@stlite/desktop 0.88.0 → 0.89.0
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/bin/dump_artifacts.js +2 -2
- package/build/assets/{ErrorOutline.esm-D5Ifiwqa.js → ErrorOutline.esm-D2SwfuYU.js} +1 -1
- package/build/assets/{FileDownload.esm-DOHSKnrq.js → FileDownload.esm-C2Gywq_5.js} +1 -1
- package/build/assets/{FileHelper-BTXiVf4-.js → FileHelper-TEIN3a2s.js} +1 -1
- package/build/assets/{FormClearHelper-BC4K9Zmh.js → FormClearHelper-DBsQ33IR.js} +1 -1
- package/build/assets/{Hooks-GYU3aDYH.js → Hooks-BdfQKLev.js} +1 -1
- package/build/assets/{InputInstructions-CqSmotDL.js → InputInstructions-CtPX8G6i.js} +1 -1
- package/build/assets/{Particles-DKyXwmGK.js → Particles-CftaQRnu.js} +1 -1
- package/build/assets/{ProgressBar-B7cXo5Zk.js → ProgressBar-M7ATKOrt.js} +1 -1
- package/build/assets/{Toolbar-CF99-ktZ.js → Toolbar-AvCHJeN3.js} +1 -1
- package/build/assets/{base-input-Bu7lYJya.js → base-input-C1jq7mBd.js} +1 -1
- package/build/assets/{checkbox-vy_88iMk.js → checkbox-mkpBvvtC.js} +1 -1
- package/build/assets/{createSuper-BZDCsfCp.js → createSuper-BqkNEFMI.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-P0wPqvRS.js → data-grid-overlay-editor-Kkg8Jnuo.js} +1 -1
- package/build/assets/{downloader-E6SH6tis.js → downloader-D5bOXv0f.js} +1 -1
- package/build/assets/{es6-lWl2HAKQ.js → es6-dD9evgqV.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-BblXhc8K.js → iframeResizer.contentWindow-CcIGM7Tj.js} +1 -1
- package/build/assets/{index-CHcwRuRz.js → index-65i-IYyx.js} +1 -1
- package/build/assets/{index-C0rU7wjo.js → index-6GmirbOq.js} +1 -1
- package/build/assets/{index-Bl3t7YE9.js → index-B6MoDIcs.js} +1 -1
- package/build/assets/{index-rGN93mnX.js → index-B6dp8D8K.js} +1 -1
- package/build/assets/{index-sNwZkMcg.js → index-B_ESKJn8.js} +1 -1
- package/build/assets/{index-BHD6dN1i.js → index-Bn07Nrcj.js} +1 -1
- package/build/assets/{index-BAt37HPV.js → index-BvsGq1E8.js} +1 -1
- package/build/assets/{index-BHYA8KUU.js → index-BwDs6Dqm.js} +1 -1
- package/build/assets/{index-NFS9SZBh.js → index-BzxHONei.js} +1 -1
- package/build/assets/{index-DKJBdNcR.js → index-C3s_fpYA.js} +1 -1
- package/build/assets/{index-D7qhlvAL.js → index-COglCO5Z.js} +5 -5
- package/build/assets/{index-UG5gS873.js → index-CRXKMFnY.js} +1 -1
- package/build/assets/{index-tGudOCY7.js → index-CZ-g3tsi.js} +1 -1
- package/build/assets/{index-9Wb22-Zl.js → index-CaQBKEJy.js} +1 -1
- package/build/assets/{index-CcNoZyGq.js → index-Cbwanp8_.js} +1 -1
- package/build/assets/{index-DodBZ077.js → index-CmCzhGLu.js} +1 -1
- package/build/assets/{index-COVY3it_.js → index-Cmk6T6xH.js} +1 -1
- package/build/assets/{index-Ba8Fd3Iw.js → index-CuAJIEXV.js} +1 -1
- package/build/assets/{index-oUxYecyl.js → index-CyGIJHIN.js} +1 -1
- package/build/assets/{index-E1lgIpin.js → index-D9I-_Axj.js} +1 -1
- package/build/assets/{index-Ck8oqwxV.js → index-DRnW2Id8.js} +1 -1
- package/build/assets/{index-LjAoKxoo.js → index-Dpl6MGkr.js} +1 -1
- package/build/assets/{index-J69gSkQ7.js → index-Du10bw-R.js} +1 -1
- package/build/assets/{index-CO2uSAB4.js → index-GIlSUqbu.js} +1 -1
- package/build/assets/{index-DPhgZ6z8.js → index-GZIk974x.js} +1 -1
- package/build/assets/{index-C9dv_cRO.js → index-GZgkD7uG.js} +1 -1
- package/build/assets/{index-C8408c32.js → index-N4aGA-cE.js} +1 -1
- package/build/assets/{index-CBgaSeZa.js → index-P6F5Xebr.js} +1 -1
- package/build/assets/{index-D1lT9gPf.js → index-XJiwj79b.js} +1 -1
- package/build/assets/{index-CESihKoP.js → index-_maoKajI.js} +1 -1
- package/build/assets/{index-C_XWYeXZ.js → index-cMy3wqhE.js} +1 -1
- package/build/assets/{index-B2QqSXxG.js → index-clm6On2Y.js} +4 -4
- package/build/assets/{index-IjmnJRcJ.js → index-i6_APaSl.js} +1 -1
- package/build/assets/{index-DDHABoz7.js → index-npEbF0j6.js} +1 -1
- package/build/assets/{index-3q7VEUlu.js → index-o_WbG_Oh.js} +1 -1
- package/build/assets/{index-DLKkPsKG.js → index-w_HPESMz.js} +1 -1
- package/build/assets/{index-CeooaFxj.js → index-yIAfElop.js} +1 -1
- package/build/assets/{inherits-CxdXuG_P.js → inherits-D8N0057t.js} +1 -1
- package/build/assets/{input-CK3Z1ctS.js → input-D2HjwqoP.js} +1 -1
- package/build/assets/{memory-F_WtxrTu.js → memory-DWwc6pLO.js} +1 -1
- package/build/assets/{mergeWith-DB-_2-Rw.js → mergeWith-BGcS1SpY.js} +1 -1
- package/build/assets/{number-overlay-editor-B9-dA9Oc.js → number-overlay-editor-B6CLC0X9.js} +1 -1
- package/build/assets/{sandbox-OL9X-HVr.js → sandbox-C6oygvjW.js} +1 -1
- package/build/assets/{slicedToArray-Dcf1iVtV.js → slicedToArray-DOoFLiRi.js} +1 -1
- package/build/assets/{timepicker-CNx-qwHe.js → timepicker-C7DrJdVV.js} +1 -1
- package/build/assets/{uniqueId-B67KB2Sb.js → uniqueId-C1Mkja_B.js} +1 -1
- package/build/assets/{useBasicWidgetState-DVIC6bdr.js → useBasicWidgetState-CCltHZT9.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-D9ObUIEt.js → useTextInputAutoExpand-LP-kJAB7.js} +1 -1
- package/build/assets/{useUpdateUiValue-BpA660Wd.js → useUpdateUiValue-JsRPimPm.js} +1 -1
- package/build/assets/{withFullScreenWrapper-CQbXKdaQ.js → withFullScreenWrapper-CKQjmc-1.js} +1 -1
- package/build/assets/{worker-Cet_Vg8m.js → worker-CiNU4sgs.js} +3 -3
- package/build/electron/worker.js +3 -3
- package/build/index.html +1 -1
- package/build/pyodide/pyodide-lock.json +1 -1
- package/build/pyodide/pyodide.asm.js +2 -4
- package/build/pyodide/pyodide.asm.wasm +0 -0
- package/build/pyodide/pyodide.mjs +3 -3
- package/build/pyodide/python_stdlib.zip +0 -0
- package/package.json +6 -6
- package/wheels/streamlit-1.48.0-cp313-none-any.whl +0 -0
- package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-
|
|
2
|
-
import{r as d,E as ms,_ as $e,f as Ny,g as lr,i as vs,h as hi,m as By,n as Wy,o as $y,p as Hh,q as Fh,R as Bt,s as jy,t as Ah,v as Uy,w as Xy,x as Gy,y as Yy,z as Ky,A as qy,e as Ir,B as bs,C as Zy,D as Qy,F as _e,G as Lh,H as st,I as fi,J as Zr,K as ws,j as ye,c as Un,M as Jy,N as ex,O as tx,Q as zh,S as nx,T as rx,U as ox,V as ix,W as _h,X as ax,Y as lx,Z as ys,$ as Vh,a0 as Nh,a1 as sx,a2 as cx,a3 as ux,a4 as dx,a5 as hx,a6 as fx,a7 as px,a8 as gx,a9 as mx,aa as Bh,ab as vx,ac as bx,ad as wx,ae as yx,af as xx,ag as Cx,ah as kx,ai as Sx,aj as Mx,ak as Rx,al as Ex,am as Ix,an as Tx,ao as Ox,ap as Qr,aq as cn,ar as xn,l as ba,as as pi,at as sr,au as Dx,av as Px,aw as Hx,ax as Fx,ay as Ax,az as Lx,aA as wa,aB as gi,aC as Ft,aD as zx,aE as _x,aF as Vx,aG as Nx,aH as Jr,aI as St,aJ as vn,aK as Wh,aL as $h,aM as ya,aN as Bx,aO as jh,aP as Uh,aQ as Wx,aR as xs,aS as $x,aT as jx,aU as Xh,aV as Ux,aW as Gh,aX as Xx,aY as Yh,aZ as Gx,a_ as Yx,a$ as Kx,d as Kh,b0 as Cs,b1 as So,b2 as qx,b3 as Zx,b4 as ks,b5 as xa,b6 as Ca,b7 as qh,b8 as ka,b9 as Xn,ba as Zh,bb as Qx,bc as Jx,bd as Qh,be as eC,bf as tC,L as nC,bg as rC,__tla as oC}from"./index-B2QqSXxG.js";import{w as iC,E as aC}from"./withFullScreenWrapper-CQbXKdaQ.js";import{T as lC,a as Mo}from"./Toolbar-CF99-ktZ.js";import{u as sC}from"./FormClearHelper-BC4K9Zmh.js";import{m as cC}from"./mergeWith-DB-_2-Rw.js";import{s as uC}from"./sprintf-D7DtBTRn.js";import{S as dC,L as hC,a as fC}from"./checkbox-vy_88iMk.js";import{c as pC}from"./createDownloadLinkElement-ZaXNnPK4.js";import{_ as cr,C as gC}from"./slicedToArray-Dcf1iVtV.js";import{_ as mC,a as vC,b as bC}from"./inherits-CxdXuG_P.js";import{_ as wC}from"./createSuper-BZDCsfCp.js";import{D as yC,F as xC}from"./FileDownload.esm-DOHSKnrq.js";let Ss,Sa,Tr,Ms,Jh,Or,Rs,rn,CC=Promise.all([(()=>{try{return oC}catch{}})()]).then(async()=>{var Es=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Es.displayName="Add";var Is=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Is.displayName="Search";var Ts=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Ts.displayName="Visibility";var Ma,Os;function ef(){if(Os)return Ma;Os=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return Ma=n,Ma}var Ra,Ds;function tf(){if(Ds)return Ra;Ds=1;var e=ef(),t=Ny();function n(r,o){return r!=null&&t(r,o,e)}return Ra=n,Ra}var nf=tf();const rf=lr(nf);function Ps(e="This should not happen"){throw new Error(e)}function En(e,t="Assertion failed"){if(!e)return Ps(t)}function Ro(e,t){return Ps(t??"Hell froze over")}function of(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function eo(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--&&eo(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!eo(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const mi=null,Ea=void 0;var Z;(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"})(Z||(Z={}));var Fs;(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"})(Fs||(Fs={}));var vi;(function(e){e.Triangle="triangle",e.Dots="dots"})(vi||(vi={}));function bi(e){return"width"in e&&typeof e.width=="number"}async function As(e){return typeof e=="object"?e:await e()}Or=function(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)},Tr=function(e){return e.kind===An.Marker||e.kind===An.NewRow};function to(e){if(!Or(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:Ro(e,"A cell was passed with an invalid kind")}}Ms=function(e){return rf(e,"editor")};function Ia(e){return!(e.readonly??!1)}var An;(function(e){e.NewRow="new-row",e.Marker="marker"})(An||(An={}));function af(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 Ls;class ot{items;constructor(t){this.items=t}static empty=()=>Ls??(Ls=new ot([]));static fromSingleSelection=t=>ot.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new ot(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=af([...this.items,n]);return new ot(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,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new ot(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,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 lf=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[,l]=i.split("_");t[l]=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(" ")},zs=lf,sf=e=>e.toUpperCase()===e,cf=e=>t=>e.indexOf(t)===-1,_s=(e,t)=>{const n={};return Object.keys(e).filter(cf(t)).forEach(r=>{n[r]=e[r]}),n};function uf(e,t,n){const r=_s(t,n);if(!e){const o=typeof vs=="function"?{default:vs}:vs;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var df=(e,t)=>{};function hf(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!sf(a[0])):n.propsAsIs,u=uf(c,i,["as","class"]);u.ref=l,u.className=n.atomic?zs(n.class,u.className||s):zs(u.className||s,n.class);const{vars:h}=n;if(h){const p={};for(const m in h){const b=h[m],y=b[0],w=b[1]||"",k=typeof y=="function"?y(i):y;df(k,n.name),p[`--${m}`]=`${k}${w}`}const f=u.style||{},g=Object.keys(f);g.length>0&&g.forEach(m=>{p[m]=f[m]}),u.style=p}return e.__wyw_meta&&e!==a?(u.as=a,d.createElement(e,u)):d.createElement(a,u)},o=d.forwardRef?d.forwardRef(r):i=>{const l=_s(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}rn=hf;const ff=rn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Vs={},Eo={},Ta={},Oa={},Ns;function pf(){return Ns||(Ns=1,function(e){(function(t,n){n(e,hi(),By())})(Oa,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=g;var o=l(n),i=l(r);function l(w){return w&&w.__esModule?w:{default:w}}var a=Object.assign||function(w){for(var k=1;k<arguments.length;k++){var I=arguments[k];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(w[E]=I[E])}return w};function s(w,k){var I={};for(var E in w)k.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(w,E)&&(I[E]=w[E]);return I}function c(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(k,I){for(var E=0;E<I.length;E++){var x=I[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}return function(k,I,E){return I&&w(k.prototype,I),E&&w(k,E),k}}();function h(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:w}function p(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}var f=!1;function g(w){f=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){g(!0)}}))}catch{}function m(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?w:w.capture}function b(w){if("touches"in w){var k=w.touches[0],I=k.pageX,E=k.pageY;return{x:I,y:E}}var x=w.screenX,H=w.screenY;return{x,y:H}}var y=function(w){p(k,w);function k(){var I;c(this,k);for(var E=arguments.length,x=Array(E),H=0;H<E;H++)x[H]=arguments[H];var O=h(this,(I=k.__proto__||Object.getPrototypeOf(k)).call.apply(I,[this].concat(x)));return O._handleSwipeStart=O._handleSwipeStart.bind(O),O._handleSwipeMove=O._handleSwipeMove.bind(O),O._handleSwipeEnd=O._handleSwipeEnd.bind(O),O._onMouseDown=O._onMouseDown.bind(O),O._onMouseMove=O._onMouseMove.bind(O),O._onMouseUp=O._onMouseUp.bind(O),O._setSwiperRef=O._setSwiperRef.bind(O),O}return u(k,[{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(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var E=b(I),x=E.x,H=E.y;this.moveStart={x,y:H},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var E=b(I),x=E.x,H=E.y,O=x-this.moveStart.x,M=H-this.moveStart.y;this.moving=!0;var F=this.props.onSwipeMove({x:O,y:M},I);F&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:O,deltaY:M}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,I):this.movePosition.deltaY>E&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var E=I.className,x=I.style,H=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var O=s(I,["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:x},O),H)}}]),k}(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})}(Oa)),Oa}var Bs;function Ws(){return Bs||(Bs=1,function(e){(function(t,n){n(e,pf())})(Ta,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})}(Ta)),Ta}var Io={},$s;function js(){if($s)return Io;$s=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.default=void 0;var e=t(Wy());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,l){return i in o?Object.defineProperty(o,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[i]=l,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,l){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Io.default=r,Io}var To={},Oo={},Us;function gf(){if(Us)return Oo;Us=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Oo.outerWidth=e,Oo}var Do={},Xs;function Da(){if(Xs)return Do;Xs=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.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],l="translate3d",a="("+i.join(",")+")";return l+a};return Do.default=e,Do}var Po={},Gs;function Ys(){if(Gs)return Po;Gs=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=void 0;var e=function(){return window};return Po.default=e,Po}var Ks;function qs(){if(Ks)return To;Ks=1,Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var e=s(hi()),t=l(js()),n=gf(),r=l(Da()),o=l(Ws()),i=l(Ys());function l(O){return O&&O.__esModule?O:{default:O}}function a(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return a=function(){return O},O}function s(O){if(O&&O.__esModule)return O;if(O===null||c(O)!=="object"&&typeof O!="function")return{default:O};var M=a();if(M&&M.has(O))return M.get(O);var F={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in O)if(Object.prototype.hasOwnProperty.call(O,C)){var R=T?Object.getOwnPropertyDescriptor(O,C):null;R&&(R.get||R.set)?Object.defineProperty(F,C,R):F[C]=O[C]}return F.default=O,M&&M.set(O,F),F}function c(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(M){return typeof M}:c=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},c(O)}function u(){return u=Object.assign||function(O){for(var M=1;M<arguments.length;M++){var F=arguments[M];for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(O[T]=F[T])}return O},u.apply(this,arguments)}function h(O,M){if(!(O instanceof M))throw new TypeError("Cannot call a class as a function")}function p(O,M){for(var F=0;F<M.length;F++){var T=M[F];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,T.key,T)}}function f(O,M,F){return M&&p(O.prototype,M),O}function g(O,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(M&&M.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),M&&m(O,M)}function m(O,M){return m=Object.setPrototypeOf||function(F,T){return F.__proto__=T,F},m(O,M)}function b(O){var M=k();return function(){var F=I(O),T;if(M){var C=I(this).constructor;T=Reflect.construct(F,arguments,C)}else T=F.apply(this,arguments);return y(this,T)}}function y(O,M){return M&&(c(M)==="object"||typeof M=="function")?M:w(O)}function w(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(O){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},I(O)}function E(O,M,F){return M in O?Object.defineProperty(O,M,{value:F,enumerable:!0,configurable:!0,writable:!0}):O[M]=F,O}var x=function(O){return O.hasOwnProperty("key")},H=function(O){g(F,O);var M=b(F);function F(T){var C;return h(this,F),C=M.call(this,T),E(w(C),"itemsWrapperRef",void 0),E(w(C),"itemsListRef",void 0),E(w(C),"thumbsRef",void 0),E(w(C),"setItemsWrapperRef",function(R){C.itemsWrapperRef=R}),E(w(C),"setItemsListRef",function(R){C.itemsListRef=R}),E(w(C),"setThumbsRef",function(R,D){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[D]=R}),E(w(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var R=e.Children.count(C.props.children),D=C.itemsWrapperRef.clientWidth,S=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),Q=Math.floor(D/S),$=Q<R,q=$?R-Q:0;C.setState(function(ie,ee){return{itemSize:S,visibleItems:Q,firstItem:$?C.getFirstItem(ee.selectedItem):0,lastPosition:q,showArrows:$}})}}),E(w(C),"handleClickItem",function(R,D,S){if(!x(S)||S.key==="Enter"){var Q=C.props.onSelectItem;typeof Q=="function"&&Q(R,D)}}),E(w(C),"onSwipeStart",function(){C.setState({swiping:!0})}),E(w(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),E(w(C),"onSwipeMove",function(R){var D=R.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var S=0,Q=e.Children.count(C.props.children),$=-(C.state.firstItem*100)/C.state.visibleItems,q=Math.max(Q-C.state.visibleItems,0),ie=-q*100/C.state.visibleItems;$===S&&D>0&&(D=0),$===ie&&D<0&&(D=0);var ee=C.itemsWrapperRef.clientWidth,K=$+100/(ee/D);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(se){C.itemsListRef.style[se]=(0,r.default)(K,"%",C.props.axis)}),!0}),E(w(C),"slideRight",function(R){C.moveTo(C.state.firstItem-(typeof R=="number"?R:1))}),E(w(C),"slideLeft",function(R){C.moveTo(C.state.firstItem+(typeof R=="number"?R:1))}),E(w(C),"moveTo",function(R){R=R<0?0:R,R=R>=C.state.lastPosition?C.state.lastPosition:R,C.setState({firstItem:R})}),C.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return f(F,[{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 C=T;return T>=this.state.lastPosition&&(C=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(C=this.state.firstItem),T<this.state.firstItem&&(C=T),C}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(C,R){var D=t.default.ITEM(!1,R===T.state.selectedItem),S={key:R,ref:function(Q){return T.setThumbsRef(Q,R)},className:D,onClick:T.handleClickItem.bind(T,R,T.props.children[R]),onKeyDown:T.handleClickItem.bind(T,R,T.props.children[R]),"aria-label":"".concat(T.props.labels.item," ").concat(R+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",u({},S,{role:"button",tabIndex:0}),C)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var C=e.Children.count(this.props.children)>1,R=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,S={},Q=-this.state.firstItem*(this.state.itemSize||0),$=(0,r.default)(Q,"px",this.props.axis),q=this.props.transitionTime+"ms";return S={WebkitTransform:$,MozTransform:$,MsTransform:$,OTransform:$,transform:$,msTransform:$,WebkitTransitionDuration:q,MozTransitionDuration:q,MsTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q},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(!R),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),C?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:S,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ie){return T.setItemsListRef(ie)},style:S},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})))}}]),F}(e.Component);return To.default=H,E(H,"displayName","Thumbs"),E(H,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),To}var Ho={},Zs;function mf(){if(Zs)return Ho;Zs=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=void 0;var e=function(){return document};return Ho.default=e,Ho}var In={},Qs;function Js(){if(Qs)return In;Qs=1,Object.defineProperty(In,"__esModule",{value:!0}),In.setPosition=In.getPosition=In.isKeyboardEvent=In.defaultStatusFormatter=In.noop=void 0;var e=hi(),t=n(Da());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};In.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};In.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};In.isKeyboardEvent=i;var l=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,p=u-1;return s&&(s!==p||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===p&&(h+=100-c.centerSlidePercentage),h}return-s*100};In.getPosition=l;var a=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return In.setPosition=a,In}var Vn={},ec;function vf(){if(ec)return Vn;ec=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.fadeAnimationHandler=Vn.slideStopSwipingHandler=Vn.slideSwipeAnimationHandler=Vn.slideAnimationHandler=void 0;var e=hi(),t=r(Da()),n=Js();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,p){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);p&&(g=g.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,g)}return f}function i(h){for(var p=1;p<arguments.length;p++){var f=arguments[p]!=null?arguments[p]:{};p%2?o(Object(f),!0).forEach(function(g){l(h,g,f[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(f,g))})}return h}function l(h,p,f){return p in h?Object.defineProperty(h,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[p]=f,h}var a=function(h,p){var f={},g=p.selectedItem,m=g,b=e.Children.count(h.children)-1,y=h.infiniteLoop&&(g<0||g>b);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(b+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(b+2)*100,h.axis):m>b&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var w=(0,n.getPosition)(g,h),k=(0,t.default)(w,"%",h.axis),I=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:k,msTransform:k,OTransform:k,transform:k},p.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),f};Vn.slideAnimationHandler=a;var s=function(h,p,f,g){var m={},b=p.axis==="horizontal",y=e.Children.count(p.children),w=0,k=(0,n.getPosition)(f.selectedItem,p),I=p.infiniteLoop?(0,n.getPosition)(y-1,p)-100:(0,n.getPosition)(y-1,p),E=b?h.x:h.y,x=E;k===w&&E>0&&(x=0),k===I&&E<0&&(x=0);var H=k+100/(f.itemSize/x),O=Math.abs(E)>p.swipeScrollTolerance;return p.infiniteLoop&&O&&(f.selectedItem===0&&H>-100?H-=y*100:f.selectedItem===y-1&&H<-y*100&&(H+=y*100)),(!p.preventMovementUntilSwipeScrollTolerance||O||f.swipeMovementStarted)&&(f.swipeMovementStarted||g({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(H,p.axis)),O&&!f.cancelClick&&g({cancelClick:!0}),m};Vn.slideSwipeAnimationHandler=s;var c=function(h,p){var f=(0,n.getPosition)(p.selectedItem,h),g=(0,n.setPosition)(f,h.axis);return{itemListStyle:g}};Vn.slideStopSwipingHandler=c;var u=function(h,p){var f=h.transitionTime+"ms",g="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:g,msTransitionTimingFunction:g,MozTransitionTimingFunction:g,WebkitTransitionTimingFunction:g,OTransitionTimingFunction:g};return p.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 Vn.fadeAnimationHandler=u,Vn}var tc;function bf(){if(tc)return Eo;tc=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.default=void 0;var e=u(hi()),t=s(Ws()),n=s(js()),r=s(qs()),o=s(mf()),i=s(Ys()),l=Js(),a=vf();function s(T){return T&&T.__esModule?T:{default:T}}function c(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return c=function(){return T},T}function u(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var C=c();if(C&&C.has(T))return C.get(T);var R={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in T)if(Object.prototype.hasOwnProperty.call(T,S)){var Q=D?Object.getOwnPropertyDescriptor(T,S):null;Q&&(Q.get||Q.set)?Object.defineProperty(R,S,Q):R[S]=T[S]}return R.default=T,C&&C.set(T,R),R}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(C){return typeof C}:h=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},h(T)}function p(){return p=Object.assign||function(T){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var D in R)Object.prototype.hasOwnProperty.call(R,D)&&(T[D]=R[D])}return T},p.apply(this,arguments)}function f(T,C){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);C&&(D=D.filter(function(S){return Object.getOwnPropertyDescriptor(T,S).enumerable})),R.push.apply(R,D)}return R}function g(T){for(var C=1;C<arguments.length;C++){var R=arguments[C]!=null?arguments[C]:{};C%2?f(Object(R),!0).forEach(function(D){M(T,D,R[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(R)):f(Object(R)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(R,D))})}return T}function m(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function b(T,C){for(var R=0;R<C.length;R++){var D=C[R];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,C,R){return C&&b(T.prototype,C),T}function w(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),C&&k(T,C)}function k(T,C){return k=Object.setPrototypeOf||function(R,D){return R.__proto__=D,R},k(T,C)}function I(T){var C=H();return function(){var R=O(T),D;if(C){var S=O(this).constructor;D=Reflect.construct(R,arguments,S)}else D=R.apply(this,arguments);return E(this,D)}}function E(T,C){return C&&(h(C)==="object"||typeof C=="function")?C:x(T)}function x(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function H(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(T){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},O(T)}function M(T,C,R){return C in T?Object.defineProperty(T,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[C]=R,T}var F=function(T){w(R,T);var C=I(R);function R(D){var S;m(this,R),S=C.call(this,D),M(x(S),"thumbsRef",void 0),M(x(S),"carouselWrapperRef",void 0),M(x(S),"listRef",void 0),M(x(S),"itemsRef",void 0),M(x(S),"timer",void 0),M(x(S),"animationHandler",void 0),M(x(S),"setThumbsRef",function($){S.thumbsRef=$}),M(x(S),"setCarouselWrapperRef",function($){S.carouselWrapperRef=$}),M(x(S),"setListRef",function($){S.listRef=$}),M(x(S),"setItemsRef",function($,q){S.itemsRef||(S.itemsRef=[]),S.itemsRef[q]=$}),M(x(S),"autoPlay",function(){e.Children.count(S.props.children)<=1||(S.clearAutoPlay(),S.props.autoPlay&&(S.timer=setTimeout(function(){S.increment()},S.props.interval)))}),M(x(S),"clearAutoPlay",function(){S.timer&&clearTimeout(S.timer)}),M(x(S),"resetAutoPlay",function(){S.clearAutoPlay(),S.autoPlay()}),M(x(S),"stopOnHover",function(){S.setState({isMouseEntered:!0},S.clearAutoPlay)}),M(x(S),"startOnLeave",function(){S.setState({isMouseEntered:!1},S.autoPlay)}),M(x(S),"isFocusWithinTheCarousel",function(){return S.carouselWrapperRef?!!((0,o.default)().activeElement===S.carouselWrapperRef||S.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),M(x(S),"navigateWithKeyboard",function($){if(S.isFocusWithinTheCarousel()){var q=S.props.axis,ie=q==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},K=ie?ee.ArrowRight:ee.ArrowDown,se=ie?ee.ArrowLeft:ee.ArrowUp;K===$.keyCode?S.increment():se===$.keyCode&&S.decrement()}}),M(x(S),"updateSizes",function(){if(!(!S.state.initialized||!S.itemsRef||S.itemsRef.length===0)){var $=S.props.axis==="horizontal",q=S.itemsRef[0];if(q){var ie=$?q.clientWidth:q.clientHeight;S.setState({itemSize:ie}),S.thumbsRef&&S.thumbsRef.updateSizes()}}}),M(x(S),"setMountState",function(){S.setState({hasMount:!0}),S.updateSizes()}),M(x(S),"handleClickItem",function($,q){if(e.Children.count(S.props.children)!==0){if(S.state.cancelClick){S.setState({cancelClick:!1});return}S.props.onClickItem($,q),$!==S.state.selectedItem&&S.setState({selectedItem:$})}}),M(x(S),"handleOnChange",function($,q){e.Children.count(S.props.children)<=1||S.props.onChange($,q)}),M(x(S),"handleClickThumb",function($,q){S.props.onClickThumb($,q),S.moveTo($)}),M(x(S),"onSwipeStart",function($){S.setState({swiping:!0}),S.props.onSwipeStart($)}),M(x(S),"onSwipeEnd",function($){S.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),S.props.onSwipeEnd($),S.clearAutoPlay(),S.state.autoPlay&&S.autoPlay()}),M(x(S),"onSwipeMove",function($,q){S.props.onSwipeMove(q);var ie=S.props.swipeAnimationHandler($,S.props,S.state,S.setState.bind(x(S)));return S.setState(g({},ie)),!!Object.keys(ie).length}),M(x(S),"decrement",function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem-(typeof $=="number"?$:1))}),M(x(S),"increment",function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem+(typeof $=="number"?$:1))}),M(x(S),"moveTo",function($){if(typeof $=="number"){var q=e.Children.count(S.props.children)-1;$<0&&($=S.props.infiniteLoop?q:0),$>q&&($=S.props.infiniteLoop?0:q),S.selectItem({selectedItem:$}),S.state.autoPlay&&S.state.isMouseEntered===!1&&S.resetAutoPlay()}}),M(x(S),"onClickNext",function(){S.increment(1)}),M(x(S),"onClickPrev",function(){S.decrement(1)}),M(x(S),"onSwipeForward",function(){S.increment(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),M(x(S),"onSwipeBackwards",function(){S.decrement(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),M(x(S),"changeItem",function($){return function(q){(!(0,l.isKeyboardEvent)(q)||q.key==="Enter")&&S.moveTo($)}}),M(x(S),"selectItem",function($){S.setState(g({previousItem:S.state.selectedItem},$),function(){S.setState(S.animationHandler(S.props,S.state))}),S.handleOnChange($.selectedItem,e.Children.toArray(S.props.children)[$.selectedItem])}),M(x(S),"getInitialImage",function(){var $=S.props.selectedItem,q=S.itemsRef&&S.itemsRef[$],ie=q&&q.getElementsByTagName("img")||[];return ie[0]}),M(x(S),"getVariableItemHeight",function($){var q=S.itemsRef&&S.itemsRef[$];if(S.state.hasMount&&q&&q.children.length){var ie=q.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var K=function ue(){S.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",K)}}var se=ie[0]||q.children[0],te=se.clientHeight;return te>0?te:null}return null});var Q={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 S.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,S.state=g(g({},Q),S.animationHandler(D,Q)),S}return y(R,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,S){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),S.swiping&&!this.state.swiping&&this.setState(g({},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 S=D.getInitialImage();S&&!S.complete?S.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 S=this;return this.props.children?e.Children.map(this.props.children,function(Q,$){var q=$===S.state.selectedItem,ie=$===S.state.previousItem,ee=q&&S.state.selectedStyle||ie&&S.state.prevStyle||S.state.slideStyle||{};S.props.centerMode&&S.props.axis==="horizontal"&&(ee=g(g({},ee),{},{minWidth:S.props.centerSlidePercentage+"%"})),S.state.swiping&&S.state.swipeMovementStarted&&(ee=g(g({},ee),{},{pointerEvents:"none"}));var K={ref:function(se){return S.setItemsRef(se,$)},key:"itemKey"+$+(D?"clone":""),className:n.default.ITEM(!0,$===S.state.selectedItem,$===S.state.previousItem),onClick:S.handleClickItem.bind(S,$,Q),style:ee};return e.default.createElement("li",K,S.props.renderItem(Q,{isSelected:$===S.state.selectedItem,isPrevious:$===S.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,S=this.props,Q=S.showIndicators,$=S.labels,q=S.renderIndicator,ie=S.children;return Q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ie,function(ee,K){return q&&q(D.changeItem(K),K===D.state.selectedItem,K,$.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 S=this.props.swipeable&&e.Children.count(this.props.children)>1,Q=this.props.axis==="horizontal",$=this.props.showArrows&&e.Children.count(this.props.children)>1,q=$&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ie=$&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),K=ee.shift(),se=ee.pop(),te={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},ue={};if(Q){if(te.onSwipeLeft=this.onSwipeForward,te.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var fe=this.getVariableItemHeight(this.state.selectedItem);ue.height=fe||"auto"}}else te.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,te.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,te.style=g(g({},te.style),{},{height:this.state.itemSize}),ue.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,q,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ue},S?e.default.createElement(t.default,p({tagName:"ul",innerRef:this.setListRef},te,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&K):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(ae){return D.setListRef(ae)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&K)),this.props.renderArrowNext(this.onClickNext,ie,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),R}(e.default.Component);return Eo.default=F,M(F,"displayName","Carousel"),M(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(T,C,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_PREV(!C),onClick:T})},renderArrowNext:function(T,C,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_NEXT(!C),onClick:T})},renderIndicator:function(T,C,R,D){return e.default.createElement("li",{className:n.default.DOT(C),onClick:T,onKeyDown:T,value:R,key:R,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(R+1)})},renderItem:function(T){return T},renderThumbs:function(T){var C=e.Children.map(T,function(R){var D=R;if(R.type!=="img"&&(D=e.Children.toArray(R.props.children).find(function(S){return S.type==="img"})),!!D)return D});return C.filter(function(R){return R}).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"),[]):C},statusFormatter:l.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}),Eo}var wf={},nc;function yf(){return nc||(nc=1),wf}var rc;function xf(){return rc||(rc=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(bf()),n=yf(),r=o(qs());function o(i){return i&&i.__esModule?i:{default:i}}}(Vs)),Vs}var Cf=xf(),Pa,oc;function kf(){if(oc)return Pa;oc=1;var e=$y(),t=function(){return e.Date.now()};return Pa=t,Pa}var Ha,ic;function ac(){if(ic)return Ha;ic=1;var e=Hh(),t=kf(),n=Fh(),r="Expected a function",o=Math.max,i=Math.min;function l(a,s,c){var u,h,p,f,g,m,b=0,y=!1,w=!1,k=!0;if(typeof a!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,w="maxWait"in c,p=w?o(n(c.maxWait)||0,s):p,k="trailing"in c?!!c.trailing:k);function I(R){var D=u,S=h;return u=h=void 0,b=R,f=a.apply(S,D),f}function E(R){return b=R,g=setTimeout(O,s),y?I(R):f}function x(R){var D=R-m,S=R-b,Q=s-D;return w?i(Q,p-S):Q}function H(R){var D=R-m,S=R-b;return m===void 0||D>=s||D<0||w&&S>=p}function O(){var R=t();if(H(R))return M(R);g=setTimeout(O,x(R))}function M(R){return g=void 0,k&&u?I(R):(u=h=void 0,f)}function F(){g!==void 0&&clearTimeout(g),b=0,u=m=h=g=void 0}function T(){return g===void 0?f:M(t())}function C(){var R=t(),D=H(R);if(u=arguments,h=this,m=R,D){if(g===void 0)return E(m);if(w)return clearTimeout(g),g=setTimeout(O,s),I(m)}return g===void 0&&(g=setTimeout(O,s)),f}return C.cancel=F,C.flush=T,C}return Ha=l,Ha}var Sf=ac();const lc=lr(Sf);function bn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{i.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function ur(e,t){return e===void 0?void 0:t}const Mf=Math.PI;function sc(e){return e*Mf/180}const cc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),uc=(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}},dc=(e,t,n)=>Math.min(e,t-n*2),hc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Fa=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"}))},Rf=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 Ef(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const l=d.useRef(lc(a=>{i.current&&o(a)},n));return d.useLayoutEffect(()=>{i.current&&l.current(()=>e())},t),r}const If="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Tf="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Of=new RegExp("^[^"+Tf+"]*["+If+"]");function Aa(e){return Of.test(e)?"rtl":"not-rtl"}let wi;function La(){if(typeof document>"u")return 0;if(wi!==void 0)return wi;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(),wi=n-r,wi}const Dr=Symbol();function Df(e){const t=d.useRef([Dr,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 s=t.current[0];s!==Dr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Dr&&o({}),r(c=>typeof a=="function"?a(s===Dr?c:s):a),t.current[0]=Dr)},[]),l=d.useCallback(()=>{t.current[0]=Dr,o({})},[]);return[t.current[0]===Dr?n:t.current[0],i,l]}function fc(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 Pf(e){const t=d.useRef(e);return eo(e,t.current)||(t.current=e),t.current}const Hf=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(ff,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Cf.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=o?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Fa,null)))};function pc(){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 Pr=pc();function Ff(e){Pr=e}const gc=/[&<>"']/,Af=new RegExp(gc.source,"g"),mc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Lf=new RegExp(mc.source,"g"),zf={"&":"&","<":"<",">":">",'"':""","'":"'"},vc=e=>zf[e];function hn(e,t){if(t){if(gc.test(e))return e.replace(Af,vc)}else if(mc.test(e))return e.replace(Lf,vc);return e}const _f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function bc(e){return e.replace(_f,(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 Vf=/(^|[^\[])\^/g;function Pt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(Vf,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const Nf=/[^\w:]/g,Bf=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wc(e,t,n){if(e){let r;try{r=decodeURIComponent(bc(n)).replace(Nf,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Bf.test(n)&&(n=Uf(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const yi={},Wf=/^[^:]+:\/*[^/]*$/,$f=/^([^:]+:)[\s\S]*$/,jf=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Uf(e,t){yi[" "+e]||(Wf.test(e)?yi[" "+e]=e+"/":yi[" "+e]=Ci(e,"/",!0)),e=yi[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace($f,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(jf,"$1")+t:e+t}const xi={exec:function(){}};function yc(e,t){const n=e.replace(/\|/g,(i,l,a)=>{let s=!1,c=l;for(;--c>=0&&a[c]==="\\";)s=!s;return s?"|":" |"}),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 Ci(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 Xf(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 Gf(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 xc(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Cc(e,t,n,r){const o=t.href,i=t.title?hn(t.title):null,l=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:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:hn(l)}}function Yf(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-Kkg8Jnuo.js","assets/index-clm6On2Y.js","assets/index.DGR6f4hm.css","assets/withFullScreenWrapper-CKQjmc-1.js","assets/Toolbar-AvCHJeN3.js","assets/FormClearHelper-DBsQ33IR.js","assets/mergeWith-BGcS1SpY.js","assets/sprintf-D7DtBTRn.js","assets/checkbox-mkpBvvtC.js","assets/createDownloadLinkElement-ZaXNnPK4.js","assets/slicedToArray-DOoFLiRi.js","assets/inherits-D8N0057t.js","assets/createSuper-BqkNEFMI.js","assets/FileDownload.esm-C2Gywq_5.js","assets/number-overlay-editor-B6CLC0X9.js","assets/es6-dD9evgqV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as d,E as ms,_ as $e,f as Ny,g as lr,i as vs,h as hi,m as By,n as Wy,o as $y,p as Hh,q as Fh,R as Bt,s as jy,t as Ah,v as Uy,w as Xy,x as Gy,y as Yy,z as Ky,A as qy,e as Ir,B as bs,C as Zy,D as Qy,F as _e,G as Lh,H as st,I as fi,J as Zr,K as ws,j as ye,c as Un,M as Jy,N as ex,O as tx,Q as zh,S as nx,T as rx,U as ox,V as ix,W as _h,X as ax,Y as lx,Z as ys,$ as Vh,a0 as Nh,a1 as sx,a2 as cx,a3 as ux,a4 as dx,a5 as hx,a6 as fx,a7 as px,a8 as gx,a9 as mx,aa as Bh,ab as vx,ac as bx,ad as wx,ae as yx,af as xx,ag as Cx,ah as kx,ai as Sx,aj as Mx,ak as Rx,al as Ex,am as Ix,an as Tx,ao as Ox,ap as Qr,aq as cn,ar as xn,l as ba,as as pi,at as sr,au as Dx,av as Px,aw as Hx,ax as Fx,ay as Ax,az as Lx,aA as wa,aB as gi,aC as Ft,aD as zx,aE as _x,aF as Vx,aG as Nx,aH as Jr,aI as St,aJ as vn,aK as Wh,aL as $h,aM as ya,aN as Bx,aO as jh,aP as Uh,aQ as Wx,aR as xs,aS as $x,aT as jx,aU as Xh,aV as Ux,aW as Gh,aX as Xx,aY as Yh,aZ as Gx,a_ as Yx,a$ as Kx,d as Kh,b0 as Cs,b1 as So,b2 as qx,b3 as Zx,b4 as ks,b5 as xa,b6 as Ca,b7 as qh,b8 as ka,b9 as Xn,ba as Zh,bb as Qx,bc as Jx,bd as Qh,be as eC,bf as tC,L as nC,bg as rC,__tla as oC}from"./index-clm6On2Y.js";import{w as iC,E as aC}from"./withFullScreenWrapper-CKQjmc-1.js";import{T as lC,a as Mo}from"./Toolbar-AvCHJeN3.js";import{u as sC}from"./FormClearHelper-DBsQ33IR.js";import{m as cC}from"./mergeWith-BGcS1SpY.js";import{s as uC}from"./sprintf-D7DtBTRn.js";import{S as dC,L as hC,a as fC}from"./checkbox-mkpBvvtC.js";import{c as pC}from"./createDownloadLinkElement-ZaXNnPK4.js";import{_ as cr,C as gC}from"./slicedToArray-DOoFLiRi.js";import{_ as mC,a as vC,b as bC}from"./inherits-D8N0057t.js";import{_ as wC}from"./createSuper-BqkNEFMI.js";import{D as yC,F as xC}from"./FileDownload.esm-C2Gywq_5.js";let Ss,Sa,Tr,Ms,Jh,Or,Rs,rn,CC=Promise.all([(()=>{try{return oC}catch{}})()]).then(async()=>{var Es=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Es.displayName="Add";var Is=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Is.displayName="Search";var Ts=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(ms,$e({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"}))});Ts.displayName="Visibility";var Ma,Os;function ef(){if(Os)return Ma;Os=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return Ma=n,Ma}var Ra,Ds;function tf(){if(Ds)return Ra;Ds=1;var e=ef(),t=Ny();function n(r,o){return r!=null&&t(r,o,e)}return Ra=n,Ra}var nf=tf();const rf=lr(nf);function Ps(e="This should not happen"){throw new Error(e)}function En(e,t="Assertion failed"){if(!e)return Ps(t)}function Ro(e,t){return Ps(t??"Hell froze over")}function of(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function eo(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--&&eo(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!eo(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const mi=null,Ea=void 0;var Z;(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"})(Z||(Z={}));var Fs;(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"})(Fs||(Fs={}));var vi;(function(e){e.Triangle="triangle",e.Dots="dots"})(vi||(vi={}));function bi(e){return"width"in e&&typeof e.width=="number"}async function As(e){return typeof e=="object"?e:await e()}Or=function(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)},Tr=function(e){return e.kind===An.Marker||e.kind===An.NewRow};function to(e){if(!Or(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:Ro(e,"A cell was passed with an invalid kind")}}Ms=function(e){return rf(e,"editor")};function Ia(e){return!(e.readonly??!1)}var An;(function(e){e.NewRow="new-row",e.Marker="marker"})(An||(An={}));function af(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 Ls;class ot{items;constructor(t){this.items=t}static empty=()=>Ls??(Ls=new ot([]));static fromSingleSelection=t=>ot.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new ot(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=af([...this.items,n]);return new ot(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,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new ot(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,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 lf=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[,l]=i.split("_");t[l]=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(" ")},zs=lf,sf=e=>e.toUpperCase()===e,cf=e=>t=>e.indexOf(t)===-1,_s=(e,t)=>{const n={};return Object.keys(e).filter(cf(t)).forEach(r=>{n[r]=e[r]}),n};function uf(e,t,n){const r=_s(t,n);if(!e){const o=typeof vs=="function"?{default:vs}:vs;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var df=(e,t)=>{};function hf(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!sf(a[0])):n.propsAsIs,u=uf(c,i,["as","class"]);u.ref=l,u.className=n.atomic?zs(n.class,u.className||s):zs(u.className||s,n.class);const{vars:h}=n;if(h){const p={};for(const m in h){const b=h[m],y=b[0],w=b[1]||"",k=typeof y=="function"?y(i):y;df(k,n.name),p[`--${m}`]=`${k}${w}`}const f=u.style||{},g=Object.keys(f);g.length>0&&g.forEach(m=>{p[m]=f[m]}),u.style=p}return e.__wyw_meta&&e!==a?(u.as=a,d.createElement(e,u)):d.createElement(a,u)},o=d.forwardRef?d.forwardRef(r):i=>{const l=_s(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}rn=hf;const ff=rn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Vs={},Eo={},Ta={},Oa={},Ns;function pf(){return Ns||(Ns=1,function(e){(function(t,n){n(e,hi(),By())})(Oa,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=g;var o=l(n),i=l(r);function l(w){return w&&w.__esModule?w:{default:w}}var a=Object.assign||function(w){for(var k=1;k<arguments.length;k++){var I=arguments[k];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(w[E]=I[E])}return w};function s(w,k){var I={};for(var E in w)k.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(w,E)&&(I[E]=w[E]);return I}function c(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(k,I){for(var E=0;E<I.length;E++){var x=I[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}return function(k,I,E){return I&&w(k.prototype,I),E&&w(k,E),k}}();function h(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:w}function p(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}var f=!1;function g(w){f=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){g(!0)}}))}catch{}function m(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?w:w.capture}function b(w){if("touches"in w){var k=w.touches[0],I=k.pageX,E=k.pageY;return{x:I,y:E}}var x=w.screenX,H=w.screenY;return{x,y:H}}var y=function(w){p(k,w);function k(){var I;c(this,k);for(var E=arguments.length,x=Array(E),H=0;H<E;H++)x[H]=arguments[H];var O=h(this,(I=k.__proto__||Object.getPrototypeOf(k)).call.apply(I,[this].concat(x)));return O._handleSwipeStart=O._handleSwipeStart.bind(O),O._handleSwipeMove=O._handleSwipeMove.bind(O),O._handleSwipeEnd=O._handleSwipeEnd.bind(O),O._onMouseDown=O._onMouseDown.bind(O),O._onMouseMove=O._onMouseMove.bind(O),O._onMouseUp=O._onMouseUp.bind(O),O._setSwiperRef=O._setSwiperRef.bind(O),O}return u(k,[{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(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var E=b(I),x=E.x,H=E.y;this.moveStart={x,y:H},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var E=b(I),x=E.x,H=E.y,O=x-this.moveStart.x,M=H-this.moveStart.y;this.moving=!0;var F=this.props.onSwipeMove({x:O,y:M},I);F&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:O,deltaY:M}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,I):this.movePosition.deltaY>E&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var E=I.className,x=I.style,H=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var O=s(I,["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:x},O),H)}}]),k}(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})}(Oa)),Oa}var Bs;function Ws(){return Bs||(Bs=1,function(e){(function(t,n){n(e,pf())})(Ta,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})}(Ta)),Ta}var Io={},$s;function js(){if($s)return Io;$s=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.default=void 0;var e=t(Wy());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,l){return i in o?Object.defineProperty(o,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[i]=l,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,l){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Io.default=r,Io}var To={},Oo={},Us;function gf(){if(Us)return Oo;Us=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Oo.outerWidth=e,Oo}var Do={},Xs;function Da(){if(Xs)return Do;Xs=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.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],l="translate3d",a="("+i.join(",")+")";return l+a};return Do.default=e,Do}var Po={},Gs;function Ys(){if(Gs)return Po;Gs=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=void 0;var e=function(){return window};return Po.default=e,Po}var Ks;function qs(){if(Ks)return To;Ks=1,Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var e=s(hi()),t=l(js()),n=gf(),r=l(Da()),o=l(Ws()),i=l(Ys());function l(O){return O&&O.__esModule?O:{default:O}}function a(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return a=function(){return O},O}function s(O){if(O&&O.__esModule)return O;if(O===null||c(O)!=="object"&&typeof O!="function")return{default:O};var M=a();if(M&&M.has(O))return M.get(O);var F={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in O)if(Object.prototype.hasOwnProperty.call(O,C)){var R=T?Object.getOwnPropertyDescriptor(O,C):null;R&&(R.get||R.set)?Object.defineProperty(F,C,R):F[C]=O[C]}return F.default=O,M&&M.set(O,F),F}function c(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(M){return typeof M}:c=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},c(O)}function u(){return u=Object.assign||function(O){for(var M=1;M<arguments.length;M++){var F=arguments[M];for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(O[T]=F[T])}return O},u.apply(this,arguments)}function h(O,M){if(!(O instanceof M))throw new TypeError("Cannot call a class as a function")}function p(O,M){for(var F=0;F<M.length;F++){var T=M[F];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,T.key,T)}}function f(O,M,F){return M&&p(O.prototype,M),O}function g(O,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(M&&M.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),M&&m(O,M)}function m(O,M){return m=Object.setPrototypeOf||function(F,T){return F.__proto__=T,F},m(O,M)}function b(O){var M=k();return function(){var F=I(O),T;if(M){var C=I(this).constructor;T=Reflect.construct(F,arguments,C)}else T=F.apply(this,arguments);return y(this,T)}}function y(O,M){return M&&(c(M)==="object"||typeof M=="function")?M:w(O)}function w(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(O){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},I(O)}function E(O,M,F){return M in O?Object.defineProperty(O,M,{value:F,enumerable:!0,configurable:!0,writable:!0}):O[M]=F,O}var x=function(O){return O.hasOwnProperty("key")},H=function(O){g(F,O);var M=b(F);function F(T){var C;return h(this,F),C=M.call(this,T),E(w(C),"itemsWrapperRef",void 0),E(w(C),"itemsListRef",void 0),E(w(C),"thumbsRef",void 0),E(w(C),"setItemsWrapperRef",function(R){C.itemsWrapperRef=R}),E(w(C),"setItemsListRef",function(R){C.itemsListRef=R}),E(w(C),"setThumbsRef",function(R,D){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[D]=R}),E(w(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var R=e.Children.count(C.props.children),D=C.itemsWrapperRef.clientWidth,S=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),Q=Math.floor(D/S),$=Q<R,q=$?R-Q:0;C.setState(function(ie,ee){return{itemSize:S,visibleItems:Q,firstItem:$?C.getFirstItem(ee.selectedItem):0,lastPosition:q,showArrows:$}})}}),E(w(C),"handleClickItem",function(R,D,S){if(!x(S)||S.key==="Enter"){var Q=C.props.onSelectItem;typeof Q=="function"&&Q(R,D)}}),E(w(C),"onSwipeStart",function(){C.setState({swiping:!0})}),E(w(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),E(w(C),"onSwipeMove",function(R){var D=R.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var S=0,Q=e.Children.count(C.props.children),$=-(C.state.firstItem*100)/C.state.visibleItems,q=Math.max(Q-C.state.visibleItems,0),ie=-q*100/C.state.visibleItems;$===S&&D>0&&(D=0),$===ie&&D<0&&(D=0);var ee=C.itemsWrapperRef.clientWidth,K=$+100/(ee/D);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(se){C.itemsListRef.style[se]=(0,r.default)(K,"%",C.props.axis)}),!0}),E(w(C),"slideRight",function(R){C.moveTo(C.state.firstItem-(typeof R=="number"?R:1))}),E(w(C),"slideLeft",function(R){C.moveTo(C.state.firstItem+(typeof R=="number"?R:1))}),E(w(C),"moveTo",function(R){R=R<0?0:R,R=R>=C.state.lastPosition?C.state.lastPosition:R,C.setState({firstItem:R})}),C.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return f(F,[{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 C=T;return T>=this.state.lastPosition&&(C=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(C=this.state.firstItem),T<this.state.firstItem&&(C=T),C}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(C,R){var D=t.default.ITEM(!1,R===T.state.selectedItem),S={key:R,ref:function(Q){return T.setThumbsRef(Q,R)},className:D,onClick:T.handleClickItem.bind(T,R,T.props.children[R]),onKeyDown:T.handleClickItem.bind(T,R,T.props.children[R]),"aria-label":"".concat(T.props.labels.item," ").concat(R+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",u({},S,{role:"button",tabIndex:0}),C)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var C=e.Children.count(this.props.children)>1,R=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,S={},Q=-this.state.firstItem*(this.state.itemSize||0),$=(0,r.default)(Q,"px",this.props.axis),q=this.props.transitionTime+"ms";return S={WebkitTransform:$,MozTransform:$,MsTransform:$,OTransform:$,transform:$,msTransform:$,WebkitTransitionDuration:q,MozTransitionDuration:q,MsTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q},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(!R),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),C?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:S,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ie){return T.setItemsListRef(ie)},style:S},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})))}}]),F}(e.Component);return To.default=H,E(H,"displayName","Thumbs"),E(H,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),To}var Ho={},Zs;function mf(){if(Zs)return Ho;Zs=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=void 0;var e=function(){return document};return Ho.default=e,Ho}var In={},Qs;function Js(){if(Qs)return In;Qs=1,Object.defineProperty(In,"__esModule",{value:!0}),In.setPosition=In.getPosition=In.isKeyboardEvent=In.defaultStatusFormatter=In.noop=void 0;var e=hi(),t=n(Da());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};In.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};In.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};In.isKeyboardEvent=i;var l=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,p=u-1;return s&&(s!==p||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===p&&(h+=100-c.centerSlidePercentage),h}return-s*100};In.getPosition=l;var a=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return In.setPosition=a,In}var Vn={},ec;function vf(){if(ec)return Vn;ec=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.fadeAnimationHandler=Vn.slideStopSwipingHandler=Vn.slideSwipeAnimationHandler=Vn.slideAnimationHandler=void 0;var e=hi(),t=r(Da()),n=Js();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,p){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);p&&(g=g.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,g)}return f}function i(h){for(var p=1;p<arguments.length;p++){var f=arguments[p]!=null?arguments[p]:{};p%2?o(Object(f),!0).forEach(function(g){l(h,g,f[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(f,g))})}return h}function l(h,p,f){return p in h?Object.defineProperty(h,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[p]=f,h}var a=function(h,p){var f={},g=p.selectedItem,m=g,b=e.Children.count(h.children)-1,y=h.infiniteLoop&&(g<0||g>b);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(b+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(b+2)*100,h.axis):m>b&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var w=(0,n.getPosition)(g,h),k=(0,t.default)(w,"%",h.axis),I=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:k,msTransform:k,OTransform:k,transform:k},p.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),f};Vn.slideAnimationHandler=a;var s=function(h,p,f,g){var m={},b=p.axis==="horizontal",y=e.Children.count(p.children),w=0,k=(0,n.getPosition)(f.selectedItem,p),I=p.infiniteLoop?(0,n.getPosition)(y-1,p)-100:(0,n.getPosition)(y-1,p),E=b?h.x:h.y,x=E;k===w&&E>0&&(x=0),k===I&&E<0&&(x=0);var H=k+100/(f.itemSize/x),O=Math.abs(E)>p.swipeScrollTolerance;return p.infiniteLoop&&O&&(f.selectedItem===0&&H>-100?H-=y*100:f.selectedItem===y-1&&H<-y*100&&(H+=y*100)),(!p.preventMovementUntilSwipeScrollTolerance||O||f.swipeMovementStarted)&&(f.swipeMovementStarted||g({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(H,p.axis)),O&&!f.cancelClick&&g({cancelClick:!0}),m};Vn.slideSwipeAnimationHandler=s;var c=function(h,p){var f=(0,n.getPosition)(p.selectedItem,h),g=(0,n.setPosition)(f,h.axis);return{itemListStyle:g}};Vn.slideStopSwipingHandler=c;var u=function(h,p){var f=h.transitionTime+"ms",g="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:g,msTransitionTimingFunction:g,MozTransitionTimingFunction:g,WebkitTransitionTimingFunction:g,OTransitionTimingFunction:g};return p.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 Vn.fadeAnimationHandler=u,Vn}var tc;function bf(){if(tc)return Eo;tc=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.default=void 0;var e=u(hi()),t=s(Ws()),n=s(js()),r=s(qs()),o=s(mf()),i=s(Ys()),l=Js(),a=vf();function s(T){return T&&T.__esModule?T:{default:T}}function c(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return c=function(){return T},T}function u(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var C=c();if(C&&C.has(T))return C.get(T);var R={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in T)if(Object.prototype.hasOwnProperty.call(T,S)){var Q=D?Object.getOwnPropertyDescriptor(T,S):null;Q&&(Q.get||Q.set)?Object.defineProperty(R,S,Q):R[S]=T[S]}return R.default=T,C&&C.set(T,R),R}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(C){return typeof C}:h=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},h(T)}function p(){return p=Object.assign||function(T){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var D in R)Object.prototype.hasOwnProperty.call(R,D)&&(T[D]=R[D])}return T},p.apply(this,arguments)}function f(T,C){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);C&&(D=D.filter(function(S){return Object.getOwnPropertyDescriptor(T,S).enumerable})),R.push.apply(R,D)}return R}function g(T){for(var C=1;C<arguments.length;C++){var R=arguments[C]!=null?arguments[C]:{};C%2?f(Object(R),!0).forEach(function(D){M(T,D,R[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(R)):f(Object(R)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(R,D))})}return T}function m(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function b(T,C){for(var R=0;R<C.length;R++){var D=C[R];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,C,R){return C&&b(T.prototype,C),T}function w(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),C&&k(T,C)}function k(T,C){return k=Object.setPrototypeOf||function(R,D){return R.__proto__=D,R},k(T,C)}function I(T){var C=H();return function(){var R=O(T),D;if(C){var S=O(this).constructor;D=Reflect.construct(R,arguments,S)}else D=R.apply(this,arguments);return E(this,D)}}function E(T,C){return C&&(h(C)==="object"||typeof C=="function")?C:x(T)}function x(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function H(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(T){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},O(T)}function M(T,C,R){return C in T?Object.defineProperty(T,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[C]=R,T}var F=function(T){w(R,T);var C=I(R);function R(D){var S;m(this,R),S=C.call(this,D),M(x(S),"thumbsRef",void 0),M(x(S),"carouselWrapperRef",void 0),M(x(S),"listRef",void 0),M(x(S),"itemsRef",void 0),M(x(S),"timer",void 0),M(x(S),"animationHandler",void 0),M(x(S),"setThumbsRef",function($){S.thumbsRef=$}),M(x(S),"setCarouselWrapperRef",function($){S.carouselWrapperRef=$}),M(x(S),"setListRef",function($){S.listRef=$}),M(x(S),"setItemsRef",function($,q){S.itemsRef||(S.itemsRef=[]),S.itemsRef[q]=$}),M(x(S),"autoPlay",function(){e.Children.count(S.props.children)<=1||(S.clearAutoPlay(),S.props.autoPlay&&(S.timer=setTimeout(function(){S.increment()},S.props.interval)))}),M(x(S),"clearAutoPlay",function(){S.timer&&clearTimeout(S.timer)}),M(x(S),"resetAutoPlay",function(){S.clearAutoPlay(),S.autoPlay()}),M(x(S),"stopOnHover",function(){S.setState({isMouseEntered:!0},S.clearAutoPlay)}),M(x(S),"startOnLeave",function(){S.setState({isMouseEntered:!1},S.autoPlay)}),M(x(S),"isFocusWithinTheCarousel",function(){return S.carouselWrapperRef?!!((0,o.default)().activeElement===S.carouselWrapperRef||S.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),M(x(S),"navigateWithKeyboard",function($){if(S.isFocusWithinTheCarousel()){var q=S.props.axis,ie=q==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},K=ie?ee.ArrowRight:ee.ArrowDown,se=ie?ee.ArrowLeft:ee.ArrowUp;K===$.keyCode?S.increment():se===$.keyCode&&S.decrement()}}),M(x(S),"updateSizes",function(){if(!(!S.state.initialized||!S.itemsRef||S.itemsRef.length===0)){var $=S.props.axis==="horizontal",q=S.itemsRef[0];if(q){var ie=$?q.clientWidth:q.clientHeight;S.setState({itemSize:ie}),S.thumbsRef&&S.thumbsRef.updateSizes()}}}),M(x(S),"setMountState",function(){S.setState({hasMount:!0}),S.updateSizes()}),M(x(S),"handleClickItem",function($,q){if(e.Children.count(S.props.children)!==0){if(S.state.cancelClick){S.setState({cancelClick:!1});return}S.props.onClickItem($,q),$!==S.state.selectedItem&&S.setState({selectedItem:$})}}),M(x(S),"handleOnChange",function($,q){e.Children.count(S.props.children)<=1||S.props.onChange($,q)}),M(x(S),"handleClickThumb",function($,q){S.props.onClickThumb($,q),S.moveTo($)}),M(x(S),"onSwipeStart",function($){S.setState({swiping:!0}),S.props.onSwipeStart($)}),M(x(S),"onSwipeEnd",function($){S.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),S.props.onSwipeEnd($),S.clearAutoPlay(),S.state.autoPlay&&S.autoPlay()}),M(x(S),"onSwipeMove",function($,q){S.props.onSwipeMove(q);var ie=S.props.swipeAnimationHandler($,S.props,S.state,S.setState.bind(x(S)));return S.setState(g({},ie)),!!Object.keys(ie).length}),M(x(S),"decrement",function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem-(typeof $=="number"?$:1))}),M(x(S),"increment",function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem+(typeof $=="number"?$:1))}),M(x(S),"moveTo",function($){if(typeof $=="number"){var q=e.Children.count(S.props.children)-1;$<0&&($=S.props.infiniteLoop?q:0),$>q&&($=S.props.infiniteLoop?0:q),S.selectItem({selectedItem:$}),S.state.autoPlay&&S.state.isMouseEntered===!1&&S.resetAutoPlay()}}),M(x(S),"onClickNext",function(){S.increment(1)}),M(x(S),"onClickPrev",function(){S.decrement(1)}),M(x(S),"onSwipeForward",function(){S.increment(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),M(x(S),"onSwipeBackwards",function(){S.decrement(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),M(x(S),"changeItem",function($){return function(q){(!(0,l.isKeyboardEvent)(q)||q.key==="Enter")&&S.moveTo($)}}),M(x(S),"selectItem",function($){S.setState(g({previousItem:S.state.selectedItem},$),function(){S.setState(S.animationHandler(S.props,S.state))}),S.handleOnChange($.selectedItem,e.Children.toArray(S.props.children)[$.selectedItem])}),M(x(S),"getInitialImage",function(){var $=S.props.selectedItem,q=S.itemsRef&&S.itemsRef[$],ie=q&&q.getElementsByTagName("img")||[];return ie[0]}),M(x(S),"getVariableItemHeight",function($){var q=S.itemsRef&&S.itemsRef[$];if(S.state.hasMount&&q&&q.children.length){var ie=q.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var K=function ue(){S.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",K)}}var se=ie[0]||q.children[0],te=se.clientHeight;return te>0?te:null}return null});var Q={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 S.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,S.state=g(g({},Q),S.animationHandler(D,Q)),S}return y(R,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,S){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),S.swiping&&!this.state.swiping&&this.setState(g({},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 S=D.getInitialImage();S&&!S.complete?S.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 S=this;return this.props.children?e.Children.map(this.props.children,function(Q,$){var q=$===S.state.selectedItem,ie=$===S.state.previousItem,ee=q&&S.state.selectedStyle||ie&&S.state.prevStyle||S.state.slideStyle||{};S.props.centerMode&&S.props.axis==="horizontal"&&(ee=g(g({},ee),{},{minWidth:S.props.centerSlidePercentage+"%"})),S.state.swiping&&S.state.swipeMovementStarted&&(ee=g(g({},ee),{},{pointerEvents:"none"}));var K={ref:function(se){return S.setItemsRef(se,$)},key:"itemKey"+$+(D?"clone":""),className:n.default.ITEM(!0,$===S.state.selectedItem,$===S.state.previousItem),onClick:S.handleClickItem.bind(S,$,Q),style:ee};return e.default.createElement("li",K,S.props.renderItem(Q,{isSelected:$===S.state.selectedItem,isPrevious:$===S.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,S=this.props,Q=S.showIndicators,$=S.labels,q=S.renderIndicator,ie=S.children;return Q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ie,function(ee,K){return q&&q(D.changeItem(K),K===D.state.selectedItem,K,$.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 S=this.props.swipeable&&e.Children.count(this.props.children)>1,Q=this.props.axis==="horizontal",$=this.props.showArrows&&e.Children.count(this.props.children)>1,q=$&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ie=$&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),K=ee.shift(),se=ee.pop(),te={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},ue={};if(Q){if(te.onSwipeLeft=this.onSwipeForward,te.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var fe=this.getVariableItemHeight(this.state.selectedItem);ue.height=fe||"auto"}}else te.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,te.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,te.style=g(g({},te.style),{},{height:this.state.itemSize}),ue.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,q,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ue},S?e.default.createElement(t.default,p({tagName:"ul",innerRef:this.setListRef},te,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&K):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(ae){return D.setListRef(ae)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&K)),this.props.renderArrowNext(this.onClickNext,ie,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),R}(e.default.Component);return Eo.default=F,M(F,"displayName","Carousel"),M(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(T,C,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_PREV(!C),onClick:T})},renderArrowNext:function(T,C,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_NEXT(!C),onClick:T})},renderIndicator:function(T,C,R,D){return e.default.createElement("li",{className:n.default.DOT(C),onClick:T,onKeyDown:T,value:R,key:R,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(R+1)})},renderItem:function(T){return T},renderThumbs:function(T){var C=e.Children.map(T,function(R){var D=R;if(R.type!=="img"&&(D=e.Children.toArray(R.props.children).find(function(S){return S.type==="img"})),!!D)return D});return C.filter(function(R){return R}).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"),[]):C},statusFormatter:l.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}),Eo}var wf={},nc;function yf(){return nc||(nc=1),wf}var rc;function xf(){return rc||(rc=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(bf()),n=yf(),r=o(qs());function o(i){return i&&i.__esModule?i:{default:i}}}(Vs)),Vs}var Cf=xf(),Pa,oc;function kf(){if(oc)return Pa;oc=1;var e=$y(),t=function(){return e.Date.now()};return Pa=t,Pa}var Ha,ic;function ac(){if(ic)return Ha;ic=1;var e=Hh(),t=kf(),n=Fh(),r="Expected a function",o=Math.max,i=Math.min;function l(a,s,c){var u,h,p,f,g,m,b=0,y=!1,w=!1,k=!0;if(typeof a!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,w="maxWait"in c,p=w?o(n(c.maxWait)||0,s):p,k="trailing"in c?!!c.trailing:k);function I(R){var D=u,S=h;return u=h=void 0,b=R,f=a.apply(S,D),f}function E(R){return b=R,g=setTimeout(O,s),y?I(R):f}function x(R){var D=R-m,S=R-b,Q=s-D;return w?i(Q,p-S):Q}function H(R){var D=R-m,S=R-b;return m===void 0||D>=s||D<0||w&&S>=p}function O(){var R=t();if(H(R))return M(R);g=setTimeout(O,x(R))}function M(R){return g=void 0,k&&u?I(R):(u=h=void 0,f)}function F(){g!==void 0&&clearTimeout(g),b=0,u=m=h=g=void 0}function T(){return g===void 0?f:M(t())}function C(){var R=t(),D=H(R);if(u=arguments,h=this,m=R,D){if(g===void 0)return E(m);if(w)return clearTimeout(g),g=setTimeout(O,s),I(m)}return g===void 0&&(g=setTimeout(O,s)),f}return C.cancel=F,C.flush=T,C}return Ha=l,Ha}var Sf=ac();const lc=lr(Sf);function bn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{i.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function ur(e,t){return e===void 0?void 0:t}const Mf=Math.PI;function sc(e){return e*Mf/180}const cc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),uc=(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}},dc=(e,t,n)=>Math.min(e,t-n*2),hc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Fa=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"}))},Rf=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 Ef(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const l=d.useRef(lc(a=>{i.current&&o(a)},n));return d.useLayoutEffect(()=>{i.current&&l.current(()=>e())},t),r}const If="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Tf="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Of=new RegExp("^[^"+Tf+"]*["+If+"]");function Aa(e){return Of.test(e)?"rtl":"not-rtl"}let wi;function La(){if(typeof document>"u")return 0;if(wi!==void 0)return wi;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(),wi=n-r,wi}const Dr=Symbol();function Df(e){const t=d.useRef([Dr,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 s=t.current[0];s!==Dr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Dr&&o({}),r(c=>typeof a=="function"?a(s===Dr?c:s):a),t.current[0]=Dr)},[]),l=d.useCallback(()=>{t.current[0]=Dr,o({})},[]);return[t.current[0]===Dr?n:t.current[0],i,l]}function fc(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 Pf(e){const t=d.useRef(e);return eo(e,t.current)||(t.current=e),t.current}const Hf=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(ff,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Cf.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=o?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Fa,null)))};function pc(){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 Pr=pc();function Ff(e){Pr=e}const gc=/[&<>"']/,Af=new RegExp(gc.source,"g"),mc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Lf=new RegExp(mc.source,"g"),zf={"&":"&","<":"<",">":">",'"':""","'":"'"},vc=e=>zf[e];function hn(e,t){if(t){if(gc.test(e))return e.replace(Af,vc)}else if(mc.test(e))return e.replace(Lf,vc);return e}const _f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function bc(e){return e.replace(_f,(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 Vf=/(^|[^\[])\^/g;function Pt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(Vf,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const Nf=/[^\w:]/g,Bf=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wc(e,t,n){if(e){let r;try{r=decodeURIComponent(bc(n)).replace(Nf,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Bf.test(n)&&(n=Uf(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const yi={},Wf=/^[^:]+:\/*[^/]*$/,$f=/^([^:]+:)[\s\S]*$/,jf=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Uf(e,t){yi[" "+e]||(Wf.test(e)?yi[" "+e]=e+"/":yi[" "+e]=Ci(e,"/",!0)),e=yi[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace($f,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(jf,"$1")+t:e+t}const xi={exec:function(){}};function yc(e,t){const n=e.replace(/\|/g,(i,l,a)=>{let s=!1,c=l;for(;--c>=0&&a[c]==="\\";)s=!s;return s?"|":" |"}),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 Ci(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 Xf(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 Gf(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 xc(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Cc(e,t,n,r){const o=t.href,i=t.title?hn(t.title):null,l=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:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:hn(l)}}function Yf(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
3
|
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[l]=i;return l.length>=r.length?o.slice(r.length):o}).join(`
|
|
4
4
|
`)}class za{constructor(t){this.options=t||Pr}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:Ci(r,`
|
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Yf(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=Ci(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,l,a,s,c,u,h,p,f,g,m=n[1].trim();const b=m.length>1,y={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const w=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(g=!1,!(!(n=w.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),u=n[2].split(`
|
|
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An err
|
|
|
169
169
|
`?(r.push(e.slice(o,l)),o=l+1,a===`
|
|
170
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
171
|
`)&&(r.push(wu(e.slice(o,l))),o=l+1,a===`
|
|
172
|
-
`&&(n.push(r),r=[])),i=t.None);break}l++}return o<e.length&&r.push(wu(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function yu(e,t,n){const r=hm(e,t),o=a=>{window.navigator.clipboard?.writeText(a)},i=(a,s)=>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([s],{type:"text/html"})})]),!0),l=(a,s)=>{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",s)}catch{i(a,s)||o(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function xu(e){return e!==!0}function Cu(e){return typeof e=="string"?e:`${e}px`}const gm=()=>e=>e.innerWidth,mm=()=>e=>e.innerHeight,vm=rn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[gm()],"wmyidgi-1":[mm()]}}),bm=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(vm,{innerHeight:Cu(n),innerWidth:Cu(t),...o},r)},wm=2,ym=1300;function xm(e,t,n){const r=Bt.useRef(0),[o,i]=e??[0,0];Bt.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let l=!1,a=0;const s=c=>{if(!l){if(a===0)a=c;else{const u=c-a;r.current=Math.min(1,r.current+u/ym);const h=r.current**1.618*u*wm;t.current?.scrollBy(o*h,i*h),a=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,o,i,n])}function Cm({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:l,remSize:a}){const[s,c,u,h,p,f]=Bt.useMemo(()=>{if(!l||a===16)return[e,t,n,r,o,i];const g=a/16,m=e,b=Wc();return[typeof m=="number"?m*g:y=>Math.ceil(m(y)*g),Math.ceil(t*g),Math.ceil(n*g),{...r,headerIconSize:(r?.headerIconSize??b.headerIconSize)*g,cellHorizontalPadding:(r?.cellHorizontalPadding??b.cellHorizontalPadding)*g,cellVerticalPadding:(r?.cellVerticalPadding??b.cellVerticalPadding)*g},Math.ceil((o??0)*g),Math.ceil((i??0)*g)]},[n,t,o,i,a,e,l,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:p,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 lt(e,t){return e===!0?t:e===!1?"":e}function ku(e){const t=Ii.value;return{activateCell:lt(e.activateCell," |Enter|shift+Enter"),clear:lt(e.clear,"any+Escape"),closeOverlay:lt(e.closeOverlay,"any+Escape"),acceptOverlayDown:lt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:lt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:lt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:lt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:lt(e.delete,t?"Backspace|Delete":"Delete"),downFill:lt(e.downFill,"primary+_68"),scrollToSelectedCell:lt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:lt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:lt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:lt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:lt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:lt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:lt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:lt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:lt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:lt(e.goToFirstCell,"primary+Home"),goToFirstColumn:lt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:lt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:lt(e.goToLastCell,"primary+End"),goToLastColumn:lt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:lt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:lt(e.goToNextPage,"PageDown"),goToPreviousPage:lt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:lt(e.rightFill,"primary+_82"),search:lt(e.search,"primary+f"),selectAll:lt(e.selectAll,"primary+a"),selectColumn:lt(e.selectColumn,"ctrl+ "),selectGrowDown:lt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:lt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:lt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:lt(e.selectGrowUp,"shift+ArrowUp"),selectRow:lt(e.selectRow,"shift+ "),selectToFirstCell:lt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:lt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:lt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:lt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:lt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:lt(e.selectToLastRow,"primary+shift+ArrowDown")}}function km(e){const t=Pf(e);return Bt.useMemo(()=>{if(t===void 0)return ku(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 ku({...mr,...n})},[t])}function Sm(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((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function sl(e,t){const n=[];function r(a,s,c=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let h=0;h<a.subGroups.length;h++){const p=h<a.subGroups.length-1?a.subGroups[h+1].headerIndex:s;r(a.subGroups[h],p,c||a.isCollapsed)}}const o=Sm(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function cl(e,t){if(t===void 0||sl.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 Mm(e,t,n,r){const o=Bt.useMemo(()=>e===void 0?void 0:sl(e,t),[e,t]),i=Bt.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),l=Bt.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),a=Bt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=Bt.useCallback(u=>{if(o===void 0)return u;let h=u;for(const p of o){if(h===0)return;if(h--,!p.isCollapsed){if(h<p.rows)return p.contentIndex+h;h-=p.rows}}return u},[o]),c=ur(r??e?.themeOverride,Bt.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:p,groupIndex:f}=cl(u,o);return h?e.themeOverride:r?.(u,f,p)},[o,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:c}}function Rm(e,t){const n=Bt.useMemo(()=>e===void 0?void 0:sl(e,t),[e,t]);return{getRowGroupingForPath:Mu,updateRowGroupingByPath:Su,mapper:Bt.useCallback(r=>{if(typeof r=="number")return cl(r,n);const o=cl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function Su(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:Su(i.subGroups??[],o,n)}:i)}function Mu(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Mu(e[n].subGroups??[],r)}function Em(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 Im(e,t,n,r,o){const[i,l]=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:l}),[r,l,i]),[s,c,u]=Df(a),h=d.useRef(o);h.current=o;const p=Em(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&p.current!==null&&f){if(p.current.scrollTop===t)return;p.current.scrollTop=t,p.current.scrollTop!==t&&u(),h.current()}},[t,f,u,p]);const g=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&p.current!==null&&g){if(p.current.scrollLeft===e)return;p.current.scrollLeft=e,p.current.scrollLeft!==e&&u(),h.current()}},[e,g,u,p]),{visibleRegion:s,setVisibleRegion:c,scrollRef:p}}const Tm=d.lazy(async()=>await bs(()=>import("./data-grid-overlay-editor-P0wPqvRS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));let Om=0;function Dm(e){return Fp(qc(qc(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Oi(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 Di={kind:Z.Loading,allowOverlay:!1},Pi={columns:ot.empty(),rows:ot.empty(),current:void 0},Pm=(e,t)=>{const[n,r]=d.useState(Pi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:p,getRowThemeOverride:f,markdownDivCreateNode:g,width:m,height:b,columns:y,rows:w,getCellContent:k,onCellClicked:I,onCellActivated:E,onFillPattern:x,onFinishedEditing:H,coercePasteValue:O,drawHeader:M,drawCell:F,editorBloom:T,onHeaderClicked:C,onColumnProposeMove:R,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:S="default",onGroupHeaderClicked:Q,onCellContextMenu:$,className:q,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:se,onCellEdited:te,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:ae,onSearchValueChange:z,searchValue:P,onKeyDown:G,onKeyUp:le,keybindings:de,editOnType:Oe=!0,onRowAppended:ge,onColumnAppended:it,onColumnMoved:Re,validateCell:Lt,highlightRegions:Ye,rangeSelect:Xe="rect",columnSelect:ne="multi",rowSelect:pe="multi",rangeSelectionBlending:Ce="exclusive",columnSelectionBlending:ce="exclusive",rowSelectionBlending:xe="exclusive",onDelete:Ie,onDragStart:Ae,onMouseMove:et,onPaste:Pe,copyHeaders:je=!1,freezeColumns:Ne=0,cellActivationBehavior:Te="second-click",rowSelectionMode:Ee="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:pt,getGroupDetails:Ke,rowGrouping:Ct,onSearchClose:qt,onItemHovered:zt,onSelectionCleared:Mt,showSearch:fn,onVisibleRegionChanged:jt,gridSelection:on,onGridSelectionChange:Tt,minColumnWidth:wt=50,maxColumnWidth:an=500,maxColumnAutoWidth:ct,provideEditor:ln,trailingRowOptions:Wt,freezeTrailingRows:Le=0,allowedFillDirections:Rt="orthogonal",scrollOffsetX:_t,scrollOffsetY:On,verticalBorder:Ut,onDragOverCell:pn,onDrop:Dn,onColumnResize:Jt,onColumnResizeEnd:en,onColumnResizeStart:Ue,customRenderers:Ot,fillHandle:Cn,experimental:vt,fixedShadowX:Ht,fixedShadowY:kn,headerIcons:rr,imageWindowLoader:Bn,initialSize:N,isDraggable:Be,onDragLeave:Ge,onRowMoved:yt,overscrollX:wn,overscrollY:un,preventDiagonalScrolling:ve,rightElement:ut,rightElementProps:bt,trapFocus:Zt=!1,smoothScrollX:Xt,smoothScrollY:or,scaleToRem:Qi=!1,rowHeight:Yl=34,headerHeight:Ji=36,groupHeaderHeight:Vr=Ji,theme:br,isOutsideClick:Kl,renderers:Jo,resizeIndicator:ea,scrollToActiveCell:ei=!0,drawFocusRing:Nr=!0,portalElementRef:ta}=e,so=Nr==="no-editor"?o===void 0:Nr,Wn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Wn?.kind??e.rowMarkers??"none",wr=Wn?.width??e.rowMarkerWidth,ir=Wn?.startIndex??e.rowMarkerStartIndex??1,co=Wn?.theme??e.rowMarkerTheme,yr=Wn?.headerTheme,uo=Wn?.headerAlwaysVisible,ti=pe!=="multi"||Wn?.headerDisabled===!0,Br=Wn?.checkboxStyle??"square",xr=Math.max(wt,20),ho=Math.max(an,xr),ql=Math.max(ct??ho,xr),ni=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:ze,rowNumberMapper:ri,rowHeight:na,getRowThemeOverride:Wr}=Mm(Ct,w,Yl,f),Zl=d.useMemo(()=>Number.parseFloat(ni.fontSize),[ni]),{rowHeight:qn,headerHeight:oi,groupHeaderHeight:ra,theme:fo,overscrollX:Ql,overscrollY:Jl}=Cm({groupHeaderHeight:Vr,headerHeight:Ji,overscrollX:wn,overscrollY:un,remSize:Zl,rowHeight:na,scaleToRem:Qi,theme:br}),Zn=km(de),Cr=wr??(w>1e4?48:w>1e3?44:w>100?36:32),Pn=Sn!=="none",W=Pn?1:0,Vt=Wt!==void 0,ar=Wt?.sticky===!0,[es,$r]=d.useState(!1),ts=fn??es,po=d.useCallback(()=>{qt!==void 0?qt():$r(!1)},[qt]),Y=d.useMemo(()=>on===void 0?void 0:Oi(on,W),[on,W])??n,Mn=d.useRef();Mn.current===void 0&&(Mn.current=new AbortController),d.useEffect(()=>()=>Mn?.current.abort(),[]);const[V,re]=am(ee,k,W,Mn.current,ze),ke=d.useCallback((v,A,L)=>{if(Lt===void 0)return!0;const j=[v[0]-W,v[1]];return Lt?.(j,A,L)},[W,Lt]),Me=d.useRef(on),oe=d.useCallback((v,A)=>{A&&(v=fm(v,V,W,S,Mn.current)),Tt!==void 0?(Me.current=Oi(v,-W),Tt(Me.current)):r(v)},[Tt,V,W,S]),me=ur(Jt,d.useCallback((v,A,L,j)=>{Jt?.(y[L-W],A,L-W,j)},[Jt,W,y])),Qe=ur(en,d.useCallback((v,A,L,j)=>{en?.(y[L-W],A,L-W,j)},[en,W,y])),we=ur(Ue,d.useCallback((v,A,L,j)=>{Ue?.(y[L-W],A,L-W,j)},[Ue,W,y])),Ze=ur(M,d.useCallback((v,A)=>M?.({...v,columnIndex:v.columnIndex-W},A)??!1,[M,W])),dt=ur(F,d.useCallback((v,A)=>F?.({...v,col:v.col-W},A)??!1,[F,W])),tn=d.useCallback(v=>{if(Ie!==void 0){const A=Ie(Oi(v,-W));return typeof A=="boolean"?A:Oi(A,W)}return!0},[Ie,W]),[gt,It,tt]=im(Y,oe,Ce,ce,xe,Xe,D),Je=d.useMemo(()=>tr(Wc(),fo),[fo]),[Nt,Gt]=d.useState([0,0,0]),jr=d.useMemo(()=>{if(Jo===void 0)return{};const v={};for(const A of Jo)v[A.kind]=A;return v},[Jo]),nn=d.useCallback(v=>v.kind!==Z.Custom?jr[v.kind]:Ot?.find(A=>A.isMatch(v)),[Ot,jr]);let{sizedColumns:sn,nonGrowWidth:kr}=Mp(y,ze,re,Nt[0]-(W===0?0:Cr)-Nt[2],xr,ql,Je,nn,Mn.current);Sn!=="none"&&(kr+=Cr);const Dt=d.useMemo(()=>sn.some(v=>v.group!==void 0),[sn]),Rn=Dt?oi+ra:oi,Hn=Y.rows.length,Sr=Sn==="none"?void 0:Hn===0?!1:Hn===ze?!0:void 0,nt=d.useMemo(()=>Sn==="none"?sn:[{title:"",width:Cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:co,rowMarker:Br,rowMarkerChecked:Sr,headerRowMarkerTheme:yr,headerRowMarkerAlwaysVisible:uo,headerRowMarkerDisabled:ti},...sn],[Sn,sn,Cr,co,Br,Sr,yr,uo,ti]),dn=d.useRef({height:1,width:1,x:0,y:0}),Qn=d.useRef(!1),{setVisibleRegion:bh,visibleRegion:Ur,scrollRef:$t}=Im(_t,On,qn,dn,()=>Qn.current=!0);dn.current=Ur;const cy=Ur.x+W,oa=Ur.y,gn=d.useRef(null),yn=d.useCallback(v=>{v===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),mn=Vt?ze+1:ze,_n=d.useCallback(v=>{const A=W===0?v:v.map(j=>({...j,location:[j.location[0]-W,j.location[1]]})),L=ue?.(A);if(L!==!0)for(const j of A)te?.(j.location,j.value);return L},[te,ue,W]),[Xr,ns]=d.useState(),ia=Y.current!==void 0&&Y.current.range.width*Y.current.range.height>1?Y.current.range:void 0,wh=so?Y.current?.cell:void 0,aa=wh?.[0],la=wh?.[1],uy=d.useMemo(()=>{if((Ye===void 0||Ye.length===0)&&(ia??aa??la??Xr)===void 0)return;const v=[];if(Ye!==void 0)for(const A of Ye){const L=nt.length-A.range.x-W;L>0&&v.push({color:A.color,range:{...A.range,x:A.range.x+W,width:Math.min(L,A.range.width)},style:A.style})}return Xr!==void 0&&v.push({color:Fr(Je.accentColor,0),range:Xr,style:"dashed"}),ia!==void 0&&v.push({color:Fr(Je.accentColor,.5),range:ia,style:"solid-outline"}),aa!==void 0&&la!==void 0&&v.push({color:Je.accentColor,range:{x:aa,y:la,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Xr,ia,aa,la,Ye,nt.length,Je.accentColor,W]),yh=d.useRef(nt);yh.current=nt;const Fn=d.useCallback(([v,A],L=!1)=>{const j=Vt&&A===mn-1;if(v===0&&Pn){if(j)return Di;const B=ri(A);return B===void 0?Di:{kind:An.Marker,allowOverlay:!1,checkboxStyle:Br,checked:Y?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:ir+B,drawHandle:yt!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(j){const B=v===W?Wt?.hint??"":"",X=yh.current[v];if(X?.trailingRowOptions?.disabled===!0)return Di;{const _=X?.trailingRowOptions?.hint??B,U=X?.trailingRowOptions?.addIcon??Wt?.addIcon;return{kind:An.NewRow,hint:_,allowOverlay:!1,icon:U}}}else{const B=v-W;if(L||vt?.strict===!0){const _=dn.current,U=_.x>B||B>_.x+_.width||_.y>A||A>_.y+_.height||A>=as.current,J=B===_.extras?.selected?.[0]&&A===_.extras?.selected[1];let he=!1;if(_.extras?.freezeRegions!==void 0){for(const Se of _.extras.freezeRegions)if(zr(Se,B,A)){he=!0;break}}if(U&&!J&&!he)return Di}let X=k([B,A]);return W!==0&&X.span!==void 0&&(X={...X,span:[X.span[0]+W,X.span[1]+W]}),X}},[Vt,mn,Pn,ri,Br,Y?.rows,Sn,ir,yt,W,Wt?.hint,Wt?.addIcon,vt?.strict,k]),rs=d.useCallback(v=>{let A=Ke?.(v)??{name:v};return se!==void 0&&v!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>ss({group:A.name,bounds:L.bounds})}]}),A},[Ke,se]),sa=d.useCallback(v=>{const[A,L]=v.cell,j=nt[A],B=j?.group!==void 0?rs(j.group)?.overrideTheme:void 0,X=j?.themeOverride,_=Wr?.(L);i({...v,theme:tr(Je,B,X,_,v.content.themeOverride)})},[Wr,nt,rs,Je]),go=d.useCallback((v,A,L)=>{if(Y.current===void 0)return;const[j,B]=Y.current.cell,X=Fn([j,B]);if(X.kind!==Z.Boolean&&X.allowOverlay){let _=X;if(L!==void 0)switch(_.kind){case Z.Number:{const U=of(()=>L==="-"?-0:Number.parseFloat(L),0);_={..._,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:_={..._,data:L};break}sa({target:v,content:_,initialValue:L,cell:[j,B],highlight:L===void 0,forceEditMode:L!==void 0})}else X.kind===Z.Boolean&&A&&X.readonly!==!0&&(_n([{location:Y.current.cell,value:{...X,data:xu(X.data)}}]),gn.current?.damage([{cell:Y.current.cell}]))},[Fn,Y,_n,sa]),xh=d.useCallback((v,A)=>{const L=gn.current?.getBounds(v,A);if(L===void 0||$t.current===null)return;const j=Fn([v,A]);j.allowOverlay&&sa({target:L,content:j,initialValue:void 0,highlight:!0,cell:[v,A],forceEditMode:!0})},[Fn,$t,sa]),Yt=d.useCallback((v,A,L="both",j=0,B=0,X=void 0)=>{if($t.current!==null){const _=gn.current,U=a.current,J=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,he=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,Se=typeof v!="number"&&v.unit==="px"?v.amount:void 0,kt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(_!==null&&U!==null){let rt={x:0,y:0,width:0,height:0},qe=0,We=0;if((J!==void 0||he!==void 0)&&(rt=_.getBounds((J??0)+W,he??0)??rt,rt.width===0||rt.height===0))return;const ht=U.getBoundingClientRect(),xt=ht.width/U.offsetWidth;if(Se!==void 0&&(rt={...rt,x:Se-ht.left-$t.current.scrollLeft,width:1}),kt!==void 0&&(rt={...rt,y:kt+ht.top-$t.current.scrollTop,height:1}),rt!==void 0){const Qt={x:rt.x-j,y:rt.y-B,width:rt.width+2*j,height:rt.height+2*B};let xo=0;for(let gs=0;gs<Ne;gs++)xo+=sn[gs].width;let ga=0;const di=Le+(ar?1:0);di>0&&(ga=Ar(mn,di,qn));let er=xo*xt+ht.left+W*Cr*xt,Co=ht.right,qr=ht.top+Rn*xt,ko=ht.bottom-ga*xt;const ma=rt.width+j*2;switch(X?.hAlign){case"start":Co=er+ma;break;case"end":er=Co-ma;break;case"center":er=Math.floor((er+Co)/2)-ma/2,Co=er+ma;break}const va=rt.height+B*2;switch(X?.vAlign){case"start":ko=qr+va;break;case"end":qr=ko-va;break;case"center":qr=Math.floor((qr+ko)/2)-va/2,ko=qr+va;break}er>Qt.x?qe=Qt.x-er:Co<Qt.x+Qt.width&&(qe=Qt.x+Qt.width-Co),qr>Qt.y?We=Qt.y-qr:ko<Qt.y+Qt.height&&(We=Qt.y+Qt.height-ko),L==="vertical"||typeof v=="number"&&v<Ne?qe=0:(L==="horizontal"||typeof A=="number"&&A>=mn-di)&&(We=0),(qe!==0||We!==0)&&(xt!==1&&(qe/=xt,We/=xt),$t.current.scrollTo({left:qe+$t.current.scrollLeft,top:We+$t.current.scrollTop,behavior:X?.behavior??"auto"}))}}}},[W,Le,Cr,$t,Rn,Ne,sn,mn,ar,qn]),os=d.useRef(xh),is=d.useRef(k);os.current=xh,is.current=k;const as=d.useRef(ze);as.current=ze;const Ch=d.useRef(nt.length);Ch.current=nt.length;const Mr=d.useCallback(async(v,A=!0,L)=>{if(nt[v]?.trailingRowOptions?.disabled===!0)return;const j=ge?.();let B,X=!0;j!==void 0&&(B=await j,B==="top"&&(X=!1),typeof B=="number"&&(X=!1));let _=0;const U=()=>{if(as.current<=ze){_<500&&window.setTimeout(U,_),_=50+_*2;return}const J=typeof B=="number"?B:X?ze:0;pa.current(v-W,J,"both",0,0,L?{behavior:L}:void 0),gt({cell:[v,J],range:{x:v,y:J,width:1,height:1}},!1,!1,"edit");const he=is.current([v-W,J]);he.allowOverlay&&to(he)&&he.readonly!==!0&&A&&window.setTimeout(()=>{os.current(v,J)},0)};U()},[nt,ge,W,ze,gt]),ca=d.useCallback(async(v,A=!0)=>{const L=it?.();let j,B=!0;L!==void 0&&(j=await L,j==="left"&&(B=!1),typeof j=="number"&&(B=!1));let X=0;const _=()=>{if(Ch.current<=nt.length){X<500&&window.setTimeout(_,X),X=50+X*2;return}const U=typeof j=="number"?j:B?nt.length:0;Yt(U-W,v),gt({cell:[U,v],range:{x:U,y:v,width:1,height:1}},!1,!1,"edit");const J=is.current([U-W,v]);J.allowOverlay&&to(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{os.current(U,v)},0)};_()},[nt,it,W,Yt,gt]),mo=d.useCallback(v=>{const A=sn[v]?.trailingRowOptions?.targetColumn??Wt?.targetColumn;if(typeof A=="number")return A+(Pn?1:0);if(typeof A=="object"){const L=y.indexOf(A);if(L>=0)return L+(Pn?1:0)}},[sn,y,Pn,Wt?.targetColumn]),Rr=d.useRef(),vo=d.useRef(),ii=d.useCallback((v,A)=>{const[L,j]=A;return tr(Je,nt[L]?.themeOverride,Wr?.(j),v.themeOverride)},[Wr,nt,Je]),{mapper:Gr}=Rm(Ct,w),$n=Ct?.navigationBehavior,ai=d.useCallback(v=>{const A=Ii.value?v.metaKey:v.ctrlKey,L=A&&pe==="multi",j=A&&ne==="multi",[B,X]=v.location,_=Y.columns,U=Y.rows,[J,he]=Y.current?.cell??[];if(v.kind==="cell"){if(vo.current=void 0,Yr.current=[B,X],B===0&&Pn){if(Vt===!0&&X===ze||Sn==="number"||pe==="none")return;const Se=Fn(v.location);if(Se.kind!==An.Marker)return;if(yt!==void 0){const qe=nn(Se);En(qe?.kind===An.Marker);const We=qe?.onClick?.({...v,cell:Se,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:ii(Se,v.location),preventDefault:()=>{}});if(We===void 0||We.checked===Se.checked)return}i(void 0),yn();const kt=U.hasIndex(X),rt=Rr.current;if(pe==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&rt!==void 0&&U.hasIndex(rt)){const qe=[Math.min(rt,X),Math.max(rt,X)+1];L||Ee==="multi"?It(void 0,qe,!0):It(ot.fromSingleSelection(qe),void 0,L)}else pe==="multi"&&(L||v.isTouch||Ee==="multi")?kt?It(U.remove(X),void 0,!0):(It(void 0,X,!0),Rr.current=X):kt&&U.length===1?It(ot.empty(),void 0,A):(It(ot.fromSingleSelection(X),void 0,A),Rr.current=X)}else if(B>=W&&Vt&&X===ze){const Se=mo(B);Mr(Se??B)}else if(J!==B||he!==X){const Se=Fn(v.location),kt=nn(Se);if(kt?.onSelect!==void 0){let We=!1;if(kt.onSelect({...v,cell:Se,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>We=!0,theme:ii(Se,v.location)}),We)return}if($n==="block"&&Gr(X).isGroupHeader)return;const rt=ar&&X===ze,qe=ar&&Y!==void 0&&Y.current?.cell[1]===ze;if((v.shiftKey||v.isLongTouch===!0)&&J!==void 0&&he!==void 0&&Y.current!==void 0&&!qe){if(rt)return;const We=Math.min(B,J),ht=Math.max(B,J),xt=Math.min(X,he),Qt=Math.max(X,he);gt({...Y.current,range:{x:We,y:xt,width:ht-We+1,height:Qt-xt+1}},!0,A,"click"),Rr.current=void 0,yn()}else gt({cell:[B,X],range:{x:B,y:X,width:1,height:1}},!0,A,"click"),Rr.current=void 0,i(void 0),yn()}}else if(v.kind==="header")if(Yr.current=[B,X],i(void 0),Pn&&B===0)Rr.current=void 0,vo.current=void 0,!ti&&pe==="multi"&&(U.length!==ze?It(ot.fromSingleSelection([0,ze]),void 0,A):It(ot.empty(),void 0,A),yn());else{const Se=vo.current;if(ne==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Se!==void 0&&_.hasIndex(Se)){const kt=[Math.min(Se,B),Math.max(Se,B)+1];j?tt(void 0,kt,A):tt(ot.fromSingleSelection(kt),void 0,A)}else j?(_.hasIndex(B)?tt(_.remove(B),void 0,A):tt(void 0,B,A),vo.current=B):ne!=="none"&&(_.hasIndex(B)?tt(_.remove(B),void 0,A):tt(ot.fromSingleSelection(B),void 0,A),vo.current=B);Rr.current=void 0,yn()}else v.kind===zn?Yr.current=[B,X]:v.kind===Ti&&!v.isMaybeScrollbar&&(oe(Pi,!1),i(void 0),yn(),Mt?.(),Rr.current=void 0,vo.current=void 0)},[pe,ne,Y,Pn,W,Vt,ze,Sn,Fn,yt,yn,Ee,nn,ii,It,mo,Mr,$n,Gr,ar,gt,tt,oe,Mt]),li=d.useRef(!1),Yr=d.useRef(),kh=d.useRef(Ur),Jn=d.useRef(),dy=d.useCallback(v=>{if(bo.current=!1,kh.current=dn.current,v.button!==0&&v.button!==1){Jn.current=void 0;return}const A=performance.now();Jn.current={button:v.button,time:A,location:v.location},v?.kind==="header"&&(li.current=!0);const L=v.kind==="cell"&&v.isFillHandle;!L&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:Y,fillHandle:L}),Yr.current=void 0,!v.isTouch&&v.button===0&&!L?ai(v):!v.isTouch&&v.button===1&&(Yr.current=v.location))},[Y,ai]),[ls,ss]=d.useState(),Sh=d.useCallback(v=>{if(v.kind!==zn||ne!=="multi")return;const A=Ii.value?v.metaKey:v.ctrlKey,[L]=v.location,j=Y.columns;if(L<W)return;const B=nt[L];let X=L,_=L;for(let U=L-1;U>=W&&Ao(B.group,nt[U].group);U--)X--;for(let U=L+1;U<nt.length&&Ao(B.group,nt[U].group);U++)_++;if(yn(),A)if(j.hasAll([X,_+1])){let U=j;for(let J=X;J<=_;J++)U=U.remove(J);tt(U,void 0,A)}else tt(void 0,[X,_+1],A);else tt(ot.fromSingleSelection([X,_+1]),void 0,A)},[ne,yn,Y.columns,nt,W,tt]),bo=d.useRef(!1),ua=d.useCallback(async v=>{if(V!==void 0&&me!==void 0){const A=dn.current.y,L=dn.current.height;let j=V({x:v,y:A,width:1,height:Math.min(L,ze-A)},Mn.current.signal);typeof j!="object"&&(j=await j());const B=sn[v-W],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=Je.baseFontFull;const _=$c(X,Je,B,0,j,xr,ho,!1,nn);me?.(B,_.width,v,_.width)}}},[sn,V,ho,Je,xr,me,W,ze,nn]),[hy,cs]=d.useState(),wo=d.useCallback(async(v,A)=>{const L=v.current?.range;if(L===void 0||V===void 0||A.current===void 0)return;const j=A.current.range;if(x!==void 0){let U=!1;if(x({fillDestination:{...j,x:j.x-W},patternSource:{...L,x:L.x-W},preventDefault:()=>U=!0}),U)return}let B=V(L,Mn.current.signal);typeof B!="object"&&(B=await B());const X=B,_=[];for(let U=0;U<j.width;U++)for(let J=0;J<j.height;J++){const he=[j.x+U,j.y+J];if(Oc(he,L))continue;const Se=X[J%L.height][U%L.width];Tr(Se)||!to(Se)||_.push({location:he,value:{...Se}})}_n(_),gn.current?.damage(_.map(U=>({cell:U.location})))},[V,_n,x,W]),Mh=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.width<=1)return;const v={...Y,current:{...Y.current,range:{...Y.current.range,width:1}}};wo(v,Y)},[wo,Y]),Rh=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.height<=1)return;const v={...Y,current:{...Y.current,range:{...Y.current.range,height:1}}};wo(v,Y)},[wo,Y]),fy=d.useCallback((v,A)=>{const L=s;if(c(void 0),ns(void 0),cs(void 0),li.current=!1,A)return;if(L?.fillHandle===!0&&Y.current!==void 0&&L.previousSelection?.current!==void 0){if(Xr===void 0)return;const Se={...Y,current:{...Y.current,range:tu(L.previousSelection.current.range,Xr)}};wo(L.previousSelection,Se),oe(Se,!0);return}const[j,B]=v.location,[X,_]=Yr.current??[],U=()=>{bo.current=!0},J=Se=>{const kt=Se.isTouch||X===j&&_===B;if(kt&&I?.([j-W,B],{...Se,preventDefault:U}),Se.button===1)return!bo.current;if(!bo.current){const rt=Fn(v.location),qe=nn(rt);if(qe!==void 0&&qe.onClick!==void 0&&kt){const ht=qe.onClick({...Se,cell:rt,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:ii(rt,v.location),preventDefault:U});ht!==void 0&&!Tr(ht)&&Or(ht)&&(_n([{location:Se.location,value:ht}]),gn.current?.damage([{cell:Se.location}]))}if(bo.current||Y.current===void 0)return!1;let We=!1;switch(rt.activationBehaviorOverride??Te){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=Y.current.cell,[Qt,xo]=L.previousSelection.current.cell;We=j===ht&&j===Qt&&B===xt&&B===xo&&(Se.isDoubleClick===!0||Te==="second-click");break}case"single-click":{We=!0;break}}if(We)return E?.([j-W,B]),go(Se.bounds,!1),!0}return!1},he=v.location[0]-W;if(v.isTouch){const Se=dn.current,kt=kh.current;if(Se.x!==kt.x||Se.y!==kt.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&Lo(Y.current?.cell,v.location)){$?.([he,v.location[1]],{...v,preventDefault:U});return}else if(v.kind==="header"&&Y.columns.hasIndex(j)){ie?.(he,{...v,preventDefault:U});return}else if(v.kind===zn){if(he<0)return;K?.(he,{...v,preventDefault:U});return}}v.kind==="cell"?J(v)||ai(v):v.kind===zn?Q?.(he,{...v,preventDefault:U}):(v.kind===gr&&C?.(he,{...v,preventDefault:U}),ai(v));return}if(v.kind==="header"){if(he<0)return;v.isEdge?v.isDoubleClick===!0&&ua(j):v.button===0&&j===X&&B===_&&C?.(he,{...v,preventDefault:U})}if(v.kind===zn){if(he<0)return;v.button===0&&j===X&&B===_&&(Q?.(he,{...v,preventDefault:U}),bo.current||Sh(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&J(v),Yr.current=void 0},[s,Y,W,Xr,wo,oe,I,Fn,nn,Te,ii,_n,E,go,$,ie,K,ai,Q,C,ua,Sh]),py=d.useCallback(v=>{const A={...v,location:[v.location[0]-W,v.location[1]]};et?.(A),s!==void 0&&v.buttons===0&&(c(void 0),ns(void 0),cs(void 0),li.current=!1),cs(L=>li.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===L?.[0]&&v.scrollEdge[1]===L[1]?L:s===void 0||(Jn.current?.location[0]??0)<W?void 0:v.scrollEdge)},[s,et,W]),gy=d.useCallback((v,A)=>{mt?.(v-W,A)},[mt,W]),my=d.useCallback((v,A)=>{pt?.(v-W,A)},[pt,W]),yo=Y?.current?.cell,vy=d.useCallback((v,A,L,j,B,X)=>{Qn.current=!1;let _=yo;_!==void 0&&(_=[_[0]-W,_[1]]);const U=Ne===0?void 0:{x:0,y:v.y,width:Ne,height:v.height},J=[];U!==void 0&&J.push(U),Le>0&&(J.push({x:v.x-W,y:ze-Le,width:v.width,height:Le}),Ne>0&&J.push({x:0,y:ze-Le,width:Ne,height:Le}));const he={x:v.x-W,y:v.y,width:v.width,height:Vt&&v.y+v.height>=ze?v.height-1:v.height,tx:B,ty:X,extras:{selected:_,freezeRegion:U,freezeRegions:J}};dn.current=he,bh(he),Gt([A,L,j]),jt?.(he,he.tx,he.ty,he.extras)},[yo,W,Vt,ze,Ne,Le,bh,jt]),by=ur(R,d.useCallback((v,A)=>R?.(v-W,A-W)!==!1,[R,W])),wy=ur(Re,d.useCallback((v,A)=>{Re?.(v-W,A-W),ne!=="none"&&tt(ot.fromSingleSelection(A),void 0,!0)},[ne,Re,W,tt])),us=d.useRef(!1),yy=d.useCallback(v=>{if(v.location[0]===0&&W>0){v.preventDefault();return}Ae?.({...v,location:[v.location[0]-W,v.location[1]]}),v.defaultPrevented()||(us.current=!0),c(void 0)},[Ae,W]),xy=d.useCallback(()=>{us.current=!1},[]),Eh=Ct?.selectionBehavior,da=d.useCallback(v=>{if(Eh!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:j}=Gr(v);if(A)return[v,v];const B=L[L.length-1],X=v-B,_=v+j-B-1;return[X,_]},[Gr,Eh]),ds=d.useRef(),hs=d.useCallback(v=>{if(!fu(v,ds.current)&&(ds.current=v,!(Jn?.current?.button!==void 0&&Jn.current.button>=1))){if(v.buttons!==0&&s!==void 0&&Jn.current?.location[0]===0&&v.location[0]===0&&W===1&&pe==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Jn.current.location[1])&&Y.rows.hasIndex(Jn.current.location[1])){const A=Math.min(Jn.current.location[1],v.location[1]),L=Math.max(Jn.current.location[1],v.location[1])+1;It(ot.fromSingleSelection([A,L]),void 0,!1)}if(v.buttons!==0&&s!==void 0&&Y.current!==void 0&&!us.current&&!li.current&&(Xe==="rect"||Xe==="multi-rect")){const[A,L]=Y.current.cell;let[j,B]=v.location;if(B<0&&(B=dn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const X=s.previousSelection.current.range;B=Math.min(B,Vt?ze-1:ze);const _=fg(X,j,B,Rt);ns(_)}else{if(Vt&&L===ze)return;if(Vt&&B===ze)if(v.kind===Ti)B--;else return;j=Math.max(j,W);const X=da(L);B=X===void 0?B:Ln(B,X[0],X[1]);const _=j-A,U=B-L,J={x:_>=0?A:j,y:U>=0?L:B,width:Math.abs(_)+1,height:Math.abs(U)+1};gt({...Y.current,range:J},!0,!1,"drag")}}zt?.({...v,location:[v.location[0]-W,v.location[1]]})}},[s,W,pe,Y,Xe,zt,It,Vt,ze,Rt,da,gt]),Cy=d.useCallback(()=>{const v=ds.current;if(v===void 0)return;const[A,L]=v.scrollEdge;let[j,B]=v.location;const X=dn.current;A===-1?j=X.extras?.freezeRegion?.x??X.x:A===1&&(j=X.x+X.width),L===-1?B=Math.max(0,X.y):L===1&&(B=Math.min(ze-1,X.y+X.height)),j=Ln(j,0,nt.length-1),B=Ln(B,0,ze-1),hs({...v,location:[j,B]})},[nt.length,hs,ze]);xm(hy,$t,Cy);const jn=d.useCallback(v=>{if(Y.current===void 0)return;const[A,L]=v,[j,B]=Y.current.cell,X=Y.current.range;let _=X.x,U=X.x+X.width,J=X.y,he=X.y+X.height;const[Se,kt]=da(B)??[0,ze-1],rt=kt+1;if(L!==0)switch(L){case 2:{he=rt,J=B,Yt(0,he,"vertical");break}case-2:{J=Se,he=B+1,Yt(0,J,"vertical");break}case 1:{J<B?(J++,Yt(0,J,"vertical")):(he=Math.min(rt,he+1),Yt(0,he,"vertical"));break}case-1:{he>B+1?(he--,Yt(0,he,"vertical")):(J=Math.max(Se,J-1),Yt(0,J,"vertical"));break}default:Ro()}if(A!==0)if(A===2)U=nt.length,_=j,Yt(U-1-W,0,"horizontal");else if(A===-2)_=W,U=j+1,Yt(_-W,0,"horizontal");else{let qe=[];if(V!==void 0){const We=V({x:_,y:J,width:U-_-W,height:he-J},Mn.current.signal);typeof We=="object"&&(qe=Dm(We))}if(A===1){let We=!1;if(_<j){if(qe.length>0){const ht=Ir(_+1,j+1).find(xt=>!qe.includes(xt-W));ht!==void 0&&(_=ht,We=!0)}else _++,We=!0;We&&Yt(_,0,"horizontal")}We||(U=Math.min(nt.length,U+1),Yt(U-1-W,0,"horizontal"))}else if(A===-1){let We=!1;if(U>j+1){if(qe.length>0){const ht=Ir(U-1,j,-1).find(xt=>!qe.includes(xt-W));ht!==void 0&&(U=ht,We=!0)}else U--,We=!0;We&&Yt(U-W,0,"horizontal")}We||(_=Math.max(W,_-1),Yt(_-W,0,"horizontal"))}else Ro()}gt({cell:Y.current.cell,range:{x:_,y:J,width:U-_,height:he-J}},!0,!1,"keyboard-select")},[V,da,Y,nt.length,W,ze,Yt,gt]),fs=d.useRef(ei);fs.current=ei;const Er=d.useCallback((v,A,L,j)=>{const B=mn-(L?0:1);v=Ln(v,W,sn.length-1+W),A=Ln(A,0,B);const X=yo?.[0],_=yo?.[1];if(v===X&&A===_)return!1;if(j&&Y.current!==void 0){const U=[...Y.current.rangeStack];(Y.current.range.width>1||Y.current.range.height>1)&&U.push(Y.current.range),oe({...Y,current:{cell:[v,A],range:{x:v,y:A,width:1,height:1},rangeStack:U}},!0)}else gt({cell:[v,A],range:{x:v,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===A&&(u.current=void 0),fs.current&&Yt(v-W,A),!0},[mn,W,sn.length,yo,Y,Yt,oe,gt]),ky=d.useCallback((v,A)=>{o?.cell!==void 0&&v!==void 0&&Or(v)&&(_n([{location:o.cell,value:v}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:o.cell}])})),yn(!0),i(void 0);const[L,j]=A;if(Y.current!==void 0&&(L!==0||j!==0)){const B=Y.current.cell[1]===mn-1&&v!==void 0,X=Y.current.cell[0]===nt.length-1&&v!==void 0;let _=!0;if(B&&j===1&&ge!==void 0){_=!1;const U=Y.current.cell[0]+L,J=mo(U);Mr(J??U,!1)}if(X&&L===1&&it!==void 0){_=!1;const U=Y.current.cell[1]+j;ca(U,!1)}_&&Er(Ln(Y.current.cell[0]+L,0,nt.length-1),Ln(Y.current.cell[1]+j,0,mn-1),B,!1)}H?.(v,A)},[o?.cell,yn,Y,H,_n,mn,Er,nt.length,Mr,ca,ge,it,mo]),Sy=d.useMemo(()=>`gdg-overlay-${Om++}`,[]),Kr=d.useCallback(v=>{yn();const A=[];for(let L=v.x;L<v.x+v.width;L++)for(let j=v.y;j<v.y+v.height;j++){const B=k([L-W,j]);if(!B.allowOverlay&&B.kind!==Z.Boolean)continue;let X;if(B.kind===Z.Custom){const _=nn(B),U=_?.provideEditor?.({...B,location:[L-W,j]});_?.onDelete!==void 0?X=_.onDelete(B):Ms(U)&&(X=U?.deletedValue?.(B))}else(Or(B)&&B.allowOverlay||B.kind===Z.Boolean)&&(X=nn(B)?.onDelete?.(B));X!==void 0&&!Tr(X)&&Or(X)&&A.push({location:[L,j],value:X})}_n(A),gn.current?.damage(A.map(L=>({cell:L.location})))},[yn,k,nn,_n,W]),si=o!==void 0,Ih=d.useCallback(v=>{const A=()=>{v.stopPropagation(),v.preventDefault()},L={didMatch:!1},{bounds:j}=v,B=Y.columns,X=Y.rows,_=Zn;if(!si&&at(_.clear,v,L))oe(Pi,!1),Mt?.();else if(!si&&at(_.selectAll,v,L))oe({columns:ot.empty(),rows:ot.empty(),current:{cell:Y.current?.cell??[W,0],range:{x:W,y:0,width:y.length,height:ze},rangeStack:[]}},!1);else if(at(_.search,v,L))l?.current?.focus({preventScroll:!0}),$r(!0);else if(at(_.delete,v,L)){const We=tn?.(Y)??!0;if(We!==!1){const ht=We===!0?Y:We;if(ht.current!==void 0){Kr(ht.current.range);for(const xt of ht.current.rangeStack)Kr(xt)}for(const xt of ht.rows)Kr({x:W,y:xt,width:y.length,height:1});for(const xt of ht.columns)Kr({x:xt,y:0,width:1,height:ze})}}if(L.didMatch)return A(),!0;if(Y.current===void 0)return!1;let[U,J]=Y.current.cell;const[,he]=Y.current.cell;let Se=!1,kt=!1;if(at(_.scrollToSelectedCell,v,L)?pa.current(U-W,J):ne!=="none"&&at(_.selectColumn,v,L)?B.hasIndex(U)?tt(B.remove(U),void 0,!0):ne==="single"?tt(ot.fromSingleSelection(U),void 0,!0):tt(void 0,U,!0):pe!=="none"&&at(_.selectRow,v,L)?X.hasIndex(J)?It(X.remove(J),void 0,!0):pe==="single"?It(ot.fromSingleSelection(J),void 0,!0):It(void 0,J,!0):!si&&j!==void 0&&at(_.activateCell,v,L)?J===ze&&Vt?window.setTimeout(()=>{const We=mo(U);Mr(We??U)},0):(E?.([U-W,J]),go(j,!0)):Y.current.range.height>1&&at(_.downFill,v,L)?Rh():Y.current.range.width>1&&at(_.rightFill,v,L)?Mh():at(_.goToNextPage,v,L)?J+=Math.max(1,dn.current.height-4):at(_.goToPreviousPage,v,L)?J-=Math.max(1,dn.current.height-4):at(_.goToFirstCell,v,L)?(i(void 0),J=0,U=0):at(_.goToLastCell,v,L)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):at(_.selectToFirstCell,v,L)?(i(void 0),jn([-2,-2])):at(_.selectToLastCell,v,L)?(i(void 0),jn([2,2])):si?(at(_.closeOverlay,v,L)&&i(void 0),at(_.acceptOverlayDown,v,L)&&(i(void 0),J++),at(_.acceptOverlayUp,v,L)&&(i(void 0),J--),at(_.acceptOverlayLeft,v,L)&&(i(void 0),U--),at(_.acceptOverlayRight,v,L)&&(i(void 0),U++)):(at(_.goDownCell,v,L)?J+=1:at(_.goUpCell,v,L)?J-=1:at(_.goRightCell,v,L)?U+=1:at(_.goLeftCell,v,L)?U-=1:at(_.goDownCellRetainSelection,v,L)?(J+=1,Se=!0):at(_.goUpCellRetainSelection,v,L)?(J-=1,Se=!0):at(_.goRightCellRetainSelection,v,L)?(U+=1,Se=!0):at(_.goLeftCellRetainSelection,v,L)?(U-=1,Se=!0):at(_.goToLastRow,v,L)?J=ze-1:at(_.goToFirstRow,v,L)?J=Number.MIN_SAFE_INTEGER:at(_.goToLastColumn,v,L)?U=Number.MAX_SAFE_INTEGER:at(_.goToFirstColumn,v,L)?U=Number.MIN_SAFE_INTEGER:(Xe==="rect"||Xe==="multi-rect")&&(at(_.selectGrowDown,v,L)?jn([0,1]):at(_.selectGrowUp,v,L)?jn([0,-1]):at(_.selectGrowRight,v,L)?jn([1,0]):at(_.selectGrowLeft,v,L)?jn([-1,0]):at(_.selectToLastRow,v,L)?jn([0,2]):at(_.selectToFirstRow,v,L)?jn([0,-2]):at(_.selectToLastColumn,v,L)?jn([2,0]):at(_.selectToFirstColumn,v,L)&&jn([-2,0])),kt=L.didMatch),$n!==void 0&&$n!=="normal"&&J!==he){const We=$n==="skip-up"||$n==="skip"||$n==="block",ht=$n==="skip-down"||$n==="skip"||$n==="block",xt=J<he;if(xt&&We){for(;J>=0&&Gr(J).isGroupHeader;)J--;J<0&&(J=he)}else if(!xt&&ht){for(;J<ze&&Gr(J).isGroupHeader;)J++;J>=ze&&(J=he)}}const rt=Er(U,J,!1,Se),qe=L.didMatch;return qe&&(rt||!kt||Zt)&&A(),qe},[$n,si,Y,Zn,ne,pe,Xe,W,Gr,ze,Er,oe,Mt,y.length,tn,Zt,Kr,tt,It,Vt,mo,Mr,E,go,Rh,Mh,jn]),ci=d.useCallback(v=>{let A=!1;if(G!==void 0&&G({...v,...v.location&&{location:[v.location[0]-W,v.location[1]]},cancel:()=>{A=!0}}),A||Ih(v)||Y.current===void 0)return;const[L,j]=Y.current.cell,B=dn.current;if(Oe&&!v.metaKey&&!v.ctrlKey&&Y.current!==void 0&&v.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(v.key)&&v.bounds!==void 0&&to(k([L-W,Math.max(0,Math.min(j,ze-1))]))){if((!Vt||j!==ze)&&(B.y>j||j>B.y+B.height||B.x>L||L>B.x+B.width))return;E?.([L-W,j]),go(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Oe,G,Ih,Y,k,W,ze,Vt,E,go]),My=d.useCallback((v,A)=>{const L=v.location[0]-W;if(v.kind==="header"&&ie?.(L,{...v,preventDefault:A}),v.kind===zn){if(L<0)return;K?.(L,{...v,preventDefault:A})}if(v.kind==="cell"){const[j,B]=v.location;$?.([L,B],{...v,preventDefault:A}),cp(Y,v.location)||Er(j,B,!1,!1)}},[Y,$,K,ie,W,Er]),ps=d.useCallback(async v=>{if(!Zn.paste)return;function A(_,U,J,he){const Se=typeof J=="object"?J?.join(`
|
|
172
|
+
`&&(n.push(r),r=[])),i=t.None);break}l++}return o<e.length&&r.push(wu(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function yu(e,t,n){const r=hm(e,t),o=a=>{window.navigator.clipboard?.writeText(a)},i=(a,s)=>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([s],{type:"text/html"})})]),!0),l=(a,s)=>{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",s)}catch{i(a,s)||o(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function xu(e){return e!==!0}function Cu(e){return typeof e=="string"?e:`${e}px`}const gm=()=>e=>e.innerWidth,mm=()=>e=>e.innerHeight,vm=rn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[gm()],"wmyidgi-1":[mm()]}}),bm=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(vm,{innerHeight:Cu(n),innerWidth:Cu(t),...o},r)},wm=2,ym=1300;function xm(e,t,n){const r=Bt.useRef(0),[o,i]=e??[0,0];Bt.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let l=!1,a=0;const s=c=>{if(!l){if(a===0)a=c;else{const u=c-a;r.current=Math.min(1,r.current+u/ym);const h=r.current**1.618*u*wm;t.current?.scrollBy(o*h,i*h),a=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,o,i,n])}function Cm({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:l,remSize:a}){const[s,c,u,h,p,f]=Bt.useMemo(()=>{if(!l||a===16)return[e,t,n,r,o,i];const g=a/16,m=e,b=Wc();return[typeof m=="number"?m*g:y=>Math.ceil(m(y)*g),Math.ceil(t*g),Math.ceil(n*g),{...r,headerIconSize:(r?.headerIconSize??b.headerIconSize)*g,cellHorizontalPadding:(r?.cellHorizontalPadding??b.cellHorizontalPadding)*g,cellVerticalPadding:(r?.cellVerticalPadding??b.cellVerticalPadding)*g},Math.ceil((o??0)*g),Math.ceil((i??0)*g)]},[n,t,o,i,a,e,l,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:p,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 lt(e,t){return e===!0?t:e===!1?"":e}function ku(e){const t=Ii.value;return{activateCell:lt(e.activateCell," |Enter|shift+Enter"),clear:lt(e.clear,"any+Escape"),closeOverlay:lt(e.closeOverlay,"any+Escape"),acceptOverlayDown:lt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:lt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:lt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:lt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:lt(e.delete,t?"Backspace|Delete":"Delete"),downFill:lt(e.downFill,"primary+_68"),scrollToSelectedCell:lt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:lt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:lt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:lt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:lt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:lt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:lt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:lt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:lt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:lt(e.goToFirstCell,"primary+Home"),goToFirstColumn:lt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:lt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:lt(e.goToLastCell,"primary+End"),goToLastColumn:lt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:lt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:lt(e.goToNextPage,"PageDown"),goToPreviousPage:lt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:lt(e.rightFill,"primary+_82"),search:lt(e.search,"primary+f"),selectAll:lt(e.selectAll,"primary+a"),selectColumn:lt(e.selectColumn,"ctrl+ "),selectGrowDown:lt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:lt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:lt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:lt(e.selectGrowUp,"shift+ArrowUp"),selectRow:lt(e.selectRow,"shift+ "),selectToFirstCell:lt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:lt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:lt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:lt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:lt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:lt(e.selectToLastRow,"primary+shift+ArrowDown")}}function km(e){const t=Pf(e);return Bt.useMemo(()=>{if(t===void 0)return ku(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 ku({...mr,...n})},[t])}function Sm(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((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function sl(e,t){const n=[];function r(a,s,c=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let h=0;h<a.subGroups.length;h++){const p=h<a.subGroups.length-1?a.subGroups[h+1].headerIndex:s;r(a.subGroups[h],p,c||a.isCollapsed)}}const o=Sm(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function cl(e,t){if(t===void 0||sl.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 Mm(e,t,n,r){const o=Bt.useMemo(()=>e===void 0?void 0:sl(e,t),[e,t]),i=Bt.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),l=Bt.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),a=Bt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=Bt.useCallback(u=>{if(o===void 0)return u;let h=u;for(const p of o){if(h===0)return;if(h--,!p.isCollapsed){if(h<p.rows)return p.contentIndex+h;h-=p.rows}}return u},[o]),c=ur(r??e?.themeOverride,Bt.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:p,groupIndex:f}=cl(u,o);return h?e.themeOverride:r?.(u,f,p)},[o,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:c}}function Rm(e,t){const n=Bt.useMemo(()=>e===void 0?void 0:sl(e,t),[e,t]);return{getRowGroupingForPath:Mu,updateRowGroupingByPath:Su,mapper:Bt.useCallback(r=>{if(typeof r=="number")return cl(r,n);const o=cl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function Su(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:Su(i.subGroups??[],o,n)}:i)}function Mu(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Mu(e[n].subGroups??[],r)}function Em(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 Im(e,t,n,r,o){const[i,l]=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:l}),[r,l,i]),[s,c,u]=Df(a),h=d.useRef(o);h.current=o;const p=Em(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&p.current!==null&&f){if(p.current.scrollTop===t)return;p.current.scrollTop=t,p.current.scrollTop!==t&&u(),h.current()}},[t,f,u,p]);const g=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&p.current!==null&&g){if(p.current.scrollLeft===e)return;p.current.scrollLeft=e,p.current.scrollLeft!==e&&u(),h.current()}},[e,g,u,p]),{visibleRegion:s,setVisibleRegion:c,scrollRef:p}}const Tm=d.lazy(async()=>await bs(()=>import("./data-grid-overlay-editor-Kkg8Jnuo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));let Om=0;function Dm(e){return Fp(qc(qc(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Oi(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 Di={kind:Z.Loading,allowOverlay:!1},Pi={columns:ot.empty(),rows:ot.empty(),current:void 0},Pm=(e,t)=>{const[n,r]=d.useState(Pi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:p,getRowThemeOverride:f,markdownDivCreateNode:g,width:m,height:b,columns:y,rows:w,getCellContent:k,onCellClicked:I,onCellActivated:E,onFillPattern:x,onFinishedEditing:H,coercePasteValue:O,drawHeader:M,drawCell:F,editorBloom:T,onHeaderClicked:C,onColumnProposeMove:R,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:S="default",onGroupHeaderClicked:Q,onCellContextMenu:$,className:q,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:se,onCellEdited:te,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:ae,onSearchValueChange:z,searchValue:P,onKeyDown:G,onKeyUp:le,keybindings:de,editOnType:Oe=!0,onRowAppended:ge,onColumnAppended:it,onColumnMoved:Re,validateCell:Lt,highlightRegions:Ye,rangeSelect:Xe="rect",columnSelect:ne="multi",rowSelect:pe="multi",rangeSelectionBlending:Ce="exclusive",columnSelectionBlending:ce="exclusive",rowSelectionBlending:xe="exclusive",onDelete:Ie,onDragStart:Ae,onMouseMove:et,onPaste:Pe,copyHeaders:je=!1,freezeColumns:Ne=0,cellActivationBehavior:Te="second-click",rowSelectionMode:Ee="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:pt,getGroupDetails:Ke,rowGrouping:Ct,onSearchClose:qt,onItemHovered:zt,onSelectionCleared:Mt,showSearch:fn,onVisibleRegionChanged:jt,gridSelection:on,onGridSelectionChange:Tt,minColumnWidth:wt=50,maxColumnWidth:an=500,maxColumnAutoWidth:ct,provideEditor:ln,trailingRowOptions:Wt,freezeTrailingRows:Le=0,allowedFillDirections:Rt="orthogonal",scrollOffsetX:_t,scrollOffsetY:On,verticalBorder:Ut,onDragOverCell:pn,onDrop:Dn,onColumnResize:Jt,onColumnResizeEnd:en,onColumnResizeStart:Ue,customRenderers:Ot,fillHandle:Cn,experimental:vt,fixedShadowX:Ht,fixedShadowY:kn,headerIcons:rr,imageWindowLoader:Bn,initialSize:N,isDraggable:Be,onDragLeave:Ge,onRowMoved:yt,overscrollX:wn,overscrollY:un,preventDiagonalScrolling:ve,rightElement:ut,rightElementProps:bt,trapFocus:Zt=!1,smoothScrollX:Xt,smoothScrollY:or,scaleToRem:Qi=!1,rowHeight:Yl=34,headerHeight:Ji=36,groupHeaderHeight:Vr=Ji,theme:br,isOutsideClick:Kl,renderers:Jo,resizeIndicator:ea,scrollToActiveCell:ei=!0,drawFocusRing:Nr=!0,portalElementRef:ta}=e,so=Nr==="no-editor"?o===void 0:Nr,Wn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Wn?.kind??e.rowMarkers??"none",wr=Wn?.width??e.rowMarkerWidth,ir=Wn?.startIndex??e.rowMarkerStartIndex??1,co=Wn?.theme??e.rowMarkerTheme,yr=Wn?.headerTheme,uo=Wn?.headerAlwaysVisible,ti=pe!=="multi"||Wn?.headerDisabled===!0,Br=Wn?.checkboxStyle??"square",xr=Math.max(wt,20),ho=Math.max(an,xr),ql=Math.max(ct??ho,xr),ni=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:ze,rowNumberMapper:ri,rowHeight:na,getRowThemeOverride:Wr}=Mm(Ct,w,Yl,f),Zl=d.useMemo(()=>Number.parseFloat(ni.fontSize),[ni]),{rowHeight:qn,headerHeight:oi,groupHeaderHeight:ra,theme:fo,overscrollX:Ql,overscrollY:Jl}=Cm({groupHeaderHeight:Vr,headerHeight:Ji,overscrollX:wn,overscrollY:un,remSize:Zl,rowHeight:na,scaleToRem:Qi,theme:br}),Zn=km(de),Cr=wr??(w>1e4?48:w>1e3?44:w>100?36:32),Pn=Sn!=="none",W=Pn?1:0,Vt=Wt!==void 0,ar=Wt?.sticky===!0,[es,$r]=d.useState(!1),ts=fn??es,po=d.useCallback(()=>{qt!==void 0?qt():$r(!1)},[qt]),Y=d.useMemo(()=>on===void 0?void 0:Oi(on,W),[on,W])??n,Mn=d.useRef();Mn.current===void 0&&(Mn.current=new AbortController),d.useEffect(()=>()=>Mn?.current.abort(),[]);const[V,re]=am(ee,k,W,Mn.current,ze),ke=d.useCallback((v,A,L)=>{if(Lt===void 0)return!0;const j=[v[0]-W,v[1]];return Lt?.(j,A,L)},[W,Lt]),Me=d.useRef(on),oe=d.useCallback((v,A)=>{A&&(v=fm(v,V,W,S,Mn.current)),Tt!==void 0?(Me.current=Oi(v,-W),Tt(Me.current)):r(v)},[Tt,V,W,S]),me=ur(Jt,d.useCallback((v,A,L,j)=>{Jt?.(y[L-W],A,L-W,j)},[Jt,W,y])),Qe=ur(en,d.useCallback((v,A,L,j)=>{en?.(y[L-W],A,L-W,j)},[en,W,y])),we=ur(Ue,d.useCallback((v,A,L,j)=>{Ue?.(y[L-W],A,L-W,j)},[Ue,W,y])),Ze=ur(M,d.useCallback((v,A)=>M?.({...v,columnIndex:v.columnIndex-W},A)??!1,[M,W])),dt=ur(F,d.useCallback((v,A)=>F?.({...v,col:v.col-W},A)??!1,[F,W])),tn=d.useCallback(v=>{if(Ie!==void 0){const A=Ie(Oi(v,-W));return typeof A=="boolean"?A:Oi(A,W)}return!0},[Ie,W]),[gt,It,tt]=im(Y,oe,Ce,ce,xe,Xe,D),Je=d.useMemo(()=>tr(Wc(),fo),[fo]),[Nt,Gt]=d.useState([0,0,0]),jr=d.useMemo(()=>{if(Jo===void 0)return{};const v={};for(const A of Jo)v[A.kind]=A;return v},[Jo]),nn=d.useCallback(v=>v.kind!==Z.Custom?jr[v.kind]:Ot?.find(A=>A.isMatch(v)),[Ot,jr]);let{sizedColumns:sn,nonGrowWidth:kr}=Mp(y,ze,re,Nt[0]-(W===0?0:Cr)-Nt[2],xr,ql,Je,nn,Mn.current);Sn!=="none"&&(kr+=Cr);const Dt=d.useMemo(()=>sn.some(v=>v.group!==void 0),[sn]),Rn=Dt?oi+ra:oi,Hn=Y.rows.length,Sr=Sn==="none"?void 0:Hn===0?!1:Hn===ze?!0:void 0,nt=d.useMemo(()=>Sn==="none"?sn:[{title:"",width:Cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:co,rowMarker:Br,rowMarkerChecked:Sr,headerRowMarkerTheme:yr,headerRowMarkerAlwaysVisible:uo,headerRowMarkerDisabled:ti},...sn],[Sn,sn,Cr,co,Br,Sr,yr,uo,ti]),dn=d.useRef({height:1,width:1,x:0,y:0}),Qn=d.useRef(!1),{setVisibleRegion:bh,visibleRegion:Ur,scrollRef:$t}=Im(_t,On,qn,dn,()=>Qn.current=!0);dn.current=Ur;const cy=Ur.x+W,oa=Ur.y,gn=d.useRef(null),yn=d.useCallback(v=>{v===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),mn=Vt?ze+1:ze,_n=d.useCallback(v=>{const A=W===0?v:v.map(j=>({...j,location:[j.location[0]-W,j.location[1]]})),L=ue?.(A);if(L!==!0)for(const j of A)te?.(j.location,j.value);return L},[te,ue,W]),[Xr,ns]=d.useState(),ia=Y.current!==void 0&&Y.current.range.width*Y.current.range.height>1?Y.current.range:void 0,wh=so?Y.current?.cell:void 0,aa=wh?.[0],la=wh?.[1],uy=d.useMemo(()=>{if((Ye===void 0||Ye.length===0)&&(ia??aa??la??Xr)===void 0)return;const v=[];if(Ye!==void 0)for(const A of Ye){const L=nt.length-A.range.x-W;L>0&&v.push({color:A.color,range:{...A.range,x:A.range.x+W,width:Math.min(L,A.range.width)},style:A.style})}return Xr!==void 0&&v.push({color:Fr(Je.accentColor,0),range:Xr,style:"dashed"}),ia!==void 0&&v.push({color:Fr(Je.accentColor,.5),range:ia,style:"solid-outline"}),aa!==void 0&&la!==void 0&&v.push({color:Je.accentColor,range:{x:aa,y:la,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Xr,ia,aa,la,Ye,nt.length,Je.accentColor,W]),yh=d.useRef(nt);yh.current=nt;const Fn=d.useCallback(([v,A],L=!1)=>{const j=Vt&&A===mn-1;if(v===0&&Pn){if(j)return Di;const B=ri(A);return B===void 0?Di:{kind:An.Marker,allowOverlay:!1,checkboxStyle:Br,checked:Y?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:ir+B,drawHandle:yt!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(j){const B=v===W?Wt?.hint??"":"",X=yh.current[v];if(X?.trailingRowOptions?.disabled===!0)return Di;{const _=X?.trailingRowOptions?.hint??B,U=X?.trailingRowOptions?.addIcon??Wt?.addIcon;return{kind:An.NewRow,hint:_,allowOverlay:!1,icon:U}}}else{const B=v-W;if(L||vt?.strict===!0){const _=dn.current,U=_.x>B||B>_.x+_.width||_.y>A||A>_.y+_.height||A>=as.current,J=B===_.extras?.selected?.[0]&&A===_.extras?.selected[1];let he=!1;if(_.extras?.freezeRegions!==void 0){for(const Se of _.extras.freezeRegions)if(zr(Se,B,A)){he=!0;break}}if(U&&!J&&!he)return Di}let X=k([B,A]);return W!==0&&X.span!==void 0&&(X={...X,span:[X.span[0]+W,X.span[1]+W]}),X}},[Vt,mn,Pn,ri,Br,Y?.rows,Sn,ir,yt,W,Wt?.hint,Wt?.addIcon,vt?.strict,k]),rs=d.useCallback(v=>{let A=Ke?.(v)??{name:v};return se!==void 0&&v!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>ss({group:A.name,bounds:L.bounds})}]}),A},[Ke,se]),sa=d.useCallback(v=>{const[A,L]=v.cell,j=nt[A],B=j?.group!==void 0?rs(j.group)?.overrideTheme:void 0,X=j?.themeOverride,_=Wr?.(L);i({...v,theme:tr(Je,B,X,_,v.content.themeOverride)})},[Wr,nt,rs,Je]),go=d.useCallback((v,A,L)=>{if(Y.current===void 0)return;const[j,B]=Y.current.cell,X=Fn([j,B]);if(X.kind!==Z.Boolean&&X.allowOverlay){let _=X;if(L!==void 0)switch(_.kind){case Z.Number:{const U=of(()=>L==="-"?-0:Number.parseFloat(L),0);_={..._,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:_={..._,data:L};break}sa({target:v,content:_,initialValue:L,cell:[j,B],highlight:L===void 0,forceEditMode:L!==void 0})}else X.kind===Z.Boolean&&A&&X.readonly!==!0&&(_n([{location:Y.current.cell,value:{...X,data:xu(X.data)}}]),gn.current?.damage([{cell:Y.current.cell}]))},[Fn,Y,_n,sa]),xh=d.useCallback((v,A)=>{const L=gn.current?.getBounds(v,A);if(L===void 0||$t.current===null)return;const j=Fn([v,A]);j.allowOverlay&&sa({target:L,content:j,initialValue:void 0,highlight:!0,cell:[v,A],forceEditMode:!0})},[Fn,$t,sa]),Yt=d.useCallback((v,A,L="both",j=0,B=0,X=void 0)=>{if($t.current!==null){const _=gn.current,U=a.current,J=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,he=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,Se=typeof v!="number"&&v.unit==="px"?v.amount:void 0,kt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(_!==null&&U!==null){let rt={x:0,y:0,width:0,height:0},qe=0,We=0;if((J!==void 0||he!==void 0)&&(rt=_.getBounds((J??0)+W,he??0)??rt,rt.width===0||rt.height===0))return;const ht=U.getBoundingClientRect(),xt=ht.width/U.offsetWidth;if(Se!==void 0&&(rt={...rt,x:Se-ht.left-$t.current.scrollLeft,width:1}),kt!==void 0&&(rt={...rt,y:kt+ht.top-$t.current.scrollTop,height:1}),rt!==void 0){const Qt={x:rt.x-j,y:rt.y-B,width:rt.width+2*j,height:rt.height+2*B};let xo=0;for(let gs=0;gs<Ne;gs++)xo+=sn[gs].width;let ga=0;const di=Le+(ar?1:0);di>0&&(ga=Ar(mn,di,qn));let er=xo*xt+ht.left+W*Cr*xt,Co=ht.right,qr=ht.top+Rn*xt,ko=ht.bottom-ga*xt;const ma=rt.width+j*2;switch(X?.hAlign){case"start":Co=er+ma;break;case"end":er=Co-ma;break;case"center":er=Math.floor((er+Co)/2)-ma/2,Co=er+ma;break}const va=rt.height+B*2;switch(X?.vAlign){case"start":ko=qr+va;break;case"end":qr=ko-va;break;case"center":qr=Math.floor((qr+ko)/2)-va/2,ko=qr+va;break}er>Qt.x?qe=Qt.x-er:Co<Qt.x+Qt.width&&(qe=Qt.x+Qt.width-Co),qr>Qt.y?We=Qt.y-qr:ko<Qt.y+Qt.height&&(We=Qt.y+Qt.height-ko),L==="vertical"||typeof v=="number"&&v<Ne?qe=0:(L==="horizontal"||typeof A=="number"&&A>=mn-di)&&(We=0),(qe!==0||We!==0)&&(xt!==1&&(qe/=xt,We/=xt),$t.current.scrollTo({left:qe+$t.current.scrollLeft,top:We+$t.current.scrollTop,behavior:X?.behavior??"auto"}))}}}},[W,Le,Cr,$t,Rn,Ne,sn,mn,ar,qn]),os=d.useRef(xh),is=d.useRef(k);os.current=xh,is.current=k;const as=d.useRef(ze);as.current=ze;const Ch=d.useRef(nt.length);Ch.current=nt.length;const Mr=d.useCallback(async(v,A=!0,L)=>{if(nt[v]?.trailingRowOptions?.disabled===!0)return;const j=ge?.();let B,X=!0;j!==void 0&&(B=await j,B==="top"&&(X=!1),typeof B=="number"&&(X=!1));let _=0;const U=()=>{if(as.current<=ze){_<500&&window.setTimeout(U,_),_=50+_*2;return}const J=typeof B=="number"?B:X?ze:0;pa.current(v-W,J,"both",0,0,L?{behavior:L}:void 0),gt({cell:[v,J],range:{x:v,y:J,width:1,height:1}},!1,!1,"edit");const he=is.current([v-W,J]);he.allowOverlay&&to(he)&&he.readonly!==!0&&A&&window.setTimeout(()=>{os.current(v,J)},0)};U()},[nt,ge,W,ze,gt]),ca=d.useCallback(async(v,A=!0)=>{const L=it?.();let j,B=!0;L!==void 0&&(j=await L,j==="left"&&(B=!1),typeof j=="number"&&(B=!1));let X=0;const _=()=>{if(Ch.current<=nt.length){X<500&&window.setTimeout(_,X),X=50+X*2;return}const U=typeof j=="number"?j:B?nt.length:0;Yt(U-W,v),gt({cell:[U,v],range:{x:U,y:v,width:1,height:1}},!1,!1,"edit");const J=is.current([U-W,v]);J.allowOverlay&&to(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{os.current(U,v)},0)};_()},[nt,it,W,Yt,gt]),mo=d.useCallback(v=>{const A=sn[v]?.trailingRowOptions?.targetColumn??Wt?.targetColumn;if(typeof A=="number")return A+(Pn?1:0);if(typeof A=="object"){const L=y.indexOf(A);if(L>=0)return L+(Pn?1:0)}},[sn,y,Pn,Wt?.targetColumn]),Rr=d.useRef(),vo=d.useRef(),ii=d.useCallback((v,A)=>{const[L,j]=A;return tr(Je,nt[L]?.themeOverride,Wr?.(j),v.themeOverride)},[Wr,nt,Je]),{mapper:Gr}=Rm(Ct,w),$n=Ct?.navigationBehavior,ai=d.useCallback(v=>{const A=Ii.value?v.metaKey:v.ctrlKey,L=A&&pe==="multi",j=A&&ne==="multi",[B,X]=v.location,_=Y.columns,U=Y.rows,[J,he]=Y.current?.cell??[];if(v.kind==="cell"){if(vo.current=void 0,Yr.current=[B,X],B===0&&Pn){if(Vt===!0&&X===ze||Sn==="number"||pe==="none")return;const Se=Fn(v.location);if(Se.kind!==An.Marker)return;if(yt!==void 0){const qe=nn(Se);En(qe?.kind===An.Marker);const We=qe?.onClick?.({...v,cell:Se,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:ii(Se,v.location),preventDefault:()=>{}});if(We===void 0||We.checked===Se.checked)return}i(void 0),yn();const kt=U.hasIndex(X),rt=Rr.current;if(pe==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&rt!==void 0&&U.hasIndex(rt)){const qe=[Math.min(rt,X),Math.max(rt,X)+1];L||Ee==="multi"?It(void 0,qe,!0):It(ot.fromSingleSelection(qe),void 0,L)}else pe==="multi"&&(L||v.isTouch||Ee==="multi")?kt?It(U.remove(X),void 0,!0):(It(void 0,X,!0),Rr.current=X):kt&&U.length===1?It(ot.empty(),void 0,A):(It(ot.fromSingleSelection(X),void 0,A),Rr.current=X)}else if(B>=W&&Vt&&X===ze){const Se=mo(B);Mr(Se??B)}else if(J!==B||he!==X){const Se=Fn(v.location),kt=nn(Se);if(kt?.onSelect!==void 0){let We=!1;if(kt.onSelect({...v,cell:Se,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>We=!0,theme:ii(Se,v.location)}),We)return}if($n==="block"&&Gr(X).isGroupHeader)return;const rt=ar&&X===ze,qe=ar&&Y!==void 0&&Y.current?.cell[1]===ze;if((v.shiftKey||v.isLongTouch===!0)&&J!==void 0&&he!==void 0&&Y.current!==void 0&&!qe){if(rt)return;const We=Math.min(B,J),ht=Math.max(B,J),xt=Math.min(X,he),Qt=Math.max(X,he);gt({...Y.current,range:{x:We,y:xt,width:ht-We+1,height:Qt-xt+1}},!0,A,"click"),Rr.current=void 0,yn()}else gt({cell:[B,X],range:{x:B,y:X,width:1,height:1}},!0,A,"click"),Rr.current=void 0,i(void 0),yn()}}else if(v.kind==="header")if(Yr.current=[B,X],i(void 0),Pn&&B===0)Rr.current=void 0,vo.current=void 0,!ti&&pe==="multi"&&(U.length!==ze?It(ot.fromSingleSelection([0,ze]),void 0,A):It(ot.empty(),void 0,A),yn());else{const Se=vo.current;if(ne==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Se!==void 0&&_.hasIndex(Se)){const kt=[Math.min(Se,B),Math.max(Se,B)+1];j?tt(void 0,kt,A):tt(ot.fromSingleSelection(kt),void 0,A)}else j?(_.hasIndex(B)?tt(_.remove(B),void 0,A):tt(void 0,B,A),vo.current=B):ne!=="none"&&(_.hasIndex(B)?tt(_.remove(B),void 0,A):tt(ot.fromSingleSelection(B),void 0,A),vo.current=B);Rr.current=void 0,yn()}else v.kind===zn?Yr.current=[B,X]:v.kind===Ti&&!v.isMaybeScrollbar&&(oe(Pi,!1),i(void 0),yn(),Mt?.(),Rr.current=void 0,vo.current=void 0)},[pe,ne,Y,Pn,W,Vt,ze,Sn,Fn,yt,yn,Ee,nn,ii,It,mo,Mr,$n,Gr,ar,gt,tt,oe,Mt]),li=d.useRef(!1),Yr=d.useRef(),kh=d.useRef(Ur),Jn=d.useRef(),dy=d.useCallback(v=>{if(bo.current=!1,kh.current=dn.current,v.button!==0&&v.button!==1){Jn.current=void 0;return}const A=performance.now();Jn.current={button:v.button,time:A,location:v.location},v?.kind==="header"&&(li.current=!0);const L=v.kind==="cell"&&v.isFillHandle;!L&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:Y,fillHandle:L}),Yr.current=void 0,!v.isTouch&&v.button===0&&!L?ai(v):!v.isTouch&&v.button===1&&(Yr.current=v.location))},[Y,ai]),[ls,ss]=d.useState(),Sh=d.useCallback(v=>{if(v.kind!==zn||ne!=="multi")return;const A=Ii.value?v.metaKey:v.ctrlKey,[L]=v.location,j=Y.columns;if(L<W)return;const B=nt[L];let X=L,_=L;for(let U=L-1;U>=W&&Ao(B.group,nt[U].group);U--)X--;for(let U=L+1;U<nt.length&&Ao(B.group,nt[U].group);U++)_++;if(yn(),A)if(j.hasAll([X,_+1])){let U=j;for(let J=X;J<=_;J++)U=U.remove(J);tt(U,void 0,A)}else tt(void 0,[X,_+1],A);else tt(ot.fromSingleSelection([X,_+1]),void 0,A)},[ne,yn,Y.columns,nt,W,tt]),bo=d.useRef(!1),ua=d.useCallback(async v=>{if(V!==void 0&&me!==void 0){const A=dn.current.y,L=dn.current.height;let j=V({x:v,y:A,width:1,height:Math.min(L,ze-A)},Mn.current.signal);typeof j!="object"&&(j=await j());const B=sn[v-W],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=Je.baseFontFull;const _=$c(X,Je,B,0,j,xr,ho,!1,nn);me?.(B,_.width,v,_.width)}}},[sn,V,ho,Je,xr,me,W,ze,nn]),[hy,cs]=d.useState(),wo=d.useCallback(async(v,A)=>{const L=v.current?.range;if(L===void 0||V===void 0||A.current===void 0)return;const j=A.current.range;if(x!==void 0){let U=!1;if(x({fillDestination:{...j,x:j.x-W},patternSource:{...L,x:L.x-W},preventDefault:()=>U=!0}),U)return}let B=V(L,Mn.current.signal);typeof B!="object"&&(B=await B());const X=B,_=[];for(let U=0;U<j.width;U++)for(let J=0;J<j.height;J++){const he=[j.x+U,j.y+J];if(Oc(he,L))continue;const Se=X[J%L.height][U%L.width];Tr(Se)||!to(Se)||_.push({location:he,value:{...Se}})}_n(_),gn.current?.damage(_.map(U=>({cell:U.location})))},[V,_n,x,W]),Mh=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.width<=1)return;const v={...Y,current:{...Y.current,range:{...Y.current.range,width:1}}};wo(v,Y)},[wo,Y]),Rh=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.height<=1)return;const v={...Y,current:{...Y.current,range:{...Y.current.range,height:1}}};wo(v,Y)},[wo,Y]),fy=d.useCallback((v,A)=>{const L=s;if(c(void 0),ns(void 0),cs(void 0),li.current=!1,A)return;if(L?.fillHandle===!0&&Y.current!==void 0&&L.previousSelection?.current!==void 0){if(Xr===void 0)return;const Se={...Y,current:{...Y.current,range:tu(L.previousSelection.current.range,Xr)}};wo(L.previousSelection,Se),oe(Se,!0);return}const[j,B]=v.location,[X,_]=Yr.current??[],U=()=>{bo.current=!0},J=Se=>{const kt=Se.isTouch||X===j&&_===B;if(kt&&I?.([j-W,B],{...Se,preventDefault:U}),Se.button===1)return!bo.current;if(!bo.current){const rt=Fn(v.location),qe=nn(rt);if(qe!==void 0&&qe.onClick!==void 0&&kt){const ht=qe.onClick({...Se,cell:rt,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:ii(rt,v.location),preventDefault:U});ht!==void 0&&!Tr(ht)&&Or(ht)&&(_n([{location:Se.location,value:ht}]),gn.current?.damage([{cell:Se.location}]))}if(bo.current||Y.current===void 0)return!1;let We=!1;switch(rt.activationBehaviorOverride??Te){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=Y.current.cell,[Qt,xo]=L.previousSelection.current.cell;We=j===ht&&j===Qt&&B===xt&&B===xo&&(Se.isDoubleClick===!0||Te==="second-click");break}case"single-click":{We=!0;break}}if(We)return E?.([j-W,B]),go(Se.bounds,!1),!0}return!1},he=v.location[0]-W;if(v.isTouch){const Se=dn.current,kt=kh.current;if(Se.x!==kt.x||Se.y!==kt.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&Lo(Y.current?.cell,v.location)){$?.([he,v.location[1]],{...v,preventDefault:U});return}else if(v.kind==="header"&&Y.columns.hasIndex(j)){ie?.(he,{...v,preventDefault:U});return}else if(v.kind===zn){if(he<0)return;K?.(he,{...v,preventDefault:U});return}}v.kind==="cell"?J(v)||ai(v):v.kind===zn?Q?.(he,{...v,preventDefault:U}):(v.kind===gr&&C?.(he,{...v,preventDefault:U}),ai(v));return}if(v.kind==="header"){if(he<0)return;v.isEdge?v.isDoubleClick===!0&&ua(j):v.button===0&&j===X&&B===_&&C?.(he,{...v,preventDefault:U})}if(v.kind===zn){if(he<0)return;v.button===0&&j===X&&B===_&&(Q?.(he,{...v,preventDefault:U}),bo.current||Sh(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&J(v),Yr.current=void 0},[s,Y,W,Xr,wo,oe,I,Fn,nn,Te,ii,_n,E,go,$,ie,K,ai,Q,C,ua,Sh]),py=d.useCallback(v=>{const A={...v,location:[v.location[0]-W,v.location[1]]};et?.(A),s!==void 0&&v.buttons===0&&(c(void 0),ns(void 0),cs(void 0),li.current=!1),cs(L=>li.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===L?.[0]&&v.scrollEdge[1]===L[1]?L:s===void 0||(Jn.current?.location[0]??0)<W?void 0:v.scrollEdge)},[s,et,W]),gy=d.useCallback((v,A)=>{mt?.(v-W,A)},[mt,W]),my=d.useCallback((v,A)=>{pt?.(v-W,A)},[pt,W]),yo=Y?.current?.cell,vy=d.useCallback((v,A,L,j,B,X)=>{Qn.current=!1;let _=yo;_!==void 0&&(_=[_[0]-W,_[1]]);const U=Ne===0?void 0:{x:0,y:v.y,width:Ne,height:v.height},J=[];U!==void 0&&J.push(U),Le>0&&(J.push({x:v.x-W,y:ze-Le,width:v.width,height:Le}),Ne>0&&J.push({x:0,y:ze-Le,width:Ne,height:Le}));const he={x:v.x-W,y:v.y,width:v.width,height:Vt&&v.y+v.height>=ze?v.height-1:v.height,tx:B,ty:X,extras:{selected:_,freezeRegion:U,freezeRegions:J}};dn.current=he,bh(he),Gt([A,L,j]),jt?.(he,he.tx,he.ty,he.extras)},[yo,W,Vt,ze,Ne,Le,bh,jt]),by=ur(R,d.useCallback((v,A)=>R?.(v-W,A-W)!==!1,[R,W])),wy=ur(Re,d.useCallback((v,A)=>{Re?.(v-W,A-W),ne!=="none"&&tt(ot.fromSingleSelection(A),void 0,!0)},[ne,Re,W,tt])),us=d.useRef(!1),yy=d.useCallback(v=>{if(v.location[0]===0&&W>0){v.preventDefault();return}Ae?.({...v,location:[v.location[0]-W,v.location[1]]}),v.defaultPrevented()||(us.current=!0),c(void 0)},[Ae,W]),xy=d.useCallback(()=>{us.current=!1},[]),Eh=Ct?.selectionBehavior,da=d.useCallback(v=>{if(Eh!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:j}=Gr(v);if(A)return[v,v];const B=L[L.length-1],X=v-B,_=v+j-B-1;return[X,_]},[Gr,Eh]),ds=d.useRef(),hs=d.useCallback(v=>{if(!fu(v,ds.current)&&(ds.current=v,!(Jn?.current?.button!==void 0&&Jn.current.button>=1))){if(v.buttons!==0&&s!==void 0&&Jn.current?.location[0]===0&&v.location[0]===0&&W===1&&pe==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Jn.current.location[1])&&Y.rows.hasIndex(Jn.current.location[1])){const A=Math.min(Jn.current.location[1],v.location[1]),L=Math.max(Jn.current.location[1],v.location[1])+1;It(ot.fromSingleSelection([A,L]),void 0,!1)}if(v.buttons!==0&&s!==void 0&&Y.current!==void 0&&!us.current&&!li.current&&(Xe==="rect"||Xe==="multi-rect")){const[A,L]=Y.current.cell;let[j,B]=v.location;if(B<0&&(B=dn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const X=s.previousSelection.current.range;B=Math.min(B,Vt?ze-1:ze);const _=fg(X,j,B,Rt);ns(_)}else{if(Vt&&L===ze)return;if(Vt&&B===ze)if(v.kind===Ti)B--;else return;j=Math.max(j,W);const X=da(L);B=X===void 0?B:Ln(B,X[0],X[1]);const _=j-A,U=B-L,J={x:_>=0?A:j,y:U>=0?L:B,width:Math.abs(_)+1,height:Math.abs(U)+1};gt({...Y.current,range:J},!0,!1,"drag")}}zt?.({...v,location:[v.location[0]-W,v.location[1]]})}},[s,W,pe,Y,Xe,zt,It,Vt,ze,Rt,da,gt]),Cy=d.useCallback(()=>{const v=ds.current;if(v===void 0)return;const[A,L]=v.scrollEdge;let[j,B]=v.location;const X=dn.current;A===-1?j=X.extras?.freezeRegion?.x??X.x:A===1&&(j=X.x+X.width),L===-1?B=Math.max(0,X.y):L===1&&(B=Math.min(ze-1,X.y+X.height)),j=Ln(j,0,nt.length-1),B=Ln(B,0,ze-1),hs({...v,location:[j,B]})},[nt.length,hs,ze]);xm(hy,$t,Cy);const jn=d.useCallback(v=>{if(Y.current===void 0)return;const[A,L]=v,[j,B]=Y.current.cell,X=Y.current.range;let _=X.x,U=X.x+X.width,J=X.y,he=X.y+X.height;const[Se,kt]=da(B)??[0,ze-1],rt=kt+1;if(L!==0)switch(L){case 2:{he=rt,J=B,Yt(0,he,"vertical");break}case-2:{J=Se,he=B+1,Yt(0,J,"vertical");break}case 1:{J<B?(J++,Yt(0,J,"vertical")):(he=Math.min(rt,he+1),Yt(0,he,"vertical"));break}case-1:{he>B+1?(he--,Yt(0,he,"vertical")):(J=Math.max(Se,J-1),Yt(0,J,"vertical"));break}default:Ro()}if(A!==0)if(A===2)U=nt.length,_=j,Yt(U-1-W,0,"horizontal");else if(A===-2)_=W,U=j+1,Yt(_-W,0,"horizontal");else{let qe=[];if(V!==void 0){const We=V({x:_,y:J,width:U-_-W,height:he-J},Mn.current.signal);typeof We=="object"&&(qe=Dm(We))}if(A===1){let We=!1;if(_<j){if(qe.length>0){const ht=Ir(_+1,j+1).find(xt=>!qe.includes(xt-W));ht!==void 0&&(_=ht,We=!0)}else _++,We=!0;We&&Yt(_,0,"horizontal")}We||(U=Math.min(nt.length,U+1),Yt(U-1-W,0,"horizontal"))}else if(A===-1){let We=!1;if(U>j+1){if(qe.length>0){const ht=Ir(U-1,j,-1).find(xt=>!qe.includes(xt-W));ht!==void 0&&(U=ht,We=!0)}else U--,We=!0;We&&Yt(U-W,0,"horizontal")}We||(_=Math.max(W,_-1),Yt(_-W,0,"horizontal"))}else Ro()}gt({cell:Y.current.cell,range:{x:_,y:J,width:U-_,height:he-J}},!0,!1,"keyboard-select")},[V,da,Y,nt.length,W,ze,Yt,gt]),fs=d.useRef(ei);fs.current=ei;const Er=d.useCallback((v,A,L,j)=>{const B=mn-(L?0:1);v=Ln(v,W,sn.length-1+W),A=Ln(A,0,B);const X=yo?.[0],_=yo?.[1];if(v===X&&A===_)return!1;if(j&&Y.current!==void 0){const U=[...Y.current.rangeStack];(Y.current.range.width>1||Y.current.range.height>1)&&U.push(Y.current.range),oe({...Y,current:{cell:[v,A],range:{x:v,y:A,width:1,height:1},rangeStack:U}},!0)}else gt({cell:[v,A],range:{x:v,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===A&&(u.current=void 0),fs.current&&Yt(v-W,A),!0},[mn,W,sn.length,yo,Y,Yt,oe,gt]),ky=d.useCallback((v,A)=>{o?.cell!==void 0&&v!==void 0&&Or(v)&&(_n([{location:o.cell,value:v}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:o.cell}])})),yn(!0),i(void 0);const[L,j]=A;if(Y.current!==void 0&&(L!==0||j!==0)){const B=Y.current.cell[1]===mn-1&&v!==void 0,X=Y.current.cell[0]===nt.length-1&&v!==void 0;let _=!0;if(B&&j===1&&ge!==void 0){_=!1;const U=Y.current.cell[0]+L,J=mo(U);Mr(J??U,!1)}if(X&&L===1&&it!==void 0){_=!1;const U=Y.current.cell[1]+j;ca(U,!1)}_&&Er(Ln(Y.current.cell[0]+L,0,nt.length-1),Ln(Y.current.cell[1]+j,0,mn-1),B,!1)}H?.(v,A)},[o?.cell,yn,Y,H,_n,mn,Er,nt.length,Mr,ca,ge,it,mo]),Sy=d.useMemo(()=>`gdg-overlay-${Om++}`,[]),Kr=d.useCallback(v=>{yn();const A=[];for(let L=v.x;L<v.x+v.width;L++)for(let j=v.y;j<v.y+v.height;j++){const B=k([L-W,j]);if(!B.allowOverlay&&B.kind!==Z.Boolean)continue;let X;if(B.kind===Z.Custom){const _=nn(B),U=_?.provideEditor?.({...B,location:[L-W,j]});_?.onDelete!==void 0?X=_.onDelete(B):Ms(U)&&(X=U?.deletedValue?.(B))}else(Or(B)&&B.allowOverlay||B.kind===Z.Boolean)&&(X=nn(B)?.onDelete?.(B));X!==void 0&&!Tr(X)&&Or(X)&&A.push({location:[L,j],value:X})}_n(A),gn.current?.damage(A.map(L=>({cell:L.location})))},[yn,k,nn,_n,W]),si=o!==void 0,Ih=d.useCallback(v=>{const A=()=>{v.stopPropagation(),v.preventDefault()},L={didMatch:!1},{bounds:j}=v,B=Y.columns,X=Y.rows,_=Zn;if(!si&&at(_.clear,v,L))oe(Pi,!1),Mt?.();else if(!si&&at(_.selectAll,v,L))oe({columns:ot.empty(),rows:ot.empty(),current:{cell:Y.current?.cell??[W,0],range:{x:W,y:0,width:y.length,height:ze},rangeStack:[]}},!1);else if(at(_.search,v,L))l?.current?.focus({preventScroll:!0}),$r(!0);else if(at(_.delete,v,L)){const We=tn?.(Y)??!0;if(We!==!1){const ht=We===!0?Y:We;if(ht.current!==void 0){Kr(ht.current.range);for(const xt of ht.current.rangeStack)Kr(xt)}for(const xt of ht.rows)Kr({x:W,y:xt,width:y.length,height:1});for(const xt of ht.columns)Kr({x:xt,y:0,width:1,height:ze})}}if(L.didMatch)return A(),!0;if(Y.current===void 0)return!1;let[U,J]=Y.current.cell;const[,he]=Y.current.cell;let Se=!1,kt=!1;if(at(_.scrollToSelectedCell,v,L)?pa.current(U-W,J):ne!=="none"&&at(_.selectColumn,v,L)?B.hasIndex(U)?tt(B.remove(U),void 0,!0):ne==="single"?tt(ot.fromSingleSelection(U),void 0,!0):tt(void 0,U,!0):pe!=="none"&&at(_.selectRow,v,L)?X.hasIndex(J)?It(X.remove(J),void 0,!0):pe==="single"?It(ot.fromSingleSelection(J),void 0,!0):It(void 0,J,!0):!si&&j!==void 0&&at(_.activateCell,v,L)?J===ze&&Vt?window.setTimeout(()=>{const We=mo(U);Mr(We??U)},0):(E?.([U-W,J]),go(j,!0)):Y.current.range.height>1&&at(_.downFill,v,L)?Rh():Y.current.range.width>1&&at(_.rightFill,v,L)?Mh():at(_.goToNextPage,v,L)?J+=Math.max(1,dn.current.height-4):at(_.goToPreviousPage,v,L)?J-=Math.max(1,dn.current.height-4):at(_.goToFirstCell,v,L)?(i(void 0),J=0,U=0):at(_.goToLastCell,v,L)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):at(_.selectToFirstCell,v,L)?(i(void 0),jn([-2,-2])):at(_.selectToLastCell,v,L)?(i(void 0),jn([2,2])):si?(at(_.closeOverlay,v,L)&&i(void 0),at(_.acceptOverlayDown,v,L)&&(i(void 0),J++),at(_.acceptOverlayUp,v,L)&&(i(void 0),J--),at(_.acceptOverlayLeft,v,L)&&(i(void 0),U--),at(_.acceptOverlayRight,v,L)&&(i(void 0),U++)):(at(_.goDownCell,v,L)?J+=1:at(_.goUpCell,v,L)?J-=1:at(_.goRightCell,v,L)?U+=1:at(_.goLeftCell,v,L)?U-=1:at(_.goDownCellRetainSelection,v,L)?(J+=1,Se=!0):at(_.goUpCellRetainSelection,v,L)?(J-=1,Se=!0):at(_.goRightCellRetainSelection,v,L)?(U+=1,Se=!0):at(_.goLeftCellRetainSelection,v,L)?(U-=1,Se=!0):at(_.goToLastRow,v,L)?J=ze-1:at(_.goToFirstRow,v,L)?J=Number.MIN_SAFE_INTEGER:at(_.goToLastColumn,v,L)?U=Number.MAX_SAFE_INTEGER:at(_.goToFirstColumn,v,L)?U=Number.MIN_SAFE_INTEGER:(Xe==="rect"||Xe==="multi-rect")&&(at(_.selectGrowDown,v,L)?jn([0,1]):at(_.selectGrowUp,v,L)?jn([0,-1]):at(_.selectGrowRight,v,L)?jn([1,0]):at(_.selectGrowLeft,v,L)?jn([-1,0]):at(_.selectToLastRow,v,L)?jn([0,2]):at(_.selectToFirstRow,v,L)?jn([0,-2]):at(_.selectToLastColumn,v,L)?jn([2,0]):at(_.selectToFirstColumn,v,L)&&jn([-2,0])),kt=L.didMatch),$n!==void 0&&$n!=="normal"&&J!==he){const We=$n==="skip-up"||$n==="skip"||$n==="block",ht=$n==="skip-down"||$n==="skip"||$n==="block",xt=J<he;if(xt&&We){for(;J>=0&&Gr(J).isGroupHeader;)J--;J<0&&(J=he)}else if(!xt&&ht){for(;J<ze&&Gr(J).isGroupHeader;)J++;J>=ze&&(J=he)}}const rt=Er(U,J,!1,Se),qe=L.didMatch;return qe&&(rt||!kt||Zt)&&A(),qe},[$n,si,Y,Zn,ne,pe,Xe,W,Gr,ze,Er,oe,Mt,y.length,tn,Zt,Kr,tt,It,Vt,mo,Mr,E,go,Rh,Mh,jn]),ci=d.useCallback(v=>{let A=!1;if(G!==void 0&&G({...v,...v.location&&{location:[v.location[0]-W,v.location[1]]},cancel:()=>{A=!0}}),A||Ih(v)||Y.current===void 0)return;const[L,j]=Y.current.cell,B=dn.current;if(Oe&&!v.metaKey&&!v.ctrlKey&&Y.current!==void 0&&v.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(v.key)&&v.bounds!==void 0&&to(k([L-W,Math.max(0,Math.min(j,ze-1))]))){if((!Vt||j!==ze)&&(B.y>j||j>B.y+B.height||B.x>L||L>B.x+B.width))return;E?.([L-W,j]),go(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Oe,G,Ih,Y,k,W,ze,Vt,E,go]),My=d.useCallback((v,A)=>{const L=v.location[0]-W;if(v.kind==="header"&&ie?.(L,{...v,preventDefault:A}),v.kind===zn){if(L<0)return;K?.(L,{...v,preventDefault:A})}if(v.kind==="cell"){const[j,B]=v.location;$?.([L,B],{...v,preventDefault:A}),cp(Y,v.location)||Er(j,B,!1,!1)}},[Y,$,K,ie,W,Er]),ps=d.useCallback(async v=>{if(!Zn.paste)return;function A(_,U,J,he){const Se=typeof J=="object"?J?.join(`
|
|
173
173
|
`)??"":J?.toString()??"";if(!Tr(_)&&to(_)&&_.readonly!==!0){const kt=O?.(Se,_);if(kt!==void 0&&Or(kt))return{location:U,value:kt};const rt=nn(_);if(rt===void 0)return;if(rt.kind===Z.Custom){En(_.kind===Z.Custom);const qe=rt.onPaste?.(Se,_.data);return qe===void 0?void 0:{location:U,value:{..._,data:qe}}}else{const qe=rt.onPaste?.(Se,_,{formatted:he,formattedString:typeof he=="string"?he:he?.join(`
|
|
174
174
|
`),rawValue:J});return qe===void 0?void 0:(En(qe.kind===_.kind),{location:U,value:qe})}}}const L=Y.columns,j=Y.rows,B=$t.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let X;if(Y.current!==void 0?X=[Y.current.range.x,Y.current.range.y]:L.length===1?X=[L.first()??0,0]:j.length===1&&(X=[W,j.first()??0]),B&&X!==void 0){let _,U;const J="text/plain",he="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const We of qe){if(We.types.includes(he)){const ht=await(await We.getType(he)).text(),xt=bu(ht);if(xt!==void 0){_=xt;break}}We.types.includes(J)&&(U=await(await We.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(v!==void 0&&v?.clipboardData!==null){if(v.clipboardData.types.includes(he)){const qe=v.clipboardData.getData(he);_=bu(qe)}_===void 0&&v.clipboardData.types.includes(J)&&(U=v.clipboardData.getData(J))}else return;const[Se,kt]=X,rt=[];do{if(Pe===void 0){const qe=Fn(X),We=U??_?.map(xt=>xt.map(Qt=>Qt.rawValue).join(" ")).join(" ")??"",ht=A(qe,X,We,void 0);ht!==void 0&&rt.push(ht);break}if(_===void 0){if(U===void 0)return;_=pm(U)}if(Pe===!1||typeof Pe=="function"&&Pe?.([X[0]-W,X[1]],_.map(qe=>qe.map(We=>We.rawValue?.toString()??"")))!==!0)return;for(const[qe,We]of _.entries()){if(qe+kt>=ze)break;for(const[ht,xt]of We.entries()){const Qt=[ht+Se,qe+kt],[xo,ga]=Qt;if(xo>=nt.length||ga>=mn)continue;const di=Fn(Qt),er=A(di,Qt,xt.rawValue,xt.formatted);er!==void 0&&rt.push(er)}}}while(!1);_n(rt),gn.current?.damage(rt.map(qe=>({cell:qe.location})))}},[O,nn,Fn,Y,Zn.paste,$t,nt.length,_n,mn,Pe,W,ze]);bn("paste",ps,h,!1,!0);const ui=d.useCallback(async(v,A)=>{if(!Zn.copy)return;const L=A===!0||$t.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,j=Y.columns,B=Y.rows,X=(_,U)=>{if(!je)yu(_,U,v);else{const J=U.map(he=>({kind:Z.Text,data:y[he].title,displayData:y[he].title,allowOverlay:!1}));yu([J,..._],U,v)}};if(L&&V!==void 0){if(Y.current!==void 0){let _=V(Y.current.range,Mn.current.signal);typeof _!="object"&&(_=await _()),X(_,Ir(Y.current.range.x-W,Y.current.range.x+Y.current.range.width-W))}else if(B!==void 0&&B.length>0){const _=[...B].map(U=>{const J=V({x:W,y:U,width:y.length,height:1},Mn.current.signal);return typeof J=="object"?J[0]:J().then(he=>he[0])});if(_.some(U=>U instanceof Promise)){const U=await Promise.all(_);X(U,Ir(y.length))}else X(_,Ir(y.length))}else if(j.length>0){const _=[],U=[];for(const J of j){let he=V({x:J,y:0,width:1,height:ze},Mn.current.signal);typeof he!="object"&&(he=await he()),_.push(he),U.push(J-W)}if(_.length===1)X(_[0],U);else{const J=_.reduce((he,Se)=>he.map((kt,rt)=>[...kt,...Se[rt]]));X(J,U)}}}},[y,V,Y,Zn.copy,W,$t,ze,je]);bn("copy",ui,h,!1,!1);const Ry=d.useCallback(async v=>{if(!(!Zn.cut||!($t.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await ui(v),Y.current!==void 0)){let A={current:{cell:Y.current.cell,range:Y.current.range,rangeStack:[]},rows:ot.empty(),columns:ot.empty()};const L=tn?.(A);if(L===!1||(A=L===!0?A:L,A.current===void 0))return;Kr(A.current.range)}},[Kr,Y,Zn.cut,ui,$t,tn]);bn("cut",Ry,h,!1,!1);const Ey=d.useCallback((v,A)=>{if(fe!==void 0){W!==0&&(v=v.map(B=>[B[0]-W,B[1]])),fe(v,A);return}if(v.length===0||A===-1)return;const[L,j]=v[A];u.current!==void 0&&u.current[0]===L&&u.current[1]===j||(u.current=[L,j],Er(L,j,!1,!1))},[fe,W,Er]),[ha,fa]=on?.current?.cell??[],pa=d.useRef(Yt);pa.current=Yt,d.useLayoutEffect(()=>{fs.current&&!Qn.current&&ha!==void 0&&fa!==void 0&&(ha!==Me.current?.current?.cell[0]||fa!==Me.current?.current?.cell[1])&&pa.current(ha,fa),Qn.current=!1},[ha,fa]);const Th=Y.current!==void 0&&(Y.current.cell[0]>=nt.length||Y.current.cell[1]>=mn);d.useLayoutEffect(()=>{Th&&oe(Pi,!1)},[Th,oe]);const Iy=d.useMemo(()=>Vt===!0&&Wt?.tint===!0?ot.fromSingleSelection(mn-1):ot.empty(),[mn,Vt,Wt?.tint]),Ty=d.useCallback(v=>typeof Ut=="boolean"?Ut:Ut?.(v-W)??!0,[W,Ut]),Oy=d.useMemo(()=>{if(ls===void 0||a.current===null)return null;const{bounds:v,group:A}=ls,L=a.current.getBoundingClientRect();return d.createElement(rm,{bounds:v,group:A,canvasBounds:L,onClose:()=>ss(void 0),onFinish:j=>{ss(void 0),se?.(A,j)}})},[se,ls]),Dy=Math.min(nt.length,Ne+(Pn?1:0));d.useImperativeHandle(t,()=>({appendRow:(v,A)=>Mr(v+W,A),appendColumn:(v,A)=>ca(v,A),updateCells:v=>(W!==0&&(v=v.map(A=>({cell:[A.cell[0]+W,A.cell[1]]}))),gn.current?.damage(v)),getBounds:(v,A)=>{if(!(a?.current===null||$t?.current===null)){if(v===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),j=L.width/$t.current.clientWidth;return{x:L.x-$t.current.scrollLeft*j,y:L.y-$t.current.scrollTop*j,width:$t.current.scrollWidth*j,height:$t.current.scrollHeight*j}}return gn.current?.getBounds((v??0)+W,A)}},focus:()=>gn.current?.focus(),emit:async v=>{switch(v){case"delete":ci({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":ci({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":ci({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 ui(void 0,!0);break;case"paste":await ps();break}},scrollTo:Yt,remeasureColumns:v=>{for(const A of v)ua(A+W)},getMouseArgsForPosition:(v,A,L)=>{if(gn?.current===null)return;const j=gn.current.getMouseArgsForPosition(v,A,L);if(j!==void 0)return{...j,location:[j.location[0]-W,j.location[1]]}}}),[Mr,ca,ua,$t,ui,ci,ps,W,Yt]);const[Oh,Dh]=yo??[],Py=d.useCallback(v=>{const[A,L]=v;if(L===-1){ne!=="none"&&(tt(ot.fromSingleSelection(A),void 0,!1),yn());return}Oh===A&&Dh===L||(gt({cell:v,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Yt(A,L))},[ne,yn,Yt,Oh,Dh,gt,tt]),[Hy,Fy]=d.useState(!1),Ph=d.useRef(lc(v=>{Fy(v)},5)),Ay=d.useCallback(()=>{Ph.current(!0),Y.current===void 0&&Y.columns.length===0&&Y.rows.length===0&&s===void 0&>({cell:[W,oa],range:{x:W,y:oa,width:1,height:1}},!0,!1,"keyboard-select")},[oa,Y,s,W,gt]),Ly=d.useCallback(()=>{Ph.current(!1)},[]),[zy,_y]=d.useMemo(()=>{let v;const A=vt?.scrollbarWidthOverride??La(),L=ze+(Vt?1:0);if(typeof qn=="number")v=Rn+L*qn;else{let B=0;const X=Math.min(L,10);for(let _=0;_<X;_++)B+=qn(_);B=Math.floor(B/X),v=Rn+L*B}v+=A;const j=nt.reduce((B,X)=>X.width+B,0)+A;return[`${Math.min(1e5,j)}px`,`${Math.min(1e5,v)}px`]},[nt,vt?.scrollbarWidthOverride,qn,ze,Vt,Rn]),Vy=d.useMemo(()=>Rs(Je),[Je]);return d.createElement(Sa.Provider,{value:Je},d.createElement(bm,{style:Vy,className:q,inWidth:m??zy,inHeight:b??_y},d.createElement(em,{fillHandle:Cn,drawFocusRing:so,experimental:vt,fixedShadowX:Ht,fixedShadowY:kn,getRowThemeOverride:Wr,headerIcons:rr,imageWindowLoader:Bn,initialSize:N,isDraggable:Be,onDragLeave:Ge,onRowMoved:yt,overscrollX:Ql,overscrollY:Jl,preventDiagonalScrolling:ve,rightElement:ut,rightElementProps:bt,smoothScrollX:Xt,smoothScrollY:or,className:q,enableGroups:Dt,onCanvasFocused:Ay,onCanvasBlur:Ly,canvasRef:a,onContextMenu:My,theme:Je,cellXOffset:cy,cellYOffset:oa,accessibilityHeight:Ur.height,onDragEnd:xy,columns:nt,nonGrowWidth:kr,drawHeader:Ze,onColumnProposeMove:by,drawCell:dt,disabledRows:Iy,freezeColumns:Dy,lockColumns:W,firstColAccessible:W===0,getCellContent:Fn,minColumnWidth:xr,maxColumnWidth:ho,searchInputRef:l,showSearch:ts,onSearchClose:po,highlightRegions:uy,getCellsForSelection:V,getGroupDetails:rs,headerHeight:oi,isFocused:Hy,groupHeaderHeight:Dt?ra:0,freezeTrailingRows:Le+(Vt&&Wt?.sticky===!0?1:0),hasAppendRow:Vt,onColumnResize:me,onColumnResizeEnd:Qe,onColumnResizeStart:we,onCellFocused:Py,onColumnMoved:wy,onDragStart:yy,onHeaderMenuClick:gy,onHeaderIndicatorClick:my,onItemHovered:hs,isFilling:s?.fillHandle===!0,onMouseMove:py,onKeyDown:ci,onKeyUp:le,onMouseDown:dy,onMouseUp:fy,onDragOverCell:pn,onDrop:Dn,onSearchResultsChanged:Ey,onVisibleRegionChanged:vy,clientSize:Nt,rowHeight:qn,searchResults:ae,searchValue:P,onSearchValueChange:z,rows:mn,scrollRef:$t,selection:Y,translateX:Ur.tx,translateY:Ur.ty,verticalBorder:Ty,gridRef:gn,getCellRenderer:nn,resizeIndicator:ea}),Oy,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(Tm,{...o,validateCell:ke,bloom:T,id:Sy,getCellRenderer:nn,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:ln,imageEditorOverride:p,portalElementRef:ta,onFinishEditing:ky,markdownDivCreateNode:g,isOutsideClick:Kl,customEventTarget:vt?.eventTarget}))))},Hm=d.forwardRef(Pm);function Ru(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:l,height:a,x:s,y:c}=o,u=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+a/2),p=dc(u,a,i.cellVerticalPadding),f=uc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,p),g=cc(f,h,p),m=hc(s+n,c+r,g);return Ia(t)&&m}const Fm={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Am(e,e.cell.data,Ia(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Ru(e)&&e.preventDefault()},onClick:e=>{if(Ru(e))return{...e.cell,data:xu(e.cell.data)}},onPaste:(e,t)=>{let n=mi;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ea),n===t.data?void 0:{...t,data:n}}};function Am(e,t,n,r,o){if(!n&&t===mi)return;const{ctx:i,hoverAmount:l,theme:a,rect:s,highlighted:c,hoverX:u,hoverY:h,cell:{contentAlign:p}}=e,{x:f,y:g,width:m,height:b}=s;let y=!1;if(o>0){let w=n?1-o+o*l:.4;if(t===mi&&(w*=l),w===0)return;w<1&&(y=!0,i.globalAlpha=w)}ol(i,a,t,f,g,m,b,c,u,h,r,p),y&&(i.globalAlpha=1)}const Lm=rn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),zm=e=>{const{bubbles:t}=e;return d.createElement(Lm,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},_m={getAccessibilityString:e=>fc(e.data),kind:Z.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=>Vm(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(zm,{bubbles:t.data})},onPaste:()=>{}};function Vm(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:l,y:a,width:s,height:c}=n;let u=l+r.cellHorizontalPadding;const h=[];for(const p of t){if(u>l+s)break;const f=Lr(p,o,r.baseFontFull).width;h.push({x:u,width:f}),u+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const p of h)Kn(o,p.x,a+(c-r.bubbleHeight)/2,p.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[p,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[p],f.x+r.bubblePadding,a+c/2+Gn(o,r))}const Nm=rn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Bm=e=>{const{drilldowns:t}=e;return d.createElement(Nm,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))))},Wm={getAccessibilityString:e=>fc(e.data.map(t=>t.text)),kind:Z.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=>jm(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Bm,{drilldowns:t.data})},onPaste:()=>{}},ul={};function $m(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,l=n-i*2,a=4,s=n*o,c=r+i,u=r*3,h=(u+i*2)*o,p=`${e},${t},${o},${n}`;if(ul[p]!==void 0)return{el:ul[p],height:s,width:h,middleWidth:a*o,sideWidth:c*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),g=f.getContext("2d");return g===null?null:(f.width=h,f.height=s,g.scale(o,o),ul[p]=f,g.beginPath(),Kn(g,i,i,u,l,r),g.shadowColor="rgba(24, 25, 34, 0.4)",g.shadowBlur=1,g.fillStyle=e,g.fill(),g.shadowColor="rgba(24, 25, 34, 0.3)",g.shadowOffsetY=1,g.shadowBlur=5,g.fillStyle=e,g.fill(),g.shadowOffsetY=0,g.shadowBlur=0,g.shadowBlur=0,g.beginPath(),Kn(g,i+.5,i+.5,u,l,r),g.strokeStyle=t,g.lineWidth=1,g.stroke(),{el:f,height:s,width:h,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function jm(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:l,row:a}=e,{x:s,width:c}=n,u=r.baseFontFull,h=ja(o,u),p=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-p)/2),g=p-10,m=r.bubblePadding,b=r.bubbleMargin;let y=s+r.cellHorizontalPadding;const w=r.roundingRadius??6,k=$m(r.bgCell,r.drilldownBorder,p,w),I=[];for(const E of t){if(y>s+c)break;const x=Lr(E.text,o,u).width;let H=0;E.img!==void 0&&i.loadOrGetImage(E.img,l,a)!==void 0&&(H=g-8+4);const O=x+H+m*2;I.push({x:y,width:O}),y+=O+b}if(k!==null){const{el:E,height:x,middleWidth:H,sideWidth:O,width:M,dpr:F,padding:T}=k,C=O/F,R=T/F;for(const D of I){const S=Math.floor(D.x),Q=Math.floor(D.width),$=Q-(C-R)*2;o.imageSmoothingEnabled=!1,o.drawImage(E,0,0,O,x,S-R,f,C,p),$>0&&o.drawImage(E,O,0,H,x,S+(C-R),f,$,p),o.drawImage(E,M-O,0,O,x,S+Q-(C-R),f,C,p),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[E,x]of I.entries()){const H=t[E];let O=x.x+m;if(H.img!==void 0){const M=i.loadOrGetImage(H.img,l,a);if(M!==void 0){const F=g-8;let T=0,C=0,R=M.width,D=M.height;R>D?(T+=(R-D)/2,R=D):D>R&&(C+=(D-R)/2,D=R),o.beginPath(),Kn(o,O,f+p/2-F/2,F,F,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(M,T,C,R,D,O,f+p/2-F/2,F,F),o.restore(),O+=F+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(H.text,O,f+p/2+Gn(o,r))}}const Um={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Xm(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??Hf;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}}},dl=4;function Xm(e,t,n,r){const{rect:o,col:i,row:l,theme:a,ctx:s,imageLoader:c}=e,{x:u,y:h,height:p,width:f}=o,g=p-a.cellVerticalPadding*2,m=[];let b=0;for(let w=0;w<t.length;w++){const k=t[w];if(k.length===0)continue;const I=c.loadOrGetImage(k,i,l);if(I!==void 0){m[w]=I;const E=I.width*(g/I.height);b+=E+dl}}if(b===0)return;b-=dl;let y=u+a.cellHorizontalPadding;r==="right"?y=Math.floor(u+f-a.cellHorizontalPadding-b):r==="center"&&(y=Math.floor(u+f/2-b/2));for(const w of m){if(w===void 0)continue;const k=w.width*(g/w.height);n>0&&(s.beginPath(),Kn(s,y,h+a.cellVerticalPadding,k,g,n),s.save(),s.clip()),s.drawImage(w,y,h+a.cellVerticalPadding,k,g),n>0&&s.restore(),y+=k+dl}}function Gm(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Ym={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Gm(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=i.width&&(a=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Kn(o,i.x+s,i.y+(i.height-c)/2,a,c,l.roundingRadius??3),o.fillStyle=Fr(l.textDark,.1),o.fill()},onPaste:()=>{}},Km=()=>e=>e.targetWidth,Eu=rn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Km(),"px"]}}),qm=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:l,validatedSelection:a}=e,s=t.data,c=t.readonly===!0,[u,h]=d.useState(s===""||r),p=d.useCallback(()=>{h(g=>!g)},[]),f=s?"gdg-ml-6":"";return u?d.createElement(Eu,{targetWidth:i.width-20},d.createElement(Hr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:g=>{g.key==="Enter"&&g.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>l(t)},d.createElement(Rf,null))):d.createElement(Eu,{targetWidth:i.width},d.createElement(Qf,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:p},d.createElement(Fa,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Zm={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:_o,measure:(e,t,n)=>{const r=t.data.split(`
|
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Yn(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:l,validatedSelection:a}=e;return d.createElement(qm,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Qm={getAccessibilityString:e=>e.row.toString(),kind:An.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Jm,measure:()=>44,draw:e=>t0(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:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Jm(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=e0,n.textAlign="center",i}function e0(e){const{ctx:t}=e;t.textAlign="start"}function t0(e,t,n,r,o,i){const{ctx:l,rect:a,hoverAmount:s,theme:c}=e,{x:u,y:h,width:p,height:f}=a,g=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&g>0){l.globalAlpha=g;const m=7*(n?s:1);if(ol(l,c,n,o?u+m:u,h,o?p-m:p,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){l.globalAlpha=s,l.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])l.rect(u+b,h+f/2+y,2,2);l.fillStyle=c.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),b=c.markerFontFull,y=u+p/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=c.textLight,l.font=b,l.fillText(m,y,h+f/2+Gn(l,b)),s!==0&&(l.globalAlpha=1)}}const n0={getAccessibilityString:()=>"",kind:An.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>r0(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function r0(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:l,spriteManager:a}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const p=t!=="";let f=0;if(n!==void 0){const g=h-8,m=s+8/2,b=c+8/2;a.drawSprite(n,"normal",r,m,b,g,l,p?1:i),f=g}else{f=24;const g=12,m=p?g:i*g,b=p?0:(1-i)*g*.5,y=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+b,c+h/2),r.lineTo(s+y+b+m,c+h/2),r.moveTo(s+y+b+m*.5,c+h/2-m*.5),r.lineTo(s+y+b+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,f+s+l.cellHorizontalPadding+.5,c+h/2+Gn(r,l)),r.beginPath()}function Iu(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=o0(e,o,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Fr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function o0(e,t,n,r,o){const i=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+l/2+1,width:t.width-i,height:t.height-l-1};const a=Lr(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,c=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:a.width+i*3,height:c-1}}const i0=d.lazy(async()=>await bs(()=>import("./number-overlay-editor-
|
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Yn(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:l,validatedSelection:a}=e;return d.createElement(qm,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Qm={getAccessibilityString:e=>e.row.toString(),kind:An.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Jm,measure:()=>44,draw:e=>t0(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:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Jm(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=e0,n.textAlign="center",i}function e0(e){const{ctx:t}=e;t.textAlign="start"}function t0(e,t,n,r,o,i){const{ctx:l,rect:a,hoverAmount:s,theme:c}=e,{x:u,y:h,width:p,height:f}=a,g=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&g>0){l.globalAlpha=g;const m=7*(n?s:1);if(ol(l,c,n,o?u+m:u,h,o?p-m:p,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){l.globalAlpha=s,l.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])l.rect(u+b,h+f/2+y,2,2);l.fillStyle=c.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),b=c.markerFontFull,y=u+p/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=c.textLight,l.font=b,l.fillText(m,y,h+f/2+Gn(l,b)),s!==0&&(l.globalAlpha=1)}}const n0={getAccessibilityString:()=>"",kind:An.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>r0(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function r0(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:l,spriteManager:a}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const p=t!=="";let f=0;if(n!==void 0){const g=h-8,m=s+8/2,b=c+8/2;a.drawSprite(n,"normal",r,m,b,g,l,p?1:i),f=g}else{f=24;const g=12,m=p?g:i*g,b=p?0:(1-i)*g*.5,y=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+b,c+h/2),r.lineTo(s+y+b+m,c+h/2),r.moveTo(s+y+b+m*.5,c+h/2-m*.5),r.lineTo(s+y+b+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,f+s+l.cellHorizontalPadding+.5,c+h/2+Gn(r,l)),r.beginPath()}function Iu(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=o0(e,o,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Fr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function o0(e,t,n,r,o){const i=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+l/2+1,width:t.width-i,height:t.height-l-1};const a=Lr(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,c=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:a.width+i*3,height:c-1}}const i0=d.lazy(async()=>await bs(()=>import("./number-overlay-editor-B6CLC0X9.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]))),a0={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:_o,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:c}=n;a===!0&&t>0&&Iu(r,o,c,s,i,t,l),Yn(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(i0,{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}}},l0={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:s0,onPaste:()=>{}};function s0(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:l}=r;t.beginPath();const a=2.5;let s=o+n.cellHorizontalPadding+a;const c=i+l/2,u=Math.cos(sc(30))*a,h=Math.sin(sc(30))*a;for(let p=0;p<12;p++)t.moveTo(s,c-a),t.lineTo(s,c+a),t.moveTo(s+u,c-h),t.lineTo(s-u,c+h),t.moveTo(s-u,c-h),t.lineTo(s+u,c+h),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const c0={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>_o(e,t,e.theme.textLight),draw:e=>Yn(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 Bt.createElement(Hr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},u0={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:_o,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:h,hoverEffectTheme:p}=t;u===!0&&n>0&&Iu(o,l,p,s,i,n,a),Yn(e,s,c,h,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
176
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(Hr,{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:l=>r({...o,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},d0=rn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),h0=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:l}=e,[a,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return a?d.createElement(Hr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(d0,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(Fa,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Tu(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-l-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-l/2),{x:o,y:i,width:l,height:a}}function Ou(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Ac(l,i.baseFontFull);if(a===void 0)return!1;const s=Tu(a,n,i,t.contentAlign);return zr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const f0={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:_o,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:l,ctx:a}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Lr(s,a,n.baseFontFull),h=Tu(u,l,n,t.contentAlign),{x:p,y:f,width:g,height:m}=h;if(o>=p-4&&o<=p-4+g+8&&i>=f-4&&i<=f-4+m+8){const b=Gn(a,n.baseFontFull);r("pointer");const y=5,w=f-b;a.beginPath(),a.moveTo(l.x+p,Math.floor(l.y+w+m+y)+.5),a.lineTo(l.x+p+g,Math.floor(l.y+w+m+y)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Yn({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),Yn({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),Yn({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),Yn({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=c?n.linkColor:n.textDark,Yn(e,s,t.contentAlign)},onSelect:e=>{Ou(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Ou(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(h0,{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:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},p0=[Qm,n0,Fm,_m,Wm,Um,Ym,Zm,a0,l0,c0,u0,f0];var hl,Du;function g0(){if(Du)return hl;Du=1;var e=ac(),t=Hh(),n="Expected a function";function r(o,i,l){var a=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return t(l)&&(a="leading"in l?!!l.leading:a,s="trailing"in l?!!l.trailing:s),e(o,i,{leading:a,maxWait:i,trailing:s})}return hl=r,hl}var m0=g0();const v0=lr(m0),fl=[];class b0 extends Nc{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=v0(()=>{this.imageLoaded(new Vo(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 l=r.cells[i];if(this.isInWindow(l)){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 l=fl.pop()??new Image;let a=!1;const s={img:void 0,cells:[Nn(n,r)],url:t,cancel:()=>{a||(a=!0,fl.length<12?fl.unshift(l):i||(l.src=""))}},c=new Promise(u=>l.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{l.src=t,await c,await l.decode();const u=this.cache[o];if(u!==void 0&&!a){u.img=l;for(const h of u.cells)this.loadedLocations.push(Ya(h));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[o]=s}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const l=Nn(n,r);return i.cells.includes(l)||i.cells.push(l),i.img}else this.loadImage(t,n,r,o)}}const w0=(e,t)=>{const n=d.useMemo(()=>({...ug,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??p0,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new b0,[e.imageWindowLoader]);return d.createElement(Hm,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},y0=d.forwardRef(w0);function Pu(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 x0=Zy();const C0=lr(x0);var pl={exports:{}},k0=pl.exports,Hu;function S0(){return Hu||(Hu=1,function(e,t){(function(n,r){try{e.exports=r(Qy)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(k0,function(n){var r=!1,o=!1,i=!1,l=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{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 c(z,P){return P.length>z.length?!1:z.indexOf(P)!==-1}function u(z){for(var P="";z;)P+="0",z-=1;return P}function h(z){for(var P=z.split("").reverse(),G=0,le=!0;le&&G<P.length;)G?P[G]==="9"?P[G]="0":(P[G]=(parseInt(P[G],10)+1).toString(),le=!1):(parseInt(P[G],10)<5&&(le=!1),P[G]="0"),G+=1;return le&&P.push("1"),P.reverse().join("")}function p(z,P){var G=H(S(P).sort(),function(de){return de+":"+P[de]}).join(","),le=z+"+"+G;return p.cache[le]||(p.cache[le]=Intl.NumberFormat(z,P)),p.cache[le]}p.cache={};function f(z,P,G){var le=P.useToLocaleString,de=P.useGrouping,Oe=de&&P.grouping.slice(),ge=P.maximumSignificantDigits,it=P.minimumIntegerDigits||1,Re=P.fractionDigits||0,Lt=P.groupingSeparator,Ye=P.decimalSeparator;if(le&&G){var Xe={minimumIntegerDigits:it,useGrouping:de};if(Re&&(Xe.maximumFractionDigits=Re,Xe.minimumFractionDigits=Re),ge&&z>0&&(Xe.maximumSignificantDigits=ge),i){if(!l){var ne=D({},P);ne.useGrouping=!1,ne.decimalSeparator=".",z=parseFloat(f(z,ne),10)}return p(G,Xe).format(z)}else{if(!o){var ne=D({},P);ne.useGrouping=!1,ne.decimalSeparator=".",z=parseFloat(f(z,ne),10)}return z.toLocaleString(G,Xe)}}var pe;ge?pe=z.toPrecision(ge+1):pe=z.toFixed(Re+1);var Ce,ce,xe,Ie=pe.split("e");xe=Ie[1]||"",Ie=Ie[0].split("."),ce=Ie[1]||"",Ce=Ie[0]||"";var Ae=Ce.length,et=ce.length,Pe=Ae+et,je=Ce+ce;(ge&&Pe===ge+1||!ge&&et===Re+1)&&(je=h(je),je.length===Pe+1&&(Ae=Ae+1),et&&(je=je.slice(0,-1)),Ce=je.slice(0,Ae),ce=je.slice(Ae)),ge&&(ce=ce.replace(/0*$/,""));var Ne=parseInt(xe,10);Ne>0?ce.length<=Ne?(ce=ce+u(Ne-ce.length),Ce=Ce+ce,ce=""):(Ce=Ce+ce.slice(0,Ne),ce=ce.slice(Ne)):Ne<0&&(ce=u(Math.abs(Ne)-Ce.length)+Ce+ce,Ce="0"),ge||(ce=ce.slice(0,Re),ce.length<Re&&(ce=ce+u(Re-ce.length)),Ce.length<it&&(Ce=u(it-Ce.length)+Ce));var Te="";if(de){Ie=Ce;for(var Ee;Ie.length;)Oe.length&&(Ee=Oe.shift()),Te&&(Te=Lt+Te),Te=Ie.slice(-Ee)+Te,Ie=Ie.slice(0,-Ee)}else Te=Ce;return ce&&(Te=Te+Ye+ce),Te}function g(z,P){return z.label.length>P.label.length?-1:z.label.length<P.label.length?1:0}function m(z,P){var G=[];return x(S(P),function(le){if(le.slice(0,15)==="_durationLabels"){var de=le.slice(15).toLowerCase();x(S(P[le]),function(Oe){Oe.slice(0,1)===z&&G.push({type:de,key:Oe,label:P[le][Oe]})})}}),G}function b(z,P,G){return P===1&&G===null?z:z+z}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:b};function w(z){return Object.prototype.toString.call(z)==="[object Array]"}function k(z){return Object.prototype.toString.call(z)==="[object Object]"}function I(z,P){for(var G=z.length;G-=1;)if(P(z[G]))return z[G]}function E(z,P){var G=0,le=z&&z.length||0,de;for(typeof P!="function"&&(de=P,P=function(Oe){return Oe===de});G<le;){if(P(z[G]))return z[G];G+=1}}function x(z,P){var G=0,le=z.length;if(!(!z||!le))for(;G<le;){if(P(z[G],G)===!1)return;G+=1}}function H(z,P){var G=0,le=z.length,de=[];if(!z||!le)return de;for(;G<le;)de[G]=P(z[G],G),G+=1;return de}function O(z,P){return H(z,function(G){return G[P]})}function M(z){var P=[];return x(z,function(G){G&&P.push(G)}),P}function F(z){var P=[];return x(z,function(G){E(P,G)||P.push(G)}),P}function T(z,P){var G=[];return x(z,function(le){x(P,function(de){le===de&&G.push(le)})}),F(G)}function C(z,P){var G=[];return x(z,function(le,de){if(!P(le))return G=z.slice(de),!1}),G}function R(z,P){var G=z.slice().reverse();return C(G,P).reverse()}function D(z,P){for(var G in P)P.hasOwnProperty(G)&&(z[G]=P[G]);return z}function S(z){var P=[];for(var G in z)z.hasOwnProperty(G)&&P.push(G);return P}function Q(z,P){var G=0,le=z.length;if(!z||!le)return!1;for(;G<le;){if(P(z[G],G)===!0)return!0;G+=1}return!1}function $(z){var P=[];return x(z,function(G){P=P.concat(G)}),P}function q(){var z=0;try{z.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ie(z){return z(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(z){var P=!0;return P=P&&z(1,"en",{minimumIntegerDigits:1})==="1",P=P&&z(1,"en",{minimumIntegerDigits:2})==="01",P=P&&z(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&z(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&z(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&z(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&z(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&z(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&z(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&z(1e3,"en",{useGrouping:!0})==="1,000",P=P&&z(1e3,"en",{useGrouping:!1})==="1000",!P))}function K(){var z=[].slice.call(arguments),P={},G;if(x(z,function(ge,it){if(!it){if(!w(ge))throw"Expected array as the first argument to durationsFormat.";G=ge}if(typeof ge=="string"||typeof ge=="function"){P.template=ge;return}if(typeof ge=="number"){P.precision=ge;return}k(ge)&&D(P,ge)}),!G||!G.length)return[];P.returnMomentTypes=!0;var le=H(G,function(ge){return ge.format(P)}),de=T(a,F(O($(le),"type"))),Oe=P.largest;return Oe&&(de=de.slice(0,Oe)),P.returnMomentTypes=!1,P.outputTypes=de,H(G,function(ge){return ge.format(P)})}function se(){var z=[].slice.call(arguments),P=D({},this.format.defaults),G=this.asMilliseconds(),le=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,le=0);var de=G<0,Oe=n.duration(Math.abs(G),"milliseconds"),ge=n.duration(Math.abs(le),"months");x(z,function(N){if(typeof N=="string"||typeof N=="function"){P.template=N;return}if(typeof N=="number"){P.precision=N;return}k(N)&&D(P,N)});var it={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Re={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=a;var Lt=function(N){return E(a,function(Be){return Re[Be].test(N)})},Ye=new RegExp(H(a,function(N){return Re[N].source}).join("|"),"g");P.duration=this;var Xe=typeof P.template=="function"?P.template.apply(P):P.template,ne=P.outputTypes,pe=P.returnMomentTypes,Ce=P.largest,ce=[];ne||(w(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&x(P.stopTrim.match(Ye),function(N){var Be=Lt(N);Be==="escape"||Be==="general"||ce.push(Be)}));var xe=n.localeData();xe||(xe={}),x(S(y),function(N){if(typeof y[N]=="function"){xe[N]||(xe[N]=y[N]);return}xe["_"+N]||(xe["_"+N]=y[N])}),x(S(xe._durationTimeTemplates),function(N){Xe=Xe.replace("_"+N+"_",xe._durationTimeTemplates[N])});var Ie=P.userLocale||n.locale(),Ae=P.useLeftUnits,et=P.usePlural,Pe=P.precision,je=P.forceLength,Ne=P.useGrouping,Te=P.trunc,Ee=P.useSignificantDigits&&Pe>0,mt=Ee?P.precision:0,pt=mt,Ke=P.minValue,Ct=!1,qt=P.maxValue,zt=!1,Mt=P.useToLocaleString,fn=P.groupingSeparator,jt=P.decimalSeparator,on=P.grouping;Mt=Mt&&(r||i);var Tt=P.trim;w(Tt)&&(Tt=Tt.join(" ")),Tt===null&&(Ce||qt||Ee)&&(Tt="all"),(Tt===null||Tt===!0||Tt==="left"||Tt==="right")&&(Tt="large"),Tt===!1&&(Tt="");var wt=function(N){return N.test(Tt)},an=/large/,ct=/small/,ln=/both/,Wt=/mid/,Le=/^all|[^sm]all/,Rt=/final/,_t=Ce>0||Q([an,ln,Le],wt),On=Q([ct,ln,Le],wt),Ut=Q([Wt,Le],wt),pn=Q([Rt,Le],wt),Dn=H(Xe.match(Ye),function(N,Be){var Ge=Lt(N);return N.slice(0,1)==="*"&&(N=N.slice(1),Ge!=="escape"&&Ge!=="general"&&ce.push(Ge)),{index:Be,length:N.length,text:"",token:Ge==="escape"?N.replace(Re.escape,"$1"):N,type:Ge==="escape"||Ge==="general"?null:Ge}}),Jt={index:0,length:0,token:"",text:"",type:null},en=[];Ae&&Dn.reverse(),x(Dn,function(N){if(N.type){(Jt.type||Jt.text)&&en.push(Jt),Jt=N;return}Ae?Jt.text=N.token+Jt.text:Jt.text+=N.token}),(Jt.type||Jt.text)&&en.push(Jt),Ae&&en.reverse();var Ue=T(a,F(M(O(en,"type"))));if(!Ue.length)return O(en,"text").join("");Ue=H(Ue,function(N,Be){var Ge=Be+1===Ue.length,yt=!Be,wn;N==="years"||N==="months"?wn=ge.as(N):wn=Oe.as(N);var un=Math.floor(wn),ve=wn-un,ut=E(en,function(bt){return N===bt.type});return yt&&qt&&wn>qt&&(zt=!0),Ge&&Ke&&Math.abs(P.duration.as(N))<Ke&&(Ct=!0),yt&&je===null&&ut.length>1&&(je=!0),Oe.subtract(un,N),ge.subtract(un,N),{rawValue:wn,wholeValue:un,decimalValue:Ge?ve:0,isSmallest:Ge,isLargest:yt,type:N,tokenLength:ut.length}});var Ot=Te?Math.floor:Math.round,Cn=function(N,Be){var Ge=Math.pow(10,Be);return Ot(N*Ge)/Ge},vt=!1,Ht=!1,kn=function(N,Be){var Ge={useGrouping:Ne,groupingSeparator:fn,decimalSeparator:jt,grouping:on,useToLocaleString:Mt};return Ee&&(mt<=0?(N.rawValue=0,N.wholeValue=0,N.decimalValue=0):(Ge.maximumSignificantDigits=mt,N.significantDigits=mt)),zt&&!Ht&&(N.isLargest?(N.wholeValue=qt,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),Ct&&!Ht&&(N.isSmallest?(N.wholeValue=Ke,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),N.isSmallest||N.significantDigits&&N.significantDigits-N.wholeValue.toString().length<=0?Pe<0?N.value=Cn(N.wholeValue,Pe):Pe===0?N.value=Ot(N.wholeValue+N.decimalValue):Ee?(Te?N.value=Cn(N.rawValue,mt-N.wholeValue.toString().length):N.value=N.rawValue,N.wholeValue&&(mt-=N.wholeValue.toString().length)):(Ge.fractionDigits=Pe,Te?N.value=N.wholeValue+Cn(N.decimalValue,Pe):N.value=N.wholeValue+N.decimalValue):Ee&&N.wholeValue?(N.value=Math.round(Cn(N.wholeValue,N.significantDigits-N.wholeValue.toString().length)),mt-=N.wholeValue.toString().length):N.value=N.wholeValue,N.tokenLength>1&&(je||vt)&&(Ge.minimumIntegerDigits=N.tokenLength,Ht&&Ge.maximumSignificantDigits<N.tokenLength&&delete Ge.maximumSignificantDigits),!vt&&(N.value>0||Tt===""||E(ce,N.type)||E(ne,N.type))&&(vt=!0),N.formattedValue=f(N.value,Ge,Ie),Ge.useGrouping=!1,Ge.decimalSeparator=".",N.formattedValueEn=f(N.value,Ge,"en"),N.tokenLength===2&&N.type==="milliseconds"&&(N.formattedValueMS=f(N.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),N};if(Ue=H(Ue,kn),Ue=M(Ue),Ue.length>1){var rr=function(N){return E(Ue,function(Be){return Be.type===N})},Bn=function(N){var Be=rr(N.type);Be&&x(N.targets,function(Ge){var yt=rr(Ge.type);yt&&parseInt(Be.formattedValueEn,10)===Ge.value&&(Be.rawValue=0,Be.wholeValue=0,Be.decimalValue=0,yt.rawValue+=1,yt.wholeValue+=1,yt.decimalValue=0,yt.formattedValueEn=yt.wholeValue.toString(),Ht=!0)})};x(s,Bn)}return Ht&&(vt=!1,mt=pt,Ue=H(Ue,kn),Ue=M(Ue)),ne&&!(zt&&!P.trim)?(Ue=H(Ue,function(N){return E(ne,function(Be){return N.type===Be})?N:null}),Ue=M(Ue)):(_t&&(Ue=C(Ue,function(N){return!N.isSmallest&&!N.wholeValue&&!E(ce,N.type)})),Ce&&Ue.length&&(Ue=Ue.slice(0,Ce)),On&&Ue.length>1&&(Ue=R(Ue,function(N){return!N.wholeValue&&!E(ce,N.type)&&!N.isLargest})),Ut&&(Ue=H(Ue,function(N,Be){return Be>0&&Be<Ue.length-1&&!N.wholeValue?null:N}),Ue=M(Ue)),pn&&Ue.length===1&&!Ue[0].wholeValue&&!(!Te&&Ue[0].isSmallest&&Ue[0].rawValue<Ke)&&(Ue=[])),pe?Ue:(x(en,function(N){var Be=it[N.type],Ge=E(Ue,function(bt){return bt.type===N.type});if(!(!Be||!Ge)){var yt=Ge.formattedValueEn.split(".");yt[0]=parseInt(yt[0],10),yt[1]?yt[1]=parseFloat("0."+yt[1],10):yt[1]=null;var wn=xe.durationPluralKey(Be,yt[0],yt[1]),un=m(Be,xe),ve=!1,ut={};x(xe._durationLabelTypes,function(bt){var Zt=E(un,function(Xt){return Xt.type===bt.type&&Xt.key===wn});Zt&&(ut[Zt.type]=Zt.label,c(N.text,bt.string)&&(N.text=N.text.replace(bt.string,Zt.label),ve=!0))}),et&&!ve&&(un.sort(g),x(un,function(bt){if(ut[bt.type]===bt.label)return c(N.text,bt.label)?!1:void 0;if(c(N.text,bt.label))return N.text=N.text.replace(bt.label,ut[bt.type]),!1}))}}),en=H(en,function(N){if(!N.type)return N.text;var Be=E(Ue,function(yt){return yt.type===N.type});if(!Be)return"";var Ge="";return Ae&&(Ge+=N.text),(de&&zt||!de&&Ct)&&(Ge+="< ",zt=!1,Ct=!1),(de&&Ct||!de&&zt)&&(Ge+="> ",zt=!1,Ct=!1),de&&(Be.value>0||Tt===""||E(ce,Be.type)||E(ne,Be.type))&&(Ge+="-",de=!1),N.type==="milliseconds"&&Be.formattedValueMS?Ge+=Be.formattedValueMS:Ge+=Be.formattedValue,Ae||(Ge+=N.text),Ge}),en.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function te(){var z=this.duration,P=function(de){return z._data[de]},G=E(this.types,P),le=I(this.types,P);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===le)return"d __";case"weeks":return G===le?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===le)return"M __";case"years":return G===le?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ue(z){if(!z)throw"Moment Duration Format init cannot find moment instance.";z.duration.format=K,z.duration.fn.format=se,z.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:te,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},z.updateLocale("en",y)}var fe=function(z,P,G){return z.toLocaleString(P,G)};r=q()&&ee(fe),o=r&&ie(fe);var ae=function(z,P,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,G).format(z)};return i=ee(ae),l=i&&ie(ae),ue(n),ue})}(pl)),pl.exports}S0();const M0=["true","t","yes","y","on","1"],R0=["false","f","no","n","off","0"];function Et(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function ao(e){return Object.hasOwn(e,"isError")&&e.isError}function E0(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Hi(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function gl(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function I0(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function ml(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 Uo(e,t){return _e(e)?t||{}:_e(t)?e||{}:Lh(e,t)}function Fu(e){if(_e(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:ft(n)):[ft(t)]}catch{return[ft(e)]}}function T0(e){return e&&e.startsWith("{")&&e.endsWith("}")}function ft(e){try{try{return C0(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Au(e){if(_e(e))return null;if(typeof e=="boolean")return e;const t=ft(e).toLowerCase().trim();if(t==="")return null;if(M0.includes(t))return!0;if(R0.includes(t))return!1}function Xo(e){if(_e(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=fi.unformat(e.trim());if(st(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Fi(e){if(_e(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ft(e)}}function O0(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 _r(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 Ai(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":_e(t)||t===""?st(n)?(n===0&&(e=Math.round(e)),fi(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):fi(e).format({thousandSeparated:!1,mantissa:O0(e),trimMantissa:!0}):t==="plain"?fi(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?_r(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?_r(e,{style:"percent",minimumFractionDigits:st(n)?Math.max(n-2,0):0,maximumFractionDigits:st(n)?Math.max(n-2,0):2}):t==="dollar"?_r(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?_r(e,{style:"currency",currency:"EUR",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?_r(e,{style:"currency",currency:"JPY",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?_r(e,{notation:t}):t==="accounting"?fi(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?_r(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):uC.sprintf(t,e)}function Lu(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(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).format(e.toDate());throw l}}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 Li(e){if(_e(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Zr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Zr.utc(e);if(n.isValid())return n.toDate();const r=Zr.utc(e,[Zr.HTML5_FMT.TIME_MS,Zr.HTML5_FMT.TIME_SECONDS,Zr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function zu(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 D0(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 P0=new RegExp(/(\r\n|\n|\r)/gm);function Go(e){return e.indexOf(`
|
|
177
177
|
`)!==-1?e.replace(P0," "):e}function H0(e,t){if(_e(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const F0=Un("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"}}),""),vl=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?ws.parse(e):ws.parse(ws.stringify(e))}catch{n=void 0}return _e(n)?ye.jsx(Hr,{highlight:!0,autoFocus:!1,disabled:!0,value:Fi(e)??"",onChange:()=>{}}):ye.jsx(F0,{"data-testid":"stJsonColumnViewer",children:ye.jsx(Jy,{src:n,collapsed:2,theme:ex(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(vl);const A0=e=>{const t=e.theme,n=e.value.data;return ye.jsx(vl,{jsonValue:n.value||n.displayValue,theme:t})},L0=e=>{const t=e.theme,n=e.value;return ye.jsx(vl,{jsonValue:n.data,theme:t})},z0={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return $a(e,r??Fi(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??Fi(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:A0})},_u="line_chart",_0="area_chart",Vu="bar_chart";function bl(e,t,n){const r=Uo({y_min:null,y_max:null},t.columnTypeOptions),o={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[r.y_min??0,r.y_max??1]}};return{...t,kind:e,typeIcon:e===_u?":material/show_chart:":e===Vu?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(i){if(_e(i))return gl();const l=Fu(i),a=[];let s=[];if(l.length===0)return gl();let c=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER;for(let f=0;f<l.length;f++){const g=Xo(l[f]);if(Number.isNaN(g)||_e(g))return Et(ft(l),`The value cannot be interpreted as a numeric array. ${ft(g)} is not a number.`);g>c&&(c=g),g<u&&(u=g),a.push(g)}let h,p;if(l.length===1){let f;c<=0?f=c===0?1:0:f=c,h=r.y_max??f,p=r.y_min??(c>=0?0:c)}else h=r.y_max??c,p=r.y_min??u;return _e(p)||_e(h)||Number.isNaN(p)||Number.isNaN(h)||p>=h?Et("Invalid min/max y-axis configuration",`The y_min (${p}) and y_max (${h}) configuration options must be valid numbers.`):(a.length>0&&(c>h||u<p)?s=a.map(f=>c-u===0?c>(h||1)?h:p:(h-p)*((f-u)/(c-u))+p):s=a,{...o,copyData:a.join(","),data:{...o.data,values:s,displayValues:a.map(f=>Ai(f)),yAxis:[p,h]},isMissingValue:_e(i)})},getCellValue(i){return i.kind===Z.Loading||i.data?.values===void 0?null:i.data?.values}}}function Nu(e){return bl(_u,e,"line")}Nu.isEditableType=!1;function Bu(e){return bl(Vu,e,"bar")}Bu.isEditableType=!1;function Wu(e){return bl(_0,e,"area")}Wu.isEditableType=!1;function wl(e){const t={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",getCell(n){let r=null;return r=Au(n),r===void 0?Et(ft(n),"The value cannot be interpreted as boolean."):{...t,data:r,isMissingValue:_e(r)}},getCellValue(n){return n.data===void 0?null:n.data}}}wl.isEditableType=!0;function $u(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function yl(e,t,n,r,o,i,l){const a=Uo({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(st(a.timezone))try{s=$u(zh(),a.timezone)?.utcOffset()||void 0}catch{}let c;st(a.min_value)&&(c=Li(a.min_value)||void 0);let u;st(a.max_value)&&(u=Li(a.max_value)||void 0);const h={kind:Z.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:c,max:u}},p=f=>{const g=Li(f);return g===null?!t.isRequired:!(g===void 0||st(c)&&i(g)<i(c)||st(u)&&i(g)>i(u))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:p,getCell(f,g){if(g===!0){const k=p(f);if(k===!1)return Et(ft(f),"Invalid input.");k instanceof Date&&(f=k)}const m=Li(f);let b="",y="",w=s;if(m===void 0)return Et(ft(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let k=zh.utc(m);if(!k.isValid())return Et(ft(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
178
178
|
Error: ${k.toString()}`);if(a.timezone){try{k=$u(k,a.timezone)}catch(I){return Et(k.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
|
|
@@ -184,5 +184,5 @@ Error: ${i}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
|
184
184
|
40% { opacity: 1; }
|
|
185
185
|
`]))),Bv=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,l=o.spacing.baseUnit;return Fe({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:l*2})},Vl=function(e){var t=e.delay,n=e.offset;return De("span",{css:Hl({animation:"".concat(Nv," 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"},"","")})},Wv=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=sr(e,Pv);return De("div",$e({},Kt(Fe(Fe({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),De(Vl,{delay:0,offset:n}),De(Vl,{delay:160,offset:!0}),De(Vl,{delay:320,offset:!n}))},$v=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,l=o.borderRadius,a=o.spacing;return Fe({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:l,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},jv=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,l=e.menuIsOpen;return De("div",$e({ref:o},Kt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":l}),i,{"aria-disabled":n||void 0}),t)},Uv=jv,Xv=["data"],Gv=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},Yv=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,l=e.headingProps,a=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return De("div",$e({},Kt(e,"group",{group:!0}),a),De(i,$e({},l,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),De("div",null,t))},Kv=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return Fe({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"})},qv=function(e){var t=yd(e);t.data;var n=sr(t,Xv);return De("div",$e({},Kt(e,"groupHeading",{"group-heading":!0}),n))},Zv=Yv,Qv=["innerRef","isDisabled","isHidden","inputClassName"],Jv=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,l=o.colors;return Fe(Fe({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},eb),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:l.neutral80})},Pd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},eb={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pd)},tb=function(e){return Fe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Pd)},nb=function(e){var t=e.cx,n=e.value,r=yd(e),o=r.innerRef,i=r.isDisabled,l=r.isHidden,a=r.inputClassName,s=sr(r,Qv);return De("div",$e({},Kt(e,"input",{"input-container":!0}),{"data-value":n||""}),De("input",$e({className:t({input:!0},a),ref:o,style:tb(l),disabled:i},s)))},rb=nb,ob=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},ib=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return Fe({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})},ab=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,l=e.isFocused;return Fe({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:l?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Hd=function(e){var t=e.children,n=e.innerProps;return De("div",n,t)},lb=Hd,sb=Hd;function cb(e){var t=e.children,n=e.innerProps;return De("div",$e({role:"button"},n),t||De(_l,{size:14}))}var ub=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,l=e.removeProps,a=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return De(s,{data:r,innerProps:Fe(Fe({},Kt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:a},De(c,{data:r,innerProps:Fe({},Kt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),De(u,{data:r,innerProps:Fe(Fe({},Kt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},l),selectProps:a}))},db=ub,hb=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,l=i.spacing,a=i.colors;return Fe({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(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?a.primary:a.primary50}})},fb=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,l=e.innerProps;return De("div",$e({},Kt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},l),t)},pb=fb,gb=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},mb=function(e){var t=e.children,n=e.innerProps;return De("div",$e({},Kt(e,"placeholder",{placeholder:!0}),n),t)},vb=mb,bb=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return Fe({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})},wb=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return De("div",$e({},Kt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},yb=wb,Fd={ClearIndicator:zv,Control:Uv,DropdownIndicator:Av,DownChevron:Od,CrossIcon:_l,Group:Zv,GroupHeading:qv,IndicatorsContainer:Ov,IndicatorSeparator:Vv,Input:rb,LoadingIndicator:Wv,Menu:mv,MenuList:bv,MenuPortal:Sv,LoadingMessage:Cv,NoOptionsMessage:xv,MultiValue:db,MultiValueContainer:lb,MultiValueLabel:sb,MultiValueRemove:cb,Option:pb,Placeholder:vb,SelectContainer:Rv,SingleValue:yb,ValueContainer:Iv},xb=function(e){return Fe(Fe({},Fd),e.components)},Ad=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Cb(e,t){return!!(e===t||Ad(e)&&Ad(t))}function kb(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Cb(e[n],t[n]))return!1;return!0}function Sb(e,t){t===void 0&&(t=kb);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 l=e.apply(this,o);return n={lastResult:l,lastArgs:o,lastThis:this},l}return r.clear=function(){n=null},r}for(var Mb={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"},Rb=function(e){return De("span",$e({css:Mb},e))},Ld=Rb,Eb={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,l=e.selectValue,a=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(f,g){return f&&f.length?"".concat(f.indexOf(g)+1," of ").concat(f.length):""};if(t==="value"&&l)return"value ".concat(i," focused, ").concat(u(l,n),".");if(t==="menu"&&c){var h=a?" disabled":"",p="".concat(s?" selected":"").concat(h);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Ib=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,l=e.selectValue,a=e.selectProps,s=e.id,c=e.isAppleDevice,u=a.ariaLiveMessages,h=a.getOptionLabel,p=a.inputValue,f=a.isMulti,g=a.isOptionDisabled,m=a.isSearchable,b=a.menuIsOpen,y=a.options,w=a.screenReaderStatus,k=a.tabSelectsValue,I=a.isLoading,E=a["aria-label"],x=a["aria-live"],H=d.useMemo(function(){return Fe(Fe({},Eb),u||{})},[u]),O=d.useMemo(function(){var D="";if(t&&H.onChange){var S=t.option,Q=t.options,$=t.removedValue,q=t.removedValues,ie=t.value,ee=function(ae){return Array.isArray(ae)?null:ae},K=$||S||ee(ie),se=K?h(K):"",te=Q||q||void 0,ue=te?te.map(h):[],fe=Fe({isDisabled:K&&g(K,l),label:se,labels:ue},t);D=H.onChange(fe)}return D},[t,H,g,l,h]),M=d.useMemo(function(){var D="",S=n||r,Q=!!(n&&l&&l.includes(n));if(S&&H.onFocus){var $={focused:S,label:h(S),isDisabled:g(S,l),isSelected:Q,options:o,context:S===n?"menu":"value",selectValue:l,isAppleDevice:c};D=H.onFocus($)}return D},[n,r,h,g,H,o,l,c]),F=d.useMemo(function(){var D="";if(b&&y.length&&!I&&H.onFilter){var S=w({count:o.length});D=H.onFilter({inputValue:p,resultsMessage:S})}return D},[o,p,b,H,y,w,I]),T=t?.action==="initial-input-focus",C=d.useMemo(function(){var D="";if(H.guidance){var S=r?"value":b?"menu":"input";D=H.guidance({"aria-label":E,context:S,isDisabled:n&&g(n,l),isMulti:f,isSearchable:m,tabSelectsValue:k,isInitialFocus:T})}return D},[E,n,r,f,g,m,b,H,l,k,T]),R=De(d.Fragment,null,De("span",{id:"aria-selection"},O),De("span",{id:"aria-focused"},M),De("span",{id:"aria-results"},F),De("span",{id:"aria-guidance"},C));return De(d.Fragment,null,De(Ld,{id:s},T&&R),De(Ld,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!T&&R))},Tb=Ib,Nl=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],Ob=new RegExp("["+Nl.map(function(e){return e.letters}).join("")+"]","g"),zd={},Bl=0;Bl<Nl.length;Bl++)for(var Wl=Nl[Bl],$l=0;$l<Wl.letters.length;$l++)zd[Wl.letters[$l]]=Wl.base;var _d=function(e){return e.replace(Ob,function(t){return zd[t]})},Db=Sb(_d),Vd=function(e){return e.replace(/^\s+|\s+$/g,"")},Pb=function(e){return"".concat(e.label," ").concat(e.value)},Hb=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:Pb,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,l=r.stringify,a=r.trim,s=r.matchFrom,c=a?Vd(n):n,u=a?Vd(l(t)):l(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=Db(c),u=_d(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Fb=["innerRef"];function Ab(e){var t=e.innerRef,n=sr(e,Fb),r=sv(n,"onExited","in","enter","exit","appear");return De("input",$e({ref:t},r,{css:Hl({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 Lb=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function zb(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,l=d.useRef(!1),a=d.useRef(!1),s=d.useRef(0),c=d.useRef(null),u=d.useCallback(function(b,y){if(c.current!==null){var w=c.current,k=w.scrollTop,I=w.scrollHeight,E=w.clientHeight,x=c.current,H=y>0,O=I-E-k,M=!1;O>y&&l.current&&(r&&r(b),l.current=!1),H&&a.current&&(i&&i(b),a.current=!1),H&&y>O?(n&&!l.current&&n(b),x.scrollTop=I,M=!0,l.current=!0):!H&&-y>k&&(o&&!a.current&&o(b),x.scrollTop=0,M=!0,a.current=!0),M&&Lb(b)}},[n,r,o,i]),h=d.useCallback(function(b){u(b,b.deltaY)},[u]),p=d.useCallback(function(b){s.current=b.changedTouches[0].clientY},[]),f=d.useCallback(function(b){var y=s.current-b.changedTouches[0].clientY;u(b,y)},[u]),g=d.useCallback(function(b){if(b){var y=iv?{passive:!1}:!1;b.addEventListener("wheel",h,y),b.addEventListener("touchstart",p,y),b.addEventListener("touchmove",f,y)}},[f,p,h]),m=d.useCallback(function(b){b&&(b.removeEventListener("wheel",h,!1),b.removeEventListener("touchstart",p,!1),b.removeEventListener("touchmove",f,!1))},[f,p,h]);return d.useEffect(function(){if(t){var b=c.current;return g(b),function(){m(b)}}},[t,g,m]),function(b){c.current=b}}var Nd=["boxSizing","height","overflow","paddingRight","position"],Bd={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Wd(e){e.cancelable&&e.preventDefault()}function $d(e){e.stopPropagation()}function jd(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ud(){return"ontouchstart"in window||navigator.maxTouchPoints}var Xd=!!(typeof window<"u"&&window.document&&window.document.createElement),Zo=0,lo={capture:!1,passive:!1};function _b(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),l=d.useCallback(function(s){if(Xd){var c=document.body,u=c&&c.style;if(r&&Nd.forEach(function(g){var m=u&&u[g];o.current[g]=m}),r&&Zo<1){var h=parseInt(o.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,f=window.innerWidth-p+h||0;Object.keys(Bd).forEach(function(g){var m=Bd[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&Ud()&&(c.addEventListener("touchmove",Wd,lo),s&&(s.addEventListener("touchstart",jd,lo),s.addEventListener("touchmove",$d,lo))),Zo+=1}},[r]),a=d.useCallback(function(s){if(Xd){var c=document.body,u=c&&c.style;Zo=Math.max(Zo-1,0),r&&Zo<1&&Nd.forEach(function(h){var p=o.current[h];u&&(u[h]=p)}),c&&Ud()&&(c.removeEventListener("touchmove",Wd,lo),s&&(s.removeEventListener("touchstart",jd,lo),s.removeEventListener("touchmove",$d,lo)))}},[r]);return d.useEffect(function(){if(t){var s=i.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){i.current=s}}var Vb=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Nb={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Bb(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,c=zb({isEnabled:o,onBottomArrive:i,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),u=_b({isEnabled:n}),h=function(p){c(p),u(p)};return De(d.Fragment,null,n&&De("div",{onClick:Vb,css:Nb}),t(h))}var Wb={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},$b=function(e){var t=e.name,n=e.onFocus;return De("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Wb,value:"",onChange:function(){}})},jb=$b;function jl(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 Ub(){return jl(/^iPhone/i)}function Gd(){return jl(/^Mac/i)}function Xb(){return jl(/^iPad/i)||Gd()&&navigator.maxTouchPoints>1}function Gb(){return Ub()||Xb()}function Yb(){return Gd()||Gb()}var Kb=function(e){return e.label},qb=function(e){return e.label},Zb=function(e){return e.value},Qb=function(e){return!!e.isDisabled},Jb={clearIndicator:Lv,container:Mv,control:$v,dropdownIndicator:Fv,group:Gv,groupHeading:Kv,indicatorsContainer:Tv,indicatorSeparator:_v,input:Jv,loadingIndicator:Bv,loadingMessage:yv,menu:fv,menuList:vv,menuPortal:kv,multiValue:ob,multiValueLabel:ib,multiValueRemove:ab,noOptionsMessage:wv,option:hb,placeholder:gb,singleValue:bb,valueContainer:Ev},ew={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%)"},tw=4,Yd=4,nw=38,rw=Yd*2,ow={baseUnit:Yd,controlHeight:nw,menuGutter:rw},Ul={borderRadius:tw,colors:ew,spacing:ow},iw={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:kd(),captureMenuScroll:!kd(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Hb(),formatGroupLabel:Kb,getOptionLabel:qb,getOptionValue:Zb,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Qb,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!rv(),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 Kd(e,t,n,r){var o=eh(e,t,n),i=th(e,t,n),l=Jd(e,t),a=Zi(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:l,value:a,index:r}}function qi(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(l,a){return Kd(e,l,t,a)}).filter(function(l){return Qd(e,l)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Kd(e,n,t,r);return Qd(e,i)?i:void 0}).filter(av)}function qd(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Cs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Zd(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Cs(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 aw(e,t){return qd(qi(e,t))}function Qd(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,l=t.label,a=t.value;return(!rh(e)||!i)&&nh(e,{label:l,value:a,data:o},r)}function lw(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 sw(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Xl=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},Jd=function(e,t){return e.getOptionLabel(t)},Zi=function(e,t){return e.getOptionValue(t)};function eh(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function th(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Zi(e,t);return n.some(function(o){return Zi(e,o)===r})}function nh(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var rh=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},cw=1,oh=function(e){mC(n,e);var t=wC(n);function n(r){var o;if(bC(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(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,c){var u=o.props,h=u.onChange,p=u.name;c.name=p,o.ariaOnChange(s,c),h(s,c)},o.setValue=function(s,c,u){var h=o.props,p=h.closeMenuOnSelect,f=h.isMulti,g=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:g}),p&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,h=c.isMulti,p=c.name,f=o.state.selectValue,g=h&&o.isOptionSelected(s,f),m=o.isOptionDisabled(s,f);if(g){var b=o.getOptionValue(s);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==b}),"deselect-option",s)}else if(!m)h?o.setValue([].concat(Cs(f),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:p});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,h=o.getOptionValue(s),p=u.filter(function(g){return o.getOptionValue(g)!==h}),f=Ki(c,p,p[0]||null);o.onChange(f,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(Ki(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,c=o.state.selectValue,u=c[c.length-1],h=c.slice(0,c.length-1),p=Ki(s,h,h[0]||null);u&&o.onChange(p,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return Xl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Zd(qi(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return Q1.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return Jd(o.props,s)},o.getOptionValue=function(s){return Zi(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,h=Jb[s](c,u);h.boxSizing="border-box";var p=o.props.styles[s];return p?p(h,c):h},o.getClassNames=function(s,c){var u,h;return(u=(h=o.props.classNames)[s])===null||u===void 0?void 0:u.call(h,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return xb(o.props)},o.buildCategorizedOptions=function(){return qi(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return qd(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:Fe({value:s},c)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var c=o.props,u=c.isMulti,h=c.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!u}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ui(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var h=Math.abs(u.clientX-o.initialTouchX),p=Math.abs(u.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||p>f}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var c=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return rh(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,h=c.backspaceRemovesValue,p=c.escapeClearsValue,f=c.inputValue,g=c.isClearable,m=c.isDisabled,b=c.menuIsOpen,y=c.onKeyDown,w=c.tabSelectsValue,k=c.openMenuOnFocus,I=o.state,E=I.focusedOption,x=I.focusedValue,H=I.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||f)return;o.focusValue("previous");break;case"ArrowRight":if(!u||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(x)o.removeValue(x);else{if(!h)return;u?o.popValue():g&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!b||!w||!E||k&&o.isOptionSelected(E,H))return;o.selectOption(E);break;case"Enter":if(s.keyCode===229)break;if(b){if(!E||o.isComposing)return;o.selectOption(E);break}return;case"Escape":b?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):g&&p&&o.clearValue();break;case" ":if(f)return;if(!b){o.openMenu("first");break}if(!E)return;o.selectOption(E);break;case"ArrowUp":b?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":b?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!b)return;o.focusOption("pageup");break;case"PageDown":if(!b)return;o.focusOption("pagedown");break;case"Home":if(!b)return;o.focusOption("first");break;case"End":if(!b)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++cw),o.state.selectValue=wd(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),l=o.buildFocusableOptions(),a=l.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=l[a],o.state.focusedOptionId=Xl(i,l[a])}return o}return vC(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&&Cd(this.menuListRef,this.focusedOptionRef),Yb()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,l=o.menuIsOpen,a=this.state.isFocused;(a&&!i&&r.isDisabled||a&&l&&!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&&(Cd(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,l=i.selectValue,a=i.isFocused,s=this.buildFocusableOptions(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(l[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=i.indexOf(l);l||(a=-1);var s=i.length-1,c=-1;if(i.length){switch(r){case"previous":a===0?c=0:a===-1?c=s:c=a-1;break;case"next":a>-1&&a<s&&(c=a+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var a=0,s=l.indexOf(i);i||(s=-1),r==="up"?a=s>0?s-1:l.length-1:r==="down"?a=(s+1)%l.length:r==="pageup"?(a=s-o,a<0&&(a=0)):r==="pagedown"?(a=s+o,a>l.length-1&&(a=l.length-1)):r==="last"&&(a=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ul):Fe(Fe({},Ul),this.props.theme):Ul}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,l=this.getClassNames,a=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,h=u.isMulti,p=u.isRtl,f=u.options,g=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:l,getValue:a,hasValue:g,isMulti:h,isRtl:p,options:f,selectOption:s,selectProps:u,setValue:c,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 eh(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return th(this.props,r,o)}},{key:"filterOption",value:function(r,o){return nh(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:l})}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,l=r.inputId,a=r.inputValue,s=r.tabIndex,c=r.form,u=r.menuIsOpen,h=r.required,p=this.getComponents(),f=p.Input,g=this.state,m=g.inputIsHidden,b=g.ariaSelection,y=this.commonProps,w=l||this.getElementId("input"),k=Fe(Fe(Fe({"aria-autocomplete":"list","aria-expanded":u,"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||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,$e({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:w,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:a},k)):d.createElement(Ab,$e({id:w,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ji,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},k))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,l=o.MultiValueContainer,a=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,h=this.commonProps,p=this.props,f=p.controlShouldRenderValue,g=p.isDisabled,m=p.isMulti,b=p.inputValue,y=p.placeholder,w=this.state,k=w.selectValue,I=w.focusedValue,E=w.isFocused;if(!this.hasValue()||!f)return b?null:d.createElement(u,$e({},h,{key:"placeholder",isDisabled:g,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return k.map(function(H,O){var M=H===I,F="".concat(r.getOptionLabel(H),"-").concat(r.getOptionValue(H));return d.createElement(i,$e({},h,{components:{Container:l,Label:a,Remove:s},isFocused:M,isDisabled:g,key:F,index:O,removeProps:{onClick:function(){return r.removeValue(H)},onTouchEnd:function(){return r.removeValue(H)},onMouseDown:function(T){T.preventDefault()}},data:H}),r.formatOptionLabel(H,"value"))});if(b)return null;var x=k[0];return d.createElement(c,$e({},h,{data:x,isDisabled:g}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||a||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,$e({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return d.createElement(o,$e({},i,{innerProps:u,isDisabled:a,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused;return d.createElement(i,$e({},l,{isDisabled:a,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,l=this.props.isDisabled,a=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,$e({},i,{innerProps:s,isDisabled:l,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,l=o.GroupHeading,a=o.Menu,s=o.MenuList,c=o.MenuPortal,u=o.LoadingMessage,h=o.NoOptionsMessage,p=o.Option,f=this.commonProps,g=this.state.focusedOption,m=this.props,b=m.captureMenuScroll,y=m.inputValue,w=m.isLoading,k=m.loadingMessage,I=m.minMenuHeight,E=m.maxMenuHeight,x=m.menuIsOpen,H=m.menuPlacement,O=m.menuPosition,M=m.menuPortalTarget,F=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,C=m.noOptionsMessage,R=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!x)return null;var S=function(K,se){var te=K.type,ue=K.data,fe=K.isDisabled,ae=K.isSelected,z=K.label,P=K.value,G=g===ue,le=fe?void 0:function(){return r.onOptionHover(ue)},de=fe?void 0:function(){return r.selectOption(ue)},Oe="".concat(r.getElementId("option"),"-").concat(se),ge={id:Oe,onClick:de,onMouseMove:le,onMouseOver:le,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:ae};return d.createElement(p,$e({},f,{innerProps:ge,data:ue,isDisabled:fe,isSelected:ae,key:Oe,label:z,type:te,value:P,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(K.data,"menu"))},Q;if(this.hasOptions())Q=this.getCategorizedOptions().map(function(K){if(K.type==="group"){var se=K.data,te=K.options,ue=K.index,fe="".concat(r.getElementId("group"),"-").concat(ue),ae="".concat(fe,"-heading");return d.createElement(i,$e({},f,{key:fe,data:se,options:te,Heading:l,headingProps:{id:ae,data:K.data},label:r.formatGroupLabel(K.data)}),K.options.map(function(z){return S(z,"".concat(ue,"-").concat(z.index))}))}else if(K.type==="option")return S(K,"".concat(K.index))});else if(w){var $=k({inputValue:y});if($===null)return null;Q=d.createElement(u,f,$)}else{var q=C({inputValue:y});if(q===null)return null;Q=d.createElement(h,f,q)}var ie={minMenuHeight:I,maxMenuHeight:E,menuPlacement:H,menuPosition:O,menuShouldScrollIntoView:T},ee=d.createElement(pv,$e({},f,ie),function(K){var se=K.ref,te=K.placerProps,ue=te.placement,fe=te.maxHeight;return d.createElement(a,$e({},f,ie,{innerRef:se,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:w,placement:ue}),d.createElement(Bb,{captureEnabled:b,onTopArrive:R,onBottomArrive:D,lockEnabled:F},function(ae){return d.createElement(s,$e({},f,{innerRef:function(z){r.getMenuListRef(z),ae(z)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:w,maxHeight:fe,focusedOption:g}),Q)}))});return M||O==="fixed"?d.createElement(c,$e({},f,{appendTo:M,controlElement:this.controlRef,menuPlacement:H,menuPosition:O}),ee):ee}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,l=o.isDisabled,a=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!l)return d.createElement(jb,{name:s,onFocus:this.onValueInputFocus});if(!(!s||l))if(a)if(i){var h=u.map(function(g){return r.getOptionValue(g)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:h})}else{var p=u.length>0?u.map(function(g,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(g)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,p)}else{var f=u[0]?this.getOptionValue(u[0]):"";return d.createElement("input",{name:s,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,l=o.focusedOption,a=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return d.createElement(Tb,$e({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:l,focusedValue:a,isFocused:s,selectValue:c,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,l=r.SelectContainer,a=r.ValueContainer,s=this.props,c=s.className,u=s.id,h=s.isDisabled,p=s.menuIsOpen,f=this.state.isFocused,g=this.commonProps=this.getCommonProps();return d.createElement(l,$e({},g,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,$e({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:p}),d.createElement(a,$e({},g,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,$e({},g,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,l=o.clearFocusValueOnUpdate,a=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,c=o.isFocused,u=o.prevWasFocused,h=o.instancePrefix,p=r.options,f=r.value,g=r.menuIsOpen,m=r.inputValue,b=r.isMulti,y=wd(f),w={};if(i&&(f!==i.value||p!==i.options||g!==i.menuIsOpen||m!==i.inputValue)){var k=g?aw(r,y):[],I=g?Zd(qi(r,y),"".concat(h,"-option")):[],E=l?lw(o,y):null,x=sw(o,k),H=Xl(I,x);w={selectValue:y,focusedOption:x,focusedOptionId:H,focusableOptionsWithIds:I,focusedValue:E,clearFocusValueOnUpdate:!1}}var O=a!=null&&r!==i?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},M=s,F=c&&u;return c&&!F&&(M={value:Ki(b,y,y[0]||null),options:y,action:"initial-input-focus"},F=!u),s?.action==="initial-input-focus"&&(M=null),Fe(Fe(Fe({},w),O),{},{prevProps:r,ariaSelection:M,prevWasFocused:F})}}]),n}(d.Component);oh.defaultProps=iw;var uw=d.forwardRef(function(e,t){var n=p1(e);return d.createElement(oh,$e({ref:t},n))}),dw=uw;const hw=e=>{const{Menu:t}=Fd,{children:n,...r}=e;return d.createElement(t,{...r},n)},fw=rn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),pw=rn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),gw=rn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),mw=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:l}=t.data,[a,s]=d.useState(l),[c,u]=d.useState(r??""),h=kp(),p=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(gw,null,d.createElement(Hr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):d.createElement(fw,null,d.createElement(dw,{className:"glide-select",inputValue:c,onInputChange:u,menuPlacement:"auto",value:p.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:g})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:g?"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(pw,null,d.createElement(hw,{className:"click-outside-ignore",...f}))},options:p,onChange:async f=>{f!==null&&(s(f.value),await new Promise(g=>window.requestAnimationFrame(g)),n({...t,data:{...t.data,value:f.value}}))}}))},vw={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),a=typeof l=="string"?l:l?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,o.x+r.cellHorizontalPadding,o.y+o.height/2+Gn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:mw,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 bw(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],l=o*t;return e.replace(n,`${Number(l.toPrecision(3))}${i}`)}return e}const ww={marginRight:8},yw={display:"flex",alignItems:"center",flexGrow:1},xw={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:l,value:a,label:s,measureLabel:c}=t.data,u=o.x+r.cellHorizontalPadding,h=o.y+o.height/2,p=l-i,f=(a-i)/p,g=`${bw(r.baseFontStyle,.9)} ${r.fontFamily}`,m=ja(n,g)/2;n.save();let b=0;s!==void 0&&(n.font=g,b=Lr(c??s,n,g).width+r.cellHorizontalPadding);const y=o.width-r.cellHorizontalPadding*2-b;if(y>=m){const w=n.createLinearGradient(u,h,u+y,h);w.addColorStop(0,r.accentColor),w.addColorStop(f,r.accentColor),w.addColorStop(f,r.bgBubble),w.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=w,ad(n,u,h-m/2,y,m,m/2),n.fill(),n.beginPath(),ad(n,u+.5,h-m/2+.5,y-1,m-1,(m-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,h+Gn(n,g))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:yw},d.createElement("input",{style:ww,type:"range",value:r,min:o,max:i,step:l,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}}},Cw=rn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Gl=(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}`)}},kw=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,l=t.min instanceof Date?Gl(n,t.min,i):t.min,a=t.max instanceof Date?Gl(n,t.max,i):t.max,s=Gl(n,t.date,i);return e.value.readonly?Bt.createElement(Hr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Bt.createElement(Cw,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:o,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-i)}})}})},Sw={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return $a(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:kw}),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)}}},Mw="None";function ih(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 Rw=e=>{const{cell:t,theme:n,ctx:r}=e;$a({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Mw,t.contentAlign),r.fillStyle=n.textDark};function Ew(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:l,ctx:a,rect:s}=r,c=r.col;if(ao(i))ih(a,s,l);else if(Hi(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():Rw(r),u.isRequired&&u.isEditable&&ih(a,s,l);return}o()},[e]),n=d.useMemo(()=>[h1,vw,xw,Sw,...N0],[]);return{drawCell:t,customRenderers:n}}function Iw(){const e=Qr();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:So(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:So(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:So(e.colors.darkenedBgMix100,.9),bgHeaderHovered:So(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(cn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${cn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${cn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:So(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(cn(e.spacing.sm)),cellVerticalPadding:Math.round(cn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(cn("1.25rem")),bubblePadding:Math.round(cn(e.spacing.sm)),bubbleMargin:Math.round(cn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(cn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(cn("25rem")),minColumnWidth:Math.round(cn("3.125rem")),maxColumnWidth:Math.round(cn("62.5rem")),maxColumnAutoWidth:Math.round(cn("31.25rem")),defaultRowHeight:Math.round(cn("2.1875rem")),defaultHeaderHeight:Math.round(cn("2.1875rem")),bgRowHovered:qx(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const Tw=ba.getLogger("useDataEditor");function Ow(e,t,n,r,o,i,l,a,s){const c=d.useCallback(([m,b],y)=>{const w=e[m];if(!w.isEditable)return;const k=w.indexNumber,I=n.current.getOriginalRowIndex(o(b)),E=r([m,b]),x=w.getCellValue(E),H=w.getCellValue(y);if(!ao(E)&&H===x)return;const O=w.getCell(H,!0);ao(O)?Tw.warn(`Not applying the cell edit since it causes this error:
|
|
186
186
|
${O.data}`):(n.current.setCell(k,I,{...O,lastUpdated:performance.now()}),a())},[e,n,o,r,a]),u=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(b=>{m.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(m),l()},[e,n,t,l]),h=d.useCallback(()=>{t||(u(),a())},[u,a,t]),p=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const b=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(b),l(),s(),a(),!1}if(m.current?.range){const b=[],y=m.current.range;for(let w=y.y;w<y.y+y.height;w++)for(let k=y.x;k<y.x+y.width;k++){const I=e[k];I.isEditable&&!I.isRequired&&(b.push({cell:[k,w]}),c([k,w],I.getCell(null)))}return b.length>0&&(a(),i(b)),!1}return!0},[e,n,t,i,o,a,c,s,l]),f=d.useCallback((m,b)=>{const[y,w]=m,k=[];for(let I=0;I<b.length;I++){const E=b[I];if(I+w>=n.current.getNumRows()){if(t)break;u()}for(let x=0;x<E.length;x++){const H=E[x],O=I+w,M=x+y;if(M>=e.length)break;const F=e[M];if(F.isEditable){const T=F.getCell(H,!0);if(st(T)&&!ao(T)){const C=F.indexNumber,R=n.current.getOriginalRowIndex(o(O)),D=F.getCellValue(r([M,O]));F.getCellValue(T)!==D&&(n.current.setCell(C,R,{...T,lastUpdated:performance.now()}),k.push({cell:[M,O]}))}}}k.length>0&&(a(),i(k))}return!1},[e,n,t,o,r,u,a,i]),g=d.useCallback((m,b)=>{const y=m[0];if(y>=e.length)return!0;const w=e[y];if(w.validateInput){const k=w.validateInput(w.getCellValue(b));return k===!0||k===!1?k:w.getCell(k)}return!0},[e]);return{onCellEdited:c,onPaste:f,onRowAppended:h,onDelete:p,validateCell:g}}const ah=",",Qo='"',Dw='"',lh=`
|
|
187
|
-
`,Pw="\uFEFF",Hw=new RegExp(`[${[ah,Qo,lh].join("")}]`),sh=ba.getLogger("useDataExporter");function ch(e){return e.map(t=>Fw(t)).join(ah)+lh}function Fw(e){if(_e(e))return"";const t=ft(e);return Hw.test(t)?`${Qo}${t.replace(new RegExp(Qo,"g"),Dw+Qo)}${Qo}`:t}async function uh(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(Pw));const i=n.map(l=>l.name);await e.write(o.encode(ch(i)));for(let l=0;l<r;l++){const a=[];n.forEach((s,c,u)=>{a.push(s.getCellValue(t([c,l])))}),await e.write(o.encode(ch(a)))}await e.close()}function Aw(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 bs(()=>import("./es6-
|
|
187
|
+
`,Pw="\uFEFF",Hw=new RegExp(`[${[ah,Qo,lh].join("")}]`),sh=ba.getLogger("useDataExporter");function ch(e){return e.map(t=>Fw(t)).join(ah)+lh}function Fw(e){if(_e(e))return"";const t=ft(e);return Hw.test(t)?`${Qo}${t.replace(new RegExp(Qo,"g"),Dw+Qo)}${Qo}`:t}async function uh(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(Pw));const i=n.map(l=>l.name);await e.write(o.encode(ch(i)));for(let l=0;l<r;l++){const a=[];n.forEach((s,c,u)=>{a.push(s.getCellValue(t([c,l])))}),await e.write(o.encode(ch(a)))}await e.close()}function Aw(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 bs(()=>import("./es6-dD9evgqV.js").then(async l=>(await l.__tla,l)).then(l=>l.a),__vite__mapDeps([15,1,2]))).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await uh(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{sh.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let l="";const a=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await uh(a.getWriter(),e,t,n);const s=new Blob([l],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=pC({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(l){sh.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function Lw(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const l=t[o],a=l.indexNumber,s=r.current.getOriginalRowIndex(i),c=r.current.isAddedRow(s);if(l.isEditable||c){const p=r.current.getCell(a,s);if(st(p))return{...l.getCell(l.getCellValue(p),!1),lastUpdated:p.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${a}; row=${s}`)}const u=e.getCell(s,a),h=Zx(e,s,a);return q0(l,u,h,e.styler?.cssStyles)}catch(l){return Et("Error during cell creation",`This error should never happen. Please report this bug.
|
|
188
188
|
Error: ${l}`)}},[t,n,e,r])}}function zw(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 _w(e,t,n,r,o){const[i,l]=d.useState({columns:ot.empty(),rows:ot.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(xn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(xn.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(xn.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(xn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(xn.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(xn.SelectionMode.MULTI_COLUMN),h=i.rows.length>0,p=i.columns.length>0,f=i.current!==void 0,g=d.useCallback(b=>{const y=!ks(b.rows.toArray(),i.rows.toArray()),w=!ks(b.columns.toArray(),i.columns.toArray()),k=!ks(b.current,i.current);let I=a&&y||c&&w,E=b;if((a||c)&&b.current!==void 0&&k&&(E={...b,rows:i.rows,columns:i.columns},I=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(E={...E,columns:i.columns},I=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(E={...E,rows:i.rows},I=!0),w&&E.columns.length>=0){let x=E.columns;r.forEach((H,O)=>{H.isIndex&&(x=x.remove(O))}),x.length<E.columns.length&&(E={...E,columns:x})}l(E),I&&o(E)},[i,a,c,o,r]),m=d.useCallback((b=!1,y=!1)=>{const w={columns:y?i.columns:ot.empty(),rows:b?i.rows:ot.empty(),current:void 0};l(w),(!b&&a||!y&&c)&&o(w)},[i,a,c,o]);return{gridSelection:i,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:h,isColumnSelected:p,isCellSelected:f,clearSelection:m,processSelectionChange:g}}function Vw(e,t,n,r,o,i,l){const a=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+a+2*t.tableBorderWidth,c=r?2:1,u=e.editingMode===xn.EditingMode.DYNAMIC?1:0,h=n+u;let p=Math.max(h*a+c*t.defaultHeaderHeight+2*t.tableBorderWidth,s),f=Math.min(p,t.defaultTableHeight);e.height&&(f=Math.max(e.height,s),p=Math.max(e.height,p)),i&&(f=Math.min(f,i),p=Math.min(p,i),e.height||(f=p));const g=t.minColumnWidth+2*t.tableBorderWidth,m=Math.max(o,g);let b,y=m;e.useContainerWidth?b=m:e.width&&(b=Math.min(Math.max(e.width,g),m),y=Math.min(Math.max(e.width,y),m));const[w,k]=d.useState({width:b||"100%",height:f});return d.useLayoutEffect(()=>{e.useContainerWidth&&w.width==="100%"&&k(I=>({...I,width:m}))},[m]),d.useLayoutEffect(()=>{k(I=>({...I,width:b||"100%"}))},[b]),d.useLayoutEffect(()=>{k(I=>({...I,height:f}))},[f,n]),d.useLayoutEffect(()=>{if(l){const I=e.useContainerWidth||st(e.width)&&e.width>0;k({width:I?y:"100%",height:p})}else k({width:b||"100%",height:f})},[l]),{minHeight:s,maxHeight:p,minWidth:g,maxWidth:y,rowHeight:a,resizableSize:w,setResizableSize:k}}const Nw=600,Bw="\u26A0\uFE0F Please fill out this cell.";function Ww(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),l=d.useCallback(s=>{if(clearTimeout(i.current),i.current=0,o(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const c=s.location[0],u=s.location[1];let h;if(c<0||c>=e.length||n.includes(u))return;const p=e[c];if(s.kind==="header"&&st(p))h=p.help;else if(s.kind==="cell"){const f=t([c,u]);ao(f)?h=f.errorDetails:p.isRequired&&p.isEditable&&Hi(f)?h=Bw:E0(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},Nw))}},[e,t,o,i,n]),a=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:a,onItemHovered:l}}const dh=Un("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),vr=Un("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}}}),""),$w=Un("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),jw=Un("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),Uw=Un("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"}),""),Xw=Un("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"}),""),Gw=Un("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),Yw=Un("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}}),""),hh=[{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:"}],Kw={number:hh,progress:hh,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 qw({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:l}){const a=Qr(),{colors:s,fontSizes:c,radii:u,fontWeights:h}=a,p=Kw[e]||[];return p.length===0?ye.jsx(ye.Fragment,{}):ye.jsx(xa,{triggerType:qh.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:ye.jsx(dh,{role:"menu",children:p.map(f=>ye.jsxs(vr,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Ca.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},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",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:ka(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:c.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:l})}const Zw=d.memo(qw),fh=ba.getLogger("ColumnMenu");function Qw({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:l,onHideColumn:a,column:s,onChangeFormat:c,onAutosize:u}){const h=Qr(),[p,f]=d.useState(!1),{colors:g,fontSizes:m,radii:b,fontWeights:y}=h;d.useEffect(()=>{function I(E){E.preventDefault()}return document.addEventListener("wheel",I,{passive:!1}),document.addEventListener("touchmove",I,{passive:!1}),()=>{document.removeEventListener("wheel",I),document.removeEventListener("touchmove",I)}},[]);const w=d.useCallback(()=>{i()},[i]),k=d.useCallback(()=>{navigator.clipboard?navigator.clipboard.writeText(s.title).catch(I=>{fh.error("Failed to copy column name to clipboard:",I)}):fh.error("Clipboard API not supported.")},[s.title]);return ye.jsx(xa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:ye.jsxs(dh,{children:[ye.jsxs(jw,{children:[ye.jsx(Uw,{title:s.kind,children:ye.jsx(Xn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),ye.jsxs(Xw,{title:s.title,children:[ye.jsx(Gw,{children:s.title}),ye.jsx(Yw,{onClick:k,title:"Copy column name","aria-label":"Copy column name",children:ye.jsx(Xn,{iconValue:":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),l&&ye.jsxs(ye.Fragment,{children:[ye.jsxs(vr,{onClick:()=>{l("asc"),w()},role:"menuitem",children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),ye.jsxs(vr,{onClick:()=>{l("desc"),w()},role:"menuitem",children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),ye.jsx($w,{})]}),c&&ye.jsx(Zw,{columnKind:s.kind,isOpen:p,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:c,onCloseMenu:w,children:ye.jsxs(vr,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:p,hasSubmenu:!0,children:[ye.jsxs("div",{children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&ye.jsxs(vr,{onClick:()=>{u(),w()},children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&ye.jsxs(vr,{onClick:()=>{o(),w()},children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&ye.jsxs(vr,{onClick:()=>{r(),w()},children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&ye.jsxs(vr,{onClick:()=>{a(),w()},children:[ye.jsx(Xn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Ca.bottomRight,accessibilityType:Zh.menu,showArrow:!1,popoverMargin:cn("0.375rem"),onClickOutside:p?void 0:w,onEsc:w,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:ka(h)?g.bgColor:g.secondaryBg,color:g.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:b.default,borderTopRightRadius:b.default,borderBottomLeftRadius:b.default,borderBottomRightRadius:b.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:ye.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Jw=d.memo(Qw),ey="(index)",ty=({label:e,initialValue:t,onChange:n})=>{const r=Qr();return ye.jsx(dC,{checked:t,onChange:o=>{n(o.target.checked)},"aria-label":e,checkmarkType:fC.default,labelPlacement:hC.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:o?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:i})=>{const l=i?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&i?`0 0 0 0.2rem ${So(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},ny=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:l,onClose:a})=>{const s=Qr();return ye.jsx(xa,{triggerType:qh.click,placement:Ca.bottomRight,autoFocus:!0,focusLock:!0,content:()=>ye.jsx("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm},children:e.map(c=>{const u=t.length&&!c.isIndex?!t.includes(c.id)&&!t.includes(c.name):!1;return ye.jsx(ty,{label:!c.title&&c.isIndex?ey:c.title,initialValue:!(c.isHidden===!0||u),onChange:h=>{h?(o(c.id),u&&n(p=>[...p,c.id])):r(c.id)}},c.id)})}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:ka(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:ye.jsx("div",{children:i})})},ry=d.memo(ny),ph=Un("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 oy({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),l=Qr(),{colors:a,fontSizes:s,radii:c,fontWeights:u}=l,h=d.useCallback(()=>{i(!1),r()},[r,i]);return ye.jsx(xa,{content:ye.jsx(Qx,{"data-testid":"stDataFrameTooltipContent",children:ye.jsx(Jx,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Ca.top,accessibilityType:Zh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,overrides:{Body:{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"}},Inner:{style:{backgroundColor:ka(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:ye.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const iy=d.memo(oy),gh=150,ay=15e4,ly="0.5rem";function sy({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i}){const{expanded:l,expand:a,collapse:s,width:c,height:u}=Qh(aC),{isInHorizontalLayout:h}=Qh(eC),p=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=tC(),b=Iw(),{getRowThemeOverride:y,onItemHovered:w}=zw(b),{libConfig:{enforceDownloadInNewTab:k=!1}}=d.useContext(nC),[I,E]=d.useState(!0),[x,H]=d.useState(!1),[O,M]=d.useState(!1),[F,T]=d.useState(!1),[C,R]=d.useState(),[D,S]=d.useState(!1),Q=d.useCallback(()=>S(ve=>!ve),[]),$=d.useCallback(()=>S(!1),[]),q=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);_e(e.editingMode)&&(e.editingMode=xn.EditingMode.READ_ONLY);const{READ_ONLY:ie,DYNAMIC:ee}=xn.EditingMode,K=t.dimensions,se=Math.max(0,K.numDataRows),te=se===0&&!(e.editingMode===ee&&K.numDataColumns>0),ue=se>ay,fe=!ue&&!te&&e.editingMode!==ee,ae=!te&&e.editingMode===ee&&!n,z=d.useRef(new Vi(se)),[P,G]=d.useState(z.current.getNumRows());d.useEffect(()=>{z.current=new Vi(se),G(z.current.getNumRows())},[se]);const le=d.useCallback(()=>{z.current=new Vi(se),G(z.current.getNumRows())},[se]),[de,Oe]=d.useState(e.columnOrder);d.useEffect(()=>{Oe(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ge,allColumns:it,setColumnConfigMapping:Re}=J0(e,t,n,de);d.useEffect(()=>{if(e.editingMode===ie)return;const ve=r.getStringValue({id:e.id,formId:e.formId});ve&&(z.current.fromJson(ve,ge),G(z.current.getNumRows()))},[]);const{getCellContent:Lt}=Lw(t,ge,P,z),{columns:Ye,sortColumn:Xe,getOriginalIndex:ne,getCellContent:pe}=c1(se,ge,Lt),Ce=d.useCallback(ve=>{const ut={selection:{rows:[],columns:[]}};ut.selection.rows=ve.rows.toArray().map(Xt=>ne(Xt)),ut.selection.columns=ve.columns.toArray().map(Xt=>Ko(Ye[Xt]));const bt=JSON.stringify(ut),Zt=r.getStringValue({id:e.id,formId:e.formId});(Zt===void 0||Zt!==bt)&&r.setStringValue({id:e.id,formId:e.formId},bt,{fromUi:!0},i)},[Ye,e.id,e.formId,r,i,ne]),{debouncedCallback:ce}=Pu(Ce,gh),{gridSelection:xe,isRowSelectionActivated:Ie,isMultiRowSelectionActivated:Ae,isColumnSelectionActivated:et,isMultiColumnSelectionActivated:Pe,isRowSelected:je,isColumnSelected:Ne,isCellSelected:Te,clearSelection:Ee,processSelectionChange:mt}=_w(e,te,n,Ye,ce);d.useEffect(()=>{Ee(!0,!0)},[l]);const pt=d.useCallback(ve=>{f.current?.updateCells(ve)},[]);d.useEffect(()=>{if(!Ie&&!et)return;const ve=r.getStringValue({id:e.id,formId:e.formId});if(ve){const ut=Ye.map(or=>Ko(or)),bt=JSON.parse(ve);let Zt=ot.empty(),Xt=ot.empty();bt.selection?.rows?.forEach(or=>{Zt=Zt.add(or)}),bt.selection?.columns?.forEach(or=>{Xt=Xt.add(ut.indexOf(or))}),(Zt.length>0||Xt.length>0)&&mt({rows:Zt,columns:Xt,current:void 0})}},[]);const Ke=d.useCallback(()=>{P!==z.current.getNumRows()&&G(z.current.getNumRows())},[P]),Ct=d.useCallback(()=>{const ve=z.current.toJson(Ye);let ut=r.getStringValue({id:e.id,formId:e.formId});ut===void 0&&(ut=new Vi(0).toJson([])),ve!==ut&&r.setStringValue({id:e.id,formId:e.formId},ve,{fromUi:!0},i)},[Ye,e.id,e.formId,r,i]),{debouncedCallback:qt}=Pu(Ct,gh),{exportToCsv:zt}=Aw(pe,Ye,P,k),{onCellEdited:Mt,onPaste:fn,onRowAppended:jt,onDelete:on,validateCell:Tt}=Ow(Ye,e.editingMode!==ee,z,pe,ne,pt,Ke,qt,Ee),wt=d.useMemo(()=>te?[0]:ae?[P]:[],[te,ae,P]),{tooltip:an,clearTooltip:ct,onItemHovered:ln}=Ww(Ye,pe,wt),{drawCell:Wt,customRenderers:Le}=Ew(Ye),{provideEditor:Rt}=d1(),_t=d.useCallback(ve=>({...ve,hasMenu:!te}),[te]),On=d.useMemo(()=>Ye.map(ve=>_t(ml(ve))),[Ye,_t]),{columns:Ut,onColumnResize:pn}=r1(On),Dn=t.dimensions.numHeaderRows>1,{minHeight:Jt,maxHeight:en,minWidth:Ue,maxWidth:Ot,rowHeight:Cn,resizableSize:vt,setResizableSize:Ht}=Vw(e,b,P,Dn,c||0,u,l),kn=d.useCallback(([ve,ut])=>({...I0(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:b.glideTheme.textLight},span:[0,Math.max(Ye.length-1,0)]}),[Ye,b.glideTheme.textLight]),rr=d.useCallback(()=>{le(),Ee()},[le,Ee]);sC({element:e,widgetMgr:r,onFormCleared:rr});const{pinColumn:Bn,unpinColumn:N,freezeColumns:Be}=t1(Ye,te,c||0,b.minColumnWidth,Ee,Re),{changeColumnFormat:Ge}=e1(Re),{hideColumn:yt,showColumn:wn}=u1(Ee,Re),{onColumnMoved:un}=n1(Ye,Be,Bn,N,Oe);return d.useEffect(()=>{let ve;const ut=requestAnimationFrame(()=>{ve=setTimeout(()=>{if(g.current&&f.current){const bt=g.current?.querySelector(".dvn-stack")?.getBoundingClientRect();bt&&(M(bt.height>g.current.clientHeight),T(bt.width>g.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(ut),ve&&clearTimeout(ve)}},[vt,P,Ut]),d.useEffect(()=>{it.length==Ye.length&&S(!1)},[it.length,Ye.length]),ye.jsxs(ph,{className:"stDataFrame","data-testid":"stDataFrame",ref:g,isInHorizontalLayout:h,onPointerDown:ve=>{if(g.current){const ut=g.current.getBoundingClientRect(),bt=(m||Math.round(cn(ly)))+1;F&&ut.height-bt<ve.clientY-ut.top&&ve.stopPropagation(),O&&ut.width-bt<ve.clientX-ut.left&&ve.stopPropagation()}},onBlur:ve=>{!I&&!q&&!ve.currentTarget.contains(ve.relatedTarget)&&Ee(!0,!0)},children:[ye.jsxs(lC,{isFullScreen:l,disableFullscreenMode:o,locked:je&&!Ie||Te||q&&I||D,onExpand:a,onCollapse:s,target:ph,children:[(Ie&&je||et&&Ne)&&ye.jsx(Mo,{label:"Clear selection",icon:gC,onClick:()=>{Ee(),ct()}}),ae&&je&&ye.jsx(Mo,{label:"Delete row(s)",icon:yC,onClick:()=>{on&&(on(xe),ct())}}),ae&&!je&&ye.jsx(Mo,{label:"Add row",icon:Es,onClick:()=>{jt&&(E(!0),jt(),ct(),f.current?.scrollTo(0,P,"vertical"))}}),!te&&it.length>Ye.length&&ye.jsx(ry,{columns:it,columnOrder:de,setColumnOrder:Oe,hideColumn:yt,showColumn:wn,isOpen:D,onClose:$,children:ye.jsx(Mo,{label:"Show/hide columns",icon:Ts,onClick:Q})}),!ue&&!te&&ye.jsx(Mo,{label:"Download as CSV",icon:xC,onClick:zt}),!te&&ye.jsx(Mo,{label:"Search",icon:Is,onClick:()=>{x?H(!1):(E(!0),H(!0)),ct()}})]}),ye.jsx(rC,{"data-testid":"stDataFrameResizable",ref:p,defaultSize:vt,style:{border:`${b.tableBorderWidth}px solid ${b.glideTheme.borderColor}`,borderRadius:`${b.tableBorderRadius}`},minHeight:Jt,maxHeight:en,minWidth:Ue,maxWidth:h?void 0:Ot,size:vt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!h,bottomLeft:!1,topLeft:!1},grid:[1,Cn],snapGap:Cn/3,onResizeStop:(ve,ut,bt,Zt)=>{if(p.current){const Xt=2*b.tableBorderWidth;Ht({width:p.current.size.width,height:en-p.current.size.height===Xt?p.current.size.height+Xt:p.current.size.height})}},children:ye.jsx(y0,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:Ut,rows:te?1:P,minColumnWidth:b.minColumnWidth,maxColumnWidth:b.maxColumnWidth,maxColumnAutoWidth:b.maxColumnAutoWidth,rowHeight:Cn,headerHeight:b.defaultHeaderHeight,getCellContent:te?kn:pe,onColumnResize:q?void 0:pn,resizeIndicator:"header",freezeColumns:Be,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:q?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:et?void 0:un,onItemHovered:ve=>{w?.(ve),ln?.(ve)},keybindings:{downFill:!0},onKeyDown:ve=>{(ve.ctrlKey||ve.metaKey)&&ve.key==="f"&&(H(ut=>!ut),ve.stopPropagation(),ve.preventDefault())},showSearch:x,searchResults:x?void 0:[],onSearchClose:()=>{H(!1),ct()},onHeaderClicked:(ve,ut)=>{!fe||et||(x&&H(!1),Ie&&je?Ee():Ee(!0,!0),Xe(ve,"auto"))},gridSelection:xe,onGridSelectionChange:ve=>{(I||q)&&(mt(ve),an!==void 0&&ct())},theme:b.glideTheme,getRowThemeOverride:y,onMouseMove:ve=>{ve.kind==="out-of-bounds"&&I?E(!1):ve.kind!=="out-of-bounds"&&!I&&E(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:F?-m:void 0,paddingRight:O?-m:void 0},provideEditor:Rt,drawCell:Wt,customRenderers:Le,imageEditorOverride:V0,headerIcons:b.headerIcons,validateCell:Tt,onHeaderMenuClick:(ve,ut)=>{R({columnIdx:ve,headerBounds:ut})},onPaste:!1,...Ie&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:b.glideTheme.bgHeader,bgCellMedium:b.glideTheme.bgHeader,textMedium:b.glideTheme.textLight}},rowSelectionMode:Ae?"multi":"auto",rowSelect:n?"none":Ae?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...et&&{columnSelect:n?"none":Pe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==ie&&!n&&{fillHandle:!q,onCellEdited:Mt,onPaste:fn,onDelete:on},...!te&&e.editingMode===ee&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:b.glideTheme.bgHeader,bgCellMedium:b.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:jt,onHeaderClicked:void 0}})}),an&&an.content&&ye.jsx(iy,{top:an.top,left:an.left,content:an.content,clearTooltip:ct}),C&&Kh.createPortal(ye.jsx(Jw,{top:C.headerBounds.y+C.headerBounds.height,left:C.headerBounds.x+C.headerBounds.width,column:ge[C.columnIdx],onCloseMenu:()=>R(void 0),onSortColumn:fe?ve=>{x&&H(!1),Ee(!(Ie&&je),!0),Xe(C.columnIdx,ve,!0)}:void 0,isColumnPinned:ge[C.columnIdx].isPinned,onUnpinColumn:()=>{N(ge[C.columnIdx].id)},onPinColumn:()=>{Bn(ge[C.columnIdx].id)},onHideColumn:()=>{yt(ge[C.columnIdx].id)},onChangeFormat:ve=>{Ge(ge[C.columnIdx].id,ve),setTimeout(()=>{f.current?.remeasureColumns(ot.fromSingleSelection(C.columnIdx))},100)},onAutosize:()=>{f.current?.remeasureColumns(ot.fromSingleSelection(C.columnIdx))}}),document.querySelector("#portal"))]})}let mh,vh;mh=iC(sy),vh=d.memo(mh),Jh=Object.freeze(Object.defineProperty({__proto__:null,default:vh},Symbol.toStringTag,{value:"Module"}))});export{Ss as C,Sa as T,CC as __tla,Tr as a,Ms as b,Jh as c,Or as i,Rs as m,rn as s};
|