@stlite/desktop 0.91.1 → 0.91.2
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.
- package/CHANGELOG.md +6 -0
- package/bin/dump_artifacts.js +1 -1
- package/build/assets/{ErrorOutline.esm-BLjkDUgO-BiXylF9Q.js → ErrorOutline.esm-CBPRrcCq-C9-TIHiy.js} +1 -1
- package/build/assets/{FileDownload.esm-BP6Yw6Mo-BauI2spi.js → FileDownload.esm-zztsCQgv-C5piFaVt.js} +1 -1
- package/build/assets/{FileHelper-BCkX4r3T-DFMmrw88.js → FileHelper-D9iak492-B1kwMP-N.js} +1 -1
- package/build/assets/{FormClearHelper-Dgu5Halt-BxICjxpW.js → FormClearHelper-B-0AN2KG-drNJ-Zdq.js} +1 -1
- package/build/assets/{Hooks-BLb3umpI-9FUxV5o-.js → Hooks-BLb3umpI-CC08A2wx.js} +1 -1
- package/build/assets/{InputInstructions-yTnPUqJo-CoOBrVL7.js → InputInstructions-w5hPdqFC-DnPj3I4S.js} +1 -1
- package/build/assets/{Particles-Dlshfcc8-CNq_pZlo.js → Particles-DQoPZNo9-BWmBxXhd.js} +1 -1
- package/build/assets/{ProgressBar-bzD0ionS-CaMxdV67.js → ProgressBar-DlHaaa-z-DdC3oXz0.js} +1 -1
- package/build/assets/{Toolbar-Ba82LOXi-C-TMlOex.js → Toolbar-Cau3SOTY-cJ6wtM04.js} +1 -1
- package/build/assets/{base-input-DjjpNP8Y-DtsTHlXD.js → base-input-D-Fvddky-3QuAUeGB.js} +1 -1
- package/build/assets/{checkbox-i_07yegq-B7N8fYE1.js → checkbox-CjcIG3na-LB8a9-d7.js} +1 -1
- package/build/assets/{createSuper-Bj1hzAgo-DTBN9Cdm.js → createSuper-B81LEHTk-DVB4ulOX.js} +1 -1
- package/build/assets/data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js +1 -0
- package/build/assets/{downloader-DcCTL3Wz-szZSaHY-.js → downloader-DcCTL3Wz-DfHnsO-D.js} +1 -1
- package/build/assets/{es6--XPcqeHG-B7r8Rb2B.js → es6--XPcqeHG-CU-P5RWV.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-D_iySM1B-C8GQUol2.js → iframeResizer.contentWindow-vAQsQkcx-DjDgPkx5.js} +1 -1
- package/build/assets/{index-GJmmE3rK-9unNgOON.js → index--hiX6Uwv-DtKO9Hld.js} +1 -1
- package/build/assets/{index-DDqIvyop-CtB9mW2T.js → index-6t9Tq-Ab-Cc_ees8I.js} +1 -1
- package/build/assets/{index-EaQvJARH-BtsSVy_Q.js → index-B5h0Xgw3-CNFqm9ip.js} +1 -1
- package/build/assets/{index-B_WoYQrI-DzwQulx6.js → index-BDD6ManL-XC9-hEWd.js} +1 -1
- package/build/assets/{index-DhLLbarZ-JEJ3GjGo.js → index-BDtR3I-m-C6v_enzF.js} +1 -1
- package/build/assets/{index-0Kn1AVK2-CFHLqZQv.js → index-BNeCf0z6-eizg-dFz.js} +1 -1
- package/build/assets/{index-DUaAy90Q-XjKFsjy5.js → index-BXbsmcnm-D0BJVs7R.js} +1 -1
- package/build/assets/index-Bt2pmgaJ-ymksNLCl.js +198 -0
- package/build/assets/{index-CvM3pTat-B8q07d1y.js → index-Bx1YyC6x-bUWv5Yyf.js} +1 -1
- package/build/assets/{index-D3uELfdo.js → index-BxpEVUJq.js} +5 -5
- package/build/assets/{index-Bo7cn_f6-DkJNz7_c.js → index-C5FPtYYS-BTTgdUI2.js} +1 -1
- package/build/assets/{index-Ct4am237-CcMxDLpd.js → index-CL9VPrGG-DvzaBWYj.js} +1 -1
- package/build/assets/{index-BhasphER-CtCV9cV8.js → index-COXlYbHo-B2m8urCs.js} +1 -1
- package/build/assets/{index-CSKWQlNk-CT5sDNrq.js → index-CR_1rzEZ-DaqWZNME.js} +1 -1
- package/build/assets/{index-C_q9gQa7-DDnyjQrF.js → index-CUH8SI0g-CgCG3Tq7.js} +1 -1
- package/build/assets/{index-CugHuPaw-BlbAJDrs.js → index-CeUKVR_x-6fYziq6X.js} +1 -1
- package/build/assets/{index-BPtHoAnG-Bw2wANqW.js → index-D4OS_mB9-BwMU_oxN.js} +1 -1
- package/build/assets/{index-CTwTw5ms-DakzaYYn.js → index-D5GvvN8r-CL05rAIV.js} +1 -1
- package/build/assets/{index-B-TfdrsK-M9kXXCZC.js → index-D6OV4wQy-CQIpYALu.js} +1 -1
- package/build/assets/{index-B3KILbqX-BzOz8wK5.js → index-D8AcUh2z-BvmWAicd.js} +1 -1
- package/build/assets/{index-kYeUTGL3-OTlUcjkG.js → index-D9Ww6wIM-CODTYNKi.js} +1 -1
- package/build/assets/{index-BxHa0gYF-QN3i1uRA.js → index-D9xjkRNt-CFe8X0f3.js} +1 -1
- package/build/assets/{index-DMjPNVEr-D5adQnea.js → index-DBM8Q3zu-1UaS0Le1.js} +1 -1
- package/build/assets/{index-X1p_3J78-Vt5ccOoW.js → index-DEKI5kx7-B8lK1On8.js} +1 -1
- package/build/assets/{index-DOzur6Jw-BNtjcqTY.js → index-DVo6TdD5-Cigl7ucs.js} +1 -1
- package/build/assets/{index-B-p8cwea-D1OIlg5n.js → index-DYssp6us-ss1M0SKX.js} +1 -1
- package/build/assets/{index-D5JbiLwX-CJBgVo_3.js → index-Da8BucgM-CDMzLZMq.js} +1 -1
- package/build/assets/{index-vYM99bZC-_qzTrUih.js → index-DbIPIRRU-UJS7GIgX.js} +1 -1
- package/build/assets/{index-Fts1z9_x-20UUj5MC.js → index-DqAvSOqr-BCGTFud5.js} +1 -1
- package/build/assets/{index-NlD3wxQH-BRnDRGJG.js → index-Ds3R2kL1-CFh_Kz3Y.js} +1 -1
- package/build/assets/{index-p-pTZlQx-8zFcur2d.js → index-FbSORAjW-Lthz52ML.js} +1 -1
- package/build/assets/{index-CATwv37T-B7vouX3Y.js → index-JJq6JoHy-CX1Omp_x.js} +1 -1
- package/build/assets/{index-D0GcWpyX--juTltdu.js → index-OAJkEMe--vGYqEFkN.js} +1 -1
- package/build/assets/{index-DmB3SAP2-X6jwpSIv.js → index-PfjJDWy5-DkldmeJ8.js} +1 -1
- package/build/assets/{index-CAzavyuT-BhYS_U-d.js → index-kgY8PEpO-BUILDAe7.js} +1 -1
- package/build/assets/{index-DU9g9Sd6-Daa3488f.js → index-oFRA4JRK-kx0e_3zA.js} +1 -1
- package/build/assets/{index-BB-Jchwk-Bom7C4Yg.js → index-vdN_5NIh-CyyygayY.js} +1 -1
- package/build/assets/{inherits-Rx5YJbse-DVYurFFp.js → inherits-DIXnBNlu-DQhXiByk.js} +1 -1
- package/build/assets/{input-BDVeiWWL-DMiIFeVV.js → input-D3V-zfyu-Ca751_uU.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-Bm8c-YGK.js → memory-B3L1Fctl-DNb7NEQl.js} +1 -1
- package/build/assets/{number-overlay-editor-BGJ9OD_Z-DIBxtO2v.js → number-overlay-editor-ChRMsdOl-C6ThLwiC.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--D3ngLCsZ.js → sandbox-ChAzL-i--FikCfyDW.js} +1 -1
- package/build/assets/{slicedToArray-DCtO1hP1-DNgLFFIn.js → slicedToArray-BPQXLGHq-C21Y2TxO.js} +1 -1
- package/build/assets/{timepicker-BTEFSiul-BiCu9n-C.js → timepicker-B0aGGgzd-sxFvpbfo.js} +1 -1
- package/build/assets/{uniqueId-DFKpdKNq-BgvPpMK3.js → uniqueId-MHj2wT7u-DPxsodx6.js} +1 -1
- package/build/assets/{useBasicWidgetState-DqA4I-I_-DtgK63iS.js → useBasicWidgetState-zjZCXhqV-BNiFnFun.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-Di5cdshf-IDsnD2RC.js → useTextInputAutoExpand-ox95UJrD-CZJQOtsK.js} +1 -1
- package/build/assets/{useUpdateUiValue-09I2_X1f-DW6jbCsf.js → useUpdateUiValue-Yj1mvLxf-DIZzUp3u.js} +1 -1
- package/build/assets/{withFullScreenWrapper-WW0e_nhm-CAjrnrPK.js → withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js} +1 -1
- package/build/assets/worker-B65uO5d3-CuVvmm9s.js +106 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/package.json +12 -11
- package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
- package/build/assets/data-grid-overlay-editor-BiH9JogL-SwK5dD6O.js +0 -1
- package/build/assets/index-GLEJ4uEg-Df22L041.js +0 -188
- package/build/assets/worker-BOuMG9lT-DqkGm1hg.js +0 -106
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-BiH9JogL-SwK5dD6O.js","assets/index-D3uELfdo.js","assets/index-Bjs8n_uU.css","assets/withFullScreenWrapper-WW0e_nhm-CAjrnrPK.js","assets/Toolbar-Ba82LOXi-C-TMlOex.js","assets/FormClearHelper-Dgu5Halt-BxICjxpW.js","assets/sprintf-D5E86llw-6tzWM3a-.js","assets/checkbox-i_07yegq-B7N8fYE1.js","assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js","assets/slicedToArray-DCtO1hP1-DNgLFFIn.js","assets/inherits-Rx5YJbse-DVYurFFp.js","assets/createSuper-Bj1hzAgo-DTBN9Cdm.js","assets/FileDownload.esm-BP6Yw6Mo-BauI2spi.js","assets/number-overlay-editor-BGJ9OD_Z-DIBxtO2v.js","assets/es6--XPcqeHG-B7r8Rb2B.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as me,r as d,c9 as Ys,ca as ln,aC as Rt,cb as qf,c8 as Xl,bX as Xf,cc as Yc,l as Zl,E as Yl,_ as Ae,cd as Zf,ce as Jc,cf as Qc,X as vr,d as Tr,cg as Yf,Q as Xa,v as Oe,c as tr,ch as Jf,ci as Qf,x as lt,cj as ed,C as ep,ck as tp,cl as np,cm as rp,cn as op,co as ip,cp as ap,cq as Ol,cr as td,aB as an,cs as lp,ct as sp,cu as up,cv as cp,cw as dp,cx as hp,cy as fp,U as ai,m as Jr,bg as Sa,bf as Ma,cz as nd,M as Ia,F as Yn,cA as pp,bu as rd,cB as gp,H as mp,e as Js,cC as vp,cD as bp,L as yp,b as od,cE as wp,cF as xp,cG as Cp,cH as kp,cI as Sp,at as id,cJ as li,cK as Qs,aH as Mp,cL as Ip,cM as Rp,cN as ad,ao as Co,cO as Ep,cP as Tp,cQ as Op,y as Za,cR as Dp,bZ as Ya,cS as Pp,cT as ld,cU as zp,be as qr,cV as Hp,cW as Lp,cX as Fp,cY as Ap,D as _p,cZ as sd,c_ as Vp,c$ as $p,aD as Bp,d0 as Wp,d1 as Np,d2 as jp,A as Gp,B as Up,d3 as Kp,d4 as qp,z as Xp,d5 as Zp,d6 as Yp,d7 as Jp,d8 as ur,$ as To,bH as Qp,d9 as eg,da as tg,db as ng,dc as rg,dd as og,de as ig,df as ag,dg as na,dh as Ko,di as At,dj as It,dk as sa,dl as yn,dm as lg,dn as sg,dp as ug,dq as cg,dr as dg,ds as hg,dt as fg,du as Gr,dv as eu,dw as tu,dx as ud,dy as cd,dz as pg,dA as Dl,dB as gg,dC as mg,dD as dd,dE as vg}from"./index-D3uELfdo.js";import{v as bg,d as yg}from"./withFullScreenWrapper-WW0e_nhm-CAjrnrPK.js";import{y as wg,X as wo}from"./Toolbar-Ba82LOXi-C-TMlOex.js";import{m as xg}from"./FormClearHelper-Dgu5Halt-BxICjxpW.js";import{_ as Cg}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as kg,y as Sg,T as Mg}from"./checkbox-i_07yegq-B7N8fYE1.js";import{a as Ig}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Rg,_ as gr}from"./slicedToArray-DCtO1hP1-DNgLFFIn.js";import{b as Eg,p as Tg,l as Og}from"./inherits-Rx5YJbse-DVYurFFp.js";import{i as Dg}from"./createSuper-Bj1hzAgo-DTBN9Cdm.js";import{o as Pg,i as zg}from"./FileDownload.esm-BP6Yw6Mo-BauI2spi.js";var hd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Yl,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});hd.displayName="Add";var fd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Yl,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});fd.displayName="Search";var pd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Yl,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});pd.displayName="Visibility";var Ja,nu;function Hg(){if(nu)return Ja;nu=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return Ja=n,Ja}var Qa,ru;function Lg(){if(ru)return Qa;ru=1;var e=Hg(),t=Zf();function n(r,o){return r!=null&&t(r,o,e)}return Qa=n,Qa}var Fg=Lg();const Ag=vr(Fg);function gd(e="This should not happen"){throw new Error(e)}function Vn(e,t="Assertion failed"){if(!e)return gd(t)}function pi(e,t){return gd(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const ou=Object.prototype.hasOwnProperty;function Do(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--&&Do(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(ou.call(e,n)&&++r&&!ou.call(t,n)||!(n in t)||!Do(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ua=null,Jl=void 0;var Y;(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"})(Y||(Y={}));var iu;(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"})(iu||(iu={}));var ca;(function(e){e.Triangle="triangle",e.Dots="dots"})(ca||(ca={}));function Ni(e){return"width"in e&&typeof e.width=="number"}async function au(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Y.Loading||e.kind===Y.Bubble||e.kind===Y.RowID||e.kind===Y.Protected||e.kind===Y.Drilldown)}function Io(e){return e.kind===Un.Marker||e.kind===Un.NewRow}function So(e){if(!ko(e)||e.kind===Y.Image)return!1;switch(e.kind){case Y.Text:case Y.Number:case Y.Markdown:case Y.Uri:case Y.Custom:case Y.Boolean:return e.readonly!==!0;default:pi(e,"A cell was passed with an invalid kind")}}function Vg(e){return Ag(e,"editor")}function Ql(e){return!(e.readonly??!1)}var Un;(function(e){e.NewRow="new-row",e.Marker="marker"})(Un||(Un={}));const da={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function el(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let lu;class et{items;constructor(t){this.items=t}static create=t=>new et(el(t));static empty=()=>lu??(lu=new et([]));static fromSingleSelection=t=>et.empty().add(t);static fromArray=t=>{if(t.length===0)return et.empty();const n=t.map(o=>[o,o+1]),r=el(n);return new et(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new et(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=el([...this.items,n]);return new et(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,s]of n.entries()){const[a,l]=s;if(a<=o&&r<=l){const u=[];a<r&&u.push([a,r]),o<l&&u.push([o,l]),n.splice(i,1,...u)}}return new et(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,o]=this.items[n];if(t>=r&&t<o)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],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);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 e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,s]=i.split("_");t[s]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},su=$g,Bg=e=>e.toUpperCase()===e,Wg=e=>t=>e.indexOf(t)===-1,md=(e,t)=>{const n={};return Object.keys(e).filter(Wg(t)).forEach(r=>{n[r]=e[r]}),n};function Ng(e,t,n){const r=md(t,n);if(!e){const o=typeof Ya=="function"?{default:Ya}:Ya;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var jg=(e,t)=>{};function Gg(e){let t="";return n=>{const r=(i,s)=>{const{as:a=e,class:l=t}=i,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Bg(a[0])):n.propsAsIs,c=Ng(u,i,["as","class"]);c.ref=s,c.className=n.atomic?su(n.class,c.className||l):su(c.className||l,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",x=typeof y=="function"?y(i):y;jg(x,n.name),g[`--${m}`]=`${x}${v}`}const f=c.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,d.createElement(e,c)):d.createElement(a,c)},o=d.forwardRef?d.forwardRef(r):(i=>{const s=md(i,["innerRef"]);return r(s,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var hn=Gg;const Ug=hn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var uu={},qo={},tl={},nl={},cu;function Kg(){return cu||(cu=1,(function(e){(function(t,n){n(e,Rt,Bp())})(nl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=s(n),i=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var R=arguments[x];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(v[E]=R[E])}return v};function l(v,x){var R={};for(var E in v)x.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E]);return R}function u(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var c=(function(){function v(x,R){for(var E=0;E<R.length;E++){var S=R[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,R,E){return R&&v(x.prototype,R),E&&v(x,E),x}})();function h(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var x=v.touches[0],R=x.pageX,E=x.pageY;return{x:R,y:E}}var S=v.screenX,P=v.screenY;return{x:S,y:P}}var y=(function(v){g(x,v);function x(){var R;u(this,x);for(var E=arguments.length,S=Array(E),P=0;P<E;P++)S[P]=arguments[P];var M=h(this,(R=x.__proto__||Object.getPrototypeOf(x)).call.apply(R,[this].concat(S)));return M._handleSwipeStart=M._handleSwipeStart.bind(M),M._handleSwipeMove=M._handleSwipeMove.bind(M),M._handleSwipeEnd=M._handleSwipeEnd.bind(M),M._onMouseDown=M._onMouseDown.bind(M),M._onMouseMove=M._onMouseMove.bind(M),M._onMouseUp=M._onMouseUp.bind(M),M._setSwiperRef=M._setSwiperRef.bind(M),M}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(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 E=w(R),S=E.x,P=E.y;this.moveStart={x:S,y:P},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var E=w(R),S=E.x,P=E.y,M=S-this.moveStart.x,C=P-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:M,y:C},R);z&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:M,deltaY:C}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,R):this.movePosition.deltaY>E&&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 E=R.className,S=R.style,P=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var M=l(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:E,style:S},M),P)}}]),x})(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})})(nl)),nl}var du;function vd(){return du||(du=1,(function(e){(function(t,n){n(e,Kg())})(tl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(tl)),tl}var Xo={},hu;function bd(){if(hu)return Xo;hu=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var e=t(Dp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,s){return i in o?Object.defineProperty(o,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[i]=s,o}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,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,s){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:s})},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 Xo.default=r,Xo}var Zo={},Yo={},fu;function qg(){if(fu)return Yo;fu=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Yo.outerWidth=e,Yo}var Jo={},pu;function es(){if(pu)return Jo;pu=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],s="translate3d",a="("+i.join(",")+")";return s+a};return Jo.default=e,Jo}var Qo={},gu;function yd(){if(gu)return Qo;gu=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(){return window};return Qo.default=e,Qo}var mu;function wd(){if(mu)return Zo;mu=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var e=l(Rt),t=s(bd()),n=qg(),r=s(es()),o=s(vd()),i=s(yd());function s(M){return M&&M.__esModule?M:{default:M}}function a(){if(typeof WeakMap!="function")return null;var M=new WeakMap;return a=function(){return M},M}function l(M){if(M&&M.__esModule)return M;if(M===null||u(M)!=="object"&&typeof M!="function")return{default:M};var C=a();if(C&&C.has(M))return C.get(M);var z={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in M)if(Object.prototype.hasOwnProperty.call(M,I)){var O=T?Object.getOwnPropertyDescriptor(M,I):null;O&&(O.get||O.set)?Object.defineProperty(z,I,O):z[I]=M[I]}return z.default=M,C&&C.set(M,z),z}function u(M){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(C){return typeof C}:u=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},u(M)}function c(){return c=Object.assign||function(M){for(var C=1;C<arguments.length;C++){var z=arguments[C];for(var T in z)Object.prototype.hasOwnProperty.call(z,T)&&(M[T]=z[T])}return M},c.apply(this,arguments)}function h(M,C){if(!(M instanceof C))throw new TypeError("Cannot call a class as a function")}function g(M,C){for(var z=0;z<C.length;z++){var T=C[z];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(M,T.key,T)}}function f(M,C,z){return C&&g(M.prototype,C),M}function p(M,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");M.prototype=Object.create(C&&C.prototype,{constructor:{value:M,writable:!0,configurable:!0}}),C&&m(M,C)}function m(M,C){return m=Object.setPrototypeOf||function(z,T){return z.__proto__=T,z},m(M,C)}function w(M){var C=x();return function(){var z=R(M),T;if(C){var I=R(this).constructor;T=Reflect.construct(z,arguments,I)}else T=z.apply(this,arguments);return y(this,T)}}function y(M,C){return C&&(u(C)==="object"||typeof C=="function")?C:v(M)}function v(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function R(M){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},R(M)}function E(M,C,z){return C in M?Object.defineProperty(M,C,{value:z,enumerable:!0,configurable:!0,writable:!0}):M[C]=z,M}var S=function(M){return M.hasOwnProperty("key")},P=(function(M){p(z,M);var C=w(z);function z(T){var I;return h(this,z),I=C.call(this,T),E(v(I),"itemsWrapperRef",void 0),E(v(I),"itemsListRef",void 0),E(v(I),"thumbsRef",void 0),E(v(I),"setItemsWrapperRef",function(O){I.itemsWrapperRef=O}),E(v(I),"setItemsListRef",function(O){I.itemsListRef=O}),E(v(I),"setThumbsRef",function(O,D){I.thumbsRef||(I.thumbsRef=[]),I.thumbsRef[D]=O}),E(v(I),"updateSizes",function(){if(!(!I.props.children||!I.itemsWrapperRef||!I.thumbsRef)){var O=e.Children.count(I.props.children),D=I.itemsWrapperRef.clientWidth,k=I.props.thumbWidth?I.props.thumbWidth:(0,n.outerWidth)(I.thumbsRef[0]),J=Math.floor(D/k),N=J<O,Z=N?O-J:0;I.setState(function(ue,te){return{itemSize:k,visibleItems:J,firstItem:N?I.getFirstItem(te.selectedItem):0,lastPosition:Z,showArrows:N}})}}),E(v(I),"handleClickItem",function(O,D,k){if(!S(k)||k.key==="Enter"){var J=I.props.onSelectItem;typeof J=="function"&&J(O,D)}}),E(v(I),"onSwipeStart",function(){I.setState({swiping:!0})}),E(v(I),"onSwipeEnd",function(){I.setState({swiping:!1})}),E(v(I),"onSwipeMove",function(O){var D=O.x;if(!I.state.itemSize||!I.itemsWrapperRef||!I.state.visibleItems)return!1;var k=0,J=e.Children.count(I.props.children),N=-(I.state.firstItem*100)/I.state.visibleItems,Z=Math.max(J-I.state.visibleItems,0),ue=-Z*100/I.state.visibleItems;N===k&&D>0&&(D=0),N===ue&&D<0&&(D=0);var te=I.itemsWrapperRef.clientWidth,X=N+100/(te/D);return I.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ge){I.itemsListRef.style[ge]=(0,r.default)(X,"%",I.props.axis)}),!0}),E(v(I),"slideRight",function(O){I.moveTo(I.state.firstItem-(typeof O=="number"?O:1))}),E(v(I),"slideLeft",function(O){I.moveTo(I.state.firstItem+(typeof O=="number"?O:1))}),E(v(I),"moveTo",function(O){O=O<0?0:O,O=O>=I.state.lastPosition?I.state.lastPosition:O,I.setState({firstItem:O})}),I.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},I}return f(z,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(T){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==T.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(T){var I=T;return T>=this.state.lastPosition&&(I=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),T<this.state.firstItem&&(I=T),I}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(I,O){var D=t.default.ITEM(!1,O===T.state.selectedItem),k={key:O,ref:function(J){return T.setThumbsRef(J,O)},className:D,onClick:T.handleClickItem.bind(T,O,T.props.children[O]),onKeyDown:T.handleClickItem.bind(T,O,T.props.children[O]),"aria-label":"".concat(T.props.labels.item," ").concat(O+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",c({},k,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,k={},J=-this.state.firstItem*(this.state.itemSize||0),N=(0,r.default)(J,"px",this.props.axis),Z=this.props.transitionTime+"ms";return k={WebkitTransform:N,MozTransform:N,MsTransform:N,OTransform:N,transform:N,msTransform:N,WebkitTransitionDuration:Z,MozTransitionDuration:Z,MsTransitionDuration:Z,OTransitionDuration:Z,transitionDuration:Z,msTransitionDuration:Z},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(o.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:k,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ue){return T.setItemsListRef(ue)},style:k},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return T.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),z})(e.Component);return Zo.default=P,E(P,"displayName","Thumbs"),E(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Zo}var ei={},vu;function Xg(){if(vu)return ei;vu=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var e=function(){return document};return ei.default=e,ei}var _n={},bu;function xd(){if(bu)return _n;bu=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.setPosition=_n.getPosition=_n.isKeyboardEvent=_n.defaultStatusFormatter=_n.noop=void 0;var e=Rt,t=n(es());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};_n.noop=r;var o=function(l,u){return"".concat(l," of ").concat(u)};_n.defaultStatusFormatter=o;var i=function(l){return l?l.hasOwnProperty("key"):!1};_n.isKeyboardEvent=i;var s=function(l,u){if(u.infiniteLoop&&++l,l===0)return 0;var c=e.Children.count(u.children);if(u.centerMode&&u.axis==="horizontal"){var h=-l*u.centerSlidePercentage,g=c-1;return l&&(l!==g||u.infiniteLoop)?h+=(100-u.centerSlidePercentage)/2:l===g&&(h+=100-u.centerSlidePercentage),h}return-l*100};_n.getPosition=s;var a=function(l,u){var c={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){c[h]=(0,t.default)(l,"%",u)}),c};return _n.setPosition=a,_n}var Zn={},yu;function Zg(){if(yu)return Zn;yu=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.fadeAnimationHandler=Zn.slideStopSwipingHandler=Zn.slideSwipeAnimationHandler=Zn.slideAnimationHandler=void 0;var e=Rt,t=r(es()),n=xd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){s(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function s(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var a=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),x=(0,t.default)(v,"%",h.axis),R=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:x,msTransform:x,OTransform:x,transform:x},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),f};Zn.slideAnimationHandler=a;var l=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,x=(0,n.getPosition)(f.selectedItem,g),R=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),E=w?h.x:h.y,S=E;x===v&&E>0&&(S=0),x===R&&E<0&&(S=0);var P=x+100/(f.itemSize/S),M=Math.abs(E)>g.swipeScrollTolerance;return g.infiniteLoop&&M&&(f.selectedItem===0&&P>-100?P-=y*100:f.selectedItem===y-1&&P<-y*100&&(P+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||M||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(P,g.axis)),M&&!f.cancelClick&&p({cancelClick:!0}),m};Zn.slideSwipeAnimationHandler=l;var u=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Zn.slideStopSwipingHandler=u;var c=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={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 g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Zn.fadeAnimationHandler=c,Zn}var wu;function Yg(){if(wu)return qo;wu=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=c(Rt),t=l(vd()),n=l(bd()),r=l(wd()),o=l(Xg()),i=l(yd()),s=xd(),a=Zg();function l(T){return T&&T.__esModule?T:{default:T}}function u(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return u=function(){return T},T}function c(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var I=u();if(I&&I.has(T))return I.get(T);var O={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in T)if(Object.prototype.hasOwnProperty.call(T,k)){var J=D?Object.getOwnPropertyDescriptor(T,k):null;J&&(J.get||J.set)?Object.defineProperty(O,k,J):O[k]=T[k]}return O.default=T,I&&I.set(T,O),O}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(I){return typeof I}:h=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},h(T)}function g(){return g=Object.assign||function(T){for(var I=1;I<arguments.length;I++){var O=arguments[I];for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&(T[D]=O[D])}return T},g.apply(this,arguments)}function f(T,I){var O=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);I&&(D=D.filter(function(k){return Object.getOwnPropertyDescriptor(T,k).enumerable})),O.push.apply(O,D)}return O}function p(T){for(var I=1;I<arguments.length;I++){var O=arguments[I]!=null?arguments[I]:{};I%2?f(Object(O),!0).forEach(function(D){C(T,D,O[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(O)):f(Object(O)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(O,D))})}return T}function m(T,I){if(!(T instanceof I))throw new TypeError("Cannot call a class as a function")}function w(T,I){for(var O=0;O<I.length;O++){var D=I[O];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,I,O){return I&&w(T.prototype,I),T}function v(T,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(I&&I.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),I&&x(T,I)}function x(T,I){return x=Object.setPrototypeOf||function(O,D){return O.__proto__=D,O},x(T,I)}function R(T){var I=P();return function(){var O=M(T),D;if(I){var k=M(this).constructor;D=Reflect.construct(O,arguments,k)}else D=O.apply(this,arguments);return E(this,D)}}function E(T,I){return I&&(h(I)==="object"||typeof I=="function")?I:S(T)}function S(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function M(T){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},M(T)}function C(T,I,O){return I in T?Object.defineProperty(T,I,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[I]=O,T}var z=(function(T){v(O,T);var I=R(O);function O(D){var k;m(this,O),k=I.call(this,D),C(S(k),"thumbsRef",void 0),C(S(k),"carouselWrapperRef",void 0),C(S(k),"listRef",void 0),C(S(k),"itemsRef",void 0),C(S(k),"timer",void 0),C(S(k),"animationHandler",void 0),C(S(k),"setThumbsRef",function(N){k.thumbsRef=N}),C(S(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),C(S(k),"setListRef",function(N){k.listRef=N}),C(S(k),"setItemsRef",function(N,Z){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Z]=N}),C(S(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),C(S(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),C(S(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),C(S(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),C(S(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),C(S(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,o.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),C(S(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var Z=k.props.axis,ue=Z==="horizontal",te={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},X=ue?te.ArrowRight:te.ArrowDown,ge=ue?te.ArrowLeft:te.ArrowUp;X===N.keyCode?k.increment():ge===N.keyCode&&k.decrement()}}),C(S(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",Z=k.itemsRef[0];if(Z){var ue=N?Z.clientWidth:Z.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),C(S(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),C(S(k),"handleClickItem",function(N,Z){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,Z),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),C(S(k),"handleOnChange",function(N,Z){e.Children.count(k.props.children)<=1||k.props.onChange(N,Z)}),C(S(k),"handleClickThumb",function(N,Z){k.props.onClickThumb(N,Z),k.moveTo(N)}),C(S(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),C(S(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),C(S(k),"onSwipeMove",function(N,Z){k.props.onSwipeMove(Z);var ue=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(S(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),C(S(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),C(S(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),C(S(k),"moveTo",function(N){if(typeof N=="number"){var Z=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?Z:0),N>Z&&(N=k.props.infiniteLoop?0:Z),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),C(S(k),"onClickNext",function(){k.increment(1)}),C(S(k),"onClickPrev",function(){k.decrement(1)}),C(S(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),C(S(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),C(S(k),"changeItem",function(N){return function(Z){(!(0,s.isKeyboardEvent)(Z)||Z.key==="Enter")&&k.moveTo(N)}}),C(S(k),"selectItem",function(N){k.setState(p({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),C(S(k),"getInitialImage",function(){var N=k.props.selectedItem,Z=k.itemsRef&&k.itemsRef[N],ue=Z&&Z.getElementsByTagName("img")||[];return ue[0]}),C(S(k),"getVariableItemHeight",function(N){var Z=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&Z&&Z.children.length){var ue=Z.children[0].getElementsByTagName("img")||[];if(ue.length>0){var te=ue[0];if(!te.complete){var X=function fe(){k.forceUpdate(),te.removeEventListener("load",fe)};te.addEventListener("load",X)}}var ge=ue[0]||Z.children[0],ae=ge.clientHeight;return ae>0?ae:null}return null});var J={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},J),k.animationHandler(D,J)),k}return y(O,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,k){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),k.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.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 D=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var k=D.getInitialImage();k&&!k.complete?k.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var k=this;return this.props.children?e.Children.map(this.props.children,function(J,N){var Z=N===k.state.selectedItem,ue=N===k.state.previousItem,te=Z&&k.state.selectedStyle||ue&&k.state.prevStyle||k.state.slideStyle||{};k.props.centerMode&&k.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:k.props.centerSlidePercentage+"%"})),k.state.swiping&&k.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var X={ref:function(ge){return k.setItemsRef(ge,N)},key:"itemKey"+N+(D?"clone":""),className:n.default.ITEM(!0,N===k.state.selectedItem,N===k.state.previousItem),onClick:k.handleClickItem.bind(k,N,J),style:te};return e.default.createElement("li",X,k.props.renderItem(J,{isSelected:N===k.state.selectedItem,isPrevious:N===k.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,k=this.props,J=k.showIndicators,N=k.labels,Z=k.renderIndicator,ue=k.children;return J?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ue,function(te,X){return Z&&Z(D.changeItem(X),X===D.state.selectedItem,X,N.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 D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var k=this.props.swipeable&&e.Children.count(this.props.children)>1,J=this.props.axis==="horizontal",N=this.props.showArrows&&e.Children.count(this.props.children)>1,Z=N&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ue=N&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),X=te.shift(),ge=te.pop(),ae={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(J){if(ae.onSwipeLeft=this.onSwipeForward,ae.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);fe.height=he||"auto"}}else ae.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ae.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ae.style=p(p({},ae.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,Z,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},k?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ae,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&X):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(oe){return D.setListRef(oe)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&X)),this.props.renderArrowNext(this.onClickNext,ue,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),O})(e.default.Component);return qo.default=z,C(z,"displayName","Carousel"),C(z,"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(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!I),onClick:T})},renderArrowNext:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!I),onClick:T})},renderIndicator:function(T,I,O,D){return e.default.createElement("li",{className:n.default.DOT(I),onClick:T,onKeyDown:T,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(O+1)})},renderItem:function(T){return T},renderThumbs:function(T){var I=e.Children.map(T,function(O){var D=O;if(O.type!=="img"&&(D=e.Children.toArray(O.props.children).find(function(k){return k.type==="img"})),!!D)return D});return I.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):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}),qo}var Jg={};function Qg(){return Jg}var xu;function em(){return xu||(xu=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=o(Yg()),n=Qg(),r=o(wd());function o(i){return i&&i.__esModule?i:{default:i}}})(uu)),uu}var tm=em(),rl,Cu;function nm(){if(Cu)return rl;Cu=1;var e=xp(),t=function(){return e.Date.now()};return rl=t,rl}var ol,ku;function Cd(){if(ku)return ol;ku=1;var e=Jc(),t=nm(),n=Qc(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,u){var c,h,g,f,p,m,w=0,y=!1,v=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(y=!!u.leading,v="maxWait"in u,g=v?o(n(u.maxWait)||0,l):g,x="trailing"in u?!!u.trailing:x);function R(O){var D=c,k=h;return c=h=void 0,w=O,f=a.apply(k,D),f}function E(O){return w=O,p=setTimeout(M,l),y?R(O):f}function S(O){var D=O-m,k=O-w,J=l-D;return v?i(J,g-k):J}function P(O){var D=O-m,k=O-w;return m===void 0||D>=l||D<0||v&&k>=g}function M(){var O=t();if(P(O))return C(O);p=setTimeout(M,S(O))}function C(O){return p=void 0,x&&c?R(O):(c=h=void 0,f)}function z(){p!==void 0&&clearTimeout(p),w=0,c=m=h=p=void 0}function T(){return p===void 0?f:C(t())}function I(){var O=t(),D=P(O);if(c=arguments,h=this,m=O,D){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(M,l),R(m)}return p===void 0&&(p=setTimeout(M,l)),f}return I.cancel=z,I.flush=T,I}return ol=s,ol}var rm=Cd();const kd=vr(rm);function Sn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{i.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:o}),()=>{s.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function Ir(e,t){return e===void 0?void 0:t}const om=Math.PI;function Su(e){return e*om/180}const Sd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Md=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Id=(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,ts=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.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"}),d.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"}))},im=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function am(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const s=d.useRef(kd(a=>{i.current&&o(a)},n));return d.useLayoutEffect(()=>{i.current&&s.current(()=>e())},t),r}const lm="֑-߿יִ-﷽ﹰ-ﻼ",sm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",um=new RegExp("^[^"+sm+"]*["+lm+"]");function ns(e){return um.test(e)?"rtl":"not-rtl"}let ji;function Pl(){if(typeof document>"u")return 0;if(ji!==void 0)return ji;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(),ji=n-r,ji}const Ur=Symbol();function cm(e){const t=d.useRef([Ur,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const l=t.current[0];l!==Ur&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ur&&o({}),r(u=>typeof a=="function"?a(l===Ur?u:l):a),t.current[0]=Ur)},[]),s=d.useCallback(()=>{t.current[0]=Ur,o({})},[]);return[t.current[0]===Ur?n:t.current[0],i,s]}function Ed(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 dm(e){const t=d.useRef(e);return Do(e,t.current)||(t.current=e),t.current}const hm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const s=i.length>1;return d.createElement(Ug,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(tm.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},i.map(a=>{const l=o?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ts,null)))};function Td(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Qr=Td();function fm(e){Qr=e}const Od=/[&<>"']/,pm=new RegExp(Od.source,"g"),Dd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,gm=new RegExp(Dd.source,"g"),mm={"&":"&","<":"<",">":">",'"':""","'":"'"},Mu=e=>mm[e];function wn(e,t){if(t){if(Od.test(e))return e.replace(pm,Mu)}else if(Dd.test(e))return e.replace(gm,Mu);return e}const vm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pd(e){return e.replace(vm,(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 bm=/(^|[^\[])\^/g;function _t(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(bm,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const ym=/[^\w:]/g,wm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Iu(e,t,n){if(e){let r;try{r=decodeURIComponent(Pd(n)).replace(ym,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!wm.test(n)&&(n=Sm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Gi={},xm=/^[^:]+:\/*[^/]*$/,Cm=/^([^:]+:)[\s\S]*$/,km=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Sm(e,t){Gi[" "+e]||(xm.test(e)?Gi[" "+e]=e+"/":Gi[" "+e]=ra(e,"/",!0)),e=Gi[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Cm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(km,"$1")+t:e+t}const ha={exec:function(){}};function Ru(e,t){const n=e.replace(/\|/g,(i,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=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(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ra(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function Mm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function Im(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 Eu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Tu(e,t,n,r){const o=t.href,i=t.title?wn(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:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:wn(s)}}function Rm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
|
-
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
|
|
4
|
-
`)}class rs{constructor(t){this.options=t||Qr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ra(r,`
|
|
5
|
-
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Rm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=ra(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.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,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,o,i,s,a,l,u,c,h,g,f,p,m=n[1].trim();const w=m.length>1,y={type:"list",raw:"",ordered:w,start:w?+m.slice(0,-1):"",loose:!1,items:[]};m=w?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=w?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
|
6
|
-
`,1)[0].replace(/^\t+/,R=>" ".repeat(3*R.length)),h=t.split(`
|
|
7
|
-
`,1)[0],this.options.pedantic?(s=2,f=c.trimLeft()):(s=n[2].search(/[^ ]/),s=s>4?1:s,f=c.slice(s),s+=n[1].length),l=!1,!c&&/^ *$/.test(h)&&(r+=h+`
|
|
8
|
-
`,t=t.substring(h.length+1),p=!0),!p){const R=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),S=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),P=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(g=t.split(`
|
|
9
|
-
`,1)[0],h=g,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(S.test(h)||P.test(h)||R.test(h)||E.test(t)));){if(h.search(/[^ ]/)>=s||!h.trim())f+=`
|
|
10
|
-
`+h.slice(s);else{if(l||c.search(/[^ ]/)>=4||S.test(c)||P.test(c)||E.test(c))break;f+=`
|
|
11
|
-
`+h}!l&&!h.trim()&&(l=!0),r+=g+`
|
|
12
|
-
`,t=t.substring(g.length+1),c=h.slice(s)}}y.loose||(u?y.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(f),o&&(i=o[0]!=="[ ] ",f=f.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:r,task:!!o,checked:i,loose:!1,text:f}),y.raw+=r}y.items[y.items.length-1].raw=r.trimRight(),y.items[y.items.length-1].text=f.trimRight(),y.raw=y.raw.trimRight();const x=y.items.length;for(a=0;a<x;a++)if(this.lexer.state.top=!1,y.items[a].tokens=this.lexer.blockTokens(y.items[a].text,[]),!y.loose){const R=y.items[a].tokens.filter(S=>S.type==="space"),E=R.length>0&&R.some(S=>/\n.*\n/.test(S.raw));y.loose=E}if(y.loose)for(a=0;a<x;a++)y.items[a].loose=!0;return y}}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 o=this.options.sanitizer?this.options.sanitizer(n[0]):wn(n[0]);r.type="paragraph",r.text=o,r.tokens=this.lexer.inline(o)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=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:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:Ru(n[1]).map(o=>({text:o})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
13
|
-
`):[]};if(r.header.length===r.align.length){r.raw=n[0];let o=r.align.length,i,s,a,l;for(i=0;i<o;i++)/^ *-+: *$/.test(r.align[i])?r.align[i]="right":/^ *:-+: *$/.test(r.align[i])?r.align[i]="center":/^ *:-+ *$/.test(r.align[i])?r.align[i]="left":r.align[i]=null;for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=Ru(r.rows[i],r.header.length).map(u=>({text:u}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;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:wn(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]):wn(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=ra(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=Mm(n[2],"()");if(s>-1){const a=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),Tu(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.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 o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Tu(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(r===""||this.rules.inline.punctuation.exec(r))){const s=o[0].length-1;let a,l,u=s,c=0;const h=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,n=n.slice(-1*t.length+s);(o=h.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){u+=l;continue}else if((o[5]||o[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+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const f=g.slice(2,-2);return{type:"strong",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=wn(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 o,i;return r[2]==="@"?(o=wn(this.options.mangle?n(r[1]):r[1]),i="mailto:"+o):(o=wn(r[1]),i=o),{type:"link",raw:r[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let o,i;if(r[2]==="@")o=wn(this.options.mangle?n(r[0]):r[0]),i="mailto:"+o;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(s!==r[0]);o=wn(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):wn(r[0]):r[0]:o=wn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:o}}}}const _e={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:ha,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;_e.def=_t(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex();_e.bullet=/(?:[*+-]|\d{1,9}[.)])/;_e.listItemStart=_t(/^( *)(bull) */).replace("bull",_e.bullet).getRegex();_e.list=_t(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex();_e._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";_e._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;_e.html=_t(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();_e.paragraph=_t(_e._paragraph).replace("hr",_e.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",_e._tag).getRegex();_e.blockquote=_t(_e.blockquote).replace("paragraph",_e.paragraph).getRegex();_e.normal={..._e};_e.gfm={..._e.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};_e.gfm.table=_t(_e.gfm.table).replace("hr",_e.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",_e._tag).getRegex();_e.gfm.paragraph=_t(_e._paragraph).replace("hr",_e.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",_e.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",_e._tag).getRegex();_e.pedantic={..._e.normal,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:ha,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^
|
|
15
|
-
]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ha,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:ha,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";be.punctuation=_t(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex();be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;be.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;be._comment=_t(_e._comment).replace("(?:-->|$)","-->").getRegex();be.emStrong.lDelim=_t(be.emStrong.lDelim).replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimAst=_t(be.emStrong.rDelimAst,"g").replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimUnd=_t(be.emStrong.rDelimUnd,"g").replace(/punct/g,be._punctuation).getRegex();be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;be._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])?)+(?![-_])/;be.autolink=_t(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex();be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;be.tag=_t(be.tag).replace("comment",be._comment).replace("attribute",be._attribute).getRegex();be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;be.link=_t(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex();be.reflink=_t(be.reflink).replace("label",be._label).replace("ref",_e._label).getRegex();be.nolink=_t(be.nolink).replace("ref",_e._label).getRegex();be.reflinkSearch=_t(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex();be.normal={...be};be.pedantic={...be.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:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()};be.gfm={...be.normal,escape:_t(be.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.!#$%&'*+\/=?_`{\|}~-]+@)))/};be.gfm.url=_t(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex();be.breaks={...be.gfm,br:_t(be.br).replace("{2,}","*").getRegex(),text:_t(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function Em(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 Ou(e){let t="",n,r;const o=e.length;for(n=0;n<o;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Or{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Qr,this.options.tokenizer=this.options.tokenizer||new rs,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:_e.normal,inline:be.normal};this.options.pedantic?(n.block=_e.pedantic,n.inline=be.pedantic):this.options.gfm&&(n.block=_e.gfm,this.options.breaks?n.inline=be.breaks:n.inline=be.gfm),this.tokenizer.rules=n}static get rules(){return{block:_e,inline:be}}static lex(t,n){return new Or(n).lex(t)}static lexInline(t,n){return new Or(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
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,o,i,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
|
-
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
18
|
-
`+r.raw,o.text+=`
|
|
19
|
-
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
20
|
-
`+r.raw,o.text+=`
|
|
21
|
-
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
|
|
22
|
-
`+r.raw,o.text+=`
|
|
23
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
|
|
24
|
-
`+r.raw,o.text+=`
|
|
25
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.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,o,i,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)+"["+Eu("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)+"["+Eu("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),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.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),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.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,Ou)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,Ou))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(function(f){g=f.call({lexer:this},h),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(i=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(i,Em)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.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 os{constructor(t){this.options=t||Qr}code(t,n,r){const o=(n||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(r=!0,t=i)}return t=t.replace(/\n$/,"")+`
|
|
26
|
-
`,o?'<pre><code class="'+this.options.langPrefix+wn(o)+'">'+(r?t:wn(t,!0))+`</code></pre>
|
|
27
|
-
`:"<pre><code>"+(r?t:wn(t,!0))+`</code></pre>
|
|
28
|
-
`}blockquote(t){return`<blockquote>
|
|
29
|
-
${t}</blockquote>
|
|
30
|
-
`}html(t){return t}heading(t,n,r,o){if(this.options.headerIds){const i=this.options.headerPrefix+o.slug(r);return`<h${n} id="${i}">${t}</h${n}>
|
|
31
|
-
`}return`<h${n}>${t}</h${n}>
|
|
32
|
-
`}hr(){return this.options.xhtml?`<hr/>
|
|
33
|
-
`:`<hr>
|
|
34
|
-
`}list(t,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
|
|
35
|
-
`+t+"</"+o+`>
|
|
36
|
-
`}listitem(t){return`<li>${t}</li>
|
|
37
|
-
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
|
|
38
|
-
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
39
|
-
<thead>
|
|
40
|
-
`+t+`</thead>
|
|
41
|
-
`+n+`</table>
|
|
42
|
-
`}tablerow(t){return`<tr>
|
|
43
|
-
${t}</tr>
|
|
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 o='<a href="'+t+'"';return n&&(o+=' title="'+n+'"'),o+=">"+r+"</a>",o}image(t,n,r){if(t=Iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let o=`<img src="${t}" alt="${r}"`;return n&&(o+=` title="${n}"`),o+=this.options.xhtml?"/>":">",o}text(t){return t}}class zd{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 Hd{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,o=0;if(this.seen.hasOwnProperty(r)){o=this.seen[t];do o++,r=t+"-"+o;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=o,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Dr{constructor(t){this.options=t||Qr,this.options.renderer=this.options.renderer||new os,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new zd,this.slugger=new Hd}static parse(t,n){return new Dr(n).parse(t)}static parseInline(t,n){return new Dr(n).parseInline(t)}parse(t,n=!0){let r="",o,i,s,a,l,u,c,h,g,f,p,m,w,y,v,x,R,E,S;const P=t.length;for(o=0;o<P;o++){if(f=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(S=this.options.extensions.renderers[f.type].call({parser:this},f),S!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type))){r+=S||"";continue}switch(f.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(f.tokens),f.depth,Pd(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(f.text,f.lang,f.escaped);continue}case"table":{for(h="",c="",a=f.header.length,i=0;i<a;i++)c+=this.renderer.tablecell(this.parseInline(f.header[i].tokens),{header:!0,align:f.align[i]});for(h+=this.renderer.tablerow(c),g="",a=f.rows.length,i=0;i<a;i++){for(u=f.rows[i],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:f.align[s]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(h,g);continue}case"blockquote":{g=this.parse(f.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=f.ordered,m=f.start,w=f.loose,a=f.items.length,g="",i=0;i<a;i++)v=f.items[i],x=v.checked,R=v.task,y="",v.task&&(E=this.renderer.checkbox(x),w?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=E+" "+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=E+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:E}):y+=E),y+=this.parse(v.tokens,w),g+=this.renderer.listitem(y,R,x);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(f.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(g=f.tokens?this.parseInline(f.tokens):f.text;o+1<P&&t[o+1].type==="text";)f=t[++o],g+=`
|
|
46
|
-
`+(f.tokens?this.parseInline(f.tokens):f.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const M='Token with "'+f.type+'" type was not found.';if(this.options.silent){console.error(M);return}else throw new Error(M)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",o,i,s;const a=t.length;for(o=0;o<a;o++){if(i=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(s=this.options.extensions.renderers[i.type].call({parser:this},i),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))){r+=s||"";continue}switch(i.type){case"escape":{r+=n.text(i.text);break}case"html":{r+=n.html(i.text);break}case"link":{r+=n.link(i.href,i.title,this.parseInline(i.tokens,n));break}case"image":{r+=n.image(i.href,i.title,i.text);break}case"strong":{r+=n.strong(this.parseInline(i.tokens,n));break}case"em":{r+=n.em(this.parseInline(i.tokens,n));break}case"codespan":{r+=n.codespan(i.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(i.tokens,n));break}case"text":{r+=n.text(i.text);break}default:{const l='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return r}}class zl{constructor(t){this.options=t||Qr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function Tm(e,t,n){return r=>{if(r.message+=`
|
|
47
|
-
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+wn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(o);if(n){n(null,o);return}return o}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function Ld(e,t){return(n,r,o)=>{typeof r=="function"&&(o=r,r=null);const i={...r};r={...Be.defaults,...i};const s=Tm(r.silent,r.async,o);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(Im(r),r.hooks&&(r.hooks.options=r),o){const a=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(h){return s(h)}const u=function(h){let g;if(!h)try{r.walkTokens&&Be.walkTokens(l,r.walkTokens),g=t(l,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(f){h=f}return r.highlight=a,h?s(h):o(null,g)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;Be.walkTokens(l,function(h){h.type==="code"&&(c++,setTimeout(()=>{a(h.text,h.lang,function(g,f){if(g)return u(g);f!=null&&f!==h.text&&(h.text=f,h.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(Be.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&&Be.walkTokens(a,r.walkTokens);let l=t(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return s(a)}}}function Be(e,t,n){return Ld(Or.lex,Dr.parse)(e,t,n)}Be.options=Be.setOptions=function(e){return Be.defaults={...Be.defaults,...e},fm(Be.defaults),Be};Be.getDefaults=Td;Be.defaults=Qr;Be.use=function(...e){const t=Be.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Be.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){const o=Be.defaults.renderer||new os;for(const i in n.renderer){const s=o[i];o[i]=(...a)=>{let l=n.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.renderer=o}if(n.tokenizer){const o=Be.defaults.tokenizer||new rs;for(const i in n.tokenizer){const s=o[i];o[i]=(...a)=>{let l=n.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.tokenizer=o}if(n.hooks){const o=Be.defaults.hooks||new zl;for(const i in n.hooks){const s=o[i];zl.passThroughHooks.has(i)?o[i]=a=>{if(Be.defaults.async)return Promise.resolve(n.hooks[i].call(o,a)).then(u=>s.call(o,u));const l=n.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=n.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.hooks=o}if(n.walkTokens){const o=Be.defaults.walkTokens;r.walkTokens=function(i){let s=[];return s.push(n.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}Be.setOptions(r)})};Be.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Be,r)),r.type){case"table":{for(const o of r.header)n=n.concat(Be.walkTokens(o.tokens,t));for(const o of r.rows)for(const i of o)n=n.concat(Be.walkTokens(i.tokens,t));break}case"list":{n=n.concat(Be.walkTokens(r.items,t));break}default:Be.defaults.extensions&&Be.defaults.extensions.childTokens&&Be.defaults.extensions.childTokens[r.type]?Be.defaults.extensions.childTokens[r.type].forEach(function(o){n=n.concat(Be.walkTokens(r[o],t))}):r.tokens&&(n=n.concat(Be.walkTokens(r.tokens,t)))}return n};Be.parseInline=Ld(Or.lexInline,Dr.parseInline);Be.Parser=Dr;Be.parser=Dr.parse;Be.Renderer=os;Be.TextRenderer=zd;Be.Lexer=Or;Be.lexer=Or.lex;Be.Tokenizer=rs;Be.Slugger=Hd;Be.Hooks=zl;Be.parse=Be;Be.options;Be.setOptions;Be.use;Be.walkTokens;Be.parseInline;Dr.parse;Or.lex;const Om=hn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Dm extends Rt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:o}=n,i=Be(r),s=document.createRange();s.selectNodeContents(t),s.deleteContents();let a=o?.(i);if(a===void 0){const u=document.createElement("template");u.innerHTML=i,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(),Rt.createElement(Om,{ref:this.containerRefHook})}}const Pm=hn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),zm=hn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Hm=hn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Du=0;const eo=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:s,...a}=e,{onChange:l,className:u}=a,c=d.useRef(null),h=n??"";Vn(l!==void 0,"GrowingEntry must be a controlled input area");const[g]=d.useState(()=>"input-box-"+(Du=(Du+1)%1e7));d.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=h.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{if(s!==void 0){const p=typeof s=="number"?[s,null]:s;c.current?.setSelectionRange(p[0],p[1])}},[s]);const f=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||r?.(p)},[i,r]);return d.createElement(Hm,{className:"gdg-growing-entry"},d.createElement(zm,{className:u},h+`
|
|
48
|
-
`),d.createElement(Pm,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:f,value:h,placeholder:t,dir:"auto"}))},il={};let Sr=null;function Lm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function gi(e){const t=e.toLowerCase().trim();if(il[t]!==void 0)return il[t];Sr=Sr||Lm(),Sr.style.color="#000",Sr.style.color=t;const n=getComputedStyle(Sr).color;Sr.style.color="#fff",Sr.style.color=t;const r=getComputedStyle(Sr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),il[t]=o,o}function Yr(e,t){const[n,r,o]=gi(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Pu=new Map;function zu(e,t){const n=`${e}-${t}`,r=Pu.get(n);if(r!==void 0)return r;const o=$n(e,t);return Pu.set(n,o),o}function $n(e,t){if(t===void 0)return e;const[n,r,o,i]=gi(e);if(i===1)return e;const[s,a,l,u]=gi(t),c=i+u*(1-i),h=(i*n+u*s*(1-i))/c,g=(i*r+u*a*(1-i))/c,f=(i*o+u*l*(1-i))/c;return`rgba(${h}, ${g}, ${f}, ${c})`}function Hl(e){if(e==="transparent")return 0;function t(i){const s=i/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,o]=gi(e);return .2126*t(n)+.7152*t(r)+.0722*t(o)}var Mo=new Map,Ro=new Map,Ll=new Map;function Fm(){Mo.clear(),Ll.clear(),Ro.clear()}function Am(e,t,n,r,o){var i,s,a;let l=0,u={};for(let h of e)l+=(i=n.get(h))!=null?i:o,u[h]=((s=u[h])!=null?s:0)+1;let c=t-l;for(let h of Object.keys(u)){let g=u[h],f=(a=n.get(h))!=null?a:o,p=f*g/l,m=c*p*r/g,w=f+m;n.set(h,w)}}function _m(e,t){var n;let r=new Map,o=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),o+=c}let i=o/r.size,s=3,a=(t/i+s)/(s+1),l=r.keys();for(let u of l)r.set(u,((n=r.get(u))!=null?n:i)*a);return r}function ci(e,t,n,r){var o,i;let s=Ro.get(n);if(r&&s!==void 0&&s.count>2e4){let u=Ll.get(n);if(u===void 0&&(u=_m(e,s.size),Ll.set(n,u)),s.count>5e5){let h=0;for(let g of t)h+=(o=u.get(g))!=null?o:s.size;return h*1.01}let c=e.measureText(t);return Am(t,c.width,u,Math.max(.05,1-s.count/2e5),s.size),Ro.set(n,{count:s.count+t.length,size:s.size}),c.width}let a=e.measureText(t),l=a.width/t.length;if(((i=s?.count)!=null?i:0)>2e4)return a.width;if(s===void 0)Ro.set(n,{count:t.length,size:l});else{let u=l-s.size,c=t.length/(s.count+t.length),h=s.size+u*c;Ro.set(n,{count:s.count+t.length,size:h})}return a.width}function Vm(e,t,n,r,o,i,s,a){if(t.length<=1)return t.length;if(o<n)return-1;let l=Math.floor(n/o*i),u=ci(e,t.slice(0,Math.max(0,l)),r,s);if(u!==n)if(u<n){for(;u<n;)l++,u=ci(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=ci(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 $m(e,t,n,r,o,i){let s=`${t}_${n}_${r}px`,a=Mo.get(s);if(a!==void 0)return a;if(r<=0)return[];let l=[],u=t.split(`
|
|
49
|
-
`),c=Ro.get(n),h=c===void 0?t.length:r/c.size*1.5,g=o&&c!==void 0&&c.count>2e4;for(let f of u){let p=ci(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h);if(p<=r)l.push(f);else{for(;p>r;){let w=Vm(e,f,r,n,p,m,g),y=f.slice(0,Math.max(0,w));f=f.slice(y.length),l.push(y),p=ci(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h)}p>0&&l.push(f)}}return l=l.map((f,p)=>p===0?f.trimEnd():f.trim()),Mo.set(s,l),Mo.size>500&&Mo.delete(Mo.keys().next().value),l}function Bm(e,t){return Rt.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 Wm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(di(e.current.cell,t))return!0;const o=[e.current.range,...e.current.rangeStack];for(const i of o)if(n>=i.x&&n<i.x+i.width&&r>=i.y&&r<i.y+i.height)return!0}return!1}function mi(e,t){return(e??"")===(t??"")}function Nm(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 di(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Ad(e){return[e.x+e.width-1,e.y+e.height-1]}function Hu(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,s=n.y+n.height-1,[a,l]=e;if(l<i||l>s)return!1;if(t.span===void 0)return a>=r&&a<=o;const[u,c]=t.span;return u>=r&&u<=o||c>=r&&u<=o||u<r&&c>o}function jm(e,t,n,r){let o=0;if(n.current===void 0)return o;const i=n.current.range;(r||i.height*i.width>1)&&Hu(e,t,i)&&o++;for(const s of n.current.rangeStack)Hu(e,t,s)&&o++;return o}function _d(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,s)=>({...i,sticky:e[s].sticky})),n=r}return n}function Po(e,t){let n=0;const r=_d(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(i.sticky)n+=i.width;else break}return n}function to(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Fl(e,t,n,r,o){const i=_d(e,r),s=[];for(const u of i)if(u.sticky)s.push(u);else break;if(s.length>0)for(const u of s)n-=u.width;let a=t,l=o??0;for(;l<=n&&a<i.length;)l+=i[a].width,a++;for(let u=t;u<a;u++){const c=i[u];c.sticky||s.push(c)}return s}function Gm(e,t,n){let r=0;for(const o of t){const i=o.sticky?r:r+(n??0);if(e<=i+o.width)return o.sourceIndex;r+=o.width}return-1}function Um(e,t,n,r,o,i,s,a,l,u){const c=r+o;if(n&&e<=o)return-2;if(e<=c)return-1;let h=t;for(let p=0;p<u;p++){const m=i-1-p,w=typeof s=="number"?s:s(m);if(h-=w,e>=h)return m}const g=i-u,f=e-(l??0);if(typeof s=="number"){const p=Math.floor((f-c)/s)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const w=s(m);if(f<=p+w)return m;p+=w}return}}let oa=0,hi={};const Km=typeof window>"u";async function qm(){Km||document?.fonts?.ready===void 0||(await document.fonts.ready,oa=0,hi={},Fm())}qm();function Vd(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function zr(e,t,n,r="middle"){const o=Vd(e,t,r,n);let i=hi[o];return i===void 0&&(i=t.measureText(e),hi[o]=i,oa++),oa>1e4&&(hi={},oa=0),i}function $d(e,t){const n=Vd(e,void 0,"middle",t);return hi[n]}function nr(e,t){return typeof t!="string"&&(t=t.baseFontFull),Xm(e,t)}function Lu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const Fu=[];function Xm(e,t){for(const o of Fu)if(o.key===t)return o.val;const n=Lu(e,"alphabetic"),r=-(Lu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Fu.push({key:t,val:r}),r}function Zm(e,t,n,r,o,i){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 h=1-u/c;s.globalAlpha=h,s.fillStyle=l.bgSearchResult,s.fillRect(a.x+1,a.y+1,a.width-(o?2:1),a.height-(i?2:1)),s.globalAlpha=1,r!==void 0&&(r.fillStyle=l.bgSearchResult)}return u<c}function Ci(e,t,n){const{ctx:r,theme:o}=e,i=t??{},s=n??o.textDark;return s!==i.fillStyle&&(r.fillStyle=s,i.fillStyle=s),i}function is(e,t,n,r,o){const{rect:i,ctx:s,theme:a}=e;s.fillStyle=a.textDark,sr({ctx:s,rect:i,theme:a},t,n,r,o)}function Bd(e,t,n,r,o,i,s,a,l){l==="right"?e.fillText(t,n+o-(a.cellHorizontalPadding+.5),r+i/2+s):l==="center"?e.fillText(t,n+o/2,r+i/2+s):e.fillText(t,n+a.cellHorizontalPadding+.5,r+i/2+s)}function as(e,t){const n=zr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Ym(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 Jm(e,t,n,r,o,i,s,a,l,u){const c=a.baseFontFull,h=$m(e,t,c,o-a.cellHorizontalPadding*2,u??!1),g=as(e,c),f=a.lineHeight*g,p=g+f*(h.length-1),m=p+a.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const w=r+i/2-p/2;let y=Math.max(r+a.cellVerticalPadding,w);for(const v of h)if(Bd(e,v,n,y,o,g,s,a,l),y+=f,y>r+i)break;m&&e.restore()}function sr(e,t,n,r,o){const{ctx:i,rect:s,theme:a}=e,{x:l,y:u,width:c,height:h}=s;r=r??!1,r||(t=Ym(t,c));const g=nr(i,a),f=ns(t)==="rtl";if(n===void 0&&f&&(n="right"),f&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?Jm(i,t,l,u,c,h,g,a,n,o):Bd(i,t,l,u,c,h,g,a,n),p&&(i.textAlign="start"),f&&(i.direction="inherit")}}function er(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.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 e0(e,t,n){const r=function(a,l){const u=l.x-a.x,c=l.y-a.y,h=Math.sqrt(u*u+c*c),g=u/h,f=c/h;return{x:u,y:l.y-a.y,len:h,nx:g,ny:f,ang:Math.atan2(f,g)}};let o;const i=t.length;let s=t[i-1];for(let a=0;a<i;a++){let l=t[a%i];const u=t[(a+1)%i],c=r(l,s),h=r(l,u),g=c.nx*h.ny-c.ny*h.nx,f=c.nx*h.nx-c.ny*-h.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,w=!1;f<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,w=!0):p>0&&(m=-1,w=!0),o=l.radius!==void 0?l.radius:n;const y=p/2;let v=Math.abs(Math.cos(y)*o/Math.sin(y)),x;v>Math.min(c.len/2,h.len/2)?(v=Math.min(c.len/2,h.len/2),x=Math.abs(v*Math.sin(y)/Math.cos(y))):x=o;let R=l.x+h.nx*v,E=l.y+h.ny*v;R+=-h.ny*x*m,E+=h.nx*x*m,e.arc(R,E,x,c.ang+Math.PI/2*m,h.ang-Math.PI/2*m,w),s=l,l=u}e.closePath()}function Al(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p){const m={x:0,y:i+u,width:0,height:0};if(e>=f.length||t>=c||t<-2||e<0)return m;const w=i-o;if(e>=h){const y=s>e?-1:1,v=Po(f);m.x+=v+l;for(let x=s;x!==e;x+=y)m.x+=f[y===1?x:x-1].width*y}else for(let y=0;y<e;y++)m.x+=f[y].width;if(m.width=f[e].width+1,t===-1)m.y=o,m.height=w;else if(t===-2){m.y=0,m.height=o;let y=e;const v=f[e].group,x=f[e].sticky;for(;y>0&&mi(f[y-1].group,v)&&f[y-1].sticky===x;){const E=f[y-1];m.x-=E.width,m.width+=E.width,y--}let R=e;for(;R+1<f.length&&mi(f[R+1].group,v)&&f[R+1].sticky===x;){const E=f[R+1];m.width+=E.width,R++}if(!x){const E=Po(f),S=m.x-E;S<0&&(m.x-=S,m.width+=S),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let y=c-t;for(m.y=r;y>0;){const v=t+y-1;m.height=typeof p=="number"?p:p(v),m.y-=m.height,y--}m.height+=1}else{const y=a>t?-1:1;if(typeof p=="number"){const v=t-a;m.y+=v*p}else for(let v=a;v!==t;v+=y)m.y+=p(v)*y;m.height=(typeof p=="number"?p:p(t))+1}return m}const ls=1<<21;function Qn(e,t){return(t+2)*ls+e}function Wd(e){return e%ls}function ss(e){return Math.floor(e/ls)-2}function us(e){const t=Wd(e),n=ss(e);return[t,n]}class Nd{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=Wd(t),r=ss(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,s=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&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&&Do(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class t0 extends Nd{cache=new Map;setValue=(t,n)=>{this.cache.set(Qn(t[0],t[1]),n)};getValue=t=>this.cache.get(Qn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class fi{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Qn(n[0],n[1])))}add(t){this.cells.add(Qn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Qn(t[0],t[1]))}remove(t){this.cells.delete(Qn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ss(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(Qn(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 us(t)}}function n0(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 jd={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 Gd(){return jd}const Ud=Rt.createContext(jd);function Kd(){return Rt.useContext(Ud)}function mr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(o==="bgCell"?n[o]=$n(r[o],n[o]):n[o]=r[o]);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 _l=150;function r0(e,t,n,r){return r(t)?.measure?.(e,t,n)??_l}function qd(e,t,n,r,o,i,s,a,l){let u=0;const c=o===void 0?[]:o.map(f=>{const p=r0(e,f[r],t,l);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let f=0;for(const m of c)f+=m;const p=f/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const h=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=h;const g=Math.max(Math.ceil(i),Math.min(Math.floor(s),Math.ceil(u)));return{...n,width:g}}function o0(e,t,n,r,o,i,s,a,l){const u=d.useRef(t),c=d.useRef(n),h=d.useRef(s);u.current=t,c.current=n,h.current=s;const[g,f]=d.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})]},[]);d.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=d.useRef({}),m=d.useRef(),[w,y]=d.useState();return d.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(Ni))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),R=0;x<u.current&&x>1&&(x--,R=1);const E={x:0,y:0,width:e.length,height:Math.min(u.current,x)},S={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const P=v(E,l.signal),M=R>0?v(S,l.signal):void 0;let C;typeof P=="object"?C=P:C=await au(P),M!==void 0&&(typeof M=="object"?C=[...C,...M]:C=[...C,...await au(M)]),m.current=e,y(C)})()},[l.signal,e]),d.useMemo(()=>{let v=e.every(Ni)?e:f===null?e.map(S=>Ni(S)?S:{...S,width:_l}):(f.font=h.current.baseFontFull,e.map((S,P)=>{if(Ni(S))return S;if(p.current[S.id]!==void 0)return{...S,width:p.current[S.id]};if(w===void 0||m.current!==e||S.id===void 0)return{...S,width:_l};const M=qd(f,s,S,P,w,o,i,!0,a);return p.current[S.id]=M.width,M})),x=0,R=0;const E=[];for(const[S,P]of v.entries())x+=P.width,P.grow!==void 0&&P.grow>0&&(R+=P.grow,E.push(S));if(x<r&&E.length>0){const S=[...v],P=r-x;let M=P;for(let C=0;C<E.length;C++){const z=E[C],T=(v[z].grow??0)/R,I=C===E.length-1?M:Math.min(M,Math.floor(P*T));S[z]={...v[z],growOffset:I,width:v[z].width+I},M-=I}v=S}return{sizedColumns:v,nonGrowWidth:x}},[r,e,f,w,s,o,i,a])}var al,Au;function i0(){if(Au)return al;Au=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 al=e,al}var ll,_u;function a0(){if(_u)return ll;_u=1;var e=i0(),t=Qc();function n(r,o,i){return i===void 0&&(i=o,o=void 0),i!==void 0&&(i=t(i),i=i===i?i:0),o!==void 0&&(o=t(o),o=o===o?o:0),e(t(r),o,i)}return ll=n,ll}var l0=a0();const Gn=vr(l0);var sl,Vu;function s0(){if(Vu)return sl;Vu=1;function e(){}return sl=e,sl}var ul,$u;function u0(){if($u)return ul;$u=1;var e=Pp(),t=s0(),n=ld(),r=1/0,o=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return ul=o,ul}var cl,Bu;function c0(){if(Bu)return cl;Bu=1;var e=Cp(),t=kp(),n=eg(),r=Sp(),o=u0(),i=ld(),s=200;function a(l,u,c){var h=-1,g=t,f=l.length,p=!0,m=[],w=m;if(c)p=!1,g=n;else if(f>=s){var y=u?null:o(l);if(y)return i(y);p=!1,g=r,w=new e}else w=u?[]:m;e:for(;++h<f;){var v=l[h],x=u?u(v):v;if(v=c||v!==0?v:0,p&&x===x){for(var R=w.length;R--;)if(w[R]===x)continue e;u&&w.push(x),m.push(v)}else g(w,x,c)||(w!==m&&w.push(x),m.push(v))}return m}return cl=a,cl}var dl,Wu;function d0(){if(Wu)return dl;Wu=1;var e=c0();function t(n){return n&&n.length?e(n):[]}return dl=t,dl}var h0=d0();const f0=vr(h0);var p0=qf();const Nu=vr(p0),$t='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',g0=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>`},m0=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>`},v0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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>`},b0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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>`},y0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
59
|
-
<path
|
|
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
|
-
fill="${n}"
|
|
62
|
-
/>
|
|
63
|
-
<path
|
|
64
|
-
fill-rule="evenodd"
|
|
65
|
-
clip-rule="evenodd"
|
|
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
|
-
fill="${t}"
|
|
68
|
-
/>
|
|
69
|
-
</svg>`},Xd=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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
|
-
<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
|
-
</svg>
|
|
74
|
-
`},w0=e=>{const t=e.bgColor;return`${$t}
|
|
75
|
-
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
|
76
|
-
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
|
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
|
-
</svg>
|
|
79
|
-
`},x0=Xd,C0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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>`},k0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
83
|
-
${$t}
|
|
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
|
-
<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
|
-
<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}"/>
|
|
87
|
-
<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}"/>
|
|
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
|
-
<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
|
-
<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>`},S0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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
|
-
<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>`},M0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
96
|
-
${$t}
|
|
97
|
-
<path fill="${t}" d="M3 3h14v14H3z"/>
|
|
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>`},I0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
100
|
-
${$t}
|
|
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
|
-
<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>`},R0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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>`},E0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
107
|
-
${$t}
|
|
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
|
-
<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
|
-
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
|
111
|
-
</svg>`},T0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
112
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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
|
-
<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>`},O0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
116
|
-
${$t}
|
|
117
|
-
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
|
118
|
-
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
|
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>`},D0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
121
|
-
<path fill="${t}" d="M4 3h12v14H4z"/>
|
|
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>`},P0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
124
|
-
${$t}
|
|
125
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},z0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
128
|
-
${$t}
|
|
129
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},H0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
132
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},L0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
135
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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
|
-
<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
|
-
<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
|
-
<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>`},F0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
141
|
-
${$t}
|
|
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
|
-
<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>`},A0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
145
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},_0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
148
|
-
${$t}
|
|
149
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},V0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
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
|
-
<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
|
-
<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>`},$0=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
|
156
|
-
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
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>`},B0=e=>{const t=e.fgColor;return`
|
|
159
|
-
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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>`},W0=e=>{const t=e.fgColor;return`
|
|
162
|
-
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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
|
-
</svg>
|
|
165
|
-
`},N0={headerRowID:g0,headerNumber:v0,headerCode:m0,headerString:b0,headerBoolean:y0,headerAudioUri:x0,headerVideoUri:C0,headerEmoji:k0,headerImage:S0,headerUri:Xd,headerPhone:M0,headerMarkdown:I0,headerDate:R0,headerTime:E0,headerEmail:T0,headerReference:O0,headerIfThenElse:D0,headerSingleValue:P0,headerLookup:z0,headerTextTemplate:H0,headerMath:L0,headerRollup:F0,headerJoinStrings:A0,headerSplitString:_0,headerGeoDistance:V0,headerArray:$0,rowOwnerOverlay:B0,protectedColumnOverlay:W0,renameIcon:w0};function j0(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class G0{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,s,a,l=1){const[u,c]=j0(n,a),h=s*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${h}_${t}`;let f=this.spriteMap.get(g);if(f===void 0){const p=this.headerIcons[t];if(p===void 0)return;f=document.createElement("canvas");const m=f.getContext("2d");if(m===null)return;const w=new Image;w.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,f);const y=w.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{m.drawImage(w,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(r.globalAlpha=l),r.drawImage(f,0,0,h,h,o,i,s,s),l<1&&(r.globalAlpha=1)}}function Zd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function Ra(e,t,n,r,o,i,s,a,l){a=a??t;let u=t,c=e;const h=r-i;let g=!1;for(;u<n&&c<h;){const f=o(c);if(u+f>a&&l(u,c,f,!1,s&&c===r-1)===!0){g=!0;break}u+=f,c++}if(!g){u=n;for(let f=0;f<i;f++){c=r-1-f;const p=o(c);u-=p,l(u,c,p,!0,s&&c===r-1)}}}function Hr(e,t,n,r,o,i){let s=0,a=0;const l=o+r;for(const u of e){const c=u.sticky?a:s+n;if(i(u,c,l,u.sticky?0:a,t)===!0)break;s+=u.width,a+=u.sticky?u.width:0}}function Yd(e,t,n,r,o){let i=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&&mi(e[u].group,l.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(s+=m.width)}const h=l.sticky?0:n,g=i+h,f=l.sticky?0:Math.max(0,s-g),p=Math.min(c-f,t-(g+f));o([l.sourceIndex,e[u-1].sourceIndex],l.group??"",g+f,0,p,r),i+=c}}function Jd(e,t,n,r,o,i,s){const[a,l]=e;let u,c;const h=s.find(g=>!g.sticky)?.sourceIndex??0;if(l>h){const g=Math.max(a,h);let f=t,p=r;for(let m=i.sourceIndex-1;m>=g;m--)f-=s[m].width,p+=s[m].width;for(let m=i.sourceIndex+1;m<=l;m++)p+=s[m].width;c={x:f,y:n,width:p,height:o}}if(h>a){const g=Math.min(l,h-1);let f=t,p=r;for(let m=i.sourceIndex-1;m>=a;m--)f-=s[m].width,p+=s[m].width;for(let m=i.sourceIndex+1;m<=g;m++)p+=s[m].width;u={x:f,y:n,width:p,height:o}}return[u,c]}function U0(e,t,n,r){if(r==="any")return Qd(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 o=t-e.x,i=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:o,r==="vertical"?Number.MAX_SAFE_INTEGER:i,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===i?{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 vi(e,t,n,r,o,i,s,a){return e<=o+s&&o<=e+n&&t<=i+a&&i<=t+r}function Zr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Qd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:o,height:i}}function K0(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 q0(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 o=-4,i=-4,s=t+4,a=n+4,l=o-e.x,u=e.x+e.width-s,c=i-e.y,h=e.y+e.height-a,g=l>0?e.x+Math.floor(l/r)*r:e.x,f=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=h>0?e.y+e.height-Math.floor(h/r)*r:e.y+e.height;return{x:g,y:p,width:f-g,height:m-p}}function X0(e,t,n,r,o){const[i,s,a,l]=t,[u,c,h,g]=o,{x:f,y:p,width:m,height:w}=e,y=[];if(m<=0||w<=0)return y;const v=f+m,x=p+w,R=f<i,E=p<s,S=f+m>a,P=p+w>l,M=f>=i&&f<a||v>i&&v<=a||f<i&&v>a,C=p>=s&&p<l||x>s&&x<=l||p<s&&x>l;if(M&&C){const z=Math.max(f,i),T=Math.max(p,s),I=Math.min(v,a),O=Math.min(x,l);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:u,y:c,width:h-u+1,height:g-c+1}})}if(R&&E){const z=f,T=p,I=Math.min(v,i),O=Math.min(x,s);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:0,y:0,width:u+1,height:c+1}})}if(E&&M){const z=Math.max(f,i),T=p,I=Math.min(v,a),O=Math.min(x,s);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:u,y:0,width:h-u+1,height:c+1}})}if(E&&S){const z=Math.max(f,a),T=p,I=v,O=Math.min(x,s);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:h,y:0,width:n-h+1,height:c+1}})}if(R&&C){const z=f,T=Math.max(p,s),I=Math.min(v,i),O=Math.min(x,l);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(S&&C){const z=Math.max(f,a),T=Math.max(p,s),I=v,O=Math.min(x,l);y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:h,y:c,width:n-h+1,height:g-c+1}})}if(R&&P){const z=f,T=Math.max(p,l),I=Math.min(v,i),O=x;y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&M){const z=Math.max(f,i),T=Math.max(p,l),I=Math.min(v,a),O=x;y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:u,y:g,width:h-u+1,height:r-g+1}})}if(S&&P){const z=Math.max(f,a),T=Math.max(p,l),I=v,O=x;y.push({rect:{x:z,y:T,width:I-z,height:O-T},clip:{x:h,y:g,width:n-h+1,height:r-g+1}})}return y}const Z0={kind:Y.Loading,allowOverlay:!1};function ju(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y,v,x,R,E,S,P,M,C,z,T,I,O,D,k,J,N,Z){let ue=x?.size??Number.MAX_SAFE_INTEGER;const te=performance.now();let X=O.baseFontFull;e.font=X;const ge={ctx:e},ae=[0,0],fe=w>0?to(l,w,u):0;let he,oe;const _=Zd(v);return Hr(t,a,i,s,o,(H,G,re,le,Ee)=>{const we=Math.max(0,le-G),ut=G+we,Se=o+1,mt=H.width-we,wt=r-o-1;if(v.length>0){let Ve=!1;for(let $e=0;$e<v.length;$e++){const tt=v[$e];if(vi(ut,Se,mt,wt,tt.x,tt.y,tt.width,tt.height)){Ve=!0;break}}if(!Ve)return}const je=()=>{e.save(),e.beginPath(),e.rect(ut,Se,mt,wt),e.clip()},ne=R.columns.hasIndex(H.sourceIndex),ie=h(H.group??"").overrideTheme,ye=H.themeOverride===void 0&&ie===void 0?O:mr(O,ie,H.themeOverride),ce=ye.baseFontFull;ce!==X&&(X=ce,e.font=ce),je();let ve;return Ra(Ee,re,r,l,u,w,y,_,(Ve,$e,tt,Me,Qe)=>{if($e<0||(ae[0]=H.sourceIndex,ae[1]=$e,x!==void 0&&!x.has(ae)))return;if(v.length>0){let Pe=!1;for(let rt=0;rt<v.length;rt++){const xt=v[rt];if(vi(G,Ve,H.width,tt,xt.x,xt.y,xt.width,xt.height)){Pe=!0;break}}if(!Pe)return}const Te=R.rows.hasIndex($e),Ie=f.hasIndex($e),De=$e<l?c(ae):Z0;let ft=G,nt=H.width,Xe=!1,kt=!1;if(De.span!==void 0){const[Pe,rt]=De.span,xt=`${$e},${Pe},${rt},${H.sticky}`;if(oe===void 0&&(oe=new Set),oe.has(xt)){ue--;return}else{const Pn=Jd(De.span,G,Ve,H.width,tt,H,n),un=H.sticky?Pn[0]:Pn[1];if(!H.sticky&&Pn[0]!==void 0&&(kt=!0),un!==void 0){ft=un.x,nt=un.width,oe.add(xt),e.restore(),ve=void 0,e.save(),e.beginPath();const cn=Math.max(0,le-un.x);e.rect(un.x+cn,Ve,un.width-cn,tt),he===void 0&&(he=[]),he.push({x:un.x+cn,y:Ve,width:un.width-cn,height:tt}),e.clip(),Xe=!0}}}const bt=g?.($e),Dt=Qe&&H.trailingRowOptions?.themeOverride!==void 0?H.trailingRowOptions?.themeOverride:void 0,Pt=De.themeOverride===void 0&&bt===void 0&&Dt===void 0?ye:mr(ye,bt,Dt,De.themeOverride);e.beginPath();const sn=Nm(ae,De,R);let Yt=jm(ae,De,R,m);const On=De.span!==void 0&&R.columns.some(Pe=>De.span!==void 0&&Pe>=De.span[0]&&Pe<=De.span[1]);sn&&!p&&m?Yt=0:sn&&m&&(Yt=Math.max(Yt,1)),On&&Yt++,sn||(Te&&Yt++,ne&&!Qe&&Yt++);const Et=De.kind===Y.Protected?Pt.bgCellMedium:Pt.bgCell;let pt;if((Me||Et!==O.bgCell)&&(pt=$n(Et,pt)),Yt>0||Ie){Ie&&(pt=$n(Pt.bgHeader,pt));for(let Pe=0;Pe<Yt;Pe++)pt=$n(Pt.accentLight,pt)}else if(E!==void 0){for(const Pe of E)if(Pe[0]===H.sourceIndex&&Pe[1]===$e){pt=$n(Pt.bgSearchResult,pt);break}}if(S!==void 0)for(let Pe=0;Pe<S.length;Pe++){const rt=S[Pe],xt=rt.range;rt.style!=="solid-outline"&&xt.x<=H.sourceIndex&&H.sourceIndex<xt.x+xt.width&&xt.y<=$e&&$e<xt.y+xt.height&&(pt=$n(rt.color,pt))}let Dn=!1;if(x!==void 0){const Pe=Ve+1,rt=(Me?Pe+tt-1:Math.min(Pe+tt-1,r-fe))-Pe;(rt!==tt-1||ft+1<=le)&&(Dn=!0,e.save(),e.beginPath(),e.rect(ft+1,Pe,nt-1,rt),e.clip()),pt=pt===void 0?Pt.bgCell:$n(pt,Pt.bgCell)}const yt=H.sourceIndex===n.length-1,Jt=$e===l-1;pt!==void 0&&(e.fillStyle=pt,ve!==void 0&&(ve.fillStyle=pt),x!==void 0?e.fillRect(ft+1,Ve+1,nt-(yt?2:1),tt-(Jt?2:1)):e.fillRect(ft,Ve,nt,tt)),De.style==="faded"&&(e.globalAlpha=.6);let Mn;for(let Pe=0;Pe<C.length;Pe++){const rt=C[Pe];if(rt.item[0]===H.sourceIndex&&rt.item[1]===$e){Mn=rt;break}}if(nt>Z&&!kt){const Pe=Pt.baseFontFull;Pe!==X&&(e.font=Pe,X=Pe),ve=eh(e,De,H.sourceIndex,$e,yt,Jt,ft,Ve,nt,tt,Yt>0,Pt,pt??Pt.bgCell,P,M,Mn?.hoverAmount??0,z,I,te,T,ve,D,k,J,N)}return Dn&&e.restore(),De.style==="faded"&&(e.globalAlpha=1),ue--,Xe&&(e.restore(),ve?.deprep?.(ge),ve=void 0,je(),X=ce,e.font=ce),ue<=0}),e.restore(),ue<=0}),he}const ti=[0,0],ni={x:0,y:0,width:0,height:0},hl=[void 0,()=>{}];let Vl=!1;function Y0(){Vl=!0}function eh(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y,v,x,R,E,S,P,M){let C,z;w!==void 0&&w[0][0]===n&&w[0][1]===r&&(C=w[1][0],z=w[1][1]);let T;ti[0]=n,ti[1]=r,ni.x=s,ni.y=a,ni.width=l,ni.height=u,hl[0]=S.getValue(ti),hl[1]=k=>S.setValue(ti,k),Vl=!1;const I={ctx:e,theme:h,col:n,row:r,cell:t,rect:ni,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:v,hoverX:C,drawState:hl,hoverY:z,imageLoader:f,spriteManager:p,hyperWrapping:y,overrideCursor:C!==void 0?M:void 0,requestAnimationFrame:Y0},O=Zm(I,t.lastUpdated,v,R,o,i),D=P(t);if(D!==void 0){R?.renderer!==D&&(R?.deprep?.(I),R=void 0);const k=D.drawPrep?.(I,R);x!==void 0&&!Io(I.cell)?x(I,()=>D.draw(I,t)):D.draw(I,t),T=k===void 0?void 0:{deprep:k?.deprep,fillStyle:k?.fillStyle,font:k?.font,renderer:D}}return(O||Vl)&&E?.(ti),T}function cs(e,t,n,r,o,i,s,a,l=-20,u=-20,c=void 0,h="center",g="square"){const f=Math.floor(o+s/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Id(c??t.checkboxMaxSize,s,t.cellVerticalPadding),w=m/2;const y=Md(h,r,i,t.cellHorizontalPadding,m),v=Sd(y,f,m),x=Rd(r+l,o+u,v);switch(n){case!0:{e.beginPath(),er(e,y-m/2,f-m/2,m,m,p),g==="circle"&&(w*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-w+m/4.23,f-w+m/1.97),e.lineTo(y-w+m/2.42,f-w+m/1.44),e.lineTo(y-w+m/1.29,f-w+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ua:case!1:{e.beginPath(),er(e,y-m/2+.5,f-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case Jl:{e.beginPath(),er(e,y-m/2,f-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(w*=.8,m*=.8),e.beginPath(),e.moveTo(y-m/3,f),e.lineTo(y+m/3,f),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:pi()}}function J0(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y,v){const x=s+a;if(x<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,o,x);const R=r?.[0]?.[0],E=r?.[0]?.[1],S=r?.[1]?.[0],P=r?.[1]?.[1],M=h.headerFontFull;e.font=M,Hr(t,0,i,0,x,(C,z,T,I)=>{if(w!==void 0&&!w.has([C.sourceIndex,-1]))return;const O=Math.max(0,I-z);e.save(),e.beginPath(),e.rect(z+O,a,C.width-O,s),e.clip();const D=m(C.group??"").overrideTheme,k=C.themeOverride===void 0&&D===void 0?h:mr(h,D,C.themeOverride);k.bgHeader!==h.bgHeader&&(e.fillStyle=k.bgHeader,e.fill()),k!==h&&(e.font=k.headerFontFull);const J=c.columns.hasIndex(C.sourceIndex),N=l!==void 0||u||C.headerRowMarkerDisabled===!0,Z=!N&&E===-1&&R===C.sourceIndex,ue=N?0:f.find(fe=>fe.item[0]===C.sourceIndex&&fe.item[1]===-1)?.hoverAmount??0,te=c?.current!==void 0&&c.current.cell[0]===C.sourceIndex,X=J?k.accentColor:te?k.bgHeaderHasFocus:k.bgHeader,ge=n?a:0,ae=C.sourceIndex===0?0:1;J?(e.fillStyle=X,e.fillRect(z+ae,ge,C.width-ae,s)):(te||ue>0)&&(e.beginPath(),e.rect(z+ae,ge,C.width-ae,s),te&&(e.fillStyle=k.bgHeaderHasFocus,e.fill()),ue>0&&(e.globalAlpha=ue,e.fillStyle=k.bgHeaderHovered,e.fill(),e.globalAlpha=1)),rh(e,z,ge,C.width,s,C,J,k,Z,Z?S:void 0,Z?P:void 0,te,ue,g,y,v),e.restore()}),n&&Q0(e,t,o,i,a,r,h,g,f,p,m,w)}function Q0(e,t,n,r,o,i,s,a,l,u,c,h){const[g,f]=i?.[0]??[];let p=0;Yd(t,n,r,o,(m,w,y,v,x,R)=>{if(h!==void 0&&!h.hasItemInRectangle({x:m[0],y:-2,width:m[1]-m[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(y,v,x,R),e.clip();const E=c(w),S=E?.overrideTheme===void 0?s:mr(s,E.overrideTheme),P=f===-2&&g!==void 0&&g>=m[0]&&g<=m[1],M=P?S.bgGroupHeaderHovered??S.bgHeaderHovered:S.bgGroupHeader??S.bgHeader;if(M!==s.bgHeader&&(e.fillStyle=M,e.fill()),e.fillStyle=S.textGroupHeader??S.textHeader,E!==void 0){let C=y;if(E.icon!==void 0&&(a.drawSprite(E.icon,"normal",e,C+8,(o-20)/2,20,S),C+=26),e.fillText(E.name,C+8,o/2+nr(e,s.headerFontFull)),E.actions!==void 0&&P){const z=th({x:y,y:v,width:x,height:R},E.actions);e.beginPath();const T=z[0].x-10,I=y+x-T;e.rect(T,0,I,o);const O=e.createLinearGradient(T,0,T+I,0),D=Yr(M,0);O.addColorStop(0,D),O.addColorStop(10/I,M),O.addColorStop(1,M),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[k,J]=i?.[1]??[-1,-1];for(let N=0;N<E.actions.length;N++){const Z=E.actions[N],ue=z[N],te=Zr(ue,k+y,J);te&&(e.globalAlpha=1),a.drawSprite(Z.icon,"normal",e,ue.x+ue.width/2-10,ue.y+ue.height/2-10,20,S),te&&(e.globalAlpha=.6)}e.globalAlpha=1}}y!==0&&u(m[0])&&(e.beginPath(),e.moveTo(y+.5,0),e.lineTo(y+.5,o),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=y+x}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,o),e.moveTo(0,o+.5),e.lineTo(n,o+.5),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()}const Ui=30;function ev(e,t,n,r,o){return{x:e+n-Ui,y:Math.max(t,t+r/2-Ui/2),width:Ui,height:Math.min(Ui,r)}}function th(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13,i=26,s=26;for(let a=0;a<t.length;a++)n.push({x:r,y:o,width:s,height:i}),r+=26;return n}function ri(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function nh(e,t,n,r,o,i,s,a){const l=s.cellHorizontalPadding,u=s.headerIconSize,c=ev(n,r,o,i);let h=n+l;const g=t.icon===void 0?void 0:{x:h,y:r+(i-u)/2,width:u,height:u},f=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(h+=Math.ceil(u*1.3));const p={x:h,y:r,width:o-h,height:i};let m;if(t.indicatorIcon!==void 0){const y=e===void 0?$d(t.title,s.headerFontFull)?.width??0:zr(t.title,e,s.headerFontFull).width;p.width=y,h+=y+l,m={x:h,y:r+(i-u)/2,width:u,height:u}}const w=n+o/2;return{menuBounds:ri(c,w,a),iconBounds:ri(g,w,a),iconOverlayBounds:ri(f,w,a),textBounds:ri(p,w,a),indicatorIconBounds:ri(m,w,a)}}function Gu(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const v=i.rowMarkerChecked;v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=h);const x=i.headerRowMarkerTheme!==void 0?mr(a,i.headerRowMarkerTheme):a;cs(e,x,v,t,n,r,o,!1,void 0,void 0,a.checkboxMaxSize,"center",i.rowMarker),v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const w=s?a.textHeaderSelected:a.textHeader,y=i.hasMenu===!0&&(l||f&&s)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let v=s?"selected":"normal";i.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(i.icon,v,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(i.overlayIcon,s?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(y&&r>35){const v=p?35:r-35,x=p?35*.7:r-35*.7,R=v/r,E=x/r,S=e.createLinearGradient(t,0,t+r,0),P=Yr(w,0);S.addColorStop(p?1:0,w),S.addColorStop(R,w),S.addColorStop(E,P),S.addColorStop(p?0:1,P),e.fillStyle=S}else e.fillStyle=w;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+nr(e,a.headerFontFull)),p&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!y||!vi(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let v=s?"selected":"normal";i.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(i.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(y&&m.menuBounds!==void 0){const v=m.menuBounds,x=u!==void 0&&c!==void 0&&Zr(v,u+t,c+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===ca.Triangle){e.beginPath();const R=v.x+v.width/2-5.5,E=v.y+v.height/2-3;e0(e,[{x:R,y:E},{x:R+11,y:E},{x:R+5.5,y:E+6}],1),e.fillStyle=w,e.fill()}else if(i.menuIcon===ca.Dots){e.beginPath();const R=v.x+v.width/2,E=v.y+v.height/2;Qm(e,R,E),e.fillStyle=w,e.fill()}else{const R=v.x+(v.width-a.headerIconSize)/2,E=v.y+(v.height-a.headerIconSize)/2;g.drawSprite(i.menuIcon,"normal",e,R,E,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function rh(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m){const w=ns(i.title)==="rtl",y=nh(e,i,t,n,r,o,a,w);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:s,hoverAmount:g,isHovered:l,hasSelectedCell:h,spriteManager:f,menuBounds:y?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>Gu(e,t,n,r,o,i,s,a,l,u,c,g,f,m,w,y)):Gu(e,t,n,r,o,i,s,a,l,u,c,g,f,m,w,y)}function tv(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y,v){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const x=Zd(w);Hr(t,l,s,a,i,(R,E,S,P,M)=>{if(R!==t[t.length-1])return;E+=R.width;const C=Math.max(E,P);C>r||(e.save(),e.beginPath(),e.rect(C,i+1,1e4,o-i-1),e.clip(),Ra(M,S,o,u,c,p,m,x,(z,T,I,O)=>{if(!O&&w.length>0&&!w.some(Z=>vi(E,z,1e4,I,Z.x,Z.y,Z.width,Z.height)))return;const D=g.hasIndex(T),k=f.hasIndex(T);e.beginPath();const J=h?.(T),N=J===void 0?v:mr(v,J);N.bgCell!==v.bgCell&&(e.fillStyle=N.bgCell,e.fillRect(E,z,1e4,I)),k&&(e.fillStyle=N.bgHeader,e.fillRect(E,z,1e4,I)),D&&(e.fillStyle=N.accentLight,e.fillRect(E,z,1e4,I))}),e.restore())})}function nv(e,t,n,r,o,i,s,a,l){let u=!1;for(const p of t)if(!p.sticky){u=s(p.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,h=l.borderColor,g=u?Po(t):0;let f;if(g!==0&&(f=zu(h,l.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=f,e.stroke()),o>0){const p=h===c&&f!==void 0?f:zu(c,l.bgCell),m=to(i,o,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const oh=(e,t,n)=>{let r=0,o=t,i=0,s=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),o=Math.max(o,a.x+a.width+1),i=Math.min(i,a.y-1),s=Math.max(s,a.y+a.height+1)}return{minX:r,maxX:o,minY:i,maxY:s}};function rv(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p){const m=p.bgCell,{minX:w,maxX:y,minY:v,maxY:x}=oh(a,i,s),R=[],E=s-to(f,g,u);let S=l,P=n,M=0;for(;S+o<E;){const I=S+o,O=u(P);if(I>=v&&I<=x-1){const D=c?.(P)?.bgCell;D!==void 0&&D!==m&&P>=f-g&&R.push({x:w,y:I,w:y-w,h:O,color:D})}S+=O,P<f-g&&(M=S),P++}let C=0;const z=Math.min(E,x)-M;if(z>0)for(let I=0;I<t.length;I++){const O=t[I];if(O.width===0)continue;const D=O.sticky?C:C+r,k=O.themeOverride?.bgCell;k!==void 0&&k!==m&&D>=w&&D<=y&&h(I+1)&&R.push({x:D,y:M,w:O.width,h:z,color:k}),C+=O.width}if(R.length===0)return;let T;e.beginPath();for(let I=R.length-1;I>=0;I--){const O=R[I];T===void 0?T=O.color:O.color!==T&&(e.fillStyle=T,e.fill(),e.beginPath(),T=O.color),e.rect(O.x,O.y,O.w,O.h)}T!==void 0&&(e.fillStyle=T,e.fill()),e.beginPath()}function Uu(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,s);for(const I of l)e.rect(I.x+1,I.y+1,I.width-1,I.height-1);e.clip("evenodd")}const v=w.horizontalBorderColor??w.borderColor,x=w.borderColor,{minX:R,maxX:E,minY:S,maxY:P}=oh(a,i,s),M=[];e.beginPath();let C=.5;for(let I=0;I<t.length;I++){const O=t[I];if(O.width===0)continue;C+=O.width;const D=O.sticky?C:C+r;D>=R&&D<=E&&f(I+1)&&M.push({x1:D,y1:Math.max(u,S),x2:D,y2:Math.min(s,P),color:x})}let z=s+.5;for(let I=m-p;I<m;I++){const O=h(I);z-=O,M.push({x1:R,y1:z,x2:E,y2:z,color:v})}if(y!==!0){let I=c+.5,O=n;const D=z;for(;I+o<D;){const k=I+o;if(k>=S&&k<=P-1){const J=g?.(O);M.push({x1:R,y1:k,x2:E,y2:k,color:J?.horizontalBorderColor??J?.borderColor??v})}I+=h(O),O++}}const T=zp(M,I=>I.color);for(const I of Object.keys(T)){e.strokeStyle=I;for(const O of T[I])e.moveTo(O.x1,O.y1),e.lineTo(O.x2,O.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function ov(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w,y,v){const x=[];e.imageSmoothingEnabled=!1;const R=Math.min(o.cellYOffset,s),E=Math.max(o.cellYOffset,s);let S=0;if(typeof y=="number")S+=(E-R)*y;else for(let D=R;D<E;D++)S+=y(D);s>o.cellYOffset&&(S=-S),S+=l-o.translateY;const P=Math.min(o.cellXOffset,i),M=Math.max(o.cellXOffset,i);let C=0;for(let D=P;D<M;D++)C+=m[D].width;i>o.cellXOffset&&(C=-C),C+=a-o.translateX;const z=Po(w);if(C!==0&&S!==0)return{regions:[]};const T=u>0?to(g,u,y):0,I=c-z-Math.abs(C),O=h-f-T-Math.abs(S)-1;if(I>150&&O>150){const D={sx:0,sy:0,sw:c*p,sh:h*p,dx:0,dy:0,dw:c*p,dh:h*p};if(S>0?(D.sy=(f+1)*p,D.sh=O*p,D.dy=(S+f+1)*p,D.dh=O*p,x.push({x:0,y:f,width:c,height:S+1})):S<0&&(D.sy=(-S+f+1)*p,D.sh=O*p,D.dy=(f+1)*p,D.dh=O*p,x.push({x:0,y:h+S-T,width:c,height:-S+T})),C>0?(D.sx=z*p,D.sw=I*p,D.dx=(C+z)*p,D.dw=I*p,x.push({x:z-1,y:0,width:C+2,height:h})):C<0&&(D.sx=(z-C)*p,D.sw=I*p,D.dx=z*p,D.dw=I*p,x.push({x:c+C,y:0,width:-C,height:h})),e.setTransform(1,0,0,1,0,0),v){if(z>0&&C!==0&&S===0&&(r===void 0||n?.[1]!==!1)){const k=z*p,J=h*p;e.drawImage(t,0,0,k,J,0,0,k,J)}if(T>0&&C===0&&S!==0&&(r===void 0||n?.[0]!==!1)){const k=(h-T)*p,J=c*p,N=T*p;e.drawImage(t,0,k,J,N,0,k,J,N)}}e.drawImage(t,D.sx,D.sy,D.sw,D.sh,D.dx,D.dy,D.dw,D.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:x}}function iv(e,t,n,r,o,i,s,a,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||o!==e.translateY||Hr(l,n,r,o,a,(h,g,f,p)=>{if(h.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:i-m,height:s}),!0}}),c}function av(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 o=e.mappedColumns[r],i=t.mappedColumns[r];if(Do(o,i))continue;if(n!==void 0||o.width===i.width)return!1;const{width:s,...a}=o,{width:l,...u}=i;if(!Do(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function Ku(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m){const w=p?.filter(P=>P.style!=="no-outline");if(w===void 0||w.length===0)return;const y=Po(a),v=to(f,g,h),x=[l,0,a.length,f-g],R=[y,0,t,n-v],E=w.map(P=>{const M=P.range,C=P.style??"dashed";return X0(M,x,t,n,R).map(z=>{const T=z.rect,I=Al(T.x,T.y,t,n,c,u+c,r,o,i,s,f,l,g,a,h),O=T.width===1&&T.height===1?I:Al(T.x+T.width-1,T.y+T.height-1,t,n,c,u+c,r,o,i,s,f,l,g,a,h);return T.x+T.width>=a.length&&(O.width-=1),T.y+T.height>=f&&(O.height-=1),{color:P.color,style:C,clip:z.clip,rect:q0({x:I.x,y:I.y,width:O.x+O.width-I.x,height:O.y+O.height-I.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let P=!1;for(const M of E)for(const C of M)if(C?.rect!==void 0&&vi(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const z=P,T=!K0(C.clip,C.rect);e.beginPath(),T&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(C.style==="solid"||C.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=C.style==="solid-outline"?$n($n(C.color,m.borderColor),m.bgCell):Yr(C.color,1),e.closePath(),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),T&&(e.restore(),P=z)}P&&e.setLineDash([])};return S(),S}function qu(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function fl(e,t,n,r,o,i,s,a,l,u,c,h,g,f,p,m,w){if(c.current===void 0)return;const y=m!==!1&&m!==void 0;if(!y)return;const v=typeof m=="object"?{...da,...m}:da,x=c.current.range,R=c.current.cell,E=[x.x+x.width-1,x.y+x.height-1];if(R[1]>=w&&E[1]>=w||!s.some(k=>k.sourceIndex===R[0]||k.sourceIndex===E[0]))return;const[S,P]=c.current.cell,M=g(c.current.cell),C=M.span??[S,S],z=P>=w-f,T=f>0&&!z?to(w,f,h)-1:0,I=E[1];let O;if(Hr(s,r,o,i,u,(k,J,N,Z,ue)=>{if(k.sticky&&S>k.sourceIndex)return;const te=k.sourceIndex<C[0],X=k.sourceIndex>C[1],ge=k.sourceIndex===E[0];if(!(!ge&&(te||X)))return Ra(ue,N,n,w,h,f,p,void 0,(ae,fe,he)=>{if(fe!==P&&fe!==I)return;let oe=J,_=k.width;if(M.span!==void 0){const H=Jd(M.span,J,ae,k.width,he,k,a),G=k.sticky?H[0]:H[1];G!==void 0&&(oe=G.x,_=G.width)}return fe===I&&ge&&y&&(O=()=>{Z>oe&&!k.sticky&&(e.beginPath(),e.rect(Z,0,t-Z,n),e.clip());const H=v.size,G=H/2,re=oe+_+v.offsetX-G+.5,le=ae+he+v.offsetY-G+.5;e.beginPath(),v.shape==="circle"?e.arc(re+G,le+G,G,0,Math.PI*2):e.rect(re,le,H,H),e.fillStyle=k.themeOverride?.accentColor??l.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=l.bgCell,v.shape==="circle"?(e.beginPath(),e.arc(re+G,le+G,G+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(re-v.outline/2,le-v.outline/2,H+v.outline,H+v.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-T),e.clip(),O?.(),e.restore()};return D(),D}function lv(e,t,n,r,o,i,s,a,l){l===void 0||l.size===0||(e.beginPath(),Yd(t,n,i,r,(u,c,h,g,f,p)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(h,g,f,p)}),Hr(t,a,i,s,o,(u,c,h,g)=>{const f=Math.max(0,g-c),p=c+f+1,m=u.width-f-1;l.has([u.sourceIndex,-1])&&e.rect(p,r,m,o-r)}),e.clip())}function sv(e,t,n,r,o,i,s,a,l,u){let c=0;return Hr(e,i,r,o,n,(h,g,f,p,m)=>(Ra(m,f,t,s,a,l,u,void 0,(w,y,v,x)=>{x||(c=Math.max(y,c))}),!0)),c}function Xu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mappedColumns:c,enableGroups:h,freezeColumns:g,dragAndDropState:f,theme:p,drawFocus:m,headerHeight:w,groupHeaderHeight:y,disabledRows:v,rowHeight:x,verticalBorder:R,overrideCursor:E,isResizing:S,selection:P,fillHandle:M,freezeTrailingRows:C,rows:z,getCellContent:T,getGroupDetails:I,getRowThemeOverride:O,isFocused:D,drawHeaderCallback:k,prelightCells:J,drawCellCallback:N,highlightRegions:Z,resizeCol:ue,imageLoader:te,lastBlitData:X,hoverValues:ge,hyperWrapping:ae,hoverInfo:fe,spriteManager:he,maxScaleFactor:oe,hasAppendRow:_,touchMode:H,enqueue:G,renderStateProvider:re,getCellRenderer:le,renderStrategy:Ee,bufferACtx:we,bufferBCtx:ut,damage:Se,minimumCellWidth:mt,resizeIndicator:wt}=e;if(o===0||i===0)return;const je=Ee==="double-buffer",ne=Math.min(oe,Math.ceil(window.devicePixelRatio??1)),ie=Ee!=="direct"&&av(e,t),ye=n.canvas;(ye.width!==o*ne||ye.height!==i*ne)&&(ye.width=o*ne,ye.height=i*ne,ye.style.width=o+"px",ye.style.height=i+"px");const ce=r.canvas,ve=h?y+w:w,Ve=ve+1;(ce.width!==o*ne||ce.height!==Ve*ne)&&(ce.width=o*ne,ce.height=Ve*ne,ce.style.width=o+"px",ce.style.height=Ve+"px");const $e=we.canvas,tt=ut.canvas;je&&($e.width!==o*ne||$e.height!==i*ne)&&($e.width=o*ne,$e.height=i*ne,X.current!==void 0&&(X.current.aBufferScroll=void 0)),je&&(tt.width!==o*ne||tt.height!==i*ne)&&(tt.width=o*ne,tt.height=i*ne,X.current!==void 0&&(X.current.bBufferScroll=void 0));const Me=X.current;if(ie===!0&&s===Me?.cellXOffset&&a===Me?.cellYOffset&&l===Me?.translateX&&u===Me?.translateY)return;let Qe=null;je&&(Qe=n);const Te=r;let Ie;je?Se!==void 0?Ie=Me?.lastBuffer==="b"?ut:we:Ie=Me?.lastBuffer==="b"?we:ut:Ie=n;const De=Ie.canvas,ft=je?De===$e?tt:$e:ye,nt=typeof x=="number"?()=>x:x;Te.save(),Ie.save(),Te.beginPath(),Ie.beginPath(),Te.textBaseline="middle",Ie.textBaseline="middle",ne!==1&&(Te.scale(ne,ne),Ie.scale(ne,ne));const Xe=Fl(c,s,o,f,l);let kt=[];const bt=m&&P.current?.cell[1]===a&&u===0;let Dt=!1;if(Z!==void 0){for(const yt of Z)if(yt.style!=="no-outline"&&yt.range.y===a&&u===0){Dt=!0;break}}const Pt=()=>{J0(Te,Xe,h,fe,o,l,w,y,f,S,P,p,he,ge,R,I,Se,k,H),Uu(Te,Xe,a,l,u,o,i,void 0,void 0,y,ve,nt,O,R,C,z,p,!0),Te.beginPath(),Te.moveTo(0,Ve-.5),Te.lineTo(o,Ve-.5),Te.strokeStyle=$n(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Te.stroke(),Dt&&Ku(Te,o,i,s,a,l,u,c,g,w,y,x,C,z,Z,p),bt&&fl(Te,o,i,a,l,u,Xe,c,p,ve,P,nt,T,C,_,M,z)};if(Se!==void 0){const yt=Xe[Xe.length-1].sourceIndex+1,Jt=Se.hasItemInRegion([{x:s,y:-2,width:yt,height:2},{x:s,y:a,width:yt,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:s,y:z-C,width:yt,height:C,when:C>0}]),Mn=Pe=>{ju(Pe,Xe,c,i,ve,l,u,a,z,nt,T,I,O,v,D,m,C,_,kt,Se,P,J,Z,te,he,ge,fe,N,ae,p,G,re,le,E,mt);const rt=P.current;M!==!1&&M!==void 0&&m&&rt!==void 0&&Se.has(Ad(rt.range))&&fl(Pe,o,i,a,l,u,Xe,c,p,ve,P,nt,T,C,_,M,z)};Jt&&(Mn(Ie),Qe!==null&&(Qe.save(),Qe.scale(ne,ne),Qe.textBaseline="middle",Mn(Qe),Qe.restore()),Se.hasHeader()&&(lv(Te,Xe,o,y,ve,l,u,a,Se),Pt())),Ie.restore(),Te.restore();return}if((ie!==!0||s!==Me?.cellXOffset||l!==Me?.translateX||bt!==Me?.mustDrawFocusOnHeader||Dt!==Me?.mustDrawHighlightRingsOnHeader)&&Pt(),ie===!0){Vn(ft!==void 0&&Me!==void 0);const{regions:yt}=ov(Ie,ft,ft===$e?Me.aBufferScroll:Me.bBufferScroll,ft===$e?Me.bBufferScroll:Me.aBufferScroll,Me,s,a,l,u,C,o,i,z,ve,ne,c,Xe,x,je);kt=yt}else ie!==!1&&(Vn(Me!==void 0),kt=iv(Me,s,a,l,u,o,i,ve,Xe,ie));nv(Ie,Xe,o,i,C,z,R,nt,p);const sn=Ku(Ie,o,i,s,a,l,u,c,g,w,y,x,C,z,Z,p),Yt=m?fl(Ie,o,i,a,l,u,Xe,c,p,ve,P,nt,T,C,_,M,z):void 0;if(Ie.fillStyle=p.bgCell,kt.length>0){Ie.beginPath();for(const yt of kt)Ie.rect(yt.x,yt.y,yt.width,yt.height);Ie.clip(),Ie.fill(),Ie.beginPath()}else Ie.fillRect(0,0,o,i);const On=ju(Ie,Xe,c,i,ve,l,u,a,z,nt,T,I,O,v,D,m,C,_,kt,Se,P,J,Z,te,he,ge,fe,N,ae,p,G,re,le,E,mt);tv(Ie,Xe,c,o,i,ve,l,u,a,z,nt,O,P.rows,v,C,_,kt,Se,p),rv(Ie,Xe,a,l,u,o,i,kt,ve,nt,O,R,C,z,p),Uu(Ie,Xe,a,l,u,o,i,kt,On,y,ve,nt,O,R,C,z,p),sn?.(),Yt?.(),S&&wt!=="none"&&Hr(Xe,0,l,0,ve,(yt,Jt)=>yt.sourceIndex===ue?(qu(Te,Jt+yt.width,0,ve+1,$n(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),wt==="full"&&qu(Ie,Jt+yt.width,ve,i,$n(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),Qe!==null&&(Qe.fillStyle=p.bgCell,Qe.fillRect(0,0,o,i),Qe.drawImage(Ie.canvas,0,0));const Et=sv(Xe,i,ve,l,u,a,z,nt,C,_);te?.setWindow({x:s,y:a,width:Xe.length,height:Et-a},g,Array.from({length:C},(yt,Jt)=>z-1-Jt));const pt=Me!==void 0&&(s!==Me.cellXOffset||l!==Me.translateX),Dn=Me!==void 0&&(a!==Me.cellYOffset||u!==Me.translateY);X.current={cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mustDrawFocusOnHeader:bt,mustDrawHighlightRingsOnHeader:Dt,lastBuffer:je?De===$e?"a":"b":void 0,aBufferScroll:De===$e?[pt,Dn]:Me?.aBufferScroll,bBufferScroll:De===tt?[pt,Dn]:Me?.bBufferScroll},Ie.restore(),Te.restore()}const uv=80;function cv(e){const t=e-1;return t*t*t+1}class dv{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(n=>di(n.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>di(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:cv(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/uv;for(const o of this.leavingItems)o.hoverAmount=Gn(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Gn(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!di(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 hv{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ds(e){return new hv(e)}const fv=ds(()=>window.navigator.userAgent.includes("Firefox")),fa=ds(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),pa=ds(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function pv(e){const t=d.useRef([]),n=d.useRef(0),r=d.useRef(e);r.current=e;const o=d.useCallback(()=>{const i=()=>window.requestAnimationFrame(s),s=()=>{const a=t.current.map(us);t.current=[],r.current(new fi(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:s)},[]);return d.useCallback(i=>{t.current.length===0&&o();const s=Qn(i[0],i[1]);t.current.includes(s)||t.current.push(s)},[o])}const Rr="header",Jn="group-header",ga="out-of-bounds";var Eo;(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"})(Eo||(Eo={}));function ih(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 gv=(e,t)=>e.kind===Y.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",mv=(e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:s,cellYOffset:a,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:h,rows:g,getCellContent:f,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:w,enableGroups:y,isFilling:v,onCanvasFocused:x,onCanvasBlur:R,isFocused:E,selection:S,freezeColumns:P,onContextMenu:M,freezeTrailingRows:C,fixedShadowX:z=!0,fixedShadowY:T=!0,drawFocusRing:I,onMouseDown:O,onMouseUp:D,onMouseMoveRaw:k,onMouseMove:J,onItemHovered:N,dragAndDropState:Z,firstColAccessible:ue,onKeyDown:te,onKeyUp:X,highlightRegions:ge,canvasRef:ae,onDragStart:fe,onDragEnd:he,eventTargetRef:oe,isResizing:_,resizeColumn:H,isDragging:G,isDraggable:re=!1,allowResize:le,disabledRows:Ee,hasAppendRow:we,getGroupDetails:ut,theme:Se,prelightCells:mt,headerIcons:wt,verticalBorder:je,drawCell:ne,drawHeader:ie,onCellFocused:ye,onDragOverCell:ce,onDrop:ve,onDragLeave:Ve,imageWindowLoader:$e,smoothScrollX:tt=!1,smoothScrollY:Me=!1,experimental:Qe,getCellRenderer:Te,resizeIndicator:Ie="full"}=e,De=e.translateX??0,ft=e.translateY??0,nt=Math.max(P,Math.min(i.length-1,s)),Xe=d.useRef(null),kt=d.useRef(Qe?.eventTarget??window),bt=kt.current,Dt=$e,Pt=d.useRef(),[sn,Yt]=d.useState(!1),On=d.useRef([]),Et=d.useRef(),[pt,Dn]=d.useState(),[yt,Jt]=d.useState(),Mn=d.useRef(null),[Pe,rt]=d.useState(),[xt,Pn]=d.useState(!1),un=d.useRef(xt);un.current=xt;const cn=d.useMemo(()=>new G0(wt,()=>{fn.current=void 0,En.current()}),[wt]),zn=y?c+l:l,Qt=d.useRef(-1),en=(Qe?.enableFirefoxRescaling??!1)&&fv.value,We=(Qe?.enableSafariRescaling??!1)&&fa.value;d.useLayoutEffect(()=>{window.devicePixelRatio===1||!en&&!We||(Qt.current!==-1&&Yt(!0),window.clearTimeout(Qt.current),Qt.current=window.setTimeout(()=>{Yt(!1),Qt.current=-1},200))},[a,nt,De,ft,en,We]);const St=Bm(i,P),Hn=d.useMemo(()=>z?Po(St,Z):0,[St,Z,z]),Ht=d.useCallback((V,ee,Ce)=>{const Re=V.getBoundingClientRect();if(ee>=St.length||Ce>=g)return;const de=Re.width/n,pe=Al(ee,Ce,n,r,c,zn,nt,a,De,ft,g,P,C,St,h);return de!==1&&(pe.x*=de,pe.y*=de,pe.width*=de,pe.height*=de),pe.x+=Re.x,pe.y+=Re.y,pe},[n,r,c,zn,nt,a,De,ft,g,P,C,St,h]),gt=d.useCallback((V,ee,Ce,Re)=>{const de=V.getBoundingClientRect(),pe=de.width/n,Ue=(ee-de.left)/pe,ke=(Ce-de.top)/pe,Ye=5,vt=Fl(St,nt,n,void 0,De);let pn=0,jt=0;const Mt=typeof PointerEvent<"u"&&Re instanceof PointerEvent&&Re.pointerType==="mouse"||typeof MouseEvent<"u"&&Re instanceof MouseEvent,ct=typeof PointerEvent<"u"&&Re instanceof PointerEvent&&Re.pointerType==="touch"||typeof TouchEvent<"u"&&Re instanceof TouchEvent;Mt&&(pn=Re.button,jt=Re.buttons);const Ke=Gm(Ue,vt,De),ht=Um(ke,r,y,l,c,g,h,a,ft,C),Bt=Re?.shiftKey===!0,uo=Re?.ctrlKey===!0,Vr=Re?.metaKey===!0,nn=[Ue<0?-1:n<Ue?1:0,ke<zn?-1:r<ke?1:0];let dn;if(Ke===-1||ke<0||Ue<0||ht===void 0||Ue>n||ke>r){const Ft=Ue>n?1:Ue<0?-1:0,Nn=ke>r?1:ke<0?-1:0;let mn=Ft*2,hr=Nn*2;Ft===0&&(mn=Ke===-1?Eo.EndPadding:Eo.Center),Nn===0&&(hr=ht===void 0?Eo.EndPadding:Eo.Center);let fr=!1;if(Ke===-1&&ht===-1){const rn=Ht(V,St.length-1,-1);Vn(rn!==void 0),fr=ee<rn.x+rn.width+Ye}const dt=Ue>n&&Ue<n+Pl()||ke>r&&ke<r+Pl();dn={kind:ga,location:[Ke!==-1?Ke:Ue<0?0:St.length-1,ht??g-1],region:[mn,hr],shiftKey:Bt,ctrlKey:uo,metaKey:Vr,isEdge:fr,isTouch:ct,button:pn,buttons:jt,scrollEdge:nn,isMaybeScrollbar:dt}}else if(ht<=-1){let Ft=Ht(V,Ke,ht);Vn(Ft!==void 0);let Nn=Ft!==void 0&&Ft.x+Ft.width-ee<=Ye;const mn=Ke-1;ee-Ft.x<=Ye&&mn>=0?(Nn=!0,Ft=Ht(V,mn,ht),Vn(Ft!==void 0),dn={kind:y&&ht===-2?Jn:Rr,location:[mn,ht],bounds:Ft,group:St[mn].group??"",isEdge:Nn,shiftKey:Bt,ctrlKey:uo,metaKey:Vr,isTouch:ct,localEventX:ee-Ft.x,localEventY:Ce-Ft.y,button:pn,buttons:jt,scrollEdge:nn}):dn={kind:y&&ht===-2?Jn:Rr,group:St[Ke].group??"",location:[Ke,ht],bounds:Ft,isEdge:Nn,shiftKey:Bt,ctrlKey:uo,metaKey:Vr,isTouch:ct,localEventX:ee-Ft.x,localEventY:Ce-Ft.y,button:pn,buttons:jt,scrollEdge:nn}}else{const Ft=Ht(V,Ke,ht);Vn(Ft!==void 0);const Nn=Ft!==void 0&&Ft.x+Ft.width-ee<Ye;let mn=!1;if(u!==!1&&u!==void 0&&S.current!==void 0){const hr=typeof u=="object"?{...da,...u}:da,fr=hr.size,dt=fr/2,rn=Ad(S.current.range),ir=Ht(V,rn[0],rn[1]);if(ir!==void 0){const Ei=ir.x+ir.width+hr.offsetX-dt+.5,pr=ir.y+ir.height+hr.offsetY-dt+.5;mn=Math.abs(Ei-ee)<fr&&Math.abs(pr-Ce)<fr}}dn={kind:"cell",location:[Ke,ht],bounds:Ft,isEdge:Nn,shiftKey:Bt,ctrlKey:uo,isFillHandle:mn,metaKey:Vr,isTouch:ct,localEventX:ee-Ft.x,localEventY:Ce-Ft.y,button:pn,buttons:jt,scrollEdge:nn}}return dn},[n,St,nt,De,r,y,l,c,g,h,a,ft,C,Ht,u,S,zn]),[In]=pt??[],cr=d.useRef(()=>{}),Bn=d.useRef(pt);Bn.current=pt;const[B,Ne]=d.useMemo(()=>{const V=document.createElement("canvas"),ee=document.createElement("canvas");return V.style.display="none",V.style.opacity="0",V.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[V.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(!(B===null||Ne===null))return document.documentElement.append(B.canvas),document.documentElement.append(Ne.canvas),()=>{B.canvas.remove(),Ne.canvas.remove()}},[B,Ne]);const Ge=d.useMemo(()=>new t0,[]),zt=en&&sn?1:We&&sn?2:5,tn=Qe?.disableMinimumCellWidth===!0?1:10,fn=d.useRef(),Rn=d.useRef(null),xn=d.useRef(null),Wt=d.useCallback(()=>{const V=Xe.current,ee=Mn.current;if(V===null||ee===null||(Rn.current===null&&(Rn.current=V.getContext("2d",{alpha:!1}),V.width=0,V.height=0),xn.current===null&&(xn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),Rn.current===null||xn.current===null||B===null||Ne===null))return;let Ce=!1;const Re=Ue=>{Ce=!0,rt(Ue)},de=fn.current,pe={headerCanvasCtx:xn.current,canvasCtx:Rn.current,bufferACtx:B,bufferBCtx:Ne,width:n,height:r,cellXOffset:nt,cellYOffset:a,translateX:Math.round(De),translateY:Math.round(ft),mappedColumns:St,enableGroups:y,freezeColumns:P,dragAndDropState:Z,theme:Se,headerHeight:l,groupHeaderHeight:c,disabledRows:Ee??et.empty(),rowHeight:h,verticalBorder:je,isResizing:_,resizeCol:H,isFocused:E,selection:S,fillHandle:u,drawCellCallback:ne,hasAppendRow:we,overrideCursor:Re,maxScaleFactor:zt,freezeTrailingRows:C,rows:g,drawFocus:I,getCellContent:f,getGroupDetails:ut??(Ue=>({name:Ue})),getRowThemeOverride:p,drawHeaderCallback:ie,prelightCells:mt,highlightRegions:ge,imageLoader:Dt,lastBlitData:Et,damage:Pt.current,hoverValues:On.current,hoverInfo:Bn.current,spriteManager:cn,scrolling:sn,hyperWrapping:Qe?.hyperWrapping??!1,touchMode:xt,enqueue:cr.current,renderStateProvider:Ge,renderStrategy:Qe?.renderStrategy??(fa.value?"double-buffer":"single-buffer"),getCellRenderer:Te,minimumCellWidth:tn,resizeIndicator:Ie};pe.damage===void 0?(fn.current=pe,Xu(pe,de)):Xu(pe,void 0),!Ce&&(pe.damage===void 0||pe.damage.has(Bn?.current?.[0]))&&rt(void 0)},[B,Ne,n,r,nt,a,De,ft,St,y,P,Z,Se,l,c,Ee,h,je,_,we,H,E,S,u,C,g,I,zt,f,ut,p,ne,ie,mt,ge,Dt,cn,sn,Qe?.hyperWrapping,Qe?.renderStrategy,xt,Ge,Te,tn,Ie]),En=d.useRef(Wt);d.useLayoutEffect(()=>{Wt(),En.current=Wt},[Wt]),d.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,fn.current=void 0,En.current()))()},[]);const Tn=d.useCallback(V=>{Pt.current=V,En.current(),Pt.current=void 0},[]),xe=pv(Tn);cr.current=xe;const Lt=d.useCallback(V=>{Tn(new fi(V.map(ee=>ee.cell)))},[Tn]);Dt.setCallback(Tn);const[Xt,Wn]=d.useState(!1),[Zt,Ut]=In??[],Kt=Zt!==void 0&&Ut===-1&&Zt>=0&&Zt<St.length&&St[Zt].headerRowMarkerDisabled!==!0,Ln=Zt!==void 0&&Ut===-2;let Fn=!1,ki=!1,Lr=Pe;if(Lr===void 0&&Zt!==void 0&&Ut!==void 0&&Ut>-1&&Ut<g){const V=f([Zt,Ut],!0);Fn=V.kind===Un.NewRow||V.kind===Un.Marker&&V.markerKind!=="number",ki=V.kind===Y.Boolean&&Ql(V),Lr=V.cursor}const Ho=G?"grabbing":(yt??!1)||_?"col-resize":Xt||v?"crosshair":Lr!==void 0?Lr:Kt||Fn||ki||Ln?"pointer":"default",Lo=d.useMemo(()=>({contain:"strict",display:"block",cursor:Ho}),[Ho]),Fo=d.useRef("default"),Kn=oe?.current;Kn!=null&&Fo.current!==Lo.cursor&&(Kn.style.cursor=Fo.current=Lo.cursor);const gn=d.useCallback((V,ee,Ce,Re)=>{if(ut===void 0)return;const de=ut(V);if(de.actions!==void 0){const pe=th(ee,de.actions);for(const[Ue,ke]of pe.entries())if(Zr(ke,Ce+ee.x,Re+ke.y))return de.actions[Ue]}},[ut]),br=d.useCallback((V,ee,Ce,Re)=>{const de=St[ee];if(!G&&!_&&!(yt??!1)){const pe=Ht(V,ee,-1);Vn(pe!==void 0);const Ue=nh(void 0,de,pe.x,pe.y,pe.width,pe.height,Se,ns(de.title)==="rtl");if(de.hasMenu===!0&&Ue.menuBounds!==void 0&&Zr(Ue.menuBounds,Ce,Re))return{area:"menu",bounds:Ue.menuBounds};if(de.indicatorIcon!==void 0&&Ue.indicatorIconBounds!==void 0&&Zr(Ue.indicatorIconBounds,Ce,Re))return{area:"indicator",bounds:Ue.indicatorIconBounds}}},[St,Ht,yt,G,_,Se]),no=d.useRef(0),yr=d.useRef(),ro=d.useRef(!1),Si=d.useCallback(V=>{const ee=Xe.current,Ce=oe?.current;if(ee===null||V.target!==ee&&V.target!==Ce)return;ro.current=!0;const Re=V.clientX,de=V.clientY;if(V.target===Ce&&Ce!==null){const Ue=Ce.getBoundingClientRect();if(Re>Ue.right||de>Ue.bottom)return}const pe=gt(ee,Re,de,V);yr.current=pe.location,pe.isTouch&&(no.current=Date.now()),un.current!==pe.isTouch&&Pn(pe.isTouch),!(pe.kind===Rr&&br(ee,pe.location[0],Re,de)!==void 0)&&(pe.kind===Jn&&gn(pe.group,pe.bounds,pe.localEventX,pe.localEventY)!==void 0||(O?.(pe),!pe.isTouch&&re!==!0&&re!==pe.kind&&pe.button<3&&pe.button!==1&&V.preventDefault()))},[oe,re,gt,gn,br,O]);Sn("pointerdown",Si,bt,!1);const Fr=d.useRef(0),oo=d.useCallback(V=>{const ee=Fr.current;Fr.current=Date.now();const Ce=Xe.current;if(ro.current=!1,D===void 0||Ce===null)return;const Re=oe?.current,de=V.target!==Ce&&V.target!==Re,pe=V.clientX,Ue=V.clientY,ke=V.pointerType==="mouse"?V.button<3:!0;let Ye=gt(Ce,pe,Ue,V);Ye.isTouch&&no.current!==0&&Date.now()-no.current>500&&(Ye={...Ye,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ye.isTouch?1e3:500)&&(Ye={...Ye,isDoubleClick:!0}),un.current!==Ye.isTouch&&Pn(Ye.isTouch),!de&&V.cancelable&&ke&&V.preventDefault();const[vt]=Ye.location,pn=br(Ce,vt,pe,Ue);if(Ye.kind===Rr&&pn!==void 0){(Ye.button!==0||yr.current?.[0]!==vt||yr.current?.[1]!==-1)&&D(Ye,!0);return}else if(Ye.kind===Jn){const jt=gn(Ye.group,Ye.bounds,Ye.localEventX,Ye.localEventY);if(jt!==void 0){Ye.button===0&&jt.onClick(Ye);return}}D(Ye,de)},[D,oe,gt,br,gn]);Sn("pointerup",oo,bt,!1);const wr=d.useCallback(V=>{const ee=Xe.current;if(ee===null)return;const Ce=oe?.current,Re=V.target!==ee&&V.target!==Ce;let de,pe,Ue=!0;V instanceof MouseEvent?(de=V.clientX,pe=V.clientY,Ue=V.button<3):(de=V.changedTouches[0].clientX,pe=V.changedTouches[0].clientY);const ke=gt(ee,de,pe,V);un.current!==ke.isTouch&&Pn(ke.isTouch),!Re&&V.cancelable&&Ue&&V.preventDefault();const[Ye]=ke.location;if(ke.kind===Rr){const vt=br(ee,Ye,de,pe);vt!==void 0&&ke.button===0&&yr.current?.[0]===Ye&&yr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ye,vt.bounds):vt.area==="indicator"&&w?.(Ye,vt.bounds))}},[oe,gt,br,m,w]);Sn("click",wr,bt,!1);const io=d.useCallback(V=>{const ee=Xe.current,Ce=oe?.current;if(ee===null||V.target!==ee&&V.target!==Ce||M===void 0)return;const Re=gt(ee,V.clientX,V.clientY,V);M(Re,()=>{V.cancelable&&V.preventDefault()})},[oe,gt,M]);Sn("contextmenu",io,oe?.current??null,!1);const Mi=d.useCallback(V=>{Pt.current=new fi(V.map(ee=>ee.item)),On.current=V,En.current(),Pt.current=void 0},[]),Ao=d.useMemo(()=>new dv(Mi),[Mi]),Fe=d.useRef(Ao);Fe.current=Ao,d.useLayoutEffect(()=>{const V=Fe.current;if(In===void 0||In[1]<0){V.setHovered(In);return}const ee=f(In,!0),Ce=Te(ee),Re=Ce===void 0&&ee.kind===Y.Custom||Ce?.needsHover!==void 0&&(typeof Ce.needsHover=="boolean"?Ce.needsHover:Ce.needsHover(ee));V.setHovered(Re?In:void 0)},[f,Te,In]);const _o=d.useRef(),Oa=d.useCallback(V=>{const ee=Xe.current;if(ee===null)return;const Ce=oe?.current,Re=V.target!==ee&&V.target!==Ce,de=gt(ee,V.clientX,V.clientY,V);if(de.kind!=="out-of-bounds"&&Re&&!ro.current&&!de.isTouch)return;const pe=(ke,Ye)=>{Dn(vt=>vt===ke||vt?.[0][0]===ke?.[0][0]&&vt?.[0][1]===ke?.[0][1]&&(vt?.[1][0]===ke?.[1][0]&&vt?.[1][1]===ke?.[1][1]||!Ye)?vt:ke)};if(!ih(de,_o.current))rt(void 0),N?.(de),pe(de.kind===ga?void 0:[de.location,[de.localEventX,de.localEventY]],!0),_o.current=de;else if(de.kind==="cell"||de.kind===Rr||de.kind===Jn){let ke=!1,Ye=!0;if(de.kind==="cell"){const pn=f(de.location);Ye=Te(pn)?.needsHoverPosition??pn.kind===Y.Custom,ke=Ye}else ke=!0;const vt=[de.location,[de.localEventX,de.localEventY]];pe(vt,Ye),Bn.current=vt,ke&&Tn(new fi([de.location]))}const Ue=de.location[0]>=(ue?0:1);Jt(de.kind===Rr&&de.isEdge&&Ue&&le===!0),Wn(de.kind==="cell"&&de.isFillHandle),k?.(V),J(de)},[oe,gt,ue,le,k,J,N,f,Te,Tn]);Sn("pointermove",Oa,bt,!0);const Ar=d.useCallback(V=>{const ee=Xe.current;if(ee===null)return;let Ce,Re;S.current!==void 0&&(Ce=Ht(ee,S.current.cell[0],S.current.cell[1]),Re=S.current.cell),te?.({bounds:Ce,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Re})},[te,S,Ht]),Da=d.useCallback(V=>{const ee=Xe.current;if(ee===null)return;let Ce,Re;S.current!==void 0&&(Ce=Ht(ee,S.current.cell[0],S.current.cell[1]),Re=S.current.cell),X?.({bounds:Ce,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Re})},[X,S,Ht]),rr=d.useCallback(V=>{if(Xe.current=V,ae!==void 0&&(ae.current=V),Qe?.eventTarget)kt.current=Qe.eventTarget;else if(V===null)kt.current=window;else{const ee=V.getRootNode();ee===document&&(kt.current=window),kt.current=ee}},[ae,Qe?.eventTarget]),Vo=d.useCallback(V=>{const ee=Xe.current;if(ee===null||re===!1||_){V.preventDefault();return}let Ce,Re;const de=gt(ee,V.clientX,V.clientY);if(re!==!0&&de.kind!==re){V.preventDefault();return}const pe=(jt,Mt)=>{Ce=jt,Re=Mt};let Ue,ke,Ye;const vt=(jt,Mt,ct)=>{Ue=jt,ke=Mt,Ye=ct};let pn=!1;if(fe?.({...de,setData:pe,setDragImage:vt,preventDefault:()=>pn=!0,defaultPrevented:()=>pn}),!pn&&Ce!==void 0&&Re!==void 0&&V.dataTransfer!==null)if(V.dataTransfer.setData(Ce,Re),V.dataTransfer.effectAllowed="copyLink",Ue!==void 0&&ke!==void 0&&Ye!==void 0)V.dataTransfer.setDragImage(Ue,ke,Ye);else{const[jt,Mt]=de.location;if(Mt!==void 0){const ct=document.createElement("canvas"),Ke=Ht(ee,jt,Mt);Vn(Ke!==void 0);const ht=Math.ceil(window.devicePixelRatio??1);ct.width=Ke.width*ht,ct.height=Ke.height*ht;const Bt=ct.getContext("2d");Bt!==null&&(Bt.scale(ht,ht),Bt.textBaseline="middle",Mt===-1?(Bt.font=Se.headerFontFull,Bt.fillStyle=Se.bgHeader,Bt.fillRect(0,0,ct.width,ct.height),rh(Bt,0,0,Ke.width,Ke.height,St[jt],!1,Se,!1,void 0,void 0,!1,0,cn,ie,!1)):(Bt.font=Se.baseFontFull,Bt.fillStyle=Se.bgCell,Bt.fillRect(0,0,ct.width,ct.height),eh(Bt,f([jt,Mt]),0,Mt,!1,!1,0,0,Ke.width,Ke.height,!1,Se,Se.bgCell,Dt,cn,1,void 0,!1,0,void 0,void 0,void 0,Ge,Te,()=>{}))),ct.style.left="-100%",ct.style.position="absolute",ct.style.width=`${Ke.width}px`,ct.style.height=`${Ke.height}px`,document.body.append(ct),V.dataTransfer.setDragImage(ct,Ke.width/2,Ke.height/2),window.setTimeout(()=>{ct.remove()},0)}}else V.preventDefault()},[re,_,gt,fe,Ht,Se,St,cn,ie,f,Dt,Ge,Te]);Sn("dragstart",Vo,oe?.current??null,!1,!1);const ao=d.useRef(),Ii=d.useCallback(V=>{const ee=Xe.current;if(ve!==void 0&&V.preventDefault(),ee===null||ce===void 0)return;const Ce=gt(ee,V.clientX,V.clientY),[Re,de]=Ce.location,pe=Re-(ue?0:1),[Ue,ke]=ao.current??[];(Ue!==pe||ke!==de)&&(ao.current=[pe,de],ce([pe,de],V.dataTransfer))},[ue,gt,ce,ve]);Sn("dragover",Ii,oe?.current??null,!1,!1);const Pa=d.useCallback(()=>{ao.current=void 0,he?.()},[he]);Sn("dragend",Pa,oe?.current??null,!1,!1);const za=d.useCallback(V=>{const ee=Xe.current;if(ee===null||ve===void 0)return;V.preventDefault();const Ce=gt(ee,V.clientX,V.clientY),[Re,de]=Ce.location,pe=Re-(ue?0:1);ve([pe,de],V.dataTransfer)},[ue,gt,ve]);Sn("drop",za,oe?.current??null,!1,!1);const or=d.useCallback(()=>{Ve?.()},[Ve]);Sn("dragleave",or,oe?.current??null,!1,!1);const dr=d.useRef(S);dr.current=S;const Cn=d.useRef(null),j=d.useCallback(V=>{Xe.current===null||!Xe.current.contains(document.activeElement)||(V===null&&dr.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):V!==null&&V.focus({preventScroll:!0}),Cn.current=V)},[ae]);d.useImperativeHandle(t,()=>({focus:()=>{const V=Cn.current;V===null||!document.contains(V)?ae?.current?.focus({preventScroll:!0}):V.focus({preventScroll:!0})},getBounds:(V,ee)=>{if(!(ae===void 0||ae.current===null))return Ht(ae.current,V??0,ee??-1)},damage:Lt,getMouseArgsForPosition:(V,ee,Ce)=>{if(!(ae===void 0||ae.current===null))return gt(ae.current,V,ee,Ce)}}),[ae,Lt,Ht,gt]);const Vt=d.useRef(),_r=am(()=>{if(n<50||Qe?.disableAccessibilityTree===!0)return null;let V=Fl(St,nt,n,Z,De);const ee=ue?0:-1;!ue&&V[0]?.sourceIndex===0&&(V=V.slice(1));const[Ce,Re]=S.current?.cell??[],de=S.current?.range,pe=V.map(ke=>ke.sourceIndex),Ue=Tr(a,Math.min(g,a+o));return Ce!==void 0&&Re!==void 0&&!(pe.includes(Ce)&&Ue.includes(Re))&&j(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":St.length+ee},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},V.map(ke=>d.createElement("th",{role:"columnheader","aria-selected":S.columns.hasIndex(ke.sourceIndex),"aria-colindex":ke.sourceIndex+1+ee,tabIndex:-1,onFocus:Ye=>{if(Ye.target!==Cn.current)return ye?.([ke.sourceIndex,-1])},key:ke.sourceIndex},ke.title)))),d.createElement("tbody",{role:"rowgroup"},Ue.map(ke=>d.createElement("tr",{role:"row","aria-selected":S.rows.hasIndex(ke),key:ke,"aria-rowindex":ke+2},V.map(Ye=>{const vt=Ye.sourceIndex,pn=Qn(vt,ke),jt=Ce===vt&&Re===ke,Mt=de!==void 0&&vt>=de.x&&vt<de.x+de.width&&ke>=de.y&&ke<de.y+de.height,ct=`glide-cell-${vt}-${ke}`,Ke=[vt,ke],ht=f(Ke,!0);return d.createElement("td",{key:pn,role:"gridcell","aria-colindex":vt+1+ee,"aria-selected":Mt,"aria-readonly":Io(ht)||!So(ht),id:ct,"data-testid":ct,onClick:()=>{const Bt=ae?.current;if(Bt!=null)return te?.({bounds:Ht(Bt,vt,ke),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Ke})},onFocusCapture:Bt=>{if(!(Bt.target===Cn.current||Vt.current?.[0]===vt&&Vt.current?.[1]===ke))return Vt.current=Ke,ye?.(Ke)},ref:jt?j:void 0,tabIndex:-1},gv(ht,Te))})))))},[n,St,nt,Z,De,g,a,o,S,j,f,ae,te,Ht,ye],200),lo=P===0||!z?0:nt>P?1:Gn(-De/100,0,1),Ri=-a*32+ft,so=T?Gn(-Ri/100,0,1):0,Ha=d.useMemo(()=>{if(!lo&&!so)return null;const V={position:"absolute",top:0,left:Hn,width:n-Hn,height:r,opacity:lo,pointerEvents:"none",transition:tt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:zn,left:0,width:n,height:r,opacity:so,pointerEvents:"none",transition:Me?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,lo>0&&d.createElement("div",{id:"shadow-x",style:V}),so>0&&d.createElement("div",{id:"shadow-y",style:ee}))},[lo,so,Hn,n,tt,zn,r,Me]),K=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ar,onKeyUp:Da,onFocus:x,onBlur:R,ref:rr,style:Lo},_r),d.createElement("canvas",{ref:Mn,style:K}),Ha)},vv=d.memo(d.forwardRef(mv));function oi(e,t,n,r){return Gn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const bv=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,s]=d.useState(),[a,l]=d.useState(),[u,c]=d.useState(!1),[h,g]=d.useState(),[f,p]=d.useState(),[m,w]=d.useState(),[y,v]=d.useState(!1),[x,R]=d.useState(),{onHeaderMenuClick:E,onHeaderIndicatorClick:S,getCellContent:P,onColumnMoved:M,onColumnResize:C,onColumnResizeStart:z,onColumnResizeEnd:T,gridRef:I,maxColumnWidth:O,minColumnWidth:D,onRowMoved:k,lockColumns:J,onColumnProposeMove:N,onMouseDown:Z,onMouseUp:ue,onItemHovered:te,onDragStart:X,canvasRef:ge}=e,ae=(C??T??z)!==void 0,{columns:fe,selection:he}=e,oe=he.columns,_=d.useCallback(ne=>{const[ie,ye]=ne.location;i!==void 0&&a!==ie&&ie>=J?(c(!0),l(ie)):f!==void 0&&ye!==void 0?(v(!0),w(Math.max(0,ye))):r===void 0&&!u&&!y&&te?.(ne)},[i,f,a,te,J,r,u,y]),H=M!==void 0,G=d.useCallback(ne=>{if(ne.button===0){const[ie,ye]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&ae){const ce=I?.current?.getBounds(fe.length-1,-1);ce!==void 0&&(n(ce.x),o(fe.length-1))}else if(ne.kind==="header"&&ie>=J){const ce=ge?.current;if(ne.isEdge&&ae&&ce){n(ne.bounds.x),o(ie);const ve=ce.getBoundingClientRect().width/ce.offsetWidth,Ve=ne.bounds.width/ve;z?.(fe[ie],Ve,ie,Ve+(fe[ie].growOffset??0))}else ne.kind==="header"&&H&&(g(ne.bounds.x),s(ie))}else ne.kind==="cell"&&J>0&&ie===0&&ye!==void 0&&k!==void 0&&(R(ne.bounds.y),p(ye))}Z?.(ne)},[Z,ae,J,k,I,fe,H,z,ge]),re=d.useCallback((ne,ie)=>{u||y||E?.(ne,ie)},[u,y,E]),le=d.useCallback((ne,ie)=>{u||y||S?.(ne,ie)},[u,y,S]),Ee=d.useRef(-1),we=d.useCallback(()=>{Ee.current=-1,p(void 0),w(void 0),R(void 0),v(!1),s(void 0),l(void 0),g(void 0),c(!1),o(void 0),n(void 0)},[]),ut=d.useCallback((ne,ie)=>{if(ne.button===0){if(r!==void 0){if(oe?.hasIndex(r)===!0)for(const ce of oe){if(ce===r)continue;const ve=fe[ce],Ve=oi(ve,Ee.current,D,O);C?.(ve,Ve,ce,Ve+(ve.growOffset??0))}const ye=oi(fe[r],Ee.current,D,O);if(T?.(fe[r],ye,r,ye+(fe[r].growOffset??0)),oe.hasIndex(r))for(const ce of oe){if(ce===r)continue;const ve=fe[ce],Ve=oi(ve,Ee.current,D,O);T?.(ve,Ve,ce,Ve+(ve.growOffset??0))}}we(),i!==void 0&&a!==void 0&&N?.(i,a)!==!1&&M?.(i,a),f!==void 0&&m!==void 0&&k?.(f,m)}ue?.(ne,ie)},[ue,r,i,a,f,m,oe,T,fe,D,O,C,M,k,we,N]),Se=d.useMemo(()=>{if(!(i===void 0||a===void 0)&&i!==a&&N?.(i,a)!==!1)return{src:i,dest:a}},[i,a,N]),mt=d.useCallback(ne=>{const ie=ge?.current;if(i!==void 0&&h!==void 0)Math.abs(ne.clientX-h)>20&&c(!0);else if(f!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&v(!0);else if(r!==void 0&&t!==void 0&&ie){const ye=ie.getBoundingClientRect().width/ie.offsetWidth,ce=(ne.clientX-t)/ye,ve=fe[r],Ve=oi(ve,ce,D,O);if(C?.(ve,Ve,r,Ve+(ve.growOffset??0)),Ee.current=ce,oe?.first()===r)for(const $e of oe){if($e===r)continue;const tt=fe[$e],Me=oi(tt,Ee.current,D,O);C?.(tt,Me,$e,Me+(tt.growOffset??0))}}},[i,h,f,x,r,t,fe,D,O,C,oe,ge]),wt=d.useCallback((ne,ie)=>{if(f===void 0||m===void 0)return P(ne,ie);let[ye,ce]=ne;return ce===m?ce=f:(ce>m&&(ce-=1),ce>=f&&(ce+=1)),P([ye,ce],ie)},[f,m,P]),je=d.useCallback(ne=>{X?.(ne),ne.defaultPrevented()||we()},[we,X]);return d.createElement(vv,{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:wt,isResizing:r!==void 0,onHeaderMenuClick:re,onHeaderIndicatorClick:le,isDragging:u,onItemHovered:_,onDragStart:je,onMouseDown:G,allowResize:ae,onMouseUp:ut,dragAndDropState:Se,onMouseMoveRaw:mt,ref:I})};function yv(e){const t=d.useRef(null),[n,r]=d.useState({width:e?.[0],height:e?.[1]});return d.useLayoutEffect(()=>{const o=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})}},i=new window.ResizeObserver(o);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const wv=(e,t,n)=>{const r=d.useRef(null),o=d.useRef(null),i=d.useRef(null),s=d.useRef(0),a=d.useRef(t);a.current=t;const l=n.current;d.useEffect(()=>{const u=()=>{if(o.current===!1&&l!==null){const g=[l.scrollLeft,l.scrollTop];if(i.current?.[0]===g[0]&&i.current?.[1]===g[1])if(s.current>10){i.current=null,o.current=null;return}else s.current++;else s.current=0,a.current(g[0],g[1]),i.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{o.current=!0,i.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},h=g=>{g.touches.length===0&&(o.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",h),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",h),r.current!==null&&window.clearTimeout(r.current)}}},[e,l])},xv=()=>e=>e.isSafari?"scroll":"auto",Cv=hn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[xv()]}}),kv=33554400,Sv=5e6;function Mv(e){const[t,n]=d.useState(!1),r=typeof window>"u"?null:window,o=d.useRef(0);return Sn("touchstart",d.useCallback(()=>{window.clearTimeout(o.current),n(!0)},[]),r,!0,!1),Sn("touchend",d.useCallback(i=>{i.touches.length===0&&(o.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const Iv=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:s,className:a,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:f=!1,scrollRef:p,initialSize:m}=e,w=[],y=g?.sticky??!1,v=g?.fill??!1,x=d.useRef(0),R=d.useRef(0),E=d.useRef(null),S=typeof window>"u"?1:window.devicePixelRatio,P=d.useRef(S);d.useEffect(()=>{if(P.current!==S){x.current=0,R.current=0,P.current=S;const he=E.current;he!==null&&k.current(he.scrollLeft,he.scrollTop)}},[S]);const M=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),C=d.useRef(null),z=Mv(200),[T,I]=d.useState(!0),O=d.useRef(0);d.useLayoutEffect(()=>{if(!T||z||M.current.lockDirection===void 0)return;const he=E.current;if(he===null)return;const[oe,_]=M.current.lockDirection;oe!==void 0?he.scrollLeft=oe:_!==void 0&&(he.scrollTop=_),M.current.lockDirection=void 0},[z,T]);const D=d.useCallback((he,oe)=>{const _=E.current;if(_===null)return;oe=oe??_.scrollTop,he=he??_.scrollLeft;const H=M.current.scrollTop,G=M.current.scrollLeft,re=he-G,le=oe-H;z&&re!==0&&le!==0&&(Math.abs(re)>3||Math.abs(le)>3)&&l&&M.current.lockDirection===void 0&&(M.current.lockDirection=Math.abs(re)<Math.abs(le)?[G,void 0]:[void 0,H]);const Ee=M.current.lockDirection;he=Ee?.[0]??he,oe=Ee?.[1]??oe,M.current.scrollLeft=he,M.current.scrollTop=oe;const we=_.clientWidth,ut=_.clientHeight,Se=oe,mt=R.current-Se,wt=_.scrollHeight-ut;R.current=Se;let je;if(wt>0&&r>_.scrollHeight+5)if(Math.abs(mt)>2e3||Se===0||Se===wt){const ne=Math.max(0,Math.min(1,Se/wt)),ie=r-ut;je=ne*ie,x.current=je}else x.current-=mt,je=x.current;else je=Se,x.current=je;je=Math.max(0,Math.min(je,r-ut)),x.current=je,Ee!==void 0&&(window.clearTimeout(O.current),I(!1),O.current=window.setTimeout(()=>I(!0),200)),i({x:he,y:je,width:we-c,height:ut-u,paddingRight:C.current?.clientWidth??0})},[u,c,r,i,l,z]);wv(f&&fa.value,D,E);const k=d.useRef(D);k.current=D;const J=d.useRef(),N=d.useRef(!1);d.useLayoutEffect(()=>{N.current?D():N.current=!0},[D,u,c]);const Z=d.useCallback(he=>{E.current=he,p!==void 0&&(p.current=he)},[p]);let ue=0,te=0;const X=Math.min(r,kv);for(w.push(d.createElement("div",{key:ue++,style:{width:o,height:0}}));te<X;){const he=Math.min(Sv,X-te);w.push(d.createElement("div",{key:ue++,style:{width:0,height:he}})),te+=he}const{ref:ge,width:ae,height:fe}=yv(m);return typeof window<"u"&&(J.current?.height!==fe||J.current?.width!==ae)&&(window.setTimeout(()=>k.current(),0),J.current={width:ae,height:fe}),(ae??0)===0||(fe??0)===0?d.createElement("div",{ref:ge}):d.createElement("div",{ref:ge},d.createElement(Cv,{isSafari:fa.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:Z,style:J.current,draggable:s,onDragStart:he=>{s||(he.stopPropagation(),he.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>D()},d.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},w),h!==void 0&&d.createElement(d.Fragment,null,!v&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:C,style:{height:fe,maxHeight:n-Math.ceil(S%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:y?c??0:void 0,pointerEvents:"auto"}},h))))))},Rv=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:s,freezeColumns:a,experimental:l,nonGrowWidth:u,clientSize:c,className:h,onVisibleRegionChanged:g,scrollRef:f,preventDiagonalScrolling:p,rightElement:m,rightElementProps:w,overscrollX:y,overscrollY:v,initialSize:x,smoothScrollX:R=!1,smoothScrollY:E=!1,isDraggable:S}=e,{paddingRight:P,paddingBottom:M}=l??{},[C,z]=c,T=d.useRef(),I=d.useRef(),O=d.useRef(),D=d.useRef(),k=u+Math.max(0,y??0);let J=s?o+i:o;if(typeof r=="number")J+=n*r;else for(let te=0;te<n;te++)J+=r(te);v!==void 0&&(J+=v);const N=d.useRef(),Z=d.useCallback(()=>{if(N.current===void 0)return;const te={...N.current};let X=0,ge=te.x<0?-te.x:0,ae=0,fe=0;te.x=te.x<0?0:te.x;let he=0;for(let le=0;le<a;le++)he+=t[le].width;for(const le of t){const Ee=X-he;if(te.x>=Ee+le.width)X+=le.width,fe++,ae++;else if(te.x>Ee)X+=le.width,R?ge+=Ee-te.x:fe++,ae++;else if(te.x+te.width>Ee)X+=le.width,ae++;else break}let oe=0,_=0,H=0;if(typeof r=="number")E?(_=Math.floor(te.y/r),oe=_*r-te.y):_=Math.ceil(te.y/r),H=Math.ceil(te.height/r)+_,oe<0&&H++;else{let le=0;for(let Ee=0;Ee<n;Ee++){const we=r(Ee),ut=le+(E?0:we/2);if(te.y>=le+we)le+=we,_++,H++;else if(te.y>ut)le+=we,E?oe+=ut-te.y:_++,H++;else if(te.y+te.height>we/2+le)le+=we,H++;else break}}_=Math.max(0,Math.min(_,n-1)),H=Math.max(_,Math.min(H,n));const G={x:fe,y:_,width:ae-fe,height:H-_},re=T.current;(re===void 0||re.y!==G.y||re.x!==G.x||re.height!==G.height||re.width!==G.width||I.current!==ge||O.current!==oe||te.width!==D.current?.[0]||te.height!==D.current?.[1])&&(g?.({x:fe,y:_,width:ae-fe,height:H-_},te.width,te.height,te.paddingRight??0,ge,oe),T.current=G,I.current=ge,O.current=oe,D.current=[te.width,te.height])},[t,r,n,g,a,R,E]),ue=d.useCallback(te=>{N.current=te,Z()},[Z]);return d.useEffect(()=>{Z()},[Z]),d.createElement(Iv,{scrollRef:f,className:h,kineticScrollPerfHack:l?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:S===!0||typeof S=="string",scrollWidth:k+(P??0),scrollHeight:J+(M??0),clientHeight:z,rightElement:m,paddingBottom:M,paddingRight:P,rightElementProps:w,update:ue,initialSize:x},d.createElement(bv,{eventTargetRef:f,width:C,height:z,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}))},Ev=hn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),Tv=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Ov=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),Dv=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),Pv=10,zv=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:s,searchResults:a,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:h=!1,onSearchClose:g}=e,[f]=d.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=d.useState(""),w=s??p,y=d.useCallback(X=>{m(X),l?.(X)},[l]),[v,x]=d.useState(),R=d.useRef(v);R.current=v,d.useEffect(()=>{a!==void 0&&(a.length>0?x(X=>({rowsSearched:r,results:a.length,selectedIndex:X?.selectedIndex??-1})):x(void 0))},[r,a]);const E=d.useRef();E.current===void 0&&(E.current=new AbortController);const S=d.useRef(),[P,M]=d.useState([]),C=a??P,z=d.useCallback(()=>{S.current!==void 0&&(window.cancelAnimationFrame(S.current),S.current=void 0),E.current!==void 0&&E.current.abort(),E.current=new AbortController},[]),T=d.useRef(n);T.current=n;const I=d.useCallback(X=>{const ge=new RegExp(X.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=T.current,fe=Math.min(10,r),he=0;x(void 0),M([]);const oe=[],_=async()=>{if(u===void 0)return;const H=performance.now(),G=r-he;let re=u({x:0,y:ae,width:o.length,height:Math.min(fe,G,r-ae)},E.current.signal);typeof re=="function"&&(re=await re());let le=!1;for(const[wt,je]of re.entries())for(const[ne,ie]of je.entries()){let ye;switch(ie.kind){case Y.Text:case Y.Number:ye=ie.displayData;break;case Y.Uri:case Y.Markdown:ye=ie.data;break;case Y.Boolean:ye=typeof ie.data=="boolean"?ie.data.toString():void 0;break;case Y.Image:case Y.Bubble:ye=ie.data.join("🐳");break;case Y.Custom:ye=ie.copyData;break}ye!==void 0&&ge.test(ye)&&(oe.push([ne,wt+ae]),le=!0)}const Ee=performance.now();le&&M([...oe]),he+=re.length,Vn(he<=r);const we=R.current?.selectedIndex??-1;x({results:oe.length,rowsSearched:he,selectedIndex:we}),c?.(oe,we),ae+fe>=r?ae=0:ae+=fe;const ut=Ee-H,Se=Math.max(ut,1),mt=Pv/Se;fe=Math.ceil(fe*mt),he<r&&oe.length<1e3&&(S.current=window.requestAnimationFrame(_))};z(),S.current=window.requestAnimationFrame(_)},[z,o.length,u,c,r]),O=d.useCallback(()=>{g?.(),x(void 0),M([]),c?.([],-1),z(),t?.current?.focus()},[z,t,g,c]),D=d.useCallback(X=>{y(X.target.value),a===void 0&&(X.target.value===""?(x(void 0),M([]),z()):I(X.target.value))},[I,z,y,a]);d.useEffect(()=>{i.current!==null&&(y(""),x(void 0),P.length>0&&(M([]),c?.([],-1)),h?i.current.focus({preventScroll:!0}):z())},[h,i]);const k=d.useCallback(X=>{if(X?.stopPropagation?.(),v===void 0||v.results===0)return;const ge=(v.selectedIndex+1)%v.results;x({...v,selectedIndex:ge}),c?.(C,ge)},[v,c,C]),J=d.useCallback(X=>{if(X?.stopPropagation?.(),v===void 0||v.results===0)return;let ge=(v.selectedIndex-1)%v.results;ge<0&&(ge+=v.results),x({...v,selectedIndex:ge}),c?.(C,ge)},[c,C,v]),N=d.useCallback(X=>{(X.ctrlKey||X.metaKey)&&X.nativeEvent.code==="KeyF"||X.key==="Escape"?(O(),X.stopPropagation(),X.preventDefault()):X.key==="Enter"&&(X.shiftKey?J():k())},[O,k,J]);d.useEffect(()=>()=>{z()},[z]);const[Z,ue]=d.useState(!1);d.useEffect(()=>{if(h)ue(!0);else{const X=setTimeout(()=>ue(!1),150);return()=>clearTimeout(X)}},[h]);const te=d.useMemo(()=>{if(!h&&!Z)return null;let X;v!==void 0&&(X=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(X=`${v.selectedIndex+1} of ${X}`));const ge=fe=>{fe.stopPropagation()},ae={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return d.createElement(Ev,{className:"gdg-search-bar"+(h?"":" out"),onMouseDown:ge,onMouseMove:ge,onMouseUp:ge,onClick:ge},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:f,"aria-hidden":!h,"data-testid":"search-input",ref:i,onChange:D,value:w,tabIndex:h?void 0:-1,onKeyDownCapture:N}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:J,disabled:(v?.results??0)===0},Tv),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:k,disabled:(v?.results??0)===0},Ov),g!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:O},Dv)),v!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},X)),d.createElement("div",{className:"gdg-search-progress",style:ae})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:f},"Type to search")))},[h,Z,v,r,f,i,D,w,N,J,k,g,O]);return d.createElement(d.Fragment,null,d.createElement(Rv,{prelightCells:C,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}),te)};class Hv extends d.PureComponent{wrapperRef=d.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,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}}const Lv=()=>e=>Math.max(16,e.targetHeight-10),Fv=hn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[Lv(),"px"]}}),Av=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[s,a]=Rt.useState(n);return Rt.createElement(Hv,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},Rt.createElement(Fv,{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"?i(s):l.key==="Escape"&&r()},autoFocus:!0}))};function _v(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 it(e,t,n){const r=ah(e,t);return r&&(n.didMatch=!0),r}function ah(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(ah(u,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const s=e.split("+"),a=s.pop();if(!_v(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":o=!0;break;case"meta":i=!0;break;case"primary":pa.value?i=!0:n=!0;break}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function Vv(e,t,n,r,o,i,s){const a=Rt.useCallback((c,h,g,f)=>{(i==="cell"||i==="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 p=n==="mixed"&&(g||f==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,w=(o==="mixed"||o==="additive")&&p;let y={current:c===void 0?void 0:{...c,rangeStack:f==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:et.empty(),rows:w?e.rows:et.empty()};g&&(i==="multi-rect"||i==="multi-cell")&&y.current!==void 0&&e.current!==void 0&&(y={...y,current:{...y.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(y,h)},[r,e,n,i,s,o,t]),l=Rt.useCallback((c,h,g)=>{c=c??e.rows,h!==void 0&&(c=c.add(h));let f;if(o==="exclusive"&&c.length>0)f={current:void 0,columns:et.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";f={current:p?e.current:void 0,columns:m?e.columns:et.empty(),rows:c}}t(f,!1)},[r,e,n,o,t]),u=Rt.useCallback((c,h,g)=>{c=c??e.columns,h!==void 0&&(c=c.add(h));let f;if(r==="exclusive"&&c.length>0)f={current:void 0,rows:et.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&o==="mixed"||o==="additive";f={current:p?e.current:void 0,rows:m?e.rows:et.empty(),columns:c}}t(f,!1)},[r,e,n,o,t]);return[a,l,u]}function $v(e,t,n,r,o){const i=d.useCallback(l=>{if(e===!0){const u=[];for(let c=l.y;c<l.y+l.height;c++){const h=[];for(let g=l.x;g<l.x+l.width;g++)g<0||c>=o?h.push({kind:Y.Loading,allowOverlay:!1}):h.push(t([g,c]));u.push(h)}return u}return e?.(l,r.signal)??[]},[r.signal,t,e,o]),s=e!==void 0?i:void 0,a=d.useCallback(l=>{if(s===void 0)return[];const u={...l,x:l.x-n};if(u.x<0){u.x=0,u.width--;const c=s(u,r.signal);return typeof c=="function"?async()=>(await c()).map(h=>[{kind:Y.Loading,allowOverlay:!1},...h]):c.map(h=>[{kind:Y.Loading,allowOverlay:!1},...h])}return s(u,r.signal)},[r.signal,s,n]);return[e!==void 0?a:void 0,s]}function Bv(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Y.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Jl?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Y.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Y.Image:case Y.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Y.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Y.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Y.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Y.Markdown:case Y.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Y.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Y.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Y.Protected:return{formatted:"************",rawValue:"",format:"string"};default:pi()}}function Wv(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:Bv(i))})}function Zu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Nv(e){const t=[];for(const n of e){const r=[];for(const o of n)o.format==="url"?r.push(o.rawValue?.toString()??""):o.format==="string-array"?r.push(o.formatted.map(i=>Zu(i,!0)).join(",")):r.push(o.doNotEscape===!0?o.formatted:Zu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
|
|
166
|
-
`)}function pl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Yu(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function jv(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Gv(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 o=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${o}><a href="${r.rawValue}">${pl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((i,s)=>`<li gdg-raw-value=${Yu(r.rawValue[s])}>`+pl(i)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Yu(r.rawValue?.toString()??"")} ${o}>${pl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function Uv(e,t){const n=Wv(e,t),r=Nv(n),o=Gv(n);return{textPlain:r,textHtml:o}}function Ju(e){const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],o=[];let i;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)i!==void 0&&o.push(i),i=[],r.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),l=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,u=l?.children.length===1&&l.children[0].nodeName==="FONT",c=a.querySelectorAll("br");for(const f of c)f.replaceWith(`
|
|
167
|
-
`);const h=a.getAttribute("gdg-raw-value"),g=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)i?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:g});else if(a.querySelector("ol")!==null){const f=a.querySelectorAll("li");i?.push({rawValue:[...f].map(p=>p.getAttribute("gdg-raw-value")??""),formatted:[...f].map(p=>p.textContent??""),format:"string-array"})}else if(h!==null)i?.push({rawValue:jv(h),formatted:a.textContent??"",format:g});else{let f=a.textContent??"";u&&(f=f.replace(/\n(?!\n)/g,"")),i?.push({rawValue:f??"",formatted:f??"",format:g})}}}return i!==void 0&&o.push(i),o}function Kv(e,t,n,r,o){const i=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 h=t({x:a.x,y:a.y,width:1,height:a.height},o.signal);if(typeof h=="function")return i;l.push(...h);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},o.signal);if(typeof g=="function")return i;l.push(...g)}else{const h=t({x:a.x,y:a.y,width:a.width,height:a.height},o.signal);if(typeof h=="function")return i;l.push(...h)}let u=a.x-n,c=a.x+a.width-1-n;for(const h of l)for(const g of h)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 Qu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function qv(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=[],o=0,i=t.None;e=e.replace(/\r\n/g,`
|
|
168
|
-
`);let s=0;for(const a of e){switch(i){case t.None:a===" "||a===`
|
|
169
|
-
`?(r.push(e.slice(o,s)),o=s+1,a===`
|
|
170
|
-
`&&(n.push(r),r=[])):a==='"'&&(i=t.inString);break;case t.inString:a==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?i=t.inString:((a===" "||a===`
|
|
171
|
-
`)&&(r.push(Qu(e.slice(o,s))),o=s+1,a===`
|
|
172
|
-
`&&(n.push(r),r=[])),i=t.None);break}s++}return o<e.length&&r.push(Qu(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function ec(e,t,n){const r=Uv(e,t),o=a=>{window.navigator.clipboard?.writeText(a)},i=(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{i(a,l)||o(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function lh(e){return e!==!0}function tc(e){return typeof e=="string"?e:`${e}px`}const Xv=()=>e=>e.innerWidth,Zv=()=>e=>e.innerHeight,Yv=hn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Xv()],"wmyidgi-1":[Zv()]}}),Jv=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Yv,{innerHeight:tc(n),innerWidth:tc(t),...o},r)},Qv=2,eb=1300;function tb(e,t,n){const r=Rt.useRef(0),[o,i]=e??[0,0];Rt.useEffect(()=>{if(o===0&&i===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/eb);const h=r.current**1.618*c*Qv;t.current?.scrollBy(o*h,i*h),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,o,i,n])}function nb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:s,remSize:a}){const[l,u,c,h,g,f]=Rt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,o,i];const p=a/16,m=e,w=Gd();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:h,overscrollX:g,overscrollY:f}}const Mr={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 nc(e){const t=pa.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 rb(e){const t=dm(e);return Rt.useMemo(()=>{if(t===void 0)return nc(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return nc({...Mr,...n})},[t])}function ob(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((s,a)=>t(s,r+1,[...o,a])).sort((s,a)=>s.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function hs(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 h=0;h<a.subGroups.length;h++){const g=h<a.subGroups.length-1?a.subGroups[h+1].headerIndex:l;r(a.subGroups[h],g,u||a.isCollapsed)}}const o=ob(e.groups);for(let a=0;a<o.length;a++){const l=a<o.length-1?o[a+1].headerIndex:null;r(o[a],l)}let i=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function $l(e,t){if(t===void 0||hs.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 ib(e,t,n,r){const o=Rt.useMemo(()=>e===void 0?void 0:hs(e,t),[e,t]),i=Rt.useMemo(()=>o?.reduce((c,h)=>(c[h.rowIndex]=h,c),{}),[o]),s=Rt.useMemo(()=>o===void 0?t:o.reduce((c,h)=>c+(h.isCollapsed?1:h.rows+1),0),[o,t]),a=Rt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>i?.[c]?e.height:typeof n=="number"?n:n(c),[i,e,n]),l=Rt.useCallback(c=>{if(o===void 0)return c;let h=c;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return c},[o]),u=Ir(r??e?.themeOverride,Rt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=$l(c,o);return h?e.themeOverride:r?.(c,f,g)},[o,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function ab(e,t){const n=Rt.useMemo(()=>e===void 0?void 0:hs(e,t),[e,t]);return{getRowGroupingForPath:uh,updateRowGroupingByPath:sh,mapper:Rt.useCallback(r=>{if(typeof r=="number")return $l(r,n);const o=$l(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function sh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,s)=>s===r?{...i,...n}:i):e.map((i,s)=>s===r?{...i,subGroups:sh(i.subGroups??[],o,n)}:i)}function uh(e,t){const[n,...r]=t;return r[0]===-1?e[n]:uh(e[n].subGroups??[],r)}function lb(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function sb(e,t,n,r,o){const[i,s]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,i]),[l,u,c]=cm(a),h=d.useRef(o);h.current=o;const g=lb(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(l.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),h.current()}},[t,f,c,g]);const p=(l.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),h.current()}},[e,p,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const ub=d.lazy(async()=>await Xl(()=>import("./data-grid-overlay-editor-BiH9JogL-SwK5dD6O.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let cb=0;function db(e){return f0(Nu(Nu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Ki(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 qi={kind:Y.Loading,allowOverlay:!1},Xi={columns:et.empty(),rows:et.empty(),current:void 0},hb=(e,t)=>{const[n,r]=d.useState(Xi),[o,i]=d.useState(),s=d.useRef(null),a=d.useRef(null),[l,u]=d.useState(),c=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:x,onCellClicked:R,onCellActivated:E,onFillPattern:S,onFinishedEditing:P,coercePasteValue:M,drawHeader:C,drawCell:z,editorBloom:T,onHeaderClicked:I,onColumnProposeMove:O,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:J,onCellContextMenu:N,className:Z,onHeaderContextMenu:ue,getCellsForSelection:te,onGroupHeaderContextMenu:X,onGroupHeaderRenamed:ge,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:he,searchResults:oe,onSearchValueChange:_,searchValue:H,onKeyDown:G,onKeyUp:re,keybindings:le,editOnType:Ee=!0,onRowAppended:we,onColumnAppended:ut,onColumnMoved:Se,validateCell:mt,highlightRegions:wt,rangeSelect:je="rect",columnSelect:ne="multi",rowSelect:ie="multi",rangeSelectionBlending:ye="exclusive",columnSelectionBlending:ce="exclusive",rowSelectionBlending:ve="exclusive",onDelete:Ve,onDragStart:$e,onMouseMove:tt,onPaste:Me,copyHeaders:Qe=!1,freezeColumns:Te=0,cellActivationBehavior:Ie="second-click",rowSelectionMode:De="auto",columnSelectionMode:ft="auto",onHeaderMenuClick:nt,onHeaderIndicatorClick:Xe,getGroupDetails:kt,rowGrouping:bt,onSearchClose:Dt,onItemHovered:Pt,onSelectionCleared:sn,showSearch:Yt,onVisibleRegionChanged:On,gridSelection:Et,onGridSelectionChange:pt,minColumnWidth:Dn=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Jt,provideEditor:Mn,trailingRowOptions:Pe,freezeTrailingRows:rt=0,allowedFillDirections:xt="orthogonal",scrollOffsetX:Pn,scrollOffsetY:un,verticalBorder:cn,onDragOverCell:zn,onDrop:Qt,onColumnResize:en,onColumnResizeEnd:We,onColumnResizeStart:St,customRenderers:Hn,fillHandle:Ht,experimental:gt,fixedShadowX:In,fixedShadowY:cr,headerIcons:Bn,imageWindowLoader:B,initialSize:Ne,isDraggable:Ge,onDragLeave:zt,onRowMoved:tn,overscrollX:fn,overscrollY:Rn,preventDiagonalScrolling:xn,rightElement:Wt,rightElementProps:En,trapFocus:Tn=!1,smoothScrollX:xe,smoothScrollY:Lt,scaleToRem:Xt=!1,rowHeight:Wn=34,headerHeight:Zt=36,groupHeaderHeight:Ut=Zt,theme:Kt,isOutsideClick:Ln,renderers:Fn,resizeIndicator:ki,scrollToActiveCell:Lr=!0,drawFocusRing:Ho=!0,portalElementRef:Lo}=e,Fo=Ho==="no-editor"?o===void 0:Ho,Kn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,gn=Kn?.kind??e.rowMarkers??"none",br=Kn?.width??e.rowMarkerWidth,no=Kn?.startIndex??e.rowMarkerStartIndex??1,yr=Kn?.theme??e.rowMarkerTheme,ro=Kn?.headerTheme,Si=Kn?.headerAlwaysVisible,Fr=ie!=="multi"||Kn?.headerDisabled===!0,oo=Kn?.checkboxStyle??"square",wr=Math.max(Dn,20),io=Math.max(yt,wr),Mi=Math.max(Jt??io,wr),Ao=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Fe,rowNumberMapper:_o,rowHeight:Oa,getRowThemeOverride:Ar}=ib(bt,v,Wn,f),Da=d.useMemo(()=>Number.parseFloat(Ao.fontSize),[Ao]),{rowHeight:rr,headerHeight:Vo,groupHeaderHeight:ao,theme:Ii,overscrollX:Pa,overscrollY:za}=nb({groupHeaderHeight:Ut,headerHeight:Zt,overscrollX:fn,overscrollY:Rn,remSize:Da,rowHeight:Oa,scaleToRem:Xt,theme:Kt}),or=rb(le),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),Cn=gn!=="none",j=Cn?1:0,Vt=Pe!==void 0,_r=Pe?.sticky===!0,[lo,Ri]=d.useState(!1),so=Yt??lo,Ha=d.useCallback(()=>{Dt!==void 0?Dt():Ri(!1)},[Dt]),K=d.useMemo(()=>Et===void 0?void 0:Ki(Et,j),[Et,j])??n,V=d.useRef();V.current===void 0&&(V.current=new AbortController),d.useEffect(()=>()=>V?.current.abort(),[]);const[ee,Ce]=$v(te,x,j,V.current,Fe),Re=d.useCallback((b,L,F)=>{if(mt===void 0)return!0;const $=[b[0]-j,b[1]];return mt?.($,L,F)},[j,mt]),de=d.useRef(Et),pe=d.useCallback((b,L)=>{L&&(b=Kv(b,ee,j,k,V.current)),pt!==void 0?(de.current=Ki(b,-j),pt(de.current)):r(b)},[pt,ee,j,k]),Ue=Ir(en,d.useCallback((b,L,F,$)=>{en?.(y[F-j],L,F-j,$)},[en,j,y])),ke=Ir(We,d.useCallback((b,L,F,$)=>{We?.(y[F-j],L,F-j,$)},[We,j,y])),Ye=Ir(St,d.useCallback((b,L,F,$)=>{St?.(y[F-j],L,F-j,$)},[St,j,y])),vt=Ir(C,d.useCallback((b,L)=>C?.({...b,columnIndex:b.columnIndex-j},L)??!1,[C,j])),pn=Ir(z,d.useCallback((b,L)=>z?.({...b,col:b.col-j},L)??!1,[z,j])),jt=d.useCallback(b=>{if(Ve!==void 0){const L=Ve(Ki(b,-j));return typeof L=="boolean"?L:Ki(L,j)}return!0},[Ve,j]),[Mt,ct,Ke]=Vv(K,pe,ye,ce,ve,je,D),ht=d.useMemo(()=>mr(Gd(),Ii),[Ii]),[Bt,uo]=d.useState([0,0,0]),Vr=d.useMemo(()=>{if(Fn===void 0)return{};const b={};for(const L of Fn)b[L.kind]=L;return b},[Fn]),nn=d.useCallback(b=>b.kind!==Y.Custom?Vr[b.kind]:Hn?.find(L=>L.isMatch(b)),[Hn,Vr]);let{sizedColumns:dn,nonGrowWidth:Ft}=o0(y,Fe,Ce,Bt[0]-(j===0?0:dr)-Bt[2],wr,Mi,ht,nn,V.current);gn!=="none"&&(Ft+=dr);const Nn=d.useMemo(()=>dn.some(b=>b.group!==void 0),[dn]),mn=Nn?Vo+ao:Vo,hr=K.rows.length,fr=gn==="none"?void 0:hr===0?!1:hr===Fe?!0:void 0,dt=d.useMemo(()=>gn==="none"?dn:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:yr,rowMarker:oo,rowMarkerChecked:fr,headerRowMarkerTheme:ro,headerRowMarkerAlwaysVisible:Si,headerRowMarkerDisabled:Fr},...dn],[gn,dn,dr,yr,oo,fr,ro,Si,Fr]),rn=d.useRef({height:1,width:1,x:0,y:0}),ir=d.useRef(!1),{setVisibleRegion:Ei,visibleRegion:pr,scrollRef:Nt}=sb(Pn,un,rr,rn,()=>ir.current=!0);rn.current=pr;const vf=pr.x+j,Ti=pr.y,vn=d.useRef(null),kn=d.useCallback(b=>{b===!0?vn.current?.focus():window.requestAnimationFrame(()=>{vn.current?.focus()})},[]),bn=Vt?Fe+1:Fe,jn=d.useCallback(b=>{const L=j===0?b:b.map($=>({...$,location:[$.location[0]-j,$.location[1]]})),F=fe?.(L);if(F!==!0)for(const $ of L)ae?.($.location,$.value);return F},[ae,fe,j]),[$r,La]=d.useState(),Oi=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,As=Fo?K.current?.cell:void 0,Di=As?.[0],Pi=As?.[1],bf=d.useMemo(()=>{if((wt===void 0||wt.length===0)&&(Oi??Di??Pi??$r)===void 0)return;const b=[];if(wt!==void 0)for(const L of wt){const F=dt.length-L.range.x-j;F>0&&b.push({color:L.color,range:{...L.range,x:L.range.x+j,width:Math.min(F,L.range.width)},style:L.style})}return $r!==void 0&&b.push({color:Yr(ht.accentColor,0),range:$r,style:"dashed"}),Oi!==void 0&&b.push({color:Yr(ht.accentColor,.5),range:Oi,style:"solid-outline"}),Di!==void 0&&Pi!==void 0&&b.push({color:ht.accentColor,range:{x:Di,y:Pi,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[$r,Oi,Di,Pi,wt,dt.length,ht.accentColor,j]),_s=d.useRef(dt);_s.current=dt;const An=d.useCallback(([b,L],F=!1)=>{const $=Vt&&L===bn-1;if(b===0&&Cn){if($)return qi;const W=_o(L);return W===void 0?qi:{kind:Un.Marker,allowOverlay:!1,checkboxStyle:oo,checked:K?.rows.hasIndex(L)===!0,markerKind:gn==="clickable-number"?"number":gn,row:no+W,drawHandle:tn!==void 0,cursor:gn==="clickable-number"?"pointer":void 0}}else if($){const W=b===j?Pe?.hint??"":"",q=_s.current[b];if(q?.trailingRowOptions?.disabled===!0)return qi;{const A=q?.trailingRowOptions?.hint??W,U=q?.trailingRowOptions?.addIcon??Pe?.addIcon;return{kind:Un.NewRow,hint:A,allowOverlay:!1,icon:U}}}else{const W=b-j;if(F||gt?.strict===!0){const A=rn.current,U=A.x>W||W>A.x+A.width||A.y>L||L>A.y+A.height||L>=Va.current,Q=W===A.extras?.selected?.[0]&&L===A.extras?.selected[1];let se=!1;if(A.extras?.freezeRegions!==void 0){for(const ze of A.extras.freezeRegions)if(Zr(ze,W,L)){se=!0;break}}if(U&&!Q&&!se)return qi}let q=x([W,L]);return j!==0&&q.span!==void 0&&(q={...q,span:[q.span[0]+j,q.span[1]+j]}),q}},[Vt,bn,Cn,_o,oo,K?.rows,gn,no,tn,j,Pe?.hint,Pe?.addIcon,gt?.strict,x]),Fa=d.useCallback(b=>{let L=kt?.(b)??{name:b};return ge!==void 0&&b!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Ba({group:L.name,bounds:F.bounds})}]}),L},[kt,ge]),zi=d.useCallback(b=>{const[L,F]=b.cell,$=dt[L],W=$?.group!==void 0?Fa($.group)?.overrideTheme:void 0,q=$?.themeOverride,A=Ar?.(F);i({...b,theme:mr(ht,W,q,A,b.content.themeOverride)})},[Ar,dt,Fa,ht]),co=d.useCallback((b,L,F)=>{if(K.current===void 0)return;const[$,W]=K.current.cell,q=An([$,W]);if(q.kind!==Y.Boolean&&q.allowOverlay){let A=q;if(F!==void 0)switch(A.kind){case Y.Number:{const U=_g(()=>F==="-"?-0:Number.parseFloat(F),0);A={...A,data:Number.isNaN(U)?0:U};break}case Y.Text:case Y.Markdown:case Y.Uri:A={...A,data:F};break}zi({target:b,content:A,initialValue:F,cell:[$,W],highlight:F===void 0,forceEditMode:F!==void 0,activation:L})}else q.kind===Y.Boolean&&L.inputType==="keyboard"&&q.readonly!==!0&&(jn([{location:K.current.cell,value:{...q,data:lh(q.data)}}]),vn.current?.damage([{cell:K.current.cell}]))},[An,K,jn,zi]),Vs=d.useCallback((b,L)=>{const F=vn.current?.getBounds(b,L);if(F===void 0||Nt.current===null)return;const $=An([b,L]);$.allowOverlay&&zi({target:F,content:$,initialValue:void 0,highlight:!0,cell:[b,L],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[An,Nt,zi]),Gt=d.useCallback((b,L,F="both",$=0,W=0,q=void 0)=>{if(Nt.current!==null){const A=vn.current,U=a.current,Q=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,se=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,ze=typeof b!="number"&&b.unit==="px"?b.amount:void 0,Ot=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(A!==null&&U!==null){let Je={x:0,y:0,width:0,height:0},qe=0,Ze=0;if((Q!==void 0||se!==void 0)&&(Je=A.getBounds((Q??0)+j,se??0)??Je,Je.width===0||Je.height===0))return;const ot=U.getBoundingClientRect(),Ct=ot.width/U.offsetWidth;if(ze!==void 0&&(Je={...Je,x:ze-ot.left-Nt.current.scrollLeft,width:1}),Ot!==void 0&&(Je={...Je,y:Ot+ot.top-Nt.current.scrollTop,height:1}),Je!==void 0){const on={x:Je.x-$,y:Je.y-W,width:Je.width+2*$,height:Je.height+2*W};let vo=0;for(let qa=0;qa<Te;qa++)vo+=dn[qa].width;let $i=0;const Uo=rt+(_r?1:0);Uo>0&&($i=to(bn,Uo,rr));let lr=vo*Ct+ot.left+j*dr*Ct,bo=ot.right,jr=ot.top+mn*Ct,yo=ot.bottom-$i*Ct;const Bi=Je.width+$*2;switch(q?.hAlign){case"start":bo=lr+Bi;break;case"end":lr=bo-Bi;break;case"center":lr=Math.floor((lr+bo)/2)-Bi/2,bo=lr+Bi;break}const Wi=Je.height+W*2;switch(q?.vAlign){case"start":yo=jr+Wi;break;case"end":jr=yo-Wi;break;case"center":jr=Math.floor((jr+yo)/2)-Wi/2,yo=jr+Wi;break}lr>on.x?qe=on.x-lr:bo<on.x+on.width&&(qe=on.x+on.width-bo),jr>on.y?Ze=on.y-jr:yo<on.y+on.height&&(Ze=on.y+on.height-yo),F==="vertical"||typeof b=="number"&&b<Te?qe=0:(F==="horizontal"||typeof L=="number"&&L>=bn-Uo)&&(Ze=0),(qe!==0||Ze!==0)&&(Ct!==1&&(qe/=Ct,Ze/=Ct),Nt.current.scrollTo({left:qe+Nt.current.scrollLeft,top:Ze+Nt.current.scrollTop,behavior:q?.behavior??"auto"}))}}}},[j,rt,dr,Nt,mn,Te,dn,bn,_r,rr]),Aa=d.useRef(Vs),_a=d.useRef(x);Aa.current=Vs,_a.current=x;const Va=d.useRef(Fe);Va.current=Fe;const $s=d.useRef(dt.length);$s.current=dt.length;const xr=d.useCallback(async(b,L=!0,F)=>{if(dt[b]?.trailingRowOptions?.disabled===!0)return;const $=we?.();let W,q=!0;$!==void 0&&(W=await $,W==="top"&&(q=!1),typeof W=="number"&&(q=!1));let A=0;const U=()=>{if(Va.current<=Fe){A<500&&window.setTimeout(U,A),A=50+A*2;return}const Q=typeof W=="number"?W:q?Fe:0;Vi.current(b-j,Q,"both",0,0,F?{behavior:F}:void 0),Mt({cell:[b,Q],range:{x:b,y:Q,width:1,height:1}},!1,!1,"edit");const se=_a.current([b-j,Q]);se.allowOverlay&&So(se)&&se.readonly!==!0&&L&&window.setTimeout(()=>{Aa.current(b,Q)},0)};U()},[dt,we,j,Fe,Mt]),Hi=d.useCallback(async(b,L=!0)=>{const F=ut?.();let $,W=!0;F!==void 0&&($=await F,$==="left"&&(W=!1),typeof $=="number"&&(W=!1));let q=0;const A=()=>{if($s.current<=dt.length){q<500&&window.setTimeout(A,q),q=50+q*2;return}const U=typeof $=="number"?$:W?dt.length:0;Gt(U-j,b),Mt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const Q=_a.current([U-j,b]);Q.allowOverlay&&So(Q)&&Q.readonly!==!0&&L&&window.setTimeout(()=>{Aa.current(U,b)},0)};A()},[dt,ut,j,Gt,Mt]),ho=d.useCallback(b=>{const L=dn[b]?.trailingRowOptions?.targetColumn??Pe?.targetColumn;if(typeof L=="number")return L+(Cn?1:0);if(typeof L=="object"){const F=y.indexOf(L);if(F>=0)return F+(Cn?1:0)}},[dn,y,Cn,Pe?.targetColumn]),Cr=d.useRef(),fo=d.useRef(),$o=d.useCallback((b,L)=>{const[F,$]=L;return mr(ht,dt[F]?.themeOverride,Ar?.($),b.themeOverride)},[Ar,dt,ht]),{mapper:Br}=ab(bt,v),qn=bt?.navigationBehavior,Bo=d.useCallback(b=>{const L=pa.value?b.metaKey:b.ctrlKey,F=L&&ie==="multi",[$,W]=b.location,q=K.columns,A=K.rows,[U,Q]=K.current?.cell??[];if(b.kind==="cell"){if(fo.current=void 0,Wr.current=[$,W],$===0&&Cn){if(Vt===!0&&W===Fe||gn==="number"||ie==="none")return;const se=An(b.location);if(se.kind!==Un.Marker)return;if(tn!==void 0){const Je=nn(se);Vn(Je?.kind===Un.Marker);const qe=Je?.onClick?.({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:$o(se,b.location),preventDefault:()=>{}});if(qe===void 0||qe.checked===se.checked)return}i(void 0),kn();const ze=A.hasIndex(W),Ot=Cr.current;if(ie==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&Ot!==void 0&&A.hasIndex(Ot)){const Je=[Math.min(Ot,W),Math.max(Ot,W)+1];F||De==="multi"?ct(void 0,Je,!0):ct(et.fromSingleSelection(Je),void 0,F)}else ie==="multi"&&(F||b.isTouch||De==="multi")?ze?ct(A.remove(W),void 0,!0):(ct(void 0,W,!0),Cr.current=W):ze&&A.length===1?ct(et.empty(),void 0,L):(ct(et.fromSingleSelection(W),void 0,L),Cr.current=W)}else if($>=j&&Vt&&W===Fe){const se=ho($);xr(se??$)}else if(U!==$||Q!==W){const se=An(b.location),ze=nn(se);if(ze?.onSelect!==void 0){let qe=!1;if(ze.onSelect({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>qe=!0,theme:$o(se,b.location)}),qe)return}if(qn==="block"&&Br(W).isGroupHeader)return;const Ot=_r&&W===Fe,Je=_r&&K!==void 0&&K.current?.cell[1]===Fe;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&Q!==void 0&&K.current!==void 0&&!Je){if(Ot)return;const qe=Math.min($,U),Ze=Math.max($,U),ot=Math.min(W,Q),Ct=Math.max(W,Q);Mt({...K.current,range:{x:qe,y:ot,width:Ze-qe+1,height:Ct-ot+1}},!0,L,"click"),Cr.current=void 0,kn()}else Mt({cell:[$,W],range:{x:$,y:W,width:1,height:1}},!0,L,"click"),Cr.current=void 0,i(void 0),kn()}}else if(b.kind==="header")if(Wr.current=[$,W],i(void 0),Cn&&$===0)Cr.current=void 0,fo.current=void 0,!Fr&&ie==="multi"&&(A.length!==Fe?ct(et.fromSingleSelection([0,Fe]),void 0,L):ct(et.empty(),void 0,L),kn());else{const se=fo.current;if(ne==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&se!==void 0&&q.hasIndex(se)){const ze=[Math.min(se,$),Math.max(se,$)+1];L||b.isTouch||ft==="multi"?Ke(void 0,ze,L):Ke(et.fromSingleSelection(ze),void 0,L)}else ne==="multi"&&(L||b.isTouch||ft==="multi")?(q.hasIndex($)?Ke(q.remove($),void 0,L):Ke(void 0,$,L),fo.current=$):ne!=="none"&&(q.hasIndex($)?Ke(q.remove($),void 0,L):Ke(et.fromSingleSelection($),void 0,L),fo.current=$);Cr.current=void 0,kn()}else b.kind===Jn?Wr.current=[$,W]:b.kind===ga&&!b.isMaybeScrollbar&&(pe(Xi,!1),i(void 0),kn(),sn?.(),Cr.current=void 0,fo.current=void 0)},[ie,ne,K,Cn,j,Vt,Fe,gn,An,tn,kn,De,ft,nn,$o,ct,ho,xr,qn,Br,_r,Mt,Fr,Ke,pe,sn]),Wo=d.useRef(!1),Wr=d.useRef(),Bs=d.useRef(pr),ar=d.useRef(),yf=d.useCallback(b=>{if(po.current=!1,Bs.current=rn.current,b.button!==0&&b.button!==1){ar.current=void 0;return}const L=performance.now();ar.current={button:b.button,time:L,location:b.location},b?.kind==="header"&&(Wo.current=!0);const F=b.kind==="cell"&&b.isFillHandle;!F&&b.kind!=="cell"&&b.isEdge||(u({previousSelection:K,fillHandle:F}),Wr.current=void 0,!b.isTouch&&b.button===0&&!F?Bo(b):!b.isTouch&&b.button===1&&(Wr.current=b.location))},[K,Bo]),[$a,Ba]=d.useState(),Ws=d.useCallback(b=>{if(b.kind!==Jn||ne!=="multi")return;const L=pa.value?b.metaKey:b.ctrlKey,[F]=b.location,$=K.columns;if(F<j)return;const W=dt[F];let q=F,A=F;for(let U=F-1;U>=j&&mi(W.group,dt[U].group);U--)q--;for(let U=F+1;U<dt.length&&mi(W.group,dt[U].group);U++)A++;if(kn(),L||b.isTouch||ft==="multi")if($.hasAll([q,A+1])){let U=$;for(let Q=q;Q<=A;Q++)U=U.remove(Q);Ke(U,void 0,L)}else Ke(void 0,[q,A+1],L);else Ke(et.fromSingleSelection([q,A+1]),void 0,L)},[ne,kn,K.columns,dt,j,Ke,ft]),po=d.useRef(!1),Li=d.useCallback(async b=>{if(ee!==void 0&&Ue!==void 0){const L=rn.current.y,F=rn.current.height;let $=ee({x:b,y:L,width:1,height:Math.min(F,Fe-L)},V.current.signal);typeof $!="object"&&($=await $());const W=dn[b-j],q=document.createElement("canvas").getContext("2d",{alpha:!1});if(q!==null){q.font=ht.baseFontFull;const A=qd(q,ht,W,0,$,wr,io,!1,nn);Ue?.(W,A.width,b,A.width)}}},[dn,ee,io,ht,wr,Ue,j,Fe,nn]),[wf,Wa]=d.useState(),go=d.useCallback(async(b,L)=>{const F=b.current?.range;if(F===void 0||ee===void 0||L.current===void 0)return;const $=L.current.range;if(S!==void 0){let U=!1;if(S({fillDestination:{...$,x:$.x-j},patternSource:{...F,x:F.x-j},preventDefault:()=>U=!0}),U)return}let W=ee(F,V.current.signal);typeof W!="object"&&(W=await W());const q=W,A=[];for(let U=0;U<$.width;U++)for(let Q=0;Q<$.height;Q++){const se=[$.x+U,$.y+Q];if(Fd(se,F))continue;const ze=q[Q%F.height][U%F.width];Io(ze)||!So(ze)||A.push({location:se,value:{...ze}})}jn(A),vn.current?.damage(A.map(U=>({cell:U.location})))},[ee,jn,S,j]),Ns=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,width:1}}};go(b,K)},[go,K]),js=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,height:1}}};go(b,K)},[go,K]),xf=d.useCallback((b,L)=>{const F=l;if(u(void 0),La(void 0),Wa(void 0),Wo.current=!1,L)return;if(F?.fillHandle===!0&&K.current!==void 0&&F.previousSelection?.current!==void 0){if($r===void 0)return;const ze={...K,current:{...K.current,range:Qd(F.previousSelection.current.range,$r)}};go(F.previousSelection,ze),pe(ze,!0);return}const[$,W]=b.location,[q,A]=Wr.current??[],U=()=>{po.current=!0},Q=ze=>{const Ot=ze.isTouch||q===$&&A===W;if(Ot&&R?.([$-j,W],{...ze,preventDefault:U}),ze.button===1)return!po.current;if(!po.current){const Je=An(b.location),qe=nn(Je);if(qe!==void 0&&qe.onClick!==void 0&&Ot){const ot=qe.onClick({...ze,cell:Je,posX:ze.localEventX,posY:ze.localEventY,bounds:ze.bounds,theme:$o(Je,b.location),preventDefault:U});ot!==void 0&&!Io(ot)&&ko(ot)&&(jn([{location:ze.location,value:ot}]),vn.current?.damage([{cell:ze.location}]))}if(po.current||K.current===void 0)return!1;let Ze=!1;switch(Je.activationBehaviorOverride??Ie){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[ot,Ct]=K.current.cell,[on,vo]=F.previousSelection.current.cell;Ze=$===ot&&$===on&&W===Ct&&W===vo&&(ze.isDoubleClick===!0||Ie==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze){const ot={inputType:"pointer",pointerActivation:ze.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Ie,pointerType:ze.isTouch?"touch":"mouse"};return E?.([$-j,W],ot),co(ze.bounds,ot),!0}}return!1},se=b.location[0]-j;if(b.isTouch){const ze=rn.current,Ot=Bs.current;if(ze.x!==Ot.x||ze.y!==Ot.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&di(K.current?.cell,b.location)){N?.([se,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&K.columns.hasIndex($)){ue?.(se,{...b,preventDefault:U});return}else if(b.kind===Jn){if(se<0)return;X?.(se,{...b,preventDefault:U});return}}b.kind==="cell"?Q(b)||Bo(b):b.kind===Jn?J?.(se,{...b,preventDefault:U}):(b.kind===Rr&&I?.(se,{...b,preventDefault:U}),Bo(b));return}if(b.kind==="header"){if(se<0)return;b.isEdge?b.isDoubleClick===!0&&Li($):b.button===0&&$===q&&W===A&&I?.(se,{...b,preventDefault:U})}if(b.kind===Jn){if(se<0)return;b.button===0&&$===q&&W===A&&(J?.(se,{...b,preventDefault:U}),po.current||Ws(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&Q(b),Wr.current=void 0},[l,K,j,$r,go,pe,R,An,nn,Ie,$o,jn,E,co,N,ue,X,Bo,J,I,Li,Ws]),Cf=d.useCallback(b=>{const L={...b,location:[b.location[0]-j,b.location[1]]};tt?.(L),l!==void 0&&b.buttons===0&&(u(void 0),La(void 0),Wa(void 0),Wo.current=!1),Wa(F=>Wo.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===F?.[0]&&b.scrollEdge[1]===F[1]?F:l===void 0||(ar.current?.location[0]??0)<j?void 0:b.scrollEdge)},[l,tt,j]),kf=d.useCallback((b,L)=>{nt?.(b-j,L)},[nt,j]),Sf=d.useCallback((b,L)=>{Xe?.(b-j,L)},[Xe,j]),mo=K?.current?.cell,Mf=d.useCallback((b,L,F,$,W,q)=>{ir.current=!1;let A=mo;A!==void 0&&(A=[A[0]-j,A[1]]);const U=Te===0?void 0:{x:0,y:b.y,width:Te,height:b.height},Q=[];U!==void 0&&Q.push(U),rt>0&&(Q.push({x:b.x-j,y:Fe-rt,width:b.width,height:rt}),Te>0&&Q.push({x:0,y:Fe-rt,width:Te,height:rt}));const se={x:b.x-j,y:b.y,width:b.width,height:Vt&&b.y+b.height>=Fe?b.height-1:b.height,tx:W,ty:q,extras:{selected:A,freezeRegion:U,freezeRegions:Q}};rn.current=se,Ei(se),uo([L,F,$]),On?.(se,se.tx,se.ty,se.extras)},[mo,j,Vt,Fe,Te,rt,Ei,On]),If=Ir(O,d.useCallback((b,L)=>O?.(b-j,L-j)!==!1,[O,j])),Rf=Ir(Se,d.useCallback((b,L)=>{Se?.(b-j,L-j),ne!=="none"&&Ke(et.fromSingleSelection(L),void 0,!0)},[ne,Se,j,Ke])),Na=d.useRef(!1),Ef=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}$e?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Na.current=!0),u(void 0)},[$e,j]),Tf=d.useCallback(()=>{Na.current=!1},[]),Gs=bt?.selectionBehavior,Fi=d.useCallback(b=>{if(Gs!=="block-spanning")return;const{isGroupHeader:L,path:F,groupRows:$}=Br(b);if(L)return[b,b];const W=F[F.length-1],q=b-W,A=b+$-W-1;return[q,A]},[Br,Gs]),ja=d.useRef(),Ga=d.useCallback(b=>{if(!ih(b,ja.current)&&(ja.current=b,!(ar?.current?.button!==void 0&&ar.current.button>=1))){if(b.buttons!==0&&l!==void 0&&ar.current?.location[0]===0&&j===1&&ie==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(ar.current.location[1])&&K.rows.hasIndex(ar.current.location[1])){const L=Math.min(ar.current.location[1],b.location[1]),F=Math.max(ar.current.location[1],b.location[1])+1;ct(et.fromSingleSelection([L,F]),void 0,!1)}else if(b.buttons!==0&&l!==void 0&&K.current!==void 0&&!Na.current&&!Wo.current&&(je==="rect"||je==="multi-rect")){const[L,F]=K.current.cell;let[$,W]=b.location;if(W<0&&(W=rn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const q=l.previousSelection.current.range;W=Math.min(W,Vt?Fe-1:Fe);const A=U0(q,$,W,xt);La(A)}else{if(Vt&&F===Fe)return;if(Vt&&W===Fe)if(b.kind===ga)W--;else return;$=Math.max($,j);const q=Fi(F);W=q===void 0?W:Gn(W,q[0],q[1]);const A=$-L,U=W-F,Q={x:A>=0?L:$,y:U>=0?F:W,width:Math.abs(A)+1,height:Math.abs(U)+1};Mt({...K.current,range:Q},!0,!1,"drag")}}Pt?.({...b,location:[b.location[0]-j,b.location[1]]})}},[l,j,ie,K,je,Pt,ct,Vt,Fe,xt,Fi,Mt]),Of=d.useCallback(()=>{const b=ja.current;if(b===void 0)return;const[L,F]=b.scrollEdge;let[$,W]=b.location;const q=rn.current;L===-1?$=q.extras?.freezeRegion?.x??q.x:L===1&&($=q.x+q.width),F===-1?W=Math.max(0,q.y):F===1&&(W=Math.min(Fe-1,q.y+q.height)),$=Gn($,0,dt.length-1),W=Gn(W,0,Fe-1),Ga({...b,location:[$,W]})},[dt.length,Ga,Fe]);tb(wf,Nt,Of);const Xn=d.useCallback(b=>{if(K.current===void 0)return;const[L,F]=b,[$,W]=K.current.cell,q=K.current.range;let A=q.x,U=q.x+q.width,Q=q.y,se=q.y+q.height;const[ze,Ot]=Fi(W)??[0,Fe-1],Je=Ot+1;if(F!==0)switch(F){case 2:{se=Je,Q=W,Gt(0,se,"vertical");break}case-2:{Q=ze,se=W+1,Gt(0,Q,"vertical");break}case 1:{Q<W?(Q++,Gt(0,Q,"vertical")):(se=Math.min(Je,se+1),Gt(0,se,"vertical"));break}case-1:{se>W+1?(se--,Gt(0,se,"vertical")):(Q=Math.max(ze,Q-1),Gt(0,Q,"vertical"));break}default:pi()}if(L!==0)if(L===2)U=dt.length,A=$,Gt(U-1-j,0,"horizontal");else if(L===-2)A=j,U=$+1,Gt(A-j,0,"horizontal");else{let qe=[];if(ee!==void 0){const Ze=ee({x:A,y:Q,width:U-A-j,height:se-Q},V.current.signal);typeof Ze=="object"&&(qe=db(Ze))}if(L===1){let Ze=!1;if(A<$){if(qe.length>0){const ot=Tr(A+1,$+1).find(Ct=>!qe.includes(Ct-j));ot!==void 0&&(A=ot,Ze=!0)}else A++,Ze=!0;Ze&&Gt(A,0,"horizontal")}Ze||(U=Math.min(dt.length,U+1),Gt(U-1-j,0,"horizontal"))}else if(L===-1){let Ze=!1;if(U>$+1){if(qe.length>0){const ot=Tr(U-1,$,-1).find(Ct=>!qe.includes(Ct-j));ot!==void 0&&(U=ot,Ze=!0)}else U--,Ze=!0;Ze&&Gt(U-j,0,"horizontal")}Ze||(A=Math.max(j,A-1),Gt(A-j,0,"horizontal"))}else pi()}Mt({cell:K.current.cell,range:{x:A,y:Q,width:U-A,height:se-Q}},!0,!1,"keyboard-select")},[ee,Fi,K,dt.length,j,Fe,Gt,Mt]),Ua=d.useRef(Lr);Ua.current=Lr;const kr=d.useCallback((b,L,F,$)=>{const W=bn-(F?0:1);b=Gn(b,j,dn.length-1+j),L=Gn(L,0,W);const q=mo?.[0],A=mo?.[1];if(b===q&&L===A)return!1;if($&&K.current!==void 0){const U=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&U.push(K.current.range),pe({...K,current:{cell:[b,L],range:{x:b,y:L,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[b,L],range:{x:b,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===b&&c.current[1]===L&&(c.current=void 0),Ua.current&&Gt(b-j,L),!0},[bn,j,dn.length,mo,K,Gt,pe,Mt]),Df=d.useCallback((b,L)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(jn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{vn.current?.damage([{cell:o.cell}])})),kn(!0),i(void 0);const[F,$]=L;if(K.current!==void 0&&(F!==0||$!==0)){const W=K.current.cell[1]===bn-1&&b!==void 0,q=K.current.cell[0]===dt.length-1&&b!==void 0;let A=!0;if(W&&$===1&&we!==void 0){A=!1;const U=K.current.cell[0]+F,Q=ho(U);xr(Q??U,!1)}if(q&&F===1&&ut!==void 0){A=!1;const U=K.current.cell[1]+$;Hi(U,!1)}A&&kr(Gn(K.current.cell[0]+F,0,dt.length-1),Gn(K.current.cell[1]+$,0,bn-1),W,!1)}P?.(b,L)},[o?.cell,kn,K,P,jn,bn,kr,dt.length,xr,Hi,we,ut,ho]),Pf=d.useMemo(()=>`gdg-overlay-${cb++}`,[]),Nr=d.useCallback(b=>{kn();const L=[];for(let F=b.x;F<b.x+b.width;F++)for(let $=b.y;$<b.y+b.height;$++){const W=x([F-j,$]);if(!W.allowOverlay&&W.kind!==Y.Boolean)continue;let q;if(W.kind===Y.Custom){const A=nn(W),U=A?.provideEditor?.({...W,location:[F-j,$]});A?.onDelete!==void 0?q=A.onDelete(W):Vg(U)&&(q=U?.deletedValue?.(W))}else(ko(W)&&W.allowOverlay||W.kind===Y.Boolean)&&(q=nn(W)?.onDelete?.(W));q!==void 0&&!Io(q)&&ko(q)&&L.push({location:[F,$],value:q})}jn(L),vn.current?.damage(L.map(F=>({cell:F.location})))},[kn,x,nn,jn,j]),No=o!==void 0,Us=d.useCallback(b=>{const L=()=>{b.stopPropagation(),b.preventDefault()},F={didMatch:!1},{bounds:$}=b,W=K.columns,q=K.rows,A=or;if(!No&&it(A.clear,b,F))pe(Xi,!1),sn?.();else if(!No&&it(A.selectAll,b,F))pe({columns:et.empty(),rows:et.empty(),current:{cell:K.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:Fe},rangeStack:[]}},!1);else if(it(A.search,b,F))s?.current?.focus({preventScroll:!0}),Ri(!0);else if(it(A.delete,b,F)){const Ze=jt?.(K)??!0;if(Ze!==!1){const ot=Ze===!0?K:Ze;if(ot.current!==void 0){Nr(ot.current.range);for(const Ct of ot.current.rangeStack)Nr(Ct)}for(const Ct of ot.rows)Nr({x:j,y:Ct,width:y.length,height:1});for(const Ct of ot.columns)Nr({x:Ct,y:0,width:1,height:Fe})}}if(F.didMatch)return L(),!0;if(K.current===void 0)return!1;let[U,Q]=K.current.cell;const[,se]=K.current.cell;let ze=!1,Ot=!1;if(it(A.scrollToSelectedCell,b,F))Vi.current(U-j,Q);else if(ne!=="none"&&it(A.selectColumn,b,F))W.hasIndex(U)?Ke(W.remove(U),void 0,!0):ne==="single"?Ke(et.fromSingleSelection(U),void 0,!0):Ke(void 0,U,!0);else if(ie!=="none"&&it(A.selectRow,b,F))q.hasIndex(Q)?ct(q.remove(Q),void 0,!0):ie==="single"?ct(et.fromSingleSelection(Q),void 0,!0):ct(void 0,Q,!0);else if(!No&&$!==void 0&&it(A.activateCell,b,F))if(Q===Fe&&Vt)window.setTimeout(()=>{const Ze=ho(U);xr(Ze??U)},0);else{const Ze={inputType:"keyboard",key:b.key};E?.([U-j,Q],Ze),co($,Ze)}else K.current.range.height>1&&it(A.downFill,b,F)?js():K.current.range.width>1&&it(A.rightFill,b,F)?Ns():it(A.goToNextPage,b,F)?Q+=Math.max(1,rn.current.height-4):it(A.goToPreviousPage,b,F)?Q-=Math.max(1,rn.current.height-4):it(A.goToFirstCell,b,F)?(i(void 0),Q=0,U=0):it(A.goToLastCell,b,F)?(i(void 0),Q=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):it(A.selectToFirstCell,b,F)?(i(void 0),Xn([-2,-2])):it(A.selectToLastCell,b,F)?(i(void 0),Xn([2,2])):No?(it(A.closeOverlay,b,F)&&i(void 0),it(A.acceptOverlayDown,b,F)&&(i(void 0),Q++),it(A.acceptOverlayUp,b,F)&&(i(void 0),Q--),it(A.acceptOverlayLeft,b,F)&&(i(void 0),U--),it(A.acceptOverlayRight,b,F)&&(i(void 0),U++)):(it(A.goDownCell,b,F)?Q+=1:it(A.goUpCell,b,F)?Q-=1:it(A.goRightCell,b,F)?U+=1:it(A.goLeftCell,b,F)?U-=1:it(A.goDownCellRetainSelection,b,F)?(Q+=1,ze=!0):it(A.goUpCellRetainSelection,b,F)?(Q-=1,ze=!0):it(A.goRightCellRetainSelection,b,F)?(U+=1,ze=!0):it(A.goLeftCellRetainSelection,b,F)?(U-=1,ze=!0):it(A.goToLastRow,b,F)?Q=Fe-1:it(A.goToFirstRow,b,F)?Q=Number.MIN_SAFE_INTEGER:it(A.goToLastColumn,b,F)?U=Number.MAX_SAFE_INTEGER:it(A.goToFirstColumn,b,F)?U=Number.MIN_SAFE_INTEGER:(je==="rect"||je==="multi-rect")&&(it(A.selectGrowDown,b,F)?Xn([0,1]):it(A.selectGrowUp,b,F)?Xn([0,-1]):it(A.selectGrowRight,b,F)?Xn([1,0]):it(A.selectGrowLeft,b,F)?Xn([-1,0]):it(A.selectToLastRow,b,F)?Xn([0,2]):it(A.selectToFirstRow,b,F)?Xn([0,-2]):it(A.selectToLastColumn,b,F)?Xn([2,0]):it(A.selectToFirstColumn,b,F)&&Xn([-2,0])),Ot=F.didMatch);if(qn!==void 0&&qn!=="normal"&&Q!==se){const Ze=qn==="skip-up"||qn==="skip"||qn==="block",ot=qn==="skip-down"||qn==="skip"||qn==="block",Ct=Q<se;if(Ct&&Ze){for(;Q>=0&&Br(Q).isGroupHeader;)Q--;Q<0&&(Q=se)}else if(!Ct&&ot){for(;Q<Fe&&Br(Q).isGroupHeader;)Q++;Q>=Fe&&(Q=se)}}const Je=kr(U,Q,!1,ze),qe=F.didMatch;return qe&&(Je||!Ot||Tn)&&L(),qe},[qn,No,K,or,ne,ie,je,j,Br,Fe,kr,pe,sn,y.length,jt,Tn,Nr,Ke,ct,Vt,ho,xr,E,co,js,Ns,Xn]),jo=d.useCallback(b=>{let L=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{L=!0}}),L||Us(b)||K.current===void 0)return;const[F,$]=K.current.cell,W=rn.current;if(Ee&&!b.metaKey&&!b.ctrlKey&&K.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&So(x([F-j,Math.max(0,Math.min($,Fe-1))]))){if((!Vt||$!==Fe)&&(W.y>$||$>W.y+W.height||W.x>F||F>W.x+W.width))return;const q={inputType:"keyboard",key:b.key};E?.([F-j,$],q),co(b.bounds,q,b.key),b.stopPropagation(),b.preventDefault()}},[Ee,G,Us,K,x,j,Fe,Vt,E,co]),zf=d.useCallback((b,L)=>{const F=b.location[0]-j;if(b.kind==="header"&&ue?.(F,{...b,preventDefault:L}),b.kind===Jn){if(F<0)return;X?.(F,{...b,preventDefault:L})}if(b.kind==="cell"){const[$,W]=b.location;N?.([F,W],{...b,preventDefault:L}),Wm(K,b.location)||kr($,W,!1,!1)}},[K,N,X,ue,j,kr]),Ka=d.useCallback(async b=>{if(!or.paste)return;function L(A,U,Q,se){const ze=typeof Q=="object"?Q?.join(`
|
|
173
|
-
`)??"":Q?.toString()??"";if(!Io(A)&&So(A)&&A.readonly!==!0){const Ot=M?.(ze,A);if(Ot!==void 0&&ko(Ot))return{location:U,value:Ot};const Je=nn(A);if(Je===void 0)return;if(Je.kind===Y.Custom){Vn(A.kind===Y.Custom);const qe=Je.onPaste?.(ze,A.data);return qe===void 0?void 0:{location:U,value:{...A,data:qe}}}else{const qe=Je.onPaste?.(ze,A,{formatted:se,formattedString:typeof se=="string"?se:se?.join(`
|
|
174
|
-
`),rawValue:Q});return qe===void 0?void 0:(Vn(qe.kind===A.kind),{location:U,value:qe})}}}const F=K.columns,$=K.rows,W=Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let q;if(K.current!==void 0?q=[K.current.range.x,K.current.range.y]:F.length===1?q=[F.first()??0,0]:$.length===1&&(q=[j,$.first()??0]),W&&q!==void 0){let A,U;const Q="text/plain",se="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Ze of qe){if(Ze.types.includes(se)){const ot=await(await Ze.getType(se)).text(),Ct=Ju(ot);if(Ct!==void 0){A=Ct;break}}Ze.types.includes(Q)&&(U=await(await Ze.getType(Q)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(b!==void 0&&b?.clipboardData!==null){if(b.clipboardData.types.includes(se)){const qe=b.clipboardData.getData(se);A=Ju(qe)}A===void 0&&b.clipboardData.types.includes(Q)&&(U=b.clipboardData.getData(Q))}else return;const[ze,Ot]=q,Je=[];do{if(Me===void 0){const qe=An(q),Ze=U??A?.map(Ct=>Ct.map(on=>on.rawValue).join(" ")).join(" ")??"",ot=L(qe,q,Ze,void 0);ot!==void 0&&Je.push(ot);break}if(A===void 0){if(U===void 0)return;A=qv(U)}if(Me===!1||typeof Me=="function"&&Me?.([q[0]-j,q[1]],A.map(qe=>qe.map(Ze=>Ze.rawValue?.toString()??"")))!==!0)return;for(const[qe,Ze]of A.entries()){if(qe+Ot>=Fe)break;for(const[ot,Ct]of Ze.entries()){const on=[ot+ze,qe+Ot],[vo,$i]=on;if(vo>=dt.length||$i>=bn)continue;const Uo=An(on),lr=L(Uo,on,Ct.rawValue,Ct.formatted);lr!==void 0&&Je.push(lr)}}}while(!1);jn(Je),vn.current?.damage(Je.map(qe=>({cell:qe.location})))}},[M,nn,An,K,or.paste,Nt,dt.length,jn,bn,Me,j,Fe]);Sn("paste",Ka,h,!1,!0);const Go=d.useCallback(async(b,L)=>{if(!or.copy)return;const F=L===!0||Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,$=K.columns,W=K.rows,q=(A,U)=>{if(!Qe)ec(A,U,b);else{const Q=U.map(se=>({kind:Y.Text,data:y[se].title,displayData:y[se].title,allowOverlay:!1}));ec([Q,...A],U,b)}};if(F&&ee!==void 0){if(K.current!==void 0){let A=ee(K.current.range,V.current.signal);typeof A!="object"&&(A=await A()),q(A,Tr(K.current.range.x-j,K.current.range.x+K.current.range.width-j))}else if(W!==void 0&&W.length>0){const A=[...W].map(U=>{const Q=ee({x:j,y:U,width:y.length,height:1},V.current.signal);return typeof Q=="object"?Q[0]:Q().then(se=>se[0])});if(A.some(U=>U instanceof Promise)){const U=await Promise.all(A);q(U,Tr(y.length))}else q(A,Tr(y.length))}else if($.length>0){const A=[],U=[];for(const Q of $){let se=ee({x:Q,y:0,width:1,height:Fe},V.current.signal);typeof se!="object"&&(se=await se()),A.push(se),U.push(Q-j)}if(A.length===1)q(A[0],U);else{const Q=A.reduce((se,ze)=>se.map((Ot,Je)=>[...Ot,...ze[Je]]));q(Q,U)}}}},[y,ee,K,or.copy,j,Nt,Fe,Qe]);Sn("copy",Go,h,!1,!1);const Hf=d.useCallback(async b=>{if(!(!or.cut||!(Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Go(b),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:et.empty(),columns:et.empty()};const F=jt?.(L);if(F===!1||(L=F===!0?L:F,L.current===void 0))return;Nr(L.current.range)}},[Nr,K,or.cut,Go,Nt,jt]);Sn("cut",Hf,h,!1,!1);const Lf=d.useCallback((b,L)=>{if(he!==void 0){j!==0&&(b=b.map(W=>[W[0]-j,W[1]])),he(b,L);return}if(b.length===0||L===-1)return;const[F,$]=b[L];c.current!==void 0&&c.current[0]===F&&c.current[1]===$||(c.current=[F,$],kr(F,$,!1,!1))},[he,j,kr]),[Ai,_i]=Et?.current?.cell??[],Vi=d.useRef(Gt);Vi.current=Gt,d.useLayoutEffect(()=>{Ua.current&&!ir.current&&Ai!==void 0&&_i!==void 0&&(Ai!==de.current?.current?.cell[0]||_i!==de.current?.current?.cell[1])&&Vi.current(Ai,_i),ir.current=!1},[Ai,_i]);const Ks=K.current!==void 0&&(K.current.cell[0]>=dt.length||K.current.cell[1]>=bn);d.useLayoutEffect(()=>{Ks&&pe(Xi,!1)},[Ks,pe]);const Ff=d.useMemo(()=>Vt===!0&&Pe?.tint===!0?et.fromSingleSelection(bn-1):et.empty(),[bn,Vt,Pe?.tint]),Af=d.useCallback(b=>typeof cn=="boolean"?cn:cn?.(b-j)??!0,[j,cn]),_f=d.useMemo(()=>{if($a===void 0||a.current===null)return null;const{bounds:b,group:L}=$a,F=a.current.getBoundingClientRect();return d.createElement(Av,{bounds:b,group:L,canvasBounds:F,onClose:()=>Ba(void 0),onFinish:$=>{Ba(void 0),ge?.(L,$)}})},[ge,$a]),Vf=Math.min(dt.length,Te+(Cn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,L)=>xr(b+j,L),appendColumn:(b,L)=>Hi(b,L),updateCells:b=>(j!==0&&(b=b.map(L=>({cell:[L.cell[0]+j,L.cell[1]]}))),vn.current?.damage(b)),getBounds:(b,L)=>{if(!(a?.current===null||Nt?.current===null)){if(b===void 0&&L===void 0){const F=a.current.getBoundingClientRect(),$=F.width/Nt.current.clientWidth;return{x:F.x-Nt.current.scrollLeft*$,y:F.y-Nt.current.scrollTop*$,width:Nt.current.scrollWidth*$,height:Nt.current.scrollHeight*$}}return vn.current?.getBounds((b??0)+j,L)}},focus:()=>vn.current?.focus(),emit:async b=>{switch(b){case"delete":jo({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":jo({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":jo({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 Go(void 0,!0);break;case"paste":await Ka();break}},scrollTo:Gt,remeasureColumns:b=>{for(const L of b)Li(L+j)},getMouseArgsForPosition:(b,L,F)=>{if(vn?.current===null)return;const $=vn.current.getMouseArgsForPosition(b,L,F);if($!==void 0)return{...$,location:[$.location[0]-j,$.location[1]]}}}),[xr,Hi,Li,Nt,Go,jo,Ka,j,Gt]);const[qs,Xs]=mo??[],$f=d.useCallback(b=>{const[L,F]=b;if(F===-1){ne!=="none"&&(Ke(et.fromSingleSelection(L),void 0,!1),kn());return}qs===L&&Xs===F||(Mt({cell:b,range:{x:L,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),Gt(L,F))},[ne,kn,Gt,qs,Xs,Mt,Ke]),[Bf,Wf]=d.useState(!1),Zs=d.useRef(kd(b=>{Wf(b)},5)),Nf=d.useCallback(()=>{Zs.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&Mt({cell:[j,Ti],range:{x:j,y:Ti,width:1,height:1}},!0,!1,"keyboard-select")},[Ti,K,l,j,Mt]),jf=d.useCallback(()=>{Zs.current(!1)},[]),[Gf,Uf]=d.useMemo(()=>{let b;const L=gt?.scrollbarWidthOverride??Pl(),F=Fe+(Vt?1:0);if(typeof rr=="number")b=mn+F*rr;else{let W=0;const q=Math.min(F,10);for(let A=0;A<q;A++)W+=rr(A);W=Math.floor(W/q),b=mn+F*W}b+=L;const $=dt.reduce((W,q)=>q.width+W,0)+L;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,b)}px`]},[dt,gt?.scrollbarWidthOverride,rr,Fe,Vt,mn]),Kf=d.useMemo(()=>n0(ht),[ht]);return d.createElement(Ud.Provider,{value:ht},d.createElement(Jv,{style:Kf,className:Z,inWidth:m??Gf,inHeight:w??Uf},d.createElement(zv,{fillHandle:Ht,drawFocusRing:Fo,experimental:gt,fixedShadowX:In,fixedShadowY:cr,getRowThemeOverride:Ar,headerIcons:Bn,imageWindowLoader:B,initialSize:Ne,isDraggable:Ge,onDragLeave:zt,onRowMoved:tn,overscrollX:Pa,overscrollY:za,preventDiagonalScrolling:xn,rightElement:Wt,rightElementProps:En,smoothScrollX:xe,smoothScrollY:Lt,className:Z,enableGroups:Nn,onCanvasFocused:Nf,onCanvasBlur:jf,canvasRef:a,onContextMenu:zf,theme:ht,cellXOffset:vf,cellYOffset:Ti,accessibilityHeight:pr.height,onDragEnd:Tf,columns:dt,nonGrowWidth:Ft,drawHeader:vt,onColumnProposeMove:If,drawCell:pn,disabledRows:Ff,freezeColumns:Vf,lockColumns:j,firstColAccessible:j===0,getCellContent:An,minColumnWidth:wr,maxColumnWidth:io,searchInputRef:s,showSearch:so,onSearchClose:Ha,highlightRegions:bf,getCellsForSelection:ee,getGroupDetails:Fa,headerHeight:Vo,isFocused:Bf,groupHeaderHeight:Nn?ao:0,freezeTrailingRows:rt+(Vt&&Pe?.sticky===!0?1:0),hasAppendRow:Vt,onColumnResize:Ue,onColumnResizeEnd:ke,onColumnResizeStart:Ye,onCellFocused:$f,onColumnMoved:Rf,onDragStart:Ef,onHeaderMenuClick:kf,onHeaderIndicatorClick:Sf,onItemHovered:Ga,isFilling:l?.fillHandle===!0,onMouseMove:Cf,onKeyDown:jo,onKeyUp:re,onMouseDown:yf,onMouseUp:xf,onDragOverCell:zn,onDrop:Qt,onSearchResultsChanged:Lf,onVisibleRegionChanged:Mf,clientSize:Bt,rowHeight:rr,searchResults:oe,searchValue:H,onSearchValueChange:_,rows:bn,scrollRef:Nt,selection:K,translateX:pr.tx,translateY:pr.ty,verticalBorder:Af,gridRef:vn,getCellRenderer:nn,resizeIndicator:ki}),_f,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(ub,{...o,validateCell:Re,bloom:T,id:Pf,getCellRenderer:nn,className:gt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Mn,imageEditorOverride:g,portalElementRef:Lo,onFinishEditing:Df,markdownDivCreateNode:p,isOutsideClick:Ln,customEventTarget:gt?.eventTarget}))))},fb=d.forwardRef(hb);function rc(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:s,height:a,x:l,y:u}=o,c=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+a/2),g=Id(c,a,i.cellVerticalPadding),f=Md(t.contentAlign??"center",l,s,i.cellHorizontalPadding,g),p=Sd(f,h,g),m=Rd(l+n,u+r,p);return Ql(t)&&m}const pb={getAccessibilityString:e=>e.data?.toString()??"false",kind:Y.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>gb(e,e.cell.data,Ql(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{rc(e)&&e.preventDefault()},onClick:e=>{if(rc(e))return{...e.cell,data:lh(e.cell.data)}},onPaste:(e,t)=>{let n=ua;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Jl),n===t.data?void 0:{...t,data:n}}};function gb(e,t,n,r,o){if(!n&&t===ua)return;const{ctx:i,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:h,cell:{contentAlign:g}}=e,{x:f,y:p,width:m,height:w}=l;let y=!1;if(o>0){let v=n?1-o+o*s:.4;if(t===ua&&(v*=s),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}cs(i,a,t,f,p,m,w,u,c,h,r,g),y&&(i.globalAlpha=1)}const mb=hn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),vb=e=>{const{bubbles:t}=e;return d.createElement(mb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},bb={getAccessibilityString:e=>Ed(e.data),kind:Y.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>yb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(vb,{bubbles:t.data})},onPaste:()=>{}};function yb(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const h=[];for(const g of t){if(c>s+l)break;const f=zr(g,o,r.baseFontFull).width;h.push({x:c,width:f}),c+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of h)er(o,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[g,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],f.x+r.bubblePadding,a+u/2+nr(o,r))}const wb=hn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),xb=e=>{const{drilldowns:t}=e;return d.createElement(wb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Cb={getAccessibilityString:e=>Ed(e.data.map(t=>t.text)),kind:Y.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+n.bubblePadding*2+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Sb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(xb,{drilldowns:t.data})},onPaste:()=>{}},gl={};function kb(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,s=n-i*2,a=4,l=n*o,u=r+i,c=r*3,h=(c+i*2)*o,g=`${e},${t},${o},${n}`;if(gl[g]!==void 0)return{el:gl[g],height:l,width:h,middleWidth:a*o,sideWidth:u*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),p=f.getContext("2d");return p===null?null:(f.width=h,f.height=l,p.scale(o,o),gl[g]=f,p.beginPath(),er(p,i,i,c,s,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),er(p,i+.5,i+.5,c,s,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:f,height:l,width:h,sideWidth:u*o,middleWidth:r*o,padding:i*o,dpr:o})}function Sb(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,h=as(o,c),g=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let y=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=kb(r.bgCell,r.drilldownBorder,g,v),R=[];for(const E of t){if(y>l+u)break;const S=zr(E.text,o,c).width;let P=0;E.img!==void 0&&i.loadOrGetImage(E.img,s,a)!==void 0&&(P=p-8+4);const M=S+P+m*2;R.push({x:y,width:M}),y+=M+w}if(x!==null){const{el:E,height:S,middleWidth:P,sideWidth:M,width:C,dpr:z,padding:T}=x,I=M/z,O=T/z;for(const D of R){const k=Math.floor(D.x),J=Math.floor(D.width),N=J-(I-O)*2;o.imageSmoothingEnabled=!1,o.drawImage(E,0,0,M,S,k-O,f,I,g),N>0&&o.drawImage(E,M,0,P,S,k+(I-O),f,N,g),o.drawImage(E,C-M,0,M,S,k+J-(I-O),f,I,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[E,S]of R.entries()){const P=t[E];let M=S.x+m;if(P.img!==void 0){const C=i.loadOrGetImage(P.img,s,a);if(C!==void 0){const z=p-8;let T=0,I=0,O=C.width,D=C.height;O>D?(T+=(O-D)/2,O=D):D>O&&(I+=(D-O)/2,D=O),o.beginPath(),er(o,M,f+g/2-z/2,z,z,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(C,T,I,O,D,M,f+g/2-z/2,z,z),o.restore(),M+=z+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(P.text,M,f+g/2+nr(o,r))}}const Mb={getAccessibilityString:e=>e.data.join(", "),kind:Y.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Ib(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,o=r??hm;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},ml=4;function Ib(e,t,n,r){const{rect:o,col:i,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:h,height:g,width:f}=o,p=g-a.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const R=u.loadOrGetImage(x,i,s);if(R!==void 0){m[v]=R;const E=R.width*(p/R.height);w+=E+ml}}if(w===0)return;w-=ml;let y=c+a.cellHorizontalPadding;r==="right"?y=Math.floor(c+f-a.cellHorizontalPadding-w):r==="center"&&(y=Math.floor(c+f/2-w/2));for(const v of m){if(v===void 0)continue;const x=v.width*(p/v.height);n>0&&(l.beginPath(),er(l,y,h+a.cellVerticalPadding,x,p,n),l.save(),l.clip()),l.drawImage(v,y,h+a.cellVerticalPadding,x,p),n>0&&l.restore(),y+=x+ml}}function Rb(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Eb={getAccessibilityString:()=>"",kind:Y.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,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(Rb(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=i.width&&(a=i.width-l*2-1);const u=t.skeletonHeight??Math.min(18,i.height-2*s.cellVerticalPadding);er(o,i.x+l,i.y+(i.height-u)/2,a,u,s.roundingRadius??3),o.fillStyle=Yr(s.textDark,.1),o.fill()},onPaste:()=>{}},Tb=()=>e=>e.targetWidth,oc=hn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Tb(),"px"]}}),Ob=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,h]=d.useState(l===""||r),g=d.useCallback(()=>{h(p=>!p)},[]),f=l?"gdg-ml-6":"";return c?d.createElement(oc,{targetWidth:i.width-20},d.createElement(eo,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>s(t)},d.createElement(im,null))):d.createElement(oc,{targetWidth:i.width},d.createElement(Dm,{contents:l,createNode:o}),!u&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:g},d.createElement(ts,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Db={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ci,measure:(e,t,n)=>{const r=t.data.split(`
|
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>sr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:s,validatedSelection:a}=e;return d.createElement(Ob,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Pb={getAccessibilityString:e=>e.row.toString(),kind:Un.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:zb,measure:()=>44,draw:e=>Lb(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:o}=e,{width:i,height:s}=t,a=n.drawHandle?7+(i-7)/2:i/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(o-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function zb(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=Hb,n.textAlign="center",i}function Hb(e){const{ctx:t}=e;t.textAlign="start"}function Lb(e,t,n,r,o,i){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:h,width:g,height:f}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(cs(s,u,n,o?c+m:c,h,o?g-m:g,f,!0,void 0,void 0,u.checkboxMaxSize,"center",i),o){s.globalAlpha=l,s.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])s.rect(c+w,h+f/2+y,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=u.markerFontFull,y=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=w,s.fillText(m,y,h+f/2+nr(s,w)),l!==0&&(s.globalAlpha=1)}}const Fb={getAccessibilityString:()=>"",kind:Un.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ab(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Ab(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(l+1,u+1,c,h-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=l+8/2,w=u+8/2;a.drawSprite(n,"normal",r,m,w,p,s,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+y+w,u+h/2),r.lineTo(l+y+w+m,u+h/2),r.moveTo(l+y+w+m*.5,u+h/2-m*.5),r.lineTo(l+y+w+m*.5,u+h/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,f+l+s.cellHorizontalPadding+.5,u+h/2+nr(r,s)),r.beginPath()}function ch(e,t,n,r,o,i,s){e.textBaseline="alphabetic";const a=_b(e,o,r,t,n?.fullSize??!1);e.beginPath(),er(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Yr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function _b(e,t,n,r,o){const i=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+s/2+1,width:t.width-i,height:t.height-s-1};const a=zr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-u)/2+1,width:a.width+i*3,height:u-1}}const Vb=d.lazy(async()=>await Xl(()=>import("./number-overlay-editor-BGJ9OD_Z-DIBxtO2v.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),$b={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ci,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&ch(r,o,u,l,i,t,s),sr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Vb,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.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}}},Bb={getAccessibilityString:()=>"",measure:()=>108,kind:Y.Protected,needsHover:!1,needsHoverPosition:!1,draw:Wb,onPaste:()=>{}};function Wb(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:s}=r;t.beginPath();const a=2.5;let l=o+n.cellHorizontalPadding+a;const u=i+s/2,c=Math.cos(Su(30))*a,h=Math.sin(Su(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-h),t.lineTo(l-c,u+h),t.moveTo(l-c,u-h),t.lineTo(l+c,u+h),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Nb={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ci(e,t,e.theme.textLight),draw:e=>sr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return Rt.createElement(eo,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},jb={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ci,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:h,hoverEffectTheme:g}=t;c===!0&&n>0&&ch(o,s,g,l,i,n,a),sr(e,l,u,h,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
176
|
-
`,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(eo,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:s=>r({...o,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Gb=hn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Ub=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:s}=e,[a,l]=d.useState(!o&&(t===""||r)),u=d.useCallback(()=>{l(!0)},[]);return a?d.createElement(eo,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Gb,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:u},d.createElement(ts,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function dh(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-s-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-s/2),{x:o,y:i,width:s,height:a}}function ic(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=$d(s,i.baseFontFull);if(a===void 0)return!1;const l=dh(a,n,i,t.contentAlign);return Zr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,o)}const Kb={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ci,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&o!==void 0&&i!==void 0){const c=zr(l,a,n.baseFontFull),h=dh(c,s,n,t.contentAlign),{x:g,y:f,width:p,height:m}=h;if(o>=g-4&&o<=g-4+p+8&&i>=f-4&&i<=f-4+m+8){const w=nr(a,n.baseFontFull);r("pointer");const y=5,v=f-w;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+m+y)+.5),a.lineTo(s.x+g+p,Math.floor(s.y+v+m+y)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,sr({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,sr(e,l,t.contentAlign)},onSelect:e=>{ic(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;ic(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:o,validatedSelection:i}=t;return d.createElement(Ub,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,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}},qb=[Pb,Fb,pb,bb,Cb,Mb,Eb,Db,$b,Bb,Nb,jb,Kb];var vl,ac;function Xb(){if(ac)return vl;ac=1;var e=Cd(),t=Jc(),n="Expected a function";function r(o,i,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(o,i,{leading:a,maxWait:i,trailing:l})}return vl=r,vl}var Zb=Xb();const Yb=vr(Zb),bl=[];class Jb extends Nd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Yb(()=>{this.imageLoaded(new fi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let o=!1;for(let i=0;i<r.cells.length;i++){const s=r.cells[i];if(this.isInWindow(s)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,o){let i=!1;const s=bl.pop()??new Image;let a=!1;const l={img:void 0,cells:[Qn(n,r)],url:t,cancel:()=>{a||(a=!0,bl.length<12?bl.unshift(s):i||(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[o];if(c!==void 0&&!a){c.img=s;for(const h of c.cells)this.loadedLocations.push(us(h));i=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[o]=l}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const s=Qn(n,r);return i.cells.includes(s)||i.cells.push(s),i.img}else this.loadImage(t,n,r,o)}}const Qb=(e,t)=>{const n=d.useMemo(()=>({...N0,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??qb,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new Jb,[e.imageWindowLoader]);return d.createElement(fb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},e1=d.forwardRef(Qb);function lc(e,t){const n=d.useRef(null),r=d.useRef(),o=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>o,[o]),{debouncedCallback:d.useCallback((...i)=>{r.current=i,o(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,o]),cancel:o}}var t1=Xf();const n1=vr(t1);var Bl={exports:{}},r1=Bl.exports,sc;function o1(){return sc||(sc=1,(function(e,t){(function(n,r){try{e.exports=r(Yf)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(r1,function(n){var r=!1,o=!1,i=!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){return H.length>_.length?!1:_.indexOf(H)!==-1}function c(_){for(var H="";_;)H+="0",_-=1;return H}function h(_){for(var H=_.split("").reverse(),G=0,re=!0;re&&G<H.length;)G?H[G]==="9"?H[G]="0":(H[G]=(parseInt(H[G],10)+1).toString(),re=!1):(parseInt(H[G],10)<5&&(re=!1),H[G]="0"),G+=1;return re&&H.push("1"),H.reverse().join("")}function g(_,H){var G=P(k(H).sort(),function(le){return le+":"+H[le]}).join(","),re=_+"+"+G;return g.cache[re]||(g.cache[re]=Intl.NumberFormat(_,H)),g.cache[re]}g.cache={};function f(_,H,G){var re=H.useToLocaleString,le=H.useGrouping,Ee=le&&H.grouping.slice(),we=H.maximumSignificantDigits,ut=H.minimumIntegerDigits||1,Se=H.fractionDigits||0,mt=H.groupingSeparator,wt=H.decimalSeparator;if(re&&G){var je={minimumIntegerDigits:ut,useGrouping:le};if(Se&&(je.maximumFractionDigits=Se,je.minimumFractionDigits=Se),we&&_>0&&(je.maximumSignificantDigits=we),i){if(!s){var ne=D({},H);ne.useGrouping=!1,ne.decimalSeparator=".",_=parseFloat(f(_,ne),10)}return g(G,je).format(_)}else{if(!o){var ne=D({},H);ne.useGrouping=!1,ne.decimalSeparator=".",_=parseFloat(f(_,ne),10)}return _.toLocaleString(G,je)}}var ie;we?ie=_.toPrecision(we+1):ie=_.toFixed(Se+1);var ye,ce,ve,Ve=ie.split("e");ve=Ve[1]||"",Ve=Ve[0].split("."),ce=Ve[1]||"",ye=Ve[0]||"";var $e=ye.length,tt=ce.length,Me=$e+tt,Qe=ye+ce;(we&&Me===we+1||!we&&tt===Se+1)&&(Qe=h(Qe),Qe.length===Me+1&&($e=$e+1),tt&&(Qe=Qe.slice(0,-1)),ye=Qe.slice(0,$e),ce=Qe.slice($e)),we&&(ce=ce.replace(/0*$/,""));var Te=parseInt(ve,10);Te>0?ce.length<=Te?(ce=ce+c(Te-ce.length),ye=ye+ce,ce=""):(ye=ye+ce.slice(0,Te),ce=ce.slice(Te)):Te<0&&(ce=c(Math.abs(Te)-ye.length)+ye+ce,ye="0"),we||(ce=ce.slice(0,Se),ce.length<Se&&(ce=ce+c(Se-ce.length)),ye.length<ut&&(ye=c(ut-ye.length)+ye));var Ie="";if(le){Ve=ye;for(var De;Ve.length;)Ee.length&&(De=Ee.shift()),Ie&&(Ie=mt+Ie),Ie=Ve.slice(-De)+Ie,Ve=Ve.slice(0,-De)}else Ie=ye;return ce&&(Ie=Ie+wt+ce),Ie}function p(_,H){return _.label.length>H.label.length?-1:_.label.length<H.label.length?1:0}function m(_,H){var G=[];return S(k(H),function(re){if(re.slice(0,15)==="_durationLabels"){var le=re.slice(15).toLowerCase();S(k(H[re]),function(Ee){Ee.slice(0,1)===_&&G.push({type:le,key:Ee,label:H[re][Ee]})})}}),G}function w(_,H,G){return H===1&&G===null?_:_+_}var y={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:w};function v(_){return Object.prototype.toString.call(_)==="[object Array]"}function x(_){return Object.prototype.toString.call(_)==="[object Object]"}function R(_,H){for(var G=_.length;G-=1;)if(H(_[G]))return _[G]}function E(_,H){var G=0,re=_&&_.length||0,le;for(typeof H!="function"&&(le=H,H=function(Ee){return Ee===le});G<re;){if(H(_[G]))return _[G];G+=1}}function S(_,H){var G=0,re=_.length;if(!(!_||!re))for(;G<re;){if(H(_[G],G)===!1)return;G+=1}}function P(_,H){var G=0,re=_.length,le=[];if(!_||!re)return le;for(;G<re;)le[G]=H(_[G],G),G+=1;return le}function M(_,H){return P(_,function(G){return G[H]})}function C(_){var H=[];return S(_,function(G){G&&H.push(G)}),H}function z(_){var H=[];return S(_,function(G){E(H,G)||H.push(G)}),H}function T(_,H){var G=[];return S(_,function(re){S(H,function(le){re===le&&G.push(re)})}),z(G)}function I(_,H){var G=[];return S(_,function(re,le){if(!H(re))return G=_.slice(le),!1}),G}function O(_,H){var G=_.slice().reverse();return I(G,H).reverse()}function D(_,H){for(var G in H)H.hasOwnProperty(G)&&(_[G]=H[G]);return _}function k(_){var H=[];for(var G in _)_.hasOwnProperty(G)&&H.push(G);return H}function J(_,H){var G=0,re=_.length;if(!_||!re)return!1;for(;G<re;){if(H(_[G],G)===!0)return!0;G+=1}return!1}function N(_){var H=[];return S(_,function(G){H=H.concat(G)}),H}function Z(){var _=0;try{_.toLocaleString("i")}catch(H){return H.name==="RangeError"}return!1}function ue(_){return _(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function te(_){var H=!0;return H=H&&_(1,"en",{minimumIntegerDigits:1})==="1",H=H&&_(1,"en",{minimumIntegerDigits:2})==="01",H=H&&_(1,"en",{minimumIntegerDigits:3})==="001",!(!H||(H=H&&_(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",H=H&&_(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",H=H&&_(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",H=H&&_(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!H)||(H=H&&_(99.99,"en",{maximumSignificantDigits:1})==="100",H=H&&_(99.99,"en",{maximumSignificantDigits:2})==="100",H=H&&_(99.99,"en",{maximumSignificantDigits:3})==="100",H=H&&_(99.99,"en",{maximumSignificantDigits:4})==="99.99",H=H&&_(99.99,"en",{maximumSignificantDigits:5})==="99.99",!H)||(H=H&&_(1e3,"en",{useGrouping:!0})==="1,000",H=H&&_(1e3,"en",{useGrouping:!1})==="1000",!H))}function X(){var _=[].slice.call(arguments),H={},G;if(S(_,function(we,ut){if(!ut){if(!v(we))throw"Expected array as the first argument to durationsFormat.";G=we}if(typeof we=="string"||typeof we=="function"){H.template=we;return}if(typeof we=="number"){H.precision=we;return}x(we)&&D(H,we)}),!G||!G.length)return[];H.returnMomentTypes=!0;var re=P(G,function(we){return we.format(H)}),le=T(a,z(M(N(re),"type"))),Ee=H.largest;return Ee&&(le=le.slice(0,Ee)),H.returnMomentTypes=!1,H.outputTypes=le,P(G,function(we){return we.format(H)})}function ge(){var _=[].slice.call(arguments),H=D({},this.format.defaults),G=this.asMilliseconds(),re=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,re=0);var le=G<0,Ee=n.duration(Math.abs(G),"milliseconds"),we=n.duration(Math.abs(re),"months");S(_,function(B){if(typeof B=="string"||typeof B=="function"){H.template=B;return}if(typeof B=="number"){H.precision=B;return}x(B)&&D(H,B)});var ut={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Se={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};H.types=a;var mt=function(B){return E(a,function(Ne){return Se[Ne].test(B)})},wt=new RegExp(P(a,function(B){return Se[B].source}).join("|"),"g");H.duration=this;var je=typeof H.template=="function"?H.template.apply(H):H.template,ne=H.outputTypes,ie=H.returnMomentTypes,ye=H.largest,ce=[];ne||(v(H.stopTrim)&&(H.stopTrim=H.stopTrim.join("")),H.stopTrim&&S(H.stopTrim.match(wt),function(B){var Ne=mt(B);Ne==="escape"||Ne==="general"||ce.push(Ne)}));var ve=n.localeData();ve||(ve={}),S(k(y),function(B){if(typeof y[B]=="function"){ve[B]||(ve[B]=y[B]);return}ve["_"+B]||(ve["_"+B]=y[B])}),S(k(ve._durationTimeTemplates),function(B){je=je.replace("_"+B+"_",ve._durationTimeTemplates[B])});var Ve=H.userLocale||n.locale(),$e=H.useLeftUnits,tt=H.usePlural,Me=H.precision,Qe=H.forceLength,Te=H.useGrouping,Ie=H.trunc,De=H.useSignificantDigits&&Me>0,ft=De?H.precision:0,nt=ft,Xe=H.minValue,kt=!1,bt=H.maxValue,Dt=!1,Pt=H.useToLocaleString,sn=H.groupingSeparator,Yt=H.decimalSeparator,On=H.grouping;Pt=Pt&&(r||i);var Et=H.trim;v(Et)&&(Et=Et.join(" ")),Et===null&&(ye||bt||De)&&(Et="all"),(Et===null||Et===!0||Et==="left"||Et==="right")&&(Et="large"),Et===!1&&(Et="");var pt=function(B){return B.test(Et)},Dn=/large/,yt=/small/,Jt=/both/,Mn=/mid/,Pe=/^all|[^sm]all/,rt=/final/,xt=ye>0||J([Dn,Jt,Pe],pt),Pn=J([yt,Jt,Pe],pt),un=J([Mn,Pe],pt),cn=J([rt,Pe],pt),zn=P(je.match(wt),function(B,Ne){var Ge=mt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ge!=="escape"&&Ge!=="general"&&ce.push(Ge)),{index:Ne,length:B.length,text:"",token:Ge==="escape"?B.replace(Se.escape,"$1"):B,type:Ge==="escape"||Ge==="general"?null:Ge}}),Qt={index:0,length:0,token:"",text:"",type:null},en=[];$e&&zn.reverse(),S(zn,function(B){if(B.type){(Qt.type||Qt.text)&&en.push(Qt),Qt=B;return}$e?Qt.text=B.token+Qt.text:Qt.text+=B.token}),(Qt.type||Qt.text)&&en.push(Qt),$e&&en.reverse();var We=T(a,z(C(M(en,"type"))));if(!We.length)return M(en,"text").join("");We=P(We,function(B,Ne){var Ge=Ne+1===We.length,zt=!Ne,tn;B==="years"||B==="months"?tn=we.as(B):tn=Ee.as(B);var fn=Math.floor(tn),Rn=tn-fn,xn=E(en,function(Wt){return B===Wt.type});return zt&&bt&&tn>bt&&(Dt=!0),Ge&&Xe&&Math.abs(H.duration.as(B))<Xe&&(kt=!0),zt&&Qe===null&&xn.length>1&&(Qe=!0),Ee.subtract(fn,B),we.subtract(fn,B),{rawValue:tn,wholeValue:fn,decimalValue:Ge?Rn:0,isSmallest:Ge,isLargest:zt,type:B,tokenLength:xn.length}});var St=Ie?Math.floor:Math.round,Hn=function(B,Ne){var Ge=Math.pow(10,Ne);return St(B*Ge)/Ge},Ht=!1,gt=!1,In=function(B,Ne){var Ge={useGrouping:Te,groupingSeparator:sn,decimalSeparator:Yt,grouping:On,useToLocaleString:Pt};return De&&(ft<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ge.maximumSignificantDigits=ft,B.significantDigits=ft)),Dt&&!gt&&(B.isLargest?(B.wholeValue=bt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),kt&&!gt&&(B.isSmallest?(B.wholeValue=Xe,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Me<0?B.value=Hn(B.wholeValue,Me):Me===0?B.value=St(B.wholeValue+B.decimalValue):De?(Ie?B.value=Hn(B.rawValue,ft-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ft-=B.wholeValue.toString().length)):(Ge.fractionDigits=Me,Ie?B.value=B.wholeValue+Hn(B.decimalValue,Me):B.value=B.wholeValue+B.decimalValue):De&&B.wholeValue?(B.value=Math.round(Hn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ft-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Qe||Ht)&&(Ge.minimumIntegerDigits=B.tokenLength,gt&&Ge.maximumSignificantDigits<B.tokenLength&&delete Ge.maximumSignificantDigits),!Ht&&(B.value>0||Et===""||E(ce,B.type)||E(ne,B.type))&&(Ht=!0),B.formattedValue=f(B.value,Ge,Ve),Ge.useGrouping=!1,Ge.decimalSeparator=".",B.formattedValueEn=f(B.value,Ge,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=f(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(We=P(We,In),We=C(We),We.length>1){var cr=function(B){return E(We,function(Ne){return Ne.type===B})},Bn=function(B){var Ne=cr(B.type);Ne&&S(B.targets,function(Ge){var zt=cr(Ge.type);zt&&parseInt(Ne.formattedValueEn,10)===Ge.value&&(Ne.rawValue=0,Ne.wholeValue=0,Ne.decimalValue=0,zt.rawValue+=1,zt.wholeValue+=1,zt.decimalValue=0,zt.formattedValueEn=zt.wholeValue.toString(),gt=!0)})};S(l,Bn)}return gt&&(Ht=!1,ft=nt,We=P(We,In),We=C(We)),ne&&!(Dt&&!H.trim)?(We=P(We,function(B){return E(ne,function(Ne){return B.type===Ne})?B:null}),We=C(We)):(xt&&(We=I(We,function(B){return!B.isSmallest&&!B.wholeValue&&!E(ce,B.type)})),ye&&We.length&&(We=We.slice(0,ye)),Pn&&We.length>1&&(We=O(We,function(B){return!B.wholeValue&&!E(ce,B.type)&&!B.isLargest})),un&&(We=P(We,function(B,Ne){return Ne>0&&Ne<We.length-1&&!B.wholeValue?null:B}),We=C(We)),cn&&We.length===1&&!We[0].wholeValue&&!(!Ie&&We[0].isSmallest&&We[0].rawValue<Xe)&&(We=[])),ie?We:(S(en,function(B){var Ne=ut[B.type],Ge=E(We,function(Wt){return Wt.type===B.type});if(!(!Ne||!Ge)){var zt=Ge.formattedValueEn.split(".");zt[0]=parseInt(zt[0],10),zt[1]?zt[1]=parseFloat("0."+zt[1],10):zt[1]=null;var tn=ve.durationPluralKey(Ne,zt[0],zt[1]),fn=m(Ne,ve),Rn=!1,xn={};S(ve._durationLabelTypes,function(Wt){var En=E(fn,function(Tn){return Tn.type===Wt.type&&Tn.key===tn});En&&(xn[En.type]=En.label,u(B.text,Wt.string)&&(B.text=B.text.replace(Wt.string,En.label),Rn=!0))}),tt&&!Rn&&(fn.sort(p),S(fn,function(Wt){if(xn[Wt.type]===Wt.label)return u(B.text,Wt.label)?!1:void 0;if(u(B.text,Wt.label))return B.text=B.text.replace(Wt.label,xn[Wt.type]),!1}))}}),en=P(en,function(B){if(!B.type)return B.text;var Ne=E(We,function(zt){return zt.type===B.type});if(!Ne)return"";var Ge="";return $e&&(Ge+=B.text),(le&&Dt||!le&&kt)&&(Ge+="< ",Dt=!1,kt=!1),(le&&kt||!le&&Dt)&&(Ge+="> ",Dt=!1,kt=!1),le&&(Ne.value>0||Et===""||E(ce,Ne.type)||E(ne,Ne.type))&&(Ge+="-",le=!1),B.type==="milliseconds"&&Ne.formattedValueMS?Ge+=Ne.formattedValueMS:Ge+=Ne.formattedValue,$e||(Ge+=B.text),Ge}),en.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var _=this.duration,H=function(le){return _._data[le]},G=E(this.types,H),re=R(this.types,H);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===re)return"d __";case"weeks":return G===re?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===re)return"M __";case"years":return G===re?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function fe(_){if(!_)throw"Moment Duration Format init cannot find moment instance.";_.duration.format=X,_.duration.fn.format=ge,_.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:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},_.updateLocale("en",y)}var he=function(_,H,G){return _.toLocaleString(H,G)};r=Z()&&te(he),o=r&&ue(he);var oe=function(_,H,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(H,G).format(_)};return i=te(oe),s=i&&ue(oe),fe(n),fe})})(Bl)),Bl.exports}o1();const i1=["true","t","yes","y","on","1"],a1=["false","f","no","n","off","0"];function Tt(e,t=""){return{kind:Y.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Oo(e){return Object.hasOwn(e,"isError")&&e.isError}function l1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function fs(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Wl(e=!1){return e?{kind:Y.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Y.Loading,allowOverlay:!1,copyData:""}}function s1(e,t){const n=t?"faded":"normal";return{kind:Y.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Nl(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 zo(e,t){return Oe(e)?t||{}:Oe(t)?e||{}:id(e,t)}function ps(e){if(Oe(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),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:st(n)):[st(t)]}catch{return[st(e)]}}function hh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Ip&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function u1(e){return e?.startsWith("{")&&e.endsWith("}")}function st(e){try{try{return n1(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function fh(e){if(Oe(e))return null;if(typeof e=="boolean")return e;const t=st(e).toLowerCase().trim();if(t==="")return null;if(i1.includes(t))return!0;if(a1.includes(t))return!1}function bi(e){if(Oe(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=li.unformat(e.trim());if(lt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function ph(e){return Oe(e)?"":st(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ma(e){if(Oe(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return st(e)}}function c1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const t=e.toExponential().split("e");return Math.abs(parseInt(t[1],10))}function Kr(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 va(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Oe(t)||t===""?lt(n)?(n===0&&(e=Math.round(e)),li(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):li(e).format({thousandSeparated:!1,mantissa:c1(e),trimMantissa:!0}):t==="plain"?li(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Kr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Kr(e,{style:"percent",minimumFractionDigits:lt(n)?Math.max(n-2,0):0,maximumFractionDigits:lt(n)?Math.max(n-2,0):2}):t==="dollar"?Kr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Kr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Kr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Kr(e,{notation:t}):t==="accounting"?li(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Kr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):Cg.sprintf(t,e)}function uc(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,o=n==="time"?void 0:"medium",i=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:o,timeStyle:i}).format(e.toDate())}catch(s){if(s instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).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 Zi(e){if(Oe(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=qr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=qr.utc(e);if(n.isValid())return n.toDate();const r=qr.utc(e,[qr.HTML5_FMT.TIME_MS,qr.HTML5_FMT.TIME_SECONDS,qr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function gh(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 d1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,o=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*o)/n}const h1=new RegExp(/(\r\n|\n|\r)/gm);function yi(e){return e.indexOf(`
|
|
177
|
-
`)!==-1?e.replace(h1," "):e}function f1(e,t){if(Oe(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const p1=tr("div",{target:"en99xsi0"})(({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"}}),""),gs=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Xa.parse(e):Xa.parse(Xa.stringify(e))}catch{n=void 0}return Oe(n)?me.jsx(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:ma(e)??"",onChange:()=>{}}):me.jsx(p1,{"data-testid":"stJsonColumnViewer",children:me.jsx(Jf,{src:n,collapsed:2,theme:Qf(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"}})})};d.memo(gs);const g1=e=>{const t=e.theme,n=e.value.data;return me.jsx(gs,{jsonValue:n.value||n.displayValue,theme:t})},m1=e=>{const t=e.theme,n=e.value;return me.jsx(gs,{jsonValue:n.data,theme:t})},v1={kind:Y.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return is(e,r??ma(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??ma(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:g1})},mh="line_chart",b1="area_chart",vh="bar_chart",y1=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function ms(e,t,n,r){const o=zo({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),i=y1(r);let s;o.color==="auto"||o.color==="auto-inverse"?s=r.colors.greenColor:s=o.color?i.get(o.color)??o.color:void 0;const a={kind:Y.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:s,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===mh?":material/show_chart:":e===vh?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(l){if(Oe(l))return Wl();const u=ps(l),c=[];let h=[];if(u.length===0)return Wl();let g=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER;for(let y=0;y<u.length;y++){const v=bi(u[y]);if(Number.isNaN(v)||Oe(v))return Tt(st(u),`The value cannot be interpreted as a numeric array. ${st(v)} is not a number.`);v>g&&(g=v),v<f&&(f=v),c.push(v)}let p,m;if(u.length===1){let y;g<=0?y=g===0?1:0:y=g,p=o.y_max??y,m=o.y_min??(g>=0?0:g)}else p=o.y_max??g,m=o.y_min??f;if(Oe(m)||Oe(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Tt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);c.length>0&&(g>p||f<m)?h=c.map(y=>g-f===0?g>(p||1)?p:m:(p-m)*((y-f)/(g-f))+m):h=c;let w=s;return(o.color==="auto"&&h[0]>h[h.length-1]||o.color==="auto-inverse"&&h[0]<h[h.length-1])&&(w=r.colors.redColor),{...a,copyData:c.join(","),data:{...a.data,values:h,displayValues:c.map(y=>va(y)),yAxis:[m,p],color:w},isMissingValue:Oe(l)}},getCellValue(l){return l.kind===Y.Loading||l.data?.values===void 0?null:l.data?.values}}}function bh(e,t){return ms(mh,e,"line",t)}bh.isEditableType=!1;function yh(e,t){return ms(vh,e,"bar",t)}yh.isEditableType=!1;function wh(e,t){return ms(b1,e,"area",t)}wh.isEditableType=!1;function vs(e,t){const n={kind:Y.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(an(t.radii.md),an(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=fh(r),o===void 0?Tt(st(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:Oe(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}vs.isEditableType=!0;function cc(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function bs(e,t,n,r,o,i,s){const a=zo({format:n,step:r,timezone:s},t.columnTypeOptions);let l;if(lt(a.timezone))try{l=cc(Qs(),a.timezone)?.utcOffset()||void 0}catch{}let u;lt(a.min_value)&&(u=Zi(a.min_value)||void 0);let c;lt(a.max_value)&&(c=Zi(a.max_value)||void 0);const h={kind:Y.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:o,min:u,max:c}},g=f=>{const p=Zi(f);return p===null?!t.isRequired:!(p===void 0||lt(u)&&i(p)<i(u)||lt(c)&&i(p)>i(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(f,p){if(p===!0){const x=g(f);if(x===!1)return Tt(st(f),"Invalid input.");x instanceof Date&&(f=x)}const m=Zi(f);let w="",y="",v=l;if(m===void 0)return Tt(st(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=Qs.utc(m);if(!x.isValid())return Tt(st(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
178
|
-
Error: ${x.toString()}`);if(a.timezone){try{x=cc(x,a.timezone)}catch(R){return Tt(x.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
|
|
179
|
-
Error: ${R}`)}v=x.utcOffset()}try{y=uc(x,a.format||n,e)}catch(R){return Tt(x.toISOString(),`Failed to format the date for rendering with: ${a.format}.
|
|
180
|
-
Error: ${R}`)}w=uc(x,n,e)}return{...h,copyData:w,isMissingValue:Oe(m),data:{...h.data,date:m,displayDate:y,timezoneOffset:v}}},getCellValue(f){return Oe(f?.data?.date)?null:i(f.data.date)}}}function ys(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=ep(e.arrowType),r=lt(n)||lt(e?.columnTypeOptions?.timezone);return bs("datetime",e,r?t+"Z":t,1,"datetime-local",o=>r?o.toISOString():o.toISOString().replace("Z",""),n)}ys.isEditableType=!0;function ws(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),bs("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}ws.isEditableType=!0;function xs(e){return bs("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}xs.isEditableType=!0;function xh(e){const t={kind:Y.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)?[st(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]}}}xh.isEditableType=!1;function Ch(e){const t={kind:Y.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)?yi(ma(n)):"";return{...t,copyData:r,isMissingValue:Oe(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Tt(st(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}Ch.isEditableType=!1;function kh(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}.
|
|
181
|
-
Error: ${l}`}let r=!1,o=t.display_text,i;if(!Oe(o)){if(o.startsWith(":material/")&&tp(o))o=np(o).icon,r=!0;else if(o.includes("(")&&o.includes(")"))try{i=new RegExp(o,"us")}catch{i=void 0}}const s={kind:Y.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:rp.iconFont,linkColor:void 0}}},a=l=>{if(Oe(l))return!e.isRequired;const u=st(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(Oe(l))return{...s,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=l;if(typeof n=="string")return Tt(st(c),n);if(u&&a(c)===!1)return Tt(st(c),"Invalid input.");let h="";return c&&(i!==void 0?h=f1(i,c):h=o||c),{...s,data:c,displayData:h,isMissingValue:Oe(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(l){return Oe(l.data)?null:l.data}}}kh.isEditableType=!0;function Cs(e){const t={kind:Y.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(Oe(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=ps(n);return{...t,data:{...t.data,values:r},copyData:ph(r),...e.isEditable&&!hh(n)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(n){return Oe(n.data?.values)?null:n.data.values}}}Cs.isEditableType=!0;const w1=e=>{const t=Hp(e);return new Map(Object.entries({red:t.redbg,blue:t.bluebg,green:t.greenbg,yellow:t.yellowbg,violet:t.violetbg,purple:t.purplebg,orange:t.orangebg,gray:t.graybg,grey:t.graybg,primary:t.primarybg}))},x1=(e,t)=>{if(Oe(e))return[];const n=w1(t);return e.filter(r=>r!==null&&r!=="").map(r=>{if(typeof r=="string")return{value:st(r).trim(),label:void 0,color:void 0};const o=r.color?Mp(n.get(r.color)??r.color,t.colors.bgColor):void 0;return{value:st(r.value).trim(),label:r.label??void 0,color:o}})};function Sh(e,t){const n=zo({options:[],accept_new_options:!1},e.columnTypeOptions),r=x1(n.options,t),o=new Set(r.map(s=>s.value)),i={kind:Y.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(s,a){if(Oe(s))return{...i,data:{...i.data,values:null},isMissingValue:!0,copyData:""};let l=ps(s);return l=l.map(u=>st(u).trim()),a&&l.length>0&&n.accept_new_options===!1&&(l=l.filter(u=>o.has(u)),l.length===0)?Tt(st(s),"The values could not be matched with the configured options."):{...i,data:{...i.data,values:l},copyData:ph(l),...e.isEditable&&!hh(s)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(s){return Oe(s.data?.values)?null:s.data.values}}}Sh.isEditableType=!0;function ks(e){const t=zo({step:ed(e.arrowType)?1:void 0,min_value:op(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(ip(e.arrowType)||ap(e.arrowType)),r=Oe(t.min_value)||t.min_value<0,o=lt(t.step)&&!Number.isNaN(t.step)?gh(t.step):void 0,i={kind:Y.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},s=a=>{let l=bi(a);if(Oe(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 h=s(a);if(h===!1)return Tt(st(a),"Invalid input.");typeof h=="number"&&(a=h)}let u=bi(a),c="";if(lt(u)){if(Number.isNaN(u))return Tt(st(a),"The value cannot be interpreted as a number.");if(lt(o)&&(u=d1(u,o)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Tt(st(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Ol(u,e.arrowType):c=va(u,t.format,o)}catch(h){return Tt(st(u),lt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${h}`:`Failed to format the number. Error: ${h}`)}}return{...i,data:u,displayData:c,isMissingValue:Oe(u),copyData:Oe(u)?"":st(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}ks.isEditableType=!0;function wi(e){const t={kind:Y.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)?st(n):null,o=lt(r)?yi(r):"";return{...t,data:r,displayData:o,isMissingValue:Oe(n)}}catch(r){return Tt(st(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}wi.isEditableType=!1;function Mh(e){const t=ed(e.arrowType),n=zo({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions),r=Oe(n.step)||Number.isNaN(n.step)?void 0:gh(n.step);let o;try{o=va(n.max_value,n.format,r)}catch{o=st(n.max_value)}const i={kind:Y.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:o}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(s){if(Oe(s))return Wl();if(Oe(n.min_value)||Oe(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Tt("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 Tt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const a=bi(s);if(Number.isNaN(a)||Oe(a))return Tt(st(s),"The value cannot be interpreted as a number.");if(Number.isInteger(a)&&!Number.isSafeInteger(a))return Tt(st(s),"The value is larger than the maximum supported integer values in number columns (2^53).");let l="";try{l=va(a,n.format,r)}catch(c){return Tt(st(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{...i,isMissingValue:Oe(s),copyData:String(a),data:{...i.data,value:u,label:l,measureLabel:l.length>o.length?l:o}}},getCellValue(s){return s.kind===Y.Loading||s.data?.value===void 0?null:s.data?.value}}}Mh.isEditableType=!1;const C1=e=>Oe(e)?[]:e.filter(t=>lt(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=st(t.value).trim();return{value:r,label:t.label??r}}const n=st(t).trim();return{value:n,label:n}});function Ss(e){let t="string";const n=zo({options:td(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=l=>typeof l=="object"&&l!==null&&"value"in l,o=l=>r(l)?typeof l.value:typeof l,i=new Set(n.options.map(o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const s=C1(n.options),a={kind:Y.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...s],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(l,u){let c=null;return lt(l)&&l!==""&&(c=st(l)),u&&!a.data.allowedValues.some(h=>h===null?c===null:typeof h=="string"?h===c:typeof h=="object"&&"value"in h?h.value===c:!1)?Tt(st(c),"The value is not part of the allowed options."):{...a,isMissingValue:c===null,copyData:c||"",data:{...a.data,value:c}}},getCellValue(l){return Oe(l.data?.value)||l.data?.value===""?null:t==="number"?bi(l.data?.value)??null:t==="boolean"?fh(l.data?.value)??null:l.data?.value}}}Ss.isEditableType=!0;function Ms(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(i){n=`Invalid validate regex: ${t.validate}.
|
|
182
|
-
Error: ${i}`}const r={kind:Y.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},o=i=>{if(Oe(i))return!e.isRequired;let s=st(i),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:o,getCell(i,s){if(typeof n=="string")return Tt(st(i),n);if(s){const a=o(i);if(a===!1)return Tt(st(i),"Invalid input.");typeof a=="string"&&(i=a)}try{const a=lt(i)?st(i):null,l=lt(a)?yi(a):"";return{...r,isMissingValue:Oe(a),data:a,displayData:l}}catch(a){return Tt("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(i){return i.data===void 0?null:i.data}}}Ms.isEditableType=!0;const dc=tr("img",{target:"e24uaba0"})({name:"6eya2z",styles:"max-width:100%;max-height:37.5rem;object-fit:scale-down"}),k1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?me.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:me.jsx(dc,{src:t})}):me.jsx(dc,{src:t})},hc=new Map(Object.entries({object:wi,text:Ms,checkbox:vs,selectbox:Ss,list:Cs,multiselect:Sh,number:ks,link:kh,datetime:ys,date:xs,time:ws,line_chart:bh,bar_chart:yh,area_chart:wh,image:xh,progress:Mh,json:Ch})),S1=[v1];var M1=Yc();const I1=vr(M1);var yl,fc;function R1(){if(fc)return yl;fc=1;var e=lp(),t=sp(),n=up(),r=Yc(),o=cp(),i=dp(),s=hp(),a=fp(),l="[object Map]",u="[object Set]",c=Object.prototype,h=c.hasOwnProperty;function g(f){if(f==null)return!0;if(o(f)&&(r(f)||typeof f=="string"||typeof f.splice=="function"||i(f)||a(f)||n(f)))return!f.length;var p=t(f);if(p==l||p==u)return!f.size;if(s(f))return!e(f).length;for(var m in f)if(h.call(f,m))return!1;return!0}return yl=g,yl}var E1=R1();const T1=vr(E1);function wl(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const o=r.exec(n);if(o)return o[1].trim()}function O1(e,t,n){const r={};if(!n.includes(t))return e;const o=wl(t,"color",n);o&&(r.textDark=o,(e.kind===Y.Bubble||e.kind===Y.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=o),e.kind===Y.Uri&&(r.linkColor=o));const i=wl(t,"background-color",n);i&&(r.bgCell=i),i==="yellow"&&o===void 0&&(r.textDark="#31333F");const s=wl(t,"font-weight",n);return s&&(r.baseFontStyle=`${s} ${Jp.sm}`),r?{...e,themeOverride:r}:e}function D1(e){return Np(e)||jp(e)?Ms:Gp(e)?ys:sd(e)?ws:Up(e)?xs:Kp(e)||qp(e)?wi:td(e)?vs:Xp(e)?ks:Zp(e)?Ss:Yp(e)?Cs:wi}function Ih(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 Is(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function P1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:o}=Ih(n),i=e.columnTypes[t];let s=!0;return Wp(i)&&(s=!1),Is({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:o,isEditable:s,arrowType:i,isIndex:!0,isPinned:!0})}function z1(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:o}=Ih(n),i=e.columnTypes[t];return Is({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:i,group:o})}function Rh(){return Is({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:_p.INDEX,arrowField:new Fp("",new Ap,!0),pandasType:void 0}})}function pc(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,o=n.numDataColumns;if(r===0&&o===0)return t.push(Rh()),t;for(let i=0;i<r;i++)t.push(P1(e,i));for(let i=0;i<o;i++)t.push(z1(e,i+r));return t}function H1(e,t,n,r=void 0){let o;if(e.kind==="object"||e.kind==="json")o=e.getCell(lt(t.content)?yi(Ol(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&<(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let i;sd(t.contentType)&<(t.field?.type?.unit)?i=Vp(t.content,t.field):i=qr.utc(Number(t.content)).toDate(),o=e.getCell(i)}else if($p(t.contentType)){const i=Oe(t.content)?null:Ol(t.content,t.contentType);o=e.getCell(i)}else o=e.getCell(t.content);if(Oo(o))return o;if(!e.isEditable){if(n&<(n?.displayContent)){const i=yi(n.displayContent);o.kind===Y.Text?o={...o,displayData:i}:o.kind===Y.Number&&Oe(e.columnTypeOptions?.format)?o={...o,displayData:i}:o.kind===Y.Uri&&Oe(e.columnTypeOptions?.display_text)?o={...o,displayData:i}:o.kind===Y.Custom&&o.data?.kind==="date-picker-cell"&&Oe(e.columnTypeOptions?.format)&&(o={...o,data:{...o.data,displayDate:i}})}r&&n?.cssId&&(o=O1(o,n.cssId,r))}return o}function Eh(e,t){return t?t?.useStretch??!1:e.useContainerWidth??!1}function Th(e,t){return t?t.pixelWidth?t.pixelWidth:void 0:e.width||void 0}function L1(e){return e?.useContent??!1}function F1(e,t){return t?t.pixelHeight?t.pixelHeight:void 0:e.height||void 0}const ia="_index",gc="_pos:",mc={small:75,medium:200,large:400},Oh=Zl.getLogger("useColumnLoader");function A1(e){if(!Oe(e)){if(typeof e=="number")return e;if(e in mc)return mc[e]}}const Yi=(e,t)=>Lp(e,t,(n,r)=>{if(I1(r))return r});function vc(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ia)&&(n=Yi(n,t.get(ia)??{})),t.has(`${gc}${e.indexNumber}`)&&(n=Yi(n,t.get(`${gc}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ia&&(n=Yi(n,t.get(e.name)??{})),t.has(e.id)&&(n=Yi(n,t.get(e.id)??{})),T1(n)?e:id({...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 _1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Oh.error(t),new Map}}function bc(e){const t=e.columnTypeOptions?.type;let n;return lt(t)&&(hc.has(t)?n=hc.get(t):Oh.warn(`Unknown column type configured in column configuration: ${t}`)),Oe(n)&&(n=D1(e.arrowType)),n}function V1(e,t,n,r,o){const i=Jr(),s=d.useMemo(()=>_1(e.columns),[e.columns]),[a,l]=d.useState(s);d.useEffect(()=>{l(s)},[s]);const u=d.useMemo(()=>Eh(e,o),[e,o]),c=d.useMemo(()=>Th(e,o),[e,o]),h=u||lt(c)&&c>0,g=lt(e.rowHeight)&&e.rowHeight>an("4rem"),f=d.useMemo(()=>pc(t).map(p=>{let m={...p,...vc(p,a),isStretched:h};const w=bc(m);return(e.editingMode===ln.EditingMode.READ_ONLY||n||w.isEditableType===!1)&&(m={...m,isEditable:!1}),e.editingMode!==ln.EditingMode.READ_ONLY&&m.isEditable==!0&&(m={...m,icon:"editable"},m.isRequired&&e.editingMode===ln.EditingMode.DYNAMIC&&(m={...m,isHidden:!1})),w(m,i)}),[t,a,h,e.editingMode,n,i]);return{columns:d.useMemo(()=>{const p=pc(t).map(v=>{let x={...v,...vc(v,a),isStretched:h,isWrappingAllowed:g};const R=bc(x);return(e.editingMode===ln.EditingMode.READ_ONLY||n||R.isEditableType===!1)&&(x={...x,isEditable:!1}),e.editingMode!==ln.EditingMode.READ_ONLY&&x.isEditable==!0&&(x={...x,icon:"editable"},x.isRequired&&e.editingMode===ln.EditingMode.DYNAMIC&&(x={...x,isHidden:!1})),R(x,i)}).filter(v=>!v.isHidden),m=[],w=[];r?.length?(p.forEach(v=>{v.isIndex&&!r.includes(v.name)&&!r.includes(v.id)&&v.isPinned!==!1&&m.push(v)}),r.forEach(v=>{const x=p.find(R=>R.name===v||R.id===v);x&&(x.isPinned?m.push(x):w.push(x))})):p.forEach(v=>{v.isPinned?m.push(v):w.push(v)});const y=[...m,...w];return y.length>0?y:[wi(Rh())]},[t,a,g,h,n,e.editingMode,r,i]),allColumns:f,setColumnConfigMapping:l}}function Xr(e){return e.isIndex?ia:Oe(e.name)?"":e.name}class Ji{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,i,s)=>{const a={};o.forEach((l,u)=>{const c=n.get(u);c&&(a[Xr(c)]=c.getCellValue(l))}),r.edited_rows[i]=a}),this.addedRows.forEach(o=>{const i={};let s=!1;o.forEach((a,l,u)=>{const c=n.get(l);if(c){const h=c.getCellValue(a);c.isRequired&&c.isEditable&&fs(a)&&(s=!0),lt(h)&&(i[Xr(c)]=h)}}),s||r.added_rows.push(i)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,i)=>i===void 0?null:i)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),o=new Map;n.forEach(s=>{o.set(s.indexNumber,s)});const i=new Map;n.forEach(s=>{i.set(Xr(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],h=i.get(u);if(h){const g=h.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(h.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=i.get(l);if(c){const h=c.getCell(u);h&&a.set(c.indexNumber,h)}}),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(!(Oe(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 xi=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),o=r.get(e),i={...o||{},...n||{}};return(o?.type_config||n?.type_config)&&(i.type_config={...o?.type_config||{},...n?.type_config||{}}),r.set(e,i),r};function $1(e){return{changeColumnFormat:d.useCallback((t,n)=>{e(r=>xi({columnId:t,columnConfigMapping:r,updatedProps:{type_config:{format:n}}}))},[e])}}function B1(e,t,n,r,o,i){const s=d.useMemo(()=>e.filter(u=>u.isPinned).reduce((u,c)=>u+(c.width??r*2),0)>n*.6,[e,n,r]),a=t||s?0:e.filter(u=>u.isPinned).length,l=d.useCallback(u=>{i(c=>xi({columnId:u,columnConfigMapping:c,updatedProps:{pinned:!1}})),o(!0,!1)},[o,i]);return{pinColumn:d.useCallback(u=>{i(c=>xi({columnId:u,columnConfigMapping:c,updatedProps:{pinned:!0}})),o(!0,!1)},[o,i]),unpinColumn:l,freezeColumns:a}}function W1(e,t,n,r,o){return{onColumnMoved:d.useCallback((i,s)=>{const a=[...e],[l]=a.splice(i,1);a.splice(s,0,l),s<t&&!l.isPinned?n(l.id):s>=t&&l.isPinned&&r(l.id),o(a.map(u=>u.id))},[e,t,n,r,o])}}function N1(e){const[t,n]=d.useState(()=>new Map),r=d.useCallback((o,i,s,a)=>{o.id&&n(new Map(t).set(o.id,a))},[t]);return{columns:d.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 Y.Number:return e.data?.toString()??"";case Y.Boolean:return e.data?.toString()??"";case Y.Markdown:case Y.RowID:case Y.Text:case Y.Uri:return e.data??"";case Y.Bubble:case Y.Image:return e.data.join("");case Y.Drilldown:return e.data.map(t=>t.text).join("");case Y.Protected:case Y.Loading:return"";case Y.Custom:return e.copyData}}function yc(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function G1(e,t){return e=yc(e),t=yc(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 U1(e,t){return e>t?1:e===t?0:-1}function K1(e){const{sort:t,rows:n,getCellContent:r}=e,o=d.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),i=d.useMemo(()=>o.map(u=>{const c=e.columns.findIndex(h=>u.column===h||h.id!==void 0&&u.column.id===h.id);return c===-1?void 0:c}),[o,e.columns]),s=d.useMemo(()=>{const u=o.map((h,g)=>({sort:h,col:i[g]})).filter(h=>h.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let h=0;h<u.length;h++){const{col:g}=u[h],f=[g,0];for(let p=0;p<n;p++)f[1]=p,c[h][p]=j1(r(f))}return Tr(n).sort((h,g)=>{for(let f=0;f<u.length;f++){const{sort:p}=u[f],m=c[f][h],w=c[f][g];let y;if(p.mode==="raw"?y=U1(m,w):p.mode==="smart"?y=G1(m,w):y=m.localeCompare(w),y!==0)return(p.direction??"asc")==="desc"&&(y=-y),y}return 0})},[r,n,o,i]),a=d.useCallback(u=>s===void 0?u:s[u],[s]),l=d.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 X1(e,t,n){const[r,o]=d.useState(),{getCellContent:i,getOriginalIndex:s}=K1({columns:t.map(u=>Nl(u)),getCellContent:n,rows:e,sort:r}),a=d.useMemo(()=>q1(t,r),[t,r]),l=d.useCallback((u,c,h)=>{const g=a[u];let f;c==="auto"?(f="asc",r&&r.column.id===g.id&&(r.direction==="asc"?f="desc":f=void 0)):f=c,f===void 0||h&&f===r?.direction?o(void 0):o({column:Nl(g),direction:f,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:l,getOriginalIndex:s,getCellContent:i}}function Z1(e,t){const n=d.useCallback(o=>{t(i=>xi({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=d.useCallback(o=>{t(i=>xi({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Y1(){return{provideEditor:d.useCallback(e=>{if(e.kind===Y.Text&&e.readonly&&u1(e.data))return{editor:m1}},[])}}const J1={kind:Y.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:o,hoverAmount:i,hoverX:s}=e;let{values:a,yAxis:l,color:u,graphKind:c="area",displayValues:h,hideAxis:g}=t.data;const[f,p]=l;if(a.length===0)return!0;a=a.map(S=>Math.min(1,Math.max(0,(S-f)/(p-f))));const m=r.cellHorizontalPadding,w=m+o.x,y=o.y+3,v=o.height-6,x=o.width-m*2,R=p-f,E=p<=0?y:f>=0?y+v:y+v*(p/R);if(!g&&f<=0&&p>=0&&(n.beginPath(),n.moveTo(w,E),n.lineTo(w+x,E),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const S=2,P=(a.length-1)*S,M=(x-P)/a.length;let C=w;for(const z of a){const T=y+v-z*v;n.moveTo(C,E),n.lineTo(C+M,E),n.lineTo(C+M,T),n.lineTo(C,T),C+=M+S}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],h&&(h=[h[0],h[0]])),n.beginPath();const S=(o.width-16)/(a.length-1),P=a.map((C,z)=>({x:w+S*z,y:y+v-C*v}));n.moveTo(P[0].x,P[0].y);let M=0;if(P.length>2)for(M=1;M<P.length-2;M++){const C=(P[M].x+P[M+1].x)/2,z=(P[M].y+P[M+1].y)/2;n.quadraticCurveTo(P[M].x,P[M].y,C,z)}if(n.quadraticCurveTo(P[M].x,P[M].y,P[M+1].x,P[M+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+i*.5,n.stroke(),n.lineTo(o.x+o.width-m,E),n.lineTo(o.x+m,E),n.closePath(),c==="area"){n.globalAlpha=.2+.2*i;const C=n.createLinearGradient(0,y,0,y+v*1.4);C.addColorStop(0,u??r.accentColor);const[z,T,I]=gi(u??r.accentColor);C.addColorStop(1,`rgba(${z}, ${T}, ${I}, 0)`),n.fillStyle=C,n.fill(),n.globalAlpha=1}if(s!==void 0&&(c==="line"||c==="area")&&h!==void 0){n.beginPath();const C=Math.min(a.length-1,Math.max(0,Math.round((s-m)/S)));n.moveTo(w+C*S,o.y+1),n.lineTo(w+C*S,o.y+o.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(h[C],w,o.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function wc(e,t,n,r,o,i){if(!(r<=0||o<=0)){if(typeof i=="number"&&i<=0){e.rect(t,n,r,o);return}typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.min(i.tl,o/2,r/2),tr:Math.min(i.tr,o/2,r/2),bl:Math.min(i.bl,o/2,r/2),br:Math.min(i.br,o/2,r/2)},i.tl=Math.max(0,i.tl),i.tr=Math.max(0,i.tr),i.br=Math.max(0,i.br),i.bl=Math.max(0,i.bl),e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}}function xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xc(Object(n),!0).forEach(function(r){ai(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Q1=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Dh(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,o=r===void 0?!1:r,i=e.defaultValue,s=i===void 0?null:i,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,h=e.onMenuClose,g=e.onMenuOpen,f=e.value,p=ur(e,Q1),m=d.useState(a!==void 0?a:n),w=gr(m,2),y=w[0],v=w[1],x=d.useState(l!==void 0?l:o),R=gr(x,2),E=R[0],S=R[1],P=d.useState(f!==void 0?f:s),M=gr(P,2),C=M[0],z=M[1],T=d.useCallback(function(Z,ue){typeof u=="function"&&u(Z,ue),z(Z)},[u]),I=d.useCallback(function(Z,ue){var te;typeof c=="function"&&(te=c(Z,ue)),v(te!==void 0?te:Z)},[c]),O=d.useCallback(function(){typeof g=="function"&&g(),S(!0)},[g]),D=d.useCallback(function(){typeof h=="function"&&h(),S(!1)},[h]),k=a!==void 0?a:y,J=l!==void 0?l:E,N=f!==void 0?f:C;return He(He({},p),{},{inputValue:k,menuIsOpen:J,onChange:T,onInputChange:I,onMenuClose:D,onMenuOpen:O,value:N})}function ey(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function ty(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var ny=(function(){function e(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ty(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=ey(r);try{o.insertRule(n,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e})(),ry=function(e,t,n){for(var r=0,o=0;r=o,o=Dl(),r===38&&o===12&&(t[n]=1),!cd(o);)ud();return mg(e,dd)},oy=function(e,t){var n=-1,r=44;do switch(cd(r)){case 0:r===38&&Dl()===12&&(t[n]=1),e[n]+=ry(dd-1,t,n);break;case 2:e[n]+=gg(r);break;case 4:if(r===44){e[++n]=Dl()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=pg(r)}while(r=ud());return e},iy=function(e,t){return dg(oy(hg(e),t))},Cc=new WeakMap,ay=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Cc.get(n))&&!r){Cc.set(e,!0);for(var o=[],i=iy(t,o),s=n.props,a=0,l=0;a<i.length;a++)for(var u=0;u<s.length;u++,l++)e.props[l]=o[a]?i[a].replace(/&\f/g,s[u]):s[u]+" "+i[a]}}},ly=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Ph(e,t){switch(fg(e,t)){case 5103:return It+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return It+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return It+e+sa+e+yn+e+e;case 6828:case 4268:return It+e+yn+e+e;case 6165:return It+e+yn+"flex-"+e+e;case 5187:return It+e+At(e,/(\w+).+(:[^]+)/,It+"box-$1$2"+yn+"flex-$1$2")+e;case 5443:return It+e+yn+"flex-item-"+At(e,/flex-|-self/,"")+e;case 4675:return It+e+yn+"flex-line-pack"+At(e,/align-content|flex-|-self/,"")+e;case 5548:return It+e+yn+At(e,"shrink","negative")+e;case 5292:return It+e+yn+At(e,"basis","preferred-size")+e;case 6060:return It+"box-"+At(e,"-grow","")+It+e+yn+At(e,"grow","positive")+e;case 4554:return It+At(e,/([^-])(transform)/g,"$1"+It+"$2")+e;case 6187:return At(At(At(e,/(zoom-|grab)/,It+"$1"),/(image-set)/,It+"$1"),e,"")+e;case 5495:case 3959:return At(e,/(image-set\([^]*)/,It+"$1$`$1");case 4968:return At(At(e,/(.+:)(flex-)?(.*)/,It+"box-pack:$3"+yn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+It+e+e;case 4095:case 3583:case 4068:case 2532:return At(e,/(.+)-inline(.+)/,It+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(eu(e)-1-t>6)switch(Gr(e,t+1)){case 109:if(Gr(e,t+4)!==45)break;case 102:return At(e,/(.+:)(.+)-([^]+)/,"$1"+It+"$2-$3$1"+sa+(Gr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tu(e,"stretch")?Ph(At(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gr(e,t+1)!==115)break;case 6444:switch(Gr(e,eu(e)-3-(~tu(e,"!important")&&10))){case 107:return At(e,":",":"+It)+e;case 101:return At(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+It+(Gr(e,14)===45?"inline-":"")+"box$3$1"+It+"$2$3$1"+yn+"$2box$3")+e}break;case 5936:switch(Gr(e,t+11)){case 114:return It+e+yn+At(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return It+e+yn+At(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return It+e+yn+At(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return It+e+yn+e+e}return e}var sy=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case sg:e.return=Ph(e.value,e.length);break;case lg:return na([Ko(e,{value:At(e.value,"@","@"+It)})],r);case og:if(e.length)return ig(e.props,function(o){switch(ag(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return na([Ko(e,{props:[At(o,/:(read-\w+)/,":"+sa+"$1")]})],r);case"::placeholder":return na([Ko(e,{props:[At(o,/:(plac\w+)/,":"+It+"input-$1")]}),Ko(e,{props:[At(o,/:(plac\w+)/,":"+sa+"$1")]}),Ko(e,{props:[At(o,/:(plac\w+)/,yn+"input-$1")]})],r)}return""})}},uy=[sy],cy=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(p){var m=p.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||uy,o={},i,s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(p){for(var m=p.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)o[m[w]]=!0;s.push(p)});var a,l=[ay,ly];{var u,c=[tg,ng(function(p){u.insert(p)})],h=Rp(l.concat(r,c)),g=function(p){return na(vg(p),h)};a=function(p,m,w,y){u=w,g(p?p+"{"+m.styles+"}":m.styles),y&&(f.inserted[m.name]=!0)}}var f={key:t,sheet:new ny({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:a};return f.sheet.hydrate(s),f},dy=function(e){return e()},hy=d.useInsertionEffect?d.useInsertionEffect:!1,fy=hy||dy,Rs={}.hasOwnProperty,zh=d.createContext(typeof HTMLElement<"u"?cy({key:"css"}):null);zh.Provider;var py=function(e){return d.forwardRef(function(t,n){var r=d.useContext(zh);return e(t,r,n)})},gy=d.createContext({}),jl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",my=function(e,t){var n={};for(var r in t)Rs.call(t,r)&&(n[r]=t[r]);return n[jl]=e,n},vy=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ug(t,n,r),fy(function(){return cg(t,n,r)}),null},by=py(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[jl],i=[r],s="";typeof e.className=="string"?s=rg(t.registered,i,e.className):e.className!=null&&(s=e.className+" ");var a=ad(i,void 0,d.useContext(gy));s+=t.key+"-"+a.name;var l={};for(var u in e)Rs.call(e,u)&&u!=="css"&&u!==jl&&(l[u]=e[u]);return l.ref=n,l.className=s,d.createElement(d.Fragment,null,d.createElement(vy,{cache:t,serialized:a,isStringTag:typeof o=="string"}),d.createElement(o,l))}),yy=by,Le=function(e,t){var n=arguments;if(t==null||!Rs.call(t,"css"))return d.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=yy,o[1]=my(e,t);for(var i=2;i<r;i++)o[i]=n[i];return d.createElement.apply(null,o)};function Es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ad(t)}var wy=function(){var e=Es.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function xy(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Cy=Math.min,ky=Math.max,ba=Math.round,Qi=Math.floor,Gl=e=>({x:e,y:e});function Sy(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ea(){return typeof window<"u"}function Hh(e){return Fh(e)?(e.nodeName||"").toLowerCase():"#document"}function Pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lh(e){var t;return(t=(Fh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fh(e){return Ea()?e instanceof Node||e instanceof Pr(e).Node:!1}function My(e){return Ea()?e instanceof Element||e instanceof Pr(e).Element:!1}function Ts(e){return Ea()?e instanceof HTMLElement||e instanceof Pr(e).HTMLElement:!1}function kc(e){return!Ea()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pr(e).ShadowRoot}const Iy=new Set(["inline","contents"]);function Ah(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Os(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Iy.has(o)}const Ry=new Set(["html","body","#document"]);function Ey(e){return Ry.has(Hh(e))}function Os(e){return Pr(e).getComputedStyle(e)}function Ty(e){if(Hh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kc(e)&&e.host||Lh(e);return kc(t)?t.host:t}function _h(e){const t=Ty(e);return Ey(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ts(t)&&Ah(t)?t:_h(t)}function ya(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=_h(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Pr(o);if(i){const a=Ul(s);return t.concat(s,s.visualViewport||[],Ah(o)?o:[],a&&n?ya(a):[])}return t.concat(o,ya(o,[],n))}function Ul(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oy(e){const t=Os(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ts(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ba(n)!==i||ba(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ds(e){return My(e)?e:e.contextElement}function Sc(e){const t=Ds(e);if(!Ts(t))return Gl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Oy(t);let s=(i?ba(n.width):n.width)/r,a=(i?ba(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}function Mc(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),i=Ds(e);let s=Gl(1);t&&(s=Sc(e));const a=Gl(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,h=o.height/s.y;if(i){const g=Pr(i),f=r;let p=g,m=Ul(p);for(;m&&r&&f!==p;){const w=Sc(m),y=m.getBoundingClientRect(),v=Os(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*w.x,R=y.top+(m.clientTop+parseFloat(v.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,h*=w.y,l+=x,u+=R,p=Pr(m),m=Ul(p)}}return Sy({width:c,height:h,x:l,y:u})}function Vh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dy(e,t){let n=null,r;const o=Lh(e);function i(){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),i();const u=e.getBoundingClientRect(),{left:c,top:h,width:g,height:f}=u;if(a||t(),!g||!f)return;const p=Qi(h),m=Qi(o.clientWidth-(c+g)),w=Qi(o.clientHeight-(h+f)),y=Qi(c),v={rootMargin:-p+"px "+-m+"px "+-w+"px "+-y+"px",threshold:ky(0,Cy(1,l))||1};let x=!0;function R(E){const S=E[0].intersectionRatio;if(S!==l){if(!x)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!Vh(u,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(R,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,v)}n.observe(e)}return s(!0),i}function Py(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ds(e),c=o||i?[...u?ya(u):[],...ya(t)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const h=u&&a?Dy(u,n):null;let g=-1,f=null;s&&(f=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let p,m=l?Mc(e):null;l&&w();function w(){const y=Mc(e);m&&!Vh(m,y)&&n(),m=y,p=requestAnimationFrame(w)}return n(),()=>{var y;c.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(p)}}var Kl=d.useLayoutEffect,zy=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],wa=function(){};function Hy(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Ly(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&i.push("".concat(Hy(e,s)));return i.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var xa=function(e){return jy(e)?e.filter(Boolean):Qp(e)==="object"&&e!==null?[e]:[]},$h=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=ur(e,zy);return He({},t)},qt=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,s=e.className;return{css:o(t,e),className:r(n??{},i(t,e),s)}};function Ta(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Fy(e){return Ta(e)?window.innerHeight:e.clientHeight}function Bh(e){return Ta(e)?window.pageYOffset:e.scrollTop}function Ca(e,t){if(Ta(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Ay(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function _y(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function ea(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wa,o=Bh(e),i=t-o,s=10,a=0;function l(){a+=s;var u=_y(a,o,i,n);Ca(e,u),a<n?window.requestAnimationFrame(l):r(e)}l()}function Ic(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ca(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ca(e,Math.max(t.offsetTop-o,0))}function Vy(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 Rc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function $y(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Wh=!1,By={get passive(){return Wh=!0}},ta=typeof window<"u"?window:{};ta.addEventListener&&ta.removeEventListener&&(ta.addEventListener("p",wa,By),ta.removeEventListener("p",wa,!1));var Wy=Wh;function Ny(e){return e!=null}function jy(e){return Array.isArray(e)}function si(e,t,n){return e?t:n}var Gy=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter(function(i){var s=gr(i,1),a=s[0];return!n.includes(a)});return o.reduce(function(i,s){var a=gr(s,2),l=a[0],u=a[1];return i[l]=u,i},{})},Uy=["children","innerProps"],Ky=["children","innerProps"];function qy(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,s=e.isFixedPosition,a=e.controlHeight,l=Ay(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),h=c.height,g=n.getBoundingClientRect(),f=g.bottom,p=g.height,m=g.top,w=n.offsetParent.getBoundingClientRect(),y=w.top,v=s?window.innerHeight:Fy(l),x=Bh(l),R=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),S=y-E,P=v-m,M=S+x,C=h-x-m,z=f-v+x+R,T=x+m-E,I=160;switch(o){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!s)return i&&ea(l,z,I),{placement:"bottom",maxHeight:t};if(!s&&C>=r||s&&P>=r){i&&ea(l,z,I);var O=s?P-R:C-R;return{placement:"bottom",maxHeight:O}}if(o==="auto"||s){var D=t,k=s?S:M;return k>=r&&(D=Math.min(k-R-a,t)),{placement:"top",maxHeight:D}}if(o==="bottom")return i&&Ca(l,z),{placement:"bottom",maxHeight:t};break;case"top":if(S>=p)return{placement:"top",maxHeight:t};if(M>=p&&!s)return i&&ea(l,T,I),{placement:"top",maxHeight:t};if(!s&&M>=r||s&&S>=r){var J=t;return(!s&&M>=r||s&&S>=r)&&(J=s?S-E:M-E),i&&ea(l,T,I),{placement:"top",maxHeight:J}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}function Xy(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Nh=function(e){return e==="auto"?"bottom":e},Zy=function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,s=o.spacing,a=o.colors;return He((n={label:"menu"},ai(n,Xy(r),"100%"),ai(n,"position","absolute"),ai(n,"width","100%"),ai(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},jh=d.createContext(null),Yy=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,s=e.menuShouldScrollIntoView,a=e.theme,l=d.useContext(jh)||{},u=l.setPortalPlacement,c=d.useRef(null),h=d.useState(r),g=gr(h,2),f=g[0],p=g[1],m=d.useState(null),w=gr(m,2),y=w[0],v=w[1],x=a.spacing.controlHeight;return Kl(function(){var R=c.current;if(R){var E=i==="fixed",S=s&&!E,P=qy({maxHeight:r,menuEl:R,minHeight:n,placement:o,shouldScroll:S,isFixedPosition:E,controlHeight:x});p(P.maxHeight),v(P.placement),u?.(P.placement)}},[r,o,i,s,n,u,x]),t({ref:c,placerProps:He(He({},e),{},{placement:y||Nh(o),maxHeight:f})})},Jy=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Le("div",Ae({},qt(e,"menu",{menu:!0}),{ref:n},r),t)},Qy=Jy,ew=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return He({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},tw=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return Le("div",Ae({},qt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},Gh=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return He({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},nw=Gh,rw=Gh,ow=function(e){var t=e.children,n=t===void 0?"No options":t,r=e.innerProps,o=ur(e,Uy);return Le("div",Ae({},qt(He(He({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},iw=function(e){var t=e.children,n=t===void 0?"Loading...":t,r=e.innerProps,o=ur(e,Ky);return Le("div",Ae({},qt(He(He({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},aw=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},lw=function(e){var t=e.appendTo,n=e.children,r=e.controlElement,o=e.innerProps,i=e.menuPlacement,s=e.menuPosition,a=d.useRef(null),l=d.useRef(null),u=d.useState(Nh(i)),c=gr(u,2),h=c[0],g=c[1],f=d.useMemo(function(){return{setPortalPlacement:g}},[]),p=d.useState(null),m=gr(p,2),w=m[0],y=m[1],v=d.useCallback(function(){if(r){var S=Vy(r),P=s==="fixed"?0:window.pageYOffset,M=S[h]+P;(M!==w?.offset||S.left!==w?.rect.left||S.width!==w?.rect.width)&&y({offset:M,rect:S})}},[r,s,h,w?.offset,w?.rect.left,w?.rect.width]);Kl(function(){v()},[v]);var x=d.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),r&&a.current&&(l.current=Py(r,a.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);Kl(function(){x()},[x]);var R=d.useCallback(function(S){a.current=S,x()},[x]);if(!t&&s!=="fixed"||!w)return null;var E=Le("div",Ae({ref:R},qt(He(He({},e),{},{offset:w.offset,position:s,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),n);return Le(jh.Provider,{value:f},t?od.createPortal(E,t):E)},sw=function(e){var t=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},uw=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Le("div",Ae({},qt(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},cw=function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return He({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},dw=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return Le("div",Ae({},qt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)},hw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},fw=function(e){var t=e.children,n=e.innerProps;return Le("div",Ae({},qt(e,"indicatorsContainer",{indicators:!0}),n),t)},Ec,pw=["size"],gw=["innerProps","isRtl","size"],mw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Uh=function(e){var t=e.size,n=ur(e,pw);return Le("svg",Ae({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:mw},n))},Ps=function(e){return Le(Uh,Ae({size:20},e),Le("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"}))},Kh=function(e){return Le(Uh,Ae({size:20},e),Le("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"}))},qh=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return He({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:o*2,":hover":{color:n?i.neutral80:i.neutral40}})},vw=qh,bw=function(e){var t=e.children,n=e.innerProps;return Le("div",Ae({},qt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Le(Kh,null))},yw=qh,ww=function(e){var t=e.children,n=e.innerProps;return Le("div",Ae({},qt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Le(Ps,null))},xw=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return He({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},Cw=function(e){var t=e.innerProps;return Le("span",Ae({},t,qt(e,"indicatorSeparator",{"indicator-separator":!0})))},kw=wy(Ec||(Ec=xy([`
|
|
183
|
-
0%, 80%, 100% { opacity: 0; }
|
|
184
|
-
40% { opacity: 1; }
|
|
185
|
-
`]))),Sw=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,s=o.spacing.baseUnit;return He({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:s*2})},xl=function(e){var t=e.delay,n=e.offset;return Le("span",{css:Es({animation:"".concat(kw," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Mw=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=ur(e,gw);return Le("div",Ae({},qt(He(He({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Le(xl,{delay:0,offset:n}),Le(xl,{delay:160,offset:!0}),Le(xl,{delay:320,offset:!n}))},Iw=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,s=o.borderRadius,a=o.spacing;return He({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},Rw=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,s=e.menuIsOpen;return Le("div",Ae({ref:o},qt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":s}),i,{"aria-disabled":n||void 0}),t)},Ew=Rw,Tw=["data"],Ow=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},Dw=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,s=e.headingProps,a=e.innerProps,l=e.label,u=e.theme,c=e.selectProps;return Le("div",Ae({},qt(e,"group",{group:!0}),a),Le(i,Ae({},s,{selectProps:c,theme:u,getStyles:r,getClassNames:o,cx:n}),l),Le("div",null,t))},Pw=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return He({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},zw=function(e){var t=$h(e);t.data;var n=ur(t,Tw);return Le("div",Ae({},qt(e,"groupHeading",{"group-heading":!0}),n))},Hw=Dw,Lw=["innerRef","isDisabled","isHidden","inputClassName"],Fw=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,s=o.colors;return He(He({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Aw),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:s.neutral80})},Xh={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Aw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":He({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Xh)},_w=function(e){return He({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Xh)},Vw=function(e){var t=e.cx,n=e.value,r=$h(e),o=r.innerRef,i=r.isDisabled,s=r.isHidden,a=r.inputClassName,l=ur(r,Lw);return Le("div",Ae({},qt(e,"input",{"input-container":!0}),{"data-value":n||""}),Le("input",Ae({className:t({input:!0},a),ref:o,style:_w(s),disabled:i},l)))},$w=Vw,Bw=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return He({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Ww=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return He({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Nw=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,s=e.isFocused;return He({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:s?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Zh=function(e){var t=e.children,n=e.innerProps;return Le("div",n,t)},jw=Zh,Gw=Zh;function Uw(e){var t=e.children,n=e.innerProps;return Le("div",Ae({role:"button"},n),t||Le(Ps,{size:14}))}var Kw=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,s=e.removeProps,a=e.selectProps,l=n.Container,u=n.Label,c=n.Remove;return Le(l,{data:r,innerProps:He(He({},qt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:a},Le(u,{data:r,innerProps:He({},qt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),Le(c,{data:r,innerProps:He(He({},qt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:a}))},qw=Kw,Xw=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,s=i.spacing,a=i.colors;return He({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?a.primary:r?a.primary25:"transparent",color:n?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?a.primary:a.primary50}})},Zw=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,s=e.innerProps;return Le("div",Ae({},qt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},s),t)},Yw=Zw,Jw=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return He({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Qw=function(e){var t=e.children,n=e.innerProps;return Le("div",Ae({},qt(e,"placeholder",{placeholder:!0}),n),t)},ex=Qw,tx=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return He({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},nx=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Le("div",Ae({},qt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},rx=nx,zs={ClearIndicator:ww,Control:Ew,DropdownIndicator:bw,DownChevron:Kh,CrossIcon:Ps,Group:Hw,GroupHeading:zw,IndicatorsContainer:fw,IndicatorSeparator:Cw,Input:$w,LoadingIndicator:Mw,Menu:Qy,MenuList:tw,MenuPortal:lw,LoadingMessage:iw,NoOptionsMessage:ow,MultiValue:qw,MultiValueContainer:jw,MultiValueLabel:Gw,MultiValueRemove:Uw,Option:Yw,Placeholder:ex,SelectContainer:uw,SingleValue:rx,ValueContainer:dw},ox=function(e){return He(He({},zs),e.components)},Tc=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function ix(e,t){return!!(e===t||Tc(e)&&Tc(t))}function ax(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ix(e[n],t[n]))return!1;return!0}function lx(e,t){t===void 0&&(t=ax);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var s=e.apply(this,o);return n={lastResult:s,lastArgs:o,lastThis:this},s}return r.clear=function(){n=null},r}var sx={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"},ux=function(e){return Le("span",Ae({css:sx},e))},Oc=ux,cx={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.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(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" 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(e){var t=e.action,n=e.label,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", 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 i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,s=e.selectValue,a=e.isDisabled,l=e.isSelected,u=e.isAppleDevice,c=function(f,p){return f&&f.length?"".concat(f.indexOf(p)+1," of ").concat(f.length):""};if(t==="value"&&s)return"value ".concat(i," focused, ").concat(c(s,n),".");if(t==="menu"&&u){var h=a?" disabled":"",g="".concat(l?" selected":"").concat(h);return"".concat(i).concat(g,", ").concat(c(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},dx=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,s=e.selectValue,a=e.selectProps,l=e.id,u=e.isAppleDevice,c=a.ariaLiveMessages,h=a.getOptionLabel,g=a.inputValue,f=a.isMulti,p=a.isOptionDisabled,m=a.isSearchable,w=a.menuIsOpen,y=a.options,v=a.screenReaderStatus,x=a.tabSelectsValue,R=a.isLoading,E=a["aria-label"],S=a["aria-live"],P=d.useMemo(function(){return He(He({},cx),c||{})},[c]),M=d.useMemo(function(){var D="";if(t&&P.onChange){var k=t.option,J=t.options,N=t.removedValue,Z=t.removedValues,ue=t.value,te=function(oe){return Array.isArray(oe)?null:oe},X=N||k||te(ue),ge=X?h(X):"",ae=J||Z||void 0,fe=ae?ae.map(h):[],he=He({isDisabled:X&&p(X,s),label:ge,labels:fe},t);D=P.onChange(he)}return D},[t,P,p,s,h]),C=d.useMemo(function(){var D="",k=n||r,J=!!(n&&s&&s.includes(n));if(k&&P.onFocus){var N={focused:k,label:h(k),isDisabled:p(k,s),isSelected:J,options:o,context:k===n?"menu":"value",selectValue:s,isAppleDevice:u};D=P.onFocus(N)}return D},[n,r,h,p,P,o,s,u]),z=d.useMemo(function(){var D="";if(w&&y.length&&!R&&P.onFilter){var k=v({count:o.length});D=P.onFilter({inputValue:g,resultsMessage:k})}return D},[o,g,w,P,y,v,R]),T=t?.action==="initial-input-focus",I=d.useMemo(function(){var D="";if(P.guidance){var k=r?"value":w?"menu":"input";D=P.guidance({"aria-label":E,context:k,isDisabled:n&&p(n,s),isMulti:f,isSearchable:m,tabSelectsValue:x,isInitialFocus:T})}return D},[E,n,r,f,p,m,w,P,s,x,T]),O=Le(d.Fragment,null,Le("span",{id:"aria-selection"},M),Le("span",{id:"aria-focused"},C),Le("span",{id:"aria-results"},z),Le("span",{id:"aria-guidance"},I));return Le(d.Fragment,null,Le(Oc,{id:l},T&&O),Le(Oc,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!T&&O))},hx=dx,ql=[{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źẑżžẓẕƶȥɀⱬꝣ"}],fx=new RegExp("["+ql.map(function(e){return e.letters}).join("")+"]","g"),Yh={};for(var Cl=0;Cl<ql.length;Cl++)for(var kl=ql[Cl],Sl=0;Sl<kl.letters.length;Sl++)Yh[kl.letters[Sl]]=kl.base;var Jh=function(e){return e.replace(fx,function(t){return Yh[t]})},px=lx(Jh),Dc=function(e){return e.replace(/^\s+|\s+$/g,"")},gx=function(e){return"".concat(e.label," ").concat(e.value)},mx=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=He({ignoreCase:!0,ignoreAccents:!0,stringify:gx,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,s=r.stringify,a=r.trim,l=r.matchFrom,u=a?Dc(n):n,c=a?Dc(s(t)):s(t);return o&&(u=u.toLowerCase(),c=c.toLowerCase()),i&&(u=px(u),c=Jh(c)),l==="start"?c.substr(0,u.length)===u:c.indexOf(u)>-1}},vx=["innerRef"];function bx(e){var t=e.innerRef,n=ur(e,vx),r=Gy(n,"onExited","in","enter","exit","appear");return Le("input",Ae({ref:t},r,{css:Es({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 yx=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function wx(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,s=d.useRef(!1),a=d.useRef(!1),l=d.useRef(0),u=d.useRef(null),c=d.useCallback(function(w,y){if(u.current!==null){var v=u.current,x=v.scrollTop,R=v.scrollHeight,E=v.clientHeight,S=u.current,P=y>0,M=R-E-x,C=!1;M>y&&s.current&&(r&&r(w),s.current=!1),P&&a.current&&(i&&i(w),a.current=!1),P&&y>M?(n&&!s.current&&n(w),S.scrollTop=R,C=!0,s.current=!0):!P&&-y>x&&(o&&!a.current&&o(w),S.scrollTop=0,C=!0,a.current=!0),C&&yx(w)}},[n,r,o,i]),h=d.useCallback(function(w){c(w,w.deltaY)},[c]),g=d.useCallback(function(w){l.current=w.changedTouches[0].clientY},[]),f=d.useCallback(function(w){var y=l.current-w.changedTouches[0].clientY;c(w,y)},[c]),p=d.useCallback(function(w){if(w){var y=Wy?{passive:!1}:!1;w.addEventListener("wheel",h,y),w.addEventListener("touchstart",g,y),w.addEventListener("touchmove",f,y)}},[f,g,h]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",h,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",f,!1))},[f,g,h]);return d.useEffect(function(){if(t){var w=u.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){u.current=w}}var Pc=["boxSizing","height","overflow","paddingRight","position"],zc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Hc(e){e.cancelable&&e.preventDefault()}function Lc(e){e.stopPropagation()}function Fc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ac(){return"ontouchstart"in window||navigator.maxTouchPoints}var _c=!!(typeof window<"u"&&window.document&&window.document.createElement),ii=0,xo={capture:!1,passive:!1};function xx(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),s=d.useCallback(function(l){if(_c){var u=document.body,c=u&&u.style;if(r&&Pc.forEach(function(p){var m=c&&c[p];o.current[p]=m}),r&&ii<1){var h=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,f=window.innerWidth-g+h||0;Object.keys(zc).forEach(function(p){var m=zc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(f,"px"))}u&&Ac()&&(u.addEventListener("touchmove",Hc,xo),l&&(l.addEventListener("touchstart",Fc,xo),l.addEventListener("touchmove",Lc,xo))),ii+=1}},[r]),a=d.useCallback(function(l){if(_c){var u=document.body,c=u&&u.style;ii=Math.max(ii-1,0),r&&ii<1&&Pc.forEach(function(h){var g=o.current[h];c&&(c[h]=g)}),u&&Ac()&&(u.removeEventListener("touchmove",Hc,xo),l&&(l.removeEventListener("touchstart",Fc,xo),l.removeEventListener("touchmove",Lc,xo)))}},[r]);return d.useEffect(function(){if(t){var l=i.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){i.current=l}}var Cx=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},kx={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Sx(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=wx({isEnabled:o,onBottomArrive:i,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=xx({isEnabled:n}),h=function(g){u(g),c(g)};return Le(d.Fragment,null,n&&Le("div",{onClick:Cx,css:kx}),t(h))}var Mx={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Ix=function(e){var t=e.name,n=e.onFocus;return Le("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Mx,value:"",onChange:function(){}})},Rx=Ix;function Hs(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 Ex(){return Hs(/^iPhone/i)}function Qh(){return Hs(/^Mac/i)}function Tx(){return Hs(/^iPad/i)||Qh()&&navigator.maxTouchPoints>1}function Ox(){return Ex()||Tx()}function Dx(){return Qh()||Ox()}var Px=function(e){return e.label},ef=function(e){return e.label},tf=function(e){return e.value},zx=function(e){return!!e.isDisabled},Hx={clearIndicator:yw,container:sw,control:Iw,dropdownIndicator:vw,group:Ow,groupHeading:Pw,indicatorsContainer:hw,indicatorSeparator:xw,input:Fw,loadingIndicator:Sw,loadingMessage:rw,menu:Zy,menuList:ew,menuPortal:aw,multiValue:Bw,multiValueLabel:Ww,multiValueRemove:Nw,noOptionsMessage:nw,option:Xw,placeholder:Jw,singleValue:tx,valueContainer:cw},Lx={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%)"},Fx=4,nf=4,Ax=38,_x=nf*2,Vx={baseUnit:nf,controlHeight:Ax,menuGutter:_x},Ml={borderRadius:Fx,colors:Lx,spacing:Vx},$x={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rc(),captureMenuScroll:!Rc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:mx(),formatGroupLabel:Px,getOptionLabel:ef,getOptionValue:tf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:zx,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!$y(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Vc(e,t,n,r){var o=af(e,t,n),i=lf(e,t,n),s=of(e,t),a=ka(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:s,value:a,index:r}}function aa(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(s,a){return Vc(e,s,t,a)}).filter(function(s){return Bc(e,s)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Vc(e,n,t,r);return Bc(e,i)?i:void 0}).filter(Ny)}function rf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,To(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function $c(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,To(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Bx(e,t){return rf(aa(e,t))}function Bc(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,s=t.label,a=t.value;return(!uf(e)||!i)&&sf(e,{label:s,value:a,data:o},r)}function Wx(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function Nx(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Il=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},of=function(e,t){return e.getOptionLabel(t)},ka=function(e,t){return e.getOptionValue(t)};function af(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function lf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ka(e,t);return n.some(function(o){return ka(e,o)===r})}function sf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var uf=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},jx=1,Ls=(function(e){Eg(n,e);var t=Dg(n);function n(r){var o;if(Tg(this,n),o=t.call(this,r),o.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:"",isAppleDevice:!1},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(l){o.controlRef=l},o.focusedOptionRef=null,o.getFocusedOptionRef=function(l){o.focusedOptionRef=l},o.menuListRef=null,o.getMenuListRef=function(l){o.menuListRef=l},o.inputRef=null,o.getInputRef=function(l){o.inputRef=l},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(l,u){var c=o.props,h=c.onChange,g=c.name;u.name=g,o.ariaOnChange(l,u),h(l,u)},o.setValue=function(l,u,c){var h=o.props,g=h.closeMenuOnSelect,f=h.isMulti,p=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(l,{action:u,option:c})},o.selectOption=function(l){var u=o.props,c=u.blurInputOnSelect,h=u.isMulti,g=u.name,f=o.state.selectValue,p=h&&o.isOptionSelected(l,f),m=o.isOptionDisabled(l,f);if(p){var w=o.getOptionValue(l);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==w}),"deselect-option",l)}else if(!m)h?o.setValue([].concat(To(f),[l]),"select-option",l):o.setValue(l,"select-option");else{o.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&o.blurInput()},o.removeValue=function(l){var u=o.props.isMulti,c=o.state.selectValue,h=o.getOptionValue(l),g=c.filter(function(p){return o.getOptionValue(p)!==h}),f=si(u,g,g[0]||null);o.onChange(f,{action:"remove-value",removedValue:l}),o.focusInput()},o.clearValue=function(){var l=o.state.selectValue;o.onChange(si(o.props.isMulti,[],null),{action:"clear",removedValues:l})},o.popValue=function(){var l=o.props.isMulti,u=o.state.selectValue,c=u[u.length-1],h=u.slice(0,u.length-1),g=si(l,h,h[0]||null);c&&o.onChange(g,{action:"pop-value",removedValue:c})},o.getFocusedOptionId=function(l){return Il(o.state.focusableOptionsWithIds,l)},o.getFocusableOptionsWithIds=function(){return $c(aa(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return Ly.apply(void 0,[o.props.classNamePrefix].concat(u))},o.getOptionLabel=function(l){return of(o.props,l)},o.getOptionValue=function(l){return ka(o.props,l)},o.getStyles=function(l,u){var c=o.props.unstyled,h=Hx[l](u,c);h.boxSizing="border-box";var g=o.props.styles[l];return g?g(h,u):h},o.getClassNames=function(l,u){var c,h;return(c=(h=o.props.classNames)[l])===null||c===void 0?void 0:c.call(h,u)},o.getElementId=function(l){return"".concat(o.state.instancePrefix,"-").concat(l)},o.getComponents=function(){return ox(o.props)},o.buildCategorizedOptions=function(){return aa(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return rf(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(l,u){o.setState({ariaSelection:He({value:l},u)})},o.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(l){o.blockOptionHover=!1},o.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&o.onMenuClose():u&&o.openMenu("first"):(u&&(o.openAfterFocus=!0),o.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},o.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!o.props.isDisabled){var u=o.props,c=u.isMulti,h=u.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!c}),o.onMenuClose()):o.openMenu("first"),l.preventDefault()}},o.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(o.clearValue(),l.preventDefault(),o.openAfterFocus=!1,l.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(l){typeof o.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Ta(l.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(l)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(o.initialTouchX=c.clientX,o.initialTouchY=c.clientY,o.userIsDragging=!1)},o.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var h=Math.abs(c.clientX-o.initialTouchX),g=Math.abs(c.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||g>f}},o.onTouchEnd=function(l){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(l.target)&&o.menuListRef&&!o.menuListRef.contains(l.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(l){o.userIsDragging||o.onControlMouseDown(l)},o.onClearIndicatorTouchEnd=function(l){o.userIsDragging||o.onClearIndicatorMouseDown(l)},o.onDropdownIndicatorTouchEnd=function(l){o.userIsDragging||o.onDropdownIndicatorMouseDown(l)},o.handleInputChange=function(l){var u=o.props.inputValue,c=l.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(c,{action:"input-change",prevInputValue:u}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(l){o.props.onFocus&&o.props.onFocus(l),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(l){var u=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(l),o.onInputChange("",{action:"input-blur",prevInputValue:u}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(l){if(!(o.blockOptionHover||o.state.focusedOption===l)){var u=o.getFocusableOptions(),c=u.indexOf(l);o.setState({focusedOption:l,focusedOptionId:c>-1?o.getFocusedOptionId(l):null})}},o.shouldHideSelectedOptions=function(){return uf(o.props)},o.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),o.focus()},o.onKeyDown=function(l){var u=o.props,c=u.isMulti,h=u.backspaceRemovesValue,g=u.escapeClearsValue,f=u.inputValue,p=u.isClearable,m=u.isDisabled,w=u.menuIsOpen,y=u.onKeyDown,v=u.tabSelectsValue,x=u.openMenuOnFocus,R=o.state,E=R.focusedOption,S=R.focusedValue,P=R.selectValue;if(!m&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(o.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||f)return;o.focusValue("previous");break;case"ArrowRight":if(!c||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(S)o.removeValue(S);else{if(!h)return;c?o.popValue():p&&o.clearValue()}break;case"Tab":if(o.isComposing||l.shiftKey||!w||!v||!E||x&&o.isOptionSelected(E,P))return;o.selectOption(E);break;case"Enter":if(l.keyCode===229)break;if(w){if(!E||o.isComposing)return;o.selectOption(E);break}return;case"Escape":w?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):p&&g&&o.clearValue();break;case" ":if(f)return;if(!w){o.openMenu("first");break}if(!E)return;o.selectOption(E);break;case"ArrowUp":w?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":w?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!w)return;o.focusOption("pageup");break;case"PageDown":if(!w)return;o.focusOption("pagedown");break;case"Home":if(!w)return;o.focusOption("first");break;case"End":if(!w)return;o.focusOption("last");break;default:return}l.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++jx),o.state.selectValue=xa(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),s=o.buildFocusableOptions(),a=s.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=s[a],o.state.focusedOptionId=Il(i,s[a])}return o}return Og(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&&Ic(this.menuListRef,this.focusedOptionRef),Dx()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,s=o.menuIsOpen,a=this.state.isFocused;(a&&!i&&r.isDisabled||a&&s&&!r.menuIsOpen)&&this.focusInput(),a&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ic(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(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,i=this.state,s=i.selectValue,a=i.isFocused,l=this.buildFocusableOptions(),u=r==="first"?0:l.length-1;if(!this.props.isMulti){var c=l.indexOf(s[0]);c>-1&&(u=c)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[u],focusedOptionId:this.getFocusedOptionId(l[u])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=i.indexOf(s);s||(a=-1);var l=i.length-1,u=-1;if(i.length){switch(r){case"previous":a===0?u=0:a===-1?u=l:u=a-1;break;case"next":a>-1&&a<l&&(u=a+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var a=0,l=s.indexOf(i);i||(l=-1),r==="up"?a=l>0?l-1:s.length-1:r==="down"?a=(l+1)%s.length:r==="pageup"?(a=l-o,a<0&&(a=0)):r==="pagedown"?(a=l+o,a>s.length-1&&(a=s.length-1)):r==="last"&&(a=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[a])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ml):He(He({},Ml),this.props.theme):Ml})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,s=this.getClassNames,a=this.getValue,l=this.selectOption,u=this.setValue,c=this.props,h=c.isMulti,g=c.isRtl,f=c.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:s,getValue:a,hasValue:p,isMulti:h,isRtl:g,options:f,selectOption:l,selectProps:c,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return af(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return lf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return sf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{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 r=this.props,o=r.isDisabled,i=r.isSearchable,s=r.inputId,a=r.inputValue,l=r.tabIndex,u=r.form,c=r.menuIsOpen,h=r.required,g=this.getComponents(),f=g.Input,p=this.state,m=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,v=s||this.getElementId("input"),x=He(He(He({"aria-autocomplete":"list","aria-expanded":c,"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":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},c&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,Ae({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:u,type:"text",value:a},x)):d.createElement(bx,Ae({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:wa,onFocus:this.onInputFocus,disabled:o,tabIndex:l,inputMode:"none",form:u,value:""},x))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,s=o.MultiValueContainer,a=o.MultiValueLabel,l=o.MultiValueRemove,u=o.SingleValue,c=o.Placeholder,h=this.commonProps,g=this.props,f=g.controlShouldRenderValue,p=g.isDisabled,m=g.isMulti,w=g.inputValue,y=g.placeholder,v=this.state,x=v.selectValue,R=v.focusedValue,E=v.isFocused;if(!this.hasValue()||!f)return w?null:d.createElement(c,Ae({},h,{key:"placeholder",isDisabled:p,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return x.map(function(P,M){var C=P===R,z="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return d.createElement(i,Ae({},h,{components:{Container:s,Label:a,Remove:l},isFocused:C,isDisabled:p,key:z,index:M,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(T){T.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(w)return null;var S=x[0];return d.createElement(u,Ae({},h,{data:S,isDisabled:p}),this.formatOptionLabel(S,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,s=this.props,a=s.isDisabled,l=s.isLoading,u=this.state.isFocused;if(!this.isClearable()||!o||a||!this.hasValue()||l)return null;var c={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:c,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,s=this.props,a=s.isDisabled,l=s.isLoading,u=this.state.isFocused;if(!o||!l)return null;var c={"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:c,isDisabled:a,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return d.createElement(i,Ae({},s,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,s=this.props.isDisabled,a=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:l,isDisabled:s,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,s=o.GroupHeading,a=o.Menu,l=o.MenuList,u=o.MenuPortal,c=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,f=this.commonProps,p=this.state.focusedOption,m=this.props,w=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,x=m.loadingMessage,R=m.minMenuHeight,E=m.maxMenuHeight,S=m.menuIsOpen,P=m.menuPlacement,M=m.menuPosition,C=m.menuPortalTarget,z=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,I=m.noOptionsMessage,O=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!S)return null;var k=function(X,ge){var ae=X.type,fe=X.data,he=X.isDisabled,oe=X.isSelected,_=X.label,H=X.value,G=p===fe,re=he?void 0:function(){return r.onOptionHover(fe)},le=he?void 0:function(){return r.selectOption(fe)},Ee="".concat(r.getElementId("option"),"-").concat(ge),we={id:Ee,onClick:le,onMouseMove:re,onMouseOver:re,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:oe};return d.createElement(g,Ae({},f,{innerProps:we,data:fe,isDisabled:he,isSelected:oe,key:Ee,label:_,type:ae,value:H,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(X.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(X){if(X.type==="group"){var ge=X.data,ae=X.options,fe=X.index,he="".concat(r.getElementId("group"),"-").concat(fe),oe="".concat(he,"-heading");return d.createElement(i,Ae({},f,{key:he,data:ge,options:ae,Heading:s,headingProps:{id:oe,data:X.data},label:r.formatGroupLabel(X.data)}),X.options.map(function(_){return k(_,"".concat(fe,"-").concat(_.index))}))}else if(X.type==="option")return k(X,"".concat(X.index))});else if(v){var N=x({inputValue:y});if(N===null)return null;J=d.createElement(c,f,N)}else{var Z=I({inputValue:y});if(Z===null)return null;J=d.createElement(h,f,Z)}var ue={minMenuHeight:R,maxMenuHeight:E,menuPlacement:P,menuPosition:M,menuShouldScrollIntoView:T},te=d.createElement(Yy,Ae({},f,ue),function(X){var ge=X.ref,ae=X.placerProps,fe=ae.placement,he=ae.maxHeight;return d.createElement(a,Ae({},f,ue,{innerRef:ge,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:fe}),d.createElement(Sx,{captureEnabled:w,onTopArrive:O,onBottomArrive:D,lockEnabled:z},function(oe){return d.createElement(l,Ae({},f,{innerRef:function(_){r.getMenuListRef(_),oe(_)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:he,focusedOption:p}),J)}))});return C||M==="fixed"?d.createElement(u,Ae({},f,{appendTo:C,controlElement:this.controlRef,menuPlacement:P,menuPosition:M}),te):te}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,s=o.isDisabled,a=o.isMulti,l=o.name,u=o.required,c=this.state.selectValue;if(u&&!this.hasValue()&&!s)return d.createElement(Rx,{name:l,onFocus:this.onValueInputFocus});if(!(!l||s))if(a)if(i){var h=c.map(function(p){return r.getOptionValue(p)}).join(i);return d.createElement("input",{name:l,type:"hidden",value:h})}else{var g=c.length>0?c.map(function(p,m){return d.createElement("input",{key:"i-".concat(m),name:l,type:"hidden",value:r.getOptionValue(p)})}):d.createElement("input",{name:l,type:"hidden",value:""});return d.createElement("div",null,g)}else{var f=c[0]?this.getOptionValue(c[0]):"";return d.createElement("input",{name:l,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,s=o.focusedOption,a=o.focusedValue,l=o.isFocused,u=o.selectValue,c=this.getFocusableOptions();return d.createElement(hx,Ae({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:s,focusedValue:a,isFocused:l,selectValue:u,focusableOptions:c,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,s=r.SelectContainer,a=r.ValueContainer,l=this.props,u=l.className,c=l.id,h=l.isDisabled,g=l.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(s,Ae({},p,{className:u,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,Ae({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:g}),d.createElement(a,Ae({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Ae({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,s=o.clearFocusValueOnUpdate,a=o.inputIsHiddenAfterUpdate,l=o.ariaSelection,u=o.isFocused,c=o.prevWasFocused,h=o.instancePrefix,g=r.options,f=r.value,p=r.menuIsOpen,m=r.inputValue,w=r.isMulti,y=xa(f),v={};if(i&&(f!==i.value||g!==i.options||p!==i.menuIsOpen||m!==i.inputValue)){var x=p?Bx(r,y):[],R=p?$c(aa(r,y),"".concat(h,"-option")):[],E=s?Wx(o,y):null,S=Nx(o,x),P=Il(R,S);v={selectValue:y,focusedOption:S,focusedOptionId:P,focusableOptionsWithIds:R,focusedValue:E,clearFocusValueOnUpdate:!1}}var M=a!=null&&r!==i?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},C=l,z=u&&c;return u&&!z&&(C={value:si(w,y,y[0]||null),options:y,action:"initial-input-focus"},z=!c),l?.action==="initial-input-focus"&&(C=null),He(He(He({},v),M),{},{prevProps:r,ariaSelection:C,prevWasFocused:z})}}]),n})(d.Component);Ls.defaultProps=$x;var Gx=d.forwardRef(function(e,t){var n=Dh(e);return d.createElement(Ls,Ae({ref:t},n))}),cf=Gx;const Ux=e=>{const{Menu:t}=zs,{children:n,...r}=e;return d.createElement(t,{...r},n)},Kx=hn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),qx=hn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Xx=hn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Zx=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:s}=t.data,[a,l]=d.useState(s),[u,c]=d.useState(r??""),h=Kd(),g=d.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:f?.toString()??""}:f),[i]);return t.readonly?d.createElement(Xx,null,d.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):d.createElement(Kx,null,d.createElement(cf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:p?"pointer":void 0,paddingLeft:h.cellHorizontalPadding,paddingRight:h.cellHorizontalPadding,":active":{...f[":active"],color:h.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:h.bgCell,neutral5:h.bgCell,neutral10:h.bgCell,neutral20:h.bgCellMedium,neutral30:h.bgCellMedium,neutral40:h.bgCellMedium,neutral50:h.textLight,neutral60:h.textMedium,neutral70:h.textMedium,neutral80:h.textDark,neutral90:h.textDark,neutral100:h.textDark,primary:h.accentColor,primary75:h.accentColor,primary50:h.accentColor,primary25:h.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>d.createElement(qx,null,d.createElement(Ux,{className:"click-outside-ignore",...f}))},options:g,onChange:async f=>{f!==null&&(l(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},Yx={kind:Y.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===i:l.value===i),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,o.x+r.cellHorizontalPadding,o.y+o.height/2+nr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Zx,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 Jx(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const o=parseFloat(r[1]),i=r[2],s=o*t;return e.replace(n,`${Number(s.toPrecision(3))}${i}`)}return e}const Qx={marginRight:8},eC={display:"flex",alignItems:"center",flexGrow:1},tC={kind:Y.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:s,value:a,label:l,measureLabel:u}=t.data,c=o.x+r.cellHorizontalPadding,h=o.y+o.height/2,g=s-i,f=(a-i)/g,p=`${Jx(r.baseFontStyle,.9)} ${r.fontFamily}`,m=as(n,p)/2;n.save();let w=0;l!==void 0&&(n.font=p,w=zr(u??l,n,p).width+r.cellHorizontalPadding);const y=o.width-r.cellHorizontalPadding*2-w;if(y>=m){const v=n.createLinearGradient(c,h,c+y,h);v.addColorStop(0,r.accentColor),v.addColorStop(f,r.accentColor),v.addColorStop(f,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,wc(n,c,h-m/2,y,m,m/2),n.fill(),n.beginPath(),wc(n,c+.5,h-m/2+.5,y-1,m-1,(m-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,o.x+o.width-r.cellHorizontalPadding,h+nr(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return d.createElement("label",{style:eC},d.createElement("input",{style:Qx,type:"range",value:r,min:o,max:i,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}}},nC=hn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Rl=(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}`)}},rC=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?Rl(n,t.min,i):t.min,a=t.max instanceof Date?Rl(n,t.max,i):t.max,l=Rl(n,t.date,i);return e.value.readonly?Rt.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Rt.createElement(nC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:o,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-i)}})}})},oC={kind:Y.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return is(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:rC}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var iC=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Wc=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),i=String(n.getOptionLabel(t)).toLowerCase();return o===r||i===r},El={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return Wc(e,o,r)})||n.some(function(o){return Wc(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function aC(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,s=i===void 0?El.formatCreateLabel:i,a=e.isValidNewOption,l=a===void 0?El.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?El.getNewOptionData:u,h=e.onCreateOption,g=e.options,f=g===void 0?[]:g,p=e.onChange,m=ur(e,iC),w=m.getOptionValue,y=w===void 0?tf:w,v=m.getOptionLabel,x=v===void 0?ef:v,R=m.inputValue,E=m.isLoading,S=m.isMulti,P=m.value,M=m.name,C=d.useMemo(function(){return l(R,xa(P),f,{getOptionValue:y,getOptionLabel:x})?c(R,s(R)):void 0},[s,c,x,y,R,l,f,P]),z=d.useMemo(function(){return(n||!E)&&C?o==="first"?[C].concat(To(f)):[].concat(To(f),[C]):f},[n,o,E,C,f]),T=d.useCallback(function(I,O){if(O.action!=="select-option")return p(I,O);var D=Array.isArray(I)?I:[I];if(D[D.length-1]===C){if(h)h(R);else{var k=c(R,R),J={action:"create-option",name:M,option:k};p(si(S,[].concat(To(xa(P)),[k]),k),J)}return}p(I,O)},[c,R,S,M,C,h,p,P]);return He(He({},m),{},{options:z,onChange:T})}var lC=d.forwardRef(function(e,t){var n=Dh(e),r=aC(n);return d.createElement(Ls,Ae({ref:t},r))}),sC=lC;const Fs="__value",uC=new RegExp(`^${Fs}\\d+__`),cC=hn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),dC=hn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),la=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),df=(e,t,n)=>e==null?[]:e.map((r,o)=>{const i=n?`${Fs}${o}__`:"",s=t.find(a=>a.value===r);return s?{...s,value:`${i}${s.value}`}:{value:`${i}${r}`,label:r}}),hC=e=>{const{Menu:t}=zs,{children:n,...r}=e;return d.createElement(t,{...r},n)},fC=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o,portalElementRef:i}=e,{options:s,values:a,allowCreation:l,allowDuplicates:u}=t.data,c=Kd(),[h,g]=d.useState(a),[f,p]=d.useState(!0),[m,w]=d.useState(n??""),y=d.useMemo(()=>la(s??[]),[s]),v=l&&u&&y.length===0,x=d.useCallback(M=>{f&&M.stopPropagation()},[f]),R={control:(M,C)=>({...M,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:C.isDisabled?"auto":M.pointerEvents,cursor:C.isDisabled?"default":M.cursor}),valueContainer:M=>({...M,flexWrap:M.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:M=>({...M,backgroundColor:c.bgCell}),option:(M,C)=>({...M,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...C.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...M[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(M,{isDisabled:C})=>C?{display:"none"}:{...M,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:M=>({...M,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:M=>({...M,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:M=>({...M,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(M,{data:C})=>({...M,backgroundColor:C.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(M,{data:C,isDisabled:z})=>({...M,paddingRight:z?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:C.color?Hl(C.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(M,{data:C,isDisabled:z,isFocused:T})=>z?{display:"none"}:{...M,color:C.color?Hl(C.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:T?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},E=d.useCallback(M=>{const C=M.map(z=>u&&z.startsWith(Fs)?z.replace(new RegExp(uC),""):z);g(C),r({...t,data:{...t.data,values:C}})},[t,r,u]),S=M=>{switch(M.key){case"Enter":case"Tab":if(!m){o(t,[0,1]);return}u&&l&&(w(""),E([...h??[],m]),p(!1),M.preventDefault())}},P=l?sC:cf;return d.createElement(cC,{onKeyDown:x,"data-testid":"multi-select-cell"},d.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:y,placeholder:t.readonly?"":l?"Add...":void 0,noOptionsMessage:M=>l&&u&&M.inputValue?`Create "${M.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:f,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:df(h,y,u),onKeyDown:t.readonly?void 0:S,menuPlacement:"auto",menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:R,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:M=>v?null:d.createElement(dC,null,d.createElement(hC,{className:"click-outside-ignore",...M}))},onChange:async M=>{M!==null&&E(M.map(C=>C.value))}}))},pC={kind:Y.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o,highlighted:i}=e,{values:s,options:a}=t.data;if(s==null)return!0;const l=la(a??[]),u={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:h}=u,g=1,f=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of s){const m=l.find(R=>R.value===p),w=m?.color??(i?r.bgBubbleSelected:r.bgBubble),y=m?.label??p,v=zr(y,n).width+r.bubblePadding*2,x=r.bubbleHeight/2;if(h!==u.x&&h+v>u.x+u.width&&g<c&&(g++,f+=r.bubbleHeight+r.bubblePadding,h=u.x),n.fillStyle=w,n.beginPath(),er(n,h,f,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Hl(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(y,h+r.bubblePadding,f+x+nr(n,r)),h+=v+r.bubbleMargin,h>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=df(r,la(o??[]),t.data.allowDuplicates).map(a=>a.label??a.value),s=i.reduce((a,l)=>e.measureText(l).width+a+n.bubblePadding*2+n.bubbleMargin,0);return i.length===0?n.cellHorizontalPadding*2:s+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:fC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=la(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},gC="None";function Nc(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 mC=e=>{const{cell:t,theme:n,ctx:r}=e;is({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},gC,t.contentAlign),r.fillStyle=n.textDark};function vC(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:s,ctx:a,rect:l}=r,u=r.col;if(Oo(i))Nc(a,l,s);else if(fs(i)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?o():mC(r),c.isRequired&&c.isEditable&&Nc(a,l,s);return}o()},[e]),n=d.useMemo(()=>[J1,Yx,tC,oC,pC,...S1],[]);return{drawCell:t,customRenderers:n}}function bC(){const e=Jr();return d.useMemo(()=>{const t={editable:n=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${n.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:Co(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Co(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Co(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Co(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(an("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Co(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(an(e.spacing.sm)),cellVerticalPadding:Math.round(an("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Tp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(an("1.25rem")),bubblePadding:Math.round(an(e.spacing.sm)),bubbleMargin:Math.round(an(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(an(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(an("25rem")),minColumnWidth:Math.round(an("3.125rem")),maxColumnWidth:Math.round(an("62.5rem")),maxColumnAutoWidth:Math.round(an("31.25rem")),defaultRowHeight:Math.round(an("2.1875rem")),defaultHeaderHeight:Math.round(an("2.1875rem")),bgRowHovered:Ep(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const yC=Zl.getLogger("useDataEditor");function wC(e,t,n,r,o,i,s,a,l){const u=d.useCallback(([m,w],y)=>{const v=e[m];if(!v.isEditable)return;const x=v.indexNumber,R=n.current.getOriginalRowIndex(o(w)),E=r([m,w]),S=v.getCellValue(E),P=v.getCellValue(y);if(!Oo(E)&&P===S)return;const M=v.getCell(P,!0);Oo(M)?yC.warn(`Not applying the cell edit since it causes this error:
|
|
186
|
-
${M.data}`):(n.current.setCell(x,R,{...M,lastUpdated:performance.now()}),a())},[e,n,o,r,a]),c=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),s()},[e,n,t,s]),h=d.useCallback(()=>{t||(c(),a())},[c,a,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(w),s(),l(),a(),!1}if(m.current?.range){const w=[],y=m.current.range;for(let v=y.y;v<y.y+y.height;v++)for(let x=y.x;x<y.x+y.width;x++){const R=e[x];R.isEditable&&!R.isRequired&&(w.push({cell:[x,v]}),u([x,v],R.getCell(null)))}return w.length>0&&(a(),i(w)),!1}return!0},[e,n,t,i,o,a,u,l,s]),f=d.useCallback((m,w)=>{const[y,v]=m,x=[];for(let R=0;R<w.length;R++){const E=w[R];if(R+v>=n.current.getNumRows()){if(t)break;c()}for(let S=0;S<E.length;S++){const P=E[S],M=R+v,C=S+y;if(C>=e.length)break;const z=e[C];if(z.isEditable){const T=z.getCell(P,!0);if(lt(T)&&!Oo(T)){const I=z.indexNumber,O=n.current.getOriginalRowIndex(o(M)),D=z.getCellValue(r([C,M]));z.getCellValue(T)!==D&&(n.current.setCell(I,O,{...T,lastUpdated:performance.now()}),x.push({cell:[C,M]}))}}}x.length>0&&(a(),i(x))}return!1},[e,n,t,o,r,c,a,i]),p=d.useCallback((m,w)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const x=v.validateInput(v.getCellValue(w));return x===!0||x===!1?x:v.getCell(x)}return!0},[e]);return{onCellEdited:u,onPaste:f,onRowAppended:h,onDelete:g,validateCell:p}}const hf=",",ui='"',xC='"',ff=`
|
|
187
|
-
`,CC="\uFEFF",kC=new RegExp(`[${[hf,ui,ff].join("")}]`),jc=Zl.getLogger("useDataExporter");function Gc(e){return e.map(t=>SC(t)).join(hf)+ff}function SC(e){if(Oe(e))return"";const t=st(e);return kC.test(t)?`${ui}${t.replace(new RegExp(ui,"g"),xC+ui)}${ui}`:t}async function Uc(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(CC));const i=n.map(s=>s.name);await e.write(o.encode(Gc(i)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(o.encode(Gc(a)))}await e.close()}function MC(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await Xl(()=>import("./es6--XPcqeHG-B7r8Rb2B.js"),__vite__mapDeps([14,1,2])).then(s=>s.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Uc(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{jc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let s="";const a=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Uc(a.getWriter(),e,t,n);const l=new Blob([s],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(l),c=Ig({enforceDownloadInNewTab:r,url:u,filename:o});c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(u)}catch(s){jc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function IC(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Tt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Tt("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[o],a=s.indexNumber,l=r.current.getOriginalRowIndex(i),u=r.current.isAddedRow(l);if(s.isEditable||u){const g=r.current.getCell(a,l);if(lt(g))return{...s.getCell(s.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(u)return Tt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${a}; row=${l}`)}const c=e.getCell(l,a),h=Op(e,l,a);return H1(s,c,h,e.styler?.cssStyles)}catch(s){return Tt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
188
|
-
Error: ${s}`)}},[t,n,e,r])}}function RC(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,i]=o.location;n(i)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function EC(e,t,n,r,o){const[i,s]=d.useState({columns:et.empty(),rows:et.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(ln.SelectionMode.MULTI_ROW)||e.selectionMode.includes(ln.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(ln.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(ln.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(ln.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(ln.SelectionMode.MULTI_COLUMN),h=!t&&!n&&(e.selectionMode.includes(ln.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(ln.SelectionMode.MULTI_CELL)),g=h&&e.selectionMode.includes(ln.SelectionMode.MULTI_CELL),f=i.rows.length>0,p=i.columns.length>0,m=i.current!==void 0,w=d.useCallback(v=>{const x=!Za(v.rows.toArray(),i.rows.toArray()),R=!Za(v.columns.toArray(),i.columns.toArray()),E=!Za(v.current,i.current),S=a&&x||u&&R||h&&E;let P=v;if(R&&P.columns.length>=0){let M=P.columns;r.forEach((C,z)=>{C.isIndex&&(M=M.remove(z))}),M.length<P.columns.length&&(P={...P,columns:M})}s(P),S&&o(P,h)},[i,a,u,h,o,r]),y=d.useCallback((v=!1,x=!1)=>{const R={columns:x?i.columns:et.empty(),rows:v?i.rows:et.empty(),current:void 0};s(R),(!v&&a||!x&&u||h)&&o(R,h)},[i,a,u,h,o]);return{gridSelection:i,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:h,isMultiCellSelectionActivated:g,isRowSelected:f,isColumnSelected:p,isCellSelected:m,clearSelection:y,processSelectionChange:w}}function TC(e,t,n,r,o,i,s,a,l){const u=e.rowHeight??t.defaultRowHeight,c=t.defaultHeaderHeight+u+2*t.tableBorderWidth,h=r?2:1,g=e.editingMode===ln.EditingMode.DYNAMIC?1:0,f=n+g;let p=Math.max(f*u+h*t.defaultHeaderHeight+2*t.tableBorderWidth,c),m=Math.min(p,t.defaultTableHeight);const w=F1(e,l);w&&(m=Math.max(w,c),p=Math.max(w,p)),i&&(m=Math.min(m,i),p=Math.min(p,i),w||(m=p));const y=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(o,y);let x,R=v;const E=Eh(e,a),S=Th(e,a),P=L1(a);E?x=v:S?(x=Math.min(Math.max(S,y),v),R=Math.min(Math.max(S,R),v)):P&&(x=void 0);const[M,C]=d.useState({width:x||"100%",height:m});return d.useLayoutEffect(()=>{E&&M.width==="100%"&&C(z=>({...z,width:v}))},[v]),d.useLayoutEffect(()=>{C(z=>({...z,width:x||"100%"}))},[x]),d.useLayoutEffect(()=>{C(z=>({...z,height:m}))},[m,n]),d.useLayoutEffect(()=>{if(s){const z=E||lt(S)&&S>0;C({width:z?R:"100%",height:p})}else C({width:x||"100%",height:m})},[s]),{minHeight:c,maxHeight:p,minWidth:y,maxWidth:R,rowHeight:u,resizableSize:M,setResizableSize:C}}const OC=600,DC="⚠️ Please fill out this cell.";function PC(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),s=d.useCallback(l=>{if(clearTimeout(i.current),i.current=0,o(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let h;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&<(g))h=g.help;else if(l.kind==="cell"){const f=t([u,c]);Oo(f)?h=f.errorDetails:g.isRequired&&g.isEditable&&fs(f)?h=DC:l1(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},OC))}},[e,t,o,i,n]),a=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}const pf=tr("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Er=tr("div",{target:"e1hnsd046"})(({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}}}),""),gf=tr("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),zC=tr("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),HC=tr("div",{target:"e1hnsd043"})(({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"}),""),LC=tr("div",{target:"e1hnsd042"})(({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"}),""),FC=tr("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),AC=tr("button",{target:"e1hnsd040"})(({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}}),""),Kc=[{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:"}],_C={number:Kc,progress:Kc,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 VC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:s}){const a=Jr(),{colors:l,fontSizes:u,radii:c,fontWeights:h}=a,g=_C[e]||[];return g.length===0?me.jsx(me.Fragment,{}):me.jsx(Sa,{triggerType:nd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:me.jsx(pf,{role:"menu",children:g.map(f=>me.jsxs(Er,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Ma.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:Ia(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const $C=d.memo(VC);function BC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const h=Jr(),[g,f]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:y}=h,{isCopied:v,copyToClipboard:x}=pp();d.useEffect(()=>{function S(P){P.preventDefault()}return document.addEventListener("wheel",S,{passive:!1}),document.addEventListener("touchmove",S,{passive:!1}),()=>{document.removeEventListener("wheel",S),document.removeEventListener("touchmove",S)}},[]);const R=d.useCallback(()=>{i()},[i]),E=d.useCallback(()=>{x(l.title)},[l.title,x]);return me.jsx(Sa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:me.jsxs(pf,{children:[me.jsxs(zC,{children:[me.jsx(HC,{title:l.kind,children:me.jsx(Yn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),me.jsxs(LC,{title:l.title,children:[me.jsx(FC,{children:l.title}),me.jsx(AC,{onClick:E,title:"Copy column name","aria-label":"Copy column name",children:me.jsx(Yn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&me.jsxs(me.Fragment,{children:[me.jsxs(Er,{onClick:()=>{s("asc"),R()},role:"menuitem",children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),me.jsxs(Er,{onClick:()=>{s("desc"),R()},role:"menuitem",children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),me.jsx(gf,{})]}),u&&me.jsx($C,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:u,onCloseMenu:R,children:me.jsxs(Er,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:g,hasSubmenu:!0,children:[me.jsxs("div",{children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&me.jsxs(Er,{onClick:()=>{c(),R()},children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&me.jsxs(Er,{onClick:()=>{o(),R()},children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&me.jsxs(Er,{onClick:()=>{r(),R()},children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&me.jsxs(Er,{onClick:()=>{a(),R()},children:[me.jsx(Yn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Ma.bottomRight,accessibilityType:rd.menu,showArrow:!1,popoverMargin:an("0.375rem"),onClickOutside:g?void 0:R,onEsc:R,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${h.sizes.borderWidth} solid ${h.colors.borderColor}`,backgroundColor:Ia(h)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:me.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const WC=d.memo(BC),NC="(index)";function Tl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const qc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Jr();return me.jsx(kg,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:Mg.default,labelPlacement:Sg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:o.spacing.none,marginTop:o.spacing.none,paddingLeft:o.spacing.md,paddingRight:o.spacing.md,paddingTop:o.spacing.twoXS,paddingBottom:o.spacing.twoXS,backgroundColor:i?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:s,$isIndeterminate:a})=>{const l=s||a?o.colors.primary:o.colors.fadedText40;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&(s||a)?`0 0 0 0.2rem ${Co(o.colors.primary,.5)}`:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:o.colors.bodyText,fontSize:o.fontSizes.sm,fontWeight:o.fontWeights.normal}}},children:e})},jC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:s,onClose:a})=>{const l=Jr(),u=f=>!(f.isHidden===!0||Tl(f,t)),c=e.every(u),h=e.some(u)&&!c,g=f=>{e.forEach(p=>{const m=Tl(p,t);f?(o(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return me.jsx(Sa,{triggerType:nd.click,placement:Ma.bottomRight,autoFocus:!0,focusLock:!0,content:()=>me.jsxs("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto"},children:[me.jsx(qc,{label:"Select all",isIndeterminate:h,initialValue:c,onChange:f=>{g(f)}}),me.jsx(gf,{}),me.jsx("div",{children:e.map(f=>{const p=Tl(f,t);return me.jsx(qc,{label:!f.title&&f.isIndex?NC:f.title,initialValue:!(f.isHidden===!0||p),onChange:m=>{m?(o(f.id),p&&n(w=>[...w,f.id])):r(f.id)}},f.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:Ia(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:me.jsx("div",{children:i})})},GC=d.memo(jC),Xc=tr("div",{target:"e1w7nams0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}),"");function UC({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),s=Jr(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,h=d.useCallback(()=>{i(!1),r()},[r,i]);return me.jsx(Sa,{content:me.jsx(gp,{"data-testid":"stDataFrameTooltipContent",children:me.jsx(mp,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:Ma.top,accessibilityType:rd.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,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:Ia(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:o,children:me.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const KC=d.memo(UC),Zc=150,qC=15e4,XC="0.5rem";function ZC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:s,widthConfig:a,heightConfig:l}){const{expanded:u,expand:c,collapse:h,width:g,height:f}=Js(yg),{isInHorizontalLayout:p}=Js(vp),m=d.useRef(null),w=d.useRef(null),y=d.useRef(null),v=bp(),x=bC(),{getRowThemeOverride:R,onItemHovered:E}=RC(x),{libConfig:{enforceDownloadInNewTab:S=!1}}=d.useContext(yp),[P,M]=d.useState(!0),[C,z]=d.useState(!1),[T,I]=d.useState(!1),[O,D]=d.useState(!1),[k,J]=d.useState(),[N,Z]=d.useState(!1),ue=d.useCallback(()=>Z(xe=>!xe),[]),te=d.useCallback(()=>Z(!1),[]),X=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Oe(e.editingMode)&&(e.editingMode=ln.EditingMode.READ_ONLY);const{READ_ONLY:ge,DYNAMIC:ae}=ln.EditingMode,fe=t.dimensions,he=Math.max(0,fe.numDataRows),oe=he===0&&!(e.editingMode===ae&&fe.numDataColumns>0),_=he>qC,H=!_&&!oe&&e.editingMode!==ae,G=!oe&&e.editingMode===ae&&!n,re=d.useRef(new Ji(he)),[le,Ee]=d.useState(re.current.getNumRows());d.useEffect(()=>{re.current=new Ji(he),Ee(re.current.getNumRows())},[he]);const we=d.useCallback(()=>{re.current=new Ji(he),Ee(re.current.getNumRows())},[he]),[ut,Se]=d.useState(e.columnOrder);d.useEffect(()=>{Se(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:mt,allColumns:wt,setColumnConfigMapping:je}=V1(e,t,n,ut,a);d.useEffect(()=>{if(e.editingMode===ge||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});xe&&(re.current.fromJson(xe,mt),Ee(re.current.getNumRows()))},[]);const{getCellContent:ne}=IC(t,mt,le,re),{columns:ie,sortColumn:ye,getOriginalIndex:ce,getCellContent:ve}=X1(he,mt,ne),Ve=d.useCallback((xe,Lt)=>{if(!r)return;const Xt={selection:{rows:[],columns:[],cells:[]}};if(Xt.selection.rows=xe.rows.toArray().map(Ut=>ce(Ut)),Xt.selection.columns=xe.columns.toArray().map(Ut=>Xr(ie[Ut])),Lt&&xe.current){const{cell:Ut,range:Kt}=xe.current;if(Kt)for(let Ln=Kt.y;Ln<Kt.y+Kt.height;Ln++)for(let Fn=Kt.x;Fn<Kt.x+Kt.width;Fn++)ie[Fn].isIndex||Xt.selection.cells.push([ce(Ln),Xr(ie[Fn])]);else if(Ut){const[Ln,Fn]=Ut;ie[Ln].isIndex||Xt.selection.cells.push([ce(Fn),Xr(ie[Ln])])}}const Wn=JSON.stringify(Xt),Zt=r.getStringValue({id:e.id,formId:e.formId});(Zt===void 0||Zt!==Wn)&&r.setStringValue({id:e.id,formId:e.formId},Wn,{fromUi:!0},i)},[ie,e.id,e.formId,r,i,ce]),{debouncedCallback:$e}=lc(Ve,Zc),{gridSelection:tt,isRowSelectionActivated:Me,isMultiRowSelectionActivated:Qe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Ie,isCellSelectionActivated:De,isMultiCellSelectionActivated:ft,isRowSelected:nt,isColumnSelected:Xe,isCellSelected:kt,clearSelection:bt,processSelectionChange:Dt}=EC(e,oe,n,ie,$e);d.useEffect(()=>{De||bt(!0,!0)},[u]);const Pt=d.useCallback(xe=>{w.current?.updateCells(xe)},[]);d.useEffect(()=>{if(!Me&&!Te&&!De||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});if(xe){const Lt=ie.map(Kt=>Xr(Kt)),Xt=JSON.parse(xe);let Wn=et.empty(),Zt=et.empty(),Ut;if(Xt.selection?.rows?.forEach(Kt=>{Wn=Wn.add(Kt)}),Xt.selection?.columns?.forEach(Kt=>{Zt=Zt.add(Lt.indexOf(Kt))}),De&&!ft){const[Kt,Ln]=Xt.selection?.cells?.[0]??[];Kt!==void 0&&Ln!==void 0&&(Ut=[Lt.indexOf(Ln),Kt])}if(Wn.length>0||Zt.length>0||Ut!==void 0){const Kt={rows:Wn,columns:Zt,current:Ut?{cell:Ut,range:{x:Ut[0],y:Ut[1],width:1,height:1},rangeStack:[]}:void 0};Dt(Kt)}}},[]);const sn=d.useCallback(()=>{le!==re.current.getNumRows()&&Ee(re.current.getNumRows())},[le]),Yt=d.useCallback(()=>{if(!r)return;const xe=re.current.toJson(ie);let Lt=r.getStringValue({id:e.id,formId:e.formId});Lt===void 0&&(Lt=new Ji(0).toJson([])),xe!==Lt&&r.setStringValue({id:e.id,formId:e.formId},xe,{fromUi:!0},i)},[ie,e.id,e.formId,r,i]),{debouncedCallback:On}=lc(Yt,Zc),{exportToCsv:Et}=MC(ve,ie,le,S),{onCellEdited:pt,onPaste:Dn,onRowAppended:yt,onDelete:Jt,validateCell:Mn}=wC(ie,e.editingMode!==ae,re,ve,ce,Pt,sn,On,bt),Pe=d.useMemo(()=>oe?[0]:G?[le]:[],[oe,G,le]),{tooltip:rt,clearTooltip:xt,onItemHovered:Pn}=PC(ie,ve,Pe),{drawCell:un,customRenderers:cn}=vC(ie),{provideEditor:zn}=Y1(),Qt=d.useCallback(xe=>({...xe,hasMenu:!oe}),[oe]),en=d.useMemo(()=>ie.map(xe=>Qt(Nl(xe))),[ie,Qt]),{columns:We,onColumnResize:St}=N1(en),Hn=t.dimensions.numHeaderRows>1,{minHeight:Ht,maxHeight:gt,minWidth:In,maxWidth:cr,rowHeight:Bn,resizableSize:B,setResizableSize:Ne}=TC(e,x,le,Hn,g||0,f,u,a,l),Ge=d.useCallback(([xe,Lt])=>({...s1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:x.glideTheme.textLight},span:[0,Math.max(ie.length-1,0)]}),[ie,x.glideTheme.textLight]),zt=d.useCallback(()=>{we(),bt()},[we,bt]);xg({element:e,widgetMgr:r,onFormCleared:zt});const{pinColumn:tn,unpinColumn:fn,freezeColumns:Rn}=B1(ie,oe,g||0,x.minColumnWidth,bt,je),{changeColumnFormat:xn}=$1(je),{hideColumn:Wt,showColumn:En}=Z1(bt,je),{onColumnMoved:Tn}=W1(ie,Rn,tn,fn,Se);return d.useEffect(()=>{let xe;const Lt=requestAnimationFrame(()=>{xe=setTimeout(()=>{if(y.current&&w.current){const Xt=y.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Xt&&(I(Xt.height>y.current.clientHeight),D(Xt.width>y.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(Lt),xe&&clearTimeout(xe)}},[B,le,We]),d.useEffect(()=>{wt.length==ie.length&&Z(!1)},[wt.length,ie.length]),me.jsxs(Xc,{className:"stDataFrame","data-testid":"stDataFrame",ref:y,isInHorizontalLayout:p,onPointerDown:xe=>{if(y.current){const Lt=y.current.getBoundingClientRect(),Xt=(v||Math.round(an(XC)))+1;O&&Lt.height-Xt<xe.clientY-Lt.top&&xe.stopPropagation(),T&&Lt.width-Xt<xe.clientX-Lt.left&&xe.stopPropagation()}},onBlur:xe=>{!P&&!X&&!xe.currentTarget.contains(xe.relatedTarget)&&!De&&bt(!0,!0)},children:[me.jsxs(wg,{isFullScreen:u,disableFullscreenMode:o,locked:nt&&!Me||kt||X&&P||N,onExpand:c,onCollapse:h,target:Xc,children:[s?.map(xe=>xe),(Me&&nt||Te&&Xe||De&&kt)&&me.jsx(wo,{label:"Clear selection",icon:Rg,onClick:()=>{bt(),xt()}}),G&&nt&&me.jsx(wo,{label:"Delete row(s)",icon:Pg,onClick:()=>{Jt&&(Jt(tt),xt())}}),G&&!nt&&me.jsx(wo,{label:"Add row",icon:hd,onClick:()=>{yt&&(M(!0),yt(),xt(),w.current?.scrollTo(0,le,"vertical"))}}),!oe&&wt.length>ie.length&&me.jsx(GC,{columns:wt,columnOrder:ut,setColumnOrder:Se,hideColumn:Wt,showColumn:En,isOpen:N,onClose:te,children:me.jsx(wo,{label:"Show/hide columns",icon:pd,onClick:ue})}),!_&&!oe&&me.jsx(wo,{label:"Download as CSV",icon:zg,onClick:Et}),!oe&&me.jsx(wo,{label:"Search",icon:fd,onClick:()=>{C?z(!1):(M(!0),z(!0)),xt()}})]}),me.jsx(wp,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:B,style:{border:`${x.tableBorderWidth}px solid ${x.glideTheme.borderColor}`,borderRadius:`${x.tableBorderRadius}`},minHeight:Ht,maxHeight:gt,minWidth:In,maxWidth:p?void 0:cr,size:B,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!p,bottomLeft:!1,topLeft:!1},grid:[1,Bn],snapGap:Bn/3,onResizeStop:(xe,Lt,Xt,Wn)=>{if(m.current){const Zt=2*x.tableBorderWidth;Ne({width:m.current.size.width,height:gt-m.current.size.height===Zt?m.current.size.height+Zt:m.current.size.height})}},children:me.jsx(e1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:We,rows:oe?1:le,minColumnWidth:x.minColumnWidth,maxColumnWidth:x.maxColumnWidth,maxColumnAutoWidth:x.maxColumnAutoWidth,rowHeight:Bn,headerHeight:x.defaultHeaderHeight,getCellContent:oe?Ge:ve,onColumnResize:X?void 0:St,resizeIndicator:"header",freezeColumns:Rn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:X?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:Tn,onItemHovered:xe=>{E?.(xe),Pn?.(xe)},keybindings:{downFill:!0,...De||_?{selectAll:!1}:{}},onKeyDown:xe=>{(xe.ctrlKey||xe.metaKey)&&xe.key==="f"&&(z(Lt=>!Lt),xe.stopPropagation(),xe.preventDefault())},showSearch:C,searchResults:C?void 0:[],onSearchClose:()=>{z(!1),xt()},onHeaderClicked:(xe,Lt)=>{!H||Te||(C&&z(!1),Me&&nt?bt():bt(!0,!0),ye(xe,"auto"))},gridSelection:tt,onGridSelectionChange:xe=>{(P||X)&&(Dt(xe),rt!==void 0&&xt(),J(void 0),Z(!1))},theme:x.glideTheme,getRowThemeOverride:R,onMouseMove:xe=>{xe.kind==="out-of-bounds"&&P?M(!1):xe.kind!=="out-of-bounds"&&!P&&M(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:O?-v:void 0,paddingRight:T?-v:void 0},provideEditor:zn,drawCell:un,customRenderers:cn,imageEditorOverride:k1,headerIcons:x.headerIcons,validateCell:Mn,onHeaderMenuClick:(xe,Lt)=>{N||J({columnIdx:xe,headerBounds:Lt})},onPaste:!1,...Me&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader,textMedium:x.glideTheme.textLight}},rowSelectionMode:Qe?"multi":"auto",rowSelect:n?"none":Qe?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...Te&&{columnSelect:n?"none":Ie?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Ie?"multi":"auto",rangeSelectionBlending:"additive"},...De&&{rangeSelect:ft?"rect":"cell",rangeSelectionBlending:"additive"},...!oe&&e.editingMode!==ge&&!n&&{fillHandle:!X,onCellEdited:pt,onPaste:Dn,onDelete:Jt},...!oe&&e.editingMode===ae&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:yt,onHeaderClicked:void 0}})}),rt?.content&&me.jsx(KC,{top:rt.top,left:rt.left,content:rt.content,clearTooltip:xt}),k&&od.createPortal(me.jsx(WC,{top:k.headerBounds.y+k.headerBounds.height,left:k.headerBounds.x+k.headerBounds.width,column:mt[k.columnIdx],onCloseMenu:()=>J(void 0),onSortColumn:H?xe=>{C&&z(!1),bt(!(Me&&nt),!0),ye(k.columnIdx,xe,!0)}:void 0,isColumnPinned:mt[k.columnIdx].isPinned,onUnpinColumn:()=>{fn(mt[k.columnIdx].id)},onPinColumn:()=>{tn(mt[k.columnIdx].id)},onHideColumn:()=>{Wt(mt[k.columnIdx].id)},onChangeFormat:xe=>{xn(mt[k.columnIdx].id,xe),setTimeout(()=>{w.current?.remeasureColumns(et.fromSingleSelection(k.columnIdx))},100)},onAutosize:()=>{w.current?.remeasureColumns(et.fromSingleSelection(k.columnIdx))}}),document.querySelector("#portal"))]})}const YC=bg(ZC),mf=d.memo(YC),JC=({data:e,height:t,customToolbarActions:n})=>me.jsx(mf,{element:new ln({useContainerWidth:!0,editingMode:ln.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:n,widthConfig:new Ys.WidthConfig({useStretch:!0}),heightConfig:t?new Ys.HeightConfig({pixelHeight:t}):void 0}),ck=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:JC,default:mf},Symbol.toStringTag,{value:"Module"}));export{Io as E,Ud as G,ko as V,hn as a,Hv as c,ck as i,n0 as k,Vg as m,JC as s};
|