@sheetxl/react 0.7.5 → 0.7.6

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.
@@ -1,33 +1,33 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._TaskPaneArea_1j53w_5{position:relative;display:flex;flex-direction:row;height:100%;width:100%}._TaskPaneTitle_1j53w_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_1j53w_13 .title{opacity:.87}._TaskPaneTitle_1j53w_13.focused .title{opacity:1}._TaskPaneFrame_1j53w_36{display:flex;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_1j53w_51{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:2px}._TaskPaneStripItem_1j53w_59{display:flex;flex-direction:row;align-items:center;padding:4px;border-radius:4px;border:grey solid 1px}._TaskPaneStripItem_1j53w_59.selected{font-weight:700}._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.5
3
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.7.6
4
4
  *
5
5
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
6
  * License: The license can be found at https://www.sheetxl.com/license.
7
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),me=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Lt=require("react-dom"),fn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),yl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:fn},Symbol.toStringTag,{value:"Module"})),Cr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),go=(e,t=!0,n=Cr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=me.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},wl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Cr,findNextFontSize:go},Symbol.toStringTag,{value:"Module"})),ho=o.memo(e=>{const{anchorLocation:t=me.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:C,fill:g,pathProps:s,style:f,...S}=e,p=a,h=l;let E="red",x=[],A=[];return t===me.AnchorLocation.TopLeft?(E=C?"rgb(255, 198, 246)":"green",x.push(h),A.push(h),x.push(h+p),A.push(h),x.push(h),A.push(h+p)):t===me.AnchorLocation.TopRight?(E=C?"rgb(0, 255, 255)":"red",x.push(n-h),A.push(h),x.push(n-(h+p)),A.push(h),x.push(n-h),A.push(h+p)):t===me.AnchorLocation.BottomRight?(E=C?"rgb(236, 252, 211)":"purple",x.push(n-h),A.push(i-h),x.push(n-(h+p)),A.push(i-h),x.push(n-h),A.push(i-(h+p))):t===me.AnchorLocation.BottomLeft&&(E=C?"rgb(255, 236, 183)":"blue",x.push(h),A.push(i-h),x.push(h+p),A.push(i-h),x.push(h),A.push(i-(h+p))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...f},...S,children:c.jsx("path",{d:`M ${x[0]} ${A[0]} L ${x[1]} ${A[1]} L ${x[2]} ${A[2]} L ${x[0]} ${A[0]} Z`,fill:g??E,...s})})}),br=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:C,style:g,...s}=e,f=o.useMemo(()=>{let E=null;const x=l.getSortField();x&&(E=x.reverse);const A=l.getField(),N=A&&A.criteria&&A.criteria.length>0;return E===!0?N?"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":E===!1?N?"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":N?"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.4533523,10.606423 2.2001838,4.9460198 2.966932,4.1188401 7.4533523,8.9589099 11.933438,4.1188401 12.700184,4.9460198"},[l]),[S,p]=o.useState(!1),h=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${h}px`,height:`${h}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${S&&!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:(h>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...g},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onMouseDown:E=>{C?.(E,l),E.preventDefault()},...s,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${S&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:f})})})},yr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:C,zoom:g=1,view:s,bodyStyle:f,normalStyle:S,showFormulas:p,showZeros:h,docTheme:E,onLinkMouseDown:x,onFilterButtonMouseDown:A,filterButtonProps:N,createFilterButton:K=br,...P}=e,R=i.height/g,O=i.width/g,m=t,q=m.getValue(),T=t.getStyle(),$=f?.darkMode??!1;let I,k;const Z=q&&q.isFormulaError,X=Z&&q instanceof d.FormulaError.Parse;let B,j=p||X;if(j)if(m.isSpillOverflow())k="";else{const De=m.getFormulaText();De?k=De:I=m.getNumberFormat(d.NumberFormat.Type.General)}else I=m.getNumberFormat();j||(B=m.getTextOverflow());const H=B?B.colBounds.width+B.leftOffset+B.rightOffset:O,J=B?B.anchorBounds.x-B.leftOffset:0,M=B?B.anchorBounds.width:O,U=B?B.anchorBounds.x:0;let ue,we=m.getRenderHorizontalAlignment();I&&(ue=I?.formattedRuns,k=ue?.runs[0]?.text??I.displayText);const je=m.getCalcStatus()===d.ICell.CalcStatus.Pending;let Te=null,ae=T.getFill().toCSS($,i),Me=0,Ke=0;if(!T.getBorder().isEmpty()){const De=T.getBorder().getRight();!De.isNone()&&d.IBorder.BuiltInDefinitions.get(De.getStyle()).width>1&&(Me=1);const D=T.getBorder().getBottom();!D.isNone()&&d.IBorder.BuiltInDefinitions.get(D.getStyle()).width>1&&(Ke=1)}let Ee=null;if(O!==M||Me||Ke||typeof ae?.backgroundPosition=="number"){const{backgroundPosition:De,...D}=ae,ee=De??0,L=s?.getScrollTopLeft(),G=ee?-(i.x+(L.left??0))%ee:0,u=ee?-(i.y+(L.top??0))%ee:0;(De!==void 0||Me||Ke||O!==M)&&(Object.keys(D).length===1&&D.background==="none"||(ae=null,Ee=c.jsx("div",{className:"fill",style:{marginLeft:`${G}px`,marginTop:`${u}px`,left:U*g,width:r.ReactUtils.boundPixel(M*g-G+1+Me),height:r.ReactUtils.boundPixel(i.height-u+1+Ke),...D}},"background")))}let Ue=null;const re=m.getComments(),te=m.getWarnings(),pe=m.getErrors();if(re||Z||pe.length>0||te.length>0){const De={size:7*g,darkMode:$,cellWidth:M*g+2,cellHeight:R*g+2,style:{top:-1,left:U*g-1}};Ue=Ue??[],(te.length>0||pe.length>0||Z)&&Ue.push(c.jsx(ho,{anchorLocation:me.AnchorLocation.TopLeft,...De},`indicator-${Ue.length}`)),re&&Ue.push(c.jsx(ho,{anchorLocation:me.AnchorLocation.TopRight,...De},`indicator-${Ue.length}`))}const Le=T.getFont();let Y=I?.conditionalColor;const W=T.getAlignment(),le=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,fe=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||le,ce=fe||j?0:W.getRotation(),Se=m.getInsets(),ie=Se.top+Se.bottom;let ve=Se.left,xe=Se.right;const Re={...l,left:l.left-1,top:l.top-1,width:l.width+1+Me,height:l.height+1+Ke},b=m.getColumnFilter(),Fe=b&&!b?.hasHiddenButton();let Ze=null;je&&(Ze=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const ze=!(je||Fe||Ee||a||Ue||ue?.runs.length>1||B||ce%360!=0);ae?.background==="none"&&(ae=null);let et=fe||!(!B||!(B.rightIndex>0||B.leftIndex>0||B.colSpan>1));if(!et){const De=m.getSpans();(De.width>1||De.height>1)&&(et=!0)}const oe={...ae,...Re,pointerEvents:x?"auto":void 0};if(!me.CommonUtils.isEmpty(k)||!me.CommonUtils.isEmpty(I?.repeatPlaceholder)){const De=I?.canWrap??!1;let D=null,ee=null,L=null,G=[],u=!0;h||j||q!==0||(u=!1);const w=m.getTextFrame(j);if(u&&w){let F=H-1-(ve+xe);if(ce){D=w.layout().bounds;const Ce={x:0,y:0,width:H-1,height:R};if(ue){let be=ue.width;if(I.repeatPlaceholder||I.repeatChars.length>0){const he=d.GeomUtils.boundsToPoints(Ce),Ie=d.GeomUtils.rotatePoints(he,-ce);be=d.GeomUtils.minBoundingRect(Ie).width}D={...D,width:be}}L=d.GeomUtils.clipToOuterRect({...D,width:D.width+1+ve+xe},Ce,ce),F=L.width-1-(ve+xe)+.01}let v=null;De&&(v={width:F});let z=null,y=I?.repeatPlaceholder;const V=w.layout(v);if(D=V.bounds,j?D={...D,width:0}:ue&&(D={...D,width:I.repeatPlaceholder||I.repeatChars.length>0?F:ue.width}),ce&&De){let ge=null;V.visitLines({visitTextLine:(Ce,be)=>{let he=Ce.bounds;const Ie=d.GeomUtils.boundsToPoints(he),Be=d.GeomUtils.rotatePoints(Ie,ce),Ne=d.GeomUtils.minBoundingRect(Be);he={...he,x:(Ne.width-he.width)/2,y:(Ne.height-he.height)/2},ge=ge?d.GeomUtils.unionBounds(ge,he):he}}),D={...ge,width:ge.width+ve+xe}}if(!y&&m.getType()!==d.ScalarType.String&&Math.floor(D.width)>F){if(T.getNumberFormat()==="General"&&m.getType()===d.ScalarType.Number){const ge=T.measureText("0"),Ce=Math.floor(F/ge.width),be=q,he=me.CommonUtils.splitNumber(be),Ie=Math.min(10,Ce-(Math.max(1,he.ipLength)+1)-(be<0?1:0));if(Ie>=-1){const Be=`0${Ie>0?".":""}${"#".repeat(Math.max(0,Ie))}`;z=m.getNumberFormat(Be).displayText,z==="0"&&be<0&&(z="-0")}else if(Math.abs(be)>=Math.pow(10,5)||Math.abs(be)<=Math.pow(10,-5)){const Be=Ce-5-(be<0?1:0);if(Be>=0){const Ne=`0.${"0".repeat(Math.max(0,Be-1))}E+00`;z=m.getNumberFormat(Ne).displayText}}}z||(y="#")}if(!y&&ue?.lastRepeatIndex>=0&&ue?.width>F&&(y="#"),y&&F>0){const ge=T.measureText(y),Ce=Math.floor((F||1)/(ge?.width||1));z=Ce>0?y.repeat(Ce):"",we=d.ITextFrame.HorizontalAlignment.Center}if(j&&(we=d.ITextFrame.HorizontalAlignment.Left),z){const ge=T.measureText(z).width;ge&&(D={...D,width:ge})}if(ee={...D,width:D.width+ve+xe,height:D.height},ce&&!De){const ge=d.GeomUtils.boundsToPoints(ee),Ce=d.GeomUtils.rotatePoints(ge,ce),be=d.GeomUtils.minBoundingRect(Ce);ee.width=be.width,ee.height=be.height}we===d.ITextFrame.HorizontalAlignment.Center||we===d.ITextFrame.HorizontalAlignment.CenterContinuous?ee.x=(H-ee.width)/2:we===d.ITextFrame.HorizontalAlignment.Right?ee.x=H-ee.width-.5:ee.x=.5,W.getVertical()===d.ITextFrame.VerticalAlignment.Center?ee.y=(R-ee.height)/2:W.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?ee.y=R-ee.height-ie:ee.y=ie;const _=ze?{...P}:void 0,Q={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:ce?`rotate(${ce}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:et?1:void 0,...ae},onMouseDown:x,onDoubleClick:x?ge=>{ge.stopPropagation(),ge.preventDefault()}:null,..._};X&&(Q.style.textDecorationStyle="wavy",Q.style.textDecorationColor=$?"rgb(0, 255, 255)":"red",Q.style.textDecorationLine="underline");const se=Le.getSize(),de=(ge,Ce,be,he,Ie,Be,Ne,Ve=null)=>{let $e=se*g,_e=be,Oe=Ne?.runs?Ne.runs:[{type:d.NumberFormat.ParseRunType.Text,text:ge,width:T.measureText(ge,$e).width}];Ne&&Ne?.width!==D.width&&(D={...D,width:Ne?.width});let Ye=ve;if(Ne?.lastRepeatIndex>=0&&F>Ne?.width){const Ge=Ne.runs[Ne.lastRepeatIndex];if(Ge){const ot=[...Oe],pt=Math.max(0,F-1-Ne.width);let wt=0,vt="";if(pt>0){const gt=Math.floor(pt/Ge.width);vt=gt>0?Ge.text.repeat(gt):"",wt=pt}ot[Ne.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:vt,width:wt},Oe=ot,D={...D,width:Ne.width+wt}}}const at=(Ge,ot,pt,wt,vt,gt,it,Et,Bt,Qt=null)=>{let Dt,en=_e.width;Ie===d.ITextFrame.HorizontalAlignment.Justify?(en=vt,Be||(Dt="justify")):Ie===d.ITextFrame.HorizontalAlignment.Distributed&&(en=vt,Dt=Be||Ge.text.split(" ").length-1==0?"center":"justify");const{style:It,className:xn,...Ct}=Qt;let Vt=Ge.text;if(Ie===d.ITextFrame.HorizontalAlignment.Fill&&I?.repeatChars.length===0){const st=Math.max(1,Math.floor((_e?.width??0)/(it?.width??1)));Vt=Vt.repeat(st)}let tn=_e.height;const Mt=Le.getVerticalAlignment(),zt=Mt===d.IFont.VerticalAlignment.Sub,qn=Mt===d.IFont.VerticalAlignment.Super;if(zt||qn){const st=Le.getSuperSubScale();$e*=st,tn*=st}const tt={textAlign:Dt,textAlignLast:Dt,...It,...Le.toCSS($,g,!0),fontSize:$e*d.IFont.getDeviceScale()};ze||(tt.background=void 0),Y&&(tt.color=Y.toCSS($));const Sn=Ye+ot;let Pt=Se.top+_e.y+0;if(zt&&(Pt+=Bt-$e),gt){const st=(it.x+Sn)*g+1,mt=(it.y+Pt)*g+1;mt<0?tt.marginTop=mt:tt.paddingTop=mt,st<0?(tt.width=(It?.width??0)-st,tt.left=(It?.left??0)+st):tt.paddingLeft=st,tt.paddingRight=Math.max(0,(It?.width??0)-en*g-st),tt.paddingBottom=Math.max(0,(It?.height??0)-_e.height*g-mt),tt.height=(It?.height??0)+(mt<0?-mt:0),(mt<0||st<0)&&(tt.clipPath=`inset(${mt<0?-mt:0}px 0px 0px ${st<0?1-st:0}px)`)}else if(tt.left=(it.x+Sn)*g+1,tt.top=(it.y+Pt)*g+1,tt.width=it.width*g,tt.height=it.height*g,ce&&!De){tt.left=(it.x+ot)*g+1,tt.top=(it.y+(_e.y+0))*g+1;const st=d.GeomUtils.centerPoint({x:Ye+ot,y:0,width:Ge.width,height:_e.height}),mt=d.GeomUtils.centerPoint({x:Ye,y:0,width:vt,height:_e.height}),on=d.GeomUtils.rotatePoints([st],ce,mt),rn={x:on[0].x-st.x,y:on[0].y-st.y};tt.left=tt.left+rn.x*g,tt.top=tt.top+rn.y*g;const Ht={..._e,x:Ye,y:Se.top,width:_e.width+(ve+xe)},Wn=d.GeomUtils.boundsToPoints(Ht),Gn=d.GeomUtils.rotatePoints(Wn,ce),Ut=d.GeomUtils.minBoundingRect(Gn);Ht.width=Ut.width,Ht.height=Ut.height;const Rn=d.GeomUtils.centerPoint(Ht),Kt={x:Rn.x-mt.x,y:Rn.y-mt.y};tt.left=tt.left+Kt.x*g,tt.top=tt.top+Kt.y*g}tt.lineHeight=tn*g+"px";const nn=ze?void 0:"text-line";G.push(c.jsx("div",{className:xn?`${xn} ${nn}`:nn,style:tt,...Ct,children:Vt},`text-${_e.y}-${wt}-${pt}`))};if(W.getOverflow()===d.ITextFrame.Overflow.Shrink&&F>0){let Ge=D?.width??0,ot=0;for(;Ge>1&&Ge>F&&$e>2&&ot<100;)$e*=F/Ge,Ge=T.measureText(ge,$e).width,ot++;D={...D,width:Ge}}let ht=_e.x;Ie===d.ITextFrame.HorizontalAlignment.Right?ht+=D.width-_e.width:Ie!==d.ITextFrame.HorizontalAlignment.Center&&Ie!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(ht+=(D.width-_e.width)/2),Ne?.lastRepeatIndex>=0&&(ht=_e.x);const qt=Oe.length;for(let Ge=0;Ge<qt;Ge++){const ot=Oe[Ge];(ot.type===d.NumberFormat.ParseRunType.Text||ot.type===d.NumberFormat.ParseRunType.Repeat)&&(ot.type,d.NumberFormat.ParseRunType.Repeat,at(ot,ht,Ge,Ce,Ie===d.ITextFrame.HorizontalAlignment.Justify||Ie===d.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?F:_e.width,ze,{x:ee.x+J,y:ee.y,width:ot.width,height:D.height},0,he,Ve)),ht+=ot.width}};z?de(z,0,{x:0,y:0,...D},V.lines[0].baseline,we,!0,null,Q):V.visitLines({visitTextLine:(ge,Ce,be)=>{const he=ge.runs[0].text.replace(/\s+$/,""),Ie=Ce===be-1;let Be=we===d.ITextFrame.HorizontalAlignment.Justify&&(Ie||ge.runs[0].text.endsWith(`
8
- `))?d.ITextFrame.HorizontalAlignment.Left:we,Ne=0;Ce>0&&(W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||W.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(R-(ie+3)-ge.bounds.height*be)/(be-1)*Ce)),W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&ce&&ce%90==0&&ce%180!=0&&(Be=d.ITextFrame.HorizontalAlignment.Distributed),Be!==d.ITextFrame.HorizontalAlignment.Justify&&Be!==d.ITextFrame.HorizontalAlignment.Distributed&&Be!==d.ITextFrame.HorizontalAlignment.Fill||(D={...D,width:F});let Ve=le||I&&(I.repeatChars.length>0||I.spacingChars.length>0)?D.width:ge.bounds.width;const $e={...ge.bounds,y:ge.bounds.y+Ne+0,width:Ve};de(he,Ce,$e,w.lines[0].baseline,Be,Ie,be===1?ue:null,ze&&Ce>0?{...Q,style:{...Q.style,background:void 0}}:Q)}})}G.length>0&&(Te=G)}if(ze)return Te&&Te.length>0?Te:c.jsx("div",{style:oe,...P});let ke=x?"auto":Re.pointerEvents,Ae=null;if(Fe){const De={x:U*g-1,y:-1,width:M*g+1,height:R*g+1};ke="auto",Ae=K({renderBounds:De,darkMode:$,className:"filter-button",disabled:!m.isEditAllowed(),zoom:g,filter:m.getColumnFilter(),onFilterButtonMouseDown:A,...N}),Ae&&(Ae=c.jsx("div",{style:{...De,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:D=>{D.stopPropagation(),D.preventDefault()},children:Ae},"filterButton"))}je&&!Te&&(Te=c.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ye=[Ee,Te,a,Ue,Ze,Ae];return c.jsx("div",{style:{...ae,...Re,pointerEvents:ke},...P,children:ye})},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)))},xl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),wr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:C,onDoneEdit:g,defaultTextStyle:s,useRichStyling:f=!0,bodyStyle:S,activeCoords:p,sheet:h,commands:E,containerBounds:x,setNaturalDimensions:A,onFocus:N,disabled:K,style:P,zoom:R=1,linesVisible:O,autoFocus:m=!1,...q}=e,{height:T=0,width:$=0}=x??{},I=S?.darkMode??!1,k=o.useRef(null),[Z,X]=o.useState(!1),[B,j]=o.useState(null),[H,J]=o.useState(()=>n);o.useEffect(()=>{Ke.current=!1,J(n)},[n]);const M=o.useMemo(()=>{const D=H.clean();let ee=D.getStyle();f||(ee=ee.createTemporaryStyle({font:{size:s?.fontSize}}));const L=D.getFormula(),G=ee.getAlignment(),u=L?d.ITextFrame.HorizontalAlignment.Left:G.getHorizontal(),w=G.getVertical(),F=G.getOverflow()===d.ITextFrame.Overflow.Wrap||D.getType()===d.ScalarType.String&&(u===d.ITextFrame.HorizontalAlignment.Justify||u===d.ITextFrame.HorizontalAlignment.Distributed||w===d.ITextFrame.VerticalAlignment.Justify||w===d.ITextFrame.VerticalAlignment.Distributed),v=(V=>{if(!V)return Ao;const _=V.clean();if(!_)return Ao;let Q=_.getStyle()?.getQuotePrefix();if(V.dirty===void 0||V.dirty===null){let se="",de=_.getFormulaText();de&&(se=de,Q=!1),se||(se=_.toTextUnformatted(!0)??"");let ge="";if(!V.editMode&&_.isSpillOverflow()){const Ce=_.getSpill();if(Ce){const be=Ce.getCell(),he=be.getFormulaText();be.isEqual(_)||(ge=he)}}return Q&&(se="'"+se),{text:se,placeholder:ge}}return{text:V.dirty??"",placeholder:""}})(H),z=v.text,y=d.ITextFrame.toCSSHorizontalTextAlign(f&&!L?H.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:ee,isWrapped:F,textValue:z,formula:L,frameVertAlign:w,placeholder:v.placeholder,insets:f?D.getInsets():me.TypesUtils.EmptyRect,textAlign:y}},[H,s,I,R,f]),U=o.useRef(null),ue=r.useImperativeElement(t,()=>({startEdit:D=>{k.current=D?.initialSelection;const ee={...n,editMode:D?.editMode??!1};D?.text!==void 0&&(ee.dirty=D.text),ee.editMode===n.editMode&&ee.dirty===n.dirty||(J(ee),Te?.(ee))},submitEdit:()=>Ee(),cancelEdit(){Ue()},autoFocus(){U.current.focus()},dispatchEvent:D=>U.current.dispatchEvent(D),focus(){U.current.focus()},getLineHeight:je}),[i,n]);o.useLayoutEffect(()=>{if(!B||!Z)return;const D=U.current;M.textValue,D&&D.setSelectionRange(B.start,B.end,B.direction)},[U.current,B,M.textValue]);const we=o.useMemo(()=>{const D=H?.clean(),ee=M.style.createTemporaryTextFrame(M.textValue,D?.getType()===d.ScalarType.String),L=f?D.getInsets().right+D.getInsets().left:0;let G=null;return M.isWrapped&&(G={width:$-L}),ee.layout(G)},[M,$,H,f]),je=r.useCallbackRef(()=>Math.ceil(we?.lines[0]?.bounds.height),[we]);o.useLayoutEffect(()=>{if(!we)return;const D=M.style,ee=D.getInsets()??me.TypesUtils.EmptyRect,L=f?ee.left+ee.right:0,G=f?.04*D.getFont().getSize():1,u=Math.round(M.isWrapped?void 0:we.bounds.width+L+G),w=Math.round(we.bounds.height);A?.({width:u,height:w})},[we,A,M,f,H]);const Te=r.useCallbackRef(a,[a]),ae=r.useCallbackRef(D=>{if(H.dirty===D)return;const ee={...H};ee.dirty=D,U.current,J(ee),Te?.(ee)},[H]),Me=r.useCallbackRef(D=>{if(H.editMode===D)return;const ee={...H};ee.editMode=D,J(ee),Te?.(ee)},[H]),Ke=o.useRef(!1),Ee=r.useCallbackRef(()=>{if(Ke.current)return!1;try{l?.(H),g?.(),Ke.current=!0}catch{return!1}return!0},[l,H]),Ue=r.useCallbackRef(()=>{Ke.current=!0,J(n),C?.(),g?.()},[C,n]),re=r.useCallbackRef(D=>{if(!U.current)return;if(D.key,D.isDefaultPrevented(),!(D.isTrusted||D.nativeEvent.ctrlKey||D.nativeEvent.metaKey||D.nativeEvent.altKey||D.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(D.nativeEvent.key)===-1&&D.nativeEvent.key!=="Backspace")){const v={...H};let z=0;return Do(v,v.dirty)&&!isNaN(parseFloat(D.key))?(v.dirty?.endsWith("%")?v.dirty=(v.dirty.substring(0,v.dirty.length-1)??"")+D.key+"%":v.dirty=(v.dirty??"")+D.key+"%",z=v.dirty.length-1):D.nativeEvent.key==="Backspace"?(v.dirty="",z=v.dirty.length):(v.dirty=(v.dirty??"")+D.key,z=v.dirty.length),U.current.value=v?.dirty,k.current={start:z,end:z,direction:"forward"},U.current?.setSelectionRange(z,z,"forward"),J(v),Te?.(v),void D.preventDefault()}const ee=D.nativeEvent.ctrlKey,L=D.nativeEvent.shiftKey,G=D.nativeEvent.altKey,u=D.nativeEvent.metaKey;if(ee&&D.key==="z"&&D.stopPropagation(),D.which===r.KeyCodes.Escape)return D.preventDefault(),void Ue();if(D.which===r.KeyCodes.F2)return Me(!0),void D.preventDefault();const w=D.target;if(D.key==="%"&&w.selectionStart===w.selectionEnd&&w.value[w.selectionStart]==="%"&&H?.clean().getStyle().numberFormat.includes("%"))return j({start:w.selectionStart+1,end:w.selectionEnd+1,direction:w.selectionDirection}),void D.preventDefault();if(D.which===r.KeyCodes.Enter){if(D.preventDefault(),u||G){const v=M.textValue.substring(0,w.selectionStart)+`
9
- `+M.textValue.substring(w.selectionEnd);return ae(v),void j({start:w.selectionStart+1,end:w.selectionStart+1,direction:w.selectionDirection})}return void(Ee()&&h.getSelection().traverse(d.IRange.Orientation.Column,L))}if(D.which===r.KeyCodes.Tab)return D.preventDefault(),void(Ee()&&h.getSelection().traverse(d.IRange.Orientation.Row,L));let F=null;switch(D.which){case r.KeyCodes.Left:F=d.IRange.Direction.Left;break;case r.KeyCodes.Right:F=d.IRange.Direction.Right;break;case r.KeyCodes.Up:F=d.IRange.Direction.Up;break;case r.KeyCodes.Down:F=d.IRange.Direction.Down}if(F&&!(ee||L||G||u)&&!H.editMode)return void Ee();H.editMode&&(F||xl.includes(D.which))&&D.stopPropagation()},[H,h,M]),te=o.useCallback(()=>{U.current?.focus(),setTimeout(()=>{U.current?.select()},0)},[]),pe=o.useCallback(()=>{U.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Le=r.useCallbackRef(()=>{const D=U.current?.value;let ee="";if(p.rowIndex>0){const L=h.getRange({rowIndex:p.rowIndex-1,colIndex:p.colIndex}).getCell();L&&(ee=L.toTextUnformatted(!0))}ae(D+ee)},[p,h]);o.useEffect(()=>h.getRange(p).addListener(()=>{const D={...H,clean:()=>h.getRange(p).getCell()};J(D),Te?.(D)}),[p,h,H]);const Y=o.useCallback(()=>{const D=H.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText();ae((U.current?.value??"")+D)},[h]),W=o.useCallback(()=>{const D=H.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText();ae((U.current?.value??"")+D)},[h]),le=o.useMemo(()=>({element:()=>U.current,doCopy:D=>{const ee=U.current.value.substring(U.current.selectionStart,U.current.selectionEnd);if(D?.isCut){const L=U.current.value.substring(0,U.current.selectionStart)+U.current.value.substring(U.current.selectionEnd,U.current.value.length);ae(L)}return ee}}),[U.current]),fe=o.useMemo(()=>({element:()=>U.current,doPaste:async(D,ee)=>{const L=await D.toText?.();if(!L)return!0;const G=U.current.value.substring(0,U.current.selectionStart)+L+U.current.value.substring(U.current.selectionEnd,U.current.value.length);return ae(G),j({start:U.current.selectionStart+L.length,end:U.current.selectionStart+L.length,direction:"forward"}),!0}}),[U.current]),ce=o.useMemo(()=>({contains:D=>U.current?.contains(D)||!1,focus(){U.current.focus()}}),[]),Se=o.useMemo(()=>[new r.SimpleCommand("selectAll",ce,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},te),new r.SimpleCommand("startEditValueAbove",ce,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Le),new r.SimpleCommand("startEditCurrentTime",ce,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},Y),new r.SimpleCommand("startEditCurrentDate",ce,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.Command("relativeReferencesToggle",ce,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},pe),new r.Command("toggleEditorFocus",ce,{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 D=null;const ee=()=>({contains:L=>U.current?.contains(L)||!1,focus(){U.current.focus()}});return D=E?E.createChildGroup(ee,"editor",!1):new r.CommandGroup(ee,"editor"),D.addCommands(Se,!0),D},[E,Se]),ve=o.useMemo(()=>({notifier:null,source:le,target:fe,commands:ie}),[le,fe,ie]);r.useCopyPaste(ve);const[xe,Re]=o.useState(!m);o.useEffect(()=>{Re(!1)},[]);const b=r.useCallbackRef(D=>{X(!0),ie?.activate();const ee=k.current;if(ee!==!1){let L,G;const u=U.current.value;Do(H,u)&&(L=u.length-1,G=u.length-1),L=ee?.start??L??u.length,G=ee?.end??G??u.length,k.current=!1,j({start:L,end:G,direction:"forward"})}N?.(D)},[N,H]),Fe=M.insets;let Ze=Fe.left+1;const ze=Fe.left+Fe.right+2-1,et=we?.bounds.height??0;let oe,ke=Fe.top;M.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?ke=Math.max(0,(T-(Fe.top+Fe.bottom)-et)/2):M.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(ke=Math.max(0,T-(Fe.top+Fe.bottom)-et)),O!==void 0&&we?.lines[0]?.bounds&&(oe=we?.lines[0]?.bounds.height*O);const Ae=M.style.getFont();let ye=Ae.getSize();Ae.isSuperSub()&&(ye*=Ae.getSuperSubScale()),ye*=d.IFont.getDeviceScale()*R;const De=f?Ae.toCSS(I,R):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:D=>{U.current&&document.activeElement!==U.current&&requestAnimationFrame(()=>{U.current.focus()})},ref:ue,...q,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...P},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ke*R+1,left:Ze*R,width:`calc(100% - ${ze*R}px)`,maxWidth:`calc(100% - ${ze*R}px)`,height:(oe??et)*R,maxHeight:(oe??et)*R},children:c.jsx("textarea",{spellCheck:"false",placeholder:M.placeholder,ref:U,value:M.textValue,disabled:xe,readOnly:K||h.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...De,fontSize:ye?`${ye}px`:"inherit",textAlign:M.textAlign,lineHeight:(we?.lines[0]?.bounds.height??0)*R+"px",height:(we?.bounds.height??0)*R,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:M.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:b,onBlur:()=>{X(!1)},onSelect:D=>{},onChange:D=>{U.current&&!Ke.current&&(k.current=!1,ae(D.target.value),M.textValue,D.target.value,D.target.selectionStart,D.target.selectionEnd,D.target.selectionDirection,j({start:D.target.selectionStart,end:D.target.selectionEnd,direction:D.target.selectionDirection}))},onMouseDown:D=>{Z&&Me(!0)},onKeyDown:re})})})})),xr=(e,t)=>({clean:e,dirty:t,editMode:!1}),qr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:C=!1,offsetX:g=0,offsetY:s=0,isVertical:f=!1,...S}=e,p=P=>{let R=null;if(P&&n>0){R="";for(let O=0;O<P.length;O++)R+=P[O],O<P.length-1&&(R+=",")}return R},h=p(i);let E=h;a&&(E=p(a));let x=n,A=t,N=null;if(l){x=Math.floor(n/2);const P=x+x/2+1;let R=null;R=f?`M ${r.ReactUtils.boundPixel(g+P)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(g+P)} ${r.ReactUtils.boundPixel(s+A)}`:`M ${r.ReactUtils.boundPixel(g)} ${r.ReactUtils.boundPixel(s+P)} L ${r.ReactUtils.boundPixel(g+A)} ${r.ReactUtils.boundPixel(s+P)}`,N=c.jsx("path",{strokeWidth:x,strokeDasharray:E,d:R,...S})}if(C){x=n/2;const P=x+x/2;let R=E,O=null;O=f?`M ${r.ReactUtils.boundPixel(g+P)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(g+P)} ${r.ReactUtils.boundPixel(s+A)}`:`M ${r.ReactUtils.boundPixel(g)} ${r.ReactUtils.boundPixel(s+P)} L ${r.ReactUtils.boundPixel(g+A)} ${r.ReactUtils.boundPixel(s+P)}`,N=c.jsx("path",{strokeWidth:x,strokeDasharray:R,strokeDashoffset:"1",shapeRendering:"crispEdges",d:O,...S})}let K=null;return K=f?`M ${r.ReactUtils.boundPixel(g+x/2)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(g+x/2)} ${r.ReactUtils.boundPixel(s+A)}`:`M ${r.ReactUtils.boundPixel(g)} ${r.ReactUtils.boundPixel(s+x/2)} L ${r.ReactUtils.boundPixel(g+A)} ${r.ReactUtils.boundPixel(s+x/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:x,strokeDasharray:h,d:K,...S}),N]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Xt=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)}},ql=function(){},Sr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sl=Sr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ot=Sr&&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],C=o.useMemo(function(){return new window.ResizeObserver(function(g){if(g[0]){var s=g[0].contentRect,f=s.x,S=s.y,p=s.width,h=s.height,E=s.top,x=s.left,A=s.bottom,N=s.right;l({x:f,y:S,width:p,height:h,top:E,left:x,bottom:A,right:N})}})},[]);return Sl(function(){if(t)return C.observe(t),function(){C.disconnect()}},[t]),[n,a]}:function(){return[ql,zo]},Rl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,kl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Ml=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:C=!1,shiftIfWide:g=!1,isVertical:s=!1,intersections:f,layout:S}=e,p=d.IBorder.BuiltInDefinitions.get(C?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!p)return null;const h=n[0],E=n[1],x=n[2],A=n[3];let N=1+(s?A-E:x-h),K=0;const P=a.getColor().toRGBA(l).toString(),R=p.description.toLowerCase().includes("double");let O,m;const q=s?"rowStart":"colStart",T=s?"rowEnd":"colEnd",$=s?E:h;if(f?.length>0){const X=f[0];if(X?.range[q]===i[q]){const j=d.IBorder.BuiltInDefinitions.get(X.stroke.getStyle());K=Math.floor(j.width/2)}if(f[f.length-1]?.range[T]===i[T]){const j=d.IBorder.BuiltInDefinitions.get(f[f.length-1].stroke.getStyle());N=Math.floor(N+(j.width===2?0:j.width/2))}if(R){const j=s?"colStart":"rowStart",H=s?"colEnd":"rowEnd",J=s?S?.getRowOffset:S?.getColOffset;let M=0,U=0;O=[],m=[];for(let ue=0;ue<f.length;ue++){const we=f[ue];if(we.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&J){const je=J(we.range[q])-($-K);we.range[j]<i[j]&&(O.push(je-M),M=je,O.push(1),M++),we.range[H]>i[H]&&(m.push(je-U),U=je,m.push(1),U++)}}O.length>0&&M<N&&O.push(N-M),m.length>0&&U<N&&m.push(N-U)}}let I=s?-Math.floor(p.width/2):-K,k=s?-K:-Math.floor(p.width/2);const Z=g&&p.width>2?-1:0;return c.jsx(qr,{offsetX:h+I+Z,offsetY:E+k+Z,length:N+K,isVertical:s,stroke:P,width:p.width,dashArray:O??p.pattern,dashArrayAdditional:m,isDouble:R,isAngled:p.description.toLowerCase().includes("slant")},t)},yo=({getBorderAt:e,borderRenderer:t=Ml,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:C=!1})=>{const g=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>f=>{const S=f.toClipBounds(f.getRangeCoordsBounds(),-3);if(!S)return;const p=g(f);if(p.length===0)return;const h=f.getVisibleColumnOffsets(),E=f.getVisibleRowOffsets();let x=[],A=[];const N=f.getVisibleColumns(),K=f.getVisibleRows(),P=[],R=[],O=[],m=(I,k,Z,X,B,j,H)=>{const J={index:X,stroke:B,visibleIndex:Z,edge:j,length:H};I[k]||(I[k]=[]),I[k].length>0&&I[k][I[k].length-1]?.index===X?I[k][I[k].length-1]=J:I[k].push(J)};for(let I=0;I<p.length;I++){const k=p[I],Z=k.coords;if(!Z)continue;const X=k?.range??{rowStart:Z.rowIndex,colStart:Z.colIndex,rowEnd:Z.rowIndex,colEnd:Z.colIndex},B=f.getVisibleRangeCoords();if(!me.CoordUtils.isRangesIntersect(X,B)&&!me.CoordUtils.isRangeWithinRange(X,B))continue;const j=Z.colIndex,H=Z.rowIndex,J=h[j],M=E[H];if(X.rowEnd!==X.rowStart){const re=E[X.rowStart]?.spanIndex??-1,te=E[X.rowEnd]?.spanIndex??E[K[K.length-1]].spanIndex+1;x.push({...X,rowStart:re,rowEnd:te})}if(X.colEnd!==X.colStart){const re=h[X.colStart]?.spanIndex??-1,te=h[X.colEnd]?.spanIndex??h[N[N.length-1]].spanIndex+1;A.push({...X,colStart:re,colEnd:te})}const U=k.value,ue=e(U,I);if(!ue||ue.isEmpty())continue;const we=ue.getLeft(),je=ue.getTop(),Te=ue.getRight(),ae=ue.getBottom();let Me=1,Ke=1;if(!J||!M)continue;const Ee=J.spanIndex,Ue=M.spanIndex;we.isNone()||m(P,Ee,Ue,H,we,d.IBorder.Edge.Left,Me),je.isNone()||m(R,Ue,Ee,j,je,d.IBorder.Edge.Top,Ke),Te.isNone()||m(P,Ee+Ke,Ue,H,Te,d.IBorder.Edge.Right,Me),ae.isNone()||m(R,Ue+Me,Ee,j,ae,d.IBorder.Edge.Bottom,Ke)}const q=(I,k,Z)=>{const X=[];return I.forEach((B,j)=>{let H=null;B.sort((J,M)=>J.visibleIndex-M.visibleIndex);for(let J=0;J<B.length;J++){const M=B[J];if(!M?.stroke||k[j]===void 0&&k[j-1]===void 0)continue;let U=!1;if(Z)for(let Te=0;!U&&Te<x.length;Te++){let ae=x[Te];ae.colStart<=M.index&&ae.colEnd>=M.index&&ae.rowStart<j&&ae.rowEnd>=j&&(U=!0)}else for(let Te=0;!U&&Te<A.length;Te++){let ae=A[Te];ae.rowStart<=M.index&&ae.rowEnd>=M.index&&ae.colStart<j&&ae.colEnd>=j&&(U=!0)}if(U)continue;const ue=M.stroke?.getColor(),we=ue?ue.toRGBA().toString():l,je=M.stroke.getStyle()+":"+we;(je!==H?.key||H&&H.visibleIndex+1<M.visibleIndex)&&(H&&X.push(H),H={key:je,index:k[j]??k[j-1]+1,visibleIndex:M.visibleIndex,edge:M.edge,stroke:M.stroke,from:M.index,to:M.index+M.length-1,intersections:[],length:1}),H.to=M.index+M.length-1,H.visibleIndex=M.visibleIndex}H&&X.push(H)}),X};x=x.sort(kl),A=A.sort(Rl);const T=q(P,N,!1),$=q(R,K,!0);if(T.length===0&&$.length===0)return null;for(let I=0;I<$.length;I++){const k=$[I];let Z=me.CommonUtils.findEqualOrGreater(T,k.from,B=>B.index),X=!1;for(;!X;){const B=T[Z++];B&&B.index>=k.from&&B.index<=k.to+1&&B.from<=k.index&&B.to+1>=k.index&&(k.intersections.push({stroke:B.stroke,range:{rowStart:B.from,rowEnd:B.to+1,colStart:B.index,colEnd:B.index}}),B.intersections.push({stroke:k.stroke,range:{rowStart:k.index,rowEnd:k.index,colStart:k.from,colEnd:k.to+1}})),X=!B||B.index>k.to+1}}for(let I=0;I<$.length;I++){const k=$[I];let Z=k.stroke;const X=`rBorder:${k.index}:${k.from}:${k.to}:${k.edge}`,B={rowStart:k.index,rowEnd:k.index,colStart:k.from,colEnd:k.to+1},j=f.getLayout(),H=!1,J=j.getColOffset(B.colStart),M=j.getRowOffset(B.rowStart),U=[J,M,j.getColOffset(B.colEnd),M];O.push(t({key:X,points:U,stroke:Z,darkMode:i,forceThinBorder:a,shiftIfWide:C,range:B,intersections:k.intersections,layout:j,isVertical:H}))}for(let I=0;I<T.length;I++){const k=T[I];let Z=k.stroke;const X=`cBorder:${k.index}:${k.from}:${k.to}:${k.edge}`,B={rowStart:k.from,rowEnd:k.to+1,colStart:k.index,colEnd:k.index},j=f.getLayout(),H=!0,J=j.getColOffset(B.colStart),M=[J,j.getRowOffset(B.rowStart),J,j.getRowOffset(B.rowEnd)];O.push(t({key:X,stroke:Z,points:M,darkMode:i,forceThinBorder:a,shiftIfWide:C,range:B,intersections:k.intersections,layout:j,isVertical:H}))}return c.jsx("svg",{width:`${S.width}`,height:`${S.height}`,viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${S.width}px`,height:`${S.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:O},"borders")},[e,i])}},No=me.AnchorLocation.Center,Tl=Object.freeze({horizontal:!1,vertical:!1}),Lo=me.TypesUtils.EmptyTopLeft,Il=(e,t)=>me.CoordUtils.EmptyCell,El=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Fl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:C=2,darkMode:g,forceThinBorder:s,children:f,...S}=e,p=o.useRef(null),[h,{width:E,height:x}]=Ot(),A=n??E,N=i??x,K=o.useMemo(()=>{const H=[];for(let J=0;J<l;J++)for(let M=0;M<C;M++){const U={colIndex:M,rowIndex:J};H.push({coords:U,value:U})}return H},[]),P=o.useCallback(H=>K,[K]),{overlay:R}=yo({getVisibleCells:P,getBorderAt:t,darkMode:g,forceThinBorder:s}),O=Math.floor(A/C),m=Math.floor(N/l),q={getColOffset:H=>Math.ceil(H*O)+0,getRowOffset:H=>Math.ceil(H*m)+0,getColIndex:H=>Math.floor((H-0)/O)-1,getRowIndex:H=>Math.floor((H-0)/m)-1},T={rowStart:0,colStart:0,rowEnd:l,colEnd:C},$={x:0,y:0,width:Math.max(0,A)+0,height:Math.max(0,N)+0},I=o.useMemo(()=>{const H={},J=Math.floor(A/C);for(let M=0;M<C;M++)H[M]={offset:M*J,size:J,spanIndex:M};return H},[A,N]),k=o.useMemo(()=>{const H={},J=Math.floor(N/l);for(let M=0;M<l;M++)H[M]={offset:M*J,size:J,spanIndex:M};return H},[A,N]);if(!R)return null;const Z={width:A,height:N},X={width:A,height:N},B={getStage:()=>p.current,getTotalSize:()=>Z,getViewportSize:()=>X,getLayout:()=>q,getCellCoordsAsRangeCoords:me.CoordUtils.cellToRange,getVisibleRangeCoords:()=>T,getVisibleRows:()=>{const H=[];for(let J=0;J<l;J++)H.push(J);return H},getTotalRangeCoords:()=>T,getRelativePointFromClient:(H,J)=>({x:H,y:J}),getVisibleColumns:()=>{const H=[];for(let J=0;J<C;J++)H.push(J);return H},toClipBounds:(H,J)=>$,toViewBounds:H=>H,toAbsoluteBounds:H=>H,getBounds:()=>$,getInsets:()=>null,getRangeCoordsBounds:(H,J)=>null,getVisibleColumnOffsets:()=>I,getVisibleRowOffsets:()=>k,allViews:()=>({[No]:B}),getAnchor:()=>No,getZoom:()=>1,scrollCellCoordsIntoView:El,getCellCoordsFromClient:Il,getScrollOrientation:()=>Tl,getScrollTopLeft:()=>Lo,getFreezeTopLeft:()=>Lo},j=R(B);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...S,children:[c.jsx("div",{ref:Xt([p,h]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:f}),j]})});function Rr(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=Rr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function yt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Rr(e))&&(i&&(i+=" "),i+=t);return i}const Al="_sheetxl-sheet_1qeq6_5",Dl="_viewport-overlay_1qeq6_6",kr=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),c.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),c.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),c.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),c.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},zl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:C,...g}=e??{},[s,f]=o.useState(null);o.useEffect(()=>{(async()=>{const m=await d.LicenseManager.getDetails();f(m)})()},[]);const[S,p]=o.useState(!1),h={opacity:.65},E=o.useMemo(()=>{const m=s?.getExceptions(),q=m?.length??0;if(q===0)return null;const T=[];for(let $=0;$<q;$++){const I=m[$];T.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:I},$))}return T},[s,n]);if(s===null||s.isValidFor(l))return null;const x=s.getType(),A=!E&&x.endsWith("ity"),N=s.getLicensee(),K=A?1.6:1,P=135/K,R=37/K;let O=null;return!x&&N?.length>0&&(O=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:N})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...C},...g,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[S?c.jsx(kr,{style:h}):c.jsx("svg",{width:P,height:R,style:h,children:c.jsx("image",{style:{width:P,height:R},href:"https://www.sheetxl.com/watermark.svg",onError:()=>p(!0)})}),c.jsxs("div",{children:[O,E,c.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),C={},g=l.length;for(let f=0;f<g;f++){const S=l[f];C[S]=(p,h)=>{i.current[S]?.(p,h)}}const s=e.addListeners(C,n);if(a)for(let f=0;f<g;f++)C[l[f]](e);return()=>{s?.()}},[e])},Tn=new d.Color("transparent");function Mr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:C,getViewport:g}=e,s=r.useNotifier(),[f,S]=o.useState(null),[p,h]=o.useState(null),E=o.useRef(null),x=r.useCallbackRef(C,[C]),A=r.useCallbackRef(g,[g]),[N,K]=o.useState(),[P,R]=o.useState(()=>t?.getStyles().parseColor(d.IColor.Scheme.Bg2)),[O,m]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),q=r.useEditMode();o.useRef(q.getMode()).current=q.getMode();const T=r.useGlobalClipboard(),[$,I]=o.useState(me.CommonUtils.EmptyArray),k=o.useCallback(()=>{if(E.current!==t)return;const u=t.getSelectedRanges();let w=null;$.length>0&&me.CoordUtils.isCellWithinRange(f,$[0].getRange().getCoords())&&(w=$[0]);const F=t?.getSelectedCell(),v=F?.getCoords()??null;Lt.unstable_batchedUpdates(()=>{we(w),S(v),h(u)})},[t,$,p,f]),Z=o.useCallback(me.CommonUtils.debounce(k,210),[k]);o.useEffect(()=>{E.current=t,k()},[t]);const X=r.useCallbackRef(()=>t.getRange(f).getCell(),[t,f]),B=r.useCallbackRef(async(u,w,F=null,v=!1,z=!0)=>{const y=u?.label?.(),V=async()=>{const de=await Promise.resolve(z&&s.showBusy(y??"Busy..."));try{await t.doBatch(async()=>w(t),y),v&&q.setMode(null),de&&de()}catch(ge){if(de&&de(),!ge)return;s.showError(ge)}},_=[];let Q=!1;const se=async()=>(_.push(V),(async()=>{if(!Q){for(Q=!0;_.length>0;){const de=_.shift();de&&await de()}Q=!1}})());if(n){let de=null;if(F!==!1&&u){const ge=F??y;de=new r.SimpleCommand(u.key(),l,{label:ge,description:ge},se)}n(de)}return se()},[t,n,s]),j=r.useCallbackRef((u,w,F=!1,v)=>B(u,z=>{const y=z.getSelectedRanges();F&&y.getStyle().update(null,v),y.getStyle().update(w,v),y.autoFit({expandOnly:d.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),H=r.useCallbackRef((u,w,F)=>{B(u,v=>{let z=w;(F||w?.address)&&(z=z??{},!F&&w?.address?.startsWith("#")?F=w?.address.substring(1):F&&(z.displayText=F)),v.getSelectedRange().setHyperlink(z)})},[t]),J=r.useCallbackRef((u,w)=>{B(u,F=>{F.getSelectedRange().setComments(w)})},[t]),M=r.useCallbackRef((u,w)=>{B(u,F=>{F.getSelectedRanges().clear(w)})},[t]),U=r.useCallbackRef(async(u,w,F=!1,v=!1)=>B(u,async z=>{let y=z.getSelectedRanges();F&&(w===d.IRange.Orientation.Row?y=y.getEntireRows(v):w===d.IRange.Orientation.Column&&(y=y.getEntireColumns(v)));let V=null;const _=q.getMode()?.key;if(_==="copy"||_==="cut"){const Q=await T.getClipboard().readReference();Q&&Q.getItemType()==="range"&&(V=Q.getItem(),V.getCoords()||(V=null))}if(V){const Q=await y.insertFrom(V,{...V.getMarkOptions(),orientation:w,autoSelect:!0});!Q||Q.isEntireRows()||Q.isEntireColumns()||Q.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),q.setMode(null)}else y.insert(w,{autoSelect:!0})},"Insert Cells",!1),[q]),[ue,we]=o.useState(null),je=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),Te=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),ae=r.useCallbackRef((u,w)=>{B(u,async F=>{const v=F.getSelectedRange(),z=F.getSelectedCell().getCoords();let y=null,V=0;const _=z.rowIndex>0?F.getRange({rowIndex:z.rowIndex,colIndex:z.colIndex}).getExtended(d.IRange.Direction.Up):null;_&&F.getRange({colStart:z.colIndex,rowStart:_.getCoords().rowStart,colEnd:z.colIndex,rowEnd:_.getCoords().rowStart}).isContentful()&&(y=d.IRange.Direction.Up,V=z.rowIndex-_.getCoords().rowEnd);const Q=z.colIndex>0?F.getRange({rowIndex:z.rowIndex,colIndex:z.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(Q&&F.getRange({colStart:Q.getCoords().colStart,rowStart:z.rowIndex,colEnd:Q.getCoords().colStart,rowEnd:z.rowIndex}).isContentful()){const de=z.colIndex-Q.getCoords().colEnd;(de<V||!y)&&(y=d.IRange.Direction.Left,V=de)}let se=null;if(y===d.IRange.Direction.Up){if(se={..._.getCoords()},(se.rowEnd===z.rowIndex||!F.getRange({colIndex:z.colIndex,rowIndex:z.rowIndex-1}).isContentful())&&se.rowStart>0&&F.getRange({colIndex:z.colIndex,rowIndex:se.rowStart-1}).isContentful()){const de=_.getExtended(d.IRange.Direction.Up);se={colStart:z.colIndex,rowStart:de.getCoords().rowStart,colEnd:z.colIndex,rowEnd:_.getCoords().rowEnd}}se.rowEnd=z.rowIndex-1}else if(y===d.IRange.Direction.Left){if(se={...Q.getCoords()},(se.colEnd===z.colIndex||!F.getRange({colIndex:z.colIndex-1,rowIndex:z.rowIndex}).isContentful())&&se.colStart>0&&F.getRange({colIndex:se.colStart-1,rowIndex:z.rowIndex}).isContentful()){const de=Q.getExtended(d.IRange.Direction.Left);se={colStart:de.getCoords().colStart,rowStart:z.rowIndex,colEnd:de.getCoords().colEnd,rowEnd:z.rowIndex}}se.colEnd=z.colIndex-1}if(v.size!==1&&y){const de=v.getCoords(),ge=v.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),Ce={...se},be=de.rowStart,he=de.rowEnd,Ie=de.colStart,Be=de.colEnd,Ne=y===d.IRange.Direction.Up;for(let Ve=Ie;Ve<=Be;Ve++){Ce.colStart=Ne?Ve:se.colStart+(Ve-Ie),Ce.colEnd=Ne?Ve:se.colEnd+(Ve-Ie);for(let $e=be;$e<=he;$e++){Ce.rowStart=Ne?se.rowStart+($e-be):$e,Ce.rowEnd=Ne?se.rowEnd+($e-be):$e;const _e=F.getRange(Ce).toString();ge.pushAt($e,Ve,`=${w}(${_e})`)}}ge.apply()}else{const de=se?F.getRange(se).toString():"",ge=`=${w}(`;x?.({text:`${ge}${de})`,editMode:!0,initialSelection:{start:ge.length,end:ge.length+de.length}})}},!1)},[t]),Me=r.useCallbackRef((u,w,F=!1,v=!0)=>{B(u,async z=>{let y=null;if(ue)return void ue.updateStyleOptions(w);{const Q=z.getSelectedRanges().getFixed(!0),se=z.getSelectedRange().getDefaultSortCriteria();let de={ranges:Q,hasHeader:se?.options?.hasHeader??!1};y=v?new Promise((ge,Ce)=>{const be={tableOptions:de,onCancel:()=>{Ce()},onDone:he=>{ge(he)},context:{getNames:()=>z.getNames()}};s.showWindow?.("tableNew",be)}):{option:"Ok",tableOptions:de}}const V=await Promise.resolve(y);if(V?.option!=="Ok")throw null;const _=await Promise.resolve(s.showBusy(u.label()));try{await z.getTables().add(V.tableOptions.ranges.at(0),{styleName:w?.name,clearFormatting:F,hasHeader:V.tableOptions.hasHeader}).getRange().select()}catch(Q){_(),s.showError(Q)}_()},!1,!0,!1)},[ue]),Ke=r.useCallbackRef(()=>i,[i]),Ee=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),Ue=r.useCallbackRef(async(u,w,F,v=!0)=>{let z=null;if(!w){let y=t.getSelectedRange();y.size===1&&(y=y.getSurrounding());let V=t.getTables().getItems({address:t.getSelectedRange()});V.length>0&&(w=V[0]),await y.select()}if(w){if(v){try{F&&await w.select()}catch{}z=new Promise(async(y,V)=>{u.update({context:Ee(w)});const _={command:u,commands:b,notifier:s,onDone:se=>{y(se)}},Q=await s.showWindow?.("tableDetails",_,{disableAutoDestroy:!0});setTimeout(()=>{Q.focus()},180)})}Promise.resolve(z).then(y=>{},y=>{s.showError(y)})}},[s]),re=r.useCallbackRef(async(u,w,F=!1)=>{let v=null;if(w)w.isITable?v=w:w.getValue()&&(v=w.getValue());else{const z=t.getTables().getItems({address:t.getSelectedRange()});z.length>0&&(v=z[0])}if(v){if(!F){const z=v.getRange().getCoords(),y=(z.colEnd-z.colStart+1)*(z.rowEnd-z.rowStart+1);if(y>1e4&&await s.showOptions({title:"Confirm",description:`Converting a table to range with '${y}' cells will set a large number of cell styles and may affect performance.
10
- Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}B(u,async()=>{F?v.delete():v.convertToRange()},!1,!0)}},[s]),te=r.useCallbackRef((u,w,F)=>{B(u,async v=>{let z=v.getSelectedRanges();if(z.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let y=z.at(0);y.size===1&&(y=y.getSurrounding());const V=v.getSelection().getCoords().cell;let _=y.getDefaultSortCriteria(d.IRange.Orientation.Row,V);if(!_){if(F)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let Q=_.options;if(F&&(Q=new Promise((de,ge)=>{const Ce={range:y,options:_.options,cell:V,onCancel:()=>{ge()},onDone:be=>{be?de(be.options):ge()}};s.showWindow?.("sort",Ce)})),Q=await Promise.resolve(Q),!Q)return;const se=await Promise.resolve(s.showBusy(u.label()));try{y.doBatch(()=>{const de={...Q,...w};y.sort(de),y.autoFit({orientations:de?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(de){se(),s.showError(de)}se()},!1,!1,!1)},[s]),pe=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),w=t.getSelectedRanges().getFlattened().getCoords(),F=(y=>{const V=new Blob([y],{type:"application/javascript"}),_=URL.createObjectURL(V),Q=new Worker(_);return URL.revokeObjectURL(_),Q})("console.log('hello from worker');");setTimeout(()=>{F.terminate(),console.log("Worker terminated")},5e3);let v=-1;for(let y=0;v===-1&&y<w.length;y++)me.CoordUtils.isCellWithinRange(u.cell,w[y])&&(v=y);if(me.CoordUtils.isEqualRangesArrays(u.ranges,w))return;const z={cell:u.cell,ranges:w,rangeIndex:v};t.getSelection().updateCoords(z)},[t]),Le=r.useCallbackRef(()=>{console.log("selectComments")},[t]),Y=r.useCallbackRef(async(u=!1,w=!1)=>{let F=null;if(w)F=t.getEntireRange();else{const v=t.getSelectedRange();if(v.isEntireRange()){const z=t.getSelection().getCoords().cell,y=t.getRange(z);F=y.getSurrounding(),F.isEntireRange()&&(F=y)}else F=v.getSurrounding({contentOnly:u})}F&&await F.select()},[t]),W=r.useCallbackRef((u,w,F)=>{B(u,async v=>{let z=v.getSelectedRanges();F&&(w===d.IRange.Orientation.Row?z=z.getEntireRows():w===d.IRange.Orientation.Column&&(z=z.getEntireColumns())),z.delete(w)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let w=null;const F=A(),v=Math.min(F.width-8,480),z=Math.min(F.height-8,288);try{t.getSelectedRanges(),w=await t.getMovables().add({bounds:{x:F.left+(F.width-v)/2,y:F.top+(F.height-z)/2,width:v,height:z},type:"chart",json:u.template}),w.select(),q.setMode(null)}catch(y){s.showError(y)}return w},[t,s]);const le=r.useCallbackRef(async(u,w,F)=>{const v=await s.showBusy(u.label());try{const z=await t.getMovables().addImage(w,{autoSelect:!0,...F});return v(),q.setMode(null),z}catch(z){v();let y=z;typeof y!="string"&&(console.warn(z),y="Unable to resolve image."),s.showMessage(y,{type:r.NotifierType.Error})}},[t,s]),fe=r.useCallbackRef((u,w)=>{B(u,async F=>{const v=F.getSelectedRanges();v.doBatch(()=>{const z=w===d.IRange.Direction.Up||w===d.IRange.Direction.Down,y=v.getCoords().slice().sort(me.CoordUtils.createRangeComparator(z?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let V=0;V<y.length;V++){const _=y[V];let Q=_;const se=F.getRange(Q).getMerges();let de=0,ge=0;if(se.length>0){const Ce=se[0];de=Ce.rowEnd-Ce.rowStart,ge=Ce.colEnd-Ce.colStart}w===d.IRange.Direction.Left?Q={..._,colStart:_.colEnd+ge}:w===d.IRange.Direction.Right?Q={..._,colEnd:_.colStart+ge}:w===d.IRange.Direction.Up?Q={..._,rowStart:_.rowEnd+de}:w===d.IRange.Direction.Down&&(Q={..._,rowEnd:_.rowStart+de}),F.getRange(Q).autoFill(_,{filler:d.AutoFill.Types.Copy}),F.getRange(_).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.label()})})},[s]),ce=r.useCallbackRef(()=>{let u=null;const w=t.getSelectedCell().getCoords();if(w?.rowIndex>0){const F=t.getRange({rowIndex:w.rowIndex-1,colIndex:w.colIndex}).getCell();F&&(u=F.toTextUnformatted(!0))}x?.({text:u})},[t]),[Se,ie]=o.useReducer(u=>u+1,0),[ve,xe]=o.useReducer(u=>u+1,0),Re=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Le()),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)=>Y(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Y(!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]}},()=>pe()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation."}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically."}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){te(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){te(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){te(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
- For example, you can prevent people from editing locked cells or making formatting changes.`}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(u){j(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(u){Me(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(u){Me(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){Me(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."},je),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Te),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){j(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){j(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){j(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top."}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells."}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom."}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically."}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left."}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content."}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right."}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content."}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells."}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){j(this,u=>({font:{size:go(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){j(this,u=>({font:{size:go(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){j(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){j(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,w){const F=this,v={initialValue:u??w.state(),context:w.context(),onInputOption:(z,y)=>{j(F,{numberFormat:z})}};s.showWindow?.("numberFormat",v)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){j(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(){j(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(){j(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(){j(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(){j(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){j(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){j(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(){j(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){j(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){j(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){j(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.",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",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.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u){u&&ae(this,u.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ae(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ae(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ae(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ae(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ae(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(){x?.({text:t.createTemporaryCell({value:fn(),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(){x?.({text:t.createTemporaryCell({value:fn(),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.",context:()=>X,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,w){const F=this,v={context:w.context(),onUpdateHyperlink:(z,y)=>{H(F,z,y)}};s.showWindow?.("hyperlink",v)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>X},async(u,w)=>{const F=w.context()();if(!F)return;const v=F.getHyperlink();if(v)try{await v.open()}catch(z){s.showError(z)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>X},function(u,w){H(this,null,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,w)=>{((F,v)=>{F?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[v," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,w.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>X},async function(u,w){const F=this,v={context:w.context(),onUpdateComments:z=>{J(F,z)}};s.showWindow?.("comments",v)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>X},function(u,w){J(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(u=null){let w=null,F=null;typeof u=="string"?F=u:w=u?.file?u.file:u,(w||(w=await me.CommonUtils.openFileDialog(F??"image/*"),w))&&await le(this,{file:w},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(u){if(!u){const w=await s.showInputOptions({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(w.option!=="Insert")return;u=w.input}u&&le(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Me(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(u){let w=null,F=!1;u.isITable?w=u:u.getValue()&&(w=u.getValue(),F=!0),Ue(this,w,F)}),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"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),fe=require("@sheetxl/utils"),o=require("react"),ct=require("@sheetxl/grid-react"),Lt=require("react-dom"),pn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),kl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:pn},Symbol.toStringTag,{value:"Module"})),Sr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),fo=(e,t=!0,n=Sr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let l=fe.CommonUtils.findEqualOrGreater(n,e);return t?(n[l]===e&&(l+=1),n[l]||(l-=1),n[l]):(l-=1,n[l])},Ml=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Sr,findNextFontSize:fo},Symbol.toStringTag,{value:"Module"})),po=o.memo(e=>{const{anchorLocation:t=fe.AnchorLocation.TopLeft,cellWidth:n,cellHeight:l,size:a=7,inset:i=1,darkMode:f,fill:u,pathProps:s,style:m,...q}=e,p=a,h=i;let k="red",b=[],I=[];return t===fe.AnchorLocation.TopLeft?(k=f?"rgb(255, 198, 246)":"green",b.push(h),I.push(h),b.push(h+p),I.push(h),b.push(h),I.push(h+p)):t===fe.AnchorLocation.TopRight?(k=f?"rgb(0, 255, 255)":"red",b.push(n-h),I.push(h),b.push(n-(h+p)),I.push(h),b.push(n-h),I.push(h+p)):t===fe.AnchorLocation.BottomRight?(k=f?"rgb(236, 252, 211)":"purple",b.push(n-h),I.push(l-h),b.push(n-(h+p)),I.push(l-h),b.push(n-h),I.push(l-(h+p))):t===fe.AnchorLocation.BottomLeft&&(k=f?"rgb(255, 236, 183)":"blue",b.push(h),I.push(l-h),b.push(h+p),I.push(l-h),b.push(h),I.push(l-(h+p))),c.jsx("svg",{width:`${n}`,height:`${l}`,viewBox:`0 0 ${n} ${l}`,style:{position:"absolute",width:`${n}px`,height:`${l}px`,pointerEvents:"none",...m},...q,children:c.jsx("path",{d:`M ${b[0]} ${I[0]} L ${b[1]} ${I[1]} L ${b[2]} ${I[2]} L ${b[0]} ${I[0]} Z`,fill:u??k,...s})})}),Rr=e=>{const{renderBounds:t,darkMode:n,zoom:l,disabled:a,filter:i,onFilterButtonMouseDown:f,style:u,...s}=e,m=o.useMemo(()=>{let k=null;const b=i.getSortField();b&&(k=b.reverse);const I=i.getField(),A=I&&I.criteria&&I.criteria.length>0;return k===!0?A?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":k===!1?A?"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":A?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[i]),[q,p]=o.useState(!1),h=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${h}px`,height:`${h}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${q&&!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:(h>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...u},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onMouseDown:k=>{f?.(k,i),k.preventDefault()},...s,children:c.jsx("svg",{width:""+15*l,height:""+15*l,viewBox:"0 0 15 15",style:{fill:`var(${q&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:m})})})},kr=e=>{const{value:t,coords:n,bounds:l,children:a,style:i,range:f,zoom:u=1,view:s,bodyStyle:m,normalStyle:q,showFormulas:p,showZeros:h,docTheme:k,onLinkMouseDown:b,onFilterButtonMouseDown:I,filterButtonProps:A,createFilterButton:K=Rr,...V}=e,M=l.height/u,P=l.width/u,v=t,S=v.getValue(),T=t.getStyle(),W=m?.darkMode??!1;let D,O;const G=S&&S.isFormulaError,le=G&&S instanceof d.FormulaError.Parse;let U,E=p||le;if(E)if(v.isSpillOverflow())O="";else{const Ne=v.getFormulaText();Ne?O=Ne:D=v.getNumberFormat(d.NumberFormat.Type.General)}else D=v.getNumberFormat();E||(U=v.getTextOverflow());const B=U?U.colBounds.width+U.leftOffset+U.rightOffset:P,$=U?U.anchorBounds.x-U.leftOffset:0,R=U?U.anchorBounds.width:P,L=U?U.anchorBounds.x:0;let ee,ie=v.getRenderHorizontalAlignment();D&&(ee=D?.formattedRuns,O=ee?.runs[0]?.text??D.displayText);const Ce=v.getCalcStatus()===d.ICell.CalcStatus.Pending;let Se=null,he=T.getFill().toCSS(W,l),Te=0,Ke=0;if(!T.getBorder().isEmpty()){const Ne=T.getBorder().getRight();!Ne.isNone()&&d.IBorder.BuiltInDefinitions.get(Ne.getStyle()).width>1&&(Te=1);const z=T.getBorder().getBottom();!z.isNone()&&d.IBorder.BuiltInDefinitions.get(z.getStyle()).width>1&&(Ke=1)}let Ee=null;if(P!==R||Te||Ke||typeof he?.backgroundPosition=="number"){const{backgroundPosition:Ne,...z}=he,te=Ne??0,j=s?.getScrollTopLeft(),Z=te?-(l.x+(j.left??0))%te:0,g=te?-(l.y+(j.top??0))%te:0;(Ne!==void 0||Te||Ke||P!==R)&&(Object.keys(z).length===1&&z.background==="none"||(he=null,Ee=c.jsx("div",{className:"fill",style:{marginLeft:`${Z}px`,marginTop:`${g}px`,left:L*u,width:r.ReactUtils.boundPixel(R*u-Z+1+Te),height:r.ReactUtils.boundPixel(l.height-g+1+Ke),...z}},"background")))}let He=null;const J=v.getComments(),ne=v.getWarnings(),pe=v.getErrors();if(J||G||pe.length>0||ne.length>0){const Ne={size:7*u,darkMode:W,cellWidth:R*u+2,cellHeight:M*u+2,style:{top:-1,left:L*u-1}};He=He??[],(ne.length>0||pe.length>0||G)&&He.push(c.jsx(po,{anchorLocation:fe.AnchorLocation.TopLeft,...Ne},`indicator-${He.length}`)),J&&He.push(c.jsx(po,{anchorLocation:fe.AnchorLocation.TopRight,...Ne},`indicator-${He.length}`))}const De=T.getFont();let Y=D?.conditionalColor;const _=T.getAlignment(),ae=_.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ve=_.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||ae,ue=ve||E?0:_.getRotation(),ke=v.getInsets(),se=ke.top+ke.bottom;let ye=ke.left,qe=ke.right;const Me={...i,left:i.left-1,top:i.top-1,width:i.width+1+Te,height:i.height+1+Ke},y=v.getColumnFilter(),Ae=y&&!y?.hasHiddenButton();let Ze=null;Ce&&(Ze=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const Le=!(Ce||Ae||Ee||a||He||ee?.runs.length>1||U||ue%360!=0);he?.background==="none"&&(he=null);let et=ve||!(!U||!(U.rightIndex>0||U.leftIndex>0||U.colSpan>1));if(!et){const Ne=v.getSpans();(Ne.width>1||Ne.height>1)&&(et=!0)}const re={...he,...Me,pointerEvents:b?"auto":void 0};if(!fe.CommonUtils.isEmpty(O)||!fe.CommonUtils.isEmpty(D?.repeatPlaceholder)){const Ne=D?.canWrap??!1;let z=null,te=null,j=null,Z=[],g=!0;h||E||S!==0||(g=!1);const x=v.getTextFrame(E);if(g&&x){let F=B-1-(ye+qe);if(ue){z=x.layout().bounds;const we={x:0,y:0,width:B-1,height:M};if(ee){let be=ee.width;if(D.repeatPlaceholder||D.repeatChars.length>0){const me=d.GeomUtils.boundsToPoints(we),Fe=d.GeomUtils.rotatePoints(me,-ue);be=d.GeomUtils.minBoundingRect(Fe).width}z={...z,width:be}}j=d.GeomUtils.clipToOuterRect({...z,width:z.width+1+ye+qe},we,ue),F=j.width-1-(ye+qe)+.01}let C=null;Ne&&(C={width:F});let N=null,w=D?.repeatPlaceholder;const H=x.layout(C);if(z=H.bounds,E?z={...z,width:0}:ee&&(z={...z,width:D.repeatPlaceholder||D.repeatChars.length>0?F:ee.width}),ue&&Ne){let ge=null;H.visitLines({visitTextLine:(we,be)=>{let me=we.bounds;const Fe=d.GeomUtils.boundsToPoints(me),Oe=d.GeomUtils.rotatePoints(Fe,ue),Pe=d.GeomUtils.minBoundingRect(Oe);me={...me,x:(Pe.width-me.width)/2,y:(Pe.height-me.height)/2},ge=ge?d.GeomUtils.unionBounds(ge,me):me}}),z={...ge,width:ge.width+ye+qe}}if(!w&&v.getType()!==d.ScalarType.String&&Math.floor(z.width)>F){if(T.getNumberFormat()==="General"&&v.getType()===d.ScalarType.Number){const ge=T.measureText("0"),we=Math.floor(F/ge.width),be=S,me=fe.CommonUtils.splitNumber(be),Fe=Math.min(10,we-(Math.max(1,me.ipLength)+1)-(be<0?1:0));if(Fe>=-1){const Oe=`0${Fe>0?".":""}${"#".repeat(Math.max(0,Fe))}`;N=v.getNumberFormat(Oe).displayText,N==="0"&&be<0&&(N="-0")}else if(Math.abs(be)>=Math.pow(10,5)||Math.abs(be)<=Math.pow(10,-5)){const Oe=we-5-(be<0?1:0);if(Oe>=0){const Pe=`0.${"0".repeat(Math.max(0,Oe-1))}E+00`;N=v.getNumberFormat(Pe).displayText}}}N||(w="#")}if(!w&&ee?.lastRepeatIndex>=0&&ee?.width>F&&(w="#"),w&&F>0){const ge=T.measureText(w),we=Math.floor((F||1)/(ge?.width||1));N=we>0?w.repeat(we):"",ie=d.ITextFrame.HorizontalAlignment.Center}if(E&&(ie=d.ITextFrame.HorizontalAlignment.Left),N){const ge=T.measureText(N).width;ge&&(z={...z,width:ge})}if(te={...z,width:z.width+ye+qe,height:z.height},ue&&!Ne){const ge=d.GeomUtils.boundsToPoints(te),we=d.GeomUtils.rotatePoints(ge,ue),be=d.GeomUtils.minBoundingRect(we);te.width=be.width,te.height=be.height}ie===d.ITextFrame.HorizontalAlignment.Center||ie===d.ITextFrame.HorizontalAlignment.CenterContinuous?te.x=(B-te.width)/2:ie===d.ITextFrame.HorizontalAlignment.Right?te.x=B-te.width-.5:te.x=.5,_.getVertical()===d.ITextFrame.VerticalAlignment.Center?te.y=(M-te.height)/2:_.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?te.y=M-te.height-se:te.y=se;const X=Le?{...V}:void 0,Q={style:{left:i.left-1,top:i.top-1,width:i.width+1,height:i.height+1,transform:ue?`rotate(${ue}deg)`:void 0,cursor:b?"pointer":void 0,pointerEvents:b?"auto":void 0,zIndex:et?1:void 0,...he},onMouseDown:b,onDoubleClick:b?ge=>{ge.stopPropagation(),ge.preventDefault()}:null,...X};le&&(Q.style.textDecorationStyle="wavy",Q.style.textDecorationColor=W?"rgb(0, 255, 255)":"red",Q.style.textDecorationLine="underline");const ce=De.getSize(),de=(ge,we,be,me,Fe,Oe,Pe,Be=null)=>{let $e=ce*u,Ge=be,je=Pe?.runs?Pe.runs:[{type:d.NumberFormat.ParseRunType.Text,text:ge,width:T.measureText(ge,$e).width}];Pe&&Pe?.width!==z.width&&(z={...z,width:Pe?.width});let Ye=ye;if(Pe?.lastRepeatIndex>=0&&F>Pe?.width){const _e=Pe.runs[Pe.lastRepeatIndex];if(_e){const ot=[...je],vt=Math.max(0,F-1-Pe.width);let bt=0,Ct="";if(vt>0){const ht=Math.floor(vt/_e.width);Ct=ht>0?_e.text.repeat(ht):"",bt=vt}ot[Pe.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:Ct,width:bt},je=ot,z={...z,width:Pe.width+bt}}}const at=(_e,ot,vt,bt,Ct,ht,it,Et,Ot,en=null)=>{let Dt,tn=Ge.width;Fe===d.ITextFrame.HorizontalAlignment.Justify?(tn=Ct,Oe||(Dt="justify")):Fe===d.ITextFrame.HorizontalAlignment.Distributed&&(tn=Ct,Dt=Oe||_e.text.split(" ").length-1==0?"center":"justify");const{style:It,className:qn,...yt}=en;let Bt=_e.text;if(Fe===d.ITextFrame.HorizontalAlignment.Fill&&D?.repeatChars.length===0){const st=Math.max(1,Math.floor((Ge?.width??0)/(it?.width??1)));Bt=Bt.repeat(st)}let nn=Ge.height;const Mt=De.getVerticalAlignment(),zt=Mt===d.IFont.VerticalAlignment.Sub,Sn=Mt===d.IFont.VerticalAlignment.Super;if(zt||Sn){const st=De.getSuperSubScale();$e*=st,nn*=st}const tt={textAlign:Dt,textAlignLast:Dt,...It,...De.toCSS(W,u,!0),fontSize:$e*d.IFont.getDeviceScale()};Le||(tt.background=void 0),Y&&(tt.color=Y.toCSS(W));const Rn=Ye+ot;let Vt=ke.top+Ge.y+0;if(zt&&(Vt+=Ot-$e),ht){const st=(it.x+Rn)*u+1,ft=(it.y+Vt)*u+1;ft<0?tt.marginTop=ft:tt.paddingTop=ft,st<0?(tt.width=(It?.width??0)-st,tt.left=(It?.left??0)+st):tt.paddingLeft=st,tt.paddingRight=Math.max(0,(It?.width??0)-tn*u-st),tt.paddingBottom=Math.max(0,(It?.height??0)-Ge.height*u-ft),tt.height=(It?.height??0)+(ft<0?-ft:0),(ft<0||st<0)&&(tt.clipPath=`inset(${ft<0?-ft:0}px 0px 0px ${st<0?1-st:0}px)`)}else if(tt.left=(it.x+Rn)*u+1,tt.top=(it.y+Vt)*u+1,tt.width=it.width*u,tt.height=it.height*u,ue&&!Ne){tt.left=(it.x+ot)*u+1,tt.top=(it.y+(Ge.y+0))*u+1;const st=d.GeomUtils.centerPoint({x:Ye+ot,y:0,width:_e.width,height:Ge.height}),ft=d.GeomUtils.centerPoint({x:Ye,y:0,width:Ct,height:Ge.height}),rn=d.GeomUtils.rotatePoints([st],ue,ft),ln={x:rn[0].x-st.x,y:rn[0].y-st.y};tt.left=tt.left+ln.x*u,tt.top=tt.top+ln.y*u;const Ht={...Ge,x:Ye,y:ke.top,width:Ge.width+(ye+qe)},Zn=d.GeomUtils.boundsToPoints(Ht),Xn=d.GeomUtils.rotatePoints(Zn,ue),Ut=d.GeomUtils.minBoundingRect(Xn);Ht.width=Ut.width,Ht.height=Ut.height;const kn=d.GeomUtils.centerPoint(Ht),Kt={x:kn.x-ft.x,y:kn.y-ft.y};tt.left=tt.left+Kt.x*u,tt.top=tt.top+Kt.y*u}tt.lineHeight=nn*u+"px";const on=Le?void 0:"text-line";Z.push(c.jsx("div",{className:qn?`${qn} ${on}`:on,style:tt,...yt,children:Bt},`text-${Ge.y}-${bt}-${vt}`))};if(_.getOverflow()===d.ITextFrame.Overflow.Shrink&&F>0){let _e=z?.width??0,ot=0;for(;_e>1&&_e>F&&$e>2&&ot<100;)$e*=F/_e,_e=T.measureText(ge,$e).width,ot++;z={...z,width:_e}}let mt=Ge.x;Fe===d.ITextFrame.HorizontalAlignment.Right?mt+=z.width-Ge.width:Fe!==d.ITextFrame.HorizontalAlignment.Center&&Fe!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(mt+=(z.width-Ge.width)/2),Pe?.lastRepeatIndex>=0&&(mt=Ge.x);const qt=je.length;for(let _e=0;_e<qt;_e++){const ot=je[_e];(ot.type===d.NumberFormat.ParseRunType.Text||ot.type===d.NumberFormat.ParseRunType.Repeat)&&(ot.type,d.NumberFormat.ParseRunType.Repeat,at(ot,mt,_e,we,Fe===d.ITextFrame.HorizontalAlignment.Justify||Fe===d.ITextFrame.HorizontalAlignment.Distributed||Pe?.lastRepeatIndex>=0?F:Ge.width,Le,{x:te.x+$,y:te.y,width:ot.width,height:z.height},0,me,Be)),mt+=ot.width}};N?de(N,0,{x:0,y:0,...z},H.lines[0].baseline,ie,!0,null,Q):H.visitLines({visitTextLine:(ge,we,be)=>{const me=ge.runs[0].text.replace(/\s+$/,""),Fe=we===be-1;let Oe=ie===d.ITextFrame.HorizontalAlignment.Justify&&(Fe||ge.runs[0].text.endsWith(`
8
+ `))?d.ITextFrame.HorizontalAlignment.Left:ie,Pe=0;we>0&&(_.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||_.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Pe=Math.max(0,(M-(se+3)-ge.bounds.height*be)/(be-1)*we)),_.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&ue&&ue%90==0&&ue%180!=0&&(Oe=d.ITextFrame.HorizontalAlignment.Distributed),Oe!==d.ITextFrame.HorizontalAlignment.Justify&&Oe!==d.ITextFrame.HorizontalAlignment.Distributed&&Oe!==d.ITextFrame.HorizontalAlignment.Fill||(z={...z,width:F});let Be=ae||D&&(D.repeatChars.length>0||D.spacingChars.length>0)?z.width:ge.bounds.width;const $e={...ge.bounds,y:ge.bounds.y+Pe+0,width:Be};de(me,we,$e,x.lines[0].baseline,Oe,Fe,be===1?ee:null,Le&&we>0?{...Q,style:{...Q.style,background:void 0}}:Q)}})}Z.length>0&&(Se=Z)}if(Le)return Se&&Se.length>0?Se:c.jsx("div",{style:re,...V});let Ie=b?"auto":Me.pointerEvents,ze=null;if(Ae){const Ne={x:L*u-1,y:-1,width:R*u+1,height:M*u+1};Ie="auto",ze=K({renderBounds:Ne,darkMode:W,className:"filter-button",disabled:!v.isEditAllowed(),zoom:u,filter:v.getColumnFilter(),onFilterButtonMouseDown:I,...A}),ze&&(ze=c.jsx("div",{style:{...Ne,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:z=>{z.stopPropagation(),z.preventDefault()},children:ze},"filterButton"))}Ce&&!Se&&(Se=c.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const xe=[Ee,Se,a,He,Ze,ze];return c.jsx("div",{style:{...he,...Me,pointerEvents:Ie},...V,children:xe})},Po={text:"",placeholder:""},jo=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},Tl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),Mr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:l,onChangeEdit:a,onSubmitEdit:i,onCancelEdit:f,onDoneEdit:u,defaultTextStyle:s,useRichStyling:m=!0,bodyStyle:q,activeCoords:p,sheet:h,commands:k,containerBounds:b,setNaturalSize:I,onFocus:A,disabled:K,style:V,zoom:M=1,linesVisible:P,autoFocus:v=!1,...S}=e,{height:T=0,width:W=0}=b??{},D=q?.darkMode??!1,O=o.useRef(null),[G,le]=o.useState(!1),[U,E]=o.useState(null),[B,$]=o.useState(()=>n);o.useEffect(()=>{Ke.current=!1,$(n)},[n]);const R=o.useMemo(()=>{const z=B.clean();let te=z.getStyle();m||(te=te.createTemporaryStyle({font:{size:s?.fontSize}}));const j=z.getFormula(),Z=te.getAlignment(),g=j?d.ITextFrame.HorizontalAlignment.Left:Z.getHorizontal(),x=Z.getVertical(),F=Z.getOverflow()===d.ITextFrame.Overflow.Wrap||z.getType()===d.ScalarType.String&&(g===d.ITextFrame.HorizontalAlignment.Justify||g===d.ITextFrame.HorizontalAlignment.Distributed||x===d.ITextFrame.VerticalAlignment.Justify||x===d.ITextFrame.VerticalAlignment.Distributed),C=(H=>{if(!H)return Po;const X=H.clean();if(!X)return Po;let Q=X.getStyle()?.getQuotePrefix();if(H.dirty===void 0||H.dirty===null){let ce="",de=X.getFormulaText();de&&(ce=de,Q=!1),ce||(ce=X.toTextUnformatted(!0)??"");let ge="";if(!H.editMode&&X.isSpillOverflow()){const we=X.getSpill();if(we){const be=we.getCell(),me=be.getFormulaText();be.isEqual(X)||(ge=me)}}return Q&&(ce="'"+ce),{text:ce,placeholder:ge}}return{text:H.dirty??"",placeholder:""}})(B),N=C.text,w=d.ITextFrame.toCSSHorizontalTextAlign(m&&!j?B.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:te,isWrapped:F,textValue:N,formula:j,frameVertAlign:x,placeholder:C.placeholder,insets:m?z.getInsets():fe.TypesUtils.EmptyRect,textAlign:w}},[B,s,D,M,m]),L=o.useRef(null),ee=r.useImperativeElement(t,()=>({startEdit:z=>{O.current=z?.initialSelection;const te={...n,editMode:z?.editMode??!1};z?.text!==void 0&&(te.dirty=z.text),te.editMode===n.editMode&&te.dirty===n.dirty||($(te),Se?.(te))},submitEdit:()=>Ee(),cancelEdit(){He()},autoFocus(){L.current.focus()},dispatchEvent:z=>L.current.dispatchEvent(z),focus(){L.current.focus()},getLineHeight:Ce}),[l,n]);o.useLayoutEffect(()=>{if(!U||!G)return;const z=L.current;R.textValue,z&&z.setSelectionRange(U.start,U.end,U.direction)},[L.current,U,R.textValue]);const ie=o.useMemo(()=>{const z=B?.clean(),te=R.style.createTemporaryTextFrame(R.textValue,z?.getType()===d.ScalarType.String),j=m?z.getInsets().right+z.getInsets().left:0;let Z=null;return R.isWrapped&&(Z={width:W-j}),te.layout(Z)},[R,W,B,m]),Ce=r.useCallbackRef(()=>Math.ceil(ie?.lines[0]?.bounds.height),[ie]);o.useLayoutEffect(()=>{if(!ie)return;const z=R.style,te=z.getInsets()??fe.TypesUtils.EmptyRect,j=m?te.left+te.right:0,Z=m?.04*z.getFont().getSize():1,g=Math.round(R.isWrapped?void 0:ie.bounds.width+j+Z),x=Math.round(ie.bounds.height);I?.({width:g,height:x})},[ie,I,R,m,B]);const Se=r.useCallbackRef(a,[a]),he=r.useCallbackRef(z=>{if(B.dirty===z)return;const te={...B};te.dirty=z,L.current,$(te),Se?.(te)},[B]),Te=r.useCallbackRef(z=>{if(B.editMode===z)return;const te={...B};te.editMode=z,$(te),Se?.(te)},[B]),Ke=o.useRef(!1),Ee=r.useCallbackRef(()=>{if(Ke.current)return!1;try{i?.(B),u?.(),Ke.current=!0}catch{return!1}return!0},[i,B]),He=r.useCallbackRef(()=>{Ke.current=!0,$(n),f?.(),u?.()},[f,n]),J=r.useCallbackRef(z=>{if(!L.current)return;if(z.key,z.isDefaultPrevented(),!(z.isTrusted||z.nativeEvent.ctrlKey||z.nativeEvent.metaKey||z.nativeEvent.altKey||z.nativeEvent.isComposing||ct.STANDARD_KEY_CHARS.indexOf(z.nativeEvent.key)===-1&&z.nativeEvent.key!=="Backspace")){const C={...B};let N=0;return jo(C,C.dirty)&&!isNaN(parseFloat(z.key))?(C.dirty?.endsWith("%")?C.dirty=(C.dirty.substring(0,C.dirty.length-1)??"")+z.key+"%":C.dirty=(C.dirty??"")+z.key+"%",N=C.dirty.length-1):z.nativeEvent.key==="Backspace"?(C.dirty="",N=C.dirty.length):(C.dirty=(C.dirty??"")+z.key,N=C.dirty.length),L.current.value=C?.dirty,O.current={start:N,end:N,direction:"forward"},L.current?.setSelectionRange(N,N,"forward"),$(C),Se?.(C),void z.preventDefault()}const te=z.nativeEvent.ctrlKey,j=z.nativeEvent.shiftKey,Z=z.nativeEvent.altKey,g=z.nativeEvent.metaKey;if(te&&z.key==="z"&&z.stopPropagation(),z.which===r.KeyCodes.Escape)return z.preventDefault(),void He();if(z.which===r.KeyCodes.F2)return Te(!0),void z.preventDefault();const x=z.target;if(z.key==="%"&&x.selectionStart===x.selectionEnd&&x.value[x.selectionStart]==="%"&&B?.clean().getStyle().numberFormat.includes("%"))return E({start:x.selectionStart+1,end:x.selectionEnd+1,direction:x.selectionDirection}),void z.preventDefault();if(z.which===r.KeyCodes.Enter){if(z.preventDefault(),g||Z){const C=R.textValue.substring(0,x.selectionStart)+`
9
+ `+R.textValue.substring(x.selectionEnd);return he(C),void E({start:x.selectionStart+1,end:x.selectionStart+1,direction:x.selectionDirection})}return void(Ee()&&h.getSelection().traverse(d.IRange.Orientation.Column,j))}if(z.which===r.KeyCodes.Tab)return z.preventDefault(),void(Ee()&&h.getSelection().traverse(d.IRange.Orientation.Row,j));let F=null;switch(z.which){case r.KeyCodes.Left:F=d.IRange.Direction.Left;break;case r.KeyCodes.Right:F=d.IRange.Direction.Right;break;case r.KeyCodes.Up:F=d.IRange.Direction.Up;break;case r.KeyCodes.Down:F=d.IRange.Direction.Down}if(F&&!(te||j||Z||g)&&!B.editMode)return void Ee();B.editMode&&(F||Tl.includes(z.which))&&z.stopPropagation()},[B,h,R]),ne=o.useCallback(()=>{L.current?.focus(),setTimeout(()=>{L.current?.select()},0)},[]),pe=o.useCallback(()=>{L.current?.focus(),console.log("implement toggleRelativeReferences")},[]),De=r.useCallbackRef(()=>{const z=L.current?.value;let te="";if(p.rowIndex>0){const j=h.getRange({rowIndex:p.rowIndex-1,colIndex:p.colIndex}).getCell();j&&(te=j.toTextUnformatted(!0))}he(z+te)},[p,h]);o.useEffect(()=>h.getRange(p).addListener(()=>{const z={...B,clean:()=>h.getRange(p).getCell()};$(z),Se?.(z)}),[p,h,B]);const Y=o.useCallback(()=>{const z=B.clean().createTemporaryCell({value:pn(),style:{numberFormat:"Medium Time"}}).toText();he((L.current?.value??"")+z)},[h]),_=o.useCallback(()=>{const z=B.clean().createTemporaryCell({value:pn(),style:{numberFormat:"Short Date"}}).toText();he((L.current?.value??"")+z)},[h]),ae=o.useMemo(()=>({element:()=>L.current,doCopy:z=>{const te=L.current.value.substring(L.current.selectionStart,L.current.selectionEnd);if(z?.isCut){const j=L.current.value.substring(0,L.current.selectionStart)+L.current.value.substring(L.current.selectionEnd,L.current.value.length);he(j)}return te}}),[L.current]),ve=o.useMemo(()=>({element:()=>L.current,doPaste:async(z,te)=>{const j=await z.toText?.();if(!j)return!0;const Z=L.current.value.substring(0,L.current.selectionStart)+j+L.current.value.substring(L.current.selectionEnd,L.current.value.length);return he(Z),E({start:L.current.selectionStart+j.length,end:L.current.selectionStart+j.length,direction:"forward"}),!0}}),[L.current]),ue=o.useMemo(()=>({contains:z=>L.current?.contains(z)||!1,focus(){L.current.focus()}}),[]),ke=o.useMemo(()=>[new r.SimpleCommand("selectAll",ue,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},ne),new r.SimpleCommand("startEditValueAbove",ue,{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]}]},De),new r.SimpleCommand("startEditCurrentTime",ue,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},Y),new r.SimpleCommand("startEditCurrentDate",ue,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},_),new r.Command("relativeReferencesToggle",ue,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},pe),new r.Command("toggleEditorFocus",ue,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),se=o.useMemo(()=>{let z=null;const te=()=>({contains:j=>L.current?.contains(j)||!1,focus(){L.current.focus()}});return z=k?k.createChildGroup(te,"editor",!1):new r.CommandGroup(te,"editor"),z.addCommands(ke,!0),z},[k,ke]),ye=o.useMemo(()=>({notifier:null,source:ae,target:ve,commands:se}),[ae,ve,se]);r.useCopyPaste(ye);const[qe,Me]=o.useState(!v);o.useEffect(()=>{Me(!1)},[]);const y=r.useCallbackRef(z=>{le(!0),se?.activate();const te=O.current;if(te!==!1){let j,Z;const g=L.current.value;jo(B,g)&&(j=g.length-1,Z=g.length-1),j=te?.start??j??g.length,Z=te?.end??Z??g.length,O.current=!1,E({start:j,end:Z,direction:"forward"})}A?.(z)},[A,B]),Ae=R.insets;let Ze=Ae.left+1;const Le=Ae.left+Ae.right+2-1,et=ie?.bounds.height??0;let re,Ie=Ae.top;R.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?Ie=Math.max(0,(T-(Ae.top+Ae.bottom)-et)/2):R.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(Ie=Math.max(0,T-(Ae.top+Ae.bottom)-et)),P!==void 0&&ie?.lines[0]?.bounds&&(re=ie?.lines[0]?.bounds.height*P);const ze=R.style.getFont();let xe=ze.getSize();ze.isSuperSub()&&(xe*=ze.getSuperSubScale()),xe*=d.IFont.getDeviceScale()*M;const Ne=m?ze.toCSS(D,M):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:z=>{L.current&&document.activeElement!==L.current&&requestAnimationFrame(()=>{L.current.focus()})},ref:ee,...S,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...V},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Ie*M+1,left:Ze*M,width:`calc(100% - ${Le*M}px)`,maxWidth:`calc(100% - ${Le*M}px)`,height:(re??et)*M,maxHeight:(re??et)*M},children:c.jsx("textarea",{spellCheck:"false",placeholder:R.placeholder,ref:L,value:R.textValue,disabled:qe,readOnly:K||h.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ne,fontSize:xe?`${xe}px`:"inherit",textAlign:R.textAlign,lineHeight:(ie?.lines[0]?.bounds.height??0)*M+"px",height:(ie?.bounds.height??0)*M,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:R.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:y,onBlur:()=>{le(!1)},onSelect:z=>{},onChange:z=>{L.current&&!Ke.current&&(O.current=!1,he(z.target.value),R.textValue,z.target.value,z.target.selectionStart,z.target.selectionEnd,z.target.selectionDirection,E({start:z.target.selectionStart,end:z.target.selectionEnd,direction:z.target.selectionDirection}))},onMouseDown:z=>{G&&Te(!0)},onKeyDown:J})})})})),Tr=(e,t)=>({clean:e,dirty:t,editMode:!1}),Ir=e=>{const{length:t=0,width:n=1,dashArray:l=null,dashArrayAdditional:a=null,isDouble:i=!1,isAngled:f=!1,offsetX:u=0,offsetY:s=0,isVertical:m=!1,...q}=e,p=V=>{let M=null;if(V&&n>0){M="";for(let P=0;P<V.length;P++)M+=V[P],P<V.length-1&&(M+=",")}return M},h=p(l);let k=h;a&&(k=p(a));let b=n,I=t,A=null;if(i){b=Math.floor(n/2);const V=b+b/2+1;let M=null;M=m?`M ${r.ReactUtils.boundPixel(u+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(u+V)} ${r.ReactUtils.boundPixel(s+I)}`:`M ${r.ReactUtils.boundPixel(u)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(u+I)} ${r.ReactUtils.boundPixel(s+V)}`,A=c.jsx("path",{strokeWidth:b,strokeDasharray:k,d:M,...q})}if(f){b=n/2;const V=b+b/2;let M=k,P=null;P=m?`M ${r.ReactUtils.boundPixel(u+V)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(u+V)} ${r.ReactUtils.boundPixel(s+I)}`:`M ${r.ReactUtils.boundPixel(u)} ${r.ReactUtils.boundPixel(s+V)} L ${r.ReactUtils.boundPixel(u+I)} ${r.ReactUtils.boundPixel(s+V)}`,A=c.jsx("path",{strokeWidth:b,strokeDasharray:M,strokeDashoffset:"1",shapeRendering:"crispEdges",d:P,...q})}let K=null;return K=m?`M ${r.ReactUtils.boundPixel(u+b/2)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(u+b/2)} ${r.ReactUtils.boundPixel(s+I)}`:`M ${r.ReactUtils.boundPixel(u)} ${r.ReactUtils.boundPixel(s+b/2)} L ${r.ReactUtils.boundPixel(u+I)} ${r.ReactUtils.boundPixel(s+b/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:b,strokeDasharray:h,d:K,...q}),A]})};function ao(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Yt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const l of e){const a=ao(l,t),i=typeof a=="function";n.push(i?a:()=>ao(l,null))}return()=>{for(const l of n)l()}}}:function(e){return t=>{for(const n of e)ao(n,t)}},Il=function(){},Er=typeof window<"u",un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},El=Er?o.useLayoutEffect:o.useEffect,Oo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Pt=Er&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],l=o.useState(Oo),a=l[0],i=l[1],f=o.useMemo(function(){return new window.ResizeObserver(function(u){if(u[0]){var s=u[0].contentRect,m=s.x,q=s.y,p=s.width,h=s.height,k=s.top,b=s.left,I=s.bottom,A=s.right;i({x:m,y:q,width:p,height:h,top:k,left:b,bottom:I,right:A})}})},[]);return El(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[Il,Oo]},Fl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Al=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Dl=e=>{const{key:t,points:n,range:l,stroke:a,darkMode:i,forceThinBorder:f=!1,shiftIfWide:u=!1,isVertical:s=!1,intersections:m,layout:q}=e,p=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!p)return null;const h=n[0],k=n[1],b=n[2],I=n[3];let A=1+(s?I-k:b-h),K=0;const V=a.getColor().toRGBA(i).toString(),M=p.description.toLowerCase().includes("double");let P,v;const S=s?"rowStart":"colStart",T=s?"rowEnd":"colEnd",W=s?k:h;if(m?.length>0){const le=m[0];if(le?.range[S]===l[S]){const E=d.IBorder.BuiltInDefinitions.get(le.stroke.getStyle());K=Math.floor(E.width/2)}if(m[m.length-1]?.range[T]===l[T]){const E=d.IBorder.BuiltInDefinitions.get(m[m.length-1].stroke.getStyle());A=Math.floor(A+(E.width===2?0:E.width/2))}if(M){const E=s?"colStart":"rowStart",B=s?"colEnd":"rowEnd",$=s?q?.getRowOffset:q?.getColOffset;let R=0,L=0;P=[],v=[];for(let ee=0;ee<m.length;ee++){const ie=m[ee];if(ie.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&$){const Ce=$(ie.range[S])-(W-K);ie.range[E]<l[E]&&(P.push(Ce-R),R=Ce,P.push(1),R++),ie.range[B]>l[B]&&(v.push(Ce-L),L=Ce,v.push(1),L++)}}P.length>0&&R<A&&P.push(A-R),v.length>0&&L<A&&v.push(A-L)}}let D=s?-Math.floor(p.width/2):-K,O=s?-K:-Math.floor(p.width/2);const G=u&&p.width>2?-1:0;return c.jsx(Ir,{offsetX:h+D+G,offsetY:k+O+G,length:A+K,isVertical:s,stroke:V,width:p.width,dashArray:P??p.pattern,dashArrayAdditional:v,isDouble:M,isAngled:p.description.toLowerCase().includes("slant")},t)},qo=({getBorderAt:e,borderRenderer:t=Dl,getVisibleCells:n,darkMode:l,forceThinBorder:a=!1,defaultColor:i="black",shiftIfWide:f=!1})=>{const u=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>m=>{const q=m.toClipBounds(m.getRangeCoordsBounds(),-3);if(!q)return;const p=u(m);if(p.length===0)return;const h=m.getVisibleColumnOffsets(),k=m.getVisibleRowOffsets();let b=[],I=[];const A=m.getVisibleColumns(),K=m.getVisibleRows(),V=[],M=[],P=[],v=(U,E,B,$,R,L,ee)=>{const ie={index:$,stroke:R,visibleIndex:B,edge:L,length:ee};U[E]||(U[E]=[]),U[E].length>0&&U[E][U[E].length-1]?.index===$?U[E][U[E].length-1]=ie:U[E].push(ie)},S=m.getVisibleRangeCoords(),T=p.length;for(let U=0;U<T;U++){const E=p[U],B=E.coords;if(!B)continue;const $=E?.range??{rowStart:B.rowIndex,colStart:B.colIndex,rowEnd:B.rowIndex,colEnd:B.colIndex};if(!fe.CoordUtils.isRangesIntersect($,S)&&!fe.CoordUtils.isRangeWithinRange($,S))continue;const R=B.colIndex,L=B.rowIndex,ee=h[R],ie=k[L];if($.rowEnd!==$.rowStart){const De=k[$.rowStart]?.spanIndex??-1,Y=k[$.rowEnd]?.spanIndex??k[K[K.length-1]].spanIndex+1;b.push({...$,rowStart:De,rowEnd:Y})}if($.colEnd!==$.colStart){const De=h[$.colStart]?.spanIndex??-1,Y=h[$.colEnd]?.spanIndex??h[A[A.length-1]].spanIndex+1;I.push({...$,colStart:De,colEnd:Y})}const Ce=E.value,Se=e(Ce,U);if(!Se||Se.isEmpty())continue;const he=Se.getLeft(),Te=Se.getTop(),Ke=Se.getRight(),Ee=Se.getBottom();let He=1,J=1;if(!ee||!ie)continue;const ne=ee.spanIndex,pe=ie.spanIndex;he.isNone()||v(V,ne,pe,L,he,d.IBorder.Edge.Left,He),Te.isNone()||v(M,pe,ne,R,Te,d.IBorder.Edge.Top,J),Ke.isNone()||v(V,ne+J,pe,L,Ke,d.IBorder.Edge.Right,He),Ee.isNone()||v(M,pe+He,ne,R,Ee,d.IBorder.Edge.Bottom,J)}const W=(U,E,B)=>{const $=[];return U.forEach((R,L)=>{let ee=null;R.sort((ie,Ce)=>ie.visibleIndex-Ce.visibleIndex);for(let ie=0;ie<R.length;ie++){const Ce=R[ie];if(!Ce?.stroke||E[L]===void 0&&E[L-1]===void 0)continue;let Se=!1;if(B){const Ee=b.length;for(let He=0;!Se&&He<Ee;He++){let J=b[He];J.colStart<=Ce.index&&J.colEnd>=Ce.index&&J.rowStart<L&&J.rowEnd>=L&&(Se=!0)}}else{const Ee=I.length;for(let He=0;!Se&&He<Ee;He++){let J=I[He];J.rowStart<=Ce.index&&J.rowEnd>=Ce.index&&J.colStart<L&&J.colEnd>=L&&(Se=!0)}}if(Se)continue;const he=Ce.stroke?.getColor(),Te=he?he.toRGBA().toString():i,Ke=Ce.stroke.getStyle()+":"+Te;(Ke!==ee?.key||ee&&ee.visibleIndex+1<Ce.visibleIndex)&&(ee&&$.push(ee),ee={key:Ke,index:E[L]??E[L-1]+1,visibleIndex:Ce.visibleIndex,edge:Ce.edge,stroke:Ce.stroke,from:Ce.index,to:Ce.index+Ce.length-1,intersections:[],length:1}),ee.to=Ce.index+Ce.length-1,ee.visibleIndex=Ce.visibleIndex}ee&&$.push(ee)}),$};b=b.sort(Al),I=I.sort(Fl);const D=W(V,A,!1),O=W(M,K,!0);if(D.length===0&&O.length===0)return null;const G=O.length;for(let U=0;U<G;U++){const E=O[U];let B=fe.CommonUtils.findEqualOrGreater(D,E.from,R=>R.index),$=!1;for(;!$;){const R=D[B++];R&&R.index>=E.from&&R.index<=E.to+1&&R.from<=E.index&&R.to+1>=E.index&&(E.intersections.push({stroke:R.stroke,range:{rowStart:R.from,rowEnd:R.to+1,colStart:R.index,colEnd:R.index}}),R.intersections.push({stroke:E.stroke,range:{rowStart:E.index,rowEnd:E.index,colStart:E.from,colEnd:E.to+1}})),$=!R||R.index>E.to+1}}for(let U=0;U<G;U++){const E=O[U];let B=E.stroke;const $=`rBorder:${E.index}:${E.from}:${E.to}:${E.edge}`,R={rowStart:E.index,rowEnd:E.index,colStart:E.from,colEnd:E.to+1},L=m.getLayout(),ee=!1,ie=L.getColOffset(R.colStart),Ce=L.getRowOffset(R.rowStart),Se=[ie,Ce,L.getColOffset(R.colEnd),Ce];P.push(t({key:$,points:Se,stroke:B,darkMode:l,forceThinBorder:a,shiftIfWide:f,range:R,intersections:E.intersections,layout:L,isVertical:ee}))}const le=D.length;for(let U=0;U<le;U++){const E=D[U];let B=E.stroke;const $=`cBorder:${E.index}:${E.from}:${E.to}:${E.edge}`,R={rowStart:E.from,rowEnd:E.to+1,colStart:E.index,colEnd:E.index},L=m.getLayout(),ee=!0,ie=L.getColOffset(R.colStart),Ce=[ie,L.getRowOffset(R.rowStart),ie,L.getRowOffset(R.rowEnd)];P.push(t({key:$,stroke:B,points:Ce,darkMode:l,forceThinBorder:a,shiftIfWide:f,range:R,intersections:E.intersections,layout:L,isVertical:ee}))}return c.jsx("svg",{width:`${q.width}`,height:`${q.height}`,viewBox:`0 0 ${q.width} ${q.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${q.width}px`,height:`${q.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:P},"borders")},[e,l])}},Bo=fe.AnchorLocation.Center,zl=Object.freeze({horizontal:!1,vertical:!1}),Vo=fe.TypesUtils.EmptyTopLeft,Nl=(e,t)=>fe.CoordUtils.EmptyCell,Ll=(e,t)=>new Promise((n,l)=>{l("StaticBorderRenderer does not support scrolling")}),Pl=o.memo(e=>{const{getBorderAt:t,width:n,height:l,style:a,rowCount:i=2,columnCount:f=2,darkMode:u,forceThinBorder:s,children:m,...q}=e,p=o.useRef(null),[h,{width:k,height:b}]=Pt(),I=n??k,A=l??b,K=o.useMemo(()=>{const B=[];for(let $=0;$<i;$++)for(let R=0;R<f;R++){const L={colIndex:R,rowIndex:$};B.push({coords:L,value:L})}return B},[]),V=o.useCallback(B=>K,[K]),{overlay:M}=qo({getVisibleCells:V,getBorderAt:t,darkMode:u,forceThinBorder:s}),P=Math.floor(I/f),v=Math.floor(A/i),S={getColOffset:B=>Math.ceil(B*P)+0,getRowOffset:B=>Math.ceil(B*v)+0,getColIndex:B=>Math.floor((B-0)/P)-1,getRowIndex:B=>Math.floor((B-0)/v)-1},T={rowStart:0,colStart:0,rowEnd:i,colEnd:f},W={x:0,y:0,width:Math.max(0,I)+0,height:Math.max(0,A)+0},D=o.useMemo(()=>{const B={},$=Math.floor(I/f);for(let R=0;R<f;R++)B[R]={offset:R*$,size:$,spanIndex:R};return B},[I,A]),O=o.useMemo(()=>{const B={},$=Math.floor(A/i);for(let R=0;R<i;R++)B[R]={offset:R*$,size:$,spanIndex:R};return B},[I,A]);if(!M)return null;const G={width:I,height:A},le={width:I,height:A},U={getStage:()=>p.current,getTotalSize:()=>G,getViewportSize:()=>le,getLayout:()=>S,getCellCoordsAsRangeCoords:fe.CoordUtils.cellToRange,getVisibleRangeCoords:()=>T,getVisibleRows:()=>{const B=[];for(let $=0;$<i;$++)B.push($);return B},getTotalRangeCoords:()=>T,getRelativePointFromClient:(B,$)=>({x:B,y:$}),getVisibleColumns:()=>{const B=[];for(let $=0;$<f;$++)B.push($);return B},toClipBounds:(B,$)=>W,toViewBounds:B=>B,toAbsoluteBounds:B=>B,getBounds:()=>W,getInsets:()=>null,getRangeCoordsBounds:(B,$)=>null,getVisibleColumnOffsets:()=>D,getVisibleRowOffsets:()=>O,allViews:()=>({[Bo]:U}),getAnchor:()=>Bo,getZoom:()=>1,scrollCellCoordsIntoView:Ll,getCellCoordsFromClient:Nl,getScrollOrientation:()=>zl,getScrollTopLeft:()=>Vo,getFreezeTopLeft:()=>Vo},E=M(U);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...q,children:[c.jsx("div",{ref:Yt([p,h]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:m}),E]})});function Fr(e){var t,n,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Fr(e[t]))&&(l&&(l+=" "),l+=n)}else for(n in e)e[n]&&(l&&(l+=" "),l+=n);return l}function ut(){for(var e,t,n=0,l="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Fr(e))&&(l&&(l+=" "),l+=t);return l}const jl="_sheetxl-sheet_1qeq6_5",Ol="_viewport-overlay_1qeq6_6",Ar=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),c.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),c.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),c.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),c.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},Bl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:l="grey",credits:a="All rights reserved - Michael Ford",feature:i,style:f,...u}=e??{},[s,m]=o.useState(null);o.useEffect(()=>{(async()=>{const v=await d.LicenseManager.getDetails();m(v)})()},[]);const[q,p]=o.useState(!1),h={opacity:.65},k=o.useMemo(()=>{const v=s?.getExceptions(),S=v?.length??0;if(S===0)return null;const T=[];for(let W=0;W<S;W++){const D=v[W];T.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:D},W))}return T},[s,n]);if(s===null||s.isValidFor(i))return null;const b=s.getType(),I=!k&&b.endsWith("ity"),A=s.getLicensee(),K=I?1.6:1,V=135/K,M=37/K;let P=null;return!b&&A?.length>0&&(P=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:A})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...u,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[q?c.jsx(Ar,{style:h}):c.jsx("svg",{width:V,height:M,style:h,children:c.jsx("image",{style:{width:V,height:M},href:"https://www.sheetxl.com/watermark.svg",onError:()=>p(!0)})}),c.jsxs("div",{children:[P,k,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:l},children:a})]})]})})}),Qe=(e,t,n)=>{const l=o.useRef(t);l.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!l.current)return;const i=Object.keys(l.current),f={},u=i.length;for(let m=0;m<u;m++){const q=i[m];f[q]=(p,h)=>{l.current[q]?.(p,h)}}const s=e.addListeners(f,n);if(a)for(let m=0;m<u;m++)f[i[m]](e);return()=>{s?.()}},[e])},In=new d.Color("transparent");function Dr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:l,commands:a,target:i,onStartEdit:f,getViewport:u}=e,s=r.useNotifier(),[m,q]=o.useState(null),[p,h]=o.useState(null),k=o.useRef(null),b=r.useCallbackRef(f,[f]),I=r.useCallbackRef(u,[u]),[A,K]=o.useState(),[V,M]=o.useState(()=>t?.getStyles().parseColor(d.IColor.Scheme.Bg2)),[P,v]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),S=r.useEditMode();o.useRef(S.getMode()).current=S.getMode();const T=r.useGlobalClipboard(),[W,D]=o.useState(fe.CommonUtils.EmptyArray),O=o.useCallback(()=>{if(k.current!==t)return;const g=t.getSelectedRanges();let x=null;W.length>0&&fe.CoordUtils.isCellWithinRange(m,W[0].getRange().getCoords())&&(x=W[0]);const F=t?.getSelectedCell(),C=F?.getCoords()??null;Lt.unstable_batchedUpdates(()=>{ie(x),q(C),h(g)})},[t,W,p,m]),G=o.useCallback(fe.CommonUtils.debounce(O,210),[O]);o.useEffect(()=>{k.current=t,O()},[t]);const le=r.useCallbackRef(()=>t.getRange(m).getCell(),[t,m]),U=r.useCallbackRef(async(g,x,F=null,C=!1,N=!0)=>{const w=g?.label?.(),H=async()=>{const de=await Promise.resolve(N&&s.showBusy(w??"Busy..."));try{await t.doBatch(async()=>x(t),w),C&&S.setMode(null),de&&de()}catch(ge){if(de&&de(),!ge)return;s.showError(ge)}},X=[];let Q=!1;const ce=async()=>(X.push(H),(async()=>{if(!Q){for(Q=!0;X.length>0;){const de=X.shift();de&&await de()}Q=!1}})());if(n){let de=null;if(F!==!1&&g){const ge=F??w;de=new r.SimpleCommand(g.key(),i,{label:ge,description:ge},ce)}n(de)}return ce()},[t,n,s]),E=r.useCallbackRef((g,x,F=!1,C)=>U(g,N=>{const w=N.getSelectedRanges();F&&w.getStyle().update(null,C),w.getStyle().update(x,C),w.autoFit({expandOnly:d.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),B=r.useCallbackRef((g,x,F)=>{U(g,C=>{let N=x;(F||x?.address)&&(N=N??{},!F&&x?.address?.startsWith("#")?F=x?.address.substring(1):F&&(N.displayText=F)),C.getSelectedRange().setHyperlink(N)})},[t]),$=r.useCallbackRef((g,x)=>{U(g,F=>{F.getSelectedRange().setComments(x)})},[t]),R=r.useCallbackRef((g,x)=>{U(g,F=>{F.getSelectedRanges().clear(x)})},[t]),L=r.useCallbackRef(async(g,x,F=!1,C=!1)=>U(g,async N=>{let w=N.getSelectedRanges();F&&(x===d.IRange.Orientation.Row?w=w.getEntireRows(C):x===d.IRange.Orientation.Column&&(w=w.getEntireColumns(C)));let H=null;const X=S.getMode()?.key;if(X==="copy"||X==="cut"){const Q=await T.getClipboard().readReference();Q&&Q.getItemType()==="range"&&(H=Q.getItem(),H.getCoords()||(H=null))}if(H){const Q=await w.insertFrom(H,{...H.getMarkOptions(),orientation:x,autoSelect:!0});!Q||Q.isEntireRows()||Q.isEntireColumns()||Q.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),S.setMode(null)}else w.insert(x,{autoSelect:!0})},"Insert Cells",!1),[S]),[ee,ie]=o.useState(null),Ce=r.useCallbackRef(g=>t.getStyles().setDefaultTableStyle(g),[t]),Se=r.useCallbackRef(g=>{t.getStyles().getTableStyle(g)?.delete()},[t]),he=r.useCallbackRef((g,x)=>{U(g,async F=>{const C=F.getSelectedRange(),N=F.getSelectedCell().getCoords();let w=null,H=0;const X=N.rowIndex>0?F.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex}).getExtended(d.IRange.Direction.Up):null;X&&F.getRange({colStart:N.colIndex,rowStart:X.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowStart}).isContentful()&&(w=d.IRange.Direction.Up,H=N.rowIndex-X.getCoords().rowEnd);const Q=N.colIndex>0?F.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(Q&&F.getRange({colStart:Q.getCoords().colStart,rowStart:N.rowIndex,colEnd:Q.getCoords().colStart,rowEnd:N.rowIndex}).isContentful()){const de=N.colIndex-Q.getCoords().colEnd;(de<H||!w)&&(w=d.IRange.Direction.Left,H=de)}let ce=null;if(w===d.IRange.Direction.Up){if(ce={...X.getCoords()},(ce.rowEnd===N.rowIndex||!F.getRange({colIndex:N.colIndex,rowIndex:N.rowIndex-1}).isContentful())&&ce.rowStart>0&&F.getRange({colIndex:N.colIndex,rowIndex:ce.rowStart-1}).isContentful()){const de=X.getExtended(d.IRange.Direction.Up);ce={colStart:N.colIndex,rowStart:de.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowEnd}}ce.rowEnd=N.rowIndex-1}else if(w===d.IRange.Direction.Left){if(ce={...Q.getCoords()},(ce.colEnd===N.colIndex||!F.getRange({colIndex:N.colIndex-1,rowIndex:N.rowIndex}).isContentful())&&ce.colStart>0&&F.getRange({colIndex:ce.colStart-1,rowIndex:N.rowIndex}).isContentful()){const de=Q.getExtended(d.IRange.Direction.Left);ce={colStart:de.getCoords().colStart,rowStart:N.rowIndex,colEnd:de.getCoords().colEnd,rowEnd:N.rowIndex}}ce.colEnd=N.colIndex-1}if(C.size!==1&&w){const de=C.getCoords(),ge=C.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),we={...ce},be=de.rowStart,me=de.rowEnd,Fe=de.colStart,Oe=de.colEnd,Pe=w===d.IRange.Direction.Up;for(let Be=Fe;Be<=Oe;Be++){we.colStart=Pe?Be:ce.colStart+(Be-Fe),we.colEnd=Pe?Be:ce.colEnd+(Be-Fe);for(let $e=be;$e<=me;$e++){we.rowStart=Pe?ce.rowStart+($e-be):$e,we.rowEnd=Pe?ce.rowEnd+($e-be):$e;const Ge=F.getRange(we).toString();ge.pushAt($e,Be,`=${x}(${Ge})`)}}ge.apply()}else{const de=ce?F.getRange(ce).toString():"",ge=`=${x}(`;b?.({text:`${ge}${de})`,editMode:!0,initialSelection:{start:ge.length,end:ge.length+de.length}})}},!1)},[t]),Te=r.useCallbackRef((g,x,F=!1,C=!0)=>{U(g,async N=>{let w=null;if(ee)return void ee.updateStyleOptions(x);{const Q=N.getSelectedRanges().getFixed(!0),ce=N.getSelectedRange().getDefaultSortCriteria();let de={ranges:Q,hasHeader:ce?.options?.hasHeader??!1};w=C?new Promise((ge,we)=>{const be={tableOptions:de,onCancel:()=>{we()},onDone:me=>{ge(me)},context:{getNames:()=>N.getNames()}};s.showWindow?.("tableNew",be)}):{option:"Ok",tableOptions:de}}const H=await Promise.resolve(w);if(H?.option!=="Ok")throw null;const X=await Promise.resolve(s.showBusy(g.label()));try{await N.getTables().add(H.tableOptions.ranges.at(0),{styleName:x?.name,clearFormatting:F,hasHeader:H.tableOptions.hasHeader}).getRange().select()}catch(Q){X(),s.showError(Q)}X()},!1,!0,!1)},[ee]),Ke=r.useCallbackRef(()=>l,[l]),Ee=r.useCallbackRef(g=>({styles:()=>t.getStyles(),table:()=>g,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),He=r.useCallbackRef(async(g,x,F,C=!0)=>{let N=null;if(!x){let w=t.getSelectedRange();w.size===1&&(w=w.getSurrounding());let H=t.getTables().getItems({address:t.getSelectedRange()});H.length>0&&(x=H[0]),await w.select()}if(x){if(C){try{F&&await x.select()}catch{}N=new Promise(async(w,H)=>{g.update({context:Ee(x)});const X={command:g,commands:y,notifier:s,onDone:ce=>{w(ce)}},Q=await s.showWindow?.("tableDetails",X,{disableAutoDestroy:!0});setTimeout(()=>{Q.focus()},180)})}Promise.resolve(N).then(w=>{},w=>{s.showError(w)})}},[s]),J=r.useCallbackRef(async(g,x,F=!1)=>{let C=null;if(x)x.isITable?C=x:x.getValue()&&(C=x.getValue());else{const N=t.getTables().getItems({address:t.getSelectedRange()});N.length>0&&(C=N[0])}if(C){if(!F){const N=C.getRange().getCoords(),w=(N.colEnd-N.colStart+1)*(N.rowEnd-N.rowStart+1);if(w>1e4&&await s.showOptions({title:"Confirm",description:`Converting a table to range with '${w}' cells will set a large number of cell styles and may affect performance.
10
+ Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}U(g,async()=>{F?C.delete():C.convertToRange()},!1,!0)}},[s]),ne=r.useCallbackRef((g,x,F)=>{U(g,async C=>{let N=C.getSelectedRanges();if(N.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let w=N.at(0);w.size===1&&(w=w.getSurrounding());const H=C.getSelection().getCoords().cell;let X=w.getDefaultSortCriteria(d.IRange.Orientation.Row,H);if(!X){if(F)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let Q=X.options;if(F&&(Q=new Promise((de,ge)=>{const we={range:w,options:X.options,cell:H,onCancel:()=>{ge()},onDone:be=>{be?de(be.options):ge()}};s.showWindow?.("sort",we)})),Q=await Promise.resolve(Q),!Q)return;const ce=await Promise.resolve(s.showBusy(g.label()));try{w.doBatch(()=>{const de={...Q,...x};w.sort(de),w.autoFit({orientations:de?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},g?.label?.())}catch(de){ce(),s.showError(de)}ce()},!1,!1,!1)},[s]),pe=r.useCallbackRef(()=>{console.log("compactedSelection");const g=t.getSelection().getCoords(),x=t.getSelectedRanges().getFlattened().getCoords(),F=(w=>{const H=new Blob([w],{type:"application/javascript"}),X=URL.createObjectURL(H),Q=new Worker(X);return URL.revokeObjectURL(X),Q})("console.log('hello from worker');");setTimeout(()=>{F.terminate(),console.log("Worker terminated")},5e3);let C=-1;for(let w=0;C===-1&&w<x.length;w++)fe.CoordUtils.isCellWithinRange(g.cell,x[w])&&(C=w);if(fe.CoordUtils.isEqualRangesArrays(g.ranges,x))return;const N={cell:g.cell,ranges:x,rangeIndex:C};t.getSelection().updateCoords(N)},[t]),De=r.useCallbackRef(()=>{console.log("selectComments")},[t]),Y=r.useCallbackRef(async(g=!1,x=!1)=>{let F=null;if(x)F=t.getEntireRange();else{const C=t.getSelectedRange();if(C.isEntireRange()){const N=t.getSelection().getCoords().cell,w=t.getRange(N);F=w.getSurrounding(),F.isEntireRange()&&(F=w)}else F=C.getSurrounding({contentOnly:g})}F&&await F.select()},[t]),_=r.useCallbackRef((g,x,F)=>{U(g,async C=>{let N=C.getSelectedRanges();F&&(x===d.IRange.Orientation.Row?N=N.getEntireRows():x===d.IRange.Orientation.Column&&(N=N.getEntireColumns())),N.delete(x)},"Delete Cells")},[t]);r.useCallbackRef(async g=>{let x=null;const F=I(),C=Math.min(F.width-8,480),N=Math.min(F.height-8,288);try{t.getSelectedRanges(),x=await t.getMovables().add({bounds:{x:F.left+(F.width-C)/2,y:F.top+(F.height-N)/2,width:C,height:N},type:"chart",json:g.template}),x.select(),S.setMode(null)}catch(w){s.showError(w)}return x},[t,s]);const ae=r.useCallbackRef(async(g,x,F)=>{const C=await s.showBusy(g.label());try{const N=await t.getMovables().addImage(x,{autoSelect:!0,...F});return C(),S.setMode(null),N}catch(N){C();let w=N;typeof w!="string"&&(console.warn(N),w="Unable to resolve image."),s.showMessage(w,{type:r.NotifierType.Error})}},[t,s]),ve=r.useCallbackRef((g,x)=>{U(g,async F=>{const C=F.getSelectedRanges();C.doBatch(()=>{const N=x===d.IRange.Direction.Up||x===d.IRange.Direction.Down,w=C.getCoords().slice().sort(fe.CoordUtils.createRangeComparator(N?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let H=0;H<w.length;H++){const X=w[H];let Q=X;const ce=F.getRange(Q).getMerges();let de=0,ge=0;if(ce.length>0){const we=ce[0];de=we.rowEnd-we.rowStart,ge=we.colEnd-we.colStart}x===d.IRange.Direction.Left?Q={...X,colStart:X.colEnd+ge}:x===d.IRange.Direction.Right?Q={...X,colEnd:X.colStart+ge}:x===d.IRange.Direction.Up?Q={...X,rowStart:X.rowEnd+de}:x===d.IRange.Direction.Down&&(Q={...X,rowEnd:X.rowStart+de}),F.getRange(Q).autoFill(X,{filler:d.AutoFill.Types.Copy}),F.getRange(X).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:g.label()})})},[s]),ue=r.useCallbackRef(()=>{let g=null;const x=t.getSelectedCell().getCoords();if(x?.rowIndex>0){const F=t.getRange({rowIndex:x.rowIndex-1,colIndex:x.colIndex}).getCell();F&&(g=F.toTextUnformatted(!0))}b?.({text:g})},[t]),[ke,se]=o.useReducer(g=>g+1,0),[ye,qe]=o.useReducer(g=>g+1,0),Me=o.useMemo(()=>[new r.Command("gridlinesToggle",i,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",i,{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",i,{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",i,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",i,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",i,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",i,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",i,{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",i,{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",i,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank.",icon:"ViewZero"}),new r.SimpleCommand("selectComments",i,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>De()),new r.Command("selectAll",i,{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]}]},(g=!1)=>Y(!1,g)),new r.SimpleCommand("selectRegion",i,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Y(!0,!1)),new r.SimpleCommand("breakSelection",i,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>pe()),new r.SimpleCommand("formatTextRotate0",i,{label:"No Text Rotation",description:"Remove all text rotation.",icon:"TextRotation315"}),new r.SimpleCommand("formatTextRotate45",i,{label:"Angle Clockwise",description:"Angle text 45 degrees downward.",icon:"TextRotation45"}),new r.SimpleCommand("formatTextRotate90",i,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left.",icon:"TextRotation90"}),new r.SimpleCommand("formatTextRotate270",i,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right.",icon:"TextRotation2702"}),new r.SimpleCommand("formatTextRotate315",i,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward.",icon:"TextRotation315"}),new r.Command("formatTextRotateCustom",i,{label:"Custom Text Rotation",description:"Angle your text using a custom angle.",icon:"TextRotationCustom"}),new r.SimpleCommand("formatTextRotateVertical",i,{label:"Vertical Text",description:"Stack text vertically.",icon:"TextRotationVertical"}),new r.SimpleCommand("sortAscending",i,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){ne(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",i,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){ne(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",i,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.",icon:"SortCustom"},function(){ne(this,{},!0)}),new r.Command("protectionSheetToggle",i,{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",i,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),new r.Command("formatCellStyle",i,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet.",icon:"PresetStyles"},function(g){E(this,{named:g.getName()},!0)}),new r.Command("formatTableStyle",i,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(g){Te(this,g)}),new r.Command("formatTableStyleClearCellStyles",i,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(g){Te(this,g,!0)}),new r.Command("formatTableStyleClearTableStyle",i,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){Te(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",i,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Ce),new r.Command("deleteTableStyle",i,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Se),new r.Command("formatBorder",i,{label:"Border",description:"Create an outline border."},function(g){E(this,{border:g})}),new r.Command("formatFillColor",i,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(g){E(this,{fill:g})}),new r.Command("formatFontColor",i,{label:"Font Color",description:"Change the color of your text."},function(g){E(this,{font:{fill:g}})}),new r.Command("formatBoldToggle",i,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",i,{label:"Italic",description:"Toggle italic formatting of text.",icon:"TextItalic",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",i,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",icon:"TextUnderline",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",i,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",i,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",i,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",i,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",i,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",i,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",i,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",i,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",i,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",i,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",i,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),new r.Command("formatTextOverflowEllipsisToggle",i,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",i,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",i,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),new r.Command("formatAlignJustifyVerticalToggle",i,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",i,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",i,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",i,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",i,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",i,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",i,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",i,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedHorizontalToggle",i,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",i,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,g=>({font:{size:fo(g.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",i,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,g=>({font:{size:fo(g.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",i,{label:"Font",description:"Select the font your text."},function(g){E(this,{font:{family:g}})}),new r.Command("formatFontSize",i,{label:"Font Size",description:"Change the size of your text."},function(g){E(this,{font:{size:g}})}),new r.Command("formatNumberDialog",i,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(g,x){const F=this,C={initialValue:g??x.state(),context:x.context(),onInputOption:(N,w)=>{E(F,{numberFormat:N})}};s.showWindow?.("numberFormat",C)}),new r.Command("formatNumberFormat",i,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(g){E(this,{numberFormat:g})}),new r.Command("formatNumberFormatGeneralStyle",i,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:d.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",i,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",i,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",i,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",i,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(g){E(this,{numberFormat:g??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",i,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",i,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){E(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",i,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){E(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",i,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){E(this,g=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",i,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){E(this,g=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",i,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",i,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",i,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",i,{label:"Hide Rows",description:"Hide the rows.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",i,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",i,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",i,{label:"Unhide Columns",description:"Unhide the columns.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",i,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",i,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(g){g&&he(this,g.getName())}),new r.Command("insertFunctionSum",i,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){he(this,"SUM")}),new r.Command("insertFunctionAverage",i,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){he(this,"AVERAGE")}),new r.Command("insertFunctionCount",i,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){he(this,"COUNT")}),new r.Command("insertFunctionMax",i,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){he(this,"MAX")}),new r.Command("insertFunctionMin",i,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){he(this,"MIN")}),new r.Command("startEditCurrentTime",i,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b?.({text:t.createTemporaryCell({value:pn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",i,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){b?.({text:t.createTemporaryCell({value:pn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",i,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",i,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",i,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("updateHyperlink",i,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",icon:"InsertHyperlink",context:()=>le,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(g,x){const F=this,C={context:x.context(),onUpdateHyperlink:(N,w)=>{B(F,N,w)}};s.showWindow?.("hyperlink",C)}),new r.Command("openHyperlink",i,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",icon:"InsertHyperlink",context:()=>le},async(g,x)=>{const F=x.context()();if(!F)return;const C=F.getHyperlink();if(C)try{await C.open()}catch(N){s.showError(N)}}),new r.Command("deleteHyperlink",i,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>le},function(g,x){B(this,null,null)}),new r.SimpleCommand("insertNote",i,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(g,x)=>{((F,C)=>{F?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[C," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,x.label())}),new r.Command("updateComments",i,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",icon:"InsertComment",context:()=>le},async function(g,x){const F=this,C={context:x.context(),onUpdateComments:N=>{$(F,N)}};s.showWindow?.("comments",C)}),new r.Command("deleteComments",i,{label:"Delete Comments",description:"Remove any comments.",context:()=>le},function(g,x){$(this,null)}),new r.Command("insertImageFromFile",i,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device.",icon:"InsertImage"},async function(g=null){let x=null,F=null;typeof g=="string"?F=g:x=g?.file?g.file:g,(x||(x=await fe.CommonUtils.openFileDialog(F??"image/*"),x))&&await ae(this,{file:x},g?.options)}),new r.Command("insertImageFromURL",i,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(g){if(!g){const x=await s.showInputOptions({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(x.option!=="Insert")return;g=x.input}g&&ae(this,{fetch:g})}),new r.SimpleCommand("insertTable",i,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Te(this)}),new r.Command("editTable",i,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features.",icon:"InsertTable"},function(g){let x=null,F=!1;g.isITable?x=g:g.getValue()&&(x=g.getValue(),F=!0),He(this,x,F)}),new r.Command("deleteTable",i,{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.`},function(u){re(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
13
+ The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(g){J(this,g,!0)}),new r.Command("convertTableToRange",i,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
14
14
 
15
- The values and the formatting are preserved.`},function(u){re(this,u,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const u=this.context().table();u&&u.setShowTotals(!u.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const u=this.context().table();u&&u.setShowHeaders(!u.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const u=this.context().table();u&&u.setShowFilterButton(!u.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new r.SimpleCommand("startEditValueAbove",l,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ce),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){U(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){U(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."},function(){return U(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."},function(){return U(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."},function(){return U(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 U(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 U(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return W(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return W(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."},function(){return W(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return W(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."},function(){return W(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.",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return fe(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.",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return fe(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."},function(){return fe(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."},function(){return fe(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 j(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 j(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return j(this,u=>{const w=u.getAlignment().getIndent()-1;return{alignment:{indent:w>0?w:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border."},function(){return j(this,u=>{const w={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(w.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),w})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:`Clear only the contents in the cells.
15
+ The values and the formatting are preserved.`,icon:"InsertTable"},function(g){J(this,g,!1)}),new r.Command("tableTotalRowToggle",i,{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 g=this.context().table();g&&g.setShowTotals(!g.getShowTotals())}),new r.Command("tableHeaderRowToggle",i,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const g=this.context().table();g&&g.setShowHeaders(!g.getShowHeaders())}),new r.Command("autoFilterToggle",i,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const g=this.context().table();g&&g.setShowFilterButton(!g.getShowFilterButton())}),new r.Command("autoFilterReapply",i,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",icon:"FilterReapply",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",i,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter..",icon:"FilterClear"}),new r.SimpleCommand("startEditValueAbove",i,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ue),new r.Command("formatPainterToggle",i,{label:"Format Painter",description:"Apply style to another part of your workbook.",icon:"FormatPaint"}),new r.SimpleCommand("insertCells",i,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",icon:"InsertColumn2",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){L(this)}),new r.SimpleCommand("insertCellsShiftRight",i,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right.",icon:"InsertCellsRight"},function(){L(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",i,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward.",icon:"InsertCellsDown"},function(){return L(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",i,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position.",icon:"InsertRow"},function(){return L(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",i,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position.",icon:"InsertColumn2"},function(){return L(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("insertRowsAfter",i,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return L(this,d.IRange.Orientation.Row,!0,!0)}),new r.SimpleCommand("insertColumnsAfter",i,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return L(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",i,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",icon:"DeleteColumns",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return _(this)}),new r.SimpleCommand("deleteCellsShiftUp",i,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward.",icon:"DeleteCellsUp"},function(){return _(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",i,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right.",icon:"DeleteCellsLeft"},function(){return _(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",i,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection.",icon:"DeleteRows"},function(){return _(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",i,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection.",icon:"DeleteColumns"},function(){return _(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",i,{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",i,{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 ve(this,d.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",i,{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 ve(this,d.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",i,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection.",icon:"FillUp"},function(){return ve(this,d.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",i,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection.",icon:"FillLeft"},function(){return ve(this,d.IRange.Direction.Left)}),new r.SimpleCommand("formatBorderAddOutline",i,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return E(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",i,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return E(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",i,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return E(this,g=>{const x=g.getAlignment().getIndent()-1;return{alignment:{indent:x>0?x:0}}})}),new r.SimpleCommand("formatIndentIncrease",i,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return E(this,g=>{const x={alignment:{indent:g.getAlignment().getIndent()+1}};return g.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(x.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),x})}),new r.Command("mergeToggle",i,{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",i,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows.",icon:"MergeHorizontal"}),new r.SimpleCommand("mergeVertical",i,{label:"Merge Vertically",description:"Combine the contents into vertical columns.",icon:"MergeVertical"}),new r.SimpleCommand("unmerge",i,{label:"Unmerge",description:"Split merged cells into multiple cells.",icon:"MergeUnMerge"}),new r.SimpleCommand("clearContents",i,{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(){M(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){M(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(){M(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){M(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},description:`Clears everything from the cells.
17
+ The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){R(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",i,{label:"Clear Formats",scopedLabels:{clear:"Formats"},icon:"ClearFormats",description:"Clear only the formatting that is applied to the cells."},function(){R(this,d.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",i,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){R(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",i,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){R(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",i,{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(){M(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),b=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(Re,!0),u},[a,Re]),[Fe,Ze]=o.useState(!1),[ze,et]=o.useState(!1);o.useEffect(()=>{if(E.current!==t||!p)return;const u=p.getCoords(),w=t.getTables().getItems({address:u[0]});I(V=>me.CommonUtils.isEqualArrays(V,w)?V:w),f&&w[0]&&me.CoordUtils.isCellWithinRange(f,w[0].getRange().getCoords())?we(w[0]??null):we(null);const F=t.getSelectedRanges(),v=F.getMerges().length>0,z=F.isOverlapping();let y=!0;for(let V=0;y&&V<u.length;V++)y=me.CoordUtils.isSingleCell(u[V]);et(z),Ze(w.length===0&&!z&&(v||!y))},[ve,p,t]),r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),w=q.getMode()?.key==="formatPainter";b.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>w}).updateCallback(()=>w?void q.setMode(null):b.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`}}))}},[q,Se,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{xe()}}),Qe(t.getSelection(),{onChange:()=>{Z()}});const oe=()=>{b.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()})}),b.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??Tn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:Tn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},ke=()=>{b.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{K(u)},darkMode:i.darkMode,quickBorder:N,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(()=>{ke()},[N]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed();b.getCommand("openHyperlink").update({disabled:!X().getHyperlink()}),b.getCommand("deleteHyperlink").update({disabled:u||!X().getHyperlink()});const w=X().getHyperlink()?"Edit":"Insert",F="Link";b.getCommand("updateHyperlink").update({label:()=>(X().getHyperlink(),`${w} ${F}`),scopedLabels:{contextMenu:`${w} ${F}…`,insert:`${F}…`,hyperlink:`${w}…`},disabled:u})},[X()?.getHyperlink(),Se]),o.useEffect(()=>{const u=X().getComments(),w=()=>u?"Edit":"Insert",F=()=>u?"Comments":"Comment";b.getCommand("updateComments").update({label:()=>`${w()} ${F()}`,scopedLabels:{contextMenu:`${w()} ${F()}…`,insert:`${F()}…`}})},[X()?.getComments(),Se]),Qe(t,{onViewChange:()=>{const u=t.getView();b.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),b.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),b.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),b.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),b.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),b.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),b.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),b.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),b.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),oe()},onTabColorChange:()=>{oe()},onMergesChange:()=>{xe()},onMovablesChange:()=>{xe()},onTablesChange:()=>{xe()},onProtectionChange:()=>{xe(),ie()},onStyleChange:()=>{oe(),ke(),xe()}}),o.useEffect(()=>{oe(),ke()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),w=$.length>0&&!ue||u,F=Ee(ue),v={context:F};b.getCommand("editTable").update(v),b.getCommand("deleteTable").update(v),b.getCommand("convertTableToRange").update(v);const z={context:F,disabled:w};b.getCommand("formatTableStyle").update({label:ue?"Apply Table Style":"Format As Table",...z}),b.getCommand("formatTableStyleClearCellStyles").update(z),b.getCommand("deleteTableStyle").update(z),b.getCommand("convertTableToRange").update(z),b.getCommand("insertTable").update({disabled:w||$.length>0});const y={context:F,disabled:w||$.length===0};b.getCommand("tableHeaderRowToggle").update(y),b.getCommand("tableTotalRowToggle").update(y),b.getCommand("autoFilterToggle").update(y),b.getCommand("formatTableStyleClearTableStyle").update({...y,disabled:y.disabled||!ue||ue.getStyleOptions().name===null})},[ue,$,Se]),o.useEffect(()=>{b.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:me.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),b.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:me.CommonUtils.findNextStep(t.getView().getZoomScale())})}),b.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),b.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),b.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),b.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),b.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),b.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),b.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),b.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),b.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})}),b.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),b.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),b.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),b.getCommand("insertFunction").update({context:()=>({searchByCategory:async u=>{const w=t.getWorkbook();if(!w)return me.CommonUtils.EmptyArray;const F=await w.getScripts().searchFunctions({category:u,includeBuiltIn:!0});return F.sort((v,z)=>v.getName().localeCompare(z.getName())),F}})})},[t]),o.useEffect(()=>{const u=t.getView().getFreezePanes(),w=()=>u.coords.rowIndex!==0,F=()=>u.coords.colIndex!==0,v=()=>u.coords.rowIndex!==0||u.coords.colIndex!==0;b.getCommand("freezeToggle").updateCallback(()=>{v()?t.getView().setFreezePanes(null):v()?F()?t.getView().setFreezePanes({coords:{rowIndex:f.rowIndex}}):w()&&t.getView().setFreezePanes({coords:{colIndex:f.colIndex}}):t.getView().setFreezePanes({coords:f})}).update({state:v,disabled:()=>!f||!v()&&f.rowIndex===0&&f.colIndex===0}),b.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:w()?0:f.rowIndex}})}).update({state:w,disabled:()=>!f||!w()&&f.rowIndex===0}),b.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:F()?0:f.colIndex}})}).update({state:F,disabled:()=>!f||!F()&&f.colIndex===0}),b.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!v()})},[ve,f,t,i]);const Ae=X().getStyle(),ye=Ae.getFont(),De=Ae.getAlignment(),D=De.getHorizontal(),ee=De.getVertical(),L=De.getOverflow(),G=De.getRotation();return o.useEffect(()=>{b.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>X().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:Oe=>t.createTemporaryCell(Oe)})}),b.getCommand("formatFillColor").update({state:()=>{let Oe=null;const Ye=Ae.getFill();return Ye?.getType()===d.IFill.Type.Solid?Oe=Ye.getColor():Ye?.getType()===d.IFill.Type.Gradient?Oe=Ye.getStops()?.[0]?.getColor():Ye?.getType()===d.IFill.Type.Pattern&&(Oe=Ye.getBackground()),Oe},context:()=>{const Oe=t.getStyles();return{onColorSelect:Ye=>{R(Ye??Tn)},darkMode:i.darkMode,quickColor:P,autoColor:Tn,schemeLookup:Oe.schemeLookup(),recentColors:Oe.recentColors(),addRecentColor:Ye=>Oe.addRecentColor(Ye),clearRecentColors:()=>Oe.clearRecentColors()}}}),b.getCommand("formatFontColor").update({state:()=>ye.toJSON()?.fill?ye.getFill():null,context:()=>{const Oe=t.getStyles();return{onColorSelect:Ye=>{m(Ye)},darkMode:i.darkMode,quickColor:O,autoColor:Oe.getNormal().getFont().getFill(),schemeLookup:Oe.schemeLookup(),recentColors:Oe.recentColors(),addRecentColor:Ye=>Oe.addRecentColor(Ye),clearRecentColors:()=>Oe.clearRecentColors()}}}),b.getCommand("formatNumberFormat").update({state:()=>Ae.getNumberFormat(),context:()=>X}),b.getCommand("formatNumberDialog").update({state:()=>Ae.getNumberFormat(),context:()=>X}),b.getCommand("formatFontFamily").update({state:()=>ye.getFamily()}),b.getCommand("formatFontSize").update({state:()=>ye.getSize()});const u=function(){const Oe=ye.getWeight()||0;return!isNaN(Oe)&&Oe>500};b.getCommand("formatBoldToggle").updateCallback(function(){j(this,{font:{weight:u()?400:700}})}).update({state:u});const w=function(){return ye.getStyle()===d.IFont.Style.Italic};b.getCommand("formatItalicToggle").updateCallback(function(){j(this,{font:{style:w()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:w}),b.getCommand("formatStrikeThroughToggle").updateCallback(function(){j(this,{font:{strike:!ye.getStrike()}})}).update({state:ye.getStrike()}),b.getCommand("formatUnderlinedToggle").updateCallback(function(){j(this,{font:{underline:ye.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===d.IFont.UnderlineStyle.Single}),b.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){j(this,{font:{underline:ye.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===d.IFont.UnderlineStyle.Double}),b.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){j(this,{font:{underline:ye.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),b.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){j(this,{font:{underline:ye.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),b.getCommand("formatSuperscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:ye.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:ye.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),b.getCommand("formatSubscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:ye.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:ye.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const F=()=>L===d.ITextFrame.Overflow.Visible;b.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){j(this,{alignment:{overflow:(F(),d.ITextFrame.Overflow.Visible)}})}).update({state:F});const v=()=>L===d.ITextFrame.Overflow.Wrap;b.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){j(this,{alignment:{overflow:v()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:v});const z=function(){return L===d.ITextFrame.Overflow.Clip};b.getCommand("formatTextOverflowClipToggle").updateCallback(function(){j(this,{alignment:{overflow:z()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:z});const y=function(){return L===d.ITextFrame.Overflow.Shrink};b.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){j(this,{alignment:{overflow:y()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:y});const V=function(){return L===d.ITextFrame.Overflow.Shrink};b.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){j(this,{alignment:{overflow:V()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:V,disabled:!0});const _=function(){return ee===d.ITextFrame.VerticalAlignment.Top};b.getCommand("formatAlignTopToggle").updateCallback(function(){j(this,{alignment:{vertical:_()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:_});const Q=function(){return ee===d.ITextFrame.VerticalAlignment.Center};b.getCommand("formatAlignMiddleToggle").updateCallback(function(){j(this,{alignment:{vertical:Q()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:Q});const se=function(){return ee===d.ITextFrame.VerticalAlignment.Bottom};b.getCommand("formatAlignBottomToggle").updateCallback(function(){j(this,{alignment:{vertical:(se(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:se});const de=function(){return ee===d.ITextFrame.VerticalAlignment.Justify};b.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:de()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:de});const ge=function(){return ee===d.ITextFrame.VerticalAlignment.Distributed};b.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:ge()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ge});const Ce=function(){return D===d.ITextFrame.HorizontalAlignment.Left};b.getCommand("formatAlignLeftToggle").updateCallback(function(){j(this,{alignment:{horizontal:Ce()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:Ce});const be=function(){return D===d.ITextFrame.HorizontalAlignment.Center};b.getCommand("formatAlignCenterToggle").updateCallback(function(){j(this,{alignment:{horizontal:be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:be});const he=function(){return D===d.ITextFrame.HorizontalAlignment.CenterContinuous};b.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Oe={alignment:{horizontal:he()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};j(this,Oe)}).update({state:he});const Ie=function(){return D===d.ITextFrame.HorizontalAlignment.Fill};b.getCommand("formatAlignFillToggle").updateCallback(function(){const Oe={alignment:{horizontal:Ie()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};j(this,Oe)}).update({state:Ie});const Be=function(){return D===d.ITextFrame.HorizontalAlignment.Distributed};b.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){j(this,{alignment:{horizontal:Be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Be});const Ne=function(){return D===d.ITextFrame.HorizontalAlignment.Right};b.getCommand("formatAlignRightToggle").updateCallback(function(){j(this,{alignment:{horizontal:Ne()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:Ne});const Ve=function(){return D===d.ITextFrame.HorizontalAlignment.Justify};b.getCommand("formatAlignJustifyToggle").updateCallback(function(){j(this,{alignment:{horizontal:Ve()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:Ve});const $e=!t.getProtection().isFormatCellsAllowed(),_e=D===d.ITextFrame.HorizontalAlignment.CenterContinuous||D===d.ITextFrame.HorizontalAlignment.Fill;b.getCommand("formatTextRotate0").updateCallback(function(Oe){j(this,{alignment:{rotation:0}})}).update({disabled:$e||_e,state:G===0}),b.getCommand("formatTextRotate45").updateCallback(function(Oe){j(this,{alignment:{rotation:Oe??1?45:0}})}).update({disabled:$e||_e,state:G===45}),b.getCommand("formatTextRotate90").updateCallback(function(Oe){j(this,{alignment:{rotation:Oe??1?90:0}})}).update({disabled:$e||_e,state:G===90}),b.getCommand("formatTextRotate270").updateCallback(function(Oe){j(this,{alignment:{rotation:Oe??1?270:0}})}).update({disabled:$e||_e,state:G===270}),b.getCommand("formatTextRotate315").updateCallback(function(Oe){j(this,{alignment:{rotation:Oe??1?315:0}})}).update({disabled:$e||_e,state:G===315}),b.getCommand("formatTextRotateCustom").updateCallback(function(Oe){j(this,{alignment:{rotation:Oe}})}).update({disabled:$e||_e,state:G??0})},[Ae,t,i,P,O]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),w=t.getSelectedRanges().getMerges().length>0,F=async(Ge,ot)=>{B(ot,async pt=>{const wt=async(gt=!1)=>{const it=await Promise.resolve(s.showBusy(ot.label()));try{const Et=pt.getSelectedRanges();if(Et.merge({orientations:Ge,discardMultipleValues:gt}),Ge===d.IRange.Orientations.Both){const Bt={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};Et.getStyle().update(Bt)}}catch(Et){throw Et}finally{it?.()}};let vt;try{await wt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;vt=!0}if(vt&&s.showOptions){if(await s.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await wt(!0)}},void 0,void 0,!1)},v=Ge=>{B(Ge,async ot=>{try{const pt=ot.getSelectedRanges();pt.unmerge();const wt={alignment:{horizontal:null}};pt.getStyle().update(wt)}catch(pt){throw pt}})};b.getCommand("mergeToggle").updateCallback(function(){me.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(w?v(this):F(d.IRange.Orientations.Both,this))}).update({state:w,disabled:!Fe||u}),b.getCommand("mergeHorizontal").updateCallback(function(){F(d.IRange.Orientations.Column,this)}).update({disabled:!Fe||u}),b.getCommand("mergeVertical").updateCallback(function(){F(d.IRange.Orientations.Row,this)}).update({disabled:!Fe}),b.getCommand("unmerge").updateCallback(function(){v(this)}).update({disabled:!w||!Fe||u});const z={disabled:u};b.getCommand("hideRows").updateCallback(function(){B(this,Ge=>{Ge.getRowHeaders().setHidden(Ge.getSelectedRanges().getCoords(),!0)})}).update(z),b.getCommand("hideColumns").updateCallback(function(){B(this,Ge=>{Ge.getColumnHeaders().setHidden(Ge.getSelectedRanges().getCoords(),!0)})}).update(z),b.getCommand("unhideRows").updateCallback(function(){B(this,Ge=>{Ge.getRowHeaders().setHidden(Ge.getSelectedRanges().getCoords(),!1)})}).update(z),b.getCommand("unhideColumns").updateCallback(function(){B(this,Ge=>{Ge.getColumnHeaders().setHidden(Ge.getSelectedRanges().getCoords(),!1)})}).update(z),b.getCommand("autoFitRows").updateCallback(function(){B(this,Ge=>{Ge.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(z),b.getCommand("autoFitColumns").updateCallback(function(){B(this,Ge=>{Ge.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(z);let y=!1,V=0,_=!1,Q=!1,se=0,de=!1;!p||u||ze||(y=p.isEntireColumnsAny(),y&&!p.isEntireColumns()?_=!0:V=p.getColumnCount(),Q=p.isEntireRowsAny(),Q&&!p.isEntireRows()?de=!0:se=p.getRowCount());const ge={disabled:u||p&&p.getCount()!==1};b.getCommand("sortAscending").update(ge),b.getCommand("sortDescending").update(ge);const Ce={disabled:y||Q||u||ze},be=y||u||ze||de;be&&(V=1);const he=Q||u||ze||_;he&&(se=1);let Ie="",Be="",Ne="",Ve="",$e="",_e="",Oe="",Ye="",at="";V>1&&(_e=Be=V+" ",Oe=Ne="s"),se>1&&(Ye=Ve=se+" ",at=$e="s"),q.getMode()?.key==="copy"?(Ie=Ve=Be="Copied ",Ne=$e="s"):q.getMode()?.key==="cut"&&(Ie=Ve=Be="Cut ",Ne=$e="s");let ht="",qt="";if(p){const Ge=p.getDefaultShiftOrientation()===d.IRange.Orientation.Column;ht=` (${Ge?"Shift Right":"Shift Down"})`,qt=` (${Ge?"Shift Left":"Shift up"})`,b.getCommand("deleteCells").update({label:`Delete Cells${qt}`})}b.getCommand("insertCells").update({label:`Insert ${Ie}Cells${ht}`,scopedLabels:{insertCells:`${Ie}At Selection`}}),b.getCommand("insertCellsShiftRight").update(Ce),b.getCommand("insertCellsShiftDown").update(Ce),b.getCommand("deleteCellsShiftUp").update(Ce),b.getCommand("deleteCellsShiftLeft").update(Ce),b.getCommand("insertRows").update({label:`Insert ${Ve}Row${$e}`,scopedLabels:{insertCells:`${Ve}Row${$e}`},disabled:he}),b.getCommand("insertRowsAfter").update({label:`Insert ${Ve}Row${$e} Below`,disabled:he}),b.getCommand("insertColumns").update({label:`Insert ${Be}Column${Ne}`,scopedLabels:{insertCells:`${Be}Column${Ne}`},disabled:be}),b.getCommand("insertColumnsAfter").update({label:`Insert ${Be}Column${Ne} After`,disabled:be}),b.getCommand("deleteRows").update({label:`Delete ${Ye}Row${at}`,scopedLabels:{deleteCells:`${Ye}Row${at}`},disabled:he}),b.getCommand("deleteColumns").update({label:`Delete ${_e}Column${Oe}`,scopedLabels:{deleteCells:`${_e}Column${Oe}`},disabled:be})},[ve,Fe,ze,p,q,s,Se]),o.useEffect(()=>{const u=t.getProtection(),w=t.getProtection().isLocked(),F=!u.isFormatCellsAllowed(),v={disabled:F};b.getCommand("protectionSheetToggle").updateCallback(async(V,_)=>{let Q=null;try{if(w){let se=null;if(u.hasPassword()){const de=await s.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(de.option!=="Unprotect")return;se=de.input}Q=await Promise.resolve(s.showBusy(_.label())),await u.unlock(se)}else Q=await Promise.resolve(s.showBusy(_.label())),await u.lock();Q?.()}catch(se){Q?.(),s.showError(se)}}).update({state:w,label:()=>w?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:w?"Unprotect":"Protect"}}),b.getCommand("deleteTable").update(v),b.getCommand("sortAscending").update(v),b.getCommand("sortDescending").update(v),b.getCommand("sortCustom")?.update(v),b.getCommand("updateComments").update(v),b.getCommand("deleteComments").update(v),b.getCommand("insertChart")?.update(v),b.getCommand("insertImageFromFile").update(v),b.getCommand("insertImageFromURL").update(v),b.getCommand("formatBorder").update(v),b.getCommand("formatFillColor").update(v),b.getCommand("formatFontColor").update(v),b.getCommand("formatBoldToggle").update(v),b.getCommand("formatItalicToggle").update(v),b.getCommand("formatUnderlinedToggle").update(v),b.getCommand("formatStrikeThroughToggle").update(v),b.getCommand("formatSuperscriptToggle").update(v),b.getCommand("formatSubscriptToggle").update(v),b.getCommand("formatAlignTopToggle").update(v),b.getCommand("formatTextOverflowVisibleToggle").update(v),b.getCommand("formatTextOverflowWrapToggle").update(v),b.getCommand("formatTextOverflowClipToggle").update(v),b.getCommand("formatTextOverflowShrinkToggle").update(v),b.getCommand("formatAlignMiddleToggle").update(v),b.getCommand("formatAlignBottomToggle").update(v),b.getCommand("formatAlignDistributedVerticalToggle").update(v),b.getCommand("formatAlignJustifyVerticalToggle").update(v),b.getCommand("formatAlignLeftToggle").update(v),b.getCommand("formatAlignCenterToggle").update(v),b.getCommand("formatAlignRightToggle").update(v),b.getCommand("formatAlignJustifyToggle").update(v),b.getCommand("formatAlignCenterContinuousToggle").update(v),b.getCommand("formatAlignDistributedHorizontalToggle").update(v),b.getCommand("formatAlignFillToggle").update(v),b.getCommand("formatFontSizeIncrease").update(v),b.getCommand("formatFontSizeDecrease").update(v),b.getCommand("formatFontFamily").update(v),b.getCommand("formatFontSize").update(v),b.getCommand("formatNumberFormat").update(v),b.getCommand("formatNumberFormatGeneralStyle").update(v),b.getCommand("formatNumberFormatNumberStyle").update(v),b.getCommand("formatNumberFormatTimeStyle").update(v),b.getCommand("formatNumberFormatDateStyle").update(v),b.getCommand("formatNumberFormatAccountingStyle").update(v),b.getCommand("formatNumberFormatPercentStyle").update(v),b.getCommand("formatNumberFormatScientificStyle").update(v),b.getCommand("formatNumberFormatCommaStyle").update(v),b.getCommand("formatNumberFormatIncreaseDecimal").update(v),b.getCommand("formatNumberFormatDecreaseDecimal").update(v),b.getCommand("hideColumns").update(v),b.getCommand("unhideColumns").update(v),b.getCommand("hideRows").update(v),b.getCommand("unhideRows").update(v),b.getCommand("insertFunctionSum").update(v),b.getCommand("insertFunctionAverage").update(v),b.getCommand("insertFunctionCount").update(v),b.getCommand("insertFunctionMax").update(v),b.getCommand("insertFunctionMin").update(v),b.getCommand("insertFunction").update(v),b.getCommand("startEditCurrentTime").update(v),b.getCommand("startEditCurrentDate").update(v),b.getCommand("startEditValueAbove").update(v),b.getCommand("fillDown").update(v),b.getCommand("fillRight").update(v),b.getCommand("fillUp").update(v),b.getCommand("fillLeft").update(v),b.getCommand("formatCellStyle").update(v),b.getCommand("formatTableStyle").update(v),b.getCommand("formatPainterToggle").update(v),b.getCommand("formatBorderAddOutline").update(v),b.getCommand("formatBorderClearOutline").update(v),b.getCommand("formatIndentDecrease").update(v),b.getCommand("formatIndentIncrease").update(v),b.getCommand("clearContents").update(v),b.getCommand("clearFormats").update(v),b.getCommand("clearAll").update(v),b.getCommand("clearComments").update(v),b.getCommand("clearHyperlinks").update(v),b.getCommand("autoFilterClear").update(v),b.getCommand("autoFilterReapply").update(v);const z=D===d.ITextFrame.HorizontalAlignment.CenterContinuous||D===d.ITextFrame.HorizontalAlignment.Fill,y={disabled:F||z};b.getCommand("formatTextRotate0").update(y),b.getCommand("formatTextRotate45").update(y),b.getCommand("formatTextRotate90").update(y),b.getCommand("formatTextRotate270").update(y),b.getCommand("formatTextRotate315").update(y),b.getCommand("formatTextRotateCustom").update(y),b.getCommand("formatTextRotateVertical").update(y)},[ve]),b}var Oo,jo;(function(){if(jo)return Oo;jo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof cn=="object"&&cn&&cn.Object===Object&&cn,C=typeof self=="object"&&self&&self.Object===Object&&self,g=l||C||Function("return this")(),s=Object.prototype.toString,f=Math.max,S=Math.min,p=function(){return g.Date.now()};function h(x){var A=typeof x;return!!x&&(A=="object"||A=="function")}function E(x){if(typeof x=="number")return x;if((function(K){return typeof K=="symbol"||(function(P){return!!P&&typeof P=="object"})(K)&&s.call(K)=="[object Symbol]"})(x))return NaN;if(h(x)){var A=typeof x.valueOf=="function"?x.valueOf():x;x=h(A)?A+"":A}if(typeof x!="string")return x===0?x:+x;x=x.replace(e,"");var N=n.test(x);return N||i.test(x)?a(x.slice(2),N?2:8):t.test(x)?NaN:+x}Oo=function(x,A,N){var K,P,R,O,m,q,T=0,$=!1,I=!1,k=!0;if(typeof x!="function")throw new TypeError("Expected a function");function Z(J){var M=K,U=P;return K=P=void 0,T=J,O=x.apply(U,M)}function X(J){var M=J-q;return q===void 0||M>=A||M<0||I&&J-T>=R}function B(){var J=p();if(X(J))return j(J);m=setTimeout(B,(function(M){var U=A-(M-q);return I?S(U,R-(M-T)):U})(J))}function j(J){return m=void 0,k&&K?Z(J):(K=P=void 0,O)}function H(){var J=p(),M=X(J);if(K=arguments,P=this,q=J,M){if(m===void 0)return(function(U){return T=U,m=setTimeout(B,A),$?Z(U):O})(q);if(I)return m=setTimeout(B,A),Z(q)}return m===void 0&&(m=setTimeout(B,A)),O}return A=E(A)||0,h(N)&&($=!!N.leading,R=(I="maxWait"in N)?f(E(N.maxWait)||0,A):R,k="trailing"in N?!!N.trailing:k),H.cancel=function(){m!==void 0&&clearTimeout(m),T=0,K=q=P=m=void 0},H.flush=function(){return m===void 0?O:j(p())},H}})();var Bo,Vo,Po={exports:{}},lo={};Vo||(Vo=1,Po.exports=(function(){if(Bo)return lo;Bo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(s,f){return s===f&&(s!==0||1/s==1/f)||s!=s&&f!=f},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function C(s){var f=s.getSnapshot;s=s.value;try{var S=f();return!t(s,S)}catch{return!0}}var g=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(s,f){return f()}:function(s,f){var S=f(),p=n({inst:{value:S,getSnapshot:f}}),h=p[0].inst,E=p[1];return a(function(){h.value=S,h.getSnapshot=f,C(h)&&E({inst:h})},[s,S,f]),i(function(){return C(h)&&E({inst:h}),s(function(){C(h)&&E({inst:h})})},[s]),l(S),S};return lo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,lo})()),Po.exports;var Ho,Uo,an={exports:{}},Gt={exports:{}},Nl=Gt.exports;function Ko(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Uo)return an.exports;Uo=1;for(var e=(Ho||(Ho=1,function(){var p,h,E,x,A,N;typeof performance<"u"&&performance!==null&&performance.now?Gt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Gt.exports=function(){return(p()-A)/1e6},h=process.hrtime,x=(p=function(){var K;return 1e9*(K=h())[0]+K[1]})(),N=1e9*process.uptime(),A=x-N):Date.now?(Gt.exports=function(){return Date.now()-E},E=Date.now()):(Gt.exports=function(){return new Date().getTime()-E},E=new Date().getTime())}.call(Nl)),Gt.exports),t=typeof window>"u"?cn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],C=0;!a&&C<n.length;C++)a=t[n[C]+"Request"+i],l=t[n[C]+"Cancel"+i]||t[n[C]+"CancelRequest"+i];if(!a||!l){var g=0,s=0,f=[],S=1e3/60;a=function(p){if(f.length===0){var h=e(),E=Math.max(0,S-(h-g));g=E+h,setTimeout(function(){var x=f.slice(0);f.length=0;for(var A=0;A<x.length;A++)if(!x[A].cancelled)try{x[A].callback(g)}catch(N){setTimeout(function(){throw N},0)}},Math.round(E))}return f.push({handle:++s,callback:p,cancelled:!1}),s},l=function(p){for(var h=0;h<f.length;h++)f[h].handle===p&&(f[h].cancelled=!0)}}an.exports=function(p){return a.call(t,p)},an.exports.cancel=function(){l.apply(t,arguments)},an.exports.polyfill=function(p){p||(p=t),p.requestAnimationFrame=a,p.cancelAnimationFrame=l},an.exports})();const wo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:C,onScrollOffset:g,showCustomScrollButtons:s=!1,offset:f=0,totalSize:S=0,viewportSize:p=0,...h}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[E]=Ot(),x=r.useCallbackRef(l,[l]),A=r.useCallbackRef(C,[C]),N=(K=E,P=t,o.useMemo(()=>K===null&&P===null?null:ae=>{Ko(K,ae),Ko(P,ae)},[K,P]));var K,P;const[R,O]=o.useState(()=>{const ae=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?ae.top:ae.left}),m=()=>{const ae=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?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,T]=o.useState(m),[$,I]=o.useState(null),[k,Z]=o.useState(!1),X=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),B=()=>{const ae=a.getUsedRange()?.getCoords()??me.CoordUtils.EmptyRange,Me=a.getSelection().getCoords().cell;return{colIndex:Math.max(ae.colEnd,Me.colIndex),rowIndex:Math.max(ae.rowEnd,Me.rowIndex)}},[j,H]=o.useState(B),J=j?(i===r.ScrollbarOrientation.Vertical?j.rowIndex:j.colIndex)+1:0,M=()=>{const ae=B();me.CoordUtils.isEqualCells(j,ae)||H(ae)};Qe(a.getView(),{onFreezeSplitChange:()=>{T(m)}}),Qe(a.getSelection(),{onChange:M}),Qe(a,{onUsedRangeChange:M}),o.useEffect(()=>{H(B())},[a]),o.useEffect(()=>{if(!$)return k&&A?.(),void Z(!1);const ae=X.getTextAt(X.findIndex(R/(a.getView().getZoomScale()/100)+q.scroll+q.shift));Z(!0),x?.({...$,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ae})},[f,R,q,i,$,X,k,a]);const U=r.useCallbackRef((ae,Me,Ke)=>{O(ae);const Ee=ae+q.scroll,Ue=Me+q.shift,re=Ke+q.shift+q.scroll;g?.(Ee,Ue,re)},[g,q]),ue=f-q.scroll,we=p-q.shift,je=S-(q.shift+q.scroll),Te=X.findOffset(J)*(a.getView().getZoomScale()/100)-(q.scroll+q.shift);return c.jsx(r.VirtualScrollbar,{ref:N,style:n,offset:ue,viewportSize:we,totalSize:je,orientation:i,showCustomScrollButtons:s,onMouseDown:ae=>{I({anchor:{x:ae.clientX,y:ae.clientY}}),ae.preventDefault()},onScrollOffset:U,onMouseOut:()=>{I(null)},onMouseUp:()=>{I(null)},minSize:Te,...h})}));wo.displayName="SheetScrollbar";const $o=(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},Wo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:C=30,containerWidth:g,containerHeight:s,headerText:f,freezeStart:S,gridStyle:p,verticalPadding:h,horizontalPadding:E,onSheetContextMenu:x,onResizeHeadersStart:A,onResizeHeaders:N,onResizeHeadersEnd:K,onResizeHeadersDown:P,onResizeHeadersUp:R,scrollPoint:O,onSelectionStart:m,onSelectionEnd:q}=e,T=o.useMemo(()=>n.getOrientation(),[n]),$=o.useRef(null),[I,k]=o.useReducer(L=>L+1,0),[Z,X]=o.useReducer(L=>L+1,0),B=n?.getSheet(),j=o.useRef(!1);o.useLayoutEffect(()=>{j.current=!0},[n]);const H=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),J=o.useMemo(()=>{const L=T===d.IRange.Orientation.Column;return{left:L?O.left:0,top:L?0:O.top}},[O]),[M,U]=o.useState(B?.getView().getZoomScale()/100),[ue,we]=o.useState(null);Qe(n,{onSizesChange:L=>{U(B?.getView().getZoomScale()/100),Se(fe())}});const je=o.useCallback(()=>{$.current?.invalidate(),X()},[]),Te=o.useCallback(me.CommonUtils.debounce(()=>{je()},10),[]),[ae,Me]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){Me(B?.getSelection().getCoords()),Te()},onProtectionChange(){je()},onViewChange(){Te()}}),o.useLayoutEffect(()=>{Se(fe())},[T,M,C]),o.useLayoutEffect(()=>{we(null),U(n?.getSheet().getView().getZoomScale()/100),Se(fe())},[n]);const Ke=o.useCallback(L=>n.at(L)?.isHidden()||n.at(L)?.getSize()===0,[n]),Ee=o.useCallback((L,G)=>n.hiddenHeadersAt(L,G),[Ke]),Ue=r.useCallbackRef(L=>n.isSelected(L),[n]),re=r.useCallbackRef(L=>n.isSelectedAll(L),[n]),te=o.useCallback(()=>n.getMinSize(),[n]),pe=o.useCallback(()=>n.getMaxSize(),[n]),Le=r.useCallbackRef((L,G,u)=>{G/=M;const w={size:G=Math.max(te(),Math.min(me.CommonUtils.roundAccurately(G,te()),pe())),hidden:!1},F=[];if(G<=0&&(w.hidden=!0,w.size=u),F.push({address:{min:L,max:L},update:w}),G<0){const v=T===d.IRange.Orientation.Column,z=v?ce.getColOffset:ce.getRowOffset,y=v?ce.getColIndex:ce.getRowIndex,V=z(L);let _=y(V+G);const Q=z(_);Q===V+G?_--:F.push({address:{min:_,max:_},update:{size:V-Q+G}}),L-_>1&&F.push({address:{min:_+1,max:L-1},update:{hidden:!0}})}n.updateHeaderPairs(F),N?.(L,G,u)},[I,n,M,N]),Y=r.useCallbackRef((L,G,u)=>{const w=T===d.IRange.Orientation.Column;let F=null,v={min:L,max:L};if(n.isSelectedAll(L)){const z=n.getSelectedRuns();z.length>1?F="Resize "+(w?"Columns":"Rows"):v=z[0];const y={hidden:G<=0,size:(G<=0?u:G)/M};n.updateHeaderPairs($o(z,y,L))}if(v){const z=v.max-v.min+1;let y;y=z===1?n.getRange(v).at(0).getDisplayText():n.getRange(v).toString(),F=`Resize ${w?"Column":"Row"}${z>1?"s":""} '${y}'`}K?.(L,G,F)},[I,n,K]),W=r.useCallbackRef((L,G)=>{const u=T===d.IRange.Orientation.Column;A(L,G,`Resize ${u?"Column":"Row"}(s)`)},[A]),le=r.useCallbackRef(L=>{let G=!1;const u=T===d.IRange.Orientation.Column,w=n.getSheet().getEntireRange().getCoords(),F=[],v=n.getSelectedRuns(),z=y=>{let V;V=u?{colStart:y.min,rowStart:w.rowStart,colEnd:y.max,rowEnd:w.rowEnd}:{colStart:w.colStart,rowStart:y.min,colEnd:w.colEnd,rowEnd:y.max},F.push(V)};for(let y=0;y<v.length;y++){const V=v[y];V.value.isSelectedAll&&(V.min<=L&&V.max>=L&&(G=!0),z(V))}if(G||z({min:L,max:L}),n.getSheet().getRanges(F).autoFit({orientations:u?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),Ke(L)){const y={hidden:null},V=$o(v,y);G||V.push({address:L,update:y}),n.updateHeaderPairs(V)}K?.(L,null,"Resize Column(s)")},[I,n,K,Ke]),fe=()=>{const L=T===d.IRange.Orientation.Column;return{getColOffset:G=>L?n.findOffset(G):G===0?0:C/M,getColIndex:G=>L?n.findIndex(G):0,getRowOffset:G=>L?G===0?0:C/M:n.findOffset(G),getRowIndex:G=>L?0:n.findIndex(G)}},[ce,Se]=o.useState(()=>fe()),ie=o.useCallback((L,G)=>L.nativeEvent.which!==r.MouseButtonCodes.Right||!re(T===d.IRange.Orientation.Column?G.colIndex:G.rowIndex),[T,re]),ve=r.useCallbackRef(L=>{a.focusSheet()},[a]),xe=r.useCallbackRef(L=>{B?.getSelection().updateCoords(L)},[B]),{...Re}=dt.useSelection({gridRef:i,commands:null,layout:ce,selection:ae,fillHandleBorderColor:p.body.fill,selectionBackgroundColor:p.selection.fill,selectionBorderColor:p.selection.strokeFill,selectionRemoveBackgroundColor:p.selectionRemove.fill,selectionRemoveBorderColor:p.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:xe,canSelectionSpanMergedCells:L=>{const G=B.getRange(L);return G.isEntireColumns()||G.isEntireRows()}}),b=r.useCallbackRef(()=>{m?.();const L=B?.getSelection();L&&L.setAdjusting(L.getCoords())},[B,m]),Fe=r.useCallbackRef(async()=>{B?.getSelection().setAdjusting(null),q?.()},[B,q]),{...Ze}=dt.useHeaderSelection({orientation:T,headerCount:H,gridRef:$,gridMainRef:i,newSelection:Re?.newSelection,modifySelection:Re?.modifySelection,appendSelection:Re?.appendSelection,clearSelections:Re?.clearSelections,pointerDownInterceptor:ie,onPointerUp:ve,onDragStart:b,onDragEnd:Fe}),ze=p.selection?.strokeFill;o.useEffect(()=>{if(!$.current)return void we(null);const L=T===d.IRange.Orientation.Column,G=n.getSelectedRuns(),u=n.isProtected()?null:Le,w=(v,z,y)=>{if(y)return L?c.jsx("div",{style:{position:"absolute",borderBottom:`${p.headerSelection.strokeWidth}px solid ${ze}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-p.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(y.x-p.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(y.width+p.headerSelection.strokeWidth+1,!0)}px`,height:C+p.headerSelection.strokeWidth-.5+"px"}},v):c.jsx("div",{style:{position:"absolute",borderRight:`${p.headerSelection.strokeWidth}px solid ${ze}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(y.y-p.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-p.headerSelection.strokeWidth/2)}px`,width:C+p.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(y.height+p.headerSelection.strokeWidth+1,!0)}px`}},v)},F=(v,z,y)=>{const V={x:0,y:0,width:0,height:0};if(L){const _=y.toClipBounds(y.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:v,colEnd:Math.min(H,z)}),dt.SELECTION_CLIP_INSETS);if(!_)return;V.x=_.x,V.width=_.width}else{const _=y.toClipBounds(y.getRangeCoordsBounds({rowStart:v,rowEnd:Math.min(H,z),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!_)return;V.y=_.y,V.height=_.height}return{x:V.x,y:V.y,width:V.width,height:V.height}};we([v=>{const z=[];let y=null,V=L?v.getVisibleColumns():v.getVisibleRows();const _=L?v.getTotalRangeCoords().colStart:v.getTotalRangeCoords().rowStart;V.length>0&&V[0]>_&&(V=[V[0]-1,...V]);let Q=[];const se=[];for(let he=0;he<V.length;he++){const Ie=V[he],Be=he<V.length-1?V[he+1]:Ie+Ee(Ie+1,!1)+1,Ne=Ie+1!==Be;if(!y||y.max<Ie)if(G.length>0&&G[G.length-1].max>=Ie){const _e=me.CommonUtils.findEqualOrGreater(G,Ie,Oe=>Oe.max);y=G[_e]}else y=null;let Ve=!1,$e=!1;if(y?.value&&(y.min<=Ie||y.min<=Be&&!Ne)&&(Ve=!0,$e=y.value.isSelectedAll),Ie===_){let _e=!1,Oe=!1;y?.value&&y.min<=Ie&&(_e=!0,Oe=y.value.isSelectedAll),Ie>0&&se.push({index:Ie-1,isNextHidden:Ne,isSelected:_e,isSelectedAll:Oe,disabledResize:!0})}if($e&&Q.push(se.length),se.push({index:Ie,isHidden:he===0&&Ee(Ie,!1)>0,isNextHidden:Ne,isSelected:Ve,isSelectedAll:$e,onDividerMouseDown:P,onDividerResizeStart:W,onDividerResize:u,onDividerMouseUp:R,onDividerResizeEnd:Y,onDividerAutoFit:le}),Ne){let _e=!1,Oe=!1;if(y&&y.min>=Ie&&y.max<=Be-1&&y.value.isSelectedAll&&Q.push(se.length),!(y?.value&&y.max>=Be))if(G.length>0&&G[G.length-1].max>=Be){const Ye=me.CommonUtils.findEqualOrGreater(G,Be,at=>at.max);y=G[Ye]}else y=null;y?.value&&y.min<=Be&&(_e=y.value.isSelected,Oe=y.value.isSelectedAll),Be>0&&se.push({index:Be-1,isHidden:!0,isSelected:_e,isSelectedAll:Oe,onDividerMouseDown:P,onDividerResizeStart:W,onDividerResize:u,onDividerMouseUp:R,onDividerResizeEnd:Y,onDividerAutoFit:le})}}if(Q.length>0){let he=Q.length-1;if(Q.length>0){const Ne=se[Q[he]].index;let Ve=null;L?(Ve=v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Ne,colEnd:Ne}),Ve.x+Ve.width>v.getBounds().width&&(he-=1,he===0&&(he=-1))):(Ve=v.getRangeCoordsBounds({rowStart:Ne,rowEnd:Ne,colStart:0,colEnd:0}),Ve.y+Ve.height>v.getBounds().height&&(he-=1,he===0&&(he=-1)))}const Ie=G?.[G.length-1],Be=v.getAnchor();if(Be==="t"||Be==="l"){const Ne=se[Q[Math.max(0,Q.length-1)]];Ne.showTouchDivider=Ie&&Ie.max<=Ne.index}else he>=0&&(se[Q[he]].showTouchDivider=!0)}const{header:de,headerSelect:ge,headerSelectAll:Ce,headerHover:be}=p??{};for(let he=0;he<se.length;he++)z.push(c.jsx(dt.HeaderDivider,{orientation:T,view:v,headerStyle:de,headerStyleSelect:ge,headerStyleSelectAll:Ce,headerStyleHover:be,disabled:n.isProtected(),...se[he]},`divider${he}`));return z},v=>{const z=[];for(let y=0;G&&y<G.length;y++)z.push(w(`selection:${v.getAnchor()}:${y}`,0,F(G[y].min,G[y].max,v)));return z}])},[Z,!0,ze,p,ce,H,S,I,M]),o.useEffect(()=>{$.current?.invalidate()},[I]);const et=r.useCallbackRef(L=>f?f(L):n.getTextAt(L),[f,n]),oe=r.useCallbackRef(L=>{const{header:G,headerSelect:u,headerSelectAll:w,headerHover:F}=p??{},{range:v,key:z,...y}=L;return c.jsx(dt.HeaderRenderer,{orientation:T,index:T===d.IRange.Orientation.Column?v.colStart:v.rowStart,isSelected:Ue,isSelectedAll:re,zoomScale:100*M,headerText:et,headerStyle:G,headerStyleSelect:u,headerStyleSelectAll:w,headerStyleHover:F,verticalPadding:h,horizontalPadding:E,...y},z)},[I,H,p,M,n]),ke=r.useEditMode(),Ae=o.useMemo(()=>{const L="white",G="black",u={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let w=T===d.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${G}' fill='${L}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${G}' fill='${L}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;ke.getMode()?.key==="formatPainter"&&(w=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${G}' fill='${L}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),u.cursor=w}return u.backgroundColor=p?.header?.fill||"transparent",u},[T,I,ke,p]),ye=r.useImperativeElement(t,()=>({scrollTo:L=>{$.current?.scrollTo(L)},forceRender:()=>{k()},getGridElement:()=>$.current}),[]),De=o.useCallback(L=>{Ze.onPointerDown(L)},[Ze]),D=o.useCallback(L=>{const G=Ze.getCellCoordsFromClient(L.clientX,L.clientY);if(!G||!x)return;const u=T===d.IRange.Orientation.Column;x({originalEvent:L,clientX:L.clientX,clientY:L.clientY,rowIndex:u?-1:G.rowIndex,colIndex:u?G.colIndex:-1}),L.stopPropagation(),L.preventDefault()},[Ze,x]),ee=o.useMemo(()=>{const L=T===d.IRange.Orientation.Column;return c.jsx("div",{ref:ye,children:c.jsx(dt.Grid,{className:"sheet-header",style:Ae,ref:$,scrollPoint:J,columnCount:L?H:1,rowCount:L?1:H,width:L?g:C,height:L?C:s,freezeLeft:L?S:void 0,freezeTop:L?void 0:S,hiddenColumnsAt:L?Ee:void 0,hiddenRowsAt:L?void 0:Ee,showGridLines:!1,layout:ce,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:D,onPointerDown:De,zoom:M,cellRenderer:oe,overlays:ue})})},[ue,ce,g,s,J,Ae,Z]);return o.useEffect(()=>{j.current=!1,$.current?.invalidate(),X()},[n,p]),ee})),Ll=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,C=r.useCallbackRef((f,S)=>f.getStyle().getBorder(),[]),{overlay:g}=yo({getVisibleCells:a,getBorderAt:C,darkMode:l.body.darkMode,shiftIfWide:!0}),s=g(n);return s&&n?s:null})),Ol={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},jl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Bl={type:d.ICell.Content.Values},Vl={fitDestination:!0,type:d.ICell.Content.Formats},Pl={fitDestination:!0,type:d.ICell.Content.Formulas},Hl={transpose:!0},Ul={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Tr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:C=dt.defaultSelectionRenderer,copyForegroundColor:g="rgb(33, 115, 70)",cutForegroundColor:s="rgb(33, 115, 70)",copyBackgroundColor:f="white",cutBackgroundColor:S="white",...p})=>{const h=r.useCallbackRef(C,[C]),E=o.useRef(null),x=r.useEditMode(),A=x.getMode(),N=o.useMemo(()=>({element:e,doCopy:m=>{const q=t.getSelectedRanges().getSnapshot(m);return new d.RangeClipboardItem(q)}}),[t,n,e]),K=o.useMemo(()=>({element:e,importFromExternal:async(m,q)=>{const T=new d.ExternalRangeClipboardItem(m,q,t.getStyles(),t.isDate1904());return await T.parse()?T:null},doPaste:async(m,q)=>{if(m?.getItemType()!=="range")return;q?.contentsOnly&&delete(q={...q,type:d.ICell.Content.Values}).contentsOnly;const T=t.getSelectedRange(),$=m.getItem(),I=$.getName();return await T.doBatch(async()=>{const k=await T.copyFrom($,q);!k||k.isEntireRows()||k.isEntireColumns()||k.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(I?` ${I}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:P,...R}=r.useCopyPaste({...p,source:N,commands:i,target:K,onClipboardUpdate:m=>{const q=m?.getItemType()==="range"?m:null;if(q){const T=m.editMode?.(),$={...m?.isCut?.()?jl:Ol,...T,args:{isClipboard:!0,...T?.args},onModeChange:I=>{I?.args?.isClipboard||P.clear(!0),T?.onModeChange?.(I)}};x.setMode($)}E.current=q,a?.(q)},onPaste:(m,q)=>{if(m?.getItemType()!=="range")return;let T=x.getMode()?.key==="cut"||m.isCut?.();if(!T&&x.getMode()?.key==="copy"){const $=m.getItem().getCoords(),I=t.getSelectedRanges().getCoords();let k=!1;if(!k&&$&&I&&m.getItem().getSource?.()===t)for(let Z=0;!k&&Z<I.length;Z++)k=me.CoordUtils.isRangesIntersect($,I[Z]);T=k}T&&x.setMode(null),e?.()?.focus(),l?.(m,q)}});o.useMemo(()=>{const m=e;if(!i)return;const q=[new r.Command("pasteValues",m,{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(){R(this)}),new r.Command("freezeToggle",i,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",i,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",i,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",i,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",i,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("autoFitColumns",i,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"})],[]),y=o.useMemo(()=>{let g=null;return g=a?a.createChildGroup(i,"sheet",!1):new r.CommandGroup(i,"sheet"),g.addCommands(Me,!0),g},[a,Me]),[Ae,Ze]=o.useState(!1),[Le,et]=o.useState(!1);o.useEffect(()=>{if(k.current!==t||!p)return;const g=p.getCoords(),x=t.getTables().getItems({address:g[0]});D(H=>fe.CommonUtils.isEqualArrays(H,x)?H:x),m&&x[0]&&fe.CoordUtils.isCellWithinRange(m,x[0].getRange().getCoords())?ie(x[0]??null):ie(null);const F=t.getSelectedRanges(),C=F.getMerges().length>0,N=F.isOverlapping();let w=!0;for(let H=0;w&&H<g.length;H++)w=fe.CoordUtils.isSingleCell(g[H]);et(N),Ze(x.length===0&&!N&&(C||!w))},[ye,p,t]),r.useCommands(a,null,{onChange:()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=S.getMode()?.key==="formatPainter";y.getCommand("formatPainterToggle").update({disabled:g||!a?.getCommand("copy"),state:()=>x}).updateCallback(()=>x?void S.setMode(null):y.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[S,ke,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{qe()}}),Qe(t.getSelection(),{onChange:()=>{G()}});const re=()=>{y.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:g=>{},darkMode:l.darkMode,autoColor:t.getStyles().parseColor(l.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),y.getCommand("formatSheetTabColor").updateCallback(g=>{t.setTabColor(g)}).update({state:()=>t?.getTabColor()??In,context:()=>({onColorSelect:g=>{},darkMode:l.darkMode,autoColor:In,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Ie=()=>{y.getCommand("formatBorder").update({context:()=>({onBorderSelect:g=>{K(g)},darkMode:l.darkMode,quickBorder:A,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:g=>t.getStyles().getNormal().createTemporaryStyle({border:g}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Ie()},[A]),o.useEffect(()=>{const g=!t.getProtection().isInsertHyperlinksAllowed();y.getCommand("openHyperlink").update({disabled:!le().getHyperlink()}),y.getCommand("deleteHyperlink").update({disabled:g||!le().getHyperlink()});const x=le().getHyperlink()?"Edit":"Insert",F="Link";y.getCommand("updateHyperlink").update({label:()=>(le().getHyperlink(),`${x} ${F}`),scopedLabels:{contextMenu:`${x} ${F}…`,insert:`${F}…`,hyperlink:`${x}…`},disabled:g})},[le()?.getHyperlink(),ke]),o.useEffect(()=>{const g=le().getComments(),x=()=>g?"Edit":"Insert",F=()=>g?"Comments":"Comment";y.getCommand("updateComments").update({label:()=>`${x()} ${F()}`,scopedLabels:{contextMenu:`${x()} ${F()}…`,insert:`${F()}…`}})},[le()?.getComments(),ke]),Qe(t,{onViewChange:()=>{const g=t.getView();y.getCommand("sheetViewToggleFormulaView").update({state:g.isShowFormulas()}),y.getCommand("sheetViewToggleShowZeros").update({state:g.isShowZeros()}),y.getCommand("gridlinesToggle").update({state:g.isShowColumnGridlines()||g.isShowRowGridlines()}),y.getCommand("sheetViewToggleGridlinesColumns").update({state:g.isShowColumnGridlines()}),y.getCommand("sheetViewToggleGridlinesRows").update({state:g.isShowRowGridlines()}),y.getCommand("sheetViewToggleShowHeadings").update({state:g.isShowColumnHeaders()||g.isShowRowHeaders()}),y.getCommand("sheetViewToggleShowHeadingColumns").update({state:g.isShowColumnHeaders()}),y.getCommand("sheetViewToggleShowHeadingRows").update({state:g.isShowRowHeaders()}),y.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),re()},onTabColorChange:()=>{re()},onMergesChange:()=>{qe()},onMovablesChange:()=>{qe()},onTablesChange:()=>{qe()},onProtectionChange:()=>{qe(),se()},onStyleChange:()=>{re(),Ie(),qe()}}),o.useEffect(()=>{re(),Ie()},[l]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=W.length>0&&!ee||g,F=Ee(ee),C={context:F};y.getCommand("editTable").update(C),y.getCommand("deleteTable").update(C),y.getCommand("convertTableToRange").update(C);const N={context:F,disabled:x};y.getCommand("formatTableStyle").update({label:ee?"Apply Table Style":"Format As Table",...N}),y.getCommand("formatTableStyleClearCellStyles").update(N),y.getCommand("deleteTableStyle").update(N),y.getCommand("convertTableToRange").update(N),y.getCommand("insertTable").update({disabled:x||W.length>0});const w={context:F,disabled:x||W.length===0};y.getCommand("tableHeaderRowToggle").update(w),y.getCommand("tableTotalRowToggle").update(w),y.getCommand("autoFilterToggle").update(w),y.getCommand("formatTableStyleClearTableStyle").update({...w,disabled:w.disabled||!ee||ee.getStyleOptions().name===null})},[ee,W,ke]),o.useEffect(()=>{y.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:fe.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),y.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:fe.CommonUtils.findNextStep(t.getView().getZoomScale())})}),y.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),y.getCommand("gridlinesToggle").updateCallback(()=>{const g=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!g,showRowGridlines:!g})}),y.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),y.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),y.getCommand("sheetViewFormatGridlinesColor").updateCallback(g=>{t.getView().update({gridLineColor:g})}),y.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const g=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!g,showRowHeaders:!g})}),y.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),y.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),y.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const g=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:g?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:g?d.ISheetView.HeaderTextStyle.One:d.ISheetView.HeaderTextStyle.Zero})}),y.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),y.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),y.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),y.getCommand("insertFunction").update({context:()=>({searchByCategory:async g=>{const x=t.getWorkbook();if(!x)return fe.CommonUtils.EmptyArray;const F=await x.getScripts().searchFunctions({category:g,includeBuiltIn:!0});return F.sort((C,N)=>C.getName().localeCompare(N.getName())),F}})})},[t]),o.useEffect(()=>{const g=t.getView().getFreezePanes(),x=()=>g.coords.rowIndex!==0,F=()=>g.coords.colIndex!==0,C=()=>g.coords.rowIndex!==0||g.coords.colIndex!==0;y.getCommand("freezeToggle").updateCallback(()=>{C()?t.getView().setFreezePanes(null):C()?F()?t.getView().setFreezePanes({coords:{rowIndex:m.rowIndex}}):x()&&t.getView().setFreezePanes({coords:{colIndex:m.colIndex}}):t.getView().setFreezePanes({coords:m})}).update({state:C,disabled:()=>!m||!C()&&m.rowIndex===0&&m.colIndex===0}),y.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:x()?0:m.rowIndex}})}).update({state:x,disabled:()=>!m||!x()&&m.rowIndex===0}),y.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:F()?0:m.colIndex}})}).update({state:F,disabled:()=>!m||!F()&&m.colIndex===0}),y.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!C()})},[ye,m,t,l]);const ze=le().getStyle(),xe=ze.getFont(),Ne=ze.getAlignment(),z=Ne.getHorizontal(),te=Ne.getVertical(),j=Ne.getOverflow(),Z=Ne.getRotation();return o.useEffect(()=>{y.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>le().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:je=>t.createTemporaryCell(je)})}),y.getCommand("formatFillColor").update({state:()=>{let je=null;const Ye=ze.getFill();return Ye?.getType()===d.IFill.Type.Solid?je=Ye.getColor():Ye?.getType()===d.IFill.Type.Gradient?je=Ye.getStops()?.[0]?.getColor():Ye?.getType()===d.IFill.Type.Pattern&&(je=Ye.getBackground()),je},context:()=>{const je=t.getStyles();return{onColorSelect:Ye=>{M(Ye??In)},darkMode:l.darkMode,quickColor:V,autoColor:In,schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:Ye=>je.addRecentColor(Ye),clearRecentColors:()=>je.clearRecentColors()}}}),y.getCommand("formatFontColor").update({state:()=>xe.toJSON()?.fill?xe.getFill():null,context:()=>{const je=t.getStyles();return{onColorSelect:Ye=>{v(Ye)},darkMode:l.darkMode,quickColor:P,autoColor:je.getNormal().getFont().getFill(),schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:Ye=>je.addRecentColor(Ye),clearRecentColors:()=>je.clearRecentColors()}}}),y.getCommand("formatNumberFormat").update({state:()=>ze.getNumberFormat(),context:()=>le}),y.getCommand("formatNumberDialog").update({state:()=>ze.getNumberFormat(),context:()=>le}),y.getCommand("formatFontFamily").update({state:()=>xe.getFamily()}),y.getCommand("formatFontSize").update({state:()=>xe.getSize()});const g=function(){const je=xe.getWeight()||0;return!isNaN(je)&&je>500};y.getCommand("formatBoldToggle").updateCallback(function(){E(this,{font:{weight:g()?400:700}})}).update({state:g});const x=function(){return xe.getStyle()===d.IFont.Style.Italic};y.getCommand("formatItalicToggle").updateCallback(function(){E(this,{font:{style:x()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:x}),y.getCommand("formatStrikeThroughToggle").updateCallback(function(){E(this,{font:{strike:!xe.getStrike()}})}).update({state:xe.getStrike()}),y.getCommand("formatUnderlinedToggle").updateCallback(function(){E(this,{font:{underline:xe.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===d.IFont.UnderlineStyle.Single}),y.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){E(this,{font:{underline:xe.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===d.IFont.UnderlineStyle.Double}),y.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){E(this,{font:{underline:xe.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),y.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){E(this,{font:{underline:xe.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),y.getCommand("formatSuperscriptToggle").updateCallback(function(){E(this,{font:{verticalAlign:xe.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),y.getCommand("formatSubscriptToggle").updateCallback(function(){E(this,{font:{verticalAlign:xe.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const F=()=>j===d.ITextFrame.Overflow.Visible;y.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){E(this,{alignment:{overflow:(F(),d.ITextFrame.Overflow.Visible)}})}).update({state:F});const C=()=>j===d.ITextFrame.Overflow.Wrap;y.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){E(this,{alignment:{overflow:C()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:C});const N=function(){return j===d.ITextFrame.Overflow.Clip};y.getCommand("formatTextOverflowClipToggle").updateCallback(function(){E(this,{alignment:{overflow:N()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:N});const w=function(){return j===d.ITextFrame.Overflow.Shrink};y.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){E(this,{alignment:{overflow:w()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:w});const H=function(){return j===d.ITextFrame.Overflow.Shrink};y.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){E(this,{alignment:{overflow:H()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:H,disabled:!0});const X=function(){return te===d.ITextFrame.VerticalAlignment.Top};y.getCommand("formatAlignTopToggle").updateCallback(function(){E(this,{alignment:{vertical:X()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:X});const Q=function(){return te===d.ITextFrame.VerticalAlignment.Center};y.getCommand("formatAlignMiddleToggle").updateCallback(function(){E(this,{alignment:{vertical:Q()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:Q});const ce=function(){return te===d.ITextFrame.VerticalAlignment.Bottom};y.getCommand("formatAlignBottomToggle").updateCallback(function(){E(this,{alignment:{vertical:(ce(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ce});const de=function(){return te===d.ITextFrame.VerticalAlignment.Justify};y.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){E(this,{alignment:{vertical:de()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:de});const ge=function(){return te===d.ITextFrame.VerticalAlignment.Distributed};y.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){E(this,{alignment:{vertical:ge()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ge});const we=function(){return z===d.ITextFrame.HorizontalAlignment.Left};y.getCommand("formatAlignLeftToggle").updateCallback(function(){E(this,{alignment:{horizontal:we()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:we});const be=function(){return z===d.ITextFrame.HorizontalAlignment.Center};y.getCommand("formatAlignCenterToggle").updateCallback(function(){E(this,{alignment:{horizontal:be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:be});const me=function(){return z===d.ITextFrame.HorizontalAlignment.CenterContinuous};y.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const je={alignment:{horizontal:me()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};E(this,je)}).update({state:me});const Fe=function(){return z===d.ITextFrame.HorizontalAlignment.Fill};y.getCommand("formatAlignFillToggle").updateCallback(function(){const je={alignment:{horizontal:Fe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};E(this,je)}).update({state:Fe});const Oe=function(){return z===d.ITextFrame.HorizontalAlignment.Distributed};y.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){E(this,{alignment:{horizontal:Oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const Pe=function(){return z===d.ITextFrame.HorizontalAlignment.Right};y.getCommand("formatAlignRightToggle").updateCallback(function(){E(this,{alignment:{horizontal:Pe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:Pe});const Be=function(){return z===d.ITextFrame.HorizontalAlignment.Justify};y.getCommand("formatAlignJustifyToggle").updateCallback(function(){E(this,{alignment:{horizontal:Be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:Be});const $e=!t.getProtection().isFormatCellsAllowed(),Ge=z===d.ITextFrame.HorizontalAlignment.CenterContinuous||z===d.ITextFrame.HorizontalAlignment.Fill;y.getCommand("formatTextRotate0").updateCallback(function(je){E(this,{alignment:{rotation:0}})}).update({disabled:$e||Ge,state:Z===0}),y.getCommand("formatTextRotate45").updateCallback(function(je){E(this,{alignment:{rotation:je??1?45:0}})}).update({disabled:$e||Ge,state:Z===45}),y.getCommand("formatTextRotate90").updateCallback(function(je){E(this,{alignment:{rotation:je??1?90:0}})}).update({disabled:$e||Ge,state:Z===90}),y.getCommand("formatTextRotate270").updateCallback(function(je){E(this,{alignment:{rotation:je??1?270:0}})}).update({disabled:$e||Ge,state:Z===270}),y.getCommand("formatTextRotate315").updateCallback(function(je){E(this,{alignment:{rotation:je??1?315:0}})}).update({disabled:$e||Ge,state:Z===315}),y.getCommand("formatTextRotateCustom").updateCallback(function(je){E(this,{alignment:{rotation:je}})}).update({disabled:$e||Ge,state:Z??0})},[ze,t,l,V,P]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=t.getSelectedRanges().getMerges().length>0,F=async(_e,ot)=>{U(ot,async vt=>{const bt=async(ht=!1)=>{const it=await Promise.resolve(s.showBusy(ot.label()));try{const Et=vt.getSelectedRanges();if(Et.merge({orientations:_e,discardMultipleValues:ht}),_e===d.IRange.Orientations.Both){const Ot={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};Et.getStyle().update(Ot)}}catch(Et){throw Et}finally{it?.()}};let Ct;try{await bt()}catch(ht){if(ht.type!=="discardMultipleValues")throw ht;Ct=!0}if(Ct&&s.showOptions){if(await s.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await bt(!0)}},void 0,void 0,!1)},C=_e=>{U(_e,async ot=>{try{const vt=ot.getSelectedRanges();vt.unmerge();const bt={alignment:{horizontal:null}};vt.getStyle().update(bt)}catch(vt){throw vt}})};y.getCommand("mergeToggle").updateCallback(function(){fe.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(x?C(this):F(d.IRange.Orientations.Both,this))}).update({state:x,disabled:!Ae||g}),y.getCommand("mergeHorizontal").updateCallback(function(){F(d.IRange.Orientations.Column,this)}).update({disabled:!Ae||g}),y.getCommand("mergeVertical").updateCallback(function(){F(d.IRange.Orientations.Row,this)}).update({disabled:!Ae}),y.getCommand("unmerge").updateCallback(function(){C(this)}).update({disabled:!x||!Ae||g});const N={disabled:g};y.getCommand("hideRows").updateCallback(function(){U(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),y.getCommand("hideColumns").updateCallback(function(){U(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),y.getCommand("unhideRows").updateCallback(function(){U(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),y.getCommand("unhideColumns").updateCallback(function(){U(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),y.getCommand("autoFitRows").updateCallback(function(){U(this,_e=>{_e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(N),y.getCommand("autoFitColumns").updateCallback(function(){U(this,_e=>{_e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(N);let w=!1,H=0,X=!1,Q=!1,ce=0,de=!1;!p||g||Le||(w=p.isEntireColumnsAny(),w&&!p.isEntireColumns()?X=!0:H=p.getColumnCount(),Q=p.isEntireRowsAny(),Q&&!p.isEntireRows()?de=!0:ce=p.getRowCount());const ge={disabled:g||p&&p.getCount()!==1};y.getCommand("sortAscending").update(ge),y.getCommand("sortDescending").update(ge);const we={disabled:w||Q||g||Le},be=w||g||Le||de;be&&(H=1);const me=Q||g||Le||X;me&&(ce=1);let Fe="",Oe="",Pe="",Be="",$e="",Ge="",je="",Ye="",at="";H>1&&(Ge=Oe=H+" ",je=Pe="s"),ce>1&&(Ye=Be=ce+" ",at=$e="s"),S.getMode()?.key==="copy"?(Fe=Be=Oe="Copied ",Pe=$e="s"):S.getMode()?.key==="cut"&&(Fe=Be=Oe="Cut ",Pe=$e="s");let mt="",qt="";if(p){const _e=p.getDefaultShiftOrientation()===d.IRange.Orientation.Column;mt=` (${_e?"Shift Right":"Shift Down"})`,qt=` (${_e?"Shift Left":"Shift up"})`,y.getCommand("deleteCells").update({label:`Delete Cells${qt}`})}y.getCommand("insertCells").update({label:`Insert ${Fe}Cells${mt}`,scopedLabels:{insertCells:`${Fe}At Selection`}}),y.getCommand("insertCellsShiftRight").update(we),y.getCommand("insertCellsShiftDown").update(we),y.getCommand("deleteCellsShiftUp").update(we),y.getCommand("deleteCellsShiftLeft").update(we),y.getCommand("insertRows").update({label:`Insert ${Be}Row${$e}`,scopedLabels:{insertCells:`${Be}Row${$e}`},disabled:me}),y.getCommand("insertRowsAfter").update({label:`Insert ${Be}Row${$e} Below`,disabled:me}),y.getCommand("insertColumns").update({label:`Insert ${Oe}Column${Pe}`,scopedLabels:{insertCells:`${Oe}Column${Pe}`},disabled:be}),y.getCommand("insertColumnsAfter").update({label:`Insert ${Oe}Column${Pe} After`,disabled:be}),y.getCommand("deleteRows").update({label:`Delete ${Ye}Row${at}`,scopedLabels:{deleteCells:`${Ye}Row${at}`},disabled:me}),y.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${je}`,scopedLabels:{deleteCells:`${Ge}Column${je}`},disabled:be})},[ye,Ae,Le,p,S,s,ke]),o.useEffect(()=>{const g=t.getProtection(),x=t.getProtection().isLocked(),F=!g.isFormatCellsAllowed(),C={disabled:F};y.getCommand("protectionSheetToggle").updateCallback(async(H,X)=>{let Q=null;try{if(x){let ce=null;if(g.hasPassword()){const de=await s.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(de.option!=="Unprotect")return;ce=de.input}Q=await Promise.resolve(s.showBusy(X.label())),await g.unlock(ce)}else Q=await Promise.resolve(s.showBusy(X.label())),await g.lock();Q?.()}catch(ce){Q?.(),s.showError(ce)}}).update({state:x,label:()=>x?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:x?"Unprotect":"Protect"}}),y.getCommand("deleteTable").update(C),y.getCommand("sortAscending").update(C),y.getCommand("sortDescending").update(C),y.getCommand("sortCustom")?.update(C),y.getCommand("updateComments").update(C),y.getCommand("deleteComments").update(C),y.getCommand("insertChart")?.update(C),y.getCommand("insertImageFromFile").update(C),y.getCommand("insertImageFromURL").update(C),y.getCommand("formatBorder").update(C),y.getCommand("formatFillColor").update(C),y.getCommand("formatFontColor").update(C),y.getCommand("formatBoldToggle").update(C),y.getCommand("formatItalicToggle").update(C),y.getCommand("formatUnderlinedToggle").update(C),y.getCommand("formatStrikeThroughToggle").update(C),y.getCommand("formatSuperscriptToggle").update(C),y.getCommand("formatSubscriptToggle").update(C),y.getCommand("formatAlignTopToggle").update(C),y.getCommand("formatTextOverflowVisibleToggle").update(C),y.getCommand("formatTextOverflowWrapToggle").update(C),y.getCommand("formatTextOverflowClipToggle").update(C),y.getCommand("formatTextOverflowShrinkToggle").update(C),y.getCommand("formatAlignMiddleToggle").update(C),y.getCommand("formatAlignBottomToggle").update(C),y.getCommand("formatAlignDistributedVerticalToggle").update(C),y.getCommand("formatAlignJustifyVerticalToggle").update(C),y.getCommand("formatAlignLeftToggle").update(C),y.getCommand("formatAlignCenterToggle").update(C),y.getCommand("formatAlignRightToggle").update(C),y.getCommand("formatAlignJustifyToggle").update(C),y.getCommand("formatAlignCenterContinuousToggle").update(C),y.getCommand("formatAlignDistributedHorizontalToggle").update(C),y.getCommand("formatAlignFillToggle").update(C),y.getCommand("formatFontSizeIncrease").update(C),y.getCommand("formatFontSizeDecrease").update(C),y.getCommand("formatFontFamily").update(C),y.getCommand("formatFontSize").update(C),y.getCommand("formatNumberFormat").update(C),y.getCommand("formatNumberFormatGeneralStyle").update(C),y.getCommand("formatNumberFormatNumberStyle").update(C),y.getCommand("formatNumberFormatTimeStyle").update(C),y.getCommand("formatNumberFormatDateStyle").update(C),y.getCommand("formatNumberFormatAccountingStyle").update(C),y.getCommand("formatNumberFormatPercentStyle").update(C),y.getCommand("formatNumberFormatScientificStyle").update(C),y.getCommand("formatNumberFormatCommaStyle").update(C),y.getCommand("formatNumberFormatIncreaseDecimal").update(C),y.getCommand("formatNumberFormatDecreaseDecimal").update(C),y.getCommand("hideColumns").update(C),y.getCommand("unhideColumns").update(C),y.getCommand("hideRows").update(C),y.getCommand("unhideRows").update(C),y.getCommand("insertFunctionSum").update(C),y.getCommand("insertFunctionAverage").update(C),y.getCommand("insertFunctionCount").update(C),y.getCommand("insertFunctionMax").update(C),y.getCommand("insertFunctionMin").update(C),y.getCommand("insertFunction").update(C),y.getCommand("startEditCurrentTime").update(C),y.getCommand("startEditCurrentDate").update(C),y.getCommand("startEditValueAbove").update(C),y.getCommand("fillDown").update(C),y.getCommand("fillRight").update(C),y.getCommand("fillUp").update(C),y.getCommand("fillLeft").update(C),y.getCommand("formatCellStyle").update(C),y.getCommand("formatTableStyle").update(C),y.getCommand("formatPainterToggle").update(C),y.getCommand("formatBorderAddOutline").update(C),y.getCommand("formatBorderClearOutline").update(C),y.getCommand("formatIndentDecrease").update(C),y.getCommand("formatIndentIncrease").update(C),y.getCommand("clearContents").update(C),y.getCommand("clearFormats").update(C),y.getCommand("clearAll").update(C),y.getCommand("clearComments").update(C),y.getCommand("clearHyperlinks").update(C),y.getCommand("autoFilterClear").update(C),y.getCommand("autoFilterReapply").update(C);const N=z===d.ITextFrame.HorizontalAlignment.CenterContinuous||z===d.ITextFrame.HorizontalAlignment.Fill,w={disabled:F||N};y.getCommand("formatTextRotate0").update(w),y.getCommand("formatTextRotate45").update(w),y.getCommand("formatTextRotate90").update(w),y.getCommand("formatTextRotate270").update(w),y.getCommand("formatTextRotate315").update(w),y.getCommand("formatTextRotateCustom").update(w),y.getCommand("formatTextRotateVertical").update(w)},[ye]),y}var Ho,Uo;(function(){if(Uo)return Ho;Uo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,a=parseInt,i=typeof un=="object"&&un&&un.Object===Object&&un,f=typeof self=="object"&&self&&self.Object===Object&&self,u=i||f||Function("return this")(),s=Object.prototype.toString,m=Math.max,q=Math.min,p=function(){return u.Date.now()};function h(b){var I=typeof b;return!!b&&(I=="object"||I=="function")}function k(b){if(typeof b=="number")return b;if((function(K){return typeof K=="symbol"||(function(V){return!!V&&typeof V=="object"})(K)&&s.call(K)=="[object Symbol]"})(b))return NaN;if(h(b)){var I=typeof b.valueOf=="function"?b.valueOf():b;b=h(I)?I+"":I}if(typeof b!="string")return b===0?b:+b;b=b.replace(e,"");var A=n.test(b);return A||l.test(b)?a(b.slice(2),A?2:8):t.test(b)?NaN:+b}Ho=function(b,I,A){var K,V,M,P,v,S,T=0,W=!1,D=!1,O=!0;if(typeof b!="function")throw new TypeError("Expected a function");function G($){var R=K,L=V;return K=V=void 0,T=$,P=b.apply(L,R)}function le($){var R=$-S;return S===void 0||R>=I||R<0||D&&$-T>=M}function U(){var $=p();if(le($))return E($);v=setTimeout(U,(function(R){var L=I-(R-S);return D?q(L,M-(R-T)):L})($))}function E($){return v=void 0,O&&K?G($):(K=V=void 0,P)}function B(){var $=p(),R=le($);if(K=arguments,V=this,S=$,R){if(v===void 0)return(function(L){return T=L,v=setTimeout(U,I),W?G(L):P})(S);if(D)return v=setTimeout(U,I),G(S)}return v===void 0&&(v=setTimeout(U,I)),P}return I=k(I)||0,h(A)&&(W=!!A.leading,M=(D="maxWait"in A)?m(k(A.maxWait)||0,I):M,O="trailing"in A?!!A.trailing:O),B.cancel=function(){v!==void 0&&clearTimeout(v),T=0,K=S=V=v=void 0},B.flush=function(){return v===void 0?P:E(p())},B}})();var Ko,$o,Wo={exports:{}},so={};$o||($o=1,Wo.exports=(function(){if(Ko)return so;Ko=1;var e=o,t=typeof Object.is=="function"?Object.is:function(s,m){return s===m&&(s!==0||1/s==1/m)||s!=s&&m!=m},n=e.useState,l=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function f(s){var m=s.getSnapshot;s=s.value;try{var q=m();return!t(s,q)}catch{return!0}}var u=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(s,m){return m()}:function(s,m){var q=m(),p=n({inst:{value:q,getSnapshot:m}}),h=p[0].inst,k=p[1];return a(function(){h.value=q,h.getSnapshot=m,f(h)&&k({inst:h})},[s,q,m]),l(function(){return f(h)&&k({inst:h}),s(function(){f(h)&&k({inst:h})})},[s]),i(q),q};return so.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,so})()),Wo.exports;var _o,Go,sn={exports:{}},_t={exports:{}},Vl=_t.exports;function Zo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Go)return sn.exports;Go=1;for(var e=(_o||(_o=1,function(){var p,h,k,b,I,A;typeof performance<"u"&&performance!==null&&performance.now?_t.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(_t.exports=function(){return(p()-I)/1e6},h=process.hrtime,b=(p=function(){var K;return 1e9*(K=h())[0]+K[1]})(),A=1e9*process.uptime(),I=b-A):Date.now?(_t.exports=function(){return Date.now()-k},k=Date.now()):(_t.exports=function(){return new Date().getTime()-k},k=new Date().getTime())}.call(Vl)),_t.exports),t=typeof window>"u"?un:window,n=["moz","webkit"],l="AnimationFrame",a=t["request"+l],i=t["cancel"+l]||t["cancelRequest"+l],f=0;!a&&f<n.length;f++)a=t[n[f]+"Request"+l],i=t[n[f]+"Cancel"+l]||t[n[f]+"CancelRequest"+l];if(!a||!i){var u=0,s=0,m=[],q=1e3/60;a=function(p){if(m.length===0){var h=e(),k=Math.max(0,q-(h-u));u=k+h,setTimeout(function(){var b=m.slice(0);m.length=0;for(var I=0;I<b.length;I++)if(!b[I].cancelled)try{b[I].callback(u)}catch(A){setTimeout(function(){throw A},0)}},Math.round(k))}return m.push({handle:++s,callback:p,cancelled:!1}),s},i=function(p){for(var h=0;h<m.length;h++)m[h].handle===p&&(m[h].cancelled=!0)}}sn.exports=function(p){return a.call(t,p)},sn.exports.cancel=function(){i.apply(t,arguments)},sn.exports.polyfill=function(p){p||(p=t),p.requestAnimationFrame=a,p.cancelAnimationFrame=i},sn.exports})();const So=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:l,sheet:a,onShowTooltip:i,onCloseTooltip:f,onScrollOffset:u,showCustomScrollButtons:s=!1,offset:m=0,totalSize:q=0,viewportSize:p=0,...h}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[k]=Pt(),b=r.useCallbackRef(i,[i]),I=r.useCallbackRef(f,[f]),A=(K=k,V=t,o.useMemo(()=>K===null&&V===null?null:he=>{Zo(K,he),Zo(V,he)},[K,V]));var K,V;const[M,P]=o.useState(()=>{const he=a.getView().getTopLeft();return l===r.ScrollbarOrientation.Vertical?he.top:he.left}),v=()=>{const he=a.getView().getFreezePanes();return l===r.ScrollbarOrientation.Vertical?he.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(he.coords.rowIndex)-he.topLeft.top,scroll:he.topLeft.top}:he.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(he.coords.colIndex)-he.topLeft.left,scroll:he.topLeft.left}},[S,T]=o.useState(v),[W,D]=o.useState(null),[O,G]=o.useState(!1),le=l===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),U=()=>{const he=a.getUsedRange()?.getCoords()??fe.CoordUtils.EmptyRange,Te=a.getSelection().getCoords().cell;return{colIndex:Math.max(he.colEnd,Te.colIndex),rowIndex:Math.max(he.rowEnd,Te.rowIndex)}},[E,B]=o.useState(U),$=E?(l===r.ScrollbarOrientation.Vertical?E.rowIndex:E.colIndex)+1:0,R=()=>{const he=U();fe.CoordUtils.isEqualCells(E,he)||B(he)};Qe(a.getView(),{onFreezeSplitChange:()=>{T(v)}}),Qe(a.getSelection(),{onChange:R}),Qe(a,{onUsedRangeChange:R}),o.useEffect(()=>{B(U())},[a]),o.useEffect(()=>{if(!W)return O&&I?.(),void G(!1);const he=le.getTextAt(le.findIndex(M/(a.getView().getZoomScale()/100)+S.scroll+S.shift));G(!0),b?.({...W,display:(l===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+he})},[m,M,S,l,W,le,O,a]);const L=r.useCallbackRef((he,Te,Ke)=>{P(he);const Ee=he+S.scroll,He=Te+S.shift,J=Ke+S.shift+S.scroll;u?.(Ee,He,J)},[u,S]),ee=m-S.scroll,ie=p-S.shift,Ce=q-(S.shift+S.scroll),Se=le.findOffset($)*(a.getView().getZoomScale()/100)-(S.scroll+S.shift);return c.jsx(r.VirtualScrollbar,{ref:A,style:n,offset:ee,viewportSize:ie,totalSize:Ce,orientation:l,showCustomScrollButtons:s,onMouseDown:he=>{D({anchor:{x:he.clientX,y:he.clientY}}),he.preventDefault()},onScrollOffset:L,onMouseOut:()=>{D(null)},onMouseUp:()=>{D(null)},minSize:Se,...h})}));So.displayName="SheetScrollbar";const Xo=(e,t,n=null)=>{const l=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;l.push({address:{min:e[a].min,max:e[a].max},update:t})}return l},Yo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:l,sheetElement:a,commands:i,oppositeSize:f=30,containerWidth:u,containerHeight:s,headerText:m,freezeStart:q,gridStyle:p,verticalPadding:h,horizontalPadding:k,onSheetContextMenu:b,onResizeHeadersStart:I,onResizeHeaders:A,onResizeHeadersEnd:K,onResizeHeadersDown:V,onResizeHeadersUp:M,scrollPoint:P,onSelectionStart:v,onSelectionEnd:S}=e,T=o.useMemo(()=>n.getOrientation(),[n]),W=o.useRef(null),[D,O]=o.useReducer(j=>j+1,0),[G,le]=o.useReducer(j=>j+1,0),U=n?.getSheet(),E=o.useRef(!1);o.useLayoutEffect(()=>{E.current=!0},[n]);const B=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),$=o.useMemo(()=>{const j=T===d.IRange.Orientation.Column;return{left:j?P.left:0,top:j?0:P.top}},[P]),[R,L]=o.useState(U?.getView().getZoomScale()/100),[ee,ie]=o.useState(null);Qe(n,{onSizesChange:j=>{L(U?.getView().getZoomScale()/100),ke(ve())}});const Ce=o.useCallback(()=>{W.current?.invalidate(),le()},[]),Se=o.useCallback(fe.CommonUtils.debounce(()=>{Ce()},10),[]),[he,Te]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){Te(U?.getSelection().getCoords()),Se()},onProtectionChange(){Ce()},onViewChange(){Se()}}),o.useLayoutEffect(()=>{ke(ve())},[T,R,f]),o.useLayoutEffect(()=>{ie(null),L(n?.getSheet().getView().getZoomScale()/100),ke(ve())},[n]);const Ke=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),Ee=o.useCallback((j,Z)=>n.hiddenHeadersAt(j,Z),[Ke]),He=r.useCallbackRef(j=>n.isSelected(j),[n]),J=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),ne=o.useCallback(()=>n.getMinSize(),[n]),pe=o.useCallback(()=>n.getMaxSize(),[n]),De=r.useCallbackRef((j,Z,g)=>{Z/=R;const x={size:Z=Math.max(ne(),Math.min(fe.CommonUtils.roundAccurately(Z,ne()),pe())),hidden:!1},F=[];if(Z<=0&&(x.hidden=!0,x.size=g),F.push({address:{min:j,max:j},update:x}),Z<0){const C=T===d.IRange.Orientation.Column,N=C?ue.getColOffset:ue.getRowOffset,w=C?ue.getColIndex:ue.getRowIndex,H=N(j);let X=w(H+Z);const Q=N(X);Q===H+Z?X--:F.push({address:{min:X,max:X},update:{size:H-Q+Z}}),j-X>1&&F.push({address:{min:X+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(F),A?.(j,Z,g)},[D,n,R,A]),Y=r.useCallbackRef((j,Z,g)=>{const x=T===d.IRange.Orientation.Column;let F=null,C={min:j,max:j};if(n.isSelectedAll(j)){const N=n.getSelectedRuns();N.length>1?F="Resize "+(x?"Columns":"Rows"):C=N[0];const w={hidden:Z<=0,size:(Z<=0?g:Z)/R};n.updateHeaderPairs(Xo(N,w,j))}if(C){const N=C.max-C.min+1;let w;w=N===1?n.getRange(C).at(0).getDisplayText():n.getRange(C).toString(),F=`Resize ${x?"Column":"Row"}${N>1?"s":""} '${w}'`}K?.(j,Z,F)},[D,n,K]),_=r.useCallbackRef((j,Z)=>{const g=T===d.IRange.Orientation.Column;I(j,Z,`Resize ${g?"Column":"Row"}(s)`)},[I]),ae=r.useCallbackRef(j=>{let Z=!1;const g=T===d.IRange.Orientation.Column,x=n.getSheet().getEntireRange().getCoords(),F=[],C=n.getSelectedRuns(),N=w=>{let H;H=g?{colStart:w.min,rowStart:x.rowStart,colEnd:w.max,rowEnd:x.rowEnd}:{colStart:x.colStart,rowStart:w.min,colEnd:x.colEnd,rowEnd:w.max},F.push(H)};for(let w=0;w<C.length;w++){const H=C[w];H.value.isSelectedAll&&(H.min<=j&&H.max>=j&&(Z=!0),N(H))}if(Z||N({min:j,max:j}),n.getSheet().getRanges(F).autoFit({orientations:g?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),Ke(j)){const w={hidden:null},H=Xo(C,w);Z||H.push({address:j,update:w}),n.updateHeaderPairs(H)}K?.(j,null,"Resize Column(s)")},[D,n,K,Ke]),ve=()=>{const j=T===d.IRange.Orientation.Column;return{getColOffset:Z=>j?n.findOffset(Z):Z===0?0:f/R,getColIndex:Z=>j?n.findIndex(Z):0,getRowOffset:Z=>j?Z===0?0:f/R:n.findOffset(Z),getRowIndex:Z=>j?0:n.findIndex(Z)}},[ue,ke]=o.useState(()=>ve()),se=o.useCallback((j,Z)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!J(T===d.IRange.Orientation.Column?Z.colIndex:Z.rowIndex),[T,J]),ye=r.useCallbackRef(j=>{a.focusSheet()},[a]),qe=r.useCallbackRef(j=>{U?.getSelection().updateCoords(j)},[U]),{...Me}=ct.useSelection({gridRef:l,commands:null,layout:ue,selection:he,fillHandleBorderColor:p.body.fill,selectionBackgroundColor:p.selection.fill,selectionBorderColor:p.selection.strokeFill,selectionRemoveBackgroundColor:p.selectionRemove.fill,selectionRemoveBorderColor:p.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:qe,canSelectionSpanMergedCells:j=>{const Z=U.getRange(j);return Z.isEntireColumns()||Z.isEntireRows()}}),y=r.useCallbackRef(()=>{v?.();const j=U?.getSelection();j&&j.setAdjusting(j.getCoords())},[U,v]),Ae=r.useCallbackRef(async()=>{U?.getSelection().setAdjusting(null),S?.()},[U,S]),{...Ze}=ct.useHeaderSelection({orientation:T,headerCount:B,gridRef:W,gridMainRef:l,newSelection:Me?.newSelection,modifySelection:Me?.modifySelection,appendSelection:Me?.appendSelection,clearSelections:Me?.clearSelections,pointerDownInterceptor:se,onPointerUp:ye,onDragStart:y,onDragEnd:Ae}),Le=p.selection?.strokeFill;o.useEffect(()=>{if(!W.current)return void ie(null);const j=T===d.IRange.Orientation.Column,Z=n.getSelectedRuns(),g=n.isProtected()?null:De,x=(C,N,w)=>{if(w)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${p.headerSelection.strokeWidth}px solid ${Le}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-p.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(w.x-p.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(w.width+p.headerSelection.strokeWidth+1,!0)}px`,height:f+p.headerSelection.strokeWidth-.5+"px"}},C):c.jsx("div",{style:{position:"absolute",borderRight:`${p.headerSelection.strokeWidth}px solid ${Le}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(w.y-p.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-p.headerSelection.strokeWidth/2)}px`,width:f+p.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(w.height+p.headerSelection.strokeWidth+1,!0)}px`}},C)},F=(C,N,w)=>{const H={x:0,y:0,width:0,height:0};if(j){const X=w.toClipBounds(w.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:C,colEnd:Math.min(B,N)}),ct.SELECTION_CLIP_INSETS);if(!X)return;H.x=X.x,H.width=X.width}else{const X=w.toClipBounds(w.getRangeCoordsBounds({rowStart:C,rowEnd:Math.min(B,N),colStart:0,colEnd:0}),ct.SELECTION_CLIP_INSETS);if(!X)return;H.y=X.y,H.height=X.height}return{x:H.x,y:H.y,width:H.width,height:H.height}};ie([C=>{const N=[];let w=null,H=j?C.getVisibleColumns():C.getVisibleRows();const X=j?C.getTotalRangeCoords().colStart:C.getTotalRangeCoords().rowStart;H.length>0&&H[0]>X&&(H=[H[0]-1,...H]);let Q=[];const ce=[];for(let me=0;me<H.length;me++){const Fe=H[me],Oe=me<H.length-1?H[me+1]:Fe+Ee(Fe+1,!1)+1,Pe=Fe+1!==Oe;if(!w||w.max<Fe)if(Z.length>0&&Z[Z.length-1].max>=Fe){const Ge=fe.CommonUtils.findEqualOrGreater(Z,Fe,je=>je.max);w=Z[Ge]}else w=null;let Be=!1,$e=!1;if(w?.value&&(w.min<=Fe||w.min<=Oe&&!Pe)&&(Be=!0,$e=w.value.isSelectedAll),Fe===X){let Ge=!1,je=!1;w?.value&&w.min<=Fe&&(Ge=!0,je=w.value.isSelectedAll),Fe>0&&ce.push({index:Fe-1,isNextHidden:Pe,isSelected:Ge,isSelectedAll:je,disabledResize:!0})}if($e&&Q.push(ce.length),ce.push({index:Fe,isHidden:me===0&&Ee(Fe,!1)>0,isNextHidden:Pe,isSelected:Be,isSelectedAll:$e,onDividerMouseDown:V,onDividerResizeStart:_,onDividerResize:g,onDividerMouseUp:M,onDividerResizeEnd:Y,onDividerAutoFit:ae}),Pe){let Ge=!1,je=!1;if(w&&w.min>=Fe&&w.max<=Oe-1&&w.value.isSelectedAll&&Q.push(ce.length),!(w?.value&&w.max>=Oe))if(Z.length>0&&Z[Z.length-1].max>=Oe){const Ye=fe.CommonUtils.findEqualOrGreater(Z,Oe,at=>at.max);w=Z[Ye]}else w=null;w?.value&&w.min<=Oe&&(Ge=w.value.isSelected,je=w.value.isSelectedAll),Oe>0&&ce.push({index:Oe-1,isHidden:!0,isSelected:Ge,isSelectedAll:je,onDividerMouseDown:V,onDividerResizeStart:_,onDividerResize:g,onDividerMouseUp:M,onDividerResizeEnd:Y,onDividerAutoFit:ae})}}if(Q.length>0){let me=Q.length-1;if(Q.length>0){const Pe=ce[Q[me]].index;let Be=null;j?(Be=C.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Pe,colEnd:Pe}),Be.x+Be.width>C.getBounds().width&&(me-=1,me===0&&(me=-1))):(Be=C.getRangeCoordsBounds({rowStart:Pe,rowEnd:Pe,colStart:0,colEnd:0}),Be.y+Be.height>C.getBounds().height&&(me-=1,me===0&&(me=-1)))}const Fe=Z?.[Z.length-1],Oe=C.getAnchor();if(Oe==="t"||Oe==="l"){const Pe=ce[Q[Math.max(0,Q.length-1)]];Pe.showTouchDivider=Fe&&Fe.max<=Pe.index}else me>=0&&(ce[Q[me]].showTouchDivider=!0)}const{header:de,headerSelect:ge,headerSelectAll:we,headerHover:be}=p??{};for(let me=0;me<ce.length;me++)N.push(c.jsx(ct.HeaderDivider,{orientation:T,view:C,headerStyle:de,headerStyleSelect:ge,headerStyleSelectAll:we,headerStyleHover:be,disabled:n.isProtected(),...ce[me]},`divider${me}`));return N},C=>{const N=[];for(let w=0;Z&&w<Z.length;w++)N.push(x(`selection:${C.getAnchor()}:${w}`,0,F(Z[w].min,Z[w].max,C)));return N}])},[G,!0,Le,p,ue,B,q,D,R]),o.useEffect(()=>{W.current?.invalidate()},[D]);const et=r.useCallbackRef(j=>m?m(j):n.getTextAt(j),[m,n]),re=r.useCallbackRef(j=>{const{header:Z,headerSelect:g,headerSelectAll:x,headerHover:F}=p??{},{range:C,key:N,...w}=j;return c.jsx(ct.HeaderRenderer,{orientation:T,index:T===d.IRange.Orientation.Column?C.colStart:C.rowStart,isSelected:He,isSelectedAll:J,zoomScale:100*R,headerText:et,headerStyle:Z,headerStyleSelect:g,headerStyleSelectAll:x,headerStyleHover:F,verticalPadding:h,horizontalPadding:k,...w},N)},[D,B,p,R,n]),Ie=r.useEditMode(),ze=o.useMemo(()=>{const j="white",Z="black",g={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let x=T===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='${Z}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Z}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Ie.getMode()?.key==="formatPainter"&&(x=`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='${Z}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),g.cursor=x}return g.backgroundColor=p?.header?.fill||"transparent",g},[T,D,Ie,p]),xe=r.useImperativeElement(t,()=>({scrollTo:j=>{W.current?.scrollTo(j)},forceRender:()=>{O()},getGridElement:()=>W.current}),[]),Ne=o.useCallback(j=>{Ze.onPointerDown(j)},[Ze]),z=o.useCallback(j=>{const Z=Ze.getCellCoordsFromClient(j.clientX,j.clientY);if(!Z||!b)return;const g=T===d.IRange.Orientation.Column;b({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:g?-1:Z.rowIndex,colIndex:g?Z.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[Ze,b]),te=o.useMemo(()=>{const j=T===d.IRange.Orientation.Column;return c.jsx("div",{ref:xe,children:c.jsx(ct.Grid,{className:"sheet-header",style:ze,ref:W,scrollPoint:$,columnCount:j?B:1,rowCount:j?1:B,width:j?u:f,height:j?f:s,freezeLeft:j?q:void 0,freezeTop:j?void 0:q,hiddenColumnsAt:j?Ee:void 0,hiddenRowsAt:j?void 0:Ee,showGridLines:!1,layout:ue,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:z,onPointerDown:Ne,zoom:R,cellRenderer:re,overlays:ee})})},[ee,ue,u,s,$,ze,G]);return o.useEffect(()=>{E.current=!1,W.current?.invalidate(),le()},[n,p]),te})),Hl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,getVisibleCells:a,gridStyle:i}=e,f=r.useCallbackRef((m,q)=>m.getStyle().getBorder(),[]),{overlay:u}=qo({getVisibleCells:a,getBorderAt:f,darkMode:i.body.darkMode,shiftIfWide:!0}),s=u(n);return s&&n?s:null})),Ul={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Kl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},$l={type:d.ICell.Content.Values},Wl={fitDestination:!0,type:d.ICell.Content.Formats},_l={fitDestination:!0,type:d.ICell.Content.Formulas},Gl={transpose:!0},Zl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},zr=({element:e,sheet:t,sheetView:n,commands:l,onClipboardUpdate:a,onPaste:i,selectionRenderer:f=ct.defaultSelectionRenderer,copyForegroundColor:u="rgb(33, 115, 70)",cutForegroundColor:s="rgb(33, 115, 70)",copyBackgroundColor:m="white",cutBackgroundColor:q="white",...p})=>{const h=r.useCallbackRef(f,[f]),k=o.useRef(null),b=r.useEditMode(),I=b.getMode(),A=o.useMemo(()=>({element:e,doCopy:v=>{const S=t.getSelectedRanges().getSnapshot(v);return new d.RangeClipboardItem(S)}}),[t,n,e]),K=o.useMemo(()=>({element:e,importFromExternal:async(v,S)=>{const T=new d.ExternalRangeClipboardItem(v,S,t.getStyles(),t.isDate1904());return await T.parse()?T:null},doPaste:async(v,S)=>{if(v?.getItemType()!=="range")return;S?.contentsOnly&&delete(S={...S,type:d.ICell.Content.Values}).contentsOnly;const T=t.getSelectedRange(),W=v.getItem(),D=W.getName();return await T.doBatch(async()=>{const O=await T.copyFrom(W,S);!O||O.isEntireRows()||O.isEntireColumns()||O.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(D?` ${D}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:V,...M}=r.useCopyPaste({...p,source:A,commands:l,target:K,onClipboardUpdate:v=>{const S=v?.getItemType()==="range"?v:null;if(S){const T=v.editMode?.(),W={...v?.isCut?.()?Kl:Ul,...T,args:{isClipboard:!0,...T?.args},onModeChange:D=>{D?.args?.isClipboard||V.clear(!0),T?.onModeChange?.(D)}};b.setMode(W)}k.current=S,a?.(S)},onPaste:(v,S)=>{if(v?.getItemType()!=="range")return;let T=b.getMode()?.key==="cut"||v.isCut?.();if(!T&&b.getMode()?.key==="copy"){const W=v.getItem().getCoords(),D=t.getSelectedRanges().getCoords();let O=!1;if(!O&&W&&D&&v.getItem().getSource?.()===t)for(let G=0;!O&&G<D.length;G++)O=fe.CoordUtils.isRangesIntersect(W,D[G]);T=O}T&&b.setMode(null),e?.()?.focus(),i?.(v,S)}});o.useMemo(()=>{const v=e;if(!l)return;const S=[new r.Command("pasteValues",v,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
20
20
 
21
- The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",m,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
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.`}),new r.Command("pasteFormulas",m,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",m,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",m,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(q,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const m={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(q=>R.paste({...Bl,...q})).update(m),i.getCommand("pasteFormats").updateCallback((q,T)=>R.paste({...Vl,description:T.label(),...q})).update(m),i.getCommand("pasteFormulas").updateCallback((q,T)=>R.paste({...Pl,description:T.label(),...q})).update(m),i.getCommand("pasteTranspose").updateCallback((q,T)=>R.paste({...Hl,description:T.label(),...q})).update(m),i.getCommand("pasteLinks").updateCallback((q,T)=>R.paste({...Ul,description:T.label(),...q})).update(m),i.getCommand("cut").update(m),i.getCommand("paste").update(m)},[t,i]);const O=o.useMemo(()=>{if(!A||!E.current)return;const m=A.key;if(m!=="copy"&&m!=="cut"&&m!=="formatPainter")return;const q=E.current.getItem();if(q.getSource()!==t)return;const T=E.current.isCut?.(),$=T?S:f,I=T?s:g,k=q.getCoords(),Z=k?[k]:null;return Z&&Z.length!==0?X=>{const B=[];for(let j=0;j<Z.length;j++){const H=Z[j],J=X.toClipBounds(X.getRangeCoordsBounds(H,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);J&&(B.push(h({range:H,key:`copy-selection-background-${j}`,x:J.x,y:J.y,width:Math.max(J.width,0),height:Math.max(J.height,0),stroke:$,strokeWidth:2})),B.push(h({range:H,key:`copy-selection-foreground-${j}`,x:J.x+(J.width<=2?-1:0),y:J.y,width:Math.max(J.width,3),height:Math.max(J.height,3),stroke:I,strokeWidth:2,isAnimatedStroke:!0})))}return B}:null},[A,t,n,g,f,s,S]);return{...R,clipboard:P,overlays:O}},Kl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:C}=e,g=l.body??{},s=a.getView(),{overlays:f}=Tr({element:i,sheet:a,sheetView:s,commands:C,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:g.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:g.fill});return Qe(a?.getSelection(),{onChange(S){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),f&&n?f(n):null})),$l="_sheet-selection_12wyx_5",Wl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Gl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},_l={key:"dragCopy",description:"Drag selection to copy cell contents."},Zl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Go=(e,t)=>t.ctrlKey&&t.shiftKey?Zl:t.ctrlKey?_l:t.shiftKey?Gl:Wl,Xl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:C,onCloseTooltip:g,sheet:s,gridRef:f,gridStyle:S,isActive:p,editingCoords:h,...E}=e,x=n?.getBounds(),A=r.useCallbackRef(C,[C]),N=r.useCallbackRef(g,[g]),[K,P]=o.useState(()=>s?.getSelection().getCoords()),R=r.useCallbackRef(Y=>{me.CoordUtils.isEqualSelectionCoords(Y,K)||s&&s.getSelection().updateCoords(Y)},[s,K]),O=r.useEditMode(),m=o.useRef(null),[q,T]=o.useState(s?.getProtection().isLocked()),[$,I]=o.useState(s?.getView().getMovableSelection().length>0),k=r.ReactUtils.detectIt().primaryInput==="touch",Z=!k&&p,X=h!==null||$,B=r.useCallbackRef(Y=>{const W=me.CoordUtils.cellToRange(Y);if(s.isClosed())return W;const le=s.getRange(W,{excludeHidden:!0}).getMerges();return le.length===0?W:le[0]},[s]),j=r.useCallbackRef((Y,W,le,fe,ce,Se)=>{const ie=s.getSelectedRange().getExtended(fe,Y).getCoords();switch(fe){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}},[s]),H=r.useCallbackRef(()=>{const Y=s.getUsedRange()?.getCoords(),W=s.getRowHeaders().getUsedRange()?.getCoords(),le=s.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,le?.max??0),rowEnd:Math.max(Y?.rowEnd??0,W?.max??0)}},[s]),J=r.useCallbackRef((Y,W)=>s.getRowHeaders().hiddenHeadersAt(Y,W),[s]),M=r.useCallbackRef((Y,W)=>s.getColumnHeaders().hiddenHeadersAt(Y,W),[s]),U=r.useCallbackRef(Y=>s.getRange(Y,{excludeHidden:!0}).getMerges(),[s]),ue=r.useCallbackRef(Y=>{s?.getSelection().setAdjusting(Y)},[s]),we=r.useCallbackRef(async()=>{s?.getSelection().setAdjusting(null),O.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),O.setMode(null))},[O,K,s,i]),je=o.useMemo(()=>{const Y=O.getMode();return Y?.key==="cut"||Y?.key==="copy"},[O]);Qe(s?.getView(),{onMovableSelectionChange:()=>{I(s.getView().getMovableSelection().length>0)}}),Qe(s?.getSelection(),{onChange(Y){const W=s.getSelection().getCoords();P(W)}}),Qe(s,{onProtectionChange:()=>{T(s.getProtection().isLocked())}});const{body:Te={}}=S||{},ae=r.useNotifier(),Me=n.getLayout(),Ke=!(Z&&K.ranges.length<=1&&h===null&&!q&&(!O.getMode()||je)),{cursor:Ee,overlay:Ue,onPointerDown:re}=dt.useSelection({gridRef:f,commands:i,layout:Me,getCellCoordsAsRangeCoords:B,selection:K,fillHandleBorderColor:Te.fill,selectionBackgroundColor:p?S.selection.fill:S.selectionInactive.fill,selectionBorderColor:p?S.selection.strokeFill:S.selectionInactive.strokeFill,selectionRemoveBackgroundColor:p?S.selectionRemove.fill:S.selectionInactive.fill,selectionRemoveBorderColor:p?S.selectionRemove.strokeFill:S.selectionInactive.strokeFill,disableFillDrag:Ke,disableMoveDrag:k||!(p&&K.ranges.length<=1&&h===null&&!q),disableTouchSelection:X,onSelectionChange:R,onSelectionDragStart:ue,onSelectionDragEnd:we,onMoveDragStart:(Y,W,le)=>{O.setMode(Go(0,le))},onMoveDragUpdate:(Y,W,le)=>{O.setMode(Go(0,le))},onMoveDragEnd:(Y,W)=>{O.setMode(null)},onMoveDragDone:async(Y,W,le)=>{if(me.CoordUtils.isEqualRanges(Y,W))return;const fe=s.getRange(W);if(ae?.showOptions){const xe=fe.getDifferences(Y);let Re=!1;const b=xe.getCount();for(let Fe=0;!Re&&Fe<b;Fe++)Re=xe.at(Fe).isContentful();if(Re&&await ae?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ce=!le.ctrlKey,Se=le.shiftKey,ie=Se?ce?"Insert Moved Cells":"Insert Copied Cells":ce?"Move Cells":"Copy Cells",ve=await ae?.showBusy?.(ie);try{const xe=s.getRange(Y);await fe.doBatch(async()=>{Se?await fe.insertFrom(Y,{isCut:ce,undoRange:xe}):await fe.copyFrom(Y,{isCut:ce,undoRange:xe}),xe.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),fe.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ie,autoSelect:!0})}catch(xe){ae?.showError?.(xe)}finally{ve?.()}},contentfulCellFinder:j,hiddenRowsAt:J,hiddenColumnsAt:M,mergedRanges:U,getDataCoords:H,canSelectionSpanMergedCells:Y=>{const W=s.getRange(Y);return W.isEntireColumns()||W.isEntireRows()},onFill:async(Y,W)=>{const le="Auto Fill",fe=await ae?.showBusy?.(le);try{await s.doBatch(()=>{s.getRange(Y).autoFill(W),s.getRange(W).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:le,autoSelect:!0})}catch(ce){ae?.showError?.(ce)}finally{m.current=null,fe?.()}},onFillPreview:(Y,W,le)=>{if(f.current&&A){O.setMode(Xl);try{m.current?.direction!==le&&(m.current=null,s.getRange(Y).autoFill(W,{previewOnly:b=>{m.current={callback:b,direction:le}}}));const fe=m.current?.callback?.(W);if(!fe||fe.isEmpty())return;const ce=fe.toText();if(!ce)return;const Se=me.CoordUtils.cellToRange(fe.getCoords()),ie=n.getRelativePointFromClient(0,0);let ve=0,xe=0,Re=r.ToolTipPlacement.Bottom;if(le===d.IRange.Direction.Down){ve=Me.getColOffset(Se.colEnd+1)-ie.x;const b=Me.getRowOffset(Se.rowEnd),Fe=Me.getRowOffset(Se.rowEnd+1);xe=Fe-(Fe-b)/2-ie.y,Re=r.ToolTipPlacement.Right}else if(le===d.IRange.Direction.Right){xe=Me.getRowOffset(Se.rowEnd+1)-ie.y;const b=Me.getColOffset(Se.colEnd),Fe=Me.getColOffset(Se.colEnd+1);ve=Fe-(Fe-b)/2-ie.x,Re=r.ToolTipPlacement.Bottom}else if(le===d.IRange.Direction.Up){ve=Me.getColOffset(Se.colEnd+1)-ie.x;const b=Me.getRowOffset(Se.rowStart),Fe=Me.getRowOffset(Se.rowStart+1);xe=Fe-(Fe-b)/2-ie.y,Re=r.ToolTipPlacement.Right}else if(le===d.IRange.Direction.Left){xe=Me.getRowOffset(Se.rowEnd+1)-ie.y;const b=Me.getColOffset(Se.colStart),Fe=Me.getColOffset(Se.colStart+1);ve=Fe-(Fe-b)/2-ie.x,Re=r.ToolTipPlacement.Bottom}A({anchor:{x:ve,y:xe},display:ce,placement:Re})}catch(fe){ae?.showError?.(fe)}}},onFillDone:()=>{m.current=null,O.setMode(null),N?.()}}),te=r.useCallbackRef(Y=>{re(r.ReactUtils.createSyntheticEvent(Y))},[re,h]);o.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",te),()=>{Y.removeEventListener("pointerdown",te)}},[n?.getStage()]);const pe=r.useImperativeElement(t,()=>({}),[]),Le=o.useRef(null);return c.jsx("div",{className:yt(a,"sheet-selection",$l),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Xt([pe,Le]),...E,children:Ue(n)})})),In=Object.freeze({x:0,y:0,width:0,height:0}),Jl={fireOnModelChange:!1},Ql=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:C,onHide:g,onShow:s,onUnFocus:f,isDragging:S,updateFrameBounds:p,dragStart:h,style:E,disabled:x,renderMovable:A,...N}=e,[K,P]=o.useState(In),[R,O]=o.useState(null),[m,q]=o.useState(!1),T=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const I=a.getBounds();if(!I)return;const k=i.toViewBounds(I);P(k??In),p(k??In)},[i?.getBounds()]),Qe(a,{onBoundsChange:I=>{const k=I.getBounds();if(!k)return;const Z=i.toViewBounds(k);P(Z??In),p(Z)},onSelectionChange:()=>{const I=me.CommonUtils.hasFocus(T.current,!0);!m&&!I||a.isSelected()||f()}}),Qe(a,{onRequestFocus:()=>me.CommonUtils.whenFocus(T.current,!0)},Jl),o.useEffect(()=>{const I=T.current;return l(I),()=>{C(I)}},[]);const $=o.useMemo(()=>{if(!K)return null;let{width:I,height:k}=K;return A({view:i,movable:a,disabled:x,isDragging:S,style:{position:"relative",left:0,top:0,width:I,height:k},onHide:g,onShow:s})},[i,a,K.width,K.height,x,S]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Xt([T,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:K.x,top:K.y,width:K.width,height:K.height,...E},onMouseDown:async I=>{const k=I.shiftKey||I.ctrlKey,Z=a.isSelected(),X=I.currentTarget;k&&Z?a.unselect():(Z&&!k||await a.select({addToSelection:k}),h(I.nativeEvent,X),X.focus())},onFocus:I=>{I.relatedTarget&&!R&&O(I.relatedTarget),q(!0)},onBlur:I=>{R&&!T?.current?.contains(I.relatedTarget)&&O(null),I.relatedTarget&&q(!1)},...N,children:$})})),ei="_movable-area_314c6_5",Ir=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:C,onUnFocus:g,onFocus:s,disabled:f=!1,disableDrag:S=!1,disableResize:p=!1,className:h,style:E,renderDirections:x=["nw","n","ne","w","e","sw","s","se"],onFirstRender:A,...N}=e,K=n.getBounds(),P=r.useCallbackRef(A,[A]),R=r.useCallbackRef(g,[g]),O=r.useCallbackRef(s,[s]),[m,q]=o.useState([]),[T,$]=o.useState(!1),[I,k]=o.useState(!1),Z=o.useRef(!0),X=o.useRef(new Map),B=o.useRef(new Map),j=o.useRef(new Map),H=o.useRef(new Map),J=o.useRef(new Map),M=o.useRef({onRequestFocus:oe=>(le(oe),null)}),U=o.useRef(null),ue=o.useRef(null),we=o.useRef(null),[je,Te]=o.useReducer(oe=>oe+1,0);o.useLayoutEffect(()=>{Te()},[n,i]),Qe(i,{onCollectionChange:()=>{const oe=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0}),ke=J.current;ke.forEach(ye=>{ye()}),ke.clear();const Ae=M.current;for(let ye=0;ye<oe.length;ye++){const De=oe[ye];if(De.isClosed())continue;const D=De.addListeners(Ae);ke.set(De,D)}Te()},onInvalidated:()=>{Te()}}),Qe(a,{onMovableSelectionChange(oe){Me(),Te()}});const ae=o.useCallback((oe,ke)=>{const Ae=j.current.get(oe);we.current&&(we.current.getTargets().forEach(ye=>{if(ye===Ae)return ye.style.left=ke.x+"px",ye.style.top=ke.y+"px",ye.style.width=ke.width+"px",void(ye.style.height=ke.height+"px")}),we.current.updateRect())},[]),Me=()=>{const oe=[],ke=a.getMovableSelection();ke.forEach(Ae=>{const ye=j.current.get(Ae);ye&&ke.indexOf(Ae)!==-1&&oe.push(ye)}),q(Ae=>me.CommonUtils.isEqualArrays(Ae,oe)?Ae:oe)},Ke=o.useRef(null),Ee=o.useRef(null),Ue=o.useMemo(()=>(Ee.current||(Ee.current=new Promise(oe=>{Ke.current=oe})),Ee.current),[]),re=o.useRef(null),te=r.useCallbackRef(async(oe,ke)=>{re.current=ke,await(async()=>!(!await Ue.then()||!we.current))()&&re.current===ke&&we.current.dragStart(oe,ke)},[m]),[pe,Le]=o.useState(!1),Y=o.useRef(null),W=o.useRef(null),le=r.useCallbackRef(async(oe=null)=>{if(oe||(oe=a.getMovableSelection()[0]),!oe)return R?.(),!1;const ke=j.current.get(oe);ke?(await me.CommonUtils.whenFocus(ke),ke.focus(),W.current=ke,Y.current=null):Y.current=oe},[a]);o.useEffect(()=>{pe&&m.length>0&&W.current!==m[0]&&le(),Z.current&&(P?.(),Z.current=!1)},[m]);const fe=o.useMemo(()=>{const oe=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(oe.length===0&&X.current.size===0)return null;const ke=(ee,L,G,u=!0)=>{const w=ee.isSelected(),F={tabIndex:G,view:n,movable:ee,onRefLoad:v=>{Y.current===ee&&(v.focus(),W.current=v,Y.current=null),j.current.set(ee,v),B.current.set(v,ee),L.rendered=!0,Me()},onRefUnload:v=>{j.current.delete(ee),B.current.delete(v),L.rendered=!1,Me()},onUnFocus:R,onHide:v=>{L.onHide=v},onShow:v=>{L.onShow=v},isDragging:w&&(I||T),disabled:f,renderMovable:l,updateFrameBounds:v=>{ae(ee,v)},dragStart:te,onMouseUp:()=>{if(re.current=null,ue.current){$(!1),k(!1);let v=!1;H.current?.forEach(z=>{me.CommonUtils.isEqualBounds(z.movable.getBounds(),z.startBounds)||(v=!0)}),v?Se():ie()}},style:{opacity:u?T&&w?.7:void 0:0,zIndex:T&&w?ee.getZIndex()+oe.length:void 0,pointerEvents:u?void 0:"none",cursor:I&&w?"grabbing":f||S?"initial":"move",boxShadow:!w||I&&!T?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Ql,{...F},`movable-${ee.getUUID()}`)},Ae=X.current,ye=new Map,De=[];for(let ee=0;ee<oe.length;ee++){const L=oe[ee];if(L.isClosed())continue;let G=Ae.get(L);G||(G={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(u,w)=>{if(!w||w.shown===!0)return;w.shown=!0;const F=++w.visibilityRequestId;requestAnimationFrame(()=>{const v=X.current.get(u);v&&F===w.visibilityRequestId&&(w.onShow?.(u),v.shown=!0)})},doHide:async(u,w)=>{if(!w||w?.shown===!1)return;w.shown=!1;const F=++w.visibilityRequestId,v=await Promise.resolve(w.onHide?.(u));F===w.visibilityRequestId&&v!==!1&&(w.shown=!1,X.current.delete(u),Te())},visibilityRequestId:0}),G.frame=ke(L,G,ee,!0),De.push(G.frame),G.doShow(L,G),Ae.delete(L),ye.set(L,G)}const D=[];return a.getMovableSelection().forEach(ee=>{const L=Ae.get(ee);L&&(L.frame=ke(ee,L,-1,!1),D.push(L.frame),Ae.delete(ee),ye.set(ee,L))}),Ae.forEach((ee,L)=>{ee.frame=ke(L,ee,-1,!1),D.push(ee.frame),ee.doHide(L,ee),Ae.delete(L),ye.set(L,ee)}),X.current=ye,Me(),[...D,...De]},[je,n,l,f,S,p,T,I]),ce=r.useCallbackRef((oe,ke)=>{const Ae=`${ke} ${m.length===1?d.TextUtils.capitalize(B.current?.get(m[0]).getContent().getType()):"Drawings"}`;ue.current&&(console.warn(`Transaction ${ue.current.getDescription()} is being replaced by ${Ae}`),ue.current.rollback(),ue.current=null),ue.current=C.beginCommit({description:Ae}),H.current.clear();for(let ye=0;ye<m.length;ye++){const De=m[ye],D=B.current?.get(De);D?H.current.set(De,{movable:D,startBounds:n.toViewBounds(D.getBounds())}):console.warn("invalid element",D)}},[C,n,m]),Se=o.useCallback(()=>{if(!ue.current)return;const oe=[];H.current?.forEach(ke=>{oe.push(ke.movable)}),ue.current.commit({viewAfter:{view:a,movableSelection:oe}}),H.current.clear(),ue.current=null},[]),ie=o.useCallback(()=>{ue.current&&(ue.current.rollback(),ue.current=null)},[]),ve=o.useRef(null);o.useEffect(()=>{ve.current&&(ve.current.onscroll=oe=>{oe.preventDefault(),oe.srcElement.scrollTop=0,oe.srcElement.scrollLeft=0})},[ve.current]);const xe=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:le,focus:()=>{le()}}),[a]),[Re,b]=o.useState(null),Fe=o.useRef(!1),Ze=o.useRef(!1),ze=o.useRef(!1);o.useEffect(()=>{if(f||m.length===0||ze.current||Fe.current)return;if(Ze.current)return void requestAnimationFrame(()=>{we.current&&U.current&&we.current.refTargets.length>0&&(ze.current=!0,Ke.current?.(!0)),q([...m])});Fe.current=!0;const oe=o.lazy(async()=>{try{const ke=await Promise.resolve().then(()=>require("./BsJnIwNed3pBcnMi.cjs"));return Fe.current=!1,Ze.current=!0,q([...m]),ke}catch(ke){return console.warn(ke),Ke.current?.(!1),null}});b(oe)},[m,f,S,p]);const et=o.useMemo(()=>!Re||f?null:c.jsx(o.Suspense,{children:c.jsx(Re,{className:yt({dragging:T||I,resizing:T,moving:I}),container:null,ref:we,target:we.current?m:[],draggable:!f&&!S,resizable:!f&&!p,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:x,onResizeStart:oe=>{ce(oe.target,"Resize")},onResize:oe=>{if(!ue.current)return oe.stopDrag(),void Te();$(!0);const ke=oe.direction[0]!==0&&oe.direction[1]!==0;let Ae=0,ye=0;for(let De=0;De<m.length;De++){const D=m[De],ee=H.current.get(D),L=B.current.get(D);if(!ee||!L){console.warn("invalid element");continue}let G=oe.dist[0],u=oe.dist[1],w=oe.drag.dist[0],F=oe.drag.dist[1],v=ee.startBounds.width,z=ee.startBounds.height;De===0?(Ae=v,ye=z):(G*=v/Ae,w*=v/Ae,u*=z/ye,F*=z/ye);const y={...ee.startBounds};if(y.width=Math.max(0,v+G),y.height=Math.max(0,z+u),oe.direction[0]===-1&&(y.width=Math.max(0,Math.min(ee.startBounds.x+v,v-w))),oe.direction[1]===-1&&(y.height=Math.max(0,Math.min(ee.startBounds.y+z,z-F))),ke&&(L.isLockAspectRatio()||oe.inputEvent?.shiftKey)){const V=v/z,_=y.width/y.height;_>V?y.height=y.width/V:_<V&&(y.width=y.height*V)}oe.direction[0]===-1&&(y.x=Math.max(0,Math.min(ee.startBounds.x+v,ee.startBounds.x+v-y.width))),oe.direction[1]===-1&&(y.y=Math.min(ee.startBounds.y+z,ee.startBounds.y+z-y.height)),ee.movable.setBounds(n.toAbsoluteBounds(y))}},onResizeEnd:oe=>{$(!1),Se()},onDragStart:oe=>{ce(oe.target,"Move")},onDrag:oe=>{if(!ue.current)return oe.stopDrag(),void Te();k(!0);for(let ke=0;ke<m.length;ke++){const Ae=m[ke],ye=H.current.get(Ae);ye?ye.movable.setBounds(n.toAbsoluteBounds({...ye.startBounds,x:ye.startBounds.x+oe.translate[0],y:ye.startBounds.y+oe.translate[1]})):console.warn("invalid element")}},onDragEnd:oe=>{},onMouseUp:oe=>{}})}),[je,Re,m,n,f,S,p,T,I]);return c.jsx("div",{className:yt(h,"movable-area",ei),style:{width:K.width,height:K.height,...E,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Xt([xe,ve]),...N,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:K.width,height:K.height},...N,children:c.jsxs("div",{ref:U,style:{position:"absolute",pointerEvents:"auto"},onFocus:oe=>{O?.(),Le(!0)},onBlur:oe=>{Le(!1)},onKeyDownCapture:oe=>{if(oe.isDefaultPrevented())return;const ke=oe.nativeEvent.ctrlKey,Ae=oe.nativeEvent.altKey,ye=oe.nativeEvent.shiftKey;if(oe.which===r.KeyCodes.Escape){const G=a.getMovableSelection();let u=[...G];return m.forEach(w=>{if(u.length===0)return;const F=B.current.get(w);let v=u.indexOf(F);u.splice(v,1)}),u.length!==G.length&&a.selectMovables(u),u.length===0&&R?.(),void oe.preventDefault()}const De=.1,D=G=>{i.updateSelected(u=>{u.setRotation(u.getRotation()+G)},"Rotate")},ee=(G,u=!0)=>{i.updateSelected(w=>{const F=w.getBounds();let v=1+G;u||(v=1/v);const z=Math.sqrt(Math.pow(F.width,2)+Math.pow(F.height,2)),y=Math.atan2(F.height,F.width),V=v*z;if(V<10)return;const _=V*Math.cos(y),Q=V*Math.sin(y),se={x:F.x+(F.width-_)/2,y:F.y+(F.height-Q)/2,width:_,height:Q};w.setBounds(se)},"Resize")},L=G=>{i.updateSelected(u=>{const w=u.getBounds(),F={x:w.x+(G.x??0),y:w.y+(G.y??0),width:w.width+(G.width??0),height:w.height+(G.height??0)};u.setBounds(F)},"Nudge")};if(oe.which===r.KeyCodes.Delete)i.updateSelected(G=>{G.delete()},"Delete"),oe.preventDefault();else if(oe.key==="a"&&ke){const G=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(G,!0),oe.preventDefault()}else oe.key==="ArrowLeft"?(ye?ee(De,!1):Ae?D(-10):L({x:ke?-10:-1}),oe.preventDefault()):oe.key==="ArrowRight"?(ye?ee(De,!0):Ae?D(10):L({x:ke?10:1}),oe.preventDefault()):oe.key==="ArrowUp"?(ye?ee(De,!0):L({y:ke?-10:-1}),oe.preventDefault()):oe.key==="ArrowDown"&&(ye?ee(De,!1):L({y:ke?10:1}),oe.preventDefault())},children:[fe,et]})})})})),Wt=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 C=e[l].getBounds();t=Math.min(C.x,t),n=Math.min(C.y,n),i=Math.max(C.x+C.width,i),a=Math.max(C.y+C.height,a)}return{x:t,y:n,width:i-t,height:a-n}},_o=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let C=0,g=Number.MAX_SAFE_INTEGER,s=0;for(let p=0;p<e.length;p++){const h=e[p],E=h.getBounds();C+=E[l],g=Math.min(E[i],g),s=Math.max(E[i]+E[l],s),n.push({bounds:E,movable:h})}const f=(s-g-C)/(e.length-1);n.sort((p,h)=>{const E=p.bounds[i],x=h.bounds[i];return E!==x?E-x:p.bounds[a]-h.bounds[a]});const S=new Map;S.set(n[0].movable,n[0].bounds);for(let p=1;p<n.length-1;p++){const h=n[p-1].bounds,E={...n[p].bounds};E[i]=h[i]+h[l]+f,n[p].bounds=E,S.set(n[p].movable,E)}return S.set(n[n.length-1].movable,n[n.length-1].bounds),S};function Er(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:C}=e,g=r.useNotifier(),s=r.useEditMode();o.useRef(s.getMode()).current=s.getMode();const f=r.useCallbackRef(async(R,O,m=null,q=!0)=>{const T=async()=>{const $=await Promise.resolve(g?.showBusy?.(R.label()));try{await O();const I=m??R?.label?.();if(C){let k=null;R&&I!==!1&&(k=new r.SimpleCommand(R.key(),l,{label:I,description:I},T)),C(k)}$?.(),q&&s.setMode(null)}catch(I){$?.(),g?.showError?.(I)}};await T()},[C,g]),[S,p]=o.useReducer(R=>R+1,0),h=r.useCallbackRef((R,O,m)=>{if(!n)return;const q=n.getMovableSelection();if(q.length===0)return;let T="Drawings";if(q.length===1){const I=q[0];T=d.TextUtils.capitalize(I.getContent().getType())??"Drawing"}const $=`${R.label()} ${T}`;f(R,()=>{let I=null;i&&(I=i.beginCommit($));const k=n.getMovableSelection();if(k.length===0)return;const Z=m?.(k);for(let X=0;X<k.length;X++){const B=k[X];O(B,Z)}I?.commit()})},[n,i]),[E,x]=o.useState(n.getMovableSelection()[0]??null),[A,N]=o.useState(!E||E?.isProtected()),K=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){h(this,R=>{R.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){h(this,R=>{R.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){h(this,R=>{R.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){h(this,R=>{R.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){h(this,R=>{R.setLockAspectRatio(!R.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){h(this,R=>{R.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){h(this,R=>{R.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){h(this,R=>{R.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){h(this,(R,O)=>{R.setBounds({x:O.x})},Wt)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){h(this,(R,O)=>{R.setBounds({x:(O.width-R.getBounds().width)/2+O.x})},Wt)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){h(this,(R,O)=>{R.setBounds({x:O.width-R.getBounds().width+O.x})},Wt)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){h(this,(R,O)=>{R.setBounds({y:O.y})},Wt)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){h(this,(R,O)=>{R.setBounds({y:(O.height-R.getBounds().height)/2+O.y})},Wt)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){h(this,(R,O)=>{R.setBounds({y:O.height-R.getBounds().height+O.y})},Wt)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){h(this,(R,O)=>{R.setBounds(O.get(R))},R=>_o(R))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){h(this,(R,O)=>{R.setBounds(O.get(R))},R=>_o(R,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,E]);o.useEffect(()=>{},[s]);const P=o.useMemo(()=>{let R=null;return R=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),R.addCommands(K,!0),R},[a,K]);return Qe(E,{onAnyChange:()=>{P.getCommand("formatAnchorTypeTwoCell").update({state:E?.getAnchorType()===d.IAnchored.Type.TwoCell}),P.getCommand("formatAnchorTypeOneCell").update({state:E?.getAnchorType()===d.IAnchored.Type.OneCell}),P.getCommand("formatAnchorTypeAbsolute").update({state:E?.getAnchorType()===d.IAnchored.Type.Absolute}),P.getCommand("formatAnchorTypeAbsolute").update({state:E?.getAnchorType()===d.IAnchored.Type.Absolute}),P.getCommand("toggleLockAspectRatio").update({state:E?.isLockAspectRatio()})},onProtectedChange:R=>{N(R.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const R=n.getMovableSelection()[0]??null;x(R),N(!R||R.isProtected()),p()}}),Qe(t,{onCollectionChange:()=>{p()}}),o.useEffect(()=>{const R={disabled:A};P.getCommand("formatAnchorTypeTwoCell").update(R),P.getCommand("formatAnchorTypeOneCell").update(R),P.getCommand("formatAnchorTypeAbsolute").update(R),P.getCommand("toggleLockAspectRatio").update(R);const O=t.getCount(),m=n.getMovableSelection(),q=A||O<=1||m.length===0;let T={disabled:q},$=T;if(!q&&m.length===1){const Z=m[0];Z.getZIndex()===0&&(T={disabled:!0}),Z.getZIndex()===O-1&&($={disabled:!0})}P.getCommand("moveToFront").update($),P.getCommand("moveForward").update($),P.getCommand("moveToBack").update(T),P.getCommand("moveBackward").update(T);const I={disabled:A||m.length<=1};P.getCommand("formatDrawAlignLeft").update(I),P.getCommand("formatDrawAlignCenter").update(I),P.getCommand("formatDrawAlignRight").update(I),P.getCommand("formatDrawAlignTop").update(I),P.getCommand("formatDrawAlignMiddle").update(I),P.getCommand("formatDrawAlignBottom").update(I),P.getCommand("formatDrawFlipHorz").update(I),P.getCommand("formatDrawFlipVert").update(I),P.getCommand("formatDrawGroup").update(I),P.getCommand("formatDrawUngroup").update(I),P.getCommand("formatDrawSwapShapes").update(I),P.getCommand("formatDrawSwapShapesHorz").update(I),P.getCommand("formatDrawSwapShapesVert").update(I);const k={disabled:A||m.length<=2};P.getCommand("formatDrawDistributeHorz").update(k),P.getCommand("formatDrawDistributeVert").update(k)},[S,A,S]),P}const ti=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:C,onHide:g,onShow:s,...f}=e;o.useEffect(()=>{},[a]);const S=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[p,{height:h,width:E}]=Ot();return c.jsx("div",{...f,ref:Xt([S,p]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:C?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:C,target:g,onRepeatCommandChange:s}=e,f=Er({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:s,commands:C,target:g});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const S=o.useMemo(()=>c.jsx(Ir,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{f.activate(),a?.onFocus?.()}},"movable-area"),[i,a,C,f]);return S&&n?S:null})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:C,setEditingCoords:g,commands:s}=e,f=r.useEditMode(),[S,p]=o.useState(null),[h,E]=o.useState(null),[x,A]=o.useState(null),[N,K]=o.useState(null),[P,R]=o.useState(null);o.useLayoutEffect(()=>{if(x===null)return K(null),void R(null);const M=()=>{const U=i.getRange(x).getCell(),ue=U.getStyle();let we,je=ue.getFill()?.toCSS(a.body.darkMode);je.background!=="none"&&je.background!=="transparent"||(je=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),je.background!=="none"&&je.background!=="transparent"||(je={background:a.body.fill}),K({style:je}),U&&!U.getFormula()&&(we=U?.getRenderHorizontalAlignment()),R(we??r.HorizontalAlignment.Left)};return M(),i.getRange(x).addListener(()=>{M()})},[i,x,a?.body]);const O=r.useCallbackRef(()=>{let M=h.editState.dirty??"";if(h.editState.dirty!==void 0){const U=d.TextUtils.clampString(M);try{const ue=h.sheet.getRange(h.coords),we=`Typing '${U}' into ${ue.toString()}`;return ue.setValue(M,{description:we,autoFit:!0}),A(null),E(null),f.setMode(null),g(null),!0}catch(ue){throw me.Notifier.error(new Error(`Unable to enter '${U}'.`,{cause:ue})),ue}}},[i,h]),m=r.useCallbackRef(M=>i.getRange(M).getCell().getExtrusions()??me.CoordUtils.cellToRange(M),[i]),q=r.useCallbackRef(M=>{let U=d.IRange.Orientation.Row,ue=!1;M!==d.IRange.Direction.Up&&M!==d.IRange.Direction.Down||(U=d.IRange.Orientation.Column),M!==d.IRange.Direction.Left&&M!==d.IRange.Direction.Up||(ue=!0),i.getSelection().traverse(U,ue)},[i]),T=o.useCallback((M,U)=>{if(l)return l(M,U);if(!i)return null;const{ref:ue,...we}=M;return c.jsx(wr,{ref:ue,...we,sheet:i,bodyStyle:a?.body,activeCoords:U,commands:s,onChangeEdit:je=>{const Te={sheet:i,coords:U,editState:je};f.setMode(ae=>({...ae,description:Te.editState.editMode?"Edit":"Enter",args:{...ae?.args,stateAndCoords:Te}}))},editState:h.editState})},[i,N,l,h,x]),{overlay:$,startEdit:I,submitEdit:k,cancelEdit:Z,onKeyboardEventNative:X,onPointerEventNative:B}=dt.useKeyboardEditorOverlay({view:n,activeCoords:S,getCellEditor:T,canEdit:()=>{const M=i.getProtection();if(M.isReadOnly())return!1;const U=M.isLocked();return U&&C(),!U},onBeforeStartEdit:M=>{const U=xr(()=>i.getRange(M).getCell()),ue={sheet:i,coords:M,editState:Object.freeze(U)};f.setMode({key:"edit",args:{stateAndCoords:ue}}),E(ue)},onStartEdit:M=>{A(M),g(M)},onSubmitEdit:O,onCancelEdit:M=>{A(null),E(null),f.setMode(null),g(null)},onDoneEdit:M=>{f.setMode(null)},onNavigate:q,containerProps:N,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:P,getRangeCoords:m});Qe(i.getSelection(),{onChange(M){p(i.getSelection().getCoords().cell)}});const j=r.useCallbackRef(M=>{B(M),x&&k()},[B,Z,x]),H=o.useCallback(M=>{B(M)},[B]),J=o.useCallback(M=>{X(M)},[X]);return o.useEffect(()=>{const M=n?.getStage();if(M)return M.addEventListener("pointerdown",j),M.addEventListener("dblclick",H),M.addEventListener("keydown",J),()=>{M.removeEventListener("pointerdown",j),M.removeEventListener("dblclick",H),M.removeEventListener("keydown",J)}},[n?.getStage()]),o.useEffect(()=>{const M=f.getMode(),U=M?.key;U==="edit"||U==="enter"?h?M.args?.cancel?Z():M.args?.submit?k():E(M.args?.stateAndCoords):I(M.args?.start):x&&Z()},[f]),$(n,t)})),Fr="white",Ar="black",ri=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,li=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ii=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[C,g]=o.useState(null),[s,f]=o.useState(null),[S,p]=o.useState(null),[h,E]=o.useState(null),x=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const m=i.getTables().getItems({address:n.getVisibleRangeCoords()});g(m.length>0?m:null)}else l(!1),g(null)},[i,n]),A=r.useCallbackRef(m=>{m.preventDefault(),m.stopPropagation();const q=n.getCellCoordsFromClient(m.clientX,m.clientY),T=i.getTables().getItems({address:q});T.length===1&&T[0].select()},[n,i]),N=r.useCallbackRef(m=>{m.preventDefault(),m.stopPropagation();const q=n.getCellCoordsFromClient(m.clientX,m.clientY),T=i.getTables().getItems({address:q});if(T.length===1){const $=T[0].getRange().getCoords(),I={colStart:$.colStart,rowStart:q.rowIndex,colEnd:$.colEnd,rowEnd:q.rowIndex};i.getRange(I).select()}},[n,i]),K=r.useCallbackRef(()=>{if(!a)return;const m=i.getTables().getItems({address:n.getVisibleRangeCoords()});g(m.length>0?m:null)},[i,a,n]);Qe(i?.getSelection(),{onChange(m){f(i.getSelection().getCoords().cell)}}),Qe(S,{onAnyChange(m){x(),K()}}),Qe(h,{onAnyChange(m){K()}}),Qe(i,{onTablesChange(m){x(),K()},onInvalidated(m){x(),K()}});const P=o.useMemo(()=>me.CommonUtils.debounce(me.CommonUtils.throttle(K,300),300),[]);o.useEffect(()=>{P()},[n]),o.useEffect(()=>{let m=null;if(C)for(let q=0;q<C.length&&!m;q++){const T=C[q],$=T.getRange().getCoords();d.CoordUtils.isCellWithinRange(s,$)&&(m=T)}p(m)},[s,C]);const R=r.useCallbackRef(m=>{let q=null;if(C)for(let T=0;T<C.length;T++){const $=C[T],I=$.getRange().getCoords();let k=n.getRangeCoordsBounds(I);const Z=n.getRelativePointFromClient(m.clientX,m.clientY),X=Z.x,B=Z.y;if(X>=k.x&&X<=k.x+k.width&&B>=k.y&&B<=k.y+k.height){const j=n.getViewportSize();X<=0||B<=0||X>=j.width||B>=j.height||(q=$)}}E(q)},[n,C]);if(o.useEffect(()=>{const m=n?.getStage();if(m&&C)return m.addEventListener("mousemove",R),m.addEventListener("mouseleave",R),()=>{m.removeEventListener("mousemove",R),m.removeEventListener("mouseleave",R)}},[C,n?.getStage()]),!n||!C||C.length===0)return null;const O=[];for(let m=0;m<C.length;m++){const q=C[m];if(q.isClosed())continue;const T=q===h,$=q===S,I=q.getRange().getCoords(),k=n.getRangeCoordsBounds(I);let Z;if(T||$){const X=q.getStyle().getProperties(),B=X.headerRow?.fill?.background??X.wholeTable?.border?.top?.color?.toString();if(B&&i){const j=i.getStyles().parseColor(B);j&&(Z=j.toCSS())}Z||(Z="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}O.push(c.jsx("div",{style:{position:"absolute",left:k.x,top:k.y,width:Math.min(16,k.width),height:k.height,pointerEvents:"all",cursor:ri},onMouseDown:N},`table-select-row-${q.getName()}`)),O.push(c.jsx("div",{style:{position:"absolute",left:k.x,top:k.y,width:Math.min(16,k.width),height:Math.min(16,k.height),pointerEvents:"all",cursor:li},onMouseDown:A},`table-select-${q.getName()}`)),O.push(c.jsx(dt.Selection,{x:k.x,y:k.y,width:k.width,height:k.height,range:I,strokeWidth:$?.5:0,stroke:Z??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:T?`${Z} 0px 0px 1px 1px`:void 0}},`table-outline-${q.getName()}`))}return O})),ai=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,C]=o.useState(null),[g,s]=o.useState(null),f=o.useRef(null),S=r.useCallbackRef(()=>{const N=i.getSelectedCell(),K=N.getSpill()?.getCoords()??null;me.CoordUtils.isEqualRanges(K,l)||(s(K?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(K),coords:K}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),C(K))},[i,n,l]);o.useEffect(()=>(f.current&&(clearTimeout(f.current),f.current=null),g&&(f.current=setTimeout(()=>{s(null),f.current=null},a)),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[g,a]);const p=o.useMemo(()=>me.CommonUtils.debounce(me.CommonUtils.throttle(S,80),80),[]);if(Qe(i?.getSelection(),{onChange(N){p()}}),Qe(i,{onSpillsChange(N){S()},onInvalidated(N){S()}}),!n||!l&&!g)return null;const h=i.getRange(l).getValue()instanceof d.FormulaError.Spill,E=[];let x=g?.bounds??n.getRangeCoordsBounds(l);if(g&&!me.CommonUtils.isEqualBounds(g.bounds,n.getRangeCoordsBounds(g.coords))&&s(null),x=n.toClipBounds(x,-10),!x)return;const A="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return E.push(c.jsx(dt.Selection,{x:x.x,y:x.y,width:x.width,height:x.height,range:l,strokeWidth:1,stroke:A,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:g?.transition==="out"?0:1,transition:g?.transition?g.transition==="in"||g.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${A} 0px 0px 4px 0px`}},"spill-outline}")),E})),si={position:"absolute",top:0,left:0,bottom:0,right:0},Zo=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},C=n.body=me.CommonUtils.mergeContentful(e.body,l);return n.body=me.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},C),n.buttonSurface=me.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=me.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=me.CommonUtils.mergeContentful(n.header,l),n.headerSelect=me.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=me.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=me.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=me.CommonUtils.mergeContentful(n.headerSelectAll,l),n},di={fireOnModelChange:!1},Xo={},Dr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Xo,headersStyle:a=Xo,onSheetContextMenu:l,showColumnHeaders:C,columnHeaderProps:g,showRowHeaders:s,rowHeaderProps:f,showScrollbars:S=!0,scrollPaneProps:p,onViewportChange:h,commands:E,onRepeatCommandChange:x,onMoveCell:A,overlays:N,renderMovable:K,viewportComponent:P,onElementLoad:R,getCellEditor:O,onFocus:m,onBlur:q,style:T=r.ReactUtils.EmptyCssProperties,onShowTooltip:$,onShowColumnTooltip:I,onShowRowTooltip:k,onCloseTooltip:Z,gridProps:X,cellRenderProps:B,...j}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[H,J]=o.useReducer(ne=>ne+1,0),[M,{width:U,height:ue}]=Ot(),we=r.useCallbackRef($,[$]),je=r.useCallbackRef(I,[I]),Te=r.useCallbackRef(k,[k]),ae=r.useCallbackRef(Z,[Z]),Me=o.useRef(!1);o.useLayoutEffect(()=>{Me.current=!0},[n]);const Ke=n?.getStyles(),Ee=o.useMemo(()=>Zo(i,Ke),[i,Ke]),Ue=o.useMemo(()=>Zo(a,Ke),[a,Ke]),{body:re={},buttonSurface:te={}}=Ee,{header:pe={},headerSelect:Le={},headerSelectAll:Y={}}=Ue,W=o.useRef(null),[le,fe]=o.useState(()=>n?.getView()),ce=(le?.getZoomScale()??100)/100,Se=o.useMemo(()=>({vertical:le.isShowColumnGridlines()&&ce>=.4,horizontal:le.isShowRowGridlines()&&ce>=.4}),[le?.isShowColumnGridlines(),le?.isShowRowGridlines(),ce]),ie=o.useMemo(()=>{if(le?.getGridLineColor())return{strokeDasharray:"1,1"}},[le?.getGridLineColor(),Ee]),ve=C??le?.isShowColumnHeaders(),xe=s??le?.isShowRowHeaders(),[Re,b]=o.useState({width:0,height:0}),Fe=o.useMemo(()=>{let ne=40,qe=20;const He=n?.getStyles().getNormal().getFont();if(Re.width>0&&Re.height>0){const Pe=He?.toCSS()?.fontFamily??Ee.header.text.fontFamily,Xe=He?.getSize()??Ee.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+Re.height,Math.ceil(Xe*d.IFont.getDeviceScale()),Pe);ne=We.width,qe=We.lineHeight}return{width:Math.round(ne+5),height:Math.round(qe+3)}},[Re,Ee?.header.text,n]),Ze=xe?ce*Fe.width:pe.edgeStrokeWidth,ze=ve?ce*Fe.height:pe.edgeStrokeWidth,et=Math.max(U,(n?.getColumnHeaders().getDefaultSize()??Fe.width)+Ze+1),oe=Math.max(ue,(n?.getRowHeaders().getDefaultSize()??Fe.height)+ze+1),ke=o.useRef(new Map),Ae=o.useRef(null),ye=()=>({getColOffset:ne=>n.getColumnHeaders().findOffset(ne),getColIndex:ne=>n.getColumnHeaders().findIndex(ne),getRowOffset:ne=>n.getRowHeaders().findOffset(ne),getRowIndex:ne=>n.getRowHeaders().findIndex(ne)}),[De,D]=o.useState(()=>ye()),[ee,L]=o.useState(!1),[G,u]=o.useState(null),w=!0,F=Ee.selection?.strokeFill,v=o.useCallback(()=>Mt.current,[]),[z,y]=o.useState(),V=r.useCallbackRef(ne=>{y(ne),n&&n.getView()&&n.getView().setTopLeft(ne?{left:ne.left,top:ne.top}:null),h?.(ne)},[n,h]),_=o.useRef(null);o.useEffect(()=>{if(!z||!n)return;const ne=n.getRangeAtBounds({x:z.left,y:z.top,width:z.width,height:z.height});_.current?.(),_.current=ne.addListener(()=>{const qe=ne.getCoords();W?.current?.invalidate(qe)})},[z,n]);const[Q,se]=o.useState(()=>n?.getView().getTopLeft()),de=r.useCallbackRef(ne=>{const qe=me.CoordUtils.cellToRange(ne);if(n.isClosed())return qe;const He=n.getRange(qe,{excludeHidden:!0}).getMerges();return He.length===0?qe:He[0]},[n]),ge=ne=>{if(!ne||ne.coords.colIndex===0&&ne.coords.rowIndex===0)return null;const qe={};return ne.coords.colIndex>0&&(qe[me.AnchorLocation.Left]={index:ne.coords.colIndex,scrollOffset:ne.topLeft.left}),ne.coords.rowIndex>0&&(qe[me.AnchorLocation.Top]={index:ne.coords.rowIndex,scrollOffset:ne.topLeft.top}),qe},[Ce,be]=o.useState(()=>ge(n.getView().getFreezePanes())),he=r.useEditMode(),Ie=o.useCallback(()=>W.current,[]),Be=r.useCallbackRef(ne=>{he.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:ne}})},[]),Ne=r.useCallbackRef(()=>z,[z]),Ve=Mr({sheet:n,commands:E,target:Ie,onRepeatCommandChange:x,bodyStyle:re,onStartEdit:Be,getViewport:Ne}),[$e,_e]=o.useState(n.getSelection().isEntire()),[Oe,Ye]=o.useState(le?.getMovableSelection().length>0),at=G!==null||Oe,ht=null,[qt,Ge]=o.useState(!1);o.useEffect(()=>{Ge(!1)},[n.getProtection()]);const ot=r.useNotifier(),pt=r.useCallbackRef(()=>{qt||(Ge(!0),ot.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[ot,qt]),wt=o.useMemo(()=>{const ne=he.getMode();return ne?.cursor?ne.cursor:null},[ht,he]),[vt,gt]=o.useState(null),it=o.useRef(!1),[Et,Bt]=o.useState([]),Qt=o.useRef(null),[Dt,en]=o.useState(me.TypesUtils.EmptyTopLeft),[It,xn]=o.useState(me.TypesUtils.EmptyTopLeft);o.useEffect(()=>{en({left:Q?.left,top:0})},[Q?.left]),o.useEffect(()=>{xn({left:0,top:Q?.top})},[Q?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{be(ge(n.getView().getFreezePanes()))},onTopLeftChange:()=>{se(n.getView().getTopLeft())},onMovableSelectionChange:()=>{Ye(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){fe(n.getView()),D(ye())},onLayoutChange:()=>{const ne=n.getEntireRange();b({height:ne.getRowCount(),width:ne.getColumnCount()}),D(ye())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),Qe(n,{onRequestScrollIntoView:async(ne,qe)=>{if(!qe)return;const He={colIndex:qe?.coords.colStart,rowIndex:qe?.coords.rowStart};return await W.current?.scrollCellCoordsIntoView(He,qe?.scroll),!0},onRequestFocus:()=>me.CommonUtils.whenFocus(Mt.current)},di);const Ct=o.useRef(!1),Vt=o.useMemo(()=>{const ne=me.CommonUtils.debounce(Pe=>{requestAnimationFrame(()=>{it.current&&je?.(Pe)})},32),qe=(Pe,Xe)=>{it.current=!0,gt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:Re.height,colStart:Pe,colEnd:Pe})))return;const lt=We.getLayout(),rt=Math.max(0,lt.getColOffset(Pe)),nt=We.getBounds(),bt=Math.min(nt.x+nt.width,lt.getColOffset(Pe+1)),Tt=We.getAnchor();if(Xe!==null&&(Tt===me.AnchorLocation.Left||Tt===me.AnchorLocation.Center||Tt===me.AnchorLocation.Right)){const to=me.CommonUtils.roundAccurately(Xe*me.CommonUtils.getDPI(),0),kn=me.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Xe/ce),2).toFixed(2),no="Width: "+(Xe?kn+" ("+to+" pixels)":"Hidden"),ln=Kt.current.getGridElement().getRelativePointFromClient(0,0),$t=0-ln.y,Mn=0-ln.y+ze,oo=ln.x-nt.x;ne({anchor:{x:rt-oo,y:$t,width:bt-rt,height:Mn-$t},display:no})}const Nt=[0,0,0,nt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:F}},Jn={x:rt-1,y:0,width:1,height:nt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:F}},eo={x:bt-1,y:0,width:1,height:nt.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let He=null;return{onResizeHeadersStart:(Pe,Xe,We)=>{He=n.beginCommit(We),Ct.current=!1,qe(Pe,Xe)},onResizeHeaders:(Pe,Xe,We)=>{Ct.current=!1,qe(Pe,Xe)},onResizeHeadersDown:(Pe,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&qe(Pe,Xe)},360)},onResizeHeadersEnd:(Pe,Xe,We)=>{He?.commit({description:We}),He=null,Ct.current=!1,requestAnimationFrame(()=>ae?.()),it.current=!1,gt(null)},onResizeHeadersUp:Pe=>{Ct.current=!1,requestAnimationFrame(()=>ae?.()),it.current=!1,gt(null)},...g}},[n,g,ze,vt]),tn=o.useMemo(()=>{const ne=me.CommonUtils.debounce(Pe=>{requestAnimationFrame(()=>{it.current&&Te?.(Pe)})},32),qe=(Pe,Xe)=>{it.current=!0,gt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Pe,rowEnd:Pe,colStart:0,colEnd:Re.width})))return;const lt=We.getLayout(),rt=Math.max(0,lt.getRowOffset(Pe)),nt=We.getBounds(),bt=Math.min(nt.y+nt.height,lt.getRowOffset(Pe+1)),Tt=We.getAnchor();if(Xe!==null&&(Tt===me.AnchorLocation.Top||Tt===me.AnchorLocation.Center||Tt===me.AnchorLocation.Bottom)){const to=Math.floor(10*me.CommonUtils.getDPI())/10,kn=me.CommonUtils.roundAccurately(Xe*to,0),no=me.CommonUtils.roundAccurately(kn/ce/(n?.getRowHeaders().getScaleFactor()*me.CommonUtils.getDPI()),2).toFixed(2),ln="Height: "+(Xe?no+" ("+kn+" pixels)":"Hidden"),$t=Ut.current.getGridElement().getRelativePointFromClient(0,0),Mn=0-$t.x,oo=0-$t.x+Ze,bl=$t.y-nt.y;ne({anchor:{x:Mn,y:rt-bl,width:oo-Mn,height:bt-rt},display:ln})}const Nt=[0,0,nt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:F}},Jn={x:0,y:rt-1,width:nt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:F}},eo={x:0,y:bt-1,width:nt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let He=null;return{onResizeHeadersStart:(Pe,Xe,We)=>{He=n.beginCommit(We),Ct.current=!1,qe(Pe,Xe)},onResizeHeaders:(Pe,Xe,We)=>{Ct.current=!1,qe(Pe,Xe)},onResizeHeadersDown:(Pe,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&qe(Pe,Xe)},360)},onResizeHeadersEnd:(Pe,Xe,We)=>{He?.commit({description:We}),He=null,Ct.current=!1,requestAnimationFrame(()=>ae?.()),it.current=!1,gt(null)},onResizeHeadersUp:Pe=>{Ct.current=!1,requestAnimationFrame(()=>ae?.()),it.current=!1,gt(null)},...f}},[n,f,Ze]),Mt=r.useImperativeElement(t,()=>{const ne=He=>{n?.getView()&&n.getView().selectMovables([]),Ae.current=null,W?.current?.focus(He)},qe=async(He=null)=>{if(He||(He=n?.getView().getMovableSelection()[0]),!He)return!1;const Pe=He.getAnchorCoords();if(!Pe)return!1;const Xe=W.current?.getViewFromCellCoords({colIndex:Pe.colStart,rowIndex:Pe.rowStart});if(!Xe)return!1;const We=Xe.getAnchor();n?.getView().getMovableSelection().indexOf(He)===-1&&n?.getView().selectMovables([He]);let lt=ke.current?.get(We);return lt?.current?(await lt.current.focusMovable(He),!0):(Ae.current={movable:He,anchor:We},!0)};return{getGridElement:()=>W.current,getRowHeaderElement:()=>Ut.current,getColumnHeaderElement:()=>Kt.current,rowHeaderHeight:()=>ze,colHeaderWidth:()=>Ze,startEdit:Be,submitEdit:()=>{he.setMode(He=>He?.key!=="edit"?He:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{he.setMode(He=>He?.key!=="edit"?He:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:G!==null,focus:He=>{n?.getView().getMovableSelection().length>0&&qe()||ne(He)},focusSheet:ne,focusMovable:qe,contains:He=>W?.current?.contains?.(He),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(ne=>{Me.current||(W?.current?.invalidate(ne),J?.())},[]);o.useEffect(()=>{zt()},[Ee]);const qn=$e?Y.edgeStrokeFill:pe.fill,tt=$e?Le.fill:typeof Ee.headerHover=="function"?Ee.headerHover(pe)?.fill:pe.fill,Sn=o.useMemo(()=>P?c.jsx("div",{className:yt("sheetxl-viewport-overlay",Dl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:P}):c.jsx(c.Fragment,{}),[P]);let Pt=null;ve&&xe&&(Pt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${ze}px`,width:`${Ze}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:ne=>{let qe=!ne.ctrlKey;Ve?.getCommand("selectAll")?.execute(!qe||ne.button!==0),ne.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:-1,colIndex:-1}):W.current?.focus()},children:[c.jsx("div",{style:{height:ze-5+"px",width:ze-5+"px",clipPath:`path('M${ze-5} 0 L0 ${ze-5} L${ze-5} ${ze-5} L${ze-5} 0 Z')`,borderRight:`2px solid ${qn}`,borderBottom:`2px solid ${qn}`,background:`${tt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${ze}px`,width:`${Ze}px`,boxSizing:"border-box",borderRight:`solid 1px ${pe.strokeFill}`,borderBottom:`solid 1px ${pe.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const nn=r.useCallbackRef(({_left:ne,_top:qe})=>{},[]),st=r.useCallbackRef(ne=>{if(!l)return;const qe=W.current.getViewFromClient(ne.clientX,ne.clientY)?.getCellCoordsFromClient(ne.clientX,ne.clientY);qe&&(l({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),ne.stopPropagation(),ne.preventDefault())},[l]),mt=r.useCallbackRef(ne=>{if(!(!ne.shiftKey&&(ne.ctrlKey||ne.metaKey)))return;const{deltaY:qe}=ne;return qe>0?Ve.getCommand("sheetZoomOut")?.execute():qe<0&&Ve.getCommand("sheetZoomIn")?.execute(),qe===0},[Ve]);o.useEffect(()=>{Bt(null),Qt.current=null,it.current=!1,gt(null);const ne=n?.getView().getTopLeft();nn(ne),W.current?.scrollTo(ne),se(ne),fe(n.getView()),be(ge(n.getView().getFreezePanes())),D(ye()),J()},[n?.getView()]);const on=r.useCallbackRef(ne=>{const qe=ne.getVisibleRangeCoords();if(!qe)return null;const He=[];return n.getRange(qe).forEach((Pe,Xe)=>{const We=Xe.getCoords(),lt=Xe.getCell();(rt=>{if(rt.isEmpty())return!1;const nt=rt.getSpans();if(nt.width>1||nt.height>1||rt.getStyle().hasVisibleStyling()||le.isShowFormulas()&&rt.getFormula()!==null)return!0;const bt=rt.getValue();return bt!==null&&!(!le.isShowZeros()&&bt===0&&rt.getType()===d.ScalarType.Number)})(lt)&&He.push({coords:We,value:lt,range:le.isShowFormulas()?null:lt.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),He},[n,le.isShowZeros(),le.isShowFormulas(),G]);o.useEffect(()=>{const ne=[];N&&ne.push(...N),vt&&ne.push(...vt),me.CommonUtils.isEqualArrays(ne,Qt.current)||(Qt.current=ne,Bt(ne))},[N,vt,Ee]);const rn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[Ee?.header?.edgeStrokeFill]),Ht=r.useCallbackRef(ne=>{ne.isDefaultPrevented()||ne.isPropagationStopped()||(Ae.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const ne=he.getMode();return ne?.key==="cut"||ne?.key==="copy"},[he]),Gn=r.useCallbackRef(async ne=>{const qe=he.getMode();return ne.keyCode===r.KeyCodes.Escape&&qe?(ne.preventDefault(),void he.setMode(null)):ne.keyCode===r.KeyCodes.Enter&&Wn?(ne.preventDefault(),await Ve?.getCommand("paste")?.execute(),void he.setMode(null)):void Ve?.dispatchToFocusedCommand(ne)},[Ve,he]),Ut=o.useRef(null),Rn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${ze+1}px`,width:`${Ze+pe.edgeStrokeWidth}px`,minWidth:`${Ze+pe.edgeStrokeWidth}px`,borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,height:`calc(100% - ${ze}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Wo,{ref:Ut,sheetElement:Mt.current,gridRef:W,freezeStart:Ce?.[me.AnchorLocation.Top],oppositeSize:Ze,containerWidth:Ze,containerHeight:oe,sheetHeader:n.getRowHeaders(),gridStyle:Ue,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:It,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${ze+1}px`,width:`${Ze+pe.edgeStrokeWidth}px`,minWidth:`${Ze+pe.edgeStrokeWidth}px`,borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,height:`calc(100% - ${ze}px)`,boxSizing:"border-box",zIndex:"2",...tn?.style},...tn})}),[Ze,ze,oe,n,It,Ce?.[me.AnchorLocation.Top],Ee,w,l,pe.fill,f]),Kt=o.useRef(null),gl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${ze+pe.edgeStrokeWidth}px`,minHeight:`${ze+pe.edgeStrokeWidth}px`,borderBottom:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Wo,{ref:Kt,sheetElement:Mt.current,gridRef:W,freezeStart:Ce?.[me.AnchorLocation.Left],oppositeSize:ze,containerWidth:et,containerHeight:ze,sheetHeader:n.getColumnHeaders(),gridStyle:Ue,scrollPoint:Dt,onSheetContextMenu:l,...Vt,style:{...Vt?.style,position:"relative",left:"0px",width:"100%",height:`${ze+pe.edgeStrokeWidth}px`,minHeight:`${ze+pe.edgeStrokeWidth}px`,borderBottom:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[ze,et,n,Dt,Ce?.[me.AnchorLocation.Left],Ee,pe.fill,w,l,g]),hl=r.useCallbackRef(ne=>{const{value:qe,key:He,...Pe}=ne;let Xe=qe,We=G;if(!We||We.colIndex===ne.coords.colIndex&&We.rowIndex===ne.coords.rowIndex||(We=null),!Xe){const nt=ne.range;if(Xe=n.getRange({rowIndex:nt.rowStart,colIndex:nt.colStart}).getCell(),Xe.isEmpty())return null}let lt=null;Xe.getHyperlink()&&(lt=async nt=>{if(B?.onLinkMouseDown?.(nt),nt.button===0&&!nt.isDefaultPrevented()){nt.stopPropagation(),nt.preventDefault();try{await Xe.getHyperlink()?.open()}catch(bt){ot.showError?.(bt)}}}),We&&We.colIndex===ne.range.colStart&&We.rowIndex===ne.range.rowStart&&(Xe=Xe.createTemporaryCell({value:null}));const rt=n.getStyles();return o.createElement(yr,{...Pe,key:He,bodyStyle:re,docTheme:rt.getTheme(),normalStyle:rt.getNormal(),showFormulas:le.isShowFormulas(),showZeros:le.isShowZeros(),onLinkMouseDown:lt,...B,value:Xe})},[n,De,re,G,le?.isShowFormulas(),le.isShowZeros()]),ml=o.useCallback((ne,qe)=>{const{key:He,...Pe}=ne;return[c.jsx(Ll,{ref:qe,getVisibleCells:on,sheet:n,gridStyle:Ee,...Pe},`border-${He}`),c.jsx(ii,{ref:qe,sheet:n,commands:Ve,...Pe},`table-${He}`),c.jsx(ai,{ref:qe,sheet:n,...Pe},`spill-${He}`),c.jsx(Yl,{ref:qe,sheet:n,commands:Ve,onShowTooltip:we,onCloseTooltip:ae,gridStyle:Ee,gridRef:W,editingCoords:G,isActive:w,...Pe},`selection-${He}`),c.jsx(Kl,{ref:qe,sheet:n,commands:Ve,gridStyle:Ee,element:v,...Pe},`copy-paste-${He}`),c.jsx(ni,{ref:qe,sheet:n,commands:Ve,target:Ie,renderMovable:K,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...Pe},`movable-${He}`),c.jsx(oi,{ref:qe,sheet:n,commands:Ve,gridStyle:Ee,getCellEditor:O,showProtectedError:pt,setEditingCoords:u,...Pe},`editor-${He}`)]},[n,W.current,Ee,O,Ve,ot]),[Eo,fl]=o.useState(!1),pl=o.useMemo(()=>{if(et===0||oe===0)return null;const ne=n.getStyles().getNormal(),qe=ne.getFont(),He=ne.getFill(),Pe=ne.getBorder(),Xe=ne.getFill().getType()===d.IFill.Type.None;let We=ie,lt=ie;const rt=(bt,Tt,Nt)=>Nt?{stroke:Pe.getBottom().isNone()?"none":bt.getColor().toRGBA(re.darkMode).toString(),...Tt}:Tt;lt=rt(Pe.getBottom(),lt,!Pe.getBottom().isNone()),lt=rt(Pe.getTop(),lt,!Pe.getTop().isNone()),We=rt(Pe.getRight(),We,!Pe.getRight().isNone()),We=rt(Pe.getLeft(),We,!Pe.getLeft().isNone());let nt=le?.getGridLineColor()?.toRGBA(re.darkMode).toString()??re.strokeFill;return Xe||(lt=rt(Pe.getBottom(),lt,!0),lt=rt(Pe.getTop(),lt,!0),We=rt(Pe.getRight(),We,!0),We=rt(Pe.getLeft(),We,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...si,...He.toCSS(re.darkMode),...qe.toCSS(re.darkMode,ce),"--sxl-app-color-background":re.fill,"--sxl-app-color-shadow":Ee.colorShadow,"--sxl-app-color-grey":Ee.colorGrey,"--sxl-app-color-button-fill":te.fill,"--sxl-app-color-button-text":te.text?.fill,"--sxl-app-color-button-border":te.edgeStrokeFill,"--sxl-app-color-primary-dark":Ee.selection.strokeFill},ref:W,zoom:ce,...X,onFirstRender:bt=>{fl(!0),X?.onFirstRender?.(bt),Ve?.activate()},showGridLines:Se,gridLineColor:nt,gridLineColumnsProps:We,gridLineRowsProps:lt,freezeLeft:Ce?.[me.AnchorLocation.Left],freezeLeftProps:rn,freezeTop:Ce?.[me.AnchorLocation.Top],freezeTopProps:rn,width:et,height:oe,columnCount:Re.width,rowCount:Re.height,cursor:wt??ht??"cell",clipCells:!0,layout:De,cellRenderer:hl,overlayRenderer:ml,getCellCoordsAsRangeCoords:de,getVisibleCells:on,onWheelScroll:mt,onPointerDown:Ht,onKeyDown:Gn,onViewportChange:V,onImmediateScroll:nn,scrollPoint:Q,stageProps:{onFocus:()=>{Ve?.activate()}},overlays:Et})},[H]);o.useEffect(()=>{Me.current||J()},[De,Ce,ce,Ve,Q?.left,Q?.top,re,X,et,oe,wt,Et,w,ht]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};S||(_n={..._n,...T});const vl=o.useMemo(()=>{const ne=n.getStyles().getTheme(),qe=ne.getColorScheme(),He=ne.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(re.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(re.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(re.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(re.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(re.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(re.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(re.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(re.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(re.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(re.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(re.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(re.darkMode),"--sxl-doc-font-major":He.getMajorFont(),"--sxl-doc-font-minor":He.getMinorFont()}},[n.getStyles().getTheme()]);let Zn=c.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:ne=>{L(!0),m?.(ne)},onBlur:ne=>{L(!1),q?.(ne)},ref:Mt,...j,children:c.jsx("div",{className:yt("sheetxl-sheet",Al),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...vl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Pt,Rn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[gl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,backgroundColor:re.fill},ref:M,onContextMenu:st,children:[pl,Sn,c.jsx(zl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Ee?.selection?.strokeFill,colorCredits:Ee?.body?.text?.fill})]})]})]})})});if(S){const ne=qe=>c.jsx(wo,{...qe,sheet:n});Zn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${pe.fill}`,minHeight:2*Fe.height,minWidth:2*Fe.width,...T},viewport:z,touchElement:W.current?.stage,disableTouch:at,onScrollViewport:qe=>{W.current?.scrollTo(qe)},createHorizontalScrollbar:ne,createVerticalScrollbar:ne,...p,children:Zn})}o.useEffect(()=>{Me.current=!1,J?.(),ee&&Mt.current?.focus()},[n]);const[Xn,Cl]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||Cl(!0)},[Xn]);return o.useEffect(()=>{if(Eo)return typeof R=="function"&&R(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[R,Eo,Xn]),Zn}));Dr.displayName="SheetElement";const ci=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Yo="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=",zr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:C,isDragging:g,view:s,onHide:f,onShow:S,onKeyDownCapture:p,onFocus:h,onBlur:E,loadingPanel:x,...A}=e,[N,K]=o.useState(!1),[P,R]=o.useState(null),[O,m]=o.useState(null),[q,T]=o.useState(null);o.useEffect(()=>{m(null),l.getDetails().then(k=>{K(!1),m(k.asUrl()),k.asSVGText?.()&&T(k.asSVGText())}).catch(k=>{console.warn(k),K(!0),m(Yo),T(null)})},[l]);const $=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),I=o.useMemo(()=>{if(O||q)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:N?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:N?"var(--sxl-app-color-background, white)":void 0,boxShadow:N?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:N?"contain":void 0,opacity:P?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:O,onLoad:()=>{R(!0)},onError:({currentTarget:k})=>{console.log("error"),k.onerror=null,m(Yo),K(!0)},alt:C??`${l.getType()}`})},[P,l,O,q,g]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:g?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...A,onKeyDownCapture:k=>{p?.(k)},ref:$,children:[P||N?void 0:x,I]})}));zr.displayName="PictureEditor";const ui=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:C,onHide:g,onShow:s,...f}=e;o.useEffect(()=>{},[a]);const S=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[p,{height:h,width:E}]=Ot();if(!a.isClosed())return c.jsx("div",{...f,ref:Xt([S,p]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:C?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),gi="_editable-input_1bqx6_6",hi=e=>c.jsx("input",{...e}),Nr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:C,onCancel:g,createInput:s=hi,styleHover:f={},dragging:S,maxLength:p,disabled:h=!1,readOnly:E=!1,...x}=e,[A,N]=o.useState(!1),[K,P]=o.useState(!1),[R,O]=o.useState(a);o.useEffect(()=>{O(a)},[a]);const m=o.useRef(null),[q,T]=o.useState(null),$=r.useNotifier(),I=o.useCallback(function(J){const M=J.message;q!==M&&($?.showMessage?.(M,{type:r.NotifierType.Error}),T(M))},[$,q]),k=o.useCallback(J=>{let M=!1;try{M=l?.(J)??!0}catch(U){I(U)}return M?(m.current=null,P(!1),O(J),M):(setTimeout(()=>{m.current?.focus()},0),M)},[l]),Z=r.useCallbackRef(()=>{O(a),m.current=null,P(!1),g?.()},[g,a]),X=o.useMemo(()=>{if(!K)return null;const J={className:yt(gi),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:p,type:"text",value:R,onFocus:M=>{m.current||(m.current=M.target,setTimeout(()=>{M.target?.select()},0))},onBlur:M=>{m.current&&k(R)},onChange:M=>{K&&O(M.target.value)},onMouseDown:M=>M.stopPropagation(),onKeyDown:M=>M.code==="Escape"?(M.preventDefault(),void Z()):M.code==="Enter"?(M.preventDefault(),void k(M.target.value)):void(M.code!=="Tab"?M.stopPropagation():k(M.target.value))};return c.jsx(c.Fragment,{children:s(J)})},[K,R,k,Z,s,h]),[B,j]=o.useState();o.useLayoutEffect(()=>{let J=Object.assign({},n);(S||A)&&(J=Object.assign(J,f)),j(J)},[S,A,f,n]),o.useEffect(()=>{X&&C?.(R)},[X,C,R]);const H=r.useImperativeElement(t,()=>({startEdit(){h||E||P(!0)},cancel(){Z()}}),[]);return c.jsxs("div",{...x,ref:H,style:{flexDirection:"column",display:"flex",...B},className:yt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{h||E||P(!0)},onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:R}),X]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...f},children:R})]})})),Pn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function ft(e){var t,n;return e?Yt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=ft(e);return e instanceof t}function bn(e){return!Yt(e)&&e instanceof ft(e).HTMLElement}function Lr(e){return e instanceof ft(e).SVGElement}function Zt(e){return e?Yt(e)?e.document:xo(e)?qo(e)?e:bn(e)||Lr(e)?e.ownerDocument:document:document:document}const Rt=Pn?o.useLayoutEffect:o.useEffect;function Hn(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 pn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function un(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function zn(e){const t=Hn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Nn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let io={};function yn(e,t){return o.useMemo(()=>{if(t)return t;const n=io[e]==null?0:io[e]+1;return io[e]=n,e+"-"+n},[e,t])}function Or(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,C)=>{const g=Object.entries(C);for(const[s,f]of g){const S=l[s];S!=null&&(l[s]=S+e*f)}return l},{...t})}}const _t=Or(1),vn=Or(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function Ln(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n})(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return(function(t){return"clientX"in t&&"clientY"in t})(e)?{x:e.clientX,y:e.clientY}:null}const jt=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[jt.Translate.toString(e),jt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Jo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mi(e){return e.matches(Jo)?e:e.querySelector(Jo)}const fi={display:"none"};function pi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:fi},n)}function vi(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 jr=o.createContext(null),Ci={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"})];l.addCommands(S,!0)},[l,e]),o.useEffect(()=>{if(!l)return;const v={disabled:!t.getProtection().isFormatCellsAllowed()};l.getCommand("pasteValues").updateCallback(S=>M.paste({...$l,...S})).update(v),l.getCommand("pasteFormats").updateCallback((S,T)=>M.paste({...Wl,description:T.label(),...S})).update(v),l.getCommand("pasteFormulas").updateCallback((S,T)=>M.paste({..._l,description:T.label(),...S})).update(v),l.getCommand("pasteTranspose").updateCallback((S,T)=>M.paste({...Gl,description:T.label(),...S})).update(v),l.getCommand("pasteLinks").updateCallback((S,T)=>M.paste({...Zl,description:T.label(),...S})).update(v),l.getCommand("cut").update(v),l.getCommand("paste").update(v)},[t,l]);const P=o.useMemo(()=>{if(!I||!k.current)return;const v=I.key;if(v!=="copy"&&v!=="cut"&&v!=="formatPainter")return;const S=k.current.getItem();if(S.getSource()!==t)return;const T=k.current.isCut?.(),W=T?q:m,D=T?s:u,O=S.getCoords(),G=O?[O]:null;return G&&G.length!==0?le=>{const U=[];for(let E=0;E<G.length;E++){const B=G[E],$=le.toClipBounds(le.getRangeCoordsBounds(B,{top:0,left:0,right:1,bottom:1}),ct.SELECTION_CLIP_INSETS);$&&(U.push(h({range:B,key:`copy-selection-background-${E}`,x:$.x,y:$.y,width:Math.max($.width,0),height:Math.max($.height,0),stroke:W,strokeWidth:2})),U.push(h({range:B,key:`copy-selection-foreground-${E}`,x:$.x+($.width<=2?-1:0),y:$.y,width:Math.max($.width,3),height:Math.max($.height,3),stroke:D,strokeWidth:2,isAnimatedStroke:!0})))}return U}:null},[I,t,n,u,m,s,q]);return{...M,clipboard:V,overlays:P}},Xl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:l,sheet:a,gridStyle:i,commands:f}=e,u=i.body??{},s=a.getView(),{overlays:m}=zr({element:l,sheet:a,sheetView:s,commands:f,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:u.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:u.fill});return Qe(a?.getSelection(),{onChange(q){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),m&&n?m(n):null})),Yl="_sheet-selection_12wyx_5",Jl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ql={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},ei={key:"dragCopy",description:"Drag selection to copy cell contents."},ti={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Jo=(e,t)=>t.ctrlKey&&t.shiftKey?ti:t.ctrlKey?ei:t.shiftKey?Ql:Jl,ni={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},oi=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:l,className:a,onFirstRender:i,onShowTooltip:f,onCloseTooltip:u,sheet:s,gridRef:m,gridStyle:q,isActive:p,editingCoords:h,...k}=e,b=n?.getBounds(),I=r.useCallbackRef(f,[f]),A=r.useCallbackRef(u,[u]),[K,V]=o.useState(()=>s?.getSelection().getCoords()),M=r.useCallbackRef(Y=>{fe.CoordUtils.isEqualSelectionCoords(Y,K)||s&&s.getSelection().updateCoords(Y)},[s,K]),P=r.useEditMode(),v=o.useRef(null),[S,T]=o.useState(s?.getProtection().isLocked()),[W,D]=o.useState(s?.getView().getMovableSelection().length>0),O=r.ReactUtils.detectIt().primaryInput==="touch",G=!O&&p,le=h!==null||W,U=r.useCallbackRef(Y=>{const _=fe.CoordUtils.cellToRange(Y);if(s.isClosed())return _;const ae=s.getRange(_,{ignoreHidden:!0}).getMerges();return ae.length===0?_:ae[0]},[s]),E=r.useCallbackRef((Y,_,ae,ve,ue,ke)=>{const se=s.getSelectedRange().getExtended(ve,Y).getCoords();switch(ve){case d.IRange.Direction.Up:return se.rowStart;case d.IRange.Direction.Down:return se.rowEnd;case d.IRange.Direction.Left:return se.colStart;case d.IRange.Direction.Right:return se.colEnd}},[s]),B=r.useCallbackRef(()=>{const Y=s.getUsedRange()?.getCoords(),_=s.getRowHeaders().getUsedRange()?.getCoords(),ae=s.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,ae?.max??0),rowEnd:Math.max(Y?.rowEnd??0,_?.max??0)}},[s]),$=r.useCallbackRef((Y,_)=>s.getRowHeaders().hiddenHeadersAt(Y,_),[s]),R=r.useCallbackRef((Y,_)=>s.getColumnHeaders().hiddenHeadersAt(Y,_),[s]),L=r.useCallbackRef(Y=>s.getRange(Y,{ignoreHidden:!0}).getMerges(),[s]),ee=r.useCallbackRef(Y=>{s?.getSelection().setAdjusting(Y)},[s]),ie=r.useCallbackRef(async()=>{s?.getSelection().setAdjusting(null),P.getMode()?.key==="formatPainter"&&(await l?.getCommand("pasteFormats")?.execute({}),P.setMode(null))},[P,K,s,l]),Ce=o.useMemo(()=>{const Y=P.getMode();return Y?.key==="cut"||Y?.key==="copy"},[P]);Qe(s?.getView(),{onMovableSelectionChange:()=>{D(s.getView().getMovableSelection().length>0)}}),Qe(s?.getSelection(),{onChange(Y){const _=s.getSelection().getCoords();V(_)}}),Qe(s,{onProtectionChange:()=>{T(s.getProtection().isLocked())}});const{body:Se={}}=q||{},he=r.useNotifier(),Te=n.getLayout(),Ke=!(G&&K.ranges.length<=1&&h===null&&!S&&(!P.getMode()||Ce)),{cursor:Ee,overlay:He,onPointerDown:J}=ct.useSelection({gridRef:m,commands:l,layout:Te,getCellCoordsAsRangeCoords:U,selection:K,fillHandleBorderColor:Se.fill,selectionBackgroundColor:p?q.selection.fill:q.selectionInactive.fill,selectionBorderColor:p?q.selection.strokeFill:q.selectionInactive.strokeFill,selectionRemoveBackgroundColor:p?q.selectionRemove.fill:q.selectionInactive.fill,selectionRemoveBorderColor:p?q.selectionRemove.strokeFill:q.selectionInactive.strokeFill,disableFillDrag:Ke,disableMoveDrag:O||!(p&&K.ranges.length<=1&&h===null&&!S),disableTouchSelection:le,onSelectionChange:M,onSelectionDragStart:ee,onSelectionDragEnd:ie,onMoveDragStart:(Y,_,ae)=>{P.setMode(Jo(0,ae))},onMoveDragUpdate:(Y,_,ae)=>{P.setMode(Jo(0,ae))},onMoveDragEnd:(Y,_)=>{P.setMode(null)},onMoveDragDone:async(Y,_,ae)=>{if(fe.CoordUtils.isEqualRanges(Y,_))return;const ve=s.getRange(_);if(he?.showOptions){const qe=ve.getDifferences(Y);let Me=!1;const y=qe.getCount();for(let Ae=0;!Me&&Ae<y;Ae++)Me=qe.at(Ae).isContentful();if(Me&&await he?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ue=!ae.ctrlKey,ke=ae.shiftKey,se=ke?ue?"Insert Moved Cells":"Insert Copied Cells":ue?"Move Cells":"Copy Cells",ye=await he?.showBusy?.(se);try{const qe=s.getRange(Y);await ve.doBatch(async()=>{ke?await ve.insertFrom(Y,{isCut:ue,undoRange:qe}):await ve.copyFrom(Y,{isCut:ue,undoRange:qe}),qe.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),ve.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:se,autoSelect:!0})}catch(qe){he?.showError?.(qe)}finally{ye?.()}},contentfulCellFinder:E,hiddenRowsAt:$,hiddenColumnsAt:R,mergedRanges:L,getDataCoords:B,canSelectionSpanMergedCells:Y=>{const _=s.getRange(Y);return _.isEntireColumns()||_.isEntireRows()},onFill:async(Y,_)=>{const ae="Auto Fill",ve=await he?.showBusy?.(ae);try{await s.doBatch(()=>{s.getRange(Y).autoFill(_),s.getRange(_).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:ae,autoSelect:!0})}catch(ue){he?.showError?.(ue)}finally{v.current=null,ve?.()}},onFillPreview:(Y,_,ae)=>{if(m.current&&I){P.setMode(ni);try{v.current?.direction!==ae&&(v.current=null,s.getRange(Y).autoFill(_,{previewOnly:y=>{v.current={callback:y,direction:ae}}}));const ve=v.current?.callback?.(_);if(!ve||ve.isEmpty())return;const ue=ve.toText();if(!ue)return;const ke=fe.CoordUtils.cellToRange(ve.getCoords()),se=n.getRelativePointFromClient(0,0);let ye=0,qe=0,Me=r.ToolTipPlacement.Bottom;if(ae===d.IRange.Direction.Down){ye=Te.getColOffset(ke.colEnd+1)-se.x;const y=Te.getRowOffset(ke.rowEnd),Ae=Te.getRowOffset(ke.rowEnd+1);qe=Ae-(Ae-y)/2-se.y,Me=r.ToolTipPlacement.Right}else if(ae===d.IRange.Direction.Right){qe=Te.getRowOffset(ke.rowEnd+1)-se.y;const y=Te.getColOffset(ke.colEnd),Ae=Te.getColOffset(ke.colEnd+1);ye=Ae-(Ae-y)/2-se.x,Me=r.ToolTipPlacement.Bottom}else if(ae===d.IRange.Direction.Up){ye=Te.getColOffset(ke.colEnd+1)-se.x;const y=Te.getRowOffset(ke.rowStart),Ae=Te.getRowOffset(ke.rowStart+1);qe=Ae-(Ae-y)/2-se.y,Me=r.ToolTipPlacement.Right}else if(ae===d.IRange.Direction.Left){qe=Te.getRowOffset(ke.rowEnd+1)-se.y;const y=Te.getColOffset(ke.colStart),Ae=Te.getColOffset(ke.colStart+1);ye=Ae-(Ae-y)/2-se.x,Me=r.ToolTipPlacement.Bottom}I({anchor:{x:ye,y:qe},display:ue,placement:Me})}catch(ve){he?.showError?.(ve)}}},onFillDone:()=>{v.current=null,P.setMode(null),A?.()}}),ne=r.useCallbackRef(Y=>{J(r.ReactUtils.createSyntheticEvent(Y))},[J,h]);o.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",ne),()=>{Y.removeEventListener("pointerdown",ne)}},[n?.getStage()]);const pe=r.useImperativeElement(t,()=>({}),[]),De=o.useRef(null);return c.jsx("div",{className:ut(a,"sheet-selection",Yl),style:{position:"absolute",width:b?.width,height:b?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Yt([pe,De]),...k,children:He(n)})})),En=Object.freeze({x:0,y:0,width:0,height:0}),ri={fireOnModelChange:!1},li=o.memo(o.forwardRef((e,t)=>{const{children:n,view:l,movable:a,onRefLoad:i,onRefUnload:f,onHide:u,onShow:s,onUnFocus:m,isDragging:q,updateFrameBounds:p,dragStart:h,style:k,disabled:b,renderMovable:I,...A}=e,[K,V]=o.useState(En),[M,P]=o.useState(null),[v,S]=o.useState(!1),T=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const D=a.getBounds();if(!D)return;const O=l.toViewBounds(D);V(O??En),p(O??En)},[l?.getBounds()]),Qe(a,{onBoundsChange:D=>{const O=D.getBounds();if(!O)return;const G=l.toViewBounds(O);V(G??En),p(G)},onSelectionChange:()=>{const D=fe.CommonUtils.hasFocus(T.current,!0);!v&&!D||a.isSelected()||m()}}),Qe(a,{onRequestFocus:()=>fe.CommonUtils.whenFocus(T.current,!0)},ri),o.useEffect(()=>{const D=T.current;return i(D),()=>{f(D)}},[]);const W=o.useMemo(()=>{if(!K)return null;let{width:D,height:O}=K;return I({view:l,movable:a,disabled:b,isDragging:q,style:{position:"relative",left:0,top:0,width:D,height:O},onHide:u,onShow:s})},[l,a,K.width,K.height,b,q]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Yt([T,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:K.x,top:K.y,width:K.width,height:K.height,...k},onMouseDown:async D=>{const O=D.shiftKey||D.ctrlKey,G=a.isSelected(),le=D.currentTarget;O&&G?a.unselect():(G&&!O||await a.select({addToSelection:O}),h(D.nativeEvent,le),le.focus())},onFocus:D=>{D.relatedTarget&&!M&&P(D.relatedTarget),S(!0)},onBlur:D=>{M&&!T?.current?.contains(D.relatedTarget)&&P(null),D.relatedTarget&&S(!1)},...A,children:W})})),ii="_movable-area_314c6_5",Nr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:l,movablesView:a,renderMovable:i,transactional:f,onUnFocus:u,onFocus:s,disabled:m=!1,disableDrag:q=!1,disableResize:p=!1,className:h,style:k,renderDirections:b=["nw","n","ne","w","e","sw","s","se"],onFirstRender:I,...A}=e,K=n.getBounds(),V=r.useCallbackRef(I,[I]),M=r.useCallbackRef(u,[u]),P=r.useCallbackRef(s,[s]),[v,S]=o.useState([]),[T,W]=o.useState(!1),[D,O]=o.useState(!1),G=o.useRef(!0),le=o.useRef(new Map),U=o.useRef(new Map),E=o.useRef(new Map),B=o.useRef(new Map),$=o.useRef(new Map),R=o.useRef({onRequestFocus:re=>(ae(re),null)}),L=o.useRef(null),ee=o.useRef(null),ie=o.useRef(null),[Ce,Se]=o.useReducer(re=>re+1,0);o.useLayoutEffect(()=>{Se()},[n,l]),Qe(l,{onCollectionChange:()=>{const re=l.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),Ie=$.current;Ie.forEach(xe=>{xe()}),Ie.clear();const ze=R.current;for(let xe=0;xe<re.length;xe++){const Ne=re[xe];if(Ne.isClosed())continue;const z=Ne.addListeners(ze);Ie.set(Ne,z)}Se()},onInvalidated:()=>{Se()}}),Qe(a,{onMovableSelectionChange(re){Te(),Se()}});const he=o.useCallback((re,Ie)=>{const ze=E.current.get(re);ie.current&&(ie.current.getTargets().forEach(xe=>{if(xe===ze)return xe.style.left=Ie.x+"px",xe.style.top=Ie.y+"px",xe.style.width=Ie.width+"px",void(xe.style.height=Ie.height+"px")}),ie.current.updateRect())},[]),Te=()=>{const re=[],Ie=a.getMovableSelection();Ie.forEach(ze=>{const xe=E.current.get(ze);xe&&Ie.indexOf(ze)!==-1&&re.push(xe)}),S(ze=>fe.CommonUtils.isEqualArrays(ze,re)?ze:re)},Ke=o.useRef(null),Ee=o.useRef(null),He=o.useMemo(()=>(Ee.current||(Ee.current=new Promise(re=>{Ke.current=re})),Ee.current),[]),J=o.useRef(null),ne=r.useCallbackRef(async(re,Ie)=>{J.current=Ie,await(async()=>!(!await He.then()||!ie.current))()&&J.current===Ie&&ie.current.dragStart(re,Ie)},[v]),[pe,De]=o.useState(!1),Y=o.useRef(null),_=o.useRef(null),ae=r.useCallbackRef(async(re=null)=>{if(re||(re=a.getMovableSelection()[0]),!re)return M?.(),!1;const Ie=E.current.get(re);Ie?(await fe.CommonUtils.whenFocus(Ie),Ie.focus(),_.current=Ie,Y.current=null):Y.current=re},[a]);o.useEffect(()=>{pe&&v.length>0&&_.current!==v[0]&&ae(),G.current&&(V?.(),G.current=!1)},[v]);const ve=o.useMemo(()=>{const re=l.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(re.length===0&&le.current.size===0)return null;const Ie=(te,j,Z,g=!0)=>{const x=te.isSelected(),F={tabIndex:Z,view:n,movable:te,onRefLoad:C=>{Y.current===te&&(C.focus(),_.current=C,Y.current=null),E.current.set(te,C),U.current.set(C,te),j.rendered=!0,Te()},onRefUnload:C=>{E.current.delete(te),U.current.delete(C),j.rendered=!1,Te()},onUnFocus:M,onHide:C=>{j.onHide=C},onShow:C=>{j.onShow=C},isDragging:x&&(D||T),disabled:m,renderMovable:i,updateFrameBounds:C=>{he(te,C)},dragStart:ne,onMouseUp:()=>{if(J.current=null,ee.current){W(!1),O(!1);let C=!1;B.current?.forEach(N=>{fe.CommonUtils.isEqualBounds(N.movable.getBounds(),N.startBounds)||(C=!0)}),C?ke():se()}},style:{opacity:g?T&&x?.7:void 0:0,zIndex:T&&x?te.getZIndex()+re.length:void 0,pointerEvents:g?void 0:"none",cursor:D&&x?"grabbing":m||q?"initial":"move",boxShadow:!x||D&&!T?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(li,{...F},`movable-${te.getUUID()}`)},ze=le.current,xe=new Map,Ne=[];for(let te=0;te<re.length;te++){const j=re[te];if(j.isClosed())continue;let Z=ze.get(j);Z||(Z={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(g,x)=>{if(!x||x.shown===!0)return;x.shown=!0;const F=++x.visibilityRequestId;requestAnimationFrame(()=>{const C=le.current.get(g);C&&F===x.visibilityRequestId&&(x.onShow?.(g),C.shown=!0)})},doHide:async(g,x)=>{if(!x||x?.shown===!1)return;x.shown=!1;const F=++x.visibilityRequestId,C=await Promise.resolve(x.onHide?.(g));F===x.visibilityRequestId&&C!==!1&&(x.shown=!1,le.current.delete(g),Se())},visibilityRequestId:0}),Z.frame=Ie(j,Z,te,!0),Ne.push(Z.frame),Z.doShow(j,Z),ze.delete(j),xe.set(j,Z)}const z=[];return a.getMovableSelection().forEach(te=>{const j=ze.get(te);j&&(j.frame=Ie(te,j,-1,!1),z.push(j.frame),ze.delete(te),xe.set(te,j))}),ze.forEach((te,j)=>{te.frame=Ie(j,te,-1,!1),z.push(te.frame),te.doHide(j,te),ze.delete(j),xe.set(j,te)}),le.current=xe,Te(),[...z,...Ne]},[Ce,n,i,m,q,p,T,D]),ue=r.useCallbackRef((re,Ie)=>{const ze=`${Ie} ${v.length===1?d.TextUtils.capitalize(U.current?.get(v[0]).getContent().getType()):"Drawings"}`;ee.current&&(console.warn(`Transaction ${ee.current.getDescription()} is being replaced by ${ze}`),ee.current.rollback(),ee.current=null),ee.current=f.beginCommit({description:ze}),B.current.clear();for(let xe=0;xe<v.length;xe++){const Ne=v[xe],z=U.current?.get(Ne);z?B.current.set(Ne,{movable:z,startBounds:n.toViewBounds(z.getBounds())}):console.warn("invalid element",z)}},[f,n,v]),ke=o.useCallback(()=>{if(!ee.current)return;const re=[];B.current?.forEach(Ie=>{re.push(Ie.movable)}),ee.current.commit({viewAfter:{view:a,movableSelection:re}}),B.current.clear(),ee.current=null},[]),se=o.useCallback(()=>{ee.current&&(ee.current.rollback(),ee.current=null)},[]),ye=o.useRef(null);o.useEffect(()=>{ye.current&&(ye.current.onscroll=re=>{re.preventDefault(),re.srcElement.scrollTop=0,re.srcElement.scrollLeft=0})},[ye.current]);const qe=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ae,focus:()=>{ae()}}),[a]),[Me,y]=o.useState(null),Ae=o.useRef(!1),Ze=o.useRef(!1),Le=o.useRef(!1);o.useEffect(()=>{if(m||v.length===0||Le.current||Ae.current)return;if(Ze.current)return void requestAnimationFrame(()=>{ie.current&&L.current&&ie.current.refTargets.length>0&&(Le.current=!0,Ke.current?.(!0)),S([...v])});Ae.current=!0;const re=o.lazy(async()=>{try{const Ie=await Promise.resolve().then(()=>require("./DmsD3sf5OJbFtZzf.cjs"));return Ae.current=!1,Ze.current=!0,S([...v]),Ie}catch(Ie){return console.warn(Ie),Ke.current?.(!1),null}});y(re)},[v,m,q,p]);const et=o.useMemo(()=>!Me||m?null:c.jsx(o.Suspense,{children:c.jsx(Me,{className:ut({dragging:T||D,resizing:T,moving:D}),container:null,ref:ie,target:ie.current?v:[],draggable:!m&&!q,resizable:!m&&!p,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:b,onResizeStart:re=>{ue(re.target,"Resize")},onResize:re=>{if(!ee.current)return re.stopDrag(),void Se();W(!0);const Ie=re.direction[0]!==0&&re.direction[1]!==0;let ze=0,xe=0;for(let Ne=0;Ne<v.length;Ne++){const z=v[Ne],te=B.current.get(z),j=U.current.get(z);if(!te||!j){console.warn("invalid element");continue}let Z=re.dist[0],g=re.dist[1],x=re.drag.dist[0],F=re.drag.dist[1],C=te.startBounds.width,N=te.startBounds.height;Ne===0?(ze=C,xe=N):(Z*=C/ze,x*=C/ze,g*=N/xe,F*=N/xe);const w={...te.startBounds};if(w.width=Math.max(0,C+Z),w.height=Math.max(0,N+g),re.direction[0]===-1&&(w.width=Math.max(0,Math.min(te.startBounds.x+C,C-x))),re.direction[1]===-1&&(w.height=Math.max(0,Math.min(te.startBounds.y+N,N-F))),Ie&&(j.isLockAspectRatio()||re.inputEvent?.shiftKey)){const H=C/N,X=w.width/w.height;X>H?w.height=w.width/H:X<H&&(w.width=w.height*H)}re.direction[0]===-1&&(w.x=Math.max(0,Math.min(te.startBounds.x+C,te.startBounds.x+C-w.width))),re.direction[1]===-1&&(w.y=Math.min(te.startBounds.y+N,te.startBounds.y+N-w.height)),te.movable.setBounds(n.toAbsoluteBounds(w))}},onResizeEnd:re=>{W(!1),ke()},onDragStart:re=>{ue(re.target,"Move")},onDrag:re=>{if(!ee.current)return re.stopDrag(),void Se();O(!0);for(let Ie=0;Ie<v.length;Ie++){const ze=v[Ie],xe=B.current.get(ze);xe?xe.movable.setBounds(n.toAbsoluteBounds({...xe.startBounds,x:xe.startBounds.x+re.translate[0],y:xe.startBounds.y+re.translate[1]})):console.warn("invalid element")}},onDragEnd:re=>{},onMouseUp:re=>{}})}),[Ce,Me,v,n,m,q,p,T,D]);return c.jsx("div",{className:ut(h,"movable-area",ii),style:{width:K.width,height:K.height,...k,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Yt([qe,ye]),...A,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:K.width,height:K.height},...A,children:c.jsxs("div",{ref:L,style:{position:"absolute",pointerEvents:"auto"},onFocus:re=>{P?.(),De(!0)},onBlur:re=>{De(!1)},onKeyDownCapture:re=>{if(re.isDefaultPrevented())return;const Ie=re.nativeEvent.ctrlKey,ze=re.nativeEvent.altKey,xe=re.nativeEvent.shiftKey;if(re.which===r.KeyCodes.Escape){const Z=a.getMovableSelection();let g=[...Z];return v.forEach(x=>{if(g.length===0)return;const F=U.current.get(x);let C=g.indexOf(F);g.splice(C,1)}),g.length!==Z.length&&a.selectMovables(g),g.length===0&&M?.(),void re.preventDefault()}const Ne=.1,z=Z=>{l.updateSelected(g=>{g.setRotation(g.getRotation()+Z)},"Rotate")},te=(Z,g=!0)=>{l.updateSelected(x=>{const F=x.getBounds();let C=1+Z;g||(C=1/C);const N=Math.sqrt(Math.pow(F.width,2)+Math.pow(F.height,2)),w=Math.atan2(F.height,F.width),H=C*N;if(H<10)return;const X=H*Math.cos(w),Q=H*Math.sin(w),ce={x:F.x+(F.width-X)/2,y:F.y+(F.height-Q)/2,width:X,height:Q};x.setBounds(ce)},"Resize")},j=Z=>{l.updateSelected(g=>{const x=g.getBounds(),F={x:x.x+(Z.x??0),y:x.y+(Z.y??0),width:x.width+(Z.width??0),height:x.height+(Z.height??0)};g.setBounds(F)},"Nudge")};if(re.which===r.KeyCodes.Delete)l.updateSelected(Z=>{Z.delete()},"Delete"),re.preventDefault();else if(re.key==="a"&&Ie){const Z=a.getMovableSelection();a.selectMovables(l.getItems(),!0),a.selectMovables(Z,!0),re.preventDefault()}else re.key==="ArrowLeft"?(xe?te(Ne,!1):ze?z(-10):j({x:Ie?-10:-1}),re.preventDefault()):re.key==="ArrowRight"?(xe?te(Ne,!0):ze?z(10):j({x:Ie?10:1}),re.preventDefault()):re.key==="ArrowUp"?(xe?te(Ne,!0):j({y:Ie?-10:-1}),re.preventDefault()):re.key==="ArrowDown"&&(xe?te(Ne,!1):j({y:Ie?10:1}),re.preventDefault())},children:[ve,et]})})})})),Wt=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,l=0,a=0;for(let i=0;i<e.length;i++){const f=e[i].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),l=Math.max(f.x+f.width,l),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:l-t,height:a-n}},Qo=(e,t=!0)=>{const n=[],l=t?"x":"y",a=t?"y":"x",i=t?"width":"height";let f=0,u=Number.MAX_SAFE_INTEGER,s=0;for(let p=0;p<e.length;p++){const h=e[p],k=h.getBounds();f+=k[i],u=Math.min(k[l],u),s=Math.max(k[l]+k[i],s),n.push({bounds:k,movable:h})}const m=(s-u-f)/(e.length-1);n.sort((p,h)=>{const k=p.bounds[l],b=h.bounds[l];return k!==b?k-b:p.bounds[a]-h.bounds[a]});const q=new Map;q.set(n[0].movable,n[0].bounds);for(let p=1;p<n.length-1;p++){const h=n[p-1].bounds,k={...n[p].bounds};k[l]=h[l]+h[i]+m,n[p].bounds=k,q.set(n[p].movable,k)}return q.set(n[n.length-1].movable,n[n.length-1].bounds),q};function Lr(e){const{movables:t,movablesView:n,transactional:l,commands:a,target:i,onRepeatCommandChange:f}=e,u=r.useNotifier(),s=r.useEditMode();o.useRef(s.getMode()).current=s.getMode();const m=r.useCallbackRef(async(M,P,v=null,S=!0)=>{const T=async()=>{const W=await Promise.resolve(u?.showBusy?.(M.label()));try{await P();const D=v??M?.label?.();if(f){let O=null;M&&D!==!1&&(O=new r.SimpleCommand(M.key(),i,{label:D,description:D},T)),f(O)}W?.(),S&&s.setMode(null)}catch(D){W?.(),u?.showError?.(D)}};await T()},[f,u]),[q,p]=o.useReducer(M=>M+1,0),h=r.useCallbackRef((M,P,v)=>{if(!n)return;const S=n.getMovableSelection();if(S.length===0)return;let T="Drawings";if(S.length===1){const D=S[0];T=d.TextUtils.capitalize(D.getContent().getType())??"Drawing"}const W=`${M.label()} ${T}`;m(M,()=>{let D=null;l&&(D=l.beginCommit(W));const O=n.getMovableSelection();if(O.length===0)return;const G=v?.(O);for(let le=0;le<O.length;le++){const U=O[le];P(U,G)}D?.commit()})},[n,l]),[k,b]=o.useState(n.getMovableSelection()[0]??null),[I,A]=o.useState(!k||k?.isProtected()),K=o.useMemo(()=>[new r.Command("moveToFront",i,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){h(this,M=>{M.moveToFront()})}),new r.Command("moveForward",i,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){h(this,M=>{M.moveForward()})}),new r.Command("moveToBack",i,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){h(this,M=>{M.moveToBack()})}),new r.Command("moveBackward",i,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){h(this,M=>{M.moveBackward()})}),new r.Command("toggleLockAspectRatio",i,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){h(this,M=>{M.setLockAspectRatio(!M.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",i,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){h(this,M=>{M.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",i,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes.",icon:"DrawResize"},function(){h(this,M=>{M.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",i,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes.",icon:"DrawResize"},function(){h(this,M=>{M.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",i,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){h(this,(M,P)=>{M.setBounds({x:P.x})},Wt)}),new r.Command("formatDrawAlignCenter",i,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){h(this,(M,P)=>{M.setBounds({x:(P.width-M.getBounds().width)/2+P.x})},Wt)}),new r.Command("formatDrawAlignRight",i,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){h(this,(M,P)=>{M.setBounds({x:P.width-M.getBounds().width+P.x})},Wt)}),new r.Command("formatDrawAlignTop",i,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){h(this,(M,P)=>{M.setBounds({y:P.y})},Wt)}),new r.Command("formatDrawAlignMiddle",i,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){h(this,(M,P)=>{M.setBounds({y:(P.height-M.getBounds().height)/2+P.y})},Wt)}),new r.Command("formatDrawAlignBottom",i,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){h(this,(M,P)=>{M.setBounds({y:P.height-M.getBounds().height+P.y})},Wt)}),new r.Command("formatDrawDistributeHorz",i,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){h(this,(M,P)=>{M.setBounds(P.get(M))},M=>Qo(M))}),new r.Command("formatDrawDistributeVert",i,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){h(this,(M,P)=>{M.setBounds(P.get(M))},M=>Qo(M,!1))}),new r.Command("formatDrawFlipHorz",i,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",i,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",i,{label:"Group",description:"Group the selected drawings into a single drawing.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",i,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),new r.Command("formatDrawSwapShapes",i,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",i,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",i,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,k]);o.useEffect(()=>{},[s]);const V=o.useMemo(()=>{let M=null;return M=a?a.createChildGroup(i,"movable",!1):new r.CommandGroup(i,"movable"),M.addCommands(K,!0),M},[a,K]);return Qe(k,{onAnyChange:()=>{V.getCommand("formatAnchorTypeTwoCell").update({state:k?.getAnchorType()===d.IAnchored.Type.TwoCell}),V.getCommand("formatAnchorTypeOneCell").update({state:k?.getAnchorType()===d.IAnchored.Type.OneCell}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===d.IAnchored.Type.Absolute}),V.getCommand("toggleLockAspectRatio").update({state:k?.isLockAspectRatio()})},onProtectedChange:M=>{A(M.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const M=n.getMovableSelection()[0]??null;b(M),A(!M||M.isProtected()),p()}}),Qe(t,{onCollectionChange:()=>{p()}}),o.useEffect(()=>{const M={disabled:I};V.getCommand("formatAnchorTypeTwoCell").update(M),V.getCommand("formatAnchorTypeOneCell").update(M),V.getCommand("formatAnchorTypeAbsolute").update(M),V.getCommand("toggleLockAspectRatio").update(M);const P=t.getCount(),v=n.getMovableSelection(),S=I||P<=1||v.length===0;let T={disabled:S},W=T;if(!S&&v.length===1){const G=v[0];G.getZIndex()===0&&(T={disabled:!0}),G.getZIndex()===P-1&&(W={disabled:!0})}V.getCommand("moveToFront").update(W),V.getCommand("moveForward").update(W),V.getCommand("moveToBack").update(T),V.getCommand("moveBackward").update(T);const D={disabled:I||v.length<=1};V.getCommand("formatDrawAlignLeft").update(D),V.getCommand("formatDrawAlignCenter").update(D),V.getCommand("formatDrawAlignRight").update(D),V.getCommand("formatDrawAlignTop").update(D),V.getCommand("formatDrawAlignMiddle").update(D),V.getCommand("formatDrawAlignBottom").update(D),V.getCommand("formatDrawFlipHorz").update(D),V.getCommand("formatDrawFlipVert").update(D),V.getCommand("formatDrawGroup").update(D),V.getCommand("formatDrawUngroup").update(D),V.getCommand("formatDrawSwapShapes").update(D),V.getCommand("formatDrawSwapShapesHorz").update(D),V.getCommand("formatDrawSwapShapesVert").update(D);const O={disabled:I||v.length<=2};V.getCommand("formatDrawDistributeHorz").update(O),V.getCommand("formatDrawDistributeVert").update(O)},[q,I,q]),V}const ai=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,description:a,view:i,isDragging:f,onHide:u,onShow:s,...m}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[p,{height:h,width:k}]=Pt();return c.jsx("div",{...m,ref:Yt([q,p]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:l?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),si=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,movableProps:a,renderMovable:i,commands:f,target:u,onRepeatCommandChange:s}=e,m=Lr({movables:l.getMovables(),movablesView:l?.getView(),transactional:l,onRepeatCommandChange:s,commands:f,target:u});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const q=o.useMemo(()=>c.jsx(Nr,{ref:t,view:n,movables:l.getMovables(),disableResize:!l.getProtection().isObjectsAllowed(),disableDrag:!l.getProtection().isObjectsAllowed(),movablesView:l.getView(),transactional:l,renderMovable:i,...a,onFocus:()=>{m.activate(),a?.onFocus?.()}},"movable-area"),[l,a,f,m]);return q&&n?q:null})),ci=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,gridStyle:a,getCellEditor:i,showProtectedError:f,setEditingCoords:u,commands:s}=e,m=r.useEditMode(),[q,p]=o.useState(null),[h,k]=o.useState(null),[b,I]=o.useState(null),[A,K]=o.useState(null),[V,M]=o.useState(null);o.useLayoutEffect(()=>{if(b===null)return K(null),void M(null);const R=()=>{const L=l.getRange(b).getCell(),ee=L.getStyle();let ie,Ce=ee.getFill()?.toCSS(a.body.darkMode);Ce.background!=="none"&&Ce.background!=="transparent"||(Ce=l.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),Ce.background!=="none"&&Ce.background!=="transparent"||(Ce={background:a.body.fill}),K({style:Ce}),L&&!L.getFormula()&&(ie=L?.getRenderHorizontalAlignment()),M(ie??r.HorizontalAlignment.Left)};return R(),l.getRange(b).addListener(()=>{R()})},[l,b,a?.body]);const P=r.useCallbackRef(()=>{let R=h.editState.dirty??"";if(h.editState.dirty!==void 0){const L=d.TextUtils.clampString(R);try{const ee=h.sheet.getRange(h.coords),ie=`Typing '${L}' into ${ee.toString()}`;return ee.setValue(R,{description:ie,autoFit:!0}),I(null),k(null),m.setMode(null),u(null),!0}catch(ee){throw fe.Notifier.error(new Error(`Unable to enter '${L}'.`,{cause:ee})),ee}}},[l,h]),v=r.useCallbackRef(R=>l.getRange(R).getCell().getExtrusions()??fe.CoordUtils.cellToRange(R),[l]),S=r.useCallbackRef(R=>{let L=d.IRange.Orientation.Row,ee=!1;R!==d.IRange.Direction.Up&&R!==d.IRange.Direction.Down||(L=d.IRange.Orientation.Column),R!==d.IRange.Direction.Left&&R!==d.IRange.Direction.Up||(ee=!0),l.getSelection().traverse(L,ee)},[l]),T=o.useCallback((R,L)=>{if(i)return i(R,L);if(!l)return null;const{ref:ee,...ie}=R;return c.jsx(Mr,{ref:ee,...ie,sheet:l,bodyStyle:a?.body,activeCoords:L,commands:s,onChangeEdit:Ce=>{const Se={sheet:l,coords:L,editState:Ce};m.setMode(he=>({...he,description:Se.editState.editMode?"Edit":"Enter",args:{...he?.args,stateAndCoords:Se}}))},editState:h.editState})},[l,A,i,h,b]),{overlay:W,startEdit:D,submitEdit:O,cancelEdit:G,onKeyboardEventNative:le,onPointerEventNative:U}=ct.useKeyboardEditorOverlay({view:n,activeCoords:q,getCellEditor:T,canEdit:()=>{const R=l.getProtection();if(R.isReadOnly())return!1;const L=R.isLocked();return L&&f(),!L},onBeforeStartEdit:R=>{const L=Tr(()=>l.getRange(R).getCell()),ee={sheet:l,coords:R,editState:Object.freeze(L)};m.setMode({key:"edit",args:{stateAndCoords:ee}}),k(ee)},onStartEdit:R=>{I(R),u(R)},onSubmitEdit:P,onCancelEdit:R=>{I(null),k(null),m.setMode(null),u(null)},onDoneEdit:R=>{m.setMode(null)},onNavigate:S,containerProps:A,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:l?.getSelection().getCoords().ranges?.length>1?1:2,alignment:V,getRangeCoords:v});Qe(l.getSelection(),{onChange(R){p(l.getSelection().getCoords().cell)}});const E=r.useCallbackRef(R=>{U(R),b&&O()},[U,G,b]),B=o.useCallback(R=>{U(R)},[U]),$=o.useCallback(R=>{le(R)},[le]);return o.useEffect(()=>{const R=n?.getStage();if(R)return R.addEventListener("pointerdown",E),R.addEventListener("dblclick",B),R.addEventListener("keydown",$),()=>{R.removeEventListener("pointerdown",E),R.removeEventListener("dblclick",B),R.removeEventListener("keydown",$)}},[n?.getStage()]),o.useEffect(()=>{const R=m.getMode(),L=R?.key;L==="edit"||L==="enter"?h?R.args?.cancel?G():R.args?.submit?O():k(R.args?.stateAndCoords):D(R.args?.start):b&&G()},[m]),W(n,t)})),Pr="white",jr="black",di=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${jr}' fill='${Pr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ui=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${jr}' fill='${Pr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,gi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l}=e,[a,i]=o.useState(l.getTables().getCount()>0),[f,u]=o.useState(null),[s,m]=o.useState(null),[q,p]=o.useState(null),[h,k]=o.useState(null),b=r.useCallbackRef(()=>{if(l.getTables().getCount()>0){i(!0);const v=l.getTables().getItems({address:n.getVisibleRangeCoords()});u(v.length>0?v:null)}else i(!1),u(null)},[l,n]),I=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const S=n.getCellCoordsFromClient(v.clientX,v.clientY),T=l.getTables().getItems({address:S});T.length===1&&T[0].select()},[n,l]),A=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const S=n.getCellCoordsFromClient(v.clientX,v.clientY),T=l.getTables().getItems({address:S});if(T.length===1){const W=T[0].getRange().getCoords(),D={colStart:W.colStart,rowStart:S.rowIndex,colEnd:W.colEnd,rowEnd:S.rowIndex};l.getRange(D).select()}},[n,l]),K=r.useCallbackRef(()=>{if(!a)return;const v=l.getTables().getItems({address:n.getVisibleRangeCoords()});u(v.length>0?v:null)},[l,a,n]);Qe(l?.getSelection(),{onChange(v){m(l.getSelection().getCoords().cell)}}),Qe(q,{onAnyChange(v){b(),K()}}),Qe(h,{onAnyChange(v){K()}}),Qe(l,{onTablesChange(v){b(),K()},onInvalidated(v){b(),K()}});const V=o.useMemo(()=>fe.CommonUtils.debounce(fe.CommonUtils.throttle(K,300),300),[]);o.useEffect(()=>{V()},[n]),o.useEffect(()=>{let v=null;if(f)for(let S=0;S<f.length&&!v;S++){const T=f[S],W=T.getRange().getCoords();d.CoordUtils.isCellWithinRange(s,W)&&(v=T)}p(v)},[s,f]);const M=r.useCallbackRef(v=>{let S=null;if(f)for(let T=0;T<f.length;T++){const W=f[T],D=W.getRange().getCoords();let O=n.getRangeCoordsBounds(D);const G=n.getRelativePointFromClient(v.clientX,v.clientY),le=G.x,U=G.y;if(le>=O.x&&le<=O.x+O.width&&U>=O.y&&U<=O.y+O.height){const E=n.getViewportSize();le<=0||U<=0||le>=E.width||U>=E.height||(S=W)}}k(S)},[n,f]);if(o.useEffect(()=>{const v=n?.getStage();if(v&&f)return v.addEventListener("mousemove",M),v.addEventListener("mouseleave",M),()=>{v.removeEventListener("mousemove",M),v.removeEventListener("mouseleave",M)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const P=[];for(let v=0;v<f.length;v++){const S=f[v];if(S.isClosed())continue;const T=S===h,W=S===q,D=S.getRange().getCoords(),O=n.getRangeCoordsBounds(D);let G;if(T||W){const le=S.getStyle().getProperties(),U=le.headerRow?.fill?.background??le.wholeTable?.border?.top?.color?.toString();if(U&&l){const E=l.getStyles().parseColor(U);E&&(G=E.toCSS())}G||(G="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}P.push(c.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:O.height,pointerEvents:"all",cursor:di},onMouseDown:A},`table-select-row-${S.getName()}`)),P.push(c.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:Math.min(16,O.height),pointerEvents:"all",cursor:ui},onMouseDown:I},`table-select-${S.getName()}`)),P.push(c.jsx(ct.Selection,{x:O.x,y:O.y,width:O.width,height:O.height,range:D,strokeWidth:W?.5:0,stroke:G??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:T?`${G} 0px 0px 1px 1px`:void 0}},`table-outline-${S.getName()}`))}return P})),hi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:l,animationTime:a=60}=e,[i,f]=o.useState(null),[u,s]=o.useState(null),m=o.useRef(null),q=r.useCallbackRef(()=>{const A=l.getSelectedCell(),K=A.getSpill()?.getCoords()??null;fe.CoordUtils.isEqualRanges(K,i)||(s(K?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(K),coords:K}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),f(K))},[l,n,i]);o.useEffect(()=>(m.current&&(clearTimeout(m.current),m.current=null),u&&(m.current=setTimeout(()=>{s(null),m.current=null},a)),()=>{m.current&&(clearTimeout(m.current),m.current=null)}),[u,a]);const p=o.useMemo(()=>fe.CommonUtils.debounce(fe.CommonUtils.throttle(q,80),80),[]);if(Qe(l?.getSelection(),{onChange(A){p()}}),Qe(l,{onSpillsChange(A){q()},onInvalidated(A){q()}}),!n||!i&&!u)return null;const h=l.getRange(i).getValue()instanceof d.FormulaError.Spill,k=[];let b=u?.bounds??n.getRangeCoordsBounds(i);if(u&&!fe.CommonUtils.isEqualBounds(u.bounds,n.getRangeCoordsBounds(u.coords))&&s(null),b=n.toClipBounds(b,-10),!b)return;const I="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return k.push(c.jsx(ct.Selection,{x:b.x,y:b.y,width:b.width,height:b.height,range:i,strokeWidth:1,stroke:I,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:u?.transition==="out"?0:1,transition:u?.transition?u.transition==="in"||u.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:`${I} 0px 0px 4px 0px`}},"spill-outline}")),k})),mi={position:"absolute",top:0,left:0,bottom:0,right:0},er=(e,t)=>{const n={...e},l=t?.getNormal().getFont(),a=l?.toCSS(),i={text:{fontFamily:a?.fontFamily,fontSize:l?.getSize()}},f=n.body=fe.CommonUtils.mergeContentful(e.body,i);return n.body=fe.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=fe.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=fe.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=fe.CommonUtils.mergeContentful(n.header,i),n.headerSelect=fe.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=fe.CommonUtils.mergeContentful(n.headerSelect,i),n.headerSelectAll=fe.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=fe.CommonUtils.mergeContentful(n.headerSelectAll,i),n},fi={fireOnModelChange:!1},tr={},Or=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:l=tr,headersStyle:a=tr,onSheetContextMenu:i,showColumnHeaders:f,columnHeaderProps:u,showRowHeaders:s,rowHeaderProps:m,showScrollbars:q=!0,scrollPaneProps:p,onViewportChange:h,commands:k,onRepeatCommandChange:b,onMoveCell:I,overlays:A,renderMovable:K,viewportComponent:V,onElementLoad:M,getCellEditor:P,onFocus:v,onBlur:S,style:T=r.ReactUtils.EmptyCssProperties,onShowTooltip:W,onShowColumnTooltip:D,onShowRowTooltip:O,onCloseTooltip:G,gridProps:le,cellRenderProps:U,...E}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[B,$]=o.useReducer(oe=>oe+1,0),[R,{width:L,height:ee}]=Pt(),ie=r.useCallbackRef(W,[W]),Ce=r.useCallbackRef(D,[D]),Se=r.useCallbackRef(O,[O]),he=r.useCallbackRef(G,[G]),Te=o.useRef(!1);o.useLayoutEffect(()=>{Te.current=!0},[n]);const Ke=n?.getStyles(),Ee=o.useMemo(()=>er(l,Ke),[l,Ke]),He=o.useMemo(()=>er(a,Ke),[a,Ke]),{body:J={},buttonSurface:ne={}}=Ee,{header:pe={},headerSelect:De={},headerSelectAll:Y={}}=He,_=o.useRef(null),[ae,ve]=o.useState(()=>n?.getView()),ue=(ae?.getZoomScale()??100)/100,ke=o.useMemo(()=>({vertical:ae.isShowColumnGridlines()&&ue>=.4,horizontal:ae.isShowRowGridlines()&&ue>=.4}),[ae?.isShowColumnGridlines(),ae?.isShowRowGridlines(),ue]),se=o.useMemo(()=>{if(ae?.getGridLineColor())return{strokeDasharray:"1,1"}},[ae?.getGridLineColor(),Ee]),ye=f??ae?.isShowColumnHeaders(),qe=s??ae?.isShowRowHeaders(),[Me,y]=o.useState({width:0,height:0}),Ae=o.useMemo(()=>{let oe=40,Re=20;const Ue=n?.getStyles().getNormal().getFont();if(Me.width>0&&Me.height>0){const Ve=Ue?.toCSS()?.fontFamily??Ee.header.text.fontFamily,Xe=Ue?.getSize()??Ee.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+Me.height,Math.ceil(Xe*d.IFont.getDeviceScale()),Ve);oe=We.width,Re=We.lineHeight}return{width:Math.round(oe+5),height:Math.round(Re+3)}},[Me,Ee?.header.text,n]),Ze=qe?ue*Ae.width:pe.edgeStrokeWidth,Le=ye?ue*Ae.height:pe.edgeStrokeWidth,et=Math.max(L,(n?.getColumnHeaders().getDefaultSize()??Ae.width)+Ze+1),re=Math.max(ee,(n?.getRowHeaders().getDefaultSize()??Ae.height)+Le+1),Ie=o.useRef(new Map),ze=o.useRef(null),xe=()=>({getColOffset:oe=>n.getColumnHeaders().findOffset(oe),getColIndex:oe=>n.getColumnHeaders().findIndex(oe),getRowOffset:oe=>n.getRowHeaders().findOffset(oe),getRowIndex:oe=>n.getRowHeaders().findIndex(oe)}),[Ne,z]=o.useState(()=>xe()),[te,j]=o.useState(!1),[Z,g]=o.useState(null),x=!0,F=Ee.selection?.strokeFill,C=o.useCallback(()=>Mt.current,[]),[N,w]=o.useState(),H=r.useCallbackRef(oe=>{w(oe),n&&n.getView()&&n.getView().setTopLeft(oe?{left:oe.left,top:oe.top}:null),h?.(oe)},[n,h]),X=o.useRef(null);o.useEffect(()=>{if(!N||!n)return;const oe=n.getRangeAtBounds({x:N.left,y:N.top,width:N.width,height:N.height});X.current?.(),X.current=oe.addListener(()=>{const Re=oe.getCoords();_?.current?.invalidate(Re)})},[N,n]);const[Q,ce]=o.useState(()=>n?.getView().getTopLeft()),de=r.useCallbackRef(oe=>{const Re=fe.CoordUtils.cellToRange(oe);if(n.isClosed())return Re;const Ue=n.getRange(Re,{ignoreHidden:!0}).getMerges();return Ue.length===0?Re:Ue[0]},[n]),ge=oe=>{if(!oe||oe.coords.colIndex===0&&oe.coords.rowIndex===0)return null;const Re={};return oe.coords.colIndex>0&&(Re[fe.AnchorLocation.Left]={index:oe.coords.colIndex,scrollOffset:oe.topLeft.left}),oe.coords.rowIndex>0&&(Re[fe.AnchorLocation.Top]={index:oe.coords.rowIndex,scrollOffset:oe.topLeft.top}),Re},[we,be]=o.useState(()=>ge(n.getView().getFreezePanes())),me=r.useEditMode(),Fe=o.useCallback(()=>_.current,[]),Oe=r.useCallbackRef(oe=>{me.setMode(Re=>Re?.key==="edit"?{...Re,args:{...Re.args}}:{key:"edit",args:{stateAndCoords:null,start:oe}})},[]),Pe=r.useCallbackRef(()=>N,[N]),Be=Dr({sheet:n,commands:k,target:Fe,onRepeatCommandChange:b,bodyStyle:J,onStartEdit:Oe,getViewport:Pe}),[$e,Ge]=o.useState(n.getSelection().isEntire()),[je,Ye]=o.useState(ae?.getMovableSelection().length>0),at=Z!==null||je,mt=null,[qt,_e]=o.useState(!1);o.useEffect(()=>{_e(!1)},[n.getProtection()]);const ot=r.useNotifier(),vt=r.useCallbackRef(()=>{qt||(_e(!0),ot.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[ot,qt]),bt=o.useMemo(()=>{const oe=me.getMode();return oe?.cursor?oe.cursor:null},[mt,me]),[Ct,ht]=o.useState(null),it=o.useRef(!1),[Et,Ot]=o.useState([]),en=o.useRef(null),[Dt,tn]=o.useState(fe.TypesUtils.EmptyTopLeft),[It,qn]=o.useState(fe.TypesUtils.EmptyTopLeft);o.useEffect(()=>{tn({left:Q?.left,top:0})},[Q?.left]),o.useEffect(()=>{qn({left:0,top:Q?.top})},[Q?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{be(ge(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ce(n.getView().getTopLeft())},onMovableSelectionChange:()=>{Ye(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{Ge(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){ve(n.getView()),z(xe())},onLayoutChange:()=>{const oe=n.getEntireRange();y({height:oe.getRowCount(),width:oe.getColumnCount()}),z(xe())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),Qe(n,{onRequestScrollIntoView:async(oe,Re)=>{if(!Re)return;const Ue={colIndex:Re?.coords.colStart,rowIndex:Re?.coords.rowStart};return await _.current?.scrollCellCoordsIntoView(Ue,Re?.scroll),!0},onRequestFocus:()=>fe.CommonUtils.whenFocus(Mt.current)},fi);const yt=o.useRef(!1),Bt=o.useMemo(()=>{const oe=fe.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{it.current&&Ce?.(Ve)})},32),Re=(Ve,Xe)=>{it.current=!0,ht([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:Me.height,colStart:Ve,colEnd:Ve})))return;const lt=We.getLayout(),rt=Math.max(0,lt.getColOffset(Ve)),nt=We.getBounds(),wt=Math.min(nt.x+nt.width,lt.getColOffset(Ve+1)),Tt=We.getAnchor();if(Xe!==null&&(Tt===fe.AnchorLocation.Left||Tt===fe.AnchorLocation.Center||Tt===fe.AnchorLocation.Right)){const ro=fe.CommonUtils.roundAccurately(Xe*fe.CommonUtils.getDPI(),0),Mn=fe.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Xe/ue),2).toFixed(2),lo="Width: "+(Xe?Mn+" ("+ro+" pixels)":"Hidden"),an=Kt.current.getGridElement().getRelativePointFromClient(0,0),$t=0-an.y,Tn=0-an.y+Le,io=an.x-nt.x;oe({anchor:{x:rt-io,y:$t,width:wt-rt,height:Tn-$t},display:lo})}const Nt=[0,0,0,nt.height],eo={style:{boxShadow:`0.5px 0px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:F}},to={x:rt-1,y:0,width:1,height:nt.height},no={style:{boxShadow:`-0.5px 0px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:F}},oo={x:wt-1,y:0,width:1,height:nt.height};return c.jsxs(o.Fragment,{children:[c.jsx(ct.SVGLine,{linePoints:Nt,bounds:to,...eo}),c.jsx(ct.SVGLine,{linePoints:Nt,bounds:oo,...no})]},"resize-dividers")}])};let Ue=null;return{onResizeHeadersStart:(Ve,Xe,We)=>{Ue=n.beginCommit(We),yt.current=!1,Re(Ve,Xe)},onResizeHeaders:(Ve,Xe,We)=>{yt.current=!1,Re(Ve,Xe)},onResizeHeadersDown:(Ve,Xe)=>{yt.current=!0,setTimeout(()=>{yt.current&&Re(Ve,Xe)},360)},onResizeHeadersEnd:(Ve,Xe,We)=>{Ue?.commit({description:We}),Ue=null,yt.current=!1,requestAnimationFrame(()=>he?.()),it.current=!1,ht(null)},onResizeHeadersUp:Ve=>{yt.current=!1,requestAnimationFrame(()=>he?.()),it.current=!1,ht(null)},...u}},[n,u,Le,Ct]),nn=o.useMemo(()=>{const oe=fe.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{it.current&&Se?.(Ve)})},32),Re=(Ve,Xe)=>{it.current=!0,ht([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:Me.width})))return;const lt=We.getLayout(),rt=Math.max(0,lt.getRowOffset(Ve)),nt=We.getBounds(),wt=Math.min(nt.y+nt.height,lt.getRowOffset(Ve+1)),Tt=We.getAnchor();if(Xe!==null&&(Tt===fe.AnchorLocation.Top||Tt===fe.AnchorLocation.Center||Tt===fe.AnchorLocation.Bottom)){const ro=Math.floor(10*fe.CommonUtils.getDPI())/10,Mn=fe.CommonUtils.roundAccurately(Xe*ro,0),lo=fe.CommonUtils.roundAccurately(Mn/ue/(n?.getRowHeaders().getScaleFactor()*fe.CommonUtils.getDPI()),2).toFixed(2),an="Height: "+(Xe?lo+" ("+Mn+" pixels)":"Hidden"),$t=Ut.current.getGridElement().getRelativePointFromClient(0,0),Tn=0-$t.x,io=0-$t.x+Ze,Rl=$t.y-nt.y;oe({anchor:{x:Tn,y:rt-Rl,width:io-Tn,height:wt-rt},display:an})}const Nt=[0,0,nt.width,0],eo={style:{boxShadow:`0px 0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:F}},to={x:0,y:rt-1,width:nt.width,height:1},no={style:{boxShadow:`0px -0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:F}},oo={x:0,y:wt-1,width:nt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(ct.SVGLine,{linePoints:Nt,bounds:to,...eo}),c.jsx(ct.SVGLine,{linePoints:Nt,bounds:oo,...no})]},"resize-dividers")}])};let Ue=null;return{onResizeHeadersStart:(Ve,Xe,We)=>{Ue=n.beginCommit(We),yt.current=!1,Re(Ve,Xe)},onResizeHeaders:(Ve,Xe,We)=>{yt.current=!1,Re(Ve,Xe)},onResizeHeadersDown:(Ve,Xe)=>{yt.current=!0,setTimeout(()=>{yt.current&&Re(Ve,Xe)},360)},onResizeHeadersEnd:(Ve,Xe,We)=>{Ue?.commit({description:We}),Ue=null,yt.current=!1,requestAnimationFrame(()=>he?.()),it.current=!1,ht(null)},onResizeHeadersUp:Ve=>{yt.current=!1,requestAnimationFrame(()=>he?.()),it.current=!1,ht(null)},...m}},[n,m,Ze]),Mt=r.useImperativeElement(t,()=>{const oe=Ue=>{n?.getView()&&n.getView().selectMovables([]),ze.current=null,_?.current?.focus(Ue)},Re=async(Ue=null)=>{if(Ue||(Ue=n?.getView().getMovableSelection()[0]),!Ue)return!1;const Ve=Ue.getAnchorCoords();if(!Ve)return!1;const Xe=_.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Xe)return!1;const We=Xe.getAnchor();n?.getView().getMovableSelection().indexOf(Ue)===-1&&n?.getView().selectMovables([Ue]);let lt=Ie.current?.get(We);return lt?.current?(await lt.current.focusMovable(Ue),!0):(ze.current={movable:Ue,anchor:We},!0)};return{getGridElement:()=>_.current,getRowHeaderElement:()=>Ut.current,getColumnHeaderElement:()=>Kt.current,rowHeaderHeight:()=>Le,colHeaderWidth:()=>Ze,startEdit:Oe,submitEdit:()=>{me.setMode(Ue=>Ue?.key!=="edit"?Ue:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{me.setMode(Ue=>Ue?.key!=="edit"?Ue:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:Z!==null,focus:Ue=>{n?.getView().getMovableSelection().length>0&&Re()||oe(Ue)},focusSheet:oe,focusMovable:Re,contains:Ue=>_?.current?.contains?.(Ue),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(oe=>{Te.current||(_?.current?.invalidate(oe),$?.())},[]);o.useEffect(()=>{zt()},[Ee]);const Sn=$e?Y.edgeStrokeFill:pe.fill,tt=$e?De.fill:typeof Ee.headerHover=="function"?Ee.headerHover(pe)?.fill:pe.fill,Rn=o.useMemo(()=>V?c.jsx("div",{className:ut("sheetxl-viewport-overlay",Ol),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:V}):c.jsx(c.Fragment,{}),[V]);let Vt=null;ye&&qe&&(Vt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Le}px`,width:`${Ze}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:oe=>{let Re=!oe.ctrlKey;Be?.getCommand("selectAll")?.execute(!Re||oe.button!==0),oe.nativeEvent.which===r.MouseButtonCodes.Right?i?.({originalEvent:oe,clientX:oe.clientX,clientY:oe.clientY,rowIndex:-1,colIndex:-1}):_.current?.focus()},children:[c.jsx("div",{style:{height:Le-5+"px",width:Le-5+"px",clipPath:`path('M${Le-5} 0 L0 ${Le-5} L${Le-5} ${Le-5} L${Le-5} 0 Z')`,borderRight:`2px solid ${Sn}`,borderBottom:`2px solid ${Sn}`,background:`${tt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${Le}px`,width:`${Ze}px`,boxSizing:"border-box",borderRight:`solid 1px ${pe.strokeFill}`,borderBottom:`solid 1px ${pe.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const on=r.useCallbackRef(({_left:oe,_top:Re})=>{},[]),st=r.useCallbackRef(oe=>{if(!i)return;const Re=_.current.getViewFromClient(oe.clientX,oe.clientY)?.getCellCoordsFromClient(oe.clientX,oe.clientY);Re&&(i({originalEvent:oe,clientX:oe.clientX,clientY:oe.clientY,rowIndex:Re.rowIndex,colIndex:Re.colIndex}),oe.stopPropagation(),oe.preventDefault())},[i]),ft=r.useCallbackRef(oe=>{if(!(!oe.shiftKey&&(oe.ctrlKey||oe.metaKey)))return;const{deltaY:Re}=oe;return Re>0?Be.getCommand("sheetZoomOut")?.execute():Re<0&&Be.getCommand("sheetZoomIn")?.execute(),Re===0},[Be]);o.useEffect(()=>{Ot(null),en.current=null,it.current=!1,ht(null);const oe=n?.getView().getTopLeft();on(oe),_.current?.scrollTo(oe),ce(oe),ve(n.getView()),be(ge(n.getView().getFreezePanes())),z(xe()),$()},[n?.getView()]);const rn=r.useCallbackRef(oe=>{const Re=oe.getVisibleRangeCoords();if(!Re)return null;const Ue=[];return n.getRange(Re).forEach((Ve,Xe)=>{const We=Xe.getCoords(),lt=Xe.getCell();(rt=>{if(rt.isEmpty())return!1;const nt=rt.getSpans();if(nt.width>1||nt.height>1||rt.getStyle().hasVisibleStyling()||ae.isShowFormulas()&&rt.getFormula()!==null)return!0;const wt=rt.getValue();return wt!==null&&!(!ae.isShowZeros()&&wt===0&&rt.getType()===d.ScalarType.Number)})(lt)&&Ue.push({coords:We,value:lt,range:ae.isShowFormulas()?null:lt.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ue},[n,ae.isShowZeros(),ae.isShowFormulas(),Z]);o.useEffect(()=>{const oe=[];A&&oe.push(...A),Ct&&oe.push(...Ct),fe.CommonUtils.isEqualArrays(oe,en.current)||(en.current=oe,Ot(oe))},[A,Ct,Ee]);const ln=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${l?.body?.fill}`},pathProps:{stroke:l?.body?.text?.fill??"black"}}),[Ee?.header?.edgeStrokeFill]),Ht=r.useCallbackRef(oe=>{oe.isDefaultPrevented()||oe.isPropagationStopped()||(ze.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Zn=o.useMemo(()=>{const oe=me.getMode();return oe?.key==="cut"||oe?.key==="copy"},[me]),Xn=r.useCallbackRef(async oe=>{const Re=me.getMode();return oe.keyCode===r.KeyCodes.Escape&&Re?(oe.preventDefault(),void me.setMode(null)):oe.keyCode===r.KeyCodes.Enter&&Zn?(oe.preventDefault(),await Be?.getCommand("paste")?.execute(),void me.setMode(null)):void Be?.dispatchToFocusedCommand(oe)},[Be,me]),Ut=o.useRef(null),kn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Le+1}px`,width:`${Ze+pe.edgeStrokeWidth}px`,minWidth:`${Ze+pe.edgeStrokeWidth}px`,borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,height:`calc(100% - ${Le}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Yo,{ref:Ut,sheetElement:Mt.current,gridRef:_,freezeStart:we?.[fe.AnchorLocation.Top],oppositeSize:Ze,containerWidth:Ze,containerHeight:re,sheetHeader:n.getRowHeaders(),gridStyle:He,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:It,onSheetContextMenu:i,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Le+1}px`,width:`${Ze+pe.edgeStrokeWidth}px`,minWidth:`${Ze+pe.edgeStrokeWidth}px`,borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,height:`calc(100% - ${Le}px)`,boxSizing:"border-box",zIndex:"2",...nn?.style},...nn})}),[Ze,Le,re,n,It,we?.[fe.AnchorLocation.Top],Ee,x,i,pe.fill,m]),Kt=o.useRef(null),Cl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Le+pe.edgeStrokeWidth}px`,minHeight:`${Le+pe.edgeStrokeWidth}px`,borderBottom:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Yo,{ref:Kt,sheetElement:Mt.current,gridRef:_,freezeStart:we?.[fe.AnchorLocation.Left],oppositeSize:Le,containerWidth:et,containerHeight:Le,sheetHeader:n.getColumnHeaders(),gridStyle:He,scrollPoint:Dt,onSheetContextMenu:i,...Bt,style:{...Bt?.style,position:"relative",left:"0px",width:"100%",height:`${Le+pe.edgeStrokeWidth}px`,minHeight:`${Le+pe.edgeStrokeWidth}px`,borderBottom:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Le,et,n,Dt,we?.[fe.AnchorLocation.Left],Ee,pe.fill,x,i,u]),yl=r.useCallbackRef(oe=>{const{value:Re,key:Ue,...Ve}=oe;let Xe=Re,We=Z;if(!We||We.colIndex===oe.coords.colIndex&&We.rowIndex===oe.coords.rowIndex||(We=null),!Xe){const nt=oe.range;if(Xe=n.getRange({rowIndex:nt.rowStart,colIndex:nt.colStart}).getCell(),Xe.isEmpty())return null}let lt=null;Xe.getHyperlink()&&(lt=async nt=>{if(U?.onLinkMouseDown?.(nt),nt.button===0&&!nt.isDefaultPrevented()){nt.stopPropagation(),nt.preventDefault();try{await Xe.getHyperlink()?.open()}catch(wt){ot.showError?.(wt)}}}),We&&We.colIndex===oe.range.colStart&&We.rowIndex===oe.range.rowStart&&(Xe=Xe.createTemporaryCell({value:null}));const rt=n.getStyles();return o.createElement(kr,{...Ve,key:Ue,bodyStyle:J,docTheme:rt.getTheme(),normalStyle:rt.getNormal(),showFormulas:ae.isShowFormulas(),showZeros:ae.isShowZeros(),onLinkMouseDown:lt,...U,value:Xe})},[n,Ne,J,Z,ae?.isShowFormulas(),ae.isShowZeros()]),wl=o.useCallback((oe,Re)=>{const{key:Ue,...Ve}=oe;return[c.jsx(Hl,{ref:Re,getVisibleCells:rn,sheet:n,gridStyle:Ee,...Ve},`border-${Ue}`),c.jsx(gi,{ref:Re,sheet:n,commands:Be,...Ve},`table-${Ue}`),c.jsx(hi,{ref:Re,sheet:n,...Ve},`spill-${Ue}`),c.jsx(oi,{ref:Re,sheet:n,commands:Be,onShowTooltip:ie,onCloseTooltip:he,gridStyle:Ee,gridRef:_,editingCoords:Z,isActive:x,...Ve},`selection-${Ue}`),c.jsx(Xl,{ref:Re,sheet:n,commands:Be,gridStyle:Ee,element:C,...Ve},`copy-paste-${Ue}`),c.jsx(si,{ref:Re,sheet:n,commands:Be,target:Fe,renderMovable:K,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...Ve},`movable-${Ue}`),c.jsx(ci,{ref:Re,sheet:n,commands:Be,gridStyle:Ee,getCellEditor:P,showProtectedError:vt,setEditingCoords:g,...Ve},`editor-${Ue}`)]},[n,_.current,Ee,P,Be,ot]),[No,bl]=o.useState(!1),xl=o.useMemo(()=>{if(et===0||re===0)return null;const oe=n.getStyles().getNormal(),Re=oe.getFont(),Ue=oe.getFill(),Ve=oe.getBorder(),Xe=oe.getFill().getType()===d.IFill.Type.None;let We=se,lt=se;const rt=(wt,Tt,Nt)=>Nt?{stroke:Ve.getBottom().isNone()?"none":wt.getColor().toRGBA(J.darkMode).toString(),...Tt}:Tt;lt=rt(Ve.getBottom(),lt,!Ve.getBottom().isNone()),lt=rt(Ve.getTop(),lt,!Ve.getTop().isNone()),We=rt(Ve.getRight(),We,!Ve.getRight().isNone()),We=rt(Ve.getLeft(),We,!Ve.getLeft().isNone());let nt=ae?.getGridLineColor()?.toRGBA(J.darkMode).toString()??J.strokeFill;return Xe||(lt=rt(Ve.getBottom(),lt,!0),lt=rt(Ve.getTop(),lt,!0),We=rt(Ve.getRight(),We,!0),We=rt(Ve.getLeft(),We,!0)),c.jsx(ct.Grid,{className:"sheetxl-sheet-primary",style:{...mi,...Ue.toCSS(J.darkMode),...Re.toCSS(J.darkMode,ue),"--sxl-app-color-background":J.fill,"--sxl-app-color-shadow":Ee.colorShadow,"--sxl-app-color-grey":Ee.colorGrey,"--sxl-app-color-button-fill":ne.fill,"--sxl-app-color-button-text":ne.text?.fill,"--sxl-app-color-button-border":ne.edgeStrokeFill,"--sxl-app-color-primary-dark":Ee.selection.strokeFill},ref:_,zoom:ue,...le,onFirstRender:wt=>{bl(!0),le?.onFirstRender?.(wt),Be?.activate()},showGridLines:ke,gridLineColor:nt,gridLineColumnsProps:We,gridLineRowsProps:lt,freezeLeft:we?.[fe.AnchorLocation.Left],freezeLeftProps:ln,freezeTop:we?.[fe.AnchorLocation.Top],freezeTopProps:ln,width:et,height:re,columnCount:Me.width,rowCount:Me.height,cursor:bt??mt??"cell",clipCells:!0,layout:Ne,cellRenderer:yl,overlayRenderer:wl,getCellCoordsAsRangeCoords:de,getVisibleCells:rn,onWheelScroll:ft,onPointerDown:Ht,onKeyDown:Xn,onViewportChange:H,onImmediateScroll:on,scrollPoint:Q,stageProps:{onFocus:()=>{Be?.activate()}},overlays:Et})},[B]);o.useEffect(()=>{Te.current||$()},[Ne,we,ue,Be,Q?.left,Q?.top,J,le,et,re,bt,Et,x,mt]);let Yn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};q||(Yn={...Yn,...T});const ql=o.useMemo(()=>{const oe=n.getStyles().getTheme(),Re=oe.getColorScheme(),Ue=oe.getFontScheme();return{"--sxl-doc-color-dk1":Re.getDk1().toCSS(J.darkMode),"--sxl-doc-color-dk2":Re.getDk2().toCSS(J.darkMode),"--sxl-doc-color-lt1":Re.getLt1().toCSS(J.darkMode),"--sxl-doc-color-lt2":Re.getLt2().toCSS(J.darkMode),"--sxl-doc-color-accent1":Re.getAccent1().toCSS(J.darkMode),"--sxl-doc-color-accent2":Re.getAccent2().toCSS(J.darkMode),"--sxl-doc-color-accent3":Re.getAccent3().toCSS(J.darkMode),"--sxl-doc-color-accent4":Re.getAccent4().toCSS(J.darkMode),"--sxl-doc-color-accent5":Re.getAccent5().toCSS(J.darkMode),"--sxl-doc-color-accent6":Re.getAccent6().toCSS(J.darkMode),"--sxl-doc-color-hlink":Re.getHlink().toCSS(J.darkMode),"--sxl-doc-color-fol-hlink":Re.getFolHlink().toCSS(J.darkMode),"--sxl-doc-font-major":Ue.getMajorFont(),"--sxl-doc-font-minor":Ue.getMinorFont()}},[n.getStyles().getTheme()]);let Jn=c.jsx("div",{style:Yn,onTouchStart:()=>{Lo()},onFocus:oe=>{j(!0),v?.(oe)},onBlur:oe=>{j(!1),S?.(oe)},ref:Mt,...E,children:c.jsx("div",{className:ut("sheetxl-sheet",jl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...ql},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Vt,kn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[Cl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${pe.edgeStrokeWidth}px ${pe.edgeStrokeFill}`,backgroundColor:J.fill},ref:R,onContextMenu:st,children:[xl,Rn,c.jsx(Bl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Ee?.selection?.strokeFill,colorCredits:Ee?.body?.text?.fill})]})]})]})})});if(q){const oe=Re=>c.jsx(So,{...Re,sheet:n});Jn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${pe.fill}`,minHeight:2*Ae.height,minWidth:2*Ae.width,...T},viewport:N,touchElement:_.current?.stage,disableTouch:at,onScrollViewport:Re=>{_.current?.scrollTo(Re)},createHorizontalScrollbar:oe,createVerticalScrollbar:oe,...p,children:Jn})}o.useEffect(()=>{Te.current=!1,$?.(),te&&Mt.current?.focus()},[n]);const[Qn,Sl]=o.useState(!1),Lo=r.useCallbackRef(()=>{Qn||Sl(!0)},[Qn]);return o.useEffect(()=>{if(No)return typeof M=="function"&&M(),r.ReactUtils.detectIt().primaryInput==="touch"&&Lo(),()=>{}},[M,No,Qn]),Jn}));Or.displayName="SheetElement";const pi=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),nr="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Br=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,style:a,picture:i,description:f,isDragging:u,view:s,onHide:m,onShow:q,onKeyDownCapture:p,onFocus:h,onBlur:k,loadingPanel:b,...I}=e,[A,K]=o.useState(!1),[V,M]=o.useState(null),[P,v]=o.useState(null),[S,T]=o.useState(null);o.useEffect(()=>{v(null),i.getDetails().then(O=>{K(!1),v(O.asUrl()),O.asSVGText?.()&&T(O.asSVGText())}).catch(O=>{console.warn(O),K(!0),v(nr),T(null)})},[i]);const W=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),D=o.useMemo(()=>{if(P||S)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:A?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:A?"var(--sxl-app-color-background, white)":void 0,boxShadow:A?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:A?"contain":void 0,opacity:V?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:P,onLoad:()=>{M(!0)},onError:({currentTarget:O})=>{console.log("error"),O.onerror=null,v(nr),K(!0)},alt:f??`${i.getType()}`})},[V,i,P,S,u]);if(!i.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:u?"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,...I,onKeyDownCapture:O=>{p?.(O)},ref:W,children:[V||A?void 0:b,D]})}));Br.displayName="PictureEditor";const vi=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:l,chart:a,view:i,isDragging:f,onHide:u,onShow:s,...m}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[p,{height:h,width:k}]=Pt();if(!a.isClosed())return c.jsx("div",{...m,ref:Yt([q,p]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:l?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),Ci="_editable-input_1bqx6_6",yi=e=>c.jsx("input",{...e}),Vr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:l,value:a="",onSubmit:i,onChange:f,onCancel:u,createInput:s=yi,styleHover:m={},dragging:q,maxLength:p,disabled:h=!1,readOnly:k=!1,...b}=e,[I,A]=o.useState(!1),[K,V]=o.useState(!1),[M,P]=o.useState(a);o.useEffect(()=>{P(a)},[a]);const v=o.useRef(null),[S,T]=o.useState(null),W=r.useNotifier(),D=o.useCallback(function($){const R=$.message;S!==R&&(W?.showMessage?.(R,{type:r.NotifierType.Error}),T(R))},[W,S]),O=o.useCallback($=>{let R=!1;try{R=i?.($)??!0}catch(L){D(L)}return R?(v.current=null,V(!1),P($),R):(setTimeout(()=>{v.current?.focus()},0),R)},[i]),G=r.useCallbackRef(()=>{P(a),v.current=null,V(!1),u?.()},[u,a]),le=o.useMemo(()=>{if(!K)return null;const $={className:ut(Ci),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:p,type:"text",value:M,onFocus:R=>{v.current||(v.current=R.target,setTimeout(()=>{R.target?.select()},0))},onBlur:R=>{v.current&&O(M)},onChange:R=>{K&&P(R.target.value)},onMouseDown:R=>R.stopPropagation(),onKeyDown:R=>R.code==="Escape"?(R.preventDefault(),void G()):R.code==="Enter"?(R.preventDefault(),void O(R.target.value)):void(R.code!=="Tab"?R.stopPropagation():O(R.target.value))};return c.jsx(c.Fragment,{children:s($)})},[K,M,O,G,s,h]),[U,E]=o.useState();o.useLayoutEffect(()=>{let $=Object.assign({},n);(q||I)&&($=Object.assign($,m)),E($)},[q,I,m,n]),o.useEffect(()=>{le&&f?.(M)},[le,f,M]);const B=r.useImperativeElement(t,()=>({startEdit(){h||k||V(!0)},cancel(){G()}}),[]);return c.jsxs("div",{...b,ref:B,style:{flexDirection:"column",display:"flex",...U},className:ut(l),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{h||k||V(!0)},onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:M}),le]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...m},children:M})]})})),Kn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Jt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ro(e){return"nodeType"in e}function pt(e){var t,n;return e?Jt(e)?e:Ro(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ko(e){const{Document:t}=pt(e);return e instanceof t}function wn(e){return!Jt(e)&&e instanceof pt(e).HTMLElement}function Hr(e){return e instanceof pt(e).SVGElement}function Zt(e){return e?Jt(e)?e.document:Ro(e)?ko(e)?e:wn(e)||Hr(e)?e.ownerDocument:document:document:document}const Rt=Kn?o.useLayoutEffect:o.useEffect;function $n(e){const t=o.useRef(e);return Rt(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,l=new Array(n),a=0;a<n;a++)l[a]=arguments[a];return t.current==null?void 0:t.current(...l)},[])}function vn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function gn(e,t){const n=o.useRef();return o.useMemo(()=>{const l=e(n.current);return n.current=l,l},[...t])}function Ln(e){const t=$n(e),n=o.useRef(null),l=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,l]}function Pn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let co={};function bn(e,t){return o.useMemo(()=>{if(t)return t;const n=co[e]==null?0:co[e]+1;return co[e]=n,e+"-"+n},[e,t])}function Ur(e){return function(t){for(var n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];return l.reduce((i,f)=>{const u=Object.entries(f);for(const[s,m]of u){const q=i[s];q!=null&&(i[s]=q+e*m)}return i},{...t})}}const Gt=Ur(1),Cn=Ur(-1);function Wn(e){if(!e)return!1;const{KeyboardEvent:t}=pt(e.target);return t&&e instanceof t}function jn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=pt(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 jt=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[jt.Translate.toString(e),jt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:l}=e;return t+" "+n+"ms "+l}}}),or="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wi(e){return e.matches(or)?e:e.querySelector(or)}const bi={display:"none"};function xi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:bi},n)}function qi(e){let{id:t,announcement:n,ariaLiveType:l="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":l,"aria-atomic":!0},n)}const Kr=o.createContext(null),Si={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
- `},bi={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 yi(e){let{announcements:t=bi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=Ci}=e;const{announce:l,announcement:C}=(function(){const[p,h]=o.useState("");return{announce:o.useCallback(E=>{E!=null&&h(E)},[]),announcement:p}})(),g=yn("DndLiveRegion"),[s,f]=o.useState(!1);if(o.useEffect(()=>{f(!0)},[]),(function(p){const h=o.useContext(jr);o.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(p)},[p,h])})(o.useMemo(()=>({onDragStart(p){let{active:h}=p;l(t.onDragStart({active:h}))},onDragMove(p){let{active:h,over:E}=p;t.onDragMove&&l(t.onDragMove({active:h,over:E}))},onDragOver(p){let{active:h,over:E}=p;l(t.onDragOver({active:h,over:E}))},onDragEnd(p){let{active:h,over:E}=p;l(t.onDragEnd({active:h,over:E}))},onDragCancel(p){let{active:h,over:E}=p;l(t.onDragCancel({active:h,over:E}))}}),[l,t])),!s)return null;const S=o.createElement(o.Fragment,null,o.createElement(pi,{id:i,value:a.draggable}),o.createElement(vi,{id:g,announcement:C}));return n?Lt.createPortal(S,n):S}var ct;function On(){}function ao(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ct||(ct={}));const kt=Object.freeze({x:0,y:0});function Br(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function wi(e,t){const n=Ln(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Vr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function xi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Qo(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 Pr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function er(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 qi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=er(t,t.left,t.top),l=[];for(const C of i){const{id:g}=C,s=n.get(g);if(s){const f=Br(er(s),a);l.push({id:g,data:{droppableContainer:C,value:f}})}}return l.sort(Vr)};function Si(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),C=a-i,g=l-n;if(i<a&&n<l){const s=t.width*t.height,f=e.width*e.height,S=C*g;return Number((S/(s+f-S)).toFixed(4))}return 0}const Ri=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:C}=l,g=n.get(C);if(g){const s=Si(g,t);s>0&&a.push({id:C,data:{droppableContainer:l,value:s}})}}return a.sort(xi)};function tr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function ki(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,C)=>({...l,top:l.top+e*C.y,bottom:l.bottom+e*C.y,left:l.left+e*C.x,right:l.right+e*C.x}),{...t})}}const Mi=ki(1);function Hr(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 Ti={ignoreTransform:!1};function Jt(e,t){t===void 0&&(t=Ti);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:S}=ft(e).getComputedStyle(e);f&&(n=(function(p,h,E){const x=Hr(h);if(!x)return p;const{scaleX:A,scaleY:N,x:K,y:P}=x,R=p.left-K-(1-A)*parseFloat(E),O=p.top-P-(1-N)*parseFloat(E.slice(E.indexOf(" ")+1)),m=A?p.width/A:p.width,q=N?p.height/N:p.height;return{width:m,height:q,top:O,right:R+m,bottom:O+q,left:R}})(n,f,S))}const{top:i,left:a,width:l,height:C,bottom:g,right:s}=n;return{top:i,left:a,width:l,height:C,bottom:g,right:s}}function nr(e){return Jt(e,{ignoreTransform:!0})}function Kn(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(!bn(a)||Lr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&(function(C,g){g===void 0&&(g=ft(C).getComputedStyle(C));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(f=>{const S=g[f];return typeof S=="string"&&s.test(S)})})(a,l)&&n.push(a),(function(C,g){return g===void 0&&(g=ft(C).getComputedStyle(C)),g.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Ur(e){const[t]=Kn(e,1);return t??null}function so(e){return Pn&&e?Yt(e)?e:xo(e)?qo(e)||e===Zt(e).scrollingElement?window:bn(e)?e:null:null:null}function Kr(e){return Yt(e)?e.scrollX:e.scrollLeft}function $r(e){return Yt(e)?e.scrollY:e.scrollTop}function mo(e){return{x:Kr(e),y:$r(e)}}var ut;function Wr(e){return!(!Pn||!e)&&e===document.scrollingElement}function Gr(e){const t={x:0,y:0},n=Wr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const Ii={x:.2,y:.2};function Ei(e,t,n,i,a){let{top:l,left:C,right:g,bottom:s}=n;i===void 0&&(i=10),a===void 0&&(a=Ii);const{isTop:f,isBottom:S,isLeft:p,isRight:h}=Gr(e),E={x:0,y:0},x={x:0,y:0},A=t.height*a.y,N=t.width*a.x;return!f&&l<=t.top+A?(E.y=ut.Backward,x.y=i*Math.abs((t.top+A-l)/A)):!S&&s>=t.bottom-A&&(E.y=ut.Forward,x.y=i*Math.abs((t.bottom-A-s)/A)),!h&&g>=t.right-N?(E.x=ut.Forward,x.x=i*Math.abs((t.right-N-g)/N)):!p&&C<=t.left+N&&(E.x=ut.Backward,x.x=i*Math.abs((t.left+N-C)/N)),{direction:E,speed:x}}function Fi(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:C}=window;return{top:0,left:0,right:l,bottom:C,width:l,height:C}}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 _r(e){return e.reduce((t,n)=>_t(t,mo(n)),kt)}function Zr(e,t){if(t===void 0&&(t=Jt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Ur(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ai=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Kr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+$r(n),0)}]];class fo{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=Kn(n),a=_r(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,C,g]of Ai)for(const s of C)Object.defineProperty(this,s,{get:()=>{const f=g(i),S=a[l]-f;return this.rect[s]+S},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gn{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 co(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Je;function or(e){e.preventDefault()}function Di(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xt||(xt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Je||(Je={}));const Xr={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},zi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.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 gn(Zt(n)),this.windowListeners=new gn(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Zr(i),n(kt)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Xr,coordinateGetter:C=zi,scrollBehavior:g="smooth"}=a,{code:s}=t;if(l.end.includes(s))return void this.handleEnd(t);if(l.cancel.includes(s))return void this.handleCancel(t);const{collisionRect:f}=i.current,S=f?{x:f.left,y:f.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=S);const p=C(t,{active:n,context:i.current,currentCoordinates:S});if(p){const h=vn(p,S),E={x:0,y:0},{scrollableAncestors:x}=i.current;for(const A of x){const N=t.code,{isTop:K,isRight:P,isLeft:R,isBottom:O,maxScroll:m,minScroll:q}=Gr(A),T=Fi(A),$={x:Math.min(N===Je.Right?T.right-T.width/2:T.right,Math.max(N===Je.Right?T.left:T.left+T.width/2,p.x)),y:Math.min(N===Je.Down?T.bottom-T.height/2:T.bottom,Math.max(N===Je.Down?T.top:T.top+T.height/2,p.y))},I=N===Je.Right&&!P||N===Je.Left&&!R,k=N===Je.Down&&!O||N===Je.Up&&!K;if(I&&$.x!==p.x){const Z=A.scrollLeft+h.x,X=N===Je.Right&&Z<=m.x||N===Je.Left&&Z>=q.x;if(X&&!h.y)return void A.scrollTo({left:Z,behavior:g});E.x=X?A.scrollLeft-Z:N===Je.Right?A.scrollLeft-m.x:A.scrollLeft-q.x,E.x&&A.scrollBy({left:-E.x,behavior:g});break}if(k&&$.y!==p.y){const Z=A.scrollTop+h.y,X=N===Je.Down&&Z<=m.y||N===Je.Up&&Z>=q.y;if(X&&!h.x)return void A.scrollTo({top:Z,behavior:g});E.y=X?A.scrollTop-Z:N===Je.Down?A.scrollTop-m.y:A.scrollTop-q.y,E.y&&A.scrollBy({top:-E.y,behavior:g});break}}this.handleMove(t,_t(vn(p,this.referenceCoordinates),E))}}}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 rr(e){return!!(e&&"distance"in e)}function lr(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Xr,onActivation:a}=t,{active:l}=n;const{code:C}=e.nativeEvent;if(i.start.includes(C)){const g=l.activatorNode.current;return(!g||e.target===g)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(g){const{EventTarget:s}=ft(g);return g instanceof s?g:Zt(g)})(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:C}=l;this.props=t,this.events=n,this.document=Zt(C),this.documentListeners=new gn(this.document),this.listeners=new gn(i),this.windowListeners=new gn(ft(C)),this.initialCoordinates=(a=Ln(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(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,or),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,or),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(rr(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Di,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:C,options:{activationConstraint:g}}=l;if(!a)return;const s=(n=Ln(t))!=null?n:kt,f=vn(a,s);if(!i&&g){if(rr(g)){if(g.tolerance!=null&&co(f,g.tolerance))return this.handleCancel();if(co(f,g.distance))return this.handleStart()}return lr(g)&&co(f,g.tolerance)?this.handleCancel():void this.handlePending(g,f)}t.cancelable&&t.preventDefault(),C(s)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ni={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yr extends Ro{constructor(t){const{event:n}=t,i=Zt(n.target);super(t,Ni,i)}}Yr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Li={move:{name:"mousemove"},end:{name:"mouseup"}};var po;(function(e){e[e.RightClick=2]="RightClick"})(po||(po={}));class Jr extends Ro{constructor(t){super(t,Li,Zt(t.event.target))}}Jr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==po.RightClick&&(i?.({event:n}),!0)}}];const uo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qr extends Ro{constructor(t){super(t,uo)}static setup(){return window.addEventListener(uo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(uo.move.name,t)};function t(){}}}var hn,jn;function Oi(e){let{acceleration:t,activator:n=hn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:C=5,order:g=jn.TreeOrder,pointerCoordinates:s,scrollableAncestors:f,scrollableAncestorRects:S,delta:p,threshold:h}=e;const E=(function(q){let{delta:T,disabled:$}=q;const I=Nn(T);return un(k=>{if($||!I||!k)return ji;const Z={x:Math.sign(T.x-I.x),y:Math.sign(T.y-I.y)};return{x:{[ut.Backward]:k.x[ut.Backward]||Z.x===-1,[ut.Forward]:k.x[ut.Forward]||Z.x===1},y:{[ut.Backward]:k.y[ut.Backward]||Z.y===-1,[ut.Forward]:k.y[ut.Forward]||Z.y===1}}},[$,T,I])})({delta:p,disabled:!l}),[x,A]=(function(){const q=o.useRef(null);return[o.useCallback((T,$)=>{q.current=setInterval(T,$)},[]),o.useCallback(()=>{q.current!==null&&(clearInterval(q.current),q.current=null)},[])]})(),N=o.useRef({x:0,y:0}),K=o.useRef({x:0,y:0}),P=o.useMemo(()=>{switch(n){case hn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case hn.DraggableRect:return a}},[n,a,s]),R=o.useRef(null),O=o.useCallback(()=>{const q=R.current;if(!q)return;const T=N.current.x*K.current.x,$=N.current.y*K.current.y;q.scrollBy(T,$)},[]),m=o.useMemo(()=>g===jn.TreeOrder?[...f].reverse():f,[g,f]);o.useEffect(()=>{if(l&&f.length&&P){for(const q of m){if(i?.(q)===!1)continue;const T=f.indexOf(q),$=S[T];if(!$)continue;const{direction:I,speed:k}=Ei(q,$,P,t,h);for(const Z of["x","y"])E[Z][I[Z]]||(k[Z]=0,I[Z]=0);if(k.x>0||k.y>0)return A(),R.current=q,x(O,C),N.current=k,void(K.current=I)}N.current={x:0,y:0},K.current={x:0,y:0},A()}else A()},[t,O,i,A,l,C,JSON.stringify(P),JSON.stringify(E),x,f,m,S,JSON.stringify(h)])}Qr.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"})(hn||(hn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jn||(jn={}));const ji={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var Cn,vo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cn||(Cn={})),(function(e){e.Optimized="optimized"})(vo||(vo={}));const ir=new Map;function Co(e,t){return un(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Bn(e){let{callback:t,disabled:n}=e;const i=Hn(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 Bi(e){return new fo(Jt(e),e)}function ar(e,t,n){t===void 0&&(t=Bi);const[i,a]=o.useState(null);function l(){a(s=>{if(!e)return null;var f;if(e.isConnected===!1)return(f=s??n)!=null?f:null;const S=t(e);return JSON.stringify(s)===JSON.stringify(S)?s:S})}const C=(function(s){let{callback:f,disabled:S}=s;const p=Hn(f),h=o.useMemo(()=>{if(S||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:E}=window;return new E(p)},[p,S]);return o.useEffect(()=>()=>h?.disconnect(),[h]),h})({callback(s){if(e)for(const f of s){const{type:S,target:p}=f;if(S==="childList"&&p instanceof HTMLElement&&p.contains(e)){l();break}}}}),g=Bn({callback:l});return Rt(()=>{l(),e?(g?.observe(e),C?.observe(document.body,{childList:!0,subtree:!0})):(g?.disconnect(),C?.disconnect())},[e]),i}const sr=[];function dr(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?vn(e,n.current):kt}function cr(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 ur=[];function el(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bn(t)?t:e}const Vi=[{sensor:Yr,options:{}},{sensor:So,options:{}}],Pi={current:{}},An={draggable:{measure:nr},droppable:{measure:nr,strategy:Cn.WhileDragging,frequency:vo.Optimized},dragOverlay:{measure:Jt}};class mn 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 Hi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:An,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},tl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},wn=o.createContext(tl),nl=o.createContext(Hi);function Ui(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mn}}}function Ki(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new mn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const C=new mn(e.droppable.containers);return C.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:C}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new mn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function $i(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(wn),l=Nn(i),C=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&C!=null){if(!Un(l)||document.activeElement===l.target)return;const g=a.get(C);if(!g)return;const{activatorNode:s,node:f}=g;if(!s.current&&!f.current)return;requestAnimationFrame(()=>{for(const S of[s.current,f.current]){if(!S)continue;const p=mi(S);if(p){p.focus();break}}})}},[i,t,a,C,l]),null}function ol(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const $n=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Wi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:C,autoScroll:g=!0,children:s,sensors:f=Vi,collisionDetection:S=Ri,measuring:p,modifiers:h,...E}=e;const x=o.useReducer(Ki,void 0,Ui),[A,N]=x,[K,P]=(function(){const[y]=o.useState(()=>new Set),V=o.useCallback(_=>(y.add(_),()=>y.delete(_)),[y]);return[o.useCallback(_=>{let{type:Q,event:se}=_;y.forEach(de=>{var ge;return(ge=de[Q])==null?void 0:ge.call(de,se)})},[y]),V]})(),[R,O]=o.useState(At.Uninitialized),m=R===At.Initialized,{draggable:{active:q,nodes:T,translate:$},droppable:{containers:I}}=A,k=q!=null?T.get(q):null,Z=o.useRef({initial:null,translated:null}),X=o.useMemo(()=>{var y;return q!=null?{id:q,data:(y=k?.data)!=null?y:Pi,rect:Z}:null},[q,k]),B=o.useRef(null),[j,H]=o.useState(null),[J,M]=o.useState(null),U=pn(E,Object.values(E)),ue=yn("DndDescribedBy",l),we=o.useMemo(()=>I.getEnabled(),[I]),je=(Te=p,o.useMemo(()=>({draggable:{...An.draggable,...Te?.draggable},droppable:{...An.droppable,...Te?.droppable},dragOverlay:{...An.dragOverlay,...Te?.dragOverlay}}),[Te?.draggable,Te?.droppable,Te?.dragOverlay]));var Te;const{droppableRects:ae,measureDroppableContainers:Me,measuringScheduled:Ke}=(function(y,V){let{dragging:_,dependencies:Q,config:se}=V;const[de,ge]=o.useState(null),{frequency:Ce,measure:be,strategy:he}=se,Ie=o.useRef(y),Be=(function(){switch(he){case Cn.Always:return!1;case Cn.BeforeDragging:return _;default:return!_}})(),Ne=pn(Be),Ve=o.useCallback(function(Oe){Oe===void 0&&(Oe=[]),Ne.current||ge(Ye=>Ye===null?Oe:Ye.concat(Oe.filter(at=>!Ye.includes(at))))},[Ne]),$e=o.useRef(null),_e=un(Oe=>{if(Be&&!_)return ir;if(!Oe||Oe===ir||Ie.current!==y||de!=null){const Ye=new Map;for(let at of y){if(!at)continue;if(de&&de.length>0&&!de.includes(at.id)&&at.rect.current){Ye.set(at.id,at.rect.current);continue}const ht=at.node.current,qt=ht?new fo(be(ht),ht):null;at.rect.current=qt,qt&&Ye.set(at.id,qt)}return Ye}return Oe},[y,de,_,Be,be]);return o.useEffect(()=>{Ie.current=y},[y]),o.useEffect(()=>{Be||Ve()},[_,Be]),o.useEffect(()=>{de&&de.length>0&&ge(null)},[JSON.stringify(de)]),o.useEffect(()=>{Be||typeof Ce!="number"||$e.current!==null||($e.current=setTimeout(()=>{Ve(),$e.current=null},Ce))},[Ce,Be,Ve,...Q]),{droppableRects:_e,measureDroppableContainers:Ve,measuringScheduled:de!=null}})(we,{dragging:m,dependencies:[$.x,$.y],config:je.droppable}),Ee=(function(y,V){const _=V!=null?y.get(V):void 0,Q=_?_.node.current:null;return un(se=>{var de;return V==null?null:(de=Q??se)!=null?de:null},[Q,V])})(T,q),Ue=o.useMemo(()=>J?Ln(J):null,[J]),re=(function(){const y=j?.autoScrollEnabled===!1,V=typeof g=="object"?g.enabled===!1:g===!1,_=m&&!y&&!V;return typeof g=="object"?{...g,enabled:_}:{enabled:_}})(),te=(function(y,V){return Co(y,V)})(Ee,je.draggable.measure);(function(y){let{activeNode:V,measure:_,initialRect:Q,config:se=!0}=y;const de=o.useRef(!1),{x:ge,y:Ce}=typeof se=="boolean"?{x:se,y:se}:se;Rt(()=>{if(!ge&&!Ce||!V)return void(de.current=!1);if(de.current||!Q)return;const be=V?.node.current;if(!be||be.isConnected===!1)return;const he=tr(_(be),Q);if(ge||(he.x=0),Ce||(he.y=0),de.current=!0,Math.abs(he.x)>0||Math.abs(he.y)>0){const Ie=Ur(be);Ie&&Ie.scrollBy({top:he.y,left:he.x})}},[V,ge,Ce,Q,_])})({activeNode:q!=null?T.get(q):null,config:re.layoutShiftCompensation,initialRect:te,measure:je.draggable.measure});const pe=ar(Ee,je.draggable.measure,te),Le=ar(Ee?Ee.parentElement:null),Y=o.useRef({activatorEvent:null,active:null,activeNode:Ee,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),W=I.getNodeFor((t=Y.current.over)==null?void 0:t.id),le=(function(y){let{measure:V}=y;const[_,Q]=o.useState(null),se=Bn({callback:o.useCallback(be=>{for(const{target:he}of be)if(bn(he)){Q(Ie=>{const Be=V(he);return Ie?{...Ie,width:Be.width,height:Be.height}:Be});break}},[V])}),de=o.useCallback(be=>{const he=el(be);se?.disconnect(),he&&se?.observe(he),Q(he?V(he):null)},[V,se]),[ge,Ce]=zn(de);return o.useMemo(()=>({nodeRef:ge,rect:_,setRef:Ce}),[_,ge,Ce])})({measure:je.dragOverlay.measure}),fe=(n=le.nodeRef.current)!=null?n:Ee,ce=m?(i=le.rect)!=null?i:pe:null,Se=!!(le.nodeRef.current&&le.rect),ie=tr(ve=Se?null:pe,Co(ve));var ve;const xe=cr(fe?ft(fe):null),Re=(function(y){const V=o.useRef(y),_=un(Q=>y?Q&&Q!==sr&&y&&V.current&&y.parentNode===V.current.parentNode?Q:Kn(y):sr,[y]);return o.useEffect(()=>{V.current=y},[y]),_})(m?W??Ee:null),b=(function(y,V){V===void 0&&(V=Jt);const[_]=y,Q=cr(_?ft(_):null),[se,de]=o.useState(ur);function ge(){de(()=>y.length?y.map(be=>Wr(be)?Q:new fo(V(be),be)):ur)}const Ce=Bn({callback:ge});return Rt(()=>{Ce?.disconnect(),ge(),y.forEach(be=>Ce?.observe(be))},[y]),se})(Re),Fe=ol(h,{transform:{x:$.x-ie.x,y:$.y-ie.y,scaleX:1,scaleY:1},activatorEvent:J,active:X,activeNodeRect:pe,containerNodeRect:Le,draggingNodeRect:ce,over:Y.current.over,overlayNodeRect:le.rect,scrollableAncestors:Re,scrollableAncestorRects:b,windowRect:xe}),Ze=Ue?_t(Ue,$):null,ze=(function(y){const[V,_]=o.useState(null),Q=o.useRef(y),se=o.useCallback(de=>{const ge=so(de.target);ge&&_(Ce=>Ce?(Ce.set(ge,mo(ge)),new Map(Ce)):null)},[]);return o.useEffect(()=>{const de=Q.current;if(y!==de){ge(de);const Ce=y.map(be=>{const he=so(be);return he?(he.addEventListener("scroll",se,{passive:!0}),[he,mo(he)]):null}).filter(be=>be!=null);_(Ce.length?new Map(Ce):null),Q.current=y}return()=>{ge(y),ge(de)};function ge(Ce){Ce.forEach(be=>{const he=so(be);he?.removeEventListener("scroll",se)})}},[se,y]),o.useMemo(()=>y.length?V?Array.from(V.values()).reduce((de,ge)=>_t(de,ge),kt):_r(y):kt,[y,V])})(Re),et=dr(ze),oe=dr(ze,[pe]),ke=_t(Fe,et),Ae=ce?Mi(ce,Fe):null,ye=X&&Ae?S({active:X,collisionRect:Ae,droppableRects:ae,droppableContainers:we,pointerCoordinates:Ze}):null,De=Pr(ye,"id"),[D,ee]=o.useState(null),L=(function(y,V,_){return{...y,scaleX:V&&_?V.width/_.width:1,scaleY:V&&_?V.height/_.height:1}})(Se?Fe:_t(Fe,oe),(a=D?.rect)!=null?a:null,pe),G=o.useRef(null),u=o.useCallback((y,V)=>{let{sensor:_,options:Q}=V;if(B.current==null)return;const se=T.get(B.current);if(!se)return;const de=y.nativeEvent,ge=new _({active:B.current,activeNode:se,event:de,options:Q,context:Y,onAbort(be){if(!T.get(be))return;const{onDragAbort:he}=U.current,Ie={id:be};he?.(Ie),K({type:"onDragAbort",event:Ie})},onPending(be,he,Ie,Be){if(!T.get(be))return;const{onDragPending:Ne}=U.current,Ve={id:be,constraint:he,initialCoordinates:Ie,offset:Be};Ne?.(Ve),K({type:"onDragPending",event:Ve})},onStart(be){const he=B.current;if(he==null)return;const Ie=T.get(he);if(!Ie)return;const{onDragStart:Be}=U.current,Ne={activatorEvent:de,active:{id:he,data:Ie.data,rect:Z}};Lt.unstable_batchedUpdates(()=>{Be?.(Ne),O(At.Initializing),N({type:ct.DragStart,initialCoordinates:be,active:he}),K({type:"onDragStart",event:Ne}),H(G.current),M(de)})},onMove(be){N({type:ct.DragMove,coordinates:be})},onEnd:Ce(ct.DragEnd),onCancel:Ce(ct.DragCancel)});function Ce(be){return async function(){const{active:he,collisions:Ie,over:Be,scrollAdjustedTranslate:Ne}=Y.current;let Ve=null;if(he&&Ne){const{cancelDrop:$e}=U.current;Ve={activatorEvent:de,active:he,collisions:Ie,delta:Ne,over:Be},be===ct.DragEnd&&typeof $e=="function"&&await Promise.resolve($e(Ve))&&(be=ct.DragCancel)}B.current=null,Lt.unstable_batchedUpdates(()=>{N({type:be}),O(At.Uninitialized),ee(null),H(null),M(null),G.current=null;const $e=be===ct.DragEnd?"onDragEnd":"onDragCancel";if(Ve){const _e=U.current[$e];_e?.(Ve),K({type:$e,event:Ve})}})}}G.current=ge},[T]),w=o.useCallback((y,V)=>(_,Q)=>{const se=_.nativeEvent,de=T.get(Q);if(B.current!==null||!de||se.dndKit||se.defaultPrevented)return;const ge={active:de};y(_,V.options,ge)===!0&&(se.dndKit={capturedBy:V.sensor},B.current=Q,u(_,V))},[T,u]),F=(function(y,V){return o.useMemo(()=>y.reduce((_,Q)=>{const{sensor:se}=Q;return[..._,...se.activators.map(de=>({eventName:de.eventName,handler:V(de.handler,Q)}))]},[]),[y,V])})(f,w);(function(y){o.useEffect(()=>{if(!Pn)return;const V=y.map(_=>{let{sensor:Q}=_;return Q.setup==null?void 0:Q.setup()});return()=>{for(const _ of V)_?.()}},y.map(V=>{let{sensor:_}=V;return _}))})(f),Rt(()=>{pe&&R===At.Initializing&&O(At.Initialized)},[pe,R]),o.useEffect(()=>{const{onDragMove:y}=U.current,{active:V,activatorEvent:_,collisions:Q,over:se}=Y.current;if(!V||!_)return;const de={active:V,activatorEvent:_,collisions:Q,delta:{x:ke.x,y:ke.y},over:se};Lt.unstable_batchedUpdates(()=>{y?.(de),K({type:"onDragMove",event:de})})},[ke.x,ke.y]),o.useEffect(()=>{const{active:y,activatorEvent:V,collisions:_,droppableContainers:Q,scrollAdjustedTranslate:se}=Y.current;if(!y||B.current==null||!V||!se)return;const{onDragOver:de}=U.current,ge=Q.get(De),Ce=ge&&ge.rect.current?{id:ge.id,rect:ge.rect.current,data:ge.data,disabled:ge.disabled}:null,be={active:y,activatorEvent:V,collisions:_,delta:{x:se.x,y:se.y},over:Ce};Lt.unstable_batchedUpdates(()=>{ee(Ce),de?.(be),K({type:"onDragOver",event:be})})},[De]),Rt(()=>{Y.current={activatorEvent:J,active:X,activeNode:Ee,collisionRect:Ae,collisions:ye,droppableRects:ae,draggableNodes:T,draggingNode:fe,draggingNodeRect:ce,droppableContainers:I,over:D,scrollableAncestors:Re,scrollAdjustedTranslate:ke},Z.current={initial:ce,translated:Ae}},[X,Ee,ye,Ae,T,fe,ce,ae,I,D,Re,ke]),Oi({...re,delta:$,draggingRect:Ae,pointerCoordinates:Ze,scrollableAncestors:Re,scrollableAncestorRects:b});const v=o.useMemo(()=>({active:X,activeNode:Ee,activeNodeRect:pe,activatorEvent:J,collisions:ye,containerNodeRect:Le,dragOverlay:le,draggableNodes:T,droppableContainers:I,droppableRects:ae,over:D,measureDroppableContainers:Me,scrollableAncestors:Re,scrollableAncestorRects:b,measuringConfiguration:je,measuringScheduled:Ke,windowRect:xe}),[X,Ee,pe,J,ye,Le,le,T,I,ae,D,Me,Re,b,je,Ke,xe]),z=o.useMemo(()=>({activatorEvent:J,activators:F,active:X,activeNodeRect:pe,ariaDescribedById:{draggable:ue},dispatch:N,draggableNodes:T,over:D,measureDroppableContainers:Me}),[J,F,X,pe,N,ue,T,D,Me]);return o.createElement(jr.Provider,{value:P},o.createElement(wn.Provider,{value:z},o.createElement(nl.Provider,{value:v},o.createElement($n.Provider,{value:L},s)),o.createElement($i,{disabled:C?.restoreFocus===!1})),o.createElement(yi,{...C,hiddenTextDescribedById:ue}))}),Gi=o.createContext(null),gr="button";function _i(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=yn("Draggable"),{activators:C,activatorEvent:g,active:s,activeNodeRect:f,ariaDescribedById:S,draggableNodes:p,over:h}=o.useContext(wn),{role:E=gr,roleDescription:x="draggable",tabIndex:A=0}=a??{},N=s?.id===t,K=o.useContext(N?$n:Gi),[P,R]=zn(),[O,m]=zn(),q=(function($,I){return o.useMemo(()=>$.reduce((k,Z)=>{let{eventName:X,handler:B}=Z;return k[X]=j=>{B(j,I)},k},{}),[$,I])})(C,t),T=pn(n);return Rt(()=>(p.set(t,{id:t,key:l,node:P,activatorNode:O,data:T}),()=>{const $=p.get(t);$&&$.key===l&&p.delete(t)}),[p,t]),{active:s,activatorEvent:g,activeNodeRect:f,attributes:o.useMemo(()=>({role:E,tabIndex:A,"aria-disabled":i,"aria-pressed":!(!N||E!==gr)||void 0,"aria-roledescription":x,"aria-describedby":S.draggable}),[i,E,A,N,x,S.draggable]),isDragging:N,listeners:i?void 0:q,node:P,over:h,setNodeRef:R,setActivatorNodeRef:m,transform:K}}function rl(){return o.useContext(nl)}const Zi={timeout:25};function Xi(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,C]=o.useState(null),g=Nn(n);return n||i||!g||a(g),Rt(()=>{if(!l)return;const s=i?.key,f=i?.props.id;s!=null&&f!=null?Promise.resolve(t(f,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:C}):null)}const Yi={x:0,y:0,scaleX:1,scaleY:1};function Ji(e){let{children:t}=e;return o.createElement(wn.Provider,{value:tl},o.createElement($n.Provider,{value:Yi},t))}const Qi={position:"fixed",touchAction:"none"},ea=e=>Un(e)?"transform 250ms ease":void 0,ta=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:C,rect:g,style:s,transform:f,transition:S=ea}=e;if(!g)return null;const p=a?f:{...f,scaleX:1,scaleY:1},h={...Qi,width:g.width,height:g.height,top:g.top,left:g.left,transform:jt.Transform.toString(p),transformOrigin:a&&i?wi(i,g):void 0,transition:typeof S=="function"?S(i):S,...s};return o.createElement(n,{className:C,style:h,ref:t},l)}),na=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:C}=e;if(l!=null&&l.active)for(const[g,s]of Object.entries(l.active))s!==void 0&&(a[g]=n.node.style.getPropertyValue(g),n.node.style.setProperty(g,s));if(l!=null&&l.dragOverlay)for(const[g,s]of Object.entries(l.dragOverlay))s!==void 0&&i.node.style.setProperty(g,s);return C!=null&&C.active&&n.node.classList.add(C.active),C!=null&&C.dragOverlay&&i.node.classList.add(C.dragOverlay),function(){for(const[g,s]of Object.entries(a))n.node.style.setProperty(g,s);C!=null&&C.active&&n.node.classList.remove(C.active)}},ll={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:jt.Transform.toString(t)},{transform:jt.Transform.toString(n)}]},sideEffects:na({styles:{active:{opacity:"0"}}})};function oa(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Hn((l,C)=>{if(t===null)return;const g=n.get(l);if(!g)return;const s=g.node.current;if(!s)return;const f=el(C);if(!f)return;const{transform:S}=ft(C).getComputedStyle(C),p=Hr(S);if(!p)return;const h=typeof t=="function"?t:(function(E){const{duration:x,easing:A,sideEffects:N,keyframes:K}={...ll,...E};return P=>{let{active:R,dragOverlay:O,transform:m,...q}=P;if(!x)return;const T={x:O.rect.left-R.rect.left,y:O.rect.top-R.rect.top},$={scaleX:m.scaleX!==1?R.rect.width*m.scaleX/O.rect.width:1,scaleY:m.scaleY!==1?R.rect.height*m.scaleY/O.rect.height:1},I={x:m.x-T.x,y:m.y-T.y,...$},k=K({...q,active:R,dragOverlay:O,transform:{initial:m,final:I}}),[Z]=k,X=k[k.length-1];if(JSON.stringify(Z)===JSON.stringify(X))return;const B=N?.({active:R,dragOverlay:O,...q}),j=O.node.animate(k,{duration:x,easing:A,fill:"forwards"});return new Promise(H=>{j.onfinish=()=>{B?.(),H()}})}})(t);return Zr(s,a.draggable.measure),h({active:{id:l,data:g.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:C,rect:a.dragOverlay.measure(f)},droppableContainers:i,measuringConfiguration:a,transform:p})})}let hr=0;function ra(e){return o.useMemo(()=>{if(e!=null)return hr++,hr},[e])}const la=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:C,wrapperElement:g="div",className:s,zIndex:f=999}=e;const{activatorEvent:S,active:p,activeNodeRect:h,containerNodeRect:E,draggableNodes:x,droppableContainers:A,dragOverlay:N,over:K,measuringConfiguration:P,scrollableAncestors:R,scrollableAncestorRects:O,windowRect:m}=rl(),q=o.useContext($n),T=ra(p?.id),$=ol(C,{activatorEvent:S,active:p,activeNodeRect:h,containerNodeRect:E,draggingNodeRect:N.rect,over:K,overlayNodeRect:N.rect,scrollableAncestors:R,scrollableAncestorRects:O,transform:q,windowRect:m}),I=Co(h),k=oa({config:i,draggableNodes:x,droppableContainers:A,measuringConfiguration:P}),Z=I?N.setRef:void 0;return o.createElement(Ji,null,o.createElement(Xi,{animation:k},p&&T?o.createElement(ta,{key:T,id:p.id,ref:Z,as:g,activatorEvent:S,adjustScale:t,className:s,transition:l,rect:I,style:{zIndex:f,...a},transform:$},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 ia(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function En(e){return e!==null&&e>=0}const Fn={scaleX:1,scaleY:1},aa=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:C}=e;const g=(t=n[a])!=null?t:i;if(!g)return null;const s=(function(f,S,p){const h=f[S],E=f[S-1],x=f[S+1];return!h||!E&&!x?0:p<S?E?h.left-(E.left+E.width):x.left-(h.left+h.width):x?x.left-(h.left+h.width):h.left-(E.left+E.width)})(n,C,a);if(C===a){const f=n[l];return f?{x:a<l?f.left+f.width-(g.left+g.width):f.left-g.left,y:0,...Fn}:null}return C>a&&C<=l?{x:-g.width-s,y:0,...Fn}:C<a&&C>=l?{x:g.width+s,y:0,...Fn}:{x:0,y:0,...Fn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),C=t[a],g=l[a];return g&&C?{x:g.left-C.left,y:g.top-C.top,scaleX:g.width/C.width,scaleY:g.height/C.height}:null},il="Sortable",al=o.createContext({activeIndex:-1,containerId:il,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function sa(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:C,dragOverlay:g,droppableRects:s,over:f,measureDroppableContainers:S}=rl(),p=yn(il,n),h=g.rect!==null,E=o.useMemo(()=>i.map(q=>typeof q=="object"&&"id"in q?q.id:q),[i]),x=C!=null,A=C?E.indexOf(C.id):-1,N=f?E.indexOf(f.id):-1,K=o.useRef(E),P=!(function(q,T){if(q===T)return!0;if(q.length!==T.length)return!1;for(let $=0;$<q.length;$++)if(q[$]!==T[$])return!1;return!0})(E,K.current),R=N!==-1&&A===-1||P,O=(function(q){return typeof q=="boolean"?{draggable:q,droppable:q}:q})(l);Rt(()=>{P&&x&&S(E)},[P,E,x,S]),o.useEffect(()=>{K.current=E},[E]);const m=o.useMemo(()=>({activeIndex:A,containerId:p,disabled:O,disableTransforms:R,items:E,overIndex:N,useDragOverlay:h,sortedRects:ia(E,s),strategy:a}),[A,p,O.draggable,O.droppable,R,E,N,s,h,a]);return o.createElement(al.Provider,{value:m},t)}const da=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},ca=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:C,previousItems:g,previousContainerId:s,transition:f}=e;return!(!f||!i)&&(g===l||a!==C)&&(!!n||C!==a&&t===s)},ua={duration:200,easing:"ease"},sl="transform",ga=jt.Transition.toString({property:sl,duration:0,easing:"linear"}),ha={roleDescription:"sortable"};function ma(e){let{animateLayoutChanges:t=ca,attributes:n,disabled:i,data:a,getNewIndex:l=da,id:C,strategy:g,resizeObserverConfig:s,transition:f=ua}=e;const{items:S,containerId:p,activeIndex:h,disabled:E,disableTransforms:x,sortedRects:A,overIndex:N,useDragOverlay:K,strategy:P}=o.useContext(al),R=(function(W,le){var fe,ce;return typeof W=="boolean"?{draggable:W,droppable:!1}:{draggable:(fe=W?.draggable)!=null?fe:le.draggable,droppable:(ce=W?.droppable)!=null?ce:le.droppable}})(i,E),O=S.indexOf(C),m=o.useMemo(()=>({sortable:{containerId:p,index:O,items:S},...a}),[p,a,O,S]),q=o.useMemo(()=>S.slice(S.indexOf(C)),[S,C]),{rect:T,node:$,isOver:I,setNodeRef:k}=(function(W){let{data:le,disabled:fe=!1,id:ce,resizeObserverConfig:Se}=W;const ie=yn("Droppable"),{active:ve,dispatch:xe,over:Re,measureDroppableContainers:b}=o.useContext(wn),Fe=o.useRef({disabled:fe}),Ze=o.useRef(!1),ze=o.useRef(null),et=o.useRef(null),{disabled:oe,updateMeasurementsFor:ke,timeout:Ae}={...Zi,...Se},ye=pn(ke??ce),De=Bn({callback:o.useCallback(()=>{Ze.current?(et.current!=null&&clearTimeout(et.current),et.current=setTimeout(()=>{b(Array.isArray(ye.current)?ye.current:[ye.current]),et.current=null},Ae)):Ze.current=!0},[Ae]),disabled:oe||!ve}),D=o.useCallback((u,w)=>{De&&(w&&(De.unobserve(w),Ze.current=!1),u&&De.observe(u))},[De]),[ee,L]=zn(D),G=pn(le);return o.useEffect(()=>{De&&ee.current&&(De.disconnect(),Ze.current=!1,De.observe(ee.current))},[ee,De]),o.useEffect(()=>(xe({type:ct.RegisterDroppable,element:{id:ce,key:ie,disabled:fe,node:ee,rect:ze,data:G}}),()=>xe({type:ct.UnregisterDroppable,key:ie,id:ce})),[ce]),o.useEffect(()=>{fe!==Fe.current.disabled&&(xe({type:ct.SetDroppableDisabled,id:ce,key:ie,disabled:fe}),Fe.current.disabled=fe)},[ce,ie,fe,xe]),{active:ve,rect:ze,isOver:Re?.id===ce,node:ee,over:Re,setNodeRef:L}})({id:C,data:m,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...s}}),{active:Z,activatorEvent:X,activeNodeRect:B,attributes:j,setNodeRef:H,listeners:J,isDragging:M,over:U,setActivatorNodeRef:ue,transform:we}=_i({id:C,data:m,attributes:{...ha,...n},disabled:R.draggable}),je=(function(){for(var W=arguments.length,le=new Array(W),fe=0;fe<W;fe++)le[fe]=arguments[fe];return o.useMemo(()=>ce=>{le.forEach(Se=>Se(ce))},le)})(k,H),Te=!!Z,ae=Te&&!x&&En(h)&&En(N),Me=!K&&M,Ke=Me&&ae?we:null,Ee=ae?Ke??(g??P)({rects:A,activeNodeRect:B,activeIndex:h,overIndex:N,index:O}):null,Ue=En(h)&&En(N)?l({id:C,items:S,activeIndex:h,overIndex:N}):O,re=Z?.id,te=o.useRef({activeId:re,items:S,newIndex:Ue,containerId:p}),pe=S!==te.current.items,Le=t({active:Z,containerId:p,isDragging:M,isSorting:Te,id:C,index:O,items:S,newIndex:te.current.newIndex,previousItems:te.current.items,previousContainerId:te.current.containerId,transition:f,wasDragging:te.current.activeId!=null}),Y=(function(W){let{disabled:le,index:fe,node:ce,rect:Se}=W;const[ie,ve]=o.useState(null),xe=o.useRef(fe);return Rt(()=>{if(!le&&fe!==xe.current&&ce.current){const Re=Se.current;if(Re){const b=Jt(ce.current,{ignoreTransform:!0}),Fe={x:Re.left-b.left,y:Re.top-b.top,scaleX:Re.width/b.width,scaleY:Re.height/b.height};(Fe.x||Fe.y)&&ve(Fe)}}fe!==xe.current&&(xe.current=fe)},[le,fe,ce,Se]),o.useEffect(()=>{ie&&ve(null)},[ie]),ie})({disabled:!Le,index:O,node:$,rect:T});return o.useEffect(()=>{Te&&te.current.newIndex!==Ue&&(te.current.newIndex=Ue),p!==te.current.containerId&&(te.current.containerId=p),S!==te.current.items&&(te.current.items=S)},[Te,Ue,p,S]),o.useEffect(()=>{if(re===te.current.activeId)return;if(re!=null&&te.current.activeId==null)return void(te.current.activeId=re);const W=setTimeout(()=>{te.current.activeId=re},50);return()=>clearTimeout(W)},[re]),{active:Z,activeIndex:h,attributes:j,data:m,rect:T,index:O,newIndex:Ue,items:S,isOver:I,isSorting:Te,isDragging:M,listeners:J,node:$,overIndex:N,over:U,setNodeRef:je,setActivatorNodeRef:ue,setDroppableNodeRef:k,setDraggableNodeRef:H,transform:Y??Ee,transition:(function(){if(Y||pe&&te.current.newIndex===O)return ga;if(!(Me&&!Un(X)||!f)&&(Te||Le))return jt.Transition.toString({...f,property:sl})})()}}function Vn(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 fa=[Je.Down,Je.Right,Je.Up,Je.Left],pa=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:C,scrollableAncestors:g}}=t;if(fa.includes(e.code)){if(e.preventDefault(),!n||!i)return;const s=[];l.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const h=a.get(p.id);if(h)switch(e.code){case Je.Down:i.top<h.top&&s.push(p);break;case Je.Up:i.top>h.top&&s.push(p);break;case Je.Left:i.left>h.left&&s.push(p);break;case Je.Right:i.left<h.left&&s.push(p)}});const f=(p=>{let{collisionRect:h,droppableRects:E,droppableContainers:x}=p;const A=Qo(h),N=[];for(const K of x){const{id:P}=K,R=E.get(P);if(R){const O=Qo(R),m=A.reduce((T,$,I)=>T+Br(O[I],$),0),q=Number((m/4).toFixed(4));N.push({id:P,data:{droppableContainer:K,value:q}})}}return N.sort(Vr)})({collisionRect:i,droppableRects:a,droppableContainers:s});let S=Pr(f,"id");if(S===C?.id&&f.length>1&&(S=f[1].id),S!=null){const p=l.get(n.id),h=l.get(S),E=h?a.get(h.id):null,x=h?.node.current;if(x&&E&&p&&h){const A=Kn(x).some((O,m)=>g[m]!==O),N=mr(p,h),K=(function(O,m){return!Vn(O)||!Vn(m)||!mr(O,m)?!1:O.data.current.sortable.index<m.data.current.sortable.index})(p,h),P=A||!N?{x:0,y:0}:{x:K?i.width-E.width:0,y:K?i.height-E.height:0},R={x:E.left,y:E.top};return P.x&&P.y?R:vn(R,P)}}}};function mr(e,t){return!(!Vn(e)||!Vn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const va=e=>{let{transform:t}=e;return{...t,y:0}},dl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:C,editable:g,selectedIndex:s,background:f,activeColor:S,borderColor:p,borderWidth:h,dragging:E,...x}=e;return c.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:s===l?"white":f,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...x,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:s===l?"0px":"-1px",marginTop:s===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:s===l&&S?S?.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"},To=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:C,index:g,listeners:s,onRemove:f,renderItem:S,sorting:p,style:h,transition:E,transform:x,value:A,wrapperStyle:N,...K},P)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const R=S?S({dragOverlay:!!t,dragging:!!n,sorting:!!p,index:g,fadeIn:!!a,listeners:s,ref:P,style:h,transform:x,transition:E,value:A}):c.jsx(c.Fragment,{children:A});return c.jsx("div",{className:yt("tab-item",St.Wrapper,a&&St.fadeIn,p&&St.sorting,t&&St.dragOverlay),style:{...N,transition:[E,N?.transition].filter(Boolean).join(", "),"--translate-x":x?`${Math.round(x.x)}px`:void 0,"--translate-y":x?`${Math.round(x.y)}px`:void 0,"--scale-x":x?.scaleX?`${x.scaleX}`:void 0,"--scale-y":x?.scaleY?`${x.scaleY}`:void 0,"--index":g},ref:P,children:c.jsx("div",{className:yt(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:h,"data-cypress":"draggable-item",...l?void 0:s,...K,tabIndex:l?void 0:-1,children:R})})})),fr={Row:"_Row_1kr10_1"},cl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:yt(fr.Row,t&&fr.horizontal),children:e}))),Ca={...ll},ba=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:C=qi,coordinateGetter:g=pa,dropAnimation:s=Ca,getItemStyles:f=()=>({}),getNewIndex:S,handle:p=!1,items:h,onMove:E,isDisabled:x=()=>!1,measuring:A,modifiers:N,renderItem:K,renderDivider:P,reorderItems:R=ko,strategy:O=Mo,style:m,useDragOverlay:q=!0,onDragStart:T,wrapperStyle:$=()=>({})}=e,[I,k]=o.useState(()=>h);o.useEffect(()=>{k(h)},[h]);const[Z,X]=o.useState(null),B=(function(){for(var U=arguments.length,ue=new Array(U),we=0;we<U;we++)ue[we]=arguments[we];return o.useMemo(()=>[...ue].filter(je=>je!=null),[...ue])})(ao(Jr,{activationConstraint:i}),ao(Qr,{activationConstraint:i}),ao(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:g})),j=I.indexOf.bind(I),H=Z?j(Z):-1,J=[];I.map((U,ue)=>{J.push(c.jsx(ya,{id:U,handle:p,index:ue,style:f,wrapperStyle:$,disabled:x(U),renderItem:K,animateLayoutChanges:a,useDragOverlay:q,getNewIndex:S},U+"-"+ue));const we=P?.({key:"divider-"+ue});we&&J.push(we)});const{getPortalContainer:M}=r.useFullscreenPortal();return c.jsxs(Wi,{sensors:B,collisionDetection:C,onDragStart:U=>{const{active:ue}=U;ue&&(T?.(U),X(ue.id))},autoScroll:{canScroll:U=>!0},onDragEnd:U=>{if(X(null),U.over){const ue=j(U.over.id);H!==ue&&(k(we=>R(we,H,ue)),E?.(H,ue))}},onDragCancel:()=>{X(null)},measuring:A,modifiers:N,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...m},className:yt(n,St.Wrapper),children:c.jsx(sa,{items:I,strategy:O,children:c.jsx(cl,{ref:t,children:J})})}),q?Lt.createPortal(c.jsx(la,{adjustScale:l,dropAnimation:s,children:Z?c.jsx(To,{value:I[H],handle:p,renderItem:K,wrapperStyle:$({index:H,isDragging:!0,id:I[H]}),index:H,dragging:!0,style:f({id:I[H],index:H,isSorting:Z!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),M()):null]})}));function ya({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:C,style:g,renderItem:s,useDragOverlay:f,wrapperStyle:S}){const{attributes:p,isDragging:h,isSorting:E,listeners:x,overIndex:A,setNodeRef:N,transform:K,transition:P}=ma({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(To,{ref:N,value:a,disabled:e,dragging:h,sorting:E,handle:i,renderItem:s,index:l,style:g({index:l,id:a,isDragging:h,isSorting:E,overIndex:A}),onRemove:C?()=>C(a):void 0,transform:K,transition:P,wrapperStyle:S({index:l,isDragging:h,id:a}),listeners:x,"data-index":l,"data-id":a,dragOverlay:!f&&h,...p})}const wa="_TabStrip_3x0dp_1",xa=new d.Color("rgb(33, 115, 70)"),qa="#eee",Sa=e=>c.jsx(dl,{...e}),ul=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:C=[],onSelectedTabIndexChange:g,onTabNameChange:s,onTabMove:f,createScrollStartButton:S=r.defaultCreateScrollStartButton,createScrollEndButton:p=r.defaultCreateScrollEndButton,createScrollEdgeButton:h=r.defaultCreateScrollEdgeButton,createTabButton:E=Sa,createTabDivider:x,editLabelProps:A,disabled:N=!1,disableDrag:K=!1,background:P="white",activeColor:R=xa,borderColor:O=qa,borderWidth:m=1}=e,[q,T]=o.useState(l),[$,I]=o.useState(C),k=o.useCallback(ie=>{const ve=M.current?.[ie]?.closest(".tab-item")??M.current?.[ie];ve&&Me.current?.scrollTo({top:ve.offsetTop,left:ve.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{k(l)},[l]);const Z=o.useCallback((ie,ve)=>{ve!==q&&(T(ve),g?.(ve)),k(ve)},[g,q]),X=o.useCallback((ie,ve)=>{f?.(ie,ve)},[f]),B=o.useRef(null),[j,H]=o.useState(-1),J=o.useCallback((ie,ve)=>{s?.(ie,ve)},[s]);o.useLayoutEffect(()=>{T(l)},[l]),o.useLayoutEffect(()=>{I(C)},[C]);const M=o.useRef([]),U=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){M.current?.[ie]?.startEdit()},cancel(ie){M.current?.[ie]?.cancel()}},U.current),[q,j]);const ue=o.useCallback(({value:ie,index:ve,dragging:xe})=>{const{style:Re,maxLength:b,...Fe}=A||{},Ze=c.jsx(Nr,{ref:ze=>{M.current[ve]=ze},value:ie,disabled:N,maxLength:b,style:{color:q===ve&&R?R?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Re},styleHover:{},onSubmit:ze=>(B.current=!1,H(-1),J(ve,ze)),onCancel:()=>{B.current=!1,H(-1)},onChange:ze=>{B.current=!0,H(ve)},...Fe});return E({onClick:ze=>Z(ze,ve),value:ie,index:ve,editing:j===ve&&B.current,editable:!0,disabled:N,selectedIndex:q,background:P,activeColor:R,borderColor:O,borderWidth:m,dragging:xe,children:Ze})},[q,J,Z,A,N,j,E]),[we,{width:je}]=Ot(),[Te,{width:ae}]=Ot(),Me=o.useRef(null),[Ke,Ee]=o.useState({left:0,top:0,width:0,height:0}),[Ue,re]=o.useState(null);o.useEffect(()=>{Ue!==null&&Me.current&&Me.current.scrollTo({left:Ue,behavior:"smooth"})},[Ue]);const te=o.useCallback((ie,ve=!1)=>{if(!Me.current)return 0;let xe=Me.current.firstChild.getBoundingClientRect(),Re=Me.current.firstChild.firstChild.children,b=0;return b=ve?0:r.ScrollUtils.getScrollTo(ie,xe.left,Re,!0,Math.max(0,ie-200)),re(b),Math.max(0,b)},[]),pe=o.useCallback((ie,ve=!1)=>{if(!Me.current)return 0;let xe=Me.current.firstChild.getBoundingClientRect(),Re=Me.current.firstChild.firstChild.children,b=0;const Fe=Math.ceil(ae-je);return b=ve?Fe:r.ScrollUtils.getScrollTo(ie,xe.left,Re,!1,Math.max(0,ie+200)),re(b),Math.min(Fe,b)},[ae,je]),Le=o.useRef(null),Y=o.useRef(null),W=o.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null,Le.current=null)},[]),le=o.useCallback((ie,ve,xe=260)=>{Le.current=ie,Y.current=setTimeout(()=>{const Re=ve?te(Le.current||ie):pe(Le.current||ie);Re!==Le.current?le(Re,ve,120):W()},xe)},[te,pe,W]);o.useEffect(()=>()=>W(),[W]);const fe=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Ke.left)<=0||Math.floor(ae-je)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>le(Me.current.scrollLeft,!0),onClick:ie=>te(Math.min(Me.current.scrollLeft,Ue??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[Ke,Ue,ae,je]),ce=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ae-je)<=Math.ceil(Ke.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>le(Me.current.scrollLeft,!1),onClick:ie=>pe(Math.max(Me.current.scrollLeft,Ue??0),ie.ctrlKey)}),[Ke,Ue,ae,je]),Se=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,h?.(fe)]}),[fe,ce,S,p,n,h]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(wa,a),ref:U,children:[c.jsx("div",{style:{borderTop:`solid ${O} ${m}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),c.jsx("div",{className:"Tabs",ref:we,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Me,onScroll:ie=>{Ee({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:c.jsx(ba,{isDisabled:ie=>N||K,items:$,strategy:aa,modifiers:[va],ref:Te,renderItem:ue,renderDivider:x,onMove:X,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ce)})]})}));ul.displayName="TabStrip";const Dn=o.createContext(null);Dn.displayName="DocThemesContext";const Ra="_script-editor_iy654_5",ka={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"},Ma=o.lazy(()=>Promise.resolve().then(()=>require("./qFryYDUi48aWqUKG.cjs")));let sn,dn,Ft=["define","require"],pr=!1;const vr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),C=await l.getNavigationTree(i.uri.toString()),g=e.getPosition();let s={...g};s.lineNumber=1,s.column=1;let f=!1;for(let A=g.lineNumber;A>=1;A--)if(i.getLineContent(A).trim()===""){const N=Io(C,i.getOffsetAt({lineNumber:A,column:1}),"function");if(!N||Ia(N)){f=!0,s.lineNumber=A+1;break}{const K=N.spans[0].start;A=i.getPositionAt(K).lineNumber,s.lineNumber=A}}let S=n,p=!1;!f&&!S.startsWith(`
28
- `)&&s.lineNumber>1&&(S=`
29
- `+S,p=!0);let h=!1;i.getLineCount()>1&&(S.endsWith(`
27
+ `},Ri={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 ki(e){let{announcements:t=Ri,container:n,hiddenTextDescribedById:l,screenReaderInstructions:a=Si}=e;const{announce:i,announcement:f}=(function(){const[p,h]=o.useState("");return{announce:o.useCallback(k=>{k!=null&&h(k)},[]),announcement:p}})(),u=bn("DndLiveRegion"),[s,m]=o.useState(!1);if(o.useEffect(()=>{m(!0)},[]),(function(p){const h=o.useContext(Kr);o.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(p)},[p,h])})(o.useMemo(()=>({onDragStart(p){let{active:h}=p;i(t.onDragStart({active:h}))},onDragMove(p){let{active:h,over:k}=p;t.onDragMove&&i(t.onDragMove({active:h,over:k}))},onDragOver(p){let{active:h,over:k}=p;i(t.onDragOver({active:h,over:k}))},onDragEnd(p){let{active:h,over:k}=p;i(t.onDragEnd({active:h,over:k}))},onDragCancel(p){let{active:h,over:k}=p;i(t.onDragCancel({active:h,over:k}))}}),[i,t])),!s)return null;const q=o.createElement(o.Fragment,null,o.createElement(xi,{id:l,value:a.draggable}),o.createElement(qi,{id:u,announcement:f}));return n?Lt.createPortal(q,n):q}var dt;function On(){}function uo(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(dt||(dt={}));const kt=Object.freeze({x:0,y:0});function $r(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mi(e,t){const n=jn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Wr(e,t){let{data:{value:n}}=e,{data:{value:l}}=t;return n-l}function Ti(e,t){let{data:{value:n}}=e,{data:{value:l}}=t;return l-n}function rr(e){let{left:t,top:n,height:l,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+l},{x:t+a,y:n+l}]}function _r(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function lr(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ii=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:l}=e;const a=lr(t,t.left,t.top),i=[];for(const f of l){const{id:u}=f,s=n.get(u);if(s){const m=$r(lr(s),a);i.push({id:u,data:{droppableContainer:f,value:m}})}}return i.sort(Wr)};function Ei(e,t){const n=Math.max(t.top,e.top),l=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),f=a-l,u=i-n;if(l<a&&n<i){const s=t.width*t.height,m=e.width*e.height,q=f*u;return Number((q/(s+m-q)).toFixed(4))}return 0}const Fi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:l}=e;const a=[];for(const i of l){const{id:f}=i,u=n.get(f);if(u){const s=Ei(u,t);s>0&&a.push({id:f,data:{droppableContainer:i,value:s}})}}return a.sort(Ti)};function ir(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function Ai(e){return function(t){for(var n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];return l.reduce((i,f)=>({...i,top:i.top+e*f.y,bottom:i.bottom+e*f.y,left:i.left+e*f.x,right:i.right+e*f.x}),{...t})}}const Di=Ai(1);function Gr(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 zi={ignoreTransform:!1};function Qt(e,t){t===void 0&&(t=zi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:q}=pt(e).getComputedStyle(e);m&&(n=(function(p,h,k){const b=Gr(h);if(!b)return p;const{scaleX:I,scaleY:A,x:K,y:V}=b,M=p.left-K-(1-I)*parseFloat(k),P=p.top-V-(1-A)*parseFloat(k.slice(k.indexOf(" ")+1)),v=I?p.width/I:p.width,S=A?p.height/A:p.height;return{width:v,height:S,top:P,right:M+v,bottom:P+S,left:M}})(n,m,q))}const{top:l,left:a,width:i,height:f,bottom:u,right:s}=n;return{top:l,left:a,width:i,height:f,bottom:u,right:s}}function ar(e){return Qt(e,{ignoreTransform:!0})}function _n(e,t){const n=[];return e?(function l(a){if(t!=null&&n.length>=t||!a)return n;if(ko(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!wn(a)||Hr(a)||n.includes(a))return n;const i=pt(e).getComputedStyle(a);return a!==e&&(function(f,u){u===void 0&&(u=pt(f).getComputedStyle(f));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(m=>{const q=u[m];return typeof q=="string"&&s.test(q)})})(a,i)&&n.push(a),(function(f,u){return u===void 0&&(u=pt(f).getComputedStyle(f)),u.position==="fixed"})(a,i)?n:l(a.parentNode)})(e):n}function Zr(e){const[t]=_n(e,1);return t??null}function go(e){return Kn&&e?Jt(e)?e:Ro(e)?ko(e)||e===Zt(e).scrollingElement?window:wn(e)?e:null:null:null}function Xr(e){return Jt(e)?e.scrollX:e.scrollLeft}function Yr(e){return Jt(e)?e.scrollY:e.scrollTop}function vo(e){return{x:Xr(e),y:Yr(e)}}var gt;function Jr(e){return!(!Kn||!e)&&e===document.scrollingElement}function Qr(e){const t={x:0,y:0},n=Jr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},l={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=l.y,isRight:e.scrollLeft>=l.x,maxScroll:l,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(gt||(gt={}));const Ni={x:.2,y:.2};function Li(e,t,n,l,a){let{top:i,left:f,right:u,bottom:s}=n;l===void 0&&(l=10),a===void 0&&(a=Ni);const{isTop:m,isBottom:q,isLeft:p,isRight:h}=Qr(e),k={x:0,y:0},b={x:0,y:0},I=t.height*a.y,A=t.width*a.x;return!m&&i<=t.top+I?(k.y=gt.Backward,b.y=l*Math.abs((t.top+I-i)/I)):!q&&s>=t.bottom-I&&(k.y=gt.Forward,b.y=l*Math.abs((t.bottom-I-s)/I)),!h&&u>=t.right-A?(k.x=gt.Forward,b.x=l*Math.abs((t.right-A-u)/A)):!p&&f<=t.left+A&&(k.x=gt.Backward,b.x=l*Math.abs((t.left+A-f)/A)),{direction:k,speed:b}}function Pi(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:f}=window;return{top:0,left:0,right:i,bottom:f,width:i,height:f}}const{top:t,left:n,right:l,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:l,bottom:a,width:e.clientWidth,height:e.clientHeight}}function el(e){return e.reduce((t,n)=>Gt(t,vo(n)),kt)}function tl(e,t){if(t===void 0&&(t=Qt),!e)return;const{top:n,left:l,bottom:a,right:i}=t(e);Zr(e)&&(a<=0||i<=0||n>=window.innerHeight||l>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ji=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Xr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Yr(n),0)}]];class Co{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const l=_n(n),a=el(l);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,f,u]of ji)for(const s of f)Object.defineProperty(this,s,{get:()=>{const m=u(l),q=a[i]-m;return this.rect[s]+q},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var l;return(l=this.target)==null?void 0:l.removeEventListener(...n)})},this.target=t}add(t,n,l){var a;(a=this.target)==null||a.addEventListener(t,n,l),this.listeners.push([t,n,l])}}function ho(e,t){const n=Math.abs(e.x),l=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+l**2)>t:"x"in t&&"y"in t?n>t.x&&l>t.y:"x"in t?n>t.x:"y"in t&&l>t.y}var xt,Je;function sr(e){e.preventDefault()}function Oi(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xt||(xt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Je||(Je={}));const nl={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},Bi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.Up:return{...n,y:n.y-25}}};class Mo{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 hn(Zt(n)),this.windowListeners=new hn(pt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,l=t.node.current;l&&tl(l),n(kt)}handleKeyDown(t){if(Wn(t)){const{active:n,context:l,options:a}=this.props,{keyboardCodes:i=nl,coordinateGetter:f=Bi,scrollBehavior:u="smooth"}=a,{code:s}=t;if(i.end.includes(s))return void this.handleEnd(t);if(i.cancel.includes(s))return void this.handleCancel(t);const{collisionRect:m}=l.current,q=m?{x:m.left,y:m.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=q);const p=f(t,{active:n,context:l.current,currentCoordinates:q});if(p){const h=Cn(p,q),k={x:0,y:0},{scrollableAncestors:b}=l.current;for(const I of b){const A=t.code,{isTop:K,isRight:V,isLeft:M,isBottom:P,maxScroll:v,minScroll:S}=Qr(I),T=Pi(I),W={x:Math.min(A===Je.Right?T.right-T.width/2:T.right,Math.max(A===Je.Right?T.left:T.left+T.width/2,p.x)),y:Math.min(A===Je.Down?T.bottom-T.height/2:T.bottom,Math.max(A===Je.Down?T.top:T.top+T.height/2,p.y))},D=A===Je.Right&&!V||A===Je.Left&&!M,O=A===Je.Down&&!P||A===Je.Up&&!K;if(D&&W.x!==p.x){const G=I.scrollLeft+h.x,le=A===Je.Right&&G<=v.x||A===Je.Left&&G>=S.x;if(le&&!h.y)return void I.scrollTo({left:G,behavior:u});k.x=le?I.scrollLeft-G:A===Je.Right?I.scrollLeft-v.x:I.scrollLeft-S.x,k.x&&I.scrollBy({left:-k.x,behavior:u});break}if(O&&W.y!==p.y){const G=I.scrollTop+h.y,le=A===Je.Down&&G<=v.y||A===Je.Up&&G>=S.y;if(le&&!h.x)return void I.scrollTo({top:G,behavior:u});k.y=le?I.scrollTop-G:A===Je.Down?I.scrollTop-v.y:I.scrollTop-S.y,k.y&&I.scrollBy({top:-k.y,behavior:u});break}}this.handleMove(t,Gt(Cn(p,this.referenceCoordinates),k))}}}handleMove(t,n){const{onMove:l}=this.props;t.preventDefault(),l(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function cr(e){return!!(e&&"distance"in e)}function dr(e){return!!(e&&"delay"in e)}Mo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:l=nl,onActivation:a}=t,{active:i}=n;const{code:f}=e.nativeEvent;if(l.start.includes(f)){const u=i.activatorNode.current;return(!u||e.target===u)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class To{constructor(t,n,l){var a;l===void 0&&(l=(function(u){const{EventTarget:s}=pt(u);return u instanceof s?u:Zt(u)})(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:f}=i;this.props=t,this.events=n,this.document=Zt(f),this.documentListeners=new hn(this.document),this.listeners=new hn(l),this.windowListeners=new hn(pt(f)),this.initialCoordinates=(a=jn(i))!=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:l}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,sr),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,sr),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(l!=null&&l({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(cr(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:l,onPending:a}=this.props;a(l,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Oi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:l,initialCoordinates:a,props:i}=this,{onMove:f,options:{activationConstraint:u}}=i;if(!a)return;const s=(n=jn(t))!=null?n:kt,m=Cn(a,s);if(!l&&u){if(cr(u)){if(u.tolerance!=null&&ho(m,u.tolerance))return this.handleCancel();if(ho(m,u.distance))return this.handleStart()}return dr(u)&&ho(m,u.tolerance)?this.handleCancel():void this.handlePending(u,m)}t.cancelable&&t.preventDefault(),f(s)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Vi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ol extends To{constructor(t){const{event:n}=t,l=Zt(n.target);super(t,Vi,l)}}ol.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;return!(!n.isPrimary||n.button!==0)&&(l?.({event:n}),!0)}}];const Hi={move:{name:"mousemove"},end:{name:"mouseup"}};var yo;(function(e){e[e.RightClick=2]="RightClick"})(yo||(yo={}));class rl extends To{constructor(t){super(t,Hi,Zt(t.event.target))}}rl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;return n.button!==yo.RightClick&&(l?.({event:n}),!0)}}];const mo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ll extends To{constructor(t){super(t,mo)}static setup(){return window.addEventListener(mo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(mo.move.name,t)};function t(){}}}var mn,Bn;function Ui(e){let{acceleration:t,activator:n=mn.Pointer,canScroll:l,draggingRect:a,enabled:i,interval:f=5,order:u=Bn.TreeOrder,pointerCoordinates:s,scrollableAncestors:m,scrollableAncestorRects:q,delta:p,threshold:h}=e;const k=(function(S){let{delta:T,disabled:W}=S;const D=Pn(T);return gn(O=>{if(W||!D||!O)return Ki;const G={x:Math.sign(T.x-D.x),y:Math.sign(T.y-D.y)};return{x:{[gt.Backward]:O.x[gt.Backward]||G.x===-1,[gt.Forward]:O.x[gt.Forward]||G.x===1},y:{[gt.Backward]:O.y[gt.Backward]||G.y===-1,[gt.Forward]:O.y[gt.Forward]||G.y===1}}},[W,T,D])})({delta:p,disabled:!i}),[b,I]=(function(){const S=o.useRef(null);return[o.useCallback((T,W)=>{S.current=setInterval(T,W)},[]),o.useCallback(()=>{S.current!==null&&(clearInterval(S.current),S.current=null)},[])]})(),A=o.useRef({x:0,y:0}),K=o.useRef({x:0,y:0}),V=o.useMemo(()=>{switch(n){case mn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case mn.DraggableRect:return a}},[n,a,s]),M=o.useRef(null),P=o.useCallback(()=>{const S=M.current;if(!S)return;const T=A.current.x*K.current.x,W=A.current.y*K.current.y;S.scrollBy(T,W)},[]),v=o.useMemo(()=>u===Bn.TreeOrder?[...m].reverse():m,[u,m]);o.useEffect(()=>{if(i&&m.length&&V){for(const S of v){if(l?.(S)===!1)continue;const T=m.indexOf(S),W=q[T];if(!W)continue;const{direction:D,speed:O}=Li(S,W,V,t,h);for(const G of["x","y"])k[G][D[G]]||(O[G]=0,D[G]=0);if(O.x>0||O.y>0)return I(),M.current=S,b(P,f),A.current=O,void(K.current=D)}A.current={x:0,y:0},K.current={x:0,y:0},I()}else I()},[t,P,l,I,i,f,JSON.stringify(V),JSON.stringify(k),b,m,v,q,JSON.stringify(h)])}ll.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:l}=t;const{touches:a}=n;return!(a.length>1)&&(l?.({event:n}),!0)}}],(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(mn||(mn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bn||(Bn={}));const Ki={x:{[gt.Backward]:!1,[gt.Forward]:!1},y:{[gt.Backward]:!1,[gt.Forward]:!1}};var yn,wo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yn||(yn={})),(function(e){e.Optimized="optimized"})(wo||(wo={}));const ur=new Map;function bo(e,t){return gn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vn(e){let{callback:t,disabled:n}=e;const l=$n(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(l)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function $i(e){return new Co(Qt(e),e)}function gr(e,t,n){t===void 0&&(t=$i);const[l,a]=o.useState(null);function i(){a(s=>{if(!e)return null;var m;if(e.isConnected===!1)return(m=s??n)!=null?m:null;const q=t(e);return JSON.stringify(s)===JSON.stringify(q)?s:q})}const f=(function(s){let{callback:m,disabled:q}=s;const p=$n(m),h=o.useMemo(()=>{if(q||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:k}=window;return new k(p)},[p,q]);return o.useEffect(()=>()=>h?.disconnect(),[h]),h})({callback(s){if(e)for(const m of s){const{type:q,target:p}=m;if(q==="childList"&&p instanceof HTMLElement&&p.contains(e)){i();break}}}}),u=Vn({callback:i});return Rt(()=>{i(),e?(u?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(u?.disconnect(),f?.disconnect())},[e]),l}const hr=[];function mr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const l=e!==kt;l&&!n.current&&(n.current=e),!l&&n.current&&(n.current=null)},[e]),n.current?Cn(e,n.current):kt}function fr(e){return o.useMemo(()=>e?(function(t){const n=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}})(e):null,[e])}const pr=[];function il(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return wn(t)?t:e}const Wi=[{sensor:ol,options:{}},{sensor:Mo,options:{}}],_i={current:{}},Dn={draggable:{measure:ar},droppable:{measure:ar,strategy:yn.WhileDragging,frequency:wo.Optimized},dragOverlay:{measure:Qt}};class fn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,l;return(n=(l=this.get(t))==null?void 0:l.node.current)!=null?n:void 0}}const Gi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Dn,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},al={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},xn=o.createContext(al),sl=o.createContext(Gi);function Zi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fn}}}function Xi(e,t){switch(t.type){case dt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case dt.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 dt.DragEnd:case dt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case dt.RegisterDroppable:{const{element:n}=t,{id:l}=n,a=new fn(e.droppable.containers);return a.set(l,n),{...e,droppable:{...e.droppable,containers:a}}}case dt.SetDroppableDisabled:{const{id:n,key:l,disabled:a}=t,i=e.droppable.containers.get(n);if(!i||l!==i.key)return e;const f=new fn(e.droppable.containers);return f.set(n,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case dt.UnregisterDroppable:{const{id:n,key:l}=t,a=e.droppable.containers.get(n);if(!a||l!==a.key)return e;const i=new fn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Yi(e){let{disabled:t}=e;const{active:n,activatorEvent:l,draggableNodes:a}=o.useContext(xn),i=Pn(l),f=Pn(n?.id);return o.useEffect(()=>{if(!t&&!l&&i&&f!=null){if(!Wn(i)||document.activeElement===i.target)return;const u=a.get(f);if(!u)return;const{activatorNode:s,node:m}=u;if(!s.current&&!m.current)return;requestAnimationFrame(()=>{for(const q of[s.current,m.current]){if(!q)continue;const p=wi(q);if(p){p.focus();break}}})}},[l,t,a,f,i]),null}function cl(e,t){let{transform:n,...l}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...l}),n):n}const Gn=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Ji=o.memo(function(e){var t,n,l,a;let{id:i,accessibility:f,autoScroll:u=!0,children:s,sensors:m=Wi,collisionDetection:q=Fi,measuring:p,modifiers:h,...k}=e;const b=o.useReducer(Xi,void 0,Zi),[I,A]=b,[K,V]=(function(){const[w]=o.useState(()=>new Set),H=o.useCallback(X=>(w.add(X),()=>w.delete(X)),[w]);return[o.useCallback(X=>{let{type:Q,event:ce}=X;w.forEach(de=>{var ge;return(ge=de[Q])==null?void 0:ge.call(de,ce)})},[w]),H]})(),[M,P]=o.useState(At.Uninitialized),v=M===At.Initialized,{draggable:{active:S,nodes:T,translate:W},droppable:{containers:D}}=I,O=S!=null?T.get(S):null,G=o.useRef({initial:null,translated:null}),le=o.useMemo(()=>{var w;return S!=null?{id:S,data:(w=O?.data)!=null?w:_i,rect:G}:null},[S,O]),U=o.useRef(null),[E,B]=o.useState(null),[$,R]=o.useState(null),L=vn(k,Object.values(k)),ee=bn("DndDescribedBy",i),ie=o.useMemo(()=>D.getEnabled(),[D]),Ce=(Se=p,o.useMemo(()=>({draggable:{...Dn.draggable,...Se?.draggable},droppable:{...Dn.droppable,...Se?.droppable},dragOverlay:{...Dn.dragOverlay,...Se?.dragOverlay}}),[Se?.draggable,Se?.droppable,Se?.dragOverlay]));var Se;const{droppableRects:he,measureDroppableContainers:Te,measuringScheduled:Ke}=(function(w,H){let{dragging:X,dependencies:Q,config:ce}=H;const[de,ge]=o.useState(null),{frequency:we,measure:be,strategy:me}=ce,Fe=o.useRef(w),Oe=(function(){switch(me){case yn.Always:return!1;case yn.BeforeDragging:return X;default:return!X}})(),Pe=vn(Oe),Be=o.useCallback(function(je){je===void 0&&(je=[]),Pe.current||ge(Ye=>Ye===null?je:Ye.concat(je.filter(at=>!Ye.includes(at))))},[Pe]),$e=o.useRef(null),Ge=gn(je=>{if(Oe&&!X)return ur;if(!je||je===ur||Fe.current!==w||de!=null){const Ye=new Map;for(let at of w){if(!at)continue;if(de&&de.length>0&&!de.includes(at.id)&&at.rect.current){Ye.set(at.id,at.rect.current);continue}const mt=at.node.current,qt=mt?new Co(be(mt),mt):null;at.rect.current=qt,qt&&Ye.set(at.id,qt)}return Ye}return je},[w,de,X,Oe,be]);return o.useEffect(()=>{Fe.current=w},[w]),o.useEffect(()=>{Oe||Be()},[X,Oe]),o.useEffect(()=>{de&&de.length>0&&ge(null)},[JSON.stringify(de)]),o.useEffect(()=>{Oe||typeof we!="number"||$e.current!==null||($e.current=setTimeout(()=>{Be(),$e.current=null},we))},[we,Oe,Be,...Q]),{droppableRects:Ge,measureDroppableContainers:Be,measuringScheduled:de!=null}})(ie,{dragging:v,dependencies:[W.x,W.y],config:Ce.droppable}),Ee=(function(w,H){const X=H!=null?w.get(H):void 0,Q=X?X.node.current:null;return gn(ce=>{var de;return H==null?null:(de=Q??ce)!=null?de:null},[Q,H])})(T,S),He=o.useMemo(()=>$?jn($):null,[$]),J=(function(){const w=E?.autoScrollEnabled===!1,H=typeof u=="object"?u.enabled===!1:u===!1,X=v&&!w&&!H;return typeof u=="object"?{...u,enabled:X}:{enabled:X}})(),ne=(function(w,H){return bo(w,H)})(Ee,Ce.draggable.measure);(function(w){let{activeNode:H,measure:X,initialRect:Q,config:ce=!0}=w;const de=o.useRef(!1),{x:ge,y:we}=typeof ce=="boolean"?{x:ce,y:ce}:ce;Rt(()=>{if(!ge&&!we||!H)return void(de.current=!1);if(de.current||!Q)return;const be=H?.node.current;if(!be||be.isConnected===!1)return;const me=ir(X(be),Q);if(ge||(me.x=0),we||(me.y=0),de.current=!0,Math.abs(me.x)>0||Math.abs(me.y)>0){const Fe=Zr(be);Fe&&Fe.scrollBy({top:me.y,left:me.x})}},[H,ge,we,Q,X])})({activeNode:S!=null?T.get(S):null,config:J.layoutShiftCompensation,initialRect:ne,measure:Ce.draggable.measure});const pe=gr(Ee,Ce.draggable.measure,ne),De=gr(Ee?Ee.parentElement:null),Y=o.useRef({activatorEvent:null,active:null,activeNode:Ee,collisionRect:null,collisions:null,droppableRects:he,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_=D.getNodeFor((t=Y.current.over)==null?void 0:t.id),ae=(function(w){let{measure:H}=w;const[X,Q]=o.useState(null),ce=Vn({callback:o.useCallback(be=>{for(const{target:me}of be)if(wn(me)){Q(Fe=>{const Oe=H(me);return Fe?{...Fe,width:Oe.width,height:Oe.height}:Oe});break}},[H])}),de=o.useCallback(be=>{const me=il(be);ce?.disconnect(),me&&ce?.observe(me),Q(me?H(me):null)},[H,ce]),[ge,we]=Ln(de);return o.useMemo(()=>({nodeRef:ge,rect:X,setRef:we}),[X,ge,we])})({measure:Ce.dragOverlay.measure}),ve=(n=ae.nodeRef.current)!=null?n:Ee,ue=v?(l=ae.rect)!=null?l:pe:null,ke=!!(ae.nodeRef.current&&ae.rect),se=ir(ye=ke?null:pe,bo(ye));var ye;const qe=fr(ve?pt(ve):null),Me=(function(w){const H=o.useRef(w),X=gn(Q=>w?Q&&Q!==hr&&w&&H.current&&w.parentNode===H.current.parentNode?Q:_n(w):hr,[w]);return o.useEffect(()=>{H.current=w},[w]),X})(v?_??Ee:null),y=(function(w,H){H===void 0&&(H=Qt);const[X]=w,Q=fr(X?pt(X):null),[ce,de]=o.useState(pr);function ge(){de(()=>w.length?w.map(be=>Jr(be)?Q:new Co(H(be),be)):pr)}const we=Vn({callback:ge});return Rt(()=>{we?.disconnect(),ge(),w.forEach(be=>we?.observe(be))},[w]),ce})(Me),Ae=cl(h,{transform:{x:W.x-se.x,y:W.y-se.y,scaleX:1,scaleY:1},activatorEvent:$,active:le,activeNodeRect:pe,containerNodeRect:De,draggingNodeRect:ue,over:Y.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Me,scrollableAncestorRects:y,windowRect:qe}),Ze=He?Gt(He,W):null,Le=(function(w){const[H,X]=o.useState(null),Q=o.useRef(w),ce=o.useCallback(de=>{const ge=go(de.target);ge&&X(we=>we?(we.set(ge,vo(ge)),new Map(we)):null)},[]);return o.useEffect(()=>{const de=Q.current;if(w!==de){ge(de);const we=w.map(be=>{const me=go(be);return me?(me.addEventListener("scroll",ce,{passive:!0}),[me,vo(me)]):null}).filter(be=>be!=null);X(we.length?new Map(we):null),Q.current=w}return()=>{ge(w),ge(de)};function ge(we){we.forEach(be=>{const me=go(be);me?.removeEventListener("scroll",ce)})}},[ce,w]),o.useMemo(()=>w.length?H?Array.from(H.values()).reduce((de,ge)=>Gt(de,ge),kt):el(w):kt,[w,H])})(Me),et=mr(Le),re=mr(Le,[pe]),Ie=Gt(Ae,et),ze=ue?Di(ue,Ae):null,xe=le&&ze?q({active:le,collisionRect:ze,droppableRects:he,droppableContainers:ie,pointerCoordinates:Ze}):null,Ne=_r(xe,"id"),[z,te]=o.useState(null),j=(function(w,H,X){return{...w,scaleX:H&&X?H.width/X.width:1,scaleY:H&&X?H.height/X.height:1}})(ke?Ae:Gt(Ae,re),(a=z?.rect)!=null?a:null,pe),Z=o.useRef(null),g=o.useCallback((w,H)=>{let{sensor:X,options:Q}=H;if(U.current==null)return;const ce=T.get(U.current);if(!ce)return;const de=w.nativeEvent,ge=new X({active:U.current,activeNode:ce,event:de,options:Q,context:Y,onAbort(be){if(!T.get(be))return;const{onDragAbort:me}=L.current,Fe={id:be};me?.(Fe),K({type:"onDragAbort",event:Fe})},onPending(be,me,Fe,Oe){if(!T.get(be))return;const{onDragPending:Pe}=L.current,Be={id:be,constraint:me,initialCoordinates:Fe,offset:Oe};Pe?.(Be),K({type:"onDragPending",event:Be})},onStart(be){const me=U.current;if(me==null)return;const Fe=T.get(me);if(!Fe)return;const{onDragStart:Oe}=L.current,Pe={activatorEvent:de,active:{id:me,data:Fe.data,rect:G}};Lt.unstable_batchedUpdates(()=>{Oe?.(Pe),P(At.Initializing),A({type:dt.DragStart,initialCoordinates:be,active:me}),K({type:"onDragStart",event:Pe}),B(Z.current),R(de)})},onMove(be){A({type:dt.DragMove,coordinates:be})},onEnd:we(dt.DragEnd),onCancel:we(dt.DragCancel)});function we(be){return async function(){const{active:me,collisions:Fe,over:Oe,scrollAdjustedTranslate:Pe}=Y.current;let Be=null;if(me&&Pe){const{cancelDrop:$e}=L.current;Be={activatorEvent:de,active:me,collisions:Fe,delta:Pe,over:Oe},be===dt.DragEnd&&typeof $e=="function"&&await Promise.resolve($e(Be))&&(be=dt.DragCancel)}U.current=null,Lt.unstable_batchedUpdates(()=>{A({type:be}),P(At.Uninitialized),te(null),B(null),R(null),Z.current=null;const $e=be===dt.DragEnd?"onDragEnd":"onDragCancel";if(Be){const Ge=L.current[$e];Ge?.(Be),K({type:$e,event:Be})}})}}Z.current=ge},[T]),x=o.useCallback((w,H)=>(X,Q)=>{const ce=X.nativeEvent,de=T.get(Q);if(U.current!==null||!de||ce.dndKit||ce.defaultPrevented)return;const ge={active:de};w(X,H.options,ge)===!0&&(ce.dndKit={capturedBy:H.sensor},U.current=Q,g(X,H))},[T,g]),F=(function(w,H){return o.useMemo(()=>w.reduce((X,Q)=>{const{sensor:ce}=Q;return[...X,...ce.activators.map(de=>({eventName:de.eventName,handler:H(de.handler,Q)}))]},[]),[w,H])})(m,x);(function(w){o.useEffect(()=>{if(!Kn)return;const H=w.map(X=>{let{sensor:Q}=X;return Q.setup==null?void 0:Q.setup()});return()=>{for(const X of H)X?.()}},w.map(H=>{let{sensor:X}=H;return X}))})(m),Rt(()=>{pe&&M===At.Initializing&&P(At.Initialized)},[pe,M]),o.useEffect(()=>{const{onDragMove:w}=L.current,{active:H,activatorEvent:X,collisions:Q,over:ce}=Y.current;if(!H||!X)return;const de={active:H,activatorEvent:X,collisions:Q,delta:{x:Ie.x,y:Ie.y},over:ce};Lt.unstable_batchedUpdates(()=>{w?.(de),K({type:"onDragMove",event:de})})},[Ie.x,Ie.y]),o.useEffect(()=>{const{active:w,activatorEvent:H,collisions:X,droppableContainers:Q,scrollAdjustedTranslate:ce}=Y.current;if(!w||U.current==null||!H||!ce)return;const{onDragOver:de}=L.current,ge=Q.get(Ne),we=ge&&ge.rect.current?{id:ge.id,rect:ge.rect.current,data:ge.data,disabled:ge.disabled}:null,be={active:w,activatorEvent:H,collisions:X,delta:{x:ce.x,y:ce.y},over:we};Lt.unstable_batchedUpdates(()=>{te(we),de?.(be),K({type:"onDragOver",event:be})})},[Ne]),Rt(()=>{Y.current={activatorEvent:$,active:le,activeNode:Ee,collisionRect:ze,collisions:xe,droppableRects:he,draggableNodes:T,draggingNode:ve,draggingNodeRect:ue,droppableContainers:D,over:z,scrollableAncestors:Me,scrollAdjustedTranslate:Ie},G.current={initial:ue,translated:ze}},[le,Ee,xe,ze,T,ve,ue,he,D,z,Me,Ie]),Ui({...J,delta:W,draggingRect:ze,pointerCoordinates:Ze,scrollableAncestors:Me,scrollableAncestorRects:y});const C=o.useMemo(()=>({active:le,activeNode:Ee,activeNodeRect:pe,activatorEvent:$,collisions:xe,containerNodeRect:De,dragOverlay:ae,draggableNodes:T,droppableContainers:D,droppableRects:he,over:z,measureDroppableContainers:Te,scrollableAncestors:Me,scrollableAncestorRects:y,measuringConfiguration:Ce,measuringScheduled:Ke,windowRect:qe}),[le,Ee,pe,$,xe,De,ae,T,D,he,z,Te,Me,y,Ce,Ke,qe]),N=o.useMemo(()=>({activatorEvent:$,activators:F,active:le,activeNodeRect:pe,ariaDescribedById:{draggable:ee},dispatch:A,draggableNodes:T,over:z,measureDroppableContainers:Te}),[$,F,le,pe,A,ee,T,z,Te]);return o.createElement(Kr.Provider,{value:V},o.createElement(xn.Provider,{value:N},o.createElement(sl.Provider,{value:C},o.createElement(Gn.Provider,{value:j},s)),o.createElement(Yi,{disabled:f?.restoreFocus===!1})),o.createElement(ki,{...f,hiddenTextDescribedById:ee}))}),Qi=o.createContext(null),vr="button";function ea(e){let{id:t,data:n,disabled:l=!1,attributes:a}=e;const i=bn("Draggable"),{activators:f,activatorEvent:u,active:s,activeNodeRect:m,ariaDescribedById:q,draggableNodes:p,over:h}=o.useContext(xn),{role:k=vr,roleDescription:b="draggable",tabIndex:I=0}=a??{},A=s?.id===t,K=o.useContext(A?Gn:Qi),[V,M]=Ln(),[P,v]=Ln(),S=(function(W,D){return o.useMemo(()=>W.reduce((O,G)=>{let{eventName:le,handler:U}=G;return O[le]=E=>{U(E,D)},O},{}),[W,D])})(f,t),T=vn(n);return Rt(()=>(p.set(t,{id:t,key:i,node:V,activatorNode:P,data:T}),()=>{const W=p.get(t);W&&W.key===i&&p.delete(t)}),[p,t]),{active:s,activatorEvent:u,activeNodeRect:m,attributes:o.useMemo(()=>({role:k,tabIndex:I,"aria-disabled":l,"aria-pressed":!(!A||k!==vr)||void 0,"aria-roledescription":b,"aria-describedby":q.draggable}),[l,k,I,A,b,q.draggable]),isDragging:A,listeners:l?void 0:S,node:V,over:h,setNodeRef:M,setActivatorNodeRef:v,transform:K}}function dl(){return o.useContext(sl)}const ta={timeout:25};function na(e){let{animation:t,children:n}=e;const[l,a]=o.useState(null),[i,f]=o.useState(null),u=Pn(n);return n||l||!u||a(u),Rt(()=>{if(!i)return;const s=l?.key,m=l?.props.id;s!=null&&m!=null?Promise.resolve(t(m,i)).then(()=>{a(null)}):a(null)},[t,l,i]),o.createElement(o.Fragment,null,n,l?o.cloneElement(l,{ref:f}):null)}const oa={x:0,y:0,scaleX:1,scaleY:1};function ra(e){let{children:t}=e;return o.createElement(xn.Provider,{value:al},o.createElement(Gn.Provider,{value:oa},t))}const la={position:"fixed",touchAction:"none"},ia=e=>Wn(e)?"transform 250ms ease":void 0,aa=o.forwardRef((e,t)=>{let{as:n,activatorEvent:l,adjustScale:a,children:i,className:f,rect:u,style:s,transform:m,transition:q=ia}=e;if(!u)return null;const p=a?m:{...m,scaleX:1,scaleY:1},h={...la,width:u.width,height:u.height,top:u.top,left:u.left,transform:jt.Transform.toString(p),transformOrigin:a&&l?Mi(l,u):void 0,transition:typeof q=="function"?q(l):q,...s};return o.createElement(n,{className:f,style:h,ref:t},i)}),sa=e=>t=>{let{active:n,dragOverlay:l}=t;const a={},{styles:i,className:f}=e;if(i!=null&&i.active)for(const[u,s]of Object.entries(i.active))s!==void 0&&(a[u]=n.node.style.getPropertyValue(u),n.node.style.setProperty(u,s));if(i!=null&&i.dragOverlay)for(const[u,s]of Object.entries(i.dragOverlay))s!==void 0&&l.node.style.setProperty(u,s);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&l.node.classList.add(f.dragOverlay),function(){for(const[u,s]of Object.entries(a))n.node.style.setProperty(u,s);f!=null&&f.active&&n.node.classList.remove(f.active)}},ul={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:jt.Transform.toString(t)},{transform:jt.Transform.toString(n)}]},sideEffects:sa({styles:{active:{opacity:"0"}}})};function ca(e){let{config:t,draggableNodes:n,droppableContainers:l,measuringConfiguration:a}=e;return $n((i,f)=>{if(t===null)return;const u=n.get(i);if(!u)return;const s=u.node.current;if(!s)return;const m=il(f);if(!m)return;const{transform:q}=pt(f).getComputedStyle(f),p=Gr(q);if(!p)return;const h=typeof t=="function"?t:(function(k){const{duration:b,easing:I,sideEffects:A,keyframes:K}={...ul,...k};return V=>{let{active:M,dragOverlay:P,transform:v,...S}=V;if(!b)return;const T={x:P.rect.left-M.rect.left,y:P.rect.top-M.rect.top},W={scaleX:v.scaleX!==1?M.rect.width*v.scaleX/P.rect.width:1,scaleY:v.scaleY!==1?M.rect.height*v.scaleY/P.rect.height:1},D={x:v.x-T.x,y:v.y-T.y,...W},O=K({...S,active:M,dragOverlay:P,transform:{initial:v,final:D}}),[G]=O,le=O[O.length-1];if(JSON.stringify(G)===JSON.stringify(le))return;const U=A?.({active:M,dragOverlay:P,...S}),E=P.node.animate(O,{duration:b,easing:I,fill:"forwards"});return new Promise(B=>{E.onfinish=()=>{U?.(),B()}})}})(t);return tl(s,a.draggable.measure),h({active:{id:i,data:u.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:l,measuringConfiguration:a,transform:p})})}let Cr=0;function da(e){return o.useMemo(()=>{if(e!=null)return Cr++,Cr},[e])}const ua=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:l,style:a,transition:i,modifiers:f,wrapperElement:u="div",className:s,zIndex:m=999}=e;const{activatorEvent:q,active:p,activeNodeRect:h,containerNodeRect:k,draggableNodes:b,droppableContainers:I,dragOverlay:A,over:K,measuringConfiguration:V,scrollableAncestors:M,scrollableAncestorRects:P,windowRect:v}=dl(),S=o.useContext(Gn),T=da(p?.id),W=cl(f,{activatorEvent:q,active:p,activeNodeRect:h,containerNodeRect:k,draggingNodeRect:A.rect,over:K,overlayNodeRect:A.rect,scrollableAncestors:M,scrollableAncestorRects:P,transform:S,windowRect:v}),D=bo(h),O=ca({config:l,draggableNodes:b,droppableContainers:I,measuringConfiguration:V}),G=D?A.setRef:void 0;return o.createElement(ra,null,o.createElement(na,{animation:O},p&&T?o.createElement(aa,{key:T,id:p.id,ref:G,as:u,activatorEvent:q,adjustScale:t,className:s,transition:i,rect:D,style:{zIndex:m,...a},transform:W},n):null))});function Io(e,t,n){const l=e.slice();return l.splice(n<0?l.length+n:n,0,l.splice(t,1)[0]),l}function ga(e,t){return e.reduce((n,l,a)=>{const i=t.get(l);return i&&(n[a]=i),n},Array(e.length))}function Fn(e){return e!==null&&e>=0}const An={scaleX:1,scaleY:1},ha=e=>{var t;let{rects:n,activeNodeRect:l,activeIndex:a,overIndex:i,index:f}=e;const u=(t=n[a])!=null?t:l;if(!u)return null;const s=(function(m,q,p){const h=m[q],k=m[q-1],b=m[q+1];return!h||!k&&!b?0:p<q?k?h.left-(k.left+k.width):b.left-(h.left+h.width):b?b.left-(h.left+h.width):h.left-(k.left+k.width)})(n,f,a);if(f===a){const m=n[i];return m?{x:a<i?m.left+m.width-(u.left+u.width):m.left-u.left,y:0,...An}:null}return f>a&&f<=i?{x:-u.width-s,y:0,...An}:f<a&&f>=i?{x:u.width+s,y:0,...An}:{x:0,y:0,...An}},Eo=e=>{let{rects:t,activeIndex:n,overIndex:l,index:a}=e;const i=Io(t,l,n),f=t[a],u=i[a];return u&&f?{x:u.left-f.left,y:u.top-f.top,scaleX:u.width/f.width,scaleY:u.height/f.height}:null},gl="Sortable",hl=o.createContext({activeIndex:-1,containerId:gl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Eo,disabled:{draggable:!1,droppable:!1}});function ma(e){let{children:t,id:n,items:l,strategy:a=Eo,disabled:i=!1}=e;const{active:f,dragOverlay:u,droppableRects:s,over:m,measureDroppableContainers:q}=dl(),p=bn(gl,n),h=u.rect!==null,k=o.useMemo(()=>l.map(S=>typeof S=="object"&&"id"in S?S.id:S),[l]),b=f!=null,I=f?k.indexOf(f.id):-1,A=m?k.indexOf(m.id):-1,K=o.useRef(k),V=!(function(S,T){if(S===T)return!0;if(S.length!==T.length)return!1;for(let W=0;W<S.length;W++)if(S[W]!==T[W])return!1;return!0})(k,K.current),M=A!==-1&&I===-1||V,P=(function(S){return typeof S=="boolean"?{draggable:S,droppable:S}:S})(i);Rt(()=>{V&&b&&q(k)},[V,k,b,q]),o.useEffect(()=>{K.current=k},[k]);const v=o.useMemo(()=>({activeIndex:I,containerId:p,disabled:P,disableTransforms:M,items:k,overIndex:A,useDragOverlay:h,sortedRects:ga(k,s),strategy:a}),[I,p,P.draggable,P.droppable,M,k,A,s,h,a]);return o.createElement(hl.Provider,{value:v},t)}const fa=e=>{let{id:t,items:n,activeIndex:l,overIndex:a}=e;return Io(n,l,a).indexOf(t)},pa=e=>{let{containerId:t,isSorting:n,wasDragging:l,index:a,items:i,newIndex:f,previousItems:u,previousContainerId:s,transition:m}=e;return!(!m||!l)&&(u===i||a!==f)&&(!!n||f!==a&&t===s)},va={duration:200,easing:"ease"},ml="transform",Ca=jt.Transition.toString({property:ml,duration:0,easing:"linear"}),ya={roleDescription:"sortable"};function wa(e){let{animateLayoutChanges:t=pa,attributes:n,disabled:l,data:a,getNewIndex:i=fa,id:f,strategy:u,resizeObserverConfig:s,transition:m=va}=e;const{items:q,containerId:p,activeIndex:h,disabled:k,disableTransforms:b,sortedRects:I,overIndex:A,useDragOverlay:K,strategy:V}=o.useContext(hl),M=(function(_,ae){var ve,ue;return typeof _=="boolean"?{draggable:_,droppable:!1}:{draggable:(ve=_?.draggable)!=null?ve:ae.draggable,droppable:(ue=_?.droppable)!=null?ue:ae.droppable}})(l,k),P=q.indexOf(f),v=o.useMemo(()=>({sortable:{containerId:p,index:P,items:q},...a}),[p,a,P,q]),S=o.useMemo(()=>q.slice(q.indexOf(f)),[q,f]),{rect:T,node:W,isOver:D,setNodeRef:O}=(function(_){let{data:ae,disabled:ve=!1,id:ue,resizeObserverConfig:ke}=_;const se=bn("Droppable"),{active:ye,dispatch:qe,over:Me,measureDroppableContainers:y}=o.useContext(xn),Ae=o.useRef({disabled:ve}),Ze=o.useRef(!1),Le=o.useRef(null),et=o.useRef(null),{disabled:re,updateMeasurementsFor:Ie,timeout:ze}={...ta,...ke},xe=vn(Ie??ue),Ne=Vn({callback:o.useCallback(()=>{Ze.current?(et.current!=null&&clearTimeout(et.current),et.current=setTimeout(()=>{y(Array.isArray(xe.current)?xe.current:[xe.current]),et.current=null},ze)):Ze.current=!0},[ze]),disabled:re||!ye}),z=o.useCallback((g,x)=>{Ne&&(x&&(Ne.unobserve(x),Ze.current=!1),g&&Ne.observe(g))},[Ne]),[te,j]=Ln(z),Z=vn(ae);return o.useEffect(()=>{Ne&&te.current&&(Ne.disconnect(),Ze.current=!1,Ne.observe(te.current))},[te,Ne]),o.useEffect(()=>(qe({type:dt.RegisterDroppable,element:{id:ue,key:se,disabled:ve,node:te,rect:Le,data:Z}}),()=>qe({type:dt.UnregisterDroppable,key:se,id:ue})),[ue]),o.useEffect(()=>{ve!==Ae.current.disabled&&(qe({type:dt.SetDroppableDisabled,id:ue,key:se,disabled:ve}),Ae.current.disabled=ve)},[ue,se,ve,qe]),{active:ye,rect:Le,isOver:Me?.id===ue,node:te,over:Me,setNodeRef:j}})({id:f,data:v,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...s}}),{active:G,activatorEvent:le,activeNodeRect:U,attributes:E,setNodeRef:B,listeners:$,isDragging:R,over:L,setActivatorNodeRef:ee,transform:ie}=ea({id:f,data:v,attributes:{...ya,...n},disabled:M.draggable}),Ce=(function(){for(var _=arguments.length,ae=new Array(_),ve=0;ve<_;ve++)ae[ve]=arguments[ve];return o.useMemo(()=>ue=>{ae.forEach(ke=>ke(ue))},ae)})(O,B),Se=!!G,he=Se&&!b&&Fn(h)&&Fn(A),Te=!K&&R,Ke=Te&&he?ie:null,Ee=he?Ke??(u??V)({rects:I,activeNodeRect:U,activeIndex:h,overIndex:A,index:P}):null,He=Fn(h)&&Fn(A)?i({id:f,items:q,activeIndex:h,overIndex:A}):P,J=G?.id,ne=o.useRef({activeId:J,items:q,newIndex:He,containerId:p}),pe=q!==ne.current.items,De=t({active:G,containerId:p,isDragging:R,isSorting:Se,id:f,index:P,items:q,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:m,wasDragging:ne.current.activeId!=null}),Y=(function(_){let{disabled:ae,index:ve,node:ue,rect:ke}=_;const[se,ye]=o.useState(null),qe=o.useRef(ve);return Rt(()=>{if(!ae&&ve!==qe.current&&ue.current){const Me=ke.current;if(Me){const y=Qt(ue.current,{ignoreTransform:!0}),Ae={x:Me.left-y.left,y:Me.top-y.top,scaleX:Me.width/y.width,scaleY:Me.height/y.height};(Ae.x||Ae.y)&&ye(Ae)}}ve!==qe.current&&(qe.current=ve)},[ae,ve,ue,ke]),o.useEffect(()=>{se&&ye(null)},[se]),se})({disabled:!De,index:P,node:W,rect:T});return o.useEffect(()=>{Se&&ne.current.newIndex!==He&&(ne.current.newIndex=He),p!==ne.current.containerId&&(ne.current.containerId=p),q!==ne.current.items&&(ne.current.items=q)},[Se,He,p,q]),o.useEffect(()=>{if(J===ne.current.activeId)return;if(J!=null&&ne.current.activeId==null)return void(ne.current.activeId=J);const _=setTimeout(()=>{ne.current.activeId=J},50);return()=>clearTimeout(_)},[J]),{active:G,activeIndex:h,attributes:E,data:v,rect:T,index:P,newIndex:He,items:q,isOver:D,isSorting:Se,isDragging:R,listeners:$,node:W,overIndex:A,over:L,setNodeRef:Ce,setActivatorNodeRef:ee,setDroppableNodeRef:O,setDraggableNodeRef:B,transform:Y??Ee,transition:(function(){if(Y||pe&&ne.current.newIndex===P)return Ca;if(!(Te&&!Wn(le)||!m)&&(Se||De))return jt.Transition.toString({...m,property:ml})})()}}function Hn(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 ba=[Je.Down,Je.Right,Je.Up,Je.Left],xa=(e,t)=>{let{context:{active:n,collisionRect:l,droppableRects:a,droppableContainers:i,over:f,scrollableAncestors:u}}=t;if(ba.includes(e.code)){if(e.preventDefault(),!n||!l)return;const s=[];i.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const h=a.get(p.id);if(h)switch(e.code){case Je.Down:l.top<h.top&&s.push(p);break;case Je.Up:l.top>h.top&&s.push(p);break;case Je.Left:l.left>h.left&&s.push(p);break;case Je.Right:l.left<h.left&&s.push(p)}});const m=(p=>{let{collisionRect:h,droppableRects:k,droppableContainers:b}=p;const I=rr(h),A=[];for(const K of b){const{id:V}=K,M=k.get(V);if(M){const P=rr(M),v=I.reduce((T,W,D)=>T+$r(P[D],W),0),S=Number((v/4).toFixed(4));A.push({id:V,data:{droppableContainer:K,value:S}})}}return A.sort(Wr)})({collisionRect:l,droppableRects:a,droppableContainers:s});let q=_r(m,"id");if(q===f?.id&&m.length>1&&(q=m[1].id),q!=null){const p=i.get(n.id),h=i.get(q),k=h?a.get(h.id):null,b=h?.node.current;if(b&&k&&p&&h){const I=_n(b).some((P,v)=>u[v]!==P),A=yr(p,h),K=(function(P,v){return!Hn(P)||!Hn(v)||!yr(P,v)?!1:P.data.current.sortable.index<v.data.current.sortable.index})(p,h),V=I||!A?{x:0,y:0}:{x:K?l.width-k.width:0,y:K?l.height-k.height:0},M={x:k.left,y:k.top};return V.x&&V.y?M:Cn(M,V)}}}};function yr(e,t){return!(!Hn(e)||!Hn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const qa=e=>{let{transform:t}=e;return{...t,y:0}},fl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:l,className:a,index:i,editing:f,editable:u,selectedIndex:s,background:m,activeColor:q,borderColor:p,borderWidth:h,dragging:k,...b}=e;return c.jsxs("div",{ref:t,className:ut(a),style:{...l,display:"flex",flexDirection:"column",background:s===i?"white":m,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...b,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:s===i?"0px":"-1px",marginTop:s===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===i?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:s===i&&q?q?.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"},Fo=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:l,fadeIn:a,handle:i,height:f,index:u,listeners:s,onRemove:m,renderItem:q,sorting:p,style:h,transition:k,transform:b,value:I,wrapperStyle:A,...K},V)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const M=q?q({dragOverlay:!!t,dragging:!!n,sorting:!!p,index:u,fadeIn:!!a,listeners:s,ref:V,style:h,transform:b,transition:k,value:I}):c.jsx(c.Fragment,{children:I});return c.jsx("div",{className:ut("tab-item",St.Wrapper,a&&St.fadeIn,p&&St.sorting,t&&St.dragOverlay),style:{...A,transition:[k,A?.transition].filter(Boolean).join(", "),"--translate-x":b?`${Math.round(b.x)}px`:void 0,"--translate-y":b?`${Math.round(b.y)}px`:void 0,"--scale-x":b?.scaleX?`${b.scaleX}`:void 0,"--scale-y":b?.scaleY?`${b.scaleY}`:void 0,"--index":u},ref:V,children:c.jsx("div",{className:ut(St.Item,n&&St.dragging,i&&St.withHandle,t&&St.dragOverlay,l&&St.disabled,e&&St.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:s,...K,tabIndex:i?void 0:-1,children:M})})})),wr={Row:"_Row_1kr10_1"},pl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},l)=>c.jsx("div",{ref:l,style:{...n},className:ut(wr.Row,t&&wr.horizontal),children:e}))),Sa={...ul},Ra=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:l,animateLayoutChanges:a,adjustScale:i=!1,collisionDetection:f=Ii,coordinateGetter:u=xa,dropAnimation:s=Sa,getItemStyles:m=()=>({}),getNewIndex:q,handle:p=!1,items:h,onMove:k,isDisabled:b=()=>!1,measuring:I,modifiers:A,renderItem:K,renderDivider:V,reorderItems:M=Io,strategy:P=Eo,style:v,useDragOverlay:S=!0,onDragStart:T,wrapperStyle:W=()=>({})}=e,[D,O]=o.useState(()=>h);o.useEffect(()=>{O(h)},[h]);const[G,le]=o.useState(null),U=(function(){for(var L=arguments.length,ee=new Array(L),ie=0;ie<L;ie++)ee[ie]=arguments[ie];return o.useMemo(()=>[...ee].filter(Ce=>Ce!=null),[...ee])})(uo(rl,{activationConstraint:l}),uo(ll,{activationConstraint:l}),uo(Mo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:u})),E=D.indexOf.bind(D),B=G?E(G):-1,$=[];D.map((L,ee)=>{$.push(c.jsx(ka,{id:L,handle:p,index:ee,style:m,wrapperStyle:W,disabled:b(L),renderItem:K,animateLayoutChanges:a,useDragOverlay:S,getNewIndex:q},L+"-"+ee));const ie=V?.({key:"divider-"+ee});ie&&$.push(ie)});const{getPortalContainer:R}=r.useFullscreenPortal();return c.jsxs(Ji,{sensors:U,collisionDetection:f,onDragStart:L=>{const{active:ee}=L;ee&&(T?.(L),le(ee.id))},autoScroll:{canScroll:L=>!0},onDragEnd:L=>{if(le(null),L.over){const ee=E(L.over.id);B!==ee&&(O(ie=>M(ie,B,ee)),k?.(B,ee))}},onDragCancel:()=>{le(null)},measuring:I,modifiers:A,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...v},className:ut(n,St.Wrapper),children:c.jsx(ma,{items:D,strategy:P,children:c.jsx(pl,{ref:t,children:$})})}),S?Lt.createPortal(c.jsx(ua,{adjustScale:i,dropAnimation:s,children:G?c.jsx(Fo,{value:D[B],handle:p,renderItem:K,wrapperStyle:W({index:B,isDragging:!0,id:D[B]}),index:B,dragging:!0,style:m({id:D[B],index:B,isSorting:G!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),R()):null]})}));function ka({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:l,id:a,index:i,onRemove:f,style:u,renderItem:s,useDragOverlay:m,wrapperStyle:q}){const{attributes:p,isDragging:h,isSorting:k,listeners:b,overIndex:I,setNodeRef:A,transform:K,transition:V}=wa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(Fo,{ref:A,value:a,disabled:e,dragging:h,sorting:k,handle:l,renderItem:s,index:i,style:u({index:i,id:a,isDragging:h,isSorting:k,overIndex:I}),onRemove:f?()=>f(a):void 0,transform:K,transition:V,wrapperStyle:q({index:i,isDragging:h,id:a}),listeners:b,"data-index":i,"data-id":a,dragOverlay:!m&&h,...p})}const Ma="_TabStrip_3x0dp_1",Ta=new d.Color("rgb(33, 115, 70)"),Ia="#eee",Ea=e=>c.jsx(fl,{...e}),vl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:l,className:a,selectedTabIndex:i=0,tabNames:f=[],onSelectedTabIndexChange:u,onTabNameChange:s,onTabMove:m,createScrollStartButton:q=r.defaultCreateScrollStartButton,createScrollEndButton:p=r.defaultCreateScrollEndButton,createScrollEdgeButton:h=r.defaultCreateScrollEdgeButton,createTabButton:k=Ea,createTabDivider:b,editLabelProps:I,disabled:A=!1,disableDrag:K=!1,background:V="white",activeColor:M=Ta,borderColor:P=Ia,borderWidth:v=1}=e,[S,T]=o.useState(i),[W,D]=o.useState(f),O=o.useCallback(se=>{const ye=R.current?.[se]?.closest(".tab-item")??R.current?.[se];ye&&Te.current?.scrollTo({top:ye.offsetTop,left:ye.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{O(i)},[i]);const G=o.useCallback((se,ye)=>{ye!==S&&(T(ye),u?.(ye)),O(ye)},[u,S]),le=o.useCallback((se,ye)=>{m?.(se,ye)},[m]),U=o.useRef(null),[E,B]=o.useState(-1),$=o.useCallback((se,ye)=>{s?.(se,ye)},[s]);o.useLayoutEffect(()=>{T(i)},[i]),o.useLayoutEffect(()=>{D(f)},[f]);const R=o.useRef([]),L=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(se){R.current?.[se]?.startEdit()},cancel(se){R.current?.[se]?.cancel()}},L.current),[S,E]);const ee=o.useCallback(({value:se,index:ye,dragging:qe})=>{const{style:Me,maxLength:y,...Ae}=I||{},Ze=c.jsx(Vr,{ref:Le=>{R.current[ye]=Le},value:se,disabled:A,maxLength:y,style:{color:S===ye&&M?M?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Me},styleHover:{},onSubmit:Le=>(U.current=!1,B(-1),$(ye,Le)),onCancel:()=>{U.current=!1,B(-1)},onChange:Le=>{U.current=!0,B(ye)},...Ae});return k({onClick:Le=>G(Le,ye),value:se,index:ye,editing:E===ye&&U.current,editable:!0,disabled:A,selectedIndex:S,background:V,activeColor:M,borderColor:P,borderWidth:v,dragging:qe,children:Ze})},[S,$,G,I,A,E,k]),[ie,{width:Ce}]=Pt(),[Se,{width:he}]=Pt(),Te=o.useRef(null),[Ke,Ee]=o.useState({left:0,top:0,width:0,height:0}),[He,J]=o.useState(null);o.useEffect(()=>{He!==null&&Te.current&&Te.current.scrollTo({left:He,behavior:"smooth"})},[He]);const ne=o.useCallback((se,ye=!1)=>{if(!Te.current)return 0;let qe=Te.current.firstChild.getBoundingClientRect(),Me=Te.current.firstChild.firstChild.children,y=0;return y=ye?0:r.ScrollUtils.getScrollTo(se,qe.left,Me,!0,Math.max(0,se-200)),J(y),Math.max(0,y)},[]),pe=o.useCallback((se,ye=!1)=>{if(!Te.current)return 0;let qe=Te.current.firstChild.getBoundingClientRect(),Me=Te.current.firstChild.firstChild.children,y=0;const Ae=Math.ceil(he-Ce);return y=ye?Ae:r.ScrollUtils.getScrollTo(se,qe.left,Me,!1,Math.max(0,se+200)),J(y),Math.min(Ae,y)},[he,Ce]),De=o.useRef(null),Y=o.useRef(null),_=o.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null,De.current=null)},[]),ae=o.useCallback((se,ye,qe=260)=>{De.current=se,Y.current=setTimeout(()=>{const Me=ye?ne(De.current||se):pe(De.current||se);Me!==De.current?ae(Me,ye,120):_()},qe)},[ne,pe,_]);o.useEffect(()=>()=>_(),[_]);const ve=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Ke.left)<=0||Math.floor(he-Ce)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:_,onMouseLeave:_,onMouseDown:()=>ae(Te.current.scrollLeft,!0),onClick:se=>ne(Math.min(Te.current.scrollLeft,He??Number.MAX_SAFE_INTEGER),se.ctrlKey)}),[Ke,He,he,Ce]),ue=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(he-Ce)<=Math.ceil(Ke.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:_,onMouseLeave:_,onMouseDown:()=>ae(Te.current.scrollLeft,!1),onClick:se=>pe(Math.max(Te.current.scrollLeft,He??0),se.ctrlKey)}),[Ke,He,he,Ce]),ke=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,h?.(ve)]}),[ve,ue,q,p,n,h]);return c.jsxs("div",{style:{...l,display:"flex",alignItems:"stretch"},className:ut(Ma,a),ref:L,children:[c.jsx("div",{style:{borderTop:`solid ${P} ${v}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:ke}),c.jsx("div",{className:"Tabs",ref:ie,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Te,onScroll:se=>{Ee({left:se.target.scrollLeft,top:se.target.scrollTop,width:se.target.scrollWidth,height:se.target.scrollHeight})},children:c.jsx(Ra,{isDisabled:se=>A||K,items:W,strategy:ha,modifiers:[qa],ref:Se,renderItem:ee,renderDivider:b,onMove:le,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ue)})]})}));vl.displayName="TabStrip";const Un=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 fe.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const l=n.contributionPoints;if(l&&l.length!==0)for(let a of l)a.startsWith(e)&&t.push(n)}return t}},br=o.createContext(void 0),Fa={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},Xt={TaskPaneArea:"_TaskPaneArea_1j53w_5",TaskPaneTitle:"_TaskPaneTitle_1j53w_13",TaskPaneFrame:"_TaskPaneFrame_1j53w_36",TaskPaneStrip:"_TaskPaneStrip_1j53w_51",TaskPaneStripItem:"_TaskPaneStripItem_1j53w_59"},Ao=o.memo(o.forwardRef((e,t)=>{const{children:n,title:l,icon:a,onClose:i,readOnly:f,focused:u,style:s,className:m,...q}=e,p=o.useMemo(()=>ut("taskpane-title",m,Xt.TaskPaneTitle,{focused:u}),[m,u]);return c.jsxs("div",{ref:t,className:p,style:s,...q,children:[c.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:l}),c.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:h=>{h.stopPropagation()},onPointerUp:()=>{i()},children:c.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));Ao.displayName="TaskPaneTitle";const Aa=(e,t)=>c.jsx(Ao,{...e,ref:t}),Da=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:l,close:a,listenerContainer:i,model:f,commands:u,onMounted:s,onUnmounted:m,paneWrapper:q,paneProps:p,renderTaskPanelTitle:h=Aa,style:k,className:b,...I}=e,[A,K]=o.useState(null),[V,M]=o.useState(!1),P=r.useCallbackRef(a,[a]),v=o.useRef(null),S=o.useRef(null);o.useEffect(()=>(s?.(l),()=>{m?.(l)}),[l]);const T=o.useRef([]),W=o.useMemo(()=>({addListener:G=>{const le=i(G);return T.current.push(le),le},close:()=>{P?.()}}),[i]);o.useEffect(()=>()=>{for(const G of T.current)G();T.current=[]},[]);const D=o.useMemo(()=>(l.renderTaskPanelTitle??h)({title:l.getTitle(),icon:null,readOnly:!1,focused:V,onClose:P,onPointerDown:G=>{}},S),[l,V]),O=o.useMemo(()=>{let G=l.renderTaskPane({entryKey:l.key,model:f,commands:u,frame:W,...p},t);return q&&(G=q(G)),G},[l,f,u,t]);return c.jsxs("div",{className:ut("taskpane-frame",b,Xt.TaskPaneFrame),tabIndex:0,ref:v,style:k,onPointerDown:async G=>{G.currentTarget.focus()},onFocus:G=>{G.relatedTarget&&!A&&K(G.relatedTarget),M(!0)},onBlur:G=>{A&&!v?.current?.contains(G.relatedTarget)&&K(null),G.relatedTarget&&M(!1)},...I,children:[c.jsx("div",{style:{flex:"0 0 0%",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:D}),c.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 0",display:"flex",width:"100%",overflow:"hidden"},children:O})]})})),Do=o.memo(o.forwardRef((e,t)=>{const{children:n,title:l,taskPanes:a,onSelect:i,selected:f,registry:u=Un,style:s,className:m,...q}=e,p=o.useMemo(()=>a.map(b=>{const I=u.getRegisteredTaskPane(b);if(!I)return null;let A=I.getIcon?.();A&&(typeof A=="string"&&(A=c.jsx(r.DynamicIcon,{iconKey:A})),A=c.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:A}));const K=b===f;return c.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ut("taskpane-strip-item",Xt.TaskPaneStripItem,{selected:K}),onClick:()=>e.onSelect(b),children:[A,I.getTitle()]},b)}),[a,f,i,u]),h=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),k=o.useMemo(()=>ut("taskpane-strip",m,Xt.TaskPaneStrip),[m]);return c.jsx("div",{ref:h,className:k,style:s,...q,children:p})}));Do.displayName="TaskPaneStrip";const za=(e,t)=>c.jsx(Do,{ref:t,...e}),Na=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:l=Un,model:a,commands:i,onOpen:f,onClose:u,paneWrapper:s,paneProps:m,frameWrapper:q,frameProps:p,renderTaskPanelTitle:h,renderTaskPaneStrip:k=za,alwaysShowStrip:b,style:I}=e,A=r.useCallbackRef(f,[f]),K=r.useCallbackRef(u,[u]),[V,M]=o.useState(null),P=o.useRef(null),[v,S]=o.useState([]),T=o.useRef(new Set),W=r.useCallbackRef(async(B,$=!1)=>{const R=Array.from(T.current),L=R.length;let ee=!0;for(let ie=0;ee&&ie<L;ie++){const Ce=R[ie];if(Ce.onBeforeHide)try{await Promise.resolve(Ce.onBeforeHide())===!1&&(ee=!1)}catch{ee=!1}}return ee},[]),D=r.useCallbackRef(B=>{const $=Array.from(T.current),R=$.length;S(L=>{const ee=L.findIndex(Ce=>Ce.key===B);if(ee===-1)return L;const ie=[...L];return ie.splice(ee,1),ie.length===0?(M(null),K?.(),ie):(O(ie[Math.max(ie.length-1,ee-1)].key),ie)});for(let L=0;L<R;L++){const ee=$[L];try{ee.onHide?.()}catch{}}},[K]),O=r.useCallbackRef(async B=>{const $=l.getRegisteredTaskPane(B);if(!$)return void console.warn(`Invalid taskpane '${B}'`);if(P.current===B||V&&!await W(V.key))return;const R=o.createRef();let L=c.jsx(Da,{ref:()=>{P.current=null},entry:$,model:a,commands:i,close:async()=>{await W(B)&&D(B)},paneWrapper:s,paneProps:m,renderTaskPanelTitle:h,listenerContainer:ie=>(T.current.add(ie),()=>{T.current.delete(ie)}),onMounted:ie=>{ie.key===B&&(P.current=null),A?.()},onUnmounted:ie=>{},...p});q&&(L=q(L));const ee={key:B,elem:L,ref:R};S(ie=>{if(ie.findIndex(Se=>Se.key===B)!==-1)return ie;const Ce=[...ie];return Ce.push(ee),Ce}),M(ee),P.current=B},[V,q,s,h]);o.useEffect(()=>{V&&!P.current&&O(V.key)},[p,a]);const G=r.useImperativeElement(t,()=>({activateTaskPane:O}),[l,m,a,i]),le=o.useMemo(()=>v.map(B=>B.key),[v]),U=o.useMemo(()=>{if(le.length<=1&&!b)return null;const B={className:Xt.TaskPaneAreaStrip,taskPanes:le,selected:V?.key,onSelect:$=>{O($)},registry:l};return k(B,null)},[le,V,l,b]),E=V?.elem;return c.jsxs("div",{ref:G,className:ut("taskpane-area",n,Xt.TaskPaneArea),style:I,children:[E,U]})})),zn=o.createContext(null);zn.displayName="DocThemesContext";const La="_script-editor_iy654_5",Pa={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"},ja=o.lazy(()=>Promise.resolve().then(()=>require("./DUMrqwScitEHV91o.cjs")));let cn,dn,Ft=["define","require"],xr=!1,Nn="@0.7.6";Nn!=="@local"&&Nn!=="@0.0.0"||(Nn="");const Oa=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${Nn}/types/scripting.d.ts`,qr=async(e,t,n)=>{const l=e.getModel();if(!l)return;const a=await t.languages.typescript.getTypeScriptWorker(),i=await a(l.uri),f=await i.getNavigationTree(l.uri.toString()),u=e.getPosition();let s={...u};s.lineNumber=1,s.column=1;let m=!1;for(let I=u.lineNumber;I>=1;I--)if(l.getLineContent(I).trim()===""){const A=zo(f,l.getOffsetAt({lineNumber:I,column:1}),"function");if(!A||Va(A)){m=!0,s.lineNumber=I+1;break}{const K=A.spans[0].start;I=l.getPositionAt(K).lineNumber,s.lineNumber=I}}let q=n,p=!1;!m&&!q.startsWith(`
28
+ `)&&s.lineNumber>1&&(q=`
29
+ `+q,p=!0);let h=!1;l.getLineCount()>1&&(q.endsWith(`
30
30
 
31
- `)||(S+=`
31
+ `)||(q+=`
32
32
 
33
- `,h=!0));const E=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${S}`}];let x=null;i.pushEditOperations([],E,A=>(x=A[0].range,p&&x.startLineNumber++,h&&x.endLineNumber--,[new t.Selection(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn)])),e.setSelection({startLineNumber:x.endLineNumber,startColumn:x.endColumn,endLineNumber:x.startLineNumber,endColumn:x.startColumn})};function Ta(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function bo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,C=e.getPositionAt(l);a.push({name:i.text,type:Ta(n,i),lineNumber:C.lineNumber})}if(i.childItems)for(const l of i.childItems)bo(e,t,n,l,a);return a}function Io(e,t,n="function",i){const a=e.spans,l=a.length;for(let C=0;C<l;C++){const g=a[C];if(g.start<=t&&t<g.start+g.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const s of e.childItems||[]){const f=Io(s,t,n,i);if(f)return f}}return null}}function Ia(e){return e.kind==="comment"}const Ea=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:C,darkMode:g,loadingPanel:s,autoFocus:f=!0,onStatusChange:S,...p}=e,h=o.useRef(null),E=r.useCallbackRef(C,[C]),x=o.useRef(!1),A=o.useMemo(()=>({contains(re){if(!h.current)return;const te=h.current.editor;return te&&te.getDomNode()?.contains(re)},focus(){if(!h.current)return;const re=h.current.editor;return re&&re.getDomNode()?.focus()}}),[]),N=o.useMemo(()=>[new r.Command("help",A,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),K=o.useMemo(()=>{let re=null;const te=()=>A;return re=a?a.createChildGroup(te,"scriptEditor",!1):new r.CommandGroup(te,"scriptEditor"),re.addCommands(N,!0),re},[a,N]),P=r.useCommands(K,["executeSelectedScript","saveScripts"]),R=P[0],O=P[1],m=R?.context(),[q,T]=o.useState({message:"Loading",cursor:"",dirty:!1}),[$,I]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),k=r.useCallbackRef(re=>{T(te=>{const pe={...te,...re};return me.CommonUtils.deepEqual(pe,te)?te:(O.update({disabled:!pe.dirty}).updateCallback(async()=>{await Z()}),pe)})},[S,O]);o.useEffect(()=>{S?.(q)},[S,q]);const Z=r.useCallbackRef(async()=>{if(!h.current)return;const re=h.current.editor;let te;if(q.dirty){const pe=re.getValue();await m?.saveSource(pe),te=m?.getScripts().getModules().getByName("scripts");const Le=te?.getSource(),Y=re.getValue(),W=(Le?.length??0)!==pe.length||Le!==Y;k({dirty:W})}else te=m?.getScripts().getModules().getByName("scripts");return te},[q]);o.useEffect(()=>{const re=m?.getScripts();if(re)return re.addListeners({onBeforeSearch:()=>Z()})},[m]);const X=r.useCallbackRef(re=>{R?.execute(re)},[R]),B=o.useRef(""),[j,H]=o.useState(!1),J=r.useCallbackRef(async()=>{if(!h.current)return null;const re=h.current,te=re.editor;if(!te)return null;const pe=re.monaco,Le=await(async(Y,W,le="export")=>{const fe=Y.getModel();if(!fe)return null;const ce=await W.languages.typescript.getTypeScriptWorker(),Se=await ce(fe.uri),ie=await Se.getNavigationTree(fe.uri.toString());let ve=null,xe=Y.getSelection();const Re=xe.startLineNumber===xe.endLineNumber&&xe.startColumn===xe.endColumn?fe.getLineCount():Math.min(xe.endLineNumber,fe.getLineCount());for(let b=xe.startLineNumber;!ve&&b<=Re;b++){const Fe=Io(ie,fe.getOffsetAt({lineNumber:b,column:1}),"function",le);Fe&&(ve=Fe.text)}return ve})(te,pe);return k({message:(Le??"").toUpperCase()}),Le?{source:te.getValue(),name:Le}:null},[]);r.useCallbackRef(me.CommonUtils.debounce(Z,200),[]);const M=r.useCallbackRef(async(re,te,pe)=>{I(Y=>({...Y,compiling:!0}));const Le=await m?.getScripts().createModule({source:pe?.getValue(),declarationsOnly:!0});Le&&((async function(Y,W){const le=[];for(let fe=1;fe<Y.getLineCount()+1;fe++){const ce={startLineNumber:fe,startColumn:1,endLineNumber:fe,endColumn:Y.getLineLength(fe)+1},Se=Y.getValueInRange(ce).indexOf("modelt");Se!==-1&&le.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:W.MarkerSeverity.Hint,startLineNumber:ce.startLineNumber,startColumn:Se+1,endLineNumber:ce.startLineNumber,endColumn:Se+5})}W.editor.setModelMarkers(Y,"owner",le)})(re,te),(async function(Y,W,le,fe){const ce=await W.languages.typescript.getTypeScriptWorker(),Se=await ce(Y.uri),ie=await Se.getNavigationTree(Y.uri.toString()),ve=bo(Y,W,fe,ie).map(xe=>{let Re=null,b=null;return xe.type==="formula"?(Re="formula.margin-icon",b="Formula"):xe.type==="macro"?(Re="macro.margin-icon",b="Macro"):xe.type==="autoRun"&&(Re="autorun.margin-icon",b="Auto Run"),{range:new W.Range(xe.lineNumber,1,xe.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Re,glyphMarginHoverMessage:{value:b},stickiness:W.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ae.current&&ae.current.clear(),ae.current=le.createDecorationsCollection(ve)})(re,te,pe,Le?Le.getFunctions().getItems():me.CommonUtils.EmptyArray),I(Y=>({...Y,compiling:!1})))},[m]),U=r.useCallbackRef(me.CommonUtils.debounce(M,580),[]),ue=r.useCallbackRef(async(re=void 0)=>{if(!h.current||!m)return;const te=h.current.editor.getPosition(),pe={cursor:te?te.toString():""};re!==void 0&&(pe.message=re),k(pe);const Le=J();m.setSelectedFunction(Le)},[m]);o.useEffect(()=>{},[$]);const we=o.useRef(null),je=r.useCallbackRef(async()=>{await Z(),E?.()},[E]);o.useEffect(()=>{if(!m)return;const re={insertSnippet:pe=>{h.current?.editor&&vr(h.current.editor,h.current.monaco,pe)},close:()=>je()};m.setEditor(re),m.setSelectedFunction(J());const te=m.addContainerListener({onBeforeSave:async()=>{Z()},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!m)return;const pe=h.current.editor,Le=m.getScripts().getModules().getItems()[0]?.getSource()??"";pe.setValue(Le)}});return()=>{m.setEditor(null),te()}},[m]),o.useEffect(()=>()=>{const re=we.current;if(re){re.dispose();const te=re.debounceTimer;te!==void 0&&clearTimeout(te),we.current=null}},[j]);const Te=r.useCallbackRef(re=>{const te=h.current?.editor;return!!te&&(te.focus(re),!0)},[q]),ae=o.useRef(null),Me=r.useCallbackRef((re,te)=>{h.current={monaco:te,editor:re},H(!0),ue("Loading Types");const pe=m.getScripts().getModules().getItems()[0]?.getSource()??"";re.setValue(pe),Promise.resolve().then(()=>require("./CE955M-HEnxcgkwj.cjs")).then(Y=>Y.customEditor).then(async Y=>{ue(""),Y.AutoTypings.create(re,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:te,onUpdate:(W,le)=>{if(W.type==="LookedUpPackage"&&W.success!==void 0){const fe=te.languages.typescript.typescriptDefaults.getDiagnosticsOptions();te.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...fe,diagnosticCodesToIgnore:[]})}},onError:W=>{W==="Not implemented yet"&&(W="Compile Errors"),console.warn("Error compiling types",W)}}).then(W=>{we.current=W;const le=re.getModel();U(le,te,re),(()=>{if(pr)return;const fe=(Se,ie)=>{try{if(ie===void 0)try{delete globalThis[Se]}catch{try{globalThis[Se]=void 0}catch{}}else globalThis[Se]=ie}catch{}},ce=Ft.length;for(let Se=0;Se<ce;Se++){const ie=Ft[Se];fe(ie,sn[ie])}sn=void 0,pr=!0})()})}),re.addCommand("executeScript",function(Y,...W){W?.[0]&&X({functionName:W?.[0]})},""),re.addAction({id:"executeScript",label:"Execute",keybindings:[te.KeyCode.F8],run:async Y=>{const W=J();m.setSelectedFunction(W);const le=await W;X(le)}}),re.addAction({id:"saveScript",label:"Save Script",keybindings:[te.KeyMod.CtrlCmd|te.KeyCode.KeyS],run:Y=>{Z()}}),re.onMouseDown(async Y=>{if(Y.target.type===te.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const W=Y.target.position.lineNumber,le=await te.languages.typescript.getTypeScriptWorker(),fe=await le(Le.uri),ce=await fe.getNavigationTree(Le.uri.toString()),Se=(await Z()).getFunctions().getItems(),ie=bo(Le,te,Se,ce).find(ve=>ve.lineNumber===W);if(ie){const ve=Y.event.browserEvent.button;ve===0?ie.type==="macro"||ie.type==="autoRun"?X({functionName:ie.name}):ie.type==="formula"&&m.quickInsertFunction?.(ie.name):ve===2&&(console.log("Context menu for function:",ie.name),Y.event.browserEvent.preventDefault())}}}),re.onDidChangeModelContent(()=>{k({dirty:!0}),U(Le,te,re)}),te.editor.onDidChangeMarkers(Y=>{Y.some(W=>W.toString()===Le.uri.toString())});const Le=re.getModel();(function(Y,W){W.languages.registerInlayHintsProvider("typescript",{provideInlayHints(le,fe,ce){const Se=[];for(let ie=1;ie<le.getLineCount()+1;ie++){const ve={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:le.getLineLength(ie)+1},xe="hint",Re=le.getValueInRange(ve).indexOf("hint");Re!==-1&&Se.push({kind:W.languages.InlayHintKind.Type,position:{lineNumber:ve.startLineNumber,column:Re+xe.length+1},label:"[hint]"})}return{hints:Se,dispose:()=>{}}}})})(0,te),Le.onDidChangeContent(Y=>{const W=m?.getScripts().getModules().getByName("scripts"),le=W?.getSource(),fe=re.getValue(),ce=(le?.length??0)!==fe.length||le!==fe;k({dirty:ce})}),re.onDidChangeCursorPosition(Y=>{ue()})},[m]),Ke=o.useMemo(()=>j?null:s||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[j,s]),Ee=o.useMemo(()=>{if(!j){if(!sn){sn={};const te=Ft.length;for(let pe=0;pe<te;pe++){const Le=Ft[pe];sn[Le]=globalThis[Le]}}if(dn){const te=Ft.length;for(let pe=0;pe<te;pe++){const Le=Ft[pe];globalThis[Le]=dn[Le]}}}const re=m?.getScripts().getModules().getByName("scripts")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(Ma,{theme:g?"extended-dark":"extended",options:{...ka,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:re,onValidate:te=>{let pe=!1;const Le=te?te.length:0;for(let Y=0;!pe&&Y<Le;Y++)te[Y].severity===8&&(pe=!0)},beforeMount:te=>{te.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),te.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),te.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),te.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let pe=!1,Le=!1;try{const Y=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk@0.7.5/types/scripting.d.ts")).text())(),W=te.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let le=te.editor.getModel(W);le?Le=!0:le=te.editor.createModel(Y,"typescript",W),te.editor.setModelMarkers(le,"default",[]),pe=!0}catch(Y){console.warn("cant load types",Y)}if(te.languages.registerLinkProvider("*",{provideLinks:(Y,W)=>{const le=[],fe={links:le},ce=Y.getLinesContent(),Se=ce.length;for(let ie=1;ie<=Se;ie++){const ve=ce[ie-1],xe=te.editor.tokenize(ve,"typescript"),Re=xe[0].length;for(let b=0;b<Re;b++){const Fe=xe[0]?.[b];if(Fe&&Fe.type.startsWith("string")){let Ze=Fe.offset,ze=xe[0]?.[b+1]?.offset??ve.length,et=new te.Range(ie,Ze+1,ie,ze+1),oe=Y.getValueInRange(et);const ke=oe[0];ke!=="`"&&ke!=="'"&&ke!=='"'||(Ze++,oe=oe.substring(1));const Ae=oe[oe.length-1];Ae!=="`"&&Ae!=="'"&&Ae!=='"'||(Ze++,oe=oe.substring(0,oe.length-1));try{m.getRanges(oe)&&le.push({range:{endColumn:ze,endLineNumber:ie,startColumn:Ze,startLineNumber:ie},tooltip:`Goto range '${oe}'`,url:`/range/${oe}`})}catch(ye){console.warn(ye)}}}}return fe}}),te.editor.registerLinkOpener({open(Y){if(Y?.path?.startsWith("/range/")){try{m.getRanges(Y.path.substring(7))?.select()}catch(W){console.warn("invalid range",W)}return!0}return!1}}),!Le){const Y=te.languages.typescript.typescriptDefaults.getCompilerOptions();te.languages.typescript.typescriptDefaults.setCompilerOptions({...Y,target:te.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:te.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(B.current&&(await vr(h.current.editor,h.current.monaco,B.current),B.current=null),x.current&&requestAnimationFrame(async()=>{x.current&&te.editor.focus()}),!dn){dn={};const Y=Ft.length;for(let W=0;W<Y;W++){const le=Ft[W];dn[le]=globalThis[le]}}})()},onMount:Me})}),Ke]})},[m,K,l,Ke,g]),Ue=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:re=>{Te(re)},close:()=>je(),getEditor:()=>m?.getEditor()}),[m]);return o.useEffect(()=>(f&&requestAnimationFrame(()=>{Ue.current?.focus()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{Ue.current?.contains(document.activeElement)&&Ue.current?.focus()})}),[]),c.jsx("div",{className:yt("script-editor",Ra,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Ue,...p,children:Ee})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),c.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=ui,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),c.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),c.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),c.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),c.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),c.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),c.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),c.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),c.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),c.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),c.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),c.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),c.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),c.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),c.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),c.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),c.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=ci,exports.CornerTriangle=ho,exports.DateUtils=yl,exports.DocThemesContext=Dn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Dn.Provider,{value:t,children:n})},exports.EditableLabel=Nr,exports.EmptyFrame=ti,exports.FilterButton=br,exports.FontUtils=wl,exports.Item=To,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),c.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),c.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),c.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=kr,exports.MovableArea=Ir,exports.PictureEditor=zr,exports.Row=cl,exports.ScriptEditor=Ea,exports.SheetCellEditor=wr,exports.SheetCellRenderer=yr,exports.SheetElement=Dr,exports.SheetScrollbar=wo,exports.StaticBorderRenderer=Fl,exports.StyledStrokePath=qr,exports.Tab=dl,exports.TabStrip=ul,exports.createCellEditStateFromCell=xr,exports.useBordersOverlay=yo,exports.useDocThemes=()=>{const e=o.useContext(Dn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=Er,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const s={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(s)}const C=s=>{a.current?.(s)},g=e.getRange(t).addListener(C,i);if(l){const s=e.getRange(t);C({getSource:()=>s,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{g?.()}},[e,t])},exports.useSheetCommands=Mr,exports.useSheetCopyPaste=Tr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
33
+ `,h=!0));const k=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${q}`}];let b=null;l.pushEditOperations([],k,I=>(b=I[0].range,p&&b.startLineNumber++,h&&b.endLineNumber--,[new t.Selection(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn)])),e.setSelection({startLineNumber:b.endLineNumber,startColumn:b.endColumn,endLineNumber:b.startLineNumber,endColumn:b.startColumn})};function Ba(e,t){let n=null;const l=e.length;for(let a=0;!n&&a<l;a++){const i=e[a];i.getName()===t.text&&(n=i)}return n?n.getContext():"formula"}function xo(e,t,n,l,a=[]){if(l.kind==="function"&&l.kindModifiers==="export"){const i=l.spans[0].start,f=e.getPositionAt(i);a.push({name:l.text,type:Ba(n,l),lineNumber:f.lineNumber})}if(l.childItems)for(const i of l.childItems)xo(e,t,n,i,a);return a}function zo(e,t,n="function",l){const a=e.spans,i=a.length;for(let f=0;f<i;f++){const u=a[f];if(u.start<=t&&t<u.start+u.length){if(e.kind===n&&(!l||e.kindModifiers===l))return e;for(const s of e.childItems||[]){const m=zo(s,t,n,l);if(m)return m}}return null}}function Va(e){return e.kind==="comment"}const Ha=o.memo(o.forwardRef((e,t)=>{const{className:n,style:l,commands:a,readOnly:i=!1,darkMode:f,loadingPanel:u,autoFocus:s=!0,frame:m,onStatusChange:q,...p}=e,h=o.useRef(null),k=o.useRef(!1),b=o.useMemo(()=>({contains(J){if(!h.current)return;const ne=h.current.editor;return ne&&ne.getDomNode()?.contains(J)},focus(){if(!h.current)return;const J=h.current.editor;return J&&J.getDomNode()?.focus()}}),[]),I=o.useMemo(()=>[new r.Command("help",b,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),A=o.useMemo(()=>{let J=null;const ne=()=>b;return J=a?a.createChildGroup(ne,"scriptEditor",!1):new r.CommandGroup(ne,"scriptEditor"),J.addCommands(I,!0),J},[a,I]),K=a.getGroup("workbook"),V=r.useCommands(K,["executeSelectedScript","saveScripts"]),M=V[0],P=V[1],v=M?.context(),[S,T]=o.useState({message:"Loading",cursor:"",dirty:!1}),[W,D]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),O=r.useCallbackRef(J=>{T(ne=>{const pe={...ne,...J};return fe.CommonUtils.deepEqual(pe,ne)?ne:(P.update({disabled:!pe.dirty}).updateCallback(async()=>{await G()}),pe)})},[q,P]);o.useEffect(()=>{q?.(S)},[q,S]);const G=r.useCallbackRef(async()=>{if(!h.current)return;const J=h.current.editor;let ne;if(S.dirty){const pe=J.getValue();await v?.saveSource(pe),ne=v?.getScripts().getModules().getByName("scripts");const De=ne?.getSource(),Y=J.getValue(),_=(De?.length??0)!==pe.length||De!==Y;O({dirty:_})}else ne=v?.getScripts().getModules().getByName("scripts");return ne},[S]);o.useEffect(()=>{const J=m?.addListener({onBeforeHide:async()=>(await G(),!0)});return()=>{J?.()}},[m]),o.useEffect(()=>{const J=v?.getScripts();if(J)return J.addListeners({onBeforeSearch:()=>G()})},[v]);const le=r.useCallbackRef(J=>{M?.execute(J)},[M]),U=o.useRef(""),[E,B]=o.useState(!1),$=r.useCallbackRef(async()=>{if(!h.current)return null;const J=h.current,ne=J.editor;if(!ne)return null;const pe=J.monaco,De=await(async(Y,_,ae="export")=>{const ve=Y.getModel();if(!ve)return null;const ue=await _.languages.typescript.getTypeScriptWorker(),ke=await ue(ve.uri),se=await ke.getNavigationTree(ve.uri.toString());let ye=null,qe=Y.getSelection();if(!qe)return null;const Me=qe.startLineNumber===qe.endLineNumber&&qe.startColumn===qe.endColumn?ve.getLineCount():Math.min(qe.endLineNumber,ve.getLineCount());for(let y=qe.startLineNumber;!ye&&y<=Me;y++){const Ae=zo(se,ve.getOffsetAt({lineNumber:y,column:1}),"function",ae);Ae&&(ye=Ae.text)}return ye})(ne,pe);return O({message:(De??"").toUpperCase()}),De?{source:ne.getValue(),name:De}:null},[]);r.useCallbackRef(fe.CommonUtils.debounce(G,200),[]);const R=r.useCallbackRef(async(J,ne,pe)=>{D(Y=>({...Y,compiling:!0}));const De=await v?.getScripts().createModule({source:pe?.getValue(),declarationsOnly:!0});De&&((async function(Y,_){const ae=[];for(let ve=1;ve<Y.getLineCount()+1;ve++){const ue={startLineNumber:ve,startColumn:1,endLineNumber:ve,endColumn:Y.getLineLength(ve)+1},ke=Y.getValueInRange(ue).indexOf("modelt");ke!==-1&&ae.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:_.MarkerSeverity.Hint,startLineNumber:ue.startLineNumber,startColumn:ke+1,endLineNumber:ue.startLineNumber,endColumn:ke+5})}_.editor.setModelMarkers(Y,"owner",ae)})(J,ne),(async function(Y,_,ae,ve){const ue=await _.languages.typescript.getTypeScriptWorker(),ke=await ue(Y.uri),se=await ke.getNavigationTree(Y.uri.toString()),ye=xo(Y,_,ve,se).map(qe=>{let Me=null,y=null;return qe.type==="formula"?(Me="formula.margin-icon",y="Formula"):qe.type==="macro"?(Me="macro.margin-icon",y="Macro"):qe.type==="autoRun"&&(Me="autorun.margin-icon",y="Auto Run"),{range:new _.Range(qe.lineNumber,1,qe.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Me,glyphMarginHoverMessage:{value:y},stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});he.current&&he.current.clear(),he.current=ae.createDecorationsCollection(ye)})(J,ne,pe,De?De.getFunctions().getItems():fe.CommonUtils.EmptyArray),D(Y=>({...Y,compiling:!1})))},[v]),L=r.useCallbackRef(fe.CommonUtils.debounce(R,580),[]),ee=r.useCallbackRef(async(J=void 0)=>{if(!h.current||!v)return;const ne=h.current.editor.getPosition(),pe={cursor:ne?ne.toString():""};J!==void 0&&(pe.message=J),O(pe);const De=$();v.setSelectedFunction(De)},[v]);o.useEffect(()=>{},[W]);const ie=o.useRef(null),Ce=r.useCallbackRef(async()=>{await G(),m?.close()},[m]);o.useEffect(()=>{if(!v)return;const J={insertSnippet:pe=>{h.current?.editor&&qr(h.current.editor,h.current.monaco,pe)},close:()=>Ce()};v.setEditor(J),v.setSelectedFunction($());const ne=v.addContainerListener({onBeforeSave:async()=>{G()},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!v)return;const pe=h.current.editor,De=v.getScripts().getModules().getItems()[0]?.getSource()??"";pe.setValue(De)}});return()=>{v.setEditor(null),ne()}},[v]),o.useEffect(()=>()=>{const J=ie.current;if(J){J.dispose();const ne=J.debounceTimer;ne!==void 0&&clearTimeout(ne),ie.current=null}},[E]);const Se=r.useCallbackRef(J=>{const ne=h.current?.editor;return!!ne&&(ne.focus(J),!0)},[S]),he=o.useRef(null),Te=r.useCallbackRef((J,ne)=>{h.current={monaco:ne,editor:J},B(!0),ee("Loading Types");const pe=v?.getScripts().getModules().getItems()[0]?.getSource()??"";J.setValue(pe),Promise.resolve().then(()=>require("./DfFsABqSQZjPFzXN.cjs")).then(Y=>Y.customEditor).then(async Y=>{ee(""),Y.AutoTypings.create(J,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:ne,onUpdate:(_,ae)=>{if(_.type==="LookedUpPackage"&&_.success!==void 0){const ve=ne.languages.typescript.typescriptDefaults.getDiagnosticsOptions();ne.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ve,diagnosticCodesToIgnore:[]})}},onError:_=>{_==="Not implemented yet"&&(_="Compile Errors"),console.warn("Error compiling types",_)}}).then(_=>{ie.current=_;const ae=J.getModel();L(ae,ne,J),(()=>{if(xr)return;const ve=(ke,se)=>{try{if(se===void 0)try{delete globalThis[ke]}catch{try{globalThis[ke]=void 0}catch{}}else globalThis[ke]=se}catch{}},ue=Ft.length;for(let ke=0;ke<ue;ke++){const se=Ft[ke];ve(se,cn[se])}cn=void 0,xr=!0})()})}),J.addCommand("executeScript",function(Y,..._){_?.[0]&&le({functionName:_?.[0]})},""),J.addAction({id:"executeScript",label:"Execute",keybindings:[ne.KeyCode.F8],run:async Y=>{const _=$();v?.setSelectedFunction(_);const ae=await _;le(ae)}}),J.addAction({id:"saveScript",label:"Save Script",keybindings:[ne.KeyMod.CtrlCmd|ne.KeyCode.KeyS],run:Y=>{G()}}),J.onMouseDown(async Y=>{if(Y.target.type===ne.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const _=Y.target.position.lineNumber,ae=await ne.languages.typescript.getTypeScriptWorker(),ve=await ae(De.uri),ue=await ve.getNavigationTree(De.uri.toString()),ke=(await G()).getFunctions().getItems(),se=xo(De,ne,ke,ue).find(ye=>ye.lineNumber===_);if(se){const ye=Y.event.browserEvent.button;ye===0?se.type==="macro"||se.type==="autoRun"?le({functionName:se.name}):se.type==="formula"&&v?.quickInsertFunction?.(se.name):ye===2&&(console.log("Context menu for function:",se.name),Y.event.browserEvent.preventDefault())}}}),J.onDidChangeModelContent(()=>{O({dirty:!0}),L(De,ne,J)}),ne.editor.onDidChangeMarkers(Y=>{Y.some(_=>_.toString()===De.uri.toString())});const De=J.getModel();(function(Y,_){_.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ae,ve,ue){const ke=[];for(let se=1;se<ae.getLineCount()+1;se++){const ye={startLineNumber:se,startColumn:1,endLineNumber:se,endColumn:ae.getLineLength(se)+1},qe="hint",Me=ae.getValueInRange(ye).indexOf("hint");Me!==-1&&ke.push({kind:_.languages.InlayHintKind.Type,position:{lineNumber:ye.startLineNumber,column:Me+qe.length+1},label:"[hint]"})}return{hints:ke,dispose:()=>{}}}})})(0,ne),De.onDidChangeContent(Y=>{const _=v?.getScripts().getModules().getByName("scripts"),ae=_?.getSource(),ve=J.getValue(),ue=(ae?.length??0)!==ve.length||ae!==ve;O({dirty:ue})}),J.onDidChangeCursorPosition(Y=>{ee()})},[v]),Ke=o.useMemo(()=>E?null:u||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[E,u]),Ee=o.useMemo(()=>{if(!E){if(!cn){cn={};const ne=Ft.length;for(let pe=0;pe<ne;pe++){const De=Ft[pe];cn[De]=globalThis[De]}}if(dn){const ne=Ft.length;for(let pe=0;pe<ne;pe++){const De=Ft[pe];globalThis[De]=dn[De]}}}const J=v?.getScripts().getModules().getByName("scripts")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(ja,{theme:f?"extended-dark":"extended",options:{...Pa,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:J,onValidate:ne=>{let pe=!1;const De=ne?ne.length:0;for(let Y=0;!pe&&Y<De;Y++)ne[Y].severity===8&&(pe=!0)},beforeMount:ne=>{ne.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),ne.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),ne.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),ne.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let pe=!1,De=!1;try{const Y=await(async()=>await(await fetch(Oa)).text())(),_=ne.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let ae=ne.editor.getModel(_);ae?De=!0:ae=ne.editor.createModel(Y,"typescript",_),ne.editor.setModelMarkers(ae,"default",[]),pe=!0}catch(Y){console.warn("cant load types",Y)}if(ne.languages.registerLinkProvider("*",{provideLinks:(Y,_)=>{const ae=[],ve={links:ae},ue=Y.getLinesContent(),ke=ue.length;for(let se=1;se<=ke;se++){const ye=ue[se-1],qe=ne.editor.tokenize(ye,"typescript"),Me=qe[0].length;for(let y=0;y<Me;y++){const Ae=qe[0]?.[y];if(Ae&&Ae.type.startsWith("string")){let Ze=Ae.offset,Le=qe[0]?.[y+1]?.offset??ye.length,et=new ne.Range(se,Ze+1,se,Le+1),re=Y.getValueInRange(et);const Ie=re[0];Ie!=="`"&&Ie!=="'"&&Ie!=='"'||(Ze++,re=re.substring(1));const ze=re[re.length-1];ze!=="`"&&ze!=="'"&&ze!=='"'||(Ze++,re=re.substring(0,re.length-1));try{v.getRanges(re)&&ae.push({range:{endColumn:Le,endLineNumber:se,startColumn:Ze,startLineNumber:se},tooltip:`Goto range '${re}'`,url:`/range/${re}`})}catch(xe){console.warn(xe)}}}}return ve}}),ne.editor.registerLinkOpener({open(Y){if(Y?.path?.startsWith("/range/")){try{v.getRanges(Y.path.substring(7))?.select()}catch(_){console.warn("invalid range",_)}return!0}return!1}}),!De){const Y=ne.languages.typescript.typescriptDefaults.getCompilerOptions();ne.languages.typescript.typescriptDefaults.setCompilerOptions({...Y,target:ne.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:ne.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(U.current&&(await qr(h.current.editor,h.current.monaco,U.current),U.current=null),k.current&&requestAnimationFrame(async()=>{k.current&&ne.editor.focus()}),!dn){dn={};const Y=Ft.length;for(let _=0;_<Y;_++){const ae=Ft[_];dn[ae]=globalThis[ae]}}})()},onMount:Te})}),Ke]})},[v,A,i,Ke,f]),He=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:J=>{Se(J)},close:()=>Ce(),getEditor:()=>v?.getEditor()}),[v]);return o.useEffect(()=>(s&&requestAnimationFrame(()=>{He.current?.focus()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{He.current?.contains(document.activeElement)&&He.current?.focus()})}),[]),c.jsx("div",{className:ut("script-editor",La,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...l},ref:He,...p,children:Ee})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),c.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=vi,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),c.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),c.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),c.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),c.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),c.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),c.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),c.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),c.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),c.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),c.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),c.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),c.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),c.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),c.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),c.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),c.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),c.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),c.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=pi,exports.CornerTriangle=po,exports.DateUtils=kl,exports.DefaultTaskPaneRegistry=Un,exports.DocThemesContext=zn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(zn.Provider,{value:t,children:n})},exports.EditableLabel=Vr,exports.EmptyFrame=ai,exports.FilterButton=Rr,exports.FontUtils=Ml,exports.Item=Fo,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),c.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),c.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),c.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=Ar,exports.MovableArea=Nr,exports.PictureEditor=Br,exports.Row=pl,exports.ScriptEditor=Ha,exports.SheetCellEditor=Mr,exports.SheetCellRenderer=kr,exports.SheetElement=Or,exports.SheetScrollbar=So,exports.StaticBorderRenderer=Pl,exports.StyledStrokePath=Ir,exports.Tab=fl,exports.TabStrip=vl,exports.TaskPaneArea=Na,exports.TaskPaneProvider=({children:e,createArea:t,onUpdateArea:n,registry:l=Un})=>{const a=o.useRef(null),i=o.useRef(null),[f,u]=o.useState(null),[s,m]=o.useState(null),q=o.useMemo(()=>({activateTaskPane(h,k){i.current!==h&&(a.current?a.current.activateTaskPane(h,k):(u(h),p(h)))}}),[]),p=r.useCallbackRef(h=>{const k=t({registry:l,onClose:()=>{m(null),n?.(null)}},b=>{b&&m(b)});return n?.(k),k},[t,l,f]);return o.useEffect(()=>{s&&f&&(s.activateTaskPane(f,{focus:!0}),u(null))},[f,s]),o.createElement(br.Provider,{value:s??q},e)},exports.TaskPaneStrip=Do,exports.TaskPaneTitle=Ao,exports.createCellEditStateFromCell=Tr,exports.useBordersOverlay=qo,exports.useDocThemes=()=>{const e=o.useContext(zn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=Lr,exports.useRangeListener=(e,t,n,l)=>{const a=o.useRef(n);a.current=n;const i=l?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const s={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(s)}const f=s=>{a.current?.(s)},u=e.getRange(t).addListener(f,l);if(i){const s=e.getRange(t);f({getSource:()=>s,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{u?.()}},[e,t])},exports.useSheetCommands=Dr,exports.useSheetCopyPaste=zr,exports.useTaskPaneArea=()=>o.useContext(br)||Fa,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});