@sheetxl/react 0.1.120 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{build/LICENSE.md → LICENSE.md} +1 -1
- package/{build/browser/cjs/CthJ-XrEQnwzvPhO.cjs → browser/cjs/BBxxczNZCba1hv7p.cjs} +1 -1
- package/{build/browser/cjs/Ctu5S2g3fltghqia.cjs → browser/cjs/DKiOfqa5nItDUd8L.cjs} +1 -1
- package/{build/browser/cjs/s8KvNJO5mPuddufN.cjs → browser/cjs/SCBX5JOswC8iI0UG.cjs} +1 -1
- package/{build/browser → browser}/cjs/index.cjs +4 -4
- package/{build/browser/esm/C59gZHntD_Fxcw2s.mjs → browser/esm/CUjHpURgClxT6pkr.mjs} +1 -1
- package/{build/browser/esm/CIRN6v4iWE_6J3Lk.mjs → browser/esm/DLKNIw4kS3RTD7SI.mjs} +1 -1
- package/{build/browser/esm/BDpEU_4l5uuqRrUK.mjs → browser/esm/DvgXJ4zs4t-AuOXe.mjs} +1 -1
- package/{build/browser → browser}/esm/index.mjs +4 -4
- package/{build/node/esm/DlC8ayzzkrCX79US.mjs → node/esm/Bmw8GVpd2Eqo5TgC.mjs} +1 -1
- package/{build/node → node}/esm/index.mjs +2 -2
- package/package.json +30 -50
- package/build/README.md +0 -6
- package/build/package.json +0 -60
- /package/{build/licenses → licenses}/dependencies.txt +0 -0
- /package/{build/node → node}/assets/style.css +0 -0
- /package/{build/types → types}/index.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Repository Licensing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
|
|
4
4
|
|
|
5
5
|
For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1tnw9_9 ._viewport-overlay_1tnw9_11{pointer-events:none}._sheetxl-sheet_1tnw9_9 ._viewport-overlay_1tnw9_11 *{pointer-events:initial}._sheetxl-sheet_1tnw9_9 .cell-container>*{overflow:hidden}._sheetxl-sheet_1tnw9_9 .cell-container .text-box{position:absolute}._sheetxl-sheet_1tnw9_9 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1tnw9_9 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1tnw9_9 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1tnw9_9 .cell-container .fill{position:absolute}._sheetxl-sheet_1tnw9_9 .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_1tnw9_1 1.5s infinite alternate}@keyframes _pulse_1tnw9_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1tnw9_9 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1tnw9_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1tnw9_9 .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_1tnw9_9 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1tnw9_9 .cell-container .inc{animation-delay:0s;animation:_increase_1tnw9_1 3s infinite}@keyframes _fadeIn_1tnw9_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1tnw9_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_1tbzy_9 .fill-handle .dragging,._movable-area_1xcl8_9 .moveable-control-box .dragging{opacity:0}._movable-area_1xcl8_9 .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_1xcl8_9 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_1xcl8_9 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_w34rk_11{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_6tyma_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_6tyma_65{0%{opacity:0}to{opacity:1}}._Wrapper_6tyma_49{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_6tyma_49._dragOverlay_6tyma_73{z-index:999}._Item_6tyma_93{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_6tyma_93:not(._withHandle_6tyma_121){touch-action:manipulation}._Item_6tyma_93._dragging_6tyma_131:not(._dragOverlay_6tyma_73){z-index:999}._Item_6tyma_93._dragOverlay_6tyma_73{cursor:inherit;animation:_pop_6tyma_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_11qr0_1{display:flex;box-sizing:border-box}._TabStrip_nciwy_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_nciwy_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_faoxm_9 .monaco-editor{position:absolute}._script-editor_faoxm_9 .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_faoxm_9 .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_faoxm_9 .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_faoxm_9 .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.
|
|
3
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
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.
|
|
@@ -20,11 +20,11 @@ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.Ke
|
|
|
20
20
|
|
|
21
21
|
The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",b,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
22
22
|
|
|
23
|
-
The content is not applied.`}),new r.Command("pasteFormulas",b,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",b,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",b,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(M,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const b={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(M=>j.paste({...zl,...M})).update(b),i.getCommand("pasteFormats").updateCallback((M,B)=>j.paste({...Nl,description:B.label(),...M})).update(b),i.getCommand("pasteFormulas").updateCallback((M,B)=>j.paste({...Ll,description:B.label(),...M})).update(b),i.getCommand("pasteTranspose").updateCallback((M,B)=>j.paste({...Ol,description:B.label(),...M})).update(b),i.getCommand("pasteLinks").updateCallback((M,B)=>j.paste({...jl,description:B.label(),...M})).update(b),i.getCommand("cut").update(b),i.getCommand("paste").update(b)},[t,i]);const S=o.useMemo(()=>{if(!z||!q.current)return;const b=z.key;if(b!=="copy"&&b!=="cut"&&b!=="formatPainter")return;const M=q.current.getItem();if(M.getSource()!==t)return;const B=q.current.isCut?.(),F=B?R:g,A=B?f:m,_=M.getCoords(),G=_?[_]:null;return G&&G.length!==0?P=>{const V=[];for(let $=0;$<G.length;$++){const te=G[$],N=P.toClipBounds(P.getRangeCoordsBounds(te,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(V.push(T({range:te,key:`copy-selection-background-${$}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:F,strokeWidth:2})),V.push(T({range:te,key:`copy-selection-foreground-${$}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[z,t,n,m,g,f,R]);return{...j,clipboard:w,overlays:S}},Bl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,f=l.body??{},g=a.getView(),{overlays:R}=Sr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:f.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:f.fill,notifier:m});return et(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),R&&n?R(n):null})),Vl="_sheet-selection_1tbzy_9",Pl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Hl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Ul={key:"dragCopy",description:"Drag selection to copy cell contents."},Kl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Uo=(e,t)=>t.ctrlKey&&t.shiftKey?Kl:t.ctrlKey?Ul:t.shiftKey?Hl:Pl,$l={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Wl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:f,sheet:g,gridRef:R,gridStyle:h,isActive:p,editingCoords:T,...q}=e,D=n?.getBounds(),z=r.useCallbackRef(m,[m]),W=r.useCallbackRef(f,[f]),[K,w]=o.useState(()=>g?.getSelection().getCoords()),j=r.useCallbackRef(ge=>{ue.CoordUtils.isEqualSelectionCoords(ge,K)||g&&g.getSelection().updateCoords(ge)},[g,K]),S=r.useEditMode(),b=o.useRef(null),[M,B]=o.useState(g?.getProtection().isLocked()),[F,A]=o.useState(g?.getView().getMovableSelection().length>0),_=r.ReactUtils.detectIt().primaryInput==="touch",G=!_&&p,P=T!==null||F,V=r.useCallbackRef(ge=>{const ce=ue.CoordUtils.cellToRange(ge);if(g.isClosed())return ce;const we=g.getRange(ce,{excludeHidden:!0}).getMerges();return we.length===0?ce:we[0]},[g]),$=r.useCallbackRef((ge,ce,we,de,ye,Ae)=>{const ve=g.getSelectedRange().getExtended(de,ge).getCoords();switch(de){case s.IRange.Direction.Up:return ve.rowStart;case s.IRange.Direction.Down:return ve.rowEnd;case s.IRange.Direction.Left:return ve.colStart;case s.IRange.Direction.Right:return ve.colEnd}},[g]),te=r.useCallbackRef(()=>{const ge=g.getUsedRange()?.getCoords(),ce=g.getRowHeaders().getUsedRange()?.getCoords(),we=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ge,colEnd:Math.max(ge?.colEnd??0,we?.max??0),rowEnd:Math.max(ge?.rowEnd??0,ce?.max??0)}},[g]),N=r.useCallbackRef((ge,ce)=>g.getRowHeaders().hiddenHeadersAt(ge,ce),[g]),x=r.useCallbackRef((ge,ce)=>g.getColumnHeaders().hiddenHeadersAt(ge,ce),[g]),H=r.useCallbackRef(ge=>g.getRange(ge,{excludeHidden:!0}).getMerges(),[g]),ne=r.useCallbackRef(ge=>{g?.getSelection().setAdjusting(ge)},[g]),be=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),S.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),S.setMode(null))},[S,K,g,i]),oe=o.useMemo(()=>{const ge=S.getMode();return ge?.key==="cut"||ge?.key==="copy"},[S]);et(g?.getView(),{onMovableSelectionChange:()=>{A(g.getView().getMovableSelection().length>0)}}),et(g?.getSelection(),{onChange(ge){const ce=g.getSelection().getCoords();w(ce)}}),et(g,{onProtectionChange:()=>{B(g.getProtection().isLocked())}});const{body:X={}}=h||{},ae=n.getLayout(),Me=!(G&&K.ranges.length<=1&&T===null&&!M&&(!S.getMode()||oe)),{cursor:Te,overlay:fe,onPointerDown:Be}=dt.useSelection({gridRef:R,commands:i,layout:ae,getCellCoordsAsRangeCoords:V,selection:K,fillHandleBorderColor:X.fill,selectionBackgroundColor:p?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:p?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:p?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:p?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Me,disableMoveDrag:_||!(p&&K.ranges.length<=1&&T===null&&!M),disableTouchSelection:P,onSelectionChange:j,onSelectionDragStart:ne,onSelectionDragEnd:be,onMoveDragStart:(ge,ce,we)=>{S.setMode(Uo(0,we))},onMoveDragUpdate:(ge,ce,we)=>{S.setMode(Uo(0,we))},onMoveDragEnd:(ge,ce)=>{S.setMode(null)},onMoveDragDone:async(ge,ce,we)=>{if(ue.CoordUtils.isEqualRanges(ge,ce))return;const de=g.getRange(ce);if(d?.showOptions){const Oe=de.getDifferences(ge);let He=!1;for(let C=0;!He&&C<Oe.getCount();C++)He=Oe.at(C).isContentful();if(He&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ye=!we.ctrlKey,Ae=we.shiftKey,ve=Ae?ye?"Insert Moved Cells":"Insert Copied Cells":ye?"Move Cells":"Copy Cells",Fe=await d?.showBusy?.(ve);try{const Oe=g.getRange(ge);await de.doBatch(async()=>{Ae?await de.insertFrom(ge,{isCut:ye,undoRange:Oe}):await de.copyFrom(ge,{isCut:ye,undoRange:Oe}),Oe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),de.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:ve,autoSelect:!0})}catch(Oe){d?.showError?.(Oe)}finally{Fe?.()}},contentfulCellFinder:$,hiddenRowsAt:N,hiddenColumnsAt:x,mergedRanges:H,getDataCoords:te,canSelectionSpanMergedCells:ge=>{const ce=g.getRange(ge);return ce.isEntireColumns()||ce.isEntireRows()},onFill:async(ge,ce)=>{const we="Auto Fill",de=await d?.showBusy?.(we);try{await g.doBatch(()=>{g.getRange(ge).autoFill(ce),g.getRange(ce).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(ye){d?.showError?.(ye)}finally{b.current=null,de?.()}},onFillPreview:(ge,ce,we)=>{if(R.current&&z){S.setMode($l);try{b.current?.direction!==we&&(b.current=null,g.getRange(ge).autoFill(ce,{previewOnly:C=>{b.current={callback:C,direction:we}}}));const de=b.current?.callback?.(ce);if(!de||de.isEmpty())return;const ye=de.toText();if(!ye)return;const Ae=ue.CoordUtils.cellToRange(de.getCoords()),ve=n.getRelativePointFromClient(0,0);let Fe=0,Oe=0,He=r.ToolTipPlacement.Bottom;if(we===s.IRange.Direction.Down){Fe=ae.getColOffset(Ae.colEnd+1)-ve.x;const C=ae.getRowOffset(Ae.rowEnd),Ue=ae.getRowOffset(Ae.rowEnd+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Right){Oe=ae.getRowOffset(Ae.rowEnd+1)-ve.y;const C=ae.getColOffset(Ae.colEnd),Ue=ae.getColOffset(Ae.colEnd+1);Fe=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}else if(we===s.IRange.Direction.Up){Fe=ae.getColOffset(Ae.colEnd+1)-ve.x;const C=ae.getRowOffset(Ae.rowStart),Ue=ae.getRowOffset(Ae.rowStart+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Left){Oe=ae.getRowOffset(Ae.rowEnd+1)-ve.y;const C=ae.getColOffset(Ae.colStart),Ue=ae.getColOffset(Ae.colStart+1);Fe=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}z({anchor:{x:Fe,y:Oe},display:ye,placement:He})}catch(de){d?.showError?.(de)}}},onFillDone:()=>{b.current=null,S.setMode(null),W?.()}}),pe=r.useCallbackRef(ge=>{Be(r.ReactUtils.createSyntheticEvent(ge))},[Be,T]);o.useEffect(()=>{const ge=n?.getStage();if(ge)return ge.addEventListener("pointerdown",pe),()=>{ge.removeEventListener("pointerdown",pe)}},[n?.getStage()]);const Pe=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:yt(a,"sheet-selection",Vl),style:{position:"absolute",width:D?.width,height:D?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Wt([Pe,Se]),...q,children:fe(n)})})),kn=Object.freeze({x:0,y:0,width:0,height:0}),Gl={fireOnModelChange:!1},_l=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:f,onUnFocus:g,isDragging:R,updateFrameBounds:h,dragStart:p,style:T,disabled:q,renderMovable:D,...z}=e,[W,K]=o.useState(kn),[w,j]=o.useState(null),[S,b]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const A=i.toViewBounds(F);K(A??kn),h(A??kn)},[i?.getBounds()]),et(a,{onBoundsChange:F=>{const A=F.getBounds();if(!A)return;const _=i.toViewBounds(A);K(_??kn),h(_)},onSelectionChange:()=>{const F=ue.CommonUtils.hasFocus(M.current,!0);!S&&!F||a.isSelected()||g()}}),et(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(M.current,!0)},Gl),o.useEffect(()=>{const F=M.current;return l(F),()=>{d(F)}},[]);const B=o.useMemo(()=>{if(!W)return null;let{width:F,height:A}=W;return D({view:i,movable:a,disabled:q,isDragging:R,style:{position:"relative",left:0,top:0,width:F,height:A},onHide:m,onShow:f})},[i,a,W.width,W.height,q,R]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Wt([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:W.x,top:W.y,width:W.width,height:W.height,...T},onMouseDown:async F=>{const A=F.shiftKey||F.ctrlKey,_=a.isSelected(),G=F.currentTarget;A&&_?a.unselect():(_&&!A||await a.select({addToSelection:A}),p(F.nativeEvent,G),G.focus())},onFocus:F=>{F.relatedTarget&&!w&&j(F.relatedTarget),b(!0)},onBlur:F=>{w&&!M?.current?.contains(F.relatedTarget)&&j(null),F.relatedTarget&&b(!1)},...z,children:B})})),Zl="_movable-area_1xcl8_9",Rr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:f,disabled:g=!1,disableDrag:R=!1,disableResize:h=!1,className:p,style:T,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:D,...z}=e,W=n.getBounds(),K=r.useCallbackRef(D,[D]),w=r.useCallbackRef(m,[m]),j=r.useCallbackRef(f,[f]),[S,b]=o.useState([]),[M,B]=o.useState(!1),[F,A]=o.useState(!1),_=o.useRef(!0),G=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),te=o.useRef(new Map),N=o.useRef({onRequestFocus:J=>(ce(J),null)}),x=o.useRef(null),H=o.useRef(null),ne=o.useRef(null),[be,oe]=o.useReducer(J=>J+1,0);o.useLayoutEffect(()=>{oe()},[n,i]),et(i,{onCollectionChange:()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ee=te.current;Ee.forEach(Ie=>{Ie()}),Ee.clear();const Ve=N.current;for(let Ie=0;Ie<J.length;Ie++){const Ne=J[Ie];if(Ne.isClosed())continue;const De=Ne.addListeners(Ve);Ee.set(Ne,De)}oe()},onInvalidated:()=>{oe()}}),et(a,{onMovableSelectionChange(J){ae(),oe()}});const X=o.useCallback((J,Ee)=>{const Ve=V.current.get(J);ne.current&&(ne.current.getTargets().forEach(Ie=>{if(Ie===Ve)return Ie.style.left=Ee.x+"px",Ie.style.top=Ee.y+"px",Ie.style.width=Ee.width+"px",void(Ie.style.height=Ee.height+"px")}),ne.current.updateRect())},[]),ae=()=>{const J=[],Ee=a.getMovableSelection();Ee.forEach(Ve=>{const Ie=V.current.get(Ve);Ie&&Ee.indexOf(Ve)!==-1&&J.push(Ie)}),b(Ve=>ue.CommonUtils.isEqualArrays(Ve,J)?Ve:J)},Me=o.useRef(null),Te=o.useMemo(()=>new Promise(J=>{Me.current=J}),[]),fe=o.useRef(null),Be=r.useCallbackRef(async(J,Ee)=>{fe.current=Ee,await(async()=>!(!await Te.then()||!ne.current))()&&fe.current===Ee&&ne.current.dragStart(J,Ee)},[S]),[pe,Pe]=o.useState(!1),Se=o.useRef(null),ge=o.useRef(null),ce=r.useCallbackRef(async(J=null)=>{if(J||(J=a.getMovableSelection()[0]),!J)return w?.(),!1;const Ee=V.current.get(J);Ee?(await ue.CommonUtils.whenFocus(Ee),Ee.focus(),ge.current=Ee,Se.current=null):Se.current=J},[a]);o.useEffect(()=>{pe&&S.length>0&&ge.current!==S[0]&&ce(),_.current&&(K?.(),_.current=!1)},[S]);const we=o.useMemo(()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(J.length===0&&G.current.size===0)return null;const Ee=(k,re,O,Y=!0)=>{const u=k.isSelected(),I={tabIndex:O,view:n,movable:k,onRefLoad:E=>{Se.current===k&&(E.focus(),ge.current=E,Se.current=null),V.current.set(k,E),P.current.set(E,k),re.rendered=!0,ae()},onRefUnload:E=>{V.current.delete(k),P.current.delete(E),re.rendered=!1,ae()},onUnFocus:w,onHide:E=>{re.onHide=E},onShow:E=>{re.onShow=E},isDragging:u&&(F||M),disabled:g,renderMovable:l,updateFrameBounds:E=>{X(k,E)},dragStart:Be,onMouseUp:()=>{if(fe.current=null,H.current){B(!1),A(!1);let E=!1;$.current?.forEach(y=>{ue.CommonUtils.isEqualBounds(y.movable.getBounds(),y.startBounds)||(E=!0)}),E?ye():Ae()}},style:{opacity:Y?M&&u?.7:void 0:0,zIndex:M&&u?k.getZIndex()+J.length:void 0,pointerEvents:Y?void 0:"none",cursor:F&&u?"grabbing":g||R?"initial":"move",boxShadow:!u||F&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(_l,{...I},`movable-${k.getUUID()}`)},Ve=G.current,Ie=new Map,Ne=[];for(let k=0;k<J.length;k++){const re=J[k];if(re.isClosed())continue;let O=Ve.get(re);O||(O={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const I=++u.visibilityRequestId;requestAnimationFrame(()=>{const E=G.current.get(Y);E&&I===u.visibilityRequestId&&(u.onShow?.(Y),E.shown=!0)})},doHide:async(Y,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const I=++u.visibilityRequestId,E=await Promise.resolve(u.onHide?.(Y));I===u.visibilityRequestId&&E!==!1&&(u.shown=!1,G.current.delete(Y),oe())},visibilityRequestId:0}),O.frame=Ee(re,O,k,!0),Ne.push(O.frame),O.doShow(re,O),Ve.delete(re),Ie.set(re,O)}const De=[];return a.getMovableSelection().forEach(k=>{const re=Ve.get(k);re&&(re.frame=Ee(k,re,-1,!1),De.push(re.frame),Ve.delete(k),Ie.set(k,re))}),Ve.forEach((k,re)=>{k.frame=Ee(re,k,-1,!1),De.push(k.frame),k.doHide(re,k),Ve.delete(re),Ie.set(re,k)}),G.current=Ie,ae(),[...De,...Ne]},[be,n,l,g,R,h,M,F]),de=r.useCallbackRef((J,Ee)=>{const Ve=`${Ee} ${S.length===1?s.TextUtils.capitalize(P.current?.get(S[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${Ve}`),H.current.rollback(),H.current=null),H.current=d.beginCommit({description:Ve}),$.current.clear();for(let Ie=0;Ie<S.length;Ie++){const Ne=S[Ie],De=P.current?.get(Ne);De?$.current.set(Ne,{movable:De,startBounds:n.toViewBounds(De.getBounds())}):console.warn("invalid element",De)}},[d,n,S]),ye=o.useCallback(()=>{if(!H.current)return;const J=[];$.current?.forEach(Ee=>{J.push(Ee.movable)}),H.current.commit({viewAfter:{view:a,movableSelection:J}}),$.current.clear(),H.current=null},[]),Ae=o.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),ve=o.useRef(null);o.useEffect(()=>{ve.current&&(ve.current.onscroll=J=>{J.preventDefault(),J.srcElement.scrollTop=0,J.srcElement.scrollLeft=0})},[ve.current]);const Fe=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ce,focus:()=>{ce()}}),[a]),[Oe,He]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Je=o.useRef(!1);o.useEffect(()=>{if(g||S.length===0||Je.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{ne.current&&x.current&&ne.current.refTargets.length>0&&(Je.current=!0,Me.current?.(!0)),b([...S])});C.current=!0;const J=o.lazy(async()=>{try{const Ee=await Promise.resolve().then(()=>require("./s8KvNJO5mPuddufN.cjs"));return C.current=!1,Ue.current=!0,b([...S]),Ee}catch(Ee){return console.warn(Ee),Me.current?.(!1),null}});He(J)},[S,g,R,h]);const $e=o.useMemo(()=>!Oe||g?null:c.jsx(o.Suspense,{children:c.jsx(Oe,{className:yt({dragging:M||F,resizing:M,moving:F}),container:null,ref:ne,target:ne.current?S:[],draggable:!g&&!R,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:J=>{de(J.target,"Resize")},onResize:J=>{if(!H.current)return J.stopDrag(),void oe();B(!0);const Ee=J.direction[0]!==0&&J.direction[1]!==0;let Ve=0,Ie=0;for(let Ne=0;Ne<S.length;Ne++){const De=S[Ne],k=$.current.get(De),re=P.current.get(De);if(!k||!re){console.warn("invalid element");continue}let O=J.dist[0],Y=J.dist[1],u=J.drag.dist[0],I=J.drag.dist[1],E=k.startBounds.width,y=k.startBounds.height;Ne===0?(Ve=E,Ie=y):(O*=E/Ve,u*=E/Ve,Y*=y/Ie,I*=y/Ie);const L={...k.startBounds};if(L.width=Math.max(0,E+O),L.height=Math.max(0,y+Y),J.direction[0]===-1&&(L.width=Math.max(0,Math.min(k.startBounds.x+E,E-u))),J.direction[1]===-1&&(L.height=Math.max(0,Math.min(k.startBounds.y+y,y-I))),Ee&&(re.isLockAspectRatio()||J.inputEvent?.shiftKey)){const v=E/y,U=L.width/L.height;U>v?L.height=L.width/v:U<v&&(L.width=L.height*v)}J.direction[0]===-1&&(L.x=Math.max(0,Math.min(k.startBounds.x+E,k.startBounds.x+E-L.width))),J.direction[1]===-1&&(L.y=Math.min(k.startBounds.y+y,k.startBounds.y+y-L.height)),k.movable.setBounds(n.toAbsoluteBounds(L))}},onResizeEnd:J=>{B(!1),ye()},onDragStart:J=>{de(J.target,"Move")},onDrag:J=>{if(!H.current)return J.stopDrag(),void oe();A(!0);for(let Ee=0;Ee<S.length;Ee++){const Ve=S[Ee],Ie=$.current.get(Ve);Ie?Ie.movable.setBounds(n.toAbsoluteBounds({...Ie.startBounds,x:Ie.startBounds.x+J.translate[0],y:Ie.startBounds.y+J.translate[1]})):console.warn("invalid element")}},onDragEnd:J=>{},onMouseUp:J=>{}})}),[be,Oe,S,n,g,R,h,M,F]);return c.jsx("div",{className:yt(p,"movable-area",Zl),style:{width:W.width,height:W.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Wt([Fe,ve]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:W.width,height:W.height},...z,children:c.jsxs("div",{ref:x,style:{position:"absolute",pointerEvents:"auto"},onFocus:J=>{j?.(),Pe(!0)},onBlur:J=>{Pe(!1)},onKeyDownCapture:J=>{if(J.isDefaultPrevented())return;const Ee=J.nativeEvent.ctrlKey,Ve=J.nativeEvent.altKey,Ie=J.nativeEvent.shiftKey;if(J.which===r.KeyCodes.Escape){const O=a.getMovableSelection();let Y=[...O];return S.forEach(u=>{if(Y.length===0)return;const I=P.current.get(u);let E=Y.indexOf(I);Y.splice(E,1)}),Y.length!==O.length&&a.selectMovables(Y),Y.length===0&&w?.(),void J.preventDefault()}const Ne=.1,De=O=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+O)},"Rotate")},k=(O,Y=!0)=>{i.updateSelected(u=>{const I=u.getBounds();let E=1+O;Y||(E=1/E);const y=Math.sqrt(Math.pow(I.width,2)+Math.pow(I.height,2)),L=Math.atan2(I.height,I.width),v=E*y;if(v<10)return;const U=v*Math.cos(L),Z=v*Math.sin(L),ee={x:I.x+(I.width-U)/2,y:I.y+(I.height-Z)/2,width:U,height:Z};u.setBounds(ee)},"Resize")},re=O=>{i.updateSelected(Y=>{const u=Y.getBounds(),I={x:u.x+(O.x??0),y:u.y+(O.y??0),width:u.width+(O.width??0),height:u.height+(O.height??0)};Y.setBounds(I)},"Nudge")};if(J.which===r.KeyCodes.Delete)i.updateSelected(O=>{O.delete()},"Delete"),J.preventDefault();else if(J.key==="a"&&Ee){const O=a.getMovableSelection();a.selectMovables(i.search(),!0),a.selectMovables(O,!0),J.preventDefault()}else J.key==="ArrowLeft"?(Ie?k(Ne,!1):Ve?De(-10):re({x:Ee?-10:-1}),J.preventDefault()):J.key==="ArrowRight"?(Ie?k(Ne,!0):Ve?De(10):re({x:Ee?10:1}),J.preventDefault()):J.key==="ArrowUp"?(Ie?k(Ne,!0):re({y:Ee?-10:-1}),J.preventDefault()):J.key==="ArrowDown"&&(Ie?k(Ne,!1):re({y:Ee?10:1}),J.preventDefault())},children:[we,$e]})})})})),Ht=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ko=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,f=0;for(let h=0;h<e.length;h++){const p=e[h],T=p.getBounds();d+=T[l],m=Math.min(T[i],m),f=Math.max(T[i]+T[l],f),n.push({bounds:T,movable:p})}const g=(f-m-d)/(e.length-1);n.sort((h,p)=>{const T=h.bounds[i],q=p.bounds[i];return T!==q?T-q:h.bounds[a]-p.bounds[a]});const R=new Map;R.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const p=n[h-1].bounds,T={...n[h].bounds};T[i]=p[i]+p[l]+g,n[h].bounds=T,R.set(n[h].movable,T)}return R.set(n[n.length-1].movable,n[n.length-1].bounds),R};function kr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,f=r.useEditMode();o.useRef(f.getMode()).current=f.getMode();const g=r.useCallbackRef(async(w,j,S=null,b=!0)=>{const M=async()=>{const B=await Promise.resolve(m?.showBusy?.(w.label()));try{await j();const F=S??w?.label?.();if(d){let A=null;w&&F!==!1&&(A=new r.SimpleCommand(w.key(),l,{label:F,description:F},M)),d(A)}B?.(),b&&f.setMode(null)}catch(F){B?.(),m?.showError?.(F)}};await M()},[d,m]),[R,h]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,j,S)=>{if(!n)return;const b=n.getMovableSelection();if(b.length===0)return;let M="Drawings";if(b.length===1){const F=b[0];M=s.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const B=`${w.label()} ${M}`;g(w,()=>{let F=null;i&&(F=i.beginCommit(B));const A=n.getMovableSelection();if(A.length===0)return;const _=S?.(A);for(let G=0;G<A.length;G++){const P=A[G];j(P,_)}F?.commit()})},[n,i]),[T,q]=o.useState(n.getMovableSelection()[0]??null),[D,z]=o.useState(!T||T?.isProtected()),W=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){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.",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.",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."},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."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){p(this,(w,j)=>{w.setBounds({x:j.x})},Ht)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){p(this,(w,j)=>{w.setBounds({x:(j.width-w.getBounds().width)/2+j.x})},Ht)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){p(this,(w,j)=>{w.setBounds({x:j.width-w.getBounds().width+j.x})},Ht)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){p(this,(w,j)=>{w.setBounds({y:j.y})},Ht)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){p(this,(w,j)=>{w.setBounds({y:(j.height-w.getBounds().height)/2+j.y})},Ht)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){p(this,(w,j)=>{w.setBounds({y:j.height-w.getBounds().height+j.y})},Ht)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){p(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){p(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(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."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,T]);o.useEffect(()=>{},[f]);const K=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(W,!0),w},[a,W]);return et(T,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===s.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===s.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:w=>{z(w.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;q(w),z(!w||w.isProtected()),h()}}),et(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const w={disabled:D};K.getCommand("formatAnchorTypeTwoCell").update(w),K.getCommand("formatAnchorTypeOneCell").update(w),K.getCommand("formatAnchorTypeAbsolute").update(w),K.getCommand("toggleLockAspectRatio").update(w);const j=t.getCount(),S=n.getMovableSelection(),b=D||j<=1||S.length===0;let M={disabled:b},B=M;if(!b&&S.length===1){const _=S[0];_.getZIndex()===0&&(M={disabled:!0}),_.getZIndex()===j-1&&(B={disabled:!0})}K.getCommand("moveToFront").update(B),K.getCommand("moveForward").update(B),K.getCommand("moveToBack").update(M),K.getCommand("moveBackward").update(M);const F={disabled:D||S.length<=1};K.getCommand("formatDrawAlignLeft").update(F),K.getCommand("formatDrawAlignCenter").update(F),K.getCommand("formatDrawAlignRight").update(F),K.getCommand("formatDrawAlignTop").update(F),K.getCommand("formatDrawAlignMiddle").update(F),K.getCommand("formatDrawAlignBottom").update(F),K.getCommand("formatDrawFlipHorz").update(F),K.getCommand("formatDrawFlipVert").update(F),K.getCommand("formatDrawGroup").update(F),K.getCommand("formatDrawUngroup").update(F),K.getCommand("formatDrawSwapShapes").update(F),K.getCommand("formatDrawSwapShapesHorz").update(F),K.getCommand("formatDrawSwapShapesVert").update(F);const A={disabled:D||S.length<=2};K.getCommand("formatDrawDistributeHorz").update(A),K.getCommand("formatDrawDistributeVert").update(A)},[R,D,R]),K}const Xl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:f,...g}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:p,width:T}]=zt();return c.jsx("div",{...g,ref:Wt([R,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:f,onRepeatCommandChange:g}=e,R=kr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:f});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Rr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{R.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,R]);return h&&n?h:null})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:f,notifier:g=r.DefaultNotifier}=e,R=r.useEditMode(),[h,p]=o.useState(null),[T,q]=o.useState(null),[D,z]=o.useState(null),[W,K]=o.useState(null),[w,j]=o.useState(null);o.useLayoutEffect(()=>{if(D===null)return K(null),void j(null);const x=()=>{const H=i.getRange(D).getCell(),ne=H.getStyle();let be,oe=ne.getFill()?.toCSS(a.body.darkMode);oe.background!=="none"&&oe.background!=="transparent"||(oe=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),oe.background!=="none"&&oe.background!=="transparent"||(oe={background:a.body.fill}),K({style:oe}),H&&!H.getFormula()&&(be=H?.getRenderHorizontalAlignment()),j(be??r.HorizontalAlignment.Left)};return x(),i.getRange(D).addListener(()=>{x()})},[i,D,a?.body]);const S=r.useCallbackRef(()=>{let x=T.editState.dirty??"";if(T.editState.dirty!==void 0){const H=s.TextUtils.clampString(x);try{const ne=T.sheet.getRange(T.coords),be=`Typing '${H}' into ${ne.toString()}`;return ne.setValue(x,{description:be,autoFit:!0}),z(null),q(null),R.setMode(null),m(null),!0}catch(ne){throw g.showError(new Error(`Unable to enter '${H}'.`,{cause:ne})),ne}}},[i,T,g]),b=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??ue.CoordUtils.cellToRange(x),[i]),M=r.useCallbackRef(x=>{let H=s.IRange.Orientation.Row,ne=!1;x!==s.IRange.Direction.Up&&x!==s.IRange.Direction.Down||(H=s.IRange.Orientation.Column),x!==s.IRange.Direction.Left&&x!==s.IRange.Direction.Up||(ne=!0),i.getSelection().traverse(H,ne)},[i]),B=o.useCallback((x,H)=>{if(l)return l(x,H);if(!i)return null;const{ref:ne,...be}=x;return c.jsx(vr,{ref:ne,...be,sheet:i,bodyStyle:a?.body,activeCoords:H,commands:f,onChangeEdit:oe=>{const X={sheet:i,coords:H,editState:oe};R.setMode(ae=>({...ae,description:X.editState.editMode?"Edit":"Enter",args:{...ae?.args,stateAndCoords:X}}))},editState:T.editState})},[i,W,l,T,D]),{overlay:F,startEdit:A,submitEdit:_,cancelEdit:G,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:B,canEdit:()=>{const x=!i.getProtection().isLocked();return x||d(),x},onBeforeStartEdit:x=>{const H=Cr(()=>i.getRange(x).getCell()),ne={sheet:i,coords:x,editState:Object.freeze(H)};R.setMode({key:"edit",args:{stateAndCoords:ne}}),q(ne)},onStartEdit:x=>{z(x),m(x)},onSubmitEdit:S,onCancelEdit:x=>{z(null),q(null),R.setMode(null),m(null)},onDoneEdit:x=>{R.setMode(null)},onNavigate:M,containerProps:W,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:w,getRangeCoords:b});et(i.getSelection(),{onChange(x){p(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(x=>{V(x),D&&_()},[V,G,D]),te=o.useCallback(x=>{V(x)},[V]),N=o.useCallback(x=>{P(x)},[P]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",$),x.addEventListener("dblclick",te),x.addEventListener("keydown",N),()=>{x.removeEventListener("pointerdown",$),x.removeEventListener("dblclick",te),x.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const x=R.getMode(),H=x?.key;H==="edit"||H==="enter"?T?x.args?.cancel?G():x.args?.submit?_():q(x.args?.stateAndCoords):A(x.args?.start):D&&G()},[R]),F(n,t)})),Mr="white",Ir="black",Ql=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Ir}' fill='${Mr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ei=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 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='${Ir}' fill='${Mr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[f,g]=o.useState(null),[R,h]=o.useState(null),[p,T]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)}else l(!1),m(null)},[i,n]),D=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const b=n.getCellCoordsFromClient(S.clientX,S.clientY),M=i.getTables().search({address:b});M.length===1&&M[0].select()},[n,i]),z=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const b=n.getCellCoordsFromClient(S.clientX,S.clientY),M=i.getTables().search({address:b});if(M.length===1){const B=M[0].getRange().getCoords(),F={colStart:B.colStart,rowStart:b.rowIndex,colEnd:B.colEnd,rowEnd:b.rowIndex};i.getRange(F).select()}},[n,i]),W=r.useCallbackRef(()=>{if(!a)return;const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)},[i,a,n]);et(i?.getSelection(),{onChange(S){g(i.getSelection().getCoords().cell)}}),et(R,{onAnyChange(S){q(),W()}}),et(p,{onAnyChange(S){W()}}),et(i,{onTablesChange(S){q(),W()},onInvalidated(S){q(),W()}});const K=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(W,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let S=null;if(d)for(let b=0;b<d.length&&!S;b++){const M=d[b],B=M.getRange().getCoords();s.CoordUtils.isCellWithinRange(f,B)&&(S=M)}h(S)},[f,d]);const w=r.useCallbackRef(S=>{let b=null;if(d)for(let M=0;M<d.length;M++){const B=d[M],F=B.getRange().getCoords();let A=n.getRangeCoordsBounds(F);const _=n.getRelativePointFromClient(S.clientX,S.clientY),G=_.x,P=_.y;if(G>=A.x&&G<=A.x+A.width&&P>=A.y&&P<=A.y+A.height){const V=n.getViewportSize();G<=0||P<=0||G>=V.width||P>=V.height||(b=B)}}T(b)},[n,d]);if(o.useEffect(()=>{const S=n?.getStage();if(S&&d)return S.addEventListener("mousemove",w),S.addEventListener("mouseleave",w),()=>{S.removeEventListener("mousemove",w),S.removeEventListener("mouseleave",w)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const j=[];for(let S=0;S<d.length;S++){const b=d[S];if(b.isClosed())continue;const M=b===p,B=b===R,F=b.getRange().getCoords(),A=n.getRangeCoordsBounds(F);let _;if(M||B){const G=b.getStyle().getProperties(),P=G.headerRow?.fill?.background??G.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(_=V.toCSS())}_||(_="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:A.height,pointerEvents:"all",cursor:Ql},onMouseDown:z},`table-select-row-${b.getName()}`)),j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:Math.min(16,A.height),pointerEvents:"all",cursor:ei},onMouseDown:D},`table-select-${b.getName()}`)),j.push(c.jsx(dt.Selection,{x:A.x,y:A.y,width:A.width,height:A.height,range:F,strokeWidth:B?.5:0,stroke:_??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${_} 0px 0px 1px 1px`:void 0}},`table-outline-${b.getName()}`))}return j})),ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,f]=o.useState(null),g=o.useRef(null),R=r.useCallbackRef(()=>{const z=i.getSelectedCell(),W=z.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(W,l)||(f(W?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(W),coords:W}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(W))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{f(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(R,80),80),[]);if(et(i?.getSelection(),{onChange(z){h()}}),et(i,{onSpillsChange(z){R()},onInvalidated(z){R()}}),!n||!l&&!m)return null;const p=i.getRange(l).getValue()instanceof s.FormulaError.Spill,T=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&f(null),q=n.toClipBounds(q,-10),!q)return;const D="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:D,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${D} 0px 0px 4px 0px`}},"spill-outline}")),T})),oi={position:"absolute",top:0,left:0,bottom:0,right:0},$o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ri={fireOnModelChange:!1},Wo={},Tr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Wo,headersStyle:a=Wo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:f,rowHeaderProps:g,showScrollbars:R=!0,scrollPaneProps:h,onViewportChange:p,commands:T,onRepeatCommandChange:q,onMoveCell:D,overlays:z,renderMovable:W,viewportComponent:K,onElementLoad:w,getCellEditor:j,onFocus:S,onBlur:b,style:M=r.ReactUtils.EmptyCssProperties,notifier:B,onShowTooltip:F,onShowColumnTooltip:A,onShowRowTooltip:_,onCloseTooltip:G,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[te,N]=o.useReducer(Q=>Q+1,0),[x,{width:H,height:ne}]=zt(),be=r.useCallbackRef(F,[F]),oe=r.useCallbackRef(A,[A]),X=r.useCallbackRef(_,[_]),ae=r.useCallbackRef(G,[G]),Me=o.useRef(!1);o.useLayoutEffect(()=>{Me.current=!0},[n]);const Te=n?.getStyles(),fe=o.useMemo(()=>$o(i,Te),[i,Te]),Be=o.useMemo(()=>$o(a,Te),[a,Te]),{body:pe={},buttonSurface:Pe={}}=fe,{header:Se={},headerSelect:ge={},headerSelectAll:ce={}}=Be,we=o.useRef(null),[de,ye]=o.useState(()=>n?.getView()),Ae=(de?.getZoomScale()??100)/100,ve=o.useMemo(()=>({vertical:de.isShowColumnGridlines()&&Ae>=.4,horizontal:de.isShowRowGridlines()&&Ae>=.4}),[de?.isShowColumnGridlines(),de?.isShowRowGridlines(),Ae]),Fe=o.useMemo(()=>{if(de?.getGridLineColor())return{strokeDasharray:"1,1"}},[de?.getGridLineColor(),fe]),Oe=d??de?.isShowColumnHeaders(),He=f??de?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Je=o.useMemo(()=>{let Q=40,qe=20;const ke=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=ke?.toCSS()?.fontFamily??fe.header.text.fontFamily,Ze=ke?.getSize()??fe.header.text.fontSize,Qe=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);Q=Qe.width,qe=Qe.lineHeight}return{width:Math.round(Q+5),height:Math.round(qe+3)}},[C,fe?.header.text,n]),$e=He?Ae*Je.width:Se.edgeStrokeWidth,J=Oe?Ae*Je.height:Se.edgeStrokeWidth,Ee=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??Je.width)+$e+1),Ve=Math.max(ne,(n?.getRowHeaders().getDefaultSize()??Je.height)+J+1),Ie=o.useRef(new Map),Ne=o.useRef(null),De=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[k,re]=o.useState(()=>De()),[O,Y]=o.useState(!1),[u,I]=o.useState(null),E=!0,y=fe.selection?.strokeFill,L=o.useCallback(()=>kt.current,[]),[v,U]=o.useState(),Z=r.useCallbackRef(Q=>{U(Q),n&&n.getView()&&n.getView().setTopLeft(Q?{left:Q.left,top:Q.top}:null),p?.(Q)},[n,p]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const Q=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=Q.addListener(()=>{const qe=Q.getCoords();we?.current?.invalidate(qe)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(Q=>{const qe=ue.CoordUtils.cellToRange(Q);if(n.isClosed())return qe;const ke=n.getRange(qe,{excludeHidden:!0}).getMerges();return ke.length===0?qe:ke[0]},[n]),Ce=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const qe={};return Q.coords.colIndex>0&&(qe[ue.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(qe[ue.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),qe},[he,me]=o.useState(()=>Ce(n.getView().getFreezePanes())),xe=r.useEditMode(),Le=o.useCallback(()=>we.current,[]),ze=r.useCallbackRef(Q=>{xe.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),We=r.useCallbackRef(()=>v,[v]),je=qr({sheet:n,commands:T,target:Le,onRepeatCommandChange:q,bodyStyle:pe,notifier:B,onStartEdit:ze,getViewport:We}),[Re,_e]=o.useState(n.getSelection().isEntire()),[lt,it]=o.useState(de?.getMovableSelection().length>0),pt=u!==null||lt,wt=null,[Ge,ot]=o.useState(!1);o.useEffect(()=>{ot(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{Ge||(ot(!0),B.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[B,Ge]),bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.cursor?Q.cursor:null},[wt,xe]),[Ct,gt]=o.useState(null),rt=o.useRef(!1),[It,Lt]=o.useState([]),Zt=o.useRef(null),[Ft,Xt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Mt,vn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Xt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{vn({left:0,top:le?.top})},[le?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{me(Ce(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),et(n,{onViewChange(){ye(n.getView()),re(De())},onLayoutChange:()=>{const Q=n.getEntireRange();Ue({height:Q.getRowCount(),width:Q.getColumnCount()}),re(De())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),et(n,{onRequestScrollIntoView:async(Q,qe)=>{if(!qe)return;const ke={colIndex:qe?.coords.colStart,rowIndex:qe?.coords.rowStart};return await we.current?.scrollCellCoordsIntoView(ke,qe?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(kt.current)},ri);const Cn=o.useMemo(()=>{const Q=(ke,Ke)=>{rt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:ke,colEnd:ke})))return;const Qe=Ze.getLayout(),nt=Math.max(0,Qe.getColOffset(ke)),Ye=Ze.getBounds(),st=Math.min(Ye.x+Ye.width,Qe.getColOffset(ke+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Left||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Right)){const Xn=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),qn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Ae),2).toFixed(2),Yn="Width: "+(Ke?qn+" ("+Xn+" pixels)":"Hidden"),nn=Vt.current.getGridElement().getRelativePointFromClient(0,0),Pt=0-nn.y,Sn=0-nn.y+J,Jn={x:nt-(nn.x-Ye.x),y:Pt,width:st-nt,height:Sn-Pt};requestAnimationFrame(()=>{rt.current&&oe?.({anchor:Jn,display:Yn})})}const Tt=[0,0,0,Ye.height],tn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Gn={x:nt-1,y:0,width:1,height:Ye.height},_n={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Zn={x:st-1,y:0,width:1,height:Ye.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(ke,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(ke,Ke)},onResizeHeaders:(ke,Ke,Ze)=>{Q(ke,Ke)},onResizeHeadersDown:(ke,Ke)=>{Q(ke,Ke)},onResizeHeadersEnd:(ke,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},...m}},[n,m,J,Ct]),Ot=o.useMemo(()=>{const Q=(ke,Ke)=>{rt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:ke,rowEnd:ke,colStart:0,colEnd:C.width})))return;const Qe=Ze.getLayout(),nt=Math.max(0,Qe.getRowOffset(ke)),Ye=Ze.getBounds(),st=Math.min(Ye.y+Ye.height,Qe.getRowOffset(ke+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Top||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Bottom)){const Xn=Math.floor(10*ue.CommonUtils.getDPI())/10,qn=ue.CommonUtils.roundAccurately(Ke*Xn,0),Yn=ue.CommonUtils.roundAccurately(qn/Ae/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),nn="Height: "+(Ke?Yn+" ("+qn+" pixels)":"Hidden"),Pt=en.current.getGridElement().getRelativePointFromClient(0,0),Sn=0-Pt.x,Jn=0-Pt.x+$e,ml={x:Sn,y:nt-(Pt.y-Ye.y),width:Jn-Sn,height:st-nt};requestAnimationFrame(()=>{rt.current&&X?.({anchor:ml,display:nn})})}const Tt=[0,0,Ye.width,0],tn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Gn={x:0,y:nt-1,width:Ye.width,height:1},_n={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Zn={x:0,y:st-1,width:Ye.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(ke,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(ke,Ke)},onResizeHeaders:(ke,Ke,Ze)=>{Q(ke,Ke)},onResizeHeadersDown:(ke,Ke)=>{Q(ke,Ke)},onResizeHeadersEnd:(ke,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},...g}},[n,g,$e]),kt=r.useImperativeElement(t,()=>{const Q=ke=>{n?.getView()&&n.getView().selectMovables([]),Ne.current=null,we?.current?.focus(ke)},qe=async(ke=null)=>{if(ke||(ke=n?.getView().getMovableSelection()[0]),!ke)return!1;const Ke=ke.getAnchorCoords();if(!Ke)return!1;const Ze=we.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const Qe=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(ke)===-1&&n?.getView().selectMovables([ke]);let nt=Ie.current?.get(Qe);return nt?.current?(await nt.current.focusMovable(ke),!0):(Ne.current={movable:ke,anchor:Qe},!0)};return{getGridElement:()=>we.current,getRowHeaderElement:()=>en.current,getColumnHeaderElement:()=>Vt.current,rowHeaderHeight:()=>J,colHeaderWidth:()=>$e,startEdit:ze,submitEdit:()=>{xe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{xe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:ke=>{n?.getView().getMovableSelection().length>0&&qe()||Q(ke)},focusSheet:Q,focusMovable:qe,contains:ke=>we?.current?.contains?.(ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{Me.current||(we?.current?.invalidate(Q),N?.())},[]);o.useEffect(()=>{At()},[fe]);const Yt=Re?ce.edgeStrokeFill:Se.fill,Hn=Re?ge.fill:typeof fe.headerHover=="function"?fe.headerHover(Se)?.fill:Se.fill,tt=o.useMemo(()=>K?c.jsx("div",{className:yt("sheetxl-viewport-overlay",Il),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:K}):c.jsx(c.Fragment,{}),[K]);let Jt=null;Oe&&He&&(Jt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${J}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let qe=!Q.ctrlKey;je?.getCommand("selectAll")?.execute(!qe||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):we.current?.focus()},children:[c.jsx("div",{style:{height:J-5+"px",width:J-5+"px",clipPath:`path('M${J-5} 0 L0 ${J-5} L${J-5} ${J-5} L${J-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Hn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${J}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const jt=r.useCallbackRef(({_left:Q,_top:qe})=>{},[]),yn=r.useCallbackRef(Q=>{if(!l)return;const qe=we.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);qe&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),at=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:qe}=Q;return qe>0?je.getCommand("sheetZoomOut")?.execute():qe<0&&je.getCommand("sheetZoomIn")?.execute(),qe===0},[je]);o.useEffect(()=>{Lt(null),Zt.current=null,rt.current=!1,gt(null);const Q=n?.getView().getTopLeft();jt(Q),we.current?.scrollTo(Q),ie(Q),ye(n.getView()),me(Ce(n.getView().getFreezePanes())),re(De()),N()},[n?.getView()]);const ht=r.useCallbackRef(Q=>{const qe=Q.getVisibleRangeCoords();if(!qe)return null;const ke=[];return n.getRange(qe).forEach((Ke,Ze)=>{const Qe=Ze.getCoords(),nt=Ze.getCell();(Ye=>{if(Ye.isEmpty())return!1;const st=Ye.getSpans();if(st.width>1||st.height>1||Ye.getStyle().hasVisibleStyling()||de.isShowFormulas()&&Ye.getFormula()!==null)return!0;const mt=Ye.getValue();return mt!==null&&!(!de.isShowZeros()&&mt===0&&Ye.getType()===s.ScalarType.Number)})(nt)&&ke.push({coords:Qe,value:nt,range:de.isShowFormulas()?null:nt.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),ke},[n,de.isShowZeros(),de.isShowFormulas(),u]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),Ct&&Q.push(...Ct),ue.CommonUtils.isEqualArrays(Q,Zt.current)||(Zt.current=Q,Lt(Q))},[z,Ct,fe]);const Qt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),bn=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(Ne.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.key==="cut"||Q?.key==="copy"},[xe]),Un=r.useCallbackRef(async Q=>{const qe=xe.getMode();return Q.keyCode===r.KeyCodes.Escape&&qe?(Q.preventDefault(),void xe.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Bt?(Q.preventDefault(),await je?.getCommand("paste")?.execute(),void xe.setMode(null)):void je?.dispatchToFocusedCommand(Q)},[je,xe]),en=o.useRef(null),wn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Ho,{ref:en,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Ve,sheetHeader:n.getRowHeaders(),gridStyle:Be,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[$e,J,Ve,n,Mt,he?.[ue.AnchorLocation.Top],fe,E,l,Se.fill,g]),Vt=o.useRef(null),xn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Ho,{ref:Vt,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Left],oppositeSize:J,containerWidth:Ee,containerHeight:J,sheetHeader:n.getColumnHeaders(),gridStyle:Be,scrollPoint:Ft,onSheetContextMenu:l,...Cn,style:{...Cn?.style,position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[J,Ee,n,Ft,he?.[ue.AnchorLocation.Left],fe,Se.fill,E,l,m]),sl=r.useCallbackRef(Q=>{const{value:qe,key:ke,...Ke}=Q;let Ze=qe,Qe=u;if(!Qe||Qe.colIndex===Q.coords.colIndex&&Qe.rowIndex===Q.coords.rowIndex||(Qe=null),!Ze){const st=Q.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let nt=null;Ze.getHyperlink()&&(nt=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(mt){B?.showError?.(mt)}}}),Qe&&Qe.colIndex===Q.range.colStart&&Qe.rowIndex===Q.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Ye=n.getStyles();return o.createElement(pr,{...Ke,key:ke,bodyStyle:pe,docTheme:Ye.getTheme(),normalStyle:Ye.getNormal(),showFormulas:de.isShowFormulas(),showZeros:de.isShowZeros(),onLinkMouseDown:nt,...V,value:Ze})},[n,k,pe,u,de?.isShowFormulas(),de.isShowZeros()]),dl=o.useCallback((Q,qe)=>{const{key:ke,...Ke}=Q;return[c.jsx(Fl,{ref:qe,getVisibleCells:ht,sheet:n,gridStyle:fe,...Ke},`border-${ke}`),c.jsx(ti,{ref:qe,sheet:n,commands:je,...Ke},`table-${ke}`),c.jsx(ni,{ref:qe,sheet:n,...Ke},`spill-${ke}`),c.jsx(Wl,{ref:qe,sheet:n,commands:je,notifier:B,onShowTooltip:be,onCloseTooltip:ae,gridStyle:fe,gridRef:we,editingCoords:u,isActive:E,...Ke},`selection-${ke}`),c.jsx(Bl,{ref:qe,sheet:n,commands:je,gridStyle:fe,element:L,notifier:B,...Ke},`copy-paste-${ke}`),c.jsx(Yl,{ref:qe,sheet:n,commands:je,target:Le,notifier:B,renderMovable:W,movableProps:{onUnFocus:()=>{kt.current.focus()}},...Ke},`movable-${ke}`),c.jsx(Jl,{ref:qe,sheet:n,commands:je,notifier:B,gridStyle:fe,getCellEditor:j,showProtectedError:vt,setEditingCoords:I,...Ke},`editor-${ke}`)]},[n,we.current,fe,j,je,B]),[ko,cl]=o.useState(!1),ul=o.useMemo(()=>{if(Ee===0||Ve===0)return null;const Q=n.getStyles().getNormal(),qe=Q.getFont(),ke=Q.getFill(),Ke=Q.getBorder(),Ze=Q.getFill().getType()===s.IFill.Type.None;let Qe=Fe,nt=Fe;const Ye=(mt,Tt,tn)=>tn?{stroke:Ke.getBottom().isNone()?"none":mt.getColor().toRGBA(pe.darkMode).toString(),...Tt}:Tt;nt=Ye(Ke.getBottom(),nt,!Ke.getBottom().isNone()),nt=Ye(Ke.getTop(),nt,!Ke.getTop().isNone()),Qe=Ye(Ke.getRight(),Qe,!Ke.getRight().isNone()),Qe=Ye(Ke.getLeft(),Qe,!Ke.getLeft().isNone());let st=de?.getGridLineColor()?.toRGBA(pe.darkMode).toString()??pe.strokeFill;return Ze||(nt=Ye(Ke.getBottom(),nt,!0),nt=Ye(Ke.getTop(),nt,!0),Qe=Ye(Ke.getRight(),Qe,!0),Qe=Ye(Ke.getLeft(),Qe,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...oi,...ke.toCSS(pe.darkMode),...qe.toCSS(pe.darkMode,Ae),"--sxl-app-color-background":pe.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":Pe.fill,"--sxl-app-color-button-text":Pe.text?.fill,"--sxl-app-color-button-border":Pe.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:we,zoom:Ae,...P,onFirstRender:mt=>{cl(!0),P?.onFirstRender?.(mt),je?.activate()},showGridLines:ve,gridLineColor:st,gridLineColumnsProps:Qe,gridLineRowsProps:nt,freezeLeft:he?.[ue.AnchorLocation.Left],freezeLeftProps:Qt,freezeTop:he?.[ue.AnchorLocation.Top],freezeTopProps:Qt,width:Ee,height:Ve,columnCount:C.width,rowCount:C.height,cursor:bt??wt??"cell",clipCells:!0,layout:k,cellRenderer:sl,overlayRenderer:dl,getCellCoordsAsRangeCoords:se,getVisibleCells:ht,onWheelScroll:at,onPointerDown:bn,onKeyDown:Un,onViewportChange:Z,onImmediateScroll:jt,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:It})},[te]);o.useEffect(()=>{Me.current||N()},[k,he,Ae,je,le?.left,le?.top,pe,P,Ee,Ve,bt,It,E,wt]);let Kn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};R||(Kn={...Kn,...M});const gl=o.useMemo(()=>{const Q=n.getStyles().getTheme(),qe=Q.getColorScheme(),ke=Q.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(pe.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(pe.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(pe.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(pe.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(pe.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(pe.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(pe.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(pe.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(pe.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(pe.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(pe.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(pe.darkMode),"--sxl-doc-font-major":ke.getMajorFont(),"--sxl-doc-font-minor":ke.getMinorFont()}},[n.getStyles().getTheme()]);let $n=c.jsx("div",{style:Kn,onTouchStart:()=>{Mo()},onFocus:Q=>{Y(!0),S?.(Q)},onBlur:Q=>{Y(!1),b?.(Q)},ref:kt,...$,children:c.jsx("div",{className:yt("sheetxl-sheet",Ml),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:[Jt,wn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:pe.fill},ref:x,onContextMenu:yn,children:[ul,tt,c.jsx(Tl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(R){const Q=qe=>c.jsx(vo,{...qe,sheet:n});$n=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Je.height,minWidth:2*Je.width,...M},viewport:v,touchElement:we.current?.stage,disableTouch:pt,onScrollViewport:qe=>{we.current?.scrollTo(qe)},createHorizontalScrollbar:Q,createVerticalScrollbar:Q,...h,children:$n})}o.useEffect(()=>{Me.current=!1,N?.(),O&&kt.current?.focus()},[n]);const[Wn,hl]=o.useState(!1),Mo=r.useCallbackRef(()=>{Wn||hl(!0)},[Wn]);return o.useEffect(()=>{if(ko)return typeof w=="function"&&w(),r.ReactUtils.detectIt().primaryInput==="touch"&&Mo(),()=>{}},[w,ko,Wn]),$n}));Tr.displayName="SheetElement";const li=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Go="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Er=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:f,onHide:g,onShow:R,onKeyDownCapture:h,onFocus:p,onBlur:T,loadingPanel:q,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(null),[j,S]=o.useState(null),[b,M]=o.useState(null);o.useEffect(()=>{S(null),l.getDetails().then(A=>{W(!1),S(A.asUrl()),A.asSVGText?.()&&M(A.asSVGText())}).catch(A=>{console.warn(A),W(!0),S(Go),M(null)})},[l]);const B=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(j||b)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:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:j,onLoad:()=>{w(!0)},onError:({currentTarget:A})=>{console.log("error"),A.onerror=null,S(Go),W(!0)},alt:d??`${l.getType()}`})},[K,l,j,b,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...D,onKeyDownCapture:A=>{h?.(A)},ref:B,children:[K||z?void 0:q,F]})}));Er.displayName="PictureEditor";const ii=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:f,...g}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:p,width:T}]=zt();if(!a.isClosed())return c.jsx("div",{...g,ref:Wt([R,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ai="_editable-input_w34rk_11",si=e=>c.jsx("input",{...e}),Fr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:f=si,notifier:g,styleHover:R={},dragging:h,maxLength:p,disabled:T=!1,readOnly:q=!1,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(!1),[j,S]=o.useState(a);o.useEffect(()=>{S(a)},[a]);const b=o.useRef(null),[M,B]=o.useState(null),F=o.useCallback(function(te){const N=te.message;M!==N&&(g?.showMessage?.(N,{type:r.NotificationType.Error}),B(N))},[g,M]),A=o.useCallback(te=>{let N=!1;try{N=l?.(te)??!0}catch(x){F(x)}return N?(b.current=null,w(!1),S(te),N):(setTimeout(()=>{b.current?.focus()},0),N)},[l]),_=r.useCallbackRef(()=>{S(a),b.current=null,w(!1),m?.()},[m,a]),G=o.useMemo(()=>{if(!K)return null;const te={className:yt(ai),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:p,type:"text",value:j,onFocus:N=>{b.current||(b.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{b.current&&A(j)},onChange:N=>{K&&S(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void _()):N.code==="Enter"?(N.preventDefault(),void A(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():A(N.target.value))};return c.jsx(c.Fragment,{children:f(te)})},[K,j,A,_,f,T]),[P,V]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(h||z)&&(te=Object.assign(te,R)),V(te)},[h,z,R,n]),o.useEffect(()=>{G&&d?.(j)},[G,d,j]);const $=r.useImperativeElement(t,()=>({startEdit(){T||q||w(!0)},cancel(){_()}}),[]);return c.jsxs("div",{...D,ref:$,style:{flexDirection:"column",display:"flex",...P},className:yt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{T||q||w(!0)},onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:j}),G]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...R},children:j})]})})),On=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Co(e){return"nodeType"in e}function ft(e){var t,n;return e?Gt(e)?e:Co(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yo(e){const{Document:t}=ft(e);return e instanceof t}function mn(e){return!Gt(e)&&e instanceof ft(e).HTMLElement}function Ar(e){return e instanceof ft(e).SVGElement}function $t(e){return e?Gt(e)?e.document:Co(e)?yo(e)?e:mn(e)||Ar(e)?e.ownerDocument:document:document:document}const St=On?o.useLayoutEffect:o.useEffect;function jn(e){const t=o.useRef(e);return St(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function ln(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function En(e){const t=jn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Fn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let to={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=to[e]==null?0:to[e]+1;return to[e]=n,e+"-"+n},[e,t])}function Dr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[f,g]of m){const R=l[f];R!=null&&(l[f]=R+e*g)}return l},{...t})}}const Kt=Dr(1),gn=Dr(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function An(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),_o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function di(e){return e.matches(_o)?e:e.querySelector(_o)}const ci={display:"none"};function ui(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:ci},n)}function gi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},n)}const zr=o.createContext(null),hi={draggable:`
|
|
23
|
+
The content is not applied.`}),new r.Command("pasteFormulas",b,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",b,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",b,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(M,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const b={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(M=>j.paste({...zl,...M})).update(b),i.getCommand("pasteFormats").updateCallback((M,B)=>j.paste({...Nl,description:B.label(),...M})).update(b),i.getCommand("pasteFormulas").updateCallback((M,B)=>j.paste({...Ll,description:B.label(),...M})).update(b),i.getCommand("pasteTranspose").updateCallback((M,B)=>j.paste({...Ol,description:B.label(),...M})).update(b),i.getCommand("pasteLinks").updateCallback((M,B)=>j.paste({...jl,description:B.label(),...M})).update(b),i.getCommand("cut").update(b),i.getCommand("paste").update(b)},[t,i]);const S=o.useMemo(()=>{if(!z||!q.current)return;const b=z.key;if(b!=="copy"&&b!=="cut"&&b!=="formatPainter")return;const M=q.current.getItem();if(M.getSource()!==t)return;const B=q.current.isCut?.(),F=B?R:g,A=B?f:m,_=M.getCoords(),G=_?[_]:null;return G&&G.length!==0?P=>{const V=[];for(let $=0;$<G.length;$++){const te=G[$],N=P.toClipBounds(P.getRangeCoordsBounds(te,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(V.push(T({range:te,key:`copy-selection-background-${$}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:F,strokeWidth:2})),V.push(T({range:te,key:`copy-selection-foreground-${$}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[z,t,n,m,g,f,R]);return{...j,clipboard:w,overlays:S}},Bl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,f=l.body??{},g=a.getView(),{overlays:R}=Sr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:f.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:f.fill,notifier:m});return et(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),R&&n?R(n):null})),Vl="_sheet-selection_1tbzy_9",Pl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Hl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Ul={key:"dragCopy",description:"Drag selection to copy cell contents."},Kl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Uo=(e,t)=>t.ctrlKey&&t.shiftKey?Kl:t.ctrlKey?Ul:t.shiftKey?Hl:Pl,$l={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Wl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:f,sheet:g,gridRef:R,gridStyle:h,isActive:p,editingCoords:T,...q}=e,D=n?.getBounds(),z=r.useCallbackRef(m,[m]),W=r.useCallbackRef(f,[f]),[K,w]=o.useState(()=>g?.getSelection().getCoords()),j=r.useCallbackRef(ge=>{ue.CoordUtils.isEqualSelectionCoords(ge,K)||g&&g.getSelection().updateCoords(ge)},[g,K]),S=r.useEditMode(),b=o.useRef(null),[M,B]=o.useState(g?.getProtection().isLocked()),[F,A]=o.useState(g?.getView().getMovableSelection().length>0),_=r.ReactUtils.detectIt().primaryInput==="touch",G=!_&&p,P=T!==null||F,V=r.useCallbackRef(ge=>{const ce=ue.CoordUtils.cellToRange(ge);if(g.isClosed())return ce;const we=g.getRange(ce,{excludeHidden:!0}).getMerges();return we.length===0?ce:we[0]},[g]),$=r.useCallbackRef((ge,ce,we,de,ye,Ae)=>{const ve=g.getSelectedRange().getExtended(de,ge).getCoords();switch(de){case s.IRange.Direction.Up:return ve.rowStart;case s.IRange.Direction.Down:return ve.rowEnd;case s.IRange.Direction.Left:return ve.colStart;case s.IRange.Direction.Right:return ve.colEnd}},[g]),te=r.useCallbackRef(()=>{const ge=g.getUsedRange()?.getCoords(),ce=g.getRowHeaders().getUsedRange()?.getCoords(),we=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ge,colEnd:Math.max(ge?.colEnd??0,we?.max??0),rowEnd:Math.max(ge?.rowEnd??0,ce?.max??0)}},[g]),N=r.useCallbackRef((ge,ce)=>g.getRowHeaders().hiddenHeadersAt(ge,ce),[g]),x=r.useCallbackRef((ge,ce)=>g.getColumnHeaders().hiddenHeadersAt(ge,ce),[g]),H=r.useCallbackRef(ge=>g.getRange(ge,{excludeHidden:!0}).getMerges(),[g]),ne=r.useCallbackRef(ge=>{g?.getSelection().setAdjusting(ge)},[g]),be=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),S.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),S.setMode(null))},[S,K,g,i]),oe=o.useMemo(()=>{const ge=S.getMode();return ge?.key==="cut"||ge?.key==="copy"},[S]);et(g?.getView(),{onMovableSelectionChange:()=>{A(g.getView().getMovableSelection().length>0)}}),et(g?.getSelection(),{onChange(ge){const ce=g.getSelection().getCoords();w(ce)}}),et(g,{onProtectionChange:()=>{B(g.getProtection().isLocked())}});const{body:X={}}=h||{},ae=n.getLayout(),Me=!(G&&K.ranges.length<=1&&T===null&&!M&&(!S.getMode()||oe)),{cursor:Te,overlay:fe,onPointerDown:Be}=dt.useSelection({gridRef:R,commands:i,layout:ae,getCellCoordsAsRangeCoords:V,selection:K,fillHandleBorderColor:X.fill,selectionBackgroundColor:p?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:p?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:p?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:p?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Me,disableMoveDrag:_||!(p&&K.ranges.length<=1&&T===null&&!M),disableTouchSelection:P,onSelectionChange:j,onSelectionDragStart:ne,onSelectionDragEnd:be,onMoveDragStart:(ge,ce,we)=>{S.setMode(Uo(0,we))},onMoveDragUpdate:(ge,ce,we)=>{S.setMode(Uo(0,we))},onMoveDragEnd:(ge,ce)=>{S.setMode(null)},onMoveDragDone:async(ge,ce,we)=>{if(ue.CoordUtils.isEqualRanges(ge,ce))return;const de=g.getRange(ce);if(d?.showOptions){const Oe=de.getDifferences(ge);let He=!1;for(let C=0;!He&&C<Oe.getCount();C++)He=Oe.at(C).isContentful();if(He&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ye=!we.ctrlKey,Ae=we.shiftKey,ve=Ae?ye?"Insert Moved Cells":"Insert Copied Cells":ye?"Move Cells":"Copy Cells",Fe=await d?.showBusy?.(ve);try{const Oe=g.getRange(ge);await de.doBatch(async()=>{Ae?await de.insertFrom(ge,{isCut:ye,undoRange:Oe}):await de.copyFrom(ge,{isCut:ye,undoRange:Oe}),Oe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),de.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:ve,autoSelect:!0})}catch(Oe){d?.showError?.(Oe)}finally{Fe?.()}},contentfulCellFinder:$,hiddenRowsAt:N,hiddenColumnsAt:x,mergedRanges:H,getDataCoords:te,canSelectionSpanMergedCells:ge=>{const ce=g.getRange(ge);return ce.isEntireColumns()||ce.isEntireRows()},onFill:async(ge,ce)=>{const we="Auto Fill",de=await d?.showBusy?.(we);try{await g.doBatch(()=>{g.getRange(ge).autoFill(ce),g.getRange(ce).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(ye){d?.showError?.(ye)}finally{b.current=null,de?.()}},onFillPreview:(ge,ce,we)=>{if(R.current&&z){S.setMode($l);try{b.current?.direction!==we&&(b.current=null,g.getRange(ge).autoFill(ce,{previewOnly:C=>{b.current={callback:C,direction:we}}}));const de=b.current?.callback?.(ce);if(!de||de.isEmpty())return;const ye=de.toText();if(!ye)return;const Ae=ue.CoordUtils.cellToRange(de.getCoords()),ve=n.getRelativePointFromClient(0,0);let Fe=0,Oe=0,He=r.ToolTipPlacement.Bottom;if(we===s.IRange.Direction.Down){Fe=ae.getColOffset(Ae.colEnd+1)-ve.x;const C=ae.getRowOffset(Ae.rowEnd),Ue=ae.getRowOffset(Ae.rowEnd+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Right){Oe=ae.getRowOffset(Ae.rowEnd+1)-ve.y;const C=ae.getColOffset(Ae.colEnd),Ue=ae.getColOffset(Ae.colEnd+1);Fe=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}else if(we===s.IRange.Direction.Up){Fe=ae.getColOffset(Ae.colEnd+1)-ve.x;const C=ae.getRowOffset(Ae.rowStart),Ue=ae.getRowOffset(Ae.rowStart+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Left){Oe=ae.getRowOffset(Ae.rowEnd+1)-ve.y;const C=ae.getColOffset(Ae.colStart),Ue=ae.getColOffset(Ae.colStart+1);Fe=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}z({anchor:{x:Fe,y:Oe},display:ye,placement:He})}catch(de){d?.showError?.(de)}}},onFillDone:()=>{b.current=null,S.setMode(null),W?.()}}),pe=r.useCallbackRef(ge=>{Be(r.ReactUtils.createSyntheticEvent(ge))},[Be,T]);o.useEffect(()=>{const ge=n?.getStage();if(ge)return ge.addEventListener("pointerdown",pe),()=>{ge.removeEventListener("pointerdown",pe)}},[n?.getStage()]);const Pe=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:yt(a,"sheet-selection",Vl),style:{position:"absolute",width:D?.width,height:D?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Wt([Pe,Se]),...q,children:fe(n)})})),kn=Object.freeze({x:0,y:0,width:0,height:0}),Gl={fireOnModelChange:!1},_l=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:f,onUnFocus:g,isDragging:R,updateFrameBounds:h,dragStart:p,style:T,disabled:q,renderMovable:D,...z}=e,[W,K]=o.useState(kn),[w,j]=o.useState(null),[S,b]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const A=i.toViewBounds(F);K(A??kn),h(A??kn)},[i?.getBounds()]),et(a,{onBoundsChange:F=>{const A=F.getBounds();if(!A)return;const _=i.toViewBounds(A);K(_??kn),h(_)},onSelectionChange:()=>{const F=ue.CommonUtils.hasFocus(M.current,!0);!S&&!F||a.isSelected()||g()}}),et(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(M.current,!0)},Gl),o.useEffect(()=>{const F=M.current;return l(F),()=>{d(F)}},[]);const B=o.useMemo(()=>{if(!W)return null;let{width:F,height:A}=W;return D({view:i,movable:a,disabled:q,isDragging:R,style:{position:"relative",left:0,top:0,width:F,height:A},onHide:m,onShow:f})},[i,a,W.width,W.height,q,R]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Wt([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:W.x,top:W.y,width:W.width,height:W.height,...T},onMouseDown:async F=>{const A=F.shiftKey||F.ctrlKey,_=a.isSelected(),G=F.currentTarget;A&&_?a.unselect():(_&&!A||await a.select({addToSelection:A}),p(F.nativeEvent,G),G.focus())},onFocus:F=>{F.relatedTarget&&!w&&j(F.relatedTarget),b(!0)},onBlur:F=>{w&&!M?.current?.contains(F.relatedTarget)&&j(null),F.relatedTarget&&b(!1)},...z,children:B})})),Zl="_movable-area_1xcl8_9",Rr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:f,disabled:g=!1,disableDrag:R=!1,disableResize:h=!1,className:p,style:T,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:D,...z}=e,W=n.getBounds(),K=r.useCallbackRef(D,[D]),w=r.useCallbackRef(m,[m]),j=r.useCallbackRef(f,[f]),[S,b]=o.useState([]),[M,B]=o.useState(!1),[F,A]=o.useState(!1),_=o.useRef(!0),G=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),te=o.useRef(new Map),N=o.useRef({onRequestFocus:J=>(ce(J),null)}),x=o.useRef(null),H=o.useRef(null),ne=o.useRef(null),[be,oe]=o.useReducer(J=>J+1,0);o.useLayoutEffect(()=>{oe()},[n,i]),et(i,{onCollectionChange:()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ee=te.current;Ee.forEach(Ie=>{Ie()}),Ee.clear();const Ve=N.current;for(let Ie=0;Ie<J.length;Ie++){const Ne=J[Ie];if(Ne.isClosed())continue;const De=Ne.addListeners(Ve);Ee.set(Ne,De)}oe()},onInvalidated:()=>{oe()}}),et(a,{onMovableSelectionChange(J){ae(),oe()}});const X=o.useCallback((J,Ee)=>{const Ve=V.current.get(J);ne.current&&(ne.current.getTargets().forEach(Ie=>{if(Ie===Ve)return Ie.style.left=Ee.x+"px",Ie.style.top=Ee.y+"px",Ie.style.width=Ee.width+"px",void(Ie.style.height=Ee.height+"px")}),ne.current.updateRect())},[]),ae=()=>{const J=[],Ee=a.getMovableSelection();Ee.forEach(Ve=>{const Ie=V.current.get(Ve);Ie&&Ee.indexOf(Ve)!==-1&&J.push(Ie)}),b(Ve=>ue.CommonUtils.isEqualArrays(Ve,J)?Ve:J)},Me=o.useRef(null),Te=o.useMemo(()=>new Promise(J=>{Me.current=J}),[]),fe=o.useRef(null),Be=r.useCallbackRef(async(J,Ee)=>{fe.current=Ee,await(async()=>!(!await Te.then()||!ne.current))()&&fe.current===Ee&&ne.current.dragStart(J,Ee)},[S]),[pe,Pe]=o.useState(!1),Se=o.useRef(null),ge=o.useRef(null),ce=r.useCallbackRef(async(J=null)=>{if(J||(J=a.getMovableSelection()[0]),!J)return w?.(),!1;const Ee=V.current.get(J);Ee?(await ue.CommonUtils.whenFocus(Ee),Ee.focus(),ge.current=Ee,Se.current=null):Se.current=J},[a]);o.useEffect(()=>{pe&&S.length>0&&ge.current!==S[0]&&ce(),_.current&&(K?.(),_.current=!1)},[S]);const we=o.useMemo(()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(J.length===0&&G.current.size===0)return null;const Ee=(k,re,O,Y=!0)=>{const u=k.isSelected(),I={tabIndex:O,view:n,movable:k,onRefLoad:E=>{Se.current===k&&(E.focus(),ge.current=E,Se.current=null),V.current.set(k,E),P.current.set(E,k),re.rendered=!0,ae()},onRefUnload:E=>{V.current.delete(k),P.current.delete(E),re.rendered=!1,ae()},onUnFocus:w,onHide:E=>{re.onHide=E},onShow:E=>{re.onShow=E},isDragging:u&&(F||M),disabled:g,renderMovable:l,updateFrameBounds:E=>{X(k,E)},dragStart:Be,onMouseUp:()=>{if(fe.current=null,H.current){B(!1),A(!1);let E=!1;$.current?.forEach(y=>{ue.CommonUtils.isEqualBounds(y.movable.getBounds(),y.startBounds)||(E=!0)}),E?ye():Ae()}},style:{opacity:Y?M&&u?.7:void 0:0,zIndex:M&&u?k.getZIndex()+J.length:void 0,pointerEvents:Y?void 0:"none",cursor:F&&u?"grabbing":g||R?"initial":"move",boxShadow:!u||F&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(_l,{...I},`movable-${k.getUUID()}`)},Ve=G.current,Ie=new Map,Ne=[];for(let k=0;k<J.length;k++){const re=J[k];if(re.isClosed())continue;let O=Ve.get(re);O||(O={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const I=++u.visibilityRequestId;requestAnimationFrame(()=>{const E=G.current.get(Y);E&&I===u.visibilityRequestId&&(u.onShow?.(Y),E.shown=!0)})},doHide:async(Y,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const I=++u.visibilityRequestId,E=await Promise.resolve(u.onHide?.(Y));I===u.visibilityRequestId&&E!==!1&&(u.shown=!1,G.current.delete(Y),oe())},visibilityRequestId:0}),O.frame=Ee(re,O,k,!0),Ne.push(O.frame),O.doShow(re,O),Ve.delete(re),Ie.set(re,O)}const De=[];return a.getMovableSelection().forEach(k=>{const re=Ve.get(k);re&&(re.frame=Ee(k,re,-1,!1),De.push(re.frame),Ve.delete(k),Ie.set(k,re))}),Ve.forEach((k,re)=>{k.frame=Ee(re,k,-1,!1),De.push(k.frame),k.doHide(re,k),Ve.delete(re),Ie.set(re,k)}),G.current=Ie,ae(),[...De,...Ne]},[be,n,l,g,R,h,M,F]),de=r.useCallbackRef((J,Ee)=>{const Ve=`${Ee} ${S.length===1?s.TextUtils.capitalize(P.current?.get(S[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${Ve}`),H.current.rollback(),H.current=null),H.current=d.beginCommit({description:Ve}),$.current.clear();for(let Ie=0;Ie<S.length;Ie++){const Ne=S[Ie],De=P.current?.get(Ne);De?$.current.set(Ne,{movable:De,startBounds:n.toViewBounds(De.getBounds())}):console.warn("invalid element",De)}},[d,n,S]),ye=o.useCallback(()=>{if(!H.current)return;const J=[];$.current?.forEach(Ee=>{J.push(Ee.movable)}),H.current.commit({viewAfter:{view:a,movableSelection:J}}),$.current.clear(),H.current=null},[]),Ae=o.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),ve=o.useRef(null);o.useEffect(()=>{ve.current&&(ve.current.onscroll=J=>{J.preventDefault(),J.srcElement.scrollTop=0,J.srcElement.scrollLeft=0})},[ve.current]);const Fe=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ce,focus:()=>{ce()}}),[a]),[Oe,He]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Je=o.useRef(!1);o.useEffect(()=>{if(g||S.length===0||Je.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{ne.current&&x.current&&ne.current.refTargets.length>0&&(Je.current=!0,Me.current?.(!0)),b([...S])});C.current=!0;const J=o.lazy(async()=>{try{const Ee=await Promise.resolve().then(()=>require("./SCBX5JOswC8iI0UG.cjs"));return C.current=!1,Ue.current=!0,b([...S]),Ee}catch(Ee){return console.warn(Ee),Me.current?.(!1),null}});He(J)},[S,g,R,h]);const $e=o.useMemo(()=>!Oe||g?null:c.jsx(o.Suspense,{children:c.jsx(Oe,{className:yt({dragging:M||F,resizing:M,moving:F}),container:null,ref:ne,target:ne.current?S:[],draggable:!g&&!R,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:J=>{de(J.target,"Resize")},onResize:J=>{if(!H.current)return J.stopDrag(),void oe();B(!0);const Ee=J.direction[0]!==0&&J.direction[1]!==0;let Ve=0,Ie=0;for(let Ne=0;Ne<S.length;Ne++){const De=S[Ne],k=$.current.get(De),re=P.current.get(De);if(!k||!re){console.warn("invalid element");continue}let O=J.dist[0],Y=J.dist[1],u=J.drag.dist[0],I=J.drag.dist[1],E=k.startBounds.width,y=k.startBounds.height;Ne===0?(Ve=E,Ie=y):(O*=E/Ve,u*=E/Ve,Y*=y/Ie,I*=y/Ie);const L={...k.startBounds};if(L.width=Math.max(0,E+O),L.height=Math.max(0,y+Y),J.direction[0]===-1&&(L.width=Math.max(0,Math.min(k.startBounds.x+E,E-u))),J.direction[1]===-1&&(L.height=Math.max(0,Math.min(k.startBounds.y+y,y-I))),Ee&&(re.isLockAspectRatio()||J.inputEvent?.shiftKey)){const v=E/y,U=L.width/L.height;U>v?L.height=L.width/v:U<v&&(L.width=L.height*v)}J.direction[0]===-1&&(L.x=Math.max(0,Math.min(k.startBounds.x+E,k.startBounds.x+E-L.width))),J.direction[1]===-1&&(L.y=Math.min(k.startBounds.y+y,k.startBounds.y+y-L.height)),k.movable.setBounds(n.toAbsoluteBounds(L))}},onResizeEnd:J=>{B(!1),ye()},onDragStart:J=>{de(J.target,"Move")},onDrag:J=>{if(!H.current)return J.stopDrag(),void oe();A(!0);for(let Ee=0;Ee<S.length;Ee++){const Ve=S[Ee],Ie=$.current.get(Ve);Ie?Ie.movable.setBounds(n.toAbsoluteBounds({...Ie.startBounds,x:Ie.startBounds.x+J.translate[0],y:Ie.startBounds.y+J.translate[1]})):console.warn("invalid element")}},onDragEnd:J=>{},onMouseUp:J=>{}})}),[be,Oe,S,n,g,R,h,M,F]);return c.jsx("div",{className:yt(p,"movable-area",Zl),style:{width:W.width,height:W.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Wt([Fe,ve]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:W.width,height:W.height},...z,children:c.jsxs("div",{ref:x,style:{position:"absolute",pointerEvents:"auto"},onFocus:J=>{j?.(),Pe(!0)},onBlur:J=>{Pe(!1)},onKeyDownCapture:J=>{if(J.isDefaultPrevented())return;const Ee=J.nativeEvent.ctrlKey,Ve=J.nativeEvent.altKey,Ie=J.nativeEvent.shiftKey;if(J.which===r.KeyCodes.Escape){const O=a.getMovableSelection();let Y=[...O];return S.forEach(u=>{if(Y.length===0)return;const I=P.current.get(u);let E=Y.indexOf(I);Y.splice(E,1)}),Y.length!==O.length&&a.selectMovables(Y),Y.length===0&&w?.(),void J.preventDefault()}const Ne=.1,De=O=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+O)},"Rotate")},k=(O,Y=!0)=>{i.updateSelected(u=>{const I=u.getBounds();let E=1+O;Y||(E=1/E);const y=Math.sqrt(Math.pow(I.width,2)+Math.pow(I.height,2)),L=Math.atan2(I.height,I.width),v=E*y;if(v<10)return;const U=v*Math.cos(L),Z=v*Math.sin(L),ee={x:I.x+(I.width-U)/2,y:I.y+(I.height-Z)/2,width:U,height:Z};u.setBounds(ee)},"Resize")},re=O=>{i.updateSelected(Y=>{const u=Y.getBounds(),I={x:u.x+(O.x??0),y:u.y+(O.y??0),width:u.width+(O.width??0),height:u.height+(O.height??0)};Y.setBounds(I)},"Nudge")};if(J.which===r.KeyCodes.Delete)i.updateSelected(O=>{O.delete()},"Delete"),J.preventDefault();else if(J.key==="a"&&Ee){const O=a.getMovableSelection();a.selectMovables(i.search(),!0),a.selectMovables(O,!0),J.preventDefault()}else J.key==="ArrowLeft"?(Ie?k(Ne,!1):Ve?De(-10):re({x:Ee?-10:-1}),J.preventDefault()):J.key==="ArrowRight"?(Ie?k(Ne,!0):Ve?De(10):re({x:Ee?10:1}),J.preventDefault()):J.key==="ArrowUp"?(Ie?k(Ne,!0):re({y:Ee?-10:-1}),J.preventDefault()):J.key==="ArrowDown"&&(Ie?k(Ne,!1):re({y:Ee?10:1}),J.preventDefault())},children:[we,$e]})})})})),Ht=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ko=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,f=0;for(let h=0;h<e.length;h++){const p=e[h],T=p.getBounds();d+=T[l],m=Math.min(T[i],m),f=Math.max(T[i]+T[l],f),n.push({bounds:T,movable:p})}const g=(f-m-d)/(e.length-1);n.sort((h,p)=>{const T=h.bounds[i],q=p.bounds[i];return T!==q?T-q:h.bounds[a]-p.bounds[a]});const R=new Map;R.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const p=n[h-1].bounds,T={...n[h].bounds};T[i]=p[i]+p[l]+g,n[h].bounds=T,R.set(n[h].movable,T)}return R.set(n[n.length-1].movable,n[n.length-1].bounds),R};function kr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,f=r.useEditMode();o.useRef(f.getMode()).current=f.getMode();const g=r.useCallbackRef(async(w,j,S=null,b=!0)=>{const M=async()=>{const B=await Promise.resolve(m?.showBusy?.(w.label()));try{await j();const F=S??w?.label?.();if(d){let A=null;w&&F!==!1&&(A=new r.SimpleCommand(w.key(),l,{label:F,description:F},M)),d(A)}B?.(),b&&f.setMode(null)}catch(F){B?.(),m?.showError?.(F)}};await M()},[d,m]),[R,h]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,j,S)=>{if(!n)return;const b=n.getMovableSelection();if(b.length===0)return;let M="Drawings";if(b.length===1){const F=b[0];M=s.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const B=`${w.label()} ${M}`;g(w,()=>{let F=null;i&&(F=i.beginCommit(B));const A=n.getMovableSelection();if(A.length===0)return;const _=S?.(A);for(let G=0;G<A.length;G++){const P=A[G];j(P,_)}F?.commit()})},[n,i]),[T,q]=o.useState(n.getMovableSelection()[0]??null),[D,z]=o.useState(!T||T?.isProtected()),W=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){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.",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.",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."},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."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){p(this,w=>{w.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){p(this,(w,j)=>{w.setBounds({x:j.x})},Ht)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){p(this,(w,j)=>{w.setBounds({x:(j.width-w.getBounds().width)/2+j.x})},Ht)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){p(this,(w,j)=>{w.setBounds({x:j.width-w.getBounds().width+j.x})},Ht)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){p(this,(w,j)=>{w.setBounds({y:j.y})},Ht)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){p(this,(w,j)=>{w.setBounds({y:(j.height-w.getBounds().height)/2+j.y})},Ht)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){p(this,(w,j)=>{w.setBounds({y:j.height-w.getBounds().height+j.y})},Ht)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){p(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){p(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(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."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,T]);o.useEffect(()=>{},[f]);const K=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(W,!0),w},[a,W]);return et(T,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===s.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===s.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:w=>{z(w.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;q(w),z(!w||w.isProtected()),h()}}),et(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const w={disabled:D};K.getCommand("formatAnchorTypeTwoCell").update(w),K.getCommand("formatAnchorTypeOneCell").update(w),K.getCommand("formatAnchorTypeAbsolute").update(w),K.getCommand("toggleLockAspectRatio").update(w);const j=t.getCount(),S=n.getMovableSelection(),b=D||j<=1||S.length===0;let M={disabled:b},B=M;if(!b&&S.length===1){const _=S[0];_.getZIndex()===0&&(M={disabled:!0}),_.getZIndex()===j-1&&(B={disabled:!0})}K.getCommand("moveToFront").update(B),K.getCommand("moveForward").update(B),K.getCommand("moveToBack").update(M),K.getCommand("moveBackward").update(M);const F={disabled:D||S.length<=1};K.getCommand("formatDrawAlignLeft").update(F),K.getCommand("formatDrawAlignCenter").update(F),K.getCommand("formatDrawAlignRight").update(F),K.getCommand("formatDrawAlignTop").update(F),K.getCommand("formatDrawAlignMiddle").update(F),K.getCommand("formatDrawAlignBottom").update(F),K.getCommand("formatDrawFlipHorz").update(F),K.getCommand("formatDrawFlipVert").update(F),K.getCommand("formatDrawGroup").update(F),K.getCommand("formatDrawUngroup").update(F),K.getCommand("formatDrawSwapShapes").update(F),K.getCommand("formatDrawSwapShapesHorz").update(F),K.getCommand("formatDrawSwapShapesVert").update(F);const A={disabled:D||S.length<=2};K.getCommand("formatDrawDistributeHorz").update(A),K.getCommand("formatDrawDistributeVert").update(A)},[R,D,R]),K}const Xl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:f,...g}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:p,width:T}]=zt();return c.jsx("div",{...g,ref:Wt([R,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:f,onRepeatCommandChange:g}=e,R=kr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:f});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Rr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{R.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,R]);return h&&n?h:null})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:f,notifier:g=r.DefaultNotifier}=e,R=r.useEditMode(),[h,p]=o.useState(null),[T,q]=o.useState(null),[D,z]=o.useState(null),[W,K]=o.useState(null),[w,j]=o.useState(null);o.useLayoutEffect(()=>{if(D===null)return K(null),void j(null);const x=()=>{const H=i.getRange(D).getCell(),ne=H.getStyle();let be,oe=ne.getFill()?.toCSS(a.body.darkMode);oe.background!=="none"&&oe.background!=="transparent"||(oe=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),oe.background!=="none"&&oe.background!=="transparent"||(oe={background:a.body.fill}),K({style:oe}),H&&!H.getFormula()&&(be=H?.getRenderHorizontalAlignment()),j(be??r.HorizontalAlignment.Left)};return x(),i.getRange(D).addListener(()=>{x()})},[i,D,a?.body]);const S=r.useCallbackRef(()=>{let x=T.editState.dirty??"";if(T.editState.dirty!==void 0){const H=s.TextUtils.clampString(x);try{const ne=T.sheet.getRange(T.coords),be=`Typing '${H}' into ${ne.toString()}`;return ne.setValue(x,{description:be,autoFit:!0}),z(null),q(null),R.setMode(null),m(null),!0}catch(ne){throw g.showError(new Error(`Unable to enter '${H}'.`,{cause:ne})),ne}}},[i,T,g]),b=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??ue.CoordUtils.cellToRange(x),[i]),M=r.useCallbackRef(x=>{let H=s.IRange.Orientation.Row,ne=!1;x!==s.IRange.Direction.Up&&x!==s.IRange.Direction.Down||(H=s.IRange.Orientation.Column),x!==s.IRange.Direction.Left&&x!==s.IRange.Direction.Up||(ne=!0),i.getSelection().traverse(H,ne)},[i]),B=o.useCallback((x,H)=>{if(l)return l(x,H);if(!i)return null;const{ref:ne,...be}=x;return c.jsx(vr,{ref:ne,...be,sheet:i,bodyStyle:a?.body,activeCoords:H,commands:f,onChangeEdit:oe=>{const X={sheet:i,coords:H,editState:oe};R.setMode(ae=>({...ae,description:X.editState.editMode?"Edit":"Enter",args:{...ae?.args,stateAndCoords:X}}))},editState:T.editState})},[i,W,l,T,D]),{overlay:F,startEdit:A,submitEdit:_,cancelEdit:G,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:B,canEdit:()=>{const x=!i.getProtection().isLocked();return x||d(),x},onBeforeStartEdit:x=>{const H=Cr(()=>i.getRange(x).getCell()),ne={sheet:i,coords:x,editState:Object.freeze(H)};R.setMode({key:"edit",args:{stateAndCoords:ne}}),q(ne)},onStartEdit:x=>{z(x),m(x)},onSubmitEdit:S,onCancelEdit:x=>{z(null),q(null),R.setMode(null),m(null)},onDoneEdit:x=>{R.setMode(null)},onNavigate:M,containerProps:W,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:w,getRangeCoords:b});et(i.getSelection(),{onChange(x){p(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(x=>{V(x),D&&_()},[V,G,D]),te=o.useCallback(x=>{V(x)},[V]),N=o.useCallback(x=>{P(x)},[P]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",$),x.addEventListener("dblclick",te),x.addEventListener("keydown",N),()=>{x.removeEventListener("pointerdown",$),x.removeEventListener("dblclick",te),x.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const x=R.getMode(),H=x?.key;H==="edit"||H==="enter"?T?x.args?.cancel?G():x.args?.submit?_():q(x.args?.stateAndCoords):A(x.args?.start):D&&G()},[R]),F(n,t)})),Mr="white",Ir="black",Ql=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Ir}' fill='${Mr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ei=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 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='${Ir}' fill='${Mr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[f,g]=o.useState(null),[R,h]=o.useState(null),[p,T]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)}else l(!1),m(null)},[i,n]),D=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const b=n.getCellCoordsFromClient(S.clientX,S.clientY),M=i.getTables().search({address:b});M.length===1&&M[0].select()},[n,i]),z=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const b=n.getCellCoordsFromClient(S.clientX,S.clientY),M=i.getTables().search({address:b});if(M.length===1){const B=M[0].getRange().getCoords(),F={colStart:B.colStart,rowStart:b.rowIndex,colEnd:B.colEnd,rowEnd:b.rowIndex};i.getRange(F).select()}},[n,i]),W=r.useCallbackRef(()=>{if(!a)return;const S=i.getTables().search({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)},[i,a,n]);et(i?.getSelection(),{onChange(S){g(i.getSelection().getCoords().cell)}}),et(R,{onAnyChange(S){q(),W()}}),et(p,{onAnyChange(S){W()}}),et(i,{onTablesChange(S){q(),W()},onInvalidated(S){q(),W()}});const K=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(W,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let S=null;if(d)for(let b=0;b<d.length&&!S;b++){const M=d[b],B=M.getRange().getCoords();s.CoordUtils.isCellWithinRange(f,B)&&(S=M)}h(S)},[f,d]);const w=r.useCallbackRef(S=>{let b=null;if(d)for(let M=0;M<d.length;M++){const B=d[M],F=B.getRange().getCoords();let A=n.getRangeCoordsBounds(F);const _=n.getRelativePointFromClient(S.clientX,S.clientY),G=_.x,P=_.y;if(G>=A.x&&G<=A.x+A.width&&P>=A.y&&P<=A.y+A.height){const V=n.getViewportSize();G<=0||P<=0||G>=V.width||P>=V.height||(b=B)}}T(b)},[n,d]);if(o.useEffect(()=>{const S=n?.getStage();if(S&&d)return S.addEventListener("mousemove",w),S.addEventListener("mouseleave",w),()=>{S.removeEventListener("mousemove",w),S.removeEventListener("mouseleave",w)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const j=[];for(let S=0;S<d.length;S++){const b=d[S];if(b.isClosed())continue;const M=b===p,B=b===R,F=b.getRange().getCoords(),A=n.getRangeCoordsBounds(F);let _;if(M||B){const G=b.getStyle().getProperties(),P=G.headerRow?.fill?.background??G.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(_=V.toCSS())}_||(_="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:A.height,pointerEvents:"all",cursor:Ql},onMouseDown:z},`table-select-row-${b.getName()}`)),j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:Math.min(16,A.height),pointerEvents:"all",cursor:ei},onMouseDown:D},`table-select-${b.getName()}`)),j.push(c.jsx(dt.Selection,{x:A.x,y:A.y,width:A.width,height:A.height,range:F,strokeWidth:B?.5:0,stroke:_??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${_} 0px 0px 1px 1px`:void 0}},`table-outline-${b.getName()}`))}return j})),ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,f]=o.useState(null),g=o.useRef(null),R=r.useCallbackRef(()=>{const z=i.getSelectedCell(),W=z.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(W,l)||(f(W?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(W),coords:W}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(W))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{f(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(R,80),80),[]);if(et(i?.getSelection(),{onChange(z){h()}}),et(i,{onSpillsChange(z){R()},onInvalidated(z){R()}}),!n||!l&&!m)return null;const p=i.getRange(l).getValue()instanceof s.FormulaError.Spill,T=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&f(null),q=n.toClipBounds(q,-10),!q)return;const D="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:D,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${D} 0px 0px 4px 0px`}},"spill-outline}")),T})),oi={position:"absolute",top:0,left:0,bottom:0,right:0},$o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ri={fireOnModelChange:!1},Wo={},Tr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Wo,headersStyle:a=Wo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:f,rowHeaderProps:g,showScrollbars:R=!0,scrollPaneProps:h,onViewportChange:p,commands:T,onRepeatCommandChange:q,onMoveCell:D,overlays:z,renderMovable:W,viewportComponent:K,onElementLoad:w,getCellEditor:j,onFocus:S,onBlur:b,style:M=r.ReactUtils.EmptyCssProperties,notifier:B,onShowTooltip:F,onShowColumnTooltip:A,onShowRowTooltip:_,onCloseTooltip:G,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[te,N]=o.useReducer(Q=>Q+1,0),[x,{width:H,height:ne}]=zt(),be=r.useCallbackRef(F,[F]),oe=r.useCallbackRef(A,[A]),X=r.useCallbackRef(_,[_]),ae=r.useCallbackRef(G,[G]),Me=o.useRef(!1);o.useLayoutEffect(()=>{Me.current=!0},[n]);const Te=n?.getStyles(),fe=o.useMemo(()=>$o(i,Te),[i,Te]),Be=o.useMemo(()=>$o(a,Te),[a,Te]),{body:pe={},buttonSurface:Pe={}}=fe,{header:Se={},headerSelect:ge={},headerSelectAll:ce={}}=Be,we=o.useRef(null),[de,ye]=o.useState(()=>n?.getView()),Ae=(de?.getZoomScale()??100)/100,ve=o.useMemo(()=>({vertical:de.isShowColumnGridlines()&&Ae>=.4,horizontal:de.isShowRowGridlines()&&Ae>=.4}),[de?.isShowColumnGridlines(),de?.isShowRowGridlines(),Ae]),Fe=o.useMemo(()=>{if(de?.getGridLineColor())return{strokeDasharray:"1,1"}},[de?.getGridLineColor(),fe]),Oe=d??de?.isShowColumnHeaders(),He=f??de?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Je=o.useMemo(()=>{let Q=40,qe=20;const ke=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=ke?.toCSS()?.fontFamily??fe.header.text.fontFamily,Ze=ke?.getSize()??fe.header.text.fontSize,Qe=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);Q=Qe.width,qe=Qe.lineHeight}return{width:Math.round(Q+5),height:Math.round(qe+3)}},[C,fe?.header.text,n]),$e=He?Ae*Je.width:Se.edgeStrokeWidth,J=Oe?Ae*Je.height:Se.edgeStrokeWidth,Ee=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??Je.width)+$e+1),Ve=Math.max(ne,(n?.getRowHeaders().getDefaultSize()??Je.height)+J+1),Ie=o.useRef(new Map),Ne=o.useRef(null),De=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[k,re]=o.useState(()=>De()),[O,Y]=o.useState(!1),[u,I]=o.useState(null),E=!0,y=fe.selection?.strokeFill,L=o.useCallback(()=>kt.current,[]),[v,U]=o.useState(),Z=r.useCallbackRef(Q=>{U(Q),n&&n.getView()&&n.getView().setTopLeft(Q?{left:Q.left,top:Q.top}:null),p?.(Q)},[n,p]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const Q=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=Q.addListener(()=>{const qe=Q.getCoords();we?.current?.invalidate(qe)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(Q=>{const qe=ue.CoordUtils.cellToRange(Q);if(n.isClosed())return qe;const ke=n.getRange(qe,{excludeHidden:!0}).getMerges();return ke.length===0?qe:ke[0]},[n]),Ce=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const qe={};return Q.coords.colIndex>0&&(qe[ue.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(qe[ue.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),qe},[he,me]=o.useState(()=>Ce(n.getView().getFreezePanes())),xe=r.useEditMode(),Le=o.useCallback(()=>we.current,[]),ze=r.useCallbackRef(Q=>{xe.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),We=r.useCallbackRef(()=>v,[v]),je=qr({sheet:n,commands:T,target:Le,onRepeatCommandChange:q,bodyStyle:pe,notifier:B,onStartEdit:ze,getViewport:We}),[Re,_e]=o.useState(n.getSelection().isEntire()),[lt,it]=o.useState(de?.getMovableSelection().length>0),pt=u!==null||lt,wt=null,[Ge,ot]=o.useState(!1);o.useEffect(()=>{ot(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{Ge||(ot(!0),B.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[B,Ge]),bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.cursor?Q.cursor:null},[wt,xe]),[Ct,gt]=o.useState(null),rt=o.useRef(!1),[It,Lt]=o.useState([]),Zt=o.useRef(null),[Ft,Xt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Mt,vn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Xt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{vn({left:0,top:le?.top})},[le?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{me(Ce(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),et(n,{onViewChange(){ye(n.getView()),re(De())},onLayoutChange:()=>{const Q=n.getEntireRange();Ue({height:Q.getRowCount(),width:Q.getColumnCount()}),re(De())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),et(n,{onRequestScrollIntoView:async(Q,qe)=>{if(!qe)return;const ke={colIndex:qe?.coords.colStart,rowIndex:qe?.coords.rowStart};return await we.current?.scrollCellCoordsIntoView(ke,qe?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(kt.current)},ri);const Cn=o.useMemo(()=>{const Q=(ke,Ke)=>{rt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:ke,colEnd:ke})))return;const Qe=Ze.getLayout(),nt=Math.max(0,Qe.getColOffset(ke)),Ye=Ze.getBounds(),st=Math.min(Ye.x+Ye.width,Qe.getColOffset(ke+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Left||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Right)){const Xn=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),qn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Ae),2).toFixed(2),Yn="Width: "+(Ke?qn+" ("+Xn+" pixels)":"Hidden"),nn=Vt.current.getGridElement().getRelativePointFromClient(0,0),Pt=0-nn.y,Sn=0-nn.y+J,Jn={x:nt-(nn.x-Ye.x),y:Pt,width:st-nt,height:Sn-Pt};requestAnimationFrame(()=>{rt.current&&oe?.({anchor:Jn,display:Yn})})}const Tt=[0,0,0,Ye.height],tn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Gn={x:nt-1,y:0,width:1,height:Ye.height},_n={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Zn={x:st-1,y:0,width:1,height:Ye.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(ke,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(ke,Ke)},onResizeHeaders:(ke,Ke,Ze)=>{Q(ke,Ke)},onResizeHeadersDown:(ke,Ke)=>{Q(ke,Ke)},onResizeHeadersEnd:(ke,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},...m}},[n,m,J,Ct]),Ot=o.useMemo(()=>{const Q=(ke,Ke)=>{rt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:ke,rowEnd:ke,colStart:0,colEnd:C.width})))return;const Qe=Ze.getLayout(),nt=Math.max(0,Qe.getRowOffset(ke)),Ye=Ze.getBounds(),st=Math.min(Ye.y+Ye.height,Qe.getRowOffset(ke+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Top||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Bottom)){const Xn=Math.floor(10*ue.CommonUtils.getDPI())/10,qn=ue.CommonUtils.roundAccurately(Ke*Xn,0),Yn=ue.CommonUtils.roundAccurately(qn/Ae/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),nn="Height: "+(Ke?Yn+" ("+qn+" pixels)":"Hidden"),Pt=en.current.getGridElement().getRelativePointFromClient(0,0),Sn=0-Pt.x,Jn=0-Pt.x+$e,ml={x:Sn,y:nt-(Pt.y-Ye.y),width:Jn-Sn,height:st-nt};requestAnimationFrame(()=>{rt.current&&X?.({anchor:ml,display:nn})})}const Tt=[0,0,Ye.width,0],tn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Gn={x:0,y:nt-1,width:Ye.width,height:1},_n={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:y}},Zn={x:0,y:st-1,width:Ye.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:Tt,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(ke,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(ke,Ke)},onResizeHeaders:(ke,Ke,Ze)=>{Q(ke,Ke)},onResizeHeadersDown:(ke,Ke)=>{Q(ke,Ke)},onResizeHeadersEnd:(ke,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},onResizeHeadersUp:ke=>{requestAnimationFrame(()=>ae?.()),rt.current=!1,gt(null)},...g}},[n,g,$e]),kt=r.useImperativeElement(t,()=>{const Q=ke=>{n?.getView()&&n.getView().selectMovables([]),Ne.current=null,we?.current?.focus(ke)},qe=async(ke=null)=>{if(ke||(ke=n?.getView().getMovableSelection()[0]),!ke)return!1;const Ke=ke.getAnchorCoords();if(!Ke)return!1;const Ze=we.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const Qe=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(ke)===-1&&n?.getView().selectMovables([ke]);let nt=Ie.current?.get(Qe);return nt?.current?(await nt.current.focusMovable(ke),!0):(Ne.current={movable:ke,anchor:Qe},!0)};return{getGridElement:()=>we.current,getRowHeaderElement:()=>en.current,getColumnHeaderElement:()=>Vt.current,rowHeaderHeight:()=>J,colHeaderWidth:()=>$e,startEdit:ze,submitEdit:()=>{xe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{xe.setMode(ke=>ke?.key!=="edit"?ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:ke=>{n?.getView().getMovableSelection().length>0&&qe()||Q(ke)},focusSheet:Q,focusMovable:qe,contains:ke=>we?.current?.contains?.(ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{Me.current||(we?.current?.invalidate(Q),N?.())},[]);o.useEffect(()=>{At()},[fe]);const Yt=Re?ce.edgeStrokeFill:Se.fill,Hn=Re?ge.fill:typeof fe.headerHover=="function"?fe.headerHover(Se)?.fill:Se.fill,tt=o.useMemo(()=>K?c.jsx("div",{className:yt("sheetxl-viewport-overlay",Il),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:K}):c.jsx(c.Fragment,{}),[K]);let Jt=null;Oe&&He&&(Jt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${J}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let qe=!Q.ctrlKey;je?.getCommand("selectAll")?.execute(!qe||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):we.current?.focus()},children:[c.jsx("div",{style:{height:J-5+"px",width:J-5+"px",clipPath:`path('M${J-5} 0 L0 ${J-5} L${J-5} ${J-5} L${J-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Hn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${J}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const jt=r.useCallbackRef(({_left:Q,_top:qe})=>{},[]),yn=r.useCallbackRef(Q=>{if(!l)return;const qe=we.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);qe&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),at=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:qe}=Q;return qe>0?je.getCommand("sheetZoomOut")?.execute():qe<0&&je.getCommand("sheetZoomIn")?.execute(),qe===0},[je]);o.useEffect(()=>{Lt(null),Zt.current=null,rt.current=!1,gt(null);const Q=n?.getView().getTopLeft();jt(Q),we.current?.scrollTo(Q),ie(Q),ye(n.getView()),me(Ce(n.getView().getFreezePanes())),re(De()),N()},[n?.getView()]);const ht=r.useCallbackRef(Q=>{const qe=Q.getVisibleRangeCoords();if(!qe)return null;const ke=[];return n.getRange(qe).forEach((Ke,Ze)=>{const Qe=Ze.getCoords(),nt=Ze.getCell();(Ye=>{if(Ye.isEmpty())return!1;const st=Ye.getSpans();if(st.width>1||st.height>1||Ye.getStyle().hasVisibleStyling()||de.isShowFormulas()&&Ye.getFormula()!==null)return!0;const mt=Ye.getValue();return mt!==null&&!(!de.isShowZeros()&&mt===0&&Ye.getType()===s.ScalarType.Number)})(nt)&&ke.push({coords:Qe,value:nt,range:de.isShowFormulas()?null:nt.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),ke},[n,de.isShowZeros(),de.isShowFormulas(),u]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),Ct&&Q.push(...Ct),ue.CommonUtils.isEqualArrays(Q,Zt.current)||(Zt.current=Q,Lt(Q))},[z,Ct,fe]);const Qt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),bn=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(Ne.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.key==="cut"||Q?.key==="copy"},[xe]),Un=r.useCallbackRef(async Q=>{const qe=xe.getMode();return Q.keyCode===r.KeyCodes.Escape&&qe?(Q.preventDefault(),void xe.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Bt?(Q.preventDefault(),await je?.getCommand("paste")?.execute(),void xe.setMode(null)):void je?.dispatchToFocusedCommand(Q)},[je,xe]),en=o.useRef(null),wn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Ho,{ref:en,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Ve,sheetHeader:n.getRowHeaders(),gridStyle:Be,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[$e,J,Ve,n,Mt,he?.[ue.AnchorLocation.Top],fe,E,l,Se.fill,g]),Vt=o.useRef(null),xn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Ho,{ref:Vt,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Left],oppositeSize:J,containerWidth:Ee,containerHeight:J,sheetHeader:n.getColumnHeaders(),gridStyle:Be,scrollPoint:Ft,onSheetContextMenu:l,...Cn,style:{...Cn?.style,position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[J,Ee,n,Ft,he?.[ue.AnchorLocation.Left],fe,Se.fill,E,l,m]),sl=r.useCallbackRef(Q=>{const{value:qe,key:ke,...Ke}=Q;let Ze=qe,Qe=u;if(!Qe||Qe.colIndex===Q.coords.colIndex&&Qe.rowIndex===Q.coords.rowIndex||(Qe=null),!Ze){const st=Q.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let nt=null;Ze.getHyperlink()&&(nt=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(mt){B?.showError?.(mt)}}}),Qe&&Qe.colIndex===Q.range.colStart&&Qe.rowIndex===Q.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Ye=n.getStyles();return o.createElement(pr,{...Ke,key:ke,bodyStyle:pe,docTheme:Ye.getTheme(),normalStyle:Ye.getNormal(),showFormulas:de.isShowFormulas(),showZeros:de.isShowZeros(),onLinkMouseDown:nt,...V,value:Ze})},[n,k,pe,u,de?.isShowFormulas(),de.isShowZeros()]),dl=o.useCallback((Q,qe)=>{const{key:ke,...Ke}=Q;return[c.jsx(Fl,{ref:qe,getVisibleCells:ht,sheet:n,gridStyle:fe,...Ke},`border-${ke}`),c.jsx(ti,{ref:qe,sheet:n,commands:je,...Ke},`table-${ke}`),c.jsx(ni,{ref:qe,sheet:n,...Ke},`spill-${ke}`),c.jsx(Wl,{ref:qe,sheet:n,commands:je,notifier:B,onShowTooltip:be,onCloseTooltip:ae,gridStyle:fe,gridRef:we,editingCoords:u,isActive:E,...Ke},`selection-${ke}`),c.jsx(Bl,{ref:qe,sheet:n,commands:je,gridStyle:fe,element:L,notifier:B,...Ke},`copy-paste-${ke}`),c.jsx(Yl,{ref:qe,sheet:n,commands:je,target:Le,notifier:B,renderMovable:W,movableProps:{onUnFocus:()=>{kt.current.focus()}},...Ke},`movable-${ke}`),c.jsx(Jl,{ref:qe,sheet:n,commands:je,notifier:B,gridStyle:fe,getCellEditor:j,showProtectedError:vt,setEditingCoords:I,...Ke},`editor-${ke}`)]},[n,we.current,fe,j,je,B]),[ko,cl]=o.useState(!1),ul=o.useMemo(()=>{if(Ee===0||Ve===0)return null;const Q=n.getStyles().getNormal(),qe=Q.getFont(),ke=Q.getFill(),Ke=Q.getBorder(),Ze=Q.getFill().getType()===s.IFill.Type.None;let Qe=Fe,nt=Fe;const Ye=(mt,Tt,tn)=>tn?{stroke:Ke.getBottom().isNone()?"none":mt.getColor().toRGBA(pe.darkMode).toString(),...Tt}:Tt;nt=Ye(Ke.getBottom(),nt,!Ke.getBottom().isNone()),nt=Ye(Ke.getTop(),nt,!Ke.getTop().isNone()),Qe=Ye(Ke.getRight(),Qe,!Ke.getRight().isNone()),Qe=Ye(Ke.getLeft(),Qe,!Ke.getLeft().isNone());let st=de?.getGridLineColor()?.toRGBA(pe.darkMode).toString()??pe.strokeFill;return Ze||(nt=Ye(Ke.getBottom(),nt,!0),nt=Ye(Ke.getTop(),nt,!0),Qe=Ye(Ke.getRight(),Qe,!0),Qe=Ye(Ke.getLeft(),Qe,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...oi,...ke.toCSS(pe.darkMode),...qe.toCSS(pe.darkMode,Ae),"--sxl-app-color-background":pe.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":Pe.fill,"--sxl-app-color-button-text":Pe.text?.fill,"--sxl-app-color-button-border":Pe.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:we,zoom:Ae,...P,onFirstRender:mt=>{cl(!0),P?.onFirstRender?.(mt),je?.activate()},showGridLines:ve,gridLineColor:st,gridLineColumnsProps:Qe,gridLineRowsProps:nt,freezeLeft:he?.[ue.AnchorLocation.Left],freezeLeftProps:Qt,freezeTop:he?.[ue.AnchorLocation.Top],freezeTopProps:Qt,width:Ee,height:Ve,columnCount:C.width,rowCount:C.height,cursor:bt??wt??"cell",clipCells:!0,layout:k,cellRenderer:sl,overlayRenderer:dl,getCellCoordsAsRangeCoords:se,getVisibleCells:ht,onWheelScroll:at,onPointerDown:bn,onKeyDown:Un,onViewportChange:Z,onImmediateScroll:jt,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:It})},[te]);o.useEffect(()=>{Me.current||N()},[k,he,Ae,je,le?.left,le?.top,pe,P,Ee,Ve,bt,It,E,wt]);let Kn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};R||(Kn={...Kn,...M});const gl=o.useMemo(()=>{const Q=n.getStyles().getTheme(),qe=Q.getColorScheme(),ke=Q.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(pe.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(pe.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(pe.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(pe.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(pe.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(pe.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(pe.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(pe.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(pe.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(pe.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(pe.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(pe.darkMode),"--sxl-doc-font-major":ke.getMajorFont(),"--sxl-doc-font-minor":ke.getMinorFont()}},[n.getStyles().getTheme()]);let $n=c.jsx("div",{style:Kn,onTouchStart:()=>{Mo()},onFocus:Q=>{Y(!0),S?.(Q)},onBlur:Q=>{Y(!1),b?.(Q)},ref:kt,...$,children:c.jsx("div",{className:yt("sheetxl-sheet",Ml),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:[Jt,wn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:pe.fill},ref:x,onContextMenu:yn,children:[ul,tt,c.jsx(Tl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(R){const Q=qe=>c.jsx(vo,{...qe,sheet:n});$n=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Je.height,minWidth:2*Je.width,...M},viewport:v,touchElement:we.current?.stage,disableTouch:pt,onScrollViewport:qe=>{we.current?.scrollTo(qe)},createHorizontalScrollbar:Q,createVerticalScrollbar:Q,...h,children:$n})}o.useEffect(()=>{Me.current=!1,N?.(),O&&kt.current?.focus()},[n]);const[Wn,hl]=o.useState(!1),Mo=r.useCallbackRef(()=>{Wn||hl(!0)},[Wn]);return o.useEffect(()=>{if(ko)return typeof w=="function"&&w(),r.ReactUtils.detectIt().primaryInput==="touch"&&Mo(),()=>{}},[w,ko,Wn]),$n}));Tr.displayName="SheetElement";const li=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Go="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Er=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:f,onHide:g,onShow:R,onKeyDownCapture:h,onFocus:p,onBlur:T,loadingPanel:q,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(null),[j,S]=o.useState(null),[b,M]=o.useState(null);o.useEffect(()=>{S(null),l.getDetails().then(A=>{W(!1),S(A.asUrl()),A.asSVGText?.()&&M(A.asSVGText())}).catch(A=>{console.warn(A),W(!0),S(Go),M(null)})},[l]);const B=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(j||b)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:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:j,onLoad:()=>{w(!0)},onError:({currentTarget:A})=>{console.log("error"),A.onerror=null,S(Go),W(!0)},alt:d??`${l.getType()}`})},[K,l,j,b,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...D,onKeyDownCapture:A=>{h?.(A)},ref:B,children:[K||z?void 0:q,F]})}));Er.displayName="PictureEditor";const ii=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:f,...g}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:p,width:T}]=zt();if(!a.isClosed())return c.jsx("div",{...g,ref:Wt([R,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ai="_editable-input_w34rk_11",si=e=>c.jsx("input",{...e}),Fr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:f=si,notifier:g,styleHover:R={},dragging:h,maxLength:p,disabled:T=!1,readOnly:q=!1,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(!1),[j,S]=o.useState(a);o.useEffect(()=>{S(a)},[a]);const b=o.useRef(null),[M,B]=o.useState(null),F=o.useCallback(function(te){const N=te.message;M!==N&&(g?.showMessage?.(N,{type:r.NotificationType.Error}),B(N))},[g,M]),A=o.useCallback(te=>{let N=!1;try{N=l?.(te)??!0}catch(x){F(x)}return N?(b.current=null,w(!1),S(te),N):(setTimeout(()=>{b.current?.focus()},0),N)},[l]),_=r.useCallbackRef(()=>{S(a),b.current=null,w(!1),m?.()},[m,a]),G=o.useMemo(()=>{if(!K)return null;const te={className:yt(ai),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:p,type:"text",value:j,onFocus:N=>{b.current||(b.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{b.current&&A(j)},onChange:N=>{K&&S(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void _()):N.code==="Enter"?(N.preventDefault(),void A(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():A(N.target.value))};return c.jsx(c.Fragment,{children:f(te)})},[K,j,A,_,f,T]),[P,V]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(h||z)&&(te=Object.assign(te,R)),V(te)},[h,z,R,n]),o.useEffect(()=>{G&&d?.(j)},[G,d,j]);const $=r.useImperativeElement(t,()=>({startEdit(){T||q||w(!0)},cancel(){_()}}),[]);return c.jsxs("div",{...D,ref:$,style:{flexDirection:"column",display:"flex",...P},className:yt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{T||q||w(!0)},onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:j}),G]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...R},children:j})]})})),On=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Co(e){return"nodeType"in e}function ft(e){var t,n;return e?Gt(e)?e:Co(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yo(e){const{Document:t}=ft(e);return e instanceof t}function mn(e){return!Gt(e)&&e instanceof ft(e).HTMLElement}function Ar(e){return e instanceof ft(e).SVGElement}function $t(e){return e?Gt(e)?e.document:Co(e)?yo(e)?e:mn(e)||Ar(e)?e.ownerDocument:document:document:document}const St=On?o.useLayoutEffect:o.useEffect;function jn(e){const t=o.useRef(e);return St(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function ln(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function En(e){const t=jn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Fn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let to={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=to[e]==null?0:to[e]+1;return to[e]=n,e+"-"+n},[e,t])}function Dr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[f,g]of m){const R=l[f];R!=null&&(l[f]=R+e*g)}return l},{...t})}}const Kt=Dr(1),gn=Dr(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function An(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),_o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function di(e){return e.matches(_o)?e:e.querySelector(_o)}const ci={display:"none"};function ui(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:ci},n)}function gi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},n)}const zr=o.createContext(null),hi={draggable:`
|
|
24
24
|
To pick up a draggable item, press the space bar.
|
|
25
25
|
While dragging, use the arrow keys to move the item.
|
|
26
26
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
27
|
-
`},mi={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function fi(e){let{announcements:t=mi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=hi}=e;const{announce:l,announcement:d}=function(){const[h,p]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&p(T)},[]),announcement:h}}(),m=fn("DndLiveRegion"),[f,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const p=o.useContext(zr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(h)},[h,p])}(o.useMemo(()=>({onDragStart(h){let{active:p}=h;l(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:T}=h;t.onDragMove&&l(t.onDragMove({active:p,over:T}))},onDragOver(h){let{active:p,over:T}=h;l(t.onDragOver({active:p,over:T}))},onDragEnd(h){let{active:p,over:T}=h;l(t.onDragEnd({active:p,over:T}))},onDragCancel(h){let{active:p,over:T}=h;l(t.onDragCancel({active:p,over:T}))}}),[l,t])),!f)return null;const R=o.createElement(o.Fragment,null,o.createElement(ui,{id:i,value:a.draggable}),o.createElement(gi,{id:m,announcement:d}));return n?Dt.createPortal(R,n):R}var ct;function Dn(){}function no(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ct||(ct={}));const Rt=Object.freeze({x:0,y:0});function Nr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pi(e,t){const n=An(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Lr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function vi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Zo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Or(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Xo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ci=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Xo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,f=n.get(m);if(f){const g=Nr(Xo(f),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(Lr)};function yi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const f=t.width*t.height,g=e.width*e.height,R=d*m;return Number((R/(f+g-R)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const f=yi(m,t);f>0&&a.push({id:d,data:{droppableContainer:l,value:f}})}}return a.sort(vi)};function Yo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function wi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const xi=wi(1);function jr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const qi={ignoreTransform:!1};function _t(e,t){t===void 0&&(t=qi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:R}=ft(e).getComputedStyle(e);g&&(n=function(h,p,T){const q=jr(p);if(!q)return h;const{scaleX:D,scaleY:z,x:W,y:K}=q,w=h.left-W-(1-D)*parseFloat(T),j=h.top-K-(1-z)*parseFloat(T.slice(T.indexOf(" ")+1)),S=D?h.width/D:h.width,b=z?h.height/z:h.height;return{width:S,height:b,top:j,right:w+S,bottom:j+b,left:w}}(n,g,R))}const{top:i,left:a,width:l,height:d,bottom:m,right:f}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:f}}function Jo(e){return _t(e,{ignoreTransform:!0})}function Vn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(yo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mn(a)||Ar(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const f=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const R=m[g];return typeof R=="string"&&f.test(R)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function Br(e){const[t]=Vn(e,1);return t??null}function oo(e){return On&&e?Gt(e)?e:Co(e)?yo(e)||e===$t(e).scrollingElement?window:mn(e)?e:null:null:null}function Vr(e){return Gt(e)?e.scrollX:e.scrollLeft}function Pr(e){return Gt(e)?e.scrollY:e.scrollTop}function co(e){return{x:Vr(e),y:Pr(e)}}var ut;function Hr(e){return!(!On||!e)&&e===document.scrollingElement}function Ur(e){const t={x:0,y:0},n=Hr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const Si={x:.2,y:.2};function Ri(e,t,n,i,a){let{top:l,left:d,right:m,bottom:f}=n;i===void 0&&(i=10),a===void 0&&(a=Si);const{isTop:g,isBottom:R,isLeft:h,isRight:p}=Ur(e),T={x:0,y:0},q={x:0,y:0},D=t.height*a.y,z=t.width*a.x;return!g&&l<=t.top+D?(T.y=ut.Backward,q.y=i*Math.abs((t.top+D-l)/D)):!R&&f>=t.bottom-D&&(T.y=ut.Forward,q.y=i*Math.abs((t.bottom-D-f)/D)),!p&&m>=t.right-z?(T.x=ut.Forward,q.x=i*Math.abs((t.right-z-m)/z)):!h&&d<=t.left+z&&(T.x=ut.Backward,q.x=i*Math.abs((t.left+z-d)/z)),{direction:T,speed:q}}function ki(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Kr(e){return e.reduce((t,n)=>Kt(t,co(n)),Rt)}function $r(e,t){if(t===void 0&&(t=_t),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Br(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Vr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Pr(n),0)}]];class uo{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Vn(n),a=Kr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Mi)for(const f of d)Object.defineProperty(this,f,{get:()=>{const g=m(i),R=a[l]-g;return this.rect[f]+R},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function ro(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Xe;function Qo(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"})(xt||(xt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Xe||(Xe={}));const Wr={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},Ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xe.Right:return{...n,x:n.x+25};case Xe.Left:return{...n,x:n.x-25};case Xe.Down:return{...n,y:n.y+25};case Xe.Up:return{...n,y:n.y-25}}};class bo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new an($t(n)),this.windowListeners=new an(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&$r(i),n(Rt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Wr,coordinateGetter:d=Ti,scrollBehavior:m="smooth"}=a,{code:f}=t;if(l.end.includes(f))return void this.handleEnd(t);if(l.cancel.includes(f))return void this.handleCancel(t);const{collisionRect:g}=i.current,R=g?{x:g.left,y:g.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=R);const h=d(t,{active:n,context:i.current,currentCoordinates:R});if(h){const p=gn(h,R),T={x:0,y:0},{scrollableAncestors:q}=i.current;for(const D of q){const z=t.code,{isTop:W,isRight:K,isLeft:w,isBottom:j,maxScroll:S,minScroll:b}=Ur(D),M=ki(D),B={x:Math.min(z===Xe.Right?M.right-M.width/2:M.right,Math.max(z===Xe.Right?M.left:M.left+M.width/2,h.x)),y:Math.min(z===Xe.Down?M.bottom-M.height/2:M.bottom,Math.max(z===Xe.Down?M.top:M.top+M.height/2,h.y))},F=z===Xe.Right&&!K||z===Xe.Left&&!w,A=z===Xe.Down&&!j||z===Xe.Up&&!W;if(F&&B.x!==h.x){const _=D.scrollLeft+p.x,G=z===Xe.Right&&_<=S.x||z===Xe.Left&&_>=b.x;if(G&&!p.y)return void D.scrollTo({left:_,behavior:m});T.x=G?D.scrollLeft-_:z===Xe.Right?D.scrollLeft-S.x:D.scrollLeft-b.x,T.x&&D.scrollBy({left:-T.x,behavior:m});break}if(A&&B.y!==h.y){const _=D.scrollTop+p.y,G=z===Xe.Down&&_<=S.y||z===Xe.Up&&_>=b.y;if(G&&!p.x)return void D.scrollTo({top:_,behavior:m});T.y=G?D.scrollTop-_:z===Xe.Down?D.scrollTop-S.y:D.scrollTop-b.y,T.y&&D.scrollBy({top:-T.y,behavior:m});break}}this.handleMove(t,Kt(gn(h,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function er(e){return!!(e&&"distance"in e)}function tr(e){return!!(e&&"delay"in e)}bo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Wr,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class wo{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:f}=ft(m);return m instanceof f?m:$t(m)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=$t(d),this.documentListeners=new an(this.document),this.listeners=new an(i),this.windowListeners=new an(ft(d)),this.initialCoordinates=(a=An(l))!=null?a:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,Qo),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,Qo),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(er(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Ii,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const f=(n=An(t))!=null?n:Rt,g=gn(a,f);if(!i&&m){if(er(m)){if(m.tolerance!=null&&ro(g,m.tolerance))return this.handleCancel();if(ro(g,m.distance))return this.handleStart()}return tr(m)&&ro(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(f)}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===Xe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ei={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Gr extends wo{constructor(t){const{event:n}=t,i=$t(n.target);super(t,Ei,i)}}Gr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Fi={move:{name:"mousemove"},end:{name:"mouseup"}};var go;(function(e){e[e.RightClick=2]="RightClick"})(go||(go={}));class _r extends wo{constructor(t){super(t,Fi,$t(t.event.target))}}_r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==go.RightClick&&(i?.({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Zr extends wo{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}var sn,zn;function Ai(e){let{acceleration:t,activator:n=sn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=zn.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:R,delta:h,threshold:p}=e;const T=function(b){let{delta:M,disabled:B}=b;const F=Fn(M);return ln(A=>{if(B||!F||!A)return Di;const _={x:Math.sign(M.x-F.x),y:Math.sign(M.y-F.y)};return{x:{[ut.Backward]:A.x[ut.Backward]||_.x===-1,[ut.Forward]:A.x[ut.Forward]||_.x===1},y:{[ut.Backward]:A.y[ut.Backward]||_.y===-1,[ut.Forward]:A.y[ut.Forward]||_.y===1}}},[B,M,F])}({delta:h,disabled:!l}),[q,D]=function(){const b=o.useRef(null);return[o.useCallback((M,B)=>{b.current=setInterval(M,B)},[]),o.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[])]}(),z=o.useRef({x:0,y:0}),W=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case sn.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case sn.DraggableRect:return a}},[n,a,f]),w=o.useRef(null),j=o.useCallback(()=>{const b=w.current;if(!b)return;const M=z.current.x*W.current.x,B=z.current.y*W.current.y;b.scrollBy(M,B)},[]),S=o.useMemo(()=>m===zn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&K){for(const b of S){if(i?.(b)===!1)continue;const M=g.indexOf(b),B=R[M];if(!B)continue;const{direction:F,speed:A}=Ri(b,B,K,t,p);for(const _ of["x","y"])T[_][F[_]]||(A[_]=0,F[_]=0);if(A.x>0||A.y>0)return D(),w.current=b,q(j,d),z.current=A,void(W.current=F)}z.current={x:0,y:0},W.current={x:0,y:0},D()}else D()},[t,j,i,D,l,d,JSON.stringify(K),JSON.stringify(T),q,g,S,R,JSON.stringify(p)])}Zr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(sn||(sn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zn||(zn={}));const Di={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var hn,ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),function(e){e.Optimized="optimized"}(ho||(ho={}));const nr=new Map;function mo(e,t){return ln(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=jn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function zi(e){return new uo(_t(e),e)}function or(e,t,n){t===void 0&&(t=zi);const[i,a]=o.useState(null);function l(){a(f=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=f??n)!=null?g:null;const R=t(e);return JSON.stringify(f)===JSON.stringify(R)?f:R})}const d=function(f){let{callback:g,disabled:R}=f;const h=jn(g),p=o.useMemo(()=>{if(R||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(h)},[h,R]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p}({callback(f){if(e)for(const g of f){const{type:R,target:h}=g;if(R==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Nn({callback:l});return St(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const rr=[];function lr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Rt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Rt}function ir(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const ar=[];function Xr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const Ni=[{sensor:Gr,options:{}},{sensor:bo,options:{}}],Li={current:{}},Tn={draggable:{measure:Jo},droppable:{measure:Jo,strategy:hn.WhileDragging,frequency:ho.Optimized},dragOverlay:{measure:_t}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const 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:Dn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Tn,measureDroppableContainers:Dn,windowRect:null,measuringScheduled:!1},Yr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dn,draggableNodes:new Map,over:null,measureDroppableContainers:Dn},pn=o.createContext(Yr),Jr=o.createContext(Oi);function ji(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function Bi(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new dn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Vi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Fn(i),d=Fn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Bn(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:f,node:g}=m;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const R of[f.current,g.current]){if(!R)continue;const h=di(R);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function Qr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Pn=o.createContext({...Rt,scaleX:1,scaleY:1});var Et;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Et||(Et={}));const Pi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:f,sensors:g=Ni,collisionDetection:R=bi,measuring:h,modifiers:p,...T}=e;const q=o.useReducer(Bi,void 0,ji),[D,z]=q,[W,K]=function(){const[v]=o.useState(()=>new Set),U=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:le}=Z;v.forEach(ie=>{var se;return(se=ie[ee])==null?void 0:se.call(ie,le)})},[v]),U]}(),[w,j]=o.useState(Et.Uninitialized),S=w===Et.Initialized,{draggable:{active:b,nodes:M,translate:B},droppable:{containers:F}}=D,A=b!=null?M.get(b):null,_=o.useRef({initial:null,translated:null}),G=o.useMemo(()=>{var v;return b!=null?{id:b,data:(v=A?.data)!=null?v:Li,rect:_}:null},[b,A]),P=o.useRef(null),[V,$]=o.useState(null),[te,N]=o.useState(null),x=un(T,Object.values(T)),H=fn("DndDescribedBy",l),ne=o.useMemo(()=>F.getEnabled(),[F]),be=(oe=h,o.useMemo(()=>({draggable:{...Tn.draggable,...oe?.draggable},droppable:{...Tn.droppable,...oe?.droppable},dragOverlay:{...Tn.dragOverlay,...oe?.dragOverlay}}),[oe?.draggable,oe?.droppable,oe?.dragOverlay]));var oe;const{droppableRects:X,measureDroppableContainers:ae,measuringScheduled:Me}=function(v,U){let{dragging:Z,dependencies:ee,config:le}=U;const[ie,se]=o.useState(null),{frequency:Ce,measure:he,strategy:me}=le,xe=o.useRef(v),Le=function(){switch(me){case hn.Always:return!1;case hn.BeforeDragging:return Z;default:return!Z}}(),ze=un(Le),We=o.useCallback(function(_e){_e===void 0&&(_e=[]),ze.current||se(lt=>lt===null?_e:lt.concat(_e.filter(it=>!lt.includes(it))))},[ze]),je=o.useRef(null),Re=ln(_e=>{if(Le&&!Z)return nr;if(!_e||_e===nr||xe.current!==v||ie!=null){const lt=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){lt.set(it.id,it.rect.current);continue}const pt=it.node.current,wt=pt?new uo(he(pt),pt):null;it.rect.current=wt,wt&<.set(it.id,wt)}return lt}return _e},[v,ie,Z,Le,he]);return o.useEffect(()=>{xe.current=v},[v]),o.useEffect(()=>{Le||We()},[Z,Le]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Le||typeof Ce!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},Ce))},[Ce,Le,We,...ee]),{droppableRects:Re,measureDroppableContainers:We,measuringScheduled:ie!=null}}(ne,{dragging:S,dependencies:[B.x,B.y],config:be.droppable}),Te=function(v,U){const Z=U!=null?v.get(U):void 0,ee=Z?Z.node.current:null;return ln(le=>{var ie;return U==null?null:(ie=ee??le)!=null?ie:null},[ee,U])}(M,b),fe=o.useMemo(()=>te?An(te):null,[te]),Be=function(){const v=V?.autoScrollEnabled===!1,U=typeof m=="object"?m.enabled===!1:m===!1,Z=S&&!v&&!U;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}}(),pe=function(v,U){return mo(v,U)}(Te,be.draggable.measure);(function(v){let{activeNode:U,measure:Z,initialRect:ee,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:Ce}=typeof le=="boolean"?{x:le,y:le}:le;St(()=>{if(!se&&!Ce||!U)return void(ie.current=!1);if(ie.current||!ee)return;const he=U?.node.current;if(!he||he.isConnected===!1)return;const me=Yo(Z(he),ee);if(se||(me.x=0),Ce||(me.y=0),ie.current=!0,Math.abs(me.x)>0||Math.abs(me.y)>0){const xe=Br(he);xe&&xe.scrollBy({top:me.y,left:me.x})}},[U,se,Ce,ee,Z])})({activeNode:b!=null?M.get(b):null,config:Be.layoutShiftCompensation,initialRect:pe,measure:be.draggable.measure});const Pe=or(Te,be.draggable.measure,pe),Se=or(Te?Te.parentElement:null),ge=o.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=F.getNodeFor((t=ge.current.over)==null?void 0:t.id),we=function(v){let{measure:U}=v;const[Z,ee]=o.useState(null),le=Nn({callback:o.useCallback(he=>{for(const{target:me}of he)if(mn(me)){ee(xe=>{const Le=U(me);return xe?{...xe,width:Le.width,height:Le.height}:Le});break}},[U])}),ie=o.useCallback(he=>{const me=Xr(he);le?.disconnect(),me&&le?.observe(me),ee(me?U(me):null)},[U,le]),[se,Ce]=En(ie);return o.useMemo(()=>({nodeRef:se,rect:Z,setRef:Ce}),[Z,se,Ce])}({measure:be.dragOverlay.measure}),de=(n=we.nodeRef.current)!=null?n:Te,ye=S?(i=we.rect)!=null?i:Pe:null,Ae=!!(we.nodeRef.current&&we.rect),ve=Yo(Fe=Ae?null:Pe,mo(Fe));var Fe;const Oe=ir(de?ft(de):null),He=function(v){const U=o.useRef(v),Z=ln(ee=>v?ee&&ee!==rr&&v&&U.current&&v.parentNode===U.current.parentNode?ee:Vn(v):rr,[v]);return o.useEffect(()=>{U.current=v},[v]),Z}(S?ce??Te:null),C=function(v,U){U===void 0&&(U=_t);const[Z]=v,ee=ir(Z?ft(Z):null),[le,ie]=o.useState(ar);function se(){ie(()=>v.length?v.map(he=>Hr(he)?ee:new uo(U(he),he)):ar)}const Ce=Nn({callback:se});return St(()=>{Ce?.disconnect(),se(),v.forEach(he=>Ce?.observe(he))},[v]),le}(He),Ue=Qr(p,{transform:{x:B.x-ve.x,y:B.y-ve.y,scaleX:1,scaleY:1},activatorEvent:te,active:G,activeNodeRect:Pe,containerNodeRect:Se,draggingNodeRect:ye,over:ge.current.over,overlayNodeRect:we.rect,scrollableAncestors:He,scrollableAncestorRects:C,windowRect:Oe}),Je=fe?Kt(fe,B):null,$e=function(v){const[U,Z]=o.useState(null),ee=o.useRef(v),le=o.useCallback(ie=>{const se=oo(ie.target);se&&Z(Ce=>Ce?(Ce.set(se,co(se)),new Map(Ce)):null)},[]);return o.useEffect(()=>{const ie=ee.current;if(v!==ie){se(ie);const Ce=v.map(he=>{const me=oo(he);return me?(me.addEventListener("scroll",le,{passive:!0}),[me,co(me)]):null}).filter(he=>he!=null);Z(Ce.length?new Map(Ce):null),ee.current=v}return()=>{se(v),se(ie)};function se(Ce){Ce.forEach(he=>{const me=oo(he);me?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?U?Array.from(U.values()).reduce((ie,se)=>Kt(ie,se),Rt):Kr(v):Rt,[v,U])}(He),J=lr($e),Ee=lr($e,[Pe]),Ve=Kt(Ue,J),Ie=ye?xi(ye,Ue):null,Ne=G&&Ie?R({active:G,collisionRect:Ie,droppableRects:X,droppableContainers:ne,pointerCoordinates:Je}):null,De=Or(Ne,"id"),[k,re]=o.useState(null),O=function(v,U,Z){return{...v,scaleX:U&&Z?U.width/Z.width:1,scaleY:U&&Z?U.height/Z.height:1}}(Ae?Ue:Kt(Ue,Ee),(a=k?.rect)!=null?a:null,Pe),Y=o.useRef(null),u=o.useCallback((v,U)=>{let{sensor:Z,options:ee}=U;if(P.current==null)return;const le=M.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new Z({active:P.current,activeNode:le,event:ie,options:ee,context:ge,onAbort(he){if(!M.get(he))return;const{onDragAbort:me}=x.current,xe={id:he};me?.(xe),W({type:"onDragAbort",event:xe})},onPending(he,me,xe,Le){if(!M.get(he))return;const{onDragPending:ze}=x.current,We={id:he,constraint:me,initialCoordinates:xe,offset:Le};ze?.(We),W({type:"onDragPending",event:We})},onStart(he){const me=P.current;if(me==null)return;const xe=M.get(me);if(!xe)return;const{onDragStart:Le}=x.current,ze={activatorEvent:ie,active:{id:me,data:xe.data,rect:_}};Dt.unstable_batchedUpdates(()=>{Le?.(ze),j(Et.Initializing),z({type:ct.DragStart,initialCoordinates:he,active:me}),W({type:"onDragStart",event:ze}),$(Y.current),N(ie)})},onMove(he){z({type:ct.DragMove,coordinates:he})},onEnd:Ce(ct.DragEnd),onCancel:Ce(ct.DragCancel)});function Ce(he){return async function(){const{active:me,collisions:xe,over:Le,scrollAdjustedTranslate:ze}=ge.current;let We=null;if(me&&ze){const{cancelDrop:je}=x.current;We={activatorEvent:ie,active:me,collisions:xe,delta:ze,over:Le},he===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(he=ct.DragCancel)}P.current=null,Dt.unstable_batchedUpdates(()=>{z({type:he}),j(Et.Uninitialized),re(null),$(null),N(null),Y.current=null;const je=he===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Re=x.current[je];Re?.(We),W({type:je,event:We})}})}}Y.current=se},[M]),I=o.useCallback((v,U)=>(Z,ee)=>{const le=Z.nativeEvent,ie=M.get(ee);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(Z,U.options,se)===!0&&(le.dndKit={capturedBy:U.sensor},P.current=ee,u(Z,U))},[M,u]),E=function(v,U){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:le}=ee;return[...Z,...le.activators.map(ie=>({eventName:ie.eventName,handler:U(ie.handler,ee)}))]},[]),[v,U])}(g,I);(function(v){o.useEffect(()=>{if(!On)return;const U=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of U)Z?.()}},v.map(U=>{let{sensor:Z}=U;return Z}))})(g),St(()=>{Pe&&w===Et.Initializing&&j(Et.Initialized)},[Pe,w]),o.useEffect(()=>{const{onDragMove:v}=x.current,{active:U,activatorEvent:Z,collisions:ee,over:le}=ge.current;if(!U||!Z)return;const ie={active:U,activatorEvent:Z,collisions:ee,delta:{x:Ve.x,y:Ve.y},over:le};Dt.unstable_batchedUpdates(()=>{v?.(ie),W({type:"onDragMove",event:ie})})},[Ve.x,Ve.y]),o.useEffect(()=>{const{active:v,activatorEvent:U,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:le}=ge.current;if(!v||P.current==null||!U||!le)return;const{onDragOver:ie}=x.current,se=ee.get(De),Ce=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,he={active:v,activatorEvent:U,collisions:Z,delta:{x:le.x,y:le.y},over:Ce};Dt.unstable_batchedUpdates(()=>{re(Ce),ie?.(he),W({type:"onDragOver",event:he})})},[De]),St(()=>{ge.current={activatorEvent:te,active:G,activeNode:Te,collisionRect:Ie,collisions:Ne,droppableRects:X,draggableNodes:M,draggingNode:de,draggingNodeRect:ye,droppableContainers:F,over:k,scrollableAncestors:He,scrollAdjustedTranslate:Ve},_.current={initial:ye,translated:Ie}},[G,Te,Ne,Ie,M,de,ye,X,F,k,He,Ve]),Ai({...Be,delta:B,draggingRect:Ie,pointerCoordinates:Je,scrollableAncestors:He,scrollableAncestorRects:C});const y=o.useMemo(()=>({active:G,activeNode:Te,activeNodeRect:Pe,activatorEvent:te,collisions:Ne,containerNodeRect:Se,dragOverlay:we,draggableNodes:M,droppableContainers:F,droppableRects:X,over:k,measureDroppableContainers:ae,scrollableAncestors:He,scrollableAncestorRects:C,measuringConfiguration:be,measuringScheduled:Me,windowRect:Oe}),[G,Te,Pe,te,Ne,Se,we,M,F,X,k,ae,He,C,be,Me,Oe]),L=o.useMemo(()=>({activatorEvent:te,activators:E,active:G,activeNodeRect:Pe,ariaDescribedById:{draggable:H},dispatch:z,draggableNodes:M,over:k,measureDroppableContainers:ae}),[te,E,G,Pe,z,H,M,k,ae]);return o.createElement(zr.Provider,{value:K},o.createElement(pn.Provider,{value:L},o.createElement(Jr.Provider,{value:y},o.createElement(Pn.Provider,{value:O},f)),o.createElement(Vi,{disabled:d?.restoreFocus===!1})),o.createElement(fi,{...d,hiddenTextDescribedById:H}))}),Hi=o.createContext(null),sr="button";function Ui(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:d,activatorEvent:m,active:f,activeNodeRect:g,ariaDescribedById:R,draggableNodes:h,over:p}=o.useContext(pn),{role:T=sr,roleDescription:q="draggable",tabIndex:D=0}=a??{},z=f?.id===t,W=o.useContext(z?Pn:Hi),[K,w]=En(),[j,S]=En(),b=function(B,F){return o.useMemo(()=>B.reduce((A,_)=>{let{eventName:G,handler:P}=_;return A[G]=V=>{P(V,F)},A},{}),[B,F])}(d,t),M=un(n);return St(()=>(h.set(t,{id:t,key:l,node:K,activatorNode:j,data:M}),()=>{const B=h.get(t);B&&B.key===l&&h.delete(t)}),[h,t]),{active:f,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:T,tabIndex:D,"aria-disabled":i,"aria-pressed":!(!z||T!==sr)||void 0,"aria-roledescription":q,"aria-describedby":R.draggable}),[i,T,D,z,q,R.draggable]),isDragging:z,listeners:i?void 0:b,node:K,over:p,setNodeRef:w,setActivatorNodeRef:S,transform:W}}function el(){return o.useContext(Jr)}const Ki={timeout:25};function $i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Fn(n);return n||i||!m||a(m),St(()=>{if(!l)return;const f=i?.key,g=i?.props.id;f!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Wi={x:0,y:0,scaleX:1,scaleY:1};function Gi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Yr},o.createElement(Pn.Provider,{value:Wi},t))}const _i={position:"fixed",touchAction:"none"},Zi=e=>Bn(e)?"transform 250ms ease":void 0,Xi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:f,transform:g,transition:R=Zi}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},p={..._i,width:m.width,height:m.height,top:m.top,left:m.left,transform:Nt.Transform.toString(h),transformOrigin:a&&i?pi(i,m):void 0,transition:typeof R=="function"?R(i):R,...f};return o.createElement(n,{className:d,style:p,ref:t},l)}),Yi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,f]of Object.entries(l.active))f!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,f));if(l!=null&&l.dragOverlay)for(const[m,f]of Object.entries(l.dragOverlay))f!==void 0&&i.node.style.setProperty(m,f);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,f]of Object.entries(a))n.node.style.setProperty(m,f);d!=null&&d.active&&n.node.classList.remove(d.active)}},tl={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:Yi({styles:{active:{opacity:"0"}}})};function Ji(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return jn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const f=m.node.current;if(!f)return;const g=Xr(d);if(!g)return;const{transform:R}=ft(d).getComputedStyle(d),h=jr(R);if(!h)return;const p=typeof t=="function"?t:function(T){const{duration:q,easing:D,sideEffects:z,keyframes:W}={...tl,...T};return K=>{let{active:w,dragOverlay:j,transform:S,...b}=K;if(!q)return;const M={x:j.rect.left-w.rect.left,y:j.rect.top-w.rect.top},B={scaleX:S.scaleX!==1?w.rect.width*S.scaleX/j.rect.width:1,scaleY:S.scaleY!==1?w.rect.height*S.scaleY/j.rect.height:1},F={x:S.x-M.x,y:S.y-M.y,...B},A=W({...b,active:w,dragOverlay:j,transform:{initial:S,final:F}}),[_]=A,G=A[A.length-1];if(JSON.stringify(_)===JSON.stringify(G))return;const P=z?.({active:w,dragOverlay:j,...b}),V=j.node.animate(A,{duration:q,easing:D,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return $r(f,a.draggable.measure),p({active:{id:l,data:m.data,node:f,rect:a.draggable.measure(f)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let dr=0;function Qi(e){return o.useMemo(()=>{if(e!=null)return dr++,dr},[e])}const ea=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:f,zIndex:g=999}=e;const{activatorEvent:R,active:h,activeNodeRect:p,containerNodeRect:T,draggableNodes:q,droppableContainers:D,dragOverlay:z,over:W,measuringConfiguration:K,scrollableAncestors:w,scrollableAncestorRects:j,windowRect:S}=el(),b=o.useContext(Pn),M=Qi(h?.id),B=Qr(d,{activatorEvent:R,active:h,activeNodeRect:p,containerNodeRect:T,draggingNodeRect:z.rect,over:W,overlayNodeRect:z.rect,scrollableAncestors:w,scrollableAncestorRects:j,transform:b,windowRect:S}),F=mo(p),A=Ji({config:i,draggableNodes:q,droppableContainers:D,measuringConfiguration:K}),_=F?z.setRef:void 0;return o.createElement(Gi,null,o.createElement($i,{animation:A},h&&M?o.createElement(Xi,{key:M,id:h.id,ref:_,as:m,activatorEvent:R,adjustScale:t,className:f,transition:l,rect:F,style:{zIndex:g,...a},transform:B},n):null))});function xo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ta(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Mn(e){return e!==null&&e>=0}const In={scaleX:1,scaleY:1},na=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const f=function(g,R,h){const p=g[R],T=g[R-1],q=g[R+1];return!p||!T&&!q?0:h<R?T?p.left-(T.left+T.width):q.left-(p.left+p.width):q?q.left-(p.left+p.width):p.left-(T.left+T.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...In}:null}return d>a&&d<=l?{x:-m.width-f,y:0,...In}:d<a&&d>=l?{x:m.width+f,y:0,...In}:{x:0,y:0,...In}},qo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=xo(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},nl="Sortable",ol=o.createContext({activeIndex:-1,containerId:nl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qo,disabled:{draggable:!1,droppable:!1}});function oa(e){let{children:t,id:n,items:i,strategy:a=qo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:f,over:g,measureDroppableContainers:R}=el(),h=fn(nl,n),p=m.rect!==null,T=o.useMemo(()=>i.map(b=>typeof b=="object"&&"id"in b?b.id:b),[i]),q=d!=null,D=d?T.indexOf(d.id):-1,z=g?T.indexOf(g.id):-1,W=o.useRef(T),K=!function(b,M){if(b===M)return!0;if(b.length!==M.length)return!1;for(let B=0;B<b.length;B++)if(b[B]!==M[B])return!1;return!0}(T,W.current),w=z!==-1&&D===-1||K,j=function(b){return typeof b=="boolean"?{draggable:b,droppable:b}:b}(l);St(()=>{K&&q&&R(T)},[K,T,q,R]),o.useEffect(()=>{W.current=T},[T]);const S=o.useMemo(()=>({activeIndex:D,containerId:h,disabled:j,disableTransforms:w,items:T,overIndex:z,useDragOverlay:p,sortedRects:ta(T,f),strategy:a}),[D,h,j.draggable,j.droppable,w,T,z,f,p,a]);return o.createElement(ol.Provider,{value:S},t)}const ra=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return xo(n,i,a).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:f,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===f)},ia={duration:200,easing:"ease"},rl="transform",aa=Nt.Transition.toString({property:rl,duration:0,easing:"linear"}),sa={roleDescription:"sortable"};function da(e){let{animateLayoutChanges:t=la,attributes:n,disabled:i,data:a,getNewIndex:l=ra,id:d,strategy:m,resizeObserverConfig:f,transition:g=ia}=e;const{items:R,containerId:h,activeIndex:p,disabled:T,disableTransforms:q,sortedRects:D,overIndex:z,useDragOverlay:W,strategy:K}=o.useContext(ol),w=function(ce,we){var de,ye;return typeof ce=="boolean"?{draggable:ce,droppable:!1}:{draggable:(de=ce?.draggable)!=null?de:we.draggable,droppable:(ye=ce?.droppable)!=null?ye:we.droppable}}(i,T),j=R.indexOf(d),S=o.useMemo(()=>({sortable:{containerId:h,index:j,items:R},...a}),[h,a,j,R]),b=o.useMemo(()=>R.slice(R.indexOf(d)),[R,d]),{rect:M,node:B,isOver:F,setNodeRef:A}=function(ce){let{data:we,disabled:de=!1,id:ye,resizeObserverConfig:Ae}=ce;const ve=fn("Droppable"),{active:Fe,dispatch:Oe,over:He,measureDroppableContainers:C}=o.useContext(pn),Ue=o.useRef({disabled:de}),Je=o.useRef(!1),$e=o.useRef(null),J=o.useRef(null),{disabled:Ee,updateMeasurementsFor:Ve,timeout:Ie}={...Ki,...Ae},Ne=un(Ve??ye),De=Nn({callback:o.useCallback(()=>{Je.current?(J.current!=null&&clearTimeout(J.current),J.current=setTimeout(()=>{C(Array.isArray(Ne.current)?Ne.current:[Ne.current]),J.current=null},Ie)):Je.current=!0},[Ie]),disabled:Ee||!Fe}),k=o.useCallback((u,I)=>{De&&(I&&(De.unobserve(I),Je.current=!1),u&&De.observe(u))},[De]),[re,O]=En(k),Y=un(we);return o.useEffect(()=>{De&&re.current&&(De.disconnect(),Je.current=!1,De.observe(re.current))},[re,De]),o.useEffect(()=>(Oe({type:ct.RegisterDroppable,element:{id:ye,key:ve,disabled:de,node:re,rect:$e,data:Y}}),()=>Oe({type:ct.UnregisterDroppable,key:ve,id:ye})),[ye]),o.useEffect(()=>{de!==Ue.current.disabled&&(Oe({type:ct.SetDroppableDisabled,id:ye,key:ve,disabled:de}),Ue.current.disabled=de)},[ye,ve,de,Oe]),{active:Fe,rect:$e,isOver:He?.id===ye,node:re,over:He,setNodeRef:O}}({id:d,data:S,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:b,...f}}),{active:_,activatorEvent:G,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:te,isDragging:N,over:x,setActivatorNodeRef:H,transform:ne}=Ui({id:d,data:S,attributes:{...sa,...n},disabled:w.draggable}),be=function(){for(var ce=arguments.length,we=new Array(ce),de=0;de<ce;de++)we[de]=arguments[de];return o.useMemo(()=>ye=>{we.forEach(Ae=>Ae(ye))},we)}(A,$),oe=!!_,X=oe&&!q&&Mn(p)&&Mn(z),ae=!W&&N,Me=ae&&X?ne:null,Te=X?Me??(m??K)({rects:D,activeNodeRect:P,activeIndex:p,overIndex:z,index:j}):null,fe=Mn(p)&&Mn(z)?l({id:d,items:R,activeIndex:p,overIndex:z}):j,Be=_?.id,pe=o.useRef({activeId:Be,items:R,newIndex:fe,containerId:h}),Pe=R!==pe.current.items,Se=t({active:_,containerId:h,isDragging:N,isSorting:oe,id:d,index:j,items:R,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:g,wasDragging:pe.current.activeId!=null}),ge=function(ce){let{disabled:we,index:de,node:ye,rect:Ae}=ce;const[ve,Fe]=o.useState(null),Oe=o.useRef(de);return St(()=>{if(!we&&de!==Oe.current&&ye.current){const He=Ae.current;if(He){const C=_t(ye.current,{ignoreTransform:!0}),Ue={x:He.left-C.left,y:He.top-C.top,scaleX:He.width/C.width,scaleY:He.height/C.height};(Ue.x||Ue.y)&&Fe(Ue)}}de!==Oe.current&&(Oe.current=de)},[we,de,ye,Ae]),o.useEffect(()=>{ve&&Fe(null)},[ve]),ve}({disabled:!Se,index:j,node:B,rect:M});return o.useEffect(()=>{oe&&pe.current.newIndex!==fe&&(pe.current.newIndex=fe),h!==pe.current.containerId&&(pe.current.containerId=h),R!==pe.current.items&&(pe.current.items=R)},[oe,fe,h,R]),o.useEffect(()=>{if(Be===pe.current.activeId)return;if(Be!=null&&pe.current.activeId==null)return void(pe.current.activeId=Be);const ce=setTimeout(()=>{pe.current.activeId=Be},50);return()=>clearTimeout(ce)},[Be]),{active:_,activeIndex:p,attributes:V,data:S,rect:M,index:j,newIndex:fe,items:R,isOver:F,isSorting:oe,isDragging:N,listeners:te,node:B,overIndex:z,over:x,setNodeRef:be,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:$,transform:ge??Te,transition:function(){if(ge||Pe&&pe.current.newIndex===j)return aa;if(!(ae&&!Bn(G)||!g)&&(oe||Se))return Nt.Transition.toString({...g,property:rl})}()}}function Ln(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ca=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],ua=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(ca.includes(e.code)){if(e.preventDefault(),!n||!i)return;const f=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=a.get(h.id);if(p)switch(e.code){case Xe.Down:i.top<p.top&&f.push(h);break;case Xe.Up:i.top>p.top&&f.push(h);break;case Xe.Left:i.left>p.left&&f.push(h);break;case Xe.Right:i.left<p.left&&f.push(h)}});const g=(h=>{let{collisionRect:p,droppableRects:T,droppableContainers:q}=h;const D=Zo(p),z=[];for(const W of q){const{id:K}=W,w=T.get(K);if(w){const j=Zo(w),S=D.reduce((M,B,F)=>M+Nr(j[F],B),0),b=Number((S/4).toFixed(4));z.push({id:K,data:{droppableContainer:W,value:b}})}}return z.sort(Lr)})({collisionRect:i,droppableRects:a,droppableContainers:f});let R=Or(g,"id");if(R===d?.id&&g.length>1&&(R=g[1].id),R!=null){const h=l.get(n.id),p=l.get(R),T=p?a.get(p.id):null,q=p?.node.current;if(q&&T&&h&&p){const D=Vn(q).some((j,S)=>m[S]!==j),z=cr(h,p),W=function(j,S){return!Ln(j)||!Ln(S)||!cr(j,S)?!1:j.data.current.sortable.index<S.data.current.sortable.index}(h,p),K=D||!z?{x:0,y:0}:{x:W?i.width-T.width:0,y:W?i.height-T.height:0},w={x:T.left,y:T.top};return K.x&&K.y?w:gn(w,K)}}}};function cr(e,t){return!(!Ln(e)||!Ln(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ga=e=>{let{transform:t}=e;return{...t,y:0}},ll=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:f,background:g,activeColor:R,borderColor:h,borderWidth:p,dragging:T,...q}=e;return c.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:f===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:f===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:f===l?"0px":"-1px",marginTop:f===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,f===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:f===l&&R?R?.toCSS():"none",minHeight:"2px"}})]})})),qt={Wrapper:"_Wrapper_6tyma_49",fadeIn:"_fadeIn_6tyma_65",dragOverlay:"_dragOverlay_6tyma_73",Item:"_Item_6tyma_93",withHandle:"_withHandle_6tyma_121",dragging:"_dragging_6tyma_131",disabled:"_disabled_6tyma_147"},So=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:f,onRemove:g,renderItem:R,sorting:h,style:p,transition:T,transform:q,value:D,wrapperStyle:z,...W},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=R?R({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:f,ref:K,style:p,transform:q,transition:T,value:D}):c.jsx(c.Fragment,{children:D});return c.jsx("div",{className:yt("tab-item",qt.Wrapper,a&&qt.fadeIn,h&&qt.sorting,t&&qt.dragOverlay),style:{...z,transition:[T,z?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:K,children:c.jsx("div",{className:yt(qt.Item,n&&qt.dragging,l&&qt.withHandle,t&&qt.dragOverlay,i&&qt.disabled,e&&qt.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:f,...W,tabIndex:l?void 0:-1,children:w})})})),ur={Row:"_Row_11qr0_1"},il=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:yt(ur.Row,t&&ur.horizontal),children:e}))),ha={...tl},ma=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=Ci,coordinateGetter:m=ua,dropAnimation:f=ha,getItemStyles:g=()=>({}),getNewIndex:R,handle:h=!1,items:p,onMove:T,isDisabled:q=()=>!1,measuring:D,modifiers:z,renderItem:W,renderDivider:K,reorderItems:w=xo,strategy:j=qo,style:S,useDragOverlay:b=!0,onDragStart:M,wrapperStyle:B=()=>({})}=e,[F,A]=o.useState(()=>p);o.useEffect(()=>{A(p)},[p]);const[_,G]=o.useState(null),P=function(){for(var x=arguments.length,H=new Array(x),ne=0;ne<x;ne++)H[ne]=arguments[ne];return o.useMemo(()=>[...H].filter(be=>be!=null),[...H])}(no(_r,{activationConstraint:i}),no(Zr,{activationConstraint:i}),no(bo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=F.indexOf.bind(F),$=_?V(_):-1,te=[];F.map((x,H)=>{te.push(c.jsx(fa,{id:x,handle:h,index:H,style:g,wrapperStyle:B,disabled:q(x),renderItem:W,animateLayoutChanges:a,useDragOverlay:b,getNewIndex:R},x+"-"+H));const ne=K?.({key:"divider-"+H});ne&&te.push(ne)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Pi,{sensors:P,collisionDetection:d,onDragStart:x=>{const{active:H}=x;H&&(M?.(x),G(H.id))},autoScroll:{canScroll:x=>!0},onDragEnd:x=>{if(G(null),x.over){const H=V(x.over.id);$!==H&&(A(ne=>w(ne,$,H)),T?.($,H))}},onDragCancel:()=>{G(null)},measuring:D,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...S},className:yt(n,qt.Wrapper),children:c.jsx(oa,{items:F,strategy:j,children:c.jsx(il,{ref:t,children:te})})}),b?Dt.createPortal(c.jsx(ea,{adjustScale:l,dropAnimation:f,children:_?c.jsx(So,{value:F[$],handle:h,renderItem:W,wrapperStyle:B({index:$,isDragging:!0,id:F[$]}),index:$,dragging:!0,style:g({id:F[$],index:$,isSorting:_!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function fa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:f,useDragOverlay:g,wrapperStyle:R}){const{attributes:h,isDragging:p,isSorting:T,listeners:q,overIndex:D,setNodeRef:z,transform:W,transition:K}=da({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(So,{ref:z,value:a,disabled:e,dragging:p,sorting:T,handle:i,renderItem:f,index:l,style:m({index:l,id:a,isDragging:p,isSorting:T,overIndex:D}),onRemove:d?()=>d(a):void 0,transform:W,transition:K,wrapperStyle:R({index:l,isDragging:p,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!g&&p,...h})}const pa="_TabStrip_nciwy_1",va=new s.Color("rgb(33, 115, 70)"),Ca="#eee",ya=e=>c.jsx(ll,{...e}),al=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:f,onTabMove:g,createScrollStartButton:R=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:p=r.defaultCreateScrollEdgeButton,createTabButton:T=ya,createTabDivider:q,editLabelProps:D,disabled:z=!1,disableDrag:W=!1,background:K="white",activeColor:w=va,borderColor:j=Ca,borderWidth:S=1}=e,[b,M]=o.useState(l),[B,F]=o.useState(d),A=o.useCallback(ve=>{const Fe=N.current?.[ve]?.closest(".tab-item")??N.current?.[ve];Fe&&ae.current?.scrollTo({top:Fe.offsetTop,left:Fe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{A(l)},[l]);const _=o.useCallback((ve,Fe)=>{Fe!==b&&(M(Fe),m?.(Fe)),A(Fe)},[m,b]),G=o.useCallback((ve,Fe)=>{g?.(ve,Fe)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),te=o.useCallback((ve,Fe)=>{f?.(ve,Fe)},[f]);o.useLayoutEffect(()=>{M(l)},[l]),o.useLayoutEffect(()=>{F(d)},[d]);const N=o.useRef([]),x=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ve){N.current?.[ve]?.startEdit()},cancel(ve){N.current?.[ve]?.cancel()}},x.current),[b,V]);const H=o.useCallback(({value:ve,index:Fe,dragging:Oe})=>{const{style:He,maxLength:C,...Ue}=D||{},Je=c.jsx(Fr,{ref:$e=>{N.current[Fe]=$e},value:ve,disabled:z,maxLength:C,style:{color:b===Fe&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...He},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),te(Fe,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Fe)},...Ue});return T({onClick:$e=>_($e,Fe),value:ve,index:Fe,editing:V===Fe&&P.current,editable:!0,disabled:z,selectedIndex:b,background:K,activeColor:w,borderColor:j,borderWidth:S,dragging:Oe,children:Je})},[b,te,_,D,z,V,T]),[ne,{width:be}]=zt(),[oe,{width:X}]=zt(),ae=o.useRef(null),[Me,Te]=o.useState({left:0,top:0,width:0,height:0}),[fe,Be]=o.useState(null);o.useEffect(()=>{fe!==null&&ae.current&&ae.current.scrollTo({left:fe,behavior:"smooth"})},[fe]);const pe=o.useCallback((ve,Fe=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;return C=Fe?0:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!0,Math.max(0,ve-200)),Be(C),Math.max(0,C)},[]),Pe=o.useCallback((ve,Fe=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(X-be);return C=Fe?Ue:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!1,Math.max(0,ve+200)),Be(C),Math.min(Ue,C)},[X,be]),Se=o.useRef(null),ge=o.useRef(null),ce=o.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Se.current=null)},[]),we=o.useCallback((ve,Fe,Oe=260)=>{Se.current=ve,ge.current=setTimeout(()=>{const He=Fe?pe(Se.current||ve):Pe(Se.current||ve);He!==Se.current?we(He,Fe,120):ce()},Oe)},[pe,Pe,ce]);o.useEffect(()=>()=>ce(),[ce]);const de=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Me.left)<=0||Math.floor(X-be)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!0),onClick:ve=>pe(Math.min(ae.current.scrollLeft,fe??Number.MAX_SAFE_INTEGER),ve.ctrlKey)}),[Me,fe,X,be]),ye=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-be)<=Math.ceil(Me.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!1),onClick:ve=>Pe(Math.max(ae.current.scrollLeft,fe??0),ve.ctrlKey)}),[Me,fe,X,be]),Ae=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,p?.(de)]}),[de,ye,R,h,n,p]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(pa,a),ref:x,children:[c.jsx("div",{style:{borderTop:`solid ${j} ${S}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Ae}),c.jsx("div",{className:"Tabs",ref:ne,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:ve=>{Te({left:ve.target.scrollLeft,top:ve.target.scrollTop,width:ve.target.scrollWidth,height:ve.target.scrollHeight})},children:c.jsx(ma,{isDisabled:ve=>z||W,items:B,strategy:na,modifiers:[ga],ref:oe,renderItem:H,renderDivider:q,onMove:G,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(ye)})]})}));al.displayName="TabStrip";const io=o.createContext(null),ba="_script-editor_faoxm_9",wa=o.lazy(()=>Promise.resolve().then(()=>require("./Ctu5S2g3fltghqia.cjs"))),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"},gr=`
|
|
27
|
+
`},mi={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function fi(e){let{announcements:t=mi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=hi}=e;const{announce:l,announcement:d}=function(){const[h,p]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&p(T)},[]),announcement:h}}(),m=fn("DndLiveRegion"),[f,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const p=o.useContext(zr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(h)},[h,p])}(o.useMemo(()=>({onDragStart(h){let{active:p}=h;l(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:T}=h;t.onDragMove&&l(t.onDragMove({active:p,over:T}))},onDragOver(h){let{active:p,over:T}=h;l(t.onDragOver({active:p,over:T}))},onDragEnd(h){let{active:p,over:T}=h;l(t.onDragEnd({active:p,over:T}))},onDragCancel(h){let{active:p,over:T}=h;l(t.onDragCancel({active:p,over:T}))}}),[l,t])),!f)return null;const R=o.createElement(o.Fragment,null,o.createElement(ui,{id:i,value:a.draggable}),o.createElement(gi,{id:m,announcement:d}));return n?Dt.createPortal(R,n):R}var ct;function Dn(){}function no(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ct||(ct={}));const Rt=Object.freeze({x:0,y:0});function Nr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pi(e,t){const n=An(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Lr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function vi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Zo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Or(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Xo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ci=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Xo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,f=n.get(m);if(f){const g=Nr(Xo(f),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(Lr)};function yi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const f=t.width*t.height,g=e.width*e.height,R=d*m;return Number((R/(f+g-R)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const f=yi(m,t);f>0&&a.push({id:d,data:{droppableContainer:l,value:f}})}}return a.sort(vi)};function Yo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function wi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const xi=wi(1);function jr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const qi={ignoreTransform:!1};function _t(e,t){t===void 0&&(t=qi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:R}=ft(e).getComputedStyle(e);g&&(n=function(h,p,T){const q=jr(p);if(!q)return h;const{scaleX:D,scaleY:z,x:W,y:K}=q,w=h.left-W-(1-D)*parseFloat(T),j=h.top-K-(1-z)*parseFloat(T.slice(T.indexOf(" ")+1)),S=D?h.width/D:h.width,b=z?h.height/z:h.height;return{width:S,height:b,top:j,right:w+S,bottom:j+b,left:w}}(n,g,R))}const{top:i,left:a,width:l,height:d,bottom:m,right:f}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:f}}function Jo(e){return _t(e,{ignoreTransform:!0})}function Vn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(yo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mn(a)||Ar(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const f=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const R=m[g];return typeof R=="string"&&f.test(R)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function Br(e){const[t]=Vn(e,1);return t??null}function oo(e){return On&&e?Gt(e)?e:Co(e)?yo(e)||e===$t(e).scrollingElement?window:mn(e)?e:null:null:null}function Vr(e){return Gt(e)?e.scrollX:e.scrollLeft}function Pr(e){return Gt(e)?e.scrollY:e.scrollTop}function co(e){return{x:Vr(e),y:Pr(e)}}var ut;function Hr(e){return!(!On||!e)&&e===document.scrollingElement}function Ur(e){const t={x:0,y:0},n=Hr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const Si={x:.2,y:.2};function Ri(e,t,n,i,a){let{top:l,left:d,right:m,bottom:f}=n;i===void 0&&(i=10),a===void 0&&(a=Si);const{isTop:g,isBottom:R,isLeft:h,isRight:p}=Ur(e),T={x:0,y:0},q={x:0,y:0},D=t.height*a.y,z=t.width*a.x;return!g&&l<=t.top+D?(T.y=ut.Backward,q.y=i*Math.abs((t.top+D-l)/D)):!R&&f>=t.bottom-D&&(T.y=ut.Forward,q.y=i*Math.abs((t.bottom-D-f)/D)),!p&&m>=t.right-z?(T.x=ut.Forward,q.x=i*Math.abs((t.right-z-m)/z)):!h&&d<=t.left+z&&(T.x=ut.Backward,q.x=i*Math.abs((t.left+z-d)/z)),{direction:T,speed:q}}function ki(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Kr(e){return e.reduce((t,n)=>Kt(t,co(n)),Rt)}function $r(e,t){if(t===void 0&&(t=_t),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Br(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Vr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Pr(n),0)}]];class uo{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Vn(n),a=Kr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Mi)for(const f of d)Object.defineProperty(this,f,{get:()=>{const g=m(i),R=a[l]-g;return this.rect[f]+R},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function ro(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Xe;function Qo(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"})(xt||(xt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Xe||(Xe={}));const Wr={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},Ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xe.Right:return{...n,x:n.x+25};case Xe.Left:return{...n,x:n.x-25};case Xe.Down:return{...n,y:n.y+25};case Xe.Up:return{...n,y:n.y-25}}};class bo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new an($t(n)),this.windowListeners=new an(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&$r(i),n(Rt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Wr,coordinateGetter:d=Ti,scrollBehavior:m="smooth"}=a,{code:f}=t;if(l.end.includes(f))return void this.handleEnd(t);if(l.cancel.includes(f))return void this.handleCancel(t);const{collisionRect:g}=i.current,R=g?{x:g.left,y:g.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=R);const h=d(t,{active:n,context:i.current,currentCoordinates:R});if(h){const p=gn(h,R),T={x:0,y:0},{scrollableAncestors:q}=i.current;for(const D of q){const z=t.code,{isTop:W,isRight:K,isLeft:w,isBottom:j,maxScroll:S,minScroll:b}=Ur(D),M=ki(D),B={x:Math.min(z===Xe.Right?M.right-M.width/2:M.right,Math.max(z===Xe.Right?M.left:M.left+M.width/2,h.x)),y:Math.min(z===Xe.Down?M.bottom-M.height/2:M.bottom,Math.max(z===Xe.Down?M.top:M.top+M.height/2,h.y))},F=z===Xe.Right&&!K||z===Xe.Left&&!w,A=z===Xe.Down&&!j||z===Xe.Up&&!W;if(F&&B.x!==h.x){const _=D.scrollLeft+p.x,G=z===Xe.Right&&_<=S.x||z===Xe.Left&&_>=b.x;if(G&&!p.y)return void D.scrollTo({left:_,behavior:m});T.x=G?D.scrollLeft-_:z===Xe.Right?D.scrollLeft-S.x:D.scrollLeft-b.x,T.x&&D.scrollBy({left:-T.x,behavior:m});break}if(A&&B.y!==h.y){const _=D.scrollTop+p.y,G=z===Xe.Down&&_<=S.y||z===Xe.Up&&_>=b.y;if(G&&!p.x)return void D.scrollTo({top:_,behavior:m});T.y=G?D.scrollTop-_:z===Xe.Down?D.scrollTop-S.y:D.scrollTop-b.y,T.y&&D.scrollBy({top:-T.y,behavior:m});break}}this.handleMove(t,Kt(gn(h,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function er(e){return!!(e&&"distance"in e)}function tr(e){return!!(e&&"delay"in e)}bo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Wr,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class wo{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:f}=ft(m);return m instanceof f?m:$t(m)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=$t(d),this.documentListeners=new an(this.document),this.listeners=new an(i),this.windowListeners=new an(ft(d)),this.initialCoordinates=(a=An(l))!=null?a:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,Qo),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,Qo),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(er(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Ii,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const f=(n=An(t))!=null?n:Rt,g=gn(a,f);if(!i&&m){if(er(m)){if(m.tolerance!=null&&ro(g,m.tolerance))return this.handleCancel();if(ro(g,m.distance))return this.handleStart()}return tr(m)&&ro(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(f)}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===Xe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ei={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Gr extends wo{constructor(t){const{event:n}=t,i=$t(n.target);super(t,Ei,i)}}Gr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Fi={move:{name:"mousemove"},end:{name:"mouseup"}};var go;(function(e){e[e.RightClick=2]="RightClick"})(go||(go={}));class _r extends wo{constructor(t){super(t,Fi,$t(t.event.target))}}_r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==go.RightClick&&(i?.({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Zr extends wo{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}var sn,zn;function Ai(e){let{acceleration:t,activator:n=sn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=zn.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:R,delta:h,threshold:p}=e;const T=function(b){let{delta:M,disabled:B}=b;const F=Fn(M);return ln(A=>{if(B||!F||!A)return Di;const _={x:Math.sign(M.x-F.x),y:Math.sign(M.y-F.y)};return{x:{[ut.Backward]:A.x[ut.Backward]||_.x===-1,[ut.Forward]:A.x[ut.Forward]||_.x===1},y:{[ut.Backward]:A.y[ut.Backward]||_.y===-1,[ut.Forward]:A.y[ut.Forward]||_.y===1}}},[B,M,F])}({delta:h,disabled:!l}),[q,D]=function(){const b=o.useRef(null);return[o.useCallback((M,B)=>{b.current=setInterval(M,B)},[]),o.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[])]}(),z=o.useRef({x:0,y:0}),W=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case sn.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case sn.DraggableRect:return a}},[n,a,f]),w=o.useRef(null),j=o.useCallback(()=>{const b=w.current;if(!b)return;const M=z.current.x*W.current.x,B=z.current.y*W.current.y;b.scrollBy(M,B)},[]),S=o.useMemo(()=>m===zn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&K){for(const b of S){if(i?.(b)===!1)continue;const M=g.indexOf(b),B=R[M];if(!B)continue;const{direction:F,speed:A}=Ri(b,B,K,t,p);for(const _ of["x","y"])T[_][F[_]]||(A[_]=0,F[_]=0);if(A.x>0||A.y>0)return D(),w.current=b,q(j,d),z.current=A,void(W.current=F)}z.current={x:0,y:0},W.current={x:0,y:0},D()}else D()},[t,j,i,D,l,d,JSON.stringify(K),JSON.stringify(T),q,g,S,R,JSON.stringify(p)])}Zr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(sn||(sn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zn||(zn={}));const Di={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var hn,ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),function(e){e.Optimized="optimized"}(ho||(ho={}));const nr=new Map;function mo(e,t){return ln(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=jn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function zi(e){return new uo(_t(e),e)}function or(e,t,n){t===void 0&&(t=zi);const[i,a]=o.useState(null);function l(){a(f=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=f??n)!=null?g:null;const R=t(e);return JSON.stringify(f)===JSON.stringify(R)?f:R})}const d=function(f){let{callback:g,disabled:R}=f;const h=jn(g),p=o.useMemo(()=>{if(R||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(h)},[h,R]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p}({callback(f){if(e)for(const g of f){const{type:R,target:h}=g;if(R==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Nn({callback:l});return St(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const rr=[];function lr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Rt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Rt}function ir(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const ar=[];function Xr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const Ni=[{sensor:Gr,options:{}},{sensor:bo,options:{}}],Li={current:{}},Tn={draggable:{measure:Jo},droppable:{measure:Jo,strategy:hn.WhileDragging,frequency:ho.Optimized},dragOverlay:{measure:_t}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const 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:Dn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Tn,measureDroppableContainers:Dn,windowRect:null,measuringScheduled:!1},Yr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dn,draggableNodes:new Map,over:null,measureDroppableContainers:Dn},pn=o.createContext(Yr),Jr=o.createContext(Oi);function ji(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function Bi(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new dn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Vi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Fn(i),d=Fn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Bn(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:f,node:g}=m;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const R of[f.current,g.current]){if(!R)continue;const h=di(R);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function Qr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Pn=o.createContext({...Rt,scaleX:1,scaleY:1});var Et;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Et||(Et={}));const Pi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:f,sensors:g=Ni,collisionDetection:R=bi,measuring:h,modifiers:p,...T}=e;const q=o.useReducer(Bi,void 0,ji),[D,z]=q,[W,K]=function(){const[v]=o.useState(()=>new Set),U=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:le}=Z;v.forEach(ie=>{var se;return(se=ie[ee])==null?void 0:se.call(ie,le)})},[v]),U]}(),[w,j]=o.useState(Et.Uninitialized),S=w===Et.Initialized,{draggable:{active:b,nodes:M,translate:B},droppable:{containers:F}}=D,A=b!=null?M.get(b):null,_=o.useRef({initial:null,translated:null}),G=o.useMemo(()=>{var v;return b!=null?{id:b,data:(v=A?.data)!=null?v:Li,rect:_}:null},[b,A]),P=o.useRef(null),[V,$]=o.useState(null),[te,N]=o.useState(null),x=un(T,Object.values(T)),H=fn("DndDescribedBy",l),ne=o.useMemo(()=>F.getEnabled(),[F]),be=(oe=h,o.useMemo(()=>({draggable:{...Tn.draggable,...oe?.draggable},droppable:{...Tn.droppable,...oe?.droppable},dragOverlay:{...Tn.dragOverlay,...oe?.dragOverlay}}),[oe?.draggable,oe?.droppable,oe?.dragOverlay]));var oe;const{droppableRects:X,measureDroppableContainers:ae,measuringScheduled:Me}=function(v,U){let{dragging:Z,dependencies:ee,config:le}=U;const[ie,se]=o.useState(null),{frequency:Ce,measure:he,strategy:me}=le,xe=o.useRef(v),Le=function(){switch(me){case hn.Always:return!1;case hn.BeforeDragging:return Z;default:return!Z}}(),ze=un(Le),We=o.useCallback(function(_e){_e===void 0&&(_e=[]),ze.current||se(lt=>lt===null?_e:lt.concat(_e.filter(it=>!lt.includes(it))))},[ze]),je=o.useRef(null),Re=ln(_e=>{if(Le&&!Z)return nr;if(!_e||_e===nr||xe.current!==v||ie!=null){const lt=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){lt.set(it.id,it.rect.current);continue}const pt=it.node.current,wt=pt?new uo(he(pt),pt):null;it.rect.current=wt,wt&<.set(it.id,wt)}return lt}return _e},[v,ie,Z,Le,he]);return o.useEffect(()=>{xe.current=v},[v]),o.useEffect(()=>{Le||We()},[Z,Le]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Le||typeof Ce!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},Ce))},[Ce,Le,We,...ee]),{droppableRects:Re,measureDroppableContainers:We,measuringScheduled:ie!=null}}(ne,{dragging:S,dependencies:[B.x,B.y],config:be.droppable}),Te=function(v,U){const Z=U!=null?v.get(U):void 0,ee=Z?Z.node.current:null;return ln(le=>{var ie;return U==null?null:(ie=ee??le)!=null?ie:null},[ee,U])}(M,b),fe=o.useMemo(()=>te?An(te):null,[te]),Be=function(){const v=V?.autoScrollEnabled===!1,U=typeof m=="object"?m.enabled===!1:m===!1,Z=S&&!v&&!U;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}}(),pe=function(v,U){return mo(v,U)}(Te,be.draggable.measure);(function(v){let{activeNode:U,measure:Z,initialRect:ee,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:Ce}=typeof le=="boolean"?{x:le,y:le}:le;St(()=>{if(!se&&!Ce||!U)return void(ie.current=!1);if(ie.current||!ee)return;const he=U?.node.current;if(!he||he.isConnected===!1)return;const me=Yo(Z(he),ee);if(se||(me.x=0),Ce||(me.y=0),ie.current=!0,Math.abs(me.x)>0||Math.abs(me.y)>0){const xe=Br(he);xe&&xe.scrollBy({top:me.y,left:me.x})}},[U,se,Ce,ee,Z])})({activeNode:b!=null?M.get(b):null,config:Be.layoutShiftCompensation,initialRect:pe,measure:be.draggable.measure});const Pe=or(Te,be.draggable.measure,pe),Se=or(Te?Te.parentElement:null),ge=o.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=F.getNodeFor((t=ge.current.over)==null?void 0:t.id),we=function(v){let{measure:U}=v;const[Z,ee]=o.useState(null),le=Nn({callback:o.useCallback(he=>{for(const{target:me}of he)if(mn(me)){ee(xe=>{const Le=U(me);return xe?{...xe,width:Le.width,height:Le.height}:Le});break}},[U])}),ie=o.useCallback(he=>{const me=Xr(he);le?.disconnect(),me&&le?.observe(me),ee(me?U(me):null)},[U,le]),[se,Ce]=En(ie);return o.useMemo(()=>({nodeRef:se,rect:Z,setRef:Ce}),[Z,se,Ce])}({measure:be.dragOverlay.measure}),de=(n=we.nodeRef.current)!=null?n:Te,ye=S?(i=we.rect)!=null?i:Pe:null,Ae=!!(we.nodeRef.current&&we.rect),ve=Yo(Fe=Ae?null:Pe,mo(Fe));var Fe;const Oe=ir(de?ft(de):null),He=function(v){const U=o.useRef(v),Z=ln(ee=>v?ee&&ee!==rr&&v&&U.current&&v.parentNode===U.current.parentNode?ee:Vn(v):rr,[v]);return o.useEffect(()=>{U.current=v},[v]),Z}(S?ce??Te:null),C=function(v,U){U===void 0&&(U=_t);const[Z]=v,ee=ir(Z?ft(Z):null),[le,ie]=o.useState(ar);function se(){ie(()=>v.length?v.map(he=>Hr(he)?ee:new uo(U(he),he)):ar)}const Ce=Nn({callback:se});return St(()=>{Ce?.disconnect(),se(),v.forEach(he=>Ce?.observe(he))},[v]),le}(He),Ue=Qr(p,{transform:{x:B.x-ve.x,y:B.y-ve.y,scaleX:1,scaleY:1},activatorEvent:te,active:G,activeNodeRect:Pe,containerNodeRect:Se,draggingNodeRect:ye,over:ge.current.over,overlayNodeRect:we.rect,scrollableAncestors:He,scrollableAncestorRects:C,windowRect:Oe}),Je=fe?Kt(fe,B):null,$e=function(v){const[U,Z]=o.useState(null),ee=o.useRef(v),le=o.useCallback(ie=>{const se=oo(ie.target);se&&Z(Ce=>Ce?(Ce.set(se,co(se)),new Map(Ce)):null)},[]);return o.useEffect(()=>{const ie=ee.current;if(v!==ie){se(ie);const Ce=v.map(he=>{const me=oo(he);return me?(me.addEventListener("scroll",le,{passive:!0}),[me,co(me)]):null}).filter(he=>he!=null);Z(Ce.length?new Map(Ce):null),ee.current=v}return()=>{se(v),se(ie)};function se(Ce){Ce.forEach(he=>{const me=oo(he);me?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?U?Array.from(U.values()).reduce((ie,se)=>Kt(ie,se),Rt):Kr(v):Rt,[v,U])}(He),J=lr($e),Ee=lr($e,[Pe]),Ve=Kt(Ue,J),Ie=ye?xi(ye,Ue):null,Ne=G&&Ie?R({active:G,collisionRect:Ie,droppableRects:X,droppableContainers:ne,pointerCoordinates:Je}):null,De=Or(Ne,"id"),[k,re]=o.useState(null),O=function(v,U,Z){return{...v,scaleX:U&&Z?U.width/Z.width:1,scaleY:U&&Z?U.height/Z.height:1}}(Ae?Ue:Kt(Ue,Ee),(a=k?.rect)!=null?a:null,Pe),Y=o.useRef(null),u=o.useCallback((v,U)=>{let{sensor:Z,options:ee}=U;if(P.current==null)return;const le=M.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new Z({active:P.current,activeNode:le,event:ie,options:ee,context:ge,onAbort(he){if(!M.get(he))return;const{onDragAbort:me}=x.current,xe={id:he};me?.(xe),W({type:"onDragAbort",event:xe})},onPending(he,me,xe,Le){if(!M.get(he))return;const{onDragPending:ze}=x.current,We={id:he,constraint:me,initialCoordinates:xe,offset:Le};ze?.(We),W({type:"onDragPending",event:We})},onStart(he){const me=P.current;if(me==null)return;const xe=M.get(me);if(!xe)return;const{onDragStart:Le}=x.current,ze={activatorEvent:ie,active:{id:me,data:xe.data,rect:_}};Dt.unstable_batchedUpdates(()=>{Le?.(ze),j(Et.Initializing),z({type:ct.DragStart,initialCoordinates:he,active:me}),W({type:"onDragStart",event:ze}),$(Y.current),N(ie)})},onMove(he){z({type:ct.DragMove,coordinates:he})},onEnd:Ce(ct.DragEnd),onCancel:Ce(ct.DragCancel)});function Ce(he){return async function(){const{active:me,collisions:xe,over:Le,scrollAdjustedTranslate:ze}=ge.current;let We=null;if(me&&ze){const{cancelDrop:je}=x.current;We={activatorEvent:ie,active:me,collisions:xe,delta:ze,over:Le},he===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(he=ct.DragCancel)}P.current=null,Dt.unstable_batchedUpdates(()=>{z({type:he}),j(Et.Uninitialized),re(null),$(null),N(null),Y.current=null;const je=he===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Re=x.current[je];Re?.(We),W({type:je,event:We})}})}}Y.current=se},[M]),I=o.useCallback((v,U)=>(Z,ee)=>{const le=Z.nativeEvent,ie=M.get(ee);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(Z,U.options,se)===!0&&(le.dndKit={capturedBy:U.sensor},P.current=ee,u(Z,U))},[M,u]),E=function(v,U){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:le}=ee;return[...Z,...le.activators.map(ie=>({eventName:ie.eventName,handler:U(ie.handler,ee)}))]},[]),[v,U])}(g,I);(function(v){o.useEffect(()=>{if(!On)return;const U=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of U)Z?.()}},v.map(U=>{let{sensor:Z}=U;return Z}))})(g),St(()=>{Pe&&w===Et.Initializing&&j(Et.Initialized)},[Pe,w]),o.useEffect(()=>{const{onDragMove:v}=x.current,{active:U,activatorEvent:Z,collisions:ee,over:le}=ge.current;if(!U||!Z)return;const ie={active:U,activatorEvent:Z,collisions:ee,delta:{x:Ve.x,y:Ve.y},over:le};Dt.unstable_batchedUpdates(()=>{v?.(ie),W({type:"onDragMove",event:ie})})},[Ve.x,Ve.y]),o.useEffect(()=>{const{active:v,activatorEvent:U,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:le}=ge.current;if(!v||P.current==null||!U||!le)return;const{onDragOver:ie}=x.current,se=ee.get(De),Ce=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,he={active:v,activatorEvent:U,collisions:Z,delta:{x:le.x,y:le.y},over:Ce};Dt.unstable_batchedUpdates(()=>{re(Ce),ie?.(he),W({type:"onDragOver",event:he})})},[De]),St(()=>{ge.current={activatorEvent:te,active:G,activeNode:Te,collisionRect:Ie,collisions:Ne,droppableRects:X,draggableNodes:M,draggingNode:de,draggingNodeRect:ye,droppableContainers:F,over:k,scrollableAncestors:He,scrollAdjustedTranslate:Ve},_.current={initial:ye,translated:Ie}},[G,Te,Ne,Ie,M,de,ye,X,F,k,He,Ve]),Ai({...Be,delta:B,draggingRect:Ie,pointerCoordinates:Je,scrollableAncestors:He,scrollableAncestorRects:C});const y=o.useMemo(()=>({active:G,activeNode:Te,activeNodeRect:Pe,activatorEvent:te,collisions:Ne,containerNodeRect:Se,dragOverlay:we,draggableNodes:M,droppableContainers:F,droppableRects:X,over:k,measureDroppableContainers:ae,scrollableAncestors:He,scrollableAncestorRects:C,measuringConfiguration:be,measuringScheduled:Me,windowRect:Oe}),[G,Te,Pe,te,Ne,Se,we,M,F,X,k,ae,He,C,be,Me,Oe]),L=o.useMemo(()=>({activatorEvent:te,activators:E,active:G,activeNodeRect:Pe,ariaDescribedById:{draggable:H},dispatch:z,draggableNodes:M,over:k,measureDroppableContainers:ae}),[te,E,G,Pe,z,H,M,k,ae]);return o.createElement(zr.Provider,{value:K},o.createElement(pn.Provider,{value:L},o.createElement(Jr.Provider,{value:y},o.createElement(Pn.Provider,{value:O},f)),o.createElement(Vi,{disabled:d?.restoreFocus===!1})),o.createElement(fi,{...d,hiddenTextDescribedById:H}))}),Hi=o.createContext(null),sr="button";function Ui(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:d,activatorEvent:m,active:f,activeNodeRect:g,ariaDescribedById:R,draggableNodes:h,over:p}=o.useContext(pn),{role:T=sr,roleDescription:q="draggable",tabIndex:D=0}=a??{},z=f?.id===t,W=o.useContext(z?Pn:Hi),[K,w]=En(),[j,S]=En(),b=function(B,F){return o.useMemo(()=>B.reduce((A,_)=>{let{eventName:G,handler:P}=_;return A[G]=V=>{P(V,F)},A},{}),[B,F])}(d,t),M=un(n);return St(()=>(h.set(t,{id:t,key:l,node:K,activatorNode:j,data:M}),()=>{const B=h.get(t);B&&B.key===l&&h.delete(t)}),[h,t]),{active:f,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:T,tabIndex:D,"aria-disabled":i,"aria-pressed":!(!z||T!==sr)||void 0,"aria-roledescription":q,"aria-describedby":R.draggable}),[i,T,D,z,q,R.draggable]),isDragging:z,listeners:i?void 0:b,node:K,over:p,setNodeRef:w,setActivatorNodeRef:S,transform:W}}function el(){return o.useContext(Jr)}const Ki={timeout:25};function $i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Fn(n);return n||i||!m||a(m),St(()=>{if(!l)return;const f=i?.key,g=i?.props.id;f!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Wi={x:0,y:0,scaleX:1,scaleY:1};function Gi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Yr},o.createElement(Pn.Provider,{value:Wi},t))}const _i={position:"fixed",touchAction:"none"},Zi=e=>Bn(e)?"transform 250ms ease":void 0,Xi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:f,transform:g,transition:R=Zi}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},p={..._i,width:m.width,height:m.height,top:m.top,left:m.left,transform:Nt.Transform.toString(h),transformOrigin:a&&i?pi(i,m):void 0,transition:typeof R=="function"?R(i):R,...f};return o.createElement(n,{className:d,style:p,ref:t},l)}),Yi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,f]of Object.entries(l.active))f!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,f));if(l!=null&&l.dragOverlay)for(const[m,f]of Object.entries(l.dragOverlay))f!==void 0&&i.node.style.setProperty(m,f);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,f]of Object.entries(a))n.node.style.setProperty(m,f);d!=null&&d.active&&n.node.classList.remove(d.active)}},tl={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:Yi({styles:{active:{opacity:"0"}}})};function Ji(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return jn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const f=m.node.current;if(!f)return;const g=Xr(d);if(!g)return;const{transform:R}=ft(d).getComputedStyle(d),h=jr(R);if(!h)return;const p=typeof t=="function"?t:function(T){const{duration:q,easing:D,sideEffects:z,keyframes:W}={...tl,...T};return K=>{let{active:w,dragOverlay:j,transform:S,...b}=K;if(!q)return;const M={x:j.rect.left-w.rect.left,y:j.rect.top-w.rect.top},B={scaleX:S.scaleX!==1?w.rect.width*S.scaleX/j.rect.width:1,scaleY:S.scaleY!==1?w.rect.height*S.scaleY/j.rect.height:1},F={x:S.x-M.x,y:S.y-M.y,...B},A=W({...b,active:w,dragOverlay:j,transform:{initial:S,final:F}}),[_]=A,G=A[A.length-1];if(JSON.stringify(_)===JSON.stringify(G))return;const P=z?.({active:w,dragOverlay:j,...b}),V=j.node.animate(A,{duration:q,easing:D,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return $r(f,a.draggable.measure),p({active:{id:l,data:m.data,node:f,rect:a.draggable.measure(f)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let dr=0;function Qi(e){return o.useMemo(()=>{if(e!=null)return dr++,dr},[e])}const ea=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:f,zIndex:g=999}=e;const{activatorEvent:R,active:h,activeNodeRect:p,containerNodeRect:T,draggableNodes:q,droppableContainers:D,dragOverlay:z,over:W,measuringConfiguration:K,scrollableAncestors:w,scrollableAncestorRects:j,windowRect:S}=el(),b=o.useContext(Pn),M=Qi(h?.id),B=Qr(d,{activatorEvent:R,active:h,activeNodeRect:p,containerNodeRect:T,draggingNodeRect:z.rect,over:W,overlayNodeRect:z.rect,scrollableAncestors:w,scrollableAncestorRects:j,transform:b,windowRect:S}),F=mo(p),A=Ji({config:i,draggableNodes:q,droppableContainers:D,measuringConfiguration:K}),_=F?z.setRef:void 0;return o.createElement(Gi,null,o.createElement($i,{animation:A},h&&M?o.createElement(Xi,{key:M,id:h.id,ref:_,as:m,activatorEvent:R,adjustScale:t,className:f,transition:l,rect:F,style:{zIndex:g,...a},transform:B},n):null))});function xo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ta(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Mn(e){return e!==null&&e>=0}const In={scaleX:1,scaleY:1},na=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const f=function(g,R,h){const p=g[R],T=g[R-1],q=g[R+1];return!p||!T&&!q?0:h<R?T?p.left-(T.left+T.width):q.left-(p.left+p.width):q?q.left-(p.left+p.width):p.left-(T.left+T.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...In}:null}return d>a&&d<=l?{x:-m.width-f,y:0,...In}:d<a&&d>=l?{x:m.width+f,y:0,...In}:{x:0,y:0,...In}},qo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=xo(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},nl="Sortable",ol=o.createContext({activeIndex:-1,containerId:nl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qo,disabled:{draggable:!1,droppable:!1}});function oa(e){let{children:t,id:n,items:i,strategy:a=qo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:f,over:g,measureDroppableContainers:R}=el(),h=fn(nl,n),p=m.rect!==null,T=o.useMemo(()=>i.map(b=>typeof b=="object"&&"id"in b?b.id:b),[i]),q=d!=null,D=d?T.indexOf(d.id):-1,z=g?T.indexOf(g.id):-1,W=o.useRef(T),K=!function(b,M){if(b===M)return!0;if(b.length!==M.length)return!1;for(let B=0;B<b.length;B++)if(b[B]!==M[B])return!1;return!0}(T,W.current),w=z!==-1&&D===-1||K,j=function(b){return typeof b=="boolean"?{draggable:b,droppable:b}:b}(l);St(()=>{K&&q&&R(T)},[K,T,q,R]),o.useEffect(()=>{W.current=T},[T]);const S=o.useMemo(()=>({activeIndex:D,containerId:h,disabled:j,disableTransforms:w,items:T,overIndex:z,useDragOverlay:p,sortedRects:ta(T,f),strategy:a}),[D,h,j.draggable,j.droppable,w,T,z,f,p,a]);return o.createElement(ol.Provider,{value:S},t)}const ra=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return xo(n,i,a).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:f,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===f)},ia={duration:200,easing:"ease"},rl="transform",aa=Nt.Transition.toString({property:rl,duration:0,easing:"linear"}),sa={roleDescription:"sortable"};function da(e){let{animateLayoutChanges:t=la,attributes:n,disabled:i,data:a,getNewIndex:l=ra,id:d,strategy:m,resizeObserverConfig:f,transition:g=ia}=e;const{items:R,containerId:h,activeIndex:p,disabled:T,disableTransforms:q,sortedRects:D,overIndex:z,useDragOverlay:W,strategy:K}=o.useContext(ol),w=function(ce,we){var de,ye;return typeof ce=="boolean"?{draggable:ce,droppable:!1}:{draggable:(de=ce?.draggable)!=null?de:we.draggable,droppable:(ye=ce?.droppable)!=null?ye:we.droppable}}(i,T),j=R.indexOf(d),S=o.useMemo(()=>({sortable:{containerId:h,index:j,items:R},...a}),[h,a,j,R]),b=o.useMemo(()=>R.slice(R.indexOf(d)),[R,d]),{rect:M,node:B,isOver:F,setNodeRef:A}=function(ce){let{data:we,disabled:de=!1,id:ye,resizeObserverConfig:Ae}=ce;const ve=fn("Droppable"),{active:Fe,dispatch:Oe,over:He,measureDroppableContainers:C}=o.useContext(pn),Ue=o.useRef({disabled:de}),Je=o.useRef(!1),$e=o.useRef(null),J=o.useRef(null),{disabled:Ee,updateMeasurementsFor:Ve,timeout:Ie}={...Ki,...Ae},Ne=un(Ve??ye),De=Nn({callback:o.useCallback(()=>{Je.current?(J.current!=null&&clearTimeout(J.current),J.current=setTimeout(()=>{C(Array.isArray(Ne.current)?Ne.current:[Ne.current]),J.current=null},Ie)):Je.current=!0},[Ie]),disabled:Ee||!Fe}),k=o.useCallback((u,I)=>{De&&(I&&(De.unobserve(I),Je.current=!1),u&&De.observe(u))},[De]),[re,O]=En(k),Y=un(we);return o.useEffect(()=>{De&&re.current&&(De.disconnect(),Je.current=!1,De.observe(re.current))},[re,De]),o.useEffect(()=>(Oe({type:ct.RegisterDroppable,element:{id:ye,key:ve,disabled:de,node:re,rect:$e,data:Y}}),()=>Oe({type:ct.UnregisterDroppable,key:ve,id:ye})),[ye]),o.useEffect(()=>{de!==Ue.current.disabled&&(Oe({type:ct.SetDroppableDisabled,id:ye,key:ve,disabled:de}),Ue.current.disabled=de)},[ye,ve,de,Oe]),{active:Fe,rect:$e,isOver:He?.id===ye,node:re,over:He,setNodeRef:O}}({id:d,data:S,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:b,...f}}),{active:_,activatorEvent:G,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:te,isDragging:N,over:x,setActivatorNodeRef:H,transform:ne}=Ui({id:d,data:S,attributes:{...sa,...n},disabled:w.draggable}),be=function(){for(var ce=arguments.length,we=new Array(ce),de=0;de<ce;de++)we[de]=arguments[de];return o.useMemo(()=>ye=>{we.forEach(Ae=>Ae(ye))},we)}(A,$),oe=!!_,X=oe&&!q&&Mn(p)&&Mn(z),ae=!W&&N,Me=ae&&X?ne:null,Te=X?Me??(m??K)({rects:D,activeNodeRect:P,activeIndex:p,overIndex:z,index:j}):null,fe=Mn(p)&&Mn(z)?l({id:d,items:R,activeIndex:p,overIndex:z}):j,Be=_?.id,pe=o.useRef({activeId:Be,items:R,newIndex:fe,containerId:h}),Pe=R!==pe.current.items,Se=t({active:_,containerId:h,isDragging:N,isSorting:oe,id:d,index:j,items:R,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:g,wasDragging:pe.current.activeId!=null}),ge=function(ce){let{disabled:we,index:de,node:ye,rect:Ae}=ce;const[ve,Fe]=o.useState(null),Oe=o.useRef(de);return St(()=>{if(!we&&de!==Oe.current&&ye.current){const He=Ae.current;if(He){const C=_t(ye.current,{ignoreTransform:!0}),Ue={x:He.left-C.left,y:He.top-C.top,scaleX:He.width/C.width,scaleY:He.height/C.height};(Ue.x||Ue.y)&&Fe(Ue)}}de!==Oe.current&&(Oe.current=de)},[we,de,ye,Ae]),o.useEffect(()=>{ve&&Fe(null)},[ve]),ve}({disabled:!Se,index:j,node:B,rect:M});return o.useEffect(()=>{oe&&pe.current.newIndex!==fe&&(pe.current.newIndex=fe),h!==pe.current.containerId&&(pe.current.containerId=h),R!==pe.current.items&&(pe.current.items=R)},[oe,fe,h,R]),o.useEffect(()=>{if(Be===pe.current.activeId)return;if(Be!=null&&pe.current.activeId==null)return void(pe.current.activeId=Be);const ce=setTimeout(()=>{pe.current.activeId=Be},50);return()=>clearTimeout(ce)},[Be]),{active:_,activeIndex:p,attributes:V,data:S,rect:M,index:j,newIndex:fe,items:R,isOver:F,isSorting:oe,isDragging:N,listeners:te,node:B,overIndex:z,over:x,setNodeRef:be,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:$,transform:ge??Te,transition:function(){if(ge||Pe&&pe.current.newIndex===j)return aa;if(!(ae&&!Bn(G)||!g)&&(oe||Se))return Nt.Transition.toString({...g,property:rl})}()}}function Ln(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ca=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],ua=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(ca.includes(e.code)){if(e.preventDefault(),!n||!i)return;const f=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=a.get(h.id);if(p)switch(e.code){case Xe.Down:i.top<p.top&&f.push(h);break;case Xe.Up:i.top>p.top&&f.push(h);break;case Xe.Left:i.left>p.left&&f.push(h);break;case Xe.Right:i.left<p.left&&f.push(h)}});const g=(h=>{let{collisionRect:p,droppableRects:T,droppableContainers:q}=h;const D=Zo(p),z=[];for(const W of q){const{id:K}=W,w=T.get(K);if(w){const j=Zo(w),S=D.reduce((M,B,F)=>M+Nr(j[F],B),0),b=Number((S/4).toFixed(4));z.push({id:K,data:{droppableContainer:W,value:b}})}}return z.sort(Lr)})({collisionRect:i,droppableRects:a,droppableContainers:f});let R=Or(g,"id");if(R===d?.id&&g.length>1&&(R=g[1].id),R!=null){const h=l.get(n.id),p=l.get(R),T=p?a.get(p.id):null,q=p?.node.current;if(q&&T&&h&&p){const D=Vn(q).some((j,S)=>m[S]!==j),z=cr(h,p),W=function(j,S){return!Ln(j)||!Ln(S)||!cr(j,S)?!1:j.data.current.sortable.index<S.data.current.sortable.index}(h,p),K=D||!z?{x:0,y:0}:{x:W?i.width-T.width:0,y:W?i.height-T.height:0},w={x:T.left,y:T.top};return K.x&&K.y?w:gn(w,K)}}}};function cr(e,t){return!(!Ln(e)||!Ln(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ga=e=>{let{transform:t}=e;return{...t,y:0}},ll=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:f,background:g,activeColor:R,borderColor:h,borderWidth:p,dragging:T,...q}=e;return c.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:f===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:f===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:f===l?"0px":"-1px",marginTop:f===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,f===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:f===l&&R?R?.toCSS():"none",minHeight:"2px"}})]})})),qt={Wrapper:"_Wrapper_6tyma_49",fadeIn:"_fadeIn_6tyma_65",dragOverlay:"_dragOverlay_6tyma_73",Item:"_Item_6tyma_93",withHandle:"_withHandle_6tyma_121",dragging:"_dragging_6tyma_131",disabled:"_disabled_6tyma_147"},So=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:f,onRemove:g,renderItem:R,sorting:h,style:p,transition:T,transform:q,value:D,wrapperStyle:z,...W},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=R?R({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:f,ref:K,style:p,transform:q,transition:T,value:D}):c.jsx(c.Fragment,{children:D});return c.jsx("div",{className:yt("tab-item",qt.Wrapper,a&&qt.fadeIn,h&&qt.sorting,t&&qt.dragOverlay),style:{...z,transition:[T,z?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:K,children:c.jsx("div",{className:yt(qt.Item,n&&qt.dragging,l&&qt.withHandle,t&&qt.dragOverlay,i&&qt.disabled,e&&qt.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:f,...W,tabIndex:l?void 0:-1,children:w})})})),ur={Row:"_Row_11qr0_1"},il=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:yt(ur.Row,t&&ur.horizontal),children:e}))),ha={...tl},ma=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=Ci,coordinateGetter:m=ua,dropAnimation:f=ha,getItemStyles:g=()=>({}),getNewIndex:R,handle:h=!1,items:p,onMove:T,isDisabled:q=()=>!1,measuring:D,modifiers:z,renderItem:W,renderDivider:K,reorderItems:w=xo,strategy:j=qo,style:S,useDragOverlay:b=!0,onDragStart:M,wrapperStyle:B=()=>({})}=e,[F,A]=o.useState(()=>p);o.useEffect(()=>{A(p)},[p]);const[_,G]=o.useState(null),P=function(){for(var x=arguments.length,H=new Array(x),ne=0;ne<x;ne++)H[ne]=arguments[ne];return o.useMemo(()=>[...H].filter(be=>be!=null),[...H])}(no(_r,{activationConstraint:i}),no(Zr,{activationConstraint:i}),no(bo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=F.indexOf.bind(F),$=_?V(_):-1,te=[];F.map((x,H)=>{te.push(c.jsx(fa,{id:x,handle:h,index:H,style:g,wrapperStyle:B,disabled:q(x),renderItem:W,animateLayoutChanges:a,useDragOverlay:b,getNewIndex:R},x+"-"+H));const ne=K?.({key:"divider-"+H});ne&&te.push(ne)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Pi,{sensors:P,collisionDetection:d,onDragStart:x=>{const{active:H}=x;H&&(M?.(x),G(H.id))},autoScroll:{canScroll:x=>!0},onDragEnd:x=>{if(G(null),x.over){const H=V(x.over.id);$!==H&&(A(ne=>w(ne,$,H)),T?.($,H))}},onDragCancel:()=>{G(null)},measuring:D,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...S},className:yt(n,qt.Wrapper),children:c.jsx(oa,{items:F,strategy:j,children:c.jsx(il,{ref:t,children:te})})}),b?Dt.createPortal(c.jsx(ea,{adjustScale:l,dropAnimation:f,children:_?c.jsx(So,{value:F[$],handle:h,renderItem:W,wrapperStyle:B({index:$,isDragging:!0,id:F[$]}),index:$,dragging:!0,style:g({id:F[$],index:$,isSorting:_!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function fa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:f,useDragOverlay:g,wrapperStyle:R}){const{attributes:h,isDragging:p,isSorting:T,listeners:q,overIndex:D,setNodeRef:z,transform:W,transition:K}=da({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(So,{ref:z,value:a,disabled:e,dragging:p,sorting:T,handle:i,renderItem:f,index:l,style:m({index:l,id:a,isDragging:p,isSorting:T,overIndex:D}),onRemove:d?()=>d(a):void 0,transform:W,transition:K,wrapperStyle:R({index:l,isDragging:p,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!g&&p,...h})}const pa="_TabStrip_nciwy_1",va=new s.Color("rgb(33, 115, 70)"),Ca="#eee",ya=e=>c.jsx(ll,{...e}),al=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:f,onTabMove:g,createScrollStartButton:R=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:p=r.defaultCreateScrollEdgeButton,createTabButton:T=ya,createTabDivider:q,editLabelProps:D,disabled:z=!1,disableDrag:W=!1,background:K="white",activeColor:w=va,borderColor:j=Ca,borderWidth:S=1}=e,[b,M]=o.useState(l),[B,F]=o.useState(d),A=o.useCallback(ve=>{const Fe=N.current?.[ve]?.closest(".tab-item")??N.current?.[ve];Fe&&ae.current?.scrollTo({top:Fe.offsetTop,left:Fe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{A(l)},[l]);const _=o.useCallback((ve,Fe)=>{Fe!==b&&(M(Fe),m?.(Fe)),A(Fe)},[m,b]),G=o.useCallback((ve,Fe)=>{g?.(ve,Fe)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),te=o.useCallback((ve,Fe)=>{f?.(ve,Fe)},[f]);o.useLayoutEffect(()=>{M(l)},[l]),o.useLayoutEffect(()=>{F(d)},[d]);const N=o.useRef([]),x=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ve){N.current?.[ve]?.startEdit()},cancel(ve){N.current?.[ve]?.cancel()}},x.current),[b,V]);const H=o.useCallback(({value:ve,index:Fe,dragging:Oe})=>{const{style:He,maxLength:C,...Ue}=D||{},Je=c.jsx(Fr,{ref:$e=>{N.current[Fe]=$e},value:ve,disabled:z,maxLength:C,style:{color:b===Fe&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...He},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),te(Fe,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Fe)},...Ue});return T({onClick:$e=>_($e,Fe),value:ve,index:Fe,editing:V===Fe&&P.current,editable:!0,disabled:z,selectedIndex:b,background:K,activeColor:w,borderColor:j,borderWidth:S,dragging:Oe,children:Je})},[b,te,_,D,z,V,T]),[ne,{width:be}]=zt(),[oe,{width:X}]=zt(),ae=o.useRef(null),[Me,Te]=o.useState({left:0,top:0,width:0,height:0}),[fe,Be]=o.useState(null);o.useEffect(()=>{fe!==null&&ae.current&&ae.current.scrollTo({left:fe,behavior:"smooth"})},[fe]);const pe=o.useCallback((ve,Fe=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;return C=Fe?0:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!0,Math.max(0,ve-200)),Be(C),Math.max(0,C)},[]),Pe=o.useCallback((ve,Fe=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(X-be);return C=Fe?Ue:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!1,Math.max(0,ve+200)),Be(C),Math.min(Ue,C)},[X,be]),Se=o.useRef(null),ge=o.useRef(null),ce=o.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Se.current=null)},[]),we=o.useCallback((ve,Fe,Oe=260)=>{Se.current=ve,ge.current=setTimeout(()=>{const He=Fe?pe(Se.current||ve):Pe(Se.current||ve);He!==Se.current?we(He,Fe,120):ce()},Oe)},[pe,Pe,ce]);o.useEffect(()=>()=>ce(),[ce]);const de=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Me.left)<=0||Math.floor(X-be)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!0),onClick:ve=>pe(Math.min(ae.current.scrollLeft,fe??Number.MAX_SAFE_INTEGER),ve.ctrlKey)}),[Me,fe,X,be]),ye=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-be)<=Math.ceil(Me.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!1),onClick:ve=>Pe(Math.max(ae.current.scrollLeft,fe??0),ve.ctrlKey)}),[Me,fe,X,be]),Ae=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,p?.(de)]}),[de,ye,R,h,n,p]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(pa,a),ref:x,children:[c.jsx("div",{style:{borderTop:`solid ${j} ${S}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Ae}),c.jsx("div",{className:"Tabs",ref:ne,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:ve=>{Te({left:ve.target.scrollLeft,top:ve.target.scrollTop,width:ve.target.scrollWidth,height:ve.target.scrollHeight})},children:c.jsx(ma,{isDisabled:ve=>z||W,items:B,strategy:na,modifiers:[ga],ref:oe,renderItem:H,renderDivider:q,onMove:G,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(ye)})]})}));al.displayName="TabStrip";const io=o.createContext(null),ba="_script-editor_faoxm_9",wa=o.lazy(()=>Promise.resolve().then(()=>require("./DKiOfqa5nItDUd8L.cjs"))),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"},gr=`
|
|
28
28
|
/**
|
|
29
29
|
* Placeholder for SheetXL scripting types.
|
|
30
30
|
*/
|
|
@@ -76,7 +76,7 @@ declare module "index" {
|
|
|
76
76
|
|
|
77
77
|
`)||(R+=`
|
|
78
78
|
|
|
79
|
-
`,p=!0));const T=[{range:new t.Range(f.lineNumber,f.column,f.lineNumber,f.column),text:`${R}`}];let q=null;i.pushEditOperations([],T,D=>(q=D[0].range,h&&q.startLineNumber++,p&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function qa(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function fo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:qa(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)fo(e,t,n,l,a);return a}function Ro(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const f=Ro(m,t,n,i);if(f)return f}}return null}}function Sa(e){return e.kind==="comment"}const Ra=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:f,autoFocus:g=!0,onStatusChange:R,...h}=e,p=o.useRef(null),T=r.useCallbackRef(d,[d]),q=o.useRef(!1),D=o.useMemo(()=>({contains(x){if(!p.current)return;const H=p.current.editor;return H&&H.getDomNode()?.contains(x)},focus(){if(!p.current)return;const x=p.current.editor;return x&&x.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",D,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),W=o.useMemo(()=>{let x=null;const H=()=>D;return x=a?a.createChildGroup(H,"scriptEditor",!1):new r.CommandGroup(H,"scriptEditor"),x.addCommands(z,!0),x},[a,z]),K=r.useCommands(W,["executeSelectedScript"])[0],w=K?.context(),j=r.useCallbackRef(x=>{K?.execute(x)},[K]),S=o.useRef(""),[b,M]=o.useState(!1),B=r.useCallbackRef(async()=>{if(!p.current)return null;const x=p.current,H=x.editor;if(!H)return null;const ne=x.monaco,be=await(async(oe,X,ae="export")=>{const Me=oe.getModel();if(!Me)return null;const Te=await X.languages.typescript.getTypeScriptWorker(),fe=await Te(Me.uri),Be=await fe.getNavigationTree(Me.uri.toString());let pe=null,Pe=oe.getSelection();const Se=Pe.startLineNumber===Pe.endLineNumber&&Pe.startColumn===Pe.endColumn?Me.getLineCount():Math.min(Pe.endLineNumber,Me.getLineCount());for(let ge=Pe.startLineNumber;!pe&&ge<=Se;ge++){const ce=Ro(Be,Me.getOffsetAt({lineNumber:ge,column:1}),"function",ae);ce&&(pe=ce.text)}return pe})(H,ne);return R?.({message:(be??"").toUpperCase()}),be?{source:H.getValue(),name:be}:null},[R]),F=r.useCallbackRef(async(x,H,ne)=>{const be=await w.getScripts().createModule({source:ne?.getValue(),declarationsOnly:!0}),oe=be?be.getFunctions().search():ue.CommonUtils.EmptyArray;be&&(async function(X,ae){const Me=[];for(let Te=1;Te<X.getLineCount()+1;Te++){const fe={startLineNumber:Te,startColumn:1,endLineNumber:Te,endColumn:X.getLineLength(Te)+1},Be=X.getValueInRange(fe).indexOf("modelt");Be!==-1&&Me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ae.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Be+1,endLineNumber:fe.startLineNumber,endColumn:Be+5})}ae.editor.setModelMarkers(X,"owner",Me)}(x,H),async function(X,ae,Me,Te){const fe=await ae.languages.typescript.getTypeScriptWorker(),Be=await fe(X.uri),pe=await Be.getNavigationTree(X.uri.toString()),Pe=fo(X,ae,Te,pe).map(Se=>{let ge=null,ce=null;return Se.type==="formula"?(ge="formula.margin-icon",ce="Formula"):Se.type==="macro"?(ge="macro.margin-icon",ce="Macro"):Se.type==="autoRun"&&(ge="autorun.margin-icon",ce="Auto Run"),{range:new ae.Range(Se.lineNumber,1,Se.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:ge,glyphMarginHoverMessage:ce,stickiness:ae.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=Me.createDecorationsCollection(Pe)}(x,H,ne,oe))},[w]),A=r.useCallbackRef(ue.CommonUtils.debounce(F,580),[]),_=r.useCallbackRef(async(x=void 0)=>{if(!p.current||!w)return;const H=p.current.editor.getPosition(),ne={cursor:H?H.toString():""};x!==void 0&&(ne.message=x),R?.(ne);const be=B();w.setSelectedFunction(be)},[w,R]);o.useEffect(()=>{if(!w)return;const x={insertSnippet:ne=>{p.current?.editor&&(b?hr(p.current.editor,p.current.monaco,ne):S.current=ne)}};w.setEditor(x),w.setSelectedFunction(B());const H=w.addContainerListener({onBeforeSave:async()=>{if(!p.current?.editor||!w)return;const ne=p.current.editor,be=w?.getScripts().getModules().getByName("scripting"),oe=be?.getSource(),X=ne.getValue();if(!((oe?.length??0)!==X.length||oe!==X))return;await w.saveSource(ne.getValue());const ae=(oe?.length??0)!==X.length||oe!==X;R?.({dirty:ae})},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!w)return;const ne=p.current.editor,be=w.getScripts().getModules().search()[0]?.getSource()??"";ne.setValue(be)}});return()=>{H(),w.setSelectedFunction(null),w.setEditor(null)}},[w,b]),o.useEffect(()=>()=>{if(!p.current?.editor)return;const x=p.current.editor;w?.saveSource(x.getValue())},[]);const G=r.useCallbackRef(x=>{const H=p.current;if(!H)return!1;const ne=H.editor;return!!ne&&(ne.focus(),!0)},[]),P=o.useRef(null),V=r.useCallbackRef((x,H)=>{p.current={monaco:H,editor:x},M(!0),_("Loading Types");const ne=w.getScripts().getModules().search()[0]?.getSource()??"";x.setValue(ne),Promise.resolve().then(()=>require("./
|
|
79
|
+
`,p=!0));const T=[{range:new t.Range(f.lineNumber,f.column,f.lineNumber,f.column),text:`${R}`}];let q=null;i.pushEditOperations([],T,D=>(q=D[0].range,h&&q.startLineNumber++,p&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function qa(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function fo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:qa(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)fo(e,t,n,l,a);return a}function Ro(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const f=Ro(m,t,n,i);if(f)return f}}return null}}function Sa(e){return e.kind==="comment"}const Ra=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:f,autoFocus:g=!0,onStatusChange:R,...h}=e,p=o.useRef(null),T=r.useCallbackRef(d,[d]),q=o.useRef(!1),D=o.useMemo(()=>({contains(x){if(!p.current)return;const H=p.current.editor;return H&&H.getDomNode()?.contains(x)},focus(){if(!p.current)return;const x=p.current.editor;return x&&x.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",D,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),W=o.useMemo(()=>{let x=null;const H=()=>D;return x=a?a.createChildGroup(H,"scriptEditor",!1):new r.CommandGroup(H,"scriptEditor"),x.addCommands(z,!0),x},[a,z]),K=r.useCommands(W,["executeSelectedScript"])[0],w=K?.context(),j=r.useCallbackRef(x=>{K?.execute(x)},[K]),S=o.useRef(""),[b,M]=o.useState(!1),B=r.useCallbackRef(async()=>{if(!p.current)return null;const x=p.current,H=x.editor;if(!H)return null;const ne=x.monaco,be=await(async(oe,X,ae="export")=>{const Me=oe.getModel();if(!Me)return null;const Te=await X.languages.typescript.getTypeScriptWorker(),fe=await Te(Me.uri),Be=await fe.getNavigationTree(Me.uri.toString());let pe=null,Pe=oe.getSelection();const Se=Pe.startLineNumber===Pe.endLineNumber&&Pe.startColumn===Pe.endColumn?Me.getLineCount():Math.min(Pe.endLineNumber,Me.getLineCount());for(let ge=Pe.startLineNumber;!pe&&ge<=Se;ge++){const ce=Ro(Be,Me.getOffsetAt({lineNumber:ge,column:1}),"function",ae);ce&&(pe=ce.text)}return pe})(H,ne);return R?.({message:(be??"").toUpperCase()}),be?{source:H.getValue(),name:be}:null},[R]),F=r.useCallbackRef(async(x,H,ne)=>{const be=await w.getScripts().createModule({source:ne?.getValue(),declarationsOnly:!0}),oe=be?be.getFunctions().search():ue.CommonUtils.EmptyArray;be&&(async function(X,ae){const Me=[];for(let Te=1;Te<X.getLineCount()+1;Te++){const fe={startLineNumber:Te,startColumn:1,endLineNumber:Te,endColumn:X.getLineLength(Te)+1},Be=X.getValueInRange(fe).indexOf("modelt");Be!==-1&&Me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ae.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Be+1,endLineNumber:fe.startLineNumber,endColumn:Be+5})}ae.editor.setModelMarkers(X,"owner",Me)}(x,H),async function(X,ae,Me,Te){const fe=await ae.languages.typescript.getTypeScriptWorker(),Be=await fe(X.uri),pe=await Be.getNavigationTree(X.uri.toString()),Pe=fo(X,ae,Te,pe).map(Se=>{let ge=null,ce=null;return Se.type==="formula"?(ge="formula.margin-icon",ce="Formula"):Se.type==="macro"?(ge="macro.margin-icon",ce="Macro"):Se.type==="autoRun"&&(ge="autorun.margin-icon",ce="Auto Run"),{range:new ae.Range(Se.lineNumber,1,Se.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:ge,glyphMarginHoverMessage:ce,stickiness:ae.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=Me.createDecorationsCollection(Pe)}(x,H,ne,oe))},[w]),A=r.useCallbackRef(ue.CommonUtils.debounce(F,580),[]),_=r.useCallbackRef(async(x=void 0)=>{if(!p.current||!w)return;const H=p.current.editor.getPosition(),ne={cursor:H?H.toString():""};x!==void 0&&(ne.message=x),R?.(ne);const be=B();w.setSelectedFunction(be)},[w,R]);o.useEffect(()=>{if(!w)return;const x={insertSnippet:ne=>{p.current?.editor&&(b?hr(p.current.editor,p.current.monaco,ne):S.current=ne)}};w.setEditor(x),w.setSelectedFunction(B());const H=w.addContainerListener({onBeforeSave:async()=>{if(!p.current?.editor||!w)return;const ne=p.current.editor,be=w?.getScripts().getModules().getByName("scripting"),oe=be?.getSource(),X=ne.getValue();if(!((oe?.length??0)!==X.length||oe!==X))return;await w.saveSource(ne.getValue());const ae=(oe?.length??0)!==X.length||oe!==X;R?.({dirty:ae})},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!w)return;const ne=p.current.editor,be=w.getScripts().getModules().search()[0]?.getSource()??"";ne.setValue(be)}});return()=>{H(),w.setSelectedFunction(null),w.setEditor(null)}},[w,b]),o.useEffect(()=>()=>{if(!p.current?.editor)return;const x=p.current.editor;w?.saveSource(x.getValue())},[]);const G=r.useCallbackRef(x=>{const H=p.current;if(!H)return!1;const ne=H.editor;return!!ne&&(ne.focus(),!0)},[]),P=o.useRef(null),V=r.useCallbackRef((x,H)=>{p.current={monaco:H,editor:x},M(!0),_("Loading Types");const ne=w.getScripts().getModules().search()[0]?.getSource()??"";x.setValue(ne),Promise.resolve().then(()=>require("./BBxxczNZCba1hv7p.cjs")).then(oe=>oe.customEditor).then(oe=>{_(""),oe.AutoTypings.create(x,{shareCache:!0,monaco:H,onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(async X=>{const ae=x.getModel();A(ae,H,x)})}),x.addCommand("executeScript",function(oe,...X){X?.[0]&&j({functionName:X?.[0]})},""),x.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async oe=>{const X=B();w.setSelectedFunction(X);const ae=await X;j(ae)}}),x.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:oe=>{w?.saveSource(x.getValue()).then(()=>{const X=w?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;R?.({dirty:Te})})}}),x.onMouseDown(async oe=>{if(oe.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=oe.target.position.lineNumber,ae=await H.languages.typescript.getTypeScriptWorker(),Me=await ae(be.uri),Te=await Me.getNavigationTree(be.uri.toString()),fe=x?.getValue(),Be=(await w?.saveSource(fe)).getFunctions().search(),pe=fo(be,H,Be,Te).find(Pe=>Pe.lineNumber===X);if(pe){const Pe=oe.event.browserEvent.button;Pe===0?pe.type==="macro"||pe.type==="autoRun"?j({functionName:pe.name}):pe.type==="formula"&&w.quickInsertFunction?.(pe.name):Pe===2&&(console.log("Context menu for function:",pe.name),oe.event.browserEvent.preventDefault())}}}),x.onDidChangeModelContent(()=>{const oe=x.getModel();A(oe,H,x)});const be=x.getModel();(function(oe,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ae,Me,Te){const fe=[];for(let Be=1;Be<ae.getLineCount()+1;Be++){const pe={startLineNumber:Be,startColumn:1,endLineNumber:Be,endColumn:ae.getLineLength(Be)+1},Pe="hint",Se=ae.getValueInRange(pe).indexOf("hint");Se!==-1&&fe.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:pe.startLineNumber,column:Se+Pe.length+1},label:"[hint]"})}return{hints:fe,dispose:()=>{}}}})})(0,H),be.onDidChangeContent(oe=>{const X=w?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;R?.({dirty:Te})}),x.onDidChangeCursorPosition(oe=>{_()})},[w,R]),$=o.useMemo(()=>b?null:f||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[b,f]),te=o.useMemo(()=>{const x=w?.getScripts().getModules().getByName("scripting")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(wa,{theme:m?"extended-dark":"extended",options:{...xa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:x,onValidate:H=>{let ne=!1;for(let be=0;!ne&&be<H?.length;be++)H[be].severity===8&&(ne=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let ne=!1;try{const oe=await(async()=>{try{return await(await fetch("http://localhost:8088/types-scripting.d.ts")).text()}catch{return console.warn("Fallback to global types"),gr}})(),X=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),ae=H.editor.createModel(oe,"typescript",X);H.editor.setModelMarkers(ae,"default",[]),ne=!0}catch(oe){console.warn("cant load types",oe)}ne&&(H.languages.typescript.typescriptDefaults.addExtraLib(gr,"global.d.ts"),H.languages.typescript.typescriptDefaults.addExtraLib(`
|
|
80
80
|
declare module '@sheetxl/primitives' {
|
|
81
81
|
/** Interface defining the methods available on the formula context. */
|
|
82
82
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as On from "react";
|
|
2
2
|
import { forwardRef as ua, useRef as ca, useImperativeHandle as la, useEffect as fa, createElement as yr } from "react";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
4
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import x, { memo as ce, useState as q, useRef as h, useCallback as ie, useEffect as M } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
3
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
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.
|
|
@@ -9,7 +9,7 @@ import tt, { memo as pt, useMemo as ye, useState as ue, forwardRef as vt, useRef
|
|
|
9
9
|
import { STANDARD_KEY_CHARS as pi, useSelection as ol, useHeaderSelection as fi, HeaderRenderer as vi, Grid as rl, HeaderDivider as wi, SELECTION_CLIP_INSETS as $o, defaultSelectionRenderer as yi, useKeyboardEditorOverlay as bi, Selection as ll, SVGLine as ro } from "@sheetxl/grid-react";
|
|
10
10
|
import { unstable_batchedUpdates as Nn, createPortal as il } from "react-dom";
|
|
11
11
|
/**
|
|
12
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
12
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
13
13
|
*
|
|
14
14
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
15
15
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -2348,7 +2348,7 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2348
2348
|
m.current = !0;
|
|
2349
2349
|
const K = tt.lazy(async () => {
|
|
2350
2350
|
try {
|
|
2351
|
-
const Ne = await import("./
|
|
2351
|
+
const Ne = await import("./DLKNIw4kS3RTD7SI.mjs");
|
|
2352
2352
|
return m.current = !1, Ke.current = !0, v([...q]), Ne;
|
|
2353
2353
|
} catch (Ne) {
|
|
2354
2354
|
return console.warn(Ne), Ie.current?.(!1), null;
|
|
@@ -4566,7 +4566,7 @@ const td = (e) => Je("svg", { ...e, viewBox: "0 0 48 48", children: [p("path", {
|
|
|
4566
4566
|
}, Td = () => {
|
|
4567
4567
|
const e = Xt(Wl), [t] = ue(() => new ti());
|
|
4568
4568
|
return ye(() => e || t, [e]);
|
|
4569
|
-
}, Ls = "_script-editor_faoxm_9", Os = tt.lazy(() => import("./
|
|
4569
|
+
}, Ls = "_script-editor_faoxm_9", Os = tt.lazy(() => import("./DvgXJ4zs4t-AuOXe.mjs")), Vs = { 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" }, jr = `
|
|
4570
4570
|
/**
|
|
4571
4571
|
* Placeholder for SheetXL scripting types.
|
|
4572
4572
|
*/
|
|
@@ -4769,7 +4769,7 @@ const Md = pt(vt((e, t) => {
|
|
|
4769
4769
|
}, []), V = Te(null), O = ie((y, B) => {
|
|
4770
4770
|
g.current = { monaco: B, editor: y }, S(!0), G("Loading Types");
|
|
4771
4771
|
const te = w.getScripts().getModules().search()[0]?.getSource() ?? "";
|
|
4772
|
-
y.setValue(te), import("./
|
|
4772
|
+
y.setValue(te), import("./CUjHpURgClxT6pkr.mjs").then((oe) => oe.c).then((oe) => {
|
|
4773
4773
|
G(""), oe.AutoTypings.create(y, { shareCache: !0, monaco: B, onError: (Z) => {
|
|
4774
4774
|
Z === "Not implemented yet" && (Z = "Compile Errors"), console.warn("Error compiling types", Z);
|
|
4775
4775
|
} }).then(async (Z) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.2.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -2175,7 +2175,7 @@ const Rt = (e2, t2, o2 = null) => {
|
|
|
2175
2175
|
ye2.current = true;
|
|
2176
2176
|
const e3 = J.lazy(async () => {
|
|
2177
2177
|
try {
|
|
2178
|
-
const e4 = await import("./
|
|
2178
|
+
const e4 = await import("./Bmw8GVpd2Eqo5TgC.mjs");
|
|
2179
2179
|
return ye2.current = false, Ce2.current = true, R2([...k2]), e4;
|
|
2180
2180
|
} catch (e4) {
|
|
2181
2181
|
return console.warn(e4), _2.current?.(false), null;
|
package/package.json
CHANGED
|
@@ -1,50 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/react",
|
|
3
3
|
"description": "React - React components needed to build advanced grid and spreadsheet UIs.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
|
-
"author": "Michael T Ford",
|
|
7
|
-
"private": false,
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"build"
|
|
13
|
-
],
|
|
14
6
|
"type": "module",
|
|
15
7
|
"exports": {
|
|
16
8
|
".": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"default": "./build/browser/esm/index.mjs"
|
|
23
|
-
}
|
|
9
|
+
"types": "./types/index.d.ts",
|
|
10
|
+
"browser": "./browser/esm/index.mjs",
|
|
11
|
+
"node": "./node/esm/index.mjs",
|
|
12
|
+
"import": "./browser/esm/index.mjs",
|
|
13
|
+
"require": "./browser/cjs/index.cjs"
|
|
24
14
|
}
|
|
25
15
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
30
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
31
|
-
"@monaco-editor/react": "^4.6.0",
|
|
32
|
-
"clsx": "^2.1.1",
|
|
33
|
-
"monaco-editor-auto-typings": "^0.4.6",
|
|
34
|
-
"react-merge-refs": "^3.0.2",
|
|
35
|
-
"react-moveable": "^0.56.0",
|
|
36
|
-
"react-use": "^17.6.0",
|
|
37
|
-
"rooks": "^8.1.0"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"react": "^19.1.0",
|
|
41
|
-
"react-dom": "^19.1.0",
|
|
42
|
-
"@sheetxl/grid-react": "0.1.120",
|
|
43
|
-
"@sheetxl/io": "0.1.120",
|
|
44
|
-
"@sheetxl/sdk": "0.1.120",
|
|
45
|
-
"@sheetxl/utils": "0.1.120",
|
|
46
|
-
"@sheetxl/utils-react": "0.1.120"
|
|
47
|
-
},
|
|
16
|
+
"types": "./types/index.d.ts",
|
|
17
|
+
"module": "./browser/esm/index.mjs",
|
|
18
|
+
"main": "./browser/cjs/index.cjs",
|
|
48
19
|
"sideEffects": [
|
|
49
20
|
"*.css",
|
|
50
21
|
"**/*.css"
|
|
@@ -60,17 +31,26 @@
|
|
|
60
31
|
"automation",
|
|
61
32
|
"charting"
|
|
62
33
|
],
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@dnd-kit/core": "^6.3.1",
|
|
36
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
37
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
38
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
39
|
+
"@monaco-editor/react": "^4.6.0",
|
|
40
|
+
"clsx": "^2.1.1",
|
|
41
|
+
"monaco-editor-auto-typings": "^0.4.6",
|
|
42
|
+
"react-merge-refs": "^3.0.2",
|
|
43
|
+
"react-moveable": "^0.56.0",
|
|
44
|
+
"react-use": "^17.6.0",
|
|
45
|
+
"rooks": "^8.1.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@sheetxl/grid-react": "^0.2.0",
|
|
49
|
+
"@sheetxl/io": "^0.2.0",
|
|
50
|
+
"@sheetxl/sdk": "^0.2.0",
|
|
51
|
+
"@sheetxl/utils": "^0.2.0",
|
|
52
|
+
"@sheetxl/utils-react": "^0.2.0",
|
|
53
|
+
"react": "^19.1.0",
|
|
54
|
+
"react-dom": "^19.1.0"
|
|
75
55
|
}
|
|
76
56
|
}
|
package/build/README.md
DELETED
package/build/package.json
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sheetxl/react",
|
|
3
|
-
"description": "React - React components needed to build advanced grid and spreadsheet UIs.",
|
|
4
|
-
"version": "0.1.120",
|
|
5
|
-
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./types/index.d.ts",
|
|
10
|
-
"browser": "./browser/esm/index.mjs",
|
|
11
|
-
"node": "./node/esm/index.mjs",
|
|
12
|
-
"import": "./browser/esm/index.mjs",
|
|
13
|
-
"require": "./browser/cjs/index.cjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"types": "./types/index.d.ts",
|
|
17
|
-
"module": "./browser/esm/index.mjs",
|
|
18
|
-
"main": "./browser/cjs/index.cjs",
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"sideEffects": [
|
|
23
|
-
"*.css",
|
|
24
|
-
"**/*.css"
|
|
25
|
-
],
|
|
26
|
-
"author": "Michael T Ford",
|
|
27
|
-
"keywords": [
|
|
28
|
-
"sheetxl",
|
|
29
|
-
"spreadsheet",
|
|
30
|
-
"react",
|
|
31
|
-
"office",
|
|
32
|
-
"grid",
|
|
33
|
-
"excel",
|
|
34
|
-
"utilities",
|
|
35
|
-
"automation",
|
|
36
|
-
"charting"
|
|
37
|
-
],
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@dnd-kit/core": "^6.3.1",
|
|
40
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
41
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
42
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
43
|
-
"@monaco-editor/react": "^4.6.0",
|
|
44
|
-
"clsx": "^2.1.1",
|
|
45
|
-
"monaco-editor-auto-typings": "^0.4.6",
|
|
46
|
-
"react-merge-refs": "^3.0.2",
|
|
47
|
-
"react-moveable": "^0.56.0",
|
|
48
|
-
"react-use": "^17.6.0",
|
|
49
|
-
"rooks": "^8.1.0"
|
|
50
|
-
},
|
|
51
|
-
"peerDependencies": {
|
|
52
|
-
"@sheetxl/grid-react": "^0.1.119",
|
|
53
|
-
"@sheetxl/io": "^0.1.119",
|
|
54
|
-
"@sheetxl/sdk": "^0.1.119",
|
|
55
|
-
"@sheetxl/utils": "^0.1.119",
|
|
56
|
-
"@sheetxl/utils-react": "^0.1.119",
|
|
57
|
-
"react": "^19.1.0",
|
|
58
|
-
"react-dom": "^19.1.0"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|