@sheetxl/react 0.7.13 → 0.7.14
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/{TNrN4vNyBjTeRdp1.cjs → BB3MqE6MmDe-ge2D.cjs} +1 -1
- package/browser/cjs/{D9khCXyDa4HlwQoc.cjs → BT91Yv7BVJbUjPkz.cjs} +1 -1
- package/browser/cjs/{Cb0U7vCZ2BhwUSZb.cjs → CVIHFd-SYF31eyeF.cjs} +1 -1
- package/browser/cjs/index.cjs +14 -14
- package/browser/esm/{DrTz2HzbKgrjxe3q.mjs → -HOHXjsBY9659ZW0.mjs} +1 -1
- package/browser/esm/{DTHyH2X-dSH_qVPt.mjs → BfSiVxlUgQSbarku.mjs} +1 -1
- package/browser/esm/{GjHde_cgb_6eBgyZ.mjs → CLF8ImQujJdTB7pl.mjs} +1 -1
- package/browser/esm/index.mjs +2483 -2491
- package/node/esm/{D96A0N9E9hY-6V5B.mjs → DKLIXbtzq6HxItZV.mjs} +1 -1
- package/node/esm/index.mjs +1462 -1471
- package/package.json +5 -5
- package/types/index.d.ts +0 -31
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,33 +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%}}._TaskPaneArea_6dmgk_5{position:absolute;height:100%;width:100%;display:flex;flex-direction:row}._TaskPaneTitle_6dmgk_13{display:flex;box-sizing:border-box;flex:1 1 0;flex-direction:row;align-items:center;font-size:1.25rem;height:100%;width:100%;padding:8px 16px;border-bottom:solid rgba(0,0,0,.2) 1px}._TaskPaneTitle_6dmgk_13 .title{opacity:.87}._TaskPaneTitle_6dmgk_13.focused .title{opacity:1}._TaskPaneFrame_6dmgk_36{display:flex;position:relative;flex-direction:column;width:100%;box-sizing:border-box;flex:1 1 0;min-height:0;align-items:stretch;justify-content:stretch;margin-bottom:4px;border-radius:4px;overflow:hidden}._TaskPaneStrip_6dmgk_52{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:2px}._TaskPaneStripItem_6dmgk_60{display:flex;flex-direction:row;align-items:center;padding:4px;border-radius:4px;border:grey solid 1px}._TaskPaneStripItem_6dmgk_60.selected{font-weight:700}._sheet-scrollbar_104cg_1{margin-left:2px;margin-bottom:1px;align-items:center}._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.7.
|
|
3
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.7.14
|
|
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 d=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),he=require("@sheetxl/utils"),o=require("react"),ut=require("@sheetxl/grid-react"),Ht=require("react-dom"),mn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),El=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:mn},Symbol.toStringTag,{value:"Module"})),Rr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),po=(e,t=!0,n=Rr)=>{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 l=he.CommonUtils.findEqualOrGreater(n,e);return t?(n[l]===e&&(l+=1),n[l]||(l-=1),n[l]):(l-=1,n[l])},Fl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Rr,findNextFontSize:po},Symbol.toStringTag,{value:"Module"})),vo=o.memo(e=>{const{anchorLocation:t=he.AnchorLocation.TopLeft,cellWidth:n,cellHeight:l,size:a=7,inset:i=1,darkMode:f,fill:m,pathProps:s,style:v,...b}=e,y=a,g=i;let k="red",x=[],E=[];return t===he.AnchorLocation.TopLeft?(k=f?"rgb(255, 198, 246)":"green",x.push(g),E.push(g),x.push(g+y),E.push(g),x.push(g),E.push(g+y)):t===he.AnchorLocation.TopRight?(k=f?"rgb(0, 255, 255)":"red",x.push(n-g),E.push(g),x.push(n-(g+y)),E.push(g),x.push(n-g),E.push(g+y)):t===he.AnchorLocation.BottomRight?(k=f?"rgb(236, 252, 211)":"purple",x.push(n-g),E.push(l-g),x.push(n-(g+y)),E.push(l-g),x.push(n-g),E.push(l-(g+y))):t===he.AnchorLocation.BottomLeft&&(k=f?"rgb(255, 236, 183)":"blue",x.push(g),E.push(l-g),x.push(g+y),E.push(l-g),x.push(g),E.push(l-(g+y))),c.jsx("svg",{width:`${n}`,height:`${l}`,viewBox:`0 0 ${n} ${l}`,style:{position:"absolute",width:`${n}px`,height:`${l}px`,pointerEvents:"none",...v},...b,children:c.jsx("path",{d:`M ${x[0]} ${E[0]} L ${x[1]} ${E[1]} L ${x[2]} ${E[2]} L ${x[0]} ${E[0]} Z`,fill:m??k,...s})})}),kr=e=>{const{renderBounds:t,darkMode:n,zoom:l,disabled:a,filter:i,onFilterButtonMouseDown:f,style:m,...s}=e,v=o.useMemo(()=>{let k=null;const x=i.getSortField();x&&(k=x.reverse);const E=i.getField(),z=E&&E.criteria&&E.criteria.length>0;return k===!0?z?"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":k===!1?z?"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":z?"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 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[i]),[b,y]=o.useState(!1),g=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${g}px`,height:`${g}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${b&&!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:(g>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:k=>{f?.(k,i),k.preventDefault()},...s,children:c.jsx("svg",{width:""+15*l,height:""+15*l,viewBox:"0 0 15 15",style:{fill:`var(${b&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:v})})})},Mr=e=>{const{value:t,coords:n,bounds:l,children:a,style:i,range:f,zoom:m=1,view:s,bodyStyle:v,normalStyle:b,showFormulas:y,showZeros:g,docTheme:k,onLinkMouseDown:x,onFilterButtonMouseDown:E,filterButtonProps:z,createFilterButton:$=kr,...V}=e,R=l.height/m,P=l.width/m,p=t,F=p.getValue(),M=t.getStyle(),H=v?.darkMode??!1;let N,B;const W=F&&F.isFormulaError,ce=W&&F instanceof d.FormulaError.Parse;let G,K=y||ce;if(K)if(p.isSpillOverflow())B="";else{const Fe=p.getFormulaText();Fe?B=Fe:N=p.getNumberFormat(d.NumberFormat.Type.General)}else N=p.getNumberFormat();K||(G=p.getTextOverflow());const L=G?G.colBounds.width+G.leftOffset+G.rightOffset:P,I=G?G.anchorBounds.x-G.leftOffset:0,q=G?G.anchorBounds.width:P,O=G?G.anchorBounds.x:0;let Q,re=p.getRenderHorizontalAlignment();N&&(Q=N?.formattedRuns,B=Q?.runs[0]?.text??N.displayText);const be=p.getCalcStatus()===d.ICell.CalcStatus.Pending;let me=null,ze=M.getFill().toCSS(H,l),Pe=0,ve=0;if(!M.getBorder().isEmpty()){const Fe=M.getBorder().getRight();!Fe.isNone()&&d.IBorder.BuiltInDefinitions.get(Fe.getStyle()).width>1&&(Pe=1);const A=M.getBorder().getBottom();!A.isNone()&&d.IBorder.BuiltInDefinitions.get(A.getStyle()).width>1&&(ve=1)}let Re=null;if(P!==q||Pe||ve||typeof ze?.backgroundPosition=="number"){const{backgroundPosition:Fe,...A}=ze,J=Fe??0,j=s?.getScrollTopLeft(),_=J?-(l.x+(j.left??0))%J:0,qe=J?-(l.y+(j.top??0))%J:0;(Fe!==void 0||Pe||ve||P!==q)&&(Object.keys(A).length===1&&A.background==="none"||(ze=null,Re=c.jsx("div",{className:"fill",style:{marginLeft:`${_}px`,marginTop:`${qe}px`,left:O*m,width:r.ReactUtils.boundPixel(q*m-_+1+Pe),height:r.ReactUtils.boundPixel(l.height-qe+1+ve),...A}},"background")))}let Ke=null;const Y=p.getComments(),Z=p.getWarnings(),de=p.getErrors();if(Y||W||de.length>0||Z.length>0){const Fe={size:7*m,darkMode:H,cellWidth:q*m+2,cellHeight:R*m+2,style:{top:-1,left:O*m-1}};Ke=Ke??[],(Z.length>0||de.length>0||W)&&Ke.push(c.jsx(vo,{anchorLocation:he.AnchorLocation.TopLeft,...Fe},`indicator-${Ke.length}`)),Y&&Ke.push(c.jsx(vo,{anchorLocation:he.AnchorLocation.TopRight,...Fe},`indicator-${Ke.length}`))}const Ie=M.getFont();let we=N?.conditionalColor;const U=M.getAlignment(),ee=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ge=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||ee,le=ge||K?0:U.getRotation(),Ee=p.getInsets(),ie=Ee.top+Ee.bottom;let pe=Ee.left,De=Ee.right;const xe={...i,left:i.left-1,top:i.top-1,width:i.width+1+Pe,height:i.height+1+ve},Be=p.getColumnFilter(),He=Be&&!Be?.hasHiddenButton();let C=null;be&&(C=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const je=!(be||He||Re||a||Ke||Q?.runs.length>1||G||le%360!=0);ze?.background==="none"&&(ze=null);let nt=ge||!(!G||!(G.rightIndex>0||G.leftIndex>0||G.colSpan>1));if(!nt){const Fe=p.getSpans();(Fe.width>1||Fe.height>1)&&(nt=!0)}const te={...ze,...xe,pointerEvents:x?"auto":void 0};if(!he.CommonUtils.isEmpty(B)||!he.CommonUtils.isEmpty(N?.repeatPlaceholder)){const Fe=N?.canWrap??!1;let A=null,J=null,j=null,_=[],qe=!0;g||K||F!==0||(qe=!1);const ye=p.getTextFrame(K);if(qe&&ye){let h=L-1-(pe+De);if(le){A=ye.layout().bounds;const ae={x:0,y:0,width:L-1,height:R};if(Q){let ue=Q.width;if(N.repeatPlaceholder||N.repeatChars.length>0){const Ce=d.GeomUtils.boundsToPoints(ae),Oe=d.GeomUtils.rotatePoints(Ce,-le);ue=d.GeomUtils.minBoundingRect(Oe).width}A={...A,width:ue}}j=d.GeomUtils.clipToOuterRect({...A,width:A.width+1+pe+De},ae,le),h=j.width-1-(pe+De)+.01}let w=null;Fe&&(w={width:h});let T=null,u=N?.repeatPlaceholder;const S=ye.layout(w);if(A=S.bounds,K?A={...A,width:0}:Q&&(A={...A,width:N.repeatPlaceholder||N.repeatChars.length>0?h:Q.width}),le&&Fe){let ne=null;S.visitLines({visitTextLine:(ae,ue)=>{let Ce=ae.bounds;const Oe=d.GeomUtils.boundsToPoints(Ce),Me=d.GeomUtils.rotatePoints(Oe,le),Te=d.GeomUtils.minBoundingRect(Me);Ce={...Ce,x:(Te.width-Ce.width)/2,y:(Te.height-Ce.height)/2},ne=ne?d.GeomUtils.unionBounds(ne,Ce):Ce}}),A={...ne,width:ne.width+pe+De}}if(!u&&p.getType()!==d.ScalarType.String&&Math.floor(A.width)>h){if(M.getNumberFormat()==="General"&&p.getType()===d.ScalarType.Number){const ne=M.measureText("0"),ae=Math.floor(h/ne.width),ue=F,Ce=he.CommonUtils.splitNumber(ue),Oe=Math.min(10,ae-(Math.max(1,Ce.ipLength)+1)-(ue<0?1:0));if(Oe>=-1){const Me=`0${Oe>0?".":""}${"#".repeat(Math.max(0,Oe))}`;T=p.getNumberFormat(Me).displayText,T==="0"&&ue<0&&(T="-0")}else if(Math.abs(ue)>=Math.pow(10,5)||Math.abs(ue)<=Math.pow(10,-5)){const Me=ae-5-(ue<0?1:0);if(Me>=0){const Te=`0.${"0".repeat(Math.max(0,Me-1))}E+00`;T=p.getNumberFormat(Te).displayText}}}T||(u="#")}if(!u&&Q?.lastRepeatIndex>=0&&Q?.width>h&&(u="#"),u&&h>0){const ne=M.measureText(u),ae=Math.floor((h||1)/(ne?.width||1));T=ae>0?u.repeat(ae):"",re=d.ITextFrame.HorizontalAlignment.Center}if(K&&(re=d.ITextFrame.HorizontalAlignment.Left),T){const ne=M.measureText(T).width;ne&&(A={...A,width:ne})}if(J={...A,width:A.width+pe+De,height:A.height},le&&!Fe){const ne=d.GeomUtils.boundsToPoints(J),ae=d.GeomUtils.rotatePoints(ne,le),ue=d.GeomUtils.minBoundingRect(ae);J.width=ue.width,J.height=ue.height}re===d.ITextFrame.HorizontalAlignment.Center||re===d.ITextFrame.HorizontalAlignment.CenterContinuous?J.x=(L-J.width)/2:re===d.ITextFrame.HorizontalAlignment.Right?J.x=L-J.width-.5:J.x=.5,U.getVertical()===d.ITextFrame.VerticalAlignment.Center?J.y=(R-J.height)/2:U.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?J.y=R-J.height-ie:J.y=ie;const D=je?{...V}:void 0,oe={style:{left:i.left-1,top:i.top-1,width:i.width+1,height:i.height+1,transform:le?`rotate(${le}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:nt?1:void 0,...ze},onMouseDown:x,onDoubleClick:x?ne=>{ne.stopPropagation(),ne.preventDefault()}:null,...D};ce&&(oe.style.textDecorationStyle="wavy",oe.style.textDecorationColor=H?"rgb(0, 255, 255)":"red",oe.style.textDecorationLine="underline");const fe=Ie.getSize(),se=(ne,ae,ue,Ce,Oe,Me,Te,$e=null)=>{let We=fe*m,_e=ue,Ye=Te?.runs?Te.runs:[{type:d.NumberFormat.ParseRunType.Text,text:ne,width:M.measureText(ne,We).width}];Te&&Te?.width!==A.width&&(A={...A,width:Te?.width});let Je=pe;if(Te?.lastRepeatIndex>=0&&h>Te?.width){const it=Te.runs[Te.lastRepeatIndex];if(it){const at=[...Ye],kt=Math.max(0,h-1-Te.width);let qt=0,wt="";if(kt>0){const vt=Math.floor(kt/it.width);wt=vt>0?it.text.repeat(vt):"",qt=kt}at[Te.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:wt,width:qt},Ye=at,A={...A,width:Te.width+qt}}}const Ne=(it,at,kt,qt,wt,vt,Ze,St,ft,bt=null)=>{let Ft,At=_e.width;Oe===d.ITextFrame.HorizontalAlignment.Justify?(At=wt,Me||(Ft="justify")):Oe===d.ITextFrame.HorizontalAlignment.Distributed&&(At=wt,Ft=Me||it.text.split(" ").length-1==0?"center":"justify");const{style:Mt,className:Nt,...pt}=bt;let Kt=it.text;if(Oe===d.ITextFrame.HorizontalAlignment.Fill&&N?.repeatChars.length===0){const dt=Math.max(1,Math.floor((_e?.width??0)/(Ze?.width??1)));Kt=Kt.repeat(dt)}let nn=_e.height;const Dt=Ie.getVerticalAlignment(),jt=Dt===d.IFont.VerticalAlignment.Sub,bn=Dt===d.IFont.VerticalAlignment.Super;if(jt||bn){const dt=Ie.getSuperSubScale();We*=dt,nn*=dt}const ot={textAlign:Ft,textAlignLast:Ft,...Mt,...Ie.toCSS(H,m,!0),fontSize:We*d.IFont.getDeviceScale()};je||(ot.background=void 0),we&&(ot.color=we.toCSS(H));const xn=Je+at;let $t=Ee.top+_e.y+0;if(jt&&($t+=ft-We),vt){const dt=(Ze.x+xn)*m+1,Ct=(Ze.y+$t)*m+1;Ct<0?ot.marginTop=Ct:ot.paddingTop=Ct,dt<0?(ot.width=(Mt?.width??0)-dt,ot.left=(Mt?.left??0)+dt):ot.paddingLeft=dt,ot.paddingRight=Math.max(0,(Mt?.width??0)-At*m-dt),ot.paddingBottom=Math.max(0,(Mt?.height??0)-_e.height*m-Ct),ot.height=(Mt?.height??0)+(Ct<0?-Ct:0),(Ct<0||dt<0)&&(ot.clipPath=`inset(${Ct<0?-Ct:0}px 0px 0px ${dt<0?1-dt:0}px)`)}else if(ot.left=(Ze.x+xn)*m+1,ot.top=(Ze.y+$t)*m+1,ot.width=Ze.width*m,ot.height=Ze.height*m,le&&!Fe){ot.left=(Ze.x+at)*m+1,ot.top=(Ze.y+(_e.y+0))*m+1;const dt=d.GeomUtils.centerPoint({x:Je+at,y:0,width:it.width,height:_e.height}),Ct=d.GeomUtils.centerPoint({x:Je,y:0,width:wt,height:_e.height}),qn=d.GeomUtils.rotatePoints([dt],le,Ct),Sn={x:qn[0].x-dt.x,y:qn[0].y-dt.y};ot.left=ot.left+Sn.x*m,ot.top=ot.top+Sn.y*m;const Ot={..._e,x:Je,y:Ee.top,width:_e.width+(pe+De)},Rn=d.GeomUtils.boundsToPoints(Ot),Xn=d.GeomUtils.rotatePoints(Rn,le),kn=d.GeomUtils.minBoundingRect(Xn);Ot.width=kn.width,Ot.height=kn.height;const Mn=d.GeomUtils.centerPoint(Ot),Wt={x:Mn.x-Ct.x,y:Mn.y-Ct.y};ot.left=ot.left+Wt.x*m,ot.top=ot.top+Wt.y*m}ot.lineHeight=nn*m+"px";const on=je?void 0:"text-line";_.push(c.jsx("div",{className:Nt?`${Nt} ${on}`:on,style:ot,...pt,children:Kt},`text-${_e.y}-${qt}-${kt}`))};if(U.getOverflow()===d.ITextFrame.Overflow.Shrink&&h>0){let it=A?.width??0,at=0;for(;it>1&&it>h&&We>2&&at<100;)We*=h/it,it=M.measureText(ne,We).width,at++;A={...A,width:it}}let Qe=_e.x;Oe===d.ITextFrame.HorizontalAlignment.Right?Qe+=A.width-_e.width:Oe!==d.ITextFrame.HorizontalAlignment.Center&&Oe!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(Qe+=(A.width-_e.width)/2),Te?.lastRepeatIndex>=0&&(Qe=_e.x);const ht=Ye.length;for(let it=0;it<ht;it++){const at=Ye[it];(at.type===d.NumberFormat.ParseRunType.Text||at.type===d.NumberFormat.ParseRunType.Repeat)&&(at.type,d.NumberFormat.ParseRunType.Repeat,Ne(at,Qe,it,ae,Oe===d.ITextFrame.HorizontalAlignment.Justify||Oe===d.ITextFrame.HorizontalAlignment.Distributed||Te?.lastRepeatIndex>=0?h:_e.width,je,{x:J.x+I,y:J.y,width:at.width,height:A.height},0,Ce,$e)),Qe+=at.width}};T?se(T,0,{x:0,y:0,...A},S.lines[0].baseline,re,!0,null,oe):S.visitLines({visitTextLine:(ne,ae,ue)=>{const Ce=ne.runs[0].text.replace(/\s+$/,""),Oe=ae===ue-1;let Me=re===d.ITextFrame.HorizontalAlignment.Justify&&(Oe||ne.runs[0].text.endsWith(`
|
|
8
|
-
`))?d.ITextFrame.HorizontalAlignment.Left:re,Te=0;ae>0&&(U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||U.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Te=Math.max(0,(R-(ie+3)-ne.bounds.height*ue)/(ue-1)*ae)),U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&le&&le%90==0&&le%180!=0&&(Me=d.ITextFrame.HorizontalAlignment.Distributed),Me!==d.ITextFrame.HorizontalAlignment.Justify&&Me!==d.ITextFrame.HorizontalAlignment.Distributed&&Me!==d.ITextFrame.HorizontalAlignment.Fill||(A={...A,width:h});let
|
|
9
|
-
`+q.textValue.substring(ye.selectionEnd);return ze(w),void K({start:ye.selectionStart+1,end:ye.selectionStart+1,direction:ye.selectionDirection})}return void(Re()&&g.getSelection().traverse(d.IRange.Orientation.Column,j))}if(A.which===r.KeyCodes.Tab)return A.preventDefault(),void(Re()&&g.getSelection().traverse(d.IRange.Orientation.Row,j));let h=null;switch(A.which){case r.KeyCodes.Left:h=d.IRange.Direction.Left;break;case r.KeyCodes.Right:h=d.IRange.Direction.Right;break;case r.KeyCodes.Up:h=d.IRange.Direction.Up;break;case r.KeyCodes.Down:h=d.IRange.Direction.Down}if(h&&!(J||j||_||qe)&&!L.editMode)return void Re();L.editMode&&(h||Al.includes(A.which))&&A.stopPropagation()},[L,g,q]),Z=o.useCallback(()=>{O.current?.focus(),setTimeout(()=>{O.current?.select()},0)},[]),de=o.useCallback(()=>{O.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Ie=r.useCallbackRef(()=>{const A=O.current?.value;let J="";if(y.rowIndex>0){const j=g.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();j&&(J=j.toTextUnformatted(!0))}ze(A+J)},[y,g]);o.useEffect(()=>g.getRange(y).addListener(()=>{const A={...L,clean:()=>g.getRange(y).getCell()};I(A),me?.(A)}),[y,g,L]);const we=o.useCallback(()=>{const A=L.clean().createTemporaryCell({value:mn(),style:{numberFormat:"Medium Time"}}).toText();ze((O.current?.value??"")+A)},[g]),U=o.useCallback(()=>{const A=L.clean().createTemporaryCell({value:mn(),style:{numberFormat:"Short Date"}}).toText();ze((O.current?.value??"")+A)},[g]),ee=o.useMemo(()=>({element:()=>O.current,doCopy:A=>{const J=O.current.value.substring(O.current.selectionStart,O.current.selectionEnd);if(A?.isCut){const j=O.current.value.substring(0,O.current.selectionStart)+O.current.value.substring(O.current.selectionEnd,O.current.value.length);ze(j)}return J}}),[O.current]),ge=o.useMemo(()=>({element:()=>O.current,doPaste:async(A,J)=>{const j=await A.toText?.();if(!j)return!0;const _=O.current.value.substring(0,O.current.selectionStart)+j+O.current.value.substring(O.current.selectionEnd,O.current.value.length);return ze(_),K({start:O.current.selectionStart+j.length,end:O.current.selectionStart+j.length,direction:"forward"}),!0}}),[O.current]),le=o.useMemo(()=>({contains:A=>O.current?.contains(A)||!1,focus(){O.current.focus()}}),[]),Ee=o.useMemo(()=>[new r.SimpleCommand("selectAll",le,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},Z),new r.SimpleCommand("startEditValueAbove",le,{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]}]},Ie),new r.SimpleCommand("startEditCurrentTime",le,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},we),new r.SimpleCommand("startEditCurrentDate",le,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},U),new r.Command("relativeReferencesToggle",le,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},de),new r.Command("toggleEditorFocus",le,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ie=o.useMemo(()=>{let A=null;const J=()=>({contains:j=>O.current?.contains(j)||!1,focus(){O.current.focus()}});return A=k?k.createChildGroup(J,"editor",!1):new r.CommandGroup(J,"editor"),A.addCommands(Ee,!0),A},[k,Ee]),pe=o.useMemo(()=>({notifier:null,source:ee,target:ge,commands:ie}),[ee,ge,ie]);r.useCopyPaste(pe);const[De,xe]=o.useState(!p);o.useEffect(()=>{xe(!1)},[]);const Be=r.useCallbackRef(A=>{ce(!0),ie?.activate();const J=B.current;if(J!==!1){let j,_;const qe=O.current.value;Bo(L,qe)&&(j=qe.length-1,_=qe.length-1),j=J?.start??j??qe.length,_=J?.end??_??qe.length,B.current=!1,K({start:j,end:_,direction:"forward"})}z?.(A)},[z,L]),He=q.insets;let C=He.left+1;const je=He.left+He.right+2-1,nt=re?.bounds.height??0;let te,ke=He.top;q.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?ke=Math.max(0,(M-(He.top+He.bottom)-nt)/2):q.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(ke=Math.max(0,M-(He.top+He.bottom)-nt)),P!==void 0&&re?.lines[0]?.bounds&&(te=re?.lines[0]?.bounds.height*P);const Le=q.style.getFont();let Ae=Le.getSize();Le.isSuperSub()&&(Ae*=Le.getSuperSubScale()),Ae*=d.IFont.getDeviceScale()*R;const Fe=v?Le.toCSS(N,R):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:A=>{O.current&&document.activeElement!==O.current&&requestAnimationFrame(()=>{O.current.focus()})},ref:Q,...F,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...V},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ke*R,left:C*R,width:`calc(100% - ${je*R}px)`,maxWidth:`calc(100% - ${je*R}px)`,height:(te??nt)*R,maxHeight:(te??nt)*R},children:c.jsx("textarea",{spellCheck:"false",placeholder:q.placeholder,ref:O,value:q.textValue,disabled:De,readOnly:$||g.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Fe,fontSize:Ae?`${Ae}px`:"inherit",textAlign:q.textAlign,lineHeight:(re?.lines[0]?.bounds.height??0)*R+"px",height:(re?.bounds.height??0)*R,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:q.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Be,onBlur:()=>{ce(!1)},onSelect:A=>{},onChange:A=>{O.current&&!ve.current&&(B.current=!1,ze(A.target.value),q.textValue,A.target.value,A.target.selectionStart,A.target.selectionEnd,A.target.selectionDirection,K({start:A.target.selectionStart,end:A.target.selectionEnd,direction:A.target.selectionDirection}))},onMouseDown:A=>{W&&Pe(!0)},onKeyDown:Y})})})})),Ir=(e,t)=>({clean:e,dirty:t,editMode:!1}),Er=e=>{const{length:t=0,width:n=1,dashArray:l=null,dashArrayAdditional:a=null,isDouble:i=!1,isAngled:f=!1,offsetX:m=0,offsetY:s=0,isVertical:v=!1,...b}=e,y=V=>{let R=null;if(V&&n>0){R="";for(let P=0;P<V.length;P++)R+=V[P],P<V.length-1&&(R+=",")}return R},g=y(l);let k=g;a&&(k=y(a));let x=n,E=t,z=null;if(i){x=Math.floor(n/2);const V=x+x/2+1;let R=null;R=v?`M ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+V)}`,z=c.jsx("path",{strokeWidth:x,strokeDasharray:k,d:R,...b})}if(f){x=n/2;const V=x+x/2;let R=k,P=null;P=v?`M ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+V)}`,z=c.jsx("path",{strokeWidth:x,strokeDasharray:R,strokeDashoffset:"1",shapeRendering:"crispEdges",d:P,...b})}let $=null;return $=v?`M ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+x/2)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+x/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:x,strokeDasharray:g,d:$,...b}),z]})};function so(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Qt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const l of e){const a=so(l,t),i=typeof a=="function";n.push(i?a:()=>so(l,null))}return()=>{for(const l of n)l()}}}:function(e){return t=>{for(const n of e)so(n,t)}},Dl=function(){},Fr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zl=Fr?o.useLayoutEffect:o.useEffect,Ho={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Vt=Fr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],l=o.useState(Ho),a=l[0],i=l[1],f=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var s=m[0].contentRect,v=s.x,b=s.y,y=s.width,g=s.height,k=s.top,x=s.left,E=s.bottom,z=s.right;i({x:v,y:b,width:y,height:g,top:k,left:x,bottom:E,right:z})}})},[]);return zl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[Dl,Ho]},Nl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Ll=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Pl=e=>{const{key:t,points:n,range:l,stroke:a,darkMode:i,forceThinBorder:f=!1,shiftIfWide:m=!1,isVertical:s=!1,intersections:v,layout:b}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const g=n[0],k=n[1],x=n[2],E=n[3];let z=1+(s?E-k:x-g),$=0;const V=a.getColor().toRGBA(i).toString(),R=y.description.toLowerCase().includes("double");let P,p;const F=s?"rowStart":"colStart",M=s?"rowEnd":"colEnd",H=s?k:g;if(v?.length>0){const ce=v[0];if(ce?.range[F]===l[F]){const K=d.IBorder.BuiltInDefinitions.get(ce.stroke.getStyle());$=Math.floor(K.width/2)}if(v[v.length-1]?.range[M]===l[M]){const K=d.IBorder.BuiltInDefinitions.get(v[v.length-1].stroke.getStyle());z=Math.floor(z+(K.width===2?0:K.width/2))}if(R){const K=s?"colStart":"rowStart",L=s?"colEnd":"rowEnd",I=s?b?.getRowOffset:b?.getColOffset;let q=0,O=0;P=[],p=[];const Q=v.length;for(let re=0;re<Q;re++){const be=v[re];if(be.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&I){const me=I(be.range[F])-(H-$);be.range[K]<l[K]&&(P.push(me-q),q=me,P.push(1),q++),be.range[L]>l[L]&&(p.push(me-O),O=me,p.push(1),O++)}}P.length>0&&q<z&&P.push(z-q),p.length>0&&O<z&&p.push(z-O)}}let N=s?-Math.floor(y.width/2):-$,B=s?-$:-Math.floor(y.width/2);const W=m&&y.width>2?-1:0;return c.jsx(Er,{offsetX:g+N+W,offsetY:k+B+W,length:z+$,isVertical:s,stroke:V,width:y.width,dashArray:P??y.pattern,dashArrayAdditional:p,isDouble:R,isAngled:y.description.toLowerCase().includes("slant")},t)},So=({getBorderAt:e,borderRenderer:t=Pl,getVisibleCells:n,darkMode:l,forceThinBorder:a=!1,defaultColor:i="black",shiftIfWide:f=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>v=>{const b=v.toClipBounds(v.getRangeCoordsBounds(),-3);if(!b)return;const y=m(v);if(y.length===0)return;const g=v.getVisibleColumnOffsets(),k=v.getVisibleRowOffsets();let x=[],E=[];const z=v.getVisibleColumns(),$=v.getVisibleRows(),V=[],R=[],P=[],p=(G,K,L,I,q,O,Q)=>{const re={index:I,stroke:q,visibleIndex:L,edge:O,length:Q};G[K]||(G[K]=[]),G[K].length>0&&G[K][G[K].length-1]?.index===I?G[K][G[K].length-1]=re:G[K].push(re)},F=v.getVisibleRangeCoords(),M=y.length;for(let G=0;G<M;G++){const K=y[G],L=K.coords;if(!L)continue;const I=K?.range??{rowStart:L.rowIndex,colStart:L.colIndex,rowEnd:L.rowIndex,colEnd:L.colIndex};if(!he.CoordUtils.isRangesIntersect(I,F)&&!he.CoordUtils.isRangeWithinRange(I,F))continue;const q=L.colIndex,O=L.rowIndex,Q=g[q],re=k[O];if(I.rowEnd!==I.rowStart){const Ie=k[I.rowStart]?.spanIndex??-1,we=k[I.rowEnd]?.spanIndex??k[$[$.length-1]].spanIndex+1;x.push({...I,rowStart:Ie,rowEnd:we})}if(I.colEnd!==I.colStart){const Ie=g[I.colStart]?.spanIndex??-1,we=g[I.colEnd]?.spanIndex??g[z[z.length-1]].spanIndex+1;E.push({...I,colStart:Ie,colEnd:we})}const be=K.value,me=e(be,G);if(!me||me.isEmpty())continue;const ze=me.getLeft(),Pe=me.getTop(),ve=me.getRight(),Re=me.getBottom();let Ke=1,Y=1;if(!Q||!re)continue;const Z=Q.spanIndex,de=re.spanIndex;ze.isNone()||p(V,Z,de,O,ze,d.IBorder.Edge.Left,Ke),Pe.isNone()||p(R,de,Z,q,Pe,d.IBorder.Edge.Top,Y),ve.isNone()||p(V,Z+Y,de,O,ve,d.IBorder.Edge.Right,Ke),Re.isNone()||p(R,de+Ke,Z,q,Re,d.IBorder.Edge.Bottom,Y)}const H=(G,K,L)=>{const I=[];return G.forEach((q,O)=>{let Q=null;q.sort((be,me)=>be.visibleIndex-me.visibleIndex);const re=q.length;for(let be=0;be<re;be++){const me=q[be];if(!me?.stroke||K[O]===void 0&&K[O-1]===void 0)continue;let ze=!1;if(L){const Ke=x.length;for(let Y=0;!ze&&Y<Ke;Y++){let Z=x[Y];Z.colStart<=me.index&&Z.colEnd>=me.index&&Z.rowStart<O&&Z.rowEnd>=O&&(ze=!0)}}else{const Ke=E.length;for(let Y=0;!ze&&Y<Ke;Y++){let Z=E[Y];Z.rowStart<=me.index&&Z.rowEnd>=me.index&&Z.colStart<O&&Z.colEnd>=O&&(ze=!0)}}if(ze)continue;const Pe=me.stroke?.getColor(),ve=Pe?Pe.toRGBA().toString():i,Re=me.stroke.getStyle()+":"+ve;(Re!==Q?.key||Q&&Q.visibleIndex+1<me.visibleIndex)&&(Q&&I.push(Q),Q={key:Re,index:K[O]??K[O-1]+1,visibleIndex:me.visibleIndex,edge:me.edge,stroke:me.stroke,from:me.index,to:me.index+me.length-1,intersections:[],length:1}),Q.to=me.index+me.length-1,Q.visibleIndex=me.visibleIndex}Q&&I.push(Q)}),I};x=x.sort(Ll),E=E.sort(Nl);const N=H(V,z,!1),B=H(R,$,!0);if(N.length===0&&B.length===0)return null;const W=B.length;for(let G=0;G<W;G++){const K=B[G];let L=he.CommonUtils.findEqualOrGreater(N,K.from,q=>q.index),I=!1;for(;!I;){const q=N[L++];q&&q.index>=K.from&&q.index<=K.to+1&&q.from<=K.index&&q.to+1>=K.index&&(K.intersections.push({stroke:q.stroke,range:{rowStart:q.from,rowEnd:q.to+1,colStart:q.index,colEnd:q.index}}),q.intersections.push({stroke:K.stroke,range:{rowStart:K.index,rowEnd:K.index,colStart:K.from,colEnd:K.to+1}})),I=!q||q.index>K.to+1}}for(let G=0;G<W;G++){const K=B[G];let L=K.stroke;const I=`rBorder:${K.index}:${K.from}:${K.to}:${K.edge}`,q={rowStart:K.index,rowEnd:K.index,colStart:K.from,colEnd:K.to+1},O=v.getLayout(),Q=!1,re=O.getColOffset(q.colStart),be=O.getRowOffset(q.rowStart),me=[re,be,O.getColOffset(q.colEnd),be];P.push(t({key:I,points:me,stroke:L,darkMode:l,forceThinBorder:a,shiftIfWide:f,range:q,intersections:K.intersections,layout:O,isVertical:Q}))}const ce=N.length;for(let G=0;G<ce;G++){const K=N[G];let L=K.stroke;const I=`cBorder:${K.index}:${K.from}:${K.to}:${K.edge}`,q={rowStart:K.from,rowEnd:K.to+1,colStart:K.index,colEnd:K.index},O=v.getLayout(),Q=!0,re=O.getColOffset(q.colStart),be=[re,O.getRowOffset(q.rowStart),re,O.getRowOffset(q.rowEnd)];P.push(t({key:I,stroke:L,points:be,darkMode:l,forceThinBorder:a,shiftIfWide:f,range:q,intersections:K.intersections,layout:O,isVertical:Q}))}return c.jsx("svg",{width:`${b.width}`,height:`${b.height}`,viewBox:`0 0 ${b.width} ${b.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${b.width}px`,height:`${b.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:P},"borders")},[e,l])}},Vo=he.AnchorLocation.Center,jl=Object.freeze({horizontal:!1,vertical:!1}),Uo=he.TypesUtils.EmptyTopLeft,Ol=(e,t)=>he.CoordUtils.EmptyCell,Bl=(e,t)=>new Promise((n,l)=>{l("StaticBorderRenderer does not support scrolling")}),Hl=o.memo(e=>{const{getBorderAt:t,width:n,height:l,style:a,rowCount:i=2,columnCount:f=2,darkMode:m,forceThinBorder:s,children:v,...b}=e,y=o.useRef(null),[g,{width:k,height:x}]=Vt(),E=n??k,z=l??x,$=o.useMemo(()=>{const L=[];for(let I=0;I<i;I++)for(let q=0;q<f;q++){const O={colIndex:q,rowIndex:I};L.push({coords:O,value:O})}return L},[]),V=o.useCallback(L=>$,[$]),{overlay:R}=So({getVisibleCells:V,getBorderAt:t,darkMode:m,forceThinBorder:s}),P=Math.floor(E/f),p=Math.floor(z/i),F={getColOffset:L=>Math.ceil(L*P)+0,getRowOffset:L=>Math.ceil(L*p)+0,getColIndex:L=>Math.floor((L-0)/P)-1,getRowIndex:L=>Math.floor((L-0)/p)-1},M={rowStart:0,colStart:0,rowEnd:i,colEnd:f},H={x:0,y:0,width:Math.max(0,E)+0,height:Math.max(0,z)+0},N=o.useMemo(()=>{const L={},I=Math.floor(E/f);for(let q=0;q<f;q++)L[q]={offset:q*I,size:I,spanIndex:q};return L},[E,z]),B=o.useMemo(()=>{const L={},I=Math.floor(z/i);for(let q=0;q<i;q++)L[q]={offset:q*I,size:I,spanIndex:q};return L},[E,z]);if(!R)return null;const W={width:E,height:z},ce={width:E,height:z},G={getStage:()=>y.current,getTotalSize:()=>W,getViewportSize:()=>ce,getLayout:()=>F,getCellCoordsAsRangeCoords:he.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const L=[];for(let I=0;I<i;I++)L.push(I);return L},getTotalRangeCoords:()=>M,getRelativePointFromClient:(L,I)=>({x:L,y:I}),getVisibleColumns:()=>{const L=[];for(let I=0;I<f;I++)L.push(I);return L},toClipBounds:(L,I)=>H,toViewBounds:L=>L,toAbsoluteBounds:L=>L,getBounds:()=>H,getInsets:()=>null,getRangeCoordsBounds:(L,I)=>null,getVisibleColumnOffsets:()=>N,getVisibleRowOffsets:()=>B,allViews:()=>({[Vo]:G}),getAnchor:()=>Vo,getZoom:()=>1,scrollCellCoordsIntoView:Bl,getCellCoordsFromClient:Ol,getScrollOrientation:()=>jl,getScrollTopLeft:()=>Uo,getFreezeTopLeft:()=>Uo},K=R(G);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...b,children:[c.jsx("div",{ref:Qt([y,g]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:v}),K]})});function Ar(e){var t,n,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ar(e[t]))&&(l&&(l+=" "),l+=n)}else for(n in e)e[n]&&(l&&(l+=" "),l+=n);return l}function ct(){for(var e,t,n=0,l="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ar(e))&&(l&&(l+=" "),l+=t);return l}const Vl="_sheetxl-sheet_1qeq6_5",Ul="_viewport-overlay_1qeq6_6",Dr=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"})]})},Kl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:l="grey",credits:a="All rights reserved - Michael Ford",feature:i,style:f,...m}=e??{},[s,v]=o.useState(null);o.useEffect(()=>{(async()=>{const p=await d.LicenseManager.getDetails();v(p)})()},[]);const[b,y]=o.useState(!1),g={opacity:.65},k=o.useMemo(()=>{const p=s?.getExceptions(),F=p?.length??0;if(F===0)return null;const M=[];for(let H=0;H<F;H++){const N=p[H];M.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:N},H))}return M},[s,n]);if(s===null||s.isValidFor(i))return null;const x=s.getType(),E=!k&&x.endsWith("ity"),z=s.getLicensee(),$=E?1.6:1,V=135/$,R=37/$;let P=null;return!x&&z?.length>0&&(P=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:z})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[b?c.jsx(Dr,{style:g}):c.jsx("svg",{width:V,height:R,style:g,children:c.jsx("image",{style:{width:V,height:R},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),c.jsxs("div",{children:[P,k,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:l},children:a})]})]})})}),tt=(e,t,n)=>{const l=o.useRef(t);l.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!l.current)return;const i=Object.keys(l.current),f={},m=i.length;for(let v=0;v<m;v++){const b=i[v];f[b]=(y,g)=>{l.current[b]?.(y,g)}}const s=e.addListeners(f,n);if(a)for(let v=0;v<m;v++)f[i[v]](e);return()=>{s?.()}},[e])},Pn=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){const n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw new Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,e)}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw new Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return he.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const l=n.contributionPoints;if(l&&l.length!==0)for(let a of l)a.startsWith(e)&&t.push(n)}return t}},zr=o.createContext(void 0),$l={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},Nr=()=>o.useContext(zr)||$l,Yt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},Ro=o.memo(o.forwardRef((e,t)=>{const{children:n,title:l,icon:a,onClose:i,readOnly:f,focused:m,style:s,className:v,...b}=e,y=o.useMemo(()=>ct("taskpane-title",v,Yt.TaskPaneTitle,{focused:m}),[v,m]);return c.jsxs("div",{ref:t,className:y,style:s,...b,children:[c.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:l}),c.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:g=>{g.stopPropagation()},onPointerUp:()=>{i()},children:c.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));Ro.displayName="TaskPaneTitle";const Wl=(e,t)=>c.jsx(Ro,{...e,ref:t}),_l=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:l,close:a,listenerContainer:i,model:f,commands:m,onMounted:s,onUnmounted:v,paneWrapper:b,paneProps:y,renderTaskPanelTitle:g=Wl,style:k,className:x,...E}=e,[z,$]=o.useState(null),[V,R]=o.useState(!1),P=r.useCallbackRef(a,[a]),p=o.useRef(null),F=o.useRef(null);o.useEffect(()=>(s?.(l),()=>{v?.(l)}),[l]);const M=o.useRef([]),H=o.useMemo(()=>({addListener:W=>{const ce=i(W);return M.current.push(ce),ce},close:()=>{P?.()},focus:W=>{p.current?.focus(W)}}),[i]);o.useEffect(()=>()=>{for(const W of M.current)W();M.current=[]},[]);const N=o.useMemo(()=>(l.renderTaskPanelTitle??g)({title:l.getTitle(),icon:null,readOnly:!1,focused:V,onClose:P,onPointerDown:W=>{}},F),[l,V]),B=o.useMemo(()=>{let W=l.renderTaskPane({entryKey:l.key,model:f,commands:m,frame:H,...y},t);return b&&(W=b(W)),W},[l,f,m,t]);return c.jsxs("div",{className:ct("taskpane-frame",x,Yt.TaskPaneFrame),tabIndex:0,ref:p,style:k,onPointerDown:async W=>{W.currentTarget.focus()},onFocus:W=>{W.relatedTarget&&!z&&$(W.relatedTarget),R(!0)},onBlur:W=>{z&&!p?.current?.contains(W.relatedTarget)&&$(null),W.relatedTarget&&R(!1)},...E,children:[c.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:N}),c.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:B})]})})),ko=o.memo(o.forwardRef((e,t)=>{const{children:n,title:l,taskPanes:a,onSelect:i,selected:f,registry:m=Pn,style:s,className:v,...b}=e,y=o.useMemo(()=>a.map(x=>{const E=m.getRegisteredTaskPane(x);if(!E)return null;let z=E.getIcon?.();z&&(typeof z=="string"&&(z=c.jsx(r.DynamicIcon,{iconKey:z})),z=c.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:z}));const $=x===f;return c.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ct("taskpane-strip-item",Yt.TaskPaneStripItem,{selected:$}),onClick:()=>e.onSelect(x),children:[z,E.getTitle()]},x)}),[a,f,i,m]),g=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),k=o.useMemo(()=>ct("taskpane-strip",v,Yt.TaskPaneStrip),[v]);return c.jsx("div",{ref:g,className:k,style:s,...b,children:y})}));ko.displayName="TaskPaneStrip";const Gl=(e,t)=>c.jsx(ko,{ref:t,...e}),Zl=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:l=Pn,model:a,commands:i,onOpen:f,onClose:m,paneWrapper:s,paneProps:v,frameWrapper:b,frameProps:y,renderTaskPanelTitle:g,renderTaskPaneStrip:k=Gl,alwaysShowStrip:x,style:E}=e,z=r.useCallbackRef(f,[f]),$=r.useCallbackRef(m,[m]),[V,R]=o.useState(null),P=o.useRef(null),[p,F]=o.useState([]),M=o.useRef(new Set),H=r.useCallbackRef(async(L,I=!1)=>{const q=Array.from(M.current),O=q.length;let Q=!0;for(let re=0;Q&&re<O;re++){const be=q[re];if(be.onBeforeHide)try{await Promise.resolve(be.onBeforeHide())===!1&&(Q=!1)}catch{Q=!1}}return Q},[]),N=r.useCallbackRef(L=>{const I=Array.from(M.current),q=I.length;F(O=>{const Q=O.findIndex(be=>be.key===L);if(Q===-1)return O;const re=[...O];return re.splice(Q,1),re.length===0?(R(null),$?.(),re):(B(re[Math.max(re.length-1,Q-1)].key),re)});for(let O=0;O<q;O++){const Q=I[O];try{Q.onHide?.()}catch{}}},[$]),B=r.useCallbackRef(async L=>{const I=l.getRegisteredTaskPane(L);if(!I)return void console.warn(`Invalid taskpane '${L}'`);if(P.current===L||V&&!await H(V.key))return;const q=o.createRef();let O=c.jsx(_l,{ref:()=>{P.current=null},entry:I,model:a,commands:i,close:async()=>{await H(L)&&N(L)},paneWrapper:s,paneProps:v,renderTaskPanelTitle:g,listenerContainer:re=>(M.current.add(re),()=>{M.current.delete(re)}),onMounted:re=>{re.key===L&&(P.current=null),z?.()},onUnmounted:re=>{},...y});b&&(O=b(O));const Q={key:L,elem:O,ref:q};F(re=>{if(re.findIndex(me=>me.key===L)!==-1)return re;const be=[...re];return be.push(Q),be}),R(Q),P.current=L},[V,b,s,g]);o.useEffect(()=>{V&&!P.current&&B(V.key)},[y,a]);const W=r.useImperativeElement(t,()=>({activateTaskPane:B}),[l,v,a,i]),ce=o.useMemo(()=>p.map(L=>L.key),[p]),G=o.useMemo(()=>{if(ce.length<=1&&!x)return null;const L={className:Yt.TaskPaneAreaStrip,taskPanes:ce,selected:V?.key,onSelect:I=>{B(I)},registry:l};return k(L,null)},[ce,V,l,x]),K=V?.elem;return c.jsxs("div",{ref:W,className:ct("taskpane-area",n,Yt.TaskPaneArea),style:E,children:[K,G]})})),En=new d.Color("transparent");function Lr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:l,commands:a,target:i,onStartEdit:f,getViewport:m}=e,s=r.useNotifier(),v=Nr(),[b,y]=o.useState(null),[g,k]=o.useState(null),x=o.useRef(null),E=r.useCallbackRef(f,[f]),z=r.useCallbackRef(m,[m]),$=o.useMemo(()=>({serializer:{parse:h=>h?t?.getStyles().parseColor(h):null,stringify:h=>h?h.toString():null}}),[t]),[V,R]=r.usePersistenceState("sheet.lastBorder",null),[P,p]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),$),[F,M]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),$),H=r.useEditMode();o.useRef(H.getMode()).current=H.getMode();const N=r.useGlobalClipboard(),[B,W]=o.useState(he.CommonUtils.EmptyArray),ce=o.useCallback(()=>{if(x.current!==t)return;const h=t.getSelectedRanges();let w=null;B.length>0&&he.CoordUtils.isCellWithinRange(b,B[0].getRange().getCoords())&&(w=B[0]);const T=t?.getSelectedCell(),u=T?.getCoords()??null;Ht.unstable_batchedUpdates(()=>{me(w),y(u),k(h)})},[t,B,g,b]),G=o.useCallback(he.CommonUtils.debounce(ce,210),[ce]);o.useEffect(()=>{x.current=t,ce()},[t]);const K=r.useCallbackRef(()=>t.getRange(b).getCell(),[t,b]),L=r.useCallbackRef(async(h,w,T=null,u=!1,S=!0)=>{const D=h?.label?.(),oe=async()=>{const ae=await Promise.resolve(S&&s.showBusy(D??"Busy..."));try{await t.doBatch(async()=>w(t),D),u&&H.setMode(null),ae&&ae()}catch(ue){if(ae&&ae(),!ue)return;s.showError(ue)}},fe=[];let se=!1;const ne=async()=>(fe.push(oe),(async()=>{if(!se){for(se=!0;fe.length>0;){const ae=fe.shift();ae&&await ae()}se=!1}})());if(n){let ae=null;if(T!==!1&&h){const ue=T??D;ae=new r.SimpleCommand(h.key(),i,{label:ue,description:ue},ne)}n(ae)}return ne()},[t,n,s]),I=r.useCallbackRef((h,w,T=!1,u)=>(u||(u={autoSelect:!0,autoFit:!0}),L(h,S=>{const D=S.getSelectedRanges();T&&D.getStyle().update(null,u),D.getStyle().update(w,u)})),[t]),q=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRange().setHyperlink(w)})},[t]),O=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRange().setComments(w)})},[t]),Q=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRanges().clear(w)})},[t]),re=r.useCallbackRef(async(h,w,T=!1,u=!1)=>L(h,async S=>{let D=S.getSelectedRanges();T&&(w===d.IRange.Orientation.Row?D=D.getEntireRows(u):w===d.IRange.Orientation.Column&&(D=D.getEntireColumns(u)));let oe=null;const fe=H.getMode()?.key;if(fe==="copy"||fe==="cut"){const se=await N.getClipboard().readReference();se&&se.getItemType()==="range"&&(oe=se.getItem(),oe.getCoords()||(oe=null))}if(oe){const se=await D.insertFrom(oe,{...oe.getMarkOptions(),orientation:w,autoSelect:!0});!se||se.isEntireRows()||se.isEntireColumns()||se.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),H.setMode(null)}else D.insert({orientation:w,autoSelect:!0})},"Insert Cells",!1),[H]),[be,me]=o.useState(null),ze=r.useCallbackRef(h=>t.getStyles().setDefaultTableStyle(h),[t]),Pe=r.useCallbackRef(h=>{t.getStyles().getTableStyle(h)?.delete()},[t]),ve=r.useCallbackRef((h,w)=>{L(h,async T=>{const u=T.getSelectedRange(),S=T.getSelectedCell().getCoords();let D=null,oe=0;const fe=S.rowIndex>0?T.getRange({rowIndex:S.rowIndex,colIndex:S.colIndex}).getExtended(d.IRange.Direction.Up):null;fe&&T.getRange({colStart:S.colIndex,rowStart:fe.getCoords().rowStart,colEnd:S.colIndex,rowEnd:fe.getCoords().rowStart}).isContentful()&&(D=d.IRange.Direction.Up,oe=S.rowIndex-fe.getCoords().rowEnd);const se=S.colIndex>0?T.getRange({rowIndex:S.rowIndex,colIndex:S.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(se&&T.getRange({colStart:se.getCoords().colStart,rowStart:S.rowIndex,colEnd:se.getCoords().colStart,rowEnd:S.rowIndex}).isContentful()){const ae=S.colIndex-se.getCoords().colEnd;(ae<oe||!D)&&(D=d.IRange.Direction.Left,oe=ae)}let ne=null;if(D===d.IRange.Direction.Up){if(ne={...fe.getCoords()},(ne.rowEnd===S.rowIndex||!T.getRange({colIndex:S.colIndex,rowIndex:S.rowIndex-1}).isContentful())&&ne.rowStart>0&&T.getRange({colIndex:S.colIndex,rowIndex:ne.rowStart-1}).isContentful()){const ae=fe.getExtended(d.IRange.Direction.Up);ne={colStart:S.colIndex,rowStart:ae.getCoords().rowStart,colEnd:S.colIndex,rowEnd:fe.getCoords().rowEnd}}ne.rowEnd=S.rowIndex-1}else if(D===d.IRange.Direction.Left){if(ne={...se.getCoords()},(ne.colEnd===S.colIndex||!T.getRange({colIndex:S.colIndex-1,rowIndex:S.rowIndex}).isContentful())&&ne.colStart>0&&T.getRange({colIndex:ne.colStart-1,rowIndex:S.rowIndex}).isContentful()){const ae=se.getExtended(d.IRange.Direction.Left);ne={colStart:ae.getCoords().colStart,rowStart:S.rowIndex,colEnd:ae.getCoords().colEnd,rowEnd:S.rowIndex}}ne.colEnd=S.colIndex-1}if(u.size!==1&&D){const ae=u.getCoords(),ue=u.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),Ce={...ne},Oe=ae.rowStart,Me=ae.rowEnd,Te=ae.colStart,$e=ae.colEnd,We=D===d.IRange.Direction.Up;for(let _e=Te;_e<=$e;_e++){Ce.colStart=We?_e:ne.colStart+(_e-Te),Ce.colEnd=We?_e:ne.colEnd+(_e-Te);for(let Ye=Oe;Ye<=Me;Ye++){Ce.rowStart=We?ne.rowStart+(Ye-Oe):Ye,Ce.rowEnd=We?ne.rowEnd+(Ye-Oe):Ye;const Je=T.getRange(Ce).toString();ue.pushAt(Ye,_e,`=${w}(${Je})`)}}ue.apply()}else{const ae=ne?T.getRange(ne).toString():"",ue=`=${w}(`;E?.({text:`${ue}${ae})`,editMode:!0,initialSelection:{start:ue.length,end:ue.length+ae.length}})}},!1)},[t]),Re=r.useCallbackRef((h,w,T=!1,u=!0)=>{L(h,async S=>{if(be)return void be.updateStyleOptions(w);const D=S.getSelectedRanges().getFixed(!0),oe=S.getSelectedRange().getDefaultSortCriteria(),fe={getNames:()=>S.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},se={ranges:D,hasHeader:oe?.options?.hasHeader??!1},ne=async ue=>{if(!(ue=await Promise.resolve(ue)))return null;const Ce=await Promise.resolve(s.showBusy(h.label()));try{await S.getTables().add(ue.ranges.at(0),{styleName:w?.name,clearFormatting:T,hasHeader:ue.hasHeader}).getRange().select(),Ce()}catch(Oe){Ce(),s.showError(Oe)}};if(!u)return void await ne(se);const ae={initialValue:se,context:()=>fe,onInput:ue=>{ne(ue)}};s.showWindow("tableNew",ae)},!1,!0,!1)},[be]),Ke=r.useCallbackRef(()=>l,[l]),Y=r.useCallbackRef(h=>({styles:()=>t.getStyles(),table:()=>h,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),Z=r.useCallbackRef(async(h,w,T,u=!0)=>{if(!w){let D=t.getSelectedRange();D.size===1&&(D=D.getSurrounding());let oe=t.getTables().getItems({address:t.getSelectedRange()});oe.length>0&&(w=oe[0]),await D.select()}if(!w)return;try{T&&await w.select()}catch{}if(!u)return;const S=new Promise(async(D,oe)=>{h.update({context:Y(w)}),v.activateTaskPane("tableDetails",{}),D(!0)});try{if(!await S)return}catch(D){s.showError(D)}},[s]),de=r.useCallbackRef(async(h,w,T=!1)=>{let u=null;if(w)w.isITable?u=w:w.getValue()&&(u=w.getValue());else{const S=t.getTables().getItems({address:t.getSelectedRange()});S.length>0&&(u=S[0])}if(u){if(!T){const S=u.getRange().getCoords(),D=(S.colEnd-S.colStart+1)*(S.rowEnd-S.rowStart+1);if(D>1e4&&await s.showOptions({title:"Confirm",description:`Converting a table to range with '${D}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
-
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}L(h,async()=>{T?u.delete():u.convertToRange()},!1,!0)}},[s]),Ie=r.useCallbackRef((h,w,T)=>{L(h,async u=>{const S=u.getSelectedRanges();if(S.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let D=S.at(0);D.size===1&&(D=D.getSurrounding());const oe=u.getSelection().getCoords().cell;let fe=D.getDefaultSortCriteria(d.IRange.Orientation.Row,oe);if(!fe){if(T)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}const se=async
|
|
11
|
-
For example, you can prevent people from editing locked cells or making formatting changes.`,icon:"Lock"}),new r.Command("formatSheetTabColor",i,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),new r.Command("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.",icon:"PresetStyles"},function(h){I(this,{named:h.getName()},!0)}),new r.Command("formatTableStyle",i,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(h){Re(this,h)}),new r.Command("formatTableStyleClearCellStyles",i,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(h){Re(this,h,!0)}),new r.Command("formatTableStyleClearTableStyle",i,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){Re(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",i,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ze),new r.Command("deleteTableStyle",i,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Pe),new r.Command("formatBorder",i,{label:"Border",description:"Create an outline border."},function(h){I(this,{border:h})}),new r.Command("formatFillColor",i,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(h){I(this,{fill:h})}),new r.Command("formatFontColor",i,{label:"Font Color",description:"Change the color of your text."},function(h){I(this,{font:{fill:h}})}),new r.Command("formatBoldToggle",i,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",i,{label:"Italic",description:"Toggle italic formatting of text.",icon:"TextItalic",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",i,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",icon:"TextUnderline",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",i,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",i,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",i,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",i,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",i,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",i,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",i,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",i,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",i,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",i,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",i,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),new r.Command("formatTextOverflowEllipsisToggle",i,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",i,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",i,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),new r.Command("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.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",i,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",i,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",i,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",i,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",i,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",i,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",i,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),new r.Command("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.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",i,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,h=>({font:{size:po(h.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",i,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,h=>({font:{size:po(h.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",i,{label:"Font",description:"Select the font your text."},function(h){I(this,{font:{family:h}})}),new r.Command("formatFontSize",i,{label:"Font Size",description:"Change the size of your text."},function(h){I(this,{font:{size:h}})}),new r.Command("formatNumberDialog",i,{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(h,w){const T=this,u={initialValue:h??w.state(),context:()=>w.context(),onInput:(S,D)=>{I(T,{numberFormat:S})}};s.showWindow("numberFormat",u)}),new r.Command("formatNumberFormat",i,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(h){I(this,{numberFormat:h})}),new r.Command("formatNumberFormatGeneralStyle",i,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:d.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",i,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",i,{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(){I(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",i,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",i,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(h){I(this,{numberFormat:h??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",i,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",i,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",i,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){I(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",i,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){I(this,h=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(h.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",i,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){I(this,h=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(h.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",i,{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",i,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",i,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",i,{label:"Hide Rows",description:"Hide the rows.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",i,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",i,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",i,{label:"Unhide Columns",description:"Unhide the columns.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",i,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",i,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(h){h&&ve(this,h.getName())}),new r.Command("insertFunctionSum",i,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ve(this,"SUM")}),new r.Command("insertFunctionAverage",i,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ve(this,"AVERAGE")}),new r.Command("insertFunctionCount",i,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ve(this,"COUNT")}),new r.Command("insertFunctionMax",i,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ve(this,"MAX")}),new r.Command("insertFunctionMin",i,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ve(this,"MIN")}),new r.Command("startEditCurrentTime",i,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E?.({text:t.createTemporaryCell({value:mn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",i,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){E?.({text:t.createTemporaryCell({value:mn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",i,{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",i,{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",i,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("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.",icon:"HyperlinkInset",context:()=>K,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(h,w){const T=this,u={context:w.context(),onInput:S=>{q(T,S)}};s.showWindow("hyperlink",u)}),new r.Command("openHyperlink",i,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",icon:"HyperlinkGoto",context:()=>K},async(h,w)=>{const T=w.context()();if(!T)return;const u=T.getHyperlink();if(u)try{await u.open()}catch(S){s.showError(S)}}),new r.Command("deleteHyperlink",i,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>K},function(h,w){q(this,null)}),new r.SimpleCommand("insertNote",i,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(h,w)=>{((T,u)=>{T?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[u," 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/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,w.label())}),new r.Command("updateComments",i,{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.",icon:"CommentInsert",context:()=>K},async function(h,w){const T=this,u={context:w.context(),onInput:S=>{O(T,S)}};s.showWindow("comments",u)}),new r.Command("deleteComments",i,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>K},function(h,w){O(this,null)}),new r.Command("insertImageFromFile",i,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device.",icon:"InsertImage"},async function(h=null){let w=null,T=null;typeof h=="string"?T=h:w=h?.file?h.file:h,(w||(w=await he.CommonUtils.openFileDialog(T??"image/*"),w))&&await le(this,{file:w},h?.options)}),new r.Command("insertImageFromURL",i,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(h){if(!h){const w=await s.showInput({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(w.option!=="Insert")return;h=w.input}h&&le(this,{fetch:h})}),new r.SimpleCommand("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.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Re(this)}),new r.Command("editTable",i,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features.",icon:"InsertTable"},function(h){let w=null,T=!1;h.isITable?w=h:h.getValue()&&(w=h.getValue(),T=!0),Z(this,w,T)}),new r.Command("deleteTable",i,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),me=require("@sheetxl/utils"),o=require("react"),ht=require("@sheetxl/grid-react"),Ht=require("react-dom"),fo=o.memo(e=>{const{anchorLocation:t=me.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:m,pathProps:s,style:v,...b}=e,y=a,g=l;let k="red",x=[],E=[];return t===me.AnchorLocation.TopLeft?(k=f?"rgb(255, 198, 246)":"green",x.push(g),E.push(g),x.push(g+y),E.push(g),x.push(g),E.push(g+y)):t===me.AnchorLocation.TopRight?(k=f?"rgb(0, 255, 255)":"red",x.push(n-g),E.push(g),x.push(n-(g+y)),E.push(g),x.push(n-g),E.push(g+y)):t===me.AnchorLocation.BottomRight?(k=f?"rgb(236, 252, 211)":"purple",x.push(n-g),E.push(i-g),x.push(n-(g+y)),E.push(i-g),x.push(n-g),E.push(i-(g+y))):t===me.AnchorLocation.BottomLeft&&(k=f?"rgb(255, 236, 183)":"blue",x.push(g),E.push(i-g),x.push(g+y),E.push(i-g),x.push(g),E.push(i-(g+y))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...v},...b,children:c.jsx("path",{d:`M ${x[0]} ${E[0]} L ${x[1]} ${E[1]} L ${x[2]} ${E[2]} L ${x[0]} ${E[0]} Z`,fill:m??k,...s})})}),qr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:m,...s}=e,v=o.useMemo(()=>{let k=null;const x=l.getSortField();x&&(k=x.reverse);const E=l.getField(),z=E&&E.criteria&&E.criteria.length>0;return k===!0?z?"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":k===!1?z?"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":z?"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 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[l]),[b,y]=o.useState(!1),g=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${g}px`,height:`${g}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${b&&!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:(g>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:k=>{f?.(k,l),k.preventDefault()},...s,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${b&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:v})})})},Sr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:m=1,view:s,bodyStyle:v,normalStyle:b,showFormulas:y,showZeros:g,docTheme:k,onLinkMouseDown:x,onFilterButtonMouseDown:E,filterButtonProps:z,createFilterButton:W=qr,...V}=e,R=i.height/m,P=i.width/m,p=t,F=p.getValue(),M=t.getStyle(),H=v?.darkMode??!1;let N,B;const $=F&&F.isFormulaError,ce=$&&F instanceof d.FormulaError.Parse;let _,K=y||ce;if(K)if(p.isSpillOverflow())B="";else{const Fe=p.getFormulaText();Fe?B=Fe:N=p.getNumberFormat(d.NumberFormat.Type.General)}else N=p.getNumberFormat();K||(_=p.getTextOverflow());const L=_?_.colBounds.width+_.leftOffset+_.rightOffset:P,I=_?_.anchorBounds.x-_.leftOffset:0,q=_?_.anchorBounds.width:P,O=_?_.anchorBounds.x:0;let Q,re=p.getRenderHorizontalAlignment();N&&(Q=N?.formattedRuns,B=Q?.runs[0]?.text??N.displayText);const be=p.getCalcStatus()===d.ICell.CalcStatus.Pending;let he=null,ze=M.getFill().toCSS(H,i),Pe=0,ve=0;if(!M.getBorder().isEmpty()){const Fe=M.getBorder().getRight();!Fe.isNone()&&d.IBorder.BuiltInDefinitions.get(Fe.getStyle()).width>1&&(Pe=1);const A=M.getBorder().getBottom();!A.isNone()&&d.IBorder.BuiltInDefinitions.get(A.getStyle()).width>1&&(ve=1)}let Re=null;if(P!==q||Pe||ve||typeof ze?.backgroundPosition=="number"){const{backgroundPosition:Fe,...A}=ze,J=Fe??0,j=s?.getScrollTopLeft(),G=J?-(i.x+(j.left??0))%J:0,qe=J?-(i.y+(j.top??0))%J:0;(Fe!==void 0||Pe||ve||P!==q)&&(Object.keys(A).length===1&&A.background==="none"||(ze=null,Re=c.jsx("div",{className:"fill",style:{marginLeft:`${G}px`,marginTop:`${qe}px`,left:O*m,width:r.ReactUtils.boundPixel(q*m-G+1+Pe),height:r.ReactUtils.boundPixel(i.height-qe+1+ve),...A}},"background")))}let We=null;const Y=p.getComments(),Z=p.getWarnings(),de=p.getErrors();if(Y||$||de.length>0||Z.length>0){const Fe={size:7*m,darkMode:H,cellWidth:q*m+2,cellHeight:R*m+2,style:{top:-1,left:O*m-1}};We=We??[],(Z.length>0||de.length>0||$)&&We.push(c.jsx(fo,{anchorLocation:me.AnchorLocation.TopLeft,...Fe},`indicator-${We.length}`)),Y&&We.push(c.jsx(fo,{anchorLocation:me.AnchorLocation.TopRight,...Fe},`indicator-${We.length}`))}const Ie=M.getFont();let ye=N?.conditionalColor;const U=M.getAlignment(),te=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ge=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||te,le=ge||K?0:U.getRotation(),Ee=p.getInsets(),ie=Ee.top+Ee.bottom;let pe=Ee.left,De=Ee.right;const xe={...l,left:l.left-1,top:l.top-1,width:l.width+1+Pe,height:l.height+1+ve},Oe=p.getColumnFilter(),Be=Oe&&!Oe?.hasHiddenButton();let C=null;be&&(C=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const je=!(be||Be||Re||a||We||Q?.runs.length>1||_||le%360!=0);ze?.background==="none"&&(ze=null);let tt=ge||!(!_||!(_.rightIndex>0||_.leftIndex>0||_.colSpan>1));if(!tt){const Fe=p.getSpans();(Fe.width>1||Fe.height>1)&&(tt=!0)}const ee={...ze,...xe,pointerEvents:x?"auto":void 0};if(!me.CommonUtils.isEmpty(B)||!me.CommonUtils.isEmpty(N?.repeatPlaceholder)){const Fe=N?.canWrap??!1;let A=null,J=null,j=null,G=[],qe=!0;g||K||F!==0||(qe=!1);const Ce=p.getTextFrame(K);if(qe&&Ce){let h=L-1-(pe+De);if(le){A=Ce.layout().bounds;const ae={x:0,y:0,width:L-1,height:R};if(Q){let ue=Q.width;if(N.repeatPlaceholder||N.repeatChars.length>0){const we=d.GeomUtils.boundsToPoints(ae),He=d.GeomUtils.rotatePoints(we,-le);ue=d.GeomUtils.minBoundingRect(He).width}A={...A,width:ue}}j=d.GeomUtils.clipToOuterRect({...A,width:A.width+1+pe+De},ae,le),h=j.width-1-(pe+De)+.01}let w=null;Fe&&(w={width:h});let T=null,u=N?.repeatPlaceholder;const S=Ce.layout(w);if(A=S.bounds,K?A={...A,width:0}:Q&&(A={...A,width:N.repeatPlaceholder||N.repeatChars.length>0?h:Q.width}),le&&Fe){let ne=null;S.visitLines({visitTextLine:(ae,ue)=>{let we=ae.bounds;const He=d.GeomUtils.boundsToPoints(we),Me=d.GeomUtils.rotatePoints(He,le),Te=d.GeomUtils.minBoundingRect(Me);we={...we,x:(Te.width-we.width)/2,y:(Te.height-we.height)/2},ne=ne?d.GeomUtils.unionBounds(ne,we):we}}),A={...ne,width:ne.width+pe+De}}if(!u&&p.getType()!==d.ScalarType.String&&Math.floor(A.width)>h){if(M.getNumberFormat()==="General"&&p.getType()===d.ScalarType.Number){const ne=M.measureText("0"),ae=Math.floor(h/ne.width),ue=F,we=me.CommonUtils.splitNumber(ue),He=Math.min(10,ae-(Math.max(1,we.ipLength)+1)-(ue<0?1:0));if(He>=-1){const Me=`0${He>0?".":""}${"#".repeat(Math.max(0,He))}`;T=p.getNumberFormat(Me).displayText,T==="0"&&ue<0&&(T="-0")}else if(Math.abs(ue)>=Math.pow(10,5)||Math.abs(ue)<=Math.pow(10,-5)){const Me=ae-5-(ue<0?1:0);if(Me>=0){const Te=`0.${"0".repeat(Math.max(0,Me-1))}E+00`;T=p.getNumberFormat(Te).displayText}}}T||(u="#")}if(!u&&Q?.lastRepeatIndex>=0&&Q?.width>h&&(u="#"),u&&h>0){const ne=M.measureText(u),ae=Math.floor((h||1)/(ne?.width||1));T=ae>0?u.repeat(ae):"",re=d.ITextFrame.HorizontalAlignment.Center}if(K&&(re=d.ITextFrame.HorizontalAlignment.Left),T){const ne=M.measureText(T).width;ne&&(A={...A,width:ne})}if(J={...A,width:A.width+pe+De,height:A.height},le&&!Fe){const ne=d.GeomUtils.boundsToPoints(J),ae=d.GeomUtils.rotatePoints(ne,le),ue=d.GeomUtils.minBoundingRect(ae);J.width=ue.width,J.height=ue.height}re===d.ITextFrame.HorizontalAlignment.Center||re===d.ITextFrame.HorizontalAlignment.CenterContinuous?J.x=(L-J.width)/2:re===d.ITextFrame.HorizontalAlignment.Right?J.x=L-J.width-.5:J.x=.5,U.getVertical()===d.ITextFrame.VerticalAlignment.Center?J.y=(R-J.height)/2:U.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?J.y=R-J.height-ie:J.y=ie;const D=je?{...V}:void 0,oe={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:le?`rotate(${le}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:tt?1:void 0,...ze},onMouseDown:x,onDoubleClick:x?ne=>{ne.stopPropagation(),ne.preventDefault()}:null,...D};ce&&(oe.style.textDecorationStyle="wavy",oe.style.textDecorationColor=H?"rgb(0, 255, 255)":"red",oe.style.textDecorationLine="underline");const fe=Ie.getSize(),se=(ne,ae,ue,we,He,Me,Te,Ue=null)=>{let _e=fe*m,$e=ue,Ye=Te?.runs?Te.runs:[{type:d.NumberFormat.ParseRunType.Text,text:ne,width:M.measureText(ne,_e).width}];Te&&Te?.width!==A.width&&(A={...A,width:Te?.width});let Je=pe;if(Te?.lastRepeatIndex>=0&&h>Te?.width){const nt=Te.runs[Te.lastRepeatIndex];if(nt){const at=[...Ye],Tt=Math.max(0,h-1-Te.width);let kt=0,yt="";if(Tt>0){const wt=Math.floor(Tt/nt.width);yt=wt>0?nt.text.repeat(wt):"",kt=Tt}at[Te.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:yt,width:kt},Ye=at,A={...A,width:Te.width+kt}}}const Le=(nt,at,Tt,kt,yt,wt,ct,rt,Rt,ft=null)=>{let Ct,zt=$e.width;He===d.ITextFrame.HorizontalAlignment.Justify?(zt=yt,Me||(Ct="justify")):He===d.ITextFrame.HorizontalAlignment.Distributed&&(zt=yt,Ct=Me||nt.text.split(" ").length-1==0?"center":"justify");const{style:qt,className:Kt,...ut}=ft;let Nt=nt.text;if(He===d.ITextFrame.HorizontalAlignment.Fill&&N?.repeatChars.length===0){const gt=Math.max(1,Math.floor(($e?.width??0)/(ct?.width??1)));Nt=Nt.repeat(gt)}let nn=$e.height;const At=Ie.getVerticalAlignment(),jt=At===d.IFont.VerticalAlignment.Sub,wn=At===d.IFont.VerticalAlignment.Super;if(jt||wn){const gt=Ie.getSuperSubScale();_e*=gt,nn*=gt}const ot={textAlign:Ct,textAlignLast:Ct,...qt,...Ie.toCSS(H,m,!0),fontSize:_e*d.IFont.getDeviceScale()};je||(ot.background=void 0),ye&&(ot.color=ye.toCSS(H));const bn=Je+at;let Wt=Ee.top+$e.y+0;if(jt&&(Wt+=Rt-_e),wt){const gt=(ct.x+bn)*m+1,bt=(ct.y+Wt)*m+1;bt<0?ot.marginTop=bt:ot.paddingTop=bt,gt<0?(ot.width=(qt?.width??0)-gt,ot.left=(qt?.left??0)+gt):ot.paddingLeft=gt,ot.paddingRight=Math.max(0,(qt?.width??0)-zt*m-gt),ot.paddingBottom=Math.max(0,(qt?.height??0)-$e.height*m-bt),ot.height=(qt?.height??0)+(bt<0?-bt:0),(bt<0||gt<0)&&(ot.clipPath=`inset(${bt<0?-bt:0}px 0px 0px ${gt<0?1-gt:0}px)`)}else if(ot.left=(ct.x+bn)*m+1,ot.top=(ct.y+Wt)*m+1,ot.width=ct.width*m,ot.height=ct.height*m,le&&!Fe){ot.left=(ct.x+at)*m+1,ot.top=(ct.y+($e.y+0))*m+1;const gt=d.GeomUtils.centerPoint({x:Je+at,y:0,width:nt.width,height:$e.height}),bt=d.GeomUtils.centerPoint({x:Je,y:0,width:yt,height:$e.height}),xn=d.GeomUtils.rotatePoints([gt],le,bt),qn={x:xn[0].x-gt.x,y:xn[0].y-gt.y};ot.left=ot.left+qn.x*m,ot.top=ot.top+qn.y*m;const Ot={...$e,x:Je,y:Ee.top,width:$e.width+(pe+De)},Sn=d.GeomUtils.boundsToPoints(Ot),Zn=d.GeomUtils.rotatePoints(Sn,le),Rn=d.GeomUtils.minBoundingRect(Zn);Ot.width=Rn.width,Ot.height=Rn.height;const kn=d.GeomUtils.centerPoint(Ot),$t={x:kn.x-bt.x,y:kn.y-bt.y};ot.left=ot.left+$t.x*m,ot.top=ot.top+$t.y*m}ot.lineHeight=nn*m+"px";const on=je?void 0:"text-line";G.push(c.jsx("div",{className:Kt?`${Kt} ${on}`:on,style:ot,...ut,children:Nt},`text-${$e.y}-${kt}-${Tt}`))};if(U.getOverflow()===d.ITextFrame.Overflow.Shrink&&h>0){let nt=A?.width??0,at=0;for(;nt>1&&nt>h&&_e>2&&at<100;)_e*=h/nt,nt=M.measureText(ne,_e).width,at++;A={...A,width:nt}}let Xe=$e.x;He===d.ITextFrame.HorizontalAlignment.Right?Xe+=A.width-$e.width:He!==d.ITextFrame.HorizontalAlignment.Center&&He!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(Xe+=(A.width-$e.width)/2),Te?.lastRepeatIndex>=0&&(Xe=$e.x);const vt=Ye.length;for(let nt=0;nt<vt;nt++){const at=Ye[nt];(at.type===d.NumberFormat.ParseRunType.Text||at.type===d.NumberFormat.ParseRunType.Repeat)&&(at.type,d.NumberFormat.ParseRunType.Repeat,Le(at,Xe,nt,ae,He===d.ITextFrame.HorizontalAlignment.Justify||He===d.ITextFrame.HorizontalAlignment.Distributed||Te?.lastRepeatIndex>=0?h:$e.width,je,{x:J.x+I,y:J.y,width:at.width,height:A.height},0,we,Ue)),Xe+=at.width}};T?se(T,0,{x:0,y:0,...A},S.lines[0].baseline,re,!0,null,oe):S.visitLines({visitTextLine:(ne,ae,ue)=>{const we=ne.runs[0].text.replace(/\s+$/,""),He=ae===ue-1;let Me=re===d.ITextFrame.HorizontalAlignment.Justify&&(He||ne.runs[0].text.endsWith(`
|
|
8
|
+
`))?d.ITextFrame.HorizontalAlignment.Left:re,Te=0;ae>0&&(U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||U.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Te=Math.max(0,(R-(ie+3)-ne.bounds.height*ue)/(ue-1)*ae)),U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&le&&le%90==0&&le%180!=0&&(Me=d.ITextFrame.HorizontalAlignment.Distributed),Me!==d.ITextFrame.HorizontalAlignment.Justify&&Me!==d.ITextFrame.HorizontalAlignment.Distributed&&Me!==d.ITextFrame.HorizontalAlignment.Fill||(A={...A,width:h});let Ue=te||N&&(N.repeatChars.length>0||N.spacingChars.length>0)?A.width:ne.bounds.width;const _e={...ne.bounds,y:ne.bounds.y+Te+0,width:Ue};se(we,ae,_e,Ce.lines[0].baseline,Me,He,ue===1?Q:null,je&&ae>0?{...oe,style:{...oe.style,background:void 0}}:oe)}})}G.length>0&&(he=G)}if(je)return he&&he.length>0?he:c.jsx("div",{style:ee,...V});let ke=x?"auto":xe.pointerEvents,Ne=null;if(Be){const Fe={x:O*m-1,y:-1,width:q*m+1,height:R*m+1};ke="auto",Ne=W({renderBounds:Fe,darkMode:H,className:"filter-button",disabled:!p.isEditAllowed(),zoom:m,filter:p.getColumnFilter(),onFilterButtonMouseDown:E,...z}),Ne&&(Ne=c.jsx("div",{style:{...Fe,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:A=>{A.stopPropagation(),A.preventDefault()},children:Ne},"filterButton"))}be&&!he&&(he=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 Ae=[Re,he,a,We,C,Ne];return c.jsx("div",{style:{...ze,...xe,pointerEvents:ke},...V,children:Ae})},Po={text:"",placeholder:""},jo=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},Ml=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),Rr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:f,onDoneEdit:m,defaultTextStyle:s,useRichStyling:v=!0,bodyStyle:b,activeCoords:y,sheet:g,commands:k,containerBounds:x,setNaturalSize:E,onFocus:z,disabled:W,style:V,zoom:R=1,linesVisible:P,autoFocus:p=!1,...F}=e,{height:M=0,width:H=0}=x??{},N=b?.darkMode??!1,B=o.useRef(null),[$,ce]=o.useState(!1),[_,K]=o.useState(null),[L,I]=o.useState(()=>n);o.useEffect(()=>{ve.current=!1,I(n)},[n]);const q=o.useMemo(()=>{const A=L.clean();let J=A.getStyle();v||(J=J.createTemporaryStyle({font:{size:s?.fontSize}}));const j=A.getFormula(),G=J.getAlignment(),qe=j?d.ITextFrame.HorizontalAlignment.Left:G.getHorizontal(),Ce=G.getVertical(),h=G.getOverflow()===d.ITextFrame.Overflow.Wrap||A.getType()===d.ScalarType.String&&(qe===d.ITextFrame.HorizontalAlignment.Justify||qe===d.ITextFrame.HorizontalAlignment.Distributed||Ce===d.ITextFrame.VerticalAlignment.Justify||Ce===d.ITextFrame.VerticalAlignment.Distributed),w=(S=>{if(!S)return Po;const D=S.clean();if(!D)return Po;let oe=D.getStyle()?.getQuotePrefix();if(S.dirty===void 0||S.dirty===null){let fe="",se=D.getFormulaText();se&&(fe=se,oe=!1),fe||(fe=D.toTextUnformatted(!0)??"");let ne="";if(!S.editMode&&D.isSpillOverflow()){const ae=D.getSpill();if(ae){const ue=ae.getCell(),we=ue.getFormulaText();ue.isEqual(D)||(ne=we)}}return oe&&(fe="'"+fe),{text:fe,placeholder:ne}}return{text:S.dirty??"",placeholder:""}})(L),T=w.text,u=d.ITextFrame.toCSSHorizontalTextAlign(v&&!j?L.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:J,isWrapped:h,textValue:T,formula:j,frameVertAlign:Ce,placeholder:w.placeholder,insets:v?A.getInsets():me.TypesUtils.EmptyRect,textAlign:u}},[L,s,N,R,v]),O=o.useRef(null),Q=r.useImperativeElement(t,()=>({startEdit:A=>{B.current=A?.initialSelection;const J={...n,editMode:A?.editMode??!1};A?.text!==void 0&&(J.dirty=A.text),J.editMode===n.editMode&&J.dirty===n.dirty||(I(J),he?.(J))},submitEdit:()=>Re(),cancelEdit(){We()},autoFocus(){O.current.focus()},dispatchEvent:A=>O.current.dispatchEvent(A),focus(){O.current.focus()},getLineHeight:be}),[i,n]);o.useLayoutEffect(()=>{if(!_||!$)return;const A=O.current;q.textValue,A&&A.setSelectionRange(_.start,_.end,_.direction)},[O.current,_,q.textValue]);const re=o.useMemo(()=>{const A=L?.clean(),J=q.style.createTemporaryTextFrame(q.textValue,A?.getType()===d.ScalarType.String),j=v?A.getInsets().right+A.getInsets().left:0;let G=null;return q.isWrapped&&(G={width:H-j}),J.layout(G)},[q,H,L,v]),be=r.useCallbackRef(()=>Math.ceil(re?.lines[0]?.bounds.height),[re]);o.useLayoutEffect(()=>{if(!re)return;const A=q.style,J=A.getInsets()??me.TypesUtils.EmptyRect,j=v?J.left+J.right:0,G=v?.04*A.getFont().getSize():1,qe=Math.round(q.isWrapped?void 0:re.bounds.width+j+G),Ce=Math.round(re.bounds.height);E?.({width:qe,height:Ce})},[re,E,q,v,L]);const he=r.useCallbackRef(a,[a]),ze=r.useCallbackRef(A=>{if(L.dirty===A)return;const J={...L};J.dirty=A,O.current,I(J),he?.(J)},[L]),Pe=r.useCallbackRef(A=>{if(L.editMode===A)return;const J={...L};J.editMode=A,I(J),he?.(J)},[L]),ve=o.useRef(!1),Re=r.useCallbackRef(()=>{if(ve.current)return!1;try{l?.(L),m?.(),ve.current=!0}catch{return!1}return!0},[l,L]),We=r.useCallbackRef(()=>{ve.current=!0,I(n),f?.(),m?.()},[f,n]),Y=r.useCallbackRef(A=>{if(!O.current)return;if(A.key,A.isDefaultPrevented(),!(A.isTrusted||A.nativeEvent.ctrlKey||A.nativeEvent.metaKey||A.nativeEvent.altKey||A.nativeEvent.isComposing||ht.STANDARD_KEY_CHARS.indexOf(A.nativeEvent.key)===-1&&A.nativeEvent.key!=="Backspace")){const w={...L};let T=0;return jo(w,w.dirty)&&!isNaN(parseFloat(A.key))?(w.dirty?.endsWith("%")?w.dirty=(w.dirty.substring(0,w.dirty.length-1)??"")+A.key+"%":w.dirty=(w.dirty??"")+A.key+"%",T=w.dirty.length-1):A.nativeEvent.key==="Backspace"?(w.dirty="",T=w.dirty.length):(w.dirty=(w.dirty??"")+A.key,T=w.dirty.length),O.current.value=w?.dirty,B.current={start:T,end:T,direction:"forward"},O.current?.setSelectionRange(T,T,"forward"),I(w),he?.(w),void A.preventDefault()}const J=A.nativeEvent.ctrlKey,j=A.nativeEvent.shiftKey,G=A.nativeEvent.altKey,qe=A.nativeEvent.metaKey;if(J&&A.key==="z"&&A.stopPropagation(),A.which===r.KeyCodes.Escape)return A.preventDefault(),void We();if(A.which===r.KeyCodes.F2)return Pe(!0),void A.preventDefault();const Ce=A.target;if(A.key==="%"&&Ce.selectionStart===Ce.selectionEnd&&Ce.value[Ce.selectionStart]==="%"&&L?.clean().getStyle().numberFormat.includes("%"))return K({start:Ce.selectionStart+1,end:Ce.selectionEnd+1,direction:Ce.selectionDirection}),void A.preventDefault();if(A.which===r.KeyCodes.Enter){if(A.preventDefault(),qe||G){const w=q.textValue.substring(0,Ce.selectionStart)+`
|
|
9
|
+
`+q.textValue.substring(Ce.selectionEnd);return ze(w),void K({start:Ce.selectionStart+1,end:Ce.selectionStart+1,direction:Ce.selectionDirection})}return void(Re()&&g.getSelection().traverse(d.IRange.Orientation.Column,j))}if(A.which===r.KeyCodes.Tab)return A.preventDefault(),void(Re()&&g.getSelection().traverse(d.IRange.Orientation.Row,j));let h=null;switch(A.which){case r.KeyCodes.Left:h=d.IRange.Direction.Left;break;case r.KeyCodes.Right:h=d.IRange.Direction.Right;break;case r.KeyCodes.Up:h=d.IRange.Direction.Up;break;case r.KeyCodes.Down:h=d.IRange.Direction.Down}if(h&&!(J||j||G||qe)&&!L.editMode)return void Re();L.editMode&&(h||Ml.includes(A.which))&&A.stopPropagation()},[L,g,q]),Z=o.useCallback(()=>{O.current?.focus(),setTimeout(()=>{O.current?.select()},0)},[]),de=o.useCallback(()=>{O.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Ie=r.useCallbackRef(()=>{const A=O.current?.value;let J="";if(y.rowIndex>0){const j=g.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();j&&(J=j.toTextUnformatted(!0))}ze(A+J)},[y,g]);o.useEffect(()=>g.getRange(y).addListener(()=>{const A={...L,clean:()=>g.getRange(y).getCell()};I(A),he?.(A)}),[y,g,L]);const ye=o.useCallback(()=>{const A=L.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();ze((O.current?.value??"")+A)},[g]),U=o.useCallback(()=>{const A=L.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();ze((O.current?.value??"")+A)},[g]),te=o.useMemo(()=>({element:()=>O.current,doCopy:A=>{const J=O.current.value.substring(O.current.selectionStart,O.current.selectionEnd);if(A?.isCut){const j=O.current.value.substring(0,O.current.selectionStart)+O.current.value.substring(O.current.selectionEnd,O.current.value.length);ze(j)}return J}}),[O.current]),ge=o.useMemo(()=>({element:()=>O.current,doPaste:async(A,J)=>{const j=await A.toText?.();if(!j)return!0;const G=O.current.value.substring(0,O.current.selectionStart)+j+O.current.value.substring(O.current.selectionEnd,O.current.value.length);return ze(G),K({start:O.current.selectionStart+j.length,end:O.current.selectionStart+j.length,direction:"forward"}),!0}}),[O.current]),le=o.useMemo(()=>({contains:A=>O.current?.contains(A)||!1,focus(){O.current.focus()}}),[]),Ee=o.useMemo(()=>[new r.SimpleCommand("selectAll",le,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},Z),new r.SimpleCommand("startEditValueAbove",le,{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]}]},Ie),new r.SimpleCommand("startEditCurrentTime",le,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},ye),new r.SimpleCommand("startEditCurrentDate",le,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},U),new r.Command("relativeReferencesToggle",le,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},de),new r.Command("toggleEditorFocus",le,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ie=o.useMemo(()=>{let A=null;const J=()=>({contains:j=>O.current?.contains(j)||!1,focus(){O.current.focus()}});return A=k?k.createChildGroup(J,"editor",!1):new r.CommandGroup(J,"editor"),A.addCommands(Ee,!0),A},[k,Ee]),pe=o.useMemo(()=>({notifier:null,source:te,target:ge,commands:ie}),[te,ge,ie]);r.useCopyPaste(pe);const[De,xe]=o.useState(!p);o.useEffect(()=>{xe(!1)},[]);const Oe=r.useCallbackRef(A=>{ce(!0),ie?.activate();const J=B.current;if(J!==!1){let j,G;const qe=O.current.value;jo(L,qe)&&(j=qe.length-1,G=qe.length-1),j=J?.start??j??qe.length,G=J?.end??G??qe.length,B.current=!1,K({start:j,end:G,direction:"forward"})}z?.(A)},[z,L]),Be=q.insets;let C=Be.left+1;const je=Be.left+Be.right+2-1,tt=re?.bounds.height??0;let ee,ke=Be.top;q.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?ke=Math.max(0,(M-(Be.top+Be.bottom)-tt)/2):q.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(ke=Math.max(0,M-(Be.top+Be.bottom)-tt)),P!==void 0&&re?.lines[0]?.bounds&&(ee=re?.lines[0]?.bounds.height*P);const Ne=q.style.getFont();let Ae=Ne.getSize();Ne.isSuperSub()&&(Ae*=Ne.getSuperSubScale()),Ae*=d.IFont.getDeviceScale()*R;const Fe=v?Ne.toCSS(N,R):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:A=>{O.current&&document.activeElement!==O.current&&requestAnimationFrame(()=>{O.current.focus()})},ref:Q,...F,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...V},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ke*R,left:C*R,width:`calc(100% - ${je*R}px)`,maxWidth:`calc(100% - ${je*R}px)`,height:(ee??tt)*R,maxHeight:(ee??tt)*R},children:c.jsx("textarea",{spellCheck:"false",placeholder:q.placeholder,ref:O,value:q.textValue,disabled:De,readOnly:W||g.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Fe,fontSize:Ae?`${Ae}px`:"inherit",textAlign:q.textAlign,lineHeight:(re?.lines[0]?.bounds.height??0)*R+"px",height:(re?.bounds.height??0)*R,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:q.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Oe,onBlur:()=>{ce(!1)},onSelect:A=>{},onChange:A=>{O.current&&!ve.current&&(B.current=!1,ze(A.target.value),q.textValue,A.target.value,A.target.selectionStart,A.target.selectionEnd,A.target.selectionDirection,K({start:A.target.selectionStart,end:A.target.selectionEnd,direction:A.target.selectionDirection}))},onMouseDown:A=>{$&&Pe(!0)},onKeyDown:Y})})})})),kr=(e,t)=>({clean:e,dirty:t,editMode:!1}),Mr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:f=!1,offsetX:m=0,offsetY:s=0,isVertical:v=!1,...b}=e,y=V=>{let R=null;if(V&&n>0){R="";for(let P=0;P<V.length;P++)R+=V[P],P<V.length-1&&(R+=",")}return R},g=y(i);let k=g;a&&(k=y(a));let x=n,E=t,z=null;if(l){x=Math.floor(n/2);const V=x+x/2+1;let R=null;R=v?`M ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+V)}`,z=c.jsx("path",{strokeWidth:x,strokeDasharray:k,d:R,...b})}if(f){x=n/2;const V=x+x/2;let R=k,P=null;P=v?`M ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+V)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+V)}`,z=c.jsx("path",{strokeWidth:x,strokeDasharray:R,strokeDashoffset:"1",shapeRendering:"crispEdges",d:P,...b})}let W=null;return W=v?`M ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(s+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(s+x/2)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(s+x/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:x,strokeDasharray:g,d:W,...b}),z]})};function ao(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Qt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ao(i,t),l=typeof a=="function";n.push(l?a:()=>ao(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ao(n,t)}},Tl=function(){},Tr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Il=Tr?o.useLayoutEffect:o.useEffect,Oo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Vt=Tr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Oo),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var s=m[0].contentRect,v=s.x,b=s.y,y=s.width,g=s.height,k=s.top,x=s.left,E=s.bottom,z=s.right;l({x:v,y:b,width:y,height:g,top:k,left:x,bottom:E,right:z})}})},[]);return Il(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[Tl,Oo]},El=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Fl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Al=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:m=!1,isVertical:s=!1,intersections:v,layout:b}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const g=n[0],k=n[1],x=n[2],E=n[3];let z=1+(s?E-k:x-g),W=0;const V=a.getColor().toRGBA(l).toString(),R=y.description.toLowerCase().includes("double");let P,p;const F=s?"rowStart":"colStart",M=s?"rowEnd":"colEnd",H=s?k:g;if(v?.length>0){const ce=v[0];if(ce?.range[F]===i[F]){const K=d.IBorder.BuiltInDefinitions.get(ce.stroke.getStyle());W=Math.floor(K.width/2)}if(v[v.length-1]?.range[M]===i[M]){const K=d.IBorder.BuiltInDefinitions.get(v[v.length-1].stroke.getStyle());z=Math.floor(z+(K.width===2?0:K.width/2))}if(R){const K=s?"colStart":"rowStart",L=s?"colEnd":"rowEnd",I=s?b?.getRowOffset:b?.getColOffset;let q=0,O=0;P=[],p=[];const Q=v.length;for(let re=0;re<Q;re++){const be=v[re];if(be.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&I){const he=I(be.range[F])-(H-W);be.range[K]<i[K]&&(P.push(he-q),q=he,P.push(1),q++),be.range[L]>i[L]&&(p.push(he-O),O=he,p.push(1),O++)}}P.length>0&&q<z&&P.push(z-q),p.length>0&&O<z&&p.push(z-O)}}let N=s?-Math.floor(y.width/2):-W,B=s?-W:-Math.floor(y.width/2);const $=m&&y.width>2?-1:0;return c.jsx(Mr,{offsetX:g+N+$,offsetY:k+B+$,length:z+W,isVertical:s,stroke:V,width:y.width,dashArray:P??y.pattern,dashArrayAdditional:p,isDouble:R,isAngled:y.description.toLowerCase().includes("slant")},t)},xo=({getBorderAt:e,borderRenderer:t=Al,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>v=>{const b=v.toClipBounds(v.getRangeCoordsBounds(),-3);if(!b)return;const y=m(v);if(y.length===0)return;const g=v.getVisibleColumnOffsets(),k=v.getVisibleRowOffsets();let x=[],E=[];const z=v.getVisibleColumns(),W=v.getVisibleRows(),V=[],R=[],P=[],p=(_,K,L,I,q,O,Q)=>{const re={index:I,stroke:q,visibleIndex:L,edge:O,length:Q};_[K]||(_[K]=[]),_[K].length>0&&_[K][_[K].length-1]?.index===I?_[K][_[K].length-1]=re:_[K].push(re)},F=v.getVisibleRangeCoords(),M=y.length;for(let _=0;_<M;_++){const K=y[_],L=K.coords;if(!L)continue;const I=K?.range??{rowStart:L.rowIndex,colStart:L.colIndex,rowEnd:L.rowIndex,colEnd:L.colIndex};if(!me.CoordUtils.isRangesIntersect(I,F)&&!me.CoordUtils.isRangeWithinRange(I,F))continue;const q=L.colIndex,O=L.rowIndex,Q=g[q],re=k[O];if(I.rowEnd!==I.rowStart){const Ie=k[I.rowStart]?.spanIndex??-1,ye=k[I.rowEnd]?.spanIndex??k[W[W.length-1]].spanIndex+1;x.push({...I,rowStart:Ie,rowEnd:ye})}if(I.colEnd!==I.colStart){const Ie=g[I.colStart]?.spanIndex??-1,ye=g[I.colEnd]?.spanIndex??g[z[z.length-1]].spanIndex+1;E.push({...I,colStart:Ie,colEnd:ye})}const be=K.value,he=e(be,_);if(!he||he.isEmpty())continue;const ze=he.getLeft(),Pe=he.getTop(),ve=he.getRight(),Re=he.getBottom();let We=1,Y=1;if(!Q||!re)continue;const Z=Q.spanIndex,de=re.spanIndex;ze.isNone()||p(V,Z,de,O,ze,d.IBorder.Edge.Left,We),Pe.isNone()||p(R,de,Z,q,Pe,d.IBorder.Edge.Top,Y),ve.isNone()||p(V,Z+Y,de,O,ve,d.IBorder.Edge.Right,We),Re.isNone()||p(R,de+We,Z,q,Re,d.IBorder.Edge.Bottom,Y)}const H=(_,K,L)=>{const I=[];return _.forEach((q,O)=>{let Q=null;q.sort((be,he)=>be.visibleIndex-he.visibleIndex);const re=q.length;for(let be=0;be<re;be++){const he=q[be];if(!he?.stroke||K[O]===void 0&&K[O-1]===void 0)continue;let ze=!1;if(L){const We=x.length;for(let Y=0;!ze&&Y<We;Y++){let Z=x[Y];Z.colStart<=he.index&&Z.colEnd>=he.index&&Z.rowStart<O&&Z.rowEnd>=O&&(ze=!0)}}else{const We=E.length;for(let Y=0;!ze&&Y<We;Y++){let Z=E[Y];Z.rowStart<=he.index&&Z.rowEnd>=he.index&&Z.colStart<O&&Z.colEnd>=O&&(ze=!0)}}if(ze)continue;const Pe=he.stroke?.getColor(),ve=Pe?Pe.toRGBA().toString():l,Re=he.stroke.getStyle()+":"+ve;(Re!==Q?.key||Q&&Q.visibleIndex+1<he.visibleIndex)&&(Q&&I.push(Q),Q={key:Re,index:K[O]??K[O-1]+1,visibleIndex:he.visibleIndex,edge:he.edge,stroke:he.stroke,from:he.index,to:he.index+he.length-1,intersections:[],length:1}),Q.to=he.index+he.length-1,Q.visibleIndex=he.visibleIndex}Q&&I.push(Q)}),I};x=x.sort(Fl),E=E.sort(El);const N=H(V,z,!1),B=H(R,W,!0);if(N.length===0&&B.length===0)return null;const $=B.length;for(let _=0;_<$;_++){const K=B[_];let L=me.CommonUtils.findEqualOrGreater(N,K.from,q=>q.index),I=!1;for(;!I;){const q=N[L++];q&&q.index>=K.from&&q.index<=K.to+1&&q.from<=K.index&&q.to+1>=K.index&&(K.intersections.push({stroke:q.stroke,range:{rowStart:q.from,rowEnd:q.to+1,colStart:q.index,colEnd:q.index}}),q.intersections.push({stroke:K.stroke,range:{rowStart:K.index,rowEnd:K.index,colStart:K.from,colEnd:K.to+1}})),I=!q||q.index>K.to+1}}for(let _=0;_<$;_++){const K=B[_];let L=K.stroke;const I=`rBorder:${K.index}:${K.from}:${K.to}:${K.edge}`,q={rowStart:K.index,rowEnd:K.index,colStart:K.from,colEnd:K.to+1},O=v.getLayout(),Q=!1,re=O.getColOffset(q.colStart),be=O.getRowOffset(q.rowStart),he=[re,be,O.getColOffset(q.colEnd),be];P.push(t({key:I,points:he,stroke:L,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:q,intersections:K.intersections,layout:O,isVertical:Q}))}const ce=N.length;for(let _=0;_<ce;_++){const K=N[_];let L=K.stroke;const I=`cBorder:${K.index}:${K.from}:${K.to}:${K.edge}`,q={rowStart:K.from,rowEnd:K.to+1,colStart:K.index,colEnd:K.index},O=v.getLayout(),Q=!0,re=O.getColOffset(q.colStart),be=[re,O.getRowOffset(q.rowStart),re,O.getRowOffset(q.rowEnd)];P.push(t({key:I,stroke:L,points:be,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:q,intersections:K.intersections,layout:O,isVertical:Q}))}return c.jsx("svg",{width:`${b.width}`,height:`${b.height}`,viewBox:`0 0 ${b.width} ${b.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${b.width}px`,height:`${b.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:P},"borders")},[e,i])}},Bo=me.AnchorLocation.Center,Dl=Object.freeze({horizontal:!1,vertical:!1}),Ho=me.TypesUtils.EmptyTopLeft,zl=(e,t)=>me.CoordUtils.EmptyCell,Nl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Ll=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:m,forceThinBorder:s,children:v,...b}=e,y=o.useRef(null),[g,{width:k,height:x}]=Vt(),E=n??k,z=i??x,W=o.useMemo(()=>{const L=[];for(let I=0;I<l;I++)for(let q=0;q<f;q++){const O={colIndex:q,rowIndex:I};L.push({coords:O,value:O})}return L},[]),V=o.useCallback(L=>W,[W]),{overlay:R}=xo({getVisibleCells:V,getBorderAt:t,darkMode:m,forceThinBorder:s}),P=Math.floor(E/f),p=Math.floor(z/l),F={getColOffset:L=>Math.ceil(L*P)+0,getRowOffset:L=>Math.ceil(L*p)+0,getColIndex:L=>Math.floor((L-0)/P)-1,getRowIndex:L=>Math.floor((L-0)/p)-1},M={rowStart:0,colStart:0,rowEnd:l,colEnd:f},H={x:0,y:0,width:Math.max(0,E)+0,height:Math.max(0,z)+0},N=o.useMemo(()=>{const L={},I=Math.floor(E/f);for(let q=0;q<f;q++)L[q]={offset:q*I,size:I,spanIndex:q};return L},[E,z]),B=o.useMemo(()=>{const L={},I=Math.floor(z/l);for(let q=0;q<l;q++)L[q]={offset:q*I,size:I,spanIndex:q};return L},[E,z]);if(!R)return null;const $={width:E,height:z},ce={width:E,height:z},_={getStage:()=>y.current,getTotalSize:()=>$,getViewportSize:()=>ce,getLayout:()=>F,getCellCoordsAsRangeCoords:me.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const L=[];for(let I=0;I<l;I++)L.push(I);return L},getTotalRangeCoords:()=>M,getRelativePointFromClient:(L,I)=>({x:L,y:I}),getVisibleColumns:()=>{const L=[];for(let I=0;I<f;I++)L.push(I);return L},toClipBounds:(L,I)=>H,toViewBounds:L=>L,toAbsoluteBounds:L=>L,getBounds:()=>H,getInsets:()=>null,getRangeCoordsBounds:(L,I)=>null,getVisibleColumnOffsets:()=>N,getVisibleRowOffsets:()=>B,allViews:()=>({[Bo]:_}),getAnchor:()=>Bo,getZoom:()=>1,scrollCellCoordsIntoView:Nl,getCellCoordsFromClient:zl,getScrollOrientation:()=>Dl,getScrollTopLeft:()=>Ho,getFreezeTopLeft:()=>Ho},K=R(_);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...b,children:[c.jsx("div",{ref:Qt([y,g]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:v}),K]})});function Ir(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=Ir(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function dt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ir(e))&&(i&&(i+=" "),i+=t);return i}const Pl="_sheetxl-sheet_1qeq6_5",jl="_viewport-overlay_1qeq6_6",Er=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"})]})},Ol=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...m}=e??{},[s,v]=o.useState(null);o.useEffect(()=>{(async()=>{const p=await d.LicenseManager.getDetails();v(p)})()},[]);const[b,y]=o.useState(!1),g={opacity:.65},k=o.useMemo(()=>{const p=s?.getExceptions(),F=p?.length??0;if(F===0)return null;const M=[];for(let H=0;H<F;H++){const N=p[H];M.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:N},H))}return M},[s,n]);if(s===null||s.isValidFor(l))return null;const x=s.getType(),E=!k&&x.endsWith("ity"),z=s.getLicensee(),W=E?1.6:1,V=135/W,R=37/W;let P=null;return!x&&z?.length>0&&(P=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:z})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[b?c.jsx(Er,{style:g}):c.jsx("svg",{width:V,height:R,style:g,children:c.jsx("image",{style:{width:V,height:R},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),c.jsxs("div",{children:[P,k,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),et=(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),f={},m=l.length;for(let v=0;v<m;v++){const b=l[v];f[b]=(y,g)=>{i.current[b]?.(y,g)}}const s=e.addListeners(f,n);if(a)for(let v=0;v<m;v++)f[l[v]](e);return()=>{s?.()}},[e])},Ln=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){const n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw new Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,e)}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw new Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return me.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const i=n.contributionPoints;if(i&&i.length!==0)for(let a of i)a.startsWith(e)&&t.push(n)}return t}},Fr=o.createContext(void 0),Bl={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},Ar=()=>o.useContext(Fr)||Bl,Yt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},qo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:m,style:s,className:v,...b}=e,y=o.useMemo(()=>dt("taskpane-title",v,Yt.TaskPaneTitle,{focused:m}),[v,m]);return c.jsxs("div",{ref:t,className:y,style:s,...b,children:[c.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),c.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:g=>{g.stopPropagation()},onPointerUp:()=>{l()},children:c.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));qo.displayName="TaskPaneTitle";const Hl=(e,t)=>c.jsx(qo,{...e,ref:t}),Vl=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:m,onMounted:s,onUnmounted:v,paneWrapper:b,paneProps:y,renderTaskPanelTitle:g=Hl,style:k,className:x,...E}=e,[z,W]=o.useState(null),[V,R]=o.useState(!1),P=r.useCallbackRef(a,[a]),p=o.useRef(null),F=o.useRef(null);o.useEffect(()=>(s?.(i),()=>{v?.(i)}),[i]);const M=o.useRef([]),H=o.useMemo(()=>({addListener:$=>{const ce=l($);return M.current.push(ce),ce},close:()=>{P?.()},focus:$=>{p.current?.focus($)}}),[l]);o.useEffect(()=>()=>{for(const $ of M.current)$();M.current=[]},[]);const N=o.useMemo(()=>(i.renderTaskPanelTitle??g)({title:i.getTitle(),icon:null,readOnly:!1,focused:V,onClose:P,onPointerDown:$=>{}},F),[i,V]),B=o.useMemo(()=>{let $=i.renderTaskPane({entryKey:i.key,model:f,commands:m,frame:H,...y},t);return b&&($=b($)),$},[i,f,m,t]);return c.jsxs("div",{className:dt("taskpane-frame",x,Yt.TaskPaneFrame),tabIndex:0,ref:p,style:k,onPointerDown:async $=>{$.currentTarget.focus()},onFocus:$=>{$.relatedTarget&&!z&&W($.relatedTarget),R(!0)},onBlur:$=>{z&&!p?.current?.contains($.relatedTarget)&&W(null),$.relatedTarget&&R(!1)},...E,children:[c.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:N}),c.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:B})]})})),So=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:m=Ln,style:s,className:v,...b}=e,y=o.useMemo(()=>a.map(x=>{const E=m.getRegisteredTaskPane(x);if(!E)return null;let z=E.getIcon?.();z&&(typeof z=="string"&&(z=c.jsx(r.DynamicIcon,{iconKey:z})),z=c.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:z}));const W=x===f;return c.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:dt("taskpane-strip-item",Yt.TaskPaneStripItem,{selected:W}),onClick:()=>e.onSelect(x),children:[z,E.getTitle()]},x)}),[a,f,l,m]),g=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),k=o.useMemo(()=>dt("taskpane-strip",v,Yt.TaskPaneStrip),[v]);return c.jsx("div",{ref:g,className:k,style:s,...b,children:y})}));So.displayName="TaskPaneStrip";const Ul=(e,t)=>c.jsx(So,{ref:t,...e}),Kl=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=Ln,model:a,commands:l,onOpen:f,onClose:m,paneWrapper:s,paneProps:v,frameWrapper:b,frameProps:y,renderTaskPanelTitle:g,renderTaskPaneStrip:k=Ul,alwaysShowStrip:x,style:E}=e,z=r.useCallbackRef(f,[f]),W=r.useCallbackRef(m,[m]),[V,R]=o.useState(null),P=o.useRef(null),[p,F]=o.useState([]),M=o.useRef(new Set),H=r.useCallbackRef(async(L,I=!1)=>{const q=Array.from(M.current),O=q.length;let Q=!0;for(let re=0;Q&&re<O;re++){const be=q[re];if(be.onBeforeHide)try{await Promise.resolve(be.onBeforeHide())===!1&&(Q=!1)}catch{Q=!1}}return Q},[]),N=r.useCallbackRef(L=>{const I=Array.from(M.current),q=I.length;F(O=>{const Q=O.findIndex(be=>be.key===L);if(Q===-1)return O;const re=[...O];return re.splice(Q,1),re.length===0?(R(null),W?.(),re):(B(re[Math.max(re.length-1,Q-1)].key),re)});for(let O=0;O<q;O++){const Q=I[O];try{Q.onHide?.()}catch{}}},[W]),B=r.useCallbackRef(async L=>{const I=i.getRegisteredTaskPane(L);if(!I)return void console.warn(`Invalid taskpane '${L}'`);if(P.current===L||V&&!await H(V.key))return;const q=o.createRef();let O=c.jsx(Vl,{ref:()=>{P.current=null},entry:I,model:a,commands:l,close:async()=>{await H(L)&&N(L)},paneWrapper:s,paneProps:v,renderTaskPanelTitle:g,listenerContainer:re=>(M.current.add(re),()=>{M.current.delete(re)}),onMounted:re=>{re.key===L&&(P.current=null),z?.()},onUnmounted:re=>{},...y});b&&(O=b(O));const Q={key:L,elem:O,ref:q};F(re=>{if(re.findIndex(he=>he.key===L)!==-1)return re;const be=[...re];return be.push(Q),be}),R(Q),P.current=L},[V,b,s,g]);o.useEffect(()=>{V&&!P.current&&B(V.key)},[y,a]);const $=r.useImperativeElement(t,()=>({activateTaskPane:B}),[i,v,a,l]),ce=o.useMemo(()=>p.map(L=>L.key),[p]),_=o.useMemo(()=>{if(ce.length<=1&&!x)return null;const L={className:Yt.TaskPaneAreaStrip,taskPanes:ce,selected:V?.key,onSelect:I=>{B(I)},registry:i};return k(L,null)},[ce,V,i,x]),K=V?.elem;return c.jsxs("div",{ref:$,className:dt("taskpane-area",n,Yt.TaskPaneArea),style:E,children:[K,_]})})),In=new d.Color("transparent");function Dr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:m}=e,s=r.useNotifier(),v=Ar(),[b,y]=o.useState(null),[g,k]=o.useState(null),x=o.useRef(null),E=r.useCallbackRef(f,[f]),z=r.useCallbackRef(m,[m]),W=o.useMemo(()=>({serializer:{parse:h=>h?t?.getStyles().parseColor(h):null,stringify:h=>h?h.toString():null}}),[t]),[V,R]=r.usePersistenceState("sheet.lastBorder",null),[P,p]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),W),[F,M]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),W),H=r.useEditMode();o.useRef(H.getMode()).current=H.getMode();const N=r.useGlobalClipboard(),[B,$]=o.useState(me.CommonUtils.EmptyArray),ce=o.useCallback(()=>{if(x.current!==t)return;const h=t.getSelectedRanges();let w=null;B.length>0&&me.CoordUtils.isCellWithinRange(b,B[0].getRange().getCoords())&&(w=B[0]);const T=t?.getSelectedCell(),u=T?.getCoords()??null;Ht.unstable_batchedUpdates(()=>{he(w),y(u),k(h)})},[t,B,g,b]),_=o.useCallback(me.CommonUtils.debounce(ce,210),[ce]);o.useEffect(()=>{x.current=t,ce()},[t]);const K=r.useCallbackRef(()=>t.getRange(b).getCell(),[t,b]),L=r.useCallbackRef(async(h,w,T=null,u=!1,S=!0)=>{const D=h?.label?.(),oe=async()=>{const ae=await Promise.resolve(S&&s.showBusy(D??"Busy..."));try{await t.doBatch(async()=>w(t),D),u&&H.setMode(null),ae&&ae()}catch(ue){if(ae&&ae(),!ue)return;s.showError(ue)}},fe=[];let se=!1;const ne=async()=>(fe.push(oe),(async()=>{if(!se){for(se=!0;fe.length>0;){const ae=fe.shift();ae&&await ae()}se=!1}})());if(n){let ae=null;if(T!==!1&&h){const ue=T??D;ae=new r.SimpleCommand(h.key(),l,{label:ue,description:ue},ne)}n(ae)}return ne()},[t,n,s]),I=r.useCallbackRef((h,w,T=!1,u)=>(u||(u={autoSelect:!0,autoFit:!0}),L(h,S=>{const D=S.getSelectedRanges();T&&D.getStyle().update(null,u),D.getStyle().update(w,u)})),[t]),q=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRange().setHyperlink(w)})},[t]),O=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRange().setComments(w)})},[t]),Q=r.useCallbackRef((h,w)=>{L(h,T=>{T.getSelectedRanges().clear(w)})},[t]),re=r.useCallbackRef(async(h,w,T=!1,u=!1)=>L(h,async S=>{let D=S.getSelectedRanges();T&&(w===d.IRange.Orientation.Row?D=D.getEntireRows(u):w===d.IRange.Orientation.Column&&(D=D.getEntireColumns(u)));let oe=null;const fe=H.getMode()?.key;if(fe==="copy"||fe==="cut"){const se=await N.getClipboard().readReference();se&&se.getItemType()==="range"&&(oe=se.getItem(),oe.getCoords()||(oe=null))}if(oe){const se=await D.insertFrom(oe,{...oe.getMarkOptions(),orientation:w,autoSelect:!0});!se||se.isEntireRows()||se.isEntireColumns()||se.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),H.setMode(null)}else D.insert({orientation:w,autoSelect:!0})},"Insert Cells",!1),[H]),[be,he]=o.useState(null),ze=r.useCallbackRef(h=>t.getStyles().setDefaultTableStyle(h),[t]),Pe=r.useCallbackRef(h=>{t.getStyles().getTableStyle(h)?.delete()},[t]),ve=r.useCallbackRef((h,w)=>{L(h,async T=>{const u=T.getSelectedRange(),S=T.getSelectedCell().getCoords();let D=null,oe=0;const fe=S.rowIndex>0?T.getRange({rowIndex:S.rowIndex,colIndex:S.colIndex}).getExtended(d.IRange.Direction.Up):null;fe&&T.getRange({colStart:S.colIndex,rowStart:fe.getCoords().rowStart,colEnd:S.colIndex,rowEnd:fe.getCoords().rowStart}).isContentful()&&(D=d.IRange.Direction.Up,oe=S.rowIndex-fe.getCoords().rowEnd);const se=S.colIndex>0?T.getRange({rowIndex:S.rowIndex,colIndex:S.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(se&&T.getRange({colStart:se.getCoords().colStart,rowStart:S.rowIndex,colEnd:se.getCoords().colStart,rowEnd:S.rowIndex}).isContentful()){const ae=S.colIndex-se.getCoords().colEnd;(ae<oe||!D)&&(D=d.IRange.Direction.Left,oe=ae)}let ne=null;if(D===d.IRange.Direction.Up){if(ne={...fe.getCoords()},(ne.rowEnd===S.rowIndex||!T.getRange({colIndex:S.colIndex,rowIndex:S.rowIndex-1}).isContentful())&&ne.rowStart>0&&T.getRange({colIndex:S.colIndex,rowIndex:ne.rowStart-1}).isContentful()){const ae=fe.getExtended(d.IRange.Direction.Up);ne={colStart:S.colIndex,rowStart:ae.getCoords().rowStart,colEnd:S.colIndex,rowEnd:fe.getCoords().rowEnd}}ne.rowEnd=S.rowIndex-1}else if(D===d.IRange.Direction.Left){if(ne={...se.getCoords()},(ne.colEnd===S.colIndex||!T.getRange({colIndex:S.colIndex-1,rowIndex:S.rowIndex}).isContentful())&&ne.colStart>0&&T.getRange({colIndex:ne.colStart-1,rowIndex:S.rowIndex}).isContentful()){const ae=se.getExtended(d.IRange.Direction.Left);ne={colStart:ae.getCoords().colStart,rowStart:S.rowIndex,colEnd:ae.getCoords().colEnd,rowEnd:S.rowIndex}}ne.colEnd=S.colIndex-1}if(u.size!==1&&D){const ae=u.getCoords(),ue=u.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),we={...ne},He=ae.rowStart,Me=ae.rowEnd,Te=ae.colStart,Ue=ae.colEnd,_e=D===d.IRange.Direction.Up;for(let $e=Te;$e<=Ue;$e++){we.colStart=_e?$e:ne.colStart+($e-Te),we.colEnd=_e?$e:ne.colEnd+($e-Te);for(let Ye=He;Ye<=Me;Ye++){we.rowStart=_e?ne.rowStart+(Ye-He):Ye,we.rowEnd=_e?ne.rowEnd+(Ye-He):Ye;const Je=T.getRange(we).toString();ue.pushAt(Ye,$e,`=${w}(${Je})`)}}ue.apply()}else{const ae=ne?T.getRange(ne).toString():"",ue=`=${w}(`;E?.({text:`${ue}${ae})`,editMode:!0,initialSelection:{start:ue.length,end:ue.length+ae.length}})}},!1)},[t]),Re=r.useCallbackRef((h,w,T=!1,u=!0)=>{L(h,async S=>{if(be)return void be.updateStyleOptions(w);const D=S.getSelectedRanges().getFixed(!0),oe=S.getSelectedRange().getDefaultSortCriteria(),fe={getNames:()=>S.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},se={ranges:D,hasHeader:oe?.options?.hasHeader??!1},ne=async ue=>{if(!(ue=await Promise.resolve(ue)))return null;const we=await Promise.resolve(s.showBusy(h.label()));try{await S.getTables().add(ue.ranges.at(0),{styleName:w?.name,clearFormatting:T,hasHeader:ue.hasHeader}).getRange().select(),we()}catch(He){we(),s.showError(He)}};if(!u)return void await ne(se);const ae={initialValue:se,context:()=>fe,onInput:ue=>{ne(ue)}};s.showWindow("tableNew",ae)},!1,!0,!1)},[be]),We=r.useCallbackRef(()=>i,[i]),Y=r.useCallbackRef(h=>({styles:()=>t.getStyles(),table:()=>h,bodyStyle:We,getNames:()=>t.getNames()}),[t]),Z=r.useCallbackRef(async(h,w,T,u=!0)=>{if(!w){let D=t.getSelectedRange();D.size===1&&(D=D.getSurrounding());let oe=t.getTables().getItems({address:t.getSelectedRange()});oe.length>0&&(w=oe[0]),await D.select()}if(!w)return;try{T&&await w.select()}catch{}if(!u)return;const S=new Promise(async(D,oe)=>{h.update({context:Y(w)}),v.activateTaskPane("tableDetails",{}),D(!0)});try{if(!await S)return}catch(D){s.showError(D)}},[s]),de=r.useCallbackRef(async(h,w,T=!1)=>{let u=null;if(w)w.isITable?u=w:w.getValue()&&(u=w.getValue());else{const S=t.getTables().getItems({address:t.getSelectedRange()});S.length>0&&(u=S[0])}if(u){if(!T){const S=u.getRange().getCoords(),D=(S.colEnd-S.colStart+1)*(S.rowEnd-S.rowStart+1);if(D>1e4&&await s.showOptions({title:"Confirm",description:`Converting a table to range with '${D}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
+
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}L(h,async()=>{T?u.delete():u.convertToRange()},!1,!0)}},[s]),Ie=r.useCallbackRef((h,w,T)=>{L(h,async u=>{const S=u.getSelectedRanges();if(S.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let D=S.at(0);D.size===1&&(D=D.getSurrounding());const oe=u.getSelection().getCoords().cell;let fe=D.getDefaultSortCriteria(d.IRange.Orientation.Row,oe);if(!fe){if(T)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}const se=async He=>{if(!(He=await Promise.resolve(He)))return;const Me=await Promise.resolve(s.showBusy(h.label()));try{D.doBatch(()=>{const Te={...He,...w};D.sort(Te),D.autoFit({orientations:Te?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},h?.label?.())}catch(Te){Me(),s.showError(Te)}Me()};let ne=fe.options;if(!T)return void await se(ne);let ae=D;ne.hasHeader&&(ae=D.getIntersect(fe.sortCoords)),ae.select();const ue={range:D,cell:oe},we={initialValue:ne,context:()=>ue,onInput:He=>{se(He)}};s.showWindow("sort",we)},!1,!1,!1)},[s]),ye=r.useCallbackRef(()=>{console.log("compactedSelection");const h=t.getSelection().getCoords(),w=t.getSelectedRanges().getFlattened().getCoords(),T=(D=>{const oe=new Blob([D],{type:"application/javascript"}),fe=URL.createObjectURL(oe),se=new Worker(fe);return URL.revokeObjectURL(fe),se})("console.log('hello from worker');");setTimeout(()=>{T.terminate(),console.log("Worker terminated")},5e3);let u=-1;for(let D=0;u===-1&&D<w.length;D++)me.CoordUtils.isCellWithinRange(h.cell,w[D])&&(u=D);if(me.CoordUtils.isEqualRangesArrays(h.ranges,w))return;const S={cell:h.cell,ranges:w,rangeIndex:u};t.getSelection().updateCoords(S)},[t]),U=r.useCallbackRef(()=>{console.log("selectComments")},[t]),te=r.useCallbackRef(async(h=!1,w=!1)=>{let T=null;if(w)T=t.getEntireRange();else{const u=t.getSelectedRange();if(u.isEntireRange()){const S=t.getSelection().getCoords().cell,D=t.getRange(S);T=D.getSurrounding(),T.isEntireRange()&&(T=D)}else T=u.getSurrounding({contentOnly:h})}T&&await T.select()},[t]),ge=r.useCallbackRef((h,w,T)=>{L(h,async u=>{let S=u.getSelectedRanges();T&&(w===d.IRange.Orientation.Row?S=S.getEntireRows():w===d.IRange.Orientation.Column&&(S=S.getEntireColumns())),S.delete(w)},"Delete Cells")},[t]);r.useCallbackRef(async h=>{let w=null;const T=z(),u=Math.min(T.width-8,480),S=Math.min(T.height-8,288);try{t.getSelectedRanges(),w=await t.getMovables().add({bounds:{x:T.left+(T.width-u)/2,y:T.top+(T.height-S)/2,width:u,height:S},type:"chart",json:h.template}),w.select(),H.setMode(null)}catch(D){s.showError(D)}return w},[t,s]);const le=r.useCallbackRef(async(h,w,T)=>{const u=await s.showBusy(h.label());try{const S=await t.getMovables().addImage(w,{autoSelect:!0,...T});return u(),H.setMode(null),S}catch(S){u();let D=S;typeof D!="string"&&(console.warn(S),D="Unable to resolve image."),s.showMessage(D,{type:r.NotifierType.Error})}},[t,s]),Ee=r.useCallbackRef((h,w)=>{L(h,async T=>{const u=T.getSelectedRanges();u.doBatch(()=>{const S=w===d.IRange.Direction.Up||w===d.IRange.Direction.Down,D=u.getCoords().slice().sort(me.CoordUtils.createRangeComparator(S?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let oe=0;oe<D.length;oe++){const fe=D[oe];let se=fe;const ne=T.getRange(se).getMerges();let ae=0,ue=0;if(ne.length>0){const we=ne[0];ae=we.rowEnd-we.rowStart,ue=we.colEnd-we.colStart}w===d.IRange.Direction.Left?se={...fe,colStart:fe.colEnd+ue}:w===d.IRange.Direction.Right?se={...fe,colEnd:fe.colStart+ue}:w===d.IRange.Direction.Up?se={...fe,rowStart:fe.rowEnd+ae}:w===d.IRange.Direction.Down&&(se={...fe,rowEnd:fe.rowStart+ae}),T.getRange(se).autoFill(fe,{filler:d.AutoFill.Types.Copy}),T.getRange(fe).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:h.label()})})},[s]),ie=r.useCallbackRef(()=>{let h=null;const w=t.getSelectedCell().getCoords();if(w?.rowIndex>0){const T=t.getRange({rowIndex:w.rowIndex-1,colIndex:w.colIndex}).getCell();T&&(h=T.toTextUnformatted(!0))}E?.({text:h})},[t]),[pe,De]=o.useReducer(h=>h+1,0),[xe,Oe]=o.useReducer(h=>h+1,0),Be=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.",icon:"FormulaView",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.",icon:"ViewZero"}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>U()),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]}]},(h=!1)=>te(!1,h)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>te(!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]}},()=>ye()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation.",icon:"TextRotation315"}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward.",icon:"TextRotation45"}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left.",icon:"TextRotation90"}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right.",icon:"TextRotation2702"}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward.",icon:"TextRotation315"}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle.",icon:"TextRotationCustom"}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically.",icon:"TextRotationVertical"}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){Ie(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){Ie(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.",icon:"SortCustom"},function(){Ie(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.`,icon:"Lock"}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),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.",icon:"PresetStyles"},function(h){I(this,{named:h.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.",icon:"PresetStyles"},function(h){Re(this,h)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(h){Re(this,h,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){Re(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."},ze),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Pe),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(h){I(this,{border:h})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(h){I(this,{fill:h})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(h){I(this,{font:{fill:h}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",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.",icon:"TextItalic",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.",icon:"TextUnderline",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.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",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.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),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.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),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.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),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.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,h=>({font:{size:d.FontUtils.findNextFontSize(h.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,h=>({font:{size:d.FontUtils.findNextFontSize(h.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(h){I(this,{font:{family:h}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(h){I(this,{font:{size:h}})}),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(h,w){const T=this,u={initialValue:h??w.state(),context:()=>w.context(),onInput:(S,D)=>{I(T,{numberFormat:S})}};s.showWindow("numberFormat",u)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(h){I(this,{numberFormat:h})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(this,{numberFormat:d.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(){I(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(){I(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(){I(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(h){I(this,{numberFormat:h??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){I(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(){I(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){I(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){I(this,h=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(h.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){I(this,h=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(h.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.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",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.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(h){h&&ve(this,h.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ve(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ve(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ve(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ve(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ve(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(){E?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),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(){E?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),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("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.",icon:"HyperlinkInset",context:()=>K,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(h,w){const T=this,u={context:w.context(),onInput:S=>{q(T,S)}};s.showWindow("hyperlink",u)}),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.",icon:"HyperlinkGoto",context:()=>K},async(h,w)=>{const T=w.context()();if(!T)return;const u=T.getHyperlink();if(u)try{await u.open()}catch(S){s.showError(S)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>K},function(h,w){q(this,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."},(h,w)=>{((T,u)=>{T?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[u," 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/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,w.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.",icon:"CommentInsert",context:()=>K},async function(h,w){const T=this,u={context:w.context(),onInput:S=>{O(T,S)}};s.showWindow("comments",u)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>K},function(h,w){O(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.",icon:"InsertImage"},async function(h=null){let w=null,T=null;typeof h=="string"?T=h:w=h?.file?h.file:h,(w||(w=await me.CommonUtils.openFileDialog(T??"image/*"),w))&&await le(this,{file:w},h?.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.",icon:"InsertImage"},async function(h){if(!h){const w=await s.showInput({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(w.option!=="Insert")return;h=w.input}h&&le(this,{fetch:h})}),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.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Re(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.",icon:"InsertTable"},function(h){let w=null,T=!1;h.isITable?w=h:h.getValue()&&(w=h.getValue(),T=!0),Z(this,w,T)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
12
12
|
|
|
13
|
-
The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(h){de(this,h,!0)}),new r.Command("convertTableToRange",
|
|
13
|
+
The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(h){de(this,h,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
|
|
14
14
|
|
|
15
|
-
The values and the formatting are preserved.`,icon:"InsertTable"},function(h){de(this,h,!1)}),new r.Command("tableTotalRowToggle",
|
|
15
|
+
The values and the formatting are preserved.`,icon:"InsertTable"},function(h){de(this,h,!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 h=this.context().table();h&&h.setShowTotals(!h.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const h=this.context().table();h&&h.setShowHeaders(!h.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const h=this.context().table();h&&h.setShowFilterButton(!h.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",icon:"FilterReapply",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..",icon:"FilterClear"}),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]}]},ie),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook.",icon:"FormatPaint.yellow"}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",icon:"InsertCells",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){re(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.",icon:"InsertCellsRight"},function(){re(this,d.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.",icon:"InsertCellsDown"},function(){return re(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position.",icon:"InsertRow"},function(){return re(this,d.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.",icon:"InsertColumn2"},function(){return re(this,d.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 re(this,d.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 re(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",icon:"DeleteCells",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return ge(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward.",icon:"DeleteCellsUp"},function(){return ge(this,d.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.",icon:"DeleteCellsLeft"},function(){return ge(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection.",icon:"DeleteRows"},function(){return ge(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection.",icon:"DeleteColumns"},function(){return ge(this,d.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.",icon:"FillDown",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Ee(this,d.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.",icon:"FillRight",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return Ee(this,d.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.",icon:"FillUp"},function(){return Ee(this,d.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.",icon:"FillLeft"},function(){return Ee(this,d.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 I(this,{border:{left:{style:d.IBorder.StrokeStyle.Thin,color:null},top:{style:d.IBorder.StrokeStyle.Thin,color:null},right:{style:d.IBorder.StrokeStyle.Thin,color:null},bottom:{style:d.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 I(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return I(this,h=>{const w=h.getAlignment().getIndent()-1;return{alignment:{indent:w>0?w:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return I(this,h=>{const w={alignment:{indent:h.getAlignment().getIndent()+1}};return h.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(w.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),w})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",icon:"MergeAll",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows.",icon:"MergeHorizontal"}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns.",icon:"MergeVertical"}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells.",icon:"MergeUnMerge"}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},icon:"ClearContents",description:`Clear only the contents in the cells.
|
|
16
16
|
|
|
17
|
-
The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){Q(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",
|
|
17
|
+
The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){Q(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},icon:"ClearFormats",description:"Clear only the formatting that is applied to the cells."},function(){Q(this,d.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",l,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){Q(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){Q(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},icon:"ClearAll",description:`Clears everything from the cells.
|
|
18
18
|
|
|
19
|
-
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){Q(this)}),new r.Command("freezeToggle",i,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",i,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",i,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",i,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",i,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("resizeRows",i,{label:"Resize Rows",description:"Resize the rows to the specified height.",icon:"RowsResize"}),new r.SimpleCommand("autoFitColumns",i,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"}),new r.SimpleCommand("resizeColumns",i,{label:"Resize Columns",description:"Resize the columns to the specified width.",icon:"ColumnsResize"})],[]),C=o.useMemo(()=>{let h=null;return h=a?a.createChildGroup(i,"sheet",!1):new r.CommandGroup(i,"sheet"),h.addCommands(He,!0),h},[a,He]),[je,nt]=o.useState(!1),[te,ke]=o.useState(!1);o.useEffect(()=>{if(x.current!==t||!g)return;const h=g.getCoords(),w=t.getTables().getItems({address:h[0]});W(oe=>he.CommonUtils.isEqualArrays(oe,w)?oe:w),b&&w[0]&&he.CoordUtils.isCellWithinRange(b,w[0].getRange().getCoords())?me(w[0]??null):me(null);const T=t.getSelectedRanges(),u=T.getMerges().length>0,S=T.isOverlapping();let D=!0;for(let oe=0;D&&oe<h.length;oe++)D=he.CoordUtils.isSingleCell(h[oe]);ke(S),nt(w.length===0&&!S&&(u||!D))},[xe,g,t]),r.useCommands(a,null,{onChange:()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=H.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:h||!a?.getCommand("copy"),state:()=>w}).updateCallback(()=>w?void H.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`}}))}},[H,pe,a]),tt(t.getView(),{onFreezeSplitChange:()=>{Be()}}),tt(t.getSelection(),{onChange:()=>{G()}});const Le=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:h=>{},darkMode:l.darkMode,autoColor:t.getStyles().parseColor(l.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:h=>t.getStyles().addRecentColor(h),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(h=>{t.setTabColor(h)}).update({state:()=>t?.getTabColor()??En,context:()=>({onColorSelect:h=>{},darkMode:l.darkMode,autoColor:En,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:h=>t.getStyles().addRecentColor(h),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Ae=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:h=>{R(h)},darkMode:l.darkMode,quickBorder:V,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:h=>t.getStyles().getNormal().createTemporaryStyle({border:h}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Ae()},[V]),o.useEffect(()=>{const h=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!K().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:h||!K().getHyperlink()});const w=K().getHyperlink()?"Edit":"Insert",T="Link";C.getCommand("updateHyperlink").update({label:()=>(K().getHyperlink(),`${w} ${T}`),icon:()=>w==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${w} ${T}…`,insert:`${T}…`,hyperlink:`${w}…`},disabled:h})},[K()?.getHyperlink(),pe]),o.useEffect(()=>{const h=K().getComments(),w=()=>h?"Edit":"Insert",T=()=>h?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${w()} ${T()}`,icon:()=>h?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${w()} ${T()}…`,insert:`${T()}…`}})},[K()?.getComments(),pe]),tt(t,{onViewChange:()=>{const h=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:h.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:h.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:h.isShowColumnGridlines()||h.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:h.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:h.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:h.isShowColumnHeaders()||h.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:h.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:h.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),Le()},onTabColorChange:()=>{Le()},onMergesChange:()=>{Be()},onMovablesChange:()=>{Be()},onTablesChange:()=>{Be()},onProtectionChange:()=>{Be(),De()},onStyleChange:()=>{Le(),Ae(),Be()}}),o.useEffect(()=>{Le(),Ae()},[l]),o.useEffect(()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=B.length>0&&!be||h,T=Y(be),u={context:T};C.getCommand("editTable").update(u),C.getCommand("deleteTable").update(u),C.getCommand("convertTableToRange").update(u);const S={context:T,disabled:w};C.getCommand("formatTableStyle").update({label:be?"Apply Table Style":"Format As Table",...S}),C.getCommand("formatTableStyleClearCellStyles").update(S),C.getCommand("deleteTableStyle").update(S),C.getCommand("convertTableToRange").update(S),C.getCommand("insertTable").update({disabled:w||B.length>0});const D={context:T,disabled:w||B.length===0};C.getCommand("tableHeaderRowToggle").update(D),C.getCommand("tableTotalRowToggle").update(D),C.getCommand("autoFilterToggle").update(D),C.getCommand("formatTableStyleClearTableStyle").update({...D,disabled:D.disabled||!be||be.getStyleOptions().name===null})},[be,B,pe]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const h=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!h,showRowGridlines:!h})}),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(h=>{t.getView().update({gridLineColor:h})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const h=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!h,showRowHeaders:!h})}),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 h=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:h?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:h?d.ISheetView.HeaderTextStyle.One:d.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()})}),C.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),C.getCommand("insertFunction").update({context:()=>({searchByCategory:async h=>{const w=t.getWorkbook();if(!w)return he.CommonUtils.EmptyArray;const T=await w.getScripts().searchFunctions({category:h,includeBuiltIn:!0});return T.sort((u,S)=>u.getName().localeCompare(S.getName())),T}})})},[t]),o.useEffect(()=>{const h=t.getView().getFreezePanes(),w=()=>h.coords.rowIndex!==0,T=()=>h.coords.colIndex!==0,u=()=>h.coords.rowIndex!==0||h.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{u()?t.getView().setFreezePanes(null):u()?T()?t.getView().setFreezePanes({coords:{rowIndex:b.rowIndex}}):w()&&t.getView().setFreezePanes({coords:{colIndex:b.colIndex}}):t.getView().setFreezePanes({coords:b})}).update({state:u,disabled:()=>!b||!u()&&b.rowIndex===0&&b.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:w()?0:b.rowIndex}})}).update({state:w,disabled:()=>!b||!w()&&b.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:T()?0:b.colIndex}})}).update({state:T,disabled:()=>!b||!T()&&b.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!u()})},[xe,b,t,l]);const Fe=K().getStyle(),A=Fe.getFont(),J=Fe.getAlignment(),j=J.getHorizontal(),_=J.getVertical(),qe=J.getOverflow(),ye=J.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>K().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:Ne=>t.createTemporaryCell(Ne)})}),C.getCommand("formatFillColor").update({state:()=>{let Ne=null;const Qe=Fe.getFill();return Qe?.getType()===d.IFill.Type.Solid?Ne=Qe.getColor():Qe?.getType()===d.IFill.Type.Gradient?Ne=Qe.getStops()?.[0]?.getColor():Qe?.getType()===d.IFill.Type.Pattern&&(Ne=Qe.getBackground()),Ne},icon:()=>c.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const Ne=t.getStyles();return{onColorSelect:Qe=>{p(Qe??En)},darkMode:l.darkMode,quickColor:P,autoColor:En,schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Qe=>Ne.addRecentColor(Qe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>A.toJSON()?.fill?A.getFill():null,icon:()=>c.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const Ne=t.getStyles();return{onColorSelect:Qe=>{M(Qe)},darkMode:l.darkMode,quickColor:F,autoColor:Ne.getNormal().getFont().getFill(),schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Qe=>Ne.addRecentColor(Qe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>Fe.getNumberFormat(),context:()=>K}),C.getCommand("formatNumberDialog").update({state:()=>Fe.getNumberFormat(),context:()=>K()}),C.getCommand("formatFontFamily").update({state:()=>A.getFamily()}),C.getCommand("formatFontSize").update({state:()=>A.getSize()});const h=function(){const Ne=A.getWeight()||0;return!isNaN(Ne)&&Ne>500};C.getCommand("formatBoldToggle").updateCallback(function(){I(this,{font:{weight:h()?400:700}})}).update({state:h});const w=function(){return A.getStyle()===d.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){I(this,{font:{style:w()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:w}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){I(this,{font:{strike:!A.getStrike()}})}).update({state:A.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){I(this,{font:{verticalAlign:A.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:A.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){I(this,{font:{verticalAlign:A.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:A.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const T=()=>qe===d.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){I(this,{alignment:{overflow:(T(),d.ITextFrame.Overflow.Visible)}})}).update({state:T});const u=()=>qe===d.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){I(this,{alignment:{overflow:u()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:u});const S=function(){return qe===d.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){I(this,{alignment:{overflow:S()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:S});const D=function(){return qe===d.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){I(this,{alignment:{overflow:D()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:D});const oe=function(){return qe===d.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){I(this,{alignment:{overflow:oe()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:oe,disabled:!0});const fe=function(){return _===d.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){I(this,{alignment:{vertical:fe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:fe});const se=function(){return _===d.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){I(this,{alignment:{vertical:se()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:se});const ne=function(){return _===d.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){I(this,{alignment:{vertical:(ne(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ne});const ae=function(){return _===d.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){I(this,{alignment:{vertical:ae()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:ae});const ue=function(){return _===d.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){I(this,{alignment:{vertical:ue()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ue});const Ce=function(){return j===d.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){I(this,{alignment:{horizontal:Ce()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:Ce});const Oe=function(){return j===d.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){I(this,{alignment:{horizontal:Oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:Oe});const Me=function(){return j===d.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Ne={alignment:{horizontal:Me()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};I(this,Ne)}).update({state:Me});const Te=function(){return j===d.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Ne={alignment:{horizontal:Te()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};I(this,Ne)}).update({state:Te});const $e=function(){return j===d.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){I(this,{alignment:{horizontal:$e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:$e});const We=function(){return j===d.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){I(this,{alignment:{horizontal:We()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:We});const _e=function(){return j===d.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){I(this,{alignment:{horizontal:_e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:_e});const Ye=!t.getProtection().isFormatCellsAllowed(),Je=j===d.ITextFrame.HorizontalAlignment.CenterContinuous||j===d.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Ne){I(this,{alignment:{rotation:0}})}).update({disabled:Ye||Je,state:ye===0}),C.getCommand("formatTextRotate45").updateCallback(function(Ne){I(this,{alignment:{rotation:Ne??1?45:0}})}).update({disabled:Ye||Je,state:ye===45}),C.getCommand("formatTextRotate90").updateCallback(function(Ne){I(this,{alignment:{rotation:Ne??1?90:0}})}).update({disabled:Ye||Je,state:ye===90}),C.getCommand("formatTextRotate270").updateCallback(function(Ne){I(this,{alignment:{rotation:Ne??1?270:0}})}).update({disabled:Ye||Je,state:ye===270}),C.getCommand("formatTextRotate315").updateCallback(function(Ne){I(this,{alignment:{rotation:Ne??1?315:0}})}).update({disabled:Ye||Je,state:ye===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Ne){I(this,{alignment:{rotation:Ne}})}).update({disabled:Ye||Je,state:ye??0})},[Fe,t,l,P,F]),o.useEffect(()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=t.getSelectedRanges().getMerges().length>0,T=async(Ze,St)=>{L(St,async ft=>{const bt=async(At=!1)=>{const Mt=await Promise.resolve(s.showBusy(St.label()));try{const Nt=ft.getSelectedRanges();if(Nt.merge({orientations:Ze,discardMultipleValues:At}),Ze===d.IRange.Orientations.Both){const pt={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};Nt.getStyle().update(pt)}}catch(Nt){throw Nt}finally{Mt?.()}};let Ft;try{await bt()}catch(At){if(At.type!=="discardMultipleValues")throw At;Ft=!0}if(Ft&&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 bt(!0)}},void 0,void 0,!1)},u=Ze=>{L(Ze,async St=>{try{const ft=St.getSelectedRanges();ft.unmerge();const bt={alignment:{horizontal:null}};ft.getStyle().update(bt)}catch(ft){throw ft}})};C.getCommand("mergeToggle").updateCallback(function(){he.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(w?u(this):T(d.IRange.Orientations.Both,this))}).update({state:w,disabled:!je||h}),C.getCommand("mergeHorizontal").updateCallback(function(){T(d.IRange.Orientations.Column,this)}).update({disabled:!je||h}),C.getCommand("mergeVertical").updateCallback(function(){T(d.IRange.Orientations.Row,this)}).update({disabled:!je}),C.getCommand("unmerge").updateCallback(function(){u(this)}).update({disabled:!w||!je||h});const S={disabled:h};C.getCommand("hideRows").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(S),C.getCommand("hideColumns").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(S),C.getCommand("unhideRows").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(S),C.getCommand("unhideColumns").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(S),C.getCommand("autoFitRows").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(S),C.getCommand("resizeRows").updateCallback(function(){const Ze={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},St={initialValue:{size:20,unit:"Px"},context:()=>Ze,onInput:(ft,bt)=>{bt!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(ft.size+ft.unit):C.getCommand("autoFitRows").execute()}};s.showWindow("resizeHeader",St)}).update(S),C.getCommand("autoFitColumns").updateCallback(function(){L(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(S),C.getCommand("resizeColumns").updateCallback(function(){const Ze={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},St={initialValue:{size:100,unit:"Px"},context:()=>Ze,onInput:(ft,bt)=>{bt!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(ft.size+ft.unit):C.getCommand("autoFitColumns").execute()}};s.showWindow("resizeHeader",St)}).update(S);let D=!1,oe=0,fe=!1,se=!1,ne=0,ae=!1;g&&!h&&(D=g.isEntireColumnsAny(),fe=D&&!g.isEntireColumns(),oe=g.getColumnCount(),se=g.isEntireRowsAny(),ae=se&&!g.isEntireRows(),ne=g.getRowCount());const ue={disabled:h||g&&g.getCount()!==1};C.getCommand("sortAscending").update(ue),C.getCommand("sortDescending").update(ue);const Ce={disabled:D||se||h||te},Oe=D||h||te||ae,Me=se||h||te||fe;let Te="",$e="",We="",_e="",Ye="",Je="",Ne="",Qe="",ht="",it="",at="",kt="",qt="";oe>1&&(Te=oe+" ",$e="s",te||(it=Je=Te,at=Ne=$e)),ne>1&&(We=ne+" ",_e="s",te||(kt=Qe=We,qt=ht=_e)),H.getMode()?.key==="copy"?(Ye=Qe=Je="Copied ",Ne=ht="s"):H.getMode()?.key==="cut"&&(Ye=Qe=Je="Cut ",Ne=ht="s");let wt="",vt="";if(g){const Ze=g.getDefaultShiftOrientation()===d.IRange.Orientation.Column;wt=` (${Ze?"Shift Right":"Shift Down"})`,vt=` (${Ze?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${vt}`})}C.getCommand("insertCells").update({label:`Insert ${Ye}Cells${wt}`,scopedLabels:{insertCells:`${Ye}At Selection`}}),C.getCommand("insertCellsShiftRight").update(Ce),C.getCommand("insertCellsShiftDown").update(Ce),C.getCommand("deleteCellsShiftUp").update(Ce),C.getCommand("deleteCellsShiftLeft").update(Ce),C.getCommand("insertRows").update({label:`Insert ${Qe}Row${ht}`,scopedLabels:{insertCells:`${Qe}Row${ht}`},disabled:Me}),C.getCommand("insertRowsAfter").update({label:`Insert ${Qe}Row${ht} Below`,disabled:Me}),C.getCommand("hideRows").update({label:`Hide ${We}Row${ht}`}),C.getCommand("insertColumns").update({label:`Insert ${Je}Column${Ne}`,scopedLabels:{insertCells:`${Je}Column${Ne}`},disabled:Oe}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Je}Column${Ne} After`,disabled:Oe}),C.getCommand("hideColumns").update({label:`Hide ${Te}Column${Ne}`}),C.getCommand("deleteRows").update({label:`Delete ${kt}Row${qt}`,scopedLabels:{deleteCells:`${kt}Row${qt}`},disabled:Me}),C.getCommand("deleteColumns").update({label:`Delete ${it}Column${at}`,scopedLabels:{deleteCells:`${it}Column${at}`},disabled:Oe})},[xe,je,te,g,H,s,pe]),o.useEffect(()=>{const h=t.getProtection(),w=t.getProtection().isLocked(),T=!h.isFormatCellsAllowed(),u={disabled:T};C.getCommand("protectionSheetToggle").updateCallback(async(oe,fe)=>{let se=null;try{if(w){let ne=null;if(h.hasPassword()){const ae=await s.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ae.option!=="Unprotect")return;ne=ae.input}se=await Promise.resolve(s.showBusy(fe.label())),await h.unlock(ne)}else se=await Promise.resolve(s.showBusy(fe.label())),await h.lock();se?.()}catch(ne){se?.(),s.showError(ne)}}).update({state:w,label:()=>w?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:w?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(u),C.getCommand("sortAscending").update(u),C.getCommand("sortDescending").update(u),C.getCommand("sortCustom")?.update(u),C.getCommand("updateComments").update(u),C.getCommand("deleteComments").update(u),C.getCommand("insertChart")?.update(u),C.getCommand("insertImageFromFile").update(u),C.getCommand("insertImageFromURL").update(u),C.getCommand("formatBorder").update(u),C.getCommand("formatFillColor").update(u),C.getCommand("formatFontColor").update(u),C.getCommand("formatBoldToggle").update(u),C.getCommand("formatItalicToggle").update(u),C.getCommand("formatUnderlinedToggle").update(u),C.getCommand("formatStrikeThroughToggle").update(u),C.getCommand("formatSuperscriptToggle").update(u),C.getCommand("formatSubscriptToggle").update(u),C.getCommand("formatAlignTopToggle").update(u),C.getCommand("formatTextOverflowVisibleToggle").update(u),C.getCommand("formatTextOverflowWrapToggle").update(u),C.getCommand("formatTextOverflowClipToggle").update(u),C.getCommand("formatTextOverflowShrinkToggle").update(u),C.getCommand("formatAlignMiddleToggle").update(u),C.getCommand("formatAlignBottomToggle").update(u),C.getCommand("formatAlignDistributedVerticalToggle").update(u),C.getCommand("formatAlignJustifyVerticalToggle").update(u),C.getCommand("formatAlignLeftToggle").update(u),C.getCommand("formatAlignCenterToggle").update(u),C.getCommand("formatAlignRightToggle").update(u),C.getCommand("formatAlignJustifyToggle").update(u),C.getCommand("formatAlignCenterContinuousToggle").update(u),C.getCommand("formatAlignDistributedHorizontalToggle").update(u),C.getCommand("formatAlignFillToggle").update(u),C.getCommand("formatFontSizeIncrease").update(u),C.getCommand("formatFontSizeDecrease").update(u),C.getCommand("formatFontFamily").update(u),C.getCommand("formatFontSize").update(u),C.getCommand("formatNumberFormat").update(u),C.getCommand("formatNumberFormatGeneralStyle").update(u),C.getCommand("formatNumberFormatNumberStyle").update(u),C.getCommand("formatNumberFormatTimeStyle").update(u),C.getCommand("formatNumberFormatDateStyle").update(u),C.getCommand("formatNumberFormatAccountingStyle").update(u),C.getCommand("formatNumberFormatPercentStyle").update(u),C.getCommand("formatNumberFormatScientificStyle").update(u),C.getCommand("formatNumberFormatCommaStyle").update(u),C.getCommand("formatNumberFormatIncreaseDecimal").update(u),C.getCommand("formatNumberFormatDecreaseDecimal").update(u),C.getCommand("hideColumns").update(u),C.getCommand("unhideColumns").update(u),C.getCommand("hideRows").update(u),C.getCommand("unhideRows").update(u),C.getCommand("insertFunctionSum").update(u),C.getCommand("insertFunctionAverage").update(u),C.getCommand("insertFunctionCount").update(u),C.getCommand("insertFunctionMax").update(u),C.getCommand("insertFunctionMin").update(u),C.getCommand("insertFunction").update(u),C.getCommand("startEditCurrentTime").update(u),C.getCommand("startEditCurrentDate").update(u),C.getCommand("startEditValueAbove").update(u),C.getCommand("fillDown").update(u),C.getCommand("fillRight").update(u),C.getCommand("fillUp").update(u),C.getCommand("fillLeft").update(u),C.getCommand("formatCellStyle").update(u),C.getCommand("formatTableStyle").update(u),C.getCommand("formatPainterToggle").update(u),C.getCommand("formatBorderAddOutline").update(u),C.getCommand("formatBorderClearOutline").update(u),C.getCommand("formatIndentDecrease").update(u),C.getCommand("formatIndentIncrease").update(u),C.getCommand("clearContents").update(u),C.getCommand("clearFormats").update(u),C.getCommand("clearAll").update(u),C.getCommand("clearComments").update(u),C.getCommand("clearHyperlinks").update(u),C.getCommand("autoFilterClear").update(u),C.getCommand("autoFilterReapply").update(u);const S=j===d.ITextFrame.HorizontalAlignment.CenterContinuous||j===d.ITextFrame.HorizontalAlignment.Fill,D={disabled:T||S};C.getCommand("formatTextRotate0").update(D),C.getCommand("formatTextRotate45").update(D),C.getCommand("formatTextRotate90").update(D),C.getCommand("formatTextRotate270").update(D),C.getCommand("formatTextRotate315").update(D),C.getCommand("formatTextRotateCustom").update(D),C.getCommand("formatTextRotateVertical").update(D)},[xe]),C}var Ko,$o;(function(){if($o)return Ko;$o=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,a=parseInt,i=typeof cn=="object"&&cn&&cn.Object===Object&&cn,f=typeof self=="object"&&self&&self.Object===Object&&self,m=i||f||Function("return this")(),s=Object.prototype.toString,v=Math.max,b=Math.min,y=function(){return m.Date.now()};function g(x){var E=typeof x;return!!x&&(E=="object"||E=="function")}function k(x){if(typeof x=="number")return x;if((function($){return typeof $=="symbol"||(function(V){return!!V&&typeof V=="object"})($)&&s.call($)=="[object Symbol]"})(x))return NaN;if(g(x)){var E=typeof x.valueOf=="function"?x.valueOf():x;x=g(E)?E+"":E}if(typeof x!="string")return x===0?x:+x;x=x.replace(e,"");var z=n.test(x);return z||l.test(x)?a(x.slice(2),z?2:8):t.test(x)?NaN:+x}Ko=function(x,E,z){var $,V,R,P,p,F,M=0,H=!1,N=!1,B=!0;if(typeof x!="function")throw new TypeError("Expected a function");function W(I){var q=$,O=V;return $=V=void 0,M=I,P=x.apply(O,q)}function ce(I){var q=I-F;return F===void 0||q>=E||q<0||N&&I-M>=R}function G(){var I=y();if(ce(I))return K(I);p=setTimeout(G,(function(q){var O=E-(q-F);return N?b(O,R-(q-M)):O})(I))}function K(I){return p=void 0,B&&$?W(I):($=V=void 0,P)}function L(){var I=y(),q=ce(I);if($=arguments,V=this,F=I,q){if(p===void 0)return(function(O){return M=O,p=setTimeout(G,E),H?W(O):P})(F);if(N)return p=setTimeout(G,E),W(F)}return p===void 0&&(p=setTimeout(G,E)),P}return E=k(E)||0,g(z)&&(H=!!z.leading,R=(N="maxWait"in z)?v(k(z.maxWait)||0,E):R,B="trailing"in z?!!z.trailing:B),L.cancel=function(){p!==void 0&&clearTimeout(p),M=0,$=F=V=p=void 0},L.flush=function(){return p===void 0?P:K(y())},L}})();var Wo,_o,Go={exports:{}},co={};_o||(_o=1,Go.exports=(function(){if(Wo)return co;Wo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(s,v){return s===v&&(s!==0||1/s==1/v)||s!=s&&v!=v},n=e.useState,l=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function f(s){var v=s.getSnapshot;s=s.value;try{var b=v();return!t(s,b)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(s,v){return v()}:function(s,v){var b=v(),y=n({inst:{value:b,getSnapshot:v}}),g=y[0].inst,k=y[1];return a(function(){g.value=b,g.getSnapshot=v,f(g)&&k({inst:g})},[s,b,v]),l(function(){return f(g)&&k({inst:g}),s(function(){f(g)&&k({inst:g})})},[s]),i(b),b};return co.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,co})()),Go.exports;var Zo,Xo,ln={exports:{}},Zt={exports:{}},Xl=Zt.exports;function Yo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Xo)return ln.exports;Xo=1;for(var e=(Zo||(Zo=1,function(){var y,g,k,x,E,z;typeof performance<"u"&&performance!==null&&performance.now?Zt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Zt.exports=function(){return(y()-E)/1e6},g=process.hrtime,x=(y=function(){var $;return 1e9*($=g())[0]+$[1]})(),z=1e9*process.uptime(),E=x-z):Date.now?(Zt.exports=function(){return Date.now()-k},k=Date.now()):(Zt.exports=function(){return new Date().getTime()-k},k=new Date().getTime())}.call(Xl)),Zt.exports),t=typeof window>"u"?cn:window,n=["moz","webkit"],l="AnimationFrame",a=t["request"+l],i=t["cancel"+l]||t["cancelRequest"+l],f=0;!a&&f<n.length;f++)a=t[n[f]+"Request"+l],i=t[n[f]+"Cancel"+l]||t[n[f]+"CancelRequest"+l];if(!a||!i){var m=0,s=0,v=[],b=1e3/60;a=function(y){if(v.length===0){var g=e(),k=Math.max(0,b-(g-m));m=k+g,setTimeout(function(){var x=v.slice(0);v.length=0;for(var E=0;E<x.length;E++)if(!x[E].cancelled)try{x[E].callback(m)}catch(z){setTimeout(function(){throw z},0)}},Math.round(k))}return v.push({handle:++s,callback:y,cancelled:!1}),s},i=function(y){for(var g=0;g<v.length;g++)v[g].handle===y&&(v[g].cancelled=!0)}}ln.exports=function(y){return a.call(t,y)},ln.exports.cancel=function(){i.apply(t,arguments)},ln.exports.polyfill=function(y){y||(y=t),y.requestAnimationFrame=a,y.cancelAnimationFrame=i},ln.exports})();const Yl="_sheet-scrollbar_104cg_1",Mo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:l,sheet:a,onShowTooltip:i,onCloseTooltip:f,onScrollOffset:m,showCustomScrollButtons:s=!0,offset:v=0,totalSize:b=0,viewportSize:y=0,className:g,endGap:k,...x}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[E]=Vt(),z=r.useCallbackRef(i,[i]),$=r.useCallbackRef(f,[f]),V=(R=E,P=t,o.useMemo(()=>R===null&&P===null?null:ve=>{Yo(R,ve),Yo(P,ve)},[R,P]));var R,P;const[p,F]=o.useState(()=>{const ve=a.getView().getTopLeft();return l===r.ScrollbarOrientation.Vertical?ve.top:ve.left}),M=()=>{const ve=a.getView().getFreezePanes();return l===r.ScrollbarOrientation.Vertical?ve.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ve.coords.rowIndex)-ve.topLeft.top,scroll:ve.topLeft.top}:ve.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ve.coords.colIndex)-ve.topLeft.left,scroll:ve.topLeft.left}},[H,N]=o.useState(M),[B,W]=o.useState(null),[ce,G]=o.useState(!1),K=l===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),L=()=>{const ve=a.getUsedRange()?.getCoords()??he.CoordUtils.EmptyRange,Re=a.getSelection().getCoords().cell;return{colIndex:Math.max(ve.colEnd,Re.colIndex),rowIndex:Math.max(ve.rowEnd,Re.rowIndex)}},[I,q]=o.useState(L),O=I?(l===r.ScrollbarOrientation.Vertical?I.rowIndex:I.colIndex)+1:0,Q=()=>{const ve=L();he.CoordUtils.isEqualCells(I,ve)||q(ve)};tt(a.getView(),{onFreezeSplitChange:()=>{N(M)}}),tt(a.getSelection(),{onChange:Q}),tt(a,{onUsedRangeChange:Q}),o.useEffect(()=>{q(L())},[a]),o.useEffect(()=>{if(!B)return ce&&$?.(),void G(!1);const ve=K.getTextAt(K.findIndex(p/(a.getView().getZoomScale()/100)+H.scroll+H.shift));G(!0),z?.({...B,display:(l===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ve})},[v,p,H,l,B,K,ce,a]);const re=r.useCallbackRef((ve,Re,Ke)=>{F(ve);const Y=ve+H.scroll,Z=Re+H.shift,de=Ke+H.shift+H.scroll;m?.(Y,Z,de)},[m,H]),be=v-H.scroll,me=y-H.shift,ze=b-(H.shift+H.scroll),Pe=K.findOffset(O)*(a.getView().getZoomScale()/100)-(H.scroll+H.shift);return o.useMemo(()=>c.jsx(r.VirtualScrollbar,{ref:V,className:ct(g,Yl),style:n,offset:be,viewportSize:me,totalSize:ze,orientation:l,showCustomScrollButtons:s,onMouseDown:ve=>{W({anchor:{x:ve.clientX,y:ve.clientY}}),ve.preventDefault()},onScrollOffset:re,onMouseOut:()=>{W(null)},onMouseUp:()=>{W(null)},minSize:Pe,...x}),[g,be,me,ze,l,s,n,Pe,k])}));Mo.displayName="SheetScrollbar";const Jo=(e,t,n=null)=>{const l=[];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;l.push({address:{min:e[a].min,max:e[a].max},update:t})}return l},Qo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:l,sheetElement:a,commands:i,oppositeSize:f=30,containerWidth:m,containerHeight:s,headerText:v,freezeStart:b,gridStyle:y,verticalPadding:g,horizontalPadding:k,onSheetContextMenu:x,onResizeHeadersStart:E,onResizeHeaders:z,onResizeHeadersEnd:$,onResizeHeadersDown:V,onResizeHeadersUp:R,scrollPoint:P,onSelectionStart:p,onSelectionEnd:F}=e,M=o.useMemo(()=>n.getOrientation(),[n]),H=o.useRef(null),[N,B]=o.useReducer(j=>j+1,0),[W,ce]=o.useReducer(j=>j+1,0),G=n?.getSheet(),K=o.useRef(!1);o.useLayoutEffect(()=>{K.current=!0},[n]);const L=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),I=o.useMemo(()=>{const j=M===d.IRange.Orientation.Column;return{left:j?P.left:0,top:j?0:P.top}},[P]),[q,O]=o.useState(G?.getView().getZoomScale()/100),[Q,re]=o.useState(null);tt(n,{onSizesChange:j=>{O(G?.getView().getZoomScale()/100),Ee(ge())}});const be=o.useCallback(()=>{H.current?.invalidate(),ce()},[]),me=o.useCallback(he.CommonUtils.debounce(()=>{be()},10),[]),[ze,Pe]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){Pe(G?.getSelection().getCoords()),me()},onProtectionChange(){be()},onViewChange(){me()}}),o.useLayoutEffect(()=>{Ee(ge())},[M,q,f]),o.useLayoutEffect(()=>{re(null),O(n?.getSheet().getView().getZoomScale()/100),Ee(ge())},[n]);const ve=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),Re=o.useCallback((j,_)=>n.hiddenHeadersAt(j,_),[ve]),Ke=r.useCallbackRef(j=>n.isSelected(j),[n]),Y=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),Z=o.useCallback(()=>n.getMinSize(),[n]),de=o.useCallback(()=>n.getMaxSize(),[n]),Ie=r.useCallbackRef((j,_,qe)=>{_/=q;const ye={size:_=Math.max(Z(),Math.min(he.CommonUtils.roundAccurately(_,Z()),de())),hidden:!1},h=[];if(_<=0&&(ye.hidden=!0,ye.size=qe),h.push({address:{min:j,max:j},update:ye}),_<0){const w=M===d.IRange.Orientation.Column,T=w?le.getColOffset:le.getRowOffset,u=w?le.getColIndex:le.getRowIndex,S=T(j);let D=u(S+_);const oe=T(D);oe===S+_?D--:h.push({address:{min:D,max:D},update:{size:S-oe+_}}),j-D>1&&h.push({address:{min:D+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(h),z?.(j,_,qe)},[N,n,q,z]),we=r.useCallbackRef((j,_,qe)=>{const ye=M===d.IRange.Orientation.Column;let h=null,w={min:j,max:j};if(n.isSelectedAll(j)){const T=n.getSelectedRuns();T.length>1?h="Resize "+(ye?"Columns":"Rows"):w=T[0];const u={hidden:_<=0,size:(_<=0?qe:_)/q};n.updateHeaderPairs(Jo(T,u,j))}if(w){const T=w.max-w.min+1;let u;u=T===1?n.getRange(w).at(0).getDisplayText():n.getRange(w).toString(),h=`Resize ${ye?"Column":"Row"}${T>1?"s":""} '${u}'`}$?.(j,_,h)},[N,n,$]),U=r.useCallbackRef((j,_)=>{const qe=M===d.IRange.Orientation.Column;E(j,_,`Resize ${qe?"Column":"Row"}(s)`)},[E]),ee=r.useCallbackRef(j=>{let _=!1;const qe=M===d.IRange.Orientation.Column,ye=n.getSheet().getEntireRange().getCoords(),h=[],w=n.getSelectedRuns(),T=u=>{let S;S=qe?{colStart:u.min,rowStart:ye.rowStart,colEnd:u.max,rowEnd:ye.rowEnd}:{colStart:ye.colStart,rowStart:u.min,colEnd:ye.colEnd,rowEnd:u.max},h.push(S)};for(let u=0;u<w.length;u++){const S=w[u];S.value.isSelectedAll&&(S.min<=j&&S.max>=j&&(_=!0),T(S))}if(_||T({min:j,max:j}),n.getSheet().getRanges(h).autoFit({orientations:qe?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),ve(j)){const u={hidden:null},S=Jo(w,u);_||S.push({address:j,update:u}),n.updateHeaderPairs(S)}$?.(j,null,"Resize Column(s)")},[N,n,$,ve]),ge=()=>{const j=M===d.IRange.Orientation.Column;return{getColOffset:_=>j?n.findOffset(_):_===0?0:f/q,getColIndex:_=>j?n.findIndex(_):0,getRowOffset:_=>j?_===0?0:f/q:n.findOffset(_),getRowIndex:_=>j?0:n.findIndex(_)}},[le,Ee]=o.useState(()=>ge()),ie=o.useCallback((j,_)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!Y(M===d.IRange.Orientation.Column?_.colIndex:_.rowIndex),[M,Y]),pe=r.useCallbackRef(j=>{a.focusSheet()},[a]),De=r.useCallbackRef(j=>{G?.getSelection().updateCoords(j)},[G]),{...xe}=ut.useSelection({gridRef:l,commands:null,layout:le,selection:ze,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:De,canSelectionSpanMergedCells:j=>{const _=G.getRange(j);return _.isEntireColumns()||_.isEntireRows()}}),Be=r.useCallbackRef(()=>{p?.();const j=G?.getSelection();j&&j.setAdjusting(j.getCoords())},[G,p]),He=r.useCallbackRef(async()=>{G?.getSelection().setAdjusting(null),F?.()},[G,F]),{...C}=ut.useHeaderSelection({orientation:M,headerCount:L,gridRef:H,gridMainRef:l,newSelection:xe?.newSelection,modifySelection:xe?.modifySelection,appendSelection:xe?.appendSelection,clearSelections:xe?.clearSelections,pointerDownInterceptor:ie,onPointerUp:pe,onDragStart:Be,onDragEnd:He}),je=y.selection?.strokeFill;o.useEffect(()=>{if(!H.current)return void re(null);const j=M===d.IRange.Orientation.Column,_=n.getSelectedRuns(),qe=n.isProtected()?null:Ie,ye=(w,T,u)=>{if(u)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${je}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(u.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(u.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},w):c.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${je}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(u.y-y.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,width:f+y.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(u.height+y.headerSelection.strokeWidth+1,!0)}px`}},w)},h=(w,T,u)=>{const S={x:0,y:0,width:0,height:0};if(j){const D=u.toClipBounds(u.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:w,colEnd:Math.min(L,T)}),ut.SELECTION_CLIP_INSETS);if(!D)return;S.x=D.x,S.width=D.width}else{const D=u.toClipBounds(u.getRangeCoordsBounds({rowStart:w,rowEnd:Math.min(L,T),colStart:0,colEnd:0}),ut.SELECTION_CLIP_INSETS);if(!D)return;S.y=D.y,S.height=D.height}return{x:S.x,y:S.y,width:S.width,height:S.height}};re([w=>{let T=null,u=j?w.getVisibleColumns():w.getVisibleRows();const S=j?w.getTotalRangeCoords().colStart:w.getTotalRangeCoords().rowStart;u.length>0&&u[0]>S&&(u=[u[0]-1,...u]);let D=[];const oe=[],fe=u.length;for(let Me=0;Me<fe;Me++){const Te=u[Me],$e=Me<fe-1?u[Me+1]:Te+Re(Te+1,!1)+1,We=Te+1!==$e;if(!T||T.max<Te)if(_.length>0&&_[_.length-1].max>=Te){const Je=he.CommonUtils.findEqualOrGreater(_,Te,Ne=>Ne.max);T=_[Je]}else T=null;let _e=!1,Ye=!1;if(T?.value&&(T.min<=Te||T.min<=$e&&!We)&&(_e=!0,Ye=T.value.isSelectedAll),Te===S){let Je=!1,Ne=!1;T?.value&&T.min<=Te&&(Je=!0,Ne=T.value.isSelectedAll),Te>0&&oe.push({index:Te-1,isNextHidden:We,isSelected:Je,isSelectedAll:Ne,disabledResize:!0})}if(Ye&&D.push(oe.length),oe.push({index:Te,isHidden:Me===0&&Re(Te,!1)>0,isNextHidden:We,isSelected:_e,isSelectedAll:Ye,onDividerMouseDown:V,onDividerResizeStart:U,onDividerResize:qe,onDividerMouseUp:R,onDividerResizeEnd:we,onDividerAutoFit:ee}),We){let Je=!1,Ne=!1;if(T&&T.min>=Te&&T.max<=$e-1&&T.value.isSelectedAll&&D.push(oe.length),!(T?.value&&T.max>=$e))if(_.length>0&&_[_.length-1].max>=$e){const Qe=he.CommonUtils.findEqualOrGreater(_,$e,ht=>ht.max);T=_[Qe]}else T=null;T?.value&&T.min<=$e&&(Je=T.value.isSelected,Ne=T.value.isSelectedAll),$e>0&&oe.push({index:$e-1,isHidden:!0,isSelected:Je,isSelectedAll:Ne,onDividerMouseDown:V,onDividerResizeStart:U,onDividerResize:qe,onDividerMouseUp:R,onDividerResizeEnd:we,onDividerAutoFit:ee})}}if(D.length>0){let Me=D.length-1;if(D.length>0){const We=oe[D[Me]].index;let _e=null;j?(_e=w.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:We,colEnd:We}),_e.x+_e.width>w.getBounds().width&&(Me-=1,Me===0&&(Me=-1))):(_e=w.getRangeCoordsBounds({rowStart:We,rowEnd:We,colStart:0,colEnd:0}),_e.y+_e.height>w.getBounds().height&&(Me-=1,Me===0&&(Me=-1)))}const Te=_?.[_.length-1],$e=w.getAnchor();if($e==="t"||$e==="l"){const We=oe[D[Math.max(0,D.length-1)]];We.showTouchDivider=Te&&Te.max<=We.index}else Me>=0&&(oe[D[Me]].showTouchDivider=!0)}const{header:se,headerSelect:ne,headerSelectAll:ae,headerHover:ue}=y??{},Ce=oe.length,Oe=new Array(Ce);for(let Me=0;Me<Ce;Me++)Oe[Me]=c.jsx(ut.HeaderDivider,{orientation:M,view:w,headerStyle:se,headerStyleSelect:ne,headerStyleSelectAll:ae,headerStyleHover:ue,disabled:n.isProtected(),...oe[Me]},`divider${Me}`);return Oe},w=>{const T=[],u=_.length;for(let S=0;_&&S<u;S++)T.push(ye(`selection:${w.getAnchor()}:${S}`,0,h(_[S].min,_[S].max,w)));return T}])},[W,!0,je,y,le,L,b,N,q]),o.useEffect(()=>{H.current?.invalidate()},[N]);const nt=r.useCallbackRef(j=>v?v(j):n.getTextAt(j),[v,n]),te=r.useCallbackRef(j=>{const{header:_,headerSelect:qe,headerSelectAll:ye,headerHover:h}=y??{},{range:w,key:T,...u}=j;return c.jsx(ut.HeaderRenderer,{orientation:M,index:M===d.IRange.Orientation.Column?w.colStart:w.rowStart,isSelected:Ke,isSelectedAll:Y,zoomScale:100*q,headerText:nt,headerStyle:_,headerStyleSelect:qe,headerStyleSelectAll:ye,headerStyleHover:h,verticalPadding:g,horizontalPadding:k,...u},T)},[N,L,y,q,n]),ke=r.useEditMode(),Le=o.useMemo(()=>{const j="white",_="black",qe={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let ye=M===d.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='${_}' 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='${_}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;ke.getMode()?.key==="formatPainter"&&(ye=`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='${_}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),qe.cursor=ye}return qe.backgroundColor=y?.header?.fill||"transparent",qe},[M,N,ke,y]),Ae=r.useImperativeElement(t,()=>({scrollTo:j=>{H.current?.scrollTo(j)},forceRender:()=>{B()},getGridElement:()=>H.current}),[]),Fe=o.useCallback(j=>{C.onPointerDown(j)},[C]),A=o.useCallback(j=>{const _=C.getCellCoordsFromClient(j.clientX,j.clientY);if(!_||!x)return;const qe=M===d.IRange.Orientation.Column;x({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:qe?-1:_.rowIndex,colIndex:qe?_.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[C,x]),J=o.useMemo(()=>{const j=M===d.IRange.Orientation.Column;return c.jsx("div",{ref:Ae,children:c.jsx(ut.Grid,{className:"sheet-header",style:Le,ref:H,scrollPoint:I,columnCount:j?L:1,rowCount:j?1:L,width:j?m:f,height:j?f:s,freezeLeft:j?b:void 0,freezeTop:j?void 0:b,hiddenColumnsAt:j?Re:void 0,hiddenRowsAt:j?void 0:Re,showGridLines:!1,layout:le,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:A,onPointerDown:Fe,zoom:q,cellRenderer:te,overlays:Q})})},[Q,le,m,s,I,Le,W]);return o.useEffect(()=>{K.current=!1,H.current?.invalidate(),ce()},[n,y]),J})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,getVisibleCells:a,gridStyle:i}=e,f=r.useCallbackRef((v,b)=>v.getStyle().getBorder(),[]),{overlay:m}=So({getVisibleCells:a,getBorderAt:f,darkMode:i.body.darkMode,shiftIfWide:!0}),s=m(n);return s&&n?s:null})),Ql={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},ei={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},ti={type:d.ICell.Content.Values},ni={fitDestination:!0,type:d.ICell.Content.Formats},oi={fitDestination:!0,type:d.ICell.Content.Formulas},ri={transpose:!0},li={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Pr=({element:e,sheet:t,sheetView:n,commands:l,onClipboardUpdate:a,onPaste:i,selectionRenderer:f=ut.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:s="rgb(33, 115, 70)",copyBackgroundColor:v="white",cutBackgroundColor:b="white",...y})=>{const g=r.useCallbackRef(f,[f]),k=o.useRef(null),x=r.useEditMode(),E=x.getMode(),z=o.useMemo(()=>({element:e,doCopy:p=>{const F=t.getSelectedRanges().getSnapshot(p);return new d.RangeClipboardItem(F)}}),[t,n,e]),$=o.useMemo(()=>({element:e,importFromExternal:async(p,F)=>{const M=new d.ExternalRangeClipboardItem(p,F,t.getStyles(),t.isDate1904());return await M.parse()?M:null},doPaste:async(p,F)=>{if(p?.getItemType()!=="range")return;F?.contentsOnly&&delete(F={...F,type:d.ICell.Content.Values}).contentsOnly;const M=p.getItem(),H=M.getName();let N=t.getSelectedRange();if(H==="HTML"&&N.size>1){const B=M?.getCoords();B&&he.CoordUtils.isSingleCell(B)&&(N=N.getResizeTo(1,1))}return await N.doBatch(async()=>{const B=await N.copyFrom(M,F);!B||B.isEntireRows()||B.isEntireColumns()||B.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(H?` ${H}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:V,...R}=r.useCopyPaste({...y,source:z,commands:l,target:$,onClipboardUpdate:p=>{const F=p?.getItemType()==="range"?p:null;if(F){const M=p.editMode?.(),H={...p?.isCut?.()?ei:Ql,...M,args:{isClipboard:!0,...M?.args},onModeChange:N=>{N?.args?.isClipboard||V.clear(!0),M?.onModeChange?.(N)}};x.setMode(H)}k.current=F,a?.(F)},onPaste:(p,F)=>{if(p?.getItemType()!=="range")return;let M=x.getMode()?.key==="cut"||p.isCut?.();if(!M&&x.getMode()?.key==="copy"){const H=p.getItem().getCoords(),N=t.getSelectedRanges().getCoords();let B=!1;if(!B&&H&&N&&p.getItem().getSource?.()===t)for(let W=0;!B&&W<N.length;W++)B=he.CoordUtils.isRangesIntersect(H,N[W]);M=B}M&&x.setMode(null),e?.()?.focus(),i?.(p,F)}});o.useMemo(()=>{const p=e;if(!l)return;const F=[new r.Command("pasteValues",p,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
19
|
+
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){Q(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).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("resizeRows",l,{label:"Resize Rows",description:"Resize the rows to the specified height.",icon:"RowsResize"}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"}),new r.SimpleCommand("resizeColumns",l,{label:"Resize Columns",description:"Resize the columns to the specified width.",icon:"ColumnsResize"})],[]),C=o.useMemo(()=>{let h=null;return h=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),h.addCommands(Be,!0),h},[a,Be]),[je,tt]=o.useState(!1),[ee,ke]=o.useState(!1);o.useEffect(()=>{if(x.current!==t||!g)return;const h=g.getCoords(),w=t.getTables().getItems({address:h[0]});$(oe=>me.CommonUtils.isEqualArrays(oe,w)?oe:w),b&&w[0]&&me.CoordUtils.isCellWithinRange(b,w[0].getRange().getCoords())?he(w[0]??null):he(null);const T=t.getSelectedRanges(),u=T.getMerges().length>0,S=T.isOverlapping();let D=!0;for(let oe=0;D&&oe<h.length;oe++)D=me.CoordUtils.isSingleCell(h[oe]);ke(S),tt(w.length===0&&!S&&(u||!D))},[xe,g,t]),r.useCommands(a,null,{onChange:()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=H.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:h||!a?.getCommand("copy"),state:()=>w}).updateCallback(()=>w?void H.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`}}))}},[H,pe,a]),et(t.getView(),{onFreezeSplitChange:()=>{Oe()}}),et(t.getSelection(),{onChange:()=>{_()}});const Ne=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:h=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:h=>t.getStyles().addRecentColor(h),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(h=>{t.setTabColor(h)}).update({state:()=>t?.getTabColor()??In,context:()=>({onColorSelect:h=>{},darkMode:i.darkMode,autoColor:In,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:h=>t.getStyles().addRecentColor(h),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Ae=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:h=>{R(h)},darkMode:i.darkMode,quickBorder:V,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:h=>t.getStyles().getNormal().createTemporaryStyle({border:h}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Ae()},[V]),o.useEffect(()=>{const h=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!K().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:h||!K().getHyperlink()});const w=K().getHyperlink()?"Edit":"Insert",T="Link";C.getCommand("updateHyperlink").update({label:()=>(K().getHyperlink(),`${w} ${T}`),icon:()=>w==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${w} ${T}…`,insert:`${T}…`,hyperlink:`${w}…`},disabled:h})},[K()?.getHyperlink(),pe]),o.useEffect(()=>{const h=K().getComments(),w=()=>h?"Edit":"Insert",T=()=>h?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${w()} ${T()}`,icon:()=>h?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${w()} ${T()}…`,insert:`${T()}…`}})},[K()?.getComments(),pe]),et(t,{onViewChange:()=>{const h=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:h.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:h.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:h.isShowColumnGridlines()||h.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:h.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:h.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:h.isShowColumnHeaders()||h.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:h.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:h.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),Ne()},onTabColorChange:()=>{Ne()},onMergesChange:()=>{Oe()},onMovablesChange:()=>{Oe()},onTablesChange:()=>{Oe()},onProtectionChange:()=>{Oe(),De()},onStyleChange:()=>{Ne(),Ae(),Oe()}}),o.useEffect(()=>{Ne(),Ae()},[i]),o.useEffect(()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=B.length>0&&!be||h,T=Y(be),u={context:T};C.getCommand("editTable").update(u),C.getCommand("deleteTable").update(u),C.getCommand("convertTableToRange").update(u);const S={context:T,disabled:w};C.getCommand("formatTableStyle").update({label:be?"Apply Table Style":"Format As Table",...S}),C.getCommand("formatTableStyleClearCellStyles").update(S),C.getCommand("deleteTableStyle").update(S),C.getCommand("convertTableToRange").update(S),C.getCommand("insertTable").update({disabled:w||B.length>0});const D={context:T,disabled:w||B.length===0};C.getCommand("tableHeaderRowToggle").update(D),C.getCommand("tableTotalRowToggle").update(D),C.getCommand("autoFilterToggle").update(D),C.getCommand("formatTableStyleClearTableStyle").update({...D,disabled:D.disabled||!be||be.getStyleOptions().name===null})},[be,B,pe]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:me.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:me.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const h=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!h,showRowGridlines:!h})}),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(h=>{t.getView().update({gridLineColor:h})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const h=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!h,showRowHeaders:!h})}),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 h=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:h?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:h?d.ISheetView.HeaderTextStyle.One:d.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()})}),C.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),C.getCommand("insertFunction").update({context:()=>({searchByCategory:async h=>{const w=t.getWorkbook();if(!w)return me.CommonUtils.EmptyArray;const T=await w.getScripts().searchFunctions({category:h,includeBuiltIn:!0});return T.sort((u,S)=>u.getName().localeCompare(S.getName())),T}})})},[t]),o.useEffect(()=>{const h=t.getView().getFreezePanes(),w=()=>h.coords.rowIndex!==0,T=()=>h.coords.colIndex!==0,u=()=>h.coords.rowIndex!==0||h.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{u()?t.getView().setFreezePanes(null):u()?T()?t.getView().setFreezePanes({coords:{rowIndex:b.rowIndex}}):w()&&t.getView().setFreezePanes({coords:{colIndex:b.colIndex}}):t.getView().setFreezePanes({coords:b})}).update({state:u,disabled:()=>!b||!u()&&b.rowIndex===0&&b.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:w()?0:b.rowIndex}})}).update({state:w,disabled:()=>!b||!w()&&b.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:T()?0:b.colIndex}})}).update({state:T,disabled:()=>!b||!T()&&b.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!u()})},[xe,b,t,i]);const Fe=K().getStyle(),A=Fe.getFont(),J=Fe.getAlignment(),j=J.getHorizontal(),G=J.getVertical(),qe=J.getOverflow(),Ce=J.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>K().getStyle(!0).getNamed(),bodyStyle:We,createTemporaryCell:Le=>t.createTemporaryCell(Le)})}),C.getCommand("formatFillColor").update({state:()=>{let Le=null;const Xe=Fe.getFill();return Xe?.getType()===d.IFill.Type.Solid?Le=Xe.getColor():Xe?.getType()===d.IFill.Type.Gradient?Le=Xe.getStops()?.[0]?.getColor():Xe?.getType()===d.IFill.Type.Pattern&&(Le=Xe.getBackground()),Le},icon:()=>c.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const Le=t.getStyles();return{onColorSelect:Xe=>{p(Xe??In)},darkMode:i.darkMode,quickColor:P,autoColor:In,schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Xe=>Le.addRecentColor(Xe),clearRecentColors:()=>Le.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>A.toJSON()?.fill?A.getFill():null,icon:()=>c.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const Le=t.getStyles();return{onColorSelect:Xe=>{M(Xe)},darkMode:i.darkMode,quickColor:F,autoColor:Le.getNormal().getFont().getFill(),schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Xe=>Le.addRecentColor(Xe),clearRecentColors:()=>Le.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>Fe.getNumberFormat(),context:()=>K}),C.getCommand("formatNumberDialog").update({state:()=>Fe.getNumberFormat(),context:()=>K()}),C.getCommand("formatFontFamily").update({state:()=>A.getFamily()}),C.getCommand("formatFontSize").update({state:()=>A.getSize()});const h=function(){const Le=A.getWeight()||0;return!isNaN(Le)&&Le>500};C.getCommand("formatBoldToggle").updateCallback(function(){I(this,{font:{weight:h()?400:700}})}).update({state:h});const w=function(){return A.getStyle()===d.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){I(this,{font:{style:w()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:w}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){I(this,{font:{strike:!A.getStrike()}})}).update({state:A.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){I(this,{font:{underline:A.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:A.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){I(this,{font:{verticalAlign:A.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:A.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){I(this,{font:{verticalAlign:A.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:A.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const T=()=>qe===d.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){I(this,{alignment:{overflow:(T(),d.ITextFrame.Overflow.Visible)}})}).update({state:T});const u=()=>qe===d.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){I(this,{alignment:{overflow:u()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:u});const S=function(){return qe===d.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){I(this,{alignment:{overflow:S()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:S});const D=function(){return qe===d.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){I(this,{alignment:{overflow:D()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:D});const oe=function(){return qe===d.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){I(this,{alignment:{overflow:oe()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:oe,disabled:!0});const fe=function(){return G===d.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){I(this,{alignment:{vertical:fe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:fe});const se=function(){return G===d.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){I(this,{alignment:{vertical:se()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:se});const ne=function(){return G===d.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){I(this,{alignment:{vertical:(ne(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ne});const ae=function(){return G===d.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){I(this,{alignment:{vertical:ae()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:ae});const ue=function(){return G===d.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){I(this,{alignment:{vertical:ue()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ue});const we=function(){return j===d.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){I(this,{alignment:{horizontal:we()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:we});const He=function(){return j===d.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){I(this,{alignment:{horizontal:He()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:He});const Me=function(){return j===d.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Le={alignment:{horizontal:Me()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};I(this,Le)}).update({state:Me});const Te=function(){return j===d.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Le={alignment:{horizontal:Te()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};I(this,Le)}).update({state:Te});const Ue=function(){return j===d.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){I(this,{alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Ue});const _e=function(){return j===d.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){I(this,{alignment:{horizontal:_e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:_e});const $e=function(){return j===d.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){I(this,{alignment:{horizontal:$e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:$e});const Ye=!t.getProtection().isFormatCellsAllowed(),Je=j===d.ITextFrame.HorizontalAlignment.CenterContinuous||j===d.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Le){I(this,{alignment:{rotation:0}})}).update({disabled:Ye||Je,state:Ce===0}),C.getCommand("formatTextRotate45").updateCallback(function(Le){I(this,{alignment:{rotation:Le??1?45:0}})}).update({disabled:Ye||Je,state:Ce===45}),C.getCommand("formatTextRotate90").updateCallback(function(Le){I(this,{alignment:{rotation:Le??1?90:0}})}).update({disabled:Ye||Je,state:Ce===90}),C.getCommand("formatTextRotate270").updateCallback(function(Le){I(this,{alignment:{rotation:Le??1?270:0}})}).update({disabled:Ye||Je,state:Ce===270}),C.getCommand("formatTextRotate315").updateCallback(function(Le){I(this,{alignment:{rotation:Le??1?315:0}})}).update({disabled:Ye||Je,state:Ce===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Le){I(this,{alignment:{rotation:Le}})}).update({disabled:Ye||Je,state:Ce??0})},[Fe,t,i,P,F]),o.useEffect(()=>{const h=!t.getProtection().isFormatCellsAllowed(),w=t.getSelectedRanges().getMerges().length>0,T=async(rt,Rt)=>{L(Rt,async ft=>{const Ct=async(qt=!1)=>{const Kt=await Promise.resolve(s.showBusy(Rt.label()));try{const ut=ft.getSelectedRanges();if(ut.merge({orientations:rt,discardMultipleValues:qt}),rt===d.IRange.Orientations.Both){const Nt={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};ut.getStyle().update(Nt)}}catch(ut){throw ut}finally{Kt?.()}};let zt;try{await Ct()}catch(qt){if(qt.type!=="discardMultipleValues")throw qt;zt=!0}if(zt&&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 Ct(!0)}},void 0,void 0,!1)},u=rt=>{L(rt,async Rt=>{try{const ft=Rt.getSelectedRanges();ft.unmerge();const Ct={alignment:{horizontal:null}};ft.getStyle().update(Ct)}catch(ft){throw ft}})};C.getCommand("mergeToggle").updateCallback(function(){me.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(w?u(this):T(d.IRange.Orientations.Both,this))}).update({state:w,disabled:!je||h}),C.getCommand("mergeHorizontal").updateCallback(function(){T(d.IRange.Orientations.Column,this)}).update({disabled:!je||h}),C.getCommand("mergeVertical").updateCallback(function(){T(d.IRange.Orientations.Row,this)}).update({disabled:!je}),C.getCommand("unmerge").updateCallback(function(){u(this)}).update({disabled:!w||!je||h});const S={disabled:h};C.getCommand("hideRows").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(S),C.getCommand("hideColumns").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(S),C.getCommand("unhideRows").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(S),C.getCommand("unhideColumns").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(S),C.getCommand("autoFitRows").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(S),C.getCommand("resizeRows").updateCallback(function(){const rt={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},Rt={initialValue:{size:20,unit:"Px"},context:()=>rt,onInput:(ft,Ct)=>{Ct!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(ft.size+ft.unit):C.getCommand("autoFitRows").execute()}};s.showWindow("resizeHeader",Rt)}).update(S),C.getCommand("autoFitColumns").updateCallback(function(){L(this,rt=>{rt.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(S),C.getCommand("resizeColumns").updateCallback(function(){const rt={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},Rt={initialValue:{size:100,unit:"Px"},context:()=>rt,onInput:(ft,Ct)=>{Ct!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(ft.size+ft.unit):C.getCommand("autoFitColumns").execute()}};s.showWindow("resizeHeader",Rt)}).update(S);let D=!1,oe=0,fe=!1,se=!1,ne=0,ae=!1;g&&!h&&(D=g.isEntireColumnsAny(),fe=D&&!g.isEntireColumns(),oe=g.getColumnCount(),se=g.isEntireRowsAny(),ae=se&&!g.isEntireRows(),ne=g.getRowCount());const ue={disabled:h||g&&g.getCount()!==1};C.getCommand("sortAscending").update(ue),C.getCommand("sortDescending").update(ue);const we={disabled:D||h||ee},He={disabled:se||h||ee},Me=D||h||ee||ae,Te=se||h||ee||fe;let Ue="",_e="",$e="",Ye="",Je="",Le="",Xe="",vt="",nt="",at="",Tt="",kt="",yt="";oe>1&&(Ue=oe+" ",_e="s",ee||(at=Le=Ue,Tt=Xe=_e)),ne>1&&($e=ne+" ",Ye="s",ee||(kt=vt=$e,yt=nt=Ye)),H.getMode()?.key==="copy"?(Je=vt=Le="Copied ",Xe=nt="s"):H.getMode()?.key==="cut"&&(Je=vt=Le="Cut ",Xe=nt="s");let wt="",ct="";if(g){const rt=g.getDefaultShiftOrientation()===d.IRange.Orientation.Column;wt=` (${rt?"Shift Right":"Shift Down"})`,ct=` (${rt?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${ct}`})}C.getCommand("insertCells").update({label:`Insert ${Je}Cells${wt}`,scopedLabels:{insertCells:`${Je}At Selection`}}),C.getCommand("insertCellsShiftRight").update(we),C.getCommand("deleteCellsShiftLeft").update(we),C.getCommand("deleteCellsShiftUp").update(He),C.getCommand("insertCellsShiftDown").update(He),C.getCommand("insertRows").update({label:`Insert ${vt}Row${nt}`,scopedLabels:{insertCells:`${vt}Row${nt}`},disabled:Te}),C.getCommand("insertRowsAfter").update({label:`Insert ${vt}Row${nt} Below`,disabled:Te}),C.getCommand("hideRows").update({label:`Hide ${$e}Row${nt}`}),C.getCommand("insertColumns").update({label:`Insert ${Le}Column${Xe}`,scopedLabels:{insertCells:`${Le}Column${Xe}`},disabled:Me}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Le}Column${Xe} After`,disabled:Me}),C.getCommand("hideColumns").update({label:`Hide ${Ue}Column${Xe}`}),C.getCommand("deleteRows").update({label:`Delete ${kt}Row${yt}`,scopedLabels:{deleteCells:`${kt}Row${yt}`},disabled:Te}),C.getCommand("deleteColumns").update({label:`Delete ${at}Column${Tt}`,scopedLabels:{deleteCells:`${at}Column${Tt}`},disabled:Me})},[xe,je,ee,g,H,s,pe]),o.useEffect(()=>{const h=t.getProtection(),w=t.getProtection().isLocked(),T=!h.isFormatCellsAllowed(),u={disabled:T};C.getCommand("protectionSheetToggle").updateCallback(async(oe,fe)=>{let se=null;try{if(w){let ne=null;if(h.hasPassword()){const ae=await s.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ae.option!=="Unprotect")return;ne=ae.input}se=await Promise.resolve(s.showBusy(fe.label())),await h.unlock(ne)}else se=await Promise.resolve(s.showBusy(fe.label())),await h.lock();se?.()}catch(ne){se?.(),s.showError(ne)}}).update({state:w,label:()=>w?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:w?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(u),C.getCommand("sortAscending").update(u),C.getCommand("sortDescending").update(u),C.getCommand("sortCustom")?.update(u),C.getCommand("updateComments").update(u),C.getCommand("deleteComments").update(u),C.getCommand("insertChart")?.update(u),C.getCommand("insertImageFromFile").update(u),C.getCommand("insertImageFromURL").update(u),C.getCommand("formatBorder").update(u),C.getCommand("formatFillColor").update(u),C.getCommand("formatFontColor").update(u),C.getCommand("formatBoldToggle").update(u),C.getCommand("formatItalicToggle").update(u),C.getCommand("formatUnderlinedToggle").update(u),C.getCommand("formatStrikeThroughToggle").update(u),C.getCommand("formatSuperscriptToggle").update(u),C.getCommand("formatSubscriptToggle").update(u),C.getCommand("formatAlignTopToggle").update(u),C.getCommand("formatTextOverflowVisibleToggle").update(u),C.getCommand("formatTextOverflowWrapToggle").update(u),C.getCommand("formatTextOverflowClipToggle").update(u),C.getCommand("formatTextOverflowShrinkToggle").update(u),C.getCommand("formatAlignMiddleToggle").update(u),C.getCommand("formatAlignBottomToggle").update(u),C.getCommand("formatAlignDistributedVerticalToggle").update(u),C.getCommand("formatAlignJustifyVerticalToggle").update(u),C.getCommand("formatAlignLeftToggle").update(u),C.getCommand("formatAlignCenterToggle").update(u),C.getCommand("formatAlignRightToggle").update(u),C.getCommand("formatAlignJustifyToggle").update(u),C.getCommand("formatAlignCenterContinuousToggle").update(u),C.getCommand("formatAlignDistributedHorizontalToggle").update(u),C.getCommand("formatAlignFillToggle").update(u),C.getCommand("formatFontSizeIncrease").update(u),C.getCommand("formatFontSizeDecrease").update(u),C.getCommand("formatFontFamily").update(u),C.getCommand("formatFontSize").update(u),C.getCommand("formatNumberFormat").update(u),C.getCommand("formatNumberFormatGeneralStyle").update(u),C.getCommand("formatNumberFormatNumberStyle").update(u),C.getCommand("formatNumberFormatTimeStyle").update(u),C.getCommand("formatNumberFormatDateStyle").update(u),C.getCommand("formatNumberFormatAccountingStyle").update(u),C.getCommand("formatNumberFormatPercentStyle").update(u),C.getCommand("formatNumberFormatScientificStyle").update(u),C.getCommand("formatNumberFormatCommaStyle").update(u),C.getCommand("formatNumberFormatIncreaseDecimal").update(u),C.getCommand("formatNumberFormatDecreaseDecimal").update(u),C.getCommand("hideColumns").update(u),C.getCommand("unhideColumns").update(u),C.getCommand("hideRows").update(u),C.getCommand("unhideRows").update(u),C.getCommand("insertFunctionSum").update(u),C.getCommand("insertFunctionAverage").update(u),C.getCommand("insertFunctionCount").update(u),C.getCommand("insertFunctionMax").update(u),C.getCommand("insertFunctionMin").update(u),C.getCommand("insertFunction").update(u),C.getCommand("startEditCurrentTime").update(u),C.getCommand("startEditCurrentDate").update(u),C.getCommand("startEditValueAbove").update(u),C.getCommand("fillDown").update(u),C.getCommand("fillRight").update(u),C.getCommand("fillUp").update(u),C.getCommand("fillLeft").update(u),C.getCommand("formatCellStyle").update(u),C.getCommand("formatTableStyle").update(u),C.getCommand("formatPainterToggle").update(u),C.getCommand("formatBorderAddOutline").update(u),C.getCommand("formatBorderClearOutline").update(u),C.getCommand("formatIndentDecrease").update(u),C.getCommand("formatIndentIncrease").update(u),C.getCommand("clearContents").update(u),C.getCommand("clearFormats").update(u),C.getCommand("clearAll").update(u),C.getCommand("clearComments").update(u),C.getCommand("clearHyperlinks").update(u),C.getCommand("autoFilterClear").update(u),C.getCommand("autoFilterReapply").update(u);const S=j===d.ITextFrame.HorizontalAlignment.CenterContinuous||j===d.ITextFrame.HorizontalAlignment.Fill,D={disabled:T||S};C.getCommand("formatTextRotate0").update(D),C.getCommand("formatTextRotate45").update(D),C.getCommand("formatTextRotate90").update(D),C.getCommand("formatTextRotate270").update(D),C.getCommand("formatTextRotate315").update(D),C.getCommand("formatTextRotateCustom").update(D),C.getCommand("formatTextRotateVertical").update(D)},[xe]),C}var Vo,Uo;(function(){if(Uo)return Vo;Uo=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 cn=="object"&&cn&&cn.Object===Object&&cn,f=typeof self=="object"&&self&&self.Object===Object&&self,m=l||f||Function("return this")(),s=Object.prototype.toString,v=Math.max,b=Math.min,y=function(){return m.Date.now()};function g(x){var E=typeof x;return!!x&&(E=="object"||E=="function")}function k(x){if(typeof x=="number")return x;if((function(W){return typeof W=="symbol"||(function(V){return!!V&&typeof V=="object"})(W)&&s.call(W)=="[object Symbol]"})(x))return NaN;if(g(x)){var E=typeof x.valueOf=="function"?x.valueOf():x;x=g(E)?E+"":E}if(typeof x!="string")return x===0?x:+x;x=x.replace(e,"");var z=n.test(x);return z||i.test(x)?a(x.slice(2),z?2:8):t.test(x)?NaN:+x}Vo=function(x,E,z){var W,V,R,P,p,F,M=0,H=!1,N=!1,B=!0;if(typeof x!="function")throw new TypeError("Expected a function");function $(I){var q=W,O=V;return W=V=void 0,M=I,P=x.apply(O,q)}function ce(I){var q=I-F;return F===void 0||q>=E||q<0||N&&I-M>=R}function _(){var I=y();if(ce(I))return K(I);p=setTimeout(_,(function(q){var O=E-(q-F);return N?b(O,R-(q-M)):O})(I))}function K(I){return p=void 0,B&&W?$(I):(W=V=void 0,P)}function L(){var I=y(),q=ce(I);if(W=arguments,V=this,F=I,q){if(p===void 0)return(function(O){return M=O,p=setTimeout(_,E),H?$(O):P})(F);if(N)return p=setTimeout(_,E),$(F)}return p===void 0&&(p=setTimeout(_,E)),P}return E=k(E)||0,g(z)&&(H=!!z.leading,R=(N="maxWait"in z)?v(k(z.maxWait)||0,E):R,B="trailing"in z?!!z.trailing:B),L.cancel=function(){p!==void 0&&clearTimeout(p),M=0,W=F=V=p=void 0},L.flush=function(){return p===void 0?P:K(y())},L}})();var Ko,Wo,$o={exports:{}},so={};Wo||(Wo=1,$o.exports=(function(){if(Ko)return so;Ko=1;var e=o,t=typeof Object.is=="function"?Object.is:function(s,v){return s===v&&(s!==0||1/s==1/v)||s!=s&&v!=v},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function f(s){var v=s.getSnapshot;s=s.value;try{var b=v();return!t(s,b)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(s,v){return v()}:function(s,v){var b=v(),y=n({inst:{value:b,getSnapshot:v}}),g=y[0].inst,k=y[1];return a(function(){g.value=b,g.getSnapshot=v,f(g)&&k({inst:g})},[s,b,v]),i(function(){return f(g)&&k({inst:g}),s(function(){f(g)&&k({inst:g})})},[s]),l(b),b};return so.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,so})()),$o.exports;var Go,_o,ln={exports:{}},Zt={exports:{}},Wl=Zt.exports;function Zo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(_o)return ln.exports;_o=1;for(var e=(Go||(Go=1,function(){var y,g,k,x,E,z;typeof performance<"u"&&performance!==null&&performance.now?Zt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Zt.exports=function(){return(y()-E)/1e6},g=process.hrtime,x=(y=function(){var W;return 1e9*(W=g())[0]+W[1]})(),z=1e9*process.uptime(),E=x-z):Date.now?(Zt.exports=function(){return Date.now()-k},k=Date.now()):(Zt.exports=function(){return new Date().getTime()-k},k=new Date().getTime())}.call(Wl)),Zt.exports),t=typeof window>"u"?cn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],f=0;!a&&f<n.length;f++)a=t[n[f]+"Request"+i],l=t[n[f]+"Cancel"+i]||t[n[f]+"CancelRequest"+i];if(!a||!l){var m=0,s=0,v=[],b=1e3/60;a=function(y){if(v.length===0){var g=e(),k=Math.max(0,b-(g-m));m=k+g,setTimeout(function(){var x=v.slice(0);v.length=0;for(var E=0;E<x.length;E++)if(!x[E].cancelled)try{x[E].callback(m)}catch(z){setTimeout(function(){throw z},0)}},Math.round(k))}return v.push({handle:++s,callback:y,cancelled:!1}),s},l=function(y){for(var g=0;g<v.length;g++)v[g].handle===y&&(v[g].cancelled=!0)}}ln.exports=function(y){return a.call(t,y)},ln.exports.cancel=function(){l.apply(t,arguments)},ln.exports.polyfill=function(y){y||(y=t),y.requestAnimationFrame=a,y.cancelAnimationFrame=l},ln.exports})();const $l="_sheet-scrollbar_104cg_1",Ro=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:m,showCustomScrollButtons:s=!0,offset:v=0,totalSize:b=0,viewportSize:y=0,className:g,endGap:k,...x}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[E]=Vt(),z=r.useCallbackRef(l,[l]),W=r.useCallbackRef(f,[f]),V=(R=E,P=t,o.useMemo(()=>R===null&&P===null?null:ve=>{Zo(R,ve),Zo(P,ve)},[R,P]));var R,P;const[p,F]=o.useState(()=>{const ve=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?ve.top:ve.left}),M=()=>{const ve=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?ve.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ve.coords.rowIndex)-ve.topLeft.top,scroll:ve.topLeft.top}:ve.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ve.coords.colIndex)-ve.topLeft.left,scroll:ve.topLeft.left}},[H,N]=o.useState(M),[B,$]=o.useState(null),[ce,_]=o.useState(!1),K=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),L=()=>{const ve=a.getUsedRange()?.getCoords()??me.CoordUtils.EmptyRange,Re=a.getSelection().getCoords().cell;return{colIndex:Math.max(ve.colEnd,Re.colIndex),rowIndex:Math.max(ve.rowEnd,Re.rowIndex)}},[I,q]=o.useState(L),O=I?(i===r.ScrollbarOrientation.Vertical?I.rowIndex:I.colIndex)+1:0,Q=()=>{const ve=L();me.CoordUtils.isEqualCells(I,ve)||q(ve)};et(a.getView(),{onFreezeSplitChange:()=>{N(M)}}),et(a.getSelection(),{onChange:Q}),et(a,{onUsedRangeChange:Q}),o.useEffect(()=>{q(L())},[a]),o.useEffect(()=>{if(!B)return ce&&W?.(),void _(!1);const ve=K.getTextAt(K.findIndex(p/(a.getView().getZoomScale()/100)+H.scroll+H.shift));_(!0),z?.({...B,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ve})},[v,p,H,i,B,K,ce,a]);const re=r.useCallbackRef((ve,Re,We)=>{F(ve);const Y=ve+H.scroll,Z=Re+H.shift,de=We+H.shift+H.scroll;m?.(Y,Z,de)},[m,H]),be=v-H.scroll,he=y-H.shift,ze=b-(H.shift+H.scroll),Pe=K.findOffset(O)*(a.getView().getZoomScale()/100)-(H.scroll+H.shift);return o.useMemo(()=>c.jsx(r.VirtualScrollbar,{ref:V,className:dt(g,$l),style:n,offset:be,viewportSize:he,totalSize:ze,orientation:i,showCustomScrollButtons:s,onMouseDown:ve=>{$({anchor:{x:ve.clientX,y:ve.clientY}}),ve.preventDefault()},onScrollOffset:re,onMouseOut:()=>{$(null)},onMouseUp:()=>{$(null)},minSize:Pe,...x}),[g,be,he,ze,i,s,n,Pe,k])}));Ro.displayName="SheetScrollbar";const Xo=(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},Yo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:m,containerHeight:s,headerText:v,freezeStart:b,gridStyle:y,verticalPadding:g,horizontalPadding:k,onSheetContextMenu:x,onResizeHeadersStart:E,onResizeHeaders:z,onResizeHeadersEnd:W,onResizeHeadersDown:V,onResizeHeadersUp:R,scrollPoint:P,onSelectionStart:p,onSelectionEnd:F}=e,M=o.useMemo(()=>n.getOrientation(),[n]),H=o.useRef(null),[N,B]=o.useReducer(j=>j+1,0),[$,ce]=o.useReducer(j=>j+1,0),_=n?.getSheet(),K=o.useRef(!1);o.useLayoutEffect(()=>{K.current=!0},[n]);const L=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),I=o.useMemo(()=>{const j=M===d.IRange.Orientation.Column;return{left:j?P.left:0,top:j?0:P.top}},[P]),[q,O]=o.useState(_?.getView().getZoomScale()/100),[Q,re]=o.useState(null);et(n,{onSizesChange:j=>{O(_?.getView().getZoomScale()/100),Ee(ge())}});const be=o.useCallback(()=>{H.current?.invalidate(),ce()},[]),he=o.useCallback(me.CommonUtils.debounce(()=>{be()},10),[]),[ze,Pe]=o.useState(null);et(n.getSheet(),{onSelectionChange(){Pe(_?.getSelection().getCoords()),he()},onProtectionChange(){be()},onViewChange(){he()}}),o.useLayoutEffect(()=>{Ee(ge())},[M,q,f]),o.useLayoutEffect(()=>{re(null),O(n?.getSheet().getView().getZoomScale()/100),Ee(ge())},[n]);const ve=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),Re=o.useCallback((j,G)=>n.hiddenHeadersAt(j,G),[ve]),We=r.useCallbackRef(j=>n.isSelected(j),[n]),Y=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),Z=o.useCallback(()=>n.getMinSize(),[n]),de=o.useCallback(()=>n.getMaxSize(),[n]),Ie=r.useCallbackRef((j,G,qe)=>{G/=q;const Ce={size:G=Math.max(Z(),Math.min(me.CommonUtils.roundAccurately(G,Z()),de())),hidden:!1},h=[];if(G<=0&&(Ce.hidden=!0,Ce.size=qe),h.push({address:{min:j,max:j},update:Ce}),G<0){const w=M===d.IRange.Orientation.Column,T=w?le.getColOffset:le.getRowOffset,u=w?le.getColIndex:le.getRowIndex,S=T(j);let D=u(S+G);const oe=T(D);oe===S+G?D--:h.push({address:{min:D,max:D},update:{size:S-oe+G}}),j-D>1&&h.push({address:{min:D+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(h),z?.(j,G,qe)},[N,n,q,z]),ye=r.useCallbackRef((j,G,qe)=>{const Ce=M===d.IRange.Orientation.Column;let h=null,w={min:j,max:j};if(n.isSelectedAll(j)){const T=n.getSelectedRuns();T.length>1?h="Resize "+(Ce?"Columns":"Rows"):w=T[0];const u={hidden:G<=0,size:(G<=0?qe:G)/q};n.updateHeaderPairs(Xo(T,u,j))}if(w){const T=w.max-w.min+1;let u;u=T===1?n.getRange(w).at(0).getDisplayText():n.getRange(w).toString(),h=`Resize ${Ce?"Column":"Row"}${T>1?"s":""} '${u}'`}W?.(j,G,h)},[N,n,W]),U=r.useCallbackRef((j,G)=>{const qe=M===d.IRange.Orientation.Column;E(j,G,`Resize ${qe?"Column":"Row"}(s)`)},[E]),te=r.useCallbackRef(j=>{let G=!1;const qe=M===d.IRange.Orientation.Column,Ce=n.getSheet().getEntireRange().getCoords(),h=[],w=n.getSelectedRuns(),T=u=>{let S;S=qe?{colStart:u.min,rowStart:Ce.rowStart,colEnd:u.max,rowEnd:Ce.rowEnd}:{colStart:Ce.colStart,rowStart:u.min,colEnd:Ce.colEnd,rowEnd:u.max},h.push(S)};for(let u=0;u<w.length;u++){const S=w[u];S.value.isSelectedAll&&(S.min<=j&&S.max>=j&&(G=!0),T(S))}if(G||T({min:j,max:j}),n.getSheet().getRanges(h).autoFit({orientations:qe?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),ve(j)){const u={hidden:null},S=Xo(w,u);G||S.push({address:j,update:u}),n.updateHeaderPairs(S)}W?.(j,null,"Resize Column(s)")},[N,n,W,ve]),ge=()=>{const j=M===d.IRange.Orientation.Column;return{getColOffset:G=>j?n.findOffset(G):G===0?0:f/q,getColIndex:G=>j?n.findIndex(G):0,getRowOffset:G=>j?G===0?0:f/q:n.findOffset(G),getRowIndex:G=>j?0:n.findIndex(G)}},[le,Ee]=o.useState(()=>ge()),ie=o.useCallback((j,G)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!Y(M===d.IRange.Orientation.Column?G.colIndex:G.rowIndex),[M,Y]),pe=r.useCallbackRef(j=>{a.focusSheet()},[a]),De=r.useCallbackRef(j=>{_?.getSelection().updateCoords(j)},[_]),{...xe}=ht.useSelection({gridRef:i,commands:null,layout:le,selection:ze,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:De,canSelectionSpanMergedCells:j=>{const G=_.getRange(j);return G.isEntireColumns()||G.isEntireRows()}}),Oe=r.useCallbackRef(()=>{p?.();const j=_?.getSelection();j&&j.setAdjusting(j.getCoords())},[_,p]),Be=r.useCallbackRef(async()=>{_?.getSelection().setAdjusting(null),F?.()},[_,F]),{...C}=ht.useHeaderSelection({orientation:M,headerCount:L,gridRef:H,gridMainRef:i,newSelection:xe?.newSelection,modifySelection:xe?.modifySelection,appendSelection:xe?.appendSelection,clearSelections:xe?.clearSelections,pointerDownInterceptor:ie,onPointerUp:pe,onDragStart:Oe,onDragEnd:Be}),je=y.selection?.strokeFill;o.useEffect(()=>{if(!H.current)return void re(null);const j=M===d.IRange.Orientation.Column,G=n.getSelectedRuns(),qe=n.isProtected()?null:Ie,Ce=(w,T,u)=>{if(u)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${je}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(u.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(u.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},w):c.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${je}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(u.y-y.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,width:f+y.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(u.height+y.headerSelection.strokeWidth+1,!0)}px`}},w)},h=(w,T,u)=>{const S={x:0,y:0,width:0,height:0};if(j){const D=u.toClipBounds(u.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:w,colEnd:Math.min(L,T)}),ht.SELECTION_CLIP_INSETS);if(!D)return;S.x=D.x,S.width=D.width}else{const D=u.toClipBounds(u.getRangeCoordsBounds({rowStart:w,rowEnd:Math.min(L,T),colStart:0,colEnd:0}),ht.SELECTION_CLIP_INSETS);if(!D)return;S.y=D.y,S.height=D.height}return{x:S.x,y:S.y,width:S.width,height:S.height}};re([w=>{let T=null,u=j?w.getVisibleColumns():w.getVisibleRows();const S=j?w.getTotalRangeCoords().colStart:w.getTotalRangeCoords().rowStart;u.length>0&&u[0]>S&&(u=[u[0]-1,...u]);let D=[];const oe=[],fe=u.length;for(let Me=0;Me<fe;Me++){const Te=u[Me],Ue=Me<fe-1?u[Me+1]:Te+Re(Te+1,!1)+1,_e=Te+1!==Ue;if(!T||T.max<Te)if(G.length>0&&G[G.length-1].max>=Te){const Je=me.CommonUtils.findEqualOrGreater(G,Te,Le=>Le.max);T=G[Je]}else T=null;let $e=!1,Ye=!1;if(T?.value&&(T.min<=Te||T.min<=Ue&&!_e)&&($e=!0,Ye=T.value.isSelectedAll),Te===S){let Je=!1,Le=!1;T?.value&&T.min<=Te&&(Je=!0,Le=T.value.isSelectedAll),Te>0&&oe.push({index:Te-1,isNextHidden:_e,isSelected:Je,isSelectedAll:Le,disabledResize:!0})}if(Ye&&D.push(oe.length),oe.push({index:Te,isHidden:Me===0&&Re(Te,!1)>0,isNextHidden:_e,isSelected:$e,isSelectedAll:Ye,onDividerMouseDown:V,onDividerResizeStart:U,onDividerResize:qe,onDividerMouseUp:R,onDividerResizeEnd:ye,onDividerAutoFit:te}),_e){let Je=!1,Le=!1;if(T&&T.min>=Te&&T.max<=Ue-1&&T.value.isSelectedAll&&D.push(oe.length),!(T?.value&&T.max>=Ue))if(G.length>0&&G[G.length-1].max>=Ue){const Xe=me.CommonUtils.findEqualOrGreater(G,Ue,vt=>vt.max);T=G[Xe]}else T=null;T?.value&&T.min<=Ue&&(Je=T.value.isSelected,Le=T.value.isSelectedAll),Ue>0&&oe.push({index:Ue-1,isHidden:!0,isSelected:Je,isSelectedAll:Le,onDividerMouseDown:V,onDividerResizeStart:U,onDividerResize:qe,onDividerMouseUp:R,onDividerResizeEnd:ye,onDividerAutoFit:te})}}if(D.length>0){let Me=D.length-1;if(D.length>0){const _e=oe[D[Me]].index;let $e=null;j?($e=w.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),$e.x+$e.width>w.getBounds().width&&(Me-=1,Me===0&&(Me=-1))):($e=w.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),$e.y+$e.height>w.getBounds().height&&(Me-=1,Me===0&&(Me=-1)))}const Te=G?.[G.length-1],Ue=w.getAnchor();if(Ue==="t"||Ue==="l"){const _e=oe[D[Math.max(0,D.length-1)]];_e.showTouchDivider=Te&&Te.max<=_e.index}else Me>=0&&(oe[D[Me]].showTouchDivider=!0)}const{header:se,headerSelect:ne,headerSelectAll:ae,headerHover:ue}=y??{},we=oe.length,He=new Array(we);for(let Me=0;Me<we;Me++)He[Me]=c.jsx(ht.HeaderDivider,{orientation:M,view:w,headerStyle:se,headerStyleSelect:ne,headerStyleSelectAll:ae,headerStyleHover:ue,disabled:n.isProtected(),...oe[Me]},`divider${Me}`);return He},w=>{const T=[],u=G.length;for(let S=0;G&&S<u;S++)T.push(Ce(`selection:${w.getAnchor()}:${S}`,0,h(G[S].min,G[S].max,w)));return T}])},[$,!0,je,y,le,L,b,N,q]),o.useEffect(()=>{H.current?.invalidate()},[N]);const tt=r.useCallbackRef(j=>v?v(j):n.getTextAt(j),[v,n]),ee=r.useCallbackRef(j=>{const{header:G,headerSelect:qe,headerSelectAll:Ce,headerHover:h}=y??{},{range:w,key:T,...u}=j;return c.jsx(ht.HeaderRenderer,{orientation:M,index:M===d.IRange.Orientation.Column?w.colStart:w.rowStart,isSelected:We,isSelectedAll:Y,zoomScale:100*q,headerText:tt,headerStyle:G,headerStyleSelect:qe,headerStyleSelectAll:Ce,headerStyleHover:h,verticalPadding:g,horizontalPadding:k,...u},T)},[N,L,y,q,n]),ke=r.useEditMode(),Ne=o.useMemo(()=>{const j="white",G="black",qe={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let Ce=M===d.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='${G}' 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='${G}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;ke.getMode()?.key==="formatPainter"&&(Ce=`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='${G}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),qe.cursor=Ce}return qe.backgroundColor=y?.header?.fill||"transparent",qe},[M,N,ke,y]),Ae=r.useImperativeElement(t,()=>({scrollTo:j=>{H.current?.scrollTo(j)},forceRender:()=>{B()},getGridElement:()=>H.current}),[]),Fe=o.useCallback(j=>{C.onPointerDown(j)},[C]),A=o.useCallback(j=>{const G=C.getCellCoordsFromClient(j.clientX,j.clientY);if(!G||!x)return;const qe=M===d.IRange.Orientation.Column;x({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:qe?-1:G.rowIndex,colIndex:qe?G.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[C,x]),J=o.useMemo(()=>{const j=M===d.IRange.Orientation.Column;return c.jsx("div",{ref:Ae,children:c.jsx(ht.Grid,{className:"sheet-header",style:Ne,ref:H,scrollPoint:I,columnCount:j?L:1,rowCount:j?1:L,width:j?m:f,height:j?f:s,freezeLeft:j?b:void 0,freezeTop:j?void 0:b,hiddenColumnsAt:j?Re:void 0,hiddenRowsAt:j?void 0:Re,showGridLines:!1,layout:le,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:A,onPointerDown:Fe,zoom:q,cellRenderer:ee,overlays:Q})})},[Q,le,m,s,I,Ne,$]);return o.useEffect(()=>{K.current=!1,H.current?.invalidate(),ce()},[n,y]),J})),Gl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((v,b)=>v.getStyle().getBorder(),[]),{overlay:m}=xo({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),s=m(n);return s&&n?s:null})),_l={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Zl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Xl={type:d.ICell.Content.Values},Yl={fitDestination:!0,type:d.ICell.Content.Formats},Jl={fitDestination:!0,type:d.ICell.Content.Formulas},Ql={transpose:!0},ei={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},zr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:f=ht.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:s="rgb(33, 115, 70)",copyBackgroundColor:v="white",cutBackgroundColor:b="white",...y})=>{const g=r.useCallbackRef(f,[f]),k=o.useRef(null),x=r.useEditMode(),E=x.getMode(),z=o.useMemo(()=>({element:e,doCopy:p=>{const F=t.getSelectedRanges().getSnapshot(p);return new d.RangeClipboardItem(F)}}),[t,n,e]),W=o.useMemo(()=>({element:e,importFromExternal:async(p,F)=>{const M=new d.ExternalRangeClipboardItem(p,F,t.getStyles(),t.isDate1904());return await M.parse()?M:null},doPaste:async(p,F)=>{if(p?.getItemType()!=="range")return;F?.contentsOnly&&delete(F={...F,type:d.ICell.Content.Values}).contentsOnly;const M=p.getItem(),H=M.getName();let N=t.getSelectedRange();if(H==="HTML"&&N.size>1){const B=M?.getCoords();B&&me.CoordUtils.isSingleCell(B)&&(N=N.getResizeTo(1,1))}return await N.doBatch(async()=>{const B=await N.copyFrom(M,F);!B||B.isEntireRows()||B.isEntireColumns()||B.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(H?` ${H}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:V,...R}=r.useCopyPaste({...y,source:z,commands:i,target:W,onClipboardUpdate:p=>{const F=p?.getItemType()==="range"?p:null;if(F){const M=p.editMode?.(),H={...p?.isCut?.()?Zl:_l,...M,args:{isClipboard:!0,...M?.args},onModeChange:N=>{N?.args?.isClipboard||V.clear(!0),M?.onModeChange?.(N)}};x.setMode(H)}k.current=F,a?.(F)},onPaste:(p,F)=>{if(p?.getItemType()!=="range")return;let M=x.getMode()?.key==="cut"||p.isCut?.();if(!M&&x.getMode()?.key==="copy"){const H=p.getItem().getCoords(),N=t.getSelectedRanges().getCoords();let B=!1;if(!B&&H&&N&&p.getItem().getSource?.()===t)for(let $=0;!B&&$<N.length;$++)B=me.CoordUtils.isRangesIntersect(H,N[$]);M=B}M&&x.setMode(null),e?.()?.focus(),l?.(p,F)}});o.useMemo(()=>{const p=e;if(!i)return;const F=[new r.Command("pasteValues",p,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
20
20
|
|
|
21
21
|
The formatting is not applied.`,icon:"PasteValues",shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",p,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
22
22
|
|
|
23
|
-
The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",p,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied.",icon:"PasteFormulas"}),new r.Command("pasteTranspose",p,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",p,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];l.addCommands(F,!0)},[l,e]),o.useEffect(()=>{if(!l)return;const p={disabled:!t.getProtection().isFormatCellsAllowed()};l.getCommand("pasteValues").updateCallback(F=>R.paste({...ti,...F})).update(p),l.getCommand("pasteFormats").updateCallback((F,M)=>R.paste({...ni,description:M.label(),...F})).update(p),l.getCommand("pasteFormulas").updateCallback((F,M)=>R.paste({...oi,description:M.label(),...F})).update(p),l.getCommand("pasteTranspose").updateCallback((F,M)=>R.paste({...ri,description:M.label(),...F})).update(p),l.getCommand("pasteLinks").updateCallback((F,M)=>R.paste({...li,description:M.label(),...F})).update(p),l.getCommand("cut").update(p),l.getCommand("paste").update(p)},[t,l]);const P=o.useMemo(()=>{if(!E||!k.current)return;const p=E.key;if(p!=="copy"&&p!=="cut"&&p!=="formatPainter")return;const F=k.current.getItem();if(F.getSource()!==t)return;const M=k.current.isCut?.(),H=M?b:v,N=M?s:m,B=F.getCoords(),W=B?[B]:null;return W&&W.length!==0?ce=>{const G=[];for(let K=0;K<W.length;K++){const L=W[K],I=ce.toClipBounds(ce.getRangeCoordsBounds(L,{top:0,left:0,right:1,bottom:1}),ut.SELECTION_CLIP_INSETS);I&&(G.push(g({range:L,key:`copy-selection-background-${K}`,x:I.x,y:I.y,width:Math.max(I.width,0),height:Math.max(I.height,0),stroke:H,strokeWidth:2})),G.push(g({range:L,key:`copy-selection-foreground-${K}`,x:I.x+(I.width<=2?-1:0),y:I.y,width:Math.max(I.width,3),height:Math.max(I.height,3),stroke:N,strokeWidth:2,isAnimatedStroke:!0})))}return G}:null},[E,t,n,m,v,s,b]);return{...R,clipboard:V,overlays:P}},ii=o.memo(o.forwardRef((e,t)=>{const{view:n,element:l,sheet:a,gridStyle:i,commands:f}=e,m=i.body??{},s=a.getView(),{overlays:v}=Pr({element:l,sheet:a,sheetView:s,commands:f,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:m.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:m.fill});return tt(a?.getSelection(),{onChange(b){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),v&&n?v(n):null})),ai="_sheet-selection_12wyx_5",si={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},ci={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},di={key:"dragCopy",description:"Drag selection to copy cell contents."},ui={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},er=(e,t)=>t.ctrlKey&&t.shiftKey?ui:t.ctrlKey?di:t.shiftKey?ci:si,gi={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},hi=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:l,className:a,onFirstRender:i,onShowTooltip:f,onCloseTooltip:m,sheet:s,gridRef:v,gridStyle:b,isActive:y,editingCoords:g,...k}=e,x=n?.getBounds(),E=r.useCallbackRef(f,[f]),z=r.useCallbackRef(m,[m]),[$,V]=o.useState(()=>s?.getSelection().getCoords()),R=r.useCallbackRef(U=>{he.CoordUtils.isEqualSelectionCoords(U,$)||s&&s.getSelection().updateCoords(U)},[s,$]),P=r.useEditMode(),p=o.useRef(null),[F,M]=o.useState(s?.getProtection().isLocked()),[H,N]=o.useState(s?.getView().getMovableSelection().length>0),B=r.ReactUtils.detectIt().primaryInput==="touch",W=!B&&y,ce=g??P.getMode()?.args?.stateAndCoords?.coords??null,G=ce!==null||H,K=r.useCallbackRef(U=>{const ee=he.CoordUtils.cellToRange(U);if(s.isClosed())return ee;const ge=s.getRange(ee,{ignoreHidden:!0}).getMerges();return ge.length===0?ee:ge[0]},[s]),L=r.useCallbackRef((U,ee,ge,le,Ee,ie)=>{const pe=s.getSelectedRange().getExtended(le,U).getCoords();switch(le){case d.IRange.Direction.Up:return pe.rowStart;case d.IRange.Direction.Down:return pe.rowEnd;case d.IRange.Direction.Left:return pe.colStart;case d.IRange.Direction.Right:return pe.colEnd}},[s]),I=r.useCallbackRef(()=>{const U=s.getUsedRange()?.getCoords(),ee=s.getRowHeaders().getUsedRange()?.getCoords(),ge=s.getColumnHeaders().getUsedRange()?.getCoords();return{...U,colEnd:Math.max(U?.colEnd??0,ge?.max??0),rowEnd:Math.max(U?.rowEnd??0,ee?.max??0)}},[s]),q=r.useCallbackRef((U,ee)=>s.getRowHeaders().hiddenHeadersAt(U,ee),[s]),O=r.useCallbackRef((U,ee)=>s.getColumnHeaders().hiddenHeadersAt(U,ee),[s]),Q=r.useCallbackRef(U=>s.getRange(U,{ignoreHidden:!0}).getMerges(),[s]),re=r.useCallbackRef(U=>{s?.getSelection().setAdjusting(U)},[s]),be=r.useCallbackRef(async()=>{s?.getSelection().setAdjusting(null),P.getMode()?.key==="formatPainter"&&(await l?.getCommand("pasteFormats")?.execute({}),P.setMode(null))},[P,$,s,l]),me=o.useMemo(()=>{const U=P.getMode();return U?.key==="cut"||U?.key==="copy"},[P]);tt(s?.getView(),{onMovableSelectionChange:()=>{N(s.getView().getMovableSelection().length>0)}}),tt(s?.getSelection(),{onChange(U){const ee=s.getSelection().getCoords();V(ee)}}),tt(s,{onProtectionChange:()=>{M(s.getProtection().isLocked())}});const{body:ze={}}=b||{},Pe=r.useNotifier(),ve=n.getLayout(),Re=!(W&&$.ranges.length<=1&&ce===null&&!F&&(!P.getMode()||me)),{cursor:Ke,overlay:Y,onPointerDown:Z}=ut.useSelection({gridRef:v,commands:l,layout:ve,getCellCoordsAsRangeCoords:K,selection:$,fillHandleBorderColor:ze.fill,selectionBackgroundColor:y?b.selection.fill:b.selectionInactive.fill,selectionBorderColor:y?b.selection.strokeFill:b.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?b.selectionRemove.fill:b.selectionInactive.fill,selectionRemoveBorderColor:y?b.selectionRemove.strokeFill:b.selectionInactive.strokeFill,disableFillDrag:Re,disableMoveDrag:B||!(y&&$.ranges.length<=1&&ce===null&&!F),disableTouchSelection:G,onSelectionChange:R,onSelectionDragStart:re,onSelectionDragEnd:be,onMoveDragStart:(U,ee,ge)=>{P.setMode(er(0,ge))},onMoveDragUpdate:(U,ee,ge)=>{P.setMode(er(0,ge))},onMoveDragEnd:(U,ee)=>{P.setMode(null)},onMoveDragDone:async(U,ee,ge)=>{if(he.CoordUtils.isEqualRanges(U,ee))return;const le=s.getRange(ee);if(Pe?.showOptions){const xe=le.getDifferences(U);let Be=!1;const He=xe.getCount();for(let C=0;!Be&&C<He;C++)Be=xe.at(C).isContentful();if(Be&&await Pe?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const Ee=!ge.ctrlKey,ie=ge.shiftKey,pe=ie?Ee?"Insert Moved Cells":"Insert Copied Cells":Ee?"Move Cells":"Copy Cells",De=await Pe?.showBusy?.(pe);try{const xe=s.getRange(U);await le.doBatch(async()=>{ie?await le.insertFrom(U,{isCut:Ee,undoRange:xe}):await le.copyFrom(U,{isCut:Ee,undoRange:xe}),xe.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),le.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:pe,autoSelect:!0})}catch(xe){Pe?.showError?.(xe)}finally{De?.()}},contentfulCellFinder:L,hiddenRowsAt:q,hiddenColumnsAt:O,mergedRanges:Q,getDataCoords:I,canSelectionSpanMergedCells:U=>{const ee=s.getRange(U);return ee.isEntireColumns()||ee.isEntireRows()},onFill:async(U,ee)=>{const ge="Auto Fill",le=await Pe?.showBusy?.(ge);try{await s.doBatch(()=>{s.getRange(U).autoFill(ee),s.getRange(ee).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:ge,autoSelect:!0})}catch(Ee){Pe?.showError?.(Ee)}finally{p.current=null,le?.()}},onFillPreview:(U,ee,ge)=>{if(v.current&&E){P.setMode(gi);try{p.current?.direction!==ge&&(p.current=null,s.getRange(U).autoFill(ee,{previewOnly:He=>{p.current={callback:He,direction:ge}}}));const le=p.current?.callback?.(ee);if(!le||le.isEmpty())return;const Ee=le.toText();if(!Ee)return;const ie=he.CoordUtils.cellToRange(le.getCoords()),pe=n.getRelativePointFromClient(0,0);let De=0,xe=0,Be=r.ToolTipPlacement.Bottom;if(ge===d.IRange.Direction.Down){De=ve.getColOffset(ie.colEnd+1)-pe.x;const He=ve.getRowOffset(ie.rowEnd),C=ve.getRowOffset(ie.rowEnd+1);xe=C-(C-He)/2-pe.y,Be=r.ToolTipPlacement.Right}else if(ge===d.IRange.Direction.Right){xe=ve.getRowOffset(ie.rowEnd+1)-pe.y;const He=ve.getColOffset(ie.colEnd),C=ve.getColOffset(ie.colEnd+1);De=C-(C-He)/2-pe.x,Be=r.ToolTipPlacement.Bottom}else if(ge===d.IRange.Direction.Up){De=ve.getColOffset(ie.colEnd+1)-pe.x;const He=ve.getRowOffset(ie.rowStart),C=ve.getRowOffset(ie.rowStart+1);xe=C-(C-He)/2-pe.y,Be=r.ToolTipPlacement.Right}else if(ge===d.IRange.Direction.Left){xe=ve.getRowOffset(ie.rowEnd+1)-pe.y;const He=ve.getColOffset(ie.colStart),C=ve.getColOffset(ie.colStart+1);De=C-(C-He)/2-pe.x,Be=r.ToolTipPlacement.Bottom}E({anchor:{x:De,y:xe},display:Ee,placement:Be})}catch(le){Pe?.showError?.(le)}}},onFillDone:()=>{p.current=null,P.setMode(null),z?.()}}),de=r.useCallbackRef(U=>{Z(r.ReactUtils.createSyntheticEvent(U))},[Z,ce]);o.useEffect(()=>{const U=n?.getStage();if(U)return U.addEventListener("pointerdown",de),()=>{U.removeEventListener("pointerdown",de)}},[n?.getStage()]);const Ie=r.useImperativeElement(t,()=>({}),[]),we=o.useRef(null);return c.jsx("div",{className:ct(a,"sheet-selection",ai),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Qt([Ie,we]),...k,children:Y(n)})})),Fn=Object.freeze({x:0,y:0,width:0,height:0}),mi={fireOnModelChange:!1},fi=o.memo(o.forwardRef((e,t)=>{const{children:n,view:l,movable:a,onRefLoad:i,onRefUnload:f,onHide:m,onShow:s,onUnFocus:v,isDragging:b,updateFrameBounds:y,dragStart:g,style:k,disabled:x,renderMovable:E,...z}=e,[$,V]=o.useState(Fn),[R,P]=o.useState(null),[p,F]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const N=a.getBounds();if(!N)return;const B=l.toViewBounds(N);V(B??Fn),y(B??Fn)},[l?.getBounds()]),tt(a,{onBoundsChange:N=>{const B=N.getBounds();if(!B)return;const W=l.toViewBounds(B);V(W??Fn),y(W)},onSelectionChange:()=>{const N=he.CommonUtils.hasFocus(M.current,!0);!p&&!N||a.isSelected()||v()}}),tt(a,{onRequestFocus:()=>he.CommonUtils.whenFocus(M.current,!0)},mi),o.useEffect(()=>{const N=M.current;return i(N),()=>{f(N)}},[]);const H=o.useMemo(()=>{if(!$)return null;let{width:N,height:B}=$;return E({view:l,movable:a,disabled:x,isDragging:b,style:{position:"relative",left:0,top:0,width:N,height:B},onHide:m,onShow:s})},[l,a,$.width,$.height,x,b]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Qt([M,t]),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,...k},onMouseDown:async N=>{const B=N.shiftKey||N.ctrlKey,W=a.isSelected(),ce=N.currentTarget;B&&W?a.unselect():(W&&!B||await a.select({addToSelection:B}),g(N.nativeEvent,ce),ce.focus())},onFocus:N=>{N.relatedTarget&&!R&&P(N.relatedTarget),F(!0)},onBlur:N=>{R&&!M?.current?.contains(N.relatedTarget)&&P(null),N.relatedTarget&&F(!1)},...z,children:H})})),pi="_movable-area_314c6_5",jr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:l,movablesView:a,renderMovable:i,transactional:f,onUnFocus:m,onFocus:s,disabled:v=!1,disableDrag:b=!1,disableResize:y=!1,className:g,style:k,renderDirections:x=["nw","n","ne","w","e","sw","s","se"],onFirstRender:E,...z}=e,$=n.getBounds(),V=r.useCallbackRef(E,[E]),R=r.useCallbackRef(m,[m]),P=r.useCallbackRef(s,[s]),[p,F]=o.useState([]),[M,H]=o.useState(!1),[N,B]=o.useState(!1),W=o.useRef(!0),ce=o.useRef(new Map),G=o.useRef(new Map),K=o.useRef(new Map),L=o.useRef(new Map),I=o.useRef(new Map),q=o.useRef({onRequestFocus:te=>(ee(te),null)}),O=o.useRef(null),Q=o.useRef(null),re=o.useRef(null),[be,me]=o.useReducer(te=>te+1,0);o.useLayoutEffect(()=>{me()},[n,l]),tt(l,{onCollectionChange:()=>{const te=l.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),ke=I.current;ke.forEach(Ae=>{Ae()}),ke.clear();const Le=q.current;for(let Ae=0;Ae<te.length;Ae++){const Fe=te[Ae];if(Fe.isClosed())continue;const A=Fe.addListeners(Le);ke.set(Fe,A)}me()},onInvalidated:()=>{me()}}),tt(a,{onMovableSelectionChange(te){Pe(),me()}});const ze=o.useCallback((te,ke)=>{const Le=K.current.get(te);re.current&&(re.current.getTargets().forEach(Ae=>{if(Ae===Le)return Ae.style.left=ke.x+"px",Ae.style.top=ke.y+"px",Ae.style.width=ke.width+"px",void(Ae.style.height=ke.height+"px")}),re.current.updateRect())},[]),Pe=()=>{const te=[],ke=a.getMovableSelection();ke.forEach(Le=>{const Ae=K.current.get(Le);Ae&&ke.indexOf(Le)!==-1&&te.push(Ae)}),F(Le=>he.CommonUtils.isEqualArrays(Le,te)?Le:te)},ve=o.useRef(null),Re=o.useRef(null),Ke=o.useMemo(()=>(Re.current||(Re.current=new Promise(te=>{ve.current=te})),Re.current),[]),Y=o.useRef(null),Z=r.useCallbackRef(async(te,ke)=>{Y.current=ke,await(async()=>!(!await Ke.then()||!re.current))()&&Y.current===ke&&re.current.dragStart(te,ke)},[p]),[de,Ie]=o.useState(!1),we=o.useRef(null),U=o.useRef(null),ee=r.useCallbackRef(async(te=null)=>{if(te||(te=a.getMovableSelection()[0]),!te)return R?.(),!1;const ke=K.current.get(te);ke?(await he.CommonUtils.whenFocus(ke),ke.focus(),U.current=ke,we.current=null):we.current=te},[a]);o.useEffect(()=>{de&&p.length>0&&U.current!==p[0]&&ee(),W.current&&(V?.(),W.current=!1)},[p]);const ge=o.useMemo(()=>{const te=l.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(te.length===0&&ce.current.size===0)return null;const ke=(J,j,_,qe=!0)=>{const ye=J.isSelected(),h={tabIndex:_,view:n,movable:J,onRefLoad:w=>{we.current===J&&(w.focus(),U.current=w,we.current=null),K.current.set(J,w),G.current.set(w,J),j.rendered=!0,Pe()},onRefUnload:w=>{K.current.delete(J),G.current.delete(w),j.rendered=!1,Pe()},onUnFocus:R,onHide:w=>{j.onHide=w},onShow:w=>{j.onShow=w},isDragging:ye&&(N||M),disabled:v,renderMovable:i,updateFrameBounds:w=>{ze(J,w)},dragStart:Z,onMouseUp:()=>{if(Y.current=null,Q.current){H(!1),B(!1);let w=!1;L.current?.forEach(T=>{he.CommonUtils.isEqualBounds(T.movable.getBounds(),T.startBounds)||(w=!0)}),w?Ee():ie()}},style:{opacity:qe?M&&ye?.7:void 0:0,zIndex:M&&ye?J.getZIndex()+te.length:void 0,pointerEvents:qe?void 0:"none",cursor:N&&ye?"grabbing":v||b?"initial":"move",boxShadow:!ye||N&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(fi,{...h},`movable-${J.getUUID()}`)},Le=ce.current,Ae=new Map,Fe=[];for(let J=0;J<te.length;J++){const j=te[J];if(j.isClosed())continue;let _=Le.get(j);_||(_={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(qe,ye)=>{if(!ye||ye.shown===!0)return;ye.shown=!0;const h=++ye.visibilityRequestId;requestAnimationFrame(()=>{const w=ce.current.get(qe);w&&h===ye.visibilityRequestId&&(ye.onShow?.(qe),w.shown=!0)})},doHide:async(qe,ye)=>{if(!ye||ye?.shown===!1)return;ye.shown=!1;const h=++ye.visibilityRequestId,w=await Promise.resolve(ye.onHide?.(qe));h===ye.visibilityRequestId&&w!==!1&&(ye.shown=!1,ce.current.delete(qe),me())},visibilityRequestId:0}),_.frame=ke(j,_,J,!0),Fe.push(_.frame),_.doShow(j,_),Le.delete(j),Ae.set(j,_)}const A=[];return a.getMovableSelection().forEach(J=>{const j=Le.get(J);j&&(j.frame=ke(J,j,-1,!1),A.push(j.frame),Le.delete(J),Ae.set(J,j))}),Le.forEach((J,j)=>{J.frame=ke(j,J,-1,!1),A.push(J.frame),J.doHide(j,J),Le.delete(j),Ae.set(j,J)}),ce.current=Ae,Pe(),[...A,...Fe]},[be,n,i,v,b,y,M,N]),le=r.useCallbackRef((te,ke)=>{const Le=`${ke} ${p.length===1?d.TextUtils.capitalize(G.current?.get(p[0]).getContent().getType()):"Drawings"}`;Q.current&&(console.warn(`Transaction ${Q.current.getDescription()} is being replaced by ${Le}`),Q.current.rollback(),Q.current=null),Q.current=f.beginCommit({description:Le}),L.current.clear();for(let Ae=0;Ae<p.length;Ae++){const Fe=p[Ae],A=G.current?.get(Fe);A?L.current.set(Fe,{movable:A,startBounds:n.toViewBounds(A.getBounds())}):console.warn("invalid element",A)}},[f,n,p]),Ee=o.useCallback(()=>{if(!Q.current)return;const te=[];L.current?.forEach(ke=>{te.push(ke.movable)}),Q.current.commit({viewAfter:{view:a,movableSelection:te}}),L.current.clear(),Q.current=null},[]),ie=o.useCallback(()=>{Q.current&&(Q.current.rollback(),Q.current=null)},[]),pe=o.useRef(null);o.useEffect(()=>{pe.current&&(pe.current.onscroll=te=>{te.preventDefault(),te.srcElement.scrollTop=0,te.srcElement.scrollLeft=0})},[pe.current]);const De=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ee,focus:()=>{ee()}}),[a]),[xe,Be]=o.useState(null),He=o.useRef(!1),C=o.useRef(!1),je=o.useRef(!1);o.useEffect(()=>{if(v||p.length===0||je.current||He.current)return;if(C.current)return void requestAnimationFrame(()=>{re.current&&O.current&&re.current.refTargets.length>0&&(je.current=!0,ve.current?.(!0)),F([...p])});He.current=!0;const te=o.lazy(async()=>{try{const ke=await Promise.resolve().then(()=>require("./TNrN4vNyBjTeRdp1.cjs"));return He.current=!1,C.current=!0,F([...p]),ke}catch(ke){return console.warn(ke),ve.current?.(!1),null}});Be(te)},[p,v,b,y]);const nt=o.useMemo(()=>!xe||v?null:c.jsx(o.Suspense,{children:c.jsx(xe,{className:ct({dragging:M||N,resizing:M,moving:N}),container:null,ref:re,target:re.current?p:[],draggable:!v&&!b,resizable:!v&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:x,onResizeStart:te=>{le(te.target,"Resize")},onResize:te=>{if(!Q.current)return te.stopDrag(),void me();H(!0);const ke=te.direction[0]!==0&&te.direction[1]!==0;let Le=0,Ae=0;for(let Fe=0;Fe<p.length;Fe++){const A=p[Fe],J=L.current.get(A),j=G.current.get(A);if(!J||!j){console.warn("invalid element");continue}let _=te.dist[0],qe=te.dist[1],ye=te.drag.dist[0],h=te.drag.dist[1],w=J.startBounds.width,T=J.startBounds.height;Fe===0?(Le=w,Ae=T):(_*=w/Le,ye*=w/Le,qe*=T/Ae,h*=T/Ae);const u={...J.startBounds};if(u.width=Math.max(0,w+_),u.height=Math.max(0,T+qe),te.direction[0]===-1&&(u.width=Math.max(0,Math.min(J.startBounds.x+w,w-ye))),te.direction[1]===-1&&(u.height=Math.max(0,Math.min(J.startBounds.y+T,T-h))),ke&&(j.isLockAspectRatio()||te.inputEvent?.shiftKey)){const S=w/T,D=u.width/u.height;D>S?u.height=u.width/S:D<S&&(u.width=u.height*S)}te.direction[0]===-1&&(u.x=Math.max(0,Math.min(J.startBounds.x+w,J.startBounds.x+w-u.width))),te.direction[1]===-1&&(u.y=Math.min(J.startBounds.y+T,J.startBounds.y+T-u.height)),J.movable.setBounds(n.toAbsoluteBounds(u))}},onResizeEnd:te=>{H(!1),Ee()},onDragStart:te=>{le(te.target,"Move")},onDrag:te=>{if(!Q.current)return te.stopDrag(),void me();B(!0);for(let ke=0;ke<p.length;ke++){const Le=p[ke],Ae=L.current.get(Le);Ae?Ae.movable.setBounds(n.toAbsoluteBounds({...Ae.startBounds,x:Ae.startBounds.x+te.translate[0],y:Ae.startBounds.y+te.translate[1]})):console.warn("invalid element")}},onDragEnd:te=>{},onMouseUp:te=>{}})}),[be,xe,p,n,v,b,y,M,N]);return c.jsx("div",{className:ct(g,"movable-area",pi),style:{width:$.width,height:$.height,...k,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Qt([De,pe]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:$.width,height:$.height},...z,children:c.jsxs("div",{ref:O,style:{position:"absolute",pointerEvents:"auto"},onFocus:te=>{P?.(),Ie(!0)},onBlur:te=>{Ie(!1)},onKeyDownCapture:te=>{if(te.isDefaultPrevented())return;const ke=te.nativeEvent.ctrlKey,Le=te.nativeEvent.altKey,Ae=te.nativeEvent.shiftKey;if(te.which===r.KeyCodes.Escape){const _=a.getMovableSelection();let qe=[..._];return p.forEach(ye=>{if(qe.length===0)return;const h=G.current.get(ye);let w=qe.indexOf(h);qe.splice(w,1)}),qe.length!==_.length&&a.selectMovables(qe),qe.length===0&&R?.(),void te.preventDefault()}const Fe=.1,A=_=>{l.updateSelected(qe=>{qe.setRotation(qe.getRotation()+_)},"Rotate")},J=(_,qe=!0)=>{l.updateSelected(ye=>{const h=ye.getBounds();let w=1+_;qe||(w=1/w);const T=Math.sqrt(Math.pow(h.width,2)+Math.pow(h.height,2)),u=Math.atan2(h.height,h.width),S=w*T;if(S<10)return;const D=S*Math.cos(u),oe=S*Math.sin(u),fe={x:h.x+(h.width-D)/2,y:h.y+(h.height-oe)/2,width:D,height:oe};ye.setBounds(fe)},"Resize")},j=_=>{l.updateSelected(qe=>{const ye=qe.getBounds(),h={x:ye.x+(_.x??0),y:ye.y+(_.y??0),width:ye.width+(_.width??0),height:ye.height+(_.height??0)};qe.setBounds(h)},"Nudge")};if(te.which===r.KeyCodes.Delete)l.updateSelected(_=>{_.delete()},"Delete"),te.preventDefault();else if(te.key==="a"&&ke){const _=a.getMovableSelection();a.selectMovables(l.getItems(),!0),a.selectMovables(_,!0),te.preventDefault()}else te.key==="ArrowLeft"?(Ae?J(Fe,!1):Le?A(-10):j({x:ke?-10:-1}),te.preventDefault()):te.key==="ArrowRight"?(Ae?J(Fe,!0):Le?A(10):j({x:ke?10:1}),te.preventDefault()):te.key==="ArrowUp"?(Ae?J(Fe,!0):j({y:ke?-10:-1}),te.preventDefault()):te.key==="ArrowDown"&&(Ae?J(Fe,!1):j({y:ke?10:1}),te.preventDefault())},children:[ge,nt]})})})})),Gt=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,l=0,a=0;for(let i=0;i<e.length;i++){const f=e[i].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),l=Math.max(f.x+f.width,l),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:l-t,height:a-n}},tr=(e,t=!0)=>{const n=[],l=t?"x":"y",a=t?"y":"x",i=t?"width":"height";let f=0,m=Number.MAX_SAFE_INTEGER,s=0;for(let y=0;y<e.length;y++){const g=e[y],k=g.getBounds();f+=k[i],m=Math.min(k[l],m),s=Math.max(k[l]+k[i],s),n.push({bounds:k,movable:g})}const v=(s-m-f)/(e.length-1);n.sort((y,g)=>{const k=y.bounds[l],x=g.bounds[l];return k!==x?k-x:y.bounds[a]-g.bounds[a]});const b=new Map;b.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const g=n[y-1].bounds,k={...n[y].bounds};k[l]=g[l]+g[i]+v,n[y].bounds=k,b.set(n[y].movable,k)}return b.set(n[n.length-1].movable,n[n.length-1].bounds),b},Or=e=>{const{movables:t,movablesView:n,transactional:l,commands:a,target:i,onRepeatCommandChange:f}=e,m=r.useNotifier(),s=r.useEditMode();o.useRef(s.getMode()).current=s.getMode();const v=r.useCallbackRef(async(R,P,p=null,F=!0)=>{const M=async()=>{const H=await Promise.resolve(m?.showBusy?.(R.label()));try{await P();const N=p??R?.label?.();if(f){let B=null;R&&N!==!1&&(B=new r.SimpleCommand(R.key(),i,{label:N,description:N},M)),f(B)}H?.(),F&&s.setMode(null)}catch(N){H?.(),m?.showError?.(N)}};await M()},[f,m]),[b,y]=o.useReducer(R=>R+1,0),g=r.useCallbackRef((R,P,p)=>{if(!n)return;const F=n.getMovableSelection();if(F.length===0)return;let M="Drawings";if(F.length===1){const N=F[0];M=d.TextUtils.capitalize(N.getContent().getType())??"Drawing"}const H=`${R.label()} ${M}`;v(R,()=>{let N=null;l&&(N=l.beginCommit(H));const B=n.getMovableSelection();if(B.length===0)return;const W=p?.(B);for(let ce=0;ce<B.length;ce++){const G=B[ce];P(G,W)}N?.commit()})},[n,l]),[k,x]=o.useState(n.getMovableSelection()[0]??null),[E,z]=o.useState(!k||k?.isProtected()),$=o.useMemo(()=>[new r.Command("moveToFront",i,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){g(this,R=>{R.moveToFront()})}),new r.Command("moveForward",i,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){g(this,R=>{R.moveForward()})}),new r.Command("moveToBack",i,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){g(this,R=>{R.moveToBack()})}),new r.Command("moveBackward",i,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){g(this,R=>{R.moveBackward()})}),new r.Command("toggleLockAspectRatio",i,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){g(this,R=>{R.setLockAspectRatio(!R.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",i,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",i,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",i,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",i,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){g(this,(R,P)=>{R.setBounds({x:P.x})},Gt)}),new r.Command("formatDrawAlignCenter",i,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){g(this,(R,P)=>{R.setBounds({x:(P.width-R.getBounds().width)/2+P.x})},Gt)}),new r.Command("formatDrawAlignRight",i,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){g(this,(R,P)=>{R.setBounds({x:P.width-R.getBounds().width+P.x})},Gt)}),new r.Command("formatDrawAlignTop",i,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){g(this,(R,P)=>{R.setBounds({y:P.y})},Gt)}),new r.Command("formatDrawAlignMiddle",i,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){g(this,(R,P)=>{R.setBounds({y:(P.height-R.getBounds().height)/2+P.y})},Gt)}),new r.Command("formatDrawAlignBottom",i,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){g(this,(R,P)=>{R.setBounds({y:P.height-R.getBounds().height+P.y})},Gt)}),new r.Command("formatDrawDistributeHorz",i,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){g(this,(R,P)=>{R.setBounds(P.get(R))},R=>tr(R))}),new r.Command("formatDrawDistributeVert",i,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){g(this,(R,P)=>{R.setBounds(P.get(R))},R=>tr(R,!1))}),new r.Command("formatDrawFlipHorz",i,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",i,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",i,{label:"Group",description:"Group the selected drawings into a single drawing.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",i,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),new r.Command("formatDrawSwapShapes",i,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",i,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",i,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,k]);o.useEffect(()=>{},[s]);const V=o.useMemo(()=>{let R=null;return R=a?a.createChildGroup(i,"movable",!1):new r.CommandGroup(i,"movable"),R.addCommands($,!0),R},[a,$]);return tt(k,{onAnyChange:()=>{V.getCommand("formatAnchorTypeTwoCell").update({state:k?.getAnchorType()===d.IAnchored.Type.TwoCell}),V.getCommand("formatAnchorTypeOneCell").update({state:k?.getAnchorType()===d.IAnchored.Type.OneCell}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("toggleLockAspectRatio").update({state:k?.isLockAspectRatio()})},onProtectedChange:R=>{z(R.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const R=n.getMovableSelection()[0]??null;x(R),z(!R||R.isProtected()),y()}}),tt(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const R={disabled:E};V.getCommand("formatAnchorTypeTwoCell").update(R),V.getCommand("formatAnchorTypeOneCell").update(R),V.getCommand("formatAnchorTypeAbsolute").update(R),V.getCommand("toggleLockAspectRatio").update(R);const P=t.getCount(),p=n.getMovableSelection(),F=E||P<=1||p.length===0;let M={disabled:F},H=M;if(!F&&p.length===1){const W=p[0];W.getZIndex()===0&&(M={disabled:!0}),W.getZIndex()===P-1&&(H={disabled:!0})}V.getCommand("moveToFront").update(H),V.getCommand("moveForward").update(H),V.getCommand("moveToBack").update(M),V.getCommand("moveBackward").update(M);const N={disabled:E||p.length<=1};V.getCommand("formatDrawAlignLeft").update(N),V.getCommand("formatDrawAlignCenter").update(N),V.getCommand("formatDrawAlignRight").update(N),V.getCommand("formatDrawAlignTop").update(N),V.getCommand("formatDrawAlignMiddle").update(N),V.getCommand("formatDrawAlignBottom").update(N),V.getCommand("formatDrawFlipHorz").update(N),V.getCommand("formatDrawFlipVert").update(N),V.getCommand("formatDrawGroup").update(N),V.getCommand("formatDrawUngroup").update(N),V.getCommand("formatDrawSwapShapes").update(N),V.getCommand("formatDrawSwapShapesHorz").update(N),V.getCommand("formatDrawSwapShapesVert").update(N);const B={disabled:E||p.length<=2};V.getCommand("formatDrawDistributeHorz").update(B),V.getCommand("formatDrawDistributeVert").update(B)},[b,E,b]),V},vi=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,description:a,view:i,isDragging:f,onHide:m,onShow:s,...v}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:g,width:k}]=Vt();return c.jsx("div",{...v,ref:Qt([b,y]),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:i.getZoom(),display:"flex",position:"relative",filter:l?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Ci=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,movableProps:a,renderMovable:i,commands:f,target:m,onRepeatCommandChange:s}=e,v=Or({movables:l.getMovables(),movablesView:l?.getView(),transactional:l,onRepeatCommandChange:s,commands:f,target:m});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const b=o.useMemo(()=>c.jsx(jr,{ref:t,view:n,movables:l.getMovables(),disableResize:!l.getProtection().isObjectsAllowed(),disableDrag:!l.getProtection().isObjectsAllowed(),movablesView:l.getView(),transactional:l,renderMovable:i,...a,onFocus:()=>{v.activate(),a?.onFocus?.()}},"movable-area"),[l,a,f,v]);return b&&n?b:null})),yi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,gridStyle:a,getCellEditor:i,showProtectedError:f,setEditingCoords:m,commands:s}=e,v=r.useEditMode(),[b,y]=o.useState(null),[g,k]=o.useState(null),[x,E]=o.useState(null),[z,$]=o.useState(null),[V,R]=o.useState(null);o.useLayoutEffect(()=>{if(x===null)return $(null),void R(null);const q=()=>{const O=l.getRange(x).getCell(),Q=O.getStyle();let re,be=Q.getFill()?.toCSS(a.body.darkMode);be.background!=="none"&&be.background!=="transparent"||(be=l.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),be.background!=="none"&&be.background!=="transparent"||(be={background:a.body.fill}),$({style:be}),O&&!O.getFormula()&&(re=O?.getRenderHorizontalAlignment()),R(re??r.HorizontalAlignment.Left)};return q(),l.getRange(x).addListener(()=>{q()})},[l,x,a?.body]);const P=r.useCallbackRef(()=>{let q=g.editState.dirty??"";if(g.editState.dirty!==void 0){const O=d.TextUtils.clampString(q);try{const Q=g.sheet.getRange(g.coords),re=`Typing '${O}' into ${Q.toString()}`;return Q.setValue(q,{description:re,autoFit:!0}),E(null),k(null),v.setMode(null),m(null),!0}catch(Q){throw he.Notifier.error(new Error(`Unable to enter '${O}'.`,{cause:Q})),Q}}},[l,g]),p=r.useCallbackRef(q=>l.getRange(q).getCell().getExtrusions()??he.CoordUtils.cellToRange(q),[l]),F=r.useCallbackRef(q=>{let O=d.IRange.Orientation.Row,Q=!1;q!==d.IRange.Direction.Up&&q!==d.IRange.Direction.Down||(O=d.IRange.Orientation.Column),q!==d.IRange.Direction.Left&&q!==d.IRange.Direction.Up||(Q=!0),l.getSelection().traverse(O,Q)},[l]),M=o.useCallback((q,O)=>{if(i)return i(q,O);if(!l)return null;const{ref:Q,...re}=q;return c.jsx(Tr,{ref:Q,...re,sheet:l,bodyStyle:a?.body,activeCoords:O,commands:s,onChangeEdit:be=>{const me={sheet:l,coords:O,editState:be};v.setMode(ze=>({...ze,description:me.editState.editMode?"Edit":"Enter",args:{...ze?.args,stateAndCoords:me}}))},editState:g.editState})},[l,z,i,g,x]),{overlay:H,startEdit:N,submitEdit:B,cancelEdit:W,onKeyboardEventNative:ce,onPointerEventNative:G}=ut.useKeyboardEditorOverlay({view:n,activeCoords:b,getCellEditor:M,canEdit:()=>{const q=l.getProtection();if(q.isReadOnly())return!1;const O=q.isLocked();return O&&f(),!O},onBeforeStartEdit:q=>{const O=Ir(()=>l.getRange(q).getCell()),Q={sheet:l,coords:q,editState:Object.freeze(O)};v.setMode({key:"edit",args:{stateAndCoords:Q}}),k(Q)},onStartEdit:q=>{E(q),m(q)},onSubmitEdit:P,onCancelEdit:q=>{E(null),k(null),v.setMode(null),m(null)},onDoneEdit:q=>{v.setMode(null)},onNavigate:F,containerProps:z,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:l?.getSelection().getCoords().ranges?.length>1?1:2,alignment:V,getRangeCoords:p});tt(l.getSelection(),{onChange(q){y(l.getSelection().getCoords().cell)}});const K=r.useCallbackRef(q=>{G(q),x&&B()},[G,W,x]),L=o.useCallback(q=>{G(q)},[G]),I=o.useCallback(q=>{ce(q)},[ce]);return o.useEffect(()=>{const q=n?.getStage();if(q)return q.addEventListener("pointerdown",K),q.addEventListener("dblclick",L),q.addEventListener("keydown",I),()=>{q.removeEventListener("pointerdown",K),q.removeEventListener("dblclick",L),q.removeEventListener("keydown",I)}},[n?.getStage()]),o.useEffect(()=>{const q=v.getMode(),O=q?.key;O==="edit"||O==="enter"?g?q.args?.cancel?W():q.args?.submit?B():k(q.args?.stateAndCoords):N(q.args?.start):x&&W()},[v]),H(n,t)})),Br="white",Hr="black",wi=`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='${Hr}' fill='${Br}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,bi=`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='${Hr}' fill='${Br}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,xi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l}=e,[a,i]=o.useState(l.getTables().getCount()>0),[f,m]=o.useState(null),[s,v]=o.useState(null),[b,y]=o.useState(null),[g,k]=o.useState(null),x=r.useCallbackRef(()=>{if(l.getTables().getCount()>0){i(!0);const p=l.getTables().getItems({address:n.getVisibleRangeCoords()});m(p.length>0?p:null)}else i(!1),m(null)},[l,n]),E=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const F=n.getCellCoordsFromClient(p.clientX,p.clientY),M=l.getTables().getItems({address:F});M.length===1&&M[0].select()},[n,l]),z=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const F=n.getCellCoordsFromClient(p.clientX,p.clientY),M=l.getTables().getItems({address:F});if(M.length===1){const H=M[0].getRange().getCoords(),N={colStart:H.colStart,rowStart:F.rowIndex,colEnd:H.colEnd,rowEnd:F.rowIndex};l.getRange(N).select()}},[n,l]),$=r.useCallbackRef(()=>{if(!a)return;const p=l.getTables().getItems({address:n.getVisibleRangeCoords()});m(p.length>0?p:null)},[l,a,n]);tt(l?.getSelection(),{onChange(p){v(l.getSelection().getCoords().cell)}}),tt(b,{onAnyChange(p){x(),$()}}),tt(g,{onAnyChange(p){$()}}),tt(l,{onTablesChange(p){x(),$()},onInvalidated(p){x(),$()}});const V=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle($,300),300),[]);o.useEffect(()=>{V()},[n]),o.useEffect(()=>{let p=null;if(f)for(let F=0;F<f.length&&!p;F++){const M=f[F],H=M.getRange().getCoords();d.CoordUtils.isCellWithinRange(s,H)&&(p=M)}y(p)},[s,f]);const R=r.useCallbackRef(p=>{let F=null;if(f)for(let M=0;M<f.length;M++){const H=f[M],N=H.getRange().getCoords();let B=n.getRangeCoordsBounds(N);const W=n.getRelativePointFromClient(p.clientX,p.clientY),ce=W.x,G=W.y;if(ce>=B.x&&ce<=B.x+B.width&&G>=B.y&&G<=B.y+B.height){const K=n.getViewportSize();ce<=0||G<=0||ce>=K.width||G>=K.height||(F=H)}}k(F)},[n,f]);if(o.useEffect(()=>{const p=n?.getStage();if(p&&f)return p.addEventListener("mousemove",R),p.addEventListener("mouseleave",R),()=>{p.removeEventListener("mousemove",R),p.removeEventListener("mouseleave",R)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const P=[];for(let p=0;p<f.length;p++){const F=f[p];if(F.isClosed())continue;const M=F===g,H=F===b,N=F.getRange().getCoords(),B=n.getRangeCoordsBounds(N);let W;if(M||H){const ce=F.getStyle().getProperties(),G=ce.headerRow?.fill?.background??ce.wholeTable?.border?.top?.color?.toString();if(G&&l){const K=l.getStyles().parseColor(G);K&&(W=K.toCSS())}W||(W="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}P.push(c.jsx("div",{style:{position:"absolute",left:B.x,top:B.y,width:Math.min(16,B.width),height:B.height,pointerEvents:"all",cursor:wi},onMouseDown:z},`table-select-row-${F.getName()}`)),P.push(c.jsx("div",{style:{position:"absolute",left:B.x,top:B.y,width:Math.min(16,B.width),height:Math.min(16,B.height),pointerEvents:"all",cursor:bi},onMouseDown:E},`table-select-${F.getName()}`)),P.push(c.jsx(ut.Selection,{x:B.x,y:B.y,width:B.width,height:B.height,range:N,strokeWidth:H?.5:0,stroke:W??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${W} 0px 0px 1px 1px`:void 0}},`table-outline-${F.getName()}`))}return P})),qi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,animationTime:a=60}=e,[i,f]=o.useState(null),[m,s]=o.useState(null),v=o.useRef(null),b=r.useCallbackRef(()=>{const z=l.getSelectedCell(),$=z.getSpill()?.getCoords()??null;he.CoordUtils.isEqualRanges($,i)||(s($?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds($),coords:$}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),f($))},[l,n,i]);o.useEffect(()=>(v.current&&(clearTimeout(v.current),v.current=null),m&&(v.current=setTimeout(()=>{s(null),v.current=null},a)),()=>{v.current&&(clearTimeout(v.current),v.current=null)}),[m,a]);const y=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle(b,80),80),[]);if(tt(l?.getSelection(),{onChange(z){y()}}),tt(l,{onSpillsChange(z){b()},onInvalidated(z){b()}}),!n||!i&&!m)return null;const g=l.getRange(i).getValue()instanceof d.FormulaError.Spill,k=[];let x=m?.bounds??n.getRangeCoordsBounds(i);if(m&&!he.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&s(null),x=n.toClipBounds(x,-10),!x)return;const E="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return k.push(c.jsx(ut.Selection,{x:x.x,y:x.y,width:x.width,height:x.height,range:i,strokeWidth:1,stroke:E,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:g?"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:`${E} 0px 0px 4px 0px`}},"spill-outline}")),k})),Si={position:"absolute",top:0,left:0,bottom:0,right:0},nr=(e,t)=>{const n={...e},l=t?.getNormal().getFont(),a=l?.toCSS(),i={text:{fontFamily:a?.fontFamily,fontSize:l?.getSize()}},f=n.body=he.CommonUtils.mergeContentful(e.body,i);return n.body=he.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=he.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=he.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=he.CommonUtils.mergeContentful(n.header,i),n.headerSelect=he.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=he.CommonUtils.mergeContentful(n.headerSelect,i),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelectAll,i),n},Ri={fireOnModelChange:!1},or={},Vr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:l=or,headersStyle:a=or,onSheetContextMenu:i,showColumnHeaders:f,columnHeaderProps:m,showRowHeaders:s,rowHeaderProps:v,showScrollbars:b=!0,scrollPaneProps:y,onViewportChange:g,commands:k,onRepeatCommandChange:x,onMoveCell:E,overlays:z,renderMovable:$,viewportComponent:V,onElementLoad:R,getCellEditor:P,onFocus:p,onBlur:F,style:M=r.ReactUtils.EmptyCssProperties,onShowTooltip:H,onShowColumnTooltip:N,onShowRowTooltip:B,onCloseTooltip:W,gridProps:ce,cellRenderProps:G,...K}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[L,I]=o.useReducer(X=>X+1,0),[q,{width:O,height:Q}]=Vt(),re=r.useCallbackRef(H,[H]),be=r.useCallbackRef(N,[N]),me=r.useCallbackRef(B,[B]),ze=r.useCallbackRef(W,[W]),Pe=o.useRef(!1);o.useLayoutEffect(()=>{Pe.current=!0},[n]);const ve=n?.getStyles(),Re=o.useMemo(()=>nr(l,ve),[l,ve]),Ke=o.useMemo(()=>nr(a,ve),[a,ve]),{body:Y={},buttonSurface:Z={}}=Re,{header:de={},headerSelect:Ie={},headerSelectAll:we={}}=Ke,U=o.useRef(null),[ee,ge]=o.useState(()=>n?.getView()),le=(ee?.getZoomScale()??100)/100,Ee=o.useMemo(()=>({vertical:ee.isShowColumnGridlines()&&le>=.4,horizontal:ee.isShowRowGridlines()&&le>=.4}),[ee?.isShowColumnGridlines(),ee?.isShowRowGridlines(),le]),ie=o.useMemo(()=>{if(ee?.getGridLineColor())return{strokeDasharray:"1,1"}},[ee?.getGridLineColor(),Re]),pe=f??ee?.isShowColumnHeaders(),De=s??ee?.isShowRowHeaders(),[xe,Be]=o.useState({width:0,height:0}),He=o.useMemo(()=>{let X=40,Se=20;const Ue=n?.getStyles().getNormal().getFont();if(xe.width>0&&xe.height>0){const Ve=Ue?.toCSS()?.fontFamily??Re.header.text.fontFamily,Xe=Ue?.getSize()??Re.header.text.fontSize,Ge=d.IFont.getSharedMeasurer()(""+xe.height,Math.ceil(Xe*d.IFont.getDeviceScale()),Ve);X=Ge.width,Se=Ge.lineHeight}return{width:Math.round(X+5),height:Math.round(Se+3)}},[xe,Re?.header.text,n]),C=De?le*He.width:de.edgeStrokeWidth,je=pe?le*He.height:de.edgeStrokeWidth,nt=Math.max(O,(n?.getColumnHeaders().getDefaultSize()??He.width)+C+1),te=Math.max(Q,(n?.getRowHeaders().getDefaultSize()??He.height)+je+1),ke=o.useRef(new Map),Le=o.useRef(null),Ae=()=>({getColOffset:X=>n.getColumnHeaders().findOffset(X),getColIndex:X=>n.getColumnHeaders().findIndex(X),getRowOffset:X=>n.getRowHeaders().findOffset(X),getRowIndex:X=>n.getRowHeaders().findIndex(X)}),[Fe,A]=o.useState(()=>Ae()),[J,j]=o.useState(!1),[_,qe]=o.useState(null),ye=!0,h=Re.selection?.strokeFill,w=o.useCallback(()=>Dt.current,[]),[T,u]=o.useState(),S=r.useCallbackRef(X=>{u(X);const Se=n?n.getView():null;Se&&Se.setTopLeft(X?{left:X.left,top:X.top}:null),g?.(X)},[n,g]),D=o.useRef(null);o.useEffect(()=>{if(!T||!n)return;const X=n.getRangeAtBounds({x:T.left,y:T.top,width:T.width,height:T.height});D.current?.(),D.current=X.addListener(()=>{const Se=X.getCoords();U?.current?.invalidate(Se)})},[T,n]);const[oe,fe]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(X=>{const Se=he.CoordUtils.cellToRange(X);if(n.isClosed())return Se;const Ue=n.getRange(Se,{ignoreHidden:!0}).getMerges();return Ue.length===0?Se:Ue[0]},[n]),ne=X=>{if(!X||X.coords.colIndex===0&&X.coords.rowIndex===0)return null;const Se={};return X.coords.colIndex>0&&(Se[he.AnchorLocation.Left]={index:X.coords.colIndex,scrollOffset:X.topLeft.left}),X.coords.rowIndex>0&&(Se[he.AnchorLocation.Top]={index:X.coords.rowIndex,scrollOffset:X.topLeft.top}),Se},[ae,ue]=o.useState(()=>ne(n.getView().getFreezePanes())),Ce=r.useEditMode(),Oe=o.useCallback(()=>U.current,[]),Me=r.useCallbackRef(X=>{Ce.setMode(Se=>Se?.key==="edit"?{...Se,args:{...Se.args}}:{key:"edit",args:{stateAndCoords:null,start:X}})},[]),Te=r.useCallbackRef(()=>T,[T]),$e=Lr({sheet:n,commands:k,target:Oe,onRepeatCommandChange:x,bodyStyle:Y,onStartEdit:Me,getViewport:Te}),[We,_e]=o.useState(n.getSelection().isEntire()),[Ye,Je]=o.useState(ee?.getMovableSelection().length>0),Ne=_!==null||Ye,Qe=null,[ht,it]=o.useState(!1);o.useEffect(()=>{it(!1)},[n.getProtection()]);const at=r.useNotifier(),kt=r.useCallbackRef(()=>{ht||(it(!0),at.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.NotifierType.Error}))},[at,ht]),qt=o.useMemo(()=>{const X=Ce.getMode();return X?.cursor?X.cursor:null},[Qe,Ce]),[wt,vt]=o.useState(null),Ze=o.useRef(!1),[St,ft]=o.useState([]),bt=o.useRef(null),[Ft,At]=o.useState(he.TypesUtils.EmptyTopLeft),[Mt,Nt]=o.useState(he.TypesUtils.EmptyTopLeft);o.useEffect(()=>{At({left:oe?.left,top:0})},[oe?.left]),o.useEffect(()=>{Nt({left:0,top:oe?.top})},[oe?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{ue(ne(n.getView().getFreezePanes()))},onTopLeftChange:()=>{fe(n.getView().getTopLeft())},onMovableSelectionChange:()=>{Je(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),tt(n,{onViewChange(){ge(n.getView()),A(Ae())},onLayoutChange:()=>{const X=n.getEntireRange();Be({height:X.getRowCount(),width:X.getColumnCount()}),A(Ae())},onStyleChange:()=>{jt()},onMovablesChange:()=>{},onInvalidated:()=>{jt()}}),tt(n,{onRequestScrollIntoView:async(X,Se)=>{if(!Se)return;const Ue={colIndex:Se?.coords?.colStart,rowIndex:Se?.coords?.rowStart};return await U.current?.scrollCellCoordsIntoView(Ue,Se?.scroll),!0},onRequestFocus:()=>he.CommonUtils.whenFocus(Dt.current)},Ri);const pt=o.useRef(!1),Kt=o.useMemo(()=>{const X=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{Ze.current&&be?.(Ve)})},32),Se=(Ve,Xe)=>{Ze.current=!0,vt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:0,rowEnd:xe.height,colStart:Ve,colEnd:Ve})))return;const st=Ge.getLayout(),lt=Math.max(0,st.getColOffset(Ve)),rt=Ge.getBounds(),xt=Math.min(rt.x+rt.width,st.getColOffset(Ve+1)),zt=Ge.getAnchor();if(Xe!==null&&(zt===he.AnchorLocation.Left||zt===he.AnchorLocation.Center||zt===he.AnchorLocation.Right)){const lo=he.CommonUtils.roundAccurately(Xe*he.CommonUtils.getDPI(),0),Tn=he.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Xe/le),2).toFixed(2),io="Width: "+(Xe?Tn+" ("+lo+" pixels)":"Hidden"),rn=Yn.current.getGridElement().getRelativePointFromClient(0,0),_t=0-rn.y,In=0-rn.y+je,ao=rn.x-rt.x;X({anchor:{x:lt-ao,y:_t,width:xt-lt,height:In-_t},display:io})}const Bt=[0,0,0,rt.height],to={style:{boxShadow:`0.5px 0px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:h}},no={x:lt-1,y:0,width:1,height:rt.height},oo={style:{boxShadow:`-0.5px 0px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:h}},ro={x:xt-1,y:0,width:1,height:rt.height};return c.jsxs(o.Fragment,{children:[c.jsx(ut.SVGLine,{linePoints:Bt,bounds:no,...to}),c.jsx(ut.SVGLine,{linePoints:Bt,bounds:ro,...oo})]},"resize-dividers")}])};let Ue=null;return{onResizeHeadersStart:(Ve,Xe,Ge)=>{Ue=n.beginCommit(Ge),pt.current=!1,Se(Ve,Xe)},onResizeHeaders:(Ve,Xe,Ge)=>{pt.current=!1,Se(Ve,Xe)},onResizeHeadersDown:(Ve,Xe)=>{pt.current=!0,setTimeout(()=>{pt.current&&Se(Ve,Xe)},360)},onResizeHeadersEnd:(Ve,Xe,Ge)=>{Ue?.commit({description:Ge}),Ue=null,pt.current=!1,requestAnimationFrame(()=>ze?.()),Ze.current=!1,vt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>ze?.()),Ze.current=!1,vt(null)},...m}},[n,m,je,wt]),nn=o.useMemo(()=>{const X=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{Ze.current&&me?.(Ve)})},32),Se=(Ve,Xe)=>{Ze.current=!0,vt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:xe.width})))return;const st=Ge.getLayout(),lt=Math.max(0,st.getRowOffset(Ve)),rt=Ge.getBounds(),xt=Math.min(rt.y+rt.height,st.getRowOffset(Ve+1)),zt=Ge.getAnchor();if(Xe!==null&&(zt===he.AnchorLocation.Top||zt===he.AnchorLocation.Center||zt===he.AnchorLocation.Bottom)){const lo=Math.floor(10*he.CommonUtils.getDPI())/10,Tn=he.CommonUtils.roundAccurately(Xe*lo,0),io=he.CommonUtils.roundAccurately(Tn/le/(n?.getRowHeaders().getScaleFactor()*he.CommonUtils.getDPI()),2).toFixed(2),rn="Height: "+(Xe?io+" ("+Tn+" pixels)":"Hidden"),_t=Wt.current.getGridElement().getRelativePointFromClient(0,0),In=0-_t.x,ao=0-_t.x+C,Il=_t.y-rt.y;X({anchor:{x:In,y:lt-Il,width:ao-In,height:xt-lt},display:rn})}const Bt=[0,0,rt.width,0],to={style:{boxShadow:`0px 0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:h}},no={x:0,y:lt-1,width:rt.width,height:1},oo={style:{boxShadow:`0px -0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:h}},ro={x:0,y:xt-1,width:rt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(ut.SVGLine,{linePoints:Bt,bounds:no,...to}),c.jsx(ut.SVGLine,{linePoints:Bt,bounds:ro,...oo})]},"resize-dividers")}])};let Ue=null;return{onResizeHeadersStart:(Ve,Xe,Ge)=>{Ue=n.beginCommit(Ge),pt.current=!1,Se(Ve,Xe)},onResizeHeaders:(Ve,Xe,Ge)=>{pt.current=!1,Se(Ve,Xe)},onResizeHeadersDown:(Ve,Xe)=>{pt.current=!0,setTimeout(()=>{pt.current&&Se(Ve,Xe)},360)},onResizeHeadersEnd:(Ve,Xe,Ge)=>{Ue?.commit({description:Ge}),Ue=null,pt.current=!1,requestAnimationFrame(()=>ze?.()),Ze.current=!1,vt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>ze?.()),Ze.current=!1,vt(null)},...v}},[n,v,C]),Dt=r.useImperativeElement(t,()=>{const X=Ue=>{n?.getView()&&n.getView().selectMovables([]),Le.current=null,U?.current?.focus(Ue)},Se=async(Ue=null)=>{if(Ue||(Ue=n?.getView().getMovableSelection()[0]),!Ue)return!1;const Ve=Ue.getAnchorCoords();if(!Ve)return!1;const Xe=U.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Xe)return!1;const Ge=Xe.getAnchor();n?.getView().getMovableSelection().indexOf(Ue)===-1&&n?.getView().selectMovables([Ue]);let st=ke.current?.get(Ge);return st?.current?(await st.current.focusMovable(Ue),!0):(Le.current={movable:Ue,anchor:Ge},!0)};return{getGridElement:()=>U.current,getRowHeaderElement:()=>Wt.current,getColumnHeaderElement:()=>Yn.current,rowHeaderHeight:()=>je,colHeaderWidth:()=>C,startEdit:Me,submitEdit:()=>{Ce.setMode(Ue=>Ue?.key!=="edit"?Ue:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{Ce.setMode(Ue=>Ue?.key!=="edit"?Ue:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:_!==null,focus:Ue=>{n?.getView().getMovableSelection().length>0&&Se()||X(Ue)},focusSheet:X,focusMovable:Se,contains:Ue=>U?.current?.contains?.(Ue),invalidate:jt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),jt=o.useCallback(X=>{Pe.current||(U?.current?.invalidate(X),I?.())},[]);o.useEffect(()=>{jt()},[Re]);const bn=We?we.edgeStrokeFill:de.fill,ot=We?Ie.fill:typeof Re.headerHover=="function"?Re.headerHover(de)?.fill:de.fill,xn=o.useMemo(()=>V?c.jsx("div",{className:ct("sheetxl-viewport-overlay",Ul),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:V}):c.jsx(c.Fragment,{}),[V]);let $t=null;pe&&De&&($t=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${je}px`,width:`${C}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:X=>{let Se=!X.ctrlKey;$e?.getCommand("selectAll")?.execute(!Se||X.button!==0),X.nativeEvent.which===r.MouseButtonCodes.Right?i?.({originalEvent:X,clientX:X.clientX,clientY:X.clientY,rowIndex:-1,colIndex:-1}):U.current?.focus()},children:[c.jsx("div",{style:{height:je-5+"px",width:je-5+"px",clipPath:`path('M${je-5} 0 L0 ${je-5} L${je-5} ${je-5} L${je-5} 0 Z')`,borderRight:`2px solid ${bn}`,borderBottom:`2px solid ${bn}`,background:`${ot}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${je}px`,width:`${C}px`,boxSizing:"border-box",borderRight:`solid 1px ${de.strokeFill}`,borderBottom:`solid 1px ${de.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const on=r.useCallbackRef(({_left:X,_top:Se})=>{},[]),dt=r.useCallbackRef(X=>{if(!i)return;const Se=U.current.getViewFromClient(X.clientX,X.clientY)?.getCellCoordsFromClient(X.clientX,X.clientY);Se&&(i({originalEvent:X,clientX:X.clientX,clientY:X.clientY,rowIndex:Se.rowIndex,colIndex:Se.colIndex}),X.stopPropagation(),X.preventDefault())},[i]),Ct=r.useCallbackRef(X=>{if(!(!X.shiftKey&&(X.ctrlKey||X.metaKey)))return;const{deltaY:Se}=X;return Se>0?$e.getCommand("sheetZoomOut")?.execute():Se<0&&$e.getCommand("sheetZoomIn")?.execute(),Se===0},[$e]);o.useEffect(()=>{ft(null),bt.current=null,Ze.current=!1,vt(null);const X=n?.getView().getTopLeft();on(X),U.current?.scrollTo(X),fe(X),ge(n.getView()),ue(ne(n.getView().getFreezePanes())),A(Ae()),I()},[n?.getView()]);const qn=o.useCallback((X,Se)=>n.getRowHeaders().hiddenHeadersAt(X,Se),[n]),Sn=o.useCallback((X,Se)=>n.getColumnHeaders().hiddenHeadersAt(X,Se),[n]),Ot=r.useCallbackRef(X=>{const Se=X.getVisibleRangeCoords();if(!Se)return null;const Ue=[];return n.getRange(Se).forEach((Ve,Xe)=>{const Ge=Xe.getCoords(),st=Xe.getCell();(lt=>{if(lt.isEmpty())return!1;const rt=lt.getSpans();if(rt.width>1||rt.height>1||lt.getStyle().hasVisibleStyling()||ee.isShowFormulas()&<.getFormula()!==null)return!0;const xt=lt.getValue();return xt!==null&&!(!ee.isShowZeros()&&xt===0&<.getType()===d.ScalarType.Number)})(st)&&Ue.push({coords:Ge,value:st,range:ee.isShowFormulas()?null:st.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ue},[n,ee.isShowZeros(),ee.isShowFormulas(),_]);o.useEffect(()=>{const X=[];z&&X.push(...z),wt&&X.push(...wt),he.CommonUtils.isEqualArrays(X,bt.current)||(bt.current=X,ft(X))},[z,wt,Re]);const Rn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:l?.body?.text?.fill??"black"}}),[Re?.header?.edgeStrokeFill]),Xn=r.useCallbackRef(X=>{X.isDefaultPrevented()||X.isPropagationStopped()||(Le.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),kn=o.useMemo(()=>{const X=Ce.getMode();return X?.key==="cut"||X?.key==="copy"},[Ce]),Mn=r.useCallbackRef(async X=>{const Se=Ce.getMode();return X.keyCode===r.KeyCodes.Escape&&Se?(X.preventDefault(),void Ce.setMode(null)):X.keyCode===r.KeyCodes.Enter&&kn?(X.preventDefault(),await $e?.getCommand("paste")?.execute(),void Ce.setMode(null)):void $e?.dispatchToFocusedCommand(X)},[$e,Ce]),Wt=o.useRef(null),bl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${je+1}px`,width:`${C+de.edgeStrokeWidth}px`,minWidth:`${C+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${je}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Qo,{ref:Wt,sheetElement:Dt.current,gridRef:U,freezeStart:ae?.[he.AnchorLocation.Top],oppositeSize:C,containerWidth:C,containerHeight:te,sheetHeader:n.getRowHeaders(),gridStyle:Ke,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:i,tabIndex:-1,style:{position:"relative",flex:"0",top:`${je+1}px`,width:`${C+de.edgeStrokeWidth}px`,minWidth:`${C+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${je}px)`,boxSizing:"border-box",zIndex:"2",...nn?.style},...nn})}),[C,je,te,n,Mt,ae?.[he.AnchorLocation.Top],Re,ye,i,de.fill,v]),Yn=o.useRef(null),xl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${je+de.edgeStrokeWidth}px`,minHeight:`${je+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Qo,{ref:Yn,sheetElement:Dt.current,gridRef:U,freezeStart:ae?.[he.AnchorLocation.Left],oppositeSize:je,containerWidth:nt,containerHeight:je,sheetHeader:n.getColumnHeaders(),gridStyle:Ke,scrollPoint:Ft,onSheetContextMenu:i,...Kt,style:{...Kt?.style,position:"relative",left:"0px",width:"100%",height:`${je+de.edgeStrokeWidth}px`,minHeight:`${je+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[je,nt,n,Ft,ae?.[he.AnchorLocation.Left],Re,de.fill,ye,i,m]),ql=r.useCallbackRef(X=>{const{value:Se,key:Ue,...Ve}=X;let Xe=Se,Ge=_;if(!Ge||Ge.colIndex===X.coords.colIndex&&Ge.rowIndex===X.coords.rowIndex||(Ge=null),!Xe){const rt=X.range;if(Xe=n.getRange({rowIndex:rt.rowStart,colIndex:rt.colStart}).getCell(),Xe.isEmpty())return null}let st=null;Xe.getHyperlink()&&(st=async rt=>{if(G?.onLinkMouseDown?.(rt),rt.button===0&&!rt.isDefaultPrevented()){rt.stopPropagation(),rt.preventDefault();try{await Xe.getHyperlink()?.open()}catch(xt){at.showError?.(xt)}}}),Ge&&Ge.colIndex===X.range.colStart&&Ge.rowIndex===X.range.rowStart&&(Xe=Xe.createTemporaryCell({value:null}));const lt=n.getStyles();return o.createElement(Mr,{...Ve,key:Ue,bodyStyle:Y,docTheme:lt.getTheme(),normalStyle:lt.getNormal(),showFormulas:ee.isShowFormulas(),showZeros:ee.isShowZeros(),onLinkMouseDown:st,...G,value:Xe})},[n,Fe,Y,_,ee?.isShowFormulas(),ee.isShowZeros()]),Sl=o.useCallback((X,Se)=>{const{key:Ue,...Ve}=X;return[c.jsx(Jl,{ref:Se,getVisibleCells:Ot,sheet:n,gridStyle:Re,...Ve},`border-${Ue}`),c.jsx(xi,{ref:Se,sheet:n,commands:$e,...Ve},`table-${Ue}`),c.jsx(qi,{ref:Se,sheet:n,...Ve},`spill-${Ue}`),c.jsx(hi,{ref:Se,sheet:n,commands:$e,onShowTooltip:re,onCloseTooltip:ze,gridStyle:Re,gridRef:U,editingCoords:_,isActive:ye,...Ve},`selection-${Ue}`),c.jsx(ii,{ref:Se,sheet:n,commands:$e,gridStyle:Re,element:w,...Ve},`copy-paste-${Ue}`),c.jsx(Ci,{ref:Se,sheet:n,commands:$e,target:Oe,renderMovable:$,movableProps:{onUnFocus:()=>{Dt.current.focus()}},...Ve},`movable-${Ue}`),c.jsx(yi,{ref:Se,sheet:n,commands:$e,gridStyle:Re,getCellEditor:P,showProtectedError:kt,setEditingCoords:qe,...Ve},`editor-${Ue}`)]},[n,U.current,Re,P,$e,at]),[Lo,Rl]=o.useState(!1),kl=o.useMemo(()=>{if(nt===0||te===0)return null;const X=n.getStyles().getNormal(),Se=X.getFont(),Ue=X.getFill(),Ve=X.getBorder(),Xe=X.getFill().getType()===d.IFill.Type.None;let Ge=ie,st=ie;const lt=(xt,zt,Bt)=>Bt?{stroke:Ve.getBottom().isNone()?"none":xt.getColor().toRGBA(Y.darkMode).toString(),...zt}:zt;st=lt(Ve.getBottom(),st,!Ve.getBottom().isNone()),st=lt(Ve.getTop(),st,!Ve.getTop().isNone()),Ge=lt(Ve.getRight(),Ge,!Ve.getRight().isNone()),Ge=lt(Ve.getLeft(),Ge,!Ve.getLeft().isNone());let rt=ee?.getGridLineColor()?.toRGBA(Y.darkMode).toString()??Y.strokeFill;return Xe||(st=lt(Ve.getBottom(),st,!0),st=lt(Ve.getTop(),st,!0),Ge=lt(Ve.getRight(),Ge,!0),Ge=lt(Ve.getLeft(),Ge,!0)),c.jsx(ut.Grid,{className:"sheetxl-sheet-primary",style:{...Si,...Ue.toCSS(Y.darkMode),...Se.toCSS(Y.darkMode,le),"--sxl-app-color-background":Y.fill,"--sxl-app-color-shadow":Re.colorShadow,"--sxl-app-color-grey":Re.colorGrey,"--sxl-app-color-button-fill":Z.fill,"--sxl-app-color-button-text":Z.text?.fill,"--sxl-app-color-button-border":Z.edgeStrokeFill,"--sxl-app-color-primary-dark":Re.selection.strokeFill},ref:U,zoom:le,...ce,onFirstRender:xt=>{Rl(!0),ce?.onFirstRender?.(xt),$e?.activate()},showGridLines:Ee,gridLineColor:rt,gridLineColumnsProps:Ge,gridLineRowsProps:st,freezeLeft:ae?.[he.AnchorLocation.Left],freezeLeftProps:Rn,freezeTop:ae?.[he.AnchorLocation.Top],freezeTopProps:Rn,width:nt,height:te,columnCount:xe.width,rowCount:xe.height,cursor:qt??Qe??"cell",clipCells:!0,layout:Fe,cellRenderer:ql,overlayRenderer:Sl,getCellCoordsAsRangeCoords:se,hiddenRowsAt:qn,hiddenColumnsAt:Sn,getVisibleCells:Ot,onWheelScroll:Ct,onPointerDown:Xn,onKeyDown:Mn,onViewportChange:S,onImmediateScroll:on,scrollPoint:oe,stageProps:{onFocus:()=>{$e?.activate()}},overlays:St})},[L]);o.useEffect(()=>{Pe.current||I()},[Fe,ae,le,$e,oe?.left,oe?.top,Y,ce,nt,te,qt,St,ye,Qe]);let Jn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};b||(Jn={...Jn,...M});const Ml=o.useMemo(()=>{const X=n.getStyles().getTheme(),Se=X.getColorScheme(),Ue=X.getFontScheme();return{"--sxl-doc-color-dk1":Se.getDk1().toCSS(Y.darkMode),"--sxl-doc-color-dk2":Se.getDk2().toCSS(Y.darkMode),"--sxl-doc-color-lt1":Se.getLt1().toCSS(Y.darkMode),"--sxl-doc-color-lt2":Se.getLt2().toCSS(Y.darkMode),"--sxl-doc-color-accent1":Se.getAccent1().toCSS(Y.darkMode),"--sxl-doc-color-accent2":Se.getAccent2().toCSS(Y.darkMode),"--sxl-doc-color-accent3":Se.getAccent3().toCSS(Y.darkMode),"--sxl-doc-color-accent4":Se.getAccent4().toCSS(Y.darkMode),"--sxl-doc-color-accent5":Se.getAccent5().toCSS(Y.darkMode),"--sxl-doc-color-accent6":Se.getAccent6().toCSS(Y.darkMode),"--sxl-doc-color-hlink":Se.getHlink().toCSS(Y.darkMode),"--sxl-doc-color-fol-hlink":Se.getFolHlink().toCSS(Y.darkMode),"--sxl-doc-font-major":Ue.getMajorFont(),"--sxl-doc-font-minor":Ue.getMinorFont()}},[n.getStyles().getTheme()]),Po=r.useCallbackRef(X=>{const{style:Se,...Ue}=X;return c.jsx(Mo,{...Ue,style:{paddingLeft:"4px",paddingRight:"4px",...Se},sheet:n})},[n]);let Qn=c.jsx("div",{style:Jn,onTouchStart:()=>{jo()},onFocus:X=>{j(!0),p?.(X)},onBlur:X=>{j(!1),F?.(X)},ref:Dt,...K,children:c.jsx("div",{className:ct("sheetxl-sheet",Vl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Ml},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[$t,bl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,backgroundColor:Y.fill},ref:q,onContextMenu:dt,children:[kl,xn,c.jsx(Kl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Re?.selection?.strokeFill,colorCredits:Re?.body?.text?.fill})]})]})]})})});b&&(Qn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${de.fill}`,minHeight:2*He.height,minWidth:2*He.width,...M},viewport:T,touchElement:U.current?.stage,disableTouch:Ne,onScrollViewport:X=>{U.current?.scrollTo(X)},createHorizontalScrollbar:Po,createVerticalScrollbar:Po,...y,children:Qn})),o.useEffect(()=>{Pe.current=!1,I?.(),J&&Dt.current?.focus()},[n]);const[eo,Tl]=o.useState(!1),jo=r.useCallbackRef(()=>{eo||Tl(!0)},[eo]);return o.useEffect(()=>{if(Lo)return typeof R=="function"&&R(),r.ReactUtils.detectIt().primaryInput==="touch"&&jo(),()=>{}},[R,Lo,eo]),Qn}));Vr.displayName="SheetElement";const rr="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=",Ur=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,style:a,picture:i,description:f,isDragging:m,view:s,onHide:v,onShow:b,onKeyDownCapture:y,onFocus:g,onBlur:k,loadingPanel:x,...E}=e,[z,$]=o.useState(!1),[V,R]=o.useState(null),[P,p]=o.useState(null),[F,M]=o.useState(null);o.useEffect(()=>{p(null),i.getDetails().then(B=>{$(!1),p(B.asUrl()),B.asSVGText?.()&&M(B.asSVGText())}).catch(B=>{console.warn(B),$(!0),p(rr),M(null)})},[i]);const H=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),N=o.useMemo(()=>{if(P||F)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:z?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:z?"var(--sxl-app-color-background, white)":void 0,boxShadow:z?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:z?"contain":void 0,opacity:V?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:P,onLoad:()=>{R(!0)},onError:({currentTarget:B})=>{console.log("error"),B.onerror=null,p(rr),$(!0)},alt:f??`${i.getType()}`})},[V,i,P,F,m]);if(!i.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,...E,onKeyDownCapture:B=>{y?.(B)},ref:H,children:[V||z?void 0:x,N]})}));Ur.displayName="PictureEditor";const ki=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,chart:a,view:i,isDragging:f,onHide:m,onShow:s,...v}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:g,width:k}]=Vt();if(!a.isClosed())return c.jsx("div",{...v,ref:Qt([b,y]),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:i.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:l?"blur(1px)":void 0,boxShadow:f?"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()})})})})),Mi="_editable-input_1bqx6_6",Ti=e=>c.jsx("input",{...e}),Kr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:l,value:a="",onSubmit:i,onChange:f,onCancel:m,createInput:s=Ti,styleHover:v={},dragging:b,maxLength:y,disabled:g=!1,readOnly:k=!1,...x}=e,[E,z]=o.useState(!1),[$,V]=o.useState(!1),[R,P]=o.useState(a);o.useEffect(()=>{P(a)},[a]);const p=o.useRef(null),[F,M]=o.useState(null),H=r.useNotifier(),N=o.useCallback(function(I){const q=I.message;F!==q&&(H?.showMessage?.(q,{type:r.NotifierType.Error}),M(q))},[H,F]),B=o.useCallback(I=>{let q=!1;try{q=i?.(I)??!0}catch(O){N(O)}return q?(p.current=null,V(!1),P(I),q):(setTimeout(()=>{p.current?.focus()},0),q)},[i]),W=r.useCallbackRef(()=>{P(a),p.current=null,V(!1),m?.()},[m,a]),ce=o.useMemo(()=>{if(!$)return null;const I={className:ct(Mi),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:R,onFocus:q=>{p.current||(p.current=q.target,setTimeout(()=>{q.target?.select()},0))},onBlur:q=>{p.current&&B(R)},onChange:q=>{$&&P(q.target.value)},onMouseDown:q=>q.stopPropagation(),onKeyDown:q=>q.code==="Escape"?(q.preventDefault(),void W()):q.code==="Enter"?(q.preventDefault(),void B(q.target.value)):void(q.code!=="Tab"?q.stopPropagation():B(q.target.value))};return c.jsx(c.Fragment,{children:s(I)})},[$,R,B,W,s,g]),[G,K]=o.useState();o.useLayoutEffect(()=>{let I=Object.assign({},n);(b||E)&&(I=Object.assign(I,v)),K(I)},[b,E,v,n]),o.useEffect(()=>{ce&&f?.(R)},[ce,f,R]);const L=r.useImperativeElement(t,()=>({startEdit(){g||k||V(!0)},cancel(){W()}}),[]);return c.jsxs("div",{...x,ref:L,style:{flexDirection:"column",display:"flex",...G},className:ct(l),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{g||k||V(!0)},onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:$?0:1},children:R}),ce]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...v},children:R})]})})),$n=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function en(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function To(e){return"nodeType"in e}function yt(e){var t,n;return e?en(e)?e:To(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Io(e){const{Document:t}=yt(e);return e instanceof t}function Cn(e){return!en(e)&&e instanceof yt(e).HTMLElement}function $r(e){return e instanceof yt(e).SVGElement}function Jt(e){return e?en(e)?e.document:To(e)?Io(e)?e:Cn(e)||$r(e)?e.ownerDocument:document:document:document}const It=$n?o.useLayoutEffect:o.useEffect;function Wn(e){const t=o.useRef(e);return It(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,l=new Array(n),a=0;a<n;a++)l[a]=arguments[a];return t.current==null?void 0:t.current(...l)},[])}function fn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return It(()=>{n.current!==e&&(n.current=e)},t),n}function dn(e,t){const n=o.useRef();return o.useMemo(()=>{const l=e(n.current);return n.current=l,l},[...t])}function jn(e){const t=Wn(e),n=o.useRef(null),l=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,l]}function On(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let uo={};function yn(e,t){return o.useMemo(()=>{if(t)return t;const n=uo[e]==null?0:uo[e]+1;return uo[e]=n,e+"-"+n},[e,t])}function Wr(e){return function(t){for(var n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];return l.reduce((i,f)=>{const m=Object.entries(f);for(const[s,v]of m){const b=i[s];b!=null&&(i[s]=b+e*v)}return i},{...t})}}const Xt=Wr(1),pn=Wr(-1);function _n(e){if(!e)return!1;const{KeyboardEvent:t}=yt(e.target);return t&&e instanceof t}function Bn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=yt(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 Ut=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[Ut.Translate.toString(e),Ut.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:l}=e;return t+" "+n+"ms "+l}}}),lr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ii(e){return e.matches(lr)?e:e.querySelector(lr)}const Ei={display:"none"};function Fi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:Ei},n)}function Ai(e){let{id:t,announcement:n,ariaLiveType:l="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":l,"aria-atomic":!0},n)}const _r=o.createContext(null),Di={draggable:`
|
|
23
|
+
The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",p,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied.",icon:"PasteFormulas"}),new r.Command("pasteTranspose",p,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",p,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(F,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const p={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(F=>R.paste({...Xl,...F})).update(p),i.getCommand("pasteFormats").updateCallback((F,M)=>R.paste({...Yl,description:M.label(),...F})).update(p),i.getCommand("pasteFormulas").updateCallback((F,M)=>R.paste({...Jl,description:M.label(),...F})).update(p),i.getCommand("pasteTranspose").updateCallback((F,M)=>R.paste({...Ql,description:M.label(),...F})).update(p),i.getCommand("pasteLinks").updateCallback((F,M)=>R.paste({...ei,description:M.label(),...F})).update(p),i.getCommand("cut").update(p),i.getCommand("paste").update(p)},[t,i]);const P=o.useMemo(()=>{if(!E||!k.current)return;const p=E.key;if(p!=="copy"&&p!=="cut"&&p!=="formatPainter")return;const F=k.current.getItem();if(F.getSource()!==t)return;const M=k.current.isCut?.(),H=M?b:v,N=M?s:m,B=F.getCoords(),$=B?[B]:null;return $&&$.length!==0?ce=>{const _=[];for(let K=0;K<$.length;K++){const L=$[K],I=ce.toClipBounds(ce.getRangeCoordsBounds(L,{top:0,left:0,right:1,bottom:1}),ht.SELECTION_CLIP_INSETS);I&&(_.push(g({range:L,key:`copy-selection-background-${K}`,x:I.x,y:I.y,width:Math.max(I.width,0),height:Math.max(I.height,0),stroke:H,strokeWidth:2})),_.push(g({range:L,key:`copy-selection-foreground-${K}`,x:I.x+(I.width<=2?-1:0),y:I.y,width:Math.max(I.width,3),height:Math.max(I.height,3),stroke:N,strokeWidth:2,isAnimatedStroke:!0})))}return _}:null},[E,t,n,m,v,s,b]);return{...R,clipboard:V,overlays:P}},ti=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,m=l.body??{},s=a.getView(),{overlays:v}=zr({element:i,sheet:a,sheetView:s,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:m.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:m.fill});return et(a?.getSelection(),{onChange(b){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),v&&n?v(n):null})),ni="_sheet-selection_12wyx_5",oi={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},ri={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},li={key:"dragCopy",description:"Drag selection to copy cell contents."},ii={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Jo=(e,t)=>t.ctrlKey&&t.shiftKey?ii:t.ctrlKey?li:t.shiftKey?ri:oi,ai={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},si=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:m,sheet:s,gridRef:v,gridStyle:b,isActive:y,editingCoords:g,...k}=e,x=n?.getBounds(),E=r.useCallbackRef(f,[f]),z=r.useCallbackRef(m,[m]),[W,V]=o.useState(()=>s?.getSelection().getCoords()),R=r.useCallbackRef(U=>{me.CoordUtils.isEqualSelectionCoords(U,W)||s&&s.getSelection().updateCoords(U)},[s,W]),P=r.useEditMode(),p=o.useRef(null),[F,M]=o.useState(s?.getProtection().isLocked()),[H,N]=o.useState(s?.getView().getMovableSelection().length>0),B=r.ReactUtils.detectIt().primaryInput==="touch",$=!B&&y,ce=g??P.getMode()?.args?.stateAndCoords?.coords??null,_=ce!==null||H,K=r.useCallbackRef(U=>{const te=me.CoordUtils.cellToRange(U);if(s.isClosed())return te;const ge=s.getRange(te,{ignoreHidden:!0}).getMerges();return ge.length===0?te:ge[0]},[s]),L=r.useCallbackRef((U,te,ge,le,Ee,ie)=>{const pe=s.getSelectedRange().getExtended(le,U).getCoords();switch(le){case d.IRange.Direction.Up:return pe.rowStart;case d.IRange.Direction.Down:return pe.rowEnd;case d.IRange.Direction.Left:return pe.colStart;case d.IRange.Direction.Right:return pe.colEnd}},[s]),I=r.useCallbackRef(()=>{const U=s.getUsedRange()?.getCoords(),te=s.getRowHeaders().getUsedRange()?.getCoords(),ge=s.getColumnHeaders().getUsedRange()?.getCoords();return{...U,colEnd:Math.max(U?.colEnd??0,ge?.max??0),rowEnd:Math.max(U?.rowEnd??0,te?.max??0)}},[s]),q=r.useCallbackRef((U,te)=>s.getRowHeaders().hiddenHeadersAt(U,te),[s]),O=r.useCallbackRef((U,te)=>s.getColumnHeaders().hiddenHeadersAt(U,te),[s]),Q=r.useCallbackRef(U=>s.getRange(U,{ignoreHidden:!0}).getMerges(),[s]),re=r.useCallbackRef(U=>{s?.getSelection().setAdjusting(U)},[s]),be=r.useCallbackRef(async()=>{s?.getSelection().setAdjusting(null),P.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),P.setMode(null))},[P,W,s,i]),he=o.useMemo(()=>{const U=P.getMode();return U?.key==="cut"||U?.key==="copy"},[P]);et(s?.getView(),{onMovableSelectionChange:()=>{N(s.getView().getMovableSelection().length>0)}}),et(s?.getSelection(),{onChange(U){const te=s.getSelection().getCoords();V(te)}}),et(s,{onProtectionChange:()=>{M(s.getProtection().isLocked())}});const{body:ze={}}=b||{},Pe=r.useNotifier(),ve=n.getLayout(),Re=!($&&W.ranges.length<=1&&ce===null&&!F&&(!P.getMode()||he)),{cursor:We,overlay:Y,onPointerDown:Z}=ht.useSelection({gridRef:v,commands:i,layout:ve,getCellCoordsAsRangeCoords:K,selection:W,fillHandleBorderColor:ze.fill,selectionBackgroundColor:y?b.selection.fill:b.selectionInactive.fill,selectionBorderColor:y?b.selection.strokeFill:b.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?b.selectionRemove.fill:b.selectionInactive.fill,selectionRemoveBorderColor:y?b.selectionRemove.strokeFill:b.selectionInactive.strokeFill,disableFillDrag:Re,disableMoveDrag:B||!(y&&W.ranges.length<=1&&ce===null&&!F),disableTouchSelection:_,onSelectionChange:R,onSelectionDragStart:re,onSelectionDragEnd:be,onMoveDragStart:(U,te,ge)=>{P.setMode(Jo(0,ge))},onMoveDragUpdate:(U,te,ge)=>{P.setMode(Jo(0,ge))},onMoveDragEnd:(U,te)=>{P.setMode(null)},onMoveDragDone:async(U,te,ge)=>{if(me.CoordUtils.isEqualRanges(U,te))return;const le=s.getRange(te);if(Pe?.showOptions){const xe=le.getDifferences(U);let Oe=!1;const Be=xe.getCount();for(let C=0;!Oe&&C<Be;C++)Oe=xe.at(C).isContentful();if(Oe&&await Pe?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const Ee=!ge.ctrlKey,ie=ge.shiftKey,pe=ie?Ee?"Insert Moved Cells":"Insert Copied Cells":Ee?"Move Cells":"Copy Cells",De=await Pe?.showBusy?.(pe);try{const xe=s.getRange(U);await le.doBatch(async()=>{ie?await le.insertFrom(U,{isCut:Ee,undoRange:xe}):await le.copyFrom(U,{isCut:Ee,undoRange:xe}),xe.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),le.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:pe,autoSelect:!0})}catch(xe){Pe?.showError?.(xe)}finally{De?.()}},contentfulCellFinder:L,hiddenRowsAt:q,hiddenColumnsAt:O,mergedRanges:Q,getDataCoords:I,canSelectionSpanMergedCells:U=>{const te=s.getRange(U);return te.isEntireColumns()||te.isEntireRows()},onFill:async(U,te)=>{const ge="Auto Fill",le=await Pe?.showBusy?.(ge);try{await s.doBatch(()=>{s.getRange(U).autoFill(te),s.getRange(te).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:ge,autoSelect:!0})}catch(Ee){Pe?.showError?.(Ee)}finally{p.current=null,le?.()}},onFillPreview:(U,te,ge)=>{if(v.current&&E){P.setMode(ai);try{p.current?.direction!==ge&&(p.current=null,s.getRange(U).autoFill(te,{previewOnly:Be=>{p.current={callback:Be,direction:ge}}}));const le=p.current?.callback?.(te);if(!le||le.isEmpty())return;const Ee=le.toText();if(!Ee)return;const ie=me.CoordUtils.cellToRange(le.getCoords()),pe=n.getRelativePointFromClient(0,0);let De=0,xe=0,Oe=r.ToolTipPlacement.Bottom;if(ge===d.IRange.Direction.Down){De=ve.getColOffset(ie.colEnd+1)-pe.x;const Be=ve.getRowOffset(ie.rowEnd),C=ve.getRowOffset(ie.rowEnd+1);xe=C-(C-Be)/2-pe.y,Oe=r.ToolTipPlacement.Right}else if(ge===d.IRange.Direction.Right){xe=ve.getRowOffset(ie.rowEnd+1)-pe.y;const Be=ve.getColOffset(ie.colEnd),C=ve.getColOffset(ie.colEnd+1);De=C-(C-Be)/2-pe.x,Oe=r.ToolTipPlacement.Bottom}else if(ge===d.IRange.Direction.Up){De=ve.getColOffset(ie.colEnd+1)-pe.x;const Be=ve.getRowOffset(ie.rowStart),C=ve.getRowOffset(ie.rowStart+1);xe=C-(C-Be)/2-pe.y,Oe=r.ToolTipPlacement.Right}else if(ge===d.IRange.Direction.Left){xe=ve.getRowOffset(ie.rowEnd+1)-pe.y;const Be=ve.getColOffset(ie.colStart),C=ve.getColOffset(ie.colStart+1);De=C-(C-Be)/2-pe.x,Oe=r.ToolTipPlacement.Bottom}E({anchor:{x:De,y:xe},display:Ee,placement:Oe})}catch(le){Pe?.showError?.(le)}}},onFillDone:()=>{p.current=null,P.setMode(null),z?.()}}),de=r.useCallbackRef(U=>{Z(r.ReactUtils.createSyntheticEvent(U))},[Z,ce]);o.useEffect(()=>{const U=n?.getStage();if(U)return U.addEventListener("pointerdown",de),()=>{U.removeEventListener("pointerdown",de)}},[n?.getStage()]);const Ie=r.useImperativeElement(t,()=>({}),[]),ye=o.useRef(null);return c.jsx("div",{className:dt(a,"sheet-selection",ni),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Qt([Ie,ye]),...k,children:Y(n)})})),En=Object.freeze({x:0,y:0,width:0,height:0}),ci={fireOnModelChange:!1},di=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:m,onShow:s,onUnFocus:v,isDragging:b,updateFrameBounds:y,dragStart:g,style:k,disabled:x,renderMovable:E,...z}=e,[W,V]=o.useState(En),[R,P]=o.useState(null),[p,F]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const N=a.getBounds();if(!N)return;const B=i.toViewBounds(N);V(B??En),y(B??En)},[i?.getBounds()]),et(a,{onBoundsChange:N=>{const B=N.getBounds();if(!B)return;const $=i.toViewBounds(B);V($??En),y($)},onSelectionChange:()=>{const N=me.CommonUtils.hasFocus(M.current,!0);!p&&!N||a.isSelected()||v()}}),et(a,{onRequestFocus:()=>me.CommonUtils.whenFocus(M.current,!0)},ci),o.useEffect(()=>{const N=M.current;return l(N),()=>{f(N)}},[]);const H=o.useMemo(()=>{if(!W)return null;let{width:N,height:B}=W;return E({view:i,movable:a,disabled:x,isDragging:b,style:{position:"relative",left:0,top:0,width:N,height:B},onHide:m,onShow:s})},[i,a,W.width,W.height,x,b]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Qt([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:W.x,top:W.y,width:W.width,height:W.height,...k},onMouseDown:async N=>{const B=N.shiftKey||N.ctrlKey,$=a.isSelected(),ce=N.currentTarget;B&&$?a.unselect():($&&!B||await a.select({addToSelection:B}),g(N.nativeEvent,ce),ce.focus())},onFocus:N=>{N.relatedTarget&&!R&&P(N.relatedTarget),F(!0)},onBlur:N=>{R&&!M?.current?.contains(N.relatedTarget)&&P(null),N.relatedTarget&&F(!1)},...z,children:H})})),ui="_movable-area_314c6_5",Nr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:m,onFocus:s,disabled:v=!1,disableDrag:b=!1,disableResize:y=!1,className:g,style:k,renderDirections:x=["nw","n","ne","w","e","sw","s","se"],onFirstRender:E,...z}=e,W=n.getBounds(),V=r.useCallbackRef(E,[E]),R=r.useCallbackRef(m,[m]),P=r.useCallbackRef(s,[s]),[p,F]=o.useState([]),[M,H]=o.useState(!1),[N,B]=o.useState(!1),$=o.useRef(!0),ce=o.useRef(new Map),_=o.useRef(new Map),K=o.useRef(new Map),L=o.useRef(new Map),I=o.useRef(new Map),q=o.useRef({onRequestFocus:ee=>(te(ee),null)}),O=o.useRef(null),Q=o.useRef(null),re=o.useRef(null),[be,he]=o.useReducer(ee=>ee+1,0);o.useLayoutEffect(()=>{he()},[n,i]),et(i,{onCollectionChange:()=>{const ee=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),ke=I.current;ke.forEach(Ae=>{Ae()}),ke.clear();const Ne=q.current;for(let Ae=0;Ae<ee.length;Ae++){const Fe=ee[Ae];if(Fe.isClosed())continue;const A=Fe.addListeners(Ne);ke.set(Fe,A)}he()},onInvalidated:()=>{he()}}),et(a,{onMovableSelectionChange(ee){Pe(),he()}});const ze=o.useCallback((ee,ke)=>{const Ne=K.current.get(ee);re.current&&(re.current.getTargets().forEach(Ae=>{if(Ae===Ne)return Ae.style.left=ke.x+"px",Ae.style.top=ke.y+"px",Ae.style.width=ke.width+"px",void(Ae.style.height=ke.height+"px")}),re.current.updateRect())},[]),Pe=()=>{const ee=[],ke=a.getMovableSelection();ke.forEach(Ne=>{const Ae=K.current.get(Ne);Ae&&ke.indexOf(Ne)!==-1&&ee.push(Ae)}),F(Ne=>me.CommonUtils.isEqualArrays(Ne,ee)?Ne:ee)},ve=o.useRef(null),Re=o.useRef(null),We=o.useMemo(()=>(Re.current||(Re.current=new Promise(ee=>{ve.current=ee})),Re.current),[]),Y=o.useRef(null),Z=r.useCallbackRef(async(ee,ke)=>{Y.current=ke,await(async()=>!(!await We.then()||!re.current))()&&Y.current===ke&&re.current.dragStart(ee,ke)},[p]),[de,Ie]=o.useState(!1),ye=o.useRef(null),U=o.useRef(null),te=r.useCallbackRef(async(ee=null)=>{if(ee||(ee=a.getMovableSelection()[0]),!ee)return R?.(),!1;const ke=K.current.get(ee);ke?(await me.CommonUtils.whenFocus(ke),ke.focus(),U.current=ke,ye.current=null):ye.current=ee},[a]);o.useEffect(()=>{de&&p.length>0&&U.current!==p[0]&&te(),$.current&&(V?.(),$.current=!1)},[p]);const ge=o.useMemo(()=>{const ee=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(ee.length===0&&ce.current.size===0)return null;const ke=(J,j,G,qe=!0)=>{const Ce=J.isSelected(),h={tabIndex:G,view:n,movable:J,onRefLoad:w=>{ye.current===J&&(w.focus(),U.current=w,ye.current=null),K.current.set(J,w),_.current.set(w,J),j.rendered=!0,Pe()},onRefUnload:w=>{K.current.delete(J),_.current.delete(w),j.rendered=!1,Pe()},onUnFocus:R,onHide:w=>{j.onHide=w},onShow:w=>{j.onShow=w},isDragging:Ce&&(N||M),disabled:v,renderMovable:l,updateFrameBounds:w=>{ze(J,w)},dragStart:Z,onMouseUp:()=>{if(Y.current=null,Q.current){H(!1),B(!1);let w=!1;L.current?.forEach(T=>{me.CommonUtils.isEqualBounds(T.movable.getBounds(),T.startBounds)||(w=!0)}),w?Ee():ie()}},style:{opacity:qe?M&&Ce?.7:void 0:0,zIndex:M&&Ce?J.getZIndex()+ee.length:void 0,pointerEvents:qe?void 0:"none",cursor:N&&Ce?"grabbing":v||b?"initial":"move",boxShadow:!Ce||N&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(di,{...h},`movable-${J.getUUID()}`)},Ne=ce.current,Ae=new Map,Fe=[];for(let J=0;J<ee.length;J++){const j=ee[J];if(j.isClosed())continue;let G=Ne.get(j);G||(G={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(qe,Ce)=>{if(!Ce||Ce.shown===!0)return;Ce.shown=!0;const h=++Ce.visibilityRequestId;requestAnimationFrame(()=>{const w=ce.current.get(qe);w&&h===Ce.visibilityRequestId&&(Ce.onShow?.(qe),w.shown=!0)})},doHide:async(qe,Ce)=>{if(!Ce||Ce?.shown===!1)return;Ce.shown=!1;const h=++Ce.visibilityRequestId,w=await Promise.resolve(Ce.onHide?.(qe));h===Ce.visibilityRequestId&&w!==!1&&(Ce.shown=!1,ce.current.delete(qe),he())},visibilityRequestId:0}),G.frame=ke(j,G,J,!0),Fe.push(G.frame),G.doShow(j,G),Ne.delete(j),Ae.set(j,G)}const A=[];return a.getMovableSelection().forEach(J=>{const j=Ne.get(J);j&&(j.frame=ke(J,j,-1,!1),A.push(j.frame),Ne.delete(J),Ae.set(J,j))}),Ne.forEach((J,j)=>{J.frame=ke(j,J,-1,!1),A.push(J.frame),J.doHide(j,J),Ne.delete(j),Ae.set(j,J)}),ce.current=Ae,Pe(),[...A,...Fe]},[be,n,l,v,b,y,M,N]),le=r.useCallbackRef((ee,ke)=>{const Ne=`${ke} ${p.length===1?d.TextUtils.capitalize(_.current?.get(p[0]).getContent().getType()):"Drawings"}`;Q.current&&(console.warn(`Transaction ${Q.current.getDescription()} is being replaced by ${Ne}`),Q.current.rollback(),Q.current=null),Q.current=f.beginCommit({description:Ne}),L.current.clear();for(let Ae=0;Ae<p.length;Ae++){const Fe=p[Ae],A=_.current?.get(Fe);A?L.current.set(Fe,{movable:A,startBounds:n.toViewBounds(A.getBounds())}):console.warn("invalid element",A)}},[f,n,p]),Ee=o.useCallback(()=>{if(!Q.current)return;const ee=[];L.current?.forEach(ke=>{ee.push(ke.movable)}),Q.current.commit({viewAfter:{view:a,movableSelection:ee}}),L.current.clear(),Q.current=null},[]),ie=o.useCallback(()=>{Q.current&&(Q.current.rollback(),Q.current=null)},[]),pe=o.useRef(null);o.useEffect(()=>{pe.current&&(pe.current.onscroll=ee=>{ee.preventDefault(),ee.srcElement.scrollTop=0,ee.srcElement.scrollLeft=0})},[pe.current]);const De=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:te,focus:()=>{te()}}),[a]),[xe,Oe]=o.useState(null),Be=o.useRef(!1),C=o.useRef(!1),je=o.useRef(!1);o.useEffect(()=>{if(v||p.length===0||je.current||Be.current)return;if(C.current)return void requestAnimationFrame(()=>{re.current&&O.current&&re.current.refTargets.length>0&&(je.current=!0,ve.current?.(!0)),F([...p])});Be.current=!0;const ee=o.lazy(async()=>{try{const ke=await Promise.resolve().then(()=>require("./BB3MqE6MmDe-ge2D.cjs"));return Be.current=!1,C.current=!0,F([...p]),ke}catch(ke){return console.warn(ke),ve.current?.(!1),null}});Oe(ee)},[p,v,b,y]);const tt=o.useMemo(()=>!xe||v?null:c.jsx(o.Suspense,{children:c.jsx(xe,{className:dt({dragging:M||N,resizing:M,moving:N}),container:null,ref:re,target:re.current?p:[],draggable:!v&&!b,resizable:!v&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:x,onResizeStart:ee=>{le(ee.target,"Resize")},onResize:ee=>{if(!Q.current)return ee.stopDrag(),void he();H(!0);const ke=ee.direction[0]!==0&&ee.direction[1]!==0;let Ne=0,Ae=0;for(let Fe=0;Fe<p.length;Fe++){const A=p[Fe],J=L.current.get(A),j=_.current.get(A);if(!J||!j){console.warn("invalid element");continue}let G=ee.dist[0],qe=ee.dist[1],Ce=ee.drag.dist[0],h=ee.drag.dist[1],w=J.startBounds.width,T=J.startBounds.height;Fe===0?(Ne=w,Ae=T):(G*=w/Ne,Ce*=w/Ne,qe*=T/Ae,h*=T/Ae);const u={...J.startBounds};if(u.width=Math.max(0,w+G),u.height=Math.max(0,T+qe),ee.direction[0]===-1&&(u.width=Math.max(0,Math.min(J.startBounds.x+w,w-Ce))),ee.direction[1]===-1&&(u.height=Math.max(0,Math.min(J.startBounds.y+T,T-h))),ke&&(j.isLockAspectRatio()||ee.inputEvent?.shiftKey)){const S=w/T,D=u.width/u.height;D>S?u.height=u.width/S:D<S&&(u.width=u.height*S)}ee.direction[0]===-1&&(u.x=Math.max(0,Math.min(J.startBounds.x+w,J.startBounds.x+w-u.width))),ee.direction[1]===-1&&(u.y=Math.min(J.startBounds.y+T,J.startBounds.y+T-u.height)),J.movable.setBounds(n.toAbsoluteBounds(u))}},onResizeEnd:ee=>{H(!1),Ee()},onDragStart:ee=>{le(ee.target,"Move")},onDrag:ee=>{if(!Q.current)return ee.stopDrag(),void he();B(!0);for(let ke=0;ke<p.length;ke++){const Ne=p[ke],Ae=L.current.get(Ne);Ae?Ae.movable.setBounds(n.toAbsoluteBounds({...Ae.startBounds,x:Ae.startBounds.x+ee.translate[0],y:Ae.startBounds.y+ee.translate[1]})):console.warn("invalid element")}},onDragEnd:ee=>{},onMouseUp:ee=>{}})}),[be,xe,p,n,v,b,y,M,N]);return c.jsx("div",{className:dt(g,"movable-area",ui),style:{width:W.width,height:W.height,...k,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Qt([De,pe]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:W.width,height:W.height},...z,children:c.jsxs("div",{ref:O,style:{position:"absolute",pointerEvents:"auto"},onFocus:ee=>{P?.(),Ie(!0)},onBlur:ee=>{Ie(!1)},onKeyDownCapture:ee=>{if(ee.isDefaultPrevented())return;const ke=ee.nativeEvent.ctrlKey,Ne=ee.nativeEvent.altKey,Ae=ee.nativeEvent.shiftKey;if(ee.which===r.KeyCodes.Escape){const G=a.getMovableSelection();let qe=[...G];return p.forEach(Ce=>{if(qe.length===0)return;const h=_.current.get(Ce);let w=qe.indexOf(h);qe.splice(w,1)}),qe.length!==G.length&&a.selectMovables(qe),qe.length===0&&R?.(),void ee.preventDefault()}const Fe=.1,A=G=>{i.updateSelected(qe=>{qe.setRotation(qe.getRotation()+G)},"Rotate")},J=(G,qe=!0)=>{i.updateSelected(Ce=>{const h=Ce.getBounds();let w=1+G;qe||(w=1/w);const T=Math.sqrt(Math.pow(h.width,2)+Math.pow(h.height,2)),u=Math.atan2(h.height,h.width),S=w*T;if(S<10)return;const D=S*Math.cos(u),oe=S*Math.sin(u),fe={x:h.x+(h.width-D)/2,y:h.y+(h.height-oe)/2,width:D,height:oe};Ce.setBounds(fe)},"Resize")},j=G=>{i.updateSelected(qe=>{const Ce=qe.getBounds(),h={x:Ce.x+(G.x??0),y:Ce.y+(G.y??0),width:Ce.width+(G.width??0),height:Ce.height+(G.height??0)};qe.setBounds(h)},"Nudge")};if(ee.which===r.KeyCodes.Delete)i.updateSelected(G=>{G.delete()},"Delete"),ee.preventDefault();else if(ee.key==="a"&&ke){const G=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(G,!0),ee.preventDefault()}else ee.key==="ArrowLeft"?(Ae?J(Fe,!1):Ne?A(-10):j({x:ke?-10:-1}),ee.preventDefault()):ee.key==="ArrowRight"?(Ae?J(Fe,!0):Ne?A(10):j({x:ke?10:1}),ee.preventDefault()):ee.key==="ArrowUp"?(Ae?J(Fe,!0):j({y:ke?-10:-1}),ee.preventDefault()):ee.key==="ArrowDown"&&(Ae?J(Fe,!1):j({y:ke?10:1}),ee.preventDefault())},children:[ge,tt]})})})})),_t=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 f=e[l].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),i=Math.max(f.x+f.width,i),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Qo=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,m=Number.MAX_SAFE_INTEGER,s=0;for(let y=0;y<e.length;y++){const g=e[y],k=g.getBounds();f+=k[l],m=Math.min(k[i],m),s=Math.max(k[i]+k[l],s),n.push({bounds:k,movable:g})}const v=(s-m-f)/(e.length-1);n.sort((y,g)=>{const k=y.bounds[i],x=g.bounds[i];return k!==x?k-x:y.bounds[a]-g.bounds[a]});const b=new Map;b.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const g=n[y-1].bounds,k={...n[y].bounds};k[i]=g[i]+g[l]+v,n[y].bounds=k,b.set(n[y].movable,k)}return b.set(n[n.length-1].movable,n[n.length-1].bounds),b},Lr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,m=r.useNotifier(),s=r.useEditMode();o.useRef(s.getMode()).current=s.getMode();const v=r.useCallbackRef(async(R,P,p=null,F=!0)=>{const M=async()=>{const H=await Promise.resolve(m?.showBusy?.(R.label()));try{await P();const N=p??R?.label?.();if(f){let B=null;R&&N!==!1&&(B=new r.SimpleCommand(R.key(),l,{label:N,description:N},M)),f(B)}H?.(),F&&s.setMode(null)}catch(N){H?.(),m?.showError?.(N)}};await M()},[f,m]),[b,y]=o.useReducer(R=>R+1,0),g=r.useCallbackRef((R,P,p)=>{if(!n)return;const F=n.getMovableSelection();if(F.length===0)return;let M="Drawings";if(F.length===1){const N=F[0];M=d.TextUtils.capitalize(N.getContent().getType())??"Drawing"}const H=`${R.label()} ${M}`;v(R,()=>{let N=null;i&&(N=i.beginCommit(H));const B=n.getMovableSelection();if(B.length===0)return;const $=p?.(B);for(let ce=0;ce<B.length;ce++){const _=B[ce];P(_,$)}N?.commit()})},[n,i]),[k,x]=o.useState(n.getMovableSelection()[0]??null),[E,z]=o.useState(!k||k?.isProtected()),W=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){g(this,R=>{R.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){g(this,R=>{R.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){g(this,R=>{R.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){g(this,R=>{R.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){g(this,R=>{R.setLockAspectRatio(!R.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.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.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.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.",icon:"DrawResize"},function(){g(this,R=>{R.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){g(this,(R,P)=>{R.setBounds({x:P.x})},_t)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){g(this,(R,P)=>{R.setBounds({x:(P.width-R.getBounds().width)/2+P.x})},_t)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){g(this,(R,P)=>{R.setBounds({x:P.width-R.getBounds().width+P.x})},_t)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){g(this,(R,P)=>{R.setBounds({y:P.y})},_t)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){g(this,(R,P)=>{R.setBounds({y:(P.height-R.getBounds().height)/2+P.y})},_t)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){g(this,(R,P)=>{R.setBounds({y:P.height-R.getBounds().height+P.y})},_t)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){g(this,(R,P)=>{R.setBounds(P.get(R))},R=>Qo(R))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){g(this,(R,P)=>{R.setBounds(P.get(R))},R=>Qo(R,!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.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),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,k]);o.useEffect(()=>{},[s]);const V=o.useMemo(()=>{let R=null;return R=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),R.addCommands(W,!0),R},[a,W]);return et(k,{onAnyChange:()=>{V.getCommand("formatAnchorTypeTwoCell").update({state:k?.getAnchorType()===d.IAnchored.Type.TwoCell}),V.getCommand("formatAnchorTypeOneCell").update({state:k?.getAnchorType()===d.IAnchored.Type.OneCell}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("toggleLockAspectRatio").update({state:k?.isLockAspectRatio()})},onProtectedChange:R=>{z(R.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const R=n.getMovableSelection()[0]??null;x(R),z(!R||R.isProtected()),y()}}),et(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const R={disabled:E};V.getCommand("formatAnchorTypeTwoCell").update(R),V.getCommand("formatAnchorTypeOneCell").update(R),V.getCommand("formatAnchorTypeAbsolute").update(R),V.getCommand("toggleLockAspectRatio").update(R);const P=t.getCount(),p=n.getMovableSelection(),F=E||P<=1||p.length===0;let M={disabled:F},H=M;if(!F&&p.length===1){const $=p[0];$.getZIndex()===0&&(M={disabled:!0}),$.getZIndex()===P-1&&(H={disabled:!0})}V.getCommand("moveToFront").update(H),V.getCommand("moveForward").update(H),V.getCommand("moveToBack").update(M),V.getCommand("moveBackward").update(M);const N={disabled:E||p.length<=1};V.getCommand("formatDrawAlignLeft").update(N),V.getCommand("formatDrawAlignCenter").update(N),V.getCommand("formatDrawAlignRight").update(N),V.getCommand("formatDrawAlignTop").update(N),V.getCommand("formatDrawAlignMiddle").update(N),V.getCommand("formatDrawAlignBottom").update(N),V.getCommand("formatDrawFlipHorz").update(N),V.getCommand("formatDrawFlipVert").update(N),V.getCommand("formatDrawGroup").update(N),V.getCommand("formatDrawUngroup").update(N),V.getCommand("formatDrawSwapShapes").update(N),V.getCommand("formatDrawSwapShapesHorz").update(N),V.getCommand("formatDrawSwapShapesVert").update(N);const B={disabled:E||p.length<=2};V.getCommand("formatDrawDistributeHorz").update(B),V.getCommand("formatDrawDistributeVert").update(B)},[b,E,b]),V},gi=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:m,onShow:s,...v}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:g,width:k}]=Vt();return c.jsx("div",{...v,ref:Qt([b,y]),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:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),hi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:f,target:m,onRepeatCommandChange:s}=e,v=Lr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:s,commands:f,target:m});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const b=o.useMemo(()=>c.jsx(Nr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{v.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,v]);return b&&n?b:null})),mi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:m,commands:s}=e,v=r.useEditMode(),[b,y]=o.useState(null),[g,k]=o.useState(null),[x,E]=o.useState(null),[z,W]=o.useState(null),[V,R]=o.useState(null);o.useLayoutEffect(()=>{if(x===null)return W(null),void R(null);const q=()=>{const O=i.getRange(x).getCell(),Q=O.getStyle();let re,be=Q.getFill()?.toCSS(a.body.darkMode);be.background!=="none"&&be.background!=="transparent"||(be=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),be.background!=="none"&&be.background!=="transparent"||(be={background:a.body.fill}),W({style:be}),O&&!O.getFormula()&&(re=O?.getRenderHorizontalAlignment()),R(re??r.HorizontalAlignment.Left)};return q(),i.getRange(x).addListener(()=>{q()})},[i,x,a?.body]);const P=r.useCallbackRef(()=>{let q=g.editState.dirty??"";if(g.editState.dirty!==void 0){const O=d.TextUtils.clampString(q);try{const Q=g.sheet.getRange(g.coords),re=`Typing '${O}' into ${Q.toString()}`;return Q.setValue(q,{description:re,autoFit:!0}),E(null),k(null),v.setMode(null),m(null),!0}catch(Q){throw me.Notifier.error(new Error(`Unable to enter '${O}'.`,{cause:Q})),Q}}},[i,g]),p=r.useCallbackRef(q=>i.getRange(q).getCell().getExtrusions()??me.CoordUtils.cellToRange(q),[i]),F=r.useCallbackRef(q=>{let O=d.IRange.Orientation.Row,Q=!1;q!==d.IRange.Direction.Up&&q!==d.IRange.Direction.Down||(O=d.IRange.Orientation.Column),q!==d.IRange.Direction.Left&&q!==d.IRange.Direction.Up||(Q=!0),i.getSelection().traverse(O,Q)},[i]),M=o.useCallback((q,O)=>{if(l)return l(q,O);if(!i)return null;const{ref:Q,...re}=q;return c.jsx(Rr,{ref:Q,...re,sheet:i,bodyStyle:a?.body,activeCoords:O,commands:s,onChangeEdit:be=>{const he={sheet:i,coords:O,editState:be};v.setMode(ze=>({...ze,description:he.editState.editMode?"Edit":"Enter",args:{...ze?.args,stateAndCoords:he}}))},editState:g.editState})},[i,z,l,g,x]),{overlay:H,startEdit:N,submitEdit:B,cancelEdit:$,onKeyboardEventNative:ce,onPointerEventNative:_}=ht.useKeyboardEditorOverlay({view:n,activeCoords:b,getCellEditor:M,canEdit:()=>{const q=i.getProtection();if(q.isReadOnly())return!1;const O=q.isLocked();return O&&f(),!O},onBeforeStartEdit:q=>{const O=kr(()=>i.getRange(q).getCell()),Q={sheet:i,coords:q,editState:Object.freeze(O)};v.setMode({key:"edit",args:{stateAndCoords:Q}}),k(Q)},onStartEdit:q=>{E(q),m(q)},onSubmitEdit:P,onCancelEdit:q=>{E(null),k(null),v.setMode(null),m(null)},onDoneEdit:q=>{v.setMode(null)},onNavigate:F,containerProps:z,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:V,getRangeCoords:p});et(i.getSelection(),{onChange(q){y(i.getSelection().getCoords().cell)}});const K=r.useCallbackRef(q=>{_(q),x&&B()},[_,$,x]),L=o.useCallback(q=>{_(q)},[_]),I=o.useCallback(q=>{ce(q)},[ce]);return o.useEffect(()=>{const q=n?.getStage();if(q)return q.addEventListener("pointerdown",K),q.addEventListener("dblclick",L),q.addEventListener("keydown",I),()=>{q.removeEventListener("pointerdown",K),q.removeEventListener("dblclick",L),q.removeEventListener("keydown",I)}},[n?.getStage()]),o.useEffect(()=>{const q=v.getMode(),O=q?.key;O==="edit"||O==="enter"?g?q.args?.cancel?$():q.args?.submit?B():k(q.args?.stateAndCoords):N(q.args?.start):x&&$()},[v]),H(n,t)})),Pr="white",jr="black",fi=`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='${jr}' fill='${Pr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,pi=`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='${jr}' fill='${Pr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,vi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,m]=o.useState(null),[s,v]=o.useState(null),[b,y]=o.useState(null),[g,k]=o.useState(null),x=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const p=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(p.length>0?p:null)}else l(!1),m(null)},[i,n]),E=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const F=n.getCellCoordsFromClient(p.clientX,p.clientY),M=i.getTables().getItems({address:F});M.length===1&&M[0].select()},[n,i]),z=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const F=n.getCellCoordsFromClient(p.clientX,p.clientY),M=i.getTables().getItems({address:F});if(M.length===1){const H=M[0].getRange().getCoords(),N={colStart:H.colStart,rowStart:F.rowIndex,colEnd:H.colEnd,rowEnd:F.rowIndex};i.getRange(N).select()}},[n,i]),W=r.useCallbackRef(()=>{if(!a)return;const p=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(p.length>0?p:null)},[i,a,n]);et(i?.getSelection(),{onChange(p){v(i.getSelection().getCoords().cell)}}),et(b,{onAnyChange(p){x(),W()}}),et(g,{onAnyChange(p){W()}}),et(i,{onTablesChange(p){x(),W()},onInvalidated(p){x(),W()}});const V=o.useMemo(()=>me.CommonUtils.debounce(me.CommonUtils.throttle(W,300),300),[]);o.useEffect(()=>{V()},[n]),o.useEffect(()=>{let p=null;if(f)for(let F=0;F<f.length&&!p;F++){const M=f[F],H=M.getRange().getCoords();d.CoordUtils.isCellWithinRange(s,H)&&(p=M)}y(p)},[s,f]);const R=r.useCallbackRef(p=>{let F=null;if(f)for(let M=0;M<f.length;M++){const H=f[M],N=H.getRange().getCoords();let B=n.getRangeCoordsBounds(N);const $=n.getRelativePointFromClient(p.clientX,p.clientY),ce=$.x,_=$.y;if(ce>=B.x&&ce<=B.x+B.width&&_>=B.y&&_<=B.y+B.height){const K=n.getViewportSize();ce<=0||_<=0||ce>=K.width||_>=K.height||(F=H)}}k(F)},[n,f]);if(o.useEffect(()=>{const p=n?.getStage();if(p&&f)return p.addEventListener("mousemove",R),p.addEventListener("mouseleave",R),()=>{p.removeEventListener("mousemove",R),p.removeEventListener("mouseleave",R)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const P=[];for(let p=0;p<f.length;p++){const F=f[p];if(F.isClosed())continue;const M=F===g,H=F===b,N=F.getRange().getCoords(),B=n.getRangeCoordsBounds(N);let $;if(M||H){const ce=F.getStyle().getProperties(),_=ce.headerRow?.fill?.background??ce.wholeTable?.border?.top?.color?.toString();if(_&&i){const K=i.getStyles().parseColor(_);K&&($=K.toCSS())}$||($="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}P.push(c.jsx("div",{style:{position:"absolute",left:B.x,top:B.y,width:Math.min(16,B.width),height:B.height,pointerEvents:"all",cursor:fi},onMouseDown:z},`table-select-row-${F.getName()}`)),P.push(c.jsx("div",{style:{position:"absolute",left:B.x,top:B.y,width:Math.min(16,B.width),height:Math.min(16,B.height),pointerEvents:"all",cursor:pi},onMouseDown:E},`table-select-${F.getName()}`)),P.push(c.jsx(ht.Selection,{x:B.x,y:B.y,width:B.width,height:B.height,range:N,strokeWidth:H?.5:0,stroke:$??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${$} 0px 0px 1px 1px`:void 0}},`table-outline-${F.getName()}`))}return P})),Ci=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[m,s]=o.useState(null),v=o.useRef(null),b=r.useCallbackRef(()=>{const z=i.getSelectedCell(),W=z.getSpill()?.getCoords()??null;me.CoordUtils.isEqualRanges(W,l)||(s(W?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(W),coords:W}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(W))},[i,n,l]);o.useEffect(()=>(v.current&&(clearTimeout(v.current),v.current=null),m&&(v.current=setTimeout(()=>{s(null),v.current=null},a)),()=>{v.current&&(clearTimeout(v.current),v.current=null)}),[m,a]);const y=o.useMemo(()=>me.CommonUtils.debounce(me.CommonUtils.throttle(b,80),80),[]);if(et(i?.getSelection(),{onChange(z){y()}}),et(i,{onSpillsChange(z){b()},onInvalidated(z){b()}}),!n||!l&&!m)return null;const g=i.getRange(l).getValue()instanceof d.FormulaError.Spill,k=[];let x=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!me.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&s(null),x=n.toClipBounds(x,-10),!x)return;const E="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return k.push(c.jsx(ht.Selection,{x:x.x,y:x.y,width:x.width,height:x.height,range:l,strokeWidth:1,stroke:E,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:g?"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:`${E} 0px 0px 4px 0px`}},"spill-outline}")),k})),yi={position:"absolute",top:0,left:0,bottom:0,right:0},er=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=me.CommonUtils.mergeContentful(e.body,l);return n.body=me.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=me.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=me.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=me.CommonUtils.mergeContentful(n.header,l),n.headerSelect=me.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=me.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=me.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=me.CommonUtils.mergeContentful(n.headerSelectAll,l),n},wi={fireOnModelChange:!1},tr={},Or=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=tr,headersStyle:a=tr,onSheetContextMenu:l,showColumnHeaders:f,columnHeaderProps:m,showRowHeaders:s,rowHeaderProps:v,showScrollbars:b=!0,scrollPaneProps:y,onViewportChange:g,commands:k,onRepeatCommandChange:x,onMoveCell:E,overlays:z,renderMovable:W,viewportComponent:V,onElementLoad:R,getCellEditor:P,onFocus:p,onBlur:F,style:M=r.ReactUtils.EmptyCssProperties,onShowTooltip:H,onShowColumnTooltip:N,onShowRowTooltip:B,onCloseTooltip:$,gridProps:ce,cellRenderProps:_,...K}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[L,I]=o.useReducer(X=>X+1,0),[q,{width:O,height:Q}]=Vt(),re=r.useCallbackRef(H,[H]),be=r.useCallbackRef(N,[N]),he=r.useCallbackRef(B,[B]),ze=r.useCallbackRef($,[$]),Pe=o.useRef(!1);o.useLayoutEffect(()=>{Pe.current=!0},[n]);const ve=n?.getStyles(),Re=o.useMemo(()=>er(i,ve),[i,ve]),We=o.useMemo(()=>er(a,ve),[a,ve]),{body:Y={},buttonSurface:Z={}}=Re,{header:de={},headerSelect:Ie={},headerSelectAll:ye={}}=We,U=o.useRef(null),[te,ge]=o.useState(()=>n?.getView()),le=(te?.getZoomScale()??100)/100,Ee=o.useMemo(()=>({vertical:te.isShowColumnGridlines()&&le>=.4,horizontal:te.isShowRowGridlines()&&le>=.4}),[te?.isShowColumnGridlines(),te?.isShowRowGridlines(),le]),ie=o.useMemo(()=>{if(te?.getGridLineColor())return{strokeDasharray:"1,1"}},[te?.getGridLineColor(),Re]),pe=f??te?.isShowColumnHeaders(),De=s??te?.isShowRowHeaders(),[xe,Oe]=o.useState({width:0,height:0}),Be=o.useMemo(()=>{let X=40,Se=20;const Ke=n?.getStyles().getNormal().getFont();if(xe.width>0&&xe.height>0){const Ve=Ke?.toCSS()?.fontFamily??Re.header.text.fontFamily,Ze=Ke?.getSize()??Re.header.text.fontSize,Ge=d.IFont.getSharedMeasurer()(""+xe.height,Math.ceil(Ze*d.IFont.getDeviceScale()),Ve);X=Ge.width,Se=Ge.lineHeight}return{width:Math.round(X+5),height:Math.round(Se+3)}},[xe,Re?.header.text,n]),C=De?le*Be.width:de.edgeStrokeWidth,je=pe?le*Be.height:de.edgeStrokeWidth,tt=Math.max(O,(n?.getColumnHeaders().getDefaultSize()??Be.width)+C+1),ee=Math.max(Q,(n?.getRowHeaders().getDefaultSize()??Be.height)+je+1),ke=o.useRef(new Map),Ne=o.useRef(null),Ae=()=>({getColOffset:X=>n.getColumnHeaders().findOffset(X),getColIndex:X=>n.getColumnHeaders().findIndex(X),getRowOffset:X=>n.getRowHeaders().findOffset(X),getRowIndex:X=>n.getRowHeaders().findIndex(X)}),[Fe,A]=o.useState(()=>Ae()),[J,j]=o.useState(!1),[G,qe]=o.useState(null),Ce=!0,h=Re.selection?.strokeFill,w=o.useCallback(()=>At.current,[]),[T,u]=o.useState(),S=r.useCallbackRef(X=>{u(X);const Se=n?n.getView():null;Se&&Se.setTopLeft(X?{left:X.left,top:X.top}:null),g?.(X)},[n,g]),D=o.useRef(null);o.useEffect(()=>{if(!T||!n)return;const X=n.getRangeAtBounds({x:T.left,y:T.top,width:T.width,height:T.height});D.current?.(),D.current=X.addListener(()=>{const Se=X.getCoords();U?.current?.invalidate(Se)})},[T,n]);const[oe,fe]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(X=>{const Se=me.CoordUtils.cellToRange(X);if(n.isClosed())return Se;const Ke=n.getRange(Se,{ignoreHidden:!0}).getMerges();return Ke.length===0?Se:Ke[0]},[n]),ne=X=>{if(!X||X.coords.colIndex===0&&X.coords.rowIndex===0)return null;const Se={};return X.coords.colIndex>0&&(Se[me.AnchorLocation.Left]={index:X.coords.colIndex,scrollOffset:X.topLeft.left}),X.coords.rowIndex>0&&(Se[me.AnchorLocation.Top]={index:X.coords.rowIndex,scrollOffset:X.topLeft.top}),Se},[ae,ue]=o.useState(()=>ne(n.getView().getFreezePanes())),we=r.useEditMode(),He=o.useCallback(()=>U.current,[]),Me=r.useCallbackRef(X=>{we.setMode(Se=>Se?.key==="edit"?{...Se,args:{...Se.args}}:{key:"edit",args:{stateAndCoords:null,start:X}})},[]),Te=r.useCallbackRef(()=>T,[T]),Ue=Dr({sheet:n,commands:k,target:He,onRepeatCommandChange:x,bodyStyle:Y,onStartEdit:Me,getViewport:Te}),[_e,$e]=o.useState(n.getSelection().isEntire()),[Ye,Je]=o.useState(te?.getMovableSelection().length>0),Le=G!==null||Ye,Xe=null,[vt,nt]=o.useState(!1);o.useEffect(()=>{nt(!1)},[n.getProtection()]);const at=r.useNotifier(),Tt=r.useCallbackRef(()=>{vt||(nt(!0),at.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.NotifierType.Error}))},[at,vt]),kt=o.useMemo(()=>{const X=we.getMode();return X?.cursor?X.cursor:null},[Xe,we]),[yt,wt]=o.useState(null),ct=o.useRef(!1),[rt,Rt]=o.useState([]),ft=o.useRef(null),[Ct,zt]=o.useState(me.TypesUtils.EmptyTopLeft),[qt,Kt]=o.useState(me.TypesUtils.EmptyTopLeft);o.useEffect(()=>{zt({left:oe?.left,top:0})},[oe?.left]),o.useEffect(()=>{Kt({left:0,top:oe?.top})},[oe?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{ue(ne(n.getView().getFreezePanes()))},onTopLeftChange:()=>{fe(n.getView().getTopLeft())},onMovableSelectionChange:()=>{Je(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{$e(n.getSelection().isEntire())}}),et(n,{onViewChange(){ge(n.getView()),A(Ae())},onLayoutChange:()=>{const X=n.getEntireRange();Oe({height:X.getRowCount(),width:X.getColumnCount()}),A(Ae())},onStyleChange:()=>{jt()},onMovablesChange:()=>{},onInvalidated:()=>{jt()}}),et(n,{onRequestScrollIntoView:async(X,Se)=>{if(!Se)return;const Ke={colIndex:Se?.coords?.colStart,rowIndex:Se?.coords?.rowStart};return await U.current?.scrollCellCoordsIntoView(Ke,Se?.scroll),!0},onRequestFocus:()=>me.CommonUtils.whenFocus(At.current)},wi);const ut=o.useRef(!1),Nt=o.useMemo(()=>{const X=me.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ct.current&&be?.(Ve)})},32),Se=(Ve,Ze)=>{ct.current=!0,wt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:0,rowEnd:xe.height,colStart:Ve,colEnd:Ve})))return;const st=Ge.getLayout(),it=Math.max(0,st.getColOffset(Ve)),lt=Ge.getBounds(),St=Math.min(lt.x+lt.width,st.getColOffset(Ve+1)),Dt=Ge.getAnchor();if(Ze!==null&&(Dt===me.AnchorLocation.Left||Dt===me.AnchorLocation.Center||Dt===me.AnchorLocation.Right)){const ro=me.CommonUtils.roundAccurately(Ze*me.CommonUtils.getDPI(),0),Mn=me.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ze/le),2).toFixed(2),lo="Width: "+(Ze?Mn+" ("+ro+" pixels)":"Hidden"),rn=Xn.current.getGridElement().getRelativePointFromClient(0,0),Gt=0-rn.y,Tn=0-rn.y+je,io=rn.x-lt.x;X({anchor:{x:it-io,y:Gt,width:St-it,height:Tn-Gt},display:lo})}const Bt=[0,0,0,lt.height],eo={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:h}},to={x:it-1,y:0,width:1,height:lt.height},no={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:h}},oo={x:St-1,y:0,width:1,height:lt.height};return c.jsxs(o.Fragment,{children:[c.jsx(ht.SVGLine,{linePoints:Bt,bounds:to,...eo}),c.jsx(ht.SVGLine,{linePoints:Bt,bounds:oo,...no})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ze,Ge)=>{Ke=n.beginCommit(Ge),ut.current=!1,Se(Ve,Ze)},onResizeHeaders:(Ve,Ze,Ge)=>{ut.current=!1,Se(Ve,Ze)},onResizeHeadersDown:(Ve,Ze)=>{ut.current=!0,setTimeout(()=>{ut.current&&Se(Ve,Ze)},360)},onResizeHeadersEnd:(Ve,Ze,Ge)=>{Ke?.commit({description:Ge}),Ke=null,ut.current=!1,requestAnimationFrame(()=>ze?.()),ct.current=!1,wt(null)},onResizeHeadersUp:Ve=>{ut.current=!1,requestAnimationFrame(()=>ze?.()),ct.current=!1,wt(null)},...m}},[n,m,je,yt]),nn=o.useMemo(()=>{const X=me.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ct.current&&he?.(Ve)})},32),Se=(Ve,Ze)=>{ct.current=!0,wt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:xe.width})))return;const st=Ge.getLayout(),it=Math.max(0,st.getRowOffset(Ve)),lt=Ge.getBounds(),St=Math.min(lt.y+lt.height,st.getRowOffset(Ve+1)),Dt=Ge.getAnchor();if(Ze!==null&&(Dt===me.AnchorLocation.Top||Dt===me.AnchorLocation.Center||Dt===me.AnchorLocation.Bottom)){const ro=Math.floor(10*me.CommonUtils.getDPI())/10,Mn=me.CommonUtils.roundAccurately(Ze*ro,0),lo=me.CommonUtils.roundAccurately(Mn/le/(n?.getRowHeaders().getScaleFactor()*me.CommonUtils.getDPI()),2).toFixed(2),rn="Height: "+(Ze?lo+" ("+Mn+" pixels)":"Hidden"),Gt=$t.current.getGridElement().getRelativePointFromClient(0,0),Tn=0-Gt.x,io=0-Gt.x+C,kl=Gt.y-lt.y;X({anchor:{x:Tn,y:it-kl,width:io-Tn,height:St-it},display:rn})}const Bt=[0,0,lt.width,0],eo={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:h}},to={x:0,y:it-1,width:lt.width,height:1},no={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:h}},oo={x:0,y:St-1,width:lt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(ht.SVGLine,{linePoints:Bt,bounds:to,...eo}),c.jsx(ht.SVGLine,{linePoints:Bt,bounds:oo,...no})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ze,Ge)=>{Ke=n.beginCommit(Ge),ut.current=!1,Se(Ve,Ze)},onResizeHeaders:(Ve,Ze,Ge)=>{ut.current=!1,Se(Ve,Ze)},onResizeHeadersDown:(Ve,Ze)=>{ut.current=!0,setTimeout(()=>{ut.current&&Se(Ve,Ze)},360)},onResizeHeadersEnd:(Ve,Ze,Ge)=>{Ke?.commit({description:Ge}),Ke=null,ut.current=!1,requestAnimationFrame(()=>ze?.()),ct.current=!1,wt(null)},onResizeHeadersUp:Ve=>{ut.current=!1,requestAnimationFrame(()=>ze?.()),ct.current=!1,wt(null)},...v}},[n,v,C]),At=r.useImperativeElement(t,()=>{const X=Ke=>{n?.getView()&&n.getView().selectMovables([]),Ne.current=null,U?.current?.focus(Ke)},Se=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ze=U.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ze)return!1;const Ge=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let st=ke.current?.get(Ge);return st?.current?(await st.current.focusMovable(Ke),!0):(Ne.current={movable:Ke,anchor:Ge},!0)};return{getGridElement:()=>U.current,getRowHeaderElement:()=>$t.current,getColumnHeaderElement:()=>Xn.current,rowHeaderHeight:()=>je,colHeaderWidth:()=>C,startEdit:Me,submitEdit:()=>{we.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{we.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:G!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&Se()||X(Ke)},focusSheet:X,focusMovable:Se,contains:Ke=>U?.current?.contains?.(Ke),invalidate:jt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),jt=o.useCallback(X=>{Pe.current||(U?.current?.invalidate(X),I?.())},[]);o.useEffect(()=>{jt()},[Re]);const wn=_e?ye.edgeStrokeFill:de.fill,ot=_e?Ie.fill:typeof Re.headerHover=="function"?Re.headerHover(de)?.fill:de.fill,bn=o.useMemo(()=>V?c.jsx("div",{className:dt("sheetxl-viewport-overlay",jl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:V}):c.jsx(c.Fragment,{}),[V]);let Wt=null;pe&&De&&(Wt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${je}px`,width:`${C}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:X=>{let Se=!X.ctrlKey;Ue?.getCommand("selectAll")?.execute(!Se||X.button!==0),X.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:X,clientX:X.clientX,clientY:X.clientY,rowIndex:-1,colIndex:-1}):U.current?.focus()},children:[c.jsx("div",{style:{height:je-5+"px",width:je-5+"px",clipPath:`path('M${je-5} 0 L0 ${je-5} L${je-5} ${je-5} L${je-5} 0 Z')`,borderRight:`2px solid ${wn}`,borderBottom:`2px solid ${wn}`,background:`${ot}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${je}px`,width:`${C}px`,boxSizing:"border-box",borderRight:`solid 1px ${de.strokeFill}`,borderBottom:`solid 1px ${de.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const on=r.useCallbackRef(({_left:X,_top:Se})=>{},[]),gt=r.useCallbackRef(X=>{if(!l)return;const Se=U.current.getViewFromClient(X.clientX,X.clientY)?.getCellCoordsFromClient(X.clientX,X.clientY);Se&&(l({originalEvent:X,clientX:X.clientX,clientY:X.clientY,rowIndex:Se.rowIndex,colIndex:Se.colIndex}),X.stopPropagation(),X.preventDefault())},[l]),bt=r.useCallbackRef(X=>{if(!(!X.shiftKey&&(X.ctrlKey||X.metaKey)))return;const{deltaY:Se}=X;return Se>0?Ue.getCommand("sheetZoomOut")?.execute():Se<0&&Ue.getCommand("sheetZoomIn")?.execute(),Se===0},[Ue]);o.useEffect(()=>{Rt(null),ft.current=null,ct.current=!1,wt(null);const X=n?.getView().getTopLeft();on(X),U.current?.scrollTo(X),fe(X),ge(n.getView()),ue(ne(n.getView().getFreezePanes())),A(Ae()),I()},[n?.getView()]);const xn=o.useCallback((X,Se)=>n.getRowHeaders().hiddenHeadersAt(X,Se),[n]),qn=o.useCallback((X,Se)=>n.getColumnHeaders().hiddenHeadersAt(X,Se),[n]),Ot=r.useCallbackRef(X=>{const Se=X.getVisibleRangeCoords();if(!Se)return null;const Ke=[];return n.getRange(Se).forEach((Ve,Ze)=>{const Ge=Ze.getCoords(),st=Ze.getCell();(it=>{if(it.isEmpty())return!1;const lt=it.getSpans();if(lt.width>1||lt.height>1||it.getStyle().hasVisibleStyling()||te.isShowFormulas()&&it.getFormula()!==null)return!0;const St=it.getValue();return St!==null&&!(!te.isShowZeros()&&St===0&&it.getType()===d.ScalarType.Number)})(st)&&Ke.push({coords:Ge,value:st,range:te.isShowFormulas()?null:st.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,te.isShowZeros(),te.isShowFormulas(),G]);o.useEffect(()=>{const X=[];z&&X.push(...z),yt&&X.push(...yt),me.CommonUtils.isEqualArrays(X,ft.current)||(ft.current=X,Rt(X))},[z,yt,Re]);const Sn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[Re?.header?.edgeStrokeFill]),Zn=r.useCallbackRef(X=>{X.isDefaultPrevented()||X.isPropagationStopped()||(Ne.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Rn=o.useMemo(()=>{const X=we.getMode();return X?.key==="cut"||X?.key==="copy"},[we]),kn=r.useCallbackRef(async X=>{const Se=we.getMode();return X.keyCode===r.KeyCodes.Escape&&Se?(X.preventDefault(),void we.setMode(null)):X.keyCode===r.KeyCodes.Enter&&Rn?(X.preventDefault(),await Ue?.getCommand("paste")?.execute(),void we.setMode(null)):void Ue?.dispatchToFocusedCommand(X)},[Ue,we]),$t=o.useRef(null),Cl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${je+1}px`,width:`${C+de.edgeStrokeWidth}px`,minWidth:`${C+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${je}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Yo,{ref:$t,sheetElement:At.current,gridRef:U,freezeStart:ae?.[me.AnchorLocation.Top],oppositeSize:C,containerWidth:C,containerHeight:ee,sheetHeader:n.getRowHeaders(),gridStyle:We,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:qt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${je+1}px`,width:`${C+de.edgeStrokeWidth}px`,minWidth:`${C+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${je}px)`,boxSizing:"border-box",zIndex:"2",...nn?.style},...nn})}),[C,je,ee,n,qt,ae?.[me.AnchorLocation.Top],Re,Ce,l,de.fill,v]),Xn=o.useRef(null),yl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${je+de.edgeStrokeWidth}px`,minHeight:`${je+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Yo,{ref:Xn,sheetElement:At.current,gridRef:U,freezeStart:ae?.[me.AnchorLocation.Left],oppositeSize:je,containerWidth:tt,containerHeight:je,sheetHeader:n.getColumnHeaders(),gridStyle:We,scrollPoint:Ct,onSheetContextMenu:l,...Nt,style:{...Nt?.style,position:"relative",left:"0px",width:"100%",height:`${je+de.edgeStrokeWidth}px`,minHeight:`${je+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[je,tt,n,Ct,ae?.[me.AnchorLocation.Left],Re,de.fill,Ce,l,m]),wl=r.useCallbackRef(X=>{const{value:Se,key:Ke,...Ve}=X;let Ze=Se,Ge=G;if(!Ge||Ge.colIndex===X.coords.colIndex&&Ge.rowIndex===X.coords.rowIndex||(Ge=null),!Ze){const lt=X.range;if(Ze=n.getRange({rowIndex:lt.rowStart,colIndex:lt.colStart}).getCell(),Ze.isEmpty())return null}let st=null;Ze.getHyperlink()&&(st=async lt=>{if(_?.onLinkMouseDown?.(lt),lt.button===0&&!lt.isDefaultPrevented()){lt.stopPropagation(),lt.preventDefault();try{await Ze.getHyperlink()?.open()}catch(St){at.showError?.(St)}}}),Ge&&Ge.colIndex===X.range.colStart&&Ge.rowIndex===X.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const it=n.getStyles();return o.createElement(Sr,{...Ve,key:Ke,bodyStyle:Y,docTheme:it.getTheme(),normalStyle:it.getNormal(),showFormulas:te.isShowFormulas(),showZeros:te.isShowZeros(),onLinkMouseDown:st,..._,value:Ze})},[n,Fe,Y,G,te?.isShowFormulas(),te.isShowZeros()]),bl=o.useCallback((X,Se)=>{const{key:Ke,...Ve}=X;return[c.jsx(Gl,{ref:Se,getVisibleCells:Ot,sheet:n,gridStyle:Re,...Ve},`border-${Ke}`),c.jsx(vi,{ref:Se,sheet:n,commands:Ue,...Ve},`table-${Ke}`),c.jsx(Ci,{ref:Se,sheet:n,...Ve},`spill-${Ke}`),c.jsx(si,{ref:Se,sheet:n,commands:Ue,onShowTooltip:re,onCloseTooltip:ze,gridStyle:Re,gridRef:U,editingCoords:G,isActive:Ce,...Ve},`selection-${Ke}`),c.jsx(ti,{ref:Se,sheet:n,commands:Ue,gridStyle:Re,element:w,...Ve},`copy-paste-${Ke}`),c.jsx(hi,{ref:Se,sheet:n,commands:Ue,target:He,renderMovable:W,movableProps:{onUnFocus:()=>{At.current.focus()}},...Ve},`movable-${Ke}`),c.jsx(mi,{ref:Se,sheet:n,commands:Ue,gridStyle:Re,getCellEditor:P,showProtectedError:Tt,setEditingCoords:qe,...Ve},`editor-${Ke}`)]},[n,U.current,Re,P,Ue,at]),[zo,xl]=o.useState(!1),ql=o.useMemo(()=>{if(tt===0||ee===0)return null;const X=n.getStyles().getNormal(),Se=X.getFont(),Ke=X.getFill(),Ve=X.getBorder(),Ze=X.getFill().getType()===d.IFill.Type.None;let Ge=ie,st=ie;const it=(St,Dt,Bt)=>Bt?{stroke:Ve.getBottom().isNone()?"none":St.getColor().toRGBA(Y.darkMode).toString(),...Dt}:Dt;st=it(Ve.getBottom(),st,!Ve.getBottom().isNone()),st=it(Ve.getTop(),st,!Ve.getTop().isNone()),Ge=it(Ve.getRight(),Ge,!Ve.getRight().isNone()),Ge=it(Ve.getLeft(),Ge,!Ve.getLeft().isNone());let lt=te?.getGridLineColor()?.toRGBA(Y.darkMode).toString()??Y.strokeFill;return Ze||(st=it(Ve.getBottom(),st,!0),st=it(Ve.getTop(),st,!0),Ge=it(Ve.getRight(),Ge,!0),Ge=it(Ve.getLeft(),Ge,!0)),c.jsx(ht.Grid,{className:"sheetxl-sheet-primary",style:{...yi,...Ke.toCSS(Y.darkMode),...Se.toCSS(Y.darkMode,le),"--sxl-app-color-background":Y.fill,"--sxl-app-color-shadow":Re.colorShadow,"--sxl-app-color-grey":Re.colorGrey,"--sxl-app-color-button-fill":Z.fill,"--sxl-app-color-button-text":Z.text?.fill,"--sxl-app-color-button-border":Z.edgeStrokeFill,"--sxl-app-color-primary-dark":Re.selection.strokeFill},ref:U,zoom:le,...ce,onFirstRender:St=>{xl(!0),ce?.onFirstRender?.(St),Ue?.activate()},showGridLines:Ee,gridLineColor:lt,gridLineColumnsProps:Ge,gridLineRowsProps:st,freezeLeft:ae?.[me.AnchorLocation.Left],freezeLeftProps:Sn,freezeTop:ae?.[me.AnchorLocation.Top],freezeTopProps:Sn,width:tt,height:ee,columnCount:xe.width,rowCount:xe.height,cursor:kt??Xe??"cell",clipCells:!0,layout:Fe,cellRenderer:wl,overlayRenderer:bl,getCellCoordsAsRangeCoords:se,hiddenRowsAt:xn,hiddenColumnsAt:qn,getVisibleCells:Ot,onWheelScroll:bt,onPointerDown:Zn,onKeyDown:kn,onViewportChange:S,onImmediateScroll:on,scrollPoint:oe,stageProps:{onFocus:()=>{Ue?.activate()}},overlays:rt})},[L]);o.useEffect(()=>{Pe.current||I()},[Fe,ae,le,Ue,oe?.left,oe?.top,Y,ce,tt,ee,kt,rt,Ce,Xe]);let Yn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};b||(Yn={...Yn,...M});const Sl=o.useMemo(()=>{const X=n.getStyles().getTheme(),Se=X.getColorScheme(),Ke=X.getFontScheme();return{"--sxl-doc-color-dk1":Se.getDk1().toCSS(Y.darkMode),"--sxl-doc-color-dk2":Se.getDk2().toCSS(Y.darkMode),"--sxl-doc-color-lt1":Se.getLt1().toCSS(Y.darkMode),"--sxl-doc-color-lt2":Se.getLt2().toCSS(Y.darkMode),"--sxl-doc-color-accent1":Se.getAccent1().toCSS(Y.darkMode),"--sxl-doc-color-accent2":Se.getAccent2().toCSS(Y.darkMode),"--sxl-doc-color-accent3":Se.getAccent3().toCSS(Y.darkMode),"--sxl-doc-color-accent4":Se.getAccent4().toCSS(Y.darkMode),"--sxl-doc-color-accent5":Se.getAccent5().toCSS(Y.darkMode),"--sxl-doc-color-accent6":Se.getAccent6().toCSS(Y.darkMode),"--sxl-doc-color-hlink":Se.getHlink().toCSS(Y.darkMode),"--sxl-doc-color-fol-hlink":Se.getFolHlink().toCSS(Y.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),No=r.useCallbackRef(X=>{const{style:Se,...Ke}=X;return c.jsx(Ro,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...Se},sheet:n})},[n]);let Jn=c.jsx("div",{style:Yn,onTouchStart:()=>{Lo()},onFocus:X=>{j(!0),p?.(X)},onBlur:X=>{j(!1),F?.(X)},ref:At,...K,children:c.jsx("div",{className:dt("sheetxl-sheet",Pl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Sl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Wt,Cl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[yl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,backgroundColor:Y.fill},ref:q,onContextMenu:gt,children:[ql,bn,c.jsx(Ol,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Re?.selection?.strokeFill,colorCredits:Re?.body?.text?.fill})]})]})]})})});b&&(Jn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${de.fill}`,minHeight:2*Be.height,minWidth:2*Be.width,...M},viewport:T,touchElement:U.current?.stage,disableTouch:Le,onScrollViewport:X=>{U.current?.scrollTo(X)},createHorizontalScrollbar:No,createVerticalScrollbar:No,...y,children:Jn})),o.useEffect(()=>{Pe.current=!1,I?.(),J&&At.current?.focus()},[n]);const[Qn,Rl]=o.useState(!1),Lo=r.useCallbackRef(()=>{Qn||Rl(!0)},[Qn]);return o.useEffect(()=>{if(zo)return typeof R=="function"&&R(),r.ReactUtils.detectIt().primaryInput==="touch"&&Lo(),()=>{}},[R,zo,Qn]),Jn}));Or.displayName="SheetElement";const nr="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=",Br=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:m,view:s,onHide:v,onShow:b,onKeyDownCapture:y,onFocus:g,onBlur:k,loadingPanel:x,...E}=e,[z,W]=o.useState(!1),[V,R]=o.useState(null),[P,p]=o.useState(null),[F,M]=o.useState(null);o.useEffect(()=>{p(null),l.getDetails().then(B=>{W(!1),p(B.asUrl()),B.asSVGText?.()&&M(B.asSVGText())}).catch(B=>{console.warn(B),W(!0),p(nr),M(null)})},[l]);const H=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),N=o.useMemo(()=>{if(P||F)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:z?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:z?"var(--sxl-app-color-background, white)":void 0,boxShadow:z?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:z?"contain":void 0,opacity:V?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:P,onLoad:()=>{R(!0)},onError:({currentTarget:B})=>{console.log("error"),B.onerror=null,p(nr),W(!0)},alt:f??`${l.getType()}`})},[V,l,P,F,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,...E,onKeyDownCapture:B=>{y?.(B)},ref:H,children:[V||z?void 0:x,N]})}));Br.displayName="PictureEditor";const bi=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:m,onShow:s,...v}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:g,width:k}]=Vt();if(!a.isClosed())return c.jsx("div",{...v,ref:Qt([b,y]),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:f?"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()})})})})),xi="_editable-input_1bqx6_6",qi=e=>c.jsx("input",{...e}),Hr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:m,createInput:s=qi,styleHover:v={},dragging:b,maxLength:y,disabled:g=!1,readOnly:k=!1,...x}=e,[E,z]=o.useState(!1),[W,V]=o.useState(!1),[R,P]=o.useState(a);o.useEffect(()=>{P(a)},[a]);const p=o.useRef(null),[F,M]=o.useState(null),H=r.useNotifier(),N=o.useCallback(function(I){const q=I.message;F!==q&&(H?.showMessage?.(q,{type:r.NotifierType.Error}),M(q))},[H,F]),B=o.useCallback(I=>{let q=!1;try{q=l?.(I)??!0}catch(O){N(O)}return q?(p.current=null,V(!1),P(I),q):(setTimeout(()=>{p.current?.focus()},0),q)},[l]),$=r.useCallbackRef(()=>{P(a),p.current=null,V(!1),m?.()},[m,a]),ce=o.useMemo(()=>{if(!W)return null;const I={className:dt(xi),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:R,onFocus:q=>{p.current||(p.current=q.target,setTimeout(()=>{q.target?.select()},0))},onBlur:q=>{p.current&&B(R)},onChange:q=>{W&&P(q.target.value)},onMouseDown:q=>q.stopPropagation(),onKeyDown:q=>q.code==="Escape"?(q.preventDefault(),void $()):q.code==="Enter"?(q.preventDefault(),void B(q.target.value)):void(q.code!=="Tab"?q.stopPropagation():B(q.target.value))};return c.jsx(c.Fragment,{children:s(I)})},[W,R,B,$,s,g]),[_,K]=o.useState();o.useLayoutEffect(()=>{let I=Object.assign({},n);(b||E)&&(I=Object.assign(I,v)),K(I)},[b,E,v,n]),o.useEffect(()=>{ce&&f?.(R)},[ce,f,R]);const L=r.useImperativeElement(t,()=>({startEdit(){g||k||V(!0)},cancel(){$()}}),[]);return c.jsxs("div",{...x,ref:L,style:{flexDirection:"column",display:"flex",..._},className:dt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{g||k||V(!0)},onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:W?0:1},children:R}),ce]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...v},children:R})]})})),Kn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function en(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ko(e){return"nodeType"in e}function xt(e){var t,n;return e?en(e)?e:ko(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Mo(e){const{Document:t}=xt(e);return e instanceof t}function vn(e){return!en(e)&&e instanceof xt(e).HTMLElement}function Vr(e){return e instanceof xt(e).SVGElement}function Jt(e){return e?en(e)?e.document:ko(e)?Mo(e)?e:vn(e)||Vr(e)?e.ownerDocument:document:document:document}const Et=Kn?o.useLayoutEffect:o.useEffect;function Wn(e){const t=o.useRef(e);return Et(()=>{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 mn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Et(()=>{n.current!==e&&(n.current=e)},t),n}function dn(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Pn(e){const t=Wn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function jn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let co={};function Cn(e,t){return o.useMemo(()=>{if(t)return t;const n=co[e]==null?0:co[e]+1;return co[e]=n,e+"-"+n},[e,t])}function Ur(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,f)=>{const m=Object.entries(f);for(const[s,v]of m){const b=l[s];b!=null&&(l[s]=b+e*v)}return l},{...t})}}const Xt=Ur(1),fn=Ur(-1);function $n(e){if(!e)return!1;const{KeyboardEvent:t}=xt(e.target);return t&&e instanceof t}function On(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=xt(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 Ut=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[Ut.Translate.toString(e),Ut.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),or="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(or)?e:e.querySelector(or)}const Ri={display:"none"};function ki(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:Ri},n)}function Mi(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 Kr=o.createContext(null),Ti={draggable:`
|
|
24
24
|
To pick up a draggable item, press the space bar.
|
|
25
25
|
While dragging, use the arrow keys to move the item.
|
|
26
26
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
27
|
-
`},zi={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 Ni(e){let{announcements:t=zi,container:n,hiddenTextDescribedById:l,screenReaderInstructions:a=Di}=e;const{announce:i,announcement:f}=(function(){const[y,g]=o.useState("");return{announce:o.useCallback(k=>{k!=null&&g(k)},[]),announcement:y}})(),m=yn("DndLiveRegion"),[s,v]=o.useState(!1);if(o.useEffect(()=>{v(!0)},[]),(function(y){const g=o.useContext(_r);o.useEffect(()=>{if(!g)throw new Error("useDndMonitor must be used within a children of <DndContext>");return g(y)},[y,g])})(o.useMemo(()=>({onDragStart(y){let{active:g}=y;i(t.onDragStart({active:g}))},onDragMove(y){let{active:g,over:k}=y;t.onDragMove&&i(t.onDragMove({active:g,over:k}))},onDragOver(y){let{active:g,over:k}=y;i(t.onDragOver({active:g,over:k}))},onDragEnd(y){let{active:g,over:k}=y;i(t.onDragEnd({active:g,over:k}))},onDragCancel(y){let{active:g,over:k}=y;i(t.onDragCancel({active:g,over:k}))}}),[i,t])),!s)return null;const b=o.createElement(o.Fragment,null,o.createElement(Fi,{id:l,value:a.draggable}),o.createElement(Ai,{id:m,announcement:f}));return n?Ht.createPortal(b,n):b}var gt;function Hn(){}function go(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"})(gt||(gt={}));const Et=Object.freeze({x:0,y:0});function Gr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Li(e,t){const n=Bn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Zr(e,t){let{data:{value:n}}=e,{data:{value:l}}=t;return n-l}function Pi(e,t){let{data:{value:n}}=e,{data:{value:l}}=t;return l-n}function ir(e){let{left:t,top:n,height:l,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+l},{x:t+a,y:n+l}]}function Xr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function ar(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 ji=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:l}=e;const a=ar(t,t.left,t.top),i=[];for(const f of l){const{id:m}=f,s=n.get(m);if(s){const v=Gr(ar(s),a);i.push({id:m,data:{droppableContainer:f,value:v}})}}return i.sort(Zr)};function Oi(e,t){const n=Math.max(t.top,e.top),l=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),f=a-l,m=i-n;if(l<a&&n<i){const s=t.width*t.height,v=e.width*e.height,b=f*m;return Number((b/(s+v-b)).toFixed(4))}return 0}const Bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:l}=e;const a=[];for(const i of l){const{id:f}=i,m=n.get(f);if(m){const s=Oi(m,t);s>0&&a.push({id:f,data:{droppableContainer:i,value:s}})}}return a.sort(Pi)};function sr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Et}function Hi(e){return function(t){for(var n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];return l.reduce((i,f)=>({...i,top:i.top+e*f.y,bottom:i.bottom+e*f.y,left:i.left+e*f.x,right:i.right+e*f.x}),{...t})}}const Vi=Hi(1);function Yr(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 Ui={ignoreTransform:!1};function tn(e,t){t===void 0&&(t=Ui);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:v,transformOrigin:b}=yt(e).getComputedStyle(e);v&&(n=(function(y,g,k){const x=Yr(g);if(!x)return y;const{scaleX:E,scaleY:z,x:$,y:V}=x,R=y.left-$-(1-E)*parseFloat(k),P=y.top-V-(1-z)*parseFloat(k.slice(k.indexOf(" ")+1)),p=E?y.width/E:y.width,F=z?y.height/z:y.height;return{width:p,height:F,top:P,right:R+p,bottom:P+F,left:R}})(n,v,b))}const{top:l,left:a,width:i,height:f,bottom:m,right:s}=n;return{top:l,left:a,width:i,height:f,bottom:m,right:s}}function cr(e){return tn(e,{ignoreTransform:!0})}function Gn(e,t){const n=[];return e?(function l(a){if(t!=null&&n.length>=t||!a)return n;if(Io(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!Cn(a)||$r(a)||n.includes(a))return n;const i=yt(e).getComputedStyle(a);return a!==e&&(function(f,m){m===void 0&&(m=yt(f).getComputedStyle(f));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(v=>{const b=m[v];return typeof b=="string"&&s.test(b)})})(a,i)&&n.push(a),(function(f,m){return m===void 0&&(m=yt(f).getComputedStyle(f)),m.position==="fixed"})(a,i)?n:l(a.parentNode)})(e):n}function Jr(e){const[t]=Gn(e,1);return t??null}function ho(e){return $n&&e?en(e)?e:To(e)?Io(e)||e===Jt(e).scrollingElement?window:Cn(e)?e:null:null:null}function Qr(e){return en(e)?e.scrollX:e.scrollLeft}function el(e){return en(e)?e.scrollY:e.scrollTop}function Co(e){return{x:Qr(e),y:el(e)}}var mt;function tl(e){return!(!$n||!e)&&e===document.scrollingElement}function nl(e){const t={x:0,y:0},n=tl(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},l={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=l.y,isRight:e.scrollLeft>=l.x,maxScroll:l,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mt||(mt={}));const Ki={x:.2,y:.2};function $i(e,t,n,l,a){let{top:i,left:f,right:m,bottom:s}=n;l===void 0&&(l=10),a===void 0&&(a=Ki);const{isTop:v,isBottom:b,isLeft:y,isRight:g}=nl(e),k={x:0,y:0},x={x:0,y:0},E=t.height*a.y,z=t.width*a.x;return!v&&i<=t.top+E?(k.y=mt.Backward,x.y=l*Math.abs((t.top+E-i)/E)):!b&&s>=t.bottom-E&&(k.y=mt.Forward,x.y=l*Math.abs((t.bottom-E-s)/E)),!g&&m>=t.right-z?(k.x=mt.Forward,x.x=l*Math.abs((t.right-z-m)/z)):!y&&f<=t.left+z&&(k.x=mt.Backward,x.x=l*Math.abs((t.left+z-f)/z)),{direction:k,speed:x}}function Wi(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:f}=window;return{top:0,left:0,right:i,bottom:f,width:i,height:f}}const{top:t,left:n,right:l,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:l,bottom:a,width:e.clientWidth,height:e.clientHeight}}function ol(e){return e.reduce((t,n)=>Xt(t,Co(n)),Et)}function rl(e,t){if(t===void 0&&(t=tn),!e)return;const{top:n,left:l,bottom:a,right:i}=t(e);Jr(e)&&(a<=0||i<=0||n>=window.innerHeight||l>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _i=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Qr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+el(n),0)}]];class yo{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 l=Gn(n),a=ol(l);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,f,m]of _i)for(const s of f)Object.defineProperty(this,s,{get:()=>{const v=m(l),b=a[i]-v;return this.rect[s]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class un{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var l;return(l=this.target)==null?void 0:l.removeEventListener(...n)})},this.target=t}add(t,n,l){var a;(a=this.target)==null||a.addEventListener(t,n,l),this.listeners.push([t,n,l])}}function mo(e,t){const n=Math.abs(e.x),l=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+l**2)>t:"x"in t&&"y"in t?n>t.x&&l>t.y:"x"in t?n>t.x:"y"in t&&l>t.y}var Rt,et;function dr(e){e.preventDefault()}function Gi(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"})(Rt||(Rt={})),(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"})(et||(et={}));const ll={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},Zi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case et.Right:return{...n,x:n.x+25};case et.Left:return{...n,x:n.x-25};case et.Down:return{...n,y:n.y+25};case et.Up:return{...n,y:n.y-25}}};class Eo{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 un(Jt(n)),this.windowListeners=new un(yt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Rt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,l=t.node.current;l&&rl(l),n(Et)}handleKeyDown(t){if(_n(t)){const{active:n,context:l,options:a}=this.props,{keyboardCodes:i=ll,coordinateGetter:f=Zi,scrollBehavior:m="smooth"}=a,{code:s}=t;if(i.end.includes(s))return void this.handleEnd(t);if(i.cancel.includes(s))return void this.handleCancel(t);const{collisionRect:v}=l.current,b=v?{x:v.left,y:v.top}:Et;this.referenceCoordinates||(this.referenceCoordinates=b);const y=f(t,{active:n,context:l.current,currentCoordinates:b});if(y){const g=pn(y,b),k={x:0,y:0},{scrollableAncestors:x}=l.current;for(const E of x){const z=t.code,{isTop:$,isRight:V,isLeft:R,isBottom:P,maxScroll:p,minScroll:F}=nl(E),M=Wi(E),H={x:Math.min(z===et.Right?M.right-M.width/2:M.right,Math.max(z===et.Right?M.left:M.left+M.width/2,y.x)),y:Math.min(z===et.Down?M.bottom-M.height/2:M.bottom,Math.max(z===et.Down?M.top:M.top+M.height/2,y.y))},N=z===et.Right&&!V||z===et.Left&&!R,B=z===et.Down&&!P||z===et.Up&&!$;if(N&&H.x!==y.x){const W=E.scrollLeft+g.x,ce=z===et.Right&&W<=p.x||z===et.Left&&W>=F.x;if(ce&&!g.y)return void E.scrollTo({left:W,behavior:m});k.x=ce?E.scrollLeft-W:z===et.Right?E.scrollLeft-p.x:E.scrollLeft-F.x,k.x&&E.scrollBy({left:-k.x,behavior:m});break}if(B&&H.y!==y.y){const W=E.scrollTop+g.y,ce=z===et.Down&&W<=p.y||z===et.Up&&W>=F.y;if(ce&&!g.x)return void E.scrollTo({top:W,behavior:m});k.y=ce?E.scrollTop-W:z===et.Down?E.scrollTop-p.y:E.scrollTop-F.y,k.y&&E.scrollBy({top:-k.y,behavior:m});break}}this.handleMove(t,Xt(pn(y,this.referenceCoordinates),k))}}}handleMove(t,n){const{onMove:l}=this.props;t.preventDefault(),l(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 ur(e){return!!(e&&"distance"in e)}function gr(e){return!!(e&&"delay"in e)}Eo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:l=ll,onActivation:a}=t,{active:i}=n;const{code:f}=e.nativeEvent;if(l.start.includes(f)){const m=i.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Fo{constructor(t,n,l){var a;l===void 0&&(l=(function(m){const{EventTarget:s}=yt(m);return m instanceof s?m:Jt(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:i}=t,{target:f}=i;this.props=t,this.events=n,this.document=Jt(f),this.documentListeners=new un(this.document),this.listeners=new un(l),this.windowListeners=new un(yt(f)),this.initialCoordinates=(a=Bn(i))!=null?a:Et,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:l}}}=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(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.DragStart,dr),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),this.windowListeners.add(Rt.ContextMenu,dr),this.documentListeners.add(Rt.Keydown,this.handleKeydown),n){if(l!=null&&l({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(ur(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:l,onPending:a}=this.props;a(l,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Rt.Click,Gi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Rt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:l,initialCoordinates:a,props:i}=this,{onMove:f,options:{activationConstraint:m}}=i;if(!a)return;const s=(n=Bn(t))!=null?n:Et,v=pn(a,s);if(!l&&m){if(ur(m)){if(m.tolerance!=null&&mo(v,m.tolerance))return this.handleCancel();if(mo(v,m.distance))return this.handleStart()}return gr(m)&&mo(v,m.tolerance)?this.handleCancel():void this.handlePending(m,v)}t.cancelable&&t.preventDefault(),f(s)}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===et.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Xi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class il extends Fo{constructor(t){const{event:n}=t,l=Jt(n.target);super(t,Xi,l)}}il.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;return!(!n.isPrimary||n.button!==0)&&(l?.({event:n}),!0)}}];const Yi={move:{name:"mousemove"},end:{name:"mouseup"}};var wo;(function(e){e[e.RightClick=2]="RightClick"})(wo||(wo={}));class al extends Fo{constructor(t){super(t,Yi,Jt(t.event.target))}}al.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;return n.button!==wo.RightClick&&(l?.({event:n}),!0)}}];const fo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class sl extends Fo{constructor(t){super(t,fo)}static setup(){return window.addEventListener(fo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(fo.move.name,t)};function t(){}}}var gn,Vn;function Ji(e){let{acceleration:t,activator:n=gn.Pointer,canScroll:l,draggingRect:a,enabled:i,interval:f=5,order:m=Vn.TreeOrder,pointerCoordinates:s,scrollableAncestors:v,scrollableAncestorRects:b,delta:y,threshold:g}=e;const k=(function(F){let{delta:M,disabled:H}=F;const N=On(M);return dn(B=>{if(H||!N||!B)return Qi;const W={x:Math.sign(M.x-N.x),y:Math.sign(M.y-N.y)};return{x:{[mt.Backward]:B.x[mt.Backward]||W.x===-1,[mt.Forward]:B.x[mt.Forward]||W.x===1},y:{[mt.Backward]:B.y[mt.Backward]||W.y===-1,[mt.Forward]:B.y[mt.Forward]||W.y===1}}},[H,M,N])})({delta:y,disabled:!i}),[x,E]=(function(){const F=o.useRef(null);return[o.useCallback((M,H)=>{F.current=setInterval(M,H)},[]),o.useCallback(()=>{F.current!==null&&(clearInterval(F.current),F.current=null)},[])]})(),z=o.useRef({x:0,y:0}),$=o.useRef({x:0,y:0}),V=o.useMemo(()=>{switch(n){case gn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case gn.DraggableRect:return a}},[n,a,s]),R=o.useRef(null),P=o.useCallback(()=>{const F=R.current;if(!F)return;const M=z.current.x*$.current.x,H=z.current.y*$.current.y;F.scrollBy(M,H)},[]),p=o.useMemo(()=>m===Vn.TreeOrder?[...v].reverse():v,[m,v]);o.useEffect(()=>{if(i&&v.length&&V){for(const F of p){if(l?.(F)===!1)continue;const M=v.indexOf(F),H=b[M];if(!H)continue;const{direction:N,speed:B}=$i(F,H,V,t,g);for(const W of["x","y"])k[W][N[W]]||(B[W]=0,N[W]=0);if(B.x>0||B.y>0)return E(),R.current=F,x(P,f),z.current=B,void($.current=N)}z.current={x:0,y:0},$.current={x:0,y:0},E()}else E()},[t,P,l,E,i,f,JSON.stringify(V),JSON.stringify(k),x,v,p,b,JSON.stringify(g)])}sl.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;const{touches:a}=n;return!(a.length>1)&&(l?.({event:n}),!0)}}],(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(gn||(gn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Vn||(Vn={}));const Qi={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var vn,bo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vn||(vn={})),(function(e){e.Optimized="optimized"})(bo||(bo={}));const hr=new Map;function xo(e,t){return dn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Un(e){let{callback:t,disabled:n}=e;const l=Wn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(l)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function ea(e){return new yo(tn(e),e)}function mr(e,t,n){t===void 0&&(t=ea);const[l,a]=o.useState(null);function i(){a(s=>{if(!e)return null;var v;if(e.isConnected===!1)return(v=s??n)!=null?v:null;const b=t(e);return JSON.stringify(s)===JSON.stringify(b)?s:b})}const f=(function(s){let{callback:v,disabled:b}=s;const y=Wn(v),g=o.useMemo(()=>{if(b||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:k}=window;return new k(y)},[y,b]);return o.useEffect(()=>()=>g?.disconnect(),[g]),g})({callback(s){if(e)for(const v of s){const{type:b,target:y}=v;if(b==="childList"&&y instanceof HTMLElement&&y.contains(e)){i();break}}}}),m=Un({callback:i});return It(()=>{i(),e?(m?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),f?.disconnect())},[e]),l}const fr=[];function pr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const l=e!==Et;l&&!n.current&&(n.current=e),!l&&n.current&&(n.current=null)},[e]),n.current?pn(e,n.current):Et}function vr(e){return o.useMemo(()=>e?(function(t){const n=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}})(e):null,[e])}const Cr=[];function cl(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Cn(t)?t:e}const ta=[{sensor:il,options:{}},{sensor:Eo,options:{}}],na={current:{}},zn={draggable:{measure:cr},droppable:{measure:cr,strategy:vn.WhileDragging,frequency:bo.Optimized},dragOverlay:{measure:tn}};class hn 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,l;return(n=(l=this.get(t))==null?void 0:l.node.current)!=null?n:void 0}}const oa={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Hn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:zn,measureDroppableContainers:Hn,windowRect:null,measuringScheduled:!1},dl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Hn,draggableNodes:new Map,over:null,measureDroppableContainers:Hn},wn=o.createContext(dl),ul=o.createContext(oa);function ra(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hn}}}function la(e,t){switch(t.type){case gt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gt.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 gt.DragEnd:case gt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gt.RegisterDroppable:{const{element:n}=t,{id:l}=n,a=new hn(e.droppable.containers);return a.set(l,n),{...e,droppable:{...e.droppable,containers:a}}}case gt.SetDroppableDisabled:{const{id:n,key:l,disabled:a}=t,i=e.droppable.containers.get(n);if(!i||l!==i.key)return e;const f=new hn(e.droppable.containers);return f.set(n,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case gt.UnregisterDroppable:{const{id:n,key:l}=t,a=e.droppable.containers.get(n);if(!a||l!==a.key)return e;const i=new hn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ia(e){let{disabled:t}=e;const{active:n,activatorEvent:l,draggableNodes:a}=o.useContext(wn),i=On(l),f=On(n?.id);return o.useEffect(()=>{if(!t&&!l&&i&&f!=null){if(!_n(i)||document.activeElement===i.target)return;const m=a.get(f);if(!m)return;const{activatorNode:s,node:v}=m;if(!s.current&&!v.current)return;requestAnimationFrame(()=>{for(const b of[s.current,v.current]){if(!b)continue;const y=Ii(b);if(y){y.focus();break}}})}},[l,t,a,f,i]),null}function gl(e,t){let{transform:n,...l}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...l}),n):n}const Zn=o.createContext({...Et,scaleX:1,scaleY:1});var Pt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pt||(Pt={}));const aa=o.memo(function(e){var t,n,l,a;let{id:i,accessibility:f,autoScroll:m=!0,children:s,sensors:v=ta,collisionDetection:b=Bi,measuring:y,modifiers:g,...k}=e;const x=o.useReducer(la,void 0,ra),[E,z]=x,[$,V]=(function(){const[u]=o.useState(()=>new Set),S=o.useCallback(D=>(u.add(D),()=>u.delete(D)),[u]);return[o.useCallback(D=>{let{type:oe,event:fe}=D;u.forEach(se=>{var ne;return(ne=se[oe])==null?void 0:ne.call(se,fe)})},[u]),S]})(),[R,P]=o.useState(Pt.Uninitialized),p=R===Pt.Initialized,{draggable:{active:F,nodes:M,translate:H},droppable:{containers:N}}=E,B=F!=null?M.get(F):null,W=o.useRef({initial:null,translated:null}),ce=o.useMemo(()=>{var u;return F!=null?{id:F,data:(u=B?.data)!=null?u:na,rect:W}:null},[F,B]),G=o.useRef(null),[K,L]=o.useState(null),[I,q]=o.useState(null),O=fn(k,Object.values(k)),Q=yn("DndDescribedBy",i),re=o.useMemo(()=>N.getEnabled(),[N]),be=(me=y,o.useMemo(()=>({draggable:{...zn.draggable,...me?.draggable},droppable:{...zn.droppable,...me?.droppable},dragOverlay:{...zn.dragOverlay,...me?.dragOverlay}}),[me?.draggable,me?.droppable,me?.dragOverlay]));var me;const{droppableRects:ze,measureDroppableContainers:Pe,measuringScheduled:ve}=(function(u,S){let{dragging:D,dependencies:oe,config:fe}=S;const[se,ne]=o.useState(null),{frequency:ae,measure:ue,strategy:Ce}=fe,Oe=o.useRef(u),Me=(function(){switch(Ce){case vn.Always:return!1;case vn.BeforeDragging:return D;default:return!D}})(),Te=fn(Me),$e=o.useCallback(function(Ye){Ye===void 0&&(Ye=[]),Te.current||ne(Je=>Je===null?Ye:Je.concat(Ye.filter(Ne=>!Je.includes(Ne))))},[Te]),We=o.useRef(null),_e=dn(Ye=>{if(Me&&!D)return hr;if(!Ye||Ye===hr||Oe.current!==u||se!=null){const Je=new Map;for(let Ne of u){if(!Ne)continue;if(se&&se.length>0&&!se.includes(Ne.id)&&Ne.rect.current){Je.set(Ne.id,Ne.rect.current);continue}const Qe=Ne.node.current,ht=Qe?new yo(ue(Qe),Qe):null;Ne.rect.current=ht,ht&&Je.set(Ne.id,ht)}return Je}return Ye},[u,se,D,Me,ue]);return o.useEffect(()=>{Oe.current=u},[u]),o.useEffect(()=>{Me||$e()},[D,Me]),o.useEffect(()=>{se&&se.length>0&&ne(null)},[JSON.stringify(se)]),o.useEffect(()=>{Me||typeof ae!="number"||We.current!==null||(We.current=setTimeout(()=>{$e(),We.current=null},ae))},[ae,Me,$e,...oe]),{droppableRects:_e,measureDroppableContainers:$e,measuringScheduled:se!=null}})(re,{dragging:p,dependencies:[H.x,H.y],config:be.droppable}),Re=(function(u,S){const D=S!=null?u.get(S):void 0,oe=D?D.node.current:null;return dn(fe=>{var se;return S==null?null:(se=oe??fe)!=null?se:null},[oe,S])})(M,F),Ke=o.useMemo(()=>I?Bn(I):null,[I]),Y=(function(){const u=K?.autoScrollEnabled===!1,S=typeof m=="object"?m.enabled===!1:m===!1,D=p&&!u&&!S;return typeof m=="object"?{...m,enabled:D}:{enabled:D}})(),Z=(function(u,S){return xo(u,S)})(Re,be.draggable.measure);(function(u){let{activeNode:S,measure:D,initialRect:oe,config:fe=!0}=u;const se=o.useRef(!1),{x:ne,y:ae}=typeof fe=="boolean"?{x:fe,y:fe}:fe;It(()=>{if(!ne&&!ae||!S)return void(se.current=!1);if(se.current||!oe)return;const ue=S?.node.current;if(!ue||ue.isConnected===!1)return;const Ce=sr(D(ue),oe);if(ne||(Ce.x=0),ae||(Ce.y=0),se.current=!0,Math.abs(Ce.x)>0||Math.abs(Ce.y)>0){const Oe=Jr(ue);Oe&&Oe.scrollBy({top:Ce.y,left:Ce.x})}},[S,ne,ae,oe,D])})({activeNode:F!=null?M.get(F):null,config:Y.layoutShiftCompensation,initialRect:Z,measure:be.draggable.measure});const de=mr(Re,be.draggable.measure,Z),Ie=mr(Re?Re.parentElement:null),we=o.useRef({activatorEvent:null,active:null,activeNode:Re,collisionRect:null,collisions:null,droppableRects:ze,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=N.getNodeFor((t=we.current.over)==null?void 0:t.id),ee=(function(u){let{measure:S}=u;const[D,oe]=o.useState(null),fe=Un({callback:o.useCallback(ue=>{for(const{target:Ce}of ue)if(Cn(Ce)){oe(Oe=>{const Me=S(Ce);return Oe?{...Oe,width:Me.width,height:Me.height}:Me});break}},[S])}),se=o.useCallback(ue=>{const Ce=cl(ue);fe?.disconnect(),Ce&&fe?.observe(Ce),oe(Ce?S(Ce):null)},[S,fe]),[ne,ae]=jn(se);return o.useMemo(()=>({nodeRef:ne,rect:D,setRef:ae}),[D,ne,ae])})({measure:be.dragOverlay.measure}),ge=(n=ee.nodeRef.current)!=null?n:Re,le=p?(l=ee.rect)!=null?l:de:null,Ee=!!(ee.nodeRef.current&&ee.rect),ie=sr(pe=Ee?null:de,xo(pe));var pe;const De=vr(ge?yt(ge):null),xe=(function(u){const S=o.useRef(u),D=dn(oe=>u?oe&&oe!==fr&&u&&S.current&&u.parentNode===S.current.parentNode?oe:Gn(u):fr,[u]);return o.useEffect(()=>{S.current=u},[u]),D})(p?U??Re:null),Be=(function(u,S){S===void 0&&(S=tn);const[D]=u,oe=vr(D?yt(D):null),[fe,se]=o.useState(Cr);function ne(){se(()=>u.length?u.map(ue=>tl(ue)?oe:new yo(S(ue),ue)):Cr)}const ae=Un({callback:ne});return It(()=>{ae?.disconnect(),ne(),u.forEach(ue=>ae?.observe(ue))},[u]),fe})(xe),He=gl(g,{transform:{x:H.x-ie.x,y:H.y-ie.y,scaleX:1,scaleY:1},activatorEvent:I,active:ce,activeNodeRect:de,containerNodeRect:Ie,draggingNodeRect:le,over:we.current.over,overlayNodeRect:ee.rect,scrollableAncestors:xe,scrollableAncestorRects:Be,windowRect:De}),C=Ke?Xt(Ke,H):null,je=(function(u){const[S,D]=o.useState(null),oe=o.useRef(u),fe=o.useCallback(se=>{const ne=ho(se.target);ne&&D(ae=>ae?(ae.set(ne,Co(ne)),new Map(ae)):null)},[]);return o.useEffect(()=>{const se=oe.current;if(u!==se){ne(se);const ae=u.map(ue=>{const Ce=ho(ue);return Ce?(Ce.addEventListener("scroll",fe,{passive:!0}),[Ce,Co(Ce)]):null}).filter(ue=>ue!=null);D(ae.length?new Map(ae):null),oe.current=u}return()=>{ne(u),ne(se)};function ne(ae){ae.forEach(ue=>{const Ce=ho(ue);Ce?.removeEventListener("scroll",fe)})}},[fe,u]),o.useMemo(()=>u.length?S?Array.from(S.values()).reduce((se,ne)=>Xt(se,ne),Et):ol(u):Et,[u,S])})(xe),nt=pr(je),te=pr(je,[de]),ke=Xt(He,nt),Le=le?Vi(le,He):null,Ae=ce&&Le?b({active:ce,collisionRect:Le,droppableRects:ze,droppableContainers:re,pointerCoordinates:C}):null,Fe=Xr(Ae,"id"),[A,J]=o.useState(null),j=(function(u,S,D){return{...u,scaleX:S&&D?S.width/D.width:1,scaleY:S&&D?S.height/D.height:1}})(Ee?He:Xt(He,te),(a=A?.rect)!=null?a:null,de),_=o.useRef(null),qe=o.useCallback((u,S)=>{let{sensor:D,options:oe}=S;if(G.current==null)return;const fe=M.get(G.current);if(!fe)return;const se=u.nativeEvent,ne=new D({active:G.current,activeNode:fe,event:se,options:oe,context:we,onAbort(ue){if(!M.get(ue))return;const{onDragAbort:Ce}=O.current,Oe={id:ue};Ce?.(Oe),$({type:"onDragAbort",event:Oe})},onPending(ue,Ce,Oe,Me){if(!M.get(ue))return;const{onDragPending:Te}=O.current,$e={id:ue,constraint:Ce,initialCoordinates:Oe,offset:Me};Te?.($e),$({type:"onDragPending",event:$e})},onStart(ue){const Ce=G.current;if(Ce==null)return;const Oe=M.get(Ce);if(!Oe)return;const{onDragStart:Me}=O.current,Te={activatorEvent:se,active:{id:Ce,data:Oe.data,rect:W}};Ht.unstable_batchedUpdates(()=>{Me?.(Te),P(Pt.Initializing),z({type:gt.DragStart,initialCoordinates:ue,active:Ce}),$({type:"onDragStart",event:Te}),L(_.current),q(se)})},onMove(ue){z({type:gt.DragMove,coordinates:ue})},onEnd:ae(gt.DragEnd),onCancel:ae(gt.DragCancel)});function ae(ue){return async function(){const{active:Ce,collisions:Oe,over:Me,scrollAdjustedTranslate:Te}=we.current;let $e=null;if(Ce&&Te){const{cancelDrop:We}=O.current;$e={activatorEvent:se,active:Ce,collisions:Oe,delta:Te,over:Me},ue===gt.DragEnd&&typeof We=="function"&&await Promise.resolve(We($e))&&(ue=gt.DragCancel)}G.current=null,Ht.unstable_batchedUpdates(()=>{z({type:ue}),P(Pt.Uninitialized),J(null),L(null),q(null),_.current=null;const We=ue===gt.DragEnd?"onDragEnd":"onDragCancel";if($e){const _e=O.current[We];_e?.($e),$({type:We,event:$e})}})}}_.current=ne},[M]),ye=o.useCallback((u,S)=>(D,oe)=>{const fe=D.nativeEvent,se=M.get(oe);if(G.current!==null||!se||fe.dndKit||fe.defaultPrevented)return;const ne={active:se};u(D,S.options,ne)===!0&&(fe.dndKit={capturedBy:S.sensor},G.current=oe,qe(D,S))},[M,qe]),h=(function(u,S){return o.useMemo(()=>u.reduce((D,oe)=>{const{sensor:fe}=oe;return[...D,...fe.activators.map(se=>({eventName:se.eventName,handler:S(se.handler,oe)}))]},[]),[u,S])})(v,ye);(function(u){o.useEffect(()=>{if(!$n)return;const S=u.map(D=>{let{sensor:oe}=D;return oe.setup==null?void 0:oe.setup()});return()=>{for(const D of S)D?.()}},u.map(S=>{let{sensor:D}=S;return D}))})(v),It(()=>{de&&R===Pt.Initializing&&P(Pt.Initialized)},[de,R]),o.useEffect(()=>{const{onDragMove:u}=O.current,{active:S,activatorEvent:D,collisions:oe,over:fe}=we.current;if(!S||!D)return;const se={active:S,activatorEvent:D,collisions:oe,delta:{x:ke.x,y:ke.y},over:fe};Ht.unstable_batchedUpdates(()=>{u?.(se),$({type:"onDragMove",event:se})})},[ke.x,ke.y]),o.useEffect(()=>{const{active:u,activatorEvent:S,collisions:D,droppableContainers:oe,scrollAdjustedTranslate:fe}=we.current;if(!u||G.current==null||!S||!fe)return;const{onDragOver:se}=O.current,ne=oe.get(Fe),ae=ne&&ne.rect.current?{id:ne.id,rect:ne.rect.current,data:ne.data,disabled:ne.disabled}:null,ue={active:u,activatorEvent:S,collisions:D,delta:{x:fe.x,y:fe.y},over:ae};Ht.unstable_batchedUpdates(()=>{J(ae),se?.(ue),$({type:"onDragOver",event:ue})})},[Fe]),It(()=>{we.current={activatorEvent:I,active:ce,activeNode:Re,collisionRect:Le,collisions:Ae,droppableRects:ze,draggableNodes:M,draggingNode:ge,draggingNodeRect:le,droppableContainers:N,over:A,scrollableAncestors:xe,scrollAdjustedTranslate:ke},W.current={initial:le,translated:Le}},[ce,Re,Ae,Le,M,ge,le,ze,N,A,xe,ke]),Ji({...Y,delta:H,draggingRect:Le,pointerCoordinates:C,scrollableAncestors:xe,scrollableAncestorRects:Be});const w=o.useMemo(()=>({active:ce,activeNode:Re,activeNodeRect:de,activatorEvent:I,collisions:Ae,containerNodeRect:Ie,dragOverlay:ee,draggableNodes:M,droppableContainers:N,droppableRects:ze,over:A,measureDroppableContainers:Pe,scrollableAncestors:xe,scrollableAncestorRects:Be,measuringConfiguration:be,measuringScheduled:ve,windowRect:De}),[ce,Re,de,I,Ae,Ie,ee,M,N,ze,A,Pe,xe,Be,be,ve,De]),T=o.useMemo(()=>({activatorEvent:I,activators:h,active:ce,activeNodeRect:de,ariaDescribedById:{draggable:Q},dispatch:z,draggableNodes:M,over:A,measureDroppableContainers:Pe}),[I,h,ce,de,z,Q,M,A,Pe]);return o.createElement(_r.Provider,{value:V},o.createElement(wn.Provider,{value:T},o.createElement(ul.Provider,{value:w},o.createElement(Zn.Provider,{value:j},s)),o.createElement(ia,{disabled:f?.restoreFocus===!1})),o.createElement(Ni,{...f,hiddenTextDescribedById:Q}))}),sa=o.createContext(null),yr="button";function ca(e){let{id:t,data:n,disabled:l=!1,attributes:a}=e;const i=yn("Draggable"),{activators:f,activatorEvent:m,active:s,activeNodeRect:v,ariaDescribedById:b,draggableNodes:y,over:g}=o.useContext(wn),{role:k=yr,roleDescription:x="draggable",tabIndex:E=0}=a??{},z=s?.id===t,$=o.useContext(z?Zn:sa),[V,R]=jn(),[P,p]=jn(),F=(function(H,N){return o.useMemo(()=>H.reduce((B,W)=>{let{eventName:ce,handler:G}=W;return B[ce]=K=>{G(K,N)},B},{}),[H,N])})(f,t),M=fn(n);return It(()=>(y.set(t,{id:t,key:i,node:V,activatorNode:P,data:M}),()=>{const H=y.get(t);H&&H.key===i&&y.delete(t)}),[y,t]),{active:s,activatorEvent:m,activeNodeRect:v,attributes:o.useMemo(()=>({role:k,tabIndex:E,"aria-disabled":l,"aria-pressed":!(!z||k!==yr)||void 0,"aria-roledescription":x,"aria-describedby":b.draggable}),[l,k,E,z,x,b.draggable]),isDragging:z,listeners:l?void 0:F,node:V,over:g,setNodeRef:R,setActivatorNodeRef:p,transform:$}}function hl(){return o.useContext(ul)}const da={timeout:25};function ua(e){let{animation:t,children:n}=e;const[l,a]=o.useState(null),[i,f]=o.useState(null),m=On(n);return n||l||!m||a(m),It(()=>{if(!i)return;const s=l?.key,v=l?.props.id;s!=null&&v!=null?Promise.resolve(t(v,i)).then(()=>{a(null)}):a(null)},[t,l,i]),o.createElement(o.Fragment,null,n,l?o.cloneElement(l,{ref:f}):null)}const ga={x:0,y:0,scaleX:1,scaleY:1};function ha(e){let{children:t}=e;return o.createElement(wn.Provider,{value:dl},o.createElement(Zn.Provider,{value:ga},t))}const ma={position:"fixed",touchAction:"none"},fa=e=>_n(e)?"transform 250ms ease":void 0,pa=o.forwardRef((e,t)=>{let{as:n,activatorEvent:l,adjustScale:a,children:i,className:f,rect:m,style:s,transform:v,transition:b=fa}=e;if(!m)return null;const y=a?v:{...v,scaleX:1,scaleY:1},g={...ma,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ut.Transform.toString(y),transformOrigin:a&&l?Li(l,m):void 0,transition:typeof b=="function"?b(l):b,...s};return o.createElement(n,{className:f,style:g,ref:t},i)}),va=e=>t=>{let{active:n,dragOverlay:l}=t;const a={},{styles:i,className:f}=e;if(i!=null&&i.active)for(const[m,s]of Object.entries(i.active))s!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,s));if(i!=null&&i.dragOverlay)for(const[m,s]of Object.entries(i.dragOverlay))s!==void 0&&l.node.style.setProperty(m,s);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&l.node.classList.add(f.dragOverlay),function(){for(const[m,s]of Object.entries(a))n.node.style.setProperty(m,s);f!=null&&f.active&&n.node.classList.remove(f.active)}},ml={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ut.Transform.toString(t)},{transform:Ut.Transform.toString(n)}]},sideEffects:va({styles:{active:{opacity:"0"}}})};function Ca(e){let{config:t,draggableNodes:n,droppableContainers:l,measuringConfiguration:a}=e;return Wn((i,f)=>{if(t===null)return;const m=n.get(i);if(!m)return;const s=m.node.current;if(!s)return;const v=cl(f);if(!v)return;const{transform:b}=yt(f).getComputedStyle(f),y=Yr(b);if(!y)return;const g=typeof t=="function"?t:(function(k){const{duration:x,easing:E,sideEffects:z,keyframes:$}={...ml,...k};return V=>{let{active:R,dragOverlay:P,transform:p,...F}=V;if(!x)return;const M={x:P.rect.left-R.rect.left,y:P.rect.top-R.rect.top},H={scaleX:p.scaleX!==1?R.rect.width*p.scaleX/P.rect.width:1,scaleY:p.scaleY!==1?R.rect.height*p.scaleY/P.rect.height:1},N={x:p.x-M.x,y:p.y-M.y,...H},B=$({...F,active:R,dragOverlay:P,transform:{initial:p,final:N}}),[W]=B,ce=B[B.length-1];if(JSON.stringify(W)===JSON.stringify(ce))return;const G=z?.({active:R,dragOverlay:P,...F}),K=P.node.animate(B,{duration:x,easing:E,fill:"forwards"});return new Promise(L=>{K.onfinish=()=>{G?.(),L()}})}})(t);return rl(s,a.draggable.measure),g({active:{id:i,data:m.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(v)},droppableContainers:l,measuringConfiguration:a,transform:y})})}let wr=0;function ya(e){return o.useMemo(()=>{if(e!=null)return wr++,wr},[e])}const wa=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:l,style:a,transition:i,modifiers:f,wrapperElement:m="div",className:s,zIndex:v=999}=e;const{activatorEvent:b,active:y,activeNodeRect:g,containerNodeRect:k,draggableNodes:x,droppableContainers:E,dragOverlay:z,over:$,measuringConfiguration:V,scrollableAncestors:R,scrollableAncestorRects:P,windowRect:p}=hl(),F=o.useContext(Zn),M=ya(y?.id),H=gl(f,{activatorEvent:b,active:y,activeNodeRect:g,containerNodeRect:k,draggingNodeRect:z.rect,over:$,overlayNodeRect:z.rect,scrollableAncestors:R,scrollableAncestorRects:P,transform:F,windowRect:p}),N=xo(g),B=Ca({config:l,draggableNodes:x,droppableContainers:E,measuringConfiguration:V}),W=N?z.setRef:void 0;return o.createElement(ha,null,o.createElement(ua,{animation:B},y&&M?o.createElement(pa,{key:M,id:y.id,ref:W,as:m,activatorEvent:b,adjustScale:t,className:s,transition:i,rect:N,style:{zIndex:v,...a},transform:H},n):null))});function Ao(e,t,n){const l=e.slice();return l.splice(n<0?l.length+n:n,0,l.splice(t,1)[0]),l}function ba(e,t){return e.reduce((n,l,a)=>{const i=t.get(l);return i&&(n[a]=i),n},Array(e.length))}function An(e){return e!==null&&e>=0}const Dn={scaleX:1,scaleY:1},xa=e=>{var t;let{rects:n,activeNodeRect:l,activeIndex:a,overIndex:i,index:f}=e;const m=(t=n[a])!=null?t:l;if(!m)return null;const s=(function(v,b,y){const g=v[b],k=v[b-1],x=v[b+1];return!g||!k&&!x?0:y<b?k?g.left-(k.left+k.width):x.left-(g.left+g.width):x?x.left-(g.left+g.width):g.left-(k.left+k.width)})(n,f,a);if(f===a){const v=n[i];return v?{x:a<i?v.left+v.width-(m.left+m.width):v.left-m.left,y:0,...Dn}:null}return f>a&&f<=i?{x:-m.width-s,y:0,...Dn}:f<a&&f>=i?{x:m.width+s,y:0,...Dn}:{x:0,y:0,...Dn}},Do=e=>{let{rects:t,activeIndex:n,overIndex:l,index:a}=e;const i=Ao(t,l,n),f=t[a],m=i[a];return m&&f?{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}:null},fl="Sortable",pl=o.createContext({activeIndex:-1,containerId:fl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Do,disabled:{draggable:!1,droppable:!1}});function qa(e){let{children:t,id:n,items:l,strategy:a=Do,disabled:i=!1}=e;const{active:f,dragOverlay:m,droppableRects:s,over:v,measureDroppableContainers:b}=hl(),y=yn(fl,n),g=m.rect!==null,k=o.useMemo(()=>l.map(F=>typeof F=="object"&&"id"in F?F.id:F),[l]),x=f!=null,E=f?k.indexOf(f.id):-1,z=v?k.indexOf(v.id):-1,$=o.useRef(k),V=!(function(F,M){if(F===M)return!0;if(F.length!==M.length)return!1;for(let H=0;H<F.length;H++)if(F[H]!==M[H])return!1;return!0})(k,$.current),R=z!==-1&&E===-1||V,P=(function(F){return typeof F=="boolean"?{draggable:F,droppable:F}:F})(i);It(()=>{V&&x&&b(k)},[V,k,x,b]),o.useEffect(()=>{$.current=k},[k]);const p=o.useMemo(()=>({activeIndex:E,containerId:y,disabled:P,disableTransforms:R,items:k,overIndex:z,useDragOverlay:g,sortedRects:ba(k,s),strategy:a}),[E,y,P.draggable,P.droppable,R,k,z,s,g,a]);return o.createElement(pl.Provider,{value:p},t)}const Sa=e=>{let{id:t,items:n,activeIndex:l,overIndex:a}=e;return Ao(n,l,a).indexOf(t)},Ra=e=>{let{containerId:t,isSorting:n,wasDragging:l,index:a,items:i,newIndex:f,previousItems:m,previousContainerId:s,transition:v}=e;return!(!v||!l)&&(m===i||a!==f)&&(!!n||f!==a&&t===s)},ka={duration:200,easing:"ease"},vl="transform",Ma=Ut.Transition.toString({property:vl,duration:0,easing:"linear"}),Ta={roleDescription:"sortable"};function Ia(e){let{animateLayoutChanges:t=Ra,attributes:n,disabled:l,data:a,getNewIndex:i=Sa,id:f,strategy:m,resizeObserverConfig:s,transition:v=ka}=e;const{items:b,containerId:y,activeIndex:g,disabled:k,disableTransforms:x,sortedRects:E,overIndex:z,useDragOverlay:$,strategy:V}=o.useContext(pl),R=(function(U,ee){var ge,le;return typeof U=="boolean"?{draggable:U,droppable:!1}:{draggable:(ge=U?.draggable)!=null?ge:ee.draggable,droppable:(le=U?.droppable)!=null?le:ee.droppable}})(l,k),P=b.indexOf(f),p=o.useMemo(()=>({sortable:{containerId:y,index:P,items:b},...a}),[y,a,P,b]),F=o.useMemo(()=>b.slice(b.indexOf(f)),[b,f]),{rect:M,node:H,isOver:N,setNodeRef:B}=(function(U){let{data:ee,disabled:ge=!1,id:le,resizeObserverConfig:Ee}=U;const ie=yn("Droppable"),{active:pe,dispatch:De,over:xe,measureDroppableContainers:Be}=o.useContext(wn),He=o.useRef({disabled:ge}),C=o.useRef(!1),je=o.useRef(null),nt=o.useRef(null),{disabled:te,updateMeasurementsFor:ke,timeout:Le}={...da,...Ee},Ae=fn(ke??le),Fe=Un({callback:o.useCallback(()=>{C.current?(nt.current!=null&&clearTimeout(nt.current),nt.current=setTimeout(()=>{Be(Array.isArray(Ae.current)?Ae.current:[Ae.current]),nt.current=null},Le)):C.current=!0},[Le]),disabled:te||!pe}),A=o.useCallback((qe,ye)=>{Fe&&(ye&&(Fe.unobserve(ye),C.current=!1),qe&&Fe.observe(qe))},[Fe]),[J,j]=jn(A),_=fn(ee);return o.useEffect(()=>{Fe&&J.current&&(Fe.disconnect(),C.current=!1,Fe.observe(J.current))},[J,Fe]),o.useEffect(()=>(De({type:gt.RegisterDroppable,element:{id:le,key:ie,disabled:ge,node:J,rect:je,data:_}}),()=>De({type:gt.UnregisterDroppable,key:ie,id:le})),[le]),o.useEffect(()=>{ge!==He.current.disabled&&(De({type:gt.SetDroppableDisabled,id:le,key:ie,disabled:ge}),He.current.disabled=ge)},[le,ie,ge,De]),{active:pe,rect:je,isOver:xe?.id===le,node:J,over:xe,setNodeRef:j}})({id:f,data:p,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...s}}),{active:W,activatorEvent:ce,activeNodeRect:G,attributes:K,setNodeRef:L,listeners:I,isDragging:q,over:O,setActivatorNodeRef:Q,transform:re}=ca({id:f,data:p,attributes:{...Ta,...n},disabled:R.draggable}),be=(function(){for(var U=arguments.length,ee=new Array(U),ge=0;ge<U;ge++)ee[ge]=arguments[ge];return o.useMemo(()=>le=>{ee.forEach(Ee=>Ee(le))},ee)})(B,L),me=!!W,ze=me&&!x&&An(g)&&An(z),Pe=!$&&q,ve=Pe&&ze?re:null,Re=ze?ve??(m??V)({rects:E,activeNodeRect:G,activeIndex:g,overIndex:z,index:P}):null,Ke=An(g)&&An(z)?i({id:f,items:b,activeIndex:g,overIndex:z}):P,Y=W?.id,Z=o.useRef({activeId:Y,items:b,newIndex:Ke,containerId:y}),de=b!==Z.current.items,Ie=t({active:W,containerId:y,isDragging:q,isSorting:me,id:f,index:P,items:b,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:v,wasDragging:Z.current.activeId!=null}),we=(function(U){let{disabled:ee,index:ge,node:le,rect:Ee}=U;const[ie,pe]=o.useState(null),De=o.useRef(ge);return It(()=>{if(!ee&&ge!==De.current&&le.current){const xe=Ee.current;if(xe){const Be=tn(le.current,{ignoreTransform:!0}),He={x:xe.left-Be.left,y:xe.top-Be.top,scaleX:xe.width/Be.width,scaleY:xe.height/Be.height};(He.x||He.y)&&pe(He)}}ge!==De.current&&(De.current=ge)},[ee,ge,le,Ee]),o.useEffect(()=>{ie&&pe(null)},[ie]),ie})({disabled:!Ie,index:P,node:H,rect:M});return o.useEffect(()=>{me&&Z.current.newIndex!==Ke&&(Z.current.newIndex=Ke),y!==Z.current.containerId&&(Z.current.containerId=y),b!==Z.current.items&&(Z.current.items=b)},[me,Ke,y,b]),o.useEffect(()=>{if(Y===Z.current.activeId)return;if(Y!=null&&Z.current.activeId==null)return void(Z.current.activeId=Y);const U=setTimeout(()=>{Z.current.activeId=Y},50);return()=>clearTimeout(U)},[Y]),{active:W,activeIndex:g,attributes:K,data:p,rect:M,index:P,newIndex:Ke,items:b,isOver:N,isSorting:me,isDragging:q,listeners:I,node:H,overIndex:z,over:O,setNodeRef:be,setActivatorNodeRef:Q,setDroppableNodeRef:B,setDraggableNodeRef:L,transform:we??Re,transition:(function(){if(we||de&&Z.current.newIndex===P)return Ma;if(!(Pe&&!_n(ce)||!v)&&(me||Ie))return Ut.Transition.toString({...v,property:vl})})()}}function Kn(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 Ea=[et.Down,et.Right,et.Up,et.Left],Fa=(e,t)=>{let{context:{active:n,collisionRect:l,droppableRects:a,droppableContainers:i,over:f,scrollableAncestors:m}}=t;if(Ea.includes(e.code)){if(e.preventDefault(),!n||!l)return;const s=[];i.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const g=a.get(y.id);if(g)switch(e.code){case et.Down:l.top<g.top&&s.push(y);break;case et.Up:l.top>g.top&&s.push(y);break;case et.Left:l.left>g.left&&s.push(y);break;case et.Right:l.left<g.left&&s.push(y)}});const v=(y=>{let{collisionRect:g,droppableRects:k,droppableContainers:x}=y;const E=ir(g),z=[];for(const $ of x){const{id:V}=$,R=k.get(V);if(R){const P=ir(R),p=E.reduce((M,H,N)=>M+Gr(P[N],H),0),F=Number((p/4).toFixed(4));z.push({id:V,data:{droppableContainer:$,value:F}})}}return z.sort(Zr)})({collisionRect:l,droppableRects:a,droppableContainers:s});let b=Xr(v,"id");if(b===f?.id&&v.length>1&&(b=v[1].id),b!=null){const y=i.get(n.id),g=i.get(b),k=g?a.get(g.id):null,x=g?.node.current;if(x&&k&&y&&g){const E=Gn(x).some((P,p)=>m[p]!==P),z=br(y,g),$=(function(P,p){return!Kn(P)||!Kn(p)||!br(P,p)?!1:P.data.current.sortable.index<p.data.current.sortable.index})(y,g),V=E||!z?{x:0,y:0}:{x:$?l.width-k.width:0,y:$?l.height-k.height:0},R={x:k.left,y:k.top};return V.x&&V.y?R:pn(R,V)}}}};function br(e,t){return!(!Kn(e)||!Kn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Aa=e=>{let{transform:t}=e;return{...t,y:0}},Cl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:l,className:a,index:i,editing:f,editable:m,selectedIndex:s,background:v,activeColor:b,borderColor:y,borderWidth:g,dragging:k,...x}=e;return c.jsxs("div",{ref:t,className:ct(a),style:{...l,display:"flex",flexDirection:"column",background:s===i?"white":v,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...x,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:s===i?"0px":"-1px",marginTop:s===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===i?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:s===i&&b?b?.toCSS():"none",minHeight:"2px"}})]})})),Tt={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"},zo=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:l,fadeIn:a,handle:i,height:f,index:m,listeners:s,onRemove:v,renderItem:b,sorting:y,style:g,transition:k,transform:x,value:E,wrapperStyle:z,...$},V)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const R=b?b({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:m,fadeIn:!!a,listeners:s,ref:V,style:g,transform:x,transition:k,value:E}):c.jsx(c.Fragment,{children:E});return c.jsx("div",{className:ct("tab-item",Tt.Wrapper,a&&Tt.fadeIn,y&&Tt.sorting,t&&Tt.dragOverlay),style:{...z,transition:[k,z?.transition].filter(Boolean).join(", "),"--translate-x":x?`${Math.round(x.x)}px`:void 0,"--translate-y":x?`${Math.round(x.y)}px`:void 0,"--scale-x":x?.scaleX?`${x.scaleX}`:void 0,"--scale-y":x?.scaleY?`${x.scaleY}`:void 0,"--index":m},ref:V,children:c.jsx("div",{className:ct(Tt.Item,n&&Tt.dragging,i&&Tt.withHandle,t&&Tt.dragOverlay,l&&Tt.disabled,e&&Tt.color,"dragging"),style:g,"data-cypress":"draggable-item",...i?void 0:s,...$,tabIndex:i?void 0:-1,children:R})})})),xr={Row:"_Row_1kr10_1"},yl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},l)=>c.jsx("div",{ref:l,style:{...n},className:ct(xr.Row,t&&xr.horizontal),children:e}))),Da={...ml},za=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:l,animateLayoutChanges:a,adjustScale:i=!1,collisionDetection:f=ji,coordinateGetter:m=Fa,dropAnimation:s=Da,getItemStyles:v=()=>({}),getNewIndex:b,handle:y=!1,items:g,onMove:k,isDisabled:x=()=>!1,measuring:E,modifiers:z,renderItem:$,renderDivider:V,reorderItems:R=Ao,strategy:P=Do,style:p,useDragOverlay:F=!0,onDragStart:M,wrapperStyle:H=()=>({})}=e,[N,B]=o.useState(()=>g);o.useEffect(()=>{B(g)},[g]);const[W,ce]=o.useState(null),G=(function(){for(var O=arguments.length,Q=new Array(O),re=0;re<O;re++)Q[re]=arguments[re];return o.useMemo(()=>[...Q].filter(be=>be!=null),[...Q])})(go(al,{activationConstraint:l}),go(sl,{activationConstraint:l}),go(Eo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),K=N.indexOf.bind(N),L=W?K(W):-1,I=[];N.map((O,Q)=>{I.push(c.jsx(Na,{id:O,handle:y,index:Q,style:v,wrapperStyle:H,disabled:x(O),renderItem:$,animateLayoutChanges:a,useDragOverlay:F,getNewIndex:b},O+"-"+Q));const re=V?.({key:"divider-"+Q});re&&I.push(re)});const{getPortalContainer:q}=r.useFullscreenPortal();return c.jsxs(aa,{sensors:G,collisionDetection:f,onDragStart:O=>{const{active:Q}=O;Q&&(M?.(O),ce(Q.id))},autoScroll:{canScroll:O=>!0},onDragEnd:O=>{if(ce(null),O.over){const Q=K(O.over.id);L!==Q&&(B(re=>R(re,L,Q)),k?.(L,Q))}},onDragCancel:()=>{ce(null)},measuring:E,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...p},className:ct(n,Tt.Wrapper),children:c.jsx(qa,{items:N,strategy:P,children:c.jsx(yl,{ref:t,children:I})})}),F?Ht.createPortal(c.jsx(wa,{adjustScale:i,dropAnimation:s,children:W?c.jsx(zo,{value:N[L],handle:y,renderItem:$,wrapperStyle:H({index:L,isDragging:!0,id:N[L]}),index:L,dragging:!0,style:v({id:N[L],index:L,isSorting:W!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),q()):null]})}));function Na({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:l,id:a,index:i,onRemove:f,style:m,renderItem:s,useDragOverlay:v,wrapperStyle:b}){const{attributes:y,isDragging:g,isSorting:k,listeners:x,overIndex:E,setNodeRef:z,transform:$,transition:V}=Ia({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(zo,{ref:z,value:a,disabled:e,dragging:g,sorting:k,handle:l,renderItem:s,index:i,style:m({index:i,id:a,isDragging:g,isSorting:k,overIndex:E}),onRemove:f?()=>f(a):void 0,transform:$,transition:V,wrapperStyle:b({index:i,isDragging:g,id:a}),listeners:x,"data-index":i,"data-id":a,dragOverlay:!v&&g,...y})}const La="_TabStrip_3x0dp_1",Pa=new d.Color("rgb(33, 115, 70)"),ja="#eee",Oa=e=>c.jsx(Cl,{...e}),wl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:l,className:a,selectedTabIndex:i=0,tabNames:f=[],onSelectedTabIndexChange:m,onTabNameChange:s,onTabMove:v,createScrollStartButton:b=r.defaultCreateScrollStartButton,createScrollEndButton:y=r.defaultCreateScrollEndButton,createScrollEdgeButton:g=r.defaultCreateScrollEdgeButton,createTabButton:k=Oa,createTabDivider:x,editLabelProps:E,disabled:z=!1,disableDrag:$=!1,background:V="white",activeColor:R=Pa,borderColor:P=ja,borderWidth:p=1}=e,[F,M]=o.useState(i),[H,N]=o.useState(f),B=o.useCallback(ie=>{const pe=q.current?.[ie]?.closest(".tab-item")??q.current?.[ie];pe&&Pe.current?.scrollTo({top:pe.offsetTop,left:pe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{B(i)},[i]);const W=o.useCallback((ie,pe)=>{pe!==F&&(M(pe),m?.(pe)),B(pe)},[m,F]),ce=o.useCallback((ie,pe)=>{v?.(ie,pe)},[v]),G=o.useRef(null),[K,L]=o.useState(-1),I=o.useCallback((ie,pe)=>{s?.(ie,pe)},[s]);o.useLayoutEffect(()=>{M(i)},[i]),o.useLayoutEffect(()=>{N(f)},[f]);const q=o.useRef([]),O=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){q.current?.[ie]?.startEdit()},cancel(ie){q.current?.[ie]?.cancel()}},O.current),[F,K]);const Q=o.useCallback(({value:ie,index:pe,dragging:De})=>{const{style:xe,maxLength:Be,...He}=E||{},C=c.jsx(Kr,{ref:je=>{q.current[pe]=je},value:ie,disabled:z,maxLength:Be,style:{color:F===pe&&R?R?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...xe},styleHover:{},onSubmit:je=>(G.current=!1,L(-1),I(pe,je)),onCancel:()=>{G.current=!1,L(-1)},onChange:je=>{G.current=!0,L(pe)},...He});return k({onClick:je=>W(je,pe),value:ie,index:pe,editing:K===pe&&G.current,editable:!0,disabled:z,selectedIndex:F,background:V,activeColor:R,borderColor:P,borderWidth:p,dragging:De,children:C})},[F,I,W,E,z,K,k]),[re,{width:be}]=Vt(),[me,{width:ze}]=Vt(),Pe=o.useRef(null),[ve,Re]=o.useState({left:0,top:0,width:0,height:0}),[Ke,Y]=o.useState(null);o.useEffect(()=>{Ke!==null&&Pe.current&&Pe.current.scrollTo({left:Ke,behavior:"smooth"})},[Ke]);const Z=o.useCallback((ie,pe=!1)=>{if(!Pe.current)return 0;let De=Pe.current.firstChild.getBoundingClientRect(),xe=Pe.current.firstChild.firstChild.children,Be=0;return Be=pe?0:r.ScrollUtils.getScrollTo(ie,De.left,xe,!0,Math.max(0,ie-200)),Y(Be),Math.max(0,Be)},[]),de=o.useCallback((ie,pe=!1)=>{if(!Pe.current)return 0;let De=Pe.current.firstChild.getBoundingClientRect(),xe=Pe.current.firstChild.firstChild.children,Be=0;const He=Math.ceil(ze-be);return Be=pe?He:r.ScrollUtils.getScrollTo(ie,De.left,xe,!1,Math.max(0,ie+200)),Y(Be),Math.min(He,Be)},[ze,be]),Ie=o.useRef(null),we=o.useRef(null),U=o.useCallback(()=>{we.current&&(clearTimeout(we.current),we.current=null,Ie.current=null)},[]),ee=o.useCallback((ie,pe,De=260)=>{Ie.current=ie,we.current=setTimeout(()=>{const xe=pe?Z(Ie.current||ie):de(Ie.current||ie);xe!==Ie.current?ee(xe,pe,120):U()},De)},[Z,de,U]);o.useEffect(()=>()=>U(),[U]);const ge=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(ve.left)<=0||Math.floor(ze-be)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>ee(Pe.current.scrollLeft,!0),onClick:ie=>Z(Math.min(Pe.current.scrollLeft,Ke??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[ve,Ke,ze,be]),le=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ze-be)<=Math.ceil(ve.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>ee(Pe.current.scrollLeft,!1),onClick:ie=>de(Math.max(Pe.current.scrollLeft,Ke??0),ie.ctrlKey)}),[ve,Ke,ze,be]),Ee=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,g?.(ge)]}),[ge,le,b,y,n,g]);return c.jsxs("div",{style:{...l,display:"flex",alignItems:"stretch"},className:ct(La,a),ref:O,children:[c.jsx("div",{style:{borderTop:`solid ${P} ${p}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Ee}),c.jsx("div",{className:"Tabs",ref:re,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:Pe,onScroll:ie=>{Re({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:c.jsx(za,{isDisabled:ie=>z||$,items:H,strategy:xa,modifiers:[Aa],ref:me,renderItem:Q,renderDivider:x,onMove:ce,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:g(le)})]})}));wl.displayName="TabStrip";const Nn=o.createContext(null);Nn.displayName="DocThemesContext";const Ba="_script-editor_iy654_5",Ha={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"},Va=o.lazy(()=>Promise.resolve().then(()=>require("./Cb0U7vCZ2BhwUSZb.cjs")));let an,sn,Lt=["define","require"],qr=!1,Ln="@0.7.13";Ln!=="@local"&&Ln!=="@0.0.0"||(Ln="");const Ua=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${Ln}/types/scripting.d.ts`,Sr=async(e,t,n)=>{const l=e.getModel();if(!l)return;const a=await t.languages.typescript.getTypeScriptWorker(),i=await a(l.uri),f=await i.getNavigationTree(l.uri.toString()),m=e.getPosition();let s={...m};s.lineNumber=1,s.column=1;let v=!1;for(let E=m.lineNumber;E>=1;E--)if(l.getLineContent(E).trim()===""){const z=No(f,l.getOffsetAt({lineNumber:E,column:1}),"function");if(!z||$a(z)){v=!0,s.lineNumber=E+1;break}{const $=z.spans[0].start;E=l.getPositionAt($).lineNumber,s.lineNumber=E}}let b=n,y=!1;!v&&!b.startsWith(`
|
|
27
|
+
`},Ii={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 Ei(e){let{announcements:t=Ii,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=Ti}=e;const{announce:l,announcement:f}=(function(){const[y,g]=o.useState("");return{announce:o.useCallback(k=>{k!=null&&g(k)},[]),announcement:y}})(),m=Cn("DndLiveRegion"),[s,v]=o.useState(!1);if(o.useEffect(()=>{v(!0)},[]),(function(y){const g=o.useContext(Kr);o.useEffect(()=>{if(!g)throw new Error("useDndMonitor must be used within a children of <DndContext>");return g(y)},[y,g])})(o.useMemo(()=>({onDragStart(y){let{active:g}=y;l(t.onDragStart({active:g}))},onDragMove(y){let{active:g,over:k}=y;t.onDragMove&&l(t.onDragMove({active:g,over:k}))},onDragOver(y){let{active:g,over:k}=y;l(t.onDragOver({active:g,over:k}))},onDragEnd(y){let{active:g,over:k}=y;l(t.onDragEnd({active:g,over:k}))},onDragCancel(y){let{active:g,over:k}=y;l(t.onDragCancel({active:g,over:k}))}}),[l,t])),!s)return null;const b=o.createElement(o.Fragment,null,o.createElement(ki,{id:i,value:a.draggable}),o.createElement(Mi,{id:m,announcement:f}));return n?Ht.createPortal(b,n):b}var mt;function Bn(){}function uo(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"})(mt||(mt={}));const Ft=Object.freeze({x:0,y:0});function Wr(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=On(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function $r(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function Ai(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function rr(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 Gr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function lr(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 Di=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=lr(t,t.left,t.top),l=[];for(const f of i){const{id:m}=f,s=n.get(m);if(s){const v=Wr(lr(s),a);l.push({id:m,data:{droppableContainer:f,value:v}})}}return l.sort($r)};function zi(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),f=a-i,m=l-n;if(i<a&&n<l){const s=t.width*t.height,v=e.width*e.height,b=f*m;return Number((b/(s+v-b)).toFixed(4))}return 0}const Ni=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,m=n.get(f);if(m){const s=zi(m,t);s>0&&a.push({id:f,data:{droppableContainer:l,value:s}})}}return a.sort(Ai)};function ir(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ft}function Li(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,f)=>({...l,top:l.top+e*f.y,bottom:l.bottom+e*f.y,left:l.left+e*f.x,right:l.right+e*f.x}),{...t})}}const Pi=Li(1);function _r(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 ji={ignoreTransform:!1};function tn(e,t){t===void 0&&(t=ji);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:v,transformOrigin:b}=xt(e).getComputedStyle(e);v&&(n=(function(y,g,k){const x=_r(g);if(!x)return y;const{scaleX:E,scaleY:z,x:W,y:V}=x,R=y.left-W-(1-E)*parseFloat(k),P=y.top-V-(1-z)*parseFloat(k.slice(k.indexOf(" ")+1)),p=E?y.width/E:y.width,F=z?y.height/z:y.height;return{width:p,height:F,top:P,right:R+p,bottom:P+F,left:R}})(n,v,b))}const{top:i,left:a,width:l,height:f,bottom:m,right:s}=n;return{top:i,left:a,width:l,height:f,bottom:m,right:s}}function ar(e){return tn(e,{ignoreTransform:!0})}function Gn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(Mo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!vn(a)||Vr(a)||n.includes(a))return n;const l=xt(e).getComputedStyle(a);return a!==e&&(function(f,m){m===void 0&&(m=xt(f).getComputedStyle(f));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(v=>{const b=m[v];return typeof b=="string"&&s.test(b)})})(a,l)&&n.push(a),(function(f,m){return m===void 0&&(m=xt(f).getComputedStyle(f)),m.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Zr(e){const[t]=Gn(e,1);return t??null}function go(e){return Kn&&e?en(e)?e:ko(e)?Mo(e)||e===Jt(e).scrollingElement?window:vn(e)?e:null:null:null}function Xr(e){return en(e)?e.scrollX:e.scrollLeft}function Yr(e){return en(e)?e.scrollY:e.scrollTop}function po(e){return{x:Xr(e),y:Yr(e)}}var pt;function Jr(e){return!(!Kn||!e)&&e===document.scrollingElement}function Qr(e){const t={x:0,y:0},n=Jr(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"})(pt||(pt={}));const Oi={x:.2,y:.2};function Bi(e,t,n,i,a){let{top:l,left:f,right:m,bottom:s}=n;i===void 0&&(i=10),a===void 0&&(a=Oi);const{isTop:v,isBottom:b,isLeft:y,isRight:g}=Qr(e),k={x:0,y:0},x={x:0,y:0},E=t.height*a.y,z=t.width*a.x;return!v&&l<=t.top+E?(k.y=pt.Backward,x.y=i*Math.abs((t.top+E-l)/E)):!b&&s>=t.bottom-E&&(k.y=pt.Forward,x.y=i*Math.abs((t.bottom-E-s)/E)),!g&&m>=t.right-z?(k.x=pt.Forward,x.x=i*Math.abs((t.right-z-m)/z)):!y&&f<=t.left+z&&(k.x=pt.Backward,x.x=i*Math.abs((t.left+z-f)/z)),{direction:k,speed:x}}function Hi(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:f}=window;return{top:0,left:0,right:l,bottom:f,width:l,height:f}}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 el(e){return e.reduce((t,n)=>Xt(t,po(n)),Ft)}function tl(e,t){if(t===void 0&&(t=tn),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Zr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Vi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Xr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Yr(n),0)}]];class vo{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=Gn(n),a=el(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,m]of Vi)for(const s of f)Object.defineProperty(this,s,{get:()=>{const v=m(i),b=a[l]-v;return this.rect[s]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class un{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 ho(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 Mt,Qe;function sr(e){e.preventDefault()}function Ui(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"})(Mt||(Mt={})),(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"})(Qe||(Qe={}));const nl={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},Ki=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class To{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 un(Jt(n)),this.windowListeners=new un(xt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Mt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&tl(i),n(Ft)}handleKeyDown(t){if($n(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=nl,coordinateGetter:f=Ki,scrollBehavior:m="smooth"}=a,{code:s}=t;if(l.end.includes(s))return void this.handleEnd(t);if(l.cancel.includes(s))return void this.handleCancel(t);const{collisionRect:v}=i.current,b=v?{x:v.left,y:v.top}:Ft;this.referenceCoordinates||(this.referenceCoordinates=b);const y=f(t,{active:n,context:i.current,currentCoordinates:b});if(y){const g=fn(y,b),k={x:0,y:0},{scrollableAncestors:x}=i.current;for(const E of x){const z=t.code,{isTop:W,isRight:V,isLeft:R,isBottom:P,maxScroll:p,minScroll:F}=Qr(E),M=Hi(E),H={x:Math.min(z===Qe.Right?M.right-M.width/2:M.right,Math.max(z===Qe.Right?M.left:M.left+M.width/2,y.x)),y:Math.min(z===Qe.Down?M.bottom-M.height/2:M.bottom,Math.max(z===Qe.Down?M.top:M.top+M.height/2,y.y))},N=z===Qe.Right&&!V||z===Qe.Left&&!R,B=z===Qe.Down&&!P||z===Qe.Up&&!W;if(N&&H.x!==y.x){const $=E.scrollLeft+g.x,ce=z===Qe.Right&&$<=p.x||z===Qe.Left&&$>=F.x;if(ce&&!g.y)return void E.scrollTo({left:$,behavior:m});k.x=ce?E.scrollLeft-$:z===Qe.Right?E.scrollLeft-p.x:E.scrollLeft-F.x,k.x&&E.scrollBy({left:-k.x,behavior:m});break}if(B&&H.y!==y.y){const $=E.scrollTop+g.y,ce=z===Qe.Down&&$<=p.y||z===Qe.Up&&$>=F.y;if(ce&&!g.x)return void E.scrollTo({top:$,behavior:m});k.y=ce?E.scrollTop-$:z===Qe.Down?E.scrollTop-p.y:E.scrollTop-F.y,k.y&&E.scrollBy({top:-k.y,behavior:m});break}}this.handleMove(t,Xt(fn(y,this.referenceCoordinates),k))}}}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 cr(e){return!!(e&&"distance"in e)}function dr(e){return!!(e&&"delay"in e)}To.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=nl,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Io{constructor(t,n,i){var a;i===void 0&&(i=(function(m){const{EventTarget:s}=xt(m);return m instanceof s?m:Jt(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:f}=l;this.props=t,this.events=n,this.document=Jt(f),this.documentListeners=new un(this.document),this.listeners=new un(i),this.windowListeners=new un(xt(f)),this.initialCoordinates=(a=On(l))!=null?a:Ft,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(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.DragStart,sr),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),this.windowListeners.add(Mt.ContextMenu,sr),this.documentListeners.add(Mt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(cr(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(Mt.Click,Ui,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Mt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:m}}=l;if(!a)return;const s=(n=On(t))!=null?n:Ft,v=fn(a,s);if(!i&&m){if(cr(m)){if(m.tolerance!=null&&ho(v,m.tolerance))return this.handleCancel();if(ho(v,m.distance))return this.handleStart()}return dr(m)&&ho(v,m.tolerance)?this.handleCancel():void this.handlePending(m,v)}t.cancelable&&t.preventDefault(),f(s)}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===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ol extends Io{constructor(t){const{event:n}=t,i=Jt(n.target);super(t,Wi,i)}}ol.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const $i={move:{name:"mousemove"},end:{name:"mouseup"}};var Co;(function(e){e[e.RightClick=2]="RightClick"})(Co||(Co={}));class rl extends Io{constructor(t){super(t,$i,Jt(t.event.target))}}rl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==Co.RightClick&&(i?.({event:n}),!0)}}];const mo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ll extends Io{constructor(t){super(t,mo)}static setup(){return window.addEventListener(mo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(mo.move.name,t)};function t(){}}}var gn,Hn;function Gi(e){let{acceleration:t,activator:n=gn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:m=Hn.TreeOrder,pointerCoordinates:s,scrollableAncestors:v,scrollableAncestorRects:b,delta:y,threshold:g}=e;const k=(function(F){let{delta:M,disabled:H}=F;const N=jn(M);return dn(B=>{if(H||!N||!B)return _i;const $={x:Math.sign(M.x-N.x),y:Math.sign(M.y-N.y)};return{x:{[pt.Backward]:B.x[pt.Backward]||$.x===-1,[pt.Forward]:B.x[pt.Forward]||$.x===1},y:{[pt.Backward]:B.y[pt.Backward]||$.y===-1,[pt.Forward]:B.y[pt.Forward]||$.y===1}}},[H,M,N])})({delta:y,disabled:!l}),[x,E]=(function(){const F=o.useRef(null);return[o.useCallback((M,H)=>{F.current=setInterval(M,H)},[]),o.useCallback(()=>{F.current!==null&&(clearInterval(F.current),F.current=null)},[])]})(),z=o.useRef({x:0,y:0}),W=o.useRef({x:0,y:0}),V=o.useMemo(()=>{switch(n){case gn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case gn.DraggableRect:return a}},[n,a,s]),R=o.useRef(null),P=o.useCallback(()=>{const F=R.current;if(!F)return;const M=z.current.x*W.current.x,H=z.current.y*W.current.y;F.scrollBy(M,H)},[]),p=o.useMemo(()=>m===Hn.TreeOrder?[...v].reverse():v,[m,v]);o.useEffect(()=>{if(l&&v.length&&V){for(const F of p){if(i?.(F)===!1)continue;const M=v.indexOf(F),H=b[M];if(!H)continue;const{direction:N,speed:B}=Bi(F,H,V,t,g);for(const $ of["x","y"])k[$][N[$]]||(B[$]=0,N[$]=0);if(B.x>0||B.y>0)return E(),R.current=F,x(P,f),z.current=B,void(W.current=N)}z.current={x:0,y:0},W.current={x:0,y:0},E()}else E()},[t,P,i,E,l,f,JSON.stringify(V),JSON.stringify(k),x,v,p,b,JSON.stringify(g)])}ll.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"})(gn||(gn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hn||(Hn={}));const _i={x:{[pt.Backward]:!1,[pt.Forward]:!1},y:{[pt.Backward]:!1,[pt.Forward]:!1}};var pn,yo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(pn||(pn={})),(function(e){e.Optimized="optimized"})(yo||(yo={}));const ur=new Map;function wo(e,t){return dn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vn(e){let{callback:t,disabled:n}=e;const i=Wn(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 Zi(e){return new vo(tn(e),e)}function gr(e,t,n){t===void 0&&(t=Zi);const[i,a]=o.useState(null);function l(){a(s=>{if(!e)return null;var v;if(e.isConnected===!1)return(v=s??n)!=null?v:null;const b=t(e);return JSON.stringify(s)===JSON.stringify(b)?s:b})}const f=(function(s){let{callback:v,disabled:b}=s;const y=Wn(v),g=o.useMemo(()=>{if(b||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:k}=window;return new k(y)},[y,b]);return o.useEffect(()=>()=>g?.disconnect(),[g]),g})({callback(s){if(e)for(const v of s){const{type:b,target:y}=v;if(b==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),m=Vn({callback:l});return Et(()=>{l(),e?(m?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),f?.disconnect())},[e]),i}const hr=[];function mr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Ft;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?fn(e,n.current):Ft}function fr(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 pr=[];function il(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vn(t)?t:e}const Xi=[{sensor:ol,options:{}},{sensor:To,options:{}}],Yi={current:{}},Dn={draggable:{measure:ar},droppable:{measure:ar,strategy:pn.WhileDragging,frequency:yo.Optimized},dragOverlay:{measure:tn}};class hn 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 Ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Dn,measureDroppableContainers:Bn,windowRect:null,measuringScheduled:!1},al={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bn,draggableNodes:new Map,over:null,measureDroppableContainers:Bn},yn=o.createContext(al),sl=o.createContext(Ji);function Qi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hn}}}function ea(e,t){switch(t.type){case mt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mt.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 mt.DragEnd:case mt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mt.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new hn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case mt.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const f=new hn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case mt.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new hn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function ta(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(yn),l=jn(i),f=jn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!$n(l)||document.activeElement===l.target)return;const m=a.get(f);if(!m)return;const{activatorNode:s,node:v}=m;if(!s.current&&!v.current)return;requestAnimationFrame(()=>{for(const b of[s.current,v.current]){if(!b)continue;const y=Si(b);if(y){y.focus();break}}})}},[i,t,a,f,l]),null}function cl(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const _n=o.createContext({...Ft,scaleX:1,scaleY:1});var Pt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pt||(Pt={}));const na=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:m=!0,children:s,sensors:v=Xi,collisionDetection:b=Ni,measuring:y,modifiers:g,...k}=e;const x=o.useReducer(ea,void 0,Qi),[E,z]=x,[W,V]=(function(){const[u]=o.useState(()=>new Set),S=o.useCallback(D=>(u.add(D),()=>u.delete(D)),[u]);return[o.useCallback(D=>{let{type:oe,event:fe}=D;u.forEach(se=>{var ne;return(ne=se[oe])==null?void 0:ne.call(se,fe)})},[u]),S]})(),[R,P]=o.useState(Pt.Uninitialized),p=R===Pt.Initialized,{draggable:{active:F,nodes:M,translate:H},droppable:{containers:N}}=E,B=F!=null?M.get(F):null,$=o.useRef({initial:null,translated:null}),ce=o.useMemo(()=>{var u;return F!=null?{id:F,data:(u=B?.data)!=null?u:Yi,rect:$}:null},[F,B]),_=o.useRef(null),[K,L]=o.useState(null),[I,q]=o.useState(null),O=mn(k,Object.values(k)),Q=Cn("DndDescribedBy",l),re=o.useMemo(()=>N.getEnabled(),[N]),be=(he=y,o.useMemo(()=>({draggable:{...Dn.draggable,...he?.draggable},droppable:{...Dn.droppable,...he?.droppable},dragOverlay:{...Dn.dragOverlay,...he?.dragOverlay}}),[he?.draggable,he?.droppable,he?.dragOverlay]));var he;const{droppableRects:ze,measureDroppableContainers:Pe,measuringScheduled:ve}=(function(u,S){let{dragging:D,dependencies:oe,config:fe}=S;const[se,ne]=o.useState(null),{frequency:ae,measure:ue,strategy:we}=fe,He=o.useRef(u),Me=(function(){switch(we){case pn.Always:return!1;case pn.BeforeDragging:return D;default:return!D}})(),Te=mn(Me),Ue=o.useCallback(function(Ye){Ye===void 0&&(Ye=[]),Te.current||ne(Je=>Je===null?Ye:Je.concat(Ye.filter(Le=>!Je.includes(Le))))},[Te]),_e=o.useRef(null),$e=dn(Ye=>{if(Me&&!D)return ur;if(!Ye||Ye===ur||He.current!==u||se!=null){const Je=new Map;for(let Le of u){if(!Le)continue;if(se&&se.length>0&&!se.includes(Le.id)&&Le.rect.current){Je.set(Le.id,Le.rect.current);continue}const Xe=Le.node.current,vt=Xe?new vo(ue(Xe),Xe):null;Le.rect.current=vt,vt&&Je.set(Le.id,vt)}return Je}return Ye},[u,se,D,Me,ue]);return o.useEffect(()=>{He.current=u},[u]),o.useEffect(()=>{Me||Ue()},[D,Me]),o.useEffect(()=>{se&&se.length>0&&ne(null)},[JSON.stringify(se)]),o.useEffect(()=>{Me||typeof ae!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ue(),_e.current=null},ae))},[ae,Me,Ue,...oe]),{droppableRects:$e,measureDroppableContainers:Ue,measuringScheduled:se!=null}})(re,{dragging:p,dependencies:[H.x,H.y],config:be.droppable}),Re=(function(u,S){const D=S!=null?u.get(S):void 0,oe=D?D.node.current:null;return dn(fe=>{var se;return S==null?null:(se=oe??fe)!=null?se:null},[oe,S])})(M,F),We=o.useMemo(()=>I?On(I):null,[I]),Y=(function(){const u=K?.autoScrollEnabled===!1,S=typeof m=="object"?m.enabled===!1:m===!1,D=p&&!u&&!S;return typeof m=="object"?{...m,enabled:D}:{enabled:D}})(),Z=(function(u,S){return wo(u,S)})(Re,be.draggable.measure);(function(u){let{activeNode:S,measure:D,initialRect:oe,config:fe=!0}=u;const se=o.useRef(!1),{x:ne,y:ae}=typeof fe=="boolean"?{x:fe,y:fe}:fe;Et(()=>{if(!ne&&!ae||!S)return void(se.current=!1);if(se.current||!oe)return;const ue=S?.node.current;if(!ue||ue.isConnected===!1)return;const we=ir(D(ue),oe);if(ne||(we.x=0),ae||(we.y=0),se.current=!0,Math.abs(we.x)>0||Math.abs(we.y)>0){const He=Zr(ue);He&&He.scrollBy({top:we.y,left:we.x})}},[S,ne,ae,oe,D])})({activeNode:F!=null?M.get(F):null,config:Y.layoutShiftCompensation,initialRect:Z,measure:be.draggable.measure});const de=gr(Re,be.draggable.measure,Z),Ie=gr(Re?Re.parentElement:null),ye=o.useRef({activatorEvent:null,active:null,activeNode:Re,collisionRect:null,collisions:null,droppableRects:ze,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=N.getNodeFor((t=ye.current.over)==null?void 0:t.id),te=(function(u){let{measure:S}=u;const[D,oe]=o.useState(null),fe=Vn({callback:o.useCallback(ue=>{for(const{target:we}of ue)if(vn(we)){oe(He=>{const Me=S(we);return He?{...He,width:Me.width,height:Me.height}:Me});break}},[S])}),se=o.useCallback(ue=>{const we=il(ue);fe?.disconnect(),we&&fe?.observe(we),oe(we?S(we):null)},[S,fe]),[ne,ae]=Pn(se);return o.useMemo(()=>({nodeRef:ne,rect:D,setRef:ae}),[D,ne,ae])})({measure:be.dragOverlay.measure}),ge=(n=te.nodeRef.current)!=null?n:Re,le=p?(i=te.rect)!=null?i:de:null,Ee=!!(te.nodeRef.current&&te.rect),ie=ir(pe=Ee?null:de,wo(pe));var pe;const De=fr(ge?xt(ge):null),xe=(function(u){const S=o.useRef(u),D=dn(oe=>u?oe&&oe!==hr&&u&&S.current&&u.parentNode===S.current.parentNode?oe:Gn(u):hr,[u]);return o.useEffect(()=>{S.current=u},[u]),D})(p?U??Re:null),Oe=(function(u,S){S===void 0&&(S=tn);const[D]=u,oe=fr(D?xt(D):null),[fe,se]=o.useState(pr);function ne(){se(()=>u.length?u.map(ue=>Jr(ue)?oe:new vo(S(ue),ue)):pr)}const ae=Vn({callback:ne});return Et(()=>{ae?.disconnect(),ne(),u.forEach(ue=>ae?.observe(ue))},[u]),fe})(xe),Be=cl(g,{transform:{x:H.x-ie.x,y:H.y-ie.y,scaleX:1,scaleY:1},activatorEvent:I,active:ce,activeNodeRect:de,containerNodeRect:Ie,draggingNodeRect:le,over:ye.current.over,overlayNodeRect:te.rect,scrollableAncestors:xe,scrollableAncestorRects:Oe,windowRect:De}),C=We?Xt(We,H):null,je=(function(u){const[S,D]=o.useState(null),oe=o.useRef(u),fe=o.useCallback(se=>{const ne=go(se.target);ne&&D(ae=>ae?(ae.set(ne,po(ne)),new Map(ae)):null)},[]);return o.useEffect(()=>{const se=oe.current;if(u!==se){ne(se);const ae=u.map(ue=>{const we=go(ue);return we?(we.addEventListener("scroll",fe,{passive:!0}),[we,po(we)]):null}).filter(ue=>ue!=null);D(ae.length?new Map(ae):null),oe.current=u}return()=>{ne(u),ne(se)};function ne(ae){ae.forEach(ue=>{const we=go(ue);we?.removeEventListener("scroll",fe)})}},[fe,u]),o.useMemo(()=>u.length?S?Array.from(S.values()).reduce((se,ne)=>Xt(se,ne),Ft):el(u):Ft,[u,S])})(xe),tt=mr(je),ee=mr(je,[de]),ke=Xt(Be,tt),Ne=le?Pi(le,Be):null,Ae=ce&&Ne?b({active:ce,collisionRect:Ne,droppableRects:ze,droppableContainers:re,pointerCoordinates:C}):null,Fe=Gr(Ae,"id"),[A,J]=o.useState(null),j=(function(u,S,D){return{...u,scaleX:S&&D?S.width/D.width:1,scaleY:S&&D?S.height/D.height:1}})(Ee?Be:Xt(Be,ee),(a=A?.rect)!=null?a:null,de),G=o.useRef(null),qe=o.useCallback((u,S)=>{let{sensor:D,options:oe}=S;if(_.current==null)return;const fe=M.get(_.current);if(!fe)return;const se=u.nativeEvent,ne=new D({active:_.current,activeNode:fe,event:se,options:oe,context:ye,onAbort(ue){if(!M.get(ue))return;const{onDragAbort:we}=O.current,He={id:ue};we?.(He),W({type:"onDragAbort",event:He})},onPending(ue,we,He,Me){if(!M.get(ue))return;const{onDragPending:Te}=O.current,Ue={id:ue,constraint:we,initialCoordinates:He,offset:Me};Te?.(Ue),W({type:"onDragPending",event:Ue})},onStart(ue){const we=_.current;if(we==null)return;const He=M.get(we);if(!He)return;const{onDragStart:Me}=O.current,Te={activatorEvent:se,active:{id:we,data:He.data,rect:$}};Ht.unstable_batchedUpdates(()=>{Me?.(Te),P(Pt.Initializing),z({type:mt.DragStart,initialCoordinates:ue,active:we}),W({type:"onDragStart",event:Te}),L(G.current),q(se)})},onMove(ue){z({type:mt.DragMove,coordinates:ue})},onEnd:ae(mt.DragEnd),onCancel:ae(mt.DragCancel)});function ae(ue){return async function(){const{active:we,collisions:He,over:Me,scrollAdjustedTranslate:Te}=ye.current;let Ue=null;if(we&&Te){const{cancelDrop:_e}=O.current;Ue={activatorEvent:se,active:we,collisions:He,delta:Te,over:Me},ue===mt.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ue))&&(ue=mt.DragCancel)}_.current=null,Ht.unstable_batchedUpdates(()=>{z({type:ue}),P(Pt.Uninitialized),J(null),L(null),q(null),G.current=null;const _e=ue===mt.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const $e=O.current[_e];$e?.(Ue),W({type:_e,event:Ue})}})}}G.current=ne},[M]),Ce=o.useCallback((u,S)=>(D,oe)=>{const fe=D.nativeEvent,se=M.get(oe);if(_.current!==null||!se||fe.dndKit||fe.defaultPrevented)return;const ne={active:se};u(D,S.options,ne)===!0&&(fe.dndKit={capturedBy:S.sensor},_.current=oe,qe(D,S))},[M,qe]),h=(function(u,S){return o.useMemo(()=>u.reduce((D,oe)=>{const{sensor:fe}=oe;return[...D,...fe.activators.map(se=>({eventName:se.eventName,handler:S(se.handler,oe)}))]},[]),[u,S])})(v,Ce);(function(u){o.useEffect(()=>{if(!Kn)return;const S=u.map(D=>{let{sensor:oe}=D;return oe.setup==null?void 0:oe.setup()});return()=>{for(const D of S)D?.()}},u.map(S=>{let{sensor:D}=S;return D}))})(v),Et(()=>{de&&R===Pt.Initializing&&P(Pt.Initialized)},[de,R]),o.useEffect(()=>{const{onDragMove:u}=O.current,{active:S,activatorEvent:D,collisions:oe,over:fe}=ye.current;if(!S||!D)return;const se={active:S,activatorEvent:D,collisions:oe,delta:{x:ke.x,y:ke.y},over:fe};Ht.unstable_batchedUpdates(()=>{u?.(se),W({type:"onDragMove",event:se})})},[ke.x,ke.y]),o.useEffect(()=>{const{active:u,activatorEvent:S,collisions:D,droppableContainers:oe,scrollAdjustedTranslate:fe}=ye.current;if(!u||_.current==null||!S||!fe)return;const{onDragOver:se}=O.current,ne=oe.get(Fe),ae=ne&&ne.rect.current?{id:ne.id,rect:ne.rect.current,data:ne.data,disabled:ne.disabled}:null,ue={active:u,activatorEvent:S,collisions:D,delta:{x:fe.x,y:fe.y},over:ae};Ht.unstable_batchedUpdates(()=>{J(ae),se?.(ue),W({type:"onDragOver",event:ue})})},[Fe]),Et(()=>{ye.current={activatorEvent:I,active:ce,activeNode:Re,collisionRect:Ne,collisions:Ae,droppableRects:ze,draggableNodes:M,draggingNode:ge,draggingNodeRect:le,droppableContainers:N,over:A,scrollableAncestors:xe,scrollAdjustedTranslate:ke},$.current={initial:le,translated:Ne}},[ce,Re,Ae,Ne,M,ge,le,ze,N,A,xe,ke]),Gi({...Y,delta:H,draggingRect:Ne,pointerCoordinates:C,scrollableAncestors:xe,scrollableAncestorRects:Oe});const w=o.useMemo(()=>({active:ce,activeNode:Re,activeNodeRect:de,activatorEvent:I,collisions:Ae,containerNodeRect:Ie,dragOverlay:te,draggableNodes:M,droppableContainers:N,droppableRects:ze,over:A,measureDroppableContainers:Pe,scrollableAncestors:xe,scrollableAncestorRects:Oe,measuringConfiguration:be,measuringScheduled:ve,windowRect:De}),[ce,Re,de,I,Ae,Ie,te,M,N,ze,A,Pe,xe,Oe,be,ve,De]),T=o.useMemo(()=>({activatorEvent:I,activators:h,active:ce,activeNodeRect:de,ariaDescribedById:{draggable:Q},dispatch:z,draggableNodes:M,over:A,measureDroppableContainers:Pe}),[I,h,ce,de,z,Q,M,A,Pe]);return o.createElement(Kr.Provider,{value:V},o.createElement(yn.Provider,{value:T},o.createElement(sl.Provider,{value:w},o.createElement(_n.Provider,{value:j},s)),o.createElement(ta,{disabled:f?.restoreFocus===!1})),o.createElement(Ei,{...f,hiddenTextDescribedById:Q}))}),oa=o.createContext(null),vr="button";function ra(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=Cn("Draggable"),{activators:f,activatorEvent:m,active:s,activeNodeRect:v,ariaDescribedById:b,draggableNodes:y,over:g}=o.useContext(yn),{role:k=vr,roleDescription:x="draggable",tabIndex:E=0}=a??{},z=s?.id===t,W=o.useContext(z?_n:oa),[V,R]=Pn(),[P,p]=Pn(),F=(function(H,N){return o.useMemo(()=>H.reduce((B,$)=>{let{eventName:ce,handler:_}=$;return B[ce]=K=>{_(K,N)},B},{}),[H,N])})(f,t),M=mn(n);return Et(()=>(y.set(t,{id:t,key:l,node:V,activatorNode:P,data:M}),()=>{const H=y.get(t);H&&H.key===l&&y.delete(t)}),[y,t]),{active:s,activatorEvent:m,activeNodeRect:v,attributes:o.useMemo(()=>({role:k,tabIndex:E,"aria-disabled":i,"aria-pressed":!(!z||k!==vr)||void 0,"aria-roledescription":x,"aria-describedby":b.draggable}),[i,k,E,z,x,b.draggable]),isDragging:z,listeners:i?void 0:F,node:V,over:g,setNodeRef:R,setActivatorNodeRef:p,transform:W}}function dl(){return o.useContext(sl)}const la={timeout:25};function ia(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),m=jn(n);return n||i||!m||a(m),Et(()=>{if(!l)return;const s=i?.key,v=i?.props.id;s!=null&&v!=null?Promise.resolve(t(v,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const aa={x:0,y:0,scaleX:1,scaleY:1};function sa(e){let{children:t}=e;return o.createElement(yn.Provider,{value:al},o.createElement(_n.Provider,{value:aa},t))}const ca={position:"fixed",touchAction:"none"},da=e=>$n(e)?"transform 250ms ease":void 0,ua=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:m,style:s,transform:v,transition:b=da}=e;if(!m)return null;const y=a?v:{...v,scaleX:1,scaleY:1},g={...ca,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ut.Transform.toString(y),transformOrigin:a&&i?Fi(i,m):void 0,transition:typeof b=="function"?b(i):b,...s};return o.createElement(n,{className:f,style:g,ref:t},l)}),ga=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[m,s]of Object.entries(l.active))s!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,s));if(l!=null&&l.dragOverlay)for(const[m,s]of Object.entries(l.dragOverlay))s!==void 0&&i.node.style.setProperty(m,s);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[m,s]of Object.entries(a))n.node.style.setProperty(m,s);f!=null&&f.active&&n.node.classList.remove(f.active)}},ul={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ut.Transform.toString(t)},{transform:Ut.Transform.toString(n)}]},sideEffects:ga({styles:{active:{opacity:"0"}}})};function ha(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Wn((l,f)=>{if(t===null)return;const m=n.get(l);if(!m)return;const s=m.node.current;if(!s)return;const v=il(f);if(!v)return;const{transform:b}=xt(f).getComputedStyle(f),y=_r(b);if(!y)return;const g=typeof t=="function"?t:(function(k){const{duration:x,easing:E,sideEffects:z,keyframes:W}={...ul,...k};return V=>{let{active:R,dragOverlay:P,transform:p,...F}=V;if(!x)return;const M={x:P.rect.left-R.rect.left,y:P.rect.top-R.rect.top},H={scaleX:p.scaleX!==1?R.rect.width*p.scaleX/P.rect.width:1,scaleY:p.scaleY!==1?R.rect.height*p.scaleY/P.rect.height:1},N={x:p.x-M.x,y:p.y-M.y,...H},B=W({...F,active:R,dragOverlay:P,transform:{initial:p,final:N}}),[$]=B,ce=B[B.length-1];if(JSON.stringify($)===JSON.stringify(ce))return;const _=z?.({active:R,dragOverlay:P,...F}),K=P.node.animate(B,{duration:x,easing:E,fill:"forwards"});return new Promise(L=>{K.onfinish=()=>{_?.(),L()}})}})(t);return tl(s,a.draggable.measure),g({active:{id:l,data:m.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(v)},droppableContainers:i,measuringConfiguration:a,transform:y})})}let Cr=0;function ma(e){return o.useMemo(()=>{if(e!=null)return Cr++,Cr},[e])}const fa=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:m="div",className:s,zIndex:v=999}=e;const{activatorEvent:b,active:y,activeNodeRect:g,containerNodeRect:k,draggableNodes:x,droppableContainers:E,dragOverlay:z,over:W,measuringConfiguration:V,scrollableAncestors:R,scrollableAncestorRects:P,windowRect:p}=dl(),F=o.useContext(_n),M=ma(y?.id),H=cl(f,{activatorEvent:b,active:y,activeNodeRect:g,containerNodeRect:k,draggingNodeRect:z.rect,over:W,overlayNodeRect:z.rect,scrollableAncestors:R,scrollableAncestorRects:P,transform:F,windowRect:p}),N=wo(g),B=ha({config:i,draggableNodes:x,droppableContainers:E,measuringConfiguration:V}),$=N?z.setRef:void 0;return o.createElement(sa,null,o.createElement(ia,{animation:B},y&&M?o.createElement(ua,{key:M,id:y.id,ref:$,as:m,activatorEvent:b,adjustScale:t,className:s,transition:l,rect:N,style:{zIndex:v,...a},transform:H},n):null))});function Eo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function pa(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Fn(e){return e!==null&&e>=0}const An={scaleX:1,scaleY:1},va=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const s=(function(v,b,y){const g=v[b],k=v[b-1],x=v[b+1];return!g||!k&&!x?0:y<b?k?g.left-(k.left+k.width):x.left-(g.left+g.width):x?x.left-(g.left+g.width):g.left-(k.left+k.width)})(n,f,a);if(f===a){const v=n[l];return v?{x:a<l?v.left+v.width-(m.left+m.width):v.left-m.left,y:0,...An}:null}return f>a&&f<=l?{x:-m.width-s,y:0,...An}:f<a&&f>=l?{x:m.width+s,y:0,...An}:{x:0,y:0,...An}},Fo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=Eo(t,i,n),f=t[a],m=l[a];return m&&f?{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}:null},gl="Sortable",hl=o.createContext({activeIndex:-1,containerId:gl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Fo,disabled:{draggable:!1,droppable:!1}});function Ca(e){let{children:t,id:n,items:i,strategy:a=Fo,disabled:l=!1}=e;const{active:f,dragOverlay:m,droppableRects:s,over:v,measureDroppableContainers:b}=dl(),y=Cn(gl,n),g=m.rect!==null,k=o.useMemo(()=>i.map(F=>typeof F=="object"&&"id"in F?F.id:F),[i]),x=f!=null,E=f?k.indexOf(f.id):-1,z=v?k.indexOf(v.id):-1,W=o.useRef(k),V=!(function(F,M){if(F===M)return!0;if(F.length!==M.length)return!1;for(let H=0;H<F.length;H++)if(F[H]!==M[H])return!1;return!0})(k,W.current),R=z!==-1&&E===-1||V,P=(function(F){return typeof F=="boolean"?{draggable:F,droppable:F}:F})(l);Et(()=>{V&&x&&b(k)},[V,k,x,b]),o.useEffect(()=>{W.current=k},[k]);const p=o.useMemo(()=>({activeIndex:E,containerId:y,disabled:P,disableTransforms:R,items:k,overIndex:z,useDragOverlay:g,sortedRects:pa(k,s),strategy:a}),[E,y,P.draggable,P.droppable,R,k,z,s,g,a]);return o.createElement(hl.Provider,{value:p},t)}const ya=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return Eo(n,i,a).indexOf(t)},wa=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:m,previousContainerId:s,transition:v}=e;return!(!v||!i)&&(m===l||a!==f)&&(!!n||f!==a&&t===s)},ba={duration:200,easing:"ease"},ml="transform",xa=Ut.Transition.toString({property:ml,duration:0,easing:"linear"}),qa={roleDescription:"sortable"};function Sa(e){let{animateLayoutChanges:t=wa,attributes:n,disabled:i,data:a,getNewIndex:l=ya,id:f,strategy:m,resizeObserverConfig:s,transition:v=ba}=e;const{items:b,containerId:y,activeIndex:g,disabled:k,disableTransforms:x,sortedRects:E,overIndex:z,useDragOverlay:W,strategy:V}=o.useContext(hl),R=(function(U,te){var ge,le;return typeof U=="boolean"?{draggable:U,droppable:!1}:{draggable:(ge=U?.draggable)!=null?ge:te.draggable,droppable:(le=U?.droppable)!=null?le:te.droppable}})(i,k),P=b.indexOf(f),p=o.useMemo(()=>({sortable:{containerId:y,index:P,items:b},...a}),[y,a,P,b]),F=o.useMemo(()=>b.slice(b.indexOf(f)),[b,f]),{rect:M,node:H,isOver:N,setNodeRef:B}=(function(U){let{data:te,disabled:ge=!1,id:le,resizeObserverConfig:Ee}=U;const ie=Cn("Droppable"),{active:pe,dispatch:De,over:xe,measureDroppableContainers:Oe}=o.useContext(yn),Be=o.useRef({disabled:ge}),C=o.useRef(!1),je=o.useRef(null),tt=o.useRef(null),{disabled:ee,updateMeasurementsFor:ke,timeout:Ne}={...la,...Ee},Ae=mn(ke??le),Fe=Vn({callback:o.useCallback(()=>{C.current?(tt.current!=null&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Oe(Array.isArray(Ae.current)?Ae.current:[Ae.current]),tt.current=null},Ne)):C.current=!0},[Ne]),disabled:ee||!pe}),A=o.useCallback((qe,Ce)=>{Fe&&(Ce&&(Fe.unobserve(Ce),C.current=!1),qe&&Fe.observe(qe))},[Fe]),[J,j]=Pn(A),G=mn(te);return o.useEffect(()=>{Fe&&J.current&&(Fe.disconnect(),C.current=!1,Fe.observe(J.current))},[J,Fe]),o.useEffect(()=>(De({type:mt.RegisterDroppable,element:{id:le,key:ie,disabled:ge,node:J,rect:je,data:G}}),()=>De({type:mt.UnregisterDroppable,key:ie,id:le})),[le]),o.useEffect(()=>{ge!==Be.current.disabled&&(De({type:mt.SetDroppableDisabled,id:le,key:ie,disabled:ge}),Be.current.disabled=ge)},[le,ie,ge,De]),{active:pe,rect:je,isOver:xe?.id===le,node:J,over:xe,setNodeRef:j}})({id:f,data:p,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...s}}),{active:$,activatorEvent:ce,activeNodeRect:_,attributes:K,setNodeRef:L,listeners:I,isDragging:q,over:O,setActivatorNodeRef:Q,transform:re}=ra({id:f,data:p,attributes:{...qa,...n},disabled:R.draggable}),be=(function(){for(var U=arguments.length,te=new Array(U),ge=0;ge<U;ge++)te[ge]=arguments[ge];return o.useMemo(()=>le=>{te.forEach(Ee=>Ee(le))},te)})(B,L),he=!!$,ze=he&&!x&&Fn(g)&&Fn(z),Pe=!W&&q,ve=Pe&&ze?re:null,Re=ze?ve??(m??V)({rects:E,activeNodeRect:_,activeIndex:g,overIndex:z,index:P}):null,We=Fn(g)&&Fn(z)?l({id:f,items:b,activeIndex:g,overIndex:z}):P,Y=$?.id,Z=o.useRef({activeId:Y,items:b,newIndex:We,containerId:y}),de=b!==Z.current.items,Ie=t({active:$,containerId:y,isDragging:q,isSorting:he,id:f,index:P,items:b,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:v,wasDragging:Z.current.activeId!=null}),ye=(function(U){let{disabled:te,index:ge,node:le,rect:Ee}=U;const[ie,pe]=o.useState(null),De=o.useRef(ge);return Et(()=>{if(!te&&ge!==De.current&&le.current){const xe=Ee.current;if(xe){const Oe=tn(le.current,{ignoreTransform:!0}),Be={x:xe.left-Oe.left,y:xe.top-Oe.top,scaleX:xe.width/Oe.width,scaleY:xe.height/Oe.height};(Be.x||Be.y)&&pe(Be)}}ge!==De.current&&(De.current=ge)},[te,ge,le,Ee]),o.useEffect(()=>{ie&&pe(null)},[ie]),ie})({disabled:!Ie,index:P,node:H,rect:M});return o.useEffect(()=>{he&&Z.current.newIndex!==We&&(Z.current.newIndex=We),y!==Z.current.containerId&&(Z.current.containerId=y),b!==Z.current.items&&(Z.current.items=b)},[he,We,y,b]),o.useEffect(()=>{if(Y===Z.current.activeId)return;if(Y!=null&&Z.current.activeId==null)return void(Z.current.activeId=Y);const U=setTimeout(()=>{Z.current.activeId=Y},50);return()=>clearTimeout(U)},[Y]),{active:$,activeIndex:g,attributes:K,data:p,rect:M,index:P,newIndex:We,items:b,isOver:N,isSorting:he,isDragging:q,listeners:I,node:H,overIndex:z,over:O,setNodeRef:be,setActivatorNodeRef:Q,setDroppableNodeRef:B,setDraggableNodeRef:L,transform:ye??Re,transition:(function(){if(ye||de&&Z.current.newIndex===P)return xa;if(!(Pe&&!$n(ce)||!v)&&(he||Ie))return Ut.Transition.toString({...v,property:ml})})()}}function Un(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 Ra=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],ka=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:m}}=t;if(Ra.includes(e.code)){if(e.preventDefault(),!n||!i)return;const s=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const g=a.get(y.id);if(g)switch(e.code){case Qe.Down:i.top<g.top&&s.push(y);break;case Qe.Up:i.top>g.top&&s.push(y);break;case Qe.Left:i.left>g.left&&s.push(y);break;case Qe.Right:i.left<g.left&&s.push(y)}});const v=(y=>{let{collisionRect:g,droppableRects:k,droppableContainers:x}=y;const E=rr(g),z=[];for(const W of x){const{id:V}=W,R=k.get(V);if(R){const P=rr(R),p=E.reduce((M,H,N)=>M+Wr(P[N],H),0),F=Number((p/4).toFixed(4));z.push({id:V,data:{droppableContainer:W,value:F}})}}return z.sort($r)})({collisionRect:i,droppableRects:a,droppableContainers:s});let b=Gr(v,"id");if(b===f?.id&&v.length>1&&(b=v[1].id),b!=null){const y=l.get(n.id),g=l.get(b),k=g?a.get(g.id):null,x=g?.node.current;if(x&&k&&y&&g){const E=Gn(x).some((P,p)=>m[p]!==P),z=yr(y,g),W=(function(P,p){return!Un(P)||!Un(p)||!yr(P,p)?!1:P.data.current.sortable.index<p.data.current.sortable.index})(y,g),V=E||!z?{x:0,y:0}:{x:W?i.width-k.width:0,y:W?i.height-k.height:0},R={x:k.left,y:k.top};return V.x&&V.y?R:fn(R,V)}}}};function yr(e,t){return!(!Un(e)||!Un(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Ma=e=>{let{transform:t}=e;return{...t,y:0}},fl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:m,selectedIndex:s,background:v,activeColor:b,borderColor:y,borderWidth:g,dragging:k,...x}=e;return c.jsxs("div",{ref:t,className:dt(a),style:{...i,display:"flex",flexDirection:"column",background:s===l?"white":v,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...x,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:s===l?"0px":"-1px",marginTop:s===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===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:s===l&&b?b?.toCSS():"none",minHeight:"2px"}})]})})),It={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"},Ao=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:m,listeners:s,onRemove:v,renderItem:b,sorting:y,style:g,transition:k,transform:x,value:E,wrapperStyle:z,...W},V)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const R=b?b({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:m,fadeIn:!!a,listeners:s,ref:V,style:g,transform:x,transition:k,value:E}):c.jsx(c.Fragment,{children:E});return c.jsx("div",{className:dt("tab-item",It.Wrapper,a&&It.fadeIn,y&&It.sorting,t&&It.dragOverlay),style:{...z,transition:[k,z?.transition].filter(Boolean).join(", "),"--translate-x":x?`${Math.round(x.x)}px`:void 0,"--translate-y":x?`${Math.round(x.y)}px`:void 0,"--scale-x":x?.scaleX?`${x.scaleX}`:void 0,"--scale-y":x?.scaleY?`${x.scaleY}`:void 0,"--index":m},ref:V,children:c.jsx("div",{className:dt(It.Item,n&&It.dragging,l&&It.withHandle,t&&It.dragOverlay,i&&It.disabled,e&&It.color,"dragging"),style:g,"data-cypress":"draggable-item",...l?void 0:s,...W,tabIndex:l?void 0:-1,children:R})})})),wr={Row:"_Row_1kr10_1"},pl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:dt(wr.Row,t&&wr.horizontal),children:e}))),Ta={...ul},Ia=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=Di,coordinateGetter:m=ka,dropAnimation:s=Ta,getItemStyles:v=()=>({}),getNewIndex:b,handle:y=!1,items:g,onMove:k,isDisabled:x=()=>!1,measuring:E,modifiers:z,renderItem:W,renderDivider:V,reorderItems:R=Eo,strategy:P=Fo,style:p,useDragOverlay:F=!0,onDragStart:M,wrapperStyle:H=()=>({})}=e,[N,B]=o.useState(()=>g);o.useEffect(()=>{B(g)},[g]);const[$,ce]=o.useState(null),_=(function(){for(var O=arguments.length,Q=new Array(O),re=0;re<O;re++)Q[re]=arguments[re];return o.useMemo(()=>[...Q].filter(be=>be!=null),[...Q])})(uo(rl,{activationConstraint:i}),uo(ll,{activationConstraint:i}),uo(To,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),K=N.indexOf.bind(N),L=$?K($):-1,I=[];N.map((O,Q)=>{I.push(c.jsx(Ea,{id:O,handle:y,index:Q,style:v,wrapperStyle:H,disabled:x(O),renderItem:W,animateLayoutChanges:a,useDragOverlay:F,getNewIndex:b},O+"-"+Q));const re=V?.({key:"divider-"+Q});re&&I.push(re)});const{getPortalContainer:q}=r.useFullscreenPortal();return c.jsxs(na,{sensors:_,collisionDetection:f,onDragStart:O=>{const{active:Q}=O;Q&&(M?.(O),ce(Q.id))},autoScroll:{canScroll:O=>!0},onDragEnd:O=>{if(ce(null),O.over){const Q=K(O.over.id);L!==Q&&(B(re=>R(re,L,Q)),k?.(L,Q))}},onDragCancel:()=>{ce(null)},measuring:E,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...p},className:dt(n,It.Wrapper),children:c.jsx(Ca,{items:N,strategy:P,children:c.jsx(pl,{ref:t,children:I})})}),F?Ht.createPortal(c.jsx(fa,{adjustScale:l,dropAnimation:s,children:$?c.jsx(Ao,{value:N[L],handle:y,renderItem:W,wrapperStyle:H({index:L,isDragging:!0,id:N[L]}),index:L,dragging:!0,style:v({id:N[L],index:L,isSorting:$!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),q()):null]})}));function Ea({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:m,renderItem:s,useDragOverlay:v,wrapperStyle:b}){const{attributes:y,isDragging:g,isSorting:k,listeners:x,overIndex:E,setNodeRef:z,transform:W,transition:V}=Sa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(Ao,{ref:z,value:a,disabled:e,dragging:g,sorting:k,handle:i,renderItem:s,index:l,style:m({index:l,id:a,isDragging:g,isSorting:k,overIndex:E}),onRemove:f?()=>f(a):void 0,transform:W,transition:V,wrapperStyle:b({index:l,isDragging:g,id:a}),listeners:x,"data-index":l,"data-id":a,dragOverlay:!v&&g,...y})}const Fa="_TabStrip_3x0dp_1",Aa=new d.Color("rgb(33, 115, 70)"),Da="#eee",za=e=>c.jsx(fl,{...e}),vl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:m,onTabNameChange:s,onTabMove:v,createScrollStartButton:b=r.defaultCreateScrollStartButton,createScrollEndButton:y=r.defaultCreateScrollEndButton,createScrollEdgeButton:g=r.defaultCreateScrollEdgeButton,createTabButton:k=za,createTabDivider:x,editLabelProps:E,disabled:z=!1,disableDrag:W=!1,background:V="white",activeColor:R=Aa,borderColor:P=Da,borderWidth:p=1}=e,[F,M]=o.useState(l),[H,N]=o.useState(f),B=o.useCallback(ie=>{const pe=q.current?.[ie]?.closest(".tab-item")??q.current?.[ie];pe&&Pe.current?.scrollTo({top:pe.offsetTop,left:pe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{B(l)},[l]);const $=o.useCallback((ie,pe)=>{pe!==F&&(M(pe),m?.(pe)),B(pe)},[m,F]),ce=o.useCallback((ie,pe)=>{v?.(ie,pe)},[v]),_=o.useRef(null),[K,L]=o.useState(-1),I=o.useCallback((ie,pe)=>{s?.(ie,pe)},[s]);o.useLayoutEffect(()=>{M(l)},[l]),o.useLayoutEffect(()=>{N(f)},[f]);const q=o.useRef([]),O=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){q.current?.[ie]?.startEdit()},cancel(ie){q.current?.[ie]?.cancel()}},O.current),[F,K]);const Q=o.useCallback(({value:ie,index:pe,dragging:De})=>{const{style:xe,maxLength:Oe,...Be}=E||{},C=c.jsx(Hr,{ref:je=>{q.current[pe]=je},value:ie,disabled:z,maxLength:Oe,style:{color:F===pe&&R?R?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...xe},styleHover:{},onSubmit:je=>(_.current=!1,L(-1),I(pe,je)),onCancel:()=>{_.current=!1,L(-1)},onChange:je=>{_.current=!0,L(pe)},...Be});return k({onClick:je=>$(je,pe),value:ie,index:pe,editing:K===pe&&_.current,editable:!0,disabled:z,selectedIndex:F,background:V,activeColor:R,borderColor:P,borderWidth:p,dragging:De,children:C})},[F,I,$,E,z,K,k]),[re,{width:be}]=Vt(),[he,{width:ze}]=Vt(),Pe=o.useRef(null),[ve,Re]=o.useState({left:0,top:0,width:0,height:0}),[We,Y]=o.useState(null);o.useEffect(()=>{We!==null&&Pe.current&&Pe.current.scrollTo({left:We,behavior:"smooth"})},[We]);const Z=o.useCallback((ie,pe=!1)=>{if(!Pe.current)return 0;let De=Pe.current.firstChild.getBoundingClientRect(),xe=Pe.current.firstChild.firstChild.children,Oe=0;return Oe=pe?0:r.ScrollUtils.getScrollTo(ie,De.left,xe,!0,Math.max(0,ie-200)),Y(Oe),Math.max(0,Oe)},[]),de=o.useCallback((ie,pe=!1)=>{if(!Pe.current)return 0;let De=Pe.current.firstChild.getBoundingClientRect(),xe=Pe.current.firstChild.firstChild.children,Oe=0;const Be=Math.ceil(ze-be);return Oe=pe?Be:r.ScrollUtils.getScrollTo(ie,De.left,xe,!1,Math.max(0,ie+200)),Y(Oe),Math.min(Be,Oe)},[ze,be]),Ie=o.useRef(null),ye=o.useRef(null),U=o.useCallback(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null,Ie.current=null)},[]),te=o.useCallback((ie,pe,De=260)=>{Ie.current=ie,ye.current=setTimeout(()=>{const xe=pe?Z(Ie.current||ie):de(Ie.current||ie);xe!==Ie.current?te(xe,pe,120):U()},De)},[Z,de,U]);o.useEffect(()=>()=>U(),[U]);const ge=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(ve.left)<=0||Math.floor(ze-be)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>te(Pe.current.scrollLeft,!0),onClick:ie=>Z(Math.min(Pe.current.scrollLeft,We??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[ve,We,ze,be]),le=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ze-be)<=Math.ceil(ve.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>te(Pe.current.scrollLeft,!1),onClick:ie=>de(Math.max(Pe.current.scrollLeft,We??0),ie.ctrlKey)}),[ve,We,ze,be]),Ee=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,g?.(ge)]}),[ge,le,b,y,n,g]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:dt(Fa,a),ref:O,children:[c.jsx("div",{style:{borderTop:`solid ${P} ${p}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Ee}),c.jsx("div",{className:"Tabs",ref:re,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:Pe,onScroll:ie=>{Re({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:c.jsx(Ia,{isDisabled:ie=>z||W,items:H,strategy:va,modifiers:[Ma],ref:he,renderItem:Q,renderDivider:x,onMove:ce,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:g(le)})]})}));vl.displayName="TabStrip";const zn=o.createContext(null);zn.displayName="DocThemesContext";const Na="_script-editor_iy654_5",La={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"},Pa=o.lazy(()=>Promise.resolve().then(()=>require("./CVIHFd-SYF31eyeF.cjs")));let an,sn,Lt=["define","require"],br=!1,Nn="@0.7.14";Nn!=="@local"&&Nn!=="@0.0.0"||(Nn="");const ja=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${Nn}/types/scripting.d.ts`,xr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),f=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let s={...m};s.lineNumber=1,s.column=1;let v=!1;for(let E=m.lineNumber;E>=1;E--)if(i.getLineContent(E).trim()===""){const z=Do(f,i.getOffsetAt({lineNumber:E,column:1}),"function");if(!z||Ba(z)){v=!0,s.lineNumber=E+1;break}{const W=z.spans[0].start;E=i.getPositionAt(W).lineNumber,s.lineNumber=E}}let b=n,y=!1;!v&&!b.startsWith(`
|
|
28
28
|
`)&&s.lineNumber>1&&(b=`
|
|
29
|
-
`+b,y=!0);let g=!1;
|
|
29
|
+
`+b,y=!0);let g=!1;i.getLineCount()>1&&(b.endsWith(`
|
|
30
30
|
|
|
31
31
|
`)||(b+=`
|
|
32
32
|
|
|
33
|
-
`,g=!0));const k=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${b}`}];let x=null;l.pushEditOperations([],k,E=>(x=E[0].range,y&&x.startLineNumber++,g&&x.endLineNumber--,[new t.Selection(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn)])),e.setSelection({startLineNumber:x.endLineNumber,startColumn:x.endColumn,endLineNumber:x.startLineNumber,endColumn:x.startColumn})};function Ka(e,t){let n=null;const l=e.length;for(let a=0;!n&&a<l;a++){const i=e[a];i.getName()===t.text&&(n=i)}return n?n.getContext():"formula"}function qo(e,t,n,l,a=[]){if(l.kind==="function"&&l.kindModifiers==="export"){const i=l.spans[0].start,f=e.getPositionAt(i);a.push({name:l.text,type:Ka(n,l),lineNumber:f.lineNumber})}if(l.childItems)for(const i of l.childItems)qo(e,t,n,i,a);return a}function No(e,t,n="function",l){const a=e.spans,i=a.length;for(let f=0;f<i;f++){const m=a[f];if(m.start<=t&&t<m.start+m.length){if(e.kind===n&&(!l||e.kindModifiers===l))return e;for(const s of e.childItems||[]){const v=No(s,t,n,l);if(v)return v}}return null}}function $a(e){return e.kind==="comment"}const Wa=o.memo(o.forwardRef((e,t)=>{const{className:n,style:l,commands:a,readOnly:i=!1,darkMode:f,loadingPanel:m,autoFocus:s=!0,frame:v,onStatusChange:b,...y}=e,g=o.useRef(null),k=o.useRef(!1),x=o.useMemo(()=>({contains(Y){if(!g.current)return;const Z=g.current.editor;return Z&&Z.getDomNode()?.contains(Y)},focus(){if(!g.current)return;const Y=g.current.editor;return Y&&Y.getDomNode()?.focus()}}),[]),E=o.useMemo(()=>[new r.Command("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),z=o.useMemo(()=>{let Y=null;const Z=()=>x;return Y=a?a.createChildGroup(Z,"scriptEditor",!1):new r.CommandGroup(Z,"scriptEditor"),Y.addCommands(E,!0),Y},[a,E]),$=a.getGroup("workbook"),V=r.useCommands($,["executeSelectedScript","saveScripts"]),R=V[0],P=V[1],p=R?.context(),[F,M]=o.useState({message:"Loading",cursor:"",dirty:!1}),[H,N]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),B=r.useCallbackRef(Y=>{M(Z=>{const de={...Z,...Y};return he.CommonUtils.deepEqual(de,Z)?Z:(P.update({disabled:!de.dirty}).updateCallback(async()=>{await W()}),de)})},[b,P]);o.useEffect(()=>{b?.(F)},[b,F]);const W=r.useCallbackRef(async()=>{if(!g.current)return;const Y=g.current.editor;let Z;if(F.dirty){const de=Y.getValue();await p?.saveSource(de),Z=p?.getScripts().getModules().getByName("scripts");const Ie=Z?.getSource(),we=Y.getValue(),U=(Ie?.length??0)!==de.length||Ie!==we;B({dirty:U})}else Z=p?.getScripts().getModules().getByName("scripts");return Z},[F]);o.useEffect(()=>{const Y=v?.addListener({onBeforeHide:async()=>(await W(),!0)});return()=>{Y?.()}},[v]),o.useEffect(()=>{const Y=p?.getScripts();if(Y)return Y.addListeners({onBeforeSearch:()=>W()})},[p]);const ce=r.useCallbackRef(Y=>{R?.execute(Y)},[R]),G=o.useRef(""),[K,L]=o.useState(!1),I=r.useCallbackRef(async()=>{if(!g.current)return null;const Y=g.current,Z=Y.editor;if(!Z)return null;const de=Y.monaco,Ie=await(async(we,U,ee="export")=>{const ge=we.getModel();if(!ge)return null;const le=await U.languages.typescript.getTypeScriptWorker(),Ee=await le(ge.uri),ie=await Ee.getNavigationTree(ge.uri.toString());let pe=null,De=we.getSelection();if(!De)return null;const xe=De.startLineNumber===De.endLineNumber&&De.startColumn===De.endColumn?ge.getLineCount():Math.min(De.endLineNumber,ge.getLineCount());for(let Be=De.startLineNumber;!pe&&Be<=xe;Be++){const He=No(ie,ge.getOffsetAt({lineNumber:Be,column:1}),"function",ee);He&&(pe=He.text)}return pe})(Z,de);return B({message:(Ie??"").toUpperCase()}),Ie?{source:Z.getValue(),name:Ie}:null},[]);r.useCallbackRef(he.CommonUtils.debounce(W,200),[]);const q=r.useCallbackRef(async(Y,Z,de)=>{N(we=>({...we,compiling:!0}));const Ie=await p?.getScripts().createModule({source:de?.getValue(),declarationsOnly:!0});Ie&&((async function(we,U){const ee=[];for(let ge=1;ge<we.getLineCount()+1;ge++){const le={startLineNumber:ge,startColumn:1,endLineNumber:ge,endColumn:we.getLineLength(ge)+1},Ee=we.getValueInRange(le).indexOf("modelt");Ee!==-1&&ee.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:le.startLineNumber,startColumn:Ee+1,endLineNumber:le.startLineNumber,endColumn:Ee+5})}U.editor.setModelMarkers(we,"owner",ee)})(Y,Z),(async function(we,U,ee,ge){const le=await U.languages.typescript.getTypeScriptWorker(),Ee=await le(we.uri),ie=await Ee.getNavigationTree(we.uri.toString()),pe=qo(we,U,ge,ie).map(De=>{let xe=null,Be=null;return De.type==="formula"?(xe="formula.margin-icon",Be="Formula"):De.type==="macro"?(xe="macro.margin-icon",Be="Macro"):De.type==="autoRun"&&(xe="autorun.margin-icon",Be="Auto Run"),{range:new U.Range(De.lineNumber,1,De.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:{value:Be},stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ze.current&&ze.current.clear(),ze.current=ee.createDecorationsCollection(pe)})(Y,Z,de,Ie?Ie.getFunctions().getItems():he.CommonUtils.EmptyArray),N(we=>({...we,compiling:!1})))},[p]),O=r.useCallbackRef(he.CommonUtils.debounce(q,580),[]),Q=r.useCallbackRef(async(Y=void 0)=>{if(!g.current||!p)return;const Z=g.current.editor.getPosition(),de={cursor:Z?Z.toString():""};Y!==void 0&&(de.message=Y),B(de);const Ie=I();p.setSelectedFunction(Ie)},[p]);o.useEffect(()=>{},[H]);const re=o.useRef(null),be=r.useCallbackRef(async()=>{await W(),v?.close()},[v]);o.useEffect(()=>{if(!p)return;const Y={insertSnippet:de=>{g.current?.editor&&Sr(g.current.editor,g.current.monaco,de)},close:()=>be()};p.setEditor(Y),p.setSelectedFunction(I());const Z=p.addContainerListener({onBeforeSave:async()=>{W()},onReadonlyChange(){},onScriptChange:async()=>{if(!g.current?.editor||!p)return;const de=g.current.editor,Ie=p.getScripts().getModules().getItems()[0]?.getSource()??"";de.setValue(Ie)}});return()=>{p.setEditor(null),Z()}},[p]),o.useEffect(()=>()=>{const Y=re.current;if(Y){Y.dispose();const Z=Y.debounceTimer;Z!==void 0&&clearTimeout(Z),re.current=null}},[K]);const me=r.useCallbackRef(Y=>{const Z=g.current?.editor;return!!Z&&(Z.focus(Y),!0)},[F]),ze=o.useRef(null),Pe=r.useCallbackRef((Y,Z)=>{g.current={monaco:Z,editor:Y},L(!0),Q("Loading Types");const de=p?.getScripts().getModules().getItems()[0]?.getSource()??"";Y.setValue(de),Promise.resolve().then(()=>require("./D9khCXyDa4HlwQoc.cjs")).then(we=>we.customEditor).then(async we=>{Q(""),we.AutoTypings.create(Y,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:Z,onUpdate:(U,ee)=>{if(U.type==="LookedUpPackage"&&U.success!==void 0){const ge=Z.languages.typescript.typescriptDefaults.getDiagnosticsOptions();Z.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ge,diagnosticCodesToIgnore:[]})}},onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(U=>{re.current=U;const ee=Y.getModel();O(ee,Z,Y),(()=>{if(qr)return;const ge=(Ee,ie)=>{try{if(ie===void 0)try{delete globalThis[Ee]}catch{try{globalThis[Ee]=void 0}catch{}}else globalThis[Ee]=ie}catch{}},le=Lt.length;for(let Ee=0;Ee<le;Ee++){const ie=Lt[Ee];ge(ie,an[ie])}an=void 0,qr=!0})()})}),Y.addCommand("executeScript",function(we,...U){U?.[0]&&ce({functionName:U?.[0]})},""),Y.addAction({id:"executeScript",label:"Execute",keybindings:[Z.KeyCode.F8],run:async we=>{const U=I();p?.setSelectedFunction(U);const ee=await U;ce(ee)}}),Y.addAction({id:"saveScript",label:"Save Script",keybindings:[Z.KeyMod.CtrlCmd|Z.KeyCode.KeyS],run:we=>{W()}}),Y.onMouseDown(async we=>{if(we.target.type===Z.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=we.target.position.lineNumber,ee=await Z.languages.typescript.getTypeScriptWorker(),ge=await ee(Ie.uri),le=await ge.getNavigationTree(Ie.uri.toString()),Ee=(await W()).getFunctions().getItems(),ie=qo(Ie,Z,Ee,le).find(pe=>pe.lineNumber===U);if(ie){const pe=we.event.browserEvent.button;pe===0?ie.type==="macro"||ie.type==="autoRun"?ce({functionName:ie.name}):ie.type==="formula"&&p?.quickInsertFunction?.(ie.name):pe===2&&(console.log("Context menu for function:",ie.name),we.event.browserEvent.preventDefault())}}}),Y.onDidChangeModelContent(()=>{B({dirty:!0}),O(Ie,Z,Y)}),Z.editor.onDidChangeMarkers(we=>{we.some(U=>U.toString()===Ie.uri.toString())});const Ie=Y.getModel();(function(we,U){U.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ee,ge,le){const Ee=[];for(let ie=1;ie<ee.getLineCount()+1;ie++){const pe={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:ee.getLineLength(ie)+1},De="hint",xe=ee.getValueInRange(pe).indexOf("hint");xe!==-1&&Ee.push({kind:U.languages.InlayHintKind.Type,position:{lineNumber:pe.startLineNumber,column:xe+De.length+1},label:"[hint]"})}return{hints:Ee,dispose:()=>{}}}})})(0,Z),Ie.onDidChangeContent(we=>{const U=p?.getScripts().getModules().getByName("scripts"),ee=U?.getSource(),ge=Y.getValue(),le=(ee?.length??0)!==ge.length||ee!==ge;B({dirty:le})}),Y.onDidChangeCursorPosition(we=>{Q()})},[p]),ve=o.useMemo(()=>K?null:m||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[K,m]),Re=o.useMemo(()=>{if(!K){if(!an){an={};const Z=Lt.length;for(let de=0;de<Z;de++){const Ie=Lt[de];an[Ie]=globalThis[Ie]}}if(sn){const Z=Lt.length;for(let de=0;de<Z;de++){const Ie=Lt[de];globalThis[Ie]=sn[Ie]}}}const Y=p?.getScripts().getModules().getByName("scripts")?.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(Va,{theme:f?"extended-dark":"extended",options:{...Ha,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:Y,onValidate:Z=>{let de=!1;const Ie=Z?Z.length:0;for(let we=0;!de&&we<Ie;we++)Z[we].severity===8&&(de=!0)},beforeMount:Z=>{Z.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),Z.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),Z.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),Z.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let de=!1,Ie=!1;try{const we=await(async()=>await(await fetch(Ua)).text())(),U=Z.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let ee=Z.editor.getModel(U);ee?Ie=!0:ee=Z.editor.createModel(we,"typescript",U),Z.editor.setModelMarkers(ee,"default",[]),de=!0}catch(we){console.warn("cant load types",we)}if(Z.languages.registerLinkProvider("*",{provideLinks:(we,U)=>{const ee=[],ge={links:ee},le=we.getLinesContent(),Ee=le.length;for(let ie=1;ie<=Ee;ie++){const pe=le[ie-1],De=Z.editor.tokenize(pe,"typescript"),xe=De[0].length;for(let Be=0;Be<xe;Be++){const He=De[0]?.[Be];if(He&&He.type.startsWith("string")){let C=He.offset,je=De[0]?.[Be+1]?.offset??pe.length,nt=new Z.Range(ie,C+1,ie,je+1),te=we.getValueInRange(nt);const ke=te[0];ke!=="`"&&ke!=="'"&&ke!=='"'||(C++,te=te.substring(1));const Le=te[te.length-1];Le!=="`"&&Le!=="'"&&Le!=='"'||(C++,te=te.substring(0,te.length-1));try{p.getRanges(te)&&ee.push({range:{endColumn:je,endLineNumber:ie,startColumn:C,startLineNumber:ie},tooltip:`Goto range '${te}'`,url:`/range/${te}`})}catch(Ae){console.warn(Ae)}}}}return ge}}),Z.editor.registerLinkOpener({open(we){if(we?.path?.startsWith("/range/")){try{p.getRanges(we.path.substring(7))?.select()}catch(U){console.warn("invalid range",U)}return!0}return!1}}),!Ie){const we=Z.languages.typescript.typescriptDefaults.getCompilerOptions();Z.languages.typescript.typescriptDefaults.setCompilerOptions({...we,target:Z.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:Z.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(G.current&&(await Sr(g.current.editor,g.current.monaco,G.current),G.current=null),k.current&&requestAnimationFrame(async()=>{k.current&&Z.editor.focus()}),!sn){sn={};const we=Lt.length;for(let U=0;U<we;U++){const ee=Lt[U];sn[ee]=globalThis[ee]}}})()},onMount:Pe})}),ve]})},[p,z,i,ve,f]),Ke=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:Y=>{me(Y)},close:()=>be(),getEditor:()=>p?.getEditor()}),[p]);return o.useEffect(()=>(s&&requestAnimationFrame(()=>{Ke.current?.focus()}),()=>{g.current?.editor&&requestAnimationFrame(()=>{Ke.current?.contains(document.activeElement)&&Ke.current?.focus()})}),[]),c.jsx("div",{className:ct("script-editor",Ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...l},ref:Ke,...y,children:Re})})),_a=Object.freeze(Object.defineProperty({__proto__:null,FindScopeOptions:{Workbook:"workbook",Sheet:"sheet"}},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.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=ki,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=_a,exports.CornerTriangle=vo,exports.DateUtils=El,exports.DefaultTaskPaneRegistry=Pn,exports.DocThemesContext=Nn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Nn.Provider,{value:t,children:n})},exports.EditableLabel=Kr,exports.EmptyFrame=vi,exports.FilterButton=kr,exports.FontUtils=Fl,exports.Item=zo,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=Dr,exports.MovableArea=jr,exports.PictureEditor=Ur,exports.Row=yl,exports.ScriptEditor=Wa,exports.SheetCellEditor=Tr,exports.SheetCellRenderer=Mr,exports.SheetElement=Vr,exports.SheetScrollbar=Mo,exports.StaticBorderRenderer=Hl,exports.StyledStrokePath=Er,exports.Tab=Cl,exports.TabStrip=wl,exports.TaskPaneArea=Zl,exports.TaskPaneProvider=({children:e,createArea:t,onUpdateArea:n,registry:l=Pn})=>{const a=o.useRef(null),i=o.useRef(null),[f,m]=o.useState(null),[s,v]=o.useState(null),b=o.useMemo(()=>({activateTaskPane(g,k){i.current!==g&&(a.current?a.current.activateTaskPane(g,k):(m(g),y(g)))}}),[]),y=r.useCallbackRef(g=>{const k=t({registry:l,onClose:()=>{v(null),n?.(null)}},x=>{x&&v(x)});return n?.(k),k},[t,l,f]);return o.useEffect(()=>{s&&f&&(s.activateTaskPane(f,{autoFocus:!0}),m(null))},[f,s]),o.createElement(zr.Provider,{value:s??b},e)},exports.TaskPaneStrip=ko,exports.TaskPaneTitle=Ro,exports.createCellEditStateFromCell=Ir,exports.useBordersOverlay=So,exports.useDocThemes=()=>{const e=o.useContext(Nn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Or,exports.useRangeListener=(e,t,n,l)=>{const a=o.useRef(n);a.current=n;const i=l?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const s={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(s)}const f=s=>{a.current?.(s)},m=e.getRange(t).addListener(f,l);if(i){const s=e.getRange(t);f({getSource:()=>s,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Lr,exports.useSheetCopyPaste=Pr,exports.useTaskPaneArea=Nr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
|
33
|
+
`,g=!0));const k=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${b}`}];let x=null;i.pushEditOperations([],k,E=>(x=E[0].range,y&&x.startLineNumber++,g&&x.endLineNumber--,[new t.Selection(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn)])),e.setSelection({startLineNumber:x.endLineNumber,startColumn:x.endColumn,endLineNumber:x.startLineNumber,endColumn:x.startColumn})};function Oa(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function bo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,f=e.getPositionAt(l);a.push({name:i.text,type:Oa(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)bo(e,t,n,l,a);return a}function Do(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const m=a[f];if(m.start<=t&&t<m.start+m.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const s of e.childItems||[]){const v=Do(s,t,n,i);if(v)return v}}return null}}function Ba(e){return e.kind==="comment"}const Ha=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:m,autoFocus:s=!0,frame:v,onStatusChange:b,...y}=e,g=o.useRef(null),k=o.useRef(!1),x=o.useMemo(()=>({contains(Y){if(!g.current)return;const Z=g.current.editor;return Z&&Z.getDomNode()?.contains(Y)},focus(){if(!g.current)return;const Y=g.current.editor;return Y&&Y.getDomNode()?.focus()}}),[]),E=o.useMemo(()=>[new r.Command("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),z=o.useMemo(()=>{let Y=null;const Z=()=>x;return Y=a?a.createChildGroup(Z,"scriptEditor",!1):new r.CommandGroup(Z,"scriptEditor"),Y.addCommands(E,!0),Y},[a,E]),W=a.getGroup("workbook"),V=r.useCommands(W,["executeSelectedScript","saveScripts"]),R=V[0],P=V[1],p=R?.context(),[F,M]=o.useState({message:"Loading",cursor:"",dirty:!1}),[H,N]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),B=r.useCallbackRef(Y=>{M(Z=>{const de={...Z,...Y};return me.CommonUtils.deepEqual(de,Z)?Z:(P.update({disabled:!de.dirty}).updateCallback(async()=>{await $()}),de)})},[b,P]);o.useEffect(()=>{b?.(F)},[b,F]);const $=r.useCallbackRef(async()=>{if(!g.current)return;const Y=g.current.editor;let Z;if(F.dirty){const de=Y.getValue();await p?.saveSource(de),Z=p?.getScripts().getModules().getByName("scripts");const Ie=Z?.getSource(),ye=Y.getValue(),U=(Ie?.length??0)!==de.length||Ie!==ye;B({dirty:U})}else Z=p?.getScripts().getModules().getByName("scripts");return Z},[F]);o.useEffect(()=>{const Y=v?.addListener({onBeforeHide:async()=>(await $(),!0)});return()=>{Y?.()}},[v]),o.useEffect(()=>{const Y=p?.getScripts();if(Y)return Y.addListeners({onBeforeSearch:()=>$()})},[p]);const ce=r.useCallbackRef(Y=>{R?.execute(Y)},[R]),_=o.useRef(""),[K,L]=o.useState(!1),I=r.useCallbackRef(async()=>{if(!g.current)return null;const Y=g.current,Z=Y.editor;if(!Z)return null;const de=Y.monaco,Ie=await(async(ye,U,te="export")=>{const ge=ye.getModel();if(!ge)return null;const le=await U.languages.typescript.getTypeScriptWorker(),Ee=await le(ge.uri),ie=await Ee.getNavigationTree(ge.uri.toString());let pe=null,De=ye.getSelection();if(!De)return null;const xe=De.startLineNumber===De.endLineNumber&&De.startColumn===De.endColumn?ge.getLineCount():Math.min(De.endLineNumber,ge.getLineCount());for(let Oe=De.startLineNumber;!pe&&Oe<=xe;Oe++){const Be=Do(ie,ge.getOffsetAt({lineNumber:Oe,column:1}),"function",te);Be&&(pe=Be.text)}return pe})(Z,de);return B({message:(Ie??"").toUpperCase()}),Ie?{source:Z.getValue(),name:Ie}:null},[]);r.useCallbackRef(me.CommonUtils.debounce($,200),[]);const q=r.useCallbackRef(async(Y,Z,de)=>{N(ye=>({...ye,compiling:!0}));const Ie=await p?.getScripts().createModule({source:de?.getValue(),declarationsOnly:!0});Ie&&((async function(ye,U){const te=[];for(let ge=1;ge<ye.getLineCount()+1;ge++){const le={startLineNumber:ge,startColumn:1,endLineNumber:ge,endColumn:ye.getLineLength(ge)+1},Ee=ye.getValueInRange(le).indexOf("modelt");Ee!==-1&&te.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:le.startLineNumber,startColumn:Ee+1,endLineNumber:le.startLineNumber,endColumn:Ee+5})}U.editor.setModelMarkers(ye,"owner",te)})(Y,Z),(async function(ye,U,te,ge){const le=await U.languages.typescript.getTypeScriptWorker(),Ee=await le(ye.uri),ie=await Ee.getNavigationTree(ye.uri.toString()),pe=bo(ye,U,ge,ie).map(De=>{let xe=null,Oe=null;return De.type==="formula"?(xe="formula.margin-icon",Oe="Formula"):De.type==="macro"?(xe="macro.margin-icon",Oe="Macro"):De.type==="autoRun"&&(xe="autorun.margin-icon",Oe="Auto Run"),{range:new U.Range(De.lineNumber,1,De.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:{value:Oe},stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ze.current&&ze.current.clear(),ze.current=te.createDecorationsCollection(pe)})(Y,Z,de,Ie?Ie.getFunctions().getItems():me.CommonUtils.EmptyArray),N(ye=>({...ye,compiling:!1})))},[p]),O=r.useCallbackRef(me.CommonUtils.debounce(q,580),[]),Q=r.useCallbackRef(async(Y=void 0)=>{if(!g.current||!p)return;const Z=g.current.editor.getPosition(),de={cursor:Z?Z.toString():""};Y!==void 0&&(de.message=Y),B(de);const Ie=I();p.setSelectedFunction(Ie)},[p]);o.useEffect(()=>{},[H]);const re=o.useRef(null),be=r.useCallbackRef(async()=>{await $(),v?.close()},[v]);o.useEffect(()=>{if(!p)return;const Y={insertSnippet:de=>{g.current?.editor&&xr(g.current.editor,g.current.monaco,de)},close:()=>be()};p.setEditor(Y),p.setSelectedFunction(I());const Z=p.addContainerListener({onBeforeSave:async()=>{$()},onReadonlyChange(){},onScriptChange:async()=>{if(!g.current?.editor||!p)return;const de=g.current.editor,Ie=p.getScripts().getModules().getItems()[0]?.getSource()??"";de.setValue(Ie)}});return()=>{p.setEditor(null),Z()}},[p]),o.useEffect(()=>()=>{const Y=re.current;if(Y){Y.dispose();const Z=Y.debounceTimer;Z!==void 0&&clearTimeout(Z),re.current=null}},[K]);const he=r.useCallbackRef(Y=>{const Z=g.current?.editor;return!!Z&&(Z.focus(Y),!0)},[F]),ze=o.useRef(null),Pe=r.useCallbackRef((Y,Z)=>{g.current={monaco:Z,editor:Y},L(!0),Q("Loading Types");const de=p?.getScripts().getModules().getItems()[0]?.getSource()??"";Y.setValue(de),Promise.resolve().then(()=>require("./BT91Yv7BVJbUjPkz.cjs")).then(ye=>ye.customEditor).then(async ye=>{Q(""),ye.AutoTypings.create(Y,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:Z,onUpdate:(U,te)=>{if(U.type==="LookedUpPackage"&&U.success!==void 0){const ge=Z.languages.typescript.typescriptDefaults.getDiagnosticsOptions();Z.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ge,diagnosticCodesToIgnore:[]})}},onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(U=>{re.current=U;const te=Y.getModel();O(te,Z,Y),(()=>{if(br)return;const ge=(Ee,ie)=>{try{if(ie===void 0)try{delete globalThis[Ee]}catch{try{globalThis[Ee]=void 0}catch{}}else globalThis[Ee]=ie}catch{}},le=Lt.length;for(let Ee=0;Ee<le;Ee++){const ie=Lt[Ee];ge(ie,an[ie])}an=void 0,br=!0})()})}),Y.addCommand("executeScript",function(ye,...U){U?.[0]&&ce({functionName:U?.[0]})},""),Y.addAction({id:"executeScript",label:"Execute",keybindings:[Z.KeyCode.F8],run:async ye=>{const U=I();p?.setSelectedFunction(U);const te=await U;ce(te)}}),Y.addAction({id:"saveScript",label:"Save Script",keybindings:[Z.KeyMod.CtrlCmd|Z.KeyCode.KeyS],run:ye=>{$()}}),Y.onMouseDown(async ye=>{if(ye.target.type===Z.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=ye.target.position.lineNumber,te=await Z.languages.typescript.getTypeScriptWorker(),ge=await te(Ie.uri),le=await ge.getNavigationTree(Ie.uri.toString()),Ee=(await $()).getFunctions().getItems(),ie=bo(Ie,Z,Ee,le).find(pe=>pe.lineNumber===U);if(ie){const pe=ye.event.browserEvent.button;pe===0?ie.type==="macro"||ie.type==="autoRun"?ce({functionName:ie.name}):ie.type==="formula"&&p?.quickInsertFunction?.(ie.name):pe===2&&(console.log("Context menu for function:",ie.name),ye.event.browserEvent.preventDefault())}}}),Y.onDidChangeModelContent(()=>{B({dirty:!0}),O(Ie,Z,Y)}),Z.editor.onDidChangeMarkers(ye=>{ye.some(U=>U.toString()===Ie.uri.toString())});const Ie=Y.getModel();(function(ye,U){U.languages.registerInlayHintsProvider("typescript",{provideInlayHints(te,ge,le){const Ee=[];for(let ie=1;ie<te.getLineCount()+1;ie++){const pe={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:te.getLineLength(ie)+1},De="hint",xe=te.getValueInRange(pe).indexOf("hint");xe!==-1&&Ee.push({kind:U.languages.InlayHintKind.Type,position:{lineNumber:pe.startLineNumber,column:xe+De.length+1},label:"[hint]"})}return{hints:Ee,dispose:()=>{}}}})})(0,Z),Ie.onDidChangeContent(ye=>{const U=p?.getScripts().getModules().getByName("scripts"),te=U?.getSource(),ge=Y.getValue(),le=(te?.length??0)!==ge.length||te!==ge;B({dirty:le})}),Y.onDidChangeCursorPosition(ye=>{Q()})},[p]),ve=o.useMemo(()=>K?null:m||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[K,m]),Re=o.useMemo(()=>{if(!K){if(!an){an={};const Z=Lt.length;for(let de=0;de<Z;de++){const Ie=Lt[de];an[Ie]=globalThis[Ie]}}if(sn){const Z=Lt.length;for(let de=0;de<Z;de++){const Ie=Lt[de];globalThis[Ie]=sn[Ie]}}}const Y=p?.getScripts().getModules().getByName("scripts")?.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(Pa,{theme:f?"extended-dark":"extended",options:{...La,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:Y,onValidate:Z=>{let de=!1;const Ie=Z?Z.length:0;for(let ye=0;!de&&ye<Ie;ye++)Z[ye].severity===8&&(de=!0)},beforeMount:Z=>{Z.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),Z.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),Z.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),Z.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let de=!1,Ie=!1;try{const ye=await(async()=>await(await fetch(ja)).text())(),U=Z.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let te=Z.editor.getModel(U);te?Ie=!0:te=Z.editor.createModel(ye,"typescript",U),Z.editor.setModelMarkers(te,"default",[]),de=!0}catch(ye){console.warn("cant load types",ye)}if(Z.languages.registerLinkProvider("*",{provideLinks:(ye,U)=>{const te=[],ge={links:te},le=ye.getLinesContent(),Ee=le.length;for(let ie=1;ie<=Ee;ie++){const pe=le[ie-1],De=Z.editor.tokenize(pe,"typescript"),xe=De[0].length;for(let Oe=0;Oe<xe;Oe++){const Be=De[0]?.[Oe];if(Be&&Be.type.startsWith("string")){let C=Be.offset,je=De[0]?.[Oe+1]?.offset??pe.length,tt=new Z.Range(ie,C+1,ie,je+1),ee=ye.getValueInRange(tt);const ke=ee[0];ke!=="`"&&ke!=="'"&&ke!=='"'||(C++,ee=ee.substring(1));const Ne=ee[ee.length-1];Ne!=="`"&&Ne!=="'"&&Ne!=='"'||(C++,ee=ee.substring(0,ee.length-1));try{p.getRanges(ee)&&te.push({range:{endColumn:je,endLineNumber:ie,startColumn:C,startLineNumber:ie},tooltip:`Goto range '${ee}'`,url:`/range/${ee}`})}catch(Ae){console.warn(Ae)}}}}return ge}}),Z.editor.registerLinkOpener({open(ye){if(ye?.path?.startsWith("/range/")){try{p.getRanges(ye.path.substring(7))?.select()}catch(U){console.warn("invalid range",U)}return!0}return!1}}),!Ie){const ye=Z.languages.typescript.typescriptDefaults.getCompilerOptions();Z.languages.typescript.typescriptDefaults.setCompilerOptions({...ye,target:Z.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:Z.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(_.current&&(await xr(g.current.editor,g.current.monaco,_.current),_.current=null),k.current&&requestAnimationFrame(async()=>{k.current&&Z.editor.focus()}),!sn){sn={};const ye=Lt.length;for(let U=0;U<ye;U++){const te=Lt[U];sn[te]=globalThis[te]}}})()},onMount:Pe})}),ve]})},[p,z,l,ve,f]),We=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:Y=>{he(Y)},close:()=>be(),getEditor:()=>p?.getEditor()}),[p]);return o.useEffect(()=>(s&&requestAnimationFrame(()=>{We.current?.focus()}),()=>{g.current?.editor&&requestAnimationFrame(()=>{We.current?.contains(document.activeElement)&&We.current?.focus()})}),[]),c.jsx("div",{className:dt("script-editor",Na,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:We,...y,children:Re})})),Va=Object.freeze(Object.defineProperty({__proto__:null,FindScopeOptions:{Workbook:"workbook",Sheet:"sheet"}},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.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=bi,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=Va,exports.CornerTriangle=fo,exports.DefaultTaskPaneRegistry=Ln,exports.DocThemesContext=zn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(zn.Provider,{value:t,children:n})},exports.EditableLabel=Hr,exports.EmptyFrame=gi,exports.FilterButton=qr,exports.Item=Ao,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=Er,exports.MovableArea=Nr,exports.PictureEditor=Br,exports.Row=pl,exports.ScriptEditor=Ha,exports.SheetCellEditor=Rr,exports.SheetCellRenderer=Sr,exports.SheetElement=Or,exports.SheetScrollbar=Ro,exports.StaticBorderRenderer=Ll,exports.StyledStrokePath=Mr,exports.Tab=fl,exports.TabStrip=vl,exports.TaskPaneArea=Kl,exports.TaskPaneProvider=({children:e,createArea:t,onUpdateArea:n,registry:i=Ln})=>{const a=o.useRef(null),l=o.useRef(null),[f,m]=o.useState(null),[s,v]=o.useState(null),b=o.useMemo(()=>({activateTaskPane(g,k){l.current!==g&&(a.current?a.current.activateTaskPane(g,k):(m(g),y(g)))}}),[]),y=r.useCallbackRef(g=>{const k=t({registry:i,onClose:()=>{v(null),n?.(null)}},x=>{x&&v(x)});return n?.(k),k},[t,i,f]);return o.useEffect(()=>{s&&f&&(s.activateTaskPane(f,{autoFocus:!0}),m(null))},[f,s]),o.createElement(Fr.Provider,{value:s??b},e)},exports.TaskPaneStrip=So,exports.TaskPaneTitle=qo,exports.createCellEditStateFromCell=kr,exports.useBordersOverlay=xo,exports.useDocThemes=()=>{const e=o.useContext(zn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=et,exports.useMovableCommands=Lr,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 s={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(s)}const f=s=>{a.current?.(s)},m=e.getRange(t).addListener(f,i);if(l){const s=e.getRange(t);f({getSource:()=>s,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Dr,exports.useSheetCopyPaste=zr,exports.useTaskPaneArea=Ar,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|