@hienlh/ppm 0.13.53 → 0.13.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/assets/skills/ppm/SKILL.md +2 -2
- package/assets/skills/ppm/references/cli-reference.md +11 -0
- package/assets/skills/ppm/references/http-api.md +7 -1
- package/dist/web/assets/ai-settings-section-AxLbNnLW.js +1 -0
- package/dist/web/assets/{api-settings-C3T95dWg.js → api-settings-BJTjIG4U.js} +1 -1
- package/dist/web/assets/architecture-PBZL5I3N-CkdUQjA_.js +1 -0
- package/dist/web/assets/arrow-down-D825m4vm.js +1 -0
- package/dist/web/assets/{audio-preview-DzlMrjXC.js → audio-preview-B53oeW0y.js} +1 -1
- package/dist/web/assets/chat-tab-Clzw7eDP.js +16 -0
- package/dist/web/assets/chevron-down-BMo4cBth.js +1 -0
- package/dist/web/assets/code-editor-BgU5lFVC.js +8 -0
- package/dist/web/assets/{conflict-editor-DsL9J6Ao.js → conflict-editor-C3l3pgtV.js} +3 -3
- package/dist/web/assets/csv-parser-D1b_lg2T.js +6 -0
- package/dist/web/assets/{csv-preview-B3Dyhgho.js → csv-preview-asMfgR0r.js} +2 -2
- package/dist/web/assets/{data-grid-overlay-editor-C1UUm7Ob.js → data-grid-overlay-editor-DGjqvYn6.js} +1 -1
- package/dist/web/assets/database-viewer-DNYgu_Jv.js +1 -0
- package/dist/web/assets/diff-viewer-Dec4mKgl.js +4 -0
- package/dist/web/assets/{esm-DCbn6xno.js → esm-xVTUq__o.js} +1 -1
- package/dist/web/assets/{extension-webview-SqqLBksj.js → extension-webview-b7T0yAq2.js} +1 -1
- package/dist/web/assets/eye-off-BacF7RVS.js +1 -0
- package/dist/web/assets/git-log-panel-CWTTJERX.js +1 -0
- package/dist/web/assets/gitGraph-HDMCJU4V-D3UR56AG.js +1 -0
- package/dist/web/assets/glide-data-grid-_9gGGfZy.js +136 -0
- package/dist/web/assets/{image-preview-CVERB6Hn.js → image-preview-CzXKlWft.js} +1 -1
- package/dist/web/assets/index-1_isAfRS.js +27 -0
- package/dist/web/assets/index-CDPVPZHJ.css +2 -0
- package/dist/web/assets/info-3K5VOQVL-DUhLSKI2.js +1 -0
- package/dist/web/assets/{input-_LFQwhzd.js → input-By_lZeCs.js} +1 -1
- package/dist/web/assets/keybindings-store-BicDU0b1.js +1 -0
- package/dist/web/assets/{markdown-renderer-F5aFyJ-g.js → markdown-renderer-DWIBF9Jg.js} +3 -3
- package/dist/web/assets/notification-store-D_2wCv0z.js +1 -0
- package/dist/web/assets/{number-overlay-editor-CyEqxXcg.js → number-overlay-editor-DtUBprPW.js} +1 -1
- package/dist/web/assets/packet-RMMSAZCW-BIpeVUGW.js +1 -0
- package/dist/web/assets/panel-store-C9VAhbZz.js +1 -0
- package/dist/web/assets/{pdf-preview-RgwYR2Lj.js → pdf-preview-C51mDesS.js} +1 -1
- package/dist/web/assets/pie-UPGHQEXC-CNoizzjb.js +1 -0
- package/dist/web/assets/port-forwarding-tab-BmRMiN32.js +1 -0
- package/dist/web/assets/{postgres-viewer-Dq2nI9jE.js → postgres-viewer-DuiEoUGK.js} +3 -3
- package/dist/web/assets/project-store-DlbHpIq0.js +1 -0
- package/dist/web/assets/radar-KQ55EAFF-7dns-ho5.js +1 -0
- package/dist/web/assets/{settings-store-8FpQDjEA.js → settings-store-DQUFTPk2.js} +2 -2
- package/dist/web/assets/settings-tab-p3lxp6_T.js +1 -0
- package/dist/web/assets/{sql-query-editor-CL6O_4eW.js → sql-query-editor-BA80nuKp.js} +1 -1
- package/dist/web/assets/{sqlite-viewer-CcJz9Bva.js → sqlite-viewer-Bev2XJe7.js} +1 -1
- package/dist/web/assets/system-monitor-tab-DfpsOgL3.js +1 -0
- package/dist/web/assets/{tab-store-CNas5Ny8.js → tab-store-CIcbSn0c.js} +1 -1
- package/dist/web/assets/{terminal-tab-BlyuDIu5.js → terminal-tab-Ca5kyUS7.js} +2 -2
- package/dist/web/assets/treemap-KZPCXAKY-D3DZCLoE.js +1 -0
- package/dist/web/assets/{use-blob-url-DB4nNruT.js → use-blob-url-VgTGpely.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-DEI-tJAh.js → use-monaco-theme-BLIgarH5.js} +1 -1
- package/dist/web/assets/{vendor-mermaid-D2KKkqNs.js → vendor-mermaid-DkqjpqJK.js} +2 -2
- package/dist/web/assets/{video-preview-C8s0VXIf.js → video-preview-Bvd0OaYA.js} +1 -1
- package/dist/web/assets/wifi-LJEyIdXf.js +1 -0
- package/dist/web/index.html +21 -20
- package/dist/web/sw.js +1 -1
- package/docs/project-changelog.md +38 -1
- package/docs/system-architecture.md +2 -1
- package/package.json +1 -1
- package/packages/ext-git-graph/src/webview-html.ts +29 -8
- package/src/cli/commands/db-cmd.ts +30 -4
- package/src/server/index.ts +4 -0
- package/src/server/middleware/auth.ts +9 -0
- package/src/server/routes/resources.ts +61 -0
- package/src/services/ppmbot/cli-reference-default.ts +6 -1
- package/src/services/resource-monitor-utils.ts +129 -0
- package/src/services/resource-monitor.service.ts +122 -0
- package/src/web/components/editor/editor-breadcrumb.tsx +8 -1
- package/src/web/components/git/git-log-panel.tsx +206 -0
- package/src/web/components/git/git-ref-badge.tsx +150 -0
- package/src/web/components/git/git-status-panel.tsx +18 -0
- package/src/web/components/layout/mobile-nav.tsx +2 -0
- package/src/web/components/layout/sidebar.tsx +6 -0
- package/src/web/components/layout/tab-bar.tsx +3 -0
- package/src/web/components/layout/tab-content.tsx +10 -0
- package/src/web/components/layout/tab-pool.tsx +2 -0
- package/src/web/components/system/resource-status-bar.tsx +66 -0
- package/src/web/components/system/sparkline-canvas.tsx +64 -0
- package/src/web/components/system/system-monitor-tab.tsx +194 -0
- package/src/web/hooks/use-resource-monitor.ts +114 -0
- package/src/web/stores/panel-store.ts +1 -1
- package/src/web/stores/tab-store.ts +3 -1
- package/templates/skill/SKILL.md.tmpl +1 -1
- package/dist/web/assets/ai-settings-section-AuV6Lzz2.js +0 -1
- package/dist/web/assets/architecture-PBZL5I3N-fAJMexNi.js +0 -1
- package/dist/web/assets/chat-tab-BpP-9jSF.js +0 -16
- package/dist/web/assets/code-editor-DUrnjDXe.js +0 -8
- package/dist/web/assets/csv-parser-Dly5nqE1.js +0 -6
- package/dist/web/assets/database-viewer-BzZ_B08X.js +0 -1
- package/dist/web/assets/diff-viewer-BTtOJWuk.js +0 -4
- package/dist/web/assets/file-store-DOxcU_7s.js +0 -1
- package/dist/web/assets/gitGraph-HDMCJU4V-ClRAoBAn.js +0 -1
- package/dist/web/assets/glide-data-grid-YCbGSPc8.js +0 -136
- package/dist/web/assets/index-CKKoR3gY.css +0 -2
- package/dist/web/assets/index-D3gMHLKc.js +0 -27
- package/dist/web/assets/info-3K5VOQVL-D8uyBfC_.js +0 -1
- package/dist/web/assets/keybindings-store-BY4JJMPB.js +0 -1
- package/dist/web/assets/notification-store-CmFhp1D7.js +0 -1
- package/dist/web/assets/packet-RMMSAZCW-BJj3FH_w.js +0 -1
- package/dist/web/assets/panel-store-C8wwxBpn.js +0 -1
- package/dist/web/assets/pie-UPGHQEXC-BKfHRBz7.js +0 -1
- package/dist/web/assets/port-forwarding-tab-CRBTvvYM.js +0 -1
- package/dist/web/assets/radar-KQ55EAFF-DkybKTt9.js +0 -1
- package/dist/web/assets/scroll-area-BDi_FNzr.js +0 -1
- package/dist/web/assets/settings-tab-BrtuPA9W.js +0 -1
- package/dist/web/assets/treemap-KZPCXAKY-BvDgIWW9.js +0 -1
- /package/dist/web/assets/{api-client-DIhJ5qVW.js → api-client-BK4NPNoY.js} +0 -0
- /package/dist/web/assets/{chevron-right-DnHIvvcy.js → chevron-right-CD8e6Aj4.js} +0 -0
- /package/dist/web/assets/{code-DGBecc50.js → code-DiNmA3eR.js} +0 -0
- /package/dist/web/assets/{data-grid-types-D2cHE8hx.js → data-grid-types-DzL5W2em.js} +0 -0
- /package/dist/web/assets/{database-DOWH9-Vv.js → database-Dc8mr-dP.js} +0 -0
- /package/dist/web/assets/{dist-BoIkGNC8.js → dist-BM2EHhLH.js} +0 -0
- /package/dist/web/assets/{dist-DVk8T0R5.js → dist-CohudVKa.js} +0 -0
- /package/dist/web/assets/{file-exclamation-point-BwzaQ50n.js → file-exclamation-point-B__2Hrd6.js} +0 -0
- /package/dist/web/assets/{globe-B4Ilypbs.js → globe-CQ8NAYvi.js} +0 -0
- /package/dist/web/assets/{katex-C10ndCVt.js → katex-CHaeM9QC.js} +0 -0
- /package/dist/web/assets/{lib-C2D8j3K3.js → lib-LPmTkMu4.js} +0 -0
- /package/dist/web/assets/{react-DMIOAtcX.js → react-DHBl6KRc.js} +0 -0
- /package/dist/web/assets/{refresh-cw-BjrAbUJe.js → refresh-cw-CRD2qr4U.js} +0 -0
- /package/dist/web/assets/{search-tM8K5zWU.js → search-D90WJ5fo.js} +0 -0
- /package/dist/web/assets/{sparkles-CulWHe4c.js → sparkles-KCOEy7QI.js} +0 -0
- /package/dist/web/assets/{table-BzjWcs87.js → table-2wDtM4_B.js} +0 -0
- /package/dist/web/assets/{text-wrap-DJz9Bgpa.js → text-wrap-AZErifCu.js} +0 -0
- /package/dist/web/assets/{utils-CQux7CsO.js → utils-CSCvNZxE.js} +0 -0
- /package/dist/web/assets/{vendor-xterm-D1P36hcr.js → vendor-xterm-vh96p1Au.js} +0 -0
- /package/dist/web/assets/{x-BPReZWnP.js → x-ClICkcxR.js} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-DGjqvYn6.js","assets/rolldown-runtime-FhOqtrmT.js","assets/dist-BM2EHhLH.js","assets/vendor-markdown-0Mxgxy0L.js","assets/vendor-ui-UXCWAcmi.js","assets/data-grid-types-DzL5W2em.js","assets/number-overlay-editor-DtUBprPW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,t}from"./rolldown-runtime-FhOqtrmT.js";import{b as n,x as r}from"./vendor-markdown-0Mxgxy0L.js";import{Y as i}from"./vendor-ui-UXCWAcmi.js";import{t as a}from"./createLucideIcon-BjHrJDVb.js";import{t as o}from"./arrow-down-D825m4vm.js";import{t as s}from"./arrow-up-Rcw6_KKu.js";import{n as c}from"./database-Dc8mr-dP.js";import{t as l}from"./chevron-right-CD8e6Aj4.js";import{i as u,n as d,r as f,t as p}from"./search-D90WJ5fo.js";import{a as m,i as h,n as g,r as _,t as v}from"./x-ClICkcxR.js";import{t as y}from"./sparkles-KCOEy7QI.js";import{t as b}from"./text-wrap-AZErifCu.js";import{K as x,j as S}from"./vendor-mermaid-DkqjpqJK.js";import{t as C}from"./tab-store-CIcbSn0c.js";import{$ as w,V as T,_ as E,ct as D,et as O}from"./index-1_isAfRS.js";import{A as k,B as ee,C as te,D as A,E as ne,F as j,G as re,H as ie,I as ae,L as M,M as oe,N,O as P,P as se,R as ce,S as le,T as F,U as I,V as ue,W as de,_ as fe,a as pe,b as me,c as he,d as ge,f as _e,g as ve,h as L,i as ye,j as R,k as be,l as z,m as xe,n as B,o as Se,p as V,r as Ce,s as we,t as H,u as Te,v as Ee,w as De,x as U,y as Oe,z as ke}from"./data-grid-types-DzL5W2em.js";import{t as W}from"./dist-BM2EHhLH.js";import{n as Ae,t as je}from"./use-monaco-theme-BLIgarH5.js";import{n as Me}from"./csv-parser-D1b_lg2T.js";var Ne=a(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Pe=a(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Fe=`SELECT.FROM.WHERE.INSERT.INTO.VALUES.UPDATE.SET.DELETE.CREATE.TABLE.ALTER.DROP.INDEX.JOIN.LEFT.RIGHT.INNER.OUTER.ON.AND.OR.NOT.NULL.IS.IN.LIKE.BETWEEN.HAVING.LIMIT.OFFSET.AS.DISTINCT.COUNT.SUM.AVG.MIN.MAX.CASE.WHEN.THEN.ELSE.END.EXISTS.UNION.ALL.ASC.DESC.ORDER BY.GROUP BY.LEFT JOIN.RIGHT JOIN.INNER JOIN.CROSS JOIN.FULL OUTER JOIN.IS NULL.IS NOT NULL`.split(`.`),Ie=[`COUNT`,`SUM`,`AVG`,`MIN`,`MAX`],Le=[`=`,`!=`,`<>`,`>`,`<`,`>=`,`<=`,`LIKE`,`ILIKE`,`IN`,`NOT IN`,`BETWEEN`,`IS NULL`,`IS NOT NULL`],Re=[`ASC`,`DESC`],ze=new Map,Be=new Set(`WHERE.SET.ON.ORDER.GROUP.HAVING.LIMIT.LEFT.RIGHT.INNER.OUTER.CROSS.FULL.JOIN.AND.OR.VALUES.SELECT.FROM.INTO.UPDATE.DELETE.INSERT.CREATE.ALTER.DROP`.split(`.`));function Ve(e){let t=new Set,n=new Map,r=e.matchAll(/\b(?:FROM|JOIN|UPDATE|INTO)\s+"?(\w+)"?(?:\s+AS\s+(\w+)|\s+(?!(?:FROM|JOIN|UPDATE|INTO|WHERE|SET|ON|ORDER|GROUP|HAVING|LIMIT|LEFT|RIGHT|INNER|OUTER|CROSS|FULL|AND|OR|VALUES|SELECT)\b)(\w+))?/gi);for(let e of r){let r=e[1];t.add(r);let i=e[2]??e[3];i&&!Be.has(i.toUpperCase())&&n.set(i.toLowerCase(),r)}return{tableRefs:t,aliasMap:n}}function He(e,t){return t.get(e.toLowerCase())??e}async function Ue(e,t){let n=e.toLowerCase(),r=ze.get(n);if(!r)try{r=await t.getColumns(e),ze.set(n,r)}catch{r=[]}return r}async function We(e,t,n,r){let i=[],a=new Set;for(let o of e){let e=await Ue(o,t);for(let t of e){if(a.has(t.name))continue;a.add(t.name);let e=/[A-Z]/.test(t.name);i.push({label:t.name,kind:n.languages.CompletionItemKind.Field,detail:`${o} · ${t.type}`,insertText:e?`"${t.name}"`:t.name,range:r,sortText:`0`+t.name})}}return i}function Ge(e){if(/(\w+)\.\s*$/.test(e))return`dot`;let t=e.match(/\b(?:ORDER|GROUP)\s+BY\s+(?:[\w"]+\s+(?:ASC|DESC)\s*,\s*)*[\w"]+\s+(\w*)$/i);if(t){let e=t[1].toUpperCase();return e===`ASC`||e===`DESC`?`after-direction`:`sort-direction`}return/\b(?:ORDER|GROUP)\s+BY\s+.*(?:ASC|DESC)\s*,\s*\w*$/i.test(e)?`order-by-next-col`:/\b(?:WHERE|AND|OR)\s+[\w"]+\s+\S*$/i.test(e)?`operator`:/\b(?:FROM|JOIN|INTO|UPDATE|TABLE)\s+\w*$/i.test(e)?`table`:/\bINSERT\s+INTO\s+[\w"]+\s*\(\s*(?:[\w"]+\s*,\s*)*\w*$/i.test(e)?`insert-cols`:/\b(?:SELECT|WHERE|ORDER\s+BY|GROUP\s+BY|HAVING|SET|ON|AND|OR)\s+(?:[\w"]+\s*,\s*)*\w*$/i.test(e)?`columns`:/,\s*\w*$/.test(e)?`comma-cols`:`default`}function Ke(e,t){return{triggerCharacters:[`.`,`,`],provideCompletionItems:async(n,r)=>{try{let i=n.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:r.lineNumber,endColumn:r.column}),a=n.getWordUntilPosition(r),o={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},{tableRefs:s,aliasMap:c}=Ve(n.getValue()),l=[],u=Ge(i);if(u===`dot`){let n=i.match(/(\w+)\.\s*$/);if(n){let r=n[1],i=await Ue(He(r,c),t);for(let t of i){let n=/[A-Z]/.test(t.name);l.push({label:t.name,kind:e.languages.CompletionItemKind.Field,detail:t.type,insertText:n?`"${t.name}"`:t.name,range:o})}}return{suggestions:l}}if(u===`sort-direction`){for(let t of Re)l.push({label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,range:o,sortText:`0`+t});return{suggestions:l}}if(u===`after-direction`)return{suggestions:[]};if(u===`order-by-next-col`)return l.push(...await We(s,t,e,o)),{suggestions:l};if(u===`operator`){for(let t of Le)l.push({label:t,kind:e.languages.CompletionItemKind.Operator,insertText:t,range:o,sortText:`0`+t});return{suggestions:l}}if(u===`table`){for(let n of t.tables)l.push({label:n.name,kind:e.languages.CompletionItemKind.Struct,detail:n.schema,insertText:n.name,range:o,sortText:`0`+n.name});return{suggestions:l}}if(u===`insert-cols`)return l.push(...await We(s,t,e,o)),{suggestions:l};if(u===`columns`){if(l.push(...await We(s,t,e,o)),/\bSELECT\s+/i.test(i)){l.push({label:`*`,kind:e.languages.CompletionItemKind.Value,insertText:`*`,range:o,sortText:`00*`});for(let t of Ie)l.push({label:`${t}()`,kind:e.languages.CompletionItemKind.Function,insertText:`${t}($0)`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o,sortText:`1`+t})}for(let t of Fe)l.push({label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,range:o,sortText:`3`+t});return{suggestions:l}}if(u===`comma-cols`&&s.size>0)return l.push(...await We(s,t,e,o)),{suggestions:l};for(let t of Fe)l.push({label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,range:o,sortText:`2`+t});for(let n of t.tables)l.push({label:n.name,kind:e.languages.CompletionItemKind.Struct,detail:n.schema,insertText:n.name,range:o,sortText:`1`+n.name});return{suggestions:l}}catch{return{suggestions:[]}}}}}function qe(){ze.clear()}var G=e(r(),1),Je=e(i(),1),K=n();function Ye(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function Xe({columns:e,rows:t,filename:n=`export`,exportAllUrl:r}){let[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(!1),c=(0,G.useRef)(null),l=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(!i)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c.current&&!c.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]);let u=(0,G.useCallback)(()=>a(e=>!e),[]),d=()=>{let r=Me(e,t.map(t=>e.map(e=>String(t[e]??``))));Ye(`${n}.csv`,r,`text/csv`),a(!1)},f=()=>{let e=JSON.stringify(t,null,2);Ye(`${n}.json`,e,`application/json`),a(!1)},p=async()=>{let n=e.join(` `),r=t.map(t=>e.map(e=>String(t[e]??``)).join(` `)).join(`
|
|
3
|
+
`);await navigator.clipboard.writeText(n+`
|
|
4
|
+
`+r),a(!1)},h=async e=>{if(r){s(!0);try{let t=await(await fetch(`${r}&format=${e}&limit=10000`)).text(),i=e===`csv`?`text/csv`:`application/json`;Ye(`${n}-all.${e}`,t,i)}catch{}s(!1),a(!1)}};if(e.length===0||t.length===0)return null;let g=c.current?.getBoundingClientRect(),_=document.getElementById(`portal`);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{ref:c,type:`button`,onClick:u,className:`p-1 rounded text-muted-foreground hover:text-foreground transition-colors`,title:`Export`,children:(0,K.jsx)(m,{className:`size-3.5`})}),i&&_&&g&&(0,Je.createPortal)((0,K.jsxs)(`div`,{ref:l,style:{position:`fixed`,left:Math.min(g.left,window.innerWidth-170),top:g.bottom+4,zIndex:1e4},className:`bg-popover border border-border rounded-md shadow-md py-1 min-w-[160px] text-xs`,children:[(0,K.jsx)(`button`,{onClick:p,className:`w-full text-left px-3 py-1.5 hover:bg-muted transition-colors text-foreground`,children:`Copy to Clipboard (TSV)`}),(0,K.jsx)(`button`,{onClick:d,className:`w-full text-left px-3 py-1.5 hover:bg-muted transition-colors text-foreground`,children:`Export Page (CSV)`}),(0,K.jsx)(`button`,{onClick:f,className:`w-full text-left px-3 py-1.5 hover:bg-muted transition-colors text-foreground`,children:`Export Page (JSON)`}),r&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`border-t border-border my-1`}),(0,K.jsx)(`button`,{onClick:()=>h(`csv`),disabled:o,className:`w-full text-left px-3 py-1.5 hover:bg-muted transition-colors disabled:opacity-50 text-foreground`,children:o?`Exporting…`:`Export All (CSV)`}),(0,K.jsx)(`button`,{onClick:()=>h(`json`),disabled:o,className:`w-full text-left px-3 py-1.5 hover:bg-muted transition-colors disabled:opacity-50 text-foreground`,children:o?`Exporting…`:`Export All (JSON)`})]})]}),_)]})}var Ze=W(`div`)({name:`ImageOverlayEditorStyle`,class:`gdg-i2iowwq`,propsAsIs:!1}),Qe=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),q=t(((e,t)=>{var n=Qe();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),$e=t(((e,t)=>{t.exports=q()()})),et=t((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`react`,`prop-types`],n);else if(e!==void 0)n(e,r(),$e());else{var i={exports:{}};n(i.exports,t.react,t.propTypes),t.reactSwipe=i.exports}})(e,function(e,t,n){Object.defineProperty(e,`__esModule`,{value:!0}),e.setHasSupportToCaptureOption=p;var r=a(t),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function s(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function u(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function d(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=!1;function p(e){f=e}try{addEventListener(`test`,null,Object.defineProperty({},`capture`,{get:function(){p(!0)}}))}catch{}function m(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?e:e.capture}function h(e){if(`touches`in e){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}return{x:e.screenX,y:e.screenY}}var g=function(e){d(t,e);function t(){var e;c(this,t);var n=[...arguments],r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(n)));return r._handleSwipeStart=r._handleSwipeStart.bind(r),r._handleSwipeMove=r._handleSwipeMove.bind(r),r._handleSwipeEnd=r._handleSwipeEnd.bind(r),r._onMouseDown=r._onMouseDown.bind(r),r._onMouseMove=r._onMouseMove.bind(r),r._onMouseUp=r._onMouseUp.bind(r),r._setSwiperRef=r._setSwiperRef.bind(r),r}return l(t,[{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(e){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener(`mouseup`,this._onMouseUp),document.addEventListener(`mousemove`,this._onMouseMove),this._handleSwipeStart(e))}},{key:`_onMouseMove`,value:function(e){this.mouseDown&&this._handleSwipeMove(e)}},{key:`_onMouseUp`,value:function(e){this.mouseDown=!1,document.removeEventListener(`mouseup`,this._onMouseUp),document.removeEventListener(`mousemove`,this._onMouseMove),this._handleSwipeEnd(e)}},{key:`_handleSwipeStart`,value:function(e){var t=h(e);this.moveStart={x:t.x,y:t.y},this.props.onSwipeStart(e)}},{key:`_handleSwipeMove`,value:function(e){if(this.moveStart){var t=h(e),n=t.x,r=t.y,i=n-this.moveStart.x,a=r-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:i,y:a},e)&&e.cancelable&&e.preventDefault(),this.movePosition={deltaX:i,deltaY:a}}}},{key:`_handleSwipeEnd`,value:function(e){this.props.onSwipeEnd(e);var t=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-t?this.props.onSwipeLeft(1,e):this.movePosition.deltaX>t&&this.props.onSwipeRight(1,e),this.movePosition.deltaY<-t?this.props.onSwipeUp(1,e):this.movePosition.deltaY>t&&this.props.onSwipeDown(1,e)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:`_setSwiperRef`,value:function(e){this.swiper=e,this.props.innerRef(e)}},{key:`render`,value:function(){var e=this.props;e.tagName;var t=e.className,n=e.style,i=e.children;e.allowMouseEvents,e.onSwipeUp,e.onSwipeDown,e.onSwipeLeft,e.onSwipeRight,e.onSwipeStart,e.onSwipeMove,e.onSwipeEnd,e.innerRef,e.tolerance;var a=s(e,[`tagName`,`className`,`style`,`children`,`allowMouseEvents`,`onSwipeUp`,`onSwipeDown`,`onSwipeLeft`,`onSwipeRight`,`onSwipeStart`,`onSwipeMove`,`onSwipeEnd`,`innerRef`,`tolerance`]);return r.default.createElement(this.props.tagName,o({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:t,style:n},a),i)}}]),t}(t.Component);g.displayName=`ReactSwipe`,g.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},g.defaultProps={tagName:`div`,allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=g})})),tt=t((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`./react-swipe`],n);else if(e!==void 0)n(e,et());else{var r={exports:{}};n(r.exports,t.reactSwipe),t.index=r.exports}})(e,function(e,t){Object.defineProperty(e,`__esModule`,{value:!0});var n=r(t);function r(e){return e&&e.__esModule?e:{default:e}}e.default=n.default})})),nt=t(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),rt=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=n(nt());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.default={ROOT:function(e){return(0,t.default)(r({"carousel-root":!0},e||``,!!e))},CAROUSEL:function(e){return(0,t.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,n){return(0,t.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":n===`horizontal`,"axis-vertical":n!==`horizontal`})},SLIDER:function(e,n){return(0,t.default)({thumbs:!e,slider:e,animated:!n})},ITEM:function(e,n,r){return(0,t.default)({thumb:!e,slide:e,selected:n,previous:r})},ARROW_PREV:function(e){return(0,t.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,t.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,t.default)({dot:!0,selected:e})}}})),it=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.outerWidth=void 0,e.outerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t}})),at=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0,e.default=function(e,t,n){var r=e===0?e:e+t;return`translate3d`+(`(`+(n===`horizontal`?[r,0,0]:[0,r,0]).join(`,`)+`)`)}})),ot=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0,e.default=function(){return window}})),st=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=u(r()),n=c(rt()),i=it(),a=c(at()),o=c(tt()),s=c(ot());function c(e){return e&&e.__esModule?e:{default:e}}function l(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(e===null||d(e)!==`object`&&typeof e!=`function`)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function d(e){"@babel/helpers - typeof";return d=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},d(e)}function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function p(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function g(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function v(e){var t=x();return function(){var n=S(e),r;if(t){var i=S(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y(this,r)}}function y(e,t){return t&&(d(t)===`object`||typeof t==`function`)?t:b(e)}function b(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function x(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){return e.hasOwnProperty(`key`)},T=function(e){g(c,e);var r=v(c);function c(e){var n;return p(this,c),n=r.call(this,e),C(b(n),`itemsWrapperRef`,void 0),C(b(n),`itemsListRef`,void 0),C(b(n),`thumbsRef`,void 0),C(b(n),`setItemsWrapperRef`,function(e){n.itemsWrapperRef=e}),C(b(n),`setItemsListRef`,function(e){n.itemsListRef=e}),C(b(n),`setThumbsRef`,function(e,t){n.thumbsRef||=[],n.thumbsRef[t]=e}),C(b(n),`updateSizes`,function(){if(!(!n.props.children||!n.itemsWrapperRef||!n.thumbsRef)){var e=t.Children.count(n.props.children),r=n.itemsWrapperRef.clientWidth,a=n.props.thumbWidth?n.props.thumbWidth:(0,i.outerWidth)(n.thumbsRef[0]),o=Math.floor(r/a),s=o<e,c=s?e-o:0;n.setState(function(e,t){return{itemSize:a,visibleItems:o,firstItem:s?n.getFirstItem(t.selectedItem):0,lastPosition:c,showArrows:s}})}}),C(b(n),`handleClickItem`,function(e,t,r){if(!w(r)||r.key===`Enter`){var i=n.props.onSelectItem;typeof i==`function`&&i(e,t)}}),C(b(n),`onSwipeStart`,function(){n.setState({swiping:!0})}),C(b(n),`onSwipeEnd`,function(){n.setState({swiping:!1})}),C(b(n),`onSwipeMove`,function(e){var r=e.x;if(!n.state.itemSize||!n.itemsWrapperRef||!n.state.visibleItems)return!1;var i=0,o=t.Children.count(n.props.children),s=-(n.state.firstItem*100)/n.state.visibleItems,c=-Math.max(o-n.state.visibleItems,0)*100/n.state.visibleItems;s===i&&r>0&&(r=0),s===c&&r<0&&(r=0);var l=s+100/(n.itemsWrapperRef.clientWidth/r);return n.itemsListRef&&[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(e){n.itemsListRef.style[e]=(0,a.default)(l,`%`,n.props.axis)}),!0}),C(b(n),`slideRight`,function(e){n.moveTo(n.state.firstItem-(typeof e==`number`?e:1))}),C(b(n),`slideLeft`,function(e){n.moveTo(n.state.firstItem+(typeof e==`number`?e:1))}),C(b(n),`moveTo`,function(e){e=e<0?0:e,e=e>=n.state.lastPosition?n.state.lastPosition:e,n.setState({firstItem:e})}),n.state={selectedItem:e.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},n}return h(c,[{key:`componentDidMount`,value:function(){this.setupThumbs()}},{key:`componentDidUpdate`,value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:`componentWillUnmount`,value:function(){this.destroyThumbs()}},{key:`setupThumbs`,value:function(){(0,s.default)().addEventListener(`resize`,this.updateSizes),(0,s.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.updateSizes()}},{key:`destroyThumbs`,value:function(){(0,s.default)().removeEventListener(`resize`,this.updateSizes),(0,s.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes)}},{key:`getFirstItem`,value:function(e){var t=e;return e>=this.state.lastPosition&&(t=this.state.lastPosition),e<this.state.firstItem+this.state.visibleItems&&(t=this.state.firstItem),e<this.state.firstItem&&(t=e),t}},{key:`renderItems`,value:function(){var e=this;return this.props.children.map(function(r,i){var a={key:i,ref:function(t){return e.setThumbsRef(t,i)},className:n.default.ITEM(!1,i===e.state.selectedItem),onClick:e.handleClickItem.bind(e,i,e.props.children[i]),onKeyDown:e.handleClickItem.bind(e,i,e.props.children[i]),"aria-label":`${e.props.labels.item} ${i+1}`,style:{width:e.props.thumbWidth}};return t.default.createElement(`li`,f({},a,{role:`button`,tabIndex:0}),r)})}},{key:`render`,value:function(){var e=this;if(!this.props.children)return null;var r=t.Children.count(this.props.children)>1,i=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,c={},l=-this.state.firstItem*(this.state.itemSize||0),u=(0,a.default)(l,`px`,this.props.axis),d=this.props.transitionTime+`ms`;return c={WebkitTransform:u,MozTransform:u,MsTransform:u,OTransform:u,transform:u,msTransform:u,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},t.default.createElement(`div`,{className:n.default.CAROUSEL(!1)},t.default.createElement(`div`,{className:n.default.WRAPPER(!1),ref:this.setItemsWrapperRef},t.default.createElement(`button`,{type:`button`,className:n.default.ARROW_PREV(!i),onClick:function(){return e.slideRight()},"aria-label":this.props.labels.leftArrow}),r?t.default.createElement(o.default,{tagName:`ul`,className:n.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:c,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):t.default.createElement(`ul`,{className:n.default.SLIDER(!1,this.state.swiping),ref:function(t){return e.setItemsListRef(t)},style:c},this.renderItems()),t.default.createElement(`button`,{type:`button`,className:n.default.ARROW_NEXT(!s),onClick:function(){return e.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),c}(t.Component);e.default=T,C(T,`displayName`,`Thumbs`),C(T,`defaultProps`,{axis:`horizontal`,labels:{leftArrow:`previous slide / item`,rightArrow:`next slide / item`,item:`slide item`},selectedItem:0,thumbWidth:80,transitionTime:350})})),ct=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0,e.default=function(){return document}})),lt=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setPosition=e.getPosition=e.isKeyboardEvent=e.defaultStatusFormatter=e.noop=void 0;var t=r(),n=i(at());function i(e){return e&&e.__esModule?e:{default:e}}e.noop=function(){},e.defaultStatusFormatter=function(e,t){return`${e} of ${t}`},e.isKeyboardEvent=function(e){return e?e.hasOwnProperty(`key`):!1},e.getPosition=function(e,n){if(n.infiniteLoop&&++e,e===0)return 0;var r=t.Children.count(n.children);if(n.centerMode&&n.axis===`horizontal`){var i=-e*n.centerSlidePercentage,a=r-1;return e&&(e!==a||n.infiniteLoop)?i+=(100-n.centerSlidePercentage)/2:e===a&&(i+=100-n.centerSlidePercentage),i}return-e*100},e.setPosition=function(e,t){var r={};return[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(i){r[i]=(0,n.default)(e,`%`,t)}),r}})),ut=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fadeAnimationHandler=e.slideStopSwipingHandler=e.slideSwipeAnimationHandler=e.slideAnimationHandler=void 0;var t=r(),n=a(at()),i=lt();function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.slideAnimationHandler=function(e,r){var a={},o=r.selectedItem,c=o,l=t.Children.count(e.children)-1;if(e.infiniteLoop&&(o<0||o>l))return c<0?e.centerMode&&e.centerSlidePercentage&&e.axis===`horizontal`?a.itemListStyle=(0,i.setPosition)(-(l+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):a.itemListStyle=(0,i.setPosition)(-(l+2)*100,e.axis):c>l&&(a.itemListStyle=(0,i.setPosition)(0,e.axis)),a;var u=(0,i.getPosition)(o,e),d=(0,n.default)(u,`%`,e.axis),f=e.transitionTime+`ms`;return a.itemListStyle={WebkitTransform:d,msTransform:d,OTransform:d,transform:d},r.swiping||(a.itemListStyle=s(s({},a.itemListStyle),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),a},e.slideSwipeAnimationHandler=function(e,n,r,a){var o={},s=n.axis===`horizontal`,c=t.Children.count(n.children),l=0,u=(0,i.getPosition)(r.selectedItem,n),d=n.infiniteLoop?(0,i.getPosition)(c-1,n)-100:(0,i.getPosition)(c-1,n),f=s?e.x:e.y,p=f;u===l&&f>0&&(p=0),u===d&&f<0&&(p=0);var m=u+100/(r.itemSize/p),h=Math.abs(f)>n.swipeScrollTolerance;return n.infiniteLoop&&h&&(r.selectedItem===0&&m>-100?m-=c*100:r.selectedItem===c-1&&m<-c*100&&(m+=c*100)),(!n.preventMovementUntilSwipeScrollTolerance||h||r.swipeMovementStarted)&&(r.swipeMovementStarted||a({swipeMovementStarted:!0}),o.itemListStyle=(0,i.setPosition)(m,n.axis)),h&&!r.cancelClick&&a({cancelClick:!0}),o},e.slideStopSwipingHandler=function(e,t){var n=(0,i.getPosition)(t.selectedItem,e);return{itemListStyle:(0,i.setPosition)(n,e.axis)}},e.fadeAnimationHandler=function(e,t){var n=e.transitionTime+`ms`,r=`ease-in-out`,i={position:`absolute`,display:`block`,zIndex:-2,minHeight:`100%`,opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return t.swiping||(i=s(s({},i),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:i,selectedStyle:s(s({},i),{},{opacity:1,position:`relative`}),prevStyle:s({},i)}}})),dt=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=f(r()),n=u(tt()),i=u(rt()),a=u(st()),o=u(ct()),s=u(ot()),c=lt(),l=ut();function u(e){return e&&e.__esModule?e:{default:e}}function d(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return d=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(e===null||p(e)!==`object`&&typeof e!=`function`)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function p(e){"@babel/helpers - typeof";return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),e}function b(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}function x(e,t){return x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},x(e,t)}function S(e){var t=T();return function(){var n=E(e),r;if(t){var i=E(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){return t&&(p(t)===`object`||typeof t==`function`)?t:w(e)}function w(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function T(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=function(e){b(u,e);var r=S(u);function u(e){var n;_(this,u),n=r.call(this,e),D(w(n),`thumbsRef`,void 0),D(w(n),`carouselWrapperRef`,void 0),D(w(n),`listRef`,void 0),D(w(n),`itemsRef`,void 0),D(w(n),`timer`,void 0),D(w(n),`animationHandler`,void 0),D(w(n),`setThumbsRef`,function(e){n.thumbsRef=e}),D(w(n),`setCarouselWrapperRef`,function(e){n.carouselWrapperRef=e}),D(w(n),`setListRef`,function(e){n.listRef=e}),D(w(n),`setItemsRef`,function(e,t){n.itemsRef||=[],n.itemsRef[t]=e}),D(w(n),`autoPlay`,function(){t.Children.count(n.props.children)<=1||(n.clearAutoPlay(),n.props.autoPlay&&(n.timer=setTimeout(function(){n.increment()},n.props.interval)))}),D(w(n),`clearAutoPlay`,function(){n.timer&&clearTimeout(n.timer)}),D(w(n),`resetAutoPlay`,function(){n.clearAutoPlay(),n.autoPlay()}),D(w(n),`stopOnHover`,function(){n.setState({isMouseEntered:!0},n.clearAutoPlay)}),D(w(n),`startOnLeave`,function(){n.setState({isMouseEntered:!1},n.autoPlay)}),D(w(n),`isFocusWithinTheCarousel`,function(){return n.carouselWrapperRef?!!((0,o.default)().activeElement===n.carouselWrapperRef||n.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),D(w(n),`navigateWithKeyboard`,function(e){if(n.isFocusWithinTheCarousel()){var t=n.props.axis===`horizontal`,r={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},i=t?r.ArrowRight:r.ArrowDown,a=t?r.ArrowLeft:r.ArrowUp;i===e.keyCode?n.increment():a===e.keyCode&&n.decrement()}}),D(w(n),`updateSizes`,function(){if(!(!n.state.initialized||!n.itemsRef||n.itemsRef.length===0)){var e=n.props.axis===`horizontal`,t=n.itemsRef[0];if(t){var r=e?t.clientWidth:t.clientHeight;n.setState({itemSize:r}),n.thumbsRef&&n.thumbsRef.updateSizes()}}}),D(w(n),`setMountState`,function(){n.setState({hasMount:!0}),n.updateSizes()}),D(w(n),`handleClickItem`,function(e,r){if(t.Children.count(n.props.children)!==0){if(n.state.cancelClick){n.setState({cancelClick:!1});return}n.props.onClickItem(e,r),e!==n.state.selectedItem&&n.setState({selectedItem:e})}}),D(w(n),`handleOnChange`,function(e,r){t.Children.count(n.props.children)<=1||n.props.onChange(e,r)}),D(w(n),`handleClickThumb`,function(e,t){n.props.onClickThumb(e,t),n.moveTo(e)}),D(w(n),`onSwipeStart`,function(e){n.setState({swiping:!0}),n.props.onSwipeStart(e)}),D(w(n),`onSwipeEnd`,function(e){n.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),n.props.onSwipeEnd(e),n.clearAutoPlay(),n.state.autoPlay&&n.autoPlay()}),D(w(n),`onSwipeMove`,function(e,t){n.props.onSwipeMove(t);var r=n.props.swipeAnimationHandler(e,n.props,n.state,n.setState.bind(w(n)));return n.setState(g({},r)),!!Object.keys(r).length}),D(w(n),`decrement`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem-(typeof e==`number`?e:1))}),D(w(n),`increment`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem+(typeof e==`number`?e:1))}),D(w(n),`moveTo`,function(e){if(typeof e==`number`){var r=t.Children.count(n.props.children)-1;e<0&&(e=n.props.infiniteLoop?r:0),e>r&&(e=n.props.infiniteLoop?0:r),n.selectItem({selectedItem:e}),n.state.autoPlay&&n.state.isMouseEntered===!1&&n.resetAutoPlay()}}),D(w(n),`onClickNext`,function(){n.increment(1)}),D(w(n),`onClickPrev`,function(){n.decrement(1)}),D(w(n),`onSwipeForward`,function(){n.increment(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`onSwipeBackwards`,function(){n.decrement(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`changeItem`,function(e){return function(t){(!(0,c.isKeyboardEvent)(t)||t.key===`Enter`)&&n.moveTo(e)}}),D(w(n),`selectItem`,function(e){n.setState(g({previousItem:n.state.selectedItem},e),function(){n.setState(n.animationHandler(n.props,n.state))}),n.handleOnChange(e.selectedItem,t.Children.toArray(n.props.children)[e.selectedItem])}),D(w(n),`getInitialImage`,function(){var e=n.props.selectedItem,t=n.itemsRef&&n.itemsRef[e];return(t&&t.getElementsByTagName(`img`)||[])[0]}),D(w(n),`getVariableItemHeight`,function(e){var t=n.itemsRef&&n.itemsRef[e];if(n.state.hasMount&&t&&t.children.length){var r=t.children[0].getElementsByTagName(`img`)||[];if(r.length>0){var i=r[0];i.complete||i.addEventListener(`load`,function e(){n.forceUpdate(),i.removeEventListener(`load`,e)})}var a=(r[0]||t.children[0]).clientHeight;return a>0?a:null}return null});var i={initialized:!1,previousItem:e.selectedItem,selectedItem:e.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:e.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return n.animationHandler=typeof e.animationHandler==`function`&&e.animationHandler||e.animationHandler===`fade`&&l.fadeAnimationHandler||l.slideAnimationHandler,n.state=g(g({},i),n.animationHandler(e,i)),n}return y(u,[{key:`componentDidMount`,value:function(){this.props.children&&this.setupCarousel()}},{key:`componentDidUpdate`,value:function(e,t){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),t.swiping&&!this.state.swiping&&this.setState(g({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.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 e=this;this.bindEvents(),this.state.autoPlay&&t.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var t=e.getInitialImage();t&&!t.complete?t.addEventListener(`load`,e.setMountState):e.setMountState()})}},{key:`destroyCarousel`,value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:`setupAutoPlay`,value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener(`mouseenter`,this.stopOnHover),e.addEventListener(`mouseleave`,this.startOnLeave))}},{key:`destroyAutoPlay`,value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener(`mouseenter`,this.stopOnHover),e.removeEventListener(`mouseleave`,this.startOnLeave))}},{key:`bindEvents`,value:function(){(0,s.default)().addEventListener(`resize`,this.updateSizes),(0,s.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`unbindEvents`,value:function(){(0,s.default)().removeEventListener(`resize`,this.updateSizes),(0,s.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener(`load`,this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`forceFocus`,value:function(){var e;(e=this.carouselWrapperRef)==null||e.focus()}},{key:`renderItems`,value:function(e){var n=this;return this.props.children?t.Children.map(this.props.children,function(r,a){var o=a===n.state.selectedItem,s=a===n.state.previousItem,c=o&&n.state.selectedStyle||s&&n.state.prevStyle||n.state.slideStyle||{};n.props.centerMode&&n.props.axis===`horizontal`&&(c=g(g({},c),{},{minWidth:n.props.centerSlidePercentage+`%`})),n.state.swiping&&n.state.swipeMovementStarted&&(c=g(g({},c),{},{pointerEvents:`none`}));var l={ref:function(e){return n.setItemsRef(e,a)},key:`itemKey`+a+(e?`clone`:``),className:i.default.ITEM(!0,a===n.state.selectedItem,a===n.state.previousItem),onClick:n.handleClickItem.bind(n,a,r),style:c};return t.default.createElement(`li`,l,n.props.renderItem(r,{isSelected:a===n.state.selectedItem,isPrevious:a===n.state.previousItem}))}):[]}},{key:`renderControls`,value:function(){var e=this,n=this.props,r=n.showIndicators,i=n.labels,a=n.renderIndicator,o=n.children;return r?t.default.createElement(`ul`,{className:`control-dots`},t.Children.map(o,function(t,n){return a&&a(e.changeItem(n),n===e.state.selectedItem,n,i.item)})):null}},{key:`renderStatus`,value:function(){return this.props.showStatus?t.default.createElement(`p`,{className:`carousel-status`},this.props.statusFormatter(this.state.selectedItem+1,t.Children.count(this.props.children))):null}},{key:`renderThumbs`,value:function(){return!this.props.showThumbs||!this.props.children||t.Children.count(this.props.children)===0?null:t.default.createElement(a.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 e=this;if(!this.props.children||t.Children.count(this.props.children)===0)return null;var r=this.props.swipeable&&t.Children.count(this.props.children)>1,a=this.props.axis===`horizontal`,o=this.props.showArrows&&t.Children.count(this.props.children)>1,s=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=o&&(this.state.selectedItem<t.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,l=this.renderItems(!0),u=l.shift(),d=l.pop(),f={className:i.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},p={};return a?(f.onSwipeLeft=this.onSwipeForward,f.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight&&(p.height=this.getVariableItemHeight(this.state.selectedItem)||`auto`)):(f.onSwipeUp=this.props.verticalSwipe===`natural`?this.onSwipeBackwards:this.onSwipeForward,f.onSwipeDown=this.props.verticalSwipe===`natural`?this.onSwipeForward:this.onSwipeBackwards,f.style=g(g({},f.style),{},{height:this.state.itemSize}),p.height=this.state.itemSize),t.default.createElement(`div`,{"aria-label":this.props.ariaLabel,className:i.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},t.default.createElement(`div`,{className:i.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,s,this.props.labels.leftArrow),t.default.createElement(`div`,{className:i.default.WRAPPER(!0,this.props.axis),style:p},r?t.default.createElement(n.default,m({tagName:`ul`,innerRef:this.setListRef},f,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u):t.default.createElement(`ul`,{className:i.default.SLIDER(!0,this.state.swiping),ref:function(t){return e.setListRef(t)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u)),this.props.renderArrowNext(this.onClickNext,c,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),u}(t.default.Component);e.default=O,D(O,`displayName`,`Carousel`),D(O,`defaultProps`,{ariaLabel:void 0,axis:`horizontal`,centerSlidePercentage:80,interval:3e3,labels:{leftArrow:`previous slide / item`,rightArrow:`next slide / item`,item:`slide item`},onClickItem:c.noop,onClickThumb:c.noop,onChange:c.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(e,n,r){return t.default.createElement(`button`,{type:`button`,"aria-label":r,className:i.default.ARROW_PREV(!n),onClick:e})},renderArrowNext:function(e,n,r){return t.default.createElement(`button`,{type:`button`,"aria-label":r,className:i.default.ARROW_NEXT(!n),onClick:e})},renderIndicator:function(e,n,r,a){return t.default.createElement(`li`,{className:i.default.DOT(n),onClick:e,onKeyDown:e,value:r,key:r,role:`button`,tabIndex:0,"aria-label":`${a} ${r+1}`})},renderItem:function(e){return e},renderThumbs:function(e){var n=t.Children.map(e,function(e){var n=e;if(e.type!==`img`&&(n=t.Children.toArray(e.props.children).find(function(e){return e.type===`img`})),n)return n});return n.filter(function(e){return e}).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`),[]):n},statusFormatter:c.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:`standard`,width:`100%`,animationHandler:`slide`,swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler})})),ft=t((()=>{})),pt=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`Carousel`,{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,`CarouselProps`,{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,`Thumbs`,{enumerable:!0,get:function(){return r.default}});var t=i(dt()),n=ft(),r=i(st());function i(e){return e&&e.__esModule?e:{default:e}}})),mt=t(((e,t)=>{var n=R();t.exports=function(){return n.Date.now()}})),ht=t(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),gt=t(((e,t)=>{var n=ht(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),_t=t(((e,t)=>{var n=gt(),r=F(),i=A(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),vt=t(((e,t)=>{var n=F(),r=mt(),i=_t(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),yt=e(vt(),1);function bt(e,t,n,r,i=!1){let a=G.useRef();a.current=t,G.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;let t=n,o=e=>{a.current?.call(t,e)};return t.addEventListener(e,o,{passive:r,capture:i}),()=>{t.removeEventListener(e,o,{capture:i})}},[e,n,r,i])}function xt(e,t){return e===void 0?void 0:t}var St=Math.PI;function Ct(e){return e*St/180}var wt=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Tt=(e,t,n,r,i)=>{switch(e){case`left`:return Math.floor(t)+r+i/2;case`center`:return Math.floor(t+n/2);case`right`:return Math.floor(t+n)-r-i/2}},Et=(e,t,n)=>Math.min(e,t-n*2),Dt=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ot=e=>{let t=e.fgColor??`currentColor`;return G.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},G.createElement(`path`,{d:`M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}),G.createElement(`path`,{d:`M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}))},kt=e=>{let t=e.fgColor??`currentColor`;return G.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},G.createElement(`path`,{d:`M19 6L10.3802 17L5.34071 11.8758`,vectorEffect:`non-scaling-stroke`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}))};function At(e,t,n){let[r,i]=G.useState(e),a=G.useRef(!0);G.useEffect(()=>()=>{a.current=!1},[]);let o=G.useRef((0,yt.default)(e=>{a.current&&i(e)},n));return G.useLayoutEffect(()=>{a.current&&o.current(()=>e())},t),r}var jt=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--]*[֑-߿יִ-﷽ﹰ-ﻼ]`);function Mt(e){return jt.test(e)?`rtl`:`not-rtl`}var Nt=void 0;function Pt(){if(typeof document>`u`)return 0;if(Nt!==void 0)return Nt;let e=document.createElement(`p`);e.style.width=`100%`,e.style.height=`200px`;let 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);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Nt=n-r,Nt}var Ft=Symbol();function It(e){let t=G.useRef([Ft,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[n,r]=G.useState(e),[,i]=G.useState(),a=G.useCallback(e=>{let n=t.current[0];n!==Ft&&(e=typeof e==`function`?e(n):e,e===n)||(n!==Ft&&i({}),r(t=>typeof e==`function`?e(n===Ft?t:n):e),t.current[0]=Ft)},[]),o=G.useCallback(()=>{t.current[0]=Ft,i({})},[]);return[t.current[0]===Ft?n:t.current[0],a,o]}function Lt(e){if(e.length===0)return``;let t=0,n=0;for(let r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(`, `)}function Rt(e){let t=G.useRef(e);return ae(e,t.current)||(t.current=e),t.current}var zt=pt(),Bt=e=>{let{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,a=t.filter(e=>e!==``);if(a.length===0)return null;let o=a.length>1;return G.createElement(Ze,{"data-testid":`GDG-default-image-overlay-editor`},G.createElement(zt.Carousel,{showArrows:o,showThumbs:!1,swipeable:o,emulateTouch:o,infiniteLoop:o},a.map(e=>{let t=i?.(e)??G.createElement(`img`,{draggable:!1,src:e});return G.createElement(`div`,{className:`gdg-centering-container`,key:e},t)})),n&&r&&G.createElement(`button`,{className:`gdg-edit-icon`,onClick:r},G.createElement(Ot,null)))},Vt=W(`div`)({name:`MarkdownContainer`,class:`gdg-mnuv029`,propsAsIs:!1}),Ht=class extends G.PureComponent{targetElement=null;renderMarkdownIntoDiv(){let{targetElement:e,props:t}=this;if(e===null)return;let{contents:n,createNode:r}=t,i=S(n),a=document.createRange();a.selectNodeContents(e),a.deleteContents();let o=r?.(i);if(o===void 0){let e=document.createElement(`template`);e.innerHTML=i,o=e.content}e.append(o);let s=e.getElementsByTagName(`a`);for(let e of s)e.target=`_blank`,e.rel=`noreferrer noopener`}containerRefHook=e=>{this.targetElement=e,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),G.createElement(Vt,{ref:this.containerRefHook})}},Ut=W(`textarea`)({name:`InputBox`,class:`gdg-izpuzkl`,propsAsIs:!1}),Wt=W(`div`)({name:`ShadowBox`,class:`gdg-s69h75o`,propsAsIs:!1}),Gt=W(`div`)({name:`GrowingEntryStyle`,class:`gdg-g1y0xocz`,propsAsIs:!1}),Kt=0,qt=e=>{let{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:a,validatedSelection:o,...s}=e,{onChange:c,className:l}=s,u=G.useRef(null),d=n??``;se(c!==void 0,`GrowingEntry must be a controlled input area`);let[f]=G.useState(()=>`input-box-`+(Kt=(Kt+1)%1e7));G.useEffect(()=>{let e=u.current;if(e===null||e.disabled)return;let t=d.toString().length;e.focus(),e.setSelectionRange(i?0:t,t)},[]),G.useLayoutEffect(()=>{if(o!==void 0){let e=typeof o==`number`?[o,null]:o;u.current?.setSelectionRange(e[0],e[1])}},[o]);let p=G.useCallback(e=>{e.key===`Enter`&&e.shiftKey&&a===!0||r?.(e)},[a,r]);return G.createElement(Gt,{className:`gdg-growing-entry`},G.createElement(Wt,{className:l},d+`
|
|
5
|
+
`),G.createElement(Ut,{...s,className:(l??``)+` gdg-input`,id:f,ref:u,onKeyDown:p,value:d,placeholder:t,dir:`auto`}))},Jt=new Map,Yt=new Map,Xt=new Map;function Zt(){Jt.clear(),Xt.clear(),Yt.clear()}function Qt(e,t,n,r,i){let a=0,o={};for(let t of e)a+=n.get(t)??i,o[t]=(o[t]??0)+1;let s=t-a;for(let e of Object.keys(o)){let t=o[e],c=n.get(e)??i,l=c+s*(c*t/a)*r/t;n.set(e,l)}}function $t(e,t){let n=new Map,r=0;for(let t of`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?`){let i=e.measureText(t).width;n.set(t,i),r+=i}let i=r/n.size,a=(t/i+3)/4,o=n.keys();for(let e of o)n.set(e,(n.get(e)??i)*a);return n}function en(e,t,n,r){let i=Yt.get(n);if(r&&i!==void 0&&i.count>2e4){let r=Xt.get(n);if(r===void 0&&(r=$t(e,i.size),Xt.set(n,r)),i.count>5e5){let e=0;for(let n of t)e+=r.get(n)??i.size;return e*1.01}let a=e.measureText(t);return Qt(t,a.width,r,Math.max(.05,1-i.count/2e5),i.size),Yt.set(n,{count:i.count+t.length,size:i.size}),a.width}let a=e.measureText(t),o=a.width/t.length;if((i?.count??0)>2e4)return a.width;if(i===void 0)Yt.set(n,{count:t.length,size:o});else{let e=o-i.size,r=t.length/(i.count+t.length),a=i.size+e*r;Yt.set(n,{count:i.count+t.length,size:a})}return a.width}function tn(e,t,n,r,i,a,o,s){if(t.length<=1)return t.length;if(i<n)return-1;let c=Math.floor(n/i*a),l=en(e,t.slice(0,Math.max(0,c)),r,o),u=s?.(t);if(l!==n)if(l<n){for(;l<n;)c++,l=en(e,t.slice(0,Math.max(0,c)),r,o);c--}else for(;l>n;){let n=u===void 0?t.lastIndexOf(` `,c-1):0;n>0?c=n:c--,l=en(e,t.slice(0,Math.max(0,c)),r,o)}if(t[c]!==` `){let e=0;if(u===void 0)e=t.lastIndexOf(` `,c);else for(let t of u){if(t>c)break;e=t}e>0&&(c=e)}return c}function J(e,t,n,r,i,a){let o=`${t}_${n}_${r}px`,s=Jt.get(o);if(s!==void 0)return s;if(r<=0)return[];let c=[],l=t.split(`
|
|
6
|
+
`),u=Yt.get(n),d=u===void 0?t.length:r/u.size*1.5,f=i&&u!==void 0&&u.count>2e4;for(let t of l){let i=en(e,t.slice(0,Math.max(0,d)),n,f),o=Math.min(t.length,d);if(i<=r)c.push(t);else{for(;i>r;){let s=tn(e,t,r,n,i,o,f,a),l=t.slice(0,Math.max(0,s));t=t.slice(l.length),c.push(l),i=en(e,t.slice(0,Math.max(0,d)),n,f),o=Math.min(t.length,d)}i>0&&c.push(t)}}return c=c.map((e,t)=>t===0?e.trimEnd():e.trim()),Jt.set(o,c),Jt.size>500&&Jt.delete(Jt.keys().next().value),c}function nn(e,t){return G.useMemo(()=>e.map((e,n)=>({group:e.group,grow:e.grow,hasMenu:e.hasMenu,icon:e.icon,id:e.id,menuIcon:e.menuIcon,overlayIcon:e.overlayIcon,sourceIndex:n,sticky:n<t,style:e.style,themeOverride:e.themeOverride,title:e.title,trailingRowOptions:e.trailingRowOptions,width:e.width,growOffset:e.growOffset,rowMarker:e.rowMarker,rowMarkerChecked:e.rowMarkerChecked})),[e,t])}function rn(e,t){let[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(cn(e.current.cell,t))return!0;let i=[e.current.range,...e.current.rangeStack];for(let e of i)if(n>=e.x&&n<e.x+e.width&&r>=e.y&&r<e.y+e.height)return!0}return!1}function an(e,t){return(e??``)===(t??``)}function on(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function sn(e,t){let[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function cn(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function ln(e){return[e.x+e.width-1,e.y+e.height-1]}function un(e,t,n){let r=n.x,i=n.x+n.width-1,a=n.y,o=n.y+n.height-1,[s,c]=e;if(c<a||c>o)return!1;if(t.span===void 0)return s>=r&&s<=i;let[l,u]=t.span;return l>=r&&l<=i||u>=r&&l<=i||l<r&&u>i}function dn(e,t,n,r){let i=0;if(n.current===void 0)return i;let a=n.current.range;(r||a.height*a.width>1)&&un(e,t,a)&&i++;for(let r of n.current.rangeStack)un(e,t,r)&&i++;return i}function fn(e,t){let n=e;if(t!==void 0){let r=[...e],i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((t,n)=>({...t,sticky:e[n].sticky})),n=r}return n}function Y(e,t){let n=0,r=fn(e,t);for(let e=0;e<r.length;e++){let t=r[e];if(t.sticky)n+=t.width;else break}return n}function pn(e,t,n){if(typeof n==`number`)return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function mn(e,t,n,r,i){let a=fn(e,r),o=[];for(let e of a)if(e.sticky)o.push(e);else break;if(o.length>0)for(let e of o)n-=e.width;let s=t,c=i??0;for(;c<=n&&s<a.length;)c+=a[s].width,s++;for(let e=t;e<s;e++){let t=a[e];t.sticky||o.push(t)}return o}function hn(e,t,n){let r=0;for(let i of t){if(e<=(i.sticky?r:r+(n??0))+i.width)return i.sourceIndex;r+=i.width}return-1}function gn(e,t,n,r,i,a,o,s,c,l){let u=r+i;if(n&&e<=i)return-2;if(e<=u)return-1;let d=t;for(let t=0;t<l;t++){let n=a-1-t,r=typeof o==`number`?o:o(n);if(d-=r,e>=d)return n}let f=a-l,p=e-(c??0);if(typeof o==`number`){let e=Math.floor((p-u)/o)+s;return e>=f?void 0:e}else{let e=u;for(let t=s;t<f;t++){let n=o(t);if(p<=e+n)return t;e+=n}return}}var _n=0,vn={},yn=typeof window>`u`;async function bn(){yn||document?.fonts?.ready===void 0||(await document.fonts.ready,_n=0,vn={},Zt())}bn();function xn(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Sn(e,t,n,r=`middle`){let i=xn(e,t,r,n),a=vn[i];return a===void 0&&(a=t.measureText(e),vn[i]=a,_n++),_n>1e4&&(vn={},_n=0),a}function Cn(e,t){let n=xn(e,void 0,`middle`,t);return vn[n]}function wn(e,t){return typeof t!=`string`&&(t=t.baseFontFull),Dn(e,t)}function Tn(e,t){e.save(),e.textBaseline=t;let n=e.measureText(`ABCDEFGHIJKLMNOPQRSTUVWXYZ`);return e.restore(),n}var En=[];function Dn(e,t){for(let e of En)if(e.key===t)return e.val;let n=Tn(e,`alphabetic`),r=-(Tn(e,`middle`).actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return En.push({key:t,val:r}),r}function On(e,t,n,r,i,a){let{ctx:o,rect:s,theme:c}=e,l=2**53-1;return t!==void 0&&(l=n-t,l<500&&(o.globalAlpha=1-l/500,o.fillStyle=c.bgSearchResult,o.fillRect(s.x+1,s.y+1,s.width-(i?2:1),s.height-(a?2:1)),o.globalAlpha=1,r!==void 0&&(r.fillStyle=c.bgSearchResult))),l<500}function kn(e,t,n){let{ctx:r,theme:i}=e,a=t??{},o=n??i.textDark;return o!==a.fillStyle&&(r.fillStyle=o,a.fillStyle=o),a}function An(e,t,n,r,i,a,o,s,c){c===`right`?e.fillText(t,n+i-(s.cellHorizontalPadding+.5),r+a/2+o):c===`center`?e.fillText(t,n+i/2,r+a/2+o):e.fillText(t,n+s.cellHorizontalPadding+.5,r+a/2+o)}function jn(e,t){let n=Sn(`ABCi09jgqpy`,e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Mn(e,t){e.includes(`
|
|
7
|
+
`)&&(e=e.split(/\r?\n/,1)[0]);let n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Nn(e,t,n,r,i,a,o,s,c,l){let u=s.baseFontFull,d=J(e,t,u,i-s.cellHorizontalPadding*2,l??!1),f=jn(e,u),p=s.lineHeight*f,m=f+p*(d.length-1),h=m+s.cellVerticalPadding>a;h&&(e.save(),e.rect(n,r,i,a),e.clip());let g=r+a/2-m/2,_=Math.max(r+s.cellVerticalPadding,g);for(let t of d)if(An(e,t,n,_,i,f,o,s,c),_+=p,_>r+a)break;h&&e.restore()}function Pn(e,t,n,r,i){let{ctx:a,rect:o,theme:s}=e,{x:c,y:l,width:u,height:d}=o;r??=!1,r||(t=Mn(t,u));let f=wn(a,s),p=Mt(t)===`rtl`;if(n===void 0&&p&&(n=`right`),p&&(a.direction=`rtl`),t.length>0){let e=!1;n===`right`?(a.textAlign=`right`,e=!0):n!==void 0&&n!==`left`&&(a.textAlign=n,e=!0),r?Nn(a,t,c,l,u,d,f,s,n,i):An(a,t,c,l,u,d,f,s,n),e&&(a.textAlign=`start`),p&&(a.direction=`inherit`)}}function Fn(e,t,n,r,i,a){typeof a==`number`&&(a={tl:a,tr:a,br:a,bl:a}),a={tl:Math.max(0,Math.min(a.tl,i/2,r/2)),tr:Math.max(0,Math.min(a.tr,i/2,r/2)),bl:Math.max(0,Math.min(a.bl,i/2,r/2)),br:Math.max(0,Math.min(a.br,i/2,r/2))},e.moveTo(t+a.tl,n),e.arcTo(t+r,n,t+r,n+a.tr,a.tr),e.arcTo(t+r,n+i,t+r-a.br,n+i,a.br),e.arcTo(t,n+i,t,n+i-a.bl,a.bl),e.arcTo(t,n,t+a.tl,n,a.tl)}function In(e,t,n){let r=1.25;e.arc(t,n-r*3.5,r,0,2*Math.PI,!1),e.arc(t,n,r,0,2*Math.PI,!1),e.arc(t,n+r*3.5,r,0,2*Math.PI,!1)}function Ln(e,t,n){let r=function(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=n/i,o=r/i;return{x:n,y:t.y-e.y,len:i,nx:a,ny:o,ang:Math.atan2(o,a)}},i,a=t.length,o=t[a-1];for(let s=0;s<a;s++){let c=t[s%a],l=t[(s+1)%a],u=r(c,o),d=r(c,l),f=u.nx*d.ny-u.ny*d.nx,p=u.nx*d.nx-u.ny*-d.ny,m=Math.asin(f<-1?-1:f>1?1:f),h=1,g=!1;p<0?m<0?m=Math.PI+m:(m=Math.PI-m,h=-1,g=!0):m>0&&(h=-1,g=!0),i=c.radius===void 0?n:c.radius;let _=m/2,v=Math.abs(Math.cos(_)*i/Math.sin(_)),y;v>Math.min(u.len/2,d.len/2)?(v=Math.min(u.len/2,d.len/2),y=Math.abs(v*Math.sin(_)/Math.cos(_))):y=i;let b=c.x+d.nx*v,x=c.y+d.ny*v;b+=-d.ny*y*h,x+=d.nx*y*h,e.arc(b,x,y,u.ang+Math.PI/2*h,d.ang-Math.PI/2*h,g),o=c,c=l}e.closePath()}function Rn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h={x:0,y:a+l,width:0,height:0};if(e>=p.length||t>=u||t<-2||e<0)return h;let g=a-i;if(e>=d){let t=o>e?-1:1,n=Y(p);h.x+=n+c;for(let n=o;n!==e;n+=t)h.x+=p[t===1?n:n-1].width*t}else for(let t=0;t<e;t++)h.x+=p[t].width;if(h.width=p[e].width+1,t===-1)h.y=i,h.height=g;else if(t===-2){h.y=0,h.height=i;let t=e,r=p[e].group,a=p[e].sticky;for(;t>0&&an(p[t-1].group,r)&&p[t-1].sticky===a;){let e=p[t-1];h.x-=e.width,h.width+=e.width,t--}let o=e;for(;o+1<p.length&&an(p[o+1].group,r)&&p[o+1].sticky===a;){let e=p[o+1];h.width+=e.width,o++}if(!a){let e=Y(p),t=h.x-e;t<0&&(h.x-=t,h.width+=t),h.x+h.width>n&&(h.width=n-h.x)}}else if(t>=u-f){let e=u-t;for(h.y=r;e>0;){let n=t+e-1;h.height=typeof m==`number`?m:m(n),h.y-=h.height,e--}h.height+=1}else{let e=s>t?-1:1;if(typeof m==`number`){let e=t-s;h.y+=e*m}else for(let n=s;n!==t;n+=e)h.y+=m(n)*e;h.height=(typeof m==`number`?m:m(t))+1}return h}var zn=1<<21;function X(e,t){return(t+2)*zn+e}function Bn(e){return e%zn}function Vn(e){return Math.floor(e/zn)-2}function Hn(e){return[Bn(e),Vn(e)]}var Un=class{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=e=>{let t=Bn(e),n=Vn(e),r=this.visibleWindow,i=t>=r.x&&t<=r.x+r.width||t<this.freezeCols,a=n>=r.y&&n<=r.y+r.height||this.freezeRows.includes(n);return i&&a};setWindow(e,t,n){this.visibleWindow.x===e.x&&this.visibleWindow.y===e.y&&this.visibleWindow.width===e.width&&this.visibleWindow.height===e.height&&this.freezeCols===t&&ae(this.freezeRows,n)||(this.visibleWindow=e,this.freezeCols=t,this.freezeRows=n,this.clearOutOfWindow())}},Wn=class extends Un{cache=new Map;setValue=(e,t)=>{this.cache.set(X(e[0],e[1]),t)};getValue=e=>this.cache.get(X(e[0],e[1]));clearOutOfWindow=()=>{for(let[e]of this.cache.entries())this.isInWindow(e)||this.cache.delete(e)}},Gn=class{cells;constructor(e=[]){this.cells=new Set(e.map(e=>X(e[0],e[1])))}add(e){this.cells.add(X(e[0],e[1]))}has(e){return e===void 0?!1:this.cells.has(X(e[0],e[1]))}remove(e){this.cells.delete(X(e[0],e[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(let e of this.cells)if(Vn(e)<0)return!0;return!1}hasItemInRectangle(e){for(let t=e.y;t<e.y+e.height;t++)for(let n=e.x;n<e.x+e.width;n++)if(this.cells.has(X(n,t)))return!0;return!1}hasItemInRegion(e){for(let t of e)if(this.hasItemInRectangle(t))return!0;return!1}*values(){for(let e of this.cells)yield Hn(e)}},Kn=150;function qn(e,t,n,r){return r(t)?.measure?.(e,t,n)??Kn}function Jn(e,t,n,r,i,a,o,s,c){let l=0,u=i===void 0?[]:i.map(n=>{let i=qn(e,n[r],t,c);return l=Math.max(l,i),i});if(u.length>5&&s){l=0;let e=0;for(let t of u)e+=t;let t=e/u.length;for(let e=0;e<u.length;e++)u[e]>=t*2?u[e]=0:l=Math.max(l,u[e])}l=Math.max(l,e.measureText(n.title).width+16+(n.icon===void 0?0:28));let d=Math.max(Math.ceil(a),Math.min(Math.floor(o),Math.ceil(l)));return{...n,width:d}}function Yn(e,t,n,r,i,a,o,s,c){let l=G.useRef(t),u=G.useRef(n),d=G.useRef(o);l.current=t,u.current=n,d.current=o;let[f,p]=G.useMemo(()=>{if(typeof window>`u`)return[null,null];let e=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,[e,e.getContext(`2d`,{alpha:!1})]},[]);G.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f?.remove()}),[f]);let m=G.useRef({}),h=G.useRef(),[g,_]=G.useState();return G.useLayoutEffect(()=>{let t=u.current;if(t===void 0||e.every(Te))return;let n=Math.max(1,10-Math.floor(e.length/1e4)),r=0;n<l.current&&n>1&&(n--,r=1);let i={x:0,y:0,width:e.length,height:Math.min(l.current,n)},a={x:0,y:l.current-1,width:e.length,height:1};(async()=>{let n=t(i,c.signal),o=r>0?t(a,c.signal):void 0,s;s=typeof n==`object`?n:await ge(n),o!==void 0&&(s=typeof o==`object`?[...s,...o]:[...s,...await ge(o)]),h.current=e,_(s)})()},[c.signal,e]),G.useMemo(()=>{let t=e.every(Te)?e:p===null?e.map(e=>Te(e)?e:{...e,width:Kn}):(p.font=d.current.baseFontFull,e.map((t,n)=>{if(Te(t))return t;if(m.current[t.id]!==void 0)return{...t,width:m.current[t.id]};if(g===void 0||h.current!==e||t.id===void 0)return{...t,width:Kn};let r=Jn(p,o,t,n,g,i,a,!0,s);return m.current[t.id]=r.width,r})),n=0,c=0,l=[];for(let[e,r]of t.entries())n+=r.width,r.grow!==void 0&&r.grow>0&&(c+=r.grow,l.push(e));if(n<r&&l.length>0){let e=[...t],i=r-n,a=i;for(let n=0;n<l.length;n++){let r=l[n],o=(t[r].grow??0)/c,s=n===l.length-1?a:Math.min(a,Math.floor(i*o));e[r]={...t[r],growOffset:s,width:t[r].width+s},a-=s}t=e}return{sizedColumns:t,nonGrowWidth:n}},[r,e,p,g,o,i,a,s])}var Xn=t(((e,t)=>{function n(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}t.exports=n})),Zn=t(((e,t)=>{var n=Xn(),r=_t();function i(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=r(i),i=i===i?i:0),t!==void 0&&(t=r(t),t=t===t?t:0),n(r(e),t,i)}t.exports=i})),Qn=t(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),$n=t(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),er=t(((e,t)=>{var n=Ee(),r=Qn(),i=$n();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),tr=t(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),nr=t(((e,t)=>{function n(e){return e!==e}t.exports=n})),rr=t(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),ir=t(((e,t)=>{var n=tr(),r=nr(),i=rr();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),ar=t(((e,t)=>{var n=ir();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),or=t(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),sr=t(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),cr=t(((e,t)=>{t.exports=le()(R(),`Set`)})),lr=t(((e,t)=>{function n(){}t.exports=n})),ur=t(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),dr=t(((e,t)=>{var n=cr(),r=lr(),i=ur();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),fr=t(((e,t)=>{var n=er(),r=ar(),i=or(),a=sr(),o=dr(),s=ur(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),pr=t(((e,t)=>{var n=fr();function r(e){return e&&e.length?n(e):[]}t.exports=r})),mr=t(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),hr=t(((e,t)=>{var n=k(),r=ve(),i=N(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),gr=t(((e,t)=>{var n=mr(),r=hr();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),_r=t(((e,t)=>{var n=gr();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),vr=t(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),yr=t(((e,t)=>{var n=De(),r=xe();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),br=t(((e,t)=>{var n=U(),r=yr(),i=L(),a=F();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),xr=t(((e,t)=>{var n=_t(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Sr=t(((e,t)=>{var n=vr(),r=br(),i=xr();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),Cr=t(((e,t)=>{t.exports=Sr()()})),Z=`<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">`,wr=e=>{let t=e.fgColor;return`
|
|
8
|
+
${Z}<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},Tr=e=>{let t=e.fgColor;return`
|
|
9
|
+
${Z}<rect x="2" y="2" width="16" height="16" rx="4" fill="${e.bgColor}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},Er=e=>{let t=e.fgColor;return`${Z}
|
|
10
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${e.bgColor}"/>
|
|
11
|
+
<path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
|
|
12
|
+
</svg>`},Dr=e=>{let t=e.fgColor;return`${Z}
|
|
13
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
14
|
+
<path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
|
|
15
|
+
</svg>`},Or=e=>{let t=e.fgColor;return`${Z}
|
|
16
|
+
<path
|
|
17
|
+
d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
|
|
18
|
+
fill="${e.bgColor}"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
fill-rule="evenodd"
|
|
22
|
+
clip-rule="evenodd"
|
|
23
|
+
d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
|
|
24
|
+
fill="${t}"
|
|
25
|
+
/>
|
|
26
|
+
</svg>`},kr=e=>{let t=e.fgColor;return`${Z}
|
|
27
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
28
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
|
|
29
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
|
|
30
|
+
</svg>
|
|
31
|
+
`},Ar={headerRowID:wr,headerNumber:Er,headerCode:Tr,headerString:Dr,headerBoolean:Or,headerAudioUri:kr,headerVideoUri:e=>{let t=e.fgColor;return`${Z}
|
|
32
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
33
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
|
|
34
|
+
</svg>`},headerEmoji:e=>{let t=e.fgColor;return`
|
|
35
|
+
${Z}
|
|
36
|
+
<path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
|
|
37
|
+
<path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
|
|
38
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
|
39
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${e.bgColor}"/>
|
|
40
|
+
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
|
|
41
|
+
<path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
|
|
42
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
|
43
|
+
</svg>`},headerImage:e=>{let t=e.fgColor;return`${Z}
|
|
44
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
45
|
+
<path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
|
|
46
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
|
|
47
|
+
</svg>`},headerUri:kr,headerPhone:e=>`
|
|
48
|
+
${Z}
|
|
49
|
+
<path fill="${e.fgColor}" d="M3 3h14v14H3z"/>
|
|
50
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${e.bgColor}"/>
|
|
51
|
+
</svg>`,headerMarkdown:e=>{let t=e.fgColor;return`
|
|
52
|
+
${Z}
|
|
53
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${e.bgColor}"/>
|
|
54
|
+
<path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
|
|
55
|
+
</svg>`},headerDate:e=>{let t=e.fgColor;return`${Z}
|
|
56
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
57
|
+
<path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
|
|
58
|
+
</svg>`},headerTime:e=>{let t=e.fgColor;return`
|
|
59
|
+
${Z}
|
|
60
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${e.bgColor}"/>
|
|
61
|
+
<path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
|
|
62
|
+
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
|
63
|
+
</svg>`},headerEmail:e=>{let t=e.fgColor;return`${Z}
|
|
64
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
65
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
|
|
66
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
|
|
67
|
+
</svg>`},headerReference:e=>{let t=e.fgColor,n=e.bgColor;return`
|
|
68
|
+
${Z}
|
|
69
|
+
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
|
70
|
+
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
|
71
|
+
<path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
|
|
72
|
+
</svg>`},headerIfThenElse:e=>`${Z}
|
|
73
|
+
<path fill="${e.fgColor}" d="M4 3h12v14H4z"/>
|
|
74
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${e.bgColor}"/>
|
|
75
|
+
</svg>`,headerSingleValue:e=>{let t=e.fgColor;return`
|
|
76
|
+
${Z}
|
|
77
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
78
|
+
<path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
|
|
79
|
+
</svg>`},headerLookup:e=>{let t=e.fgColor;return`
|
|
80
|
+
${Z}
|
|
81
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
82
|
+
<path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
|
|
83
|
+
</svg>`},headerTextTemplate:e=>{let t=e.fgColor;return`${Z}
|
|
84
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
85
|
+
<path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
|
|
86
|
+
</svg>`},headerMath:e=>{let t=e.fgColor;return`${Z}
|
|
87
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
88
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
|
|
89
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
|
|
90
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
|
|
91
|
+
<path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
|
|
92
|
+
</svg>`},headerRollup:e=>{let t=e.fgColor;return`
|
|
93
|
+
${Z}
|
|
94
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${e.bgColor}"/>
|
|
95
|
+
<path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
|
|
96
|
+
</svg>`},headerJoinStrings:e=>{let t=e.fgColor;return`${Z}
|
|
97
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
98
|
+
<path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
|
|
99
|
+
</svg>`},headerSplitString:e=>{let t=e.fgColor;return`
|
|
100
|
+
${Z}
|
|
101
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
102
|
+
<path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
|
|
103
|
+
</svg>`},headerGeoDistance:e=>{let t=e.fgColor;return`${Z}
|
|
104
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${e.bgColor}"/>
|
|
105
|
+
<path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
|
|
106
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
|
|
107
|
+
</svg>`},headerArray:e=>{let t=e.fgColor;return`${Z}
|
|
108
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${e.bgColor}"/>
|
|
109
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
|
|
110
|
+
</svg>`},rowOwnerOverlay:e=>{let t=e.fgColor;return`
|
|
111
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
112
|
+
<path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
|
113
|
+
</svg>`},protectedColumnOverlay:e=>{let t=e.fgColor;return`
|
|
114
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
115
|
+
<path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
|
116
|
+
</svg>
|
|
117
|
+
`},renameIcon:e=>{let t=e.bgColor;return`${Z}
|
|
118
|
+
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
|
119
|
+
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
|
120
|
+
<path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
|
|
121
|
+
</svg>
|
|
122
|
+
`}};function jr(e,t){return e===`normal`?[t.bgIconHeader,t.fgIconHeader]:e===`selected`?[`white`,t.accentColor]:[t.accentColor,t.bgHeader]}var Mr=class{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(e,t){this.onSettled=t,this.headerIcons=e??{}}drawSprite(e,t,n,r,i,a,o,s=1){let[c,l]=jr(t,o),u=a*Math.ceil(window.devicePixelRatio),d=`${c}_${l}_${u}_${e}`,f=this.spriteMap.get(d);if(f===void 0){let t=this.headerIcons[e];if(t===void 0)return;f=document.createElement(`canvas`);let n=f.getContext(`2d`);if(n===null)return;let r=new Image;r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t({fgColor:l,bgColor:c}))}`,this.spriteMap.set(d,f);let i=r.decode();if(i===void 0)return;this.inFlight++,i.then(()=>{n.drawImage(r,0,0,u,u)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(n.globalAlpha=s),n.drawImage(f,0,0,u,u,r,i,a,a),s<1&&(n.globalAlpha=1)}};function Nr(e){if(e.length===0)return;let t;for(let n of e)t=Math.min(t??n.y,n.y)}function Pr(e,t,n,r,i,a,o,s,c){s??=t;let l=t,u=e,d=r-a,f=!1;for(;l<n&&u<d;){let e=i(u);if(l+e>s&&c(l,u,e,!1,o&&u===r-1)===!0){f=!0;break}l+=e,u++}if(!f){l=n;for(let e=0;e<a;e++){u=r-1-e;let t=i(u);l-=t,c(l,u,t,!0,o&&u===r-1)}}}function Fr(e,t,n,r,i,a){let o=0,s=0,c=i+r;for(let r of e){if(a(r,r.sticky?s:o+n,c,r.sticky?0:s,t)===!0)break;o+=r.width,s+=r.sticky?r.width:0}}function Ir(e,t,n,r,i){let a=0,o=0;for(let s=0;s<e.length;s++){let c=e[s],l=s+1,u=c.width;for(c.sticky&&(o+=u);l<e.length&&an(e[l].group,c.group)&&e[l].sticky===e[s].sticky;){let t=e[l];u+=t.width,l++,s++,t.sticky&&(o+=t.width)}let d=c.sticky?0:n,f=a+d,p=c.sticky?0:Math.max(0,o-f),m=Math.min(u-p,t-(f+p));i([c.sourceIndex,e[l-1].sourceIndex],c.group??``,f+p,0,m,r),a+=u}}function Lr(e,t,n,r,i,a,o){let[s,c]=e,l,u,d=o.find(e=>!e.sticky)?.sourceIndex??0;if(c>d){let e=Math.max(s,d),l=t,f=r;for(let t=a.sourceIndex-1;t>=e;t--)l-=o[t].width,f+=o[t].width;for(let e=a.sourceIndex+1;e<=c;e++)f+=o[e].width;u={x:l,y:n,width:f,height:i}}if(d>s){let e=Math.min(c,d-1),u=t,f=r;for(let e=a.sourceIndex-1;e>=s;e--)u-=o[e].width,f+=o[e].width;for(let t=a.sourceIndex+1;t<=e;t++)f+=o[t].width;l={x:u,y:n,width:f,height:i}}return[l,u]}function Rr(e,t,n,r){if(r===`any`)return Vr(e,{x:t,y:n,width:1,height:1});if(r===`vertical`&&(t=e.x),r===`horizontal`&&(n=e.y),sn([t,n],e))return;let i=t-e.x,a=e.x+e.width-t,o=n-e.y+1,s=e.y+e.height-n,c=Math.min(r===`vertical`?2**53-1:i,r===`vertical`?2**53-1:a,r===`horizontal`?2**53-1:o,r===`horizontal`?2**53-1:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===o?{x:e.x,y:n,width:e.width,height:e.y-n}:c===a?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function zr(e,t,n,r,i,a,o,s){return e<=i+o&&i<=e+n&&t<=a+s&&a<=t+r}function Br(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Vr(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Hr(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Ur(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;let i=t+4,a=n+4,o=-4-e.x,s=e.x+e.width-i,c=-4-e.y,l=e.y+e.height-a,u=o>0?e.x+Math.floor(o/r)*r:e.x,d=s>0?e.x+e.width-Math.floor(s/r)*r:e.x+e.width,f=c>0?e.y+Math.floor(c/r)*r:e.y,p=l>0?e.y+e.height-Math.floor(l/r)*r:e.y+e.height;return{x:u,y:f,width:d-u,height:p-f}}function Wr(e,t,n,r,i){let[a,o,s,c]=t,[l,u,d,f]=i,{x:p,y:m,width:h,height:g}=e,_=[];if(h<=0||g<=0)return _;let v=p+h,y=m+g,b=p<a,x=m<o,S=p+h>s,C=m+g>c,w=p>=a&&p<s||v>a&&v<=s||p<a&&v>s,T=m>=o&&m<c||y>o&&y<=c||m<o&&y>c;if(w&&T){let e=Math.max(p,a),t=Math.max(m,o),n=Math.min(v,s),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:u,width:d-l+1,height:f-u+1}})}if(b&&x){let e=p,t=m,n=Math.min(v,a),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:0,width:l+1,height:u+1}})}if(x&&w){let e=Math.max(p,a),t=m,n=Math.min(v,s),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:0,width:d-l+1,height:u+1}})}if(x&&S){let e=Math.max(p,s),t=m,r=v,i=Math.min(y,o);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:0,width:n-d+1,height:u+1}})}if(b&&T){let e=p,t=Math.max(m,o),n=Math.min(v,a),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:u,width:l+1,height:f-u+1}})}if(S&&T){let e=Math.max(p,s),t=Math.max(m,o),r=v,i=Math.min(y,c);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:u,width:n-d+1,height:f-u+1}})}if(b&&C){let e=p,t=Math.max(m,c),n=Math.min(v,a),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:0,y:f,width:l+1,height:r-f+1}})}if(C&&w){let e=Math.max(p,a),t=Math.max(m,c),n=Math.min(v,s),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:l,y:f,width:d-l+1,height:r-f+1}})}if(S&&C){let e=Math.max(p,s),t=Math.max(m,c),i=v,a=y;_.push({rect:{x:e,y:t,width:i-e,height:a-t},clip:{x:d,y:f,width:n-d+1,height:r-f+1}})}return _}var Gr={kind:B.Loading,allowOverlay:!1};function Kr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,ee,te,A,ne,j){let re=y?.size??2**53-1,ae=performance.now(),M=k.baseFontFull;e.font=M;let oe={ctx:e},N=[0,0],P=g>0?pn(c,g,l):0,se,ce,le=Nr(v);return Fr(t,s,a,o,i,(t,a,o,s,F)=>{let I=Math.max(0,s-a),de=a+I,fe=i+1,pe=t.width-I,me=r-i-1;if(v.length>0){let e=!1;for(let t=0;t<v.length;t++){let n=v[t];if(zr(de,fe,pe,me,n.x,n.y,n.width,n.height)){e=!0;break}}if(!e)return}let he=()=>{e.save(),e.beginPath(),e.rect(de,fe,pe,me),e.clip()},ge=b.columns.hasIndex(t.sourceIndex),_e=d(t.group??``).overrideTheme,ve=t.themeOverride===void 0&&_e===void 0?k:ue(k,_e,t.themeOverride),L=ve.baseFontFull;L!==M&&(M=L,e.font=L),he();let ye;return Pr(F,o,r,c,l,g,_,le,(i,o,l,d,g)=>{if(o<0||(N[0]=t.sourceIndex,N[1]=o,y!==void 0&&!y.has(N)))return;if(v.length>0){let e=!1;for(let n=0;n<v.length;n++){let r=v[n];if(zr(a,i,t.width,l,r.x,r.y,r.width,r.height)){e=!0;break}}if(!e)return}let _=b.rows.hasIndex(o),le=p.hasIndex(o),F=o<c?u(N):Gr,I=a,de=t.width,fe=!1,pe=!1;if(F.span!==void 0){let[r,c]=F.span,u=`${o},${r},${c},${t.sticky}`;if(ce===void 0&&(ce=new Set),ce.has(u)){re--;return}else{let r=Lr(F.span,a,i,t.width,l,t,n),o=t.sticky?r[0]:r[1];if(!t.sticky&&r[0]!==void 0&&(pe=!0),o!==void 0){I=o.x,de=o.width,ce.add(u),e.restore(),ye=void 0,e.save(),e.beginPath();let t=Math.max(0,s-o.x);e.rect(o.x+t,i,o.width-t,l),se===void 0&&(se=[]),se.push({x:o.x+t,y:i,width:o.width-t,height:l}),e.clip(),fe=!0}}}let me=f?.(o),_e=g&&t.trailingRowOptions?.themeOverride!==void 0?t.trailingRowOptions?.themeOverride:void 0,R=F.themeOverride===void 0&&me===void 0&&_e===void 0?ve:ue(ve,me,_e,F.themeOverride);e.beginPath();let be=on(N,F,b),z=dn(N,F,b,h),xe=F.span!==void 0&&b.columns.some(e=>F.span!==void 0&&e>=F.span[0]&&e<=F.span[1]);be&&!m&&h?z=0:be&&h&&(z=Math.max(z,1)),xe&&z++,be||(_&&z++,ge&&!g&&z++);let Se=F.kind===B.Protected?R.bgCellMedium:R.bgCell,V;if((d||Se!==k.bgCell)&&(V=ie(Se,V)),z>0||le){le&&(V=ie(R.bgHeader,V));for(let e=0;e<z;e++)V=ie(R.accentLight,V)}else if(x!==void 0){for(let e of x)if(e[0]===t.sourceIndex&&e[1]===o){V=ie(R.bgSearchResult,V);break}}if(S!==void 0)for(let e=0;e<S.length;e++){let n=S[e],r=n.range;n.style!==`solid-outline`&&r.x<=t.sourceIndex&&t.sourceIndex<r.x+r.width&&r.y<=o&&o<r.y+r.height&&(V=ie(n.color,V))}let Ce=!1;if(y!==void 0){let t=i+1,n=(d?t+l-1:Math.min(t+l-1,r-P))-t;(n!==l-1||I+1<=s)&&(Ce=!0,e.save(),e.beginPath(),e.rect(I+1,t,de-1,n),e.clip()),V=V===void 0?R.bgCell:ie(V,R.bgCell)}let we=t.sourceIndex===n.length-1,H=o===c-1;V!==void 0&&(e.fillStyle=V,ye!==void 0&&(ye.fillStyle=V),y===void 0?e.fillRect(I,i,de,l):e.fillRect(I+1,i+1,de-(we?2:1),l-(H?2:1))),F.style===`faded`&&(e.globalAlpha=.6);let Te;for(let e=0;e<T.length;e++){let n=T[e];if(n.item[0]===t.sourceIndex&&n.item[1]===o){Te=n;break}}if(de>j&&!pe){let n=R.baseFontFull;n!==M&&(e.font=n,M=n),ye=Qr(e,F,t.sourceIndex,o,we,H,I,i,de,l,z>0,R,V??R.bgCell,C,w,Te?.hoverAmount??0,E,O,ae,D,ye,ee,te,A,ne)}return Ce&&e.restore(),F.style===`faded`&&(e.globalAlpha=1),re--,fe&&(e.restore(),ye?.deprep?.(oe),ye=void 0,he(),M=L,e.font=L),re<=0}),e.restore(),re<=0}),se}var qr=[0,0],Jr={x:0,y:0,width:0,height:0},Yr=[void 0,()=>void 0],Xr=!1;function Zr(){Xr=!0}function Qr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w){let T,E;g!==void 0&&g[0][0]===n&&g[0][1]===r&&(T=g[1][0],E=g[1][1]);let D;qr[0]=n,qr[1]=r,Jr.x=o,Jr.y=s,Jr.width=c,Jr.height=l,Yr[0]=S.getValue(qr),Yr[1]=e=>S.setValue(qr,e),Xr=!1;let O={ctx:e,theme:d,col:n,row:r,cell:t,rect:Jr,highlighted:u,cellFillColor:f,hoverAmount:h,frameTime:v,hoverX:T,drawState:Yr,hoverY:E,imageLoader:p,spriteManager:m,hyperWrapping:_,overrideCursor:T===void 0?void 0:w,requestAnimationFrame:Zr},k=On(O,t.lastUpdated,v,b,i,a),ee=C(t);if(ee!==void 0){b?.renderer!==ee&&(b?.deprep?.(O),b=void 0);let e=ee.drawPrep?.(O,b);y!==void 0&&!we(O.cell)?y(O,()=>ee.draw(O,t)):ee.draw(O,t),D=e===void 0?void 0:{deprep:e?.deprep,fillStyle:e?.fillStyle,font:e?.font,renderer:ee}}return(k||Xr)&&x?.(qr),D}function $r(e,t,n,r,i,a,o,s,c=-20,l=-20,u=32,d=`center`,f=`square`){let p=Math.floor(i+o/2),m=f===`circle`?1e4:t.roundingRadius??4,h=Et(u,o,t.cellVerticalPadding),g=h/2,_=Tt(d,r,a,t.cellHorizontalPadding,h),v=wt(_,p,h),y=Dt(r+c,i+l,v);switch(n){case!0:e.beginPath(),Fn(e,_-h/2,p-h/2,h,h,m),f===`circle`&&(g*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(_-g+h/4.23,p-g+h/1.97),e.lineTo(_-g+h/2.42,p-g+h/1.44),e.lineTo(_-g+h/1.29,p-g+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin=`round`,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;case null:case!1:e.beginPath(),Fn(e,_-h/2+.5,p-h/2+.5,h-1,h-1,m),e.lineWidth=1,e.strokeStyle=y?t.textDark:t.textMedium,e.stroke();break;case void 0:e.beginPath(),Fn(e,_-h/2,p-h/2,h,h,m),e.fillStyle=y?t.textMedium:t.textLight,e.fill(),f===`circle`&&(g*=.8,h*=.8),e.beginPath(),e.moveTo(_-h/3,p),e.lineTo(_+h/3,p),e.strokeStyle=t.bgCell,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;default:j(n)}}function ei(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=o+s;if(y<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,y);let[b,x]=r?.[0]??[];e.font=d.headerFontFull,Fr(t,0,a,0,y,(t,r,i,a)=>{if(g!==void 0&&!g.has([t.sourceIndex,-1]))return;let m=Math.max(0,a-r);e.save(),e.beginPath(),e.rect(r+m,s,t.width-m,o),e.clip();let y=h(t.group??``).overrideTheme,S=t.themeOverride===void 0&&y===void 0?d:ue(d,y,t.themeOverride);S.bgHeader!==d.bgHeader&&(e.fillStyle=S.bgHeader,e.fill()),S!==d&&(e.font=S.baseFontFull);let C=u.columns.hasIndex(t.sourceIndex),w=c!==void 0||l,T=!w&&x===-1&&b===t.sourceIndex,E=w?0:p.find(e=>e.item[0]===t.sourceIndex&&e.item[1]===-1)?.hoverAmount??0,D=u?.current!==void 0&&u.current.cell[0]===t.sourceIndex,O=C?S.accentColor:D?S.bgHeaderHasFocus:S.bgHeader,k=n?s:0,ee=t.sourceIndex===0?0:1;C?(e.fillStyle=O,e.fillRect(r+ee,k,t.width-ee,o)):(D||E>0)&&(e.beginPath(),e.rect(r+ee,k,t.width-ee,o),D&&(e.fillStyle=S.bgHeaderHasFocus,e.fill()),E>0&&(e.globalAlpha=E,e.fillStyle=S.bgHeaderHovered,e.fill(),e.globalAlpha=1)),oi(e,r,k,t.width,o,t,C,S,T,D,E,f,_,v),e.restore()}),n&&ti(e,t,i,a,s,r,d,f,p,m,h,g)}function ti(e,t,n,r,i,a,o,s,c,l,u,d){let[f,p]=a?.[0]??[],m=0;Ir(t,n,r,i,(t,n,r,c,h,g)=>{if(d!==void 0&&!d.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(r,c,h,g),e.clip();let _=u(n),v=_?.overrideTheme===void 0?o:ue(o,_.overrideTheme),y=p===-2&&f!==void 0&&f>=t[0]&&f<=t[1],b=y?v.bgHeaderHovered:v.bgHeader;if(b!==o.bgHeader&&(e.fillStyle=b,e.fill()),e.fillStyle=v.textGroupHeader??v.textHeader,_!==void 0){let t=r;if(_.icon!==void 0&&(s.drawSprite(_.icon,`normal`,e,t+8,(i-20)/2,20,v),t+=26),e.fillText(_.name,t+8,i/2+wn(e,o.headerFontFull)),_.actions!==void 0&&y){let t=ii({x:r,y:c,width:h,height:g},_.actions);e.beginPath();let n=t[0].x-10,o=r+h-n;e.rect(n,0,o,i);let l=e.createLinearGradient(n,0,n+o,0),u=de(b,0);l.addColorStop(0,u),l.addColorStop(10/o,b),l.addColorStop(1,b),e.fillStyle=l,e.fill(),e.globalAlpha=.6;let[d,f]=a?.[1]??[-1,-1];for(let n=0;n<_.actions.length;n++){let i=_.actions[n],a=t[n],o=Br(a,d+r,f);o&&(e.globalAlpha=1),s.drawSprite(i.icon,`normal`,e,a.x+a.width/2-10,a.y+a.height/2-10,20,v),o&&(e.globalAlpha=.6)}e.globalAlpha=1}}r!==0&&l(t[0])&&(e.beginPath(),e.moveTo(r+.5,0),e.lineTo(r+.5,i),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=r+h}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()}var ni=30;function ri(e,t,n,r,i){return i?{x:e,y:t,width:ni,height:Math.min(ni,r)}:{x:e+n-ni,y:Math.max(t,t+r/2-ni/2),width:ni,height:Math.min(ni,r)}}function ii(e,t){let n=[],r=e.x+e.width-26*t.length,i=e.y+e.height/2-13;for(let e=0;e<t.length;e++)n.push({x:r,y:i,width:26,height:26}),r+=26;return n}function ai(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(a.rowMarker!==void 0){let o=a.rowMarkerChecked;o!==!0&&(e.globalAlpha=l),$r(e,s,o,t,n,r,i,!1,void 0,void 0,18,`center`,a.rowMarker),o!==!0&&(e.globalAlpha=1);return}let m=s.cellHorizontalPadding,h=o?s.textHeaderSelected:s.textHeader,g=a.hasMenu===!0&&(c||d&&o),_=f?-1:1,v=f?t+r-m:t+m;if(a.icon!==void 0){let t=o?`selected`:`normal`;a.style===`highlight`&&(t=o?`selected`:`special`);let r=s.headerIconSize;u.drawSprite(a.icon,t,e,f?v-r:v,n+(i-r)/2,r,s),a.overlayIcon!==void 0&&u.drawSprite(a.overlayIcon,o?`selected`:`special`,e,f?v-r+9:v+9,n+((i-18)/2+6),18,s),v+=Math.ceil(r*1.3)*_}if(g&&a.hasMenu===!0&&r>35){let n=f?35:r-35,i=f?35*.7:r-35*.7,a=n/r,o=i/r,s=e.createLinearGradient(t,0,t+r,0),c=de(h,0);s.addColorStop(f?1:0,h),s.addColorStop(a,h),s.addColorStop(o,c),s.addColorStop(f?0:1,c),e.fillStyle=s}else e.fillStyle=h;if(f&&(e.textAlign=`right`),e.fillText(a.title,v,n+i/2+wn(e,s.headerFontFull)),f&&(e.textAlign=`left`),g&&a.hasMenu===!0)if(a.menuIcon===void 0||a.menuIcon===Ce.Triangle){e.beginPath();let t=p.x+p.width/2-5.5,n=p.y+p.height/2-3;Ln(e,[{x:t,y:n},{x:t+11,y:n},{x:t+5.5,y:n+6}],1),e.fillStyle=h,e.fill()}else if(a.menuIcon===Ce.Dots)e.beginPath(),In(e,p.x+p.width/2,p.y+p.height/2),e.fillStyle=h,e.fill();else{let t=p.x+(p.width-s.headerIconSize)/2,n=p.y+(p.height-s.headerIconSize)/2;u.drawSprite(a.menuIcon,`normal`,e,t,n,s.headerIconSize,s)}}function oi(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=Mt(a.title)===`rtl`,h=ri(t,n,r,i,m);f===void 0?ai(e,t,n,r,i,a,o,s,c,u,d,p,m,h):f({ctx:e,theme:s,rect:{x:t,y:n,width:r,height:i},column:a,columnIndex:a.sourceIndex,isSelected:o,hoverAmount:u,isHovered:c,hasSelectedCell:l,spriteManager:d,menuBounds:h},()=>ai(e,t,n,r,i,a,o,s,c,u,d,p,m,h))}var si=t(((e,t)=>{var n=le();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),ci=t(((e,t)=>{var n=si();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),li=t(((e,t)=>{function n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}t.exports=n})),ui=t(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),di=t(((e,t)=>{t.exports=ui()()})),fi=t(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),pi=t(((e,t)=>{function n(){return!1}t.exports=n})),mi=t(((e,t)=>{var n=R(),r=pi(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),hi=t(((e,t)=>{var n=be(),r=xe(),i=P(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=ee})),gi=t(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),_i=t(((e,t)=>{var n=oe(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),vi=t(((e,t)=>{var n=hi(),r=gi(),i=_i(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),yi=t(((e,t)=>{var n=fi(),r=ve(),i=N(),a=mi(),o=L(),s=vi(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),bi=t(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),xi=t(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Si=t(((e,t)=>{t.exports=xi()(Object.keys,Object)})),Ci=t(((e,t)=>{var n=bi(),r=Si(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),wi=t(((e,t)=>{var n=yi(),r=Ci(),i=yr();function a(e){return i(e)?n(e):r(e)}t.exports=a})),Ti=t(((e,t)=>{var n=di(),r=wi();function i(e,t){return e&&n(e,t,r)}t.exports=i})),Ei=t(((e,t)=>{var n=yr();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),Di=t(((e,t)=>{var n=Ti();t.exports=Ei()(n)})),Oi=t(((e,t)=>{var n=Di();function r(e,t,r,i){return n(e,function(e,n,a){t(i,e,r(e),a)}),i}t.exports=r})),ki=t(((e,t)=>{var n=me();function r(){this.__data__=new n,this.size=0}t.exports=r})),Ai=t(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),ji=t(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),Mi=t(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Ni=t(((e,t)=>{var n=me(),r=Oe(),i=Ee(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),Pi=t(((e,t)=>{var n=me(),r=ki(),i=Ai(),a=ji(),o=Mi(),s=Ni();function c(e){this.size=(this.__data__=new n(e)).size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Fi=t(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),Ii=t(((e,t)=>{var n=er(),r=Fi(),i=sr(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),Li=t(((e,t)=>{t.exports=R().Uint8Array})),Ri=t(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),zi=t(((e,t)=>{var n=k(),r=Li(),i=U(),a=Ii(),o=Ri(),s=ur(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),Bi=t(((e,t)=>{var n=mr(),r=N();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Vi=t(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),Hi=t(((e,t)=>{function n(){return[]}t.exports=n})),Ui=t(((e,t)=>{var n=Vi(),r=Hi(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Wi=t(((e,t)=>{var n=Bi(),r=Ui(),i=wi();function a(e){return n(e,i,r)}t.exports=a})),Gi=t(((e,t)=>{var n=Wi(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),Ki=t(((e,t)=>{t.exports=le()(R(),`DataView`)})),qi=t(((e,t)=>{t.exports=le()(R(),`Promise`)})),Ji=t(((e,t)=>{t.exports=le()(R(),`WeakMap`)})),Yi=t(((e,t)=>{var n=Ki(),r=Oe(),i=qi(),a=cr(),o=Ji(),s=be(),c=te(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),Xi=t(((e,t)=>{var n=Pi(),r=Ii(),i=zi(),a=Gi(),o=Yi(),s=N(),c=mi(),l=vi(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),Zi=t(((e,t)=>{var n=Xi(),r=P();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Qi=t(((e,t)=>{var n=Pi(),r=Zi(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),$i=t(((e,t)=>{var n=F();function r(e){return e===e&&!n(e)}t.exports=r})),ea=t(((e,t)=>{var n=$i(),r=wi();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),ta=t(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),na=t(((e,t)=>{var n=Qi(),r=ea(),i=ta();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),ra=t(((e,t)=>{var n=fe(),r=V();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),ia=t(((e,t)=>{var n=ra();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),aa=t(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),oa=t(((e,t)=>{var n=aa(),r=_e();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),sa=t(((e,t)=>{var n=Zi(),r=ia(),i=oa(),a=ne(),o=$i(),s=ta(),c=V(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),ca=t(((e,t)=>{function n(e){return e}t.exports=n})),la=t(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),ua=t(((e,t)=>{var n=ra();function r(e){return function(t){return n(t,e)}}t.exports=r})),da=t(((e,t)=>{var n=la(),r=ua(),i=ne(),a=V();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),fa=t(((e,t)=>{var n=na(),r=sa(),i=ca(),a=N(),o=da();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),pa=t(((e,t)=>{var n=li(),r=Oi(),i=fa(),a=N();function o(e,t){return function(o,s){var c=a(o)?n:r,l=t?t():{};return c(o,e,i(s,2),l)}}t.exports=o})),ma=e(t(((e,t)=>{var n=ci(),r=pa(),i=Object.prototype.hasOwnProperty;t.exports=r(function(e,t,r){i.call(e,r)?e[r].push(t):n(e,r,[t])})}))(),1);function ha(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(_!==void 0||t[t.length-1]!==n[t.length-1])return;let y=Nr(g);Fr(t,c,o,s,a,(n,o,s,c,_)=>{if(n!==t[t.length-1])return;o+=n.width;let b=Math.max(o,c);b>r||(e.save(),e.beginPath(),e.rect(b,a+1,1e4,i-a-1),e.clip(),Pr(_,s,i,l,u,m,h,y,(t,n,r,i)=>{if(!i&&g.length>0&&!g.some(e=>zr(o,t,1e4,r,e.x,e.y,e.width,e.height)))return;let a=f.hasIndex(n),s=p.hasIndex(n);e.beginPath();let c=d?.(n),l=c===void 0?v:ue(v,c);l.bgCell!==v.bgCell&&(e.fillStyle=l.bgCell,e.fillRect(o,t,1e4,r)),s&&(e.fillStyle=l.bgHeader,e.fillRect(o,t,1e4,r)),a&&(e.fillStyle=l.accentLight,e.fillRect(o,t,1e4,r))}),e.restore())})}function ga(e,t,n,r,i,a,o,s,c){let l=!1;for(let e of t)if(!e.sticky){l=o(e.sourceIndex);break}let u=c.horizontalBorderColor??c.borderColor,d=c.borderColor,f=l?Y(t):0,p;if(f!==0&&(p=I(d,c.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,r),e.strokeStyle=p,e.stroke()),i>0){let t=d===u&&p!==void 0?p:I(u,c.bgCell),o=pn(a,i,s);e.beginPath(),e.moveTo(0,r-o+.5),e.lineTo(n,r-o+.5),e.strokeStyle=t,e.stroke()}}var _a=(e,t,n)=>{let r=0,i=t,a=0,o=n;if(e!==void 0&&e.length>0){r=2**53-1,a=2**53-1,i=-(2**53-1),o=-(2**53-1);for(let t of e)r=Math.min(r,t.x-1),i=Math.max(i,t.x+t.width+1),a=Math.min(a,t.y-1),o=Math.max(o,t.y+t.height+1)}return{minX:r,maxX:i,minY:a,maxY:o}};function va(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=m.bgCell,{minX:g,maxX:_,minY:v,maxY:y}=_a(s,a,o),b=[],x=o-pn(p,f,l),S=c,C=n,w=0;for(;S+i<x;){let e=S+i,t=l(C);if(e>=v&&e<=y-1){let n=u?.(C)?.bgCell;n!==void 0&&n!==h&&C>=p-f&&b.push({x:g,y:e,w:_-g,h:t,color:n})}S+=t,C<p-f&&(w=S),C++}let T=0,E=Math.min(x,y)-w;if(E>0)for(let e=0;e<t.length;e++){let n=t[e];if(n.width===0)continue;let i=n.sticky?T:T+r,a=n.themeOverride?.bgCell;a!==void 0&&a!==h&&i>=g&&i<=_&&d(e+1)&&b.push({x:i,y:w,w:n.width,h:E,color:a}),T+=n.width}if(b.length===0)return;let D;e.beginPath();for(let t=b.length-1;t>=0;t--){let n=b[t];D===void 0?D=n.color:n.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=n.color),e.rect(n.x,n.y,n.w,n.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ya(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,a,o);for(let t of c)e.rect(t.x+1,t.y+1,t.width-1,t.height-1);e.clip(`evenodd`)}let v=g.horizontalBorderColor??g.borderColor,y=g.borderColor,{minX:b,maxX:x,minY:S,maxY:C}=_a(s,a,o),w=[];e.beginPath();let T=.5;for(let e=0;e<t.length;e++){let n=t[e];if(n.width===0)continue;T+=n.width;let i=n.sticky?T:T+r;i>=b&&i<=x&&p(e+1)&&w.push({x1:i,y1:Math.max(l,S),x2:i,y2:Math.min(o,C),color:y})}let E=o+.5;for(let e=h-m;e<h;e++){let t=d(e);E-=t,w.push({x1:b,y1:E,x2:x,y2:E,color:v})}if(_!==!0){let e=u+.5,t=n,r=E;for(;e+i<r;){let n=e+i;if(n>=S&&n<=C-1){let e=f?.(t);w.push({x1:b,y1:n,x2:x,y2:n,color:e?.horizontalBorderColor??e?.borderColor??v})}e+=d(t),t++}}let D=(0,ma.default)(w,e=>e.color);for(let t of Object.keys(D)){e.strokeStyle=t;for(let n of D[t])e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}function ba(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=[];e.imageSmoothingEnabled=!1;let b=Math.min(i.cellYOffset,o),x=Math.max(i.cellYOffset,o),S=0;if(typeof _==`number`)S+=(x-b)*_;else for(let e=b;e<x;e++)S+=_(e);o>i.cellYOffset&&(S=-S),S+=c-i.translateY;let C=Math.min(i.cellXOffset,a),w=Math.max(i.cellXOffset,a),T=0;for(let e=C;e<w;e++)T+=h[e].width;a>i.cellXOffset&&(T=-T),T+=s-i.translateX;let E=Y(g);if(T!==0&&S!==0)return{regions:[]};let D=l>0?pn(f,l,_):0,O=u-E-Math.abs(T),k=d-p-D-Math.abs(S)-1;if(O>150&&k>150){let i={sx:0,sy:0,sw:u*m,sh:d*m,dx:0,dy:0,dw:u*m,dh:d*m};if(S>0?(i.sy=(p+1)*m,i.sh=k*m,i.dy=(S+p+1)*m,i.dh=k*m,y.push({x:0,y:p,width:u,height:S+1})):S<0&&(i.sy=(-S+p+1)*m,i.sh=k*m,i.dy=(p+1)*m,i.dh=k*m,y.push({x:0,y:d+S-D,width:u,height:-S+D})),T>0?(i.sx=E*m,i.sw=O*m,i.dx=(T+E)*m,i.dw=O*m,y.push({x:E-1,y:0,width:T+2,height:d})):T<0&&(i.sx=(E-T)*m,i.sw=O*m,i.dx=E*m,i.dw=O*m,y.push({x:u+T,y:0,width:-T,height:d})),e.setTransform(1,0,0,1,0,0),v){if(E>0&&T!==0&&S===0&&(r===void 0||n?.[1]!==!1)){let n=E*m,r=d*m;e.drawImage(t,0,0,n,r,0,0,n,r)}if(D>0&&T===0&&S!==0&&(r===void 0||n?.[0]!==!1)){let n=(d-D)*m,r=u*m,i=D*m;e.drawImage(t,0,n,r,i,0,n,r,i)}}e.drawImage(t,i.sx,i.sy,i.sw,i.sh,i.dx,i.dy,i.dw,i.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:y}}function xa(e,t,n,r,i,a,o,s,c,l){let u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Fr(c,n,r,i,s,(e,t,n,r)=>{if(e.sourceIndex===l){let e=Math.max(t,r)+1;return u.push({x:e,y:0,width:a-e,height:o}),!0}}),u}function Sa(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){let i=e.mappedColumns[r],a=t.mappedColumns[r];if(ae(i,a))continue;if(n!==void 0||i.width===a.width)return!1;let{width:o,...s}=i,{width:c,...l}=a;if(!ae(s,l))return!1;n=r}return n===void 0?!0:n}return!0}function Ca(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=m?.filter(e=>e.style!==`no-outline`);if(g===void 0||g.length===0)return;let _=Y(s),v=pn(p,f,d),y=[c,0,s.length,p-f],b=[_,0,t,n-v],x=g.map(e=>{let m=e.range,h=e.style??`dashed`;return Wr(m,y,t,n,b).map(m=>{let g=m.rect,_=Rn(g.x,g.y,t,n,u,l+u,r,i,a,o,p,c,f,s,d),v=g.width===1&&g.height===1?_:Rn(g.x+g.width-1,g.y+g.height-1,t,n,u,l+u,r,i,a,o,p,c,f,s,d);return g.x+g.width>=s.length&&--v.width,g.y+g.height>=p&&--v.height,{color:e.color,style:h,clip:m.clip,rect:Ur({x:_.x,y:_.y,width:v.x+v.width-_.x,height:v.y+v.height-_.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let r=!1;for(let i of x)for(let a of i)if(a?.rect!==void 0&&zr(0,0,t,n,a.rect.x,a.rect.y,a.rect.width,a.rect.height)){let t=r,n=!Hr(a.clip,a.rect);n&&(e.save(),e.rect(a.clip.x,a.clip.y,a.clip.width,a.clip.height),e.clip()),a.style===`dashed`&&!r?(e.setLineDash([5,3]),r=!0):(a.style===`solid`||a.style===`solid-outline`)&&r&&(e.setLineDash([]),r=!1),e.strokeStyle=a.style===`solid-outline`?ie(ie(a.color,h.borderColor),h.bgCell):de(a.color,1),e.strokeRect(a.rect.x+.5,a.rect.y+.5,a.rect.width-1,a.rect.height-1),n&&(e.restore(),r=t)}r&&e.setLineDash([])};return S(),S}function wa(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function Ta(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){if(u.current===void 0)return;let _=u.current.range,v=u.current.cell,y=[_.x+_.width-1,_.y+_.height-1];if(v[1]>=g&&y[1]>=g||!o.some(e=>e.sourceIndex===v[0]||e.sourceIndex===y[0]))return;let[b,x]=u.current.cell,S=f(u.current.cell),C=S.span??[b,b],w=x>=g-p,T=p>0&&!w?pn(g,p,d)-1:0,E=y[1],D;if(Fr(o,r,i,a,l,(r,i,a,o,l)=>{if(r.sticky&&b>r.sourceIndex)return;let u=r.sourceIndex<C[0],f=r.sourceIndex>C[1],_=r.sourceIndex===y[0];if(!(!_&&(u||f)))return Pr(l,a,n,g,d,p,m,void 0,(a,l,u)=>{if(l!==x&&l!==E)return;let d=i,f=r.width;if(S.span!==void 0){let e=Lr(S.span,i,a,r.width,u,r,s),t=r.sticky?e[0]:e[1];t!==void 0&&(d=t.x,f=t.width)}return l===E&&_&&h&&(D=()=>{o>d&&!r.sticky&&(e.beginPath(),e.rect(o,0,t-o,n),e.clip()),e.beginPath(),e.rect(d+f-4,a+u-4,4,4),e.fillStyle=r.themeOverride?.accentColor??c.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;let O=()=>{e.save(),e.beginPath(),e.rect(0,l,t,n-l-T),e.clip(),D?.(),e.restore()};return O(),O}function Ea(e,t,n,r,i,a,o,s,c){c===void 0||c.size===0||(e.beginPath(),Ir(t,n,a,r,(t,n,r,i,a,o)=>{c.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1})&&e.rect(r,i,a,o)}),Fr(t,s,a,o,i,(t,n,a,o)=>{let s=Math.max(0,o-n),l=n+s+1,u=t.width-s-1;c.has([t.sourceIndex,-1])&&e.rect(l,r,u,i-r)}),e.clip())}function Da(e,t,n,r,i,a,o,s,c,l){let u=0;return Fr(e,a,r,i,n,(e,n,r,i,a)=>(Pr(a,r,t,o,s,c,l,void 0,(e,t,n,r)=>{r||(u=Math.max(t,u))}),!0)),u}function Oa(e,t){let{canvasCtx:n,headerCanvasCtx:r,width:i,height:a,cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mappedColumns:u,enableGroups:d,freezeColumns:f,dragAndDropState:p,theme:m,drawFocus:h,headerHeight:g,groupHeaderHeight:_,disabledRows:v,rowHeight:y,verticalBorder:b,overrideCursor:x,isResizing:S,selection:C,fillHandle:w,freezeTrailingRows:T,rows:E,getCellContent:D,getGroupDetails:O,getRowThemeOverride:k,isFocused:ee,drawHeaderCallback:te,prelightCells:A,drawCellCallback:ne,highlightRegions:j,resizeCol:re,imageLoader:ae,lastBlitData:M,hoverValues:oe,hyperWrapping:N,hoverInfo:P,spriteManager:ce,maxScaleFactor:le,hasAppendRow:F,touchMode:I,enqueue:ue,renderStateProvider:de,getCellRenderer:fe,renderStrategy:pe,bufferACtx:me,bufferBCtx:he,damage:ge,minimumCellWidth:_e}=e;if(i===0||a===0)return;let ve=pe===`double-buffer`,L=Math.min(le,Math.ceil(window.devicePixelRatio??1)),ye=pe!==`direct`&&Sa(e,t),R=n.canvas;(R.width!==i*L||R.height!==a*L)&&(R.width=i*L,R.height=a*L,R.style.width=i+`px`,R.style.height=a+`px`);let be=r.canvas,z=d?_+g:g,xe=z+1;(be.width!==i*L||be.height!==xe*L)&&(be.width=i*L,be.height=xe*L,be.style.width=i+`px`,be.style.height=xe+`px`);let B=me.canvas,Se=he.canvas;ve&&(B.width!==i*L||B.height!==a*L)&&(B.width=i*L,B.height=a*L,M.current!==void 0&&(M.current.aBufferScroll=void 0)),ve&&(Se.width!==i*L||Se.height!==a*L)&&(Se.width=i*L,Se.height=a*L,M.current!==void 0&&(M.current.bBufferScroll=void 0));let V=M.current;if(ye===!0&&o===V?.cellXOffset&&s===V?.cellYOffset&&c===V?.translateX&&l===V?.translateY)return;let Ce=null;ve&&(Ce=n);let we=r,H;H=ve?ge===void 0?V?.lastBuffer===`b`?me:he:V?.lastBuffer===`b`?he:me:n;let Te=H.canvas,Ee=ve?Te===B?Se:B:R,De=typeof y==`number`?()=>y:y;we.save(),H.save(),we.beginPath(),H.beginPath(),we.textBaseline=`middle`,H.textBaseline=`middle`,L!==1&&(we.scale(L,L),H.scale(L,L));let U=mn(u,o,i,p,c),Oe=[],ke=h&&C.current?.cell[1]===s&&l===0,W=!1;if(j!==void 0){for(let e of j)if(e.style!==`no-outline`&&e.range.y===s&&l===0){W=!0;break}}let Ae=()=>{ei(we,U,d,P,i,c,g,_,p,S,C,m,ce,oe,b,O,ge,te,I),ya(we,U,s,c,l,i,a,void 0,void 0,_,z,De,k,b,T,E,m,!0),we.beginPath(),we.moveTo(0,xe-.5),we.lineTo(i,xe-.5),we.strokeStyle=ie(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),we.stroke(),W&&Ca(we,i,a,o,s,c,l,u,f,g,_,y,T,E,j,m),ke&&Ta(we,i,a,s,c,l,U,u,m,z,C,De,D,T,F,w,E)};if(ge!==void 0){let e=U[U.length-1].sourceIndex+1,t=ge.hasItemInRegion([{x:o,y:-2,width:e,height:2},{x:o,y:s,width:e,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:o,y:E-T,width:e,height:T,when:T>0}]),n=e=>{Kr(e,U,u,a,z,c,l,s,E,De,D,O,k,v,ee,h,T,F,Oe,ge,C,A,j,ae,ce,oe,P,ne,N,m,ue,de,fe,x,_e);let t=C.current;w&&h&&t!==void 0&&ge.has(ln(t.range))&&Ta(e,i,a,s,c,l,U,u,m,z,C,De,D,T,F,w,E)};t&&(n(H),Ce!==null&&(Ce.save(),Ce.scale(L,L),Ce.textBaseline=`middle`,n(Ce),Ce.restore()),ge.hasHeader()&&(Ea(we,U,i,_,z,c,l,s,ge),Ae())),H.restore(),we.restore();return}if((ye!==!0||o!==V?.cellXOffset||c!==V?.translateX||ke!==V?.mustDrawFocusOnHeader||W!==V?.mustDrawHighlightRingsOnHeader)&&Ae(),ye===!0){se(Ee!==void 0&&V!==void 0);let{regions:e}=ba(H,Ee,Ee===B?V.aBufferScroll:V.bBufferScroll,Ee===B?V.bBufferScroll:V.aBufferScroll,V,o,s,c,l,T,i,a,E,z,L,u,U,y,ve);Oe=e}else ye!==!1&&(se(V!==void 0),Oe=xa(V,o,s,c,l,i,a,z,U,ye));ga(H,U,i,a,T,E,b,De,m);let je=Ca(H,i,a,o,s,c,l,u,f,g,_,y,T,E,j,m),Me=h?Ta(H,i,a,s,c,l,U,u,m,z,C,De,D,T,F,w,E):void 0;if(H.fillStyle=m.bgCell,Oe.length>0){H.beginPath();for(let e of Oe)H.rect(e.x,e.y,e.width,e.height);H.clip(),H.fill(),H.beginPath()}else H.fillRect(0,0,i,a);let Ne=Kr(H,U,u,a,z,c,l,s,E,De,D,O,k,v,ee,h,T,F,Oe,ge,C,A,j,ae,ce,oe,P,ne,N,m,ue,de,fe,x,_e);ha(H,U,u,i,a,z,c,l,s,E,De,k,C.rows,v,T,F,Oe,ge,m),va(H,U,s,c,l,i,a,Oe,z,De,k,b,T,E,m),ya(H,U,s,c,l,i,a,Oe,Ne,_,z,De,k,b,T,E,m),je?.(),Me?.(),S&&Fr(U,0,c,0,z,(e,t)=>e.sourceIndex===re?(wa(we,t+e.width,0,z+1,ie(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),wa(H,t+e.width,z,a,ie(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Ce!==null&&(Ce.fillStyle=m.bgCell,Ce.fillRect(0,0,i,a),Ce.drawImage(H.canvas,0,0));let Pe=Da(U,a,z,c,l,s,E,De,T,F);ae?.setWindow({x:o,y:s,width:U.length,height:Pe-s},f,Array.from({length:T},(e,t)=>E-1-t));let Fe=V!==void 0&&(o!==V.cellXOffset||c!==V.translateX),Ie=V!==void 0&&(s!==V.cellYOffset||l!==V.translateY);M.current={cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mustDrawFocusOnHeader:ke,mustDrawHighlightRingsOnHeader:W,lastBuffer:ve?Te===B?`a`:`b`:void 0,aBufferScroll:Te===B?[Fe,Ie]:V?.aBufferScroll,bBufferScroll:Te===Se?[Fe,Ie]:V?.bBufferScroll},H.restore(),we.restore()}var ka=e(Zn(),1),Aa=80;function ja(e){let t=e-1;return t*t*t+1}var Ma=class{callback;constructor(e){this.callback=e}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=e=>{this.leavingItems.some(t=>cn(t.item,e.item))||this.leavingItems.push(e)};removeFromLeavingItems=e=>{let t=this.leavingItems.find(t=>cn(t.item,e));return this.leavingItems=this.leavingItems.filter(e=>e!==t),t?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(e=>e.hoverAmount>0)};shouldStep=()=>{let e=this.leavingItems.length>0,t=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return e||t};getAnimatingItems=()=>this.currentHoveredItem===void 0?this.leavingItems.map(e=>({...e,hoverAmount:ja(e.hoverAmount)})):[...this.leavingItems,this.currentHoveredItem];step=e=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=e;else{let t=(e-this.lastAnimationTime)/Aa;for(let e of this.leavingItems)e.hoverAmount=(0,ka.default)(e.hoverAmount-t,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,ka.default)(this.currentHoveredItem.hoverAmount+t,0,1));let n=this.getAnimatingItems();this.callback(n),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=e,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=e=>{cn(this.currentHoveredItem?.item,e)||(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),e===void 0?this.currentHoveredItem=void 0:this.currentHoveredItem={item:e,hoverAmount:this.removeFromLeavingItems(e)},this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step))}},Na=class{fn;val;constructor(e){this.fn=e}get value(){return this.val??=this.fn()}};function Pa(e){return new Na(e)}var Fa=Pa(()=>window.navigator.userAgent.includes(`Firefox`)),Ia=Pa(()=>window.navigator.userAgent.includes(`Mac OS`)&&window.navigator.userAgent.includes(`Safari`)&&!window.navigator.userAgent.includes(`Chrome`)),La=Pa(()=>window.navigator.platform.toLowerCase().startsWith(`mac`));function Ra(e){let t=G.useRef([]),n=G.useRef(0),r=G.useRef(e);r.current=e;let i=G.useCallback(()=>{let e=()=>window.requestAnimationFrame(i),i=()=>{let e=t.current.map(Hn);t.current=[],r.current(new Gn(e)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?e:i)},[]);return G.useCallback(e=>{t.current.length===0&&i();let n=X(e[0],e[1]);t.current.includes(n)||t.current.push(n)},[i])}var za=`header`,Ba=`group-header`,Va=`out-of-bounds`,Ha;(function(e){e[e.Start=-2]=`Start`,e[e.StartPadding=-1]=`StartPadding`,e[e.Center=0]=`Center`,e[e.EndPadding=1]=`EndPadding`,e[e.End=2]=`End`})(Ha||={});function Ua(e,t){return e===t?!0:e?.kind===`out-of-bounds`?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}var Wa=e(Cr(),1),Ga=6,Ka=(e,t)=>e.kind===B.Custom?e.copyData:(t?.(e))?.getAccessibilityString(e)??``,qa=G.memo(G.forwardRef((e,t)=>{let{width:n,height:r,accessibilityHeight:i,columns:a,cellXOffset:o,cellYOffset:s,headerHeight:c,fillHandle:l=!1,groupHeaderHeight:u,rowHeight:d,rows:f,getCellContent:p,getRowThemeOverride:m,onHeaderMenuClick:h,enableGroups:g,isFilling:_,onCanvasFocused:v,onCanvasBlur:y,isFocused:b,selection:x,freezeColumns:S,onContextMenu:C,freezeTrailingRows:w,fixedShadowX:T=!0,fixedShadowY:E=!0,drawFocusRing:D,onMouseDown:O,onMouseUp:k,onMouseMoveRaw:ee,onMouseMove:te,onItemHovered:A,dragAndDropState:ne,firstColAccessible:j,onKeyDown:re,onKeyUp:ie,highlightRegions:ae,canvasRef:M,onDragStart:oe,onDragEnd:N,eventTargetRef:P,isResizing:ce,resizeColumn:le,isDragging:F,isDraggable:I=!1,allowResize:ue,disabledRows:de,hasAppendRow:fe,getGroupDetails:me,theme:he,prelightCells:ge,headerIcons:_e,verticalBorder:ve,drawCell:L,drawHeader:R,onCellFocused:be,onDragOverCell:xe,onDrop:Se,onDragLeave:V,imageWindowLoader:Ce,smoothScrollX:Te=!1,smoothScrollY:Ee=!1,experimental:De,getCellRenderer:U}=e,Oe=e.translateX??0,ke=e.translateY??0,W=Math.max(S,Math.min(a.length-1,o)),Ae=G.useRef(null),je=Ce,Me=G.useRef(),[Ne,Pe]=G.useState(!1),Fe=G.useRef([]),Ie=G.useRef(),[Le,Re]=G.useState(),[ze,Be]=G.useState(),Ve=G.useRef(null),[He,Ue]=G.useState(),[We,Ge]=G.useState(!1),Ke=G.useRef(We);Ke.current=We;let qe=G.useMemo(()=>new Mr(_e,()=>{ct.current=void 0,ft.current()}),[_e]),Je=g?u+c:c,K=G.useRef(-1),Ye=(De?.enableFirefoxRescaling??!1)&&Fa.value,Xe=(De?.enableSafariRescaling??!1)&&Ia.value;G.useLayoutEffect(()=>{window.devicePixelRatio===1||!Ye&&!Xe||(K.current!==-1&&Pe(!0),window.clearTimeout(K.current),K.current=window.setTimeout(()=>{Pe(!1),K.current=-1},200))},[s,W,Oe,ke,Ye,Xe]);let Ze=nn(a,S),Qe=T?Y(Ze,ne):0,q=G.useCallback((e,t,i)=>{let a=e.getBoundingClientRect();if(t>=Ze.length||i>=f)return;let o=a.width/n,c=Rn(t,i,n,r,u,Je,W,s,Oe,ke,f,S,w,Ze,d);return o!==1&&(c.x*=o,c.y*=o,c.width*=o,c.height*=o),c.x+=a.x,c.y+=a.y,c},[n,r,u,Je,W,s,Oe,ke,f,S,w,Ze,d]),$e=G.useCallback((e,t,i,a)=>{let o=e.getBoundingClientRect(),p=o.width/n,m=(t-o.left)/p,h=(i-o.top)/p,_=mn(Ze,W,n,void 0,Oe),v=0,y=0;a instanceof MouseEvent&&(v=a.button,y=a.buttons);let b=hn(m,_,Oe),S=gn(h,r,g,c,u,f,d,s,ke,w),C=a?.shiftKey===!0,T=a?.ctrlKey===!0,E=a?.metaKey===!0,D=a!==void 0&&!(a instanceof MouseEvent)||a?.pointerType===`touch`,O=[m<0?-1:n<m?1:0,h<Je?-1:r<h?1:0],k;if(b===-1||h<0||m<0||S===void 0||m>n||h>r){let i=m>n?1:m<0?-1:0,a=h>r?1:h<0?-1:0,o=i*2,s=a*2;i===0&&(o=b===-1?Ha.EndPadding:Ha.Center),a===0&&(s=S===void 0?Ha.EndPadding:Ha.Center);let c=!1;if(b===-1&&S===-1){let n=q(e,Ze.length-1,-1);se(n!==void 0),c=t<n.x+n.width+5}let l=m>n&&m<n+Pt()||h>r&&h<r+Pt();k={kind:Va,location:[b===-1?m<0?0:Ze.length-1:b,S??f-1],region:[o,s],shiftKey:C,ctrlKey:T,metaKey:E,isEdge:c,isTouch:D,button:v,buttons:y,scrollEdge:O,isMaybeScrollbar:l}}else if(S<=-1){let n=q(e,b,S);se(n!==void 0);let r=n!==void 0&&n.x+n.width-t<=5,a=b-1;t-n.x<=5&&a>=0?(r=!0,n=q(e,a,S),se(n!==void 0),k={kind:g&&S===-2?Ba:za,location:[a,S],bounds:n,group:Ze[a].group??``,isEdge:r,shiftKey:C,ctrlKey:T,metaKey:E,isTouch:D,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:O}):k={kind:g&&S===-2?Ba:za,group:Ze[b].group??``,location:[b,S],bounds:n,isEdge:r,shiftKey:C,ctrlKey:T,metaKey:E,isTouch:D,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:O}}else{let n=q(e,b,S);se(n!==void 0);let r=n!==void 0&&n.x+n.width-t<5,a=!1;if(l&&x.current!==void 0){let n=ln(x.current.range),r=q(e,n[0],n[1]);if(r!==void 0){let e=r.x+r.width-2,n=r.y+r.height-2;a=Math.abs(e-t)<Ga&&Math.abs(n-i)<Ga}}k={kind:`cell`,location:[b,S],bounds:n,isEdge:r,shiftKey:C,ctrlKey:T,isFillHandle:a,metaKey:E,isTouch:D,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:O}}return k},[n,Ze,W,Oe,r,g,c,u,f,d,s,ke,w,q,l,x,Je]),[et]=Le??[],tt=G.useRef(()=>{}),nt=G.useRef(Le);nt.current=Le;let[rt,it]=G.useMemo(()=>{let e=document.createElement(`canvas`),t=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,t.style.display=`none`,t.style.opacity=`0`,t.style.position=`fixed`,[e.getContext(`2d`,{alpha:!1}),t.getContext(`2d`,{alpha:!1})]},[]);G.useLayoutEffect(()=>{if(!(rt===null||it===null))return document.documentElement.append(rt.canvas),document.documentElement.append(it.canvas),()=>{rt.canvas.remove(),it.canvas.remove()}},[rt,it]);let at=G.useMemo(()=>new Wn,[]),ot=Ye&&Ne?1:Xe&&Ne?2:5,st=De?.disableMinimumCellWidth===!0?1:10,ct=G.useRef(),lt=G.useRef(null),ut=G.useRef(null),dt=G.useCallback(()=>{let e=Ae.current,t=Ve.current;if(e===null||t===null||(lt.current===null&&(lt.current=e.getContext(`2d`,{alpha:!1}),e.width=0,e.height=0),ut.current===null&&(ut.current=t.getContext(`2d`,{alpha:!1}),t.width=0,t.height=0),lt.current===null||ut.current===null||rt===null||it===null))return;let i=!1,a=e=>{i=!0,Ue(e)},o=ct.current,h={headerCanvasCtx:ut.current,canvasCtx:lt.current,bufferACtx:rt,bufferBCtx:it,width:n,height:r,cellXOffset:W,cellYOffset:s,translateX:Math.round(Oe),translateY:Math.round(ke),mappedColumns:Ze,enableGroups:g,freezeColumns:S,dragAndDropState:ne,theme:he,headerHeight:c,groupHeaderHeight:u,disabledRows:de??H.empty(),rowHeight:d,verticalBorder:ve,isResizing:ce,resizeCol:le,isFocused:b,selection:x,fillHandle:l,drawCellCallback:L,hasAppendRow:fe,overrideCursor:a,maxScaleFactor:ot,freezeTrailingRows:w,rows:f,drawFocus:D,getCellContent:p,getGroupDetails:me??(e=>({name:e})),getRowThemeOverride:m,drawHeaderCallback:R,prelightCells:ge,highlightRegions:ae,imageLoader:je,lastBlitData:Ie,damage:Me.current,hoverValues:Fe.current,hoverInfo:nt.current,spriteManager:qe,scrolling:Ne,hyperWrapping:De?.hyperWrapping??!1,touchMode:We,enqueue:tt.current,renderStateProvider:at,renderStrategy:De?.renderStrategy??(Ia.value?`double-buffer`:`single-buffer`),getCellRenderer:U,minimumCellWidth:st};h.damage===void 0?(ct.current=h,Oa(h,o)):Oa(h,void 0),!i&&(h.damage===void 0||h.damage.has(nt?.current?.[0]))&&Ue(void 0)},[rt,it,n,r,W,s,Oe,ke,Ze,g,S,ne,he,c,u,de,d,ve,ce,fe,le,b,x,l,w,f,D,ot,p,me,m,L,R,ge,ae,je,qe,Ne,De?.hyperWrapping,De?.renderStrategy,We,at,U,st]),ft=G.useRef(dt);G.useLayoutEffect(()=>{dt(),ft.current=dt},[dt]),G.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,ct.current=void 0,ft.current())})()},[]);let pt=G.useCallback(e=>{Me.current=e,ft.current(),Me.current=void 0},[]);tt.current=Ra(pt);let mt=G.useCallback(e=>{pt(new Gn(e.map(e=>e.cell)))},[pt]);je.setCallback(pt);let[ht,gt]=G.useState(!1),[_t,vt]=et??[],yt=_t!==void 0&&vt===-1,xt=_t!==void 0&&vt===-2,St=!1,Ct=!1,wt=He;if(wt===void 0&&_t!==void 0&&vt!==void 0&&vt>-1&&vt<f){let e=p([_t,vt],!0);St=e.kind===ye.NewRow||e.kind===ye.Marker&&e.markerKind!==`number`,Ct=e.kind===B.Boolean&&pe(e),wt=e.cursor}let Tt=F?`grabbing`:(ze??!1)||ce?`col-resize`:ht||_?`crosshair`:wt===void 0?yt||St||Ct||xt?`pointer`:`default`:wt,Et=G.useMemo(()=>({contain:`strict`,display:`block`,cursor:Tt}),[Tt]),Dt=G.useRef(`default`),Ot=P?.current;Ot!=null&&Dt.current!==Et.cursor&&(Ot.style.cursor=Dt.current=Et.cursor);let kt=G.useCallback((e,t,n,r)=>{if(me===void 0)return;let i=me(e);if(i.actions!==void 0){let e=ii(t,i.actions);for(let[a,o]of e.entries())if(Br(o,n+t.x,r+o.y))return i.actions[a]}},[me]),jt=G.useCallback((e,t,n,r)=>{let i=a[t];if(!F&&!ce&&i.hasMenu===!0&&!(ze??!1)){let a=q(e,t,-1);se(a!==void 0);let o=ri(a.x,a.y,a.width,a.height,Mt(i.title)===`rtl`);if(n>o.x&&n<o.x+o.width&&r>o.y&&r<o.y+o.height)return a}},[a,q,ze,F,ce]),Nt=G.useRef(0),Ft=G.useRef(),It=G.useRef(!1),Lt=G.useCallback(e=>{let t=Ae.current,n=P?.current;if(t===null||e.target!==t&&e.target!==n)return;It.current=!0;let r,i;if(e instanceof MouseEvent?(r=e.clientX,i=e.clientY):(r=e.touches[0].clientX,i=e.touches[0].clientY),e.target===n&&n!==null){let e=n.getBoundingClientRect();if(r>e.right||i>e.bottom)return}let a=$e(t,r,i,e);Ft.current=a.location,a.isTouch&&(Nt.current=Date.now()),Ke.current!==a.isTouch&&Ge(a.isTouch),!(a.kind===`header`&&jt(t,a.location[0],r,i)!==void 0)&&(a.kind===`group-header`&&kt(a.group,a.bounds,a.localEventX,a.localEventY)!==void 0||(O?.(a),!a.isTouch&&I!==!0&&I!==a.kind&&a.button<3&&a.button!==1&&e.preventDefault()))},[P,I,$e,kt,jt,O]);bt(`touchstart`,Lt,window,!1),bt(`mousedown`,Lt,window,!1);let Rt=G.useRef(0),zt=G.useCallback(e=>{let t=Rt.current;Rt.current=Date.now();let n=Ae.current;if(It.current=!1,k===void 0||n===null)return;let r=P?.current,i=e.target!==n&&e.target!==r,a,o,s=!0;if(e instanceof MouseEvent){if(a=e.clientX,o=e.clientY,s=e.button<3,e.pointerType===`touch`)return}else a=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY;let c=$e(n,a,o,e);c.isTouch&&Nt.current!==0&&Date.now()-Nt.current>500&&(c={...c,isLongTouch:!0}),t!==0&&Date.now()-t<(c.isTouch?1e3:500)&&(c={...c,isDoubleClick:!0}),Ke.current!==c.isTouch&&Ge(c.isTouch),!i&&e.cancelable&&s&&e.preventDefault();let[l]=c.location,u=jt(n,l,a,o);if(c.kind===`header`&&u!==void 0){(c.button!==0||Ft.current?.[0]!==l||Ft.current?.[1]!==-1)&&k(c,!0);return}else if(c.kind===`group-header`){let e=kt(c.group,c.bounds,c.localEventX,c.localEventY);if(e!==void 0){c.button===0&&e.onClick(c);return}}k(c,i)},[k,P,$e,jt,kt]);bt(`mouseup`,zt,window,!1),bt(`touchend`,zt,window,!1),bt(`click`,G.useCallback(e=>{let t=Ae.current;if(t===null)return;let n=P?.current,r=e.target!==t&&e.target!==n,i,a,o=!0;e instanceof MouseEvent?(i=e.clientX,a=e.clientY,o=e.button<3):(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY);let s=$e(t,i,a,e);Ke.current!==s.isTouch&&Ge(s.isTouch),!r&&e.cancelable&&o&&e.preventDefault();let[c]=s.location,l=jt(t,c,i,a);if(s.kind===`header`&&l!==void 0)s.button===0&&Ft.current?.[0]===c&&Ft.current?.[1]===-1&&h?.(c,l);else if(s.kind===`group-header`){let e=kt(s.group,s.bounds,s.localEventX,s.localEventY);e!==void 0&&s.button===0&&e.onClick(s)}},[P,$e,jt,h,kt]),window,!1),bt(`contextmenu`,G.useCallback(e=>{let t=Ae.current,n=P?.current;t===null||e.target!==t&&e.target!==n||C===void 0||C($e(t,e.clientX,e.clientY,e),()=>{e.cancelable&&e.preventDefault()})},[P,$e,C]),P?.current??null,!1);let Bt=G.useCallback(e=>{Me.current=new Gn(e.map(e=>e.item)),Fe.current=e,ft.current(),Me.current=void 0},[]),Vt=G.useMemo(()=>new Ma(Bt),[Bt]),Ht=G.useRef(Vt);Ht.current=Vt,G.useLayoutEffect(()=>{let e=Ht.current;if(et===void 0||et[1]<0){e.setHovered(et);return}let t=p(et,!0),n=U(t),r=n===void 0&&t.kind===B.Custom||n?.needsHover!==void 0&&(typeof n.needsHover==`boolean`?n.needsHover:n.needsHover(t));e.setHovered(r?et:void 0)},[p,U,et]);let Ut=G.useRef();bt(`mousemove`,G.useCallback(e=>{let t=Ae.current;if(t===null)return;let n=P?.current,r=e.target!==t&&e.target!==n,i=$e(t,e.clientX,e.clientY,e);if(i.kind!==`out-of-bounds`&&r&&!It.current&&!i.isTouch)return;let a=(e,t)=>{Re(n=>n===e||n?.[0][0]===e?.[0][0]&&n?.[0][1]===e?.[0][1]&&(n?.[1][0]===e?.[1][0]&&n?.[1][1]===e?.[1][1]||!t)?n:e)};if(!Ua(i,Ut.current))Ue(void 0),A?.(i),a(i.kind===`out-of-bounds`?void 0:[i.location,[i.localEventX,i.localEventY]],!0),Ut.current=i;else if(i.kind===`cell`||i.kind===`header`||i.kind===`group-header`){let e=!1,t=!0;if(i.kind===`cell`){let n=p(i.location);t=U(n)?.needsHoverPosition??n.kind===B.Custom,e=t}else i.kind===`group-header`&&(e=!0);let n=[i.location,[i.localEventX,i.localEventY]];a(n,t),nt.current=n,e&&pt(new Gn([i.location]))}let o=i.location[0]>=(j?0:1);Be(i.kind===`header`&&i.isEdge&&o&&ue===!0),gt(i.kind===`cell`&&i.isFillHandle),ee?.(e),te(i)},[P,$e,j,ue,ee,te,A,p,U,pt]),window,!0);let Wt=G.useCallback(e=>{let t=Ae.current;if(t===null)return;let n,r;x.current!==void 0&&(n=q(t,x.current.cell[0],x.current.cell[1]),r=x.current.cell),re?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[re,x,q]),Gt=G.useCallback(e=>{let t=Ae.current;if(t===null)return;let n,r;x.current!==void 0&&(n=q(t,x.current.cell[0],x.current.cell[1]),r=x.current.cell),ie?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[ie,x,q]),Kt=G.useCallback(e=>{Ae.current=e,M!==void 0&&(M.current=e)},[M]);bt(`dragstart`,G.useCallback(e=>{let t=Ae.current;if(t===null||I===!1||ce){e.preventDefault();return}let n,r,i=$e(t,e.clientX,e.clientY);if(I!==!0&&i.kind!==I){e.preventDefault();return}let a=(e,t)=>{n=e,r=t},o,s,c,l=(e,t,n)=>{o=e,s=t,c=n},u=!1;if(oe?.({...i,setData:a,setDragImage:l,preventDefault:()=>u=!0,defaultPrevented:()=>u}),!u&&n!==void 0&&r!==void 0&&e.dataTransfer!==null)if(e.dataTransfer.setData(n,r),e.dataTransfer.effectAllowed=`copyLink`,o!==void 0&&s!==void 0&&c!==void 0)e.dataTransfer.setDragImage(o,s,c);else{let[n,r]=i.location;if(r!==void 0){let i=document.createElement(`canvas`),a=q(t,n,r);se(a!==void 0);let o=Math.ceil(window.devicePixelRatio??1);i.width=a.width*o,i.height=a.height*o;let s=i.getContext(`2d`);s!==null&&(s.scale(o,o),s.textBaseline=`middle`,r===-1?(s.font=he.headerFontFull,s.fillStyle=he.bgHeader,s.fillRect(0,0,i.width,i.height),oi(s,0,0,a.width,a.height,Ze[n],!1,he,!1,!1,0,qe,R,!1)):(s.font=he.baseFontFull,s.fillStyle=he.bgCell,s.fillRect(0,0,i.width,i.height),Qr(s,p([n,r]),0,r,!1,!1,0,0,a.width,a.height,!1,he,he.bgCell,je,qe,1,void 0,!1,0,void 0,void 0,void 0,at,U,()=>void 0))),i.style.left=`-100%`,i.style.position=`absolute`,i.style.width=`${a.width}px`,i.style.height=`${a.height}px`,document.body.append(i),e.dataTransfer.setDragImage(i,a.width/2,a.height/2),window.setTimeout(()=>{i.remove()},0)}}else e.preventDefault()},[I,ce,$e,oe,q,he,Ze,qe,R,p,je,at,U]),P?.current??null,!1,!1);let qt=G.useRef();bt(`dragover`,G.useCallback(e=>{let t=Ae.current;if(Se!==void 0&&e.preventDefault(),t===null||xe===void 0)return;let[n,r]=$e(t,e.clientX,e.clientY).location,i=n-(j?0:1),[a,o]=qt.current??[];(a!==i||o!==r)&&(qt.current=[i,r],xe([i,r],e.dataTransfer))},[j,$e,xe,Se]),P?.current??null,!1,!1),bt(`dragend`,G.useCallback(()=>{qt.current=void 0,N?.()},[N]),P?.current??null,!1,!1),bt(`drop`,G.useCallback(e=>{let t=Ae.current;if(t===null||Se===void 0)return;e.preventDefault();let[n,r]=$e(t,e.clientX,e.clientY).location;Se([n-(j?0:1),r],e.dataTransfer)},[j,$e,Se]),P?.current??null,!1,!1),bt(`dragleave`,G.useCallback(()=>{V?.()},[V]),P?.current??null,!1,!1);let Jt=G.useRef(x);Jt.current=x;let Yt=G.useRef(null),Xt=G.useCallback(e=>{Ae.current===null||!Ae.current.contains(document.activeElement)||(e===null&&Jt.current.current!==void 0?M?.current?.focus({preventScroll:!0}):e!==null&&e.focus({preventScroll:!0}),Yt.current=e)},[M]);G.useImperativeHandle(t,()=>({focus:()=>{let e=Yt.current;e===null||!document.contains(e)?M?.current?.focus({preventScroll:!0}):e.focus({preventScroll:!0})},getBounds:(e,t)=>{if(!(M===void 0||M.current===null))return q(M.current,e??0,t??-1)},damage:mt}),[M,mt,q]);let Zt=G.useRef(),Qt=At(()=>{if(n<50||De?.disableAccessibilityTree===!0)return null;let e=mn(Ze,W,n,ne,Oe),t=j?0:-1;!j&&e[0]?.sourceIndex===0&&(e=e.slice(1));let[r,a]=x.current?.cell??[],o=x.current?.range,c=e.map(e=>e.sourceIndex),l=(0,Wa.default)(s,Math.min(f,s+i));return r!==void 0&&a!==void 0&&!(c.includes(r)&&l.includes(a))&&Xt(null),G.createElement(`table`,{key:`access-tree`,role:`grid`,"aria-rowcount":f+1,"aria-multiselectable":`true`,"aria-colcount":Ze.length+t},G.createElement(`thead`,{role:`rowgroup`},G.createElement(`tr`,{role:`row`,"aria-rowindex":1},e.map(e=>G.createElement(`th`,{role:`columnheader`,"aria-selected":x.columns.hasIndex(e.sourceIndex),"aria-colindex":e.sourceIndex+1+t,tabIndex:-1,onFocus:t=>{if(t.target!==Yt.current)return be?.([e.sourceIndex,-1])},key:e.sourceIndex},e.title)))),G.createElement(`tbody`,{role:`rowgroup`},l.map(n=>G.createElement(`tr`,{role:`row`,"aria-selected":x.rows.hasIndex(n),key:n,"aria-rowindex":n+2},e.map(e=>{let i=e.sourceIndex,s=X(i,n),c=r===i&&a===n,l=o!==void 0&&i>=o.x&&i<o.x+o.width&&n>=o.y&&n<o.y+o.height,u=`glide-cell-${i}-${n}`,d=[i,n],f=p(d,!0);return G.createElement(`td`,{key:s,role:`gridcell`,"aria-colindex":i+1+t,"aria-selected":l,"aria-readonly":we(f)||!z(f),id:u,"data-testid":u,onClick:()=>{let e=M?.current;if(e!=null)return re?.({bounds:q(e,i,n),cancel:()=>void 0,preventDefault:()=>void 0,stopPropagation:()=>void 0,ctrlKey:!1,key:`Enter`,keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:d})},onFocusCapture:e=>{if(!(e.target===Yt.current||Zt.current?.[0]===i&&Zt.current?.[1]===n))return Zt.current=d,be?.(d)},ref:c?Xt:void 0,tabIndex:-1},Ka(f,U))})))))},[n,Ze,W,ne,Oe,f,s,i,x,Xt,p,M,re,q,be],200),$t=S===0||!T?0:W>S?1:(0,ka.default)(-Oe/100,0,1),en=-s*32+ke,tn=E?(0,ka.default)(-en/100,0,1):0,J=G.useMemo(()=>{if(!$t&&!tn)return null;let e={position:`absolute`,top:0,left:Qe,width:n-Qe,height:r,opacity:$t,pointerEvents:`none`,transition:Te?void 0:`opacity 0.2s`,boxShadow:`inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)`},t={position:`absolute`,top:Je,left:0,width:n,height:r,opacity:tn,pointerEvents:`none`,transition:Ee?void 0:`opacity 0.2s`,boxShadow:`inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)`};return G.createElement(G.Fragment,null,$t>0&&G.createElement(`div`,{id:`shadow-x`,style:e}),tn>0&&G.createElement(`div`,{id:`shadow-y`,style:t}))},[$t,tn,Qe,n,Te,Je,r,Ee]),rn=G.useMemo(()=>({position:`absolute`,top:0,left:0}),[]);return G.createElement(G.Fragment,null,G.createElement(`canvas`,{"data-testid":`data-grid-canvas`,tabIndex:0,onKeyDown:Wt,onKeyUp:Gt,onFocus:v,onBlur:y,ref:Kt,style:Et},Qt),G.createElement(`canvas`,{ref:Ve,style:rn}),J)}));function Ja(e,t,n,r){return(0,ka.default)(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}var Ya=e=>{let[t,n]=G.useState(),[r,i]=G.useState(),[a,o]=G.useState(),[s,c]=G.useState(),[l,u]=G.useState(!1),[d,f]=G.useState(),[p,m]=G.useState(),[h,g]=G.useState(),[_,v]=G.useState(!1),[y,b]=G.useState(),{onHeaderMenuClick:x,getCellContent:S,onColumnMoved:C,onColumnResize:w,onColumnResizeStart:T,onColumnResizeEnd:E,gridRef:D,maxColumnWidth:O,minColumnWidth:k,onRowMoved:ee,lockColumns:te,onColumnProposeMove:A,onMouseDown:ne,onMouseUp:j,onItemHovered:re,onDragStart:ie,canvasRef:ae}=e,M=(w??E??T)!==void 0,{columns:oe,selection:N}=e,P=N.columns,se=G.useCallback(e=>{let[t,n]=e.location;a!==void 0&&s!==t&&t>=te?(u(!0),c(t)):p!==void 0&&n!==void 0?(v(!0),g(Math.max(0,n))):r===void 0&&!l&&!_&&re?.(e)},[a,p,s,re,te,r,l,_]),ce=C!==void 0,le=G.useCallback(e=>{if(e.button===0){let[t,r]=e.location;if(e.kind===`out-of-bounds`&&e.isEdge&&M){let e=D?.current?.getBounds(oe.length-1,-1);e!==void 0&&(n(e.x),i(oe.length-1))}else if(e.kind===`header`&&t>=te){let r=ae?.current;if(e.isEdge&&M&&r){n(e.bounds.x),i(t);let a=r.getBoundingClientRect().width/r.offsetWidth,o=e.bounds.width/a;T?.(oe[t],o,t,o+(oe[t].growOffset??0))}else e.kind===`header`&&ce&&(f(e.bounds.x),o(t))}else e.kind===`cell`&&te>0&&t===0&&r!==void 0&&ee!==void 0&&(b(e.bounds.y),m(r))}ne?.(e)},[ne,M,te,ee,D,oe,ce,T,ae]),F=G.useCallback((e,t)=>{l||_||x?.(e,t)},[l,_,x]),I=G.useRef(-1),ue=G.useCallback(()=>{I.current=-1,m(void 0),g(void 0),b(void 0),v(!1),o(void 0),c(void 0),f(void 0),u(!1),i(void 0),n(void 0)},[]),de=G.useCallback((e,t)=>{if(e.button===0){if(r!==void 0){if(P?.hasIndex(r)===!0)for(let e of P){if(e===r)continue;let t=oe[e],n=Ja(t,I.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}let e=Ja(oe[r],I.current,k,O);if(E?.(oe[r],e,r,e+(oe[r].growOffset??0)),P.hasIndex(r))for(let e of P){if(e===r)continue;let t=oe[e],n=Ja(t,I.current,k,O);E?.(t,n,e,n+(t.growOffset??0))}}ue(),a!==void 0&&s!==void 0&&C?.(a,s),p!==void 0&&h!==void 0&&ee?.(p,h)}j?.(e,t)},[j,r,a,s,p,h,P,E,oe,k,O,w,C,ee,ue]),fe=G.useMemo(()=>{if(!(a===void 0||s===void 0)&&a!==s&&A?.(a,s)!==!1)return{src:a,dest:s}},[a,s,A]),pe=G.useCallback(e=>{let n=ae?.current;if(a!==void 0&&d!==void 0)Math.abs(e.clientX-d)>20&&u(!0);else if(p!==void 0&&y!==void 0)Math.abs(e.clientY-y)>20&&v(!0);else if(r!==void 0&&t!==void 0&&n){let i=n.getBoundingClientRect().width/n.offsetWidth,a=(e.clientX-t)/i,o=oe[r],s=Ja(o,a,k,O);if(w?.(o,s,r,s+(o.growOffset??0)),I.current=a,P?.first()===r)for(let e of P){if(e===r)continue;let t=oe[e],n=Ja(t,I.current,k,O);w?.(t,n,e,n+(t.growOffset??0))}}},[a,d,p,y,r,t,oe,k,O,w,P,ae]),me=G.useCallback((e,t)=>{if(p===void 0||h===void 0)return S(e,t);let[n,r]=e;return r===h?r=p:(r>h&&--r,r>=p&&(r+=1)),S([n,r],t)},[p,h,S]),he=G.useCallback(e=>{ie?.(e),e.defaultPrevented()||ue()},[ue,ie]);return G.createElement(qa,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:me,isResizing:r!==void 0,onHeaderMenuClick:F,isDragging:l,onItemHovered:se,onDragStart:he,onMouseDown:le,allowResize:M,onMouseUp:de,dragAndDropState:fe,onMouseMoveRaw:pe,ref:D})};function Xa(e){let t=(0,G.useRef)(null),[n,r]=(0,G.useState)({width:e?.[0],height:e?.[1]});return(0,G.useLayoutEffect)(()=>{let e=new window.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t&&t.contentRect||{};r(t=>t.width===e&&t.height===n?t:{width:e,height:n})}});return t.current&&e.observe(t.current,void 0),()=>{e.disconnect()}},[t.current]),{ref:t,...n}}var Za=(e,t,n)=>{let r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useRef)(0),s=(0,G.useRef)(t);s.current=t;let c=n.current;(0,G.useEffect)(()=>{let t=()=>{if(i.current===!1&&c!==null){let e=[c.scrollLeft,c.scrollTop];if(a.current?.[0]===e[0]&&a.current?.[1]===e[1])if(o.current>10){a.current=null,i.current=null;return}else o.current++;else o.current=0,s.current(e[0],e[1]),a.current=e;r.current=window.setTimeout(t,1e3/120)}},n=()=>{i.current=!0,a.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},l=e=>{e.touches.length===0&&(i.current=!1,o.current=0,r.current=window.setTimeout(t,1e3/120))};if(e&&c!==null){let e=c;return e.addEventListener(`touchstart`,n),e.addEventListener(`touchend`,l),()=>{e.removeEventListener(`touchstart`,n),e.removeEventListener(`touchend`,l),r.current!==null&&window.clearTimeout(r.current)}}},[e,c])},Qa=()=>e=>e.isSafari?`scroll`:`auto`,$a=W(`div`)({name:`ScrollRegionStyle`,class:`gdg-s1dgczr6`,propsAsIs:!1,vars:{"s1dgczr6-0":[Qa()]}});function eo(e){let[t,n]=G.useState(!1),r=typeof window>`u`?null:window,i=G.useRef(0);return bt(`touchstart`,G.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),bt(`touchend`,G.useCallback(t=>{t.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}var to=e=>{let{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:a,draggable:o,className:s,preventDiagonalScrolling:c=!1,paddingBottom:l=0,paddingRight:u=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:p=!1,scrollRef:m,initialSize:h}=e,g=[],_=f?.sticky??!1,v=f?.fill??!1,y=G.useRef(0),b=G.useRef(0),x=G.useRef(null),S=typeof window>`u`?1:window.devicePixelRatio,C=G.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),w=G.useRef(null),T=eo(200),[E,D]=G.useState(!0),O=G.useRef(0);G.useLayoutEffect(()=>{if(!E||T||C.current.lockDirection===void 0)return;let e=x.current;if(e===null)return;let[t,n]=C.current.lockDirection;t===void 0?n!==void 0&&(e.scrollTop=n):e.scrollLeft=t,C.current.lockDirection=void 0},[T,E]);let k=G.useCallback((e,t)=>{let n=x.current;if(n===null)return;t??=n.scrollTop,e??=n.scrollLeft;let i=C.current.scrollTop,o=C.current.scrollLeft,s=e-o,d=t-i;T&&s!==0&&d!==0&&(Math.abs(s)>3||Math.abs(d)>3)&&c&&C.current.lockDirection===void 0&&(C.current.lockDirection=Math.abs(s)<Math.abs(d)?[o,void 0]:[void 0,i]);let f=C.current.lockDirection;e=f?.[0]??e,t=f?.[1]??t,C.current.scrollLeft=e,C.current.scrollTop=t;let p=n.clientWidth,m=n.clientHeight,h=t,g=b.current-h,_=n.scrollHeight-m;if(b.current=h,_>0&&(Math.abs(g)>2e3||h===0||h===_)&&r>n.scrollHeight+5){let e=h/_;y.current=(r-m)*e-h}f!==void 0&&(window.clearTimeout(O.current),D(!1),O.current=window.setTimeout(()=>D(!0),200)),a({x:e,y:h+y.current,width:p-u,height:m-l,paddingRight:w.current?.clientWidth??0})},[l,u,r,a,c,T]);Za(p&&Ia.value,k,x);let ee=G.useRef(k);ee.current=k;let te=G.useRef(),A=G.useRef(!1);G.useLayoutEffect(()=>{A.current?k():A.current=!0},[k,l,u]);let ne=G.useCallback(e=>{x.current=e,m!==void 0&&(m.current=e)},[m]),j=0,re=0;for(g.push(G.createElement(`div`,{key:j++,style:{width:i,height:0}}));re<r;){let e=Math.min(5e6,r-re);g.push(G.createElement(`div`,{key:j++,style:{width:0,height:e}})),re+=e}let{ref:ie,width:ae,height:M}=Xa(h);return typeof window<`u`&&(te.current?.height!==M||te.current?.width!==ae)&&(window.setTimeout(()=>ee.current(),0),te.current={width:ae,height:M}),(ae??0)===0||(M??0)===0?G.createElement(`div`,{ref:ie}):G.createElement(`div`,{ref:ie},G.createElement($a,{isSafari:Ia.value},G.createElement(`div`,{className:`dvn-underlay`},t),G.createElement(`div`,{ref:ne,style:te.current,draggable:o,onDragStart:e=>{o||(e.stopPropagation(),e.preventDefault())},className:`dvn-scroller `+(s??``),onScroll:()=>k()},G.createElement(`div`,{className:`dvn-scroll-inner`+(d===void 0?` dvn-hidden`:``)},G.createElement(`div`,{className:`dvn-stack`},g),d!==void 0&&G.createElement(G.Fragment,null,!v&&G.createElement(`div`,{className:`dvn-spacer`}),G.createElement(`div`,{ref:w,style:{height:M,maxHeight:n-Math.ceil(S%1),position:`sticky`,top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:_?u??0:void 0,pointerEvents:`auto`}},d))))))},no=e=>{let{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:a,enableGroups:o,freezeColumns:s,experimental:c,nonGrowWidth:l,clientSize:u,className:d,onVisibleRegionChanged:f,scrollRef:p,preventDiagonalScrolling:m,rightElement:h,rightElementProps:g,overscrollX:_,overscrollY:v,initialSize:y,smoothScrollX:b=!1,smoothScrollY:x=!1,isDraggable:S}=e,{paddingRight:C,paddingBottom:w}=c??{},[T,E]=u,D=G.useRef(),O=G.useRef(),k=G.useRef(),ee=G.useRef(),te=l+Math.max(0,_??0),A=o?i+a:i;if(typeof r==`number`)A+=n*r;else for(let e=0;e<n;e++)A+=r(e);v!==void 0&&(A+=v);let ne=G.useRef(),j=G.useCallback(()=>{if(ne.current===void 0)return;let e={...ne.current},i=0,a=e.x<0?-e.x:0,o=0,c=0;e.x=e.x<0?0:e.x;let l=0;for(let e=0;e<s;e++)l+=t[e].width;for(let n of t){let t=i-l;if(e.x>=t+n.width)i+=n.width,c++,o++;else if(e.x>t)i+=n.width,b?a+=t-e.x:c++,o++;else if(e.x+e.width>t)i+=n.width,o++;else break}let u=0,d=0,p=0;if(typeof r==`number`)x?(d=Math.floor(e.y/r),u=d*r-e.y):d=Math.ceil(e.y/r),p=Math.ceil(e.height/r)+d,u<0&&p++;else{let t=0;for(let i=0;i<n;i++){let n=r(i),a=t+(x?0:n/2);if(e.y>=t+n)t+=n,d++,p++;else if(e.y>a)t+=n,x?u+=a-e.y:d++,p++;else if(e.y+e.height>n/2+t)t+=n,p++;else break}}let m={x:c,y:d,width:o-c,height:p-d},h=D.current;(h===void 0||h.y!==m.y||h.x!==m.x||h.height!==m.height||h.width!==m.width||O.current!==a||k.current!==u||e.width!==ee.current?.[0]||e.height!==ee.current?.[1])&&(f?.({x:c,y:d,width:o-c,height:p-d},e.width,e.height,e.paddingRight??0,a,u),D.current=m,O.current=a,k.current=u,ee.current=[e.width,e.height])},[t,r,n,f,s,b,x]),re=G.useCallback(e=>{ne.current=e,j()},[j]);return G.useEffect(()=>{j()},[j]),G.createElement(to,{scrollRef:p,className:d,kineticScrollPerfHack:c?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:S===!0||typeof S==`string`,scrollWidth:te+(C??0),scrollHeight:A+(w??0),clientHeight:E,rightElement:h,paddingBottom:w,paddingRight:C,rightElementProps:g,update:re,initialSize:y},G.createElement(Ya,{eventTargetRef:p,width:T,height:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))},ro=W(`div`)({name:`SearchWrapper`,class:`gdg-seveqep`,propsAsIs:!1}),io=G.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},G.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 244l144-144 144 144M256 120v292`})),ao=G.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},G.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 268l144 144 144-144M256 392V100`})),oo=G.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},G.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`32`,d:`M368 368L144 144M368 144L144 368`})),so=10,co=e=>{let{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:a,searchValue:o,searchResults:s,onSearchValueChange:c,getCellsForSelection:l,onSearchResultsChanged:u,showSearch:d=!1,onSearchClose:f}=e,[p]=G.useState(()=>`search-box-`+Math.round(Math.random()*1e3)),[m,h]=G.useState(``),g=o??m,_=G.useCallback(e=>{h(e),c?.(e)},[c]),[v,y]=G.useState(),b=G.useRef(v);b.current=v,G.useEffect(()=>{s!==void 0&&(s.length>0?y(e=>({rowsSearched:r,results:s.length,selectedIndex:e?.selectedIndex??-1})):y(void 0))},[r,s]);let x=G.useRef();x.current===void 0&&(x.current=new AbortController);let S=G.useRef(),[C,w]=G.useState([]),T=s??C,E=G.useCallback(()=>{S.current!==void 0&&(window.cancelAnimationFrame(S.current),S.current=void 0,x.current.abort())},[]),D=G.useRef(n);D.current=n;let O=G.useCallback(e=>{let t=new RegExp(e.replace(/([$()*+.?[\\\]^{|}-])/g,`\\$1`),`i`),n=D.current,a=Math.min(10,r),o=0;y(void 0),w([]);let s=[],c=async()=>{if(l===void 0)return;let e=performance.now(),d=r-o,f=l({x:0,y:n,width:i.length,height:Math.min(a,d,r-n)},x.current.signal);typeof f==`function`&&(f=await f());let p=!1;for(let[e,r]of f.entries())for(let[i,a]of r.entries()){let r;switch(a.kind){case B.Text:case B.Number:r=a.displayData;break;case B.Uri:case B.Markdown:r=a.data;break;case B.Boolean:r=typeof a.data==`boolean`?a.data.toString():void 0;break;case B.Image:case B.Bubble:r=a.data.join(`🐳`);break;case B.Custom:r=a.copyData;break}r!==void 0&&t.test(r)&&(s.push([i,e+n]),p=!0)}let m=performance.now();p&&w([...s]),o+=f.length,se(o<=r);let h=b.current?.selectedIndex??-1;y({results:s.length,rowsSearched:o,selectedIndex:h}),u?.(s,h),n+a>=r?n=0:n+=a;let g=m-e,_=so/Math.max(g,1);a=Math.ceil(a*_),o<r&&s.length<1e3&&(S.current=window.requestAnimationFrame(c))};E(),S.current=window.requestAnimationFrame(c)},[E,i.length,l,u,r]),k=G.useCallback(()=>{f?.(),y(void 0),w([]),u?.([],-1),E(),t?.current?.focus()},[E,t,f,u]),ee=G.useCallback(e=>{_(e.target.value),s===void 0&&(e.target.value===``?(y(void 0),w([]),E()):O(e.target.value))},[O,E,_,s]);G.useEffect(()=>{d&&a.current!==null&&(_(``),a.current.focus({preventScroll:!0}))},[d,a,_]);let te=G.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex+1)%v.results;y({...v,selectedIndex:t}),u?.(T,t)},[v,u,T]),A=G.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0)return;let t=(v.selectedIndex-1)%v.results;t<0&&(t+=v.results),y({...v,selectedIndex:t}),u?.(T,t)},[u,T,v]),ne=G.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.nativeEvent.code===`KeyF`||e.key===`Escape`?(k(),e.stopPropagation(),e.preventDefault()):e.key===`Enter`&&(e.shiftKey?A():te())},[k,te,A]);G.useEffect(()=>()=>{E()},[E]);let[j,re]=G.useState(!1);G.useEffect(()=>{if(d)re(!0);else{let e=setTimeout(()=>re(!1),150);return()=>clearTimeout(e)}},[d]);let ie=G.useMemo(()=>{if(!d&&!j)return null;let e;v!==void 0&&(e=v.results>=1e3?`over 1000`:`${v.results} result${v.results===1?``:`s`}`,v.selectedIndex>=0&&(e=`${v.selectedIndex+1} of ${e}`));let t=e=>{e.stopPropagation()},n={width:`${Math.floor((v?.rowsSearched??0)/r*100)}%`};return G.createElement(ro,{className:d?``:`out`,onMouseDown:t,onMouseMove:t,onMouseUp:t,onClick:t},G.createElement(`div`,{className:`gdg-search-bar-inner`},G.createElement(`input`,{id:p,"aria-hidden":!d,"data-testid":`search-input`,ref:a,onChange:ee,value:g,tabIndex:d?void 0:-1,onKeyDownCapture:ne}),G.createElement(`button`,{"aria-label":`Previous Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:A,disabled:(v?.results??0)===0},io),G.createElement(`button`,{"aria-label":`Next Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:te,disabled:(v?.results??0)===0},ao),f!==void 0&&G.createElement(`button`,{"aria-label":`Close Search`,"aria-hidden":!d,"data-testid":`search-close-button`,tabIndex:d?void 0:-1,onClick:k},oo)),v===void 0?G.createElement(`div`,{className:`gdg-search-status`},G.createElement(`label`,{htmlFor:p},`Type to search`)):G.createElement(G.Fragment,null,G.createElement(`div`,{className:`gdg-search-status`},G.createElement(`div`,{"data-testid":`search-result-area`},e)),G.createElement(`div`,{className:`gdg-search-progress`,style:n})))},[d,j,v,r,p,a,ee,g,ne,A,te,f,k]);return G.createElement(G.Fragment,null,G.createElement(no,{prelightCells:T,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),ie)},lo=()=>e=>Math.max(16,e.targetHeight-10),uo=W(`input`)({name:`RenameInput`,class:`gdg-r17m35ur`,propsAsIs:!1,vars:{"r17m35ur-0":[lo(),`px`]}}),fo=e=>{let{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:a}=e,[o,s]=G.useState(n);return G.createElement(re,{style:{position:`absolute`,left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:`gdg-c1tqibwd`,onClickOutside:r},G.createElement(uo,{targetHeight:t.height,"data-testid":`group-rename-input`,value:o,onBlur:r,onFocus:e=>e.target.setSelectionRange(0,o.length),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?a(o):e.key===`Escape`&&r()},autoFocus:!0}))};function po(e,t){return e===void 0?!1:e.length>1&&e.startsWith(`_`)?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>=`a`&&e<=`z`?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Q(e,t,n){let r=mo(e,t);return r&&(n.didMatch=!0),r}function mo(e,t){if(e.length===0)return!1;if(e.includes(`|`)){let n=e.split(`|`);for(let e of n)if(mo(e,t))return!0;return!1}let n=!1,r=!1,i=!1,a=!1,o=e.split(`+`);if(!po(o.pop(),t))return!1;if(o[0]===`any`)return!0;for(let e of o)switch(e){case`ctrl`:n=!0;break;case`shift`:r=!0;break;case`alt`:i=!0;break;case`meta`:a=!0;break;case`primary`:La.value?a=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===a}function ho(e,t,n,r,i,a){return[G.useCallback((o,s,c,l)=>{(a===`cell`||a===`multi-cell`)&&o!==void 0&&(o={...o,range:{x:o.cell[0],y:o.cell[1],width:1,height:1}});let u=n===`mixed`&&(c||l===`drag`),d=r===`mixed`&&u,f=i===`mixed`&&u,p={current:o===void 0?void 0:{...o,rangeStack:l===`drag`?e.current?.rangeStack??[]:[]},columns:d?e.columns:H.empty(),rows:f?e.rows:H.empty()};c&&(a===`multi-rect`||a===`multi-cell`)&&p.current!==void 0&&e.current!==void 0&&(p={...p,current:{...p.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(p,s)},[r,e,n,a,i,t]),G.useCallback((a,o,s)=>{a??=e.rows,o!==void 0&&(a=a.add(o));let c;if(i===`exclusive`&&a.length>0)c={current:void 0,columns:H.empty(),rows:a};else{let t=s&&n===`mixed`,i=s&&r===`mixed`;c={current:t?e.current:void 0,columns:i?e.columns:H.empty(),rows:a}}t(c,!1)},[r,e,n,i,t]),G.useCallback((a,o,s)=>{a??=e.columns,o!==void 0&&(a=a.add(o));let c;if(r===`exclusive`&&a.length>0)c={current:void 0,rows:H.empty(),columns:a};else{let t=s&&n===`mixed`,r=s&&i===`mixed`;c={current:t?e.current:void 0,rows:r?e.rows:H.empty(),columns:a}}t(c,!1)},[r,e,n,i,t])]}function go(e,t,n,r,i){let a=G.useCallback(n=>{if(e===!0){let e=[];for(let r=n.y;r<n.y+n.height;r++){let a=[];for(let e=n.x;e<n.x+n.width;e++)e<0||r>=i?a.push({kind:B.Loading,allowOverlay:!1}):a.push(t([e,r]));e.push(a)}return e}return e?.(n,r.signal)??[]},[r.signal,t,e,i]),o=e===void 0?void 0:a,s=G.useCallback(e=>{if(o===void 0)return[];let t={...e,x:e.x-n};if(t.x<0){t.x=0,t.width--;let e=o(t,r.signal);return typeof e==`function`?async()=>(await e()).map(e=>[{kind:B.Loading,allowOverlay:!1},...e]):e.map(e=>[{kind:B.Loading,allowOverlay:!1},...e])}return o(t,r.signal)},[r.signal,o,n]);return[e===void 0?void 0:s,o]}function _o(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:`string`};switch(e.kind){case B.Boolean:return{formatted:e.data===!0?`TRUE`:e.data===!1?`FALSE`:e.data===void 0?`INDETERMINATE`:``,rawValue:e.data,format:`boolean`};case B.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:`string`};case B.Image:case B.Bubble:return{formatted:e.data,rawValue:e.data,format:`string-array`};case B.Drilldown:return{formatted:e.data.map(e=>e.text),rawValue:e.data.map(e=>e.text),format:`string-array`};case B.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:`string`};case B.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:`url`};case B.Markdown:case B.RowID:return{formatted:e.data,rawValue:e.data,format:`string`};case B.Number:return{formatted:e.displayData,rawValue:e.data,format:`number`};case B.Loading:return{formatted:`#LOADING`,rawValue:``,format:`string`};case B.Protected:return{formatted:`************`,rawValue:``,format:`string`};default:j(e)}}function vo(e,t){return e.map((e,n)=>{let r=t[n];return e.map(e=>e.span!==void 0&&e.span[0]!==r?{formatted:``,rawValue:``,format:`string`}:_o(e))})}function yo(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,`""`)}"`),e}function bo(e){let t=[];for(let n of e){let e=[];for(let t of n)t.format===`url`?e.push(t.rawValue?.toString()??``):t.format===`string-array`?e.push(t.formatted.map(e=>yo(e,!0)).join(`,`)):e.push(yo(t.formatted,!1));t.push(e.join(` `))}return t.join(`
|
|
123
|
+
`)}function xo(e){return e.replace(/\t/g,` `).replace(/ {2,}/g,e=>`<span> </span>`.repeat(e.length))}function So(e){return`"`+e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)+`"`}function Co(e){return e.replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}function wo(e){let t=[];t.push(`<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>`,`<table><tbody>`);for(let n of e){t.push(`<tr>`);for(let e of n){let n=`gdg-format="${e.format}"`;e.format===`url`?t.push(`<td ${n}><a href="${e.rawValue}">${xo(e.formatted)}</a></td>`):e.format===`string-array`?t.push(`<td ${n}><ol>${e.formatted.map((t,n)=>`<li gdg-raw-value=${So(e.rawValue[n])}>`+xo(t)+`</li>`).join(``)}</ol></td>`):t.push(`<td gdg-raw-value=${So(e.rawValue?.toString()??``)} ${n}>${xo(e.formatted)}</td>`)}t.push(`</tr>`)}return t.push(`</tbody></table>`),t.join(``)}function To(e,t){let n=vo(e,t);return{textPlain:bo(n),textHtml:wo(n)}}function Eo(e){let t=document.createElement(`html`);t.innerHTML=e.replace(/ /g,` `);let n=t.querySelector(`table`);if(n===null)return;let r=[n],i=[],a;for(;r.length>0;){let e=r.pop();if(e===void 0)break;if(e instanceof HTMLTableElement||e.nodeName===`TBODY`)r.push(...[...e.children].reverse());else if(e instanceof HTMLTableRowElement)a!==void 0&&i.push(a),a=[],r.push(...[...e.children].reverse());else if(e instanceof HTMLTableCellElement){let t=e.cloneNode(!0),n=t.children.length===1&&t.children[0].nodeName===`P`?t.children[0]:null,r=n?.children.length===1&&n.children[0].nodeName===`FONT`,i=t.querySelectorAll(`br`);for(let e of i)e.replaceWith(`
|
|
124
|
+
`);let o=t.getAttribute(`gdg-raw-value`),s=t.getAttribute(`gdg-format`)??`string`;if(t.querySelector(`a`)!==null)a?.push({rawValue:t.querySelector(`a`)?.getAttribute(`href`)??``,formatted:t.textContent??``,format:s});else if(t.querySelector(`ol`)!==null){let e=t.querySelectorAll(`li`);a?.push({rawValue:[...e].map(e=>e.getAttribute(`gdg-raw-value`)??``),formatted:[...e].map(e=>e.textContent??``),format:`string-array`})}else if(o!==null)a?.push({rawValue:Co(o),formatted:t.textContent??``,format:s});else{let e=t.textContent??``;r&&(e=e.replace(/\n(?!\n)/g,``)),a?.push({rawValue:e??``,formatted:e??``,format:s})}}}return a!==void 0&&i.push(a),i}function Do(e,t,n,r,i){let a=e;if(r===`allowPartial`||e.current===void 0||t===void 0)return e;let o=!1;do{if(e?.current===void 0)break;let r=e.current?.range,s=[];if(r.width>2){let e=t({x:r.x,y:r.y,width:1,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e);let n=t({x:r.x+r.width-1,y:r.y,width:1,height:r.height},i.signal);if(typeof n==`function`)return a;s.push(...n)}else{let e=t({x:r.x,y:r.y,width:r.width,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e)}let c=r.x-n,l=r.x+r.width-1-n;for(let e of s)for(let t of e)t.span!==void 0&&(c=Math.min(t.span[0],c),l=Math.max(t.span[1],l));c===r.x-n&&l===r.x+r.width-1-n?o=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:r.y,width:l-c+1,height:r.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!o);return e}function Oo(e){return e.startsWith(`"`)&&e.endsWith(`"`)&&(e=e.slice(1,-1).replace(/""/g,`"`)),e}function ko(e){let t;(function(e){e[e.None=0]=`None`,e[e.inString=1]=`inString`,e[e.inStringPostQuote=2]=`inStringPostQuote`})(t||={});let n=[],r=[],i=0,a=t.None;e=e.replace(/\r\n/g,`
|
|
125
|
+
`);let o=0;for(let s of e){switch(a){case t.None:s===` `||s===`
|
|
126
|
+
`?(r.push(e.slice(i,o)),i=o+1,s===`
|
|
127
|
+
`&&(n.push(r),r=[])):s===`"`&&(a=t.inString);break;case t.inString:s===`"`&&(a=t.inStringPostQuote);break;case t.inStringPostQuote:s===`"`?a=t.inString:s===` `||s===`
|
|
128
|
+
`?(r.push(Oo(e.slice(i,o))),i=o+1,s===`
|
|
129
|
+
`&&(n.push(r),r=[]),a=t.None):a=t.None;break}o++}return i<e.length&&r.push(Oo(e.slice(i,e.length))),n.push(r),n.map(e=>e.map(e=>({rawValue:e,formatted:e,format:`string`})))}function Ao(e,t,n){let r=To(e,t),i=e=>{window.navigator.clipboard?.writeText(e)},a=(e,t)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0);window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?((e,t)=>{try{if(n===void 0||n.clipboardData===null)throw Error(`No clipboard data`);n?.clipboardData?.setData(`text/plain`,e),n?.clipboardData?.setData(`text/html`,t)}catch{a(e,t)||i(e)}})(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function jo(e){return e!==!0}function Mo(e){return typeof e==`string`?e:`${e}px`}var No=()=>e=>e.innerWidth,Po=()=>e=>e.innerHeight,Fo=W(`div`)({name:`Wrapper`,class:`gdg-wmyidgi`,propsAsIs:!1,vars:{"wmyidgi-0":[No()],"wmyidgi-1":[Po()]}}),Io=e=>{let{inWidth:t,inHeight:n,children:r,...i}=e;return G.createElement(Fo,{innerHeight:Mo(n),innerWidth:Mo(t),...i},r)},Lo=2,Ro=1300;function zo(e,t,n){let r=G.useRef(0),[i,a]=e??[0,0];G.useEffect(()=>{if(i===0&&a===0){r.current=0;return}let e=!1,o=0,s=c=>{if(!e){if(o===0)o=c;else{let e=c-o;r.current=Math.min(1,r.current+e/Ro);let s=r.current**1.618*e*Lo;t.current?.scrollBy(i*s,a*s),o=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{e=!0}},[t,i,a,n])}function Bo({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:a,scaleToRem:o,remSize:s}){let[c,l,u,d,f,p]=G.useMemo(()=>{if(!o||s===16)return[e,t,n,r,i,a];let c=s/16,l=e,u=ke();return[typeof l==`number`?l*c:e=>Math.ceil(l(e)*c),Math.ceil(t*c),Math.ceil(n*c),{...r,headerIconSize:(r?.headerIconSize??u.headerIconSize)*c,cellHorizontalPadding:(r?.cellHorizontalPadding??u.cellHorizontalPadding)*c,cellVerticalPadding:(r?.cellVerticalPadding??u.cellVerticalPadding)*c},Math.ceil((i??0)*c),Math.ceil((a??0)*c)]},[n,t,i,a,s,e,o,r]);return{rowHeight:c,headerHeight:l,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}var Vo={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 $(e,t){return e===!0?t:e===!1?``:e}function Ho(e){let t=La.value;return{activateCell:$(e.activateCell,` |Enter|shift+Enter`),clear:$(e.clear,`any+Escape`),closeOverlay:$(e.closeOverlay,`any+Escape`),acceptOverlayDown:$(e.acceptOverlayDown,`Enter`),acceptOverlayUp:$(e.acceptOverlayUp,`shift+Enter`),acceptOverlayLeft:$(e.acceptOverlayLeft,`shift+Tab`),acceptOverlayRight:$(e.acceptOverlayRight,`Tab`),copy:e.copy,cut:e.cut,delete:$(e.delete,t?`Backspace|Delete`:`Delete`),downFill:$(e.downFill,`primary+_68`),scrollToSelectedCell:$(e.scrollToSelectedCell,`primary+Enter`),goDownCell:$(e.goDownCell,`ArrowDown`),goDownCellRetainSelection:$(e.goDownCellRetainSelection,`alt+ArrowDown`),goLeftCell:$(e.goLeftCell,`ArrowLeft|shift+Tab`),goLeftCellRetainSelection:$(e.goLeftCellRetainSelection,`alt+ArrowLeft`),goRightCell:$(e.goRightCell,`ArrowRight|Tab`),goRightCellRetainSelection:$(e.goRightCellRetainSelection,`alt+ArrowRight`),goUpCell:$(e.goUpCell,`ArrowUp`),goUpCellRetainSelection:$(e.goUpCellRetainSelection,`alt+ArrowUp`),goToFirstCell:$(e.goToFirstCell,`primary+Home`),goToFirstColumn:$(e.goToFirstColumn,`Home|primary+ArrowLeft`),goToFirstRow:$(e.goToFirstRow,`primary+ArrowUp`),goToLastCell:$(e.goToLastCell,`primary+End`),goToLastColumn:$(e.goToLastColumn,`End|primary+ArrowRight`),goToLastRow:$(e.goToLastRow,`primary+ArrowDown`),goToNextPage:$(e.goToNextPage,`PageDown`),goToPreviousPage:$(e.goToPreviousPage,`PageUp`),paste:e.paste,rightFill:$(e.rightFill,`primary+_82`),search:$(e.search,`primary+f`),selectAll:$(e.selectAll,`primary+a`),selectColumn:$(e.selectColumn,`ctrl+ `),selectGrowDown:$(e.selectGrowDown,`shift+ArrowDown`),selectGrowLeft:$(e.selectGrowLeft,`shift+ArrowLeft`),selectGrowRight:$(e.selectGrowRight,`shift+ArrowRight`),selectGrowUp:$(e.selectGrowUp,`shift+ArrowUp`),selectRow:$(e.selectRow,`shift+ `),selectToFirstCell:$(e.selectToFirstCell,`primary+shift+Home`),selectToFirstColumn:$(e.selectToFirstColumn,`primary+shift+ArrowLeft`),selectToFirstRow:$(e.selectToFirstRow,`primary+shift+ArrowUp`),selectToLastCell:$(e.selectToLastCell,`primary+shift+End`),selectToLastColumn:$(e.selectToLastColumn,`primary+shift+ArrowRight`),selectToLastRow:$(e.selectToLastRow,`primary+shift+ArrowDown`)}}function Uo(e){let t=Rt(e);return G.useMemo(()=>{if(t===void 0)return Ho(Vo);let e={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Vo.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Vo.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Vo.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Vo.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Vo.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Vo.selectToLastCell};return Ho({...Vo,...e})},[t])}var Wo=e(pr(),1),Go=e(_r(),1),Ko=G.lazy(async()=>await x(()=>import(`./data-grid-overlay-editor-DGjqvYn6.js`),__vite__mapDeps([0,1,2,3,4,5]))),qo=0;function Jo(e){return(0,Wo.default)((0,Go.default)((0,Go.default)(e).filter(e=>e.span!==void 0).map(e=>(0,Wa.default)((e.span?.[0]??0)+1,(e.span?.[1]??0)+1))))}function Yo(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(e=>({...e,x:e.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var Xo={kind:B.Loading,allowOverlay:!1},Zo={columns:H.empty(),rows:H.empty(),current:void 0},Qo=G.forwardRef((e,t)=>{let[n,r]=G.useState(Zo),[i,a]=G.useState(),o=G.useRef(null),s=G.useRef(null),[c,l]=G.useState(),u=G.useRef(null),d=G.useRef(),f=typeof window>`u`?null:window,{imageEditorOverride:p,getRowThemeOverride:m,markdownDivCreateNode:h,width:g,height:_,columns:v,rows:y,getCellContent:b,onCellClicked:x,onCellActivated:S,onFillPattern:C,onFinishedEditing:w,coercePasteValue:T,drawHeader:E,drawCell:D,editorBloom:O,onHeaderClicked:k,onColumnProposeMove:te,spanRangeBehavior:A=`default`,onGroupHeaderClicked:ne,onCellContextMenu:re,className:ie,onHeaderContextMenu:ae,getCellsForSelection:oe,onGroupHeaderContextMenu:N,onGroupHeaderRenamed:P,onCellEdited:le,onCellsEdited:F,onSearchResultsChanged:I,searchResults:fe,onSearchValueChange:pe,searchValue:me,onKeyDown:ge,onKeyUp:_e,keybindings:ve,editOnType:L=!0,onRowAppended:R,onColumnMoved:be,validateCell:xe,highlightRegions:V,rangeSelect:Ce=`rect`,columnSelect:Te=`multi`,rowSelect:Ee=`multi`,rangeSelectionBlending:De=`exclusive`,columnSelectionBlending:U=`exclusive`,rowSelectionBlending:Oe=`exclusive`,onDelete:W,onDragStart:Ae,onMouseMove:je,onPaste:Me,copyHeaders:Ne=!1,freezeColumns:Pe=0,cellActivationBehavior:Fe=`second-click`,rowSelectionMode:Ie=`auto`,onHeaderMenuClick:Le,getGroupDetails:Re,onSearchClose:ze,onItemHovered:Be,onSelectionCleared:Ve,showSearch:He,onVisibleRegionChanged:Ue,gridSelection:We,onGridSelectionChange:Ge,minColumnWidth:Ke=50,maxColumnWidth:qe=500,maxColumnAutoWidth:Je,provideEditor:K,trailingRowOptions:Ye,freezeTrailingRows:Xe=0,allowedFillDirections:Ze=`orthogonal`,scrollOffsetX:Qe,scrollOffsetY:q,verticalBorder:$e,onDragOverCell:et,onDrop:tt,onColumnResize:nt,onColumnResizeEnd:rt,onColumnResizeStart:it,customRenderers:at,fillHandle:ot,drawFocusRing:st=!0,experimental:ct,fixedShadowX:lt,fixedShadowY:ut,headerIcons:dt,imageWindowLoader:ft,initialSize:pt,isDraggable:mt,onDragLeave:ht,onRowMoved:gt,overscrollX:_t,overscrollY:vt,preventDiagonalScrolling:St,rightElement:Ct,rightElementProps:wt,trapFocus:Tt=!1,smoothScrollX:Et,smoothScrollY:Dt,scaleToRem:Ot=!1,rowHeight:kt=34,headerHeight:At=36,groupHeaderHeight:jt=At,theme:Mt,isOutsideClick:Nt,renderers:Ft}=e,Lt=typeof e.rowMarkers==`string`?void 0:e.rowMarkers,Rt=Lt?.kind??e.rowMarkers??`none`,zt=Lt?.width??e.rowMarkerWidth,Bt=Lt?.startIndex??e.rowMarkerStartIndex??1,Vt=Lt?.theme??e.rowMarkerTheme,Ht=Lt?.checkboxStyle??`square`,Ut=Math.max(Ke,20),Wt=Math.max(qe,Ut),Gt=Math.max(Je??Wt,Ut),Kt=G.useMemo(()=>typeof window>`u`?{fontSize:`16px`}:window.getComputedStyle(document.documentElement),[]),{rowHeight:qt,headerHeight:Jt,groupHeaderHeight:Yt,theme:Xt,overscrollX:Zt,overscrollY:Qt}=Bo({groupHeaderHeight:jt,headerHeight:At,overscrollX:_t,overscrollY:vt,remSize:G.useMemo(()=>Number.parseFloat(Kt.fontSize),[Kt]),rowHeight:kt,scaleToRem:Ot,theme:Mt}),$t=Uo(ve),en=zt??(y>1e4?48:y>1e3?44:y>100?36:32),tn=Rt!==`none`,J=tn?1:0,nn=R!==void 0,on=Ye?.sticky===!0,[ln,un]=G.useState(!1),dn=He??ln,fn=G.useCallback(()=>{ze===void 0?un(!1):ze()},[ze]),Y=G.useMemo(()=>We===void 0?void 0:Yo(We,J),[We,J])??n,mn=G.useRef();mn.current===void 0&&(mn.current=new AbortController),G.useEffect(()=>()=>mn?.current.abort(),[]);let[hn,gn]=go(oe,b,J,mn.current,y),_n=G.useCallback((e,t,n)=>{if(xe===void 0)return!0;let r=[e[0]-J,e[1]];return xe?.(r,t,n)},[J,xe]),vn=G.useRef(We),yn=G.useCallback((e,t)=>{t&&(e=Do(e,hn,J,A,mn.current)),Ge===void 0?r(e):(vn.current=Yo(e,-J),Ge(vn.current))},[Ge,hn,J,A]),bn=xt(nt,G.useCallback((e,t,n,r)=>{nt?.(v[n-J],t,n-J,r)},[nt,J,v])),xn=xt(rt,G.useCallback((e,t,n,r)=>{rt?.(v[n-J],t,n-J,r)},[rt,J,v])),Sn=xt(it,G.useCallback((e,t,n,r)=>{it?.(v[n-J],t,n-J,r)},[it,J,v])),Cn=xt(E,G.useCallback((e,t)=>E?.({...e,columnIndex:e.columnIndex-J},t)??!1,[E,J])),wn=xt(D,G.useCallback((e,t)=>D?.({...e,col:e.col-J},t)??!1,[D,J])),Tn=G.useCallback(e=>{if(W!==void 0){let t=W(Yo(e,-J));return typeof t==`boolean`?t:Yo(t,J)}return!0},[W,J]),[En,Dn,On]=ho(Y,yn,De,U,Oe,Ce),kn=G.useMemo(()=>ue(ke(),Xt),[Xt]),[An,jn]=G.useState([0,0,0]),Mn=G.useMemo(()=>{if(Ft===void 0)return{};let e={};for(let t of Ft)e[t.kind]=t;return e},[Ft]),Nn=G.useCallback(e=>e.kind===B.Custom?at?.find(t=>t.isMatch(e)):Mn[e.kind],[at,Mn]),{sizedColumns:Pn,nonGrowWidth:Fn}=Yn(v,y,gn,An[0]-(J===0?0:en)-An[2],Ut,Gt,kn,Nn,mn.current);Rt!==`none`&&(Fn+=en);let In=G.useMemo(()=>Pn.some(e=>e.group!==void 0),[Pn]),Ln=In?Jt+Yt:Jt,Rn=Y.rows.length,zn=Rt===`none`?void 0:Rn===0?!1:Rn===y?!0:void 0,X=G.useMemo(()=>Rt===`none`?Pn:[{title:``,width:en,icon:void 0,hasMenu:!1,style:`normal`,themeOverride:Vt,rowMarker:Ht,rowMarkerChecked:zn},...Pn],[Rt,Pn,en,Vt,Ht,zn]),[Bn,Vn]=G.useMemo(()=>[q!==void 0&&typeof qt==`number`?Math.floor(q/qt):0,q!==void 0&&typeof qt==`number`?-(q%qt):0],[q,qt]),Hn=G.useRef({height:1,width:1,x:0,y:0}),Un=G.useMemo(()=>({x:Hn.current.x,y:Bn,width:Hn.current.width??1,height:Hn.current.height??1,ty:Vn}),[Vn,Bn]),Wn=G.useRef(!1),[Gn,Kn,qn]=It(Un);Hn.current=Gn;let Xn=(Gn.height??1)>1;G.useLayoutEffect(()=>{if(q!==void 0&&u.current!==null&&Xn){if(u.current.scrollTop===q)return;u.current.scrollTop=q,u.current.scrollTop!==q&&qn(),Wn.current=!0}},[q,Xn,qn]);let Zn=(Gn.width??1)>1;G.useLayoutEffect(()=>{if(Qe!==void 0&&u.current!==null&&Zn){if(u.current.scrollLeft===Qe)return;u.current.scrollLeft=Qe,u.current.scrollLeft!==Qe&&qn(),Wn.current=!0}},[Qe,Zn,qn]);let Qn=Gn.x+J,$n=Gn.y,er=G.useRef(null),tr=G.useCallback(e=>{e===!0?er.current?.focus():window.requestAnimationFrame(()=>{er.current?.focus()})},[]),nr=nn?y+1:y,rr=G.useCallback(e=>{let t=J===0?e:e.map(e=>({...e,location:[e.location[0]-J,e.location[1]]})),n=F?.(t);if(n!==!0)for(let e of t)le?.(e.location,e.value);return n},[le,F,J]),[ir,ar]=G.useState(),or=Y.current!==void 0&&Y.current.range.width*Y.current.range.height>1?Y.current.range:void 0,sr=st?Y.current?.cell:void 0,cr=sr?.[0],lr=sr?.[1],ur=G.useMemo(()=>{if((V===void 0||V.length===0)&&(or??cr??lr??ir)===void 0)return;let e=[];if(V!==void 0)for(let t of V){let n=X.length-t.range.x-J;n>0&&e.push({color:t.color,range:{...t.range,x:t.range.x+J,width:Math.min(n,t.range.width)},style:t.style})}return ir!==void 0&&e.push({color:de(kn.accentColor,0),range:ir,style:`dashed`}),or!==void 0&&e.push({color:de(kn.accentColor,.5),range:or,style:`solid-outline`}),cr!==void 0&&lr!==void 0&&e.push({color:kn.accentColor,range:{x:cr,y:lr,width:1,height:1},style:`solid-outline`}),e.length>0?e:void 0},[ir,or,cr,lr,V,X.length,kn.accentColor,J]),dr=G.useRef(X);dr.current=X;let fr=G.useCallback(([e,t],n=!1)=>{let r=nn&&t===nr-1;if(e===0&&tn)return r?Xo:{kind:ye.Marker,allowOverlay:!1,checkboxStyle:Ht,checked:Y?.rows.hasIndex(t)===!0,markerKind:Rt===`clickable-number`?`number`:Rt,row:Bt+t,drawHandle:gt!==void 0,cursor:Rt===`clickable-number`?`pointer`:void 0};if(r){let t=e===J?Ye?.hint??``:``,n=dr.current[e];if(n?.trailingRowOptions?.disabled===!0)return Xo;{let e=n?.trailingRowOptions?.hint??t,r=n?.trailingRowOptions?.addIcon??Ye?.addIcon;return{kind:ye.NewRow,hint:e,allowOverlay:!1,icon:r}}}else{let r=e-J;if(n||ct?.strict===!0){let e=Hn.current,n=e.x>r||r>e.x+e.width||e.y>t||t>e.y+e.height||t>=br.current,i=r===e.extras?.selected?.[0]&&t===e.extras?.selected[1],a=!1;if(e.extras?.freezeRegions!==void 0){for(let n of e.extras.freezeRegions)if(Br(n,r,t)){a=!0;break}}if(n&&!i&&!a)return Xo}let i=b([r,t]);return J!==0&&i.span!==void 0&&(i={...i,span:[i.span[0]+J,i.span[1]+J]}),i}},[nn,nr,tn,Ht,Y?.rows,Rt,Bt,gt,J,Ye?.hint,Ye?.addIcon,ct?.strict,b]),pr=G.useCallback(e=>{let t=Re?.(e)??{name:e};return P!==void 0&&e!==``&&(t={icon:t.icon,name:t.name,overrideTheme:t.overrideTheme,actions:[...t.actions??[],{title:`Rename`,icon:`renameIcon`,onClick:e=>Mr({group:t.name,bounds:e.bounds})}]}),t},[Re,P]),mr=G.useCallback(e=>{let[t,n]=e.cell,r=X[t],i=r?.group===void 0?void 0:pr(r.group)?.overrideTheme,o=r?.themeOverride,s=m?.(n);a({...e,theme:ue(kn,i,o,s,e.content.themeOverride)})},[m,X,pr,kn]),hr=G.useCallback((e,t,n)=>{if(Y.current===void 0)return;let[r,i]=Y.current.cell,a=fr([r,i]);if(a.kind!==B.Boolean&&a.allowOverlay){let t=a;if(n!==void 0)switch(t.kind){case B.Number:{let e=M(()=>n===`-`?-0:Number.parseFloat(n),0);t={...t,data:Number.isNaN(e)?0:e};break}case B.Text:case B.Markdown:case B.Uri:t={...t,data:n};break}mr({target:e,content:t,initialValue:n,cell:[r,i],highlight:n===void 0,forceEditMode:n!==void 0})}else a.kind===B.Boolean&&t&&a.readonly!==!0&&(rr([{location:Y.current.cell,value:{...a,data:jo(a.data)}}]),er.current?.damage([{cell:Y.current.cell}]))},[fr,Y,rr,mr]),gr=G.useCallback((e,t)=>{let n=er.current?.getBounds(e,t);if(n===void 0||u.current===null)return;let r=fr([e,t]);r.allowOverlay&&mr({target:n,content:r,initialValue:void 0,highlight:!0,cell:[e,t],forceEditMode:!0})},[fr,mr]),_r=G.useCallback((e,t,n=`both`,r=0,i=0,a=void 0)=>{if(u.current!==null){let o=er.current,c=s.current,l=typeof e==`number`?e:e.unit===`cell`?e.amount:void 0,d=typeof t==`number`?t:t.unit===`cell`?t.amount:void 0,f=typeof e!=`number`&&e.unit===`px`?e.amount:void 0,p=typeof t!=`number`&&t.unit===`px`?t.amount:void 0;if(o!==null&&c!==null){let s={x:0,y:0,width:0,height:0},m=0,h=0;if((l!==void 0||d!==void 0)&&(s=o.getBounds((l??0)+J,d??0)??s,s.width===0||s.height===0))return;let g=c.getBoundingClientRect(),_=g.width/c.offsetWidth;if(f!==void 0&&(s={...s,x:f-g.left-u.current.scrollLeft,width:1}),p!==void 0&&(s={...s,y:p+g.top-u.current.scrollTop,height:1}),s!==void 0){let o={x:s.x-r,y:s.y-i,width:s.width+2*r,height:s.height+2*i},c=0;for(let e=0;e<Pe;e++)c+=Pn[e].width;let l=0,d=Xe+(on?1:0);d>0&&(l=pn(nr,d,qt));let f=c*_+g.left+J*en*_,p=g.right,v=g.top+Ln*_,y=g.bottom-l*_,b=s.width+r*2;switch(a?.hAlign){case`start`:p=f+b;break;case`end`:f=p-b;break;case`center`:f=Math.floor((f+p)/2)-b/2,p=f+b;break}let x=s.height+i*2;switch(a?.vAlign){case`start`:y=v+x;break;case`end`:v=y-x;break;case`center`:v=Math.floor((v+y)/2)-x/2,y=v+x;break}f>o.x?m=o.x-f:p<o.x+o.width&&(m=o.x+o.width-p),v>o.y?h=o.y-v:y<o.y+o.height&&(h=o.y+o.height-y),n===`vertical`||typeof e==`number`&&e<Pe?m=0:(n===`horizontal`||typeof t==`number`&&t>=nr-d)&&(h=0),(m!==0||h!==0)&&(_!==1&&(m/=_,h/=_),u.current.scrollTo(m+u.current.scrollLeft,h+u.current.scrollTop))}}}},[J,Xe,en,Ln,Pe,Pn,nr,on,qt]),vr=G.useRef(gr),yr=G.useRef(b),br=G.useRef(y);vr.current=gr,yr.current=b,br.current=y;let xr=G.useCallback(async(e,t=!0)=>{if(X[e]?.trailingRowOptions?.disabled===!0)return;let n=R?.(),r,i=!0;n!==void 0&&(r=await n,r===`top`&&(i=!1),typeof r==`number`&&(i=!1));let a=0,o=()=>{if(br.current<=y){a<500&&window.setTimeout(o,a),a=50+a*2;return}let n=typeof r==`number`?r:i?y:0;hi.current(e-J,n),En({cell:[e,n],range:{x:e,y:n,width:1,height:1}},!1,!1,`edit`);let s=yr.current([e-J,n]);s.allowOverlay&&z(s)&&s.readonly!==!0&&t&&window.setTimeout(()=>{vr.current(e,n)},0)};o()},[X,R,J,y,En]),Sr=G.useCallback(e=>{let t=Pn[e]?.trailingRowOptions?.targetColumn??Ye?.targetColumn;if(typeof t==`number`)return t+(tn?1:0);if(typeof t==`object`){let e=v.indexOf(t);if(e>=0)return e+(tn?1:0)}},[Pn,v,tn,Ye?.targetColumn]),Cr=G.useRef(),Z=G.useRef(),wr=G.useCallback((e,t)=>{let[n,r]=t;return ue(kn,X[n]?.themeOverride,m?.(r),e.themeOverride)},[m,X,kn]),Tr=G.useCallback(e=>{let t=La.value?e.metaKey:e.ctrlKey,n=t&&Ee===`multi`,r=t&&Te===`multi`,[i,o]=e.location,s=Y.columns,c=Y.rows,[l,u]=Y.current?.cell??[];if(e.kind===`cell`){if(Z.current=void 0,Dr.current=[i,o],i===0&&tn){if(nn===!0&&o===y||Rt===`number`||Ee===`none`)return;let r=fr(e.location);if(r.kind!==ye.Marker)return;if(gt!==void 0){let t=Nn(r);se(t?.kind===ye.Marker);let n=t?.onClick?.({...e,cell:r,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:wr(r,e.location),preventDefault:()=>void 0});if(n===void 0||n.checked===r.checked)return}a(void 0),tr();let i=c.hasIndex(o),s=Cr.current;if(Ee===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&s!==void 0&&c.hasIndex(s)){let e=[Math.min(s,o),Math.max(s,o)+1];n||Ie===`multi`?Dn(void 0,e,!0):Dn(H.fromSingleSelection(e),void 0,n)}else n||e.isTouch||Ie===`multi`?i?Dn(c.remove(o),void 0,!0):(Dn(void 0,o,!0),Cr.current=o):i&&c.length===1?Dn(H.empty(),void 0,t):(Dn(H.fromSingleSelection(o),void 0,t),Cr.current=o)}else if(i>=J&&nn&&o===y)xr(Sr(i)??i);else if(l!==i||u!==o){let n=fr(e.location),r=Nn(n);if(r?.onSelect!==void 0){let t=!1;if(r.onSelect({...e,cell:n,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>t=!0,theme:wr(n,e.location)}),t)return}let s=on&&o===y,c=on&&Y!==void 0&&Y.current?.cell[1]===y;if((e.shiftKey||e.isLongTouch===!0)&&l!==void 0&&u!==void 0&&Y.current!==void 0&&!c){if(s)return;let e=Math.min(i,l),n=Math.max(i,l),r=Math.min(o,u),a=Math.max(o,u);En({...Y.current,range:{x:e,y:r,width:n-e+1,height:a-r+1}},!0,t,`click`),Cr.current=void 0,tr()}else En({cell:[i,o],range:{x:i,y:o,width:1,height:1}},!0,t,`click`),Cr.current=void 0,a(void 0),tr()}}else if(e.kind===`header`)if(Dr.current=[i,o],a(void 0),tn&&i===0)Cr.current=void 0,Z.current=void 0,Ee===`multi`&&(c.length===y?Dn(H.empty(),void 0,t):Dn(H.fromSingleSelection([0,y]),void 0,t),tr());else{let n=Z.current;if(Te===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&n!==void 0&&s.hasIndex(n)){let e=[Math.min(n,i),Math.max(n,i)+1];r?On(void 0,e,t):On(H.fromSingleSelection(e),void 0,t)}else r?(s.hasIndex(i)?On(s.remove(i),void 0,t):On(void 0,i,t),Z.current=i):Te!==`none`&&(On(H.fromSingleSelection(i),void 0,t),Z.current=i);Cr.current=void 0,tr()}else e.kind===`group-header`?Dr.current=[i,o]:e.kind===`out-of-bounds`&&!e.isMaybeScrollbar&&(yn(Zo,!1),a(void 0),tr(),Ve?.(),Cr.current=void 0,Z.current=void 0)},[xr,Te,tr,Nn,Sr,fr,Y,tn,on,Ve,gt,J,Rt,Ee,Ie,y,En,yn,On,Dn,nn,wr]),Er=G.useRef(!1),Dr=G.useRef(),Or=G.useRef(Gn),kr=G.useRef(),Ar=G.useCallback(e=>{if(Pr.current=!1,Or.current=Hn.current,e.button!==0&&e.button!==1){kr.current=void 0;return}let t=performance.now();kr.current={button:e.button,time:t,location:e.location},e?.kind===`header`&&(Er.current=!0);let n=e.kind===`cell`&&e.isFillHandle;!n&&e.kind!==`cell`&&e.isEdge||(l({previousSelection:Y,fillHandle:n}),Dr.current=void 0,!e.isTouch&&e.button===0&&!n?Tr(e):!e.isTouch&&e.button===1&&(Dr.current=e.location))},[Y,Tr]),[jr,Mr]=G.useState(),Nr=G.useCallback(e=>{if(e.kind!==`group-header`||Te!==`multi`)return;let t=La.value?e.metaKey:e.ctrlKey,[n]=e.location,r=Y.columns;if(n<J)return;let i=X[n],a=n,o=n;for(let e=n-1;e>=J&&an(i.group,X[e].group);e--)a--;for(let e=n+1;e<X.length&&an(i.group,X[e].group);e++)o++;if(tr(),t)if(r.hasAll([a,o+1])){let e=r;for(let t=a;t<=o;t++)e=e.remove(t);On(e,void 0,t)}else On(void 0,[a,o+1],t);else On(H.fromSingleSelection([a,o+1]),void 0,t)},[Te,tr,Y.columns,X,J,On]),Pr=G.useRef(!1),Fr=G.useCallback(async e=>{if(hn!==void 0&&bn!==void 0){let t=Hn.current.y,n=Hn.current.height,r=hn({x:e,y:t,width:1,height:Math.min(n,y-t)},mn.current.signal);typeof r!=`object`&&(r=await r());let i=Pn[e-J],a=document.createElement(`canvas`).getContext(`2d`,{alpha:!1});if(a!==null){a.font=kn.baseFontFull;let t=Jn(a,kn,i,0,r,Ut,Wt,!1,Nn);bn?.(i,t.width,e,t.width)}}},[Pn,hn,Wt,kn,Ut,bn,J,y,Nn]),[Ir,Lr]=G.useState(),zr=G.useCallback(async(e,t)=>{let n=e.current?.range;if(n===void 0||hn===void 0||t.current===void 0)return;let r=t.current.range;if(C!==void 0){let e=!1;if(C({fillDestination:{...r,x:r.x-J},patternSource:{...n,x:n.x-J},preventDefault:()=>e=!0}),e)return}let i=hn(n,mn.current.signal);typeof i!=`object`&&(i=await i());let a=i,o=[];for(let e=0;e<r.width;e++)for(let t=0;t<r.height;t++){let i=[r.x+e,r.y+t];if(sn(i,n))continue;let s=a[t%n.height][e%n.width];we(s)||!z(s)||o.push({location:i,value:{...s}})}rr(o),er.current?.damage(o.map(e=>({cell:e.location})))},[hn,rr,C,J]),Hr=G.useCallback(()=>{Y.current===void 0||Y.current.range.width<=1||zr({...Y,current:{...Y.current,range:{...Y.current.range,width:1}}},Y)},[zr,Y]),Ur=G.useCallback(()=>{Y.current===void 0||Y.current.range.height<=1||zr({...Y,current:{...Y.current,range:{...Y.current.range,height:1}}},Y)},[zr,Y]),Wr=G.useCallback((e,t)=>{let n=c;if(l(void 0),ar(void 0),Lr(void 0),Er.current=!1,t)return;if(n?.fillHandle===!0&&Y.current!==void 0&&n.previousSelection?.current!==void 0){if(ir===void 0)return;let e={...Y,current:{...Y.current,range:Vr(n.previousSelection.current.range,ir)}};zr(n.previousSelection,e),yn(e,!0);return}let[r,i]=e.location,[a,o]=Dr.current??[],s=()=>{Pr.current=!0},u=t=>{let c=t.isTouch||a===r&&o===i;if(c&&x?.([r-J,i],{...t,preventDefault:s}),t.button===1)return!Pr.current;if(!Pr.current){let a=fr(e.location),o=Nn(a);if(o!==void 0&&o.onClick!==void 0&&c){let n=o.onClick({...t,cell:a,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:wr(a,e.location),preventDefault:s});n!==void 0&&!we(n)&&Se(n)&&(rr([{location:t.location,value:n}]),er.current?.damage([{cell:t.location}]))}if(Pr.current||Y.current===void 0)return!1;let l=!1;switch(a.activationBehaviorOverride??Fe){case`double-click`:case`second-click`:{if(n?.previousSelection?.current?.cell===void 0)break;let[e,a]=Y.current.cell,[o,s]=n.previousSelection.current.cell;l=r===e&&r===o&&i===a&&i===s&&(t.isDoubleClick===!0||Fe===`second-click`);break}case`single-click`:l=!0;break}if(l)return S?.([r-J,i]),hr(t.bounds,!1),!0}return!1},d=e.location[0]-J;if(e.isTouch){let t=Hn.current,n=Or.current;if(t.x!==n.x||t.y!==n.y)return;if(e.isLongTouch===!0){if(e.kind===`cell`&&cn(Y.current?.cell,e.location)){re?.([d,e.location[1]],{...e,preventDefault:s});return}else if(e.kind===`header`&&Y.columns.hasIndex(r)){ae?.(d,{...e,preventDefault:s});return}else if(e.kind===`group-header`){if(d<0)return;N?.(d,{...e,preventDefault:s});return}}e.kind===`cell`?u(e)||Tr(e):e.kind===`group-header`?ne?.(d,{...e,preventDefault:s}):(e.kind===`header`&&k?.(d,{...e,preventDefault:s}),Tr(e));return}if(e.kind===`header`){if(d<0)return;e.isEdge?e.isDoubleClick===!0&&Fr(r):e.button===0&&r===a&&i===o&&k?.(d,{...e,preventDefault:s})}if(e.kind===`group-header`){if(d<0)return;e.button===0&&r===a&&i===o&&(ne?.(d,{...e,preventDefault:s}),Pr.current||Nr(e))}e.kind===`cell`&&(e.button===0||e.button===1)&&u(e),Dr.current=void 0},[c,Y,J,ir,zr,yn,x,fr,Nn,Fe,wr,rr,S,hr,re,ae,N,Tr,ne,k,Fr,Nr]),Gr=G.useCallback(e=>{let t={...e,location:[e.location[0]-J,e.location[1]]};je?.(t),c!==void 0&&e.buttons===0&&(l(void 0),ar(void 0),Lr(void 0),Er.current=!1),Lr(t=>Er.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===t?.[0]&&e.scrollEdge[1]===t[1]?t:c===void 0||(kr.current?.location[0]??0)<J?void 0:e.scrollEdge)},[c,je,J]),Kr=G.useCallback((e,t)=>{Le?.(e-J,t)},[Le,J]),qr=Y?.current?.cell,Jr=G.useCallback((e,t,n,r,i,a)=>{Wn.current=!1;let o=qr;o!==void 0&&(o=[o[0]-J,o[1]]);let s=Pe===0?void 0:{x:0,y:e.y,width:Pe,height:e.height},c=[];s!==void 0&&c.push(s),Xe>0&&(c.push({x:e.x-J,y:y-Xe,width:e.width,height:Xe}),Pe>0&&c.push({x:0,y:y-Xe,width:Pe,height:Xe}));let l={x:e.x-J,y:e.y,width:e.width,height:nn&&e.y+e.height>=y?e.height-1:e.height,tx:i,ty:a,extras:{selected:o,freezeRegion:s,freezeRegions:c}};Hn.current=l,Kn(l),jn([t,n,r]),Ue?.(l,l.tx,l.ty,l.extras)},[qr,J,nn,y,Pe,Xe,Kn,Ue]),Yr=xt(be,G.useCallback((e,t)=>{be?.(e-J,t-J),Te!==`none`&&On(H.fromSingleSelection(t),void 0,!0)},[Te,be,J,On])),Xr=G.useRef(!1),Zr=G.useCallback(e=>{if(e.location[0]===0&&J>0){e.preventDefault();return}Ae?.({...e,location:[e.location[0]-J,e.location[1]]}),e.defaultPrevented()||(Xr.current=!0),l(void 0)},[Ae,J]),Qr=G.useCallback(()=>{Xr.current=!1},[]),$r=G.useRef(),ei=G.useCallback(e=>{if(!Ua(e,$r.current)&&($r.current=e,!(kr?.current?.button!==void 0&&kr.current.button>=1))){if(e.buttons!==0&&c!==void 0&&kr.current?.location[0]===0&&e.location[0]===0&&J===1&&Ee===`multi`&&c.previousSelection&&!c.previousSelection.rows.hasIndex(kr.current.location[1])&&Y.rows.hasIndex(kr.current.location[1])){let t=Math.min(kr.current.location[1],e.location[1]),n=Math.max(kr.current.location[1],e.location[1])+1;Dn(H.fromSingleSelection([t,n]),void 0,!1)}if(e.buttons!==0&&c!==void 0&&Y.current!==void 0&&!Xr.current&&!Er.current&&(Ce===`rect`||Ce===`multi-rect`)){let[t,n]=Y.current.cell,[r,i]=e.location;if(i<0&&(i=Hn.current.y),c.fillHandle===!0&&c.previousSelection?.current!==void 0){let e=c.previousSelection.current.range;i=Math.min(i,nn?y-1:y),ar(Rr(e,r,i,Ze))}else{if(nn&&n===y)return;if(nn&&i===y)if(e.kind===`out-of-bounds`)i--;else return;r=Math.max(r,J);let a=r-t,o=i-n,s={x:a>=0?t:r,y:o>=0?n:i,width:Math.abs(a)+1,height:Math.abs(o)+1};En({...Y.current,range:s},!0,!1,`drag`)}}Be?.({...e,location:[e.location[0]-J,e.location[1]]})}},[Ze,c,J,Ee,Y,Ce,Be,Dn,nn,y,En]);zo(Ir,u,G.useCallback(()=>{let e=$r.current;if(e===void 0)return;let[t,n]=e.scrollEdge,[r,i]=e.location,a=Hn.current;t===-1?r=a.extras?.freezeRegion?.x??a.x:t===1&&(r=a.x+a.width),n===-1?i=Math.max(0,a.y):n===1&&(i=Math.min(y-1,a.y+a.height)),r=(0,ka.default)(r,0,X.length-1),i=(0,ka.default)(i,0,y-1),ei({...e,location:[r,i]})},[X.length,ei,y]));let ti=G.useCallback(e=>{if(Y.current===void 0)return;let[t,n]=e,[r,i]=Y.current.cell,a=Y.current.range,o=a.x,s=a.x+a.width,c=a.y,l=a.y+a.height;if(n!==0)switch(n){case 2:l=y,c=i,_r(0,l,`vertical`);break;case-2:c=0,l=i+1,_r(0,c,`vertical`);break;case 1:c<i?(c++,_r(0,c,`vertical`)):(l=Math.min(y,l+1),_r(0,l,`vertical`));break;case-1:l>i+1?(l--,_r(0,l,`vertical`)):(c=Math.max(0,c-1),_r(0,c,`vertical`));break;default:j(n)}if(t!==0)if(t===2)s=X.length,o=r,_r(s-1-J,0,`horizontal`);else if(t===-2)o=J,s=r+1,_r(o-J,0,`horizontal`);else{let e=[];if(hn!==void 0){let t=hn({x:o,y:c,width:s-o-J,height:l-c},mn.current.signal);typeof t==`object`&&(e=Jo(t))}if(t===1){let t=!1;if(o<r){if(e.length>0){let n=(0,Wa.default)(o+1,r+1).find(t=>!e.includes(t-J));n!==void 0&&(o=n,t=!0)}else o++,t=!0;t&&_r(o,0,`horizontal`)}t||(s=Math.min(X.length,s+1),_r(s-1-J,0,`horizontal`))}else if(t===-1){let t=!1;if(s>r+1){if(e.length>0){let n=(0,Wa.default)(s-1,r,-1).find(t=>!e.includes(t-J));n!==void 0&&(s=n,t=!0)}else s--,t=!0;t&&_r(s-J,0,`horizontal`)}t||(o=Math.max(J,o-1),_r(o-J,0,`horizontal`))}else j(t)}En({cell:Y.current.cell,range:{x:o,y:c,width:s-o,height:l-c}},!0,!1,`keyboard-select`)},[hn,Y,X.length,J,y,_r,En]),ni=G.useCallback((e,t,n,r)=>{let i=nr-(n?0:1);if(e=(0,ka.default)(e,J,Pn.length-1+J),t=(0,ka.default)(t,0,i),e===qr?.[0]&&t===qr?.[1])return!1;if(r&&Y.current!==void 0){let n=[...Y.current.rangeStack];(Y.current.range.width>1||Y.current.range.height>1)&&n.push(Y.current.range),yn({...Y,current:{cell:[e,t],range:{x:e,y:t,width:1,height:1},rangeStack:n}},!0)}else En({cell:[e,t],range:{x:e,y:t,width:1,height:1}},!0,!1,`keyboard-nav`);return d.current!==void 0&&d.current[0]===e&&d.current[1]===t&&(d.current=void 0),_r(e-J,t),!0},[nr,J,Pn.length,qr,Y,_r,yn,En]),ri=G.useCallback((e,t)=>{i?.cell!==void 0&&e!==void 0&&Se(e)&&(rr([{location:i.cell,value:e}]),window.requestAnimationFrame(()=>{er.current?.damage([{cell:i.cell}])})),tr(!0),a(void 0);let[n,r]=t;if(Y.current!==void 0&&(n!==0||r!==0)){let t=Y.current.cell[1]===nr-1&&e!==void 0;ni((0,ka.default)(Y.current.cell[0]+n,0,X.length-1),(0,ka.default)(Y.current.cell[1]+r,0,nr-1),t,!1)}w?.(e,t)},[i?.cell,tr,Y,w,rr,nr,ni,X.length]),ii=G.useMemo(()=>`gdg-overlay-${qo++}`,[]),ai=G.useCallback(e=>{tr();let t=[];for(let n=e.x;n<e.x+e.width;n++)for(let r=e.y;r<e.y+e.height;r++){let e=b([n-J,r]);if(!e.allowOverlay&&e.kind!==B.Boolean)continue;let i;if(e.kind===B.Custom){let t=Nn(e),n=t?.provideEditor?.(e);t?.onDelete===void 0?he(n)&&(i=n?.deletedValue?.(e)):i=t.onDelete(e)}else (Se(e)&&e.allowOverlay||e.kind===B.Boolean)&&(i=Nn(e)?.onDelete?.(e));i!==void 0&&!we(i)&&Se(i)&&t.push({location:[n,r],value:i})}rr(t),er.current?.damage(t.map(e=>({cell:e.location})))},[tr,b,Nn,rr,J]),oi=i!==void 0,si=G.useCallback(e=>{let t=()=>{e.stopPropagation(),e.preventDefault()},n={didMatch:!1},{bounds:r}=e,i=Y.columns,s=Y.rows,c=$t;if(!oi&&Q(c.clear,e,n))yn(Zo,!1),Ve?.();else if(!oi&&Q(c.selectAll,e,n))yn({columns:H.empty(),rows:H.empty(),current:{cell:Y.current?.cell??[J,0],range:{x:J,y:0,width:v.length,height:y},rangeStack:[]}},!1);else if(Q(c.search,e,n))o?.current?.focus({preventScroll:!0}),un(!0);else if(Q(c.delete,e,n)){let e=Tn?.(Y)??!0;if(e!==!1){let t=e===!0?Y:e;if(t.current!==void 0){ai(t.current.range);for(let e of t.current.rangeStack)ai(e)}for(let e of t.rows)ai({x:J,y:e,width:v.length,height:1});for(let e of t.columns)ai({x:e,y:0,width:1,height:y})}}if(n.didMatch)return t(),!0;if(Y.current===void 0)return!1;let[l,u]=Y.current.cell,d=!1,f=!1;Q(c.scrollToSelectedCell,e,n)?hi.current(l-J,u):Te!==`none`&&Q(c.selectColumn,e,n)?i.hasIndex(l)?On(i.remove(l),void 0,!0):Te===`single`?On(H.fromSingleSelection(l),void 0,!0):On(void 0,l,!0):Ee!==`none`&&Q(c.selectRow,e,n)?s.hasIndex(u)?Dn(s.remove(u),void 0,!0):Ee===`single`?Dn(H.fromSingleSelection(u),void 0,!0):Dn(void 0,u,!0):!oi&&r!==void 0&&Q(c.activateCell,e,n)?u===y&&nn?window.setTimeout(()=>{xr(Sr(l)??l)},0):(S?.([l-J,u]),hr(r,!0)):Y.current.range.height>1&&Q(c.downFill,e,n)?Ur():Y.current.range.width>1&&Q(c.rightFill,e,n)?Hr():Q(c.goToNextPage,e,n)?u+=Math.max(1,Hn.current.height-4):Q(c.goToPreviousPage,e,n)?u-=Math.max(1,Hn.current.height-4):Q(c.goToFirstCell,e,n)?(a(void 0),u=0,l=0):Q(c.goToLastCell,e,n)?(a(void 0),u=2**53-1,l=2**53-1):Q(c.selectToFirstCell,e,n)?(a(void 0),ti([-2,-2])):Q(c.selectToLastCell,e,n)?(a(void 0),ti([2,2])):oi?(Q(c.closeOverlay,e,n)&&a(void 0),Q(c.acceptOverlayDown,e,n)&&(a(void 0),u++),Q(c.acceptOverlayUp,e,n)&&(a(void 0),u--),Q(c.acceptOverlayLeft,e,n)&&(a(void 0),l--),Q(c.acceptOverlayRight,e,n)&&(a(void 0),l++)):(Q(c.goDownCell,e,n)?u+=1:Q(c.goUpCell,e,n)?--u:Q(c.goRightCell,e,n)?l+=1:Q(c.goLeftCell,e,n)?--l:Q(c.goDownCellRetainSelection,e,n)?(u+=1,d=!0):Q(c.goUpCellRetainSelection,e,n)?(--u,d=!0):Q(c.goRightCellRetainSelection,e,n)?(l+=1,d=!0):Q(c.goLeftCellRetainSelection,e,n)?(--l,d=!0):Q(c.goToLastRow,e,n)?u=y-1:Q(c.goToFirstRow,e,n)?u=-(2**53-1):Q(c.goToLastColumn,e,n)?l=2**53-1:Q(c.goToFirstColumn,e,n)?l=-(2**53-1):(Ce===`rect`||Ce===`multi-rect`)&&(Q(c.selectGrowDown,e,n)?ti([0,1]):Q(c.selectGrowUp,e,n)?ti([0,-1]):Q(c.selectGrowRight,e,n)?ti([1,0]):Q(c.selectGrowLeft,e,n)?ti([-1,0]):Q(c.selectToLastRow,e,n)?ti([0,2]):Q(c.selectToFirstRow,e,n)?ti([0,-2]):Q(c.selectToLastColumn,e,n)?ti([2,0]):Q(c.selectToFirstColumn,e,n)&&ti([-2,0])),f=n.didMatch);let p=ni(l,u,!1,d),m=n.didMatch;return m&&(p||!f||Tt)&&t(),m},[oi,Y,$t,Te,Ee,Ce,J,y,ni,yn,Ve,v.length,Tn,Tt,ai,On,Dn,nn,Sr,xr,S,hr,Ur,Hr,ti]),ci=G.useCallback(e=>{let t=!1;if(ge!==void 0&&ge({...e,cancel:()=>{t=!0}}),t||si(e)||Y.current===void 0)return;let[n,r]=Y.current.cell,i=Hn.current;if(L&&!e.metaKey&&!e.ctrlKey&&Y.current!==void 0&&e.key.length===1&&/[ -~]/g.test(e.key)&&e.bounds!==void 0&&z(b([n-J,Math.max(0,Math.min(r,y-1))]))){if((!nn||r!==y)&&(i.y>r||r>i.y+i.height||i.x>n||n>i.x+i.width))return;hr(e.bounds,!0,e.key),e.stopPropagation(),e.preventDefault()}},[L,ge,si,Y,b,J,y,nn,hr]),li=G.useCallback((e,t)=>{let n=e.location[0]-J;if(e.kind===`header`&&ae?.(n,{...e,preventDefault:t}),e.kind===`group-header`){if(n<0)return;N?.(n,{...e,preventDefault:t})}if(e.kind===`cell`){let[r,i]=e.location;re?.([n,i],{...e,preventDefault:t}),rn(Y,e.location)||ni(r,i,!1,!1)}},[Y,re,N,ae,J,ni]),ui=G.useCallback(async e=>{if(!$t.paste)return;function t(e,t,n,r){let i=typeof n==`object`?n?.join(`
|
|
130
|
+
`)??``:n?.toString()??``;if(!we(e)&&z(e)&&e.readonly!==!0){let a=T?.(i,e);if(a!==void 0&&Se(a))return{location:t,value:a};let o=Nn(e);if(o===void 0)return;if(o.kind===B.Custom){se(e.kind===B.Custom);let n=o.onPaste?.(i,e.data);return n===void 0?void 0:{location:t,value:{...e,data:n}}}else{let a=o.onPaste?.(i,e,{formatted:r,formattedString:typeof r==`string`?r:r?.join(`
|
|
131
|
+
`),rawValue:n});return a===void 0?void 0:(se(a.kind===e.kind),{location:t,value:a})}}}let n=Y.columns,r=Y.rows,i=u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,a;if(Y.current===void 0?n.length===1?a=[n.first()??0,0]:r.length===1&&(a=[J,r.first()??0]):a=[Y.current.range.x,Y.current.range.y],i&&a!==void 0){let n,r,i=`text/plain`,o=`text/html`;if(navigator.clipboard.read!==void 0){let e=await navigator.clipboard.read();for(let t of e){if(t.types.includes(o)){let e=Eo(await(await t.getType(o)).text());if(e!==void 0){n=e;break}}t.types.includes(i)&&(r=await(await t.getType(i)).text())}}else if(navigator.clipboard.readText!==void 0)r=await navigator.clipboard.readText();else if(e!==void 0&&e?.clipboardData!==null)e.clipboardData.types.includes(o)&&(n=Eo(e.clipboardData.getData(o))),n===void 0&&e.clipboardData.types.includes(i)&&(r=e.clipboardData.getData(i));else return;let[s,c]=a,l=[];do{if(Me===void 0){let e=fr(a),i=r??n?.map(e=>e.map(e=>e.rawValue).join(` `)).join(` `)??``,o=t(e,a,i,void 0);o!==void 0&&l.push(o);break}if(n===void 0){if(r===void 0)return;n=ko(r)}if(Me===!1||typeof Me==`function`&&Me?.([a[0]-J,a[1]],n.map(e=>e.map(e=>e.rawValue?.toString()??``)))!==!0)return;for(let[e,r]of n.entries()){if(e+c>=y)break;for(let[n,i]of r.entries()){let r=[n+s,e+c],[a,o]=r;if(a>=X.length||o>=nr)continue;let u=t(fr(r),r,i.rawValue,i.formatted);u!==void 0&&l.push(u)}}}while(!1);rr(l),er.current?.damage(l.map(e=>({cell:e.location})))}},[T,Nn,fr,Y,$t.paste,X.length,rr,nr,Me,J,y]);bt(`paste`,ui,f,!1,!0);let di=G.useCallback(async(e,t)=>{if(!$t.copy)return;let n=t===!0||u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,r=Y.columns,i=Y.rows,a=(t,n)=>{Ao(Ne?[n.map(e=>({kind:B.Text,data:v[e].title,displayData:v[e].title,allowOverlay:!1})),...t]:t,n,e)};if(n&&hn!==void 0){if(Y.current!==void 0){let e=hn(Y.current.range,mn.current.signal);typeof e!=`object`&&(e=await e()),a(e,(0,Wa.default)(Y.current.range.x-J,Y.current.range.x+Y.current.range.width-J))}else if(i!==void 0&&i.length>0){let e=[...i].map(e=>{let t=hn({x:J,y:e,width:v.length,height:1},mn.current.signal);return typeof t==`object`?t[0]:t().then(e=>e[0])});e.some(e=>e instanceof Promise)?a(await Promise.all(e),(0,Wa.default)(v.length)):a(e,(0,Wa.default)(v.length))}else if(r.length>0){let e=[],t=[];for(let n of r){let r=hn({x:n,y:0,width:1,height:y},mn.current.signal);typeof r!=`object`&&(r=await r()),e.push(r),t.push(n-J)}e.length===1?a(e[0],t):a(e.reduce((e,t)=>e.map((e,n)=>[...e,...t[n]])),t)}}},[v,hn,Y,$t.copy,J,y,Ne]);bt(`copy`,di,f,!1,!1),bt(`cut`,G.useCallback(async e=>{if($t.cut&&(u.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0)&&(await di(e),Y.current!==void 0)){let e={current:{cell:Y.current.cell,range:Y.current.range,rangeStack:[]},rows:H.empty(),columns:H.empty()},t=Tn?.(e);if(t===!1||(e=t===!0?e:t,e.current===void 0))return;ai(e.current.range)}},[ai,Y,$t.cut,di,Tn]),f,!1,!1);let fi=G.useCallback((e,t)=>{if(I!==void 0){J!==0&&(e=e.map(e=>[e[0]-J,e[1]])),I(e,t);return}if(e.length===0||t===-1)return;let[n,r]=e[t];d.current!==void 0&&d.current[0]===n&&d.current[1]===r||(d.current=[n,r],ni(n,r,!1,!1))},[I,J,ni]),[pi,mi]=We?.current?.cell??[],hi=G.useRef(_r);hi.current=_r,G.useLayoutEffect(()=>{!Wn.current&&pi!==void 0&&mi!==void 0&&(pi!==vn.current?.current?.cell[0]||mi!==vn.current?.current?.cell[1])&&hi.current(pi,mi),Wn.current=!1},[pi,mi]);let gi=Y.current!==void 0&&(Y.current.cell[0]>=X.length||Y.current.cell[1]>=nr);G.useLayoutEffect(()=>{gi&&yn(Zo,!1)},[gi,yn]);let _i=G.useMemo(()=>nn===!0&&Ye?.tint===!0?H.fromSingleSelection(nr-1):H.empty(),[nr,nn,Ye?.tint]),vi=G.useCallback(e=>typeof $e==`boolean`?$e:$e?.(e-J)??!0,[J,$e]),yi=G.useMemo(()=>{if(jr===void 0||s.current===null)return null;let{bounds:e,group:t}=jr,n=s.current.getBoundingClientRect();return G.createElement(fo,{bounds:e,group:t,canvasBounds:n,onClose:()=>Mr(void 0),onFinish:e=>{Mr(void 0),P?.(t,e)}})},[P,jr]),bi=Math.min(X.length,Pe+(tn?1:0));G.useImperativeHandle(t,()=>({appendRow:(e,t)=>xr(e+J,t),updateCells:e=>(J!==0&&(e=e.map(e=>({cell:[e.cell[0]+J,e.cell[1]]}))),er.current?.damage(e)),getBounds:(e,t)=>{if(!(s?.current===null||u?.current===null)){if(e===void 0&&t===void 0){let e=s.current.getBoundingClientRect(),t=e.width/u.current.clientWidth;return{x:e.x-u.current.scrollLeft*t,y:e.y-u.current.scrollTop*t,width:u.current.scrollWidth*t,height:u.current.scrollHeight*t}}return er.current?.getBounds((e??0)+J,t)}},focus:()=>er.current?.focus(),emit:async e=>{switch(e){case`delete`:ci({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,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:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,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:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`d`,keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`copy`:await di(void 0,!0);break;case`paste`:await ui();break}},scrollTo:_r,remeasureColumns:e=>{for(let t of e)Fr(t+J)}}),[xr,Fr,di,ci,ui,J,_r]);let[xi,Si]=qr??[],Ci=G.useCallback(e=>{let[t,n]=e;if(n===-1){Te!==`none`&&(On(H.fromSingleSelection(t),void 0,!1),tr());return}xi===t&&Si===n||(En({cell:e,range:{x:t,y:n,width:1,height:1}},!0,!1,`keyboard-nav`),_r(t,n))},[Te,tr,_r,xi,Si,En,On]),[wi,Ti]=G.useState(!1),Ei=G.useRef((0,yt.default)(e=>{Ti(e)},5)),Di=G.useCallback(()=>{Ei.current(!0),Y.current===void 0&&Y.columns.length===0&&Y.rows.length===0&&c===void 0&&En({cell:[J,$n],range:{x:J,y:$n,width:1,height:1}},!0,!1,`keyboard-select`)},[$n,Y,c,J,En]),Oi=G.useCallback(()=>{Ei.current(!1)},[]),[ki,Ai]=G.useMemo(()=>{let e,t=ct?.scrollbarWidthOverride??Pt(),n=y+(nn?1:0);if(typeof qt==`number`)e=Ln+n*qt;else{let t=0,r=Math.min(n,10);for(let e=0;e<r;e++)t+=qt(e);t=Math.floor(t/r),e=Ln+n*t}e+=t;let r=X.reduce((e,t)=>t.width+e,0)+t;return[`${Math.min(1e5,r)}px`,`${Math.min(1e5,e)}px`]},[X,ct?.scrollbarWidthOverride,qt,y,nn,Ln]),ji=G.useMemo(()=>ee(kn),[kn]);return G.createElement(ce.Provider,{value:kn},G.createElement(Io,{style:ji,className:ie,inWidth:g??ki,inHeight:_??Ai},G.createElement(co,{fillHandle:ot,drawFocusRing:st,experimental:ct,fixedShadowX:lt,fixedShadowY:ut,getRowThemeOverride:m,headerIcons:dt,imageWindowLoader:ft,initialSize:pt,isDraggable:mt,onDragLeave:ht,onRowMoved:gt,overscrollX:Zt,overscrollY:Qt,preventDiagonalScrolling:St,rightElement:Ct,rightElementProps:wt,smoothScrollX:Et,smoothScrollY:Dt,className:ie,enableGroups:In,onCanvasFocused:Di,onCanvasBlur:Oi,canvasRef:s,onContextMenu:li,theme:kn,cellXOffset:Qn,cellYOffset:$n,accessibilityHeight:Gn.height,onDragEnd:Qr,columns:X,nonGrowWidth:Fn,drawHeader:Cn,onColumnProposeMove:te,drawCell:wn,disabledRows:_i,freezeColumns:bi,lockColumns:J,firstColAccessible:J===0,getCellContent:fr,minColumnWidth:Ut,maxColumnWidth:Wt,searchInputRef:o,showSearch:dn,onSearchClose:fn,highlightRegions:ur,getCellsForSelection:hn,getGroupDetails:pr,headerHeight:Jt,isFocused:wi,groupHeaderHeight:In?Yt:0,freezeTrailingRows:Xe+(nn&&Ye?.sticky===!0?1:0),hasAppendRow:nn,onColumnResize:bn,onColumnResizeEnd:xn,onColumnResizeStart:Sn,onCellFocused:Ci,onColumnMoved:Yr,onDragStart:Zr,onHeaderMenuClick:Kr,onItemHovered:ei,isFilling:c?.fillHandle===!0,onMouseMove:Gr,onKeyDown:ci,onKeyUp:_e,onMouseDown:Ar,onMouseUp:Wr,onDragOverCell:et,onDrop:tt,onSearchResultsChanged:fi,onVisibleRegionChanged:Jr,clientSize:An,rowHeight:qt,searchResults:fe,searchValue:me,onSearchValueChange:pe,rows:nr,scrollRef:u,selection:Y,translateX:Gn.tx,translateY:Gn.ty,verticalBorder:vi,gridRef:er,getCellRenderer:Nn}),yi,i!==void 0&&G.createElement(G.Suspense,{fallback:null},G.createElement(Ko,{...i,validateCell:_n,bloom:O,id:ii,getCellRenderer:Nn,className:ct?.isSubGrid===!0?`click-outside-ignore`:void 0,provideEditor:K,imageEditorOverride:p,onFinishEditing:ri,markdownDivCreateNode:h,isOutsideClick:Nt}))))}),$o=20,es={getAccessibilityString:e=>e.data?.toString()??`false`,kind:B.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>ts(e,e.cell.data,pe(e.cell),e.cell.maxSize??$o),onDelete:e=>({...e,data:!1}),onClick:e=>{let{cell:t,posX:n,posY:r,bounds:i,theme:a}=e,{width:o,height:s,x:c,y:l}=i,u=t.maxSize??$o,d=Math.floor(i.y+s/2),f=Et(u,s,a.cellVerticalPadding),p=wt(Tt(t.contentAlign??`center`,c,o,a.cellHorizontalPadding,f),d,f),m=Dt(c+n,l+r,p);if(pe(t)&&m)return{...t,data:jo(t.data)}},onPaste:(e,t)=>{let n=null;return e.toLowerCase()===`true`?n=!0:e.toLowerCase()===`false`?n=!1:e.toLowerCase()===`indeterminate`&&(n=void 0),n===t.data?void 0:{...t,data:n}}};function ts(e,t,n,r){if(!n&&t===null)return;let{ctx:i,hoverAmount:a,theme:o,rect:s,highlighted:c,hoverX:l,hoverY:u,cell:{contentAlign:d}}=e,{x:f,y:p,width:m,height:h}=s,g=.35,_=n?1-g+g*a:.4;t===null&&(_*=a),_!==0&&(i.globalAlpha=_,$r(i,o,t,f,p,m,h,c,l,u,r,d),i.globalAlpha=1)}var ns=W(`div`)({name:`BubblesOverlayEditorStyle`,class:`gdg-b1ygi5by`,propsAsIs:!1}),rs=e=>{let{bubbles:t}=e;return G.createElement(ns,null,t.map((e,t)=>G.createElement(`div`,{key:t,className:`boe-bubble`},e)),G.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))},is={getAccessibilityString:e=>Lt(e.data),kind:B.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n).width+t+20,0)+2*n.cellHorizontalPadding-4,draw:e=>os(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return G.createElement(rs,{bubbles:t.data})},onPaste:()=>void 0},as=4;function os(e,t){let{rect:n,theme:r,ctx:i,highlighted:a}=e,{x:o,y:s,width:c,height:l}=n,u=as,d=o+r.cellHorizontalPadding,f=[];for(let e of t){if(d>o+c)break;let t=Sn(e,i,r.baseFontFull).width;f.push({x:d,width:t}),d+=t+16+u}i.beginPath();for(let e of f)Fn(i,e.x,s+(l-20)/2,e.width+16,20,r.roundingRadius??20/2);i.fillStyle=a?r.bgBubbleSelected:r.bgBubble,i.fill();for(let[e,n]of f.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[e],n.x+8,s+l/2+wn(i,r))}var ss=W(`div`)({name:`DrilldownOverlayEditorStyle`,class:`gdg-d4zsq0x`,propsAsIs:!1}),cs=e=>{let{drilldowns:t}=e;return G.createElement(ss,null,t.map((e,t)=>G.createElement(`div`,{key:t,className:`doe-bubble`},e.img!==void 0&&G.createElement(`img`,{src:e.img}),G.createElement(`div`,null,e.text))))},ls={getAccessibilityString:e=>Lt(e.data.map(e=>e.text)),kind:B.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,n)=>e.measureText(n.text).width+t+20+(n.img===void 0?0:18),0)+2*n.cellHorizontalPadding-4,draw:e=>ps(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return G.createElement(cs,{drilldowns:t.data})},onPaste:()=>void 0},us=4,ds={};function fs(e,t,n,r){let i=Math.ceil(window.devicePixelRatio),a=n-10,o=n*i,s=r+5,c=r*3,l=(c+10)*i,u=`${e},${t},${i},${n}`;if(ds[u]!==void 0)return{el:ds[u],height:o,width:l,middleWidth:4*i,sideWidth:s*i,padding:5*i,dpr:i};let d=document.createElement(`canvas`),f=d.getContext(`2d`);return f===null?null:(d.width=l,d.height=o,f.scale(i,i),ds[u]=d,f.beginPath(),Fn(f,5,5,c,a,r),f.shadowColor=`rgba(24, 25, 34, 0.4)`,f.shadowBlur=1,f.fillStyle=e,f.fill(),f.shadowColor=`rgba(24, 25, 34, 0.3)`,f.shadowOffsetY=1,f.shadowBlur=5,f.fillStyle=e,f.fill(),f.shadowOffsetY=0,f.shadowBlur=0,f.shadowBlur=0,f.beginPath(),Fn(f,5.5,5.5,c,a,r),f.strokeStyle=t,f.lineWidth=1,f.stroke(),{el:d,height:o,width:l,sideWidth:s*i,middleWidth:r*i,padding:5*i,dpr:i})}function ps(e,t){let{rect:n,theme:r,ctx:i,imageLoader:a,col:o,row:s}=e,{x:c,width:l}=n,u=r.baseFontFull,d=jn(i,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-f)/2),m=f-10,h=us,g=c+r.cellHorizontalPadding,_=r.roundingRadius??6,v=fs(r.bgCell,r.drilldownBorder,f,_),y=[];for(let e of t){if(g>c+l)break;let t=Sn(e.text,i,u).width,n=0;e.img!==void 0&&a.loadOrGetImage(e.img,o,s)!==void 0&&(n=m-8+4);let r=t+n+16;y.push({x:g,width:r}),g+=r+h}if(v!==null){let{el:e,height:t,middleWidth:n,sideWidth:r,width:a,dpr:o,padding:s}=v,c=r/o,l=s/o;for(let o of y){let s=Math.floor(o.x),u=Math.floor(o.width),d=u-(c-l)*2;i.imageSmoothingEnabled=!1,i.drawImage(e,0,0,r,t,s-l,p,c,f),d>0&&i.drawImage(e,r,0,n,t,s+(c-l),p,d,f),i.drawImage(e,a-r,0,r,t,s+u-(c-l),p,c,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(let[e,n]of y.entries()){let c=t[e],l=n.x+8;if(c.img!==void 0){let e=a.loadOrGetImage(c.img,o,s);if(e!==void 0){let t=m-8,n=0,a=0,o=e.width,s=e.height;o>s?(n+=(o-s)/2,o=s):s>o&&(a+=(s-o)/2,s=o),i.beginPath(),Fn(i,l,p+f/2-t/2,t,t,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(e,n,a,o,s,l,p+f/2-t/2,t,t),i.restore(),l+=t+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(c.text,l,p+f/2+wn(i,r))}}var ms={getAccessibilityString:e=>e.data.join(`, `),kind:B.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>gs(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=>{let{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??Bt;return G.createElement(i,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:e=>{n({...t,data:[e]})}})},onPaste:(e,t)=>{e=e.trim();let n=e.split(`,`).map(e=>{try{return new URL(e),e}catch{return}}).filter(e=>e!==void 0);if(!(n.length===t.data.length&&n.every((e,n)=>e===t.data[n])))return{...t,data:n}}},hs=4;function gs(e,t,n,r){let{rect:i,col:a,row:o,theme:s,ctx:c,imageLoader:l}=e,{x:u,y:d,height:f,width:p}=i,m=f-s.cellVerticalPadding*2,h=[],g=0;for(let e=0;e<t.length;e++){let n=t[e];if(n.length===0)continue;let r=l.loadOrGetImage(n,a,o);if(r!==void 0){h[e]=r;let t=r.width*(m/r.height);g+=t+hs}}if(g===0)return;g-=hs;let _=u+s.cellHorizontalPadding;r===`right`?_=Math.floor(u+p-s.cellHorizontalPadding-g):r===`center`&&(_=Math.floor(u+p/2-g/2));for(let e of h){if(e===void 0)continue;let t=e.width*(m/e.height);n>0&&(c.beginPath(),Fn(c,_,d+s.cellVerticalPadding,t,m,n),c.save(),c.clip()),c.drawImage(e,_,d+s.cellVerticalPadding,t,m),n>0&&c.restore(),_+=t+hs}}function _s(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}var vs={getAccessibilityString:()=>``,kind:B.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{let{cell:t,col:n,row:r,ctx:i,rect:a,theme:o}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(_s(n,r)*t.skeletonWidthVariability));let c=o.cellHorizontalPadding,l=t.skeletonHeight??Math.min(18,a.height-2*o.cellVerticalPadding);Fn(i,a.x+c,a.y+(a.height-l)/2,s,l,o.roundingRadius??3),i.fillStyle=de(o.textDark,.1),i.fill()},onPaste:()=>void 0},ys=()=>e=>e.targetWidth,bs=W(`div`)({name:`MarkdownOverlayEditorStyle`,class:`gdg-m1pnx84e`,propsAsIs:!1,vars:{"m1pnx84e-0":[ys(),`px`]}}),xs=e=>{let{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:a,onFinish:o,validatedSelection:s}=e,c=t.data,l=t.readonly===!0,[u,d]=G.useState(c===``||r),f=G.useCallback(()=>{d(e=>!e)},[]),p=c?`gdg-ml-6`:``;return u?G.createElement(bs,{targetWidth:a.width-20},G.createElement(qt,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:e=>{e.key===`Enter`&&e.stopPropagation()},onChange:n}),G.createElement(`div`,{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>o(t)},G.createElement(kt,null))):G.createElement(bs,{targetWidth:a.width},G.createElement(Ht,{contents:c,createNode:i}),!l&&G.createElement(G.Fragment,null,G.createElement(`div`,{className:`spacer`}),G.createElement(`div`,{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:f},G.createElement(Ot,null))),G.createElement(`textarea`,{className:`gdg-md-edit-textarea gdg-input`,autoFocus:!0}))},Ss={getAccessibilityString:e=>e.data?.toString()??``,kind:B.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:kn,measure:(e,t,n)=>{let r=t.data.split(`
|
|
132
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Pn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:``}),provideEditor:()=>e=>{let{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:a,forceEditMode:o,validatedSelection:s}=e;return G.createElement(xs,{onFinish:i,targetRect:r,value:n,validatedSelection:s,onChange:e=>t({...n,data:e.target.value}),forceEditMode:o,createNode:a})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Cs={getAccessibilityString:e=>e.row.toString(),kind:ye.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:ws,measure:()=>44,draw:e=>Es(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:n,posX:r,posY:i}=e,{width:a,height:o}=t,s=n.drawHandle?7+(a-7)/2:a/2,c=o/2;if(Math.abs(r-s)<=10&&Math.abs(i-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>void 0};function ws(e,t){let{ctx:n,theme:r}=e,i=r.markerFontFull,a=t??{};return a?.font!==i&&(n.font=i,a.font=i),a.deprep=Ts,n.textAlign=`center`,a}function Ts(e){let{ctx:t}=e;t.textAlign=`start`}function Es(e,t,n,r,i,a){let{ctx:o,rect:s,hoverAmount:c,theme:l}=e,{x:u,y:d,width:f,height:p}=s,m=n?1:r===`checkbox-visible`?.6+.4*c:c;if(r!==`number`&&m>0){o.globalAlpha=m;let e=7*(n?c:1);if($r(o,l,n,i?u+e:u,d,i?f-e:f,p,!0,void 0,void 0,18,`center`,a),i){o.globalAlpha=c,o.beginPath();for(let e of[3,6])for(let t of[-5,-1,3])o.rect(u+e,d+p/2+t,2,2);o.fillStyle=l.textLight,o.fill(),o.beginPath()}o.globalAlpha=1}if(r===`number`||r===`both`&&!n){let e=t.toString(),n=l.markerFontFull,i=u+f/2;r===`both`&&c!==0&&(o.globalAlpha=1-c),o.fillStyle=l.textLight,o.font=n,o.fillText(e,i,d+p/2+wn(o,n)),c!==0&&(o.globalAlpha=1)}}var Ds={getAccessibilityString:()=>``,kind:ye.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Os(e,e.cell.hint,e.cell.icon),onPaste:()=>void 0};function Os(e,t,n){let{ctx:r,rect:i,hoverAmount:a,theme:o,spriteManager:s}=e,{x:c,y:l,width:u,height:d}=i;r.beginPath(),r.globalAlpha=a,r.rect(c+1,l+1,u,d-2),r.fillStyle=o.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();let f=t!==``,p=0;if(n!==void 0){let e=d-8,t=c+8/2,i=l+8/2;s.drawSprite(n,`normal`,r,t,i,e,o,f?1:a),p=e}else{p=24;let e=f?12:a*12,t=f?0:(1-a)*12*.5,n=o.cellHorizontalPadding+4;e>0&&(r.moveTo(c+n+t,l+d/2),r.lineTo(c+n+t+e,l+d/2),r.moveTo(c+n+t+e*.5,l+d/2-e*.5),r.lineTo(c+n+t+e*.5,l+d/2+e*.5),r.lineWidth=2,r.strokeStyle=o.bgIconHeader,r.lineCap=`round`,r.stroke())}r.fillStyle=o.textMedium,r.fillText(t,p+c+o.cellHorizontalPadding+.5,l+d/2+wn(r,o)),r.beginPath()}var ks=G.lazy(async()=>await x(()=>import(`./number-overlay-editor-DtUBprPW.js`),__vite__mapDeps([6,1,2,3]))),As={getAccessibilityString:e=>e.data?.toString()??``,kind:B.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:kn,draw:e=>Pn(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=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return G.createElement(G.Suspense,{fallback:null},G.createElement(ks,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:e=>n({...r,data:Number.isNaN(e.floatValue??0)?0:e.floatValue})}))},onPaste:(e,t,n)=>{let 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}}},js={getAccessibilityString:()=>``,measure:()=>108,kind:B.Protected,needsHover:!1,needsHoverPosition:!1,draw:Ms,onPaste:()=>void 0};function Ms(e){let{ctx:t,theme:n,rect:r}=e,{x:i,y:a,height:o}=r;t.beginPath();let s=2.5,c=i+n.cellHorizontalPadding+s,l=a+o/2,u=Math.cos(Ct(30))*s,d=Math.sin(Ct(30))*s;for(let e=0;e<12;e++)t.moveTo(c,l-s),t.lineTo(c,l+s),t.moveTo(c+u,l-d),t.lineTo(c-u,l+d),t.moveTo(c-u,l-d),t.lineTo(c+u,l+d),c+=8;t.lineWidth=1.1,t.lineCap=`square`,t.strokeStyle=n.textLight,t.stroke()}var Ns={getAccessibilityString:e=>e.data?.toString()??``,kind:B.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>kn(e,t,e.theme.textLight),draw:e=>Pn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return G.createElement(qt,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:e=>n({...r,data:e.target.value})})},onPaste:()=>void 0},Ps={getAccessibilityString:e=>e.data?.toString()??``,kind:B.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:kn,useLabel:!0,draw:e=>{let{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:a,theme:o,overrideCursor:s}=e,{displayData:c,contentAlign:l,hoverEffect:u,allowWrapping:d}=t;if(u===!0&&n>0){i.textBaseline=`alphabetic`;let e=o.cellHorizontalPadding,t=o.cellVerticalPadding,r=Sn(c,i,o.baseFontFull,`alphabetic`),l=a.height-t,u=Math.min(l,r.actualBoundingBoxAscent*2.5);i.beginPath(),Fn(i,a.x+e/2,a.y+(a.height-u)/2+1,r.width+e*3,u-1,o.roundingRadius??4),i.globalAlpha=n,i.fillStyle=de(o.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=o.textDark,i.textBaseline=`middle`,s?.(`text`)}Pn(e,c,l,d,r)},measure:(e,t,n)=>{let r=t.displayData.split(`
|
|
133
|
+
`,t.allowWrapping===!0?void 0:1),i=0;for(let t of r)i=Math.max(i,e.measureText(t).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:``}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:n,onChange:r,value:i,validatedSelection:a}=t;return G.createElement(qt,{style:e.allowWrapping===!0?{padding:`3px 8.5px`}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:a,onChange:e=>r({...i,data:e.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Fs=W(`div`)({name:`UriOverlayEditorStyle`,class:`gdg-u1rrojo`,propsAsIs:!1}),Is=e=>{let{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:a,preview:o}=e,[s,c]=G.useState(!i&&(t===``||r)),l=G.useCallback(()=>{c(!0)},[]);return s?G.createElement(qt,{validatedSelection:a,highlight:!0,autoFocus:!0,value:t,onChange:n}):G.createElement(Fs,null,G.createElement(`a`,{className:`gdg-link-area`,href:t,target:`_blank`,rel:`noopener noreferrer`},o),!i&&G.createElement(`div`,{className:`gdg-edit-icon`,onClick:l},G.createElement(Ot,null)),G.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};function Ls(e,t,n,r){let i=n.cellHorizontalPadding,a=t.height/2-e.actualBoundingBoxAscent/2,o=e.width,s=e.actualBoundingBoxAscent;return r===`right`?i=t.width-o-n.cellHorizontalPadding:r===`center`&&(i=t.width/2-o/2),{x:i,y:a,width:o,height:s}}var Rs=[Cs,Ds,es,is,ls,ms,vs,Ss,As,js,Ns,Ps,{getAccessibilityString:e=>e.data?.toString()??``,kind:B.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:kn,draw:e=>{let{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:a,rect:o,ctx:s}=e,c=t.displayData??t.data,l=t.hoverEffect===!0;if(r!==void 0&&l&&i!==void 0&&a!==void 0){let{x:l,y:u,width:d,height:f}=Ls(Sn(c,s,n.baseFontFull),o,n,t.contentAlign);if(i>=l-4&&i<=l-4+d+8&&a>=u-4&&a<=u-4+f+8){let i=wn(s,n.baseFontFull);r(`pointer`);let a=u-i;s.beginPath(),s.moveTo(o.x+l,Math.floor(o.y+a+f+5)+.5),s.lineTo(o.x+l+d,Math.floor(o.y+a+f+5)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,Pn({...e,rect:{...o,x:o.x-1}},c,t.contentAlign),Pn({...e,rect:{...o,x:o.x-2}},c,t.contentAlign),Pn({...e,rect:{...o,x:o.x+1}},c,t.contentAlign),Pn({...e,rect:{...o,x:o.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=l?n.linkColor:n.textDark,Pn(e,c,t.contentAlign)},onClick:e=>{let{cell:t,bounds:n,posX:r,posY:i,theme:a}=e,o=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let s=Cn(o,a.baseFontFull);if(s===void 0)return;let c=Ls(s,n,a,t.contentAlign);Br({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},r,i)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:``}),provideEditor:e=>t=>{let{onChange:n,value:r,forceEditMode:i,validatedSelection:a}=t;return G.createElement(Is,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:a,readonly:r.readonly===!0,onChange:e=>n({...r,data:e.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}}],zs=e(t(((e,t)=>{var n=vt(),r=F(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))(),1),Bs=[],Vs=class extends Un{imageLoaded=()=>void 0;loadedLocations=[];cache={};setCallback(e){this.imageLoaded=e}sendLoaded=(0,zs.default)(()=>{this.imageLoaded(new Gn(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{let e=Object.keys(this.cache);for(let t of e){let e=this.cache[t],n=!1;for(let t=0;t<e.cells.length;t++){let r=e.cells[t];if(this.isInWindow(r)){n=!0;break}}n?e.cells=e.cells.filter(this.isInWindow):(e.cancel(),delete this.cache[t])}};loadImage(e,t,n,r){let i=!1,a=Bs.pop()??new Image,o=!1,s={img:void 0,cells:[X(t,n)],url:e,cancel:()=>{o||(o=!0,Bs.length<12?Bs.unshift(a):i||(a.src=``))}},c=new Promise(e=>a.addEventListener(`load`,()=>e(null)));requestAnimationFrame(async()=>{try{a.src=e,await c,await a.decode();let t=this.cache[r];if(t!==void 0&&!o){t.img=a;for(let e of t.cells)this.loadedLocations.push(Hn(e));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[r]=s}loadOrGetImage(e,t,n){let r=e,i=this.cache[r];if(i!==void 0){let e=X(t,n);return i.cells.includes(e)||i.cells.push(e),i.img}else this.loadImage(e,t,n,r)}},Hs=G.forwardRef((e,t)=>{let n=G.useMemo(()=>({...Ar,...e.headerIcons}),[e.headerIcons]),r=G.useMemo(()=>e.imageWindowLoader??new Vs,[e.imageWindowLoader]);return G.createElement(Qo,{...e,renderers:Rs,headerIcons:n,ref:t,imageWindowLoader:r})});function Us(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function Ws(e,t){if(e.startsWith(`#`)){let n=e.slice(1);return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}return e}function Gs(){let e=Us(`--color-background`),t=Us(`--color-foreground`),n=Us(`--color-muted`),r=Us(`--color-muted-foreground`),i=Us(`--color-primary`),a=Us(`--color-primary-foreground`),o=Us(`--color-border`),s=Us(`--color-accent`),c=Us(`--color-text-secondary`),l=Us(`--color-text-subtle`),u=Us(`--font-sans`)||`Geist, system-ui, sans-serif`;return{bgCell:e,bgCellMedium:n,bgHeader:n,bgHeaderHasFocus:s,bgHeaderHovered:s,bgBubble:s,bgBubbleSelected:i,textDark:t,textMedium:c,textLight:l,textHeader:r,textGroupHeader:r,textHeaderSelected:t,textBubble:t,accentColor:i,accentFg:a,accentLight:Ws(i,.12),borderColor:o,horizontalBorderColor:o,fontFamily:u,baseFontStyle:`13px`,headerFontStyle:`600 12px`,editorFontSize:`13px`,lineHeight:1.5,cellHorizontalPadding:8,cellVerticalPadding:4,headerIconSize:16}}function Ks(){let[e,t]=(0,G.useState)(0);return(0,G.useEffect)(()=>{let e=new MutationObserver(()=>t(e=>e+1));return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>e.disconnect()},[]),(0,G.useMemo)(()=>Gs(),[e])}function qs(e,t,n){let r=e.length*9+40,i=0,a=Math.min(t.length,20);for(let n=0;n<a;n++){let r=t[n]?.[e];if(r==null)continue;let a=typeof r==`object`?12:String(r).length;i=Math.max(i,a*8)}let o=/^(int|serial|bigint|smallint|float|double|decimal|numeric|real|money|bool)/.test(n.toLowerCase())?80:100;return Math.max(o,Math.min(Math.max(r,i)+16,400))}function Js(e,t,n,r,i,a,o){return(0,G.useMemo)(()=>{let s=t.filter(e=>n.has(e)),c=t.filter(e=>!n.has(e)),l=[...s,...c],u=new Map(e.map(e=>[e.name,e]));return{columns:l.map(e=>{let t=u.get(e),n=t?.pk??!1,s;return a===e?s=o===`ASC`?`sortAsc`:`sortDesc`:n?s=`headerRowID`:t?.fk&&(s=`headerFk`),{title:e,id:e,width:r.get(e)??qs(e,i,t?.type??`text`),hasMenu:!0,icon:s}}),freezeColumns:s.length,columnOrder:l}},[e,t,n,r,i,a,o])}function Ys(e){if(e==null)return!1;if(typeof e==`object`)return!0;let t=String(e);if(t.length>=200)return!0;let n=t.trimStart();return!!((n[0]===`{`||n[0]===`[`)&&(n.endsWith(`}`)||n.endsWith(`]`))||n.startsWith(`<?xml`)||n.startsWith(`<`)&&n.endsWith(`>`))}function Xs(e){return e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e)}function Zs(e){let t=e.trimStart();if(t[0]===`{`||t[0]===`[`)try{return JSON.parse(t),`json`}catch{}return t.startsWith(`<?xml`)||t.startsWith(`<`)&&/<\/\w+>/.test(t)?`xml`:t.startsWith(`---`)||/^\w+:\s/m.test(t)?`yaml`:`plaintext`}function Qs(e){let t=e.toLowerCase();return/^(int|serial|bigint|smallint|float|double|decimal|numeric|real|money)/.test(t)?B.Number:/^bool/.test(t)?B.Boolean:B.Text}function $s(e){let t=e.type.toLowerCase();return!!(/^(serial|bigserial|smallserial)/.test(t)||/^(int|bigint|smallint|integer)/.test(t)&&e.defaultValue&&/nextval|identity|auto_increment/i.test(e.defaultValue)||t===`integer`&&e.pk&&!e.defaultValue)}function ec(e,t=200){return e.length>t?e.slice(0,t)+`…`:e}var tc={bgCell:`rgba(251, 191, 36, 0.15)`};function nc(e,t,n,r,i,a){let o=(0,G.useRef)(e);o.current=e;let s=(0,G.useRef)(t);s.current=t;let c=(0,G.useRef)(new Map);return c.current=new Map(n.map(e=>[e.name,e])),{getCellContent:(0,G.useCallback)(([e,t])=>{let n=s.current[e],i=o.current[t];if(!n||!i)return{kind:B.Text,data:``,displayData:``,allowOverlay:!1};let l=c.current.get(n),u=l?Qs(l.type):B.Text,d=l?.pk??!1,f=r?i[r]:void 0,p=typeof f==`string`&&f.startsWith(`__new_`),m=`${f}:${n}`,h=a.current.get(m),g=h===void 0?i[n]:h.newVal,_=h!==void 0;if(d&&p){if(l&&$s(l))return{kind:B.Text,data:``,displayData:`AUTO`,allowOverlay:!1,readonly:!0,themeOverride:{textDark:`#6b7280`}};let e=h===void 0?``:String(h.newVal??``);return{kind:B.Text,data:e,displayData:e||`Enter ID…`,allowOverlay:!0,readonly:!1,themeOverride:e?_?tc:void 0:{textDark:`#9ca3af`}}}if(g==null){let e=p?``:`NULL`;if(p&&!_&&l){let t=l.type.toLowerCase();l.defaultValue?e=l.defaultValue:/^(timestamp|datetime|date)/.test(t)?e=`NOW()`:/^(uuid)/.test(t)&&(e=`gen_random_uuid()`)}return{kind:B.Text,data:``,displayData:e,allowOverlay:!d,readonly:d,themeOverride:_?tc:p||e!==`NULL`?{textDark:`#9ca3af`}:{textDark:`#6b7280`}}}if(u===B.Number&&typeof g==`number`)return{kind:B.Number,data:g,displayData:String(g),allowOverlay:!d,readonly:d,themeOverride:_?tc:void 0};if(u===B.Boolean&&typeof g==`boolean`)return{kind:B.Boolean,data:g,readonly:d,allowOverlay:!1};let v=Xs(g);return{kind:B.Text,data:v,displayData:ec(v),allowOverlay:!d,readonly:d,themeOverride:_?tc:void 0}},[]),onCellEdited:(0,G.useCallback)(([e,t],n)=>{if(!r)return;let a=s.current[e],c=o.current[t];if(!a||!c)return;let l=c[r],u;if(n.kind===B.Text)u=n.data===``?null:n.data;else if(n.kind===B.Number)u=n.data;else if(n.kind===B.Boolean)u=n.data;else return;i(l,a,u)},[r,i])}}var rc={columns:H.empty(),rows:H.empty()};function ic(){let[e,t]=(0,G.useState)(rc);return{gridSelection:e,onGridSelectionChange:(0,G.useCallback)(e=>{t(e)},[]),selectedRowIndices:(0,G.useMemo)(()=>{let t=[];if(e.rows)for(let n of e.rows)if(Array.isArray(n))for(let e=n[0];e<n[1];e++)t.push(e);else t.push(n);return t},[e.rows]),clearSelection:(0,G.useCallback)(()=>{t(rc)},[])}}function ac(e,t,n){let[r,i]=(0,G.useState)(new Map),a=(0,G.useRef)(r);a.current=r;let o=(0,G.useRef)(!1);return{pendingEdits:r,pendingRef:a,addEdit:(0,G.useCallback)((e,t,n)=>{let r=`${e}:${t}`;i(i=>new Map(i).set(r,{pkVal:e,col:t,newVal:n}))},[]),commitAll:(0,G.useCallback)(async()=>{if(!e)return;let r=new Map;for(let n of a.current.values()){let i=String(n.pkVal);i.startsWith(`__new_`)?(r.has(i)||r.set(i,{}),r.get(i)[n.col]=n.newVal):t(e,n.pkVal,n.col,n.newVal)}if(n)for(let e of r.values())await n(e);o.current=!0},[e,t,n]),discardAll:(0,G.useCallback)(()=>{i(new Map),o.current=!1},[]),hasPending:r.size>0,pendingCount:r.size,committedRef:o}}function oc(e,t){let[n,r]=(0,G.useState)(new Set);return{effectiveRows:(0,G.useMemo)(()=>{if(n.size===0||!t)return e;let r=[],i=[];for(let a of e)n.has(String(a[t]??``))?i.push(a):r.push(a);return[...r,...i]},[e,n,t]),pinnedCount:n.size,pinnedPks:n,setPinnedPks:r}}function sc(e){let{displayRows:t,columnOrder:n,schema:r,pkCol:i,connectionId:a,connectionName:o,selectedTable:s,selectedSchema:c,addEdit:l,gridSelection:u,containerRef:d}=e,{openTab:f}=C(E(e=>({openTab:e.openTab}))),[p,m]=(0,G.useState)(null),h=(0,G.useRef)(t);h.current=t;let g=(0,G.useRef)(n);g.current=n;let _=(0,G.useCallback)(e=>{let n=t[e];if(!n)return;let r=i?String(n[i]??``):``,o=s??``,c=JSON.stringify(n,null,2);m({title:r?`Row #${r}${o?` — ${o}`:``}`:`Row — ${o}`,content:c,language:`json`,viewerKey:`${a}:${o}:row:${r}`})},[t,i,s,a]),v=(0,G.useCallback)((e,r)=>{let o=t[e];if(!o)return;let c=n[r];if(!c)return;let l=Xs(o[c]),u=i?String(o[i]??e):String(e),d=s??``;m({title:`${c} #${u}${d?` — ${d}`:``}`,content:l,language:Zs(l),viewerKey:`${a}:${d}:${c}:${u}`})},[t,n,i,s,a]),y=(0,G.useCallback)(()=>{p&&f({type:`editor`,title:p.title,projectId:null,closable:!0,metadata:{inlineContent:p.content,inlineLanguage:p.language,viewerKey:p.viewerKey}})},[f,p]),b=(0,G.useCallback)((e,t)=>{if(!i)return!1;let[n,a]=e;for(let e=0;e<t.length;e++){let o=h.current[a+e];if(!o)continue;let s=o[i];for(let i=0;i<t[e].length;i++){let a=g.current[n+i];if(!a||r.find(e=>e.name===a)?.pk)continue;let o=t[e][i];l(s,a,o===``?null:o)}}return!1},[i,r,l]),x=(0,G.useRef)(r);x.current=r;let S=(0,G.useRef)(u);S.current=u;let w=(0,G.useRef)(l);w.current=l;let T=(0,G.useRef)(i);return T.current=i,(0,G.useEffect)(()=>{if(!d)return;let e=e=>{let t=d.current;if(!t||!t.contains(document.activeElement))return;let n=document.activeElement?.tagName;if(n===`INPUT`||n===`TEXTAREA`)return;let r=T.current;if(!r)return;let i=S.current?.current;if(!i)return;let a=e.clipboardData?.getData(`text/plain`);if(!a)return;let o=a.split(/\r?\n/).filter(e=>e.length>0).map(e=>e.split(` `));if(o.length===0)return;let[s,c]=i.cell;for(let e=0;e<o.length;e++){let t=h.current[c+e];if(!t)continue;let n=t[r];for(let t=0;t<o[e].length;t++){let r=g.current[s+t];if(!r||x.current.find(e=>e.name===r)?.pk)continue;let i=o[e][t];w.current(n,r,i===``?null:i)}}e.preventDefault()};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[d]),{previewData:p,setPreviewData:m,openRowPreview:_,openCellPreview:v,openPreviewInTab:y,handlePaste:b,getContextFk:(0,G.useCallback)(e=>e?r.find(t=>t.name===e)?.fk??null:null,[r]),isCellViewable:(0,G.useCallback)((e,t)=>e&&t?Ys(e[t]):!1,[]),openFkTable:(0,G.useCallback)((e,t)=>{t==null||!a||f({type:`database`,title:`${o??`DB`} · ${e.table}`,projectId:null,closable:!0,metadata:{connectionId:a,connectionName:o,tableName:e.table,schemaName:c??`public`,initialSql:`SELECT * FROM "${e.table}" WHERE "${e.column}" = '${String(t).replace(/'/g,`''`)}'`}})},[a,o,c,f])}}function cc({colName:e,bounds:t,isPinned:n,filterValue:r,sortState:i,onFilter:a,onSort:c,onClearSort:l,onTogglePin:u,onClose:p}){let[m,h]=(0,G.useState)(r),g=(0,G.useRef)(null),_=(0,G.useRef)(void 0);(0,G.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&p()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]),(0,G.useEffect)(()=>{let e=e=>{e.key===`Escape`&&p()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[p]);let y=e=>{h(e),clearTimeout(_.current),_.current=setTimeout(()=>a(e),300)},b=Math.min(t.x,window.innerWidth-220-8),x=t.y+t.height+2,S=document.getElementById(`portal`);return S?(0,Je.createPortal)((0,K.jsxs)(`div`,{ref:g,style:{position:`fixed`,left:b,top:x,zIndex:1e4},className:`w-[220px] bg-popover border border-border rounded-md shadow-lg text-xs overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border text-muted-foreground font-medium truncate`,children:e}),(0,K.jsx)(`div`,{className:`px-2 py-1.5 border-b border-border`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(Ne,{className:`size-3 text-muted-foreground shrink-0`}),(0,K.jsx)(`input`,{autoFocus:!0,type:`text`,value:m,onChange:e=>y(e.target.value),placeholder:`Filter (ILIKE)…`,className:`flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground text-xs`}),m&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>y(``),className:`text-muted-foreground hover:text-foreground`,children:(0,K.jsx)(v,{className:`size-3`})})]})}),(0,K.jsxs)(`div`,{className:`py-1`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{c(),p()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[i===`asc`?(0,K.jsx)(o,{className:`size-3`}):(0,K.jsx)(s,{className:`size-3`}),i===`asc`?`Sort Descending`:`Sort Ascending`]}),i&&l&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{l(),p()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(v,{className:`size-3`}),`Clear Sort`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{u(),p()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[n?(0,K.jsx)(f,{className:`size-3`}):(0,K.jsx)(d,{className:`size-3`}),n?`Unpin Column`:`Pin Column`]})]})]}),S):null}function lc({position:e,isPinned:t,onViewRow:n,onViewCell:r,onPinRow:i,onDeleteRow:a,onOpenFkTable:o,fkLabel:s,onClose:c}){let[l,u]=(0,G.useState)(!1),p=(0,G.useRef)(null);(0,G.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&c()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[c]),(0,G.useEffect)(()=>{let e=e=>{e.key===`Escape`&&c()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[c]);let m=Math.min(e.x,window.innerWidth-180-8),_=Math.min(e.y,window.innerHeight-130-8),v=document.getElementById(`portal`);return v?(0,Je.createPortal)((0,K.jsxs)(`div`,{ref:p,style:{position:`fixed`,left:m,top:_,zIndex:1e4},className:`w-[180px] bg-popover border border-border rounded-md shadow-lg text-xs overflow-hidden py-1`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{n(),c()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(h,{className:`size-3`}),` View as JSON`]}),r&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{r(),c()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(h,{className:`size-3`}),` View Cell`]}),o&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{o(),c()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-blue-400`,children:[(0,K.jsx)(D,{className:`size-3`}),` `,s??`Open Referenced Table`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{i(),c()},className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-foreground`,children:[t?(0,K.jsx)(f,{className:`size-3`}):(0,K.jsx)(d,{className:`size-3`}),t?`Unpin Row`:`Pin Row`]}),(0,K.jsx)(`div`,{className:`border-t border-border my-0.5`}),l?(0,K.jsxs)(`div`,{className:`px-3 py-1.5 flex items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>{a(),c()},className:`text-destructive font-medium hover:underline`,children:`Delete?`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>u(!1),className:`text-muted-foreground hover:underline`,children:`Cancel`})]}):(0,K.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`w-full text-left px-3 py-1.5 hover:bg-muted flex items-center gap-2 text-destructive`,children:[(0,K.jsx)(g,{className:`size-3`}),` Delete Row`]})]}),v):null}function uc({columns:e,onSelect:t,onClose:n,anchorRect:r}){let[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(0),c=(0,G.useRef)(null),l=(0,G.useRef)(null),u=i?e.filter(e=>e.toLowerCase().includes(i.toLowerCase())):e;(0,G.useEffect)(()=>{s(0)},[i]),(0,G.useEffect)(()=>{let e=l.current;e&&e.children[o]?.scrollIntoView({block:`nearest`})},[o]),(0,G.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&n()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]);let d=(0,G.useCallback)(e=>{if(e.key===`Escape`){n();return}if(e.key===`ArrowDown`){e.preventDefault(),s(e=>Math.min(e+1,u.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),s(e=>Math.max(e-1,0));return}if(e.key===`Enter`){e.preventDefault();let r=u[o];r&&(t(r),n())}},[u,o,t,n]),f=document.getElementById(`portal`);return f?(0,Je.createPortal)((0,K.jsxs)(`div`,{ref:c,style:{position:`fixed`,left:Math.min(r.x,window.innerWidth-216),top:Math.min(r.y,window.innerHeight-308),zIndex:1e4},className:`w-[200px] max-h-[300px] bg-popover border border-border rounded-md shadow-lg text-xs overflow-hidden flex flex-col`,children:[(0,K.jsx)(`div`,{className:`px-2 py-1.5 border-b border-border`,children:(0,K.jsx)(`input`,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),onKeyDown:d,placeholder:`Search columns…`,className:`w-full bg-transparent outline-none text-foreground placeholder:text-muted-foreground text-xs`})}),(0,K.jsxs)(`div`,{ref:l,className:`overflow-y-auto py-1`,children:[u.map((e,r)=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>{t(e),n()},onMouseEnter:()=>s(r),className:`w-full text-left px-3 py-1 truncate text-foreground ${r===o?`bg-muted`:`hover:bg-muted`}`,children:e},e)),u.length===0&&(0,K.jsx)(`div`,{className:`px-3 py-2 text-muted-foreground`,children:`No columns found`})]})]}),f):null}function dc({hasSelection:e,selectedCount:t,onBulkDelete:n,onInsertRow:r,columns:i,selectedRows:a,connectionName:o,searchTerm:s,onSearchChange:c,onColumnJump:l,colSearchOpen:d,onColSearchChange:f}){let[m,h]=(0,G.useState)(!1),[y,b]=(0,G.useState)(!1),x=d??y,S=f??b,C=(0,G.useRef)(null),w=C.current?(()=>{let e=C.current.getBoundingClientRect();return{x:e.left,y:e.bottom+4}})():{x:0,y:0};return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 border-b border-border bg-background shrink-0`,children:[e&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[t,` selected`]}),n&&(m?(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{n(),h(!1)},className:`text-destructive text-[10px] font-medium hover:underline`,children:[`Delete `,t,`?`]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(!1),className:`text-muted-foreground text-[10px] hover:underline`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(!0),className:`p-0.5 text-muted-foreground hover:text-destructive`,children:(0,K.jsx)(g,{className:`size-3`})})),(0,K.jsx)(Xe,{columns:i,rows:a,filename:`${o??`db`}-selected`})]}),(0,K.jsx)(`div`,{className:`flex-1`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,K.jsx)(p,{className:`size-3 text-muted-foreground`}),(0,K.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Search page…`,className:`w-24 bg-transparent outline-none text-foreground placeholder:text-muted-foreground text-xs`}),s&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(``),className:`text-muted-foreground hover:text-foreground`,children:(0,K.jsx)(v,{className:`size-3`})})]}),l&&(0,K.jsx)(`button`,{ref:C,type:`button`,onClick:()=>S(!x),className:`p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors`,title:`Jump to column (/)`,children:(0,K.jsx)(u,{className:`size-3.5`})}),r&&(0,K.jsx)(`button`,{type:`button`,onClick:r,className:`p-0.5 rounded text-muted-foreground hover:text-primary transition-colors`,title:`Insert row`,children:(0,K.jsx)(_,{className:`size-3.5`})}),x&&l&&(0,K.jsx)(uc,{columns:i,onSelect:l,onClose:()=>S(!1),anchorRect:w})]})}function fc({pendingCount:e,onSave:t,onDiscard:n}){return e===0?null:(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-t border-amber-400/50 bg-amber-50 dark:bg-amber-950/30 shrink-0 text-xs`,children:[(0,K.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-300 font-medium`,children:[e,` pending edit`,e>1?`s`:``]}),(0,K.jsx)(`div`,{className:`flex-1`}),(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-1 px-2 py-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:[(0,K.jsx)(T,{className:`size-3`}),` Discard`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-1 px-2 py-0.5 rounded bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,children:[(0,K.jsx)(Pe,{className:`size-3`}),` Save`,(0,K.jsx)(`kbd`,{className:`ml-1 text-[9px] opacity-70`,children:`⌘↵`})]})]})}function pc({total:e,page:t,totalPages:n,onPageChange:r}){return(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 border-t border-border bg-background shrink-0 text-xs text-muted-foreground`,children:[(0,K.jsxs)(`span`,{children:[e.toLocaleString(),` rows`]}),(0,K.jsxs)(`div`,{className:`hidden md:flex items-center gap-2 text-[10px] text-muted-foreground/50`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`kbd`,{className:`px-1 py-0.5 rounded bg-muted text-[9px]`,children:`/`}),` columns`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsxs)(`kbd`,{className:`px-1 py-0.5 rounded bg-muted text-[9px]`,children:[`⌘`,`A`]}),` select all`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsxs)(`kbd`,{className:`px-1 py-0.5 rounded bg-muted text-[9px]`,children:[`⌘`,`C`]}),` copy`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,disabled:t<=1,onClick:()=>r(t-1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,K.jsx)(c,{className:`size-3.5`})}),(0,K.jsxs)(`span`,{children:[t,` / `,n]}),(0,K.jsx)(`button`,{type:`button`,disabled:t>=n,onClick:()=>r(t+1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,K.jsx)(l,{className:`size-3.5`})})]})]})}function mc({data:e,onClose:t,onOpenInTab:n}){let r=je(),[i,a]=(0,G.useState)(!0),[o,s]=(0,G.useState)(e.content),[c,l]=(0,G.useState)(!1),u=e.language===`json`||e.language===`xml`,d=(0,G.useRef)(e.title);d.current!==e.title&&(d.current=e.title,s(e.content),l(!1));let f=(0,G.useCallback)(()=>{if(c)s(e.content),l(!1);else if(e.language===`json`)try{s(JSON.stringify(JSON.parse(e.content.trim()),null,2)),l(!0)}catch{}else if(e.language===`xml`){let t=0;s(e.content.trim().replace(/>\s*</g,`>
|
|
134
|
+
<`).split(`
|
|
135
|
+
`).map(e=>{let n=e.trim();n.startsWith(`</`)&&(t=Math.max(0,t-1));let r=` `.repeat(t)+n;return n.startsWith(`<`)&&!n.startsWith(`</`)&&!n.endsWith(`/>`)&&!n.startsWith(`<?`)&&t++,r}).join(`
|
|
136
|
+
`)),l(!0)}},[c,e.content,e.language]),[p,m]=(0,G.useState)(200),g=(0,G.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=p,r=e=>m(Math.max(80,n+(t-e.clientY))),i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[p]);return(0,K.jsxs)(`div`,{className:`shrink-0 border-t border-border flex flex-col`,style:{height:p},children:[(0,K.jsx)(`div`,{onMouseDown:g,className:`shrink-0 h-1.5 cursor-row-resize bg-border/50 hover:bg-primary/30 flex items-center justify-center transition-colors`,children:(0,K.jsx)(O,{className:`size-3 text-muted-foreground/50`})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 bg-muted/50 border-b border-border shrink-0`,children:[(0,K.jsx)(h,{className:`size-3 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground truncate flex-1`,children:e.title}),u&&(0,K.jsx)(`button`,{type:`button`,onClick:f,title:c?`Raw`:`Beautify`,className:`p-0.5 rounded transition-colors ${c?`text-primary`:`text-muted-foreground hover:text-foreground`}`,children:(0,K.jsx)(y,{className:`size-3`})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>a(!i),title:i?`No wrap`:`Word wrap`,className:`p-0.5 rounded transition-colors ${i?`text-primary`:`text-muted-foreground hover:text-foreground`}`,children:(0,K.jsx)(b,{className:`size-3`})}),(0,K.jsxs)(`button`,{type:`button`,onClick:n,title:`Open in new tab`,className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:[(0,K.jsx)(D,{className:`size-3`}),(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:`Open in Tab`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:t,title:`Close preview (Esc)`,className:`p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors`,children:(0,K.jsx)(v,{className:`size-3`})})]}),(0,K.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,K.jsx)(Ae,{height:`100%`,language:e.language===`plaintext`?void 0:e.language,value:o,theme:r,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:i?`on`:`off`,lineNumbers:`on`,fontSize:12,folding:!0,bracketPairColorization:{enabled:!0},domReadOnly:!0,contextmenu:!1,overviewRulerLanes:0},loading:(0,K.jsx)(w,{className:`size-4 animate-spin text-muted-foreground`})})})]})}var hc={sortAsc:e=>`<svg viewBox="0 0 16 16" fill="${e.fgColor}"><path d="M8 4l4 6H4z"/></svg>`,sortDesc:e=>`<svg viewBox="0 0 16 16" fill="${e.fgColor}"><path d="M8 12l4-6H4z"/></svg>`,headerFk:()=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#3b82f6" stroke-width="1.5" stroke-linecap="round"><path d="M6 4.5H4.5a2.5 2.5 0 000 5H6M10 4.5h1.5a2.5 2.5 0 010 5H10M5 7h6"/></svg>`};function gc(e){let{columns:t,rows:n,total:r,limit:i,schema:a,loading:o,page:s,onPageChange:c,onCellUpdate:l,onRowDelete:u,onBulkDelete:d,onInsertRow:f,orderBy:p,orderDir:m,onToggleSort:h,onClearSort:g,columnFilters:_={},onColumnFilter:v,connectionId:y,selectedTable:b,selectedSchema:x,connectionName:S}=e,C=Ks(),T=(0,G.useRef)(null),E=(0,G.useRef)(null),D=(0,G.useMemo)(()=>{let e=new Set(a.map(e=>e.name));return t.filter(t=>e.has(t))},[t,a]),[O,k]=(0,G.useState)(new Set),[ee,te]=(0,G.useState)(new Map),[A,ne]=(0,G.useState)(null),[j,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(``),[M,oe]=(0,G.useState)([]),N=(0,G.useMemo)(()=>a.find(e=>e.pk)?.name??a.find(e=>e.name.toLowerCase()===`id`)?.name??null,[a]),{effectiveRows:P,pinnedCount:se,pinnedPks:ce,setPinnedPks:le}=oc(n,N),F=(0,G.useMemo)(()=>{if(se===0)return[...P,...M];let e=P.slice(0,P.length-se),t=P.slice(P.length-se);return[...e,...M,...t]},[P,M,se]),I=(0,G.useMemo)(()=>{if(!ie.trim())return F;let e=ie.toLowerCase();return F.filter(t=>D.some(n=>String(t[n]??``).toLowerCase().includes(e)))},[F,D,ie]),ue=(0,G.useMemo)(()=>se===0||!N?0:ie.trim()?I.filter(e=>ce.has(String(e[N]??``))).length:se,[se,N,ie,I,ce]),{pendingRef:de,addEdit:fe,commitAll:pe,discardAll:me,hasPending:he,pendingCount:ge,committedRef:_e}=ac(N,l,f),{columns:ve,freezeColumns:L,columnOrder:ye}=Js(a,D,O,ee,I,p,m),{getCellContent:R,onCellEdited:be}=nc(I,ye,a,N,fe,de),{gridSelection:z,onGridSelectionChange:xe,selectedRowIndices:B,clearSelection:Se}=ic(),{previewData:V,setPreviewData:Ce,openRowPreview:we,openCellPreview:H,openPreviewInTab:Te,handlePaste:Ee,getContextFk:De,isCellViewable:U,openFkTable:Oe}=sc({displayRows:I,columnOrder:ye,schema:a,pkCol:N,connectionId:y,connectionName:S,selectedTable:b,selectedSchema:x,addEdit:fe,gridSelection:z,containerRef:E});(0,G.useEffect)(()=>{_e.current&&(_e.current=!1,me(),oe([]))},[n]);let ke=(0,G.useCallback)((e,t)=>{te(n=>new Map(n).set(e.id??e.title,t))},[]),W=(0,G.useCallback)((e,t)=>{let n=ye[e];n&&ne({colName:n,bounds:t})},[ye]),Ae=(0,G.useCallback)(([e,t],n)=>{n.preventDefault(),re({position:{x:n.bounds.x+n.localEventX,y:n.bounds.y+n.localEventY},rowIdx:t,colIdx:e})},[]),je=(0,G.useCallback)(e=>{k(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Me=(0,G.useCallback)(e=>{if(!N)return;let t=I[e];if(!t)return;let n=String(t[N]??``);le(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})},[N,I,le]),Ne=(0,G.useCallback)(e=>{if(ce.size===0||!N)return;let t=I[e];if(t&&ce.has(String(t[N]??``)))return{bgCell:C.bgCellMedium??C.bgHeader}},[ce,N,I,C]),Pe=(0,G.useCallback)(()=>{!N||!d||(d(N,B.map(e=>I[e]?.[N]).filter(e=>e!=null)),Se())},[N,d,B,I,Se]),[Fe,Ie]=(0,G.useState)(!1),Le=(0,G.useCallback)(e=>{if(e.key===`Escape`){Ce(null),Ie(!1);return}(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&he&&(e.preventDefault(),pe());let t=e.target?.tagName;e.key===`/`&&t!==`INPUT`&&t!==`TEXTAREA`&&(e.preventDefault(),Ie(!0))},[he,pe]),Re=(0,G.useCallback)(()=>{!N||!f||oe(e=>[...e,{[N]:`__new_${Date.now()}`}])},[N,f]),ze=(0,G.useCallback)(e=>{let t=ye.indexOf(e);t>=0&&T.current?.scrollTo&&T.current.scrollTo(t,0)},[ye]),Be=j?I[j.rowIdx]:null,Ve=Be&&N?String(Be[N]??``):``,He=j?ye[j.colIdx]:null,Ue=U(Be??null,He??null),We=De(He??null),Ge=Be&&He?Be[He]:null;return D.length?(0,K.jsxs)(`div`,{ref:E,className:`flex flex-col h-full overflow-hidden relative`,tabIndex:0,onKeyDown:Le,children:[(0,K.jsx)(dc,{hasSelection:B.length>0,selectedCount:B.length,onBulkDelete:d&&N?Pe:void 0,onInsertRow:f&&N?Re:void 0,columns:D,selectedRows:B.map(e=>I[e]).filter(Boolean),connectionName:S,searchTerm:ie,onSearchChange:ae,onColumnJump:ze,colSearchOpen:Fe,onColSearchChange:Ie}),o&&(0,K.jsx)(`div`,{className:`absolute inset-0 z-30 flex items-center justify-center bg-background/60`,children:(0,K.jsx)(w,{className:`size-5 animate-spin text-primary`})}),(0,K.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,K.jsx)(Hs,{ref:T,columns:ve,rows:I.length,getCellContent:R,getCellsForSelection:!0,onCellEdited:be,onPaste:Ee,theme:C,freezeColumns:L,freezeTrailingRows:ue,rowMarkers:N?`checkbox-visible`:`number`,gridSelection:z,onGridSelectionChange:xe,onColumnResize:ke,onHeaderMenuClick:W,onCellContextMenu:Ae,getRowThemeOverride:Ne,trailingRowOptions:f&&N?{sticky:!0,tint:!0}:void 0,onRowAppended:f?Re:void 0,headerIcons:hc,smoothScrollX:!0,smoothScrollY:!0,width:`100%`,height:`100%`})}),he&&(0,K.jsx)(fc,{pendingCount:ge,onSave:pe,onDiscard:()=>{me(),oe([])}}),V&&(0,K.jsx)(mc,{data:V,onClose:()=>Ce(null),onOpenInTab:Te}),(0,K.jsx)(pc,{total:r,page:s,totalPages:Math.ceil(r/i)||1,onPageChange:c}),A&&(0,K.jsx)(cc,{colName:A.colName,bounds:A.bounds,isPinned:O.has(A.colName),filterValue:_[A.colName]??``,sortState:p===A.colName?m===`ASC`?`asc`:`desc`:null,onFilter:e=>{if(!v)return;let t={..._};e?t[A.colName]=e:delete t[A.colName],v(t)},onSort:()=>{h&&h(A.colName)},onClearSort:g,onTogglePin:()=>je(A.colName),onClose:()=>ne(null)}),j&&Be&&(0,K.jsx)(lc,{position:j.position,isPinned:ce.has(Ve),onViewRow:()=>we(j.rowIdx),onViewCell:Ue?()=>H(j.rowIdx,j.colIdx):void 0,onPinRow:()=>Me(j.rowIdx),onDeleteRow:()=>{N&&u&&Be&&u(N,Be[N])},onOpenFkTable:We&&Ge!=null&&y?()=>Oe(We,Ge):void 0,fkLabel:We?`Open ${We.table}.${We.column}`:void 0,onClose:()=>re(null)})]}):(0,K.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:o?(0,K.jsx)(w,{className:`size-4 animate-spin`}):`Select a table`})}export{Ke as i,Xe as n,qe as r,gc as t};
|