@sheetxl/react 0.7.25 → 0.7.27
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/{CpAymN_r66WNSGto.cjs → DNki9dGbSn_gUfd3.cjs} +1 -1
- package/browser/cjs/{bkd9NqdKNyW3PgiL.cjs → Da611GSWMp5ncOGO.cjs} +1 -1
- package/browser/cjs/{gO4-IM2G3htj8EhV.cjs → F8ZECny0CwW2OV5X.cjs} +1 -1
- package/browser/cjs/index.cjs +16 -16
- package/browser/esm/{yQlUSiMKgCRHLXMR.mjs → BYGSBjns_83FWXAx.mjs} +1 -1
- package/browser/esm/{Qh6oFvYGT3BsYrwP.mjs → CmObbQiLq9AAM7-q.mjs} +1 -1
- package/browser/esm/{BpnM0ZfOTJChgXJl.mjs → Daa2g2QALCIHFgqP.mjs} +1 -1
- package/browser/esm/index.mjs +2648 -2648
- package/node/esm/{CNOJ8jvNTSRVp4vY.mjs → Bu9xI_rgkuupQ2AO.mjs} +1 -1
- package/node/esm/index.mjs +28 -28
- package/package.json +5 -5
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.27
|
|
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"),s=require("react/jsx-runtime"),he=require("@sheetxl/utils"),r=require("@sheetxl/utils-react"),o=require("react"),gt=require("@sheetxl/grid-react"),Kt=require("react-dom"),uo=o.memo(e=>{const{anchorLocation:t=he.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:h,propsPath:c,style:C,...k}=e,y=a,p=l;let M="red",T=[],z=[];return t===he.AnchorLocation.TopLeft?(M=f?"rgb(255, 198, 246)":"green",T.push(p),z.push(p),T.push(p+y),z.push(p),T.push(p),z.push(p+y)):t===he.AnchorLocation.TopRight?(M=f?"rgb(0, 255, 255)":"red",T.push(n-p),z.push(p),T.push(n-(p+y)),z.push(p),T.push(n-p),z.push(p+y)):t===he.AnchorLocation.BottomRight?(M=f?"rgb(236, 252, 211)":"purple",T.push(n-p),z.push(i-p),T.push(n-(p+y)),z.push(i-p),T.push(n-p),z.push(i-(p+y))):t===he.AnchorLocation.BottomLeft&&(M=f?"rgb(255, 236, 183)":"blue",T.push(p),z.push(i-p),T.push(p+y),z.push(i-p),T.push(p),z.push(i-(p+y))),s.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...C},...k,children:s.jsx("path",{d:`M ${T[0]} ${z[0]} L ${T[1]} ${z[1]} L ${T[2]} ${z[2]} L ${T[0]} ${z[0]} Z`,fill:h??M,...c})})}),dr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:h,...c}=e,C=o.useMemo(()=>{let M=null;const T=l.getSortField();T&&(M=T.reverse);const z=l.getField(),D=z&&z.criteria&&z.criteria.length>0;return M===!0?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":M===!1?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 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]),[k,y]=o.useState(!1),p=Math.min(Math.min(18,t.height-8),t.width);return s.jsx("div",{style:{width:`${p}px`,height:`${p}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${k&&!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:(p>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...h},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:M=>{f?.(M,l),M.preventDefault()},...c,children:s.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${k&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:s.jsx("path",{d:C})})})},ur=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:h=1,view:c,bodyStyle:C,normalStyle:k,showFormulas:y,showZeros:p,docTheme:M,onLinkMouseDown:T,onFilterButtonMouseDown:z,propsFilterButton:D,renderFilterButton:Z=dr,...K}=e,w=i.height/h,N=i.width/h,v=t,I=v.getValue(),q=t.getStyle(),X=C?.darkMode??!1;let E,j;const $=I&&I.isFormulaError,ve=$&&I instanceof d.FormulaError.Parse;let Y,_=y||ve;if(_)if(v.isSpillOverflow())j="";else{const le=v.getFormulaText();le?j=le:E=v.getNumberFormat(d.NumberFormat.Type.General)}else E=v.getNumberFormat();_||(Y=v.getTextOverflow());const A=Y?Y.colBounds.width+Y.leftOffset+Y.rightOffset:N,J=Y?Y.anchorBounds.x-Y.leftOffset:0,x=Y?Y.anchorBounds.width:N,S=Y?Y.anchorBounds.x:0;let oe,ie=v.getRenderHorizontalAlignment();E&&(oe=E?.formattedRuns,j=oe?.runs[0]?.text??E.displayText);const qe=v.getCalcStatus()===d.ICell.CalcStatus.Pending;let de=null,Pe=q.getFill().toCSS(X,i),je=0,De=0;if(!q.getBorder().isEmpty()){const le=q.getBorder().getRight();!le.isNone()&&d.IBorder.BuiltInDefinitions.get(le.getStyle()).width>1&&(je=1);const b=q.getBorder().getBottom();!b.isNone()&&d.IBorder.BuiltInDefinitions.get(b.getStyle()).width>1&&(De=1)}let Ie=null;if(N!==x||je||De||typeof Pe?.backgroundPosition=="number"){const{backgroundPosition:le,...b}=Pe,B=le??0,R=c?.getScrollTopLeft(),P=B?-(i.x+(R.left??0))%B:0,ce=B?-(i.y+(R.top??0))%B:0;(le!==void 0||je||De||N!==x)&&(Object.keys(b).length===1&&b.background==="none"||(Pe=null,Ie=s.jsx("div",{className:"fill",style:{marginLeft:`${P}px`,marginTop:`${ce}px`,left:S*h,width:r.ReactUtils.boundPixel(x*h-P+1+je),height:r.ReactUtils.boundPixel(i.height-ce+1+De),...b}},"background")))}let ke=null;const ge=v.getComments(),O=v.getWarnings(),Fe=v.getErrors();if(ge||$||Fe.length>0||O.length>0){const le={size:7*h,darkMode:X,cellWidth:x*h+2,cellHeight:w*h+2,style:{top:-1,left:S*h-1}};ke=ke??[],(O.length>0||Fe.length>0||$)&&ke.push(s.jsx(uo,{anchorLocation:he.AnchorLocation.TopLeft,...le},`indicator-${ke.length}`)),ge&&ke.push(s.jsx(uo,{anchorLocation:he.AnchorLocation.TopRight,...le},`indicator-${ke.length}`))}const ze=q.getFont();let H=E?.conditionalColor;const W=q.getAlignment(),me=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ue=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||me,fe=ue||_?0:W.getRotation(),Me=v.getInsets(),ae=Me.top+Me.bottom;let be=Me.left,g=Me.right;const Ne={...l,left:l.left-1,top:l.top-1,width:l.width+1+je,height:l.height+1+De},Be=v.getColumnFilter(),Te=Be&&!Be?.hasHiddenButton();let u=null;qe&&(u=s.jsxs("div",{className:"slider",children:[s.jsx("div",{className:"line"}),s.jsx("div",{className:"subline inc"})]},"pending"));const L=!(qe||Te||Ie||a||ke||oe?.runs.length>1||Y||fe%360!=0);Pe?.background==="none"&&(Pe=null);let U=ue||!(!Y||!(Y.rightIndex>0||Y.leftIndex>0||Y.colSpan>1));if(!U){const le=v.getSpans();(le.width>1||le.height>1)&&(U=!0)}const m={...Pe,...Ne,pointerEvents:T?"auto":void 0};if(!he.CommonUtils.isEmpty(j)||!he.CommonUtils.isEmpty(E?.repeatPlaceholder)){const le=E?.canWrap??!1;let b=null,B=null,R=null,P=[],ce=!0;p||_||I!==0||(ce=!1);const se=v.getTextFrame(_);if(ce&&se){let ye=A-1-(be+g);if(fe){b=se.layout().bounds;const He={x:0,y:0,width:A-1,height:w};if(oe){let Ce=oe.width;if(E.repeatPlaceholder||E.repeatChars.length>0){const Ae=d.GeomUtils.boundsToPoints(He),we=d.GeomUtils.rotatePoints(Ae,-fe);Ce=d.GeomUtils.minBoundingRect(we).width}b={...b,width:Ce}}R=d.GeomUtils.clipToOuterRect({...b,width:b.width+1+be+g},He,fe),ye=R.width-1-(be+g)+.01}let ee=null;le&&(ee={width:ye});let pe=null,V=E?.repeatPlaceholder;const Q=se.layout(ee);if(b=Q.bounds,_?b={...b,width:0}:oe&&(b={...b,width:E.repeatPlaceholder||E.repeatChars.length>0?ye:oe.width}),fe&&le){let xe=null;Q.visitLines({visitTextLine:(He,Ce)=>{let Ae=He.bounds;const we=d.GeomUtils.boundsToPoints(Ae),Se=d.GeomUtils.rotatePoints(we,fe),Le=d.GeomUtils.minBoundingRect(Se);Ae={...Ae,x:(Le.width-Ae.width)/2,y:(Le.height-Ae.height)/2},xe=xe?d.GeomUtils.unionBounds(xe,Ae):Ae}}),b={...xe,width:xe.width+be+g}}if(!V&&v.getType()!==d.ScalarType.String&&Math.floor(b.width)>ye){if(q.getNumberFormat()==="General"&&v.getType()===d.ScalarType.Number){const xe=q.measureText("0"),He=Math.floor(ye/xe.width),Ce=I,Ae=he.CommonUtils.splitNumber(Ce),we=Math.min(10,He-(Math.max(1,Ae.ipLength)+1)-(Ce<0?1:0));if(we>=-1){const Se=`0${we>0?".":""}${"#".repeat(Math.max(0,we))}`;pe=v.getNumberFormat(Se).displayText,pe==="0"&&Ce<0&&(pe="-0")}else if(Math.abs(Ce)>=Math.pow(10,5)||Math.abs(Ce)<=Math.pow(10,-5)){const Se=He-5-(Ce<0?1:0);if(Se>=0){const Le=`0.${"0".repeat(Math.max(0,Se-1))}E+00`;pe=v.getNumberFormat(Le).displayText}}}pe||(V="#")}if(!V&&oe?.lastRepeatIndex>=0&&oe?.width>ye&&(V="#"),V&&ye>0){const xe=q.measureText(V),He=Math.floor((ye||1)/(xe?.width||1));pe=He>0?V.repeat(He):"",ie=d.ITextFrame.HorizontalAlignment.Center}if(_&&(ie=d.ITextFrame.HorizontalAlignment.Left),pe){const xe=q.measureText(pe).width;xe&&(b={...b,width:xe})}if(B={...b,width:b.width+be+g,height:b.height},fe&&!le){const xe=d.GeomUtils.boundsToPoints(B),He=d.GeomUtils.rotatePoints(xe,fe),Ce=d.GeomUtils.minBoundingRect(He);B.width=Ce.width,B.height=Ce.height}ie===d.ITextFrame.HorizontalAlignment.Center||ie===d.ITextFrame.HorizontalAlignment.CenterContinuous?B.x=(A-B.width)/2:ie===d.ITextFrame.HorizontalAlignment.Right?B.x=A-B.width-.5:B.x=.5,W.getVertical()===d.ITextFrame.VerticalAlignment.Center?B.y=(w-B.height)/2:W.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?B.y=w-B.height-ae:B.y=ae;const re=L?{...K}:void 0,Ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:fe?`rotate(${fe}deg)`:void 0,cursor:T?"pointer":void 0,pointerEvents:T?"auto":void 0,zIndex:U?1:void 0,...Pe},onMouseDown:T,onDoubleClick:T?xe=>{xe.stopPropagation(),xe.preventDefault()}:null,...re};ve&&(Ee.style.textDecorationStyle="wavy",Ee.style.textDecorationColor=X?"rgb(0, 255, 255)":"red",Ee.style.textDecorationLine="underline");const Ue=ze.getSize(),Oe=(xe,He,Ce,Ae,we,Se,Le,Ze=null)=>{let _e=Ue*h,Xe=Ce,at=Le?.runs?Le.runs:[{type:d.NumberFormat.ParseRunType.Text,text:xe,width:q.measureText(xe,_e).width}];Le&&Le?.width!==b.width&&(b={...b,width:Le?.width});let ot=be;if(Le?.lastRepeatIndex>=0&&ye>Le?.width){const Je=Le.runs[Le.lastRepeatIndex];if(Je){const st=[...at],wt=Math.max(0,ye-1-Le.width);let bt=0,dt="";if(wt>0){const ft=Math.floor(wt/Je.width);dt=ft>0?Je.text.repeat(ft):"",bt=wt}st[Le.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:dt,width:bt},at=st,b={...b,width:Le.width+bt}}}const $e=(Je,st,wt,bt,dt,ft,xt,Un,Yt,fn=null)=>{let Pt,jt=Xe.width;we===d.ITextFrame.HorizontalAlignment.Justify?(jt=dt,Se||(Pt="justify")):we===d.ITextFrame.HorizontalAlignment.Distributed&&(jt=dt,Pt=Se||Je.text.split(" ").length-1==0?"center":"justify");const{style:It,className:pt,...pn}=fn;let Bt=Je.text;if(we===d.ITextFrame.HorizontalAlignment.Fill&&E?.repeatChars.length===0){const ut=Math.max(1,Math.floor((Xe?.width??0)/(xt?.width??1)));Bt=Bt.repeat(ut)}let Mt=Xe.height;const At=ze.getVerticalAlignment(),Jt=At===d.IFont.VerticalAlignment.Sub,Kn=At===d.IFont.VerticalAlignment.Super;if(Jt||Kn){const ut=ze.getSuperSubScale();_e*=ut,Mt*=ut}const et={textAlign:Pt,textAlignLast:Pt,...It,...ze.toCSS(X,h,!0),fontSize:_e*d.IFont.getDeviceScale()};L||(et.background=void 0),H&&(et.color=H.toCSS(X));const Qt=ot+st;let Ot=Me.top+Xe.y+0;if(Jt&&(Ot+=Yt-_e),ft){const ut=(xt.x+Qt)*h+1,vt=(xt.y+Ot)*h+1;vt<0?et.marginTop=vt:et.paddingTop=vt,ut<0?(et.width=(It?.width??0)-ut,et.left=(It?.left??0)+ut):et.paddingLeft=ut,et.paddingRight=Math.max(0,(It?.width??0)-jt*h-ut),et.paddingBottom=Math.max(0,(It?.height??0)-Xe.height*h-vt),et.height=(It?.height??0)+(vt<0?-vt:0),(vt<0||ut<0)&&(et.clipPath=`inset(${vt<0?-vt:0}px 0px 0px ${ut<0?1-ut:0}px)`)}else if(et.left=(xt.x+Qt)*h+1,et.top=(xt.y+Ot)*h+1,et.width=xt.width*h,et.height=xt.height*h,fe&&!le){et.left=(xt.x+st)*h+1,et.top=(xt.y+(Xe.y+0))*h+1;const ut=d.GeomUtils.centerPoint({x:ot+st,y:0,width:Je.width,height:Xe.height}),vt=d.GeomUtils.centerPoint({x:ot,y:0,width:dt,height:Xe.height}),Cn=d.GeomUtils.rotatePoints([ut],fe,vt),en={x:Cn[0].x-ut.x,y:Cn[0].y-ut.y};et.left=et.left+en.x*h,et.top=et.top+en.y*h;const Dt={...Xe,x:ot,y:Me.top,width:Xe.width+(be+g)},$n=d.GeomUtils.boundsToPoints(Dt),Wn=d.GeomUtils.rotatePoints($n,fe),yn=d.GeomUtils.minBoundingRect(Wn);Dt.width=yn.width,Dt.height=yn.height;const Ht=d.GeomUtils.centerPoint(Dt),wn={x:Ht.x-vt.x,y:Ht.y-vt.y};et.left=et.left+wn.x*h,et.top=et.top+wn.y*h}et.lineHeight=Mt*h+"px";const vn=L?void 0:"text-line";P.push(s.jsx("div",{className:pt?`${pt} ${vn}`:vn,style:et,...pn,children:Bt},`text-${Xe.y}-${bt}-${wt}`))};if(W.getOverflow()===d.ITextFrame.Overflow.Shrink&&ye>0){let Je=b?.width??0,st=0;for(;Je>1&&Je>ye&&_e>2&&st<100;)_e*=ye/Je,Je=q.measureText(xe,_e).width,st++;b={...b,width:Je}}let lt=Xe.x;we===d.ITextFrame.HorizontalAlignment.Right?lt+=b.width-Xe.width:we!==d.ITextFrame.HorizontalAlignment.Center&&we!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(lt+=(b.width-Xe.width)/2),Le?.lastRepeatIndex>=0&&(lt=Xe.x);const it=at.length;for(let Je=0;Je<it;Je++){const st=at[Je];(st.type===d.NumberFormat.ParseRunType.Text||st.type===d.NumberFormat.ParseRunType.Repeat)&&(st.type,d.NumberFormat.ParseRunType.Repeat,$e(st,lt,Je,He,we===d.ITextFrame.HorizontalAlignment.Justify||we===d.ITextFrame.HorizontalAlignment.Distributed||Le?.lastRepeatIndex>=0?ye:Xe.width,L,{x:B.x+J,y:B.y,width:st.width,height:b.height},0,Ae,Ze)),lt+=st.width}};pe?Oe(pe,0,{x:0,y:0,...b},Q.lines[0].baseline,ie,!0,null,Ee):Q.visitLines({visitTextLine:(xe,He,Ce)=>{const Ae=xe.runs[0].text.replace(/\s+$/,""),we=He===Ce-1;let Se=ie===d.ITextFrame.HorizontalAlignment.Justify&&(we||xe.runs[0].text.endsWith(`
|
|
8
|
-
`))?d.ITextFrame.HorizontalAlignment.Left:
|
|
9
|
-
`+x.textValue.substring(se.selectionEnd);return Pe(ee),void _({start:se.selectionStart+1,end:se.selectionStart+1,direction:se.selectionDirection})}return void(Ie()&&p.getSelection().traverse(d.IRange.Orientation.Column,R))}if(b.which===r.KeyCodes.Tab)return b.preventDefault(),void(Ie()&&p.getSelection().traverse(d.IRange.Orientation.Row,R));let ye=null;switch(b.which){case r.KeyCodes.Left:ye=d.IRange.Direction.Left;break;case r.KeyCodes.Right:ye=d.IRange.Direction.Right;break;case r.KeyCodes.Up:ye=d.IRange.Direction.Up;break;case r.KeyCodes.Down:ye=d.IRange.Direction.Down}if(ye&&!(B||R||P||ce)&&!A.editMode)return void Ie();A.editMode&&(ye||hl.includes(b.which))&&b.stopPropagation()},[A,p,x]),O=o.useCallback(()=>{S.current?.focus(),setTimeout(()=>{S.current?.select()},0)},[]),Fe=o.useCallback(()=>{S.current?.focus(),console.log("implement toggleRelativeReferences")},[]),ze=r.useCallbackRef(()=>{const b=S.current?.value;let B="";if(y.rowIndex>0){const R=p.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();R&&(B=R.toTextUnformatted(!0))}Pe(b+B)},[y,p]);o.useEffect(()=>p.getRange(y).addListener(()=>{const b={...A,clean:()=>p.getRange(y).getCell()};J(b),de?.(b)}),[y,p,A]);const H=o.useCallback(()=>{const b=A.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();Pe((S.current?.value??"")+b)},[p]),W=o.useCallback(()=>{const b=A.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();Pe((S.current?.value??"")+b)},[p]),me=o.useMemo(()=>({element:()=>S.current,doCopy:b=>{const B=S.current.value.substring(S.current.selectionStart,S.current.selectionEnd);if(b?.isCut){const R=S.current.value.substring(0,S.current.selectionStart)+S.current.value.substring(S.current.selectionEnd,S.current.value.length);Pe(R)}return B}}),[S.current]),ue=o.useMemo(()=>({element:()=>S.current,doPaste:async(b,B)=>{const R=await b.toText?.();if(!R)return!0;const P=S.current.value.substring(0,S.current.selectionStart)+R+S.current.value.substring(S.current.selectionEnd,S.current.value.length);return Pe(P),_({start:S.current.selectionStart+R.length,end:S.current.selectionStart+R.length,direction:"forward"}),!0}}),[S.current]),fe=o.useMemo(()=>({contains:b=>S.current?.contains(b)||!1,focus(){S.current.focus()}}),[]),Me=o.useMemo(()=>[new r.SimpleCommand("selectAll",fe,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},O),new r.SimpleCommand("startEditValueAbove",fe,{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]}]},ze),new r.SimpleCommand("startEditCurrentTime",fe,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},H),new r.SimpleCommand("startEditCurrentDate",fe,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.Command("relativeReferencesToggle",fe,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Fe),new r.Command("toggleEditorFocus",fe,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ae=o.useMemo(()=>{let b=null;const B=()=>({contains:R=>S.current?.contains(R)||!1,focus(){S.current.focus()}});return b=M?M.createChildGroup(B,"editor",!1):new r.CommandGroup(B,"editor"),b.addCommands(Me,!0),b},[M,Me]),be=o.useMemo(()=>({notifier:null,source:me,target:ue,commands:ae}),[me,ue,ae]);r.useCopyPaste(be);const[g,Ne]=o.useState(!v);o.useEffect(()=>{Ne(!1)},[]);const Be=r.useCallbackRef(b=>{ve(!0),ae?.activate();const B=j.current;if(B!==!1){let R,P;const ce=S.current.value;Do(A,ce)&&(R=ce.length-1,P=ce.length-1),R=B?.start??R??ce.length,P=B?.end??P??ce.length,j.current=!1,_({start:R,end:P,direction:"forward"})}D?.(b)},[D,A]),Te=x.insets;let u=Te.left+1;const L=Te.left+Te.right+2-1,U=ie?.bounds.height??0;let m,F=Te.top;x.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?F=Math.max(0,(q-(Te.top+Te.bottom)-U)/2):x.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(F=Math.max(0,q-(Te.top+Te.bottom)-U)),N!==void 0&&ie?.lines[0]?.bounds&&(m=ie?.lines[0]?.bounds.height*N);const G=x.style.getFont();let te=G.getSize();G.isSuperSub()&&(te*=G.getSuperSubScale()),te*=d.IFont.getDeviceScale()*w;const le=C?G.toCSS(E,w):null;return s.jsx("div",{className:"sheet-cell-editor",onMouseDown:b=>{S.current&&document.activeElement!==S.current&&requestAnimationFrame(()=>{S.current.focus()})},ref:oe,...I,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...K},children:s.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:F*w,left:u*w,width:`calc(100% - ${L*w}px)`,maxWidth:`calc(100% - ${L*w}px)`,height:(m??U)*w,maxHeight:(m??U)*w},children:s.jsx("textarea",{spellCheck:"false",placeholder:x.placeholder,ref:S,value:x.textValue,disabled:g,readOnly:Z||p.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...le,fontSize:te?`${te}px`:"inherit",textAlign:x.textAlign,lineHeight:(ie?.lines[0]?.bounds.height??0)*w+"px",height:(ie?.bounds.height??0)*w,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:x.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Be,onBlur:()=>{ve(!1)},onSelect:b=>{},onChange:b=>{S.current&&!De.current&&(j.current=!1,Pe(b.target.value),x.textValue,b.target.value,b.target.selectionStart,b.target.selectionEnd,b.target.selectionDirection,_({start:b.target.selectionStart,end:b.target.selectionEnd,direction:b.target.selectionDirection}))},onMouseDown:b=>{$&&je(!0)},onKeyDown:ge})})})})),hr=(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:h=0,offsetY:c=0,isVertical:C=!1,...k}=e,y=K=>{let w=null;if(K&&n>0){w="";for(let N=0;N<K.length;N++)w+=K[N],N<K.length-1&&(w+=",")}return w},p=y(i);let M=p;a&&(M=y(a));let T=n,z=t,D=null;if(l){T=Math.floor(n/2);const K=T+T/2+1;let w=null;w=C?`M ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+K)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+K)}`,D=s.jsx("path",{strokeWidth:T,strokeDasharray:M,d:w,...k})}if(f){T=n/2;const K=T+T/2;let w=M,N=null;N=C?`M ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+K)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+K)}`,D=s.jsx("path",{strokeWidth:T,strokeDasharray:w,strokeDashoffset:"1",shapeRendering:"crispEdges",d:N,...k})}let Z=null;return Z=C?`M ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+T/2)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+T/2)}`,s.jsxs(s.Fragment,{children:[s.jsx("path",{strokeWidth:T,strokeDasharray:p,d:Z,...k}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Nt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ro(i,t),l=typeof a=="function";n.push(l?a:()=>ro(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ro(n,t)}},ml=function(){},fr=typeof window<"u",fl=fr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Wt=fr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(zo),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var c=h[0].contentRect,C=c.x,k=c.y,y=c.width,p=c.height,M=c.top,T=c.left,z=c.bottom,D=c.right;l({x:C,y:k,width:y,height:p,top:M,left:T,bottom:z,right:D})}})},[]);return fl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[ml,zo]},pl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,vl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Cl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:h=!1,isVertical:c=!1,intersections:C,layout:k}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const p=n[0],M=n[1],T=n[2],z=n[3];let D=1+(c?z-M:T-p),Z=0;const K=a.getColor().toRGBA(l).toString(),w=y.description.toLowerCase().includes("double");let N,v;const I=c?"rowStart":"colStart",q=c?"rowEnd":"colEnd",X=c?M:p;if(C?.length>0){const ve=C[0];if(ve?.range[I]===i[I]){const _=d.IBorder.BuiltInDefinitions.get(ve.stroke.getStyle());Z=Math.floor(_.width/2)}if(C[C.length-1]?.range[q]===i[q]){const _=d.IBorder.BuiltInDefinitions.get(C[C.length-1].stroke.getStyle());D=Math.floor(D+(_.width===2?0:_.width/2))}if(w){const _=c?"colStart":"rowStart",A=c?"colEnd":"rowEnd",J=c?k?.getRowOffset:k?.getColOffset;let x=0,S=0;N=[],v=[];const oe=C.length;for(let ie=0;ie<oe;ie++){const qe=C[ie];if(qe.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&J){const de=J(qe.range[I])-(X-Z);qe.range[_]<i[_]&&(N.push(de-x),x=de,N.push(1),x++),qe.range[A]>i[A]&&(v.push(de-S),S=de,v.push(1),S++)}}N.length>0&&x<D&&N.push(D-x),v.length>0&&S<D&&v.push(D-S)}}let E=c?-Math.floor(y.width/2):-Z,j=c?-Z:-Math.floor(y.width/2);const $=h&&y.width>2?-1:0;return s.jsx(mr,{offsetX:p+E+$,offsetY:M+j+$,length:D+Z,isVertical:c,stroke:K,width:y.width,dashArray:N??y.pattern,dashArrayAdditional:v,isDouble:w,isAngled:y.description.toLowerCase().includes("slant")},t)},Co=({getBorderAt:e,rendererBorder:t=Cl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const h=r.useCallbackRef(n,[n]);return{renderOverlay:o.useMemo(()=>C=>{const k=C.toClipBounds(C.getRangeCoordsBounds(),-3);if(!k)return;const y=h(C);if(y.length===0)return;const p=C.getVisibleColumnOffsets(),M=C.getVisibleRowOffsets();let T=[],z=[];const D=C.getVisibleColumns(),Z=C.getVisibleRows(),K=[],w=[],N=[],v=(Y,_,A,J,x,S,oe)=>{const ie={index:J,stroke:x,visibleIndex:A,edge:S,length:oe};Y[_]||(Y[_]=[]),Y[_].length>0&&Y[_][Y[_].length-1]?.index===J?Y[_][Y[_].length-1]=ie:Y[_].push(ie)},I=C.getVisibleRangeCoords(),q=y.length;for(let Y=0;Y<q;Y++){const _=y[Y],A=_.coords;if(!A)continue;const J=_?.range??{rowStart:A.rowIndex,colStart:A.colIndex,rowEnd:A.rowIndex,colEnd:A.colIndex};if(!he.CoordUtils.isRangesIntersect(J,I)&&!he.CoordUtils.isRangeWithinRange(J,I))continue;const x=A.colIndex,S=A.rowIndex,oe=p[x],ie=M[S];if(J.rowEnd!==J.rowStart){const ze=M[J.rowStart]?.spanIndex??-1,H=M[J.rowEnd]?.spanIndex??M[Z[Z.length-1]].spanIndex+1;T.push({...J,rowStart:ze,rowEnd:H})}if(J.colEnd!==J.colStart){const ze=p[J.colStart]?.spanIndex??-1,H=p[J.colEnd]?.spanIndex??p[D[D.length-1]].spanIndex+1;z.push({...J,colStart:ze,colEnd:H})}const qe=_.value,de=e(qe,Y);if(!de||de.isEmpty())continue;const Pe=de.getLeft(),je=de.getTop(),De=de.getRight(),Ie=de.getBottom();let ke=1,ge=1;if(!oe||!ie)continue;const O=oe.spanIndex,Fe=ie.spanIndex;Pe.isNone()||v(K,O,Fe,S,Pe,d.IBorder.Edge.Left,ke),je.isNone()||v(w,Fe,O,x,je,d.IBorder.Edge.Top,ge),De.isNone()||v(K,O+ge,Fe,S,De,d.IBorder.Edge.Right,ke),Ie.isNone()||v(w,Fe+ke,O,x,Ie,d.IBorder.Edge.Bottom,ge)}const X=(Y,_,A)=>{const J=[];return Y.forEach((x,S)=>{let oe=null;x.sort((qe,de)=>qe.visibleIndex-de.visibleIndex);const ie=x.length;for(let qe=0;qe<ie;qe++){const de=x[qe];if(!de?.stroke||_[S]===void 0&&_[S-1]===void 0)continue;let Pe=!1;if(A){const ke=T.length;for(let ge=0;!Pe&&ge<ke;ge++){let O=T[ge];O.colStart<=de.index&&O.colEnd>=de.index&&O.rowStart<S&&O.rowEnd>=S&&(Pe=!0)}}else{const ke=z.length;for(let ge=0;!Pe&&ge<ke;ge++){let O=z[ge];O.rowStart<=de.index&&O.rowEnd>=de.index&&O.colStart<S&&O.colEnd>=S&&(Pe=!0)}}if(Pe)continue;const je=de.stroke?.getColor(),De=je?je.toRGBA().toString():l,Ie=de.stroke.getStyle()+":"+De;(Ie!==oe?.key||oe&&oe.visibleIndex+1<de.visibleIndex)&&(oe&&J.push(oe),oe={key:Ie,index:_[S]??_[S-1]+1,visibleIndex:de.visibleIndex,edge:de.edge,stroke:de.stroke,from:de.index,to:de.index+de.length-1,intersections:[],length:1}),oe.to=de.index+de.length-1,oe.visibleIndex=de.visibleIndex}oe&&J.push(oe)}),J};T=T.sort(vl),z=z.sort(pl);const E=X(K,D,!1),j=X(w,Z,!0);if(E.length===0&&j.length===0)return null;const $=j.length;for(let Y=0;Y<$;Y++){const _=j[Y];let A=he.CommonUtils.findEqualOrGreater(E,_.from,x=>x.index),J=!1;for(;!J;){const x=E[A++];x&&x.index>=_.from&&x.index<=_.to+1&&x.from<=_.index&&x.to+1>=_.index&&(_.intersections.push({stroke:x.stroke,range:{rowStart:x.from,rowEnd:x.to+1,colStart:x.index,colEnd:x.index}}),x.intersections.push({stroke:_.stroke,range:{rowStart:_.index,rowEnd:_.index,colStart:_.from,colEnd:_.to+1}})),J=!x||x.index>_.to+1}}for(let Y=0;Y<$;Y++){const _=j[Y];let A=_.stroke;const J=`rBorder:${_.index}:${_.from}:${_.to}:${_.edge}`,x={rowStart:_.index,rowEnd:_.index,colStart:_.from,colEnd:_.to+1},S=C.getLayout(),oe=!1,ie=S.getColOffset(x.colStart),qe=S.getRowOffset(x.rowStart),de=[ie,qe,S.getColOffset(x.colEnd),qe];N.push(t({key:J,points:de,stroke:A,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:x,intersections:_.intersections,layout:S,isVertical:oe}))}const ve=E.length;for(let Y=0;Y<ve;Y++){const _=E[Y];let A=_.stroke;const J=`cBorder:${_.index}:${_.from}:${_.to}:${_.edge}`,x={rowStart:_.from,rowEnd:_.to+1,colStart:_.index,colEnd:_.index},S=C.getLayout(),oe=!0,ie=S.getColOffset(x.colStart),qe=[ie,S.getRowOffset(x.rowStart),ie,S.getRowOffset(x.rowEnd)];N.push(t({key:J,stroke:A,points:qe,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:x,intersections:_.intersections,layout:S,isVertical:oe}))}return s.jsx("svg",{width:`${k.width}`,height:`${k.height}`,viewBox:`0 0 ${k.width} ${k.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${k.width}px`,height:`${k.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:N},"borders")},[e,i])}},Lo=he.AnchorLocation.Center,yl=Object.freeze({horizontal:!1,vertical:!1}),No=he.TypesUtils.EmptyTopLeft,wl=(e,t)=>he.CoordUtils.EmptyCell,bl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),xl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:h,forceThinBorder:c,children:C,...k}=e,y=o.useRef(null),[p,{width:M,height:T}]=Wt(),z=n??M,D=i??T,Z=o.useMemo(()=>{const A=[];for(let J=0;J<l;J++)for(let x=0;x<f;x++){const S={colIndex:x,rowIndex:J};A.push({coords:S,value:S})}return A},[]),K=o.useCallback(A=>Z,[Z]),{renderOverlay:w}=Co({getVisibleCells:K,getBorderAt:t,darkMode:h,forceThinBorder:c}),N=Math.floor(z/f),v=Math.floor(D/l),I={getColOffset:A=>Math.ceil(A*N)+0,getRowOffset:A=>Math.ceil(A*v)+0,getColIndex:A=>Math.floor((A-0)/N)-1,getRowIndex:A=>Math.floor((A-0)/v)-1},q={rowStart:0,colStart:0,rowEnd:l,colEnd:f},X={x:0,y:0,width:Math.max(0,z)+0,height:Math.max(0,D)+0},E=o.useMemo(()=>{const A={},J=Math.floor(z/f);for(let x=0;x<f;x++)A[x]={offset:x*J,size:J,spanIndex:x};return A},[z,D]),j=o.useMemo(()=>{const A={},J=Math.floor(D/l);for(let x=0;x<l;x++)A[x]={offset:x*J,size:J,spanIndex:x};return A},[z,D]);if(!w)return null;const $={width:z,height:D},ve={width:z,height:D},Y={getStage:()=>y.current,getTotalSize:()=>$,getViewportSize:()=>ve,getLayout:()=>I,getCellCoordsAsRangeCoords:he.CoordUtils.cellToRange,getVisibleRangeCoords:()=>q,getVisibleRows:()=>{const A=[];for(let J=0;J<l;J++)A.push(J);return A},getTotalRangeCoords:()=>q,getRelativePointFromClient:(A,J)=>({x:A,y:J}),getVisibleColumns:()=>{const A=[];for(let J=0;J<f;J++)A.push(J);return A},toClipBounds:(A,J)=>X,toViewBounds:A=>A,toAbsoluteBounds:A=>A,getBounds:()=>X,getInsets:()=>null,getRangeCoordsBounds:(A,J)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>j,allViews:()=>({[Lo]:Y}),getAnchor:()=>Lo,getZoom:()=>1,scrollCellCoordsIntoView:bl,getCellCoordsFromClient:wl,getScrollOrientation:()=>yl,getScrollTopLeft:()=>No,getFreezeTopLeft:()=>No},_=w(Y);return s.jsxs("div",{style:{...a,position:"relative",display:"flex"},...k,children:[s.jsx("div",{ref:Nt([y,p]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:C}),_]})});function pr(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=pr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function ct(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=pr(e))&&(i&&(i+=" "),i+=t);return i}const ql="_sheetxl-sheet_1qeq6_5",Sl="_viewport-overlay_1qeq6_6",vr=e=>{const{style:t,...n}=e??{};return s.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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"})]})},Rl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...h}=e??{},[c,C]=o.useState(null);o.useEffect(()=>{(async()=>{const v=await d.LicenseManager.getDetails();C(v)})()},[]);const[k,y]=o.useState(!1),p={opacity:.65},M=o.useMemo(()=>{const v=c?.getExceptions(),I=v?.length??0;if(I===0)return null;const q=[];for(let X=0;X<I;X++){const E=v[X];q.push(s.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:E},X))}return q},[c,n]);if(c===null||c.isValidFor(l))return null;const T=c.getType(),z=!M&&T.endsWith("ity"),D=c.getLicensee(),Z=z?1.6:1,K=135/Z,w=37/Z;let N=null;return!T&&D?.length>0&&(N=s.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),s.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...h,children:s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[k?s.jsx(vr,{style:p}):s.jsx("svg",{width:K,height:w,style:p,children:s.jsx("image",{style:{width:K,height:w},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),s.jsxs("div",{children:[N,M,s.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),Qe=(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={},h=l.length;for(let C=0;C<h;C++){const k=l[C];f[k]=(y,p)=>{i.current[k]?.(y,p)}}const c=e.addListeners(f,n);if(a)for(let C=0;C<h;C++)f[l[C]](e);return()=>{c?.()}},[e])},En=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 i=n.contributionPoints;if(i&&i.length!==0)for(let a of i)a.startsWith(e)&&t.push(n)}return t}},Cr=o.createContext(void 0),kl={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},yr=()=>o.useContext(Cr)||kl,Gt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},yo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:h,style:c,className:C,...k}=e,y=o.useMemo(()=>ct("taskpane-title",C,Gt.TaskPaneTitle,{focused:h}),[C,h]);return s.jsxs("div",{ref:t,className:y,style:c,...k,children:[s.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),s.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:p=>{p.stopPropagation()},onPointerUp:()=>{l()},children:s.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));yo.displayName="TaskPaneTitle";const Ml=e=>s.jsx(yo,{...e}),Tl=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:h,onMounted:c,onUnmounted:C,wrapperPane:k,propsPane:y,renderTaskPanelTitle:p=Ml,style:M,className:T,...z}=e,[D,Z]=o.useState(null),[K,w]=o.useState(!1),N=r.useCallbackRef(a,[a]),v=o.useRef(null),I=o.useRef(null);o.useEffect(()=>(c?.(i),()=>{C?.(i)}),[i]);const q=o.useRef([]),X=o.useMemo(()=>({addListener:$=>{const ve=l($);return q.current.push(ve),ve},close:()=>{N?.()},focus:$=>{v.current?.focus($)}}),[l]);o.useEffect(()=>()=>{for(const $ of q.current)$();q.current=[]},[]);const E=o.useMemo(()=>(i.renderTaskPanelTitle??p)({ref:I,title:i.getTitle(),icon:null,readOnly:!1,focused:K,onClose:N,onPointerDown:$=>{}}),[i,K]),j=o.useMemo(()=>{let $=i.renderTaskPane({entryKey:i.key,model:f,commands:h,frame:X,...y},t);return k&&($=k($)),$},[i,f,h,t]);return s.jsxs("div",{className:ct("taskpane-frame",T,Gt.TaskPaneFrame),tabIndex:0,ref:v,style:M,onPointerDown:async $=>{$.currentTarget.focus()},onFocus:$=>{$.relatedTarget&&!D&&Z($.relatedTarget),w(!0)},onBlur:$=>{D&&!v?.current?.contains($.relatedTarget)&&Z(null),$.relatedTarget&&w(!1)},...z,children:[s.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:E}),s.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:j})]})})),wo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:h=En,style:c,className:C,...k}=e,y=o.useMemo(()=>a.map(T=>{const z=h.getRegisteredTaskPane(T);if(!z)return null;let D=z.getIcon?.();D&&(typeof D=="string"&&(D=s.jsx(r.DynamicIcon,{iconKey:D})),D=s.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:D}));const Z=T===f;return s.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ct("taskpane-strip-item",Gt.TaskPaneStripItem,{selected:Z}),onClick:()=>e.onSelect(T),children:[D,z.getTitle()]},T)}),[a,f,l,h]),p=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),M=o.useMemo(()=>ct("taskpane-strip",C,Gt.TaskPaneStrip),[C]);return s.jsx("div",{ref:p,className:M,style:c,...k,children:y})}));wo.displayName="TaskPaneStrip";const Il=e=>s.jsx(wo,{...e}),El=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=En,model:a,commands:l,onOpen:f,onClose:h,wrapperPane:c,propsPane:C,wrapperFrame:k,propsFrame:y,renderTaskPanelTitle:p,renderTaskPaneStrip:M=Il,alwaysShowStrip:T,style:z}=e,D=r.useCallbackRef(f,[f]),Z=r.useCallbackRef(h,[h]),[K,w]=o.useState(null),N=o.useRef(null),[v,I]=o.useState([]),q=o.useRef(new Set),X=r.useCallbackRef(async(A,J=!1)=>{const x=Array.from(q.current),S=x.length;let oe=!0;for(let ie=0;oe&&ie<S;ie++){const qe=x[ie];if(qe.onBeforeHide)try{await Promise.resolve(qe.onBeforeHide())===!1&&(oe=!1)}catch{oe=!1}}return oe},[]),E=r.useCallbackRef(A=>{const J=Array.from(q.current),x=J.length;I(S=>{const oe=S.findIndex(qe=>qe.key===A);if(oe===-1)return S;const ie=[...S];return ie.splice(oe,1),ie.length===0?(w(null),Z?.(),ie):(j(ie[Math.max(ie.length-1,oe-1)].key),ie)});for(let S=0;S<x;S++){const oe=J[S];try{oe.onHide?.()}catch{}}},[Z]),j=r.useCallbackRef(async A=>{const J=i.getRegisteredTaskPane(A);if(!J)return void console.warn(`Invalid taskpane '${A}'`);if(N.current===A||K&&!await X(K.key))return;const x=o.createRef();let S=s.jsx(Tl,{ref:()=>{N.current=null},entry:J,model:a,commands:l,close:async()=>{await X(A)&&E(A)},wrapperPane:c,propsPane:C,renderTaskPanelTitle:p,listenerContainer:ie=>(q.current.add(ie),()=>{q.current.delete(ie)}),onMounted:ie=>{ie.key===A&&(N.current=null),D?.()},onUnmounted:ie=>{},...y});k&&(S=k(S));const oe={key:A,elem:S,ref:x};I(ie=>{if(ie.findIndex(de=>de.key===A)!==-1)return ie;const qe=[...ie];return qe.push(oe),qe}),w(oe),N.current=A},[K,k,C,p]);o.useEffect(()=>{K&&!N.current&&j(K.key)},[y,a]);const $=r.useImperativeElement(t,()=>({activateTaskPane:j}),[i,C,a,l]),ve=o.useMemo(()=>v.map(A=>A.key),[v]),Y=o.useMemo(()=>{if(ve.length<=1&&!T)return null;const A={className:Gt.TaskPaneAreaStrip,taskPanes:ve,selected:K?.key,onSelect:J=>{j(J)},registry:i};return M(A)},[ve,K,i,T]),_=K?.elem;return s.jsxs("div",{ref:$,className:ct("taskpane-area",n,Gt.TaskPaneArea),style:z,children:[_,Y]})})),qn=new d.Color("transparent");function wr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:h}=e,c=r.useNotifier(),C=yr(),k=r.useCallbackRef(f,[f]),y=r.useCallbackRef(h,[h]),p=o.useMemo(()=>({serializer:{parse:u=>u?t?.getStyles().parseColor(u):null,stringify:u=>u?u.toString():null}}),[t]),[M,T]=r.usePersistenceState("sheet.lastBorder",null),[z,D]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),p),[Z,K]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),p),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const[N,v]=o.useReducer(u=>u+1,0),[I,q]=o.useReducer(u=>u+1,0),X=r.useGlobalClipboard(),E=o.useRef(null),[j,$]=o.useReducer(u=>u+1,0),[ve,Y]=o.useReducer(u=>u+1,0),_=o.useRef(null),A=r.useCallbackRef(()=>{if(!t)return null;const u=_.current;if(u)return u;const L=t.getSelectedCell(),U=L.getCoords(),m=t.getSelectedRanges(),F=t.getSelectedRange(),G=t.getTables(),te=G.getItems({address:F}),le=G.getItems({address:U});let b=null;le.length>0&&(b=le[0]);const B=m.getMerges().length>0,R=m.isOverlapping();let P=!0;const ce=m.getCoords(),se=ce.length;for(let ye=0;P&&ye<se;ye++)P=he.CoordUtils.isSingleCell(ce[ye]);return u&&b===u.table&&he.CommonUtils.isEqualArrays(te,u.tables)||requestAnimationFrame(()=>{Y()}),_.current={tables:te,table:b,ranges:m,rangesCoords:ce,range:F,cell:L,containsMerge:B,isOverlapping:R,isSingleCell:P},_.current},[t]),J=o.useCallback(he.CommonUtils.debounce($,210),[]);o.useEffect(()=>{E.current=t,$()},[t]),Qe(t.getSelection(),{onChange:()=>{_.current=null,J()}});const x=r.useCallbackRef(async(u,L,U=null,m=!1,F=!0)=>{const G=u?.getLabel?.(),te=async()=>{const R=await Promise.resolve(F&&c.showBusy(G??"Busy..."));try{await t.doBatch(async()=>L(t),G),m&&w.setMode(null),R&&R()}catch(P){if(R&&R(),!P)return;c.showError(P)}},le=[];let b=!1;const B=async()=>(le.push(te),(async()=>{if(!b){for(b=!0;le.length>0;){const R=le.shift();R&&await R()}b=!1}})());if(n){let R=null;if(U!==!1&&u){const P=U??G;R=new r.SimpleCommand(u.getKey(),l,{label:P,description:P},B)}n(R)}return B()},[t,n,c]),S=r.useCallbackRef((u,L,U=!1,m)=>(m||(m={autoSelect:!0,autoFit:!0}),x(u,F=>{const G=F.getSelectedRanges();U&&G.getStyle().update(null,m),G.getStyle().update(L,m)})),[t]),oe=r.useCallbackRef((u,L)=>{x(u,U=>{U.getSelectedRange().setHyperlink(L)})},[t]),ie=r.useCallbackRef((u,L)=>{x(u,U=>{U.getSelectedRange().setComments(L)})},[t]),qe=r.useCallbackRef((u,L)=>{x(u,U=>{U.getSelectedRanges().clear(L)})},[t]),de=r.useCallbackRef(async(u,L,U=!1,m=!1)=>x(u,async F=>{let G=F.getSelectedRanges();U&&(L===d.IRange.Orientation.Row?G=G.getEntireRows(m):L===d.IRange.Orientation.Column&&(G=G.getEntireColumns(m)));let te=null;const le=w.getMode()?.key;if(le==="copy"||le==="cut"){const b=await X.getClipboard().readReference();b&&b.getItemType()==="range"&&(te=b.getItem(),te.getCoords()||(te=null))}if(te){const b=await G.insertFrom(te,{...te.getMarkOptions(),orientation:L,autoSelect:!0});!b||b.isEntireRows()||b.isEntireColumns()||b.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else G.insert({orientation:L,autoSelect:!0})},"Insert Cells",!1),[w]),Pe=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),je=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),De=r.useCallbackRef((u,L)=>{x(u,async U=>{const m=U.getSelectedRange(),F=U.getSelectedCell().getCoords();let G=null,te=0;const le=F.rowIndex>0?U.getRange({rowIndex:F.rowIndex,colIndex:F.colIndex}).getExtended(d.IRange.Direction.Up):null;le&&U.getRange({colStart:F.colIndex,rowStart:le.getCoords().rowStart,colEnd:F.colIndex,rowEnd:le.getCoords().rowStart}).isContentful()&&(G=d.IRange.Direction.Up,te=F.rowIndex-le.getCoords().rowEnd);const b=F.colIndex>0?U.getRange({rowIndex:F.rowIndex,colIndex:F.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(b&&U.getRange({colStart:b.getCoords().colStart,rowStart:F.rowIndex,colEnd:b.getCoords().colStart,rowEnd:F.rowIndex}).isContentful()){const R=F.colIndex-b.getCoords().colEnd;(R<te||!G)&&(G=d.IRange.Direction.Left,te=R)}let B=null;if(G===d.IRange.Direction.Up){if(B={...le.getCoords()},(B.rowEnd===F.rowIndex||!U.getRange({colIndex:F.colIndex,rowIndex:F.rowIndex-1}).isContentful())&&B.rowStart>0&&U.getRange({colIndex:F.colIndex,rowIndex:B.rowStart-1}).isContentful()){const R=le.getExtended(d.IRange.Direction.Up);B={colStart:F.colIndex,rowStart:R.getCoords().rowStart,colEnd:F.colIndex,rowEnd:le.getCoords().rowEnd}}B.rowEnd=F.rowIndex-1}else if(G===d.IRange.Direction.Left){if(B={...b.getCoords()},(B.colEnd===F.colIndex||!U.getRange({colIndex:F.colIndex-1,rowIndex:F.rowIndex}).isContentful())&&B.colStart>0&&U.getRange({colIndex:B.colStart-1,rowIndex:F.rowIndex}).isContentful()){const R=b.getExtended(d.IRange.Direction.Left);B={colStart:R.getCoords().colStart,rowStart:F.rowIndex,colEnd:R.getCoords().colEnd,rowEnd:F.rowIndex}}B.colEnd=F.colIndex-1}if(m.size!==1&&G){const R=m.getCoords(),P=m.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),ce={...B},se=R.rowStart,ye=R.rowEnd,ee=R.colStart,pe=R.colEnd,V=G===d.IRange.Direction.Up;for(let Q=ee;Q<=pe;Q++){ce.colStart=V?Q:B.colStart+(Q-ee),ce.colEnd=V?Q:B.colEnd+(Q-ee);for(let re=se;re<=ye;re++){ce.rowStart=V?B.rowStart+(re-se):re,ce.rowEnd=V?B.rowEnd+(re-se):re;const Ee=U.getRange(ce).toString();P.pushAt(re,Q,`=${L}(${Ee})`)}}P.apply()}else{const R=B?U.getRange(B).toString():"",P=`=${L}(`;k?.({text:`${P}${R})`,editMode:!0,initialSelection:{start:P.length,end:P.length+R.length}})}},!1)},[t]),Ie=r.useCallbackRef((u,L,U=!1,m=!0)=>{x(u,async F=>{const G=A()?.table;if(G)return void G.updateStyleOptions(L);const te=F.getSelectedRanges().getFixed(!0),le=F.getSelectedRange().getDefaultSortCriteria(),b={getNames:()=>F.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},B={ranges:te,hasHeader:le?.options?.hasHeader??!1},R=async ce=>{if(!(ce=await Promise.resolve(ce)))return null;const se=await Promise.resolve(c.showBusy(u.getLabel()));try{await F.getTables().add(ce.ranges.at(0),{styleName:L?.name,clearFormatting:U,hasHeader:ce.hasHeader}).getRange().select(),se()}catch(ye){se(),c.showError(ye)}};if(!m)return void await R(B);const P={initialValue:B,context:()=>b,onInput:ce=>{R(ce)}};c.showWindow("tableNew",P)},!1,!0,!1)},[]),ke=r.useCallbackRef(()=>i,[i]),ge=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:ke,getNames:()=>t.getNames()}),[t]),O=r.useCallbackRef(async(u,L,U,m=!0)=>{if(!L){const G=A();if(!G)return;let te=G.range;te.size===1&&(te=te.getSurrounding());const le=G.table;le&&(L=le),await te.select()}if(!L)return;try{U&&await L.select()}catch{}if(!m)return;const F=new Promise(async(G,te)=>{u.update({context:ge(L)}),C.activateTaskPane("tableDetails",{}),G(!0)});try{if(!await F)return}catch(G){c.showError(G)}},[c]),Fe=r.useCallbackRef(async(u,L,U=!1)=>{let m=null;if(L?L.isITable?m=L:L.getValue()&&(m=L.getValue()):m=A()?.table,m){if(!U){const F=m.getRange().getCoords(),G=(F.colEnd-F.colStart+1)*(F.rowEnd-F.rowStart+1);if(G>1e4&&await c.showOptions({title:"Confirm",description:`Converting a table to range with '${G}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
-
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}
|
|
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(u){S(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(u){Ie(this,u)}),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(u){Ie(this,u,!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(){Ie(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."},Pe),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},je),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){S(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){S(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){S(this,{font:{fill:u}})}),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(){S(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.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(){S(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){S(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){S(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,L){const U=this,m={initialValue:u??L.getState(),context:()=>L.getContext(),onInput:(F,G)=>{S(U,{numberFormat:F})}};c.showWindow("numberFormat",m)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){S(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(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(){S(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(){S(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(){S(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(u){S(this,{numberFormat:u??'_($* #,##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(){S(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(){S(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(){S(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(){S(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){S(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",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(u){u&&De(this,u.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(){De(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){De(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){De(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){De(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){De(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(){k?.({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(){k?.({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:()=>A().cell,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,L){const U=this,m={context:()=>L.getContext(),onInput:F=>{oe(U,F)}};c.showWindow("hyperlink",m)}),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:()=>A().cell},async(u,L)=>{const U=L.getContext();if(!U)return;const m=U.getHyperlink();if(m)try{await m.open()}catch(F){c.showError(F)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>A().cell},function(u,L){oe(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."},(u,L)=>{((U,m)=>{U?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[m," is not yet implemented.",s.jsx("br",{}),s.jsx("br",{}),"Please see the ",s.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(c,L.getLabel())}),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:()=>A().cell},async function(u,L){const U=this,m={context:()=>L.getContext(),onInput:F=>{ie(U,F)}};c.showWindow("comments",m)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>A().cell},function(u,L){ie(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(u=null){let L=null,U=null;typeof u=="string"?U=u:L=u?.file?u.file:u,(L||(L=await he.CommonUtils.openFileDialog(U??"image/*"),L))&&await fe(this,{file:L},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(u){if(!u){const L=await c.showInput({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",propsInput:{style:{minWidth:"440px"}},options:["Insert"]});if(L.option!=="Insert")return;u=L.input}u&&fe(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Ie(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(u){let L=null,U=!1;u.isITable?L=u:u.getValue()&&(L=u.getValue(),U=!0),O(this,L,U)}),new r.Command("deleteTable",l,{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"),s=require("react/jsx-runtime"),ge=require("@sheetxl/utils"),r=require("@sheetxl/utils-react"),o=require("react"),gt=require("@sheetxl/grid-react"),Kt=require("react-dom"),uo=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:h,propsPath:c,style:C,...M}=e,y=a,p=l;let T="red",I=[],z=[];return t===ge.AnchorLocation.TopLeft?(T=f?"rgb(255, 198, 246)":"green",I.push(p),z.push(p),I.push(p+y),z.push(p),I.push(p),z.push(p+y)):t===ge.AnchorLocation.TopRight?(T=f?"rgb(0, 255, 255)":"red",I.push(n-p),z.push(p),I.push(n-(p+y)),z.push(p),I.push(n-p),z.push(p+y)):t===ge.AnchorLocation.BottomRight?(T=f?"rgb(236, 252, 211)":"purple",I.push(n-p),z.push(i-p),I.push(n-(p+y)),z.push(i-p),I.push(n-p),z.push(i-(p+y))):t===ge.AnchorLocation.BottomLeft&&(T=f?"rgb(255, 236, 183)":"blue",I.push(p),z.push(i-p),I.push(p+y),z.push(i-p),I.push(p),z.push(i-(p+y))),s.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...C},...M,children:s.jsx("path",{d:`M ${I[0]} ${z[0]} L ${I[1]} ${z[1]} L ${I[2]} ${z[2]} L ${I[0]} ${z[0]} Z`,fill:h??T,...c})})}),dr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:h,...c}=e,C=o.useMemo(()=>{let T=null;const I=l.getSortField();I&&(T=I.reverse);const z=l.getField(),D=z&&z.criteria&&z.criteria.length>0;return T===!0?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":T===!1?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 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]),[M,y]=o.useState(!1),p=Math.min(Math.min(18,t.height-8),t.width);return s.jsx("div",{style:{width:`${p}px`,height:`${p}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${M&&!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:(p>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...h},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:T=>{f?.(T,l),T.preventDefault()},...c,children:s.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${M&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:s.jsx("path",{d:C})})})},ur=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:h=1,view:c,bodyStyle:C,normalStyle:M,showFormulas:y,showZeros:p,docTheme:T,onLinkMouseDown:I,onFilterButtonMouseDown:z,propsFilterButton:D,renderFilterButton:_=dr,...$}=e,w=i.height/h,N=i.width/h,v=t,E=v.getValue(),q=t.getStyle(),Z=C?.darkMode??!1;let F,P;const W=E&&E.isFormulaError,pe=W&&E instanceof d.FormulaError.Parse;let de,le=y||pe;if(le)if(v.isSpillOverflow())P="";else{const re=v.getFormulaText();re?P=re:F=v.getNumberFormat(d.NumberFormat.Type.General)}else F=v.getNumberFormat();le||(de=v.getTextOverflow());const R=de?de.colBounds.width+de.leftOffset+de.rightOffset:N,te=de?de.anchorBounds.x-de.leftOffset:0,k=de?de.anchorBounds.width:N,b=de?de.anchorBounds.x:0;let ee,ne=v.getRenderHorizontalAlignment();F&&(ee=F?.formattedRuns,P=ee?.runs[0]?.text??F.displayText);const Re=v.getCalcStatus()===d.ICell.CalcStatus.Pending;let Ce=null,ye=q.getFill().toCSS(Z,i),Pe=0,ze=0;if(!q.getBorder().isEmpty()){const re=q.getBorder().getRight();!re.isNone()&&d.IBorder.BuiltInDefinitions.get(re.getStyle()).width>1&&(Pe=1);const x=q.getBorder().getBottom();!x.isNone()&&d.IBorder.BuiltInDefinitions.get(x.getStyle()).width>1&&(ze=1)}let Ae=null;if(N!==k||Pe||ze||typeof ye?.backgroundPosition=="number"){const{backgroundPosition:re,...x}=ye,B=re??0,S=c?.getScrollTopLeft(),j=B?-(i.x+(S.left??0))%B:0,se=B?-(i.y+(S.top??0))%B:0;(re!==void 0||Pe||ze||N!==k)&&(Object.keys(x).length===1&&x.background==="none"||(ye=null,Ae=s.jsx("div",{className:"fill",style:{marginLeft:`${j}px`,marginTop:`${se}px`,left:b*h,width:r.ReactUtils.boundPixel(k*h-j+1+Pe),height:r.ReactUtils.boundPixel(i.height-se+1+ze),...x}},"background")))}let Ie=null;const ue=v.getComments(),O=v.getWarnings(),xe=v.getErrors();if(ue||W||xe.length>0||O.length>0){const re={size:7*h,darkMode:Z,cellWidth:k*h+2,cellHeight:w*h+2,style:{top:-1,left:b*h-1}};Ie=Ie??[],(O.length>0||xe.length>0||W)&&Ie.push(s.jsx(uo,{anchorLocation:ge.AnchorLocation.TopLeft,...re},`indicator-${Ie.length}`)),ue&&Ie.push(s.jsx(uo,{anchorLocation:ge.AnchorLocation.TopRight,...re},`indicator-${Ie.length}`))}const Le=q.getFont();let H=F?.conditionalColor;const U=q.getAlignment(),he=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ce=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||he,me=ce||le?0:U.getRotation(),Te=v.getInsets(),ie=Te.top+Te.bottom;let qe=Te.left,g=Te.right;const je={...l,left:l.left-1,top:l.top-1,width:l.width+1+Pe,height:l.height+1+ze},Be=v.getColumnFilter(),Ee=Be&&!Be?.hasHiddenButton();let u=null;Re&&(u=s.jsxs("div",{className:"slider",children:[s.jsx("div",{className:"line"}),s.jsx("div",{className:"subline inc"})]},"pending"));const L=!(Re||Ee||Ae||a||Ie||ee?.runs.length>1||de||me%360!=0);ye?.background==="none"&&(ye=null);let K=ce||!(!de||!(de.rightIndex>0||de.leftIndex>0||de.colSpan>1));if(!K){const re=v.getSpans();(re.width>1||re.height>1)&&(K=!0)}const m={...ye,...je,pointerEvents:I?"auto":void 0};if(!ge.CommonUtils.isEmpty(P)||!ge.CommonUtils.isEmpty(F?.repeatPlaceholder)){const re=F?.canWrap??!1;let x=null,B=null,S=null,j=[],se=!0;p||le||E!==0||(se=!1);const ae=v.getTextFrame(le);if(se&&ae){let we=R-1-(qe+g);if(me){x=ae.layout().bounds;const He={x:0,y:0,width:R-1,height:w};if(ee){let ve=ee.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const De=d.GeomUtils.boundsToPoints(He),be=d.GeomUtils.rotatePoints(De,-me);ve=d.GeomUtils.minBoundingRect(be).width}x={...x,width:ve}}S=d.GeomUtils.clipToOuterRect({...x,width:x.width+1+qe+g},He,me),we=S.width-1-(qe+g)+.01}let Y=null;re&&(Y={width:we});let fe=null,V=F?.repeatPlaceholder;const X=ae.layout(Y);if(x=X.bounds,le?x={...x,width:0}:ee&&(x={...x,width:F.repeatPlaceholder||F.repeatChars.length>0?we:ee.width}),me&&re){let Se=null;X.visitLines({visitTextLine:(He,ve)=>{let De=He.bounds;const be=d.GeomUtils.boundsToPoints(De),ke=d.GeomUtils.rotatePoints(be,me),Ne=d.GeomUtils.minBoundingRect(ke);De={...De,x:(Ne.width-De.width)/2,y:(Ne.height-De.height)/2},Se=Se?d.GeomUtils.unionBounds(Se,De):De}}),x={...Se,width:Se.width+qe+g}}if(!V&&v.getType()!==d.ScalarType.String&&Math.floor(x.width)>we){if(q.getNumberFormat()==="General"&&v.getType()===d.ScalarType.Number){const Se=q.measureText("0"),He=Math.floor(we/Se.width),ve=E,De=ge.CommonUtils.splitNumber(ve),be=Math.min(10,He-(Math.max(1,De.ipLength)+1)-(ve<0?1:0));if(be>=-1){const ke=`0${be>0?".":""}${"#".repeat(Math.max(0,be))}`;fe=v.getNumberFormat(ke).displayText,fe==="0"&&ve<0&&(fe="-0")}else if(Math.abs(ve)>=Math.pow(10,5)||Math.abs(ve)<=Math.pow(10,-5)){const ke=He-5-(ve<0?1:0);if(ke>=0){const Ne=`0.${"0".repeat(Math.max(0,ke-1))}E+00`;fe=v.getNumberFormat(Ne).displayText}}}fe||(V="#")}if(!V&&ee?.lastRepeatIndex>=0&&ee?.width>we&&(V="#"),V&&we>0){const Se=q.measureText(V),He=Math.floor((we||1)/(Se?.width||1));fe=He>0?V.repeat(He):"",ne=d.ITextFrame.HorizontalAlignment.Center}if(le&&(ne=d.ITextFrame.HorizontalAlignment.Left),fe){const Se=q.measureText(fe).width;Se&&(x={...x,width:Se})}if(B={...x,width:x.width+qe+g,height:x.height},me&&!re){const Se=d.GeomUtils.boundsToPoints(B),He=d.GeomUtils.rotatePoints(Se,me),ve=d.GeomUtils.minBoundingRect(He);B.width=ve.width,B.height=ve.height}ne===d.ITextFrame.HorizontalAlignment.Center||ne===d.ITextFrame.HorizontalAlignment.CenterContinuous?B.x=(R-B.width)/2:ne===d.ITextFrame.HorizontalAlignment.Right?B.x=R-B.width-.5:B.x=.5,U.getVertical()===d.ITextFrame.VerticalAlignment.Center?B.y=(w-B.height)/2:U.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?B.y=w-B.height-ie:B.y=ie;const oe=L?{...$}:void 0,Fe={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:me?`rotate(${me}deg)`:void 0,cursor:I?"pointer":void 0,pointerEvents:I?"auto":void 0,zIndex:K?1:void 0,...ye},onMouseDown:I,onDoubleClick:I?Se=>{Se.stopPropagation(),Se.preventDefault()}:null,...oe};pe&&(Fe.style.textDecorationStyle="wavy",Fe.style.textDecorationColor=Z?"rgb(0, 255, 255)":"red",Fe.style.textDecorationLine="underline");const Ue=Le.getSize(),Oe=(Se,He,ve,De,be,ke,Ne,Ze=null)=>{let _e=Ue*h,Xe=ve,at=Ne?.runs?Ne.runs:[{type:d.NumberFormat.ParseRunType.Text,text:Se,width:q.measureText(Se,_e).width}];Ne&&Ne?.width!==x.width&&(x={...x,width:Ne?.width});let ot=qe;if(Ne?.lastRepeatIndex>=0&&we>Ne?.width){const Je=Ne.runs[Ne.lastRepeatIndex];if(Je){const st=[...at],wt=Math.max(0,we-1-Ne.width);let bt=0,dt="";if(wt>0){const ft=Math.floor(wt/Je.width);dt=ft>0?Je.text.repeat(ft):"",bt=wt}st[Ne.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:dt,width:bt},at=st,x={...x,width:Ne.width+bt}}}const $e=(Je,st,wt,bt,dt,ft,xt,Un,Yt,fn=null)=>{let Pt,jt=Xe.width;be===d.ITextFrame.HorizontalAlignment.Justify?(jt=dt,ke||(Pt="justify")):be===d.ITextFrame.HorizontalAlignment.Distributed&&(jt=dt,Pt=ke||Je.text.split(" ").length-1==0?"center":"justify");const{style:It,className:pt,...pn}=fn;let Bt=Je.text;if(be===d.ITextFrame.HorizontalAlignment.Fill&&F?.repeatChars.length===0){const ut=Math.max(1,Math.floor((Xe?.width??0)/(xt?.width??1)));Bt=Bt.repeat(ut)}let Mt=Xe.height;const At=Le.getVerticalAlignment(),Jt=At===d.IFont.VerticalAlignment.Sub,Kn=At===d.IFont.VerticalAlignment.Super;if(Jt||Kn){const ut=Le.getSuperSubScale();_e*=ut,Mt*=ut}const et={textAlign:Pt,textAlignLast:Pt,...It,...Le.toCSS(Z,h,!0),fontSize:_e*d.IFont.getDeviceScale()};L||(et.background=void 0),H&&(et.color=H.toCSS(Z));const Qt=ot+st;let Ot=Te.top+Xe.y+0;if(Jt&&(Ot+=Yt-_e),ft){const ut=(xt.x+Qt)*h+1,vt=(xt.y+Ot)*h+1;vt<0?et.marginTop=vt:et.paddingTop=vt,ut<0?(et.width=(It?.width??0)-ut,et.left=(It?.left??0)+ut):et.paddingLeft=ut,et.paddingRight=Math.max(0,(It?.width??0)-jt*h-ut),et.paddingBottom=Math.max(0,(It?.height??0)-Xe.height*h-vt),et.height=(It?.height??0)+(vt<0?-vt:0),(vt<0||ut<0)&&(et.clipPath=`inset(${vt<0?-vt:0}px 0px 0px ${ut<0?1-ut:0}px)`)}else if(et.left=(xt.x+Qt)*h+1,et.top=(xt.y+Ot)*h+1,et.width=xt.width*h,et.height=xt.height*h,me&&!re){et.left=(xt.x+st)*h+1,et.top=(xt.y+(Xe.y+0))*h+1;const ut=d.GeomUtils.centerPoint({x:ot+st,y:0,width:Je.width,height:Xe.height}),vt=d.GeomUtils.centerPoint({x:ot,y:0,width:dt,height:Xe.height}),Cn=d.GeomUtils.rotatePoints([ut],me,vt),en={x:Cn[0].x-ut.x,y:Cn[0].y-ut.y};et.left=et.left+en.x*h,et.top=et.top+en.y*h;const Dt={...Xe,x:ot,y:Te.top,width:Xe.width+(qe+g)},$n=d.GeomUtils.boundsToPoints(Dt),Wn=d.GeomUtils.rotatePoints($n,me),yn=d.GeomUtils.minBoundingRect(Wn);Dt.width=yn.width,Dt.height=yn.height;const Ht=d.GeomUtils.centerPoint(Dt),wn={x:Ht.x-vt.x,y:Ht.y-vt.y};et.left=et.left+wn.x*h,et.top=et.top+wn.y*h}et.lineHeight=Mt*h+"px";const vn=L?void 0:"text-line";j.push(s.jsx("div",{className:pt?`${pt} ${vn}`:vn,style:et,...pn,children:Bt},`text-${Xe.y}-${bt}-${wt}`))};if(U.getOverflow()===d.ITextFrame.Overflow.Shrink&&we>0){let Je=x?.width??0,st=0;for(;Je>1&&Je>we&&_e>2&&st<100;)_e*=we/Je,Je=q.measureText(Se,_e).width,st++;x={...x,width:Je}}let lt=Xe.x;be===d.ITextFrame.HorizontalAlignment.Right?lt+=x.width-Xe.width:be!==d.ITextFrame.HorizontalAlignment.Center&&be!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(lt+=(x.width-Xe.width)/2),Ne?.lastRepeatIndex>=0&&(lt=Xe.x);const it=at.length;for(let Je=0;Je<it;Je++){const st=at[Je];(st.type===d.NumberFormat.ParseRunType.Text||st.type===d.NumberFormat.ParseRunType.Repeat)&&(st.type,d.NumberFormat.ParseRunType.Repeat,$e(st,lt,Je,He,be===d.ITextFrame.HorizontalAlignment.Justify||be===d.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?we:Xe.width,L,{x:B.x+te,y:B.y,width:st.width,height:x.height},0,De,Ze)),lt+=st.width}};fe?Oe(fe,0,{x:0,y:0,...x},X.lines[0].baseline,ne,!0,null,Fe):X.visitLines({visitTextLine:(Se,He,ve)=>{const De=Se.runs[0].text.replace(/\s+$/,""),be=He===ve-1;let ke=ne===d.ITextFrame.HorizontalAlignment.Justify&&(be||Se.runs[0].text.endsWith(`
|
|
8
|
+
`))?d.ITextFrame.HorizontalAlignment.Left:ne,Ne=0;He>0&&(U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||U.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(w-(ie+3)-Se.bounds.height*ve)/(ve-1)*He)),U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&me&&me%90==0&&me%180!=0&&(ke=d.ITextFrame.HorizontalAlignment.Distributed),ke!==d.ITextFrame.HorizontalAlignment.Justify&&ke!==d.ITextFrame.HorizontalAlignment.Distributed&&ke!==d.ITextFrame.HorizontalAlignment.Fill||(x={...x,width:we});let Ze=he||F&&(F.repeatChars.length>0||F.spacingChars.length>0)?x.width:Se.bounds.width;const _e={...Se.bounds,y:Se.bounds.y+Ne+0,width:Ze};Oe(De,He,_e,ae.lines[0].baseline,ke,be,ve===1?ee:null,L&&He>0?{...Fe,style:{...Fe.style,background:void 0}}:Fe)}})}j.length>0&&(Ce=j)}if(L)return Ce&&Ce.length>0?Ce:s.jsx("div",{style:m,...$});let A=I?"auto":je.pointerEvents,G=null;if(Ee){const re={x:b*h-1,y:-1,width:k*h+1,height:w*h+1};A="auto",G=_({renderBounds:re,darkMode:Z,className:"filter-button",disabled:!v.isEditAllowed(),zoom:h,filter:v.getColumnFilter(),onFilterButtonMouseDown:z,...D}),G&&(G=s.jsx("div",{style:{...re,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:x=>{x.stopPropagation(),x.preventDefault()},children:G},"filterButton"))}Re&&!Ce&&(Ce=s.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 J=[Ae,Ce,a,Ie,u,G];return s.jsx("div",{style:{...ye,...je,pointerEvents:A},...$,children:J})},Ao={text:"",placeholder:""},Do=(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)))},hl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),gr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:f,onDoneEdit:h,defaultTextStyle:c,useRichStyling:C=!0,bodyStyle:M,activeCoords:y,sheet:p,commands:T,containerBounds:I,setNaturalSize:z,onFocus:D,disabled:_,style:$,zoom:w=1,linesVisible:N,autoFocus:v=!1,...E}=e,{height:q=0,width:Z=0}=I??{},F=M?.darkMode??!1,P=o.useRef(null),[W,pe]=o.useState(!1),[de,le]=o.useState(null),[R,te]=o.useState(()=>n);o.useEffect(()=>{ze.current=!1,te(n)},[n]);const k=o.useMemo(()=>{const x=R.clean();let B=x.getStyle();C||(B=B.createTemporaryStyle({font:{size:c?.fontSize}}));const S=x.getFormula(),j=B.getAlignment(),se=S?d.ITextFrame.HorizontalAlignment.Left:j.getHorizontal(),ae=j.getVertical(),we=j.getOverflow()===d.ITextFrame.Overflow.Wrap||x.getType()===d.ScalarType.String&&(se===d.ITextFrame.HorizontalAlignment.Justify||se===d.ITextFrame.HorizontalAlignment.Distributed||ae===d.ITextFrame.VerticalAlignment.Justify||ae===d.ITextFrame.VerticalAlignment.Distributed),Y=(X=>{if(!X)return Ao;const oe=X.clean();if(!oe)return Ao;let Fe=oe.getStyle()?.getQuotePrefix();if(X.dirty===void 0||X.dirty===null){let Ue="",Oe=oe.getFormulaText();Oe&&(Ue=Oe,Fe=!1),Ue||(Ue=oe.toTextUnformatted(!0)??"");let Se="";if(!X.editMode&&oe.isSpillOverflow()){const He=oe.getSpill();if(He){const ve=He.getCell(),De=ve.getFormulaText();ve.isEqual(oe)||(Se=De)}}return Fe&&(Ue="'"+Ue),{text:Ue,placeholder:Se}}return{text:X.dirty??"",placeholder:""}})(R),fe=Y.text,V=d.ITextFrame.toCSSHorizontalTextAlign(C&&!S?R.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:B,isWrapped:we,textValue:fe,formula:S,frameVertAlign:ae,placeholder:Y.placeholder,insets:C?x.getInsets():ge.TypesUtils.EmptyRect,textAlign:V}},[R,c,F,w,C]),b=o.useRef(null),ee=r.useImperativeElement(t,()=>({startEdit:x=>{P.current=x?.initialSelection;const B={...n,editMode:x?.editMode??!1};x?.text!==void 0&&(B.dirty=x.text),B.editMode===n.editMode&&B.dirty===n.dirty||(te(B),Ce?.(B))},submitEdit:()=>Ae(),cancelEdit(){Ie()},autoFocus(){b.current.focus()},dispatchEvent:x=>b.current.dispatchEvent(x),focus(){b.current.focus()},getLineHeight:Re}),[i,n]);o.useLayoutEffect(()=>{if(!de||!W)return;const x=b.current;k.textValue,x&&x.setSelectionRange(de.start,de.end,de.direction)},[b.current,de,k.textValue]);const ne=o.useMemo(()=>{const x=R?.clean(),B=k.style.createTemporaryTextFrame(k.textValue,x?.getType()===d.ScalarType.String),S=C?x.getInsets().right+x.getInsets().left:0;let j=null;return k.isWrapped&&(j={width:Z-S}),B.layout(j)},[k,Z,R,C]),Re=r.useCallbackRef(()=>Math.ceil(ne?.lines[0]?.bounds.height),[ne]);o.useLayoutEffect(()=>{if(!ne)return;const x=k.style,B=x.getInsets()??ge.TypesUtils.EmptyRect,S=C?B.left+B.right:0,j=C?.04*x.getFont().getSize():1,se=Math.round(k.isWrapped?void 0:ne.bounds.width+S+j),ae=Math.round(ne.bounds.height);z?.({width:se,height:ae})},[ne,z,k,C,R]);const Ce=r.useCallbackRef(a,[a]),ye=r.useCallbackRef(x=>{if(R.dirty===x)return;const B={...R};B.dirty=x,b.current,te(B),Ce?.(B)},[R]),Pe=r.useCallbackRef(x=>{if(R.editMode===x)return;const B={...R};B.editMode=x,te(B),Ce?.(B)},[R]),ze=o.useRef(!1),Ae=r.useCallbackRef(()=>{if(ze.current)return!1;try{l?.(R),h?.(),ze.current=!0}catch{return!1}return!0},[l,R]),Ie=r.useCallbackRef(()=>{ze.current=!0,te(n),f?.(),h?.()},[f,n]),ue=r.useCallbackRef(x=>{if(!b.current)return;if(x.key,x.isDefaultPrevented(),!(x.isTrusted||x.nativeEvent.ctrlKey||x.nativeEvent.metaKey||x.nativeEvent.altKey||x.nativeEvent.isComposing||gt.STANDARD_KEY_CHARS.indexOf(x.nativeEvent.key)===-1&&x.nativeEvent.key!=="Backspace")){const Y={...R};let fe=0;return Do(Y,Y.dirty)&&!isNaN(parseFloat(x.key))?(Y.dirty?.endsWith("%")?Y.dirty=(Y.dirty.substring(0,Y.dirty.length-1)??"")+x.key+"%":Y.dirty=(Y.dirty??"")+x.key+"%",fe=Y.dirty.length-1):x.nativeEvent.key==="Backspace"?(Y.dirty="",fe=Y.dirty.length):(Y.dirty=(Y.dirty??"")+x.key,fe=Y.dirty.length),b.current.value=Y?.dirty,P.current={start:fe,end:fe,direction:"forward"},b.current?.setSelectionRange(fe,fe,"forward"),te(Y),Ce?.(Y),void x.preventDefault()}const B=x.nativeEvent.ctrlKey,S=x.nativeEvent.shiftKey,j=x.nativeEvent.altKey,se=x.nativeEvent.metaKey;if(B&&x.key==="z"&&x.stopPropagation(),x.which===r.KeyCodes.Escape)return x.preventDefault(),void Ie();if(x.which===r.KeyCodes.F2)return Pe(!0),void x.preventDefault();const ae=x.target;if(x.key==="%"&&ae.selectionStart===ae.selectionEnd&&ae.value[ae.selectionStart]==="%"&&R?.clean().getStyle().numberFormat.includes("%"))return le({start:ae.selectionStart+1,end:ae.selectionEnd+1,direction:ae.selectionDirection}),void x.preventDefault();if(x.which===r.KeyCodes.Enter){if(x.preventDefault(),se||j){const Y=k.textValue.substring(0,ae.selectionStart)+`
|
|
9
|
+
`+k.textValue.substring(ae.selectionEnd);return ye(Y),void le({start:ae.selectionStart+1,end:ae.selectionStart+1,direction:ae.selectionDirection})}return void(Ae()&&p.getSelection().traverse(d.IRange.Orientation.Column,S))}if(x.which===r.KeyCodes.Tab)return x.preventDefault(),void(Ae()&&p.getSelection().traverse(d.IRange.Orientation.Row,S));let we=null;switch(x.which){case r.KeyCodes.Left:we=d.IRange.Direction.Left;break;case r.KeyCodes.Right:we=d.IRange.Direction.Right;break;case r.KeyCodes.Up:we=d.IRange.Direction.Up;break;case r.KeyCodes.Down:we=d.IRange.Direction.Down}if(we&&!(B||S||j||se)&&!R.editMode)return void Ae();R.editMode&&(we||hl.includes(x.which))&&x.stopPropagation()},[R,p,k]),O=o.useCallback(()=>{b.current?.focus(),setTimeout(()=>{b.current?.select()},0)},[]),xe=o.useCallback(()=>{b.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Le=r.useCallbackRef(()=>{const x=b.current?.value;let B="";if(y.rowIndex>0){const S=p.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();S&&(B=S.toTextUnformatted(!0))}ye(x+B)},[y,p]);o.useEffect(()=>p.getRange(y).addListener(()=>{const x={...R,clean:()=>p.getRange(y).getCell()};te(x),Ce?.(x)}),[y,p,R]);const H=o.useCallback(()=>{const x=R.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();ye((b.current?.value??"")+x)},[p]),U=o.useCallback(()=>{const x=R.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();ye((b.current?.value??"")+x)},[p]),he=o.useMemo(()=>({element:()=>b.current,doCopy:x=>{const B=b.current.value.substring(b.current.selectionStart,b.current.selectionEnd);if(x?.isCut){const S=b.current.value.substring(0,b.current.selectionStart)+b.current.value.substring(b.current.selectionEnd,b.current.value.length);ye(S)}return B}}),[b.current]),ce=o.useMemo(()=>({element:()=>b.current,doPaste:async(x,B)=>{const S=await x.toText?.();if(!S)return!0;const j=b.current.value.substring(0,b.current.selectionStart)+S+b.current.value.substring(b.current.selectionEnd,b.current.value.length);return ye(j),le({start:b.current.selectionStart+S.length,end:b.current.selectionStart+S.length,direction:"forward"}),!0}}),[b.current]),me=o.useMemo(()=>({contains:x=>b.current?.contains(x)||!1,focus(){b.current.focus()}}),[]),Te=o.useMemo(()=>[new r.SimpleCommand("selectAll",me,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},O),new r.SimpleCommand("startEditValueAbove",me,{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]}]},Le),new r.SimpleCommand("startEditCurrentTime",me,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},H),new r.SimpleCommand("startEditCurrentDate",me,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},U),new r.Command("relativeReferencesToggle",me,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},xe),new r.Command("toggleEditorFocus",me,{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 x=null;const B=()=>({contains:S=>b.current?.contains(S)||!1,focus(){b.current.focus()}});return x=T?T.createChildGroup(B,"editor",!1):new r.CommandGroup(B,"editor"),x.addCommands(Te,!0),x},[T,Te]),qe=o.useMemo(()=>({notifier:null,source:he,target:ce,commands:ie}),[he,ce,ie]);r.useCopyPaste(qe);const[g,je]=o.useState(!v);o.useEffect(()=>{je(!1)},[]);const Be=r.useCallbackRef(x=>{pe(!0),ie?.activate();const B=P.current;if(B!==!1){let S,j;const se=b.current.value;Do(R,se)&&(S=se.length-1,j=se.length-1),S=B?.start??S??se.length,j=B?.end??j??se.length,P.current=!1,le({start:S,end:j,direction:"forward"})}D?.(x)},[D,R]),Ee=k.insets;let u=Ee.left+1;const L=Ee.left+Ee.right+2-1,K=ne?.bounds.height??0;let m,A=Ee.top;k.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?A=Math.max(0,(q-(Ee.top+Ee.bottom)-K)/2):k.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(A=Math.max(0,q-(Ee.top+Ee.bottom)-K)),N!==void 0&&ne?.lines[0]?.bounds&&(m=ne?.lines[0]?.bounds.height*N);const G=k.style.getFont();let J=G.getSize();G.isSuperSub()&&(J*=G.getSuperSubScale()),J*=d.IFont.getDeviceScale()*w;const re=C?G.toCSS(F,w):null;return s.jsx("div",{className:"sheet-cell-editor",onMouseDown:x=>{b.current&&document.activeElement!==b.current&&requestAnimationFrame(()=>{b.current.focus()})},ref:ee,...E,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...$},children:s.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:A*w,left:u*w,width:`calc(100% - ${L*w}px)`,maxWidth:`calc(100% - ${L*w}px)`,height:(m??K)*w,maxHeight:(m??K)*w},children:s.jsx("textarea",{spellCheck:"false",placeholder:k.placeholder,ref:b,value:k.textValue,disabled:g,readOnly:_||p.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...re,fontSize:J?`${J}px`:"inherit",textAlign:k.textAlign,lineHeight:(ne?.lines[0]?.bounds.height??0)*w+"px",height:(ne?.bounds.height??0)*w,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:k.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Be,onBlur:()=>{pe(!1)},onSelect:x=>{},onChange:x=>{b.current&&!ze.current&&(P.current=!1,ye(x.target.value),k.textValue,x.target.value,x.target.selectionStart,x.target.selectionEnd,x.target.selectionDirection,le({start:x.target.selectionStart,end:x.target.selectionEnd,direction:x.target.selectionDirection}))},onMouseDown:x=>{W&&Pe(!0)},onKeyDown:ue})})})})),hr=(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:h=0,offsetY:c=0,isVertical:C=!1,...M}=e,y=$=>{let w=null;if($&&n>0){w="";for(let N=0;N<$.length;N++)w+=$[N],N<$.length-1&&(w+=",")}return w},p=y(i);let T=p;a&&(T=y(a));let I=n,z=t,D=null;if(l){I=Math.floor(n/2);const $=I+I/2+1;let w=null;w=C?`M ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+$)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+$)}`,D=s.jsx("path",{strokeWidth:I,strokeDasharray:T,d:w,...M})}if(f){I=n/2;const $=I+I/2;let w=T,N=null;N=C?`M ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+$)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+$)}`,D=s.jsx("path",{strokeWidth:I,strokeDasharray:w,strokeDashoffset:"1",shapeRendering:"crispEdges",d:N,...M})}let _=null;return _=C?`M ${r.ReactUtils.boundPixel(h+I/2)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+I/2)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+I/2)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+I/2)}`,s.jsxs(s.Fragment,{children:[s.jsx("path",{strokeWidth:I,strokeDasharray:p,d:_,...M}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Nt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ro(i,t),l=typeof a=="function";n.push(l?a:()=>ro(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ro(n,t)}},ml=function(){},fr=typeof window<"u",fl=fr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Wt=fr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(zo),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var c=h[0].contentRect,C=c.x,M=c.y,y=c.width,p=c.height,T=c.top,I=c.left,z=c.bottom,D=c.right;l({x:C,y:M,width:y,height:p,top:T,left:I,bottom:z,right:D})}})},[]);return fl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[ml,zo]},pl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,vl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Cl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:h=!1,isVertical:c=!1,intersections:C,layout:M}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const p=n[0],T=n[1],I=n[2],z=n[3];let D=1+(c?z-T:I-p),_=0;const $=a.getColor().toRGBA(l).toString(),w=y.description.toLowerCase().includes("double");let N,v;const E=c?"rowStart":"colStart",q=c?"rowEnd":"colEnd",Z=c?T:p;if(C?.length>0){const pe=C[0];if(pe?.range[E]===i[E]){const le=d.IBorder.BuiltInDefinitions.get(pe.stroke.getStyle());_=Math.floor(le.width/2)}if(C[C.length-1]?.range[q]===i[q]){const le=d.IBorder.BuiltInDefinitions.get(C[C.length-1].stroke.getStyle());D=Math.floor(D+(le.width===2?0:le.width/2))}if(w){const le=c?"colStart":"rowStart",R=c?"colEnd":"rowEnd",te=c?M?.getRowOffset:M?.getColOffset;let k=0,b=0;N=[],v=[];const ee=C.length;for(let ne=0;ne<ee;ne++){const Re=C[ne];if(Re.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&te){const Ce=te(Re.range[E])-(Z-_);Re.range[le]<i[le]&&(N.push(Ce-k),k=Ce,N.push(1),k++),Re.range[R]>i[R]&&(v.push(Ce-b),b=Ce,v.push(1),b++)}}N.length>0&&k<D&&N.push(D-k),v.length>0&&b<D&&v.push(D-b)}}let F=c?-Math.floor(y.width/2):-_,P=c?-_:-Math.floor(y.width/2);const W=h&&y.width>2?-1:0;return s.jsx(mr,{offsetX:p+F+W,offsetY:T+P+W,length:D+_,isVertical:c,stroke:$,width:y.width,dashArray:N??y.pattern,dashArrayAdditional:v,isDouble:w,isAngled:y.description.toLowerCase().includes("slant")},t)},Co=({getBorderAt:e,rendererBorder:t=Cl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const h=r.useCallbackRef(n,[n]);return{renderOverlay:o.useMemo(()=>C=>{const M=C.toClipBounds(C.getRangeCoordsBounds(),-3);if(!M)return;const y=h(C);if(y.length===0)return;const p=C.getVisibleColumnOffsets(),T=C.getVisibleRowOffsets();let I=[],z=[];const D=C.getVisibleColumns(),_=C.getVisibleRows(),$=[],w=[],N=[],v=[],E=(le,R,te,k,b,ee,ne)=>{const Re={index:k,stroke:b,visibleIndex:te,edge:ee,length:ne};le[R]||(le[R]=[]),le[R].length>0&&le[R][le[R].length-1]?.index===k?le[R][le[R].length-1]=Re:le[R].push(Re)},q=C.getVisibleRangeCoords(),Z=y.length;for(let le=0;le<Z;le++){const R=y[le],te=R.coords;if(!te)continue;const k=R?.range??{rowStart:te.rowIndex,colStart:te.colIndex,rowEnd:te.rowIndex,colEnd:te.colIndex};if(!ge.CoordUtils.isRangesIntersect(k,q)&&!ge.CoordUtils.isRangeWithinRange(k,q))continue;const b=te.colIndex,ee=te.rowIndex,ne=p[b],Re=T[ee];if(k.rowEnd!==k.rowStart){const H=T[k.rowStart]?.spanIndex??-1,U=T[k.rowEnd]?.spanIndex??T[_[_.length-1]].spanIndex+1;I.push({...k,rowStart:H,rowEnd:U})}if(k.colEnd!==k.colStart){const H=p[k.colStart]?.spanIndex??-1,U=p[k.colEnd]?.spanIndex??p[D[D.length-1]].spanIndex+1;z.push({...k,colStart:H,colEnd:U})}const Ce=R.value,ye=e(Ce,le);if(!ye||ye.isEmpty())continue;const Pe=ye.getLeft(),ze=ye.getTop(),Ae=ye.getRight(),Ie=ye.getBottom();let ue=1,O=1;if(!ne||!Re)continue;const xe=ne.spanIndex,Le=Re.spanIndex;Pe.isNone()||E($,xe,Le,ee,Pe,d.IBorder.Edge.Left,ue),ze.isNone()||E(w,Le,xe,b,ze,d.IBorder.Edge.Top,O),Ae.isNone()||E($,xe+O,Le,ee,Ae,d.IBorder.Edge.Right,ue),Ie.isNone()||E(w,Le+ue,xe,b,Ie,d.IBorder.Edge.Bottom,O)}const F=(le,R,te)=>{const k=[];return le.forEach((b,ee)=>{let ne=null;b.sort((Ce,ye)=>Ce.visibleIndex-ye.visibleIndex);const Re=b.length;for(let Ce=0;Ce<Re;Ce++){const ye=b[Ce];if(!ye?.stroke||R[ee]===void 0&&R[ee-1]===void 0)continue;let Pe=!1;if(te){const ue=I.length;for(let O=0;!Pe&&O<ue;O++){let xe=I[O];xe.colStart<=ye.index&&xe.colEnd>=ye.index&&xe.rowStart<ee&&xe.rowEnd>=ee&&(Pe=!0)}}else{const ue=z.length;for(let O=0;!Pe&&O<ue;O++){let xe=z[O];xe.rowStart<=ye.index&&xe.rowEnd>=ye.index&&xe.colStart<ee&&xe.colEnd>=ee&&(Pe=!0)}}if(Pe)continue;const ze=ye.stroke?.getColor(),Ae=ze?ze.toRGBA().toString():l,Ie=ye.stroke.getStyle()+":"+Ae;(Ie!==ne?.key||ne&&ne.visibleIndex+1<ye.visibleIndex)&&(ne&&k.push(ne),ne={key:Ie,index:R[ee]??R[ee-1]+1,visibleIndex:ye.visibleIndex,edge:ye.edge,stroke:ye.stroke,from:ye.index,to:ye.index+ye.length-1,intersections:[],length:1}),ne.to=ye.index+ye.length-1,ne.visibleIndex=ye.visibleIndex}ne&&k.push(ne)}),k};I=I.sort(vl),z=z.sort(pl);const P=F($,D,!1),W=F(w,_,!0);if(P.length===0&&W.length===0)return null;const pe=W.length;for(let le=0;le<pe;le++){const R=W[le];let te=ge.CommonUtils.findEqualOrGreater(P,R.from,b=>b.index),k=!1;for(;!k;){const b=P[te++];b&&b.index>=R.from&&b.index<=R.to+1&&b.from<=R.index&&b.to+1>=R.index&&(R.intersections.push({stroke:b.stroke,range:{rowStart:b.from,rowEnd:b.to+1,colStart:b.index,colEnd:b.index}}),b.intersections.push({stroke:R.stroke,range:{rowStart:R.index,rowEnd:R.index,colStart:R.from,colEnd:R.to+1}})),k=!b||b.index>R.to+1}}for(let le=0;le<pe;le++){const R=W[le];let te=R.stroke;const k=`rBorder:${R.index}:${R.from}:${R.to}:${R.edge}`,b={rowStart:R.index,rowEnd:R.index,colStart:R.from,colEnd:R.to+1},ee=C.getLayout(),ne=!1,Re=ee.getColOffset(b.colStart),Ce=ee.getRowOffset(b.rowStart),ye=[Re,Ce,ee.getColOffset(b.colEnd),Ce];N.push(t({key:k,points:ye,stroke:te,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:b,intersections:R.intersections,layout:ee,isVertical:ne}))}const de=P.length;for(let le=0;le<de;le++){const R=P[le];let te=R.stroke;const k=`cBorder:${R.index}:${R.from}:${R.to}:${R.edge}`,b={rowStart:R.from,rowEnd:R.to+1,colStart:R.index,colEnd:R.index},ee=C.getLayout(),ne=!0,Re=ee.getColOffset(b.colStart),Ce=[Re,ee.getRowOffset(b.rowStart),Re,ee.getRowOffset(b.rowEnd)];v.push(t({key:k,stroke:te,points:Ce,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:b,intersections:R.intersections,layout:ee,isVertical:ne}))}return s.jsxs("svg",{width:`${M.width}`,height:`${M.height}`,viewBox:`0 0 ${M.width} ${M.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${M.width}px`,height:`${M.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:[v,N]},"borders")},[e,i])}},Lo=ge.AnchorLocation.Center,yl=Object.freeze({horizontal:!1,vertical:!1}),No=ge.TypesUtils.EmptyTopLeft,wl=(e,t)=>ge.CoordUtils.EmptyCell,bl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),xl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:h,forceThinBorder:c,children:C,...M}=e,y=o.useRef(null),[p,{width:T,height:I}]=Wt(),z=n??T,D=i??I,_=o.useMemo(()=>{const R=[];for(let te=0;te<l;te++)for(let k=0;k<f;k++){const b={colIndex:k,rowIndex:te};R.push({coords:b,value:b})}return R},[]),$=o.useCallback(R=>_,[_]),{renderOverlay:w}=Co({getVisibleCells:$,getBorderAt:t,darkMode:h,forceThinBorder:c}),N=Math.floor(z/f),v=Math.floor(D/l),E={getColOffset:R=>Math.ceil(R*N)+0,getRowOffset:R=>Math.ceil(R*v)+0,getColIndex:R=>Math.floor((R-0)/N)-1,getRowIndex:R=>Math.floor((R-0)/v)-1},q={rowStart:0,colStart:0,rowEnd:l,colEnd:f},Z={x:0,y:0,width:Math.max(0,z)+0,height:Math.max(0,D)+0},F=o.useMemo(()=>{const R={},te=Math.floor(z/f);for(let k=0;k<f;k++)R[k]={offset:k*te,size:te,spanIndex:k};return R},[z,D]),P=o.useMemo(()=>{const R={},te=Math.floor(D/l);for(let k=0;k<l;k++)R[k]={offset:k*te,size:te,spanIndex:k};return R},[z,D]);if(!w)return null;const W={width:z,height:D},pe={width:z,height:D},de={getStage:()=>y.current,getTotalSize:()=>W,getViewportSize:()=>pe,getLayout:()=>E,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>q,getVisibleRows:()=>{const R=[];for(let te=0;te<l;te++)R.push(te);return R},getTotalRangeCoords:()=>q,getRelativePointFromClient:(R,te)=>({x:R,y:te}),getVisibleColumns:()=>{const R=[];for(let te=0;te<f;te++)R.push(te);return R},toClipBounds:(R,te)=>Z,toViewBounds:R=>R,toAbsoluteBounds:R=>R,getBounds:()=>Z,getInsets:()=>null,getRangeCoordsBounds:(R,te)=>null,getVisibleColumnOffsets:()=>F,getVisibleRowOffsets:()=>P,allViews:()=>({[Lo]:de}),getAnchor:()=>Lo,getZoom:()=>1,scrollCellCoordsIntoView:bl,getCellCoordsFromClient:wl,getScrollOrientation:()=>yl,getScrollTopLeft:()=>No,getFreezeTopLeft:()=>No},le=w(de);return s.jsxs("div",{style:{...a,position:"relative",display:"flex"},...M,children:[s.jsx("div",{ref:Nt([y,p]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:C}),le]})});function pr(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=pr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function ct(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=pr(e))&&(i&&(i+=" "),i+=t);return i}const ql="_sheetxl-sheet_1qeq6_5",Sl="_viewport-overlay_1qeq6_6",vr=e=>{const{style:t,...n}=e??{};return s.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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"})]})},Rl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...h}=e??{},[c,C]=o.useState(null);o.useEffect(()=>{(async()=>{const v=await d.LicenseManager.getDetails();C(v)})()},[]);const[M,y]=o.useState(!1),p={opacity:.65},T=o.useMemo(()=>{const v=c?.getExceptions(),E=v?.length??0;if(E===0)return null;const q=[];for(let Z=0;Z<E;Z++){const F=v[Z];q.push(s.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:F},Z))}return q},[c,n]);if(c===null||c.isValidFor(l))return null;const I=c.getType(),z=!T&&I.endsWith("ity"),D=c.getLicensee(),_=z?1.6:1,$=135/_,w=37/_;let N=null;return!I&&D?.length>0&&(N=s.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),s.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...h,children:s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[M?s.jsx(vr,{style:p}):s.jsx("svg",{width:$,height:w,style:p,children:s.jsx("image",{style:{width:$,height:w},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),s.jsxs("div",{children:[N,T,s.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),Qe=(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={},h=l.length;for(let C=0;C<h;C++){const M=l[C];f[M]=(y,p)=>{i.current[M]?.(y,p)}}const c=e.addListeners(f,n);if(a)for(let C=0;C<h;C++)f[l[C]](e);return()=>{c?.()}},[e])},En=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 ge.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}},Cr=o.createContext(void 0),kl={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},yr=()=>o.useContext(Cr)||kl,Gt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},yo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:h,style:c,className:C,...M}=e,y=o.useMemo(()=>ct("taskpane-title",C,Gt.TaskPaneTitle,{focused:h}),[C,h]);return s.jsxs("div",{ref:t,className:y,style:c,...M,children:[s.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),s.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:p=>{p.stopPropagation()},onPointerUp:()=>{l()},children:s.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));yo.displayName="TaskPaneTitle";const Ml=e=>s.jsx(yo,{...e}),Tl=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:h,onMounted:c,onUnmounted:C,wrapperPane:M,propsPane:y,renderTaskPanelTitle:p=Ml,style:T,className:I,...z}=e,[D,_]=o.useState(null),[$,w]=o.useState(!1),N=r.useCallbackRef(a,[a]),v=o.useRef(null),E=o.useRef(null);o.useEffect(()=>(c?.(i),()=>{C?.(i)}),[i]);const q=o.useRef([]),Z=o.useMemo(()=>({addListener:W=>{const pe=l(W);return q.current.push(pe),pe},close:()=>{N?.()},focus:W=>{v.current?.focus(W)}}),[l]);o.useEffect(()=>()=>{for(const W of q.current)W();q.current=[]},[]);const F=o.useMemo(()=>(i.renderTaskPanelTitle??p)({ref:E,title:i.getTitle(),icon:null,readOnly:!1,focused:$,onClose:N,onPointerDown:W=>{}}),[i,$]),P=o.useMemo(()=>{let W=i.renderTaskPane({entryKey:i.key,model:f,commands:h,frame:Z,...y},t);return M&&(W=M(W)),W},[i,f,h,t]);return s.jsxs("div",{className:ct("taskpane-frame",I,Gt.TaskPaneFrame),tabIndex:0,ref:v,style:T,onPointerDown:async W=>{W.currentTarget.focus()},onFocus:W=>{W.relatedTarget&&!D&&_(W.relatedTarget),w(!0)},onBlur:W=>{D&&!v?.current?.contains(W.relatedTarget)&&_(null),W.relatedTarget&&w(!1)},...z,children:[s.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:F}),s.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:P})]})})),wo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:h=En,style:c,className:C,...M}=e,y=o.useMemo(()=>a.map(I=>{const z=h.getRegisteredTaskPane(I);if(!z)return null;let D=z.getIcon?.();D&&(typeof D=="string"&&(D=s.jsx(r.DynamicIcon,{iconKey:D})),D=s.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:D}));const _=I===f;return s.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ct("taskpane-strip-item",Gt.TaskPaneStripItem,{selected:_}),onClick:()=>e.onSelect(I),children:[D,z.getTitle()]},I)}),[a,f,l,h]),p=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),T=o.useMemo(()=>ct("taskpane-strip",C,Gt.TaskPaneStrip),[C]);return s.jsx("div",{ref:p,className:T,style:c,...M,children:y})}));wo.displayName="TaskPaneStrip";const Il=e=>s.jsx(wo,{...e}),El=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=En,model:a,commands:l,onOpen:f,onClose:h,wrapperPane:c,propsPane:C,wrapperFrame:M,propsFrame:y,renderTaskPanelTitle:p,renderTaskPaneStrip:T=Il,alwaysShowStrip:I,style:z}=e,D=r.useCallbackRef(f,[f]),_=r.useCallbackRef(h,[h]),[$,w]=o.useState(null),N=o.useRef(null),[v,E]=o.useState([]),q=o.useRef(new Set),Z=r.useCallbackRef(async(R,te=!1)=>{const k=Array.from(q.current),b=k.length;let ee=!0;for(let ne=0;ee&&ne<b;ne++){const Re=k[ne];if(Re.onBeforeHide)try{await Promise.resolve(Re.onBeforeHide())===!1&&(ee=!1)}catch{ee=!1}}return ee},[]),F=r.useCallbackRef(R=>{const te=Array.from(q.current),k=te.length;E(b=>{const ee=b.findIndex(Re=>Re.key===R);if(ee===-1)return b;const ne=[...b];return ne.splice(ee,1),ne.length===0?(w(null),_?.(),ne):(P(ne[Math.max(ne.length-1,ee-1)].key),ne)});for(let b=0;b<k;b++){const ee=te[b];try{ee.onHide?.()}catch{}}},[_]),P=r.useCallbackRef(async R=>{const te=i.getRegisteredTaskPane(R);if(!te)return void console.warn(`Invalid taskpane '${R}'`);if(N.current===R||$&&!await Z($.key))return;const k=o.createRef();let b=s.jsx(Tl,{ref:()=>{N.current=null},entry:te,model:a,commands:l,close:async()=>{await Z(R)&&F(R)},wrapperPane:c,propsPane:C,renderTaskPanelTitle:p,listenerContainer:ne=>(q.current.add(ne),()=>{q.current.delete(ne)}),onMounted:ne=>{ne.key===R&&(N.current=null),D?.()},onUnmounted:ne=>{},...y});M&&(b=M(b));const ee={key:R,elem:b,ref:k};E(ne=>{if(ne.findIndex(Ce=>Ce.key===R)!==-1)return ne;const Re=[...ne];return Re.push(ee),Re}),w(ee),N.current=R},[$,M,C,p]);o.useEffect(()=>{$&&!N.current&&P($.key)},[y,a]);const W=r.useImperativeElement(t,()=>({activateTaskPane:P}),[i,C,a,l]),pe=o.useMemo(()=>v.map(R=>R.key),[v]),de=o.useMemo(()=>{if(pe.length<=1&&!I)return null;const R={className:Gt.TaskPaneAreaStrip,taskPanes:pe,selected:$?.key,onSelect:te=>{P(te)},registry:i};return T(R)},[pe,$,i,I]),le=$?.elem;return s.jsxs("div",{ref:W,className:ct("taskpane-area",n,Gt.TaskPaneArea),style:z,children:[le,de]})})),qn=new d.Color("transparent");function wr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:h}=e,c=r.useNotifier(),C=yr(),M=r.useCallbackRef(f,[f]),y=r.useCallbackRef(h,[h]),p=o.useMemo(()=>({serializer:{parse:u=>u?t?.getStyles().parseColor(u):null,stringify:u=>u?u.toString():null}}),[t]),[T,I]=r.usePersistenceState("sheet.lastBorder",null),[z,D]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),p),[_,$]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),p),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const[N,v]=o.useReducer(u=>u+1,0),[E,q]=o.useReducer(u=>u+1,0),Z=r.useGlobalClipboard(),F=o.useRef(null),[P,W]=o.useReducer(u=>u+1,0),[pe,de]=o.useReducer(u=>u+1,0),le=o.useRef(null),R=r.useCallbackRef(()=>{if(!t)return null;const u=le.current;if(u)return u;const L=t.getSelectedCell(),K=L.getCoords(),m=t.getSelectedRanges(),A=t.getSelectedRange(),G=t.getTables(),J=G.getItems({address:A}),re=G.getItems({address:K});let x=null;re.length>0&&(x=re[0]);const B=m.getMerges().length>0,S=m.isOverlapping();let j=!0;const se=m.getCoords(),ae=se.length;for(let we=0;j&&we<ae;we++)j=ge.CoordUtils.isSingleCell(se[we]);return u&&x===u.table&&ge.CommonUtils.isEqualArrays(J,u.tables)||requestAnimationFrame(()=>{de()}),le.current={tables:J,table:x,ranges:m,rangesCoords:se,range:A,cell:L,containsMerge:B,isOverlapping:S,isSingleCell:j},le.current},[t]),te=o.useCallback(ge.CommonUtils.debounce(W,210),[]);o.useEffect(()=>{F.current=t,W()},[t]),Qe(t.getSelection(),{onChange:()=>{le.current=null,te()}});const k=r.useCallbackRef(async(u,L,K=null,m=!1,A=!0)=>{const G=u?.getLabel?.(),J=async()=>{const S=await Promise.resolve(A&&c.showBusy(G??"Busy..."));try{await t.doBatch(async()=>L(t),G),m&&w.setMode(null),S&&S()}catch(j){if(S&&S(),!j)return;c.showError(j)}},re=[];let x=!1;const B=async()=>(re.push(J),(async()=>{if(!x){for(x=!0;re.length>0;){const S=re.shift();S&&await S()}x=!1}})());if(n){let S=null;if(K!==!1&&u){const j=K??G;S=new r.SimpleCommand(u.getKey(),l,{label:j,description:j},B)}n(S)}return B()},[t,n,c]),b=r.useCallbackRef((u,L,K=!1,m)=>(m||(m={autoSelect:!0,autoFit:!0}),k(u,A=>{const G=A.getSelectedRanges();K&&G.getStyle().update(null,m),G.getStyle().update(L,m)})),[t]),ee=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRange().setHyperlink(L)})},[t]),ne=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRange().setComments(L)})},[t]),Re=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRanges().clear(L)})},[t]),Ce=r.useCallbackRef(async(u,L,K=!1,m=!1)=>k(u,async A=>{let G=A.getSelectedRanges();K&&(L===d.IRange.Orientation.Row?G=G.getEntireRows(m):L===d.IRange.Orientation.Column&&(G=G.getEntireColumns(m)));let J=null;const re=w.getMode()?.key;if(re==="copy"||re==="cut"){const x=await Z.getClipboard().readReference();x&&x.getItemType()==="range"&&(J=x.getItem(),J.getCoords()||(J=null))}if(J){const x=await G.insertFrom(J,{...J.getMarkOptions(),orientation:L,autoSelect:!0});!x||x.isEntireRows()||x.isEntireColumns()||x.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else G.insert({orientation:L,autoSelect:!0})},"Insert Cells",!1),[w]),ye=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),Pe=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),ze=r.useCallbackRef((u,L)=>{k(u,async K=>{const m=K.getSelectedRange(),A=K.getSelectedCell().getCoords();let G=null,J=0;const re=A.rowIndex>0?K.getRange({rowIndex:A.rowIndex,colIndex:A.colIndex}).getExtended(d.IRange.Direction.Up):null;re&&K.getRange({colStart:A.colIndex,rowStart:re.getCoords().rowStart,colEnd:A.colIndex,rowEnd:re.getCoords().rowStart}).isContentful()&&(G=d.IRange.Direction.Up,J=A.rowIndex-re.getCoords().rowEnd);const x=A.colIndex>0?K.getRange({rowIndex:A.rowIndex,colIndex:A.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(x&&K.getRange({colStart:x.getCoords().colStart,rowStart:A.rowIndex,colEnd:x.getCoords().colStart,rowEnd:A.rowIndex}).isContentful()){const S=A.colIndex-x.getCoords().colEnd;(S<J||!G)&&(G=d.IRange.Direction.Left,J=S)}let B=null;if(G===d.IRange.Direction.Up){if(B={...re.getCoords()},(B.rowEnd===A.rowIndex||!K.getRange({colIndex:A.colIndex,rowIndex:A.rowIndex-1}).isContentful())&&B.rowStart>0&&K.getRange({colIndex:A.colIndex,rowIndex:B.rowStart-1}).isContentful()){const S=re.getExtended(d.IRange.Direction.Up);B={colStart:A.colIndex,rowStart:S.getCoords().rowStart,colEnd:A.colIndex,rowEnd:re.getCoords().rowEnd}}B.rowEnd=A.rowIndex-1}else if(G===d.IRange.Direction.Left){if(B={...x.getCoords()},(B.colEnd===A.colIndex||!K.getRange({colIndex:A.colIndex-1,rowIndex:A.rowIndex}).isContentful())&&B.colStart>0&&K.getRange({colIndex:B.colStart-1,rowIndex:A.rowIndex}).isContentful()){const S=x.getExtended(d.IRange.Direction.Left);B={colStart:S.getCoords().colStart,rowStart:A.rowIndex,colEnd:S.getCoords().colEnd,rowEnd:A.rowIndex}}B.colEnd=A.colIndex-1}if(m.size!==1&&G){const S=m.getCoords(),j=m.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),se={...B},ae=S.rowStart,we=S.rowEnd,Y=S.colStart,fe=S.colEnd,V=G===d.IRange.Direction.Up;for(let X=Y;X<=fe;X++){se.colStart=V?X:B.colStart+(X-Y),se.colEnd=V?X:B.colEnd+(X-Y);for(let oe=ae;oe<=we;oe++){se.rowStart=V?B.rowStart+(oe-ae):oe,se.rowEnd=V?B.rowEnd+(oe-ae):oe;const Fe=K.getRange(se).toString();j.pushAt(oe,X,`=${L}(${Fe})`)}}j.apply()}else{const S=B?K.getRange(B).toString():"",j=`=${L}(`;M?.({text:`${j}${S})`,editMode:!0,initialSelection:{start:j.length,end:j.length+S.length}})}},!1)},[t]),Ae=r.useCallbackRef((u,L,K=!1,m=!0)=>{k(u,async A=>{const G=R()?.table;if(G)return void G.updateStyleOptions(L);const J=A.getSelectedRanges().getFixed(!0),re=A.getSelectedRange().getDefaultSortCriteria(),x={getNames:()=>A.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},B={ranges:J,hasHeader:re?.options?.hasHeader??!1},S=async se=>{if(!(se=await Promise.resolve(se)))return null;const ae=await Promise.resolve(c.showBusy(u.getLabel()));try{await A.getTables().add(se.ranges.at(0),{styleName:L?.name,clearFormatting:K,hasHeader:se.hasHeader}).getRange().select(),ae()}catch(we){ae(),c.showError(we)}};if(!m)return void await S(B);const j={initialValue:B,context:()=>x,onInput:se=>{S(se)}};c.showWindow("tableNew",j)},!1,!0,!1)},[]),Ie=r.useCallbackRef(()=>i,[i]),ue=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:Ie,getNames:()=>t.getNames()}),[t]),O=r.useCallbackRef(async(u,L,K,m=!0)=>{if(!L){const G=R();if(!G)return;let J=G.range;J.size===1&&(J=J.getSurrounding());const re=G.table;re&&(L=re),await J.select()}if(!L)return;try{K&&await L.select()}catch{}if(!m)return;const A=new Promise(async(G,J)=>{u.update({context:ue(L)}),C.activateTaskPane("tableDetails",{}),G(!0)});try{if(!await A)return}catch(G){c.showError(G)}},[c]),xe=r.useCallbackRef(async(u,L,K=!1)=>{let m=null;if(L?L.isITable?m=L:L.getValue()&&(m=L.getValue()):m=R()?.table,m){if(!K){const A=m.getRange().getCoords(),G=(A.colEnd-A.colStart+1)*(A.rowEnd-A.rowStart+1);if(G>1e4&&await c.showOptions({title:"Confirm",description:`Converting a table to range with '${G}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
+
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}k(u,async()=>{K?m.delete():m.convertToRange()},!1,!0)}},[c]),Le=r.useCallbackRef((u,L,K)=>{k(u,async m=>{const A=R();if(!A)return;const G=A.ranges;if(G.getCount()>1)throw new ge.ExpectedError("Can not sort on multiple cell ranges. Please select a single range and try again.");let J=G.at(0);J.size===1&&(J=J.getSurrounding());const re=A.cell;let x=J.getDefaultSortCriteria(d.IRange.Orientation.Row,re);if(!x){if(K)throw new ge.ExpectedError("Invalid sort selection. Sort requires a single range with data.");return}const B=async we=>{if(!(we=await Promise.resolve(we)))return;const Y=await Promise.resolve(c.showBusy(u.getLabel()));try{J.doBatch(()=>{const fe={...we,...L};J.sort(fe),J.autoFit({orientations:fe?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.getLabel?.())}catch(fe){Y(),c.showError(fe)}Y()};let S=x.options;if(!K)return void await B(S);let j=J;S.hasHeader&&(j=J.getIntersect(x.sortCoords)),j.select();const se={range:J,cell:re},ae={initialValue:S,context:()=>se,onInput:we=>{B(we)}};c.showWindow("sort",ae)},!1,!1,!1)},[c]),H=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),L=t.getSelectedRanges().getFlattened().getCoords(),K=(G=>{const J=new Blob([G],{type:"application/javascript"}),re=URL.createObjectURL(J),x=new Worker(re);return URL.revokeObjectURL(re),x})("console.log('hello from worker');");setTimeout(()=>{K.terminate(),console.log("Worker terminated")},5e3);let m=-1;for(let G=0;m===-1&&G<L.length;G++)ge.CoordUtils.isCellWithinRange(u.cell,L[G])&&(m=G);if(ge.CoordUtils.isEqualRangesArrays(u.ranges,L))return;const A={cell:u.cell,ranges:L,rangeIndex:m};t.getSelection().updateCoords(A)},[t]),U=r.useCallbackRef(()=>{console.log("selectComments")},[t]),he=r.useCallbackRef(async(u=!1,L=!1)=>{let K=null;if(L)K=t.getEntireRange();else{const m=t.getSelectedRange();if(m.isEntireRange()){const A=t.getSelection().getCoords().cell,G=t.getRange(A);K=G.getSurrounding(),K.isEntireRange()&&(K=G)}else K=m.getSurrounding({contentOnly:u})}K&&await K.select()},[t]),ce=r.useCallbackRef((u,L,K)=>{k(u,async m=>{let A=m.getSelectedRanges();K&&(L===d.IRange.Orientation.Row?A=A.getEntireRows():L===d.IRange.Orientation.Column&&(A=A.getEntireColumns())),A.delete(L)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let L=null;const K=y(),m=Math.min(K.width-8,480),A=Math.min(K.height-8,288);try{t.getSelectedRanges(),L=await t.getMovables().add({bounds:{x:K.left+(K.width-m)/2,y:K.top+(K.height-A)/2,width:m,height:A},type:"chart",json:u.template}),L.select(),w.setMode(null)}catch(G){c.showError(G)}return L},[t,c]);const me=r.useCallbackRef(async(u,L,K)=>{const m=await c.showBusy(u.getLabel());try{const A=await t.getMovables().addImage(L,{autoSelect:!0,...K});return m(),w.setMode(null),A}catch(A){m();let G=A;typeof G!="string"&&(console.warn(A),G="Unable to resolve image."),c.showMessage(G,{type:r.NotifierType.Error})}},[t,c]),Te=r.useCallbackRef((u,L)=>{k(u,async K=>{const m=K.getSelectedRanges();m.doBatch(()=>{const A=L===d.IRange.Direction.Up||L===d.IRange.Direction.Down,G=m.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(A?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let J=0;J<G.length;J++){const re=G[J];let x=re;const B=K.getRange(x).getMerges();let S=0,j=0;if(B.length>0){const se=B[0];S=se.rowEnd-se.rowStart,j=se.colEnd-se.colStart}L===d.IRange.Direction.Left?x={...re,colStart:re.colEnd+j}:L===d.IRange.Direction.Right?x={...re,colEnd:re.colStart+j}:L===d.IRange.Direction.Up?x={...re,rowStart:re.rowEnd+S}:L===d.IRange.Direction.Down&&(x={...re,rowEnd:re.rowStart+S}),K.getRange(x).autoFill(re,{filler:d.AutoFill.Types.Copy}),K.getRange(re).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.getLabel()})})},[c]),ie=r.useCallbackRef(()=>{let u=null;const L=t.getSelectedCell().getCoords();if(L?.rowIndex>0){const K=t.getRange({rowIndex:L.rowIndex-1,colIndex:L.colIndex}).getCell();K&&(u=K.toTextUnformatted(!0))}M?.({text:u})},[t]),qe=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]}]},(u=!1)=>he(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>he(!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]}},()=>H()),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",sortFilter:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){Le(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending",sortFilter:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){Le(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…",sortFilter:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.",icon:"SortCustom"},function(){Le(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(u){b(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(u){Ae(this,u)}),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(u){Ae(this,u,!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(){Ae(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."},ye),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(u){b(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){b(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){b(this,{font:{fill:u}})}),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(){b(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.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(){b(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){b(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){b(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,L){const K=this,m={initialValue:u??L.getState(),context:()=>L.getContext(),onInput:(A,G)=>{b(K,{numberFormat:A})}};c.showWindow("numberFormat",m)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){b(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(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(){b(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(){b(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(){b(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(u){b(this,{numberFormat:u??'_($* #,##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(){b(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(){b(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(){b(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(){b(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){b(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",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(u){u&&ze(this,u.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(){ze(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ze(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ze(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ze(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ze(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(){M?.({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(){M?.({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:()=>R().cell,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,L){const K=this,m={context:()=>L.getContext(),onInput:A=>{ee(K,A)}};c.showWindow("hyperlink",m)}),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:()=>R().cell},async(u,L)=>{const K=L.getContext();if(!K)return;const m=K.getHyperlink();if(m)try{await m.open()}catch(A){c.showError(A)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>R().cell},function(u,L){ee(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."},(u,L)=>{((K,m)=>{K?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[m," is not yet implemented.",s.jsx("br",{}),s.jsx("br",{}),"Please see the ",s.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(c,L.getLabel())}),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:()=>R().cell},async function(u,L){const K=this,m={context:()=>L.getContext(),onInput:A=>{ne(K,A)}};c.showWindow("comments",m)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>R().cell},function(u,L){ne(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(u=null){let L=null,K=null;typeof u=="string"?K=u:L=u?.file?u.file:u,(L||(L=await ge.CommonUtils.openFileDialog(K??"image/*"),L))&&await me(this,{file:L},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(u){if(!u){const L=await c.showInput({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",propsInput:{style:{minWidth:"440px"}},options:["Insert"]});if(L.option!=="Insert")return;u=L.input}u&&me(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Ae(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(u){let L=null,K=!1;u.isITable?L=u:u.getValue()&&(L=u.getValue(),K=!0),O(this,L,K)}),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(u){
|
|
13
|
+
The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(u){xe(this,u,!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(u){
|
|
15
|
+
The values and the formatting are preserved.`,icon:"InsertTable"},function(u){xe(this,u,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const u=this.getContext().table();u&&u.setShowTotals(!u.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const u=this.getContext().table();u&&u.setShowHeaders(!u.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter",sortFilter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const u=this.getContext().table();u&&u.setShowFilterButton(!u.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply",sortFilter:"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",sortFilter:"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(){Ce(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(){Ce(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 Ce(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 Ce(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 Ce(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 Ce(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 Ce(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 ce(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 ce(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 ce(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 ce(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 ce(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 Te(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 Te(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 Te(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 Te(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 b(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 b(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return b(this,u=>{const L=u.getAlignment().getIndent()-1;return{alignment:{indent:L>0?L:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return b(this,u=>{const L={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(L.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),L})}),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(){
|
|
17
|
+
The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){Re(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(){Re(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(){Re(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){Re(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(){qe(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"})],[]),g=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(be,!0),u},[a,be]);r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=w.getMode()?.key==="formatPainter";g.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>L}).updateCallback(()=>L?void w.setMode(null):g.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[w,N,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{q()}});const Ne=()=>{g.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),g.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??qn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:qn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Be=()=>{g.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{T(u)},darkMode:i.darkMode,quickBorder:M,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Be()},[M]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed(),L=A(),U=L?.cell.getHyperlink();g.getCommand("openHyperlink").update({disabled:!U}),g.getCommand("deleteHyperlink").update({disabled:u||!U});const m=U?"Edit":"Insert",F="Link";g.getCommand("updateHyperlink").update({label:()=>`${m} ${F}`,icon:()=>m==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${m} ${F}…`,insert:`${F}…`,hyperlink:`${m}…`},disabled:u})},[j,N]),o.useEffect(()=>{const u=A(),L=u?.cell.getComments(),U=()=>L?"Edit":"Insert",m=()=>L?"Comments":"Comment";g.getCommand("updateComments").update({label:()=>`${U()} ${m()}`,icon:()=>L?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${U()} ${m()}…`,insert:`${m()}…`}})},[j,N]),Qe(t,{onViewChange:()=>{const u=t.getView();g.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),g.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),g.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),g.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),g.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),g.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),g.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),Ne()},onTabColorChange:()=>{Ne()},onMergesChange:()=>{q()},onMovablesChange:()=>{q()},onTablesChange:()=>{q()},onProtectionChange:()=>{q(),v()},onStyleChange:()=>{Ne(),Be(),q()}}),o.useEffect(()=>{Ne(),Be()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=A(),U=L.table,m=L.tables,F=m.length>0&&!U||u,G=ge(U),te={context:G};g.getCommand("editTable").update(te),g.getCommand("deleteTable").update(te),g.getCommand("convertTableToRange").update(te);const le={context:G,disabled:F};g.getCommand("formatTableStyle").update({label:U?"Apply Table Style":"Format As Table",...le}),g.getCommand("formatTableStyleClearCellStyles").update(le),g.getCommand("deleteTableStyle").update(le),g.getCommand("convertTableToRange").update(le),g.getCommand("insertTable").update({disabled:F||m.length>0});const b={context:G,disabled:F||m.length===0};g.getCommand("tableHeaderRowToggle").update(b),g.getCommand("tableTotalRowToggle").update(b),g.getCommand("autoFilterToggle").update(b),g.getCommand("formatTableStyleClearTableStyle").update({...b,disabled:b.disabled||!U||U.getStyleOptions().name===null})},[ve,N]),o.useEffect(()=>{g.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),g.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale())})}),g.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),g.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),g.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),g.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),g.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),g.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),g.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),g.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),g.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?d.ISheetView.HeaderTextStyle.One:d.ISheetView.HeaderTextStyle.Zero})}),g.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),g.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),g.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),g.getCommand("insertFunction").update({context:()=>({searchByCategory:async u=>{const L=t.getWorkbook();if(!L)return he.CommonUtils.EmptyArray;const U=await L.getScripts().searchFunctions({category:u,includeBuiltIn:!0});return U.sort((m,F)=>m.getName().localeCompare(F.getName())),U}})})},[t]),o.useEffect(()=>{const u=A()?.cell.getCoords(),L=t.getView().getFreezePanes(),U=()=>L.coords.rowIndex!==0,m=()=>L.coords.colIndex!==0,F=()=>L.coords.rowIndex!==0||L.coords.colIndex!==0;g.getCommand("freezeToggle").updateCallback(()=>{F()?t.getView().setFreezePanes(null):F()?m()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):U()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:F,disabled:()=>!u||!F()&&u.rowIndex===0&&u.colIndex===0}),g.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:U()?0:u.rowIndex}})}).update({state:U,disabled:()=>!u||!U()&&u.rowIndex===0}),g.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:m()?0:u.colIndex}})}).update({state:m,disabled:()=>!u||!m()&&u.colIndex===0}),g.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!F()})},[I,j,t,i]);const Te=t?.getSelectedCell().getStyle();return o.useEffect(()=>{const u=Te.getFont(),L=Te.getAlignment(),U=L.getHorizontal(),m=L.getVertical(),F=L.getOverflow(),G=L.getRotation();g.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>A().cell.getStyle(!0).getNamed(),bodyStyle:ke,createTemporaryCell:we=>t.createTemporaryCell(we)})}),g.getCommand("formatFillColor").update({state:()=>{let we=null;const Se=Te.getFill();return Se?.getType()===d.IFill.Type.Solid?we=Se.getColor():Se?.getType()===d.IFill.Type.Gradient?we=Se.getStops()?.[0]?.getColor():Se?.getType()===d.IFill.Type.Pattern&&(we=Se.getBackground()),we},icon:()=>s.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const we=t.getStyles();return{onColorSelect:Se=>{D(Se??qn)},darkMode:i.darkMode,quickColor:z,autoColor:qn,schemeLookup:we.schemeLookup(),recentColors:we.recentColors(),addRecentColor:Se=>we.addRecentColor(Se),clearRecentColors:()=>we.clearRecentColors()}}}),g.getCommand("formatFontColor").update({state:()=>u.toJSON()?.fill?u.getFill():null,icon:()=>s.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const we=t.getStyles();return{onColorSelect:Se=>{K(Se)},darkMode:i.darkMode,quickColor:Z,autoColor:we.getNormal().getFont().getFill(),schemeLookup:we.schemeLookup(),recentColors:we.recentColors(),addRecentColor:Se=>we.addRecentColor(Se),clearRecentColors:()=>we.clearRecentColors()}}}),g.getCommand("formatNumberFormat").update({state:()=>Te.getNumberFormat(),context:()=>A().cell}),g.getCommand("formatNumberDialog").update({state:()=>Te.getNumberFormat(),context:()=>A().cell}),g.getCommand("formatFontFamily").update({state:()=>u.getFamily()}),g.getCommand("formatFontSize").update({state:()=>u.getSize()});const te=function(){const we=u.getWeight()||0;return!isNaN(we)&&we>500};g.getCommand("formatBoldToggle").updateCallback(function(){S(this,{font:{weight:te()?400:700}})}).update({state:te});const le=function(){return u.getStyle()===d.IFont.Style.Italic};g.getCommand("formatItalicToggle").updateCallback(function(){S(this,{font:{style:le()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:le}),g.getCommand("formatStrikeThroughToggle").updateCallback(function(){S(this,{font:{strike:!u.getStrike()}})}).update({state:u.getStrike()}),g.getCommand("formatUnderlinedToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Single}),g.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Double}),g.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),g.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),g.getCommand("formatSuperscriptToggle").updateCallback(function(){S(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),g.getCommand("formatSubscriptToggle").updateCallback(function(){S(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const b=()=>F===d.ITextFrame.Overflow.Visible;g.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){S(this,{alignment:{overflow:(b(),d.ITextFrame.Overflow.Visible)}})}).update({state:b});const B=()=>F===d.ITextFrame.Overflow.Wrap;g.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){S(this,{alignment:{overflow:B()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:B});const R=function(){return F===d.ITextFrame.Overflow.Clip};g.getCommand("formatTextOverflowClipToggle").updateCallback(function(){S(this,{alignment:{overflow:R()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:R});const P=function(){return F===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){S(this,{alignment:{overflow:P()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:P});const ce=function(){return F===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){S(this,{alignment:{overflow:ce()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:ce,disabled:!0});const se=function(){return m===d.ITextFrame.VerticalAlignment.Top};g.getCommand("formatAlignTopToggle").updateCallback(function(){S(this,{alignment:{vertical:se()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:se});const ye=function(){return m===d.ITextFrame.VerticalAlignment.Center};g.getCommand("formatAlignMiddleToggle").updateCallback(function(){S(this,{alignment:{vertical:ye()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:ye});const ee=function(){return m===d.ITextFrame.VerticalAlignment.Bottom};g.getCommand("formatAlignBottomToggle").updateCallback(function(){S(this,{alignment:{vertical:(ee(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ee});const pe=function(){return m===d.ITextFrame.VerticalAlignment.Justify};g.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){S(this,{alignment:{vertical:pe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:pe});const V=function(){return m===d.ITextFrame.VerticalAlignment.Distributed};g.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){S(this,{alignment:{vertical:V()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:V});const Q=function(){return U===d.ITextFrame.HorizontalAlignment.Left};g.getCommand("formatAlignLeftToggle").updateCallback(function(){S(this,{alignment:{horizontal:Q()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:Q});const re=function(){return U===d.ITextFrame.HorizontalAlignment.Center};g.getCommand("formatAlignCenterToggle").updateCallback(function(){S(this,{alignment:{horizontal:re()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:re});const Ee=function(){return U===d.ITextFrame.HorizontalAlignment.CenterContinuous};g.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const we={alignment:{horizontal:Ee()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};S(this,we)}).update({state:Ee});const Ue=function(){return U===d.ITextFrame.HorizontalAlignment.Fill};g.getCommand("formatAlignFillToggle").updateCallback(function(){const we={alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};S(this,we)}).update({state:Ue});const Oe=function(){return U===d.ITextFrame.HorizontalAlignment.Distributed};g.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){S(this,{alignment:{horizontal:Oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const xe=function(){return U===d.ITextFrame.HorizontalAlignment.Right};g.getCommand("formatAlignRightToggle").updateCallback(function(){S(this,{alignment:{horizontal:xe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:xe});const He=function(){return U===d.ITextFrame.HorizontalAlignment.Justify};g.getCommand("formatAlignJustifyToggle").updateCallback(function(){S(this,{alignment:{horizontal:He()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:He});const Ce=!t.getProtection().isFormatCellsAllowed(),Ae=U===d.ITextFrame.HorizontalAlignment.CenterContinuous||U===d.ITextFrame.HorizontalAlignment.Fill;g.getCommand("formatTextRotate0").updateCallback(function(we){S(this,{alignment:{rotation:0}})}).update({disabled:Ce||Ae,state:G===0}),g.getCommand("formatTextRotate45").updateCallback(function(we){S(this,{alignment:{rotation:we??1?45:0}})}).update({disabled:Ce||Ae,state:G===45}),g.getCommand("formatTextRotate90").updateCallback(function(we){S(this,{alignment:{rotation:we??1?90:0}})}).update({disabled:Ce||Ae,state:G===90}),g.getCommand("formatTextRotate270").updateCallback(function(we){S(this,{alignment:{rotation:we??1?270:0}})}).update({disabled:Ce||Ae,state:G===270}),g.getCommand("formatTextRotate315").updateCallback(function(we){S(this,{alignment:{rotation:we??1?315:0}})}).update({disabled:Ce||Ae,state:G===315}),g.getCommand("formatTextRotateCustom").updateCallback(function(we){S(this,{alignment:{rotation:we}})}).update({disabled:Ce||Ae,state:G??0})},[Te,t,i,z,Z]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=A(),U=L.containsMerge,m=L.tables.length===0&&!L.isOverlapping&&(U||!L.isSingleCell),F=async($e,lt)=>{x(lt,async it=>{const Je=async(wt=!1)=>{const bt=await Promise.resolve(c.showBusy(lt.getLabel()));try{const dt=it.getSelectedRanges();if(dt.merge({orientations:$e,discardMultipleValues:wt}),$e===d.IRange.Orientations.Both){const ft={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};dt.getStyle().update(ft)}}catch(dt){throw dt}finally{bt?.()}};let st;try{await Je()}catch(wt){if(wt.type!=="discardMultipleValues")throw wt;st=!0}if(st&&c.showOptions){if(await c.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 Je(!0)}},void 0,void 0,!1)},G=$e=>{x($e,async lt=>{try{const it=lt.getSelectedRanges();it.unmerge();const Je={alignment:{horizontal:null}};it.getStyle().update(Je)}catch(it){throw it}})};g.getCommand("mergeToggle").updateCallback(function(){he.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(U?G(this):F(d.IRange.Orientations.Both,this))}).update({state:U,disabled:!m||u}),g.getCommand("mergeHorizontal").updateCallback(function(){F(d.IRange.Orientations.Column,this)}).update({disabled:!m||u}),g.getCommand("mergeVertical").updateCallback(function(){F(d.IRange.Orientations.Row,this)}).update({disabled:!m}),g.getCommand("unmerge").updateCallback(function(){G(this)}).update({disabled:!U||!m||u});const te={disabled:u};g.getCommand("hideRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(te),g.getCommand("hideColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(te),g.getCommand("unhideRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(te),g.getCommand("unhideColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(te),g.getCommand("autoFitRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(te),g.getCommand("resizeRows").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},lt={initialValue:{size:20,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(it.size+it.unit):g.getCommand("autoFitRows").execute()}};c.showWindow("resizeHeader",lt)}).update(te),g.getCommand("autoFitColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(te),g.getCommand("resizeColumns").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},lt={initialValue:{size:100,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(it.size+it.unit):g.getCommand("autoFitColumns").execute()}};c.showWindow("resizeHeader",lt)}).update(te);let le=!1,b=0,B=!1,R=!1,P=0,ce=!1;const se=L.ranges;se&&!u&&(le=se.isEntireColumnsAny(),B=le&&!se.isEntireColumns(),b=se.getColumnCount(),R=se.isEntireRowsAny(),ce=R&&!se.isEntireRows(),P=se.getRowCount());const ye={disabled:u||se&&se.getCount()!==1};g.getCommand("sortAscending").update(ye),g.getCommand("sortDescending").update(ye);const ee=L.isOverlapping,pe={disabled:le||u||ee},V={disabled:R||u||ee},Q=le||u||ee||ce,re=R||u||ee||B;let Ee="",Ue="",Oe="",xe="",He="",Ce="",Ae="",we="",Se="",Le="",Ze="",_e="",Xe="";b>1&&(Ee=b+" ",Ue="s",ee||(Le=Ce=Ee,Ze=Ae=Ue)),P>1&&(Oe=P+" ",xe="s",ee||(_e=we=Oe,Xe=Se=xe)),w.getMode()?.key==="copy"?(He=we=Ce="Copied ",Ae=Se="s"):w.getMode()?.key==="cut"&&(He=we=Ce="Cut ",Ae=Se="s");let at="",ot="";if(se){const $e=se.getDefaultShiftOrientation()===d.IRange.Orientation.Column;at=` (${$e?"Shift Right":"Shift Down"})`,ot=` (${$e?"Shift Left":"Shift up"})`,g.getCommand("deleteCells").update({label:`Delete Cells${ot}`})}g.getCommand("insertCells").update({label:`Insert ${He}Cells${at}`,scopedLabels:{insertCells:`${He}At Selection`}}),g.getCommand("insertCellsShiftRight").update(pe),g.getCommand("deleteCellsShiftLeft").update(pe),g.getCommand("deleteCellsShiftUp").update(V),g.getCommand("insertCellsShiftDown").update(V),g.getCommand("insertRows").update({label:`Insert ${we}Row${Se}`,scopedLabels:{insertCells:`${we}Row${Se}`},disabled:re}),g.getCommand("insertRowsAfter").update({label:`Insert ${we}Row${Se} Below`,disabled:re}),g.getCommand("hideRows").update({label:`Hide ${Oe}Row${Se}`}),g.getCommand("insertColumns").update({label:`Insert ${Ce}Column${Ae}`,scopedLabels:{insertCells:`${Ce}Column${Ae}`},disabled:Q}),g.getCommand("insertColumnsAfter").update({label:`Insert ${Ce}Column${Ae} After`,disabled:Q}),g.getCommand("hideColumns").update({label:`Hide ${Ee}Column${Ae}`}),g.getCommand("deleteRows").update({label:`Delete ${_e}Row${Xe}`,scopedLabels:{deleteCells:`${_e}Row${Xe}`},disabled:re}),g.getCommand("deleteColumns").update({label:`Delete ${Le}Column${Ze}`,scopedLabels:{deleteCells:`${Le}Column${Ze}`},disabled:Q})},[I,j,N,w,c]),o.useEffect(()=>{const u=t.getProtection(),L=t.getProtection().isLocked(),U=!u.isFormatCellsAllowed(),m={disabled:U};g.getCommand("protectionSheetToggle").updateCallback(async(le,b)=>{let B=null;try{if(L){let R=null;if(u.hasPassword()){const P=await c.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(P.option!=="Unprotect")return;R=P.input}B=await Promise.resolve(c.showBusy(b.getLabel())),await u.unlock(R)}else B=await Promise.resolve(c.showBusy(b.getLabel())),await u.lock();B?.()}catch(R){B?.(),c.showError(R)}}).update({state:L,label:()=>L?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:L?"Unprotect":"Protect"}}),g.getCommand("deleteTable").update(m),g.getCommand("sortAscending").update(m),g.getCommand("sortDescending").update(m),g.getCommand("sortCustom")?.update(m),g.getCommand("updateComments").update(m),g.getCommand("deleteComments").update(m),g.getCommand("insertChart")?.update(m),g.getCommand("insertImageFromFile").update(m),g.getCommand("insertImageFromURL").update(m),g.getCommand("formatBorder").update(m),g.getCommand("formatFillColor").update(m),g.getCommand("formatFontColor").update(m),g.getCommand("formatBoldToggle").update(m),g.getCommand("formatItalicToggle").update(m),g.getCommand("formatUnderlinedToggle").update(m),g.getCommand("formatStrikeThroughToggle").update(m),g.getCommand("formatSuperscriptToggle").update(m),g.getCommand("formatSubscriptToggle").update(m),g.getCommand("formatAlignTopToggle").update(m),g.getCommand("formatTextOverflowVisibleToggle").update(m),g.getCommand("formatTextOverflowWrapToggle").update(m),g.getCommand("formatTextOverflowClipToggle").update(m),g.getCommand("formatTextOverflowShrinkToggle").update(m),g.getCommand("formatAlignMiddleToggle").update(m),g.getCommand("formatAlignBottomToggle").update(m),g.getCommand("formatAlignDistributedVerticalToggle").update(m),g.getCommand("formatAlignJustifyVerticalToggle").update(m),g.getCommand("formatAlignLeftToggle").update(m),g.getCommand("formatAlignCenterToggle").update(m),g.getCommand("formatAlignRightToggle").update(m),g.getCommand("formatAlignJustifyToggle").update(m),g.getCommand("formatAlignCenterContinuousToggle").update(m),g.getCommand("formatAlignDistributedHorizontalToggle").update(m),g.getCommand("formatAlignFillToggle").update(m),g.getCommand("formatFontSizeIncrease").update(m),g.getCommand("formatFontSizeDecrease").update(m),g.getCommand("formatFontFamily").update(m),g.getCommand("formatFontSize").update(m),g.getCommand("formatNumberFormat").update(m),g.getCommand("formatNumberFormatGeneralStyle").update(m),g.getCommand("formatNumberFormatNumberStyle").update(m),g.getCommand("formatNumberFormatTimeStyle").update(m),g.getCommand("formatNumberFormatDateStyle").update(m),g.getCommand("formatNumberFormatAccountingStyle").update(m),g.getCommand("formatNumberFormatPercentStyle").update(m),g.getCommand("formatNumberFormatScientificStyle").update(m),g.getCommand("formatNumberFormatCommaStyle").update(m),g.getCommand("formatNumberFormatIncreaseDecimal").update(m),g.getCommand("formatNumberFormatDecreaseDecimal").update(m),g.getCommand("hideColumns").update(m),g.getCommand("unhideColumns").update(m),g.getCommand("hideRows").update(m),g.getCommand("unhideRows").update(m),g.getCommand("insertFunctionSum").update(m),g.getCommand("insertFunctionAverage").update(m),g.getCommand("insertFunctionCount").update(m),g.getCommand("insertFunctionMax").update(m),g.getCommand("insertFunctionMin").update(m),g.getCommand("insertFunction").update(m),g.getCommand("startEditCurrentTime").update(m),g.getCommand("startEditCurrentDate").update(m),g.getCommand("startEditValueAbove").update(m),g.getCommand("fillDown").update(m),g.getCommand("fillRight").update(m),g.getCommand("fillUp").update(m),g.getCommand("fillLeft").update(m),g.getCommand("formatCellStyle").update(m),g.getCommand("formatTableStyle").update(m),g.getCommand("formatPainterToggle").update(m),g.getCommand("formatBorderAddOutline").update(m),g.getCommand("formatBorderClearOutline").update(m),g.getCommand("formatIndentDecrease").update(m),g.getCommand("formatIndentIncrease").update(m),g.getCommand("clearContents").update(m),g.getCommand("clearFormats").update(m),g.getCommand("clearAll").update(m),g.getCommand("clearComments").update(m),g.getCommand("clearHyperlinks").update(m),g.getCommand("autoFilterClear").update(m),g.getCommand("autoFilterReapply").update(m);const F=Te.getAlignment().getHorizontal(),G=F===d.ITextFrame.HorizontalAlignment.CenterContinuous||F===d.ITextFrame.HorizontalAlignment.Fill,te={disabled:U||G};g.getCommand("formatTextRotate0").update(te),g.getCommand("formatTextRotate45").update(te),g.getCommand("formatTextRotate90").update(te),g.getCommand("formatTextRotate270").update(te),g.getCommand("formatTextRotate315").update(te),g.getCommand("formatTextRotateCustom").update(te),g.getCommand("formatTextRotateVertical").update(te)},[I]),g}const Fl="_sheet-scrollbar_104cg_1",bo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:h,showCustomScrollButtons:c,offset:C=0,totalSize:k=0,viewportSize:y=0,className:p,endGap:M,...T}=e;if(!a)throw new Error("SheetScrollbar needs an ISheet");const z=r.useCallbackRef(l,[l]),D=r.useCallbackRef(f,[f]),Z=o.useRef(null),K=Nt([Z,t]),w=i===r.ScrollbarOrientation.Vertical,[N,v]=o.useState(()=>{const Ie=a.getView().getTopLeft();return w?Ie.top:Ie.left}),I=()=>{const Ie=a.getView().getFreezePanes();return w?Ie.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Ie.coords.rowIndex)-Ie.topLeft.top,scroll:Ie.topLeft.top}:Ie.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Ie.coords.colIndex)-Ie.topLeft.left,scroll:Ie.topLeft.left}},[q,X]=o.useState(I),[E,j]=o.useState(null),[$,ve]=o.useState(!1),Y=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),_=()=>{const Ie=a.getUsedRange()?.getCoords()??he.CoordUtils.EmptyRange,ke=a.getSelection().getCoords().cell;return{colIndex:Math.max(Ie.colEnd,ke.colIndex),rowIndex:Math.max(Ie.rowEnd,ke.rowIndex)}},[A,J]=o.useState(_),x=A?(w?A.rowIndex:A.colIndex)+1:0,S=()=>{const Ie=_();he.CoordUtils.isEqualCells(A,Ie)||J(Ie)};Qe(a.getView(),{onFreezeSplitChange:()=>{X(I)}}),Qe(a.getSelection(),{onChange:S}),Qe(a,{onUsedRangeChange:S}),o.useEffect(()=>{J(_())},[a]);const oe=C-q.scroll,ie=y-q.shift,qe=k-(q.shift+q.scroll),de=Y.findOffset(x)*(a.getView().getZoomScale()/100)-(q.scroll+q.shift);o.useEffect(()=>{if(!E)return $&&D?.(),void ve(!1);De(w,N,ie,M,E,a,Y,q)},[w,C,N,ie,M,q,i,E,Y,$,a]);const Pe=r.useCallbackRef((Ie,ke,ge)=>{v(Ie);const O=Ie+q.scroll,Fe=ke+q.shift,ze=ge+q.shift+q.scroll;h?.(O,Fe,ze)},[h,q]),je=o.useCallback((Ie,ke,ge,O,Fe,ze,H,W)=>{const me=H.getTextAt(H.findIndex(ke/(ze.getView().getZoomScale()/100)+W.scroll+W.shift)),ue={...Fe,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+me};if(Z.current){const fe=Z.current.querySelector('[role="slider"]');if(fe){const Me=fe.getBoundingClientRect();Ie?ue.anchor.y=Me.top+Me.height/2:ue.anchor.x=Me.left+Me.width/2}}ve(!0),z?.(ue)},[]),De=r.useCallbackRef(he.CommonUtils.debounce(je,90),[]);return o.useMemo(()=>s.jsx(r.VirtualScrollbar,{ref:K,className:ct(p,Fl),style:n,offset:oe,viewportSize:ie,totalSize:qe,orientation:i,showCustomScrollButtons:c,onMouseDown:Ie=>{j({anchor:{x:Ie.clientX,y:Ie.clientY}}),Ie.preventDefault()},onScrollOffset:Pe,onMouseOut:()=>{j(null)},onMouseUp:()=>{j(null)},minSize:de,...T}),[p,oe,ie,qe,i,c,n,de,M])}));bo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},jo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:h,containerHeight:c,headerText:C,freezeStart:k,gridStyle:y,verticalPadding:p,horizontalPadding:M,onSheetContextMenu:T,onResizeHeadersStart:z,onResizeHeaders:D,onResizeHeadersEnd:Z,onResizeHeadersDown:K,onResizeHeadersUp:w,scrollPoint:N,onSelectionStart:v,onSelectionEnd:I}=e,q=o.useMemo(()=>n.getOrientation(),[n]),X=o.useRef(null),[E,j]=o.useReducer(R=>R+1,0),[$,ve]=o.useReducer(R=>R+1,0),Y=n?.getSheet(),_=o.useRef(!1);o.useLayoutEffect(()=>{_.current=!0},[n]);const A=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),J=o.useMemo(()=>{const R=q===d.IRange.Orientation.Column;return{left:R?N.left:0,top:R?0:N.top}},[N]),[x,S]=o.useState(Y?.getView().getZoomScale()/100),[oe,ie]=o.useState(null);Qe(n,{onSizesChange:R=>{S(Y?.getView().getZoomScale()/100),Me(ue())}});const qe=o.useCallback(()=>{X.current?.invalidate(),ve()},[]),de=o.useCallback(he.CommonUtils.debounce(()=>{qe()},10),[]),[Pe,je]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){je(Y?.getSelection().getCoords()),de()},onProtectionChange(){qe()},onViewChange(){de()}}),o.useLayoutEffect(()=>{Me(ue())},[q,x,f]),o.useLayoutEffect(()=>{ie(null),S(n?.getSheet().getView().getZoomScale()/100),Me(ue())},[n]);const De=o.useCallback(R=>n.at(R)?.isHidden()||n.at(R)?.getSize()===0,[n]),Ie=o.useCallback((R,P)=>n.hiddenHeadersAt(R,P),[De]),ke=r.useCallbackRef(R=>n.isSelected(R),[n]),ge=r.useCallbackRef(R=>n.isSelectedAll(R),[n]),O=o.useCallback(()=>n.getMinSize(),[n]),Fe=o.useCallback(()=>n.getMaxSize(),[n]),ze=r.useCallbackRef((R,P,ce)=>{P/=x;const se={size:P=Math.max(O(),Math.min(he.CommonUtils.roundAccurately(P,O()),Fe())),hidden:!1},ye=[];if(P<=0&&(se.hidden=!0,se.size=ce),ye.push({address:{min:R,max:R},update:se}),P<0){const ee=q===d.IRange.Orientation.Column,pe=ee?fe.getColOffset:fe.getRowOffset,V=ee?fe.getColIndex:fe.getRowIndex,Q=pe(R);let re=V(Q+P);const Ee=pe(re);Ee===Q+P?re--:ye.push({address:{min:re,max:re},update:{size:Q-Ee+P}}),R-re>1&&ye.push({address:{min:re+1,max:R-1},update:{hidden:!0}})}n.updateHeaderPairs(ye),D?.(R,P,ce)},[E,n,x,D]),H=r.useCallbackRef((R,P,ce)=>{const se=q===d.IRange.Orientation.Column;let ye=null,ee={min:R,max:R};if(n.isSelectedAll(R)){const pe=n.getSelectedRuns();pe.length>1?ye="Resize "+(se?"Columns":"Rows"):ee=pe[0];const V={hidden:P<=0,size:(P<=0?ce:P)/x};n.updateHeaderPairs(Po(pe,V,R))}if(ee){const pe=ee.max-ee.min+1;let V;V=pe===1?n.getRange(ee).at(0).getDisplayText():n.getRange(ee).toString(),ye=`Resize ${se?"Column":"Row"}${pe>1?"s":""} '${V}'`}Z?.(R,P,ye)},[E,n,Z]),W=r.useCallbackRef((R,P)=>{const ce=q===d.IRange.Orientation.Column;z(R,P,`Resize ${ce?"Column":"Row"}(s)`)},[z]),me=r.useCallbackRef(R=>{let P=!1;const ce=q===d.IRange.Orientation.Column,se=n.getSheet().getEntireRange().getCoords(),ye=[],ee=n.getSelectedRuns(),pe=V=>{let Q;Q=ce?{colStart:V.min,rowStart:se.rowStart,colEnd:V.max,rowEnd:se.rowEnd}:{colStart:se.colStart,rowStart:V.min,colEnd:se.colEnd,rowEnd:V.max},ye.push(Q)};for(let V=0;V<ee.length;V++){const Q=ee[V];Q.value.isSelectedAll&&(Q.min<=R&&Q.max>=R&&(P=!0),pe(Q))}if(P||pe({min:R,max:R}),n.getSheet().getRanges(ye).autoFit({orientations:ce?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),De(R)){const V={hidden:null},Q=Po(ee,V);P||Q.push({address:R,update:V}),n.updateHeaderPairs(Q)}Z?.(R,null,"Resize Column(s)")},[E,n,Z,De]),ue=()=>{const R=q===d.IRange.Orientation.Column;return{getColOffset:P=>R?n.findOffset(P):P===0?0:f/x,getColIndex:P=>R?n.findIndex(P):0,getRowOffset:P=>R?P===0?0:f/x:n.findOffset(P),getRowIndex:P=>R?0:n.findIndex(P)}},[fe,Me]=o.useState(()=>ue()),ae=o.useCallback((R,P)=>R.nativeEvent.which!==r.MouseButtonCodes.Right||!ge(q===d.IRange.Orientation.Column?P.colIndex:P.rowIndex),[q,ge]),be=r.useCallbackRef(R=>{a.focusSheet()},[a]),g=r.useCallbackRef(R=>{Y?.getSelection().updateCoords(R)},[Y]),{...Ne}=gt.useSelection({gridRef:i,commands:null,layout:fe,selection:Pe,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:g,canSelectionSpanMergedCells:R=>{const P=Y.getRange(R);return P.isEntireColumns()||P.isEntireRows()}}),Be=r.useCallbackRef(()=>{v?.();const R=Y?.getSelection();R&&R.setAdjusting(R.getCoords())},[Y,v]),Te=r.useCallbackRef(async()=>{Y?.getSelection().setAdjusting(null),I?.()},[Y,I]),{...u}=gt.useHeaderSelection({orientation:q,headerCount:A,gridRef:X,gridMainRef:i,newSelection:Ne?.newSelection,modifySelection:Ne?.modifySelection,appendSelection:Ne?.appendSelection,clearSelections:Ne?.clearSelections,pointerDownInterceptor:ae,onPointerUp:be,onDragStart:Be,onDragEnd:Te}),L=y.selection?.strokeFill;o.useEffect(()=>{if(!X.current)return void ie(null);const R=q===d.IRange.Orientation.Column,P=n.getSelectedRuns(),ce=n.isProtected()?null:ze,se=(ee,pe,V)=>{if(V)return R?s.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(V.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(V.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},ee):s.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(V.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(V.height+y.headerSelection.strokeWidth+1,!0)}px`}},ee)},ye=(ee,pe,V)=>{const Q={x:0,y:0,width:0,height:0};if(R){const re=V.toClipBounds(V.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:ee,colEnd:Math.min(A,pe)}),gt.SELECTION_CLIP_INSETS);if(!re)return;Q.x=re.x,Q.width=re.width}else{const re=V.toClipBounds(V.getRangeCoordsBounds({rowStart:ee,rowEnd:Math.min(A,pe),colStart:0,colEnd:0}),gt.SELECTION_CLIP_INSETS);if(!re)return;Q.y=re.y,Q.height=re.height}return{x:Q.x,y:Q.y,width:Q.width,height:Q.height}};ie([ee=>{let pe=null,V=R?ee.getVisibleColumns():ee.getVisibleRows();const Q=R?ee.getTotalRangeCoords().colStart:ee.getTotalRangeCoords().rowStart;V.length>0&&V[0]>Q&&(V=[V[0]-1,...V]);let re=[];const Ee=[],Ue=V.length;for(let Se=0;Se<Ue;Se++){const Le=V[Se],Ze=Se<Ue-1?V[Se+1]:Le+Ie(Le+1,!1)+1,_e=Le+1!==Ze;if(!pe||pe.max<Le)if(P.length>0&&P[P.length-1].max>=Le){const ot=he.CommonUtils.findEqualOrGreater(P,Le,$e=>$e.max);pe=P[ot]}else pe=null;let Xe=!1,at=!1;if(pe?.value&&(pe.min<=Le||pe.min<=Ze&&!_e)&&(Xe=!0,at=pe.value.isSelectedAll),Le===Q){let ot=!1,$e=!1;pe?.value&&pe.min<=Le&&(ot=!0,$e=pe.value.isSelectedAll),Le>0&&Ee.push({index:Le-1,isNextHidden:_e,isSelected:ot,isSelectedAll:$e,disabledResize:!0})}if(at&&re.push(Ee.length),Ee.push({index:Le,isHidden:Se===0&&Ie(Le,!1)>0,isNextHidden:_e,isSelected:Xe,isSelectedAll:at,onDividerMouseDown:K,onDividerResizeStart:W,onDividerResize:ce,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:me}),_e){let ot=!1,$e=!1;if(pe&&pe.min>=Le&&pe.max<=Ze-1&&pe.value.isSelectedAll&&re.push(Ee.length),!(pe?.value&&pe.max>=Ze))if(P.length>0&&P[P.length-1].max>=Ze){const lt=he.CommonUtils.findEqualOrGreater(P,Ze,it=>it.max);pe=P[lt]}else pe=null;pe?.value&&pe.min<=Ze&&(ot=pe.value.isSelected,$e=pe.value.isSelectedAll),Ze>0&&Ee.push({index:Ze-1,isHidden:!0,isSelected:ot,isSelectedAll:$e,onDividerMouseDown:K,onDividerResizeStart:W,onDividerResize:ce,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:me})}}if(re.length>0){let Se=re.length-1;if(re.length>0){const _e=Ee[re[Se]].index;let Xe=null;R?(Xe=ee.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),Xe.x+Xe.width>ee.getBounds().width&&(Se-=1,Se===0&&(Se=-1))):(Xe=ee.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),Xe.y+Xe.height>ee.getBounds().height&&(Se-=1,Se===0&&(Se=-1)))}const Le=P?.[P.length-1],Ze=ee.getAnchor();if(Ze==="t"||Ze==="l"){const _e=Ee[re[Math.max(0,re.length-1)]];_e.showTouchDivider=Le&&Le.max<=_e.index}else Se>=0&&(Ee[re[Se]].showTouchDivider=!0)}const{header:Oe,headerSelect:xe,headerSelectAll:He,headerHover:Ce}=y??{},Ae=Ee.length,we=new Array(Ae);for(let Se=0;Se<Ae;Se++)we[Se]=s.jsx(gt.HeaderDivider,{orientation:q,view:ee,headerStyle:Oe,headerStyleSelect:xe,headerStyleSelectAll:He,headerStyleHover:Ce,disabled:n.isProtected(),...Ee[Se]},`divider${Se}`);return we},ee=>{const pe=[],V=P.length;for(let Q=0;P&&Q<V;Q++)pe.push(se(`selection:${ee.getAnchor()}:${Q}`,0,ye(P[Q].min,P[Q].max,ee)));return pe}])},[$,!0,L,y,fe,A,k,E,x]),o.useEffect(()=>{X.current?.invalidate()},[E]);const U=r.useCallbackRef(R=>C?C(R):n.getTextAt(R),[C,n]),m=r.useCallbackRef(R=>{const{header:P,headerSelect:ce,headerSelectAll:se,headerHover:ye}=y??{},{range:ee,key:pe,...V}=R;return s.jsx(gt.HeaderRenderer,{orientation:q,index:q===d.IRange.Orientation.Column?ee.colStart:ee.rowStart,isSelected:ke,isSelectedAll:ge,zoomScale:100*x,headerText:U,headerStyle:P,headerStyleSelect:ce,headerStyleSelectAll:se,headerStyleHover:ye,verticalPadding:p,horizontalPadding:M,...V},pe)},[E,A,y,x,n]),F=r.useEditMode(),G=o.useMemo(()=>{const R="white",P="black",ce={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let se=q===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='${P}' fill='${R}'/%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='${P}' fill='${R}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;F.getMode()?.key==="formatPainter"&&(se=`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='${P}' fill='${R}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),ce.cursor=se}return ce.backgroundColor=y?.header?.fill||"transparent",ce},[q,E,F,y]),te=r.useImperativeElement(t,()=>({scrollTo:R=>{X.current?.scrollTo(R)},forceRender:()=>{j()},getGridElement:()=>X.current}),[]),le=o.useCallback(R=>{u.onPointerDown(R)},[u]),b=o.useCallback(R=>{const P=u.getCellCoordsFromClient(R.clientX,R.clientY);if(!P||!T)return;const ce=q===d.IRange.Orientation.Column;T({originalEvent:R,clientX:R.clientX,clientY:R.clientY,rowIndex:ce?-1:P.rowIndex,colIndex:ce?P.colIndex:-1}),R.stopPropagation(),R.preventDefault()},[u,T]),B=o.useMemo(()=>{const R=q===d.IRange.Orientation.Column;return s.jsx("div",{ref:te,children:s.jsx(gt.Grid,{className:"sheet-header",style:G,ref:X,scrollPoint:J,columnCount:R?A:1,rowCount:R?1:A,width:R?h:f,height:R?f:c,freezeLeft:R?k:void 0,freezeTop:R?void 0:k,hiddenColumnsAt:R?Ie:void 0,hiddenRowsAt:R?void 0:Ie,showGridLines:!1,layout:fe,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:b,onPointerDown:le,zoom:x,renderCell:m,renderOverlays:oe})})},[oe,fe,h,c,J,G,$]);return o.useEffect(()=>{_.current=!1,X.current?.invalidate(),ve()},[n,y]),B})),Al=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((C,k)=>C.getStyle().getBorder(),[]),{renderOverlay:h}=Co({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),c=h(n);return c&&n?c:null})),Dl={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."},Ll={type:d.ICell.Content.Values},Nl={fitDestination:!0,type:d.ICell.Content.Formats},Pl={fitDestination:!0,type:d.ICell.Content.Formulas},jl={transpose:!0},Bl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},br=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,renderSelection:f=gt.defaultSelectionRenderer,copyForegroundColor:h="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:C="white",cutBackgroundColor:k="white",...y})=>{const p=r.useCallbackRef(f,[f]),M=o.useRef(null),T=r.useEditMode(),z=T.getMode(),D=o.useMemo(()=>({element:e,doCopy:v=>{const I=t.getSelectedRanges().getSnapshot(v);return new d.RangeClipboardItem(I)}}),[t,n,e]),Z=o.useMemo(()=>({element:e,importFromExternal:async(v,I)=>{const q=new d.ExternalRangeClipboardItem(v,I,t.getStyles(),t.isDate1904());return await q.parse()?q:null},doPaste:async(v,I)=>{if(v?.getItemType()!=="range")return;I?.contentsOnly&&delete(I={...I,type:d.ICell.Content.Values}).contentsOnly;const q=v.getItem(),X=q.getName();let E=t.getSelectedRange();if(X==="HTML"&&E.size>1){const j=q?.getCoords();j&&he.CoordUtils.isSingleCell(j)&&(E=E.getResizeTo(1,1))}return await E.doBatch(async()=>{const j=await E.copyFrom(q,I);!j||j.isEntireRows()||j.isEntireColumns()||j.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(X?` ${X}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:K,...w}=r.useCopyPaste({...y,source:D,commands:i,target:Z,onClipboardUpdate:v=>{const I=v?.getItemType()==="range"?v:null;if(I){const q=v.editMode?.(),X={...v?.isCut?.()?zl:Dl,...q,args:{isClipboard:!0,...q?.args},onModeChange:E=>{E?.args?.isClipboard||K.clear(!0),q?.onModeChange?.(E)}};T.setMode(X)}M.current=I,a?.(I)},onPaste:(v,I)=>{if(v?.getItemType()!=="range")return;let q=T.getMode()?.key==="cut"||v.isCut?.();if(!q&&T.getMode()?.key==="copy"){const X=v.getItem().getCoords(),E=t.getSelectedRanges().getCoords();let j=!1;if(!j&&X&&E&&v.getItem().getSource?.()===t)for(let $=0;!j&&$<E.length;$++)j=he.CoordUtils.isRangesIntersect(X,E[$]);q=j}q&&T.setMode(null),e?.()?.focus(),l?.(v,I)}});o.useMemo(()=>{const v=e;if(!i)return;const I=[new r.Command("pasteValues",v,{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(){Re(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"})],[]),g=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(qe,!0),u},[a,qe]);r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=w.getMode()?.key==="formatPainter";g.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>L}).updateCallback(()=>L?void w.setMode(null):g.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[w,N,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{q()}});const je=()=>{g.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),g.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??qn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:qn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Be=()=>{g.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{I(u)},darkMode:i.darkMode,quickBorder:T,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Be()},[T]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed(),L=R(),K=L?.cell.getHyperlink();g.getCommand("openHyperlink").update({disabled:!K}),g.getCommand("deleteHyperlink").update({disabled:u||!K});const m=K?"Edit":"Insert",A="Link";g.getCommand("updateHyperlink").update({label:()=>`${m} ${A}`,icon:()=>m==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${m} ${A}…`,insert:`${A}…`,hyperlink:`${m}…`},disabled:u})},[P,N]),o.useEffect(()=>{const u=R(),L=u?.cell.getComments(),K=()=>L?"Edit":"Insert",m=()=>L?"Comments":"Comment";g.getCommand("updateComments").update({label:()=>`${K()} ${m()}`,icon:()=>L?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${K()} ${m()}…`,insert:`${m()}…`}})},[P,N]),Qe(t,{onViewChange:()=>{const u=t.getView();g.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),g.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),g.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),g.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),g.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),g.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),g.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),je()},onTabColorChange:()=>{je()},onMergesChange:()=>{q()},onMovablesChange:()=>{q()},onTablesChange:()=>{q()},onProtectionChange:()=>{q(),v()},onStyleChange:()=>{je(),Be(),q()}}),o.useEffect(()=>{je(),Be()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=R(),K=L.table,m=L.tables,A=m.length>0&&!K||u,G=ue(K),J={context:G};g.getCommand("editTable").update(J),g.getCommand("deleteTable").update(J),g.getCommand("convertTableToRange").update(J);const re={context:G,disabled:A};g.getCommand("formatTableStyle").update({label:K?"Apply Table Style":"Format As Table",...re}),g.getCommand("formatTableStyleClearCellStyles").update(re),g.getCommand("deleteTableStyle").update(re),g.getCommand("convertTableToRange").update(re),g.getCommand("insertTable").update({disabled:A||m.length>0});const x={context:G,disabled:A||m.length===0};g.getCommand("tableHeaderRowToggle").update(x),g.getCommand("tableTotalRowToggle").update(x),g.getCommand("autoFilterToggle").update(x),g.getCommand("formatTableStyleClearTableStyle").update({...x,disabled:x.disabled||!K||K.getStyleOptions().name===null})},[pe,N]),o.useEffect(()=>{g.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),g.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),g.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),g.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),g.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),g.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),g.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),g.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),g.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),g.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),g.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?d.ISheetView.HeaderTextStyle.One:d.ISheetView.HeaderTextStyle.Zero})}),g.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),g.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),g.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),g.getCommand("insertFunction").update({context:()=>({searchByCategory:async u=>{const L=t.getWorkbook();if(!L)return ge.CommonUtils.EmptyArray;const K=await L.getScripts().searchFunctions({category:u,includeBuiltIn:!0});return K.sort((m,A)=>m.getName().localeCompare(A.getName())),K}})})},[t]),o.useEffect(()=>{const u=R()?.cell.getCoords(),L=t.getView().getFreezePanes(),K=()=>L.coords.rowIndex!==0,m=()=>L.coords.colIndex!==0,A=()=>L.coords.rowIndex!==0||L.coords.colIndex!==0;g.getCommand("freezeToggle").updateCallback(()=>{A()?t.getView().setFreezePanes(null):A()?m()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):K()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:A,disabled:()=>!u||!A()&&u.rowIndex===0&&u.colIndex===0}),g.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:K()?0:u.rowIndex}})}).update({state:K,disabled:()=>!u||!K()&&u.rowIndex===0}),g.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:m()?0:u.colIndex}})}).update({state:m,disabled:()=>!u||!m()&&u.colIndex===0}),g.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!A()})},[E,P,t,i]);const Ee=t?.getSelectedCell().getStyle();return o.useEffect(()=>{const u=Ee.getFont(),L=Ee.getAlignment(),K=L.getHorizontal(),m=L.getVertical(),A=L.getOverflow(),G=L.getRotation();g.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>R().cell.getStyle(!0).getNamed(),bodyStyle:Ie,createTemporaryCell:be=>t.createTemporaryCell(be)})}),g.getCommand("formatFillColor").update({state:()=>{let be=null;const ke=Ee.getFill();return ke?.getType()===d.IFill.Type.Solid?be=ke.getColor():ke?.getType()===d.IFill.Type.Gradient?be=ke.getStops()?.[0]?.getColor():ke?.getType()===d.IFill.Type.Pattern&&(be=ke.getBackground()),be},icon:()=>s.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const be=t.getStyles();return{onColorSelect:ke=>{D(ke??qn)},darkMode:i.darkMode,quickColor:z,autoColor:qn,schemeLookup:be.schemeLookup(),recentColors:be.recentColors(),addRecentColor:ke=>be.addRecentColor(ke),clearRecentColors:()=>be.clearRecentColors()}}}),g.getCommand("formatFontColor").update({state:()=>u.toJSON()?.fill?u.getFill():null,icon:()=>s.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const be=t.getStyles();return{onColorSelect:ke=>{$(ke)},darkMode:i.darkMode,quickColor:_,autoColor:be.getNormal().getFont().getFill(),schemeLookup:be.schemeLookup(),recentColors:be.recentColors(),addRecentColor:ke=>be.addRecentColor(ke),clearRecentColors:()=>be.clearRecentColors()}}}),g.getCommand("formatNumberFormat").update({state:()=>Ee.getNumberFormat(),context:()=>R().cell}),g.getCommand("formatNumberDialog").update({state:()=>Ee.getNumberFormat(),context:()=>R().cell}),g.getCommand("formatFontFamily").update({state:()=>u.getFamily()}),g.getCommand("formatFontSize").update({state:()=>u.getSize()});const J=function(){const be=u.getWeight()||0;return!isNaN(be)&&be>500};g.getCommand("formatBoldToggle").updateCallback(function(){b(this,{font:{weight:J()?400:700}})}).update({state:J});const re=function(){return u.getStyle()===d.IFont.Style.Italic};g.getCommand("formatItalicToggle").updateCallback(function(){b(this,{font:{style:re()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:re}),g.getCommand("formatStrikeThroughToggle").updateCallback(function(){b(this,{font:{strike:!u.getStrike()}})}).update({state:u.getStrike()}),g.getCommand("formatUnderlinedToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Single}),g.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Double}),g.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),g.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),g.getCommand("formatSuperscriptToggle").updateCallback(function(){b(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),g.getCommand("formatSubscriptToggle").updateCallback(function(){b(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const x=()=>A===d.ITextFrame.Overflow.Visible;g.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){b(this,{alignment:{overflow:(x(),d.ITextFrame.Overflow.Visible)}})}).update({state:x});const B=()=>A===d.ITextFrame.Overflow.Wrap;g.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){b(this,{alignment:{overflow:B()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:B});const S=function(){return A===d.ITextFrame.Overflow.Clip};g.getCommand("formatTextOverflowClipToggle").updateCallback(function(){b(this,{alignment:{overflow:S()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:S});const j=function(){return A===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){b(this,{alignment:{overflow:j()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:j});const se=function(){return A===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){b(this,{alignment:{overflow:se()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:se,disabled:!0});const ae=function(){return m===d.ITextFrame.VerticalAlignment.Top};g.getCommand("formatAlignTopToggle").updateCallback(function(){b(this,{alignment:{vertical:ae()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:ae});const we=function(){return m===d.ITextFrame.VerticalAlignment.Center};g.getCommand("formatAlignMiddleToggle").updateCallback(function(){b(this,{alignment:{vertical:we()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:we});const Y=function(){return m===d.ITextFrame.VerticalAlignment.Bottom};g.getCommand("formatAlignBottomToggle").updateCallback(function(){b(this,{alignment:{vertical:(Y(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:Y});const fe=function(){return m===d.ITextFrame.VerticalAlignment.Justify};g.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){b(this,{alignment:{vertical:fe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:fe});const V=function(){return m===d.ITextFrame.VerticalAlignment.Distributed};g.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){b(this,{alignment:{vertical:V()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:V});const X=function(){return K===d.ITextFrame.HorizontalAlignment.Left};g.getCommand("formatAlignLeftToggle").updateCallback(function(){b(this,{alignment:{horizontal:X()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:X});const oe=function(){return K===d.ITextFrame.HorizontalAlignment.Center};g.getCommand("formatAlignCenterToggle").updateCallback(function(){b(this,{alignment:{horizontal:oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:oe});const Fe=function(){return K===d.ITextFrame.HorizontalAlignment.CenterContinuous};g.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const be={alignment:{horizontal:Fe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};b(this,be)}).update({state:Fe});const Ue=function(){return K===d.ITextFrame.HorizontalAlignment.Fill};g.getCommand("formatAlignFillToggle").updateCallback(function(){const be={alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};b(this,be)}).update({state:Ue});const Oe=function(){return K===d.ITextFrame.HorizontalAlignment.Distributed};g.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){b(this,{alignment:{horizontal:Oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const Se=function(){return K===d.ITextFrame.HorizontalAlignment.Right};g.getCommand("formatAlignRightToggle").updateCallback(function(){b(this,{alignment:{horizontal:Se()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:Se});const He=function(){return K===d.ITextFrame.HorizontalAlignment.Justify};g.getCommand("formatAlignJustifyToggle").updateCallback(function(){b(this,{alignment:{horizontal:He()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:He});const ve=!t.getProtection().isFormatCellsAllowed(),De=K===d.ITextFrame.HorizontalAlignment.CenterContinuous||K===d.ITextFrame.HorizontalAlignment.Fill;g.getCommand("formatTextRotate0").updateCallback(function(be){b(this,{alignment:{rotation:0}})}).update({disabled:ve||De,state:G===0}),g.getCommand("formatTextRotate45").updateCallback(function(be){b(this,{alignment:{rotation:be??1?45:0}})}).update({disabled:ve||De,state:G===45}),g.getCommand("formatTextRotate90").updateCallback(function(be){b(this,{alignment:{rotation:be??1?90:0}})}).update({disabled:ve||De,state:G===90}),g.getCommand("formatTextRotate270").updateCallback(function(be){b(this,{alignment:{rotation:be??1?270:0}})}).update({disabled:ve||De,state:G===270}),g.getCommand("formatTextRotate315").updateCallback(function(be){b(this,{alignment:{rotation:be??1?315:0}})}).update({disabled:ve||De,state:G===315}),g.getCommand("formatTextRotateCustom").updateCallback(function(be){b(this,{alignment:{rotation:be}})}).update({disabled:ve||De,state:G??0})},[Ee,t,i,z,_]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=R(),K=L.containsMerge,m=L.tables.length===0&&!L.isOverlapping&&(K||!L.isSingleCell),A=async($e,lt)=>{k(lt,async it=>{const Je=async(wt=!1)=>{const bt=await Promise.resolve(c.showBusy(lt.getLabel()));try{const dt=it.getSelectedRanges();if(dt.merge({orientations:$e,discardMultipleValues:wt}),$e===d.IRange.Orientations.Both){const ft={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};dt.getStyle().update(ft)}}catch(dt){throw dt}finally{bt?.()}};let st;try{await Je()}catch(wt){if(wt.type!=="discardMultipleValues")throw wt;st=!0}if(st&&c.showOptions){if(await c.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 Je(!0)}},void 0,void 0,!1)},G=$e=>{k($e,async lt=>{try{const it=lt.getSelectedRanges();it.unmerge();const Je={alignment:{horizontal:null}};it.getStyle().update(Je)}catch(it){throw it}})};g.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(K?G(this):A(d.IRange.Orientations.Both,this))}).update({state:K,disabled:!m||u}),g.getCommand("mergeHorizontal").updateCallback(function(){A(d.IRange.Orientations.Column,this)}).update({disabled:!m||u}),g.getCommand("mergeVertical").updateCallback(function(){A(d.IRange.Orientations.Row,this)}).update({disabled:!m}),g.getCommand("unmerge").updateCallback(function(){G(this)}).update({disabled:!K||!m||u});const J={disabled:u};g.getCommand("hideRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(J),g.getCommand("hideColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(J),g.getCommand("unhideRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(J),g.getCommand("unhideColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(J),g.getCommand("autoFitRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(J),g.getCommand("resizeRows").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},lt={initialValue:{size:20,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(it.size+it.unit):g.getCommand("autoFitRows").execute()}};c.showWindow("resizeHeader",lt)}).update(J),g.getCommand("autoFitColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(J),g.getCommand("resizeColumns").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},lt={initialValue:{size:100,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(it.size+it.unit):g.getCommand("autoFitColumns").execute()}};c.showWindow("resizeHeader",lt)}).update(J);let re=!1,x=0,B=!1,S=!1,j=0,se=!1;const ae=L.ranges;ae&&!u&&(re=ae.isEntireColumnsAny(),B=re&&!ae.isEntireColumns(),x=ae.getColumnCount(),S=ae.isEntireRowsAny(),se=S&&!ae.isEntireRows(),j=ae.getRowCount());const we={disabled:u||ae&&ae.getCount()!==1};g.getCommand("sortAscending").update(we),g.getCommand("sortDescending").update(we);const Y=L.isOverlapping,fe={disabled:re||u||Y},V={disabled:S||u||Y},X=re||u||Y||se,oe=S||u||Y||B;let Fe="",Ue="",Oe="",Se="",He="",ve="",De="",be="",ke="",Ne="",Ze="",_e="",Xe="";x>1&&(Fe=x+" ",Ue="s",Y||(Ne=ve=Fe,Ze=De=Ue)),j>1&&(Oe=j+" ",Se="s",Y||(_e=be=Oe,Xe=ke=Se)),w.getMode()?.key==="copy"?(He=be=ve="Copied ",De=ke="s"):w.getMode()?.key==="cut"&&(He=be=ve="Cut ",De=ke="s");let at="",ot="";if(ae){const $e=ae.getDefaultShiftOrientation()===d.IRange.Orientation.Column;at=` (${$e?"Shift Right":"Shift Down"})`,ot=` (${$e?"Shift Left":"Shift up"})`,g.getCommand("deleteCells").update({label:`Delete Cells${ot}`})}g.getCommand("insertCells").update({label:`Insert ${He}Cells${at}`,scopedLabels:{insertCells:`${He}At Selection`}}),g.getCommand("insertCellsShiftRight").update(fe),g.getCommand("deleteCellsShiftLeft").update(fe),g.getCommand("deleteCellsShiftUp").update(V),g.getCommand("insertCellsShiftDown").update(V),g.getCommand("insertRows").update({label:`Insert ${be}Row${ke}`,scopedLabels:{insertCells:`${be}Row${ke}`},disabled:oe}),g.getCommand("insertRowsAfter").update({label:`Insert ${be}Row${ke} Below`,disabled:oe}),g.getCommand("hideRows").update({label:`Hide ${Oe}Row${ke}`}),g.getCommand("insertColumns").update({label:`Insert ${ve}Column${De}`,scopedLabels:{insertCells:`${ve}Column${De}`},disabled:X}),g.getCommand("insertColumnsAfter").update({label:`Insert ${ve}Column${De} After`,disabled:X}),g.getCommand("hideColumns").update({label:`Hide ${Fe}Column${De}`}),g.getCommand("deleteRows").update({label:`Delete ${_e}Row${Xe}`,scopedLabels:{deleteCells:`${_e}Row${Xe}`},disabled:oe}),g.getCommand("deleteColumns").update({label:`Delete ${Ne}Column${Ze}`,scopedLabels:{deleteCells:`${Ne}Column${Ze}`},disabled:X})},[E,P,N,w,c]),o.useEffect(()=>{const u=t.getProtection(),L=t.getProtection().isLocked(),K=!u.isFormatCellsAllowed(),m={disabled:K};g.getCommand("protectionSheetToggle").updateCallback(async(re,x)=>{let B=null;try{if(L){let S=null;if(u.hasPassword()){const j=await c.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(j.option!=="Unprotect")return;S=j.input}B=await Promise.resolve(c.showBusy(x.getLabel())),await u.unlock(S)}else B=await Promise.resolve(c.showBusy(x.getLabel())),await u.lock();B?.()}catch(S){B?.(),c.showError(S)}}).update({state:L,label:()=>L?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:L?"Unprotect":"Protect"}}),g.getCommand("deleteTable").update(m),g.getCommand("sortAscending").update(m),g.getCommand("sortDescending").update(m),g.getCommand("sortCustom")?.update(m),g.getCommand("updateComments").update(m),g.getCommand("deleteComments").update(m),g.getCommand("insertChart")?.update(m),g.getCommand("insertImageFromFile").update(m),g.getCommand("insertImageFromURL").update(m),g.getCommand("formatBorder").update(m),g.getCommand("formatFillColor").update(m),g.getCommand("formatFontColor").update(m),g.getCommand("formatBoldToggle").update(m),g.getCommand("formatItalicToggle").update(m),g.getCommand("formatUnderlinedToggle").update(m),g.getCommand("formatStrikeThroughToggle").update(m),g.getCommand("formatSuperscriptToggle").update(m),g.getCommand("formatSubscriptToggle").update(m),g.getCommand("formatAlignTopToggle").update(m),g.getCommand("formatTextOverflowVisibleToggle").update(m),g.getCommand("formatTextOverflowWrapToggle").update(m),g.getCommand("formatTextOverflowClipToggle").update(m),g.getCommand("formatTextOverflowShrinkToggle").update(m),g.getCommand("formatAlignMiddleToggle").update(m),g.getCommand("formatAlignBottomToggle").update(m),g.getCommand("formatAlignDistributedVerticalToggle").update(m),g.getCommand("formatAlignJustifyVerticalToggle").update(m),g.getCommand("formatAlignLeftToggle").update(m),g.getCommand("formatAlignCenterToggle").update(m),g.getCommand("formatAlignRightToggle").update(m),g.getCommand("formatAlignJustifyToggle").update(m),g.getCommand("formatAlignCenterContinuousToggle").update(m),g.getCommand("formatAlignDistributedHorizontalToggle").update(m),g.getCommand("formatAlignFillToggle").update(m),g.getCommand("formatFontSizeIncrease").update(m),g.getCommand("formatFontSizeDecrease").update(m),g.getCommand("formatFontFamily").update(m),g.getCommand("formatFontSize").update(m),g.getCommand("formatNumberFormat").update(m),g.getCommand("formatNumberFormatGeneralStyle").update(m),g.getCommand("formatNumberFormatNumberStyle").update(m),g.getCommand("formatNumberFormatTimeStyle").update(m),g.getCommand("formatNumberFormatDateStyle").update(m),g.getCommand("formatNumberFormatAccountingStyle").update(m),g.getCommand("formatNumberFormatPercentStyle").update(m),g.getCommand("formatNumberFormatScientificStyle").update(m),g.getCommand("formatNumberFormatCommaStyle").update(m),g.getCommand("formatNumberFormatIncreaseDecimal").update(m),g.getCommand("formatNumberFormatDecreaseDecimal").update(m),g.getCommand("hideColumns").update(m),g.getCommand("unhideColumns").update(m),g.getCommand("hideRows").update(m),g.getCommand("unhideRows").update(m),g.getCommand("insertFunctionSum").update(m),g.getCommand("insertFunctionAverage").update(m),g.getCommand("insertFunctionCount").update(m),g.getCommand("insertFunctionMax").update(m),g.getCommand("insertFunctionMin").update(m),g.getCommand("insertFunction").update(m),g.getCommand("startEditCurrentTime").update(m),g.getCommand("startEditCurrentDate").update(m),g.getCommand("startEditValueAbove").update(m),g.getCommand("fillDown").update(m),g.getCommand("fillRight").update(m),g.getCommand("fillUp").update(m),g.getCommand("fillLeft").update(m),g.getCommand("formatCellStyle").update(m),g.getCommand("formatTableStyle").update(m),g.getCommand("formatPainterToggle").update(m),g.getCommand("formatBorderAddOutline").update(m),g.getCommand("formatBorderClearOutline").update(m),g.getCommand("formatIndentDecrease").update(m),g.getCommand("formatIndentIncrease").update(m),g.getCommand("clearContents").update(m),g.getCommand("clearFormats").update(m),g.getCommand("clearAll").update(m),g.getCommand("clearComments").update(m),g.getCommand("clearHyperlinks").update(m),g.getCommand("autoFilterClear").update(m),g.getCommand("autoFilterReapply").update(m);const A=Ee.getAlignment().getHorizontal(),G=A===d.ITextFrame.HorizontalAlignment.CenterContinuous||A===d.ITextFrame.HorizontalAlignment.Fill,J={disabled:K||G};g.getCommand("formatTextRotate0").update(J),g.getCommand("formatTextRotate45").update(J),g.getCommand("formatTextRotate90").update(J),g.getCommand("formatTextRotate270").update(J),g.getCommand("formatTextRotate315").update(J),g.getCommand("formatTextRotateCustom").update(J),g.getCommand("formatTextRotateVertical").update(J)},[E]),g}const Fl="_sheet-scrollbar_104cg_1",bo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:h,showCustomScrollButtons:c,offset:C=0,totalSize:M=0,viewportSize:y=0,className:p,endGap:T,...I}=e;if(!a)throw new Error("SheetScrollbar needs an ISheet");const z=r.useCallbackRef(l,[l]),D=r.useCallbackRef(f,[f]),_=o.useRef(null),$=Nt([_,t]),w=i===r.ScrollbarOrientation.Vertical,[N,v]=o.useState(()=>{const Ae=a.getView().getTopLeft();return w?Ae.top:Ae.left}),E=()=>{const Ae=a.getView().getFreezePanes();return w?Ae.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Ae.coords.rowIndex)-Ae.topLeft.top,scroll:Ae.topLeft.top}:Ae.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Ae.coords.colIndex)-Ae.topLeft.left,scroll:Ae.topLeft.left}},[q,Z]=o.useState(E),[F,P]=o.useState(null),[W,pe]=o.useState(!1),de=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),le=()=>{const Ae=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,Ie=a.getSelection().getCoords().cell;return{colIndex:Math.max(Ae.colEnd,Ie.colIndex),rowIndex:Math.max(Ae.rowEnd,Ie.rowIndex)}},[R,te]=o.useState(le),k=R?(w?R.rowIndex:R.colIndex)+1:0,b=()=>{const Ae=le();ge.CoordUtils.isEqualCells(R,Ae)||te(Ae)};Qe(a.getView(),{onFreezeSplitChange:()=>{Z(E)}}),Qe(a.getSelection(),{onChange:b}),Qe(a,{onUsedRangeChange:b}),o.useEffect(()=>{te(le())},[a]);const ee=C-q.scroll,ne=y-q.shift,Re=M-(q.shift+q.scroll),Ce=de.findOffset(k)*(a.getView().getZoomScale()/100)-(q.scroll+q.shift);o.useEffect(()=>{if(!F)return W&&D?.(),void pe(!1);ze(w,N,ne,T,F,a,de,q)},[w,C,N,ne,T,q,i,F,de,W,a]);const ye=r.useCallbackRef((Ae,Ie,ue)=>{v(Ae);const O=Ae+q.scroll,xe=Ie+q.shift,Le=ue+q.shift+q.scroll;h?.(O,xe,Le)},[h,q]),Pe=o.useCallback((Ae,Ie,ue,O,xe,Le,H,U)=>{const he=H.getTextAt(H.findIndex(Ie/(Le.getView().getZoomScale()/100)+U.scroll+U.shift)),ce={...xe,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+he};if(_.current){const me=_.current.querySelector('[role="slider"]');if(me){const Te=me.getBoundingClientRect();Ae?ce.anchor.y=Te.top+Te.height/2:ce.anchor.x=Te.left+Te.width/2}}pe(!0),z?.(ce)},[]),ze=r.useCallbackRef(ge.CommonUtils.debounce(Pe,90),[]);return o.useMemo(()=>s.jsx(r.VirtualScrollbar,{ref:$,className:ct(p,Fl),style:n,offset:ee,viewportSize:ne,totalSize:Re,orientation:i,showCustomScrollButtons:c,onMouseDown:Ae=>{P({anchor:{x:Ae.clientX,y:Ae.clientY}}),Ae.preventDefault()},onScrollOffset:ye,onMouseOut:()=>{P(null)},onMouseUp:()=>{P(null)},minSize:Ce,...I}),[p,ee,ne,Re,i,c,n,Ce,T])}));bo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},jo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:h,containerHeight:c,headerText:C,freezeStart:M,gridStyle:y,verticalPadding:p,horizontalPadding:T,onSheetContextMenu:I,onResizeHeadersStart:z,onResizeHeaders:D,onResizeHeadersEnd:_,onResizeHeadersDown:$,onResizeHeadersUp:w,scrollPoint:N,onSelectionStart:v,onSelectionEnd:E}=e,q=o.useMemo(()=>n.getOrientation(),[n]),Z=o.useRef(null),[F,P]=o.useReducer(S=>S+1,0),[W,pe]=o.useReducer(S=>S+1,0),de=n?.getSheet(),le=o.useRef(!1);o.useLayoutEffect(()=>{le.current=!0},[n]);const R=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),te=o.useMemo(()=>{const S=q===d.IRange.Orientation.Column;return{left:S?N.left:0,top:S?0:N.top}},[N]),[k,b]=o.useState(de?.getView().getZoomScale()/100),[ee,ne]=o.useState(null);Qe(n,{onSizesChange:S=>{b(de?.getView().getZoomScale()/100),Te(ce())}});const Re=o.useCallback(()=>{Z.current?.invalidate(),pe()},[]),Ce=o.useCallback(ge.CommonUtils.debounce(()=>{Re()},10),[]),[ye,Pe]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){Pe(de?.getSelection().getCoords()),Ce()},onProtectionChange(){Re()},onViewChange(){Ce()}}),o.useLayoutEffect(()=>{Te(ce())},[q,k,f]),o.useLayoutEffect(()=>{ne(null),b(n?.getSheet().getView().getZoomScale()/100),Te(ce())},[n]);const ze=o.useCallback(S=>n.at(S)?.isHidden()||n.at(S)?.getSize()===0,[n]),Ae=o.useCallback((S,j)=>n.hiddenHeadersAt(S,j),[ze]),Ie=r.useCallbackRef(S=>n.isSelected(S),[n]),ue=r.useCallbackRef(S=>n.isSelectedAll(S),[n]),O=o.useCallback(()=>n.getMinSize(),[n]),xe=o.useCallback(()=>n.getMaxSize(),[n]),Le=r.useCallbackRef((S,j,se)=>{j/=k;const ae={size:j=Math.max(O(),Math.min(ge.CommonUtils.roundAccurately(j,O()),xe())),hidden:!1},we=[];if(j<=0&&(ae.hidden=!0,ae.size=se),we.push({address:{min:S,max:S},update:ae}),j<0){const Y=q===d.IRange.Orientation.Column,fe=Y?me.getColOffset:me.getRowOffset,V=Y?me.getColIndex:me.getRowIndex,X=fe(S);let oe=V(X+j);const Fe=fe(oe);Fe===X+j?oe--:we.push({address:{min:oe,max:oe},update:{size:X-Fe+j}}),S-oe>1&&we.push({address:{min:oe+1,max:S-1},update:{hidden:!0}})}n.updateHeaderPairs(we),D?.(S,j,se)},[F,n,k,D]),H=r.useCallbackRef((S,j,se)=>{const ae=q===d.IRange.Orientation.Column;let we=null,Y={min:S,max:S};if(n.isSelectedAll(S)){const fe=n.getSelectedRuns();fe.length>1?we="Resize "+(ae?"Columns":"Rows"):Y=fe[0];const V={hidden:j<=0,size:(j<=0?se:j)/k};n.updateHeaderPairs(Po(fe,V,S))}if(Y){const fe=Y.max-Y.min+1;let V;V=fe===1?n.getRange(Y).at(0).getDisplayText():n.getRange(Y).toString(),we=`Resize ${ae?"Column":"Row"}${fe>1?"s":""} '${V}'`}_?.(S,j,we)},[F,n,_]),U=r.useCallbackRef((S,j)=>{const se=q===d.IRange.Orientation.Column;z(S,j,`Resize ${se?"Column":"Row"}(s)`)},[z]),he=r.useCallbackRef(S=>{let j=!1;const se=q===d.IRange.Orientation.Column,ae=n.getSheet().getEntireRange().getCoords(),we=[],Y=n.getSelectedRuns(),fe=V=>{let X;X=se?{colStart:V.min,rowStart:ae.rowStart,colEnd:V.max,rowEnd:ae.rowEnd}:{colStart:ae.colStart,rowStart:V.min,colEnd:ae.colEnd,rowEnd:V.max},we.push(X)};for(let V=0;V<Y.length;V++){const X=Y[V];X.value.isSelectedAll&&(X.min<=S&&X.max>=S&&(j=!0),fe(X))}if(j||fe({min:S,max:S}),n.getSheet().getRanges(we).autoFit({orientations:se?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),ze(S)){const V={hidden:null},X=Po(Y,V);j||X.push({address:S,update:V}),n.updateHeaderPairs(X)}_?.(S,null,"Resize Column(s)")},[F,n,_,ze]),ce=()=>{const S=q===d.IRange.Orientation.Column;return{getColOffset:j=>S?n.findOffset(j):j===0?0:f/k,getColIndex:j=>S?n.findIndex(j):0,getRowOffset:j=>S?j===0?0:f/k:n.findOffset(j),getRowIndex:j=>S?0:n.findIndex(j)}},[me,Te]=o.useState(()=>ce()),ie=o.useCallback((S,j)=>S.nativeEvent.which!==r.MouseButtonCodes.Right||!ue(q===d.IRange.Orientation.Column?j.colIndex:j.rowIndex),[q,ue]),qe=r.useCallbackRef(S=>{a.focusSheet()},[a]),g=r.useCallbackRef(S=>{de?.getSelection().updateCoords(S)},[de]),{...je}=gt.useSelection({gridRef:i,commands:null,layout:me,selection:ye,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:g,canSelectionSpanMergedCells:S=>{const j=de.getRange(S);return j.isEntireColumns()||j.isEntireRows()}}),Be=r.useCallbackRef(()=>{v?.();const S=de?.getSelection();S&&S.setAdjusting(S.getCoords())},[de,v]),Ee=r.useCallbackRef(async()=>{de?.getSelection().setAdjusting(null),E?.()},[de,E]),{...u}=gt.useHeaderSelection({orientation:q,headerCount:R,gridRef:Z,gridMainRef:i,newSelection:je?.newSelection,modifySelection:je?.modifySelection,appendSelection:je?.appendSelection,clearSelections:je?.clearSelections,pointerDownInterceptor:ie,onPointerUp:qe,onDragStart:Be,onDragEnd:Ee}),L=y.selection?.strokeFill;o.useEffect(()=>{if(!Z.current)return void ne(null);const S=q===d.IRange.Orientation.Column,j=n.getSelectedRuns(),se=n.isProtected()?null:Le,ae=(Y,fe,V)=>{if(V)return S?s.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(V.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(V.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},Y):s.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(V.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(V.height+y.headerSelection.strokeWidth+1,!0)}px`}},Y)},we=(Y,fe,V)=>{const X={x:0,y:0,width:0,height:0};if(S){const oe=V.toClipBounds(V.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Y,colEnd:Math.min(R,fe)}),gt.SELECTION_CLIP_INSETS);if(!oe)return;X.x=oe.x,X.width=oe.width}else{const oe=V.toClipBounds(V.getRangeCoordsBounds({rowStart:Y,rowEnd:Math.min(R,fe),colStart:0,colEnd:0}),gt.SELECTION_CLIP_INSETS);if(!oe)return;X.y=oe.y,X.height=oe.height}return{x:X.x,y:X.y,width:X.width,height:X.height}};ne([Y=>{let fe=null,V=S?Y.getVisibleColumns():Y.getVisibleRows();const X=S?Y.getTotalRangeCoords().colStart:Y.getTotalRangeCoords().rowStart;V.length>0&&V[0]>X&&(V=[V[0]-1,...V]);let oe=[];const Fe=[],Ue=V.length;for(let ke=0;ke<Ue;ke++){const Ne=V[ke],Ze=ke<Ue-1?V[ke+1]:Ne+Ae(Ne+1,!1)+1,_e=Ne+1!==Ze;if(!fe||fe.max<Ne)if(j.length>0&&j[j.length-1].max>=Ne){const ot=ge.CommonUtils.findEqualOrGreater(j,Ne,$e=>$e.max);fe=j[ot]}else fe=null;let Xe=!1,at=!1;if(fe?.value&&(fe.min<=Ne||fe.min<=Ze&&!_e)&&(Xe=!0,at=fe.value.isSelectedAll),Ne===X){let ot=!1,$e=!1;fe?.value&&fe.min<=Ne&&(ot=!0,$e=fe.value.isSelectedAll),Ne>0&&Fe.push({index:Ne-1,isNextHidden:_e,isSelected:ot,isSelectedAll:$e,disabledResize:!0})}if(at&&oe.push(Fe.length),Fe.push({index:Ne,isHidden:ke===0&&Ae(Ne,!1)>0,isNextHidden:_e,isSelected:Xe,isSelectedAll:at,onDividerMouseDown:$,onDividerResizeStart:U,onDividerResize:se,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:he}),_e){let ot=!1,$e=!1;if(fe&&fe.min>=Ne&&fe.max<=Ze-1&&fe.value.isSelectedAll&&oe.push(Fe.length),!(fe?.value&&fe.max>=Ze))if(j.length>0&&j[j.length-1].max>=Ze){const lt=ge.CommonUtils.findEqualOrGreater(j,Ze,it=>it.max);fe=j[lt]}else fe=null;fe?.value&&fe.min<=Ze&&(ot=fe.value.isSelected,$e=fe.value.isSelectedAll),Ze>0&&Fe.push({index:Ze-1,isHidden:!0,isSelected:ot,isSelectedAll:$e,onDividerMouseDown:$,onDividerResizeStart:U,onDividerResize:se,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:he})}}if(oe.length>0){let ke=oe.length-1;if(oe.length>0){const _e=Fe[oe[ke]].index;let Xe=null;S?(Xe=Y.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),Xe.x+Xe.width>Y.getBounds().width&&(ke-=1,ke===0&&(ke=-1))):(Xe=Y.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),Xe.y+Xe.height>Y.getBounds().height&&(ke-=1,ke===0&&(ke=-1)))}const Ne=j?.[j.length-1],Ze=Y.getAnchor();if(Ze==="t"||Ze==="l"){const _e=Fe[oe[Math.max(0,oe.length-1)]];_e.showTouchDivider=Ne&&Ne.max<=_e.index}else ke>=0&&(Fe[oe[ke]].showTouchDivider=!0)}const{header:Oe,headerSelect:Se,headerSelectAll:He,headerHover:ve}=y??{},De=Fe.length,be=new Array(De);for(let ke=0;ke<De;ke++)be[ke]=s.jsx(gt.HeaderDivider,{orientation:q,view:Y,headerStyle:Oe,headerStyleSelect:Se,headerStyleSelectAll:He,headerStyleHover:ve,disabled:n.isProtected(),...Fe[ke]},`divider${ke}`);return be},Y=>{const fe=[],V=j.length;for(let X=0;j&&X<V;X++)fe.push(ae(`selection:${Y.getAnchor()}:${X}`,0,we(j[X].min,j[X].max,Y)));return fe}])},[W,!0,L,y,me,R,M,F,k]),o.useEffect(()=>{Z.current?.invalidate()},[F]);const K=r.useCallbackRef(S=>C?C(S):n.getTextAt(S),[C,n]),m=r.useCallbackRef(S=>{const{header:j,headerSelect:se,headerSelectAll:ae,headerHover:we}=y??{},{range:Y,key:fe,...V}=S;return s.jsx(gt.HeaderRenderer,{orientation:q,index:q===d.IRange.Orientation.Column?Y.colStart:Y.rowStart,isSelected:Ie,isSelectedAll:ue,zoomScale:100*k,headerText:K,headerStyle:j,headerStyleSelect:se,headerStyleSelectAll:ae,headerStyleHover:we,verticalPadding:p,horizontalPadding:T,...V},fe)},[F,R,y,k,n]),A=r.useEditMode(),G=o.useMemo(()=>{const S="white",j="black",se={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let ae=q===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='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;A.getMode()?.key==="formatPainter"&&(ae=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),se.cursor=ae}return se.backgroundColor=y?.header?.fill||"transparent",se},[q,F,A,y]),J=r.useImperativeElement(t,()=>({scrollTo:S=>{Z.current?.scrollTo(S)},forceRender:()=>{P()},getGridElement:()=>Z.current}),[]),re=o.useCallback(S=>{u.onPointerDown(S)},[u]),x=o.useCallback(S=>{const j=u.getCellCoordsFromClient(S.clientX,S.clientY);if(!j||!I)return;const se=q===d.IRange.Orientation.Column;I({originalEvent:S,clientX:S.clientX,clientY:S.clientY,rowIndex:se?-1:j.rowIndex,colIndex:se?j.colIndex:-1}),S.stopPropagation(),S.preventDefault()},[u,I]),B=o.useMemo(()=>{const S=q===d.IRange.Orientation.Column;return s.jsx("div",{ref:J,children:s.jsx(gt.Grid,{className:"sheet-header",style:G,ref:Z,scrollPoint:te,columnCount:S?R:1,rowCount:S?1:R,width:S?h:f,height:S?f:c,freezeLeft:S?M:void 0,freezeTop:S?void 0:M,hiddenColumnsAt:S?Ae:void 0,hiddenRowsAt:S?void 0:Ae,showGridLines:!1,layout:me,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:x,onPointerDown:re,zoom:k,renderCell:m,renderOverlays:ee})})},[ee,me,h,c,te,G,W]);return o.useEffect(()=>{le.current=!1,Z.current?.invalidate(),pe()},[n,y]),B})),Al=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((C,M)=>C.getStyle().getBorder(),[]),{renderOverlay:h}=Co({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),c=h(n);return c&&n?c:null})),Dl={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."},Ll={type:d.ICell.Content.Values},Nl={fitDestination:!0,type:d.ICell.Content.Formats},Pl={fitDestination:!0,type:d.ICell.Content.Formulas},jl={transpose:!0},Bl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},br=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,renderSelection:f=gt.defaultSelectionRenderer,copyForegroundColor:h="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:C="white",cutBackgroundColor:M="white",...y})=>{const p=r.useCallbackRef(f,[f]),T=o.useRef(null),I=r.useEditMode(),z=I.getMode(),D=o.useMemo(()=>({element:e,doCopy:v=>{const E=t.getSelectedRanges().getSnapshot(v);return new d.RangeClipboardItem(E)}}),[t,n,e]),_=o.useMemo(()=>({element:e,importFromExternal:async(v,E)=>{const q=new d.ExternalRangeClipboardItem(v,E,t.getStyles(),t.isDate1904());return await q.parse()?q:null},doPaste:async(v,E)=>{if(v?.getItemType()!=="range")return;E?.contentsOnly&&delete(E={...E,type:d.ICell.Content.Values}).contentsOnly;const q=v.getItem(),Z=q.getName();let F=t.getSelectedRange();if(Z==="HTML"&&F.size>1){const P=q?.getCoords();P&&ge.CoordUtils.isSingleCell(P)&&(F=F.getResizeTo(1,1))}return await F.doBatch(async()=>{const P=await F.copyFrom(q,E);!P||P.isEntireRows()||P.isEntireColumns()||P.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(Z?` ${Z}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:$,...w}=r.useCopyPaste({...y,source:D,commands:i,target:_,onClipboardUpdate:v=>{const E=v?.getItemType()==="range"?v:null;if(E){const q=v.editMode?.(),Z={...v?.isCut?.()?zl:Dl,...q,args:{isClipboard:!0,...q?.args},onModeChange:F=>{F?.args?.isClipboard||$.clear(!0),q?.onModeChange?.(F)}};I.setMode(Z)}T.current=E,a?.(E)},onPaste:(v,E)=>{if(v?.getItemType()!=="range")return;let q=I.getMode()?.key==="cut"||v.isCut?.();if(!q&&I.getMode()?.key==="copy"){const Z=v.getItem().getCoords(),F=t.getSelectedRanges().getCoords();let P=!1;if(!P&&Z&&F&&v.getItem().getSource?.()===t)for(let W=0;!P&&W<F.length;W++)P=ge.CoordUtils.isRangesIntersect(Z,F[W]);q=P}q&&I.setMode(null),e?.()?.focus(),l?.(v,E)}});o.useMemo(()=>{const v=e;if(!i)return;const E=[new r.Command("pasteValues",v,{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",v,{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",v,{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",v,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",v,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(I,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const v={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(I=>w.paste({...Ll,...I})).update(v),i.getCommand("pasteFormats").updateCallback((I,q)=>w.paste({...Nl,description:q.getLabel(),...I})).update(v),i.getCommand("pasteFormulas").updateCallback((I,q)=>w.paste({...Pl,description:q.getLabel(),...I})).update(v),i.getCommand("pasteTranspose").updateCallback((I,q)=>w.paste({...jl,description:q.getLabel(),...I})).update(v),i.getCommand("pasteLinks").updateCallback((I,q)=>w.paste({...Bl,description:q.getLabel(),...I})).update(v),i.getCommand("cut").update(v),i.getCommand("paste").update(v)},[t,i]);const N=o.useMemo(()=>{if(!z||!M.current)return;const v=z.key;if(v!=="copy"&&v!=="cut"&&v!=="formatPainter")return;const I=M.current.getItem();if(I.getSource()!==t)return;const q=M.current.isCut?.(),X=q?k:C,E=q?c:h,j=I.getCoords(),$=j?[j]:null;return $&&$.length!==0?ve=>{const Y=[];for(let _=0;_<$.length;_++){const A=$[_],J=ve.toClipBounds(ve.getRangeCoordsBounds(A,{top:0,left:0,right:1,bottom:1}),gt.SELECTION_CLIP_INSETS);J&&(Y.push(p({range:A,key:`copy-selection-background-${_}`,x:J.x,y:J.y,width:Math.max(J.width,0),height:Math.max(J.height,0),stroke:X,strokeWidth:2})),Y.push(p({range:A,key:`copy-selection-foreground-${_}`,x:J.x+(J.width<=2?-1:0),y:J.y,width:Math.max(J.width,3),height:Math.max(J.height,3),stroke:E,strokeWidth:2,isAnimatedStroke:!0})))}return Y}:null},[z,t,n,h,C,c,k]);return{...w,clipboard:K,overlays:N}},Ol=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,h=l.body??{},c=a.getView(),{overlays:C}=br({element:i,sheet:a,sheetView:c,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:h.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:h.fill});return Qe(a?.getSelection(),{onChange(k){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),C&&n?C(n):null})),Hl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ul={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Kl={key:"dragCopy",description:"Drag selection to copy cell contents."},$l={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Bo=(e,t)=>t.ctrlKey&&t.shiftKey?$l:t.ctrlKey?Kl:t.shiftKey?Ul:Vl,Wl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Gl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:h,sheet:c,gridRef:C,gridStyle:k,isActive:y,...p}=e,M=n?.getBounds(),T=r.useCallbackRef(f,[f]),z=r.useCallbackRef(h,[h]),[D,Z]=o.useState(()=>c?.getSelection().getCoords()),K=r.useCallbackRef(H=>{he.CoordUtils.isEqualSelectionCoords(H,D)||c&&c.getSelection().updateCoords(H)},[c,D]),w=r.useEditMode(),N=o.useRef(null),[v,I]=o.useState(c?.getProtection().isLocked()),[q,X]=o.useState(c?.getView().getMovableSelection().length>0),E=r.ReactUtils.detectIt().primaryInput==="touch",j=!E&&y,$=w.getMode()?.args?.stateAndCoords?.coords??null,ve=$!==null||q,Y=r.useCallbackRef(H=>{const W=he.CoordUtils.cellToRange(H);if(c.isClosed())return W;const me=c.getRange(W,{ignoreHidden:!0}).getMerges();return me.length===0?W:me[0]},[c]),_=r.useCallbackRef((H,W,me,ue,fe,Me)=>{const ae=c.getSelectedRange().getExtended(ue,H).getCoords();switch(ue){case d.IRange.Direction.Up:return ae.rowStart;case d.IRange.Direction.Down:return ae.rowEnd;case d.IRange.Direction.Left:return ae.colStart;case d.IRange.Direction.Right:return ae.colEnd}},[c]),A=r.useCallbackRef(()=>{const H=c.getUsedRange()?.getCoords(),W=c.getRowHeaders().getUsedRange()?.getCoords(),me=c.getColumnHeaders().getUsedRange()?.getCoords();return{...H,colEnd:Math.max(H?.colEnd??0,me?.max??0),rowEnd:Math.max(H?.rowEnd??0,W?.max??0)}},[c]),J=r.useCallbackRef((H,W)=>c.getRowHeaders().hiddenHeadersAt(H,W),[c]),x=r.useCallbackRef((H,W)=>c.getColumnHeaders().hiddenHeadersAt(H,W),[c]),S=r.useCallbackRef(H=>c.getRange(H,{ignoreHidden:!0}).getMerges(),[c]),oe=r.useCallbackRef(H=>{c?.getSelection().setAdjusting(H)},[c]),ie=r.useCallbackRef(async()=>{c?.getSelection().setAdjusting(null),w.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),w.setMode(null))},[w,D,c,i]),qe=o.useMemo(()=>{const H=w.getMode();return H?.key==="cut"||H?.key==="copy"},[w]);Qe(c?.getView(),{onMovableSelectionChange:()=>{X(c.getView().getMovableSelection().length>0)}}),Qe(c?.getSelection(),{onChange(H){const W=c.getSelection().getCoords();Z(W)}}),Qe(c,{onProtectionChange:()=>{I(c.getProtection().isLocked())}});const{body:de={}}=k||{},Pe=r.useNotifier(),je=n.getLayout(),De=!(j&&D.ranges.length<=1&&$===null&&!v&&(!w.getMode()||qe)),{cursor:Ie,renderOverlay:ke,onPointerDown:ge}=gt.useSelection({gridRef:C,commands:i,layout:je,getCellCoordsAsRangeCoords:Y,selection:D,fillHandleBorderColor:de.fill,selectionBackgroundColor:y?k.selection.fill:k.selectionInactive.fill,selectionBorderColor:y?k.selection.strokeFill:k.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?k.selectionRemove.fill:k.selectionInactive.fill,selectionRemoveBorderColor:y?k.selectionRemove.strokeFill:k.selectionInactive.strokeFill,disableFillDrag:De,disableMoveDrag:E||!(y&&D.ranges.length<=1&&$===null&&!v),disableTouchSelection:ve,onSelectionChange:K,onSelectionDragStart:oe,onSelectionDragEnd:ie,onMoveDragStart:(H,W,me)=>{w.setMode(Bo(0,me))},onMoveDragUpdate:(H,W,me)=>{w.setMode(Bo(0,me))},onMoveDragEnd:(H,W)=>{w.setMode(null)},onMoveDragDone:async(H,W,me)=>{if(he.CoordUtils.isEqualRanges(H,W))return;const ue=c.getRange(W);if(Pe?.showOptions){const g=ue.getDifferences(H);let Ne=!1;const Be=g.getCount();for(let Te=0;!Ne&&Te<Be;Te++)Ne=g.at(Te).isContentful();if(Ne&&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 fe=!me.ctrlKey,Me=me.shiftKey,ae=Me?fe?"Insert Moved Cells":"Insert Copied Cells":fe?"Move Cells":"Copy Cells",be=await Pe?.showBusy?.(ae);try{const g=c.getRange(H);await ue.doBatch(async()=>{Me?await ue.insertFrom(H,{isCut:fe,undoRange:g}):await ue.copyFrom(H,{isCut:fe,undoRange:g}),g.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),ue.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ae,autoSelect:!0})}catch(g){Pe?.showError?.(g)}finally{be?.()}},contentfulCellFinder:_,hiddenRowsAt:J,hiddenColumnsAt:x,mergedRanges:S,getDataCoords:A,canSelectionSpanMergedCells:H=>{const W=c.getRange(H);return W.isEntireColumns()||W.isEntireRows()},onFill:async(H,W)=>{const me="Auto Fill",ue=await Pe?.showBusy?.(me);try{await c.doBatch(()=>{c.getRange(H).autoFill(W),c.getRange(W).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:me,autoSelect:!0})}catch(fe){Pe?.showError?.(fe)}finally{N.current=null,ue?.()}},onFillPreview:(H,W,me)=>{if(C.current&&T){w.setMode(Wl);try{N.current?.direction!==me&&(N.current=null,c.getRange(H).autoFill(W,{previewOnly:Be=>{N.current={callback:Be,direction:me}}}));const ue=N.current?.callback?.(W);if(!ue||ue.isEmpty())return;const fe=ue.toText();if(!fe)return;const Me=he.CoordUtils.cellToRange(ue.getCoords()),ae=n.getRelativePointFromClient(0,0);let be=0,g=0,Ne=r.ToolTipPlacement.Bottom;if(me===d.IRange.Direction.Down){be=je.getColOffset(Me.colEnd+1)-ae.x;const Be=je.getRowOffset(Me.rowEnd),Te=je.getRowOffset(Me.rowEnd+1);g=Te-(Te-Be)/2-ae.y,Ne=r.ToolTipPlacement.Right}else if(me===d.IRange.Direction.Right){g=je.getRowOffset(Me.rowEnd+1)-ae.y;const Be=je.getColOffset(Me.colEnd),Te=je.getColOffset(Me.colEnd+1);be=Te-(Te-Be)/2-ae.x,Ne=r.ToolTipPlacement.Bottom}else if(me===d.IRange.Direction.Up){be=je.getColOffset(Me.colEnd+1)-ae.x;const Be=je.getRowOffset(Me.rowStart),Te=je.getRowOffset(Me.rowStart+1);g=Te-(Te-Be)/2-ae.y,Ne=r.ToolTipPlacement.Right}else if(me===d.IRange.Direction.Left){g=je.getRowOffset(Me.rowEnd+1)-ae.y;const Be=je.getColOffset(Me.colStart),Te=je.getColOffset(Me.colStart+1);be=Te-(Te-Be)/2-ae.x,Ne=r.ToolTipPlacement.Bottom}T({anchor:{x:be,y:g},display:fe,placement:Ne})}catch(ue){Pe?.showError?.(ue)}}},onFillDone:()=>{N.current=null,w.setMode(null),z?.()}}),O=r.useCallbackRef(H=>{ge(r.ReactUtils.createSyntheticEvent(H))},[ge,$]);o.useEffect(()=>{const H=n?.getStage();if(H)return H.addEventListener("pointerdown",O),()=>{H.removeEventListener("pointerdown",O)}},[n?.getStage()]);const Fe=r.useImperativeElement(t,()=>({}),[]),ze=o.useRef(null);return s.jsx("div",{className:ct(a,"sheet-selection",Hl),style:{position:"absolute",width:M?.width,height:M?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Nt([Fe,ze]),...p,children:ke(n)})})),Sn=Object.freeze({x:0,y:0,width:0,height:0}),_l={fireOnModelChange:!1},Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:h,onShow:c,onUnFocus:C,isDragging:k,updateFrameBounds:y,dragStart:p,style:M,disabled:T,renderMovable:z,...D}=e,[Z,K]=o.useState(Sn),[w,N]=o.useState(null),[v,I]=o.useState(!1),q=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const E=a.getBounds();if(!E)return;const j=i.toViewBounds(E);K(j??Sn),y(j??Sn)},[i?.getBounds()]),Qe(a,{onBoundsChange:E=>{const j=E.getBounds();if(!j)return;const $=i.toViewBounds(j);K($??Sn),y($)},onSelectionChange:()=>{const E=he.CommonUtils.hasFocus(q.current,!0);!v&&!E||a.isSelected()||C()}}),Qe(a,{onRequestFocus:()=>he.CommonUtils.whenFocus(q.current,!0)},_l),o.useEffect(()=>{const E=q.current;return l(E),()=>{f(E)}},[]);const X=o.useMemo(()=>{if(!Z)return null;let{width:E,height:j}=Z;return z({view:i,movable:a,disabled:T,isDragging:k,style:{position:"relative",left:0,top:0,width:E,height:j},onHide:h,onShow:c})},[i,a,Z.width,Z.height,T,k]);return s.jsx("div",{className:"movable",tabIndex:0,ref:Nt([q,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:Z.x,top:Z.y,width:Z.width,height:Z.height,...M},onMouseDown:async E=>{const j=E.shiftKey||E.ctrlKey,$=a.isSelected(),ve=E.currentTarget;j&&$?a.unselect():($&&!j||await a.select({addToSelection:j}),p(E.nativeEvent,ve),ve.focus())},onFocus:E=>{E.relatedTarget&&!w&&N(E.relatedTarget),I(!0)},onBlur:E=>{w&&!q?.current?.contains(E.relatedTarget)&&N(null),E.relatedTarget&&I(!1)},...D,children:X})})),Xl="_movable-area_314c6_5",xr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:h,onFocus:c,disabled:C=!1,disableDrag:k=!1,disableResize:y=!1,className:p,style:M,renderDirections:T=["nw","n","ne","w","e","sw","s","se"],onFirstRender:z,...D}=e,Z=n.getBounds(),K=r.useCallbackRef(z,[z]),w=r.useCallbackRef(h,[h]),N=r.useCallbackRef(c,[c]),[v,I]=o.useState([]),[q,X]=o.useState(!1),[E,j]=o.useState(!1),$=o.useRef(!0),ve=o.useRef(new Map),Y=o.useRef(new Map),_=o.useRef(new Map),A=o.useRef(new Map),J=o.useRef(new Map),x=o.useRef({onRequestFocus:m=>(me(m),null)}),S=o.useRef(null),oe=o.useRef(null),ie=o.useRef(null),[qe,de]=o.useReducer(m=>m+1,0);o.useLayoutEffect(()=>{de()},[n,i]),Qe(i,{onCollectionChange:()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),F=J.current;F.forEach(te=>{te()}),F.clear();const G=x.current;for(let te=0;te<m.length;te++){const le=m[te];if(le.isClosed())continue;const b=le.addListeners(G);F.set(le,b)}de()},onInvalidated:()=>{de()}}),Qe(a,{onMovableSelectionChange(m){je(),de()}});const Pe=o.useCallback((m,F)=>{const G=_.current.get(m);ie.current&&(ie.current.getTargets().forEach(te=>{if(te===G)return te.style.left=F.x+"px",te.style.top=F.y+"px",te.style.width=F.width+"px",void(te.style.height=F.height+"px")}),ie.current.updateRect())},[]),je=()=>{const m=[],F=a.getMovableSelection();F.forEach(G=>{const te=_.current.get(G);te&&F.indexOf(G)!==-1&&m.push(te)}),I(G=>he.CommonUtils.isEqualArrays(G,m)?G:m)},De=o.useRef(null),Ie=o.useRef(null),ke=o.useMemo(()=>(Ie.current||(Ie.current=new Promise(m=>{De.current=m})),Ie.current),[]),ge=o.useRef(null),O=r.useCallbackRef(async(m,F)=>{ge.current=F,await(async()=>!(!await ke.then()||!ie.current))()&&ge.current===F&&ie.current.dragStart(m,F)},[v]),[Fe,ze]=o.useState(!1),H=o.useRef(null),W=o.useRef(null),me=r.useCallbackRef(async(m=null)=>{if(m||(m=a.getMovableSelection()[0]),!m)return w?.(),!1;const F=_.current.get(m);F?(await he.CommonUtils.whenFocus(F),F.focus(),W.current=F,H.current=null):H.current=m},[a]);o.useEffect(()=>{Fe&&v.length>0&&W.current!==v[0]&&me(),$.current&&(K?.(),$.current=!1)},[v]);const ue=o.useMemo(()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(m.length===0&&ve.current.size===0)return null;const F=(B,R,P,ce=!0)=>{const se=B.isSelected(),ye={tabIndex:P,view:n,movable:B,onRefLoad:ee=>{H.current===B&&(ee.focus(),W.current=ee,H.current=null),_.current.set(B,ee),Y.current.set(ee,B),R.rendered=!0,je()},onRefUnload:ee=>{_.current.delete(B),Y.current.delete(ee),R.rendered=!1,je()},onUnFocus:w,onHide:ee=>{R.onHide=ee},onShow:ee=>{R.onShow=ee},isDragging:se&&(E||q),disabled:C,renderMovable:l,updateFrameBounds:ee=>{Pe(B,ee)},dragStart:O,onMouseUp:()=>{if(ge.current=null,oe.current){X(!1),j(!1);let ee=!1;A.current?.forEach(pe=>{he.CommonUtils.isEqualBounds(pe.movable.getBounds(),pe.startBounds)||(ee=!0)}),ee?Me():ae()}},style:{opacity:ce?q&&se?.7:void 0:0,zIndex:q&&se?B.getZIndex()+m.length:void 0,pointerEvents:ce?void 0:"none",cursor:E&&se?"grabbing":C||k?"initial":"move",boxShadow:!se||E&&!q?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(Zl,{...ye},`movable-${B.getUUID()}`)},G=ve.current,te=new Map,le=[];for(let B=0;B<m.length;B++){const R=m[B];if(R.isClosed())continue;let P=G.get(R);P||(P={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(ce,se)=>{if(!se||se.shown===!0)return;se.shown=!0;const ye=++se.visibilityRequestId;requestAnimationFrame(()=>{const ee=ve.current.get(ce);ee&&ye===se.visibilityRequestId&&(se.onShow?.(ce),ee.shown=!0)})},doHide:async(ce,se)=>{if(!se||se?.shown===!1)return;se.shown=!1;const ye=++se.visibilityRequestId,ee=await Promise.resolve(se.onHide?.(ce));ye===se.visibilityRequestId&&ee!==!1&&(se.shown=!1,ve.current.delete(ce),de())},visibilityRequestId:0}),P.frame=F(R,P,B,!0),le.push(P.frame),P.doShow(R,P),G.delete(R),te.set(R,P)}const b=[];return a.getMovableSelection().forEach(B=>{const R=G.get(B);R&&(R.frame=F(B,R,-1,!1),b.push(R.frame),G.delete(B),te.set(B,R))}),G.forEach((B,R)=>{B.frame=F(R,B,-1,!1),b.push(B.frame),B.doHide(R,B),G.delete(R),te.set(R,B)}),ve.current=te,je(),[...b,...le]},[qe,n,l,C,k,y,q,E]),fe=r.useCallbackRef((m,F)=>{const G=`${F} ${v.length===1?d.TextUtils.capitalize(Y.current?.get(v[0]).getContent().getType()):"Drawings"}`;oe.current&&(console.warn(`Transaction ${oe.current.getDescription()} is being replaced by ${G}`),oe.current.rollback(),oe.current=null),oe.current=f.beginCommit({description:G}),A.current.clear();for(let te=0;te<v.length;te++){const le=v[te],b=Y.current?.get(le);b?A.current.set(le,{movable:b,startBounds:n.toViewBounds(b.getBounds())}):console.warn("invalid element",b)}},[f,n,v]),Me=o.useCallback(()=>{if(!oe.current)return;const m=[];A.current?.forEach(F=>{m.push(F.movable)}),oe.current.commit({viewAfter:{view:a,movableSelection:m}}),A.current.clear(),oe.current=null},[]),ae=o.useCallback(()=>{oe.current&&(oe.current.rollback(),oe.current=null)},[]),be=o.useRef(null);o.useEffect(()=>{be.current&&(be.current.onscroll=m=>{m.preventDefault(),m.srcElement.scrollTop=0,m.srcElement.scrollLeft=0})},[be.current]);const g=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:me,focus:()=>{me()}}),[a]),[Ne,Be]=o.useState(null),Te=o.useRef(!1),u=o.useRef(!1),L=o.useRef(!1);o.useEffect(()=>{if(C||v.length===0||L.current||Te.current)return;if(u.current)return void requestAnimationFrame(()=>{ie.current&&S.current&&ie.current.refTargets.length>0&&(L.current=!0,De.current?.(!0)),I([...v])});Te.current=!0;const m=o.lazy(async()=>{try{const F=await Promise.resolve().then(()=>require("./gO4-IM2G3htj8EhV.cjs"));return Te.current=!1,u.current=!0,I([...v]),F}catch(F){return console.warn(F),De.current?.(!1),null}});Be(m)},[v,C,k,y]);const U=o.useMemo(()=>!Ne||C?null:s.jsx(o.Suspense,{children:s.jsx(Ne,{className:ct({dragging:q||E,resizing:q,moving:E}),container:null,ref:ie,target:ie.current?v:[],draggable:!C&&!k,resizable:!C&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:T,onResizeStart:m=>{fe(m.target,"Resize")},onResize:m=>{if(!oe.current)return m.stopDrag(),void de();X(!0);const F=m.direction[0]!==0&&m.direction[1]!==0;let G=0,te=0;for(let le=0;le<v.length;le++){const b=v[le],B=A.current.get(b),R=Y.current.get(b);if(!B||!R){console.warn("invalid element");continue}let P=m.dist[0],ce=m.dist[1],se=m.drag.dist[0],ye=m.drag.dist[1],ee=B.startBounds.width,pe=B.startBounds.height;le===0?(G=ee,te=pe):(P*=ee/G,se*=ee/G,ce*=pe/te,ye*=pe/te);const V={...B.startBounds};if(V.width=Math.max(0,ee+P),V.height=Math.max(0,pe+ce),m.direction[0]===-1&&(V.width=Math.max(0,Math.min(B.startBounds.x+ee,ee-se))),m.direction[1]===-1&&(V.height=Math.max(0,Math.min(B.startBounds.y+pe,pe-ye))),F&&(R.isLockAspectRatio()||m.inputEvent?.shiftKey)){const Q=ee/pe,re=V.width/V.height;re>Q?V.height=V.width/Q:re<Q&&(V.width=V.height*Q)}m.direction[0]===-1&&(V.x=Math.max(0,Math.min(B.startBounds.x+ee,B.startBounds.x+ee-V.width))),m.direction[1]===-1&&(V.y=Math.min(B.startBounds.y+pe,B.startBounds.y+pe-V.height)),B.movable.setBounds(n.toAbsoluteBounds(V))}},onResizeEnd:m=>{X(!1),Me()},onDragStart:m=>{fe(m.target,"Move")},onDrag:m=>{if(!oe.current)return m.stopDrag(),void de();j(!0);for(let F=0;F<v.length;F++){const G=v[F],te=A.current.get(G);te?te.movable.setBounds(n.toAbsoluteBounds({...te.startBounds,x:te.startBounds.x+m.translate[0],y:te.startBounds.y+m.translate[1]})):console.warn("invalid element")}},onDragEnd:m=>{},onMouseUp:m=>{}})}),[qe,Ne,v,n,C,k,y,q,E]);return s.jsx("div",{className:ct(p,"movable-area",Xl),style:{width:Z.width,height:Z.height,...M,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Nt([g,be]),...D,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:Z.width,height:Z.height},...D,children:s.jsxs("div",{ref:S,style:{position:"absolute",pointerEvents:"auto"},onFocus:m=>{N?.(),ze(!0)},onBlur:m=>{ze(!1)},onKeyDownCapture:m=>{if(m.isDefaultPrevented())return;const F=m.nativeEvent.ctrlKey,G=m.nativeEvent.altKey,te=m.nativeEvent.shiftKey;if(m.which===r.KeyCodes.Escape){const P=a.getMovableSelection();let ce=[...P];return v.forEach(se=>{if(ce.length===0)return;const ye=Y.current.get(se);let ee=ce.indexOf(ye);ce.splice(ee,1)}),ce.length!==P.length&&a.selectMovables(ce),ce.length===0&&w?.(),void m.preventDefault()}const le=.1,b=P=>{i.updateSelected(ce=>{ce.setRotation(ce.getRotation()+P)},"Rotate")},B=(P,ce=!0)=>{i.updateSelected(se=>{const ye=se.getBounds();let ee=1+P;ce||(ee=1/ee);const pe=Math.sqrt(Math.pow(ye.width,2)+Math.pow(ye.height,2)),V=Math.atan2(ye.height,ye.width),Q=ee*pe;if(Q<10)return;const re=Q*Math.cos(V),Ee=Q*Math.sin(V),Ue={x:ye.x+(ye.width-re)/2,y:ye.y+(ye.height-Ee)/2,width:re,height:Ee};se.setBounds(Ue)},"Resize")},R=P=>{i.updateSelected(ce=>{const se=ce.getBounds(),ye={x:se.x+(P.x??0),y:se.y+(P.y??0),width:se.width+(P.width??0),height:se.height+(P.height??0)};ce.setBounds(ye)},"Nudge")};if(m.which===r.KeyCodes.Delete)i.updateSelected(P=>{P.delete()},"Delete"),m.preventDefault();else if(m.key==="a"&&F){const P=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(P,!0),m.preventDefault()}else m.key==="ArrowLeft"?(te?B(le,!1):G?b(-10):R({x:F?-10:-1}),m.preventDefault()):m.key==="ArrowRight"?(te?B(le,!0):G?b(10):R({x:F?10:1}),m.preventDefault()):m.key==="ArrowUp"?(te?B(le,!0):R({y:F?-10:-1}),m.preventDefault()):m.key==="ArrowDown"&&(te?B(le,!1):R({y:F?10:1}),m.preventDefault())},children:[ue,U]})})})})),Ut=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}},Oo=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,h=Number.MAX_SAFE_INTEGER,c=0;for(let y=0;y<e.length;y++){const p=e[y],M=p.getBounds();f+=M[l],h=Math.min(M[i],h),c=Math.max(M[i]+M[l],c),n.push({bounds:M,movable:p})}const C=(c-h-f)/(e.length-1);n.sort((y,p)=>{const M=y.bounds[i],T=p.bounds[i];return M!==T?M-T:y.bounds[a]-p.bounds[a]});const k=new Map;k.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const p=n[y-1].bounds,M={...n[y].bounds};M[i]=p[i]+p[l]+C,n[y].bounds=M,k.set(n[y].movable,M)}return k.set(n[n.length-1].movable,n[n.length-1].bounds),k},qr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,h=r.useNotifier(),c=r.useEditMode();o.useRef(c.getMode()).current=c.getMode();const C=r.useCallbackRef(async(w,N,v=null,I=!0)=>{const q=async()=>{const X=await Promise.resolve(h?.showBusy?.(w.getLabel()));try{await N();const E=v??w?.getLabel?.();if(f){let j=null;w&&E!==!1&&(j=new r.SimpleCommand(w.getKey(),l,{label:E,description:E},q)),f(j)}X?.(),I&&c.setMode(null)}catch(E){X?.(),h?.showError?.(E)}};await q()},[f,h]),[k,y]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,N,v)=>{if(!n)return;const I=n.getMovableSelection();if(I.length===0)return;let q="Drawings";if(I.length===1){const E=I[0];q=d.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const X=`${w.getLabel()} ${q}`;C(w,()=>{let E=null;i&&(E=i.beginCommit(X));const j=n.getMovableSelection();if(j.length===0)return;const $=v?.(j);for(let ve=0;ve<j.length;ve++){const Y=j[ve];N(Y,$)}E?.commit()})},[n,i]),[M,T]=o.useState(n.getMovableSelection()[0]??null),[z,D]=o.useState(!M||M?.isProtected()),Z=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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.setLockAspectRatio(!w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){p(this,(w,N)=>{w.setBounds({x:N.x})},Ut)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){p(this,(w,N)=>{w.setBounds({x:(N.width-w.getBounds().width)/2+N.x})},Ut)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){p(this,(w,N)=>{w.setBounds({x:N.width-w.getBounds().width+N.x})},Ut)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){p(this,(w,N)=>{w.setBounds({y:N.y})},Ut)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){p(this,(w,N)=>{w.setBounds({y:(N.height-w.getBounds().height)/2+N.y})},Ut)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){p(this,(w,N)=>{w.setBounds({y:N.height-w.getBounds().height+N.y})},Ut)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w,!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,M]);o.useEffect(()=>{},[c]);const K=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(Z,!0),w},[a,Z]);return Qe(M,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:M?.getAnchorType()===d.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:M?.getAnchorType()===d.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:M?.isLockAspectRatio()})},onProtectedChange:w=>{D(w.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;T(w),D(!w||w.isProtected()),y()}}),Qe(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const w={disabled:z};K.getCommand("formatAnchorTypeTwoCell").update(w),K.getCommand("formatAnchorTypeOneCell").update(w),K.getCommand("formatAnchorTypeAbsolute").update(w),K.getCommand("toggleLockAspectRatio").update(w);const N=t.getCount(),v=n.getMovableSelection(),I=z||N<=1||v.length===0;let q={disabled:I},X=q;if(!I&&v.length===1){const $=v[0];$.getZIndex()===0&&(q={disabled:!0}),$.getZIndex()===N-1&&(X={disabled:!0})}K.getCommand("moveToFront").update(X),K.getCommand("moveForward").update(X),K.getCommand("moveToBack").update(q),K.getCommand("moveBackward").update(q);const E={disabled:z||v.length<=1};K.getCommand("formatDrawAlignLeft").update(E),K.getCommand("formatDrawAlignCenter").update(E),K.getCommand("formatDrawAlignRight").update(E),K.getCommand("formatDrawAlignTop").update(E),K.getCommand("formatDrawAlignMiddle").update(E),K.getCommand("formatDrawAlignBottom").update(E),K.getCommand("formatDrawFlipHorz").update(E),K.getCommand("formatDrawFlipVert").update(E),K.getCommand("formatDrawGroup").update(E),K.getCommand("formatDrawUngroup").update(E),K.getCommand("formatDrawSwapShapes").update(E),K.getCommand("formatDrawSwapShapesHorz").update(E),K.getCommand("formatDrawSwapShapesVert").update(E);const j={disabled:z||v.length<=2};K.getCommand("formatDrawDistributeHorz").update(j),K.getCommand("formatDrawDistributeVert").update(j)},[k,z,k]),K},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:p,width:M}]=Wt();return s.jsx("div",{...C,ref:Nt([k,y]),children:s.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:s.jsx("div",{style:{textAlign:"center"},children:a})})})})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,propsMovable:a,renderMovable:l,commands:f,target:h,onRepeatCommandChange:c}=e,C=qr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:c,commands:f,target:h});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const k=o.useMemo(()=>s.jsx(xr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{C.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,C]);return k&&n?k:null})),Ql=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:h,commands:c}=e,C=r.useEditMode(),[k,y]=o.useState(null),[p,M]=o.useState(null),[T,z]=o.useState(null),[D,Z]=o.useState(null),[K,w]=o.useState(null);o.useLayoutEffect(()=>{if(T===null)return Z(null),void w(null);const x=()=>{const S=i.getRange(T).getCell(),oe=S.getStyle();let ie,qe=oe.getFill()?.toCSS(a.body.darkMode);qe.background!=="none"&&qe.background!=="transparent"||(qe=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),qe.background!=="none"&&qe.background!=="transparent"||(qe={background:a.body.fill}),Z({style:qe}),S&&!S.getFormula()&&(ie=S?.getRenderHorizontalAlignment()),w(ie??r.HorizontalAlignment.Left)};return x(),i.getRange(T).addListener(()=>{x()})},[i,T,a?.body]);const N=r.useCallbackRef(()=>{let x=p.editState.dirty??"";if(p.editState.dirty!==void 0){const S=d.TextUtils.clampString(x);try{const oe=p.sheet.getRange(p.coords),ie=`Typing '${S}' into ${oe.toString()}`;return oe.setValue(x,{description:ie,autoFit:!0}),z(null),M(null),C.setMode(null),h(null),!0}catch(oe){throw he.Notifier.error(new Error(`Unable to enter '${S}'.`,{cause:oe})),oe}}},[i,p]),v=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??he.CoordUtils.cellToRange(x),[i]),I=r.useCallbackRef(x=>{let S=d.IRange.Orientation.Row,oe=!1;x!==d.IRange.Direction.Up&&x!==d.IRange.Direction.Down||(S=d.IRange.Orientation.Column),x!==d.IRange.Direction.Left&&x!==d.IRange.Direction.Up||(oe=!0),i.getSelection().traverse(S,oe)},[i]),q=o.useCallback((x,S)=>{if(l)return l(x,S);if(!i)return null;const{ref:oe,...ie}=x;return s.jsx(gr,{ref:oe,...ie,sheet:i,bodyStyle:a?.body,activeCoords:S,commands:c,onChangeEdit:qe=>{const de={sheet:i,coords:S,editState:qe};C.setMode(Pe=>({...Pe,description:de.editState.editMode?"Edit":"Enter",args:{...Pe?.args,stateAndCoords:de}}))},editState:p.editState})},[i,D,l,p,T]),{renderOverlay:X,startEdit:E,submitEdit:j,cancelEdit:$,onKeyboardEventNative:ve,onPointerEventNative:Y}=gt.useKeyboardEditorOverlay({view:n,activeCoords:k,getCellEditor:q,canEdit:()=>{const x=i.getProtection();if(x.isReadOnly())return!1;const S=x.isLocked();return S&&f(),!S},onBeforeStartEdit:x=>{const S=hr(()=>i.getRange(x).getCell()),oe={sheet:i,coords:x,editState:Object.freeze(S)};C.setMode({key:"edit",args:{stateAndCoords:oe}}),M(oe)},onStartEdit:x=>{z(x),h(x)},onSubmitEdit:N,onCancelEdit:x=>{z(null),M(null),C.setMode(null),h(null)},onDoneEdit:x=>{C.setMode(null)},onNavigate:I,propsContainer:D,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:K,getRangeCoords:v});Qe(i.getSelection(),{onChange(x){y(i.getSelection().getCoords().cell)}});const _=r.useCallbackRef(x=>{Y(x),T&&j()},[Y,$,T]),A=o.useCallback(x=>{Y(x)},[Y]),J=o.useCallback(x=>{ve(x)},[ve]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",_),x.addEventListener("dblclick",A),x.addEventListener("keydown",J),()=>{x.removeEventListener("pointerdown",_),x.removeEventListener("dblclick",A),x.removeEventListener("keydown",J)}},[n?.getStage()]),o.useEffect(()=>{const x=C.getMode(),S=x?.key;S==="edit"||S==="enter"?p?x.args?.cancel?$():x.args?.submit?j():M(x.args?.stateAndCoords):E(x.args?.start):T&&$()},[C]),X(n,t)})),Sr="white",Rr="black",ei=`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='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ti=`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='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,h]=o.useState(null),[c,C]=o.useState(null),[k,y]=o.useState(null),[p,M]=o.useState(null),T=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)}else l(!1),h(null)},[i,n]),z=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const I=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:I});q.length===1&&q[0].select()},[n,i]),D=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const I=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:I});if(q.length===1){const X=q[0].getRange().getCoords(),E={colStart:X.colStart,rowStart:I.rowIndex,colEnd:X.colEnd,rowEnd:I.rowIndex};i.getRange(E).select()}},[n,i]),Z=r.useCallbackRef(()=>{if(!a)return;const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)},[i,a,n]);Qe(i?.getSelection(),{onChange(v){C(i.getSelection().getCoords().cell)}}),Qe(k,{onAnyChange(v){T(),Z()}}),Qe(p,{onAnyChange(v){Z()}}),Qe(i,{onTablesChange(v){T(),Z()},onInvalidated(v){T(),Z()}});const K=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle(Z,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let v=null;if(f)for(let I=0;I<f.length&&!v;I++){const q=f[I],X=q.getRange().getCoords();d.CoordUtils.isCellWithinRange(c,X)&&(v=q)}y(v)},[c,f]);const w=r.useCallbackRef(v=>{let I=null;if(f)for(let q=0;q<f.length;q++){const X=f[q],E=X.getRange().getCoords();let j=n.getRangeCoordsBounds(E);const $=n.getRelativePointFromClient(v.clientX,v.clientY),ve=$.x,Y=$.y;if(ve>=j.x&&ve<=j.x+j.width&&Y>=j.y&&Y<=j.y+j.height){const _=n.getViewportSize();ve<=0||Y<=0||ve>=_.width||Y>=_.height||(I=X)}}M(I)},[n,f]);if(o.useEffect(()=>{const v=n?.getStage();if(v&&f)return v.addEventListener("mousemove",w),v.addEventListener("mouseleave",w),()=>{v.removeEventListener("mousemove",w),v.removeEventListener("mouseleave",w)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const N=[];for(let v=0;v<f.length;v++){const I=f[v];if(I.isClosed())continue;const q=I===p,X=I===k,E=I.getRange().getCoords(),j=n.getRangeCoordsBounds(E);let $;if(q||X){const ve=I.getStyle().getProperties(),Y=ve.headerRow?.fill?.background??ve.wholeTable?.border?.top?.color?.toString();if(Y&&i){const _=i.getStyles().parseColor(Y);_&&($=_.toCSS())}$||($="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}N.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:j.height,pointerEvents:"all",cursor:ei},onMouseDown:D},`table-select-row-${I.getName()}`)),N.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:Math.min(16,j.height),pointerEvents:"all",cursor:ti},onMouseDown:z},`table-select-${I.getName()}`)),N.push(s.jsx(gt.Selection,{x:j.x,y:j.y,width:j.width,height:j.height,range:E,strokeWidth:X?.5:0,stroke:$??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:q?`${$} 0px 0px 1px 1px`:void 0}},`table-outline-${I.getName()}`))}return N})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[h,c]=o.useState(null),C=o.useRef(null),k=r.useCallbackRef(()=>{const D=i.getSelectedCell(),Z=D.getSpill()?.getCoords()??null;he.CoordUtils.isEqualRanges(Z,l)||(c(Z?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(Z),coords:Z}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(Z))},[i,n,l]);o.useEffect(()=>(C.current&&(clearTimeout(C.current),C.current=null),h&&(C.current=setTimeout(()=>{c(null),C.current=null},a)),()=>{C.current&&(clearTimeout(C.current),C.current=null)}),[h,a]);const y=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle(k,80),80),[]);if(Qe(i?.getSelection(),{onChange(D){y()}}),Qe(i,{onSpillsChange(D){k()},onInvalidated(D){k()}}),!n||!l&&!h)return null;const p=i.getRange(l).getValue()instanceof d.FormulaError.Spill,M=[];let T=h?.bounds??n.getRangeCoordsBounds(l);if(h&&!he.CommonUtils.isEqualBounds(h.bounds,n.getRangeCoordsBounds(h.coords))&&c(null),T=n.toClipBounds(T,-10),!T)return;const z="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return M.push(s.jsx(gt.Selection,{x:T.x,y:T.y,width:T.width,height:T.height,range:l,strokeWidth:1,stroke:z,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:h?.transition==="out"?0:1,transition:h?.transition?h.transition==="in"||h.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:`${z} 0px 0px 4px 0px`}},"spill-outline}")),M})),ri={position:"absolute",top:0,left:0,bottom:0,right:0},Ho=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=he.CommonUtils.mergeContentful(e.body,l);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,l),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,l),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelectAll,l),n},li={fireOnModelChange:!1},Vo={},kr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Vo,headersStyle:a=Vo,onSheetContextMenu:l,showColumnHeaders:f,propsColumnHeader:h,showRowHeaders:c,propsRowHeader:C,showScrollbars:k=!0,propsScrollPane:y,onViewportChange:p,commands:M,onRepeatCommandChange:T,overlays:z,renderMovable:D,viewportComponent:Z,onElementLoad:K,getCellEditor:w,onFocus:N,onBlur:v,style:I=r.ReactUtils.EmptyCssProperties,onShowTooltip:q,onShowColumnTooltip:X,onShowRowTooltip:E,onCloseTooltip:j,propsGrid:$,propsCellRender:ve,...Y}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[_,A]=o.useReducer(ne=>ne+1,0),[J,{width:x,height:S}]=Wt(),oe=r.useCallbackRef(q,[q]),ie=r.useCallbackRef(X,[X]),qe=r.useCallbackRef(E,[E]),de=r.useCallbackRef(j,[j]),Pe=o.useRef(!1);o.useLayoutEffect(()=>{Pe.current=!0},[n]);const je=n?.getStyles(),De=o.useMemo(()=>Ho(i,je),[i,je]),Ie=o.useMemo(()=>Ho(a,je),[a,je]),{body:ke={},buttonSurface:ge={}}=De,{header:O={},headerSelect:Fe={},headerSelectAll:ze={}}=Ie,H=o.useRef(null),[W,me]=o.useState(()=>n?.getView()),ue=(W?.getZoomScale()??100)/100,fe=o.useMemo(()=>({vertical:W.isShowColumnGridlines()&&ue>=.4,horizontal:W.isShowRowGridlines()&&ue>=.4}),[W?.isShowColumnGridlines(),W?.isShowRowGridlines(),ue]),Me=o.useMemo(()=>{if(W?.getGridLineColor())return{strokeDasharray:"1,1"}},[W?.getGridLineColor(),De]),ae=f??W?.isShowColumnHeaders(),be=c??W?.isShowRowHeaders(),[g,Ne]=o.useState({width:0,height:0}),Be=o.useMemo(()=>{let ne=40,Re=20;const Ke=n?.getStyles().getNormal().getFont();if(g.width>0&&g.height>0){const Ve=Ke?.toCSS()?.fontFamily??De.header.text.fontFamily,Ge=Ke?.getSize()??De.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+g.height,Math.ceil(Ge*d.IFont.getDeviceScale()),Ve);ne=We.width,Re=We.lineHeight}return{width:Math.round(ne+5),height:Math.round(Re+3)}},[g,De?.header.text,n]),Te=be?ue*Be.width:O.edgeStrokeWidth,u=ae?ue*Be.height:O.edgeStrokeWidth,L=Math.max(x,(n?.getColumnHeaders().getDefaultSize()??Be.width)+Te+1),U=Math.max(S,(n?.getRowHeaders().getDefaultSize()??Be.height)+u+1),m=o.useRef(new Map),F=o.useRef(null),G=()=>({getColOffset:ne=>n.getColumnHeaders().findOffset(ne),getColIndex:ne=>n.getColumnHeaders().findIndex(ne),getRowOffset:ne=>n.getRowHeaders().findOffset(ne),getRowIndex:ne=>n.getRowHeaders().findIndex(ne)}),[te,le]=o.useState(()=>G()),[b,B]=o.useState(!1),[R,P]=o.useState(null),ce=!0,se=De.selection?.strokeFill,ye=o.useCallback(()=>Mt.current,[]),[ee,pe]=o.useState(),V=r.useCallbackRef(ne=>{pe(ne);const Re=n?n.getView():null;Re&&Re.setTopLeft(ne?{left:ne.left,top:ne.top}:null),p?.(ne)},[n,p]),Q=o.useRef(null);o.useEffect(()=>{if(!ee||!n)return;const ne=n.getRangeAtBounds({x:ee.left,y:ee.top,width:ee.width,height:ee.height});Q.current?.(),Q.current=ne.addListener(()=>{const Re=ne.getCoords();H?.current?.invalidate(Re)})},[ee,n]);const[re,Ee]=o.useState(()=>n?.getView().getTopLeft()),Ue=r.useCallbackRef(ne=>{const Re=he.CoordUtils.cellToRange(ne);if(n.isClosed())return Re;const Ke=n.getRange(Re,{ignoreHidden:!0}).getMerges();return Ke.length===0?Re:Ke[0]},[n]),Oe=ne=>{if(!ne||ne.coords.colIndex===0&&ne.coords.rowIndex===0)return null;const Re={};return ne.coords.colIndex>0&&(Re[he.AnchorLocation.Left]={index:ne.coords.colIndex,scrollOffset:ne.topLeft.left}),ne.coords.rowIndex>0&&(Re[he.AnchorLocation.Top]={index:ne.coords.rowIndex,scrollOffset:ne.topLeft.top}),Re},[xe,He]=o.useState(()=>Oe(n.getView().getFreezePanes())),Ce=r.useEditMode(),Ae=o.useCallback(()=>H.current,[]),we=r.useCallbackRef(ne=>{Ce.setMode(Re=>Re?.key==="edit"?{...Re,args:{...Re.args}}:{key:"edit",args:{stateAndCoords:null,start:ne}})},[]),Se=r.useCallbackRef(()=>ee,[ee]),Le=wr({sheet:n,commands:M,target:Ae,onRepeatCommandChange:T,bodyStyle:ke,onStartEdit:we,getViewport:Se}),[Ze,_e]=o.useState(n.getSelection().isEntire()),[Xe,at]=o.useState(W?.getMovableSelection().length>0),ot=R!==null||Xe,$e=null,[lt,it]=o.useState(!1);o.useEffect(()=>{it(!1)},[n.getProtection()]);const Je=r.useNotifier(),st=r.useCallbackRef(()=>{lt||(it(!0),Je.showMessage?.(s.jsxs("span",{children:["This sheet is protected.",s.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[Je,lt]),wt=o.useMemo(()=>{const ne=Ce.getMode();return ne?.cursor?ne.cursor:null},[$e,Ce]),[bt,dt]=o.useState(null),ft=o.useRef(!1),[xt,Un]=o.useState([]),Yt=o.useRef(null),[fn,Pt]=o.useState(he.TypesUtils.EmptyTopLeft),[jt,It]=o.useState(he.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Pt({left:re?.left,top:0})},[re?.left]),o.useEffect(()=>{It({left:0,top:re?.top})},[re?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{He(Oe(n.getView().getFreezePanes()))},onTopLeftChange:()=>{Ee(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){me(n.getView()),le(G())},onLayoutChange:()=>{const ne=n.getEntireRange();Ne({height:ne.getRowCount(),width:ne.getColumnCount()}),le(G())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),Qe(n,{onRequestScrollIntoView:async(ne,Re)=>{if(!Re)return;const Ke={colIndex:Re?.coords?.colStart,rowIndex:Re?.coords?.rowStart};return await H.current?.scrollCellCoordsIntoView(Ke,Re?.scroll),!0},onRequestFocus:()=>he.CommonUtils.whenFocus(Mt.current)},li);const pt=o.useRef(!1),pn=o.useMemo(()=>{const ne=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&ie?.(Ve)})},32),Re=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:g.height,colStart:Ve,colEnd:Ve})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getColOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.x+tt.width,rt.getColOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===he.AnchorLocation.Left||Tt===he.AnchorLocation.Center||Tt===he.AnchorLocation.Right)){const to=he.CommonUtils.roundAccurately(Ge*he.CommonUtils.getDPI(),0),bn=he.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ge/ue),2).toFixed(2),no="Width: "+(Ge?bn+" ("+to+" pixels)":"Hidden"),tn=Gn.current.getGridElement().getRelativePointFromClient(0,0),Vt=0-tn.y,xn=0-tn.y+u,oo=tn.x-tt.x;ne({anchor:{x:nt-oo,y:Vt,width:yt-nt,height:xn-Vt},display:no})}const zt=[0,0,0,tt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},Jn={x:nt-1,y:0,width:1,height:tt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},eo={x:yt-1,y:0,width:1,height:tt.height};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Re(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Re(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Re(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},...h}},[n,h,u,bt]),Bt=o.useMemo(()=>{const ne=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&qe?.(Ve)})},32),Re=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:g.width})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getRowOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.y+tt.height,rt.getRowOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===he.AnchorLocation.Top||Tt===he.AnchorLocation.Center||Tt===he.AnchorLocation.Bottom)){const to=Math.floor(10*he.CommonUtils.getDPI())/10,bn=he.CommonUtils.roundAccurately(Ge*to,0),no=he.CommonUtils.roundAccurately(bn/ue/(n?.getRowHeaders().getScaleFactor()*he.CommonUtils.getDPI()),2).toFixed(2),tn="Height: "+(Ge?no+" ("+bn+" pixels)":"Hidden"),Vt=Ht.current.getGridElement().getRelativePointFromClient(0,0),xn=0-Vt.x,oo=0-Vt.x+Te,gl=Vt.y-tt.y;ne({anchor:{x:xn,y:nt-gl,width:oo-xn,height:yt-nt},display:tn})}const zt=[0,0,tt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},Jn={x:0,y:nt-1,width:tt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},eo={x:0,y:yt-1,width:tt.width,height:1};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Re(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Re(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Re(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},...C}},[n,C,Te]),Mt=r.useImperativeElement(t,()=>{const ne=Ke=>{n?.getView()&&n.getView().selectMovables([]),F.current=null,H?.current?.focus(Ke)},Re=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ge=H.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ge)return!1;const We=Ge.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let rt=m.current?.get(We);return rt?.current?(await rt.current.focusMovable(Ke),!0):(F.current={movable:Ke,anchor:We},!0)};return{getGridElement:()=>H.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Gn.current,rowHeaderHeight:()=>u,colHeaderWidth:()=>Te,startEdit:we,submitEdit:()=>{Ce.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{Ce.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:R!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&Re()||ne(Ke)},focusSheet:ne,focusMovable:Re,contains:Ke=>H?.current?.contains?.(Ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(ne=>{Pe.current||(H?.current?.invalidate(ne),A?.())},[]);o.useEffect(()=>{At()},[De]);const Jt=Ze?ze.edgeStrokeFill:O.fill,Kn=Ze?Fe.fill:typeof De.headerHover=="function"?De.headerHover(O)?.fill:O.fill,et=o.useMemo(()=>Z?s.jsx("div",{className:ct("sheetxl-viewport-overlay",Sl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:Z}):s.jsx(s.Fragment,{}),[Z]);let Qt=null;ae&&be&&(Qt=s.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${u}px`,width:`${Te}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:ne=>{let Re=!ne.ctrlKey;Le?.getCommand("selectAll")?.execute(!Re||ne.button!==0),ne.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:-1,colIndex:-1}):H.current?.focus()},children:[s.jsx("div",{style:{height:u-5+"px",width:u-5+"px",clipPath:`path('M${u-5} 0 L0 ${u-5} L${u-5} ${u-5} L${u-5} 0 Z')`,borderRight:`2px solid ${Jt}`,borderBottom:`2px solid ${Jt}`,background:`${Kn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),s.jsx("div",{style:{position:"absolute",height:`${u}px`,width:`${Te}px`,boxSizing:"border-box",borderRight:`solid 1px ${O.strokeFill}`,borderBottom:`solid 1px ${O.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Ot=r.useCallbackRef(({_left:ne,_top:Re})=>{},[]),vn=r.useCallbackRef(ne=>{if(!l)return;const Re=H.current.getViewFromClient(ne.clientX,ne.clientY)?.getCellCoordsFromClient(ne.clientX,ne.clientY);Re&&(l({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:Re.rowIndex,colIndex:Re.colIndex}),ne.stopPropagation(),ne.preventDefault())},[l]),ut=r.useCallbackRef(ne=>{if(!(!ne.shiftKey&&(ne.ctrlKey||ne.metaKey)))return;const{deltaY:Re}=ne;return Re>0?Le.getCommand("sheetZoomOut")?.execute():Re<0&&Le.getCommand("sheetZoomIn")?.execute(),Re===0},[Le]);o.useEffect(()=>{Un(null),Yt.current=null,ft.current=!1,dt(null);const ne=n?.getView().getTopLeft();Ot(ne),H.current?.scrollTo(ne),Ee(ne),me(n.getView()),He(Oe(n.getView().getFreezePanes())),le(G()),A()},[n?.getView()]);const vt=o.useCallback((ne,Re)=>n.getRowHeaders().hiddenHeadersAt(ne,Re),[n]),Cn=o.useCallback((ne,Re)=>n.getColumnHeaders().hiddenHeadersAt(ne,Re),[n]),en=r.useCallbackRef(ne=>{const Re=ne.getVisibleRangeCoords();if(!Re)return null;const Ke=[];return n.getRange(Re).forEach((Ve,Ge)=>{const We=Ge.getCoords(),rt=Ge.getCell();(nt=>{if(nt.isEmpty())return!1;const tt=nt.getSpans();if(tt.width>1||tt.height>1||nt.getStyle().hasVisibleStyling()||W.isShowFormulas()&&nt.getFormula()!==null)return!0;const yt=nt.getValue();return yt!==null&&!(!W.isShowZeros()&&yt===0&&nt.getType()===d.ScalarType.Number)})(rt)&&Ke.push({coords:We,value:rt,range:W.isShowFormulas()?null:rt.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,W.isShowZeros(),W.isShowFormulas(),R]);o.useEffect(()=>{const ne=[];z&&ne.push(...z),bt&&ne.push(...bt),he.CommonUtils.isEqualArrays(ne,Yt.current)||(Yt.current=ne,Un(ne))},[z,bt,De]);const Dt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:i?.body?.text?.fill??"black"}}),[De?.header?.edgeStrokeFill]),$n=r.useCallbackRef(ne=>{ne.isDefaultPrevented()||ne.isPropagationStopped()||(F.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const ne=Ce.getMode();return ne?.key==="cut"||ne?.key==="copy"},[Ce]),yn=r.useCallbackRef(async ne=>{const Re=Ce.getMode();return ne.keyCode===r.KeyCodes.Escape&&Re?(ne.preventDefault(),void Ce.setMode(null)):ne.keyCode===r.KeyCodes.Enter&&Wn?(ne.preventDefault(),await Le?.getCommand("paste")?.execute(),void Ce.setMode(null)):void Le?.dispatchToFocusedCommand(ne)},[Le,Ce]),Ht=o.useRef(null),wn=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Te+O.edgeStrokeWidth}px`,minWidth:`${Te+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2"},children:s.jsx(jo,{ref:Ht,sheetElement:Mt.current,gridRef:H,freezeStart:xe?.[he.AnchorLocation.Top],oppositeSize:Te,containerWidth:Te,containerHeight:U,sheetHeader:n.getRowHeaders(),gridStyle:Ie,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:jt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Te+O.edgeStrokeWidth}px`,minWidth:`${Te+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2",...Bt?.style},...Bt})}),[Te,u,U,n,jt,xe?.[he.AnchorLocation.Top],De,ce,l,O.fill,C]),Gn=o.useRef(null),ll=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:s.jsx(jo,{ref:Gn,sheetElement:Mt.current,gridRef:H,freezeStart:xe?.[he.AnchorLocation.Left],oppositeSize:u,containerWidth:L,containerHeight:u,sheetHeader:n.getColumnHeaders(),gridStyle:Ie,scrollPoint:fn,onSheetContextMenu:l,...pn,style:{...pn?.style,position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[u,L,n,fn,xe?.[he.AnchorLocation.Left],De,O.fill,ce,l,h]),il=r.useCallbackRef(ne=>{const{value:Re,key:Ke,...Ve}=ne;let Ge=Re,We=R;if(!We||We.colIndex===ne.coords.colIndex&&We.rowIndex===ne.coords.rowIndex||(We=null),!Ge){const tt=ne.range;if(Ge=n.getRange({rowIndex:tt.rowStart,colIndex:tt.colStart}).getCell(),Ge.isEmpty())return null}let rt=null;Ge.getHyperlink()&&(rt=async tt=>{if(ve?.onLinkMouseDown?.(tt),tt.button===0&&!tt.isDefaultPrevented()){tt.stopPropagation(),tt.preventDefault();try{await Ge.getHyperlink()?.open()}catch(yt){Je.showError?.(yt)}}}),We&&We.colIndex===ne.range.colStart&&We.rowIndex===ne.range.rowStart&&(Ge=Ge.createTemporaryCell({value:null}));const nt=n.getStyles();return o.createElement(ur,{...Ve,key:Ke,bodyStyle:ke,docTheme:nt.getTheme(),normalStyle:nt.getNormal(),showFormulas:W.isShowFormulas(),showZeros:W.isShowZeros(),onLinkMouseDown:rt,...ve,value:Ge})},[n,te,ke,R,W?.isShowFormulas(),W.isShowZeros()]),al=o.useCallback(ne=>{const{key:Re,ref:Ke,...Ve}=ne;return[s.jsx(Al,{ref:Ke,getVisibleCells:en,sheet:n,gridStyle:De,...Ve},`border-${Re}`),s.jsx(ni,{ref:Ke,sheet:n,commands:Le,...Ve},`table-${Re}`),s.jsx(oi,{ref:Ke,sheet:n,...Ve},`spill-${Re}`),s.jsx(Gl,{ref:Ke,sheet:n,commands:Le,onShowTooltip:oe,onCloseTooltip:de,gridStyle:De,gridRef:H,isActive:ce,...Ve},`selection-${Re}`),s.jsx(Ol,{ref:Ke,sheet:n,commands:Le,gridStyle:De,element:ye,...Ve},`copy-paste-${Re}`),s.jsx(Jl,{ref:Ke,sheet:n,commands:Le,target:Ae,renderMovable:D,propsMovable:{onUnFocus:()=>{Mt.current.focus()}},...Ve},`movable-${Re}`),s.jsx(Ql,{ref:Ke,sheet:n,commands:Le,gridStyle:De,getCellEditor:w,showProtectedError:st,setEditingCoords:P,...Ve},`editor-${Re}`)]},[n,H.current,De,w,Le,Je]),[Io,sl]=o.useState(!1),cl=o.useMemo(()=>{if(L===0||U===0)return null;const ne=n.getStyles().getNormal(),Re=ne.getFont(),Ke=ne.getFill(),Ve=ne.getBorder(),Ge=ne.getFill().getType()===d.IFill.Type.None;let We=Me,rt=Me;const nt=(yt,Tt,zt)=>zt?{stroke:Ve.getBottom().isNone()?"none":yt.getColor().toRGBA(ke.darkMode).toString(),...Tt}:Tt;rt=nt(Ve.getBottom(),rt,!Ve.getBottom().isNone()),rt=nt(Ve.getTop(),rt,!Ve.getTop().isNone()),We=nt(Ve.getRight(),We,!Ve.getRight().isNone()),We=nt(Ve.getLeft(),We,!Ve.getLeft().isNone());let tt=W?.getGridLineColor()?.toRGBA(ke.darkMode).toString()??ke.strokeFill;return Ge||(rt=nt(Ve.getBottom(),rt,!0),rt=nt(Ve.getTop(),rt,!0),We=nt(Ve.getRight(),We,!0),We=nt(Ve.getLeft(),We,!0)),s.jsx(gt.Grid,{className:"sheetxl-sheet-primary",style:{...ri,...Ke.toCSS(ke.darkMode),...Re.toCSS(ke.darkMode,ue),"--sxl-app-color-background":ke.fill,"--sxl-app-color-shadow":De.colorShadow,"--sxl-app-color-grey":De.colorGrey,"--sxl-app-color-button-fill":ge.fill,"--sxl-app-color-button-text":ge.text?.fill,"--sxl-app-color-button-border":ge.edgeStrokeFill,"--sxl-app-color-primary-dark":De.selection.strokeFill},ref:H,zoom:ue,...$,onFirstRender:yt=>{sl(!0),$?.onFirstRender?.(yt),Le?.activate()},showGridLines:fe,gridLineColor:tt,propsGridLineColumns:We,propsGridLineRows:rt,freezeLeft:xe?.[he.AnchorLocation.Left],propsFreezeLeft:Dt,freezeTop:xe?.[he.AnchorLocation.Top],propsFreezeTop:Dt,width:L,height:U,columnCount:g.width,rowCount:g.height,cursor:wt??$e??"cell",clipCells:!0,layout:te,renderCell:il,renderOverlay:al,getCellCoordsAsRangeCoords:Ue,hiddenRowsAt:vt,hiddenColumnsAt:Cn,getVisibleCells:en,onWheelScroll:ut,onPointerDown:$n,onKeyDown:yn,onViewportChange:V,onImmediateScroll:Ot,scrollPoint:re,propsStage:{onFocus:()=>{Le?.activate()}},renderOverlays:xt})},[_]);o.useEffect(()=>{Pe.current||A()},[te,xe,ue,Le,re?.left,re?.top,ke,$,L,U,wt,xt,ce,$e]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};k||(_n={..._n,...I});const dl=o.useMemo(()=>{const ne=n.getStyles().getTheme(),Re=ne.getColorScheme(),Ke=ne.getFontScheme();return{"--sxl-doc-color-dk1":Re.getDk1().toCSS(ke.darkMode),"--sxl-doc-color-dk2":Re.getDk2().toCSS(ke.darkMode),"--sxl-doc-color-lt1":Re.getLt1().toCSS(ke.darkMode),"--sxl-doc-color-lt2":Re.getLt2().toCSS(ke.darkMode),"--sxl-doc-color-accent1":Re.getAccent1().toCSS(ke.darkMode),"--sxl-doc-color-accent2":Re.getAccent2().toCSS(ke.darkMode),"--sxl-doc-color-accent3":Re.getAccent3().toCSS(ke.darkMode),"--sxl-doc-color-accent4":Re.getAccent4().toCSS(ke.darkMode),"--sxl-doc-color-accent5":Re.getAccent5().toCSS(ke.darkMode),"--sxl-doc-color-accent6":Re.getAccent6().toCSS(ke.darkMode),"--sxl-doc-color-hlink":Re.getHlink().toCSS(ke.darkMode),"--sxl-doc-color-fol-hlink":Re.getFolHlink().toCSS(ke.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),Eo=r.useCallbackRef(ne=>{const{style:Re,...Ke}=ne;return s.jsx(bo,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...Re},sheet:n})},[n]);let Zn=s.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:ne=>{B(!0),N?.(ne)},onBlur:ne=>{B(!1),v?.(ne)},ref:Mt,...Y,children:s.jsx("div",{className:ct("sheetxl-sheet",ql),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...dl},children:s.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[ll,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,backgroundColor:ke.fill},ref:J,onContextMenu:vn,children:[cl,et,s.jsx(Rl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:De?.selection?.strokeFill,colorCredits:De?.body?.text?.fill})]})]})]})})});k&&(Zn=s.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${O.fill}`,minHeight:2*Be.height,minWidth:2*Be.width,...I},viewport:ee,touchElement:H.current?.stage,disableTouch:ot,onScrollViewport:ne=>{H.current?.scrollTo(ne)},renderScrollbarHorizontal:Eo,renderScrollbarVertical:Eo,...y,children:Zn})),o.useEffect(()=>{Pe.current=!1,A?.(),b&&Mt.current?.focus()},[n]);const[Xn,ul]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||ul(!0)},[Xn]);return o.useEffect(()=>{if(Io)return typeof K=="function"&&K(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[K,Io,Xn]),Zn}));kr.displayName="SheetElement";const Uo="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=",Mr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:h,view:c,onHide:C,onShow:k,onKeyDownCapture:y,onFocus:p,onBlur:M,loadingPanel:T,...z}=e,[D,Z]=o.useState(!1),[K,w]=o.useState(null),[N,v]=o.useState(null),[I,q]=o.useState(null);o.useEffect(()=>{v(null),l.getDetails().then(j=>{Z(!1),v(j.asUrl()),j.asSVGText?.()&&q(j.asSVGText())}).catch(j=>{console.warn(j),Z(!0),v(Uo),q(null)})},[l]);const X=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),E=o.useMemo(()=>{if(N||I)return s.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:N,onLoad:()=>{w(!0)},onError:({currentTarget:j})=>{console.log("error"),j.onerror=null,v(Uo),Z(!0)},alt:f??`${l.getType()}`})},[K,l,N,I,h]);if(!l.isClosed())return s.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:h?"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,...z,onKeyDownCapture:j=>{y?.(j)},ref:X,children:[K||D?void 0:T,E]})}));Mr.displayName="PictureEditor";const ii=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:p,width:M}]=Wt();if(!a.isClosed())return s.jsx("div",{...C,ref:Nt([k,y]),children:s.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:s.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ai="_editable-input_1bqx6_6",si=e=>s.jsx("input",{...e}),Tr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:h,renderInput:c=si,styleHover:C={},dragging:k,maxLength:y,disabled:p=!1,readOnly:M=!1,...T}=e,[z,D]=o.useState(!1),[Z,K]=o.useState(!1),[w,N]=o.useState(a);o.useEffect(()=>{N(a)},[a]);const v=o.useRef(null),[I,q]=o.useState(null),X=r.useNotifier(),E=o.useCallback(function(J){const x=J.message;I!==x&&(X?.showMessage?.(x,{type:r.NotifierType.Error}),q(x))},[X,I]),j=o.useCallback(J=>{let x=!1;try{x=l?.(J)??!0}catch(S){E(S)}return x?(v.current=null,K(!1),N(J),x):(setTimeout(()=>{v.current?.focus()},0),x)},[l]),$=r.useCallbackRef(()=>{N(a),v.current=null,K(!1),h?.()},[h,a]),ve=o.useMemo(()=>{if(!Z)return null;const J={className:ct(ai),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:w,onFocus:x=>{v.current||(v.current=x.target,setTimeout(()=>{x.target?.select()},0))},onBlur:x=>{v.current&&j(w)},onChange:x=>{Z&&N(x.target.value)},onMouseDown:x=>x.stopPropagation(),onKeyDown:x=>x.code==="Escape"?(x.preventDefault(),void $()):x.code==="Enter"?(x.preventDefault(),void j(x.target.value)):void(x.code!=="Tab"?x.stopPropagation():j(x.target.value))};return s.jsx(s.Fragment,{children:c(J)})},[Z,w,j,$,c,p]),[Y,_]=o.useState();o.useLayoutEffect(()=>{let J=Object.assign({},n);(k||z)&&(J=Object.assign(J,C)),_(J)},[k,z,C,n]),o.useEffect(()=>{ve&&f?.(w)},[ve,f,w]);const A=r.useImperativeElement(t,()=>({startEdit(){p||M||K(!0)},cancel(){$()}}),[]);return s.jsxs("div",{...T,ref:A,style:{flexDirection:"column",display:"flex",...Y},className:ct(i),children:[s.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||M||K(!0)},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[s.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:Z?0:1},children:w}),ve]}),s.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...C},children:w})]})})),jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Zt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function Ct(e){var t,n;return e?Zt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=Ct(e);return e instanceof t}function gn(e){return!Zt(e)&&e instanceof Ct(e).HTMLElement}function Ir(e){return e instanceof Ct(e).SVGElement}function _t(e){return e?Zt(e)?e.document:xo(e)?qo(e)?e:gn(e)||Ir(e)?e.ownerDocument:document:document:document}const Rt=jn?o.useLayoutEffect:o.useEffect;function Bn(e){const t=o.useRef(e);return Rt(()=>{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 cn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function rn(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Fn(e){const t=Bn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function An(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function hn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Er(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 h=Object.entries(f);for(const[c,C]of h){const k=l[c];k!=null&&(l[c]=k+e*C)}return l},{...t})}}const $t=Er(1),dn=Er(-1);function On(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Dn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=Ct(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 Lt=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[Lt.Translate.toString(e),Lt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Ko="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ci(e){return e.matches(Ko)?e:e.querySelector(Ko)}const di={display:"none"};function ui(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function gi(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 Fr=o.createContext(null),hi={draggable:`
|
|
23
|
+
The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",v,{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",v,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",v,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(E,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const v={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(E=>w.paste({...Ll,...E})).update(v),i.getCommand("pasteFormats").updateCallback((E,q)=>w.paste({...Nl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteFormulas").updateCallback((E,q)=>w.paste({...Pl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteTranspose").updateCallback((E,q)=>w.paste({...jl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteLinks").updateCallback((E,q)=>w.paste({...Bl,description:q.getLabel(),...E})).update(v),i.getCommand("cut").update(v),i.getCommand("paste").update(v)},[t,i]);const N=o.useMemo(()=>{if(!z||!T.current)return;const v=z.key;if(v!=="copy"&&v!=="cut"&&v!=="formatPainter")return;const E=T.current.getItem();if(E.getSource()!==t)return;const q=T.current.isCut?.(),Z=q?M:C,F=q?c:h,P=E.getCoords(),W=P?[P]:null;return W&&W.length!==0?pe=>{const de=[];for(let le=0;le<W.length;le++){const R=W[le],te=pe.toClipBounds(pe.getRangeCoordsBounds(R,{top:0,left:0,right:1,bottom:1}),gt.SELECTION_CLIP_INSETS);te&&(de.push(p({range:R,key:`copy-selection-background-${le}`,x:te.x,y:te.y,width:Math.max(te.width,0),height:Math.max(te.height,0),stroke:Z,strokeWidth:2})),de.push(p({range:R,key:`copy-selection-foreground-${le}`,x:te.x+(te.width<=2?-1:0),y:te.y,width:Math.max(te.width,3),height:Math.max(te.height,3),stroke:F,strokeWidth:2,isAnimatedStroke:!0})))}return de}:null},[z,t,n,h,C,c,M]);return{...w,clipboard:$,overlays:N}},Ol=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,h=l.body??{},c=a.getView(),{overlays:C}=br({element:i,sheet:a,sheetView:c,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:h.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:h.fill});return Qe(a?.getSelection(),{onChange(M){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),C&&n?C(n):null})),Hl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ul={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Kl={key:"dragCopy",description:"Drag selection to copy cell contents."},$l={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Bo=(e,t)=>t.ctrlKey&&t.shiftKey?$l:t.ctrlKey?Kl:t.shiftKey?Ul:Vl,Wl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Gl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:h,sheet:c,gridRef:C,gridStyle:M,isActive:y,...p}=e,T=n?.getBounds(),I=r.useCallbackRef(f,[f]),z=r.useCallbackRef(h,[h]),[D,_]=o.useState(()=>c?.getSelection().getCoords()),$=r.useCallbackRef(H=>{ge.CoordUtils.isEqualSelectionCoords(H,D)||c&&c.getSelection().updateCoords(H)},[c,D]),w=r.useEditMode(),N=o.useRef(null),[v,E]=o.useState(c?.getProtection().isLocked()),[q,Z]=o.useState(c?.getView().getMovableSelection().length>0),F=r.ReactUtils.detectIt().primaryInput==="touch",P=!F&&y,W=w.getMode()?.args?.stateAndCoords?.coords??null,pe=W!==null||q,de=r.useCallbackRef(H=>{const U=ge.CoordUtils.cellToRange(H);if(c.isClosed())return U;const he=c.getRange(U,{ignoreHidden:!0}).getMerges();return he.length===0?U:he[0]},[c]),le=r.useCallbackRef((H,U,he,ce,me,Te)=>{const ie=c.getSelectedRange().getExtended(ce,H).getCoords();switch(ce){case d.IRange.Direction.Up:return ie.rowStart;case d.IRange.Direction.Down:return ie.rowEnd;case d.IRange.Direction.Left:return ie.colStart;case d.IRange.Direction.Right:return ie.colEnd}},[c]),R=r.useCallbackRef(()=>{const H=c.getUsedRange()?.getCoords(),U=c.getRowHeaders().getUsedRange()?.getCoords(),he=c.getColumnHeaders().getUsedRange()?.getCoords();return{...H,colEnd:Math.max(H?.colEnd??0,he?.max??0),rowEnd:Math.max(H?.rowEnd??0,U?.max??0)}},[c]),te=r.useCallbackRef((H,U)=>c.getRowHeaders().hiddenHeadersAt(H,U),[c]),k=r.useCallbackRef((H,U)=>c.getColumnHeaders().hiddenHeadersAt(H,U),[c]),b=r.useCallbackRef(H=>c.getRange(H,{ignoreHidden:!0}).getMerges(),[c]),ee=r.useCallbackRef(H=>{c?.getSelection().setAdjusting(H)},[c]),ne=r.useCallbackRef(async()=>{c?.getSelection().setAdjusting(null),w.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),w.setMode(null))},[w,D,c,i]),Re=o.useMemo(()=>{const H=w.getMode();return H?.key==="cut"||H?.key==="copy"},[w]);Qe(c?.getView(),{onMovableSelectionChange:()=>{Z(c.getView().getMovableSelection().length>0)}}),Qe(c?.getSelection(),{onChange(H){const U=c.getSelection().getCoords();_(U)}}),Qe(c,{onProtectionChange:()=>{E(c.getProtection().isLocked())}});const{body:Ce={}}=M||{},ye=r.useNotifier(),Pe=n.getLayout(),ze=!(P&&D.ranges.length<=1&&W===null&&!v&&(!w.getMode()||Re)),{cursor:Ae,renderOverlay:Ie,onPointerDown:ue}=gt.useSelection({gridRef:C,commands:i,layout:Pe,getCellCoordsAsRangeCoords:de,selection:D,fillHandleBorderColor:Ce.fill,selectionBackgroundColor:y?M.selection.fill:M.selectionInactive.fill,selectionBorderColor:y?M.selection.strokeFill:M.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?M.selectionRemove.fill:M.selectionInactive.fill,selectionRemoveBorderColor:y?M.selectionRemove.strokeFill:M.selectionInactive.strokeFill,disableFillDrag:ze,disableMoveDrag:F||!(y&&D.ranges.length<=1&&W===null&&!v),disableTouchSelection:pe,onSelectionChange:$,onSelectionDragStart:ee,onSelectionDragEnd:ne,onMoveDragStart:(H,U,he)=>{w.setMode(Bo(0,he))},onMoveDragUpdate:(H,U,he)=>{w.setMode(Bo(0,he))},onMoveDragEnd:(H,U)=>{w.setMode(null)},onMoveDragDone:async(H,U,he)=>{if(ge.CoordUtils.isEqualRanges(H,U))return;const ce=c.getRange(U);if(ye?.showOptions){const g=ce.getDifferences(H);let je=!1;const Be=g.getCount();for(let Ee=0;!je&&Ee<Be;Ee++)je=g.at(Ee).isContentful();if(je&&await ye?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const me=!he.ctrlKey,Te=he.shiftKey,ie=Te?me?"Insert Moved Cells":"Insert Copied Cells":me?"Move Cells":"Copy Cells",qe=await ye?.showBusy?.(ie);try{const g=c.getRange(H);await ce.doBatch(async()=>{Te?await ce.insertFrom(H,{isCut:me,undoRange:g}):await ce.copyFrom(H,{isCut:me,undoRange:g}),g.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),ce.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ie,autoSelect:!0})}catch(g){ye?.showError?.(g)}finally{qe?.()}},contentfulCellFinder:le,hiddenRowsAt:te,hiddenColumnsAt:k,mergedRanges:b,getDataCoords:R,canSelectionSpanMergedCells:H=>{const U=c.getRange(H);return U.isEntireColumns()||U.isEntireRows()},onFill:async(H,U)=>{const he="Auto Fill",ce=await ye?.showBusy?.(he);try{await c.doBatch(()=>{c.getRange(H).autoFill(U),c.getRange(U).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:he,autoSelect:!0})}catch(me){ye?.showError?.(me)}finally{N.current=null,ce?.()}},onFillPreview:(H,U,he)=>{if(C.current&&I){w.setMode(Wl);try{N.current?.direction!==he&&(N.current=null,c.getRange(H).autoFill(U,{previewOnly:Be=>{N.current={callback:Be,direction:he}}}));const ce=N.current?.callback?.(U);if(!ce||ce.isEmpty())return;const me=ce.toText();if(!me)return;const Te=ge.CoordUtils.cellToRange(ce.getCoords()),ie=n.getRelativePointFromClient(0,0);let qe=0,g=0,je=r.ToolTipPlacement.Bottom;if(he===d.IRange.Direction.Down){qe=Pe.getColOffset(Te.colEnd+1)-ie.x;const Be=Pe.getRowOffset(Te.rowEnd),Ee=Pe.getRowOffset(Te.rowEnd+1);g=Ee-(Ee-Be)/2-ie.y,je=r.ToolTipPlacement.Right}else if(he===d.IRange.Direction.Right){g=Pe.getRowOffset(Te.rowEnd+1)-ie.y;const Be=Pe.getColOffset(Te.colEnd),Ee=Pe.getColOffset(Te.colEnd+1);qe=Ee-(Ee-Be)/2-ie.x,je=r.ToolTipPlacement.Bottom}else if(he===d.IRange.Direction.Up){qe=Pe.getColOffset(Te.colEnd+1)-ie.x;const Be=Pe.getRowOffset(Te.rowStart),Ee=Pe.getRowOffset(Te.rowStart+1);g=Ee-(Ee-Be)/2-ie.y,je=r.ToolTipPlacement.Right}else if(he===d.IRange.Direction.Left){g=Pe.getRowOffset(Te.rowEnd+1)-ie.y;const Be=Pe.getColOffset(Te.colStart),Ee=Pe.getColOffset(Te.colStart+1);qe=Ee-(Ee-Be)/2-ie.x,je=r.ToolTipPlacement.Bottom}I({anchor:{x:qe,y:g},display:me,placement:je})}catch(ce){ye?.showError?.(ce)}}},onFillDone:()=>{N.current=null,w.setMode(null),z?.()}}),O=r.useCallbackRef(H=>{ue(r.ReactUtils.createSyntheticEvent(H))},[ue,W]);o.useEffect(()=>{const H=n?.getStage();if(H)return H.addEventListener("pointerdown",O),()=>{H.removeEventListener("pointerdown",O)}},[n?.getStage()]);const xe=r.useImperativeElement(t,()=>({}),[]),Le=o.useRef(null);return s.jsx("div",{className:ct(a,"sheet-selection",Hl),style:{position:"absolute",width:T?.width,height:T?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Nt([xe,Le]),...p,children:Ie(n)})})),Sn=Object.freeze({x:0,y:0,width:0,height:0}),_l={fireOnModelChange:!1},Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:h,onShow:c,onUnFocus:C,isDragging:M,updateFrameBounds:y,dragStart:p,style:T,disabled:I,renderMovable:z,...D}=e,[_,$]=o.useState(Sn),[w,N]=o.useState(null),[v,E]=o.useState(!1),q=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const P=i.toViewBounds(F);$(P??Sn),y(P??Sn)},[i?.getBounds()]),Qe(a,{onBoundsChange:F=>{const P=F.getBounds();if(!P)return;const W=i.toViewBounds(P);$(W??Sn),y(W)},onSelectionChange:()=>{const F=ge.CommonUtils.hasFocus(q.current,!0);!v&&!F||a.isSelected()||C()}}),Qe(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(q.current,!0)},_l),o.useEffect(()=>{const F=q.current;return l(F),()=>{f(F)}},[]);const Z=o.useMemo(()=>{if(!_)return null;let{width:F,height:P}=_;return z({view:i,movable:a,disabled:I,isDragging:M,style:{position:"relative",left:0,top:0,width:F,height:P},onHide:h,onShow:c})},[i,a,_.width,_.height,I,M]);return s.jsx("div",{className:"movable",tabIndex:0,ref:Nt([q,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,...T},onMouseDown:async F=>{const P=F.shiftKey||F.ctrlKey,W=a.isSelected(),pe=F.currentTarget;P&&W?a.unselect():(W&&!P||await a.select({addToSelection:P}),p(F.nativeEvent,pe),pe.focus())},onFocus:F=>{F.relatedTarget&&!w&&N(F.relatedTarget),E(!0)},onBlur:F=>{w&&!q?.current?.contains(F.relatedTarget)&&N(null),F.relatedTarget&&E(!1)},...D,children:Z})})),Xl="_movable-area_314c6_5",xr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:h,onFocus:c,disabled:C=!1,disableDrag:M=!1,disableResize:y=!1,className:p,style:T,renderDirections:I=["nw","n","ne","w","e","sw","s","se"],onFirstRender:z,...D}=e,_=n.getBounds(),$=r.useCallbackRef(z,[z]),w=r.useCallbackRef(h,[h]),N=r.useCallbackRef(c,[c]),[v,E]=o.useState([]),[q,Z]=o.useState(!1),[F,P]=o.useState(!1),W=o.useRef(!0),pe=o.useRef(new Map),de=o.useRef(new Map),le=o.useRef(new Map),R=o.useRef(new Map),te=o.useRef(new Map),k=o.useRef({onRequestFocus:m=>(he(m),null)}),b=o.useRef(null),ee=o.useRef(null),ne=o.useRef(null),[Re,Ce]=o.useReducer(m=>m+1,0);o.useLayoutEffect(()=>{Ce()},[n,i]),Qe(i,{onCollectionChange:()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),A=te.current;A.forEach(J=>{J()}),A.clear();const G=k.current;for(let J=0;J<m.length;J++){const re=m[J];if(re.isClosed())continue;const x=re.addListeners(G);A.set(re,x)}Ce()},onInvalidated:()=>{Ce()}}),Qe(a,{onMovableSelectionChange(m){Pe(),Ce()}});const ye=o.useCallback((m,A)=>{const G=le.current.get(m);ne.current&&(ne.current.getTargets().forEach(J=>{if(J===G)return J.style.left=A.x+"px",J.style.top=A.y+"px",J.style.width=A.width+"px",void(J.style.height=A.height+"px")}),ne.current.updateRect())},[]),Pe=()=>{const m=[],A=a.getMovableSelection();A.forEach(G=>{const J=le.current.get(G);J&&A.indexOf(G)!==-1&&m.push(J)}),E(G=>ge.CommonUtils.isEqualArrays(G,m)?G:m)},ze=o.useRef(null),Ae=o.useRef(null),Ie=o.useMemo(()=>(Ae.current||(Ae.current=new Promise(m=>{ze.current=m})),Ae.current),[]),ue=o.useRef(null),O=r.useCallbackRef(async(m,A)=>{ue.current=A,await(async()=>!(!await Ie.then()||!ne.current))()&&ue.current===A&&ne.current.dragStart(m,A)},[v]),[xe,Le]=o.useState(!1),H=o.useRef(null),U=o.useRef(null),he=r.useCallbackRef(async(m=null)=>{if(m||(m=a.getMovableSelection()[0]),!m)return w?.(),!1;const A=le.current.get(m);A?(await ge.CommonUtils.whenFocus(A),A.focus(),U.current=A,H.current=null):H.current=m},[a]);o.useEffect(()=>{xe&&v.length>0&&U.current!==v[0]&&he(),W.current&&($?.(),W.current=!1)},[v]);const ce=o.useMemo(()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(m.length===0&&pe.current.size===0)return null;const A=(B,S,j,se=!0)=>{const ae=B.isSelected(),we={tabIndex:j,view:n,movable:B,onRefLoad:Y=>{H.current===B&&(Y.focus(),U.current=Y,H.current=null),le.current.set(B,Y),de.current.set(Y,B),S.rendered=!0,Pe()},onRefUnload:Y=>{le.current.delete(B),de.current.delete(Y),S.rendered=!1,Pe()},onUnFocus:w,onHide:Y=>{S.onHide=Y},onShow:Y=>{S.onShow=Y},isDragging:ae&&(F||q),disabled:C,renderMovable:l,updateFrameBounds:Y=>{ye(B,Y)},dragStart:O,onMouseUp:()=>{if(ue.current=null,ee.current){Z(!1),P(!1);let Y=!1;R.current?.forEach(fe=>{ge.CommonUtils.isEqualBounds(fe.movable.getBounds(),fe.startBounds)||(Y=!0)}),Y?Te():ie()}},style:{opacity:se?q&&ae?.7:void 0:0,zIndex:q&&ae?B.getZIndex()+m.length:void 0,pointerEvents:se?void 0:"none",cursor:F&&ae?"grabbing":C||M?"initial":"move",boxShadow:!ae||F&&!q?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(Zl,{...we},`movable-${B.getUUID()}`)},G=pe.current,J=new Map,re=[];for(let B=0;B<m.length;B++){const S=m[B];if(S.isClosed())continue;let j=G.get(S);j||(j={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(se,ae)=>{if(!ae||ae.shown===!0)return;ae.shown=!0;const we=++ae.visibilityRequestId;requestAnimationFrame(()=>{const Y=pe.current.get(se);Y&&we===ae.visibilityRequestId&&(ae.onShow?.(se),Y.shown=!0)})},doHide:async(se,ae)=>{if(!ae||ae?.shown===!1)return;ae.shown=!1;const we=++ae.visibilityRequestId,Y=await Promise.resolve(ae.onHide?.(se));we===ae.visibilityRequestId&&Y!==!1&&(ae.shown=!1,pe.current.delete(se),Ce())},visibilityRequestId:0}),j.frame=A(S,j,B,!0),re.push(j.frame),j.doShow(S,j),G.delete(S),J.set(S,j)}const x=[];return a.getMovableSelection().forEach(B=>{const S=G.get(B);S&&(S.frame=A(B,S,-1,!1),x.push(S.frame),G.delete(B),J.set(B,S))}),G.forEach((B,S)=>{B.frame=A(S,B,-1,!1),x.push(B.frame),B.doHide(S,B),G.delete(S),J.set(S,B)}),pe.current=J,Pe(),[...x,...re]},[Re,n,l,C,M,y,q,F]),me=r.useCallbackRef((m,A)=>{const G=`${A} ${v.length===1?d.TextUtils.capitalize(de.current?.get(v[0]).getContent().getType()):"Drawings"}`;ee.current&&(console.warn(`Transaction ${ee.current.getDescription()} is being replaced by ${G}`),ee.current.rollback(),ee.current=null),ee.current=f.beginCommit({description:G}),R.current.clear();for(let J=0;J<v.length;J++){const re=v[J],x=de.current?.get(re);x?R.current.set(re,{movable:x,startBounds:n.toViewBounds(x.getBounds())}):console.warn("invalid element",x)}},[f,n,v]),Te=o.useCallback(()=>{if(!ee.current)return;const m=[];R.current?.forEach(A=>{m.push(A.movable)}),ee.current.commit({viewAfter:{view:a,movableSelection:m}}),R.current.clear(),ee.current=null},[]),ie=o.useCallback(()=>{ee.current&&(ee.current.rollback(),ee.current=null)},[]),qe=o.useRef(null);o.useEffect(()=>{qe.current&&(qe.current.onscroll=m=>{m.preventDefault(),m.srcElement.scrollTop=0,m.srcElement.scrollLeft=0})},[qe.current]);const g=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:he,focus:()=>{he()}}),[a]),[je,Be]=o.useState(null),Ee=o.useRef(!1),u=o.useRef(!1),L=o.useRef(!1);o.useEffect(()=>{if(C||v.length===0||L.current||Ee.current)return;if(u.current)return void requestAnimationFrame(()=>{ne.current&&b.current&&ne.current.refTargets.length>0&&(L.current=!0,ze.current?.(!0)),E([...v])});Ee.current=!0;const m=o.lazy(async()=>{try{const A=await Promise.resolve().then(()=>require("./F8ZECny0CwW2OV5X.cjs"));return Ee.current=!1,u.current=!0,E([...v]),A}catch(A){return console.warn(A),ze.current?.(!1),null}});Be(m)},[v,C,M,y]);const K=o.useMemo(()=>!je||C?null:s.jsx(o.Suspense,{children:s.jsx(je,{className:ct({dragging:q||F,resizing:q,moving:F}),container:null,ref:ne,target:ne.current?v:[],draggable:!C&&!M,resizable:!C&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:I,onResizeStart:m=>{me(m.target,"Resize")},onResize:m=>{if(!ee.current)return m.stopDrag(),void Ce();Z(!0);const A=m.direction[0]!==0&&m.direction[1]!==0;let G=0,J=0;for(let re=0;re<v.length;re++){const x=v[re],B=R.current.get(x),S=de.current.get(x);if(!B||!S){console.warn("invalid element");continue}let j=m.dist[0],se=m.dist[1],ae=m.drag.dist[0],we=m.drag.dist[1],Y=B.startBounds.width,fe=B.startBounds.height;re===0?(G=Y,J=fe):(j*=Y/G,ae*=Y/G,se*=fe/J,we*=fe/J);const V={...B.startBounds};if(V.width=Math.max(0,Y+j),V.height=Math.max(0,fe+se),m.direction[0]===-1&&(V.width=Math.max(0,Math.min(B.startBounds.x+Y,Y-ae))),m.direction[1]===-1&&(V.height=Math.max(0,Math.min(B.startBounds.y+fe,fe-we))),A&&(S.isLockAspectRatio()||m.inputEvent?.shiftKey)){const X=Y/fe,oe=V.width/V.height;oe>X?V.height=V.width/X:oe<X&&(V.width=V.height*X)}m.direction[0]===-1&&(V.x=Math.max(0,Math.min(B.startBounds.x+Y,B.startBounds.x+Y-V.width))),m.direction[1]===-1&&(V.y=Math.min(B.startBounds.y+fe,B.startBounds.y+fe-V.height)),B.movable.setBounds(n.toAbsoluteBounds(V))}},onResizeEnd:m=>{Z(!1),Te()},onDragStart:m=>{me(m.target,"Move")},onDrag:m=>{if(!ee.current)return m.stopDrag(),void Ce();P(!0);for(let A=0;A<v.length;A++){const G=v[A],J=R.current.get(G);J?J.movable.setBounds(n.toAbsoluteBounds({...J.startBounds,x:J.startBounds.x+m.translate[0],y:J.startBounds.y+m.translate[1]})):console.warn("invalid element")}},onDragEnd:m=>{},onMouseUp:m=>{}})}),[Re,je,v,n,C,M,y,q,F]);return s.jsx("div",{className:ct(p,"movable-area",Xl),style:{width:_.width,height:_.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Nt([g,qe]),...D,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:_.width,height:_.height},...D,children:s.jsxs("div",{ref:b,style:{position:"absolute",pointerEvents:"auto"},onFocus:m=>{N?.(),Le(!0)},onBlur:m=>{Le(!1)},onKeyDownCapture:m=>{if(m.isDefaultPrevented())return;const A=m.nativeEvent.ctrlKey,G=m.nativeEvent.altKey,J=m.nativeEvent.shiftKey;if(m.which===r.KeyCodes.Escape){const j=a.getMovableSelection();let se=[...j];return v.forEach(ae=>{if(se.length===0)return;const we=de.current.get(ae);let Y=se.indexOf(we);se.splice(Y,1)}),se.length!==j.length&&a.selectMovables(se),se.length===0&&w?.(),void m.preventDefault()}const re=.1,x=j=>{i.updateSelected(se=>{se.setRotation(se.getRotation()+j)},"Rotate")},B=(j,se=!0)=>{i.updateSelected(ae=>{const we=ae.getBounds();let Y=1+j;se||(Y=1/Y);const fe=Math.sqrt(Math.pow(we.width,2)+Math.pow(we.height,2)),V=Math.atan2(we.height,we.width),X=Y*fe;if(X<10)return;const oe=X*Math.cos(V),Fe=X*Math.sin(V),Ue={x:we.x+(we.width-oe)/2,y:we.y+(we.height-Fe)/2,width:oe,height:Fe};ae.setBounds(Ue)},"Resize")},S=j=>{i.updateSelected(se=>{const ae=se.getBounds(),we={x:ae.x+(j.x??0),y:ae.y+(j.y??0),width:ae.width+(j.width??0),height:ae.height+(j.height??0)};se.setBounds(we)},"Nudge")};if(m.which===r.KeyCodes.Delete)i.updateSelected(j=>{j.delete()},"Delete"),m.preventDefault();else if(m.key==="a"&&A){const j=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(j,!0),m.preventDefault()}else m.key==="ArrowLeft"?(J?B(re,!1):G?x(-10):S({x:A?-10:-1}),m.preventDefault()):m.key==="ArrowRight"?(J?B(re,!0):G?x(10):S({x:A?10:1}),m.preventDefault()):m.key==="ArrowUp"?(J?B(re,!0):S({y:A?-10:-1}),m.preventDefault()):m.key==="ArrowDown"&&(J?B(re,!1):S({y:A?10:1}),m.preventDefault())},children:[ce,K]})})})})),Ut=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}},Oo=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,h=Number.MAX_SAFE_INTEGER,c=0;for(let y=0;y<e.length;y++){const p=e[y],T=p.getBounds();f+=T[l],h=Math.min(T[i],h),c=Math.max(T[i]+T[l],c),n.push({bounds:T,movable:p})}const C=(c-h-f)/(e.length-1);n.sort((y,p)=>{const T=y.bounds[i],I=p.bounds[i];return T!==I?T-I:y.bounds[a]-p.bounds[a]});const M=new Map;M.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const p=n[y-1].bounds,T={...n[y].bounds};T[i]=p[i]+p[l]+C,n[y].bounds=T,M.set(n[y].movable,T)}return M.set(n[n.length-1].movable,n[n.length-1].bounds),M},qr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,h=r.useNotifier(),c=r.useEditMode();o.useRef(c.getMode()).current=c.getMode();const C=r.useCallbackRef(async(w,N,v=null,E=!0)=>{const q=async()=>{const Z=await Promise.resolve(h?.showBusy?.(w.getLabel()));try{await N();const F=v??w?.getLabel?.();if(f){let P=null;w&&F!==!1&&(P=new r.SimpleCommand(w.getKey(),l,{label:F,description:F},q)),f(P)}Z?.(),E&&c.setMode(null)}catch(F){Z?.(),h?.showError?.(F)}};await q()},[f,h]),[M,y]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,N,v)=>{if(!n)return;const E=n.getMovableSelection();if(E.length===0)return;let q="Drawings";if(E.length===1){const F=E[0];q=d.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const Z=`${w.getLabel()} ${q}`;C(w,()=>{let F=null;i&&(F=i.beginCommit(Z));const P=n.getMovableSelection();if(P.length===0)return;const W=v?.(P);for(let pe=0;pe<P.length;pe++){const de=P[pe];N(de,W)}F?.commit()})},[n,i]),[T,I]=o.useState(n.getMovableSelection()[0]??null),[z,D]=o.useState(!T||T?.isProtected()),_=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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.setLockAspectRatio(!w.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(){p(this,w=>{w.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(){p(this,w=>{w.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(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){p(this,(w,N)=>{w.setBounds({x:N.x})},Ut)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){p(this,(w,N)=>{w.setBounds({x:(N.width-w.getBounds().width)/2+N.x})},Ut)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){p(this,(w,N)=>{w.setBounds({x:N.width-w.getBounds().width+N.x})},Ut)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){p(this,(w,N)=>{w.setBounds({y:N.y})},Ut)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){p(this,(w,N)=>{w.setBounds({y:(N.height-w.getBounds().height)/2+N.y})},Ut)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){p(this,(w,N)=>{w.setBounds({y:N.height-w.getBounds().height+N.y})},Ut)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w,!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,T]);o.useEffect(()=>{},[c]);const $=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(_,!0),w},[a,_]);return Qe(T,{onAnyChange:()=>{$.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===d.IAnchored.Type.TwoCell}),$.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===d.IAnchored.Type.OneCell}),$.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===d.IAnchored.Type.Absolute}),$.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===d.IAnchored.Type.Absolute}),$.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:w=>{D(w.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;I(w),D(!w||w.isProtected()),y()}}),Qe(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const w={disabled:z};$.getCommand("formatAnchorTypeTwoCell").update(w),$.getCommand("formatAnchorTypeOneCell").update(w),$.getCommand("formatAnchorTypeAbsolute").update(w),$.getCommand("toggleLockAspectRatio").update(w);const N=t.getCount(),v=n.getMovableSelection(),E=z||N<=1||v.length===0;let q={disabled:E},Z=q;if(!E&&v.length===1){const W=v[0];W.getZIndex()===0&&(q={disabled:!0}),W.getZIndex()===N-1&&(Z={disabled:!0})}$.getCommand("moveToFront").update(Z),$.getCommand("moveForward").update(Z),$.getCommand("moveToBack").update(q),$.getCommand("moveBackward").update(q);const F={disabled:z||v.length<=1};$.getCommand("formatDrawAlignLeft").update(F),$.getCommand("formatDrawAlignCenter").update(F),$.getCommand("formatDrawAlignRight").update(F),$.getCommand("formatDrawAlignTop").update(F),$.getCommand("formatDrawAlignMiddle").update(F),$.getCommand("formatDrawAlignBottom").update(F),$.getCommand("formatDrawFlipHorz").update(F),$.getCommand("formatDrawFlipVert").update(F),$.getCommand("formatDrawGroup").update(F),$.getCommand("formatDrawUngroup").update(F),$.getCommand("formatDrawSwapShapes").update(F),$.getCommand("formatDrawSwapShapesHorz").update(F),$.getCommand("formatDrawSwapShapesVert").update(F);const P={disabled:z||v.length<=2};$.getCommand("formatDrawDistributeHorz").update(P),$.getCommand("formatDrawDistributeVert").update(P)},[M,z,M]),$},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const M=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:p,width:T}]=Wt();return s.jsx("div",{...C,ref:Nt([M,y]),children:s.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:s.jsx("div",{style:{textAlign:"center"},children:a})})})})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,propsMovable:a,renderMovable:l,commands:f,target:h,onRepeatCommandChange:c}=e,C=qr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:c,commands:f,target:h});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const M=o.useMemo(()=>s.jsx(xr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{C.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,C]);return M&&n?M:null})),Ql=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:h,commands:c}=e,C=r.useEditMode(),[M,y]=o.useState(null),[p,T]=o.useState(null),[I,z]=o.useState(null),[D,_]=o.useState(null),[$,w]=o.useState(null);o.useLayoutEffect(()=>{if(I===null)return _(null),void w(null);const k=()=>{const b=i.getRange(I).getCell(),ee=b.getStyle();let ne,Re=ee.getFill()?.toCSS(a.body.darkMode);Re.background!=="none"&&Re.background!=="transparent"||(Re=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),Re.background!=="none"&&Re.background!=="transparent"||(Re={background:a.body.fill}),_({style:Re}),b&&!b.getFormula()&&(ne=b?.getRenderHorizontalAlignment()),w(ne??r.HorizontalAlignment.Left)};return k(),i.getRange(I).addListener(()=>{k()})},[i,I,a?.body]);const N=r.useCallbackRef(()=>{let k=p.editState.dirty??"";if(p.editState.dirty!==void 0){const b=d.TextUtils.clampString(k);try{const ee=p.sheet.getRange(p.coords),ne=`Typing '${b}' into ${ee.toString()}`;return ee.setValue(k,{description:ne,autoFit:!0}),z(null),T(null),C.setMode(null),h(null),!0}catch(ee){throw ge.Notifier.error(new Error(`Unable to enter '${b}'.`,{cause:ee})),ee}}},[i,p]),v=r.useCallbackRef(k=>i.getRange(k).getCell().getExtrusions()??ge.CoordUtils.cellToRange(k),[i]),E=r.useCallbackRef(k=>{let b=d.IRange.Orientation.Row,ee=!1;k!==d.IRange.Direction.Up&&k!==d.IRange.Direction.Down||(b=d.IRange.Orientation.Column),k!==d.IRange.Direction.Left&&k!==d.IRange.Direction.Up||(ee=!0),i.getSelection().traverse(b,ee)},[i]),q=o.useCallback((k,b)=>{if(l)return l(k,b);if(!i)return null;const{ref:ee,...ne}=k;return s.jsx(gr,{ref:ee,...ne,sheet:i,bodyStyle:a?.body,activeCoords:b,commands:c,onChangeEdit:Re=>{const Ce={sheet:i,coords:b,editState:Re};C.setMode(ye=>({...ye,description:Ce.editState.editMode?"Edit":"Enter",args:{...ye?.args,stateAndCoords:Ce}}))},editState:p.editState})},[i,D,l,p,I]),{renderOverlay:Z,startEdit:F,submitEdit:P,cancelEdit:W,onKeyboardEventNative:pe,onPointerEventNative:de}=gt.useKeyboardEditorOverlay({view:n,activeCoords:M,getCellEditor:q,canEdit:()=>{const k=i.getProtection();if(k.isReadOnly())return!1;const b=k.isLocked();return b&&f(),!b},onBeforeStartEdit:k=>{const b=hr(()=>i.getRange(k).getCell()),ee={sheet:i,coords:k,editState:Object.freeze(b)};C.setMode({key:"edit",args:{stateAndCoords:ee}}),T(ee)},onStartEdit:k=>{z(k),h(k)},onSubmitEdit:N,onCancelEdit:k=>{z(null),T(null),C.setMode(null),h(null)},onDoneEdit:k=>{C.setMode(null)},onNavigate:E,propsContainer:D,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:$,getRangeCoords:v});Qe(i.getSelection(),{onChange(k){y(i.getSelection().getCoords().cell)}});const le=r.useCallbackRef(k=>{de(k),I&&P()},[de,W,I]),R=o.useCallback(k=>{de(k)},[de]),te=o.useCallback(k=>{pe(k)},[pe]);return o.useEffect(()=>{const k=n?.getStage();if(k)return k.addEventListener("pointerdown",le),k.addEventListener("dblclick",R),k.addEventListener("keydown",te),()=>{k.removeEventListener("pointerdown",le),k.removeEventListener("dblclick",R),k.removeEventListener("keydown",te)}},[n?.getStage()]),o.useEffect(()=>{const k=C.getMode(),b=k?.key;b==="edit"||b==="enter"?p?k.args?.cancel?W():k.args?.submit?P():T(k.args?.stateAndCoords):F(k.args?.start):I&&W()},[C]),Z(n,t)})),Sr="white",Rr="black",ei=`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='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ti=`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='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,h]=o.useState(null),[c,C]=o.useState(null),[M,y]=o.useState(null),[p,T]=o.useState(null),I=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)}else l(!1),h(null)},[i,n]),z=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const E=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:E});q.length===1&&q[0].select()},[n,i]),D=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const E=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:E});if(q.length===1){const Z=q[0].getRange().getCoords(),F={colStart:Z.colStart,rowStart:E.rowIndex,colEnd:Z.colEnd,rowEnd:E.rowIndex};i.getRange(F).select()}},[n,i]),_=r.useCallbackRef(()=>{if(!a)return;const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)},[i,a,n]);Qe(i?.getSelection(),{onChange(v){C(i.getSelection().getCoords().cell)}}),Qe(M,{onAnyChange(v){I(),_()}}),Qe(p,{onAnyChange(v){_()}}),Qe(i,{onTablesChange(v){I(),_()},onInvalidated(v){I(),_()}});const $=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(_,300),300),[]);o.useEffect(()=>{$()},[n]),o.useEffect(()=>{let v=null;if(f)for(let E=0;E<f.length&&!v;E++){const q=f[E],Z=q.getRange().getCoords();d.CoordUtils.isCellWithinRange(c,Z)&&(v=q)}y(v)},[c,f]);const w=r.useCallbackRef(v=>{let E=null;if(f)for(let q=0;q<f.length;q++){const Z=f[q],F=Z.getRange().getCoords();let P=n.getRangeCoordsBounds(F);const W=n.getRelativePointFromClient(v.clientX,v.clientY),pe=W.x,de=W.y;if(pe>=P.x&&pe<=P.x+P.width&&de>=P.y&&de<=P.y+P.height){const le=n.getViewportSize();pe<=0||de<=0||pe>=le.width||de>=le.height||(E=Z)}}T(E)},[n,f]);if(o.useEffect(()=>{const v=n?.getStage();if(v&&f)return v.addEventListener("mousemove",w),v.addEventListener("mouseleave",w),()=>{v.removeEventListener("mousemove",w),v.removeEventListener("mouseleave",w)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const N=[];for(let v=0;v<f.length;v++){const E=f[v];if(E.isClosed())continue;const q=E===p,Z=E===M,F=E.getRange().getCoords(),P=n.getRangeCoordsBounds(F);let W;if(q||Z){const pe=E.getStyle().getProperties(),de=pe.headerRow?.fill?.background??pe.wholeTable?.border?.top?.color?.toString();if(de&&i){const le=i.getStyles().parseColor(de);le&&(W=le.toCSS())}W||(W="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}N.push(s.jsx("div",{style:{position:"absolute",left:P.x,top:P.y,width:Math.min(16,P.width),height:P.height,pointerEvents:"all",cursor:ei},onMouseDown:D},`table-select-row-${E.getName()}`)),N.push(s.jsx("div",{style:{position:"absolute",left:P.x,top:P.y,width:Math.min(16,P.width),height:Math.min(16,P.height),pointerEvents:"all",cursor:ti},onMouseDown:z},`table-select-${E.getName()}`)),N.push(s.jsx(gt.Selection,{x:P.x,y:P.y,width:P.width,height:P.height,range:F,strokeWidth:Z?.5:0,stroke:W??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:q?`${W} 0px 0px 1px 1px`:void 0}},`table-outline-${E.getName()}`))}return N})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[h,c]=o.useState(null),C=o.useRef(null),M=r.useCallbackRef(()=>{const D=i.getSelectedCell(),_=D.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(_,l)||(c(_?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(_),coords:_}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(_))},[i,n,l]);o.useEffect(()=>(C.current&&(clearTimeout(C.current),C.current=null),h&&(C.current=setTimeout(()=>{c(null),C.current=null},a)),()=>{C.current&&(clearTimeout(C.current),C.current=null)}),[h,a]);const y=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(M,80),80),[]);if(Qe(i?.getSelection(),{onChange(D){y()}}),Qe(i,{onSpillsChange(D){M()},onInvalidated(D){M()}}),!n||!l&&!h)return null;const p=i.getRange(l).getValue()instanceof d.FormulaError.Spill,T=[];let I=h?.bounds??n.getRangeCoordsBounds(l);if(h&&!ge.CommonUtils.isEqualBounds(h.bounds,n.getRangeCoordsBounds(h.coords))&&c(null),I=n.toClipBounds(I,-10),!I)return;const z="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(s.jsx(gt.Selection,{x:I.x,y:I.y,width:I.width,height:I.height,range:l,strokeWidth:1,stroke:z,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:h?.transition==="out"?0:1,transition:h?.transition?h.transition==="in"||h.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:`${z} 0px 0px 4px 0px`}},"spill-outline}")),T})),ri={position:"absolute",top:0,left:0,bottom:0,right:0},Ho=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=ge.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=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},li={fireOnModelChange:!1},Vo={},kr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Vo,headersStyle:a=Vo,onSheetContextMenu:l,showColumnHeaders:f,propsColumnHeader:h,showRowHeaders:c,propsRowHeader:C,showScrollbars:M=!0,propsScrollPane:y,onViewportChange:p,commands:T,onRepeatCommandChange:I,overlays:z,renderMovable:D,viewportComponent:_,onElementLoad:$,getCellEditor:w,onFocus:N,onBlur:v,style:E=r.ReactUtils.EmptyCssProperties,onShowTooltip:q,onShowColumnTooltip:Z,onShowRowTooltip:F,onCloseTooltip:P,propsGrid:W,propsCellRender:pe,...de}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[le,R]=o.useReducer(Q=>Q+1,0),[te,{width:k,height:b}]=Wt(),ee=r.useCallbackRef(q,[q]),ne=r.useCallbackRef(Z,[Z]),Re=r.useCallbackRef(F,[F]),Ce=r.useCallbackRef(P,[P]),ye=o.useRef(!1);o.useLayoutEffect(()=>{ye.current=!0},[n]);const Pe=n?.getStyles(),ze=o.useMemo(()=>Ho(i,Pe),[i,Pe]),Ae=o.useMemo(()=>Ho(a,Pe),[a,Pe]),{body:Ie={},buttonSurface:ue={}}=ze,{header:O={},headerSelect:xe={},headerSelectAll:Le={}}=Ae,H=o.useRef(null),[U,he]=o.useState(()=>n?.getView()),ce=(U?.getZoomScale()??100)/100,me=o.useMemo(()=>({vertical:U.isShowColumnGridlines()&&ce>=.4,horizontal:U.isShowRowGridlines()&&ce>=.4}),[U?.isShowColumnGridlines(),U?.isShowRowGridlines(),ce]),Te=o.useMemo(()=>{if(U?.getGridLineColor())return{strokeDasharray:"1,1"}},[U?.getGridLineColor(),ze]),ie=f??U?.isShowColumnHeaders(),qe=c??U?.isShowRowHeaders(),[g,je]=o.useState({width:0,height:0}),Be=o.useMemo(()=>{let Q=40,Me=20;const Ke=n?.getStyles().getNormal().getFont();if(g.width>0&&g.height>0){const Ve=Ke?.toCSS()?.fontFamily??ze.header.text.fontFamily,Ge=Ke?.getSize()??ze.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+g.height,Math.ceil(Ge*d.IFont.getDeviceScale()),Ve);Q=We.width,Me=We.lineHeight}return{width:Math.round(Q+5),height:Math.round(Me+3)}},[g,ze?.header.text,n]),Ee=qe?ce*Be.width:O.edgeStrokeWidth,u=ie?ce*Be.height:O.edgeStrokeWidth,L=Math.max(k,(n?.getColumnHeaders().getDefaultSize()??Be.width)+Ee+1),K=Math.max(b,(n?.getRowHeaders().getDefaultSize()??Be.height)+u+1),m=o.useRef(new Map),A=o.useRef(null),G=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[J,re]=o.useState(()=>G()),[x,B]=o.useState(!1),[S,j]=o.useState(null),se=!0,ae=ze.selection?.strokeFill,we=o.useCallback(()=>Mt.current,[]),[Y,fe]=o.useState(),V=r.useCallbackRef(Q=>{fe(Q);const Me=n?n.getView():null;Me&&Me.setTopLeft(Q?{left:Q.left,top:Q.top}:null),p?.(Q)},[n,p]),X=o.useRef(null);o.useEffect(()=>{if(!Y||!n)return;const Q=n.getRangeAtBounds({x:Y.left,y:Y.top,width:Y.width,height:Y.height});X.current?.(),X.current=Q.addListener(()=>{const Me=Q.getCoords();H?.current?.invalidate(Me)})},[Y,n]);const[oe,Fe]=o.useState(()=>n?.getView().getTopLeft()),Ue=r.useCallbackRef(Q=>{const Me=ge.CoordUtils.cellToRange(Q);if(n.isClosed())return Me;const Ke=n.getRange(Me,{ignoreHidden:!0}).getMerges();return Ke.length===0?Me:Ke[0]},[n]),Oe=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const Me={};return Q.coords.colIndex>0&&(Me[ge.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(Me[ge.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),Me},[Se,He]=o.useState(()=>Oe(n.getView().getFreezePanes())),ve=r.useEditMode(),De=o.useCallback(()=>H.current,[]),be=r.useCallbackRef(Q=>{ve.setMode(Me=>Me?.key==="edit"?{...Me,args:{...Me.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),ke=r.useCallbackRef(()=>Y,[Y]),Ne=wr({sheet:n,commands:T,target:De,onRepeatCommandChange:I,bodyStyle:Ie,onStartEdit:be,getViewport:ke}),[Ze,_e]=o.useState(n.getSelection().isEntire()),[Xe,at]=o.useState(U?.getMovableSelection().length>0),ot=S!==null||Xe,$e=null,[lt,it]=o.useState(!1);o.useEffect(()=>{it(!1)},[n.getProtection()]);const Je=r.useNotifier(),st=r.useCallbackRef(()=>{lt||(it(!0),Je.showMessage?.(s.jsxs("span",{children:["This sheet is protected.",s.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[Je,lt]),wt=o.useMemo(()=>{const Q=ve.getMode();return Q?.cursor?Q.cursor:null},[$e,ve]),[bt,dt]=o.useState(null),ft=o.useRef(!1),[xt,Un]=o.useState([]),Yt=o.useRef(null),[fn,Pt]=o.useState(ge.TypesUtils.EmptyTopLeft),[jt,It]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Pt({left:oe?.left,top:0})},[oe?.left]),o.useEffect(()=>{It({left:0,top:oe?.top})},[oe?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{He(Oe(n.getView().getFreezePanes()))},onTopLeftChange:()=>{Fe(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){he(n.getView()),re(G())},onLayoutChange:()=>{const Q=n.getEntireRange();je({height:Q.getRowCount(),width:Q.getColumnCount()}),re(G())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),Qe(n,{onRequestScrollIntoView:async(Q,Me)=>{if(!Me)return;const Ke={colIndex:Me?.coords?.colStart,rowIndex:Me?.coords?.rowStart};return await H.current?.scrollCellCoordsIntoView(Ke,Me?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(Mt.current)},li);const pt=o.useRef(!1),pn=o.useMemo(()=>{const Q=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&ne?.(Ve)})},32),Me=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:g.height,colStart:Ve,colEnd:Ve})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getColOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.x+tt.width,rt.getColOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===ge.AnchorLocation.Left||Tt===ge.AnchorLocation.Center||Tt===ge.AnchorLocation.Right)){const to=ge.CommonUtils.roundAccurately(Ge*ge.CommonUtils.getDPI(),0),bn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ge/ce),2).toFixed(2),no="Width: "+(Ge?bn+" ("+to+" pixels)":"Hidden"),tn=Gn.current.getGridElement().getRelativePointFromClient(0,0),Vt=0-tn.y,xn=0-tn.y+u,oo=tn.x-tt.x;Q({anchor:{x:nt-oo,y:Vt,width:yt-nt,height:xn-Vt},display:no})}const zt=[0,0,0,tt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},Jn={x:nt-1,y:0,width:1,height:tt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},eo={x:yt-1,y:0,width:1,height:tt.height};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Me(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Me(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Me(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},...h}},[n,h,u,bt]),Bt=o.useMemo(()=>{const Q=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&Re?.(Ve)})},32),Me=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:g.width})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getRowOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.y+tt.height,rt.getRowOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===ge.AnchorLocation.Top||Tt===ge.AnchorLocation.Center||Tt===ge.AnchorLocation.Bottom)){const to=Math.floor(10*ge.CommonUtils.getDPI())/10,bn=ge.CommonUtils.roundAccurately(Ge*to,0),no=ge.CommonUtils.roundAccurately(bn/ce/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),tn="Height: "+(Ge?no+" ("+bn+" pixels)":"Hidden"),Vt=Ht.current.getGridElement().getRelativePointFromClient(0,0),xn=0-Vt.x,oo=0-Vt.x+Ee,gl=Vt.y-tt.y;Q({anchor:{x:xn,y:nt-gl,width:oo-xn,height:yt-nt},display:tn})}const zt=[0,0,tt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},Jn={x:0,y:nt-1,width:tt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},eo={x:0,y:yt-1,width:tt.width,height:1};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Me(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Me(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Me(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},...C}},[n,C,Ee]),Mt=r.useImperativeElement(t,()=>{const Q=Ke=>{n?.getView()&&n.getView().selectMovables([]),A.current=null,H?.current?.focus(Ke)},Me=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ge=H.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ge)return!1;const We=Ge.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let rt=m.current?.get(We);return rt?.current?(await rt.current.focusMovable(Ke),!0):(A.current={movable:Ke,anchor:We},!0)};return{getGridElement:()=>H.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Gn.current,rowHeaderHeight:()=>u,colHeaderWidth:()=>Ee,startEdit:be,submitEdit:()=>{ve.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{ve.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:S!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&Me()||Q(Ke)},focusSheet:Q,focusMovable:Me,contains:Ke=>H?.current?.contains?.(Ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{ye.current||(H?.current?.invalidate(Q),R?.())},[]);o.useEffect(()=>{At()},[ze]);const Jt=Ze?Le.edgeStrokeFill:O.fill,Kn=Ze?xe.fill:typeof ze.headerHover=="function"?ze.headerHover(O)?.fill:O.fill,et=o.useMemo(()=>_?s.jsx("div",{className:ct("sheetxl-viewport-overlay",Sl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:_}):s.jsx(s.Fragment,{}),[_]);let Qt=null;ie&&qe&&(Qt=s.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${u}px`,width:`${Ee}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let Me=!Q.ctrlKey;Ne?.getCommand("selectAll")?.execute(!Me||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):H.current?.focus()},children:[s.jsx("div",{style:{height:u-5+"px",width:u-5+"px",clipPath:`path('M${u-5} 0 L0 ${u-5} L${u-5} ${u-5} L${u-5} 0 Z')`,borderRight:`2px solid ${Jt}`,borderBottom:`2px solid ${Jt}`,background:`${Kn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),s.jsx("div",{style:{position:"absolute",height:`${u}px`,width:`${Ee}px`,boxSizing:"border-box",borderRight:`solid 1px ${O.strokeFill}`,borderBottom:`solid 1px ${O.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Ot=r.useCallbackRef(({_left:Q,_top:Me})=>{},[]),vn=r.useCallbackRef(Q=>{if(!l)return;const Me=H.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);Me&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:Me.rowIndex,colIndex:Me.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),ut=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:Me}=Q;return Me>0?Ne.getCommand("sheetZoomOut")?.execute():Me<0&&Ne.getCommand("sheetZoomIn")?.execute(),Me===0},[Ne]);o.useEffect(()=>{Un(null),Yt.current=null,ft.current=!1,dt(null);const Q=n?.getView().getTopLeft();Ot(Q),H.current?.scrollTo(Q),Fe(Q),he(n.getView()),He(Oe(n.getView().getFreezePanes())),re(G()),R()},[n?.getView()]);const vt=o.useCallback((Q,Me)=>n.getRowHeaders().hiddenHeadersAt(Q,Me),[n]),Cn=o.useCallback((Q,Me)=>n.getColumnHeaders().hiddenHeadersAt(Q,Me),[n]),en=r.useCallbackRef(Q=>{const Me=Q.getVisibleRangeCoords();if(!Me)return null;const Ke=[];return n.getRange(Me).forEach((Ve,Ge)=>{const We=Ge.getCoords(),rt=Ge.getCell();(nt=>{if(nt.isEmpty())return!1;const tt=nt.getSpans();if(tt.width>1||tt.height>1||nt.getStyle().hasVisibleStyling()||U.isShowFormulas()&&nt.getFormula()!==null)return!0;const yt=nt.getValue();return yt!==null&&!(!U.isShowZeros()&&yt===0&&nt.getType()===d.ScalarType.Number)})(rt)&&Ke.push({coords:We,value:rt,range:U.isShowFormulas()?null:rt.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,U.isShowZeros(),U.isShowFormulas(),S]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),bt&&Q.push(...bt),ge.CommonUtils.isEqualArrays(Q,Yt.current)||(Yt.current=Q,Un(Q))},[z,bt,ze]);const Dt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:i?.body?.text?.fill??"black"}}),[ze?.header?.edgeStrokeFill]),$n=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(A.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const Q=ve.getMode();return Q?.key==="cut"||Q?.key==="copy"},[ve]),yn=r.useCallbackRef(async Q=>{const Me=ve.getMode();return Q.keyCode===r.KeyCodes.Escape&&Me?(Q.preventDefault(),void ve.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Wn?(Q.preventDefault(),await Ne?.getCommand("paste")?.execute(),void ve.setMode(null)):void Ne?.dispatchToFocusedCommand(Q)},[Ne,ve]),Ht=o.useRef(null),wn=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Ee+O.edgeStrokeWidth}px`,minWidth:`${Ee+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2"},children:s.jsx(jo,{ref:Ht,sheetElement:Mt.current,gridRef:H,freezeStart:Se?.[ge.AnchorLocation.Top],oppositeSize:Ee,containerWidth:Ee,containerHeight:K,sheetHeader:n.getRowHeaders(),gridStyle:Ae,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:jt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Ee+O.edgeStrokeWidth}px`,minWidth:`${Ee+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2",...Bt?.style},...Bt})}),[Ee,u,K,n,jt,Se?.[ge.AnchorLocation.Top],ze,se,l,O.fill,C]),Gn=o.useRef(null),ll=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:s.jsx(jo,{ref:Gn,sheetElement:Mt.current,gridRef:H,freezeStart:Se?.[ge.AnchorLocation.Left],oppositeSize:u,containerWidth:L,containerHeight:u,sheetHeader:n.getColumnHeaders(),gridStyle:Ae,scrollPoint:fn,onSheetContextMenu:l,...pn,style:{...pn?.style,position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[u,L,n,fn,Se?.[ge.AnchorLocation.Left],ze,O.fill,se,l,h]),il=r.useCallbackRef(Q=>{const{value:Me,key:Ke,...Ve}=Q;let Ge=Me,We=S;if(!We||We.colIndex===Q.coords.colIndex&&We.rowIndex===Q.coords.rowIndex||(We=null),!Ge){const tt=Q.range;if(Ge=n.getRange({rowIndex:tt.rowStart,colIndex:tt.colStart}).getCell(),Ge.isEmpty())return null}let rt=null;Ge.getHyperlink()&&(rt=async tt=>{if(pe?.onLinkMouseDown?.(tt),tt.button===0&&!tt.isDefaultPrevented()){tt.stopPropagation(),tt.preventDefault();try{await Ge.getHyperlink()?.open()}catch(yt){Je.showError?.(yt)}}}),We&&We.colIndex===Q.range.colStart&&We.rowIndex===Q.range.rowStart&&(Ge=Ge.createTemporaryCell({value:null}));const nt=n.getStyles();return o.createElement(ur,{...Ve,key:Ke,bodyStyle:Ie,docTheme:nt.getTheme(),normalStyle:nt.getNormal(),showFormulas:U.isShowFormulas(),showZeros:U.isShowZeros(),onLinkMouseDown:rt,...pe,value:Ge})},[n,J,Ie,S,U?.isShowFormulas(),U.isShowZeros()]),al=o.useCallback(Q=>{const{key:Me,ref:Ke,...Ve}=Q;return[s.jsx(Al,{ref:Ke,getVisibleCells:en,sheet:n,gridStyle:ze,...Ve},`border-${Me}`),s.jsx(ni,{ref:Ke,sheet:n,commands:Ne,...Ve},`table-${Me}`),s.jsx(oi,{ref:Ke,sheet:n,...Ve},`spill-${Me}`),s.jsx(Gl,{ref:Ke,sheet:n,commands:Ne,onShowTooltip:ee,onCloseTooltip:Ce,gridStyle:ze,gridRef:H,isActive:se,...Ve},`selection-${Me}`),s.jsx(Ol,{ref:Ke,sheet:n,commands:Ne,gridStyle:ze,element:we,...Ve},`copy-paste-${Me}`),s.jsx(Jl,{ref:Ke,sheet:n,commands:Ne,target:De,renderMovable:D,propsMovable:{onUnFocus:()=>{Mt.current.focus()}},...Ve},`movable-${Me}`),s.jsx(Ql,{ref:Ke,sheet:n,commands:Ne,gridStyle:ze,getCellEditor:w,showProtectedError:st,setEditingCoords:j,...Ve},`editor-${Me}`)]},[n,H.current,ze,w,Ne,Je]),[Io,sl]=o.useState(!1),cl=o.useMemo(()=>{if(L===0||K===0)return null;const Q=n.getStyles().getNormal(),Me=Q.getFont(),Ke=Q.getFill(),Ve=Q.getBorder(),Ge=Q.getFill().getType()===d.IFill.Type.None;let We=Te,rt=Te;const nt=(yt,Tt,zt)=>zt?{stroke:Ve.getBottom().isNone()?"none":yt.getColor().toRGBA(Ie.darkMode).toString(),...Tt}:Tt;rt=nt(Ve.getBottom(),rt,!Ve.getBottom().isNone()),rt=nt(Ve.getTop(),rt,!Ve.getTop().isNone()),We=nt(Ve.getRight(),We,!Ve.getRight().isNone()),We=nt(Ve.getLeft(),We,!Ve.getLeft().isNone());let tt=U?.getGridLineColor()?.toRGBA(Ie.darkMode).toString()??Ie.strokeFill;return Ge||(rt=nt(Ve.getBottom(),rt,!0),rt=nt(Ve.getTop(),rt,!0),We=nt(Ve.getRight(),We,!0),We=nt(Ve.getLeft(),We,!0)),s.jsx(gt.Grid,{className:"sheetxl-sheet-primary",style:{...ri,...Ke.toCSS(Ie.darkMode),...Me.toCSS(Ie.darkMode,ce),"--sxl-app-color-background":Ie.fill,"--sxl-app-color-shadow":ze.colorShadow,"--sxl-app-color-grey":ze.colorGrey,"--sxl-app-color-button-fill":ue.fill,"--sxl-app-color-button-text":ue.text?.fill,"--sxl-app-color-button-border":ue.edgeStrokeFill,"--sxl-app-color-primary-dark":ze.selection.strokeFill},ref:H,zoom:ce,...W,onFirstRender:yt=>{sl(!0),W?.onFirstRender?.(yt),Ne?.activate()},showGridLines:me,gridLineColor:tt,propsGridLineColumns:We,propsGridLineRows:rt,freezeLeft:Se?.[ge.AnchorLocation.Left],propsFreezeLeft:Dt,freezeTop:Se?.[ge.AnchorLocation.Top],propsFreezeTop:Dt,width:L,height:K,columnCount:g.width,rowCount:g.height,cursor:wt??$e??"cell",clipCells:!0,layout:J,renderCell:il,renderOverlay:al,getCellCoordsAsRangeCoords:Ue,hiddenRowsAt:vt,hiddenColumnsAt:Cn,getVisibleCells:en,onWheelScroll:ut,onPointerDown:$n,onKeyDown:yn,onViewportChange:V,onImmediateScroll:Ot,scrollPoint:oe,propsStage:{onFocus:()=>{Ne?.activate()}},renderOverlays:xt})},[le]);o.useEffect(()=>{ye.current||R()},[J,Se,ce,Ne,oe?.left,oe?.top,Ie,W,L,K,wt,xt,se,$e]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};M||(_n={..._n,...E});const dl=o.useMemo(()=>{const Q=n.getStyles().getTheme(),Me=Q.getColorScheme(),Ke=Q.getFontScheme();return{"--sxl-doc-color-dk1":Me.getDk1().toCSS(Ie.darkMode),"--sxl-doc-color-dk2":Me.getDk2().toCSS(Ie.darkMode),"--sxl-doc-color-lt1":Me.getLt1().toCSS(Ie.darkMode),"--sxl-doc-color-lt2":Me.getLt2().toCSS(Ie.darkMode),"--sxl-doc-color-accent1":Me.getAccent1().toCSS(Ie.darkMode),"--sxl-doc-color-accent2":Me.getAccent2().toCSS(Ie.darkMode),"--sxl-doc-color-accent3":Me.getAccent3().toCSS(Ie.darkMode),"--sxl-doc-color-accent4":Me.getAccent4().toCSS(Ie.darkMode),"--sxl-doc-color-accent5":Me.getAccent5().toCSS(Ie.darkMode),"--sxl-doc-color-accent6":Me.getAccent6().toCSS(Ie.darkMode),"--sxl-doc-color-hlink":Me.getHlink().toCSS(Ie.darkMode),"--sxl-doc-color-fol-hlink":Me.getFolHlink().toCSS(Ie.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),Eo=r.useCallbackRef(Q=>{const{style:Me,...Ke}=Q;return s.jsx(bo,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...Me},sheet:n})},[n]);let Zn=s.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:Q=>{B(!0),N?.(Q)},onBlur:Q=>{B(!1),v?.(Q)},ref:Mt,...de,children:s.jsx("div",{className:ct("sheetxl-sheet",ql),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...dl},children:s.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[ll,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,backgroundColor:Ie.fill},ref:te,onContextMenu:vn,children:[cl,et,s.jsx(Rl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ze?.selection?.strokeFill,colorCredits:ze?.body?.text?.fill})]})]})]})})});M&&(Zn=s.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${O.fill}`,minHeight:2*Be.height,minWidth:2*Be.width,...E},viewport:Y,touchElement:H.current?.stage,disableTouch:ot,onScrollViewport:Q=>{H.current?.scrollTo(Q)},renderScrollbarHorizontal:Eo,renderScrollbarVertical:Eo,...y,children:Zn})),o.useEffect(()=>{ye.current=!1,R?.(),x&&Mt.current?.focus()},[n]);const[Xn,ul]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||ul(!0)},[Xn]);return o.useEffect(()=>{if(Io)return typeof $=="function"&&$(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[$,Io,Xn]),Zn}));kr.displayName="SheetElement";const Uo="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=",Mr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:h,view:c,onHide:C,onShow:M,onKeyDownCapture:y,onFocus:p,onBlur:T,loadingPanel:I,...z}=e,[D,_]=o.useState(!1),[$,w]=o.useState(null),[N,v]=o.useState(null),[E,q]=o.useState(null);o.useEffect(()=>{v(null),l.getDetails().then(P=>{_(!1),v(P.asUrl()),P.asSVGText?.()&&q(P.asSVGText())}).catch(P=>{console.warn(P),_(!0),v(Uo),q(null)})},[l]);const Z=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(N||E)return s.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:$?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:N,onLoad:()=>{w(!0)},onError:({currentTarget:P})=>{console.log("error"),P.onerror=null,v(Uo),_(!0)},alt:f??`${l.getType()}`})},[$,l,N,E,h]);if(!l.isClosed())return s.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:h?"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,...z,onKeyDownCapture:P=>{y?.(P)},ref:Z,children:[$||D?void 0:I,F]})}));Mr.displayName="PictureEditor";const ii=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const M=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:p,width:T}]=Wt();if(!a.isClosed())return s.jsx("div",{...C,ref:Nt([M,y]),children:s.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:s.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ai="_editable-input_1bqx6_6",si=e=>s.jsx("input",{...e}),Tr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:h,renderInput:c=si,styleHover:C={},dragging:M,maxLength:y,disabled:p=!1,readOnly:T=!1,...I}=e,[z,D]=o.useState(!1),[_,$]=o.useState(!1),[w,N]=o.useState(a);o.useEffect(()=>{N(a)},[a]);const v=o.useRef(null),[E,q]=o.useState(null),Z=r.useNotifier(),F=o.useCallback(function(te){const k=te.message;E!==k&&(Z?.showMessage?.(k,{type:r.NotifierType.Error}),q(k))},[Z,E]),P=o.useCallback(te=>{let k=!1;try{k=l?.(te)??!0}catch(b){F(b)}return k?(v.current=null,$(!1),N(te),k):(setTimeout(()=>{v.current?.focus()},0),k)},[l]),W=r.useCallbackRef(()=>{N(a),v.current=null,$(!1),h?.()},[h,a]),pe=o.useMemo(()=>{if(!_)return null;const te={className:ct(ai),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:w,onFocus:k=>{v.current||(v.current=k.target,setTimeout(()=>{k.target?.select()},0))},onBlur:k=>{v.current&&P(w)},onChange:k=>{_&&N(k.target.value)},onMouseDown:k=>k.stopPropagation(),onKeyDown:k=>k.code==="Escape"?(k.preventDefault(),void W()):k.code==="Enter"?(k.preventDefault(),void P(k.target.value)):void(k.code!=="Tab"?k.stopPropagation():P(k.target.value))};return s.jsx(s.Fragment,{children:c(te)})},[_,w,P,W,c,p]),[de,le]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(M||z)&&(te=Object.assign(te,C)),le(te)},[M,z,C,n]),o.useEffect(()=>{pe&&f?.(w)},[pe,f,w]);const R=r.useImperativeElement(t,()=>({startEdit(){p||T||$(!0)},cancel(){W()}}),[]);return s.jsxs("div",{...I,ref:R,style:{flexDirection:"column",display:"flex",...de},className:ct(i),children:[s.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||T||$(!0)},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[s.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",opacity:_?0:1},children:w}),pe]}),s.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...C},children:w})]})})),jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Zt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function Ct(e){var t,n;return e?Zt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=Ct(e);return e instanceof t}function gn(e){return!Zt(e)&&e instanceof Ct(e).HTMLElement}function Ir(e){return e instanceof Ct(e).SVGElement}function _t(e){return e?Zt(e)?e.document:xo(e)?qo(e)?e:gn(e)||Ir(e)?e.ownerDocument:document:document:document}const Rt=jn?o.useLayoutEffect:o.useEffect;function Bn(e){const t=o.useRef(e);return Rt(()=>{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 cn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function rn(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Fn(e){const t=Bn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function An(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function hn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Er(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 h=Object.entries(f);for(const[c,C]of h){const M=l[c];M!=null&&(l[c]=M+e*C)}return l},{...t})}}const $t=Er(1),dn=Er(-1);function On(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Dn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=Ct(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 Lt=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[Lt.Translate.toString(e),Lt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Ko="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ci(e){return e.matches(Ko)?e:e.querySelector(Ko)}const di={display:"none"};function ui(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function gi(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 Fr=o.createContext(null),hi={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
|
-
`},mi={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 fi(e){let{announcements:t=mi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=hi}=e;const{announce:l,announcement:f}=(function(){const[y,p]=o.useState("");return{announce:o.useCallback(M=>{M!=null&&p(M)},[]),announcement:y}})(),h=hn("DndLiveRegion"),[c,C]=o.useState(!1);if(o.useEffect(()=>{C(!0)},[]),(function(y){const p=o.useContext(Fr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(y)},[y,p])})(o.useMemo(()=>({onDragStart(y){let{active:p}=y;l(t.onDragStart({active:p}))},onDragMove(y){let{active:p,over:M}=y;t.onDragMove&&l(t.onDragMove({active:p,over:M}))},onDragOver(y){let{active:p,over:M}=y;l(t.onDragOver({active:p,over:M}))},onDragEnd(y){let{active:p,over:M}=y;l(t.onDragEnd({active:p,over:M}))},onDragCancel(y){let{active:p,over:M}=y;l(t.onDragCancel({active:p,over:M}))}}),[l,t])),!c)return null;const k=o.createElement(o.Fragment,null,o.createElement(ui,{id:i,value:a.draggable}),o.createElement(gi,{id:h,announcement:f}));return n?Kt.createPortal(k,n):k}var ht;function zn(){}function io(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"})(ht||(ht={}));const kt=Object.freeze({x:0,y:0});function Ar(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pi(e,t){const n=Dn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Dr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function vi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function $o(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 zr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wo(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 Ci=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Wo(t,t.left,t.top),l=[];for(const f of i){const{id:h}=f,c=n.get(h);if(c){const C=Ar(Wo(c),a);l.push({id:h,data:{droppableContainer:f,value:C}})}}return l.sort(Dr)};function yi(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,h=l-n;if(i<a&&n<l){const c=t.width*t.height,C=e.width*e.height,k=f*h;return Number((k/(c+C-k)).toFixed(4))}return 0}const wi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,h=n.get(f);if(h){const c=yi(h,t);c>0&&a.push({id:f,data:{droppableContainer:l,value:c}})}}return a.sort(vi)};function Go(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function bi(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 xi=bi(1);function Lr(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 qi={ignoreTransform:!1};function Xt(e,t){t===void 0&&(t=qi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:C,transformOrigin:k}=Ct(e).getComputedStyle(e);C&&(n=(function(y,p,M){const T=Lr(p);if(!T)return y;const{scaleX:z,scaleY:D,x:Z,y:K}=T,w=y.left-Z-(1-z)*parseFloat(M),N=y.top-K-(1-D)*parseFloat(M.slice(M.indexOf(" ")+1)),v=z?y.width/z:y.width,I=D?y.height/D:y.height;return{width:v,height:I,top:N,right:w+v,bottom:N+I,left:w}})(n,C,k))}const{top:i,left:a,width:l,height:f,bottom:h,right:c}=n;return{top:i,left:a,width:l,height:f,bottom:h,right:c}}function _o(e){return Xt(e,{ignoreTransform:!0})}function Hn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!gn(a)||Ir(a)||n.includes(a))return n;const l=Ct(e).getComputedStyle(a);return a!==e&&(function(f,h){h===void 0&&(h=Ct(f).getComputedStyle(f));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(C=>{const k=h[C];return typeof k=="string"&&c.test(k)})})(a,l)&&n.push(a),(function(f,h){return h===void 0&&(h=Ct(f).getComputedStyle(f)),h.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Nr(e){const[t]=Hn(e,1);return t??null}function ao(e){return jn&&e?Zt(e)?e:xo(e)?qo(e)||e===_t(e).scrollingElement?window:gn(e)?e:null:null:null}function Pr(e){return Zt(e)?e.scrollX:e.scrollLeft}function jr(e){return Zt(e)?e.scrollY:e.scrollTop}function go(e){return{x:Pr(e),y:jr(e)}}var mt;function Br(e){return!(!jn||!e)&&e===document.scrollingElement}function Or(e){const t={x:0,y:0},n=Br(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"})(mt||(mt={}));const Si={x:.2,y:.2};function Ri(e,t,n,i,a){let{top:l,left:f,right:h,bottom:c}=n;i===void 0&&(i=10),a===void 0&&(a=Si);const{isTop:C,isBottom:k,isLeft:y,isRight:p}=Or(e),M={x:0,y:0},T={x:0,y:0},z=t.height*a.y,D=t.width*a.x;return!C&&l<=t.top+z?(M.y=mt.Backward,T.y=i*Math.abs((t.top+z-l)/z)):!k&&c>=t.bottom-z&&(M.y=mt.Forward,T.y=i*Math.abs((t.bottom-z-c)/z)),!p&&h>=t.right-D?(M.x=mt.Forward,T.x=i*Math.abs((t.right-D-h)/D)):!y&&f<=t.left+D&&(M.x=mt.Backward,T.x=i*Math.abs((t.left+D-f)/D)),{direction:M,speed:T}}function ki(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 Hr(e){return e.reduce((t,n)=>$t(t,go(n)),kt)}function Vr(e,t){if(t===void 0&&(t=Xt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Nr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Pr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+jr(n),0)}]];class ho{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=Hn(n),a=Hr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,h]of Mi)for(const c of f)Object.defineProperty(this,c,{get:()=>{const C=h(i),k=a[l]-C;return this.rect[c]+k},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ln{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 so(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 qt,Ye;function Zo(e){e.preventDefault()}function Ti(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"})(qt||(qt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const Ur={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ii=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class So{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 ln(_t(n)),this.windowListeners=new ln(Ct(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Vr(i),n(kt)}handleKeyDown(t){if(On(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Ur,coordinateGetter:f=Ii,scrollBehavior:h="smooth"}=a,{code:c}=t;if(l.end.includes(c))return void this.handleEnd(t);if(l.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:C}=i.current,k=C?{x:C.left,y:C.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=k);const y=f(t,{active:n,context:i.current,currentCoordinates:k});if(y){const p=dn(y,k),M={x:0,y:0},{scrollableAncestors:T}=i.current;for(const z of T){const D=t.code,{isTop:Z,isRight:K,isLeft:w,isBottom:N,maxScroll:v,minScroll:I}=Or(z),q=ki(z),X={x:Math.min(D===Ye.Right?q.right-q.width/2:q.right,Math.max(D===Ye.Right?q.left:q.left+q.width/2,y.x)),y:Math.min(D===Ye.Down?q.bottom-q.height/2:q.bottom,Math.max(D===Ye.Down?q.top:q.top+q.height/2,y.y))},E=D===Ye.Right&&!K||D===Ye.Left&&!w,j=D===Ye.Down&&!N||D===Ye.Up&&!Z;if(E&&X.x!==y.x){const $=z.scrollLeft+p.x,ve=D===Ye.Right&&$<=v.x||D===Ye.Left&&$>=I.x;if(ve&&!p.y)return void z.scrollTo({left:$,behavior:h});M.x=ve?z.scrollLeft-$:D===Ye.Right?z.scrollLeft-v.x:z.scrollLeft-I.x,M.x&&z.scrollBy({left:-M.x,behavior:h});break}if(j&&X.y!==y.y){const $=z.scrollTop+p.y,ve=D===Ye.Down&&$<=v.y||D===Ye.Up&&$>=I.y;if(ve&&!p.x)return void z.scrollTo({top:$,behavior:h});M.y=ve?z.scrollTop-$:D===Ye.Down?z.scrollTop-v.y:z.scrollTop-I.y,M.y&&z.scrollBy({top:-M.y,behavior:h});break}}this.handleMove(t,$t(dn(y,this.referenceCoordinates),M))}}}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 Xo(e){return!!(e&&"distance"in e)}function Yo(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Ur,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const h=l.activatorNode.current;return(!h||e.target===h)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(h){const{EventTarget:c}=Ct(h);return h instanceof c?h:_t(h)})(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=_t(f),this.documentListeners=new ln(this.document),this.listeners=new ln(i),this.windowListeners=new ln(Ct(f)),this.initialCoordinates=(a=Dn(l))!=null?a:kt,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(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,Zo),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,Zo),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yo(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Xo(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(qt.Click,Ti,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:h}}=l;if(!a)return;const c=(n=Dn(t))!=null?n:kt,C=dn(a,c);if(!i&&h){if(Xo(h)){if(h.tolerance!=null&&so(C,h.tolerance))return this.handleCancel();if(so(C,h.distance))return this.handleStart()}return Yo(h)&&so(C,h.tolerance)?this.handleCancel():void this.handlePending(h,C)}t.cancelable&&t.preventDefault(),f(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ei={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Kr extends Ro{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Ei,i)}}Kr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Fi={move:{name:"mousemove"},end:{name:"mouseup"}};var mo;(function(e){e[e.RightClick=2]="RightClick"})(mo||(mo={}));class $r extends Ro{constructor(t){super(t,Fi,_t(t.event.target))}}$r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==mo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Wr extends Ro{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var an,Ln;function Ai(e){let{acceleration:t,activator:n=an.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:h=Ln.TreeOrder,pointerCoordinates:c,scrollableAncestors:C,scrollableAncestorRects:k,delta:y,threshold:p}=e;const M=(function(I){let{delta:q,disabled:X}=I;const E=An(q);return rn(j=>{if(X||!E||!j)return Di;const $={x:Math.sign(q.x-E.x),y:Math.sign(q.y-E.y)};return{x:{[mt.Backward]:j.x[mt.Backward]||$.x===-1,[mt.Forward]:j.x[mt.Forward]||$.x===1},y:{[mt.Backward]:j.y[mt.Backward]||$.y===-1,[mt.Forward]:j.y[mt.Forward]||$.y===1}}},[X,q,E])})({delta:y,disabled:!l}),[T,z]=(function(){const I=o.useRef(null);return[o.useCallback((q,X)=>{I.current=setInterval(q,X)},[]),o.useCallback(()=>{I.current!==null&&(clearInterval(I.current),I.current=null)},[])]})(),D=o.useRef({x:0,y:0}),Z=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case an.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case an.DraggableRect:return a}},[n,a,c]),w=o.useRef(null),N=o.useCallback(()=>{const I=w.current;if(!I)return;const q=D.current.x*Z.current.x,X=D.current.y*Z.current.y;I.scrollBy(q,X)},[]),v=o.useMemo(()=>h===Ln.TreeOrder?[...C].reverse():C,[h,C]);o.useEffect(()=>{if(l&&C.length&&K){for(const I of v){if(i?.(I)===!1)continue;const q=C.indexOf(I),X=k[q];if(!X)continue;const{direction:E,speed:j}=Ri(I,X,K,t,p);for(const $ of["x","y"])M[$][E[$]]||(j[$]=0,E[$]=0);if(j.x>0||j.y>0)return z(),w.current=I,T(N,f),D.current=j,void(Z.current=E)}D.current={x:0,y:0},Z.current={x:0,y:0},z()}else z()},[t,N,i,z,l,f,JSON.stringify(K),JSON.stringify(M),T,C,v,k,JSON.stringify(p)])}Wr.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"})(an||(an={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ln||(Ln={}));const Di={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var un,fo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(un||(un={})),(function(e){e.Optimized="optimized"})(fo||(fo={}));const Jo=new Map;function po(e,t){return rn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=Bn(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 ho(Xt(e),e)}function Qo(e,t,n){t===void 0&&(t=zi);const[i,a]=o.useState(null);function l(){a(c=>{if(!e)return null;var C;if(e.isConnected===!1)return(C=c??n)!=null?C:null;const k=t(e);return JSON.stringify(c)===JSON.stringify(k)?c:k})}const f=(function(c){let{callback:C,disabled:k}=c;const y=Bn(C),p=o.useMemo(()=>{if(k||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:M}=window;return new M(y)},[y,k]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p})({callback(c){if(e)for(const C of c){const{type:k,target:y}=C;if(k==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),h=Nn({callback:l});return Rt(()=>{l(),e?(h?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),f?.disconnect())},[e]),i}const er=[];function tr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?dn(e,n.current):kt}function nr(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 or=[];function Gr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gn(t)?t:e}const Li=[{sensor:Kr,options:{}},{sensor:So,options:{}}],Ni={current:{}},Mn={draggable:{measure:_o},droppable:{measure:_o,strategy:un.WhileDragging,frequency:fo.Optimized},dragOverlay:{measure:Xt}};class sn 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 Pi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mn,measureDroppableContainers:zn,windowRect:null,measuringScheduled:!1},_r={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zn,draggableNodes:new Map,over:null,measureDroppableContainers:zn},mn=o.createContext(_r),Zr=o.createContext(Pi);function ji(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function Bi(e,t){switch(t.type){case ht.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ht.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 ht.DragEnd:case ht.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new sn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ht.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 sn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case ht.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new sn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Oi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(mn),l=An(i),f=An(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!On(l)||document.activeElement===l.target)return;const h=a.get(f);if(!h)return;const{activatorNode:c,node:C}=h;if(!c.current&&!C.current)return;requestAnimationFrame(()=>{for(const k of[c.current,C.current]){if(!k)continue;const y=ci(k);if(y){y.focus();break}}})}},[i,t,a,f,l]),null}function Xr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Vn=o.createContext({...kt,scaleX:1,scaleY:1});var Ft;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ft||(Ft={}));const Hi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:h=!0,children:c,sensors:C=Li,collisionDetection:k=wi,measuring:y,modifiers:p,...M}=e;const T=o.useReducer(Bi,void 0,ji),[z,D]=T,[Z,K]=(function(){const[V]=o.useState(()=>new Set),Q=o.useCallback(re=>(V.add(re),()=>V.delete(re)),[V]);return[o.useCallback(re=>{let{type:Ee,event:Ue}=re;V.forEach(Oe=>{var xe;return(xe=Oe[Ee])==null?void 0:xe.call(Oe,Ue)})},[V]),Q]})(),[w,N]=o.useState(Ft.Uninitialized),v=w===Ft.Initialized,{draggable:{active:I,nodes:q,translate:X},droppable:{containers:E}}=z,j=I!=null?q.get(I):null,$=o.useRef({initial:null,translated:null}),ve=o.useMemo(()=>{var V;return I!=null?{id:I,data:(V=j?.data)!=null?V:Ni,rect:$}:null},[I,j]),Y=o.useRef(null),[_,A]=o.useState(null),[J,x]=o.useState(null),S=cn(M,Object.values(M)),oe=hn("DndDescribedBy",l),ie=o.useMemo(()=>E.getEnabled(),[E]),qe=(de=y,o.useMemo(()=>({draggable:{...Mn.draggable,...de?.draggable},droppable:{...Mn.droppable,...de?.droppable},dragOverlay:{...Mn.dragOverlay,...de?.dragOverlay}}),[de?.draggable,de?.droppable,de?.dragOverlay]));var de;const{droppableRects:Pe,measureDroppableContainers:je,measuringScheduled:De}=(function(V,Q){let{dragging:re,dependencies:Ee,config:Ue}=Q;const[Oe,xe]=o.useState(null),{frequency:He,measure:Ce,strategy:Ae}=Ue,we=o.useRef(V),Se=(function(){switch(Ae){case un.Always:return!1;case un.BeforeDragging:return re;default:return!re}})(),Le=cn(Se),Ze=o.useCallback(function(at){at===void 0&&(at=[]),Le.current||xe(ot=>ot===null?at:ot.concat(at.filter($e=>!ot.includes($e))))},[Le]),_e=o.useRef(null),Xe=rn(at=>{if(Se&&!re)return Jo;if(!at||at===Jo||we.current!==V||Oe!=null){const ot=new Map;for(let $e of V){if(!$e)continue;if(Oe&&Oe.length>0&&!Oe.includes($e.id)&&$e.rect.current){ot.set($e.id,$e.rect.current);continue}const lt=$e.node.current,it=lt?new ho(Ce(lt),lt):null;$e.rect.current=it,it&&ot.set($e.id,it)}return ot}return at},[V,Oe,re,Se,Ce]);return o.useEffect(()=>{we.current=V},[V]),o.useEffect(()=>{Se||Ze()},[re,Se]),o.useEffect(()=>{Oe&&Oe.length>0&&xe(null)},[JSON.stringify(Oe)]),o.useEffect(()=>{Se||typeof He!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ze(),_e.current=null},He))},[He,Se,Ze,...Ee]),{droppableRects:Xe,measureDroppableContainers:Ze,measuringScheduled:Oe!=null}})(ie,{dragging:v,dependencies:[X.x,X.y],config:qe.droppable}),Ie=(function(V,Q){const re=Q!=null?V.get(Q):void 0,Ee=re?re.node.current:null;return rn(Ue=>{var Oe;return Q==null?null:(Oe=Ee??Ue)!=null?Oe:null},[Ee,Q])})(q,I),ke=o.useMemo(()=>J?Dn(J):null,[J]),ge=(function(){const V=_?.autoScrollEnabled===!1,Q=typeof h=="object"?h.enabled===!1:h===!1,re=v&&!V&&!Q;return typeof h=="object"?{...h,enabled:re}:{enabled:re}})(),O=(function(V,Q){return po(V,Q)})(Ie,qe.draggable.measure);(function(V){let{activeNode:Q,measure:re,initialRect:Ee,config:Ue=!0}=V;const Oe=o.useRef(!1),{x:xe,y:He}=typeof Ue=="boolean"?{x:Ue,y:Ue}:Ue;Rt(()=>{if(!xe&&!He||!Q)return void(Oe.current=!1);if(Oe.current||!Ee)return;const Ce=Q?.node.current;if(!Ce||Ce.isConnected===!1)return;const Ae=Go(re(Ce),Ee);if(xe||(Ae.x=0),He||(Ae.y=0),Oe.current=!0,Math.abs(Ae.x)>0||Math.abs(Ae.y)>0){const we=Nr(Ce);we&&we.scrollBy({top:Ae.y,left:Ae.x})}},[Q,xe,He,Ee,re])})({activeNode:I!=null?q.get(I):null,config:ge.layoutShiftCompensation,initialRect:O,measure:qe.draggable.measure});const Fe=Qo(Ie,qe.draggable.measure,O),ze=Qo(Ie?Ie.parentElement:null),H=o.useRef({activatorEvent:null,active:null,activeNode:Ie,collisionRect:null,collisions:null,droppableRects:Pe,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),W=E.getNodeFor((t=H.current.over)==null?void 0:t.id),me=(function(V){let{measure:Q}=V;const[re,Ee]=o.useState(null),Ue=Nn({callback:o.useCallback(Ce=>{for(const{target:Ae}of Ce)if(gn(Ae)){Ee(we=>{const Se=Q(Ae);return we?{...we,width:Se.width,height:Se.height}:Se});break}},[Q])}),Oe=o.useCallback(Ce=>{const Ae=Gr(Ce);Ue?.disconnect(),Ae&&Ue?.observe(Ae),Ee(Ae?Q(Ae):null)},[Q,Ue]),[xe,He]=Fn(Oe);return o.useMemo(()=>({nodeRef:xe,rect:re,setRef:He}),[re,xe,He])})({measure:qe.dragOverlay.measure}),ue=(n=me.nodeRef.current)!=null?n:Ie,fe=v?(i=me.rect)!=null?i:Fe:null,Me=!!(me.nodeRef.current&&me.rect),ae=Go(be=Me?null:Fe,po(be));var be;const g=nr(ue?Ct(ue):null),Ne=(function(V){const Q=o.useRef(V),re=rn(Ee=>V?Ee&&Ee!==er&&V&&Q.current&&V.parentNode===Q.current.parentNode?Ee:Hn(V):er,[V]);return o.useEffect(()=>{Q.current=V},[V]),re})(v?W??Ie:null),Be=(function(V,Q){Q===void 0&&(Q=Xt);const[re]=V,Ee=nr(re?Ct(re):null),[Ue,Oe]=o.useState(or);function xe(){Oe(()=>V.length?V.map(Ce=>Br(Ce)?Ee:new ho(Q(Ce),Ce)):or)}const He=Nn({callback:xe});return Rt(()=>{He?.disconnect(),xe(),V.forEach(Ce=>He?.observe(Ce))},[V]),Ue})(Ne),Te=Xr(p,{transform:{x:X.x-ae.x,y:X.y-ae.y,scaleX:1,scaleY:1},activatorEvent:J,active:ve,activeNodeRect:Fe,containerNodeRect:ze,draggingNodeRect:fe,over:H.current.over,overlayNodeRect:me.rect,scrollableAncestors:Ne,scrollableAncestorRects:Be,windowRect:g}),u=ke?$t(ke,X):null,L=(function(V){const[Q,re]=o.useState(null),Ee=o.useRef(V),Ue=o.useCallback(Oe=>{const xe=ao(Oe.target);xe&&re(He=>He?(He.set(xe,go(xe)),new Map(He)):null)},[]);return o.useEffect(()=>{const Oe=Ee.current;if(V!==Oe){xe(Oe);const He=V.map(Ce=>{const Ae=ao(Ce);return Ae?(Ae.addEventListener("scroll",Ue,{passive:!0}),[Ae,go(Ae)]):null}).filter(Ce=>Ce!=null);re(He.length?new Map(He):null),Ee.current=V}return()=>{xe(V),xe(Oe)};function xe(He){He.forEach(Ce=>{const Ae=ao(Ce);Ae?.removeEventListener("scroll",Ue)})}},[Ue,V]),o.useMemo(()=>V.length?Q?Array.from(Q.values()).reduce((Oe,xe)=>$t(Oe,xe),kt):Hr(V):kt,[V,Q])})(Ne),U=tr(L),m=tr(L,[Fe]),F=$t(Te,U),G=fe?xi(fe,Te):null,te=ve&&G?k({active:ve,collisionRect:G,droppableRects:Pe,droppableContainers:ie,pointerCoordinates:u}):null,le=zr(te,"id"),[b,B]=o.useState(null),R=(function(V,Q,re){return{...V,scaleX:Q&&re?Q.width/re.width:1,scaleY:Q&&re?Q.height/re.height:1}})(Me?Te:$t(Te,m),(a=b?.rect)!=null?a:null,Fe),P=o.useRef(null),ce=o.useCallback((V,Q)=>{let{sensor:re,options:Ee}=Q;if(Y.current==null)return;const Ue=q.get(Y.current);if(!Ue)return;const Oe=V.nativeEvent,xe=new re({active:Y.current,activeNode:Ue,event:Oe,options:Ee,context:H,onAbort(Ce){if(!q.get(Ce))return;const{onDragAbort:Ae}=S.current,we={id:Ce};Ae?.(we),Z({type:"onDragAbort",event:we})},onPending(Ce,Ae,we,Se){if(!q.get(Ce))return;const{onDragPending:Le}=S.current,Ze={id:Ce,constraint:Ae,initialCoordinates:we,offset:Se};Le?.(Ze),Z({type:"onDragPending",event:Ze})},onStart(Ce){const Ae=Y.current;if(Ae==null)return;const we=q.get(Ae);if(!we)return;const{onDragStart:Se}=S.current,Le={activatorEvent:Oe,active:{id:Ae,data:we.data,rect:$}};Kt.unstable_batchedUpdates(()=>{Se?.(Le),N(Ft.Initializing),D({type:ht.DragStart,initialCoordinates:Ce,active:Ae}),Z({type:"onDragStart",event:Le}),A(P.current),x(Oe)})},onMove(Ce){D({type:ht.DragMove,coordinates:Ce})},onEnd:He(ht.DragEnd),onCancel:He(ht.DragCancel)});function He(Ce){return async function(){const{active:Ae,collisions:we,over:Se,scrollAdjustedTranslate:Le}=H.current;let Ze=null;if(Ae&&Le){const{cancelDrop:_e}=S.current;Ze={activatorEvent:Oe,active:Ae,collisions:we,delta:Le,over:Se},Ce===ht.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ze))&&(Ce=ht.DragCancel)}Y.current=null,Kt.unstable_batchedUpdates(()=>{D({type:Ce}),N(Ft.Uninitialized),B(null),A(null),x(null),P.current=null;const _e=Ce===ht.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const Xe=S.current[_e];Xe?.(Ze),Z({type:_e,event:Ze})}})}}P.current=xe},[q]),se=o.useCallback((V,Q)=>(re,Ee)=>{const Ue=re.nativeEvent,Oe=q.get(Ee);if(Y.current!==null||!Oe||Ue.dndKit||Ue.defaultPrevented)return;const xe={active:Oe};V(re,Q.options,xe)===!0&&(Ue.dndKit={capturedBy:Q.sensor},Y.current=Ee,ce(re,Q))},[q,ce]),ye=(function(V,Q){return o.useMemo(()=>V.reduce((re,Ee)=>{const{sensor:Ue}=Ee;return[...re,...Ue.activators.map(Oe=>({eventName:Oe.eventName,handler:Q(Oe.handler,Ee)}))]},[]),[V,Q])})(C,se);(function(V){o.useEffect(()=>{if(!jn)return;const Q=V.map(re=>{let{sensor:Ee}=re;return Ee.setup==null?void 0:Ee.setup()});return()=>{for(const re of Q)re?.()}},V.map(Q=>{let{sensor:re}=Q;return re}))})(C),Rt(()=>{Fe&&w===Ft.Initializing&&N(Ft.Initialized)},[Fe,w]),o.useEffect(()=>{const{onDragMove:V}=S.current,{active:Q,activatorEvent:re,collisions:Ee,over:Ue}=H.current;if(!Q||!re)return;const Oe={active:Q,activatorEvent:re,collisions:Ee,delta:{x:F.x,y:F.y},over:Ue};Kt.unstable_batchedUpdates(()=>{V?.(Oe),Z({type:"onDragMove",event:Oe})})},[F.x,F.y]),o.useEffect(()=>{const{active:V,activatorEvent:Q,collisions:re,droppableContainers:Ee,scrollAdjustedTranslate:Ue}=H.current;if(!V||Y.current==null||!Q||!Ue)return;const{onDragOver:Oe}=S.current,xe=Ee.get(le),He=xe&&xe.rect.current?{id:xe.id,rect:xe.rect.current,data:xe.data,disabled:xe.disabled}:null,Ce={active:V,activatorEvent:Q,collisions:re,delta:{x:Ue.x,y:Ue.y},over:He};Kt.unstable_batchedUpdates(()=>{B(He),Oe?.(Ce),Z({type:"onDragOver",event:Ce})})},[le]),Rt(()=>{H.current={activatorEvent:J,active:ve,activeNode:Ie,collisionRect:G,collisions:te,droppableRects:Pe,draggableNodes:q,draggingNode:ue,draggingNodeRect:fe,droppableContainers:E,over:b,scrollableAncestors:Ne,scrollAdjustedTranslate:F},$.current={initial:fe,translated:G}},[ve,Ie,te,G,q,ue,fe,Pe,E,b,Ne,F]),Ai({...ge,delta:X,draggingRect:G,pointerCoordinates:u,scrollableAncestors:Ne,scrollableAncestorRects:Be});const ee=o.useMemo(()=>({active:ve,activeNode:Ie,activeNodeRect:Fe,activatorEvent:J,collisions:te,containerNodeRect:ze,dragOverlay:me,draggableNodes:q,droppableContainers:E,droppableRects:Pe,over:b,measureDroppableContainers:je,scrollableAncestors:Ne,scrollableAncestorRects:Be,measuringConfiguration:qe,measuringScheduled:De,windowRect:g}),[ve,Ie,Fe,J,te,ze,me,q,E,Pe,b,je,Ne,Be,qe,De,g]),pe=o.useMemo(()=>({activatorEvent:J,activators:ye,active:ve,activeNodeRect:Fe,ariaDescribedById:{draggable:oe},dispatch:D,draggableNodes:q,over:b,measureDroppableContainers:je}),[J,ye,ve,Fe,D,oe,q,b,je]);return o.createElement(Fr.Provider,{value:K},o.createElement(mn.Provider,{value:pe},o.createElement(Zr.Provider,{value:ee},o.createElement(Vn.Provider,{value:R},c)),o.createElement(Oi,{disabled:f?.restoreFocus===!1})),o.createElement(fi,{...f,hiddenTextDescribedById:oe}))}),Vi=o.createContext(null),rr="button";function Ui(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=hn("Draggable"),{activators:f,activatorEvent:h,active:c,activeNodeRect:C,ariaDescribedById:k,draggableNodes:y,over:p}=o.useContext(mn),{role:M=rr,roleDescription:T="draggable",tabIndex:z=0}=a??{},D=c?.id===t,Z=o.useContext(D?Vn:Vi),[K,w]=Fn(),[N,v]=Fn(),I=(function(X,E){return o.useMemo(()=>X.reduce((j,$)=>{let{eventName:ve,handler:Y}=$;return j[ve]=_=>{Y(_,E)},j},{}),[X,E])})(f,t),q=cn(n);return Rt(()=>(y.set(t,{id:t,key:l,node:K,activatorNode:N,data:q}),()=>{const X=y.get(t);X&&X.key===l&&y.delete(t)}),[y,t]),{active:c,activatorEvent:h,activeNodeRect:C,attributes:o.useMemo(()=>({role:M,tabIndex:z,"aria-disabled":i,"aria-pressed":!(!D||M!==rr)||void 0,"aria-roledescription":T,"aria-describedby":k.draggable}),[i,M,z,D,T,k.draggable]),isDragging:D,listeners:i?void 0:I,node:K,over:p,setNodeRef:w,setActivatorNodeRef:v,transform:Z}}function Yr(){return o.useContext(Zr)}const Ki={timeout:25};function $i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),h=An(n);return n||i||!h||a(h),Rt(()=>{if(!l)return;const c=i?.key,C=i?.props.id;c!=null&&C!=null?Promise.resolve(t(C,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const Wi={x:0,y:0,scaleX:1,scaleY:1};function Gi(e){let{children:t}=e;return o.createElement(mn.Provider,{value:_r},o.createElement(Vn.Provider,{value:Wi},t))}const _i={position:"fixed",touchAction:"none"},Zi=e=>On(e)?"transform 250ms ease":void 0,Xi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:h,style:c,transform:C,transition:k=Zi}=e;if(!h)return null;const y=a?C:{...C,scaleX:1,scaleY:1},p={..._i,width:h.width,height:h.height,top:h.top,left:h.left,transform:Lt.Transform.toString(y),transformOrigin:a&&i?pi(i,h):void 0,transition:typeof k=="function"?k(i):k,...c};return o.createElement(n,{className:f,style:p,ref:t},l)}),Yi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[h,c]of Object.entries(l.active))c!==void 0&&(a[h]=n.node.style.getPropertyValue(h),n.node.style.setProperty(h,c));if(l!=null&&l.dragOverlay)for(const[h,c]of Object.entries(l.dragOverlay))c!==void 0&&i.node.style.setProperty(h,c);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[h,c]of Object.entries(a))n.node.style.setProperty(h,c);f!=null&&f.active&&n.node.classList.remove(f.active)}},Jr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Lt.Transform.toString(t)},{transform:Lt.Transform.toString(n)}]},sideEffects:Yi({styles:{active:{opacity:"0"}}})};function Ji(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Bn((l,f)=>{if(t===null)return;const h=n.get(l);if(!h)return;const c=h.node.current;if(!c)return;const C=Gr(f);if(!C)return;const{transform:k}=Ct(f).getComputedStyle(f),y=Lr(k);if(!y)return;const p=typeof t=="function"?t:(function(M){const{duration:T,easing:z,sideEffects:D,keyframes:Z}={...Jr,...M};return K=>{let{active:w,dragOverlay:N,transform:v,...I}=K;if(!T)return;const q={x:N.rect.left-w.rect.left,y:N.rect.top-w.rect.top},X={scaleX:v.scaleX!==1?w.rect.width*v.scaleX/N.rect.width:1,scaleY:v.scaleY!==1?w.rect.height*v.scaleY/N.rect.height:1},E={x:v.x-q.x,y:v.y-q.y,...X},j=Z({...I,active:w,dragOverlay:N,transform:{initial:v,final:E}}),[$]=j,ve=j[j.length-1];if(JSON.stringify($)===JSON.stringify(ve))return;const Y=D?.({active:w,dragOverlay:N,...I}),_=N.node.animate(j,{duration:T,easing:z,fill:"forwards"});return new Promise(A=>{_.onfinish=()=>{Y?.(),A()}})}})(t);return Vr(c,a.draggable.measure),p({active:{id:l,data:h.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(C)},droppableContainers:i,measuringConfiguration:a,transform:y})})}let lr=0;function Qi(e){return o.useMemo(()=>{if(e!=null)return lr++,lr},[e])}const ea=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:h="div",className:c,zIndex:C=999}=e;const{activatorEvent:k,active:y,activeNodeRect:p,containerNodeRect:M,draggableNodes:T,droppableContainers:z,dragOverlay:D,over:Z,measuringConfiguration:K,scrollableAncestors:w,scrollableAncestorRects:N,windowRect:v}=Yr(),I=o.useContext(Vn),q=Qi(y?.id),X=Xr(f,{activatorEvent:k,active:y,activeNodeRect:p,containerNodeRect:M,draggingNodeRect:D.rect,over:Z,overlayNodeRect:D.rect,scrollableAncestors:w,scrollableAncestorRects:N,transform:I,windowRect:v}),E=po(p),j=Ji({config:i,draggableNodes:T,droppableContainers:z,measuringConfiguration:K}),$=E?D.setRef:void 0;return o.createElement(Gi,null,o.createElement($i,{animation:j},y&&q?o.createElement(Xi,{key:q,id:y.id,ref:$,as:h,activatorEvent:k,adjustScale:t,className:c,transition:l,rect:E,style:{zIndex:C,...a},transform:X},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ta(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Rn(e){return e!==null&&e>=0}const kn={scaleX:1,scaleY:1},na=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const h=(t=n[a])!=null?t:i;if(!h)return null;const c=(function(C,k,y){const p=C[k],M=C[k-1],T=C[k+1];return!p||!M&&!T?0:y<k?M?p.left-(M.left+M.width):T.left-(p.left+p.width):T?T.left-(p.left+p.width):p.left-(M.left+M.width)})(n,f,a);if(f===a){const C=n[l];return C?{x:a<l?C.left+C.width-(h.left+h.width):C.left-h.left,y:0,...kn}:null}return f>a&&f<=l?{x:-h.width-c,y:0,...kn}:f<a&&f>=l?{x:h.width+c,y:0,...kn}:{x:0,y:0,...kn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),f=t[a],h=l[a];return h&&f?{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}:null},Qr="Sortable",el=o.createContext({activeIndex:-1,containerId:Qr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function oa(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:f,dragOverlay:h,droppableRects:c,over:C,measureDroppableContainers:k}=Yr(),y=hn(Qr,n),p=h.rect!==null,M=o.useMemo(()=>i.map(I=>typeof I=="object"&&"id"in I?I.id:I),[i]),T=f!=null,z=f?M.indexOf(f.id):-1,D=C?M.indexOf(C.id):-1,Z=o.useRef(M),K=!(function(I,q){if(I===q)return!0;if(I.length!==q.length)return!1;for(let X=0;X<I.length;X++)if(I[X]!==q[X])return!1;return!0})(M,Z.current),w=D!==-1&&z===-1||K,N=(function(I){return typeof I=="boolean"?{draggable:I,droppable:I}:I})(l);Rt(()=>{K&&T&&k(M)},[K,M,T,k]),o.useEffect(()=>{Z.current=M},[M]);const v=o.useMemo(()=>({activeIndex:z,containerId:y,disabled:N,disableTransforms:w,items:M,overIndex:D,useDragOverlay:p,sortedRects:ta(M,c),strategy:a}),[z,y,N.draggable,N.droppable,w,M,D,c,p,a]);return o.createElement(el.Provider,{value:v},t)}const ra=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:h,previousContainerId:c,transition:C}=e;return!(!C||!i)&&(h===l||a!==f)&&(!!n||f!==a&&t===c)},ia={duration:200,easing:"ease"},tl="transform",aa=Lt.Transition.toString({property:tl,duration:0,easing:"linear"}),sa={roleDescription:"sortable"};function ca(e){let{animateLayoutChanges:t=la,attributes:n,disabled:i,data:a,getNewIndex:l=ra,id:f,strategy:h,resizeObserverConfig:c,transition:C=ia}=e;const{items:k,containerId:y,activeIndex:p,disabled:M,disableTransforms:T,sortedRects:z,overIndex:D,useDragOverlay:Z,strategy:K}=o.useContext(el),w=(function(W,me){var ue,fe;return typeof W=="boolean"?{draggable:W,droppable:!1}:{draggable:(ue=W?.draggable)!=null?ue:me.draggable,droppable:(fe=W?.droppable)!=null?fe:me.droppable}})(i,M),N=k.indexOf(f),v=o.useMemo(()=>({sortable:{containerId:y,index:N,items:k},...a}),[y,a,N,k]),I=o.useMemo(()=>k.slice(k.indexOf(f)),[k,f]),{rect:q,node:X,isOver:E,setNodeRef:j}=(function(W){let{data:me,disabled:ue=!1,id:fe,resizeObserverConfig:Me}=W;const ae=hn("Droppable"),{active:be,dispatch:g,over:Ne,measureDroppableContainers:Be}=o.useContext(mn),Te=o.useRef({disabled:ue}),u=o.useRef(!1),L=o.useRef(null),U=o.useRef(null),{disabled:m,updateMeasurementsFor:F,timeout:G}={...Ki,...Me},te=cn(F??fe),le=Nn({callback:o.useCallback(()=>{u.current?(U.current!=null&&clearTimeout(U.current),U.current=setTimeout(()=>{Be(Array.isArray(te.current)?te.current:[te.current]),U.current=null},G)):u.current=!0},[G]),disabled:m||!be}),b=o.useCallback((ce,se)=>{le&&(se&&(le.unobserve(se),u.current=!1),ce&&le.observe(ce))},[le]),[B,R]=Fn(b),P=cn(me);return o.useEffect(()=>{le&&B.current&&(le.disconnect(),u.current=!1,le.observe(B.current))},[B,le]),o.useEffect(()=>(g({type:ht.RegisterDroppable,element:{id:fe,key:ae,disabled:ue,node:B,rect:L,data:P}}),()=>g({type:ht.UnregisterDroppable,key:ae,id:fe})),[fe]),o.useEffect(()=>{ue!==Te.current.disabled&&(g({type:ht.SetDroppableDisabled,id:fe,key:ae,disabled:ue}),Te.current.disabled=ue)},[fe,ae,ue,g]),{active:be,rect:L,isOver:Ne?.id===fe,node:B,over:Ne,setNodeRef:R}})({id:f,data:v,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...c}}),{active:$,activatorEvent:ve,activeNodeRect:Y,attributes:_,setNodeRef:A,listeners:J,isDragging:x,over:S,setActivatorNodeRef:oe,transform:ie}=Ui({id:f,data:v,attributes:{...sa,...n},disabled:w.draggable}),qe=(function(){for(var W=arguments.length,me=new Array(W),ue=0;ue<W;ue++)me[ue]=arguments[ue];return o.useMemo(()=>fe=>{me.forEach(Me=>Me(fe))},me)})(j,A),de=!!$,Pe=de&&!T&&Rn(p)&&Rn(D),je=!Z&&x,De=je&&Pe?ie:null,Ie=Pe?De??(h??K)({rects:z,activeNodeRect:Y,activeIndex:p,overIndex:D,index:N}):null,ke=Rn(p)&&Rn(D)?l({id:f,items:k,activeIndex:p,overIndex:D}):N,ge=$?.id,O=o.useRef({activeId:ge,items:k,newIndex:ke,containerId:y}),Fe=k!==O.current.items,ze=t({active:$,containerId:y,isDragging:x,isSorting:de,id:f,index:N,items:k,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:C,wasDragging:O.current.activeId!=null}),H=(function(W){let{disabled:me,index:ue,node:fe,rect:Me}=W;const[ae,be]=o.useState(null),g=o.useRef(ue);return Rt(()=>{if(!me&&ue!==g.current&&fe.current){const Ne=Me.current;if(Ne){const Be=Xt(fe.current,{ignoreTransform:!0}),Te={x:Ne.left-Be.left,y:Ne.top-Be.top,scaleX:Ne.width/Be.width,scaleY:Ne.height/Be.height};(Te.x||Te.y)&&be(Te)}}ue!==g.current&&(g.current=ue)},[me,ue,fe,Me]),o.useEffect(()=>{ae&&be(null)},[ae]),ae})({disabled:!ze,index:N,node:X,rect:q});return o.useEffect(()=>{de&&O.current.newIndex!==ke&&(O.current.newIndex=ke),y!==O.current.containerId&&(O.current.containerId=y),k!==O.current.items&&(O.current.items=k)},[de,ke,y,k]),o.useEffect(()=>{if(ge===O.current.activeId)return;if(ge!=null&&O.current.activeId==null)return void(O.current.activeId=ge);const W=setTimeout(()=>{O.current.activeId=ge},50);return()=>clearTimeout(W)},[ge]),{active:$,activeIndex:p,attributes:_,data:v,rect:q,index:N,newIndex:ke,items:k,isOver:E,isSorting:de,isDragging:x,listeners:J,node:X,overIndex:D,over:S,setNodeRef:qe,setActivatorNodeRef:oe,setDroppableNodeRef:j,setDraggableNodeRef:A,transform:H??Ie,transition:(function(){if(H||Fe&&O.current.newIndex===N)return aa;if(!(je&&!On(ve)||!C)&&(de||ze))return Lt.Transition.toString({...C,property:tl})})()}}function Pn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ua=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:h}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const c=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const p=a.get(y.id);if(p)switch(e.code){case Ye.Down:i.top<p.top&&c.push(y);break;case Ye.Up:i.top>p.top&&c.push(y);break;case Ye.Left:i.left>p.left&&c.push(y);break;case Ye.Right:i.left<p.left&&c.push(y)}});const C=(y=>{let{collisionRect:p,droppableRects:M,droppableContainers:T}=y;const z=$o(p),D=[];for(const Z of T){const{id:K}=Z,w=M.get(K);if(w){const N=$o(w),v=z.reduce((q,X,E)=>q+Ar(N[E],X),0),I=Number((v/4).toFixed(4));D.push({id:K,data:{droppableContainer:Z,value:I}})}}return D.sort(Dr)})({collisionRect:i,droppableRects:a,droppableContainers:c});let k=zr(C,"id");if(k===f?.id&&C.length>1&&(k=C[1].id),k!=null){const y=l.get(n.id),p=l.get(k),M=p?a.get(p.id):null,T=p?.node.current;if(T&&M&&y&&p){const z=Hn(T).some((N,v)=>h[v]!==N),D=ir(y,p),Z=(function(N,v){return!Pn(N)||!Pn(v)||!ir(N,v)?!1:N.data.current.sortable.index<v.data.current.sortable.index})(y,p),K=z||!D?{x:0,y:0}:{x:Z?i.width-M.width:0,y:Z?i.height-M.height:0},w={x:M.left,y:M.top};return K.x&&K.y?w:dn(w,K)}}}};function ir(e,t){return!(!Pn(e)||!Pn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ga=e=>{let{transform:t}=e;return{...t,y:0}},nl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:h,selectedIndex:c,background:C,activeColor:k,borderColor:y,borderWidth:p,dragging:M,...T}=e;return s.jsxs("div",{ref:t,className:ct(a),style:{...i,display:"flex",flexDirection:"column",background:c===l?"white":C,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...T,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===l?"0px":"-1px",marginTop:c===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===l?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===l&&k?k?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},ol=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:h,listeners:c,onRemove:C,renderItem:k,sorting:y,style:p,transition:M,transform:T,value:z,wrapperStyle:D,...Z},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=k?k({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:h,fadeIn:!!a,listeners:c,ref:K,style:p,transform:T,transition:M,value:z}):s.jsx(s.Fragment,{children:z});return s.jsx("div",{className:ct("tab-item",St.Wrapper,a&&St.fadeIn,y&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[M,D?.transition].filter(Boolean).join(", "),"--translate-x":T?`${Math.round(T.x)}px`:void 0,"--translate-y":T?`${Math.round(T.y)}px`:void 0,"--scale-x":T?.scaleX?`${T.scaleX}`:void 0,"--scale-y":T?.scaleY?`${T.scaleY}`:void 0,"--index":h},ref:K,children:s.jsx("div",{className:ct(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:c,...Z,tabIndex:l?void 0:-1,children:w})})})),ar={Row:"_Row_1kr10_1"},ha=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>s.jsx("div",{ref:i,style:{...n},className:ct(ar.Row,t&&ar.horizontal),children:e}))),ma={...Jr},fa=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=Ci,coordinateGetter:h=ua,dropAnimation:c=ma,getItemStyles:C=()=>({}),getNewIndex:k,handle:y=!1,items:p,onMove:M,isDisabled:T=()=>!1,measuring:z,modifiers:D,renderItem:Z,renderDivider:K,reorderItems:w=ko,strategy:N=Mo,style:v,useDragOverlay:I=!0,onDragStart:q,wrapperStyle:X=()=>({})}=e,[E,j]=o.useState(()=>p);o.useEffect(()=>{j(p)},[p]);const[$,ve]=o.useState(null),Y=(function(){for(var S=arguments.length,oe=new Array(S),ie=0;ie<S;ie++)oe[ie]=arguments[ie];return o.useMemo(()=>[...oe].filter(qe=>qe!=null),[...oe])})(io($r,{activationConstraint:i}),io(Wr,{activationConstraint:i}),io(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:h})),_=E.indexOf.bind(E),A=$?_($):-1,J=[];E.map((S,oe)=>{J.push(s.jsx(pa,{id:S,handle:y,index:oe,style:C,wrapperStyle:X,disabled:T(S),renderItem:Z,animateLayoutChanges:a,useDragOverlay:I,getNewIndex:k},S+"-"+oe));const ie=K?.({key:"divider-"+oe});ie&&J.push(ie)});const{getPortalContainer:x}=r.useFullscreenPortal();return s.jsxs(Hi,{sensors:Y,collisionDetection:f,onDragStart:S=>{const{active:oe}=S;oe&&(q?.(S),ve(oe.id))},autoScroll:{canScroll:S=>!0},onDragEnd:S=>{if(ve(null),S.over){const oe=_(S.over.id);A!==oe&&(j(ie=>w(ie,A,oe)),M?.(A,oe))}},onDragCancel:()=>{ve(null)},measuring:z,modifiers:D,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...v},className:ct(n,St.Wrapper),children:s.jsx(oa,{items:E,strategy:N,children:s.jsx(ha,{ref:t,children:J})})}),I?Kt.createPortal(s.jsx(ea,{adjustScale:l,dropAnimation:c,children:$?s.jsx(ol,{value:E[A],handle:y,renderItem:Z,wrapperStyle:X({index:A,isDragging:!0,id:E[A]}),index:A,dragging:!0,style:C({id:E[A],index:A,isSorting:$!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),x()):null]})}));function pa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:h,renderItem:c,useDragOverlay:C,wrapperStyle:k}){const{attributes:y,isDragging:p,isSorting:M,listeners:T,overIndex:z,setNodeRef:D,transform:Z,transition:K}=ca({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(ol,{ref:D,value:a,disabled:e,dragging:p,sorting:M,handle:i,renderItem:c,index:l,style:h({index:l,id:a,isDragging:p,isSorting:M,overIndex:z}),onRemove:f?()=>f(a):void 0,transform:Z,transition:K,wrapperStyle:k({index:l,isDragging:p,id:a}),listeners:T,"data-index":l,"data-id":a,dragOverlay:!C&&p,...y})}const va="_TabStrip_3x0dp_1",Ca=new d.Color("rgb(33, 115, 70)"),ya="#eee",wa=e=>s.jsx(nl,{...e}),rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:h,onTabNameChange:c,onTabMove:C,renderScrollButtonStart:k=r.defaultCreateScrollStartButton,renderScrollButtonEnd:y=r.defaultCreateScrollEndButton,renderScrollButtonEdge:p=r.defaultCreateScrollEdgeButton,renderTabButton:M=wa,renderTabDivider:T,propsEditLabel:z,disabled:D=!1,disableDrag:Z=!1,background:K="white",activeColor:w=Ca,borderColor:N=ya,borderWidth:v=1}=e,[I,q]=o.useState(l),[X,E]=o.useState(f),j=o.useCallback(ae=>{const be=x.current?.[ae]?.closest(".tab-item")??x.current?.[ae];be&&je.current?.scrollTo({top:be.offsetTop,left:be.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{j(l)},[l]);const $=o.useCallback((ae,be)=>{be!==I&&(q(be),h?.(be)),j(be)},[h,I]),ve=o.useCallback((ae,be)=>{C?.(ae,be)},[C]),Y=o.useRef(null),[_,A]=o.useState(-1),J=o.useCallback((ae,be)=>{c?.(ae,be)},[c]);o.useLayoutEffect(()=>{q(l)},[l]),o.useLayoutEffect(()=>{E(f)},[f]);const x=o.useRef([]),S=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ae){x.current?.[ae]?.startEdit()},cancel(ae){x.current?.[ae]?.cancel()}},S.current),[I,_]);const oe=o.useCallback(({value:ae,index:be,dragging:g})=>{const{style:Ne,maxLength:Be,...Te}=z||{},u=s.jsx(Tr,{ref:L=>{x.current[be]=L},value:ae,disabled:D,maxLength:Be,style:{color:I===be&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Ne},styleHover:{},onSubmit:L=>(Y.current=!1,A(-1),J(be,L)),onCancel:()=>{Y.current=!1,A(-1)},onChange:L=>{Y.current=!0,A(be)},...Te});return M({onClick:L=>$(L,be),value:ae,index:be,editing:_===be&&Y.current,editable:!0,disabled:D,selectedIndex:I,background:K,activeColor:w,borderColor:N,borderWidth:v,dragging:g,children:u})},[I,J,$,z,D,_,M]),[ie,{width:qe}]=Wt(),[de,{width:Pe}]=Wt(),je=o.useRef(null),[De,Ie]=o.useState({left:0,top:0,width:0,height:0}),[ke,ge]=o.useState(null);o.useEffect(()=>{ke!==null&&je.current&&je.current.scrollTo({left:ke,behavior:"smooth"})},[ke]);const O=o.useCallback((ae,be=!1)=>{if(!je.current)return 0;let g=je.current.firstChild.getBoundingClientRect(),Ne=je.current.firstChild.firstChild.children,Be=0;return Be=be?0:r.ScrollUtils.getScrollTo(ae,g.left,Ne,!0,Math.max(0,ae-200)),ge(Be),Math.max(0,Be)},[]),Fe=o.useCallback((ae,be=!1)=>{if(!je.current)return 0;let g=je.current.firstChild.getBoundingClientRect(),Ne=je.current.firstChild.firstChild.children,Be=0;const Te=Math.ceil(Pe-qe);return Be=be?Te:r.ScrollUtils.getScrollTo(ae,g.left,Ne,!1,Math.max(0,ae+200)),ge(Be),Math.min(Te,Be)},[Pe,qe]),ze=o.useRef(null),H=o.useRef(null),W=o.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=null,ze.current=null)},[]),me=o.useCallback((ae,be,g=260)=>{ze.current=ae,H.current=setTimeout(()=>{const Ne=be?O(ze.current||ae):Fe(ze.current||ae);Ne!==ze.current?me(Ne,be,120):W()},g)},[O,Fe,W]);o.useEffect(()=>()=>W(),[W]);const ue=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(De.left)<=0||Math.floor(Pe-qe)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>me(je.current.scrollLeft,!0),onClick:ae=>O(Math.min(je.current.scrollLeft,ke??Number.MAX_SAFE_INTEGER),ae.ctrlKey)}),[De,ke,Pe,qe]),fe=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(Pe-qe)<=Math.ceil(De.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>me(je.current.scrollLeft,!1),onClick:ae=>Fe(Math.max(je.current.scrollLeft,ke??0),ae.ctrlKey)}),[De,ke,Pe,qe]),Me=o.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,p?.(ue)]}),[ue,fe,k,y,n,p]);return s.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:ct(va,a),ref:S,children:[s.jsx("div",{style:{borderTop:`solid ${N} ${v}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Me}),s.jsx("div",{className:"Tabs",ref:ie,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:je,onScroll:ae=>{Ie({left:ae.target.scrollLeft,top:ae.target.scrollTop,width:ae.target.scrollWidth,height:ae.target.scrollHeight})},children:s.jsx(fa,{isDisabled:ae=>D||Z,items:X,strategy:na,modifiers:[ga],ref:de,renderItem:oe,renderDivider:T,onMove:ve,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(fe)})]})}));rl.displayName="TabStrip";const Tn=o.createContext(null);Tn.displayName="DocThemesContext";const ba="_script-editor_iy654_5",xa={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"},qa=o.lazy(()=>Promise.resolve().then(()=>require("./bkd9NqdKNyW3PgiL.cjs")));let nn,on,Et=["define","require"],sr=!1,In="@0.7.25";In!=="@local"&&In!=="@0.0.0"||(In="");const Sa=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${In}/types/scripting.d.ts`,cr=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()),h=e.getPosition();let c={...h};c.lineNumber=1,c.column=1;let C=!1;for(let z=h.lineNumber;z>=1;z--)if(i.getLineContent(z).trim()===""){const D=To(f,i.getOffsetAt({lineNumber:z,column:1}),"function");if(!D||ka(D)){C=!0,c.lineNumber=z+1;break}{const Z=D.spans[0].start;z=i.getPositionAt(Z).lineNumber,c.lineNumber=z}}let k=n,y=!1;!C&&!k.startsWith(`
|
|
28
|
-
`)&&c.lineNumber>1&&(
|
|
29
|
-
`+
|
|
27
|
+
`},mi={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 fi(e){let{announcements:t=mi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=hi}=e;const{announce:l,announcement:f}=(function(){const[y,p]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&p(T)},[]),announcement:y}})(),h=hn("DndLiveRegion"),[c,C]=o.useState(!1);if(o.useEffect(()=>{C(!0)},[]),(function(y){const p=o.useContext(Fr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(y)},[y,p])})(o.useMemo(()=>({onDragStart(y){let{active:p}=y;l(t.onDragStart({active:p}))},onDragMove(y){let{active:p,over:T}=y;t.onDragMove&&l(t.onDragMove({active:p,over:T}))},onDragOver(y){let{active:p,over:T}=y;l(t.onDragOver({active:p,over:T}))},onDragEnd(y){let{active:p,over:T}=y;l(t.onDragEnd({active:p,over:T}))},onDragCancel(y){let{active:p,over:T}=y;l(t.onDragCancel({active:p,over:T}))}}),[l,t])),!c)return null;const M=o.createElement(o.Fragment,null,o.createElement(ui,{id:i,value:a.draggable}),o.createElement(gi,{id:h,announcement:f}));return n?Kt.createPortal(M,n):M}var ht;function zn(){}function io(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"})(ht||(ht={}));const kt=Object.freeze({x:0,y:0});function Ar(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pi(e,t){const n=Dn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Dr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function vi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function $o(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 zr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wo(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 Ci=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Wo(t,t.left,t.top),l=[];for(const f of i){const{id:h}=f,c=n.get(h);if(c){const C=Ar(Wo(c),a);l.push({id:h,data:{droppableContainer:f,value:C}})}}return l.sort(Dr)};function yi(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,h=l-n;if(i<a&&n<l){const c=t.width*t.height,C=e.width*e.height,M=f*h;return Number((M/(c+C-M)).toFixed(4))}return 0}const wi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,h=n.get(f);if(h){const c=yi(h,t);c>0&&a.push({id:f,data:{droppableContainer:l,value:c}})}}return a.sort(vi)};function Go(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function bi(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 xi=bi(1);function Lr(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 qi={ignoreTransform:!1};function Xt(e,t){t===void 0&&(t=qi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:C,transformOrigin:M}=Ct(e).getComputedStyle(e);C&&(n=(function(y,p,T){const I=Lr(p);if(!I)return y;const{scaleX:z,scaleY:D,x:_,y:$}=I,w=y.left-_-(1-z)*parseFloat(T),N=y.top-$-(1-D)*parseFloat(T.slice(T.indexOf(" ")+1)),v=z?y.width/z:y.width,E=D?y.height/D:y.height;return{width:v,height:E,top:N,right:w+v,bottom:N+E,left:w}})(n,C,M))}const{top:i,left:a,width:l,height:f,bottom:h,right:c}=n;return{top:i,left:a,width:l,height:f,bottom:h,right:c}}function _o(e){return Xt(e,{ignoreTransform:!0})}function Hn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!gn(a)||Ir(a)||n.includes(a))return n;const l=Ct(e).getComputedStyle(a);return a!==e&&(function(f,h){h===void 0&&(h=Ct(f).getComputedStyle(f));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(C=>{const M=h[C];return typeof M=="string"&&c.test(M)})})(a,l)&&n.push(a),(function(f,h){return h===void 0&&(h=Ct(f).getComputedStyle(f)),h.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Nr(e){const[t]=Hn(e,1);return t??null}function ao(e){return jn&&e?Zt(e)?e:xo(e)?qo(e)||e===_t(e).scrollingElement?window:gn(e)?e:null:null:null}function Pr(e){return Zt(e)?e.scrollX:e.scrollLeft}function jr(e){return Zt(e)?e.scrollY:e.scrollTop}function go(e){return{x:Pr(e),y:jr(e)}}var mt;function Br(e){return!(!jn||!e)&&e===document.scrollingElement}function Or(e){const t={x:0,y:0},n=Br(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"})(mt||(mt={}));const Si={x:.2,y:.2};function Ri(e,t,n,i,a){let{top:l,left:f,right:h,bottom:c}=n;i===void 0&&(i=10),a===void 0&&(a=Si);const{isTop:C,isBottom:M,isLeft:y,isRight:p}=Or(e),T={x:0,y:0},I={x:0,y:0},z=t.height*a.y,D=t.width*a.x;return!C&&l<=t.top+z?(T.y=mt.Backward,I.y=i*Math.abs((t.top+z-l)/z)):!M&&c>=t.bottom-z&&(T.y=mt.Forward,I.y=i*Math.abs((t.bottom-z-c)/z)),!p&&h>=t.right-D?(T.x=mt.Forward,I.x=i*Math.abs((t.right-D-h)/D)):!y&&f<=t.left+D&&(T.x=mt.Backward,I.x=i*Math.abs((t.left+D-f)/D)),{direction:T,speed:I}}function ki(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 Hr(e){return e.reduce((t,n)=>$t(t,go(n)),kt)}function Vr(e,t){if(t===void 0&&(t=Xt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Nr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Pr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+jr(n),0)}]];class ho{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=Hn(n),a=Hr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,h]of Mi)for(const c of f)Object.defineProperty(this,c,{get:()=>{const C=h(i),M=a[l]-C;return this.rect[c]+M},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ln{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 so(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 qt,Ye;function Zo(e){e.preventDefault()}function Ti(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"})(qt||(qt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const Ur={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ii=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class So{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 ln(_t(n)),this.windowListeners=new ln(Ct(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Vr(i),n(kt)}handleKeyDown(t){if(On(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Ur,coordinateGetter:f=Ii,scrollBehavior:h="smooth"}=a,{code:c}=t;if(l.end.includes(c))return void this.handleEnd(t);if(l.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:C}=i.current,M=C?{x:C.left,y:C.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=M);const y=f(t,{active:n,context:i.current,currentCoordinates:M});if(y){const p=dn(y,M),T={x:0,y:0},{scrollableAncestors:I}=i.current;for(const z of I){const D=t.code,{isTop:_,isRight:$,isLeft:w,isBottom:N,maxScroll:v,minScroll:E}=Or(z),q=ki(z),Z={x:Math.min(D===Ye.Right?q.right-q.width/2:q.right,Math.max(D===Ye.Right?q.left:q.left+q.width/2,y.x)),y:Math.min(D===Ye.Down?q.bottom-q.height/2:q.bottom,Math.max(D===Ye.Down?q.top:q.top+q.height/2,y.y))},F=D===Ye.Right&&!$||D===Ye.Left&&!w,P=D===Ye.Down&&!N||D===Ye.Up&&!_;if(F&&Z.x!==y.x){const W=z.scrollLeft+p.x,pe=D===Ye.Right&&W<=v.x||D===Ye.Left&&W>=E.x;if(pe&&!p.y)return void z.scrollTo({left:W,behavior:h});T.x=pe?z.scrollLeft-W:D===Ye.Right?z.scrollLeft-v.x:z.scrollLeft-E.x,T.x&&z.scrollBy({left:-T.x,behavior:h});break}if(P&&Z.y!==y.y){const W=z.scrollTop+p.y,pe=D===Ye.Down&&W<=v.y||D===Ye.Up&&W>=E.y;if(pe&&!p.x)return void z.scrollTo({top:W,behavior:h});T.y=pe?z.scrollTop-W:D===Ye.Down?z.scrollTop-v.y:z.scrollTop-E.y,T.y&&z.scrollBy({top:-T.y,behavior:h});break}}this.handleMove(t,$t(dn(y,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Xo(e){return!!(e&&"distance"in e)}function Yo(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Ur,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const h=l.activatorNode.current;return(!h||e.target===h)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(h){const{EventTarget:c}=Ct(h);return h instanceof c?h:_t(h)})(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=_t(f),this.documentListeners=new ln(this.document),this.listeners=new ln(i),this.windowListeners=new ln(Ct(f)),this.initialCoordinates=(a=Dn(l))!=null?a:kt,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(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,Zo),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,Zo),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yo(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Xo(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(qt.Click,Ti,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:h}}=l;if(!a)return;const c=(n=Dn(t))!=null?n:kt,C=dn(a,c);if(!i&&h){if(Xo(h)){if(h.tolerance!=null&&so(C,h.tolerance))return this.handleCancel();if(so(C,h.distance))return this.handleStart()}return Yo(h)&&so(C,h.tolerance)?this.handleCancel():void this.handlePending(h,C)}t.cancelable&&t.preventDefault(),f(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ei={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Kr extends Ro{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Ei,i)}}Kr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Fi={move:{name:"mousemove"},end:{name:"mouseup"}};var mo;(function(e){e[e.RightClick=2]="RightClick"})(mo||(mo={}));class $r extends Ro{constructor(t){super(t,Fi,_t(t.event.target))}}$r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==mo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Wr extends Ro{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var an,Ln;function Ai(e){let{acceleration:t,activator:n=an.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:h=Ln.TreeOrder,pointerCoordinates:c,scrollableAncestors:C,scrollableAncestorRects:M,delta:y,threshold:p}=e;const T=(function(E){let{delta:q,disabled:Z}=E;const F=An(q);return rn(P=>{if(Z||!F||!P)return Di;const W={x:Math.sign(q.x-F.x),y:Math.sign(q.y-F.y)};return{x:{[mt.Backward]:P.x[mt.Backward]||W.x===-1,[mt.Forward]:P.x[mt.Forward]||W.x===1},y:{[mt.Backward]:P.y[mt.Backward]||W.y===-1,[mt.Forward]:P.y[mt.Forward]||W.y===1}}},[Z,q,F])})({delta:y,disabled:!l}),[I,z]=(function(){const E=o.useRef(null);return[o.useCallback((q,Z)=>{E.current=setInterval(q,Z)},[]),o.useCallback(()=>{E.current!==null&&(clearInterval(E.current),E.current=null)},[])]})(),D=o.useRef({x:0,y:0}),_=o.useRef({x:0,y:0}),$=o.useMemo(()=>{switch(n){case an.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case an.DraggableRect:return a}},[n,a,c]),w=o.useRef(null),N=o.useCallback(()=>{const E=w.current;if(!E)return;const q=D.current.x*_.current.x,Z=D.current.y*_.current.y;E.scrollBy(q,Z)},[]),v=o.useMemo(()=>h===Ln.TreeOrder?[...C].reverse():C,[h,C]);o.useEffect(()=>{if(l&&C.length&&$){for(const E of v){if(i?.(E)===!1)continue;const q=C.indexOf(E),Z=M[q];if(!Z)continue;const{direction:F,speed:P}=Ri(E,Z,$,t,p);for(const W of["x","y"])T[W][F[W]]||(P[W]=0,F[W]=0);if(P.x>0||P.y>0)return z(),w.current=E,I(N,f),D.current=P,void(_.current=F)}D.current={x:0,y:0},_.current={x:0,y:0},z()}else z()},[t,N,i,z,l,f,JSON.stringify($),JSON.stringify(T),I,C,v,M,JSON.stringify(p)])}Wr.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"})(an||(an={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ln||(Ln={}));const Di={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var un,fo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(un||(un={})),(function(e){e.Optimized="optimized"})(fo||(fo={}));const Jo=new Map;function po(e,t){return rn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=Bn(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 ho(Xt(e),e)}function Qo(e,t,n){t===void 0&&(t=zi);const[i,a]=o.useState(null);function l(){a(c=>{if(!e)return null;var C;if(e.isConnected===!1)return(C=c??n)!=null?C:null;const M=t(e);return JSON.stringify(c)===JSON.stringify(M)?c:M})}const f=(function(c){let{callback:C,disabled:M}=c;const y=Bn(C),p=o.useMemo(()=>{if(M||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(y)},[y,M]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p})({callback(c){if(e)for(const C of c){const{type:M,target:y}=C;if(M==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),h=Nn({callback:l});return Rt(()=>{l(),e?(h?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),f?.disconnect())},[e]),i}const er=[];function tr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?dn(e,n.current):kt}function nr(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 or=[];function Gr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gn(t)?t:e}const Li=[{sensor:Kr,options:{}},{sensor:So,options:{}}],Ni={current:{}},Mn={draggable:{measure:_o},droppable:{measure:_o,strategy:un.WhileDragging,frequency:fo.Optimized},dragOverlay:{measure:Xt}};class sn 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 Pi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mn,measureDroppableContainers:zn,windowRect:null,measuringScheduled:!1},_r={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zn,draggableNodes:new Map,over:null,measureDroppableContainers:zn},mn=o.createContext(_r),Zr=o.createContext(Pi);function ji(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function Bi(e,t){switch(t.type){case ht.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ht.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 ht.DragEnd:case ht.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new sn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ht.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 sn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case ht.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new sn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Oi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(mn),l=An(i),f=An(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!On(l)||document.activeElement===l.target)return;const h=a.get(f);if(!h)return;const{activatorNode:c,node:C}=h;if(!c.current&&!C.current)return;requestAnimationFrame(()=>{for(const M of[c.current,C.current]){if(!M)continue;const y=ci(M);if(y){y.focus();break}}})}},[i,t,a,f,l]),null}function Xr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Vn=o.createContext({...kt,scaleX:1,scaleY:1});var Ft;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ft||(Ft={}));const Hi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:h=!0,children:c,sensors:C=Li,collisionDetection:M=wi,measuring:y,modifiers:p,...T}=e;const I=o.useReducer(Bi,void 0,ji),[z,D]=I,[_,$]=(function(){const[V]=o.useState(()=>new Set),X=o.useCallback(oe=>(V.add(oe),()=>V.delete(oe)),[V]);return[o.useCallback(oe=>{let{type:Fe,event:Ue}=oe;V.forEach(Oe=>{var Se;return(Se=Oe[Fe])==null?void 0:Se.call(Oe,Ue)})},[V]),X]})(),[w,N]=o.useState(Ft.Uninitialized),v=w===Ft.Initialized,{draggable:{active:E,nodes:q,translate:Z},droppable:{containers:F}}=z,P=E!=null?q.get(E):null,W=o.useRef({initial:null,translated:null}),pe=o.useMemo(()=>{var V;return E!=null?{id:E,data:(V=P?.data)!=null?V:Ni,rect:W}:null},[E,P]),de=o.useRef(null),[le,R]=o.useState(null),[te,k]=o.useState(null),b=cn(T,Object.values(T)),ee=hn("DndDescribedBy",l),ne=o.useMemo(()=>F.getEnabled(),[F]),Re=(Ce=y,o.useMemo(()=>({draggable:{...Mn.draggable,...Ce?.draggable},droppable:{...Mn.droppable,...Ce?.droppable},dragOverlay:{...Mn.dragOverlay,...Ce?.dragOverlay}}),[Ce?.draggable,Ce?.droppable,Ce?.dragOverlay]));var Ce;const{droppableRects:ye,measureDroppableContainers:Pe,measuringScheduled:ze}=(function(V,X){let{dragging:oe,dependencies:Fe,config:Ue}=X;const[Oe,Se]=o.useState(null),{frequency:He,measure:ve,strategy:De}=Ue,be=o.useRef(V),ke=(function(){switch(De){case un.Always:return!1;case un.BeforeDragging:return oe;default:return!oe}})(),Ne=cn(ke),Ze=o.useCallback(function(at){at===void 0&&(at=[]),Ne.current||Se(ot=>ot===null?at:ot.concat(at.filter($e=>!ot.includes($e))))},[Ne]),_e=o.useRef(null),Xe=rn(at=>{if(ke&&!oe)return Jo;if(!at||at===Jo||be.current!==V||Oe!=null){const ot=new Map;for(let $e of V){if(!$e)continue;if(Oe&&Oe.length>0&&!Oe.includes($e.id)&&$e.rect.current){ot.set($e.id,$e.rect.current);continue}const lt=$e.node.current,it=lt?new ho(ve(lt),lt):null;$e.rect.current=it,it&&ot.set($e.id,it)}return ot}return at},[V,Oe,oe,ke,ve]);return o.useEffect(()=>{be.current=V},[V]),o.useEffect(()=>{ke||Ze()},[oe,ke]),o.useEffect(()=>{Oe&&Oe.length>0&&Se(null)},[JSON.stringify(Oe)]),o.useEffect(()=>{ke||typeof He!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ze(),_e.current=null},He))},[He,ke,Ze,...Fe]),{droppableRects:Xe,measureDroppableContainers:Ze,measuringScheduled:Oe!=null}})(ne,{dragging:v,dependencies:[Z.x,Z.y],config:Re.droppable}),Ae=(function(V,X){const oe=X!=null?V.get(X):void 0,Fe=oe?oe.node.current:null;return rn(Ue=>{var Oe;return X==null?null:(Oe=Fe??Ue)!=null?Oe:null},[Fe,X])})(q,E),Ie=o.useMemo(()=>te?Dn(te):null,[te]),ue=(function(){const V=le?.autoScrollEnabled===!1,X=typeof h=="object"?h.enabled===!1:h===!1,oe=v&&!V&&!X;return typeof h=="object"?{...h,enabled:oe}:{enabled:oe}})(),O=(function(V,X){return po(V,X)})(Ae,Re.draggable.measure);(function(V){let{activeNode:X,measure:oe,initialRect:Fe,config:Ue=!0}=V;const Oe=o.useRef(!1),{x:Se,y:He}=typeof Ue=="boolean"?{x:Ue,y:Ue}:Ue;Rt(()=>{if(!Se&&!He||!X)return void(Oe.current=!1);if(Oe.current||!Fe)return;const ve=X?.node.current;if(!ve||ve.isConnected===!1)return;const De=Go(oe(ve),Fe);if(Se||(De.x=0),He||(De.y=0),Oe.current=!0,Math.abs(De.x)>0||Math.abs(De.y)>0){const be=Nr(ve);be&&be.scrollBy({top:De.y,left:De.x})}},[X,Se,He,Fe,oe])})({activeNode:E!=null?q.get(E):null,config:ue.layoutShiftCompensation,initialRect:O,measure:Re.draggable.measure});const xe=Qo(Ae,Re.draggable.measure,O),Le=Qo(Ae?Ae.parentElement:null),H=o.useRef({activatorEvent:null,active:null,activeNode:Ae,collisionRect:null,collisions:null,droppableRects:ye,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=F.getNodeFor((t=H.current.over)==null?void 0:t.id),he=(function(V){let{measure:X}=V;const[oe,Fe]=o.useState(null),Ue=Nn({callback:o.useCallback(ve=>{for(const{target:De}of ve)if(gn(De)){Fe(be=>{const ke=X(De);return be?{...be,width:ke.width,height:ke.height}:ke});break}},[X])}),Oe=o.useCallback(ve=>{const De=Gr(ve);Ue?.disconnect(),De&&Ue?.observe(De),Fe(De?X(De):null)},[X,Ue]),[Se,He]=Fn(Oe);return o.useMemo(()=>({nodeRef:Se,rect:oe,setRef:He}),[oe,Se,He])})({measure:Re.dragOverlay.measure}),ce=(n=he.nodeRef.current)!=null?n:Ae,me=v?(i=he.rect)!=null?i:xe:null,Te=!!(he.nodeRef.current&&he.rect),ie=Go(qe=Te?null:xe,po(qe));var qe;const g=nr(ce?Ct(ce):null),je=(function(V){const X=o.useRef(V),oe=rn(Fe=>V?Fe&&Fe!==er&&V&&X.current&&V.parentNode===X.current.parentNode?Fe:Hn(V):er,[V]);return o.useEffect(()=>{X.current=V},[V]),oe})(v?U??Ae:null),Be=(function(V,X){X===void 0&&(X=Xt);const[oe]=V,Fe=nr(oe?Ct(oe):null),[Ue,Oe]=o.useState(or);function Se(){Oe(()=>V.length?V.map(ve=>Br(ve)?Fe:new ho(X(ve),ve)):or)}const He=Nn({callback:Se});return Rt(()=>{He?.disconnect(),Se(),V.forEach(ve=>He?.observe(ve))},[V]),Ue})(je),Ee=Xr(p,{transform:{x:Z.x-ie.x,y:Z.y-ie.y,scaleX:1,scaleY:1},activatorEvent:te,active:pe,activeNodeRect:xe,containerNodeRect:Le,draggingNodeRect:me,over:H.current.over,overlayNodeRect:he.rect,scrollableAncestors:je,scrollableAncestorRects:Be,windowRect:g}),u=Ie?$t(Ie,Z):null,L=(function(V){const[X,oe]=o.useState(null),Fe=o.useRef(V),Ue=o.useCallback(Oe=>{const Se=ao(Oe.target);Se&&oe(He=>He?(He.set(Se,go(Se)),new Map(He)):null)},[]);return o.useEffect(()=>{const Oe=Fe.current;if(V!==Oe){Se(Oe);const He=V.map(ve=>{const De=ao(ve);return De?(De.addEventListener("scroll",Ue,{passive:!0}),[De,go(De)]):null}).filter(ve=>ve!=null);oe(He.length?new Map(He):null),Fe.current=V}return()=>{Se(V),Se(Oe)};function Se(He){He.forEach(ve=>{const De=ao(ve);De?.removeEventListener("scroll",Ue)})}},[Ue,V]),o.useMemo(()=>V.length?X?Array.from(X.values()).reduce((Oe,Se)=>$t(Oe,Se),kt):Hr(V):kt,[V,X])})(je),K=tr(L),m=tr(L,[xe]),A=$t(Ee,K),G=me?xi(me,Ee):null,J=pe&&G?M({active:pe,collisionRect:G,droppableRects:ye,droppableContainers:ne,pointerCoordinates:u}):null,re=zr(J,"id"),[x,B]=o.useState(null),S=(function(V,X,oe){return{...V,scaleX:X&&oe?X.width/oe.width:1,scaleY:X&&oe?X.height/oe.height:1}})(Te?Ee:$t(Ee,m),(a=x?.rect)!=null?a:null,xe),j=o.useRef(null),se=o.useCallback((V,X)=>{let{sensor:oe,options:Fe}=X;if(de.current==null)return;const Ue=q.get(de.current);if(!Ue)return;const Oe=V.nativeEvent,Se=new oe({active:de.current,activeNode:Ue,event:Oe,options:Fe,context:H,onAbort(ve){if(!q.get(ve))return;const{onDragAbort:De}=b.current,be={id:ve};De?.(be),_({type:"onDragAbort",event:be})},onPending(ve,De,be,ke){if(!q.get(ve))return;const{onDragPending:Ne}=b.current,Ze={id:ve,constraint:De,initialCoordinates:be,offset:ke};Ne?.(Ze),_({type:"onDragPending",event:Ze})},onStart(ve){const De=de.current;if(De==null)return;const be=q.get(De);if(!be)return;const{onDragStart:ke}=b.current,Ne={activatorEvent:Oe,active:{id:De,data:be.data,rect:W}};Kt.unstable_batchedUpdates(()=>{ke?.(Ne),N(Ft.Initializing),D({type:ht.DragStart,initialCoordinates:ve,active:De}),_({type:"onDragStart",event:Ne}),R(j.current),k(Oe)})},onMove(ve){D({type:ht.DragMove,coordinates:ve})},onEnd:He(ht.DragEnd),onCancel:He(ht.DragCancel)});function He(ve){return async function(){const{active:De,collisions:be,over:ke,scrollAdjustedTranslate:Ne}=H.current;let Ze=null;if(De&&Ne){const{cancelDrop:_e}=b.current;Ze={activatorEvent:Oe,active:De,collisions:be,delta:Ne,over:ke},ve===ht.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ze))&&(ve=ht.DragCancel)}de.current=null,Kt.unstable_batchedUpdates(()=>{D({type:ve}),N(Ft.Uninitialized),B(null),R(null),k(null),j.current=null;const _e=ve===ht.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const Xe=b.current[_e];Xe?.(Ze),_({type:_e,event:Ze})}})}}j.current=Se},[q]),ae=o.useCallback((V,X)=>(oe,Fe)=>{const Ue=oe.nativeEvent,Oe=q.get(Fe);if(de.current!==null||!Oe||Ue.dndKit||Ue.defaultPrevented)return;const Se={active:Oe};V(oe,X.options,Se)===!0&&(Ue.dndKit={capturedBy:X.sensor},de.current=Fe,se(oe,X))},[q,se]),we=(function(V,X){return o.useMemo(()=>V.reduce((oe,Fe)=>{const{sensor:Ue}=Fe;return[...oe,...Ue.activators.map(Oe=>({eventName:Oe.eventName,handler:X(Oe.handler,Fe)}))]},[]),[V,X])})(C,ae);(function(V){o.useEffect(()=>{if(!jn)return;const X=V.map(oe=>{let{sensor:Fe}=oe;return Fe.setup==null?void 0:Fe.setup()});return()=>{for(const oe of X)oe?.()}},V.map(X=>{let{sensor:oe}=X;return oe}))})(C),Rt(()=>{xe&&w===Ft.Initializing&&N(Ft.Initialized)},[xe,w]),o.useEffect(()=>{const{onDragMove:V}=b.current,{active:X,activatorEvent:oe,collisions:Fe,over:Ue}=H.current;if(!X||!oe)return;const Oe={active:X,activatorEvent:oe,collisions:Fe,delta:{x:A.x,y:A.y},over:Ue};Kt.unstable_batchedUpdates(()=>{V?.(Oe),_({type:"onDragMove",event:Oe})})},[A.x,A.y]),o.useEffect(()=>{const{active:V,activatorEvent:X,collisions:oe,droppableContainers:Fe,scrollAdjustedTranslate:Ue}=H.current;if(!V||de.current==null||!X||!Ue)return;const{onDragOver:Oe}=b.current,Se=Fe.get(re),He=Se&&Se.rect.current?{id:Se.id,rect:Se.rect.current,data:Se.data,disabled:Se.disabled}:null,ve={active:V,activatorEvent:X,collisions:oe,delta:{x:Ue.x,y:Ue.y},over:He};Kt.unstable_batchedUpdates(()=>{B(He),Oe?.(ve),_({type:"onDragOver",event:ve})})},[re]),Rt(()=>{H.current={activatorEvent:te,active:pe,activeNode:Ae,collisionRect:G,collisions:J,droppableRects:ye,draggableNodes:q,draggingNode:ce,draggingNodeRect:me,droppableContainers:F,over:x,scrollableAncestors:je,scrollAdjustedTranslate:A},W.current={initial:me,translated:G}},[pe,Ae,J,G,q,ce,me,ye,F,x,je,A]),Ai({...ue,delta:Z,draggingRect:G,pointerCoordinates:u,scrollableAncestors:je,scrollableAncestorRects:Be});const Y=o.useMemo(()=>({active:pe,activeNode:Ae,activeNodeRect:xe,activatorEvent:te,collisions:J,containerNodeRect:Le,dragOverlay:he,draggableNodes:q,droppableContainers:F,droppableRects:ye,over:x,measureDroppableContainers:Pe,scrollableAncestors:je,scrollableAncestorRects:Be,measuringConfiguration:Re,measuringScheduled:ze,windowRect:g}),[pe,Ae,xe,te,J,Le,he,q,F,ye,x,Pe,je,Be,Re,ze,g]),fe=o.useMemo(()=>({activatorEvent:te,activators:we,active:pe,activeNodeRect:xe,ariaDescribedById:{draggable:ee},dispatch:D,draggableNodes:q,over:x,measureDroppableContainers:Pe}),[te,we,pe,xe,D,ee,q,x,Pe]);return o.createElement(Fr.Provider,{value:$},o.createElement(mn.Provider,{value:fe},o.createElement(Zr.Provider,{value:Y},o.createElement(Vn.Provider,{value:S},c)),o.createElement(Oi,{disabled:f?.restoreFocus===!1})),o.createElement(fi,{...f,hiddenTextDescribedById:ee}))}),Vi=o.createContext(null),rr="button";function Ui(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=hn("Draggable"),{activators:f,activatorEvent:h,active:c,activeNodeRect:C,ariaDescribedById:M,draggableNodes:y,over:p}=o.useContext(mn),{role:T=rr,roleDescription:I="draggable",tabIndex:z=0}=a??{},D=c?.id===t,_=o.useContext(D?Vn:Vi),[$,w]=Fn(),[N,v]=Fn(),E=(function(Z,F){return o.useMemo(()=>Z.reduce((P,W)=>{let{eventName:pe,handler:de}=W;return P[pe]=le=>{de(le,F)},P},{}),[Z,F])})(f,t),q=cn(n);return Rt(()=>(y.set(t,{id:t,key:l,node:$,activatorNode:N,data:q}),()=>{const Z=y.get(t);Z&&Z.key===l&&y.delete(t)}),[y,t]),{active:c,activatorEvent:h,activeNodeRect:C,attributes:o.useMemo(()=>({role:T,tabIndex:z,"aria-disabled":i,"aria-pressed":!(!D||T!==rr)||void 0,"aria-roledescription":I,"aria-describedby":M.draggable}),[i,T,z,D,I,M.draggable]),isDragging:D,listeners:i?void 0:E,node:$,over:p,setNodeRef:w,setActivatorNodeRef:v,transform:_}}function Yr(){return o.useContext(Zr)}const Ki={timeout:25};function $i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),h=An(n);return n||i||!h||a(h),Rt(()=>{if(!l)return;const c=i?.key,C=i?.props.id;c!=null&&C!=null?Promise.resolve(t(C,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const Wi={x:0,y:0,scaleX:1,scaleY:1};function Gi(e){let{children:t}=e;return o.createElement(mn.Provider,{value:_r},o.createElement(Vn.Provider,{value:Wi},t))}const _i={position:"fixed",touchAction:"none"},Zi=e=>On(e)?"transform 250ms ease":void 0,Xi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:h,style:c,transform:C,transition:M=Zi}=e;if(!h)return null;const y=a?C:{...C,scaleX:1,scaleY:1},p={..._i,width:h.width,height:h.height,top:h.top,left:h.left,transform:Lt.Transform.toString(y),transformOrigin:a&&i?pi(i,h):void 0,transition:typeof M=="function"?M(i):M,...c};return o.createElement(n,{className:f,style:p,ref:t},l)}),Yi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[h,c]of Object.entries(l.active))c!==void 0&&(a[h]=n.node.style.getPropertyValue(h),n.node.style.setProperty(h,c));if(l!=null&&l.dragOverlay)for(const[h,c]of Object.entries(l.dragOverlay))c!==void 0&&i.node.style.setProperty(h,c);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[h,c]of Object.entries(a))n.node.style.setProperty(h,c);f!=null&&f.active&&n.node.classList.remove(f.active)}},Jr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Lt.Transform.toString(t)},{transform:Lt.Transform.toString(n)}]},sideEffects:Yi({styles:{active:{opacity:"0"}}})};function Ji(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Bn((l,f)=>{if(t===null)return;const h=n.get(l);if(!h)return;const c=h.node.current;if(!c)return;const C=Gr(f);if(!C)return;const{transform:M}=Ct(f).getComputedStyle(f),y=Lr(M);if(!y)return;const p=typeof t=="function"?t:(function(T){const{duration:I,easing:z,sideEffects:D,keyframes:_}={...Jr,...T};return $=>{let{active:w,dragOverlay:N,transform:v,...E}=$;if(!I)return;const q={x:N.rect.left-w.rect.left,y:N.rect.top-w.rect.top},Z={scaleX:v.scaleX!==1?w.rect.width*v.scaleX/N.rect.width:1,scaleY:v.scaleY!==1?w.rect.height*v.scaleY/N.rect.height:1},F={x:v.x-q.x,y:v.y-q.y,...Z},P=_({...E,active:w,dragOverlay:N,transform:{initial:v,final:F}}),[W]=P,pe=P[P.length-1];if(JSON.stringify(W)===JSON.stringify(pe))return;const de=D?.({active:w,dragOverlay:N,...E}),le=N.node.animate(P,{duration:I,easing:z,fill:"forwards"});return new Promise(R=>{le.onfinish=()=>{de?.(),R()}})}})(t);return Vr(c,a.draggable.measure),p({active:{id:l,data:h.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(C)},droppableContainers:i,measuringConfiguration:a,transform:y})})}let lr=0;function Qi(e){return o.useMemo(()=>{if(e!=null)return lr++,lr},[e])}const ea=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:h="div",className:c,zIndex:C=999}=e;const{activatorEvent:M,active:y,activeNodeRect:p,containerNodeRect:T,draggableNodes:I,droppableContainers:z,dragOverlay:D,over:_,measuringConfiguration:$,scrollableAncestors:w,scrollableAncestorRects:N,windowRect:v}=Yr(),E=o.useContext(Vn),q=Qi(y?.id),Z=Xr(f,{activatorEvent:M,active:y,activeNodeRect:p,containerNodeRect:T,draggingNodeRect:D.rect,over:_,overlayNodeRect:D.rect,scrollableAncestors:w,scrollableAncestorRects:N,transform:E,windowRect:v}),F=po(p),P=Ji({config:i,draggableNodes:I,droppableContainers:z,measuringConfiguration:$}),W=F?D.setRef:void 0;return o.createElement(Gi,null,o.createElement($i,{animation:P},y&&q?o.createElement(Xi,{key:q,id:y.id,ref:W,as:h,activatorEvent:M,adjustScale:t,className:c,transition:l,rect:F,style:{zIndex:C,...a},transform:Z},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ta(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Rn(e){return e!==null&&e>=0}const kn={scaleX:1,scaleY:1},na=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const h=(t=n[a])!=null?t:i;if(!h)return null;const c=(function(C,M,y){const p=C[M],T=C[M-1],I=C[M+1];return!p||!T&&!I?0:y<M?T?p.left-(T.left+T.width):I.left-(p.left+p.width):I?I.left-(p.left+p.width):p.left-(T.left+T.width)})(n,f,a);if(f===a){const C=n[l];return C?{x:a<l?C.left+C.width-(h.left+h.width):C.left-h.left,y:0,...kn}:null}return f>a&&f<=l?{x:-h.width-c,y:0,...kn}:f<a&&f>=l?{x:h.width+c,y:0,...kn}:{x:0,y:0,...kn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),f=t[a],h=l[a];return h&&f?{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}:null},Qr="Sortable",el=o.createContext({activeIndex:-1,containerId:Qr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function oa(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:f,dragOverlay:h,droppableRects:c,over:C,measureDroppableContainers:M}=Yr(),y=hn(Qr,n),p=h.rect!==null,T=o.useMemo(()=>i.map(E=>typeof E=="object"&&"id"in E?E.id:E),[i]),I=f!=null,z=f?T.indexOf(f.id):-1,D=C?T.indexOf(C.id):-1,_=o.useRef(T),$=!(function(E,q){if(E===q)return!0;if(E.length!==q.length)return!1;for(let Z=0;Z<E.length;Z++)if(E[Z]!==q[Z])return!1;return!0})(T,_.current),w=D!==-1&&z===-1||$,N=(function(E){return typeof E=="boolean"?{draggable:E,droppable:E}:E})(l);Rt(()=>{$&&I&&M(T)},[$,T,I,M]),o.useEffect(()=>{_.current=T},[T]);const v=o.useMemo(()=>({activeIndex:z,containerId:y,disabled:N,disableTransforms:w,items:T,overIndex:D,useDragOverlay:p,sortedRects:ta(T,c),strategy:a}),[z,y,N.draggable,N.droppable,w,T,D,c,p,a]);return o.createElement(el.Provider,{value:v},t)}const ra=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:h,previousContainerId:c,transition:C}=e;return!(!C||!i)&&(h===l||a!==f)&&(!!n||f!==a&&t===c)},ia={duration:200,easing:"ease"},tl="transform",aa=Lt.Transition.toString({property:tl,duration:0,easing:"linear"}),sa={roleDescription:"sortable"};function ca(e){let{animateLayoutChanges:t=la,attributes:n,disabled:i,data:a,getNewIndex:l=ra,id:f,strategy:h,resizeObserverConfig:c,transition:C=ia}=e;const{items:M,containerId:y,activeIndex:p,disabled:T,disableTransforms:I,sortedRects:z,overIndex:D,useDragOverlay:_,strategy:$}=o.useContext(el),w=(function(U,he){var ce,me;return typeof U=="boolean"?{draggable:U,droppable:!1}:{draggable:(ce=U?.draggable)!=null?ce:he.draggable,droppable:(me=U?.droppable)!=null?me:he.droppable}})(i,T),N=M.indexOf(f),v=o.useMemo(()=>({sortable:{containerId:y,index:N,items:M},...a}),[y,a,N,M]),E=o.useMemo(()=>M.slice(M.indexOf(f)),[M,f]),{rect:q,node:Z,isOver:F,setNodeRef:P}=(function(U){let{data:he,disabled:ce=!1,id:me,resizeObserverConfig:Te}=U;const ie=hn("Droppable"),{active:qe,dispatch:g,over:je,measureDroppableContainers:Be}=o.useContext(mn),Ee=o.useRef({disabled:ce}),u=o.useRef(!1),L=o.useRef(null),K=o.useRef(null),{disabled:m,updateMeasurementsFor:A,timeout:G}={...Ki,...Te},J=cn(A??me),re=Nn({callback:o.useCallback(()=>{u.current?(K.current!=null&&clearTimeout(K.current),K.current=setTimeout(()=>{Be(Array.isArray(J.current)?J.current:[J.current]),K.current=null},G)):u.current=!0},[G]),disabled:m||!qe}),x=o.useCallback((se,ae)=>{re&&(ae&&(re.unobserve(ae),u.current=!1),se&&re.observe(se))},[re]),[B,S]=Fn(x),j=cn(he);return o.useEffect(()=>{re&&B.current&&(re.disconnect(),u.current=!1,re.observe(B.current))},[B,re]),o.useEffect(()=>(g({type:ht.RegisterDroppable,element:{id:me,key:ie,disabled:ce,node:B,rect:L,data:j}}),()=>g({type:ht.UnregisterDroppable,key:ie,id:me})),[me]),o.useEffect(()=>{ce!==Ee.current.disabled&&(g({type:ht.SetDroppableDisabled,id:me,key:ie,disabled:ce}),Ee.current.disabled=ce)},[me,ie,ce,g]),{active:qe,rect:L,isOver:je?.id===me,node:B,over:je,setNodeRef:S}})({id:f,data:v,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:W,activatorEvent:pe,activeNodeRect:de,attributes:le,setNodeRef:R,listeners:te,isDragging:k,over:b,setActivatorNodeRef:ee,transform:ne}=Ui({id:f,data:v,attributes:{...sa,...n},disabled:w.draggable}),Re=(function(){for(var U=arguments.length,he=new Array(U),ce=0;ce<U;ce++)he[ce]=arguments[ce];return o.useMemo(()=>me=>{he.forEach(Te=>Te(me))},he)})(P,R),Ce=!!W,ye=Ce&&!I&&Rn(p)&&Rn(D),Pe=!_&&k,ze=Pe&&ye?ne:null,Ae=ye?ze??(h??$)({rects:z,activeNodeRect:de,activeIndex:p,overIndex:D,index:N}):null,Ie=Rn(p)&&Rn(D)?l({id:f,items:M,activeIndex:p,overIndex:D}):N,ue=W?.id,O=o.useRef({activeId:ue,items:M,newIndex:Ie,containerId:y}),xe=M!==O.current.items,Le=t({active:W,containerId:y,isDragging:k,isSorting:Ce,id:f,index:N,items:M,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:C,wasDragging:O.current.activeId!=null}),H=(function(U){let{disabled:he,index:ce,node:me,rect:Te}=U;const[ie,qe]=o.useState(null),g=o.useRef(ce);return Rt(()=>{if(!he&&ce!==g.current&&me.current){const je=Te.current;if(je){const Be=Xt(me.current,{ignoreTransform:!0}),Ee={x:je.left-Be.left,y:je.top-Be.top,scaleX:je.width/Be.width,scaleY:je.height/Be.height};(Ee.x||Ee.y)&&qe(Ee)}}ce!==g.current&&(g.current=ce)},[he,ce,me,Te]),o.useEffect(()=>{ie&&qe(null)},[ie]),ie})({disabled:!Le,index:N,node:Z,rect:q});return o.useEffect(()=>{Ce&&O.current.newIndex!==Ie&&(O.current.newIndex=Ie),y!==O.current.containerId&&(O.current.containerId=y),M!==O.current.items&&(O.current.items=M)},[Ce,Ie,y,M]),o.useEffect(()=>{if(ue===O.current.activeId)return;if(ue!=null&&O.current.activeId==null)return void(O.current.activeId=ue);const U=setTimeout(()=>{O.current.activeId=ue},50);return()=>clearTimeout(U)},[ue]),{active:W,activeIndex:p,attributes:le,data:v,rect:q,index:N,newIndex:Ie,items:M,isOver:F,isSorting:Ce,isDragging:k,listeners:te,node:Z,overIndex:D,over:b,setNodeRef:Re,setActivatorNodeRef:ee,setDroppableNodeRef:P,setDraggableNodeRef:R,transform:H??Ae,transition:(function(){if(H||xe&&O.current.newIndex===N)return aa;if(!(Pe&&!On(pe)||!C)&&(Ce||Le))return Lt.Transition.toString({...C,property:tl})})()}}function Pn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ua=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:h}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const c=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const p=a.get(y.id);if(p)switch(e.code){case Ye.Down:i.top<p.top&&c.push(y);break;case Ye.Up:i.top>p.top&&c.push(y);break;case Ye.Left:i.left>p.left&&c.push(y);break;case Ye.Right:i.left<p.left&&c.push(y)}});const C=(y=>{let{collisionRect:p,droppableRects:T,droppableContainers:I}=y;const z=$o(p),D=[];for(const _ of I){const{id:$}=_,w=T.get($);if(w){const N=$o(w),v=z.reduce((q,Z,F)=>q+Ar(N[F],Z),0),E=Number((v/4).toFixed(4));D.push({id:$,data:{droppableContainer:_,value:E}})}}return D.sort(Dr)})({collisionRect:i,droppableRects:a,droppableContainers:c});let M=zr(C,"id");if(M===f?.id&&C.length>1&&(M=C[1].id),M!=null){const y=l.get(n.id),p=l.get(M),T=p?a.get(p.id):null,I=p?.node.current;if(I&&T&&y&&p){const z=Hn(I).some((N,v)=>h[v]!==N),D=ir(y,p),_=(function(N,v){return!Pn(N)||!Pn(v)||!ir(N,v)?!1:N.data.current.sortable.index<v.data.current.sortable.index})(y,p),$=z||!D?{x:0,y:0}:{x:_?i.width-T.width:0,y:_?i.height-T.height:0},w={x:T.left,y:T.top};return $.x&&$.y?w:dn(w,$)}}}};function ir(e,t){return!(!Pn(e)||!Pn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ga=e=>{let{transform:t}=e;return{...t,y:0}},nl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:h,selectedIndex:c,background:C,activeColor:M,borderColor:y,borderWidth:p,dragging:T,...I}=e;return s.jsxs("div",{ref:t,className:ct(a),style:{...i,display:"flex",flexDirection:"column",background:c===l?"white":C,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...I,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===l?"0px":"-1px",marginTop:c===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===l?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===l&&M?M?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},ol=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:h,listeners:c,onRemove:C,renderItem:M,sorting:y,style:p,transition:T,transform:I,value:z,wrapperStyle:D,..._},$)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=M?M({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:h,fadeIn:!!a,listeners:c,ref:$,style:p,transform:I,transition:T,value:z}):s.jsx(s.Fragment,{children:z});return s.jsx("div",{className:ct("tab-item",St.Wrapper,a&&St.fadeIn,y&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[T,D?.transition].filter(Boolean).join(", "),"--translate-x":I?`${Math.round(I.x)}px`:void 0,"--translate-y":I?`${Math.round(I.y)}px`:void 0,"--scale-x":I?.scaleX?`${I.scaleX}`:void 0,"--scale-y":I?.scaleY?`${I.scaleY}`:void 0,"--index":h},ref:$,children:s.jsx("div",{className:ct(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:c,..._,tabIndex:l?void 0:-1,children:w})})})),ar={Row:"_Row_1kr10_1"},ha=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>s.jsx("div",{ref:i,style:{...n},className:ct(ar.Row,t&&ar.horizontal),children:e}))),ma={...Jr},fa=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=Ci,coordinateGetter:h=ua,dropAnimation:c=ma,getItemStyles:C=()=>({}),getNewIndex:M,handle:y=!1,items:p,onMove:T,isDisabled:I=()=>!1,measuring:z,modifiers:D,renderItem:_,renderDivider:$,reorderItems:w=ko,strategy:N=Mo,style:v,useDragOverlay:E=!0,onDragStart:q,wrapperStyle:Z=()=>({})}=e,[F,P]=o.useState(()=>p);o.useEffect(()=>{P(p)},[p]);const[W,pe]=o.useState(null),de=(function(){for(var b=arguments.length,ee=new Array(b),ne=0;ne<b;ne++)ee[ne]=arguments[ne];return o.useMemo(()=>[...ee].filter(Re=>Re!=null),[...ee])})(io($r,{activationConstraint:i}),io(Wr,{activationConstraint:i}),io(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:h})),le=F.indexOf.bind(F),R=W?le(W):-1,te=[];F.map((b,ee)=>{te.push(s.jsx(pa,{id:b,handle:y,index:ee,style:C,wrapperStyle:Z,disabled:I(b),renderItem:_,animateLayoutChanges:a,useDragOverlay:E,getNewIndex:M},b+"-"+ee));const ne=$?.({key:"divider-"+ee});ne&&te.push(ne)});const{getPortalContainer:k}=r.useFullscreenPortal();return s.jsxs(Hi,{sensors:de,collisionDetection:f,onDragStart:b=>{const{active:ee}=b;ee&&(q?.(b),pe(ee.id))},autoScroll:{canScroll:b=>!0},onDragEnd:b=>{if(pe(null),b.over){const ee=le(b.over.id);R!==ee&&(P(ne=>w(ne,R,ee)),T?.(R,ee))}},onDragCancel:()=>{pe(null)},measuring:z,modifiers:D,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...v},className:ct(n,St.Wrapper),children:s.jsx(oa,{items:F,strategy:N,children:s.jsx(ha,{ref:t,children:te})})}),E?Kt.createPortal(s.jsx(ea,{adjustScale:l,dropAnimation:c,children:W?s.jsx(ol,{value:F[R],handle:y,renderItem:_,wrapperStyle:Z({index:R,isDragging:!0,id:F[R]}),index:R,dragging:!0,style:C({id:F[R],index:R,isSorting:W!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),k()):null]})}));function pa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:h,renderItem:c,useDragOverlay:C,wrapperStyle:M}){const{attributes:y,isDragging:p,isSorting:T,listeners:I,overIndex:z,setNodeRef:D,transform:_,transition:$}=ca({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(ol,{ref:D,value:a,disabled:e,dragging:p,sorting:T,handle:i,renderItem:c,index:l,style:h({index:l,id:a,isDragging:p,isSorting:T,overIndex:z}),onRemove:f?()=>f(a):void 0,transform:_,transition:$,wrapperStyle:M({index:l,isDragging:p,id:a}),listeners:I,"data-index":l,"data-id":a,dragOverlay:!C&&p,...y})}const va="_TabStrip_3x0dp_1",Ca=new d.Color("rgb(33, 115, 70)"),ya="#eee",wa=e=>s.jsx(nl,{...e}),rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:h,onTabNameChange:c,onTabMove:C,renderScrollButtonStart:M=r.defaultCreateScrollStartButton,renderScrollButtonEnd:y=r.defaultCreateScrollEndButton,renderScrollButtonEdge:p=r.defaultCreateScrollEdgeButton,renderTabButton:T=wa,renderTabDivider:I,propsEditLabel:z,disabled:D=!1,disableDrag:_=!1,background:$="white",activeColor:w=Ca,borderColor:N=ya,borderWidth:v=1}=e,[E,q]=o.useState(l),[Z,F]=o.useState(f),P=o.useCallback(ie=>{const qe=k.current?.[ie]?.closest(".tab-item")??k.current?.[ie];qe&&Pe.current?.scrollTo({top:qe.offsetTop,left:qe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{P(l)},[l]);const W=o.useCallback((ie,qe)=>{qe!==E&&(q(qe),h?.(qe)),P(qe)},[h,E]),pe=o.useCallback((ie,qe)=>{C?.(ie,qe)},[C]),de=o.useRef(null),[le,R]=o.useState(-1),te=o.useCallback((ie,qe)=>{c?.(ie,qe)},[c]);o.useLayoutEffect(()=>{q(l)},[l]),o.useLayoutEffect(()=>{F(f)},[f]);const k=o.useRef([]),b=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){k.current?.[ie]?.startEdit()},cancel(ie){k.current?.[ie]?.cancel()}},b.current),[E,le]);const ee=o.useCallback(({value:ie,index:qe,dragging:g})=>{const{style:je,maxLength:Be,...Ee}=z||{},u=s.jsx(Tr,{ref:L=>{k.current[qe]=L},value:ie,disabled:D,maxLength:Be,style:{color:E===qe&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...je},styleHover:{},onSubmit:L=>(de.current=!1,R(-1),te(qe,L)),onCancel:()=>{de.current=!1,R(-1)},onChange:L=>{de.current=!0,R(qe)},...Ee});return T({onClick:L=>W(L,qe),value:ie,index:qe,editing:le===qe&&de.current,editable:!0,disabled:D,selectedIndex:E,background:$,activeColor:w,borderColor:N,borderWidth:v,dragging:g,children:u})},[E,te,W,z,D,le,T]),[ne,{width:Re}]=Wt(),[Ce,{width:ye}]=Wt(),Pe=o.useRef(null),[ze,Ae]=o.useState({left:0,top:0,width:0,height:0}),[Ie,ue]=o.useState(null);o.useEffect(()=>{Ie!==null&&Pe.current&&Pe.current.scrollTo({left:Ie,behavior:"smooth"})},[Ie]);const O=o.useCallback((ie,qe=!1)=>{if(!Pe.current)return 0;let g=Pe.current.firstChild.getBoundingClientRect(),je=Pe.current.firstChild.firstChild.children,Be=0;return Be=qe?0:r.ScrollUtils.getScrollTo(ie,g.left,je,!0,Math.max(0,ie-200)),ue(Be),Math.max(0,Be)},[]),xe=o.useCallback((ie,qe=!1)=>{if(!Pe.current)return 0;let g=Pe.current.firstChild.getBoundingClientRect(),je=Pe.current.firstChild.firstChild.children,Be=0;const Ee=Math.ceil(ye-Re);return Be=qe?Ee:r.ScrollUtils.getScrollTo(ie,g.left,je,!1,Math.max(0,ie+200)),ue(Be),Math.min(Ee,Be)},[ye,Re]),Le=o.useRef(null),H=o.useRef(null),U=o.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=null,Le.current=null)},[]),he=o.useCallback((ie,qe,g=260)=>{Le.current=ie,H.current=setTimeout(()=>{const je=qe?O(Le.current||ie):xe(Le.current||ie);je!==Le.current?he(je,qe,120):U()},g)},[O,xe,U]);o.useEffect(()=>()=>U(),[U]);const ce=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(ze.left)<=0||Math.floor(ye-Re)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>he(Pe.current.scrollLeft,!0),onClick:ie=>O(Math.min(Pe.current.scrollLeft,Ie??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[ze,Ie,ye,Re]),me=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ye-Re)<=Math.ceil(ze.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>he(Pe.current.scrollLeft,!1),onClick:ie=>xe(Math.max(Pe.current.scrollLeft,Ie??0),ie.ctrlKey)}),[ze,Ie,ye,Re]),Te=o.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,p?.(ce)]}),[ce,me,M,y,n,p]);return s.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:ct(va,a),ref:b,children:[s.jsx("div",{style:{borderTop:`solid ${N} ${v}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Te}),s.jsx("div",{className:"Tabs",ref:ne,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Pe,onScroll:ie=>{Ae({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:s.jsx(fa,{isDisabled:ie=>D||_,items:Z,strategy:na,modifiers:[ga],ref:Ce,renderItem:ee,renderDivider:I,onMove:pe,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(me)})]})}));rl.displayName="TabStrip";const Tn=o.createContext(null);Tn.displayName="DocThemesContext";const ba="_script-editor_iy654_5",xa={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"},qa=o.lazy(()=>Promise.resolve().then(()=>require("./Da611GSWMp5ncOGO.cjs")));let nn,on,Et=["define","require"],sr=!1,In="@0.7.27";In!=="@local"&&In!=="@0.0.0"||(In="");const Sa=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${In}/types/scripting.d.ts`,cr=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()),h=e.getPosition();let c={...h};c.lineNumber=1,c.column=1;let C=!1;for(let z=h.lineNumber;z>=1;z--)if(i.getLineContent(z).trim()===""){const D=To(f,i.getOffsetAt({lineNumber:z,column:1}),"function");if(!D||ka(D)){C=!0,c.lineNumber=z+1;break}{const _=D.spans[0].start;z=i.getPositionAt(_).lineNumber,c.lineNumber=z}}let M=n,y=!1;!C&&!M.startsWith(`
|
|
28
|
+
`)&&c.lineNumber>1&&(M=`
|
|
29
|
+
`+M,y=!0);let p=!1;i.getLineCount()>1&&(M.endsWith(`
|
|
30
30
|
|
|
31
|
-
`)||(
|
|
31
|
+
`)||(M+=`
|
|
32
32
|
|
|
33
|
-
`,p=!0));const M=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${k}`}];let T=null;i.pushEditOperations([],M,z=>(T=z[0].range,y&&T.startLineNumber++,p&&T.endLineNumber--,[new t.Selection(T.startLineNumber,T.startColumn,T.endLineNumber,T.endColumn)])),e.setSelection({startLineNumber:T.endLineNumber,startColumn:T.endColumn,endLineNumber:T.startLineNumber,endColumn:T.startColumn})};function Ra(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 vo(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:Ra(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)vo(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const h=a[f];if(h.start<=t&&t<h.start+h.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const c of e.childItems||[]){const C=To(c,t,n,i);if(C)return C}}return null}}function ka(e){return e.kind==="comment"}const Ma=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:h,autoFocus:c=!0,frame:C,onStatusChange:k,...y}=e,p=o.useRef(null),M=o.useRef(!1),T=o.useMemo(()=>({contains(ge){if(!p.current)return;const O=p.current.editor;return O&&O.getDomNode()?.contains(ge)},focus(){if(!p.current)return;const ge=p.current.editor;return ge&&ge.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",T,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),D=o.useMemo(()=>{let ge=null;const O=()=>T;return ge=a?a.createChildGroup(O,"scriptEditor",!1):new r.CommandGroup(O,"scriptEditor"),ge.addCommands(z,!0),ge},[a,z]),Z=a.getGroup("workbook"),K=r.useCommands(Z,["executeSelectedScript","saveScripts"]),w=K[0],N=K[1],v=w?.getContext(),[I,q]=o.useState({message:"Loading",cursor:"",dirty:!1}),[X,E]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),j=r.useCallbackRef(ge=>{q(O=>{const Fe={...O,...ge};return he.CommonUtils.deepEqual(Fe,O)?O:(N.update({disabled:!Fe.dirty}).updateCallback(async()=>{await $()}),Fe)})},[k,N]);o.useEffect(()=>{k?.(I)},[k,I]);const $=r.useCallbackRef(async()=>{if(!p.current)return;const ge=p.current.editor;let O;if(I.dirty){const Fe=ge.getValue();await v?.saveSource(Fe),O=v?.getScripts().getModules().getByName("scripts");const ze=O?.getSource(),H=ge.getValue(),W=(ze?.length??0)!==Fe.length||ze!==H;j({dirty:W})}else O=v?.getScripts().getModules().getByName("scripts");return O},[I]);o.useEffect(()=>{const ge=C?.addListener({onBeforeHide:async()=>(await $(),!0)});return()=>{ge?.()}},[C]),o.useEffect(()=>{const ge=v?.getScripts();if(ge)return ge.addListeners({onBeforeSearch:()=>$()})},[v]);const ve=r.useCallbackRef(ge=>{w?.execute(ge)},[w]),Y=o.useRef(""),[_,A]=o.useState(!1),J=r.useCallbackRef(async()=>{if(!p.current)return null;const ge=p.current,O=ge.editor;if(!O)return null;const Fe=ge.monaco,ze=await(async(H,W,me="export")=>{const ue=H.getModel();if(!ue)return null;const fe=await W.languages.typescript.getTypeScriptWorker(),Me=await fe(ue.uri),ae=await Me.getNavigationTree(ue.uri.toString());let be=null,g=H.getSelection();if(!g)return null;const Ne=g.startLineNumber===g.endLineNumber&&g.startColumn===g.endColumn?ue.getLineCount():Math.min(g.endLineNumber,ue.getLineCount());for(let Be=g.startLineNumber;!be&&Be<=Ne;Be++){const Te=To(ae,ue.getOffsetAt({lineNumber:Be,column:1}),"function",me);Te&&(be=Te.text)}return be})(O,Fe);return j({message:(ze??"").toUpperCase()}),ze?{source:O.getValue(),name:ze}:null},[]);r.useCallbackRef(he.CommonUtils.debounce($,200),[]);const x=r.useCallbackRef(async(ge,O,Fe)=>{E(H=>({...H,compiling:!0}));const ze=await v?.getScripts().createModule({source:Fe?.getValue(),declarationsOnly:!0});ze&&((async function(H,W){const me=[];for(let ue=1;ue<H.getLineCount()+1;ue++){const fe={startLineNumber:ue,startColumn:1,endLineNumber:ue,endColumn:H.getLineLength(ue)+1},Me=H.getValueInRange(fe).indexOf("modelt");Me!==-1&&me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:W.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Me+1,endLineNumber:fe.startLineNumber,endColumn:Me+5})}W.editor.setModelMarkers(H,"owner",me)})(ge,O),(async function(H,W,me,ue){const fe=await W.languages.typescript.getTypeScriptWorker(),Me=await fe(H.uri),ae=await Me.getNavigationTree(H.uri.toString()),be=vo(H,W,ue,ae).map(g=>{let Ne=null,Be=null;return g.type==="formula"?(Ne="formula.margin-icon",Be="Formula"):g.type==="macro"?(Ne="macro.margin-icon",Be="Macro"):g.type==="autoRun"&&(Ne="autorun.margin-icon",Be="Auto Run"),{range:new W.Range(g.lineNumber,1,g.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Ne,glyphMarginHoverMessage:{value:Be},stickiness:W.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});Pe.current&&Pe.current.clear(),Pe.current=me.createDecorationsCollection(be)})(ge,O,Fe,ze?ze.getFunctions().getItems():he.CommonUtils.EmptyArray),E(H=>({...H,compiling:!1})))},[v]),S=r.useCallbackRef(he.CommonUtils.debounce(x,580),[]),oe=r.useCallbackRef(async(ge=void 0)=>{if(!p.current||!v)return;const O=p.current.editor.getPosition(),Fe={cursor:O?O.toString():""};ge!==void 0&&(Fe.message=ge),j(Fe);const ze=J();v.setSelectedFunction(ze)},[v]);o.useEffect(()=>{},[X]);const ie=o.useRef(null),qe=r.useCallbackRef(async()=>{await $(),C?.close()},[C]);o.useEffect(()=>{if(!v)return;const ge={insertSnippet:Fe=>{p.current?.editor&&cr(p.current.editor,p.current.monaco,Fe)},close:()=>qe()};v.setEditor(ge),v.setSelectedFunction(J());const O=v.addContainerListener({onBeforeSave:async()=>{$()},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!v)return;const Fe=p.current.editor,ze=v.getScripts().getModules().getItems()[0]?.getSource()??"";Fe.setValue(ze)}});return()=>{v.setEditor(null),O()}},[v]),o.useEffect(()=>()=>{const ge=ie.current;if(ge){ge.dispose();const O=ge.debounceTimer;O!==void 0&&clearTimeout(O),ie.current=null}},[_]);const de=r.useCallbackRef(ge=>{const O=p.current?.editor;return!!O&&(O.focus(ge),!0)},[I]),Pe=o.useRef(null),je=r.useCallbackRef((ge,O)=>{p.current={monaco:O,editor:ge},A(!0),oe("Loading Types");const Fe=v?.getScripts().getModules().getItems()[0]?.getSource()??"";ge.setValue(Fe),Promise.resolve().then(()=>require("./CpAymN_r66WNSGto.cjs")).then(H=>H.customEditor).then(async H=>{oe(""),H.AutoTypings.create(ge,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:O,onUpdate:(W,me)=>{if(W.type==="LookedUpPackage"&&W.success!==void 0){const ue=O.languages.typescript.typescriptDefaults.getDiagnosticsOptions();O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ue,diagnosticCodesToIgnore:[]})}},onError:W=>{W==="Not implemented yet"&&(W="Compile Errors"),console.warn("Error compiling types",W)}}).then(W=>{ie.current=W;const me=ge.getModel();S(me,O,ge),(()=>{if(sr)return;const ue=(Me,ae)=>{try{if(ae===void 0)try{delete globalThis[Me]}catch{try{globalThis[Me]=void 0}catch{}}else globalThis[Me]=ae}catch{}},fe=Et.length;for(let Me=0;Me<fe;Me++){const ae=Et[Me];ue(ae,nn[ae])}nn=void 0,sr=!0})()})}),ge.addCommand("executeScript",function(H,...W){W?.[0]&&ve({functionName:W?.[0]})},""),ge.addAction({id:"executeScript",label:"Execute",keybindings:[O.KeyCode.F8],run:async H=>{const W=J();v?.setSelectedFunction(W);const me=await W;ve(me)}}),ge.addAction({id:"saveScript",label:"Save Script",keybindings:[O.KeyMod.CtrlCmd|O.KeyCode.KeyS],run:H=>{$()}}),ge.onMouseDown(async H=>{if(H.target.type===O.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const W=H.target.position.lineNumber,me=await O.languages.typescript.getTypeScriptWorker(),ue=await me(ze.uri),fe=await ue.getNavigationTree(ze.uri.toString()),Me=(await $()).getFunctions().getItems(),ae=vo(ze,O,Me,fe).find(be=>be.lineNumber===W);if(ae){const be=H.event.browserEvent.button;be===0?ae.type==="macro"||ae.type==="autoRun"?ve({functionName:ae.name}):ae.type==="formula"&&v?.quickInsertFunction?.(ae.name):be===2&&(console.log("Context menu for function:",ae.name),H.event.browserEvent.preventDefault())}}}),ge.onDidChangeModelContent(()=>{j({dirty:!0}),S(ze,O,ge)}),O.editor.onDidChangeMarkers(H=>{H.some(W=>W.toString()===ze.uri.toString())});const ze=ge.getModel();(function(H,W){W.languages.registerInlayHintsProvider("typescript",{provideInlayHints(me,ue,fe){const Me=[];for(let ae=1;ae<me.getLineCount()+1;ae++){const be={startLineNumber:ae,startColumn:1,endLineNumber:ae,endColumn:me.getLineLength(ae)+1},g="hint",Ne=me.getValueInRange(be).indexOf("hint");Ne!==-1&&Me.push({kind:W.languages.InlayHintKind.Type,position:{lineNumber:be.startLineNumber,column:Ne+g.length+1},label:"[hint]"})}return{hints:Me,dispose:()=>{}}}})})(0,O),ze.onDidChangeContent(H=>{const W=v?.getScripts().getModules().getByName("scripts"),me=W?.getSource(),ue=ge.getValue(),fe=(me?.length??0)!==ue.length||me!==ue;j({dirty:fe})}),ge.onDidChangeCursorPosition(H=>{oe()})},[v]),De=o.useMemo(()=>_?null:h||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[_,h]),Ie=o.useMemo(()=>{if(!_){if(!nn){nn={};const O=Et.length;for(let Fe=0;Fe<O;Fe++){const ze=Et[Fe];nn[ze]=globalThis[ze]}}if(on){const O=Et.length;for(let Fe=0;Fe<O;Fe++){const ze=Et[Fe];globalThis[ze]=on[ze]}}}const ge=v?.getScripts().getModules()?.getByName("scripts")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(o.Suspense,{children:s.jsx(qa,{theme:f?"extended-dark":"extended",options:{...xa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:ge,onValidate:O=>{let Fe=!1;const ze=O?O.length:0;for(let H=0;!Fe&&H<ze;H++)O[H].severity===8&&(Fe=!0)},beforeMount:O=>{O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),O.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),O.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),O.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Fe=!1,ze=!1;try{const H=await(async()=>await(await fetch(Sa)).text())(),W=O.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let me=O.editor.getModel(W);me?ze=!0:me=O.editor.createModel(H,"typescript",W),O.editor.setModelMarkers(me,"default",[]),Fe=!0}catch(H){console.warn("cant load types",H)}if(O.languages.registerLinkProvider("*",{provideLinks:(H,W)=>{const me=[],ue={links:me},fe=H.getLinesContent(),Me=fe.length;for(let ae=1;ae<=Me;ae++){const be=fe[ae-1],g=O.editor.tokenize(be,"typescript"),Ne=g[0].length;for(let Be=0;Be<Ne;Be++){const Te=g[0]?.[Be];if(Te&&Te.type.startsWith("string")){let u=Te.offset,L=g[0]?.[Be+1]?.offset??be.length,U=new O.Range(ae,u+1,ae,L+1),m=H.getValueInRange(U);const F=m[0];F!=="`"&&F!=="'"&&F!=='"'||(u++,m=m.substring(1));const G=m[m.length-1];G!=="`"&&G!=="'"&&G!=='"'||(u++,m=m.substring(0,m.length-1));try{v.getRanges(m)&&me.push({range:{endColumn:L,endLineNumber:ae,startColumn:u,startLineNumber:ae},tooltip:`Goto range '${m}'`,url:`/range/${m}`})}catch(te){console.warn(te)}}}}return ue}}),O.editor.registerLinkOpener({open(H){if(H?.path?.startsWith("/range/")){try{v.getRanges(H.path.substring(7))?.select()}catch(W){console.warn("invalid range",W)}return!0}return!1}}),!ze){const H=O.languages.typescript.typescriptDefaults.getCompilerOptions();O.languages.typescript.typescriptDefaults.setCompilerOptions({...H,target:O.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:O.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(Y.current&&(await cr(p.current.editor,p.current.monaco,Y.current),Y.current=null),M.current&&requestAnimationFrame(async()=>{M.current&&O.editor.focus()}),!on){on={};const H=Et.length;for(let W=0;W<H;W++){const me=Et[W];on[me]=globalThis[me]}}})()},onMount:je})}),De]})},[v,D,l,De,f]),ke=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:ge=>{de(ge)},close:()=>qe(),getEditor:()=>v?.getEditor()}),[v]);return o.useEffect(()=>(c&&requestAnimationFrame(()=>{ke.current?.focus()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{ke.current?.contains(document.activeElement)&&ke.current?.focus()})}),[]),s.jsx("div",{className:ct("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:ke,...y,children:Ie})})),Ta=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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),s.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"}),s.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"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),s.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=ii,exports.ChartLineIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=Ta,exports.CornerTriangle=uo,exports.DefaultTaskPaneRegistry=En,exports.DocThemesContext=Tn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return s.jsx(Tn.Provider,{value:t,children:n})},exports.EditableLabel=Tr,exports.EmptyFrame=Yl,exports.FilterButton=dr,exports.LogoNoPaddingIcon=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.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"}),s.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"}),s.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"}),s.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=vr,exports.MovableArea=xr,exports.PictureEditor=Mr,exports.ScriptEditor=Ma,exports.SheetCellEditor=gr,exports.SheetCellRenderer=ur,exports.SheetElement=kr,exports.SheetScrollbar=bo,exports.StaticBorderRenderer=xl,exports.StyledStrokePath=mr,exports.Tab=nl,exports.TabStrip=rl,exports.TaskPaneArea=El,exports.TaskPaneProvider=({children:e,renderArea:t,onUpdateArea:n,registry:i=En})=>{const a=o.useRef(null),l=o.useRef(null),[f,h]=o.useState(null),[c,C]=o.useState(null),k=r.useCallbackRef(p=>{const M=t({registry:i,onClose:()=>{C(null),n?.(null)},ref:T=>{T&&C(T)}});return n?.(M),M},[t,i,f]),y=o.useMemo(()=>({activateTaskPane(p,M){l.current!==p&&(a.current?a.current.activateTaskPane(p,M):(h(p),k(p)))}}),[]);return o.useEffect(()=>{c&&f&&(c.activateTaskPane(f,{autoFocus:!0}),h(null))},[f,c]),o.createElement(Cr.Provider,{value:c??y},e)},exports.TaskPaneStrip=wo,exports.TaskPaneTitle=yo,exports.createCellEditStateFromCell=hr,exports.useBordersOverlay=Co,exports.useDocThemes=()=>{const e=o.useContext(Tn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=qr,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 c={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(c)}const f=c=>{a.current?.(c)},h=e.getRange(t).addListener(f,i);if(l){const c=e.getRange(t);f({getSource:()=>c,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{h?.()}},[e,t])},exports.useSheetCommands=wr,exports.useSheetCopyPaste=br,exports.useTaskPaneArea=yr;
|
|
33
|
+
`,p=!0));const T=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${M}`}];let I=null;i.pushEditOperations([],T,z=>(I=z[0].range,y&&I.startLineNumber++,p&&I.endLineNumber--,[new t.Selection(I.startLineNumber,I.startColumn,I.endLineNumber,I.endColumn)])),e.setSelection({startLineNumber:I.endLineNumber,startColumn:I.endColumn,endLineNumber:I.startLineNumber,endColumn:I.startColumn})};function Ra(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 vo(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:Ra(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)vo(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const h=a[f];if(h.start<=t&&t<h.start+h.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const c of e.childItems||[]){const C=To(c,t,n,i);if(C)return C}}return null}}function ka(e){return e.kind==="comment"}const Ma=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:h,autoFocus:c=!0,frame:C,onStatusChange:M,...y}=e,p=o.useRef(null),T=o.useRef(!1),I=o.useMemo(()=>({contains(ue){if(!p.current)return;const O=p.current.editor;return O&&O.getDomNode()?.contains(ue)},focus(){if(!p.current)return;const ue=p.current.editor;return ue&&ue.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",I,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),D=o.useMemo(()=>{let ue=null;const O=()=>I;return ue=a?a.createChildGroup(O,"scriptEditor",!1):new r.CommandGroup(O,"scriptEditor"),ue.addCommands(z,!0),ue},[a,z]),_=a.getGroup("workbook"),$=r.useCommands(_,["executeSelectedScript","saveScripts"]),w=$[0],N=$[1],v=w?.getContext(),[E,q]=o.useState({message:"Loading",cursor:"",dirty:!1}),[Z,F]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),P=r.useCallbackRef(ue=>{q(O=>{const xe={...O,...ue};return ge.CommonUtils.deepEqual(xe,O)?O:(N.update({disabled:!xe.dirty}).updateCallback(async()=>{await W()}),xe)})},[M,N]);o.useEffect(()=>{M?.(E)},[M,E]);const W=r.useCallbackRef(async()=>{if(!p.current)return;const ue=p.current.editor;let O;if(E.dirty){const xe=ue.getValue();await v?.saveSource(xe),O=v?.getScripts().getModules().getByName("scripts");const Le=O?.getSource(),H=ue.getValue(),U=(Le?.length??0)!==xe.length||Le!==H;P({dirty:U})}else O=v?.getScripts().getModules().getByName("scripts");return O},[E]);o.useEffect(()=>{const ue=C?.addListener({onBeforeHide:async()=>(await W(),!0)});return()=>{ue?.()}},[C]),o.useEffect(()=>{const ue=v?.getScripts();if(ue)return ue.addListeners({onBeforeSearch:()=>W()})},[v]);const pe=r.useCallbackRef(ue=>{w?.execute(ue)},[w]),de=o.useRef(""),[le,R]=o.useState(!1),te=r.useCallbackRef(async()=>{if(!p.current)return null;const ue=p.current,O=ue.editor;if(!O)return null;const xe=ue.monaco,Le=await(async(H,U,he="export")=>{const ce=H.getModel();if(!ce)return null;const me=await U.languages.typescript.getTypeScriptWorker(),Te=await me(ce.uri),ie=await Te.getNavigationTree(ce.uri.toString());let qe=null,g=H.getSelection();if(!g)return null;const je=g.startLineNumber===g.endLineNumber&&g.startColumn===g.endColumn?ce.getLineCount():Math.min(g.endLineNumber,ce.getLineCount());for(let Be=g.startLineNumber;!qe&&Be<=je;Be++){const Ee=To(ie,ce.getOffsetAt({lineNumber:Be,column:1}),"function",he);Ee&&(qe=Ee.text)}return qe})(O,xe);return P({message:(Le??"").toUpperCase()}),Le?{source:O.getValue(),name:Le}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce(W,200),[]);const k=r.useCallbackRef(async(ue,O,xe)=>{F(H=>({...H,compiling:!0}));const Le=await v?.getScripts().createModule({source:xe?.getValue(),declarationsOnly:!0});Le&&((async function(H,U){const he=[];for(let ce=1;ce<H.getLineCount()+1;ce++){const me={startLineNumber:ce,startColumn:1,endLineNumber:ce,endColumn:H.getLineLength(ce)+1},Te=H.getValueInRange(me).indexOf("modelt");Te!==-1&&he.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:me.startLineNumber,startColumn:Te+1,endLineNumber:me.startLineNumber,endColumn:Te+5})}U.editor.setModelMarkers(H,"owner",he)})(ue,O),(async function(H,U,he,ce){const me=await U.languages.typescript.getTypeScriptWorker(),Te=await me(H.uri),ie=await Te.getNavigationTree(H.uri.toString()),qe=vo(H,U,ce,ie).map(g=>{let je=null,Be=null;return g.type==="formula"?(je="formula.margin-icon",Be="Formula"):g.type==="macro"?(je="macro.margin-icon",Be="Macro"):g.type==="autoRun"&&(je="autorun.margin-icon",Be="Auto Run"),{range:new U.Range(g.lineNumber,1,g.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:je,glyphMarginHoverMessage:{value:Be},stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ye.current&&ye.current.clear(),ye.current=he.createDecorationsCollection(qe)})(ue,O,xe,Le?Le.getFunctions().getItems():ge.CommonUtils.EmptyArray),F(H=>({...H,compiling:!1})))},[v]),b=r.useCallbackRef(ge.CommonUtils.debounce(k,580),[]),ee=r.useCallbackRef(async(ue=void 0)=>{if(!p.current||!v)return;const O=p.current.editor.getPosition(),xe={cursor:O?O.toString():""};ue!==void 0&&(xe.message=ue),P(xe);const Le=te();v.setSelectedFunction(Le)},[v]);o.useEffect(()=>{},[Z]);const ne=o.useRef(null),Re=r.useCallbackRef(async()=>{await W(),C?.close()},[C]);o.useEffect(()=>{if(!v)return;const ue={insertSnippet:xe=>{p.current?.editor&&cr(p.current.editor,p.current.monaco,xe)},close:()=>Re()};v.setEditor(ue),v.setSelectedFunction(te());const O=v.addContainerListener({onBeforeSave:async()=>{W()},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!v)return;const xe=p.current.editor,Le=v.getScripts().getModules().getItems()[0]?.getSource()??"";xe.setValue(Le)}});return()=>{v.setEditor(null),O()}},[v]),o.useEffect(()=>()=>{const ue=ne.current;if(ue){ue.dispose();const O=ue.debounceTimer;O!==void 0&&clearTimeout(O),ne.current=null}},[le]);const Ce=r.useCallbackRef(ue=>{const O=p.current?.editor;return!!O&&(O.focus(ue),!0)},[E]),ye=o.useRef(null),Pe=r.useCallbackRef((ue,O)=>{p.current={monaco:O,editor:ue},R(!0),ee("Loading Types");const xe=v?.getScripts().getModules().getItems()[0]?.getSource()??"";ue.setValue(xe),Promise.resolve().then(()=>require("./DNki9dGbSn_gUfd3.cjs")).then(H=>H.customEditor).then(async H=>{ee(""),H.AutoTypings.create(ue,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:O,onUpdate:(U,he)=>{if(U.type==="LookedUpPackage"&&U.success!==void 0){const ce=O.languages.typescript.typescriptDefaults.getDiagnosticsOptions();O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ce,diagnosticCodesToIgnore:[]})}},onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(U=>{ne.current=U;const he=ue.getModel();b(he,O,ue),(()=>{if(sr)return;const ce=(Te,ie)=>{try{if(ie===void 0)try{delete globalThis[Te]}catch{try{globalThis[Te]=void 0}catch{}}else globalThis[Te]=ie}catch{}},me=Et.length;for(let Te=0;Te<me;Te++){const ie=Et[Te];ce(ie,nn[ie])}nn=void 0,sr=!0})()})}),ue.addCommand("executeScript",function(H,...U){U?.[0]&&pe({functionName:U?.[0]})},""),ue.addAction({id:"executeScript",label:"Execute",keybindings:[O.KeyCode.F8],run:async H=>{const U=te();v?.setSelectedFunction(U);const he=await U;pe(he)}}),ue.addAction({id:"saveScript",label:"Save Script",keybindings:[O.KeyMod.CtrlCmd|O.KeyCode.KeyS],run:H=>{W()}}),ue.onMouseDown(async H=>{if(H.target.type===O.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=H.target.position.lineNumber,he=await O.languages.typescript.getTypeScriptWorker(),ce=await he(Le.uri),me=await ce.getNavigationTree(Le.uri.toString()),Te=(await W()).getFunctions().getItems(),ie=vo(Le,O,Te,me).find(qe=>qe.lineNumber===U);if(ie){const qe=H.event.browserEvent.button;qe===0?ie.type==="macro"||ie.type==="autoRun"?pe({functionName:ie.name}):ie.type==="formula"&&v?.quickInsertFunction?.(ie.name):qe===2&&(console.log("Context menu for function:",ie.name),H.event.browserEvent.preventDefault())}}}),ue.onDidChangeModelContent(()=>{P({dirty:!0}),b(Le,O,ue)}),O.editor.onDidChangeMarkers(H=>{H.some(U=>U.toString()===Le.uri.toString())});const Le=ue.getModel();(function(H,U){U.languages.registerInlayHintsProvider("typescript",{provideInlayHints(he,ce,me){const Te=[];for(let ie=1;ie<he.getLineCount()+1;ie++){const qe={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:he.getLineLength(ie)+1},g="hint",je=he.getValueInRange(qe).indexOf("hint");je!==-1&&Te.push({kind:U.languages.InlayHintKind.Type,position:{lineNumber:qe.startLineNumber,column:je+g.length+1},label:"[hint]"})}return{hints:Te,dispose:()=>{}}}})})(0,O),Le.onDidChangeContent(H=>{const U=v?.getScripts().getModules().getByName("scripts"),he=U?.getSource(),ce=ue.getValue(),me=(he?.length??0)!==ce.length||he!==ce;P({dirty:me})}),ue.onDidChangeCursorPosition(H=>{ee()})},[v]),ze=o.useMemo(()=>le?null:h||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[le,h]),Ae=o.useMemo(()=>{if(!le){if(!nn){nn={};const O=Et.length;for(let xe=0;xe<O;xe++){const Le=Et[xe];nn[Le]=globalThis[Le]}}if(on){const O=Et.length;for(let xe=0;xe<O;xe++){const Le=Et[xe];globalThis[Le]=on[Le]}}}const ue=v?.getScripts().getModules()?.getByName("scripts")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(o.Suspense,{children:s.jsx(qa,{theme:f?"extended-dark":"extended",options:{...xa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:ue,onValidate:O=>{let xe=!1;const Le=O?O.length:0;for(let H=0;!xe&&H<Le;H++)O[H].severity===8&&(xe=!0)},beforeMount:O=>{O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),O.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),O.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),O.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let xe=!1,Le=!1;try{const H=await(async()=>await(await fetch(Sa)).text())(),U=O.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let he=O.editor.getModel(U);he?Le=!0:he=O.editor.createModel(H,"typescript",U),O.editor.setModelMarkers(he,"default",[]),xe=!0}catch(H){console.warn("cant load types",H)}if(O.languages.registerLinkProvider("*",{provideLinks:(H,U)=>{const he=[],ce={links:he},me=H.getLinesContent(),Te=me.length;for(let ie=1;ie<=Te;ie++){const qe=me[ie-1],g=O.editor.tokenize(qe,"typescript"),je=g[0].length;for(let Be=0;Be<je;Be++){const Ee=g[0]?.[Be];if(Ee&&Ee.type.startsWith("string")){let u=Ee.offset,L=g[0]?.[Be+1]?.offset??qe.length,K=new O.Range(ie,u+1,ie,L+1),m=H.getValueInRange(K);const A=m[0];A!=="`"&&A!=="'"&&A!=='"'||(u++,m=m.substring(1));const G=m[m.length-1];G!=="`"&&G!=="'"&&G!=='"'||(u++,m=m.substring(0,m.length-1));try{v.getRanges(m)&&he.push({range:{endColumn:L,endLineNumber:ie,startColumn:u,startLineNumber:ie},tooltip:`Goto range '${m}'`,url:`/range/${m}`})}catch(J){console.warn(J)}}}}return ce}}),O.editor.registerLinkOpener({open(H){if(H?.path?.startsWith("/range/")){try{v.getRanges(H.path.substring(7))?.select()}catch(U){console.warn("invalid range",U)}return!0}return!1}}),!Le){const H=O.languages.typescript.typescriptDefaults.getCompilerOptions();O.languages.typescript.typescriptDefaults.setCompilerOptions({...H,target:O.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:O.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(de.current&&(await cr(p.current.editor,p.current.monaco,de.current),de.current=null),T.current&&requestAnimationFrame(async()=>{T.current&&O.editor.focus()}),!on){on={};const H=Et.length;for(let U=0;U<H;U++){const he=Et[U];on[he]=globalThis[he]}}})()},onMount:Pe})}),ze]})},[v,D,l,ze,f]),Ie=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:ue=>{Ce(ue)},close:()=>Re(),getEditor:()=>v?.getEditor()}),[v]);return o.useEffect(()=>(c&&requestAnimationFrame(()=>{Ie.current?.focus()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{Ie.current?.contains(document.activeElement)&&Ie.current?.focus()})}),[]),s.jsx("div",{className:ct("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Ie,...y,children:Ae})})),Ta=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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),s.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"}),s.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"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),s.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"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),s.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=ii,exports.ChartLineIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.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"}),s.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"}),s.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"}),s.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=Ta,exports.CornerTriangle=uo,exports.DefaultTaskPaneRegistry=En,exports.DocThemesContext=Tn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return s.jsx(Tn.Provider,{value:t,children:n})},exports.EditableLabel=Tr,exports.EmptyFrame=Yl,exports.FilterButton=dr,exports.LogoNoPaddingIcon=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.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"}),s.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"}),s.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"}),s.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=vr,exports.MovableArea=xr,exports.PictureEditor=Mr,exports.ScriptEditor=Ma,exports.SheetCellEditor=gr,exports.SheetCellRenderer=ur,exports.SheetElement=kr,exports.SheetScrollbar=bo,exports.StaticBorderRenderer=xl,exports.StyledStrokePath=mr,exports.Tab=nl,exports.TabStrip=rl,exports.TaskPaneArea=El,exports.TaskPaneProvider=({children:e,renderArea:t,onUpdateArea:n,registry:i=En})=>{const a=o.useRef(null),l=o.useRef(null),[f,h]=o.useState(null),[c,C]=o.useState(null),M=r.useCallbackRef(p=>{const T=t({registry:i,onClose:()=>{C(null),n?.(null)},ref:I=>{I&&C(I)}});return n?.(T),T},[t,i,f]),y=o.useMemo(()=>({activateTaskPane(p,T){l.current!==p&&(a.current?a.current.activateTaskPane(p,T):(h(p),M(p)))}}),[]);return o.useEffect(()=>{c&&f&&(c.activateTaskPane(f,{autoFocus:!0}),h(null))},[f,c]),o.createElement(Cr.Provider,{value:c??y},e)},exports.TaskPaneStrip=wo,exports.TaskPaneTitle=yo,exports.createCellEditStateFromCell=hr,exports.useBordersOverlay=Co,exports.useDocThemes=()=>{const e=o.useContext(Tn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=qr,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 c={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(c)}const f=c=>{a.current?.(c)},h=e.getRange(t).addListener(f,i);if(l){const c=e.getRange(t);f({getSource:()=>c,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{h?.()}},[e,t])},exports.useSheetCommands=wr,exports.useSheetCopyPaste=br,exports.useTaskPaneArea=yr;
|