@sheetxl/react 0.7.20 → 0.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,33 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._TaskPaneArea_6dmgk_5{position:absolute;height:100%;width:100%;display:flex;flex-direction:row}._TaskPaneTitle_6dmgk_13{display:flex;box-sizing:border-box;flex:1 1 0;flex-direction:row;align-items:center;font-size:1.25rem;height:100%;width:100%;padding:8px 16px;border-bottom:solid rgba(0,0,0,.2) 1px}._TaskPaneTitle_6dmgk_13 .title{opacity:.87}._TaskPaneTitle_6dmgk_13.focused .title{opacity:1}._TaskPaneFrame_6dmgk_36{display:flex;position:relative;flex-direction:column;width:100%;box-sizing:border-box;flex:1 1 0;min-height:0;align-items:stretch;justify-content:stretch;margin-bottom:4px;border-radius:4px;overflow:hidden}._TaskPaneStrip_6dmgk_52{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:2px}._TaskPaneStripItem_6dmgk_60{display:flex;flex-direction:row;align-items:center;padding:4px;border-radius:4px;border:grey solid 1px}._TaskPaneStripItem_6dmgk_60.selected{font-weight:700}._sheet-scrollbar_104cg_1{margin-left:2px;margin-bottom:1px;align-items:center}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  "use strict";/**
3
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.7.20
3
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.7.21
4
4
  *
5
5
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
6
  * License: The license can be found at https://www.sheetxl.com/license.
7
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ge=require("@sheetxl/utils"),o=require("react"),ht=require("@sheetxl/grid-react"),Ht=require("react-dom"),uo=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:h,pathProps:s,style:y,...b}=e,w=a,m=l;let M="red",T=[],P=[];return t===ge.AnchorLocation.TopLeft?(M=f?"rgb(255, 198, 246)":"green",T.push(m),P.push(m),T.push(m+w),P.push(m),T.push(m),P.push(m+w)):t===ge.AnchorLocation.TopRight?(M=f?"rgb(0, 255, 255)":"red",T.push(n-m),P.push(m),T.push(n-(m+w)),P.push(m),T.push(n-m),P.push(m+w)):t===ge.AnchorLocation.BottomRight?(M=f?"rgb(236, 252, 211)":"purple",T.push(n-m),P.push(i-m),T.push(n-(m+w)),P.push(i-m),T.push(n-m),P.push(i-(m+w))):t===ge.AnchorLocation.BottomLeft&&(M=f?"rgb(255, 236, 183)":"blue",T.push(m),P.push(i-m),T.push(m+w),P.push(i-m),T.push(m),P.push(i-(m+w))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...y},...b,children:c.jsx("path",{d:`M ${T[0]} ${P[0]} L ${T[1]} ${P[1]} L ${T[2]} ${P[2]} L ${T[0]} ${P[0]} Z`,fill:h??M,...s})})}),ur=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:h,...s}=e,y=o.useMemo(()=>{let M=null;const T=l.getSortField();T&&(M=T.reverse);const P=l.getField(),z=P&&P.criteria&&P.criteria.length>0;return M===!0?z?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":M===!1?z?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":z?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[l]),[b,w]=o.useState(!1),m=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${m}px`,height:`${m}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${b&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(m>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...h},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),onMouseDown:M=>{f?.(M,l),M.preventDefault()},...s,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${b&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:y})})})},gr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:h=1,view:s,bodyStyle:y,normalStyle:b,showFormulas:w,showZeros:m,docTheme:M,onLinkMouseDown:T,onFilterButtonMouseDown:P,filterButtonProps:z,createFilterButton:_=ur,...H}=e,x=i.height/h,B=i.width/h,p=t,A=p.getValue(),S=t.getStyle(),U=y?.darkMode??!1;let D,j;const K=A&&A.isFormulaError,pe=K&&A instanceof d.FormulaError.Parse;let Z,V=w||pe;if(V)if(p.isSpillOverflow())j="";else{const De=p.getFormulaText();De?j=De:D=p.getNumberFormat(d.NumberFormat.Type.General)}else D=p.getNumberFormat();V||(Z=p.getTextOverflow());const N=Z?Z.colBounds.width+Z.leftOffset+Z.rightOffset:B,F=Z?Z.anchorBounds.x-Z.leftOffset:0,k=Z?Z.anchorBounds.width:B,O=Z?Z.anchorBounds.x:0;let ee,oe=p.getRenderHorizontalAlignment();D&&(ee=D?.formattedRuns,j=ee?.runs[0]?.text??D.displayText);const be=p.getCalcStatus()===d.ICell.CalcStatus.Pending;let he=null,Ee=S.getFill().toCSS(U,i),Ae=0,We=0;if(!S.getBorder().isEmpty()){const De=S.getBorder().getRight();!De.isNone()&&d.IBorder.BuiltInDefinitions.get(De.getStyle()).width>1&&(Ae=1);const I=S.getBorder().getBottom();!I.isNone()&&d.IBorder.BuiltInDefinitions.get(I.getStyle()).width>1&&(We=1)}let ve=null;if(B!==k||Ae||We||typeof Ee?.backgroundPosition=="number"){const{backgroundPosition:De,...I}=Ee,Q=De??0,L=s?.getScrollTopLeft(),$=Q?-(i.x+(L.left??0))%Q:0,xe=Q?-(i.y+(L.top??0))%Q:0;(De!==void 0||Ae||We||B!==k)&&(Object.keys(I).length===1&&I.background==="none"||(Ee=null,ve=c.jsx("div",{className:"fill",style:{marginLeft:`${$}px`,marginTop:`${xe}px`,left:O*h,width:r.ReactUtils.boundPixel(k*h-$+1+Ae),height:r.ReactUtils.boundPixel(i.height-xe+1+We),...I}},"background")))}let He=null;const Y=p.getComments(),X=p.getWarnings(),de=p.getErrors();if(Y||K||de.length>0||X.length>0){const De={size:7*h,darkMode:U,cellWidth:k*h+2,cellHeight:x*h+2,style:{top:-1,left:O*h-1}};He=He??[],(X.length>0||de.length>0||K)&&He.push(c.jsx(uo,{anchorLocation:ge.AnchorLocation.TopLeft,...De},`indicator-${He.length}`)),Y&&He.push(c.jsx(uo,{anchorLocation:ge.AnchorLocation.TopRight,...De},`indicator-${He.length}`))}const Me=S.getFont();let G=D?.conditionalColor;const W=S.getAlignment(),re=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,me=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||re,se=me||V?0:W.getRotation(),Se=p.getInsets(),ie=Se.top+Se.bottom;let we=Se.left,ke=Se.right;const Re={...l,left:l.left-1,top:l.top-1,width:l.width+1+Ae,height:l.height+1+We},Le=p.getColumnFilter(),Ne=Le&&!Le?.hasHiddenButton();let v=null;be&&(v=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const Oe=!(be||Ne||ve||a||He||ee?.runs.length>1||Z||se%360!=0);Ee?.background==="none"&&(Ee=null);let tt=me||!(!Z||!(Z.rightIndex>0||Z.leftIndex>0||Z.colSpan>1));if(!tt){const De=p.getSpans();(De.width>1||De.height>1)&&(tt=!0)}const te={...Ee,...Re,pointerEvents:T?"auto":void 0};if(!ge.CommonUtils.isEmpty(j)||!ge.CommonUtils.isEmpty(D?.repeatPlaceholder)){const De=D?.canWrap??!1;let I=null,Q=null,L=null,$=[],xe=!0;m||V||A!==0||(xe=!1);const Ce=p.getTextFrame(V);if(xe&&Ce){let g=N-1-(we+ke);if(se){I=Ce.layout().bounds;const ae={x:0,y:0,width:N-1,height:x};if(ee){let ue=ee.width;if(D.repeatPlaceholder||D.repeatChars.length>0){const ye=d.GeomUtils.boundsToPoints(ae),Be=d.GeomUtils.rotatePoints(ye,-se);ue=d.GeomUtils.minBoundingRect(Be).width}I={...I,width:ue}}L=d.GeomUtils.clipToOuterRect({...I,width:I.width+1+we+ke},ae,se),g=L.width-1-(we+ke)+.01}let C=null;De&&(C={width:g});let R=null,u=D?.repeatPlaceholder;const q=Ce.layout(C);if(I=q.bounds,V?I={...I,width:0}:ee&&(I={...I,width:D.repeatPlaceholder||D.repeatChars.length>0?g:ee.width}),se&&De){let ne=null;q.visitLines({visitTextLine:(ae,ue)=>{let ye=ae.bounds;const Be=d.GeomUtils.boundsToPoints(ye),Ie=d.GeomUtils.rotatePoints(Be,se),Fe=d.GeomUtils.minBoundingRect(Ie);ye={...ye,x:(Fe.width-ye.width)/2,y:(Fe.height-ye.height)/2},ne=ne?d.GeomUtils.unionBounds(ne,ye):ye}}),I={...ne,width:ne.width+we+ke}}if(!u&&p.getType()!==d.ScalarType.String&&Math.floor(I.width)>g){if(S.getNumberFormat()==="General"&&p.getType()===d.ScalarType.Number){const ne=S.measureText("0"),ae=Math.floor(g/ne.width),ue=A,ye=ge.CommonUtils.splitNumber(ue),Be=Math.min(10,ae-(Math.max(1,ye.ipLength)+1)-(ue<0?1:0));if(Be>=-1){const Ie=`0${Be>0?".":""}${"#".repeat(Math.max(0,Be))}`;R=p.getNumberFormat(Ie).displayText,R==="0"&&ue<0&&(R="-0")}else if(Math.abs(ue)>=Math.pow(10,5)||Math.abs(ue)<=Math.pow(10,-5)){const Ie=ae-5-(ue<0?1:0);if(Ie>=0){const Fe=`0.${"0".repeat(Math.max(0,Ie-1))}E+00`;R=p.getNumberFormat(Fe).displayText}}}R||(u="#")}if(!u&&ee?.lastRepeatIndex>=0&&ee?.width>g&&(u="#"),u&&g>0){const ne=S.measureText(u),ae=Math.floor((g||1)/(ne?.width||1));R=ae>0?u.repeat(ae):"",oe=d.ITextFrame.HorizontalAlignment.Center}if(V&&(oe=d.ITextFrame.HorizontalAlignment.Left),R){const ne=S.measureText(R).width;ne&&(I={...I,width:ne})}if(Q={...I,width:I.width+we+ke,height:I.height},se&&!De){const ne=d.GeomUtils.boundsToPoints(Q),ae=d.GeomUtils.rotatePoints(ne,se),ue=d.GeomUtils.minBoundingRect(ae);Q.width=ue.width,Q.height=ue.height}oe===d.ITextFrame.HorizontalAlignment.Center||oe===d.ITextFrame.HorizontalAlignment.CenterContinuous?Q.x=(N-Q.width)/2:oe===d.ITextFrame.HorizontalAlignment.Right?Q.x=N-Q.width-.5:Q.x=.5,W.getVertical()===d.ITextFrame.VerticalAlignment.Center?Q.y=(x-Q.height)/2:W.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?Q.y=x-Q.height-ie:Q.y=ie;const E=Oe?{...H}:void 0,le={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:se?`rotate(${se}deg)`:void 0,cursor:T?"pointer":void 0,pointerEvents:T?"auto":void 0,zIndex:tt?1:void 0,...Ee},onMouseDown:T,onDoubleClick:T?ne=>{ne.stopPropagation(),ne.preventDefault()}:null,...E};pe&&(le.style.textDecorationStyle="wavy",le.style.textDecorationColor=U?"rgb(0, 255, 255)":"red",le.style.textDecorationLine="underline");const fe=Me.getSize(),ce=(ne,ae,ue,ye,Be,Ie,Fe,Ue=null)=>{let _e=fe*h,$e=ue,Ye=Fe?.runs?Fe.runs:[{type:d.NumberFormat.ParseRunType.Text,text:ne,width:S.measureText(ne,_e).width}];Fe&&Fe?.width!==I.width&&(I={...I,width:Fe?.width});let Je=we;if(Fe?.lastRepeatIndex>=0&&g>Fe?.width){const nt=Fe.runs[Fe.lastRepeatIndex];if(nt){const at=[...Ye],Tt=Math.max(0,g-1-Fe.width);let kt=0,yt="";if(Tt>0){const wt=Math.floor(Tt/nt.width);yt=wt>0?nt.text.repeat(wt):"",kt=Tt}at[Fe.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:yt,width:kt},Ye=at,I={...I,width:Fe.width+kt}}}const je=(nt,at,Tt,kt,yt,wt,ct,rt,Rt,ft=null)=>{let Ct,zt=$e.width;Be===d.ITextFrame.HorizontalAlignment.Justify?(zt=yt,Ie||(Ct="justify")):Be===d.ITextFrame.HorizontalAlignment.Distributed&&(zt=yt,Ct=Ie||nt.text.split(" ").length-1==0?"center":"justify");const{style:qt,className:Kt,...ut}=ft;let Nt=nt.text;if(Be===d.ITextFrame.HorizontalAlignment.Fill&&D?.repeatChars.length===0){const gt=Math.max(1,Math.floor(($e?.width??0)/(ct?.width??1)));Nt=Nt.repeat(gt)}let tn=$e.height;const At=Me.getVerticalAlignment(),jt=At===d.IFont.VerticalAlignment.Sub,vn=At===d.IFont.VerticalAlignment.Super;if(jt||vn){const gt=Me.getSuperSubScale();_e*=gt,tn*=gt}const ot={textAlign:Ct,textAlignLast:Ct,...qt,...Me.toCSS(U,h,!0),fontSize:_e*d.IFont.getDeviceScale()};Oe||(ot.background=void 0),G&&(ot.color=G.toCSS(U));const Cn=Je+at;let Wt=Se.top+$e.y+0;if(jt&&(Wt+=Rt-_e),wt){const gt=(ct.x+Cn)*h+1,bt=(ct.y+Wt)*h+1;bt<0?ot.marginTop=bt:ot.paddingTop=bt,gt<0?(ot.width=(qt?.width??0)-gt,ot.left=(qt?.left??0)+gt):ot.paddingLeft=gt,ot.paddingRight=Math.max(0,(qt?.width??0)-zt*h-gt),ot.paddingBottom=Math.max(0,(qt?.height??0)-$e.height*h-bt),ot.height=(qt?.height??0)+(bt<0?-bt:0),(bt<0||gt<0)&&(ot.clipPath=`inset(${bt<0?-bt:0}px 0px 0px ${gt<0?1-gt:0}px)`)}else if(ot.left=(ct.x+Cn)*h+1,ot.top=(ct.y+Wt)*h+1,ot.width=ct.width*h,ot.height=ct.height*h,se&&!De){ot.left=(ct.x+at)*h+1,ot.top=(ct.y+($e.y+0))*h+1;const gt=d.GeomUtils.centerPoint({x:Je+at,y:0,width:nt.width,height:$e.height}),bt=d.GeomUtils.centerPoint({x:Je,y:0,width:yt,height:$e.height}),yn=d.GeomUtils.rotatePoints([gt],se,bt),wn={x:yn[0].x-gt.x,y:yn[0].y-gt.y};ot.left=ot.left+wn.x*h,ot.top=ot.top+wn.y*h;const Ot={...$e,x:Je,y:Se.top,width:$e.width+(we+ke)},bn=d.GeomUtils.boundsToPoints(Ot),$n=d.GeomUtils.rotatePoints(bn,se),xn=d.GeomUtils.minBoundingRect($n);Ot.width=xn.width,Ot.height=xn.height;const qn=d.GeomUtils.centerPoint(Ot),$t={x:qn.x-bt.x,y:qn.y-bt.y};ot.left=ot.left+$t.x*h,ot.top=ot.top+$t.y*h}ot.lineHeight=tn*h+"px";const nn=Oe?void 0:"text-line";$.push(c.jsx("div",{className:Kt?`${Kt} ${nn}`:nn,style:ot,...ut,children:Nt},`text-${$e.y}-${kt}-${Tt}`))};if(W.getOverflow()===d.ITextFrame.Overflow.Shrink&&g>0){let nt=I?.width??0,at=0;for(;nt>1&&nt>g&&_e>2&&at<100;)_e*=g/nt,nt=S.measureText(ne,_e).width,at++;I={...I,width:nt}}let Xe=$e.x;Be===d.ITextFrame.HorizontalAlignment.Right?Xe+=I.width-$e.width:Be!==d.ITextFrame.HorizontalAlignment.Center&&Be!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(Xe+=(I.width-$e.width)/2),Fe?.lastRepeatIndex>=0&&(Xe=$e.x);const vt=Ye.length;for(let nt=0;nt<vt;nt++){const at=Ye[nt];(at.type===d.NumberFormat.ParseRunType.Text||at.type===d.NumberFormat.ParseRunType.Repeat)&&(at.type,d.NumberFormat.ParseRunType.Repeat,je(at,Xe,nt,ae,Be===d.ITextFrame.HorizontalAlignment.Justify||Be===d.ITextFrame.HorizontalAlignment.Distributed||Fe?.lastRepeatIndex>=0?g:$e.width,Oe,{x:Q.x+F,y:Q.y,width:at.width,height:I.height},0,ye,Ue)),Xe+=at.width}};R?ce(R,0,{x:0,y:0,...I},q.lines[0].baseline,oe,!0,null,le):q.visitLines({visitTextLine:(ne,ae,ue)=>{const ye=ne.runs[0].text.replace(/\s+$/,""),Be=ae===ue-1;let Ie=oe===d.ITextFrame.HorizontalAlignment.Justify&&(Be||ne.runs[0].text.endsWith(`
8
- `))?d.ITextFrame.HorizontalAlignment.Left:oe,Fe=0;ae>0&&(W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||W.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Fe=Math.max(0,(x-(ie+3)-ne.bounds.height*ue)/(ue-1)*ae)),W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&se&&se%90==0&&se%180!=0&&(Ie=d.ITextFrame.HorizontalAlignment.Distributed),Ie!==d.ITextFrame.HorizontalAlignment.Justify&&Ie!==d.ITextFrame.HorizontalAlignment.Distributed&&Ie!==d.ITextFrame.HorizontalAlignment.Fill||(I={...I,width:g});let Ue=re||D&&(D.repeatChars.length>0||D.spacingChars.length>0)?I.width:ne.bounds.width;const _e={...ne.bounds,y:ne.bounds.y+Fe+0,width:Ue};ce(ye,ae,_e,Ce.lines[0].baseline,Ie,Be,ue===1?ee:null,Oe&&ae>0?{...le,style:{...le.style,background:void 0}}:le)}})}$.length>0&&(he=$)}if(Oe)return he&&he.length>0?he:c.jsx("div",{style:te,...H});let Te=T?"auto":Re.pointerEvents,Pe=null;if(Ne){const De={x:O*h-1,y:-1,width:k*h+1,height:x*h+1};Te="auto",Pe=_({renderBounds:De,darkMode:U,className:"filter-button",disabled:!p.isEditAllowed(),zoom:h,filter:p.getColumnFilter(),onFilterButtonMouseDown:P,...z}),Pe&&(Pe=c.jsx("div",{style:{...De,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:I=>{I.stopPropagation(),I.preventDefault()},children:Pe},"filterButton"))}be&&!he&&(he=c.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ze=[ve,he,a,He,v,Pe];return c.jsx("div",{style:{...Ee,...Re,pointerEvents:Te},...H,children:ze})},Do={text:"",placeholder:""},zo=(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)))},fl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),hr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:f,onDoneEdit:h,defaultTextStyle:s,useRichStyling:y=!0,bodyStyle:b,activeCoords:w,sheet:m,commands:M,containerBounds:T,setNaturalSize:P,onFocus:z,disabled:_,style:H,zoom:x=1,linesVisible:B,autoFocus:p=!1,...A}=e,{height:S=0,width:U=0}=T??{},D=b?.darkMode??!1,j=o.useRef(null),[K,pe]=o.useState(!1),[Z,V]=o.useState(null),[N,F]=o.useState(()=>n);o.useEffect(()=>{We.current=!1,F(n)},[n]);const k=o.useMemo(()=>{const I=N.clean();let Q=I.getStyle();y||(Q=Q.createTemporaryStyle({font:{size:s?.fontSize}}));const L=I.getFormula(),$=Q.getAlignment(),xe=L?d.ITextFrame.HorizontalAlignment.Left:$.getHorizontal(),Ce=$.getVertical(),g=$.getOverflow()===d.ITextFrame.Overflow.Wrap||I.getType()===d.ScalarType.String&&(xe===d.ITextFrame.HorizontalAlignment.Justify||xe===d.ITextFrame.HorizontalAlignment.Distributed||Ce===d.ITextFrame.VerticalAlignment.Justify||Ce===d.ITextFrame.VerticalAlignment.Distributed),C=(q=>{if(!q)return Do;const E=q.clean();if(!E)return Do;let le=E.getStyle()?.getQuotePrefix();if(q.dirty===void 0||q.dirty===null){let fe="",ce=E.getFormulaText();ce&&(fe=ce,le=!1),fe||(fe=E.toTextUnformatted(!0)??"");let ne="";if(!q.editMode&&E.isSpillOverflow()){const ae=E.getSpill();if(ae){const ue=ae.getCell(),ye=ue.getFormulaText();ue.isEqual(E)||(ne=ye)}}return le&&(fe="'"+fe),{text:fe,placeholder:ne}}return{text:q.dirty??"",placeholder:""}})(N),R=C.text,u=d.ITextFrame.toCSSHorizontalTextAlign(y&&!L?N.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:Q,isWrapped:g,textValue:R,formula:L,frameVertAlign:Ce,placeholder:C.placeholder,insets:y?I.getInsets():ge.TypesUtils.EmptyRect,textAlign:u}},[N,s,D,x,y]),O=o.useRef(null),ee=r.useImperativeElement(t,()=>({startEdit:I=>{j.current=I?.initialSelection;const Q={...n,editMode:I?.editMode??!1};I?.text!==void 0&&(Q.dirty=I.text),Q.editMode===n.editMode&&Q.dirty===n.dirty||(F(Q),he?.(Q))},submitEdit:()=>ve(),cancelEdit(){He()},autoFocus(){O.current.focus()},dispatchEvent:I=>O.current.dispatchEvent(I),focus(){O.current.focus()},getLineHeight:be}),[i,n]);o.useLayoutEffect(()=>{if(!Z||!K)return;const I=O.current;k.textValue,I&&I.setSelectionRange(Z.start,Z.end,Z.direction)},[O.current,Z,k.textValue]);const oe=o.useMemo(()=>{const I=N?.clean(),Q=k.style.createTemporaryTextFrame(k.textValue,I?.getType()===d.ScalarType.String),L=y?I.getInsets().right+I.getInsets().left:0;let $=null;return k.isWrapped&&($={width:U-L}),Q.layout($)},[k,U,N,y]),be=r.useCallbackRef(()=>Math.ceil(oe?.lines[0]?.bounds.height),[oe]);o.useLayoutEffect(()=>{if(!oe)return;const I=k.style,Q=I.getInsets()??ge.TypesUtils.EmptyRect,L=y?Q.left+Q.right:0,$=y?.04*I.getFont().getSize():1,xe=Math.round(k.isWrapped?void 0:oe.bounds.width+L+$),Ce=Math.round(oe.bounds.height);P?.({width:xe,height:Ce})},[oe,P,k,y,N]);const he=r.useCallbackRef(a,[a]),Ee=r.useCallbackRef(I=>{if(N.dirty===I)return;const Q={...N};Q.dirty=I,O.current,F(Q),he?.(Q)},[N]),Ae=r.useCallbackRef(I=>{if(N.editMode===I)return;const Q={...N};Q.editMode=I,F(Q),he?.(Q)},[N]),We=o.useRef(!1),ve=r.useCallbackRef(()=>{if(We.current)return!1;try{l?.(N),h?.(),We.current=!0}catch{return!1}return!0},[l,N]),He=r.useCallbackRef(()=>{We.current=!0,F(n),f?.(),h?.()},[f,n]),Y=r.useCallbackRef(I=>{if(!O.current)return;if(I.key,I.isDefaultPrevented(),!(I.isTrusted||I.nativeEvent.ctrlKey||I.nativeEvent.metaKey||I.nativeEvent.altKey||I.nativeEvent.isComposing||ht.STANDARD_KEY_CHARS.indexOf(I.nativeEvent.key)===-1&&I.nativeEvent.key!=="Backspace")){const C={...N};let R=0;return zo(C,C.dirty)&&!isNaN(parseFloat(I.key))?(C.dirty?.endsWith("%")?C.dirty=(C.dirty.substring(0,C.dirty.length-1)??"")+I.key+"%":C.dirty=(C.dirty??"")+I.key+"%",R=C.dirty.length-1):I.nativeEvent.key==="Backspace"?(C.dirty="",R=C.dirty.length):(C.dirty=(C.dirty??"")+I.key,R=C.dirty.length),O.current.value=C?.dirty,j.current={start:R,end:R,direction:"forward"},O.current?.setSelectionRange(R,R,"forward"),F(C),he?.(C),void I.preventDefault()}const Q=I.nativeEvent.ctrlKey,L=I.nativeEvent.shiftKey,$=I.nativeEvent.altKey,xe=I.nativeEvent.metaKey;if(Q&&I.key==="z"&&I.stopPropagation(),I.which===r.KeyCodes.Escape)return I.preventDefault(),void He();if(I.which===r.KeyCodes.F2)return Ae(!0),void I.preventDefault();const Ce=I.target;if(I.key==="%"&&Ce.selectionStart===Ce.selectionEnd&&Ce.value[Ce.selectionStart]==="%"&&N?.clean().getStyle().numberFormat.includes("%"))return V({start:Ce.selectionStart+1,end:Ce.selectionEnd+1,direction:Ce.selectionDirection}),void I.preventDefault();if(I.which===r.KeyCodes.Enter){if(I.preventDefault(),xe||$){const C=k.textValue.substring(0,Ce.selectionStart)+`
9
- `+k.textValue.substring(Ce.selectionEnd);return Ee(C),void V({start:Ce.selectionStart+1,end:Ce.selectionStart+1,direction:Ce.selectionDirection})}return void(ve()&&m.getSelection().traverse(d.IRange.Orientation.Column,L))}if(I.which===r.KeyCodes.Tab)return I.preventDefault(),void(ve()&&m.getSelection().traverse(d.IRange.Orientation.Row,L));let g=null;switch(I.which){case r.KeyCodes.Left:g=d.IRange.Direction.Left;break;case r.KeyCodes.Right:g=d.IRange.Direction.Right;break;case r.KeyCodes.Up:g=d.IRange.Direction.Up;break;case r.KeyCodes.Down:g=d.IRange.Direction.Down}if(g&&!(Q||L||$||xe)&&!N.editMode)return void ve();N.editMode&&(g||fl.includes(I.which))&&I.stopPropagation()},[N,m,k]),X=o.useCallback(()=>{O.current?.focus(),setTimeout(()=>{O.current?.select()},0)},[]),de=o.useCallback(()=>{O.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Me=r.useCallbackRef(()=>{const I=O.current?.value;let Q="";if(w.rowIndex>0){const L=m.getRange({rowIndex:w.rowIndex-1,colIndex:w.colIndex}).getCell();L&&(Q=L.toTextUnformatted(!0))}Ee(I+Q)},[w,m]);o.useEffect(()=>m.getRange(w).addListener(()=>{const I={...N,clean:()=>m.getRange(w).getCell()};F(I),he?.(I)}),[w,m,N]);const G=o.useCallback(()=>{const I=N.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();Ee((O.current?.value??"")+I)},[m]),W=o.useCallback(()=>{const I=N.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();Ee((O.current?.value??"")+I)},[m]),re=o.useMemo(()=>({element:()=>O.current,doCopy:I=>{const Q=O.current.value.substring(O.current.selectionStart,O.current.selectionEnd);if(I?.isCut){const L=O.current.value.substring(0,O.current.selectionStart)+O.current.value.substring(O.current.selectionEnd,O.current.value.length);Ee(L)}return Q}}),[O.current]),me=o.useMemo(()=>({element:()=>O.current,doPaste:async(I,Q)=>{const L=await I.toText?.();if(!L)return!0;const $=O.current.value.substring(0,O.current.selectionStart)+L+O.current.value.substring(O.current.selectionEnd,O.current.value.length);return Ee($),V({start:O.current.selectionStart+L.length,end:O.current.selectionStart+L.length,direction:"forward"}),!0}}),[O.current]),se=o.useMemo(()=>({contains:I=>O.current?.contains(I)||!1,focus(){O.current.focus()}}),[]),Se=o.useMemo(()=>[new r.SimpleCommand("selectAll",se,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},X),new r.SimpleCommand("startEditValueAbove",se,{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]}]},Me),new r.SimpleCommand("startEditCurrentTime",se,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},G),new r.SimpleCommand("startEditCurrentDate",se,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.Command("relativeReferencesToggle",se,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},de),new r.Command("toggleEditorFocus",se,{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 I=null;const Q=()=>({contains:L=>O.current?.contains(L)||!1,focus(){O.current.focus()}});return I=M?M.createChildGroup(Q,"editor",!1):new r.CommandGroup(Q,"editor"),I.addCommands(Se,!0),I},[M,Se]),we=o.useMemo(()=>({notifier:null,source:re,target:me,commands:ie}),[re,me,ie]);r.useCopyPaste(we);const[ke,Re]=o.useState(!p);o.useEffect(()=>{Re(!1)},[]);const Le=r.useCallbackRef(I=>{pe(!0),ie?.activate();const Q=j.current;if(Q!==!1){let L,$;const xe=O.current.value;zo(N,xe)&&(L=xe.length-1,$=xe.length-1),L=Q?.start??L??xe.length,$=Q?.end??$??xe.length,j.current=!1,V({start:L,end:$,direction:"forward"})}z?.(I)},[z,N]),Ne=k.insets;let v=Ne.left+1;const Oe=Ne.left+Ne.right+2-1,tt=oe?.bounds.height??0;let te,Te=Ne.top;k.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?Te=Math.max(0,(S-(Ne.top+Ne.bottom)-tt)/2):k.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(Te=Math.max(0,S-(Ne.top+Ne.bottom)-tt)),B!==void 0&&oe?.lines[0]?.bounds&&(te=oe?.lines[0]?.bounds.height*B);const Pe=k.style.getFont();let ze=Pe.getSize();Pe.isSuperSub()&&(ze*=Pe.getSuperSubScale()),ze*=d.IFont.getDeviceScale()*x;const De=y?Pe.toCSS(D,x):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:I=>{O.current&&document.activeElement!==O.current&&requestAnimationFrame(()=>{O.current.focus()})},ref:ee,...A,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...H},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Te*x,left:v*x,width:`calc(100% - ${Oe*x}px)`,maxWidth:`calc(100% - ${Oe*x}px)`,height:(te??tt)*x,maxHeight:(te??tt)*x},children:c.jsx("textarea",{spellCheck:"false",placeholder:k.placeholder,ref:O,value:k.textValue,disabled:ke,readOnly:_||m.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...De,fontSize:ze?`${ze}px`:"inherit",textAlign:k.textAlign,lineHeight:(oe?.lines[0]?.bounds.height??0)*x+"px",height:(oe?.bounds.height??0)*x,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:k.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Le,onBlur:()=>{pe(!1)},onSelect:I=>{},onChange:I=>{O.current&&!We.current&&(j.current=!1,Ee(I.target.value),k.textValue,I.target.value,I.target.selectionStart,I.target.selectionEnd,I.target.selectionDirection,V({start:I.target.selectionStart,end:I.target.selectionEnd,direction:I.target.selectionDirection}))},onMouseDown:I=>{K&&Ae(!0)},onKeyDown:Y})})})})),mr=(e,t)=>({clean:e,dirty:t,editMode:!1}),fr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:f=!1,offsetX:h=0,offsetY:s=0,isVertical:y=!1,...b}=e,w=H=>{let x=null;if(H&&n>0){x="";for(let B=0;B<H.length;B++)x+=H[B],B<H.length-1&&(x+=",")}return x},m=w(i);let M=m;a&&(M=w(a));let T=n,P=t,z=null;if(l){T=Math.floor(n/2);const H=T+T/2+1;let x=null;x=y?`M ${r.ReactUtils.boundPixel(h+H)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(h+H)} ${r.ReactUtils.boundPixel(s+P)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(s+H)} L ${r.ReactUtils.boundPixel(h+P)} ${r.ReactUtils.boundPixel(s+H)}`,z=c.jsx("path",{strokeWidth:T,strokeDasharray:M,d:x,...b})}if(f){T=n/2;const H=T+T/2;let x=M,B=null;B=y?`M ${r.ReactUtils.boundPixel(h+H)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(h+H)} ${r.ReactUtils.boundPixel(s+P)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(s+H)} L ${r.ReactUtils.boundPixel(h+P)} ${r.ReactUtils.boundPixel(s+H)}`,z=c.jsx("path",{strokeWidth:T,strokeDasharray:x,strokeDashoffset:"1",shapeRendering:"crispEdges",d:B,...b})}let _=null;return _=y?`M ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(s)} L ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(s+P)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(s+T/2)} L ${r.ReactUtils.boundPixel(h+P)} ${r.ReactUtils.boundPixel(s+T/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:T,strokeDasharray:m,d:_,...b}),z]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Ut=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)}},pl=function(){},pr=typeof window<"u",vl=pr?o.useLayoutEffect:o.useEffect,No={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Xt=pr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(No),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var s=h[0].contentRect,y=s.x,b=s.y,w=s.width,m=s.height,M=s.top,T=s.left,P=s.bottom,z=s.right;l({x:y,y:b,width:w,height:m,top:M,left:T,bottom:P,right:z})}})},[]);return vl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[pl,No]},Cl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,yl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,wl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:h=!1,isVertical:s=!1,intersections:y,layout:b}=e,w=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!w)return null;const m=n[0],M=n[1],T=n[2],P=n[3];let z=1+(s?P-M:T-m),_=0;const H=a.getColor().toRGBA(l).toString(),x=w.description.toLowerCase().includes("double");let B,p;const A=s?"rowStart":"colStart",S=s?"rowEnd":"colEnd",U=s?M:m;if(y?.length>0){const pe=y[0];if(pe?.range[A]===i[A]){const V=d.IBorder.BuiltInDefinitions.get(pe.stroke.getStyle());_=Math.floor(V.width/2)}if(y[y.length-1]?.range[S]===i[S]){const V=d.IBorder.BuiltInDefinitions.get(y[y.length-1].stroke.getStyle());z=Math.floor(z+(V.width===2?0:V.width/2))}if(x){const V=s?"colStart":"rowStart",N=s?"colEnd":"rowEnd",F=s?b?.getRowOffset:b?.getColOffset;let k=0,O=0;B=[],p=[];const ee=y.length;for(let oe=0;oe<ee;oe++){const be=y[oe];if(be.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&F){const he=F(be.range[A])-(U-_);be.range[V]<i[V]&&(B.push(he-k),k=he,B.push(1),k++),be.range[N]>i[N]&&(p.push(he-O),O=he,p.push(1),O++)}}B.length>0&&k<z&&B.push(z-k),p.length>0&&O<z&&p.push(z-O)}}let D=s?-Math.floor(w.width/2):-_,j=s?-_:-Math.floor(w.width/2);const K=h&&w.width>2?-1:0;return c.jsx(fr,{offsetX:m+D+K,offsetY:M+j+K,length:z+_,isVertical:s,stroke:H,width:w.width,dashArray:B??w.pattern,dashArrayAdditional:p,isDouble:x,isAngled:w.description.toLowerCase().includes("slant")},t)},Co=({getBorderAt:e,borderRenderer:t=wl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const h=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>y=>{const b=y.toClipBounds(y.getRangeCoordsBounds(),-3);if(!b)return;const w=h(y);if(w.length===0)return;const m=y.getVisibleColumnOffsets(),M=y.getVisibleRowOffsets();let T=[],P=[];const z=y.getVisibleColumns(),_=y.getVisibleRows(),H=[],x=[],B=[],p=(Z,V,N,F,k,O,ee)=>{const oe={index:F,stroke:k,visibleIndex:N,edge:O,length:ee};Z[V]||(Z[V]=[]),Z[V].length>0&&Z[V][Z[V].length-1]?.index===F?Z[V][Z[V].length-1]=oe:Z[V].push(oe)},A=y.getVisibleRangeCoords(),S=w.length;for(let Z=0;Z<S;Z++){const V=w[Z],N=V.coords;if(!N)continue;const F=V?.range??{rowStart:N.rowIndex,colStart:N.colIndex,rowEnd:N.rowIndex,colEnd:N.colIndex};if(!ge.CoordUtils.isRangesIntersect(F,A)&&!ge.CoordUtils.isRangeWithinRange(F,A))continue;const k=N.colIndex,O=N.rowIndex,ee=m[k],oe=M[O];if(F.rowEnd!==F.rowStart){const Me=M[F.rowStart]?.spanIndex??-1,G=M[F.rowEnd]?.spanIndex??M[_[_.length-1]].spanIndex+1;T.push({...F,rowStart:Me,rowEnd:G})}if(F.colEnd!==F.colStart){const Me=m[F.colStart]?.spanIndex??-1,G=m[F.colEnd]?.spanIndex??m[z[z.length-1]].spanIndex+1;P.push({...F,colStart:Me,colEnd:G})}const be=V.value,he=e(be,Z);if(!he||he.isEmpty())continue;const Ee=he.getLeft(),Ae=he.getTop(),We=he.getRight(),ve=he.getBottom();let He=1,Y=1;if(!ee||!oe)continue;const X=ee.spanIndex,de=oe.spanIndex;Ee.isNone()||p(H,X,de,O,Ee,d.IBorder.Edge.Left,He),Ae.isNone()||p(x,de,X,k,Ae,d.IBorder.Edge.Top,Y),We.isNone()||p(H,X+Y,de,O,We,d.IBorder.Edge.Right,He),ve.isNone()||p(x,de+He,X,k,ve,d.IBorder.Edge.Bottom,Y)}const U=(Z,V,N)=>{const F=[];return Z.forEach((k,O)=>{let ee=null;k.sort((be,he)=>be.visibleIndex-he.visibleIndex);const oe=k.length;for(let be=0;be<oe;be++){const he=k[be];if(!he?.stroke||V[O]===void 0&&V[O-1]===void 0)continue;let Ee=!1;if(N){const He=T.length;for(let Y=0;!Ee&&Y<He;Y++){let X=T[Y];X.colStart<=he.index&&X.colEnd>=he.index&&X.rowStart<O&&X.rowEnd>=O&&(Ee=!0)}}else{const He=P.length;for(let Y=0;!Ee&&Y<He;Y++){let X=P[Y];X.rowStart<=he.index&&X.rowEnd>=he.index&&X.colStart<O&&X.colEnd>=O&&(Ee=!0)}}if(Ee)continue;const Ae=he.stroke?.getColor(),We=Ae?Ae.toRGBA().toString():l,ve=he.stroke.getStyle()+":"+We;(ve!==ee?.key||ee&&ee.visibleIndex+1<he.visibleIndex)&&(ee&&F.push(ee),ee={key:ve,index:V[O]??V[O-1]+1,visibleIndex:he.visibleIndex,edge:he.edge,stroke:he.stroke,from:he.index,to:he.index+he.length-1,intersections:[],length:1}),ee.to=he.index+he.length-1,ee.visibleIndex=he.visibleIndex}ee&&F.push(ee)}),F};T=T.sort(yl),P=P.sort(Cl);const D=U(H,z,!1),j=U(x,_,!0);if(D.length===0&&j.length===0)return null;const K=j.length;for(let Z=0;Z<K;Z++){const V=j[Z];let N=ge.CommonUtils.findEqualOrGreater(D,V.from,k=>k.index),F=!1;for(;!F;){const k=D[N++];k&&k.index>=V.from&&k.index<=V.to+1&&k.from<=V.index&&k.to+1>=V.index&&(V.intersections.push({stroke:k.stroke,range:{rowStart:k.from,rowEnd:k.to+1,colStart:k.index,colEnd:k.index}}),k.intersections.push({stroke:V.stroke,range:{rowStart:V.index,rowEnd:V.index,colStart:V.from,colEnd:V.to+1}})),F=!k||k.index>V.to+1}}for(let Z=0;Z<K;Z++){const V=j[Z];let N=V.stroke;const F=`rBorder:${V.index}:${V.from}:${V.to}:${V.edge}`,k={rowStart:V.index,rowEnd:V.index,colStart:V.from,colEnd:V.to+1},O=y.getLayout(),ee=!1,oe=O.getColOffset(k.colStart),be=O.getRowOffset(k.rowStart),he=[oe,be,O.getColOffset(k.colEnd),be];B.push(t({key:F,points:he,stroke:N,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:k,intersections:V.intersections,layout:O,isVertical:ee}))}const pe=D.length;for(let Z=0;Z<pe;Z++){const V=D[Z];let N=V.stroke;const F=`cBorder:${V.index}:${V.from}:${V.to}:${V.edge}`,k={rowStart:V.from,rowEnd:V.to+1,colStart:V.index,colEnd:V.index},O=y.getLayout(),ee=!0,oe=O.getColOffset(k.colStart),be=[oe,O.getRowOffset(k.rowStart),oe,O.getRowOffset(k.rowEnd)];B.push(t({key:F,stroke:N,points:be,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:k,intersections:V.intersections,layout:O,isVertical:ee}))}return c.jsx("svg",{width:`${b.width}`,height:`${b.height}`,viewBox:`0 0 ${b.width} ${b.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${b.width}px`,height:`${b.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:B},"borders")},[e,i])}},Lo=ge.AnchorLocation.Center,bl=Object.freeze({horizontal:!1,vertical:!1}),Po=ge.TypesUtils.EmptyTopLeft,xl=(e,t)=>ge.CoordUtils.EmptyCell,ql=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Sl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:h,forceThinBorder:s,children:y,...b}=e,w=o.useRef(null),[m,{width:M,height:T}]=Xt(),P=n??M,z=i??T,_=o.useMemo(()=>{const N=[];for(let F=0;F<l;F++)for(let k=0;k<f;k++){const O={colIndex:k,rowIndex:F};N.push({coords:O,value:O})}return N},[]),H=o.useCallback(N=>_,[_]),{overlay:x}=Co({getVisibleCells:H,getBorderAt:t,darkMode:h,forceThinBorder:s}),B=Math.floor(P/f),p=Math.floor(z/l),A={getColOffset:N=>Math.ceil(N*B)+0,getRowOffset:N=>Math.ceil(N*p)+0,getColIndex:N=>Math.floor((N-0)/B)-1,getRowIndex:N=>Math.floor((N-0)/p)-1},S={rowStart:0,colStart:0,rowEnd:l,colEnd:f},U={x:0,y:0,width:Math.max(0,P)+0,height:Math.max(0,z)+0},D=o.useMemo(()=>{const N={},F=Math.floor(P/f);for(let k=0;k<f;k++)N[k]={offset:k*F,size:F,spanIndex:k};return N},[P,z]),j=o.useMemo(()=>{const N={},F=Math.floor(z/l);for(let k=0;k<l;k++)N[k]={offset:k*F,size:F,spanIndex:k};return N},[P,z]);if(!x)return null;const K={width:P,height:z},pe={width:P,height:z},Z={getStage:()=>w.current,getTotalSize:()=>K,getViewportSize:()=>pe,getLayout:()=>A,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>S,getVisibleRows:()=>{const N=[];for(let F=0;F<l;F++)N.push(F);return N},getTotalRangeCoords:()=>S,getRelativePointFromClient:(N,F)=>({x:N,y:F}),getVisibleColumns:()=>{const N=[];for(let F=0;F<f;F++)N.push(F);return N},toClipBounds:(N,F)=>U,toViewBounds:N=>N,toAbsoluteBounds:N=>N,getBounds:()=>U,getInsets:()=>null,getRangeCoordsBounds:(N,F)=>null,getVisibleColumnOffsets:()=>D,getVisibleRowOffsets:()=>j,allViews:()=>({[Lo]:Z}),getAnchor:()=>Lo,getZoom:()=>1,scrollCellCoordsIntoView:ql,getCellCoordsFromClient:xl,getScrollOrientation:()=>bl,getScrollTopLeft:()=>Po,getFreezeTopLeft:()=>Po},V=x(Z);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...b,children:[c.jsx("div",{ref:Ut([w,m]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:y}),V]})});function vr(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=vr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function dt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=vr(e))&&(i&&(i+=" "),i+=t);return i}const Rl="_sheetxl-sheet_1qeq6_5",kl="_viewport-overlay_1qeq6_6",Cr=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"})]})},Ml=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...h}=e??{},[s,y]=o.useState(null);o.useEffect(()=>{(async()=>{const p=await d.LicenseManager.getDetails();y(p)})()},[]);const[b,w]=o.useState(!1),m={opacity:.65},M=o.useMemo(()=>{const p=s?.getExceptions(),A=p?.length??0;if(A===0)return null;const S=[];for(let U=0;U<A;U++){const D=p[U];S.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:D},U))}return S},[s,n]);if(s===null||s.isValidFor(l))return null;const T=s.getType(),P=!M&&T.endsWith("ity"),z=s.getLicensee(),_=P?1.6:1,H=135/_,x=37/_;let B=null;return!T&&z?.length>0&&(B=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:z})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...h,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[b?c.jsx(Cr,{style:m}):c.jsx("svg",{width:H,height:x,style:m,children:c.jsx("image",{style:{width:H,height:x},href:"https://www.sheetxl.com/watermark.svg",onError:()=>w(!0)})}),c.jsxs("div",{children:[B,M,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),et=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),f={},h=l.length;for(let y=0;y<h;y++){const b=l[y];f[b]=(w,m)=>{i.current[b]?.(w,m)}}const s=e.addListeners(f,n);if(a)for(let y=0;y<h;y++)f[l[y]](e);return()=>{s?.()}},[e])},Dn=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){const n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw new Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,e)}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw new Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return ge.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const i=n.contributionPoints;if(i&&i.length!==0)for(let a of i)a.startsWith(e)&&t.push(n)}return t}},yr=o.createContext(void 0),Tl={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},wr=()=>o.useContext(yr)||Tl,Yt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},yo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:h,style:s,className:y,...b}=e,w=o.useMemo(()=>dt("taskpane-title",y,Yt.TaskPaneTitle,{focused:h}),[y,h]);return c.jsxs("div",{ref:t,className:w,style:s,...b,children:[c.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),c.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:m=>{m.stopPropagation()},onPointerUp:()=>{l()},children:c.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));yo.displayName="TaskPaneTitle";const Il=e=>c.jsx(yo,{...e}),El=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:h,onMounted:s,onUnmounted:y,paneWrapper:b,paneProps:w,renderTaskPanelTitle:m=Il,style:M,className:T,...P}=e,[z,_]=o.useState(null),[H,x]=o.useState(!1),B=r.useCallbackRef(a,[a]),p=o.useRef(null),A=o.useRef(null);o.useEffect(()=>(s?.(i),()=>{y?.(i)}),[i]);const S=o.useRef([]),U=o.useMemo(()=>({addListener:K=>{const pe=l(K);return S.current.push(pe),pe},close:()=>{B?.()},focus:K=>{p.current?.focus(K)}}),[l]);o.useEffect(()=>()=>{for(const K of S.current)K();S.current=[]},[]);const D=o.useMemo(()=>(i.renderTaskPanelTitle??m)({ref:A,title:i.getTitle(),icon:null,readOnly:!1,focused:H,onClose:B,onPointerDown:K=>{}}),[i,H]),j=o.useMemo(()=>{let K=i.renderTaskPane({entryKey:i.key,model:f,commands:h,frame:U,...w},t);return b&&(K=b(K)),K},[i,f,h,t]);return c.jsxs("div",{className:dt("taskpane-frame",T,Yt.TaskPaneFrame),tabIndex:0,ref:p,style:M,onPointerDown:async K=>{K.currentTarget.focus()},onFocus:K=>{K.relatedTarget&&!z&&_(K.relatedTarget),x(!0)},onBlur:K=>{z&&!p?.current?.contains(K.relatedTarget)&&_(null),K.relatedTarget&&x(!1)},...P,children:[c.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:D}),c.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:j})]})})),wo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:h=Dn,style:s,className:y,...b}=e,w=o.useMemo(()=>a.map(T=>{const P=h.getRegisteredTaskPane(T);if(!P)return null;let z=P.getIcon?.();z&&(typeof z=="string"&&(z=c.jsx(r.DynamicIcon,{iconKey:z})),z=c.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:z}));const _=T===f;return c.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:dt("taskpane-strip-item",Yt.TaskPaneStripItem,{selected:_}),onClick:()=>e.onSelect(T),children:[z,P.getTitle()]},T)}),[a,f,l,h]),m=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),M=o.useMemo(()=>dt("taskpane-strip",y,Yt.TaskPaneStrip),[y]);return c.jsx("div",{ref:m,className:M,style:s,...b,children:w})}));wo.displayName="TaskPaneStrip";const Fl=e=>c.jsx(wo,{...e}),Al=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=Dn,model:a,commands:l,onOpen:f,onClose:h,paneWrapper:s,paneProps:y,frameWrapper:b,frameProps:w,renderTaskPanelTitle:m,renderTaskPaneStrip:M=Fl,alwaysShowStrip:T,style:P}=e,z=r.useCallbackRef(f,[f]),_=r.useCallbackRef(h,[h]),[H,x]=o.useState(null),B=o.useRef(null),[p,A]=o.useState([]),S=o.useRef(new Set),U=r.useCallbackRef(async(N,F=!1)=>{const k=Array.from(S.current),O=k.length;let ee=!0;for(let oe=0;ee&&oe<O;oe++){const be=k[oe];if(be.onBeforeHide)try{await Promise.resolve(be.onBeforeHide())===!1&&(ee=!1)}catch{ee=!1}}return ee},[]),D=r.useCallbackRef(N=>{const F=Array.from(S.current),k=F.length;A(O=>{const ee=O.findIndex(be=>be.key===N);if(ee===-1)return O;const oe=[...O];return oe.splice(ee,1),oe.length===0?(x(null),_?.(),oe):(j(oe[Math.max(oe.length-1,ee-1)].key),oe)});for(let O=0;O<k;O++){const ee=F[O];try{ee.onHide?.()}catch{}}},[_]),j=r.useCallbackRef(async N=>{const F=i.getRegisteredTaskPane(N);if(!F)return void console.warn(`Invalid taskpane '${N}'`);if(B.current===N||H&&!await U(H.key))return;const k=o.createRef();let O=c.jsx(El,{ref:()=>{B.current=null},entry:F,model:a,commands:l,close:async()=>{await U(N)&&D(N)},paneWrapper:s,paneProps:y,renderTaskPanelTitle:m,listenerContainer:oe=>(S.current.add(oe),()=>{S.current.delete(oe)}),onMounted:oe=>{oe.key===N&&(B.current=null),z?.()},onUnmounted:oe=>{},...w});b&&(O=b(O));const ee={key:N,elem:O,ref:k};A(oe=>{if(oe.findIndex(he=>he.key===N)!==-1)return oe;const be=[...oe];return be.push(ee),be}),x(ee),B.current=N},[H,b,s,m]);o.useEffect(()=>{H&&!B.current&&j(H.key)},[w,a]);const K=r.useImperativeElement(t,()=>({activateTaskPane:j}),[i,y,a,l]),pe=o.useMemo(()=>p.map(N=>N.key),[p]),Z=o.useMemo(()=>{if(pe.length<=1&&!T)return null;const N={className:Yt.TaskPaneAreaStrip,taskPanes:pe,selected:H?.key,onSelect:F=>{j(F)},registry:i};return M(N)},[pe,H,i,T]),V=H?.elem;return c.jsxs("div",{ref:K,className:dt("taskpane-area",n,Yt.TaskPaneArea),style:P,children:[V,Z]})})),kn=new d.Color("transparent");function br(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:h}=e,s=r.useNotifier(),y=wr(),[b,w]=o.useState(null),[m,M]=o.useState(null),T=o.useRef(null),P=r.useCallbackRef(f,[f]),z=r.useCallbackRef(h,[h]),_=o.useMemo(()=>({serializer:{parse:g=>g?t?.getStyles().parseColor(g):null,stringify:g=>g?g.toString():null}}),[t]),[H,x]=r.usePersistenceState("sheet.lastBorder",null),[B,p]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),_),[A,S]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),_),U=r.useEditMode();o.useRef(U.getMode()).current=U.getMode();const D=r.useGlobalClipboard(),[j,K]=o.useState(ge.CommonUtils.EmptyArray),pe=o.useCallback(()=>{if(T.current!==t)return;const g=t.getSelectedRanges();let C=null;j.length>0&&ge.CoordUtils.isCellWithinRange(b,j[0].getRange().getCoords())&&(C=j[0]);const R=t?.getSelectedCell(),u=R?.getCoords()??null;Ht.unstable_batchedUpdates(()=>{he(C),w(u),M(g)})},[t,j,m,b]),Z=o.useCallback(ge.CommonUtils.debounce(pe,210),[pe]);o.useEffect(()=>{T.current=t,pe()},[t]);const V=r.useCallbackRef(()=>t.getSelectedCell(),[t]),N=r.useCallbackRef(async(g,C,R=null,u=!1,q=!0)=>{const E=g?.label?.(),le=async()=>{const ae=await Promise.resolve(q&&s.showBusy(E??"Busy..."));try{await t.doBatch(async()=>C(t),E),u&&U.setMode(null),ae&&ae()}catch(ue){if(ae&&ae(),!ue)return;s.showError(ue)}},fe=[];let ce=!1;const ne=async()=>(fe.push(le),(async()=>{if(!ce){for(ce=!0;fe.length>0;){const ae=fe.shift();ae&&await ae()}ce=!1}})());if(n){let ae=null;if(R!==!1&&g){const ue=R??E;ae=new r.SimpleCommand(g.key(),l,{label:ue,description:ue},ne)}n(ae)}return ne()},[t,n,s]),F=r.useCallbackRef((g,C,R=!1,u)=>(u||(u={autoSelect:!0,autoFit:!0}),N(g,q=>{const E=q.getSelectedRanges();R&&E.getStyle().update(null,u),E.getStyle().update(C,u)})),[t]),k=r.useCallbackRef((g,C)=>{N(g,R=>{R.getSelectedRange().setHyperlink(C)})},[t]),O=r.useCallbackRef((g,C)=>{N(g,R=>{R.getSelectedRange().setComments(C)})},[t]),ee=r.useCallbackRef((g,C)=>{N(g,R=>{R.getSelectedRanges().clear(C)})},[t]),oe=r.useCallbackRef(async(g,C,R=!1,u=!1)=>N(g,async q=>{let E=q.getSelectedRanges();R&&(C===d.IRange.Orientation.Row?E=E.getEntireRows(u):C===d.IRange.Orientation.Column&&(E=E.getEntireColumns(u)));let le=null;const fe=U.getMode()?.key;if(fe==="copy"||fe==="cut"){const ce=await D.getClipboard().readReference();ce&&ce.getItemType()==="range"&&(le=ce.getItem(),le.getCoords()||(le=null))}if(le){const ce=await E.insertFrom(le,{...le.getMarkOptions(),orientation:C,autoSelect:!0});!ce||ce.isEntireRows()||ce.isEntireColumns()||ce.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),U.setMode(null)}else E.insert({orientation:C,autoSelect:!0})},"Insert Cells",!1),[U]),[be,he]=o.useState(null),Ee=r.useCallbackRef(g=>t.getStyles().setDefaultTableStyle(g),[t]),Ae=r.useCallbackRef(g=>{t.getStyles().getTableStyle(g)?.delete()},[t]),We=r.useCallbackRef((g,C)=>{N(g,async R=>{const u=R.getSelectedRange(),q=R.getSelectedCell().getCoords();let E=null,le=0;const fe=q.rowIndex>0?R.getRange({rowIndex:q.rowIndex,colIndex:q.colIndex}).getExtended(d.IRange.Direction.Up):null;fe&&R.getRange({colStart:q.colIndex,rowStart:fe.getCoords().rowStart,colEnd:q.colIndex,rowEnd:fe.getCoords().rowStart}).isContentful()&&(E=d.IRange.Direction.Up,le=q.rowIndex-fe.getCoords().rowEnd);const ce=q.colIndex>0?R.getRange({rowIndex:q.rowIndex,colIndex:q.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(ce&&R.getRange({colStart:ce.getCoords().colStart,rowStart:q.rowIndex,colEnd:ce.getCoords().colStart,rowEnd:q.rowIndex}).isContentful()){const ae=q.colIndex-ce.getCoords().colEnd;(ae<le||!E)&&(E=d.IRange.Direction.Left,le=ae)}let ne=null;if(E===d.IRange.Direction.Up){if(ne={...fe.getCoords()},(ne.rowEnd===q.rowIndex||!R.getRange({colIndex:q.colIndex,rowIndex:q.rowIndex-1}).isContentful())&&ne.rowStart>0&&R.getRange({colIndex:q.colIndex,rowIndex:ne.rowStart-1}).isContentful()){const ae=fe.getExtended(d.IRange.Direction.Up);ne={colStart:q.colIndex,rowStart:ae.getCoords().rowStart,colEnd:q.colIndex,rowEnd:fe.getCoords().rowEnd}}ne.rowEnd=q.rowIndex-1}else if(E===d.IRange.Direction.Left){if(ne={...ce.getCoords()},(ne.colEnd===q.colIndex||!R.getRange({colIndex:q.colIndex-1,rowIndex:q.rowIndex}).isContentful())&&ne.colStart>0&&R.getRange({colIndex:ne.colStart-1,rowIndex:q.rowIndex}).isContentful()){const ae=ce.getExtended(d.IRange.Direction.Left);ne={colStart:ae.getCoords().colStart,rowStart:q.rowIndex,colEnd:ae.getCoords().colEnd,rowEnd:q.rowIndex}}ne.colEnd=q.colIndex-1}if(u.size!==1&&E){const ae=u.getCoords(),ue=u.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),ye={...ne},Be=ae.rowStart,Ie=ae.rowEnd,Fe=ae.colStart,Ue=ae.colEnd,_e=E===d.IRange.Direction.Up;for(let $e=Fe;$e<=Ue;$e++){ye.colStart=_e?$e:ne.colStart+($e-Fe),ye.colEnd=_e?$e:ne.colEnd+($e-Fe);for(let Ye=Be;Ye<=Ie;Ye++){ye.rowStart=_e?ne.rowStart+(Ye-Be):Ye,ye.rowEnd=_e?ne.rowEnd+(Ye-Be):Ye;const Je=R.getRange(ye).toString();ue.pushAt(Ye,$e,`=${C}(${Je})`)}}ue.apply()}else{const ae=ne?R.getRange(ne).toString():"",ue=`=${C}(`;P?.({text:`${ue}${ae})`,editMode:!0,initialSelection:{start:ue.length,end:ue.length+ae.length}})}},!1)},[t]),ve=r.useCallbackRef((g,C,R=!1,u=!0)=>{N(g,async q=>{if(be)return void be.updateStyleOptions(C);const E=q.getSelectedRanges().getFixed(!0),le=q.getSelectedRange().getDefaultSortCriteria(),fe={getNames:()=>q.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},ce={ranges:E,hasHeader:le?.options?.hasHeader??!1},ne=async ue=>{if(!(ue=await Promise.resolve(ue)))return null;const ye=await Promise.resolve(s.showBusy(g.label()));try{await q.getTables().add(ue.ranges.at(0),{styleName:C?.name,clearFormatting:R,hasHeader:ue.hasHeader}).getRange().select(),ye()}catch(Be){ye(),s.showError(Be)}};if(!u)return void await ne(ce);const ae={initialValue:ce,context:()=>fe,onInput:ue=>{ne(ue)}};s.showWindow("tableNew",ae)},!1,!0,!1)},[be]),He=r.useCallbackRef(()=>i,[i]),Y=r.useCallbackRef(g=>({styles:()=>t.getStyles(),table:()=>g,bodyStyle:He,getNames:()=>t.getNames()}),[t]),X=r.useCallbackRef(async(g,C,R,u=!0)=>{if(!C){let E=t.getSelectedRange();E.size===1&&(E=E.getSurrounding());let le=t.getTables().getItems({address:t.getSelectedRange()});le.length>0&&(C=le[0]),await E.select()}if(!C)return;try{R&&await C.select()}catch{}if(!u)return;const q=new Promise(async(E,le)=>{g.update({context:Y(C)}),y.activateTaskPane("tableDetails",{}),E(!0)});try{if(!await q)return}catch(E){s.showError(E)}},[s]),de=r.useCallbackRef(async(g,C,R=!1)=>{let u=null;if(C)C.isITable?u=C:C.getValue()&&(u=C.getValue());else{const q=t.getTables().getItems({address:t.getSelectedRange()});q.length>0&&(u=q[0])}if(u){if(!R){const q=u.getRange().getCoords(),E=(q.colEnd-q.colStart+1)*(q.rowEnd-q.rowStart+1);if(E>1e4&&await s.showOptions({title:"Confirm",description:`Converting a table to range with '${E}' cells will set a large number of cell styles and may affect performance.
10
- Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}N(g,async()=>{R?u.delete():u.convertToRange()},!1,!0)}},[s]),Me=r.useCallbackRef((g,C,R)=>{N(g,async u=>{const q=u.getSelectedRanges();if(q.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let E=q.at(0);E.size===1&&(E=E.getSurrounding());const le=u.getSelection().getCoords().cell;let fe=E.getDefaultSortCriteria(d.IRange.Orientation.Row,le);if(!fe){if(R)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}const ce=async Be=>{if(!(Be=await Promise.resolve(Be)))return;const Ie=await Promise.resolve(s.showBusy(g.label()));try{E.doBatch(()=>{const Fe={...Be,...C};E.sort(Fe),E.autoFit({orientations:Fe?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},g?.label?.())}catch(Fe){Ie(),s.showError(Fe)}Ie()};let ne=fe.options;if(!R)return void await ce(ne);let ae=E;ne.hasHeader&&(ae=E.getIntersect(fe.sortCoords)),ae.select();const ue={range:E,cell:le},ye={initialValue:ne,context:()=>ue,onInput:Be=>{ce(Be)}};s.showWindow("sort",ye)},!1,!1,!1)},[s]),G=r.useCallbackRef(()=>{console.log("compactedSelection");const g=t.getSelection().getCoords(),C=t.getSelectedRanges().getFlattened().getCoords(),R=(E=>{const le=new Blob([E],{type:"application/javascript"}),fe=URL.createObjectURL(le),ce=new Worker(fe);return URL.revokeObjectURL(fe),ce})("console.log('hello from worker');");setTimeout(()=>{R.terminate(),console.log("Worker terminated")},5e3);let u=-1;for(let E=0;u===-1&&E<C.length;E++)ge.CoordUtils.isCellWithinRange(g.cell,C[E])&&(u=E);if(ge.CoordUtils.isEqualRangesArrays(g.ranges,C))return;const q={cell:g.cell,ranges:C,rangeIndex:u};t.getSelection().updateCoords(q)},[t]),W=r.useCallbackRef(()=>{console.log("selectComments")},[t]),re=r.useCallbackRef(async(g=!1,C=!1)=>{let R=null;if(C)R=t.getEntireRange();else{const u=t.getSelectedRange();if(u.isEntireRange()){const q=t.getSelection().getCoords().cell,E=t.getRange(q);R=E.getSurrounding(),R.isEntireRange()&&(R=E)}else R=u.getSurrounding({contentOnly:g})}R&&await R.select()},[t]),me=r.useCallbackRef((g,C,R)=>{N(g,async u=>{let q=u.getSelectedRanges();R&&(C===d.IRange.Orientation.Row?q=q.getEntireRows():C===d.IRange.Orientation.Column&&(q=q.getEntireColumns())),q.delete(C)},"Delete Cells")},[t]);r.useCallbackRef(async g=>{let C=null;const R=z(),u=Math.min(R.width-8,480),q=Math.min(R.height-8,288);try{t.getSelectedRanges(),C=await t.getMovables().add({bounds:{x:R.left+(R.width-u)/2,y:R.top+(R.height-q)/2,width:u,height:q},type:"chart",json:g.template}),C.select(),U.setMode(null)}catch(E){s.showError(E)}return C},[t,s]);const se=r.useCallbackRef(async(g,C,R)=>{const u=await s.showBusy(g.label());try{const q=await t.getMovables().addImage(C,{autoSelect:!0,...R});return u(),U.setMode(null),q}catch(q){u();let E=q;typeof E!="string"&&(console.warn(q),E="Unable to resolve image."),s.showMessage(E,{type:r.NotifierType.Error})}},[t,s]),Se=r.useCallbackRef((g,C)=>{N(g,async R=>{const u=R.getSelectedRanges();u.doBatch(()=>{const q=C===d.IRange.Direction.Up||C===d.IRange.Direction.Down,E=u.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(q?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let le=0;le<E.length;le++){const fe=E[le];let ce=fe;const ne=R.getRange(ce).getMerges();let ae=0,ue=0;if(ne.length>0){const ye=ne[0];ae=ye.rowEnd-ye.rowStart,ue=ye.colEnd-ye.colStart}C===d.IRange.Direction.Left?ce={...fe,colStart:fe.colEnd+ue}:C===d.IRange.Direction.Right?ce={...fe,colEnd:fe.colStart+ue}:C===d.IRange.Direction.Up?ce={...fe,rowStart:fe.rowEnd+ae}:C===d.IRange.Direction.Down&&(ce={...fe,rowEnd:fe.rowStart+ae}),R.getRange(ce).autoFill(fe,{filler:d.AutoFill.Types.Copy}),R.getRange(fe).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:g.label()})})},[s]),ie=r.useCallbackRef(()=>{let g=null;const C=t.getSelectedCell().getCoords();if(C?.rowIndex>0){const R=t.getRange({rowIndex:C.rowIndex-1,colIndex:C.colIndex}).getCell();R&&(g=R.toTextUnformatted(!0))}P?.({text:g})},[t]),[we,ke]=o.useReducer(g=>g+1,0),[Re,Le]=o.useReducer(g=>g+1,0),Ne=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",icon:"FormulaView",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank.",icon:"ViewZero"}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>W()),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]}]},(g=!1)=>re(!1,g)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>re(!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]}},()=>G()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation.",icon:"TextRotation315"}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward.",icon:"TextRotation45"}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left.",icon:"TextRotation90"}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right.",icon:"TextRotation2702"}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward.",icon:"TextRotation315"}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle.",icon:"TextRotationCustom"}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically.",icon:"TextRotationVertical"}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending",sortFilter:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){Me(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending",sortFilter:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){Me(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…",sortFilter:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.",icon:"SortCustom"},function(){Me(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
- For example, you can prevent people from editing locked cells or making formatting changes.`,icon:"Lock"}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet.",icon:"PresetStyles"},function(g){F(this,{named:g.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(g){ve(this,g)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(g){ve(this,g,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){ve(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."},Ee),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Ae),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(g){F(this,{border:g})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(g){F(this,{fill:g})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(g){F(this,{font:{fill:g}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",icon:"TextItalic",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",icon:"TextUnderline",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){F(this,g=>({font:{size:d.FontUtils.findNextFontSize(g.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){F(this,g=>({font:{size:d.FontUtils.findNextFontSize(g.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(g){F(this,{font:{family:g}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(g){F(this,{font:{size:g}})}),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(g,C){const R=this,u={initialValue:g??C.state(),context:()=>C.context(),onInput:(q,E)=>{F(R,{numberFormat:q})}};s.showWindow("numberFormat",u)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(g){F(this,{numberFormat:g})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){F(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(){F(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(){F(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(){F(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(g){F(this,{numberFormat:g??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){F(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(){F(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){F(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){F(this,g=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){F(this,g=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(g){g&&We(this,g.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){We(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){We(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){We(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){We(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){We(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(){P?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){P?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("updateHyperlink",l,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",icon:"HyperlinkInset",context:()=>V,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(g,C){const R=this,u={context:C.context(),onInput:q=>{k(R,q)}};s.showWindow("hyperlink",u)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",icon:"HyperlinkGoto",context:()=>V},async(g,C)=>{const R=C.context()();if(!R)return;const u=R.getHyperlink();if(u)try{await u.open()}catch(q){s.showError(q)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>V},function(g,C){k(this,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(g,C)=>{((R,u)=>{R?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[u," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(s,C.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",icon:"CommentInsert",context:()=>V},async function(g,C){const R=this,u={context:C.context(),onInput:q=>{O(R,q)}};s.showWindow("comments",u)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>V},function(g,C){O(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device.",icon:"InsertImage"},async function(g=null){let C=null,R=null;typeof g=="string"?R=g:C=g?.file?g.file:g,(C||(C=await ge.CommonUtils.openFileDialog(R??"image/*"),C))&&await se(this,{file:C},g?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(g){if(!g){const C=await s.showInput({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(C.option!=="Insert")return;g=C.input}g&&se(this,{fetch:g})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){ve(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features.",icon:"InsertTable"},function(g){let C=null,R=!1;g.isITable?C=g:g.getValue()&&(C=g.getValue(),R=!0),X(this,C,R)}),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"),s=require("react/jsx-runtime"),he=require("@sheetxl/utils"),o=require("react"),gt=require("@sheetxl/grid-react"),Kt=require("react-dom"),uo=o.memo(e=>{const{anchorLocation:t=he.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:h,propsPath:c,style:C,...k}=e,y=a,p=l;let M="red",T=[],z=[];return t===he.AnchorLocation.TopLeft?(M=f?"rgb(255, 198, 246)":"green",T.push(p),z.push(p),T.push(p+y),z.push(p),T.push(p),z.push(p+y)):t===he.AnchorLocation.TopRight?(M=f?"rgb(0, 255, 255)":"red",T.push(n-p),z.push(p),T.push(n-(p+y)),z.push(p),T.push(n-p),z.push(p+y)):t===he.AnchorLocation.BottomRight?(M=f?"rgb(236, 252, 211)":"purple",T.push(n-p),z.push(i-p),T.push(n-(p+y)),z.push(i-p),T.push(n-p),z.push(i-(p+y))):t===he.AnchorLocation.BottomLeft&&(M=f?"rgb(255, 236, 183)":"blue",T.push(p),z.push(i-p),T.push(p+y),z.push(i-p),T.push(p),z.push(i-(p+y))),s.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...C},...k,children:s.jsx("path",{d:`M ${T[0]} ${z[0]} L ${T[1]} ${z[1]} L ${T[2]} ${z[2]} L ${T[0]} ${z[0]} Z`,fill:h??M,...c})})}),ur=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:h,...c}=e,C=o.useMemo(()=>{let M=null;const T=l.getSortField();T&&(M=T.reverse);const z=l.getField(),D=z&&z.criteria&&z.criteria.length>0;return M===!0?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":M===!1?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[l]),[k,y]=o.useState(!1),p=Math.min(Math.min(18,t.height-8),t.width);return s.jsx("div",{style:{width:`${p}px`,height:`${p}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${k&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(p>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...h},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:M=>{f?.(M,l),M.preventDefault()},...c,children:s.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${k&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:s.jsx("path",{d:C})})})},gr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:h=1,view:c,bodyStyle:C,normalStyle:k,showFormulas:y,showZeros:p,docTheme:M,onLinkMouseDown:T,onFilterButtonMouseDown:z,propsFilterButton:D,renderFilterButton:Z=ur,...K}=e,w=i.height/h,L=i.width/h,v=t,I=v.getValue(),q=t.getStyle(),X=C?.darkMode??!1;let E,j;const $=I&&I.isFormulaError,ve=$&&I instanceof d.FormulaError.Parse;let Y,_=y||ve;if(_)if(v.isSpillOverflow())j="";else{const le=v.getFormulaText();le?j=le:E=v.getNumberFormat(d.NumberFormat.Type.General)}else E=v.getNumberFormat();_||(Y=v.getTextOverflow());const A=Y?Y.colBounds.width+Y.leftOffset+Y.rightOffset:L,J=Y?Y.anchorBounds.x-Y.leftOffset:0,x=Y?Y.anchorBounds.width:L,S=Y?Y.anchorBounds.x:0;let oe,ie=v.getRenderHorizontalAlignment();E&&(oe=E?.formattedRuns,j=oe?.runs[0]?.text??E.displayText);const qe=v.getCalcStatus()===d.ICell.CalcStatus.Pending;let de=null,Pe=q.getFill().toCSS(X,i),je=0,De=0;if(!q.getBorder().isEmpty()){const le=q.getBorder().getRight();!le.isNone()&&d.IBorder.BuiltInDefinitions.get(le.getStyle()).width>1&&(je=1);const b=q.getBorder().getBottom();!b.isNone()&&d.IBorder.BuiltInDefinitions.get(b.getStyle()).width>1&&(De=1)}let Ie=null;if(L!==x||je||De||typeof Pe?.backgroundPosition=="number"){const{backgroundPosition:le,...b}=Pe,O=le??0,R=c?.getScrollTopLeft(),P=O?-(i.x+(R.left??0))%O:0,ce=O?-(i.y+(R.top??0))%O:0;(le!==void 0||je||De||L!==x)&&(Object.keys(b).length===1&&b.background==="none"||(Pe=null,Ie=s.jsx("div",{className:"fill",style:{marginLeft:`${P}px`,marginTop:`${ce}px`,left:S*h,width:r.ReactUtils.boundPixel(x*h-P+1+je),height:r.ReactUtils.boundPixel(i.height-ce+1+De),...b}},"background")))}let ke=null;const ge=v.getComments(),B=v.getWarnings(),Fe=v.getErrors();if(ge||$||Fe.length>0||B.length>0){const le={size:7*h,darkMode:X,cellWidth:x*h+2,cellHeight:w*h+2,style:{top:-1,left:S*h-1}};ke=ke??[],(B.length>0||Fe.length>0||$)&&ke.push(s.jsx(uo,{anchorLocation:he.AnchorLocation.TopLeft,...le},`indicator-${ke.length}`)),ge&&ke.push(s.jsx(uo,{anchorLocation:he.AnchorLocation.TopRight,...le},`indicator-${ke.length}`))}const ze=q.getFont();let H=E?.conditionalColor;const W=q.getAlignment(),me=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ue=W.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||me,fe=ue||_?0:W.getRotation(),Me=v.getInsets(),ae=Me.top+Me.bottom;let be=Me.left,g=Me.right;const Le={...l,left:l.left-1,top:l.top-1,width:l.width+1+je,height:l.height+1+De},Oe=v.getColumnFilter(),Te=Oe&&!Oe?.hasHiddenButton();let u=null;qe&&(u=s.jsxs("div",{className:"slider",children:[s.jsx("div",{className:"line"}),s.jsx("div",{className:"subline inc"})]},"pending"));const N=!(qe||Te||Ie||a||ke||oe?.runs.length>1||Y||fe%360!=0);Pe?.background==="none"&&(Pe=null);let U=ue||!(!Y||!(Y.rightIndex>0||Y.leftIndex>0||Y.colSpan>1));if(!U){const le=v.getSpans();(le.width>1||le.height>1)&&(U=!0)}const m={...Pe,...Le,pointerEvents:T?"auto":void 0};if(!he.CommonUtils.isEmpty(j)||!he.CommonUtils.isEmpty(E?.repeatPlaceholder)){const le=E?.canWrap??!1;let b=null,O=null,R=null,P=[],ce=!0;p||_||I!==0||(ce=!1);const se=v.getTextFrame(_);if(ce&&se){let ye=A-1-(be+g);if(fe){b=se.layout().bounds;const He={x:0,y:0,width:A-1,height:w};if(oe){let Ce=oe.width;if(E.repeatPlaceholder||E.repeatChars.length>0){const Ae=d.GeomUtils.boundsToPoints(He),we=d.GeomUtils.rotatePoints(Ae,-fe);Ce=d.GeomUtils.minBoundingRect(we).width}b={...b,width:Ce}}R=d.GeomUtils.clipToOuterRect({...b,width:b.width+1+be+g},He,fe),ye=R.width-1-(be+g)+.01}let ee=null;le&&(ee={width:ye});let pe=null,V=E?.repeatPlaceholder;const Q=se.layout(ee);if(b=Q.bounds,_?b={...b,width:0}:oe&&(b={...b,width:E.repeatPlaceholder||E.repeatChars.length>0?ye:oe.width}),fe&&le){let xe=null;Q.visitLines({visitTextLine:(He,Ce)=>{let Ae=He.bounds;const we=d.GeomUtils.boundsToPoints(Ae),Se=d.GeomUtils.rotatePoints(we,fe),Ne=d.GeomUtils.minBoundingRect(Se);Ae={...Ae,x:(Ne.width-Ae.width)/2,y:(Ne.height-Ae.height)/2},xe=xe?d.GeomUtils.unionBounds(xe,Ae):Ae}}),b={...xe,width:xe.width+be+g}}if(!V&&v.getType()!==d.ScalarType.String&&Math.floor(b.width)>ye){if(q.getNumberFormat()==="General"&&v.getType()===d.ScalarType.Number){const xe=q.measureText("0"),He=Math.floor(ye/xe.width),Ce=I,Ae=he.CommonUtils.splitNumber(Ce),we=Math.min(10,He-(Math.max(1,Ae.ipLength)+1)-(Ce<0?1:0));if(we>=-1){const Se=`0${we>0?".":""}${"#".repeat(Math.max(0,we))}`;pe=v.getNumberFormat(Se).displayText,pe==="0"&&Ce<0&&(pe="-0")}else if(Math.abs(Ce)>=Math.pow(10,5)||Math.abs(Ce)<=Math.pow(10,-5)){const Se=He-5-(Ce<0?1:0);if(Se>=0){const Ne=`0.${"0".repeat(Math.max(0,Se-1))}E+00`;pe=v.getNumberFormat(Ne).displayText}}}pe||(V="#")}if(!V&&oe?.lastRepeatIndex>=0&&oe?.width>ye&&(V="#"),V&&ye>0){const xe=q.measureText(V),He=Math.floor((ye||1)/(xe?.width||1));pe=He>0?V.repeat(He):"",ie=d.ITextFrame.HorizontalAlignment.Center}if(_&&(ie=d.ITextFrame.HorizontalAlignment.Left),pe){const xe=q.measureText(pe).width;xe&&(b={...b,width:xe})}if(O={...b,width:b.width+be+g,height:b.height},fe&&!le){const xe=d.GeomUtils.boundsToPoints(O),He=d.GeomUtils.rotatePoints(xe,fe),Ce=d.GeomUtils.minBoundingRect(He);O.width=Ce.width,O.height=Ce.height}ie===d.ITextFrame.HorizontalAlignment.Center||ie===d.ITextFrame.HorizontalAlignment.CenterContinuous?O.x=(A-O.width)/2:ie===d.ITextFrame.HorizontalAlignment.Right?O.x=A-O.width-.5:O.x=.5,W.getVertical()===d.ITextFrame.VerticalAlignment.Center?O.y=(w-O.height)/2:W.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?O.y=w-O.height-ae:O.y=ae;const re=N?{...K}:void 0,Ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:fe?`rotate(${fe}deg)`:void 0,cursor:T?"pointer":void 0,pointerEvents:T?"auto":void 0,zIndex:U?1:void 0,...Pe},onMouseDown:T,onDoubleClick:T?xe=>{xe.stopPropagation(),xe.preventDefault()}:null,...re};ve&&(Ee.style.textDecorationStyle="wavy",Ee.style.textDecorationColor=X?"rgb(0, 255, 255)":"red",Ee.style.textDecorationLine="underline");const Ue=ze.getSize(),Be=(xe,He,Ce,Ae,we,Se,Ne,Ze=null)=>{let _e=Ue*h,Xe=Ce,at=Ne?.runs?Ne.runs:[{type:d.NumberFormat.ParseRunType.Text,text:xe,width:q.measureText(xe,_e).width}];Ne&&Ne?.width!==b.width&&(b={...b,width:Ne?.width});let ot=be;if(Ne?.lastRepeatIndex>=0&&ye>Ne?.width){const Je=Ne.runs[Ne.lastRepeatIndex];if(Je){const st=[...at],wt=Math.max(0,ye-1-Ne.width);let bt=0,dt="";if(wt>0){const ft=Math.floor(wt/Je.width);dt=ft>0?Je.text.repeat(ft):"",bt=wt}st[Ne.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:dt,width:bt},at=st,b={...b,width:Ne.width+bt}}}const $e=(Je,st,wt,bt,dt,ft,xt,Un,Yt,fn=null)=>{let Pt,jt=Xe.width;we===d.ITextFrame.HorizontalAlignment.Justify?(jt=dt,Se||(Pt="justify")):we===d.ITextFrame.HorizontalAlignment.Distributed&&(jt=dt,Pt=Se||Je.text.split(" ").length-1==0?"center":"justify");const{style:It,className:pt,...pn}=fn;let Ot=Je.text;if(we===d.ITextFrame.HorizontalAlignment.Fill&&E?.repeatChars.length===0){const ut=Math.max(1,Math.floor((Xe?.width??0)/(xt?.width??1)));Ot=Ot.repeat(ut)}let Mt=Xe.height;const At=ze.getVerticalAlignment(),Jt=At===d.IFont.VerticalAlignment.Sub,Kn=At===d.IFont.VerticalAlignment.Super;if(Jt||Kn){const ut=ze.getSuperSubScale();_e*=ut,Mt*=ut}const et={textAlign:Pt,textAlignLast:Pt,...It,...ze.toCSS(X,h,!0),fontSize:_e*d.IFont.getDeviceScale()};N||(et.background=void 0),H&&(et.color=H.toCSS(X));const Qt=ot+st;let Bt=Me.top+Xe.y+0;if(Jt&&(Bt+=Yt-_e),ft){const ut=(xt.x+Qt)*h+1,vt=(xt.y+Bt)*h+1;vt<0?et.marginTop=vt:et.paddingTop=vt,ut<0?(et.width=(It?.width??0)-ut,et.left=(It?.left??0)+ut):et.paddingLeft=ut,et.paddingRight=Math.max(0,(It?.width??0)-jt*h-ut),et.paddingBottom=Math.max(0,(It?.height??0)-Xe.height*h-vt),et.height=(It?.height??0)+(vt<0?-vt:0),(vt<0||ut<0)&&(et.clipPath=`inset(${vt<0?-vt:0}px 0px 0px ${ut<0?1-ut:0}px)`)}else if(et.left=(xt.x+Qt)*h+1,et.top=(xt.y+Bt)*h+1,et.width=xt.width*h,et.height=xt.height*h,fe&&!le){et.left=(xt.x+st)*h+1,et.top=(xt.y+(Xe.y+0))*h+1;const ut=d.GeomUtils.centerPoint({x:ot+st,y:0,width:Je.width,height:Xe.height}),vt=d.GeomUtils.centerPoint({x:ot,y:0,width:dt,height:Xe.height}),Cn=d.GeomUtils.rotatePoints([ut],fe,vt),en={x:Cn[0].x-ut.x,y:Cn[0].y-ut.y};et.left=et.left+en.x*h,et.top=et.top+en.y*h;const Dt={...Xe,x:ot,y:Me.top,width:Xe.width+(be+g)},$n=d.GeomUtils.boundsToPoints(Dt),Wn=d.GeomUtils.rotatePoints($n,fe),yn=d.GeomUtils.minBoundingRect(Wn);Dt.width=yn.width,Dt.height=yn.height;const Ht=d.GeomUtils.centerPoint(Dt),wn={x:Ht.x-vt.x,y:Ht.y-vt.y};et.left=et.left+wn.x*h,et.top=et.top+wn.y*h}et.lineHeight=Mt*h+"px";const vn=N?void 0:"text-line";P.push(s.jsx("div",{className:pt?`${pt} ${vn}`:vn,style:et,...pn,children:Ot},`text-${Xe.y}-${bt}-${wt}`))};if(W.getOverflow()===d.ITextFrame.Overflow.Shrink&&ye>0){let Je=b?.width??0,st=0;for(;Je>1&&Je>ye&&_e>2&&st<100;)_e*=ye/Je,Je=q.measureText(xe,_e).width,st++;b={...b,width:Je}}let lt=Xe.x;we===d.ITextFrame.HorizontalAlignment.Right?lt+=b.width-Xe.width:we!==d.ITextFrame.HorizontalAlignment.Center&&we!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(lt+=(b.width-Xe.width)/2),Ne?.lastRepeatIndex>=0&&(lt=Xe.x);const it=at.length;for(let Je=0;Je<it;Je++){const st=at[Je];(st.type===d.NumberFormat.ParseRunType.Text||st.type===d.NumberFormat.ParseRunType.Repeat)&&(st.type,d.NumberFormat.ParseRunType.Repeat,$e(st,lt,Je,He,we===d.ITextFrame.HorizontalAlignment.Justify||we===d.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?ye:Xe.width,N,{x:O.x+J,y:O.y,width:st.width,height:b.height},0,Ae,Ze)),lt+=st.width}};pe?Be(pe,0,{x:0,y:0,...b},Q.lines[0].baseline,ie,!0,null,Ee):Q.visitLines({visitTextLine:(xe,He,Ce)=>{const Ae=xe.runs[0].text.replace(/\s+$/,""),we=He===Ce-1;let Se=ie===d.ITextFrame.HorizontalAlignment.Justify&&(we||xe.runs[0].text.endsWith(`
8
+ `))?d.ITextFrame.HorizontalAlignment.Left:ie,Ne=0;He>0&&(W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||W.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(w-(ae+3)-xe.bounds.height*Ce)/(Ce-1)*He)),W.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&fe&&fe%90==0&&fe%180!=0&&(Se=d.ITextFrame.HorizontalAlignment.Distributed),Se!==d.ITextFrame.HorizontalAlignment.Justify&&Se!==d.ITextFrame.HorizontalAlignment.Distributed&&Se!==d.ITextFrame.HorizontalAlignment.Fill||(b={...b,width:ye});let Ze=me||E&&(E.repeatChars.length>0||E.spacingChars.length>0)?b.width:xe.bounds.width;const _e={...xe.bounds,y:xe.bounds.y+Ne+0,width:Ze};Be(Ae,He,_e,se.lines[0].baseline,Se,we,Ce===1?oe:null,N&&He>0?{...Ee,style:{...Ee.style,background:void 0}}:Ee)}})}P.length>0&&(de=P)}if(N)return de&&de.length>0?de:s.jsx("div",{style:m,...K});let F=T?"auto":Le.pointerEvents,G=null;if(Te){const le={x:S*h-1,y:-1,width:x*h+1,height:w*h+1};F="auto",G=Z({renderBounds:le,darkMode:X,className:"filter-button",disabled:!v.isEditAllowed(),zoom:h,filter:v.getColumnFilter(),onFilterButtonMouseDown:z,...D}),G&&(G=s.jsx("div",{style:{...le,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:b=>{b.stopPropagation(),b.preventDefault()},children:G},"filterButton"))}qe&&!de&&(de=s.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const te=[Ie,de,a,ke,u,G];return s.jsx("div",{style:{...Pe,...Le,pointerEvents:F},...K,children:te})},Do={text:"",placeholder:""},zo=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},ml=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),hr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:f,onDoneEdit:h,defaultTextStyle:c,useRichStyling:C=!0,bodyStyle:k,activeCoords:y,sheet:p,commands:M,containerBounds:T,setNaturalSize:z,onFocus:D,disabled:Z,style:K,zoom:w=1,linesVisible:L,autoFocus:v=!1,...I}=e,{height:q=0,width:X=0}=T??{},E=k?.darkMode??!1,j=o.useRef(null),[$,ve]=o.useState(!1),[Y,_]=o.useState(null),[A,J]=o.useState(()=>n);o.useEffect(()=>{De.current=!1,J(n)},[n]);const x=o.useMemo(()=>{const b=A.clean();let O=b.getStyle();C||(O=O.createTemporaryStyle({font:{size:c?.fontSize}}));const R=b.getFormula(),P=O.getAlignment(),ce=R?d.ITextFrame.HorizontalAlignment.Left:P.getHorizontal(),se=P.getVertical(),ye=P.getOverflow()===d.ITextFrame.Overflow.Wrap||b.getType()===d.ScalarType.String&&(ce===d.ITextFrame.HorizontalAlignment.Justify||ce===d.ITextFrame.HorizontalAlignment.Distributed||se===d.ITextFrame.VerticalAlignment.Justify||se===d.ITextFrame.VerticalAlignment.Distributed),ee=(Q=>{if(!Q)return Do;const re=Q.clean();if(!re)return Do;let Ee=re.getStyle()?.getQuotePrefix();if(Q.dirty===void 0||Q.dirty===null){let Ue="",Be=re.getFormulaText();Be&&(Ue=Be,Ee=!1),Ue||(Ue=re.toTextUnformatted(!0)??"");let xe="";if(!Q.editMode&&re.isSpillOverflow()){const He=re.getSpill();if(He){const Ce=He.getCell(),Ae=Ce.getFormulaText();Ce.isEqual(re)||(xe=Ae)}}return Ee&&(Ue="'"+Ue),{text:Ue,placeholder:xe}}return{text:Q.dirty??"",placeholder:""}})(A),pe=ee.text,V=d.ITextFrame.toCSSHorizontalTextAlign(C&&!R?A.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:O,isWrapped:ye,textValue:pe,formula:R,frameVertAlign:se,placeholder:ee.placeholder,insets:C?b.getInsets():he.TypesUtils.EmptyRect,textAlign:V}},[A,c,E,w,C]),S=o.useRef(null),oe=r.useImperativeElement(t,()=>({startEdit:b=>{j.current=b?.initialSelection;const O={...n,editMode:b?.editMode??!1};b?.text!==void 0&&(O.dirty=b.text),O.editMode===n.editMode&&O.dirty===n.dirty||(J(O),de?.(O))},submitEdit:()=>Ie(),cancelEdit(){ke()},autoFocus(){S.current.focus()},dispatchEvent:b=>S.current.dispatchEvent(b),focus(){S.current.focus()},getLineHeight:qe}),[i,n]);o.useLayoutEffect(()=>{if(!Y||!$)return;const b=S.current;x.textValue,b&&b.setSelectionRange(Y.start,Y.end,Y.direction)},[S.current,Y,x.textValue]);const ie=o.useMemo(()=>{const b=A?.clean(),O=x.style.createTemporaryTextFrame(x.textValue,b?.getType()===d.ScalarType.String),R=C?b.getInsets().right+b.getInsets().left:0;let P=null;return x.isWrapped&&(P={width:X-R}),O.layout(P)},[x,X,A,C]),qe=r.useCallbackRef(()=>Math.ceil(ie?.lines[0]?.bounds.height),[ie]);o.useLayoutEffect(()=>{if(!ie)return;const b=x.style,O=b.getInsets()??he.TypesUtils.EmptyRect,R=C?O.left+O.right:0,P=C?.04*b.getFont().getSize():1,ce=Math.round(x.isWrapped?void 0:ie.bounds.width+R+P),se=Math.round(ie.bounds.height);z?.({width:ce,height:se})},[ie,z,x,C,A]);const de=r.useCallbackRef(a,[a]),Pe=r.useCallbackRef(b=>{if(A.dirty===b)return;const O={...A};O.dirty=b,S.current,J(O),de?.(O)},[A]),je=r.useCallbackRef(b=>{if(A.editMode===b)return;const O={...A};O.editMode=b,J(O),de?.(O)},[A]),De=o.useRef(!1),Ie=r.useCallbackRef(()=>{if(De.current)return!1;try{l?.(A),h?.(),De.current=!0}catch{return!1}return!0},[l,A]),ke=r.useCallbackRef(()=>{De.current=!0,J(n),f?.(),h?.()},[f,n]),ge=r.useCallbackRef(b=>{if(!S.current)return;if(b.key,b.isDefaultPrevented(),!(b.isTrusted||b.nativeEvent.ctrlKey||b.nativeEvent.metaKey||b.nativeEvent.altKey||b.nativeEvent.isComposing||gt.STANDARD_KEY_CHARS.indexOf(b.nativeEvent.key)===-1&&b.nativeEvent.key!=="Backspace")){const ee={...A};let pe=0;return zo(ee,ee.dirty)&&!isNaN(parseFloat(b.key))?(ee.dirty?.endsWith("%")?ee.dirty=(ee.dirty.substring(0,ee.dirty.length-1)??"")+b.key+"%":ee.dirty=(ee.dirty??"")+b.key+"%",pe=ee.dirty.length-1):b.nativeEvent.key==="Backspace"?(ee.dirty="",pe=ee.dirty.length):(ee.dirty=(ee.dirty??"")+b.key,pe=ee.dirty.length),S.current.value=ee?.dirty,j.current={start:pe,end:pe,direction:"forward"},S.current?.setSelectionRange(pe,pe,"forward"),J(ee),de?.(ee),void b.preventDefault()}const O=b.nativeEvent.ctrlKey,R=b.nativeEvent.shiftKey,P=b.nativeEvent.altKey,ce=b.nativeEvent.metaKey;if(O&&b.key==="z"&&b.stopPropagation(),b.which===r.KeyCodes.Escape)return b.preventDefault(),void ke();if(b.which===r.KeyCodes.F2)return je(!0),void b.preventDefault();const se=b.target;if(b.key==="%"&&se.selectionStart===se.selectionEnd&&se.value[se.selectionStart]==="%"&&A?.clean().getStyle().numberFormat.includes("%"))return _({start:se.selectionStart+1,end:se.selectionEnd+1,direction:se.selectionDirection}),void b.preventDefault();if(b.which===r.KeyCodes.Enter){if(b.preventDefault(),ce||P){const ee=x.textValue.substring(0,se.selectionStart)+`
9
+ `+x.textValue.substring(se.selectionEnd);return Pe(ee),void _({start:se.selectionStart+1,end:se.selectionStart+1,direction:se.selectionDirection})}return void(Ie()&&p.getSelection().traverse(d.IRange.Orientation.Column,R))}if(b.which===r.KeyCodes.Tab)return b.preventDefault(),void(Ie()&&p.getSelection().traverse(d.IRange.Orientation.Row,R));let ye=null;switch(b.which){case r.KeyCodes.Left:ye=d.IRange.Direction.Left;break;case r.KeyCodes.Right:ye=d.IRange.Direction.Right;break;case r.KeyCodes.Up:ye=d.IRange.Direction.Up;break;case r.KeyCodes.Down:ye=d.IRange.Direction.Down}if(ye&&!(O||R||P||ce)&&!A.editMode)return void Ie();A.editMode&&(ye||ml.includes(b.which))&&b.stopPropagation()},[A,p,x]),B=o.useCallback(()=>{S.current?.focus(),setTimeout(()=>{S.current?.select()},0)},[]),Fe=o.useCallback(()=>{S.current?.focus(),console.log("implement toggleRelativeReferences")},[]),ze=r.useCallbackRef(()=>{const b=S.current?.value;let O="";if(y.rowIndex>0){const R=p.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();R&&(O=R.toTextUnformatted(!0))}Pe(b+O)},[y,p]);o.useEffect(()=>p.getRange(y).addListener(()=>{const b={...A,clean:()=>p.getRange(y).getCell()};J(b),de?.(b)}),[y,p,A]);const H=o.useCallback(()=>{const b=A.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();Pe((S.current?.value??"")+b)},[p]),W=o.useCallback(()=>{const b=A.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();Pe((S.current?.value??"")+b)},[p]),me=o.useMemo(()=>({element:()=>S.current,doCopy:b=>{const O=S.current.value.substring(S.current.selectionStart,S.current.selectionEnd);if(b?.isCut){const R=S.current.value.substring(0,S.current.selectionStart)+S.current.value.substring(S.current.selectionEnd,S.current.value.length);Pe(R)}return O}}),[S.current]),ue=o.useMemo(()=>({element:()=>S.current,doPaste:async(b,O)=>{const R=await b.toText?.();if(!R)return!0;const P=S.current.value.substring(0,S.current.selectionStart)+R+S.current.value.substring(S.current.selectionEnd,S.current.value.length);return Pe(P),_({start:S.current.selectionStart+R.length,end:S.current.selectionStart+R.length,direction:"forward"}),!0}}),[S.current]),fe=o.useMemo(()=>({contains:b=>S.current?.contains(b)||!1,focus(){S.current.focus()}}),[]),Me=o.useMemo(()=>[new r.SimpleCommand("selectAll",fe,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},B),new r.SimpleCommand("startEditValueAbove",fe,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ze),new r.SimpleCommand("startEditCurrentTime",fe,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},H),new r.SimpleCommand("startEditCurrentDate",fe,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.Command("relativeReferencesToggle",fe,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Fe),new r.Command("toggleEditorFocus",fe,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ae=o.useMemo(()=>{let b=null;const O=()=>({contains:R=>S.current?.contains(R)||!1,focus(){S.current.focus()}});return b=M?M.createChildGroup(O,"editor",!1):new r.CommandGroup(O,"editor"),b.addCommands(Me,!0),b},[M,Me]),be=o.useMemo(()=>({notifier:null,source:me,target:ue,commands:ae}),[me,ue,ae]);r.useCopyPaste(be);const[g,Le]=o.useState(!v);o.useEffect(()=>{Le(!1)},[]);const Oe=r.useCallbackRef(b=>{ve(!0),ae?.activate();const O=j.current;if(O!==!1){let R,P;const ce=S.current.value;zo(A,ce)&&(R=ce.length-1,P=ce.length-1),R=O?.start??R??ce.length,P=O?.end??P??ce.length,j.current=!1,_({start:R,end:P,direction:"forward"})}D?.(b)},[D,A]),Te=x.insets;let u=Te.left+1;const N=Te.left+Te.right+2-1,U=ie?.bounds.height??0;let m,F=Te.top;x.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?F=Math.max(0,(q-(Te.top+Te.bottom)-U)/2):x.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(F=Math.max(0,q-(Te.top+Te.bottom)-U)),L!==void 0&&ie?.lines[0]?.bounds&&(m=ie?.lines[0]?.bounds.height*L);const G=x.style.getFont();let te=G.getSize();G.isSuperSub()&&(te*=G.getSuperSubScale()),te*=d.IFont.getDeviceScale()*w;const le=C?G.toCSS(E,w):null;return s.jsx("div",{className:"sheet-cell-editor",onMouseDown:b=>{S.current&&document.activeElement!==S.current&&requestAnimationFrame(()=>{S.current.focus()})},ref:oe,...I,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...K},children:s.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:F*w,left:u*w,width:`calc(100% - ${N*w}px)`,maxWidth:`calc(100% - ${N*w}px)`,height:(m??U)*w,maxHeight:(m??U)*w},children:s.jsx("textarea",{spellCheck:"false",placeholder:x.placeholder,ref:S,value:x.textValue,disabled:g,readOnly:Z||p.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...le,fontSize:te?`${te}px`:"inherit",textAlign:x.textAlign,lineHeight:(ie?.lines[0]?.bounds.height??0)*w+"px",height:(ie?.bounds.height??0)*w,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:x.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Oe,onBlur:()=>{ve(!1)},onSelect:b=>{},onChange:b=>{S.current&&!De.current&&(j.current=!1,Pe(b.target.value),x.textValue,b.target.value,b.target.selectionStart,b.target.selectionEnd,b.target.selectionDirection,_({start:b.target.selectionStart,end:b.target.selectionEnd,direction:b.target.selectionDirection}))},onMouseDown:b=>{$&&je(!0)},onKeyDown:ge})})})})),mr=(e,t)=>({clean:e,dirty:t,editMode:!1}),fr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:f=!1,offsetX:h=0,offsetY:c=0,isVertical:C=!1,...k}=e,y=K=>{let w=null;if(K&&n>0){w="";for(let L=0;L<K.length;L++)w+=K[L],L<K.length-1&&(w+=",")}return w},p=y(i);let M=p;a&&(M=y(a));let T=n,z=t,D=null;if(l){T=Math.floor(n/2);const K=T+T/2+1;let w=null;w=C?`M ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+K)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+K)}`,D=s.jsx("path",{strokeWidth:T,strokeDasharray:M,d:w,...k})}if(f){T=n/2;const K=T+T/2;let w=M,L=null;L=C?`M ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+K)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+K)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+K)}`,D=s.jsx("path",{strokeWidth:T,strokeDasharray:w,strokeDashoffset:"1",shapeRendering:"crispEdges",d:L,...k})}let Z=null;return Z=C?`M ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+T/2)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+T/2)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+T/2)}`,s.jsxs(s.Fragment,{children:[s.jsx("path",{strokeWidth:T,strokeDasharray:p,d:Z,...k}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Lt=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)}},fl=function(){},pr=typeof window<"u",pl=pr?o.useLayoutEffect:o.useEffect,No={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Wt=pr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(No),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var c=h[0].contentRect,C=c.x,k=c.y,y=c.width,p=c.height,M=c.top,T=c.left,z=c.bottom,D=c.right;l({x:C,y:k,width:y,height:p,top:M,left:T,bottom:z,right:D})}})},[]);return pl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[fl,No]},vl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Cl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,yl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:h=!1,isVertical:c=!1,intersections:C,layout:k}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const p=n[0],M=n[1],T=n[2],z=n[3];let D=1+(c?z-M:T-p),Z=0;const K=a.getColor().toRGBA(l).toString(),w=y.description.toLowerCase().includes("double");let L,v;const I=c?"rowStart":"colStart",q=c?"rowEnd":"colEnd",X=c?M:p;if(C?.length>0){const ve=C[0];if(ve?.range[I]===i[I]){const _=d.IBorder.BuiltInDefinitions.get(ve.stroke.getStyle());Z=Math.floor(_.width/2)}if(C[C.length-1]?.range[q]===i[q]){const _=d.IBorder.BuiltInDefinitions.get(C[C.length-1].stroke.getStyle());D=Math.floor(D+(_.width===2?0:_.width/2))}if(w){const _=c?"colStart":"rowStart",A=c?"colEnd":"rowEnd",J=c?k?.getRowOffset:k?.getColOffset;let x=0,S=0;L=[],v=[];const oe=C.length;for(let ie=0;ie<oe;ie++){const qe=C[ie];if(qe.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&J){const de=J(qe.range[I])-(X-Z);qe.range[_]<i[_]&&(L.push(de-x),x=de,L.push(1),x++),qe.range[A]>i[A]&&(v.push(de-S),S=de,v.push(1),S++)}}L.length>0&&x<D&&L.push(D-x),v.length>0&&S<D&&v.push(D-S)}}let E=c?-Math.floor(y.width/2):-Z,j=c?-Z:-Math.floor(y.width/2);const $=h&&y.width>2?-1:0;return s.jsx(fr,{offsetX:p+E+$,offsetY:M+j+$,length:D+Z,isVertical:c,stroke:K,width:y.width,dashArray:L??y.pattern,dashArrayAdditional:v,isDouble:w,isAngled:y.description.toLowerCase().includes("slant")},t)},Co=({getBorderAt:e,rendererBorder:t=yl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const h=r.useCallbackRef(n,[n]);return{renderOverlay:o.useMemo(()=>C=>{const k=C.toClipBounds(C.getRangeCoordsBounds(),-3);if(!k)return;const y=h(C);if(y.length===0)return;const p=C.getVisibleColumnOffsets(),M=C.getVisibleRowOffsets();let T=[],z=[];const D=C.getVisibleColumns(),Z=C.getVisibleRows(),K=[],w=[],L=[],v=(Y,_,A,J,x,S,oe)=>{const ie={index:J,stroke:x,visibleIndex:A,edge:S,length:oe};Y[_]||(Y[_]=[]),Y[_].length>0&&Y[_][Y[_].length-1]?.index===J?Y[_][Y[_].length-1]=ie:Y[_].push(ie)},I=C.getVisibleRangeCoords(),q=y.length;for(let Y=0;Y<q;Y++){const _=y[Y],A=_.coords;if(!A)continue;const J=_?.range??{rowStart:A.rowIndex,colStart:A.colIndex,rowEnd:A.rowIndex,colEnd:A.colIndex};if(!he.CoordUtils.isRangesIntersect(J,I)&&!he.CoordUtils.isRangeWithinRange(J,I))continue;const x=A.colIndex,S=A.rowIndex,oe=p[x],ie=M[S];if(J.rowEnd!==J.rowStart){const ze=M[J.rowStart]?.spanIndex??-1,H=M[J.rowEnd]?.spanIndex??M[Z[Z.length-1]].spanIndex+1;T.push({...J,rowStart:ze,rowEnd:H})}if(J.colEnd!==J.colStart){const ze=p[J.colStart]?.spanIndex??-1,H=p[J.colEnd]?.spanIndex??p[D[D.length-1]].spanIndex+1;z.push({...J,colStart:ze,colEnd:H})}const qe=_.value,de=e(qe,Y);if(!de||de.isEmpty())continue;const Pe=de.getLeft(),je=de.getTop(),De=de.getRight(),Ie=de.getBottom();let ke=1,ge=1;if(!oe||!ie)continue;const B=oe.spanIndex,Fe=ie.spanIndex;Pe.isNone()||v(K,B,Fe,S,Pe,d.IBorder.Edge.Left,ke),je.isNone()||v(w,Fe,B,x,je,d.IBorder.Edge.Top,ge),De.isNone()||v(K,B+ge,Fe,S,De,d.IBorder.Edge.Right,ke),Ie.isNone()||v(w,Fe+ke,B,x,Ie,d.IBorder.Edge.Bottom,ge)}const X=(Y,_,A)=>{const J=[];return Y.forEach((x,S)=>{let oe=null;x.sort((qe,de)=>qe.visibleIndex-de.visibleIndex);const ie=x.length;for(let qe=0;qe<ie;qe++){const de=x[qe];if(!de?.stroke||_[S]===void 0&&_[S-1]===void 0)continue;let Pe=!1;if(A){const ke=T.length;for(let ge=0;!Pe&&ge<ke;ge++){let B=T[ge];B.colStart<=de.index&&B.colEnd>=de.index&&B.rowStart<S&&B.rowEnd>=S&&(Pe=!0)}}else{const ke=z.length;for(let ge=0;!Pe&&ge<ke;ge++){let B=z[ge];B.rowStart<=de.index&&B.rowEnd>=de.index&&B.colStart<S&&B.colEnd>=S&&(Pe=!0)}}if(Pe)continue;const je=de.stroke?.getColor(),De=je?je.toRGBA().toString():l,Ie=de.stroke.getStyle()+":"+De;(Ie!==oe?.key||oe&&oe.visibleIndex+1<de.visibleIndex)&&(oe&&J.push(oe),oe={key:Ie,index:_[S]??_[S-1]+1,visibleIndex:de.visibleIndex,edge:de.edge,stroke:de.stroke,from:de.index,to:de.index+de.length-1,intersections:[],length:1}),oe.to=de.index+de.length-1,oe.visibleIndex=de.visibleIndex}oe&&J.push(oe)}),J};T=T.sort(Cl),z=z.sort(vl);const E=X(K,D,!1),j=X(w,Z,!0);if(E.length===0&&j.length===0)return null;const $=j.length;for(let Y=0;Y<$;Y++){const _=j[Y];let A=he.CommonUtils.findEqualOrGreater(E,_.from,x=>x.index),J=!1;for(;!J;){const x=E[A++];x&&x.index>=_.from&&x.index<=_.to+1&&x.from<=_.index&&x.to+1>=_.index&&(_.intersections.push({stroke:x.stroke,range:{rowStart:x.from,rowEnd:x.to+1,colStart:x.index,colEnd:x.index}}),x.intersections.push({stroke:_.stroke,range:{rowStart:_.index,rowEnd:_.index,colStart:_.from,colEnd:_.to+1}})),J=!x||x.index>_.to+1}}for(let Y=0;Y<$;Y++){const _=j[Y];let A=_.stroke;const J=`rBorder:${_.index}:${_.from}:${_.to}:${_.edge}`,x={rowStart:_.index,rowEnd:_.index,colStart:_.from,colEnd:_.to+1},S=C.getLayout(),oe=!1,ie=S.getColOffset(x.colStart),qe=S.getRowOffset(x.rowStart),de=[ie,qe,S.getColOffset(x.colEnd),qe];L.push(t({key:J,points:de,stroke:A,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:x,intersections:_.intersections,layout:S,isVertical:oe}))}const ve=E.length;for(let Y=0;Y<ve;Y++){const _=E[Y];let A=_.stroke;const J=`cBorder:${_.index}:${_.from}:${_.to}:${_.edge}`,x={rowStart:_.from,rowEnd:_.to+1,colStart:_.index,colEnd:_.index},S=C.getLayout(),oe=!0,ie=S.getColOffset(x.colStart),qe=[ie,S.getRowOffset(x.rowStart),ie,S.getRowOffset(x.rowEnd)];L.push(t({key:J,stroke:A,points:qe,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:x,intersections:_.intersections,layout:S,isVertical:oe}))}return s.jsx("svg",{width:`${k.width}`,height:`${k.height}`,viewBox:`0 0 ${k.width} ${k.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${k.width}px`,height:`${k.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:L},"borders")},[e,i])}},Lo=he.AnchorLocation.Center,wl=Object.freeze({horizontal:!1,vertical:!1}),Po=he.TypesUtils.EmptyTopLeft,bl=(e,t)=>he.CoordUtils.EmptyCell,xl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),ql=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:h,forceThinBorder:c,children:C,...k}=e,y=o.useRef(null),[p,{width:M,height:T}]=Wt(),z=n??M,D=i??T,Z=o.useMemo(()=>{const A=[];for(let J=0;J<l;J++)for(let x=0;x<f;x++){const S={colIndex:x,rowIndex:J};A.push({coords:S,value:S})}return A},[]),K=o.useCallback(A=>Z,[Z]),{renderOverlay:w}=Co({getVisibleCells:K,getBorderAt:t,darkMode:h,forceThinBorder:c}),L=Math.floor(z/f),v=Math.floor(D/l),I={getColOffset:A=>Math.ceil(A*L)+0,getRowOffset:A=>Math.ceil(A*v)+0,getColIndex:A=>Math.floor((A-0)/L)-1,getRowIndex:A=>Math.floor((A-0)/v)-1},q={rowStart:0,colStart:0,rowEnd:l,colEnd:f},X={x:0,y:0,width:Math.max(0,z)+0,height:Math.max(0,D)+0},E=o.useMemo(()=>{const A={},J=Math.floor(z/f);for(let x=0;x<f;x++)A[x]={offset:x*J,size:J,spanIndex:x};return A},[z,D]),j=o.useMemo(()=>{const A={},J=Math.floor(D/l);for(let x=0;x<l;x++)A[x]={offset:x*J,size:J,spanIndex:x};return A},[z,D]);if(!w)return null;const $={width:z,height:D},ve={width:z,height:D},Y={getStage:()=>y.current,getTotalSize:()=>$,getViewportSize:()=>ve,getLayout:()=>I,getCellCoordsAsRangeCoords:he.CoordUtils.cellToRange,getVisibleRangeCoords:()=>q,getVisibleRows:()=>{const A=[];for(let J=0;J<l;J++)A.push(J);return A},getTotalRangeCoords:()=>q,getRelativePointFromClient:(A,J)=>({x:A,y:J}),getVisibleColumns:()=>{const A=[];for(let J=0;J<f;J++)A.push(J);return A},toClipBounds:(A,J)=>X,toViewBounds:A=>A,toAbsoluteBounds:A=>A,getBounds:()=>X,getInsets:()=>null,getRangeCoordsBounds:(A,J)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>j,allViews:()=>({[Lo]:Y}),getAnchor:()=>Lo,getZoom:()=>1,scrollCellCoordsIntoView:xl,getCellCoordsFromClient:bl,getScrollOrientation:()=>wl,getScrollTopLeft:()=>Po,getFreezeTopLeft:()=>Po},_=w(Y);return s.jsxs("div",{style:{...a,position:"relative",display:"flex"},...k,children:[s.jsx("div",{ref:Lt([y,p]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:C}),_]})});function vr(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=vr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function ct(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=vr(e))&&(i&&(i+=" "),i+=t);return i}const Sl="_sheetxl-sheet_1qeq6_5",Rl="_viewport-overlay_1qeq6_6",Cr=e=>{const{style:t,...n}=e??{};return s.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[s.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),s.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),s.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),s.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),s.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},kl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...h}=e??{},[c,C]=o.useState(null);o.useEffect(()=>{(async()=>{const v=await d.LicenseManager.getDetails();C(v)})()},[]);const[k,y]=o.useState(!1),p={opacity:.65},M=o.useMemo(()=>{const v=c?.getExceptions(),I=v?.length??0;if(I===0)return null;const q=[];for(let X=0;X<I;X++){const E=v[X];q.push(s.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:E},X))}return q},[c,n]);if(c===null||c.isValidFor(l))return null;const T=c.getType(),z=!M&&T.endsWith("ity"),D=c.getLicensee(),Z=z?1.6:1,K=135/Z,w=37/Z;let L=null;return!T&&D?.length>0&&(L=s.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),s.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...h,children:s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[k?s.jsx(Cr,{style:p}):s.jsx("svg",{width:K,height:w,style:p,children:s.jsx("image",{style:{width:K,height:w},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),s.jsxs("div",{children:[L,M,s.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),Qe=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),f={},h=l.length;for(let C=0;C<h;C++){const k=l[C];f[k]=(y,p)=>{i.current[k]?.(y,p)}}const c=e.addListeners(f,n);if(a)for(let C=0;C<h;C++)f[l[C]](e);return()=>{c?.()}},[e])},En=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){const n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw new Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,e)}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw new Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return he.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const i=n.contributionPoints;if(i&&i.length!==0)for(let a of i)a.startsWith(e)&&t.push(n)}return t}},yr=o.createContext(void 0),Ml={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},wr=()=>o.useContext(yr)||Ml,Gt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},yo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:h,style:c,className:C,...k}=e,y=o.useMemo(()=>ct("taskpane-title",C,Gt.TaskPaneTitle,{focused:h}),[C,h]);return s.jsxs("div",{ref:t,className:y,style:c,...k,children:[s.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),s.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:p=>{p.stopPropagation()},onPointerUp:()=>{l()},children:s.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));yo.displayName="TaskPaneTitle";const Tl=e=>s.jsx(yo,{...e}),Il=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:h,onMounted:c,onUnmounted:C,wrapperPane:k,propsPane:y,renderTaskPanelTitle:p=Tl,style:M,className:T,...z}=e,[D,Z]=o.useState(null),[K,w]=o.useState(!1),L=r.useCallbackRef(a,[a]),v=o.useRef(null),I=o.useRef(null);o.useEffect(()=>(c?.(i),()=>{C?.(i)}),[i]);const q=o.useRef([]),X=o.useMemo(()=>({addListener:$=>{const ve=l($);return q.current.push(ve),ve},close:()=>{L?.()},focus:$=>{v.current?.focus($)}}),[l]);o.useEffect(()=>()=>{for(const $ of q.current)$();q.current=[]},[]);const E=o.useMemo(()=>(i.renderTaskPanelTitle??p)({ref:I,title:i.getTitle(),icon:null,readOnly:!1,focused:K,onClose:L,onPointerDown:$=>{}}),[i,K]),j=o.useMemo(()=>{let $=i.renderTaskPane({entryKey:i.key,model:f,commands:h,frame:X,...y},t);return k&&($=k($)),$},[i,f,h,t]);return s.jsxs("div",{className:ct("taskpane-frame",T,Gt.TaskPaneFrame),tabIndex:0,ref:v,style:M,onPointerDown:async $=>{$.currentTarget.focus()},onFocus:$=>{$.relatedTarget&&!D&&Z($.relatedTarget),w(!0)},onBlur:$=>{D&&!v?.current?.contains($.relatedTarget)&&Z(null),$.relatedTarget&&w(!1)},...z,children:[s.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:E}),s.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:j})]})})),wo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:h=En,style:c,className:C,...k}=e,y=o.useMemo(()=>a.map(T=>{const z=h.getRegisteredTaskPane(T);if(!z)return null;let D=z.getIcon?.();D&&(typeof D=="string"&&(D=s.jsx(r.DynamicIcon,{iconKey:D})),D=s.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:D}));const Z=T===f;return s.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ct("taskpane-strip-item",Gt.TaskPaneStripItem,{selected:Z}),onClick:()=>e.onSelect(T),children:[D,z.getTitle()]},T)}),[a,f,l,h]),p=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),M=o.useMemo(()=>ct("taskpane-strip",C,Gt.TaskPaneStrip),[C]);return s.jsx("div",{ref:p,className:M,style:c,...k,children:y})}));wo.displayName="TaskPaneStrip";const El=e=>s.jsx(wo,{...e}),Fl=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=En,model:a,commands:l,onOpen:f,onClose:h,wrapperPane:c,propsPane:C,wrapperFrame:k,propsFrame:y,renderTaskPanelTitle:p,renderTaskPaneStrip:M=El,alwaysShowStrip:T,style:z}=e,D=r.useCallbackRef(f,[f]),Z=r.useCallbackRef(h,[h]),[K,w]=o.useState(null),L=o.useRef(null),[v,I]=o.useState([]),q=o.useRef(new Set),X=r.useCallbackRef(async(A,J=!1)=>{const x=Array.from(q.current),S=x.length;let oe=!0;for(let ie=0;oe&&ie<S;ie++){const qe=x[ie];if(qe.onBeforeHide)try{await Promise.resolve(qe.onBeforeHide())===!1&&(oe=!1)}catch{oe=!1}}return oe},[]),E=r.useCallbackRef(A=>{const J=Array.from(q.current),x=J.length;I(S=>{const oe=S.findIndex(qe=>qe.key===A);if(oe===-1)return S;const ie=[...S];return ie.splice(oe,1),ie.length===0?(w(null),Z?.(),ie):(j(ie[Math.max(ie.length-1,oe-1)].key),ie)});for(let S=0;S<x;S++){const oe=J[S];try{oe.onHide?.()}catch{}}},[Z]),j=r.useCallbackRef(async A=>{const J=i.getRegisteredTaskPane(A);if(!J)return void console.warn(`Invalid taskpane '${A}'`);if(L.current===A||K&&!await X(K.key))return;const x=o.createRef();let S=s.jsx(Il,{ref:()=>{L.current=null},entry:J,model:a,commands:l,close:async()=>{await X(A)&&E(A)},wrapperPane:c,propsPane:C,renderTaskPanelTitle:p,listenerContainer:ie=>(q.current.add(ie),()=>{q.current.delete(ie)}),onMounted:ie=>{ie.key===A&&(L.current=null),D?.()},onUnmounted:ie=>{},...y});k&&(S=k(S));const oe={key:A,elem:S,ref:x};I(ie=>{if(ie.findIndex(de=>de.key===A)!==-1)return ie;const qe=[...ie];return qe.push(oe),qe}),w(oe),L.current=A},[K,k,C,p]);o.useEffect(()=>{K&&!L.current&&j(K.key)},[y,a]);const $=r.useImperativeElement(t,()=>({activateTaskPane:j}),[i,C,a,l]),ve=o.useMemo(()=>v.map(A=>A.key),[v]),Y=o.useMemo(()=>{if(ve.length<=1&&!T)return null;const A={className:Gt.TaskPaneAreaStrip,taskPanes:ve,selected:K?.key,onSelect:J=>{j(J)},registry:i};return M(A)},[ve,K,i,T]),_=K?.elem;return s.jsxs("div",{ref:$,className:ct("taskpane-area",n,Gt.TaskPaneArea),style:z,children:[_,Y]})})),qn=new d.Color("transparent");function br(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:h}=e,c=r.useNotifier(),C=wr(),k=r.useCallbackRef(f,[f]),y=r.useCallbackRef(h,[h]),p=o.useMemo(()=>({serializer:{parse:u=>u?t?.getStyles().parseColor(u):null,stringify:u=>u?u.toString():null}}),[t]),[M,T]=r.usePersistenceState("sheet.lastBorder",null),[z,D]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),p),[Z,K]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),p),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const[L,v]=o.useReducer(u=>u+1,0),[I,q]=o.useReducer(u=>u+1,0),X=r.useGlobalClipboard(),E=o.useRef(null),[j,$]=o.useReducer(u=>u+1,0),[ve,Y]=o.useReducer(u=>u+1,0),_=o.useRef(null),A=r.useCallbackRef(()=>{if(!t)return null;const u=_.current;if(u)return u;const N=t.getSelectedCell(),U=N.getCoords(),m=t.getSelectedRanges(),F=t.getSelectedRange(),G=t.getTables(),te=G.getItems({address:F}),le=G.getItems({address:U});let b=null;le.length>0&&(b=le[0]);const O=m.getMerges().length>0,R=m.isOverlapping();let P=!0;const ce=m.getCoords(),se=ce.length;for(let ye=0;P&&ye<se;ye++)P=he.CoordUtils.isSingleCell(ce[ye]);return u&&b===u.table&&he.CommonUtils.isEqualArrays(te,u.tables)||requestAnimationFrame(()=>{Y()}),_.current={tables:te,table:b,ranges:m,rangesCoords:ce,range:F,cell:N,containsMerge:O,isOverlapping:R,isSingleCell:P},_.current},[t]),J=o.useCallback(he.CommonUtils.debounce($,210),[]);o.useEffect(()=>{E.current=t,$()},[t]),Qe(t.getSelection(),{onChange:()=>{_.current=null,J()}});const x=r.useCallbackRef(async(u,N,U=null,m=!1,F=!0)=>{const G=u?.label?.(),te=async()=>{const R=await Promise.resolve(F&&c.showBusy(G??"Busy..."));try{await t.doBatch(async()=>N(t),G),m&&w.setMode(null),R&&R()}catch(P){if(R&&R(),!P)return;c.showError(P)}},le=[];let b=!1;const O=async()=>(le.push(te),(async()=>{if(!b){for(b=!0;le.length>0;){const R=le.shift();R&&await R()}b=!1}})());if(n){let R=null;if(U!==!1&&u){const P=U??G;R=new r.SimpleCommand(u.key(),l,{label:P,description:P},O)}n(R)}return O()},[t,n,c]),S=r.useCallbackRef((u,N,U=!1,m)=>(m||(m={autoSelect:!0,autoFit:!0}),x(u,F=>{const G=F.getSelectedRanges();U&&G.getStyle().update(null,m),G.getStyle().update(N,m)})),[t]),oe=r.useCallbackRef((u,N)=>{x(u,U=>{U.getSelectedRange().setHyperlink(N)})},[t]),ie=r.useCallbackRef((u,N)=>{x(u,U=>{U.getSelectedRange().setComments(N)})},[t]),qe=r.useCallbackRef((u,N)=>{x(u,U=>{U.getSelectedRanges().clear(N)})},[t]),de=r.useCallbackRef(async(u,N,U=!1,m=!1)=>x(u,async F=>{let G=F.getSelectedRanges();U&&(N===d.IRange.Orientation.Row?G=G.getEntireRows(m):N===d.IRange.Orientation.Column&&(G=G.getEntireColumns(m)));let te=null;const le=w.getMode()?.key;if(le==="copy"||le==="cut"){const b=await X.getClipboard().readReference();b&&b.getItemType()==="range"&&(te=b.getItem(),te.getCoords()||(te=null))}if(te){const b=await G.insertFrom(te,{...te.getMarkOptions(),orientation:N,autoSelect:!0});!b||b.isEntireRows()||b.isEntireColumns()||b.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else G.insert({orientation:N,autoSelect:!0})},"Insert Cells",!1),[w]),Pe=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),je=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),De=r.useCallbackRef((u,N)=>{x(u,async U=>{const m=U.getSelectedRange(),F=U.getSelectedCell().getCoords();let G=null,te=0;const le=F.rowIndex>0?U.getRange({rowIndex:F.rowIndex,colIndex:F.colIndex}).getExtended(d.IRange.Direction.Up):null;le&&U.getRange({colStart:F.colIndex,rowStart:le.getCoords().rowStart,colEnd:F.colIndex,rowEnd:le.getCoords().rowStart}).isContentful()&&(G=d.IRange.Direction.Up,te=F.rowIndex-le.getCoords().rowEnd);const b=F.colIndex>0?U.getRange({rowIndex:F.rowIndex,colIndex:F.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(b&&U.getRange({colStart:b.getCoords().colStart,rowStart:F.rowIndex,colEnd:b.getCoords().colStart,rowEnd:F.rowIndex}).isContentful()){const R=F.colIndex-b.getCoords().colEnd;(R<te||!G)&&(G=d.IRange.Direction.Left,te=R)}let O=null;if(G===d.IRange.Direction.Up){if(O={...le.getCoords()},(O.rowEnd===F.rowIndex||!U.getRange({colIndex:F.colIndex,rowIndex:F.rowIndex-1}).isContentful())&&O.rowStart>0&&U.getRange({colIndex:F.colIndex,rowIndex:O.rowStart-1}).isContentful()){const R=le.getExtended(d.IRange.Direction.Up);O={colStart:F.colIndex,rowStart:R.getCoords().rowStart,colEnd:F.colIndex,rowEnd:le.getCoords().rowEnd}}O.rowEnd=F.rowIndex-1}else if(G===d.IRange.Direction.Left){if(O={...b.getCoords()},(O.colEnd===F.colIndex||!U.getRange({colIndex:F.colIndex-1,rowIndex:F.rowIndex}).isContentful())&&O.colStart>0&&U.getRange({colIndex:O.colStart-1,rowIndex:F.rowIndex}).isContentful()){const R=b.getExtended(d.IRange.Direction.Left);O={colStart:R.getCoords().colStart,rowStart:F.rowIndex,colEnd:R.getCoords().colEnd,rowEnd:F.rowIndex}}O.colEnd=F.colIndex-1}if(m.size!==1&&G){const R=m.getCoords(),P=m.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),ce={...O},se=R.rowStart,ye=R.rowEnd,ee=R.colStart,pe=R.colEnd,V=G===d.IRange.Direction.Up;for(let Q=ee;Q<=pe;Q++){ce.colStart=V?Q:O.colStart+(Q-ee),ce.colEnd=V?Q:O.colEnd+(Q-ee);for(let re=se;re<=ye;re++){ce.rowStart=V?O.rowStart+(re-se):re,ce.rowEnd=V?O.rowEnd+(re-se):re;const Ee=U.getRange(ce).toString();P.pushAt(re,Q,`=${N}(${Ee})`)}}P.apply()}else{const R=O?U.getRange(O).toString():"",P=`=${N}(`;k?.({text:`${P}${R})`,editMode:!0,initialSelection:{start:P.length,end:P.length+R.length}})}},!1)},[t]),Ie=r.useCallbackRef((u,N,U=!1,m=!0)=>{x(u,async F=>{const G=A()?.table;if(G)return void G.updateStyleOptions(N);const te=F.getSelectedRanges().getFixed(!0),le=F.getSelectedRange().getDefaultSortCriteria(),b={getNames:()=>F.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},O={ranges:te,hasHeader:le?.options?.hasHeader??!1},R=async ce=>{if(!(ce=await Promise.resolve(ce)))return null;const se=await Promise.resolve(c.showBusy(u.label()));try{await F.getTables().add(ce.ranges.at(0),{styleName:N?.name,clearFormatting:U,hasHeader:ce.hasHeader}).getRange().select(),se()}catch(ye){se(),c.showError(ye)}};if(!m)return void await R(O);const P={initialValue:O,context:()=>b,onInput:ce=>{R(ce)}};c.showWindow("tableNew",P)},!1,!0,!1)},[]),ke=r.useCallbackRef(()=>i,[i]),ge=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:ke,getNames:()=>t.getNames()}),[t]),B=r.useCallbackRef(async(u,N,U,m=!0)=>{if(!N){const G=A();if(!G)return;let te=G.range;te.size===1&&(te=te.getSurrounding());const le=G.table;le&&(N=le),await te.select()}if(!N)return;try{U&&await N.select()}catch{}if(!m)return;const F=new Promise(async(G,te)=>{u.update({context:ge(N)}),C.activateTaskPane("tableDetails",{}),G(!0)});try{if(!await F)return}catch(G){c.showError(G)}},[c]),Fe=r.useCallbackRef(async(u,N,U=!1)=>{let m=null;if(N?N.isITable?m=N:N.getValue()&&(m=N.getValue()):m=A()?.table,m){if(!U){const F=m.getRange().getCoords(),G=(F.colEnd-F.colStart+1)*(F.rowEnd-F.rowStart+1);if(G>1e4&&await c.showOptions({title:"Confirm",description:`Converting a table to range with '${G}' cells will set a large number of cell styles and may affect performance.
10
+ Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}x(u,async()=>{U?m.delete():m.convertToRange()},!1,!0)}},[c]),ze=r.useCallbackRef((u,N,U)=>{x(u,async m=>{const F=A();if(!F)return;const G=F.ranges;if(G.getCount()>1)throw new he.ExpectedError("Can not sort on multiple cell ranges. Please select a single range and try again.");let te=G.at(0);te.size===1&&(te=te.getSurrounding());const le=F.cell;let b=te.getDefaultSortCriteria(d.IRange.Orientation.Row,le);if(!b){if(U)throw new he.ExpectedError("Invalid sort selection. Sort requires a single range with data.");return}const O=async ye=>{if(!(ye=await Promise.resolve(ye)))return;const ee=await Promise.resolve(c.showBusy(u.label()));try{te.doBatch(()=>{const pe={...ye,...N};te.sort(pe),te.autoFit({orientations:pe?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(pe){ee(),c.showError(pe)}ee()};let R=b.options;if(!U)return void await O(R);let P=te;R.hasHeader&&(P=te.getIntersect(b.sortCoords)),P.select();const ce={range:te,cell:le},se={initialValue:R,context:()=>ce,onInput:ye=>{O(ye)}};c.showWindow("sort",se)},!1,!1,!1)},[c]),H=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),N=t.getSelectedRanges().getFlattened().getCoords(),U=(G=>{const te=new Blob([G],{type:"application/javascript"}),le=URL.createObjectURL(te),b=new Worker(le);return URL.revokeObjectURL(le),b})("console.log('hello from worker');");setTimeout(()=>{U.terminate(),console.log("Worker terminated")},5e3);let m=-1;for(let G=0;m===-1&&G<N.length;G++)he.CoordUtils.isCellWithinRange(u.cell,N[G])&&(m=G);if(he.CoordUtils.isEqualRangesArrays(u.ranges,N))return;const F={cell:u.cell,ranges:N,rangeIndex:m};t.getSelection().updateCoords(F)},[t]),W=r.useCallbackRef(()=>{console.log("selectComments")},[t]),me=r.useCallbackRef(async(u=!1,N=!1)=>{let U=null;if(N)U=t.getEntireRange();else{const m=t.getSelectedRange();if(m.isEntireRange()){const F=t.getSelection().getCoords().cell,G=t.getRange(F);U=G.getSurrounding(),U.isEntireRange()&&(U=G)}else U=m.getSurrounding({contentOnly:u})}U&&await U.select()},[t]),ue=r.useCallbackRef((u,N,U)=>{x(u,async m=>{let F=m.getSelectedRanges();U&&(N===d.IRange.Orientation.Row?F=F.getEntireRows():N===d.IRange.Orientation.Column&&(F=F.getEntireColumns())),F.delete(N)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let N=null;const U=y(),m=Math.min(U.width-8,480),F=Math.min(U.height-8,288);try{t.getSelectedRanges(),N=await t.getMovables().add({bounds:{x:U.left+(U.width-m)/2,y:U.top+(U.height-F)/2,width:m,height:F},type:"chart",json:u.template}),N.select(),w.setMode(null)}catch(G){c.showError(G)}return N},[t,c]);const fe=r.useCallbackRef(async(u,N,U)=>{const m=await c.showBusy(u.label());try{const F=await t.getMovables().addImage(N,{autoSelect:!0,...U});return m(),w.setMode(null),F}catch(F){m();let G=F;typeof G!="string"&&(console.warn(F),G="Unable to resolve image."),c.showMessage(G,{type:r.NotifierType.Error})}},[t,c]),Me=r.useCallbackRef((u,N)=>{x(u,async U=>{const m=U.getSelectedRanges();m.doBatch(()=>{const F=N===d.IRange.Direction.Up||N===d.IRange.Direction.Down,G=m.getCoords().slice().sort(he.CoordUtils.createRangeComparator(F?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let te=0;te<G.length;te++){const le=G[te];let b=le;const O=U.getRange(b).getMerges();let R=0,P=0;if(O.length>0){const ce=O[0];R=ce.rowEnd-ce.rowStart,P=ce.colEnd-ce.colStart}N===d.IRange.Direction.Left?b={...le,colStart:le.colEnd+P}:N===d.IRange.Direction.Right?b={...le,colEnd:le.colStart+P}:N===d.IRange.Direction.Up?b={...le,rowStart:le.rowEnd+R}:N===d.IRange.Direction.Down&&(b={...le,rowEnd:le.rowStart+R}),U.getRange(b).autoFill(le,{filler:d.AutoFill.Types.Copy}),U.getRange(le).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.label()})})},[c]),ae=r.useCallbackRef(()=>{let u=null;const N=t.getSelectedCell().getCoords();if(N?.rowIndex>0){const U=t.getRange({rowIndex:N.rowIndex-1,colIndex:N.colIndex}).getCell();U&&(u=U.toTextUnformatted(!0))}k?.({text:u})},[t]),be=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",icon:"FormulaView",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank.",icon:"ViewZero"}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>W()),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)=>me(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>me(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>H()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation.",icon:"TextRotation315"}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward.",icon:"TextRotation45"}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left.",icon:"TextRotation90"}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right.",icon:"TextRotation2702"}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward.",icon:"TextRotation315"}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle.",icon:"TextRotationCustom"}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically.",icon:"TextRotationVertical"}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending",sortFilter:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){ze(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending",sortFilter:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){ze(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…",sortFilter:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.",icon:"SortCustom"},function(){ze(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
+ For example, you can prevent people from editing locked cells or making formatting changes.`,icon:"Lock"}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet.",icon:"PresetStyles"},function(u){S(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(u){Ie(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(u){Ie(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){Ie(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Pe),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},je),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){S(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){S(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){S(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",icon:"TextItalic",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",icon:"TextUnderline",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){S(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){S(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,N){const U=this,m={initialValue:u??N.state(),context:()=>N.context(),onInput:(F,G)=>{S(U,{numberFormat:F})}};c.showWindow("numberFormat",m)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){S(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:d.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){S(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){S(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){S(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){S(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u){u&&De(this,u.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){De(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){De(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){De(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){De(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){De(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){k?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){k?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("updateHyperlink",l,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",icon:"HyperlinkInset",context:()=>A().cell,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,N){const U=this,m={context:N.context(),onInput:F=>{oe(U,F)}};c.showWindow("hyperlink",m)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",icon:"HyperlinkGoto",context:()=>A().cell},async(u,N)=>{const U=N.context()();if(!U)return;const m=U.getHyperlink();if(m)try{await m.open()}catch(F){c.showError(F)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>A().cell},function(u,N){oe(this,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,N)=>{((U,m)=>{U?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[m," is not yet implemented.",s.jsx("br",{}),s.jsx("br",{}),"Please see the ",s.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(c,N.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",icon:"CommentInsert",context:()=>A().cell},async function(u,N){const U=this,m={context:N.context(),onInput:F=>{ie(U,F)}};c.showWindow("comments",m)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>A().cell},function(u,N){ie(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device.",icon:"InsertImage"},async function(u=null){let N=null,U=null;typeof u=="string"?U=u:N=u?.file?u.file:u,(N||(N=await he.CommonUtils.openFileDialog(U??"image/*"),N))&&await fe(this,{file:N},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(u){if(!u){const N=await c.showInput({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",propsInput:{style:{minWidth:"440px"}},options:["Insert"]});if(N.option!=="Insert")return;u=N.input}u&&fe(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Ie(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features.",icon:"InsertTable"},function(u){let N=null,U=!1;u.isITable?N=u:u.getValue()&&(N=u.getValue(),U=!0),B(this,N,U)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
12
12
 
13
- The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(g){de(this,g,!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(u){Fe(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
14
14
 
15
- The values and the formatting are preserved.`,icon:"InsertTable"},function(g){de(this,g,!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 g=this.context().table();g&&g.setShowTotals(!g.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{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",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter",sortFilter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const g=this.context().table();g&&g.setShowFilterButton(!g.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply",sortFilter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",icon:"FilterReapply",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear",sortFilter:"Clear"},description:"Clear the filters criteria from the current filter..",icon:"FilterClear"}),new r.SimpleCommand("startEditValueAbove",l,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ie),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook.",icon:"FormatPaint.yellow"}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",icon:"InsertCells",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){oe(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right.",icon:"InsertCellsRight"},function(){oe(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward.",icon:"InsertCellsDown"},function(){return oe(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position.",icon:"InsertRow"},function(){return oe(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position.",icon:"InsertColumn2"},function(){return oe(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 oe(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 oe(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",icon:"DeleteCells",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return me(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward.",icon:"DeleteCellsUp"},function(){return me(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right.",icon:"DeleteCellsLeft"},function(){return me(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection.",icon:"DeleteRows"},function(){return me(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection.",icon:"DeleteColumns"},function(){return me(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",icon:"FillDown",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Se(this,d.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",icon:"FillRight",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return Se(this,d.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection.",icon:"FillUp"},function(){return Se(this,d.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection.",icon:"FillLeft"},function(){return Se(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 F(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 F(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return F(this,g=>{const C=g.getAlignment().getIndent()-1;return{alignment:{indent:C>0?C:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return F(this,g=>{const C={alignment:{indent:g.getAlignment().getIndent()+1}};return g.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(C.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),C})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",icon:"MergeAll",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows.",icon:"MergeHorizontal"}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns.",icon:"MergeVertical"}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells.",icon:"MergeUnMerge"}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},icon:"ClearContents",description:`Clear only the contents in the cells.
15
+ The values and the formatting are preserved.`,icon:"InsertTable"},function(u){Fe(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",sortFilter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",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",sortFilter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",icon:"FilterReapply",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear",sortFilter:"Clear"},description:"Clear the filters criteria from the current filter..",icon:"FilterClear"}),new r.SimpleCommand("startEditValueAbove",l,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ae),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook.",icon:"FormatPaint.yellow"}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",icon:"InsertCells",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){de(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right.",icon:"InsertCellsRight"},function(){de(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward.",icon:"InsertCellsDown"},function(){return de(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position.",icon:"InsertRow"},function(){return de(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position.",icon:"InsertColumn2"},function(){return de(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 de(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 de(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",icon:"DeleteCells",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return ue(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward.",icon:"DeleteCellsUp"},function(){return ue(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right.",icon:"DeleteCellsLeft"},function(){return ue(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection.",icon:"DeleteRows"},function(){return ue(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection.",icon:"DeleteColumns"},function(){return ue(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",icon:"FillDown",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Me(this,d.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",icon:"FillRight",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return Me(this,d.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection.",icon:"FillUp"},function(){return Me(this,d.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection.",icon:"FillLeft"},function(){return Me(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 S(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 S(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return S(this,u=>{const N=u.getAlignment().getIndent()-1;return{alignment:{indent:N>0?N:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return S(this,u=>{const N={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(N.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),N})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",icon:"MergeAll",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows.",icon:"MergeHorizontal"}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns.",icon:"MergeVertical"}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells.",icon:"MergeUnMerge"}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},icon:"ClearContents",description:`Clear only the contents in the cells.
16
16
 
17
- The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){ee(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},icon:"ClearFormats",description:"Clear only the formatting that is applied to the cells."},function(){ee(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(){ee(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){ee(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},icon:"ClearAll",description:`Clears everything from the cells.
17
+ The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){qe(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},icon:"ClearFormats",description:"Clear only the formatting that is applied to the cells."},function(){qe(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(){qe(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){qe(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},icon:"ClearAll",description:`Clears everything from the cells.
18
18
 
19
- All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){ee(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("resizeRows",l,{label:"Resize Rows",description:"Resize the rows to the specified height.",icon:"RowsResize"}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"}),new r.SimpleCommand("resizeColumns",l,{label:"Resize Columns",description:"Resize the columns to the specified width.",icon:"ColumnsResize"})],[]),v=o.useMemo(()=>{let g=null;return g=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),g.addCommands(Ne,!0),g},[a,Ne]),[Oe,tt]=o.useState(!1),[te,Te]=o.useState(!1);o.useEffect(()=>{if(T.current!==t||!m)return;const g=m.getCoords(),C=t.getTables().getItems({address:g[0]});K(le=>ge.CommonUtils.isEqualArrays(le,C)?le:C),b&&C[0]&&ge.CoordUtils.isCellWithinRange(b,C[0].getRange().getCoords())?he(C[0]??null):he(null);const R=t.getSelectedRanges(),u=R.getMerges().length>0,q=R.isOverlapping();let E=!0;for(let le=0;E&&le<g.length;le++)E=ge.CoordUtils.isSingleCell(g[le]);Te(q),tt(C.length===0&&!q&&(u||!E))},[Re,m,t]),r.useCommands(a,null,{onChange:()=>{const g=!t.getProtection().isFormatCellsAllowed(),C=U.getMode()?.key==="formatPainter";v.getCommand("formatPainterToggle").update({disabled:g||!a?.getCommand("copy"),state:()=>C}).updateCallback(()=>C?void U.setMode(null):v.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`}}))}},[U,we,a]),et(t.getView(),{onFreezeSplitChange:()=>{Le()}}),et(t.getSelection(),{onChange:()=>{Z()}});const Pe=()=>{v.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),v.getCommand("formatSheetTabColor").updateCallback(g=>{t.setTabColor(g)}).update({state:()=>t?.getTabColor()??kn,context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:kn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},ze=()=>{v.getCommand("formatBorder").update({context:()=>({onBorderSelect:g=>{x(g)},darkMode:i.darkMode,quickBorder:H,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(()=>{ze()},[H]),o.useEffect(()=>{const g=!t.getProtection().isInsertHyperlinksAllowed();v.getCommand("openHyperlink").update({disabled:!V().getHyperlink()}),v.getCommand("deleteHyperlink").update({disabled:g||!V().getHyperlink()});const C=V().getHyperlink()?"Edit":"Insert",R="Link";v.getCommand("updateHyperlink").update({label:()=>(V().getHyperlink(),`${C} ${R}`),icon:()=>C==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${C} ${R}…`,insert:`${R}…`,hyperlink:`${C}…`},disabled:g})},[V()?.getHyperlink(),we]),o.useEffect(()=>{const g=V().getComments(),C=()=>g?"Edit":"Insert",R=()=>g?"Comments":"Comment";v.getCommand("updateComments").update({label:()=>`${C()} ${R()}`,icon:()=>g?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${C()} ${R()}…`,insert:`${R()}…`}})},[V()?.getComments(),we]),et(t,{onViewChange:()=>{const g=t.getView();v.getCommand("sheetViewToggleFormulaView").update({state:g.isShowFormulas()}),v.getCommand("sheetViewToggleShowZeros").update({state:g.isShowZeros()}),v.getCommand("gridlinesToggle").update({state:g.isShowColumnGridlines()||g.isShowRowGridlines()}),v.getCommand("sheetViewToggleGridlinesColumns").update({state:g.isShowColumnGridlines()}),v.getCommand("sheetViewToggleGridlinesRows").update({state:g.isShowRowGridlines()}),v.getCommand("sheetViewToggleShowHeadings").update({state:g.isShowColumnHeaders()||g.isShowRowHeaders()}),v.getCommand("sheetViewToggleShowHeadingColumns").update({state:g.isShowColumnHeaders()}),v.getCommand("sheetViewToggleShowHeadingRows").update({state:g.isShowRowHeaders()}),v.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),Pe()},onTabColorChange:()=>{Pe()},onMergesChange:()=>{Le()},onMovablesChange:()=>{Le()},onTablesChange:()=>{Le()},onProtectionChange:()=>{Le(),ke()},onStyleChange:()=>{Pe(),ze(),Le()}}),o.useEffect(()=>{Pe(),ze()},[i]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),C=j.length>0&&!be||g,R=Y(be),u={context:R};v.getCommand("editTable").update(u),v.getCommand("deleteTable").update(u),v.getCommand("convertTableToRange").update(u);const q={context:R,disabled:C};v.getCommand("formatTableStyle").update({label:be?"Apply Table Style":"Format As Table",...q}),v.getCommand("formatTableStyleClearCellStyles").update(q),v.getCommand("deleteTableStyle").update(q),v.getCommand("convertTableToRange").update(q),v.getCommand("insertTable").update({disabled:C||j.length>0});const E={context:R,disabled:C||j.length===0};v.getCommand("tableHeaderRowToggle").update(E),v.getCommand("tableTotalRowToggle").update(E),v.getCommand("autoFilterToggle").update(E),v.getCommand("formatTableStyleClearTableStyle").update({...E,disabled:E.disabled||!be||be.getStyleOptions().name===null})},[be,j,we]),o.useEffect(()=>{v.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),v.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),v.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),v.getCommand("gridlinesToggle").updateCallback(()=>{const g=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!g,showRowGridlines:!g})}),v.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),v.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),v.getCommand("sheetViewFormatGridlinesColor").updateCallback(g=>{t.getView().update({gridLineColor:g})}),v.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const g=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!g,showRowHeaders:!g})}),v.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),v.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),v.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})}),v.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),v.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),v.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),v.getCommand("insertFunction").update({context:()=>({searchByCategory:async g=>{const C=t.getWorkbook();if(!C)return ge.CommonUtils.EmptyArray;const R=await C.getScripts().searchFunctions({category:g,includeBuiltIn:!0});return R.sort((u,q)=>u.getName().localeCompare(q.getName())),R}})})},[t]),o.useEffect(()=>{const g=t.getView().getFreezePanes(),C=()=>g.coords.rowIndex!==0,R=()=>g.coords.colIndex!==0,u=()=>g.coords.rowIndex!==0||g.coords.colIndex!==0;v.getCommand("freezeToggle").updateCallback(()=>{u()?t.getView().setFreezePanes(null):u()?R()?t.getView().setFreezePanes({coords:{rowIndex:b.rowIndex}}):C()&&t.getView().setFreezePanes({coords:{colIndex:b.colIndex}}):t.getView().setFreezePanes({coords:b})}).update({state:u,disabled:()=>!b||!u()&&b.rowIndex===0&&b.colIndex===0}),v.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:C()?0:b.rowIndex}})}).update({state:C,disabled:()=>!b||!C()&&b.rowIndex===0}),v.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:R()?0:b.colIndex}})}).update({state:R,disabled:()=>!b||!R()&&b.colIndex===0}),v.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!u()})},[Re,b,t,i]);const De=V().getStyle(),I=De.getFont(),Q=De.getAlignment(),L=Q.getHorizontal(),$=Q.getVertical(),xe=Q.getOverflow(),Ce=Q.getRotation();return o.useEffect(()=>{v.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>V().getStyle(!0).getNamed(),bodyStyle:He,createTemporaryCell:je=>t.createTemporaryCell(je)})}),v.getCommand("formatFillColor").update({state:()=>{let je=null;const Xe=De.getFill();return Xe?.getType()===d.IFill.Type.Solid?je=Xe.getColor():Xe?.getType()===d.IFill.Type.Gradient?je=Xe.getStops()?.[0]?.getColor():Xe?.getType()===d.IFill.Type.Pattern&&(je=Xe.getBackground()),je},icon:()=>c.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const je=t.getStyles();return{onColorSelect:Xe=>{p(Xe??kn)},darkMode:i.darkMode,quickColor:B,autoColor:kn,schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:Xe=>je.addRecentColor(Xe),clearRecentColors:()=>je.clearRecentColors()}}}),v.getCommand("formatFontColor").update({state:()=>I.toJSON()?.fill?I.getFill():null,icon:()=>c.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const je=t.getStyles();return{onColorSelect:Xe=>{S(Xe)},darkMode:i.darkMode,quickColor:A,autoColor:je.getNormal().getFont().getFill(),schemeLookup:je.schemeLookup(),recentColors:je.recentColors(),addRecentColor:Xe=>je.addRecentColor(Xe),clearRecentColors:()=>je.clearRecentColors()}}}),v.getCommand("formatNumberFormat").update({state:()=>De.getNumberFormat(),context:()=>V}),v.getCommand("formatNumberDialog").update({state:()=>De.getNumberFormat(),context:()=>V()}),v.getCommand("formatFontFamily").update({state:()=>I.getFamily()}),v.getCommand("formatFontSize").update({state:()=>I.getSize()});const g=function(){const je=I.getWeight()||0;return!isNaN(je)&&je>500};v.getCommand("formatBoldToggle").updateCallback(function(){F(this,{font:{weight:g()?400:700}})}).update({state:g});const C=function(){return I.getStyle()===d.IFont.Style.Italic};v.getCommand("formatItalicToggle").updateCallback(function(){F(this,{font:{style:C()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:C}),v.getCommand("formatStrikeThroughToggle").updateCallback(function(){F(this,{font:{strike:!I.getStrike()}})}).update({state:I.getStrike()}),v.getCommand("formatUnderlinedToggle").updateCallback(function(){F(this,{font:{underline:I.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:I.getUnderline()===d.IFont.UnderlineStyle.Single}),v.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){F(this,{font:{underline:I.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:I.getUnderline()===d.IFont.UnderlineStyle.Double}),v.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){F(this,{font:{underline:I.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:I.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),v.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){F(this,{font:{underline:I.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:I.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),v.getCommand("formatSuperscriptToggle").updateCallback(function(){F(this,{font:{verticalAlign:I.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:I.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),v.getCommand("formatSubscriptToggle").updateCallback(function(){F(this,{font:{verticalAlign:I.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:I.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const R=()=>xe===d.ITextFrame.Overflow.Visible;v.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){F(this,{alignment:{overflow:(R(),d.ITextFrame.Overflow.Visible)}})}).update({state:R});const u=()=>xe===d.ITextFrame.Overflow.Wrap;v.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){F(this,{alignment:{overflow:u()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:u});const q=function(){return xe===d.ITextFrame.Overflow.Clip};v.getCommand("formatTextOverflowClipToggle").updateCallback(function(){F(this,{alignment:{overflow:q()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:q});const E=function(){return xe===d.ITextFrame.Overflow.Shrink};v.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){F(this,{alignment:{overflow:E()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:E});const le=function(){return xe===d.ITextFrame.Overflow.Shrink};v.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){F(this,{alignment:{overflow:le()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:le,disabled:!0});const fe=function(){return $===d.ITextFrame.VerticalAlignment.Top};v.getCommand("formatAlignTopToggle").updateCallback(function(){F(this,{alignment:{vertical:fe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:fe});const ce=function(){return $===d.ITextFrame.VerticalAlignment.Center};v.getCommand("formatAlignMiddleToggle").updateCallback(function(){F(this,{alignment:{vertical:ce()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:ce});const ne=function(){return $===d.ITextFrame.VerticalAlignment.Bottom};v.getCommand("formatAlignBottomToggle").updateCallback(function(){F(this,{alignment:{vertical:(ne(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ne});const ae=function(){return $===d.ITextFrame.VerticalAlignment.Justify};v.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){F(this,{alignment:{vertical:ae()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:ae});const ue=function(){return $===d.ITextFrame.VerticalAlignment.Distributed};v.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){F(this,{alignment:{vertical:ue()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ue});const ye=function(){return L===d.ITextFrame.HorizontalAlignment.Left};v.getCommand("formatAlignLeftToggle").updateCallback(function(){F(this,{alignment:{horizontal:ye()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:ye});const Be=function(){return L===d.ITextFrame.HorizontalAlignment.Center};v.getCommand("formatAlignCenterToggle").updateCallback(function(){F(this,{alignment:{horizontal:Be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:Be});const Ie=function(){return L===d.ITextFrame.HorizontalAlignment.CenterContinuous};v.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const je={alignment:{horizontal:Ie()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};F(this,je)}).update({state:Ie});const Fe=function(){return L===d.ITextFrame.HorizontalAlignment.Fill};v.getCommand("formatAlignFillToggle").updateCallback(function(){const je={alignment:{horizontal:Fe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};F(this,je)}).update({state:Fe});const Ue=function(){return L===d.ITextFrame.HorizontalAlignment.Distributed};v.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){F(this,{alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Ue});const _e=function(){return L===d.ITextFrame.HorizontalAlignment.Right};v.getCommand("formatAlignRightToggle").updateCallback(function(){F(this,{alignment:{horizontal:_e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:_e});const $e=function(){return L===d.ITextFrame.HorizontalAlignment.Justify};v.getCommand("formatAlignJustifyToggle").updateCallback(function(){F(this,{alignment:{horizontal:$e()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:$e});const Ye=!t.getProtection().isFormatCellsAllowed(),Je=L===d.ITextFrame.HorizontalAlignment.CenterContinuous||L===d.ITextFrame.HorizontalAlignment.Fill;v.getCommand("formatTextRotate0").updateCallback(function(je){F(this,{alignment:{rotation:0}})}).update({disabled:Ye||Je,state:Ce===0}),v.getCommand("formatTextRotate45").updateCallback(function(je){F(this,{alignment:{rotation:je??1?45:0}})}).update({disabled:Ye||Je,state:Ce===45}),v.getCommand("formatTextRotate90").updateCallback(function(je){F(this,{alignment:{rotation:je??1?90:0}})}).update({disabled:Ye||Je,state:Ce===90}),v.getCommand("formatTextRotate270").updateCallback(function(je){F(this,{alignment:{rotation:je??1?270:0}})}).update({disabled:Ye||Je,state:Ce===270}),v.getCommand("formatTextRotate315").updateCallback(function(je){F(this,{alignment:{rotation:je??1?315:0}})}).update({disabled:Ye||Je,state:Ce===315}),v.getCommand("formatTextRotateCustom").updateCallback(function(je){F(this,{alignment:{rotation:je}})}).update({disabled:Ye||Je,state:Ce??0})},[De,t,i,B,A]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),C=t.getSelectedRanges().getMerges().length>0,R=async(rt,Rt)=>{N(Rt,async ft=>{const Ct=async(qt=!1)=>{const Kt=await Promise.resolve(s.showBusy(Rt.label()));try{const ut=ft.getSelectedRanges();if(ut.merge({orientations:rt,discardMultipleValues:qt}),rt===d.IRange.Orientations.Both){const Nt={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};ut.getStyle().update(Nt)}}catch(ut){throw ut}finally{Kt?.()}};let zt;try{await Ct()}catch(qt){if(qt.type!=="discardMultipleValues")throw qt;zt=!0}if(zt&&s.showOptions){if(await s.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await Ct(!0)}},void 0,void 0,!1)},u=rt=>{N(rt,async Rt=>{try{const ft=Rt.getSelectedRanges();ft.unmerge();const Ct={alignment:{horizontal:null}};ft.getStyle().update(Ct)}catch(ft){throw ft}})};v.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(C?u(this):R(d.IRange.Orientations.Both,this))}).update({state:C,disabled:!Oe||g}),v.getCommand("mergeHorizontal").updateCallback(function(){R(d.IRange.Orientations.Column,this)}).update({disabled:!Oe||g}),v.getCommand("mergeVertical").updateCallback(function(){R(d.IRange.Orientations.Row,this)}).update({disabled:!Oe}),v.getCommand("unmerge").updateCallback(function(){u(this)}).update({disabled:!C||!Oe||g});const q={disabled:g};v.getCommand("hideRows").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(q),v.getCommand("hideColumns").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(q),v.getCommand("unhideRows").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(q),v.getCommand("unhideColumns").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(q),v.getCommand("autoFitRows").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(q),v.getCommand("resizeRows").updateCallback(function(){const rt={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},Rt={initialValue:{size:20,unit:"Px"},context:()=>rt,onInput:(ft,Ct)=>{Ct!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(ft.size+ft.unit):v.getCommand("autoFitRows").execute()}};s.showWindow("resizeHeader",Rt)}).update(q),v.getCommand("autoFitColumns").updateCallback(function(){N(this,rt=>{rt.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(q),v.getCommand("resizeColumns").updateCallback(function(){const rt={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},Rt={initialValue:{size:100,unit:"Px"},context:()=>rt,onInput:(ft,Ct)=>{Ct!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(ft.size+ft.unit):v.getCommand("autoFitColumns").execute()}};s.showWindow("resizeHeader",Rt)}).update(q);let E=!1,le=0,fe=!1,ce=!1,ne=0,ae=!1;m&&!g&&(E=m.isEntireColumnsAny(),fe=E&&!m.isEntireColumns(),le=m.getColumnCount(),ce=m.isEntireRowsAny(),ae=ce&&!m.isEntireRows(),ne=m.getRowCount());const ue={disabled:g||m&&m.getCount()!==1};v.getCommand("sortAscending").update(ue),v.getCommand("sortDescending").update(ue);const ye={disabled:E||g||te},Be={disabled:ce||g||te},Ie=E||g||te||ae,Fe=ce||g||te||fe;let Ue="",_e="",$e="",Ye="",Je="",je="",Xe="",vt="",nt="",at="",Tt="",kt="",yt="";le>1&&(Ue=le+" ",_e="s",te||(at=je=Ue,Tt=Xe=_e)),ne>1&&($e=ne+" ",Ye="s",te||(kt=vt=$e,yt=nt=Ye)),U.getMode()?.key==="copy"?(Je=vt=je="Copied ",Xe=nt="s"):U.getMode()?.key==="cut"&&(Je=vt=je="Cut ",Xe=nt="s");let wt="",ct="";if(m){const rt=m.getDefaultShiftOrientation()===d.IRange.Orientation.Column;wt=` (${rt?"Shift Right":"Shift Down"})`,ct=` (${rt?"Shift Left":"Shift up"})`,v.getCommand("deleteCells").update({label:`Delete Cells${ct}`})}v.getCommand("insertCells").update({label:`Insert ${Je}Cells${wt}`,scopedLabels:{insertCells:`${Je}At Selection`}}),v.getCommand("insertCellsShiftRight").update(ye),v.getCommand("deleteCellsShiftLeft").update(ye),v.getCommand("deleteCellsShiftUp").update(Be),v.getCommand("insertCellsShiftDown").update(Be),v.getCommand("insertRows").update({label:`Insert ${vt}Row${nt}`,scopedLabels:{insertCells:`${vt}Row${nt}`},disabled:Fe}),v.getCommand("insertRowsAfter").update({label:`Insert ${vt}Row${nt} Below`,disabled:Fe}),v.getCommand("hideRows").update({label:`Hide ${$e}Row${nt}`}),v.getCommand("insertColumns").update({label:`Insert ${je}Column${Xe}`,scopedLabels:{insertCells:`${je}Column${Xe}`},disabled:Ie}),v.getCommand("insertColumnsAfter").update({label:`Insert ${je}Column${Xe} After`,disabled:Ie}),v.getCommand("hideColumns").update({label:`Hide ${Ue}Column${Xe}`}),v.getCommand("deleteRows").update({label:`Delete ${kt}Row${yt}`,scopedLabels:{deleteCells:`${kt}Row${yt}`},disabled:Fe}),v.getCommand("deleteColumns").update({label:`Delete ${at}Column${Tt}`,scopedLabels:{deleteCells:`${at}Column${Tt}`},disabled:Ie})},[Re,Oe,te,m,U,s,we]),o.useEffect(()=>{const g=t.getProtection(),C=t.getProtection().isLocked(),R=!g.isFormatCellsAllowed(),u={disabled:R};v.getCommand("protectionSheetToggle").updateCallback(async(le,fe)=>{let ce=null;try{if(C){let ne=null;if(g.hasPassword()){const ae=await s.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ae.option!=="Unprotect")return;ne=ae.input}ce=await Promise.resolve(s.showBusy(fe.label())),await g.unlock(ne)}else ce=await Promise.resolve(s.showBusy(fe.label())),await g.lock();ce?.()}catch(ne){ce?.(),s.showError(ne)}}).update({state:C,label:()=>C?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:C?"Unprotect":"Protect"}}),v.getCommand("deleteTable").update(u),v.getCommand("sortAscending").update(u),v.getCommand("sortDescending").update(u),v.getCommand("sortCustom")?.update(u),v.getCommand("updateComments").update(u),v.getCommand("deleteComments").update(u),v.getCommand("insertChart")?.update(u),v.getCommand("insertImageFromFile").update(u),v.getCommand("insertImageFromURL").update(u),v.getCommand("formatBorder").update(u),v.getCommand("formatFillColor").update(u),v.getCommand("formatFontColor").update(u),v.getCommand("formatBoldToggle").update(u),v.getCommand("formatItalicToggle").update(u),v.getCommand("formatUnderlinedToggle").update(u),v.getCommand("formatStrikeThroughToggle").update(u),v.getCommand("formatSuperscriptToggle").update(u),v.getCommand("formatSubscriptToggle").update(u),v.getCommand("formatAlignTopToggle").update(u),v.getCommand("formatTextOverflowVisibleToggle").update(u),v.getCommand("formatTextOverflowWrapToggle").update(u),v.getCommand("formatTextOverflowClipToggle").update(u),v.getCommand("formatTextOverflowShrinkToggle").update(u),v.getCommand("formatAlignMiddleToggle").update(u),v.getCommand("formatAlignBottomToggle").update(u),v.getCommand("formatAlignDistributedVerticalToggle").update(u),v.getCommand("formatAlignJustifyVerticalToggle").update(u),v.getCommand("formatAlignLeftToggle").update(u),v.getCommand("formatAlignCenterToggle").update(u),v.getCommand("formatAlignRightToggle").update(u),v.getCommand("formatAlignJustifyToggle").update(u),v.getCommand("formatAlignCenterContinuousToggle").update(u),v.getCommand("formatAlignDistributedHorizontalToggle").update(u),v.getCommand("formatAlignFillToggle").update(u),v.getCommand("formatFontSizeIncrease").update(u),v.getCommand("formatFontSizeDecrease").update(u),v.getCommand("formatFontFamily").update(u),v.getCommand("formatFontSize").update(u),v.getCommand("formatNumberFormat").update(u),v.getCommand("formatNumberFormatGeneralStyle").update(u),v.getCommand("formatNumberFormatNumberStyle").update(u),v.getCommand("formatNumberFormatTimeStyle").update(u),v.getCommand("formatNumberFormatDateStyle").update(u),v.getCommand("formatNumberFormatAccountingStyle").update(u),v.getCommand("formatNumberFormatPercentStyle").update(u),v.getCommand("formatNumberFormatScientificStyle").update(u),v.getCommand("formatNumberFormatCommaStyle").update(u),v.getCommand("formatNumberFormatIncreaseDecimal").update(u),v.getCommand("formatNumberFormatDecreaseDecimal").update(u),v.getCommand("hideColumns").update(u),v.getCommand("unhideColumns").update(u),v.getCommand("hideRows").update(u),v.getCommand("unhideRows").update(u),v.getCommand("insertFunctionSum").update(u),v.getCommand("insertFunctionAverage").update(u),v.getCommand("insertFunctionCount").update(u),v.getCommand("insertFunctionMax").update(u),v.getCommand("insertFunctionMin").update(u),v.getCommand("insertFunction").update(u),v.getCommand("startEditCurrentTime").update(u),v.getCommand("startEditCurrentDate").update(u),v.getCommand("startEditValueAbove").update(u),v.getCommand("fillDown").update(u),v.getCommand("fillRight").update(u),v.getCommand("fillUp").update(u),v.getCommand("fillLeft").update(u),v.getCommand("formatCellStyle").update(u),v.getCommand("formatTableStyle").update(u),v.getCommand("formatPainterToggle").update(u),v.getCommand("formatBorderAddOutline").update(u),v.getCommand("formatBorderClearOutline").update(u),v.getCommand("formatIndentDecrease").update(u),v.getCommand("formatIndentIncrease").update(u),v.getCommand("clearContents").update(u),v.getCommand("clearFormats").update(u),v.getCommand("clearAll").update(u),v.getCommand("clearComments").update(u),v.getCommand("clearHyperlinks").update(u),v.getCommand("autoFilterClear").update(u),v.getCommand("autoFilterReapply").update(u);const q=L===d.ITextFrame.HorizontalAlignment.CenterContinuous||L===d.ITextFrame.HorizontalAlignment.Fill,E={disabled:R||q};v.getCommand("formatTextRotate0").update(E),v.getCommand("formatTextRotate45").update(E),v.getCommand("formatTextRotate90").update(E),v.getCommand("formatTextRotate270").update(E),v.getCommand("formatTextRotate315").update(E),v.getCommand("formatTextRotateCustom").update(E),v.getCommand("formatTextRotateVertical").update(E)},[Re]),v}const Dl="_sheet-scrollbar_104cg_1",bo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:h,showCustomScrollButtons:s,offset:y=0,totalSize:b=0,viewportSize:w=0,className:m,endGap:M,...T}=e;if(!a)throw new Error("SheetScrollbar needs an ISheet");const P=r.useCallbackRef(l,[l]),z=r.useCallbackRef(f,[f]),_=o.useRef(null),H=Ut([_,t]),x=i===r.ScrollbarOrientation.Vertical,[B,p]=o.useState(()=>{const ve=a.getView().getTopLeft();return x?ve.top:ve.left}),A=()=>{const ve=a.getView().getFreezePanes();return x?ve.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ve.coords.rowIndex)-ve.topLeft.top,scroll:ve.topLeft.top}:ve.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ve.coords.colIndex)-ve.topLeft.left,scroll:ve.topLeft.left}},[S,U]=o.useState(A),[D,j]=o.useState(null),[K,pe]=o.useState(!1),Z=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),V=()=>{const ve=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,He=a.getSelection().getCoords().cell;return{colIndex:Math.max(ve.colEnd,He.colIndex),rowIndex:Math.max(ve.rowEnd,He.rowIndex)}},[N,F]=o.useState(V),k=N?(x?N.rowIndex:N.colIndex)+1:0,O=()=>{const ve=V();ge.CoordUtils.isEqualCells(N,ve)||F(ve)};et(a.getView(),{onFreezeSplitChange:()=>{U(A)}}),et(a.getSelection(),{onChange:O}),et(a,{onUsedRangeChange:O}),o.useEffect(()=>{F(V())},[a]);const ee=y-S.scroll,oe=w-S.shift,be=b-(S.shift+S.scroll),he=Z.findOffset(k)*(a.getView().getZoomScale()/100)-(S.scroll+S.shift);o.useEffect(()=>{if(!D)return K&&z?.(),void pe(!1);We(x,B,oe,M,D,a,Z,S)},[x,y,B,oe,M,S,i,D,Z,K,a]);const Ee=r.useCallbackRef((ve,He,Y)=>{p(ve);const X=ve+S.scroll,de=He+S.shift,Me=Y+S.shift+S.scroll;h?.(X,de,Me)},[h,S]),Ae=o.useCallback((ve,He,Y,X,de,Me,G,W)=>{const re=G.getTextAt(G.findIndex(He/(Me.getView().getZoomScale()/100)+W.scroll+W.shift)),me={...de,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+re};if(_.current){const se=_.current.querySelector('[role="slider"]');if(se){const Se=se.getBoundingClientRect();ve?me.anchor.y=Se.top+Se.height/2:me.anchor.x=Se.left+Se.width/2}}pe(!0),P?.(me)},[]),We=r.useCallbackRef(ge.CommonUtils.debounce(Ae,90),[]);return o.useMemo(()=>c.jsx(r.VirtualScrollbar,{ref:H,className:dt(m,Dl),style:n,offset:ee,viewportSize:oe,totalSize:be,orientation:i,showCustomScrollButtons:s,onMouseDown:ve=>{j({anchor:{x:ve.clientX,y:ve.clientY}}),ve.preventDefault()},onScrollOffset:Ee,onMouseOut:()=>{j(null)},onMouseUp:()=>{j(null)},minSize:he,...T}),[m,ee,oe,be,i,s,n,he,M])}));bo.displayName="SheetScrollbar";const jo=(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},Oo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:h,containerHeight:s,headerText:y,freezeStart:b,gridStyle:w,verticalPadding:m,horizontalPadding:M,onSheetContextMenu:T,onResizeHeadersStart:P,onResizeHeaders:z,onResizeHeadersEnd:_,onResizeHeadersDown:H,onResizeHeadersUp:x,scrollPoint:B,onSelectionStart:p,onSelectionEnd:A}=e,S=o.useMemo(()=>n.getOrientation(),[n]),U=o.useRef(null),[D,j]=o.useReducer(L=>L+1,0),[K,pe]=o.useReducer(L=>L+1,0),Z=n?.getSheet(),V=o.useRef(!1);o.useLayoutEffect(()=>{V.current=!0},[n]);const N=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),F=o.useMemo(()=>{const L=S===d.IRange.Orientation.Column;return{left:L?B.left:0,top:L?0:B.top}},[B]),[k,O]=o.useState(Z?.getView().getZoomScale()/100),[ee,oe]=o.useState(null);et(n,{onSizesChange:L=>{O(Z?.getView().getZoomScale()/100),Se(me())}});const be=o.useCallback(()=>{U.current?.invalidate(),pe()},[]),he=o.useCallback(ge.CommonUtils.debounce(()=>{be()},10),[]),[Ee,Ae]=o.useState(null);et(n.getSheet(),{onSelectionChange(){Ae(Z?.getSelection().getCoords()),he()},onProtectionChange(){be()},onViewChange(){he()}}),o.useLayoutEffect(()=>{Se(me())},[S,k,f]),o.useLayoutEffect(()=>{oe(null),O(n?.getSheet().getView().getZoomScale()/100),Se(me())},[n]);const We=o.useCallback(L=>n.at(L)?.isHidden()||n.at(L)?.getSize()===0,[n]),ve=o.useCallback((L,$)=>n.hiddenHeadersAt(L,$),[We]),He=r.useCallbackRef(L=>n.isSelected(L),[n]),Y=r.useCallbackRef(L=>n.isSelectedAll(L),[n]),X=o.useCallback(()=>n.getMinSize(),[n]),de=o.useCallback(()=>n.getMaxSize(),[n]),Me=r.useCallbackRef((L,$,xe)=>{$/=k;const Ce={size:$=Math.max(X(),Math.min(ge.CommonUtils.roundAccurately($,X()),de())),hidden:!1},g=[];if($<=0&&(Ce.hidden=!0,Ce.size=xe),g.push({address:{min:L,max:L},update:Ce}),$<0){const C=S===d.IRange.Orientation.Column,R=C?se.getColOffset:se.getRowOffset,u=C?se.getColIndex:se.getRowIndex,q=R(L);let E=u(q+$);const le=R(E);le===q+$?E--:g.push({address:{min:E,max:E},update:{size:q-le+$}}),L-E>1&&g.push({address:{min:E+1,max:L-1},update:{hidden:!0}})}n.updateHeaderPairs(g),z?.(L,$,xe)},[D,n,k,z]),G=r.useCallbackRef((L,$,xe)=>{const Ce=S===d.IRange.Orientation.Column;let g=null,C={min:L,max:L};if(n.isSelectedAll(L)){const R=n.getSelectedRuns();R.length>1?g="Resize "+(Ce?"Columns":"Rows"):C=R[0];const u={hidden:$<=0,size:($<=0?xe:$)/k};n.updateHeaderPairs(jo(R,u,L))}if(C){const R=C.max-C.min+1;let u;u=R===1?n.getRange(C).at(0).getDisplayText():n.getRange(C).toString(),g=`Resize ${Ce?"Column":"Row"}${R>1?"s":""} '${u}'`}_?.(L,$,g)},[D,n,_]),W=r.useCallbackRef((L,$)=>{const xe=S===d.IRange.Orientation.Column;P(L,$,`Resize ${xe?"Column":"Row"}(s)`)},[P]),re=r.useCallbackRef(L=>{let $=!1;const xe=S===d.IRange.Orientation.Column,Ce=n.getSheet().getEntireRange().getCoords(),g=[],C=n.getSelectedRuns(),R=u=>{let q;q=xe?{colStart:u.min,rowStart:Ce.rowStart,colEnd:u.max,rowEnd:Ce.rowEnd}:{colStart:Ce.colStart,rowStart:u.min,colEnd:Ce.colEnd,rowEnd:u.max},g.push(q)};for(let u=0;u<C.length;u++){const q=C[u];q.value.isSelectedAll&&(q.min<=L&&q.max>=L&&($=!0),R(q))}if($||R({min:L,max:L}),n.getSheet().getRanges(g).autoFit({orientations:xe?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),We(L)){const u={hidden:null},q=jo(C,u);$||q.push({address:L,update:u}),n.updateHeaderPairs(q)}_?.(L,null,"Resize Column(s)")},[D,n,_,We]),me=()=>{const L=S===d.IRange.Orientation.Column;return{getColOffset:$=>L?n.findOffset($):$===0?0:f/k,getColIndex:$=>L?n.findIndex($):0,getRowOffset:$=>L?$===0?0:f/k:n.findOffset($),getRowIndex:$=>L?0:n.findIndex($)}},[se,Se]=o.useState(()=>me()),ie=o.useCallback((L,$)=>L.nativeEvent.which!==r.MouseButtonCodes.Right||!Y(S===d.IRange.Orientation.Column?$.colIndex:$.rowIndex),[S,Y]),we=r.useCallbackRef(L=>{a.focusSheet()},[a]),ke=r.useCallbackRef(L=>{Z?.getSelection().updateCoords(L)},[Z]),{...Re}=ht.useSelection({gridRef:i,commands:null,layout:se,selection:Ee,fillHandleBorderColor:w.body.fill,selectionBackgroundColor:w.selection.fill,selectionBorderColor:w.selection.strokeFill,selectionRemoveBackgroundColor:w.selectionRemove.fill,selectionRemoveBorderColor:w.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:ke,canSelectionSpanMergedCells:L=>{const $=Z.getRange(L);return $.isEntireColumns()||$.isEntireRows()}}),Le=r.useCallbackRef(()=>{p?.();const L=Z?.getSelection();L&&L.setAdjusting(L.getCoords())},[Z,p]),Ne=r.useCallbackRef(async()=>{Z?.getSelection().setAdjusting(null),A?.()},[Z,A]),{...v}=ht.useHeaderSelection({orientation:S,headerCount:N,gridRef:U,gridMainRef:i,newSelection:Re?.newSelection,modifySelection:Re?.modifySelection,appendSelection:Re?.appendSelection,clearSelections:Re?.clearSelections,pointerDownInterceptor:ie,onPointerUp:we,onDragStart:Le,onDragEnd:Ne}),Oe=w.selection?.strokeFill;o.useEffect(()=>{if(!U.current)return void oe(null);const L=S===d.IRange.Orientation.Column,$=n.getSelectedRuns(),xe=n.isProtected()?null:Me,Ce=(C,R,u)=>{if(u)return L?c.jsx("div",{style:{position:"absolute",borderBottom:`${w.headerSelection.strokeWidth}px solid ${Oe}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-w.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(u.x-w.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(u.width+w.headerSelection.strokeWidth+1,!0)}px`,height:f+w.headerSelection.strokeWidth-.5+"px"}},C):c.jsx("div",{style:{position:"absolute",borderRight:`${w.headerSelection.strokeWidth}px solid ${Oe}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(u.y-w.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-w.headerSelection.strokeWidth/2)}px`,width:f+w.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(u.height+w.headerSelection.strokeWidth+1,!0)}px`}},C)},g=(C,R,u)=>{const q={x:0,y:0,width:0,height:0};if(L){const E=u.toClipBounds(u.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:C,colEnd:Math.min(N,R)}),ht.SELECTION_CLIP_INSETS);if(!E)return;q.x=E.x,q.width=E.width}else{const E=u.toClipBounds(u.getRangeCoordsBounds({rowStart:C,rowEnd:Math.min(N,R),colStart:0,colEnd:0}),ht.SELECTION_CLIP_INSETS);if(!E)return;q.y=E.y,q.height=E.height}return{x:q.x,y:q.y,width:q.width,height:q.height}};oe([C=>{let R=null,u=L?C.getVisibleColumns():C.getVisibleRows();const q=L?C.getTotalRangeCoords().colStart:C.getTotalRangeCoords().rowStart;u.length>0&&u[0]>q&&(u=[u[0]-1,...u]);let E=[];const le=[],fe=u.length;for(let Ie=0;Ie<fe;Ie++){const Fe=u[Ie],Ue=Ie<fe-1?u[Ie+1]:Fe+ve(Fe+1,!1)+1,_e=Fe+1!==Ue;if(!R||R.max<Fe)if($.length>0&&$[$.length-1].max>=Fe){const Je=ge.CommonUtils.findEqualOrGreater($,Fe,je=>je.max);R=$[Je]}else R=null;let $e=!1,Ye=!1;if(R?.value&&(R.min<=Fe||R.min<=Ue&&!_e)&&($e=!0,Ye=R.value.isSelectedAll),Fe===q){let Je=!1,je=!1;R?.value&&R.min<=Fe&&(Je=!0,je=R.value.isSelectedAll),Fe>0&&le.push({index:Fe-1,isNextHidden:_e,isSelected:Je,isSelectedAll:je,disabledResize:!0})}if(Ye&&E.push(le.length),le.push({index:Fe,isHidden:Ie===0&&ve(Fe,!1)>0,isNextHidden:_e,isSelected:$e,isSelectedAll:Ye,onDividerMouseDown:H,onDividerResizeStart:W,onDividerResize:xe,onDividerMouseUp:x,onDividerResizeEnd:G,onDividerAutoFit:re}),_e){let Je=!1,je=!1;if(R&&R.min>=Fe&&R.max<=Ue-1&&R.value.isSelectedAll&&E.push(le.length),!(R?.value&&R.max>=Ue))if($.length>0&&$[$.length-1].max>=Ue){const Xe=ge.CommonUtils.findEqualOrGreater($,Ue,vt=>vt.max);R=$[Xe]}else R=null;R?.value&&R.min<=Ue&&(Je=R.value.isSelected,je=R.value.isSelectedAll),Ue>0&&le.push({index:Ue-1,isHidden:!0,isSelected:Je,isSelectedAll:je,onDividerMouseDown:H,onDividerResizeStart:W,onDividerResize:xe,onDividerMouseUp:x,onDividerResizeEnd:G,onDividerAutoFit:re})}}if(E.length>0){let Ie=E.length-1;if(E.length>0){const _e=le[E[Ie]].index;let $e=null;L?($e=C.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),$e.x+$e.width>C.getBounds().width&&(Ie-=1,Ie===0&&(Ie=-1))):($e=C.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),$e.y+$e.height>C.getBounds().height&&(Ie-=1,Ie===0&&(Ie=-1)))}const Fe=$?.[$.length-1],Ue=C.getAnchor();if(Ue==="t"||Ue==="l"){const _e=le[E[Math.max(0,E.length-1)]];_e.showTouchDivider=Fe&&Fe.max<=_e.index}else Ie>=0&&(le[E[Ie]].showTouchDivider=!0)}const{header:ce,headerSelect:ne,headerSelectAll:ae,headerHover:ue}=w??{},ye=le.length,Be=new Array(ye);for(let Ie=0;Ie<ye;Ie++)Be[Ie]=c.jsx(ht.HeaderDivider,{orientation:S,view:C,headerStyle:ce,headerStyleSelect:ne,headerStyleSelectAll:ae,headerStyleHover:ue,disabled:n.isProtected(),...le[Ie]},`divider${Ie}`);return Be},C=>{const R=[],u=$.length;for(let q=0;$&&q<u;q++)R.push(Ce(`selection:${C.getAnchor()}:${q}`,0,g($[q].min,$[q].max,C)));return R}])},[K,!0,Oe,w,se,N,b,D,k]),o.useEffect(()=>{U.current?.invalidate()},[D]);const tt=r.useCallbackRef(L=>y?y(L):n.getTextAt(L),[y,n]),te=r.useCallbackRef(L=>{const{header:$,headerSelect:xe,headerSelectAll:Ce,headerHover:g}=w??{},{range:C,key:R,...u}=L;return c.jsx(ht.HeaderRenderer,{orientation:S,index:S===d.IRange.Orientation.Column?C.colStart:C.rowStart,isSelected:He,isSelectedAll:Y,zoomScale:100*k,headerText:tt,headerStyle:$,headerStyleSelect:xe,headerStyleSelectAll:Ce,headerStyleHover:g,verticalPadding:m,horizontalPadding:M,...u},R)},[D,N,w,k,n]),Te=r.useEditMode(),Pe=o.useMemo(()=>{const L="white",$="black",xe={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let Ce=S===d.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${$}' fill='${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='${$}' fill='${L}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Te.getMode()?.key==="formatPainter"&&(Ce=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${$}' fill='${L}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),xe.cursor=Ce}return xe.backgroundColor=w?.header?.fill||"transparent",xe},[S,D,Te,w]),ze=r.useImperativeElement(t,()=>({scrollTo:L=>{U.current?.scrollTo(L)},forceRender:()=>{j()},getGridElement:()=>U.current}),[]),De=o.useCallback(L=>{v.onPointerDown(L)},[v]),I=o.useCallback(L=>{const $=v.getCellCoordsFromClient(L.clientX,L.clientY);if(!$||!T)return;const xe=S===d.IRange.Orientation.Column;T({originalEvent:L,clientX:L.clientX,clientY:L.clientY,rowIndex:xe?-1:$.rowIndex,colIndex:xe?$.colIndex:-1}),L.stopPropagation(),L.preventDefault()},[v,T]),Q=o.useMemo(()=>{const L=S===d.IRange.Orientation.Column;return c.jsx("div",{ref:ze,children:c.jsx(ht.Grid,{className:"sheet-header",style:Pe,ref:U,scrollPoint:F,columnCount:L?N:1,rowCount:L?1:N,width:L?h:f,height:L?f:s,freezeLeft:L?b:void 0,freezeTop:L?void 0:b,hiddenColumnsAt:L?ve:void 0,hiddenRowsAt:L?void 0:ve,showGridLines:!1,layout:se,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:I,onPointerDown:De,zoom:k,cellRenderer:te,overlays:ee})})},[ee,se,h,s,F,Pe,K]);return o.useEffect(()=>{V.current=!1,U.current?.invalidate(),pe()},[n,w]),Q})),zl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((y,b)=>y.getStyle().getBorder(),[]),{overlay:h}=Co({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),s=h(n);return s&&n?s:null})),Nl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Ll={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Pl={type:d.ICell.Content.Values},jl={fitDestination:!0,type:d.ICell.Content.Formats},Ol={fitDestination:!0,type:d.ICell.Content.Formulas},Bl={transpose:!0},Hl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},xr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:f=ht.defaultSelectionRenderer,copyForegroundColor:h="rgb(33, 115, 70)",cutForegroundColor:s="rgb(33, 115, 70)",copyBackgroundColor:y="white",cutBackgroundColor:b="white",...w})=>{const m=r.useCallbackRef(f,[f]),M=o.useRef(null),T=r.useEditMode(),P=T.getMode(),z=o.useMemo(()=>({element:e,doCopy:p=>{const A=t.getSelectedRanges().getSnapshot(p);return new d.RangeClipboardItem(A)}}),[t,n,e]),_=o.useMemo(()=>({element:e,importFromExternal:async(p,A)=>{const S=new d.ExternalRangeClipboardItem(p,A,t.getStyles(),t.isDate1904());return await S.parse()?S:null},doPaste:async(p,A)=>{if(p?.getItemType()!=="range")return;A?.contentsOnly&&delete(A={...A,type:d.ICell.Content.Values}).contentsOnly;const S=p.getItem(),U=S.getName();let D=t.getSelectedRange();if(U==="HTML"&&D.size>1){const j=S?.getCoords();j&&ge.CoordUtils.isSingleCell(j)&&(D=D.getResizeTo(1,1))}return await D.doBatch(async()=>{const j=await D.copyFrom(S,A);!j||j.isEntireRows()||j.isEntireColumns()||j.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(U?` ${U}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:H,...x}=r.useCopyPaste({...w,source:z,commands:i,target:_,onClipboardUpdate:p=>{const A=p?.getItemType()==="range"?p:null;if(A){const S=p.editMode?.(),U={...p?.isCut?.()?Ll:Nl,...S,args:{isClipboard:!0,...S?.args},onModeChange:D=>{D?.args?.isClipboard||H.clear(!0),S?.onModeChange?.(D)}};T.setMode(U)}M.current=A,a?.(A)},onPaste:(p,A)=>{if(p?.getItemType()!=="range")return;let S=T.getMode()?.key==="cut"||p.isCut?.();if(!S&&T.getMode()?.key==="copy"){const U=p.getItem().getCoords(),D=t.getSelectedRanges().getCoords();let j=!1;if(!j&&U&&D&&p.getItem().getSource?.()===t)for(let K=0;!j&&K<D.length;K++)j=ge.CoordUtils.isRangesIntersect(U,D[K]);S=j}S&&T.setMode(null),e?.()?.focus(),l?.(p,A)}});o.useMemo(()=>{const p=e;if(!i)return;const A=[new r.Command("pasteValues",p,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
19
+ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){qe(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("resizeRows",l,{label:"Resize Rows",description:"Resize the rows to the specified height.",icon:"RowsResize"}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"}),new r.SimpleCommand("resizeColumns",l,{label:"Resize Columns",description:"Resize the columns to the specified width.",icon:"ColumnsResize"})],[]),g=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(be,!0),u},[a,be]);r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),N=w.getMode()?.key==="formatPainter";g.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>N}).updateCallback(()=>N?void w.setMode(null):g.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[w,L,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{q()}});const Le=()=>{g.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),g.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??qn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:qn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Oe=()=>{g.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{T(u)},darkMode:i.darkMode,quickBorder:M,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Oe()},[M]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed(),N=A(),U=N?.cell.getHyperlink();g.getCommand("openHyperlink").update({disabled:!U}),g.getCommand("deleteHyperlink").update({disabled:u||!U});const m=U?"Edit":"Insert",F="Link";g.getCommand("updateHyperlink").update({label:()=>`${m} ${F}`,icon:()=>m==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${m} ${F}…`,insert:`${F}…`,hyperlink:`${m}…`},disabled:u})},[j,L]),o.useEffect(()=>{const u=A(),N=u?.cell.getComments(),U=()=>N?"Edit":"Insert",m=()=>N?"Comments":"Comment";g.getCommand("updateComments").update({label:()=>`${U()} ${m()}`,icon:()=>N?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${U()} ${m()}…`,insert:`${m()}…`}})},[j,L]),Qe(t,{onViewChange:()=>{const u=t.getView();g.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),g.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),g.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),g.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),g.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),g.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),g.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),Le()},onTabColorChange:()=>{Le()},onMergesChange:()=>{q()},onMovablesChange:()=>{q()},onTablesChange:()=>{q()},onProtectionChange:()=>{q(),v()},onStyleChange:()=>{Le(),Oe(),q()}}),o.useEffect(()=>{Le(),Oe()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),N=A(),U=N.table,m=N.tables,F=m.length>0&&!U||u,G=ge(U),te={context:G};g.getCommand("editTable").update(te),g.getCommand("deleteTable").update(te),g.getCommand("convertTableToRange").update(te);const le={context:G,disabled:F};g.getCommand("formatTableStyle").update({label:U?"Apply Table Style":"Format As Table",...le}),g.getCommand("formatTableStyleClearCellStyles").update(le),g.getCommand("deleteTableStyle").update(le),g.getCommand("convertTableToRange").update(le),g.getCommand("insertTable").update({disabled:F||m.length>0});const b={context:G,disabled:F||m.length===0};g.getCommand("tableHeaderRowToggle").update(b),g.getCommand("tableTotalRowToggle").update(b),g.getCommand("autoFilterToggle").update(b),g.getCommand("formatTableStyleClearTableStyle").update({...b,disabled:b.disabled||!U||U.getStyleOptions().name===null})},[ve,L]),o.useEffect(()=>{g.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),g.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:he.CommonUtils.findNextStep(t.getView().getZoomScale())})}),g.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),g.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),g.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),g.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),g.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),g.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),g.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),g.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),g.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?d.ISheetView.HeaderTextStyle.One:d.ISheetView.HeaderTextStyle.Zero})}),g.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),g.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),g.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),g.getCommand("insertFunction").update({context:()=>({searchByCategory:async u=>{const N=t.getWorkbook();if(!N)return he.CommonUtils.EmptyArray;const U=await N.getScripts().searchFunctions({category:u,includeBuiltIn:!0});return U.sort((m,F)=>m.getName().localeCompare(F.getName())),U}})})},[t]),o.useEffect(()=>{const u=A()?.cell.getCoords(),N=t.getView().getFreezePanes(),U=()=>N.coords.rowIndex!==0,m=()=>N.coords.colIndex!==0,F=()=>N.coords.rowIndex!==0||N.coords.colIndex!==0;g.getCommand("freezeToggle").updateCallback(()=>{F()?t.getView().setFreezePanes(null):F()?m()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):U()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:F,disabled:()=>!u||!F()&&u.rowIndex===0&&u.colIndex===0}),g.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:U()?0:u.rowIndex}})}).update({state:U,disabled:()=>!u||!U()&&u.rowIndex===0}),g.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:m()?0:u.colIndex}})}).update({state:m,disabled:()=>!u||!m()&&u.colIndex===0}),g.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!F()})},[I,j,t,i]);const Te=t?.getSelectedCell().getStyle();return o.useEffect(()=>{const u=Te.getFont(),N=Te.getAlignment(),U=N.getHorizontal(),m=N.getVertical(),F=N.getOverflow(),G=N.getRotation();g.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>A().cell.getStyle(!0).getNamed(),bodyStyle:ke,createTemporaryCell:we=>t.createTemporaryCell(we)})}),g.getCommand("formatFillColor").update({state:()=>{let we=null;const Se=Te.getFill();return Se?.getType()===d.IFill.Type.Solid?we=Se.getColor():Se?.getType()===d.IFill.Type.Gradient?we=Se.getStops()?.[0]?.getColor():Se?.getType()===d.IFill.Type.Pattern&&(we=Se.getBackground()),we},icon:()=>s.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const we=t.getStyles();return{onColorSelect:Se=>{D(Se??qn)},darkMode:i.darkMode,quickColor:z,autoColor:qn,schemeLookup:we.schemeLookup(),recentColors:we.recentColors(),addRecentColor:Se=>we.addRecentColor(Se),clearRecentColors:()=>we.clearRecentColors()}}}),g.getCommand("formatFontColor").update({state:()=>u.toJSON()?.fill?u.getFill():null,icon:()=>s.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const we=t.getStyles();return{onColorSelect:Se=>{K(Se)},darkMode:i.darkMode,quickColor:Z,autoColor:we.getNormal().getFont().getFill(),schemeLookup:we.schemeLookup(),recentColors:we.recentColors(),addRecentColor:Se=>we.addRecentColor(Se),clearRecentColors:()=>we.clearRecentColors()}}}),g.getCommand("formatNumberFormat").update({state:()=>Te.getNumberFormat(),context:()=>A().cell}),g.getCommand("formatNumberDialog").update({state:()=>Te.getNumberFormat(),context:()=>A().cell}),g.getCommand("formatFontFamily").update({state:()=>u.getFamily()}),g.getCommand("formatFontSize").update({state:()=>u.getSize()});const te=function(){const we=u.getWeight()||0;return!isNaN(we)&&we>500};g.getCommand("formatBoldToggle").updateCallback(function(){S(this,{font:{weight:te()?400:700}})}).update({state:te});const le=function(){return u.getStyle()===d.IFont.Style.Italic};g.getCommand("formatItalicToggle").updateCallback(function(){S(this,{font:{style:le()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:le}),g.getCommand("formatStrikeThroughToggle").updateCallback(function(){S(this,{font:{strike:!u.getStrike()}})}).update({state:u.getStrike()}),g.getCommand("formatUnderlinedToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Single}),g.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Double}),g.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),g.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){S(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),g.getCommand("formatSuperscriptToggle").updateCallback(function(){S(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),g.getCommand("formatSubscriptToggle").updateCallback(function(){S(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const b=()=>F===d.ITextFrame.Overflow.Visible;g.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){S(this,{alignment:{overflow:(b(),d.ITextFrame.Overflow.Visible)}})}).update({state:b});const O=()=>F===d.ITextFrame.Overflow.Wrap;g.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){S(this,{alignment:{overflow:O()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:O});const R=function(){return F===d.ITextFrame.Overflow.Clip};g.getCommand("formatTextOverflowClipToggle").updateCallback(function(){S(this,{alignment:{overflow:R()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:R});const P=function(){return F===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){S(this,{alignment:{overflow:P()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:P});const ce=function(){return F===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){S(this,{alignment:{overflow:ce()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:ce,disabled:!0});const se=function(){return m===d.ITextFrame.VerticalAlignment.Top};g.getCommand("formatAlignTopToggle").updateCallback(function(){S(this,{alignment:{vertical:se()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:se});const ye=function(){return m===d.ITextFrame.VerticalAlignment.Center};g.getCommand("formatAlignMiddleToggle").updateCallback(function(){S(this,{alignment:{vertical:ye()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:ye});const ee=function(){return m===d.ITextFrame.VerticalAlignment.Bottom};g.getCommand("formatAlignBottomToggle").updateCallback(function(){S(this,{alignment:{vertical:(ee(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ee});const pe=function(){return m===d.ITextFrame.VerticalAlignment.Justify};g.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){S(this,{alignment:{vertical:pe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:pe});const V=function(){return m===d.ITextFrame.VerticalAlignment.Distributed};g.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){S(this,{alignment:{vertical:V()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:V});const Q=function(){return U===d.ITextFrame.HorizontalAlignment.Left};g.getCommand("formatAlignLeftToggle").updateCallback(function(){S(this,{alignment:{horizontal:Q()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:Q});const re=function(){return U===d.ITextFrame.HorizontalAlignment.Center};g.getCommand("formatAlignCenterToggle").updateCallback(function(){S(this,{alignment:{horizontal:re()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:re});const Ee=function(){return U===d.ITextFrame.HorizontalAlignment.CenterContinuous};g.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const we={alignment:{horizontal:Ee()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};S(this,we)}).update({state:Ee});const Ue=function(){return U===d.ITextFrame.HorizontalAlignment.Fill};g.getCommand("formatAlignFillToggle").updateCallback(function(){const we={alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};S(this,we)}).update({state:Ue});const Be=function(){return U===d.ITextFrame.HorizontalAlignment.Distributed};g.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){S(this,{alignment:{horizontal:Be()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Be});const xe=function(){return U===d.ITextFrame.HorizontalAlignment.Right};g.getCommand("formatAlignRightToggle").updateCallback(function(){S(this,{alignment:{horizontal:xe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:xe});const He=function(){return U===d.ITextFrame.HorizontalAlignment.Justify};g.getCommand("formatAlignJustifyToggle").updateCallback(function(){S(this,{alignment:{horizontal:He()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:He});const Ce=!t.getProtection().isFormatCellsAllowed(),Ae=U===d.ITextFrame.HorizontalAlignment.CenterContinuous||U===d.ITextFrame.HorizontalAlignment.Fill;g.getCommand("formatTextRotate0").updateCallback(function(we){S(this,{alignment:{rotation:0}})}).update({disabled:Ce||Ae,state:G===0}),g.getCommand("formatTextRotate45").updateCallback(function(we){S(this,{alignment:{rotation:we??1?45:0}})}).update({disabled:Ce||Ae,state:G===45}),g.getCommand("formatTextRotate90").updateCallback(function(we){S(this,{alignment:{rotation:we??1?90:0}})}).update({disabled:Ce||Ae,state:G===90}),g.getCommand("formatTextRotate270").updateCallback(function(we){S(this,{alignment:{rotation:we??1?270:0}})}).update({disabled:Ce||Ae,state:G===270}),g.getCommand("formatTextRotate315").updateCallback(function(we){S(this,{alignment:{rotation:we??1?315:0}})}).update({disabled:Ce||Ae,state:G===315}),g.getCommand("formatTextRotateCustom").updateCallback(function(we){S(this,{alignment:{rotation:we}})}).update({disabled:Ce||Ae,state:G??0})},[Te,t,i,z,Z]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),N=A(),U=N.containsMerge,m=N.tables.length===0&&!N.isOverlapping&&(U||!N.isSingleCell),F=async($e,lt)=>{x(lt,async it=>{const Je=async(wt=!1)=>{const bt=await Promise.resolve(c.showBusy(lt.label()));try{const dt=it.getSelectedRanges();if(dt.merge({orientations:$e,discardMultipleValues:wt}),$e===d.IRange.Orientations.Both){const ft={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};dt.getStyle().update(ft)}}catch(dt){throw dt}finally{bt?.()}};let st;try{await Je()}catch(wt){if(wt.type!=="discardMultipleValues")throw wt;st=!0}if(st&&c.showOptions){if(await c.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await Je(!0)}},void 0,void 0,!1)},G=$e=>{x($e,async lt=>{try{const it=lt.getSelectedRanges();it.unmerge();const Je={alignment:{horizontal:null}};it.getStyle().update(Je)}catch(it){throw it}})};g.getCommand("mergeToggle").updateCallback(function(){he.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(U?G(this):F(d.IRange.Orientations.Both,this))}).update({state:U,disabled:!m||u}),g.getCommand("mergeHorizontal").updateCallback(function(){F(d.IRange.Orientations.Column,this)}).update({disabled:!m||u}),g.getCommand("mergeVertical").updateCallback(function(){F(d.IRange.Orientations.Row,this)}).update({disabled:!m}),g.getCommand("unmerge").updateCallback(function(){G(this)}).update({disabled:!U||!m||u});const te={disabled:u};g.getCommand("hideRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(te),g.getCommand("hideColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(te),g.getCommand("unhideRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(te),g.getCommand("unhideColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(te),g.getCommand("autoFitRows").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(te),g.getCommand("resizeRows").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},lt={initialValue:{size:20,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(it.size+it.unit):g.getCommand("autoFitRows").execute()}};c.showWindow("resizeHeader",lt)}).update(te),g.getCommand("autoFitColumns").updateCallback(function(){x(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(te),g.getCommand("resizeColumns").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},lt={initialValue:{size:100,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(it.size+it.unit):g.getCommand("autoFitColumns").execute()}};c.showWindow("resizeHeader",lt)}).update(te);let le=!1,b=0,O=!1,R=!1,P=0,ce=!1;const se=N.ranges;se&&!u&&(le=se.isEntireColumnsAny(),O=le&&!se.isEntireColumns(),b=se.getColumnCount(),R=se.isEntireRowsAny(),ce=R&&!se.isEntireRows(),P=se.getRowCount());const ye={disabled:u||se&&se.getCount()!==1};g.getCommand("sortAscending").update(ye),g.getCommand("sortDescending").update(ye);const ee=N.isOverlapping,pe={disabled:le||u||ee},V={disabled:R||u||ee},Q=le||u||ee||ce,re=R||u||ee||O;let Ee="",Ue="",Be="",xe="",He="",Ce="",Ae="",we="",Se="",Ne="",Ze="",_e="",Xe="";b>1&&(Ee=b+" ",Ue="s",ee||(Ne=Ce=Ee,Ze=Ae=Ue)),P>1&&(Be=P+" ",xe="s",ee||(_e=we=Be,Xe=Se=xe)),w.getMode()?.key==="copy"?(He=we=Ce="Copied ",Ae=Se="s"):w.getMode()?.key==="cut"&&(He=we=Ce="Cut ",Ae=Se="s");let at="",ot="";if(se){const $e=se.getDefaultShiftOrientation()===d.IRange.Orientation.Column;at=` (${$e?"Shift Right":"Shift Down"})`,ot=` (${$e?"Shift Left":"Shift up"})`,g.getCommand("deleteCells").update({label:`Delete Cells${ot}`})}g.getCommand("insertCells").update({label:`Insert ${He}Cells${at}`,scopedLabels:{insertCells:`${He}At Selection`}}),g.getCommand("insertCellsShiftRight").update(pe),g.getCommand("deleteCellsShiftLeft").update(pe),g.getCommand("deleteCellsShiftUp").update(V),g.getCommand("insertCellsShiftDown").update(V),g.getCommand("insertRows").update({label:`Insert ${we}Row${Se}`,scopedLabels:{insertCells:`${we}Row${Se}`},disabled:re}),g.getCommand("insertRowsAfter").update({label:`Insert ${we}Row${Se} Below`,disabled:re}),g.getCommand("hideRows").update({label:`Hide ${Be}Row${Se}`}),g.getCommand("insertColumns").update({label:`Insert ${Ce}Column${Ae}`,scopedLabels:{insertCells:`${Ce}Column${Ae}`},disabled:Q}),g.getCommand("insertColumnsAfter").update({label:`Insert ${Ce}Column${Ae} After`,disabled:Q}),g.getCommand("hideColumns").update({label:`Hide ${Ee}Column${Ae}`}),g.getCommand("deleteRows").update({label:`Delete ${_e}Row${Xe}`,scopedLabels:{deleteCells:`${_e}Row${Xe}`},disabled:re}),g.getCommand("deleteColumns").update({label:`Delete ${Ne}Column${Ze}`,scopedLabels:{deleteCells:`${Ne}Column${Ze}`},disabled:Q})},[I,j,L,w,c]),o.useEffect(()=>{const u=t.getProtection(),N=t.getProtection().isLocked(),U=!u.isFormatCellsAllowed(),m={disabled:U};g.getCommand("protectionSheetToggle").updateCallback(async(le,b)=>{let O=null;try{if(N){let R=null;if(u.hasPassword()){const P=await c.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(P.option!=="Unprotect")return;R=P.input}O=await Promise.resolve(c.showBusy(b.label())),await u.unlock(R)}else O=await Promise.resolve(c.showBusy(b.label())),await u.lock();O?.()}catch(R){O?.(),c.showError(R)}}).update({state:N,label:()=>N?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:N?"Unprotect":"Protect"}}),g.getCommand("deleteTable").update(m),g.getCommand("sortAscending").update(m),g.getCommand("sortDescending").update(m),g.getCommand("sortCustom")?.update(m),g.getCommand("updateComments").update(m),g.getCommand("deleteComments").update(m),g.getCommand("insertChart")?.update(m),g.getCommand("insertImageFromFile").update(m),g.getCommand("insertImageFromURL").update(m),g.getCommand("formatBorder").update(m),g.getCommand("formatFillColor").update(m),g.getCommand("formatFontColor").update(m),g.getCommand("formatBoldToggle").update(m),g.getCommand("formatItalicToggle").update(m),g.getCommand("formatUnderlinedToggle").update(m),g.getCommand("formatStrikeThroughToggle").update(m),g.getCommand("formatSuperscriptToggle").update(m),g.getCommand("formatSubscriptToggle").update(m),g.getCommand("formatAlignTopToggle").update(m),g.getCommand("formatTextOverflowVisibleToggle").update(m),g.getCommand("formatTextOverflowWrapToggle").update(m),g.getCommand("formatTextOverflowClipToggle").update(m),g.getCommand("formatTextOverflowShrinkToggle").update(m),g.getCommand("formatAlignMiddleToggle").update(m),g.getCommand("formatAlignBottomToggle").update(m),g.getCommand("formatAlignDistributedVerticalToggle").update(m),g.getCommand("formatAlignJustifyVerticalToggle").update(m),g.getCommand("formatAlignLeftToggle").update(m),g.getCommand("formatAlignCenterToggle").update(m),g.getCommand("formatAlignRightToggle").update(m),g.getCommand("formatAlignJustifyToggle").update(m),g.getCommand("formatAlignCenterContinuousToggle").update(m),g.getCommand("formatAlignDistributedHorizontalToggle").update(m),g.getCommand("formatAlignFillToggle").update(m),g.getCommand("formatFontSizeIncrease").update(m),g.getCommand("formatFontSizeDecrease").update(m),g.getCommand("formatFontFamily").update(m),g.getCommand("formatFontSize").update(m),g.getCommand("formatNumberFormat").update(m),g.getCommand("formatNumberFormatGeneralStyle").update(m),g.getCommand("formatNumberFormatNumberStyle").update(m),g.getCommand("formatNumberFormatTimeStyle").update(m),g.getCommand("formatNumberFormatDateStyle").update(m),g.getCommand("formatNumberFormatAccountingStyle").update(m),g.getCommand("formatNumberFormatPercentStyle").update(m),g.getCommand("formatNumberFormatScientificStyle").update(m),g.getCommand("formatNumberFormatCommaStyle").update(m),g.getCommand("formatNumberFormatIncreaseDecimal").update(m),g.getCommand("formatNumberFormatDecreaseDecimal").update(m),g.getCommand("hideColumns").update(m),g.getCommand("unhideColumns").update(m),g.getCommand("hideRows").update(m),g.getCommand("unhideRows").update(m),g.getCommand("insertFunctionSum").update(m),g.getCommand("insertFunctionAverage").update(m),g.getCommand("insertFunctionCount").update(m),g.getCommand("insertFunctionMax").update(m),g.getCommand("insertFunctionMin").update(m),g.getCommand("insertFunction").update(m),g.getCommand("startEditCurrentTime").update(m),g.getCommand("startEditCurrentDate").update(m),g.getCommand("startEditValueAbove").update(m),g.getCommand("fillDown").update(m),g.getCommand("fillRight").update(m),g.getCommand("fillUp").update(m),g.getCommand("fillLeft").update(m),g.getCommand("formatCellStyle").update(m),g.getCommand("formatTableStyle").update(m),g.getCommand("formatPainterToggle").update(m),g.getCommand("formatBorderAddOutline").update(m),g.getCommand("formatBorderClearOutline").update(m),g.getCommand("formatIndentDecrease").update(m),g.getCommand("formatIndentIncrease").update(m),g.getCommand("clearContents").update(m),g.getCommand("clearFormats").update(m),g.getCommand("clearAll").update(m),g.getCommand("clearComments").update(m),g.getCommand("clearHyperlinks").update(m),g.getCommand("autoFilterClear").update(m),g.getCommand("autoFilterReapply").update(m);const F=Te.getAlignment().getHorizontal(),G=F===d.ITextFrame.HorizontalAlignment.CenterContinuous||F===d.ITextFrame.HorizontalAlignment.Fill,te={disabled:U||G};g.getCommand("formatTextRotate0").update(te),g.getCommand("formatTextRotate45").update(te),g.getCommand("formatTextRotate90").update(te),g.getCommand("formatTextRotate270").update(te),g.getCommand("formatTextRotate315").update(te),g.getCommand("formatTextRotateCustom").update(te),g.getCommand("formatTextRotateVertical").update(te)},[I]),g}const Al="_sheet-scrollbar_104cg_1",bo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:h,showCustomScrollButtons:c,offset:C=0,totalSize:k=0,viewportSize:y=0,className:p,endGap:M,...T}=e;if(!a)throw new Error("SheetScrollbar needs an ISheet");const z=r.useCallbackRef(l,[l]),D=r.useCallbackRef(f,[f]),Z=o.useRef(null),K=Lt([Z,t]),w=i===r.ScrollbarOrientation.Vertical,[L,v]=o.useState(()=>{const Ie=a.getView().getTopLeft();return w?Ie.top:Ie.left}),I=()=>{const Ie=a.getView().getFreezePanes();return w?Ie.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Ie.coords.rowIndex)-Ie.topLeft.top,scroll:Ie.topLeft.top}:Ie.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Ie.coords.colIndex)-Ie.topLeft.left,scroll:Ie.topLeft.left}},[q,X]=o.useState(I),[E,j]=o.useState(null),[$,ve]=o.useState(!1),Y=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),_=()=>{const Ie=a.getUsedRange()?.getCoords()??he.CoordUtils.EmptyRange,ke=a.getSelection().getCoords().cell;return{colIndex:Math.max(Ie.colEnd,ke.colIndex),rowIndex:Math.max(Ie.rowEnd,ke.rowIndex)}},[A,J]=o.useState(_),x=A?(w?A.rowIndex:A.colIndex)+1:0,S=()=>{const Ie=_();he.CoordUtils.isEqualCells(A,Ie)||J(Ie)};Qe(a.getView(),{onFreezeSplitChange:()=>{X(I)}}),Qe(a.getSelection(),{onChange:S}),Qe(a,{onUsedRangeChange:S}),o.useEffect(()=>{J(_())},[a]);const oe=C-q.scroll,ie=y-q.shift,qe=k-(q.shift+q.scroll),de=Y.findOffset(x)*(a.getView().getZoomScale()/100)-(q.scroll+q.shift);o.useEffect(()=>{if(!E)return $&&D?.(),void ve(!1);De(w,L,ie,M,E,a,Y,q)},[w,C,L,ie,M,q,i,E,Y,$,a]);const Pe=r.useCallbackRef((Ie,ke,ge)=>{v(Ie);const B=Ie+q.scroll,Fe=ke+q.shift,ze=ge+q.shift+q.scroll;h?.(B,Fe,ze)},[h,q]),je=o.useCallback((Ie,ke,ge,B,Fe,ze,H,W)=>{const me=H.getTextAt(H.findIndex(ke/(ze.getView().getZoomScale()/100)+W.scroll+W.shift)),ue={...Fe,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+me};if(Z.current){const fe=Z.current.querySelector('[role="slider"]');if(fe){const Me=fe.getBoundingClientRect();Ie?ue.anchor.y=Me.top+Me.height/2:ue.anchor.x=Me.left+Me.width/2}}ve(!0),z?.(ue)},[]),De=r.useCallbackRef(he.CommonUtils.debounce(je,90),[]);return o.useMemo(()=>s.jsx(r.VirtualScrollbar,{ref:K,className:ct(p,Al),style:n,offset:oe,viewportSize:ie,totalSize:qe,orientation:i,showCustomScrollButtons:c,onMouseDown:Ie=>{j({anchor:{x:Ie.clientX,y:Ie.clientY}}),Ie.preventDefault()},onScrollOffset:Pe,onMouseOut:()=>{j(null)},onMouseUp:()=>{j(null)},minSize:de,...T}),[p,oe,ie,qe,i,c,n,de,M])}));bo.displayName="SheetScrollbar";const jo=(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},Oo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:h,containerHeight:c,headerText:C,freezeStart:k,gridStyle:y,verticalPadding:p,horizontalPadding:M,onSheetContextMenu:T,onResizeHeadersStart:z,onResizeHeaders:D,onResizeHeadersEnd:Z,onResizeHeadersDown:K,onResizeHeadersUp:w,scrollPoint:L,onSelectionStart:v,onSelectionEnd:I}=e,q=o.useMemo(()=>n.getOrientation(),[n]),X=o.useRef(null),[E,j]=o.useReducer(R=>R+1,0),[$,ve]=o.useReducer(R=>R+1,0),Y=n?.getSheet(),_=o.useRef(!1);o.useLayoutEffect(()=>{_.current=!0},[n]);const A=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),J=o.useMemo(()=>{const R=q===d.IRange.Orientation.Column;return{left:R?L.left:0,top:R?0:L.top}},[L]),[x,S]=o.useState(Y?.getView().getZoomScale()/100),[oe,ie]=o.useState(null);Qe(n,{onSizesChange:R=>{S(Y?.getView().getZoomScale()/100),Me(ue())}});const qe=o.useCallback(()=>{X.current?.invalidate(),ve()},[]),de=o.useCallback(he.CommonUtils.debounce(()=>{qe()},10),[]),[Pe,je]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){je(Y?.getSelection().getCoords()),de()},onProtectionChange(){qe()},onViewChange(){de()}}),o.useLayoutEffect(()=>{Me(ue())},[q,x,f]),o.useLayoutEffect(()=>{ie(null),S(n?.getSheet().getView().getZoomScale()/100),Me(ue())},[n]);const De=o.useCallback(R=>n.at(R)?.isHidden()||n.at(R)?.getSize()===0,[n]),Ie=o.useCallback((R,P)=>n.hiddenHeadersAt(R,P),[De]),ke=r.useCallbackRef(R=>n.isSelected(R),[n]),ge=r.useCallbackRef(R=>n.isSelectedAll(R),[n]),B=o.useCallback(()=>n.getMinSize(),[n]),Fe=o.useCallback(()=>n.getMaxSize(),[n]),ze=r.useCallbackRef((R,P,ce)=>{P/=x;const se={size:P=Math.max(B(),Math.min(he.CommonUtils.roundAccurately(P,B()),Fe())),hidden:!1},ye=[];if(P<=0&&(se.hidden=!0,se.size=ce),ye.push({address:{min:R,max:R},update:se}),P<0){const ee=q===d.IRange.Orientation.Column,pe=ee?fe.getColOffset:fe.getRowOffset,V=ee?fe.getColIndex:fe.getRowIndex,Q=pe(R);let re=V(Q+P);const Ee=pe(re);Ee===Q+P?re--:ye.push({address:{min:re,max:re},update:{size:Q-Ee+P}}),R-re>1&&ye.push({address:{min:re+1,max:R-1},update:{hidden:!0}})}n.updateHeaderPairs(ye),D?.(R,P,ce)},[E,n,x,D]),H=r.useCallbackRef((R,P,ce)=>{const se=q===d.IRange.Orientation.Column;let ye=null,ee={min:R,max:R};if(n.isSelectedAll(R)){const pe=n.getSelectedRuns();pe.length>1?ye="Resize "+(se?"Columns":"Rows"):ee=pe[0];const V={hidden:P<=0,size:(P<=0?ce:P)/x};n.updateHeaderPairs(jo(pe,V,R))}if(ee){const pe=ee.max-ee.min+1;let V;V=pe===1?n.getRange(ee).at(0).getDisplayText():n.getRange(ee).toString(),ye=`Resize ${se?"Column":"Row"}${pe>1?"s":""} '${V}'`}Z?.(R,P,ye)},[E,n,Z]),W=r.useCallbackRef((R,P)=>{const ce=q===d.IRange.Orientation.Column;z(R,P,`Resize ${ce?"Column":"Row"}(s)`)},[z]),me=r.useCallbackRef(R=>{let P=!1;const ce=q===d.IRange.Orientation.Column,se=n.getSheet().getEntireRange().getCoords(),ye=[],ee=n.getSelectedRuns(),pe=V=>{let Q;Q=ce?{colStart:V.min,rowStart:se.rowStart,colEnd:V.max,rowEnd:se.rowEnd}:{colStart:se.colStart,rowStart:V.min,colEnd:se.colEnd,rowEnd:V.max},ye.push(Q)};for(let V=0;V<ee.length;V++){const Q=ee[V];Q.value.isSelectedAll&&(Q.min<=R&&Q.max>=R&&(P=!0),pe(Q))}if(P||pe({min:R,max:R}),n.getSheet().getRanges(ye).autoFit({orientations:ce?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),De(R)){const V={hidden:null},Q=jo(ee,V);P||Q.push({address:R,update:V}),n.updateHeaderPairs(Q)}Z?.(R,null,"Resize Column(s)")},[E,n,Z,De]),ue=()=>{const R=q===d.IRange.Orientation.Column;return{getColOffset:P=>R?n.findOffset(P):P===0?0:f/x,getColIndex:P=>R?n.findIndex(P):0,getRowOffset:P=>R?P===0?0:f/x:n.findOffset(P),getRowIndex:P=>R?0:n.findIndex(P)}},[fe,Me]=o.useState(()=>ue()),ae=o.useCallback((R,P)=>R.nativeEvent.which!==r.MouseButtonCodes.Right||!ge(q===d.IRange.Orientation.Column?P.colIndex:P.rowIndex),[q,ge]),be=r.useCallbackRef(R=>{a.focusSheet()},[a]),g=r.useCallbackRef(R=>{Y?.getSelection().updateCoords(R)},[Y]),{...Le}=gt.useSelection({gridRef:i,commands:null,layout:fe,selection:Pe,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:g,canSelectionSpanMergedCells:R=>{const P=Y.getRange(R);return P.isEntireColumns()||P.isEntireRows()}}),Oe=r.useCallbackRef(()=>{v?.();const R=Y?.getSelection();R&&R.setAdjusting(R.getCoords())},[Y,v]),Te=r.useCallbackRef(async()=>{Y?.getSelection().setAdjusting(null),I?.()},[Y,I]),{...u}=gt.useHeaderSelection({orientation:q,headerCount:A,gridRef:X,gridMainRef:i,newSelection:Le?.newSelection,modifySelection:Le?.modifySelection,appendSelection:Le?.appendSelection,clearSelections:Le?.clearSelections,pointerDownInterceptor:ae,onPointerUp:be,onDragStart:Oe,onDragEnd:Te}),N=y.selection?.strokeFill;o.useEffect(()=>{if(!X.current)return void ie(null);const R=q===d.IRange.Orientation.Column,P=n.getSelectedRuns(),ce=n.isProtected()?null:ze,se=(ee,pe,V)=>{if(V)return R?s.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${N}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(V.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(V.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},ee):s.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${N}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(V.y-y.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,width:f+y.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(V.height+y.headerSelection.strokeWidth+1,!0)}px`}},ee)},ye=(ee,pe,V)=>{const Q={x:0,y:0,width:0,height:0};if(R){const re=V.toClipBounds(V.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:ee,colEnd:Math.min(A,pe)}),gt.SELECTION_CLIP_INSETS);if(!re)return;Q.x=re.x,Q.width=re.width}else{const re=V.toClipBounds(V.getRangeCoordsBounds({rowStart:ee,rowEnd:Math.min(A,pe),colStart:0,colEnd:0}),gt.SELECTION_CLIP_INSETS);if(!re)return;Q.y=re.y,Q.height=re.height}return{x:Q.x,y:Q.y,width:Q.width,height:Q.height}};ie([ee=>{let pe=null,V=R?ee.getVisibleColumns():ee.getVisibleRows();const Q=R?ee.getTotalRangeCoords().colStart:ee.getTotalRangeCoords().rowStart;V.length>0&&V[0]>Q&&(V=[V[0]-1,...V]);let re=[];const Ee=[],Ue=V.length;for(let Se=0;Se<Ue;Se++){const Ne=V[Se],Ze=Se<Ue-1?V[Se+1]:Ne+Ie(Ne+1,!1)+1,_e=Ne+1!==Ze;if(!pe||pe.max<Ne)if(P.length>0&&P[P.length-1].max>=Ne){const ot=he.CommonUtils.findEqualOrGreater(P,Ne,$e=>$e.max);pe=P[ot]}else pe=null;let Xe=!1,at=!1;if(pe?.value&&(pe.min<=Ne||pe.min<=Ze&&!_e)&&(Xe=!0,at=pe.value.isSelectedAll),Ne===Q){let ot=!1,$e=!1;pe?.value&&pe.min<=Ne&&(ot=!0,$e=pe.value.isSelectedAll),Ne>0&&Ee.push({index:Ne-1,isNextHidden:_e,isSelected:ot,isSelectedAll:$e,disabledResize:!0})}if(at&&re.push(Ee.length),Ee.push({index:Ne,isHidden:Se===0&&Ie(Ne,!1)>0,isNextHidden:_e,isSelected:Xe,isSelectedAll:at,onDividerMouseDown:K,onDividerResizeStart:W,onDividerResize:ce,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:me}),_e){let ot=!1,$e=!1;if(pe&&pe.min>=Ne&&pe.max<=Ze-1&&pe.value.isSelectedAll&&re.push(Ee.length),!(pe?.value&&pe.max>=Ze))if(P.length>0&&P[P.length-1].max>=Ze){const lt=he.CommonUtils.findEqualOrGreater(P,Ze,it=>it.max);pe=P[lt]}else pe=null;pe?.value&&pe.min<=Ze&&(ot=pe.value.isSelected,$e=pe.value.isSelectedAll),Ze>0&&Ee.push({index:Ze-1,isHidden:!0,isSelected:ot,isSelectedAll:$e,onDividerMouseDown:K,onDividerResizeStart:W,onDividerResize:ce,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:me})}}if(re.length>0){let Se=re.length-1;if(re.length>0){const _e=Ee[re[Se]].index;let Xe=null;R?(Xe=ee.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),Xe.x+Xe.width>ee.getBounds().width&&(Se-=1,Se===0&&(Se=-1))):(Xe=ee.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),Xe.y+Xe.height>ee.getBounds().height&&(Se-=1,Se===0&&(Se=-1)))}const Ne=P?.[P.length-1],Ze=ee.getAnchor();if(Ze==="t"||Ze==="l"){const _e=Ee[re[Math.max(0,re.length-1)]];_e.showTouchDivider=Ne&&Ne.max<=_e.index}else Se>=0&&(Ee[re[Se]].showTouchDivider=!0)}const{header:Be,headerSelect:xe,headerSelectAll:He,headerHover:Ce}=y??{},Ae=Ee.length,we=new Array(Ae);for(let Se=0;Se<Ae;Se++)we[Se]=s.jsx(gt.HeaderDivider,{orientation:q,view:ee,headerStyle:Be,headerStyleSelect:xe,headerStyleSelectAll:He,headerStyleHover:Ce,disabled:n.isProtected(),...Ee[Se]},`divider${Se}`);return we},ee=>{const pe=[],V=P.length;for(let Q=0;P&&Q<V;Q++)pe.push(se(`selection:${ee.getAnchor()}:${Q}`,0,ye(P[Q].min,P[Q].max,ee)));return pe}])},[$,!0,N,y,fe,A,k,E,x]),o.useEffect(()=>{X.current?.invalidate()},[E]);const U=r.useCallbackRef(R=>C?C(R):n.getTextAt(R),[C,n]),m=r.useCallbackRef(R=>{const{header:P,headerSelect:ce,headerSelectAll:se,headerHover:ye}=y??{},{range:ee,key:pe,...V}=R;return s.jsx(gt.HeaderRenderer,{orientation:q,index:q===d.IRange.Orientation.Column?ee.colStart:ee.rowStart,isSelected:ke,isSelectedAll:ge,zoomScale:100*x,headerText:U,headerStyle:P,headerStyleSelect:ce,headerStyleSelectAll:se,headerStyleHover:ye,verticalPadding:p,horizontalPadding:M,...V},pe)},[E,A,y,x,n]),F=r.useEditMode(),G=o.useMemo(()=>{const R="white",P="black",ce={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let se=q===d.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${P}' fill='${R}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${P}' fill='${R}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;F.getMode()?.key==="formatPainter"&&(se=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${P}' fill='${R}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),ce.cursor=se}return ce.backgroundColor=y?.header?.fill||"transparent",ce},[q,E,F,y]),te=r.useImperativeElement(t,()=>({scrollTo:R=>{X.current?.scrollTo(R)},forceRender:()=>{j()},getGridElement:()=>X.current}),[]),le=o.useCallback(R=>{u.onPointerDown(R)},[u]),b=o.useCallback(R=>{const P=u.getCellCoordsFromClient(R.clientX,R.clientY);if(!P||!T)return;const ce=q===d.IRange.Orientation.Column;T({originalEvent:R,clientX:R.clientX,clientY:R.clientY,rowIndex:ce?-1:P.rowIndex,colIndex:ce?P.colIndex:-1}),R.stopPropagation(),R.preventDefault()},[u,T]),O=o.useMemo(()=>{const R=q===d.IRange.Orientation.Column;return s.jsx("div",{ref:te,children:s.jsx(gt.Grid,{className:"sheet-header",style:G,ref:X,scrollPoint:J,columnCount:R?A:1,rowCount:R?1:A,width:R?h:f,height:R?f:c,freezeLeft:R?k:void 0,freezeTop:R?void 0:k,hiddenColumnsAt:R?Ie:void 0,hiddenRowsAt:R?void 0:Ie,showGridLines:!1,layout:fe,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:b,onPointerDown:le,zoom:x,renderCell:m,renderOverlays:oe})})},[oe,fe,h,c,J,G,$]);return o.useEffect(()=>{_.current=!1,X.current?.invalidate(),ve()},[n,y]),O})),Dl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((C,k)=>C.getStyle().getBorder(),[]),{renderOverlay:h}=Co({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),c=h(n);return c&&n?c:null})),zl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Nl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Ll={type:d.ICell.Content.Values},Pl={fitDestination:!0,type:d.ICell.Content.Formats},jl={fitDestination:!0,type:d.ICell.Content.Formulas},Ol={transpose:!0},Bl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},xr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,renderSelection:f=gt.defaultSelectionRenderer,copyForegroundColor:h="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:C="white",cutBackgroundColor:k="white",...y})=>{const p=r.useCallbackRef(f,[f]),M=o.useRef(null),T=r.useEditMode(),z=T.getMode(),D=o.useMemo(()=>({element:e,doCopy:v=>{const I=t.getSelectedRanges().getSnapshot(v);return new d.RangeClipboardItem(I)}}),[t,n,e]),Z=o.useMemo(()=>({element:e,importFromExternal:async(v,I)=>{const q=new d.ExternalRangeClipboardItem(v,I,t.getStyles(),t.isDate1904());return await q.parse()?q:null},doPaste:async(v,I)=>{if(v?.getItemType()!=="range")return;I?.contentsOnly&&delete(I={...I,type:d.ICell.Content.Values}).contentsOnly;const q=v.getItem(),X=q.getName();let E=t.getSelectedRange();if(X==="HTML"&&E.size>1){const j=q?.getCoords();j&&he.CoordUtils.isSingleCell(j)&&(E=E.getResizeTo(1,1))}return await E.doBatch(async()=>{const j=await E.copyFrom(q,I);!j||j.isEntireRows()||j.isEntireColumns()||j.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(X?` ${X}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:K,...w}=r.useCopyPaste({...y,source:D,commands:i,target:Z,onClipboardUpdate:v=>{const I=v?.getItemType()==="range"?v:null;if(I){const q=v.editMode?.(),X={...v?.isCut?.()?Nl:zl,...q,args:{isClipboard:!0,...q?.args},onModeChange:E=>{E?.args?.isClipboard||K.clear(!0),q?.onModeChange?.(E)}};T.setMode(X)}M.current=I,a?.(I)},onPaste:(v,I)=>{if(v?.getItemType()!=="range")return;let q=T.getMode()?.key==="cut"||v.isCut?.();if(!q&&T.getMode()?.key==="copy"){const X=v.getItem().getCoords(),E=t.getSelectedRanges().getCoords();let j=!1;if(!j&&X&&E&&v.getItem().getSource?.()===t)for(let $=0;!j&&$<E.length;$++)j=he.CoordUtils.isRangesIntersect(X,E[$]);q=j}q&&T.setMode(null),e?.()?.focus(),l?.(v,I)}});o.useMemo(()=>{const v=e;if(!i)return;const I=[new r.Command("pasteValues",v,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
20
20
 
21
- The formatting is not applied.`,icon:"PasteValues",shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",p,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
21
+ The formatting is not applied.`,icon:"PasteValues",shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",v,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
22
22
 
23
- The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",p,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied.",icon:"PasteFormulas"}),new r.Command("pasteTranspose",p,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",p,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(A,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const p={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(A=>x.paste({...Pl,...A})).update(p),i.getCommand("pasteFormats").updateCallback((A,S)=>x.paste({...jl,description:S.label(),...A})).update(p),i.getCommand("pasteFormulas").updateCallback((A,S)=>x.paste({...Ol,description:S.label(),...A})).update(p),i.getCommand("pasteTranspose").updateCallback((A,S)=>x.paste({...Bl,description:S.label(),...A})).update(p),i.getCommand("pasteLinks").updateCallback((A,S)=>x.paste({...Hl,description:S.label(),...A})).update(p),i.getCommand("cut").update(p),i.getCommand("paste").update(p)},[t,i]);const B=o.useMemo(()=>{if(!P||!M.current)return;const p=P.key;if(p!=="copy"&&p!=="cut"&&p!=="formatPainter")return;const A=M.current.getItem();if(A.getSource()!==t)return;const S=M.current.isCut?.(),U=S?b:y,D=S?s:h,j=A.getCoords(),K=j?[j]:null;return K&&K.length!==0?pe=>{const Z=[];for(let V=0;V<K.length;V++){const N=K[V],F=pe.toClipBounds(pe.getRangeCoordsBounds(N,{top:0,left:0,right:1,bottom:1}),ht.SELECTION_CLIP_INSETS);F&&(Z.push(m({range:N,key:`copy-selection-background-${V}`,x:F.x,y:F.y,width:Math.max(F.width,0),height:Math.max(F.height,0),stroke:U,strokeWidth:2})),Z.push(m({range:N,key:`copy-selection-foreground-${V}`,x:F.x+(F.width<=2?-1:0),y:F.y,width:Math.max(F.width,3),height:Math.max(F.height,3),stroke:D,strokeWidth:2,isAnimatedStroke:!0})))}return Z}:null},[P,t,n,h,y,s,b]);return{...x,clipboard:H,overlays:B}},Vl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,h=l.body??{},s=a.getView(),{overlays:y}=xr({element:i,sheet:a,sheetView:s,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:h.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:h.fill});return et(a?.getSelection(),{onChange(b){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),y&&n?y(n):null})),Ul="_sheet-selection_12wyx_5",Kl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Wl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},$l={key:"dragCopy",description:"Drag selection to copy cell contents."},Gl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Bo=(e,t)=>t.ctrlKey&&t.shiftKey?Gl:t.ctrlKey?$l:t.shiftKey?Wl:Kl,_l={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Zl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:h,sheet:s,gridRef:y,gridStyle:b,isActive:w,...m}=e,M=n?.getBounds(),T=r.useCallbackRef(f,[f]),P=r.useCallbackRef(h,[h]),[z,_]=o.useState(()=>s?.getSelection().getCoords()),H=r.useCallbackRef(G=>{ge.CoordUtils.isEqualSelectionCoords(G,z)||s&&s.getSelection().updateCoords(G)},[s,z]),x=r.useEditMode(),B=o.useRef(null),[p,A]=o.useState(s?.getProtection().isLocked()),[S,U]=o.useState(s?.getView().getMovableSelection().length>0),D=r.ReactUtils.detectIt().primaryInput==="touch",j=!D&&w,K=x.getMode()?.args?.stateAndCoords?.coords??null,pe=K!==null||S,Z=r.useCallbackRef(G=>{const W=ge.CoordUtils.cellToRange(G);if(s.isClosed())return W;const re=s.getRange(W,{ignoreHidden:!0}).getMerges();return re.length===0?W:re[0]},[s]),V=r.useCallbackRef((G,W,re,me,se,Se)=>{const ie=s.getSelectedRange().getExtended(me,G).getCoords();switch(me){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]),N=r.useCallbackRef(()=>{const G=s.getUsedRange()?.getCoords(),W=s.getRowHeaders().getUsedRange()?.getCoords(),re=s.getColumnHeaders().getUsedRange()?.getCoords();return{...G,colEnd:Math.max(G?.colEnd??0,re?.max??0),rowEnd:Math.max(G?.rowEnd??0,W?.max??0)}},[s]),F=r.useCallbackRef((G,W)=>s.getRowHeaders().hiddenHeadersAt(G,W),[s]),k=r.useCallbackRef((G,W)=>s.getColumnHeaders().hiddenHeadersAt(G,W),[s]),O=r.useCallbackRef(G=>s.getRange(G,{ignoreHidden:!0}).getMerges(),[s]),ee=r.useCallbackRef(G=>{s?.getSelection().setAdjusting(G)},[s]),oe=r.useCallbackRef(async()=>{s?.getSelection().setAdjusting(null),x.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),x.setMode(null))},[x,z,s,i]),be=o.useMemo(()=>{const G=x.getMode();return G?.key==="cut"||G?.key==="copy"},[x]);et(s?.getView(),{onMovableSelectionChange:()=>{U(s.getView().getMovableSelection().length>0)}}),et(s?.getSelection(),{onChange(G){const W=s.getSelection().getCoords();_(W)}}),et(s,{onProtectionChange:()=>{A(s.getProtection().isLocked())}});const{body:he={}}=b||{},Ee=r.useNotifier(),Ae=n.getLayout(),We=!(j&&z.ranges.length<=1&&K===null&&!p&&(!x.getMode()||be)),{cursor:ve,overlay:He,onPointerDown:Y}=ht.useSelection({gridRef:y,commands:i,layout:Ae,getCellCoordsAsRangeCoords:Z,selection:z,fillHandleBorderColor:he.fill,selectionBackgroundColor:w?b.selection.fill:b.selectionInactive.fill,selectionBorderColor:w?b.selection.strokeFill:b.selectionInactive.strokeFill,selectionRemoveBackgroundColor:w?b.selectionRemove.fill:b.selectionInactive.fill,selectionRemoveBorderColor:w?b.selectionRemove.strokeFill:b.selectionInactive.strokeFill,disableFillDrag:We,disableMoveDrag:D||!(w&&z.ranges.length<=1&&K===null&&!p),disableTouchSelection:pe,onSelectionChange:H,onSelectionDragStart:ee,onSelectionDragEnd:oe,onMoveDragStart:(G,W,re)=>{x.setMode(Bo(0,re))},onMoveDragUpdate:(G,W,re)=>{x.setMode(Bo(0,re))},onMoveDragEnd:(G,W)=>{x.setMode(null)},onMoveDragDone:async(G,W,re)=>{if(ge.CoordUtils.isEqualRanges(G,W))return;const me=s.getRange(W);if(Ee?.showOptions){const ke=me.getDifferences(G);let Re=!1;const Le=ke.getCount();for(let Ne=0;!Re&&Ne<Le;Ne++)Re=ke.at(Ne).isContentful();if(Re&&await Ee?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const se=!re.ctrlKey,Se=re.shiftKey,ie=Se?se?"Insert Moved Cells":"Insert Copied Cells":se?"Move Cells":"Copy Cells",we=await Ee?.showBusy?.(ie);try{const ke=s.getRange(G);await me.doBatch(async()=>{Se?await me.insertFrom(G,{isCut:se,undoRange:ke}):await me.copyFrom(G,{isCut:se,undoRange:ke}),ke.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),me.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ie,autoSelect:!0})}catch(ke){Ee?.showError?.(ke)}finally{we?.()}},contentfulCellFinder:V,hiddenRowsAt:F,hiddenColumnsAt:k,mergedRanges:O,getDataCoords:N,canSelectionSpanMergedCells:G=>{const W=s.getRange(G);return W.isEntireColumns()||W.isEntireRows()},onFill:async(G,W)=>{const re="Auto Fill",me=await Ee?.showBusy?.(re);try{await s.doBatch(()=>{s.getRange(G).autoFill(W),s.getRange(W).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:re,autoSelect:!0})}catch(se){Ee?.showError?.(se)}finally{B.current=null,me?.()}},onFillPreview:(G,W,re)=>{if(y.current&&T){x.setMode(_l);try{B.current?.direction!==re&&(B.current=null,s.getRange(G).autoFill(W,{previewOnly:Le=>{B.current={callback:Le,direction:re}}}));const me=B.current?.callback?.(W);if(!me||me.isEmpty())return;const se=me.toText();if(!se)return;const Se=ge.CoordUtils.cellToRange(me.getCoords()),ie=n.getRelativePointFromClient(0,0);let we=0,ke=0,Re=r.ToolTipPlacement.Bottom;if(re===d.IRange.Direction.Down){we=Ae.getColOffset(Se.colEnd+1)-ie.x;const Le=Ae.getRowOffset(Se.rowEnd),Ne=Ae.getRowOffset(Se.rowEnd+1);ke=Ne-(Ne-Le)/2-ie.y,Re=r.ToolTipPlacement.Right}else if(re===d.IRange.Direction.Right){ke=Ae.getRowOffset(Se.rowEnd+1)-ie.y;const Le=Ae.getColOffset(Se.colEnd),Ne=Ae.getColOffset(Se.colEnd+1);we=Ne-(Ne-Le)/2-ie.x,Re=r.ToolTipPlacement.Bottom}else if(re===d.IRange.Direction.Up){we=Ae.getColOffset(Se.colEnd+1)-ie.x;const Le=Ae.getRowOffset(Se.rowStart),Ne=Ae.getRowOffset(Se.rowStart+1);ke=Ne-(Ne-Le)/2-ie.y,Re=r.ToolTipPlacement.Right}else if(re===d.IRange.Direction.Left){ke=Ae.getRowOffset(Se.rowEnd+1)-ie.y;const Le=Ae.getColOffset(Se.colStart),Ne=Ae.getColOffset(Se.colStart+1);we=Ne-(Ne-Le)/2-ie.x,Re=r.ToolTipPlacement.Bottom}T({anchor:{x:we,y:ke},display:se,placement:Re})}catch(me){Ee?.showError?.(me)}}},onFillDone:()=>{B.current=null,x.setMode(null),P?.()}}),X=r.useCallbackRef(G=>{Y(r.ReactUtils.createSyntheticEvent(G))},[Y,K]);o.useEffect(()=>{const G=n?.getStage();if(G)return G.addEventListener("pointerdown",X),()=>{G.removeEventListener("pointerdown",X)}},[n?.getStage()]);const de=r.useImperativeElement(t,()=>({}),[]),Me=o.useRef(null);return c.jsx("div",{className:dt(a,"sheet-selection",Ul),style:{position:"absolute",width:M?.width,height:M?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Ut([de,Me]),...m,children:He(n)})})),Mn=Object.freeze({x:0,y:0,width:0,height:0}),Xl={fireOnModelChange:!1},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:h,onShow:s,onUnFocus:y,isDragging:b,updateFrameBounds:w,dragStart:m,style:M,disabled:T,renderMovable:P,...z}=e,[_,H]=o.useState(Mn),[x,B]=o.useState(null),[p,A]=o.useState(!1),S=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const D=a.getBounds();if(!D)return;const j=i.toViewBounds(D);H(j??Mn),w(j??Mn)},[i?.getBounds()]),et(a,{onBoundsChange:D=>{const j=D.getBounds();if(!j)return;const K=i.toViewBounds(j);H(K??Mn),w(K)},onSelectionChange:()=>{const D=ge.CommonUtils.hasFocus(S.current,!0);!p&&!D||a.isSelected()||y()}}),et(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(S.current,!0)},Xl),o.useEffect(()=>{const D=S.current;return l(D),()=>{f(D)}},[]);const U=o.useMemo(()=>{if(!_)return null;let{width:D,height:j}=_;return P({view:i,movable:a,disabled:T,isDragging:b,style:{position:"relative",left:0,top:0,width:D,height:j},onHide:h,onShow:s})},[i,a,_.width,_.height,T,b]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Ut([S,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:_.x,top:_.y,width:_.width,height:_.height,...M},onMouseDown:async D=>{const j=D.shiftKey||D.ctrlKey,K=a.isSelected(),pe=D.currentTarget;j&&K?a.unselect():(K&&!j||await a.select({addToSelection:j}),m(D.nativeEvent,pe),pe.focus())},onFocus:D=>{D.relatedTarget&&!x&&B(D.relatedTarget),A(!0)},onBlur:D=>{x&&!S?.current?.contains(D.relatedTarget)&&B(null),D.relatedTarget&&A(!1)},...z,children:U})})),Jl="_movable-area_314c6_5",qr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:h,onFocus:s,disabled:y=!1,disableDrag:b=!1,disableResize:w=!1,className:m,style:M,renderDirections:T=["nw","n","ne","w","e","sw","s","se"],onFirstRender:P,...z}=e,_=n.getBounds(),H=r.useCallbackRef(P,[P]),x=r.useCallbackRef(h,[h]),B=r.useCallbackRef(s,[s]),[p,A]=o.useState([]),[S,U]=o.useState(!1),[D,j]=o.useState(!1),K=o.useRef(!0),pe=o.useRef(new Map),Z=o.useRef(new Map),V=o.useRef(new Map),N=o.useRef(new Map),F=o.useRef(new Map),k=o.useRef({onRequestFocus:te=>(re(te),null)}),O=o.useRef(null),ee=o.useRef(null),oe=o.useRef(null),[be,he]=o.useReducer(te=>te+1,0);o.useLayoutEffect(()=>{he()},[n,i]),et(i,{onCollectionChange:()=>{const te=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),Te=F.current;Te.forEach(ze=>{ze()}),Te.clear();const Pe=k.current;for(let ze=0;ze<te.length;ze++){const De=te[ze];if(De.isClosed())continue;const I=De.addListeners(Pe);Te.set(De,I)}he()},onInvalidated:()=>{he()}}),et(a,{onMovableSelectionChange(te){Ae(),he()}});const Ee=o.useCallback((te,Te)=>{const Pe=V.current.get(te);oe.current&&(oe.current.getTargets().forEach(ze=>{if(ze===Pe)return ze.style.left=Te.x+"px",ze.style.top=Te.y+"px",ze.style.width=Te.width+"px",void(ze.style.height=Te.height+"px")}),oe.current.updateRect())},[]),Ae=()=>{const te=[],Te=a.getMovableSelection();Te.forEach(Pe=>{const ze=V.current.get(Pe);ze&&Te.indexOf(Pe)!==-1&&te.push(ze)}),A(Pe=>ge.CommonUtils.isEqualArrays(Pe,te)?Pe:te)},We=o.useRef(null),ve=o.useRef(null),He=o.useMemo(()=>(ve.current||(ve.current=new Promise(te=>{We.current=te})),ve.current),[]),Y=o.useRef(null),X=r.useCallbackRef(async(te,Te)=>{Y.current=Te,await(async()=>!(!await He.then()||!oe.current))()&&Y.current===Te&&oe.current.dragStart(te,Te)},[p]),[de,Me]=o.useState(!1),G=o.useRef(null),W=o.useRef(null),re=r.useCallbackRef(async(te=null)=>{if(te||(te=a.getMovableSelection()[0]),!te)return x?.(),!1;const Te=V.current.get(te);Te?(await ge.CommonUtils.whenFocus(Te),Te.focus(),W.current=Te,G.current=null):G.current=te},[a]);o.useEffect(()=>{de&&p.length>0&&W.current!==p[0]&&re(),K.current&&(H?.(),K.current=!1)},[p]);const me=o.useMemo(()=>{const te=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(te.length===0&&pe.current.size===0)return null;const Te=(Q,L,$,xe=!0)=>{const Ce=Q.isSelected(),g={tabIndex:$,view:n,movable:Q,onRefLoad:C=>{G.current===Q&&(C.focus(),W.current=C,G.current=null),V.current.set(Q,C),Z.current.set(C,Q),L.rendered=!0,Ae()},onRefUnload:C=>{V.current.delete(Q),Z.current.delete(C),L.rendered=!1,Ae()},onUnFocus:x,onHide:C=>{L.onHide=C},onShow:C=>{L.onShow=C},isDragging:Ce&&(D||S),disabled:y,renderMovable:l,updateFrameBounds:C=>{Ee(Q,C)},dragStart:X,onMouseUp:()=>{if(Y.current=null,ee.current){U(!1),j(!1);let C=!1;N.current?.forEach(R=>{ge.CommonUtils.isEqualBounds(R.movable.getBounds(),R.startBounds)||(C=!0)}),C?Se():ie()}},style:{opacity:xe?S&&Ce?.7:void 0:0,zIndex:S&&Ce?Q.getZIndex()+te.length:void 0,pointerEvents:xe?void 0:"none",cursor:D&&Ce?"grabbing":y||b?"initial":"move",boxShadow:!Ce||D&&!S?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Yl,{...g},`movable-${Q.getUUID()}`)},Pe=pe.current,ze=new Map,De=[];for(let Q=0;Q<te.length;Q++){const L=te[Q];if(L.isClosed())continue;let $=Pe.get(L);$||($={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(xe,Ce)=>{if(!Ce||Ce.shown===!0)return;Ce.shown=!0;const g=++Ce.visibilityRequestId;requestAnimationFrame(()=>{const C=pe.current.get(xe);C&&g===Ce.visibilityRequestId&&(Ce.onShow?.(xe),C.shown=!0)})},doHide:async(xe,Ce)=>{if(!Ce||Ce?.shown===!1)return;Ce.shown=!1;const g=++Ce.visibilityRequestId,C=await Promise.resolve(Ce.onHide?.(xe));g===Ce.visibilityRequestId&&C!==!1&&(Ce.shown=!1,pe.current.delete(xe),he())},visibilityRequestId:0}),$.frame=Te(L,$,Q,!0),De.push($.frame),$.doShow(L,$),Pe.delete(L),ze.set(L,$)}const I=[];return a.getMovableSelection().forEach(Q=>{const L=Pe.get(Q);L&&(L.frame=Te(Q,L,-1,!1),I.push(L.frame),Pe.delete(Q),ze.set(Q,L))}),Pe.forEach((Q,L)=>{Q.frame=Te(L,Q,-1,!1),I.push(Q.frame),Q.doHide(L,Q),Pe.delete(L),ze.set(L,Q)}),pe.current=ze,Ae(),[...I,...De]},[be,n,l,y,b,w,S,D]),se=r.useCallbackRef((te,Te)=>{const Pe=`${Te} ${p.length===1?d.TextUtils.capitalize(Z.current?.get(p[0]).getContent().getType()):"Drawings"}`;ee.current&&(console.warn(`Transaction ${ee.current.getDescription()} is being replaced by ${Pe}`),ee.current.rollback(),ee.current=null),ee.current=f.beginCommit({description:Pe}),N.current.clear();for(let ze=0;ze<p.length;ze++){const De=p[ze],I=Z.current?.get(De);I?N.current.set(De,{movable:I,startBounds:n.toViewBounds(I.getBounds())}):console.warn("invalid element",I)}},[f,n,p]),Se=o.useCallback(()=>{if(!ee.current)return;const te=[];N.current?.forEach(Te=>{te.push(Te.movable)}),ee.current.commit({viewAfter:{view:a,movableSelection:te}}),N.current.clear(),ee.current=null},[]),ie=o.useCallback(()=>{ee.current&&(ee.current.rollback(),ee.current=null)},[]),we=o.useRef(null);o.useEffect(()=>{we.current&&(we.current.onscroll=te=>{te.preventDefault(),te.srcElement.scrollTop=0,te.srcElement.scrollLeft=0})},[we.current]);const ke=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:re,focus:()=>{re()}}),[a]),[Re,Le]=o.useState(null),Ne=o.useRef(!1),v=o.useRef(!1),Oe=o.useRef(!1);o.useEffect(()=>{if(y||p.length===0||Oe.current||Ne.current)return;if(v.current)return void requestAnimationFrame(()=>{oe.current&&O.current&&oe.current.refTargets.length>0&&(Oe.current=!0,We.current?.(!0)),A([...p])});Ne.current=!0;const te=o.lazy(async()=>{try{const Te=await Promise.resolve().then(()=>require("./U5U53xpMO6ip9Ek5.cjs"));return Ne.current=!1,v.current=!0,A([...p]),Te}catch(Te){return console.warn(Te),We.current?.(!1),null}});Le(te)},[p,y,b,w]);const tt=o.useMemo(()=>!Re||y?null:c.jsx(o.Suspense,{children:c.jsx(Re,{className:dt({dragging:S||D,resizing:S,moving:D}),container:null,ref:oe,target:oe.current?p:[],draggable:!y&&!b,resizable:!y&&!w,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:T,onResizeStart:te=>{se(te.target,"Resize")},onResize:te=>{if(!ee.current)return te.stopDrag(),void he();U(!0);const Te=te.direction[0]!==0&&te.direction[1]!==0;let Pe=0,ze=0;for(let De=0;De<p.length;De++){const I=p[De],Q=N.current.get(I),L=Z.current.get(I);if(!Q||!L){console.warn("invalid element");continue}let $=te.dist[0],xe=te.dist[1],Ce=te.drag.dist[0],g=te.drag.dist[1],C=Q.startBounds.width,R=Q.startBounds.height;De===0?(Pe=C,ze=R):($*=C/Pe,Ce*=C/Pe,xe*=R/ze,g*=R/ze);const u={...Q.startBounds};if(u.width=Math.max(0,C+$),u.height=Math.max(0,R+xe),te.direction[0]===-1&&(u.width=Math.max(0,Math.min(Q.startBounds.x+C,C-Ce))),te.direction[1]===-1&&(u.height=Math.max(0,Math.min(Q.startBounds.y+R,R-g))),Te&&(L.isLockAspectRatio()||te.inputEvent?.shiftKey)){const q=C/R,E=u.width/u.height;E>q?u.height=u.width/q:E<q&&(u.width=u.height*q)}te.direction[0]===-1&&(u.x=Math.max(0,Math.min(Q.startBounds.x+C,Q.startBounds.x+C-u.width))),te.direction[1]===-1&&(u.y=Math.min(Q.startBounds.y+R,Q.startBounds.y+R-u.height)),Q.movable.setBounds(n.toAbsoluteBounds(u))}},onResizeEnd:te=>{U(!1),Se()},onDragStart:te=>{se(te.target,"Move")},onDrag:te=>{if(!ee.current)return te.stopDrag(),void he();j(!0);for(let Te=0;Te<p.length;Te++){const Pe=p[Te],ze=N.current.get(Pe);ze?ze.movable.setBounds(n.toAbsoluteBounds({...ze.startBounds,x:ze.startBounds.x+te.translate[0],y:ze.startBounds.y+te.translate[1]})):console.warn("invalid element")}},onDragEnd:te=>{},onMouseUp:te=>{}})}),[be,Re,p,n,y,b,w,S,D]);return c.jsx("div",{className:dt(m,"movable-area",Jl),style:{width:_.width,height:_.height,...M,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Ut([ke,we]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:_.width,height:_.height},...z,children:c.jsxs("div",{ref:O,style:{position:"absolute",pointerEvents:"auto"},onFocus:te=>{B?.(),Me(!0)},onBlur:te=>{Me(!1)},onKeyDownCapture:te=>{if(te.isDefaultPrevented())return;const Te=te.nativeEvent.ctrlKey,Pe=te.nativeEvent.altKey,ze=te.nativeEvent.shiftKey;if(te.which===r.KeyCodes.Escape){const $=a.getMovableSelection();let xe=[...$];return p.forEach(Ce=>{if(xe.length===0)return;const g=Z.current.get(Ce);let C=xe.indexOf(g);xe.splice(C,1)}),xe.length!==$.length&&a.selectMovables(xe),xe.length===0&&x?.(),void te.preventDefault()}const De=.1,I=$=>{i.updateSelected(xe=>{xe.setRotation(xe.getRotation()+$)},"Rotate")},Q=($,xe=!0)=>{i.updateSelected(Ce=>{const g=Ce.getBounds();let C=1+$;xe||(C=1/C);const R=Math.sqrt(Math.pow(g.width,2)+Math.pow(g.height,2)),u=Math.atan2(g.height,g.width),q=C*R;if(q<10)return;const E=q*Math.cos(u),le=q*Math.sin(u),fe={x:g.x+(g.width-E)/2,y:g.y+(g.height-le)/2,width:E,height:le};Ce.setBounds(fe)},"Resize")},L=$=>{i.updateSelected(xe=>{const Ce=xe.getBounds(),g={x:Ce.x+($.x??0),y:Ce.y+($.y??0),width:Ce.width+($.width??0),height:Ce.height+($.height??0)};xe.setBounds(g)},"Nudge")};if(te.which===r.KeyCodes.Delete)i.updateSelected($=>{$.delete()},"Delete"),te.preventDefault();else if(te.key==="a"&&Te){const $=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables($,!0),te.preventDefault()}else te.key==="ArrowLeft"?(ze?Q(De,!1):Pe?I(-10):L({x:Te?-10:-1}),te.preventDefault()):te.key==="ArrowRight"?(ze?Q(De,!0):Pe?I(10):L({x:Te?10:1}),te.preventDefault()):te.key==="ArrowUp"?(ze?Q(De,!0):L({y:Te?-10:-1}),te.preventDefault()):te.key==="ArrowDown"&&(ze?Q(De,!1):L({y:Te?10:1}),te.preventDefault())},children:[me,tt]})})})})),_t=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const f=e[l].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),i=Math.max(f.x+f.width,i),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ho=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,h=Number.MAX_SAFE_INTEGER,s=0;for(let w=0;w<e.length;w++){const m=e[w],M=m.getBounds();f+=M[l],h=Math.min(M[i],h),s=Math.max(M[i]+M[l],s),n.push({bounds:M,movable:m})}const y=(s-h-f)/(e.length-1);n.sort((w,m)=>{const M=w.bounds[i],T=m.bounds[i];return M!==T?M-T:w.bounds[a]-m.bounds[a]});const b=new Map;b.set(n[0].movable,n[0].bounds);for(let w=1;w<n.length-1;w++){const m=n[w-1].bounds,M={...n[w].bounds};M[i]=m[i]+m[l]+y,n[w].bounds=M,b.set(n[w].movable,M)}return b.set(n[n.length-1].movable,n[n.length-1].bounds),b},Sr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,h=r.useNotifier(),s=r.useEditMode();o.useRef(s.getMode()).current=s.getMode();const y=r.useCallbackRef(async(x,B,p=null,A=!0)=>{const S=async()=>{const U=await Promise.resolve(h?.showBusy?.(x.label()));try{await B();const D=p??x?.label?.();if(f){let j=null;x&&D!==!1&&(j=new r.SimpleCommand(x.key(),l,{label:D,description:D},S)),f(j)}U?.(),A&&s.setMode(null)}catch(D){U?.(),h?.showError?.(D)}};await S()},[f,h]),[b,w]=o.useReducer(x=>x+1,0),m=r.useCallbackRef((x,B,p)=>{if(!n)return;const A=n.getMovableSelection();if(A.length===0)return;let S="Drawings";if(A.length===1){const D=A[0];S=d.TextUtils.capitalize(D.getContent().getType())??"Drawing"}const U=`${x.label()} ${S}`;y(x,()=>{let D=null;i&&(D=i.beginCommit(U));const j=n.getMovableSelection();if(j.length===0)return;const K=p?.(j);for(let pe=0;pe<j.length;pe++){const Z=j[pe];B(Z,K)}D?.commit()})},[n,i]),[M,T]=o.useState(n.getMovableSelection()[0]??null),[P,z]=o.useState(!M||M?.isProtected()),_=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){m(this,x=>{x.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){m(this,x=>{x.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){m(this,x=>{x.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){m(this,x=>{x.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){m(this,x=>{x.setLockAspectRatio(!x.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){m(this,x=>{x.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes.",icon:"DrawResize"},function(){m(this,x=>{x.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes.",icon:"DrawResize"},function(){m(this,x=>{x.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){m(this,(x,B)=>{x.setBounds({x:B.x})},_t)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){m(this,(x,B)=>{x.setBounds({x:(B.width-x.getBounds().width)/2+B.x})},_t)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){m(this,(x,B)=>{x.setBounds({x:B.width-x.getBounds().width+B.x})},_t)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){m(this,(x,B)=>{x.setBounds({y:B.y})},_t)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){m(this,(x,B)=>{x.setBounds({y:(B.height-x.getBounds().height)/2+B.y})},_t)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){m(this,(x,B)=>{x.setBounds({y:B.height-x.getBounds().height+B.y})},_t)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){m(this,(x,B)=>{x.setBounds(B.get(x))},x=>Ho(x))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){m(this,(x,B)=>{x.setBounds(B.get(x))},x=>Ho(x,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,M]);o.useEffect(()=>{},[s]);const H=o.useMemo(()=>{let x=null;return x=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),x.addCommands(_,!0),x},[a,_]);return et(M,{onAnyChange:()=>{H.getCommand("formatAnchorTypeTwoCell").update({state:M?.getAnchorType()===d.IAnchored.Type.TwoCell}),H.getCommand("formatAnchorTypeOneCell").update({state:M?.getAnchorType()===d.IAnchored.Type.OneCell}),H.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),H.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),H.getCommand("toggleLockAspectRatio").update({state:M?.isLockAspectRatio()})},onProtectedChange:x=>{z(x.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const x=n.getMovableSelection()[0]??null;T(x),z(!x||x.isProtected()),w()}}),et(t,{onCollectionChange:()=>{w()}}),o.useEffect(()=>{const x={disabled:P};H.getCommand("formatAnchorTypeTwoCell").update(x),H.getCommand("formatAnchorTypeOneCell").update(x),H.getCommand("formatAnchorTypeAbsolute").update(x),H.getCommand("toggleLockAspectRatio").update(x);const B=t.getCount(),p=n.getMovableSelection(),A=P||B<=1||p.length===0;let S={disabled:A},U=S;if(!A&&p.length===1){const K=p[0];K.getZIndex()===0&&(S={disabled:!0}),K.getZIndex()===B-1&&(U={disabled:!0})}H.getCommand("moveToFront").update(U),H.getCommand("moveForward").update(U),H.getCommand("moveToBack").update(S),H.getCommand("moveBackward").update(S);const D={disabled:P||p.length<=1};H.getCommand("formatDrawAlignLeft").update(D),H.getCommand("formatDrawAlignCenter").update(D),H.getCommand("formatDrawAlignRight").update(D),H.getCommand("formatDrawAlignTop").update(D),H.getCommand("formatDrawAlignMiddle").update(D),H.getCommand("formatDrawAlignBottom").update(D),H.getCommand("formatDrawFlipHorz").update(D),H.getCommand("formatDrawFlipVert").update(D),H.getCommand("formatDrawGroup").update(D),H.getCommand("formatDrawUngroup").update(D),H.getCommand("formatDrawSwapShapes").update(D),H.getCommand("formatDrawSwapShapesHorz").update(D),H.getCommand("formatDrawSwapShapesVert").update(D);const j={disabled:P||p.length<=2};H.getCommand("formatDrawDistributeHorz").update(j),H.getCommand("formatDrawDistributeVert").update(j)},[b,P,b]),H},Ql=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:h,onShow:s,...y}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[w,{height:m,width:M}]=Xt();return c.jsx("div",{...y,ref:Ut([b,w]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:f,target:h,onRepeatCommandChange:s}=e,y=Sr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:s,commands:f,target:h});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const b=o.useMemo(()=>c.jsx(qr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{y.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,y]);return b&&n?b:null})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:h,commands:s}=e,y=r.useEditMode(),[b,w]=o.useState(null),[m,M]=o.useState(null),[T,P]=o.useState(null),[z,_]=o.useState(null),[H,x]=o.useState(null);o.useLayoutEffect(()=>{if(T===null)return _(null),void x(null);const k=()=>{const O=i.getRange(T).getCell(),ee=O.getStyle();let oe,be=ee.getFill()?.toCSS(a.body.darkMode);be.background!=="none"&&be.background!=="transparent"||(be=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),be.background!=="none"&&be.background!=="transparent"||(be={background:a.body.fill}),_({style:be}),O&&!O.getFormula()&&(oe=O?.getRenderHorizontalAlignment()),x(oe??r.HorizontalAlignment.Left)};return k(),i.getRange(T).addListener(()=>{k()})},[i,T,a?.body]);const B=r.useCallbackRef(()=>{let k=m.editState.dirty??"";if(m.editState.dirty!==void 0){const O=d.TextUtils.clampString(k);try{const ee=m.sheet.getRange(m.coords),oe=`Typing '${O}' into ${ee.toString()}`;return ee.setValue(k,{description:oe,autoFit:!0}),P(null),M(null),y.setMode(null),h(null),!0}catch(ee){throw ge.Notifier.error(new Error(`Unable to enter '${O}'.`,{cause:ee})),ee}}},[i,m]),p=r.useCallbackRef(k=>i.getRange(k).getCell().getExtrusions()??ge.CoordUtils.cellToRange(k),[i]),A=r.useCallbackRef(k=>{let O=d.IRange.Orientation.Row,ee=!1;k!==d.IRange.Direction.Up&&k!==d.IRange.Direction.Down||(O=d.IRange.Orientation.Column),k!==d.IRange.Direction.Left&&k!==d.IRange.Direction.Up||(ee=!0),i.getSelection().traverse(O,ee)},[i]),S=o.useCallback((k,O)=>{if(l)return l(k,O);if(!i)return null;const{ref:ee,...oe}=k;return c.jsx(hr,{ref:ee,...oe,sheet:i,bodyStyle:a?.body,activeCoords:O,commands:s,onChangeEdit:be=>{const he={sheet:i,coords:O,editState:be};y.setMode(Ee=>({...Ee,description:he.editState.editMode?"Edit":"Enter",args:{...Ee?.args,stateAndCoords:he}}))},editState:m.editState})},[i,z,l,m,T]),{overlay:U,startEdit:D,submitEdit:j,cancelEdit:K,onKeyboardEventNative:pe,onPointerEventNative:Z}=ht.useKeyboardEditorOverlay({view:n,activeCoords:b,getCellEditor:S,canEdit:()=>{const k=i.getProtection();if(k.isReadOnly())return!1;const O=k.isLocked();return O&&f(),!O},onBeforeStartEdit:k=>{const O=mr(()=>i.getRange(k).getCell()),ee={sheet:i,coords:k,editState:Object.freeze(O)};y.setMode({key:"edit",args:{stateAndCoords:ee}}),M(ee)},onStartEdit:k=>{P(k),h(k)},onSubmitEdit:B,onCancelEdit:k=>{P(null),M(null),y.setMode(null),h(null)},onDoneEdit:k=>{y.setMode(null)},onNavigate:A,containerProps:z,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:H,getRangeCoords:p});et(i.getSelection(),{onChange(k){w(i.getSelection().getCoords().cell)}});const V=r.useCallbackRef(k=>{Z(k),T&&j()},[Z,K,T]),N=o.useCallback(k=>{Z(k)},[Z]),F=o.useCallback(k=>{pe(k)},[pe]);return o.useEffect(()=>{const k=n?.getStage();if(k)return k.addEventListener("pointerdown",V),k.addEventListener("dblclick",N),k.addEventListener("keydown",F),()=>{k.removeEventListener("pointerdown",V),k.removeEventListener("dblclick",N),k.removeEventListener("keydown",F)}},[n?.getStage()]),o.useEffect(()=>{const k=y.getMode(),O=k?.key;O==="edit"||O==="enter"?m?k.args?.cancel?K():k.args?.submit?j():M(k.args?.stateAndCoords):D(k.args?.start):T&&K()},[y]),U(n,t)})),Rr="white",kr="black",ni=`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='${kr}' fill='${Rr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,oi=`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='${kr}' fill='${Rr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ri=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,h]=o.useState(null),[s,y]=o.useState(null),[b,w]=o.useState(null),[m,M]=o.useState(null),T=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const p=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(p.length>0?p:null)}else l(!1),h(null)},[i,n]),P=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const A=n.getCellCoordsFromClient(p.clientX,p.clientY),S=i.getTables().getItems({address:A});S.length===1&&S[0].select()},[n,i]),z=r.useCallbackRef(p=>{p.preventDefault(),p.stopPropagation();const A=n.getCellCoordsFromClient(p.clientX,p.clientY),S=i.getTables().getItems({address:A});if(S.length===1){const U=S[0].getRange().getCoords(),D={colStart:U.colStart,rowStart:A.rowIndex,colEnd:U.colEnd,rowEnd:A.rowIndex};i.getRange(D).select()}},[n,i]),_=r.useCallbackRef(()=>{if(!a)return;const p=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(p.length>0?p:null)},[i,a,n]);et(i?.getSelection(),{onChange(p){y(i.getSelection().getCoords().cell)}}),et(b,{onAnyChange(p){T(),_()}}),et(m,{onAnyChange(p){_()}}),et(i,{onTablesChange(p){T(),_()},onInvalidated(p){T(),_()}});const H=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(_,300),300),[]);o.useEffect(()=>{H()},[n]),o.useEffect(()=>{let p=null;if(f)for(let A=0;A<f.length&&!p;A++){const S=f[A],U=S.getRange().getCoords();d.CoordUtils.isCellWithinRange(s,U)&&(p=S)}w(p)},[s,f]);const x=r.useCallbackRef(p=>{let A=null;if(f)for(let S=0;S<f.length;S++){const U=f[S],D=U.getRange().getCoords();let j=n.getRangeCoordsBounds(D);const K=n.getRelativePointFromClient(p.clientX,p.clientY),pe=K.x,Z=K.y;if(pe>=j.x&&pe<=j.x+j.width&&Z>=j.y&&Z<=j.y+j.height){const V=n.getViewportSize();pe<=0||Z<=0||pe>=V.width||Z>=V.height||(A=U)}}M(A)},[n,f]);if(o.useEffect(()=>{const p=n?.getStage();if(p&&f)return p.addEventListener("mousemove",x),p.addEventListener("mouseleave",x),()=>{p.removeEventListener("mousemove",x),p.removeEventListener("mouseleave",x)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const B=[];for(let p=0;p<f.length;p++){const A=f[p];if(A.isClosed())continue;const S=A===m,U=A===b,D=A.getRange().getCoords(),j=n.getRangeCoordsBounds(D);let K;if(S||U){const pe=A.getStyle().getProperties(),Z=pe.headerRow?.fill?.background??pe.wholeTable?.border?.top?.color?.toString();if(Z&&i){const V=i.getStyles().parseColor(Z);V&&(K=V.toCSS())}K||(K="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}B.push(c.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:j.height,pointerEvents:"all",cursor:ni},onMouseDown:z},`table-select-row-${A.getName()}`)),B.push(c.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:Math.min(16,j.height),pointerEvents:"all",cursor:oi},onMouseDown:P},`table-select-${A.getName()}`)),B.push(c.jsx(ht.Selection,{x:j.x,y:j.y,width:j.width,height:j.height,range:D,strokeWidth:U?.5:0,stroke:K??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:S?`${K} 0px 0px 1px 1px`:void 0}},`table-outline-${A.getName()}`))}return B})),li=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[h,s]=o.useState(null),y=o.useRef(null),b=r.useCallbackRef(()=>{const z=i.getSelectedCell(),_=z.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(_,l)||(s(_?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(_),coords:_}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(_))},[i,n,l]);o.useEffect(()=>(y.current&&(clearTimeout(y.current),y.current=null),h&&(y.current=setTimeout(()=>{s(null),y.current=null},a)),()=>{y.current&&(clearTimeout(y.current),y.current=null)}),[h,a]);const w=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(b,80),80),[]);if(et(i?.getSelection(),{onChange(z){w()}}),et(i,{onSpillsChange(z){b()},onInvalidated(z){b()}}),!n||!l&&!h)return null;const m=i.getRange(l).getValue()instanceof d.FormulaError.Spill,M=[];let T=h?.bounds??n.getRangeCoordsBounds(l);if(h&&!ge.CommonUtils.isEqualBounds(h.bounds,n.getRangeCoordsBounds(h.coords))&&s(null),T=n.toClipBounds(T,-10),!T)return;const P="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return M.push(c.jsx(ht.Selection,{x:T.x,y:T.y,width:T.width,height:T.height,range:l,strokeWidth:1,stroke:P,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:m?"6 3":void 0,opacity:h?.transition==="out"?0:1,transition:h?.transition?h.transition==="in"||h.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${P} 0px 0px 4px 0px`}},"spill-outline}")),M})),ii={position:"absolute",top:0,left:0,bottom:0,right:0},Vo=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=ge.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ai={fireOnModelChange:!1},Uo={},Mr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Uo,headersStyle:a=Uo,onSheetContextMenu:l,showColumnHeaders:f,columnHeaderProps:h,showRowHeaders:s,rowHeaderProps:y,showScrollbars:b=!0,scrollPaneProps:w,onViewportChange:m,commands:M,onRepeatCommandChange:T,onMoveCell:P,overlays:z,renderMovable:_,viewportComponent:H,onElementLoad:x,getCellEditor:B,onFocus:p,onBlur:A,style:S=r.ReactUtils.EmptyCssProperties,onShowTooltip:U,onShowColumnTooltip:D,onShowRowTooltip:j,onCloseTooltip:K,gridProps:pe,cellRenderProps:Z,...V}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[N,F]=o.useReducer(J=>J+1,0),[k,{width:O,height:ee}]=Xt(),oe=r.useCallbackRef(U,[U]),be=r.useCallbackRef(D,[D]),he=r.useCallbackRef(j,[j]),Ee=r.useCallbackRef(K,[K]),Ae=o.useRef(!1);o.useLayoutEffect(()=>{Ae.current=!0},[n]);const We=n?.getStyles(),ve=o.useMemo(()=>Vo(i,We),[i,We]),He=o.useMemo(()=>Vo(a,We),[a,We]),{body:Y={},buttonSurface:X={}}=ve,{header:de={},headerSelect:Me={},headerSelectAll:G={}}=He,W=o.useRef(null),[re,me]=o.useState(()=>n?.getView()),se=(re?.getZoomScale()??100)/100,Se=o.useMemo(()=>({vertical:re.isShowColumnGridlines()&&se>=.4,horizontal:re.isShowRowGridlines()&&se>=.4}),[re?.isShowColumnGridlines(),re?.isShowRowGridlines(),se]),ie=o.useMemo(()=>{if(re?.getGridLineColor())return{strokeDasharray:"1,1"}},[re?.getGridLineColor(),ve]),we=f??re?.isShowColumnHeaders(),ke=s??re?.isShowRowHeaders(),[Re,Le]=o.useState({width:0,height:0}),Ne=o.useMemo(()=>{let J=40,qe=20;const Ke=n?.getStyles().getNormal().getFont();if(Re.width>0&&Re.height>0){const Ve=Ke?.toCSS()?.fontFamily??ve.header.text.fontFamily,Ze=Ke?.getSize()??ve.header.text.fontSize,Ge=d.IFont.getSharedMeasurer()(""+Re.height,Math.ceil(Ze*d.IFont.getDeviceScale()),Ve);J=Ge.width,qe=Ge.lineHeight}return{width:Math.round(J+5),height:Math.round(qe+3)}},[Re,ve?.header.text,n]),v=ke?se*Ne.width:de.edgeStrokeWidth,Oe=we?se*Ne.height:de.edgeStrokeWidth,tt=Math.max(O,(n?.getColumnHeaders().getDefaultSize()??Ne.width)+v+1),te=Math.max(ee,(n?.getRowHeaders().getDefaultSize()??Ne.height)+Oe+1),Te=o.useRef(new Map),Pe=o.useRef(null),ze=()=>({getColOffset:J=>n.getColumnHeaders().findOffset(J),getColIndex:J=>n.getColumnHeaders().findIndex(J),getRowOffset:J=>n.getRowHeaders().findOffset(J),getRowIndex:J=>n.getRowHeaders().findIndex(J)}),[De,I]=o.useState(()=>ze()),[Q,L]=o.useState(!1),[$,xe]=o.useState(null),Ce=!0,g=ve.selection?.strokeFill,C=o.useCallback(()=>At.current,[]),[R,u]=o.useState(),q=r.useCallbackRef(J=>{u(J);const qe=n?n.getView():null;qe&&qe.setTopLeft(J?{left:J.left,top:J.top}:null),m?.(J)},[n,m]),E=o.useRef(null);o.useEffect(()=>{if(!R||!n)return;const J=n.getRangeAtBounds({x:R.left,y:R.top,width:R.width,height:R.height});E.current?.(),E.current=J.addListener(()=>{const qe=J.getCoords();W?.current?.invalidate(qe)})},[R,n]);const[le,fe]=o.useState(()=>n?.getView().getTopLeft()),ce=r.useCallbackRef(J=>{const qe=ge.CoordUtils.cellToRange(J);if(n.isClosed())return qe;const Ke=n.getRange(qe,{ignoreHidden:!0}).getMerges();return Ke.length===0?qe:Ke[0]},[n]),ne=J=>{if(!J||J.coords.colIndex===0&&J.coords.rowIndex===0)return null;const qe={};return J.coords.colIndex>0&&(qe[ge.AnchorLocation.Left]={index:J.coords.colIndex,scrollOffset:J.topLeft.left}),J.coords.rowIndex>0&&(qe[ge.AnchorLocation.Top]={index:J.coords.rowIndex,scrollOffset:J.topLeft.top}),qe},[ae,ue]=o.useState(()=>ne(n.getView().getFreezePanes())),ye=r.useEditMode(),Be=o.useCallback(()=>W.current,[]),Ie=r.useCallbackRef(J=>{ye.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:J}})},[]),Fe=r.useCallbackRef(()=>R,[R]),Ue=br({sheet:n,commands:M,target:Be,onRepeatCommandChange:T,bodyStyle:Y,onStartEdit:Ie,getViewport:Fe}),[_e,$e]=o.useState(n.getSelection().isEntire()),[Ye,Je]=o.useState(re?.getMovableSelection().length>0),je=$!==null||Ye,Xe=null,[vt,nt]=o.useState(!1);o.useEffect(()=>{nt(!1)},[n.getProtection()]);const at=r.useNotifier(),Tt=r.useCallbackRef(()=>{vt||(nt(!0),at.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[at,vt]),kt=o.useMemo(()=>{const J=ye.getMode();return J?.cursor?J.cursor:null},[Xe,ye]),[yt,wt]=o.useState(null),ct=o.useRef(!1),[rt,Rt]=o.useState([]),ft=o.useRef(null),[Ct,zt]=o.useState(ge.TypesUtils.EmptyTopLeft),[qt,Kt]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{zt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{Kt({left:0,top:le?.top})},[le?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{ue(ne(n.getView().getFreezePanes()))},onTopLeftChange:()=>{fe(n.getView().getTopLeft())},onMovableSelectionChange:()=>{Je(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{$e(n.getSelection().isEntire())}}),et(n,{onViewChange(){me(n.getView()),I(ze())},onLayoutChange:()=>{const J=n.getEntireRange();Le({height:J.getRowCount(),width:J.getColumnCount()}),I(ze())},onStyleChange:()=>{jt()},onMovablesChange:()=>{},onInvalidated:()=>{jt()}}),et(n,{onRequestScrollIntoView:async(J,qe)=>{if(!qe)return;const Ke={colIndex:qe?.coords?.colStart,rowIndex:qe?.coords?.rowStart};return await W.current?.scrollCellCoordsIntoView(Ke,qe?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(At.current)},ai);const ut=o.useRef(!1),Nt=o.useMemo(()=>{const J=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ct.current&&be?.(Ve)})},32),qe=(Ve,Ze)=>{ct.current=!0,wt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:0,rowEnd:Re.height,colStart:Ve,colEnd:Ve})))return;const st=Ge.getLayout(),it=Math.max(0,st.getColOffset(Ve)),lt=Ge.getBounds(),St=Math.min(lt.x+lt.width,st.getColOffset(Ve+1)),Dt=Ge.getAnchor();if(Ze!==null&&(Dt===ge.AnchorLocation.Left||Dt===ge.AnchorLocation.Center||Dt===ge.AnchorLocation.Right)){const to=ge.CommonUtils.roundAccurately(Ze*ge.CommonUtils.getDPI(),0),Sn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ze/se),2).toFixed(2),no="Width: "+(Ze?Sn+" ("+to+" pixels)":"Hidden"),on=Gn.current.getGridElement().getRelativePointFromClient(0,0),Gt=0-on.y,Rn=0-on.y+Oe,oo=on.x-lt.x;J({anchor:{x:it-oo,y:Gt,width:St-it,height:Rn-Gt},display:no})}const Bt=[0,0,0,lt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:g}},Jn={x:it-1,y:0,width:1,height:lt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:g}},eo={x:St-1,y:0,width:1,height:lt.height};return c.jsxs(o.Fragment,{children:[c.jsx(ht.SVGLine,{linePoints:Bt,bounds:Jn,...Yn}),c.jsx(ht.SVGLine,{linePoints:Bt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ze,Ge)=>{Ke=n.beginCommit(Ge),ut.current=!1,qe(Ve,Ze)},onResizeHeaders:(Ve,Ze,Ge)=>{ut.current=!1,qe(Ve,Ze)},onResizeHeadersDown:(Ve,Ze)=>{ut.current=!0,setTimeout(()=>{ut.current&&qe(Ve,Ze)},360)},onResizeHeadersEnd:(Ve,Ze,Ge)=>{Ke?.commit({description:Ge}),Ke=null,ut.current=!1,requestAnimationFrame(()=>Ee?.()),ct.current=!1,wt(null)},onResizeHeadersUp:Ve=>{ut.current=!1,requestAnimationFrame(()=>Ee?.()),ct.current=!1,wt(null)},...h}},[n,h,Oe,yt]),tn=o.useMemo(()=>{const J=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ct.current&&he?.(Ve)})},32),qe=(Ve,Ze)=>{ct.current=!0,wt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:Re.width})))return;const st=Ge.getLayout(),it=Math.max(0,st.getRowOffset(Ve)),lt=Ge.getBounds(),St=Math.min(lt.y+lt.height,st.getRowOffset(Ve+1)),Dt=Ge.getAnchor();if(Ze!==null&&(Dt===ge.AnchorLocation.Top||Dt===ge.AnchorLocation.Center||Dt===ge.AnchorLocation.Bottom)){const to=Math.floor(10*ge.CommonUtils.getDPI())/10,Sn=ge.CommonUtils.roundAccurately(Ze*to,0),no=ge.CommonUtils.roundAccurately(Sn/se/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),on="Height: "+(Ze?no+" ("+Sn+" pixels)":"Hidden"),Gt=$t.current.getGridElement().getRelativePointFromClient(0,0),Rn=0-Gt.x,oo=0-Gt.x+v,ml=Gt.y-lt.y;J({anchor:{x:Rn,y:it-ml,width:oo-Rn,height:St-it},display:on})}const Bt=[0,0,lt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:g}},Jn={x:0,y:it-1,width:lt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:g}},eo={x:0,y:St-1,width:lt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(ht.SVGLine,{linePoints:Bt,bounds:Jn,...Yn}),c.jsx(ht.SVGLine,{linePoints:Bt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ze,Ge)=>{Ke=n.beginCommit(Ge),ut.current=!1,qe(Ve,Ze)},onResizeHeaders:(Ve,Ze,Ge)=>{ut.current=!1,qe(Ve,Ze)},onResizeHeadersDown:(Ve,Ze)=>{ut.current=!0,setTimeout(()=>{ut.current&&qe(Ve,Ze)},360)},onResizeHeadersEnd:(Ve,Ze,Ge)=>{Ke?.commit({description:Ge}),Ke=null,ut.current=!1,requestAnimationFrame(()=>Ee?.()),ct.current=!1,wt(null)},onResizeHeadersUp:Ve=>{ut.current=!1,requestAnimationFrame(()=>Ee?.()),ct.current=!1,wt(null)},...y}},[n,y,v]),At=r.useImperativeElement(t,()=>{const J=Ke=>{n?.getView()&&n.getView().selectMovables([]),Pe.current=null,W?.current?.focus(Ke)},qe=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ze=W.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ze)return!1;const Ge=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let st=Te.current?.get(Ge);return st?.current?(await st.current.focusMovable(Ke),!0):(Pe.current={movable:Ke,anchor:Ge},!0)};return{getGridElement:()=>W.current,getRowHeaderElement:()=>$t.current,getColumnHeaderElement:()=>Gn.current,rowHeaderHeight:()=>Oe,colHeaderWidth:()=>v,startEdit:Ie,submitEdit:()=>{ye.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{ye.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:$!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&qe()||J(Ke)},focusSheet:J,focusMovable:qe,contains:Ke=>W?.current?.contains?.(Ke),invalidate:jt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),jt=o.useCallback(J=>{Ae.current||(W?.current?.invalidate(J),F?.())},[]);o.useEffect(()=>{jt()},[ve]);const vn=_e?G.edgeStrokeFill:de.fill,ot=_e?Me.fill:typeof ve.headerHover=="function"?ve.headerHover(de)?.fill:de.fill,Cn=o.useMemo(()=>H?c.jsx("div",{className:dt("sheetxl-viewport-overlay",kl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:H}):c.jsx(c.Fragment,{}),[H]);let Wt=null;we&&ke&&(Wt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Oe}px`,width:`${v}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:J=>{let qe=!J.ctrlKey;Ue?.getCommand("selectAll")?.execute(!qe||J.button!==0),J.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:J,clientX:J.clientX,clientY:J.clientY,rowIndex:-1,colIndex:-1}):W.current?.focus()},children:[c.jsx("div",{style:{height:Oe-5+"px",width:Oe-5+"px",clipPath:`path('M${Oe-5} 0 L0 ${Oe-5} L${Oe-5} ${Oe-5} L${Oe-5} 0 Z')`,borderRight:`2px solid ${vn}`,borderBottom:`2px solid ${vn}`,background:`${ot}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${Oe}px`,width:`${v}px`,boxSizing:"border-box",borderRight:`solid 1px ${de.strokeFill}`,borderBottom:`solid 1px ${de.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const nn=r.useCallbackRef(({_left:J,_top:qe})=>{},[]),gt=r.useCallbackRef(J=>{if(!l)return;const qe=W.current.getViewFromClient(J.clientX,J.clientY)?.getCellCoordsFromClient(J.clientX,J.clientY);qe&&(l({originalEvent:J,clientX:J.clientX,clientY:J.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),J.stopPropagation(),J.preventDefault())},[l]),bt=r.useCallbackRef(J=>{if(!(!J.shiftKey&&(J.ctrlKey||J.metaKey)))return;const{deltaY:qe}=J;return qe>0?Ue.getCommand("sheetZoomOut")?.execute():qe<0&&Ue.getCommand("sheetZoomIn")?.execute(),qe===0},[Ue]);o.useEffect(()=>{Rt(null),ft.current=null,ct.current=!1,wt(null);const J=n?.getView().getTopLeft();nn(J),W.current?.scrollTo(J),fe(J),me(n.getView()),ue(ne(n.getView().getFreezePanes())),I(ze()),F()},[n?.getView()]);const yn=o.useCallback((J,qe)=>n.getRowHeaders().hiddenHeadersAt(J,qe),[n]),wn=o.useCallback((J,qe)=>n.getColumnHeaders().hiddenHeadersAt(J,qe),[n]),Ot=r.useCallbackRef(J=>{const qe=J.getVisibleRangeCoords();if(!qe)return null;const Ke=[];return n.getRange(qe).forEach((Ve,Ze)=>{const Ge=Ze.getCoords(),st=Ze.getCell();(it=>{if(it.isEmpty())return!1;const lt=it.getSpans();if(lt.width>1||lt.height>1||it.getStyle().hasVisibleStyling()||re.isShowFormulas()&&it.getFormula()!==null)return!0;const St=it.getValue();return St!==null&&!(!re.isShowZeros()&&St===0&&it.getType()===d.ScalarType.Number)})(st)&&Ke.push({coords:Ge,value:st,range:re.isShowFormulas()?null:st.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,re.isShowZeros(),re.isShowFormulas(),$]);o.useEffect(()=>{const J=[];z&&J.push(...z),yt&&J.push(...yt),ge.CommonUtils.isEqualArrays(J,ft.current)||(ft.current=J,Rt(J))},[z,yt,ve]);const bn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[ve?.header?.edgeStrokeFill]),$n=r.useCallbackRef(J=>{J.isDefaultPrevented()||J.isPropagationStopped()||(Pe.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),xn=o.useMemo(()=>{const J=ye.getMode();return J?.key==="cut"||J?.key==="copy"},[ye]),qn=r.useCallbackRef(async J=>{const qe=ye.getMode();return J.keyCode===r.KeyCodes.Escape&&qe?(J.preventDefault(),void ye.setMode(null)):J.keyCode===r.KeyCodes.Enter&&xn?(J.preventDefault(),await Ue?.getCommand("paste")?.execute(),void ye.setMode(null)):void Ue?.dispatchToFocusedCommand(J)},[Ue,ye]),$t=o.useRef(null),il=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Oe+1}px`,width:`${v+de.edgeStrokeWidth}px`,minWidth:`${v+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${Oe}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Oo,{ref:$t,sheetElement:At.current,gridRef:W,freezeStart:ae?.[ge.AnchorLocation.Top],oppositeSize:v,containerWidth:v,containerHeight:te,sheetHeader:n.getRowHeaders(),gridStyle:He,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:qt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Oe+1}px`,width:`${v+de.edgeStrokeWidth}px`,minWidth:`${v+de.edgeStrokeWidth}px`,borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,height:`calc(100% - ${Oe}px)`,boxSizing:"border-box",zIndex:"2",...tn?.style},...tn})}),[v,Oe,te,n,qt,ae?.[ge.AnchorLocation.Top],ve,Ce,l,de.fill,y]),Gn=o.useRef(null),al=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Oe+de.edgeStrokeWidth}px`,minHeight:`${Oe+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Oo,{ref:Gn,sheetElement:At.current,gridRef:W,freezeStart:ae?.[ge.AnchorLocation.Left],oppositeSize:Oe,containerWidth:tt,containerHeight:Oe,sheetHeader:n.getColumnHeaders(),gridStyle:He,scrollPoint:Ct,onSheetContextMenu:l,...Nt,style:{...Nt?.style,position:"relative",left:"0px",width:"100%",height:`${Oe+de.edgeStrokeWidth}px`,minHeight:`${Oe+de.edgeStrokeWidth}px`,borderBottom:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Oe,tt,n,Ct,ae?.[ge.AnchorLocation.Left],ve,de.fill,Ce,l,h]),sl=r.useCallbackRef(J=>{const{value:qe,key:Ke,...Ve}=J;let Ze=qe,Ge=$;if(!Ge||Ge.colIndex===J.coords.colIndex&&Ge.rowIndex===J.coords.rowIndex||(Ge=null),!Ze){const lt=J.range;if(Ze=n.getRange({rowIndex:lt.rowStart,colIndex:lt.colStart}).getCell(),Ze.isEmpty())return null}let st=null;Ze.getHyperlink()&&(st=async lt=>{if(Z?.onLinkMouseDown?.(lt),lt.button===0&&!lt.isDefaultPrevented()){lt.stopPropagation(),lt.preventDefault();try{await Ze.getHyperlink()?.open()}catch(St){at.showError?.(St)}}}),Ge&&Ge.colIndex===J.range.colStart&&Ge.rowIndex===J.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const it=n.getStyles();return o.createElement(gr,{...Ve,key:Ke,bodyStyle:Y,docTheme:it.getTheme(),normalStyle:it.getNormal(),showFormulas:re.isShowFormulas(),showZeros:re.isShowZeros(),onLinkMouseDown:st,...Z,value:Ze})},[n,De,Y,$,re?.isShowFormulas(),re.isShowZeros()]),cl=o.useCallback((J,qe)=>{const{key:Ke,...Ve}=J;return[c.jsx(zl,{ref:qe,getVisibleCells:Ot,sheet:n,gridStyle:ve,...Ve},`border-${Ke}`),c.jsx(ri,{ref:qe,sheet:n,commands:Ue,...Ve},`table-${Ke}`),c.jsx(li,{ref:qe,sheet:n,...Ve},`spill-${Ke}`),c.jsx(Zl,{ref:qe,sheet:n,commands:Ue,onShowTooltip:oe,onCloseTooltip:Ee,gridStyle:ve,gridRef:W,isActive:Ce,...Ve},`selection-${Ke}`),c.jsx(Vl,{ref:qe,sheet:n,commands:Ue,gridStyle:ve,element:C,...Ve},`copy-paste-${Ke}`),c.jsx(ei,{ref:qe,sheet:n,commands:Ue,target:Be,renderMovable:_,movableProps:{onUnFocus:()=>{At.current.focus()}},...Ve},`movable-${Ke}`),c.jsx(ti,{ref:qe,sheet:n,commands:Ue,gridStyle:ve,getCellEditor:B,showProtectedError:Tt,setEditingCoords:xe,...Ve},`editor-${Ke}`)]},[n,W.current,ve,B,Ue,at]),[Eo,dl]=o.useState(!1),ul=o.useMemo(()=>{if(tt===0||te===0)return null;const J=n.getStyles().getNormal(),qe=J.getFont(),Ke=J.getFill(),Ve=J.getBorder(),Ze=J.getFill().getType()===d.IFill.Type.None;let Ge=ie,st=ie;const it=(St,Dt,Bt)=>Bt?{stroke:Ve.getBottom().isNone()?"none":St.getColor().toRGBA(Y.darkMode).toString(),...Dt}:Dt;st=it(Ve.getBottom(),st,!Ve.getBottom().isNone()),st=it(Ve.getTop(),st,!Ve.getTop().isNone()),Ge=it(Ve.getRight(),Ge,!Ve.getRight().isNone()),Ge=it(Ve.getLeft(),Ge,!Ve.getLeft().isNone());let lt=re?.getGridLineColor()?.toRGBA(Y.darkMode).toString()??Y.strokeFill;return Ze||(st=it(Ve.getBottom(),st,!0),st=it(Ve.getTop(),st,!0),Ge=it(Ve.getRight(),Ge,!0),Ge=it(Ve.getLeft(),Ge,!0)),c.jsx(ht.Grid,{className:"sheetxl-sheet-primary",style:{...ii,...Ke.toCSS(Y.darkMode),...qe.toCSS(Y.darkMode,se),"--sxl-app-color-background":Y.fill,"--sxl-app-color-shadow":ve.colorShadow,"--sxl-app-color-grey":ve.colorGrey,"--sxl-app-color-button-fill":X.fill,"--sxl-app-color-button-text":X.text?.fill,"--sxl-app-color-button-border":X.edgeStrokeFill,"--sxl-app-color-primary-dark":ve.selection.strokeFill},ref:W,zoom:se,...pe,onFirstRender:St=>{dl(!0),pe?.onFirstRender?.(St),Ue?.activate()},showGridLines:Se,gridLineColor:lt,gridLineColumnsProps:Ge,gridLineRowsProps:st,freezeLeft:ae?.[ge.AnchorLocation.Left],freezeLeftProps:bn,freezeTop:ae?.[ge.AnchorLocation.Top],freezeTopProps:bn,width:tt,height:te,columnCount:Re.width,rowCount:Re.height,cursor:kt??Xe??"cell",clipCells:!0,layout:De,cellRenderer:sl,overlayRenderer:cl,getCellCoordsAsRangeCoords:ce,hiddenRowsAt:yn,hiddenColumnsAt:wn,getVisibleCells:Ot,onWheelScroll:bt,onPointerDown:$n,onKeyDown:qn,onViewportChange:q,onImmediateScroll:nn,scrollPoint:le,stageProps:{onFocus:()=>{Ue?.activate()}},overlays:rt})},[N]);o.useEffect(()=>{Ae.current||F()},[De,ae,se,Ue,le?.left,le?.top,Y,pe,tt,te,kt,rt,Ce,Xe]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};b||(_n={..._n,...S});const gl=o.useMemo(()=>{const J=n.getStyles().getTheme(),qe=J.getColorScheme(),Ke=J.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(Y.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(Y.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(Y.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(Y.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(Y.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(Y.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(Y.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(Y.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(Y.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(Y.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(Y.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(Y.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),Fo=r.useCallbackRef(J=>{const{style:qe,...Ke}=J;return c.jsx(bo,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...qe},sheet:n})},[n]);let Zn=c.jsx("div",{style:_n,onTouchStart:()=>{Ao()},onFocus:J=>{L(!0),p?.(J)},onBlur:J=>{L(!1),A?.(J)},ref:At,...V,children:c.jsx("div",{className:dt("sheetxl-sheet",Rl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...gl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Wt,il,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[al,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${de.edgeStrokeWidth}px ${de.edgeStrokeFill}`,backgroundColor:Y.fill},ref:k,onContextMenu:gt,children:[ul,Cn,c.jsx(Ml,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ve?.selection?.strokeFill,colorCredits:ve?.body?.text?.fill})]})]})]})})});b&&(Zn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${de.fill}`,minHeight:2*Ne.height,minWidth:2*Ne.width,...S},viewport:R,touchElement:W.current?.stage,disableTouch:je,onScrollViewport:J=>{W.current?.scrollTo(J)},createHorizontalScrollbar:Fo,createVerticalScrollbar:Fo,...w,children:Zn})),o.useEffect(()=>{Ae.current=!1,F?.(),Q&&At.current?.focus()},[n]);const[Xn,hl]=o.useState(!1),Ao=r.useCallbackRef(()=>{Xn||hl(!0)},[Xn]);return o.useEffect(()=>{if(Eo)return typeof x=="function"&&x(),r.ReactUtils.detectIt().primaryInput==="touch"&&Ao(),()=>{}},[x,Eo,Xn]),Zn}));Mr.displayName="SheetElement";const Ko="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=",Tr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:h,view:s,onHide:y,onShow:b,onKeyDownCapture:w,onFocus:m,onBlur:M,loadingPanel:T,...P}=e,[z,_]=o.useState(!1),[H,x]=o.useState(null),[B,p]=o.useState(null),[A,S]=o.useState(null);o.useEffect(()=>{p(null),l.getDetails().then(j=>{_(!1),p(j.asUrl()),j.asSVGText?.()&&S(j.asSVGText())}).catch(j=>{console.warn(j),_(!0),p(Ko),S(null)})},[l]);const U=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),D=o.useMemo(()=>{if(B||A)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:z?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:z?"var(--sxl-app-color-background, white)":void 0,boxShadow:z?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:z?"contain":void 0,opacity:H?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:B,onLoad:()=>{x(!0)},onError:({currentTarget:j})=>{console.log("error"),j.onerror=null,p(Ko),_(!0)},alt:f??`${l.getType()}`})},[H,l,B,A,h]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:h?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...P,onKeyDownCapture:j=>{w?.(j)},ref:U,children:[H||z?void 0:T,D]})}));Tr.displayName="PictureEditor";const si=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:h,onShow:s,...y}=e;o.useEffect(()=>{},[a]);const b=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[w,{height:m,width:M}]=Xt();if(!a.isClosed())return c.jsx("div",{...y,ref:Ut([b,w]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ci="_editable-input_1bqx6_6",di=e=>c.jsx("input",{...e}),Ir=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:h,createInput:s=di,styleHover:y={},dragging:b,maxLength:w,disabled:m=!1,readOnly:M=!1,...T}=e,[P,z]=o.useState(!1),[_,H]=o.useState(!1),[x,B]=o.useState(a);o.useEffect(()=>{B(a)},[a]);const p=o.useRef(null),[A,S]=o.useState(null),U=r.useNotifier(),D=o.useCallback(function(F){const k=F.message;A!==k&&(U?.showMessage?.(k,{type:r.NotifierType.Error}),S(k))},[U,A]),j=o.useCallback(F=>{let k=!1;try{k=l?.(F)??!0}catch(O){D(O)}return k?(p.current=null,H(!1),B(F),k):(setTimeout(()=>{p.current?.focus()},0),k)},[l]),K=r.useCallbackRef(()=>{B(a),p.current=null,H(!1),h?.()},[h,a]),pe=o.useMemo(()=>{if(!_)return null;const F={className:dt(ci),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:w,type:"text",value:x,onFocus:k=>{p.current||(p.current=k.target,setTimeout(()=>{k.target?.select()},0))},onBlur:k=>{p.current&&j(x)},onChange:k=>{_&&B(k.target.value)},onMouseDown:k=>k.stopPropagation(),onKeyDown:k=>k.code==="Escape"?(k.preventDefault(),void K()):k.code==="Enter"?(k.preventDefault(),void j(k.target.value)):void(k.code!=="Tab"?k.stopPropagation():j(k.target.value))};return c.jsx(c.Fragment,{children:s(F)})},[_,x,j,K,s,m]),[Z,V]=o.useState();o.useLayoutEffect(()=>{let F=Object.assign({},n);(b||P)&&(F=Object.assign(F,y)),V(F)},[b,P,y,n]),o.useEffect(()=>{pe&&f?.(x)},[pe,f,x]);const N=r.useImperativeElement(t,()=>({startEdit(){m||M||H(!0)},cancel(){K()}}),[]);return c.jsxs("div",{...T,ref:N,style:{flexDirection:"column",display:"flex",...Z},className:dt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{m||M||H(!0)},onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:_?0:1},children:x}),pe]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...y},children:x})]})})),Hn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Qt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function xt(e){var t,n;return e?Qt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=xt(e);return e instanceof t}function mn(e){return!Qt(e)&&e instanceof xt(e).HTMLElement}function Er(e){return e instanceof xt(e).SVGElement}function Jt(e){return e?Qt(e)?e.document:xo(e)?qo(e)?e:mn(e)||Er(e)?e.ownerDocument:document:document:document}const Et=Hn?o.useLayoutEffect:o.useEffect;function Vn(e){const t=o.useRef(e);return Et(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Et(()=>{n.current!==e&&(n.current=e)},t),n}function an(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=Vn(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 lo={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Fr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>{const h=Object.entries(f);for(const[s,y]of h){const b=l[s];b!=null&&(l[s]=b+e*y)}return l},{...t})}}const Zt=Fr(1),gn=Fr(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=xt(e.target);return t&&e instanceof t}function Ln(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=xt(t.target);return n&&t instanceof n})(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return(function(t){return"clientX"in t&&"clientY"in t})(e)?{x:e.clientX,y:e.clientY}:null}const Vt=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[Vt.Translate.toString(e),Vt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Wo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ui(e){return e.matches(Wo)?e:e.querySelector(Wo)}const gi={display:"none"};function hi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:gi},n)}function mi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},n)}const Ar=o.createContext(null),fi={draggable:`
23
+ The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",v,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied.",icon:"PasteFormulas"}),new r.Command("pasteTranspose",v,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",v,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(I,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const v={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(I=>w.paste({...Ll,...I})).update(v),i.getCommand("pasteFormats").updateCallback((I,q)=>w.paste({...Pl,description:q.label(),...I})).update(v),i.getCommand("pasteFormulas").updateCallback((I,q)=>w.paste({...jl,description:q.label(),...I})).update(v),i.getCommand("pasteTranspose").updateCallback((I,q)=>w.paste({...Ol,description:q.label(),...I})).update(v),i.getCommand("pasteLinks").updateCallback((I,q)=>w.paste({...Bl,description:q.label(),...I})).update(v),i.getCommand("cut").update(v),i.getCommand("paste").update(v)},[t,i]);const L=o.useMemo(()=>{if(!z||!M.current)return;const v=z.key;if(v!=="copy"&&v!=="cut"&&v!=="formatPainter")return;const I=M.current.getItem();if(I.getSource()!==t)return;const q=M.current.isCut?.(),X=q?k:C,E=q?c:h,j=I.getCoords(),$=j?[j]:null;return $&&$.length!==0?ve=>{const Y=[];for(let _=0;_<$.length;_++){const A=$[_],J=ve.toClipBounds(ve.getRangeCoordsBounds(A,{top:0,left:0,right:1,bottom:1}),gt.SELECTION_CLIP_INSETS);J&&(Y.push(p({range:A,key:`copy-selection-background-${_}`,x:J.x,y:J.y,width:Math.max(J.width,0),height:Math.max(J.height,0),stroke:X,strokeWidth:2})),Y.push(p({range:A,key:`copy-selection-foreground-${_}`,x:J.x+(J.width<=2?-1:0),y:J.y,width:Math.max(J.width,3),height:Math.max(J.height,3),stroke:E,strokeWidth:2,isAnimatedStroke:!0})))}return Y}:null},[z,t,n,h,C,c,k]);return{...w,clipboard:K,overlays:L}},Hl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,h=l.body??{},c=a.getView(),{overlays:C}=xr({element:i,sheet:a,sheetView:c,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:h.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:h.fill});return Qe(a?.getSelection(),{onChange(k){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),C&&n?C(n):null})),Vl="_sheet-selection_12wyx_5",Ul={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Kl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},$l={key:"dragCopy",description:"Drag selection to copy cell contents."},Wl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Bo=(e,t)=>t.ctrlKey&&t.shiftKey?Wl:t.ctrlKey?$l:t.shiftKey?Kl:Ul,Gl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},_l=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:h,sheet:c,gridRef:C,gridStyle:k,isActive:y,...p}=e,M=n?.getBounds(),T=r.useCallbackRef(f,[f]),z=r.useCallbackRef(h,[h]),[D,Z]=o.useState(()=>c?.getSelection().getCoords()),K=r.useCallbackRef(H=>{he.CoordUtils.isEqualSelectionCoords(H,D)||c&&c.getSelection().updateCoords(H)},[c,D]),w=r.useEditMode(),L=o.useRef(null),[v,I]=o.useState(c?.getProtection().isLocked()),[q,X]=o.useState(c?.getView().getMovableSelection().length>0),E=r.ReactUtils.detectIt().primaryInput==="touch",j=!E&&y,$=w.getMode()?.args?.stateAndCoords?.coords??null,ve=$!==null||q,Y=r.useCallbackRef(H=>{const W=he.CoordUtils.cellToRange(H);if(c.isClosed())return W;const me=c.getRange(W,{ignoreHidden:!0}).getMerges();return me.length===0?W:me[0]},[c]),_=r.useCallbackRef((H,W,me,ue,fe,Me)=>{const ae=c.getSelectedRange().getExtended(ue,H).getCoords();switch(ue){case d.IRange.Direction.Up:return ae.rowStart;case d.IRange.Direction.Down:return ae.rowEnd;case d.IRange.Direction.Left:return ae.colStart;case d.IRange.Direction.Right:return ae.colEnd}},[c]),A=r.useCallbackRef(()=>{const H=c.getUsedRange()?.getCoords(),W=c.getRowHeaders().getUsedRange()?.getCoords(),me=c.getColumnHeaders().getUsedRange()?.getCoords();return{...H,colEnd:Math.max(H?.colEnd??0,me?.max??0),rowEnd:Math.max(H?.rowEnd??0,W?.max??0)}},[c]),J=r.useCallbackRef((H,W)=>c.getRowHeaders().hiddenHeadersAt(H,W),[c]),x=r.useCallbackRef((H,W)=>c.getColumnHeaders().hiddenHeadersAt(H,W),[c]),S=r.useCallbackRef(H=>c.getRange(H,{ignoreHidden:!0}).getMerges(),[c]),oe=r.useCallbackRef(H=>{c?.getSelection().setAdjusting(H)},[c]),ie=r.useCallbackRef(async()=>{c?.getSelection().setAdjusting(null),w.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),w.setMode(null))},[w,D,c,i]),qe=o.useMemo(()=>{const H=w.getMode();return H?.key==="cut"||H?.key==="copy"},[w]);Qe(c?.getView(),{onMovableSelectionChange:()=>{X(c.getView().getMovableSelection().length>0)}}),Qe(c?.getSelection(),{onChange(H){const W=c.getSelection().getCoords();Z(W)}}),Qe(c,{onProtectionChange:()=>{I(c.getProtection().isLocked())}});const{body:de={}}=k||{},Pe=r.useNotifier(),je=n.getLayout(),De=!(j&&D.ranges.length<=1&&$===null&&!v&&(!w.getMode()||qe)),{cursor:Ie,renderOverlay:ke,onPointerDown:ge}=gt.useSelection({gridRef:C,commands:i,layout:je,getCellCoordsAsRangeCoords:Y,selection:D,fillHandleBorderColor:de.fill,selectionBackgroundColor:y?k.selection.fill:k.selectionInactive.fill,selectionBorderColor:y?k.selection.strokeFill:k.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?k.selectionRemove.fill:k.selectionInactive.fill,selectionRemoveBorderColor:y?k.selectionRemove.strokeFill:k.selectionInactive.strokeFill,disableFillDrag:De,disableMoveDrag:E||!(y&&D.ranges.length<=1&&$===null&&!v),disableTouchSelection:ve,onSelectionChange:K,onSelectionDragStart:oe,onSelectionDragEnd:ie,onMoveDragStart:(H,W,me)=>{w.setMode(Bo(0,me))},onMoveDragUpdate:(H,W,me)=>{w.setMode(Bo(0,me))},onMoveDragEnd:(H,W)=>{w.setMode(null)},onMoveDragDone:async(H,W,me)=>{if(he.CoordUtils.isEqualRanges(H,W))return;const ue=c.getRange(W);if(Pe?.showOptions){const g=ue.getDifferences(H);let Le=!1;const Oe=g.getCount();for(let Te=0;!Le&&Te<Oe;Te++)Le=g.at(Te).isContentful();if(Le&&await Pe?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const fe=!me.ctrlKey,Me=me.shiftKey,ae=Me?fe?"Insert Moved Cells":"Insert Copied Cells":fe?"Move Cells":"Copy Cells",be=await Pe?.showBusy?.(ae);try{const g=c.getRange(H);await ue.doBatch(async()=>{Me?await ue.insertFrom(H,{isCut:fe,undoRange:g}):await ue.copyFrom(H,{isCut:fe,undoRange:g}),g.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),ue.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ae,autoSelect:!0})}catch(g){Pe?.showError?.(g)}finally{be?.()}},contentfulCellFinder:_,hiddenRowsAt:J,hiddenColumnsAt:x,mergedRanges:S,getDataCoords:A,canSelectionSpanMergedCells:H=>{const W=c.getRange(H);return W.isEntireColumns()||W.isEntireRows()},onFill:async(H,W)=>{const me="Auto Fill",ue=await Pe?.showBusy?.(me);try{await c.doBatch(()=>{c.getRange(H).autoFill(W),c.getRange(W).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:me,autoSelect:!0})}catch(fe){Pe?.showError?.(fe)}finally{L.current=null,ue?.()}},onFillPreview:(H,W,me)=>{if(C.current&&T){w.setMode(Gl);try{L.current?.direction!==me&&(L.current=null,c.getRange(H).autoFill(W,{previewOnly:Oe=>{L.current={callback:Oe,direction:me}}}));const ue=L.current?.callback?.(W);if(!ue||ue.isEmpty())return;const fe=ue.toText();if(!fe)return;const Me=he.CoordUtils.cellToRange(ue.getCoords()),ae=n.getRelativePointFromClient(0,0);let be=0,g=0,Le=r.ToolTipPlacement.Bottom;if(me===d.IRange.Direction.Down){be=je.getColOffset(Me.colEnd+1)-ae.x;const Oe=je.getRowOffset(Me.rowEnd),Te=je.getRowOffset(Me.rowEnd+1);g=Te-(Te-Oe)/2-ae.y,Le=r.ToolTipPlacement.Right}else if(me===d.IRange.Direction.Right){g=je.getRowOffset(Me.rowEnd+1)-ae.y;const Oe=je.getColOffset(Me.colEnd),Te=je.getColOffset(Me.colEnd+1);be=Te-(Te-Oe)/2-ae.x,Le=r.ToolTipPlacement.Bottom}else if(me===d.IRange.Direction.Up){be=je.getColOffset(Me.colEnd+1)-ae.x;const Oe=je.getRowOffset(Me.rowStart),Te=je.getRowOffset(Me.rowStart+1);g=Te-(Te-Oe)/2-ae.y,Le=r.ToolTipPlacement.Right}else if(me===d.IRange.Direction.Left){g=je.getRowOffset(Me.rowEnd+1)-ae.y;const Oe=je.getColOffset(Me.colStart),Te=je.getColOffset(Me.colStart+1);be=Te-(Te-Oe)/2-ae.x,Le=r.ToolTipPlacement.Bottom}T({anchor:{x:be,y:g},display:fe,placement:Le})}catch(ue){Pe?.showError?.(ue)}}},onFillDone:()=>{L.current=null,w.setMode(null),z?.()}}),B=r.useCallbackRef(H=>{ge(r.ReactUtils.createSyntheticEvent(H))},[ge,$]);o.useEffect(()=>{const H=n?.getStage();if(H)return H.addEventListener("pointerdown",B),()=>{H.removeEventListener("pointerdown",B)}},[n?.getStage()]);const Fe=r.useImperativeElement(t,()=>({}),[]),ze=o.useRef(null);return s.jsx("div",{className:ct(a,"sheet-selection",Vl),style:{position:"absolute",width:M?.width,height:M?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Lt([Fe,ze]),...p,children:ke(n)})})),Sn=Object.freeze({x:0,y:0,width:0,height:0}),Zl={fireOnModelChange:!1},Xl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:h,onShow:c,onUnFocus:C,isDragging:k,updateFrameBounds:y,dragStart:p,style:M,disabled:T,renderMovable:z,...D}=e,[Z,K]=o.useState(Sn),[w,L]=o.useState(null),[v,I]=o.useState(!1),q=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const E=a.getBounds();if(!E)return;const j=i.toViewBounds(E);K(j??Sn),y(j??Sn)},[i?.getBounds()]),Qe(a,{onBoundsChange:E=>{const j=E.getBounds();if(!j)return;const $=i.toViewBounds(j);K($??Sn),y($)},onSelectionChange:()=>{const E=he.CommonUtils.hasFocus(q.current,!0);!v&&!E||a.isSelected()||C()}}),Qe(a,{onRequestFocus:()=>he.CommonUtils.whenFocus(q.current,!0)},Zl),o.useEffect(()=>{const E=q.current;return l(E),()=>{f(E)}},[]);const X=o.useMemo(()=>{if(!Z)return null;let{width:E,height:j}=Z;return z({view:i,movable:a,disabled:T,isDragging:k,style:{position:"relative",left:0,top:0,width:E,height:j},onHide:h,onShow:c})},[i,a,Z.width,Z.height,T,k]);return s.jsx("div",{className:"movable",tabIndex:0,ref:Lt([q,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:Z.x,top:Z.y,width:Z.width,height:Z.height,...M},onMouseDown:async E=>{const j=E.shiftKey||E.ctrlKey,$=a.isSelected(),ve=E.currentTarget;j&&$?a.unselect():($&&!j||await a.select({addToSelection:j}),p(E.nativeEvent,ve),ve.focus())},onFocus:E=>{E.relatedTarget&&!w&&L(E.relatedTarget),I(!0)},onBlur:E=>{w&&!q?.current?.contains(E.relatedTarget)&&L(null),E.relatedTarget&&I(!1)},...D,children:X})})),Yl="_movable-area_314c6_5",qr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:h,onFocus:c,disabled:C=!1,disableDrag:k=!1,disableResize:y=!1,className:p,style:M,renderDirections:T=["nw","n","ne","w","e","sw","s","se"],onFirstRender:z,...D}=e,Z=n.getBounds(),K=r.useCallbackRef(z,[z]),w=r.useCallbackRef(h,[h]),L=r.useCallbackRef(c,[c]),[v,I]=o.useState([]),[q,X]=o.useState(!1),[E,j]=o.useState(!1),$=o.useRef(!0),ve=o.useRef(new Map),Y=o.useRef(new Map),_=o.useRef(new Map),A=o.useRef(new Map),J=o.useRef(new Map),x=o.useRef({onRequestFocus:m=>(me(m),null)}),S=o.useRef(null),oe=o.useRef(null),ie=o.useRef(null),[qe,de]=o.useReducer(m=>m+1,0);o.useLayoutEffect(()=>{de()},[n,i]),Qe(i,{onCollectionChange:()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),F=J.current;F.forEach(te=>{te()}),F.clear();const G=x.current;for(let te=0;te<m.length;te++){const le=m[te];if(le.isClosed())continue;const b=le.addListeners(G);F.set(le,b)}de()},onInvalidated:()=>{de()}}),Qe(a,{onMovableSelectionChange(m){je(),de()}});const Pe=o.useCallback((m,F)=>{const G=_.current.get(m);ie.current&&(ie.current.getTargets().forEach(te=>{if(te===G)return te.style.left=F.x+"px",te.style.top=F.y+"px",te.style.width=F.width+"px",void(te.style.height=F.height+"px")}),ie.current.updateRect())},[]),je=()=>{const m=[],F=a.getMovableSelection();F.forEach(G=>{const te=_.current.get(G);te&&F.indexOf(G)!==-1&&m.push(te)}),I(G=>he.CommonUtils.isEqualArrays(G,m)?G:m)},De=o.useRef(null),Ie=o.useRef(null),ke=o.useMemo(()=>(Ie.current||(Ie.current=new Promise(m=>{De.current=m})),Ie.current),[]),ge=o.useRef(null),B=r.useCallbackRef(async(m,F)=>{ge.current=F,await(async()=>!(!await ke.then()||!ie.current))()&&ge.current===F&&ie.current.dragStart(m,F)},[v]),[Fe,ze]=o.useState(!1),H=o.useRef(null),W=o.useRef(null),me=r.useCallbackRef(async(m=null)=>{if(m||(m=a.getMovableSelection()[0]),!m)return w?.(),!1;const F=_.current.get(m);F?(await he.CommonUtils.whenFocus(F),F.focus(),W.current=F,H.current=null):H.current=m},[a]);o.useEffect(()=>{Fe&&v.length>0&&W.current!==v[0]&&me(),$.current&&(K?.(),$.current=!1)},[v]);const ue=o.useMemo(()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(m.length===0&&ve.current.size===0)return null;const F=(O,R,P,ce=!0)=>{const se=O.isSelected(),ye={tabIndex:P,view:n,movable:O,onRefLoad:ee=>{H.current===O&&(ee.focus(),W.current=ee,H.current=null),_.current.set(O,ee),Y.current.set(ee,O),R.rendered=!0,je()},onRefUnload:ee=>{_.current.delete(O),Y.current.delete(ee),R.rendered=!1,je()},onUnFocus:w,onHide:ee=>{R.onHide=ee},onShow:ee=>{R.onShow=ee},isDragging:se&&(E||q),disabled:C,renderMovable:l,updateFrameBounds:ee=>{Pe(O,ee)},dragStart:B,onMouseUp:()=>{if(ge.current=null,oe.current){X(!1),j(!1);let ee=!1;A.current?.forEach(pe=>{he.CommonUtils.isEqualBounds(pe.movable.getBounds(),pe.startBounds)||(ee=!0)}),ee?Me():ae()}},style:{opacity:ce?q&&se?.7:void 0:0,zIndex:q&&se?O.getZIndex()+m.length:void 0,pointerEvents:ce?void 0:"none",cursor:E&&se?"grabbing":C||k?"initial":"move",boxShadow:!se||E&&!q?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(Xl,{...ye},`movable-${O.getUUID()}`)},G=ve.current,te=new Map,le=[];for(let O=0;O<m.length;O++){const R=m[O];if(R.isClosed())continue;let P=G.get(R);P||(P={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(ce,se)=>{if(!se||se.shown===!0)return;se.shown=!0;const ye=++se.visibilityRequestId;requestAnimationFrame(()=>{const ee=ve.current.get(ce);ee&&ye===se.visibilityRequestId&&(se.onShow?.(ce),ee.shown=!0)})},doHide:async(ce,se)=>{if(!se||se?.shown===!1)return;se.shown=!1;const ye=++se.visibilityRequestId,ee=await Promise.resolve(se.onHide?.(ce));ye===se.visibilityRequestId&&ee!==!1&&(se.shown=!1,ve.current.delete(ce),de())},visibilityRequestId:0}),P.frame=F(R,P,O,!0),le.push(P.frame),P.doShow(R,P),G.delete(R),te.set(R,P)}const b=[];return a.getMovableSelection().forEach(O=>{const R=G.get(O);R&&(R.frame=F(O,R,-1,!1),b.push(R.frame),G.delete(O),te.set(O,R))}),G.forEach((O,R)=>{O.frame=F(R,O,-1,!1),b.push(O.frame),O.doHide(R,O),G.delete(R),te.set(R,O)}),ve.current=te,je(),[...b,...le]},[qe,n,l,C,k,y,q,E]),fe=r.useCallbackRef((m,F)=>{const G=`${F} ${v.length===1?d.TextUtils.capitalize(Y.current?.get(v[0]).getContent().getType()):"Drawings"}`;oe.current&&(console.warn(`Transaction ${oe.current.getDescription()} is being replaced by ${G}`),oe.current.rollback(),oe.current=null),oe.current=f.beginCommit({description:G}),A.current.clear();for(let te=0;te<v.length;te++){const le=v[te],b=Y.current?.get(le);b?A.current.set(le,{movable:b,startBounds:n.toViewBounds(b.getBounds())}):console.warn("invalid element",b)}},[f,n,v]),Me=o.useCallback(()=>{if(!oe.current)return;const m=[];A.current?.forEach(F=>{m.push(F.movable)}),oe.current.commit({viewAfter:{view:a,movableSelection:m}}),A.current.clear(),oe.current=null},[]),ae=o.useCallback(()=>{oe.current&&(oe.current.rollback(),oe.current=null)},[]),be=o.useRef(null);o.useEffect(()=>{be.current&&(be.current.onscroll=m=>{m.preventDefault(),m.srcElement.scrollTop=0,m.srcElement.scrollLeft=0})},[be.current]);const g=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:me,focus:()=>{me()}}),[a]),[Le,Oe]=o.useState(null),Te=o.useRef(!1),u=o.useRef(!1),N=o.useRef(!1);o.useEffect(()=>{if(C||v.length===0||N.current||Te.current)return;if(u.current)return void requestAnimationFrame(()=>{ie.current&&S.current&&ie.current.refTargets.length>0&&(N.current=!0,De.current?.(!0)),I([...v])});Te.current=!0;const m=o.lazy(async()=>{try{const F=await Promise.resolve().then(()=>require("./Be13sRyTTTUvNIit.cjs"));return Te.current=!1,u.current=!0,I([...v]),F}catch(F){return console.warn(F),De.current?.(!1),null}});Oe(m)},[v,C,k,y]);const U=o.useMemo(()=>!Le||C?null:s.jsx(o.Suspense,{children:s.jsx(Le,{className:ct({dragging:q||E,resizing:q,moving:E}),container:null,ref:ie,target:ie.current?v:[],draggable:!C&&!k,resizable:!C&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:T,onResizeStart:m=>{fe(m.target,"Resize")},onResize:m=>{if(!oe.current)return m.stopDrag(),void de();X(!0);const F=m.direction[0]!==0&&m.direction[1]!==0;let G=0,te=0;for(let le=0;le<v.length;le++){const b=v[le],O=A.current.get(b),R=Y.current.get(b);if(!O||!R){console.warn("invalid element");continue}let P=m.dist[0],ce=m.dist[1],se=m.drag.dist[0],ye=m.drag.dist[1],ee=O.startBounds.width,pe=O.startBounds.height;le===0?(G=ee,te=pe):(P*=ee/G,se*=ee/G,ce*=pe/te,ye*=pe/te);const V={...O.startBounds};if(V.width=Math.max(0,ee+P),V.height=Math.max(0,pe+ce),m.direction[0]===-1&&(V.width=Math.max(0,Math.min(O.startBounds.x+ee,ee-se))),m.direction[1]===-1&&(V.height=Math.max(0,Math.min(O.startBounds.y+pe,pe-ye))),F&&(R.isLockAspectRatio()||m.inputEvent?.shiftKey)){const Q=ee/pe,re=V.width/V.height;re>Q?V.height=V.width/Q:re<Q&&(V.width=V.height*Q)}m.direction[0]===-1&&(V.x=Math.max(0,Math.min(O.startBounds.x+ee,O.startBounds.x+ee-V.width))),m.direction[1]===-1&&(V.y=Math.min(O.startBounds.y+pe,O.startBounds.y+pe-V.height)),O.movable.setBounds(n.toAbsoluteBounds(V))}},onResizeEnd:m=>{X(!1),Me()},onDragStart:m=>{fe(m.target,"Move")},onDrag:m=>{if(!oe.current)return m.stopDrag(),void de();j(!0);for(let F=0;F<v.length;F++){const G=v[F],te=A.current.get(G);te?te.movable.setBounds(n.toAbsoluteBounds({...te.startBounds,x:te.startBounds.x+m.translate[0],y:te.startBounds.y+m.translate[1]})):console.warn("invalid element")}},onDragEnd:m=>{},onMouseUp:m=>{}})}),[qe,Le,v,n,C,k,y,q,E]);return s.jsx("div",{className:ct(p,"movable-area",Yl),style:{width:Z.width,height:Z.height,...M,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Lt([g,be]),...D,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:Z.width,height:Z.height},...D,children:s.jsxs("div",{ref:S,style:{position:"absolute",pointerEvents:"auto"},onFocus:m=>{L?.(),ze(!0)},onBlur:m=>{ze(!1)},onKeyDownCapture:m=>{if(m.isDefaultPrevented())return;const F=m.nativeEvent.ctrlKey,G=m.nativeEvent.altKey,te=m.nativeEvent.shiftKey;if(m.which===r.KeyCodes.Escape){const P=a.getMovableSelection();let ce=[...P];return v.forEach(se=>{if(ce.length===0)return;const ye=Y.current.get(se);let ee=ce.indexOf(ye);ce.splice(ee,1)}),ce.length!==P.length&&a.selectMovables(ce),ce.length===0&&w?.(),void m.preventDefault()}const le=.1,b=P=>{i.updateSelected(ce=>{ce.setRotation(ce.getRotation()+P)},"Rotate")},O=(P,ce=!0)=>{i.updateSelected(se=>{const ye=se.getBounds();let ee=1+P;ce||(ee=1/ee);const pe=Math.sqrt(Math.pow(ye.width,2)+Math.pow(ye.height,2)),V=Math.atan2(ye.height,ye.width),Q=ee*pe;if(Q<10)return;const re=Q*Math.cos(V),Ee=Q*Math.sin(V),Ue={x:ye.x+(ye.width-re)/2,y:ye.y+(ye.height-Ee)/2,width:re,height:Ee};se.setBounds(Ue)},"Resize")},R=P=>{i.updateSelected(ce=>{const se=ce.getBounds(),ye={x:se.x+(P.x??0),y:se.y+(P.y??0),width:se.width+(P.width??0),height:se.height+(P.height??0)};ce.setBounds(ye)},"Nudge")};if(m.which===r.KeyCodes.Delete)i.updateSelected(P=>{P.delete()},"Delete"),m.preventDefault();else if(m.key==="a"&&F){const P=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(P,!0),m.preventDefault()}else m.key==="ArrowLeft"?(te?O(le,!1):G?b(-10):R({x:F?-10:-1}),m.preventDefault()):m.key==="ArrowRight"?(te?O(le,!0):G?b(10):R({x:F?10:1}),m.preventDefault()):m.key==="ArrowUp"?(te?O(le,!0):R({y:F?-10:-1}),m.preventDefault()):m.key==="ArrowDown"&&(te?O(le,!1):R({y:F?10:1}),m.preventDefault())},children:[ue,U]})})})})),Ut=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const f=e[l].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),i=Math.max(f.x+f.width,i),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ho=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,h=Number.MAX_SAFE_INTEGER,c=0;for(let y=0;y<e.length;y++){const p=e[y],M=p.getBounds();f+=M[l],h=Math.min(M[i],h),c=Math.max(M[i]+M[l],c),n.push({bounds:M,movable:p})}const C=(c-h-f)/(e.length-1);n.sort((y,p)=>{const M=y.bounds[i],T=p.bounds[i];return M!==T?M-T:y.bounds[a]-p.bounds[a]});const k=new Map;k.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const p=n[y-1].bounds,M={...n[y].bounds};M[i]=p[i]+p[l]+C,n[y].bounds=M,k.set(n[y].movable,M)}return k.set(n[n.length-1].movable,n[n.length-1].bounds),k},Sr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,h=r.useNotifier(),c=r.useEditMode();o.useRef(c.getMode()).current=c.getMode();const C=r.useCallbackRef(async(w,L,v=null,I=!0)=>{const q=async()=>{const X=await Promise.resolve(h?.showBusy?.(w.label()));try{await L();const E=v??w?.label?.();if(f){let j=null;w&&E!==!1&&(j=new r.SimpleCommand(w.key(),l,{label:E,description:E},q)),f(j)}X?.(),I&&c.setMode(null)}catch(E){X?.(),h?.showError?.(E)}};await q()},[f,h]),[k,y]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,L,v)=>{if(!n)return;const I=n.getMovableSelection();if(I.length===0)return;let q="Drawings";if(I.length===1){const E=I[0];q=d.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const X=`${w.label()} ${q}`;C(w,()=>{let E=null;i&&(E=i.beginCommit(X));const j=n.getMovableSelection();if(j.length===0)return;const $=v?.(j);for(let ve=0;ve<j.length;ve++){const Y=j[ve];L(Y,$)}E?.commit()})},[n,i]),[M,T]=o.useState(n.getMovableSelection()[0]??null),[z,D]=o.useState(!M||M?.isProtected()),Z=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,w=>{w.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,w=>{w.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){p(this,w=>{w.setLockAspectRatio(!w.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){p(this,(w,L)=>{w.setBounds({x:L.x})},Ut)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){p(this,(w,L)=>{w.setBounds({x:(L.width-w.getBounds().width)/2+L.x})},Ut)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){p(this,(w,L)=>{w.setBounds({x:L.width-w.getBounds().width+L.x})},Ut)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){p(this,(w,L)=>{w.setBounds({y:L.y})},Ut)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){p(this,(w,L)=>{w.setBounds({y:(L.height-w.getBounds().height)/2+L.y})},Ut)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){p(this,(w,L)=>{w.setBounds({y:L.height-w.getBounds().height+L.y})},Ut)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){p(this,(w,L)=>{w.setBounds(L.get(w))},w=>Ho(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){p(this,(w,L)=>{w.setBounds(L.get(w))},w=>Ho(w,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,M]);o.useEffect(()=>{},[c]);const K=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(Z,!0),w},[a,Z]);return Qe(M,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:M?.getAnchorType()===d.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:M?.getAnchorType()===d.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===d.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:M?.isLockAspectRatio()})},onProtectedChange:w=>{D(w.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;T(w),D(!w||w.isProtected()),y()}}),Qe(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const w={disabled:z};K.getCommand("formatAnchorTypeTwoCell").update(w),K.getCommand("formatAnchorTypeOneCell").update(w),K.getCommand("formatAnchorTypeAbsolute").update(w),K.getCommand("toggleLockAspectRatio").update(w);const L=t.getCount(),v=n.getMovableSelection(),I=z||L<=1||v.length===0;let q={disabled:I},X=q;if(!I&&v.length===1){const $=v[0];$.getZIndex()===0&&(q={disabled:!0}),$.getZIndex()===L-1&&(X={disabled:!0})}K.getCommand("moveToFront").update(X),K.getCommand("moveForward").update(X),K.getCommand("moveToBack").update(q),K.getCommand("moveBackward").update(q);const E={disabled:z||v.length<=1};K.getCommand("formatDrawAlignLeft").update(E),K.getCommand("formatDrawAlignCenter").update(E),K.getCommand("formatDrawAlignRight").update(E),K.getCommand("formatDrawAlignTop").update(E),K.getCommand("formatDrawAlignMiddle").update(E),K.getCommand("formatDrawAlignBottom").update(E),K.getCommand("formatDrawFlipHorz").update(E),K.getCommand("formatDrawFlipVert").update(E),K.getCommand("formatDrawGroup").update(E),K.getCommand("formatDrawUngroup").update(E),K.getCommand("formatDrawSwapShapes").update(E),K.getCommand("formatDrawSwapShapesHorz").update(E),K.getCommand("formatDrawSwapShapesVert").update(E);const j={disabled:z||v.length<=2};K.getCommand("formatDrawDistributeHorz").update(j),K.getCommand("formatDrawDistributeVert").update(j)},[k,z,k]),K},Jl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:p,width:M}]=Wt();return s.jsx("div",{...C,ref:Lt([k,y]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:a})})})})),Ql=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,propsMovable:a,renderMovable:l,commands:f,target:h,onRepeatCommandChange:c}=e,C=Sr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:c,commands:f,target:h});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const k=o.useMemo(()=>s.jsx(qr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{C.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,C]);return k&&n?k:null})),ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:h,commands:c}=e,C=r.useEditMode(),[k,y]=o.useState(null),[p,M]=o.useState(null),[T,z]=o.useState(null),[D,Z]=o.useState(null),[K,w]=o.useState(null);o.useLayoutEffect(()=>{if(T===null)return Z(null),void w(null);const x=()=>{const S=i.getRange(T).getCell(),oe=S.getStyle();let ie,qe=oe.getFill()?.toCSS(a.body.darkMode);qe.background!=="none"&&qe.background!=="transparent"||(qe=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),qe.background!=="none"&&qe.background!=="transparent"||(qe={background:a.body.fill}),Z({style:qe}),S&&!S.getFormula()&&(ie=S?.getRenderHorizontalAlignment()),w(ie??r.HorizontalAlignment.Left)};return x(),i.getRange(T).addListener(()=>{x()})},[i,T,a?.body]);const L=r.useCallbackRef(()=>{let x=p.editState.dirty??"";if(p.editState.dirty!==void 0){const S=d.TextUtils.clampString(x);try{const oe=p.sheet.getRange(p.coords),ie=`Typing '${S}' into ${oe.toString()}`;return oe.setValue(x,{description:ie,autoFit:!0}),z(null),M(null),C.setMode(null),h(null),!0}catch(oe){throw he.Notifier.error(new Error(`Unable to enter '${S}'.`,{cause:oe})),oe}}},[i,p]),v=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??he.CoordUtils.cellToRange(x),[i]),I=r.useCallbackRef(x=>{let S=d.IRange.Orientation.Row,oe=!1;x!==d.IRange.Direction.Up&&x!==d.IRange.Direction.Down||(S=d.IRange.Orientation.Column),x!==d.IRange.Direction.Left&&x!==d.IRange.Direction.Up||(oe=!0),i.getSelection().traverse(S,oe)},[i]),q=o.useCallback((x,S)=>{if(l)return l(x,S);if(!i)return null;const{ref:oe,...ie}=x;return s.jsx(hr,{ref:oe,...ie,sheet:i,bodyStyle:a?.body,activeCoords:S,commands:c,onChangeEdit:qe=>{const de={sheet:i,coords:S,editState:qe};C.setMode(Pe=>({...Pe,description:de.editState.editMode?"Edit":"Enter",args:{...Pe?.args,stateAndCoords:de}}))},editState:p.editState})},[i,D,l,p,T]),{renderOverlay:X,startEdit:E,submitEdit:j,cancelEdit:$,onKeyboardEventNative:ve,onPointerEventNative:Y}=gt.useKeyboardEditorOverlay({view:n,activeCoords:k,getCellEditor:q,canEdit:()=>{const x=i.getProtection();if(x.isReadOnly())return!1;const S=x.isLocked();return S&&f(),!S},onBeforeStartEdit:x=>{const S=mr(()=>i.getRange(x).getCell()),oe={sheet:i,coords:x,editState:Object.freeze(S)};C.setMode({key:"edit",args:{stateAndCoords:oe}}),M(oe)},onStartEdit:x=>{z(x),h(x)},onSubmitEdit:L,onCancelEdit:x=>{z(null),M(null),C.setMode(null),h(null)},onDoneEdit:x=>{C.setMode(null)},onNavigate:I,propsContainer:D,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:K,getRangeCoords:v});Qe(i.getSelection(),{onChange(x){y(i.getSelection().getCoords().cell)}});const _=r.useCallbackRef(x=>{Y(x),T&&j()},[Y,$,T]),A=o.useCallback(x=>{Y(x)},[Y]),J=o.useCallback(x=>{ve(x)},[ve]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",_),x.addEventListener("dblclick",A),x.addEventListener("keydown",J),()=>{x.removeEventListener("pointerdown",_),x.removeEventListener("dblclick",A),x.removeEventListener("keydown",J)}},[n?.getStage()]),o.useEffect(()=>{const x=C.getMode(),S=x?.key;S==="edit"||S==="enter"?p?x.args?.cancel?$():x.args?.submit?j():M(x.args?.stateAndCoords):E(x.args?.start):T&&$()},[C]),X(n,t)})),Rr="white",kr="black",ti=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${kr}' fill='${Rr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ni=`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='${kr}' fill='${Rr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,h]=o.useState(null),[c,C]=o.useState(null),[k,y]=o.useState(null),[p,M]=o.useState(null),T=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)}else l(!1),h(null)},[i,n]),z=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const I=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:I});q.length===1&&q[0].select()},[n,i]),D=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const I=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:I});if(q.length===1){const X=q[0].getRange().getCoords(),E={colStart:X.colStart,rowStart:I.rowIndex,colEnd:X.colEnd,rowEnd:I.rowIndex};i.getRange(E).select()}},[n,i]),Z=r.useCallbackRef(()=>{if(!a)return;const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)},[i,a,n]);Qe(i?.getSelection(),{onChange(v){C(i.getSelection().getCoords().cell)}}),Qe(k,{onAnyChange(v){T(),Z()}}),Qe(p,{onAnyChange(v){Z()}}),Qe(i,{onTablesChange(v){T(),Z()},onInvalidated(v){T(),Z()}});const K=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle(Z,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let v=null;if(f)for(let I=0;I<f.length&&!v;I++){const q=f[I],X=q.getRange().getCoords();d.CoordUtils.isCellWithinRange(c,X)&&(v=q)}y(v)},[c,f]);const w=r.useCallbackRef(v=>{let I=null;if(f)for(let q=0;q<f.length;q++){const X=f[q],E=X.getRange().getCoords();let j=n.getRangeCoordsBounds(E);const $=n.getRelativePointFromClient(v.clientX,v.clientY),ve=$.x,Y=$.y;if(ve>=j.x&&ve<=j.x+j.width&&Y>=j.y&&Y<=j.y+j.height){const _=n.getViewportSize();ve<=0||Y<=0||ve>=_.width||Y>=_.height||(I=X)}}M(I)},[n,f]);if(o.useEffect(()=>{const v=n?.getStage();if(v&&f)return v.addEventListener("mousemove",w),v.addEventListener("mouseleave",w),()=>{v.removeEventListener("mousemove",w),v.removeEventListener("mouseleave",w)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const L=[];for(let v=0;v<f.length;v++){const I=f[v];if(I.isClosed())continue;const q=I===p,X=I===k,E=I.getRange().getCoords(),j=n.getRangeCoordsBounds(E);let $;if(q||X){const ve=I.getStyle().getProperties(),Y=ve.headerRow?.fill?.background??ve.wholeTable?.border?.top?.color?.toString();if(Y&&i){const _=i.getStyles().parseColor(Y);_&&($=_.toCSS())}$||($="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}L.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:j.height,pointerEvents:"all",cursor:ti},onMouseDown:D},`table-select-row-${I.getName()}`)),L.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:Math.min(16,j.height),pointerEvents:"all",cursor:ni},onMouseDown:z},`table-select-${I.getName()}`)),L.push(s.jsx(gt.Selection,{x:j.x,y:j.y,width:j.width,height:j.height,range:E,strokeWidth:X?.5:0,stroke:$??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:q?`${$} 0px 0px 1px 1px`:void 0}},`table-outline-${I.getName()}`))}return L})),ri=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[h,c]=o.useState(null),C=o.useRef(null),k=r.useCallbackRef(()=>{const D=i.getSelectedCell(),Z=D.getSpill()?.getCoords()??null;he.CoordUtils.isEqualRanges(Z,l)||(c(Z?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(Z),coords:Z}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(Z))},[i,n,l]);o.useEffect(()=>(C.current&&(clearTimeout(C.current),C.current=null),h&&(C.current=setTimeout(()=>{c(null),C.current=null},a)),()=>{C.current&&(clearTimeout(C.current),C.current=null)}),[h,a]);const y=o.useMemo(()=>he.CommonUtils.debounce(he.CommonUtils.throttle(k,80),80),[]);if(Qe(i?.getSelection(),{onChange(D){y()}}),Qe(i,{onSpillsChange(D){k()},onInvalidated(D){k()}}),!n||!l&&!h)return null;const p=i.getRange(l).getValue()instanceof d.FormulaError.Spill,M=[];let T=h?.bounds??n.getRangeCoordsBounds(l);if(h&&!he.CommonUtils.isEqualBounds(h.bounds,n.getRangeCoordsBounds(h.coords))&&c(null),T=n.toClipBounds(T,-10),!T)return;const z="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return M.push(s.jsx(gt.Selection,{x:T.x,y:T.y,width:T.width,height:T.height,range:l,strokeWidth:1,stroke:z,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:h?.transition==="out"?0:1,transition:h?.transition?h.transition==="in"||h.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${z} 0px 0px 4px 0px`}},"spill-outline}")),M})),li={position:"absolute",top:0,left:0,bottom:0,right:0},Vo=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=he.CommonUtils.mergeContentful(e.body,l);return n.body=he.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=he.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=he.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=he.CommonUtils.mergeContentful(n.header,l),n.headerSelect=he.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=he.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=he.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ii={fireOnModelChange:!1},Uo={},Mr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Uo,headersStyle:a=Uo,onSheetContextMenu:l,showColumnHeaders:f,propsColumnHeader:h,showRowHeaders:c,propsRowHeader:C,showScrollbars:k=!0,propsScrollPane:y,onViewportChange:p,commands:M,onRepeatCommandChange:T,overlays:z,renderMovable:D,viewportComponent:Z,onElementLoad:K,getCellEditor:w,onFocus:L,onBlur:v,style:I=r.ReactUtils.EmptyCssProperties,onShowTooltip:q,onShowColumnTooltip:X,onShowRowTooltip:E,onCloseTooltip:j,propsGrid:$,propsCellRender:ve,...Y}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[_,A]=o.useReducer(ne=>ne+1,0),[J,{width:x,height:S}]=Wt(),oe=r.useCallbackRef(q,[q]),ie=r.useCallbackRef(X,[X]),qe=r.useCallbackRef(E,[E]),de=r.useCallbackRef(j,[j]),Pe=o.useRef(!1);o.useLayoutEffect(()=>{Pe.current=!0},[n]);const je=n?.getStyles(),De=o.useMemo(()=>Vo(i,je),[i,je]),Ie=o.useMemo(()=>Vo(a,je),[a,je]),{body:ke={},buttonSurface:ge={}}=De,{header:B={},headerSelect:Fe={},headerSelectAll:ze={}}=Ie,H=o.useRef(null),[W,me]=o.useState(()=>n?.getView()),ue=(W?.getZoomScale()??100)/100,fe=o.useMemo(()=>({vertical:W.isShowColumnGridlines()&&ue>=.4,horizontal:W.isShowRowGridlines()&&ue>=.4}),[W?.isShowColumnGridlines(),W?.isShowRowGridlines(),ue]),Me=o.useMemo(()=>{if(W?.getGridLineColor())return{strokeDasharray:"1,1"}},[W?.getGridLineColor(),De]),ae=f??W?.isShowColumnHeaders(),be=c??W?.isShowRowHeaders(),[g,Le]=o.useState({width:0,height:0}),Oe=o.useMemo(()=>{let ne=40,Re=20;const Ke=n?.getStyles().getNormal().getFont();if(g.width>0&&g.height>0){const Ve=Ke?.toCSS()?.fontFamily??De.header.text.fontFamily,Ge=Ke?.getSize()??De.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+g.height,Math.ceil(Ge*d.IFont.getDeviceScale()),Ve);ne=We.width,Re=We.lineHeight}return{width:Math.round(ne+5),height:Math.round(Re+3)}},[g,De?.header.text,n]),Te=be?ue*Oe.width:B.edgeStrokeWidth,u=ae?ue*Oe.height:B.edgeStrokeWidth,N=Math.max(x,(n?.getColumnHeaders().getDefaultSize()??Oe.width)+Te+1),U=Math.max(S,(n?.getRowHeaders().getDefaultSize()??Oe.height)+u+1),m=o.useRef(new Map),F=o.useRef(null),G=()=>({getColOffset:ne=>n.getColumnHeaders().findOffset(ne),getColIndex:ne=>n.getColumnHeaders().findIndex(ne),getRowOffset:ne=>n.getRowHeaders().findOffset(ne),getRowIndex:ne=>n.getRowHeaders().findIndex(ne)}),[te,le]=o.useState(()=>G()),[b,O]=o.useState(!1),[R,P]=o.useState(null),ce=!0,se=De.selection?.strokeFill,ye=o.useCallback(()=>Mt.current,[]),[ee,pe]=o.useState(),V=r.useCallbackRef(ne=>{pe(ne);const Re=n?n.getView():null;Re&&Re.setTopLeft(ne?{left:ne.left,top:ne.top}:null),p?.(ne)},[n,p]),Q=o.useRef(null);o.useEffect(()=>{if(!ee||!n)return;const ne=n.getRangeAtBounds({x:ee.left,y:ee.top,width:ee.width,height:ee.height});Q.current?.(),Q.current=ne.addListener(()=>{const Re=ne.getCoords();H?.current?.invalidate(Re)})},[ee,n]);const[re,Ee]=o.useState(()=>n?.getView().getTopLeft()),Ue=r.useCallbackRef(ne=>{const Re=he.CoordUtils.cellToRange(ne);if(n.isClosed())return Re;const Ke=n.getRange(Re,{ignoreHidden:!0}).getMerges();return Ke.length===0?Re:Ke[0]},[n]),Be=ne=>{if(!ne||ne.coords.colIndex===0&&ne.coords.rowIndex===0)return null;const Re={};return ne.coords.colIndex>0&&(Re[he.AnchorLocation.Left]={index:ne.coords.colIndex,scrollOffset:ne.topLeft.left}),ne.coords.rowIndex>0&&(Re[he.AnchorLocation.Top]={index:ne.coords.rowIndex,scrollOffset:ne.topLeft.top}),Re},[xe,He]=o.useState(()=>Be(n.getView().getFreezePanes())),Ce=r.useEditMode(),Ae=o.useCallback(()=>H.current,[]),we=r.useCallbackRef(ne=>{Ce.setMode(Re=>Re?.key==="edit"?{...Re,args:{...Re.args}}:{key:"edit",args:{stateAndCoords:null,start:ne}})},[]),Se=r.useCallbackRef(()=>ee,[ee]),Ne=br({sheet:n,commands:M,target:Ae,onRepeatCommandChange:T,bodyStyle:ke,onStartEdit:we,getViewport:Se}),[Ze,_e]=o.useState(n.getSelection().isEntire()),[Xe,at]=o.useState(W?.getMovableSelection().length>0),ot=R!==null||Xe,$e=null,[lt,it]=o.useState(!1);o.useEffect(()=>{it(!1)},[n.getProtection()]);const Je=r.useNotifier(),st=r.useCallbackRef(()=>{lt||(it(!0),Je.showMessage?.(s.jsxs("span",{children:["This sheet is protected.",s.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[Je,lt]),wt=o.useMemo(()=>{const ne=Ce.getMode();return ne?.cursor?ne.cursor:null},[$e,Ce]),[bt,dt]=o.useState(null),ft=o.useRef(!1),[xt,Un]=o.useState([]),Yt=o.useRef(null),[fn,Pt]=o.useState(he.TypesUtils.EmptyTopLeft),[jt,It]=o.useState(he.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Pt({left:re?.left,top:0})},[re?.left]),o.useEffect(()=>{It({left:0,top:re?.top})},[re?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{He(Be(n.getView().getFreezePanes()))},onTopLeftChange:()=>{Ee(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){me(n.getView()),le(G())},onLayoutChange:()=>{const ne=n.getEntireRange();Le({height:ne.getRowCount(),width:ne.getColumnCount()}),le(G())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),Qe(n,{onRequestScrollIntoView:async(ne,Re)=>{if(!Re)return;const Ke={colIndex:Re?.coords?.colStart,rowIndex:Re?.coords?.rowStart};return await H.current?.scrollCellCoordsIntoView(Ke,Re?.scroll),!0},onRequestFocus:()=>he.CommonUtils.whenFocus(Mt.current)},ii);const pt=o.useRef(!1),pn=o.useMemo(()=>{const ne=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&ie?.(Ve)})},32),Re=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:g.height,colStart:Ve,colEnd:Ve})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getColOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.x+tt.width,rt.getColOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===he.AnchorLocation.Left||Tt===he.AnchorLocation.Center||Tt===he.AnchorLocation.Right)){const to=he.CommonUtils.roundAccurately(Ge*he.CommonUtils.getDPI(),0),bn=he.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ge/ue),2).toFixed(2),no="Width: "+(Ge?bn+" ("+to+" pixels)":"Hidden"),tn=Gn.current.getGridElement().getRelativePointFromClient(0,0),Vt=0-tn.y,xn=0-tn.y+u,oo=tn.x-tt.x;ne({anchor:{x:nt-oo,y:Vt,width:yt-nt,height:xn-Vt},display:no})}const zt=[0,0,0,tt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},Jn={x:nt-1,y:0,width:1,height:tt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},eo={x:yt-1,y:0,width:1,height:tt.height};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Re(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Re(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Re(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},...h}},[n,h,u,bt]),Ot=o.useMemo(()=>{const ne=he.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&qe?.(Ve)})},32),Re=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:g.width})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getRowOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.y+tt.height,rt.getRowOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===he.AnchorLocation.Top||Tt===he.AnchorLocation.Center||Tt===he.AnchorLocation.Bottom)){const to=Math.floor(10*he.CommonUtils.getDPI())/10,bn=he.CommonUtils.roundAccurately(Ge*to,0),no=he.CommonUtils.roundAccurately(bn/ue/(n?.getRowHeaders().getScaleFactor()*he.CommonUtils.getDPI()),2).toFixed(2),tn="Height: "+(Ge?no+" ("+bn+" pixels)":"Hidden"),Vt=Ht.current.getGridElement().getRelativePointFromClient(0,0),xn=0-Vt.x,oo=0-Vt.x+Te,hl=Vt.y-tt.y;ne({anchor:{x:xn,y:nt-hl,width:oo-xn,height:yt-nt},display:tn})}const zt=[0,0,tt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},Jn={x:0,y:nt-1,width:tt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:se}},eo={x:0,y:yt-1,width:tt.width,height:1};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Re(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Re(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Re(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>de?.()),ft.current=!1,dt(null)},...C}},[n,C,Te]),Mt=r.useImperativeElement(t,()=>{const ne=Ke=>{n?.getView()&&n.getView().selectMovables([]),F.current=null,H?.current?.focus(Ke)},Re=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ge=H.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ge)return!1;const We=Ge.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let rt=m.current?.get(We);return rt?.current?(await rt.current.focusMovable(Ke),!0):(F.current={movable:Ke,anchor:We},!0)};return{getGridElement:()=>H.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Gn.current,rowHeaderHeight:()=>u,colHeaderWidth:()=>Te,startEdit:we,submitEdit:()=>{Ce.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{Ce.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:R!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&Re()||ne(Ke)},focusSheet:ne,focusMovable:Re,contains:Ke=>H?.current?.contains?.(Ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(ne=>{Pe.current||(H?.current?.invalidate(ne),A?.())},[]);o.useEffect(()=>{At()},[De]);const Jt=Ze?ze.edgeStrokeFill:B.fill,Kn=Ze?Fe.fill:typeof De.headerHover=="function"?De.headerHover(B)?.fill:B.fill,et=o.useMemo(()=>Z?s.jsx("div",{className:ct("sheetxl-viewport-overlay",Rl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:Z}):s.jsx(s.Fragment,{}),[Z]);let Qt=null;ae&&be&&(Qt=s.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${u}px`,width:`${Te}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:ne=>{let Re=!ne.ctrlKey;Ne?.getCommand("selectAll")?.execute(!Re||ne.button!==0),ne.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:-1,colIndex:-1}):H.current?.focus()},children:[s.jsx("div",{style:{height:u-5+"px",width:u-5+"px",clipPath:`path('M${u-5} 0 L0 ${u-5} L${u-5} ${u-5} L${u-5} 0 Z')`,borderRight:`2px solid ${Jt}`,borderBottom:`2px solid ${Jt}`,background:`${Kn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),s.jsx("div",{style:{position:"absolute",height:`${u}px`,width:`${Te}px`,boxSizing:"border-box",borderRight:`solid 1px ${B.strokeFill}`,borderBottom:`solid 1px ${B.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Bt=r.useCallbackRef(({_left:ne,_top:Re})=>{},[]),vn=r.useCallbackRef(ne=>{if(!l)return;const Re=H.current.getViewFromClient(ne.clientX,ne.clientY)?.getCellCoordsFromClient(ne.clientX,ne.clientY);Re&&(l({originalEvent:ne,clientX:ne.clientX,clientY:ne.clientY,rowIndex:Re.rowIndex,colIndex:Re.colIndex}),ne.stopPropagation(),ne.preventDefault())},[l]),ut=r.useCallbackRef(ne=>{if(!(!ne.shiftKey&&(ne.ctrlKey||ne.metaKey)))return;const{deltaY:Re}=ne;return Re>0?Ne.getCommand("sheetZoomOut")?.execute():Re<0&&Ne.getCommand("sheetZoomIn")?.execute(),Re===0},[Ne]);o.useEffect(()=>{Un(null),Yt.current=null,ft.current=!1,dt(null);const ne=n?.getView().getTopLeft();Bt(ne),H.current?.scrollTo(ne),Ee(ne),me(n.getView()),He(Be(n.getView().getFreezePanes())),le(G()),A()},[n?.getView()]);const vt=o.useCallback((ne,Re)=>n.getRowHeaders().hiddenHeadersAt(ne,Re),[n]),Cn=o.useCallback((ne,Re)=>n.getColumnHeaders().hiddenHeadersAt(ne,Re),[n]),en=r.useCallbackRef(ne=>{const Re=ne.getVisibleRangeCoords();if(!Re)return null;const Ke=[];return n.getRange(Re).forEach((Ve,Ge)=>{const We=Ge.getCoords(),rt=Ge.getCell();(nt=>{if(nt.isEmpty())return!1;const tt=nt.getSpans();if(tt.width>1||tt.height>1||nt.getStyle().hasVisibleStyling()||W.isShowFormulas()&&nt.getFormula()!==null)return!0;const yt=nt.getValue();return yt!==null&&!(!W.isShowZeros()&&yt===0&&nt.getType()===d.ScalarType.Number)})(rt)&&Ke.push({coords:We,value:rt,range:W.isShowFormulas()?null:rt.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,W.isShowZeros(),W.isShowFormulas(),R]);o.useEffect(()=>{const ne=[];z&&ne.push(...z),bt&&ne.push(...bt),he.CommonUtils.isEqualArrays(ne,Yt.current)||(Yt.current=ne,Un(ne))},[z,bt,De]);const Dt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:i?.body?.text?.fill??"black"}}),[De?.header?.edgeStrokeFill]),$n=r.useCallbackRef(ne=>{ne.isDefaultPrevented()||ne.isPropagationStopped()||(F.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const ne=Ce.getMode();return ne?.key==="cut"||ne?.key==="copy"},[Ce]),yn=r.useCallbackRef(async ne=>{const Re=Ce.getMode();return ne.keyCode===r.KeyCodes.Escape&&Re?(ne.preventDefault(),void Ce.setMode(null)):ne.keyCode===r.KeyCodes.Enter&&Wn?(ne.preventDefault(),await Ne?.getCommand("paste")?.execute(),void Ce.setMode(null)):void Ne?.dispatchToFocusedCommand(ne)},[Ne,Ce]),Ht=o.useRef(null),wn=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Te+B.edgeStrokeWidth}px`,minWidth:`${Te+B.edgeStrokeWidth}px`,borderRight:`solid ${B.edgeStrokeWidth}px ${B.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2"},children:s.jsx(Oo,{ref:Ht,sheetElement:Mt.current,gridRef:H,freezeStart:xe?.[he.AnchorLocation.Top],oppositeSize:Te,containerWidth:Te,containerHeight:U,sheetHeader:n.getRowHeaders(),gridStyle:Ie,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:jt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Te+B.edgeStrokeWidth}px`,minWidth:`${Te+B.edgeStrokeWidth}px`,borderRight:`solid ${B.edgeStrokeWidth}px ${B.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[Te,u,U,n,jt,xe?.[he.AnchorLocation.Top],De,ce,l,B.fill,C]),Gn=o.useRef(null),il=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${u+B.edgeStrokeWidth}px`,minHeight:`${u+B.edgeStrokeWidth}px`,borderBottom:`solid ${B.edgeStrokeWidth}px ${B.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:s.jsx(Oo,{ref:Gn,sheetElement:Mt.current,gridRef:H,freezeStart:xe?.[he.AnchorLocation.Left],oppositeSize:u,containerWidth:N,containerHeight:u,sheetHeader:n.getColumnHeaders(),gridStyle:Ie,scrollPoint:fn,onSheetContextMenu:l,...pn,style:{...pn?.style,position:"relative",left:"0px",width:"100%",height:`${u+B.edgeStrokeWidth}px`,minHeight:`${u+B.edgeStrokeWidth}px`,borderBottom:`solid ${B.edgeStrokeWidth}px ${B.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[u,N,n,fn,xe?.[he.AnchorLocation.Left],De,B.fill,ce,l,h]),al=r.useCallbackRef(ne=>{const{value:Re,key:Ke,...Ve}=ne;let Ge=Re,We=R;if(!We||We.colIndex===ne.coords.colIndex&&We.rowIndex===ne.coords.rowIndex||(We=null),!Ge){const tt=ne.range;if(Ge=n.getRange({rowIndex:tt.rowStart,colIndex:tt.colStart}).getCell(),Ge.isEmpty())return null}let rt=null;Ge.getHyperlink()&&(rt=async tt=>{if(ve?.onLinkMouseDown?.(tt),tt.button===0&&!tt.isDefaultPrevented()){tt.stopPropagation(),tt.preventDefault();try{await Ge.getHyperlink()?.open()}catch(yt){Je.showError?.(yt)}}}),We&&We.colIndex===ne.range.colStart&&We.rowIndex===ne.range.rowStart&&(Ge=Ge.createTemporaryCell({value:null}));const nt=n.getStyles();return o.createElement(gr,{...Ve,key:Ke,bodyStyle:ke,docTheme:nt.getTheme(),normalStyle:nt.getNormal(),showFormulas:W.isShowFormulas(),showZeros:W.isShowZeros(),onLinkMouseDown:rt,...ve,value:Ge})},[n,te,ke,R,W?.isShowFormulas(),W.isShowZeros()]),sl=o.useCallback(ne=>{const{key:Re,ref:Ke,...Ve}=ne;return[s.jsx(Dl,{ref:Ke,getVisibleCells:en,sheet:n,gridStyle:De,...Ve},`border-${Re}`),s.jsx(oi,{ref:Ke,sheet:n,commands:Ne,...Ve},`table-${Re}`),s.jsx(ri,{ref:Ke,sheet:n,...Ve},`spill-${Re}`),s.jsx(_l,{ref:Ke,sheet:n,commands:Ne,onShowTooltip:oe,onCloseTooltip:de,gridStyle:De,gridRef:H,isActive:ce,...Ve},`selection-${Re}`),s.jsx(Hl,{ref:Ke,sheet:n,commands:Ne,gridStyle:De,element:ye,...Ve},`copy-paste-${Re}`),s.jsx(Ql,{ref:Ke,sheet:n,commands:Ne,target:Ae,renderMovable:D,propsMovable:{onUnFocus:()=>{Mt.current.focus()}},...Ve},`movable-${Re}`),s.jsx(ei,{ref:Ke,sheet:n,commands:Ne,gridStyle:De,getCellEditor:w,showProtectedError:st,setEditingCoords:P,...Ve},`editor-${Re}`)]},[n,H.current,De,w,Ne,Je]),[Eo,cl]=o.useState(!1),dl=o.useMemo(()=>{if(N===0||U===0)return null;const ne=n.getStyles().getNormal(),Re=ne.getFont(),Ke=ne.getFill(),Ve=ne.getBorder(),Ge=ne.getFill().getType()===d.IFill.Type.None;let We=Me,rt=Me;const nt=(yt,Tt,zt)=>zt?{stroke:Ve.getBottom().isNone()?"none":yt.getColor().toRGBA(ke.darkMode).toString(),...Tt}:Tt;rt=nt(Ve.getBottom(),rt,!Ve.getBottom().isNone()),rt=nt(Ve.getTop(),rt,!Ve.getTop().isNone()),We=nt(Ve.getRight(),We,!Ve.getRight().isNone()),We=nt(Ve.getLeft(),We,!Ve.getLeft().isNone());let tt=W?.getGridLineColor()?.toRGBA(ke.darkMode).toString()??ke.strokeFill;return Ge||(rt=nt(Ve.getBottom(),rt,!0),rt=nt(Ve.getTop(),rt,!0),We=nt(Ve.getRight(),We,!0),We=nt(Ve.getLeft(),We,!0)),s.jsx(gt.Grid,{className:"sheetxl-sheet-primary",style:{...li,...Ke.toCSS(ke.darkMode),...Re.toCSS(ke.darkMode,ue),"--sxl-app-color-background":ke.fill,"--sxl-app-color-shadow":De.colorShadow,"--sxl-app-color-grey":De.colorGrey,"--sxl-app-color-button-fill":ge.fill,"--sxl-app-color-button-text":ge.text?.fill,"--sxl-app-color-button-border":ge.edgeStrokeFill,"--sxl-app-color-primary-dark":De.selection.strokeFill},ref:H,zoom:ue,...$,onFirstRender:yt=>{cl(!0),$?.onFirstRender?.(yt),Ne?.activate()},showGridLines:fe,gridLineColor:tt,propsGridLineColumns:We,propsGridLineRows:rt,freezeLeft:xe?.[he.AnchorLocation.Left],propsFreezeLeft:Dt,freezeTop:xe?.[he.AnchorLocation.Top],propsFreezeTop:Dt,width:N,height:U,columnCount:g.width,rowCount:g.height,cursor:wt??$e??"cell",clipCells:!0,layout:te,renderCell:al,renderOverlay:sl,getCellCoordsAsRangeCoords:Ue,hiddenRowsAt:vt,hiddenColumnsAt:Cn,getVisibleCells:en,onWheelScroll:ut,onPointerDown:$n,onKeyDown:yn,onViewportChange:V,onImmediateScroll:Bt,scrollPoint:re,propsStage:{onFocus:()=>{Ne?.activate()}},renderOverlays:xt})},[_]);o.useEffect(()=>{Pe.current||A()},[te,xe,ue,Ne,re?.left,re?.top,ke,$,N,U,wt,xt,ce,$e]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};k||(_n={..._n,...I});const ul=o.useMemo(()=>{const ne=n.getStyles().getTheme(),Re=ne.getColorScheme(),Ke=ne.getFontScheme();return{"--sxl-doc-color-dk1":Re.getDk1().toCSS(ke.darkMode),"--sxl-doc-color-dk2":Re.getDk2().toCSS(ke.darkMode),"--sxl-doc-color-lt1":Re.getLt1().toCSS(ke.darkMode),"--sxl-doc-color-lt2":Re.getLt2().toCSS(ke.darkMode),"--sxl-doc-color-accent1":Re.getAccent1().toCSS(ke.darkMode),"--sxl-doc-color-accent2":Re.getAccent2().toCSS(ke.darkMode),"--sxl-doc-color-accent3":Re.getAccent3().toCSS(ke.darkMode),"--sxl-doc-color-accent4":Re.getAccent4().toCSS(ke.darkMode),"--sxl-doc-color-accent5":Re.getAccent5().toCSS(ke.darkMode),"--sxl-doc-color-accent6":Re.getAccent6().toCSS(ke.darkMode),"--sxl-doc-color-hlink":Re.getHlink().toCSS(ke.darkMode),"--sxl-doc-color-fol-hlink":Re.getFolHlink().toCSS(ke.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),Fo=r.useCallbackRef(ne=>{const{style:Re,...Ke}=ne;return s.jsx(bo,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...Re},sheet:n})},[n]);let Zn=s.jsx("div",{style:_n,onTouchStart:()=>{Ao()},onFocus:ne=>{O(!0),L?.(ne)},onBlur:ne=>{O(!1),v?.(ne)},ref:Mt,...Y,children:s.jsx("div",{className:ct("sheetxl-sheet",Sl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...ul},children:s.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[il,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${B.edgeStrokeWidth}px ${B.edgeStrokeFill}`,backgroundColor:ke.fill},ref:J,onContextMenu:vn,children:[dl,et,s.jsx(kl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:De?.selection?.strokeFill,colorCredits:De?.body?.text?.fill})]})]})]})})});k&&(Zn=s.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${B.fill}`,minHeight:2*Oe.height,minWidth:2*Oe.width,...I},viewport:ee,touchElement:H.current?.stage,disableTouch:ot,onScrollViewport:ne=>{H.current?.scrollTo(ne)},renderScrollbarHorizontal:Fo,renderScrollbarVertical:Fo,...y,children:Zn})),o.useEffect(()=>{Pe.current=!1,A?.(),b&&Mt.current?.focus()},[n]);const[Xn,gl]=o.useState(!1),Ao=r.useCallbackRef(()=>{Xn||gl(!0)},[Xn]);return o.useEffect(()=>{if(Eo)return typeof K=="function"&&K(),r.ReactUtils.detectIt().primaryInput==="touch"&&Ao(),()=>{}},[K,Eo,Xn]),Zn}));Mr.displayName="SheetElement";const Ko="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=",Tr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:h,view:c,onHide:C,onShow:k,onKeyDownCapture:y,onFocus:p,onBlur:M,loadingPanel:T,...z}=e,[D,Z]=o.useState(!1),[K,w]=o.useState(null),[L,v]=o.useState(null),[I,q]=o.useState(null);o.useEffect(()=>{v(null),l.getDetails().then(j=>{Z(!1),v(j.asUrl()),j.asSVGText?.()&&q(j.asSVGText())}).catch(j=>{console.warn(j),Z(!0),v(Ko),q(null)})},[l]);const X=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),E=o.useMemo(()=>{if(L||I)return s.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:L,onLoad:()=>{w(!0)},onError:({currentTarget:j})=>{console.log("error"),j.onerror=null,v(Ko),Z(!0)},alt:f??`${l.getType()}`})},[K,l,L,I,h]);if(!l.isClosed())return s.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:h?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...z,onKeyDownCapture:j=>{y?.(j)},ref:X,children:[K||D?void 0:T,E]})}));Tr.displayName="PictureEditor";const ai=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:p,width:M}]=Wt();if(!a.isClosed())return s.jsx("div",{...C,ref:Lt([k,y]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),si="_editable-input_1bqx6_6",ci=e=>s.jsx("input",{...e}),Ir=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:h,renderInput:c=ci,styleHover:C={},dragging:k,maxLength:y,disabled:p=!1,readOnly:M=!1,...T}=e,[z,D]=o.useState(!1),[Z,K]=o.useState(!1),[w,L]=o.useState(a);o.useEffect(()=>{L(a)},[a]);const v=o.useRef(null),[I,q]=o.useState(null),X=r.useNotifier(),E=o.useCallback(function(J){const x=J.message;I!==x&&(X?.showMessage?.(x,{type:r.NotifierType.Error}),q(x))},[X,I]),j=o.useCallback(J=>{let x=!1;try{x=l?.(J)??!0}catch(S){E(S)}return x?(v.current=null,K(!1),L(J),x):(setTimeout(()=>{v.current?.focus()},0),x)},[l]),$=r.useCallbackRef(()=>{L(a),v.current=null,K(!1),h?.()},[h,a]),ve=o.useMemo(()=>{if(!Z)return null;const J={className:ct(si),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:w,onFocus:x=>{v.current||(v.current=x.target,setTimeout(()=>{x.target?.select()},0))},onBlur:x=>{v.current&&j(w)},onChange:x=>{Z&&L(x.target.value)},onMouseDown:x=>x.stopPropagation(),onKeyDown:x=>x.code==="Escape"?(x.preventDefault(),void $()):x.code==="Enter"?(x.preventDefault(),void j(x.target.value)):void(x.code!=="Tab"?x.stopPropagation():j(x.target.value))};return s.jsx(s.Fragment,{children:c(J)})},[Z,w,j,$,c,p]),[Y,_]=o.useState();o.useLayoutEffect(()=>{let J=Object.assign({},n);(k||z)&&(J=Object.assign(J,C)),_(J)},[k,z,C,n]),o.useEffect(()=>{ve&&f?.(w)},[ve,f,w]);const A=r.useImperativeElement(t,()=>({startEdit(){p||M||K(!0)},cancel(){$()}}),[]);return s.jsxs("div",{...T,ref:A,style:{flexDirection:"column",display:"flex",...Y},className:ct(i),children:[s.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||M||K(!0)},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[s.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:Z?0:1},children:w}),ve]}),s.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...C},children:w})]})})),jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Zt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function Ct(e){var t,n;return e?Zt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=Ct(e);return e instanceof t}function gn(e){return!Zt(e)&&e instanceof Ct(e).HTMLElement}function Er(e){return e instanceof Ct(e).SVGElement}function _t(e){return e?Zt(e)?e.document:xo(e)?qo(e)?e:gn(e)||Er(e)?e.ownerDocument:document:document:document}const Rt=jn?o.useLayoutEffect:o.useEffect;function On(e){const t=o.useRef(e);return Rt(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function cn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function rn(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Fn(e){const t=On(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function An(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function hn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Fr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>{const h=Object.entries(f);for(const[c,C]of h){const k=l[c];k!=null&&(l[c]=k+e*C)}return l},{...t})}}const $t=Fr(1),dn=Fr(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Dn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=Ct(t.target);return n&&t instanceof n})(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return(function(t){return"clientX"in t&&"clientY"in t})(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),$o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function di(e){return e.matches($o)?e:e.querySelector($o)}const ui={display:"none"};function gi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:ui},n)}function hi(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 Ar=o.createContext(null),mi={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
- `},pi={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 vi(e){let{announcements:t=pi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=fi}=e;const{announce:l,announcement:f}=(function(){const[w,m]=o.useState("");return{announce:o.useCallback(M=>{M!=null&&m(M)},[]),announcement:w}})(),h=fn("DndLiveRegion"),[s,y]=o.useState(!1);if(o.useEffect(()=>{y(!0)},[]),(function(w){const m=o.useContext(Ar);o.useEffect(()=>{if(!m)throw new Error("useDndMonitor must be used within a children of <DndContext>");return m(w)},[w,m])})(o.useMemo(()=>({onDragStart(w){let{active:m}=w;l(t.onDragStart({active:m}))},onDragMove(w){let{active:m,over:M}=w;t.onDragMove&&l(t.onDragMove({active:m,over:M}))},onDragOver(w){let{active:m,over:M}=w;l(t.onDragOver({active:m,over:M}))},onDragEnd(w){let{active:m,over:M}=w;l(t.onDragEnd({active:m,over:M}))},onDragCancel(w){let{active:m,over:M}=w;l(t.onDragCancel({active:m,over:M}))}}),[l,t])),!s)return null;const b=o.createElement(o.Fragment,null,o.createElement(hi,{id:i,value:a.draggable}),o.createElement(mi,{id:h,announcement:f}));return n?Ht.createPortal(b,n):b}var mt;function Pn(){}function io(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(mt||(mt={}));const Ft=Object.freeze({x:0,y:0});function Dr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ci(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 zr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function yi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function $o(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Nr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Go(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 wi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Go(t,t.left,t.top),l=[];for(const f of i){const{id:h}=f,s=n.get(h);if(s){const y=Dr(Go(s),a);l.push({id:h,data:{droppableContainer:f,value:y}})}}return l.sort(zr)};function bi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),f=a-i,h=l-n;if(i<a&&n<l){const s=t.width*t.height,y=e.width*e.height,b=f*h;return Number((b/(s+y-b)).toFixed(4))}return 0}const xi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,h=n.get(f);if(h){const s=bi(h,t);s>0&&a.push({id:f,data:{droppableContainer:l,value:s}})}}return a.sort(yi)};function _o(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ft}function qi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>({...l,top:l.top+e*f.y,bottom:l.bottom+e*f.y,left:l.left+e*f.x,right:l.right+e*f.x}),{...t})}}const Si=qi(1);function Lr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Ri={ignoreTransform:!1};function en(e,t){t===void 0&&(t=Ri);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:y,transformOrigin:b}=xt(e).getComputedStyle(e);y&&(n=(function(w,m,M){const T=Lr(m);if(!T)return w;const{scaleX:P,scaleY:z,x:_,y:H}=T,x=w.left-_-(1-P)*parseFloat(M),B=w.top-H-(1-z)*parseFloat(M.slice(M.indexOf(" ")+1)),p=P?w.width/P:w.width,A=z?w.height/z:w.height;return{width:p,height:A,top:B,right:x+p,bottom:B+A,left:x}})(n,y,b))}const{top:i,left:a,width:l,height:f,bottom:h,right:s}=n;return{top:i,left:a,width:l,height:f,bottom:h,right:s}}function Zo(e){return en(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(!mn(a)||Er(a)||n.includes(a))return n;const l=xt(e).getComputedStyle(a);return a!==e&&(function(f,h){h===void 0&&(h=xt(f).getComputedStyle(f));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(y=>{const b=h[y];return typeof b=="string"&&s.test(b)})})(a,l)&&n.push(a),(function(f,h){return h===void 0&&(h=xt(f).getComputedStyle(f)),h.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Pr(e){const[t]=Kn(e,1);return t??null}function ao(e){return Hn&&e?Qt(e)?e:xo(e)?qo(e)||e===Jt(e).scrollingElement?window:mn(e)?e:null:null:null}function jr(e){return Qt(e)?e.scrollX:e.scrollLeft}function Or(e){return Qt(e)?e.scrollY:e.scrollTop}function go(e){return{x:jr(e),y:Or(e)}}var pt;function Br(e){return!(!Hn||!e)&&e===document.scrollingElement}function Hr(e){const t={x:0,y:0},n=Br(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pt||(pt={}));const ki={x:.2,y:.2};function Mi(e,t,n,i,a){let{top:l,left:f,right:h,bottom:s}=n;i===void 0&&(i=10),a===void 0&&(a=ki);const{isTop:y,isBottom:b,isLeft:w,isRight:m}=Hr(e),M={x:0,y:0},T={x:0,y:0},P=t.height*a.y,z=t.width*a.x;return!y&&l<=t.top+P?(M.y=pt.Backward,T.y=i*Math.abs((t.top+P-l)/P)):!b&&s>=t.bottom-P&&(M.y=pt.Forward,T.y=i*Math.abs((t.bottom-P-s)/P)),!m&&h>=t.right-z?(M.x=pt.Forward,T.x=i*Math.abs((t.right-z-h)/z)):!w&&f<=t.left+z&&(M.x=pt.Backward,T.x=i*Math.abs((t.left+z-f)/z)),{direction:M,speed:T}}function Ti(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:f}=window;return{top:0,left:0,right:l,bottom:f,width:l,height:f}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Vr(e){return e.reduce((t,n)=>Zt(t,go(n)),Ft)}function Ur(e,t){if(t===void 0&&(t=en),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Pr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ii=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+jr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Or(n),0)}]];class ho{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Kn(n),a=Vr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,h]of Ii)for(const s of f)Object.defineProperty(this,s,{get:()=>{const y=h(i),b=a[l]-y;return this.rect[s]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class sn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function so(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var Mt,Qe;function Xo(e){e.preventDefault()}function Ei(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Mt||(Mt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const Kr={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},Fi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class 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 sn(Jt(n)),this.windowListeners=new sn(xt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Mt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Ur(i),n(Ft)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Kr,coordinateGetter:f=Fi,scrollBehavior:h="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:y}=i.current,b=y?{x:y.left,y:y.top}:Ft;this.referenceCoordinates||(this.referenceCoordinates=b);const w=f(t,{active:n,context:i.current,currentCoordinates:b});if(w){const m=gn(w,b),M={x:0,y:0},{scrollableAncestors:T}=i.current;for(const P of T){const z=t.code,{isTop:_,isRight:H,isLeft:x,isBottom:B,maxScroll:p,minScroll:A}=Hr(P),S=Ti(P),U={x:Math.min(z===Qe.Right?S.right-S.width/2:S.right,Math.max(z===Qe.Right?S.left:S.left+S.width/2,w.x)),y:Math.min(z===Qe.Down?S.bottom-S.height/2:S.bottom,Math.max(z===Qe.Down?S.top:S.top+S.height/2,w.y))},D=z===Qe.Right&&!H||z===Qe.Left&&!x,j=z===Qe.Down&&!B||z===Qe.Up&&!_;if(D&&U.x!==w.x){const K=P.scrollLeft+m.x,pe=z===Qe.Right&&K<=p.x||z===Qe.Left&&K>=A.x;if(pe&&!m.y)return void P.scrollTo({left:K,behavior:h});M.x=pe?P.scrollLeft-K:z===Qe.Right?P.scrollLeft-p.x:P.scrollLeft-A.x,M.x&&P.scrollBy({left:-M.x,behavior:h});break}if(j&&U.y!==w.y){const K=P.scrollTop+m.y,pe=z===Qe.Down&&K<=p.y||z===Qe.Up&&K>=A.y;if(pe&&!m.x)return void P.scrollTo({top:K,behavior:h});M.y=pe?P.scrollTop-K:z===Qe.Down?P.scrollTop-p.y:P.scrollTop-A.y,M.y&&P.scrollBy({top:-M.y,behavior:h});break}}this.handleMove(t,Zt(gn(w,this.referenceCoordinates),M))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Yo(e){return!!(e&&"distance"in e)}function Jo(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Kr,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const h=l.activatorNode.current;return(!h||e.target===h)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(h){const{EventTarget:s}=xt(h);return h instanceof s?h:Jt(h)})(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:f}=l;this.props=t,this.events=n,this.document=Jt(f),this.documentListeners=new sn(this.document),this.listeners=new sn(i),this.windowListeners=new sn(xt(f)),this.initialCoordinates=(a=Ln(l))!=null?a:Ft,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.DragStart,Xo),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),this.windowListeners.add(Mt.ContextMenu,Xo),this.documentListeners.add(Mt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jo(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Yo(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Mt.Click,Ei,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Mt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:h}}=l;if(!a)return;const s=(n=Ln(t))!=null?n:Ft,y=gn(a,s);if(!i&&h){if(Yo(h)){if(h.tolerance!=null&&so(y,h.tolerance))return this.handleCancel();if(so(y,h.distance))return this.handleStart()}return Jo(h)&&so(y,h.tolerance)?this.handleCancel():void this.handlePending(h,y)}t.cancelable&&t.preventDefault(),f(s)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ai={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wr extends Ro{constructor(t){const{event:n}=t,i=Jt(n.target);super(t,Ai,i)}}Wr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Di={move:{name:"mousemove"},end:{name:"mouseup"}};var mo;(function(e){e[e.RightClick=2]="RightClick"})(mo||(mo={}));class $r extends Ro{constructor(t){super(t,Di,Jt(t.event.target))}}$r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==mo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Gr extends Ro{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var cn,jn;function zi(e){let{acceleration:t,activator:n=cn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:h=jn.TreeOrder,pointerCoordinates:s,scrollableAncestors:y,scrollableAncestorRects:b,delta:w,threshold:m}=e;const M=(function(A){let{delta:S,disabled:U}=A;const D=Nn(S);return an(j=>{if(U||!D||!j)return Ni;const K={x:Math.sign(S.x-D.x),y:Math.sign(S.y-D.y)};return{x:{[pt.Backward]:j.x[pt.Backward]||K.x===-1,[pt.Forward]:j.x[pt.Forward]||K.x===1},y:{[pt.Backward]:j.y[pt.Backward]||K.y===-1,[pt.Forward]:j.y[pt.Forward]||K.y===1}}},[U,S,D])})({delta:w,disabled:!l}),[T,P]=(function(){const A=o.useRef(null);return[o.useCallback((S,U)=>{A.current=setInterval(S,U)},[]),o.useCallback(()=>{A.current!==null&&(clearInterval(A.current),A.current=null)},[])]})(),z=o.useRef({x:0,y:0}),_=o.useRef({x:0,y:0}),H=o.useMemo(()=>{switch(n){case cn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case cn.DraggableRect:return a}},[n,a,s]),x=o.useRef(null),B=o.useCallback(()=>{const A=x.current;if(!A)return;const S=z.current.x*_.current.x,U=z.current.y*_.current.y;A.scrollBy(S,U)},[]),p=o.useMemo(()=>h===jn.TreeOrder?[...y].reverse():y,[h,y]);o.useEffect(()=>{if(l&&y.length&&H){for(const A of p){if(i?.(A)===!1)continue;const S=y.indexOf(A),U=b[S];if(!U)continue;const{direction:D,speed:j}=Mi(A,U,H,t,m);for(const K of["x","y"])M[K][D[K]]||(j[K]=0,D[K]=0);if(j.x>0||j.y>0)return P(),x.current=A,T(B,f),z.current=j,void(_.current=D)}z.current={x:0,y:0},_.current={x:0,y:0},P()}else P()},[t,B,i,P,l,f,JSON.stringify(H),JSON.stringify(M),T,y,p,b,JSON.stringify(m)])}Gr.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"})(cn||(cn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jn||(jn={}));const Ni={x:{[pt.Backward]:!1,[pt.Forward]:!1},y:{[pt.Backward]:!1,[pt.Forward]:!1}};var hn,fo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),(function(e){e.Optimized="optimized"})(fo||(fo={}));const Qo=new Map;function po(e,t){return an(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function On(e){let{callback:t,disabled:n}=e;const i=Vn(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 Li(e){return new ho(en(e),e)}function er(e,t,n){t===void 0&&(t=Li);const[i,a]=o.useState(null);function l(){a(s=>{if(!e)return null;var y;if(e.isConnected===!1)return(y=s??n)!=null?y:null;const b=t(e);return JSON.stringify(s)===JSON.stringify(b)?s:b})}const f=(function(s){let{callback:y,disabled:b}=s;const w=Vn(y),m=o.useMemo(()=>{if(b||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:M}=window;return new M(w)},[w,b]);return o.useEffect(()=>()=>m?.disconnect(),[m]),m})({callback(s){if(e)for(const y of s){const{type:b,target:w}=y;if(b==="childList"&&w instanceof HTMLElement&&w.contains(e)){l();break}}}}),h=On({callback:l});return Et(()=>{l(),e?(h?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),f?.disconnect())},[e]),i}const tr=[];function nr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Ft;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Ft}function or(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 rr=[];function _r(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const Pi=[{sensor:Wr,options:{}},{sensor:So,options:{}}],ji={current:{}},En={draggable:{measure:Zo},droppable:{measure:Zo,strategy:hn.WhileDragging,frequency:fo.Optimized},dragOverlay:{measure:en}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Oi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:En,measureDroppableContainers:Pn,windowRect:null,measuringScheduled:!1},Zr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pn,draggableNodes:new Map,over:null,measureDroppableContainers:Pn},pn=o.createContext(Zr),Xr=o.createContext(Oi);function Bi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function Hi(e,t){switch(t.type){case mt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case mt.DragEnd:case mt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mt.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case mt.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const f=new dn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case mt.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Vi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Nn(i),f=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!Un(l)||document.activeElement===l.target)return;const h=a.get(f);if(!h)return;const{activatorNode:s,node:y}=h;if(!s.current&&!y.current)return;requestAnimationFrame(()=>{for(const b of[s.current,y.current]){if(!b)continue;const w=ui(b);if(w){w.focus();break}}})}},[i,t,a,f,l]),null}function Yr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Wn=o.createContext({...Ft,scaleX:1,scaleY:1});var Pt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pt||(Pt={}));const Ui=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:h=!0,children:s,sensors:y=Pi,collisionDetection:b=xi,measuring:w,modifiers:m,...M}=e;const T=o.useReducer(Hi,void 0,Bi),[P,z]=T,[_,H]=(function(){const[u]=o.useState(()=>new Set),q=o.useCallback(E=>(u.add(E),()=>u.delete(E)),[u]);return[o.useCallback(E=>{let{type:le,event:fe}=E;u.forEach(ce=>{var ne;return(ne=ce[le])==null?void 0:ne.call(ce,fe)})},[u]),q]})(),[x,B]=o.useState(Pt.Uninitialized),p=x===Pt.Initialized,{draggable:{active:A,nodes:S,translate:U},droppable:{containers:D}}=P,j=A!=null?S.get(A):null,K=o.useRef({initial:null,translated:null}),pe=o.useMemo(()=>{var u;return A!=null?{id:A,data:(u=j?.data)!=null?u:ji,rect:K}:null},[A,j]),Z=o.useRef(null),[V,N]=o.useState(null),[F,k]=o.useState(null),O=un(M,Object.values(M)),ee=fn("DndDescribedBy",l),oe=o.useMemo(()=>D.getEnabled(),[D]),be=(he=w,o.useMemo(()=>({draggable:{...En.draggable,...he?.draggable},droppable:{...En.droppable,...he?.droppable},dragOverlay:{...En.dragOverlay,...he?.dragOverlay}}),[he?.draggable,he?.droppable,he?.dragOverlay]));var he;const{droppableRects:Ee,measureDroppableContainers:Ae,measuringScheduled:We}=(function(u,q){let{dragging:E,dependencies:le,config:fe}=q;const[ce,ne]=o.useState(null),{frequency:ae,measure:ue,strategy:ye}=fe,Be=o.useRef(u),Ie=(function(){switch(ye){case hn.Always:return!1;case hn.BeforeDragging:return E;default:return!E}})(),Fe=un(Ie),Ue=o.useCallback(function(Ye){Ye===void 0&&(Ye=[]),Fe.current||ne(Je=>Je===null?Ye:Je.concat(Ye.filter(je=>!Je.includes(je))))},[Fe]),_e=o.useRef(null),$e=an(Ye=>{if(Ie&&!E)return Qo;if(!Ye||Ye===Qo||Be.current!==u||ce!=null){const Je=new Map;for(let je of u){if(!je)continue;if(ce&&ce.length>0&&!ce.includes(je.id)&&je.rect.current){Je.set(je.id,je.rect.current);continue}const Xe=je.node.current,vt=Xe?new ho(ue(Xe),Xe):null;je.rect.current=vt,vt&&Je.set(je.id,vt)}return Je}return Ye},[u,ce,E,Ie,ue]);return o.useEffect(()=>{Be.current=u},[u]),o.useEffect(()=>{Ie||Ue()},[E,Ie]),o.useEffect(()=>{ce&&ce.length>0&&ne(null)},[JSON.stringify(ce)]),o.useEffect(()=>{Ie||typeof ae!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ue(),_e.current=null},ae))},[ae,Ie,Ue,...le]),{droppableRects:$e,measureDroppableContainers:Ue,measuringScheduled:ce!=null}})(oe,{dragging:p,dependencies:[U.x,U.y],config:be.droppable}),ve=(function(u,q){const E=q!=null?u.get(q):void 0,le=E?E.node.current:null;return an(fe=>{var ce;return q==null?null:(ce=le??fe)!=null?ce:null},[le,q])})(S,A),He=o.useMemo(()=>F?Ln(F):null,[F]),Y=(function(){const u=V?.autoScrollEnabled===!1,q=typeof h=="object"?h.enabled===!1:h===!1,E=p&&!u&&!q;return typeof h=="object"?{...h,enabled:E}:{enabled:E}})(),X=(function(u,q){return po(u,q)})(ve,be.draggable.measure);(function(u){let{activeNode:q,measure:E,initialRect:le,config:fe=!0}=u;const ce=o.useRef(!1),{x:ne,y:ae}=typeof fe=="boolean"?{x:fe,y:fe}:fe;Et(()=>{if(!ne&&!ae||!q)return void(ce.current=!1);if(ce.current||!le)return;const ue=q?.node.current;if(!ue||ue.isConnected===!1)return;const ye=_o(E(ue),le);if(ne||(ye.x=0),ae||(ye.y=0),ce.current=!0,Math.abs(ye.x)>0||Math.abs(ye.y)>0){const Be=Pr(ue);Be&&Be.scrollBy({top:ye.y,left:ye.x})}},[q,ne,ae,le,E])})({activeNode:A!=null?S.get(A):null,config:Y.layoutShiftCompensation,initialRect:X,measure:be.draggable.measure});const de=er(ve,be.draggable.measure,X),Me=er(ve?ve.parentElement:null),G=o.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:Ee,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),W=D.getNodeFor((t=G.current.over)==null?void 0:t.id),re=(function(u){let{measure:q}=u;const[E,le]=o.useState(null),fe=On({callback:o.useCallback(ue=>{for(const{target:ye}of ue)if(mn(ye)){le(Be=>{const Ie=q(ye);return Be?{...Be,width:Ie.width,height:Ie.height}:Ie});break}},[q])}),ce=o.useCallback(ue=>{const ye=_r(ue);fe?.disconnect(),ye&&fe?.observe(ye),le(ye?q(ye):null)},[q,fe]),[ne,ae]=zn(ce);return o.useMemo(()=>({nodeRef:ne,rect:E,setRef:ae}),[E,ne,ae])})({measure:be.dragOverlay.measure}),me=(n=re.nodeRef.current)!=null?n:ve,se=p?(i=re.rect)!=null?i:de:null,Se=!!(re.nodeRef.current&&re.rect),ie=_o(we=Se?null:de,po(we));var we;const ke=or(me?xt(me):null),Re=(function(u){const q=o.useRef(u),E=an(le=>u?le&&le!==tr&&u&&q.current&&u.parentNode===q.current.parentNode?le:Kn(u):tr,[u]);return o.useEffect(()=>{q.current=u},[u]),E})(p?W??ve:null),Le=(function(u,q){q===void 0&&(q=en);const[E]=u,le=or(E?xt(E):null),[fe,ce]=o.useState(rr);function ne(){ce(()=>u.length?u.map(ue=>Br(ue)?le:new ho(q(ue),ue)):rr)}const ae=On({callback:ne});return Et(()=>{ae?.disconnect(),ne(),u.forEach(ue=>ae?.observe(ue))},[u]),fe})(Re),Ne=Yr(m,{transform:{x:U.x-ie.x,y:U.y-ie.y,scaleX:1,scaleY:1},activatorEvent:F,active:pe,activeNodeRect:de,containerNodeRect:Me,draggingNodeRect:se,over:G.current.over,overlayNodeRect:re.rect,scrollableAncestors:Re,scrollableAncestorRects:Le,windowRect:ke}),v=He?Zt(He,U):null,Oe=(function(u){const[q,E]=o.useState(null),le=o.useRef(u),fe=o.useCallback(ce=>{const ne=ao(ce.target);ne&&E(ae=>ae?(ae.set(ne,go(ne)),new Map(ae)):null)},[]);return o.useEffect(()=>{const ce=le.current;if(u!==ce){ne(ce);const ae=u.map(ue=>{const ye=ao(ue);return ye?(ye.addEventListener("scroll",fe,{passive:!0}),[ye,go(ye)]):null}).filter(ue=>ue!=null);E(ae.length?new Map(ae):null),le.current=u}return()=>{ne(u),ne(ce)};function ne(ae){ae.forEach(ue=>{const ye=ao(ue);ye?.removeEventListener("scroll",fe)})}},[fe,u]),o.useMemo(()=>u.length?q?Array.from(q.values()).reduce((ce,ne)=>Zt(ce,ne),Ft):Vr(u):Ft,[u,q])})(Re),tt=nr(Oe),te=nr(Oe,[de]),Te=Zt(Ne,tt),Pe=se?Si(se,Ne):null,ze=pe&&Pe?b({active:pe,collisionRect:Pe,droppableRects:Ee,droppableContainers:oe,pointerCoordinates:v}):null,De=Nr(ze,"id"),[I,Q]=o.useState(null),L=(function(u,q,E){return{...u,scaleX:q&&E?q.width/E.width:1,scaleY:q&&E?q.height/E.height:1}})(Se?Ne:Zt(Ne,te),(a=I?.rect)!=null?a:null,de),$=o.useRef(null),xe=o.useCallback((u,q)=>{let{sensor:E,options:le}=q;if(Z.current==null)return;const fe=S.get(Z.current);if(!fe)return;const ce=u.nativeEvent,ne=new E({active:Z.current,activeNode:fe,event:ce,options:le,context:G,onAbort(ue){if(!S.get(ue))return;const{onDragAbort:ye}=O.current,Be={id:ue};ye?.(Be),_({type:"onDragAbort",event:Be})},onPending(ue,ye,Be,Ie){if(!S.get(ue))return;const{onDragPending:Fe}=O.current,Ue={id:ue,constraint:ye,initialCoordinates:Be,offset:Ie};Fe?.(Ue),_({type:"onDragPending",event:Ue})},onStart(ue){const ye=Z.current;if(ye==null)return;const Be=S.get(ye);if(!Be)return;const{onDragStart:Ie}=O.current,Fe={activatorEvent:ce,active:{id:ye,data:Be.data,rect:K}};Ht.unstable_batchedUpdates(()=>{Ie?.(Fe),B(Pt.Initializing),z({type:mt.DragStart,initialCoordinates:ue,active:ye}),_({type:"onDragStart",event:Fe}),N($.current),k(ce)})},onMove(ue){z({type:mt.DragMove,coordinates:ue})},onEnd:ae(mt.DragEnd),onCancel:ae(mt.DragCancel)});function ae(ue){return async function(){const{active:ye,collisions:Be,over:Ie,scrollAdjustedTranslate:Fe}=G.current;let Ue=null;if(ye&&Fe){const{cancelDrop:_e}=O.current;Ue={activatorEvent:ce,active:ye,collisions:Be,delta:Fe,over:Ie},ue===mt.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ue))&&(ue=mt.DragCancel)}Z.current=null,Ht.unstable_batchedUpdates(()=>{z({type:ue}),B(Pt.Uninitialized),Q(null),N(null),k(null),$.current=null;const _e=ue===mt.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const $e=O.current[_e];$e?.(Ue),_({type:_e,event:Ue})}})}}$.current=ne},[S]),Ce=o.useCallback((u,q)=>(E,le)=>{const fe=E.nativeEvent,ce=S.get(le);if(Z.current!==null||!ce||fe.dndKit||fe.defaultPrevented)return;const ne={active:ce};u(E,q.options,ne)===!0&&(fe.dndKit={capturedBy:q.sensor},Z.current=le,xe(E,q))},[S,xe]),g=(function(u,q){return o.useMemo(()=>u.reduce((E,le)=>{const{sensor:fe}=le;return[...E,...fe.activators.map(ce=>({eventName:ce.eventName,handler:q(ce.handler,le)}))]},[]),[u,q])})(y,Ce);(function(u){o.useEffect(()=>{if(!Hn)return;const q=u.map(E=>{let{sensor:le}=E;return le.setup==null?void 0:le.setup()});return()=>{for(const E of q)E?.()}},u.map(q=>{let{sensor:E}=q;return E}))})(y),Et(()=>{de&&x===Pt.Initializing&&B(Pt.Initialized)},[de,x]),o.useEffect(()=>{const{onDragMove:u}=O.current,{active:q,activatorEvent:E,collisions:le,over:fe}=G.current;if(!q||!E)return;const ce={active:q,activatorEvent:E,collisions:le,delta:{x:Te.x,y:Te.y},over:fe};Ht.unstable_batchedUpdates(()=>{u?.(ce),_({type:"onDragMove",event:ce})})},[Te.x,Te.y]),o.useEffect(()=>{const{active:u,activatorEvent:q,collisions:E,droppableContainers:le,scrollAdjustedTranslate:fe}=G.current;if(!u||Z.current==null||!q||!fe)return;const{onDragOver:ce}=O.current,ne=le.get(De),ae=ne&&ne.rect.current?{id:ne.id,rect:ne.rect.current,data:ne.data,disabled:ne.disabled}:null,ue={active:u,activatorEvent:q,collisions:E,delta:{x:fe.x,y:fe.y},over:ae};Ht.unstable_batchedUpdates(()=>{Q(ae),ce?.(ue),_({type:"onDragOver",event:ue})})},[De]),Et(()=>{G.current={activatorEvent:F,active:pe,activeNode:ve,collisionRect:Pe,collisions:ze,droppableRects:Ee,draggableNodes:S,draggingNode:me,draggingNodeRect:se,droppableContainers:D,over:I,scrollableAncestors:Re,scrollAdjustedTranslate:Te},K.current={initial:se,translated:Pe}},[pe,ve,ze,Pe,S,me,se,Ee,D,I,Re,Te]),zi({...Y,delta:U,draggingRect:Pe,pointerCoordinates:v,scrollableAncestors:Re,scrollableAncestorRects:Le});const C=o.useMemo(()=>({active:pe,activeNode:ve,activeNodeRect:de,activatorEvent:F,collisions:ze,containerNodeRect:Me,dragOverlay:re,draggableNodes:S,droppableContainers:D,droppableRects:Ee,over:I,measureDroppableContainers:Ae,scrollableAncestors:Re,scrollableAncestorRects:Le,measuringConfiguration:be,measuringScheduled:We,windowRect:ke}),[pe,ve,de,F,ze,Me,re,S,D,Ee,I,Ae,Re,Le,be,We,ke]),R=o.useMemo(()=>({activatorEvent:F,activators:g,active:pe,activeNodeRect:de,ariaDescribedById:{draggable:ee},dispatch:z,draggableNodes:S,over:I,measureDroppableContainers:Ae}),[F,g,pe,de,z,ee,S,I,Ae]);return o.createElement(Ar.Provider,{value:H},o.createElement(pn.Provider,{value:R},o.createElement(Xr.Provider,{value:C},o.createElement(Wn.Provider,{value:L},s)),o.createElement(Vi,{disabled:f?.restoreFocus===!1})),o.createElement(vi,{...f,hiddenTextDescribedById:ee}))}),Ki=o.createContext(null),lr="button";function Wi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:f,activatorEvent:h,active:s,activeNodeRect:y,ariaDescribedById:b,draggableNodes:w,over:m}=o.useContext(pn),{role:M=lr,roleDescription:T="draggable",tabIndex:P=0}=a??{},z=s?.id===t,_=o.useContext(z?Wn:Ki),[H,x]=zn(),[B,p]=zn(),A=(function(U,D){return o.useMemo(()=>U.reduce((j,K)=>{let{eventName:pe,handler:Z}=K;return j[pe]=V=>{Z(V,D)},j},{}),[U,D])})(f,t),S=un(n);return Et(()=>(w.set(t,{id:t,key:l,node:H,activatorNode:B,data:S}),()=>{const U=w.get(t);U&&U.key===l&&w.delete(t)}),[w,t]),{active:s,activatorEvent:h,activeNodeRect:y,attributes:o.useMemo(()=>({role:M,tabIndex:P,"aria-disabled":i,"aria-pressed":!(!z||M!==lr)||void 0,"aria-roledescription":T,"aria-describedby":b.draggable}),[i,M,P,z,T,b.draggable]),isDragging:z,listeners:i?void 0:A,node:H,over:m,setNodeRef:x,setActivatorNodeRef:p,transform:_}}function Jr(){return o.useContext(Xr)}const $i={timeout:25};function Gi(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),h=Nn(n);return n||i||!h||a(h),Et(()=>{if(!l)return;const s=i?.key,y=i?.props.id;s!=null&&y!=null?Promise.resolve(t(y,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const _i={x:0,y:0,scaleX:1,scaleY:1};function Zi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Zr},o.createElement(Wn.Provider,{value:_i},t))}const Xi={position:"fixed",touchAction:"none"},Yi=e=>Un(e)?"transform 250ms ease":void 0,Ji=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:h,style:s,transform:y,transition:b=Yi}=e;if(!h)return null;const w=a?y:{...y,scaleX:1,scaleY:1},m={...Xi,width:h.width,height:h.height,top:h.top,left:h.left,transform:Vt.Transform.toString(w),transformOrigin:a&&i?Ci(i,h):void 0,transition:typeof b=="function"?b(i):b,...s};return o.createElement(n,{className:f,style:m,ref:t},l)}),Qi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[h,s]of Object.entries(l.active))s!==void 0&&(a[h]=n.node.style.getPropertyValue(h),n.node.style.setProperty(h,s));if(l!=null&&l.dragOverlay)for(const[h,s]of Object.entries(l.dragOverlay))s!==void 0&&i.node.style.setProperty(h,s);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[h,s]of Object.entries(a))n.node.style.setProperty(h,s);f!=null&&f.active&&n.node.classList.remove(f.active)}},Qr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vt.Transform.toString(t)},{transform:Vt.Transform.toString(n)}]},sideEffects:Qi({styles:{active:{opacity:"0"}}})};function ea(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Vn((l,f)=>{if(t===null)return;const h=n.get(l);if(!h)return;const s=h.node.current;if(!s)return;const y=_r(f);if(!y)return;const{transform:b}=xt(f).getComputedStyle(f),w=Lr(b);if(!w)return;const m=typeof t=="function"?t:(function(M){const{duration:T,easing:P,sideEffects:z,keyframes:_}={...Qr,...M};return H=>{let{active:x,dragOverlay:B,transform:p,...A}=H;if(!T)return;const S={x:B.rect.left-x.rect.left,y:B.rect.top-x.rect.top},U={scaleX:p.scaleX!==1?x.rect.width*p.scaleX/B.rect.width:1,scaleY:p.scaleY!==1?x.rect.height*p.scaleY/B.rect.height:1},D={x:p.x-S.x,y:p.y-S.y,...U},j=_({...A,active:x,dragOverlay:B,transform:{initial:p,final:D}}),[K]=j,pe=j[j.length-1];if(JSON.stringify(K)===JSON.stringify(pe))return;const Z=z?.({active:x,dragOverlay:B,...A}),V=B.node.animate(j,{duration:T,easing:P,fill:"forwards"});return new Promise(N=>{V.onfinish=()=>{Z?.(),N()}})}})(t);return Ur(s,a.draggable.measure),m({active:{id:l,data:h.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(y)},droppableContainers:i,measuringConfiguration:a,transform:w})})}let ir=0;function ta(e){return o.useMemo(()=>{if(e!=null)return ir++,ir},[e])}const na=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:h="div",className:s,zIndex:y=999}=e;const{activatorEvent:b,active:w,activeNodeRect:m,containerNodeRect:M,draggableNodes:T,droppableContainers:P,dragOverlay:z,over:_,measuringConfiguration:H,scrollableAncestors:x,scrollableAncestorRects:B,windowRect:p}=Jr(),A=o.useContext(Wn),S=ta(w?.id),U=Yr(f,{activatorEvent:b,active:w,activeNodeRect:m,containerNodeRect:M,draggingNodeRect:z.rect,over:_,overlayNodeRect:z.rect,scrollableAncestors:x,scrollableAncestorRects:B,transform:A,windowRect:p}),D=po(m),j=ea({config:i,draggableNodes:T,droppableContainers:P,measuringConfiguration:H}),K=D?z.setRef:void 0;return o.createElement(Zi,null,o.createElement(Gi,{animation:j},w&&S?o.createElement(Ji,{key:S,id:w.id,ref:K,as:h,activatorEvent:b,adjustScale:t,className:s,transition:l,rect:D,style:{zIndex:y,...a},transform:U},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 oa(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Tn(e){return e!==null&&e>=0}const In={scaleX:1,scaleY:1},ra=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const h=(t=n[a])!=null?t:i;if(!h)return null;const s=(function(y,b,w){const m=y[b],M=y[b-1],T=y[b+1];return!m||!M&&!T?0:w<b?M?m.left-(M.left+M.width):T.left-(m.left+m.width):T?T.left-(m.left+m.width):m.left-(M.left+M.width)})(n,f,a);if(f===a){const y=n[l];return y?{x:a<l?y.left+y.width-(h.left+h.width):y.left-h.left,y:0,...In}:null}return f>a&&f<=l?{x:-h.width-s,y:0,...In}:f<a&&f>=l?{x:h.width+s,y:0,...In}:{x:0,y:0,...In}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),f=t[a],h=l[a];return h&&f?{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}:null},el="Sortable",tl=o.createContext({activeIndex:-1,containerId:el,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function la(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:f,dragOverlay:h,droppableRects:s,over:y,measureDroppableContainers:b}=Jr(),w=fn(el,n),m=h.rect!==null,M=o.useMemo(()=>i.map(A=>typeof A=="object"&&"id"in A?A.id:A),[i]),T=f!=null,P=f?M.indexOf(f.id):-1,z=y?M.indexOf(y.id):-1,_=o.useRef(M),H=!(function(A,S){if(A===S)return!0;if(A.length!==S.length)return!1;for(let U=0;U<A.length;U++)if(A[U]!==S[U])return!1;return!0})(M,_.current),x=z!==-1&&P===-1||H,B=(function(A){return typeof A=="boolean"?{draggable:A,droppable:A}:A})(l);Et(()=>{H&&T&&b(M)},[H,M,T,b]),o.useEffect(()=>{_.current=M},[M]);const p=o.useMemo(()=>({activeIndex:P,containerId:w,disabled:B,disableTransforms:x,items:M,overIndex:z,useDragOverlay:m,sortedRects:oa(M,s),strategy:a}),[P,w,B.draggable,B.droppable,x,M,z,s,m,a]);return o.createElement(tl.Provider,{value:p},t)}const ia=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},aa=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:h,previousContainerId:s,transition:y}=e;return!(!y||!i)&&(h===l||a!==f)&&(!!n||f!==a&&t===s)},sa={duration:200,easing:"ease"},nl="transform",ca=Vt.Transition.toString({property:nl,duration:0,easing:"linear"}),da={roleDescription:"sortable"};function ua(e){let{animateLayoutChanges:t=aa,attributes:n,disabled:i,data:a,getNewIndex:l=ia,id:f,strategy:h,resizeObserverConfig:s,transition:y=sa}=e;const{items:b,containerId:w,activeIndex:m,disabled:M,disableTransforms:T,sortedRects:P,overIndex:z,useDragOverlay:_,strategy:H}=o.useContext(tl),x=(function(W,re){var me,se;return typeof W=="boolean"?{draggable:W,droppable:!1}:{draggable:(me=W?.draggable)!=null?me:re.draggable,droppable:(se=W?.droppable)!=null?se:re.droppable}})(i,M),B=b.indexOf(f),p=o.useMemo(()=>({sortable:{containerId:w,index:B,items:b},...a}),[w,a,B,b]),A=o.useMemo(()=>b.slice(b.indexOf(f)),[b,f]),{rect:S,node:U,isOver:D,setNodeRef:j}=(function(W){let{data:re,disabled:me=!1,id:se,resizeObserverConfig:Se}=W;const ie=fn("Droppable"),{active:we,dispatch:ke,over:Re,measureDroppableContainers:Le}=o.useContext(pn),Ne=o.useRef({disabled:me}),v=o.useRef(!1),Oe=o.useRef(null),tt=o.useRef(null),{disabled:te,updateMeasurementsFor:Te,timeout:Pe}={...$i,...Se},ze=un(Te??se),De=On({callback:o.useCallback(()=>{v.current?(tt.current!=null&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Le(Array.isArray(ze.current)?ze.current:[ze.current]),tt.current=null},Pe)):v.current=!0},[Pe]),disabled:te||!we}),I=o.useCallback((xe,Ce)=>{De&&(Ce&&(De.unobserve(Ce),v.current=!1),xe&&De.observe(xe))},[De]),[Q,L]=zn(I),$=un(re);return o.useEffect(()=>{De&&Q.current&&(De.disconnect(),v.current=!1,De.observe(Q.current))},[Q,De]),o.useEffect(()=>(ke({type:mt.RegisterDroppable,element:{id:se,key:ie,disabled:me,node:Q,rect:Oe,data:$}}),()=>ke({type:mt.UnregisterDroppable,key:ie,id:se})),[se]),o.useEffect(()=>{me!==Ne.current.disabled&&(ke({type:mt.SetDroppableDisabled,id:se,key:ie,disabled:me}),Ne.current.disabled=me)},[se,ie,me,ke]),{active:we,rect:Oe,isOver:Re?.id===se,node:Q,over:Re,setNodeRef:L}})({id:f,data:p,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...s}}),{active:K,activatorEvent:pe,activeNodeRect:Z,attributes:V,setNodeRef:N,listeners:F,isDragging:k,over:O,setActivatorNodeRef:ee,transform:oe}=Wi({id:f,data:p,attributes:{...da,...n},disabled:x.draggable}),be=(function(){for(var W=arguments.length,re=new Array(W),me=0;me<W;me++)re[me]=arguments[me];return o.useMemo(()=>se=>{re.forEach(Se=>Se(se))},re)})(j,N),he=!!K,Ee=he&&!T&&Tn(m)&&Tn(z),Ae=!_&&k,We=Ae&&Ee?oe:null,ve=Ee?We??(h??H)({rects:P,activeNodeRect:Z,activeIndex:m,overIndex:z,index:B}):null,He=Tn(m)&&Tn(z)?l({id:f,items:b,activeIndex:m,overIndex:z}):B,Y=K?.id,X=o.useRef({activeId:Y,items:b,newIndex:He,containerId:w}),de=b!==X.current.items,Me=t({active:K,containerId:w,isDragging:k,isSorting:he,id:f,index:B,items:b,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:y,wasDragging:X.current.activeId!=null}),G=(function(W){let{disabled:re,index:me,node:se,rect:Se}=W;const[ie,we]=o.useState(null),ke=o.useRef(me);return Et(()=>{if(!re&&me!==ke.current&&se.current){const Re=Se.current;if(Re){const Le=en(se.current,{ignoreTransform:!0}),Ne={x:Re.left-Le.left,y:Re.top-Le.top,scaleX:Re.width/Le.width,scaleY:Re.height/Le.height};(Ne.x||Ne.y)&&we(Ne)}}me!==ke.current&&(ke.current=me)},[re,me,se,Se]),o.useEffect(()=>{ie&&we(null)},[ie]),ie})({disabled:!Me,index:B,node:U,rect:S});return o.useEffect(()=>{he&&X.current.newIndex!==He&&(X.current.newIndex=He),w!==X.current.containerId&&(X.current.containerId=w),b!==X.current.items&&(X.current.items=b)},[he,He,w,b]),o.useEffect(()=>{if(Y===X.current.activeId)return;if(Y!=null&&X.current.activeId==null)return void(X.current.activeId=Y);const W=setTimeout(()=>{X.current.activeId=Y},50);return()=>clearTimeout(W)},[Y]),{active:K,activeIndex:m,attributes:V,data:p,rect:S,index:B,newIndex:He,items:b,isOver:D,isSorting:he,isDragging:k,listeners:F,node:U,overIndex:z,over:O,setNodeRef:be,setActivatorNodeRef:ee,setDroppableNodeRef:j,setDraggableNodeRef:N,transform:G??ve,transition:(function(){if(G||de&&X.current.newIndex===B)return ca;if(!(Ae&&!Un(pe)||!y)&&(he||Me))return Vt.Transition.toString({...y,property:nl})})()}}function Bn(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 ga=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],ha=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:h}}=t;if(ga.includes(e.code)){if(e.preventDefault(),!n||!i)return;const s=[];l.getEnabled().forEach(w=>{if(!w||w!=null&&w.disabled)return;const m=a.get(w.id);if(m)switch(e.code){case Qe.Down:i.top<m.top&&s.push(w);break;case Qe.Up:i.top>m.top&&s.push(w);break;case Qe.Left:i.left>m.left&&s.push(w);break;case Qe.Right:i.left<m.left&&s.push(w)}});const y=(w=>{let{collisionRect:m,droppableRects:M,droppableContainers:T}=w;const P=$o(m),z=[];for(const _ of T){const{id:H}=_,x=M.get(H);if(x){const B=$o(x),p=P.reduce((S,U,D)=>S+Dr(B[D],U),0),A=Number((p/4).toFixed(4));z.push({id:H,data:{droppableContainer:_,value:A}})}}return z.sort(zr)})({collisionRect:i,droppableRects:a,droppableContainers:s});let b=Nr(y,"id");if(b===f?.id&&y.length>1&&(b=y[1].id),b!=null){const w=l.get(n.id),m=l.get(b),M=m?a.get(m.id):null,T=m?.node.current;if(T&&M&&w&&m){const P=Kn(T).some((B,p)=>h[p]!==B),z=ar(w,m),_=(function(B,p){return!Bn(B)||!Bn(p)||!ar(B,p)?!1:B.data.current.sortable.index<p.data.current.sortable.index})(w,m),H=P||!z?{x:0,y:0}:{x:_?i.width-M.width:0,y:_?i.height-M.height:0},x={x:M.left,y:M.top};return H.x&&H.y?x:gn(x,H)}}}};function ar(e,t){return!(!Bn(e)||!Bn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ma=e=>{let{transform:t}=e;return{...t,y:0}},ol=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:h,selectedIndex:s,background:y,activeColor:b,borderColor:w,borderWidth:m,dragging:M,...T}=e;return c.jsxs("div",{ref:t,className:dt(a),style:{...i,display:"flex",flexDirection:"column",background:s===l?"white":y,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...T,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:s===l?"0px":"-1px",marginTop:s===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:s===l&&b?b?.toCSS():"none",minHeight:"2px"}})]})})),It={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},To=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:h,listeners:s,onRemove:y,renderItem:b,sorting:w,style:m,transition:M,transform:T,value:P,wrapperStyle:z,..._},H)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const x=b?b({dragOverlay:!!t,dragging:!!n,sorting:!!w,index:h,fadeIn:!!a,listeners:s,ref:H,style:m,transform:T,transition:M,value:P}):c.jsx(c.Fragment,{children:P});return c.jsx("div",{className:dt("tab-item",It.Wrapper,a&&It.fadeIn,w&&It.sorting,t&&It.dragOverlay),style:{...z,transition:[M,z?.transition].filter(Boolean).join(", "),"--translate-x":T?`${Math.round(T.x)}px`:void 0,"--translate-y":T?`${Math.round(T.y)}px`:void 0,"--scale-x":T?.scaleX?`${T.scaleX}`:void 0,"--scale-y":T?.scaleY?`${T.scaleY}`:void 0,"--index":h},ref:H,children:c.jsx("div",{className:dt(It.Item,n&&It.dragging,l&&It.withHandle,t&&It.dragOverlay,i&&It.disabled,e&&It.color,"dragging"),style:m,"data-cypress":"draggable-item",...l?void 0:s,..._,tabIndex:l?void 0:-1,children:x})})})),sr={Row:"_Row_1kr10_1"},rl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:dt(sr.Row,t&&sr.horizontal),children:e}))),fa={...Qr},pa=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=wi,coordinateGetter:h=ha,dropAnimation:s=fa,getItemStyles:y=()=>({}),getNewIndex:b,handle:w=!1,items:m,onMove:M,isDisabled:T=()=>!1,measuring:P,modifiers:z,renderItem:_,renderDivider:H,reorderItems:x=ko,strategy:B=Mo,style:p,useDragOverlay:A=!0,onDragStart:S,wrapperStyle:U=()=>({})}=e,[D,j]=o.useState(()=>m);o.useEffect(()=>{j(m)},[m]);const[K,pe]=o.useState(null),Z=(function(){for(var O=arguments.length,ee=new Array(O),oe=0;oe<O;oe++)ee[oe]=arguments[oe];return o.useMemo(()=>[...ee].filter(be=>be!=null),[...ee])})(io($r,{activationConstraint:i}),io(Gr,{activationConstraint:i}),io(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:h})),V=D.indexOf.bind(D),N=K?V(K):-1,F=[];D.map((O,ee)=>{F.push(c.jsx(va,{id:O,handle:w,index:ee,style:y,wrapperStyle:U,disabled:T(O),renderItem:_,animateLayoutChanges:a,useDragOverlay:A,getNewIndex:b},O+"-"+ee));const oe=H?.({key:"divider-"+ee});oe&&F.push(oe)});const{getPortalContainer:k}=r.useFullscreenPortal();return c.jsxs(Ui,{sensors:Z,collisionDetection:f,onDragStart:O=>{const{active:ee}=O;ee&&(S?.(O),pe(ee.id))},autoScroll:{canScroll:O=>!0},onDragEnd:O=>{if(pe(null),O.over){const ee=V(O.over.id);N!==ee&&(j(oe=>x(oe,N,ee)),M?.(N,ee))}},onDragCancel:()=>{pe(null)},measuring:P,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...p},className:dt(n,It.Wrapper),children:c.jsx(la,{items:D,strategy:B,children:c.jsx(rl,{ref:t,children:F})})}),A?Ht.createPortal(c.jsx(na,{adjustScale:l,dropAnimation:s,children:K?c.jsx(To,{value:D[N],handle:w,renderItem:_,wrapperStyle:U({index:N,isDragging:!0,id:D[N]}),index:N,dragging:!0,style:y({id:D[N],index:N,isSorting:K!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),k()):null]})}));function va({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:h,renderItem:s,useDragOverlay:y,wrapperStyle:b}){const{attributes:w,isDragging:m,isSorting:M,listeners:T,overIndex:P,setNodeRef:z,transform:_,transition:H}=ua({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(To,{ref:z,value:a,disabled:e,dragging:m,sorting:M,handle:i,renderItem:s,index:l,style:h({index:l,id:a,isDragging:m,isSorting:M,overIndex:P}),onRemove:f?()=>f(a):void 0,transform:_,transition:H,wrapperStyle:b({index:l,isDragging:m,id:a}),listeners:T,"data-index":l,"data-id":a,dragOverlay:!y&&m,...w})}const Ca="_TabStrip_3x0dp_1",ya=new d.Color("rgb(33, 115, 70)"),wa="#eee",ba=e=>c.jsx(ol,{...e}),ll=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:h,onTabNameChange:s,onTabMove:y,createScrollStartButton:b=r.defaultCreateScrollStartButton,createScrollEndButton:w=r.defaultCreateScrollEndButton,createScrollEdgeButton:m=r.defaultCreateScrollEdgeButton,createTabButton:M=ba,createTabDivider:T,editLabelProps:P,disabled:z=!1,disableDrag:_=!1,background:H="white",activeColor:x=ya,borderColor:B=wa,borderWidth:p=1}=e,[A,S]=o.useState(l),[U,D]=o.useState(f),j=o.useCallback(ie=>{const we=k.current?.[ie]?.closest(".tab-item")??k.current?.[ie];we&&Ae.current?.scrollTo({top:we.offsetTop,left:we.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{j(l)},[l]);const K=o.useCallback((ie,we)=>{we!==A&&(S(we),h?.(we)),j(we)},[h,A]),pe=o.useCallback((ie,we)=>{y?.(ie,we)},[y]),Z=o.useRef(null),[V,N]=o.useState(-1),F=o.useCallback((ie,we)=>{s?.(ie,we)},[s]);o.useLayoutEffect(()=>{S(l)},[l]),o.useLayoutEffect(()=>{D(f)},[f]);const k=o.useRef([]),O=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){k.current?.[ie]?.startEdit()},cancel(ie){k.current?.[ie]?.cancel()}},O.current),[A,V]);const ee=o.useCallback(({value:ie,index:we,dragging:ke})=>{const{style:Re,maxLength:Le,...Ne}=P||{},v=c.jsx(Ir,{ref:Oe=>{k.current[we]=Oe},value:ie,disabled:z,maxLength:Le,style:{color:A===we&&x?x?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Re},styleHover:{},onSubmit:Oe=>(Z.current=!1,N(-1),F(we,Oe)),onCancel:()=>{Z.current=!1,N(-1)},onChange:Oe=>{Z.current=!0,N(we)},...Ne});return M({onClick:Oe=>K(Oe,we),value:ie,index:we,editing:V===we&&Z.current,editable:!0,disabled:z,selectedIndex:A,background:H,activeColor:x,borderColor:B,borderWidth:p,dragging:ke,children:v})},[A,F,K,P,z,V,M]),[oe,{width:be}]=Xt(),[he,{width:Ee}]=Xt(),Ae=o.useRef(null),[We,ve]=o.useState({left:0,top:0,width:0,height:0}),[He,Y]=o.useState(null);o.useEffect(()=>{He!==null&&Ae.current&&Ae.current.scrollTo({left:He,behavior:"smooth"})},[He]);const X=o.useCallback((ie,we=!1)=>{if(!Ae.current)return 0;let ke=Ae.current.firstChild.getBoundingClientRect(),Re=Ae.current.firstChild.firstChild.children,Le=0;return Le=we?0:r.ScrollUtils.getScrollTo(ie,ke.left,Re,!0,Math.max(0,ie-200)),Y(Le),Math.max(0,Le)},[]),de=o.useCallback((ie,we=!1)=>{if(!Ae.current)return 0;let ke=Ae.current.firstChild.getBoundingClientRect(),Re=Ae.current.firstChild.firstChild.children,Le=0;const Ne=Math.ceil(Ee-be);return Le=we?Ne:r.ScrollUtils.getScrollTo(ie,ke.left,Re,!1,Math.max(0,ie+200)),Y(Le),Math.min(Ne,Le)},[Ee,be]),Me=o.useRef(null),G=o.useRef(null),W=o.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=null,Me.current=null)},[]),re=o.useCallback((ie,we,ke=260)=>{Me.current=ie,G.current=setTimeout(()=>{const Re=we?X(Me.current||ie):de(Me.current||ie);Re!==Me.current?re(Re,we,120):W()},ke)},[X,de,W]);o.useEffect(()=>()=>W(),[W]);const me=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(We.left)<=0||Math.floor(Ee-be)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>re(Ae.current.scrollLeft,!0),onClick:ie=>X(Math.min(Ae.current.scrollLeft,He??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[We,He,Ee,be]),se=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(Ee-be)<=Math.ceil(We.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>re(Ae.current.scrollLeft,!1),onClick:ie=>de(Math.max(Ae.current.scrollLeft,He??0),ie.ctrlKey)}),[We,He,Ee,be]),Se=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,m?.(me)]}),[me,se,b,w,n,m]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:dt(Ca,a),ref:O,children:[c.jsx("div",{style:{borderTop:`solid ${B} ${p}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),c.jsx("div",{className:"Tabs",ref:oe,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:Ae,onScroll:ie=>{ve({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:c.jsx(pa,{isDisabled:ie=>z||_,items:U,strategy:ra,modifiers:[ma],ref:he,renderItem:ee,renderDivider:T,onMove:pe,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:m(se)})]})}));ll.displayName="TabStrip";const Fn=o.createContext(null);Fn.displayName="DocThemesContext";const xa="_script-editor_iy654_5",qa={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"},Sa=o.lazy(()=>Promise.resolve().then(()=>require("./BnOYc_JHwZOSLFGE.cjs")));let rn,ln,Lt=["define","require"],cr=!1,An="@0.7.20";An!=="@local"&&An!=="@0.0.0"||(An="");const Ra=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${An}/types/scripting.d.ts`,dr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),f=await l.getNavigationTree(i.uri.toString()),h=e.getPosition();let s={...h};s.lineNumber=1,s.column=1;let y=!1;for(let P=h.lineNumber;P>=1;P--)if(i.getLineContent(P).trim()===""){const z=Io(f,i.getOffsetAt({lineNumber:P,column:1}),"function");if(!z||Ma(z)){y=!0,s.lineNumber=P+1;break}{const _=z.spans[0].start;P=i.getPositionAt(_).lineNumber,s.lineNumber=P}}let b=n,w=!1;!y&&!b.startsWith(`
28
- `)&&s.lineNumber>1&&(b=`
29
- `+b,w=!0);let m=!1;i.getLineCount()>1&&(b.endsWith(`
27
+ `},fi={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 pi(e){let{announcements:t=fi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=mi}=e;const{announce:l,announcement:f}=(function(){const[y,p]=o.useState("");return{announce:o.useCallback(M=>{M!=null&&p(M)},[]),announcement:y}})(),h=hn("DndLiveRegion"),[c,C]=o.useState(!1);if(o.useEffect(()=>{C(!0)},[]),(function(y){const p=o.useContext(Ar);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(y)},[y,p])})(o.useMemo(()=>({onDragStart(y){let{active:p}=y;l(t.onDragStart({active:p}))},onDragMove(y){let{active:p,over:M}=y;t.onDragMove&&l(t.onDragMove({active:p,over:M}))},onDragOver(y){let{active:p,over:M}=y;l(t.onDragOver({active:p,over:M}))},onDragEnd(y){let{active:p,over:M}=y;l(t.onDragEnd({active:p,over:M}))},onDragCancel(y){let{active:p,over:M}=y;l(t.onDragCancel({active:p,over:M}))}}),[l,t])),!c)return null;const k=o.createElement(o.Fragment,null,o.createElement(gi,{id:i,value:a.draggable}),o.createElement(hi,{id:h,announcement:f}));return n?Kt.createPortal(k,n):k}var ht;function zn(){}function io(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ht||(ht={}));const kt=Object.freeze({x:0,y:0});function Dr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function vi(e,t){const n=Dn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function zr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function Ci(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Wo(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 Nr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Go(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 yi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Go(t,t.left,t.top),l=[];for(const f of i){const{id:h}=f,c=n.get(h);if(c){const C=Dr(Go(c),a);l.push({id:h,data:{droppableContainer:f,value:C}})}}return l.sort(zr)};function wi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),f=a-i,h=l-n;if(i<a&&n<l){const c=t.width*t.height,C=e.width*e.height,k=f*h;return Number((k/(c+C-k)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,h=n.get(f);if(h){const c=wi(h,t);c>0&&a.push({id:f,data:{droppableContainer:l,value:c}})}}return a.sort(Ci)};function _o(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function xi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>({...l,top:l.top+e*f.y,bottom:l.bottom+e*f.y,left:l.left+e*f.x,right:l.right+e*f.x}),{...t})}}const qi=xi(1);function Lr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Si={ignoreTransform:!1};function Xt(e,t){t===void 0&&(t=Si);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:C,transformOrigin:k}=Ct(e).getComputedStyle(e);C&&(n=(function(y,p,M){const T=Lr(p);if(!T)return y;const{scaleX:z,scaleY:D,x:Z,y:K}=T,w=y.left-Z-(1-z)*parseFloat(M),L=y.top-K-(1-D)*parseFloat(M.slice(M.indexOf(" ")+1)),v=z?y.width/z:y.width,I=D?y.height/D:y.height;return{width:v,height:I,top:L,right:w+v,bottom:L+I,left:w}})(n,C,k))}const{top:i,left:a,width:l,height:f,bottom:h,right:c}=n;return{top:i,left:a,width:l,height:f,bottom:h,right:c}}function Zo(e){return Xt(e,{ignoreTransform:!0})}function Hn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!gn(a)||Er(a)||n.includes(a))return n;const l=Ct(e).getComputedStyle(a);return a!==e&&(function(f,h){h===void 0&&(h=Ct(f).getComputedStyle(f));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(C=>{const k=h[C];return typeof k=="string"&&c.test(k)})})(a,l)&&n.push(a),(function(f,h){return h===void 0&&(h=Ct(f).getComputedStyle(f)),h.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Pr(e){const[t]=Hn(e,1);return t??null}function ao(e){return jn&&e?Zt(e)?e:xo(e)?qo(e)||e===_t(e).scrollingElement?window:gn(e)?e:null:null:null}function jr(e){return Zt(e)?e.scrollX:e.scrollLeft}function Or(e){return Zt(e)?e.scrollY:e.scrollTop}function go(e){return{x:jr(e),y:Or(e)}}var mt;function Br(e){return!(!jn||!e)&&e===document.scrollingElement}function Hr(e){const t={x:0,y:0},n=Br(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mt||(mt={}));const Ri={x:.2,y:.2};function ki(e,t,n,i,a){let{top:l,left:f,right:h,bottom:c}=n;i===void 0&&(i=10),a===void 0&&(a=Ri);const{isTop:C,isBottom:k,isLeft:y,isRight:p}=Hr(e),M={x:0,y:0},T={x:0,y:0},z=t.height*a.y,D=t.width*a.x;return!C&&l<=t.top+z?(M.y=mt.Backward,T.y=i*Math.abs((t.top+z-l)/z)):!k&&c>=t.bottom-z&&(M.y=mt.Forward,T.y=i*Math.abs((t.bottom-z-c)/z)),!p&&h>=t.right-D?(M.x=mt.Forward,T.x=i*Math.abs((t.right-D-h)/D)):!y&&f<=t.left+D&&(M.x=mt.Backward,T.x=i*Math.abs((t.left+D-f)/D)),{direction:M,speed:T}}function Mi(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:f}=window;return{top:0,left:0,right:l,bottom:f,width:l,height:f}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Vr(e){return e.reduce((t,n)=>$t(t,go(n)),kt)}function Ur(e,t){if(t===void 0&&(t=Xt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Pr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ti=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+jr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Or(n),0)}]];class ho{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Hn(n),a=Vr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,h]of Ti)for(const c of f)Object.defineProperty(this,c,{get:()=>{const C=h(i),k=a[l]-C;return this.rect[c]+k},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ln{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function so(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var qt,Ye;function Xo(e){e.preventDefault()}function Ii(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(qt||(qt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const Kr={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ei=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class So{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ln(_t(n)),this.windowListeners=new ln(Ct(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Ur(i),n(kt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Kr,coordinateGetter:f=Ei,scrollBehavior:h="smooth"}=a,{code:c}=t;if(l.end.includes(c))return void this.handleEnd(t);if(l.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:C}=i.current,k=C?{x:C.left,y:C.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=k);const y=f(t,{active:n,context:i.current,currentCoordinates:k});if(y){const p=dn(y,k),M={x:0,y:0},{scrollableAncestors:T}=i.current;for(const z of T){const D=t.code,{isTop:Z,isRight:K,isLeft:w,isBottom:L,maxScroll:v,minScroll:I}=Hr(z),q=Mi(z),X={x:Math.min(D===Ye.Right?q.right-q.width/2:q.right,Math.max(D===Ye.Right?q.left:q.left+q.width/2,y.x)),y:Math.min(D===Ye.Down?q.bottom-q.height/2:q.bottom,Math.max(D===Ye.Down?q.top:q.top+q.height/2,y.y))},E=D===Ye.Right&&!K||D===Ye.Left&&!w,j=D===Ye.Down&&!L||D===Ye.Up&&!Z;if(E&&X.x!==y.x){const $=z.scrollLeft+p.x,ve=D===Ye.Right&&$<=v.x||D===Ye.Left&&$>=I.x;if(ve&&!p.y)return void z.scrollTo({left:$,behavior:h});M.x=ve?z.scrollLeft-$:D===Ye.Right?z.scrollLeft-v.x:z.scrollLeft-I.x,M.x&&z.scrollBy({left:-M.x,behavior:h});break}if(j&&X.y!==y.y){const $=z.scrollTop+p.y,ve=D===Ye.Down&&$<=v.y||D===Ye.Up&&$>=I.y;if(ve&&!p.x)return void z.scrollTo({top:$,behavior:h});M.y=ve?z.scrollTop-$:D===Ye.Down?z.scrollTop-v.y:z.scrollTop-I.y,M.y&&z.scrollBy({top:-M.y,behavior:h});break}}this.handleMove(t,$t(dn(y,this.referenceCoordinates),M))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Yo(e){return!!(e&&"distance"in e)}function Jo(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Kr,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const h=l.activatorNode.current;return(!h||e.target===h)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(h){const{EventTarget:c}=Ct(h);return h instanceof c?h:_t(h)})(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:f}=l;this.props=t,this.events=n,this.document=_t(f),this.documentListeners=new ln(this.document),this.listeners=new ln(i),this.windowListeners=new ln(Ct(f)),this.initialCoordinates=(a=Dn(l))!=null?a:kt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,Xo),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,Xo),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jo(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Yo(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(qt.Click,Ii,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:h}}=l;if(!a)return;const c=(n=Dn(t))!=null?n:kt,C=dn(a,c);if(!i&&h){if(Yo(h)){if(h.tolerance!=null&&so(C,h.tolerance))return this.handleCancel();if(so(C,h.distance))return this.handleStart()}return Jo(h)&&so(C,h.tolerance)?this.handleCancel():void this.handlePending(h,C)}t.cancelable&&t.preventDefault(),f(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Fi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $r extends Ro{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Fi,i)}}$r.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Ai={move:{name:"mousemove"},end:{name:"mouseup"}};var mo;(function(e){e[e.RightClick=2]="RightClick"})(mo||(mo={}));class Wr extends Ro{constructor(t){super(t,Ai,_t(t.event.target))}}Wr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==mo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Gr extends Ro{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var an,Nn;function Di(e){let{acceleration:t,activator:n=an.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:h=Nn.TreeOrder,pointerCoordinates:c,scrollableAncestors:C,scrollableAncestorRects:k,delta:y,threshold:p}=e;const M=(function(I){let{delta:q,disabled:X}=I;const E=An(q);return rn(j=>{if(X||!E||!j)return zi;const $={x:Math.sign(q.x-E.x),y:Math.sign(q.y-E.y)};return{x:{[mt.Backward]:j.x[mt.Backward]||$.x===-1,[mt.Forward]:j.x[mt.Forward]||$.x===1},y:{[mt.Backward]:j.y[mt.Backward]||$.y===-1,[mt.Forward]:j.y[mt.Forward]||$.y===1}}},[X,q,E])})({delta:y,disabled:!l}),[T,z]=(function(){const I=o.useRef(null);return[o.useCallback((q,X)=>{I.current=setInterval(q,X)},[]),o.useCallback(()=>{I.current!==null&&(clearInterval(I.current),I.current=null)},[])]})(),D=o.useRef({x:0,y:0}),Z=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case an.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case an.DraggableRect:return a}},[n,a,c]),w=o.useRef(null),L=o.useCallback(()=>{const I=w.current;if(!I)return;const q=D.current.x*Z.current.x,X=D.current.y*Z.current.y;I.scrollBy(q,X)},[]),v=o.useMemo(()=>h===Nn.TreeOrder?[...C].reverse():C,[h,C]);o.useEffect(()=>{if(l&&C.length&&K){for(const I of v){if(i?.(I)===!1)continue;const q=C.indexOf(I),X=k[q];if(!X)continue;const{direction:E,speed:j}=ki(I,X,K,t,p);for(const $ of["x","y"])M[$][E[$]]||(j[$]=0,E[$]=0);if(j.x>0||j.y>0)return z(),w.current=I,T(L,f),D.current=j,void(Z.current=E)}D.current={x:0,y:0},Z.current={x:0,y:0},z()}else z()},[t,L,i,z,l,f,JSON.stringify(K),JSON.stringify(M),T,C,v,k,JSON.stringify(p)])}Gr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(an||(an={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nn||(Nn={}));const zi={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var un,fo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(un||(un={})),(function(e){e.Optimized="optimized"})(fo||(fo={}));const Qo=new Map;function po(e,t){return rn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ln(e){let{callback:t,disabled:n}=e;const i=On(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 Ni(e){return new ho(Xt(e),e)}function er(e,t,n){t===void 0&&(t=Ni);const[i,a]=o.useState(null);function l(){a(c=>{if(!e)return null;var C;if(e.isConnected===!1)return(C=c??n)!=null?C:null;const k=t(e);return JSON.stringify(c)===JSON.stringify(k)?c:k})}const f=(function(c){let{callback:C,disabled:k}=c;const y=On(C),p=o.useMemo(()=>{if(k||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:M}=window;return new M(y)},[y,k]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p})({callback(c){if(e)for(const C of c){const{type:k,target:y}=C;if(k==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),h=Ln({callback:l});return Rt(()=>{l(),e?(h?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),f?.disconnect())},[e]),i}const tr=[];function nr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?dn(e,n.current):kt}function or(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 rr=[];function _r(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gn(t)?t:e}const Li=[{sensor:$r,options:{}},{sensor:So,options:{}}],Pi={current:{}},Mn={draggable:{measure:Zo},droppable:{measure:Zo,strategy:un.WhileDragging,frequency:fo.Optimized},dragOverlay:{measure:Xt}};class sn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mn,measureDroppableContainers:zn,windowRect:null,measuringScheduled:!1},Zr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zn,draggableNodes:new Map,over:null,measureDroppableContainers:zn},mn=o.createContext(Zr),Xr=o.createContext(ji);function Oi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function Bi(e,t){switch(t.type){case ht.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ht.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ht.DragEnd:case ht.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new sn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ht.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const f=new sn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case ht.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new sn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Hi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(mn),l=An(i),f=An(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!Bn(l)||document.activeElement===l.target)return;const h=a.get(f);if(!h)return;const{activatorNode:c,node:C}=h;if(!c.current&&!C.current)return;requestAnimationFrame(()=>{for(const k of[c.current,C.current]){if(!k)continue;const y=di(k);if(y){y.focus();break}}})}},[i,t,a,f,l]),null}function Yr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Vn=o.createContext({...kt,scaleX:1,scaleY:1});var Ft;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ft||(Ft={}));const Vi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:h=!0,children:c,sensors:C=Li,collisionDetection:k=bi,measuring:y,modifiers:p,...M}=e;const T=o.useReducer(Bi,void 0,Oi),[z,D]=T,[Z,K]=(function(){const[V]=o.useState(()=>new Set),Q=o.useCallback(re=>(V.add(re),()=>V.delete(re)),[V]);return[o.useCallback(re=>{let{type:Ee,event:Ue}=re;V.forEach(Be=>{var xe;return(xe=Be[Ee])==null?void 0:xe.call(Be,Ue)})},[V]),Q]})(),[w,L]=o.useState(Ft.Uninitialized),v=w===Ft.Initialized,{draggable:{active:I,nodes:q,translate:X},droppable:{containers:E}}=z,j=I!=null?q.get(I):null,$=o.useRef({initial:null,translated:null}),ve=o.useMemo(()=>{var V;return I!=null?{id:I,data:(V=j?.data)!=null?V:Pi,rect:$}:null},[I,j]),Y=o.useRef(null),[_,A]=o.useState(null),[J,x]=o.useState(null),S=cn(M,Object.values(M)),oe=hn("DndDescribedBy",l),ie=o.useMemo(()=>E.getEnabled(),[E]),qe=(de=y,o.useMemo(()=>({draggable:{...Mn.draggable,...de?.draggable},droppable:{...Mn.droppable,...de?.droppable},dragOverlay:{...Mn.dragOverlay,...de?.dragOverlay}}),[de?.draggable,de?.droppable,de?.dragOverlay]));var de;const{droppableRects:Pe,measureDroppableContainers:je,measuringScheduled:De}=(function(V,Q){let{dragging:re,dependencies:Ee,config:Ue}=Q;const[Be,xe]=o.useState(null),{frequency:He,measure:Ce,strategy:Ae}=Ue,we=o.useRef(V),Se=(function(){switch(Ae){case un.Always:return!1;case un.BeforeDragging:return re;default:return!re}})(),Ne=cn(Se),Ze=o.useCallback(function(at){at===void 0&&(at=[]),Ne.current||xe(ot=>ot===null?at:ot.concat(at.filter($e=>!ot.includes($e))))},[Ne]),_e=o.useRef(null),Xe=rn(at=>{if(Se&&!re)return Qo;if(!at||at===Qo||we.current!==V||Be!=null){const ot=new Map;for(let $e of V){if(!$e)continue;if(Be&&Be.length>0&&!Be.includes($e.id)&&$e.rect.current){ot.set($e.id,$e.rect.current);continue}const lt=$e.node.current,it=lt?new ho(Ce(lt),lt):null;$e.rect.current=it,it&&ot.set($e.id,it)}return ot}return at},[V,Be,re,Se,Ce]);return o.useEffect(()=>{we.current=V},[V]),o.useEffect(()=>{Se||Ze()},[re,Se]),o.useEffect(()=>{Be&&Be.length>0&&xe(null)},[JSON.stringify(Be)]),o.useEffect(()=>{Se||typeof He!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ze(),_e.current=null},He))},[He,Se,Ze,...Ee]),{droppableRects:Xe,measureDroppableContainers:Ze,measuringScheduled:Be!=null}})(ie,{dragging:v,dependencies:[X.x,X.y],config:qe.droppable}),Ie=(function(V,Q){const re=Q!=null?V.get(Q):void 0,Ee=re?re.node.current:null;return rn(Ue=>{var Be;return Q==null?null:(Be=Ee??Ue)!=null?Be:null},[Ee,Q])})(q,I),ke=o.useMemo(()=>J?Dn(J):null,[J]),ge=(function(){const V=_?.autoScrollEnabled===!1,Q=typeof h=="object"?h.enabled===!1:h===!1,re=v&&!V&&!Q;return typeof h=="object"?{...h,enabled:re}:{enabled:re}})(),B=(function(V,Q){return po(V,Q)})(Ie,qe.draggable.measure);(function(V){let{activeNode:Q,measure:re,initialRect:Ee,config:Ue=!0}=V;const Be=o.useRef(!1),{x:xe,y:He}=typeof Ue=="boolean"?{x:Ue,y:Ue}:Ue;Rt(()=>{if(!xe&&!He||!Q)return void(Be.current=!1);if(Be.current||!Ee)return;const Ce=Q?.node.current;if(!Ce||Ce.isConnected===!1)return;const Ae=_o(re(Ce),Ee);if(xe||(Ae.x=0),He||(Ae.y=0),Be.current=!0,Math.abs(Ae.x)>0||Math.abs(Ae.y)>0){const we=Pr(Ce);we&&we.scrollBy({top:Ae.y,left:Ae.x})}},[Q,xe,He,Ee,re])})({activeNode:I!=null?q.get(I):null,config:ge.layoutShiftCompensation,initialRect:B,measure:qe.draggable.measure});const Fe=er(Ie,qe.draggable.measure,B),ze=er(Ie?Ie.parentElement:null),H=o.useRef({activatorEvent:null,active:null,activeNode:Ie,collisionRect:null,collisions:null,droppableRects:Pe,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),W=E.getNodeFor((t=H.current.over)==null?void 0:t.id),me=(function(V){let{measure:Q}=V;const[re,Ee]=o.useState(null),Ue=Ln({callback:o.useCallback(Ce=>{for(const{target:Ae}of Ce)if(gn(Ae)){Ee(we=>{const Se=Q(Ae);return we?{...we,width:Se.width,height:Se.height}:Se});break}},[Q])}),Be=o.useCallback(Ce=>{const Ae=_r(Ce);Ue?.disconnect(),Ae&&Ue?.observe(Ae),Ee(Ae?Q(Ae):null)},[Q,Ue]),[xe,He]=Fn(Be);return o.useMemo(()=>({nodeRef:xe,rect:re,setRef:He}),[re,xe,He])})({measure:qe.dragOverlay.measure}),ue=(n=me.nodeRef.current)!=null?n:Ie,fe=v?(i=me.rect)!=null?i:Fe:null,Me=!!(me.nodeRef.current&&me.rect),ae=_o(be=Me?null:Fe,po(be));var be;const g=or(ue?Ct(ue):null),Le=(function(V){const Q=o.useRef(V),re=rn(Ee=>V?Ee&&Ee!==tr&&V&&Q.current&&V.parentNode===Q.current.parentNode?Ee:Hn(V):tr,[V]);return o.useEffect(()=>{Q.current=V},[V]),re})(v?W??Ie:null),Oe=(function(V,Q){Q===void 0&&(Q=Xt);const[re]=V,Ee=or(re?Ct(re):null),[Ue,Be]=o.useState(rr);function xe(){Be(()=>V.length?V.map(Ce=>Br(Ce)?Ee:new ho(Q(Ce),Ce)):rr)}const He=Ln({callback:xe});return Rt(()=>{He?.disconnect(),xe(),V.forEach(Ce=>He?.observe(Ce))},[V]),Ue})(Le),Te=Yr(p,{transform:{x:X.x-ae.x,y:X.y-ae.y,scaleX:1,scaleY:1},activatorEvent:J,active:ve,activeNodeRect:Fe,containerNodeRect:ze,draggingNodeRect:fe,over:H.current.over,overlayNodeRect:me.rect,scrollableAncestors:Le,scrollableAncestorRects:Oe,windowRect:g}),u=ke?$t(ke,X):null,N=(function(V){const[Q,re]=o.useState(null),Ee=o.useRef(V),Ue=o.useCallback(Be=>{const xe=ao(Be.target);xe&&re(He=>He?(He.set(xe,go(xe)),new Map(He)):null)},[]);return o.useEffect(()=>{const Be=Ee.current;if(V!==Be){xe(Be);const He=V.map(Ce=>{const Ae=ao(Ce);return Ae?(Ae.addEventListener("scroll",Ue,{passive:!0}),[Ae,go(Ae)]):null}).filter(Ce=>Ce!=null);re(He.length?new Map(He):null),Ee.current=V}return()=>{xe(V),xe(Be)};function xe(He){He.forEach(Ce=>{const Ae=ao(Ce);Ae?.removeEventListener("scroll",Ue)})}},[Ue,V]),o.useMemo(()=>V.length?Q?Array.from(Q.values()).reduce((Be,xe)=>$t(Be,xe),kt):Vr(V):kt,[V,Q])})(Le),U=nr(N),m=nr(N,[Fe]),F=$t(Te,U),G=fe?qi(fe,Te):null,te=ve&&G?k({active:ve,collisionRect:G,droppableRects:Pe,droppableContainers:ie,pointerCoordinates:u}):null,le=Nr(te,"id"),[b,O]=o.useState(null),R=(function(V,Q,re){return{...V,scaleX:Q&&re?Q.width/re.width:1,scaleY:Q&&re?Q.height/re.height:1}})(Me?Te:$t(Te,m),(a=b?.rect)!=null?a:null,Fe),P=o.useRef(null),ce=o.useCallback((V,Q)=>{let{sensor:re,options:Ee}=Q;if(Y.current==null)return;const Ue=q.get(Y.current);if(!Ue)return;const Be=V.nativeEvent,xe=new re({active:Y.current,activeNode:Ue,event:Be,options:Ee,context:H,onAbort(Ce){if(!q.get(Ce))return;const{onDragAbort:Ae}=S.current,we={id:Ce};Ae?.(we),Z({type:"onDragAbort",event:we})},onPending(Ce,Ae,we,Se){if(!q.get(Ce))return;const{onDragPending:Ne}=S.current,Ze={id:Ce,constraint:Ae,initialCoordinates:we,offset:Se};Ne?.(Ze),Z({type:"onDragPending",event:Ze})},onStart(Ce){const Ae=Y.current;if(Ae==null)return;const we=q.get(Ae);if(!we)return;const{onDragStart:Se}=S.current,Ne={activatorEvent:Be,active:{id:Ae,data:we.data,rect:$}};Kt.unstable_batchedUpdates(()=>{Se?.(Ne),L(Ft.Initializing),D({type:ht.DragStart,initialCoordinates:Ce,active:Ae}),Z({type:"onDragStart",event:Ne}),A(P.current),x(Be)})},onMove(Ce){D({type:ht.DragMove,coordinates:Ce})},onEnd:He(ht.DragEnd),onCancel:He(ht.DragCancel)});function He(Ce){return async function(){const{active:Ae,collisions:we,over:Se,scrollAdjustedTranslate:Ne}=H.current;let Ze=null;if(Ae&&Ne){const{cancelDrop:_e}=S.current;Ze={activatorEvent:Be,active:Ae,collisions:we,delta:Ne,over:Se},Ce===ht.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ze))&&(Ce=ht.DragCancel)}Y.current=null,Kt.unstable_batchedUpdates(()=>{D({type:Ce}),L(Ft.Uninitialized),O(null),A(null),x(null),P.current=null;const _e=Ce===ht.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const Xe=S.current[_e];Xe?.(Ze),Z({type:_e,event:Ze})}})}}P.current=xe},[q]),se=o.useCallback((V,Q)=>(re,Ee)=>{const Ue=re.nativeEvent,Be=q.get(Ee);if(Y.current!==null||!Be||Ue.dndKit||Ue.defaultPrevented)return;const xe={active:Be};V(re,Q.options,xe)===!0&&(Ue.dndKit={capturedBy:Q.sensor},Y.current=Ee,ce(re,Q))},[q,ce]),ye=(function(V,Q){return o.useMemo(()=>V.reduce((re,Ee)=>{const{sensor:Ue}=Ee;return[...re,...Ue.activators.map(Be=>({eventName:Be.eventName,handler:Q(Be.handler,Ee)}))]},[]),[V,Q])})(C,se);(function(V){o.useEffect(()=>{if(!jn)return;const Q=V.map(re=>{let{sensor:Ee}=re;return Ee.setup==null?void 0:Ee.setup()});return()=>{for(const re of Q)re?.()}},V.map(Q=>{let{sensor:re}=Q;return re}))})(C),Rt(()=>{Fe&&w===Ft.Initializing&&L(Ft.Initialized)},[Fe,w]),o.useEffect(()=>{const{onDragMove:V}=S.current,{active:Q,activatorEvent:re,collisions:Ee,over:Ue}=H.current;if(!Q||!re)return;const Be={active:Q,activatorEvent:re,collisions:Ee,delta:{x:F.x,y:F.y},over:Ue};Kt.unstable_batchedUpdates(()=>{V?.(Be),Z({type:"onDragMove",event:Be})})},[F.x,F.y]),o.useEffect(()=>{const{active:V,activatorEvent:Q,collisions:re,droppableContainers:Ee,scrollAdjustedTranslate:Ue}=H.current;if(!V||Y.current==null||!Q||!Ue)return;const{onDragOver:Be}=S.current,xe=Ee.get(le),He=xe&&xe.rect.current?{id:xe.id,rect:xe.rect.current,data:xe.data,disabled:xe.disabled}:null,Ce={active:V,activatorEvent:Q,collisions:re,delta:{x:Ue.x,y:Ue.y},over:He};Kt.unstable_batchedUpdates(()=>{O(He),Be?.(Ce),Z({type:"onDragOver",event:Ce})})},[le]),Rt(()=>{H.current={activatorEvent:J,active:ve,activeNode:Ie,collisionRect:G,collisions:te,droppableRects:Pe,draggableNodes:q,draggingNode:ue,draggingNodeRect:fe,droppableContainers:E,over:b,scrollableAncestors:Le,scrollAdjustedTranslate:F},$.current={initial:fe,translated:G}},[ve,Ie,te,G,q,ue,fe,Pe,E,b,Le,F]),Di({...ge,delta:X,draggingRect:G,pointerCoordinates:u,scrollableAncestors:Le,scrollableAncestorRects:Oe});const ee=o.useMemo(()=>({active:ve,activeNode:Ie,activeNodeRect:Fe,activatorEvent:J,collisions:te,containerNodeRect:ze,dragOverlay:me,draggableNodes:q,droppableContainers:E,droppableRects:Pe,over:b,measureDroppableContainers:je,scrollableAncestors:Le,scrollableAncestorRects:Oe,measuringConfiguration:qe,measuringScheduled:De,windowRect:g}),[ve,Ie,Fe,J,te,ze,me,q,E,Pe,b,je,Le,Oe,qe,De,g]),pe=o.useMemo(()=>({activatorEvent:J,activators:ye,active:ve,activeNodeRect:Fe,ariaDescribedById:{draggable:oe},dispatch:D,draggableNodes:q,over:b,measureDroppableContainers:je}),[J,ye,ve,Fe,D,oe,q,b,je]);return o.createElement(Ar.Provider,{value:K},o.createElement(mn.Provider,{value:pe},o.createElement(Xr.Provider,{value:ee},o.createElement(Vn.Provider,{value:R},c)),o.createElement(Hi,{disabled:f?.restoreFocus===!1})),o.createElement(pi,{...f,hiddenTextDescribedById:oe}))}),Ui=o.createContext(null),lr="button";function Ki(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=hn("Draggable"),{activators:f,activatorEvent:h,active:c,activeNodeRect:C,ariaDescribedById:k,draggableNodes:y,over:p}=o.useContext(mn),{role:M=lr,roleDescription:T="draggable",tabIndex:z=0}=a??{},D=c?.id===t,Z=o.useContext(D?Vn:Ui),[K,w]=Fn(),[L,v]=Fn(),I=(function(X,E){return o.useMemo(()=>X.reduce((j,$)=>{let{eventName:ve,handler:Y}=$;return j[ve]=_=>{Y(_,E)},j},{}),[X,E])})(f,t),q=cn(n);return Rt(()=>(y.set(t,{id:t,key:l,node:K,activatorNode:L,data:q}),()=>{const X=y.get(t);X&&X.key===l&&y.delete(t)}),[y,t]),{active:c,activatorEvent:h,activeNodeRect:C,attributes:o.useMemo(()=>({role:M,tabIndex:z,"aria-disabled":i,"aria-pressed":!(!D||M!==lr)||void 0,"aria-roledescription":T,"aria-describedby":k.draggable}),[i,M,z,D,T,k.draggable]),isDragging:D,listeners:i?void 0:I,node:K,over:p,setNodeRef:w,setActivatorNodeRef:v,transform:Z}}function Jr(){return o.useContext(Xr)}const $i={timeout:25};function Wi(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),h=An(n);return n||i||!h||a(h),Rt(()=>{if(!l)return;const c=i?.key,C=i?.props.id;c!=null&&C!=null?Promise.resolve(t(C,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const Gi={x:0,y:0,scaleX:1,scaleY:1};function _i(e){let{children:t}=e;return o.createElement(mn.Provider,{value:Zr},o.createElement(Vn.Provider,{value:Gi},t))}const Zi={position:"fixed",touchAction:"none"},Xi=e=>Bn(e)?"transform 250ms ease":void 0,Yi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:h,style:c,transform:C,transition:k=Xi}=e;if(!h)return null;const y=a?C:{...C,scaleX:1,scaleY:1},p={...Zi,width:h.width,height:h.height,top:h.top,left:h.left,transform:Nt.Transform.toString(y),transformOrigin:a&&i?vi(i,h):void 0,transition:typeof k=="function"?k(i):k,...c};return o.createElement(n,{className:f,style:p,ref:t},l)}),Ji=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[h,c]of Object.entries(l.active))c!==void 0&&(a[h]=n.node.style.getPropertyValue(h),n.node.style.setProperty(h,c));if(l!=null&&l.dragOverlay)for(const[h,c]of Object.entries(l.dragOverlay))c!==void 0&&i.node.style.setProperty(h,c);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[h,c]of Object.entries(a))n.node.style.setProperty(h,c);f!=null&&f.active&&n.node.classList.remove(f.active)}},Qr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nt.Transform.toString(t)},{transform:Nt.Transform.toString(n)}]},sideEffects:Ji({styles:{active:{opacity:"0"}}})};function Qi(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return On((l,f)=>{if(t===null)return;const h=n.get(l);if(!h)return;const c=h.node.current;if(!c)return;const C=_r(f);if(!C)return;const{transform:k}=Ct(f).getComputedStyle(f),y=Lr(k);if(!y)return;const p=typeof t=="function"?t:(function(M){const{duration:T,easing:z,sideEffects:D,keyframes:Z}={...Qr,...M};return K=>{let{active:w,dragOverlay:L,transform:v,...I}=K;if(!T)return;const q={x:L.rect.left-w.rect.left,y:L.rect.top-w.rect.top},X={scaleX:v.scaleX!==1?w.rect.width*v.scaleX/L.rect.width:1,scaleY:v.scaleY!==1?w.rect.height*v.scaleY/L.rect.height:1},E={x:v.x-q.x,y:v.y-q.y,...X},j=Z({...I,active:w,dragOverlay:L,transform:{initial:v,final:E}}),[$]=j,ve=j[j.length-1];if(JSON.stringify($)===JSON.stringify(ve))return;const Y=D?.({active:w,dragOverlay:L,...I}),_=L.node.animate(j,{duration:T,easing:z,fill:"forwards"});return new Promise(A=>{_.onfinish=()=>{Y?.(),A()}})}})(t);return Ur(c,a.draggable.measure),p({active:{id:l,data:h.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(C)},droppableContainers:i,measuringConfiguration:a,transform:y})})}let ir=0;function ea(e){return o.useMemo(()=>{if(e!=null)return ir++,ir},[e])}const ta=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:h="div",className:c,zIndex:C=999}=e;const{activatorEvent:k,active:y,activeNodeRect:p,containerNodeRect:M,draggableNodes:T,droppableContainers:z,dragOverlay:D,over:Z,measuringConfiguration:K,scrollableAncestors:w,scrollableAncestorRects:L,windowRect:v}=Jr(),I=o.useContext(Vn),q=ea(y?.id),X=Yr(f,{activatorEvent:k,active:y,activeNodeRect:p,containerNodeRect:M,draggingNodeRect:D.rect,over:Z,overlayNodeRect:D.rect,scrollableAncestors:w,scrollableAncestorRects:L,transform:I,windowRect:v}),E=po(p),j=Qi({config:i,draggableNodes:T,droppableContainers:z,measuringConfiguration:K}),$=E?D.setRef:void 0;return o.createElement(_i,null,o.createElement(Wi,{animation:j},y&&q?o.createElement(Yi,{key:q,id:y.id,ref:$,as:h,activatorEvent:k,adjustScale:t,className:c,transition:l,rect:E,style:{zIndex:C,...a},transform:X},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function na(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Rn(e){return e!==null&&e>=0}const kn={scaleX:1,scaleY:1},oa=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const h=(t=n[a])!=null?t:i;if(!h)return null;const c=(function(C,k,y){const p=C[k],M=C[k-1],T=C[k+1];return!p||!M&&!T?0:y<k?M?p.left-(M.left+M.width):T.left-(p.left+p.width):T?T.left-(p.left+p.width):p.left-(M.left+M.width)})(n,f,a);if(f===a){const C=n[l];return C?{x:a<l?C.left+C.width-(h.left+h.width):C.left-h.left,y:0,...kn}:null}return f>a&&f<=l?{x:-h.width-c,y:0,...kn}:f<a&&f>=l?{x:h.width+c,y:0,...kn}:{x:0,y:0,...kn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),f=t[a],h=l[a];return h&&f?{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}:null},el="Sortable",tl=o.createContext({activeIndex:-1,containerId:el,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function ra(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:f,dragOverlay:h,droppableRects:c,over:C,measureDroppableContainers:k}=Jr(),y=hn(el,n),p=h.rect!==null,M=o.useMemo(()=>i.map(I=>typeof I=="object"&&"id"in I?I.id:I),[i]),T=f!=null,z=f?M.indexOf(f.id):-1,D=C?M.indexOf(C.id):-1,Z=o.useRef(M),K=!(function(I,q){if(I===q)return!0;if(I.length!==q.length)return!1;for(let X=0;X<I.length;X++)if(I[X]!==q[X])return!1;return!0})(M,Z.current),w=D!==-1&&z===-1||K,L=(function(I){return typeof I=="boolean"?{draggable:I,droppable:I}:I})(l);Rt(()=>{K&&T&&k(M)},[K,M,T,k]),o.useEffect(()=>{Z.current=M},[M]);const v=o.useMemo(()=>({activeIndex:z,containerId:y,disabled:L,disableTransforms:w,items:M,overIndex:D,useDragOverlay:p,sortedRects:na(M,c),strategy:a}),[z,y,L.draggable,L.droppable,w,M,D,c,p,a]);return o.createElement(tl.Provider,{value:v},t)}const la=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},ia=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:h,previousContainerId:c,transition:C}=e;return!(!C||!i)&&(h===l||a!==f)&&(!!n||f!==a&&t===c)},aa={duration:200,easing:"ease"},nl="transform",sa=Nt.Transition.toString({property:nl,duration:0,easing:"linear"}),ca={roleDescription:"sortable"};function da(e){let{animateLayoutChanges:t=ia,attributes:n,disabled:i,data:a,getNewIndex:l=la,id:f,strategy:h,resizeObserverConfig:c,transition:C=aa}=e;const{items:k,containerId:y,activeIndex:p,disabled:M,disableTransforms:T,sortedRects:z,overIndex:D,useDragOverlay:Z,strategy:K}=o.useContext(tl),w=(function(W,me){var ue,fe;return typeof W=="boolean"?{draggable:W,droppable:!1}:{draggable:(ue=W?.draggable)!=null?ue:me.draggable,droppable:(fe=W?.droppable)!=null?fe:me.droppable}})(i,M),L=k.indexOf(f),v=o.useMemo(()=>({sortable:{containerId:y,index:L,items:k},...a}),[y,a,L,k]),I=o.useMemo(()=>k.slice(k.indexOf(f)),[k,f]),{rect:q,node:X,isOver:E,setNodeRef:j}=(function(W){let{data:me,disabled:ue=!1,id:fe,resizeObserverConfig:Me}=W;const ae=hn("Droppable"),{active:be,dispatch:g,over:Le,measureDroppableContainers:Oe}=o.useContext(mn),Te=o.useRef({disabled:ue}),u=o.useRef(!1),N=o.useRef(null),U=o.useRef(null),{disabled:m,updateMeasurementsFor:F,timeout:G}={...$i,...Me},te=cn(F??fe),le=Ln({callback:o.useCallback(()=>{u.current?(U.current!=null&&clearTimeout(U.current),U.current=setTimeout(()=>{Oe(Array.isArray(te.current)?te.current:[te.current]),U.current=null},G)):u.current=!0},[G]),disabled:m||!be}),b=o.useCallback((ce,se)=>{le&&(se&&(le.unobserve(se),u.current=!1),ce&&le.observe(ce))},[le]),[O,R]=Fn(b),P=cn(me);return o.useEffect(()=>{le&&O.current&&(le.disconnect(),u.current=!1,le.observe(O.current))},[O,le]),o.useEffect(()=>(g({type:ht.RegisterDroppable,element:{id:fe,key:ae,disabled:ue,node:O,rect:N,data:P}}),()=>g({type:ht.UnregisterDroppable,key:ae,id:fe})),[fe]),o.useEffect(()=>{ue!==Te.current.disabled&&(g({type:ht.SetDroppableDisabled,id:fe,key:ae,disabled:ue}),Te.current.disabled=ue)},[fe,ae,ue,g]),{active:be,rect:N,isOver:Le?.id===fe,node:O,over:Le,setNodeRef:R}})({id:f,data:v,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...c}}),{active:$,activatorEvent:ve,activeNodeRect:Y,attributes:_,setNodeRef:A,listeners:J,isDragging:x,over:S,setActivatorNodeRef:oe,transform:ie}=Ki({id:f,data:v,attributes:{...ca,...n},disabled:w.draggable}),qe=(function(){for(var W=arguments.length,me=new Array(W),ue=0;ue<W;ue++)me[ue]=arguments[ue];return o.useMemo(()=>fe=>{me.forEach(Me=>Me(fe))},me)})(j,A),de=!!$,Pe=de&&!T&&Rn(p)&&Rn(D),je=!Z&&x,De=je&&Pe?ie:null,Ie=Pe?De??(h??K)({rects:z,activeNodeRect:Y,activeIndex:p,overIndex:D,index:L}):null,ke=Rn(p)&&Rn(D)?l({id:f,items:k,activeIndex:p,overIndex:D}):L,ge=$?.id,B=o.useRef({activeId:ge,items:k,newIndex:ke,containerId:y}),Fe=k!==B.current.items,ze=t({active:$,containerId:y,isDragging:x,isSorting:de,id:f,index:L,items:k,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:C,wasDragging:B.current.activeId!=null}),H=(function(W){let{disabled:me,index:ue,node:fe,rect:Me}=W;const[ae,be]=o.useState(null),g=o.useRef(ue);return Rt(()=>{if(!me&&ue!==g.current&&fe.current){const Le=Me.current;if(Le){const Oe=Xt(fe.current,{ignoreTransform:!0}),Te={x:Le.left-Oe.left,y:Le.top-Oe.top,scaleX:Le.width/Oe.width,scaleY:Le.height/Oe.height};(Te.x||Te.y)&&be(Te)}}ue!==g.current&&(g.current=ue)},[me,ue,fe,Me]),o.useEffect(()=>{ae&&be(null)},[ae]),ae})({disabled:!ze,index:L,node:X,rect:q});return o.useEffect(()=>{de&&B.current.newIndex!==ke&&(B.current.newIndex=ke),y!==B.current.containerId&&(B.current.containerId=y),k!==B.current.items&&(B.current.items=k)},[de,ke,y,k]),o.useEffect(()=>{if(ge===B.current.activeId)return;if(ge!=null&&B.current.activeId==null)return void(B.current.activeId=ge);const W=setTimeout(()=>{B.current.activeId=ge},50);return()=>clearTimeout(W)},[ge]),{active:$,activeIndex:p,attributes:_,data:v,rect:q,index:L,newIndex:ke,items:k,isOver:E,isSorting:de,isDragging:x,listeners:J,node:X,overIndex:D,over:S,setNodeRef:qe,setActivatorNodeRef:oe,setDroppableNodeRef:j,setDraggableNodeRef:A,transform:H??Ie,transition:(function(){if(H||Fe&&B.current.newIndex===L)return sa;if(!(je&&!Bn(ve)||!C)&&(de||ze))return Nt.Transition.toString({...C,property:nl})})()}}function Pn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ua=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ga=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:h}}=t;if(ua.includes(e.code)){if(e.preventDefault(),!n||!i)return;const c=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const p=a.get(y.id);if(p)switch(e.code){case Ye.Down:i.top<p.top&&c.push(y);break;case Ye.Up:i.top>p.top&&c.push(y);break;case Ye.Left:i.left>p.left&&c.push(y);break;case Ye.Right:i.left<p.left&&c.push(y)}});const C=(y=>{let{collisionRect:p,droppableRects:M,droppableContainers:T}=y;const z=Wo(p),D=[];for(const Z of T){const{id:K}=Z,w=M.get(K);if(w){const L=Wo(w),v=z.reduce((q,X,E)=>q+Dr(L[E],X),0),I=Number((v/4).toFixed(4));D.push({id:K,data:{droppableContainer:Z,value:I}})}}return D.sort(zr)})({collisionRect:i,droppableRects:a,droppableContainers:c});let k=Nr(C,"id");if(k===f?.id&&C.length>1&&(k=C[1].id),k!=null){const y=l.get(n.id),p=l.get(k),M=p?a.get(p.id):null,T=p?.node.current;if(T&&M&&y&&p){const z=Hn(T).some((L,v)=>h[v]!==L),D=ar(y,p),Z=(function(L,v){return!Pn(L)||!Pn(v)||!ar(L,v)?!1:L.data.current.sortable.index<v.data.current.sortable.index})(y,p),K=z||!D?{x:0,y:0}:{x:Z?i.width-M.width:0,y:Z?i.height-M.height:0},w={x:M.left,y:M.top};return K.x&&K.y?w:dn(w,K)}}}};function ar(e,t){return!(!Pn(e)||!Pn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ha=e=>{let{transform:t}=e;return{...t,y:0}},ol=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:h,selectedIndex:c,background:C,activeColor:k,borderColor:y,borderWidth:p,dragging:M,...T}=e;return s.jsxs("div",{ref:t,className:ct(a),style:{...i,display:"flex",flexDirection:"column",background:c===l?"white":C,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...T,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===l?"0px":"-1px",marginTop:c===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===l?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===l&&k?k?.toCSS():"none",minHeight:"2px"}})]})})),St={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},To=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:h,listeners:c,onRemove:C,renderItem:k,sorting:y,style:p,transition:M,transform:T,value:z,wrapperStyle:D,...Z},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=k?k({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:h,fadeIn:!!a,listeners:c,ref:K,style:p,transform:T,transition:M,value:z}):s.jsx(s.Fragment,{children:z});return s.jsx("div",{className:ct("tab-item",St.Wrapper,a&&St.fadeIn,y&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[M,D?.transition].filter(Boolean).join(", "),"--translate-x":T?`${Math.round(T.x)}px`:void 0,"--translate-y":T?`${Math.round(T.y)}px`:void 0,"--scale-x":T?.scaleX?`${T.scaleX}`:void 0,"--scale-y":T?.scaleY?`${T.scaleY}`:void 0,"--index":h},ref:K,children:s.jsx("div",{className:ct(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:c,...Z,tabIndex:l?void 0:-1,children:w})})})),sr={Row:"_Row_1kr10_1"},rl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>s.jsx("div",{ref:i,style:{...n},className:ct(sr.Row,t&&sr.horizontal),children:e}))),ma={...Qr},fa=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=yi,coordinateGetter:h=ga,dropAnimation:c=ma,getItemStyles:C=()=>({}),getNewIndex:k,handle:y=!1,items:p,onMove:M,isDisabled:T=()=>!1,measuring:z,modifiers:D,renderItem:Z,renderDivider:K,reorderItems:w=ko,strategy:L=Mo,style:v,useDragOverlay:I=!0,onDragStart:q,wrapperStyle:X=()=>({})}=e,[E,j]=o.useState(()=>p);o.useEffect(()=>{j(p)},[p]);const[$,ve]=o.useState(null),Y=(function(){for(var S=arguments.length,oe=new Array(S),ie=0;ie<S;ie++)oe[ie]=arguments[ie];return o.useMemo(()=>[...oe].filter(qe=>qe!=null),[...oe])})(io(Wr,{activationConstraint:i}),io(Gr,{activationConstraint:i}),io(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:h})),_=E.indexOf.bind(E),A=$?_($):-1,J=[];E.map((S,oe)=>{J.push(s.jsx(pa,{id:S,handle:y,index:oe,style:C,wrapperStyle:X,disabled:T(S),renderItem:Z,animateLayoutChanges:a,useDragOverlay:I,getNewIndex:k},S+"-"+oe));const ie=K?.({key:"divider-"+oe});ie&&J.push(ie)});const{getPortalContainer:x}=r.useFullscreenPortal();return s.jsxs(Vi,{sensors:Y,collisionDetection:f,onDragStart:S=>{const{active:oe}=S;oe&&(q?.(S),ve(oe.id))},autoScroll:{canScroll:S=>!0},onDragEnd:S=>{if(ve(null),S.over){const oe=_(S.over.id);A!==oe&&(j(ie=>w(ie,A,oe)),M?.(A,oe))}},onDragCancel:()=>{ve(null)},measuring:z,modifiers:D,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...v},className:ct(n,St.Wrapper),children:s.jsx(ra,{items:E,strategy:L,children:s.jsx(rl,{ref:t,children:J})})}),I?Kt.createPortal(s.jsx(ta,{adjustScale:l,dropAnimation:c,children:$?s.jsx(To,{value:E[A],handle:y,renderItem:Z,wrapperStyle:X({index:A,isDragging:!0,id:E[A]}),index:A,dragging:!0,style:C({id:E[A],index:A,isSorting:$!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),x()):null]})}));function pa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:h,renderItem:c,useDragOverlay:C,wrapperStyle:k}){const{attributes:y,isDragging:p,isSorting:M,listeners:T,overIndex:z,setNodeRef:D,transform:Z,transition:K}=da({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(To,{ref:D,value:a,disabled:e,dragging:p,sorting:M,handle:i,renderItem:c,index:l,style:h({index:l,id:a,isDragging:p,isSorting:M,overIndex:z}),onRemove:f?()=>f(a):void 0,transform:Z,transition:K,wrapperStyle:k({index:l,isDragging:p,id:a}),listeners:T,"data-index":l,"data-id":a,dragOverlay:!C&&p,...y})}const va="_TabStrip_3x0dp_1",Ca=new d.Color("rgb(33, 115, 70)"),ya="#eee",wa=e=>s.jsx(ol,{...e}),ll=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:h,onTabNameChange:c,onTabMove:C,renderScrollButtonStart:k=r.defaultCreateScrollStartButton,renderScrollButtonEnd:y=r.defaultCreateScrollEndButton,renderScrollButtonEdge:p=r.defaultCreateScrollEdgeButton,renderTabButton:M=wa,renderTabDivider:T,propsEditLabel:z,disabled:D=!1,disableDrag:Z=!1,background:K="white",activeColor:w=Ca,borderColor:L=ya,borderWidth:v=1}=e,[I,q]=o.useState(l),[X,E]=o.useState(f),j=o.useCallback(ae=>{const be=x.current?.[ae]?.closest(".tab-item")??x.current?.[ae];be&&je.current?.scrollTo({top:be.offsetTop,left:be.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{j(l)},[l]);const $=o.useCallback((ae,be)=>{be!==I&&(q(be),h?.(be)),j(be)},[h,I]),ve=o.useCallback((ae,be)=>{C?.(ae,be)},[C]),Y=o.useRef(null),[_,A]=o.useState(-1),J=o.useCallback((ae,be)=>{c?.(ae,be)},[c]);o.useLayoutEffect(()=>{q(l)},[l]),o.useLayoutEffect(()=>{E(f)},[f]);const x=o.useRef([]),S=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ae){x.current?.[ae]?.startEdit()},cancel(ae){x.current?.[ae]?.cancel()}},S.current),[I,_]);const oe=o.useCallback(({value:ae,index:be,dragging:g})=>{const{style:Le,maxLength:Oe,...Te}=z||{},u=s.jsx(Ir,{ref:N=>{x.current[be]=N},value:ae,disabled:D,maxLength:Oe,style:{color:I===be&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Le},styleHover:{},onSubmit:N=>(Y.current=!1,A(-1),J(be,N)),onCancel:()=>{Y.current=!1,A(-1)},onChange:N=>{Y.current=!0,A(be)},...Te});return M({onClick:N=>$(N,be),value:ae,index:be,editing:_===be&&Y.current,editable:!0,disabled:D,selectedIndex:I,background:K,activeColor:w,borderColor:L,borderWidth:v,dragging:g,children:u})},[I,J,$,z,D,_,M]),[ie,{width:qe}]=Wt(),[de,{width:Pe}]=Wt(),je=o.useRef(null),[De,Ie]=o.useState({left:0,top:0,width:0,height:0}),[ke,ge]=o.useState(null);o.useEffect(()=>{ke!==null&&je.current&&je.current.scrollTo({left:ke,behavior:"smooth"})},[ke]);const B=o.useCallback((ae,be=!1)=>{if(!je.current)return 0;let g=je.current.firstChild.getBoundingClientRect(),Le=je.current.firstChild.firstChild.children,Oe=0;return Oe=be?0:r.ScrollUtils.getScrollTo(ae,g.left,Le,!0,Math.max(0,ae-200)),ge(Oe),Math.max(0,Oe)},[]),Fe=o.useCallback((ae,be=!1)=>{if(!je.current)return 0;let g=je.current.firstChild.getBoundingClientRect(),Le=je.current.firstChild.firstChild.children,Oe=0;const Te=Math.ceil(Pe-qe);return Oe=be?Te:r.ScrollUtils.getScrollTo(ae,g.left,Le,!1,Math.max(0,ae+200)),ge(Oe),Math.min(Te,Oe)},[Pe,qe]),ze=o.useRef(null),H=o.useRef(null),W=o.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=null,ze.current=null)},[]),me=o.useCallback((ae,be,g=260)=>{ze.current=ae,H.current=setTimeout(()=>{const Le=be?B(ze.current||ae):Fe(ze.current||ae);Le!==ze.current?me(Le,be,120):W()},g)},[B,Fe,W]);o.useEffect(()=>()=>W(),[W]);const ue=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(De.left)<=0||Math.floor(Pe-qe)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>me(je.current.scrollLeft,!0),onClick:ae=>B(Math.min(je.current.scrollLeft,ke??Number.MAX_SAFE_INTEGER),ae.ctrlKey)}),[De,ke,Pe,qe]),fe=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(Pe-qe)<=Math.ceil(De.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:W,onMouseLeave:W,onMouseDown:()=>me(je.current.scrollLeft,!1),onClick:ae=>Fe(Math.max(je.current.scrollLeft,ke??0),ae.ctrlKey)}),[De,ke,Pe,qe]),Me=o.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,p?.(ue)]}),[ue,fe,k,y,n,p]);return s.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:ct(va,a),ref:S,children:[s.jsx("div",{style:{borderTop:`solid ${L} ${v}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Me}),s.jsx("div",{className:"Tabs",ref:ie,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:je,onScroll:ae=>{Ie({left:ae.target.scrollLeft,top:ae.target.scrollTop,width:ae.target.scrollWidth,height:ae.target.scrollHeight})},children:s.jsx(fa,{isDisabled:ae=>D||Z,items:X,strategy:oa,modifiers:[ha],ref:de,renderItem:oe,renderDivider:T,onMove:ve,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(fe)})]})}));ll.displayName="TabStrip";const Tn=o.createContext(null);Tn.displayName="DocThemesContext";const ba="_script-editor_iy654_5",xa={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},qa=o.lazy(()=>Promise.resolve().then(()=>require("./KLgpeikeRSDp4tUK.cjs")));let nn,on,Et=["define","require"],cr=!1,In="@0.7.21";In!=="@local"&&In!=="@0.0.0"||(In="");const Sa=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${In}/types/scripting.d.ts`,dr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),f=await l.getNavigationTree(i.uri.toString()),h=e.getPosition();let c={...h};c.lineNumber=1,c.column=1;let C=!1;for(let z=h.lineNumber;z>=1;z--)if(i.getLineContent(z).trim()===""){const D=Io(f,i.getOffsetAt({lineNumber:z,column:1}),"function");if(!D||ka(D)){C=!0,c.lineNumber=z+1;break}{const Z=D.spans[0].start;z=i.getPositionAt(Z).lineNumber,c.lineNumber=z}}let k=n,y=!1;!C&&!k.startsWith(`
28
+ `)&&c.lineNumber>1&&(k=`
29
+ `+k,y=!0);let p=!1;i.getLineCount()>1&&(k.endsWith(`
30
30
 
31
- `)||(b+=`
31
+ `)||(k+=`
32
32
 
33
- `,m=!0));const M=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${b}`}];let T=null;i.pushEditOperations([],M,P=>(T=P[0].range,w&&T.startLineNumber++,m&&T.endLineNumber--,[new t.Selection(T.startLineNumber,T.startColumn,T.endLineNumber,T.endColumn)])),e.setSelection({startLineNumber:T.endLineNumber,startColumn:T.endColumn,endLineNumber:T.startLineNumber,endColumn:T.startColumn})};function ka(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function vo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,f=e.getPositionAt(l);a.push({name:i.text,type:ka(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)vo(e,t,n,l,a);return a}function Io(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const h=a[f];if(h.start<=t&&t<h.start+h.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const s of e.childItems||[]){const y=Io(s,t,n,i);if(y)return y}}return null}}function Ma(e){return e.kind==="comment"}const Ta=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:h,autoFocus:s=!0,frame:y,onStatusChange:b,...w}=e,m=o.useRef(null),M=o.useRef(!1),T=o.useMemo(()=>({contains(Y){if(!m.current)return;const X=m.current.editor;return X&&X.getDomNode()?.contains(Y)},focus(){if(!m.current)return;const Y=m.current.editor;return Y&&Y.getDomNode()?.focus()}}),[]),P=o.useMemo(()=>[new r.Command("help",T,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),z=o.useMemo(()=>{let Y=null;const X=()=>T;return Y=a?a.createChildGroup(X,"scriptEditor",!1):new r.CommandGroup(X,"scriptEditor"),Y.addCommands(P,!0),Y},[a,P]),_=a.getGroup("workbook"),H=r.useCommands(_,["executeSelectedScript","saveScripts"]),x=H[0],B=H[1],p=x?.context(),[A,S]=o.useState({message:"Loading",cursor:"",dirty:!1}),[U,D]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),j=r.useCallbackRef(Y=>{S(X=>{const de={...X,...Y};return ge.CommonUtils.deepEqual(de,X)?X:(B.update({disabled:!de.dirty}).updateCallback(async()=>{await K()}),de)})},[b,B]);o.useEffect(()=>{b?.(A)},[b,A]);const K=r.useCallbackRef(async()=>{if(!m.current)return;const Y=m.current.editor;let X;if(A.dirty){const de=Y.getValue();await p?.saveSource(de),X=p?.getScripts().getModules().getByName("scripts");const Me=X?.getSource(),G=Y.getValue(),W=(Me?.length??0)!==de.length||Me!==G;j({dirty:W})}else X=p?.getScripts().getModules().getByName("scripts");return X},[A]);o.useEffect(()=>{const Y=y?.addListener({onBeforeHide:async()=>(await K(),!0)});return()=>{Y?.()}},[y]),o.useEffect(()=>{const Y=p?.getScripts();if(Y)return Y.addListeners({onBeforeSearch:()=>K()})},[p]);const pe=r.useCallbackRef(Y=>{x?.execute(Y)},[x]),Z=o.useRef(""),[V,N]=o.useState(!1),F=r.useCallbackRef(async()=>{if(!m.current)return null;const Y=m.current,X=Y.editor;if(!X)return null;const de=Y.monaco,Me=await(async(G,W,re="export")=>{const me=G.getModel();if(!me)return null;const se=await W.languages.typescript.getTypeScriptWorker(),Se=await se(me.uri),ie=await Se.getNavigationTree(me.uri.toString());let we=null,ke=G.getSelection();if(!ke)return null;const Re=ke.startLineNumber===ke.endLineNumber&&ke.startColumn===ke.endColumn?me.getLineCount():Math.min(ke.endLineNumber,me.getLineCount());for(let Le=ke.startLineNumber;!we&&Le<=Re;Le++){const Ne=Io(ie,me.getOffsetAt({lineNumber:Le,column:1}),"function",re);Ne&&(we=Ne.text)}return we})(X,de);return j({message:(Me??"").toUpperCase()}),Me?{source:X.getValue(),name:Me}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce(K,200),[]);const k=r.useCallbackRef(async(Y,X,de)=>{D(G=>({...G,compiling:!0}));const Me=await p?.getScripts().createModule({source:de?.getValue(),declarationsOnly:!0});Me&&((async function(G,W){const re=[];for(let me=1;me<G.getLineCount()+1;me++){const se={startLineNumber:me,startColumn:1,endLineNumber:me,endColumn:G.getLineLength(me)+1},Se=G.getValueInRange(se).indexOf("modelt");Se!==-1&&re.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:W.MarkerSeverity.Hint,startLineNumber:se.startLineNumber,startColumn:Se+1,endLineNumber:se.startLineNumber,endColumn:Se+5})}W.editor.setModelMarkers(G,"owner",re)})(Y,X),(async function(G,W,re,me){const se=await W.languages.typescript.getTypeScriptWorker(),Se=await se(G.uri),ie=await Se.getNavigationTree(G.uri.toString()),we=vo(G,W,me,ie).map(ke=>{let Re=null,Le=null;return ke.type==="formula"?(Re="formula.margin-icon",Le="Formula"):ke.type==="macro"?(Re="macro.margin-icon",Le="Macro"):ke.type==="autoRun"&&(Re="autorun.margin-icon",Le="Auto Run"),{range:new W.Range(ke.lineNumber,1,ke.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Re,glyphMarginHoverMessage:{value:Le},stickiness:W.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});Ee.current&&Ee.current.clear(),Ee.current=re.createDecorationsCollection(we)})(Y,X,de,Me?Me.getFunctions().getItems():ge.CommonUtils.EmptyArray),D(G=>({...G,compiling:!1})))},[p]),O=r.useCallbackRef(ge.CommonUtils.debounce(k,580),[]),ee=r.useCallbackRef(async(Y=void 0)=>{if(!m.current||!p)return;const X=m.current.editor.getPosition(),de={cursor:X?X.toString():""};Y!==void 0&&(de.message=Y),j(de);const Me=F();p.setSelectedFunction(Me)},[p]);o.useEffect(()=>{},[U]);const oe=o.useRef(null),be=r.useCallbackRef(async()=>{await K(),y?.close()},[y]);o.useEffect(()=>{if(!p)return;const Y={insertSnippet:de=>{m.current?.editor&&dr(m.current.editor,m.current.monaco,de)},close:()=>be()};p.setEditor(Y),p.setSelectedFunction(F());const X=p.addContainerListener({onBeforeSave:async()=>{K()},onReadonlyChange(){},onScriptChange:async()=>{if(!m.current?.editor||!p)return;const de=m.current.editor,Me=p.getScripts().getModules().getItems()[0]?.getSource()??"";de.setValue(Me)}});return()=>{p.setEditor(null),X()}},[p]),o.useEffect(()=>()=>{const Y=oe.current;if(Y){Y.dispose();const X=Y.debounceTimer;X!==void 0&&clearTimeout(X),oe.current=null}},[V]);const he=r.useCallbackRef(Y=>{const X=m.current?.editor;return!!X&&(X.focus(Y),!0)},[A]),Ee=o.useRef(null),Ae=r.useCallbackRef((Y,X)=>{m.current={monaco:X,editor:Y},N(!0),ee("Loading Types");const de=p?.getScripts().getModules().getItems()[0]?.getSource()??"";Y.setValue(de),Promise.resolve().then(()=>require("./CLyN7mEMTjqdNl5I.cjs")).then(G=>G.customEditor).then(async G=>{ee(""),G.AutoTypings.create(Y,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:X,onUpdate:(W,re)=>{if(W.type==="LookedUpPackage"&&W.success!==void 0){const me=X.languages.typescript.typescriptDefaults.getDiagnosticsOptions();X.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...me,diagnosticCodesToIgnore:[]})}},onError:W=>{W==="Not implemented yet"&&(W="Compile Errors"),console.warn("Error compiling types",W)}}).then(W=>{oe.current=W;const re=Y.getModel();O(re,X,Y),(()=>{if(cr)return;const me=(Se,ie)=>{try{if(ie===void 0)try{delete globalThis[Se]}catch{try{globalThis[Se]=void 0}catch{}}else globalThis[Se]=ie}catch{}},se=Lt.length;for(let Se=0;Se<se;Se++){const ie=Lt[Se];me(ie,rn[ie])}rn=void 0,cr=!0})()})}),Y.addCommand("executeScript",function(G,...W){W?.[0]&&pe({functionName:W?.[0]})},""),Y.addAction({id:"executeScript",label:"Execute",keybindings:[X.KeyCode.F8],run:async G=>{const W=F();p?.setSelectedFunction(W);const re=await W;pe(re)}}),Y.addAction({id:"saveScript",label:"Save Script",keybindings:[X.KeyMod.CtrlCmd|X.KeyCode.KeyS],run:G=>{K()}}),Y.onMouseDown(async G=>{if(G.target.type===X.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const W=G.target.position.lineNumber,re=await X.languages.typescript.getTypeScriptWorker(),me=await re(Me.uri),se=await me.getNavigationTree(Me.uri.toString()),Se=(await K()).getFunctions().getItems(),ie=vo(Me,X,Se,se).find(we=>we.lineNumber===W);if(ie){const we=G.event.browserEvent.button;we===0?ie.type==="macro"||ie.type==="autoRun"?pe({functionName:ie.name}):ie.type==="formula"&&p?.quickInsertFunction?.(ie.name):we===2&&(console.log("Context menu for function:",ie.name),G.event.browserEvent.preventDefault())}}}),Y.onDidChangeModelContent(()=>{j({dirty:!0}),O(Me,X,Y)}),X.editor.onDidChangeMarkers(G=>{G.some(W=>W.toString()===Me.uri.toString())});const Me=Y.getModel();(function(G,W){W.languages.registerInlayHintsProvider("typescript",{provideInlayHints(re,me,se){const Se=[];for(let ie=1;ie<re.getLineCount()+1;ie++){const we={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:re.getLineLength(ie)+1},ke="hint",Re=re.getValueInRange(we).indexOf("hint");Re!==-1&&Se.push({kind:W.languages.InlayHintKind.Type,position:{lineNumber:we.startLineNumber,column:Re+ke.length+1},label:"[hint]"})}return{hints:Se,dispose:()=>{}}}})})(0,X),Me.onDidChangeContent(G=>{const W=p?.getScripts().getModules().getByName("scripts"),re=W?.getSource(),me=Y.getValue(),se=(re?.length??0)!==me.length||re!==me;j({dirty:se})}),Y.onDidChangeCursorPosition(G=>{ee()})},[p]),We=o.useMemo(()=>V?null:h||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[V,h]),ve=o.useMemo(()=>{if(!V){if(!rn){rn={};const X=Lt.length;for(let de=0;de<X;de++){const Me=Lt[de];rn[Me]=globalThis[Me]}}if(ln){const X=Lt.length;for(let de=0;de<X;de++){const Me=Lt[de];globalThis[Me]=ln[Me]}}}const Y=p?.getScripts().getModules()?.getByName("scripts")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(Sa,{theme:f?"extended-dark":"extended",options:{...qa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:Y,onValidate:X=>{let de=!1;const Me=X?X.length:0;for(let G=0;!de&&G<Me;G++)X[G].severity===8&&(de=!0)},beforeMount:X=>{X.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),X.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),X.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),X.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let de=!1,Me=!1;try{const G=await(async()=>await(await fetch(Ra)).text())(),W=X.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let re=X.editor.getModel(W);re?Me=!0:re=X.editor.createModel(G,"typescript",W),X.editor.setModelMarkers(re,"default",[]),de=!0}catch(G){console.warn("cant load types",G)}if(X.languages.registerLinkProvider("*",{provideLinks:(G,W)=>{const re=[],me={links:re},se=G.getLinesContent(),Se=se.length;for(let ie=1;ie<=Se;ie++){const we=se[ie-1],ke=X.editor.tokenize(we,"typescript"),Re=ke[0].length;for(let Le=0;Le<Re;Le++){const Ne=ke[0]?.[Le];if(Ne&&Ne.type.startsWith("string")){let v=Ne.offset,Oe=ke[0]?.[Le+1]?.offset??we.length,tt=new X.Range(ie,v+1,ie,Oe+1),te=G.getValueInRange(tt);const Te=te[0];Te!=="`"&&Te!=="'"&&Te!=='"'||(v++,te=te.substring(1));const Pe=te[te.length-1];Pe!=="`"&&Pe!=="'"&&Pe!=='"'||(v++,te=te.substring(0,te.length-1));try{p.getRanges(te)&&re.push({range:{endColumn:Oe,endLineNumber:ie,startColumn:v,startLineNumber:ie},tooltip:`Goto range '${te}'`,url:`/range/${te}`})}catch(ze){console.warn(ze)}}}}return me}}),X.editor.registerLinkOpener({open(G){if(G?.path?.startsWith("/range/")){try{p.getRanges(G.path.substring(7))?.select()}catch(W){console.warn("invalid range",W)}return!0}return!1}}),!Me){const G=X.languages.typescript.typescriptDefaults.getCompilerOptions();X.languages.typescript.typescriptDefaults.setCompilerOptions({...G,target:X.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:X.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(Z.current&&(await dr(m.current.editor,m.current.monaco,Z.current),Z.current=null),M.current&&requestAnimationFrame(async()=>{M.current&&X.editor.focus()}),!ln){ln={};const G=Lt.length;for(let W=0;W<G;W++){const re=Lt[W];ln[re]=globalThis[re]}}})()},onMount:Ae})}),We]})},[p,z,l,We,f]),He=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:Y=>{he(Y)},close:()=>be(),getEditor:()=>p?.getEditor()}),[p]);return o.useEffect(()=>(s&&requestAnimationFrame(()=>{He.current?.focus()}),()=>{m.current?.editor&&requestAnimationFrame(()=>{He.current?.contains(document.activeElement)&&He.current?.focus()})}),[]),c.jsx("div",{className:dt("script-editor",xa,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:He,...w,children:ve})})),Ia=Object.freeze(Object.defineProperty({__proto__:null,FindScopeOptions:{Workbook:"workbook",Sheet:"sheet"}},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),c.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),c.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),c.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),c.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=si,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=Ia,exports.CornerTriangle=uo,exports.DefaultTaskPaneRegistry=Dn,exports.DocThemesContext=Fn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Fn.Provider,{value:t,children:n})},exports.EditableLabel=Ir,exports.EmptyFrame=Ql,exports.FilterButton=ur,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=Cr,exports.MovableArea=qr,exports.PictureEditor=Tr,exports.Row=rl,exports.ScriptEditor=Ta,exports.SheetCellEditor=hr,exports.SheetCellRenderer=gr,exports.SheetElement=Mr,exports.SheetScrollbar=bo,exports.StaticBorderRenderer=Sl,exports.StyledStrokePath=fr,exports.Tab=ol,exports.TabStrip=ll,exports.TaskPaneArea=Al,exports.TaskPaneProvider=({children:e,createArea:t,onUpdateArea:n,registry:i=Dn})=>{const a=o.useRef(null),l=o.useRef(null),[f,h]=o.useState(null),[s,y]=o.useState(null),b=o.useMemo(()=>({activateTaskPane(m,M){l.current!==m&&(a.current?a.current.activateTaskPane(m,M):(h(m),w(m)))}}),[]),w=r.useCallbackRef(m=>{const M=t({registry:i,onClose:()=>{y(null),n?.(null)}},T=>{T&&y(T)});return n?.(M),M},[t,i,f]);return o.useEffect(()=>{s&&f&&(s.activateTaskPane(f,{autoFocus:!0}),h(null))},[f,s]),o.createElement(yr.Provider,{value:s??b},e)},exports.TaskPaneStrip=wo,exports.TaskPaneTitle=yo,exports.createCellEditStateFromCell=mr,exports.useBordersOverlay=Co,exports.useDocThemes=()=>{const e=o.useContext(Fn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=et,exports.useMovableCommands=Sr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const s={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(s)}const f=s=>{a.current?.(s)},h=e.getRange(t).addListener(f,i);if(l){const s=e.getRange(t);f({getSource:()=>s,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{h?.()}},[e,t])},exports.useSheetCommands=br,exports.useSheetCopyPaste=xr,exports.useTaskPaneArea=wr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
33
+ `,p=!0));const M=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${k}`}];let T=null;i.pushEditOperations([],M,z=>(T=z[0].range,y&&T.startLineNumber++,p&&T.endLineNumber--,[new t.Selection(T.startLineNumber,T.startColumn,T.endLineNumber,T.endColumn)])),e.setSelection({startLineNumber:T.endLineNumber,startColumn:T.endColumn,endLineNumber:T.startLineNumber,endColumn:T.startColumn})};function Ra(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function vo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,f=e.getPositionAt(l);a.push({name:i.text,type:Ra(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)vo(e,t,n,l,a);return a}function Io(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const h=a[f];if(h.start<=t&&t<h.start+h.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const c of e.childItems||[]){const C=Io(c,t,n,i);if(C)return C}}return null}}function ka(e){return e.kind==="comment"}const Ma=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:h,autoFocus:c=!0,frame:C,onStatusChange:k,...y}=e,p=o.useRef(null),M=o.useRef(!1),T=o.useMemo(()=>({contains(ge){if(!p.current)return;const B=p.current.editor;return B&&B.getDomNode()?.contains(ge)},focus(){if(!p.current)return;const ge=p.current.editor;return ge&&ge.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",T,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),D=o.useMemo(()=>{let ge=null;const B=()=>T;return ge=a?a.createChildGroup(B,"scriptEditor",!1):new r.CommandGroup(B,"scriptEditor"),ge.addCommands(z,!0),ge},[a,z]),Z=a.getGroup("workbook"),K=r.useCommands(Z,["executeSelectedScript","saveScripts"]),w=K[0],L=K[1],v=w?.context(),[I,q]=o.useState({message:"Loading",cursor:"",dirty:!1}),[X,E]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),j=r.useCallbackRef(ge=>{q(B=>{const Fe={...B,...ge};return he.CommonUtils.deepEqual(Fe,B)?B:(L.update({disabled:!Fe.dirty}).updateCallback(async()=>{await $()}),Fe)})},[k,L]);o.useEffect(()=>{k?.(I)},[k,I]);const $=r.useCallbackRef(async()=>{if(!p.current)return;const ge=p.current.editor;let B;if(I.dirty){const Fe=ge.getValue();await v?.saveSource(Fe),B=v?.getScripts().getModules().getByName("scripts");const ze=B?.getSource(),H=ge.getValue(),W=(ze?.length??0)!==Fe.length||ze!==H;j({dirty:W})}else B=v?.getScripts().getModules().getByName("scripts");return B},[I]);o.useEffect(()=>{const ge=C?.addListener({onBeforeHide:async()=>(await $(),!0)});return()=>{ge?.()}},[C]),o.useEffect(()=>{const ge=v?.getScripts();if(ge)return ge.addListeners({onBeforeSearch:()=>$()})},[v]);const ve=r.useCallbackRef(ge=>{w?.execute(ge)},[w]),Y=o.useRef(""),[_,A]=o.useState(!1),J=r.useCallbackRef(async()=>{if(!p.current)return null;const ge=p.current,B=ge.editor;if(!B)return null;const Fe=ge.monaco,ze=await(async(H,W,me="export")=>{const ue=H.getModel();if(!ue)return null;const fe=await W.languages.typescript.getTypeScriptWorker(),Me=await fe(ue.uri),ae=await Me.getNavigationTree(ue.uri.toString());let be=null,g=H.getSelection();if(!g)return null;const Le=g.startLineNumber===g.endLineNumber&&g.startColumn===g.endColumn?ue.getLineCount():Math.min(g.endLineNumber,ue.getLineCount());for(let Oe=g.startLineNumber;!be&&Oe<=Le;Oe++){const Te=Io(ae,ue.getOffsetAt({lineNumber:Oe,column:1}),"function",me);Te&&(be=Te.text)}return be})(B,Fe);return j({message:(ze??"").toUpperCase()}),ze?{source:B.getValue(),name:ze}:null},[]);r.useCallbackRef(he.CommonUtils.debounce($,200),[]);const x=r.useCallbackRef(async(ge,B,Fe)=>{E(H=>({...H,compiling:!0}));const ze=await v?.getScripts().createModule({source:Fe?.getValue(),declarationsOnly:!0});ze&&((async function(H,W){const me=[];for(let ue=1;ue<H.getLineCount()+1;ue++){const fe={startLineNumber:ue,startColumn:1,endLineNumber:ue,endColumn:H.getLineLength(ue)+1},Me=H.getValueInRange(fe).indexOf("modelt");Me!==-1&&me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:W.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Me+1,endLineNumber:fe.startLineNumber,endColumn:Me+5})}W.editor.setModelMarkers(H,"owner",me)})(ge,B),(async function(H,W,me,ue){const fe=await W.languages.typescript.getTypeScriptWorker(),Me=await fe(H.uri),ae=await Me.getNavigationTree(H.uri.toString()),be=vo(H,W,ue,ae).map(g=>{let Le=null,Oe=null;return g.type==="formula"?(Le="formula.margin-icon",Oe="Formula"):g.type==="macro"?(Le="macro.margin-icon",Oe="Macro"):g.type==="autoRun"&&(Le="autorun.margin-icon",Oe="Auto Run"),{range:new W.Range(g.lineNumber,1,g.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Le,glyphMarginHoverMessage:{value:Oe},stickiness:W.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});Pe.current&&Pe.current.clear(),Pe.current=me.createDecorationsCollection(be)})(ge,B,Fe,ze?ze.getFunctions().getItems():he.CommonUtils.EmptyArray),E(H=>({...H,compiling:!1})))},[v]),S=r.useCallbackRef(he.CommonUtils.debounce(x,580),[]),oe=r.useCallbackRef(async(ge=void 0)=>{if(!p.current||!v)return;const B=p.current.editor.getPosition(),Fe={cursor:B?B.toString():""};ge!==void 0&&(Fe.message=ge),j(Fe);const ze=J();v.setSelectedFunction(ze)},[v]);o.useEffect(()=>{},[X]);const ie=o.useRef(null),qe=r.useCallbackRef(async()=>{await $(),C?.close()},[C]);o.useEffect(()=>{if(!v)return;const ge={insertSnippet:Fe=>{p.current?.editor&&dr(p.current.editor,p.current.monaco,Fe)},close:()=>qe()};v.setEditor(ge),v.setSelectedFunction(J());const B=v.addContainerListener({onBeforeSave:async()=>{$()},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!v)return;const Fe=p.current.editor,ze=v.getScripts().getModules().getItems()[0]?.getSource()??"";Fe.setValue(ze)}});return()=>{v.setEditor(null),B()}},[v]),o.useEffect(()=>()=>{const ge=ie.current;if(ge){ge.dispose();const B=ge.debounceTimer;B!==void 0&&clearTimeout(B),ie.current=null}},[_]);const de=r.useCallbackRef(ge=>{const B=p.current?.editor;return!!B&&(B.focus(ge),!0)},[I]),Pe=o.useRef(null),je=r.useCallbackRef((ge,B)=>{p.current={monaco:B,editor:ge},A(!0),oe("Loading Types");const Fe=v?.getScripts().getModules().getItems()[0]?.getSource()??"";ge.setValue(Fe),Promise.resolve().then(()=>require("./n4OQZCE7fVxRfX1r.cjs")).then(H=>H.customEditor).then(async H=>{oe(""),H.AutoTypings.create(ge,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:B,onUpdate:(W,me)=>{if(W.type==="LookedUpPackage"&&W.success!==void 0){const ue=B.languages.typescript.typescriptDefaults.getDiagnosticsOptions();B.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ue,diagnosticCodesToIgnore:[]})}},onError:W=>{W==="Not implemented yet"&&(W="Compile Errors"),console.warn("Error compiling types",W)}}).then(W=>{ie.current=W;const me=ge.getModel();S(me,B,ge),(()=>{if(cr)return;const ue=(Me,ae)=>{try{if(ae===void 0)try{delete globalThis[Me]}catch{try{globalThis[Me]=void 0}catch{}}else globalThis[Me]=ae}catch{}},fe=Et.length;for(let Me=0;Me<fe;Me++){const ae=Et[Me];ue(ae,nn[ae])}nn=void 0,cr=!0})()})}),ge.addCommand("executeScript",function(H,...W){W?.[0]&&ve({functionName:W?.[0]})},""),ge.addAction({id:"executeScript",label:"Execute",keybindings:[B.KeyCode.F8],run:async H=>{const W=J();v?.setSelectedFunction(W);const me=await W;ve(me)}}),ge.addAction({id:"saveScript",label:"Save Script",keybindings:[B.KeyMod.CtrlCmd|B.KeyCode.KeyS],run:H=>{$()}}),ge.onMouseDown(async H=>{if(H.target.type===B.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const W=H.target.position.lineNumber,me=await B.languages.typescript.getTypeScriptWorker(),ue=await me(ze.uri),fe=await ue.getNavigationTree(ze.uri.toString()),Me=(await $()).getFunctions().getItems(),ae=vo(ze,B,Me,fe).find(be=>be.lineNumber===W);if(ae){const be=H.event.browserEvent.button;be===0?ae.type==="macro"||ae.type==="autoRun"?ve({functionName:ae.name}):ae.type==="formula"&&v?.quickInsertFunction?.(ae.name):be===2&&(console.log("Context menu for function:",ae.name),H.event.browserEvent.preventDefault())}}}),ge.onDidChangeModelContent(()=>{j({dirty:!0}),S(ze,B,ge)}),B.editor.onDidChangeMarkers(H=>{H.some(W=>W.toString()===ze.uri.toString())});const ze=ge.getModel();(function(H,W){W.languages.registerInlayHintsProvider("typescript",{provideInlayHints(me,ue,fe){const Me=[];for(let ae=1;ae<me.getLineCount()+1;ae++){const be={startLineNumber:ae,startColumn:1,endLineNumber:ae,endColumn:me.getLineLength(ae)+1},g="hint",Le=me.getValueInRange(be).indexOf("hint");Le!==-1&&Me.push({kind:W.languages.InlayHintKind.Type,position:{lineNumber:be.startLineNumber,column:Le+g.length+1},label:"[hint]"})}return{hints:Me,dispose:()=>{}}}})})(0,B),ze.onDidChangeContent(H=>{const W=v?.getScripts().getModules().getByName("scripts"),me=W?.getSource(),ue=ge.getValue(),fe=(me?.length??0)!==ue.length||me!==ue;j({dirty:fe})}),ge.onDidChangeCursorPosition(H=>{oe()})},[v]),De=o.useMemo(()=>_?null:h||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[_,h]),Ie=o.useMemo(()=>{if(!_){if(!nn){nn={};const B=Et.length;for(let Fe=0;Fe<B;Fe++){const ze=Et[Fe];nn[ze]=globalThis[ze]}}if(on){const B=Et.length;for(let Fe=0;Fe<B;Fe++){const ze=Et[Fe];globalThis[ze]=on[ze]}}}const ge=v?.getScripts().getModules()?.getByName("scripts")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(o.Suspense,{children:s.jsx(qa,{theme:f?"extended-dark":"extended",options:{...xa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:ge,onValidate:B=>{let Fe=!1;const ze=B?B.length:0;for(let H=0;!Fe&&H<ze;H++)B[H].severity===8&&(Fe=!0)},beforeMount:B=>{B.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),B.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),B.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),B.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Fe=!1,ze=!1;try{const H=await(async()=>await(await fetch(Sa)).text())(),W=B.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let me=B.editor.getModel(W);me?ze=!0:me=B.editor.createModel(H,"typescript",W),B.editor.setModelMarkers(me,"default",[]),Fe=!0}catch(H){console.warn("cant load types",H)}if(B.languages.registerLinkProvider("*",{provideLinks:(H,W)=>{const me=[],ue={links:me},fe=H.getLinesContent(),Me=fe.length;for(let ae=1;ae<=Me;ae++){const be=fe[ae-1],g=B.editor.tokenize(be,"typescript"),Le=g[0].length;for(let Oe=0;Oe<Le;Oe++){const Te=g[0]?.[Oe];if(Te&&Te.type.startsWith("string")){let u=Te.offset,N=g[0]?.[Oe+1]?.offset??be.length,U=new B.Range(ae,u+1,ae,N+1),m=H.getValueInRange(U);const F=m[0];F!=="`"&&F!=="'"&&F!=='"'||(u++,m=m.substring(1));const G=m[m.length-1];G!=="`"&&G!=="'"&&G!=='"'||(u++,m=m.substring(0,m.length-1));try{v.getRanges(m)&&me.push({range:{endColumn:N,endLineNumber:ae,startColumn:u,startLineNumber:ae},tooltip:`Goto range '${m}'`,url:`/range/${m}`})}catch(te){console.warn(te)}}}}return ue}}),B.editor.registerLinkOpener({open(H){if(H?.path?.startsWith("/range/")){try{v.getRanges(H.path.substring(7))?.select()}catch(W){console.warn("invalid range",W)}return!0}return!1}}),!ze){const H=B.languages.typescript.typescriptDefaults.getCompilerOptions();B.languages.typescript.typescriptDefaults.setCompilerOptions({...H,target:B.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:B.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(Y.current&&(await dr(p.current.editor,p.current.monaco,Y.current),Y.current=null),M.current&&requestAnimationFrame(async()=>{M.current&&B.editor.focus()}),!on){on={};const H=Et.length;for(let W=0;W<H;W++){const me=Et[W];on[me]=globalThis[me]}}})()},onMount:je})}),De]})},[v,D,l,De,f]),ke=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:ge=>{de(ge)},close:()=>qe(),getEditor:()=>v?.getEditor()}),[v]);return o.useEffect(()=>(c&&requestAnimationFrame(()=>{ke.current?.focus()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{ke.current?.contains(document.activeElement)&&ke.current?.focus()})}),[]),s.jsx("div",{className:ct("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:ke,...y,children:Ie})})),Ta=Object.freeze(Object.defineProperty({__proto__:null,FindScopeOptions:{Workbook:"workbook",Sheet:"sheet"}},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.LicenseManager}),exports.ChartAreaIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),s.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),s.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),s.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),s.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),s.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),s.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),s.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),s.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),s.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),s.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),s.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),s.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),s.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=ai,exports.ChartLineIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),s.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),s.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),s.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),s.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),s.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),s.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),s.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),s.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),s.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),s.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),s.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),s.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),s.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),s.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),s.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),s.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),s.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),s.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),s.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=Ta,exports.CornerTriangle=uo,exports.DefaultTaskPaneRegistry=En,exports.DocThemesContext=Tn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return s.jsx(Tn.Provider,{value:t,children:n})},exports.EditableLabel=Ir,exports.EmptyFrame=Jl,exports.FilterButton=ur,exports.Item=To,exports.LogoNoPaddingIcon=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),s.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),s.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),s.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=Cr,exports.MovableArea=qr,exports.PictureEditor=Tr,exports.Row=rl,exports.ScriptEditor=Ma,exports.SheetCellEditor=hr,exports.SheetCellRenderer=gr,exports.SheetElement=Mr,exports.SheetScrollbar=bo,exports.StaticBorderRenderer=ql,exports.StyledStrokePath=fr,exports.Tab=ol,exports.TabStrip=ll,exports.TaskPaneArea=Fl,exports.TaskPaneProvider=({children:e,renderArea:t,onUpdateArea:n,registry:i=En})=>{const a=o.useRef(null),l=o.useRef(null),[f,h]=o.useState(null),[c,C]=o.useState(null),k=r.useCallbackRef(p=>{const M=t({registry:i,onClose:()=>{C(null),n?.(null)},ref:T=>{T&&C(T)}});return n?.(M),M},[t,i,f]),y=o.useMemo(()=>({activateTaskPane(p,M){l.current!==p&&(a.current?a.current.activateTaskPane(p,M):(h(p),k(p)))}}),[]);return o.useEffect(()=>{c&&f&&(c.activateTaskPane(f,{autoFocus:!0}),h(null))},[f,c]),o.createElement(yr.Provider,{value:c??y},e)},exports.TaskPaneStrip=wo,exports.TaskPaneTitle=yo,exports.createCellEditStateFromCell=mr,exports.useBordersOverlay=Co,exports.useDocThemes=()=>{const e=o.useContext(Tn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=Sr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const c={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(c)}const f=c=>{a.current?.(c)},h=e.getRange(t).addListener(f,i);if(l){const c=e.getRange(t);f({getSource:()=>c,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{h?.()}},[e,t])},exports.useSheetCommands=br,exports.useSheetCopyPaste=xr,exports.useTaskPaneArea=wr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});