@sheetxl/react 0.4.20 → 0.4.21
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/browser/cjs/{CX6l4lNPTiSB3HUX.cjs → 4HUry3XT7-cfmesD.cjs} +1 -1
- package/browser/cjs/{Dw31E_I05ytgzGk2.cjs → CsK6mjkIvPry4SgD.cjs} +1 -1
- package/browser/cjs/{CGI2BcTiIO1cJwAK.cjs → QYCMHglsAIjHCSEg.cjs} +1 -1
- package/browser/cjs/index.cjs +17 -24
- package/browser/esm/{BxmnMuUkG1ti58-4.mjs → CiXmyVAjR6BoiS2g.mjs} +1 -1
- package/browser/esm/{x7Cs5_IIejRdxYRP.mjs → CmlZyAPFVFma1a0S.mjs} +1 -1
- package/browser/esm/index.mjs +4139 -6126
- package/browser/esm/{B5NkP56B0onsUVLy.mjs → wz-bwVrp2H1fhsi_.mjs} +1 -1
- package/licenses/dependencies.txt +0 -44
- package/node/esm/{CF8NDkLcqmeVZv-g.mjs → Cu3h0KP2FsrN74Bm.mjs} +1 -1
- package/node/esm/index.mjs +2824 -4757
- package/package.json +6 -6
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.
|
|
3
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.21
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@sheetxl/sdk"),g=require("react/jsx-runtime"),l=require("react"),Hs=require("react-dom/client"),Wt=require("react-dom"),ft=require("@sheetxl/grid-react"),ct={TopLeft:"tl",Top:"t",TopRight:"tr",Left:"l",Center:"c",Right:"r",BottomLeft:"bl",Bottom:"b",BottomRight:"br"},Ct="text/html",Pt="text/plain",po="image/png",$s=Object.freeze({left:0,top:0}),Us=Object.freeze({left:0,top:0,bottom:0,right:0}),Ws=Object.freeze({x:0,y:0,width:0,height:0}),Vn=Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:Ws,EmptyRect:Us,EmptyTopLeft:$s},Symbol.toStringTag,{value:"Module"})),Xt="column",Hn="row",Gs=Object.freeze({colIndex:0,rowIndex:0}),Ks=Object.freeze({colStart:0,rowStart:0,colEnd:0,rowEnd:0}),hl=(t,e)=>t.colStart===e.colStart?t.rowStart-e.rowStart:t.colStart-e.colStart,gl=(t,e)=>t.rowStart===e.rowStart?t.colStart-e.colStart:t.rowStart-e.rowStart,Zs=(t,e)=>t.rowEnd===e.rowEnd?e.colEnd-t.colEnd:e.rowEnd-t.rowEnd,Ys=(t,e)=>t.colEnd===e.colEnd?e.rowEnd-t.rowEnd:e.colEnd-t.colEnd,Xr=(t,e)=>t.colIndex===e.colIndex?t.rowIndex-e.rowIndex:t.colIndex-e.colIndex,Jr=(t,e)=>t.rowIndex===e.rowIndex?t.colIndex-e.colIndex:t.rowIndex-e.rowIndex,ml=(t=Hn,e=!1)=>e?t!==Xt?Zs:Ys:t!==Xt?gl:hl,Qr=(t,e)=>t===e||!(!t||!e)&&t.rowIndex===e.rowIndex&&t.colIndex===e.colIndex,ur=(t,e)=>t===e||!(!t||!e)&&t.rowStart===e.rowStart&&t.rowEnd===e.rowEnd&&t.colStart===e.colStart&&t.colEnd===e.colEnd,hr=(t,e)=>!(!t||!e||t.colStart>e.colEnd||e.colStart>t.colEnd||t.rowStart>e.rowEnd||e.rowStart>t.rowEnd),ei=(t,e)=>{if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!ur(t[n],e[n]))return!1;return!0},Ko=(t,e,n)=>{if(!t&&!e)return null;if(!t)return n?e:{...e};if(!e)return n?t:{...t};const o=Math.min(t.colStart,e.colStart),r=Math.min(t.rowStart,e.rowStart),i=Math.max(t.colEnd,e.colEnd),s=Math.max(t.rowEnd,e.rowEnd);let a=n;return a?(a.colStart=o,a.rowStart=r,a.colEnd=i,a.rowEnd=s):a={colStart:o,rowStart:r,colEnd:i,rowEnd:s},a},ti=(t,e)=>{if(!e||e.length===0)return t;const n={...t};for(let o=0;o<e.length;o++){const r=e[o];hr(n,r)&&(n.rowStart=Math.min(n.rowStart,r.rowStart),n.colStart=Math.min(n.colStart,r.colStart),n.rowEnd=Math.max(n.rowEnd,r.rowEnd),n.colEnd=Math.max(n.colEnd,r.colEnd))}return n},Xs=[null,null],Js=(t,e,n)=>{if(t[0].value===t[1].value)return e};function ni(t,e=2,n,o=Hn,r){let i=[...t];if(e<=0||t.length<=1)return i;let s=o===Xt,a=0,d=!1;do{const c=i.sort(ml(s?Hn:Xt));i=[],i.push(c[0]);const f=c.length;let h=0,u=c[0],w=u.colStart,b=u.rowStart,q=u.colEnd,I=u.rowEnd;for(let $=1;$<f;$++){const D=c[$];let v=!1;if(v=s?u&&b===D.rowStart&&I===D.rowEnd&&q+1===D.colStart:u&&w===D.colStart&&q===D.colEnd&&I+1===D.rowStart,v){let F={colStart:w,rowStart:b,colEnd:s?D.colEnd:q,rowEnd:s?I:D.rowEnd};if(u.value!==void 0&&(F.value=u.value),n){const E=r??[null,null];E[0]=u,E[1]=D,F=n(E,F,o)}if(F){i[h]=F,d=!0,u=F,w=u.colStart,b=u.rowStart,q=u.colEnd,I=u.rowEnd;continue}}i[++h]=D,u=D,w=u.colStart,b=u.rowStart,q=u.colEnd,I=u.rowEnd}a++,s=!s,a===1&&(d=!0)}while(a<e&&d&&i.length>1);return i}const ut=Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:Gs,EmptyRange:Ks,cellToRange:(t,e)=>{if(!t)return null;let n=e;return n||(n={...t},delete n.colIndex,delete n.rowIndex),n.colStart=t.colIndex??0,n.rowStart=t.rowIndex??0,n.colEnd=t.colIndex??0,n.rowEnd=t.rowIndex??0,n},columnFirstCellComparator:Xr,columnFirstRangeComparator:hl,createCellComparator:(t=Hn,e=!1)=>e?t!==Xt?(n,o)=>n.rowIndex===o.rowIndex?o.colIndex-n.colIndex:o.rowIndex-n.rowIndex:(n,o)=>n.colIndex===o.colIndex?o.rowIndex-n.rowIndex:o.colIndex-n.colIndex:t!==Xt?Jr:Xr,createConflatingRanges:(t,e=!1)=>{const n=[];let o,r,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;return{append:(a,d,c)=>{let f=!0;const h=c!==void 0;if(h){const b=t?t(r,c,e):r===c?c:void 0;b===void 0?f=!1:c=b}if(f&&d===s+1&&a===i)return e?o.rowEnd=d:o.colEnd=d,s=d,void(r=c);o&&n.push(o);const u=e?a:d,w=e?d:a;o={colStart:u,rowStart:w,colEnd:u,rowEnd:w},h&&(o.value=c),i=a,s=d,r=c},done:a=>(o&&(n.push(o),o=null),a?ni(n,3,a===!0?Js:a,e?Xt:Hn,Xs):n)}},createRangeComparator:ml,defaultRange:(t,e,n)=>t?n?(n.colStart=t.colStart??e.colStart,n.rowStart=t.rowStart??e.rowStart,n.colEnd=t.colEnd??e.colEnd,n.rowEnd=t.rowEnd??e.rowEnd,n):{colStart:t.colStart??e.colStart,rowStart:t.rowStart??e.rowStart,colEnd:t.colEnd??e.colEnd,rowEnd:t.rowEnd??e.rowEnd}:e,extendRangeToIntersectingRanges:ti,extendRangeToUnionRanges:(t,e)=>{if(!e||e.length===0)return t;let n=t,o=null;for(;!ur(n,o);)o=n,n=ti(o,e);return n},indexOfCoords:(t,e)=>{const n={colStart:t.colIndex,rowStart:t.rowIndex,colEnd:t.colIndex,rowEnd:t.rowIndex};for(let o=e.length-1;o>=0;o--)if(hr(n,e[o]))return o;return-1},intersectRanges:(t,e,n)=>{if(!t)return n?e:{...e};if(!e)return n?t:{...t};if(!t&&!e||t.rowStart>e.rowEnd||t.rowEnd<e.rowStart||t.colStart>e.colEnd||t.colEnd<e.colStart)return null;const o=Math.max(t.colStart,e.colStart),r=Math.max(t.rowStart,e.rowStart),i=Math.min(t.colEnd,e.colEnd),s=Math.min(t.rowEnd,e.rowEnd);let a=n;return a?(a.colStart=o,a.rowStart=r,a.colEnd=i,a.rowEnd=s):a={colStart:o,rowStart:r,colEnd:i,rowEnd:s},a},isCellWithinRange:(t,e)=>!(!t||!e||t.rowIndex<e.rowStart||t.rowIndex>e.rowEnd||t.colIndex<e.colStart||t.colIndex>e.colEnd),isEqualCells:Qr,isEqualRanges:ur,isEqualRangesArrays:ei,isEqualSelectionCoords:(t,e)=>t===e||!(!t||!e)&&t.rangeIndex===e.rangeIndex&&!!Qr(t.cell,e.cell)&&ei(t.ranges,e.ranges),isRangeWithinRange:(t,e)=>!(t.rowStart<e.rowStart||t.rowEnd>e.rowEnd||t.colStart<e.colStart||t.colEnd>e.colEnd),isRangesIntersect:hr,isSingleCell:t=>!!t&&t.rowEnd===t.rowStart&&t.colStart===t.colEnd,isValidRange:t=>!(!t||typeof t.colStart!="number"||t.colStart<0||typeof t.colEnd!="number"||t.colEnd<t.colStart||typeof t.rowStart!="number"||t.rowStart<0||typeof t.rowEnd!="number"||t.rowEnd<t.rowStart),mergeRangedValues:ni,rowFirstCellComparator:Jr,rowFirstRangeComparator:gl,sanitizeRange:t=>t?{colStart:t.colIndex??t.colStart??0,rowStart:t.rowIndex??t.rowStart??0,colEnd:t.colIndex??t.colEnd??0,rowEnd:t.rowIndex??t.rowEnd??0}:null,translateRange:(t,e=-t.rowStart,n=-t.colStart,o)=>o?(o.colStart=t.colStart+n,o.rowStart=t.rowStart+e,o.colEnd=t.colEnd+n,o.rowEnd=t.rowEnd+e,o):{colStart:t.colStart+n,rowStart:t.rowStart+e,colEnd:t.colEnd+n,rowEnd:t.rowEnd+e},unionRanges:Ko,unionRangesArrays:(t,e,n)=>{if(!t||t.length===0)return null;if(t.length===1&&!e)return t[0];let o=t[0];for(let r=1;r<t.length;r++)o=Ko(o,t[r],n);return e&&(o=Ko(o,e,n)),o}},Symbol.toStringTag,{value:"Module"})),Qs=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ea(t){return function(e){return!!e&&typeof e=="object"}(t)&&!function(e){const n=Object.prototype.toString.call(e);return n==="[object RegExp]"||n==="[object Date]"||e.$$typeof===Qs}(t)}function zn(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Jt((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function ta(t,e,n){return t.concat(e).map(function(o){return zn(o,n)})}function oi(t){return Object.keys(t).concat((e=t,Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(n){return Object.propertyIsEnumerable.call(e,n)}):[]));var e}function ri(t,e){try{return e in t}catch{return!1}}function Jt(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||ta,n.isMergeableObject=n.isMergeableObject||ea,n.cloneUnlessOtherwiseSpecified=zn;const o=Array.isArray(e);return o===Array.isArray(t)?o?n.arrayMerge(t,e,n):function(r,i,s){const a={};return s.isMergeableObject(r)&&oi(r).forEach(function(d){a[d]=zn(r[d],s)}),oi(i).forEach(function(d){var c,f;ri(c=r,f=d)&&(!Object.hasOwnProperty.call(c,f)||!Object.propertyIsEnumerable.call(c,f))||(ri(r,d)&&s.isMergeableObject(i[d])?a[d]=function(h,u){if(!u.customMerge)return Jt;const w=u.customMerge(h);return typeof w=="function"?w:Jt}(d,s)(r[d],i[d],s):a[d]=zn(i[d],s))}),a}(t,e,n):zn(e,n)}Jt.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return Jt(n,o,e)},{})};const na=Object.freeze([]),oa=Object.freeze({}),ii=t=>t,vo=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return(t==="x"?e:3&e|8).toString(16)}),fl=(t,e)=>t===e||!(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)&&t.every((n,o)=>n===e[o]),Dn=t=>typeof t=="object"&&!Array.isArray(t)&&t!==null,pl=t=>typeof t!="object"||Array.isArray(t)||t===null?t:(Object.keys(t).forEach(function(e){t[e]&&typeof t[e]=="object"?pl(t[e]):t[e]!==null&&t[e]!==void 0||delete t[e],typeof t[e]=="object"&&Object.keys(t[e]).length===0&&delete t[e]}),Object.keys(t).length===0?null:t),ra=(t,e)=>!(t!==e&&!fl(t,e)&&!t.isEqual?.(e)),vl=(t,e,n=ra)=>{if(t==null||t===e)return null;if(!t||typeof t!="object"||Array.isArray(t)||t.isImmutable?.())return n(t,e)?null:t;const o=Object.keys(t);if(o.length===0)return null;let r=!1;for(let i=0;i<o.length;i++){const s=o[i];vl(t[s],e?.[s],n)===null&&(r=!0,delete t[s])}return r&&Object.keys(t).length===0?null:void 0},li=typeof performance=="object"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now(),si=t=>t==null,ai=(t,e)=>!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top),ci=!(typeof window>"u"||!window.document||!window.document.createElement),qt={Windows:"windows",MacOS:"macos",IOS:"ios",Linux:"linux",Android:"android",Safari:"safari",Firefox:"firefox",Node:"node",Unknown:"unknown"},$n=()=>{if(wl())return qt.Node;const t=globalThis.navigator!==void 0&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";return t?/(win32|win64|windows|wince)/i.test(t)?qt.Windows:/(macintosh|macintel|macppc|mac68k|macos)/i.test(t)?qt.MacOS:/(iphone|ipad|ipod)/i.test(t)?qt.IOS:/android/.test(t)?qt.Android:/linux/.test(t)?qt.Linux:/^((?!chrome|android|).)*safari/i.test(t)?qt.Safari:/^((?!chrome|android|Seamonkey).)*firefox/i.test(t)?qt.Firefox:qt.Unknown:qt.Unknown};function wl(){return typeof process<"u"&&process.release?.name==="node"||(typeof process<"u"&&process.browser,!1)}const di=(t,e=!1)=>(document.hasFocus()||e)&&(t===document.activeElement||t?.contains(document.activeElement)),Ue=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:na,EmptyObject:oa,OSType:qt,arrayMove:function(t,e,n){const o=t.slice();return o.splice(n<0?o.length+n:n,0,o.splice(e,1)[0]),o},asNumber:t=>{const e=(n=>1*n)(t);return Number.isFinite(e)?e:0},camelToPrettyCase:t=>t.length===1?t.toUpperCase():t.replace(/([A-Z])/g," $1").replace(/^./,function(e){return e.toUpperCase()}).trim(),canUseDOM:ci,cancelTimeout:t=>{cancelAnimationFrame(t.id)},castToString:t=>t==null||t===void 0?"":typeof t!="string"?""+t:t,cloneObject:t=>si(t)?t:JSON.parse(JSON.stringify(t)),consoleWithNoSource:(...t)=>new Promise(e=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,t),e()})}),debounce:function(t,e=300,n=!1){let o,r,i,s,a=0;function d(){let f=Date.now()-a;f<e&&f>=0?o=setTimeout(d,e-f):(o=null,n||(s=t.apply(i,r),i=r=null))}e==null&&(e=100);const c=function(){i=globalThis,r=arguments,a=Date.now();var f=n&&!o;return o||(o=setTimeout(d,e)),f&&(s=t.apply(i,r),i=r=null),s};return c.clear=function(){o&&(clearTimeout(o),o=null)},c.flush=function(){o&&(s=t.apply(i,r),i=r=null,clearTimeout(o),o=null)},c},deepEqual:function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;let o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(r of e.entries())if(!n.has(r[0]))return!1;for(r of e.entries())if(!t(r[1],n.get(r[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(r of e.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(e[r]!==n[r])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){let s=i[r];if(!(s==="_owner"&&e.$$typeof||t(e[s],n[s])))return!1}return!0}return e!=e&&n!=n},deepFreeze:function t(e){return Object.freeze(e),Object.keys(e).forEach(n=>{typeof e[n]!="object"||e[n]===null||Object.isFrozen(e[n])||t(e[n])}),e},deepMerge:Jt,diffValues:(t,e)=>{const n={},o=Object.keys(e),r=o.length;for(let i=0;i<r;i++){const s=o[i];t[s]!==e[s]&&(t[s]===void 0?n[s]=e[s]:n[s]=t[s])}return Object.keys(n).length===0?null:n},findEqualOrGreater:function(t,e,n=ii){let o=0,r=t.length-1;for(;o<=r;){let i=Math.floor((o+r)/2),s=n(t[i]);if(s===e)return i;s<e?o=i+1:r=i-1}return o},findEqualOrLesser:function(t,e,n=ii){let o=t.length-1,r=0;for(;o>=r;){let i=Math.floor((o+r)/2),s=n(t[i]);if(s===e)return i;s>e?o=i-1:r=i+1}return o},findNextStep:(t,e=!0,n=15,o=10,r=400)=>{const i=Math.max(t-o,0)+(e?1:-1);return Math.min(r,Math[e?"ceil":"floor"](i/n)*n+o)},getDPI:()=>{let t=1;return typeof window=="object"&&(t=window.devicePixelRatio||1),t},getFromPath:(t,e)=>{const n=e.split(".");let o=t;for(let r=0;r<n.length;r++){const i=n[r];if(!o)return null;let s=o[i];if(typeof s=="function"&&(s=s.bind(o)()),!s||!Dn(s))return s;o=s}return o??null},getOS:$n,hasFocus:di,isDefined:t=>t!=null,isEmpty:t=>t==null||t==="",isEqualArrays:fl,isEqualBounds:(t,e)=>t===e||!(t&&!e||e&&!t)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEqualObjectKeys:(t,e)=>{if(t===e)return!0;if(t&&!e||e&&!t)return!1;const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o=0;o<n.length;o++)if(t[n[o]]!==e[n[o]])return!1;return!0},isNode:wl,isNullOrUndefined:si,isNumeric:t=>{const e=1*t;return Number.isFinite(e)&&typeof e=="number"},isObject:Dn,isPromiseLike:t=>!!t&&typeof t.then=="function",isRectInsideRect:(t,e)=>t.top>=e.top&&t.bottom<=e.bottom&&t.left>=e.left&&t.right<=e.right,isRectIntersect:ai,mergeContentful:(...t)=>{const e=t.length;if(e>0&&t[e-1]!==void 0&&!Dn(t[e-1]))return t[e-1];let n=t[0]||{};for(let o=1;o<e;o++)n=Jt(n,t[o]||{},{arrayMerge:(r,i)=>[...i]});return n},nextTick:t=>{typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{t()}):(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{t()})},openFileDialog:(t="*.*")=>new Promise((e,n)=>{if(!ci)return void n("Unable to open dialog with no dom.");const o=document.createElement("input");o.type="file",o.accept=t;let r=null,i=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{r||i||(i=!0,e(null))},1e3)},{once:!0,passive:!0}),o.onchange=()=>{if(r=o.files[0],r){if(i)return void console.warn("File open detected after faux cancel.",r);e(r)}},o.autofocus=!0,o.click()}),rafThrottle:t=>{let e,n=!1,o=function(){n=!1,t(e)};return function(r){e=r,e&&e.persist&&e.persist(),n||(n=!0,requestAnimationFrame(o))}},removeEmptyProperties:pl,removeEqualValues:vl,removeListenerAll:t=>{if(!t)return[];for(let e=0;e<t.length;e++)t[e]&&t[e]();return[]},requestTimeout:(t,e)=>{const n=li(),o={id:requestAnimationFrame(function r(){li()-n>=e?t.call(null):o.id=requestAnimationFrame(r)})};return o},roundAccurately:(t,e=0)=>{if(t==null||!isFinite(t))return null;const n=10**e;return Number(Math.round(t*n)/n)},setToPath:(t,e,n)=>{const o=e.split(".");let r=t;if(!r)throw new Error("Can not set path to a null path.");for(let i=0;r&&i<o.length-1;i++){const s=o[i];let a=r[s];if(a==null&&(a={},r[s]=a),!Dn(a))throw new Error("Can not set path to a non object path.");r=a}if(typeof n!="number"&&typeof n!="boolean"&&typeof n!="string"&&!Dn(n))throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);return r[o[o.length-1]]=n,t},splitNumber:t=>{let e=Math.abs(t);if(isNaN(e)||!isFinite(t))return null;let n=0|e,o=e-n,r=0,i=0,s=1;if(o>5e-8)for(;i<8&&Math.abs(r/s-o)>5e-8;)i++,s*=10,r=Math.round(o*s);return{ip:Math.trunc(t),fp:r,ipLength:Math.ceil(Math.log10(n+1)),fpLength:i}},subtractRect:(t,e,n=!1)=>{if(!e)return[t];if(!ai(t,e))return[];const o=[];let r=t;const i=()=>{e.top>r.top&&e.top<r.bottom&&(o.push({...r,bottom:e.top}),r={...r,top:e.top})},s=()=>{e.bottom>r.top&&e.bottom<r.bottom&&(o.push({...r,top:e.bottom}),r={...r,bottom:e.bottom})},a=()=>{e.right>r.left&&e.right<r.right&&(o.push({...r,left:e.right}),r={...r,right:e.right})},d=()=>{e.left>r.left&&e.left<r.right&&(o.push({...r,right:e.left}),r={...r,left:e.left})};return n?(d(),a(),i(),s()):(i(),s(),a(),d()),o},textToKey:t=>t.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(t,e){let n=null;return(...o)=>{const r=Date.now();(!n||r-n>=e)&&(n=r,t(...o))}},toSafeJSON:function t(e){if(e===null||typeof e!="object")return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(o=>t(o));if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();const n={};for(const o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o]));return n},transpose:t=>{if(!t)return t;const e=t.length,n=t[0].length,o=[];for(let r=0;r<n;r++)o[r]=Array(e);for(let r=0;r<e;r++)for(let i=0;i<n;i++)o[i][r]=t[r][i];return o},uuidV4:vo,validEnumValue:(t,e)=>{if(!Object.values(t).includes(e))throw new Error(`Invalid type: ${e??"null"}. Must be one of: ${Object.values(e).join(", ")}.`)},whenFocus:async(t,e=!1)=>new Promise(n=>{di(t,e)?n(!0):t.addEventListener("focusin",()=>{n(!0)},{once:!0}),t.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:t=>`Invalid argument: '${t}'.`},Symbol.toStringTag,{value:"Module"}));const yl=t=>{const e=new Uint8Array(t),n=e.byteLength;let o="";for(let r=0;r<n;r++)o+=String.fromCharCode(e[r]);if(typeof window<"u"&&typeof globalThis.btoa=="function")return globalThis.btoa(o);if(typeof Buffer<"u")return Buffer.from(o,"binary").toString("base64");throw new Error("Unsupported environment")},gr=t=>new Promise((e,n)=>{if(t)if(typeof FileReader<"u"){const o=new FileReader;o.onload=()=>{e(o.result)},o.onerror=()=>{n(o.error)},o.readAsText(t)}else if(typeof Buffer<"u"){const o=r=>Buffer.from(r).toString("utf-8");t.arrayBuffer().then(r=>{e(o(r))}).catch(r=>{n(r)})}else n(new Error("Unsupported environment"));else e("")});Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:yl,base64ToArrayBuffer:t=>{const e=typeof window<"u"&&typeof globalThis.atob=="function"?globalThis.atob(t):Buffer.from(t,"base64").toString("binary"),n=e.length,o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=e.charCodeAt(r);return o.buffer},blobToString:gr},Symbol.toStringTag,{value:"Module"}));const bl="data:image/png;base64,",xl="Unable to resolve image.",ui=t=>new Promise(async(e,n)=>{let o=null;try{o=new Image,o.src=t,o.addEventListener("load",function(){e({width:o.naturalWidth,height:o.naturalHeight})},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(t),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(xl)}),Zo="image/svg+xml";var hi,gi;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:bl,getImageDataUrl:(t,e=1)=>new Promise(async(n,o)=>{let r=null;try{r=new Image,r.src=t,r.addEventListener("load",function(){try{const i=document.createElement("canvas");i.width=r.naturalWidth,i.height=r.naturalHeight,i.getContext("2d").drawImage(r,0,0);const s=i.toDataURL("image/png",e);n({elemImg:r,dataUrl:s})}catch(i){URL.revokeObjectURL(t),o(i)}},{once:!0}),r.addEventListener("error",function(){URL.revokeObjectURL(t),o("Invalid Image")},{once:!0}),await r.decode("sync")}catch{r?.src&&URL.revokeObjectURL(r.src)}r||o(xl)}),loadImageDetails:async(t,e=null)=>{let n=null;const o=async()=>{try{const i=e??"image/*",s=URL.createObjectURL(new Blob([t],{type:i})),a=await ui(s);n={mimeType:i,naturalDimensions:a,asUrl:s}}catch{}},r=async()=>{try{const i=new TextDecoder().decode(t),s=URL.createObjectURL(new Blob([i],{type:Zo})),a=await ui(s);n={mimeType:e??Zo,naturalDimensions:a,asUrl:s,asSVGText:i}}catch{}};if(e===Zo?await r():e.startsWith("image/")?await o():(await o(),n||await r()),!n)throw new Error("Failed to load image");return n}},Symbol.toStringTag,{value:"Module"})),(gi=hi||(hi={})).resolveTypedUpdates=(t,e,n,o)=>{if(t===null)return t;if(t===void 0)return o;let r=t;if(e?.shorthand){const d=e?.shorthand(t,n);d!==void 0&&(r=d)}if(r!==null&&e?.getSubType){const d=e.getSubType(r);d&&(e=d)}const i=e?.properties,s=e?.arrayType??!1;let a=r;if(e&&e.merge&&a&&o)a=e.merge(a,o,n);else if(!s&&i){const d=Object.keys({...r,...o});a=null;for(let c=0;c<d.length;c++){const f=d[c];let h,u=r[f];if(u!==void 0){const w=i[f];h=w?(0,gi.resolveTypedUpdates)(u,w,n,o?.[f]):u}else h=o?.[f];h!=null&&(a=a??{},a[f]=h)}}return a};const mi=`The Safari browser does not support advanced copy and paste.
|
|
8
|
-
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ue=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Dt=require("react-dom"),cn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),ml=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:cn},Symbol.toStringTag,{value:"Module"})),hr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),ao=(e,t=!0,n=hr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=ue.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},fl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:hr,findNextFontSize:ao},Symbol.toStringTag,{value:"Module"})),so=o.memo(e=>{const{anchorLocation:t=ue.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:p,style:g,...x}=e,h=a,f=l;let T="red",q=[],A=[];return t===ue.AnchorLocation.TopLeft?(T=d?"rgb(255, 198, 246)":"green",q.push(f),A.push(f),q.push(f+h),A.push(f),q.push(f),A.push(f+h)):t===ue.AnchorLocation.TopRight?(T=d?"rgb(0, 255, 255)":"red",q.push(n-f),A.push(f),q.push(n-(f+h)),A.push(f),q.push(n-f),A.push(f+h)):t===ue.AnchorLocation.BottomRight?(T=d?"rgb(236, 252, 211)":"purple",q.push(n-f),A.push(i-f),q.push(n-(f+h)),A.push(i-f),q.push(n-f),A.push(i-(f+h))):t===ue.AnchorLocation.BottomLeft&&(T=d?"rgb(255, 236, 183)":"blue",q.push(f),A.push(i-f),q.push(f+h),A.push(i-f),q.push(f),A.push(i-(f+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...g},...x,children:c.jsx("path",{d:`M ${q[0]} ${A[0]} L ${q[1]} ${A[1]} L ${q[2]} ${A[2]} L ${q[0]} ${A[0]} Z`,fill:m??T,...p})})}),mr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...p}=e,g=o.useMemo(()=>{let T=null;const q=l.getSortField();q&&(T=q.reverse);const A=l.getField(),D=A&&A.criteria&&A.criteria.length>0;return T===!0?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":T===!1?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[l]),[x,h]=o.useState(!1),f=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${f}px`,height:`${f}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${x&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(f>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:T=>{d?.(T,l)},...p,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${x&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:g})})})},fr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:p,bodyStyle:g,normalStyle:x,showFormulas:h,showZeros:f,docTheme:T,onLinkMouseDown:q,onFilterButtonMouseDown:A,filterButtonProps:D,createFilterButton:G=mr,...U}=e,y=i.height/m,B=i.width/m,S=t,w=S.getValue(),k=t.getStyle(),O=g?.darkMode??!1;let E,F;const Z=w&&w.isFormulaError,_=Z&&w instanceof s.FormulaError.Parse;let P,V=h||_;if(V)if(S.isSpillOverflow())F="";else{const Ae=S.getFormulaText();Ae?F=Ae:E=S.getNumberFormat(s.NumberFormat.Type.General)}else E=S.getNumberFormat();V||(P=S.getTextOverflow());const $=P?P.colBounds.width+P.leftOffset+P.rightOffset:B,oe=P?P.anchorBounds.x-P.leftOffset:0,L=P?P.anchorBounds.width:B,z=P?P.anchorBounds.x:0;let K,W=S.getRenderHorizontalAlignment();E&&(K=E?.formattedRuns,F=K?.runs[0]?.text??E.displayText);const Ce=S.getCalcStatus()===s.ICell.CalcStatus.Pending;let ae=null,Q=k.getFill().toCSS(O,i),ee=0,we=0;if(!k.getBorder().isEmpty()){const Ae=k.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(ee=1);const R=k.getBorder().getBottom();!R.isNone()&&s.IBorder.BuiltInDefinitions.get(R.getStyle()).width>1&&(we=1)}let ke=null;if(B!==L||ee||we||typeof Q?.backgroundPosition=="number"){const{backgroundPosition:Ae,...R}=Q,re=Ae??0,j=p?.getScrollTopLeft(),Y=re?-(i.x+(j.left??0))%re:0,u=re?-(i.y+(j.top??0))%re:0;(Ae!==void 0||ee||we||B!==L)&&(Object.keys(R).length===1&&R.background==="none"||(Q=null,ke=c.jsx("div",{className:"fill",style:{marginLeft:`${Y}px`,marginTop:`${u}px`,left:z*m,width:r.ReactUtils.boundPixel(L*m-Y+1+ee),height:r.ReactUtils.boundPixel(i.height-u+1+we),...R}},"background")))}let ve=null;const Pe=S.getComments(),ge=S.getWarnings(),He=S.getErrors();if(Pe||Z||He.length>0||ge.length>0){const Ae={size:7*m,darkMode:O,cellWidth:L*m+2,cellHeight:y*m+2,style:{top:-1,left:z*m-1}};ve=ve??[],(ge.length>0||He.length>0||Z)&&ve.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopLeft,...Ae},`indicator-${ve.length}`)),Pe&&ve.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopRight,...Ae},`indicator-${ve.length}`))}const Se=k.getFont();let ce=E?.conditionalColor;const de=k.getAlignment(),he=de.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,pe=de.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||he,xe=pe||V?0:de.getRotation(),Me=S.getInsets(),be=Me.top+Me.bottom;let Ee=Me.left,Le=Me.right;const Ve={...l,left:l.left-1,top:l.top-1,width:l.width+1+ee,height:l.height+1+we},C=S.getColumnFilter(),Ue=C&&!C?.hasHiddenButton();let Qe=null;Ce&&(Qe=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const $e=!(Ce||Ue||ke||a||ve||K?.runs.length>1||P||xe%360!=0);Q?.background==="none"&&(Q=null);let J=pe||!(!P||!(P.rightIndex>0||P.leftIndex>0||P.colSpan>1));if(!J){const Ae=S.getSpans();(Ae.width>1||Ae.height>1)&&(J=!0)}const Fe={...Q,...Ve,pointerEvents:q?"auto":void 0};if(!ue.CommonUtils.isEmpty(F)||!ue.CommonUtils.isEmpty(E?.repeatPlaceholder)){const Ae=E?.canWrap??!1;let R=null,re=null,j=null,Y=[],u=!0;f||V||w!==0||(u=!1);const M=S.getTextFrame(V);if(u&&M){let I=$-1-(Ee+Le);if(xe){R=M.layout().bounds;const ye={x:0,y:0,width:$-1,height:y};if(K){let me=K.width;if(E.repeatPlaceholder||E.repeatChars.length>0){const fe=s.GeomUtils.boundsToPoints(ye),qe=s.GeomUtils.rotatePoints(fe,-xe);me=s.GeomUtils.minBoundingRect(qe).width}R={...R,width:me}}j=s.GeomUtils.clipToOuterRect({...R,width:R.width+1+Ee+Le},ye,xe),I=j.width-1-(Ee+Le)+.01}let b=null;Ae&&(b={width:I});let N=null,v=E?.repeatPlaceholder;const H=M.layout(b);if(R=H.bounds,V?R={...R,width:0}:K&&(R={...R,width:E.repeatPlaceholder||E.repeatChars.length>0?I:K.width}),xe&&Ae){let se=null;H.visitLines({visitTextLine:(ye,me)=>{let fe=ye.bounds;const qe=s.GeomUtils.boundsToPoints(fe),Oe=s.GeomUtils.rotatePoints(qe,xe),De=s.GeomUtils.minBoundingRect(Oe);fe={...fe,x:(De.width-fe.width)/2,y:(De.height-fe.height)/2},se=se?s.GeomUtils.unionBounds(se,fe):fe}}),R={...se,width:se.width+Ee+Le}}if(!v&&S.getType()!==s.ScalarType.String&&Math.floor(R.width)>I){if(k.getNumberFormat()==="General"&&S.getType()===s.ScalarType.Number){const se=k.measureText("0"),ye=Math.floor(I/se.width),me=w,fe=ue.CommonUtils.splitNumber(me),qe=Math.min(10,ye-(Math.max(1,fe.ipLength)+1)-(me<0?1:0));if(qe>=-1){const Oe=`0${qe>0?".":""}${"#".repeat(Math.max(0,qe))}`;N=S.getNumberFormat(Oe).displayText,N==="0"&&me<0&&(N="-0")}else if(Math.abs(me)>=Math.pow(10,5)||Math.abs(me)<=Math.pow(10,-5)){const Oe=ye-5-(me<0?1:0);if(Oe>=0){const De=`0.${"0".repeat(Math.max(0,Oe-1))}E+00`;N=S.getNumberFormat(De).displayText}}}N||(v="#")}if(!v&&K?.lastRepeatIndex>=0&&K?.width>I&&(v="#"),v&&I>0){const se=k.measureText(v),ye=Math.floor((I||1)/(se?.width||1));N=ye>0?v.repeat(ye):""}if(V&&(W=s.ITextFrame.HorizontalAlignment.Left),N){const se=k.measureText(N).width;se&&(R={...R,width:se})}if(re={...R,width:R.width+Ee+Le,height:R.height},xe&&!Ae){const se=s.GeomUtils.boundsToPoints(re),ye=s.GeomUtils.rotatePoints(se,xe),me=s.GeomUtils.minBoundingRect(ye);re.width=me.width,re.height=me.height}W===s.ITextFrame.HorizontalAlignment.Center||W===s.ITextFrame.HorizontalAlignment.CenterContinuous?re.x=($-re.width)/2:W===s.ITextFrame.HorizontalAlignment.Right?re.x=$-re.width-.5:re.x=.5,de.getVertical()===s.ITextFrame.VerticalAlignment.Center?re.y=(y-re.height)/2:de.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?re.y=y-re.height-be:re.y=be;const X=$e?{...U}:void 0,ne={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:xe?`rotate(${xe}deg)`:void 0,cursor:q?"pointer":void 0,pointerEvents:q?"auto":void 0,zIndex:J?1:void 0,...Q},onMouseDown:q,onDoubleClick:q?se=>{se.stopPropagation(),se.preventDefault()}:null,...X};_&&(ne.style.textDecorationStyle="wavy",ne.style.textDecorationColor=O?"rgb(0, 255, 255)":"red",ne.style.textDecorationLine="underline");const le=Se.getSize(),ie=(se,ye,me,fe,qe,Oe,De,We=null)=>{let je=le*m,Ge=me,Ne=De?.runs?De.runs:[{type:s.NumberFormat.ParseRunType.Text,text:se,width:k.measureText(se,je).width}];De&&De?.width!==R.width&&(R={...R,width:De?.width});let Xe=Ee;if(De?.lastRepeatIndex>=0&&I>De?.width){const _e=De.runs[De.lastRepeatIndex];if(_e){const rt=[...Ne],vt=Math.max(0,I-1-De.width);let yt=0,Ct="";if(vt>0){const gt=Math.floor(vt/_e.width);Ct=gt>0?_e.text.repeat(gt):"",yt=vt}rt[De.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:Ct,width:yt},Ne=rt,R={...R,width:De.width+yt}}}const it=(_e,rt,vt,yt,Ct,gt,lt,Tt,Lt,Zt=null)=>{let Ft,Xt=Ge.width;qe===s.ITextFrame.HorizontalAlignment.Justify?(Xt=Ct,Oe||(Ft="justify")):qe===s.ITextFrame.HorizontalAlignment.Distributed&&(Xt=Ct,Ft=Oe||_e.text.split(" ").length-1==0?"center":"justify");const{style:Mt,className:vn,...Cn}=Zt;let Ot=_e.text;if(qe===s.ITextFrame.HorizontalAlignment.Fill&&E?.repeatChars.length===0){const at=Math.max(1,Math.floor((Ge?.width??0)/(lt?.width??1)));Ot=Ot.repeat(at)}let kt=Ge.height;const At=Se.getVerticalAlignment(),Yt=At===s.IFont.VerticalAlignment.Sub,Hn=At===s.IFont.VerticalAlignment.Super;if(Yt||Hn){const at=Se.getSuperSubScale();je*=at,kt*=at}const nt={textAlign:Ft,textAlignLast:Ft,background:void 0,...Mt,...Se.toCSS(O,m,!0),fontSize:je*s.IFont.getDeviceScale()};ce&&(nt.color=ce.toCSS(O));const Jt=Xe+rt;let jt=Me.top+Ge.y+0;if(Yt&&(jt+=Lt-je),gt){const at=(lt.x+Jt)*m+1,ht=(lt.y+jt)*m+1;ht<0?nt.marginTop=ht:nt.paddingTop=ht,at<0?(nt.width=(Mt?.width??0)-at,nt.left=(Mt?.left??0)+at):nt.paddingLeft=at,nt.paddingRight=Math.max(0,(Mt?.width??0)-Xt*m-at),nt.paddingBottom=Math.max(0,(Mt?.height??0)-Ge.height*m-ht),nt.height=(Mt?.height??0)+(ht<0?-ht:0),(ht<0||at<0)&&(nt.clipPath=`inset(${ht<0?-ht:0}px 0px 0px ${at<0?1-at:0}px)`)}else if(nt.left=(lt.x+Jt)*m+1,nt.top=(lt.y+jt)*m+1,nt.width=lt.width*m,nt.height=lt.height*m,xe&&!Ae){nt.left=(lt.x+rt)*m+1,nt.top=(lt.y+(Ge.y+0))*m+1;const at=s.GeomUtils.centerPoint({x:Xe+rt,y:0,width:_e.width,height:Ge.height}),ht=s.GeomUtils.centerPoint({x:Xe,y:0,width:Ct,height:Ge.height}),Qt=s.GeomUtils.rotatePoints([at],xe,ht),yn={x:Qt[0].x-at.x,y:Qt[0].y-at.y};nt.left=nt.left+yn.x*m,nt.top=nt.top+yn.y*m;const Bt={...Ge,x:Xe,y:Me.top,width:Ge.width+(Ee+Le)},Un=s.GeomUtils.boundsToPoints(Bt),en=s.GeomUtils.rotatePoints(Un,xe),wn=s.GeomUtils.minBoundingRect(en);Bt.width=wn.width,Bt.height=wn.height;const Vt=s.GeomUtils.centerPoint(Bt),xn={x:Vt.x-ht.x,y:Vt.y-ht.y};nt.left=nt.left+xn.x*m,nt.top=nt.top+xn.y*m}nt.lineHeight=kt*m+"px";const bn=$e?void 0:"text-line";Y.push(c.jsx("div",{className:vn?`${vn} ${bn}`:bn,style:nt,...Cn,children:Ot},`text-${Ge.y}-${yt}-${vt}`))};if(de.getOverflow()===s.ITextFrame.Overflow.Shrink&&I>0){let _e=R?.width??0,rt=0;for(;_e>1&&_e>I&&je>2&&rt<100;)je*=I/_e,_e=k.measureText(se,je).width,rt++;R={...R,width:_e}}let pt=Ge.x;qe===s.ITextFrame.HorizontalAlignment.Right?pt+=R.width-Ge.width:qe!==s.ITextFrame.HorizontalAlignment.Center&&qe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(pt+=(R.width-Ge.width)/2),De?.lastRepeatIndex>=0&&(pt=Ge.x);const wt=Ne.length;for(let _e=0;_e<wt;_e++){const rt=Ne[_e];(rt.type===s.NumberFormat.ParseRunType.Text||rt.type===s.NumberFormat.ParseRunType.Repeat)&&(rt.type,s.NumberFormat.ParseRunType.Repeat,it(rt,pt,_e,ye,qe===s.ITextFrame.HorizontalAlignment.Justify||qe===s.ITextFrame.HorizontalAlignment.Distributed||De?.lastRepeatIndex>=0?I:Ge.width,$e,{x:re.x+oe,y:re.y,width:rt.width,height:R.height},0,fe,We)),pt+=rt.width}};N?ie(N,0,{x:0,y:0,...R},H.lines[0].baseline,W,!0,null,ne):H.visitLines({visitTextLine:(se,ye,me)=>{const fe=se.runs[0].text.replace(/\s+$/,""),qe=ye===me-1;let Oe=W===s.ITextFrame.HorizontalAlignment.Justify&&(qe||se.runs[0].text.endsWith(`
|
|
8
|
+
`))?s.ITextFrame.HorizontalAlignment.Left:W,De=0;ye>0&&(de.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||de.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(De=Math.max(0,(y-(be+3)-se.bounds.height*me)/(me-1)*ye)),de.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&xe&&xe%90==0&&xe%180!=0&&(Oe=s.ITextFrame.HorizontalAlignment.Distributed),Oe!==s.ITextFrame.HorizontalAlignment.Justify&&Oe!==s.ITextFrame.HorizontalAlignment.Distributed&&Oe!==s.ITextFrame.HorizontalAlignment.Fill||(R={...R,width:I});const We={...se.bounds,y:se.bounds.y+De+0,width:he||E&&(E.repeatChars.length>0||E.spacingChars.length>0)?R.width:se.bounds.width};ie(fe,ye,We,M.lines[0].baseline,Oe,qe,me===1?K:null,$e&&ye>0?{...ne,style:{...ne.style,background:void 0}}:ne)}})}Y.length>0&&(ae=Y)}if($e)return ae&&ae.length>0?ae:c.jsx("div",{style:Fe,...U});let Be=q?"auto":Ve.pointerEvents,Ie=null;if(Ue){const Ae={x:z*m-1,y:-1,width:L*m+1,height:y*m+1};Be="auto",Ie=G({renderBounds:Ae,darkMode:O,className:"filter-button",disabled:!S.isEditAllowed(),zoom:m,filter:S.getColumnFilter(),onFilterButtonMouseDown:A,...D}),Ie&&(Ie=c.jsx("div",{style:{...Ae,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:R=>{R.stopPropagation(),R.preventDefault()},children:Ie},"filterButton"))}Ce&&!ae&&(ae=c.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ze=[ke,ae,a,ve,Qe,Ie];return c.jsx("div",{style:{...Q,...Ve,pointerEvents:Be},...U,children:ze})},To={text:"",placeholder:""},Io=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},pl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),pr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:p,useRichStyling:g=!0,bodyStyle:x,activeCoords:h,sheet:f,commands:T,containerBounds:q,setNaturalDimensions:A,onFocus:D,disabled:G,style:U,zoom:y=1,linesVisible:B,autoFocus:S=!1,...w}=e,{height:k=0,width:O=0}=q??{},E=x?.darkMode??!1,F=o.useRef(null),[Z,_]=o.useState(!1),[P,V]=o.useState(null),[$,oe]=o.useState(()=>n);o.useEffect(()=>{we.current=!1,oe(n)},[n]);const L=o.useMemo(()=>{const R=$.clean();let re=R.getStyle();g||(re=re.createTemporaryStyle({font:{size:p?.fontSize}}));const j=R.getFormula(),Y=re.getAlignment(),u=j?s.ITextFrame.HorizontalAlignment.Left:Y.getHorizontal(),M=Y.getVertical(),I=Y.getOverflow()===s.ITextFrame.Overflow.Wrap||R.getType()===s.ScalarType.String&&(u===s.ITextFrame.HorizontalAlignment.Justify||u===s.ITextFrame.HorizontalAlignment.Distributed||M===s.ITextFrame.VerticalAlignment.Justify||M===s.ITextFrame.VerticalAlignment.Distributed),b=(H=>{if(!H)return To;const X=H.clean();if(!X)return To;let ne=X.getStyle()?.getQuotePrefix();if(H.dirty===void 0||H.dirty===null){let le="",ie=X.getFormulaText();ie&&(le=ie,ne=!1),le||(le=X.toTextUnformatted(!0)??"");let se="";if(!H.editMode&&X.isSpillOverflow()){const ye=X.getSpill();if(ye){const me=ye.getCell(),fe=me.getFormulaText();me.isEqual(X)||(se=fe)}}return ne&&(le="'"+le),{text:le,placeholder:se}}return{text:H.dirty??"",placeholder:""}})($),N=b.text,v=s.ITextFrame.toCSSHorizontalTextAlign(g&&!j?$.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:re,isWrapped:I,textValue:N,formula:j,frameVertAlign:M,placeholder:b.placeholder,insets:g?R.getInsets():ue.TypesUtils.EmptyRect,textAlign:v}},[$,p,E,y,g]),z=o.useRef(null),K=r.useImperativeElement(t,()=>({startEdit:R=>{F.current=R?.initialSelection;const re={...n,editMode:R?.editMode??!1};R?.text!==void 0&&(re.dirty=R.text),re.editMode===n.editMode&&re.dirty===n.dirty||(oe(re),ae?.(re))},submitEdit:()=>ke(),cancelEdit(){ve()},autoFocus(){z.current.focus()},dispatchEvent:R=>z.current.dispatchEvent(R),focus(){z.current.focus()},getLineHeight:Ce}),[i,n]);o.useLayoutEffect(()=>{if(!P||!Z)return;const R=z.current;L.textValue,R&&R.setSelectionRange(P.start,P.end,P.direction)},[z.current,P,L.textValue]);const W=o.useMemo(()=>{const R=$?.clean(),re=L.style.createTemporaryTextFrame(L.textValue,R?.getType()===s.ScalarType.String),j=g?R.getInsets().right+R.getInsets().left:0;let Y=null;return L.isWrapped&&(Y={width:O-j}),re.layout(Y)},[L,O,$,g]),Ce=r.useCallbackRef(()=>Math.ceil(W?.lines[0]?.bounds.height),[W]);o.useLayoutEffect(()=>{if(!W)return;const R=L.style,re=R.getInsets()??ue.TypesUtils.EmptyRect,j=g?re.left+re.right:0,Y=g?.04*R.getFont().getSize():1,u=Math.round(L.isWrapped?void 0:W.bounds.width+j+Y),M=Math.round(W.bounds.height);A?.({width:u,height:M})},[W,A,L,g,$]);const ae=r.useCallbackRef(a,[a]),Q=r.useCallbackRef(R=>{if($.dirty===R)return;const re={...$};re.dirty=R,z.current,oe(re),ae?.(re)},[$]),ee=r.useCallbackRef(R=>{if($.editMode===R)return;const re={...$};re.editMode=R,oe(re),ae?.(re)},[$]),we=o.useRef(!1),ke=r.useCallbackRef(()=>{if(we.current)return!1;try{l?.($),m?.(),we.current=!0}catch{return!1}return!0},[l,$]),ve=r.useCallbackRef(()=>{we.current=!0,oe(n),d?.(),m?.()},[d,n]),Pe=r.useCallbackRef(R=>{if(!z.current)return;if(R.key,R.isDefaultPrevented(),!(R.isTrusted||R.nativeEvent.ctrlKey||R.nativeEvent.metaKey||R.nativeEvent.altKey||R.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(R.nativeEvent.key)===-1&&R.nativeEvent.key!=="Backspace")){const b={...$};let N=0;return Io(b,b.dirty)&&!isNaN(parseFloat(R.key))?(b.dirty?.endsWith("%")?b.dirty=(b.dirty.substring(0,b.dirty.length-1)??"")+R.key+"%":b.dirty=(b.dirty??"")+R.key+"%",N=b.dirty.length-1):R.nativeEvent.key==="Backspace"?(b.dirty="",N=b.dirty.length):(b.dirty=(b.dirty??"")+R.key,N=b.dirty.length),z.current.value=b?.dirty,F.current={start:N,end:N,direction:"forward"},z.current?.setSelectionRange(N,N,"forward"),oe(b),ae?.(b),void R.preventDefault()}const re=R.nativeEvent.ctrlKey,j=R.nativeEvent.shiftKey,Y=R.nativeEvent.altKey,u=R.nativeEvent.metaKey;if(re&&R.key==="z"&&R.stopPropagation(),R.which===r.KeyCodes.Escape)return R.preventDefault(),void ve();if(R.which===r.KeyCodes.F2)return ee(!0),void R.preventDefault();const M=R.target;if(R.key==="%"&&M.selectionStart===M.selectionEnd&&M.value[M.selectionStart]==="%"&&$?.clean().getStyle().numberFormat.includes("%"))return V({start:M.selectionStart+1,end:M.selectionEnd+1,direction:M.selectionDirection}),void R.preventDefault();if(R.which===r.KeyCodes.Enter){if(R.preventDefault(),u||Y){const b=L.textValue.substring(0,M.selectionStart)+`
|
|
9
|
+
`+L.textValue.substring(M.selectionEnd);return Q(b),void V({start:M.selectionStart+1,end:M.selectionStart+1,direction:M.selectionDirection})}return void(ke()&&f.getSelection().traverse(s.IRange.Orientation.Column,j))}if(R.which===r.KeyCodes.Tab)return R.preventDefault(),void(ke()&&f.getSelection().traverse(s.IRange.Orientation.Row,j));let I=null;switch(R.which){case r.KeyCodes.Left:I=s.IRange.Direction.Left;break;case r.KeyCodes.Right:I=s.IRange.Direction.Right;break;case r.KeyCodes.Up:I=s.IRange.Direction.Up;break;case r.KeyCodes.Down:I=s.IRange.Direction.Down}if(I&&!(re||j||Y||u)&&!$.editMode)return void ke();$.editMode&&(I||pl.includes(R.which))&&R.stopPropagation()},[$,f,L]),ge=o.useCallback(()=>{z.current?.focus(),setTimeout(()=>{z.current?.select()},0)},[]),He=o.useCallback(()=>{z.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Se=r.useCallbackRef(()=>{const R=z.current?.value;let re="";if(h.rowIndex>0){const j=f.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();j&&(re=j.toTextUnformatted(!0))}Q(R+re)},[h,f]);o.useEffect(()=>f.getRange(h).addListener(()=>{const R={...$,clean:()=>f.getRange(h).getCell()};oe(R),ae?.(R)}),[h,f]);const ce=o.useCallback(()=>{const R=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Medium Time"}}).toText();Q((z.current?.value??"")+R)},[f]),de=o.useCallback(()=>{const R=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Short Date"}}).toText();Q((z.current?.value??"")+R)},[f]),he=o.useMemo(()=>({element:()=>z.current,doCopy:R=>{const re=z.current.value.substring(z.current.selectionStart,z.current.selectionEnd);if(R?.isCut){const j=z.current.value.substring(0,z.current.selectionStart)+z.current.value.substring(z.current.selectionEnd,z.current.value.length);Q(j)}return re}}),[z.current]),pe=o.useMemo(()=>({element:()=>z.current,doPaste:async(R,re)=>{const j=await R.toText?.();if(!j)return!0;const Y=z.current.value.substring(0,z.current.selectionStart)+j+z.current.value.substring(z.current.selectionEnd,z.current.value.length);return Q(Y),V({start:z.current.selectionStart+j.length,end:z.current.selectionStart+j.length,direction:"forward"}),!0}}),[z.current]),xe=o.useMemo(()=>({contains:R=>z.current?.contains(R)||!1,focus(){z.current.focus()}}),[]),Me=o.useMemo(()=>[new r.SimpleCommand("selectAll",xe,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},ge),new r.SimpleCommand("startEditValueAbove",xe,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Se),new r.SimpleCommand("startEditCurrentTime",xe,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},ce),new r.SimpleCommand("startEditCurrentDate",xe,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},de),new r.Command("relativeReferencesToggle",xe,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},He),new r.Command("toggleEditorFocus",xe,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),be=o.useMemo(()=>{let R=null;const re=()=>({contains:j=>z.current?.contains(j)||!1,focus(){z.current.focus()}});return R=T?T.createChildGroup(re,"editor",!1):new r.CommandGroup(re,"editor"),R.addCommands(Me,!0),R},[T,Me]),Ee=o.useMemo(()=>({notifier:null,source:he,target:pe,commands:be}),[he,pe,be]);r.useCopyPaste(Ee);const[Le,Ve]=o.useState(!S);o.useEffect(()=>{Ve(!1)},[]);const C=r.useCallbackRef(R=>{_(!0),be?.activate();const re=F.current;if(re!==!1){let j,Y;const u=z.current.value;Io($,u)&&(j=u.length-1,Y=u.length-1),j=re?.start??j??u.length,Y=re?.end??Y??u.length,F.current=!1,V({start:j,end:Y,direction:"forward"})}D?.(R)},[D,$]),Ue=L.insets;let Qe=Ue.left+1;const $e=Ue.left+Ue.right+2-1,J=W?.bounds.height??0;let Fe,Be=Ue.top;L.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?Be=Math.max(0,(k-(Ue.top+Ue.bottom)-J)/2):L.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(Be=Math.max(0,k-(Ue.top+Ue.bottom)-J)),B!==void 0&&W?.lines[0]?.bounds&&(Fe=W?.lines[0]?.bounds.height*B);const Ie=L.style.getFont();let ze=Ie.getSize();Ie.isSuperSub()&&(ze*=Ie.getSuperSubScale()),ze*=s.IFont.getDeviceScale()*y;const Ae=g?Ie.toCSS(E,y):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:R=>{z.current&&document.activeElement!==z.current&&requestAnimationFrame(()=>{z.current.focus()})},ref:K,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...U},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Be*y+1,left:Qe*y,width:`calc(100% - ${$e*y}px)`,maxWidth:`calc(100% - ${$e*y}px)`,height:(Fe??J)*y,maxHeight:(Fe??J)*y},children:c.jsx("textarea",{spellCheck:"false",placeholder:L.placeholder,ref:z,value:L.textValue,disabled:Le,readOnly:G||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:ze?`${ze}px`:"inherit",textAlign:L.textAlign,lineHeight:(W?.lines[0]?.bounds.height??0)*y+"px",height:(W?.bounds.height??0)*y,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:L.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:C,onBlur:()=>{_(!1)},onSelect:R=>{},onChange:R=>{z.current&&!we.current&&(F.current=!1,Q(R.target.value),L.textValue,R.target.value,R.target.selectionStart,R.target.selectionEnd,R.target.selectionDirection,V({start:R.target.selectionStart,end:R.target.selectionEnd,direction:R.target.selectionDirection}))},onMouseDown:R=>{Z&&ee(!0)},onKeyDown:Pe})})})})),vr=(e,t)=>({clean:e,dirty:t,editMode:!1}),Cr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:p=0,isVertical:g=!1,...x}=e,h=U=>{let y=null;if(U&&n>0){y="";for(let B=0;B<U.length;B++)y+=U[B],B<U.length-1&&(y+=",")}return y},f=h(i);let T=f;a&&(T=h(a));let q=n,A=t,D=null;if(l){q=Math.floor(n/2);const U=q+q/2+1;let y=null;y=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:T,d:y,...x})}if(d){q=n/2;const U=q+q/2;let y=T,B=null;B=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:y,strokeDashoffset:"1",shapeRendering:"crispEdges",d:B,...x})}let G=null;return G=g?`M ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+q/2)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+q/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:q,strokeDasharray:f,d:G,...x}),D]})};function Qn(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Wt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=Qn(i,t),l=typeof a=="function";n.push(l?a:()=>Qn(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)Qn(n,t)}},vl=function(){},br=typeof window<"u",rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cl=br?o.useLayoutEffect:o.useEffect,Eo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const zt=br&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Eo),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var p=m[0].contentRect,g=p.x,x=p.y,h=p.width,f=p.height,T=p.top,q=p.left,A=p.bottom,D=p.right;l({x:g,y:x,width:h,height:f,top:T,left:q,bottom:A,right:D})}})},[]);return Cl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[vl,Eo]},bl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,yl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,wl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:p=!1,intersections:g,layout:x}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const f=n[0],T=n[1],q=n[2],A=n[3];let D=1+(p?A-T:q-f),G=0;const U=a.getColor().toRGBA(l).toString(),y=h.description.toLowerCase().includes("double");let B,S;const w=p?"rowStart":"colStart",k=p?"rowEnd":"colEnd",O=p?T:f;if(g?.length>0){const _=g[0];if(_?.range[w]===i[w]){const V=s.IBorder.BuiltInDefinitions.get(_.stroke.getStyle());G=Math.floor(V.width/2)}if(g[g.length-1]?.range[k]===i[k]){const V=s.IBorder.BuiltInDefinitions.get(g[g.length-1].stroke.getStyle());D=Math.floor(D+(V.width===2?0:V.width/2))}if(y){const V=p?"colStart":"rowStart",$=p?"colEnd":"rowEnd",oe=p?x?.getRowOffset:x?.getColOffset;let L=0,z=0;B=[],S=[];for(let K=0;K<g.length;K++){const W=g[K];if(W.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&oe){const Ce=oe(W.range[w])-(O-G);W.range[V]<i[V]&&(B.push(Ce-L),L=Ce,B.push(1),L++),W.range[$]>i[$]&&(S.push(Ce-z),z=Ce,S.push(1),z++)}}B.length>0&&L<D&&B.push(D-L),S.length>0&&z<D&&S.push(D-z)}}let E=p?-Math.floor(h.width/2):-G,F=p?-G:-Math.floor(h.width/2);const Z=m&&h.width>2?-1:0;return c.jsx(Cr,{offsetX:f+E+Z,offsetY:T+F+Z,length:D+G,isVertical:p,stroke:U,width:h.width,dashArray:B??h.pattern,dashArrayAdditional:S,isDouble:y,isAngled:h.description.toLowerCase().includes("slant")},t)},po=({getBorderAt:e,borderRenderer:t=wl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>g=>{const x=g.toClipBounds(g.getRangeCoordsBounds(),-3);if(!x)return;const h=m(g);if(h.length===0)return;const f=g.getVisibleColumnOffsets(),T=g.getVisibleRowOffsets();let q=[],A=[];const D=g.getVisibleColumns(),G=g.getVisibleRows(),U=[],y=[],B=[],S=(E,F,Z,_,P,V,$)=>{const oe={index:_,stroke:P,visibleIndex:Z,edge:V,length:$};E[F]||(E[F]=[]),E[F].length>0&&E[F][E[F].length-1]?.index===_?E[F][E[F].length-1]=oe:E[F].push(oe)};for(let E=0;E<h.length;E++){const F=h[E],Z=F.coords;if(!Z)continue;const _=F?.range??{rowStart:Z.rowIndex,colStart:Z.colIndex,rowEnd:Z.rowIndex,colEnd:Z.colIndex},P=g.getVisibleRangeCoords();if(!ue.CoordUtils.isRangesIntersect(_,P)&&!ue.CoordUtils.isRangeWithinRange(_,P))continue;const V=Z.colIndex,$=Z.rowIndex,oe=f[V],L=T[$];if(_.rowEnd!==_.rowStart){const Pe=T[_.rowStart]?.spanIndex??-1,ge=T[_.rowEnd]?.spanIndex??T[G[G.length-1]].spanIndex+1;q.push({..._,rowStart:Pe,rowEnd:ge})}if(_.colEnd!==_.colStart){const Pe=f[_.colStart]?.spanIndex??-1,ge=f[_.colEnd]?.spanIndex??f[D[D.length-1]].spanIndex+1;A.push({..._,colStart:Pe,colEnd:ge})}const z=F.value,K=e(z,E);if(!K||K.isEmpty())continue;const W=K.getLeft(),Ce=K.getTop(),ae=K.getRight(),Q=K.getBottom();let ee=1,we=1;if(!oe||!L)continue;const ke=oe.spanIndex,ve=L.spanIndex;W.isNone()||S(U,ke,ve,$,W,s.IBorder.Edge.Left,ee),Ce.isNone()||S(y,ve,ke,V,Ce,s.IBorder.Edge.Top,we),ae.isNone()||S(U,ke+we,ve,$,ae,s.IBorder.Edge.Right,ee),Q.isNone()||S(y,ve+ee,ke,V,Q,s.IBorder.Edge.Bottom,we)}const w=(E,F,Z)=>{const _=[];return E.forEach((P,V)=>{let $=null;P.sort((oe,L)=>oe.visibleIndex-L.visibleIndex);for(let oe=0;oe<P.length;oe++){const L=P[oe];if(!L?.stroke||F[V]===void 0&&F[V-1]===void 0)continue;let z=!1;if(Z)for(let ae=0;!z&&ae<q.length;ae++){let Q=q[ae];Q.colStart<=L.index&&Q.colEnd>=L.index&&Q.rowStart<V&&Q.rowEnd>=V&&(z=!0)}else for(let ae=0;!z&&ae<A.length;ae++){let Q=A[ae];Q.rowStart<=L.index&&Q.rowEnd>=L.index&&Q.colStart<V&&Q.colEnd>=V&&(z=!0)}if(z)continue;const K=L.stroke?.getColor(),W=K?K.toRGBA().toString():l,Ce=L.stroke.getStyle()+":"+W;(Ce!==$?.key||$&&$.visibleIndex+1<L.visibleIndex)&&($&&_.push($),$={key:Ce,index:F[V]??F[V-1]+1,visibleIndex:L.visibleIndex,edge:L.edge,stroke:L.stroke,from:L.index,to:L.index+L.length-1,intersections:[],length:1}),$.to=L.index+L.length-1,$.visibleIndex=L.visibleIndex}$&&_.push($)}),_};q=q.sort(yl),A=A.sort(bl);const k=w(U,D,!1),O=w(y,G,!0);if(k.length===0&&O.length===0)return null;for(let E=0;E<O.length;E++){const F=O[E];let Z=ue.CommonUtils.findEqualOrGreater(k,F.from,P=>P.index),_=!1;for(;!_;){const P=k[Z++];P&&P.index>=F.from&&P.index<=F.to+1&&P.from<=F.index&&P.to+1>=F.index&&(F.intersections.push({stroke:P.stroke,range:{rowStart:P.from,rowEnd:P.to+1,colStart:P.index,colEnd:P.index}}),P.intersections.push({stroke:F.stroke,range:{rowStart:F.index,rowEnd:F.index,colStart:F.from,colEnd:F.to+1}})),_=!P||P.index>F.to+1}}for(let E=0;E<O.length;E++){const F=O[E];let Z=F.stroke;const _=`rBorder:${F.index}:${F.from}:${F.to}:${F.edge}`,P={rowStart:F.index,rowEnd:F.index,colStart:F.from,colEnd:F.to+1},V=g.getLayout(),$=!1,oe=V.getColOffset(P.colStart),L=V.getRowOffset(P.rowStart),z=[oe,L,V.getColOffset(P.colEnd),L];B.push(t({key:_,points:z,stroke:Z,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:F.intersections,layout:V,isVertical:$}))}for(let E=0;E<k.length;E++){const F=k[E];let Z=F.stroke;const _=`cBorder:${F.index}:${F.from}:${F.to}:${F.edge}`,P={rowStart:F.from,rowEnd:F.to+1,colStart:F.index,colEnd:F.index},V=g.getLayout(),$=!0,oe=V.getColOffset(P.colStart),L=[oe,V.getRowOffset(P.rowStart),oe,V.getRowOffset(P.rowEnd)];B.push(t({key:_,stroke:Z,points:L,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:F.intersections,layout:V,isVertical:$}))}return c.jsx("svg",{width:`${x.width}`,height:`${x.height}`,viewBox:`0 0 ${x.width} ${x.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${x.width}px`,height:`${x.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:B},"borders")},[e,i])}},Fo=ue.AnchorLocation.Center,xl=Object.freeze({horizontal:!1,vertical:!1}),Ao=ue.TypesUtils.EmptyTopLeft,ql=(e,t)=>ue.CoordUtils.EmptyCell,Sl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Rl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:p,children:g,...x}=e,h=o.useRef(null),[f,{width:T,height:q}]=zt(),A=n??T,D=i??q,G=o.useMemo(()=>{const $=[];for(let oe=0;oe<l;oe++)for(let L=0;L<d;L++){const z={colIndex:L,rowIndex:oe};$.push({coords:z,value:z})}return $},[]),U=o.useCallback($=>G,[G]),{overlay:y}=po({getVisibleCells:U,getBorderAt:t,darkMode:m,forceThinBorder:p}),B=Math.floor(A/d),S=Math.floor(D/l),w={getColOffset:$=>Math.ceil($*B)+0,getRowOffset:$=>Math.ceil($*S)+0,getColIndex:$=>Math.floor(($-0)/B)-1,getRowIndex:$=>Math.floor(($-0)/S)-1},k={rowStart:0,colStart:0,rowEnd:l,colEnd:d},O={x:0,y:0,width:Math.max(0,A)+0,height:Math.max(0,D)+0},E=o.useMemo(()=>{const $={},oe=Math.floor(A/d);for(let L=0;L<d;L++)$[L]={offset:L*oe,size:oe,spanIndex:L};return $},[A,D]),F=o.useMemo(()=>{const $={},oe=Math.floor(D/l);for(let L=0;L<l;L++)$[L]={offset:L*oe,size:oe,spanIndex:L};return $},[A,D]);if(!y)return null;const Z={width:A,height:D},_={width:A,height:D},P={getStage:()=>h.current,getTotalSize:()=>Z,getViewportSize:()=>_,getLayout:()=>w,getCellCoordsAsRangeCoords:ue.CoordUtils.cellToRange,getVisibleRangeCoords:()=>k,getVisibleRows:()=>{const $=[];for(let oe=0;oe<l;oe++)$.push(oe);return $},getTotalRangeCoords:()=>k,getRelativePointFromClient:($,oe)=>({x:$,y:oe}),getVisibleColumns:()=>{const $=[];for(let oe=0;oe<d;oe++)$.push(oe);return $},toClipBounds:($,oe)=>O,toViewBounds:$=>$,toAbsoluteBounds:$=>$,getBounds:()=>O,getInsets:()=>null,getRangeCoordsBounds:($,oe)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>F,allViews:()=>({[Fo]:P}),getAnchor:()=>Fo,getZoom:()=>1,scrollCellCoordsIntoView:Sl,getCellCoordsFromClient:ql,getScrollOrientation:()=>xl,getScrollTopLeft:()=>Ao,getFreezeTopLeft:()=>Ao},V=y(P);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...x,children:[c.jsx("div",{ref:Wt([h,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),V]})});function yr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=yr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function bt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=yr(e))&&(i&&(i+=" "),i+=t);return i}const kl="_sheetxl-sheet_1qeq6_5",Ml="_viewport-overlay_1qeq6_6",wr=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),c.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),c.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),c.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),c.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},Tl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:d,...m}=e??{},[p,g]=o.useState(null);o.useEffect(()=>{(async()=>{const S=await s.LicenseManager.getDetails();g(S)})()},[]);const[x,h]=o.useState(!1),f={opacity:.65},T=o.useMemo(()=>{const S=p?.exceptions(),w=S?.length??0;if(w===0)return null;const k=[];for(let O=0;O<w;O++){const E=S[O];k.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:E},O))}return k},[p,n]);if(p===null||p.isValidFor(l))return null;const q=p.type(),A=!T&&q.endsWith("ity"),D=p.licensee(),G=A?1.6:1,U=135/G,y=37/G;let B=null;return!q&&D?.length>0&&(B=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[x?c.jsx(wr,{style:f}):c.jsx("svg",{width:U,height:y,style:f,children:c.jsx("image",{style:{width:U,height:y},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[B,T,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),tt=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),d={},m=l.length;for(let g=0;g<m;g++){const x=l[g];d[x]=(h,f)=>{i.current[x]?.(h,f)}}const p=e.addListeners(d,n);if(a)for(let g=0;g<m;g++)d[l[g]](e);return()=>{p?.()}},[e])},Rn=new s.Color("transparent");function xr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:p}=e,[g,x]=o.useState(null),[h,f]=o.useState(null),T=o.useRef(null),q=r.useCallbackRef(m,[m]),A=r.useCallbackRef(p,[p]),[D,G]=o.useState(),[U,y]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[B,S]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const k=r.useGlobalClipboard(),[O,E]=o.useState(ue.CommonUtils.EmptyArray),F=o.useCallback(()=>{if(T.current!==t)return;const u=t.getSelectedRanges();let M=null;O.length>0&&ue.CoordUtils.isCellWithinRange(g,O[0].getRange().getCoords())&&(M=O[0]);const I=t?.getSelectedCell(),b=I?.getCoords()??null;Dt.unstable_batchedUpdates(()=>{W(M),x(b),f(u)})},[t,O,h,g]),Z=o.useCallback(ue.CommonUtils.debounce(F,210),[F]);o.useEffect(()=>{T.current=t,F()},[t]);const _=r.useCallbackRef(()=>t.getRange(g).getCell(),[t,g]),P=r.useCallbackRef(async(u,M,I=null,b=!1,N=!0)=>{const v=u?.label?.(),H=async()=>{const ie=await Promise.resolve(N&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>M(t),v),b&&w.setMode(null),ie&&ie()}catch(se){if(ie&&ie(),!se)return;d?.showError?.(se)}},X=[];let ne=!1;const le=async()=>(X.push(H),(async()=>{if(!ne){for(ne=!0;X.length>0;){const ie=X.shift();ie&&await ie()}ne=!1}})());if(n){let ie=null;if(I!==!1&&u){const se=I??v;ie=new r.SimpleCommand(u.key(),l,{label:se,description:se},le)}n(ie)}return le()},[t,n,d]),V=r.useCallbackRef((u,M,I=!1,b)=>P(u,N=>{const v=N.getSelectedRanges();I&&v.updateStyle(null,b),v.updateStyle(M,b),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),$=r.useCallbackRef((u,M,I)=>{P(u,b=>{let N=M;(I||M?.address)&&(N=N??{},!I&&M?.address?.startsWith("#")?I=M?.address.substring(1):I&&(N.displayText=I)),b.getSelectedRange().setHyperlink(N)})},[t]),oe=r.useCallbackRef((u,M)=>{P(u,I=>{I.getSelectedRange().setComments(M)})},[t]),L=r.useCallbackRef((u,M)=>{P(u,I=>{I.getSelectedRanges().clear(M)})},[t]),z=r.useCallbackRef(async(u,M,I=!1,b=!1)=>P(u,async N=>{let v=N.getSelectedRanges();I&&(M===s.IRange.Orientation.Row?v=v.getEntireRows(b):M===s.IRange.Orientation.Column&&(v=v.getEntireColumns(b)));let H=null;const X=w.getMode()?.key;if(X==="copy"||X==="cut"){const ne=await k.getClipboard().readReference();ne&&ne.getItemType()==="range"&&(H=ne.getItem(),H.getCoords()||(H=null))}if(H){const ne=await v.insertFrom(H,{...H.getMarkOptions(),orientation:M,autoSelect:!0});!ne||ne.isEntireRows()||ne.isEntireColumns()||ne.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else v.insert(M,{autoSelect:!0})},"Insert Cells",!1),[w]),[K,W]=o.useState(null),Ce=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),ae=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),Q=r.useCallbackRef((u,M)=>{P(u,async I=>{const b=I.getSelectedRange(),N=I.getSelectedCell().getCoords();let v=null,H=0;const X=N.rowIndex>0?I.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex}).getExtended(s.IRange.Direction.Up):null;X&&I.getRange({colStart:N.colIndex,rowStart:X.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,H=N.rowIndex-X.getCoords().rowEnd);const ne=N.colIndex>0?I.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ne&&I.getRange({colStart:ne.getCoords().colStart,rowStart:N.rowIndex,colEnd:ne.getCoords().colStart,rowEnd:N.rowIndex}).isContentful()){const ie=N.colIndex-ne.getCoords().colEnd;(ie<H||!v)&&(v=s.IRange.Direction.Left,H=ie)}let le=null;if(v===s.IRange.Direction.Up){if(le={...X.getCoords()},(le.rowEnd===N.rowIndex||!I.getRange({colIndex:N.colIndex,rowIndex:N.rowIndex-1}).isContentful())&&le.rowStart>0&&I.getRange({colIndex:N.colIndex,rowIndex:le.rowStart-1}).isContentful()){const ie=X.getExtended(s.IRange.Direction.Up);le={colStart:N.colIndex,rowStart:ie.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowEnd}}le.rowEnd=N.rowIndex-1}else if(v===s.IRange.Direction.Left){if(le={...ne.getCoords()},(le.colEnd===N.colIndex||!I.getRange({colIndex:N.colIndex-1,rowIndex:N.rowIndex}).isContentful())&&le.colStart>0&&I.getRange({colIndex:le.colStart-1,rowIndex:N.rowIndex}).isContentful()){const ie=ne.getExtended(s.IRange.Direction.Left);le={colStart:ie.getCoords().colStart,rowStart:N.rowIndex,colEnd:ie.getCoords().colEnd,rowEnd:N.rowIndex}}le.colEnd=N.colIndex-1}if(b.size!==1&&v){const ie=b.getCoords(),se=b.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),ye={...le},me=ie.rowStart,fe=ie.rowEnd,qe=ie.colStart,Oe=ie.colEnd,De=v===s.IRange.Direction.Up;for(let We=qe;We<=Oe;We++){ye.colStart=De?We:le.colStart+(We-qe),ye.colEnd=De?We:le.colEnd+(We-qe);for(let je=me;je<=fe;je++){ye.rowStart=De?le.rowStart+(je-me):je,ye.rowEnd=De?le.rowEnd+(je-me):je;const Ge=I.getRange(ye).toString();se.pushAt(je,We,`=${M}(${Ge})`)}}se.apply()}else{const ie=le?I.getRange(le).toString():"",se=`=${M}(`;q?.({text:`${se}${ie})`,editMode:!0,initialSelection:{start:se.length,end:se.length+ie.length}})}},!1)},[t]),ee=r.useCallbackRef((u,M,I=!1,b=!0)=>{P(u,async N=>{let v=null;if(K)return void K.updateStyleOptions(M);{const ne=N.getSelectedRanges().getFixed(!0),le=N.getSelectedRange().getDefaultSortCriteria();let ie={ranges:ne,hasHeader:le?.options?.hasHeader??!1};v=b?new Promise((se,ye)=>{const me={tableOptions:ie,onCancel:()=>{ye()},onDone:fe=>{se(fe)},context:{getNames:()=>N.getNames()}};d.showWindow?.("tableNew",me)}):{option:"Ok",tableOptions:ie}}const H=await Promise.resolve(v);if(H?.option!=="Ok")throw null;const X=await Promise.resolve(d?.showBusy?.(u.label()));try{await N.getTables().add(H.tableOptions.ranges.at(0),{styleName:M?.name,clearFormatting:I,hasHeader:H.tableOptions.hasHeader}).getRange().select()}catch(ne){X(),d?.showError?.(ne)}X()},!1,!0,!1)},[K]),we=r.useCallbackRef(()=>i,[i]),ke=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:we,getNames:()=>t.getNames()}),[t]),ve=r.useCallbackRef(async(u,M,I,b=!0)=>{let N=null;if(!M){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let H=t.getTables().search({address:t.getSelectedRange()});H.length>0&&(M=H[0]),await v.select()}if(M){if(b){try{I&&await M.select()}catch{}N=new Promise(async(v,H)=>{u.update({context:ke(M)});const X={command:u,commands:C,notifier:d,onDone:le=>{v(le)}},ne=await d.showWindow?.("tableDetails",X,{disableAutoDestroy:!0});setTimeout(()=>{ne.focus()},180)})}Promise.resolve(N).then(v=>{},v=>{d?.showError?.(v)})}},[d]),Pe=r.useCallbackRef(async(u,M,I=!1)=>{let b=null;if(M)M.isITable?b=M:M.getValue()&&(b=M.getValue());else{const N=t.getTables().search({address:t.getSelectedRange()});N.length>0&&(b=N[0])}if(b){if(!I){const N=b.getRange().getCoords(),v=(N.colEnd-N.colStart+1)*(N.rowEnd-N.rowStart+1);if(v>1e4&&await d?.showOptions({title:"Confirm",description:`Converting a table to range with '${v}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
+
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}P(u,async()=>{I?b.delete():b.convertToRange()},!1,!0)}},[d]),ge=r.useCallbackRef((u,M,I)=>{P(u,async b=>{let N=b.getSelectedRanges();if(N.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let v=N.at(0);v.size===1&&(v=v.getSurrounding());const H=b.getSelection().getCoords().cell;let X=v.getDefaultSortCriteria(s.IRange.Orientation.Row,H);if(!X){if(I)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ne=X.options;if(I&&(ne=new Promise((ie,se)=>{const ye={range:v,options:X.options,cell:H,onCancel:()=>{se()},onDone:me=>{me?ie(me.options):se()}};d.showWindow?.("sort",ye)})),ne=await Promise.resolve(ne),!ne)return;const le=await Promise.resolve(d?.showBusy?.(u.label()));try{v.doBatch(()=>{const ie={...ne,...M};v.sort(ie),v.autoFit({orientations:ie?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(ie){le(),d?.showError?.(ie)}le()},!1,!1,!1)},[d]),He=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),M=t.getSelectedRanges().getFlattened().getCoords(),I=(v=>{const H=new Blob([v],{type:"application/javascript"}),X=URL.createObjectURL(H),ne=new Worker(X);return URL.revokeObjectURL(X),ne})("console.log('hello from worker');");setTimeout(()=>{I.terminate(),console.log("Worker terminated")},5e3);let b=-1;for(let v=0;b===-1&&v<M.length;v++)ue.CoordUtils.isCellWithinRange(u.cell,M[v])&&(b=v);if(ue.CoordUtils.isEqualRangesArrays(u.ranges,M))return;const N={cell:u.cell,ranges:M,rangeIndex:b};t.getSelection().updateCoords(N)},[t]),Se=r.useCallbackRef(()=>{console.log("selectComments")},[t]),ce=r.useCallbackRef(async(u=!1,M=!1)=>{let I=null;if(M)I=t.getEntireRange();else{const b=t.getSelectedRange();if(b.isEntireRange()){const N=t.getSelection().getCoords().cell,v=t.getRange(N);I=v.getSurrounding(),I.isEntireRange()&&(I=v)}else I=b.getSurrounding({contentOnly:u})}I&&await I.select()},[t]),de=r.useCallbackRef((u,M,I)=>{P(u,async b=>{let N=b.getSelectedRanges();I&&(M===s.IRange.Orientation.Row?N=N.getEntireRows():M===s.IRange.Orientation.Column&&(N=N.getEntireColumns())),N.delete(M)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let M=null;const I=A(),b=Math.min(I.width-8,480),N=Math.min(I.height-8,288);try{t.getSelectedRanges(),M=await t.getMovables().add({bounds:{x:I.left+(I.width-b)/2,y:I.top+(I.height-N)/2,width:b,height:N},type:"chart",json:u.template}),M.select(),w.setMode(null)}catch(v){d?.showError?.(v)}return M},[t,d]);const he=r.useCallbackRef(async(u,M,I)=>{const b=await d?.showBusy?.(u.label());try{const N=await t.getMovables().addImage(M,{autoSelect:!0,...I});return b(),w.setMode(null),N}catch(N){b();let v=N;typeof v!="string"&&(console.warn(N),v="Unable to resolve image."),d?.showMessage?.(v,{type:r.NotificationType.Error})}},[t,d]),pe=r.useCallbackRef((u,M)=>{P(u,async I=>{const b=I.getSelectedRanges();b.doBatch(()=>{const N=M===s.IRange.Direction.Up||M===s.IRange.Direction.Down,v=b.getCoords().slice().sort(ue.CoordUtils.createRangeComparator(N?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let H=0;H<v.length;H++){const X=v[H];let ne=X;const le=I.getRange(ne).getMerges();let ie=0,se=0;if(le.length>0){const ye=le[0];ie=ye.rowEnd-ye.rowStart,se=ye.colEnd-ye.colStart}M===s.IRange.Direction.Left?ne={...X,colStart:X.colEnd+se}:M===s.IRange.Direction.Right?ne={...X,colEnd:X.colStart+se}:M===s.IRange.Direction.Up?ne={...X,rowStart:X.rowEnd+ie}:M===s.IRange.Direction.Down&&(ne={...X,rowEnd:X.rowStart+ie}),I.getRange(ne).autoFill(X,{filler:s.AutoFill.Types.Copy}),I.getRange(X).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.label()})})},[d]),xe=r.useCallbackRef(()=>{let u=null;const M=t.getSelectedCell().getCoords();if(M?.rowIndex>0){const I=t.getRange({rowIndex:M.rowIndex-1,colIndex:M.colIndex}).getCell();I&&(u=I.toTextUnformatted(!0))}q?.({text:u})},[t]),[Me,be]=o.useReducer(u=>u+1,0),[Ee,Le]=o.useReducer(u=>u+1,0),Ve=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Se()),new r.Command("selectAll",l,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[r.KeyModifiers.Ctrl]},{key:"Space",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},(u=!1)=>ce(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>ce(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>He()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation."}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically."}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){ge(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){ge(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){ge(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
11
|
+
For example, you can prevent people from editing locked cells or making formatting changes.`}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(u){V(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(u){ee(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(u){ee(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){ee(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Ce),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},ae),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){V(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){V(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){V(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top."}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells."}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom."}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically."}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left."}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content."}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right."}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content."}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells."}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:ao(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:ao(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){V(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){V(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,M){const I=this,b={initialValue:u??M.state(),context:M.context(),onInputOption:(N,v)=>{V(I,{numberFormat:N})}};d.showWindow?.("numberFormat",b)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){V(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:s.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){V(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){V(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("quickFormulaSum",l,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){Q(this,"SUM")}),new r.Command("quickFormulaAverage",l,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){Q(this,"AVERAGE")}),new r.Command("quickFormulaCount",l,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){Q(this,"COUNT")}),new r.Command("quickFormulaMax",l,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){Q(this,"MAX")}),new r.Command("quickFormulaMin",l,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){Q(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){q?.({text:t.createTemporaryCell({value:cn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){q?.({text:t.createTemporaryCell({value:cn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u,M){console.log("insertFunction")}),new r.Command("updateHyperlink",l,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>_,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,M){const I=this,b={context:M.context(),onUpdateHyperlink:(N,v)=>{$(I,N,v)}};d.showWindow?.("hyperlink",b)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>_},async(u,M)=>{const I=M.context()();if(!I)return;const b=I.getHyperlink();if(b)try{await b.open()}catch(N){d?.showError?.(N)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>_},function(u,M){$(this,null,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,M)=>{((I,b)=>{I?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[b," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,M.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>_},async function(u,M){const I=this,b={context:M.context(),onUpdateComments:N=>{oe(I,N)}};d.showWindow?.("comments",b)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>_},function(u,M){oe(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(u=null){let M=null,I=null;typeof u=="string"?I=u:M=u?.file?u.file:u,(M||(M=await ue.CommonUtils.openFileDialog(I??"image/*"),M))&&await he(this,{file:M},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(u){if(!u){const M=await d?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(M.option!=="Insert")return;u=M.input}u&&he(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){ee(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(u){let M=null,I=!1;u.isITable?M=u:u.getValue()&&(M=u.getValue(),I=!0),ve(this,M,I)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
All copy and paste operations will be limited to the browser tab.`,Cl={Safari:`The Safari browser does not support advanced copy and paste.
|
|
12
|
-
Copy and paste will be limited to within the browser tab.
|
|
13
|
+
The table and table specific styling will be removed but the values will be preserved.`},function(u){Pe(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
|
|
13
14
|
|
|
14
|
-
Please use Chrome or Edge if external copy and paste is required.`,Perms:Yo,PermsWrite:$n()===qt.Safari?mi:Yo,PermsRead:$n()===qt.Safari?mi:Yo},Xo=async()=>new Promise(t=>{document.hasFocus()?t():globalThis.addEventListener?.("focus",()=>{t()},{once:!0}),document.activeElement.focus?.()}),Jo=async(t,e,n)=>{if($n()===qt.Safari)return await n(new Error(Cl.Safari));try{const o=async s=>{try{return await s()}catch(a){if(a.message?.includes("Document is not focused"))return!1;throw a}},r=await globalThis?.navigator?.permissions?.query({name:t,allowWithoutGesture:!0,allowWithoutSanitization:!0});let i=!1;if(r.state==="prompt"&&(i=await o(e)),i||r.state!=="granted"||(i=await e()),!i)return await n(new Error(r.state))}catch(o){return o.message==="No valid data on clipboard"||o.name==="DataError"?void 0:await n(o)}},Sl=async t=>{try{return await t.read({unsanitized:[Ct]})}catch{}return await t.read()},ql=async(t,e)=>{if(!t)return null;const n=await Sl(t);let o=!1;for(let r=0;!o&&n&&r<n.length;r++)if(o=n[r].types.includes(e),o)return await n[r].getType(e);return o?void 0:null};if(!globalThis.ClipboardItem){const t=(n,o)=>new Blob([o],{type:n});class e{constructor(o,r){this._items={},this._types=Object.keys(o);const i={},s=Object.keys(o);for(let a=0;a<s.length;a++){const d=s[a];let c=o[d];i[d]=typeof c=="string"?t(d,c):c}this._items=i,this._presentationStyle=r?.presentationStyle??"unspecified"}get types(){return this._types}getType(o){return Promise.resolve(this._items[o])}supports(o){return!0}}globalThis.ClipboardItem=e}const bo=async(t,e=Ct)=>new Promise(async(n,o)=>{try{const r=await ql(t,e);if(r){const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=()=>{n("")},i.readAsText(r)}else n("")}catch(r){o(r)}}),mr=async(t,e=Ct)=>{const n=await bo(t,e);if(!n)return null;let o=null;try{o=new DOMParser().parseFromString(n,Ct)}catch{console.warn("Can't parse html from clipboard.")}return o},ia=async t=>{t&&await t.writeText("")},la=ql,sa=bo,aa=mr,Un="clipboard-uuid",dn="web text/uuid",fi=t=>`<div style="display:none" ${Un}="${t}"/>`,ca=(t,e)=>{let n=null;try{const o=new DOMParser().parseFromString(e,Ct);o.body.firstElementChild.setAttribute(Un,t),n=o.getElementsByTagName("body")[0].innerHTML}catch(o){console.warn("Can't embed uuid.",o)}return n},pi=(t,e)=>{if(!e||!t)return!1;try{const n=e.querySelectorAll(`[${Un}="${t}"]`);if(n&&n.length===1)return!0;if(e.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};let wn=class{constructor(t){if(t?.nativeClipboard===void 0||t?.nativeClipboard===!0)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{t?.nativeClipboard===!0&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=t?.nativeClipboard===!1?null:t?.nativeClipboard;this._disableCheckOnFocus=t?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await Jo("clipboard-read",async()=>{await Xo();const t=await bo(this._nativeClipboard,dn);if(!this._state||t&&t===this._state.uuid)return!0;const e=await mr(this._nativeClipboard,Ct);return!this._state||(pi(this._state.uuid,e)||this.clear(),!0)},async t=>{t?.message==="denied"||t.message?.includes("Document is not focused")||$n()===qt.Safari||console.warn("Unable to detect clipboard changes: ",t)})}_init(){const t=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{t._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",t._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",e=>{t._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const t=this;return await Jo("clipboard-read",async()=>{if(await Xo(),this._state?.uuid){const e=await bo(this._nativeClipboard,dn);if(e&&e===t._state.uuid)return!0;const n=await mr(this._nativeClipboard,Ct);if(pi(t._state?.uuid,n))return!0}return t._state={items:await Sl(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async e=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(t){return this._write({uuid:vo(),items:t,ref:null})}async _write(t){if(!this._nativeClipboard)return this._state=t,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const e=this,n=[],o=t.uuid;let r=t.items??[];const i=()=>{e._state={uuid:o,ref:t.ref,items:n},e.dispatchEvent(new Event("clipboardwrite")),e.dispatchEvent(new Event("clipboardchange"))};await Jo("clipboard-write",async()=>{await Xo(),o&&r.length===0&&(r.push(new ClipboardItem({[dn]:new Blob([o],{type:dn})})),r.push(new ClipboardItem({[Ct]:new Blob([fi(o)],{type:Ct})})));for(let s=0;s<Math.min(1,r.length);s++){const a=r[s];let d=a.types.indexOf(Ct),c=null;if(d!==-1){const u=await a.getType(Ct);c=await gr(u),c&&(c=ca(o,c))}if(!c&&a.types.includes(Pt)){const u=await a.getType(Pt);if(u){let w=null;typeof u=="string"?(console.warn("text as string",u),w=u):w=await gr(u),w&&(c=`<div ${Un}="${o}">${w}</div>`)}}if(!c&&a.types.includes(po)){const u=await a.getType(po),w=yl(await u.arrayBuffer());c=`<div ${Un}="${o}"><img src="${bl+w}"/></div>`}!c&&o&&(c=fi(o));const f=new Blob([c??""],{type:Ct}),h={};for(let u=0;u<a.types.length;u++){const w=a.types[u];h[w]=u===d?f:a.getType(w)}c&&d===-1&&(h[Ct]=f),o&&(h[dn]=new Blob([o],{type:dn})),n.push(new ClipboardItem(h))}try{n&&n.length!==0?await this._nativeClipboard.write(n):await ia(this._nativeClipboard)}catch(s){s.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",s)}return i(),!0},async s=>{this.dispatchEvent(new Event("clipboarderrorwrite")),i()})}async writeReference(t){if(!t)return void this.clear();let e=null;const n={};try{const r=await t.toText?.()??null;r&&(n[Pt]=new Blob([r??""],{type:Pt}))}catch(r){e=r}try{const r=await t.toHtml?.()??null;r&&(n[Ct]=new Blob([r],{type:Ct}))}catch(r){e=r,console.warn("export to html",r)}try{const r=await t.toImage?.()??null;r&&(n[po]=r)}catch(r){e=r,console.warn("export to png",r)}const o=this._write({uuid:vo(),ref:t,items:Object.keys(n).length>0?[new ClipboardItem(n)]:null});if(e)throw e;return o}clear(t=!1){this._state&&(this._state=null,t&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(t,e)=>{const n=await this.read();let o=null;for(let i=0;!o&&n&&i<n.length;i++)n[i].types.includes(Pt)&&(o=await n[i].getType(Pt));if(!o)return void t("");const r=new FileReader;r.onload=()=>{t(r.result)},r.readAsText(o),r.onerror=i=>{e(i)}})}async writeText(t){const e=[new ClipboardItem({[Pt]:new Blob([t],{type:Pt})})];return this._write({uuid:vo(),items:e,ref:null})}addEventListener(t,e,n={}){const o=n?.capture?this._listenersCapture:this._listeners;let r=o.get(t);r||(r=new Map,o.set(t,r)),r.set(e,typeof n=="boolean"?{}:n)}dispatchEvent(t){if(!t)return;const e=n=>{const o=n.get(t.type);o&&o.forEach((r,i)=>{try{typeof i=="function"?i(t):i.handleEvent&&i.handleEvent(t),r.once&&o.delete(i)}catch(s){console.warn(s)}})};return e(this._listenersCapture),e(this._listeners),!0}removeEventListener(t,e,n){const o=n?.capture?this._listenersCapture:this._listeners,r=o.get(t);r&&(r.delete(e),r.size===0&&o.delete(t))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}};var Qo;(Qo=wn||(wn={})).ErrorMessages=Cl,Qo.Global=new Qo,function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();const Rl={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},Q={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},St={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},_r={Left:1,Middle:2,Right:3},wt={Horizontal:"horizontal",Vertical:"vertical"};function El(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=El(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function fn(){for(var t,e,n=0,o="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=El(t))&&(o&&(o+=" "),o+=e);return o}var da=function(){},Tl=typeof window<"u",ua=Tl?l.useLayoutEffect:l.useEffect,vi={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Qt=Tl&&window.ResizeObserver!==void 0?function(){var t=l.useState(null),e=t[0],n=t[1],o=l.useState(vi),r=o[0],i=o[1],s=l.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var d=a[0].contentRect,c=d.x,f=d.y,h=d.width,u=d.height,w=d.top,b=d.left,q=d.bottom,I=d.right;i({x:c,y:f,width:h,height:u,top:w,left:b,bottom:q,right:I})}})},[]);return ua(function(){if(e)return s.observe(e),function(){s.disconnect()}},[e]),[n,r]}:function(){return[da,vi]},X=(t,e)=>{const n=l.useCallback((...i)=>t?.(...i),e),o=l.useRef(null);o.current=n;const r=l.useCallback((...i)=>o.current?.(...i),[]);if(o.current)return r},Ir=t=>{const{style:e,orientation:n=wt.Vertical,...o}=t,r=n===wt.Vertical;return g.jsx("div",{style:{paddingBottom:"0px",paddingRight:"0px",paddingLeft:r?"0px":"3px",paddingTop:r?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:g.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${r?"vertical":"horizontal"} single-button start`,children:g.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:g.jsx("path",{d:r?"m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z":"m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z"})})})})},Fr=t=>{const{style:e,orientation:n=wt.Vertical,...o}=t,r=n===wt.Vertical;return g.jsx("div",{style:{paddingLeft:"0px",paddingTop:"0px",paddingRight:r?"0px":"3px",paddingBottom:r?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:g.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${r?"vertical":"horizontal"} single-button end`,children:g.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:g.jsx("path",{d:r?"M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z":"m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z"})})})})},Ml=t=>{const{style:e,orientation:n=wt.Vertical,...o}=t,r=n===wt.Vertical;return g.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${r?"vertical":"horizontal"} edge`,...o,children:g.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r?"rotate(90) ":"",children:g.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:t.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},fr=(t,e,n,o,r=0)=>{for(let i=0;i<n.length;i++){const s=n[i].getBoundingClientRect();let a=s.left-e,d=a+s.width;if(o){if(a<t&&d>=t)return a}else if(Math.ceil(d)>Math.ceil(t)+2)return d}return r},pr=Object.freeze(Object.defineProperty({__proto__:null,getScrollTo:fr},Symbol.toStringTag,{value:"Module"})),Io=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,totalSize:o=0,viewportSize:r=0,style:i,className:s,orientation:a=wt.Vertical,onScrollOffset:d,onScroll:c,showCustomScrollButtons:f=!1,scrollButtonIncrement:h=200,scrollButtonInitialRepeatDelay:u=260,scrollButtonAdditionalRepeatDelay:w=120,createScrollStartButton:b=Ir,createScrollEndButton:q=Fr,...I}=t,$=X(c,[c]),D=l.useRef(null),[v,{width:F,height:E}]=Qt(),[S,{width:k,height:N}]=Qt(),R=a===wt.Vertical,T=R?"top":"left",G=R?"scrollTop":"scrollLeft",O=R?E:F,j=R?N:k,[z,B]=l.useState(null);l.useEffect(()=>{z!==null&&D.current&&D.current.scrollTo({behavior:"smooth",[T]:z})},[z,R]);const Z=l.useCallback((ae,Fe=!1)=>{if(!D.current)return 0;const me=D.current.querySelector(".scrollbar-viewport"),Oe=me.getBoundingClientRect(),xe=me.children,ge=Fe?0:fr(ae,Oe[T],xe,!0,Math.max(0,ae-h));return B(ge),Math.max(0,ge)},[]),P=l.useCallback((ae,Fe=!1)=>{if(!D.current)return 0;const me=D.current.querySelector(".scrollbar-viewport"),Oe=me.getBoundingClientRect(),xe=me.children,ge=Math.ceil(j-O),fe=Fe?ge:fr(ae,Oe[T],xe,!1,Math.max(0,ae+h));return B(fe),Math.min(ge,fe)},[j,O]),M=l.useRef(null),H=l.useCallback(ae=>{M.current=n;const Fe=ae.target[G];d(Fe,r,o),$?.(ae)},[d,r,o,n]);l.useEffect(()=>{const ae=M.current;M.current=null,n!==ae&&(D.current[G]=n)},[n,G]);const oe=l.useRef(null),ue=l.useRef(null),te=l.useCallback(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null,ue.current=null)},[]),K=l.useCallback((ae,Fe,me,Oe=u)=>{ue.current=ae,oe.current=setTimeout(()=>{const xe=me?Z(ue.current||ae):P(ue.current||ae);xe!==ue.current?K(xe,!1,me,w):te()},Fe?0:Oe)},[Z,P,te]);l.useEffect(()=>()=>te(),[te]);const le=n,Re=l.useMemo(()=>{if(!f)return null;const ae={orientation:a,disabled:Math.floor(le)<=0||Math.floor(j-O)===0,onMouseUp:te,onMouseLeave:te,onMouseDown:()=>K(le,!0,!0)};return b?.(ae)},[f,a,le,z,j,O]),Te=l.useMemo(()=>{if(!f)return null;const ae={orientation:a,disabled:Math.floor(j-O)<=Math.ceil(le),onMouseUp:te,onMouseLeave:te,onMouseDown:()=>K(le,!0,!1)};return q?.(ae)},[f,a,le,z,j,O]);return g.jsxs("div",{ref:e,style:{display:"flex",flex:"1",flexDirection:R?"column":"row",padding:"0",...i},className:fn("_sheetxl-scrollbar_eblx4_6",s),...I,children:[Re,g.jsx("div",{className:"pseudo-scrollbar",style:{flex:"1 1 100%",display:"flex",boxSizing:"content-box",flexDirection:R?"column":"row",justifyContent:"center",alignItems:"center"},ref:v,children:g.jsx("div",{tabIndex:-1,style:{flex:"1 1 100%",overflowY:R?"scroll":"hidden",overflowX:R?"hidden":"scroll",position:"relative",willChange:"transform"},onScroll:H,ref:D,children:g.jsx("div",{ref:S,style:{position:"absolute",height:R?o-r+(E??0):1,width:R?1:o-r+(F??0)},className:"scrollbar-viewport"})})}),Te]})}));Io.displayName="Scrollbar";let wi=Date.now,$t={},ha=1;const An=t=>{let e=$t[t]!==null;return e&&($t[t]=null),e},yi=(t,e,n,o=0,r)=>{let i=wi(),s=i,a=0,d=0,c=0,f=ha++;if(f%20==0){const u={};for(let w in $t)u[w]=!0;$t=u}const h=function(u){let w=u!==!0,b=wi(),q=!0;try{q=(!e||e(f))??!0}catch{q=!1}if(!$t[f]||!q)return $t[f]=null,void n?.(60-d/((b-i)/1e3),f,!1);if(w){c=Math.round((b-s)/16.666666666666668)-1;for(let D=0;D<Math.min(c,4);D++)h(!0),d++}o&&(a=(b-i)/o,a>1&&(a=1));let I=r?r(a):a,$=!1;try{$=t(I,b,w)}catch{$=!1}$!==!1&&a!==1||!w?w&&(s=b,requestAnimationFrame(h)):($t[f]=null,n?.(60-d/((b-i)/1e3),f,a===1||o==null))};return $t[f]=!0,requestAnimationFrame(h),f},ga=function(t){return Math.pow(t-1,3)+1},ma=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)};class fa{constructor(e,n){this.__isSingleTouch=!1,this.__isTracking=!1,this.__didDecelerationComplete=!1,this.__isGesturing=!1,this.__isDragging=!1,this.__isDecelerating=0,this.__isAnimating=0,this.__interruptedAnimation=!1,this.__lastScale=1,this.__enableScrollX=!0,this.__enableScrollY=!0,this.__clientLeft=0,this.__clientTop=0,this.__clientWidth=0,this.__clientHeight=0,this.__contentWidth=0,this.__contentHeight=0,this.__snapWidth=100,this.__snapHeight=100,this.__zoomLevel=1,this.__scrollLeft=0,this.__scrollTop=0,this.__maxScrollLeft=0,this.__maxScrollTop=0,this.__scheduledLeft=0,this.__scheduledTop=0,this.__scheduledZoom=0,this.__lastTouchLeft=0,this.__lastTouchTop=0,this.__lastTouchMove=0,this.__positions=[],this.__initialTouchLeft=0,this.__initialTouchTop=0,this.__zoomLevelStart=1,this.__minDecelerationScrollLeft=null,this.__minDecelerationScrollTop=null,this.__maxDecelerationScrollLeft=null,this.__maxDecelerationScrollTop=null,this.__decelerationVelocityX=null,this.__decelerationVelocityY=0,this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...n}}setDimensions(e,n,o,r){e!==null&&(this.__clientWidth=e),n!==null&&(this.__clientHeight=n),o!==null&&(this.__contentWidth=o),r!==null&&(this.__contentHeight=r),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)}setPosition(e,n){this.__clientLeft=e||0,this.__clientTop=n||0}setSnapSize(e,n){this.__snapWidth=e,this.__snapHeight=n}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,n){const o=this.getValues();return{left:e/o.zoom,top:n/o.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,n=!1,o,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(An(this.__isDecelerating),this.__isDecelerating=0);const s=this.__zoomLevel;o===void 0&&(o=this.__clientWidth/2),r===void 0&&(r=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const a=e/s;let d=a*(this.__scrollLeft+o)-o,c=a*(this.__scrollTop+r)-r;d>this.__maxScrollLeft?d=this.__maxScrollLeft:d<0&&(d=0),c>this.__maxScrollTop?c=this.__maxScrollTop:c<0&&(c=0),this.__publish(d,c,e,n)}zoomBy(e,n=!1,o=0,r=0,i){this.zoomTo(this.__zoomLevel*e,n,o,r,i)}scrollTo(e,n,o=!1,r=1){if(this.__isDecelerating&&(An(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,n*=r,this.__computeScrollMax(r)}else r=this.__zoomLevel;this.options.scrollingX?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY?this.options.paging?n=Math.round(n/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(n=Math.round(n/this.__snapHeight)*this.__snapHeight):n=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),n=Math.max(Math.min(this.__maxScrollTop,n),0),e===this.__scrollLeft&&n===this.__scrollTop&&(o=!1),this.__publish(e,n,r,o)}scrollBy(e=0,n=0,o=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(n||0),o)}doMouseZoom(e,n,o,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,o-this.__clientLeft,r-this.__clientTop)}doTouchStart(e,n){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(n instanceof Date&&(n=n.valueOf()),typeof n!="number")throw new Error("Invalid timestamp value: "+n);let o,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(An(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(An(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;i?(o=e[0].pageX,r=e[0].pageY):(o=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=o,this.__initialTouchTop=r,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=o,this.__lastTouchTop=r,this.__lastTouchMove=n,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,this.__positions=[]}doTouchMove(e,n,o=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(n instanceof Date&&(n=n.valueOf()),typeof n!="number")throw new Error("Invalid timestamp value: "+n);if(!this.__isTracking)return;let r,i;e.length===2?(r=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(r=e[0].pageX,i=e[0].pageY);let s=this.__positions;if(this.__isDragging){let a=r-this.__lastTouchLeft,d=i-this.__lastTouchTop,c=this.__scrollLeft,f=this.__scrollTop,h=this.__zoomLevel;if(o!==void 0&&this.options.zooming){let u=h;if(h=h/this.__lastScale*o,h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom),u!==h){let w=r-this.__clientLeft,b=i-this.__clientTop;c=(w+c)*h/u-w,f=(b+f)*h/u-b,this.__computeScrollMax(h)}}if(this.__enableScrollX){c-=a*this.options.speedMultiplier;let u=this.__maxScrollLeft;(c>u||c<0)&&(this.options.bouncing?c+=a/2*this.options.speedMultiplier:c=c>u?u:0)}if(this.__enableScrollY){f-=d*this.options.speedMultiplier;const u=this.__maxScrollTop;(f>u||f<0)&&(this.options.bouncing?f+=d/2*this.options.speedMultiplier:f=f>u?u:0)}s.length>60&&s.splice(0,30),s.push(c,f,n),this.__publish(c,f,h)}else{let a=this.options.locking?3:0,d=5,c=Math.abs(r-this.__initialTouchLeft),f=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&c>=a,this.__enableScrollY=this.options.scrollingY&&f>=a,s.push(this.__scrollLeft,this.__scrollTop,n),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(c>=d||f>=d),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,this.__lastTouchMove=n,this.__lastScale=o}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let n=this.__positions,o=n.length-1,r=o;for(let i=o;i>0&&n[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==o){const i=n[o]-n[r],s=this.__scrollLeft-n[r-2],a=this.__scrollTop-n[r-1];this.__decelerationVelocityX=s/i*(1e3/60),this.__decelerationVelocityY=a/i*(1e3/60);const d=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>d||Math.abs(this.__decelerationVelocityY)>d)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,n,o,r=!1){const i=this.__isAnimating;if(i&&(An(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=n,this.__scheduledZoom=o;const s=this.__scrollLeft,a=this.__scrollTop,d=this.__zoomLevel,c=e-s,f=n-a,h=o-d,u=function(q,I,$){$&&(this.__scrollLeft=s+c*q,this.__scrollTop=a+f*q,this.__zoomLevel=d+h*q,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),w=function(q){return this.__isAnimating===q}.bind(this),b=function(q,I,$){I===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||$)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=yi(u,w,b,this.options.animationDuration,i?ga:ma)}else this.__scheduledLeft=this.__scrollLeft=e,this.__scheduledTop=this.__scrollTop=n,this.__scheduledZoom=this.__zoomLevel=o,this.__callback&&this.__callback(e,n,o),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const s=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),a=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),d=this.__clientWidth,c=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(s/d)*d,this.__minDecelerationScrollTop=Math.floor(a/c)*c,this.__maxDecelerationScrollLeft=Math.ceil(s/d)*d,this.__maxDecelerationScrollTop=Math.ceil(a/c)*c}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const n=function(s,a,d){this.__stepThroughDeceleration(d)}.bind(this),o=this.options.snapping?4:.1,r=function(){const s=Math.abs(this.__decelerationVelocityX)>=o||Math.abs(this.__decelerationVelocityY)>=o;return s||(this.__didDecelerationComplete=!0),s}.bind(this),i=function(s,a,d){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=yi(n,r,i)}__stepThroughDeceleration(e){let n=this.__scrollLeft+this.__decelerationVelocityX,o=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,n),this.__minDecelerationScrollLeft);r!==n&&(n=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,o),this.__minDecelerationScrollTop);i!==o&&(o=i,this.__decelerationVelocityY=0)}if(e?this.__publish(n,o,this.__zoomLevel):(this.__scrollLeft=n,this.__scrollTop=o),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let r=0,i=0,s=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;n<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-n:n>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-n),o<this.__minDecelerationScrollTop?i=this.__minDecelerationScrollTop-o:o>this.__maxDecelerationScrollTop&&(i=this.__maxDecelerationScrollTop-o),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*s:this.__decelerationVelocityX=r*a),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*s:this.__decelerationVelocityY=i*a)}}}var It=typeof window<"u"?window:{screen:{},navigator:{}},yn=(It.matchMedia||function(){return{matches:!1}}).bind(It),kl=!1,pa={get passive(){return kl=!0}},bi=function(){};It.addEventListener&&It.addEventListener("p",bi,pa),It.removeEventListener&&It.removeEventListener("p",bi,!1);var va=kl,wa="PointerEvent"in It,Dr="ontouchstart"in It,_l=Dr||"TouchEvent"in It&&yn("(any-pointer: coarse)").matches,xi=(It.navigator.maxTouchPoints||0)>0||_l,Il=It.navigator.userAgent||"",ya=yn("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Il)&&Math.min(It.screen.width||0,It.screen.height||0)>=768,Fl=(yn("(pointer: coarse)").matches||!yn("(pointer: fine)").matches&&Dr)&&!/Windows.*Firefox/.test(Il),ba=yn("(any-pointer: fine)").matches||yn("(any-hover: hover)").matches||ya||!Dr,vr=!xi||!ba&&Fl?xi?"touchOnly":"mouseOnly":"hybrid",xa=vr==="mouseOnly"?"mouse":vr==="touchOnly"||Fl?"touch":"mouse";const Ca=Object.freeze(Object.defineProperty({__proto__:null,deviceType:vr,primaryInput:xa,supportsPassiveEvents:va,supportsPointerEvents:wa,supportsTouchEvents:_l},Symbol.toStringTag,{value:"Module"})),Sa=new Set(["INPUT","TEXTAREA","SELECT"]),Dl={};function wr(){return Ca}const Al=t=>t==="BracketLeft"?"[":t==="BracketRight"?"]":Ue.camelToPrettyCase(t),Qe=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Dl,boundPixel:function(t,e=!1,n=0){return t},createSyntheticEvent:t=>{let e=!1,n=!1;return{nativeEvent:t,currentTarget:t.currentTarget,target:t.target,bubbles:t.bubbles,cancelable:t.cancelable,defaultPrevented:t.defaultPrevented,eventPhase:t.eventPhase,isTrusted:t.isTrusted,preventDefault:()=>{e=!0,t.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{n=!0,t.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:t.timeStamp,type:t.type}},detectIt:wr,focusableNodeNames:Sa,toPrettyKeyCode:Al},Symbol.toStringTag,{value:"Module"})),qa=[];function Ft(t,e,n=qa){const o=l.useRef(null);return l.useImperativeHandle(t,()=>{if(!o.current)return;const r=o.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const s=Object.keys(i),a=s.length;for(let d=0;d<a;d++){const c=s[d],f=i[c];Object.defineProperty(r,c,{value:f,writable:!0,configurable:!0,enumerable:!0})}return r},n),o}const yr=t=>g.jsx(Io,{...t}),Ll=({width:t,height:e})=>g.jsx("div",{className:"corner",style:{minWidth:`${t}px`,width:`${t}px`,minHeight:`${e}px`,height:`${e}px`}}),Ar=l.memo(l.forwardRef((t,e)=>{const{children:n,viewport:o,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:s=!0,createScrollCorner:a=Ll,createHorizontalScrollbar:d=yr,createVerticalScrollbar:c=yr,style:f,touchElement:h,disableTouch:u,...w}=t,b=X(r,[r]),q=Ft(e,()=>({isScrollPane:()=>!0}),[]),I=l.useRef(null);l.useEffect(()=>{I.current&&(I.current.__scrollTop===o?.top&&I.current.__scrollLeft===o?.left||I.current.__isDecelerating||I.current?.scrollTo(o?.left,o?.top,!1))},[o?.left,o?.top,h]);const $=l.useCallback((O,j)=>{b?.({left:O,top:j})},[]),D=l.useCallback(O=>{I.current?.doTouchStart(O.touches,O.timeStamp)},[]),v=l.useCallback(O=>{O.preventDefault(),I.current?.doTouchMove(O.touches,O.timeStamp)},[]),F=l.useCallback(O=>{I.current?.doTouchEnd(O.timeStamp)},[]),E=l.useCallback(({containerWidth:O,containerHeight:j,totalWidth:z,totalHeight:B})=>{I.current.setDimensions(O,j,z,B)},[]);l.useEffect(()=>{const O=h??q.current;if(!u&&wr().supportsTouchEvents&&O&&o){if(!I.current){const j={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};I.current=new fa($,j)}wr().supportsTouchEvents&&(O.addEventListener("touchstart",D),O.addEventListener("touchend",F),O.addEventListener("touchmove",v)),E({containerWidth:o?.width,containerHeight:o?.height,totalWidth:o?.totalWidth,totalHeight:o?.totalHeight})}return()=>{O?.removeEventListener("touchstart",D),O?.removeEventListener("touchend",F),O?.removeEventListener("touchmove",v)}},[o?.width,o?.height,o?.totalWidth,o?.totalHeight,u,h]);const[S,{width:k}]=Qt(),[N,{height:R}]=Qt(),T=l.useMemo(()=>{const O=c({orientation:wt.Vertical,offset:o?.top,viewportSize:o?.height,totalSize:o?.totalHeight,onScrollOffset:j=>{b?.({top:j})}});return g.jsx("div",{style:{display:"flex",flex:"0"},ref:S,children:O})},[c,o?.top,o?.height,o?.totalHeight]),G=l.useMemo(()=>{const O=d({orientation:wt.Horizontal,offset:o?.left,viewportSize:o?.width,totalSize:o?.totalWidth,onScrollOffset:j=>b?.({left:j})});return g.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[g.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${k}px)`},children:g.jsx("div",{ref:N,className:"sizer",children:O})}),s?a({width:k,height:R}):g.jsx(g.Fragment,{})]})},[d,o?.left,o?.width,o?.totalWidth,s,a,k,R]);return g.jsx("div",{style:{position:"relative",display:"flex",minWidth:s?`${k}px`:void 0,minHeight:i?`${R}px`:void 0,...f},...w,ref:q,children:g.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[g.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[g.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:n}),s?T:g.jsx(g.Fragment,{})]}),i?G:g.jsx(g.Fragment,{})]})})}));Ar.displayName="ScrollPane";const bn={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"},Ci=new Set,xo={showMessage:(t,e)=>{if(e?.onceKey){if(Ci.has(e.onceKey))return;Ci.add(e.onceKey)}let n=console.log;e?.type!==bn.Warning&&e?.type!==bn.Error||(n=console.warn),n(t)},showBusy:(t,e)=>new Promise(n=>{n(()=>{})}),showError:t=>{console.error(t)}},zl=()=>{const t=document.fullscreenElement;return t?t.querySelector(".fullscreen-portal-root")||t:document.body};let so=0;function Ol(){return l.useEffect(()=>{function t(){const e=document.fullscreenElement;if(!e)return;let n=e.querySelector(".fullscreen-portal-root");n||(n=document.createElement("div"),n.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",e.appendChild(n))}return so++,t(),document.addEventListener("fullscreenchange",t),()=>{document.removeEventListener("fullscreenchange",t),so--,so<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),so=0)}},[]),{getPortalContainer:zl}}const Ra=100,Ea=100,Ta=1e6,Ma=100,ka=50,Lr=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,viewportSize:o=0,totalSize:r=0,minSize:i=0,endGap:s=Ra,endScrollIncrement:a=Ea,style:d=Dl,onMouseDown:c,onScrollOffset:f,onScroll:h,scaleLimit:u=Ta,scaleFactor:w=Ma,precisionFactor:b=ka,...q}=t;h&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const I=X(c,[c]),$=()=>({offset:n,totalSize:u===0?r:Math.min(r??0,Math.max(i??0,(n??0)+(o??0))+(s??0))}),[D,v]=l.useState($),F=u!==0&&D.totalSize>u?w:1,E=F/b,S=Math.ceil(D.totalSize/F),k=Math.ceil(D.offset/F),N=Math.ceil(o/F),R=l.useCallback(Z=>{},[]),[T,G]=l.useState(!1),O=l.useRef(null);l.useLayoutEffect(()=>{if(!T){O.current={propTotalSize:r,propViewportSize:o,propOffset:n};const Z=$();v(Z)}},[r,o,n,T,i,s,a]);const j=X((Z,P,M)=>{const H=O.current;O.current=null,H&&H.propTotalSize===r&&H.propViewportSize===o&&H.propOffset===n||(Math.abs(Z-k)<E&&(Z=k),f?.(Z*F,k,N))},[f,F,E,k,N]),z=l.useCallback(Z=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",z),G(!1)},[]),B=l.useCallback(Z=>{I?.(Z),G(!0),document.addEventListener("mousemove",R,{passive:!0}),document.addEventListener("mouseup",z,{passive:!0})},[R,z]);return g.jsx(Io,{ref:e,style:{...d},...q,offset:k,totalSize:S,viewportSize:N,onMouseDown:B,onScrollOffset:j})}));Lr.displayName="VirtualScrollbar";const hn={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"};function er(t,e){if(typeof t=="function")return t(e);t&&(t.current=e)}var Co=parseInt(l.version.split(".")[0],10)>=19?function(t){return e=>{const n=[];for(const o of t){const r=er(o,e),i=typeof r=="function";n.push(i?r:()=>er(o,null))}return()=>{for(const o of n)o()}}}:function(t){return e=>{for(const n of t)er(n,e)}};const _a=l.memo(l.forwardRef((t,e)=>{const{refFocusStart:n,...o}=t,r=l.useRef(null),i=l.useCallback(()=>{if(n)return void n?.current?.focus();const s=r.current.parentElement.children;let a=[];for(let d=0;d<s.length&&s[d]!==r.current;d++){const c=s[d].getAttribute("tabindex");if(c==null||c==="-1"||s[d].getAttribute("disabled")==="true")continue;const f=s[d];f.focus&&a.push({tabindex:parseInt(c),child:f})}a.length!==0&&(a.sort(function(d,c){return d.tabindex-c.tabindex}),a[0].child.focus())},[n]);return g.jsx("div",{tabIndex:0,ref:Co([r,e]),onFocus:i,...o})})),Ia=l.memo(l.forwardRef((t,e)=>{const{className:n,style:o,children:r,radius:i=4,strokeWidth:s=1,strokeColor:a="grey",...d}=t,[c,{width:f,height:h}]=Qt(),u=l.useRef(null),w=($,D=0)=>{const v=$/2,F=h-v+D;return function(E,S,k=!1){if(S===0)return E;function N(z,B,Z){let P=B.x-z.x,M=B.y-z.y,H=Math.sqrt(P*P+M*M);return R(z,B,Math.min(1,Z/H))}function R(z,B,Z){return{x:z.x+(B.x-z.x)*Z,y:z.y+(B.y-z.y)*Z}}function T(z,B){z.length>2&&(z[z.length-2]=B.x,z[z.length-1]=B.y)}function G(z){return{x:parseFloat(z[z.length-2]),y:parseFloat(z[z.length-1])}}let O=E.split(/[,\s]/).reduce(function(z,B){let Z=B.match("([a-zA-Z])(.+)");return Z?(z.push(Z[1]),z.push(Z[2])):z.push(B),z},[]).reduce(function(z,B){return parseFloat(B)==B&&z.length?z[z.length-1].push(B):z.push([B]),z},[]),j=[];if(O.length>1){let z=G(O[0]),B=null;O[O.length-1][0]==="Z"&&O[0].length>2&&(B=["L",z.x,z.y],O[O.length-1]=B),j.push(O[0]);for(let Z=1;Z<O.length;Z++){let P=j[j.length-1],M=O[Z],H=M===B?O[1]:O[Z+1];if(H&&P&&P.length>2&&M[0]==="L"&&H.length>2&&H[0]==="L"){let oe,ue,te=G(P),K=G(M),le=G(H);k?(oe=R(K,P.origPoint||te,S),ue=R(K,H.origPoint||le,S)):(oe=N(K,te,S),ue=N(K,le,S)),T(M,oe),M.origPoint=K,j.push(M);let Re=R(oe,K,.5),Te=R(K,ue,.5),ae=["C",Re.x,Re.y,Te.x,Te.y,ue.x,ue.y];ae.origPoint=K,j.push(ae)}else j.push(M)}if(B){let Z=G(j[j.length-1]);j.push(["Z"]),T(j[0],Z)}}else j=O;return j.reduce(function(z,B){return z+B.join(" ")+" "},"")}(`M 0 ${v} L ${i-.5} ${v} L ${i-.5} ${F} L ${2*i} ${F} L ${f-2*i} ${F} M ${f-2*i} ${F} L ${f-i} ${F} L ${f-i} ${v} L ${f} ${v}`,i)},b=l.useMemo(()=>w(s),[f,h,i,s]),q=l.useMemo(()=>{if(i===0)return;const $=i/2;return w(i)+`L ${f} 0 L 0 0 L 0 ${$}`},[b,i,s]),I=l.useMemo(()=>({style:{clipPath:`path('${q}')`}}),[q]);return g.jsxs("div",{className:n,style:{display:"flex",flexDirection:"row",...o},...d,ref:Co([u,c,e]),children:[l.isValidElement(r)?l.cloneElement(r,I):g.jsx(g.Fragment,{}),g.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:f,height:h,viewBox:`0 0 ${f} ${h}`,children:g.jsx("path",{d:b,stroke:a,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:s})})]})})),Fa={},jl=t=>{const{onPointerDown:e,style:n,splitDirection:o,paddingBefore:r=0,paddingAfter:i=0,disabled:s,key:a,hitAreaProps:d=Fa,...c}=t,f=o==="row",{style:h,className:u,...w}=d;return g.jsx("div",{style:{...n,position:"relative"},...c,children:g.jsx("div",{className:fn("hit-box",u),style:{left:(f?-r:0)+"px",width:`calc(100% + ${f?r+i:0}px)`,top:(f?0:-r)+"px",height:`calc(100% + ${f?0:r+i}px)`,position:"absolute",...h},onPointerDown:s?void 0:e,...w})},a)},ao={},Yt=(t,e,n=!0)=>t===null?null:t.pixels!==null?n?t.pixels:e-t.pixels:(n?t.percent:100-t.percent)/100*e,co=(t,e=!0)=>t?.percent?`${e?t.percent:100-t.percent}%`:t?.pixels?`${t.pixels}px`:void 0,Ht=(t,e)=>{if(t==null)return null;const n={percent:null,pixels:null};let o=e;return typeof t=="string"&&((t=t.trim().toLowerCase()).endsWith("px")?(t=t.substring(0,t.length-2),o=!1):t.endsWith("%")&&(t=t.substring(0,t.length-1),o=!0),t=parseFloat(t)),o?n.percent=t:n.pixels=t,Object.freeze(n)},Da=l.memo(l.forwardRef((t,e)=>{const{elementBefore:n,elementAfter:o,splitDirection:r="row",fixedPane:i=null,position:s,onPositionChange:a,minBefore:d,maxBefore:c,minAfter:f,maxAfter:h,children:u,className:w,style:b,disabled:q=!1,onDragStart:I,onDragResize:$,onDragFinish:D,resizerProps:v=ao,paneProps:F=ao,paneBeforeProps:E=ao,paneAfterProps:S=ao,createResizer:k=jl}=t;if(u)throw new Error("Use elementBefore and elementAfter instead of children.");const N=l.useMemo(()=>l.isValidElement(o)&&l.isValidElement(n),[o,n]),R=l.useMemo(()=>{let m=null;i&&(i==="before"?m=0:i==="after"&&(m=1));const _=m===null;return{fixedPaneOffset:m,isPercent:_,minBefore:Ht(d,_),maxBefore:Ht(c,_),minAfter:Ht(f,_),maxAfter:Ht(h,_)}},[d,c,f,h]),T=X(a,[a]),[G,O]=l.useState(()=>Ht(s,i===null));l.useEffect(()=>{O(Ht(s,i===null))},[s,i]);const[j,{width:z,height:B}]=Qt(),[Z,{width:P,height:M}]=Qt(),H=r==="row"?P:M,oe=r==="row"?z:B,ue=l.useMemo(()=>((m,_,A,x)=>{const V=[null,null],y=[null,null];if(m||(m={percent:x.fixedPaneOffset===null?50:null,pixels:x.fixedPaneOffset===null?null:0}),_===0)return m?.pixels!=null?x.fixedPaneOffset!==1?(V[0]=m?.pixels,y[1]=100):(V[1]=m?.pixels-A,y[0]=100):m?.percent!=null&&(x.fixedPaneOffset!==1?(y[0]=m?.percent,y[1]=100-m?.percent):(y[1]=m?.percent,y[0]=100-m?.percent)),{percents:y,pixels:V,minBefore:co(x.minBefore,!0),maxBefore:co(x.maxBefore,!0),minAfter:co(x.minAfter),maxAfter:co(x.maxAfter)};let W=Yt(m,_,x.fixedPaneOffset!==1),Y=_-A,ie=Yt(x.minBefore,Y,!0)??0,de=Yt(x.maxBefore,Y,!0)??Y,ce=0,he=0,be=0,ve=Y;ce=(Yt(x.maxAfter,_,!1)??A)-A,he=Yt(x.minAfter,_,!1)??_,be=Math.max(ie,ce),ve=Math.min(de,he),W=Math.max(be,Math.min(W,ve)),he=Math.min(Y-W,Yt(x.maxAfter,Y-W,!0)??Y),ce=Math.min(Y-W,Yt(x.minAfter,Y-W,!0)??Y),V[0]=W,V[1]=Y-V[0];const we=Math.max(0,Math.min(100,W/Y*100));return y[0]=we,y[1]=100-y[0],{percents:y,pixels:V,minBefore:`${ie}px`,minAfter:`${ce}px`,maxBefore:`${V[0]}px`,maxAfter:`${V[1]}px`}})(G,oe,H,R),[R,G,oe,H,r]),[te,K]=l.useState(!1),le=X(I,[I]),Re=X($,[$]),Te=X(D,[D]),ae=l.useRef(null),Fe=l.useRef(null),me=l.useRef(null),{style:Oe,className:xe,...ge}=F,fe={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",display:"flex",overflow:"hidden",...Oe},{className:Se,style:pe,...Ce}=E,{className:Ae,style:ye,...De}=S,Pe={flex:"1 1 100%",width:"100%",...b,flexDirection:r,display:"flex"},{className:$e,style:C,onPointerDown:We,...nt}=v,Ke=X(m=>{const _=Ht(m,i===null);O(_)},[i]),ee=X(m=>{if(q||!te)return;const _=Me.current?.getBoundingClientRect();let A=0;A=r==="row"?(m.clientX??m.touches?.[0]?.clientX)-_.x:(m.clientY??m.touches?.[0]?.clientY)-_.y,A=Math.max(0,Math.min(oe,A)),R.fixedPaneOffset===1&&(A=oe-A),s&&G.pixels===A||O({pixels:A,percent:null}),Re?.(A),m.stopPropagation(),m.preventDefault()},[R,r,q,te,G,oe]),_e=X(m=>{if(document.removeEventListener("pointermove",ee),document.removeEventListener("touchmove",ee),document.removeEventListener("pointerup",_e),te&&(K(!1),G)){if(Te(G.pixels),!Ht(s,i===null)||G.pixels!==s){const _={...G};_.percent===null&&(_.percent=_.pixels/oe*100),T(_)}m.stopPropagation(),m.preventDefault()}},[G,te,s,i,oe]),Ve=X(m=>{We?.(m),m.defaultPrevented||q||te||(K(!0),le(),document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("pointerup",_e,{passive:!1}))},[We]),Me=Ft(e,()=>({setPosition:Ke,isSplitPane:()=>!0}),[]),Le=l.useMemo(()=>N?k?.({key:"resizer",ref:Co([Z,Fe]),className:fn("resizer",$e),onPointerDownCapture:Ve,style:{cursor:q?void 0:r==="row"?"ew-resize":"ns-resize",minWidth:r==="row"?"2px":void 0,minHeight:r!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...C},splitDirection:r,disabled:q,...nt}):null,[N,$e,nt,r,C,q]),Ie=r==="row"?"Width":"Height",L={...fe,...pe,flex:R.fixedPaneOffset===0&&ue?.pixels[0]!==null?`0 0 ${Math.round(ue?.pixels[0])}px`:`1 1 ${Math.round(ue?.percents[0]??100)}%`,[`min${Ie}`]:ue?.minBefore,[`max${Ie}`]:o?ue?.maxBefore:"100%"},se={...fe,...ye,flex:R.fixedPaneOffset===1&&ue?.pixels[1]!==null?`0 0 ${Math.round(ue?.pixels[1])}px`:`1 1 ${Math.round(ue?.percents[1]??100)}%`,[`min${Ie}`]:ue?.minAfter,[`max${Ie}`]:n?ue?.maxAfter:"100%"},U=l.useMemo(()=>n?g.jsx("div",{ref:ae,className:fn("before",xe,Se),style:L,...ge,...Ce,children:n},"before"):null,[n,F,E,R,ue]),J=l.useMemo(()=>o?g.jsx("div",{ref:me,className:fn("after",xe,Ae),style:se,...ge,...De,children:o},"after"):null,[o,F,S,R,ue]);return g.jsxs("div",{ref:Co([j,Me]),className:fn("splitPane",r==="row"?"vertical":"horizontal",{dragging:te},w),style:Pe,children:[U,Le,J]})}));function Si(t){if(!t)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:n,onPointerMoveOrWait:o,processTouch:r=!1,consumeTouch:i=!0}=t,s=X(e,[e]),a=X(n,[n]),d=X(o,[o]),c=l.useRef(!1),f=t?.timerInitial??230,h=t?.timerContinuous??f/2,u=l.useRef(null),w=l.useRef(null),b=l.useRef(null),q=l.useRef(null),I=l.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=null)},[]),$=l.useCallback(T=>{q.current=setTimeout(()=>{window.requestAnimationFrame(()=>{c.current!==!1&&d?.(w.current,b.current,u.current)}),$(h)},T??f)},[]);l.useEffect(()=>()=>I(),[]);const D=r?"pointer":"mouse",v=l.useCallback(T=>{T.stopPropagation(),T.stopImmediatePropagation(),T.preventDefault()},[]),F=X(T=>{document.removeEventListener(`${D}move`,k),document.removeEventListener(`${D}up`,F),document.removeEventListener("keydown",N),document.removeEventListener("keyup",R),document.removeEventListener("touchstart",v,{capture:!0}),document.removeEventListener("touchmove",v,{capture:!0}),window.removeEventListener("blur",E),I(),window.requestAnimationFrame(()=>{c.current!==!1&&(c.current=!1,a?.(T,b.current,u.current),b.current=null)})},[]),E=l.useCallback(()=>{c.current!==!1&&(c.current=!1,F(w.current))},[]),S=X(()=>{I(),$(h),window.requestAnimationFrame(()=>{c.current!==!1&&d?.(w.current,b.current,u.current)})},[h]),k=X(T=>{w.current=T,S()},[]),N=X(T=>{b.current={ctrlKey:T.ctrlKey,shiftKey:T.shiftKey,altKey:T.altKey,metaKey:T.metaKey},S()},[]),R=X(T=>{b.current={ctrlKey:T.ctrlKey,shiftKey:T.shiftKey,altKey:T.altKey,metaKey:T.metaKey},S()},[h]);return X(T=>{T.isDefaultPrevented()||(b.current={ctrlKey:T.ctrlKey,shiftKey:T.shiftKey,altKey:T.altKey,metaKey:T.metaKey},s(T,b.current)!==!1&&(u.current=T,w.current=T.nativeEvent,document.addEventListener(`${D}up`,F,{passive:!1}),document.addEventListener(`${D}move`,k,{passive:!1}),document.addEventListener("keydown",N,{passive:!1}),document.addEventListener("keyup",R,{passive:!1}),window.addEventListener("blur",E,{passive:!0}),r&&i&&(document.addEventListener("touchstart",v,{passive:!1,capture:!0}),document.addEventListener("touchmove",v,{passive:!1,capture:!0})),c.current=!0,$(f)))},[f,r])}const Aa=({initValue:t,useHookBody:e,applyStateChange:n})=>{const o=l.useRef(t);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return l.useLayoutEffect(()=>{o.current!==r&&(o.current=r,n(r))},[n,r]),null},br=t=>{console&&console.warn&&console.warn(t)},tr=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let La=1,xr=!1,Nl=!1;const wo=[],pn=[],So=()=>{pn.forEach(t=>t())},za=({automaticContainerInternalUseOnly:t})=>{const[e,n]=l.useState([]),o=l.useRef([]);return o.current=e,t||xr!==!1||(Nl=!0),l.useEffect(()=>{let r=!0;function i(){if(r)return pn[0]!==i?(t||xr!==!0||br("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void n(s=>[])):void n([...wo])}return pn.push(i),So(),()=>{r=!1,o.current?.length>0&&br("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),pn.splice(pn.indexOf(i),1),So()}},[t]),g.jsx(g.Fragment,{children:e.map(({hook:r,key:i})=>l.createElement(Aa,{...r,key:i}))})},Pl=(t,e,n={})=>{let o,r,i=!1,s=!1,a=[],{unmountIfNoConsumers:d=!1}=n;const c=h=>{r=h,Wt.unstable_batchedUpdates(()=>a.forEach(u=>u(h)))},f=()=>(s||(r=typeof t=="function"?t():t,s=!0),r);return()=>{const[h,u]=l.useState(f);return l.useEffect(()=>(i||(i=!0,o=(w=>{const b=La++;return wo.push({hook:w,key:b}),pn.length===0&&Nl===!1&&(xr=!0,(q=>{if(tr.document&&tr.document.createElement){const I=tr.document.createElement("div");Hs.createRoot(I).render(g.jsx(q,{automaticContainerInternalUseOnly:!0}))}else br("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(za)),So(),()=>{wo.splice(wo.findIndex(q=>q.key===b),1),So()}})({initValue:t,useHookBody:e,applyStateChange:c})),a.push(u),r!==h&&u(r),()=>{a.splice(a.indexOf(u),1),a.length===0&&d&&(o(),i=!1)}),[]),h}};let Bl=()=>{console.warn("You must call useEditMode before setting its state.")};const Oa=Pl(null,()=>{const[t,e]=l.useState(null);return Bl=e,t}),Gt=()=>{const t=Oa();return l.useMemo(()=>({setMode:e=>{Bl(n=>(typeof e=="function"&&(e=e(n)),e?.onModeChange?.(e??null),e))},getMode:()=>t}),[t])};class ne{constructor(e,n,o,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=n,this._applyProps(o||{}),this._callback=r,r===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,n){if(typeof e=="function"){const o=n??this._context;return e(typeof o=="function"?o():o)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,n){const o=this._scopedLabels?.[e]||this._label;let r=null;if(typeof o=="function"){const i=n??this._context;r=o(typeof i=="function"?i():i)}else r=o;return r}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,n){if(!this.disabled()&&this._callback){try{let o=!0;if(n?.beforeExecute&&(o=n?.beforeExecute(this,e)),await Promise.resolve(o)===!1)return!1;const r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!1)return!1;n?.onExecute?.(this,e),this._notifyExecute(e)}catch(o){return console.warn(o),n?.onError(this,o,e),this._notifyError(e,o),!1}return!0}}addPropertyListener(e,n=!1){if(!e)throw new Error("listener must be specified");const o=this._listenersProperties;return o.add(e),n&&e({},this),()=>{o.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const n=this._listenersExecute;return n.add(e),function(){n.delete(e)}}_notifyExecute(e){const n=this;this._listenersExecute.forEach(o=>{o.onExecute(n,e)})}_notifyError(e,n){const o=this;this._listenersExecute.forEach(r=>{r.onError?.(o,e,n)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const n=this._applyProps(e);return Object.keys(n).length>0&&this._notifyPropertyChange(n),this}_notifyPropertyChange(e){const n=this;this._listenersProperties.forEach(o=>{o(e,n)})}_applyProps(e){let n={},o=this;return Object.keys(e).forEach(r=>{let i=e[r];o["_"+r]!==i&&(o["_"+r]=n[r]=i)}),n}}class Ne extends ne{}class nn{constructor(e,n){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=Ue.uuidV4(),this._target=e,this._groupKey=n??null,this._root=this,this._nodes=new Map,this._nodes.set(n,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const o=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(r,i)=>{const s=o._root._listenersByKey,a=i.key(),d=s.get(a);d&&o._notifyCommands(d,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,n=!1){const o=this._root._focused;let r=o,i=o===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?o:this)._getCommand(e)}createChildGroup(e,n,o){let r;if(!o){let a=this;for(;a&&!r;){let d=a._nodes.get(n);d&&(r=d),a=a._parent}}r||(r=new nn(e,n),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(a,d)=>{!a.has(n)||o?a.set(n,d):o===void 0&&console.warn("commandGroup already registered",n)};i(this._root._nodes,r);let s=this._parent;for(;s;)i(this._nodes,r),s=s._parent;return this._children.set(n,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,n=void 0){const o=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,s=this._root._unListenersByCommand;for(let a=0;a<e.length;a++){const d=e[a],c=d.key();if(o.has(c)&&!n){n===void 0&&console.warn("command already registered",c);continue}o.set(c,d);let f=s.get(d);f&&(f(),s.delete(d));const h=d.addPropertyListener(i);s.set(d,h);const u=d.shortcut();if(!u)continue;const w=Array.isArray(u)?u:[u];for(let b=0;b<w.length;b++){const q=gn(w[b]),I=r.get(q);I&&!n&&n===void 0&&console.warn(`Shortcut already registered: ${q}, ${c}, ${I}.`),r.set(q,c)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,n=[];const o=this._groupKey;for(;e;)n.push(e._nodes),e._nodes.delete(o),e=e._parent;e=this._parent;const r=i=>{i._children.forEach(s=>{for(let a=0;a<n.length;a++)s._nodes.delete(n[a]);r(s)})};r(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,n){this._addCommands(e,n),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let n=this;if(e&&(n=this._nodes.get(e),!n))return void console.warn("group not found",e);let o=this._root._focused??this._root;for(;o;)o=o._parent;this._root._focused!==n&&(this._root._focused=n,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const n=[];e.altKey&&n.push(Q.Alt),e.shiftKey&&n.push(Q.Shift),e.ctrlKey&&n.push(Q.Ctrl),e.metaKey&&n.push(Q.Meta);let o=gn({key:e.code,modifiers:n});const r=this._commandsByShortcut;let i=r.get(o);i||(o=gn({key:e.key,modifiers:n}),i=r.get(o)),!i&&e.code.startsWith("Digit")&&(o=gn({key:e.code.substring(5,e.code.length),modifiers:n}),i=this._commandsByShortcut.get(o)),!i&&e.code.startsWith("Key")&&(i=gn({key:e.code.substring(3,e.code.length),modifiers:n}),i=r.get(o));let s=null;return i&&(s=this._commandsByKey.get(i),s&&s.disabled()&&(s=null),!s||s.target()&&s.target().contains(e.target)||(s=null)),s||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const n=this.getActive();if(!n||e.isDefaultPrevented())return!1;const o=n.findCommandByEvent?.(e);return!!o&&(o.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,n){const o=this._listeners,r=n?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let s=null;if(r)for(let a=0;a<r.length;a++){const d=r[a];if(!d)continue;let c=i.get(d);c||(c=new Set,i.set(d,c)),s||(s=[]),s.push(c),c.add(e)}return o.add(e),()=>{if(s)for(let a=0;a<s.length;a++)s[a].delete(e);o.delete(e)}}_notifyCommands(e,n,o){const r=this;setTimeout(()=>{e.forEach(i=>{i[n]?.(r,o)})},0)}_notify(e,n){const o=this;setTimeout(()=>{o._listeners.forEach(r=>{r[e]?.(o,n)}),o._parent&&o._parent._notify(e,n)},0)}getAllCommands(){const e=[],n=this._groupKey;return this._commandsByKey.forEach(o=>{e.push({command:o,groupKey:n})}),this._children.forEach(o=>{e.push(...o.getAllCommands())}),e}}const ja=Ue.getOS()===Ue.OSType.MacOS||Ue.getOS()===Ue.OSType.IOS?"Cmd":"Ctrl",Na=Ue.getOS()===Ue.OSType.MacOS||Ue.getOS()===Ue.OSType.IOS?"⌘":"^",gn=(t,e=!1)=>{const n={};for(let r=0;t.modifiers&&r<t.modifiers.length;r++)n[t.modifiers[r]]=!0;let o="";return(n?.[Q.Ctrl]||n?.[Q.Meta])&&(o+=(o.length>0?"+":"")+(e?Na:ja)),n?.[Q.Alt]&&(o+=e?"⌥":"Alt"),n?.[Q.Shift]&&(o+=(o.length>0?"+":"")+(e?"⇧":"Shift")),o+=(o.length>0?"+":"")+Al(t.key),o},uo=(t,e)=>{const n=[];if(e)for(let o=0;o<e.length;o++){const r=e[o],i=r?t?.getCommand(r):null;n.push(i)}return n};function zr(t,e=null,n=null,o){const r=l.useRef(n);r.current=n,e&&!Array.isArray(e)&&(e=[e]);const[i,s]=l.useState(uo(t,e)),a=o?[...o,t]:[t];return l.useEffect(()=>{const d={onGroupChange:()=>{const u=uo(t,e);s(u),r.current?.onChange?.(this)}};let c;e&&e.length>0&&(c={keys:e},d.onCommandChange=(u,w)=>{r.current?.onChange?.(t),s(uo(t,e))});const f=t?.addListener(d,c),h=uo(t,e);return s(h),r.current?.onChange&&r.current?.onChange(t),()=>{f?.()}},a),i}const Or=Pl({setClipboard:t=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>wn.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[t,e]=l.useState(wn.Global);return{setClipboard:n=>e(n),getClipboard:()=>t,refNativeCopy:l.useRef(null),refNativeLastKey:l.useRef(null)}}),jr=t=>{const{source:e,target:n,onPaste:o,onClipboardUpdate:r,notifier:i=xo,commands:s}=t,a=X(r,[r]),d=X(o,[o]),{getClipboard:c,refNativeCopy:f}=Or(),h=c();l.useMemo(()=>{const D=e?.element,v=n?.element??e?.element;if(!s)return;const F=[new Ne("cut",D,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",shortcut:{key:"X",modifiers:[Q.Ctrl]}}),new Ne("copy",D,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",shortcut:{key:"C",modifiers:[Q.Ctrl]}}),new Ne("paste",v,{label:"Paste",description:"Add content on the clipboard to your document.",shortcut:[{key:"V",modifiers:[Q.Ctrl]},{key:"F8",modifiers:[Q.Ctrl]}]})];s?.addCommands(F,!0)},[s]);const u=X(async D=>{if(!e?.element)return;let v=null;try{v=e.doCopy?.(D),typeof v=="string"?await h.writeText(v):await h.writeReference(v)}catch(F){throw F}},[e,i]),w=X(async D=>{const v=e?.element?.();if(v){f.current={sourceElement:v,args:D};try{await u(D)}catch(F){i?.showError?.(F)}}},[e?.element,i]),b=l.useCallback(()=>{w({isCut:!0})},[]),q=X(async(D,v,F)=>{try{if(await D.doPaste(v,F)===!1)return;d?.(v,F)}catch(E){i?.showError?.(E)}},[d]),I=X(async(D,v,F)=>{const E=n?.element?.();if(E&&await Ue.whenFocus(E),!D&&!v)return;const S=await i?.showBusy?.("Pasting...");if(v)try{return await q(n,v,F),void S?.()}catch(R){S?.(),i?.showError?.(R)}let k,N=n.importFromExternal;N||(N=(R,T)=>({getItemType:()=>"text",toText:()=>D.text,isClipboardItem:!0}));try{k=await N(D,{isCut:!1})}catch(R){S?.(),i?.showError?.(R)}if(k)try{const R=await Promise.resolve(k);await q(n,R,F),S?.()}catch(R){S?.(),i?.showError?.(R)}else S?.()},[q,n,i]),$=X(async D=>{if(n?.element)try{const v=await h.readReference();if(v)return void await I(null,v,D);const F=[];F[0]=await sa(h,Pt),F[1]=await aa(h,Ct),F[2]=await la(h,po);const E={text:F[0]??null,html:F[1]??null,image:F[2]??null};await I(E,null,D)}catch(v){if(v?.message==="Document is not focused.")return;i?.showError?.(v)}},[I,n?.element,i]);return X(async D=>{},[e?.element]),X(async D=>{},[n?.element,I,i]),l.useEffect(()=>{if(!h)return;const D=async E=>{const S=await h.readReference();a?.(S)},v=E=>{i?.showMessage?.(wn.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},F=E=>{i?.showMessage?.(wn.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return h.addEventListener("clipboardchange",D),h.addEventListener("clipboarderrorread",v),h.addEventListener("clipboarderrorwrite",F),()=>{h.removeEventListener("clipboardchange",D),h.removeEventListener("clipboarderrorread",v),h.removeEventListener("clipboarderrorwrite",F)}},[h,i]),l.useEffect(()=>{},[u,I,e,n]),l.useEffect(()=>{s?.getCommand("cut")?.updateCallback(b).update({disabled:!e||!n}),s?.getCommand("copy")?.updateCallback(w).update({disabled:!e}),s?.getCommand("paste")?.updateCallback($).update({disabled:!n})},[e,n,s]),{paste:$,copy:w,clipboard:h}};let nr=!1,Pa=0;var Ba=typeof document<"u"?l.useLayoutEffect:l.useEffect;const qi=()=>"sheetxl-ui-"+Pa++,Va=l.useId??function(){const[t,e]=l.useState(()=>nr?qi():void 0);return Ba(()=>{t==null&&e(qi())},[]),l.useEffect(()=>{nr||(nr=!0)},[]),t},Ri="Undo the last action.",Ei="Repeat the last action or undo the redo.",Ha=t=>`Redo ${t}`,Wn=(t=6e4)=>new Date(Math.floor(Date.now()/t)*t),$a=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:Wn},Symbol.toStringTag,{value:"Module"})),Vl=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),Cr=(t,e=!0,n=Vl)=>{if(!n||n.length===0)return t;if(t===void 0)return n[0];if(e&&t>=n[n.length-1]||!e&&t<=n[0])return t;let o=Ue.findEqualOrGreater(n,t);return e?(n[o]===t&&(o+=1),n[o]||(o-=1),n[o]):(o-=1,n[o])},Ua=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Vl,findNextFontSize:Cr},Symbol.toStringTag,{value:"Module"})),Sr=l.memo(t=>{const{anchorLocation:e=ct.TopLeft,cellWidth:n,cellHeight:o,size:r=7,inset:i=1,darkMode:s,fill:a,pathProps:d,style:c,...f}=t,h=r,u=i;let w="red",b=[],q=[];return e===ct.TopLeft?(w=s?"rgb(255, 198, 246)":"green",b.push(u),q.push(u),b.push(u+h),q.push(u),b.push(u),q.push(u+h)):e===ct.TopRight?(w=s?"rgb(0, 255, 255)":"red",b.push(n-u),q.push(u),b.push(n-(u+h)),q.push(u),b.push(n-u),q.push(u+h)):e===ct.BottomRight?(w=s?"rgb(236, 252, 211)":"purple",b.push(n-u),q.push(o-u),b.push(n-(u+h)),q.push(o-u),b.push(n-u),q.push(o-(u+h))):e===ct.BottomLeft&&(w=s?"rgb(255, 236, 183)":"blue",b.push(u),q.push(o-u),b.push(u+h),q.push(o-u),b.push(u),q.push(o-(u+h))),g.jsx("svg",{width:`${n}`,height:`${o}`,viewBox:`0 0 ${n} ${o}`,style:{position:"absolute",width:`${n}px`,height:`${o}px`,pointerEvents:"none",...c},...f,children:g.jsx("path",{d:`M ${b[0]} ${q[0]} L ${b[1]} ${q[1]} L ${b[2]} ${q[2]} L ${b[0]} ${q[0]} Z`,fill:a??w,...d})})}),Hl=t=>{const{renderBounds:e,darkMode:n,zoom:o,disabled:r,filter:i,onFilterButtonMouseDown:s,style:a,...d}=t,c=l.useMemo(()=>{let w=null;const b=i.getSortField();b&&(w=b.reverse);const q=i.getField(),I=q&&q.criteria&&q.criteria.length>0;return w===!0?I?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":w===!1?I?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":I?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[i]),[f,h]=l.useState(!1),u=Math.min(Math.min(18,e.height-8),e.width);return g.jsx("div",{style:{width:`${u}px`,height:`${u}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${f&&!r?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(u>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:r?void 0:"pointer",...a},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:w=>{s?.(w,i)},...d,children:g.jsx("svg",{width:""+15*o,height:""+15*o,viewBox:"0 0 15 15",style:{fill:`var(${f&&!r?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:r?.6:1},children:g.jsx("path",{d:c})})})},$l=t=>{const{value:e,coords:n,bounds:o,children:r,style:i,range:s,zoom:a=1,view:d,bodyStyle:c,normalStyle:f,showFormulas:h,showZeros:u,docTheme:w,onLinkMouseDown:b,onFilterButtonMouseDown:q,filterButtonProps:I,createFilterButton:$=Hl,...D}=t,v=o.height/a,F=o.width/a,E=e,S=E.getValue(),k=e.getStyle(),N=c?.darkMode??!1;let R,T;const G=S&&S.isFormulaError,O=G&&S instanceof p.FormulaError.Parse;let j,z=h||O;if(z)if(E.isSpillOverflow())T="";else{const Ie=E.getFormulaText();Ie?T=Ie:R=E.getNumberFormat(p.NumberFormat.Type.General)}else R=E.getNumberFormat();z||(j=E.getTextOverflow());const B=j?j.colBounds.width+j.leftOffset+j.rightOffset:F,Z=j?j.anchorBounds.x-j.leftOffset:0,P=j?j.anchorBounds.width:F,M=j?j.anchorBounds.x:0;let H,oe=E.getRenderHorizontalAlignment();R&&(H=R?.formattedRuns,T=H?.runs[0]?.text??R.displayText);const ue=E.getCalcStatus()===p.ICell.CalcStatus.Pending;let te=null,K=k.getFill().toCSS(N,o),le=0,Re=0;if(!k.getBorder().isEmpty()){const Ie=k.getBorder().getRight();!Ie.isNone()&&p.IBorder.BuiltInDefinitions.get(Ie.getStyle()).width>1&&(le=1);const L=k.getBorder().getBottom();!L.isNone()&&p.IBorder.BuiltInDefinitions.get(L.getStyle()).width>1&&(Re=1)}let Te=null;if(F!==P||le||Re||typeof K?.backgroundPosition=="number"){const{backgroundPosition:Ie,...L}=K,se=Ie??0,U=d?.getScrollTopLeft(),J=se?-(o.x+(U.left??0))%se:0,m=se?-(o.y+(U.top??0))%se:0;(Ie!==void 0||le||Re||F!==P)&&(Object.keys(L).length===1&&L.background==="none"||(K=null,Te=g.jsx("div",{className:"fill",style:{marginLeft:`${J}px`,marginTop:`${m}px`,left:M*a,width:Qe.boundPixel(P*a-J+1+le),height:Qe.boundPixel(o.height-m+1+Re),...L}},"background")))}let ae=null;const Fe=E.getComments(),me=E.getWarnings(),Oe=E.getErrors();if(Fe||G||Oe.length>0||me.length>0){const Ie={size:7*a,darkMode:N,cellWidth:P*a+2,cellHeight:v*a+2,style:{top:-1,left:M*a-1}};ae=ae??[],(me.length>0||Oe.length>0||G)&&ae.push(g.jsx(Sr,{anchorLocation:ct.TopLeft,...Ie},`indicator-${ae.length}`)),Fe&&ae.push(g.jsx(Sr,{anchorLocation:ct.TopRight,...Ie},`indicator-${ae.length}`))}const xe=k.getFont();let ge=R?.conditionalColor;const fe=k.getAlignment(),Se=fe.getHorizontal()===p.ITextFrame.HorizontalAlignment.Fill,pe=fe.getHorizontal()===p.ITextFrame.HorizontalAlignment.CenterContinuous||Se,Ce=pe||z?0:fe.getRotation(),Ae=E.getInsets(),ye=Ae.top+Ae.bottom;let De=Ae.left,Pe=Ae.right;const $e={...i,left:i.left-1,top:i.top-1,width:i.width+1+le,height:i.height+1+Re},C=E.getColumnFilter(),We=C&&!C?.hasHiddenButton();let nt=null;ue&&(nt=g.jsxs("div",{className:"slider",children:[g.jsx("div",{className:"line"}),g.jsx("div",{className:"subline inc"})]},"pending"));const Ke=!(ue||We||Te||r||ae||H?.runs.length>1||j||Ce%360!=0);K?.background==="none"&&(K=null);let ee=pe||!(!j||!(j.rightIndex>0||j.leftIndex>0||j.colSpan>1));if(!ee){const Ie=E.getSpans();(Ie.width>1||Ie.height>1)&&(ee=!0)}const _e={...K,...$e,pointerEvents:b?"auto":void 0};if(!Ue.isEmpty(T)||!Ue.isEmpty(R?.repeatPlaceholder)){const Ie=R?.canWrap??!1;let L=null,se=null,U=null,J=[],m=!0;u||z||S!==0||(m=!1);const _=E.getTextFrame(z);if(m&&_){let A=B-1-(De+Pe);if(Ce){L=_.layout().bounds;const be={x:0,y:0,width:B-1,height:v};if(H){let ve=H.width;if(R.repeatPlaceholder||R.repeatChars.length>0){const we=p.GeomUtils.boundsToPoints(be),qe=p.GeomUtils.rotatePoints(we,-Ce);ve=p.GeomUtils.minBoundingRect(qe).width}L={...L,width:ve}}U=p.GeomUtils.clipToOuterRect({...L,width:L.width+1+De+Pe},be,Ce),A=U.width-1-(De+Pe)+.01}let x=null;Ie&&(x={width:A});let V=null,y=R?.repeatPlaceholder;const W=_.layout(x);if(L=W.bounds,z?L={...L,width:0}:H&&(L={...L,width:R.repeatPlaceholder||R.repeatChars.length>0?A:H.width}),Ce&&Ie){let he=null;W.visitLines({visitTextLine:(be,ve)=>{let we=be.bounds;const qe=p.GeomUtils.boundsToPoints(we),Be=p.GeomUtils.rotatePoints(qe,Ce),ze=p.GeomUtils.minBoundingRect(Be);we={...we,x:(ze.width-we.width)/2,y:(ze.height-we.height)/2},he=he?p.GeomUtils.unionBounds(he,we):we}}),L={...he,width:he.width+De+Pe}}if(!y&&E.getType()!==p.ScalarType.String&&Math.floor(L.width)>A){if(k.getNumberFormat()==="General"&&E.getType()===p.ScalarType.Number){const he=k.measureText("0"),be=Math.floor(A/he.width),ve=S,we=Ue.splitNumber(ve),qe=Math.min(10,be-(Math.max(1,we.ipLength)+1)-(ve<0?1:0));if(qe>=-1){const Be=`0${qe>0?".":""}${"#".repeat(Math.max(0,qe))}`;V=E.getNumberFormat(Be).displayText,V==="0"&&ve<0&&(V="-0")}else if(Math.abs(ve)>=Math.pow(10,5)||Math.abs(ve)<=Math.pow(10,-5)){const Be=be-5-(ve<0?1:0);if(Be>=0){const ze=`0.${"0".repeat(Math.max(0,Be-1))}E+00`;V=E.getNumberFormat(ze).displayText}}}V||(y="#")}if(!y&&H?.lastRepeatIndex>=0&&H?.width>A&&(y="#"),y&&A>0){const he=k.measureText(y),be=Math.floor((A||1)/(he?.width||1));V=be>0?y.repeat(be):""}if(z&&(oe=p.ITextFrame.HorizontalAlignment.Left),V){const he=k.measureText(V).width;he&&(L={...L,width:he})}if(se={...L,width:L.width+De+Pe,height:L.height},Ce&&!Ie){const he=p.GeomUtils.boundsToPoints(se),be=p.GeomUtils.rotatePoints(he,Ce),ve=p.GeomUtils.minBoundingRect(be);se.width=ve.width,se.height=ve.height}oe===p.ITextFrame.HorizontalAlignment.Center||oe===p.ITextFrame.HorizontalAlignment.CenterContinuous?se.x=(B-se.width)/2:oe===p.ITextFrame.HorizontalAlignment.Right?se.x=B-se.width-.5:se.x=.5,fe.getVertical()===p.ITextFrame.VerticalAlignment.Center?se.y=(v-se.height)/2:fe.getVertical()===p.ITextFrame.VerticalAlignment.Bottom?se.y=v-se.height-ye:se.y=ye;const Y=Ke?{...D}:void 0,ie={style:{left:i.left-1,top:i.top-1,width:i.width+1,height:i.height+1,transform:Ce?`rotate(${Ce}deg)`:void 0,cursor:b?"pointer":void 0,pointerEvents:b?"auto":void 0,zIndex:ee?1:void 0,...K},onMouseDown:b,onDoubleClick:b?he=>{he.stopPropagation(),he.preventDefault()}:null,...Y};O&&(ie.style.textDecorationStyle="wavy",ie.style.textDecorationColor=N?"rgb(0, 255, 255)":"red",ie.style.textDecorationLine="underline");const de=xe.getSize(),ce=(he,be,ve,we,qe,Be,ze,Ze=null)=>{let He=de*a,Ye=ve,je=ze?.runs?ze.runs:[{type:p.NumberFormat.ParseRunType.Text,text:he,width:k.measureText(he,He).width}];ze&&ze?.width!==L.width&&(L={...L,width:ze?.width});let et=De;if(ze?.lastRepeatIndex>=0&&A>ze?.width){const Xe=ze.runs[ze.lastRepeatIndex];if(Xe){const at=[...je],Tt=Math.max(0,A-1-ze.width);let _t=0,Mt="";if(Tt>0){const yt=Math.floor(Tt/Xe.width);Mt=yt>0?Xe.text.repeat(yt):"",_t=Tt}at[ze.lastRepeatIndex]={type:p.NumberFormat.ParseRunType.Repeat,text:Mt,width:_t},je=at,L={...L,width:ze.width+_t}}}const ht=(Xe,at,Tt,_t,Mt,yt,dt,Bt,on,Rn=null)=>{let Kt,En=Ye.width;qe===p.ITextFrame.HorizontalAlignment.Justify?(En=Mt,Be||(Kt="justify")):qe===p.ITextFrame.HorizontalAlignment.Distributed&&(En=Mt,Kt=Be||Xe.text.split(" ").length-1==0?"center":"justify");const{style:Nt,className:Qn,...eo}=Rn;let rn=Xe.text;if(qe===p.ITextFrame.HorizontalAlignment.Fill&&R?.repeatChars.length===0){const gt=Math.max(1,Math.floor((Ye?.width??0)/(dt?.width??1)));rn=rn.repeat(gt)}let jt=Ye.height;const Zt=xe.getVerticalAlignment(),Tn=Zt===p.IFont.VerticalAlignment.Sub,Oo=Zt===p.IFont.VerticalAlignment.Super;if(Tn||Oo){const gt=xe.getSuperSubScale();He*=gt,jt*=gt}const lt={textAlign:Kt,textAlignLast:Kt,background:void 0,...Nt,...xe.toCSS(N,a,!0),fontSize:He*p.IFont.getDeviceScale()};ge&&(lt.color=ge.toCSS(N));const Mn=et+at;let ln=Ae.top+Ye.y+0;if(Tn&&(ln+=on-He),yt){const gt=(dt.x+Mn)*a+1,bt=(dt.y+ln)*a+1;bt<0?lt.marginTop=bt:lt.paddingTop=bt,gt<0?(lt.width=(Nt?.width??0)-gt,lt.left=(Nt?.left??0)+gt):lt.paddingLeft=gt,lt.paddingRight=Math.max(0,(Nt?.width??0)-En*a-gt),lt.paddingBottom=Math.max(0,(Nt?.height??0)-Ye.height*a-bt),lt.height=(Nt?.height??0)+(bt<0?-bt:0),(bt<0||gt<0)&&(lt.clipPath=`inset(${bt<0?-bt:0}px 0px 0px ${gt<0?1-gt:0}px)`)}else if(lt.left=(dt.x+Mn)*a+1,lt.top=(dt.y+ln)*a+1,lt.width=dt.width*a,lt.height=dt.height*a,Ce&&!Ie){lt.left=(dt.x+at)*a+1,lt.top=(dt.y+(Ye.y+0))*a+1;const gt=p.GeomUtils.centerPoint({x:et+at,y:0,width:Xe.width,height:Ye.height}),bt=p.GeomUtils.centerPoint({x:et,y:0,width:Mt,height:Ye.height}),kn=p.GeomUtils.rotatePoints([gt],Ce,bt),no={x:kn[0].x-gt.x,y:kn[0].y-gt.y};lt.left=lt.left+no.x*a,lt.top=lt.top+no.y*a;const sn={...Ye,x:et,y:Ae.top,width:Ye.width+(De+Pe)},jo=p.GeomUtils.boundsToPoints(sn),_n=p.GeomUtils.rotatePoints(jo,Ce),oo=p.GeomUtils.minBoundingRect(_n);sn.width=oo.width,sn.height=oo.height;const an=p.GeomUtils.centerPoint(sn),ro={x:an.x-bt.x,y:an.y-bt.y};lt.left=lt.left+ro.x*a,lt.top=lt.top+ro.y*a}lt.lineHeight=jt*a+"px";const to=Ke?void 0:"text-line";J.push(g.jsx("div",{className:Qn?`${Qn} ${to}`:to,style:lt,...eo,children:rn},`text-${Ye.y}-${_t}-${Tt}`))};if(fe.getOverflow()===p.ITextFrame.Overflow.Shrink&&A>0){let Xe=L?.width??0,at=0;for(;Xe>1&&Xe>A&&He>2&&at<100;)He*=A/Xe,Xe=k.measureText(he,He).width,at++;L={...L,width:Xe}}let Et=Ye.x;qe===p.ITextFrame.HorizontalAlignment.Right?Et+=L.width-Ye.width:qe!==p.ITextFrame.HorizontalAlignment.Center&&qe!==p.ITextFrame.HorizontalAlignment.CenterContinuous||(Et+=(L.width-Ye.width)/2),ze?.lastRepeatIndex>=0&&(Et=Ye.x);const Dt=je.length;for(let Xe=0;Xe<Dt;Xe++){const at=je[Xe];(at.type===p.NumberFormat.ParseRunType.Text||at.type===p.NumberFormat.ParseRunType.Repeat)&&(at.type,p.NumberFormat.ParseRunType.Repeat,ht(at,Et,Xe,be,qe===p.ITextFrame.HorizontalAlignment.Justify||qe===p.ITextFrame.HorizontalAlignment.Distributed||ze?.lastRepeatIndex>=0?A:Ye.width,Ke,{x:se.x+Z,y:se.y,width:at.width,height:L.height},0,we,Ze)),Et+=at.width}};V?ce(V,0,{x:0,y:0,...L},W.lines[0].baseline,oe,!0,null,ie):W.visitLines({visitTextLine:(he,be,ve)=>{const we=he.runs[0].text.replace(/\s+$/,""),qe=be===ve-1;let Be=oe===p.ITextFrame.HorizontalAlignment.Justify&&(qe||he.runs[0].text.endsWith(`
|
|
15
|
-
`))?p.ITextFrame.HorizontalAlignment.Left:oe,ze=0;be>0&&(fe.getVertical()===p.ITextFrame.VerticalAlignment.Distributed||fe.getVertical()===p.ITextFrame.VerticalAlignment.Justify)&&(ze=Math.max(0,(v-(ye+3)-he.bounds.height*ve)/(ve-1)*be)),fe.getVertical()===p.ITextFrame.VerticalAlignment.Distributed&&Ce&&Ce%90==0&&Ce%180!=0&&(Be=p.ITextFrame.HorizontalAlignment.Distributed),Be!==p.ITextFrame.HorizontalAlignment.Justify&&Be!==p.ITextFrame.HorizontalAlignment.Distributed&&Be!==p.ITextFrame.HorizontalAlignment.Fill||(L={...L,width:A});const Ze={...he.bounds,y:he.bounds.y+ze+0,width:Se||R&&(R.repeatChars.length>0||R.spacingChars.length>0)?L.width:he.bounds.width};ce(we,be,Ze,_.lines[0].baseline,Be,qe,ve===1?H:null,Ke&&be>0?{...ie,style:{...ie.style,background:void 0}}:ie)}})}J.length>0&&(te=J)}if(Ke)return te&&te.length>0?te:g.jsx("div",{style:_e,...D});let Ve=b?"auto":$e.pointerEvents,Me=null;if(We){const Ie={x:M*a-1,y:-1,width:P*a+1,height:v*a+1};Ve="auto",Me=$({renderBounds:Ie,darkMode:N,className:"filter-button",disabled:!E.isEditAllowed(),zoom:a,filter:E.getColumnFilter(),onFilterButtonMouseDown:q,...I}),Me&&(Me=g.jsx("div",{style:{...Ie,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:L=>{L.stopPropagation(),L.preventDefault()},children:Me},"filterButton"))}ue&&!te&&(te=g.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const Le=[Te,te,r,ae,nt,Me];return g.jsx("div",{style:{...K,...$e,pointerEvents:Ve},...D,children:Le})},Ti={text:"",placeholder:""},Mi=(t,e)=>{if(!t.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=e??t.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},Wa=Object.freeze([St.Delete,St.Home,St.End]),Ul=l.memo(l.forwardRef((t,e)=>{const{editState:n,onStartEdit:o,onChangeEdit:r,onSubmitEdit:i,onCancelEdit:s,onDoneEdit:a,defaultTextStyle:d,useRichStyling:c=!0,bodyStyle:f,activeCoords:h,sheet:u,commands:w,containerBounds:b,setNaturalDimensions:q,onFocus:I,disabled:$,style:D,zoom:v=1,linesVisible:F,autoFocus:E=!1,...S}=t,{height:k=0,width:N=0}=b??{},R=f?.darkMode??!1,T=l.useRef(null),[G,O]=l.useState(!1),[j,z]=l.useState(null),[B,Z]=l.useState(()=>n);l.useEffect(()=>{Re.current=!1,Z(n)},[n]);const P=l.useMemo(()=>{const L=B.clean();let se=L.getStyle();c||(se=se.createTemporaryStyle({font:{size:d?.fontSize}}));const U=L.getFormula(),J=se.getAlignment(),m=U?p.ITextFrame.HorizontalAlignment.Left:J.getHorizontal(),_=J.getVertical(),A=J.getOverflow()===p.ITextFrame.Overflow.Wrap||L.getType()===p.ScalarType.String&&(m===p.ITextFrame.HorizontalAlignment.Justify||m===p.ITextFrame.HorizontalAlignment.Distributed||_===p.ITextFrame.VerticalAlignment.Justify||_===p.ITextFrame.VerticalAlignment.Distributed),x=(W=>{if(!W)return Ti;const Y=W.clean();if(!Y)return Ti;let ie=Y.getStyle()?.getQuotePrefix();if(W.dirty===void 0||W.dirty===null){let de="",ce=Y.getFormulaText();ce&&(de=ce,ie=!1),de||(de=Y.toTextUnformatted(!0)??"");let he="";if(!W.editMode&&Y.isSpillOverflow()){const be=Y.getSpill();if(be){const ve=be.getCell(),we=ve.getFormulaText();ve.isEqual(Y)||(he=we)}}return ie&&(de="'"+de),{text:de,placeholder:he}}return{text:W.dirty??"",placeholder:""}})(B),V=x.text,y=p.ITextFrame.toCSSHorizontalTextAlign(c&&!U?B.clean()?.getRenderHorizontalAlignment():p.ITextFrame.HorizontalAlignment.Left);return{style:se,isWrapped:A,textValue:V,formula:U,frameVertAlign:_,placeholder:x.placeholder,insets:c?L.getInsets():Vn.EmptyRect,textAlign:y}},[B,d,R,v,c]),M=l.useRef(null),H=Ft(e,()=>({startEdit:L=>{T.current=L?.initialSelection;const se={...n,editMode:L?.editMode??!1};L?.text!==void 0&&(se.dirty=L.text),se.editMode===n.editMode&&se.dirty===n.dirty||(Z(se),te?.(se))},submitEdit:()=>Te(),cancelEdit(){ae()},autoFocus(){M.current.focus()},dispatchEvent:L=>M.current.dispatchEvent(L),focus(){M.current.focus()},getLineHeight:ue}),[o,n]);l.useLayoutEffect(()=>{if(!j||!G)return;const L=M.current;P.textValue,L&&L.setSelectionRange(j.start,j.end,j.direction)},[M.current,j,P.textValue]);const oe=l.useMemo(()=>{const L=B?.clean(),se=P.style.createTemporaryTextFrame(P.textValue,L?.getType()===p.ScalarType.String),U=c?L.getInsets().right+L.getInsets().left:0;let J=null;return P.isWrapped&&(J={width:N-U}),se.layout(J)},[P,N,B,c]),ue=X(()=>Math.ceil(oe?.lines[0]?.bounds.height),[oe]);l.useLayoutEffect(()=>{if(!oe)return;const L=P.style,se=L.getInsets()??Vn.EmptyRect,U=c?se.left+se.right:0,J=c?.04*L.getFont().getSize():1,m=Math.round(P.isWrapped?void 0:oe.bounds.width+U+J),_=Math.round(oe.bounds.height);q?.({width:m,height:_})},[oe,q,P,c,B]);const te=X(r,[r]),K=X(L=>{if(B.dirty===L)return;const se={...B};se.dirty=L,M.current,Z(se),te?.(se)},[B]),le=X(L=>{if(B.editMode===L)return;const se={...B};se.editMode=L,Z(se),te?.(se)},[B]),Re=l.useRef(!1),Te=X(()=>{if(Re.current)return!1;try{i?.(B),a?.(),Re.current=!0}catch{return!1}return!0},[i,B]),ae=X(()=>{Re.current=!0,Z(n),s?.(),a?.()},[s,n]),Fe=X(L=>{if(!M.current)return;if(L.key,L.isDefaultPrevented(),!(L.isTrusted||L.nativeEvent.ctrlKey||L.nativeEvent.metaKey||L.nativeEvent.altKey||L.nativeEvent.isComposing||ft.STANDARD_KEY_CHARS.indexOf(L.nativeEvent.key)===-1&&L.nativeEvent.key!=="Backspace")){const x={...B};let V=0;return Mi(x,x.dirty)&&!isNaN(parseFloat(L.key))?(x.dirty?.endsWith("%")?x.dirty=(x.dirty.substring(0,x.dirty.length-1)??"")+L.key+"%":x.dirty=(x.dirty??"")+L.key+"%",V=x.dirty.length-1):L.nativeEvent.key==="Backspace"?(x.dirty="",V=x.dirty.length):(x.dirty=(x.dirty??"")+L.key,V=x.dirty.length),M.current.value=x?.dirty,T.current={start:V,end:V,direction:"forward"},M.current?.setSelectionRange(V,V,"forward"),Z(x),te?.(x),void L.preventDefault()}const se=L.nativeEvent.ctrlKey,U=L.nativeEvent.shiftKey,J=L.nativeEvent.altKey,m=L.nativeEvent.metaKey;if(se&&L.key==="z"&&L.stopPropagation(),L.which===St.Escape)return L.preventDefault(),void ae();if(L.which===St.F2)return le(!0),void L.preventDefault();const _=L.target;if(L.key==="%"&&_.selectionStart===_.selectionEnd&&_.value[_.selectionStart]==="%"&&B?.clean().getStyle().numberFormat.includes("%"))return z({start:_.selectionStart+1,end:_.selectionEnd+1,direction:_.selectionDirection}),void L.preventDefault();if(L.which===St.Enter){if(L.preventDefault(),m||J){const x=P.textValue.substring(0,_.selectionStart)+`
|
|
16
|
-
`+P.textValue.substring(_.selectionEnd);return K(x),void z({start:_.selectionStart+1,end:_.selectionStart+1,direction:_.selectionDirection})}return void(Te()&&u.getSelection().traverse(p.IRange.Orientation.Column,U))}if(L.which===St.Tab)return L.preventDefault(),void(Te()&&u.getSelection().traverse(p.IRange.Orientation.Row,U));let A=null;switch(L.which){case St.Left:A=p.IRange.Direction.Left;break;case St.Right:A=p.IRange.Direction.Right;break;case St.Up:A=p.IRange.Direction.Up;break;case St.Down:A=p.IRange.Direction.Down}if(A&&!(se||U||J||m)&&!B.editMode)return void Te();B.editMode&&(A||Wa.includes(L.which))&&L.stopPropagation()},[B,u,P]),me=l.useCallback(()=>{M.current?.focus(),setTimeout(()=>{M.current?.select()},0)},[]),Oe=l.useCallback(()=>{M.current?.focus(),console.log("implement toggleRelativeReferences")},[]),xe=X(()=>{const L=M.current?.value;let se="";if(h.rowIndex>0){const U=u.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();U&&(se=U.toTextUnformatted(!0))}K(L+se)},[h,u]);l.useEffect(()=>u.getRange(h).addListener(()=>{const L={...B,clean:()=>u.getRange(h).getCell()};Z(L),te?.(L)}),[h,u]);const ge=l.useCallback(()=>{const L=B.clean().createTemporaryCell({value:Wn(),style:{numberFormat:"Medium Time"}}).toText();K((M.current?.value??"")+L)},[u]),fe=l.useCallback(()=>{const L=B.clean().createTemporaryCell({value:Wn(),style:{numberFormat:"Short Date"}}).toText();K((M.current?.value??"")+L)},[u]),Se=l.useMemo(()=>({element:()=>M.current,doCopy:L=>{const se=M.current.value.substring(M.current.selectionStart,M.current.selectionEnd);if(L?.isCut){const U=M.current.value.substring(0,M.current.selectionStart)+M.current.value.substring(M.current.selectionEnd,M.current.value.length);K(U)}return se}}),[M.current]),pe=l.useMemo(()=>({element:()=>M.current,doPaste:async(L,se)=>{const U=await L.toText?.();if(!U)return!0;const J=M.current.value.substring(0,M.current.selectionStart)+U+M.current.value.substring(M.current.selectionEnd,M.current.value.length);return K(J),z({start:M.current.selectionStart+U.length,end:M.current.selectionStart+U.length,direction:"forward"}),!0}}),[M.current]),Ce=l.useMemo(()=>({contains:L=>M.current?.contains(L)||!1,focus(){M.current.focus()}}),[]),Ae=l.useMemo(()=>[new Ne("selectAll",Ce,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[Q.Ctrl]}},me),new Ne("startEditValueAbove",Ce,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[Q.Ctrl]},{key:'"',modifiers:[Q.Ctrl,Q.Shift]}]},xe),new Ne("startEditCurrentTime",Ce,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[Q.Ctrl,Q.Shift]}},ge),new Ne("startEditCurrentDate",Ce,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[Q.Ctrl]}},fe),new ne("relativeReferencesToggle",Ce,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Oe),new ne("toggleEditorFocus",Ce,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[Q.Ctrl]}})],[]),ye=l.useMemo(()=>{let L=null;const se=()=>({contains:U=>M.current?.contains(U)||!1,focus(){M.current.focus()}});return L=w?w.createChildGroup(se,"editor",!1):new nn(se,"editor"),L.addCommands(Ae,!0),L},[w,Ae]),De=l.useMemo(()=>({notifier:null,source:Se,target:pe,commands:ye}),[Se,pe,ye]);jr(De);const[Pe,$e]=l.useState(!E);l.useEffect(()=>{$e(!1)},[]);const C=X(L=>{O(!0),ye?.activate();const se=T.current;if(se!==!1){let U,J;const m=M.current.value;Mi(B,m)&&(U=m.length-1,J=m.length-1),U=se?.start??U??m.length,J=se?.end??J??m.length,T.current=!1,z({start:U,end:J,direction:"forward"})}I?.(L)},[I,B]),We=P.insets;let nt=We.left+1;const Ke=We.left+We.right+2-1,ee=oe?.bounds.height??0;let _e,Ve=We.top;P.frameVertAlign===p.ITextFrame.VerticalAlignment.Center?Ve=Math.max(0,(k-(We.top+We.bottom)-ee)/2):P.frameVertAlign===p.ITextFrame.VerticalAlignment.Bottom&&(Ve=Math.max(0,k-(We.top+We.bottom)-ee)),F!==void 0&&oe?.lines[0]?.bounds&&(_e=oe?.lines[0]?.bounds.height*F);const Me=P.style.getFont();let Le=Me.getSize();Me.isSuperSub()&&(Le*=Me.getSuperSubScale()),Le*=p.IFont.getDeviceScale()*v;const Ie=c?Me.toCSS(R,v):null;return g.jsx("div",{className:"sheet-cell-editor",onMouseDown:L=>{M.current&&document.activeElement!==M.current&&requestAnimationFrame(()=>{M.current.focus()})},ref:H,...S,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...D},children:g.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Ve*v+1,left:nt*v,width:`calc(100% - ${Ke*v}px)`,maxWidth:`calc(100% - ${Ke*v}px)`,height:(_e??ee)*v,maxHeight:(_e??ee)*v},children:g.jsx("textarea",{spellCheck:"false",placeholder:P.placeholder,ref:M,value:P.textValue,disabled:Pe,readOnly:$||u.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ie,fontSize:Le?`${Le}px`:"inherit",textAlign:P.textAlign,lineHeight:(oe?.lines[0]?.bounds.height??0)*v+"px",height:(oe?.bounds.height??0)*v,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:P.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:C,onBlur:()=>{O(!1)},onSelect:L=>{},onChange:L=>{M.current&&!Re.current&&(T.current=!1,K(L.target.value),P.textValue,L.target.value,L.target.selectionStart,L.target.selectionEnd,L.target.selectionDirection,z({start:L.target.selectionStart,end:L.target.selectionEnd,direction:L.target.selectionDirection}))},onMouseDown:L=>{G&&le(!0)},onKeyDown:Fe})})})})),Wl=(t,e)=>({clean:t,dirty:e,editMode:!1}),Gl=t=>{const{length:e=0,width:n=1,dashArray:o=null,dashArrayAdditional:r=null,isDouble:i=!1,isAngled:s=!1,offsetX:a=0,offsetY:d=0,isVertical:c=!1,...f}=t,h=D=>{let v=null;if(D&&n>0){v="";for(let F=0;F<D.length;F++)v+=D[F],F<D.length-1&&(v+=",")}return v},u=h(o);let w=u;r&&(w=h(r));let b=n,q=e,I=null;if(i){b=Math.floor(n/2);const D=b+b/2+1;let v=null;v=c?`M ${Qe.boundPixel(a+D)} ${Qe.boundPixel(d)} L ${Qe.boundPixel(a+D)} ${Qe.boundPixel(d+q)}`:`M ${Qe.boundPixel(a)} ${Qe.boundPixel(d+D)} L ${Qe.boundPixel(a+q)} ${Qe.boundPixel(d+D)}`,I=g.jsx("path",{strokeWidth:b,strokeDasharray:w,d:v,...f})}if(s){b=n/2;const D=b+b/2;let v=w,F=null;F=c?`M ${Qe.boundPixel(a+D)} ${Qe.boundPixel(d)} L ${Qe.boundPixel(a+D)} ${Qe.boundPixel(d+q)}`:`M ${Qe.boundPixel(a)} ${Qe.boundPixel(d+D)} L ${Qe.boundPixel(a+q)} ${Qe.boundPixel(d+D)}`,I=g.jsx("path",{strokeWidth:b,strokeDasharray:v,strokeDashoffset:"1",shapeRendering:"crispEdges",d:F,...f})}let $=null;return $=c?`M ${Qe.boundPixel(a+b/2)} ${Qe.boundPixel(d)} L ${Qe.boundPixel(a+b/2)} ${Qe.boundPixel(d+q)}`:`M ${Qe.boundPixel(a)} ${Qe.boundPixel(d+b/2)} L ${Qe.boundPixel(a+q)} ${Qe.boundPixel(d+b/2)}`,g.jsxs(g.Fragment,{children:[g.jsx("path",{strokeWidth:b,strokeDasharray:u,d:$,...f}),I]})};function or(t,e){if(typeof t=="function")return t(e);t&&(t.current=e)}var Cn=parseInt(l.version.split(".")[0],10)>=19?function(t){return e=>{const n=[];for(const o of t){const r=or(o,e),i=typeof r=="function";n.push(i?r:()=>or(o,null))}return()=>{for(const o of n)o()}}}:function(t){return e=>{for(const n of t)or(n,e)}},Ga=function(){},Kl=typeof window<"u",On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ka=Kl?l.useLayoutEffect:l.useEffect,ki={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const en=Kl&&window.ResizeObserver!==void 0?function(){var t=l.useState(null),e=t[0],n=t[1],o=l.useState(ki),r=o[0],i=o[1],s=l.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var d=a[0].contentRect,c=d.x,f=d.y,h=d.width,u=d.height,w=d.top,b=d.left,q=d.bottom,I=d.right;i({x:c,y:f,width:h,height:u,top:w,left:b,bottom:q,right:I})}})},[]);return Ka(function(){if(e)return s.observe(e),function(){s.disconnect()}},[e]),[n,r]}:function(){return[Ga,ki]},Za=(t,e)=>t.colStart===e.colStart?t.rowStart-e.rowStart:t.colStart-e.colStart,Ya=(t,e)=>t.rowStart===e.rowStart?t.colStart-e.colStart:t.rowStart-e.rowStart,Xa=t=>{const{key:e,points:n,range:o,stroke:r,darkMode:i,forceThinBorder:s=!1,shiftIfWide:a=!1,isVertical:d=!1,intersections:c,layout:f}=t,h=p.IBorder.BuiltInDefinitions.get(s?p.IBorder.StrokeStyle.Thin:r.getStyle());if(!h)return null;const u=n[0],w=n[1],b=n[2],q=n[3];let I=1+(d?q-w:b-u),$=0;const D=r.getColor().toRGBA(i).toString(),v=h.description.toLowerCase().includes("double");let F,E;const S=d?"rowStart":"colStart",k=d?"rowEnd":"colEnd",N=d?w:u;if(c?.length>0){const O=c[0];if(O?.range[S]===o[S]){const z=p.IBorder.BuiltInDefinitions.get(O.stroke.getStyle());$=Math.floor(z.width/2)}if(c[c.length-1]?.range[k]===o[k]){const z=p.IBorder.BuiltInDefinitions.get(c[c.length-1].stroke.getStyle());I=Math.floor(I+(z.width===2?0:z.width/2))}if(v){const z=d?"colStart":"rowStart",B=d?"colEnd":"rowEnd",Z=d?f?.getRowOffset:f?.getColOffset;let P=0,M=0;F=[],E=[];for(let H=0;H<c.length;H++){const oe=c[H];if(oe.stroke.getStyle()===p.IBorder.StrokeStyle.Double&&Z){const ue=Z(oe.range[S])-(N-$);oe.range[z]<o[z]&&(F.push(ue-P),P=ue,F.push(1),P++),oe.range[B]>o[B]&&(E.push(ue-M),M=ue,E.push(1),M++)}}F.length>0&&P<I&&F.push(I-P),E.length>0&&M<I&&E.push(I-M)}}let R=d?-Math.floor(h.width/2):-$,T=d?-$:-Math.floor(h.width/2);const G=a&&h.width>2?-1:0;return g.jsx(Gl,{offsetX:u+R+G,offsetY:w+T+G,length:I+$,isVertical:d,stroke:D,width:h.width,dashArray:F??h.pattern,dashArrayAdditional:E,isDouble:v,isAngled:h.description.toLowerCase().includes("slant")},e)},Nr=({getBorderAt:t,borderRenderer:e=Xa,getVisibleCells:n,darkMode:o,forceThinBorder:r=!1,defaultColor:i="black",shiftIfWide:s=!1})=>{const a=X(n,[n]);return{overlay:l.useMemo(()=>c=>{const f=c.toClipBounds(c.getRangeCoordsBounds(),-3);if(!f)return;const h=a(c);if(h.length===0)return;const u=c.getVisibleColumnOffsets(),w=c.getVisibleRowOffsets();let b=[],q=[];const I=c.getVisibleColumns(),$=c.getVisibleRows(),D=[],v=[],F=[],E=(R,T,G,O,j,z,B)=>{const Z={index:O,stroke:j,visibleIndex:G,edge:z,length:B};R[T]||(R[T]=[]),R[T].length>0&&R[T][R[T].length-1]?.index===O?R[T][R[T].length-1]=Z:R[T].push(Z)};for(let R=0;R<h.length;R++){const T=h[R],G=T.coords;if(!G)continue;const O=T?.range??{rowStart:G.rowIndex,colStart:G.colIndex,rowEnd:G.rowIndex,colEnd:G.colIndex},j=c.getVisibleRangeCoords();if(!ut.isRangesIntersect(O,j)&&!ut.isRangeWithinRange(O,j))continue;const z=G.colIndex,B=G.rowIndex,Z=u[z],P=w[B];if(O.rowEnd!==O.rowStart){const Fe=w[O.rowStart]?.spanIndex??-1,me=w[O.rowEnd]?.spanIndex??w[$[$.length-1]].spanIndex+1;b.push({...O,rowStart:Fe,rowEnd:me})}if(O.colEnd!==O.colStart){const Fe=u[O.colStart]?.spanIndex??-1,me=u[O.colEnd]?.spanIndex??u[I[I.length-1]].spanIndex+1;q.push({...O,colStart:Fe,colEnd:me})}const M=T.value,H=t(M,R);if(!H||H.isEmpty())continue;const oe=H.getLeft(),ue=H.getTop(),te=H.getRight(),K=H.getBottom();let le=1,Re=1;if(!Z||!P)continue;const Te=Z.spanIndex,ae=P.spanIndex;oe.isNone()||E(D,Te,ae,B,oe,p.IBorder.Edge.Left,le),ue.isNone()||E(v,ae,Te,z,ue,p.IBorder.Edge.Top,Re),te.isNone()||E(D,Te+Re,ae,B,te,p.IBorder.Edge.Right,le),K.isNone()||E(v,ae+le,Te,z,K,p.IBorder.Edge.Bottom,Re)}const S=(R,T,G)=>{const O=[];return R.forEach((j,z)=>{let B=null;j.sort((Z,P)=>Z.visibleIndex-P.visibleIndex);for(let Z=0;Z<j.length;Z++){const P=j[Z];if(!P?.stroke||T[z]===void 0&&T[z-1]===void 0)continue;let M=!1;if(G)for(let te=0;!M&&te<b.length;te++){let K=b[te];K.colStart<=P.index&&K.colEnd>=P.index&&K.rowStart<z&&K.rowEnd>=z&&(M=!0)}else for(let te=0;!M&&te<q.length;te++){let K=q[te];K.rowStart<=P.index&&K.rowEnd>=P.index&&K.colStart<z&&K.colEnd>=z&&(M=!0)}if(M)continue;const H=P.stroke?.getColor(),oe=H?H.toRGBA().toString():i,ue=P.stroke.getStyle()+":"+oe;(ue!==B?.key||B&&B.visibleIndex+1<P.visibleIndex)&&(B&&O.push(B),B={key:ue,index:T[z]??T[z-1]+1,visibleIndex:P.visibleIndex,edge:P.edge,stroke:P.stroke,from:P.index,to:P.index+P.length-1,intersections:[],length:1}),B.to=P.index+P.length-1,B.visibleIndex=P.visibleIndex}B&&O.push(B)}),O};b=b.sort(Ya),q=q.sort(Za);const k=S(D,I,!1),N=S(v,$,!0);if(k.length===0&&N.length===0)return null;for(let R=0;R<N.length;R++){const T=N[R];let G=Ue.findEqualOrGreater(k,T.from,j=>j.index),O=!1;for(;!O;){const j=k[G++];j&&j.index>=T.from&&j.index<=T.to+1&&j.from<=T.index&&j.to+1>=T.index&&(T.intersections.push({stroke:j.stroke,range:{rowStart:j.from,rowEnd:j.to+1,colStart:j.index,colEnd:j.index}}),j.intersections.push({stroke:T.stroke,range:{rowStart:T.index,rowEnd:T.index,colStart:T.from,colEnd:T.to+1}})),O=!j||j.index>T.to+1}}for(let R=0;R<N.length;R++){const T=N[R];let G=T.stroke;const O=`rBorder:${T.index}:${T.from}:${T.to}:${T.edge}`,j={rowStart:T.index,rowEnd:T.index,colStart:T.from,colEnd:T.to+1},z=c.getLayout(),B=!1,Z=z.getColOffset(j.colStart),P=z.getRowOffset(j.rowStart),M=[Z,P,z.getColOffset(j.colEnd),P];F.push(e({key:O,points:M,stroke:G,darkMode:o,forceThinBorder:r,shiftIfWide:s,range:j,intersections:T.intersections,layout:z,isVertical:B}))}for(let R=0;R<k.length;R++){const T=k[R];let G=T.stroke;const O=`cBorder:${T.index}:${T.from}:${T.to}:${T.edge}`,j={rowStart:T.from,rowEnd:T.to+1,colStart:T.index,colEnd:T.index},z=c.getLayout(),B=!0,Z=z.getColOffset(j.colStart),P=[Z,z.getRowOffset(j.rowStart),Z,z.getRowOffset(j.rowEnd)];F.push(e({key:O,stroke:G,points:P,darkMode:o,forceThinBorder:r,shiftIfWide:s,range:j,intersections:T.intersections,layout:z,isVertical:B}))}return g.jsx("svg",{width:`${f.width}`,height:`${f.height}`,viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${f.width}px`,height:`${f.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:F},"borders")},[t,o])}},_i=ct.Center,Ja=Object.freeze({horizontal:!1,vertical:!1}),Ii=Vn.EmptyTopLeft,Qa=(t,e)=>ut.EmptyCell,ec=(t,e)=>new Promise((n,o)=>{o("StaticBorderRenderer does not support scrolling")}),tc=l.memo(t=>{const{getBorderAt:e,width:n,height:o,style:r,rowCount:i=2,columnCount:s=2,darkMode:a,forceThinBorder:d,children:c,...f}=t,h=l.useRef(null),[u,{width:w,height:b}]=en(),q=n??w,I=o??b,$=l.useMemo(()=>{const B=[];for(let Z=0;Z<i;Z++)for(let P=0;P<s;P++){const M={colIndex:P,rowIndex:Z};B.push({coords:M,value:M})}return B},[]),D=l.useCallback(B=>$,[$]),{overlay:v}=Nr({getVisibleCells:D,getBorderAt:e,darkMode:a,forceThinBorder:d}),F=Math.floor(q/s),E=Math.floor(I/i),S={getColOffset:B=>Math.ceil(B*F)+0,getRowOffset:B=>Math.ceil(B*E)+0,getColIndex:B=>Math.floor((B-0)/F)-1,getRowIndex:B=>Math.floor((B-0)/E)-1},k={rowStart:0,colStart:0,rowEnd:i,colEnd:s},N={x:0,y:0,width:Math.max(0,q)+0,height:Math.max(0,I)+0},R=l.useMemo(()=>{const B={},Z=Math.floor(q/s);for(let P=0;P<s;P++)B[P]={offset:P*Z,size:Z,spanIndex:P};return B},[q,I]),T=l.useMemo(()=>{const B={},Z=Math.floor(I/i);for(let P=0;P<i;P++)B[P]={offset:P*Z,size:Z,spanIndex:P};return B},[q,I]);if(!v)return null;const G={width:q,height:I},O={width:q,height:I},j={getStage:()=>h.current,getTotalSize:()=>G,getViewportSize:()=>O,getLayout:()=>S,getCellCoordsAsRangeCoords:ut.cellToRange,getVisibleRangeCoords:()=>k,getVisibleRows:()=>{const B=[];for(let Z=0;Z<i;Z++)B.push(Z);return B},getTotalRangeCoords:()=>k,getRelativePointFromClient:(B,Z)=>({x:B,y:Z}),getVisibleColumns:()=>{const B=[];for(let Z=0;Z<s;Z++)B.push(Z);return B},toClipBounds:(B,Z)=>N,toViewBounds:B=>B,toAbsoluteBounds:B=>B,getBounds:()=>N,getInsets:()=>null,getRangeCoordsBounds:(B,Z)=>null,getVisibleColumnOffsets:()=>R,getVisibleRowOffsets:()=>T,allViews:()=>({[_i]:j}),getAnchor:()=>_i,getZoom:()=>1,scrollCellCoordsIntoView:ec,getCellCoordsFromClient:Qa,getScrollOrientation:()=>Ja,getScrollTopLeft:()=>Ii,getFreezeTopLeft:()=>Ii},z=v(j);return g.jsxs("div",{style:{...r,position:"relative",display:"flex"},...f,children:[g.jsx("div",{ref:Cn([h,u]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:c}),z]})});function Zl(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=Zl(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function kt(){for(var t,e,n=0,o="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=Zl(t))&&(o&&(o+=" "),o+=e);return o}const nc="_sheetxl-sheet_1qeq6_5",oc="_viewport-overlay_1qeq6_6",Yl=t=>{const{style:e,...n}=t??{};return g.jsxs("svg",{style:{width:"135px",height:"37px",...e},viewBox:"0 0 135 37",...n,children:[g.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),g.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),g.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),g.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),g.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},rc=l.memo(t=>{const{colorLicensee:e="blue",colorError:n="red",colorCredits:o="grey",credits:r="All rights reserved - Michael Ford",feature:i,style:s,...a}=t??{},[d,c]=l.useState(null);l.useEffect(()=>{(async()=>{const E=await p.LicenseManager.getDetails();c(E)})()},[]);const[f,h]=l.useState(!1),u={opacity:.65},w=l.useMemo(()=>{const E=d?.exceptions(),S=E?.length??0;if(S===0)return null;const k=[];for(let N=0;N<S;N++){const R=E[N];k.push(g.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:R},N))}return k},[d,n]);if(d===null||d.isValidFor(i))return null;const b=d.type(),q=!w&&b.endsWith("ity"),I=d.licensee(),$=q?1.6:1,D=135/$,v=37/$;let F=null;return!b&&I?.length>0&&(F=g.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:e},children:I})),g.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...s},...a,children:g.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[f?g.jsx(Yl,{style:u}):g.jsx("svg",{width:D,height:v,style:u,children:g.jsx("image",{style:{width:D,height:v},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),g.jsxs("div",{children:[F,w,g.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:o},children:r})]})]})})}),it=(t,e,n)=>{const o=l.useRef(e);o.current=e;const r=n?.fireOnModelChange??!0;l.useEffect(()=>{if(!t||!o.current)return;const i=Object.keys(o.current),s={},a=i.length;for(let c=0;c<a;c++){const f=i[c];s[f]=(h,u)=>{o.current[f]?.(h,u)}}const d=t.addListeners(s,n);if(r)for(let c=0;c<a;c++)s[i[c]](t);return()=>{d?.()}},[t])},ho=new p.Color("transparent");function Xl(t){const{sheet:e,onRepeatCommandChange:n,bodyStyle:o,commands:r,target:i,notifier:s,onStartEdit:a,getViewport:d}=t,[c,f]=l.useState(null),[h,u]=l.useState(null),w=l.useRef(null),b=X(a,[a]),q=X(d,[d]),[I,$]=l.useState(),[D,v]=l.useState(()=>e?.getStyles().parseColor(p.IColor.Scheme.Bg2)),[F,E]=l.useState(()=>e?.getStyles().getNormal().getFont().getFill()),S=Gt();l.useRef(S.getMode()).current=S.getMode();const k=Or(),[N,R]=l.useState(Ue.EmptyArray),T=l.useCallback(()=>{if(w.current!==e)return;const m=e.getSelectedRanges();let _=null;N.length>0&&ut.isCellWithinRange(c,N[0].getRange().getCoords())&&(_=N[0]);const A=e?.getSelectedCell(),x=A?.getCoords()??null;Wt.unstable_batchedUpdates(()=>{oe(_),f(x),u(m)})},[e,N,h,c]),G=l.useCallback(Ue.debounce(T,210),[T]);l.useEffect(()=>{w.current=e,T()},[e]);const O=X(()=>e.getRange(c).getCell(),[e,c]),j=X(async(m,_,A=null,x=!1,V=!0)=>{const y=m?.label?.(),W=async()=>{const ce=await Promise.resolve(V&&s?.showBusy?.(y??"Busy..."));try{await e.doBatch(async()=>_(e),y),x&&S.setMode(null),ce&&ce()}catch(he){if(ce&&ce(),!he)return;s?.showError?.(he)}},Y=[];let ie=!1;const de=async()=>(Y.push(W),(async()=>{if(!ie){for(ie=!0;Y.length>0;){const ce=Y.shift();ce&&await ce()}ie=!1}})());if(n){let ce=null;if(A!==!1&&m){const he=A??y;ce=new Ne(m.key(),i,{label:he,description:he},de)}n(ce)}return de()},[e,n,s]),z=X((m,_,A=!1,x)=>j(m,V=>{const y=V.getSelectedRanges();A&&y.updateStyle(null,x),y.updateStyle(_,x),y.autoFit({expandOnly:p.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[e]),B=X((m,_,A)=>{j(m,x=>{let V=_;(A||_?.address)&&(V=V??{},!A&&_?.address?.startsWith("#")?A=_?.address.substring(1):A&&(V.displayText=A)),x.getSelectedRange().setHyperlink(V)})},[e]),Z=X((m,_)=>{j(m,A=>{A.getSelectedRange().setComments(_)})},[e]),P=X((m,_)=>{j(m,A=>{A.getSelectedRanges().clear(_)})},[e]),M=X(async(m,_,A=!1,x=!1)=>j(m,async V=>{let y=V.getSelectedRanges();A&&(_===p.IRange.Orientation.Row?y=y.getEntireRows(x):_===p.IRange.Orientation.Column&&(y=y.getEntireColumns(x)));let W=null;const Y=S.getMode()?.key;if(Y==="copy"||Y==="cut"){const ie=await k.getClipboard().readReference();ie&&ie.getItemType()==="range"&&(W=ie.getItem(),W.getCoords()||(W=null))}if(W){const ie=await y.insertFrom(W,{...W.getMarkOptions(),orientation:_,autoSelect:!0});!ie||ie.isEntireRows()||ie.isEntireColumns()||ie.autoFit({orientations:p.IRange.Orientations.Row,minContent:!0}),S.setMode(null)}else y.insert(_,{autoSelect:!0})},"Insert Cells",!1),[S]),[H,oe]=l.useState(null),ue=X(m=>e.getStyles().setDefaultTableStyle(m),[e]),te=X(m=>{e.getStyles().getTableStyle(m)?.delete()},[e]),K=X((m,_)=>{j(m,async A=>{const x=A.getSelectedRange(),V=A.getSelectedCell().getCoords();let y=null,W=0;const Y=V.rowIndex>0?A.getRange({rowIndex:V.rowIndex,colIndex:V.colIndex}).getExtended(p.IRange.Direction.Up):null;Y&&A.getRange({colStart:V.colIndex,rowStart:Y.getCoords().rowStart,colEnd:V.colIndex,rowEnd:Y.getCoords().rowStart}).isContentful()&&(y=p.IRange.Direction.Up,W=V.rowIndex-Y.getCoords().rowEnd);const ie=V.colIndex>0?A.getRange({rowIndex:V.rowIndex,colIndex:V.colIndex-1}).getExtended(p.IRange.Direction.Left):null;if(ie&&A.getRange({colStart:ie.getCoords().colStart,rowStart:V.rowIndex,colEnd:ie.getCoords().colStart,rowEnd:V.rowIndex}).isContentful()){const ce=V.colIndex-ie.getCoords().colEnd;(ce<W||!y)&&(y=p.IRange.Direction.Left,W=ce)}let de=null;if(y===p.IRange.Direction.Up){if(de={...Y.getCoords()},(de.rowEnd===V.rowIndex||!A.getRange({colIndex:V.colIndex,rowIndex:V.rowIndex-1}).isContentful())&&de.rowStart>0&&A.getRange({colIndex:V.colIndex,rowIndex:de.rowStart-1}).isContentful()){const ce=Y.getExtended(p.IRange.Direction.Up);de={colStart:V.colIndex,rowStart:ce.getCoords().rowStart,colEnd:V.colIndex,rowEnd:Y.getCoords().rowEnd}}de.rowEnd=V.rowIndex-1}else if(y===p.IRange.Direction.Left){if(de={...ie.getCoords()},(de.colEnd===V.colIndex||!A.getRange({colIndex:V.colIndex-1,rowIndex:V.rowIndex}).isContentful())&&de.colStart>0&&A.getRange({colIndex:de.colStart-1,rowIndex:V.rowIndex}).isContentful()){const ce=ie.getExtended(p.IRange.Direction.Left);de={colStart:ce.getCoords().colStart,rowStart:V.rowIndex,colEnd:ce.getCoords().colEnd,rowEnd:V.rowIndex}}de.colEnd=V.colIndex-1}if(x.size!==1&&y){const ce=x.getCoords(),he=x.startIncrementalUpdates({orientation:p.IRange.Orientation.Column}),be={...de},ve=ce.rowStart,we=ce.rowEnd,qe=ce.colStart,Be=ce.colEnd,ze=y===p.IRange.Direction.Up;for(let Ze=qe;Ze<=Be;Ze++){be.colStart=ze?Ze:de.colStart+(Ze-qe),be.colEnd=ze?Ze:de.colEnd+(Ze-qe);for(let He=ve;He<=we;He++){be.rowStart=ze?de.rowStart+(He-ve):He,be.rowEnd=ze?de.rowEnd+(He-ve):He;const Ye=A.getRange(be).toString();he.pushAt(He,Ze,`=${_}(${Ye})`)}}he.apply()}else{const ce=de?A.getRange(de).toString():"",he=`=${_}(`;b?.({text:`${he}${ce})`,editMode:!0,initialSelection:{start:he.length,end:he.length+ce.length}})}},!1)},[e]),le=X((m,_,A=!1,x=!0)=>{j(m,async V=>{let y=null;if(H)return void H.updateStyleOptions(_);{const ie=V.getSelectedRanges().getFixed(!0),de=V.getSelectedRange().getDefaultSortCriteria();let ce={ranges:ie,hasHeader:de?.options?.hasHeader??!1};y=x?new Promise((he,be)=>{const ve={tableOptions:ce,onCancel:()=>{be()},onDone:we=>{he(we)},context:{getNames:()=>V.getNames()}};s.showWindow?.("tableNew",ve)}):{option:"Ok",tableOptions:ce}}const W=await Promise.resolve(y);if(W?.option!=="Ok")throw null;const Y=await Promise.resolve(s?.showBusy?.(m.label()));try{await V.getTables().add(W.tableOptions.ranges.at(0),{styleName:_?.name,clearFormatting:A,hasHeader:W.tableOptions.hasHeader}).getRange().select()}catch(ie){Y(),s?.showError?.(ie)}Y()},!1,!0,!1)},[H]),Re=X(()=>o,[o]),Te=X(m=>({styles:()=>e.getStyles(),table:()=>m,bodyStyle:Re,getNames:()=>e.getNames()}),[e]),ae=X(async(m,_,A,x=!0)=>{let V=null;if(!_){let y=e.getSelectedRange();y.size===1&&(y=y.getSurrounding());let W=e.getTables().search({address:e.getSelectedRange()});W.length>0&&(_=W[0]),await y.select()}if(_){if(x){try{A&&await _.select()}catch{}V=new Promise(async(y,W)=>{m.update({context:Te(_)});const Y={command:m,commands:C,notifier:s,onDone:de=>{y(de)}},ie=await s.showWindow?.("tableDetails",Y,{disableAutoDestroy:!0});setTimeout(()=>{ie.focus()},180)})}Promise.resolve(V).then(y=>{},y=>{s?.showError?.(y)})}},[s]),Fe=X(async(m,_,A=!1)=>{let x=null;if(_)_.isITable?x=_:_.getValue()&&(x=_.getValue());else{const V=e.getTables().search({address:e.getSelectedRange()});V.length>0&&(x=V[0])}if(x){if(!A){const V=x.getRange().getCoords(),y=(V.colEnd-V.colStart+1)*(V.rowEnd-V.rowStart+1);if(y>1e4&&await s?.showOptions({title:"Confirm",description:`Converting a table to range with '${y}' cells will set a large number of cell styles and may affect performance.
|
|
17
|
-
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}j(m,async()=>{A?x.delete():x.convertToRange()},!1,!0)}},[s]),me=X((m,_,A)=>{j(m,async x=>{let V=x.getSelectedRanges();if(V.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let y=V.at(0);y.size===1&&(y=y.getSurrounding());const W=x.getSelection().getCoords().cell;let Y=y.getDefaultSortCriteria(p.IRange.Orientation.Row,W);if(!Y){if(A)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ie=Y.options;if(A&&(ie=new Promise((ce,he)=>{const be={range:y,options:Y.options,cell:W,onCancel:()=>{he()},onDone:ve=>{ve?ce(ve.options):he()}};s.showWindow?.("sort",be)})),ie=await Promise.resolve(ie),!ie)return;const de=await Promise.resolve(s?.showBusy?.(m.label()));try{y.doBatch(()=>{const ce={...ie,..._};y.sort(ce),y.autoFit({orientations:ce?.orientation===p.IRange.Orientation.Column?p.IRange.Orientations.Column:p.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},m?.label?.())}catch(ce){de(),s?.showError?.(ce)}de()},!1,!1,!1)},[s]),Oe=X(()=>{console.log("compactedSelection");const m=e.getSelection().getCoords(),_=e.getSelectedRanges().getFlattened().getCoords(),A=(y=>{const W=new Blob([y],{type:"application/javascript"}),Y=URL.createObjectURL(W),ie=new Worker(Y);return URL.revokeObjectURL(Y),ie})("console.log('hello from worker');");setTimeout(()=>{A.terminate(),console.log("Worker terminated")},5e3);let x=-1;for(let y=0;x===-1&&y<_.length;y++)ut.isCellWithinRange(m.cell,_[y])&&(x=y);if(ut.isEqualRangesArrays(m.ranges,_))return;const V={cell:m.cell,ranges:_,rangeIndex:x};e.getSelection().updateCoords(V)},[e]),xe=X(()=>{console.log("selectComments")},[e]),ge=X(async(m=!1,_=!1)=>{let A=null;if(_)A=e.getEntireRange();else{const x=e.getSelectedRange();if(x.isEntireRange()){const V=e.getSelection().getCoords().cell,y=e.getRange(V);A=y.getSurrounding(),A.isEntireRange()&&(A=y)}else A=x.getSurrounding({contentOnly:m})}A&&await A.select()},[e]),fe=X((m,_,A)=>{j(m,async x=>{let V=x.getSelectedRanges();A&&(_===p.IRange.Orientation.Row?V=V.getEntireRows():_===p.IRange.Orientation.Column&&(V=V.getEntireColumns())),V.delete(_)},"Delete Cells")},[e]);X(async m=>{let _=null;const A=q(),x=Math.min(A.width-8,480),V=Math.min(A.height-8,288);try{e.getSelectedRanges(),_=await e.getMovables().add({bounds:{x:A.left+(A.width-x)/2,y:A.top+(A.height-V)/2,width:x,height:V},type:"chart",json:m.template}),_.select(),S.setMode(null)}catch(y){s?.showError?.(y)}return _},[e,s]);const Se=X(async(m,_,A)=>{const x=await s?.showBusy?.(m.label());try{const V=await e.getMovables().addImage(_,{autoSelect:!0,...A});return x(),S.setMode(null),V}catch(V){x();let y=V;typeof y!="string"&&(console.warn(V),y="Unable to resolve image."),s?.showMessage?.(y,{type:bn.Error})}},[e,s]),pe=X((m,_)=>{j(m,async A=>{const x=A.getSelectedRanges();x.doBatch(()=>{const V=_===p.IRange.Direction.Up||_===p.IRange.Direction.Down,y=x.getCoords().slice().sort(ut.createRangeComparator(V?p.IRange.Orientation.Row:p.IRange.Orientation.Column));for(let W=0;W<y.length;W++){const Y=y[W];let ie=Y;const de=A.getRange(ie).getMerges();let ce=0,he=0;if(de.length>0){const be=de[0];ce=be.rowEnd-be.rowStart,he=be.colEnd-be.colStart}_===p.IRange.Direction.Left?ie={...Y,colStart:Y.colEnd+he}:_===p.IRange.Direction.Right?ie={...Y,colEnd:Y.colStart+he}:_===p.IRange.Direction.Up?ie={...Y,rowStart:Y.rowEnd+ce}:_===p.IRange.Direction.Down&&(ie={...Y,rowEnd:Y.rowStart+ce}),A.getRange(ie).autoFill(Y,{filler:p.AutoFill.Types.Copy}),A.getRange(Y).autoFit({orientations:p.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:m.label()})})},[s]),Ce=X(()=>{let m=null;const _=e.getSelectedCell().getCoords();if(_?.rowIndex>0){const A=e.getRange({rowIndex:_.rowIndex-1,colIndex:_.colIndex}).getCell();A&&(m=A.toTextUnformatted(!0))}b?.({text:m})},[e]),[Ae,ye]=l.useReducer(m=>m+1,0),[De,Pe]=l.useReducer(m=>m+1,0),$e=l.useMemo(()=>[new ne("gridlinesToggle",i,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new ne("sheetViewToggleGridlinesRows",i,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new ne("sheetViewToggleGridlinesColumns",i,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new ne("sheetViewFormatGridlinesColor",i,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new ne("sheetViewToggleShowHeadings",i,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new ne("sheetViewToggleShowHeadingRows",i,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new ne("sheetViewToggleShowHeadingColumns",i,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new ne("sheetViewToggleShowHeadingsNumeric",i,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[Q.Ctrl,Q.Shift]}}),new ne("sheetViewToggleFormulaView",i,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[Q.Ctrl]},{key:"`",modifiers:[Q.Ctrl,Q.Shift]}]}),new ne("sheetViewToggleShowZeros",i,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new Ne("selectComments",i,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[Q.Ctrl,Q.Shift]}},()=>xe()),new ne("selectAll",i,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[Q.Ctrl]},{key:"Space",modifiers:[Q.Ctrl,Q.Shift]}]},(m=!1)=>ge(!1,m)),new Ne("selectRegion",i,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[Q.Ctrl,Q.Shift]}},()=>ge(!0,!1)),new Ne("breakSelection",i,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[Q.Ctrl,Q.Alt]}},()=>Oe()),new Ne("formatTextRotate0",i,{label:"No Text Rotation",description:"Remove all text rotation."}),new Ne("formatTextRotate45",i,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new Ne("formatTextRotate90",i,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new Ne("formatTextRotate270",i,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new Ne("formatTextRotate315",i,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new ne("formatTextRotateCustom",i,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new Ne("formatTextRotateVertical",i,{label:"Vertical Text",description:"Stack text vertically."}),new Ne("sortAscending",i,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){me(this,{reverse:!1},!1)}),new Ne("sortDescending",i,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){me(this,{reverse:!0},!1)}),new Ne("sortCustom",i,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){me(this,{},!0)}),new ne("protectionSheetToggle",i,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
18
|
-
For example, you can prevent people from editing locked cells or making formatting changes.`}),new ne("formatSheetTabColor",i,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new ne("formatCellStyle",i,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(m){z(this,{named:m.getName()},!0)}),new ne("formatTableStyle",i,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(m){le(this,m)}),new ne("formatTableStyleClearCellStyles",i,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(m){le(this,m,!0)}),new ne("formatTableStyleClearTableStyle",i,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){le(this,{name:null},!0)}),new ne("setDefaultTableStyle",i,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ue),new ne("deleteTableStyle",i,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},te),new ne("formatBorder",i,{label:"Border",description:"Create an outline border."},function(m){z(this,{border:m})}),new ne("formatFillColor",i,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(m){z(this,{fill:m})}),new ne("formatFontColor",i,{label:"Font Color",description:"Change the color of your text."},function(m){z(this,{font:{fill:m}})}),new ne("formatBoldToggle",i,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[Q.Ctrl]},{key:"2",modifiers:[Q.Ctrl]}]}),new ne("formatItalicToggle",i,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[Q.Ctrl]},{key:"3",modifiers:[Q.Ctrl]}]}),new ne("formatUnderlinedToggle",i,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[Q.Ctrl]},{key:"4",modifiers:[Q.Ctrl]}]}),new ne("formatUnderlinedDoubleToggle",i,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new ne("formatUnderlinedAccountingToggle",i,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new ne("formatUnderlinedAccountingDoubleToggle",i,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new ne("formatStrikeThroughToggle",i,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[Q.Ctrl]}}),new ne("formatSuperscriptToggle",i,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new ne("formatSubscriptToggle",i,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new ne("formatAlignTopToggle",i,{label:"Align Top",description:"Align text to the top."}),new ne("formatTextOverflowVisibleToggle",i,{label:"Overflow Text",description:"Overflow text to the next cells."}),new ne("formatTextOverflowWrapToggle",i,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new ne("formatTextOverflowClipToggle",i,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new ne("formatTextOverflowShrinkToggle",i,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new ne("formatTextOverflowEllipsisToggle",i,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new ne("formatAlignMiddleToggle",i,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new ne("formatAlignBottomToggle",i,{label:"Align Bottom",description:"Align text to the bottom."}),new ne("formatAlignJustifyVerticalToggle",i,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new ne("formatAlignDistributedVerticalToggle",i,{label:"Distribute Vertically",description:"Justify your content vertically."}),new ne("formatAlignLeftToggle",i,{label:"Align Left",description:"Align your content to the left."}),new ne("formatAlignCenterToggle",i,{label:"Align Center",description:"Center your content."}),new ne("formatAlignRightToggle",i,{label:"Align Right",description:"Align your content to the right."}),new ne("formatAlignJustifyToggle",i,{label:"Align Justify",description:"Justify your content."}),new ne("formatAlignCenterContinuousToggle",i,{label:"Center Across",description:"Center your content across multiple cells."}),new ne("formatAlignFillToggle",i,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new ne("formatAlignDistributedHorizontalToggle",i,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new Ne("formatFontSizeIncrease",i,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,m=>({font:{size:Cr(m.getFont().getSize(),!0)}}))}),new Ne("formatFontSizeDecrease",i,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,m=>({font:{size:Cr(m.getFont().getSize(),!1)}}))}),new ne("formatFontFamily",i,{label:"Font",description:"Select the font your text."},function(m){z(this,{font:{family:m}})}),new ne("formatFontSize",i,{label:"Font Size",description:"Change the size of your text."},function(m){z(this,{font:{size:m}})}),new ne("formatNumberDialog",i,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[Q.Ctrl]},{key:"1",modifiers:[Q.Ctrl,Q.Alt]}]},function(m,_){const A=this,x={initialValue:m??_.state(),context:_.context(),onInputOption:(V,y)=>{z(A,{numberFormat:V})}};s.showWindow?.("numberFormat",x)}),new ne("formatNumberFormat",i,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(m){z(this,{numberFormat:m})}),new ne("formatNumberFormatGeneralStyle",i,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:p.NumberFormat.Type.General})}),new ne("formatNumberFormatNumberStyle",i,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:"#,##0.00"})}),new ne("formatNumberFormatTimeStyle",i,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:"h:mm AM/PM"})}),new ne("formatNumberFormatDateStyle",i,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:"d-mmm-yy"})}),new ne("formatNumberFormatAccountingStyle",i,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[Q.Ctrl,Q.Shift]}},function(m){z(this,{numberFormat:m??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new ne("formatNumberFormatPercentStyle",i,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:"0%"})}),new ne("formatNumberFormatScientificStyle",i,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[Q.Ctrl,Q.Shift]}},function(){z(this,{numberFormat:"0.00E+00"})}),new ne("formatNumberFormatCommaStyle",i,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[Q.Ctrl]}},function(){z(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new ne("formatNumberFormatIncreaseDecimal",i,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){z(this,m=>({numberFormat:p.NumberFormat.Parser.adjustDecimalPlaces(m.getNumberFormat(),1)}))}),new ne("formatNumberFormatDecreaseDecimal",i,{label:"Decrease Decimal",description:"Show few decimal places."},function(){z(this,m=>({numberFormat:p.NumberFormat.Parser.adjustDecimalPlaces(m.getNumberFormat(),-1)}))}),new ne("displayPlaceholdersToggle",i,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[Q.Ctrl]}}),new Ne("noOp",i,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[Q.Ctrl]}},function(){}),new ne("displayOutlineSymbolsToggle",i,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[Q.Ctrl]}}),new ne("hideRows",i,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[Q.Ctrl]}}),new ne("unhideRows",i,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[Q.Ctrl,Q.Shift]}}),new ne("hideColumns",i,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[Q.Ctrl]},{key:"0",modifiers:[Q.Ctrl,Q.Alt]}]}),new ne("unhideColumns",i,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[Q.Ctrl,Q.Shift]}}),new ne("quickFormulaSum",i,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[Q.Alt]}},function(){K(this,"SUM")}),new ne("quickFormulaAverage",i,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){K(this,"AVERAGE")}),new ne("quickFormulaCount",i,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){K(this,"COUNT")}),new ne("quickFormulaMax",i,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){K(this,"MAX")}),new ne("quickFormulaMin",i,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){K(this,"MIN")}),new ne("startEditCurrentTime",i,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[Q.Ctrl,Q.Shift]}},function(){b?.({text:e.createTemporaryCell({value:Wn(),style:{numberFormat:"Medium Time"}}).toText()})}),new ne("startEditCurrentDate",i,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[Q.Ctrl]}},function(){b?.({text:e.createTemporaryCell({value:Wn(),style:{numberFormat:"Short Date"}}).toText()})}),new Ne("sheetZoomOut",i,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[Q.Ctrl,Q.Alt]},{key:"NumpadSubtract",modifiers:[Q.Ctrl,Q.Alt]}]}),new Ne("sheetZoomIn",i,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[Q.Ctrl,Q.Alt]},{key:"NumpadAdd",modifiers:[Q.Ctrl,Q.Alt]}]}),new Ne("sheetZoom100",i,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[Q.Ctrl,Q.Alt]}}),new ne("insertFunction",i,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[Q.Shift]}},function(m,_){console.log("insertFunction")}),new ne("updateHyperlink",i,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>O,shortcut:[{key:"K",modifiers:[Q.Ctrl]},{key:"K",modifiers:[Q.Ctrl,Q.Alt]}]},async function(m,_){const A=this,x={context:_.context(),onUpdateHyperlink:(V,y)=>{B(A,V,y)}};s.showWindow?.("hyperlink",x)}),new ne("openHyperlink",i,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[Q.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>O},async(m,_)=>{const A=_.context()();if(!A)return;const x=A.getHyperlink();if(x)try{await x.open()}catch(V){s?.showError?.(V)}}),new ne("deleteHyperlink",i,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>O},function(m,_){B(this,null,null)}),new Ne("insertNote",i,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[Q.Shift]},description:"Add a note to the cell."},(m,_)=>{((A,x)=>{A?.showMessage?.(g.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[x," is not yet implemented.",g.jsx("br",{}),g.jsx("br",{}),"Please see the ",g.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,_.label())}),new ne("updateComments",i,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[Q.Ctrl,Q.Alt]},description:"Add a comment to the current cell.",context:()=>O},async function(m,_){const A=this,x={context:_.context(),onUpdateComments:V=>{Z(A,V)}};s.showWindow?.("comments",x)}),new ne("deleteComments",i,{label:"Delete Comments",description:"Remove any comments.",context:()=>O},function(m,_){Z(this,null)}),new ne("insertImageFromFile",i,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(m=null){let _=null,A=null;typeof m=="string"?A=m:_=m?.file?m.file:m,(_||(_=await Ue.openFileDialog(A??"image/*"),_))&&await Se(this,{file:_},m?.options)}),new ne("insertImageFromURL",i,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(m){if(!m){const _=await s?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(_.option!=="Insert")return;m=_.input}m&&Se(this,{fetch:m})}),new Ne("insertTable",i,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[Q.Ctrl]},{key:"T",modifiers:[Q.Alt,Q.Ctrl]}]},function(){le(this)}),new ne("editTable",i,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(m){let _=null,A=!1;m.isITable?_=m:m.getValue()&&(_=m.getValue(),A=!0),ae(this,_,A)}),new ne("deleteTable",i,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
15
|
+
The values and the formatting are preserved.`},function(u){Pe(this,u,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const u=this.context().table();u&&u.setShowTotals(!u.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const u=this.context().table();u&&u.setShowHeaders(!u.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const u=this.context().table();u&&u.setShowFilterButton(!u.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new r.SimpleCommand("startEditValueAbove",l,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},xe),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){z(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){z(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return z(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return z(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return z(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("insertRowsAfter",l,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return z(this,s.IRange.Orientation.Row,!0,!0)}),new r.SimpleCommand("insertColumnsAfter",l,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return z(this,s.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return de(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return de(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return de(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return de(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return de(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return pe(this,s.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return pe(this,s.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return pe(this,s.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return pe(this,s.IRange.Direction.Left)}),new r.SimpleCommand("formatBorderAddOutline",l,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return V(this,{border:{left:{style:s.IBorder.StrokeStyle.Thin,color:null},top:{style:s.IBorder.StrokeStyle.Thin,color:null},right:{style:s.IBorder.StrokeStyle.Thin,color:null},bottom:{style:s.IBorder.StrokeStyle.Thin,color:null}}})}),new r.SimpleCommand("formatBorderClearOutline",l,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return V(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return V(this,u=>{const M=u.getAlignment().getIndent()-1;return{alignment:{indent:M>0?M:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border."},function(){return V(this,u=>{const M={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===s.ITextFrame.HorizontalAlignment.General&&(M.alignment.horizontal=s.ITextFrame.HorizontalAlignment.Left),M})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:`Clear only the contents in the cells.
|
|
19
16
|
|
|
20
|
-
The
|
|
17
|
+
The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){L(this,s.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){L(this,s.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",l,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){L(this,s.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){L(this,s.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},description:`Clears everything from the cells.
|
|
21
18
|
|
|
22
|
-
The values and the formatting are preserved.`},function(m){Fe(this,m,!1)}),new ne("tableTotalRowToggle",i,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[Q.Ctrl,Q.Alt]}},function(){const m=this.context().table();m&&m.setShowTotals(!m.getShowTotals())}),new ne("tableHeaderRowToggle",i,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const m=this.context().table();m&&m.setShowHeaders(!m.getShowHeaders())}),new ne("autoFilterToggle",i,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[Q.Ctrl,Q.Shift]}},function(){const m=this.context().table();m&&m.setShowFilterButton(!m.getShowFilterButton())}),new ne("autoFilterReapply",i,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[Q.Ctrl,Q.Alt]}}),new ne("autoFilterClear",i,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new Ne("startEditValueAbove",i,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[Q.Ctrl]},{key:'"',modifiers:[Q.Ctrl,Q.Shift]}]},Ce),new ne("formatPainterToggle",i,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new Ne("insertCells",i,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[Q.Ctrl,Q.Shift]}},function(){M(this)}),new Ne("insertCellsShiftRight",i,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){M(this,p.IRange.Orientation.Column)}),new Ne("insertCellsShiftDown",i,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return M(this,p.IRange.Orientation.Row)}),new Ne("insertRows",i,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return M(this,p.IRange.Orientation.Row,!0)}),new Ne("insertColumns",i,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return M(this,p.IRange.Orientation.Column,!0)}),new Ne("insertRowsAfter",i,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return M(this,p.IRange.Orientation.Row,!0,!0)}),new Ne("insertColumnsAfter",i,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return M(this,p.IRange.Orientation.Column,!0,!0)}),new Ne("deleteCells",i,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[Q.Ctrl]}},function(){return fe(this)}),new Ne("deleteCellsShiftUp",i,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return fe(this,p.IRange.Orientation.Row)}),new Ne("deleteCellsShiftLeft",i,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return fe(this,p.IRange.Orientation.Column)}),new Ne("deleteRows",i,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return fe(this,p.IRange.Orientation.Row,!0)}),new Ne("deleteColumns",i,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return fe(this,p.IRange.Orientation.Column,!0)}),new Ne("flashFill",i,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[Q.Ctrl]},{key:"e",modifiers:[Q.Ctrl,Q.Alt]}]}),new Ne("fillDown",i,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[Q.Ctrl]}},function(){return pe(this,p.IRange.Direction.Down)}),new Ne("fillRight",i,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[Q.Ctrl]}]},function(){return pe(this,p.IRange.Direction.Right)}),new Ne("fillUp",i,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return pe(this,p.IRange.Direction.Up)}),new Ne("fillLeft",i,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return pe(this,p.IRange.Direction.Left)}),new Ne("formatBorderAddOutline",i,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[Q.Ctrl,Q.Shift]}},function(){return z(this,{border:{left:{style:p.IBorder.StrokeStyle.Thin,color:null},top:{style:p.IBorder.StrokeStyle.Thin,color:null},right:{style:p.IBorder.StrokeStyle.Thin,color:null},bottom:{style:p.IBorder.StrokeStyle.Thin,color:null}}})}),new Ne("formatBorderClearOutline",i,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[Q.Ctrl,Q.Shift]}},function(){return z(this,{border:null})}),new Ne("formatIndentDecrease",i,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return z(this,m=>{const _=m.getAlignment().getIndent()-1;return{alignment:{indent:_>0?_:0}}})}),new Ne("formatIndentIncrease",i,{label:"Increase Indent",description:"Move your content further from the border."},function(){return z(this,m=>{const _={alignment:{indent:m.getAlignment().getIndent()+1}};return m.getAlignment().getHorizontal()===p.ITextFrame.HorizontalAlignment.General&&(_.alignment.horizontal=p.ITextFrame.HorizontalAlignment.Left),_})}),new ne("mergeToggle",i,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[Q.Ctrl]}}),new Ne("mergeHorizontal",i,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new Ne("mergeVertical",i,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new Ne("unmerge",i,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new Ne("clearContents",i,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:`Clear only the contents in the cells.
|
|
19
|
+
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){L(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),C=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(Ve,!0),u},[a,Ve]),[Ue,Qe]=o.useState(!1),[$e,J]=o.useState(!1);o.useEffect(()=>{if(T.current!==t||!h)return;const u=h.getCoords(),M=t.getTables().search({address:u[0]});E(H=>ue.CommonUtils.isEqualArrays(H,M)?H:M),g&&M[0]&&ue.CoordUtils.isCellWithinRange(g,M[0].getRange().getCoords())?W(M[0]??null):W(null);const I=t.getSelectedRanges(),b=I.getMerges().length>0,N=I.isOverlapping();let v=!0;for(let H=0;v&&H<u.length;H++)v=ue.CoordUtils.isSingleCell(u[H]);J(N),Qe(M.length===0&&!N&&(b||!v))},[Ee,h,t]),r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=w.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>M}).updateCallback(()=>M?void w.setMode(null):C.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[w,Me,a]),tt(t.getView(),{onFreezeSplitChange:()=>{Le()}}),tt(t.getSelection(),{onChange:()=>{Z()}});const Fe=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??Rn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:Rn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Be=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{G(u)},darkMode:i.darkMode,quickBorder:D,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Be()},[D]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!_().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:u||!_().getHyperlink()});const M=_().getHyperlink()?"Edit":"Insert",I="Link";C.getCommand("updateHyperlink").update({label:()=>(_().getHyperlink(),`${M} ${I}`),scopedLabels:{contextMenu:`${M} ${I}…`,insert:`${I}…`,hyperlink:`${M}…`},disabled:u})},[_()?.getHyperlink(),Me]),o.useEffect(()=>{const u=_().getComments(),M=()=>u?"Edit":"Insert",I=()=>u?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${M()} ${I()}`,scopedLabels:{contextMenu:`${M()} ${I()}…`,insert:`${I()}…`}})},[_()?.getComments(),Me]),tt(t,{onViewChange:()=>{const u=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),Fe()},onTabColorChange:()=>{Fe()},onMergesChange:()=>{Le()},onMovablesChange:()=>{Le()},onTablesChange:()=>{Le()},onProtectionChange:()=>{Le(),be()},onStyleChange:()=>{Fe(),Be(),Le()}}),o.useEffect(()=>{Fe(),Be()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=O.length>0&&!K||u,I=ke(K),b={context:I};C.getCommand("editTable").update(b),C.getCommand("deleteTable").update(b),C.getCommand("convertTableToRange").update(b);const N={context:I,disabled:M};C.getCommand("formatTableStyle").update({label:K?"Apply Table Style":"Format As Table",...N}),C.getCommand("formatTableStyleClearCellStyles").update(N),C.getCommand("deleteTableStyle").update(N),C.getCommand("convertTableToRange").update(N),C.getCommand("insertTable").update({disabled:M||O.length>0});const v={context:I,disabled:M||O.length===0};C.getCommand("tableHeaderRowToggle").update(v),C.getCommand("tableTotalRowToggle").update(v),C.getCommand("autoFilterToggle").update(v),C.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!K||K.getStyleOptions().name===null})},[K,O,Me]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),C.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),C.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),C.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),C.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),C.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),C.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),C.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),C.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})})},[t]),o.useEffect(()=>{const u=t.getView().getFreezePanes(),M=()=>u.coords.rowIndex!==0,I=()=>u.coords.colIndex!==0,b=()=>u.coords.rowIndex!==0||u.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{b()?t.getView().setFreezePanes(null):b()?I()?t.getView().setFreezePanes({coords:{rowIndex:g.rowIndex}}):M()&&t.getView().setFreezePanes({coords:{colIndex:g.colIndex}}):t.getView().setFreezePanes({coords:g})}).update({state:b,disabled:()=>!g||!b()&&g.rowIndex===0&&g.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:M()?0:g.rowIndex}})}).update({state:M,disabled:()=>!g||!M()&&g.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:I()?0:g.colIndex}})}).update({state:I,disabled:()=>!g||!I()&&g.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!b()})},[Ee,g,t,i]);const Ie=_().getStyle(),ze=Ie.getFont(),Ae=Ie.getAlignment(),R=Ae.getHorizontal(),re=Ae.getVertical(),j=Ae.getOverflow(),Y=Ae.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>_().getStyle(!0).getNamed(),bodyStyle:we,createTemporaryCell:Ne=>t.createTemporaryCell(Ne)})}),C.getCommand("formatFillColor").update({state:()=>{let Ne=null;const Xe=Ie.getFill();return Xe?.getType()===s.IFill.Type.Solid?Ne=Xe.getColor():Xe?.getType()===s.IFill.Type.Gradient?Ne=Xe.getStops()?.[0]?.getColor():Xe?.getType()===s.IFill.Type.Pattern&&(Ne=Xe.getBackground()),Ne},context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{y(Xe??Rn)},darkMode:i.darkMode,quickColor:U,autoColor:Rn,schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>ze.toJSON()?.fill?ze.getFill():null,context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{S(Xe)},darkMode:i.darkMode,quickColor:B,autoColor:Ne.getNormal().getFont().getFill(),schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>Ie.getNumberFormat(),context:()=>_}),C.getCommand("formatNumberDialog").update({state:()=>Ie.getNumberFormat(),context:()=>_}),C.getCommand("formatFontFamily").update({state:()=>ze.getFamily()}),C.getCommand("formatFontSize").update({state:()=>ze.getSize()});const u=function(){const Ne=ze.getWeight()||0;return!isNaN(Ne)&&Ne>500};C.getCommand("formatBoldToggle").updateCallback(function(){V(this,{font:{weight:u()?400:700}})}).update({state:u});const M=function(){return ze.getStyle()===s.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){V(this,{font:{style:M()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:M}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){V(this,{font:{strike:!ze.getStrike()}})}).update({state:ze.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const I=()=>j===s.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){V(this,{alignment:{overflow:(I(),s.ITextFrame.Overflow.Visible)}})}).update({state:I});const b=()=>j===s.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){V(this,{alignment:{overflow:b()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:b});const N=function(){return j===s.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){V(this,{alignment:{overflow:N()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:N});const v=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){V(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const H=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){V(this,{alignment:{overflow:H()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:H,disabled:!0});const X=function(){return re===s.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){V(this,{alignment:{vertical:X()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:X});const ne=function(){return re===s.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){V(this,{alignment:{vertical:ne()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ne});const le=function(){return re===s.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){V(this,{alignment:{vertical:(le(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:le});const ie=function(){return re===s.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:ie()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:ie});const se=function(){return re===s.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:se});const ye=function(){return R===s.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){V(this,{alignment:{horizontal:ye()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:ye});const me=function(){return R===s.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){V(this,{alignment:{horizontal:me()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:me});const fe=function(){return R===s.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Ne={alignment:{horizontal:fe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};V(this,Ne)}).update({state:fe});const qe=function(){return R===s.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Ne={alignment:{horizontal:qe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};V(this,Ne)}).update({state:qe});const Oe=function(){return R===s.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){V(this,{alignment:{horizontal:Oe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const De=function(){return R===s.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){V(this,{alignment:{horizontal:De()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:De});const We=function(){return R===s.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){V(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),Ge=R===s.ITextFrame.HorizontalAlignment.CenterContinuous||R===s.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Ne){V(this,{alignment:{rotation:0}})}).update({disabled:je||Ge,state:Y===0}),C.getCommand("formatTextRotate45").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?45:0}})}).update({disabled:je||Ge,state:Y===45}),C.getCommand("formatTextRotate90").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?90:0}})}).update({disabled:je||Ge,state:Y===90}),C.getCommand("formatTextRotate270").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?270:0}})}).update({disabled:je||Ge,state:Y===270}),C.getCommand("formatTextRotate315").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?315:0}})}).update({disabled:je||Ge,state:Y===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne}})}).update({disabled:je||Ge,state:Y??0})},[Ie,t,i,U,B]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=t.getSelectedRanges().getMerges().length>0,I=async(_e,rt)=>{P(rt,async vt=>{const yt=async(gt=!1)=>{const lt=await Promise.resolve(d?.showBusy?.(rt.label()));try{const Tt=vt.getSelectedRanges();if(Tt.merge({orientations:_e,discardMultipleValues:gt}),_e===s.IRange.Orientations.Both){const Lt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};Tt.updateStyle(Lt)}}catch(Tt){throw Tt}finally{lt?.()}};let Ct;try{await yt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;Ct=!0}if(Ct&&d?.showOptions){if(await d?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await yt(!0)}},void 0,void 0,!1)},b=_e=>{P(_e,async rt=>{try{const vt=rt.getSelectedRanges();vt.unmerge();const yt={alignment:{horizontal:null}};vt.updateStyle(yt)}catch(vt){throw vt}})};C.getCommand("mergeToggle").updateCallback(function(){ue.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(M?b(this):I(s.IRange.Orientations.Both,this))}).update({state:M,disabled:!Ue||u}),C.getCommand("mergeHorizontal").updateCallback(function(){I(s.IRange.Orientations.Column,this)}).update({disabled:!Ue||u}),C.getCommand("mergeVertical").updateCallback(function(){I(s.IRange.Orientations.Row,this)}).update({disabled:!Ue}),C.getCommand("unmerge").updateCallback(function(){b(this)}).update({disabled:!M||!Ue||u});const N={disabled:u};C.getCommand("hideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),C.getCommand("hideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),C.getCommand("unhideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),C.getCommand("unhideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),C.getCommand("autoFitRows").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(N),C.getCommand("autoFitColumns").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(N);let v=!1,H=0,X=!1,ne=!1,le=0,ie=!1;!h||u||$e||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?X=!0:H=h.getColumnCount(),ne=h.isEntireRowsAny(),ne&&!h.isEntireRows()?ie=!0:le=h.getRowCount());const se={disabled:u||h&&h.getCount()!==1};C.getCommand("sortAscending").update(se),C.getCommand("sortDescending").update(se);const ye={disabled:v||ne||u||$e},me=v||u||$e||ie;me&&(H=1);const fe=ne||u||$e||X;fe&&(le=1);let qe="",Oe="",De="",We="",je="",Ge="",Ne="",Xe="",it="";H>1&&(Ge=Oe=H+" ",Ne=De="s"),le>1&&(Xe=We=le+" ",it=je="s"),w.getMode()?.key==="copy"?(qe=We=Oe="Copied ",De=je="s"):w.getMode()?.key==="cut"&&(qe=We=Oe="Cut ",De=je="s");let pt="",wt="";if(h){const _e=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;pt=` (${_e?"Shift Right":"Shift Down"})`,wt=` (${_e?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${wt}`})}C.getCommand("insertCells").update({label:`Insert ${qe}Cells${pt}`,scopedLabels:{insertCells:`${qe}At Selection`}}),C.getCommand("insertCellsShiftRight").update(ye),C.getCommand("insertCellsShiftDown").update(ye),C.getCommand("deleteCellsShiftUp").update(ye),C.getCommand("deleteCellsShiftLeft").update(ye),C.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:fe}),C.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:fe}),C.getCommand("insertColumns").update({label:`Insert ${Oe}Column${De}`,scopedLabels:{insertCells:`${Oe}Column${De}`},disabled:me}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Oe}Column${De} After`,disabled:me}),C.getCommand("deleteRows").update({label:`Delete ${Xe}Row${it}`,scopedLabels:{deleteCells:`${Xe}Row${it}`},disabled:fe}),C.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${Ne}`,scopedLabels:{deleteCells:`${Ge}Column${Ne}`},disabled:me})},[Ee,Ue,$e,h,w,d,Me]),o.useEffect(()=>{const u=t.getProtection(),M=t.getProtection().isLocked(),I=!u.isFormatCellsAllowed(),b={disabled:I};C.getCommand("protectionSheetToggle").updateCallback(async(H,X)=>{let ne=null;try{if(M){let le=null;if(u.hasPassword()){const ie=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ie.option!=="Unprotect")return;le=ie.input}ne=await Promise.resolve(d?.showBusy?.(X.label())),await u.unlock(le)}else ne=await Promise.resolve(d?.showBusy?.(X.label())),await u.lock();ne?.()}catch(le){ne?.(),d?.showError?.(le)}}).update({state:M,label:()=>M?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:M?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(b),C.getCommand("sortAscending").update(b),C.getCommand("sortDescending").update(b),C.getCommand("sortCustom")?.update(b),C.getCommand("updateComments").update(b),C.getCommand("deleteComments").update(b),C.getCommand("insertChart")?.update(b),C.getCommand("insertImageFromFile").update(b),C.getCommand("insertImageFromURL").update(b),C.getCommand("formatBorder").update(b),C.getCommand("formatFillColor").update(b),C.getCommand("formatFontColor").update(b),C.getCommand("formatBoldToggle").update(b),C.getCommand("formatItalicToggle").update(b),C.getCommand("formatUnderlinedToggle").update(b),C.getCommand("formatStrikeThroughToggle").update(b),C.getCommand("formatSuperscriptToggle").update(b),C.getCommand("formatSubscriptToggle").update(b),C.getCommand("formatAlignTopToggle").update(b),C.getCommand("formatTextOverflowVisibleToggle").update(b),C.getCommand("formatTextOverflowWrapToggle").update(b),C.getCommand("formatTextOverflowClipToggle").update(b),C.getCommand("formatTextOverflowShrinkToggle").update(b),C.getCommand("formatAlignMiddleToggle").update(b),C.getCommand("formatAlignBottomToggle").update(b),C.getCommand("formatAlignDistributedVerticalToggle").update(b),C.getCommand("formatAlignJustifyVerticalToggle").update(b),C.getCommand("formatAlignLeftToggle").update(b),C.getCommand("formatAlignCenterToggle").update(b),C.getCommand("formatAlignRightToggle").update(b),C.getCommand("formatAlignJustifyToggle").update(b),C.getCommand("formatAlignCenterContinuousToggle").update(b),C.getCommand("formatAlignDistributedHorizontalToggle").update(b),C.getCommand("formatAlignFillToggle").update(b),C.getCommand("formatFontSizeIncrease").update(b),C.getCommand("formatFontSizeDecrease").update(b),C.getCommand("formatFontFamily").update(b),C.getCommand("formatFontSize").update(b),C.getCommand("formatNumberFormat").update(b),C.getCommand("formatNumberFormatGeneralStyle").update(b),C.getCommand("formatNumberFormatNumberStyle").update(b),C.getCommand("formatNumberFormatTimeStyle").update(b),C.getCommand("formatNumberFormatDateStyle").update(b),C.getCommand("formatNumberFormatAccountingStyle").update(b),C.getCommand("formatNumberFormatPercentStyle").update(b),C.getCommand("formatNumberFormatScientificStyle").update(b),C.getCommand("formatNumberFormatCommaStyle").update(b),C.getCommand("formatNumberFormatIncreaseDecimal").update(b),C.getCommand("formatNumberFormatDecreaseDecimal").update(b),C.getCommand("hideColumns").update(b),C.getCommand("unhideColumns").update(b),C.getCommand("hideRows").update(b),C.getCommand("unhideRows").update(b),C.getCommand("quickFormulaSum").update(b),C.getCommand("quickFormulaAverage").update(b),C.getCommand("quickFormulaCount").update(b),C.getCommand("quickFormulaMax").update(b),C.getCommand("quickFormulaMin").update(b),C.getCommand("startEditCurrentTime").update(b),C.getCommand("startEditCurrentDate").update(b),C.getCommand("startEditValueAbove").update(b),C.getCommand("fillDown").update(b),C.getCommand("fillRight").update(b),C.getCommand("fillUp").update(b),C.getCommand("fillLeft").update(b),C.getCommand("formatCellStyle").update(b),C.getCommand("formatTableStyle").update(b),C.getCommand("formatPainterToggle").update(b),C.getCommand("formatBorderAddOutline").update(b),C.getCommand("formatBorderClearOutline").update(b),C.getCommand("formatIndentDecrease").update(b),C.getCommand("formatIndentIncrease").update(b),C.getCommand("clearContents").update(b),C.getCommand("clearFormats").update(b),C.getCommand("clearAll").update(b),C.getCommand("clearComments").update(b),C.getCommand("clearHyperlinks").update(b),C.getCommand("autoFilterClear").update(b),C.getCommand("autoFilterReapply").update(b);const N=R===s.ITextFrame.HorizontalAlignment.CenterContinuous||R===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:I||N};C.getCommand("formatTextRotate0").update(v),C.getCommand("formatTextRotate45").update(v),C.getCommand("formatTextRotate90").update(v),C.getCommand("formatTextRotate270").update(v),C.getCommand("formatTextRotate315").update(v),C.getCommand("formatTextRotateCustom").update(v),C.getCommand("formatTextRotateVertical").update(v)},[Ee]),C}var Do,zo;(function(){if(zo)return Do;zo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof rn=="object"&&rn&&rn.Object===Object&&rn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),p=Object.prototype.toString,g=Math.max,x=Math.min,h=function(){return m.Date.now()};function f(q){var A=typeof q;return!!q&&(A=="object"||A=="function")}function T(q){if(typeof q=="number")return q;if(function(G){return typeof G=="symbol"||function(U){return!!U&&typeof U=="object"}(G)&&p.call(G)=="[object Symbol]"}(q))return NaN;if(f(q)){var A=typeof q.valueOf=="function"?q.valueOf():q;q=f(A)?A+"":A}if(typeof q!="string")return q===0?q:+q;q=q.replace(e,"");var D=n.test(q);return D||i.test(q)?a(q.slice(2),D?2:8):t.test(q)?NaN:+q}Do=function(q,A,D){var G,U,y,B,S,w,k=0,O=!1,E=!1,F=!0;if(typeof q!="function")throw new TypeError("Expected a function");function Z(oe){var L=G,z=U;return G=U=void 0,k=oe,B=q.apply(z,L)}function _(oe){var L=oe-w;return w===void 0||L>=A||L<0||E&&oe-k>=y}function P(){var oe=h();if(_(oe))return V(oe);S=setTimeout(P,function(L){var z=A-(L-w);return E?x(z,y-(L-k)):z}(oe))}function V(oe){return S=void 0,F&&G?Z(oe):(G=U=void 0,B)}function $(){var oe=h(),L=_(oe);if(G=arguments,U=this,w=oe,L){if(S===void 0)return function(z){return k=z,S=setTimeout(P,A),O?Z(z):B}(w);if(E)return S=setTimeout(P,A),Z(w)}return S===void 0&&(S=setTimeout(P,A)),B}return A=T(A)||0,f(D)&&(O=!!D.leading,y=(E="maxWait"in D)?g(T(D.maxWait)||0,A):y,F="trailing"in D?!!D.trailing:F),$.cancel=function(){S!==void 0&&clearTimeout(S),k=0,G=w=U=S=void 0},$.flush=function(){return S===void 0?B:V(h())},$}})();var No,Lo,Oo={exports:{}},eo={};Lo||(Lo=1,Oo.exports=function(){if(No)return eo;No=1;var e=o,t=typeof Object.is=="function"?Object.is:function(p,g){return p===g&&(p!==0||1/p==1/g)||p!=p&&g!=g},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!t(p,x)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(p,g){return g()}:function(p,g){var x=g(),h=n({inst:{value:x,getSnapshot:g}}),f=h[0].inst,T=h[1];return a(function(){f.value=x,f.getSnapshot=g,d(f)&&T({inst:f})},[p,x,g]),i(function(){return d(f)&&T({inst:f}),p(function(){d(f)&&T({inst:f})})},[p]),l(x),x};return eo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,eo}()),Oo.exports;var jo,Bo,on={exports:{}},Ut={exports:{}},Il=Ut.exports;function Vo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Bo)return on.exports;Bo=1;for(var e=(jo||(jo=1,function(){var h,f,T,q,A,D;typeof performance<"u"&&performance!==null&&performance.now?Ut.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Ut.exports=function(){return(h()-A)/1e6},f=process.hrtime,q=(h=function(){var G;return 1e9*(G=f())[0]+G[1]})(),D=1e9*process.uptime(),A=q-D):Date.now?(Ut.exports=function(){return Date.now()-T},T=Date.now()):(Ut.exports=function(){return new Date().getTime()-T},T=new Date().getTime())}.call(Il)),Ut.exports),t=typeof window>"u"?rn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],d=0;!a&&d<n.length;d++)a=t[n[d]+"Request"+i],l=t[n[d]+"Cancel"+i]||t[n[d]+"CancelRequest"+i];if(!a||!l){var m=0,p=0,g=[],x=1e3/60;a=function(h){if(g.length===0){var f=e(),T=Math.max(0,x-(f-m));m=T+f,setTimeout(function(){var q=g.slice(0);g.length=0;for(var A=0;A<q.length;A++)if(!q[A].cancelled)try{q[A].callback(m)}catch(D){setTimeout(function(){throw D},0)}},Math.round(T))}return g.push({handle:++p,callback:h,cancelled:!1}),p},l=function(h){for(var f=0;f<g.length;f++)g[f].handle===h&&(g[f].cancelled=!0)}}on.exports=function(h){return a.call(t,h)},on.exports.cancel=function(){l.apply(t,arguments)},on.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},on.exports})();const vo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:p=!1,offset:g=0,totalSize:x=0,viewportSize:h=0,...f}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[T]=zt(),q=r.useCallbackRef(l,[l]),A=r.useCallbackRef(d,[d]),D=(G=T,U=t,o.useMemo(()=>G===null&&U===null?null:Q=>{Vo(G,Q),Vo(U,Q)},[G,U]));var G,U;const[y,B]=o.useState(()=>{const Q=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?Q.top:Q.left}),S=()=>{const Q=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?Q.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Q.coords.rowIndex)-Q.topLeft.top,scroll:Q.topLeft.top}:Q.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Q.coords.colIndex)-Q.topLeft.left,scroll:Q.topLeft.left}},[w,k]=o.useState(S),[O,E]=o.useState(null),[F,Z]=o.useState(!1),_=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),P=()=>{const Q=a.getUsedRange()?.getCoords()??ue.CoordUtils.EmptyRange,ee=a.getSelection().getCoords().cell;return{colIndex:Math.max(Q.colEnd,ee.colIndex),rowIndex:Math.max(Q.rowEnd,ee.rowIndex)}},[V,$]=o.useState(P),oe=V?(i===r.ScrollbarOrientation.Vertical?V.rowIndex:V.colIndex)+1:0,L=()=>{const Q=P();ue.CoordUtils.isEqualCells(V,Q)||$(Q)};tt(a.getView(),{onFreezeSplitChange:()=>{k(S)}}),tt(a.getSelection(),{onChange:L}),tt(a,{onUsedRangeChange:L}),o.useEffect(()=>{$(P())},[a]),o.useEffect(()=>{if(!O)return F&&A?.(),void Z(!1);const Q=_.getTextAt(_.findIndex(y/(a.getView().getZoomScale()/100)+w.scroll+w.shift));Z(!0),q?.({...O,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+Q})},[g,y,w,i,O,_,F,a]);const z=r.useCallbackRef((Q,ee,we)=>{B(Q);const ke=Q+w.scroll,ve=ee+w.shift,Pe=we+w.shift+w.scroll;m?.(ke,ve,Pe)},[m,w]),K=g-w.scroll,W=h-w.shift,Ce=x-(w.shift+w.scroll),ae=_.findOffset(oe)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return c.jsx(r.VirtualScrollbar,{ref:D,style:n,offset:K,viewportSize:W,totalSize:Ce,orientation:i,showCustomScrollButtons:p,onMouseDown:Q=>{E({anchor:{x:Q.clientX,y:Q.clientY}}),Q.preventDefault()},onScrollOffset:z,onMouseOut:()=>{E(null)},onMouseUp:()=>{E(null)},minSize:ae,...f})}));vo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},Ho=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:p,headerText:g,freezeStart:x,gridStyle:h,verticalPadding:f,horizontalPadding:T,onSheetContextMenu:q,onResizeHeadersStart:A,onResizeHeaders:D,onResizeHeadersEnd:G,onResizeHeadersDown:U,onResizeHeadersUp:y,scrollPoint:B,onSelectionStart:S,onSelectionEnd:w}=e,k=o.useMemo(()=>n.getOrientation(),[n]),O=o.useRef(null),[E,F]=o.useReducer(j=>j+1,0),[Z,_]=o.useReducer(j=>j+1,0),P=n?.getSheet(),V=o.useRef(!1);o.useLayoutEffect(()=>{V.current=!0},[n]);const $=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),oe=o.useMemo(()=>{const j=k===s.IRange.Orientation.Column;return{left:j?B.left:0,top:j?0:B.top}},[B]),[L,z]=o.useState(P?.getView().getZoomScale()/100),[K,W]=o.useState(null);tt(n,{onSizesChange:j=>{z(P?.getView().getZoomScale()/100),Me(pe())}});const Ce=o.useCallback(()=>{O.current?.invalidate(),_()},[]),ae=o.useCallback(ue.CommonUtils.debounce(()=>{Ce()},10),[]),[Q,ee]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){ee(P?.getSelection().getCoords()),ae()},onProtectionChange(){Ce()},onViewChange(){ae()}}),o.useLayoutEffect(()=>{Me(pe())},[k,L,d]),o.useLayoutEffect(()=>{W(null),z(n?.getSheet().getView().getZoomScale()/100),Me(pe())},[n]);const we=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),ke=o.useCallback((j,Y)=>n.hiddenHeadersAt(j,Y),[we]),ve=r.useCallbackRef(j=>n.isSelected(j),[n]),Pe=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),ge=o.useCallback(()=>n.getMinSize(),[n]),He=o.useCallback(()=>n.getMaxSize(),[n]),Se=r.useCallbackRef((j,Y,u)=>{Y/=L;const M={size:Y=Math.max(ge(),Math.min(ue.CommonUtils.roundAccurately(Y,ge()),He())),hidden:!1},I=[];if(Y<=0&&(M.hidden=!0,M.size=u),I.push({address:{min:j,max:j},update:M}),Y<0){const b=k===s.IRange.Orientation.Column,N=b?xe.getColOffset:xe.getRowOffset,v=b?xe.getColIndex:xe.getRowIndex,H=N(j);let X=v(H+Y);const ne=N(X);ne===H+Y?X--:I.push({address:{min:X,max:X},update:{size:H-ne+Y}}),j-X>1&&I.push({address:{min:X+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(I),D?.(j,Y,u)},[E,n,L,D]),ce=r.useCallbackRef((j,Y,u)=>{const M=k===s.IRange.Orientation.Column;let I=null,b={min:j,max:j};if(n.isSelectedAll(j)){const N=n.getSelectedRuns();N.length>1?I="Resize "+(M?"Columns":"Rows"):b=N[0];const v={hidden:Y<=0,size:(Y<=0?u:Y)/L};n.updateHeaderPairs(Po(N,v,j))}if(b){const N=b.max-b.min+1;let v;v=N===1?n.getRange(b).at(0).getDisplayText():n.getRange(b).toString(),I=`Resize ${M?"Column":"Row"}${N>1?"s":""} '${v}'`}G?.(j,Y,I)},[E,n,G]),de=r.useCallbackRef((j,Y)=>{const u=k===s.IRange.Orientation.Column;A(j,Y,`Resize ${u?"Column":"Row"}(s)`)},[A]),he=r.useCallbackRef(j=>{let Y=!1;const u=k===s.IRange.Orientation.Column,M=n.getSheet().getEntireRange().getCoords(),I=[],b=n.getSelectedRuns(),N=v=>{let H;H=u?{colStart:v.min,rowStart:M.rowStart,colEnd:v.max,rowEnd:M.rowEnd}:{colStart:M.colStart,rowStart:v.min,colEnd:M.colEnd,rowEnd:v.max},I.push(H)};for(let v=0;v<b.length;v++){const H=b[v];H.value.isSelectedAll&&(H.min<=j&&H.max>=j&&(Y=!0),N(H))}if(Y||N({min:j,max:j}),n.getSheet().getRanges(I).autoFit({orientations:u?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),we(j)){const v={hidden:null},H=Po(b,v);Y||H.push({address:j,update:v}),n.updateHeaderPairs(H)}G?.(j,null,"Resize Column(s)")},[E,n,G,we]),pe=()=>{const j=k===s.IRange.Orientation.Column;return{getColOffset:Y=>j?n.findOffset(Y):Y===0?0:d/L,getColIndex:Y=>j?n.findIndex(Y):0,getRowOffset:Y=>j?Y===0?0:d/L:n.findOffset(Y),getRowIndex:Y=>j?0:n.findIndex(Y)}},[xe,Me]=o.useState(()=>pe()),be=o.useCallback((j,Y)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!Pe(k===s.IRange.Orientation.Column?Y.colIndex:Y.rowIndex),[k,Pe]),Ee=r.useCallbackRef(j=>{a.focusSheet()},[a]),Le=r.useCallbackRef(j=>{P?.getSelection().updateCoords(j)},[P]),{...Ve}=dt.useSelection({gridRef:i,commands:null,layout:xe,selection:Q,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Le,canSelectionSpanMergedCells:j=>{const Y=P.getRange(j);return Y.isEntireColumns()||Y.isEntireRows()}}),C=r.useCallbackRef(()=>{S?.();const j=P?.getSelection();j&&j.setAdjusting(j.getCoords())},[P,S]),Ue=r.useCallbackRef(async()=>{P?.getSelection().setAdjusting(null),w?.()},[P,w]),{...Qe}=dt.useHeaderSelection({orientation:k,headerCount:$,gridRef:O,gridMainRef:i,newSelection:Ve?.newSelection,modifySelection:Ve?.modifySelection,appendSelection:Ve?.appendSelection,clearSelections:Ve?.clearSelections,pointerDownInterceptor:be,onPointerUp:Ee,onDragStart:C,onDragEnd:Ue}),$e=h.selection?.strokeFill;o.useEffect(()=>{if(!O.current)return void W(null);const j=k===s.IRange.Orientation.Column,Y=n.getSelectedRuns(),u=n.isProtected()?null:Se,M=(b,N,v)=>{if(v)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(v.x-h.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(v.width+h.headerSelection.strokeWidth+1,!0)}px`,height:d+h.headerSelection.strokeWidth-.5+"px"}},b):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(v.y-h.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:d+h.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(v.height+h.headerSelection.strokeWidth+1,!0)}px`}},b)},I=(b,N,v)=>{const H={x:0,y:0,width:0,height:0};if(j){const X=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:b,colEnd:Math.min($,N)}),dt.SELECTION_CLIP_INSETS);if(!X)return;H.x=X.x,H.width=X.width}else{const X=v.toClipBounds(v.getRangeCoordsBounds({rowStart:b,rowEnd:Math.min($,N),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!X)return;H.y=X.y,H.height=X.height}return{x:H.x,y:H.y,width:H.width,height:H.height}};W([b=>{const N=[];let v=null,H=j?b.getVisibleColumns():b.getVisibleRows();const X=j?b.getTotalRangeCoords().colStart:b.getTotalRangeCoords().rowStart;H.length>0&&H[0]>X&&(H=[H[0]-1,...H]);let ne=[];const le=[];for(let fe=0;fe<H.length;fe++){const qe=H[fe],Oe=fe<H.length-1?H[fe+1]:qe+ke(qe+1,!1)+1,De=qe+1!==Oe;if(!v||v.max<qe)if(Y.length>0&&Y[Y.length-1].max>=qe){const Ge=ue.CommonUtils.findEqualOrGreater(Y,qe,Ne=>Ne.max);v=Y[Ge]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=qe||v.min<=Oe&&!De)&&(We=!0,je=v.value.isSelectedAll),qe===X){let Ge=!1,Ne=!1;v?.value&&v.min<=qe&&(Ge=!0,Ne=v.value.isSelectedAll),qe>0&&le.push({index:qe-1,isNextHidden:De,isSelected:Ge,isSelectedAll:Ne,disabledResize:!0})}if(je&&ne.push(le.length),le.push({index:qe,isHidden:fe===0&&ke(qe,!1)>0,isNextHidden:De,isSelected:We,isSelectedAll:je,onDividerMouseDown:U,onDividerResizeStart:de,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ce,onDividerAutoFit:he}),De){let Ge=!1,Ne=!1;if(v&&v.min>=qe&&v.max<=Oe-1&&v.value.isSelectedAll&&ne.push(le.length),!(v?.value&&v.max>=Oe))if(Y.length>0&&Y[Y.length-1].max>=Oe){const Xe=ue.CommonUtils.findEqualOrGreater(Y,Oe,it=>it.max);v=Y[Xe]}else v=null;v?.value&&v.min<=Oe&&(Ge=v.value.isSelected,Ne=v.value.isSelectedAll),Oe>0&&le.push({index:Oe-1,isHidden:!0,isSelected:Ge,isSelectedAll:Ne,onDividerMouseDown:U,onDividerResizeStart:de,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ce,onDividerAutoFit:he})}}if(ne.length>0){let fe=ne.length-1;if(ne.length>0){const De=le[ne[fe]].index;let We=null;j?(We=b.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:De,colEnd:De}),We.x+We.width>b.getBounds().width&&(fe-=1,fe===0&&(fe=-1))):(We=b.getRangeCoordsBounds({rowStart:De,rowEnd:De,colStart:0,colEnd:0}),We.y+We.height>b.getBounds().height&&(fe-=1,fe===0&&(fe=-1)))}const qe=Y?.[Y.length-1],Oe=b.getAnchor();if(Oe==="t"||Oe==="l"){const De=le[ne[Math.max(0,ne.length-1)]];De.showTouchDivider=qe&&qe.max<=De.index}else fe>=0&&(le[ne[fe]].showTouchDivider=!0)}const{header:ie,headerSelect:se,headerSelectAll:ye,headerHover:me}=h??{};for(let fe=0;fe<le.length;fe++)N.push(c.jsx(dt.HeaderDivider,{orientation:k,view:b,headerStyle:ie,headerStyleSelect:se,headerStyleSelectAll:ye,headerStyleHover:me,disabled:n.isProtected(),...le[fe]},`divider${fe}`));return N},b=>{const N=[];for(let v=0;Y&&v<Y.length;v++)N.push(M(`selection:${b.getAnchor()}:${v}`,0,I(Y[v].min,Y[v].max,b)));return N}])},[Z,!0,$e,h,xe,$,x,E,L]),o.useEffect(()=>{O.current?.invalidate()},[E]);const J=r.useCallbackRef(j=>g?g(j):n.getTextAt(j),[g,n]),Fe=r.useCallbackRef(j=>{const{header:Y,headerSelect:u,headerSelectAll:M,headerHover:I}=h??{},{range:b,key:N,...v}=j;return c.jsx(dt.HeaderRenderer,{orientation:k,index:k===s.IRange.Orientation.Column?b.colStart:b.rowStart,isSelected:ve,isSelectedAll:Pe,zoomScale:100*L,headerText:J,headerStyle:Y,headerStyleSelect:u,headerStyleSelectAll:M,headerStyleHover:I,verticalPadding:f,horizontalPadding:T,...v},N)},[E,$,h,L,n]),Be=r.useEditMode(),Ie=o.useMemo(()=>{const j="white",Y="black",u={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let M=k===s.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${Y}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Y}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Be.getMode()?.key==="formatPainter"&&(M=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${Y}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),u.cursor=M}return u.backgroundColor=h?.header?.fill||"transparent",u},[k,E,Be,h]),ze=r.useImperativeElement(t,()=>({scrollTo:j=>{O.current?.scrollTo(j)},forceRender:()=>{F()},getGridElement:()=>O.current}),[]),Ae=o.useCallback(j=>{Qe.onPointerDown(j)},[Qe]),R=o.useCallback(j=>{const Y=Qe.getCellCoordsFromClient(j.clientX,j.clientY);if(!Y||!q)return;const u=k===s.IRange.Orientation.Column;q({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:u?-1:Y.rowIndex,colIndex:u?Y.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[Qe,q]),re=o.useMemo(()=>{const j=k===s.IRange.Orientation.Column;return c.jsx("div",{ref:ze,children:c.jsx(dt.Grid,{className:"sheet-header",style:Ie,ref:O,scrollPoint:oe,columnCount:j?$:1,rowCount:j?1:$,width:j?m:d,height:j?d:p,freezeLeft:j?x:void 0,freezeTop:j?void 0:x,hiddenColumnsAt:j?ke:void 0,hiddenRowsAt:j?void 0:ke,showGridLines:!1,layout:xe,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:R,onPointerDown:Ae,zoom:L,cellRenderer:Fe,overlays:K})})},[K,xe,m,p,oe,Ie,Z]);return o.useEffect(()=>{V.current=!1,O.current?.invalidate(),_()},[n,h]),re})),El=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((g,x)=>g.getStyle().getBorder(),[]),{overlay:m}=po({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),p=m(n);return p&&n?p:null})),Fl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Al={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Dl={type:s.ICell.Content.Values},zl={fitDestination:!0,type:s.ICell.Content.Formats},Nl={fitDestination:!0,type:s.ICell.Content.Formulas},Ll={transpose:!0},Ol={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},qr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:p="rgb(33, 115, 70)",copyBackgroundColor:g="white",cutBackgroundColor:x="white",notifier:h,...f})=>{const T=r.useCallbackRef(d,[d]),q=o.useRef(null),A=r.useEditMode(),D=A.getMode(),G=o.useMemo(()=>({element:e,doCopy:w=>{const k=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(k)}}),[t,n,e]),U=o.useMemo(()=>({element:e,importFromExternal:async(w,k)=>{const O=new s.ExternalRangeClipboardItem(w,k,t.getStyles(),t.isDate1904());return await O.parse()?O:null},doPaste:async(w,k)=>{if(w?.getItemType()!=="range")return;k?.contentsOnly&&delete(k={...k,type:s.ICell.Content.Values}).contentsOnly;const O=t.getSelectedRange(),E=w.getItem(),F=E.getName();return await O.doBatch(async()=>{const Z=await O.copyFrom(E,k);!Z||Z.isEntireRows()||Z.isEntireColumns()||Z.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(F?` ${F}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:y,...B}=r.useCopyPaste({...f,source:G,commands:i,target:U,notifier:h,onClipboardUpdate:w=>{const k=w?.getItemType()==="range"?w:null;if(k){const O=w.editMode?.(),E={...w?.isCut?.()?Al:Fl,...O,args:{isClipboard:!0,...O?.args},onModeChange:F=>{F?.args?.isClipboard||y.clear(!0),O?.onModeChange?.(F)}};A.setMode(E)}q.current=k,a?.(k)},onPaste:(w,k)=>{if(w?.getItemType()!=="range")return;let O=A.getMode()?.key==="cut"||w.isCut?.();if(!O&&A.getMode()?.key==="copy"){const E=w.getItem().getCoords(),F=t.getSelectedRanges().getCoords();let Z=!1;if(!Z&&E&&F&&w.getItem().getSource?.()===t)for(let _=0;!Z&&_<F.length;_++)Z=ue.CoordUtils.isRangesIntersect(E,F[_]);O=Z}O&&A.setMode(null),e?.()?.focus(),l?.(w,k)}});o.useMemo(()=>{const w=e;if(!i)return;const k=[new r.Command("pasteValues",w,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
23
20
|
|
|
24
|
-
The formatting is not
|
|
21
|
+
The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",w,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
25
22
|
|
|
26
|
-
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[Q.Ctrl,Q.Shift]}},function(){P(this)}),new ne("freezeToggle",i,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new ne("freezeToggleHorizontal",i,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new ne("freezeToggleVertical",i,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new Ne("unfreeze",i,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new Ne("autoFitRows",i,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new Ne("autoFitColumns",i,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),C=l.useMemo(()=>{let m=null;return m=r?r.createChildGroup(i,"sheet",!1):new nn(i,"sheet"),m.addCommands($e,!0),m},[r,$e]),[We,nt]=l.useState(!1),[Ke,ee]=l.useState(!1);l.useEffect(()=>{if(w.current!==e||!h)return;const m=h.getCoords(),_=e.getTables().search({address:m[0]});R(W=>Ue.isEqualArrays(W,_)?W:_),c&&_[0]&&ut.isCellWithinRange(c,_[0].getRange().getCoords())?oe(_[0]??null):oe(null);const A=e.getSelectedRanges(),x=A.getMerges().length>0,V=A.isOverlapping();let y=!0;for(let W=0;y&&W<m.length;W++)y=ut.isSingleCell(m[W]);ee(V),nt(_.length===0&&!V&&(x||!y))},[De,h,e]),zr(r,null,{onChange:()=>{const m=!e.getProtection().isFormatCellsAllowed(),_=S.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:m||!r?.getCommand("copy"),state:()=>_}).updateCallback(()=>_?void S.setMode(null):C.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[S,Ae,r]),it(e.getView(),{onFreezeSplitChange:()=>{Pe()}}),it(e.getSelection(),{onChange:()=>{G()}});const _e=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>e.getView().getGridLineColor(),context:()=>({onColorSelect:m=>{},darkMode:o.darkMode,autoColor:e.getStyles().parseColor(o.strokeFill),schemeLookup:e.getStyles().schemeLookup(),recentColors:()=>e.getStyles().recentColors(),addRecentColor:m=>e.getStyles().addRecentColor(m),clearRecentColors:()=>e.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(m=>{e.setTabColor(m)}).update({state:()=>e?.getTabColor()??ho,context:()=>({onColorSelect:m=>{},darkMode:o.darkMode,autoColor:ho,schemeLookup:e.getStyles().schemeLookup(),recentColors:()=>e.getStyles().recentColors(),addRecentColor:m=>e.getStyles().addRecentColor(m),clearRecentColors:()=>e.getStyles().clearRecentColors()})})},Ve=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:m=>{$(m)},darkMode:o.darkMode,quickBorder:I,autoColor:e.getStyles().getNormal().getFont().getFill(),autoStyle:p.IBorder.StrokeStyle.Thin,createTemporaryBorder:m=>e.getStyles().getNormal().createTemporaryStyle({border:m}).getBorder(),schemeLookup:e.getStyles().schemeLookup()})})};l.useEffect(()=>{Ve()},[I]),l.useEffect(()=>{const m=!e.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!O().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:m||!O().getHyperlink()});const _=O().getHyperlink()?"Edit":"Insert",A="Link";C.getCommand("updateHyperlink").update({label:()=>(O().getHyperlink(),`${_} ${A}`),scopedLabels:{contextMenu:`${_} ${A}…`,insert:`${A}…`,hyperlink:`${_}…`},disabled:m})},[O()?.getHyperlink(),Ae]),l.useEffect(()=>{const m=O().getComments(),_=()=>m?"Edit":"Insert",A=()=>m?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${_()} ${A()}`,scopedLabels:{contextMenu:`${_()} ${A()}…`,insert:`${A()}…`}})},[O()?.getComments(),Ae]),it(e,{onViewChange:()=>{const m=e.getView();C.getCommand("sheetViewToggleFormulaView").update({state:m.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:m.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:m.isShowColumnGridlines()||m.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:m.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:m.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:m.isShowColumnHeaders()||m.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:m.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:m.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>e.getView().getColumnHeaderStyle()===p.ISheetView.HeaderTextStyle.Zero&&e.getView().getRowHeaderStyle()===p.ISheetView.HeaderTextStyle.Zero}),_e()},onTabColorChange:()=>{_e()},onMergesChange:()=>{Pe()},onMovablesChange:()=>{Pe()},onTablesChange:()=>{Pe()},onProtectionChange:()=>{Pe(),ye()},onStyleChange:()=>{_e(),Ve(),Pe()}}),l.useEffect(()=>{_e(),Ve()},[o]),l.useEffect(()=>{const m=!e.getProtection().isFormatCellsAllowed(),_=N.length>0&&!H||m,A=Te(H),x={context:A};C.getCommand("editTable").update(x),C.getCommand("deleteTable").update(x),C.getCommand("convertTableToRange").update(x);const V={context:A,disabled:_};C.getCommand("formatTableStyle").update({label:H?"Apply Table Style":"Format As Table",...V}),C.getCommand("formatTableStyleClearCellStyles").update(V),C.getCommand("deleteTableStyle").update(V),C.getCommand("convertTableToRange").update(V),C.getCommand("insertTable").update({disabled:_||N.length>0});const y={context:A,disabled:_||N.length===0};C.getCommand("tableHeaderRowToggle").update(y),C.getCommand("tableTotalRowToggle").update(y),C.getCommand("autoFilterToggle").update(y),C.getCommand("formatTableStyleClearTableStyle").update({...y,disabled:y.disabled||!H||H.getStyleOptions().name===null})},[H,N,Ae]),l.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{e.getView().update({zoomScale:Ue.findNextStep(e.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{e.getView().update({zoomScale:Ue.findNextStep(e.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{e.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const m=e.getView().isShowColumnGridlines()&&e.getView().isShowRowGridlines();e.getView().update({showColumnGridlines:!m,showRowGridlines:!m})}),C.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{e.getView().update({showRowGridlines:!e.getView().isShowRowGridlines()})}),C.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{e.getView().update({showColumnGridlines:!e.getView().isShowColumnGridlines()})}),C.getCommand("sheetViewFormatGridlinesColor").updateCallback(m=>{e.getView().update({gridLineColor:m})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const m=e.getView().isShowColumnHeaders()&&e.getView().isShowRowHeaders();e.getView().update({showColumnHeaders:!m,showRowHeaders:!m})}),C.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{e.getView().update({showColumnHeaders:!e.getView().isShowColumnHeaders()})}),C.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{e.getView().update({showRowHeaders:!e.getView().isShowRowHeaders()})}),C.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const m=e.getView().getColumnHeaderStyle()===p.ISheetView.HeaderTextStyle.Zero&&e.getView().getRowHeaderStyle()===p.ISheetView.HeaderTextStyle.Zero;e.getView().update({columnHeaderStyle:m?p.ISheetView.HeaderTextStyle.A1:p.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:m?p.ISheetView.HeaderTextStyle.One:p.ISheetView.HeaderTextStyle.Zero})}),C.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{e.getView().update({showFormulas:!e.getView().isShowFormulas()})}),C.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{e.getView().update({showZeros:!e.getView().isShowZeros()})})},[e]),l.useEffect(()=>{const m=e.getView().getFreezePanes(),_=()=>m.coords.rowIndex!==0,A=()=>m.coords.colIndex!==0,x=()=>m.coords.rowIndex!==0||m.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{x()?e.getView().setFreezePanes(null):x()?A()?e.getView().setFreezePanes({coords:{rowIndex:c.rowIndex}}):_()&&e.getView().setFreezePanes({coords:{colIndex:c.colIndex}}):e.getView().setFreezePanes({coords:c})}).update({state:x,disabled:()=>!c||!x()&&c.rowIndex===0&&c.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{e.getView().setFreezePanes({coords:{rowIndex:_()?0:c.rowIndex}})}).update({state:_,disabled:()=>!c||!_()&&c.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{e.getView().setFreezePanes({coords:{colIndex:A()?0:c.colIndex}})}).update({state:A,disabled:()=>!c||!A()&&c.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{e.getView().setFreezePanes(null)}).update({disabled:()=>!x()})},[De,c,e,o]);const Me=O().getStyle(),Le=Me.getFont(),Ie=Me.getAlignment(),L=Ie.getHorizontal(),se=Ie.getVertical(),U=Ie.getOverflow(),J=Ie.getRotation();return l.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>e.getStyles(),named:()=>O().getStyle(!0).getNamed(),bodyStyle:Re,createTemporaryCell:je=>e.createTemporaryCell(je)})}),C.getCommand("formatFillColor").update({state:()=>{let je=null;const et=Me.getFill();return et?.getType()===p.IFill.Type.Solid?je=et.getColor():et?.getType()===p.IFill.Type.Gradient?je=et.getStops()?.[0]?.getColor():et?.getType()===p.IFill.Type.Pattern&&(je=et.getBackground()),je},context:()=>{const je=e.getStyles();return{onColorSelect:et=>{v(et??ho)},darkMode:o.darkMode,quickColor:D,autoColor:ho,schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:et=>je.addRecentColor(et),clearRecentColors:()=>je.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>Le.toJSON()?.fill?Le.getFill():null,context:()=>{const je=e.getStyles();return{onColorSelect:et=>{E(et)},darkMode:o.darkMode,quickColor:F,autoColor:je.getNormal().getFont().getFill(),schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:et=>je.addRecentColor(et),clearRecentColors:()=>je.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>Me.getNumberFormat(),context:()=>O}),C.getCommand("formatNumberDialog").update({state:()=>Me.getNumberFormat(),context:()=>O}),C.getCommand("formatFontFamily").update({state:()=>Le.getFamily()}),C.getCommand("formatFontSize").update({state:()=>Le.getSize()});const m=function(){const je=Le.getWeight()||0;return!isNaN(je)&&je>500};C.getCommand("formatBoldToggle").updateCallback(function(){z(this,{font:{weight:m()?400:700}})}).update({state:m});const _=function(){return Le.getStyle()===p.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){z(this,{font:{style:_()?p.IFont.Style.Normal:p.IFont.Style.Italic}})}).update({state:_}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){z(this,{font:{strike:!Le.getStrike()}})}).update({state:Le.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){z(this,{font:{underline:Le.getUnderline()!==p.IFont.UnderlineStyle.Single?p.IFont.UnderlineStyle.Single:p.IFont.UnderlineStyle.None}})}).update({state:Le.getUnderline()===p.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){z(this,{font:{underline:Le.getUnderline()!==p.IFont.UnderlineStyle.Double?p.IFont.UnderlineStyle.Double:p.IFont.UnderlineStyle.None}})}).update({state:Le.getUnderline()===p.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){z(this,{font:{underline:Le.getUnderline()!==p.IFont.UnderlineStyle.SingleAccounting?p.IFont.UnderlineStyle.SingleAccounting:p.IFont.UnderlineStyle.None}})}).update({state:Le.getUnderline()===p.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){z(this,{font:{underline:Le.getUnderline()!==p.IFont.UnderlineStyle.DoubleAccounting?p.IFont.UnderlineStyle.DoubleAccounting:p.IFont.UnderlineStyle.None}})}).update({state:Le.getUnderline()===p.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){z(this,{font:{verticalAlign:Le.getVerticalAlignment()!==p.IFont.VerticalAlignment.Super?p.IFont.VerticalAlignment.Super:p.IFont.VerticalAlignment.Baseline}})}).update({state:Le.getVerticalAlignment()===p.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){z(this,{font:{verticalAlign:Le.getVerticalAlignment()!==p.IFont.VerticalAlignment.Sub?p.IFont.VerticalAlignment.Sub:p.IFont.VerticalAlignment.Baseline}})}).update({state:Le.getVerticalAlignment()===p.IFont.VerticalAlignment.Sub});const A=()=>U===p.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){z(this,{alignment:{overflow:(A(),p.ITextFrame.Overflow.Visible)}})}).update({state:A});const x=()=>U===p.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){z(this,{alignment:{overflow:x()?p.ITextFrame.Overflow.Visible:p.ITextFrame.Overflow.Wrap}})}).update({state:x});const V=function(){return U===p.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){z(this,{alignment:{overflow:V()?p.ITextFrame.Overflow.Visible:p.ITextFrame.Overflow.Clip}})}).update({state:V});const y=function(){return U===p.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){z(this,{alignment:{overflow:y()?p.ITextFrame.Overflow.Visible:p.ITextFrame.Overflow.Shrink}})}).update({state:y});const W=function(){return U===p.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){z(this,{alignment:{overflow:W()?p.ITextFrame.Overflow.Visible:p.ITextFrame.Overflow.Ellipsis}})}).update({state:W,disabled:!0});const Y=function(){return se===p.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){z(this,{alignment:{vertical:Y()?p.ITextFrame.VerticalAlignment.Bottom:p.ITextFrame.VerticalAlignment.Top}})}).update({state:Y});const ie=function(){return se===p.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){z(this,{alignment:{vertical:ie()?p.ITextFrame.VerticalAlignment.Bottom:p.ITextFrame.VerticalAlignment.Center}})}).update({state:ie});const de=function(){return se===p.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){z(this,{alignment:{vertical:(de(),p.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:de});const ce=function(){return se===p.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){z(this,{alignment:{vertical:ce()?p.ITextFrame.VerticalAlignment.Bottom:p.ITextFrame.VerticalAlignment.Justify}})}).update({state:ce});const he=function(){return se===p.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){z(this,{alignment:{vertical:he()?p.ITextFrame.VerticalAlignment.Bottom:p.ITextFrame.VerticalAlignment.Distributed}})}).update({state:he});const be=function(){return L===p.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){z(this,{alignment:{horizontal:be()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Left}})}).update({state:be});const ve=function(){return L===p.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){z(this,{alignment:{horizontal:ve()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Center}})}).update({state:ve});const we=function(){return L===p.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const je={alignment:{horizontal:we()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};z(this,je)}).update({state:we});const qe=function(){return L===p.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const je={alignment:{horizontal:qe()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Fill,rotation:null}};z(this,je)}).update({state:qe});const Be=function(){return L===p.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){z(this,{alignment:{horizontal:Be()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Be});const ze=function(){return L===p.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){z(this,{alignment:{horizontal:ze()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Right}})}).update({state:ze});const Ze=function(){return L===p.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){z(this,{alignment:{horizontal:Ze()?p.ITextFrame.HorizontalAlignment.General:p.ITextFrame.HorizontalAlignment.Justify}})}).update({state:Ze});const He=!e.getProtection().isFormatCellsAllowed(),Ye=L===p.ITextFrame.HorizontalAlignment.CenterContinuous||L===p.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(je){z(this,{alignment:{rotation:0}})}).update({disabled:He||Ye,state:J===0}),C.getCommand("formatTextRotate45").updateCallback(function(je){z(this,{alignment:{rotation:je??1?45:0}})}).update({disabled:He||Ye,state:J===45}),C.getCommand("formatTextRotate90").updateCallback(function(je){z(this,{alignment:{rotation:je??1?90:0}})}).update({disabled:He||Ye,state:J===90}),C.getCommand("formatTextRotate270").updateCallback(function(je){z(this,{alignment:{rotation:je??1?270:0}})}).update({disabled:He||Ye,state:J===270}),C.getCommand("formatTextRotate315").updateCallback(function(je){z(this,{alignment:{rotation:je??1?315:0}})}).update({disabled:He||Ye,state:J===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(je){z(this,{alignment:{rotation:je}})}).update({disabled:He||Ye,state:J??0})},[Me,e,o,D,F]),l.useEffect(()=>{const m=!e.getProtection().isFormatCellsAllowed(),_=e.getSelectedRanges().getMerges().length>0,A=async(Xe,at)=>{j(at,async Tt=>{const _t=async(yt=!1)=>{const dt=await Promise.resolve(s?.showBusy?.(at.label()));try{const Bt=Tt.getSelectedRanges();if(Bt.merge({orientations:Xe,discardMultipleValues:yt}),Xe===p.IRange.Orientations.Both){const on={alignment:{horizontal:p.ITextFrame.HorizontalAlignment.Center}};Bt.updateStyle(on)}}catch(Bt){throw Bt}finally{dt?.()}};let Mt;try{await _t()}catch(yt){if(yt.type!=="discardMultipleValues")throw yt;Mt=!0}if(Mt&&s?.showOptions){if(await s?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await _t(!0)}},void 0,void 0,!1)},x=Xe=>{j(Xe,async at=>{try{const Tt=at.getSelectedRanges();Tt.unmerge();const _t={alignment:{horizontal:null}};Tt.updateStyle(_t)}catch(Tt){throw Tt}})};C.getCommand("mergeToggle").updateCallback(function(){ut.isSingleCell(e.getSelectedRange().getCoords())||(_?x(this):A(p.IRange.Orientations.Both,this))}).update({state:_,disabled:!We||m}),C.getCommand("mergeHorizontal").updateCallback(function(){A(p.IRange.Orientations.Column,this)}).update({disabled:!We||m}),C.getCommand("mergeVertical").updateCallback(function(){A(p.IRange.Orientations.Row,this)}).update({disabled:!We}),C.getCommand("unmerge").updateCallback(function(){x(this)}).update({disabled:!_||!We||m});const V={disabled:m};C.getCommand("hideRows").updateCallback(function(){j(this,Xe=>{Xe.getRowHeaders().setHidden(Xe.getSelectedRanges().getCoords(),!0)})}).update(V),C.getCommand("hideColumns").updateCallback(function(){j(this,Xe=>{Xe.getColumnHeaders().setHidden(Xe.getSelectedRanges().getCoords(),!0)})}).update(V),C.getCommand("unhideRows").updateCallback(function(){j(this,Xe=>{Xe.getRowHeaders().setHidden(Xe.getSelectedRanges().getCoords(),!1)})}).update(V),C.getCommand("unhideColumns").updateCallback(function(){j(this,Xe=>{Xe.getColumnHeaders().setHidden(Xe.getSelectedRanges().getCoords(),!1)})}).update(V),C.getCommand("autoFitRows").updateCallback(function(){j(this,Xe=>{Xe.getSelectedRanges().autoFit({orientations:p.IRange.Orientations.Row})})}).update(V),C.getCommand("autoFitColumns").updateCallback(function(){j(this,Xe=>{Xe.getSelectedRanges().autoFit({orientations:p.IRange.Orientations.Column})})}).update(V);let y=!1,W=0,Y=!1,ie=!1,de=0,ce=!1;!h||m||Ke||(y=h.isEntireColumnsAny(),y&&!h.isEntireColumns()?Y=!0:W=h.getColumnCount(),ie=h.isEntireRowsAny(),ie&&!h.isEntireRows()?ce=!0:de=h.getRowCount());const he={disabled:m||h&&h.getCount()!==1};C.getCommand("sortAscending").update(he),C.getCommand("sortDescending").update(he);const be={disabled:y||ie||m||Ke},ve=y||m||Ke||ce;ve&&(W=1);const we=ie||m||Ke||Y;we&&(de=1);let qe="",Be="",ze="",Ze="",He="",Ye="",je="",et="",ht="";W>1&&(Ye=Be=W+" ",je=ze="s"),de>1&&(et=Ze=de+" ",ht=He="s"),S.getMode()?.key==="copy"?(qe=Ze=Be="Copied ",ze=He="s"):S.getMode()?.key==="cut"&&(qe=Ze=Be="Cut ",ze=He="s");let Et="",Dt="";if(h){const Xe=h.getDefaultShiftOrientation()===p.IRange.Orientation.Column;Et=` (${Xe?"Shift Right":"Shift Down"})`,Dt=` (${Xe?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${Dt}`})}C.getCommand("insertCells").update({label:`Insert ${qe}Cells${Et}`,scopedLabels:{insertCells:`${qe}At Selection`}}),C.getCommand("insertCellsShiftRight").update(be),C.getCommand("insertCellsShiftDown").update(be),C.getCommand("deleteCellsShiftUp").update(be),C.getCommand("deleteCellsShiftLeft").update(be),C.getCommand("insertRows").update({label:`Insert ${Ze}Row${He}`,scopedLabels:{insertCells:`${Ze}Row${He}`},disabled:we}),C.getCommand("insertRowsAfter").update({label:`Insert ${Ze}Row${He} Below`,disabled:we}),C.getCommand("insertColumns").update({label:`Insert ${Be}Column${ze}`,scopedLabels:{insertCells:`${Be}Column${ze}`},disabled:ve}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Be}Column${ze} After`,disabled:ve}),C.getCommand("deleteRows").update({label:`Delete ${et}Row${ht}`,scopedLabels:{deleteCells:`${et}Row${ht}`},disabled:we}),C.getCommand("deleteColumns").update({label:`Delete ${Ye}Column${je}`,scopedLabels:{deleteCells:`${Ye}Column${je}`},disabled:ve})},[De,We,Ke,h,S,s,Ae]),l.useEffect(()=>{const m=e.getProtection(),_=e.getProtection().isLocked(),A=!m.isFormatCellsAllowed(),x={disabled:A};C.getCommand("protectionSheetToggle").updateCallback(async(W,Y)=>{let ie=null;try{if(_){let de=null;if(m.hasPassword()){const ce=await s?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ce.option!=="Unprotect")return;de=ce.input}ie=await Promise.resolve(s?.showBusy?.(Y.label())),await m.unlock(de)}else ie=await Promise.resolve(s?.showBusy?.(Y.label())),await m.lock();ie?.()}catch(de){ie?.(),s?.showError?.(de)}}).update({state:_,label:()=>_?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:_?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(x),C.getCommand("sortAscending").update(x),C.getCommand("sortDescending").update(x),C.getCommand("sortCustom")?.update(x),C.getCommand("updateComments").update(x),C.getCommand("deleteComments").update(x),C.getCommand("insertChart")?.update(x),C.getCommand("insertImageFromFile").update(x),C.getCommand("insertImageFromURL").update(x),C.getCommand("formatBorder").update(x),C.getCommand("formatFillColor").update(x),C.getCommand("formatFontColor").update(x),C.getCommand("formatBoldToggle").update(x),C.getCommand("formatItalicToggle").update(x),C.getCommand("formatUnderlinedToggle").update(x),C.getCommand("formatStrikeThroughToggle").update(x),C.getCommand("formatSuperscriptToggle").update(x),C.getCommand("formatSubscriptToggle").update(x),C.getCommand("formatAlignTopToggle").update(x),C.getCommand("formatTextOverflowVisibleToggle").update(x),C.getCommand("formatTextOverflowWrapToggle").update(x),C.getCommand("formatTextOverflowClipToggle").update(x),C.getCommand("formatTextOverflowShrinkToggle").update(x),C.getCommand("formatAlignMiddleToggle").update(x),C.getCommand("formatAlignBottomToggle").update(x),C.getCommand("formatAlignDistributedVerticalToggle").update(x),C.getCommand("formatAlignJustifyVerticalToggle").update(x),C.getCommand("formatAlignLeftToggle").update(x),C.getCommand("formatAlignCenterToggle").update(x),C.getCommand("formatAlignRightToggle").update(x),C.getCommand("formatAlignJustifyToggle").update(x),C.getCommand("formatAlignCenterContinuousToggle").update(x),C.getCommand("formatAlignDistributedHorizontalToggle").update(x),C.getCommand("formatAlignFillToggle").update(x),C.getCommand("formatFontSizeIncrease").update(x),C.getCommand("formatFontSizeDecrease").update(x),C.getCommand("formatFontFamily").update(x),C.getCommand("formatFontSize").update(x),C.getCommand("formatNumberFormat").update(x),C.getCommand("formatNumberFormatGeneralStyle").update(x),C.getCommand("formatNumberFormatNumberStyle").update(x),C.getCommand("formatNumberFormatTimeStyle").update(x),C.getCommand("formatNumberFormatDateStyle").update(x),C.getCommand("formatNumberFormatAccountingStyle").update(x),C.getCommand("formatNumberFormatPercentStyle").update(x),C.getCommand("formatNumberFormatScientificStyle").update(x),C.getCommand("formatNumberFormatCommaStyle").update(x),C.getCommand("formatNumberFormatIncreaseDecimal").update(x),C.getCommand("formatNumberFormatDecreaseDecimal").update(x),C.getCommand("hideColumns").update(x),C.getCommand("unhideColumns").update(x),C.getCommand("hideRows").update(x),C.getCommand("unhideRows").update(x),C.getCommand("quickFormulaSum").update(x),C.getCommand("quickFormulaAverage").update(x),C.getCommand("quickFormulaCount").update(x),C.getCommand("quickFormulaMax").update(x),C.getCommand("quickFormulaMin").update(x),C.getCommand("startEditCurrentTime").update(x),C.getCommand("startEditCurrentDate").update(x),C.getCommand("startEditValueAbove").update(x),C.getCommand("fillDown").update(x),C.getCommand("fillRight").update(x),C.getCommand("fillUp").update(x),C.getCommand("fillLeft").update(x),C.getCommand("formatCellStyle").update(x),C.getCommand("formatTableStyle").update(x),C.getCommand("formatPainterToggle").update(x),C.getCommand("formatBorderAddOutline").update(x),C.getCommand("formatBorderClearOutline").update(x),C.getCommand("formatIndentDecrease").update(x),C.getCommand("formatIndentIncrease").update(x),C.getCommand("clearContents").update(x),C.getCommand("clearFormats").update(x),C.getCommand("clearAll").update(x),C.getCommand("clearComments").update(x),C.getCommand("clearHyperlinks").update(x),C.getCommand("autoFilterClear").update(x),C.getCommand("autoFilterReapply").update(x);const V=L===p.ITextFrame.HorizontalAlignment.CenterContinuous||L===p.ITextFrame.HorizontalAlignment.Fill,y={disabled:A||V};C.getCommand("formatTextRotate0").update(y),C.getCommand("formatTextRotate45").update(y),C.getCommand("formatTextRotate90").update(y),C.getCommand("formatTextRotate270").update(y),C.getCommand("formatTextRotate315").update(y),C.getCommand("formatTextRotateCustom").update(y),C.getCommand("formatTextRotateVertical").update(y)},[De]),C}var Fi,Di;(function(){if(Di)return Fi;Di=1;var t=/^\s+|\s+$/g,e=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof On=="object"&&On&&On.Object===Object&&On,s=typeof self=="object"&&self&&self.Object===Object&&self,a=i||s||Function("return this")(),d=Object.prototype.toString,c=Math.max,f=Math.min,h=function(){return a.Date.now()};function u(b){var q=typeof b;return!!b&&(q=="object"||q=="function")}function w(b){if(typeof b=="number")return b;if(function($){return typeof $=="symbol"||function(D){return!!D&&typeof D=="object"}($)&&d.call($)=="[object Symbol]"}(b))return NaN;if(u(b)){var q=typeof b.valueOf=="function"?b.valueOf():b;b=u(q)?q+"":q}if(typeof b!="string")return b===0?b:+b;b=b.replace(t,"");var I=n.test(b);return I||o.test(b)?r(b.slice(2),I?2:8):e.test(b)?NaN:+b}Fi=function(b,q,I){var $,D,v,F,E,S,k=0,N=!1,R=!1,T=!0;if(typeof b!="function")throw new TypeError("Expected a function");function G(Z){var P=$,M=D;return $=D=void 0,k=Z,F=b.apply(M,P)}function O(Z){var P=Z-S;return S===void 0||P>=q||P<0||R&&Z-k>=v}function j(){var Z=h();if(O(Z))return z(Z);E=setTimeout(j,function(P){var M=q-(P-S);return R?f(M,v-(P-k)):M}(Z))}function z(Z){return E=void 0,T&&$?G(Z):($=D=void 0,F)}function B(){var Z=h(),P=O(Z);if($=arguments,D=this,S=Z,P){if(E===void 0)return function(M){return k=M,E=setTimeout(j,q),N?G(M):F}(S);if(R)return E=setTimeout(j,q),G(S)}return E===void 0&&(E=setTimeout(j,q)),F}return q=w(q)||0,u(I)&&(N=!!I.leading,v=(R="maxWait"in I)?c(w(I.maxWait)||0,q):v,T="trailing"in I?!!I.trailing:T),B.cancel=function(){E!==void 0&&clearTimeout(E),k=0,$=S=D=E=void 0},B.flush=function(){return E===void 0?F:z(h())},B}})();var Ai,Li,zi={exports:{}},rr={};Li||(Li=1,zi.exports=function(){if(Ai)return rr;Ai=1;var t=l,e=typeof Object.is=="function"?Object.is:function(d,c){return d===c&&(d!==0||1/d==1/c)||d!=d&&c!=c},n=t.useState,o=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function s(d){var c=d.getSnapshot;d=d.value;try{var f=c();return!e(d,f)}catch{return!0}}var a=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(d,c){return c()}:function(d,c){var f=c(),h=n({inst:{value:f,getSnapshot:c}}),u=h[0].inst,w=h[1];return r(function(){u.value=f,u.getSnapshot=c,s(u)&&w({inst:u})},[d,f,c]),o(function(){return s(u)&&w({inst:u}),d(function(){s(u)&&w({inst:u})})},[d]),i(f),f};return rr.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:a,rr}()),zi.exports;var Oi,ji,Ln={exports:{}},mn={exports:{}},ic=mn.exports;function Ni(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}(function(){if(ji)return Ln.exports;ji=1;for(var t=(Oi||(Oi=1,function(){var h,u,w,b,q,I;typeof performance<"u"&&performance!==null&&performance.now?mn.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(mn.exports=function(){return(h()-q)/1e6},u=process.hrtime,b=(h=function(){var $;return 1e9*($=u())[0]+$[1]})(),I=1e9*process.uptime(),q=b-I):Date.now?(mn.exports=function(){return Date.now()-w},w=Date.now()):(mn.exports=function(){return new Date().getTime()-w},w=new Date().getTime())}.call(ic)),mn.exports),e=typeof window>"u"?On:window,n=["moz","webkit"],o="AnimationFrame",r=e["request"+o],i=e["cancel"+o]||e["cancelRequest"+o],s=0;!r&&s<n.length;s++)r=e[n[s]+"Request"+o],i=e[n[s]+"Cancel"+o]||e[n[s]+"CancelRequest"+o];if(!r||!i){var a=0,d=0,c=[],f=1e3/60;r=function(h){if(c.length===0){var u=t(),w=Math.max(0,f-(u-a));a=w+u,setTimeout(function(){var b=c.slice(0);c.length=0;for(var q=0;q<b.length;q++)if(!b[q].cancelled)try{b[q].callback(a)}catch(I){setTimeout(function(){throw I},0)}},Math.round(w))}return c.push({handle:++d,callback:h,cancelled:!1}),d},i=function(h){for(var u=0;u<c.length;u++)c[u].handle===h&&(c[u].cancelled=!0)}}Ln.exports=function(h){return r.call(e,h)},Ln.exports.cancel=function(){i.apply(e,arguments)},Ln.exports.polyfill=function(h){h||(h=e),h.requestAnimationFrame=r,h.cancelAnimationFrame=i},Ln.exports})();const Pr=l.memo(l.forwardRef((t,e)=>{const{style:n=Qe.EmptyCssProperties,orientation:o,sheet:r,onShowTooltip:i,onCloseTooltip:s,onScrollOffset:a,showCustomScrollButtons:d=!1,offset:c=0,totalSize:f=0,viewportSize:h=0,...u}=t;if(!r)throw new Error("SheetScrollBar needs a sheet model");const[w]=en(),b=X(i,[i]),q=X(s,[s]),I=($=w,D=e,l.useMemo(()=>$===null&&D===null?null:K=>{Ni($,K),Ni(D,K)},[$,D]));var $,D;const[v,F]=l.useState(()=>{const K=r.getView().getTopLeft();return o===wt.Vertical?K.top:K.left}),E=()=>{const K=r.getView().getFreezePanes();return o===wt.Vertical?K.coords.rowIndex===0?{shift:0,scroll:0}:{shift:r.getRowHeaders().findOffset(K.coords.rowIndex)-K.topLeft.top,scroll:K.topLeft.top}:K.coords.colIndex===0?{shift:0,scroll:0}:{shift:r.getColumnHeaders().findOffset(K.coords.colIndex)-K.topLeft.left,scroll:K.topLeft.left}},[S,k]=l.useState(E),[N,R]=l.useState(null),[T,G]=l.useState(!1),O=o===wt.Vertical?r.getRowHeaders():r.getColumnHeaders(),j=()=>{const K=r.getUsedRange()?.getCoords()??ut.EmptyRange,le=r.getSelection().getCoords().cell;return{colIndex:Math.max(K.colEnd,le.colIndex),rowIndex:Math.max(K.rowEnd,le.rowIndex)}},[z,B]=l.useState(j),Z=z?(o===wt.Vertical?z.rowIndex:z.colIndex)+1:0,P=()=>{const K=j();ut.isEqualCells(z,K)||B(K)};it(r.getView(),{onFreezeSplitChange:()=>{k(E)}}),it(r.getSelection(),{onChange:P}),it(r,{onUsedRangeChange:P}),l.useEffect(()=>{B(j())},[r]),l.useEffect(()=>{if(!N)return T&&q?.(),void G(!1);const K=O.getTextAt(O.findIndex(v/(r.getView().getZoomScale()/100)+S.scroll+S.shift));G(!0),b?.({...N,display:(o===wt.Vertical?"Row":"Column")+": "+K})},[c,v,S,o,N,O,T,r]);const M=X((K,le,Re)=>{F(K);const Te=K+S.scroll,ae=le+S.shift,Fe=Re+S.shift+S.scroll;a?.(Te,ae,Fe)},[a,S]),H=c-S.scroll,oe=h-S.shift,ue=f-(S.shift+S.scroll),te=O.findOffset(Z)*(r.getView().getZoomScale()/100)-(S.scroll+S.shift);return g.jsx(Lr,{ref:I,style:n,offset:H,viewportSize:oe,totalSize:ue,orientation:o,showCustomScrollButtons:d,onMouseDown:K=>{R({anchor:{x:K.clientX,y:K.clientY}}),K.preventDefault()},onScrollOffset:M,onMouseOut:()=>{R(null)},onMouseUp:()=>{R(null)},minSize:te,...u})}));Pr.displayName="SheetScrollbar";const Pi=(t,e,n=null)=>{const o=[];for(let r=0;r<t.length;r++)if(t[r].value.isSelectedAll){if(t[r].min===t[r].max&&t[r].min===n)continue;o.push({address:{min:t[r].min,max:t[r].max},update:e})}return o},Bi=l.memo(l.forwardRef((t,e)=>{const{sheetHeader:n,gridRef:o,sheetElement:r,commands:i,oppositeSize:s=30,containerWidth:a,containerHeight:d,headerText:c,freezeStart:f,gridStyle:h,verticalPadding:u,horizontalPadding:w,onSheetContextMenu:b,onResizeHeadersStart:q,onResizeHeaders:I,onResizeHeadersEnd:$,onResizeHeadersDown:D,onResizeHeadersUp:v,scrollPoint:F,onSelectionStart:E,onSelectionEnd:S}=t,k=l.useMemo(()=>n.getOrientation(),[n]),N=l.useRef(null),[R,T]=l.useReducer(U=>U+1,0),[G,O]=l.useReducer(U=>U+1,0),j=n?.getSheet(),z=l.useRef(!1);l.useLayoutEffect(()=>{z.current=!0},[n]);const B=l.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),Z=l.useMemo(()=>{const U=k===p.IRange.Orientation.Column;return{left:U?F.left:0,top:U?0:F.top}},[F]),[P,M]=l.useState(j?.getView().getZoomScale()/100),[H,oe]=l.useState(null);it(n,{onSizesChange:U=>{M(j?.getView().getZoomScale()/100),Ae(pe())}});const ue=l.useCallback(()=>{N.current?.invalidate(),O()},[]),te=l.useCallback(Ue.debounce(()=>{ue()},10),[]),[K,le]=l.useState(null);it(n.getSheet(),{onSelectionChange(){le(j?.getSelection().getCoords()),te()},onProtectionChange(){ue()},onViewChange(){te()}}),l.useLayoutEffect(()=>{Ae(pe())},[k,P,s]),l.useLayoutEffect(()=>{oe(null),M(n?.getSheet().getView().getZoomScale()/100),Ae(pe())},[n]);const Re=l.useCallback(U=>n.at(U)?.isHidden()||n.at(U)?.getSize()===0,[n]),Te=l.useCallback((U,J)=>n.hiddenHeadersAt(U,J),[Re]),ae=X(U=>n.isSelected(U),[n]),Fe=X(U=>n.isSelectedAll(U),[n]),me=l.useCallback(()=>n.getMinSize(),[n]),Oe=l.useCallback(()=>n.getMaxSize(),[n]),xe=X((U,J,m)=>{J/=P;const _={size:J=Math.max(me(),Math.min(Ue.roundAccurately(J,me()),Oe())),hidden:!1},A=[];if(J<=0&&(_.hidden=!0,_.size=m),A.push({address:{min:U,max:U},update:_}),J<0){const x=k===p.IRange.Orientation.Column,V=x?Ce.getColOffset:Ce.getRowOffset,y=x?Ce.getColIndex:Ce.getRowIndex,W=V(U);let Y=y(W+J);const ie=V(Y);ie===W+J?Y--:A.push({address:{min:Y,max:Y},update:{size:W-ie+J}}),U-Y>1&&A.push({address:{min:Y+1,max:U-1},update:{hidden:!0}})}n.updateHeaderPairs(A),I?.(U,J,m)},[R,n,P,I]),ge=X((U,J,m)=>{const _=k===p.IRange.Orientation.Column;let A=null,x={min:U,max:U};if(n.isSelectedAll(U)){const V=n.getSelectedRuns();V.length>1?A="Resize "+(_?"Columns":"Rows"):x=V[0];const y={hidden:J<=0,size:(J<=0?m:J)/P};n.updateHeaderPairs(Pi(V,y,U))}if(x){const V=x.max-x.min+1;let y;y=V===1?n.getRange(x).at(0).getDisplayText():n.getRange(x).toString(),A=`Resize ${_?"Column":"Row"}${V>1?"s":""} '${y}'`}$?.(U,J,A)},[R,n,$]),fe=X((U,J)=>{const m=k===p.IRange.Orientation.Column;q(U,J,`Resize ${m?"Column":"Row"}(s)`)},[q]),Se=X(U=>{let J=!1;const m=k===p.IRange.Orientation.Column,_=n.getSheet().getEntireRange().getCoords(),A=[],x=n.getSelectedRuns(),V=y=>{let W;W=m?{colStart:y.min,rowStart:_.rowStart,colEnd:y.max,rowEnd:_.rowEnd}:{colStart:_.colStart,rowStart:y.min,colEnd:_.colEnd,rowEnd:y.max},A.push(W)};for(let y=0;y<x.length;y++){const W=x[y];W.value.isSelectedAll&&(W.min<=U&&W.max>=U&&(J=!0),V(W))}if(J||V({min:U,max:U}),n.getSheet().getRanges(A).autoFit({orientations:m?p.IRange.Orientations.Column:p.IRange.Orientations.Row}),Re(U)){const y={hidden:null},W=Pi(x,y);J||W.push({address:U,update:y}),n.updateHeaderPairs(W)}$?.(U,null,"Resize Column(s)")},[R,n,$,Re]),pe=()=>{const U=k===p.IRange.Orientation.Column;return{getColOffset:J=>U?n.findOffset(J):J===0?0:s/P,getColIndex:J=>U?n.findIndex(J):0,getRowOffset:J=>U?J===0?0:s/P:n.findOffset(J),getRowIndex:J=>U?0:n.findIndex(J)}},[Ce,Ae]=l.useState(()=>pe()),ye=l.useCallback((U,J)=>U.nativeEvent.which!==_r.Right||!Fe(k===p.IRange.Orientation.Column?J.colIndex:J.rowIndex),[k,Fe]),De=X(U=>{r.focusSheet()},[r]),Pe=X(U=>{j?.getSelection().updateCoords(U)},[j]),{...$e}=ft.useSelection({gridRef:o,commands:null,layout:Ce,selection:K,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Pe,canSelectionSpanMergedCells:U=>{const J=j.getRange(U);return J.isEntireColumns()||J.isEntireRows()}}),C=X(()=>{E?.();const U=j?.getSelection();U&&U.setAdjusting(U.getCoords())},[j,E]),We=X(async()=>{j?.getSelection().setAdjusting(null),S?.()},[j,S]),{...nt}=ft.useHeaderSelection({orientation:k,headerCount:B,gridRef:N,gridMainRef:o,newSelection:$e?.newSelection,modifySelection:$e?.modifySelection,appendSelection:$e?.appendSelection,clearSelections:$e?.clearSelections,pointerDownInterceptor:ye,onPointerUp:De,onDragStart:C,onDragEnd:We}),Ke=h.selection?.strokeFill;l.useEffect(()=>{if(!N.current)return void oe(null);const U=k===p.IRange.Orientation.Column,J=n.getSelectedRuns(),m=n.isProtected()?null:xe,_=(x,V,y)=>{if(y)return U?g.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${Ke}`,pointerEvents:"none",top:`${Qe.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${Qe.boundPixel(y.x-h.headerSelection.strokeWidth)}px`,width:`${Qe.boundPixel(y.width+h.headerSelection.strokeWidth+1,!0)}px`,height:s+h.headerSelection.strokeWidth-.5+"px"}},x):g.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${Ke}`,pointerEvents:"none",top:`${Qe.boundPixel(y.y-h.headerSelection.strokeWidth)}px`,left:`${Qe.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:s+h.headerSelection.strokeWidth-.5+"px",height:`${Qe.boundPixel(y.height+h.headerSelection.strokeWidth+1,!0)}px`}},x)},A=(x,V,y)=>{const W={x:0,y:0,width:0,height:0};if(U){const Y=y.toClipBounds(y.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:x,colEnd:Math.min(B,V)}),ft.SELECTION_CLIP_INSETS);if(!Y)return;W.x=Y.x,W.width=Y.width}else{const Y=y.toClipBounds(y.getRangeCoordsBounds({rowStart:x,rowEnd:Math.min(B,V),colStart:0,colEnd:0}),ft.SELECTION_CLIP_INSETS);if(!Y)return;W.y=Y.y,W.height=Y.height}return{x:W.x,y:W.y,width:W.width,height:W.height}};oe([x=>{const V=[];let y=null,W=U?x.getVisibleColumns():x.getVisibleRows();const Y=U?x.getTotalRangeCoords().colStart:x.getTotalRangeCoords().rowStart;W.length>0&&W[0]>Y&&(W=[W[0]-1,...W]);let ie=[];const de=[];for(let we=0;we<W.length;we++){const qe=W[we],Be=we<W.length-1?W[we+1]:qe+Te(qe+1,!1)+1,ze=qe+1!==Be;if(!y||y.max<qe)if(J.length>0&&J[J.length-1].max>=qe){const Ye=Ue.findEqualOrGreater(J,qe,je=>je.max);y=J[Ye]}else y=null;let Ze=!1,He=!1;if(y?.value&&(y.min<=qe||y.min<=Be&&!ze)&&(Ze=!0,He=y.value.isSelectedAll),qe===Y){let Ye=!1,je=!1;y?.value&&y.min<=qe&&(Ye=!0,je=y.value.isSelectedAll),qe>0&&de.push({index:qe-1,isNextHidden:ze,isSelected:Ye,isSelectedAll:je,disabledResize:!0})}if(He&&ie.push(de.length),de.push({index:qe,isHidden:we===0&&Te(qe,!1)>0,isNextHidden:ze,isSelected:Ze,isSelectedAll:He,onDividerMouseDown:D,onDividerResizeStart:fe,onDividerResize:m,onDividerMouseUp:v,onDividerResizeEnd:ge,onDividerAutoFit:Se}),ze){let Ye=!1,je=!1;if(y&&y.min>=qe&&y.max<=Be-1&&y.value.isSelectedAll&&ie.push(de.length),!(y?.value&&y.max>=Be))if(J.length>0&&J[J.length-1].max>=Be){const et=Ue.findEqualOrGreater(J,Be,ht=>ht.max);y=J[et]}else y=null;y?.value&&y.min<=Be&&(Ye=y.value.isSelected,je=y.value.isSelectedAll),Be>0&&de.push({index:Be-1,isHidden:!0,isSelected:Ye,isSelectedAll:je,onDividerMouseDown:D,onDividerResizeStart:fe,onDividerResize:m,onDividerMouseUp:v,onDividerResizeEnd:ge,onDividerAutoFit:Se})}}if(ie.length>0){let we=ie.length-1;if(ie.length>0){const ze=de[ie[we]].index;let Ze=null;U?(Ze=x.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:ze,colEnd:ze}),Ze.x+Ze.width>x.getBounds().width&&(we-=1,we===0&&(we=-1))):(Ze=x.getRangeCoordsBounds({rowStart:ze,rowEnd:ze,colStart:0,colEnd:0}),Ze.y+Ze.height>x.getBounds().height&&(we-=1,we===0&&(we=-1)))}const qe=J?.[J.length-1],Be=x.getAnchor();if(Be==="t"||Be==="l"){const ze=de[ie[Math.max(0,ie.length-1)]];ze.showTouchDivider=qe&&qe.max<=ze.index}else we>=0&&(de[ie[we]].showTouchDivider=!0)}const{header:ce,headerSelect:he,headerSelectAll:be,headerHover:ve}=h??{};for(let we=0;we<de.length;we++)V.push(g.jsx(ft.HeaderDivider,{orientation:k,view:x,headerStyle:ce,headerStyleSelect:he,headerStyleSelectAll:be,headerStyleHover:ve,disabled:n.isProtected(),...de[we]},`divider${we}`));return V},x=>{const V=[];for(let y=0;J&&y<J.length;y++)V.push(_(`selection:${x.getAnchor()}:${y}`,0,A(J[y].min,J[y].max,x)));return V}])},[G,!0,Ke,h,Ce,B,f,R,P]),l.useEffect(()=>{N.current?.invalidate()},[R]);const ee=X(U=>c?c(U):n.getTextAt(U),[c,n]),_e=X(U=>{const{header:J,headerSelect:m,headerSelectAll:_,headerHover:A}=h??{},{range:x,key:V,...y}=U;return g.jsx(ft.HeaderRenderer,{orientation:k,index:k===p.IRange.Orientation.Column?x.colStart:x.rowStart,isSelected:ae,isSelectedAll:Fe,zoomScale:100*P,headerText:ee,headerStyle:J,headerStyleSelect:m,headerStyleSelectAll:_,headerStyleHover:A,verticalPadding:u,horizontalPadding:w,...y},V)},[R,B,h,P,n]),Ve=Gt(),Me=l.useMemo(()=>{const U="white",J="black",m={};if(Qe.detectIt().primaryInput!=="touch"){let _=k===p.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${J}' fill='${U}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${J}' fill='${U}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Ve.getMode()?.key==="formatPainter"&&(_=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${J}' fill='${U}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),m.cursor=_}return m.backgroundColor=h?.header?.fill||"transparent",m},[k,R,Ve,h]),Le=Ft(e,()=>({scrollTo:U=>{N.current?.scrollTo(U)},forceRender:()=>{T()},getGridElement:()=>N.current}),[]),Ie=l.useCallback(U=>{nt.onPointerDown(U)},[nt]),L=l.useCallback(U=>{const J=nt.getCellCoordsFromClient(U.clientX,U.clientY);if(!J||!b)return;const m=k===p.IRange.Orientation.Column;b({originalEvent:U,clientX:U.clientX,clientY:U.clientY,rowIndex:m?-1:J.rowIndex,colIndex:m?J.colIndex:-1}),U.stopPropagation(),U.preventDefault()},[nt,b]),se=l.useMemo(()=>{const U=k===p.IRange.Orientation.Column;return g.jsx("div",{ref:Le,children:g.jsx(ft.Grid,{className:"sheet-header",style:Me,ref:N,scrollPoint:Z,columnCount:U?B:1,rowCount:U?1:B,width:U?a:s,height:U?s:d,freezeLeft:U?f:void 0,freezeTop:U?void 0:f,hiddenColumnsAt:U?Te:void 0,hiddenRowsAt:U?void 0:Te,showGridLines:!1,layout:Ce,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:L,onPointerDown:Ie,zoom:P,cellRenderer:_e,overlays:H})})},[H,Ce,a,d,Z,Me,G]);return l.useEffect(()=>{z.current=!1,N.current?.invalidate(),O()},[n,h]),se})),lc=l.memo(l.forwardRef((t,e)=>{const{view:n,sheet:o,getVisibleCells:r,gridStyle:i}=t,s=X((c,f)=>c.getStyle().getBorder(),[]),{overlay:a}=Nr({getVisibleCells:r,getBorderAt:s,darkMode:i.body.darkMode,shiftIfWide:!0}),d=a(n);return d&&n?d:null})),sc={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},ac={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},cc={type:p.ICell.Content.Values},dc={fitDestination:!0,type:p.ICell.Content.Formats},uc={fitDestination:!0,type:p.ICell.Content.Formulas},hc={transpose:!0},gc={fitDestination:!0,adjustCells:(t,e,n)=>({value:`=${e.getA1({$colIndex:!0,$rowIndex:!0})}`})},Jl=({element:t,sheet:e,sheetView:n,commands:o,onClipboardUpdate:r,onPaste:i,selectionRenderer:s=ft.defaultSelectionRenderer,copyForegroundColor:a="rgb(33, 115, 70)",cutForegroundColor:d="rgb(33, 115, 70)",copyBackgroundColor:c="white",cutBackgroundColor:f="white",notifier:h,...u})=>{const w=X(s,[s]),b=l.useRef(null),q=Gt(),I=q.getMode(),$=l.useMemo(()=>({element:t,doCopy:S=>{const k=e.getSelectedRanges().getSnapshot(S);return new p.RangeClipboardItem(k)}}),[e,n,t]),D=l.useMemo(()=>({element:t,importFromExternal:async(S,k)=>{const N=new p.ExternalRangeClipboardItem(S,k,e.getStyles(),e.isDate1904());return await N.parse()?N:null},doPaste:async(S,k)=>{if(S?.getItemType()!=="range")return;k?.contentsOnly&&delete(k={...k,type:p.ICell.Content.Values}).contentsOnly;const N=e.getSelectedRange(),R=S.getItem(),T=R.getName();return await N.doBatch(async()=>{const G=await N.copyFrom(R,k);!G||G.isEntireRows()||G.isEntireColumns()||G.autoFit({orientations:p.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(T?` ${T}`:""),autoSelect:!0}),!0}}),[e,n,h,t]),{clipboard:v,...F}=jr({...u,source:$,commands:o,target:D,notifier:h,onClipboardUpdate:S=>{const k=S?.getItemType()==="range"?S:null;if(k){const N=S.editMode?.(),R={...S?.isCut?.()?ac:sc,...N,args:{isClipboard:!0,...N?.args},onModeChange:T=>{T?.args?.isClipboard||v.clear(!0),N?.onModeChange?.(T)}};q.setMode(R)}b.current=k,r?.(k)},onPaste:(S,k)=>{if(S?.getItemType()!=="range")return;let N=q.getMode()?.key==="cut"||S.isCut?.();if(!N&&q.getMode()?.key==="copy"){const R=S.getItem().getCoords(),T=e.getSelectedRanges().getCoords();let G=!1;if(!G&&R&&T&&S.getItem().getSource?.()===e)for(let O=0;!G&&O<T.length;O++)G=ut.isRangesIntersect(R,T[O]);N=G}N&&q.setMode(null),t?.()?.focus(),i?.(S,k)}});l.useMemo(()=>{const S=t;if(!o)return;const k=[new ne("pasteValues",S,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
27
|
-
|
|
28
|
-
The formatting is not applied.`,shortcut:{key:"V",modifiers:[Q.Ctrl,Q.Shift]}}),new ne("pasteFormats",S,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
29
|
-
|
|
30
|
-
The content is not applied.`}),new ne("pasteFormulas",S,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new ne("pasteTranspose",S,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new ne("pasteLinks",S,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];o.addCommands(k,!0)},[o,t]),l.useEffect(()=>{if(!o)return;const S={disabled:!e.getProtection().isFormatCellsAllowed()};o.getCommand("pasteValues").updateCallback(k=>F.paste({...cc,...k})).update(S),o.getCommand("pasteFormats").updateCallback((k,N)=>F.paste({...dc,description:N.label(),...k})).update(S),o.getCommand("pasteFormulas").updateCallback((k,N)=>F.paste({...uc,description:N.label(),...k})).update(S),o.getCommand("pasteTranspose").updateCallback((k,N)=>F.paste({...hc,description:N.label(),...k})).update(S),o.getCommand("pasteLinks").updateCallback((k,N)=>F.paste({...gc,description:N.label(),...k})).update(S),o.getCommand("cut").update(S),o.getCommand("paste").update(S)},[e,o]);const E=l.useMemo(()=>{if(!I||!b.current)return;const S=I.key;if(S!=="copy"&&S!=="cut"&&S!=="formatPainter")return;const k=b.current.getItem();if(k.getSource()!==e)return;const N=b.current.isCut?.(),R=N?f:c,T=N?d:a,G=k.getCoords(),O=G?[G]:null;return O&&O.length!==0?j=>{const z=[];for(let B=0;B<O.length;B++){const Z=O[B],P=j.toClipBounds(j.getRangeCoordsBounds(Z,{top:0,left:0,right:1,bottom:1}),ft.SELECTION_CLIP_INSETS);P&&(z.push(w({range:Z,key:`copy-selection-background-${B}`,x:P.x,y:P.y,width:Math.max(P.width,0),height:Math.max(P.height,0),stroke:R,strokeWidth:2})),z.push(w({range:Z,key:`copy-selection-foreground-${B}`,x:P.x+(P.width<=2?-1:0),y:P.y,width:Math.max(P.width,3),height:Math.max(P.height,3),stroke:T,strokeWidth:2,isAnimatedStroke:!0})))}return z}:null},[I,e,n,a,c,d,f]);return{...F,clipboard:v,overlays:E}},mc=l.memo(l.forwardRef((t,e)=>{const{view:n,element:o,sheet:r,gridStyle:i,commands:s,notifier:a}=t,d=i.body??{},c=r.getView(),{overlays:f}=Jl({element:o,sheet:r,sheetView:c,commands:s,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:d.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:d.fill,notifier:a});return it(r?.getSelection(),{onChange(h){}}),l.useEffect(()=>{n?.getStage()},[n?.getStage()]),f&&n?f(n):null})),fc="_sheet-selection_12wyx_5",pc={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},vc={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},wc={key:"dragCopy",description:"Drag selection to copy cell contents."},yc={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Vi=(t,e)=>e.ctrlKey&&e.shiftKey?yc:e.ctrlKey?wc:e.shiftKey?vc:pc,bc={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},xc=l.memo(l.forwardRef((t,e)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:s,onShowTooltip:a,onCloseTooltip:d,sheet:c,gridRef:f,gridStyle:h,isActive:u,editingCoords:w,...b}=t,q=n?.getBounds(),I=X(a,[a]),$=X(d,[d]),[D,v]=l.useState(()=>c?.getSelection().getCoords()),F=X(ge=>{ut.isEqualSelectionCoords(ge,D)||c&&c.getSelection().updateCoords(ge)},[c,D]),E=Gt(),S=l.useRef(null),[k,N]=l.useState(c?.getProtection().isLocked()),[R,T]=l.useState(c?.getView().getMovableSelection().length>0),G=Qe.detectIt().primaryInput==="touch",O=!G&&u,j=w!==null||R,z=X(ge=>{const fe=ut.cellToRange(ge);if(c.isClosed())return fe;const Se=c.getRange(fe,{excludeHidden:!0}).getMerges();return Se.length===0?fe:Se[0]},[c]),B=X((ge,fe,Se,pe,Ce,Ae)=>{const ye=c.getSelectedRange().getExtended(pe,ge).getCoords();switch(pe){case p.IRange.Direction.Up:return ye.rowStart;case p.IRange.Direction.Down:return ye.rowEnd;case p.IRange.Direction.Left:return ye.colStart;case p.IRange.Direction.Right:return ye.colEnd}},[c]),Z=X(()=>{const ge=c.getUsedRange()?.getCoords(),fe=c.getRowHeaders().getUsedRange()?.getCoords(),Se=c.getColumnHeaders().getUsedRange()?.getCoords();return{...ge,colEnd:Math.max(ge?.colEnd??0,Se?.max??0),rowEnd:Math.max(ge?.rowEnd??0,fe?.max??0)}},[c]),P=X((ge,fe)=>c.getRowHeaders().hiddenHeadersAt(ge,fe),[c]),M=X((ge,fe)=>c.getColumnHeaders().hiddenHeadersAt(ge,fe),[c]),H=X(ge=>c.getRange(ge,{excludeHidden:!0}).getMerges(),[c]),oe=X(ge=>{c?.getSelection().setAdjusting(ge)},[c]),ue=X(async()=>{c?.getSelection().setAdjusting(null),E.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),E.setMode(null))},[E,D,c,o]),te=l.useMemo(()=>{const ge=E.getMode();return ge?.key==="cut"||ge?.key==="copy"},[E]);it(c?.getView(),{onMovableSelectionChange:()=>{T(c.getView().getMovableSelection().length>0)}}),it(c?.getSelection(),{onChange(ge){const fe=c.getSelection().getCoords();v(fe)}}),it(c,{onProtectionChange:()=>{N(c.getProtection().isLocked())}});const{body:K={}}=h||{},le=n.getLayout(),Re=!(O&&D.ranges.length<=1&&w===null&&!k&&(!E.getMode()||te)),{cursor:Te,overlay:ae,onPointerDown:Fe}=ft.useSelection({gridRef:f,commands:o,layout:le,getCellCoordsAsRangeCoords:z,selection:D,fillHandleBorderColor:K.fill,selectionBackgroundColor:u?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:u?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:u?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:u?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Re,disableMoveDrag:G||!(u&&D.ranges.length<=1&&w===null&&!k),disableTouchSelection:j,onSelectionChange:F,onSelectionDragStart:oe,onSelectionDragEnd:ue,onMoveDragStart:(ge,fe,Se)=>{E.setMode(Vi(0,Se))},onMoveDragUpdate:(ge,fe,Se)=>{E.setMode(Vi(0,Se))},onMoveDragEnd:(ge,fe)=>{E.setMode(null)},onMoveDragDone:async(ge,fe,Se)=>{if(ut.isEqualRanges(ge,fe))return;const pe=c.getRange(fe);if(s?.showOptions){const Pe=pe.getDifferences(ge);let $e=!1;for(let C=0;!$e&&C<Pe.getCount();C++)$e=Pe.at(C).isContentful();if($e&&await s?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const Ce=!Se.ctrlKey,Ae=Se.shiftKey,ye=Ae?Ce?"Insert Moved Cells":"Insert Copied Cells":Ce?"Move Cells":"Copy Cells",De=await s?.showBusy?.(ye);try{const Pe=c.getRange(ge);await pe.doBatch(async()=>{Ae?await pe.insertFrom(ge,{isCut:Ce,undoRange:Pe}):await pe.copyFrom(ge,{isCut:Ce,undoRange:Pe}),Pe.autoFit({skipCustomSize:!0,orientations:p.IRange.Orientations.Row,minContent:!0}),pe.autoFit({skipCustomSize:!0,orientations:p.IRange.Orientations.Row,minContent:!0})},{description:ye,autoSelect:!0})}catch(Pe){s?.showError?.(Pe)}finally{De?.()}},contentfulCellFinder:B,hiddenRowsAt:P,hiddenColumnsAt:M,mergedRanges:H,getDataCoords:Z,canSelectionSpanMergedCells:ge=>{const fe=c.getRange(ge);return fe.isEntireColumns()||fe.isEntireRows()},onFill:async(ge,fe)=>{const Se="Auto Fill",pe=await s?.showBusy?.(Se);try{await c.doBatch(()=>{c.getRange(ge).autoFill(fe),c.getRange(fe).autoFit({orientations:p.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:Se,autoSelect:!0})}catch(Ce){s?.showError?.(Ce)}finally{S.current=null,pe?.()}},onFillPreview:(ge,fe,Se)=>{if(f.current&&I){E.setMode(bc);try{S.current?.direction!==Se&&(S.current=null,c.getRange(ge).autoFill(fe,{previewOnly:C=>{S.current={callback:C,direction:Se}}}));const pe=S.current?.callback?.(fe);if(!pe||pe.isEmpty())return;const Ce=pe.toText();if(!Ce)return;const Ae=ut.cellToRange(pe.getCoords()),ye=n.getRelativePointFromClient(0,0);let De=0,Pe=0,$e=hn.Bottom;if(Se===p.IRange.Direction.Down){De=le.getColOffset(Ae.colEnd+1)-ye.x;const C=le.getRowOffset(Ae.rowEnd),We=le.getRowOffset(Ae.rowEnd+1);Pe=We-(We-C)/2-ye.y,$e=hn.Right}else if(Se===p.IRange.Direction.Right){Pe=le.getRowOffset(Ae.rowEnd+1)-ye.y;const C=le.getColOffset(Ae.colEnd),We=le.getColOffset(Ae.colEnd+1);De=We-(We-C)/2-ye.x,$e=hn.Bottom}else if(Se===p.IRange.Direction.Up){De=le.getColOffset(Ae.colEnd+1)-ye.x;const C=le.getRowOffset(Ae.rowStart),We=le.getRowOffset(Ae.rowStart+1);Pe=We-(We-C)/2-ye.y,$e=hn.Right}else if(Se===p.IRange.Direction.Left){Pe=le.getRowOffset(Ae.rowEnd+1)-ye.y;const C=le.getColOffset(Ae.colStart),We=le.getColOffset(Ae.colStart+1);De=We-(We-C)/2-ye.x,$e=hn.Bottom}I({anchor:{x:De,y:Pe},display:Ce,placement:$e})}catch(pe){s?.showError?.(pe)}}},onFillDone:()=>{S.current=null,E.setMode(null),$?.()}}),me=X(ge=>{Fe(Qe.createSyntheticEvent(ge))},[Fe,w]);l.useEffect(()=>{const ge=n?.getStage();if(ge)return ge.addEventListener("pointerdown",me),()=>{ge.removeEventListener("pointerdown",me)}},[n?.getStage()]);const Oe=Ft(e,()=>({}),[]),xe=l.useRef(null);return g.jsx("div",{className:kt(r,"sheet-selection",fc),style:{position:"absolute",width:q?.width,height:q?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Cn([Oe,xe]),...b,children:ae(n)})})),go=Object.freeze({x:0,y:0,width:0,height:0}),Cc={fireOnModelChange:!1},Sc=l.memo(l.forwardRef((t,e)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:s,onHide:a,onShow:d,onUnFocus:c,isDragging:f,updateFrameBounds:h,dragStart:u,style:w,disabled:b,renderMovable:q,...I}=t,[$,D]=l.useState(go),[v,F]=l.useState(null),[E,S]=l.useState(!1),k=l.useRef(null);l.useLayoutEffect(()=>{if(r.isClosed())return;const R=r.getBounds();if(!R)return;const T=o.toViewBounds(R);D(T??go),h(T??go)},[o?.getBounds()]),it(r,{onBoundsChange:R=>{const T=R.getBounds();if(!T)return;const G=o.toViewBounds(T);D(G??go),h(G)},onSelectionChange:()=>{const R=Ue.hasFocus(k.current,!0);!E&&!R||r.isSelected()||c()}}),it(r,{onRequestFocus:()=>Ue.whenFocus(k.current,!0)},Cc),l.useEffect(()=>{const R=k.current;return i(R),()=>{s(R)}},[]);const N=l.useMemo(()=>{if(!$)return null;let{width:R,height:T}=$;return q({view:o,movable:r,disabled:b,isDragging:f,style:{position:"relative",left:0,top:0,width:R,height:T},onHide:a,onShow:d})},[o,r,$.width,$.height,b,f]);return g.jsx("div",{className:"movable",tabIndex:0,ref:Cn([k,e]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:$.x,top:$.y,width:$.width,height:$.height,...w},onMouseDown:async R=>{const T=R.shiftKey||R.ctrlKey,G=r.isSelected(),O=R.currentTarget;T&&G?r.unselect():(G&&!T||await r.select({addToSelection:T}),u(R.nativeEvent,O),O.focus())},onFocus:R=>{R.relatedTarget&&!v&&F(R.relatedTarget),S(!0)},onBlur:R=>{v&&!k?.current?.contains(R.relatedTarget)&&F(null),R.relatedTarget&&S(!1)},...I,children:N})})),qc="_movable-area_314c6_5",Ql=l.memo(l.forwardRef((t,e)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:s,onUnFocus:a,onFocus:d,disabled:c=!1,disableDrag:f=!1,disableResize:h=!1,className:u,style:w,renderDirections:b=["nw","n","ne","w","e","sw","s","se"],onFirstRender:q,...I}=t,$=n.getBounds(),D=X(q,[q]),v=X(a,[a]),F=X(d,[d]),[E,S]=l.useState([]),[k,N]=l.useState(!1),[R,T]=l.useState(!1),G=l.useRef(!0),O=l.useRef(new Map),j=l.useRef(new Map),z=l.useRef(new Map),B=l.useRef(new Map),Z=l.useRef(new Map),P=l.useRef({onRequestFocus:ee=>(fe(ee),null)}),M=l.useRef(null),H=l.useRef(null),oe=l.useRef(null),[ue,te]=l.useReducer(ee=>ee+1,0);l.useLayoutEffect(()=>{te()},[n,o]),it(o,{onCollectionChange:()=>{const ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),_e=Z.current;_e.forEach(Me=>{Me()}),_e.clear();const Ve=P.current;for(let Me=0;Me<ee.length;Me++){const Le=ee[Me];if(Le.isClosed())continue;const Ie=Le.addListeners(Ve);_e.set(Le,Ie)}te()},onInvalidated:()=>{te()}}),it(r,{onMovableSelectionChange(ee){le(),te()}});const K=l.useCallback((ee,_e)=>{const Ve=z.current.get(ee);oe.current&&(oe.current.getTargets().forEach(Me=>{if(Me===Ve)return Me.style.left=_e.x+"px",Me.style.top=_e.y+"px",Me.style.width=_e.width+"px",void(Me.style.height=_e.height+"px")}),oe.current.updateRect())},[]),le=()=>{const ee=[],_e=r.getMovableSelection();_e.forEach(Ve=>{const Me=z.current.get(Ve);Me&&_e.indexOf(Ve)!==-1&&ee.push(Me)}),S(Ve=>Ue.isEqualArrays(Ve,ee)?Ve:ee)},Re=l.useRef(null),Te=l.useMemo(()=>new Promise(ee=>{Re.current=ee}),[]),ae=l.useRef(null),Fe=X(async(ee,_e)=>{ae.current=_e,await(async()=>!(!await Te.then()||!oe.current))()&&ae.current===_e&&oe.current.dragStart(ee,_e)},[E]),[me,Oe]=l.useState(!1),xe=l.useRef(null),ge=l.useRef(null),fe=X(async(ee=null)=>{if(ee||(ee=r.getMovableSelection()[0]),!ee)return v?.(),!1;const _e=z.current.get(ee);_e?(await Ue.whenFocus(_e),_e.focus(),ge.current=_e,xe.current=null):xe.current=ee},[r]);l.useEffect(()=>{me&&E.length>0&&ge.current!==E[0]&&fe(),G.current&&(D?.(),G.current=!1)},[E]);const Se=l.useMemo(()=>{const ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ee.length===0&&O.current.size===0)return null;const _e=(L,se,U,J=!0)=>{const m=L.isSelected(),_={tabIndex:U,view:n,movable:L,onRefLoad:A=>{xe.current===L&&(A.focus(),ge.current=A,xe.current=null),z.current.set(L,A),j.current.set(A,L),se.rendered=!0,le()},onRefUnload:A=>{z.current.delete(L),j.current.delete(A),se.rendered=!1,le()},onUnFocus:v,onHide:A=>{se.onHide=A},onShow:A=>{se.onShow=A},isDragging:m&&(R||k),disabled:c,renderMovable:i,updateFrameBounds:A=>{K(L,A)},dragStart:Fe,onMouseUp:()=>{if(ae.current=null,H.current){N(!1),T(!1);let A=!1;B.current?.forEach(x=>{Ue.isEqualBounds(x.movable.getBounds(),x.startBounds)||(A=!0)}),A?Ce():Ae()}},style:{opacity:J?k&&m?.7:void 0:0,zIndex:k&&m?L.getZIndex()+ee.length:void 0,pointerEvents:J?void 0:"none",cursor:R&&m?"grabbing":c||f?"initial":"move",boxShadow:!m||R&&!k?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return g.jsx(Sc,{..._},`movable-${L.getUUID()}`)},Ve=O.current,Me=new Map,Le=[];for(let L=0;L<ee.length;L++){const se=ee[L];if(se.isClosed())continue;let U=Ve.get(se);U||(U={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(J,m)=>{if(!m||m.shown===!0)return;m.shown=!0;const _=++m.visibilityRequestId;requestAnimationFrame(()=>{const A=O.current.get(J);A&&_===m.visibilityRequestId&&(m.onShow?.(J),A.shown=!0)})},doHide:async(J,m)=>{if(!m||m?.shown===!1)return;m.shown=!1;const _=++m.visibilityRequestId,A=await Promise.resolve(m.onHide?.(J));_===m.visibilityRequestId&&A!==!1&&(m.shown=!1,O.current.delete(J),te())},visibilityRequestId:0}),U.frame=_e(se,U,L,!0),Le.push(U.frame),U.doShow(se,U),Ve.delete(se),Me.set(se,U)}const Ie=[];return r.getMovableSelection().forEach(L=>{const se=Ve.get(L);se&&(se.frame=_e(L,se,-1,!1),Ie.push(se.frame),Ve.delete(L),Me.set(L,se))}),Ve.forEach((L,se)=>{L.frame=_e(se,L,-1,!1),Ie.push(L.frame),L.doHide(se,L),Ve.delete(se),Me.set(se,L)}),O.current=Me,le(),[...Ie,...Le]},[ue,n,i,c,f,h,k,R]),pe=X((ee,_e)=>{const Ve=`${_e} ${E.length===1?p.TextUtils.capitalize(j.current?.get(E[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${Ve}`),H.current.rollback(),H.current=null),H.current=s.beginCommit({description:Ve}),B.current.clear();for(let Me=0;Me<E.length;Me++){const Le=E[Me],Ie=j.current?.get(Le);Ie?B.current.set(Le,{movable:Ie,startBounds:n.toViewBounds(Ie.getBounds())}):console.warn("invalid element",Ie)}},[s,n,E]),Ce=l.useCallback(()=>{if(!H.current)return;const ee=[];B.current?.forEach(_e=>{ee.push(_e.movable)}),H.current.commit({viewAfter:{view:r,movableSelection:ee}}),B.current.clear(),H.current=null},[]),Ae=l.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),ye=l.useRef(null);l.useEffect(()=>{ye.current&&(ye.current.onscroll=ee=>{ee.preventDefault(),ee.srcElement.scrollTop=0,ee.srcElement.scrollLeft=0})},[ye.current]);const De=Ft(e,()=>({isMovableArea:()=>!0,focusMovable:fe,focus:()=>{fe()}}),[r]),[Pe,$e]=l.useState(null),C=l.useRef(!1),We=l.useRef(!1),nt=l.useRef(!1);l.useEffect(()=>{if(c||E.length===0||nt.current||C.current)return;if(We.current)return void requestAnimationFrame(()=>{oe.current&&M.current&&oe.current.refTargets.length>0&&(nt.current=!0,Re.current?.(!0)),S([...E])});C.current=!0;const ee=l.lazy(async()=>{try{const _e=await Promise.resolve().then(()=>require("./Dw31E_I05ytgzGk2.cjs"));return C.current=!1,We.current=!0,S([...E]),_e}catch(_e){return console.warn(_e),Re.current?.(!1),null}});$e(ee)},[E,c,f,h]);const Ke=l.useMemo(()=>!Pe||c?null:g.jsx(l.Suspense,{children:g.jsx(Pe,{className:kt({dragging:k||R,resizing:k,moving:R}),container:null,ref:oe,target:oe.current?E:[],draggable:!c&&!f,resizable:!c&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:b,onResizeStart:ee=>{pe(ee.target,"Resize")},onResize:ee=>{if(!H.current)return ee.stopDrag(),void te();N(!0);const _e=ee.direction[0]!==0&&ee.direction[1]!==0;let Ve=0,Me=0;for(let Le=0;Le<E.length;Le++){const Ie=E[Le],L=B.current.get(Ie),se=j.current.get(Ie);if(!L||!se){console.warn("invalid element");continue}let U=ee.dist[0],J=ee.dist[1],m=ee.drag.dist[0],_=ee.drag.dist[1],A=L.startBounds.width,x=L.startBounds.height;Le===0?(Ve=A,Me=x):(U*=A/Ve,m*=A/Ve,J*=x/Me,_*=x/Me);const V={...L.startBounds};if(V.width=Math.max(0,A+U),V.height=Math.max(0,x+J),ee.direction[0]===-1&&(V.width=Math.max(0,Math.min(L.startBounds.x+A,A-m))),ee.direction[1]===-1&&(V.height=Math.max(0,Math.min(L.startBounds.y+x,x-_))),_e&&(se.isLockAspectRatio()||ee.inputEvent?.shiftKey)){const y=A/x,W=V.width/V.height;W>y?V.height=V.width/y:W<y&&(V.width=V.height*y)}ee.direction[0]===-1&&(V.x=Math.max(0,Math.min(L.startBounds.x+A,L.startBounds.x+A-V.width))),ee.direction[1]===-1&&(V.y=Math.min(L.startBounds.y+x,L.startBounds.y+x-V.height)),L.movable.setBounds(n.toAbsoluteBounds(V))}},onResizeEnd:ee=>{N(!1),Ce()},onDragStart:ee=>{pe(ee.target,"Move")},onDrag:ee=>{if(!H.current)return ee.stopDrag(),void te();T(!0);for(let _e=0;_e<E.length;_e++){const Ve=E[_e],Me=B.current.get(Ve);Me?Me.movable.setBounds(n.toAbsoluteBounds({...Me.startBounds,x:Me.startBounds.x+ee.translate[0],y:Me.startBounds.y+ee.translate[1]})):console.warn("invalid element")}},onDragEnd:ee=>{},onMouseUp:ee=>{}})}),[ue,Pe,E,n,c,f,h,k,R]);return g.jsx("div",{className:kt(u,"movable-area",qc),style:{width:$.width,height:$.height,...w,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Cn([De,ye]),...I,children:g.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:$.width,height:$.height},...I,children:g.jsxs("div",{ref:M,style:{position:"absolute",pointerEvents:"auto"},onFocus:ee=>{F?.(),Oe(!0)},onBlur:ee=>{Oe(!1)},onKeyDownCapture:ee=>{if(ee.isDefaultPrevented())return;const _e=ee.nativeEvent.ctrlKey,Ve=ee.nativeEvent.altKey,Me=ee.nativeEvent.shiftKey;if(ee.which===St.Escape){const U=r.getMovableSelection();let J=[...U];return E.forEach(m=>{if(J.length===0)return;const _=j.current.get(m);let A=J.indexOf(_);J.splice(A,1)}),J.length!==U.length&&r.selectMovables(J),J.length===0&&v?.(),void ee.preventDefault()}const Le=.1,Ie=U=>{o.updateSelected(J=>{J.setRotation(J.getRotation()+U)},"Rotate")},L=(U,J=!0)=>{o.updateSelected(m=>{const _=m.getBounds();let A=1+U;J||(A=1/A);const x=Math.sqrt(Math.pow(_.width,2)+Math.pow(_.height,2)),V=Math.atan2(_.height,_.width),y=A*x;if(y<10)return;const W=y*Math.cos(V),Y=y*Math.sin(V),ie={x:_.x+(_.width-W)/2,y:_.y+(_.height-Y)/2,width:W,height:Y};m.setBounds(ie)},"Resize")},se=U=>{o.updateSelected(J=>{const m=J.getBounds(),_={x:m.x+(U.x??0),y:m.y+(U.y??0),width:m.width+(U.width??0),height:m.height+(U.height??0)};J.setBounds(_)},"Nudge")};if(ee.which===St.Delete)o.updateSelected(U=>{U.delete()},"Delete"),ee.preventDefault();else if(ee.key==="a"&&_e){const U=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(U,!0),ee.preventDefault()}else ee.key==="ArrowLeft"?(Me?L(Le,!1):Ve?Ie(-10):se({x:_e?-10:-1}),ee.preventDefault()):ee.key==="ArrowRight"?(Me?L(Le,!0):Ve?Ie(10):se({x:_e?10:1}),ee.preventDefault()):ee.key==="ArrowUp"?(Me?L(Le,!0):se({y:_e?-10:-1}),ee.preventDefault()):ee.key==="ArrowDown"&&(Me?L(Le,!1):se({y:_e?10:1}),ee.preventDefault())},children:[Se,Ke]})})})})),un=t=>{let e=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<t.length;i++){const s=t[i].getBounds();e=Math.min(s.x,e),n=Math.min(s.y,n),o=Math.max(s.x+s.width,o),r=Math.max(s.y+s.height,r)}return{x:e,y:n,width:o-e,height:r-n}},Hi=(t,e=!0)=>{const n=[],o=e?"x":"y",r=e?"y":"x",i=e?"width":"height";let s=0,a=Number.MAX_SAFE_INTEGER,d=0;for(let h=0;h<t.length;h++){const u=t[h],w=u.getBounds();s+=w[i],a=Math.min(w[o],a),d=Math.max(w[o]+w[i],d),n.push({bounds:w,movable:u})}const c=(d-a-s)/(t.length-1);n.sort((h,u)=>{const w=h.bounds[o],b=u.bounds[o];return w!==b?w-b:h.bounds[r]-u.bounds[r]});const f=new Map;f.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const u=n[h-1].bounds,w={...n[h].bounds};w[o]=u[o]+u[i]+c,n[h].bounds=w,f.set(n[h].movable,w)}return f.set(n[n.length-1].movable,n[n.length-1].bounds),f};function es(t){const{movables:e,movablesView:n,transactional:o,commands:r,target:i,onRepeatCommandChange:s,notifier:a}=t,d=Gt();l.useRef(d.getMode()).current=d.getMode();const c=X(async(v,F,E=null,S=!0)=>{const k=async()=>{const N=await Promise.resolve(a?.showBusy?.(v.label()));try{await F();const R=E??v?.label?.();if(s){let T=null;v&&R!==!1&&(T=new Ne(v.key(),i,{label:R,description:R},k)),s(T)}N?.(),S&&d.setMode(null)}catch(R){N?.(),a?.showError?.(R)}};await k()},[s,a]),[f,h]=l.useReducer(v=>v+1,0),u=X((v,F,E)=>{if(!n)return;const S=n.getMovableSelection();if(S.length===0)return;let k="Drawings";if(S.length===1){const R=S[0];k=p.TextUtils.capitalize(R.getContent().getType())??"Drawing"}const N=`${v.label()} ${k}`;c(v,()=>{let R=null;o&&(R=o.beginCommit(N));const T=n.getMovableSelection();if(T.length===0)return;const G=E?.(T);for(let O=0;O<T.length;O++){const j=T[O];F(j,G)}R?.commit()})},[n,o]),[w,b]=l.useState(n.getMovableSelection()[0]??null),[q,I]=l.useState(!w||w?.isProtected()),$=l.useMemo(()=>[new ne("moveToFront",i,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[Q.Ctrl,Q.Shift]}},function(){u(this,v=>{v.moveToFront()})}),new ne("moveForward",i,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[Q.Ctrl]}},function(){u(this,v=>{v.moveForward()})}),new ne("moveToBack",i,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[Q.Ctrl,Q.Shift]}},function(){u(this,v=>{v.moveToBack()})}),new ne("moveBackward",i,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[Q.Ctrl]}},function(){u(this,v=>{v.moveBackward()})}),new ne("toggleLockAspectRatio",i,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){u(this,v=>{v.setLockAspectRatio(!v.isLockAspectRatio())})}),new ne("formatAnchorTypeTwoCell",i,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){u(this,v=>{v.setAnchorType(p.IAnchored.Type.TwoCell)})}),new ne("formatAnchorTypeOneCell",i,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){u(this,v=>{v.setAnchorType(p.IAnchored.Type.OneCell)})}),new ne("formatAnchorTypeAbsolute",i,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){u(this,v=>{v.setAnchorType(p.IAnchored.Type.Absolute)})}),new ne("formatDrawAlignLeft",i,{label:"Align Left",description:"Align the selected drawings to the left."},function(){u(this,(v,F)=>{v.setBounds({x:F.x})},un)}),new ne("formatDrawAlignCenter",i,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){u(this,(v,F)=>{v.setBounds({x:(F.width-v.getBounds().width)/2+F.x})},un)}),new ne("formatDrawAlignRight",i,{label:"Align Right",description:"Align the selected drawings to the right."},function(){u(this,(v,F)=>{v.setBounds({x:F.width-v.getBounds().width+F.x})},un)}),new ne("formatDrawAlignTop",i,{label:"Align Top",description:"Align the selected drawings to the top."},function(){u(this,(v,F)=>{v.setBounds({y:F.y})},un)}),new ne("formatDrawAlignMiddle",i,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){u(this,(v,F)=>{v.setBounds({y:(F.height-v.getBounds().height)/2+F.y})},un)}),new ne("formatDrawAlignBottom",i,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){u(this,(v,F)=>{v.setBounds({y:F.height-v.getBounds().height+F.y})},un)}),new ne("formatDrawDistributeHorz",i,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){u(this,(v,F)=>{v.setBounds(F.get(v))},v=>Hi(v))}),new ne("formatDrawDistributeVert",i,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){u(this,(v,F)=>{v.setBounds(F.get(v))},v=>Hi(v,!1))}),new ne("formatDrawFlipHorz",i,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new ne("formatDrawFlipVert",i,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new ne("formatDrawGroup",i,{label:"Group",description:"Group the selected drawings into a single drawing."}),new ne("formatDrawUngroup",i,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new ne("formatDrawSwapShapes",i,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new ne("formatDrawSwapShapesHorz",i,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new ne("formatDrawSwapShapesVert",i,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,w]);l.useEffect(()=>{},[d]);const D=l.useMemo(()=>{let v=null;return v=r?r.createChildGroup(i,"movable",!1):new nn(i,"movable"),v.addCommands($,!0),v},[r,$]);return it(w,{onAnyChange:()=>{D.getCommand("formatAnchorTypeTwoCell").update({state:w?.getAnchorType()===p.IAnchored.Type.TwoCell}),D.getCommand("formatAnchorTypeOneCell").update({state:w?.getAnchorType()===p.IAnchored.Type.OneCell}),D.getCommand("formatAnchorTypeAbsolute").update({state:w?.getAnchorType()===p.IAnchored.Type.Absolute}),D.getCommand("formatAnchorTypeAbsolute").update({state:w?.getAnchorType()===p.IAnchored.Type.Absolute}),D.getCommand("toggleLockAspectRatio").update({state:w?.isLockAspectRatio()})},onProtectedChange:v=>{I(v.isProtected())},onDelete:()=>{}}),it(n,{onMovableSelectionChange:()=>{const v=n.getMovableSelection()[0]??null;b(v),I(!v||v.isProtected()),h()}}),it(e,{onCollectionChange:()=>{h()}}),l.useEffect(()=>{const v={disabled:q};D.getCommand("formatAnchorTypeTwoCell").update(v),D.getCommand("formatAnchorTypeOneCell").update(v),D.getCommand("formatAnchorTypeAbsolute").update(v),D.getCommand("toggleLockAspectRatio").update(v);const F=e.getCount(),E=n.getMovableSelection(),S=q||F<=1||E.length===0;let k={disabled:S},N=k;if(!S&&E.length===1){const G=E[0];G.getZIndex()===0&&(k={disabled:!0}),G.getZIndex()===F-1&&(N={disabled:!0})}D.getCommand("moveToFront").update(N),D.getCommand("moveForward").update(N),D.getCommand("moveToBack").update(k),D.getCommand("moveBackward").update(k);const R={disabled:q||E.length<=1};D.getCommand("formatDrawAlignLeft").update(R),D.getCommand("formatDrawAlignCenter").update(R),D.getCommand("formatDrawAlignRight").update(R),D.getCommand("formatDrawAlignTop").update(R),D.getCommand("formatDrawAlignMiddle").update(R),D.getCommand("formatDrawAlignBottom").update(R),D.getCommand("formatDrawFlipHorz").update(R),D.getCommand("formatDrawFlipVert").update(R),D.getCommand("formatDrawGroup").update(R),D.getCommand("formatDrawUngroup").update(R),D.getCommand("formatDrawSwapShapes").update(R),D.getCommand("formatDrawSwapShapesHorz").update(R),D.getCommand("formatDrawSwapShapesVert").update(R);const T={disabled:q||E.length<=2};D.getCommand("formatDrawDistributeHorz").update(T),D.getCommand("formatDrawDistributeVert").update(T)},[f,q,f]),D}const Rc=l.memo(l.forwardRef((t,e)=>{const{children:n,disabled:o,description:r,view:i,isDragging:s,onHide:a,onShow:d,...c}=t;l.useEffect(()=>{},[r]);const f=Ft(e,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:u,width:w}]=en();return g.jsx("div",{...c,ref:Cn([f,h]),children:g.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:s?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:g.jsx("div",{style:{textAlign:"center"},children:r})})})})),Ec=l.memo(l.forwardRef((t,e)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:s,target:a,notifier:d,onRepeatCommandChange:c}=t,f=es({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:c,commands:s,target:a,notifier:d});l.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=l.useMemo(()=>g.jsx(Ql,{ref:e,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{f.activate(),r?.onFocus?.()}},"movable-area"),[o,r,s,f]);return h&&n?h:null})),Tc=l.memo(l.forwardRef((t,e)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:s,setEditingCoords:a,commands:d,notifier:c=xo}=t,f=Gt(),[h,u]=l.useState(null),[w,b]=l.useState(null),[q,I]=l.useState(null),[$,D]=l.useState(null),[v,F]=l.useState(null);l.useLayoutEffect(()=>{if(q===null)return D(null),void F(null);const M=()=>{const H=o.getRange(q).getCell(),oe=H.getStyle();let ue,te=oe.getFill()?.toCSS(r.body.darkMode);te.background!=="none"&&te.background!=="transparent"||(te=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),te.background!=="none"&&te.background!=="transparent"||(te={background:r.body.fill}),D({style:te}),H&&!H.getFormula()&&(ue=H?.getRenderHorizontalAlignment()),F(ue??Rl.Left)};return M(),o.getRange(q).addListener(()=>{M()})},[o,q,r?.body]);const E=X(()=>{let M=w.editState.dirty??"";if(w.editState.dirty!==void 0){const H=p.TextUtils.clampString(M);try{const oe=w.sheet.getRange(w.coords),ue=`Typing '${H}' into ${oe.toString()}`;return oe.setValue(M,{description:ue,autoFit:!0}),I(null),b(null),f.setMode(null),a(null),!0}catch(oe){throw c.showError(new Error(`Unable to enter '${H}'.`,{cause:oe})),oe}}},[o,w,c]),S=X(M=>o.getRange(M).getCell().getExtrusions()??ut.cellToRange(M),[o]),k=X(M=>{let H=p.IRange.Orientation.Row,oe=!1;M!==p.IRange.Direction.Up&&M!==p.IRange.Direction.Down||(H=p.IRange.Orientation.Column),M!==p.IRange.Direction.Left&&M!==p.IRange.Direction.Up||(oe=!0),o.getSelection().traverse(H,oe)},[o]),N=l.useCallback((M,H)=>{if(i)return i(M,H);if(!o)return null;const{ref:oe,...ue}=M;return g.jsx(Ul,{ref:oe,...ue,sheet:o,bodyStyle:r?.body,activeCoords:H,commands:d,onChangeEdit:te=>{const K={sheet:o,coords:H,editState:te};f.setMode(le=>({...le,description:K.editState.editMode?"Edit":"Enter",args:{...le?.args,stateAndCoords:K}}))},editState:w.editState})},[o,$,i,w,q]),{overlay:R,startEdit:T,submitEdit:G,cancelEdit:O,onKeyboardEventNative:j,onPointerEventNative:z}=ft.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:N,canEdit:()=>{const M=o.getProtection();if(M.isReadOnly())return!1;const H=M.isLocked();return H&&s(),!H},onBeforeStartEdit:M=>{const H=Wl(()=>o.getRange(M).getCell()),oe={sheet:o,coords:M,editState:Object.freeze(H)};f.setMode({key:"edit",args:{stateAndCoords:oe}}),b(oe)},onStartEdit:M=>{I(M),a(M)},onSubmitEdit:E,onCancelEdit:M=>{I(null),b(null),f.setMode(null),a(null)},onDoneEdit:M=>{f.setMode(null)},onNavigate:k,containerProps:$,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:v,getRangeCoords:S});it(o.getSelection(),{onChange(M){u(o.getSelection().getCoords().cell)}});const B=X(M=>{z(M),q&&G()},[z,O,q]),Z=l.useCallback(M=>{z(M)},[z]),P=l.useCallback(M=>{j(M)},[j]);return l.useEffect(()=>{const M=n?.getStage();if(M)return M.addEventListener("pointerdown",B),M.addEventListener("dblclick",Z),M.addEventListener("keydown",P),()=>{M.removeEventListener("pointerdown",B),M.removeEventListener("dblclick",Z),M.removeEventListener("keydown",P)}},[n?.getStage()]),l.useEffect(()=>{const M=f.getMode(),H=M?.key;H==="edit"||H==="enter"?w?M.args?.cancel?O():M.args?.submit?G():b(M.args?.stateAndCoords):T(M.args?.start):q&&O()},[f]),R(n,e)})),ts="white",ns="black",Mc=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${ns}' fill='${ts}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,kc=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${ns}' fill='${ts}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,_c=l.memo(l.forwardRef((t,e)=>{const{view:n,sheet:o}=t,[r,i]=l.useState(o.getTables().getCount()>0),[s,a]=l.useState(null),[d,c]=l.useState(null),[f,h]=l.useState(null),[u,w]=l.useState(null),b=X(()=>{if(o.getTables().getCount()>0){i(!0);const E=o.getTables().search({address:n.getVisibleRangeCoords()});a(E.length>0?E:null)}else i(!1),a(null)},[o,n]),q=X(E=>{E.preventDefault(),E.stopPropagation();const S=n.getCellCoordsFromClient(E.clientX,E.clientY),k=o.getTables().search({address:S});k.length===1&&k[0].select()},[n,o]),I=X(E=>{E.preventDefault(),E.stopPropagation();const S=n.getCellCoordsFromClient(E.clientX,E.clientY),k=o.getTables().search({address:S});if(k.length===1){const N=k[0].getRange().getCoords(),R={colStart:N.colStart,rowStart:S.rowIndex,colEnd:N.colEnd,rowEnd:S.rowIndex};o.getRange(R).select()}},[n,o]),$=X(()=>{if(!r)return;const E=o.getTables().search({address:n.getVisibleRangeCoords()});a(E.length>0?E:null)},[o,r,n]);it(o?.getSelection(),{onChange(E){c(o.getSelection().getCoords().cell)}}),it(f,{onAnyChange(E){b(),$()}}),it(u,{onAnyChange(E){$()}}),it(o,{onTablesChange(E){b(),$()},onInvalidated(E){b(),$()}});const D=l.useMemo(()=>Ue.debounce(Ue.throttle($,300),300),[]);l.useEffect(()=>{D()},[n]),l.useEffect(()=>{let E=null;if(s)for(let S=0;S<s.length&&!E;S++){const k=s[S],N=k.getRange().getCoords();p.CoordUtils.isCellWithinRange(d,N)&&(E=k)}h(E)},[d,s]);const v=X(E=>{let S=null;if(s)for(let k=0;k<s.length;k++){const N=s[k],R=N.getRange().getCoords();let T=n.getRangeCoordsBounds(R);const G=n.getRelativePointFromClient(E.clientX,E.clientY),O=G.x,j=G.y;if(O>=T.x&&O<=T.x+T.width&&j>=T.y&&j<=T.y+T.height){const z=n.getViewportSize();O<=0||j<=0||O>=z.width||j>=z.height||(S=N)}}w(S)},[n,s]);if(l.useEffect(()=>{const E=n?.getStage();if(E&&s)return E.addEventListener("mousemove",v),E.addEventListener("mouseleave",v),()=>{E.removeEventListener("mousemove",v),E.removeEventListener("mouseleave",v)}},[s,n?.getStage()]),!n||!s||s.length===0)return null;const F=[];for(let E=0;E<s.length;E++){const S=s[E];if(S.isClosed())continue;const k=S===u,N=S===f,R=S.getRange().getCoords(),T=n.getRangeCoordsBounds(R);let G;if(k||N){const O=S.getStyle().getProperties(),j=O.headerRow?.fill?.background??O.wholeTable?.border?.top?.color?.toString();if(j&&o){const z=o.getStyles().parseColor(j);z&&(G=z.toCSS())}G||(G="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}F.push(g.jsx("div",{style:{position:"absolute",left:T.x,top:T.y,width:Math.min(16,T.width),height:T.height,pointerEvents:"all",cursor:Mc},onMouseDown:I},`table-select-row-${S.getName()}`)),F.push(g.jsx("div",{style:{position:"absolute",left:T.x,top:T.y,width:Math.min(16,T.width),height:Math.min(16,T.height),pointerEvents:"all",cursor:kc},onMouseDown:q},`table-select-${S.getName()}`)),F.push(g.jsx(ft.Selection,{x:T.x,y:T.y,width:T.width,height:T.height,range:R,strokeWidth:N?.5:0,stroke:G??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:k?`${G} 0px 0px 1px 1px`:void 0}},`table-outline-${S.getName()}`))}return F})),Ic=l.memo(l.forwardRef((t,e)=>{const{view:n,sheet:o,animationTime:r=60}=t,[i,s]=l.useState(null),[a,d]=l.useState(null),c=l.useRef(null),f=X(()=>{const I=o.getSelectedCell(),$=I.getSpill()?.getCoords()??null;ut.isEqualRanges($,i)||(d($?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds($),coords:$}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),s($))},[o,n,i]);l.useEffect(()=>(c.current&&(clearTimeout(c.current),c.current=null),a&&(c.current=setTimeout(()=>{d(null),c.current=null},r)),()=>{c.current&&(clearTimeout(c.current),c.current=null)}),[a,r]);const h=l.useMemo(()=>Ue.debounce(Ue.throttle(f,80),80),[]);if(it(o?.getSelection(),{onChange(I){h()}}),it(o,{onSpillsChange(I){f()},onInvalidated(I){f()}}),!n||!i&&!a)return null;const u=o.getRange(i).getValue()instanceof p.FormulaError.Spill,w=[];let b=a?.bounds??n.getRangeCoordsBounds(i);if(a&&!Ue.isEqualBounds(a.bounds,n.getRangeCoordsBounds(a.coords))&&d(null),b=n.toClipBounds(b,-10),!b)return;const q="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return w.push(g.jsx(ft.Selection,{x:b.x,y:b.y,width:b.width,height:b.height,range:i,strokeWidth:1,stroke:q,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:u?"6 3":void 0,opacity:a?.transition==="out"?0:1,transition:a?.transition?a.transition==="in"||a.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${q} 0px 0px 4px 0px`}},"spill-outline}")),w})),Fc={position:"absolute",top:0,left:0,bottom:0,right:0},$i=(t,e)=>{const n={...t},o=e?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},s=n.body=Ue.mergeContentful(t.body,i);return n.body=Ue.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},s),n.buttonSurface=Ue.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...t.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...t.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...t.selectionRemove},n.headerSelection={...n.selection,...t.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...t.headerSelectionInactive},n.header=Ue.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},t.header),n.header=Ue.mergeContentful(n.header,i),n.headerSelect=Ue.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},t.headerSelect),n.headerSelect=Ue.mergeContentful(n.headerSelect,i),n.headerSelectAll=Ue.mergeContentful(n.headerSelect,{},t.headerSelectAll),n.headerSelectAll=Ue.mergeContentful(n.headerSelectAll,i),n},Dc={fireOnModelChange:!1},Ui={},os=l.memo(l.forwardRef((t,e)=>{const{sheet:n,gridStyle:o=Ui,headersStyle:r=Ui,onSheetContextMenu:i,showColumnHeaders:s,columnHeaderProps:a,showRowHeaders:d,rowHeaderProps:c,showScrollbars:f=!0,scrollPaneProps:h,onViewportChange:u,commands:w,onRepeatCommandChange:b,onMoveCell:q,overlays:I,renderMovable:$,viewportComponent:D,onElementLoad:v,getCellEditor:F,onFocus:E,onBlur:S,style:k=Qe.EmptyCssProperties,notifier:N,onShowTooltip:R,onShowColumnTooltip:T,onShowRowTooltip:G,onCloseTooltip:O,gridProps:j,cellRenderProps:z,...B}=t;if(l.useEffect(()=>{p.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[Z,P]=l.useReducer(re=>re+1,0),[M,{width:H,height:oe}]=en(),ue=X(R,[R]),te=X(T,[T]),K=X(G,[G]),le=X(O,[O]),Re=l.useRef(!1);l.useLayoutEffect(()=>{Re.current=!0},[n]);const Te=n?.getStyles(),ae=l.useMemo(()=>$i(o,Te),[o,Te]),Fe=l.useMemo(()=>$i(r,Te),[r,Te]),{body:me={},buttonSurface:Oe={}}=ae,{header:xe={},headerSelect:ge={},headerSelectAll:fe={}}=Fe,Se=l.useRef(null),[pe,Ce]=l.useState(()=>n?.getView()),Ae=(pe?.getZoomScale()??100)/100,ye=l.useMemo(()=>({vertical:pe.isShowColumnGridlines()&&Ae>=.4,horizontal:pe.isShowRowGridlines()&&Ae>=.4}),[pe?.isShowColumnGridlines(),pe?.isShowRowGridlines(),Ae]),De=l.useMemo(()=>{if(pe?.getGridLineColor())return{strokeDasharray:"1,1"}},[pe?.getGridLineColor(),ae]),Pe=s??pe?.isShowColumnHeaders(),$e=d??pe?.isShowRowHeaders(),[C,We]=l.useState({width:0,height:0}),nt=l.useMemo(()=>{let re=40,Ee=20;const ke=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ge=ke?.toCSS()?.fontFamily??ae.header.text.fontFamily,Je=ke?.getSize()??ae.header.text.fontSize,rt=p.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Je*p.IFont.getDeviceScale()),Ge);re=rt.width,Ee=rt.lineHeight}return{width:Math.round(re+5),height:Math.round(Ee+3)}},[C,ae?.header.text,n]),Ke=$e?Ae*nt.width:xe.edgeStrokeWidth,ee=Pe?Ae*nt.height:xe.edgeStrokeWidth,_e=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??nt.width)+Ke+1),Ve=Math.max(oe,(n?.getRowHeaders().getDefaultSize()??nt.height)+ee+1),Me=l.useRef(new Map),Le=l.useRef(null),Ie=()=>({getColOffset:re=>n.getColumnHeaders().findOffset(re),getColIndex:re=>n.getColumnHeaders().findIndex(re),getRowOffset:re=>n.getRowHeaders().findOffset(re),getRowIndex:re=>n.getRowHeaders().findIndex(re)}),[L,se]=l.useState(()=>Ie()),[U,J]=l.useState(!1),[m,_]=l.useState(null),A=!0,x=ae.selection?.strokeFill,V=l.useCallback(()=>jt.current,[]),[y,W]=l.useState(),Y=X(re=>{W(re),n&&n.getView()&&n.getView().setTopLeft(re?{left:re.left,top:re.top}:null),u?.(re)},[n,u]),ie=l.useRef(null);l.useEffect(()=>{if(!y||!n)return;const re=n.getRangeAtBounds({x:y.left,y:y.top,width:y.width,height:y.height});ie.current?.(),ie.current=re.addListener(()=>{const Ee=re.getCoords();Se?.current?.invalidate(Ee)})},[y,n]);const[de,ce]=l.useState(()=>n?.getView().getTopLeft()),he=X(re=>{const Ee=ut.cellToRange(re);if(n.isClosed())return Ee;const ke=n.getRange(Ee,{excludeHidden:!0}).getMerges();return ke.length===0?Ee:ke[0]},[n]),be=re=>{if(!re||re.coords.colIndex===0&&re.coords.rowIndex===0)return null;const Ee={};return re.coords.colIndex>0&&(Ee[ct.Left]={index:re.coords.colIndex,scrollOffset:re.topLeft.left}),re.coords.rowIndex>0&&(Ee[ct.Top]={index:re.coords.rowIndex,scrollOffset:re.topLeft.top}),Ee},[ve,we]=l.useState(()=>be(n.getView().getFreezePanes())),qe=Gt(),Be=l.useCallback(()=>Se.current,[]),ze=X(re=>{qe.setMode(Ee=>Ee?.key==="edit"?{...Ee,args:{...Ee.args}}:{key:"edit",args:{stateAndCoords:null,start:re}})},[]),Ze=X(()=>y,[y]),He=Xl({sheet:n,commands:w,target:Be,onRepeatCommandChange:b,bodyStyle:me,notifier:N,onStartEdit:ze,getViewport:Ze}),[Ye,je]=l.useState(n.getSelection().isEntire()),[et,ht]=l.useState(pe?.getMovableSelection().length>0),Et=m!==null||et,Dt=null,[Xe,at]=l.useState(!1);l.useEffect(()=>{at(!1)},[n.getProtection()]);const Tt=X(()=>{Xe||(at(!0),N.showMessage?.(g.jsxs("span",{children:["This sheet is protected.",g.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:bn.Error}))},[N,Xe]),_t=l.useMemo(()=>{const re=qe.getMode();return re?.cursor?re.cursor:null},[Dt,qe]),[Mt,yt]=l.useState(null),dt=l.useRef(!1),[Bt,on]=l.useState([]),Rn=l.useRef(null),[Kt,En]=l.useState(Vn.EmptyTopLeft),[Nt,Qn]=l.useState(Vn.EmptyTopLeft);l.useEffect(()=>{En({left:de?.left,top:0})},[de?.left]),l.useEffect(()=>{Qn({left:0,top:de?.top})},[de?.top]),it(n?.getView(),{onFreezeSplitChange:()=>{we(be(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ce(n.getView().getTopLeft())},onMovableSelectionChange:()=>{ht(n.getView().getMovableSelection().length>0)}}),it(n?.getSelection(),{onChange:()=>{je(n.getSelection().isEntire())}}),it(n,{onViewChange(){Ce(n.getView()),se(Ie())},onLayoutChange:()=>{const re=n.getEntireRange();We({height:re.getRowCount(),width:re.getColumnCount()}),se(Ie())},onStyleChange:()=>{Zt()},onMovablesChange:()=>{},onInvalidated:()=>{Zt()}}),it(n,{onRequestScrollIntoView:async(re,Ee)=>{if(!Ee)return;const ke={colIndex:Ee?.coords.colStart,rowIndex:Ee?.coords.rowStart};return await Se.current?.scrollCellCoordsIntoView(ke,Ee?.scroll),!0},onRequestFocus:()=>Ue.whenFocus(jt.current)},Dc);const eo=l.useMemo(()=>{const re=(ke,Ge)=>{dt.current=!0,yt([Je=>{if(!Je.toClipBounds(Je.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:ke,colEnd:ke})))return;const rt=Je.getLayout(),st=Math.max(0,rt.getColOffset(ke)),ot=Je.getBounds(),mt=Math.min(ot.x+ot.width,rt.getColOffset(ke+1)),xt=Je.getAnchor();if(Ge!==null&&(xt===ct.Left||xt===ct.Center||xt===ct.Right)){const Uo=Ue.roundAccurately(Ge*Ue.getDPI(),0),io=Ue.roundAccurately(n?.getColumnWidthAsFontUnit(Ge/Ae),2).toFixed(2),Wo="Width: "+(Ge?io+" ("+Uo+" pixels)":"Hidden"),Fn=an.current.getGridElement().getRelativePointFromClient(0,0),cn=0-Fn.y,lo=0-Fn.y+ee,Go={x:st-(Fn.x-ot.x),y:cn,width:mt-st,height:lo-cn};requestAnimationFrame(()=>{dt.current&&te?.({anchor:Go,display:Wo})})}const Vt=[0,0,0,ot.height],In={style:{boxShadow:`0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:x}},Vo={x:st-1,y:0,width:1,height:ot.height},Ho={style:{boxShadow:`-0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:x}},$o={x:mt-1,y:0,width:1,height:ot.height};return g.jsxs(l.Fragment,{children:[g.jsx(ft.SVGLine,{linePoints:Vt,bounds:Vo,...In}),g.jsx(ft.SVGLine,{linePoints:Vt,bounds:$o,...Ho})]},"resize-dividers")}])};let Ee=null;return{onResizeHeadersStart:(ke,Ge,Je)=>{Ee=n.beginCommit(Je),re(ke,Ge)},onResizeHeaders:(ke,Ge,Je)=>{re(ke,Ge)},onResizeHeadersDown:(ke,Ge)=>{re(ke,Ge)},onResizeHeadersEnd:(ke,Ge,Je)=>{Ee?.commit({description:Je}),Ee=null,requestAnimationFrame(()=>le?.()),dt.current=!1,yt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>le?.()),dt.current=!1,yt(null)},...a}},[n,a,ee,Mt]),rn=l.useMemo(()=>{const re=(ke,Ge)=>{dt.current=!0,yt([Je=>{if(!Je.toClipBounds(Je.getRangeCoordsBounds({rowStart:ke,rowEnd:ke,colStart:0,colEnd:C.width})))return;const rt=Je.getLayout(),st=Math.max(0,rt.getRowOffset(ke)),ot=Je.getBounds(),mt=Math.min(ot.y+ot.height,rt.getRowOffset(ke+1)),xt=Je.getAnchor();if(Ge!==null&&(xt===ct.Top||xt===ct.Center||xt===ct.Bottom)){const Uo=Math.floor(10*Ue.getDPI())/10,io=Ue.roundAccurately(Ge*Uo,0),Wo=Ue.roundAccurately(io/Ae/(n?.getRowHeaders().getScaleFactor()*Ue.getDPI()),2).toFixed(2),Fn="Height: "+(Ge?Wo+" ("+io+" pixels)":"Hidden"),cn=_n.current.getGridElement().getRelativePointFromClient(0,0),lo=0-cn.x,Go=0-cn.x+Ke,Vs={x:lo,y:st-(cn.y-ot.y),width:Go-lo,height:mt-st};requestAnimationFrame(()=>{dt.current&&K?.({anchor:Vs,display:Fn})})}const Vt=[0,0,ot.width,0],In={style:{boxShadow:`0px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:x}},Vo={x:0,y:st-1,width:ot.width,height:1},Ho={style:{boxShadow:`0px -0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:x}},$o={x:0,y:mt-1,width:ot.width,height:1};return g.jsxs(l.Fragment,{children:[g.jsx(ft.SVGLine,{linePoints:Vt,bounds:Vo,...In}),g.jsx(ft.SVGLine,{linePoints:Vt,bounds:$o,...Ho})]},"resize-dividers")}])};let Ee=null;return{onResizeHeadersStart:(ke,Ge,Je)=>{Ee=n.beginCommit(Je),re(ke,Ge)},onResizeHeaders:(ke,Ge,Je)=>{re(ke,Ge)},onResizeHeadersDown:(ke,Ge)=>{re(ke,Ge)},onResizeHeadersEnd:(ke,Ge,Je)=>{Ee?.commit({description:Je}),Ee=null,requestAnimationFrame(()=>le?.()),dt.current=!1,yt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>le?.()),dt.current=!1,yt(null)},...c}},[n,c,Ke]),jt=Ft(e,()=>{const re=ke=>{n?.getView()&&n.getView().selectMovables([]),Le.current=null,Se?.current?.focus(ke)},Ee=async(ke=null)=>{if(ke||(ke=n?.getView().getMovableSelection()[0]),!ke)return!1;const Ge=ke.getAnchorCoords();if(!Ge)return!1;const Je=Se.current?.getViewFromCellCoords({colIndex:Ge.colStart,rowIndex:Ge.rowStart});if(!Je)return!1;const rt=Je.getAnchor();n?.getView().getMovableSelection().indexOf(ke)===-1&&n?.getView().selectMovables([ke]);let st=Me.current?.get(rt);return st?.current?(await st.current.focusMovable(ke),!0):(Le.current={movable:ke,anchor:rt},!0)};return{getGridElement:()=>Se.current,getRowHeaderElement:()=>_n.current,getColumnHeaderElement:()=>an.current,rowHeaderHeight:()=>ee,colHeaderWidth:()=>Ke,startEdit:ze,submitEdit:()=>{qe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{qe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:m!==null,focus:ke=>{n?.getView().getMovableSelection().length>0&&Ee()||re(ke)},focusSheet:re,focusMovable:Ee,contains:ke=>Se?.current?.contains?.(ke),invalidate:Zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),Zt=l.useCallback(re=>{Re.current||(Se?.current?.invalidate(re),P?.())},[]);l.useEffect(()=>{Zt()},[ae]);const Tn=Ye?fe.edgeStrokeFill:xe.fill,Oo=Ye?ge.fill:typeof ae.headerHover=="function"?ae.headerHover(xe)?.fill:xe.fill,lt=l.useMemo(()=>D?g.jsx("div",{className:kt("sheetxl-viewport-overlay",oc),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:D}):g.jsx(g.Fragment,{}),[D]);let Mn=null;Pe&&$e&&(Mn=g.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${ee}px`,width:`${Ke}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:re=>{let Ee=!re.ctrlKey;He?.getCommand("selectAll")?.execute(!Ee||re.button!==0),re.nativeEvent.which===_r.Right?i?.({originalEvent:re,clientX:re.clientX,clientY:re.clientY,rowIndex:-1,colIndex:-1}):Se.current?.focus()},children:[g.jsx("div",{style:{height:ee-5+"px",width:ee-5+"px",clipPath:`path('M${ee-5} 0 L0 ${ee-5} L${ee-5} ${ee-5} L${ee-5} 0 Z')`,borderRight:`2px solid ${Tn}`,borderBottom:`2px solid ${Tn}`,background:`${Oo}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),g.jsx("div",{style:{position:"absolute",height:`${ee}px`,width:`${Ke}px`,boxSizing:"border-box",borderRight:`solid 1px ${xe.strokeFill}`,borderBottom:`solid 1px ${xe.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const ln=X(({_left:re,_top:Ee})=>{},[]),to=X(re=>{if(!i)return;const Ee=Se.current.getViewFromClient(re.clientX,re.clientY)?.getCellCoordsFromClient(re.clientX,re.clientY);Ee&&(i({originalEvent:re,clientX:re.clientX,clientY:re.clientY,rowIndex:Ee.rowIndex,colIndex:Ee.colIndex}),re.stopPropagation(),re.preventDefault())},[i]),gt=X(re=>{if(!(!re.shiftKey&&(re.ctrlKey||re.metaKey)))return;const{deltaY:Ee}=re;return Ee>0?He.getCommand("sheetZoomOut")?.execute():Ee<0&&He.getCommand("sheetZoomIn")?.execute(),Ee===0},[He]);l.useEffect(()=>{on(null),Rn.current=null,dt.current=!1,yt(null);const re=n?.getView().getTopLeft();ln(re),Se.current?.scrollTo(re),ce(re),Ce(n.getView()),we(be(n.getView().getFreezePanes())),se(Ie()),P()},[n?.getView()]);const bt=X(re=>{const Ee=re.getVisibleRangeCoords();if(!Ee)return null;const ke=[];return n.getRange(Ee).forEach((Ge,Je)=>{const rt=Je.getCoords(),st=Je.getCell();(ot=>{if(ot.isEmpty())return!1;const mt=ot.getSpans();if(mt.width>1||mt.height>1||ot.getStyle().hasVisibleStyling()||pe.isShowFormulas()&&ot.getFormula()!==null)return!0;const xt=ot.getValue();return xt!==null&&!(!pe.isShowZeros()&&xt===0&&ot.getType()===p.ScalarType.Number)})(st)&&ke.push({coords:rt,value:st,range:pe.isShowFormulas()?null:st.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),ke},[n,pe.isShowZeros(),pe.isShowFormulas(),m]);l.useEffect(()=>{const re=[];I&&re.push(...I),Mt&&re.push(...Mt),Ue.isEqualArrays(re,Rn.current)||(Rn.current=re,on(re))},[I,Mt,ae]);const kn=l.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:o?.body?.text?.fill??"black"}}),[ae?.header?.edgeStrokeFill]),no=X(re=>{re.isDefaultPrevented()||re.isPropagationStopped()||(Le.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),sn=l.useMemo(()=>{const re=qe.getMode();return re?.key==="cut"||re?.key==="copy"},[qe]),jo=X(async re=>{const Ee=qe.getMode();return re.keyCode===St.Escape&&Ee?(re.preventDefault(),void qe.setMode(null)):re.keyCode===St.Enter&&sn?(re.preventDefault(),await He?.getCommand("paste")?.execute(),void qe.setMode(null)):void He?.dispatchToFocusedCommand(re)},[He,qe]),_n=l.useRef(null),oo=l.useMemo(()=>g.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${ee+1}px`,width:`${Ke+xe.edgeStrokeWidth}px`,minWidth:`${Ke+xe.edgeStrokeWidth}px`,borderRight:`solid ${xe.edgeStrokeWidth}px ${xe.edgeStrokeFill}`,height:`calc(100% - ${ee}px)`,boxSizing:"border-box",zIndex:"2"},children:g.jsx(Bi,{ref:_n,sheetElement:jt.current,gridRef:Se,freezeStart:ve?.[ct.Top],oppositeSize:Ke,containerWidth:Ke,containerHeight:Ve,sheetHeader:n.getRowHeaders(),gridStyle:Fe,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Nt,onSheetContextMenu:i,tabIndex:-1,style:{position:"relative",flex:"0",top:`${ee+1}px`,width:`${Ke+xe.edgeStrokeWidth}px`,minWidth:`${Ke+xe.edgeStrokeWidth}px`,borderRight:`solid ${xe.edgeStrokeWidth}px ${xe.edgeStrokeFill}`,height:`calc(100% - ${ee}px)`,boxSizing:"border-box",zIndex:"2",...rn?.style},...rn})}),[Ke,ee,Ve,n,Nt,ve?.[ct.Top],ae,A,i,xe.fill,c]),an=l.useRef(null),ro=l.useMemo(()=>g.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${ee+xe.edgeStrokeWidth}px`,minHeight:`${ee+xe.edgeStrokeWidth}px`,borderBottom:`solid ${xe.edgeStrokeWidth}px ${xe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:g.jsx(Bi,{ref:an,sheetElement:jt.current,gridRef:Se,freezeStart:ve?.[ct.Left],oppositeSize:ee,containerWidth:_e,containerHeight:ee,sheetHeader:n.getColumnHeaders(),gridStyle:Fe,scrollPoint:Kt,onSheetContextMenu:i,...eo,style:{...eo?.style,position:"relative",left:"0px",width:"100%",height:`${ee+xe.edgeStrokeWidth}px`,minHeight:`${ee+xe.edgeStrokeWidth}px`,borderBottom:`solid ${xe.edgeStrokeWidth}px ${xe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[ee,_e,n,Kt,ve?.[ct.Left],ae,xe.fill,A,i,a]),zs=X(re=>{const{value:Ee,key:ke,...Ge}=re;let Je=Ee,rt=m;if(!rt||rt.colIndex===re.coords.colIndex&&rt.rowIndex===re.coords.rowIndex||(rt=null),!Je){const mt=re.range;if(Je=n.getRange({rowIndex:mt.rowStart,colIndex:mt.colStart}).getCell(),Je.isEmpty())return null}let st=null;Je.getHyperlink()&&(st=async mt=>{if(z?.onLinkMouseDown?.(mt),mt.button===0&&!mt.isDefaultPrevented()){mt.stopPropagation(),mt.preventDefault();try{await Je.getHyperlink()?.open()}catch(xt){N?.showError?.(xt)}}}),rt&&rt.colIndex===re.range.colStart&&rt.rowIndex===re.range.rowStart&&(Je=Je.createTemporaryCell({value:null}));const ot=n.getStyles();return l.createElement($l,{...Ge,key:ke,bodyStyle:me,docTheme:ot.getTheme(),normalStyle:ot.getNormal(),showFormulas:pe.isShowFormulas(),showZeros:pe.isShowZeros(),onLinkMouseDown:st,...z,value:Je})},[n,L,me,m,pe?.isShowFormulas(),pe.isShowZeros()]),Os=l.useCallback((re,Ee)=>{const{key:ke,...Ge}=re;return[g.jsx(lc,{ref:Ee,getVisibleCells:bt,sheet:n,gridStyle:ae,...Ge},`border-${ke}`),g.jsx(_c,{ref:Ee,sheet:n,commands:He,...Ge},`table-${ke}`),g.jsx(Ic,{ref:Ee,sheet:n,...Ge},`spill-${ke}`),g.jsx(xc,{ref:Ee,sheet:n,commands:He,notifier:N,onShowTooltip:ue,onCloseTooltip:le,gridStyle:ae,gridRef:Se,editingCoords:m,isActive:A,...Ge},`selection-${ke}`),g.jsx(mc,{ref:Ee,sheet:n,commands:He,gridStyle:ae,element:V,notifier:N,...Ge},`copy-paste-${ke}`),g.jsx(Ec,{ref:Ee,sheet:n,commands:He,target:Be,notifier:N,renderMovable:$,movableProps:{onUnFocus:()=>{jt.current.focus()}},...Ge},`movable-${ke}`),g.jsx(Tc,{ref:Ee,sheet:n,commands:He,notifier:N,gridStyle:ae,getCellEditor:F,showProtectedError:Tt,setEditingCoords:_,...Ge},`editor-${ke}`)]},[n,Se.current,ae,F,He,N]),[Zr,js]=l.useState(!1),Ns=l.useMemo(()=>{if(_e===0||Ve===0)return null;const re=n.getStyles().getNormal(),Ee=re.getFont(),ke=re.getFill(),Ge=re.getBorder(),Je=re.getFill().getType()===p.IFill.Type.None;let rt=De,st=De;const ot=(xt,Vt,In)=>In?{stroke:Ge.getBottom().isNone()?"none":xt.getColor().toRGBA(me.darkMode).toString(),...Vt}:Vt;st=ot(Ge.getBottom(),st,!Ge.getBottom().isNone()),st=ot(Ge.getTop(),st,!Ge.getTop().isNone()),rt=ot(Ge.getRight(),rt,!Ge.getRight().isNone()),rt=ot(Ge.getLeft(),rt,!Ge.getLeft().isNone());let mt=pe?.getGridLineColor()?.toRGBA(me.darkMode).toString()??me.strokeFill;return Je||(st=ot(Ge.getBottom(),st,!0),st=ot(Ge.getTop(),st,!0),rt=ot(Ge.getRight(),rt,!0),rt=ot(Ge.getLeft(),rt,!0)),g.jsx(ft.Grid,{className:"sheetxl-sheet-primary",style:{...Fc,...ke.toCSS(me.darkMode),...Ee.toCSS(me.darkMode,Ae),"--sxl-app-color-background":me.fill,"--sxl-app-color-shadow":ae.colorShadow,"--sxl-app-color-grey":ae.colorGrey,"--sxl-app-color-button-fill":Oe.fill,"--sxl-app-color-button-text":Oe.text?.fill,"--sxl-app-color-button-border":Oe.edgeStrokeFill,"--sxl-app-color-primary-dark":ae.selection.strokeFill},ref:Se,zoom:Ae,...j,onFirstRender:xt=>{js(!0),j?.onFirstRender?.(xt),He?.activate()},showGridLines:ye,gridLineColor:mt,gridLineColumnsProps:rt,gridLineRowsProps:st,freezeLeft:ve?.[ct.Left],freezeLeftProps:kn,freezeTop:ve?.[ct.Top],freezeTopProps:kn,width:_e,height:Ve,columnCount:C.width,rowCount:C.height,cursor:_t??Dt??"cell",clipCells:!0,layout:L,cellRenderer:zs,overlayRenderer:Os,getCellCoordsAsRangeCoords:he,getVisibleCells:bt,onWheelScroll:gt,onPointerDown:no,onKeyDown:jo,onViewportChange:Y,onImmediateScroll:ln,scrollPoint:de,stageProps:{onFocus:()=>{He?.activate()}},overlays:Bt})},[Z]);l.useEffect(()=>{Re.current||P()},[L,ve,Ae,He,de?.left,de?.top,me,j,_e,Ve,_t,Bt,A,Dt]);let No={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};f||(No={...No,...k});const Ps=l.useMemo(()=>{const re=n.getStyles().getTheme(),Ee=re.getColorScheme(),ke=re.getFontScheme();return{"--sxl-doc-color-dk1":Ee.getDk1().toCSS(me.darkMode),"--sxl-doc-color-dk2":Ee.getDk2().toCSS(me.darkMode),"--sxl-doc-color-lt1":Ee.getLt1().toCSS(me.darkMode),"--sxl-doc-color-lt2":Ee.getLt2().toCSS(me.darkMode),"--sxl-doc-color-accent1":Ee.getAccent1().toCSS(me.darkMode),"--sxl-doc-color-accent2":Ee.getAccent2().toCSS(me.darkMode),"--sxl-doc-color-accent3":Ee.getAccent3().toCSS(me.darkMode),"--sxl-doc-color-accent4":Ee.getAccent4().toCSS(me.darkMode),"--sxl-doc-color-accent5":Ee.getAccent5().toCSS(me.darkMode),"--sxl-doc-color-accent6":Ee.getAccent6().toCSS(me.darkMode),"--sxl-doc-color-hlink":Ee.getHlink().toCSS(me.darkMode),"--sxl-doc-color-fol-hlink":Ee.getFolHlink().toCSS(me.darkMode),"--sxl-doc-font-major":ke.getMajorFont(),"--sxl-doc-font-minor":ke.getMinorFont()}},[n.getStyles().getTheme()]);let Po=g.jsx("div",{style:No,onTouchStart:()=>{Yr()},onFocus:re=>{J(!0),E?.(re)},onBlur:re=>{J(!1),S?.(re)},ref:jt,...B,children:g.jsx("div",{className:kt("sheetxl-sheet",nc),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Ps},children:g.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Mn,oo,g.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[ro,g.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${xe.edgeStrokeWidth}px ${xe.edgeStrokeFill}`,backgroundColor:me.fill},ref:M,onContextMenu:to,children:[Ns,lt,g.jsx(rc,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ae?.selection?.strokeFill,colorCredits:ae?.body?.text?.fill})]})]})]})})});if(f){const re=Ee=>g.jsx(Pr,{...Ee,sheet:n});Po=g.jsx(Ar,{style:{flex:"1 1 100%",overflow:"hidden",background:`${xe.fill}`,minHeight:2*nt.height,minWidth:2*nt.width,...k},viewport:y,touchElement:Se.current?.stage,disableTouch:Et,onScrollViewport:Ee=>{Se.current?.scrollTo(Ee)},createHorizontalScrollbar:re,createVerticalScrollbar:re,...h,children:Po})}l.useEffect(()=>{Re.current=!1,P?.(),U&&jt.current?.focus()},[n]);const[Bo,Bs]=l.useState(!1),Yr=X(()=>{Bo||Bs(!0)},[Bo]);return l.useEffect(()=>{if(Zr)return typeof v=="function"&&v(),Qe.detectIt().primaryInput==="touch"&&Yr(),()=>{}},[v,Zr,Bo]),Po}));os.displayName="SheetElement";const Ac=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Wi="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",rs=l.memo(l.forwardRef((t,e)=>{const{children:n,disabled:o,style:r,picture:i,description:s,isDragging:a,view:d,onHide:c,onShow:f,onKeyDownCapture:h,onFocus:u,onBlur:w,loadingPanel:b,...q}=t,[I,$]=l.useState(!1),[D,v]=l.useState(null),[F,E]=l.useState(null),[S,k]=l.useState(null);l.useEffect(()=>{E(null),i.getDetails().then(T=>{$(!1),E(T.asUrl()),T.asSVGText?.()&&k(T.asSVGText())}).catch(T=>{console.warn(T),$(!0),E(Wi),k(null)})},[i]);const N=Ft(e,()=>({isPictureEditor:()=>!0}),[]),R=l.useMemo(()=>{if(F||S)return g.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:I?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:I?"var(--sxl-app-color-background, white)":void 0,boxShadow:I?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:I?"contain":void 0,opacity:D?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:F,onLoad:()=>{v(!0)},onError:({currentTarget:T})=>{console.log("error"),T.onerror=null,E(Wi),$(!0)},alt:s??`${i.getType()}`})},[D,i,F,S,a]);if(!i.isClosed())return g.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:a?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...r,width:"100%",height:"100%"},tabIndex:0,...q,onKeyDownCapture:T=>{h?.(T)},ref:N,children:[D||I?void 0:b,R]})}));rs.displayName="PictureEditor";const Lc=l.memo(l.forwardRef((t,e)=>{const{children:n,disabled:o,chart:r,view:i,isDragging:s,onHide:a,onShow:d,...c}=t;l.useEffect(()=>{},[r]);const f=Ft(e,()=>({isChartEditor:()=>!0}),[]),[h,{height:u,width:w}]=en();if(!r.isClosed())return g.jsx("div",{...c,ref:Cn([f,h]),children:g.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:o?"blur(1px)":void 0,boxShadow:s?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:g.jsx("div",{style:{textAlign:"center"},children:r.getDescription()})})})})),zc="_editable-input_1bqx6_6",Oc=t=>g.jsx("input",{...t}),is=l.memo(l.forwardRef((t,e)=>{const{style:n={},className:o,value:r="",onSubmit:i,onChange:s,onCancel:a,createInput:d=Oc,notifier:c,styleHover:f={},dragging:h,maxLength:u,disabled:w=!1,readOnly:b=!1,...q}=t,[I,$]=l.useState(!1),[D,v]=l.useState(!1),[F,E]=l.useState(r);l.useEffect(()=>{E(r)},[r]);const S=l.useRef(null),[k,N]=l.useState(null),R=l.useCallback(function(Z){const P=Z.message;k!==P&&(c?.showMessage?.(P,{type:bn.Error}),N(P))},[c,k]),T=l.useCallback(Z=>{let P=!1;try{P=i?.(Z)??!0}catch(M){R(M)}return P?(S.current=null,v(!1),E(Z),P):(setTimeout(()=>{S.current?.focus()},0),P)},[i]),G=X(()=>{E(r),S.current=null,v(!1),a?.()},[a,r]),O=l.useMemo(()=>{if(!D)return null;const Z={className:kt(zc),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:u,type:"text",value:F,onFocus:P=>{S.current||(S.current=P.target,setTimeout(()=>{P.target?.select()},0))},onBlur:P=>{S.current&&T(F)},onChange:P=>{D&&E(P.target.value)},onMouseDown:P=>P.stopPropagation(),onKeyDown:P=>P.code==="Escape"?(P.preventDefault(),void G()):P.code==="Enter"?(P.preventDefault(),void T(P.target.value)):void(P.code!=="Tab"?P.stopPropagation():T(P.target.value))};return g.jsx(g.Fragment,{children:d(Z)})},[D,F,T,G,d,w]),[j,z]=l.useState();l.useLayoutEffect(()=>{let Z=Object.assign({},n);(h||I)&&(Z=Object.assign(Z,f)),z(Z)},[h,I,f,n]),l.useEffect(()=>{O&&s?.(F)},[O,s,F]);const B=Ft(e,()=>({startEdit(){w||b||v(!0)},cancel(){G()}}),[]);return g.jsxs("div",{...q,ref:B,style:{flexDirection:"column",display:"flex",...j},className:kt(o),children:[g.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{w||b||v(!0)},onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:[g.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:D?0:1},children:F}),O]}),g.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...f},children:F})]})})),Fo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Sn(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Br(t){return"nodeType"in t}function Rt(t){var e,n;return t?Sn(t)?t:Br(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Vr(t){const{Document:e}=Rt(t);return t instanceof e}function Yn(t){return!Sn(t)&&t instanceof Rt(t).HTMLElement}function ls(t){return t instanceof Rt(t).SVGElement}function xn(t){return t?Sn(t)?t.document:Br(t)?Vr(t)?t:Yn(t)||ls(t)?t.ownerDocument:document:document:document}const zt=Fo?l.useLayoutEffect:l.useEffect;function Do(t){const e=l.useRef(t);return zt(()=>{e.current=t}),l.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}function Gn(t,e){e===void 0&&(e=[t]);const n=l.useRef(t);return zt(()=>{n.current!==t&&(n.current=t)},e),n}function jn(t,e){const n=l.useRef();return l.useMemo(()=>{const o=t(n.current);return n.current=o,o},[...e])}function qo(t){const e=Do(t),n=l.useRef(null),o=l.useCallback(r=>{r!==n.current&&e?.(r,n.current),n.current=r},[]);return[n,o]}function Ro(t){const e=l.useRef();return l.useEffect(()=>{e.current=t},[t]),e.current}let ir={};function Xn(t,e){return l.useMemo(()=>{if(e)return e;const n=ir[t]==null?0:ir[t]+1;return ir[t]=n,t+"-"+n},[t,e])}function ss(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,s)=>{const a=Object.entries(s);for(const[d,c]of a){const f=i[d];f!=null&&(i[d]=f+t*c)}return i},{...e})}}const vn=ss(1),Kn=ss(-1);function Ao(t){if(!t)return!1;const{KeyboardEvent:e}=Rt(t.target);return e&&t instanceof e}function Eo(t){if(function(e){if(!e)return!1;const{TouchEvent:n}=Rt(e.target);return n&&e instanceof n}(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(t)?{x:t.clientX,y:t.clientY}:null}const tn=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[tn.Translate.toString(t),tn.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:o}=t;return e+" "+n+"ms "+o}}}),Gi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jc(t){return t.matches(Gi)?t:t.querySelector(Gi)}const Nc={display:"none"};function Pc(t){let{id:e,value:n}=t;return l.createElement("div",{id:e,style:Nc},n)}function Bc(t){let{id:e,announcement:n,ariaLiveType:o="assertive"}=t;return l.createElement("div",{id:e,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const as=l.createContext(null),Vc={draggable:`
|
|
23
|
+
The content is not applied.`}),new r.Command("pasteFormulas",w,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",w,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",w,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(k,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(k=>B.paste({...Dl,...k})).update(w),i.getCommand("pasteFormats").updateCallback((k,O)=>B.paste({...zl,description:O.label(),...k})).update(w),i.getCommand("pasteFormulas").updateCallback((k,O)=>B.paste({...Nl,description:O.label(),...k})).update(w),i.getCommand("pasteTranspose").updateCallback((k,O)=>B.paste({...Ll,description:O.label(),...k})).update(w),i.getCommand("pasteLinks").updateCallback((k,O)=>B.paste({...Ol,description:O.label(),...k})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const S=o.useMemo(()=>{if(!D||!q.current)return;const w=D.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const k=q.current.getItem();if(k.getSource()!==t)return;const O=q.current.isCut?.(),E=O?x:g,F=O?p:m,Z=k.getCoords(),_=Z?[Z]:null;return _&&_.length!==0?P=>{const V=[];for(let $=0;$<_.length;$++){const oe=_[$],L=P.toClipBounds(P.getRangeCoordsBounds(oe,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);L&&(V.push(T({range:oe,key:`copy-selection-background-${$}`,x:L.x,y:L.y,width:Math.max(L.width,0),height:Math.max(L.height,0),stroke:E,strokeWidth:2})),V.push(T({range:oe,key:`copy-selection-foreground-${$}`,x:L.x+(L.width<=2?-1:0),y:L.y,width:Math.max(L.width,3),height:Math.max(L.height,3),stroke:F,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[D,t,n,m,g,p,x]);return{...B,clipboard:y,overlays:S}},jl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,p=l.body??{},g=a.getView(),{overlays:x}=qr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:p.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:p.fill,notifier:m});return tt(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),x&&n?x(n):null})),Bl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Pl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Hl={key:"dragCopy",description:"Drag selection to copy cell contents."},Ul={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Uo=(e,t)=>t.ctrlKey&&t.shiftKey?Ul:t.ctrlKey?Hl:t.shiftKey?Pl:Vl,Kl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},$l=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:p,sheet:g,gridRef:x,gridStyle:h,isActive:f,editingCoords:T,...q}=e,A=n?.getBounds(),D=r.useCallbackRef(m,[m]),G=r.useCallbackRef(p,[p]),[U,y]=o.useState(()=>g?.getSelection().getCoords()),B=r.useCallbackRef(ce=>{ue.CoordUtils.isEqualSelectionCoords(ce,U)||g&&g.getSelection().updateCoords(ce)},[g,U]),S=r.useEditMode(),w=o.useRef(null),[k,O]=o.useState(g?.getProtection().isLocked()),[E,F]=o.useState(g?.getView().getMovableSelection().length>0),Z=r.ReactUtils.detectIt().primaryInput==="touch",_=!Z&&f,P=T!==null||E,V=r.useCallbackRef(ce=>{const de=ue.CoordUtils.cellToRange(ce);if(g.isClosed())return de;const he=g.getRange(de,{excludeHidden:!0}).getMerges();return he.length===0?de:he[0]},[g]),$=r.useCallbackRef((ce,de,he,pe,xe,Me)=>{const be=g.getSelectedRange().getExtended(pe,ce).getCoords();switch(pe){case s.IRange.Direction.Up:return be.rowStart;case s.IRange.Direction.Down:return be.rowEnd;case s.IRange.Direction.Left:return be.colStart;case s.IRange.Direction.Right:return be.colEnd}},[g]),oe=r.useCallbackRef(()=>{const ce=g.getUsedRange()?.getCoords(),de=g.getRowHeaders().getUsedRange()?.getCoords(),he=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ce,colEnd:Math.max(ce?.colEnd??0,he?.max??0),rowEnd:Math.max(ce?.rowEnd??0,de?.max??0)}},[g]),L=r.useCallbackRef((ce,de)=>g.getRowHeaders().hiddenHeadersAt(ce,de),[g]),z=r.useCallbackRef((ce,de)=>g.getColumnHeaders().hiddenHeadersAt(ce,de),[g]),K=r.useCallbackRef(ce=>g.getRange(ce,{excludeHidden:!0}).getMerges(),[g]),W=r.useCallbackRef(ce=>{g?.getSelection().setAdjusting(ce)},[g]),Ce=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),S.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),S.setMode(null))},[S,U,g,i]),ae=o.useMemo(()=>{const ce=S.getMode();return ce?.key==="cut"||ce?.key==="copy"},[S]);tt(g?.getView(),{onMovableSelectionChange:()=>{F(g.getView().getMovableSelection().length>0)}}),tt(g?.getSelection(),{onChange(ce){const de=g.getSelection().getCoords();y(de)}}),tt(g,{onProtectionChange:()=>{O(g.getProtection().isLocked())}});const{body:Q={}}=h||{},ee=n.getLayout(),we=!(_&&U.ranges.length<=1&&T===null&&!k&&(!S.getMode()||ae)),{cursor:ke,overlay:ve,onPointerDown:Pe}=dt.useSelection({gridRef:x,commands:i,layout:ee,getCellCoordsAsRangeCoords:V,selection:U,fillHandleBorderColor:Q.fill,selectionBackgroundColor:f?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:f?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:f?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:f?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:we,disableMoveDrag:Z||!(f&&U.ranges.length<=1&&T===null&&!k),disableTouchSelection:P,onSelectionChange:B,onSelectionDragStart:W,onSelectionDragEnd:Ce,onMoveDragStart:(ce,de,he)=>{S.setMode(Uo(0,he))},onMoveDragUpdate:(ce,de,he)=>{S.setMode(Uo(0,he))},onMoveDragEnd:(ce,de)=>{S.setMode(null)},onMoveDragDone:async(ce,de,he)=>{if(ue.CoordUtils.isEqualRanges(ce,de))return;const pe=g.getRange(de);if(d?.showOptions){const Le=pe.getDifferences(ce);let Ve=!1;for(let C=0;!Ve&&C<Le.getCount();C++)Ve=Le.at(C).isContentful();if(Ve&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const xe=!he.ctrlKey,Me=he.shiftKey,be=Me?xe?"Insert Moved Cells":"Insert Copied Cells":xe?"Move Cells":"Copy Cells",Ee=await d?.showBusy?.(be);try{const Le=g.getRange(ce);await pe.doBatch(async()=>{Me?await pe.insertFrom(ce,{isCut:xe,undoRange:Le}):await pe.copyFrom(ce,{isCut:xe,undoRange:Le}),Le.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),pe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:be,autoSelect:!0})}catch(Le){d?.showError?.(Le)}finally{Ee?.()}},contentfulCellFinder:$,hiddenRowsAt:L,hiddenColumnsAt:z,mergedRanges:K,getDataCoords:oe,canSelectionSpanMergedCells:ce=>{const de=g.getRange(ce);return de.isEntireColumns()||de.isEntireRows()},onFill:async(ce,de)=>{const he="Auto Fill",pe=await d?.showBusy?.(he);try{await g.doBatch(()=>{g.getRange(ce).autoFill(de),g.getRange(de).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:he,autoSelect:!0})}catch(xe){d?.showError?.(xe)}finally{w.current=null,pe?.()}},onFillPreview:(ce,de,he)=>{if(x.current&&D){S.setMode(Kl);try{w.current?.direction!==he&&(w.current=null,g.getRange(ce).autoFill(de,{previewOnly:C=>{w.current={callback:C,direction:he}}}));const pe=w.current?.callback?.(de);if(!pe||pe.isEmpty())return;const xe=pe.toText();if(!xe)return;const Me=ue.CoordUtils.cellToRange(pe.getCoords()),be=n.getRelativePointFromClient(0,0);let Ee=0,Le=0,Ve=r.ToolTipPlacement.Bottom;if(he===s.IRange.Direction.Down){Ee=ee.getColOffset(Me.colEnd+1)-be.x;const C=ee.getRowOffset(Me.rowEnd),Ue=ee.getRowOffset(Me.rowEnd+1);Le=Ue-(Ue-C)/2-be.y,Ve=r.ToolTipPlacement.Right}else if(he===s.IRange.Direction.Right){Le=ee.getRowOffset(Me.rowEnd+1)-be.y;const C=ee.getColOffset(Me.colEnd),Ue=ee.getColOffset(Me.colEnd+1);Ee=Ue-(Ue-C)/2-be.x,Ve=r.ToolTipPlacement.Bottom}else if(he===s.IRange.Direction.Up){Ee=ee.getColOffset(Me.colEnd+1)-be.x;const C=ee.getRowOffset(Me.rowStart),Ue=ee.getRowOffset(Me.rowStart+1);Le=Ue-(Ue-C)/2-be.y,Ve=r.ToolTipPlacement.Right}else if(he===s.IRange.Direction.Left){Le=ee.getRowOffset(Me.rowEnd+1)-be.y;const C=ee.getColOffset(Me.colStart),Ue=ee.getColOffset(Me.colStart+1);Ee=Ue-(Ue-C)/2-be.x,Ve=r.ToolTipPlacement.Bottom}D({anchor:{x:Ee,y:Le},display:xe,placement:Ve})}catch(pe){d?.showError?.(pe)}}},onFillDone:()=>{w.current=null,S.setMode(null),G?.()}}),ge=r.useCallbackRef(ce=>{Pe(r.ReactUtils.createSyntheticEvent(ce))},[Pe,T]);o.useEffect(()=>{const ce=n?.getStage();if(ce)return ce.addEventListener("pointerdown",ge),()=>{ce.removeEventListener("pointerdown",ge)}},[n?.getStage()]);const He=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:bt(a,"sheet-selection",Bl),style:{position:"absolute",width:A?.width,height:A?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Wt([He,Se]),...q,children:ve(n)})})),kn=Object.freeze({x:0,y:0,width:0,height:0}),Wl={fireOnModelChange:!1},Gl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:p,onUnFocus:g,isDragging:x,updateFrameBounds:h,dragStart:f,style:T,disabled:q,renderMovable:A,...D}=e,[G,U]=o.useState(kn),[y,B]=o.useState(null),[S,w]=o.useState(!1),k=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const E=a.getBounds();if(!E)return;const F=i.toViewBounds(E);U(F??kn),h(F??kn)},[i?.getBounds()]),tt(a,{onBoundsChange:E=>{const F=E.getBounds();if(!F)return;const Z=i.toViewBounds(F);U(Z??kn),h(Z)},onSelectionChange:()=>{const E=ue.CommonUtils.hasFocus(k.current,!0);!S&&!E||a.isSelected()||g()}}),tt(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(k.current,!0)},Wl),o.useEffect(()=>{const E=k.current;return l(E),()=>{d(E)}},[]);const O=o.useMemo(()=>{if(!G)return null;let{width:E,height:F}=G;return A({view:i,movable:a,disabled:q,isDragging:x,style:{position:"relative",left:0,top:0,width:E,height:F},onHide:m,onShow:p})},[i,a,G.width,G.height,q,x]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Wt([k,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:G.x,top:G.y,width:G.width,height:G.height,...T},onMouseDown:async E=>{const F=E.shiftKey||E.ctrlKey,Z=a.isSelected(),_=E.currentTarget;F&&Z?a.unselect():(Z&&!F||await a.select({addToSelection:F}),f(E.nativeEvent,_),_.focus())},onFocus:E=>{E.relatedTarget&&!y&&B(E.relatedTarget),w(!0)},onBlur:E=>{y&&!k?.current?.contains(E.relatedTarget)&&B(null),E.relatedTarget&&w(!1)},...D,children:O})})),_l="_movable-area_314c6_5",Sr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:p,disabled:g=!1,disableDrag:x=!1,disableResize:h=!1,className:f,style:T,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:A,...D}=e,G=n.getBounds(),U=r.useCallbackRef(A,[A]),y=r.useCallbackRef(m,[m]),B=r.useCallbackRef(p,[p]),[S,w]=o.useState([]),[k,O]=o.useState(!1),[E,F]=o.useState(!1),Z=o.useRef(!0),_=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),oe=o.useRef(new Map),L=o.useRef({onRequestFocus:J=>(de(J),null)}),z=o.useRef(null),K=o.useRef(null),W=o.useRef(null),[Ce,ae]=o.useReducer(J=>J+1,0);o.useLayoutEffect(()=>{ae()},[n,i]),tt(i,{onCollectionChange:()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Fe=oe.current;Fe.forEach(Ie=>{Ie()}),Fe.clear();const Be=L.current;for(let Ie=0;Ie<J.length;Ie++){const ze=J[Ie];if(ze.isClosed())continue;const Ae=ze.addListeners(Be);Fe.set(ze,Ae)}ae()},onInvalidated:()=>{ae()}}),tt(a,{onMovableSelectionChange(J){ee(),ae()}});const Q=o.useCallback((J,Fe)=>{const Be=V.current.get(J);W.current&&(W.current.getTargets().forEach(Ie=>{if(Ie===Be)return Ie.style.left=Fe.x+"px",Ie.style.top=Fe.y+"px",Ie.style.width=Fe.width+"px",void(Ie.style.height=Fe.height+"px")}),W.current.updateRect())},[]),ee=()=>{const J=[],Fe=a.getMovableSelection();Fe.forEach(Be=>{const Ie=V.current.get(Be);Ie&&Fe.indexOf(Be)!==-1&&J.push(Ie)}),w(Be=>ue.CommonUtils.isEqualArrays(Be,J)?Be:J)},we=o.useRef(null),ke=o.useMemo(()=>new Promise(J=>{we.current=J}),[]),ve=o.useRef(null),Pe=r.useCallbackRef(async(J,Fe)=>{ve.current=Fe,await(async()=>!(!await ke.then()||!W.current))()&&ve.current===Fe&&W.current.dragStart(J,Fe)},[S]),[ge,He]=o.useState(!1),Se=o.useRef(null),ce=o.useRef(null),de=r.useCallbackRef(async(J=null)=>{if(J||(J=a.getMovableSelection()[0]),!J)return y?.(),!1;const Fe=V.current.get(J);Fe?(await ue.CommonUtils.whenFocus(Fe),Fe.focus(),ce.current=Fe,Se.current=null):Se.current=J},[a]);o.useEffect(()=>{ge&&S.length>0&&ce.current!==S[0]&&de(),Z.current&&(U?.(),Z.current=!1)},[S]);const he=o.useMemo(()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(J.length===0&&_.current.size===0)return null;const Fe=(R,re,j,Y=!0)=>{const u=R.isSelected(),M={tabIndex:j,view:n,movable:R,onRefLoad:I=>{Se.current===R&&(I.focus(),ce.current=I,Se.current=null),V.current.set(R,I),P.current.set(I,R),re.rendered=!0,ee()},onRefUnload:I=>{V.current.delete(R),P.current.delete(I),re.rendered=!1,ee()},onUnFocus:y,onHide:I=>{re.onHide=I},onShow:I=>{re.onShow=I},isDragging:u&&(E||k),disabled:g,renderMovable:l,updateFrameBounds:I=>{Q(R,I)},dragStart:Pe,onMouseUp:()=>{if(ve.current=null,K.current){O(!1),F(!1);let I=!1;$.current?.forEach(b=>{ue.CommonUtils.isEqualBounds(b.movable.getBounds(),b.startBounds)||(I=!0)}),I?xe():Me()}},style:{opacity:Y?k&&u?.7:void 0:0,zIndex:k&&u?R.getZIndex()+J.length:void 0,pointerEvents:Y?void 0:"none",cursor:E&&u?"grabbing":g||x?"initial":"move",boxShadow:!u||E&&!k?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Gl,{...M},`movable-${R.getUUID()}`)},Be=_.current,Ie=new Map,ze=[];for(let R=0;R<J.length;R++){const re=J[R];if(re.isClosed())continue;let j=Be.get(re);j||(j={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const M=++u.visibilityRequestId;requestAnimationFrame(()=>{const I=_.current.get(Y);I&&M===u.visibilityRequestId&&(u.onShow?.(Y),I.shown=!0)})},doHide:async(Y,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const M=++u.visibilityRequestId,I=await Promise.resolve(u.onHide?.(Y));M===u.visibilityRequestId&&I!==!1&&(u.shown=!1,_.current.delete(Y),ae())},visibilityRequestId:0}),j.frame=Fe(re,j,R,!0),ze.push(j.frame),j.doShow(re,j),Be.delete(re),Ie.set(re,j)}const Ae=[];return a.getMovableSelection().forEach(R=>{const re=Be.get(R);re&&(re.frame=Fe(R,re,-1,!1),Ae.push(re.frame),Be.delete(R),Ie.set(R,re))}),Be.forEach((R,re)=>{R.frame=Fe(re,R,-1,!1),Ae.push(R.frame),R.doHide(re,R),Be.delete(re),Ie.set(re,R)}),_.current=Ie,ee(),[...Ae,...ze]},[Ce,n,l,g,x,h,k,E]),pe=r.useCallbackRef((J,Fe)=>{const Be=`${Fe} ${S.length===1?s.TextUtils.capitalize(P.current?.get(S[0]).getContent().getType()):"Drawings"}`;K.current&&(console.warn(`Transaction ${K.current.getDescription()} is being replaced by ${Be}`),K.current.rollback(),K.current=null),K.current=d.beginCommit({description:Be}),$.current.clear();for(let Ie=0;Ie<S.length;Ie++){const ze=S[Ie],Ae=P.current?.get(ze);Ae?$.current.set(ze,{movable:Ae,startBounds:n.toViewBounds(Ae.getBounds())}):console.warn("invalid element",Ae)}},[d,n,S]),xe=o.useCallback(()=>{if(!K.current)return;const J=[];$.current?.forEach(Fe=>{J.push(Fe.movable)}),K.current.commit({viewAfter:{view:a,movableSelection:J}}),$.current.clear(),K.current=null},[]),Me=o.useCallback(()=>{K.current&&(K.current.rollback(),K.current=null)},[]),be=o.useRef(null);o.useEffect(()=>{be.current&&(be.current.onscroll=J=>{J.preventDefault(),J.srcElement.scrollTop=0,J.srcElement.scrollLeft=0})},[be.current]);const Ee=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:de,focus:()=>{de()}}),[a]),[Le,Ve]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Qe=o.useRef(!1);o.useEffect(()=>{if(g||S.length===0||Qe.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{W.current&&z.current&&W.current.refTargets.length>0&&(Qe.current=!0,we.current?.(!0)),w([...S])});C.current=!0;const J=o.lazy(async()=>{try{const Fe=await Promise.resolve().then(()=>require("./CsK6mjkIvPry4SgD.cjs"));return C.current=!1,Ue.current=!0,w([...S]),Fe}catch(Fe){return console.warn(Fe),we.current?.(!1),null}});Ve(J)},[S,g,x,h]);const $e=o.useMemo(()=>!Le||g?null:c.jsx(o.Suspense,{children:c.jsx(Le,{className:bt({dragging:k||E,resizing:k,moving:E}),container:null,ref:W,target:W.current?S:[],draggable:!g&&!x,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:J=>{pe(J.target,"Resize")},onResize:J=>{if(!K.current)return J.stopDrag(),void ae();O(!0);const Fe=J.direction[0]!==0&&J.direction[1]!==0;let Be=0,Ie=0;for(let ze=0;ze<S.length;ze++){const Ae=S[ze],R=$.current.get(Ae),re=P.current.get(Ae);if(!R||!re){console.warn("invalid element");continue}let j=J.dist[0],Y=J.dist[1],u=J.drag.dist[0],M=J.drag.dist[1],I=R.startBounds.width,b=R.startBounds.height;ze===0?(Be=I,Ie=b):(j*=I/Be,u*=I/Be,Y*=b/Ie,M*=b/Ie);const N={...R.startBounds};if(N.width=Math.max(0,I+j),N.height=Math.max(0,b+Y),J.direction[0]===-1&&(N.width=Math.max(0,Math.min(R.startBounds.x+I,I-u))),J.direction[1]===-1&&(N.height=Math.max(0,Math.min(R.startBounds.y+b,b-M))),Fe&&(re.isLockAspectRatio()||J.inputEvent?.shiftKey)){const v=I/b,H=N.width/N.height;H>v?N.height=N.width/v:H<v&&(N.width=N.height*v)}J.direction[0]===-1&&(N.x=Math.max(0,Math.min(R.startBounds.x+I,R.startBounds.x+I-N.width))),J.direction[1]===-1&&(N.y=Math.min(R.startBounds.y+b,R.startBounds.y+b-N.height)),R.movable.setBounds(n.toAbsoluteBounds(N))}},onResizeEnd:J=>{O(!1),xe()},onDragStart:J=>{pe(J.target,"Move")},onDrag:J=>{if(!K.current)return J.stopDrag(),void ae();F(!0);for(let Fe=0;Fe<S.length;Fe++){const Be=S[Fe],Ie=$.current.get(Be);Ie?Ie.movable.setBounds(n.toAbsoluteBounds({...Ie.startBounds,x:Ie.startBounds.x+J.translate[0],y:Ie.startBounds.y+J.translate[1]})):console.warn("invalid element")}},onDragEnd:J=>{},onMouseUp:J=>{}})}),[Ce,Le,S,n,g,x,h,k,E]);return c.jsx("div",{className:bt(f,"movable-area",_l),style:{width:G.width,height:G.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Wt([Ee,be]),...D,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:G.width,height:G.height},...D,children:c.jsxs("div",{ref:z,style:{position:"absolute",pointerEvents:"auto"},onFocus:J=>{B?.(),He(!0)},onBlur:J=>{He(!1)},onKeyDownCapture:J=>{if(J.isDefaultPrevented())return;const Fe=J.nativeEvent.ctrlKey,Be=J.nativeEvent.altKey,Ie=J.nativeEvent.shiftKey;if(J.which===r.KeyCodes.Escape){const j=a.getMovableSelection();let Y=[...j];return S.forEach(u=>{if(Y.length===0)return;const M=P.current.get(u);let I=Y.indexOf(M);Y.splice(I,1)}),Y.length!==j.length&&a.selectMovables(Y),Y.length===0&&y?.(),void J.preventDefault()}const ze=.1,Ae=j=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+j)},"Rotate")},R=(j,Y=!0)=>{i.updateSelected(u=>{const M=u.getBounds();let I=1+j;Y||(I=1/I);const b=Math.sqrt(Math.pow(M.width,2)+Math.pow(M.height,2)),N=Math.atan2(M.height,M.width),v=I*b;if(v<10)return;const H=v*Math.cos(N),X=v*Math.sin(N),ne={x:M.x+(M.width-H)/2,y:M.y+(M.height-X)/2,width:H,height:X};u.setBounds(ne)},"Resize")},re=j=>{i.updateSelected(Y=>{const u=Y.getBounds(),M={x:u.x+(j.x??0),y:u.y+(j.y??0),width:u.width+(j.width??0),height:u.height+(j.height??0)};Y.setBounds(M)},"Nudge")};if(J.which===r.KeyCodes.Delete)i.updateSelected(j=>{j.delete()},"Delete"),J.preventDefault();else if(J.key==="a"&&Fe){const j=a.getMovableSelection();a.selectMovables(i.search(),!0),a.selectMovables(j,!0),J.preventDefault()}else J.key==="ArrowLeft"?(Ie?R(ze,!1):Be?Ae(-10):re({x:Fe?-10:-1}),J.preventDefault()):J.key==="ArrowRight"?(Ie?R(ze,!0):Be?Ae(10):re({x:Fe?10:1}),J.preventDefault()):J.key==="ArrowUp"?(Ie?R(ze,!0):re({y:Fe?-10:-1}),J.preventDefault()):J.key==="ArrowDown"&&(Ie?R(ze,!1):re({y:Fe?10:1}),J.preventDefault())},children:[he,$e]})})})})),Ht=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ko=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,p=0;for(let h=0;h<e.length;h++){const f=e[h],T=f.getBounds();d+=T[l],m=Math.min(T[i],m),p=Math.max(T[i]+T[l],p),n.push({bounds:T,movable:f})}const g=(p-m-d)/(e.length-1);n.sort((h,f)=>{const T=h.bounds[i],q=f.bounds[i];return T!==q?T-q:h.bounds[a]-f.bounds[a]});const x=new Map;x.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const f=n[h-1].bounds,T={...n[h].bounds};T[i]=f[i]+f[l]+g,n[h].bounds=T,x.set(n[h].movable,T)}return x.set(n[n.length-1].movable,n[n.length-1].bounds),x};function Rr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,p=r.useEditMode();o.useRef(p.getMode()).current=p.getMode();const g=r.useCallbackRef(async(y,B,S=null,w=!0)=>{const k=async()=>{const O=await Promise.resolve(m?.showBusy?.(y.label()));try{await B();const E=S??y?.label?.();if(d){let F=null;y&&E!==!1&&(F=new r.SimpleCommand(y.key(),l,{label:E,description:E},k)),d(F)}O?.(),w&&p.setMode(null)}catch(E){O?.(),m?.showError?.(E)}};await k()},[d,m]),[x,h]=o.useReducer(y=>y+1,0),f=r.useCallbackRef((y,B,S)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let k="Drawings";if(w.length===1){const E=w[0];k=s.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const O=`${y.label()} ${k}`;g(y,()=>{let E=null;i&&(E=i.beginCommit(O));const F=n.getMovableSelection();if(F.length===0)return;const Z=S?.(F);for(let _=0;_<F.length;_++){const P=F[_];B(P,Z)}E?.commit()})},[n,i]),[T,q]=o.useState(n.getMovableSelection()[0]??null),[A,D]=o.useState(!T||T?.isProtected()),G=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,y=>{y.setLockAspectRatio(!y.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(y,B)=>{y.setBounds({x:B.x})},Ht)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(y,B)=>{y.setBounds({x:(B.width-y.getBounds().width)/2+B.x})},Ht)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(y,B)=>{y.setBounds({x:B.width-y.getBounds().width+B.x})},Ht)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(y,B)=>{y.setBounds({y:B.y})},Ht)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(y,B)=>{y.setBounds({y:(B.height-y.getBounds().height)/2+B.y})},Ht)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(y,B)=>{y.setBounds({y:B.height-y.getBounds().height+B.y})},Ht)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Ko(y))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Ko(y,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,T]);o.useEffect(()=>{},[p]);const U=o.useMemo(()=>{let y=null;return y=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),y.addCommands(G,!0),y},[a,G]);return tt(T,{onAnyChange:()=>{U.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===s.IAnchored.Type.TwoCell}),U.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===s.IAnchored.Type.OneCell}),U.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:y=>{D(y.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const y=n.getMovableSelection()[0]??null;q(y),D(!y||y.isProtected()),h()}}),tt(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const y={disabled:A};U.getCommand("formatAnchorTypeTwoCell").update(y),U.getCommand("formatAnchorTypeOneCell").update(y),U.getCommand("formatAnchorTypeAbsolute").update(y),U.getCommand("toggleLockAspectRatio").update(y);const B=t.getCount(),S=n.getMovableSelection(),w=A||B<=1||S.length===0;let k={disabled:w},O=k;if(!w&&S.length===1){const Z=S[0];Z.getZIndex()===0&&(k={disabled:!0}),Z.getZIndex()===B-1&&(O={disabled:!0})}U.getCommand("moveToFront").update(O),U.getCommand("moveForward").update(O),U.getCommand("moveToBack").update(k),U.getCommand("moveBackward").update(k);const E={disabled:A||S.length<=1};U.getCommand("formatDrawAlignLeft").update(E),U.getCommand("formatDrawAlignCenter").update(E),U.getCommand("formatDrawAlignRight").update(E),U.getCommand("formatDrawAlignTop").update(E),U.getCommand("formatDrawAlignMiddle").update(E),U.getCommand("formatDrawAlignBottom").update(E),U.getCommand("formatDrawFlipHorz").update(E),U.getCommand("formatDrawFlipVert").update(E),U.getCommand("formatDrawGroup").update(E),U.getCommand("formatDrawUngroup").update(E),U.getCommand("formatDrawSwapShapes").update(E),U.getCommand("formatDrawSwapShapesHorz").update(E),U.getCommand("formatDrawSwapShapesVert").update(E);const F={disabled:A||S.length<=2};U.getCommand("formatDrawDistributeHorz").update(F),U.getCommand("formatDrawDistributeVert").update(F)},[x,A,x]),U}const Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const x=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:f,width:T}]=zt();return c.jsx("div",{...g,ref:Wt([x,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Xl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:p,onRepeatCommandChange:g}=e,x=Rr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:p});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Sr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{x.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,x]);return h&&n?h:null})),Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:p,notifier:g=r.DefaultNotifier}=e,x=r.useEditMode(),[h,f]=o.useState(null),[T,q]=o.useState(null),[A,D]=o.useState(null),[G,U]=o.useState(null),[y,B]=o.useState(null);o.useLayoutEffect(()=>{if(A===null)return U(null),void B(null);const z=()=>{const K=i.getRange(A).getCell(),W=K.getStyle();let Ce,ae=W.getFill()?.toCSS(a.body.darkMode);ae.background!=="none"&&ae.background!=="transparent"||(ae=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),ae.background!=="none"&&ae.background!=="transparent"||(ae={background:a.body.fill}),U({style:ae}),K&&!K.getFormula()&&(Ce=K?.getRenderHorizontalAlignment()),B(Ce??r.HorizontalAlignment.Left)};return z(),i.getRange(A).addListener(()=>{z()})},[i,A,a?.body]);const S=r.useCallbackRef(()=>{let z=T.editState.dirty??"";if(T.editState.dirty!==void 0){const K=s.TextUtils.clampString(z);try{const W=T.sheet.getRange(T.coords),Ce=`Typing '${K}' into ${W.toString()}`;return W.setValue(z,{description:Ce,autoFit:!0}),D(null),q(null),x.setMode(null),m(null),!0}catch(W){throw g.showError(new Error(`Unable to enter '${K}'.`,{cause:W})),W}}},[i,T,g]),w=r.useCallbackRef(z=>i.getRange(z).getCell().getExtrusions()??ue.CoordUtils.cellToRange(z),[i]),k=r.useCallbackRef(z=>{let K=s.IRange.Orientation.Row,W=!1;z!==s.IRange.Direction.Up&&z!==s.IRange.Direction.Down||(K=s.IRange.Orientation.Column),z!==s.IRange.Direction.Left&&z!==s.IRange.Direction.Up||(W=!0),i.getSelection().traverse(K,W)},[i]),O=o.useCallback((z,K)=>{if(l)return l(z,K);if(!i)return null;const{ref:W,...Ce}=z;return c.jsx(pr,{ref:W,...Ce,sheet:i,bodyStyle:a?.body,activeCoords:K,commands:p,onChangeEdit:ae=>{const Q={sheet:i,coords:K,editState:ae};x.setMode(ee=>({...ee,description:Q.editState.editMode?"Edit":"Enter",args:{...ee?.args,stateAndCoords:Q}}))},editState:T.editState})},[i,G,l,T,A]),{overlay:E,startEdit:F,submitEdit:Z,cancelEdit:_,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:O,canEdit:()=>{const z=i.getProtection();if(z.isReadOnly())return!1;const K=z.isLocked();return K&&d(),!K},onBeforeStartEdit:z=>{const K=vr(()=>i.getRange(z).getCell()),W={sheet:i,coords:z,editState:Object.freeze(K)};x.setMode({key:"edit",args:{stateAndCoords:W}}),q(W)},onStartEdit:z=>{D(z),m(z)},onSubmitEdit:S,onCancelEdit:z=>{D(null),q(null),x.setMode(null),m(null)},onDoneEdit:z=>{x.setMode(null)},onNavigate:k,containerProps:G,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:y,getRangeCoords:w});tt(i.getSelection(),{onChange(z){f(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(z=>{V(z),A&&Z()},[V,_,A]),oe=o.useCallback(z=>{V(z)},[V]),L=o.useCallback(z=>{P(z)},[P]);return o.useEffect(()=>{const z=n?.getStage();if(z)return z.addEventListener("pointerdown",$),z.addEventListener("dblclick",oe),z.addEventListener("keydown",L),()=>{z.removeEventListener("pointerdown",$),z.removeEventListener("dblclick",oe),z.removeEventListener("keydown",L)}},[n?.getStage()]),o.useEffect(()=>{const z=x.getMode(),K=z?.key;K==="edit"||K==="enter"?T?z.args?.cancel?_():z.args?.submit?Z():q(z.args?.stateAndCoords):F(z.args?.start):A&&_()},[x]),E(n,t)})),kr="white",Mr="black",Jl=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Ql=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[p,g]=o.useState(null),[x,h]=o.useState(null),[f,T]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)}else l(!1),m(null)},[i,n]),A=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const w=n.getCellCoordsFromClient(S.clientX,S.clientY),k=i.getTables().search({address:w});k.length===1&&k[0].select()},[n,i]),D=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const w=n.getCellCoordsFromClient(S.clientX,S.clientY),k=i.getTables().search({address:w});if(k.length===1){const O=k[0].getRange().getCoords(),E={colStart:O.colStart,rowStart:w.rowIndex,colEnd:O.colEnd,rowEnd:w.rowIndex};i.getRange(E).select()}},[n,i]),G=r.useCallbackRef(()=>{if(!a)return;const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)},[i,a,n]);tt(i?.getSelection(),{onChange(S){g(i.getSelection().getCoords().cell)}}),tt(x,{onAnyChange(S){q(),G()}}),tt(f,{onAnyChange(S){G()}}),tt(i,{onTablesChange(S){q(),G()},onInvalidated(S){q(),G()}});const U=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(G,300),300),[]);o.useEffect(()=>{U()},[n]),o.useEffect(()=>{let S=null;if(d)for(let w=0;w<d.length&&!S;w++){const k=d[w],O=k.getRange().getCoords();s.CoordUtils.isCellWithinRange(p,O)&&(S=k)}h(S)},[p,d]);const y=r.useCallbackRef(S=>{let w=null;if(d)for(let k=0;k<d.length;k++){const O=d[k],E=O.getRange().getCoords();let F=n.getRangeCoordsBounds(E);const Z=n.getRelativePointFromClient(S.clientX,S.clientY),_=Z.x,P=Z.y;if(_>=F.x&&_<=F.x+F.width&&P>=F.y&&P<=F.y+F.height){const V=n.getViewportSize();_<=0||P<=0||_>=V.width||P>=V.height||(w=O)}}T(w)},[n,d]);if(o.useEffect(()=>{const S=n?.getStage();if(S&&d)return S.addEventListener("mousemove",y),S.addEventListener("mouseleave",y),()=>{S.removeEventListener("mousemove",y),S.removeEventListener("mouseleave",y)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const B=[];for(let S=0;S<d.length;S++){const w=d[S];if(w.isClosed())continue;const k=w===f,O=w===x,E=w.getRange().getCoords(),F=n.getRangeCoordsBounds(E);let Z;if(k||O){const _=w.getStyle().getProperties(),P=_.headerRow?.fill?.background??_.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(Z=V.toCSS())}Z||(Z="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}B.push(c.jsx("div",{style:{position:"absolute",left:F.x,top:F.y,width:Math.min(16,F.width),height:F.height,pointerEvents:"all",cursor:Jl},onMouseDown:D},`table-select-row-${w.getName()}`)),B.push(c.jsx("div",{style:{position:"absolute",left:F.x,top:F.y,width:Math.min(16,F.width),height:Math.min(16,F.height),pointerEvents:"all",cursor:Ql},onMouseDown:A},`table-select-${w.getName()}`)),B.push(c.jsx(dt.Selection,{x:F.x,y:F.y,width:F.width,height:F.height,range:E,strokeWidth:O?.5:0,stroke:Z??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:k?`${Z} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return B})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,p]=o.useState(null),g=o.useRef(null),x=r.useCallbackRef(()=>{const D=i.getSelectedCell(),G=D.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(G,l)||(p(G?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(G),coords:G}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(G))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{p(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(x,80),80),[]);if(tt(i?.getSelection(),{onChange(D){h()}}),tt(i,{onSpillsChange(D){x()},onInvalidated(D){x()}}),!n||!l&&!m)return null;const f=i.getRange(l).getValue()instanceof s.FormulaError.Spill,T=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&p(null),q=n.toClipBounds(q,-10),!q)return;const A="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:A,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:f?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${A} 0px 0px 4px 0px`}},"spill-outline}")),T})),ni={position:"absolute",top:0,left:0,bottom:0,right:0},$o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},oi={fireOnModelChange:!1},Wo={},Tr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Wo,headersStyle:a=Wo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:p,rowHeaderProps:g,showScrollbars:x=!0,scrollPaneProps:h,onViewportChange:f,commands:T,onRepeatCommandChange:q,onMoveCell:A,overlays:D,renderMovable:G,viewportComponent:U,onElementLoad:y,getCellEditor:B,onFocus:S,onBlur:w,style:k=r.ReactUtils.EmptyCssProperties,notifier:O,onShowTooltip:E,onShowColumnTooltip:F,onShowRowTooltip:Z,onCloseTooltip:_,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[oe,L]=o.useReducer(te=>te+1,0),[z,{width:K,height:W}]=zt(),Ce=r.useCallbackRef(E,[E]),ae=r.useCallbackRef(F,[F]),Q=r.useCallbackRef(Z,[Z]),ee=r.useCallbackRef(_,[_]),we=o.useRef(!1);o.useLayoutEffect(()=>{we.current=!0},[n]);const ke=n?.getStyles(),ve=o.useMemo(()=>$o(i,ke),[i,ke]),Pe=o.useMemo(()=>$o(a,ke),[a,ke]),{body:ge={},buttonSurface:He={}}=ve,{header:Se={},headerSelect:ce={},headerSelectAll:de={}}=Pe,he=o.useRef(null),[pe,xe]=o.useState(()=>n?.getView()),Me=(pe?.getZoomScale()??100)/100,be=o.useMemo(()=>({vertical:pe.isShowColumnGridlines()&&Me>=.4,horizontal:pe.isShowRowGridlines()&&Me>=.4}),[pe?.isShowColumnGridlines(),pe?.isShowRowGridlines(),Me]),Ee=o.useMemo(()=>{if(pe?.getGridLineColor())return{strokeDasharray:"1,1"}},[pe?.getGridLineColor(),ve]),Le=d??pe?.isShowColumnHeaders(),Ve=p??pe?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Qe=o.useMemo(()=>{let te=40,Re=20;const Te=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=Te?.toCSS()?.fontFamily??ve.header.text.fontFamily,Ze=Te?.getSize()??ve.header.text.fontSize,et=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);te=et.width,Re=et.lineHeight}return{width:Math.round(te+5),height:Math.round(Re+3)}},[C,ve?.header.text,n]),$e=Ve?Me*Qe.width:Se.edgeStrokeWidth,J=Le?Me*Qe.height:Se.edgeStrokeWidth,Fe=Math.max(K,(n?.getColumnHeaders().getDefaultSize()??Qe.width)+$e+1),Be=Math.max(W,(n?.getRowHeaders().getDefaultSize()??Qe.height)+J+1),Ie=o.useRef(new Map),ze=o.useRef(null),Ae=()=>({getColOffset:te=>n.getColumnHeaders().findOffset(te),getColIndex:te=>n.getColumnHeaders().findIndex(te),getRowOffset:te=>n.getRowHeaders().findOffset(te),getRowIndex:te=>n.getRowHeaders().findIndex(te)}),[R,re]=o.useState(()=>Ae()),[j,Y]=o.useState(!1),[u,M]=o.useState(null),I=!0,b=ve.selection?.strokeFill,N=o.useCallback(()=>kt.current,[]),[v,H]=o.useState(),X=r.useCallbackRef(te=>{H(te),n&&n.getView()&&n.getView().setTopLeft(te?{left:te.left,top:te.top}:null),f?.(te)},[n,f]),ne=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const te=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ne.current?.(),ne.current=te.addListener(()=>{const Re=te.getCoords();he?.current?.invalidate(Re)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(te=>{const Re=ue.CoordUtils.cellToRange(te);if(n.isClosed())return Re;const Te=n.getRange(Re,{excludeHidden:!0}).getMerges();return Te.length===0?Re:Te[0]},[n]),ye=te=>{if(!te||te.coords.colIndex===0&&te.coords.rowIndex===0)return null;const Re={};return te.coords.colIndex>0&&(Re[ue.AnchorLocation.Left]={index:te.coords.colIndex,scrollOffset:te.topLeft.left}),te.coords.rowIndex>0&&(Re[ue.AnchorLocation.Top]={index:te.coords.rowIndex,scrollOffset:te.topLeft.top}),Re},[me,fe]=o.useState(()=>ye(n.getView().getFreezePanes())),qe=r.useEditMode(),Oe=o.useCallback(()=>he.current,[]),De=r.useCallbackRef(te=>{qe.setMode(Re=>Re?.key==="edit"?{...Re,args:{...Re.args}}:{key:"edit",args:{stateAndCoords:null,start:te}})},[]),We=r.useCallbackRef(()=>v,[v]),je=xr({sheet:n,commands:T,target:Oe,onRepeatCommandChange:q,bodyStyle:ge,notifier:O,onStartEdit:De,getViewport:We}),[Ge,Ne]=o.useState(n.getSelection().isEntire()),[Xe,it]=o.useState(pe?.getMovableSelection().length>0),pt=u!==null||Xe,wt=null,[_e,rt]=o.useState(!1);o.useEffect(()=>{rt(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{_e||(rt(!0),O.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[O,_e]),yt=o.useMemo(()=>{const te=qe.getMode();return te?.cursor?te.cursor:null},[wt,qe]),[Ct,gt]=o.useState(null),lt=o.useRef(!1),[Tt,Lt]=o.useState([]),Zt=o.useRef(null),[Ft,Xt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Mt,vn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Xt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{vn({left:0,top:le?.top})},[le?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{fe(ye(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{Ne(n.getSelection().isEntire())}}),tt(n,{onViewChange(){xe(n.getView()),re(Ae())},onLayoutChange:()=>{const te=n.getEntireRange();Ue({height:te.getRowCount(),width:te.getColumnCount()}),re(Ae())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),tt(n,{onRequestScrollIntoView:async(te,Re)=>{if(!Re)return;const Te={colIndex:Re?.coords.colStart,rowIndex:Re?.coords.rowStart};return await he.current?.scrollCellCoordsIntoView(Te,Re?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(kt.current)},oi);const Cn=o.useMemo(()=>{const te=(Te,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:Te,colEnd:Te})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getColOffset(Te)),Je=Ze.getBounds(),st=Math.min(Je.x+Je.width,et.getColOffset(Te+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Left||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Right)){const Xn=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),qn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Me),2).toFixed(2),Yn="Width: "+(Ke?qn+" ("+Xn+" pixels)":"Hidden"),nn=Vt.current.getGridElement().getRelativePointFromClient(0,0),Pt=0-nn.y,Sn=0-nn.y+J,Jn={x:ot-(nn.x-Je.x),y:Pt,width:st-ot,height:Sn-Pt};requestAnimationFrame(()=>{lt.current&&ae?.({anchor:Jn,display:Yn})})}const It=[0,0,0,Je.height],tn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:ot-1,y:0,width:1,height:Je.height},_n={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:st-1,y:0,width:1,height:Je.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let Re=null;return{onResizeHeadersStart:(Te,Ke,Ze)=>{Re=n.beginCommit(Ze),te(Te,Ke)},onResizeHeaders:(Te,Ke,Ze)=>{te(Te,Ke)},onResizeHeadersDown:(Te,Ke)=>{te(Te,Ke)},onResizeHeadersEnd:(Te,Ke,Ze)=>{Re?.commit({description:Ze}),Re=null,requestAnimationFrame(()=>ee?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Te=>{requestAnimationFrame(()=>ee?.()),lt.current=!1,gt(null)},...m}},[n,m,J,Ct]),Ot=o.useMemo(()=>{const te=(Te,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:Te,rowEnd:Te,colStart:0,colEnd:C.width})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getRowOffset(Te)),Je=Ze.getBounds(),st=Math.min(Je.y+Je.height,et.getRowOffset(Te+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Top||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Bottom)){const Xn=Math.floor(10*ue.CommonUtils.getDPI())/10,qn=ue.CommonUtils.roundAccurately(Ke*Xn,0),Yn=ue.CommonUtils.roundAccurately(qn/Me/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),nn="Height: "+(Ke?Yn+" ("+qn+" pixels)":"Hidden"),Pt=en.current.getGridElement().getRelativePointFromClient(0,0),Sn=0-Pt.x,Jn=0-Pt.x+$e,hl={x:Sn,y:ot-(Pt.y-Je.y),width:Jn-Sn,height:st-ot};requestAnimationFrame(()=>{lt.current&&Q?.({anchor:hl,display:nn})})}const It=[0,0,Je.width,0],tn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:0,y:ot-1,width:Je.width,height:1},_n={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:0,y:st-1,width:Je.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let Re=null;return{onResizeHeadersStart:(Te,Ke,Ze)=>{Re=n.beginCommit(Ze),te(Te,Ke)},onResizeHeaders:(Te,Ke,Ze)=>{te(Te,Ke)},onResizeHeadersDown:(Te,Ke)=>{te(Te,Ke)},onResizeHeadersEnd:(Te,Ke,Ze)=>{Re?.commit({description:Ze}),Re=null,requestAnimationFrame(()=>ee?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Te=>{requestAnimationFrame(()=>ee?.()),lt.current=!1,gt(null)},...g}},[n,g,$e]),kt=r.useImperativeElement(t,()=>{const te=Te=>{n?.getView()&&n.getView().selectMovables([]),ze.current=null,he?.current?.focus(Te)},Re=async(Te=null)=>{if(Te||(Te=n?.getView().getMovableSelection()[0]),!Te)return!1;const Ke=Te.getAnchorCoords();if(!Ke)return!1;const Ze=he.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const et=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Te)===-1&&n?.getView().selectMovables([Te]);let ot=Ie.current?.get(et);return ot?.current?(await ot.current.focusMovable(Te),!0):(ze.current={movable:Te,anchor:et},!0)};return{getGridElement:()=>he.current,getRowHeaderElement:()=>en.current,getColumnHeaderElement:()=>Vt.current,rowHeaderHeight:()=>J,colHeaderWidth:()=>$e,startEdit:De,submitEdit:()=>{qe.setMode(Te=>Te?.key!=="edit"?Te:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{qe.setMode(Te=>Te?.key!=="edit"?Te:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:Te=>{n?.getView().getMovableSelection().length>0&&Re()||te(Te)},focusSheet:te,focusMovable:Re,contains:Te=>he?.current?.contains?.(Te),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(te=>{we.current||(he?.current?.invalidate(te),L?.())},[]);o.useEffect(()=>{At()},[ve]);const Yt=Ge?de.edgeStrokeFill:Se.fill,Hn=Ge?ce.fill:typeof ve.headerHover=="function"?ve.headerHover(Se)?.fill:Se.fill,nt=o.useMemo(()=>U?c.jsx("div",{className:bt("sheetxl-viewport-overlay",Ml),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:U}):c.jsx(c.Fragment,{}),[U]);let Jt=null;Le&&Ve&&(Jt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${J}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:te=>{let Re=!te.ctrlKey;je?.getCommand("selectAll")?.execute(!Re||te.button!==0),te.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:-1,colIndex:-1}):he.current?.focus()},children:[c.jsx("div",{style:{height:J-5+"px",width:J-5+"px",clipPath:`path('M${J-5} 0 L0 ${J-5} L${J-5} ${J-5} L${J-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Hn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${J}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const jt=r.useCallbackRef(({_left:te,_top:Re})=>{},[]),bn=r.useCallbackRef(te=>{if(!l)return;const Re=he.current.getViewFromClient(te.clientX,te.clientY)?.getCellCoordsFromClient(te.clientX,te.clientY);Re&&(l({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:Re.rowIndex,colIndex:Re.colIndex}),te.stopPropagation(),te.preventDefault())},[l]),at=r.useCallbackRef(te=>{if(!(!te.shiftKey&&(te.ctrlKey||te.metaKey)))return;const{deltaY:Re}=te;return Re>0?je.getCommand("sheetZoomOut")?.execute():Re<0&&je.getCommand("sheetZoomIn")?.execute(),Re===0},[je]);o.useEffect(()=>{Lt(null),Zt.current=null,lt.current=!1,gt(null);const te=n?.getView().getTopLeft();jt(te),he.current?.scrollTo(te),ie(te),xe(n.getView()),fe(ye(n.getView().getFreezePanes())),re(Ae()),L()},[n?.getView()]);const ht=r.useCallbackRef(te=>{const Re=te.getVisibleRangeCoords();if(!Re)return null;const Te=[];return n.getRange(Re).forEach((Ke,Ze)=>{const et=Ze.getCoords(),ot=Ze.getCell();(Je=>{if(Je.isEmpty())return!1;const st=Je.getSpans();if(st.width>1||st.height>1||Je.getStyle().hasVisibleStyling()||pe.isShowFormulas()&&Je.getFormula()!==null)return!0;const mt=Je.getValue();return mt!==null&&!(!pe.isShowZeros()&&mt===0&&Je.getType()===s.ScalarType.Number)})(ot)&&Te.push({coords:et,value:ot,range:pe.isShowFormulas()?null:ot.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Te},[n,pe.isShowZeros(),pe.isShowFormulas(),u]);o.useEffect(()=>{const te=[];D&&te.push(...D),Ct&&te.push(...Ct),ue.CommonUtils.isEqualArrays(te,Zt.current)||(Zt.current=te,Lt(te))},[D,Ct,ve]);const Qt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[ve?.header?.edgeStrokeFill]),yn=r.useCallbackRef(te=>{te.isDefaultPrevented()||te.isPropagationStopped()||(ze.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Bt=o.useMemo(()=>{const te=qe.getMode();return te?.key==="cut"||te?.key==="copy"},[qe]),Un=r.useCallbackRef(async te=>{const Re=qe.getMode();return te.keyCode===r.KeyCodes.Escape&&Re?(te.preventDefault(),void qe.setMode(null)):te.keyCode===r.KeyCodes.Enter&&Bt?(te.preventDefault(),await je?.getCommand("paste")?.execute(),void qe.setMode(null)):void je?.dispatchToFocusedCommand(te)},[je,qe]),en=o.useRef(null),wn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Ho,{ref:en,sheetElement:kt.current,gridRef:he,freezeStart:me?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Be,sheetHeader:n.getRowHeaders(),gridStyle:Pe,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[$e,J,Be,n,Mt,me?.[ue.AnchorLocation.Top],ve,I,l,Se.fill,g]),Vt=o.useRef(null),xn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Ho,{ref:Vt,sheetElement:kt.current,gridRef:he,freezeStart:me?.[ue.AnchorLocation.Left],oppositeSize:J,containerWidth:Fe,containerHeight:J,sheetHeader:n.getColumnHeaders(),gridStyle:Pe,scrollPoint:Ft,onSheetContextMenu:l,...Cn,style:{...Cn?.style,position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[J,Fe,n,Ft,me?.[ue.AnchorLocation.Left],ve,Se.fill,I,l,m]),al=r.useCallbackRef(te=>{const{value:Re,key:Te,...Ke}=te;let Ze=Re,et=u;if(!et||et.colIndex===te.coords.colIndex&&et.rowIndex===te.coords.rowIndex||(et=null),!Ze){const st=te.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let ot=null;Ze.getHyperlink()&&(ot=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(mt){O?.showError?.(mt)}}}),et&&et.colIndex===te.range.colStart&&et.rowIndex===te.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Je=n.getStyles();return o.createElement(fr,{...Ke,key:Te,bodyStyle:ge,docTheme:Je.getTheme(),normalStyle:Je.getNormal(),showFormulas:pe.isShowFormulas(),showZeros:pe.isShowZeros(),onLinkMouseDown:ot,...V,value:Ze})},[n,R,ge,u,pe?.isShowFormulas(),pe.isShowZeros()]),sl=o.useCallback((te,Re)=>{const{key:Te,...Ke}=te;return[c.jsx(El,{ref:Re,getVisibleCells:ht,sheet:n,gridStyle:ve,...Ke},`border-${Te}`),c.jsx(ei,{ref:Re,sheet:n,commands:je,...Ke},`table-${Te}`),c.jsx(ti,{ref:Re,sheet:n,...Ke},`spill-${Te}`),c.jsx($l,{ref:Re,sheet:n,commands:je,notifier:O,onShowTooltip:Ce,onCloseTooltip:ee,gridStyle:ve,gridRef:he,editingCoords:u,isActive:I,...Ke},`selection-${Te}`),c.jsx(jl,{ref:Re,sheet:n,commands:je,gridStyle:ve,element:N,notifier:O,...Ke},`copy-paste-${Te}`),c.jsx(Xl,{ref:Re,sheet:n,commands:je,target:Oe,notifier:O,renderMovable:G,movableProps:{onUnFocus:()=>{kt.current.focus()}},...Ke},`movable-${Te}`),c.jsx(Yl,{ref:Re,sheet:n,commands:je,notifier:O,gridStyle:ve,getCellEditor:B,showProtectedError:vt,setEditingCoords:M,...Ke},`editor-${Te}`)]},[n,he.current,ve,B,je,O]),[ko,dl]=o.useState(!1),cl=o.useMemo(()=>{if(Fe===0||Be===0)return null;const te=n.getStyles().getNormal(),Re=te.getFont(),Te=te.getFill(),Ke=te.getBorder(),Ze=te.getFill().getType()===s.IFill.Type.None;let et=Ee,ot=Ee;const Je=(mt,It,tn)=>tn?{stroke:Ke.getBottom().isNone()?"none":mt.getColor().toRGBA(ge.darkMode).toString(),...It}:It;ot=Je(Ke.getBottom(),ot,!Ke.getBottom().isNone()),ot=Je(Ke.getTop(),ot,!Ke.getTop().isNone()),et=Je(Ke.getRight(),et,!Ke.getRight().isNone()),et=Je(Ke.getLeft(),et,!Ke.getLeft().isNone());let st=pe?.getGridLineColor()?.toRGBA(ge.darkMode).toString()??ge.strokeFill;return Ze||(ot=Je(Ke.getBottom(),ot,!0),ot=Je(Ke.getTop(),ot,!0),et=Je(Ke.getRight(),et,!0),et=Je(Ke.getLeft(),et,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...ni,...Te.toCSS(ge.darkMode),...Re.toCSS(ge.darkMode,Me),"--sxl-app-color-background":ge.fill,"--sxl-app-color-shadow":ve.colorShadow,"--sxl-app-color-grey":ve.colorGrey,"--sxl-app-color-button-fill":He.fill,"--sxl-app-color-button-text":He.text?.fill,"--sxl-app-color-button-border":He.edgeStrokeFill,"--sxl-app-color-primary-dark":ve.selection.strokeFill},ref:he,zoom:Me,...P,onFirstRender:mt=>{dl(!0),P?.onFirstRender?.(mt),je?.activate()},showGridLines:be,gridLineColor:st,gridLineColumnsProps:et,gridLineRowsProps:ot,freezeLeft:me?.[ue.AnchorLocation.Left],freezeLeftProps:Qt,freezeTop:me?.[ue.AnchorLocation.Top],freezeTopProps:Qt,width:Fe,height:Be,columnCount:C.width,rowCount:C.height,cursor:yt??wt??"cell",clipCells:!0,layout:R,cellRenderer:al,overlayRenderer:sl,getCellCoordsAsRangeCoords:se,getVisibleCells:ht,onWheelScroll:at,onPointerDown:yn,onKeyDown:Un,onViewportChange:X,onImmediateScroll:jt,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:Tt})},[oe]);o.useEffect(()=>{we.current||L()},[R,me,Me,je,le?.left,le?.top,ge,P,Fe,Be,yt,Tt,I,wt]);let Kn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};x||(Kn={...Kn,...k});const ul=o.useMemo(()=>{const te=n.getStyles().getTheme(),Re=te.getColorScheme(),Te=te.getFontScheme();return{"--sxl-doc-color-dk1":Re.getDk1().toCSS(ge.darkMode),"--sxl-doc-color-dk2":Re.getDk2().toCSS(ge.darkMode),"--sxl-doc-color-lt1":Re.getLt1().toCSS(ge.darkMode),"--sxl-doc-color-lt2":Re.getLt2().toCSS(ge.darkMode),"--sxl-doc-color-accent1":Re.getAccent1().toCSS(ge.darkMode),"--sxl-doc-color-accent2":Re.getAccent2().toCSS(ge.darkMode),"--sxl-doc-color-accent3":Re.getAccent3().toCSS(ge.darkMode),"--sxl-doc-color-accent4":Re.getAccent4().toCSS(ge.darkMode),"--sxl-doc-color-accent5":Re.getAccent5().toCSS(ge.darkMode),"--sxl-doc-color-accent6":Re.getAccent6().toCSS(ge.darkMode),"--sxl-doc-color-hlink":Re.getHlink().toCSS(ge.darkMode),"--sxl-doc-color-fol-hlink":Re.getFolHlink().toCSS(ge.darkMode),"--sxl-doc-font-major":Te.getMajorFont(),"--sxl-doc-font-minor":Te.getMinorFont()}},[n.getStyles().getTheme()]);let $n=c.jsx("div",{style:Kn,onTouchStart:()=>{Mo()},onFocus:te=>{Y(!0),S?.(te)},onBlur:te=>{Y(!1),w?.(te)},ref:kt,...$,children:c.jsx("div",{className:bt("sheetxl-sheet",kl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...ul},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Jt,wn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:ge.fill},ref:z,onContextMenu:bn,children:[cl,nt,c.jsx(Tl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ve?.selection?.strokeFill,colorCredits:ve?.body?.text?.fill})]})]})]})})});if(x){const te=Re=>c.jsx(vo,{...Re,sheet:n});$n=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Qe.height,minWidth:2*Qe.width,...k},viewport:v,touchElement:he.current?.stage,disableTouch:pt,onScrollViewport:Re=>{he.current?.scrollTo(Re)},createHorizontalScrollbar:te,createVerticalScrollbar:te,...h,children:$n})}o.useEffect(()=>{we.current=!1,L?.(),j&&kt.current?.focus()},[n]);const[Wn,gl]=o.useState(!1),Mo=r.useCallbackRef(()=>{Wn||gl(!0)},[Wn]);return o.useEffect(()=>{if(ko)return typeof y=="function"&&y(),r.ReactUtils.detectIt().primaryInput==="touch"&&Mo(),()=>{}},[y,ko,Wn]),$n}));Tr.displayName="SheetElement";const ri=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Go="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Ir=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:p,onHide:g,onShow:x,onKeyDownCapture:h,onFocus:f,onBlur:T,loadingPanel:q,...A}=e,[D,G]=o.useState(!1),[U,y]=o.useState(null),[B,S]=o.useState(null),[w,k]=o.useState(null);o.useEffect(()=>{S(null),l.getDetails().then(F=>{G(!1),S(F.asUrl()),F.asSVGText?.()&&k(F.asSVGText())}).catch(F=>{console.warn(F),G(!0),S(Go),k(null)})},[l]);const O=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),E=o.useMemo(()=>{if(B||w)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:U?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:B,onLoad:()=>{y(!0)},onError:({currentTarget:F})=>{console.log("error"),F.onerror=null,S(Go),G(!0)},alt:d??`${l.getType()}`})},[U,l,B,w,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...A,onKeyDownCapture:F=>{h?.(F)},ref:O,children:[U||D?void 0:q,E]})}));Ir.displayName="PictureEditor";const li=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const x=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:f,width:T}]=zt();if(!a.isClosed())return c.jsx("div",{...g,ref:Wt([x,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ii="_editable-input_1bqx6_6",ai=e=>c.jsx("input",{...e}),Er=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:p=ai,notifier:g,styleHover:x={},dragging:h,maxLength:f,disabled:T=!1,readOnly:q=!1,...A}=e,[D,G]=o.useState(!1),[U,y]=o.useState(!1),[B,S]=o.useState(a);o.useEffect(()=>{S(a)},[a]);const w=o.useRef(null),[k,O]=o.useState(null),E=o.useCallback(function(oe){const L=oe.message;k!==L&&(g?.showMessage?.(L,{type:r.NotificationType.Error}),O(L))},[g,k]),F=o.useCallback(oe=>{let L=!1;try{L=l?.(oe)??!0}catch(z){E(z)}return L?(w.current=null,y(!1),S(oe),L):(setTimeout(()=>{w.current?.focus()},0),L)},[l]),Z=r.useCallbackRef(()=>{S(a),w.current=null,y(!1),m?.()},[m,a]),_=o.useMemo(()=>{if(!U)return null;const oe={className:bt(ii),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:B,onFocus:L=>{w.current||(w.current=L.target,setTimeout(()=>{L.target?.select()},0))},onBlur:L=>{w.current&&F(B)},onChange:L=>{U&&S(L.target.value)},onMouseDown:L=>L.stopPropagation(),onKeyDown:L=>L.code==="Escape"?(L.preventDefault(),void Z()):L.code==="Enter"?(L.preventDefault(),void F(L.target.value)):void(L.code!=="Tab"?L.stopPropagation():F(L.target.value))};return c.jsx(c.Fragment,{children:p(oe)})},[U,B,F,Z,p,T]),[P,V]=o.useState();o.useLayoutEffect(()=>{let oe=Object.assign({},n);(h||D)&&(oe=Object.assign(oe,x)),V(oe)},[h,D,x,n]),o.useEffect(()=>{_&&d?.(B)},[_,d,B]);const $=r.useImperativeElement(t,()=>({startEdit(){T||q||y(!0)},cancel(){Z()}}),[]);return c.jsxs("div",{...A,ref:$,style:{flexDirection:"column",display:"flex",...P},className:bt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{T||q||y(!0)},onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:U?0:1},children:B}),_]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...x},children:B})]})})),On=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Co(e){return"nodeType"in e}function ft(e){var t,n;return e?Gt(e)?e:Co(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bo(e){const{Document:t}=ft(e);return e instanceof t}function mn(e){return!Gt(e)&&e instanceof ft(e).HTMLElement}function Fr(e){return e instanceof ft(e).SVGElement}function $t(e){return e?Gt(e)?e.document:Co(e)?bo(e)?e:mn(e)||Fr(e)?e.ownerDocument:document:document:document}const St=On?o.useLayoutEffect:o.useEffect;function jn(e){const t=o.useRef(e);return St(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function ln(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function En(e){const t=jn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Fn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let to={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=to[e]==null?0:to[e]+1;return to[e]=n,e+"-"+n},[e,t])}function Ar(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[p,g]of m){const x=l[p];x!=null&&(l[p]=x+e*g)}return l},{...t})}}const Kt=Ar(1),gn=Ar(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function An(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),_o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function si(e){return e.matches(_o)?e:e.querySelector(_o)}const di={display:"none"};function ci(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function ui(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},n)}const Dr=o.createContext(null),gi={draggable:`
|
|
31
24
|
To pick up a draggable item, press the space bar.
|
|
32
25
|
While dragging, use the arrow keys to move the item.
|
|
33
26
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
34
|
-
`},Hc={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function $c(t){let{announcements:e=Hc,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=Vc}=t;const{announce:i,announcement:s}=function(){const[h,u]=l.useState("");return{announce:l.useCallback(w=>{w!=null&&u(w)},[]),announcement:h}}(),a=Xn("DndLiveRegion"),[d,c]=l.useState(!1);if(l.useEffect(()=>{c(!0)},[]),function(h){const u=l.useContext(as);l.useEffect(()=>{if(!u)throw new Error("useDndMonitor must be used within a children of <DndContext>");return u(h)},[h,u])}(l.useMemo(()=>({onDragStart(h){let{active:u}=h;i(e.onDragStart({active:u}))},onDragMove(h){let{active:u,over:w}=h;e.onDragMove&&i(e.onDragMove({active:u,over:w}))},onDragOver(h){let{active:u,over:w}=h;i(e.onDragOver({active:u,over:w}))},onDragEnd(h){let{active:u,over:w}=h;i(e.onDragEnd({active:u,over:w}))},onDragCancel(h){let{active:u,over:w}=h;i(e.onDragCancel({active:u,over:w}))}}),[i,e])),!d)return null;const f=l.createElement(l.Fragment,null,l.createElement(Pc,{id:o,value:r.draggable}),l.createElement(Bc,{id:a,announcement:s}));return n?Wt.createPortal(f,n):f}var pt;function To(){}function lr(t,e){return l.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(pt||(pt={}));const Ot=Object.freeze({x:0,y:0});function cs(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Uc(t,e){const n=Eo(t);return n?(n.x-e.left)/e.width*100+"% "+(n.y-e.top)/e.height*100+"%":"0 0"}function ds(t,e){let{data:{value:n}}=t,{data:{value:o}}=e;return n-o}function Wc(t,e){let{data:{value:n}}=t,{data:{value:o}}=e;return o-n}function Ki(t){let{left:e,top:n,height:o,width:r}=t;return[{x:e,y:n},{x:e+r,y:n},{x:e,y:n+o},{x:e+r,y:n+o}]}function us(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function Zi(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+.5*t.width,y:n+.5*t.height}}const Gc=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:o}=t;const r=Zi(e,e.left,e.top),i=[];for(const s of o){const{id:a}=s,d=n.get(a);if(d){const c=cs(Zi(d),r);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(ds)};function Kc(t,e){const n=Math.max(e.top,t.top),o=Math.max(e.left,t.left),r=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),s=r-o,a=i-n;if(o<r&&n<i){const d=e.width*e.height,c=t.width*t.height,f=s*a;return Number((f/(d+c-f)).toFixed(4))}return 0}const Zc=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:o}=t;const r=[];for(const i of o){const{id:s}=i,a=n.get(s);if(a){const d=Kc(a,e);d>0&&r.push({id:s,data:{droppableContainer:i,value:d}})}}return r.sort(Wc)};function Yi(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ot}function Yc(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,s)=>({...i,top:i.top+t*s.y,bottom:i.bottom+t*s.y,left:i.left+t*s.x,right:i.right+t*s.x}),{...e})}}const Xc=Yc(1);function hs(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}const Jc={ignoreTransform:!1};function qn(t,e){e===void 0&&(e=Jc);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:f}=Rt(t).getComputedStyle(t);c&&(n=function(h,u,w){const b=hs(u);if(!b)return h;const{scaleX:q,scaleY:I,x:$,y:D}=b,v=h.left-$-(1-q)*parseFloat(w),F=h.top-D-(1-I)*parseFloat(w.slice(w.indexOf(" ")+1)),E=q?h.width/q:h.width,S=I?h.height/I:h.height;return{width:E,height:S,top:F,right:v+E,bottom:F+S,left:v}}(n,c,f))}const{top:o,left:r,width:i,height:s,bottom:a,right:d}=n;return{top:o,left:r,width:i,height:s,bottom:a,right:d}}function Xi(t){return qn(t,{ignoreTransform:!0})}function Lo(t,e){const n=[];return t?function o(r){if(e!=null&&n.length>=e||!r)return n;if(Vr(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Yn(r)||ls(r)||n.includes(r))return n;const i=Rt(t).getComputedStyle(r);return r!==t&&function(s,a){a===void 0&&(a=Rt(s).getComputedStyle(s));const d=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const f=a[c];return typeof f=="string"&&d.test(f)})}(r,i)&&n.push(r),function(s,a){return a===void 0&&(a=Rt(s).getComputedStyle(s)),a.position==="fixed"}(r,i)?n:o(r.parentNode)}(t):n}function gs(t){const[e]=Lo(t,1);return e??null}function sr(t){return Fo&&t?Sn(t)?t:Br(t)?Vr(t)||t===xn(t).scrollingElement?window:Yn(t)?t:null:null:null}function ms(t){return Sn(t)?t.scrollX:t.scrollLeft}function fs(t){return Sn(t)?t.scrollY:t.scrollTop}function qr(t){return{x:ms(t),y:fs(t)}}var vt;function ps(t){return!(!Fo||!t)&&t===document.scrollingElement}function vs(t){const e={x:0,y:0},n=ps(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height};return{isTop:t.scrollTop<=e.y,isLeft:t.scrollLeft<=e.x,isBottom:t.scrollTop>=o.y,isRight:t.scrollLeft>=o.x,maxScroll:o,minScroll:e}}(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(vt||(vt={}));const Qc={x:.2,y:.2};function ed(t,e,n,o,r){let{top:i,left:s,right:a,bottom:d}=n;o===void 0&&(o=10),r===void 0&&(r=Qc);const{isTop:c,isBottom:f,isLeft:h,isRight:u}=vs(t),w={x:0,y:0},b={x:0,y:0},q=e.height*r.y,I=e.width*r.x;return!c&&i<=e.top+q?(w.y=vt.Backward,b.y=o*Math.abs((e.top+q-i)/q)):!f&&d>=e.bottom-q&&(w.y=vt.Forward,b.y=o*Math.abs((e.bottom-q-d)/q)),!u&&a>=e.right-I?(w.x=vt.Forward,b.x=o*Math.abs((e.right-I-a)/I)):!h&&s<=e.left+I&&(w.x=vt.Backward,b.x=o*Math.abs((e.left+I-s)/I)),{direction:w,speed:b}}function td(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:e,left:n,right:o,bottom:r}=t.getBoundingClientRect();return{top:e,left:n,right:o,bottom:r,width:t.clientWidth,height:t.clientHeight}}function ws(t){return t.reduce((e,n)=>vn(e,qr(n)),Ot)}function ys(t,e){if(e===void 0&&(e=qn),!t)return;const{top:n,left:o,bottom:r,right:i}=e(t);gs(t)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const nd=[["x",["left","right"],function(t){return t.reduce((e,n)=>e+ms(n),0)}],["y",["top","bottom"],function(t){return t.reduce((e,n)=>e+fs(n),0)}]];class Rr{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Lo(n),r=ws(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,s,a]of nd)for(const d of s)Object.defineProperty(this,d,{get:()=>{const c=a(o),f=r[i]-c;return this.rect[d]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Nn{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=e}add(e,n,o){var r;(r=this.target)==null||r.addEventListener(e,n,o),this.listeners.push([e,n,o])}}function ar(t,e){const n=Math.abs(t.x),o=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+o**2)>e:"x"in e&&"y"in e?n>e.x&&o>e.y:"x"in e?n>e.x:"y"in e&&o>e.y}var At,tt;function Ji(t){t.preventDefault()}function od(t){t.stopPropagation()}(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(At||(At={})),function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"}(tt||(tt={}));const bs={start:[tt.Space,tt.Enter],cancel:[tt.Esc],end:[tt.Space,tt.Enter,tt.Tab]},rd=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case tt.Right:return{...n,x:n.x+25};case tt.Left:return{...n,x:n.x-25};case tt.Down:return{...n,y:n.y+25};case tt.Up:return{...n,y:n.y-25}}};class Hr{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Nn(xn(n)),this.windowListeners=new Nn(Rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(At.Resize,this.handleCancel),this.windowListeners.add(At.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(At.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,o=e.node.current;o&&ys(o),n(Ot)}handleKeyDown(e){if(Ao(e)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=bs,coordinateGetter:s=rd,scrollBehavior:a="smooth"}=r,{code:d}=e;if(i.end.includes(d))return void this.handleEnd(e);if(i.cancel.includes(d))return void this.handleCancel(e);const{collisionRect:c}=o.current,f=c?{x:c.left,y:c.top}:Ot;this.referenceCoordinates||(this.referenceCoordinates=f);const h=s(e,{active:n,context:o.current,currentCoordinates:f});if(h){const u=Kn(h,f),w={x:0,y:0},{scrollableAncestors:b}=o.current;for(const q of b){const I=e.code,{isTop:$,isRight:D,isLeft:v,isBottom:F,maxScroll:E,minScroll:S}=vs(q),k=td(q),N={x:Math.min(I===tt.Right?k.right-k.width/2:k.right,Math.max(I===tt.Right?k.left:k.left+k.width/2,h.x)),y:Math.min(I===tt.Down?k.bottom-k.height/2:k.bottom,Math.max(I===tt.Down?k.top:k.top+k.height/2,h.y))},R=I===tt.Right&&!D||I===tt.Left&&!v,T=I===tt.Down&&!F||I===tt.Up&&!$;if(R&&N.x!==h.x){const G=q.scrollLeft+u.x,O=I===tt.Right&&G<=E.x||I===tt.Left&&G>=S.x;if(O&&!u.y)return void q.scrollTo({left:G,behavior:a});w.x=O?q.scrollLeft-G:I===tt.Right?q.scrollLeft-E.x:q.scrollLeft-S.x,w.x&&q.scrollBy({left:-w.x,behavior:a});break}if(T&&N.y!==h.y){const G=q.scrollTop+u.y,O=I===tt.Down&&G<=E.y||I===tt.Up&&G>=S.y;if(O&&!u.x)return void q.scrollTo({top:G,behavior:a});w.y=O?q.scrollTop-G:I===tt.Down?q.scrollTop-E.y:q.scrollTop-S.y,w.y&&q.scrollBy({top:-w.y,behavior:a});break}}this.handleMove(e,vn(Kn(h,this.referenceCoordinates),w))}}}handleMove(e,n){const{onMove:o}=this.props;e.preventDefault(),o(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Qi(t){return!!(t&&"distance"in t)}function el(t){return!!(t&&"delay"in t)}Hr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:o=bs,onActivation:r}=e,{active:i}=n;const{code:s}=t.nativeEvent;if(o.start.includes(s)){const a=i.activatorNode.current;return(!a||t.target===a)&&(t.preventDefault(),r?.({event:t.nativeEvent}),!0)}return!1}}];class $r{constructor(e,n,o){var r;o===void 0&&(o=function(a){const{EventTarget:d}=Rt(a);return a instanceof d?a:xn(a)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:s}=i;this.props=e,this.events=n,this.document=xn(s),this.documentListeners=new Nn(this.document),this.listeners=new Nn(o),this.windowListeners=new Nn(Rt(s)),this.initialCoordinates=(r=Eo(i))!=null?r:Ot,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(At.Resize,this.handleCancel),this.windowListeners.add(At.DragStart,Ji),this.windowListeners.add(At.VisibilityChange,this.handleCancel),this.windowListeners.add(At.ContextMenu,Ji),this.documentListeners.add(At.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(el(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Qi(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:o,onPending:r}=this.props;r(o,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(At.Click,od,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(At.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!r)return;const d=(n=Eo(e))!=null?n:Ot,c=Kn(r,d);if(!o&&a){if(Qi(a)){if(a.tolerance!=null&&ar(c,a.tolerance))return this.handleCancel();if(ar(c,a.distance))return this.handleStart()}return el(a)&&ar(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),s(d)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===tt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const id={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class xs extends $r{constructor(e){const{event:n}=e,o=xn(n.target);super(e,id,o)}}xs.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;return!(!n.isPrimary||n.button!==0)&&(o?.({event:n}),!0)}}];const ld={move:{name:"mousemove"},end:{name:"mouseup"}};var Er;(function(t){t[t.RightClick=2]="RightClick"})(Er||(Er={}));class Cs extends $r{constructor(e){super(e,ld,xn(e.event.target))}}Cs.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;return n.button!==Er.RightClick&&(o?.({event:n}),!0)}}];const cr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ss extends $r{constructor(e){super(e,cr)}static setup(){return window.addEventListener(cr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(cr.move.name,e)};function e(){}}}var Pn,Mo;function sd(t){let{acceleration:e,activator:n=Pn.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:s=5,order:a=Mo.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:f,delta:h,threshold:u}=t;const w=function(S){let{delta:k,disabled:N}=S;const R=Ro(k);return jn(T=>{if(N||!R||!T)return ad;const G={x:Math.sign(k.x-R.x),y:Math.sign(k.y-R.y)};return{x:{[vt.Backward]:T.x[vt.Backward]||G.x===-1,[vt.Forward]:T.x[vt.Forward]||G.x===1},y:{[vt.Backward]:T.y[vt.Backward]||G.y===-1,[vt.Forward]:T.y[vt.Forward]||G.y===1}}},[N,k,R])}({delta:h,disabled:!i}),[b,q]=function(){const S=l.useRef(null);return[l.useCallback((k,N)=>{S.current=setInterval(k,N)},[]),l.useCallback(()=>{S.current!==null&&(clearInterval(S.current),S.current=null)},[])]}(),I=l.useRef({x:0,y:0}),$=l.useRef({x:0,y:0}),D=l.useMemo(()=>{switch(n){case Pn.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Pn.DraggableRect:return r}},[n,r,d]),v=l.useRef(null),F=l.useCallback(()=>{const S=v.current;if(!S)return;const k=I.current.x*$.current.x,N=I.current.y*$.current.y;S.scrollBy(k,N)},[]),E=l.useMemo(()=>a===Mo.TreeOrder?[...c].reverse():c,[a,c]);l.useEffect(()=>{if(i&&c.length&&D){for(const S of E){if(o?.(S)===!1)continue;const k=c.indexOf(S),N=f[k];if(!N)continue;const{direction:R,speed:T}=ed(S,N,D,e,u);for(const G of["x","y"])w[G][R[G]]||(T[G]=0,R[G]=0);if(T.x>0||T.y>0)return q(),v.current=S,b(F,s),I.current=T,void($.current=R)}I.current={x:0,y:0},$.current={x:0,y:0},q()}else q()},[e,F,o,q,i,s,JSON.stringify(D),JSON.stringify(w),b,c,E,f,JSON.stringify(u)])}Ss.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;const{touches:r}=n;return!(r.length>1)&&(o?.({event:n}),!0)}}],function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"}(Pn||(Pn={})),function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"}(Mo||(Mo={}));const ad={x:{[vt.Backward]:!1,[vt.Forward]:!1},y:{[vt.Backward]:!1,[vt.Forward]:!1}};var Zn,Tr;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Zn||(Zn={})),function(t){t.Optimized="optimized"}(Tr||(Tr={}));const tl=new Map;function Mr(t,e){return jn(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function ko(t){let{callback:e,disabled:n}=t;const o=Do(e),r=l.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return l.useEffect(()=>()=>r?.disconnect(),[r]),r}function cd(t){return new Rr(qn(t),t)}function nl(t,e,n){e===void 0&&(e=cd);const[o,r]=l.useState(null);function i(){r(d=>{if(!t)return null;var c;if(t.isConnected===!1)return(c=d??n)!=null?c:null;const f=e(t);return JSON.stringify(d)===JSON.stringify(f)?d:f})}const s=function(d){let{callback:c,disabled:f}=d;const h=Do(c),u=l.useMemo(()=>{if(f||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:w}=window;return new w(h)},[h,f]);return l.useEffect(()=>()=>u?.disconnect(),[u]),u}({callback(d){if(t)for(const c of d){const{type:f,target:h}=c;if(f==="childList"&&h instanceof HTMLElement&&h.contains(t)){i();break}}}}),a=ko({callback:i});return zt(()=>{i(),t?(a?.observe(t),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[t]),o}const ol=[];function rl(t,e){e===void 0&&(e=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},e),l.useEffect(()=>{const o=t!==Ot;o&&!n.current&&(n.current=t),!o&&n.current&&(n.current=null)},[t]),n.current?Kn(t,n.current):Ot}function il(t){return l.useMemo(()=>t?function(e){const n=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(t):null,[t])}const ll=[];function qs(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Yn(e)?e:t}const dd=[{sensor:xs,options:{}},{sensor:Hr,options:{}}],ud={current:{}},yo={draggable:{measure:Xi},droppable:{measure:Xi,strategy:Zn.WhileDragging,frequency:Tr.Optimized},dragOverlay:{measure:qn}};class Bn extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,o;return(n=(o=this.get(e))==null?void 0:o.node.current)!=null?n:void 0}}const hd={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Bn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:To},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:yo,measureDroppableContainers:To,windowRect:null,measuringScheduled:!1},Rs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:To,draggableNodes:new Map,over:null,measureDroppableContainers:To},Jn=l.createContext(Rs),Es=l.createContext(hd);function gd(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Bn}}}function md(t,e){switch(e.type){case pt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case pt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case pt.DragEnd:case pt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pt.RegisterDroppable:{const{element:n}=e,{id:o}=n,r=new Bn(t.droppable.containers);return r.set(o,n),{...t,droppable:{...t.droppable,containers:r}}}case pt.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=e,i=t.droppable.containers.get(n);if(!i||o!==i.key)return t;const s=new Bn(t.droppable.containers);return s.set(n,{...i,disabled:r}),{...t,droppable:{...t.droppable,containers:s}}}case pt.UnregisterDroppable:{const{id:n,key:o}=e,r=t.droppable.containers.get(n);if(!r||o!==r.key)return t;const i=new Bn(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function fd(t){let{disabled:e}=t;const{active:n,activatorEvent:o,draggableNodes:r}=l.useContext(Jn),i=Ro(o),s=Ro(n?.id);return l.useEffect(()=>{if(!e&&!o&&i&&s!=null){if(!Ao(i)||document.activeElement===i.target)return;const a=r.get(s);if(!a)return;const{activatorNode:d,node:c}=a;if(!d.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[d.current,c.current]){if(!f)continue;const h=jc(f);if(h){h.focus();break}}})}},[o,e,r,s,i]),null}function Ts(t,e){let{transform:n,...o}=e;return t!=null&&t.length?t.reduce((r,i)=>i({transform:r,...o}),n):n}const zo=l.createContext({...Ot,scaleX:1,scaleY:1});var Ut;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ut||(Ut={}));const pd=l.memo(function(t){var e,n,o,r;let{id:i,accessibility:s,autoScroll:a=!0,children:d,sensors:c=dd,collisionDetection:f=Zc,measuring:h,modifiers:u,...w}=t;const b=l.useReducer(md,void 0,gd),[q,I]=b,[$,D]=function(){const[y]=l.useState(()=>new Set),W=l.useCallback(Y=>(y.add(Y),()=>y.delete(Y)),[y]);return[l.useCallback(Y=>{let{type:ie,event:de}=Y;y.forEach(ce=>{var he;return(he=ce[ie])==null?void 0:he.call(ce,de)})},[y]),W]}(),[v,F]=l.useState(Ut.Uninitialized),E=v===Ut.Initialized,{draggable:{active:S,nodes:k,translate:N},droppable:{containers:R}}=q,T=S!=null?k.get(S):null,G=l.useRef({initial:null,translated:null}),O=l.useMemo(()=>{var y;return S!=null?{id:S,data:(y=T?.data)!=null?y:ud,rect:G}:null},[S,T]),j=l.useRef(null),[z,B]=l.useState(null),[Z,P]=l.useState(null),M=Gn(w,Object.values(w)),H=Xn("DndDescribedBy",i),oe=l.useMemo(()=>R.getEnabled(),[R]),ue=(te=h,l.useMemo(()=>({draggable:{...yo.draggable,...te?.draggable},droppable:{...yo.droppable,...te?.droppable},dragOverlay:{...yo.dragOverlay,...te?.dragOverlay}}),[te?.draggable,te?.droppable,te?.dragOverlay]));var te;const{droppableRects:K,measureDroppableContainers:le,measuringScheduled:Re}=function(y,W){let{dragging:Y,dependencies:ie,config:de}=W;const[ce,he]=l.useState(null),{frequency:be,measure:ve,strategy:we}=de,qe=l.useRef(y),Be=function(){switch(we){case Zn.Always:return!1;case Zn.BeforeDragging:return Y;default:return!Y}}(),ze=Gn(Be),Ze=l.useCallback(function(je){je===void 0&&(je=[]),ze.current||he(et=>et===null?je:et.concat(je.filter(ht=>!et.includes(ht))))},[ze]),He=l.useRef(null),Ye=jn(je=>{if(Be&&!Y)return tl;if(!je||je===tl||qe.current!==y||ce!=null){const et=new Map;for(let ht of y){if(!ht)continue;if(ce&&ce.length>0&&!ce.includes(ht.id)&&ht.rect.current){et.set(ht.id,ht.rect.current);continue}const Et=ht.node.current,Dt=Et?new Rr(ve(Et),Et):null;ht.rect.current=Dt,Dt&&et.set(ht.id,Dt)}return et}return je},[y,ce,Y,Be,ve]);return l.useEffect(()=>{qe.current=y},[y]),l.useEffect(()=>{Be||Ze()},[Y,Be]),l.useEffect(()=>{ce&&ce.length>0&&he(null)},[JSON.stringify(ce)]),l.useEffect(()=>{Be||typeof be!="number"||He.current!==null||(He.current=setTimeout(()=>{Ze(),He.current=null},be))},[be,Be,Ze,...ie]),{droppableRects:Ye,measureDroppableContainers:Ze,measuringScheduled:ce!=null}}(oe,{dragging:E,dependencies:[N.x,N.y],config:ue.droppable}),Te=function(y,W){const Y=W!=null?y.get(W):void 0,ie=Y?Y.node.current:null;return jn(de=>{var ce;return W==null?null:(ce=ie??de)!=null?ce:null},[ie,W])}(k,S),ae=l.useMemo(()=>Z?Eo(Z):null,[Z]),Fe=function(){const y=z?.autoScrollEnabled===!1,W=typeof a=="object"?a.enabled===!1:a===!1,Y=E&&!y&&!W;return typeof a=="object"?{...a,enabled:Y}:{enabled:Y}}(),me=function(y,W){return Mr(y,W)}(Te,ue.draggable.measure);(function(y){let{activeNode:W,measure:Y,initialRect:ie,config:de=!0}=y;const ce=l.useRef(!1),{x:he,y:be}=typeof de=="boolean"?{x:de,y:de}:de;zt(()=>{if(!he&&!be||!W)return void(ce.current=!1);if(ce.current||!ie)return;const ve=W?.node.current;if(!ve||ve.isConnected===!1)return;const we=Yi(Y(ve),ie);if(he||(we.x=0),be||(we.y=0),ce.current=!0,Math.abs(we.x)>0||Math.abs(we.y)>0){const qe=gs(ve);qe&&qe.scrollBy({top:we.y,left:we.x})}},[W,he,be,ie,Y])})({activeNode:S!=null?k.get(S):null,config:Fe.layoutShiftCompensation,initialRect:me,measure:ue.draggable.measure});const Oe=nl(Te,ue.draggable.measure,me),xe=nl(Te?Te.parentElement:null),ge=l.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=R.getNodeFor((e=ge.current.over)==null?void 0:e.id),Se=function(y){let{measure:W}=y;const[Y,ie]=l.useState(null),de=ko({callback:l.useCallback(ve=>{for(const{target:we}of ve)if(Yn(we)){ie(qe=>{const Be=W(we);return qe?{...qe,width:Be.width,height:Be.height}:Be});break}},[W])}),ce=l.useCallback(ve=>{const we=qs(ve);de?.disconnect(),we&&de?.observe(we),ie(we?W(we):null)},[W,de]),[he,be]=qo(ce);return l.useMemo(()=>({nodeRef:he,rect:Y,setRef:be}),[Y,he,be])}({measure:ue.dragOverlay.measure}),pe=(n=Se.nodeRef.current)!=null?n:Te,Ce=E?(o=Se.rect)!=null?o:Oe:null,Ae=!!(Se.nodeRef.current&&Se.rect),ye=Yi(De=Ae?null:Oe,Mr(De));var De;const Pe=il(pe?Rt(pe):null),$e=function(y){const W=l.useRef(y),Y=jn(ie=>y?ie&&ie!==ol&&y&&W.current&&y.parentNode===W.current.parentNode?ie:Lo(y):ol,[y]);return l.useEffect(()=>{W.current=y},[y]),Y}(E?fe??Te:null),C=function(y,W){W===void 0&&(W=qn);const[Y]=y,ie=il(Y?Rt(Y):null),[de,ce]=l.useState(ll);function he(){ce(()=>y.length?y.map(ve=>ps(ve)?ie:new Rr(W(ve),ve)):ll)}const be=ko({callback:he});return zt(()=>{be?.disconnect(),he(),y.forEach(ve=>be?.observe(ve))},[y]),de}($e),We=Ts(u,{transform:{x:N.x-ye.x,y:N.y-ye.y,scaleX:1,scaleY:1},activatorEvent:Z,active:O,activeNodeRect:Oe,containerNodeRect:xe,draggingNodeRect:Ce,over:ge.current.over,overlayNodeRect:Se.rect,scrollableAncestors:$e,scrollableAncestorRects:C,windowRect:Pe}),nt=ae?vn(ae,N):null,Ke=function(y){const[W,Y]=l.useState(null),ie=l.useRef(y),de=l.useCallback(ce=>{const he=sr(ce.target);he&&Y(be=>be?(be.set(he,qr(he)),new Map(be)):null)},[]);return l.useEffect(()=>{const ce=ie.current;if(y!==ce){he(ce);const be=y.map(ve=>{const we=sr(ve);return we?(we.addEventListener("scroll",de,{passive:!0}),[we,qr(we)]):null}).filter(ve=>ve!=null);Y(be.length?new Map(be):null),ie.current=y}return()=>{he(y),he(ce)};function he(be){be.forEach(ve=>{const we=sr(ve);we?.removeEventListener("scroll",de)})}},[de,y]),l.useMemo(()=>y.length?W?Array.from(W.values()).reduce((ce,he)=>vn(ce,he),Ot):ws(y):Ot,[y,W])}($e),ee=rl(Ke),_e=rl(Ke,[Oe]),Ve=vn(We,ee),Me=Ce?Xc(Ce,We):null,Le=O&&Me?f({active:O,collisionRect:Me,droppableRects:K,droppableContainers:oe,pointerCoordinates:nt}):null,Ie=us(Le,"id"),[L,se]=l.useState(null),U=function(y,W,Y){return{...y,scaleX:W&&Y?W.width/Y.width:1,scaleY:W&&Y?W.height/Y.height:1}}(Ae?We:vn(We,_e),(r=L?.rect)!=null?r:null,Oe),J=l.useRef(null),m=l.useCallback((y,W)=>{let{sensor:Y,options:ie}=W;if(j.current==null)return;const de=k.get(j.current);if(!de)return;const ce=y.nativeEvent,he=new Y({active:j.current,activeNode:de,event:ce,options:ie,context:ge,onAbort(ve){if(!k.get(ve))return;const{onDragAbort:we}=M.current,qe={id:ve};we?.(qe),$({type:"onDragAbort",event:qe})},onPending(ve,we,qe,Be){if(!k.get(ve))return;const{onDragPending:ze}=M.current,Ze={id:ve,constraint:we,initialCoordinates:qe,offset:Be};ze?.(Ze),$({type:"onDragPending",event:Ze})},onStart(ve){const we=j.current;if(we==null)return;const qe=k.get(we);if(!qe)return;const{onDragStart:Be}=M.current,ze={activatorEvent:ce,active:{id:we,data:qe.data,rect:G}};Wt.unstable_batchedUpdates(()=>{Be?.(ze),F(Ut.Initializing),I({type:pt.DragStart,initialCoordinates:ve,active:we}),$({type:"onDragStart",event:ze}),B(J.current),P(ce)})},onMove(ve){I({type:pt.DragMove,coordinates:ve})},onEnd:be(pt.DragEnd),onCancel:be(pt.DragCancel)});function be(ve){return async function(){const{active:we,collisions:qe,over:Be,scrollAdjustedTranslate:ze}=ge.current;let Ze=null;if(we&&ze){const{cancelDrop:He}=M.current;Ze={activatorEvent:ce,active:we,collisions:qe,delta:ze,over:Be},ve===pt.DragEnd&&typeof He=="function"&&await Promise.resolve(He(Ze))&&(ve=pt.DragCancel)}j.current=null,Wt.unstable_batchedUpdates(()=>{I({type:ve}),F(Ut.Uninitialized),se(null),B(null),P(null),J.current=null;const He=ve===pt.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const Ye=M.current[He];Ye?.(Ze),$({type:He,event:Ze})}})}}J.current=he},[k]),_=l.useCallback((y,W)=>(Y,ie)=>{const de=Y.nativeEvent,ce=k.get(ie);if(j.current!==null||!ce||de.dndKit||de.defaultPrevented)return;const he={active:ce};y(Y,W.options,he)===!0&&(de.dndKit={capturedBy:W.sensor},j.current=ie,m(Y,W))},[k,m]),A=function(y,W){return l.useMemo(()=>y.reduce((Y,ie)=>{const{sensor:de}=ie;return[...Y,...de.activators.map(ce=>({eventName:ce.eventName,handler:W(ce.handler,ie)}))]},[]),[y,W])}(c,_);(function(y){l.useEffect(()=>{if(!Fo)return;const W=y.map(Y=>{let{sensor:ie}=Y;return ie.setup==null?void 0:ie.setup()});return()=>{for(const Y of W)Y?.()}},y.map(W=>{let{sensor:Y}=W;return Y}))})(c),zt(()=>{Oe&&v===Ut.Initializing&&F(Ut.Initialized)},[Oe,v]),l.useEffect(()=>{const{onDragMove:y}=M.current,{active:W,activatorEvent:Y,collisions:ie,over:de}=ge.current;if(!W||!Y)return;const ce={active:W,activatorEvent:Y,collisions:ie,delta:{x:Ve.x,y:Ve.y},over:de};Wt.unstable_batchedUpdates(()=>{y?.(ce),$({type:"onDragMove",event:ce})})},[Ve.x,Ve.y]),l.useEffect(()=>{const{active:y,activatorEvent:W,collisions:Y,droppableContainers:ie,scrollAdjustedTranslate:de}=ge.current;if(!y||j.current==null||!W||!de)return;const{onDragOver:ce}=M.current,he=ie.get(Ie),be=he&&he.rect.current?{id:he.id,rect:he.rect.current,data:he.data,disabled:he.disabled}:null,ve={active:y,activatorEvent:W,collisions:Y,delta:{x:de.x,y:de.y},over:be};Wt.unstable_batchedUpdates(()=>{se(be),ce?.(ve),$({type:"onDragOver",event:ve})})},[Ie]),zt(()=>{ge.current={activatorEvent:Z,active:O,activeNode:Te,collisionRect:Me,collisions:Le,droppableRects:K,draggableNodes:k,draggingNode:pe,draggingNodeRect:Ce,droppableContainers:R,over:L,scrollableAncestors:$e,scrollAdjustedTranslate:Ve},G.current={initial:Ce,translated:Me}},[O,Te,Le,Me,k,pe,Ce,K,R,L,$e,Ve]),sd({...Fe,delta:N,draggingRect:Me,pointerCoordinates:nt,scrollableAncestors:$e,scrollableAncestorRects:C});const x=l.useMemo(()=>({active:O,activeNode:Te,activeNodeRect:Oe,activatorEvent:Z,collisions:Le,containerNodeRect:xe,dragOverlay:Se,draggableNodes:k,droppableContainers:R,droppableRects:K,over:L,measureDroppableContainers:le,scrollableAncestors:$e,scrollableAncestorRects:C,measuringConfiguration:ue,measuringScheduled:Re,windowRect:Pe}),[O,Te,Oe,Z,Le,xe,Se,k,R,K,L,le,$e,C,ue,Re,Pe]),V=l.useMemo(()=>({activatorEvent:Z,activators:A,active:O,activeNodeRect:Oe,ariaDescribedById:{draggable:H},dispatch:I,draggableNodes:k,over:L,measureDroppableContainers:le}),[Z,A,O,Oe,I,H,k,L,le]);return l.createElement(as.Provider,{value:D},l.createElement(Jn.Provider,{value:V},l.createElement(Es.Provider,{value:x},l.createElement(zo.Provider,{value:U},d)),l.createElement(fd,{disabled:s?.restoreFocus===!1})),l.createElement($c,{...s,hiddenTextDescribedById:H}))}),vd=l.createContext(null),sl="button";function wd(t){let{id:e,data:n,disabled:o=!1,attributes:r}=t;const i=Xn("Draggable"),{activators:s,activatorEvent:a,active:d,activeNodeRect:c,ariaDescribedById:f,draggableNodes:h,over:u}=l.useContext(Jn),{role:w=sl,roleDescription:b="draggable",tabIndex:q=0}=r??{},I=d?.id===e,$=l.useContext(I?zo:vd),[D,v]=qo(),[F,E]=qo(),S=function(N,R){return l.useMemo(()=>N.reduce((T,G)=>{let{eventName:O,handler:j}=G;return T[O]=z=>{j(z,R)},T},{}),[N,R])}(s,e),k=Gn(n);return zt(()=>(h.set(e,{id:e,key:i,node:D,activatorNode:F,data:k}),()=>{const N=h.get(e);N&&N.key===i&&h.delete(e)}),[h,e]),{active:d,activatorEvent:a,activeNodeRect:c,attributes:l.useMemo(()=>({role:w,tabIndex:q,"aria-disabled":o,"aria-pressed":!(!I||w!==sl)||void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[o,w,q,I,b,f.draggable]),isDragging:I,listeners:o?void 0:S,node:D,over:u,setNodeRef:v,setActivatorNodeRef:E,transform:$}}function Ms(){return l.useContext(Es)}const yd={timeout:25};function bd(t){let{animation:e,children:n}=t;const[o,r]=l.useState(null),[i,s]=l.useState(null),a=Ro(n);return n||o||!a||r(a),zt(()=>{if(!i)return;const d=o?.key,c=o?.props.id;d!=null&&c!=null?Promise.resolve(e(c,i)).then(()=>{r(null)}):r(null)},[e,o,i]),l.createElement(l.Fragment,null,n,o?l.cloneElement(o,{ref:s}):null)}const xd={x:0,y:0,scaleX:1,scaleY:1};function Cd(t){let{children:e}=t;return l.createElement(Jn.Provider,{value:Rs},l.createElement(zo.Provider,{value:xd},e))}const Sd={position:"fixed",touchAction:"none"},qd=t=>Ao(t)?"transform 250ms ease":void 0,Rd=l.forwardRef((t,e)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:s,rect:a,style:d,transform:c,transition:f=qd}=t;if(!a)return null;const h=r?c:{...c,scaleX:1,scaleY:1},u={...Sd,width:a.width,height:a.height,top:a.top,left:a.left,transform:tn.Transform.toString(h),transformOrigin:r&&o?Uc(o,a):void 0,transition:typeof f=="function"?f(o):f,...d};return l.createElement(n,{className:s,style:u,ref:e},i)}),Ed=t=>e=>{let{active:n,dragOverlay:o}=e;const r={},{styles:i,className:s}=t;if(i!=null&&i.active)for(const[a,d]of Object.entries(i.active))d!==void 0&&(r[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,d));if(i!=null&&i.dragOverlay)for(const[a,d]of Object.entries(i.dragOverlay))d!==void 0&&o.node.style.setProperty(a,d);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&o.node.classList.add(s.dragOverlay),function(){for(const[a,d]of Object.entries(r))n.node.style.setProperty(a,d);s!=null&&s.active&&n.node.classList.remove(s.active)}},ks={duration:250,easing:"ease",keyframes:t=>{let{transform:{initial:e,final:n}}=t;return[{transform:tn.Transform.toString(e)},{transform:tn.Transform.toString(n)}]},sideEffects:Ed({styles:{active:{opacity:"0"}}})};function Td(t){let{config:e,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=t;return Do((i,s)=>{if(e===null)return;const a=n.get(i);if(!a)return;const d=a.node.current;if(!d)return;const c=qs(s);if(!c)return;const{transform:f}=Rt(s).getComputedStyle(s),h=hs(f);if(!h)return;const u=typeof e=="function"?e:function(w){const{duration:b,easing:q,sideEffects:I,keyframes:$}={...ks,...w};return D=>{let{active:v,dragOverlay:F,transform:E,...S}=D;if(!b)return;const k={x:F.rect.left-v.rect.left,y:F.rect.top-v.rect.top},N={scaleX:E.scaleX!==1?v.rect.width*E.scaleX/F.rect.width:1,scaleY:E.scaleY!==1?v.rect.height*E.scaleY/F.rect.height:1},R={x:E.x-k.x,y:E.y-k.y,...N},T=$({...S,active:v,dragOverlay:F,transform:{initial:E,final:R}}),[G]=T,O=T[T.length-1];if(JSON.stringify(G)===JSON.stringify(O))return;const j=I?.({active:v,dragOverlay:F,...S}),z=F.node.animate(T,{duration:b,easing:q,fill:"forwards"});return new Promise(B=>{z.onfinish=()=>{j?.(),B()}})}}(e);return ys(d,r.draggable.measure),u({active:{id:i,data:a.data,node:d,rect:r.draggable.measure(d)},draggableNodes:n,dragOverlay:{node:s,rect:r.dragOverlay.measure(c)},droppableContainers:o,measuringConfiguration:r,transform:h})})}let al=0;function Md(t){return l.useMemo(()=>{if(t!=null)return al++,al},[t])}const kd=l.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:s,wrapperElement:a="div",className:d,zIndex:c=999}=t;const{activatorEvent:f,active:h,activeNodeRect:u,containerNodeRect:w,draggableNodes:b,droppableContainers:q,dragOverlay:I,over:$,measuringConfiguration:D,scrollableAncestors:v,scrollableAncestorRects:F,windowRect:E}=Ms(),S=l.useContext(zo),k=Md(h?.id),N=Ts(s,{activatorEvent:f,active:h,activeNodeRect:u,containerNodeRect:w,draggingNodeRect:I.rect,over:$,overlayNodeRect:I.rect,scrollableAncestors:v,scrollableAncestorRects:F,transform:S,windowRect:E}),R=Mr(u),T=Td({config:o,draggableNodes:b,droppableContainers:q,measuringConfiguration:D}),G=R?I.setRef:void 0;return l.createElement(Cd,null,l.createElement(bd,{animation:T},h&&k?l.createElement(Rd,{key:k,id:h.id,ref:G,as:a,activatorEvent:f,adjustScale:e,className:d,transition:i,rect:R,style:{zIndex:c,...r},transform:N},n):null))});function Ur(t,e,n){const o=t.slice();return o.splice(n<0?o.length+n:n,0,o.splice(e,1)[0]),o}function _d(t,e){return t.reduce((n,o,r)=>{const i=e.get(o);return i&&(n[r]=i),n},Array(t.length))}function mo(t){return t!==null&&t>=0}const fo={scaleX:1,scaleY:1},Id=t=>{var e;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:s}=t;const a=(e=n[r])!=null?e:o;if(!a)return null;const d=function(c,f,h){const u=c[f],w=c[f-1],b=c[f+1];return!u||!w&&!b?0:h<f?w?u.left-(w.left+w.width):b.left-(u.left+u.width):b?b.left-(u.left+u.width):u.left-(w.left+w.width)}(n,s,r);if(s===r){const c=n[i];return c?{x:r<i?c.left+c.width-(a.left+a.width):c.left-a.left,y:0,...fo}:null}return s>r&&s<=i?{x:-a.width-d,y:0,...fo}:s<r&&s>=i?{x:a.width+d,y:0,...fo}:{x:0,y:0,...fo}},Wr=t=>{let{rects:e,activeIndex:n,overIndex:o,index:r}=t;const i=Ur(e,o,n),s=e[r],a=i[r];return a&&s?{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}:null},_s="Sortable",Is=l.createContext({activeIndex:-1,containerId:_s,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Wr,disabled:{draggable:!1,droppable:!1}});function Fd(t){let{children:e,id:n,items:o,strategy:r=Wr,disabled:i=!1}=t;const{active:s,dragOverlay:a,droppableRects:d,over:c,measureDroppableContainers:f}=Ms(),h=Xn(_s,n),u=a.rect!==null,w=l.useMemo(()=>o.map(S=>typeof S=="object"&&"id"in S?S.id:S),[o]),b=s!=null,q=s?w.indexOf(s.id):-1,I=c?w.indexOf(c.id):-1,$=l.useRef(w),D=!function(S,k){if(S===k)return!0;if(S.length!==k.length)return!1;for(let N=0;N<S.length;N++)if(S[N]!==k[N])return!1;return!0}(w,$.current),v=I!==-1&&q===-1||D,F=function(S){return typeof S=="boolean"?{draggable:S,droppable:S}:S}(i);zt(()=>{D&&b&&f(w)},[D,w,b,f]),l.useEffect(()=>{$.current=w},[w]);const E=l.useMemo(()=>({activeIndex:q,containerId:h,disabled:F,disableTransforms:v,items:w,overIndex:I,useDragOverlay:u,sortedRects:_d(w,d),strategy:r}),[q,h,F.draggable,F.droppable,v,w,I,d,u,r]);return l.createElement(Is.Provider,{value:E},e)}const Dd=t=>{let{id:e,items:n,activeIndex:o,overIndex:r}=t;return Ur(n,o,r).indexOf(e)},Ad=t=>{let{containerId:e,isSorting:n,wasDragging:o,index:r,items:i,newIndex:s,previousItems:a,previousContainerId:d,transition:c}=t;return!(!c||!o)&&(a===i||r!==s)&&(!!n||s!==r&&e===d)},Ld={duration:200,easing:"ease"},Fs="transform",zd=tn.Transition.toString({property:Fs,duration:0,easing:"linear"}),Od={roleDescription:"sortable"};function jd(t){let{animateLayoutChanges:e=Ad,attributes:n,disabled:o,data:r,getNewIndex:i=Dd,id:s,strategy:a,resizeObserverConfig:d,transition:c=Ld}=t;const{items:f,containerId:h,activeIndex:u,disabled:w,disableTransforms:b,sortedRects:q,overIndex:I,useDragOverlay:$,strategy:D}=l.useContext(Is),v=function(fe,Se){var pe,Ce;return typeof fe=="boolean"?{draggable:fe,droppable:!1}:{draggable:(pe=fe?.draggable)!=null?pe:Se.draggable,droppable:(Ce=fe?.droppable)!=null?Ce:Se.droppable}}(o,w),F=f.indexOf(s),E=l.useMemo(()=>({sortable:{containerId:h,index:F,items:f},...r}),[h,r,F,f]),S=l.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:k,node:N,isOver:R,setNodeRef:T}=function(fe){let{data:Se,disabled:pe=!1,id:Ce,resizeObserverConfig:Ae}=fe;const ye=Xn("Droppable"),{active:De,dispatch:Pe,over:$e,measureDroppableContainers:C}=l.useContext(Jn),We=l.useRef({disabled:pe}),nt=l.useRef(!1),Ke=l.useRef(null),ee=l.useRef(null),{disabled:_e,updateMeasurementsFor:Ve,timeout:Me}={...yd,...Ae},Le=Gn(Ve??Ce),Ie=ko({callback:l.useCallback(()=>{nt.current?(ee.current!=null&&clearTimeout(ee.current),ee.current=setTimeout(()=>{C(Array.isArray(Le.current)?Le.current:[Le.current]),ee.current=null},Me)):nt.current=!0},[Me]),disabled:_e||!De}),L=l.useCallback((m,_)=>{Ie&&(_&&(Ie.unobserve(_),nt.current=!1),m&&Ie.observe(m))},[Ie]),[se,U]=qo(L),J=Gn(Se);return l.useEffect(()=>{Ie&&se.current&&(Ie.disconnect(),nt.current=!1,Ie.observe(se.current))},[se,Ie]),l.useEffect(()=>(Pe({type:pt.RegisterDroppable,element:{id:Ce,key:ye,disabled:pe,node:se,rect:Ke,data:J}}),()=>Pe({type:pt.UnregisterDroppable,key:ye,id:Ce})),[Ce]),l.useEffect(()=>{pe!==We.current.disabled&&(Pe({type:pt.SetDroppableDisabled,id:Ce,key:ye,disabled:pe}),We.current.disabled=pe)},[Ce,ye,pe,Pe]),{active:De,rect:Ke,isOver:$e?.id===Ce,node:se,over:$e,setNodeRef:U}}({id:s,data:E,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...d}}),{active:G,activatorEvent:O,activeNodeRect:j,attributes:z,setNodeRef:B,listeners:Z,isDragging:P,over:M,setActivatorNodeRef:H,transform:oe}=wd({id:s,data:E,attributes:{...Od,...n},disabled:v.draggable}),ue=function(){for(var fe=arguments.length,Se=new Array(fe),pe=0;pe<fe;pe++)Se[pe]=arguments[pe];return l.useMemo(()=>Ce=>{Se.forEach(Ae=>Ae(Ce))},Se)}(T,B),te=!!G,K=te&&!b&&mo(u)&&mo(I),le=!$&&P,Re=le&&K?oe:null,Te=K?Re??(a??D)({rects:q,activeNodeRect:j,activeIndex:u,overIndex:I,index:F}):null,ae=mo(u)&&mo(I)?i({id:s,items:f,activeIndex:u,overIndex:I}):F,Fe=G?.id,me=l.useRef({activeId:Fe,items:f,newIndex:ae,containerId:h}),Oe=f!==me.current.items,xe=e({active:G,containerId:h,isDragging:P,isSorting:te,id:s,index:F,items:f,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:c,wasDragging:me.current.activeId!=null}),ge=function(fe){let{disabled:Se,index:pe,node:Ce,rect:Ae}=fe;const[ye,De]=l.useState(null),Pe=l.useRef(pe);return zt(()=>{if(!Se&&pe!==Pe.current&&Ce.current){const $e=Ae.current;if($e){const C=qn(Ce.current,{ignoreTransform:!0}),We={x:$e.left-C.left,y:$e.top-C.top,scaleX:$e.width/C.width,scaleY:$e.height/C.height};(We.x||We.y)&&De(We)}}pe!==Pe.current&&(Pe.current=pe)},[Se,pe,Ce,Ae]),l.useEffect(()=>{ye&&De(null)},[ye]),ye}({disabled:!xe,index:F,node:N,rect:k});return l.useEffect(()=>{te&&me.current.newIndex!==ae&&(me.current.newIndex=ae),h!==me.current.containerId&&(me.current.containerId=h),f!==me.current.items&&(me.current.items=f)},[te,ae,h,f]),l.useEffect(()=>{if(Fe===me.current.activeId)return;if(Fe!=null&&me.current.activeId==null)return void(me.current.activeId=Fe);const fe=setTimeout(()=>{me.current.activeId=Fe},50);return()=>clearTimeout(fe)},[Fe]),{active:G,activeIndex:u,attributes:z,data:E,rect:k,index:F,newIndex:ae,items:f,isOver:R,isSorting:te,isDragging:P,listeners:Z,node:N,overIndex:I,over:M,setNodeRef:ue,setActivatorNodeRef:H,setDroppableNodeRef:T,setDraggableNodeRef:B,transform:ge??Te,transition:function(){if(ge||Oe&&me.current.newIndex===F)return zd;if(!(le&&!Ao(O)||!c)&&(te||xe))return tn.Transition.toString({...c,property:Fs})}()}}function _o(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const Nd=[tt.Down,tt.Right,tt.Up,tt.Left],Pd=(t,e)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:s,scrollableAncestors:a}}=e;if(Nd.includes(t.code)){if(t.preventDefault(),!n||!o)return;const d=[];i.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const u=r.get(h.id);if(u)switch(t.code){case tt.Down:o.top<u.top&&d.push(h);break;case tt.Up:o.top>u.top&&d.push(h);break;case tt.Left:o.left>u.left&&d.push(h);break;case tt.Right:o.left<u.left&&d.push(h)}});const c=(h=>{let{collisionRect:u,droppableRects:w,droppableContainers:b}=h;const q=Ki(u),I=[];for(const $ of b){const{id:D}=$,v=w.get(D);if(v){const F=Ki(v),E=q.reduce((k,N,R)=>k+cs(F[R],N),0),S=Number((E/4).toFixed(4));I.push({id:D,data:{droppableContainer:$,value:S}})}}return I.sort(ds)})({collisionRect:o,droppableRects:r,droppableContainers:d});let f=us(c,"id");if(f===s?.id&&c.length>1&&(f=c[1].id),f!=null){const h=i.get(n.id),u=i.get(f),w=u?r.get(u.id):null,b=u?.node.current;if(b&&w&&h&&u){const q=Lo(b).some((F,E)=>a[E]!==F),I=cl(h,u),$=function(F,E){return!_o(F)||!_o(E)||!cl(F,E)?!1:F.data.current.sortable.index<E.data.current.sortable.index}(h,u),D=q||!I?{x:0,y:0}:{x:$?o.width-w.width:0,y:$?o.height-w.height:0},v={x:w.left,y:w.top};return D.x&&D.y?v:Kn(v,D)}}}};function cl(t,e){return!(!_o(t)||!_o(e))&&t.data.current.sortable.containerId===e.data.current.sortable.containerId}const Bd=t=>{let{transform:e}=t;return{...e,y:0}},Ds=l.memo(l.forwardRef((t,e)=>{const{children:n,style:o,className:r,index:i,editing:s,editable:a,selectedIndex:d,background:c,activeColor:f,borderColor:h,borderWidth:u,dragging:w,...b}=t;return g.jsxs("div",{ref:e,className:kt(r),style:{...o,display:"flex",flexDirection:"column",background:d===i?"white":c,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:d===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...b,children:[g.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[g.jsx("div",{style:{marginLeft:d===i?"0px":"-1px",marginTop:d===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,d===i?g.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):g.jsx(g.Fragment,{})]}),g.jsx("div",{style:{flex:"1 1 100%",background:d===i&&f?f?.toCSS():"none",minHeight:"2px"}})]})})),Lt={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},Gr=l.memo(l.forwardRef(({color:t,dragOverlay:e,dragging:n,disabled:o,fadeIn:r,handle:i,height:s,index:a,listeners:d,onRemove:c,renderItem:f,sorting:h,style:u,transition:w,transform:b,value:q,wrapperStyle:I,...$},D)=>{l.useEffect(()=>{if(e)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[e]);const v=f?f({dragOverlay:!!e,dragging:!!n,sorting:!!h,index:a,fadeIn:!!r,listeners:d,ref:D,style:u,transform:b,transition:w,value:q}):g.jsx(g.Fragment,{children:q});return g.jsx("div",{className:kt("tab-item",Lt.Wrapper,r&&Lt.fadeIn,h&&Lt.sorting,e&&Lt.dragOverlay),style:{...I,transition:[w,I?.transition].filter(Boolean).join(", "),"--translate-x":b?`${Math.round(b.x)}px`:void 0,"--translate-y":b?`${Math.round(b.y)}px`:void 0,"--scale-x":b?.scaleX?`${b.scaleX}`:void 0,"--scale-y":b?.scaleY?`${b.scaleY}`:void 0,"--index":a},ref:D,children:g.jsx("div",{className:kt(Lt.Item,n&&Lt.dragging,i&&Lt.withHandle,e&&Lt.dragOverlay,o&&Lt.disabled,t&&Lt.color,"dragging"),style:u,"data-cypress":"draggable-item",...i?void 0:d,...$,tabIndex:i?void 0:-1,children:v})})})),dl={Row:"_Row_1kr10_1"},As=l.memo(l.forwardRef(({children:t,horizontal:e,style:n},o)=>g.jsx("div",{ref:o,style:{...n},className:kt(dl.Row,e&&dl.horizontal),children:t}))),Vd={...ks},Hd=l.memo(l.forwardRef((t,e)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:s=Gc,coordinateGetter:a=Pd,dropAnimation:d=Vd,getItemStyles:c=()=>({}),getNewIndex:f,handle:h=!1,items:u,onMove:w,isDisabled:b=()=>!1,measuring:q,modifiers:I,renderItem:$,renderDivider:D,reorderItems:v=Ur,strategy:F=Wr,style:E,useDragOverlay:S=!0,onDragStart:k,wrapperStyle:N=()=>({})}=t,[R,T]=l.useState(()=>u);l.useEffect(()=>{T(u)},[u]);const[G,O]=l.useState(null),j=function(){for(var M=arguments.length,H=new Array(M),oe=0;oe<M;oe++)H[oe]=arguments[oe];return l.useMemo(()=>[...H].filter(ue=>ue!=null),[...H])}(lr(Cs,{activationConstraint:o}),lr(Ss,{activationConstraint:o}),lr(Hr,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:a})),z=R.indexOf.bind(R),B=G?z(G):-1,Z=[];R.map((M,H)=>{Z.push(g.jsx($d,{id:M,handle:h,index:H,style:c,wrapperStyle:N,disabled:b(M),renderItem:$,animateLayoutChanges:r,useDragOverlay:S,getNewIndex:f},M+"-"+H));const oe=D?.({key:"divider-"+H});oe&&Z.push(oe)});const{getPortalContainer:P}=Ol();return g.jsxs(pd,{sensors:j,collisionDetection:s,onDragStart:M=>{const{active:H}=M;H&&(k?.(M),O(H.id))},autoScroll:{canScroll:M=>!0},onDragEnd:M=>{if(O(null),M.over){const H=z(M.over.id);B!==H&&(T(oe=>v(oe,B,H)),w?.(B,H))}},onDragCancel:()=>{O(null)},measuring:q,modifiers:I,children:[g.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...E},className:kt(n,Lt.Wrapper),children:g.jsx(Fd,{items:R,strategy:F,children:g.jsx(As,{ref:e,children:Z})})}),S?Wt.createPortal(g.jsx(kd,{adjustScale:i,dropAnimation:d,children:G?g.jsx(Gr,{value:R[B],handle:h,renderItem:$,wrapperStyle:N({index:B,isDragging:!0,id:R[B]}),index:B,dragging:!0,style:c({id:R[B],index:B,isSorting:G!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),P()):null]})}));function $d({disabled:t,animateLayoutChanges:e,getNewIndex:n,handle:o,id:r,index:i,onRemove:s,style:a,renderItem:d,useDragOverlay:c,wrapperStyle:f}){const{attributes:h,isDragging:u,isSorting:w,listeners:b,overIndex:q,setNodeRef:I,transform:$,transition:D}=jd({id:r,animateLayoutChanges:e,disabled:t,getNewIndex:n});return g.jsx(Gr,{ref:I,value:r,disabled:t,dragging:u,sorting:w,handle:o,renderItem:d,index:i,style:a({index:i,id:r,isDragging:u,isSorting:w,overIndex:q}),onRemove:s?()=>s(r):void 0,transform:$,transition:D,wrapperStyle:f({index:i,isDragging:u,id:r}),listeners:b,"data-index":i,"data-id":r,dragOverlay:!c&&u,...h})}const Ud="_TabStrip_3x0dp_1",Wd=new p.Color("rgb(33, 115, 70)"),Gd="#eee",Kd=t=>g.jsx(Ds,{...t}),Ls=l.memo(l.forwardRef((t,e)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:s=[],onSelectedTabIndexChange:a,onTabNameChange:d,onTabMove:c,createScrollStartButton:f=Ir,createScrollEndButton:h=Fr,createScrollEdgeButton:u=Ml,createTabButton:w=Kd,createTabDivider:b,editLabelProps:q,disabled:I=!1,disableDrag:$=!1,background:D="white",activeColor:v=Wd,borderColor:F=Gd,borderWidth:E=1}=t,[S,k]=l.useState(i),[N,R]=l.useState(s),T=l.useCallback(ye=>{const De=P.current?.[ye]?.closest(".tab-item")??P.current?.[ye];De&&le.current?.scrollTo({top:De.offsetTop,left:De.offsetLeft,behavior:"smooth"})},[]);l.useEffect(()=>{T(i)},[i]);const G=l.useCallback((ye,De)=>{De!==S&&(k(De),a?.(De)),T(De)},[a,S]),O=l.useCallback((ye,De)=>{c?.(ye,De)},[c]),j=l.useRef(null),[z,B]=l.useState(-1),Z=l.useCallback((ye,De)=>{d?.(ye,De)},[d]);l.useLayoutEffect(()=>{k(i)},[i]),l.useLayoutEffect(()=>{R(s)},[s]);const P=l.useRef([]),M=l.useRef(null);l.useImperativeHandle(e,()=>Object.assign({startEdit(ye){P.current?.[ye]?.startEdit()},cancel(ye){P.current?.[ye]?.cancel()}},M.current),[S,z]);const H=l.useCallback(({value:ye,index:De,dragging:Pe})=>{const{style:$e,maxLength:C,...We}=q||{},nt=g.jsx(is,{ref:Ke=>{P.current[De]=Ke},value:ye,disabled:I,maxLength:C,style:{color:S===De&&v?v?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...$e},styleHover:{},onSubmit:Ke=>(j.current=!1,B(-1),Z(De,Ke)),onCancel:()=>{j.current=!1,B(-1)},onChange:Ke=>{j.current=!0,B(De)},...We});return w({onClick:Ke=>G(Ke,De),value:ye,index:De,editing:z===De&&j.current,editable:!0,disabled:I,selectedIndex:S,background:D,activeColor:v,borderColor:F,borderWidth:E,dragging:Pe,children:nt})},[S,Z,G,q,I,z,w]),[oe,{width:ue}]=en(),[te,{width:K}]=en(),le=l.useRef(null),[Re,Te]=l.useState({left:0,top:0,width:0,height:0}),[ae,Fe]=l.useState(null);l.useEffect(()=>{ae!==null&&le.current&&le.current.scrollTo({left:ae,behavior:"smooth"})},[ae]);const me=l.useCallback((ye,De=!1)=>{if(!le.current)return 0;let Pe=le.current.firstChild.getBoundingClientRect(),$e=le.current.firstChild.firstChild.children,C=0;return C=De?0:pr.getScrollTo(ye,Pe.left,$e,!0,Math.max(0,ye-200)),Fe(C),Math.max(0,C)},[]),Oe=l.useCallback((ye,De=!1)=>{if(!le.current)return 0;let Pe=le.current.firstChild.getBoundingClientRect(),$e=le.current.firstChild.firstChild.children,C=0;const We=Math.ceil(K-ue);return C=De?We:pr.getScrollTo(ye,Pe.left,$e,!1,Math.max(0,ye+200)),Fe(C),Math.min(We,C)},[K,ue]),xe=l.useRef(null),ge=l.useRef(null),fe=l.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,xe.current=null)},[]),Se=l.useCallback((ye,De,Pe=260)=>{xe.current=ye,ge.current=setTimeout(()=>{const $e=De?me(xe.current||ye):Oe(xe.current||ye);$e!==xe.current?Se($e,De,120):fe()},Pe)},[me,Oe,fe]);l.useEffect(()=>()=>fe(),[fe]);const pe=l.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Re.left)<=0||Math.floor(K-ue)===0,orientation:wt.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>Se(le.current.scrollLeft,!0),onClick:ye=>me(Math.min(le.current.scrollLeft,ae??Number.MAX_SAFE_INTEGER),ye.ctrlKey)}),[Re,ae,K,ue]),Ce=l.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(K-ue)<=Math.ceil(Re.left),orientation:wt.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>Se(le.current.scrollLeft,!1),onClick:ye=>Oe(Math.max(le.current.scrollLeft,ae??0),ye.ctrlKey)}),[Re,ae,K,ue]),Ae=l.useMemo(()=>g.jsxs(g.Fragment,{children:[g.jsx("div",{style:{minWidth:"16px"}}),n,u?.(pe)]}),[pe,Ce,f,h,n,u]);return g.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:kt(Ud,r),ref:M,children:[g.jsx("div",{style:{borderTop:`solid ${F} ${E}px`,position:"absolute",width:"100%"}}),g.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Ae}),g.jsx("div",{className:"Tabs",ref:oe,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:g.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:le,onScroll:ye=>{Te({left:ye.target.scrollLeft,top:ye.target.scrollTop,width:ye.target.scrollWidth,height:ye.target.scrollHeight})},children:g.jsx(Hd,{isDisabled:ye=>I||$,items:N,strategy:Id,modifiers:[Bd],ref:te,renderItem:H,renderDivider:b,onMove:O,activationConstraint:{distance:15}})})}),g.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:u(Ce)})]})}));Ls.displayName="TabStrip";const dr=l.createContext(null),Zd="_script-editor_iy654_5",Yd=l.lazy(()=>Promise.resolve().then(()=>require("./CGI2BcTiIO1cJwAK.cjs"))),Xd={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},ul=async(t,e,n)=>{const o=t.getModel();if(!o)return;const r=await e.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),s=await i.getNavigationTree(o.uri.toString()),a=t.getPosition();let d={...a};d.lineNumber=1,d.column=1;let c=!1;for(let q=a.lineNumber;q>=1;q--)if(o.getLineContent(q).trim()===""){const I=Kr(s,o.getOffsetAt({lineNumber:q,column:1}),"function");if(!I||Qd(I)){c=!0,d.lineNumber=q+1;break}{const $=I.spans[0].start;q=o.getPositionAt($).lineNumber,d.lineNumber=q}}let f=n,h=!1;!c&&!f.startsWith(`
|
|
35
|
-
`)&&
|
|
36
|
-
`+
|
|
27
|
+
`},hi={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function mi(e){let{announcements:t=hi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=gi}=e;const{announce:l,announcement:d}=function(){const[h,f]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&f(T)},[]),announcement:h}}(),m=fn("DndLiveRegion"),[p,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const f=o.useContext(Dr);o.useEffect(()=>{if(!f)throw new Error("useDndMonitor must be used within a children of <DndContext>");return f(h)},[h,f])}(o.useMemo(()=>({onDragStart(h){let{active:f}=h;l(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:T}=h;t.onDragMove&&l(t.onDragMove({active:f,over:T}))},onDragOver(h){let{active:f,over:T}=h;l(t.onDragOver({active:f,over:T}))},onDragEnd(h){let{active:f,over:T}=h;l(t.onDragEnd({active:f,over:T}))},onDragCancel(h){let{active:f,over:T}=h;l(t.onDragCancel({active:f,over:T}))}}),[l,t])),!p)return null;const x=o.createElement(o.Fragment,null,o.createElement(ci,{id:i,value:a.draggable}),o.createElement(ui,{id:m,announcement:d}));return n?Dt.createPortal(x,n):x}var ct;function Dn(){}function no(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ct||(ct={}));const Rt=Object.freeze({x:0,y:0});function zr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fi(e,t){const n=An(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Nr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function pi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Zo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Lr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Xo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const vi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Xo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,p=n.get(m);if(p){const g=zr(Xo(p),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(Nr)};function Ci(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const p=t.width*t.height,g=e.width*e.height,x=d*m;return Number((x/(p+g-x)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const p=Ci(m,t);p>0&&a.push({id:d,data:{droppableContainer:l,value:p}})}}return a.sort(pi)};function Yo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function yi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const wi=yi(1);function Or(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const xi={ignoreTransform:!1};function _t(e,t){t===void 0&&(t=xi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:x}=ft(e).getComputedStyle(e);g&&(n=function(h,f,T){const q=Or(f);if(!q)return h;const{scaleX:A,scaleY:D,x:G,y:U}=q,y=h.left-G-(1-A)*parseFloat(T),B=h.top-U-(1-D)*parseFloat(T.slice(T.indexOf(" ")+1)),S=A?h.width/A:h.width,w=D?h.height/D:h.height;return{width:S,height:w,top:B,right:y+S,bottom:B+w,left:y}}(n,g,x))}const{top:i,left:a,width:l,height:d,bottom:m,right:p}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:p}}function Jo(e){return _t(e,{ignoreTransform:!0})}function Vn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(bo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mn(a)||Fr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const x=m[g];return typeof x=="string"&&p.test(x)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function jr(e){const[t]=Vn(e,1);return t??null}function oo(e){return On&&e?Gt(e)?e:Co(e)?bo(e)||e===$t(e).scrollingElement?window:mn(e)?e:null:null:null}function Br(e){return Gt(e)?e.scrollX:e.scrollLeft}function Vr(e){return Gt(e)?e.scrollY:e.scrollTop}function co(e){return{x:Br(e),y:Vr(e)}}var ut;function Pr(e){return!(!On||!e)&&e===document.scrollingElement}function Hr(e){const t={x:0,y:0},n=Pr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const qi={x:.2,y:.2};function Si(e,t,n,i,a){let{top:l,left:d,right:m,bottom:p}=n;i===void 0&&(i=10),a===void 0&&(a=qi);const{isTop:g,isBottom:x,isLeft:h,isRight:f}=Hr(e),T={x:0,y:0},q={x:0,y:0},A=t.height*a.y,D=t.width*a.x;return!g&&l<=t.top+A?(T.y=ut.Backward,q.y=i*Math.abs((t.top+A-l)/A)):!x&&p>=t.bottom-A&&(T.y=ut.Forward,q.y=i*Math.abs((t.bottom-A-p)/A)),!f&&m>=t.right-D?(T.x=ut.Forward,q.x=i*Math.abs((t.right-D-m)/D)):!h&&d<=t.left+D&&(T.x=ut.Backward,q.x=i*Math.abs((t.left+D-d)/D)),{direction:T,speed:q}}function Ri(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Ur(e){return e.reduce((t,n)=>Kt(t,co(n)),Rt)}function Kr(e,t){if(t===void 0&&(t=_t),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);jr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ki=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Br(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Vr(n),0)}]];class uo{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Vn(n),a=Ur(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of ki)for(const p of d)Object.defineProperty(this,p,{get:()=>{const g=m(i),x=a[l]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function ro(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Ye;function Qo(e){e.preventDefault()}function Mi(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xt||(xt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Ye||(Ye={}));const $r={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class yo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new an($t(n)),this.windowListeners=new an(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Kr(i),n(Rt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=$r,coordinateGetter:d=Ti,scrollBehavior:m="smooth"}=a,{code:p}=t;if(l.end.includes(p))return void this.handleEnd(t);if(l.cancel.includes(p))return void this.handleCancel(t);const{collisionRect:g}=i.current,x=g?{x:g.left,y:g.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=x);const h=d(t,{active:n,context:i.current,currentCoordinates:x});if(h){const f=gn(h,x),T={x:0,y:0},{scrollableAncestors:q}=i.current;for(const A of q){const D=t.code,{isTop:G,isRight:U,isLeft:y,isBottom:B,maxScroll:S,minScroll:w}=Hr(A),k=Ri(A),O={x:Math.min(D===Ye.Right?k.right-k.width/2:k.right,Math.max(D===Ye.Right?k.left:k.left+k.width/2,h.x)),y:Math.min(D===Ye.Down?k.bottom-k.height/2:k.bottom,Math.max(D===Ye.Down?k.top:k.top+k.height/2,h.y))},E=D===Ye.Right&&!U||D===Ye.Left&&!y,F=D===Ye.Down&&!B||D===Ye.Up&&!G;if(E&&O.x!==h.x){const Z=A.scrollLeft+f.x,_=D===Ye.Right&&Z<=S.x||D===Ye.Left&&Z>=w.x;if(_&&!f.y)return void A.scrollTo({left:Z,behavior:m});T.x=_?A.scrollLeft-Z:D===Ye.Right?A.scrollLeft-S.x:A.scrollLeft-w.x,T.x&&A.scrollBy({left:-T.x,behavior:m});break}if(F&&O.y!==h.y){const Z=A.scrollTop+f.y,_=D===Ye.Down&&Z<=S.y||D===Ye.Up&&Z>=w.y;if(_&&!f.x)return void A.scrollTo({top:Z,behavior:m});T.y=_?A.scrollTop-Z:D===Ye.Down?A.scrollTop-S.y:A.scrollTop-w.y,T.y&&A.scrollBy({top:-T.y,behavior:m});break}}this.handleMove(t,Kt(gn(h,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function er(e){return!!(e&&"distance"in e)}function tr(e){return!!(e&&"delay"in e)}yo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=$r,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class wo{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:p}=ft(m);return m instanceof p?m:$t(m)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=$t(d),this.documentListeners=new an(this.document),this.listeners=new an(i),this.windowListeners=new an(ft(d)),this.initialCoordinates=(a=An(l))!=null?a:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,Qo),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,Qo),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(er(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Mi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const p=(n=An(t))!=null?n:Rt,g=gn(a,p);if(!i&&m){if(er(m)){if(m.tolerance!=null&&ro(g,m.tolerance))return this.handleCancel();if(ro(g,m.distance))return this.handleStart()}return tr(m)&&ro(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ii={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wr extends wo{constructor(t){const{event:n}=t,i=$t(n.target);super(t,Ii,i)}}Wr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Ei={move:{name:"mousemove"},end:{name:"mouseup"}};var go;(function(e){e[e.RightClick=2]="RightClick"})(go||(go={}));class Gr extends wo{constructor(t){super(t,Ei,$t(t.event.target))}}Gr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==go.RightClick&&(i?.({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _r extends wo{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}var sn,zn;function Fi(e){let{acceleration:t,activator:n=sn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=zn.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:h,threshold:f}=e;const T=function(w){let{delta:k,disabled:O}=w;const E=Fn(k);return ln(F=>{if(O||!E||!F)return Ai;const Z={x:Math.sign(k.x-E.x),y:Math.sign(k.y-E.y)};return{x:{[ut.Backward]:F.x[ut.Backward]||Z.x===-1,[ut.Forward]:F.x[ut.Forward]||Z.x===1},y:{[ut.Backward]:F.y[ut.Backward]||Z.y===-1,[ut.Forward]:F.y[ut.Forward]||Z.y===1}}},[O,k,E])}({delta:h,disabled:!l}),[q,A]=function(){const w=o.useRef(null);return[o.useCallback((k,O)=>{w.current=setInterval(k,O)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]}(),D=o.useRef({x:0,y:0}),G=o.useRef({x:0,y:0}),U=o.useMemo(()=>{switch(n){case sn.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case sn.DraggableRect:return a}},[n,a,p]),y=o.useRef(null),B=o.useCallback(()=>{const w=y.current;if(!w)return;const k=D.current.x*G.current.x,O=D.current.y*G.current.y;w.scrollBy(k,O)},[]),S=o.useMemo(()=>m===zn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&U){for(const w of S){if(i?.(w)===!1)continue;const k=g.indexOf(w),O=x[k];if(!O)continue;const{direction:E,speed:F}=Si(w,O,U,t,f);for(const Z of["x","y"])T[Z][E[Z]]||(F[Z]=0,E[Z]=0);if(F.x>0||F.y>0)return A(),y.current=w,q(B,d),D.current=F,void(G.current=E)}D.current={x:0,y:0},G.current={x:0,y:0},A()}else A()},[t,B,i,A,l,d,JSON.stringify(U),JSON.stringify(T),q,g,S,x,JSON.stringify(f)])}_r.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(sn||(sn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zn||(zn={}));const Ai={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var hn,ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),function(e){e.Optimized="optimized"}(ho||(ho={}));const nr=new Map;function mo(e,t){return ln(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=jn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function Di(e){return new uo(_t(e),e)}function or(e,t,n){t===void 0&&(t=Di);const[i,a]=o.useState(null);function l(){a(p=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=p??n)!=null?g:null;const x=t(e);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const d=function(p){let{callback:g,disabled:x}=p;const h=jn(g),f=o.useMemo(()=>{if(x||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(h)},[h,x]);return o.useEffect(()=>()=>f?.disconnect(),[f]),f}({callback(p){if(e)for(const g of p){const{type:x,target:h}=g;if(x==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Nn({callback:l});return St(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const rr=[];function lr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Rt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Rt}function ir(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const ar=[];function Zr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const zi=[{sensor:Wr,options:{}},{sensor:yo,options:{}}],Ni={current:{}},In={draggable:{measure:Jo},droppable:{measure:Jo,strategy:hn.WhileDragging,frequency:ho.Optimized},dragOverlay:{measure:_t}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Li={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Dn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:In,measureDroppableContainers:Dn,windowRect:null,measuringScheduled:!1},Xr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dn,draggableNodes:new Map,over:null,measureDroppableContainers:Dn},pn=o.createContext(Xr),Yr=o.createContext(Li);function Oi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function ji(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new dn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Bi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Fn(i),d=Fn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Bn(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const h=si(x);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function Jr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Pn=o.createContext({...Rt,scaleX:1,scaleY:1});var Et;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Et||(Et={}));const Vi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:p,sensors:g=zi,collisionDetection:x=bi,measuring:h,modifiers:f,...T}=e;const q=o.useReducer(ji,void 0,Oi),[A,D]=q,[G,U]=function(){const[v]=o.useState(()=>new Set),H=o.useCallback(X=>(v.add(X),()=>v.delete(X)),[v]);return[o.useCallback(X=>{let{type:ne,event:le}=X;v.forEach(ie=>{var se;return(se=ie[ne])==null?void 0:se.call(ie,le)})},[v]),H]}(),[y,B]=o.useState(Et.Uninitialized),S=y===Et.Initialized,{draggable:{active:w,nodes:k,translate:O},droppable:{containers:E}}=A,F=w!=null?k.get(w):null,Z=o.useRef({initial:null,translated:null}),_=o.useMemo(()=>{var v;return w!=null?{id:w,data:(v=F?.data)!=null?v:Ni,rect:Z}:null},[w,F]),P=o.useRef(null),[V,$]=o.useState(null),[oe,L]=o.useState(null),z=un(T,Object.values(T)),K=fn("DndDescribedBy",l),W=o.useMemo(()=>E.getEnabled(),[E]),Ce=(ae=h,o.useMemo(()=>({draggable:{...In.draggable,...ae?.draggable},droppable:{...In.droppable,...ae?.droppable},dragOverlay:{...In.dragOverlay,...ae?.dragOverlay}}),[ae?.draggable,ae?.droppable,ae?.dragOverlay]));var ae;const{droppableRects:Q,measureDroppableContainers:ee,measuringScheduled:we}=function(v,H){let{dragging:X,dependencies:ne,config:le}=H;const[ie,se]=o.useState(null),{frequency:ye,measure:me,strategy:fe}=le,qe=o.useRef(v),Oe=function(){switch(fe){case hn.Always:return!1;case hn.BeforeDragging:return X;default:return!X}}(),De=un(Oe),We=o.useCallback(function(Ne){Ne===void 0&&(Ne=[]),De.current||se(Xe=>Xe===null?Ne:Xe.concat(Ne.filter(it=>!Xe.includes(it))))},[De]),je=o.useRef(null),Ge=ln(Ne=>{if(Oe&&!X)return nr;if(!Ne||Ne===nr||qe.current!==v||ie!=null){const Xe=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){Xe.set(it.id,it.rect.current);continue}const pt=it.node.current,wt=pt?new uo(me(pt),pt):null;it.rect.current=wt,wt&&Xe.set(it.id,wt)}return Xe}return Ne},[v,ie,X,Oe,me]);return o.useEffect(()=>{qe.current=v},[v]),o.useEffect(()=>{Oe||We()},[X,Oe]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Oe||typeof ye!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},ye))},[ye,Oe,We,...ne]),{droppableRects:Ge,measureDroppableContainers:We,measuringScheduled:ie!=null}}(W,{dragging:S,dependencies:[O.x,O.y],config:Ce.droppable}),ke=function(v,H){const X=H!=null?v.get(H):void 0,ne=X?X.node.current:null;return ln(le=>{var ie;return H==null?null:(ie=ne??le)!=null?ie:null},[ne,H])}(k,w),ve=o.useMemo(()=>oe?An(oe):null,[oe]),Pe=function(){const v=V?.autoScrollEnabled===!1,H=typeof m=="object"?m.enabled===!1:m===!1,X=S&&!v&&!H;return typeof m=="object"?{...m,enabled:X}:{enabled:X}}(),ge=function(v,H){return mo(v,H)}(ke,Ce.draggable.measure);(function(v){let{activeNode:H,measure:X,initialRect:ne,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:ye}=typeof le=="boolean"?{x:le,y:le}:le;St(()=>{if(!se&&!ye||!H)return void(ie.current=!1);if(ie.current||!ne)return;const me=H?.node.current;if(!me||me.isConnected===!1)return;const fe=Yo(X(me),ne);if(se||(fe.x=0),ye||(fe.y=0),ie.current=!0,Math.abs(fe.x)>0||Math.abs(fe.y)>0){const qe=jr(me);qe&&qe.scrollBy({top:fe.y,left:fe.x})}},[H,se,ye,ne,X])})({activeNode:w!=null?k.get(w):null,config:Pe.layoutShiftCompensation,initialRect:ge,measure:Ce.draggable.measure});const He=or(ke,Ce.draggable.measure,ge),Se=or(ke?ke.parentElement:null),ce=o.useRef({activatorEvent:null,active:null,activeNode:ke,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=E.getNodeFor((t=ce.current.over)==null?void 0:t.id),he=function(v){let{measure:H}=v;const[X,ne]=o.useState(null),le=Nn({callback:o.useCallback(me=>{for(const{target:fe}of me)if(mn(fe)){ne(qe=>{const Oe=H(fe);return qe?{...qe,width:Oe.width,height:Oe.height}:Oe});break}},[H])}),ie=o.useCallback(me=>{const fe=Zr(me);le?.disconnect(),fe&&le?.observe(fe),ne(fe?H(fe):null)},[H,le]),[se,ye]=En(ie);return o.useMemo(()=>({nodeRef:se,rect:X,setRef:ye}),[X,se,ye])}({measure:Ce.dragOverlay.measure}),pe=(n=he.nodeRef.current)!=null?n:ke,xe=S?(i=he.rect)!=null?i:He:null,Me=!!(he.nodeRef.current&&he.rect),be=Yo(Ee=Me?null:He,mo(Ee));var Ee;const Le=ir(pe?ft(pe):null),Ve=function(v){const H=o.useRef(v),X=ln(ne=>v?ne&&ne!==rr&&v&&H.current&&v.parentNode===H.current.parentNode?ne:Vn(v):rr,[v]);return o.useEffect(()=>{H.current=v},[v]),X}(S?de??ke:null),C=function(v,H){H===void 0&&(H=_t);const[X]=v,ne=ir(X?ft(X):null),[le,ie]=o.useState(ar);function se(){ie(()=>v.length?v.map(me=>Pr(me)?ne:new uo(H(me),me)):ar)}const ye=Nn({callback:se});return St(()=>{ye?.disconnect(),se(),v.forEach(me=>ye?.observe(me))},[v]),le}(Ve),Ue=Jr(f,{transform:{x:O.x-be.x,y:O.y-be.y,scaleX:1,scaleY:1},activatorEvent:oe,active:_,activeNodeRect:He,containerNodeRect:Se,draggingNodeRect:xe,over:ce.current.over,overlayNodeRect:he.rect,scrollableAncestors:Ve,scrollableAncestorRects:C,windowRect:Le}),Qe=ve?Kt(ve,O):null,$e=function(v){const[H,X]=o.useState(null),ne=o.useRef(v),le=o.useCallback(ie=>{const se=oo(ie.target);se&&X(ye=>ye?(ye.set(se,co(se)),new Map(ye)):null)},[]);return o.useEffect(()=>{const ie=ne.current;if(v!==ie){se(ie);const ye=v.map(me=>{const fe=oo(me);return fe?(fe.addEventListener("scroll",le,{passive:!0}),[fe,co(fe)]):null}).filter(me=>me!=null);X(ye.length?new Map(ye):null),ne.current=v}return()=>{se(v),se(ie)};function se(ye){ye.forEach(me=>{const fe=oo(me);fe?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?H?Array.from(H.values()).reduce((ie,se)=>Kt(ie,se),Rt):Ur(v):Rt,[v,H])}(Ve),J=lr($e),Fe=lr($e,[He]),Be=Kt(Ue,J),Ie=xe?wi(xe,Ue):null,ze=_&&Ie?x({active:_,collisionRect:Ie,droppableRects:Q,droppableContainers:W,pointerCoordinates:Qe}):null,Ae=Lr(ze,"id"),[R,re]=o.useState(null),j=function(v,H,X){return{...v,scaleX:H&&X?H.width/X.width:1,scaleY:H&&X?H.height/X.height:1}}(Me?Ue:Kt(Ue,Fe),(a=R?.rect)!=null?a:null,He),Y=o.useRef(null),u=o.useCallback((v,H)=>{let{sensor:X,options:ne}=H;if(P.current==null)return;const le=k.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new X({active:P.current,activeNode:le,event:ie,options:ne,context:ce,onAbort(me){if(!k.get(me))return;const{onDragAbort:fe}=z.current,qe={id:me};fe?.(qe),G({type:"onDragAbort",event:qe})},onPending(me,fe,qe,Oe){if(!k.get(me))return;const{onDragPending:De}=z.current,We={id:me,constraint:fe,initialCoordinates:qe,offset:Oe};De?.(We),G({type:"onDragPending",event:We})},onStart(me){const fe=P.current;if(fe==null)return;const qe=k.get(fe);if(!qe)return;const{onDragStart:Oe}=z.current,De={activatorEvent:ie,active:{id:fe,data:qe.data,rect:Z}};Dt.unstable_batchedUpdates(()=>{Oe?.(De),B(Et.Initializing),D({type:ct.DragStart,initialCoordinates:me,active:fe}),G({type:"onDragStart",event:De}),$(Y.current),L(ie)})},onMove(me){D({type:ct.DragMove,coordinates:me})},onEnd:ye(ct.DragEnd),onCancel:ye(ct.DragCancel)});function ye(me){return async function(){const{active:fe,collisions:qe,over:Oe,scrollAdjustedTranslate:De}=ce.current;let We=null;if(fe&&De){const{cancelDrop:je}=z.current;We={activatorEvent:ie,active:fe,collisions:qe,delta:De,over:Oe},me===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(me=ct.DragCancel)}P.current=null,Dt.unstable_batchedUpdates(()=>{D({type:me}),B(Et.Uninitialized),re(null),$(null),L(null),Y.current=null;const je=me===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Ge=z.current[je];Ge?.(We),G({type:je,event:We})}})}}Y.current=se},[k]),M=o.useCallback((v,H)=>(X,ne)=>{const le=X.nativeEvent,ie=k.get(ne);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(X,H.options,se)===!0&&(le.dndKit={capturedBy:H.sensor},P.current=ne,u(X,H))},[k,u]),I=function(v,H){return o.useMemo(()=>v.reduce((X,ne)=>{const{sensor:le}=ne;return[...X,...le.activators.map(ie=>({eventName:ie.eventName,handler:H(ie.handler,ne)}))]},[]),[v,H])}(g,M);(function(v){o.useEffect(()=>{if(!On)return;const H=v.map(X=>{let{sensor:ne}=X;return ne.setup==null?void 0:ne.setup()});return()=>{for(const X of H)X?.()}},v.map(H=>{let{sensor:X}=H;return X}))})(g),St(()=>{He&&y===Et.Initializing&&B(Et.Initialized)},[He,y]),o.useEffect(()=>{const{onDragMove:v}=z.current,{active:H,activatorEvent:X,collisions:ne,over:le}=ce.current;if(!H||!X)return;const ie={active:H,activatorEvent:X,collisions:ne,delta:{x:Be.x,y:Be.y},over:le};Dt.unstable_batchedUpdates(()=>{v?.(ie),G({type:"onDragMove",event:ie})})},[Be.x,Be.y]),o.useEffect(()=>{const{active:v,activatorEvent:H,collisions:X,droppableContainers:ne,scrollAdjustedTranslate:le}=ce.current;if(!v||P.current==null||!H||!le)return;const{onDragOver:ie}=z.current,se=ne.get(Ae),ye=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,me={active:v,activatorEvent:H,collisions:X,delta:{x:le.x,y:le.y},over:ye};Dt.unstable_batchedUpdates(()=>{re(ye),ie?.(me),G({type:"onDragOver",event:me})})},[Ae]),St(()=>{ce.current={activatorEvent:oe,active:_,activeNode:ke,collisionRect:Ie,collisions:ze,droppableRects:Q,draggableNodes:k,draggingNode:pe,draggingNodeRect:xe,droppableContainers:E,over:R,scrollableAncestors:Ve,scrollAdjustedTranslate:Be},Z.current={initial:xe,translated:Ie}},[_,ke,ze,Ie,k,pe,xe,Q,E,R,Ve,Be]),Fi({...Pe,delta:O,draggingRect:Ie,pointerCoordinates:Qe,scrollableAncestors:Ve,scrollableAncestorRects:C});const b=o.useMemo(()=>({active:_,activeNode:ke,activeNodeRect:He,activatorEvent:oe,collisions:ze,containerNodeRect:Se,dragOverlay:he,draggableNodes:k,droppableContainers:E,droppableRects:Q,over:R,measureDroppableContainers:ee,scrollableAncestors:Ve,scrollableAncestorRects:C,measuringConfiguration:Ce,measuringScheduled:we,windowRect:Le}),[_,ke,He,oe,ze,Se,he,k,E,Q,R,ee,Ve,C,Ce,we,Le]),N=o.useMemo(()=>({activatorEvent:oe,activators:I,active:_,activeNodeRect:He,ariaDescribedById:{draggable:K},dispatch:D,draggableNodes:k,over:R,measureDroppableContainers:ee}),[oe,I,_,He,D,K,k,R,ee]);return o.createElement(Dr.Provider,{value:U},o.createElement(pn.Provider,{value:N},o.createElement(Yr.Provider,{value:b},o.createElement(Pn.Provider,{value:j},p)),o.createElement(Bi,{disabled:d?.restoreFocus===!1})),o.createElement(mi,{...d,hiddenTextDescribedById:K}))}),Pi=o.createContext(null),sr="button";function Hi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:d,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:h,over:f}=o.useContext(pn),{role:T=sr,roleDescription:q="draggable",tabIndex:A=0}=a??{},D=p?.id===t,G=o.useContext(D?Pn:Pi),[U,y]=En(),[B,S]=En(),w=function(O,E){return o.useMemo(()=>O.reduce((F,Z)=>{let{eventName:_,handler:P}=Z;return F[_]=V=>{P(V,E)},F},{}),[O,E])}(d,t),k=un(n);return St(()=>(h.set(t,{id:t,key:l,node:U,activatorNode:B,data:k}),()=>{const O=h.get(t);O&&O.key===l&&h.delete(t)}),[h,t]),{active:p,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:T,tabIndex:A,"aria-disabled":i,"aria-pressed":!(!D||T!==sr)||void 0,"aria-roledescription":q,"aria-describedby":x.draggable}),[i,T,A,D,q,x.draggable]),isDragging:D,listeners:i?void 0:w,node:U,over:f,setNodeRef:y,setActivatorNodeRef:S,transform:G}}function Qr(){return o.useContext(Yr)}const Ui={timeout:25};function Ki(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Fn(n);return n||i||!m||a(m),St(()=>{if(!l)return;const p=i?.key,g=i?.props.id;p!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const $i={x:0,y:0,scaleX:1,scaleY:1};function Wi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Xr},o.createElement(Pn.Provider,{value:$i},t))}const Gi={position:"fixed",touchAction:"none"},_i=e=>Bn(e)?"transform 250ms ease":void 0,Zi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:p,transform:g,transition:x=_i}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},f={...Gi,width:m.width,height:m.height,top:m.top,left:m.left,transform:Nt.Transform.toString(h),transformOrigin:a&&i?fi(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return o.createElement(n,{className:d,style:f,ref:t},l)}),Xi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,p]of Object.entries(l.active))p!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,p));if(l!=null&&l.dragOverlay)for(const[m,p]of Object.entries(l.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,p]of Object.entries(a))n.node.style.setProperty(m,p);d!=null&&d.active&&n.node.classList.remove(d.active)}},el={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nt.Transform.toString(t)},{transform:Nt.Transform.toString(n)}]},sideEffects:Xi({styles:{active:{opacity:"0"}}})};function Yi(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return jn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const p=m.node.current;if(!p)return;const g=Zr(d);if(!g)return;const{transform:x}=ft(d).getComputedStyle(d),h=Or(x);if(!h)return;const f=typeof t=="function"?t:function(T){const{duration:q,easing:A,sideEffects:D,keyframes:G}={...el,...T};return U=>{let{active:y,dragOverlay:B,transform:S,...w}=U;if(!q)return;const k={x:B.rect.left-y.rect.left,y:B.rect.top-y.rect.top},O={scaleX:S.scaleX!==1?y.rect.width*S.scaleX/B.rect.width:1,scaleY:S.scaleY!==1?y.rect.height*S.scaleY/B.rect.height:1},E={x:S.x-k.x,y:S.y-k.y,...O},F=G({...w,active:y,dragOverlay:B,transform:{initial:S,final:E}}),[Z]=F,_=F[F.length-1];if(JSON.stringify(Z)===JSON.stringify(_))return;const P=D?.({active:y,dragOverlay:B,...w}),V=B.node.animate(F,{duration:q,easing:A,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return Kr(p,a.draggable.measure),f({active:{id:l,data:m.data,node:p,rect:a.draggable.measure(p)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let dr=0;function Ji(e){return o.useMemo(()=>{if(e!=null)return dr++,dr},[e])}const Qi=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:p,zIndex:g=999}=e;const{activatorEvent:x,active:h,activeNodeRect:f,containerNodeRect:T,draggableNodes:q,droppableContainers:A,dragOverlay:D,over:G,measuringConfiguration:U,scrollableAncestors:y,scrollableAncestorRects:B,windowRect:S}=Qr(),w=o.useContext(Pn),k=Ji(h?.id),O=Jr(d,{activatorEvent:x,active:h,activeNodeRect:f,containerNodeRect:T,draggingNodeRect:D.rect,over:G,overlayNodeRect:D.rect,scrollableAncestors:y,scrollableAncestorRects:B,transform:w,windowRect:S}),E=mo(f),F=Yi({config:i,draggableNodes:q,droppableContainers:A,measuringConfiguration:U}),Z=E?D.setRef:void 0;return o.createElement(Wi,null,o.createElement(Ki,{animation:F},h&&k?o.createElement(Zi,{key:k,id:h.id,ref:Z,as:m,activatorEvent:x,adjustScale:t,className:p,transition:l,rect:E,style:{zIndex:g,...a},transform:O},n):null))});function xo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ea(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Mn(e){return e!==null&&e>=0}const Tn={scaleX:1,scaleY:1},ta=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const p=function(g,x,h){const f=g[x],T=g[x-1],q=g[x+1];return!f||!T&&!q?0:h<x?T?f.left-(T.left+T.width):q.left-(f.left+f.width):q?q.left-(f.left+f.width):f.left-(T.left+T.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...Tn}:null}return d>a&&d<=l?{x:-m.width-p,y:0,...Tn}:d<a&&d>=l?{x:m.width+p,y:0,...Tn}:{x:0,y:0,...Tn}},qo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=xo(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},tl="Sortable",nl=o.createContext({activeIndex:-1,containerId:tl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qo,disabled:{draggable:!1,droppable:!1}});function na(e){let{children:t,id:n,items:i,strategy:a=qo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=Qr(),h=fn(tl,n),f=m.rect!==null,T=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),q=d!=null,A=d?T.indexOf(d.id):-1,D=g?T.indexOf(g.id):-1,G=o.useRef(T),U=!function(w,k){if(w===k)return!0;if(w.length!==k.length)return!1;for(let O=0;O<w.length;O++)if(w[O]!==k[O])return!1;return!0}(T,G.current),y=D!==-1&&A===-1||U,B=function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w}(l);St(()=>{U&&q&&x(T)},[U,T,q,x]),o.useEffect(()=>{G.current=T},[T]);const S=o.useMemo(()=>({activeIndex:A,containerId:h,disabled:B,disableTransforms:y,items:T,overIndex:D,useDragOverlay:f,sortedRects:ea(T,p),strategy:a}),[A,h,B.draggable,B.droppable,y,T,D,p,f,a]);return o.createElement(nl.Provider,{value:S},t)}const oa=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return xo(n,i,a).indexOf(t)},ra=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:p,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===p)},la={duration:200,easing:"ease"},ol="transform",ia=Nt.Transition.toString({property:ol,duration:0,easing:"linear"}),aa={roleDescription:"sortable"};function sa(e){let{animateLayoutChanges:t=ra,attributes:n,disabled:i,data:a,getNewIndex:l=oa,id:d,strategy:m,resizeObserverConfig:p,transition:g=la}=e;const{items:x,containerId:h,activeIndex:f,disabled:T,disableTransforms:q,sortedRects:A,overIndex:D,useDragOverlay:G,strategy:U}=o.useContext(nl),y=function(de,he){var pe,xe;return typeof de=="boolean"?{draggable:de,droppable:!1}:{draggable:(pe=de?.draggable)!=null?pe:he.draggable,droppable:(xe=de?.droppable)!=null?xe:he.droppable}}(i,T),B=x.indexOf(d),S=o.useMemo(()=>({sortable:{containerId:h,index:B,items:x},...a}),[h,a,B,x]),w=o.useMemo(()=>x.slice(x.indexOf(d)),[x,d]),{rect:k,node:O,isOver:E,setNodeRef:F}=function(de){let{data:he,disabled:pe=!1,id:xe,resizeObserverConfig:Me}=de;const be=fn("Droppable"),{active:Ee,dispatch:Le,over:Ve,measureDroppableContainers:C}=o.useContext(pn),Ue=o.useRef({disabled:pe}),Qe=o.useRef(!1),$e=o.useRef(null),J=o.useRef(null),{disabled:Fe,updateMeasurementsFor:Be,timeout:Ie}={...Ui,...Me},ze=un(Be??xe),Ae=Nn({callback:o.useCallback(()=>{Qe.current?(J.current!=null&&clearTimeout(J.current),J.current=setTimeout(()=>{C(Array.isArray(ze.current)?ze.current:[ze.current]),J.current=null},Ie)):Qe.current=!0},[Ie]),disabled:Fe||!Ee}),R=o.useCallback((u,M)=>{Ae&&(M&&(Ae.unobserve(M),Qe.current=!1),u&&Ae.observe(u))},[Ae]),[re,j]=En(R),Y=un(he);return o.useEffect(()=>{Ae&&re.current&&(Ae.disconnect(),Qe.current=!1,Ae.observe(re.current))},[re,Ae]),o.useEffect(()=>(Le({type:ct.RegisterDroppable,element:{id:xe,key:be,disabled:pe,node:re,rect:$e,data:Y}}),()=>Le({type:ct.UnregisterDroppable,key:be,id:xe})),[xe]),o.useEffect(()=>{pe!==Ue.current.disabled&&(Le({type:ct.SetDroppableDisabled,id:xe,key:be,disabled:pe}),Ue.current.disabled=pe)},[xe,be,pe,Le]),{active:Ee,rect:$e,isOver:Ve?.id===xe,node:re,over:Ve,setNodeRef:j}}({id:d,data:S,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...p}}),{active:Z,activatorEvent:_,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:oe,isDragging:L,over:z,setActivatorNodeRef:K,transform:W}=Hi({id:d,data:S,attributes:{...aa,...n},disabled:y.draggable}),Ce=function(){for(var de=arguments.length,he=new Array(de),pe=0;pe<de;pe++)he[pe]=arguments[pe];return o.useMemo(()=>xe=>{he.forEach(Me=>Me(xe))},he)}(F,$),ae=!!Z,Q=ae&&!q&&Mn(f)&&Mn(D),ee=!G&&L,we=ee&&Q?W:null,ke=Q?we??(m??U)({rects:A,activeNodeRect:P,activeIndex:f,overIndex:D,index:B}):null,ve=Mn(f)&&Mn(D)?l({id:d,items:x,activeIndex:f,overIndex:D}):B,Pe=Z?.id,ge=o.useRef({activeId:Pe,items:x,newIndex:ve,containerId:h}),He=x!==ge.current.items,Se=t({active:Z,containerId:h,isDragging:L,isSorting:ae,id:d,index:B,items:x,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:g,wasDragging:ge.current.activeId!=null}),ce=function(de){let{disabled:he,index:pe,node:xe,rect:Me}=de;const[be,Ee]=o.useState(null),Le=o.useRef(pe);return St(()=>{if(!he&&pe!==Le.current&&xe.current){const Ve=Me.current;if(Ve){const C=_t(xe.current,{ignoreTransform:!0}),Ue={x:Ve.left-C.left,y:Ve.top-C.top,scaleX:Ve.width/C.width,scaleY:Ve.height/C.height};(Ue.x||Ue.y)&&Ee(Ue)}}pe!==Le.current&&(Le.current=pe)},[he,pe,xe,Me]),o.useEffect(()=>{be&&Ee(null)},[be]),be}({disabled:!Se,index:B,node:O,rect:k});return o.useEffect(()=>{ae&&ge.current.newIndex!==ve&&(ge.current.newIndex=ve),h!==ge.current.containerId&&(ge.current.containerId=h),x!==ge.current.items&&(ge.current.items=x)},[ae,ve,h,x]),o.useEffect(()=>{if(Pe===ge.current.activeId)return;if(Pe!=null&&ge.current.activeId==null)return void(ge.current.activeId=Pe);const de=setTimeout(()=>{ge.current.activeId=Pe},50);return()=>clearTimeout(de)},[Pe]),{active:Z,activeIndex:f,attributes:V,data:S,rect:k,index:B,newIndex:ve,items:x,isOver:E,isSorting:ae,isDragging:L,listeners:oe,node:O,overIndex:D,over:z,setNodeRef:Ce,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:$,transform:ce??ke,transition:function(){if(ce||He&&ge.current.newIndex===B)return ia;if(!(ee&&!Bn(_)||!g)&&(ae||Se))return Nt.Transition.toString({...g,property:ol})}()}}function Ln(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ca=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const p=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=a.get(h.id);if(f)switch(e.code){case Ye.Down:i.top<f.top&&p.push(h);break;case Ye.Up:i.top>f.top&&p.push(h);break;case Ye.Left:i.left>f.left&&p.push(h);break;case Ye.Right:i.left<f.left&&p.push(h)}});const g=(h=>{let{collisionRect:f,droppableRects:T,droppableContainers:q}=h;const A=Zo(f),D=[];for(const G of q){const{id:U}=G,y=T.get(U);if(y){const B=Zo(y),S=A.reduce((k,O,E)=>k+zr(B[E],O),0),w=Number((S/4).toFixed(4));D.push({id:U,data:{droppableContainer:G,value:w}})}}return D.sort(Nr)})({collisionRect:i,droppableRects:a,droppableContainers:p});let x=Lr(g,"id");if(x===d?.id&&g.length>1&&(x=g[1].id),x!=null){const h=l.get(n.id),f=l.get(x),T=f?a.get(f.id):null,q=f?.node.current;if(q&&T&&h&&f){const A=Vn(q).some((B,S)=>m[S]!==B),D=cr(h,f),G=function(B,S){return!Ln(B)||!Ln(S)||!cr(B,S)?!1:B.data.current.sortable.index<S.data.current.sortable.index}(h,f),U=A||!D?{x:0,y:0}:{x:G?i.width-T.width:0,y:G?i.height-T.height:0},y={x:T.left,y:T.top};return U.x&&U.y?y:gn(y,U)}}}};function cr(e,t){return!(!Ln(e)||!Ln(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ua=e=>{let{transform:t}=e;return{...t,y:0}},rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:p,background:g,activeColor:x,borderColor:h,borderWidth:f,dragging:T,...q}=e;return c.jsxs("div",{ref:t,className:bt(a),style:{...i,display:"flex",flexDirection:"column",background:p===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:p===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:p===l?"0px":"-1px",marginTop:p===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,p===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:p===l&&x?x?.toCSS():"none",minHeight:"2px"}})]})})),qt={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},So=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:p,onRemove:g,renderItem:x,sorting:h,style:f,transition:T,transform:q,value:A,wrapperStyle:D,...G},U)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=x?x({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:p,ref:U,style:f,transform:q,transition:T,value:A}):c.jsx(c.Fragment,{children:A});return c.jsx("div",{className:bt("tab-item",qt.Wrapper,a&&qt.fadeIn,h&&qt.sorting,t&&qt.dragOverlay),style:{...D,transition:[T,D?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:U,children:c.jsx("div",{className:bt(qt.Item,n&&qt.dragging,l&&qt.withHandle,t&&qt.dragOverlay,i&&qt.disabled,e&&qt.color,"dragging"),style:f,"data-cypress":"draggable-item",...l?void 0:p,...G,tabIndex:l?void 0:-1,children:y})})})),ur={Row:"_Row_1kr10_1"},ll=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:bt(ur.Row,t&&ur.horizontal),children:e}))),ga={...el},ha=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=vi,coordinateGetter:m=ca,dropAnimation:p=ga,getItemStyles:g=()=>({}),getNewIndex:x,handle:h=!1,items:f,onMove:T,isDisabled:q=()=>!1,measuring:A,modifiers:D,renderItem:G,renderDivider:U,reorderItems:y=xo,strategy:B=qo,style:S,useDragOverlay:w=!0,onDragStart:k,wrapperStyle:O=()=>({})}=e,[E,F]=o.useState(()=>f);o.useEffect(()=>{F(f)},[f]);const[Z,_]=o.useState(null),P=function(){for(var z=arguments.length,K=new Array(z),W=0;W<z;W++)K[W]=arguments[W];return o.useMemo(()=>[...K].filter(Ce=>Ce!=null),[...K])}(no(Gr,{activationConstraint:i}),no(_r,{activationConstraint:i}),no(yo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=E.indexOf.bind(E),$=Z?V(Z):-1,oe=[];E.map((z,K)=>{oe.push(c.jsx(ma,{id:z,handle:h,index:K,style:g,wrapperStyle:O,disabled:q(z),renderItem:G,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:x},z+"-"+K));const W=U?.({key:"divider-"+K});W&&oe.push(W)});const{getPortalContainer:L}=r.useFullscreenPortal();return c.jsxs(Vi,{sensors:P,collisionDetection:d,onDragStart:z=>{const{active:K}=z;K&&(k?.(z),_(K.id))},autoScroll:{canScroll:z=>!0},onDragEnd:z=>{if(_(null),z.over){const K=V(z.over.id);$!==K&&(F(W=>y(W,$,K)),T?.($,K))}},onDragCancel:()=>{_(null)},measuring:A,modifiers:D,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...S},className:bt(n,qt.Wrapper),children:c.jsx(na,{items:E,strategy:B,children:c.jsx(ll,{ref:t,children:oe})})}),w?Dt.createPortal(c.jsx(Qi,{adjustScale:l,dropAnimation:p,children:Z?c.jsx(So,{value:E[$],handle:h,renderItem:G,wrapperStyle:O({index:$,isDragging:!0,id:E[$]}),index:$,dragging:!0,style:g({id:E[$],index:$,isSorting:Z!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),L()):null]})}));function ma({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:p,useDragOverlay:g,wrapperStyle:x}){const{attributes:h,isDragging:f,isSorting:T,listeners:q,overIndex:A,setNodeRef:D,transform:G,transition:U}=sa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(So,{ref:D,value:a,disabled:e,dragging:f,sorting:T,handle:i,renderItem:p,index:l,style:m({index:l,id:a,isDragging:f,isSorting:T,overIndex:A}),onRemove:d?()=>d(a):void 0,transform:G,transition:U,wrapperStyle:x({index:l,isDragging:f,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!g&&f,...h})}const fa="_TabStrip_3x0dp_1",pa=new s.Color("rgb(33, 115, 70)"),va="#eee",Ca=e=>c.jsx(rl,{...e}),il=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:p,onTabMove:g,createScrollStartButton:x=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:f=r.defaultCreateScrollEdgeButton,createTabButton:T=Ca,createTabDivider:q,editLabelProps:A,disabled:D=!1,disableDrag:G=!1,background:U="white",activeColor:y=pa,borderColor:B=va,borderWidth:S=1}=e,[w,k]=o.useState(l),[O,E]=o.useState(d),F=o.useCallback(be=>{const Ee=L.current?.[be]?.closest(".tab-item")??L.current?.[be];Ee&&ee.current?.scrollTo({top:Ee.offsetTop,left:Ee.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{F(l)},[l]);const Z=o.useCallback((be,Ee)=>{Ee!==w&&(k(Ee),m?.(Ee)),F(Ee)},[m,w]),_=o.useCallback((be,Ee)=>{g?.(be,Ee)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),oe=o.useCallback((be,Ee)=>{p?.(be,Ee)},[p]);o.useLayoutEffect(()=>{k(l)},[l]),o.useLayoutEffect(()=>{E(d)},[d]);const L=o.useRef([]),z=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(be){L.current?.[be]?.startEdit()},cancel(be){L.current?.[be]?.cancel()}},z.current),[w,V]);const K=o.useCallback(({value:be,index:Ee,dragging:Le})=>{const{style:Ve,maxLength:C,...Ue}=A||{},Qe=c.jsx(Er,{ref:$e=>{L.current[Ee]=$e},value:be,disabled:D,maxLength:C,style:{color:w===Ee&&y?y?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Ve},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),oe(Ee,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Ee)},...Ue});return T({onClick:$e=>Z($e,Ee),value:be,index:Ee,editing:V===Ee&&P.current,editable:!0,disabled:D,selectedIndex:w,background:U,activeColor:y,borderColor:B,borderWidth:S,dragging:Le,children:Qe})},[w,oe,Z,A,D,V,T]),[W,{width:Ce}]=zt(),[ae,{width:Q}]=zt(),ee=o.useRef(null),[we,ke]=o.useState({left:0,top:0,width:0,height:0}),[ve,Pe]=o.useState(null);o.useEffect(()=>{ve!==null&&ee.current&&ee.current.scrollTo({left:ve,behavior:"smooth"})},[ve]);const ge=o.useCallback((be,Ee=!1)=>{if(!ee.current)return 0;let Le=ee.current.firstChild.getBoundingClientRect(),Ve=ee.current.firstChild.firstChild.children,C=0;return C=Ee?0:r.ScrollUtils.getScrollTo(be,Le.left,Ve,!0,Math.max(0,be-200)),Pe(C),Math.max(0,C)},[]),He=o.useCallback((be,Ee=!1)=>{if(!ee.current)return 0;let Le=ee.current.firstChild.getBoundingClientRect(),Ve=ee.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(Q-Ce);return C=Ee?Ue:r.ScrollUtils.getScrollTo(be,Le.left,Ve,!1,Math.max(0,be+200)),Pe(C),Math.min(Ue,C)},[Q,Ce]),Se=o.useRef(null),ce=o.useRef(null),de=o.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null,Se.current=null)},[]),he=o.useCallback((be,Ee,Le=260)=>{Se.current=be,ce.current=setTimeout(()=>{const Ve=Ee?ge(Se.current||be):He(Se.current||be);Ve!==Se.current?he(Ve,Ee,120):de()},Le)},[ge,He,de]);o.useEffect(()=>()=>de(),[de]);const pe=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(we.left)<=0||Math.floor(Q-Ce)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>he(ee.current.scrollLeft,!0),onClick:be=>ge(Math.min(ee.current.scrollLeft,ve??Number.MAX_SAFE_INTEGER),be.ctrlKey)}),[we,ve,Q,Ce]),xe=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(Q-Ce)<=Math.ceil(we.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>he(ee.current.scrollLeft,!1),onClick:be=>He(Math.max(ee.current.scrollLeft,ve??0),be.ctrlKey)}),[we,ve,Q,Ce]),Me=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,f?.(pe)]}),[pe,xe,x,h,n,f]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:bt(fa,a),ref:z,children:[c.jsx("div",{style:{borderTop:`solid ${B} ${S}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Me}),c.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:ee,onScroll:be=>{ke({left:be.target.scrollLeft,top:be.target.scrollTop,width:be.target.scrollWidth,height:be.target.scrollHeight})},children:c.jsx(ha,{isDisabled:be=>D||G,items:O,strategy:ta,modifiers:[ua],ref:ae,renderItem:K,renderDivider:q,onMove:_,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(xe)})]})}));il.displayName="TabStrip";const io=o.createContext(null),ba="_script-editor_iy654_5",ya=o.lazy(()=>Promise.resolve().then(()=>require("./QYCMHglsAIjHCSEg.cjs"))),wa={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},gr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),d=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let p={...m};p.lineNumber=1,p.column=1;let g=!1;for(let A=m.lineNumber;A>=1;A--)if(i.getLineContent(A).trim()===""){const D=Ro(d,i.getOffsetAt({lineNumber:A,column:1}),"function");if(!D||qa(D)){g=!0,p.lineNumber=A+1;break}{const G=D.spans[0].start;A=i.getPositionAt(G).lineNumber,p.lineNumber=A}}let x=n,h=!1;!g&&!x.startsWith(`
|
|
28
|
+
`)&&p.lineNumber>1&&(x=`
|
|
29
|
+
`+x,h=!0);let f=!1;i.getLineCount()>1&&(x.endsWith(`
|
|
37
30
|
|
|
38
|
-
`)||(
|
|
31
|
+
`)||(x+=`
|
|
39
32
|
|
|
40
|
-
`,u=!0));const w=[{range:new e.Range(d.lineNumber,d.column,d.lineNumber,d.column),text:`${f}`}];let b=null;o.pushEditOperations([],w,q=>(b=q[0].range,h&&b.startLineNumber++,u&&b.endLineNumber--,[new e.Selection(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn)])),t.setSelection({startLineNumber:b.endLineNumber,startColumn:b.endColumn,endLineNumber:b.startLineNumber,endColumn:b.startColumn})};function Jd(t,e){let n=null;for(let o=0;!n&&o<t.length;o++){const r=t[o];r.getName()===e.text&&(n=r)}return n?n.getContext():"formula"}function kr(t,e,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,s=t.getPositionAt(i);r.push({name:o.text,type:Jd(n,o),lineNumber:s.lineNumber})}if(o.childItems)for(const i of o.childItems)kr(t,e,n,i,r);return r}function Kr(t,e,n="function",o){const r=t.spans;for(let i=0;i<r.length;i++){const s=r[i];if(s.start<=e&&e<s.start+s.length){if(t.kind===n&&(!o||t.kindModifiers===o))return t;for(const a of t.childItems||[]){const d=Kr(a,e,n,o);if(d)return d}}return null}}function Qd(t){return t.kind==="comment"}const eu=l.memo(l.forwardRef((t,e)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:s,darkMode:a,loadingPanel:d,autoFocus:c=!0,onStatusChange:f,...h}=t,u=l.useRef(null),w=X(s,[s]),b=l.useRef(!1),q=l.useMemo(()=>({contains(M){if(!u.current)return;const H=u.current.editor;return H&&H.getDomNode()?.contains(M)},focus(){if(!u.current)return;const M=u.current.editor;return M&&M.getDomNode()?.focus()}}),[]),I=l.useMemo(()=>[new ne("help",q,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),$=l.useMemo(()=>{let M=null;const H=()=>q;return M=r?r.createChildGroup(H,"scriptEditor",!1):new nn(H,"scriptEditor"),M.addCommands(I,!0),M},[r,I]),D=zr($,["executeSelectedScript"])[0],v=D?.context(),F=X(M=>{D?.execute(M)},[D]),E=l.useRef(""),[S,k]=l.useState(!1),N=X(async()=>{if(!u.current)return null;const M=u.current,H=M.editor;if(!H)return null;const oe=M.monaco,ue=await(async(te,K,le="export")=>{const Re=te.getModel();if(!Re)return null;const Te=await K.languages.typescript.getTypeScriptWorker(),ae=await Te(Re.uri),Fe=await ae.getNavigationTree(Re.uri.toString());let me=null,Oe=te.getSelection();const xe=Oe.startLineNumber===Oe.endLineNumber&&Oe.startColumn===Oe.endColumn?Re.getLineCount():Math.min(Oe.endLineNumber,Re.getLineCount());for(let ge=Oe.startLineNumber;!me&&ge<=xe;ge++){const fe=Kr(Fe,Re.getOffsetAt({lineNumber:ge,column:1}),"function",le);fe&&(me=fe.text)}return me})(H,oe);return f?.({message:(ue??"").toUpperCase()}),ue?{source:H.getValue(),name:ue}:null},[f]),R=X(async(M,H,oe)=>{const ue=await v.getScripts().createModule({source:oe?.getValue(),declarationsOnly:!0}),te=ue?ue.getFunctions().search():Ue.EmptyArray;ue&&(async function(K,le){const Re=[];for(let Te=1;Te<K.getLineCount()+1;Te++){const ae={startLineNumber:Te,startColumn:1,endLineNumber:Te,endColumn:K.getLineLength(Te)+1},Fe=K.getValueInRange(ae).indexOf("modelt");Fe!==-1&&Re.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:le.MarkerSeverity.Hint,startLineNumber:ae.startLineNumber,startColumn:Fe+1,endLineNumber:ae.startLineNumber,endColumn:Fe+5})}le.editor.setModelMarkers(K,"owner",Re)}(M,H),async function(K,le,Re,Te){const ae=await le.languages.typescript.getTypeScriptWorker(),Fe=await ae(K.uri),me=await Fe.getNavigationTree(K.uri.toString()),Oe=kr(K,le,Te,me).map(xe=>{let ge=null,fe=null;return xe.type==="formula"?(ge="formula.margin-icon",fe="Formula"):xe.type==="macro"?(ge="macro.margin-icon",fe="Macro"):xe.type==="autoRun"&&(ge="autorun.margin-icon",fe="Auto Run"),{range:new le.Range(xe.lineNumber,1,xe.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:ge,glyphMarginHoverMessage:fe,stickiness:le.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});j.current&&j.current.clear(),j.current=Re.createDecorationsCollection(Oe)}(M,H,oe,te))},[v]),T=X(Ue.debounce(R,580),[]),G=X(async(M=void 0)=>{if(!u.current||!v)return;const H=u.current.editor.getPosition(),oe={cursor:H?H.toString():""};M!==void 0&&(oe.message=M),f?.(oe);const ue=N();v.setSelectedFunction(ue)},[v,f]);l.useEffect(()=>{if(!v)return;const M={insertSnippet:oe=>{u.current?.editor&&(S?ul(u.current.editor,u.current.monaco,oe):E.current=oe)}};v.setEditor(M),v.setSelectedFunction(N());const H=v.addContainerListener({onBeforeSave:async()=>{if(!u.current?.editor||!v)return;const oe=u.current.editor,ue=v?.getScripts().getModules().getByName("scripting"),te=ue?.getSource(),K=oe.getValue();if(!((te?.length??0)!==K.length||te!==K))return;await v.saveSource(oe.getValue());const le=(te?.length??0)!==K.length||te!==K;f?.({dirty:le})},onReadonlyChange(){},onScriptChange:async()=>{if(!u.current?.editor||!v)return;const oe=u.current.editor,ue=v.getScripts().getModules().search()[0]?.getSource()??"";oe.setValue(ue)}});return()=>{H(),v.setSelectedFunction(null),v.setEditor(null)}},[v,S]),l.useEffect(()=>()=>{if(!u.current?.editor)return;const M=u.current.editor;v?.saveSource(M.getValue())},[]);const O=X(M=>{const H=u.current;if(!H)return!1;const oe=H.editor;return!!oe&&(oe.focus(),!0)},[]),j=l.useRef(null),z=X((M,H)=>{u.current={monaco:H,editor:M},k(!0),G("Loading Types");const oe=v.getScripts().getModules().search()[0]?.getSource()??"";M.setValue(oe),Promise.resolve().then(()=>require("./CX6l4lNPTiSB3HUX.cjs")).then(te=>te.customEditor).then(te=>{G(""),te.AutoTypings.create(M,{shareCache:!0,monaco:H,onError:K=>{K==="Not implemented yet"&&(K="Compile Errors"),console.warn("Error compiling types",K)}}).then(async K=>{const le=M.getModel();T(le,H,M)})}),M.addCommand("executeScript",function(te,...K){K?.[0]&&F({functionName:K?.[0]})},""),M.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async te=>{const K=N();v.setSelectedFunction(K);const le=await K;F(le)}}),M.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:te=>{v?.saveSource(M.getValue()).then(()=>{const K=v?.getScripts().getModules().getByName("scripting"),le=K?.getSource(),Re=M.getValue(),Te=(le?.length??0)!==Re.length||le!==Re;f?.({dirty:Te})})}}),M.onMouseDown(async te=>{if(te.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const K=te.target.position.lineNumber,le=await H.languages.typescript.getTypeScriptWorker(),Re=await le(ue.uri),Te=await Re.getNavigationTree(ue.uri.toString()),ae=M?.getValue(),Fe=(await v?.saveSource(ae)).getFunctions().search(),me=kr(ue,H,Fe,Te).find(Oe=>Oe.lineNumber===K);if(me){const Oe=te.event.browserEvent.button;Oe===0?me.type==="macro"||me.type==="autoRun"?F({functionName:me.name}):me.type==="formula"&&v.quickInsertFunction?.(me.name):Oe===2&&(console.log("Context menu for function:",me.name),te.event.browserEvent.preventDefault())}}}),M.onDidChangeModelContent(()=>{const te=M.getModel();T(te,H,M)});const ue=M.getModel();(function(te,K){K.languages.registerInlayHintsProvider("typescript",{provideInlayHints(le,Re,Te){const ae=[];for(let Fe=1;Fe<le.getLineCount()+1;Fe++){const me={startLineNumber:Fe,startColumn:1,endLineNumber:Fe,endColumn:le.getLineLength(Fe)+1},Oe="hint",xe=le.getValueInRange(me).indexOf("hint");xe!==-1&&ae.push({kind:K.languages.InlayHintKind.Type,position:{lineNumber:me.startLineNumber,column:xe+Oe.length+1},label:"[hint]"})}return{hints:ae,dispose:()=>{}}}})})(0,H),ue.onDidChangeContent(te=>{const K=v?.getScripts().getModules().getByName("scripting"),le=K?.getSource(),Re=M.getValue(),Te=(le?.length??0)!==Re.length||le!==Re;f?.({dirty:Te})}),M.onDidChangeCursorPosition(te=>{G()})},[v,f]),B=l.useMemo(()=>S?null:d||g.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[S,d]),Z=l.useMemo(()=>{const M=v?.getScripts().getModules().getByName("scripting")?.getSource()??"";return g.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[g.jsx(l.Suspense,{children:g.jsx(Yd,{theme:a?"extended-dark":"extended",options:{...Xd,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:M,onValidate:H=>{let oe=!1;for(let ue=0;!oe&&ue<H?.length;ue++)H[ue].severity===8&&(oe=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let oe=!1;try{const te=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),K=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),le=H.editor.createModel(te,"typescript",K);H.editor.setModelMarkers(le,"default",[]),oe=!0}catch(te){console.warn("cant load types",te)}H.languages.registerLinkProvider("*",{provideLinks:(te,K)=>{const le=[],Re={links:le},Te=te.getLinesContent();for(let ae=1;ae<=Te.length;ae++){const Fe=Te[ae-1],me=H.editor.tokenize(Fe,"typescript");for(let Oe=0;Oe<me[0].length;Oe++){const xe=me[0]?.[Oe];if(xe&&xe.type.startsWith("string")){let ge=xe.offset,fe=me[0]?.[Oe+1]?.offset??Fe.length,Se=new H.Range(ae,ge+1,ae,fe+1),pe=te.getValueInRange(Se);const Ce=pe[0];Ce!=="`"&&Ce!=="'"&&Ce!=='"'||(ge++,pe=pe.substring(1));const Ae=pe[pe.length-1];Ae!=="`"&&Ae!=="'"&&Ae!=='"'||(ge++,pe=pe.substring(0,pe.length-1));try{v.getRanges(pe)&&le.push({range:{endColumn:fe,endLineNumber:ae,startColumn:ge,startLineNumber:ae},tooltip:`Goto range '${pe}'`,url:`/range/${pe}`})}catch(ye){console.warn(ye)}}}}return Re}}),H.editor.registerLinkOpener({open(te){if(te?.path?.startsWith("/range/")){try{v.getRanges(te.path.substring(7))?.select()}catch(K){console.warn("invalid range",K)}return!0}return!1}});const ue=H.languages.typescript.typescriptDefaults.getCompilerOptions();H.languages.typescript.typescriptDefaults.setCompilerOptions({...ue,target:H.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:H.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),E.current&&(await ul(u.current.editor,u.current.monaco,E.current),E.current=null),b.current&&requestAnimationFrame(async()=>{b.current&&H.editor.focus()}),H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),k(!0)})()},onMount:z})}),B]})},[v,$,i,B,a]),P=Ft(e,()=>({isScriptEditorElement:()=>!0,focus:M=>{O(M)},close:()=>{w?.()},getEditor:()=>v?.getEditor()}),[v]);return l.useEffect(()=>(c&&requestAnimationFrame(()=>{O()}),()=>{u.current?.editor&&requestAnimationFrame(()=>{P.current?.contains(document.activeElement)&&O()})}),[]),g.jsx("div",{className:kt("script-editor",Zd,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:P,...h,children:Z})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>p.LicenseManager}),exports.ChartAreaIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),g.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),g.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),g.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),g.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),g.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),g.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),g.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),g.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),g.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),g.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),g.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),g.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),g.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),g.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),g.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),g.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),g.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),g.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),g.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),g.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),g.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),g.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),g.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),g.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),g.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),g.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),g.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),g.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),g.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),g.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),g.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=Lc,exports.ChartLineIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),g.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),g.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),g.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),g.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),g.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),g.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),g.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),g.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),g.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),g.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),g.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),g.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),g.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),g.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),g.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),g.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),g.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),g.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),g.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),g.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),g.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),g.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),g.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=t=>g.jsxs("svg",{viewBox:"0,0,2048,2048",...t,children:[g.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),g.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),g.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),g.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.Command=ne,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandContext=Ac,exports.CommandGroup=nn,exports.CornerTriangle=Sr,exports.DateUtils=$a,exports.DefaultNotifier=xo,exports.DocThemesContext=dr,exports.DocThemesProvider=t=>{const{themes:e,children:n}=t;return g.jsx(dr.Provider,{value:e,children:n})},exports.EditableLabel=is,exports.EmptyFrame=Rc,exports.FilterButton=Hl,exports.FocusKeyNavigation=_a,exports.FontUtils=Ua,exports.HorizontalAlignment=Rl,exports.Item=Gr,exports.KeyCodes=St,exports.KeyModifiers=Q,exports.LogoNoPaddingIcon=t=>g.jsxs("svg",{...t,viewBox:"0 0 48 48",children:[g.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),g.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),g.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),g.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=Yl,exports.MouseButtonCodes=_r,exports.MovableArea=Ql,exports.NotificationType=bn,exports.PictureEditor=rs,exports.ReactUtils=Qe,exports.RoundedTab=Ia,exports.Row=As,exports.ScriptEditor=eu,exports.ScrollPane=Ar,exports.ScrollUtils=pr,exports.Scrollbar=Io,exports.ScrollbarOrientation=wt,exports.SheetCellEditor=Ul,exports.SheetCellRenderer=$l,exports.SheetElement=os,exports.SheetScrollbar=Pr,exports.SimpleCommand=Ne,exports.SplitPane=Da,exports.SplitPaneResizer=jl,exports.StaticBorderRenderer=tc,exports.StyledStrokePath=Gl,exports.Tab=Ds,exports.TabStrip=Ls,exports.ToolTipPlacement=hn,exports.VirtualScrollbar=Lr,exports.createCellEditStateFromCell=Wl,exports.defaultCreateScrollCorner=Ll,exports.defaultCreateScrollEdgeButton=Ml,exports.defaultCreateScrollEndButton=Fr,exports.defaultCreateScrollStartButton=Ir,exports.defaultCreateScrollbar=yr,exports.getDevicePixelRatio=function(t){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:n=3,round:o=!0}=t||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,o?Math.floor(r):r),n)},exports.getPortalContainer=zl,exports.toShortcutString=gn,exports.useBordersOverlay=Nr,exports.useCallbackRef=X,exports.useCommand=function(t,e=null){const n=l.useRef(e);n.current=e;const[o,r]=l.useReducer(s=>s+1,0),i=l.useMemo(()=>Array.isArray(t)?t:[t],[t]);return l.useEffect(()=>{if(!i||i.length===0)return;const s=(c,f)=>{n.current?.onChange?.(f),r()};let a=null;e&&(a={onExecute(c,f){n.current?.onExecute?.(c,f)},onError(c,f,h){n.current?.onError?.(c,f,h)}});const d=new Set;for(let c=0;c<i.length;c++)d.add(i[c]?.addPropertyListener(Ue.debounce(s,0),!0)),e&&d.add(i[c]?.addExecuteListener(a));return()=>{d.forEach(c=>{c?.()})}},[t]),o},exports.useCommands=zr,exports.useCopyPaste=jr,exports.useDevicePixelRatio=function(t){const[e,n]=l.useState(typeof window<"u"?window.devicePixelRatio:1),o=l.useRef(null);return l.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),n(window.devicePixelRatio),o.current={mediaMatcher:i,listener:r}};return r(),()=>{o.current&&o.current.mediaMatcher.removeEventListener("change",o.current.listener)}},[t]),e},exports.useDocThemes=()=>{const t=l.useContext(dr),[e]=l.useState(()=>new p.ThemeCollection);return l.useMemo(()=>t||e,[t])},exports.useEditMode=Gt,exports.useFullscreenPortal=Ol,exports.useGlobalClipboard=Or,exports.useId=Va,exports.useImperativeElement=Ft,exports.useModelListener=it,exports.useMouseDownAndHoldListener=function(t,e){return Si({onPointerDown:t,onPointerMoveOrWait:(n,o,r)=>{t?.(r)},...e})},exports.useMovableCommands=es,exports.useOnClickOrFocusAway=function(t,e,n){const o=X(e,[e]);l.useEffect(()=>{const r=i=>{t.current&&!t.current.contains(i.target)&&o(i)};return n&&n.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),n&&n.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[t])},exports.useRangeListener=(t,e,n,o)=>{const r=l.useRef(n);r.current=n;const i=o?.fireOnAddressChange??!0;l.useEffect(()=>{if(!t||!e||!r.current){const d={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void r.current?.(d)}const s=d=>{r.current?.(d)},a=t.getRange(e).addListener(s,o);if(i){const d=t.getRange(e);s({getSource:()=>d,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{a?.()}},[t,e])},exports.useSheetCommands=Xl,exports.useSheetCopyPaste=Jl,exports.useSynchronizedPointerHandler=Si,exports.useTraceUpdate=function(t,e=!0){const n=l.useRef(t);l.useEffect(()=>{if(e){const o=Object.entries(t).reduce((r,[i,s])=>(n.current[i]!==s&&(r[i]=[n.current[i],s]),r),{});Object.keys(o).length>0&&console.log("Changed props:",o)}n.current=t})},exports.useUndoManager=({manager:t,commands:e,disabled:n,notifier:o=xo})=>{const r=X(s=>{try{t?.undo(s)}catch(a){o.showError?.(a)}},[t]),i=X(s=>{try{t?.redo(s)}catch(a){o.showError?.(a)}},[t]);return l.useMemo(()=>{if(!e)return;const s={contains:d=>!0,focus(){}},a=[new ne("undo",s,{label:"Undo",description:Ri,shortcut:{key:"z",modifiers:[Q.Ctrl]},disabled:!0},r),new ne("redo",s,{label:"Redo",description:Ei,shortcut:[{key:"y",modifiers:[Q.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[Q.Alt]}],disabled:!0},i)];e?.addCommands(a,!0)},[e]),l.useEffect(()=>{if(!e)return;const s=()=>{const d=t?.getTopUndoDescription(),c={};var f;e.getCommand("undo").update({disabled:n||!t||!t.hasUndo(),description:d?(f=d,`Undo ${f}`):Ri,state:c,context:{undoManager:t}});const h=t?.getTopRedoDescription();e.getCommand("redo").update({disabled:n||!t||!t.hasRedo(),description:h?Ha(h):Ei,state:c,context:{undoManager:t}})};if(s(),!t)return;const a=t.addListener({onStackChange(){s()}});return()=>a?.()},[t,e,n]),{undo:r,redo:i}};
|
|
33
|
+
`,f=!0));const T=[{range:new t.Range(p.lineNumber,p.column,p.lineNumber,p.column),text:`${x}`}];let q=null;i.pushEditOperations([],T,A=>(q=A[0].range,h&&q.startLineNumber++,f&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function xa(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function fo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:xa(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)fo(e,t,n,l,a);return a}function Ro(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const p=Ro(m,t,n,i);if(p)return p}}return null}}function qa(e){return e.kind==="comment"}const Sa=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:p,autoFocus:g=!0,onStatusChange:x,...h}=e,f=o.useRef(null),T=r.useCallbackRef(d,[d]),q=o.useRef(!1),A=o.useMemo(()=>({contains(K){if(!f.current)return;const W=f.current.editor;return W&&W.getDomNode()?.contains(K)},focus(){if(!f.current)return;const K=f.current.editor;return K&&K.getDomNode()?.focus()}}),[]),D=o.useMemo(()=>[new r.Command("help",A,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),G=o.useMemo(()=>{let K=null;const W=()=>A;return K=a?a.createChildGroup(W,"scriptEditor",!1):new r.CommandGroup(W,"scriptEditor"),K.addCommands(D,!0),K},[a,D]),U=r.useCommands(G,["executeSelectedScript"])[0],y=U?.context(),B=r.useCallbackRef(K=>{U?.execute(K)},[U]),S=o.useRef(""),[w,k]=o.useState(!1),O=r.useCallbackRef(async()=>{if(!f.current)return null;const K=f.current,W=K.editor;if(!W)return null;const Ce=K.monaco,ae=await(async(Q,ee,we="export")=>{const ke=Q.getModel();if(!ke)return null;const ve=await ee.languages.typescript.getTypeScriptWorker(),Pe=await ve(ke.uri),ge=await Pe.getNavigationTree(ke.uri.toString());let He=null,Se=Q.getSelection();const ce=Se.startLineNumber===Se.endLineNumber&&Se.startColumn===Se.endColumn?ke.getLineCount():Math.min(Se.endLineNumber,ke.getLineCount());for(let de=Se.startLineNumber;!He&&de<=ce;de++){const he=Ro(ge,ke.getOffsetAt({lineNumber:de,column:1}),"function",we);he&&(He=he.text)}return He})(W,Ce);return x?.({message:(ae??"").toUpperCase()}),ae?{source:W.getValue(),name:ae}:null},[x]),E=r.useCallbackRef(async(K,W,Ce)=>{const ae=await y.getScripts().createModule({source:Ce?.getValue(),declarationsOnly:!0}),Q=ae?ae.getFunctions().search():ue.CommonUtils.EmptyArray;ae&&(async function(ee,we){const ke=[];for(let ve=1;ve<ee.getLineCount()+1;ve++){const Pe={startLineNumber:ve,startColumn:1,endLineNumber:ve,endColumn:ee.getLineLength(ve)+1},ge=ee.getValueInRange(Pe).indexOf("modelt");ge!==-1&&ke.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:we.MarkerSeverity.Hint,startLineNumber:Pe.startLineNumber,startColumn:ge+1,endLineNumber:Pe.startLineNumber,endColumn:ge+5})}we.editor.setModelMarkers(ee,"owner",ke)}(K,W),async function(ee,we,ke,ve){const Pe=await we.languages.typescript.getTypeScriptWorker(),ge=await Pe(ee.uri),He=await ge.getNavigationTree(ee.uri.toString()),Se=fo(ee,we,ve,He).map(ce=>{let de=null,he=null;return ce.type==="formula"?(de="formula.margin-icon",he="Formula"):ce.type==="macro"?(de="macro.margin-icon",he="Macro"):ce.type==="autoRun"&&(de="autorun.margin-icon",he="Auto Run"),{range:new we.Range(ce.lineNumber,1,ce.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:de,glyphMarginHoverMessage:{value:he},stickiness:we.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});V.current&&V.current.clear(),V.current=ke.createDecorationsCollection(Se)}(K,W,Ce,Q))},[y]),F=r.useCallbackRef(ue.CommonUtils.debounce(E,580),[]),Z=r.useCallbackRef(async(K=void 0)=>{if(!f.current||!y)return;const W=f.current.editor.getPosition(),Ce={cursor:W?W.toString():""};K!==void 0&&(Ce.message=K),x?.(Ce);const ae=O();y.setSelectedFunction(ae)},[y,x]),_=o.useRef(null);o.useEffect(()=>{if(!y)return;const K={insertSnippet:Ce=>{f.current?.editor&&(w?gr(f.current.editor,f.current.monaco,Ce):S.current=Ce)}};y.setEditor(K),y.setSelectedFunction(O());const W=y.addContainerListener({onBeforeSave:async()=>{if(!f.current?.editor||!y)return;const Ce=f.current.editor,ae=y?.getScripts().getModules().getByName("scripting"),Q=ae?.getSource(),ee=Ce.getValue();if(!((Q?.length??0)!==ee.length||Q!==ee))return;await y.saveSource(Ce.getValue());const we=(Q?.length??0)!==ee.length||Q!==ee;x?.({dirty:we})},onReadonlyChange(){},onScriptChange:async()=>{if(!f.current?.editor||!y)return;const Ce=f.current.editor,ae=y.getScripts().getModules().search()[0]?.getSource()??"";Ce.setValue(ae)}});return()=>{W(),y.setSelectedFunction(null),y.setEditor(null);const Ce=_.current;if(Ce){Ce.dispose();const ae=Ce.debounceTimer;ae!==void 0&&clearTimeout(ae),_.current=null}}},[y,w]),o.useEffect(()=>()=>{if(!f.current?.editor)return;const K=f.current.editor;y?.saveSource(K.getValue())},[]);const P=r.useCallbackRef(K=>{const W=f.current;if(!W)return!1;const Ce=W.editor;return!!Ce&&(Ce.focus(),!0)},[]),V=o.useRef(null),$=r.useCallbackRef((K,W)=>{f.current={monaco:W,editor:K},k(!0),Z("Loading Types");const Ce=y.getScripts().getModules().search()[0]?.getSource()??"";K.setValue(Ce),Promise.resolve().then(()=>require("./4HUry3XT7-cfmesD.cjs")).then(Q=>Q.customEditor).then(Q=>{Z(""),Q.AutoTypings.create(K,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:W,onUpdate:(ee,we)=>{if(ee.type==="LookedUpPackage"&&ee.success!==void 0){const ke=W.languages.typescript.typescriptDefaults.getDiagnosticsOptions();W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ke,diagnosticCodesToIgnore:[]})}},onError:ee=>{ee==="Not implemented yet"&&(ee="Compile Errors"),console.warn("Error compiling types",ee)}}).then(ee=>{_.current=ee;const we=K.getModel();F(we,W,K)})}),K.addCommand("executeScript",function(Q,...ee){ee?.[0]&&B({functionName:ee?.[0]})},""),K.addAction({id:"executeScript",label:"Execute",keybindings:[W.KeyCode.F8],run:async Q=>{const ee=O();y.setSelectedFunction(ee);const we=await ee;B(we)}}),K.addAction({id:"saveScript",label:"Save Script",keybindings:[W.KeyMod.CtrlCmd|W.KeyCode.KeyS],run:Q=>{y?.saveSource(K.getValue()).then(()=>{const ee=y?.getScripts().getModules().getByName("scripting"),we=ee?.getSource(),ke=K.getValue(),ve=(we?.length??0)!==ke.length||we!==ke;x?.({dirty:ve})})}}),K.onMouseDown(async Q=>{if(Q.target.type===W.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const ee=Q.target.position.lineNumber,we=await W.languages.typescript.getTypeScriptWorker(),ke=await we(ae.uri),ve=await ke.getNavigationTree(ae.uri.toString()),Pe=K?.getValue(),ge=(await y?.saveSource(Pe)).getFunctions().search(),He=fo(ae,W,ge,ve).find(Se=>Se.lineNumber===ee);if(He){const Se=Q.event.browserEvent.button;Se===0?He.type==="macro"||He.type==="autoRun"?B({functionName:He.name}):He.type==="formula"&&y.quickInsertFunction?.(He.name):Se===2&&(console.log("Context menu for function:",He.name),Q.event.browserEvent.preventDefault())}}}),K.onDidChangeModelContent(()=>{F(ae,W,K)}),W.editor.onDidChangeMarkers(Q=>{Q.some(ee=>ee.toString()===ae.uri.toString())});const ae=K.getModel();(function(Q,ee){ee.languages.registerInlayHintsProvider("typescript",{provideInlayHints(we,ke,ve){const Pe=[];for(let ge=1;ge<we.getLineCount()+1;ge++){const He={startLineNumber:ge,startColumn:1,endLineNumber:ge,endColumn:we.getLineLength(ge)+1},Se="hint",ce=we.getValueInRange(He).indexOf("hint");ce!==-1&&Pe.push({kind:ee.languages.InlayHintKind.Type,position:{lineNumber:He.startLineNumber,column:ce+Se.length+1},label:"[hint]"})}return{hints:Pe,dispose:()=>{}}}})})(0,W),ae.onDidChangeContent(Q=>{const ee=y?.getScripts().getModules().getByName("scripting"),we=ee?.getSource(),ke=K.getValue(),ve=(we?.length??0)!==ke.length||we!==ke;x?.({dirty:ve})}),K.onDidChangeCursorPosition(Q=>{Z()})},[y,x]),oe=o.useMemo(()=>w?null:p||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[w,p]),L=o.useMemo(()=>{const K=y?.getScripts().getModules().getByName("scripting")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(ya,{theme:m?"extended-dark":"extended",options:{...wa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:K,onValidate:W=>{let Ce=!1;for(let ae=0;!Ce&&ae<W?.length;ae++)W[ae].severity===8&&(Ce=!0)},beforeMount:W=>{W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),W.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),W.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),W.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Ce=!1,ae=!1;try{const Q=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),ee=W.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let we=W.editor.getModel(ee);we?ae=!0:we=W.editor.createModel(Q,"typescript",ee),W.editor.setModelMarkers(we,"default",[]),Ce=!0}catch(Q){console.warn("cant load types",Q)}if(!ae){W.languages.registerLinkProvider("*",{provideLinks:(ee,we)=>{const ke=[],ve={links:ke},Pe=ee.getLinesContent();for(let ge=1;ge<=Pe.length;ge++){const He=Pe[ge-1],Se=W.editor.tokenize(He,"typescript");for(let ce=0;ce<Se[0].length;ce++){const de=Se[0]?.[ce];if(de&&de.type.startsWith("string")){let he=de.offset,pe=Se[0]?.[ce+1]?.offset??He.length,xe=new W.Range(ge,he+1,ge,pe+1),Me=ee.getValueInRange(xe);const be=Me[0];be!=="`"&&be!=="'"&&be!=='"'||(he++,Me=Me.substring(1));const Ee=Me[Me.length-1];Ee!=="`"&&Ee!=="'"&&Ee!=='"'||(he++,Me=Me.substring(0,Me.length-1));try{y.getRanges(Me)&&ke.push({range:{endColumn:pe,endLineNumber:ge,startColumn:he,startLineNumber:ge},tooltip:`Goto range '${Me}'`,url:`/range/${Me}`})}catch(Le){console.warn(Le)}}}}return ve}}),W.editor.registerLinkOpener({open(ee){if(ee?.path?.startsWith("/range/")){try{y.getRanges(ee.path.substring(7))?.select()}catch(we){console.warn("invalid range",we)}return!0}return!1}});const Q=W.languages.typescript.typescriptDefaults.getCompilerOptions();W.languages.typescript.typescriptDefaults.setCompilerOptions({...Q,target:W.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:W.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}S.current&&(await gr(f.current.editor,f.current.monaco,S.current),S.current=null),q.current&&requestAnimationFrame(async()=>{q.current&&W.editor.focus()}),k(!0)})()},onMount:$})}),oe]})},[y,G,l,oe,m]),z=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:K=>{P(K)},close:()=>{T?.()},getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(g&&requestAnimationFrame(()=>{P()}),()=>{f.current?.editor&&requestAnimationFrame(()=>{z.current?.contains(document.activeElement)&&P()})}),[]),c.jsx("div",{className:bt("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:z,...h,children:L})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>s.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),c.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=li,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),c.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),c.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),c.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),c.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),c.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),c.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),c.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),c.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),c.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),c.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),c.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),c.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),c.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),c.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),c.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),c.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=ri,exports.CornerTriangle=so,exports.DateUtils=ml,exports.DocThemesContext=io,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(io.Provider,{value:t,children:n})},exports.EditableLabel=Er,exports.EmptyFrame=Zl,exports.FilterButton=mr,exports.FontUtils=fl,exports.Item=So,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),c.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),c.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),c.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=wr,exports.MovableArea=Sr,exports.PictureEditor=Ir,exports.Row=ll,exports.ScriptEditor=Sa,exports.SheetCellEditor=pr,exports.SheetCellRenderer=fr,exports.SheetElement=Tr,exports.SheetScrollbar=vo,exports.StaticBorderRenderer=Rl,exports.StyledStrokePath=Cr,exports.Tab=rl,exports.TabStrip=il,exports.createCellEditStateFromCell=vr,exports.useBordersOverlay=po,exports.useDocThemes=()=>{const e=o.useContext(io),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Rr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const p={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(p)}const d=p=>{a.current?.(p)},m=e.getRange(t).addListener(d,i);if(l){const p=e.getRange(t);d({getSource:()=>p,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=xr,exports.useSheetCopyPaste=qr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|