@sheetxl/studio-mui 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{Dvt2IAj97024ZgC1.cjs → B-ux82mC3pdz1kz_.cjs} +1 -1
- package/browser/cjs/{KIc9ZDpTo3kpO7Oh.cjs → B0DBQadzoF7C4vlu.cjs} +7 -7
- package/browser/cjs/{C_v094rC6ZzOyGw_.cjs → BC-7zTAFDNOpYXcQ.cjs} +1 -1
- package/browser/cjs/{CiHZBicoX3PWiQ0L.cjs → BIKJ2_bHsaXftgBA.cjs} +2 -2
- package/browser/cjs/{DbJXy_YCEs8sblz-.cjs → BIiFKMaRy0Seo_xY.cjs} +2 -2
- package/browser/cjs/{CZ10qs_G-ai0jsyd.cjs → BNuSzQJqJbqHwotK.cjs} +2 -2
- package/browser/cjs/{DlQaYoKDVLqXhrya.cjs → BeU89ZkkvdnHOF1P.cjs} +2 -2
- package/browser/cjs/{DdYWRSoyIpSc_8lw.cjs → CB_V4Ok9VnnjqWQB.cjs} +1 -1
- package/browser/cjs/{Cbdxli_V881Hci2P.cjs → CFMdCpzsOvXxkNao.cjs} +3 -3
- package/browser/cjs/{D7qFUx13O41OkX_c.cjs → CJLLfqCAwoVg1zFf.cjs} +2 -2
- package/browser/cjs/{C2I6DLwxf-YSb_jE.cjs → CODNX35VkrQ_uYLp.cjs} +1 -1
- package/browser/cjs/{BIer7D14Ee-tvsvO.cjs → CfR-erRBEERmc9wX.cjs} +2 -2
- package/browser/cjs/{DZqxCC2NnSaeVA6T.cjs → CnFS2z2aIkAOecZl.cjs} +2 -2
- package/browser/cjs/{BaBM36Unyi3LA40i.cjs → Cq88W0KN7eeKf96-.cjs} +2 -2
- package/browser/cjs/{D-ryuYDSK4DZxnFP.cjs → D8CHP6b7A1ozVuVv.cjs} +1 -1
- package/browser/cjs/{DKb4LAbZQrysUK06.cjs → Da2vqZhCoygWa4Gd.cjs} +1 -1
- package/browser/cjs/{CyRjksxgzVEJkZ0o.cjs → DcFfMY3RZgcsj0C5.cjs} +2 -2
- package/browser/cjs/{CTcK6J2u4hz3iU3I.cjs → Dd-24dPmZyIm2GZn.cjs} +4 -4
- package/browser/cjs/{5Ny9bRWrQUPFU3rr.cjs → Rw2yrV19tzTGGBPV.cjs} +1 -1
- package/browser/cjs/{C4LIe424uA1OEIXG.cjs → TsuMTKhj2O-5Vm_K.cjs} +1 -1
- package/browser/cjs/{D2lk9iDkETqiNlM-.cjs → Vl02t3Ty3ttvNkaF.cjs} +3 -3
- package/browser/cjs/{D0HT9fxj5oOuHbDe.cjs → duIJEG2QfFHcyCNS.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{DeI7be_GTFaBNaQE.cjs → ivbAx6mvfpGeOeWC.cjs} +2 -2
- package/browser/cjs/{DCBkJgJos_64slSF.cjs → lhF4xnajIhTMhNl3.cjs} +2 -2
- package/browser/cjs/{BTJCgtyeGTpr8d7i.cjs → s_IQJahtZWmMiA6H.cjs} +1 -1
- package/browser/esm/{B9vgTenZasJ5c-Gy.mjs → BXMqtXcjrhd3mV_b.mjs} +1 -1
- package/browser/esm/{WDDWzpoQltCyXHy3.mjs → BgZu4ONYiuE03g5E.mjs} +1 -1
- package/browser/esm/{CJZfDCEiiw4DxYmL.mjs → BkJhQM8qXEY6xg0A.mjs} +1 -1
- package/browser/esm/{DNnN3DPk-osK5dRB.mjs → BrpIqbhfQOsETW-Z.mjs} +1 -1
- package/browser/esm/{BSGLfLCxSuuMjK20.mjs → C-jaMTSM-mlUYQWc.mjs} +1 -1
- package/browser/esm/{BgeAnQmizCf4luoG.mjs → C6M-ezBh1hG72jnT.mjs} +1 -1
- package/browser/esm/{5qjH9Ls3nis6vvcf.mjs → CCp_VIhDZtSAxQ-y.mjs} +2 -2
- package/browser/esm/{D13PjUb_QMfoPpQA.mjs → CNshvpoFM47orxx0.mjs} +4 -4
- package/browser/esm/{DPObyflqVasjsFZe.mjs → CPDWi1cSKW_R-qNz.mjs} +2 -2
- package/browser/esm/{RKJfQRZFCuUl_lDs.mjs → CSv3pOHLylhWmH8d.mjs} +8 -8
- package/browser/esm/{DitZ5iKibNroWdo4.mjs → CWTqa3g0eIUrE5B3.mjs} +2 -2
- package/browser/esm/{Dc0w0rPZIwiDqUEa.mjs → CtSrx4nacWKKijnq.mjs} +2 -2
- package/browser/esm/{Dq-RkasehibvxjAF.mjs → D2sGb-BBS93SaVfr.mjs} +2 -2
- package/browser/esm/{ZFEuOOJ1OjzEugNL.mjs → D3_xTUNkwBvulPoy.mjs} +3 -3
- package/browser/esm/{DzEPyliLJf_0H5ZV.mjs → D3s4Rb9aXGcQfRLP.mjs} +2 -2
- package/browser/esm/{ClGyPgftg3ezMvEB.mjs → D4fOozQcIpB_kEGh.mjs} +1 -1
- package/browser/esm/{cZfWAhKZ0hUeBoRR.mjs → D5C01UlJ_WzGJb1U.mjs} +3 -3
- package/browser/esm/{CUR6Eb12vLWE2Qaj.mjs → DCyFgwVUUJCbr3b-.mjs} +6 -6
- package/browser/esm/{C0Kl_C2ISGrrzNs4.mjs → DG2D4wrC2ecjUvbW.mjs} +2 -2
- package/browser/esm/{DtcguzjEfXD50C2G.mjs → DJ-nuB993iuQ2dLR.mjs} +2 -2
- package/browser/esm/{B2sj-vLyLzscqSGC.mjs → DREtSHtE37T0AmS_.mjs} +1 -1
- package/browser/esm/{atsteUR8wdwhUP5X.mjs → Df-0UQ7Oqnnr_YCR.mjs} +4 -4
- package/browser/esm/{CcZqTslihfnMLOJe.mjs → Dutwya1U4avCGOZJ.mjs} +1 -1
- package/browser/esm/{CyHalByJUPvN8NSK.mjs → DvlcfUv1sOYogEJf.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{Crk4YK9JBbjCyTZo.mjs → rIOGES0P2u1T8gdG.mjs} +2 -2
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{DyB1BhR-uUcKMB5z.mjs → -GRUm7YcLL_9P76x.mjs} +3 -3
- package/node/esm/{BBKzM2sT9VJhFwhp.mjs → 79z9w3OUJQUnnnTe.mjs} +1 -1
- package/node/esm/{NH8pDr30z7rBs6dx.mjs → B3aQ-fFB5yGiGNZu.mjs} +1 -1
- package/node/esm/{BAjg0ld3sSOeiJnH.mjs → B9wtGYSLb1z45fF5.mjs} +1 -1
- package/node/esm/{1tVhjWjZZ0QR4vrP.mjs → BTrBLz8J87eNSGGC.mjs} +1 -1
- package/node/esm/{CO1TO30UdST-CZ1P.mjs → BdrnOScBIZcLJeWZ.mjs} +1 -1
- package/node/esm/{D2MnUDbdTOeHE-Ii.mjs → BoKKdS08-mpDe0Jc.mjs} +1 -1
- package/node/esm/{Bo8cja5TLmKb7d5Z.mjs → CAscK0b5hQqKD1_4.mjs} +1 -1
- package/node/esm/{C11T3ZieiJhjwSlf.mjs → CXTz7AVGH2Ne89GX.mjs} +2 -2
- package/node/esm/{D7OBFyeKz8L6K5tw.mjs → Cg-6-Y9Esur_JzgV.mjs} +1 -1
- package/node/esm/{DSLj4MF1P67T-CeT.mjs → CtOavd1Vs8YekqUA.mjs} +1 -1
- package/node/esm/{d1JmPvwEgFIiVfuv.mjs → CvgIFzdCYUUT5sgy.mjs} +1 -1
- package/node/esm/{D4cV4gZD1BeZCaLX.mjs → CxGKKSUOrDlzNKTk.mjs} +1 -1
- package/node/esm/{CfZFQRNZrIHEZ3Zh.mjs → D9kW-cf46a2qJOgl.mjs} +1 -1
- package/node/esm/{WsHBhbc75wBWLM21.mjs → DF1cEAzdzmVYXHdn.mjs} +3 -3
- package/node/esm/{NA-GEzmfkyV86xfx.mjs → DhY-IsMoPgxoGE0v.mjs} +1 -1
- package/node/esm/{N6MyXx8q1XHVI1tX.mjs → DnJpLOMDZ1Eja55K.mjs} +1 -1
- package/node/esm/{DZdJJJFNLKMRj_Vu.mjs → MUuB7IhyC7mkrpFl.mjs} +1 -1
- package/node/esm/{CHcMQsKKnpOfwbO3.mjs → O9nLv91VOHDe81St.mjs} +1 -1
- package/node/esm/{_91EwetZkmJN4FeD.mjs → OVsHEKU-iS-n5eF_.mjs} +5 -5
- package/node/esm/{CBxMk3FECJWRCvbR.mjs → XBeUWyM3aN4u_BdX.mjs} +1 -1
- package/node/esm/{CzEcqqQ-yz_2cIAp.mjs → Z4ETLRjjeRuieug-.mjs} +1 -1
- package/node/esm/index.mjs +8 -8
- package/node/esm/{C3sHFfwWbPBuwypb.mjs → j54okY-ax6T04nM8.mjs} +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.14
|
|
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.
|
|
@@ -34,7 +34,7 @@ export default theme;`}function Ld(e={},...t){const{breakpoints:n,mixins:o={},sp
|
|
|
34
34
|
`);await navigator.clipboard.writeText(p),r("Copied!"),setTimeout(()=>r(null),2e3)}catch(u){r("Can't copy!"),console.warn("Failed to copy stack trace:",u)}},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Copy stack trace",children:a.jsx(wn.ContentCopy,{sx:{fontSize:"0.875rem"}})}),a.jsx(V.IconButton,{size:"small",onClick:()=>{console.log(e)},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Log error to console",children:a.jsx(wn.BugReport,{sx:{fontSize:"0.875rem"}})})]}),a.jsxs(V.Box,{sx:{mt:1,backgroundColor:"rgba(0, 0, 0, 0.2)",borderRadius:1,p:1,maxHeight:"300px",overflow:"auto",fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.4},children:[d.map((u,p)=>u.isBoundary?a.jsx(V.Box,{sx:{py:1,mt:p>0?1:0,mb:.5,borderTop:p>0?"1px solid rgba(255, 255, 255, 0.1)":"none"},children:a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",fontWeight:"bold",color:f=>u.isBoundary?f.palette.text.primary:f.palette.text.secondary,display:"block"},children:u.line})},`error-${p}`):a.jsxs(V.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,py:.25,pl:1,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},children:[!n&&a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.5,minWidth:"20px",textAlign:"right",userSelect:"none"},children:p+1}),a.jsxs(V.Box,{sx:{flex:1,overflow:"hidden"},children:[a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"inherit"},children:u.line}),u.location&&u.line!==u.location&&a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic"},children:u.location})]})]},`stack-${p}`)),c&&a.jsxs(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic",textAlign:"center",display:"block",mt:1},children:["... and ",l.length-t," more frames"]})]})]})});X2.displayName="StackTrace";const Qh=s.memo(s.forwardRef((e,t)=>{const{sx:n,icon:o=a.jsx(wn.Error,{style:{fontSize:48}}),error:r,hideStackTrace:i=!1,stackTraceExpanded:l=!1,...d}=e,c=s.useMemo(()=>((u,p=!1)=>{if(s.isValidElement(u))return u;if(u instanceof Error)return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"500px",width:"100%"},children:[a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,mb:1},children:u.message}),u.cause?a.jsxs(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",mb:1,opacity:.8},children:["Caused by: ",u.cause instanceof Error?u.cause.message:String(u.cause)]}):null,!p&&a.jsx(X2,{error:u,hideLineNumbers:!0})]});const f=u==="string"?u:`Unknown Error: ${String(u)}`;return a.jsx(V.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em"},children:f})})(r,i,l),[r,i,l]);return s.useMemo(()=>a.jsx(V.Box,{ref:t,sx:{boxSizing:"border-box",alignItems:"center",justifyContent:"center",display:"flex",flexDirection:"row",overflow:"hidden",width:"100%",height:"100%",...n},...d,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",height:"100%",alignItems:"center",justifyContent:"center",boxSizing:"border-box",position:"relative"},children:[a.jsx(V.Box,{className:"backdrop",sx:{backdropFilter:"blur(4px)",borderRadius:u=>`${u.shape.borderRadius}px`,zIndex:-1,position:"absolute",width:"100%",height:"100%",boxSizing:"border-box"}}),a.jsx(V.Paper,{elevation:0,sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",rowGap:"8px",alignSelf:"center",marginBottom:"5%",backgroundColor:u=>u.palette.error.light,color:u=>u.palette.error.contrastText,paddingLeft:u=>u.spacing(2),paddingRight:u=>u.spacing(2),paddingTop:u=>u.spacing(2),paddingBottom:u=>u.spacing(2),borderRadius:u=>`${u.shape.borderRadius}px`,boxShadow:u=>u.shadows[2],"& .primary":{background:u=>`${u.palette.error.contrastText} !important`,border:"solid transparent"},zIndex:1},children:a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:u=>u.spacing(2),width:"100%",maxWidth:"600px"},children:a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:u=>u.spacing(2)},children:[o,c]})})})]})}),[n])}));Qh.displayName="ErrorPanel";const ep=s.memo(s.forwardRef((e,t)=>{const{chips:n,sx:o,...r}=e,i=s.useMemo(()=>{if(!n)return null;let l=null;l=Array.isArray(n)?n:[n];const d=[];for(let c=0;c<l.length;c++){const u=l[c];let p=null;typeof u=="string"?p=a.jsx(V.Chip,{label:u,color:"primary",size:"small",sx:{scale:"0.8"}},"chip-"+c):s.cloneElement(u,{key:"chip-"+c}),d.push(p)}return d},[n]);return a.jsx(V.Box,{ref:t,sx:{display:"flex",flexDirection:"row",marginLeft:"4px",gap:"2px",...o},...r,children:i})}));var Wd="top",Bs="bottom",Ud="right",tp="left",fv=[Wd,Bs,Ud,tp],np="viewport",El="popper";function J0(e){return e?(e.nodeName||"").toLowerCase():null}function x0(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Yi(e){return e instanceof x0(e).Element||e instanceof Element}function Ni(e){return e instanceof x0(e).HTMLElement||e instanceof HTMLElement}function qd(e){return typeof ShadowRoot<"u"&&(e instanceof x0(e).ShadowRoot||e instanceof ShadowRoot)}var ea=Math.max,r6=Math.min,i6=Math.round;function Zd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function op(){return!/^((?!chrome|android).)*safari/i.test(Zd())}function Y2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&Ni(e)&&(r=e.offsetWidth>0&&i6(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&i6(o.height)/e.offsetHeight||1);var l=(Yi(e)?x0(e):window).visualViewport,d=!op()&&n,c=(o.left+(d&&l?l.offsetLeft:0))/r,u=(o.top+(d&&l?l.offsetTop:0))/i,p=o.width/r,f=o.height/i;return{width:p,height:f,top:u,right:c+p,bottom:u+f,left:c,x:c,y:u}}function L0(e){return x0(e).getComputedStyle(e)}function mv(e){return["table","td","th"].indexOf(J0(e))>=0}function Vi(e){return((Yi(e)?e.ownerDocument:e.document)||window.document).documentElement}function a1(e){return J0(e)==="html"?e:e.assignedSlot||e.parentNode||(qd(e)?e.host:null)||Vi(e)}function l6(e){return Ni(e)&&L0(e).position!=="fixed"?e.offsetParent:null}function rp(e){var t=x0(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function a6(e){return Y2(Vi(e)).left+rp(e).scrollLeft}function ip(e){var t=L0(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function lp(e){return["html","body","#document"].indexOf(J0(e))>=0?e.ownerDocument.body:Ni(e)&&ip(e)?e:lp(a1(e))}function ap(e,t){var n;t===void 0&&(t=[]);var o=lp(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=x0(o),l=r?[i].concat(i.visualViewport||[],ip(o)?o:[]):o,d=t.concat(l);return r?d:d.concat(ap(a1(l)))}function Gd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function s6(e,t,n){return t===np?Gd(function(o,r){var i=x0(o),l=Vi(o),d=i.visualViewport,c=l.clientWidth,u=l.clientHeight,p=0,f=0;if(d){c=d.width,u=d.height;var h=op();(h||!h&&r==="fixed")&&(p=d.offsetLeft,f=d.offsetTop)}return{width:c,height:u,x:p+a6(o),y:f}}(e,n)):Yi(t)?function(o,r){var i=Y2(o,!1,r==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(t,n):Gd(function(o){var r,i=Vi(o),l=rp(o),d=(r=o.ownerDocument)==null?void 0:r.body,c=ea(i.scrollWidth,i.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),u=ea(i.scrollHeight,i.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),p=-l.scrollLeft+a6(o),f=-l.scrollTop;return L0(d||i).direction==="rtl"&&(p+=ea(i.clientWidth,d?d.clientWidth:0)-c),{width:c,height:u,x:p,y:f}}(Vi(e)))}function gv(e){var t=ap(a1(e)),n=["absolute","fixed"].indexOf(L0(e).position)>=0&&Ni(e)?function(o){for(var r=x0(o),i=l6(o);i&&mv(i)&&L0(i).position==="static";)i=l6(i);return i&&(J0(i)==="html"||J0(i)==="body"&&L0(i).position==="static")?r:i||function(l){var d=/firefox/i.test(Zd());if(/Trident/i.test(Zd())&&Ni(l)&&L0(l).position==="fixed")return null;var c=a1(l);for(qd(c)&&(c=c.host);Ni(c)&&["html","body"].indexOf(J0(c))<0;){var u=L0(c);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||d&&u.willChange==="filter"||d&&u.filter&&u.filter!=="none")return c;c=c.parentNode}return null}(o)||r}(e):e;return Yi(n)?t.filter(function(o){return Yi(o)&&function(r,i){var l=i.getRootNode&&i.getRootNode();if(r.contains(i))return!0;if(l&&qd(l)){var d=i;do{if(d&&r.isSameNode(d))return!0;d=d.parentNode||d.host}while(d)}return!1}(o,n)&&J0(o)!=="body"}):[]}const xv={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(e){var t=e.state,n=e.name,o=function(m,g){g===void 0&&(g={});var x,y=g,v=y.placement,b=v===void 0?m.placement:v,C=y.strategy,k=C===void 0?m.strategy:C,E=y.boundary,R=E===void 0?"clippingParents":E,j=y.rootBoundary,B=j===void 0?np:j,T=y.elementContext,_=T===void 0?El:T,w=y.altBoundary,S=w!==void 0&&w,O=y.padding,P=O===void 0?0:O,M=function(F){return Object.assign({},{top:0,right:0,bottom:0,left:0},F)}(typeof P!="number"?P:(x=P,fv.reduce(function(F,X){return F[X]=x,F},{}))),A=_===El?"reference":El,D=m.rects.popper,L=m.elements[S?A:_],N=function(F,X,K,ne){var J=X==="clippingParents"?gv(F):[].concat(X),re=[].concat(J,[K]),fe=re[0],ie=re.reduce(function(ee,pe){var Te=s6(F,pe,ne);return ee.top=ea(Te.top,ee.top),ee.right=r6(Te.right,ee.right),ee.bottom=r6(Te.bottom,ee.bottom),ee.left=ea(Te.left,ee.left),ee},s6(F,fe,ne));return ie.width=ie.right-ie.left,ie.height=ie.bottom-ie.top,ie.x=ie.left,ie.y=ie.top,ie}(Yi(L)?L:L.contextElement||Vi(m.elements.popper),R,B,k),W=Y2(m.elements.reference),I=function(F){var X,K=F.reference,ne=F.element,J=F.placement,re=J?J.split("-")[0]:null,fe=J?J.split("-")[1]:null,ie=K.x+K.width/2-ne.width/2,ee=K.y+K.height/2-ne.height/2;switch(re){case Wd:X={x:ie,y:K.y-ne.height};break;case Bs:X={x:ie,y:K.y+K.height};break;case Ud:X={x:K.x+K.width,y:ee};break;case tp:X={x:K.x-ne.width,y:ee};break;default:X={x:K.x,y:K.y}}var pe=re?function(Ae){return["top","bottom"].indexOf(Ae)>=0?"x":"y"}(re):null;if(pe!=null){var Te=pe==="y"?"height":"width";switch(fe){case"start":X[pe]=X[pe]-(K[Te]/2-ne[Te]/2);break;case"end":X[pe]=X[pe]+(K[Te]/2-ne[Te]/2)}}return X}({reference:W,element:D,placement:b}),U=Gd(Object.assign({},D,I)),G=_===El?U:W,Q={top:N.top-G.top+M.top,bottom:G.bottom-N.bottom+M.bottom,left:N.left-G.left+M.left,right:G.right-N.right+M.right},H=m.modifiersData.offset;if(_===El&&H){var $=H[b];Object.keys(Q).forEach(function(F){var X=[Ud,Bs].indexOf(F)>=0?1:-1,K=[Wd,Bs].indexOf(F)>=0?"y":"x";Q[F]+=$[K]*X})}return Q}(t,e.options),r=t.modifiersData.preventOverflow||{x:0,y:0},i=r.x,l=r.y;let d=t.rects.popper,c=d.width,u=d.height,p=t.placement.split("-")[0],f=p==="left"?"left":"right",h=p==="top"?"top":"bottom";t.modifiersData[n]={width:c-o[f]-i,height:u-o[h]-l}}},yv=[0,2],sp=s.memo(s.forwardRef((e,t)=>{const{sx:n,open:o,children:r,label:i,offsets:l=yv,anchorEl:d,anchorPosition:c,onMount:u,onOpening:p,onOpen:f,onClosing:h,onClose:m,resizeOnOverflow:g=!0,...x}=e;if(Array.isArray(r))throw new Error("children can not be an array");const y=N2(),v={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:N}){const{height:W}=N.modifiersData.maxSize;N.styles.popper.maxHeight=W-10+"px"}},b=s.useMemo(()=>{const N=[{name:"offset",options:{offset:l}},{name:"flip",enabled:!0,options:{rootBoundary:"document"}}];return g&&N.unshift(xv,v),N},[g,l]),[C,k]=s.useState(!1),E=s.useRef(null),R=fn(()=>{u?.(O.current,E.current)},[p]),j=fn(p,[p]),B=fn(f,[f]),T=fn(h,[h]),_=fn(()=>{k(!1),m?.()},[m]),[w,S]=s.useState(!1),O=s.useRef(null),P=s.useRef(!0),M=s.useMemo(()=>({onFirstUpdate:()=>{P.current&&(S(!0),R?.(),P.current=!1)}}),[o,C]);s.useEffect(()=>{o&&w?j?.():!o&&C&&T?.(),o&&k(o)},[o,w]);const A=s.useMemo(()=>({getBoundingClientRect:()=>c?new DOMRect(c?.left||0,c?.top||0,0,0):d.getBoundingClientRect()}),[c,d]);s.useImperativeHandle(t,()=>({instance:()=>E.current,element:()=>O.current}),[]);const{getPortalContainer:D}=U2(),L=s.useMemo(()=>({zIndex:o?"1300":"1299",display:"flex",pointerEvents:C&&o?void 0:"none",maxWidth:"100%",maxHeight:"100%",...n}),[n,o,C]);return a.jsx(V.Popper,{ref:O,popperRef:E,container:D,anchorEl:A,open:C,role:void 0,popperOptions:M,transition:!0,sx:L,placement:"bottom-start",modifiers:b,...x,children:({TransitionProps:N,placement:W,...I})=>{const{in:U,onEnter:G,onExited:Q,...H}=N??{};return a.jsx(V.Grow,{...H,in:o,onEnter:()=>{G?.(),B()},onExited:()=>{Q?.(),_()},timeout:{enter:y.transitions.duration.shorter,exit:0},style:{transformOrigin:W==="bottom-start"?"left top":"center bottom"},children:typeof r=="function"?r({TransitionProps:N,placement:W,...I}):r||{}})}})}));sp.displayName="ExhibitPopper";const Ir={Toolbar:"toolbar",Menuitem:"menuitem"},_n=e=>{const{closeFloat:t,closeFloatAll:n,floatReference:o,popupContainer:r,children:i,className:l,sx:d,...c}=e;return a.jsx(V.Box,{className:Mo("menu",l),sx:{display:"flex",flexDirection:"column",...d},...c,children:i})},c6=(e,t,n)=>a.jsx(wn.ArrowDropDown,{sx:{marginLeft:e?void 0:t?"-5px":"-3px",marginRight:e?void 0:t?"-5px":"-6px",transform:()=>{let o;return t&&(o=(o?o+" ":"")+"scale(0.8)"),n&&(o=(o?o+" ":"")+"rotate(180deg)"),o}},color:"inherit"}),bv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,vv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Kd=function(e,t=null){if(!e)return e;e=e.replace(bv,function(o,r,i,l){return r+r+i+i+l+l});let n=vv.exec(e);return n?t===null?`rgb(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)})`:`rgb(${parseInt(n[1],16)} ${parseInt(n[2],16)} ${parseInt(n[3],16)} / ${100*t}%)`:e},Cr=function(e,t=.2,n="light"){if(!e)return e;let o=n!=="dark";return t<0&&(o=!o,t*=-1),e=Kd(e),o?gt.darken(e,Math.max(0,Math.min(1,1*t))):gt.lighten(e,Math.max(0,Math.min(1,1.5*t)))};function J2(e,t){t=S8.deepmerge({track:Cr(e.palette.background.paper,.05,e?.palette.mode),thumb:Cr(e.palette.background.paper,.3,e?.palette.mode),active:e.palette.primary.main,corner:e.palette.background.paper,outline:!1},t||{});const n={"&::-webkit-scrollbar, & *::-webkit-scrollbar":{backgroundColor:gt.alpha(t.track,.2),width:"13px",height:"13px"},"&::-webkit-scrollbar-button":{display:"none"},"& .scrollbar-button":{fill:t.thumb,backgroundColor:"transparent",transition:"fill opacity 260ms ease",width:"13px",height:"13px"},"& .scrollbar-button:hover:not([disabled])":{fill:t.active},"& .scrollbar-button:disabled":{opacity:.8},"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track":{},"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece":{},"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb":{borderRadius:8,backgroundColor:t.thumb,minHeight:"24px",minWidth:"24px",border:`2px solid ${t.track}`},"&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner":{backgroundColor:t.corner||t.thumb}};return oo.getOS()===oo.OSType.Firefox&&(n["* .pseudo-scrollbar"]={scrollbarColor:`${t.thumb} transparent`},n["* .pseudo-scrollbar:hover:not([disabled])"]={scrollbarColor:`${t.active} transparent`}),n}const cp=s.memo(s.forwardRef((e,t)=>{const{open:n,anchorEl:o,anchorPosition:r,label:i,floatReference:l,createPopupPanel:d=_n,popperProps:c,onMount:u,onClosing:p,onClose:f,onOpening:h,onOpen:m,children:g,sx:x,...y}=e,v=fn(p,[p]),b=fn(f,[f]),C=fn(h,[h]),k=fn(m,[m]),[E,R]=s.useState(),j=s.useRef(null),B=fn((_,w)=>{R(_),u?.(j.current,w)},[u]),T=s.useMemo(()=>{const _={popupContainer:E,floatReference:l,children:g,...y},w=d(_);return a.jsx(V.Paper,{elevation:8,ref:j,sx:{display:"flex",overflow:"auto",outline:"none","&.MuiPaper-root":S=>J2(S)},tabIndex:0,children:w})},[d,g,E,l]);return a.jsx(sp,{ref:t,anchorEl:o,anchorPosition:r,label:i,open:n,onMount:B,onOpening:C,onOpen:k,onClosing:v,onClose:b,...c,children:T})}));cp.displayName="ExhibitFloatPanel";const T0=new Map;let Lc=null;const j0=new Map;let h0=null;const Oc=(e=null,t,n,o)=>(h0&&(h0.fn.clear(),h0=null),e===0?t:(e===null&&(e=120),h0={fn:oo.debounce(()=>t(),e),setReferences:n,isClose:o},h0.fn)),dp=(e,t)=>{if(t===null)return;e.add(t);const n=T0.get(t.key);if(!n)return;const o=j0.get(n);o&&dp(e,o)},d6=e=>{const t=new Set;return dp(t,e),t},i0=e=>{const{anchor:t,label:n=null,parentFloat:o=null,onOpen:r,onClose:i,popperProps:l,createPopupPanel:d=_n}=e??{},c=fn(r,[r]),u=fn(i,[i]),[p,f]=s.useState(null),[h,m]=s.useState(!1),[g,x]=s.useState(!1),y=s.useMemo(()=>o===null?(Lc===null&&(Lc={key:{label:"root"},isRoot:!0,parent:null,open:()=>null,close:F=>null,closeChild:F=>null,onChildVisible:()=>{},onChildHidden:()=>{},closeAll:()=>A(0),floatElement:()=>null,anchorElement:()=>null}),Lc):o,[]),v=s.useMemo(()=>({label:n}),[]),b=s.useRef(null),C=s.useRef(t);s.useEffect(()=>{C.current=t},[t]);const k=F=>{const X=T0.get(F);let K=null;return X&&(K=j0.get(X)?.close(0)),K},E=()=>k(N.key),[R,j]=s.useState(),B=()=>{if(!p)return void S();const F=new Promise((X,K)=>{j(ne=>({resolve:X,reject:K}))});return E(),T0.delete(y.key),f(!1),F};s.useEffect(()=>{R&&(R.resolve(),j(null))},[h,g,R]);const T=s.useCallback(()=>{let F=y;for(;F.parent;)F=F.parent;return k(F.key)},[]),_=()=>{if(p)return void S();y&&j0.get(y.key)?.open(0);const F=T0.get(y.key);F&&F!==v&&j0.get(F)?.close(0),requestAnimationFrame(()=>{T0.set(y.key,N.key),f(!0)})},[w,S]=s.useReducer(F=>F+1,0),O=s.useCallback(F=>d===null?null:d({closeFloat:A,closeFloatAll:L,...F}),[d]),P=d===null,M=fn((F=120)=>Oc(F,_,new Set([N]),!1)(),[_]),A=fn((F=60)=>Oc(F,B,d6(N),!0)(),[B]),D=fn((F=360)=>Oc(F,E,d6((X=>{const K=T0.get(X.key);return K&&j0.get(K)||null})(N)),!0)(),[E]),L=fn(T,[T]),N=s.useMemo(()=>({key:v,isRoot:!1,label:n,parent:y,onChildVisible:()=>{x(!0)},onChildHidden:()=>{x(!1)},open:M,close:A,closeChild:D,closeAll:L,floatElement:()=>b.current,anchorElement:()=>C.current}),[]);s.useEffect(()=>{j0.set(v,N)},[N]),s.useEffect(()=>()=>{j0.delete(v),A(0)},[]),s.useEffect(()=>{p&&!P&&(m(!0),y.onChildVisible())},[p,P]);const W=s.useCallback(F=>{F.which===Bo.Escape&&(F.preventDefault(),F.stopPropagation(),A(0))},[]),I=s.useRef(null),U=s.useCallback(()=>{const F=I.current,X=b.current;F&&X&&(requestAnimationFrame(()=>{(X.contains(document.activeElement)||document.activeElement===document.body)&&F.focus()}),I.current=null),u?.()},[]),G=s.useCallback(F=>{b.current=F,F.addEventListener("focus",K=>{I.current=K.relatedTarget},{once:!0,passive:!0});const X=document.activeElement;requestAnimationFrame(()=>{X===document.activeElement&&F.focus()})},[]),[Q,H]=s.useState();s.useEffect(()=>{P&&(p?c?.():p===!1&&u?.()),H(h?a.jsx(cp,{floatReference:N,open:p,label:n,anchorEl:t,onOpening:()=>{c?.(),y.onChildVisible()},onClosing:U,onClose:()=>{m(!1),y.onChildHidden()},onMount:G,popperProps:{onKeyDown:W,onMouseEnter:F=>{p&&h0?.isClose&&h0.setReferences.has(N)&&(h0.fn.clear(),h0=null,N.closeChild())},...l},createPopupPanel:O}):null)},[h,p,n,P,l,O,w]);const $=fn(F=>{if(T0.size===0)return;let X=!1;T0.forEach(K=>{const ne=j0.get(K);!X&&ne&&(ne.floatElement()?.contains?.(F.target)&&(X=!0),ne.anchorElement()?.contains?.(F.target)&&(X=!0))}),X||T()},[T]);return s.useEffect(()=>{if(!p||!y.isRoot)return;const F=X=>{$(X)};return document.addEventListener("mousedown",F),document.addEventListener("touchstart",F),document.addEventListener("focus",F),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("touchstart",F),document.removeEventListener("focus",F)}},[p,y]),{component:Q,reference:N}},wv=s.memo(s.forwardRef((e,t)=>{const{nestedChildren:n,variant:o,disabled:r=!1,createPopupPanel:i,...l}=e,d={disabled:r,createPopupPanel:fn(c=>{if(!n||n.length===0)return null;const{popupContainer:u,floatReference:p,...f}=c,h=[];for(let m=0;m<n.length;m++){const g=n[m];g&&h.push(a.jsx(wv,{parentFloat:p,...f,...g},m))}return a.jsxs(V.Box,{ref:t,sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:["Children here",h,a.jsx(sr,{parentFloat:p,children:"Close other children"})]})},[n]),...l};return a.jsx(o===Ir.Toolbar?Ur:Pa,{...d})})),Sv={placement:"right-start"},up=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,createPopupPanel:i,popperProps:l=Sv,label:d,...c}=e;(function(y){if(!y)throw new Error("Invariant failed")})(s.isValidElement(n));const u=n,p=s.useMemo(()=>({...u?.props,...c,onContextMenu:y=>{u?.props?.onContextMenu?.(y),y.isDefaultPrevented()||(c?.onContextMenu?.(y),y.isDefaultPrevented()||(m(y),y.preventDefault()))}}),[c,u?.props]),f=fn(i,[i]),[h,m]=s.useState(null),{reference:g,component:x}=i0({label:d??"contextMenu",popperProps:l,parentFloat:r,anchor:{getBoundingClientRect:()=>new DOMRect(h?.clientX||0,h?.clientY||0)},onClose:()=>m(null),createPopupPanel:f});return s.useEffect(()=>{h?g.open(0):g.close(0)},[h]),a.jsxs(a.Fragment,{children:[s.cloneElement(n,p),x]})})),vr=s.forwardRef((e,t)=>{const{slotProps:n,...o}=e,{getPortalContainer:r}=U2();return a.jsx(V.Tooltip,{ref:t,slotProps:{...n,popper:{container:r,...n?.popper||{}}},...o})});vr.displayName="SimpleTooltip";const _l=s.memo(e=>{const{modifier:t,sx:n,...o}=e;return a.jsx(V.Box,{sx:{marginLeft:"1px",marginRight:"1px",borderRadius:"4px",borderStyle:"solid",borderTopWidth:"1px",borderLeftWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"2px",borderTopColor:r=>gt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderLeftColor:r=>gt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderRightColor:r=>gt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderBottomColor:r=>gt.alpha(r.palette.background.paper,1-r.palette.action.disabledOpacity),backgroundColor:r=>gt.alpha(r.palette.action.hover,r.palette.action.disabledOpacity),paddingLeft:"4px",paddingRight:"4px",minHeight:"1.6em",display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"content-box",overflow:"hidden",...n},...o,children:a.jsx(V.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center","& *":{fontWeight:"500"}},children:t})})}),Cv=oo.getOS()===oo.OSType.MacOS||oo.getOS()===oo.OSType.IOS?"Cmd":"Ctrl",Q2=(e,t=!1,n=null)=>{if(Array.isArray(e)){let i=[],l=e;for(let d=0;d<l.length;d++)i.push(Q2(l[d],t,n??""+d));return a.jsx(V.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:i},n)}if(!e?.key)return null;const o={};for(let i=0;e.modifiers&&i<e.modifiers.length;i++)o[e.modifiers[i]]=!0;const r=[];return o?.ctrl&&(r.push(a.jsx(_l,{modifier:t?"^":a.jsx("div",{style:{paddingRight:"1px"},children:Cv})},"ctrl")),r.push("+")),o?.alt&&(r.push(a.jsx(_l,{modifier:t?"⌥":"Alt"},"alt")),r.push("+")),o?.shift&&(r.push(a.jsx(_l,{modifier:t?"⇧":a.jsx("div",{style:{paddingRight:"1px"},children:"Shift"})},"shift")),r.push("+")),o?.meta&&(r.push(a.jsx(_l,{modifier:t?a.jsx("div",{style:{paddingTop:"1px"},children:"⌘"}):"Meta"},"meta")),r.push("+")),r.push(a.jsx(_l,{modifier:Dy.toPrettyKeyCode(e.key)},"character")),a.jsx(V.Box,{sx:{display:"flex",alignItems:"center"},children:r},n)},No=s.memo(s.forwardRef((e,t)=>{const{disabled:n=!1,label:o,shortcut:r,chips:i,description:l,maxWidth:d=280,useModifierSymbols:c=!1,children:u,simple:p,componentDisabled:f=!1,sx:h,...m}=e;let g=null;return r&&(g=Q2(r,c)),a.jsx(vr,{slotProps:{popper:{sx:{"& .MuiTooltip-tooltip":{marginTop:"0px !important"},...h},modifiers:[{name:"offset",options:{offset:[0,14]}}]}},className:"tooltip-wrapper",tabIndex:-1,title:!n&&o?a.jsxs(V.Box,{sx:{maxWidth:`${d}px`},ref:t,children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",marginBottom:l?"4px":"0px"},children:[a.jsx(V.Typography,{variant:"subtitle1",component:"div",flex:"1 1 100%",children:o}),i?a.jsx(ep,{chips:i}):null,g?a.jsx(V.Box,{sx:{marginLeft:"8px"}},"leadingSpace"):a.jsx(a.Fragment,{}),g]}),l?a.jsx(V.Typography,{variant:"caption",sx:{whiteSpace:"pre-line",lineHeight:"1.4"},children:l}):a.jsx(a.Fragment,{})]}):"",enterDelay:260,enterNextDelay:130,leaveDelay:230,disableInteractive:!0,...m,children:a.jsx("div",{style:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},children:u})})})),z1=a.jsx(Gi,{}),kv=ye(a.jsx(R2,{})),xr=s.memo(s.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,disableHover:r=!1,parentFloat:i,selected:l,icon:d,tooltipProps:c,children:u,primary:p,sx:f,className:h,onFocus:m,onBlur:g,...x}=e,[y,v]=s.useState(!1),b={marginRight:"0px",padding:n?"2px":"7px",borderRadius:j=>`${j.shape.borderRadius}px`,color:j=>p?void 0:j.palette.text.icon??j.palette.action.active,border:j=>`solid ${o?j.palette.divider:"transparent"} 1px`,"& .MuiTouchRipple-child":{borderRadius:j=>`${j.shape.borderRadius}px !important`},"&.Mui-selected":{backgroundColor:j=>gt.alpha(j.palette.text.primary,j.palette.action.selectedOpacity),border:j=>`solid ${o?j.palette.text?.primary:j.palette.divider} 1px`},"&.Mui-disabled":{border:j=>`solid ${o?j.palette.divider:"transparent"} 1px`},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},"&.Mui-focusVisible":{outline:"solid transparent 1px",border:"1px solid transparent"},...f},C={"&:hover:not(.Mui-disabled, [disabled])":{color:j=>j.palette.text.primary,border:j=>`solid ${o?j.palette.text?.primary:j.palette.divider} 1px`,"&.Mui-selected":{backgroundColor:j=>gt.alpha(j.palette.text.primary,j.palette.action.selectedOpacity+j.palette.action.hoverOpacity)},"> .outline-hover":{outline:j=>`solid ${o?j.palette.text?.primary:j.palette.divider} 1px`},backgroundColor:null},"&.Mui-focusVisible":{outline:j=>`solid ${j.palette.primary.main} 1px`,border:j=>`1px solid ${j.palette?.primary?.main}`,zIndex:1}};let k=b;r||(k=oo.mergeContentful(b,C));const E=s.useMemo(()=>{let j=typeof d=="function"?d():d;return j===null?j:j||(l===void 0?z1:kv)},[d,l]);let R=a.jsxs(V.IconButton,{component:"div",ref:t,className:Mo({"Mui-focusVisible":y,"Mui-selected":l},h),onFocus:j=>{v(!0),m?.(j)},onBlur:j=>{v(!1),g?.(j)},size:"small",TouchRippleProps:{center:!1},sx:k,edge:"end",...x,children:[E,u]});if(c)if(c.simple&&c.label&&!c.disabled){const{label:j,description:B,maxWidth:T,shortcut:_,useModifierSymbols:w,componentDisabled:S,simple:O,chips:P,...M}=c;R=a.jsx(vr,{disableInteractive:!0,title:j??"",...M,children:a.jsx(V.Box,{sx:{display:"flex"},children:R})})}else R=a.jsx(No,{children:R,...c});return R})),Ev=e=>e.icon,sr=s.memo(s.forwardRef((e,t)=>{const{icon:n=z1,renderIcon:o=Ev,parentFloat:r,className:i,onFocus:l,selected:d,onBlur:c,onMouseOver:u,onMouseOut:p,onMouseEnter:f,disabled:h,children:m,sx:g,tooltipProps:x,chips:y,primary:v,...b}=e,[C,k]=s.useState(!1),[E,R]=s.useState(!1),j=s.useMemo(()=>{const T=o?.({icon:n,disabled:h,selected:d});return T?a.jsx(V.ListItemIcon,{className:Mo({"Mui-focusVisible":C,"Mui-hovered":E}),sx:{"& .MuiSvgIcon-root":{color:_=>v?void 0:_.palette.text.icon??_.palette.action.active},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{"& .MuiSvgIcon-root":{color:_=>_.palette.text.primary}}},children:T}):null},[o,h,n,C,E,v,d]);let B=a.jsxs(V.MenuItem,{ref:t,disabled:h,onMouseOver:T=>{u?.(T),T.isDefaultPrevented()||R(!0)},onMouseOut:T=>{p?.(T),T.isDefaultPrevented()||R(!1)},onMouseEnter:T=>{f?.(T),T.isDefaultPrevented()||r?.closeChild()},TouchRippleProps:{center:!1},className:Mo({"Mui-focusVisible":C,"Mui-hovered":E},i),onFocus:T=>{l?.(T),k(!0)},onBlur:T=>{c?.(T),k(!1)},sx:{flex:"1 1 100%","&.Mui-disabled path.styled":{filter:"grayscale(65%)"},"&.Mui-selected":{color:T=>T.palette.text.primary},color:T=>T.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:T=>T.palette.text.primary},...g},...b,children:[j,m,y?a.jsx(ep,{chips:y}):null]});return x&&(B=a.jsx(No,{children:B,placement:"right-start",...x})),B})),Ji=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,primary:r=!1,variant:i="subtitle1",...l}=e;return a.jsx(a.Fragment,{children:a.jsx(V.Typography,{ref:t,variant:i,component:"div",sx:{userSelect:"none",fontWeight:"500",paddingLeft:"8px",paddingTop:i==="subtitle1"?"2px":void 0,paddingBottom:i==="subtitle1"?"2px":void 0,color:d=>r?void 0:d.palette.text.secondary,...o},...l,children:n})})})),Ur=s.memo(s.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,label:r,selected:i=!1,onQuickClick:l,parentFloat:d,createPopupPanel:c,popupProps:u,onPopupOpen:p,onPopupClose:f,quickButtonProps:h,createQuickButton:m,tooltip:g="",createTooltip:x,icon:y,disabled:v,buttonProps:b=oo.EmptyObject,disableHover:C,touchRippleRef:k,primary:E,children:R,sx:j,className:B,...T}=e,_=N2(),w=s.useMemo(()=>{const ee=(pe,Te,Ae,ae=Ae)=>{const he=typeof o=="boolean"?null:o[pe];return typeof he=="function"?he(Te):he||(o?Ae:ae)};return{outline:{color:pe=>ee("color",pe,pe.palette.divider,"transparent"),hoverColor:pe=>ee("hoverColor",pe,pe.palette.text?.primary,pe.palette.divider),focusColor:pe=>ee("focusColor",pe,pe.palette?.primary?.main)},active:_.palette.mode==="dark"?_.palette.text.secondary:_.palette.text.primary,text:_.palette.text.icon??_.palette.action.active}},[o,_]),[S,O]=s.useState(!1),[P,M]=s.useState(!1),[A,D]=s.useState(!1),L=s.useRef(null),N=s.useRef(null),W=i0({anchor:L.current,label:r,createPopupPanel:c,parentFloat:d,popperProps:u?.popperProps,onClose:()=>{O(!1),f?.()},onOpen:()=>{O(!0),p?.()}}),I=fn(ee=>{l?.(ee),W.reference.close(0)},[l,W]),U=fn(()=>{S?W.reference.close(0):W.reference.open(0)},[S,W,d,r]),G=s.useMemo(()=>{const ee={"&.bordered":{borderWidth:"1px",borderRadius:"0px",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:we=>w.outline.color(we),"&.Mui-focusVisible":{border:we=>`1px solid ${w.outline.focusColor(we)} !important`},"&:hover:not(.Mui-disabled, [disabled])":{borderColor:()=>C?"transparent":void 0,backgroundColor:()=>C?"transparent":void 0},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{borderColor:we=>w.outline.hoverColor(we)},"&.Mui-selected:not(.Mui-disabled, [disabled])":{borderColor:we=>w.outline.hoverColor(we)},"&.left":{borderTopLeftRadius:we=>`${we.shape.borderRadius}px`,borderBottomLeftRadius:we=>`${we.shape.borderRadius}px`,borderLeftStyle:"solid"},"&.hard-right":{borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:we=>w.outline.color(we)},"&.right":{borderTopRightRadius:we=>`${we.shape.borderRadius}px`,borderBottomRightRadius:we=>`${we.shape.borderRadius}px`,borderRightStyle:"solid"},"&.divider":{borderLeftWidth:"0px !important"}},"& .MuiTouchRipple-child":{borderRadius:we=>`${we.shape.borderRadius}px !important`}},pe={"&.Mui-selected":{backgroundColor:we=>gt.alpha(we.palette.primary.main,we.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:we=>gt.alpha(we.palette.primary.main,we.palette.action.selectedOpacity+we.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:we=>gt.alpha(we.palette.primary.main,we.palette.action.selectedOpacity)}}}},Te={maxHeight:"100%","&.Mui-selected":{backgroundColor:we=>gt.alpha(we.palette.text.icon??we.palette.action.active,we.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:we=>gt.alpha(we.palette.text.icon??we.palette.action.active,we.palette.action.selectedOpacity+we.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:we=>gt.alpha(we.palette.text.icon??we.palette.action.active,we.palette.action.selectedOpacity)}}},"&:hover:not(.Mui-disabled, [disabled])":{color:we=>we.palette.text.primary},backgroundColor:()=>C?"transparent":void 0,color:we=>we.palette.text.icon,"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},padding:()=>n?"2px 3px":"7px",marginRight:"0"},Ae=oo.mergeContentful(Te,ee),ae=oo.mergeContentful(Ae,pe),he=oo.mergeContentful(Te,ee);return{quickButtonStyling:Ae,openQuickButtonStyling:ae,compoundStyling:he,openCompoundStyling:oo.mergeContentful(he,pe)}},[w,C]),Q=fn(ee=>{const{children:pe,...Te}=ee;return a.jsx(vr,{...Te,disableInteractive:!0,children:pe})},[]),H=l||m,$=H&&(h?.tooltip||h?.createTooltip),F=ee=>{const{tooltip:pe,createTooltip:Te,sx:Ae,...ae}=ee;let he=a.jsx(V.IconButton,{sx:{...Ae},component:"div",...ae});return $&&(he=(Te??Q)({title:S?"":pe??g,children:a.jsx("div",{children:he})},S)),he},X={onKeyDown:ee=>{ee.keyCode===Bo.Space?U():ee.keyCode===Bo.F4||ee.keyCode===Bo.Down?W.reference.open(0):ee.keyCode===Bo.Up&&W.reference.close(0)}};let K=a.jsx(a.Fragment,{});const ne=s.useMemo(()=>typeof y=="function"?y():y,[y]);if(H){let ee=S?G.openQuickButtonStyling:G.quickButtonStyling;const pe=(m||F)({tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseEnter:()=>{W.reference.parent.closeChild()},onMouseDown:Ae=>{Ae.button===0&&(Ae.preventDefault(),I(Ae))},touchRippleRef:k,children:ne,...h,className:Mo({"Mui-focusVisible":P||S,"Mui-selected":i,"Mui-hovered":A||S,"Mui-disabled":v,bordered:!0,left:!0,"hard-right":!0},h?.className),sx:{...G.quickButtonStyling,height:"100%",...h?.sx}});let Te=c6(!0,n,S);$&&(Te=(x??Q)({title:S?"":g,children:Te},S)),K=a.jsxs(a.Fragment,{children:[pe,a.jsx(V.IconButton,{ref:N,component:"div",className:Mo({"Mui-selected":S,"Mui-hovered":A||S,"Mui-disabled":v,"Mui-focusVisible":P||S,bordered:!0,right:!0,divider:!0}),sx:{paddingLeft:(n?0:2)+"px",paddingRight:(n?0:2)+"px",width:()=>"1em",...G.quickButtonStyling,...ee},TouchRippleProps:{center:!1},tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseDown:Ae=>{Ae.button===0&&(Ae.preventDefault(),U())},children:Te})]})}else{let ee=S?G.openCompoundStyling:G.compoundStyling;K=a.jsx(xr,{ref:N,tabIndex:-1,disabled:v,size:"small",icon:ne,className:Mo({"Mui-selected":S||i,"Mui-hovered":A,"Mui-disabled":v,"Mui-focusVisible":P||S,bordered:!0,left:!0,right:!0}),sx:{...G.quickButtonStyling,...ee},onMouseDown:pe=>{pe.button===0&&(pe.preventDefault(),U())},children:c6(!1,n,S)})}const{className:J,sx:re,...fe}=b;let ie=a.jsx(V.Box,{onFocus:()=>M(!0),onBlur:()=>M(!1),onMouseOver:()=>D(!0),onMouseOut:()=>D(!1),...X,"aria-label":"split button",ref:L,tabIndex:v?void 0:0,className:Mo(J,"split-button-root",{"Mui-focusVisible":P||S,"Mui-selected":S||i,"Mui-hovered":A,"Mui-disabled":v}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","&:not(.Mui-disabled)":{cursor:"pointer"},marginLeft:o?"1px":"0px",marginRight:o?"1px":"0px",borderRadius:ee=>`${ee.shape.borderRadius}px`,"&.Mui-focusVisible":{outline:ee=>`solid ${ee.palette.primary.main} 1px`,zIndex:2},...re},...fe,children:K});return $||(ie=(x??Q)({title:S?"":g,children:ie},S)),a.jsxs(V.Box,{className:Mo(B,"popupIconButton"),ref:t,...T,sx:{zIndex:P||S?2:void 0,display:"flex",alignItems:"center",...j},children:[ie,W.component]})}));Ur.displayName="ExhibitPopupIconButton";const _v={},Pa=s.memo(s.forwardRef((e,t)=>{const{selected:n=!1,label:o,onQuickClick:r,parentFloat:i,createPopupPanel:l,popupProps:d=_v,onPopupOpen:c,onPopupClose:u,quickButtonProps:p,createQuickButton:f,tooltip:h="",createTooltip:m,icon:g,disabled:x,touchRippleRef:y,primary:v,children:b,sx:C,...k}=e,[E,R]=s.useState(!1),[j,B]=s.useState(!1),[T,_]=s.useState(!1),[w,S]=s.useState(!1),O=s.useRef(null),P=s.useRef(null),M=s.useMemo(()=>{if(!d)return;const{popperProps:$}=d;return{placement:"right-start",offsets:[-4,-2],...$}},[d]),A=i0({anchor:O.current,label:o,createPopupPanel:l,parentFloat:i,popperProps:M,onClose:()=>{R(!1),u?.()},onOpen:()=>{R(!0),c?.()}}),D=fn($=>{$.button===0&&(r?.($),A.reference.close(0))},[r]),L=a.jsx(wn.ArrowRight,{sx:{transform:()=>{}}}),N={"&.Mui-selected":{color:$=>$.palette.text.primary,"& svg * ":{color:$=>$.palette.text.primary}}},W=s.useCallback($=>{const{children:F,...X}=$;return a.jsx(vr,{...X,disableInteractive:!0,children:F})},[]),I=r||f,U=$=>{const{tooltip:F,createTooltip:X,...K}=$;return a.jsx(sr,{icon:g,className:Mo({"Mui-hovered":T}),sx:{flex:"1 1 100%",...N},...K,children:o})},G={onFocus:()=>{B(!0)},onBlur:()=>B(!1),onMouseOver:()=>{_(!0)},onMouseLeave:()=>{_(!1)},onMouseEnter:()=>{A.reference.open()},onMouseDown:$=>{$.button===0&&$.preventDefault()}};let Q=a.jsx(a.Fragment,{});if(I){const $=(f||U)({tabIndex:-1,disabled:x,onMouseEnter:()=>{A.reference.parent.closeChild()},onMouseDown:F=>{F.button===0&&(F.preventDefault(),D(F))},className:Mo("quick-left",{},p?.className),...p});Q=a.jsxs(a.Fragment,{children:[$,a.jsx(V.Divider,{sx:{ml:"0px",mr:"0px"},orientation:"vertical",variant:"middle",flexItem:!0}),a.jsx(V.MenuItem,{ref:P,className:Mo({"Mui-selected":E,"Mui-hovered":T}),sx:{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px",paddingLeft:"0px",paddingRight:"0px",marginLeft:"0px",color:F=>v?void 0:F.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:F=>F.palette.text.primary},...N},tabIndex:-1,disabled:x,...G,children:a.jsx(V.Box,{className:"expand-icon",sx:{flex:"none",display:"flex",border:"1px solid transparent",paddingTop:"1px",paddingBottom:"1px",color:F=>v?void 0:F.palette.text.icon??F.palette.action.active},onMouseOver:F=>{F.preventDefault(),S(!0)},onMouseLeave:()=>{S(!1)},onClick:F=>{F.preventDefault(),E?A.reference.close():A.reference.open()},children:L})})]})}else Q=a.jsxs(sr,{ref:P,tabIndex:-1,disabled:x,icon:g,className:Mo({"Mui-selected":E||n,"Mui-hovered":T}),sx:{flex:"1 1 100%",paddingRight:"0px",...N},onClick:$=>{$.preventDefault(),E?A.reference.close():A.reference.open()},...G,children:[a.jsx("div",{style:{flex:"1 1 100%"},children:o}),a.jsx(V.Box,{className:"expand-icon2",sx:{flex:"none",display:"flex",color:$=>v?void 0:$.palette.text.icon??$.palette.action.active},children:L})]});let H=a.jsx(V.Box,{"aria-label":"split button",ref:O,tabIndex:x?void 0:0,className:Mo({"Mui-disabled":x,"Mui-selected":E,"Mui-focusVisible":j||E,"Mui-hovered":T}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","& .quick-left":{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",marginRight:"-1px"},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},...C},...k,children:Q});return I&&!w&&(p?.tooltip||p?.createTooltip)&&(H=(p?.createTooltip??W)({title:E?"":H??p?.tooltip,children:H},E)),a.jsxs(V.Box,{ref:t,sx:{zIndex:j||E?2:void 0,display:"flex"," .tooltip-wrapper":{display:"flex",flex:"1 1 100%"}},children:[H,A.component]})})),hp=s.memo(s.forwardRef((e,t)=>{const{onSelectToggle:n,selected:o=!1,label:r,shortcut:i,tabIndex:l=0,preventFocus:d=!1,...c}=e;return a.jsx(No,{label:r,shortcut:i,children:a.jsx(xr,{ref:t,outlined:!1,tabIndex:l,selected:o,onMouseDown:u=>{d&&u.preventDefault()},onClick:()=>{n?.(!o)},...c})})})),Aa=s.memo(s.forwardRef((e,t)=>{const{children:n,selected:o=!0,outlined:r=!0,sx:i,...l}=e,d={display:"flex",border:u=>o?`solid ${r?u.palette.divider:"transparent"} 1px`:"solid transparent 1px",borderRadius:u=>`${u.shape.borderRadius}px`,backgroundColor:u=>{if(o)return gt.alpha(u.palette.text.icon??u.palette.action.active,u.palette.action.selectedOpacity)}};let c=n;return c===null&&(c=a.jsx(Gi,{})),c||(c=a.jsx(R2,{})),c=ye(c),a.jsx(V.Box,{ref:t,sx:{...d,...i},...l,children:c})}));function qo(){return qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},qo.apply(null,arguments)}function pp(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}var Mr,wi,Tv={state:{},updateModal:function(){},hideModal:function(){},destroyModal:function(){},destroyModalsByRootId:function(){},showModal:function(){return{id:"id",hide:function(){},destroy:function(){},update:function(){}}}},fp=s.createContext(void 0);(wi=Mr||(Mr={})).SHOW="SHOW",wi.HIDE="HIDE",wi.UPDATE="UPDATE",wi.DESTROY="DESTROY",wi.DESTROY_BY_ROOT_ID="DESTROY_BY_ROOT_ID",wi.UNKNOWN="UNKNOWN";var jv={};function Mv(e,t){switch(t.type){case Mr.SHOW:var n,o=t.payload,r=o.id,i=o.component,l=o.props,d=o.options;return qo({},e,((n={})[r]={component:i,props:qo({},l,{open:!0}),options:d},n));case Mr.HIDE:var c,u=t.payload.id;return e[u]?qo({},e,((c={})[u]=qo({},e[u],{props:qo({},e[u].props,{open:!1})}),c)):e;case Mr.UPDATE:var p,f=t.payload,h=f.id,m=f.props;return e[h]?qo({},e,((p={})[h]=qo({},e[h],{props:qo({},e[h].props,m)}),p)):e;case Mr.DESTROY:var g=t.payload.id,x=qo({},e);return delete x[g],x;case Mr.DESTROY_BY_ROOT_ID:var y=t.payload.rootId;return Object.keys(e).filter(function(v){return v.split(".")[0]!==y}).reduce(function(v,b){var C;return qo({},v,((C={})[b]=e[b],C))},{});default:throw new Error("Unexpected action")}}var Pc="[ERROR]: Modal ID is missing",mp=function(e){e===void 0&&(e=8);for(var t=[],n=0;n<e;n++)t[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t.join("")},Rv=["open"],Iv=["showModal","destroyModalsByRootId"],u6={disableAutoDestroy:!1};function ds(e){e===void 0&&(e=u6);var t=qo({},u6,e).disableAutoDestroy,n=s.useContext(fp)||Tv,o=n.showModal,r=n.destroyModalsByRootId,i=pp(n,Iv),l=s.useRef(mp(6));return s.useEffect(function(){return function(){!t&&r&&r(l.current)}},[t,r]),qo({showModal:s.useCallback(function(d,c,u){return o(d,c,qo({rootId:l.current,hideOnClose:!0},u))},[o]),destroyModalsByRootId:r},i)}var gp=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],s1=gp.join(","),xp=typeof Element>"u",oi=xp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ns=!xp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},c1=function e(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert");return r===""||r==="true"||n&&t&&e(t.parentNode)},yp=function(e,t,n){if(c1(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(s1));return t&&oi.call(e,s1)&&o.unshift(e),o.filter(n)},bp=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!c1(l,!1))if(l.tagName==="SLOT"){var d=l.assignedElements(),c=e(d.length?d:l.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:l,candidates:c})}else{oi.call(l,s1)&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var u=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),p=!c1(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(u&&p){var f=e(u===!0?l.children:u.children,!0,o);o.flatten?r.push.apply(r,f):r.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return r},vp=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},O0=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!vp(e)?0:e.tabIndex},Dv=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wp=function(e){return e.tagName==="INPUT"},h6=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},d1=function(e,t){return!(t.disabled||c1(t)||(n=t,wp(n)&&n.type==="hidden")||function(o,r){var i=r.displayCheck,l=r.getShadowRoot;if(getComputedStyle(o).visibility==="hidden")return!0;var d=oi.call(o,"details>summary:first-of-type")?o.parentElement:o;if(oi.call(d,"details:not([open]) *"))return!0;if(i&&i!=="full"&&i!=="legacy-full"){if(i==="non-zero-area")return h6(o)}else{if(typeof l=="function"){for(var c=o;o;){var u=o.parentElement,p=Ns(o);if(u&&!u.shadowRoot&&l(u)===!0)return h6(o);o=o.assignedSlot?o.assignedSlot:u||p===o.ownerDocument?u:p.host}o=c}if(function(f){var h,m,g,x,y=f&&Ns(f),v=(h=y)===null||h===void 0?void 0:h.host,b=!1;if(y&&y!==f)for(b=!!((m=v)!==null&&m!==void 0&&(g=m.ownerDocument)!==null&&g!==void 0&&g.contains(v)||f!=null&&(x=f.ownerDocument)!==null&&x!==void 0&&x.contains(f));!b&&v;){var C,k,E;b=!((k=v=(C=y=Ns(v))===null||C===void 0?void 0:C.host)===null||k===void 0||(E=k.ownerDocument)===null||E===void 0||!E.contains(v))}return b}(o))return!o.getClientRects().length;if(i!=="legacy-full")return!0}return!1}(t,e)||function(o){return o.tagName==="DETAILS"&&Array.prototype.slice.apply(o.children).some(function(r){return r.tagName==="SUMMARY"})}(t)||function(o){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(o.tagName))for(var r=o.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var l=r.children.item(i);if(l.tagName==="LEGEND")return!!oi.call(r,"fieldset[disabled] *")||!l.contains(o)}return!0}r=r.parentElement}return!1}(t));var n},Xd=function(e,t){return!(function(n){return wp(o=n)&&o.type==="radio"&&!function(r){if(!r.name)return!0;var i,l=r.form||Ns(r),d=function(u){return l.querySelectorAll('input[type="radio"][name="'+u+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")i=d(window.CSS.escape(r.name));else try{i=d(r.name)}catch(u){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",u.message),!1}var c=function(u,p){for(var f=0;f<u.length;f++)if(u[f].checked&&u[f].form===p)return u[f]}(i,r.form);return!c||c===r}(n);var o}(t)||O0(t)<0||!d1(e,t))},Lv=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ov=function e(t){var n=[],o=[];return t.forEach(function(r,i){var l,d,c,u=!!r.scopeParent,p=u?r.scopeParent:r,f=(d=u,(c=O0(l=p))<0&&d&&!vp(l)?0:c),h=u?e(r.candidates):p;f===0?u?n.push.apply(n,h):n.push(p):o.push({documentOrder:i,tabIndex:f,item:r,isScope:u,content:h})}),o.sort(Dv).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Sp=function(e,t){var n;return n=(t=t||{}).getShadowRoot?bp([e],t.includeContainer,{filter:Xd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Lv}):yp(e,t.includeContainer,Xd.bind(null,t)),Ov(n)},Cp=function(e,t){return(t=t||{}).getShadowRoot?bp([e],t.includeContainer,{filter:d1.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):yp(e,t.includeContainer,d1.bind(null,t))},G0=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return oi.call(e,s1)!==!1&&Xd(t,e)},Pv=gp.concat("iframe").join(","),Vs=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return oi.call(e,Pv)!==!1&&d1(t,e)};const Av=Object.freeze(Object.defineProperty({__proto__:null,focusable:Cp,getTabIndex:O0,isFocusable:Vs,isTabbable:G0,tabbable:Sp},Symbol.toStringTag,{value:"Module"}));function Ac(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function Fv(e,t,n){return(t=function(o){var r=function(i,l){if(typeof i!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var c=d.call(i,l);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function f6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p6(Object(n),!0).forEach(function(o){Fv(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p6(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}var ta=function(e){return e?.key==="Tab"||e?.keyCode===9},zv=function(e){return ta(e)&&!e.shiftKey},Bv=function(e){return ta(e)&&e.shiftKey},m6=function(e){return setTimeout(e,0)},Tl=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return typeof e=="function"?e.apply(void 0,n):e},us=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Nv=[];const Vv=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(e,t){var n,o=t?.document||document,r=t?.trapStack||Nv,i=f6({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:zv,isKeyBackward:Bv},t),l={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},d=function(T,_,w){return T&&T[_]!==void 0?T[_]:i[w||_]},c=function(T,_){var w=typeof _?.composedPath=="function"?_.composedPath():void 0;return l.containerGroups.findIndex(function(S){var O=S.container,P=S.tabbableNodes;return O.contains(T)||w?.includes(O)||P.find(function(M){return M===T})})},u=function(T){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=_.hasFallback,S=w!==void 0&&w,O=_.params,P=O===void 0?[]:O,M=i[T];if(typeof M=="function"&&(M=M.apply(void 0,function(D){return function(L){if(Array.isArray(L))return Ac(L)}(D)||function(L){if(typeof Symbol<"u"&&L[Symbol.iterator]!=null||L["@@iterator"]!=null)return Array.from(L)}(D)||function(L,N){if(L){if(typeof L=="string")return Ac(L,N);var W={}.toString.call(L).slice(8,-1);return W==="Object"&&L.constructor&&(W=L.constructor.name),W==="Map"||W==="Set"?Array.from(L):W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W)?Ac(L,N):void 0}}(D)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
35
35
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}(P))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(T,"` was specified but was not a node, or did not return a node"))}var A=M;if(typeof M=="string"){try{A=o.querySelector(M)}catch(D){throw new Error("`".concat(T,'` appears to be an invalid selector; error="').concat(D.message,'"'))}if(!A&&!S)throw new Error("`".concat(T,"` as selector refers to no known node"))}return A},p=function(){var T=u("initialFocus",{hasFallback:!0});if(T===!1)return!1;if(T===void 0||T&&!Vs(T,i.tabbableOptions))if(c(o.activeElement)>=0)T=o.activeElement;else{var _=l.tabbableGroups[0];T=_&&_.firstTabbableNode||u("fallbackFocus")}else T===null&&(T=u("fallbackFocus"));if(!T)throw new Error("Your focus-trap needs to have at least one focusable element");return T},f=function(){if(l.containerGroups=l.containers.map(function(T){var _=Sp(T,i.tabbableOptions),w=Cp(T,i.tabbableOptions),S=_.length>0?_[0]:void 0,O=_.length>0?_[_.length-1]:void 0,P=w.find(function(D){return G0(D)}),M=w.slice().reverse().find(function(D){return G0(D)}),A=!!_.find(function(D){return O0(D)>0});return{container:T,tabbableNodes:_,focusableNodes:w,posTabIndexesFound:A,firstTabbableNode:S,lastTabbableNode:O,firstDomTabbableNode:P,lastDomTabbableNode:M,nextTabbableNode:function(D){var L=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],N=_.indexOf(D);return N<0?L?w.slice(w.indexOf(D)+1).find(function(W){return G0(W)}):w.slice(0,w.indexOf(D)).reverse().find(function(W){return G0(W)}):_[N+(L?1:-1)]}}}),l.tabbableGroups=l.containerGroups.filter(function(T){return T.tabbableNodes.length>0}),l.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(l.containerGroups.find(function(T){return T.posTabIndexesFound})&&l.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(T){var _=T.activeElement;if(_)return _.shadowRoot&&_.shadowRoot.activeElement!==null?h(_.shadowRoot):_},m=function(T){T!==!1&&T!==h(document)&&(T&&T.focus?(T.focus({preventScroll:!!i.preventScroll}),l.mostRecentlyFocusedNode=T,function(_){return _.tagName&&_.tagName.toLowerCase()==="input"&&typeof _.select=="function"}(T)&&T.select()):m(p()))},g=function(T){var _=u("setReturnFocus",{params:[T]});return _||_!==!1&&T},x=function(T){var _=T.target,w=T.event,S=T.isBackward,O=S!==void 0&&S;_=_||us(w),f();var P=null;if(l.tabbableGroups.length>0){var M=c(_,w),A=M>=0?l.containerGroups[M]:void 0;if(M<0)P=O?l.tabbableGroups[l.tabbableGroups.length-1].lastTabbableNode:l.tabbableGroups[0].firstTabbableNode;else if(O){var D=l.tabbableGroups.findIndex(function(G){var Q=G.firstTabbableNode;return _===Q});if(D<0&&(A.container===_||Vs(_,i.tabbableOptions)&&!G0(_,i.tabbableOptions)&&!A.nextTabbableNode(_,!1))&&(D=M),D>=0){var L=D===0?l.tabbableGroups.length-1:D-1,N=l.tabbableGroups[L];P=O0(_)>=0?N.lastTabbableNode:N.lastDomTabbableNode}else ta(w)||(P=A.nextTabbableNode(_,!1))}else{var W=l.tabbableGroups.findIndex(function(G){var Q=G.lastTabbableNode;return _===Q});if(W<0&&(A.container===_||Vs(_,i.tabbableOptions)&&!G0(_,i.tabbableOptions)&&!A.nextTabbableNode(_))&&(W=M),W>=0){var I=W===l.tabbableGroups.length-1?0:W+1,U=l.tabbableGroups[I];P=O0(_)>=0?U.firstTabbableNode:U.firstDomTabbableNode}else ta(w)||(P=A.nextTabbableNode(_))}}else P=u("fallbackFocus");return P},y=function(T){var _=us(T);c(_,T)>=0||(Tl(i.clickOutsideDeactivates,T)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Tl(i.allowOutsideClick,T)||T.preventDefault())},v=function(T){var _=us(T),w=c(_,T)>=0;if(w||_ instanceof Document)w&&(l.mostRecentlyFocusedNode=_);else{var S;T.stopImmediatePropagation();var O=!0;if(l.mostRecentlyFocusedNode)if(O0(l.mostRecentlyFocusedNode)>0){var P=c(l.mostRecentlyFocusedNode),M=l.containerGroups[P].tabbableNodes;if(M.length>0){var A=M.findIndex(function(D){return D===l.mostRecentlyFocusedNode});A>=0&&(i.isKeyForward(l.recentNavEvent)?A+1<M.length&&(S=M[A+1],O=!1):A-1>=0&&(S=M[A-1],O=!1))}}else l.containerGroups.some(function(D){return D.tabbableNodes.some(function(L){return O0(L)>0})})||(O=!1);else O=!1;O&&(S=x({target:l.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(l.recentNavEvent)})),m(S||l.mostRecentlyFocusedNode||p())}l.recentNavEvent=void 0},b=function(T){(i.isKeyForward(T)||i.isKeyBackward(T))&&function(_){var w=arguments.length>1&&arguments[1]!==void 0&&arguments[1];l.recentNavEvent=_;var S=x({event:_,isBackward:w});S&&(ta(_)&&_.preventDefault(),m(S))}(T,i.isKeyBackward(T))},C=function(T){var _;((_=T)==null?void 0:_.key)!=="Escape"&&_?.key!=="Esc"&&_?.keyCode!==27||Tl(i.escapeDeactivates,T)===!1||(T.preventDefault(),n.deactivate())},k=function(T){var _=us(T);c(_,T)>=0||Tl(i.clickOutsideDeactivates,T)||Tl(i.allowOutsideClick,T)||(T.preventDefault(),T.stopImmediatePropagation())},E=function(){if(l.active)return function(T,_){if(T.length>0){var w=T[T.length-1];w!==_&&w._setPausedState(!0)}var S=T.indexOf(_);S===-1||T.splice(S,1),T.push(_)}(r,n),l.delayInitialFocusTimer=i.delayInitialFocus?m6(function(){m(p())}):m(p()),o.addEventListener("focusin",v,!0),o.addEventListener("mousedown",y,{capture:!0,passive:!1}),o.addEventListener("touchstart",y,{capture:!0,passive:!1}),o.addEventListener("click",k,{capture:!0,passive:!1}),o.addEventListener("keydown",b,{capture:!0,passive:!1}),o.addEventListener("keydown",C),n},R=function(){if(l.active)return o.removeEventListener("focusin",v,!0),o.removeEventListener("mousedown",y,!0),o.removeEventListener("touchstart",y,!0),o.removeEventListener("click",k,!0),o.removeEventListener("keydown",b,!0),o.removeEventListener("keydown",C),n},j=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(function(T){T.some(function(_){return Array.from(_.removedNodes).some(function(w){return w===l.mostRecentlyFocusedNode})})&&m(p())}):void 0,B=function(){j&&(j.disconnect(),l.active&&!l.paused&&l.containers.map(function(T){j.observe(T,{subtree:!0,childList:!0})}))};return n={get active(){return l.active},get paused(){return l.paused},activate:function(T){if(l.active)return this;var _=d(T,"onActivate"),w=d(T,"onPostActivate"),S=d(T,"checkCanFocusTrap");S||f(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=h(o),_?.();var O=function(){S&&f(),E(),B(),w?.()};return S?(S(l.containers.concat()).then(O,O),this):(O(),this)},deactivate:function(T){if(!l.active)return this;var _=f6({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},T);clearTimeout(l.delayInitialFocusTimer),l.delayInitialFocusTimer=void 0,R(),l.active=!1,l.paused=!1,B(),function(A,D){var L=A.indexOf(D);L!==-1&&A.splice(L,1),A.length>0&&!A[A.length-1]._isManuallyPaused()&&A[A.length-1]._setPausedState(!1)}(r,n);var w=d(_,"onDeactivate"),S=d(_,"onPostDeactivate"),O=d(_,"checkCanReturnFocus"),P=d(_,"returnFocus","returnFocusOnDeactivate");w?.();var M=function(){m6(function(){P&&m(g(l.nodeFocusedBeforeActivation)),S?.()})};return P&&O?(O(g(l.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(T){return l.active?(l.manuallyPaused=!0,this._setPausedState(!0,T)):this},unpause:function(T){return l.active?(l.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,T)):this},updateContainerElements:function(T){var _=[].concat(T).filter(Boolean);return l.containers=_.map(function(w){return typeof w=="string"?o.querySelector(w):w}),l.active&&f(),B(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return l.manuallyPaused}},_setPausedState:{value:function(T,_){if(l.paused===T)return this;if(l.paused=T,T){var w=d(_,"onPause"),S=d(_,"onPostPause");w?.(),R(),B(),S?.()}else{var O=d(_,"onUnpause"),P=d(_,"onPostUnpause");O?.(),f(),E(),B(),P?.()}return this}}}),n.updateContainerElements(e),n}},Symbol.toStringTag,{value:"Module"})),Hv=xh(Vv),$v=xh(Av);var g6,x6,Wv=function(){if(x6)return g6;function e(f){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(f)}function t(){try{var f=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t=function(){return!!f})()}function n(f){return(n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)})(f)}function o(f,h){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,g){return m.__proto__=g,m},o(f,h)}function r(f){var h=function(m,g){if(e(m)!="object"||!m)return m;var x=m[Symbol.toPrimitive];if(x!==void 0){var y=x.call(m,g);if(e(y)!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}(f,"string");return e(h)=="symbol"?h:h+""}x6=1;var i=s,l=Dd(),d=Hv.createFocusTrap,c=$v.isFocusable,u=function(f){function h(m){var g;(function(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")})(this,h),function(v,b,C){(b=r(b))in v?Object.defineProperty(v,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):v[b]=C}(g=function(v,b,C){return b=n(b),function(k,E){if(E&&(e(E)=="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R}(k)}(v,t()?Reflect.construct(b,C||[],n(v).constructor):b.apply(v,C))}(this,h,[m]),"getNodeForOption",function(v){var b,C=(b=this.internalOptions[v])!==null&&b!==void 0?b:this.originalOptions[v];if(typeof C=="function"){for(var k=arguments.length,E=new Array(k>1?k-1:0),R=1;R<k;R++)E[R-1]=arguments[R];C=C.apply(void 0,E)}if(C===!0&&(C=void 0),!C){if(C===void 0||C===!1)return C;throw new Error("`".concat(v,"` was specified but was not a node, or did not return a node"))}var j,B=C;if(typeof C=="string"&&!(B=(j=this.getDocument())===null||j===void 0?void 0:j.querySelector(C)))throw new Error("`".concat(v,"` as selector refers to no known node"));return B}),g.handleDeactivate=g.handleDeactivate.bind(g),g.handlePostDeactivate=g.handlePostDeactivate.bind(g),g.handleClickOutsideDeactivates=g.handleClickOutsideDeactivates.bind(g),g.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:g.handleDeactivate,onPostDeactivate:g.handlePostDeactivate,clickOutsideDeactivates:g.handleClickOutsideDeactivates},g.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var x=m.focusTrapOptions;for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(y!=="returnFocusOnDeactivate"&&y!=="onDeactivate"&&y!=="onPostDeactivate"&&y!=="checkCanReturnFocus"&&y!=="clickOutsideDeactivates"?g.internalOptions[y]=x[y]:g.originalOptions[y]=x[y]);return g.outsideClick=null,g.focusTrapElements=m.containerElements||[],g.updatePreviousElement(),g}return function(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),g&&o(m,g)}(h,f),function(m,g){return g&&function(x,y){for(var v=0;v<y.length;v++){var b=y[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,r(b.key),b)}}(m.prototype,g),Object.defineProperty(m,"prototype",{writable:!1}),m}(h,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var m=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return m||m!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var m=this.getDocument();m&&(this.previouslyFocusedElement=m.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(m){var g=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,m):this.originalOptions.clickOutsideDeactivates;return g&&(this.outsideClick={target:m.target,allowDeactivation:g}),g}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var m=this,g=function(){var x=m.getReturnFocusNode(),y=!(!m.originalOptions.returnFocusOnDeactivate||x==null||!x.focus||m.outsideClick&&(!m.outsideClick.allowDeactivation||c(m.outsideClick.target,m.internalOptions.tabbableOptions))),v=m.internalOptions.preventScroll,b=v!==void 0&&v;y&&x.focus({preventScroll:b}),m.originalOptions.onPostDeactivate&&m.originalOptions.onPostDeactivate.call(null),m.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(g,g):g()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(m){if(this.focusTrap){m.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var g=!m.active&&this.props.active,x=m.active&&!this.props.active,y=!m.paused&&this.props.paused,v=m.paused&&!this.props.paused;if(g&&(this.updatePreviousElement(),this.focusTrap.activate()),x)return void this.deactivateTrap();y&&this.focusTrap.pause(),v&&this.focusTrap.unpause()}else m.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var m=this,g=this.props.children?i.Children.only(this.props.children):void 0;if(g){if(g.type&&g.type===i.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return i.cloneElement(g,{ref:function(x){var y=m.props.containerElements;g&&(typeof g.ref=="function"?g.ref(x):g.ref&&(g.ref.current=x)),m.focusTrapElements=y||[x]}})}return null}}])}(i.Component),p=typeof Element>"u"?Function:Element;return u.propTypes={active:l.bool,paused:l.bool,focusTrapOptions:l.shape({document:l.object,onActivate:l.func,onPostActivate:l.func,checkCanFocusTrap:l.func,onPause:l.func,onPostPause:l.func,onUnpause:l.func,onPostUnpause:l.func,onDeactivate:l.func,onPostDeactivate:l.func,checkCanReturnFocus:l.func,initialFocus:l.oneOfType([l.instanceOf(p),l.string,l.bool,l.func]),fallbackFocus:l.oneOfType([l.instanceOf(p),l.string,l.func]),escapeDeactivates:l.oneOfType([l.bool,l.func]),clickOutsideDeactivates:l.oneOfType([l.bool,l.func]),returnFocusOnDeactivate:l.bool,setReturnFocus:l.oneOfType([l.instanceOf(p),l.string,l.bool,l.func]),allowOutsideClick:l.oneOfType([l.bool,l.func]),preventScroll:l.bool,tabbableOptions:l.shape({displayCheck:l.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:l.oneOfType([l.bool,l.func])}),trapStack:l.array,isKeyForward:l.func,isKeyBackward:l.func}),containerElements:l.arrayOf(l.instanceOf(p)),children:l.oneOfType([l.element,l.instanceOf(p)])},u.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:d},g6=u}();const Uv=gh(Wv);var y6,b6,jl={exports:{}},v6={},hs={exports:{}},fo={},U0={};function u1(){return b6||(b6=1,Object.defineProperty(U0,"__esModule",{value:!0}),U0.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},U0.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},U0.int=function(e){return parseInt(e,10)},U0.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},U0.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),U0}var w6,S6,S0={};function Yd(){if(S6)return fo;S6=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.addClassName=l,fo.addEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.addEventListener?c.addEventListener(u,p,h):c.attachEvent?c.attachEvent("on"+u,p):c["on"+u]=p},fo.addUserSelectStyles=function(c){if(!c)return;let u=c.getElementById("react-draggable-style-el");u||(u=c.createElement("style"),u.type="text/css",u.id="react-draggable-style-el",u.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
36
36
|
`,u.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
37
|
-
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&l(c.body,"react-draggable-transparent-selection")},fo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},fo.createSVGTransform=function(c,u){return r(c,u,"")},fo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},fo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},fo.getTranslation=r,fo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},fo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},fo.matchesSelector=o,fo.matchesSelectorAndParentsTo=function(c,u,p){let f=c;do{if(o(f,u))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},fo.offsetXYFromParent=function(c,u,p){const f=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect();return{x:(c.clientX+u.scrollLeft-f.left)/p,y:(c.clientY+u.scrollTop-f.top)/p}},fo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},fo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},fo.removeClassName=d,fo.removeEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},fo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=u1(),t=function(c){if(typeof WeakMap=="function")var u=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,m={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return m;if(f=u){if(f.has(p))return f.get(p);f.set(p,m)}for(const g in p)g!=="default"&&{}.hasOwnProperty.call(p,g)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,g))&&(h.get||h.set)?f(m,g,h):m[g]=p[g]);return m}(c)}(function(){if(w6)return S0;w6=1,Object.defineProperty(S0,"__esModule",{value:!0}),S0.browserPrefixToKey=p,S0.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},S0.default=void 0,S0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let m=0;m<c.length;m++)if(p(f,c[m])in h)return c[m];return""}function p(f,h){return h?`${h}${function(m){let g="",x=!0;for(let y=0;y<m.length;y++)x?(g+=m[y].toUpperCase(),x=!1):m[y]==="-"?x=!0:g+=m[y];return g}(f)}`:f}return S0.default=u(),S0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:f,y:h}=c,m=`translate(${f}${p},${h}${p})`;return u&&(m=`translate(${typeof u.x=="string"?u.x:u.x+p}, ${typeof u.y=="string"?u.y:u.y+p})`+m),m}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function l(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return fo}var C6,Kr={};function k6(){if(C6)return Kr;C6=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Kr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Kr.createCoreData=function(o,r,i){const l=!(0,e.isNum)(o.lastX),d=n(o);return l?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Kr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Kr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:l}=o.props;var d;l=typeof l=="string"?l:{left:(d=l).left,top:d.top,right:d.right,bottom:d.bottom};const c=n(o);if(typeof l=="string"){const{ownerDocument:u}=c,p=u.defaultView;let f;if(f=l==="parent"?c.parentNode:c.getRootNode().querySelector(l),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+l+'" could not find an element.');const h=f,m=p.getComputedStyle(c),g=p.getComputedStyle(h);l={left:-c.offsetLeft+(0,e.int)(g.paddingLeft)+(0,e.int)(m.marginLeft),top:-c.offsetTop+(0,e.int)(g.paddingTop)+(0,e.int)(m.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(g.paddingRight)-(0,e.int)(m.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(g.paddingBottom)-(0,e.int)(m.marginBottom)}}return(0,e.isNum)(l.right)&&(r=Math.min(r,l.right)),(0,e.isNum)(l.bottom)&&(i=Math.min(i,l.bottom)),(0,e.isNum)(l.left)&&(r=Math.max(r,l.left)),(0,e.isNum)(l.top)&&(i=Math.max(i,l.top)),[r,i]},Kr.getControlPosition=function(o,r,i){const l=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!l)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(l||o,c,i.props.scale)},Kr.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=u1(),t=Yd();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Kr}var E6,_6,T6,j6,Ml={},Fc={};function M6(){return E6||(E6=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=function(){}),Fc}function qv(){return T6||(T6=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(g){if(typeof WeakMap=="function")var x=new WeakMap;return function(y){if(y&&y.__esModule)return y;var v,b,C={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return C;if(v=x){if(v.has(y))return v.get(y);v.set(y,C)}for(const k in y)k!=="default"&&{}.hasOwnProperty.call(y,k)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,k))&&(b.get||b.set)?v(C,k,b):C[k]=y[k]);return C}(g)}(s),n=p(Dd()),o=p(wo),r=function(){if(y6)return hs.exports;function g(y){var v,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(v=0;v<k;v++)y[v]&&(b=g(y[v]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,v,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(v=g(y))&&(C&&(C+=" "),C+=v);return C}return y6=1,hs.exports=x,hs.exports.clsx=x,hs.exports}(),i=Yd(),l=k6(),d=u1(),c=p(function(){if(_6)return Ml;_6=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.default=void 0;var g=function(w){if(typeof WeakMap=="function")var S=new WeakMap;return function(O){if(O&&O.__esModule)return O;var P,M,A={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return A;if(P=S){if(P.has(O))return P.get(O);P.set(O,A)}for(const D in O)D!=="default"&&{}.hasOwnProperty.call(O,D)&&((M=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,D))&&(M.get||M.set)?P(A,D,M):A[D]=O[D]);return A}(w)}(s),x=E(Dd()),y=E(wo),v=Yd(),b=k6(),C=u1(),k=E(M6());function E(w){return w&&w.__esModule?w:{default:w}}function R(w,S,O){return(S=function(P){var M=function(A,D){if(typeof A!="object"||!A)return A;var L=A[Symbol.toPrimitive];if(L!==void 0){var N=L.call(A,D);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(P,"string");return typeof M=="symbol"?M:M+""}(S))in w?Object.defineProperty(w,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):w[S]=O,w}const j={start:"touchstart",move:"touchmove",stop:"touchend"},B={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=B,_=class extends g.Component{constructor(){super(...arguments),R(this,"dragging",!1),R(this,"lastX",NaN),R(this,"lastY",NaN),R(this,"touchIdentifier",null),R(this,"mounted",!1),R(this,"handleDragStart",w=>{if(this.props.onMouseDown(w),!this.props.allowAnyClick&&typeof w.button=="number"&&w.button!==0)return!1;const S=this.findDOMNode();if(!S||!S.ownerDocument||!S.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:O}=S;if(this.props.disabled||!(w.target instanceof O.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(w.target,this.props.handle,S)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(w.target,this.props.cancel,S))return;w.type!=="touchstart"||this.props.allowMobileScroll||w.preventDefault();const P=(0,v.getTouchIdentifier)(w);this.touchIdentifier=P;const M=(0,b.getControlPosition)(w,P,this);if(M==null)return;const{x:A,y:D}=M,L=(0,b.createCoreData)(this,A,D);(0,k.default)("DraggableCore: handleDragStart: %j",L),(0,k.default)("calling",this.props.onStart),this.props.onStart(w,L)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(O),this.dragging=!0,this.lastX=A,this.lastY=D,(0,v.addEvent)(O,T.move,this.handleDrag),(0,v.addEvent)(O,T.stop,this.handleDragStop))}),R(this,"handleDrag",w=>{const S=(0,b.getControlPosition)(w,this.touchIdentifier,this);if(S==null)return;let{x:O,y:P}=S;if(Array.isArray(this.props.grid)){let A=O-this.lastX,D=P-this.lastY;if([A,D]=(0,b.snapToGrid)(this.props.grid,A,D),!A&&!D)return;O=this.lastX+A,P=this.lastY+D}const M=(0,b.createCoreData)(this,O,P);if((0,k.default)("DraggableCore: handleDrag: %j",M),this.props.onDrag(w,M)!==!1&&this.mounted!==!1)this.lastX=O,this.lastY=P;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const A=document.createEvent("MouseEvents");A.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(A)}}),R(this,"handleDragStop",w=>{if(!this.dragging)return;const S=(0,b.getControlPosition)(w,this.touchIdentifier,this);if(S==null)return;let{x:O,y:P}=S;if(Array.isArray(this.props.grid)){let D=O-this.lastX||0,L=P-this.lastY||0;[D,L]=(0,b.snapToGrid)(this.props.grid,D,L),O=this.lastX+D,P=this.lastY+L}const M=(0,b.createCoreData)(this,O,P);if(this.props.onStop(w,M)===!1||this.mounted===!1)return!1;const A=this.findDOMNode();A&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(A.ownerDocument),(0,k.default)("DraggableCore: handleDragStop: %j",M),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,A&&((0,k.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(A.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(A.ownerDocument,T.stop,this.handleDragStop))}),R(this,"onMouseDown",w=>(T=B,this.handleDragStart(w))),R(this,"onMouseUp",w=>(T=B,this.handleDragStop(w))),R(this,"onTouchStart",w=>(T=j,this.handleDragStart(w))),R(this,"onTouchEnd",w=>(T=j,this.handleDragStop(w)))}componentDidMount(){this.mounted=!0;const w=this.findDOMNode();w&&(0,v.addEvent)(w,j.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const w=this.findDOMNode();if(w){const{ownerDocument:S}=w;(0,v.removeEvent)(S,B.move,this.handleDrag),(0,v.removeEvent)(S,j.move,this.handleDrag),(0,v.removeEvent)(S,B.stop,this.handleDragStop),(0,v.removeEvent)(S,j.stop,this.handleDragStop),(0,v.removeEvent)(w,j.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(S)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:y.default.findDOMNode(this)}render(){return g.cloneElement(g.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ml.default=_,R(_,"displayName","DraggableCore"),R(_,"propTypes",{allowAnyClick:x.default.bool,allowMobileScroll:x.default.bool,children:x.default.node.isRequired,disabled:x.default.bool,enableUserSelectHack:x.default.bool,offsetParent:function(w,S){if(w[S]&&w[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:x.default.arrayOf(x.default.number),handle:x.default.string,cancel:x.default.string,nodeRef:x.default.object,onStart:x.default.func,onDrag:x.default.func,onStop:x.default.func,onMouseDown:x.default.func,scale:x.default.number,className:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),R(_,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ml}()),u=p(M6());function p(g){return g&&g.__esModule?g:{default:g}}function f(){return f=Object.assign?Object.assign.bind():function(g){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var v in y)({}).hasOwnProperty.call(y,v)&&(g[v]=y[v])}return g},f.apply(null,arguments)}function h(g,x,y){return(x=function(v){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var R=E.call(C,k);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(v,"string");return typeof b=="symbol"?b:b+""}(x))in g?Object.defineProperty(g,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[x]=y,g}class m extends t.Component{static getDerivedStateFromProps(x,y){let{position:v}=x,{prevPropsPosition:b}=y;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(x){super(x),h(this,"onDragStart",(y,v)=>{if((0,u.default)("Draggable: onDragStart: %j",v),this.props.onStart(y,(0,l.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,v)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",v);const b=(0,l.createDraggableData)(this,v),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[R,j]=(0,l.getBoundPosition)(this,C.x,C.y);C.x=R,C.y=j,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,v)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,v))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:v,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:R,positionOffset:j,scale:B,...T}=this.props;let _={},w=null;const S=!R||this.state.dragging,O=R||b,P={x:(0,l.canDragX)(this)&&S?this.state.x:O.x,y:(0,l.canDragY)(this)&&S?this.state.y:O.y};this.state.isElementSVG?w=(0,i.createSVGTransform)(P,j):_=(0,i.createCSSTransform)(P,j);const M=(0,r.clsx)(v.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:M,style:{...v.props.style,..._},transform:w}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(m,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(v6)),v6}var Zv=function(){if(j6)return jl.exports;j6=1;const{default:e,DraggableCore:t}=qv();return jl.exports=e,jl.exports.default=e,jl.exports.DraggableCore=t,jl.exports}();const Gv=gh(Zv),R6={x:0,y:0},Kv=s.memo(s.forwardRef((e,t)=>{const{defaultPosition:n=R6,PaperComponent:o=V.Paper,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:l=".draggable-title",titleSize:d,rootSize:c,...u}=e,p=s.useRef(null),f=s.useMemo(()=>d&&c?{left:0,top:0,right:c.width-d.width,bottom:c.height-d.height}:null,[d,c]),[h,m]=s.useState(null),[g,x]=s.useState(null),[y,v]=s.useState(null);return s.useLayoutEffect(()=>{!h&&n&&m(n??R6)},[n]),s.useEffect(()=>{f&&h&&x({x:Math.max(0,Math.min(h.x,f.right)),y:Math.max(0,Math.min(h.y,f.bottom))})},[h,f]),a.jsx(Gv,{nodeRef:p,handle:l,cancel:'[class*="MuiDialogContent-root"]',position:g,bounds:f??".MuiModal-root",onStop:r,onStart:(b,C)=>{const k=b;v({x:(k.clientX??k.touches?.[0]?.clientX)-C.x,y:(k.clientY??k.touches?.[0]?.clientY)-C.y})},onDrag:(b,C)=>{const k=b,E=k.clientX??k.touches?.[0]?.clientX,R=k.clientY??k.touches?.[0]?.clientY;m({x:E-y.x,y:R-y.y})},children:a.jsx(o,{ref:K2([p,t]),...u})})})),Xv={x:"50",y:"50"},kp=s.memo(e=>{const t=function({props:he,name:we}){return Kx({props:he,name:we,defaultTheme:B2,themeId:I2})}({props:e,name:"MuiDialog"}),n=N2(),o={enter:.66*n.transitions.duration.enteringScreen,exit:.66*n.transitions.duration.leavingScreen},{title:r="SheetXL",key:i="draggable-window",onCancel:l,onDone:d,onShow:c,onShown:u,onHide:p,refWindow:f,open:h,autoFocusSel:m,children:g,TransitionComponent:x=V.Fade,TransitionProps:y,transitionDuration:v=o,BackdropComponent:b=V.Backdrop,BackdropProps:C,PaperComponent:k=V.Paper,PaperProps:E,onBackdropClick:R,sx:j,className:B,onMouseDown:T,initialPosition:_=Xv,isModal:w=!1,...S}=t,O=s.useRef(null),[P,M]=s.useState(null),[A,D]=s.useState(!1),[L,N]=s.useState(!1),W=s.useRef(null),[I,U]=n6(),G=s.useRef(null),[Q,H]=n6(),$=s.useRef(null);s.useEffect(()=>{P&&D(h)},[h,P]);const F=fn(()=>{l?.(),D(!1)},[l]);s.useEffect(()=>{if(U.width===0&&U.height===0||P)return;const he=$.current?.getBoundingClientRect(),we=U.height-he.height,He=U.width-he.width;let Ye=.5*He,wt=.5*we;typeof _?.x=="number"?Ye=_.x:typeof _?.x=="string"&&(Ye=He*(parseFloat(_.x)/100)),typeof _?.y=="number"?wt=_.y:typeof _?.y=="string"&&(wt=we*(parseFloat(_.y)/100)),M({x:Ye,y:wt})},[U,H]);const[X,K]=s.useState(!1),[ne,J]=s.useState(null),[re,fe]=s.useState(null),ie=fn(he=>{if(ne)return ne.focus(he),!0;if(m){const we=G.current?.querySelectorAll?.(m);if(we&&we.length>0)return we[0]?.focus?.(he),!0}return G.current?.focus?.(he),!1},[ne,m]),ee=F1(f,()=>({focus:he=>{ie(he)}}),[]),pe={...y,onExited:he=>{d?.(null),y?.onExited?.(he)},onExit:he=>{const we=re;we&&requestAnimationFrame(()=>{ee.current?.contains(document.activeElement)&&we.focus()}),p?.(),N(!1),y?.onExit?.(he)},onEntered:(he,we)=>{c?.(),y?.onEntered?.(he,we)},onEntering:(he,we)=>{N(!0),u?.(ee.current)}};s.useEffect(()=>{L&&ie()},[L]);const Te=a.jsx(Uv,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:O,active:L,children:a.jsx(x,{in:A,timeout:v,role:"presentation",...pe,children:a.jsx(V.Box,{className:"MuiDialog-container",ref:G,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:he=>{he.which===Bo.Escape&&(F(),W.current?.start(he,{center:!1}),setTimeout(()=>W.current?.stop(he),180)),he.stopPropagation()},children:a.jsxs(Kv,{className:Mo({"Mui-focusVisible":X},B),sx:{"& *":he=>J2(he),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:he=>`solid ${gt.alpha(he.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:he=>`solid ${gt.alpha(he.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",...j},defaultPosition:P,ref:$,titleSize:H,rootSize:U,PaperComponent:k,...S,...E,children:[r?a.jsx(V.DialogTitle,{className:Mo({"Mui-selected":X},"draggable-title"),sx:{cursor:"move",display:"flex",color:he=>he.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:he=>`${he.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:he=>he.transitions.duration.shortest/2+"ms"},backgroundColor:he=>gt.alpha(he.palette.action.hover,.03)},ref:Q,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:he=>he.spacing(1),marginLeft:he=>he.spacing(1),marginRight:he=>he.spacing(1)},children:[a.jsx(V.Box,{sx:{flex:"1 1 100%",paddingLeft:he=>he.spacing(1)},children:r}),a.jsx(No,{label:"Close",children:a.jsx(V.IconButton,{"aria-label":"close",sx:{color:he=>he.palette.text.icon??he.palette.action.active},touchRippleRef:W,onPointerDown:he=>{W.current?.start(he,{center:!1}),he.stopPropagation(),he.preventDefault()},onPointerUp:F,children:a.jsx(wn.Close,{})})})]})}):null,g]})})})});let Ae=null;w&&(Ae=a.jsx(b,{...C,open:A,onMouseDown:he=>{F(),C?.onMouseDown?.(he)},onClick:he=>{R?.(he),C?.onClick?.(he)},sx:{pointerEvents:"auto",...C?.sx}}));const{getPortalContainer:ae}=U2();return wo.createPortal(a.jsxs(V.Box,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:K2([ee,I]),onPointerDown:he=>{X&&(he.target===G.current||he.target.tabIndex<0)&&G.current?.contains(document.activeElement)},onContextMenu:he=>{he.isPropagationStopped()||he.preventDefault()},onFocus:he=>{!X&&(he.target===G.current||he.target.tabIndex<0)&&setTimeout(()=>{ie()},100),O.current?.focusTrap?.unpause(),K(!0),G.current?.contains(he.target)&&he.target!==G.current&&J(he.target),he.relatedTarget&&!re&&fe(he.relatedTarget)},onBlur:he=>{ee?.current?.contains(he.relatedTarget)||(fe(null),O.current?.focusTrap?.pause(),K(!1))},children:[Ae,Te]}),ae(),i+"")});var Rr=typeof window<"u"?window:{screen:{},navigator:{}},Qi=(Rr.matchMedia||function(){return{matches:!1}}).bind(Rr),Yv={get passive(){return!0}},I6=function(){};Rr.addEventListener&&Rr.addEventListener("p",I6,Yv),Rr.removeEventListener&&Rr.removeEventListener("p",I6,!1);var eu="ontouchstart"in Rr,Jv=eu||"TouchEvent"in Rr&&Qi("(any-pointer: coarse)").matches,D6=(Rr.navigator.maxTouchPoints||0)>0||Jv,Ep=Rr.navigator.userAgent||"",Qv=Qi("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Ep)&&Math.min(Rr.screen.width||0,Rr.screen.height||0)>=768,_p=(Qi("(pointer: coarse)").matches||!Qi("(pointer: fine)").matches&&eu)&&!/Windows.*Firefox/.test(Ep),ew=Qi("(any-pointer: fine)").matches||Qi("(any-hover: hover)").matches||Qv||!eu,L6=!D6||!ew&&_p?D6?"touchOnly":"mouseOnly":"hybrid",tw=L6==="mouseOnly"?"mouse":L6==="touchOnly"||_p?"touch":"mouse",na=e=>e.type==="checkbox",Q0=e=>e instanceof Date,tr=e=>e==null;const Tp=e=>typeof e=="object";var So=e=>!tr(e)&&!Array.isArray(e)&&Tp(e)&&!Q0(e),tu=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Wo(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(tu&&(e instanceof Blob||o)||!n&&!So(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return So(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Wo(e[r]));else t=e}return t}var B1=e=>/^\w*$/.test(e),ko=e=>e===void 0,Jd=e=>Array.isArray(e)?e.filter(Boolean):[],nu=e=>Jd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Bt=(e,t,n)=>{if(!t||!So(e))return n;const o=(B1(t)?[t]:nu(t)).reduce((r,i)=>tr(r)?r:r[i],e);return ko(o)||o===e?ko(e[t])?n:e[t]:o},e0=e=>typeof e=="boolean",Zn=(e,t,n)=>{let o=-1;const r=B1(t)?[t]:nu(t),i=r.length,l=i-1;for(;++o<i;){const d=r[o];let c=n;if(o!==l){const u=e[d];c=So(u)||Array.isArray(u)?u:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=c,e=e[d]}};const jp="onChange",Mp="onSubmit",ba="all",O6="pattern",P6="required",Rp=s.createContext(null);Rp.displayName="HookFormContext";const nw=e=>{const{children:t,...n}=e;return s.createElement(Rp.Provider,{value:n},t)},ow=typeof window<"u"?F0.useLayoutEffect:F0.useEffect;var n0=e=>typeof e=="string",rw=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Ul=e=>Array.isArray(e)?e:[e],A6=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Qd=e=>tr(e)||!Tp(e);function P0(e,t){if(Qd(e)||Qd(t))return e===t;if(Q0(e)&&Q0(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const l=t[r];if(Q0(i)&&Q0(l)||So(i)&&So(l)||Array.isArray(i)&&Array.isArray(l)?!P0(i,l):i!==l)return!1}}return!0}var ir=e=>So(e)&&!Object.keys(e).length,ou=e=>e.type==="file",Vr=e=>typeof e=="function",h1=e=>{if(!tu)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ip=e=>e.type==="select-multiple",ru=e=>e.type==="radio",zc=e=>h1(e)&&e.isConnected;function To(e,t){const n=Array.isArray(t)?t:B1(t)?[t]:nu(t),o=n.length===1?e:function(l,d){const c=d.slice(0,-1).length;let u=0;for(;u<c;)l=ko(l)?u++:l[d[u++]];return l}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(So(o)&&ir(o)||Array.isArray(o)&&function(l){for(const d in l)if(l.hasOwnProperty(d)&&!ko(l[d]))return!1;return!0}(o))&&To(e,n.slice(0,-1)),e}var Dp=e=>{for(const t in e)if(Vr(e[t]))return!0;return!1};function p1(e,t={}){const n=Array.isArray(e);if(So(e)||n)for(const o in e)Array.isArray(e[o])||So(e[o])&&!Dp(e[o])?(t[o]=Array.isArray(e[o])?[]:{},p1(e[o],t[o])):tr(e[o])||(t[o]=!0);return t}function Lp(e,t,n){const o=Array.isArray(e);if(So(e)||o)for(const r in e)Array.isArray(e[r])||So(e[r])&&!Dp(e[r])?ko(t)||Qd(n[r])?n[r]=Array.isArray(e[r])?p1(e[r],[]):{...p1(e[r])}:Lp(e[r],tr(t)?{}:t[r],n[r]):n[r]=!P0(e[r],t[r]);return n}var Rl=(e,t)=>Lp(e,t,p1(t));const F6={value:!1,isValid:!1},z6={value:!0,isValid:!0};var Op=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ko(e[0].attributes.value)?ko(e[0].value)||e[0].value===""?z6:{value:e[0].value,isValid:!0}:z6:F6}return F6},Pp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>ko(e)?e:t?e===""?NaN:e&&+e:n&&n0(e)?new Date(e):o?o(e):e;const B6={isValid:!1,value:null};var Ap=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,B6):B6;function N6(e){const t=e.ref;return ou(t)?t.files:ru(t)?Ap(e.refs).value:Ip(t)?[...t.selectedOptions].map(({value:n})=>n):na(t)?Op(e.refs).value:Pp(ko(t.value)?e.ref.value:t.value,e)}var f1=e=>e instanceof RegExp,Il=e=>ko(e)?e:f1(e)?e.source:So(e)?f1(e.value)?e.value.source:e.value:e,V6=e=>({isOnSubmit:!e||e===Mp,isOnBlur:e==="onBlur",isOnChange:e===jp,isOnAll:e===ba,isOnTouch:e==="onTouched"});const H6="AsyncFunction";var iw=e=>!!e&&!!e.validate&&!!(Vr(e.validate)&&e.validate.constructor.name===H6||So(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===H6)),$6=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const oa=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Bt(e,r);if(i){const{_f:l,...d}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o||l.ref&&t(l.ref,l.name)&&!o)return!0;if(oa(d,t))break}else if(So(d)&&oa(d,t))break}}};function W6(e,t,n){const o=Bt(e,n);if(o||B1(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Bt(t,i),d=Bt(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var lw=(e,t,n)=>{const o=Ul(Bt(e,n));return Zn(o,"root",t[n]),Zn(e,n,o),e},Hs=e=>n0(e);function U6(e,t,n="validate"){if(Hs(e)||Array.isArray(e)&&e.every(Hs)||e0(e)&&!e)return{type:n,message:Hs(e)?e:"",ref:t}}var Si=e=>So(e)&&!f1(e)?e:{value:e,message:""},q6=async(e,t,n,o,r,i)=>{const{ref:l,refs:d,required:c,maxLength:u,minLength:p,min:f,max:h,pattern:m,validate:g,name:x,valueAsNumber:y,mount:v}=e._f,b=Bt(n,x);if(!v||t.has(x))return{};const C=d?d[0]:l,k=S=>{r&&C.reportValidity&&(C.setCustomValidity(e0(S)?"":S||""),C.reportValidity())},E={},R=ru(l),j=na(l),B=R||j,T=(y||ou(l))&&ko(l.value)&&ko(b)||h1(l)&&l.value===""||b===""||Array.isArray(b)&&!b.length,_=rw.bind(null,x,o,E),w=(S,O,P,M="maxLength",A="minLength")=>{const D=S?O:P;E[x]={type:S?M:A,message:D,ref:l,..._(S?M:A,D)}};if(i?!Array.isArray(b)||!b.length:c&&(!B&&(T||tr(b))||e0(b)&&!b||j&&!Op(d).isValid||R&&!Ap(d).isValid)){const{value:S,message:O}=Hs(c)?{value:!!c,message:c}:Si(c);if(S&&(E[x]={type:P6,message:O,ref:C,..._(P6,O)},!o))return k(O),E}if(!(T||tr(f)&&tr(h))){let S,O;const P=Si(h),M=Si(f);if(tr(b)||isNaN(b)){const A=l.valueAsDate||new Date(b),D=W=>new Date(new Date().toDateString()+" "+W),L=l.type=="time",N=l.type=="week";n0(P.value)&&b&&(S=L?D(b)>D(P.value):N?b>P.value:A>new Date(P.value)),n0(M.value)&&b&&(O=L?D(b)<D(M.value):N?b<M.value:A<new Date(M.value))}else{const A=l.valueAsNumber||b&&+b;tr(P.value)||(S=A>P.value),tr(M.value)||(O=A<M.value)}if((S||O)&&(w(!!S,P.message,M.message,"max","min"),!o))return k(E[x].message),E}if((u||p)&&!T&&(n0(b)||i&&Array.isArray(b))){const S=Si(u),O=Si(p),P=!tr(S.value)&&b.length>+S.value,M=!tr(O.value)&&b.length<+O.value;if((P||M)&&(w(P,S.message,O.message),!o))return k(E[x].message),E}if(m&&!T&&n0(b)){const{value:S,message:O}=Si(m);if(f1(S)&&!b.match(S)&&(E[x]={type:O6,message:O,ref:l,..._(O6,O)},!o))return k(O),E}if(g){if(Vr(g)){const S=U6(await g(b,n),C);if(S&&(E[x]={...S,..._("validate",S.message)},!o))return k(S.message),E}else if(So(g)){let S={};for(const O in g){if(!ir(S)&&!o)break;const P=U6(await g[O](b,n),C,O);P&&(S={...P,..._(O,P.message)},k(P.message),o&&(E[x]=S))}if(!ir(S)&&(E[x]={ref:C,...S},!o))return E}}return k(!0),E};const aw={mode:Mp,reValidateMode:jp,shouldFocusError:!0};function sw(e={}){let t={...aw,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Vr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const o={};let r,i=(So(t.defaultValues)||So(t.values))&&Wo(t.defaultValues||t.values)||{},l=t.shouldUnregister?{}:Wo(i),d={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...p};const h={array:A6(),state:A6()},m=t.criteriaMode===ba,g=async H=>{if(!t.disabled&&(p.isValid||f.isValid||H)){const $=t.resolver?ir((await b()).errors):await C(o,!0);$!==n.isValid&&h.state.next({isValid:$})}},x=(H,$)=>{!t.disabled&&(p.isValidating||p.validatingFields||f.isValidating||f.validatingFields)&&((H||Array.from(c.mount)).forEach(F=>{F&&($?Zn(n.validatingFields,F,$):To(n.validatingFields,F))}),h.state.next({validatingFields:n.validatingFields,isValidating:!ir(n.validatingFields)}))},y=(H,$,F,X)=>{const K=Bt(o,H);if(K){const ne=Bt(l,H,ko(F)?Bt(i,H):F);ko(ne)||X&&X.defaultChecked||$?Zn(l,H,$?ne:N6(K._f)):R(H,ne),d.mount&&g()}},v=(H,$,F,X,K)=>{let ne=!1,J=!1;const re={name:H};if(!t.disabled){if(!F||X){(p.isDirty||f.isDirty)&&(J=n.isDirty,n.isDirty=re.isDirty=k(),ne=J!==re.isDirty);const fe=P0(Bt(i,H),$);J=!!Bt(n.dirtyFields,H),fe?To(n.dirtyFields,H):Zn(n.dirtyFields,H,!0),re.dirtyFields=n.dirtyFields,ne=ne||(p.dirtyFields||f.dirtyFields)&&J!==!fe}if(F){const fe=Bt(n.touchedFields,H);fe||(Zn(n.touchedFields,H,F),re.touchedFields=n.touchedFields,ne=ne||(p.touchedFields||f.touchedFields)&&fe!==F)}ne&&K&&h.state.next(re)}return ne?re:{}},b=async H=>{x(H,!0);const $=await t.resolver(l,t.context,((F,X,K,ne)=>{const J={};for(const re of F){const fe=Bt(X,re);fe&&Zn(J,re,fe._f)}return{criteriaMode:K,names:[...F],fields:J,shouldUseNativeValidation:ne}})(H||c.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return x(H),$},C=async(H,$,F={valid:!0})=>{for(const X in H){const K=H[X];if(K){const{_f:ne,...J}=K;if(ne){const re=c.array.has(ne.name),fe=K._f&&iw(K._f);fe&&p.validatingFields&&x([X],!0);const ie=await q6(K,c.disabled,l,m,t.shouldUseNativeValidation&&!$,re);if(fe&&p.validatingFields&&x([X]),ie[ne.name]&&(F.valid=!1,$))break;!$&&(Bt(ie,ne.name)?re?lw(n.errors,ie,ne.name):Zn(n.errors,ne.name,ie[ne.name]):To(n.errors,ne.name))}!ir(J)&&await C(J,$,F)}}return F.valid},k=(H,$)=>!t.disabled&&(H&&$&&Zn(l,H,$),!P0(S(),i)),E=(H,$,F)=>((X,K,ne,J,re)=>n0(X)?(J&&K.watch.add(X),Bt(ne,X,re)):Array.isArray(X)?X.map(fe=>(J&&K.watch.add(fe),Bt(ne,fe))):(J&&(K.watchAll=!0),ne))(H,c,{...d.mount?l:ko($)?i:n0(H)?{[H]:$}:$},F,$),R=(H,$,F={})=>{const X=Bt(o,H);let K=$;if(X){const ne=X._f;ne&&(!ne.disabled&&Zn(l,H,Pp($,ne)),K=h1(ne.ref)&&tr($)?"":$,Ip(ne.ref)?[...ne.ref.options].forEach(J=>J.selected=K.includes(J.value)):ne.refs?na(ne.ref)?ne.refs.forEach(J=>{J.defaultChecked&&J.disabled||(Array.isArray(K)?J.checked=!!K.find(re=>re===J.value):J.checked=K===J.value||!!K)}):ne.refs.forEach(J=>J.checked=J.value===K):ou(ne.ref)?ne.ref.value="":(ne.ref.value=K,ne.ref.type||h.state.next({name:H,values:Wo(l)})))}(F.shouldDirty||F.shouldTouch)&&v(H,K,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&w(H)},j=(H,$,F)=>{for(const X in $){if(!$.hasOwnProperty(X))return;const K=$[X],ne=H+"."+X,J=Bt(o,ne);(c.array.has(H)||So(K)||J&&!J._f)&&!Q0(K)?j(ne,K,F):R(ne,K,F)}},B=(H,$,F={})=>{const X=Bt(o,H),K=c.array.has(H),ne=Wo($);Zn(l,H,ne),K?(h.array.next({name:H,values:Wo(l)}),(p.isDirty||p.dirtyFields||f.isDirty||f.dirtyFields)&&F.shouldDirty&&h.state.next({name:H,dirtyFields:Rl(i,l),isDirty:k(H,ne)})):!X||X._f||tr(ne)?R(H,ne,F):j(H,ne,F),$6(H,c)&&h.state.next({...n}),h.state.next({name:d.mount?H:void 0,values:Wo(l)})},T=async H=>{d.mount=!0;const $=H.target;let F=$.name,X=!0;const K=Bt(o,F),ne=ie=>{X=Number.isNaN(ie)||Q0(ie)&&isNaN(ie.getTime())||P0(ie,Bt(l,F,ie))},J=V6(t.mode),re=V6(t.reValidateMode);if(K){let ie,ee;const pe=$.type?N6(K._f):So(fe=H)&&fe.target?na(fe.target)?fe.target.checked:fe.target.value:fe,Te=H.type==="blur"||H.type==="focusout",Ae=!(He=>He.mount&&(He.required||He.min||He.max||He.maxLength||He.minLength||He.pattern||He.validate))(K._f)&&!t.resolver&&!Bt(n.errors,F)&&!K._f.deps||((He,Ye,wt,Ct,Ee)=>!Ee.isOnAll&&(!wt&&Ee.isOnTouch?!(Ye||He):(wt?Ct.isOnBlur:Ee.isOnBlur)?!He:!(wt?Ct.isOnChange:Ee.isOnChange)||He))(Te,Bt(n.touchedFields,F),n.isSubmitted,re,J),ae=$6(F,c,Te);Zn(l,F,pe),Te?(K._f.onBlur&&K._f.onBlur(H),r&&r(0)):K._f.onChange&&K._f.onChange(H);const he=v(F,pe,Te),we=!ir(he)||ae;if(!Te&&h.state.next({name:F,type:H.type,values:Wo(l)}),Ae)return(p.isValid||f.isValid)&&(t.mode==="onBlur"?Te&&g():Te||g()),we&&h.state.next({name:F,...ae?{}:he});if(!Te&&ae&&h.state.next({...n}),t.resolver){const{errors:He}=await b([F]);if(ne(pe),X){const Ye=W6(n.errors,o,F),wt=W6(He,o,Ye.name||F);ie=wt.error,F=wt.name,ee=ir(He)}}else x([F],!0),ie=(await q6(K,c.disabled,l,m,t.shouldUseNativeValidation))[F],x([F]),ne(pe),X&&(ie?ee=!1:(p.isValid||f.isValid)&&(ee=await C(o,!0)));X&&(K._f.deps&&w(K._f.deps),((He,Ye,wt,Ct)=>{const Ee=Bt(n.errors,He),Ie=(p.isValid||f.isValid)&&e0(Ye)&&n.isValid!==Ye;var ft;if(t.delayError&&wt?(ft=()=>(($e,yt)=>{Zn(n.errors,$e,yt),h.state.next({errors:n.errors})})(He,wt),r=$e=>{clearTimeout(u),u=setTimeout(ft,$e)},r(t.delayError)):(clearTimeout(u),r=null,wt?Zn(n.errors,He,wt):To(n.errors,He)),(wt?!P0(Ee,wt):Ee)||!ir(Ct)||Ie){const $e={...Ct,...Ie&&e0(Ye)?{isValid:Ye}:{},errors:n.errors,name:He};n={...n,...$e},h.state.next($e)}})(F,ee,ie,he))}var fe},_=(H,$)=>{if(Bt(n.errors,$)&&H.focus)return H.focus(),1},w=async(H,$={})=>{let F,X;const K=Ul(H);if(t.resolver){const ne=await(async J=>{const{errors:re}=await b(J);if(J)for(const fe of J){const ie=Bt(re,fe);ie?Zn(n.errors,fe,ie):To(n.errors,fe)}else n.errors=re;return re})(ko(H)?H:K);F=ir(ne),X=H?!K.some(J=>Bt(ne,J)):F}else H?(X=(await Promise.all(K.map(async ne=>{const J=Bt(o,ne);return await C(J&&J._f?{[ne]:J}:J)}))).every(Boolean),(X||n.isValid)&&g()):X=F=await C(o);return h.state.next({...!n0(H)||(p.isValid||f.isValid)&&F!==n.isValid?{}:{name:H},...t.resolver||!H?{isValid:F}:{},errors:n.errors}),$.shouldFocus&&!X&&oa(o,_,H?K:c.mount),X},S=H=>{const $={...d.mount?l:i};return ko(H)?$:n0(H)?Bt($,H):H.map(F=>Bt($,F))},O=(H,$)=>({invalid:!!Bt(($||n).errors,H),isDirty:!!Bt(($||n).dirtyFields,H),error:Bt(($||n).errors,H),isValidating:!!Bt(n.validatingFields,H),isTouched:!!Bt(($||n).touchedFields,H)}),P=(H,$,F)=>{const X=(Bt(o,H,{_f:{}})._f||{}).ref,K=Bt(n.errors,H)||{},{ref:ne,message:J,type:re,...fe}=K;Zn(n.errors,H,{...fe,...$,ref:X}),h.state.next({name:H,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&X&&X.focus&&X.focus()},M=H=>h.state.subscribe({next:$=>{var F,X,K;F=H.name,X=$.name,K=H.exact,F&&X&&F!==X&&!Ul(F).some(ne=>ne&&(K?ne===X:ne.startsWith(X)||X.startsWith(ne)))||!((ne,J,re,fe)=>{re(ne);const{name:ie,...ee}=ne;return ir(ee)||Object.keys(ee).length>=Object.keys(J).length||Object.keys(ee).find(pe=>J[pe]===(!fe||ba))})($,H.formState||p,G,H.reRenderRoot)||H.callback({values:{...l},...n,...$})}}).unsubscribe,A=(H,$={})=>{for(const F of H?Ul(H):c.mount)c.mount.delete(F),c.array.delete(F),$.keepValue||(To(o,F),To(l,F)),!$.keepError&&To(n.errors,F),!$.keepDirty&&To(n.dirtyFields,F),!$.keepTouched&&To(n.touchedFields,F),!$.keepIsValidating&&To(n.validatingFields,F),!t.shouldUnregister&&!$.keepDefaultValue&&To(i,F);h.state.next({values:Wo(l)}),h.state.next({...n,...$.keepDirty?{isDirty:k()}:{}}),!$.keepIsValid&&g()},D=({disabled:H,name:$})=>{(e0(H)&&d.mount||H||c.disabled.has($))&&(H?c.disabled.add($):c.disabled.delete($))},L=(H,$={})=>{let F=Bt(o,H);const X=e0($.disabled)||e0(t.disabled);return Zn(o,H,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:H}},name:H,mount:!0,...$}}),c.mount.add(H),F?D({disabled:e0($.disabled)?$.disabled:t.disabled,name:H}):y(H,!0,$.value),{...X?{disabled:$.disabled||t.disabled}:{},...t.progressive?{required:!!$.required,min:Il($.min),max:Il($.max),minLength:Il($.minLength),maxLength:Il($.maxLength),pattern:Il($.pattern)}:{},name:H,onChange:T,onBlur:T,ref:K=>{if(K){L(H,$),F=Bt(o,H);const re=ko(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,fe=(ee=>ru(ee)||na(ee))(re),ie=F._f.refs||[];if(fe?ie.find(ee=>ee===re):re===F._f.ref)return;Zn(o,H,{_f:{...F._f,...fe?{refs:[...ie.filter(zc),re,...Array.isArray(Bt(i,H))?[{}]:[]],ref:{type:re.type,name:H}}:{ref:re}}}),y(H,!1,void 0,re)}else F=Bt(o,H,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||$.shouldUnregister)&&(ne=c.array,J=H,!ne.has((re=>re.substring(0,re.search(/\.\d+(\.|$)/))||re)(J))||!d.action)&&c.unMount.add(H);var ne,J}}},N=()=>t.shouldFocusError&&oa(o,_,c.mount),W=(H,$)=>async F=>{let X;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let K=Wo(l);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ne,values:J}=await b();n.errors=ne,K=J}else await C(o);if(c.disabled.size)for(const ne of c.disabled)Zn(K,ne,void 0);if(To(n.errors,"root"),ir(n.errors)){h.state.next({errors:{}});try{await H(K,F)}catch(ne){X=ne}}else $&&await $({...n.errors},F),N(),setTimeout(N);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ir(n.errors)&&!X,submitCount:n.submitCount+1,errors:n.errors}),X)throw X},I=(H,$={})=>{const F=H?Wo(H):i,X=Wo(F),K=ir(H),ne=K?i:X;if($.keepDefaultValues||(i=F),!$.keepValues){if($.keepDirtyValues){const J=new Set([...c.mount,...Object.keys(Rl(i,l))]);for(const re of Array.from(J))Bt(n.dirtyFields,re)?Zn(ne,re,Bt(l,re)):B(re,Bt(ne,re))}else{if(tu&&ko(H))for(const J of c.mount){const re=Bt(o,J);if(re&&re._f){const fe=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(h1(fe)){const ie=fe.closest("form");if(ie){ie.reset();break}}}}for(const J of c.mount)B(J,Bt(ne,J))}l=Wo(ne),h.array.next({values:{...ne}}),h.state.next({values:{...ne}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!p.isValid||!!$.keepIsValid||!!$.keepDirtyValues,d.watch=!!t.shouldUnregister,h.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:!K&&($.keepDirty?n.isDirty:!(!$.keepDefaultValues||P0(H,i))),isSubmitted:!!$.keepIsSubmitted&&n.isSubmitted,dirtyFields:K?{}:$.keepDirtyValues?$.keepDefaultValues&&l?Rl(i,l):n.dirtyFields:$.keepDefaultValues&&H?Rl(i,H):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:!!$.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},U=(H,$)=>I(Vr(H)?H(l):H,$),G=H=>{n={...n,...H}},Q={control:{register:L,unregister:A,getFieldState:O,handleSubmit:W,setError:P,_subscribe:M,_runSchema:b,_focusError:N,_getWatch:E,_getDirty:k,_setValid:g,_setFieldArray:(H,$=[],F,X,K=!0,ne=!0)=>{if(X&&F&&!t.disabled){if(d.action=!0,ne&&Array.isArray(Bt(o,H))){const J=F(Bt(o,H),X.argA,X.argB);K&&Zn(o,H,J)}if(ne&&Array.isArray(Bt(n.errors,H))){const J=F(Bt(n.errors,H),X.argA,X.argB);K&&Zn(n.errors,H,J),((re,fe)=>{!Jd(Bt(re,fe)).length&&To(re,fe)})(n.errors,H)}if((p.touchedFields||f.touchedFields)&&ne&&Array.isArray(Bt(n.touchedFields,H))){const J=F(Bt(n.touchedFields,H),X.argA,X.argB);K&&Zn(n.touchedFields,H,J)}(p.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Rl(i,l)),h.state.next({name:H,isDirty:k(H,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Zn(l,H,$)},_setDisabledField:D,_setErrors:H=>{n.errors=H,h.state.next({errors:n.errors,isValid:!1})},_getFieldArray:H=>Jd(Bt(d.mount?l:i,H,t.shouldUnregister?Bt(i,H,[]):[])),_reset:I,_resetDefaultValues:()=>Vr(t.defaultValues)&&t.defaultValues().then(H=>{U(H,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const H of c.unMount){const $=Bt(o,H);$&&($._f.refs?$._f.refs.every(F=>!zc(F)):!zc($._f.ref))&&A(H)}c.unMount=new Set},_disableForm:H=>{e0(H)&&(h.state.next({disabled:H}),oa(o,($,F)=>{const X=Bt(o,F);X&&($.disabled=X._f.disabled||H,Array.isArray(X._f.refs)&&X._f.refs.forEach(K=>{K.disabled=X._f.disabled||H}))},0,!1))},_subjects:h,_proxyFormState:p,get _fields(){return o},get _formValues(){return l},get _state(){return d},set _state(H){d=H},get _defaultValues(){return i},get _names(){return c},set _names(H){c=H},get _formState(){return n},get _options(){return t},set _options(H){t={...t,...H}}},subscribe:H=>(d.mount=!0,f={...f,...H.formState},M({...H,formState:f})),trigger:w,register:L,handleSubmit:W,watch:(H,$)=>Vr(H)?h.state.subscribe({next:F=>H(E(void 0,$),F)}):E(H,$,!0),setValue:B,getValues:S,reset:U,resetField:(H,$={})=>{Bt(o,H)&&(ko($.defaultValue)?B(H,Wo(Bt(i,H))):(B(H,$.defaultValue),Zn(i,H,Wo($.defaultValue))),$.keepTouched||To(n.touchedFields,H),$.keepDirty||(To(n.dirtyFields,H),n.isDirty=$.defaultValue?k(H,Wo(Bt(i,H))):k()),$.keepError||(To(n.errors,H),p.isValid&&g()),h.state.next({...n}))},clearErrors:H=>{H&&Ul(H).forEach($=>To(n.errors,$)),h.state.next({errors:H?n.errors:{}})},unregister:A,setError:P,setFocus:(H,$={})=>{const F=Bt(o,H),X=F&&F._f;if(X){const K=X.refs?X.refs[0]:X.ref;K.focus&&(K.focus(),$.shouldSelect&&Vr(K.select)&&K.select())}},getFieldState:O};return{...Q,formControl:Q}}const cw=["Ok","Cancel"],e2=e=>{const{description:t,icon:n,onCancel:o,onOption:r,onDone:i,onValidateOption:l,createOptionsButton:d,options:c=cw,autoFocusSel:u=".defaultOption",defaultOption:p=c[0],cancelOption:f="Cancel",children:h,...m}=e,g=function(_={}){const w=s.useRef(void 0),S=s.useRef(void 0),[O,P]=s.useState({isDirty:!1,isValidating:!1,isLoading:Vr(_.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:_.errors||{},disabled:_.disabled||!1,isReady:!1,defaultValues:Vr(_.defaultValues)?void 0:_.defaultValues});if(!w.current)if(_.formControl)w.current={..._.formControl,formState:O},_.defaultValues&&!Vr(_.defaultValues)&&_.formControl.reset(_.defaultValues,_.resetOptions);else{const{formControl:A,...D}=sw(_);w.current={...D,formState:O}}const M=w.current.control;return M._options=_,ow(()=>{const A=M._subscribe({formState:M._proxyFormState,callback:()=>P({...M._formState}),reRenderRoot:!0});return P(D=>({...D,isReady:!0})),M._formState.isReady=!0,A},[M]),s.useEffect(()=>M._disableForm(_.disabled),[M,_.disabled]),s.useEffect(()=>{_.mode&&(M._options.mode=_.mode),_.reValidateMode&&(M._options.reValidateMode=_.reValidateMode)},[M,_.mode,_.reValidateMode]),s.useEffect(()=>{_.errors&&(M._setErrors(_.errors),M._focusError())},[M,_.errors]),s.useEffect(()=>{_.shouldUnregister&&M._subjects.state.next({values:M._getWatch()})},[M,_.shouldUnregister]),s.useEffect(()=>{if(M._proxyFormState.isDirty){const A=M._getDirty();A!==O.isDirty&&M._subjects.state.next({isDirty:A})}},[M,O.isDirty]),s.useEffect(()=>{_.values&&!P0(_.values,S.current)?(M._reset(_.values,M._options.resetOptions),S.current=_.values,P(A=>({...A}))):M._resetDefaultValues()},[M,_.values]),s.useEffect(()=>{M._state.mount||(M._setValid(),M._state.mount=!0),M._state.watch&&(M._state.watch=!1,M._subjects.state.next({...M._formState})),M._removeUnmounted()}),w.current.formState=((A,D,L,N=!0)=>{const W={defaultValues:D._defaultValues};for(const I in A)Object.defineProperty(W,I,{get:()=>{const U=I;return D._proxyFormState[U]!==ba&&(D._proxyFormState[U]=!N||ba),A[U]}});return W})(O,M),w.current}({shouldUseNativeValidation:!1}),{handleSubmit:x,formState:y}=g,v=s.useRef(null),b=s.useRef(null),C=s.useRef(null),k=fn(async _=>{let w;try{if(w=await Promise.resolve(l?.(_))??!0,w!==!0)return;await Promise.resolve(r?.(_,_===f,_===p)),i?.(_)}catch{}},[r,i,l,f,p]),E=fn((_,w)=>{setTimeout(()=>{k(p)},180)},[k]),R=fn(()=>{r?.(f,!0,!1),o?.(),i?.(null)},[r,f,o,i]),j=y&&(Object.keys(y.errors).length>0||y.disabled||y.isSubmitted),B=fn((_,w)=>{const S=_===f,O={className:w?"defaultOption":"action",type:w?"submit":"button",style:{minWidth:"75px"},onClick:()=>{S?R():w||k(_)}};if(d)return d(_,O,w);const P={className:w?"defaultOption":"action",variant:w?"contained":"outlined",size:"small",disabled:!S&&j,color:"primary",...O};if(w||S){const M=w?v:b;P.touchRippleRef=M,P.onPointerDown=A=>{M.current?.start(A,{center:!1}),A.stopPropagation(),A.preventDefault()}}return a.jsx(V.Button,{...P,children:a.jsx("div",{style:{paddingTop:"3px"},children:_})},`action:${_}`)},[c,p,f,d,y]),T=s.useMemo(()=>{const _=[];for(let w=0;w<c.length;w++){const S=c[w],O=p?S===p:w===0;_.push(B(S,O))}return _},[c,p,y]);return a.jsx(kp,{onCancel:R,initialPosition:{y:tw==="touch"?"15":"35"},onDone:i,autoFocusSel:u,isModal:!0,PaperProps:{},...m,children:a.jsx(nw,{...g,children:a.jsxs("form",{ref:C,onSubmit:x(E),children:[a.jsx(V.DialogContent,{dividers:!0,onKeyDown:_=>{if(_.isDefaultPrevented())return;_.stopPropagation();let w=null,S=null;const O=_.which===Bo.Escape&&f;if(O)w=f,S=b;else{if(j)return;_.which===Bo.Enter&&(w=p??c[0],S=v)}w&&(S.current?.start(_,{center:!1}),setTimeout(()=>{S.current?.stop(_),O&&k(w)},180))},children:a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:_=>_.spacing(n||t?1.5:0)},children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column"},children:[n,t]}),h]})}),a.jsx(V.DialogActions,{sx:{paddingTop:_=>_.spacing(1),paddingBottom:_=>_.spacing(1),paddingLeft:_=>_.spacing(1),paddingRight:_=>_.spacing(1),backgroundColor:_=>gt.alpha(_.palette.action.hover,.03)},children:T})]})})})},dw=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:e2,default:e2},Symbol.toStringTag,{value:"Module"})),uw=s.lazy(()=>Promise.resolve().then(()=>dw)),hw=s.lazy(()=>Promise.resolve().then(()=>require("./CZ10qs_G-ai0jsyd.cjs"))),ll=s.memo(s.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...l}=e;return q2(n),a.jsx(No,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...l,children:a.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),Re=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:l,labelOverride:d,disabled:c=!1,variant:u=jr.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...m}=e,g=s.useRef(null),x=s.useRef(!1),y=s.useMemo(()=>{const B={onExecute(T,_){o?.onExecute?.(T,_),x.current||(g.current?.start({center:!1}),setTimeout(()=>g.current?.stop({}),180)),x.current=!1},onError(T,_,w){o?.onError(T,_,w)}};return o?.beforeExecute&&(B.beforeExecute=o.beforeExecute),B},[o]),v=q2(n,y),b=s.useCallback(B=>{B.button===0&&B.preventDefault()},[]),C=s.useCallback(B=>{B.button===0&&n?.execute(f,o)},[v,o,f]),k=s.useCallback(B=>{B.keyCode!==Bo.Enter&&B.keyCode!==Bo.Space||n?.execute(f,o)},[v,o,f]),E=s.useMemo(()=>l||u===jr.Toolbar||n?.state()?typeof l=="function"?l(n):l:z1,[v,l]),R=s.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:u===jr.Toolbar?E:a.jsx(Aa,{selected:n?.state()??!1,children:E}),touchRippleRef:g,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:C,onKeyDown:k}),[v,o,c,E]);let j;return j=u===jr.Menuitem?a.jsx(sr,{...m,chips:n?.tags(),...R,children:d??n?.label(r,i)}):a.jsx(xr,{...m,...R}),(d||n?.label())&&((n.disabled()||c)&&(j=a.jsx("div",{children:j})),j=a.jsx(ll,{command:n,placement:u===jr.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:j})),j})),pw=s.memo(s.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=z1,label:i,variant:l=jr.Toolbar,disabled:d=!1,commandHook:c,...u}=e,p=s.useRef(null),f=s.useRef(!1),h=s.useMemo(()=>{const j={onExecute(B,T){c?.onExecute?.(B,T),f.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),f.current=!1},onError(B,T,_){c?.onError(B,T,_)}};return c?.beforeExecute&&(j.beforeExecute=c.beforeExecute),j},[c]),m=q2(n,h),g=()=>n?.state()?.toString()||"0",[x,y]=s.useState(g),v=fn(()=>{const j=parseFloat(x);isNaN(j)?y(g()):parseFloat(g())!==j&&n.execute(j,c)},[g,n,x,c]);s.useEffect(()=>{y(g())},[n?.state()]);const b=s.useMemo(()=>typeof r=="function"?r(n):r,[m,r]),C=s.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[m]),k=s.useMemo(()=>a.jsx(V.IconButton,{...u,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:j=>j.stopPropagation(),onMouseDown:j=>{j.button===0&&j.stopPropagation()},onMouseUp:j=>{j.button===0&&j.stopPropagation()},children:a.jsx(V.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:j=>`${Math.round(j.typography.fontSize)}px`,width:j=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:x,onFocus:j=>{j.target?.select()},onKeyDown:j=>{if(j.which===Bo.Enter)g()!==x&&(j.stopPropagation(),j.preventDefault(),v());else if(j.which===Bo.Escape)g()!==x&&(y(g()),setTimeout(()=>{j.target?.select()},0),j.stopPropagation(),j.preventDefault());else{if(j.key.match("[-]")||j.key.match("[0-9.]")&&(x+j.key).length>4)return j.stopPropagation(),void j.preventDefault();if(j.which===Bo.Space)return void j.preventDefault()}},onBlur:()=>{v()},onChange:j=>{if(j.target.value.length>4)return j.stopPropagation(),void j.preventDefault();y(j.target.value)}})}),[x,d,n]),E={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:d||!n||n.disabled(),onMouseDown:j=>{j.button===0&&j.preventDefault()},onMouseUp:j=>{j.button!==0||j.isPropagationStopped()||j.isDefaultPrevented()||j.isDefaultPrevented()||(j.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:j=>{j.keyCode!==Bo.Enter&&j.keyCode!==Bo.Space||n?.execute(!n?.state?.(),h)}};let R;return R=l===jr.Menuitem?a.jsxs(sr,{...u,chips:n?.tags(),...E,children:[C,k]}):a.jsx(xr,{...u,...E}),n?.label()&&((n.disabled()||d)&&(R=a.jsx("div",{children:R})),R=a.jsx(ll,{command:n,placement:l===jr.Toolbar?"bottom-start":"right-start",children:R})),R})),Pn=s.memo(s.forwardRef((e,t)=>{const{variant:n=jr.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:l,commandHook:d,disabled:c,label:u,icon:p,createPopupPanel:f,tooltip:h,selected:m,scope:g,...x}=e,y=s.useRef(null),v=s.useRef(!1),b=s.useMemo(()=>{const _={onExecute(w,S){d?.onExecute?.(w,S),v.current||(y.current?.start({center:!1}),setTimeout(()=>y.current?.stop({}),180)),v.current=!1},onError(w,S,O){d?.onError(w,S,O)}};return d?.beforeExecute&&(_.beforeExecute=d.beforeExecute),_},[d]),C=Z2(i,[o],null,[o]),k=C[0],{label:E,icon:R}=s.useMemo(()=>{let _=null;u&&(_=typeof u=="function"?u(k):u),_||(_=k?.label?.(g));let w=null;return p&&(w=typeof p=="function"?p(k):p),w||(w=k?.icon?.()),{label:_,icon:w}},[C,u,p]),j={disabled:c,scope:g,touchRippleRef:y,onQuickClick:r,tooltip:h,label:E,icon:R};(E||h)&&(j.createTooltip=({children:_},w)=>a.jsx(No,{label:E,description:h,disabled:w,children:_}));const B=fn(_=>f?.(_,i),[f,C]),T=fn(_=>k?.execute(l,b),[k]);return k?(j.quickButtonProps={},j.quickButtonProps.createTooltip=({children:_,placement:w},S)=>a.jsx(ll,{command:k,placement:w??n===jr.Toolbar?"bottom-start":"right-start",disabled:S,children:_}),j.disabled=j.disabled??k?.disabled(),r||(j.onQuickClick=T)):o&&(j.onQuickClick=()=>{}),j.selected=m??k?.state(),j.createPopupPanel=B,n===jr.Toolbar?a.jsx(Ur,{...x,...j,ref:t}):a.jsx(Pa,{...x,...j,ref:t})}));Pn.displayName="CommandPopupButton";const el=e=>{const{command:t,label:n,scope:o,icon:r=a.jsx(R2,{}),sx:i,...l}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:d=>d.typography.subtitle2.fontSize,...i},...l,children:[r?ye(r):null,a.jsx(V.Typography,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:d=>d.spacing(.25),paddingRight:d=>d.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},Fa=s.memo(s.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:l,children:d,...c}=e,u=F1(t,()=>({}),[]),[p,f]=s.useState(null),{reference:h}=i0({label:"toolbar",anchor:u.current,parentFloat:i,createPopupPanel:null}),m=s.useCallback(()=>{const j=p;j&&requestAnimationFrame(()=>{u.current?.contains(document.activeElement)&&j.focus()})},[]),g=s.useMemo(()=>({dense:!0,outlined:!1}),[]),x=s.useMemo(()=>{const{commandHook:j,...B}=r||{};return{commandHook:{beforeExecute:(T,_)=>j?.beforeExecute?.(T,_)!==!1&&h.closeAll(),onExecute(T,_){j?.onExecute?.(T,_),m()},onError(T,_,w){j?.onError?.(T,_,w)}},...B}},[h,r]),y=s.useMemo(()=>({...g,...x}),[g,x]),[v,b]=s.useReducer(j=>j+1,0);Z2(o,[],{onChange:()=>{b()}});const C=s.useMemo(()=>({commands:o,parentFloat:h,...x}),[v,y,h,r]);let k=0;g.dense||(k+=2),g.outlined&&k++;let E=2;g.dense||(E=4);const R=s.useMemo(()=>l({commands:o,commandButtonProps:y,commandPopupProps:{commands:o,...C,...r}}),[v,y,C,l]);return a.jsx(V.Toolbar,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${E}px`,paddingBottom:`${E}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:u,onFocus:j=>{j.relatedTarget&&!p&&f(j.relatedTarget)},onBlur:j=>{p&&!u?.current?.contains(j.relatedTarget)&&f(null)},onKeyDown:j=>{p&&j.which===Bo.Escape&&p.focus()},...c,children:a.jsx("div",{ref:u,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${E}px`,columnGap:`${k}px`,alignItems:"center",maxWidth:"100%"},children:R})})}));Fa.displayName="CommandToolbar";const fw=e=>{const{key:t,...n}=e;return a.jsx(Re,{...n},t)},o0=s.memo(s.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o,scope:r,commands:i,icon:l,quickCommand:d,popupScope:c=d,commandState:u,commandHook:p,disabled:f=!1,...h}=e;Z2(i,[d,...n]);const m=s.useCallback((g,x)=>{const y={variant:jr.Menuitem,commandHook:p,commandState:u,icon:l,scope:c,disabled:f},v=[];for(let b=0;b<n?.length;b++){const C=n[b];if(C===null||C==="-"){v.push(a.jsx(Lt,{orientation:"horizontal"},`element-${v.length}`));continue}const k=x.getCommand(C),E={key:`${C}-${v.length}`,command:k,...y},R=o?.(E)??fw(E);R&&v.push(R)}return _n({...g,children:v})},[f,p,u,c,n,l,o]);return a.jsx(Pn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:u,scope:r,quickCommand:d,icon:l,createPopupPanel:m,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Fp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),u=s.useMemo(()=>{for(let m=0;m<c.length;m++)if(c[m]?.state())return c[m].key();return c[0]?.key()},[c]),p=s.useMemo(()=>{const m=new Map;return m.set("formatAlignLeftToggle",ye(a.jsx(wn.FormatAlignLeft,{}))),m.set("formatAlignCenterToggle",ye(a.jsx(wn.FormatAlignCenter,{}))),m.set("formatAlignRightToggle",ye(a.jsx(wn.FormatAlignRight,{}))),m.set("formatAlignJustifyToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m.set("formatAlignCenterContinuousToggle",ye(a.jsx(wn.FormatAlignCenter,{}))),m.set("formatAlignFillToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m.set("formatAlignDistributedHorizontalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m},[]),f=s.useMemo(()=>{if(!o)return null;const m={...o};return delete m.beforeExecute,m},[o]),h=s.useCallback((m,g)=>{const x={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},y=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...x,command:g.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...x,command:g.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=a.jsxs(V.Box,{sx:{className:Qn("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:C=>C.stopPropagation(),children:[a.jsx(Re,{command:g.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ye(a.jsx(db,{}))}),a.jsx(Re,{command:g.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ye(a.jsx(cb,{}))})]}),b=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...d,children:[v,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return _n({...m,children:b})},[i,o]);return a.jsx(Pn,{ref:t,parentFloat:l,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:u,icon:p.get(u)??a.jsx(wn.FormatAlignLeft,{}),...d})})),zp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatAlignTopToggle",ye(a.jsx(yb,{}))),f.set("formatAlignMiddleToggle",ye(a.jsx(bb,{}))),f.set("formatAlignBottomToggle",ye(a.jsx(X3,{}))),f.set("formatAlignJustifyVerticalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),f.set("formatAlignDistributedVerticalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatAlignTopToggle"),icon:u.get("formatAlignTopToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignMiddleToggle"),icon:u.get("formatAlignMiddleToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignBottomToggle"),icon:u.get("formatAlignBottomToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...m,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:u.get("formatAlignJustifyVerticalToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:u.get("formatAlignDistributedVerticalToggle")})]});return _n({...f,children:g})},[i,o,u]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:u.get(c)??ye(a.jsx(X3,{})),...l})})),Bp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatTextOverflowVisibleToggle",ye(a.jsx(t3,{}))),f.set("formatTextOverflowWrapToggle",ye(a.jsx(ox,{}))),f.set("formatTextOverflowClipToggle",ye(a.jsx(rx,{}))),f.set("formatTextOverflowShrinkToggle",ye(a.jsx(ix,{}))),f},[]),p=ue((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:u.get("formatTextOverflowVisibleToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowWrapToggle"),icon:u.get("formatTextOverflowWrapToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowClipToggle"),icon:u.get("formatTextOverflowClipToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:u.get("formatTextOverflowShrinkToggle")})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:u.get(c)??ye(a.jsx(t3,{})),...l})})),Np=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=s.useMemo(()=>{for(let h=0;h<d.length;h++)if(d[h]?.state())return d[h].key();return d[1]?.key()},[d]),u=s.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ye(a.jsx(cs,{}))),h.set("formatTextRotate315",ye(a.jsx(cs,{}))),h.set("formatTextRotate45",ye(a.jsx(q3,{}))),h.set("formatTextRotate90",ye(a.jsx(Z3,{}))),h.set("formatTextRotate270",ye(a.jsx(G3,{}))),h.set("formatTextRotateCustom",ye(a.jsx(K3,{}))),h},[]),p=s.useCallback((h,m)=>{const g={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},x=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...g,command:m.getCommand("formatTextRotate0"),icon:ye(a.jsx(xb,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate315"),icon:ye(a.jsx(cs,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate45"),icon:ye(a.jsx(q3,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate90"),icon:ye(a.jsx(Z3,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate270"),icon:ye(a.jsx(G3,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(pw,{...g,command:m.getCommand("formatTextRotateCustom"),icon:ye(a.jsx(K3,{})),label:"Custom"})]});return _n({...h,children:x})},[i,o,r]),f=s.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[d]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,selected:f,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:f?"formatTextRotate0":"formatTextRotate315",icon:ye(u.get(c)??a.jsx(cs,{})),...l})}));function di(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const A0="$$material";function mw(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5,...r}=e,i=(p=>{const f=Object.keys(p).map(h=>({key:h,val:p[h]}))||[];return f.sort((h,m)=>h.val-m.val),f.reduce((h,m)=>({...h,[m.key]:m.val}),{})})(t),l=Object.keys(i);function d(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-o/100}${n})`}function u(p,f){const h=l.indexOf(f);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(h!==-1&&typeof t[l[h]]=="number"?t[l[h]]:f)-o/100}${n})`}return{keys:l,values:i,up:d,down:c,between:u,only:function(p){return l.indexOf(p)+1<l.length?u(p,l[l.indexOf(p)+1]):d(p)},not:function(p){const f=l.indexOf(p);return f===0?d(l[1]):f===l.length-1?c(l[f]):u(p,l[l.indexOf(p)+1]).replace("@media","@media not all and")},unit:n,...r}}var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Z6,G6,K6={exports:{}},Vn={};function gw(){if(Z6)return Vn;Z6=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(x){if(typeof x=="object"&&x!==null){var y=x.$$typeof;switch(y){case e:switch(x=x.type){case n:case r:case o:case c:case u:case h:return x;default:switch(x=x&&x.$$typeof){case l:case d:case f:case p:case i:return x;default:return y}}case t:return y}}}return Vn.ContextConsumer=i,Vn.ContextProvider=l,Vn.Element=e,Vn.ForwardRef=d,Vn.Fragment=n,Vn.Lazy=f,Vn.Memo=p,Vn.Portal=t,Vn.Profiler=r,Vn.StrictMode=o,Vn.Suspense=c,Vn.SuspenseList=u,Vn.isContextConsumer=function(x){return g(x)===i},Vn.isContextProvider=function(x){return g(x)===l},Vn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Vn.isForwardRef=function(x){return g(x)===d},Vn.isFragment=function(x){return g(x)===n},Vn.isLazy=function(x){return g(x)===f},Vn.isMemo=function(x){return g(x)===p},Vn.isPortal=function(x){return g(x)===t},Vn.isProfiler=function(x){return g(x)===r},Vn.isStrictMode=function(x){return g(x)===o},Vn.isSuspense=function(x){return g(x)===c},Vn.isSuspenseList=function(x){return g(x)===u},Vn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===r||x===o||x===c||x===u||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===p||x.$$typeof===l||x.$$typeof===i||x.$$typeof===d||x.$$typeof===m||x.getModuleId!==void 0)},Vn.typeOf=g,Vn}function xw(){return G6||(G6=1,K6.exports=gw()),K6.exports}var Vp=xw();function p0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function Hp(e){if(F0.isValidElement(e)||Vp.isValidElementType(e)||!p0(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Hp(e[n])}),t}function yr(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return p0(e)&&p0(t)&&Object.keys(t).forEach(r=>{F0.isValidElement(t[r])||Vp.isValidElementType(t[r])?o[r]=t[r]:p0(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&p0(e[r])?o[r]=yr(e[r],t[r],n):n.clone?o[r]=p0(t[r])?Hp(t[r]):t[r]:o[r]=t[r]}),o}function iu(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function B0(e){if(e.type)return e;if(e.charAt(0)==="#")return B0(function(i){i=i.slice(1);const l=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let d=i.match(l);return d&&d[0].length===1&&(d=d.map(c=>c+c)),d?`rgb${d.length===4?"a":""}(${d.map((c,u)=>u<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(di(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(di(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const ql=(e,t)=>{try{return(n=>{const o=B0(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function N1(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function $p(e){e=B0(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),l=(u,p=(u+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let d="rgb";const c=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return e.type==="hsla"&&(d+="a",c.push(t[3])),N1({type:d,values:c})}function t2(e){let t=(e=B0(e)).type==="hsl"||e.type==="hsla"?B0($p(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ps(e,t,n){try{return function(o,r){return o=B0(o),r=iu(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,N1(o)}(e,t)}catch{return e}}function lu(e,t){if(e=B0(e),t=iu(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return N1(e)}function Un(e,t,n){try{return lu(e,t)}catch{return e}}function au(e,t){if(e=B0(e),t=iu(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return N1(e)}function qn(e,t,n){try{return au(e,t)}catch{return e}}function fs(e,t,n){try{return function(o,r=.15){return t2(o)>.5?lu(o,r):au(o,r)}(e,t)}catch{return e}}const va={black:"#000",white:"#fff"},yw={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},bw="#f3e5f5",vw="#ce93d8",ww="#ba68c8",Sw="#ab47bc",Cw="#9c27b0",kw="#7b1fa2",Ew="#e57373",_w="#ef5350",Tw="#f44336",X6="#d32f2f",jw="#c62828",Mw="#ffb74d",Rw="#ffa726",Iw="#ff9800",Dw="#f57c00",Lw="#e65100",Ow="#e3f2fd",Pw="#90caf9",Y6="#42a5f5",Aw="#1976d2",Fw="#1565c0",zw="#4fc3f7",Bw="#29b6f6",Nw="#03a9f4",J6="#0288d1",Vw="#01579b",Hw="#81c784",$w="#66bb6a",Ww="#4caf50",Uw="#388e3c",qw="#2e7d32",Zw="#1b5e20";function Wp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:va.white,default:va.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Gw=Wp();function Up(){return{text:{primary:va.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:va.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Q6=Up();function e4(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=au(e.main,r):t==="dark"&&(e.dark=lu(e.main,i)))}function su(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(g="light"){return g==="dark"?{main:Pw,light:Ow,dark:Y6}:{main:Aw,light:Y6,dark:Fw}}(t),l=e.secondary||function(g="light"){return g==="dark"?{main:vw,light:bw,dark:Sw}:{main:Cw,light:ww,dark:kw}}(t),d=e.error||function(g="light"){return g==="dark"?{main:Tw,light:Ew,dark:X6}:{main:X6,light:_w,dark:jw}}(t),c=e.info||function(g="light"){return g==="dark"?{main:Bw,light:zw,dark:J6}:{main:J6,light:Nw,dark:Vw}}(t),u=e.success||function(g="light"){return g==="dark"?{main:$w,light:Hw,dark:Uw}:{main:qw,light:Ww,dark:Zw}}(t),p=e.warning||function(g="light"){return g==="dark"?{main:Rw,light:Mw,dark:Dw}:{main:"#ed6c02",light:Iw,dark:Lw}}(t);function f(g){return function(y,v){const b=t2(y),C=t2(v);return(Math.max(b,C)+.05)/(Math.min(b,C)+.05)}(g,Q6.text.primary)>=n?Q6.text.primary:Gw.text.primary}const h=({color:g,name:x,mainShade:y=500,lightShade:v=300,darkShade:b=700})=>{if(!(g={...g}).main&&g[y]&&(g.main=g[y]),!g.hasOwnProperty("main"))throw new Error(di(11,x?` (${x})`:"",y));if(typeof g.main!="string")throw new Error(di(12,x?` (${x})`:"",JSON.stringify(g.main)));return e4(g,"light",v,o),e4(g,"dark",b,o),g.contrastText||(g.contrastText=f(g.main)),g};let m;return t==="light"?m=Wp():t==="dark"&&(m=Up()),yr({common:{...va},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:d,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:u,name:"success"}),grey:yw,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...m},r)}var t4,n4,Bc,o4,r4,i4={exports:{}};function Kw(){return n4?t4:(n4=1,t4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Xw(){if(o4)return Bc;o4=1;var e=Kw();function t(){}function n(){}return n.resetWarningCache=t,Bc=function(){function o(l,d,c,u,p,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Bc}function za(){return r4||(r4=1,i4.exports=Xw()()),i4.exports}function ra(e,t){return t?yr(e,t,{clone:!1}):e}function l4(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const V1={xs:0,sm:600,md:900,lg:1200,xl:1536},a4={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${V1[e]}px)`},Yw={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:V1[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function g0(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||a4;return t.reduce((i,l,d)=>(i[r.up(r.keys[d])]=n(t[d]),i),{})}if(typeof t=="object"){const r=o.breakpoints||a4;return Object.keys(t).reduce((i,l)=>{if(d=r.keys,(c=l)==="@"||c.startsWith("@")&&(d.some(u=>c.startsWith(`@${u}`))||c.match(/^@\d/))){const u=function(p,f){const h=f.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,m,g]=h,x=Number.isNaN(+m)?m||0:+m;return p.containerQueries(g).up(x)}(o.containerQueries?o:Yw,l);u&&(i[u]=n(t[l],l))}else if(Object.keys(r.values||V1).includes(l))i[r.up(l)]=n(t[l],l);else{const u=l;i[u]=t[u]}var d,c;return i},{})}return n(t)}function s4(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function qp(e){if(typeof e!="string")throw new Error(di(7));return e.charAt(0).toUpperCase()+e.slice(1)}function H1(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function m1(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:H1(e,n)||o,t&&(r=t(r,o,e)),r}function bo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=l=>{if(l[t]==null)return null;const d=l[t],c=H1(l.theme,o)||{};return g0(l,d,u=>{let p=m1(c,r,u);return u===p&&typeof u=="string"&&(p=m1(c,r,`${t}${u==="default"?"":qp(u)}`,u)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const Jw={m:"margin",p:"padding"},Qw={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},c4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},eS=function(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!c4[e])return[e];e=c4[e]}const[t,n]=e.split(""),o=Jw[t],r=Qw[n]||"";return Array.isArray(r)?r.map(i=>o+i):[o+r]}),Zp=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Gp=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function Ba(e,t,n,o){const r=H1(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const l=Math.abs(i),d=r[l];return i>=0?d:typeof d=="number"?-d:`-${d}`}:typeof r=="function"?r:()=>{}}function cu(e){return Ba(e,"spacing",8)}function Na(e,t){return typeof t=="string"||t==null?t:e(t)}function tS(e,t,n,o){if(!t.includes(n))return null;const r=function(i,l){return d=>i.reduce((c,u)=>(c[u]=Na(l,d),c),{})}(eS(n),o);return g0(e,e[n],r)}function Kp(e,t){const n=cu(e.theme);return Object.keys(e).map(o=>tS(e,t,o,n)).reduce(ra,{})}function so(e){return Kp(e,Zp)}function co(e){return Kp(e,Gp)}so.propTypes={},so.filterProps=Zp,co.propTypes={},co.filterProps=Gp;const nS={borderRadius:4};function $1(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?ra(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function Tr(e){return typeof e!="number"?e:`${e}px solid`}function Lr(e,t){return bo({prop:e,themeKey:"borders",transform:t})}const oS=Lr("border",Tr),rS=Lr("borderTop",Tr),iS=Lr("borderRight",Tr),lS=Lr("borderBottom",Tr),aS=Lr("borderLeft",Tr),sS=Lr("borderColor"),cS=Lr("borderTopColor"),dS=Lr("borderRightColor"),uS=Lr("borderBottomColor"),hS=Lr("borderLeftColor"),pS=Lr("outline",Tr),fS=Lr("outlineColor"),$s=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ba(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:Na(t,o)});return g0(e,e.borderRadius,n)}return null};$s.propTypes={},$s.filterProps=["borderRadius"],$1(oS,rS,iS,lS,aS,sS,cS,dS,uS,hS,$s,pS,fS);const g1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({gap:Na(t,o)});return g0(e,e.gap,n)}return null};g1.propTypes={},g1.filterProps=["gap"];const x1=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({columnGap:Na(t,o)});return g0(e,e.columnGap,n)}return null};x1.propTypes={},x1.filterProps=["columnGap"];const y1=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({rowGap:Na(t,o)});return g0(e,e.rowGap,n)}return null};y1.propTypes={},y1.filterProps=["rowGap"];function Hi(e,t){return t==="grey"?t:e}$1(g1,x1,y1,bo({prop:"gridColumn"}),bo({prop:"gridRow"}),bo({prop:"gridAutoFlow"}),bo({prop:"gridAutoColumns"}),bo({prop:"gridAutoRows"}),bo({prop:"gridTemplateColumns"}),bo({prop:"gridTemplateRows"}),bo({prop:"gridTemplateAreas"}),bo({prop:"gridArea"}));function pr(e){return e<=1&&e!==0?100*e+"%":e}$1(bo({prop:"color",themeKey:"palette",transform:Hi}),bo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Hi}),bo({prop:"backgroundColor",themeKey:"palette",transform:Hi}));const mS=bo({prop:"width",transform:pr}),du=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||V1[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:pr(n)}};return g0(e,e.maxWidth,t)}return null};du.filterProps=["maxWidth"];const gS=bo({prop:"minWidth",transform:pr}),xS=bo({prop:"height",transform:pr}),yS=bo({prop:"maxHeight",transform:pr}),bS=bo({prop:"minHeight",transform:pr});bo({prop:"size",cssProperty:"width",transform:pr}),bo({prop:"size",cssProperty:"height",transform:pr});$1(mS,du,gS,xS,yS,bS,bo({prop:"boxSizing"}));const W1={border:{themeKey:"borders",transform:Tr},borderTop:{themeKey:"borders",transform:Tr},borderRight:{themeKey:"borders",transform:Tr},borderBottom:{themeKey:"borders",transform:Tr},borderLeft:{themeKey:"borders",transform:Tr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Tr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$s},color:{themeKey:"palette",transform:Hi},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Hi},backgroundColor:{themeKey:"palette",transform:Hi},p:{style:co},pt:{style:co},pr:{style:co},pb:{style:co},pl:{style:co},px:{style:co},py:{style:co},padding:{style:co},paddingTop:{style:co},paddingRight:{style:co},paddingBottom:{style:co},paddingLeft:{style:co},paddingX:{style:co},paddingY:{style:co},paddingInline:{style:co},paddingInlineStart:{style:co},paddingInlineEnd:{style:co},paddingBlock:{style:co},paddingBlockStart:{style:co},paddingBlockEnd:{style:co},m:{style:so},mt:{style:so},mr:{style:so},mb:{style:so},ml:{style:so},mx:{style:so},my:{style:so},margin:{style:so},marginTop:{style:so},marginRight:{style:so},marginBottom:{style:so},marginLeft:{style:so},marginX:{style:so},marginY:{style:so},marginInline:{style:so},marginInlineStart:{style:so},marginInlineEnd:{style:so},marginBlock:{style:so},marginBlockStart:{style:so},marginBlockEnd:{style:so},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:g1},rowGap:{style:y1},columnGap:{style:x1},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:pr},maxWidth:{style:du},minWidth:{transform:pr},height:{transform:pr},maxHeight:{transform:pr},minHeight:{transform:pr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},al=function(){function e(t,n,o,r){const i={[t]:n,theme:o},l=r[t];if(!l)return{[t]:n};const{cssProperty:d=t,themeKey:c,transform:u,style:p}=l;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const f=H1(o,c)||{};return p?p(i):g0(i,n,h=>{let m=m1(f,u,h);return h===m&&typeof h=="string"&&(m=m1(f,u,`${t}${h==="default"?"":qp(h)}`,h)),d===!1?m:{[d]:m}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const l=r.unstable_sxConfig??W1;function d(c){let u=c;if(typeof c=="function")u=c(r);else if(typeof c!="object")return c;if(!u)return null;const p=function(m={}){return m.keys?.reduce((x,y)=>(x[m.up(y)]={},x),{})||{}}(r.breakpoints),f=Object.keys(p);let h=p;return Object.keys(u).forEach(m=>{const g=(x=u[m],y=r,typeof x=="function"?x(y):x);var x,y;if(g!=null)if(typeof g=="object")if(l[m])h=ra(h,e(m,g,r,l));else{const v=g0({theme:r},g,b=>({[m]:b}));(function(...b){const C=b.reduce((E,R)=>E.concat(Object.keys(R)),[]),k=new Set(C);return b.every(E=>k.size===Object.keys(E).length)})(v,g)?h[m]=t({sx:g,theme:r,nested:!0}):h=ra(h,v)}else h=ra(h,e(m,g,r,l))}),!i&&r.modularCssLayers?{"@layer sx":l4(r,s4(f,h))}:l4(r,s4(f,h))}return Array.isArray(o)?o.map(d):d(o)}}();function vS(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function Xp(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...l}=e,d=mw(n),c=function(p=8,f=cu({spacing:p})){if(p.mui)return p;const h=(...m)=>(m.length===0?[1]:m).map(g=>{const x=f(g);return typeof x=="number"?`${x}px`:x}).join(" ");return h.mui=!0,h}(r);let u=yr({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:c,shape:{...nS,...i}},l);return u=function(p){const f=(x,y)=>x.replace("@media",y?`@container ${y}`:"@container");function h(x,y){x.up=(...v)=>f(p.breakpoints.up(...v),y),x.down=(...v)=>f(p.breakpoints.down(...v),y),x.between=(...v)=>f(p.breakpoints.between(...v),y),x.only=(...v)=>f(p.breakpoints.only(...v),y),x.not=(...v)=>{const b=f(p.breakpoints.not(...v),y);return b.includes("not all and")?b.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):b}}const m={},g=x=>(h(m,x),m);return h(g),{...p,containerQueries:g}}(u),u.applyStyles=vS,u=t.reduce((p,f)=>yr(p,f),u),u.unstable_sxConfig={...W1,...l?.unstable_sxConfig},u.unstable_sx=function(p){return al({sx:p,theme:this})},u}al.filterProps=["sx"];const d4=(e,t,n,o=[])=>{let r=e;t.forEach((i,l)=>{l===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function Nc(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},l={};var d,c;return d=(u,p,f)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(u,p))){const h=`--${n?`${n}-`:""}${u.join("-")}`,m=((g,x)=>typeof x=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(y=>g.includes(y))||g[g.length-1].toLowerCase().includes("opacity")?x:`${x}px`:x)(u,p);Object.assign(r,{[h]:m}),d4(i,u,`var(${h})`,f),d4(l,u,`var(${h}, ${m})`,f)}},c=u=>u[0]==="vars",function u(p,f=[],h=[]){Object.entries(p).forEach(([m,g])=>{(!c||c&&!c([...f,m]))&&g!=null&&(typeof g=="object"&&Object.keys(g).length>0?u(g,[...f,m],Array.isArray(g)?[...h,m]:h):d([...f,m],g,h))})}(e),{css:r,vars:i,varsWithDefaults:l}}function wS(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}const u4={textTransform:"uppercase"},h4='"Roboto", "Helvetica", "Arial", sans-serif';function Yp(e,t){const{fontFamily:n=h4,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:l=500,fontWeightBold:d=700,htmlFontSize:c=16,allVariants:u,pxToRem:p,...f}=typeof t=="function"?t(e):t,h=o/14,m=p||(y=>y/c*h+"rem"),g=(y,v,b,C,k)=>{return{fontFamily:n,fontWeight:y,fontSize:m(v),lineHeight:b,...n===h4?{letterSpacing:(E=C/v,Math.round(1e5*E)/1e5+"em")}:{},...k,...u};var E},x={h1:g(r,96,1.167,-1.5),h2:g(r,60,1.2,-.5),h3:g(i,48,1.167,0),h4:g(i,34,1.235,.25),h5:g(i,24,1.334,0),h6:g(l,20,1.6,.15),subtitle1:g(i,16,1.75,.15),subtitle2:g(l,14,1.57,.1),body1:g(i,16,1.5,.15),body2:g(i,14,1.43,.15),button:g(l,14,1.75,.4,u4),caption:g(i,12,1.66,.4),overline:g(i,12,2.66,1,u4),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return yr({htmlFontSize:c,pxToRem:m,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:l,fontWeightBold:d,...x},f,{clone:!1})}function Jn(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const SS=["none",Jn(0,2,1,-1,0,1,1,0,0,1,3,0),Jn(0,3,1,-2,0,2,2,0,0,1,5,0),Jn(0,3,3,-2,0,3,4,0,0,1,8,0),Jn(0,2,4,-1,0,4,5,0,0,1,10,0),Jn(0,3,5,-1,0,5,8,0,0,1,14,0),Jn(0,3,5,-1,0,6,10,0,0,1,18,0),Jn(0,4,5,-2,0,7,10,1,0,2,16,1),Jn(0,5,5,-3,0,8,10,1,0,3,14,2),Jn(0,5,6,-3,0,9,12,1,0,3,16,2),Jn(0,6,6,-3,0,10,14,1,0,4,18,3),Jn(0,6,7,-4,0,11,15,1,0,4,20,3),Jn(0,7,8,-4,0,12,17,2,0,5,22,4),Jn(0,7,8,-4,0,13,19,2,0,5,24,4),Jn(0,7,9,-4,0,14,21,2,0,5,26,4),Jn(0,8,9,-5,0,15,22,2,0,6,28,5),Jn(0,8,10,-5,0,16,24,2,0,6,30,5),Jn(0,8,11,-5,0,17,26,2,0,6,32,5),Jn(0,9,11,-5,0,18,28,2,0,7,34,6),Jn(0,9,12,-6,0,19,29,2,0,7,36,6),Jn(0,10,13,-6,0,20,31,3,0,8,38,7),Jn(0,10,13,-6,0,21,33,3,0,8,40,7),Jn(0,10,14,-6,0,22,35,3,0,8,42,7),Jn(0,11,14,-7,0,23,36,3,0,9,44,8),Jn(0,11,15,-7,0,24,38,3,0,9,46,8)],CS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},kS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function p4(e){return`${Math.round(e)}ms`}function ES(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function _S(e){const t={...CS,...e.easing},n={...kS,...e.duration};return{getAutoHeightDuration:ES,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:l=t.easeInOut,delay:d=0,...c}=r;return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:p4(i)} ${l} ${typeof d=="string"?d:p4(d)}`).join(",")},...e,easing:t,duration:n}}const TS={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function jS(e){return p0(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Jp(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[l,d]=r[i];!jS(d)||l.startsWith("unstable_")?delete o[l]:p0(d)&&(o[l]={...d},n(o[l]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
37
|
+
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&l(c.body,"react-draggable-transparent-selection")},fo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},fo.createSVGTransform=function(c,u){return r(c,u,"")},fo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},fo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},fo.getTranslation=r,fo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},fo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},fo.matchesSelector=o,fo.matchesSelectorAndParentsTo=function(c,u,p){let f=c;do{if(o(f,u))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},fo.offsetXYFromParent=function(c,u,p){const f=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect();return{x:(c.clientX+u.scrollLeft-f.left)/p,y:(c.clientY+u.scrollTop-f.top)/p}},fo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},fo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},fo.removeClassName=d,fo.removeEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},fo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=u1(),t=function(c){if(typeof WeakMap=="function")var u=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,m={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return m;if(f=u){if(f.has(p))return f.get(p);f.set(p,m)}for(const g in p)g!=="default"&&{}.hasOwnProperty.call(p,g)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,g))&&(h.get||h.set)?f(m,g,h):m[g]=p[g]);return m}(c)}(function(){if(w6)return S0;w6=1,Object.defineProperty(S0,"__esModule",{value:!0}),S0.browserPrefixToKey=p,S0.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},S0.default=void 0,S0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let m=0;m<c.length;m++)if(p(f,c[m])in h)return c[m];return""}function p(f,h){return h?`${h}${function(m){let g="",x=!0;for(let y=0;y<m.length;y++)x?(g+=m[y].toUpperCase(),x=!1):m[y]==="-"?x=!0:g+=m[y];return g}(f)}`:f}return S0.default=u(),S0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:f,y:h}=c,m=`translate(${f}${p},${h}${p})`;return u&&(m=`translate(${typeof u.x=="string"?u.x:u.x+p}, ${typeof u.y=="string"?u.y:u.y+p})`+m),m}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function l(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return fo}var C6,Kr={};function k6(){if(C6)return Kr;C6=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Kr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Kr.createCoreData=function(o,r,i){const l=!(0,e.isNum)(o.lastX),d=n(o);return l?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Kr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Kr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:l}=o.props;var d;l=typeof l=="string"?l:{left:(d=l).left,top:d.top,right:d.right,bottom:d.bottom};const c=n(o);if(typeof l=="string"){const{ownerDocument:u}=c,p=u.defaultView;let f;if(f=l==="parent"?c.parentNode:c.getRootNode().querySelector(l),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+l+'" could not find an element.');const h=f,m=p.getComputedStyle(c),g=p.getComputedStyle(h);l={left:-c.offsetLeft+(0,e.int)(g.paddingLeft)+(0,e.int)(m.marginLeft),top:-c.offsetTop+(0,e.int)(g.paddingTop)+(0,e.int)(m.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(g.paddingRight)-(0,e.int)(m.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(g.paddingBottom)-(0,e.int)(m.marginBottom)}}return(0,e.isNum)(l.right)&&(r=Math.min(r,l.right)),(0,e.isNum)(l.bottom)&&(i=Math.min(i,l.bottom)),(0,e.isNum)(l.left)&&(r=Math.max(r,l.left)),(0,e.isNum)(l.top)&&(i=Math.max(i,l.top)),[r,i]},Kr.getControlPosition=function(o,r,i){const l=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!l)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(l||o,c,i.props.scale)},Kr.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=u1(),t=Yd();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Kr}var E6,_6,T6,j6,Ml={},Fc={};function M6(){return E6||(E6=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=function(){}),Fc}function qv(){return T6||(T6=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(g){if(typeof WeakMap=="function")var x=new WeakMap;return function(y){if(y&&y.__esModule)return y;var v,b,C={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return C;if(v=x){if(v.has(y))return v.get(y);v.set(y,C)}for(const k in y)k!=="default"&&{}.hasOwnProperty.call(y,k)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,k))&&(b.get||b.set)?v(C,k,b):C[k]=y[k]);return C}(g)}(s),n=p(Dd()),o=p(wo),r=function(){if(y6)return hs.exports;function g(y){var v,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(v=0;v<k;v++)y[v]&&(b=g(y[v]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,v,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(v=g(y))&&(C&&(C+=" "),C+=v);return C}return y6=1,hs.exports=x,hs.exports.clsx=x,hs.exports}(),i=Yd(),l=k6(),d=u1(),c=p(function(){if(_6)return Ml;_6=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.default=void 0;var g=function(w){if(typeof WeakMap=="function")var S=new WeakMap;return function(O){if(O&&O.__esModule)return O;var P,M,A={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return A;if(P=S){if(P.has(O))return P.get(O);P.set(O,A)}for(const D in O)D!=="default"&&{}.hasOwnProperty.call(O,D)&&((M=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,D))&&(M.get||M.set)?P(A,D,M):A[D]=O[D]);return A}(w)}(s),x=E(Dd()),y=E(wo),v=Yd(),b=k6(),C=u1(),k=E(M6());function E(w){return w&&w.__esModule?w:{default:w}}function R(w,S,O){return(S=function(P){var M=function(A,D){if(typeof A!="object"||!A)return A;var L=A[Symbol.toPrimitive];if(L!==void 0){var N=L.call(A,D);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(P,"string");return typeof M=="symbol"?M:M+""}(S))in w?Object.defineProperty(w,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):w[S]=O,w}const j={start:"touchstart",move:"touchmove",stop:"touchend"},B={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=B,_=class extends g.Component{constructor(){super(...arguments),R(this,"dragging",!1),R(this,"lastX",NaN),R(this,"lastY",NaN),R(this,"touchIdentifier",null),R(this,"mounted",!1),R(this,"handleDragStart",w=>{if(this.props.onMouseDown(w),!this.props.allowAnyClick&&typeof w.button=="number"&&w.button!==0)return!1;const S=this.findDOMNode();if(!S||!S.ownerDocument||!S.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:O}=S;if(this.props.disabled||!(w.target instanceof O.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(w.target,this.props.handle,S)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(w.target,this.props.cancel,S))return;w.type!=="touchstart"||this.props.allowMobileScroll||w.preventDefault();const P=(0,v.getTouchIdentifier)(w);this.touchIdentifier=P;const M=(0,b.getControlPosition)(w,P,this);if(M==null)return;const{x:A,y:D}=M,L=(0,b.createCoreData)(this,A,D);(0,k.default)("DraggableCore: handleDragStart: %j",L),(0,k.default)("calling",this.props.onStart),this.props.onStart(w,L)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(O),this.dragging=!0,this.lastX=A,this.lastY=D,(0,v.addEvent)(O,T.move,this.handleDrag),(0,v.addEvent)(O,T.stop,this.handleDragStop))}),R(this,"handleDrag",w=>{const S=(0,b.getControlPosition)(w,this.touchIdentifier,this);if(S==null)return;let{x:O,y:P}=S;if(Array.isArray(this.props.grid)){let A=O-this.lastX,D=P-this.lastY;if([A,D]=(0,b.snapToGrid)(this.props.grid,A,D),!A&&!D)return;O=this.lastX+A,P=this.lastY+D}const M=(0,b.createCoreData)(this,O,P);if((0,k.default)("DraggableCore: handleDrag: %j",M),this.props.onDrag(w,M)!==!1&&this.mounted!==!1)this.lastX=O,this.lastY=P;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const A=document.createEvent("MouseEvents");A.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(A)}}),R(this,"handleDragStop",w=>{if(!this.dragging)return;const S=(0,b.getControlPosition)(w,this.touchIdentifier,this);if(S==null)return;let{x:O,y:P}=S;if(Array.isArray(this.props.grid)){let D=O-this.lastX||0,L=P-this.lastY||0;[D,L]=(0,b.snapToGrid)(this.props.grid,D,L),O=this.lastX+D,P=this.lastY+L}const M=(0,b.createCoreData)(this,O,P);if(this.props.onStop(w,M)===!1||this.mounted===!1)return!1;const A=this.findDOMNode();A&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(A.ownerDocument),(0,k.default)("DraggableCore: handleDragStop: %j",M),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,A&&((0,k.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(A.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(A.ownerDocument,T.stop,this.handleDragStop))}),R(this,"onMouseDown",w=>(T=B,this.handleDragStart(w))),R(this,"onMouseUp",w=>(T=B,this.handleDragStop(w))),R(this,"onTouchStart",w=>(T=j,this.handleDragStart(w))),R(this,"onTouchEnd",w=>(T=j,this.handleDragStop(w)))}componentDidMount(){this.mounted=!0;const w=this.findDOMNode();w&&(0,v.addEvent)(w,j.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const w=this.findDOMNode();if(w){const{ownerDocument:S}=w;(0,v.removeEvent)(S,B.move,this.handleDrag),(0,v.removeEvent)(S,j.move,this.handleDrag),(0,v.removeEvent)(S,B.stop,this.handleDragStop),(0,v.removeEvent)(S,j.stop,this.handleDragStop),(0,v.removeEvent)(w,j.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(S)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:y.default.findDOMNode(this)}render(){return g.cloneElement(g.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ml.default=_,R(_,"displayName","DraggableCore"),R(_,"propTypes",{allowAnyClick:x.default.bool,allowMobileScroll:x.default.bool,children:x.default.node.isRequired,disabled:x.default.bool,enableUserSelectHack:x.default.bool,offsetParent:function(w,S){if(w[S]&&w[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:x.default.arrayOf(x.default.number),handle:x.default.string,cancel:x.default.string,nodeRef:x.default.object,onStart:x.default.func,onDrag:x.default.func,onStop:x.default.func,onMouseDown:x.default.func,scale:x.default.number,className:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),R(_,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ml}()),u=p(M6());function p(g){return g&&g.__esModule?g:{default:g}}function f(){return f=Object.assign?Object.assign.bind():function(g){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var v in y)({}).hasOwnProperty.call(y,v)&&(g[v]=y[v])}return g},f.apply(null,arguments)}function h(g,x,y){return(x=function(v){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var R=E.call(C,k);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(v,"string");return typeof b=="symbol"?b:b+""}(x))in g?Object.defineProperty(g,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[x]=y,g}class m extends t.Component{static getDerivedStateFromProps(x,y){let{position:v}=x,{prevPropsPosition:b}=y;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(x){super(x),h(this,"onDragStart",(y,v)=>{if((0,u.default)("Draggable: onDragStart: %j",v),this.props.onStart(y,(0,l.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,v)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",v);const b=(0,l.createDraggableData)(this,v),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[R,j]=(0,l.getBoundPosition)(this,C.x,C.y);C.x=R,C.y=j,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,v)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,v))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:v,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:R,positionOffset:j,scale:B,...T}=this.props;let _={},w=null;const S=!R||this.state.dragging,O=R||b,P={x:(0,l.canDragX)(this)&&S?this.state.x:O.x,y:(0,l.canDragY)(this)&&S?this.state.y:O.y};this.state.isElementSVG?w=(0,i.createSVGTransform)(P,j):_=(0,i.createCSSTransform)(P,j);const M=(0,r.clsx)(v.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:M,style:{...v.props.style,..._},transform:w}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(m,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(v6)),v6}var Zv=function(){if(j6)return jl.exports;j6=1;const{default:e,DraggableCore:t}=qv();return jl.exports=e,jl.exports.default=e,jl.exports.DraggableCore=t,jl.exports}();const Gv=gh(Zv),R6={x:0,y:0},Kv=s.memo(s.forwardRef((e,t)=>{const{defaultPosition:n=R6,PaperComponent:o=V.Paper,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:l=".draggable-title",titleSize:d,rootSize:c,...u}=e,p=s.useRef(null),f=s.useMemo(()=>d&&c?{left:0,top:0,right:c.width-d.width,bottom:c.height-d.height}:null,[d,c]),[h,m]=s.useState(null),[g,x]=s.useState(null),[y,v]=s.useState(null);return s.useLayoutEffect(()=>{!h&&n&&m(n??R6)},[n]),s.useEffect(()=>{f&&h&&x({x:Math.max(0,Math.min(h.x,f.right)),y:Math.max(0,Math.min(h.y,f.bottom))})},[h,f]),a.jsx(Gv,{nodeRef:p,handle:l,cancel:'[class*="MuiDialogContent-root"]',position:g,bounds:f??".MuiModal-root",onStop:r,onStart:(b,C)=>{const k=b;v({x:(k.clientX??k.touches?.[0]?.clientX)-C.x,y:(k.clientY??k.touches?.[0]?.clientY)-C.y})},onDrag:(b,C)=>{const k=b,E=k.clientX??k.touches?.[0]?.clientX,R=k.clientY??k.touches?.[0]?.clientY;m({x:E-y.x,y:R-y.y})},children:a.jsx(o,{ref:K2([p,t]),...u})})})),Xv={x:"50",y:"50"},kp=s.memo(e=>{const t=function({props:he,name:we}){return Kx({props:he,name:we,defaultTheme:B2,themeId:I2})}({props:e,name:"MuiDialog"}),n=N2(),o={enter:.66*n.transitions.duration.enteringScreen,exit:.66*n.transitions.duration.leavingScreen},{title:r="SheetXL",key:i="draggable-window",onCancel:l,onDone:d,onShow:c,onShown:u,onHide:p,refWindow:f,open:h,autoFocusSel:m,children:g,TransitionComponent:x=V.Fade,TransitionProps:y,transitionDuration:v=o,BackdropComponent:b=V.Backdrop,BackdropProps:C,PaperComponent:k=V.Paper,PaperProps:E,onBackdropClick:R,sx:j,className:B,onMouseDown:T,initialPosition:_=Xv,isModal:w=!1,...S}=t,O=s.useRef(null),[P,M]=s.useState(null),[A,D]=s.useState(!1),[L,N]=s.useState(!1),W=s.useRef(null),[I,U]=n6(),G=s.useRef(null),[Q,H]=n6(),$=s.useRef(null);s.useEffect(()=>{P&&D(h)},[h,P]);const F=fn(()=>{l?.(),D(!1)},[l]);s.useEffect(()=>{if(U.width===0&&U.height===0||P)return;const he=$.current?.getBoundingClientRect(),we=U.height-he.height,He=U.width-he.width;let Ye=.5*He,wt=.5*we;typeof _?.x=="number"?Ye=_.x:typeof _?.x=="string"&&(Ye=He*(parseFloat(_.x)/100)),typeof _?.y=="number"?wt=_.y:typeof _?.y=="string"&&(wt=we*(parseFloat(_.y)/100)),M({x:Ye,y:wt})},[U,H]);const[X,K]=s.useState(!1),[ne,J]=s.useState(null),[re,fe]=s.useState(null),ie=fn(he=>{if(ne)return ne.focus(he),!0;if(m){const we=G.current?.querySelectorAll?.(m);if(we&&we.length>0)return we[0]?.focus?.(he),!0}return G.current?.focus?.(he),!1},[ne,m]),ee=F1(f,()=>({focus:he=>{ie(he)}}),[]),pe={...y,onExited:he=>{d?.(null),y?.onExited?.(he)},onExit:he=>{const we=re;we&&requestAnimationFrame(()=>{ee.current?.contains(document.activeElement)&&we.focus()}),p?.(),N(!1),y?.onExit?.(he)},onEntered:(he,we)=>{c?.(),y?.onEntered?.(he,we)},onEntering:(he,we)=>{N(!0),u?.(ee.current)}};s.useEffect(()=>{L&&ie()},[L]);const Te=a.jsx(Uv,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:O,active:L,children:a.jsx(x,{in:A,timeout:v,role:"presentation",...pe,children:a.jsx(V.Box,{className:"MuiDialog-container",ref:G,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:he=>{he.which===Bo.Escape&&(F(),W.current?.start(he,{center:!1}),setTimeout(()=>W.current?.stop(he),180)),he.stopPropagation()},children:a.jsxs(Kv,{className:Mo({"Mui-focusVisible":X},B),sx:{"& *":he=>J2(he),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:he=>`solid ${gt.alpha(he.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:he=>`solid ${gt.alpha(he.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",...j},defaultPosition:P,ref:$,titleSize:H,rootSize:U,PaperComponent:k,...S,...E,children:[r?a.jsx(V.DialogTitle,{className:Mo({"Mui-selected":X},"draggable-title"),sx:{cursor:"move",display:"flex",color:he=>he.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:he=>`${he.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:he=>he.transitions.duration.shortest/2+"ms"},backgroundColor:he=>gt.alpha(he.palette.action.hover,.03)},ref:Q,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:he=>he.spacing(1),marginLeft:he=>he.spacing(1),marginRight:he=>he.spacing(1)},children:[a.jsx(V.Box,{sx:{flex:"1 1 100%",paddingLeft:he=>he.spacing(1)},children:r}),a.jsx(No,{label:"Close",children:a.jsx(V.IconButton,{"aria-label":"close",sx:{color:he=>he.palette.text.icon??he.palette.action.active},touchRippleRef:W,onPointerDown:he=>{W.current?.start(he,{center:!1}),he.stopPropagation(),he.preventDefault()},onPointerUp:F,children:a.jsx(wn.Close,{})})})]})}):null,g]})})})});let Ae=null;w&&(Ae=a.jsx(b,{...C,open:A,onMouseDown:he=>{F(),C?.onMouseDown?.(he)},onClick:he=>{R?.(he),C?.onClick?.(he)},sx:{pointerEvents:"auto",...C?.sx}}));const{getPortalContainer:ae}=U2();return wo.createPortal(a.jsxs(V.Box,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:K2([ee,I]),onPointerDown:he=>{X&&(he.target===G.current||he.target.tabIndex<0)&&G.current?.contains(document.activeElement)},onContextMenu:he=>{he.isPropagationStopped()||he.preventDefault()},onFocus:he=>{!X&&(he.target===G.current||he.target.tabIndex<0)&&setTimeout(()=>{ie()},100),O.current?.focusTrap?.unpause(),K(!0),G.current?.contains(he.target)&&he.target!==G.current&&J(he.target),he.relatedTarget&&!re&&fe(he.relatedTarget)},onBlur:he=>{ee?.current?.contains(he.relatedTarget)||(fe(null),O.current?.focusTrap?.pause(),K(!1))},children:[Ae,Te]}),ae(),i+"")});var Rr=typeof window<"u"?window:{screen:{},navigator:{}},Qi=(Rr.matchMedia||function(){return{matches:!1}}).bind(Rr),Yv={get passive(){return!0}},I6=function(){};Rr.addEventListener&&Rr.addEventListener("p",I6,Yv),Rr.removeEventListener&&Rr.removeEventListener("p",I6,!1);var eu="ontouchstart"in Rr,Jv=eu||"TouchEvent"in Rr&&Qi("(any-pointer: coarse)").matches,D6=(Rr.navigator.maxTouchPoints||0)>0||Jv,Ep=Rr.navigator.userAgent||"",Qv=Qi("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Ep)&&Math.min(Rr.screen.width||0,Rr.screen.height||0)>=768,_p=(Qi("(pointer: coarse)").matches||!Qi("(pointer: fine)").matches&&eu)&&!/Windows.*Firefox/.test(Ep),ew=Qi("(any-pointer: fine)").matches||Qi("(any-hover: hover)").matches||Qv||!eu,L6=!D6||!ew&&_p?D6?"touchOnly":"mouseOnly":"hybrid",tw=L6==="mouseOnly"?"mouse":L6==="touchOnly"||_p?"touch":"mouse",na=e=>e.type==="checkbox",Q0=e=>e instanceof Date,tr=e=>e==null;const Tp=e=>typeof e=="object";var So=e=>!tr(e)&&!Array.isArray(e)&&Tp(e)&&!Q0(e),tu=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Wo(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(tu&&(e instanceof Blob||o)||!n&&!So(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return So(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Wo(e[r]));else t=e}return t}var B1=e=>/^\w*$/.test(e),ko=e=>e===void 0,Jd=e=>Array.isArray(e)?e.filter(Boolean):[],nu=e=>Jd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Bt=(e,t,n)=>{if(!t||!So(e))return n;const o=(B1(t)?[t]:nu(t)).reduce((r,i)=>tr(r)?r:r[i],e);return ko(o)||o===e?ko(e[t])?n:e[t]:o},e0=e=>typeof e=="boolean",Zn=(e,t,n)=>{let o=-1;const r=B1(t)?[t]:nu(t),i=r.length,l=i-1;for(;++o<i;){const d=r[o];let c=n;if(o!==l){const u=e[d];c=So(u)||Array.isArray(u)?u:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=c,e=e[d]}};const jp="onChange",Mp="onSubmit",ba="all",O6="pattern",P6="required",Rp=s.createContext(null);Rp.displayName="HookFormContext";const nw=e=>{const{children:t,...n}=e;return s.createElement(Rp.Provider,{value:n},t)},ow=typeof window<"u"?F0.useLayoutEffect:F0.useEffect;var n0=e=>typeof e=="string",rw=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Ul=e=>Array.isArray(e)?e:[e],A6=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Qd=e=>tr(e)||!Tp(e);function P0(e,t){if(Qd(e)||Qd(t))return e===t;if(Q0(e)&&Q0(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const l=t[r];if(Q0(i)&&Q0(l)||So(i)&&So(l)||Array.isArray(i)&&Array.isArray(l)?!P0(i,l):i!==l)return!1}}return!0}var ir=e=>So(e)&&!Object.keys(e).length,ou=e=>e.type==="file",Vr=e=>typeof e=="function",h1=e=>{if(!tu)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ip=e=>e.type==="select-multiple",ru=e=>e.type==="radio",zc=e=>h1(e)&&e.isConnected;function To(e,t){const n=Array.isArray(t)?t:B1(t)?[t]:nu(t),o=n.length===1?e:function(l,d){const c=d.slice(0,-1).length;let u=0;for(;u<c;)l=ko(l)?u++:l[d[u++]];return l}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(So(o)&&ir(o)||Array.isArray(o)&&function(l){for(const d in l)if(l.hasOwnProperty(d)&&!ko(l[d]))return!1;return!0}(o))&&To(e,n.slice(0,-1)),e}var Dp=e=>{for(const t in e)if(Vr(e[t]))return!0;return!1};function p1(e,t={}){const n=Array.isArray(e);if(So(e)||n)for(const o in e)Array.isArray(e[o])||So(e[o])&&!Dp(e[o])?(t[o]=Array.isArray(e[o])?[]:{},p1(e[o],t[o])):tr(e[o])||(t[o]=!0);return t}function Lp(e,t,n){const o=Array.isArray(e);if(So(e)||o)for(const r in e)Array.isArray(e[r])||So(e[r])&&!Dp(e[r])?ko(t)||Qd(n[r])?n[r]=Array.isArray(e[r])?p1(e[r],[]):{...p1(e[r])}:Lp(e[r],tr(t)?{}:t[r],n[r]):n[r]=!P0(e[r],t[r]);return n}var Rl=(e,t)=>Lp(e,t,p1(t));const F6={value:!1,isValid:!1},z6={value:!0,isValid:!0};var Op=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ko(e[0].attributes.value)?ko(e[0].value)||e[0].value===""?z6:{value:e[0].value,isValid:!0}:z6:F6}return F6},Pp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>ko(e)?e:t?e===""?NaN:e&&+e:n&&n0(e)?new Date(e):o?o(e):e;const B6={isValid:!1,value:null};var Ap=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,B6):B6;function N6(e){const t=e.ref;return ou(t)?t.files:ru(t)?Ap(e.refs).value:Ip(t)?[...t.selectedOptions].map(({value:n})=>n):na(t)?Op(e.refs).value:Pp(ko(t.value)?e.ref.value:t.value,e)}var f1=e=>e instanceof RegExp,Il=e=>ko(e)?e:f1(e)?e.source:So(e)?f1(e.value)?e.value.source:e.value:e,V6=e=>({isOnSubmit:!e||e===Mp,isOnBlur:e==="onBlur",isOnChange:e===jp,isOnAll:e===ba,isOnTouch:e==="onTouched"});const H6="AsyncFunction";var iw=e=>!!e&&!!e.validate&&!!(Vr(e.validate)&&e.validate.constructor.name===H6||So(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===H6)),$6=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const oa=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Bt(e,r);if(i){const{_f:l,...d}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o||l.ref&&t(l.ref,l.name)&&!o)return!0;if(oa(d,t))break}else if(So(d)&&oa(d,t))break}}};function W6(e,t,n){const o=Bt(e,n);if(o||B1(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Bt(t,i),d=Bt(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var lw=(e,t,n)=>{const o=Ul(Bt(e,n));return Zn(o,"root",t[n]),Zn(e,n,o),e},Hs=e=>n0(e);function U6(e,t,n="validate"){if(Hs(e)||Array.isArray(e)&&e.every(Hs)||e0(e)&&!e)return{type:n,message:Hs(e)?e:"",ref:t}}var Si=e=>So(e)&&!f1(e)?e:{value:e,message:""},q6=async(e,t,n,o,r,i)=>{const{ref:l,refs:d,required:c,maxLength:u,minLength:p,min:f,max:h,pattern:m,validate:g,name:x,valueAsNumber:y,mount:v}=e._f,b=Bt(n,x);if(!v||t.has(x))return{};const C=d?d[0]:l,k=S=>{r&&C.reportValidity&&(C.setCustomValidity(e0(S)?"":S||""),C.reportValidity())},E={},R=ru(l),j=na(l),B=R||j,T=(y||ou(l))&&ko(l.value)&&ko(b)||h1(l)&&l.value===""||b===""||Array.isArray(b)&&!b.length,_=rw.bind(null,x,o,E),w=(S,O,P,M="maxLength",A="minLength")=>{const D=S?O:P;E[x]={type:S?M:A,message:D,ref:l,..._(S?M:A,D)}};if(i?!Array.isArray(b)||!b.length:c&&(!B&&(T||tr(b))||e0(b)&&!b||j&&!Op(d).isValid||R&&!Ap(d).isValid)){const{value:S,message:O}=Hs(c)?{value:!!c,message:c}:Si(c);if(S&&(E[x]={type:P6,message:O,ref:C,..._(P6,O)},!o))return k(O),E}if(!(T||tr(f)&&tr(h))){let S,O;const P=Si(h),M=Si(f);if(tr(b)||isNaN(b)){const A=l.valueAsDate||new Date(b),D=W=>new Date(new Date().toDateString()+" "+W),L=l.type=="time",N=l.type=="week";n0(P.value)&&b&&(S=L?D(b)>D(P.value):N?b>P.value:A>new Date(P.value)),n0(M.value)&&b&&(O=L?D(b)<D(M.value):N?b<M.value:A<new Date(M.value))}else{const A=l.valueAsNumber||b&&+b;tr(P.value)||(S=A>P.value),tr(M.value)||(O=A<M.value)}if((S||O)&&(w(!!S,P.message,M.message,"max","min"),!o))return k(E[x].message),E}if((u||p)&&!T&&(n0(b)||i&&Array.isArray(b))){const S=Si(u),O=Si(p),P=!tr(S.value)&&b.length>+S.value,M=!tr(O.value)&&b.length<+O.value;if((P||M)&&(w(P,S.message,O.message),!o))return k(E[x].message),E}if(m&&!T&&n0(b)){const{value:S,message:O}=Si(m);if(f1(S)&&!b.match(S)&&(E[x]={type:O6,message:O,ref:l,..._(O6,O)},!o))return k(O),E}if(g){if(Vr(g)){const S=U6(await g(b,n),C);if(S&&(E[x]={...S,..._("validate",S.message)},!o))return k(S.message),E}else if(So(g)){let S={};for(const O in g){if(!ir(S)&&!o)break;const P=U6(await g[O](b,n),C,O);P&&(S={...P,..._(O,P.message)},k(P.message),o&&(E[x]=S))}if(!ir(S)&&(E[x]={ref:C,...S},!o))return E}}return k(!0),E};const aw={mode:Mp,reValidateMode:jp,shouldFocusError:!0};function sw(e={}){let t={...aw,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Vr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const o={};let r,i=(So(t.defaultValues)||So(t.values))&&Wo(t.defaultValues||t.values)||{},l=t.shouldUnregister?{}:Wo(i),d={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...p};const h={array:A6(),state:A6()},m=t.criteriaMode===ba,g=async H=>{if(!t.disabled&&(p.isValid||f.isValid||H)){const $=t.resolver?ir((await b()).errors):await C(o,!0);$!==n.isValid&&h.state.next({isValid:$})}},x=(H,$)=>{!t.disabled&&(p.isValidating||p.validatingFields||f.isValidating||f.validatingFields)&&((H||Array.from(c.mount)).forEach(F=>{F&&($?Zn(n.validatingFields,F,$):To(n.validatingFields,F))}),h.state.next({validatingFields:n.validatingFields,isValidating:!ir(n.validatingFields)}))},y=(H,$,F,X)=>{const K=Bt(o,H);if(K){const ne=Bt(l,H,ko(F)?Bt(i,H):F);ko(ne)||X&&X.defaultChecked||$?Zn(l,H,$?ne:N6(K._f)):R(H,ne),d.mount&&g()}},v=(H,$,F,X,K)=>{let ne=!1,J=!1;const re={name:H};if(!t.disabled){if(!F||X){(p.isDirty||f.isDirty)&&(J=n.isDirty,n.isDirty=re.isDirty=k(),ne=J!==re.isDirty);const fe=P0(Bt(i,H),$);J=!!Bt(n.dirtyFields,H),fe?To(n.dirtyFields,H):Zn(n.dirtyFields,H,!0),re.dirtyFields=n.dirtyFields,ne=ne||(p.dirtyFields||f.dirtyFields)&&J!==!fe}if(F){const fe=Bt(n.touchedFields,H);fe||(Zn(n.touchedFields,H,F),re.touchedFields=n.touchedFields,ne=ne||(p.touchedFields||f.touchedFields)&&fe!==F)}ne&&K&&h.state.next(re)}return ne?re:{}},b=async H=>{x(H,!0);const $=await t.resolver(l,t.context,((F,X,K,ne)=>{const J={};for(const re of F){const fe=Bt(X,re);fe&&Zn(J,re,fe._f)}return{criteriaMode:K,names:[...F],fields:J,shouldUseNativeValidation:ne}})(H||c.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return x(H),$},C=async(H,$,F={valid:!0})=>{for(const X in H){const K=H[X];if(K){const{_f:ne,...J}=K;if(ne){const re=c.array.has(ne.name),fe=K._f&&iw(K._f);fe&&p.validatingFields&&x([X],!0);const ie=await q6(K,c.disabled,l,m,t.shouldUseNativeValidation&&!$,re);if(fe&&p.validatingFields&&x([X]),ie[ne.name]&&(F.valid=!1,$))break;!$&&(Bt(ie,ne.name)?re?lw(n.errors,ie,ne.name):Zn(n.errors,ne.name,ie[ne.name]):To(n.errors,ne.name))}!ir(J)&&await C(J,$,F)}}return F.valid},k=(H,$)=>!t.disabled&&(H&&$&&Zn(l,H,$),!P0(S(),i)),E=(H,$,F)=>((X,K,ne,J,re)=>n0(X)?(J&&K.watch.add(X),Bt(ne,X,re)):Array.isArray(X)?X.map(fe=>(J&&K.watch.add(fe),Bt(ne,fe))):(J&&(K.watchAll=!0),ne))(H,c,{...d.mount?l:ko($)?i:n0(H)?{[H]:$}:$},F,$),R=(H,$,F={})=>{const X=Bt(o,H);let K=$;if(X){const ne=X._f;ne&&(!ne.disabled&&Zn(l,H,Pp($,ne)),K=h1(ne.ref)&&tr($)?"":$,Ip(ne.ref)?[...ne.ref.options].forEach(J=>J.selected=K.includes(J.value)):ne.refs?na(ne.ref)?ne.refs.forEach(J=>{J.defaultChecked&&J.disabled||(Array.isArray(K)?J.checked=!!K.find(re=>re===J.value):J.checked=K===J.value||!!K)}):ne.refs.forEach(J=>J.checked=J.value===K):ou(ne.ref)?ne.ref.value="":(ne.ref.value=K,ne.ref.type||h.state.next({name:H,values:Wo(l)})))}(F.shouldDirty||F.shouldTouch)&&v(H,K,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&w(H)},j=(H,$,F)=>{for(const X in $){if(!$.hasOwnProperty(X))return;const K=$[X],ne=H+"."+X,J=Bt(o,ne);(c.array.has(H)||So(K)||J&&!J._f)&&!Q0(K)?j(ne,K,F):R(ne,K,F)}},B=(H,$,F={})=>{const X=Bt(o,H),K=c.array.has(H),ne=Wo($);Zn(l,H,ne),K?(h.array.next({name:H,values:Wo(l)}),(p.isDirty||p.dirtyFields||f.isDirty||f.dirtyFields)&&F.shouldDirty&&h.state.next({name:H,dirtyFields:Rl(i,l),isDirty:k(H,ne)})):!X||X._f||tr(ne)?R(H,ne,F):j(H,ne,F),$6(H,c)&&h.state.next({...n}),h.state.next({name:d.mount?H:void 0,values:Wo(l)})},T=async H=>{d.mount=!0;const $=H.target;let F=$.name,X=!0;const K=Bt(o,F),ne=ie=>{X=Number.isNaN(ie)||Q0(ie)&&isNaN(ie.getTime())||P0(ie,Bt(l,F,ie))},J=V6(t.mode),re=V6(t.reValidateMode);if(K){let ie,ee;const pe=$.type?N6(K._f):So(fe=H)&&fe.target?na(fe.target)?fe.target.checked:fe.target.value:fe,Te=H.type==="blur"||H.type==="focusout",Ae=!(He=>He.mount&&(He.required||He.min||He.max||He.maxLength||He.minLength||He.pattern||He.validate))(K._f)&&!t.resolver&&!Bt(n.errors,F)&&!K._f.deps||((He,Ye,wt,Ct,Ee)=>!Ee.isOnAll&&(!wt&&Ee.isOnTouch?!(Ye||He):(wt?Ct.isOnBlur:Ee.isOnBlur)?!He:!(wt?Ct.isOnChange:Ee.isOnChange)||He))(Te,Bt(n.touchedFields,F),n.isSubmitted,re,J),ae=$6(F,c,Te);Zn(l,F,pe),Te?(K._f.onBlur&&K._f.onBlur(H),r&&r(0)):K._f.onChange&&K._f.onChange(H);const he=v(F,pe,Te),we=!ir(he)||ae;if(!Te&&h.state.next({name:F,type:H.type,values:Wo(l)}),Ae)return(p.isValid||f.isValid)&&(t.mode==="onBlur"?Te&&g():Te||g()),we&&h.state.next({name:F,...ae?{}:he});if(!Te&&ae&&h.state.next({...n}),t.resolver){const{errors:He}=await b([F]);if(ne(pe),X){const Ye=W6(n.errors,o,F),wt=W6(He,o,Ye.name||F);ie=wt.error,F=wt.name,ee=ir(He)}}else x([F],!0),ie=(await q6(K,c.disabled,l,m,t.shouldUseNativeValidation))[F],x([F]),ne(pe),X&&(ie?ee=!1:(p.isValid||f.isValid)&&(ee=await C(o,!0)));X&&(K._f.deps&&w(K._f.deps),((He,Ye,wt,Ct)=>{const Ee=Bt(n.errors,He),Ie=(p.isValid||f.isValid)&&e0(Ye)&&n.isValid!==Ye;var ft;if(t.delayError&&wt?(ft=()=>(($e,yt)=>{Zn(n.errors,$e,yt),h.state.next({errors:n.errors})})(He,wt),r=$e=>{clearTimeout(u),u=setTimeout(ft,$e)},r(t.delayError)):(clearTimeout(u),r=null,wt?Zn(n.errors,He,wt):To(n.errors,He)),(wt?!P0(Ee,wt):Ee)||!ir(Ct)||Ie){const $e={...Ct,...Ie&&e0(Ye)?{isValid:Ye}:{},errors:n.errors,name:He};n={...n,...$e},h.state.next($e)}})(F,ee,ie,he))}var fe},_=(H,$)=>{if(Bt(n.errors,$)&&H.focus)return H.focus(),1},w=async(H,$={})=>{let F,X;const K=Ul(H);if(t.resolver){const ne=await(async J=>{const{errors:re}=await b(J);if(J)for(const fe of J){const ie=Bt(re,fe);ie?Zn(n.errors,fe,ie):To(n.errors,fe)}else n.errors=re;return re})(ko(H)?H:K);F=ir(ne),X=H?!K.some(J=>Bt(ne,J)):F}else H?(X=(await Promise.all(K.map(async ne=>{const J=Bt(o,ne);return await C(J&&J._f?{[ne]:J}:J)}))).every(Boolean),(X||n.isValid)&&g()):X=F=await C(o);return h.state.next({...!n0(H)||(p.isValid||f.isValid)&&F!==n.isValid?{}:{name:H},...t.resolver||!H?{isValid:F}:{},errors:n.errors}),$.shouldFocus&&!X&&oa(o,_,H?K:c.mount),X},S=H=>{const $={...d.mount?l:i};return ko(H)?$:n0(H)?Bt($,H):H.map(F=>Bt($,F))},O=(H,$)=>({invalid:!!Bt(($||n).errors,H),isDirty:!!Bt(($||n).dirtyFields,H),error:Bt(($||n).errors,H),isValidating:!!Bt(n.validatingFields,H),isTouched:!!Bt(($||n).touchedFields,H)}),P=(H,$,F)=>{const X=(Bt(o,H,{_f:{}})._f||{}).ref,K=Bt(n.errors,H)||{},{ref:ne,message:J,type:re,...fe}=K;Zn(n.errors,H,{...fe,...$,ref:X}),h.state.next({name:H,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&X&&X.focus&&X.focus()},M=H=>h.state.subscribe({next:$=>{var F,X,K;F=H.name,X=$.name,K=H.exact,F&&X&&F!==X&&!Ul(F).some(ne=>ne&&(K?ne===X:ne.startsWith(X)||X.startsWith(ne)))||!((ne,J,re,fe)=>{re(ne);const{name:ie,...ee}=ne;return ir(ee)||Object.keys(ee).length>=Object.keys(J).length||Object.keys(ee).find(pe=>J[pe]===(!fe||ba))})($,H.formState||p,G,H.reRenderRoot)||H.callback({values:{...l},...n,...$})}}).unsubscribe,A=(H,$={})=>{for(const F of H?Ul(H):c.mount)c.mount.delete(F),c.array.delete(F),$.keepValue||(To(o,F),To(l,F)),!$.keepError&&To(n.errors,F),!$.keepDirty&&To(n.dirtyFields,F),!$.keepTouched&&To(n.touchedFields,F),!$.keepIsValidating&&To(n.validatingFields,F),!t.shouldUnregister&&!$.keepDefaultValue&&To(i,F);h.state.next({values:Wo(l)}),h.state.next({...n,...$.keepDirty?{isDirty:k()}:{}}),!$.keepIsValid&&g()},D=({disabled:H,name:$})=>{(e0(H)&&d.mount||H||c.disabled.has($))&&(H?c.disabled.add($):c.disabled.delete($))},L=(H,$={})=>{let F=Bt(o,H);const X=e0($.disabled)||e0(t.disabled);return Zn(o,H,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:H}},name:H,mount:!0,...$}}),c.mount.add(H),F?D({disabled:e0($.disabled)?$.disabled:t.disabled,name:H}):y(H,!0,$.value),{...X?{disabled:$.disabled||t.disabled}:{},...t.progressive?{required:!!$.required,min:Il($.min),max:Il($.max),minLength:Il($.minLength),maxLength:Il($.maxLength),pattern:Il($.pattern)}:{},name:H,onChange:T,onBlur:T,ref:K=>{if(K){L(H,$),F=Bt(o,H);const re=ko(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,fe=(ee=>ru(ee)||na(ee))(re),ie=F._f.refs||[];if(fe?ie.find(ee=>ee===re):re===F._f.ref)return;Zn(o,H,{_f:{...F._f,...fe?{refs:[...ie.filter(zc),re,...Array.isArray(Bt(i,H))?[{}]:[]],ref:{type:re.type,name:H}}:{ref:re}}}),y(H,!1,void 0,re)}else F=Bt(o,H,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||$.shouldUnregister)&&(ne=c.array,J=H,!ne.has((re=>re.substring(0,re.search(/\.\d+(\.|$)/))||re)(J))||!d.action)&&c.unMount.add(H);var ne,J}}},N=()=>t.shouldFocusError&&oa(o,_,c.mount),W=(H,$)=>async F=>{let X;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let K=Wo(l);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ne,values:J}=await b();n.errors=ne,K=J}else await C(o);if(c.disabled.size)for(const ne of c.disabled)Zn(K,ne,void 0);if(To(n.errors,"root"),ir(n.errors)){h.state.next({errors:{}});try{await H(K,F)}catch(ne){X=ne}}else $&&await $({...n.errors},F),N(),setTimeout(N);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ir(n.errors)&&!X,submitCount:n.submitCount+1,errors:n.errors}),X)throw X},I=(H,$={})=>{const F=H?Wo(H):i,X=Wo(F),K=ir(H),ne=K?i:X;if($.keepDefaultValues||(i=F),!$.keepValues){if($.keepDirtyValues){const J=new Set([...c.mount,...Object.keys(Rl(i,l))]);for(const re of Array.from(J))Bt(n.dirtyFields,re)?Zn(ne,re,Bt(l,re)):B(re,Bt(ne,re))}else{if(tu&&ko(H))for(const J of c.mount){const re=Bt(o,J);if(re&&re._f){const fe=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(h1(fe)){const ie=fe.closest("form");if(ie){ie.reset();break}}}}for(const J of c.mount)B(J,Bt(ne,J))}l=Wo(ne),h.array.next({values:{...ne}}),h.state.next({values:{...ne}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!p.isValid||!!$.keepIsValid||!!$.keepDirtyValues,d.watch=!!t.shouldUnregister,h.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:!K&&($.keepDirty?n.isDirty:!(!$.keepDefaultValues||P0(H,i))),isSubmitted:!!$.keepIsSubmitted&&n.isSubmitted,dirtyFields:K?{}:$.keepDirtyValues?$.keepDefaultValues&&l?Rl(i,l):n.dirtyFields:$.keepDefaultValues&&H?Rl(i,H):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:!!$.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},U=(H,$)=>I(Vr(H)?H(l):H,$),G=H=>{n={...n,...H}},Q={control:{register:L,unregister:A,getFieldState:O,handleSubmit:W,setError:P,_subscribe:M,_runSchema:b,_focusError:N,_getWatch:E,_getDirty:k,_setValid:g,_setFieldArray:(H,$=[],F,X,K=!0,ne=!0)=>{if(X&&F&&!t.disabled){if(d.action=!0,ne&&Array.isArray(Bt(o,H))){const J=F(Bt(o,H),X.argA,X.argB);K&&Zn(o,H,J)}if(ne&&Array.isArray(Bt(n.errors,H))){const J=F(Bt(n.errors,H),X.argA,X.argB);K&&Zn(n.errors,H,J),((re,fe)=>{!Jd(Bt(re,fe)).length&&To(re,fe)})(n.errors,H)}if((p.touchedFields||f.touchedFields)&&ne&&Array.isArray(Bt(n.touchedFields,H))){const J=F(Bt(n.touchedFields,H),X.argA,X.argB);K&&Zn(n.touchedFields,H,J)}(p.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Rl(i,l)),h.state.next({name:H,isDirty:k(H,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Zn(l,H,$)},_setDisabledField:D,_setErrors:H=>{n.errors=H,h.state.next({errors:n.errors,isValid:!1})},_getFieldArray:H=>Jd(Bt(d.mount?l:i,H,t.shouldUnregister?Bt(i,H,[]):[])),_reset:I,_resetDefaultValues:()=>Vr(t.defaultValues)&&t.defaultValues().then(H=>{U(H,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const H of c.unMount){const $=Bt(o,H);$&&($._f.refs?$._f.refs.every(F=>!zc(F)):!zc($._f.ref))&&A(H)}c.unMount=new Set},_disableForm:H=>{e0(H)&&(h.state.next({disabled:H}),oa(o,($,F)=>{const X=Bt(o,F);X&&($.disabled=X._f.disabled||H,Array.isArray(X._f.refs)&&X._f.refs.forEach(K=>{K.disabled=X._f.disabled||H}))},0,!1))},_subjects:h,_proxyFormState:p,get _fields(){return o},get _formValues(){return l},get _state(){return d},set _state(H){d=H},get _defaultValues(){return i},get _names(){return c},set _names(H){c=H},get _formState(){return n},get _options(){return t},set _options(H){t={...t,...H}}},subscribe:H=>(d.mount=!0,f={...f,...H.formState},M({...H,formState:f})),trigger:w,register:L,handleSubmit:W,watch:(H,$)=>Vr(H)?h.state.subscribe({next:F=>H(E(void 0,$),F)}):E(H,$,!0),setValue:B,getValues:S,reset:U,resetField:(H,$={})=>{Bt(o,H)&&(ko($.defaultValue)?B(H,Wo(Bt(i,H))):(B(H,$.defaultValue),Zn(i,H,Wo($.defaultValue))),$.keepTouched||To(n.touchedFields,H),$.keepDirty||(To(n.dirtyFields,H),n.isDirty=$.defaultValue?k(H,Wo(Bt(i,H))):k()),$.keepError||(To(n.errors,H),p.isValid&&g()),h.state.next({...n}))},clearErrors:H=>{H&&Ul(H).forEach($=>To(n.errors,$)),h.state.next({errors:H?n.errors:{}})},unregister:A,setError:P,setFocus:(H,$={})=>{const F=Bt(o,H),X=F&&F._f;if(X){const K=X.refs?X.refs[0]:X.ref;K.focus&&(K.focus(),$.shouldSelect&&Vr(K.select)&&K.select())}},getFieldState:O};return{...Q,formControl:Q}}const cw=["Ok","Cancel"],e2=e=>{const{description:t,icon:n,onCancel:o,onOption:r,onDone:i,onValidateOption:l,createOptionsButton:d,options:c=cw,autoFocusSel:u=".defaultOption",defaultOption:p=c[0],cancelOption:f="Cancel",children:h,...m}=e,g=function(_={}){const w=s.useRef(void 0),S=s.useRef(void 0),[O,P]=s.useState({isDirty:!1,isValidating:!1,isLoading:Vr(_.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:_.errors||{},disabled:_.disabled||!1,isReady:!1,defaultValues:Vr(_.defaultValues)?void 0:_.defaultValues});if(!w.current)if(_.formControl)w.current={..._.formControl,formState:O},_.defaultValues&&!Vr(_.defaultValues)&&_.formControl.reset(_.defaultValues,_.resetOptions);else{const{formControl:A,...D}=sw(_);w.current={...D,formState:O}}const M=w.current.control;return M._options=_,ow(()=>{const A=M._subscribe({formState:M._proxyFormState,callback:()=>P({...M._formState}),reRenderRoot:!0});return P(D=>({...D,isReady:!0})),M._formState.isReady=!0,A},[M]),s.useEffect(()=>M._disableForm(_.disabled),[M,_.disabled]),s.useEffect(()=>{_.mode&&(M._options.mode=_.mode),_.reValidateMode&&(M._options.reValidateMode=_.reValidateMode)},[M,_.mode,_.reValidateMode]),s.useEffect(()=>{_.errors&&(M._setErrors(_.errors),M._focusError())},[M,_.errors]),s.useEffect(()=>{_.shouldUnregister&&M._subjects.state.next({values:M._getWatch()})},[M,_.shouldUnregister]),s.useEffect(()=>{if(M._proxyFormState.isDirty){const A=M._getDirty();A!==O.isDirty&&M._subjects.state.next({isDirty:A})}},[M,O.isDirty]),s.useEffect(()=>{_.values&&!P0(_.values,S.current)?(M._reset(_.values,M._options.resetOptions),S.current=_.values,P(A=>({...A}))):M._resetDefaultValues()},[M,_.values]),s.useEffect(()=>{M._state.mount||(M._setValid(),M._state.mount=!0),M._state.watch&&(M._state.watch=!1,M._subjects.state.next({...M._formState})),M._removeUnmounted()}),w.current.formState=((A,D,L,N=!0)=>{const W={defaultValues:D._defaultValues};for(const I in A)Object.defineProperty(W,I,{get:()=>{const U=I;return D._proxyFormState[U]!==ba&&(D._proxyFormState[U]=!N||ba),A[U]}});return W})(O,M),w.current}({shouldUseNativeValidation:!1}),{handleSubmit:x,formState:y}=g,v=s.useRef(null),b=s.useRef(null),C=s.useRef(null),k=fn(async _=>{let w;try{if(w=await Promise.resolve(l?.(_))??!0,w!==!0)return;await Promise.resolve(r?.(_,_===f,_===p)),i?.(_)}catch{}},[r,i,l,f,p]),E=fn((_,w)=>{setTimeout(()=>{k(p)},180)},[k]),R=fn(()=>{r?.(f,!0,!1),o?.(),i?.(null)},[r,f,o,i]),j=y&&(Object.keys(y.errors).length>0||y.disabled||y.isSubmitted),B=fn((_,w)=>{const S=_===f,O={className:w?"defaultOption":"action",type:w?"submit":"button",style:{minWidth:"75px"},onClick:()=>{S?R():w||k(_)}};if(d)return d(_,O,w);const P={className:w?"defaultOption":"action",variant:w?"contained":"outlined",size:"small",disabled:!S&&j,color:"primary",...O};if(w||S){const M=w?v:b;P.touchRippleRef=M,P.onPointerDown=A=>{M.current?.start(A,{center:!1}),A.stopPropagation(),A.preventDefault()}}return a.jsx(V.Button,{...P,children:a.jsx("div",{style:{paddingTop:"3px"},children:_})},`action:${_}`)},[c,p,f,d,y]),T=s.useMemo(()=>{const _=[];for(let w=0;w<c.length;w++){const S=c[w],O=p?S===p:w===0;_.push(B(S,O))}return _},[c,p,y]);return a.jsx(kp,{onCancel:R,initialPosition:{y:tw==="touch"?"15":"35"},onDone:i,autoFocusSel:u,isModal:!0,PaperProps:{},...m,children:a.jsx(nw,{...g,children:a.jsxs("form",{ref:C,onSubmit:x(E),children:[a.jsx(V.DialogContent,{dividers:!0,onKeyDown:_=>{if(_.isDefaultPrevented())return;_.stopPropagation();let w=null,S=null;const O=_.which===Bo.Escape&&f;if(O)w=f,S=b;else{if(j)return;_.which===Bo.Enter&&(w=p??c[0],S=v)}w&&(S.current?.start(_,{center:!1}),setTimeout(()=>{S.current?.stop(_),O&&k(w)},180))},children:a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:_=>_.spacing(n||t?1.5:0)},children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column"},children:[n,t]}),h]})}),a.jsx(V.DialogActions,{sx:{paddingTop:_=>_.spacing(1),paddingBottom:_=>_.spacing(1),paddingLeft:_=>_.spacing(1),paddingRight:_=>_.spacing(1),backgroundColor:_=>gt.alpha(_.palette.action.hover,.03)},children:T})]})})})},dw=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:e2,default:e2},Symbol.toStringTag,{value:"Module"})),uw=s.lazy(()=>Promise.resolve().then(()=>dw)),hw=s.lazy(()=>Promise.resolve().then(()=>require("./BNuSzQJqJbqHwotK.cjs"))),ll=s.memo(s.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...l}=e;return q2(n),a.jsx(No,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...l,children:a.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),Re=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:l,labelOverride:d,disabled:c=!1,variant:u=jr.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...m}=e,g=s.useRef(null),x=s.useRef(!1),y=s.useMemo(()=>{const B={onExecute(T,_){o?.onExecute?.(T,_),x.current||(g.current?.start({center:!1}),setTimeout(()=>g.current?.stop({}),180)),x.current=!1},onError(T,_,w){o?.onError(T,_,w)}};return o?.beforeExecute&&(B.beforeExecute=o.beforeExecute),B},[o]),v=q2(n,y),b=s.useCallback(B=>{B.button===0&&B.preventDefault()},[]),C=s.useCallback(B=>{B.button===0&&n?.execute(f,o)},[v,o,f]),k=s.useCallback(B=>{B.keyCode!==Bo.Enter&&B.keyCode!==Bo.Space||n?.execute(f,o)},[v,o,f]),E=s.useMemo(()=>l||u===jr.Toolbar||n?.state()?typeof l=="function"?l(n):l:z1,[v,l]),R=s.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:u===jr.Toolbar?E:a.jsx(Aa,{selected:n?.state()??!1,children:E}),touchRippleRef:g,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:C,onKeyDown:k}),[v,o,c,E]);let j;return j=u===jr.Menuitem?a.jsx(sr,{...m,chips:n?.tags(),...R,children:d??n?.label(r,i)}):a.jsx(xr,{...m,...R}),(d||n?.label())&&((n.disabled()||c)&&(j=a.jsx("div",{children:j})),j=a.jsx(ll,{command:n,placement:u===jr.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:j})),j})),pw=s.memo(s.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=z1,label:i,variant:l=jr.Toolbar,disabled:d=!1,commandHook:c,...u}=e,p=s.useRef(null),f=s.useRef(!1),h=s.useMemo(()=>{const j={onExecute(B,T){c?.onExecute?.(B,T),f.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),f.current=!1},onError(B,T,_){c?.onError(B,T,_)}};return c?.beforeExecute&&(j.beforeExecute=c.beforeExecute),j},[c]),m=q2(n,h),g=()=>n?.state()?.toString()||"0",[x,y]=s.useState(g),v=fn(()=>{const j=parseFloat(x);isNaN(j)?y(g()):parseFloat(g())!==j&&n.execute(j,c)},[g,n,x,c]);s.useEffect(()=>{y(g())},[n?.state()]);const b=s.useMemo(()=>typeof r=="function"?r(n):r,[m,r]),C=s.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[m]),k=s.useMemo(()=>a.jsx(V.IconButton,{...u,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:j=>j.stopPropagation(),onMouseDown:j=>{j.button===0&&j.stopPropagation()},onMouseUp:j=>{j.button===0&&j.stopPropagation()},children:a.jsx(V.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:j=>`${Math.round(j.typography.fontSize)}px`,width:j=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:x,onFocus:j=>{j.target?.select()},onKeyDown:j=>{if(j.which===Bo.Enter)g()!==x&&(j.stopPropagation(),j.preventDefault(),v());else if(j.which===Bo.Escape)g()!==x&&(y(g()),setTimeout(()=>{j.target?.select()},0),j.stopPropagation(),j.preventDefault());else{if(j.key.match("[-]")||j.key.match("[0-9.]")&&(x+j.key).length>4)return j.stopPropagation(),void j.preventDefault();if(j.which===Bo.Space)return void j.preventDefault()}},onBlur:()=>{v()},onChange:j=>{if(j.target.value.length>4)return j.stopPropagation(),void j.preventDefault();y(j.target.value)}})}),[x,d,n]),E={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:d||!n||n.disabled(),onMouseDown:j=>{j.button===0&&j.preventDefault()},onMouseUp:j=>{j.button!==0||j.isPropagationStopped()||j.isDefaultPrevented()||j.isDefaultPrevented()||(j.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:j=>{j.keyCode!==Bo.Enter&&j.keyCode!==Bo.Space||n?.execute(!n?.state?.(),h)}};let R;return R=l===jr.Menuitem?a.jsxs(sr,{...u,chips:n?.tags(),...E,children:[C,k]}):a.jsx(xr,{...u,...E}),n?.label()&&((n.disabled()||d)&&(R=a.jsx("div",{children:R})),R=a.jsx(ll,{command:n,placement:l===jr.Toolbar?"bottom-start":"right-start",children:R})),R})),Pn=s.memo(s.forwardRef((e,t)=>{const{variant:n=jr.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:l,commandHook:d,disabled:c,label:u,icon:p,createPopupPanel:f,tooltip:h,selected:m,scope:g,...x}=e,y=s.useRef(null),v=s.useRef(!1),b=s.useMemo(()=>{const _={onExecute(w,S){d?.onExecute?.(w,S),v.current||(y.current?.start({center:!1}),setTimeout(()=>y.current?.stop({}),180)),v.current=!1},onError(w,S,O){d?.onError(w,S,O)}};return d?.beforeExecute&&(_.beforeExecute=d.beforeExecute),_},[d]),C=Z2(i,[o],null,[o]),k=C[0],{label:E,icon:R}=s.useMemo(()=>{let _=null;u&&(_=typeof u=="function"?u(k):u),_||(_=k?.label?.(g));let w=null;return p&&(w=typeof p=="function"?p(k):p),w||(w=k?.icon?.()),{label:_,icon:w}},[C,u,p]),j={disabled:c,scope:g,touchRippleRef:y,onQuickClick:r,tooltip:h,label:E,icon:R};(E||h)&&(j.createTooltip=({children:_},w)=>a.jsx(No,{label:E,description:h,disabled:w,children:_}));const B=fn(_=>f?.(_,i),[f,C]),T=fn(_=>k?.execute(l,b),[k]);return k?(j.quickButtonProps={},j.quickButtonProps.createTooltip=({children:_,placement:w},S)=>a.jsx(ll,{command:k,placement:w??n===jr.Toolbar?"bottom-start":"right-start",disabled:S,children:_}),j.disabled=j.disabled??k?.disabled(),r||(j.onQuickClick=T)):o&&(j.onQuickClick=()=>{}),j.selected=m??k?.state(),j.createPopupPanel=B,n===jr.Toolbar?a.jsx(Ur,{...x,...j,ref:t}):a.jsx(Pa,{...x,...j,ref:t})}));Pn.displayName="CommandPopupButton";const el=e=>{const{command:t,label:n,scope:o,icon:r=a.jsx(R2,{}),sx:i,...l}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:d=>d.typography.subtitle2.fontSize,...i},...l,children:[r?ye(r):null,a.jsx(V.Typography,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:d=>d.spacing(.25),paddingRight:d=>d.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},Fa=s.memo(s.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:l,children:d,...c}=e,u=F1(t,()=>({}),[]),[p,f]=s.useState(null),{reference:h}=i0({label:"toolbar",anchor:u.current,parentFloat:i,createPopupPanel:null}),m=s.useCallback(()=>{const j=p;j&&requestAnimationFrame(()=>{u.current?.contains(document.activeElement)&&j.focus()})},[]),g=s.useMemo(()=>({dense:!0,outlined:!1}),[]),x=s.useMemo(()=>{const{commandHook:j,...B}=r||{};return{commandHook:{beforeExecute:(T,_)=>j?.beforeExecute?.(T,_)!==!1&&h.closeAll(),onExecute(T,_){j?.onExecute?.(T,_),m()},onError(T,_,w){j?.onError?.(T,_,w)}},...B}},[h,r]),y=s.useMemo(()=>({...g,...x}),[g,x]),[v,b]=s.useReducer(j=>j+1,0);Z2(o,[],{onChange:()=>{b()}});const C=s.useMemo(()=>({commands:o,parentFloat:h,...x}),[v,y,h,r]);let k=0;g.dense||(k+=2),g.outlined&&k++;let E=2;g.dense||(E=4);const R=s.useMemo(()=>l({commands:o,commandButtonProps:y,commandPopupProps:{commands:o,...C,...r}}),[v,y,C,l]);return a.jsx(V.Toolbar,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${E}px`,paddingBottom:`${E}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:u,onFocus:j=>{j.relatedTarget&&!p&&f(j.relatedTarget)},onBlur:j=>{p&&!u?.current?.contains(j.relatedTarget)&&f(null)},onKeyDown:j=>{p&&j.which===Bo.Escape&&p.focus()},...c,children:a.jsx("div",{ref:u,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${E}px`,columnGap:`${k}px`,alignItems:"center",maxWidth:"100%"},children:R})})}));Fa.displayName="CommandToolbar";const fw=e=>{const{key:t,...n}=e;return a.jsx(Re,{...n},t)},o0=s.memo(s.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o,scope:r,commands:i,icon:l,quickCommand:d,popupScope:c=d,commandState:u,commandHook:p,disabled:f=!1,...h}=e;Z2(i,[d,...n]);const m=s.useCallback((g,x)=>{const y={variant:jr.Menuitem,commandHook:p,commandState:u,icon:l,scope:c,disabled:f},v=[];for(let b=0;b<n?.length;b++){const C=n[b];if(C===null||C==="-"){v.push(a.jsx(Lt,{orientation:"horizontal"},`element-${v.length}`));continue}const k=x.getCommand(C),E={key:`${C}-${v.length}`,command:k,...y},R=o?.(E)??fw(E);R&&v.push(R)}return _n({...g,children:v})},[f,p,u,c,n,l,o]);return a.jsx(Pn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:u,scope:r,quickCommand:d,icon:l,createPopupPanel:m,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Fp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),u=s.useMemo(()=>{for(let m=0;m<c.length;m++)if(c[m]?.state())return c[m].key();return c[0]?.key()},[c]),p=s.useMemo(()=>{const m=new Map;return m.set("formatAlignLeftToggle",ye(a.jsx(wn.FormatAlignLeft,{}))),m.set("formatAlignCenterToggle",ye(a.jsx(wn.FormatAlignCenter,{}))),m.set("formatAlignRightToggle",ye(a.jsx(wn.FormatAlignRight,{}))),m.set("formatAlignJustifyToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m.set("formatAlignCenterContinuousToggle",ye(a.jsx(wn.FormatAlignCenter,{}))),m.set("formatAlignFillToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m.set("formatAlignDistributedHorizontalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),m},[]),f=s.useMemo(()=>{if(!o)return null;const m={...o};return delete m.beforeExecute,m},[o]),h=s.useCallback((m,g)=>{const x={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},y=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...x,command:g.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...x,command:g.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),a.jsx(Re,{...x,command:g.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=a.jsxs(V.Box,{sx:{className:Qn("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:C=>C.stopPropagation(),children:[a.jsx(Re,{command:g.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ye(a.jsx(db,{}))}),a.jsx(Re,{command:g.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ye(a.jsx(cb,{}))})]}),b=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...d,children:[v,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return _n({...m,children:b})},[i,o]);return a.jsx(Pn,{ref:t,parentFloat:l,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:u,icon:p.get(u)??a.jsx(wn.FormatAlignLeft,{}),...d})})),zp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatAlignTopToggle",ye(a.jsx(yb,{}))),f.set("formatAlignMiddleToggle",ye(a.jsx(bb,{}))),f.set("formatAlignBottomToggle",ye(a.jsx(X3,{}))),f.set("formatAlignJustifyVerticalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),f.set("formatAlignDistributedVerticalToggle",ye(a.jsx(wn.FormatAlignJustify,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatAlignTopToggle"),icon:u.get("formatAlignTopToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignMiddleToggle"),icon:u.get("formatAlignMiddleToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignBottomToggle"),icon:u.get("formatAlignBottomToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...m,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:u.get("formatAlignJustifyVerticalToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:u.get("formatAlignDistributedVerticalToggle")})]});return _n({...f,children:g})},[i,o,u]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:u.get(c)??ye(a.jsx(X3,{})),...l})})),Bp=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatTextOverflowVisibleToggle",ye(a.jsx(t3,{}))),f.set("formatTextOverflowWrapToggle",ye(a.jsx(ox,{}))),f.set("formatTextOverflowClipToggle",ye(a.jsx(rx,{}))),f.set("formatTextOverflowShrinkToggle",ye(a.jsx(ix,{}))),f},[]),p=ue((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:u.get("formatTextOverflowVisibleToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowWrapToggle"),icon:u.get("formatTextOverflowWrapToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowClipToggle"),icon:u.get("formatTextOverflowClipToggle")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...m,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:u.get("formatTextOverflowShrinkToggle")})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:u.get(c)??ye(a.jsx(t3,{})),...l})})),Np=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=s.useMemo(()=>{for(let h=0;h<d.length;h++)if(d[h]?.state())return d[h].key();return d[1]?.key()},[d]),u=s.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ye(a.jsx(cs,{}))),h.set("formatTextRotate315",ye(a.jsx(cs,{}))),h.set("formatTextRotate45",ye(a.jsx(q3,{}))),h.set("formatTextRotate90",ye(a.jsx(Z3,{}))),h.set("formatTextRotate270",ye(a.jsx(G3,{}))),h.set("formatTextRotateCustom",ye(a.jsx(K3,{}))),h},[]),p=s.useCallback((h,m)=>{const g={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},x=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...g,command:m.getCommand("formatTextRotate0"),icon:ye(a.jsx(xb,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate315"),icon:ye(a.jsx(cs,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate45"),icon:ye(a.jsx(q3,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate90"),icon:ye(a.jsx(Z3,{}))}),a.jsx(Re,{...g,command:m.getCommand("formatTextRotate270"),icon:ye(a.jsx(G3,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(pw,{...g,command:m.getCommand("formatTextRotateCustom"),icon:ye(a.jsx(K3,{})),label:"Custom"})]});return _n({...h,children:x})},[i,o,r]),f=s.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[d]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,selected:f,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:f?"formatTextRotate0":"formatTextRotate315",icon:ye(u.get(c)??a.jsx(cs,{})),...l})}));function di(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const A0="$$material";function mw(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5,...r}=e,i=(p=>{const f=Object.keys(p).map(h=>({key:h,val:p[h]}))||[];return f.sort((h,m)=>h.val-m.val),f.reduce((h,m)=>({...h,[m.key]:m.val}),{})})(t),l=Object.keys(i);function d(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-o/100}${n})`}function u(p,f){const h=l.indexOf(f);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(h!==-1&&typeof t[l[h]]=="number"?t[l[h]]:f)-o/100}${n})`}return{keys:l,values:i,up:d,down:c,between:u,only:function(p){return l.indexOf(p)+1<l.length?u(p,l[l.indexOf(p)+1]):d(p)},not:function(p){const f=l.indexOf(p);return f===0?d(l[1]):f===l.length-1?c(l[f]):u(p,l[l.indexOf(p)+1]).replace("@media","@media not all and")},unit:n,...r}}var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Z6,G6,K6={exports:{}},Vn={};function gw(){if(Z6)return Vn;Z6=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(x){if(typeof x=="object"&&x!==null){var y=x.$$typeof;switch(y){case e:switch(x=x.type){case n:case r:case o:case c:case u:case h:return x;default:switch(x=x&&x.$$typeof){case l:case d:case f:case p:case i:return x;default:return y}}case t:return y}}}return Vn.ContextConsumer=i,Vn.ContextProvider=l,Vn.Element=e,Vn.ForwardRef=d,Vn.Fragment=n,Vn.Lazy=f,Vn.Memo=p,Vn.Portal=t,Vn.Profiler=r,Vn.StrictMode=o,Vn.Suspense=c,Vn.SuspenseList=u,Vn.isContextConsumer=function(x){return g(x)===i},Vn.isContextProvider=function(x){return g(x)===l},Vn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Vn.isForwardRef=function(x){return g(x)===d},Vn.isFragment=function(x){return g(x)===n},Vn.isLazy=function(x){return g(x)===f},Vn.isMemo=function(x){return g(x)===p},Vn.isPortal=function(x){return g(x)===t},Vn.isProfiler=function(x){return g(x)===r},Vn.isStrictMode=function(x){return g(x)===o},Vn.isSuspense=function(x){return g(x)===c},Vn.isSuspenseList=function(x){return g(x)===u},Vn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===r||x===o||x===c||x===u||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===p||x.$$typeof===l||x.$$typeof===i||x.$$typeof===d||x.$$typeof===m||x.getModuleId!==void 0)},Vn.typeOf=g,Vn}function xw(){return G6||(G6=1,K6.exports=gw()),K6.exports}var Vp=xw();function p0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function Hp(e){if(F0.isValidElement(e)||Vp.isValidElementType(e)||!p0(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Hp(e[n])}),t}function yr(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return p0(e)&&p0(t)&&Object.keys(t).forEach(r=>{F0.isValidElement(t[r])||Vp.isValidElementType(t[r])?o[r]=t[r]:p0(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&p0(e[r])?o[r]=yr(e[r],t[r],n):n.clone?o[r]=p0(t[r])?Hp(t[r]):t[r]:o[r]=t[r]}),o}function iu(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function B0(e){if(e.type)return e;if(e.charAt(0)==="#")return B0(function(i){i=i.slice(1);const l=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let d=i.match(l);return d&&d[0].length===1&&(d=d.map(c=>c+c)),d?`rgb${d.length===4?"a":""}(${d.map((c,u)=>u<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(di(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(di(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const ql=(e,t)=>{try{return(n=>{const o=B0(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function N1(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function $p(e){e=B0(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),l=(u,p=(u+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let d="rgb";const c=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return e.type==="hsla"&&(d+="a",c.push(t[3])),N1({type:d,values:c})}function t2(e){let t=(e=B0(e)).type==="hsl"||e.type==="hsla"?B0($p(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ps(e,t,n){try{return function(o,r){return o=B0(o),r=iu(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,N1(o)}(e,t)}catch{return e}}function lu(e,t){if(e=B0(e),t=iu(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return N1(e)}function Un(e,t,n){try{return lu(e,t)}catch{return e}}function au(e,t){if(e=B0(e),t=iu(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return N1(e)}function qn(e,t,n){try{return au(e,t)}catch{return e}}function fs(e,t,n){try{return function(o,r=.15){return t2(o)>.5?lu(o,r):au(o,r)}(e,t)}catch{return e}}const va={black:"#000",white:"#fff"},yw={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},bw="#f3e5f5",vw="#ce93d8",ww="#ba68c8",Sw="#ab47bc",Cw="#9c27b0",kw="#7b1fa2",Ew="#e57373",_w="#ef5350",Tw="#f44336",X6="#d32f2f",jw="#c62828",Mw="#ffb74d",Rw="#ffa726",Iw="#ff9800",Dw="#f57c00",Lw="#e65100",Ow="#e3f2fd",Pw="#90caf9",Y6="#42a5f5",Aw="#1976d2",Fw="#1565c0",zw="#4fc3f7",Bw="#29b6f6",Nw="#03a9f4",J6="#0288d1",Vw="#01579b",Hw="#81c784",$w="#66bb6a",Ww="#4caf50",Uw="#388e3c",qw="#2e7d32",Zw="#1b5e20";function Wp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:va.white,default:va.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Gw=Wp();function Up(){return{text:{primary:va.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:va.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Q6=Up();function e4(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=au(e.main,r):t==="dark"&&(e.dark=lu(e.main,i)))}function su(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(g="light"){return g==="dark"?{main:Pw,light:Ow,dark:Y6}:{main:Aw,light:Y6,dark:Fw}}(t),l=e.secondary||function(g="light"){return g==="dark"?{main:vw,light:bw,dark:Sw}:{main:Cw,light:ww,dark:kw}}(t),d=e.error||function(g="light"){return g==="dark"?{main:Tw,light:Ew,dark:X6}:{main:X6,light:_w,dark:jw}}(t),c=e.info||function(g="light"){return g==="dark"?{main:Bw,light:zw,dark:J6}:{main:J6,light:Nw,dark:Vw}}(t),u=e.success||function(g="light"){return g==="dark"?{main:$w,light:Hw,dark:Uw}:{main:qw,light:Ww,dark:Zw}}(t),p=e.warning||function(g="light"){return g==="dark"?{main:Rw,light:Mw,dark:Dw}:{main:"#ed6c02",light:Iw,dark:Lw}}(t);function f(g){return function(y,v){const b=t2(y),C=t2(v);return(Math.max(b,C)+.05)/(Math.min(b,C)+.05)}(g,Q6.text.primary)>=n?Q6.text.primary:Gw.text.primary}const h=({color:g,name:x,mainShade:y=500,lightShade:v=300,darkShade:b=700})=>{if(!(g={...g}).main&&g[y]&&(g.main=g[y]),!g.hasOwnProperty("main"))throw new Error(di(11,x?` (${x})`:"",y));if(typeof g.main!="string")throw new Error(di(12,x?` (${x})`:"",JSON.stringify(g.main)));return e4(g,"light",v,o),e4(g,"dark",b,o),g.contrastText||(g.contrastText=f(g.main)),g};let m;return t==="light"?m=Wp():t==="dark"&&(m=Up()),yr({common:{...va},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:d,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:u,name:"success"}),grey:yw,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...m},r)}var t4,n4,Bc,o4,r4,i4={exports:{}};function Kw(){return n4?t4:(n4=1,t4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Xw(){if(o4)return Bc;o4=1;var e=Kw();function t(){}function n(){}return n.resetWarningCache=t,Bc=function(){function o(l,d,c,u,p,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Bc}function za(){return r4||(r4=1,i4.exports=Xw()()),i4.exports}function ra(e,t){return t?yr(e,t,{clone:!1}):e}function l4(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const V1={xs:0,sm:600,md:900,lg:1200,xl:1536},a4={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${V1[e]}px)`},Yw={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:V1[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function g0(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||a4;return t.reduce((i,l,d)=>(i[r.up(r.keys[d])]=n(t[d]),i),{})}if(typeof t=="object"){const r=o.breakpoints||a4;return Object.keys(t).reduce((i,l)=>{if(d=r.keys,(c=l)==="@"||c.startsWith("@")&&(d.some(u=>c.startsWith(`@${u}`))||c.match(/^@\d/))){const u=function(p,f){const h=f.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,m,g]=h,x=Number.isNaN(+m)?m||0:+m;return p.containerQueries(g).up(x)}(o.containerQueries?o:Yw,l);u&&(i[u]=n(t[l],l))}else if(Object.keys(r.values||V1).includes(l))i[r.up(l)]=n(t[l],l);else{const u=l;i[u]=t[u]}var d,c;return i},{})}return n(t)}function s4(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function qp(e){if(typeof e!="string")throw new Error(di(7));return e.charAt(0).toUpperCase()+e.slice(1)}function H1(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function m1(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:H1(e,n)||o,t&&(r=t(r,o,e)),r}function bo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=l=>{if(l[t]==null)return null;const d=l[t],c=H1(l.theme,o)||{};return g0(l,d,u=>{let p=m1(c,r,u);return u===p&&typeof u=="string"&&(p=m1(c,r,`${t}${u==="default"?"":qp(u)}`,u)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const Jw={m:"margin",p:"padding"},Qw={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},c4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},eS=function(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!c4[e])return[e];e=c4[e]}const[t,n]=e.split(""),o=Jw[t],r=Qw[n]||"";return Array.isArray(r)?r.map(i=>o+i):[o+r]}),Zp=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Gp=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function Ba(e,t,n,o){const r=H1(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const l=Math.abs(i),d=r[l];return i>=0?d:typeof d=="number"?-d:`-${d}`}:typeof r=="function"?r:()=>{}}function cu(e){return Ba(e,"spacing",8)}function Na(e,t){return typeof t=="string"||t==null?t:e(t)}function tS(e,t,n,o){if(!t.includes(n))return null;const r=function(i,l){return d=>i.reduce((c,u)=>(c[u]=Na(l,d),c),{})}(eS(n),o);return g0(e,e[n],r)}function Kp(e,t){const n=cu(e.theme);return Object.keys(e).map(o=>tS(e,t,o,n)).reduce(ra,{})}function so(e){return Kp(e,Zp)}function co(e){return Kp(e,Gp)}so.propTypes={},so.filterProps=Zp,co.propTypes={},co.filterProps=Gp;const nS={borderRadius:4};function $1(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?ra(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function Tr(e){return typeof e!="number"?e:`${e}px solid`}function Lr(e,t){return bo({prop:e,themeKey:"borders",transform:t})}const oS=Lr("border",Tr),rS=Lr("borderTop",Tr),iS=Lr("borderRight",Tr),lS=Lr("borderBottom",Tr),aS=Lr("borderLeft",Tr),sS=Lr("borderColor"),cS=Lr("borderTopColor"),dS=Lr("borderRightColor"),uS=Lr("borderBottomColor"),hS=Lr("borderLeftColor"),pS=Lr("outline",Tr),fS=Lr("outlineColor"),$s=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ba(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:Na(t,o)});return g0(e,e.borderRadius,n)}return null};$s.propTypes={},$s.filterProps=["borderRadius"],$1(oS,rS,iS,lS,aS,sS,cS,dS,uS,hS,$s,pS,fS);const g1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({gap:Na(t,o)});return g0(e,e.gap,n)}return null};g1.propTypes={},g1.filterProps=["gap"];const x1=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({columnGap:Na(t,o)});return g0(e,e.columnGap,n)}return null};x1.propTypes={},x1.filterProps=["columnGap"];const y1=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ba(e.theme,"spacing",8),n=o=>({rowGap:Na(t,o)});return g0(e,e.rowGap,n)}return null};y1.propTypes={},y1.filterProps=["rowGap"];function Hi(e,t){return t==="grey"?t:e}$1(g1,x1,y1,bo({prop:"gridColumn"}),bo({prop:"gridRow"}),bo({prop:"gridAutoFlow"}),bo({prop:"gridAutoColumns"}),bo({prop:"gridAutoRows"}),bo({prop:"gridTemplateColumns"}),bo({prop:"gridTemplateRows"}),bo({prop:"gridTemplateAreas"}),bo({prop:"gridArea"}));function pr(e){return e<=1&&e!==0?100*e+"%":e}$1(bo({prop:"color",themeKey:"palette",transform:Hi}),bo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Hi}),bo({prop:"backgroundColor",themeKey:"palette",transform:Hi}));const mS=bo({prop:"width",transform:pr}),du=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||V1[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:pr(n)}};return g0(e,e.maxWidth,t)}return null};du.filterProps=["maxWidth"];const gS=bo({prop:"minWidth",transform:pr}),xS=bo({prop:"height",transform:pr}),yS=bo({prop:"maxHeight",transform:pr}),bS=bo({prop:"minHeight",transform:pr});bo({prop:"size",cssProperty:"width",transform:pr}),bo({prop:"size",cssProperty:"height",transform:pr});$1(mS,du,gS,xS,yS,bS,bo({prop:"boxSizing"}));const W1={border:{themeKey:"borders",transform:Tr},borderTop:{themeKey:"borders",transform:Tr},borderRight:{themeKey:"borders",transform:Tr},borderBottom:{themeKey:"borders",transform:Tr},borderLeft:{themeKey:"borders",transform:Tr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Tr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$s},color:{themeKey:"palette",transform:Hi},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Hi},backgroundColor:{themeKey:"palette",transform:Hi},p:{style:co},pt:{style:co},pr:{style:co},pb:{style:co},pl:{style:co},px:{style:co},py:{style:co},padding:{style:co},paddingTop:{style:co},paddingRight:{style:co},paddingBottom:{style:co},paddingLeft:{style:co},paddingX:{style:co},paddingY:{style:co},paddingInline:{style:co},paddingInlineStart:{style:co},paddingInlineEnd:{style:co},paddingBlock:{style:co},paddingBlockStart:{style:co},paddingBlockEnd:{style:co},m:{style:so},mt:{style:so},mr:{style:so},mb:{style:so},ml:{style:so},mx:{style:so},my:{style:so},margin:{style:so},marginTop:{style:so},marginRight:{style:so},marginBottom:{style:so},marginLeft:{style:so},marginX:{style:so},marginY:{style:so},marginInline:{style:so},marginInlineStart:{style:so},marginInlineEnd:{style:so},marginBlock:{style:so},marginBlockStart:{style:so},marginBlockEnd:{style:so},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:g1},rowGap:{style:y1},columnGap:{style:x1},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:pr},maxWidth:{style:du},minWidth:{transform:pr},height:{transform:pr},maxHeight:{transform:pr},minHeight:{transform:pr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},al=function(){function e(t,n,o,r){const i={[t]:n,theme:o},l=r[t];if(!l)return{[t]:n};const{cssProperty:d=t,themeKey:c,transform:u,style:p}=l;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const f=H1(o,c)||{};return p?p(i):g0(i,n,h=>{let m=m1(f,u,h);return h===m&&typeof h=="string"&&(m=m1(f,u,`${t}${h==="default"?"":qp(h)}`,h)),d===!1?m:{[d]:m}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const l=r.unstable_sxConfig??W1;function d(c){let u=c;if(typeof c=="function")u=c(r);else if(typeof c!="object")return c;if(!u)return null;const p=function(m={}){return m.keys?.reduce((x,y)=>(x[m.up(y)]={},x),{})||{}}(r.breakpoints),f=Object.keys(p);let h=p;return Object.keys(u).forEach(m=>{const g=(x=u[m],y=r,typeof x=="function"?x(y):x);var x,y;if(g!=null)if(typeof g=="object")if(l[m])h=ra(h,e(m,g,r,l));else{const v=g0({theme:r},g,b=>({[m]:b}));(function(...b){const C=b.reduce((E,R)=>E.concat(Object.keys(R)),[]),k=new Set(C);return b.every(E=>k.size===Object.keys(E).length)})(v,g)?h[m]=t({sx:g,theme:r,nested:!0}):h=ra(h,v)}else h=ra(h,e(m,g,r,l))}),!i&&r.modularCssLayers?{"@layer sx":l4(r,s4(f,h))}:l4(r,s4(f,h))}return Array.isArray(o)?o.map(d):d(o)}}();function vS(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function Xp(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...l}=e,d=mw(n),c=function(p=8,f=cu({spacing:p})){if(p.mui)return p;const h=(...m)=>(m.length===0?[1]:m).map(g=>{const x=f(g);return typeof x=="number"?`${x}px`:x}).join(" ");return h.mui=!0,h}(r);let u=yr({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:c,shape:{...nS,...i}},l);return u=function(p){const f=(x,y)=>x.replace("@media",y?`@container ${y}`:"@container");function h(x,y){x.up=(...v)=>f(p.breakpoints.up(...v),y),x.down=(...v)=>f(p.breakpoints.down(...v),y),x.between=(...v)=>f(p.breakpoints.between(...v),y),x.only=(...v)=>f(p.breakpoints.only(...v),y),x.not=(...v)=>{const b=f(p.breakpoints.not(...v),y);return b.includes("not all and")?b.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):b}}const m={},g=x=>(h(m,x),m);return h(g),{...p,containerQueries:g}}(u),u.applyStyles=vS,u=t.reduce((p,f)=>yr(p,f),u),u.unstable_sxConfig={...W1,...l?.unstable_sxConfig},u.unstable_sx=function(p){return al({sx:p,theme:this})},u}al.filterProps=["sx"];const d4=(e,t,n,o=[])=>{let r=e;t.forEach((i,l)=>{l===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function Nc(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},l={};var d,c;return d=(u,p,f)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(u,p))){const h=`--${n?`${n}-`:""}${u.join("-")}`,m=((g,x)=>typeof x=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(y=>g.includes(y))||g[g.length-1].toLowerCase().includes("opacity")?x:`${x}px`:x)(u,p);Object.assign(r,{[h]:m}),d4(i,u,`var(${h})`,f),d4(l,u,`var(${h}, ${m})`,f)}},c=u=>u[0]==="vars",function u(p,f=[],h=[]){Object.entries(p).forEach(([m,g])=>{(!c||c&&!c([...f,m]))&&g!=null&&(typeof g=="object"&&Object.keys(g).length>0?u(g,[...f,m],Array.isArray(g)?[...h,m]:h):d([...f,m],g,h))})}(e),{css:r,vars:i,varsWithDefaults:l}}function wS(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}const u4={textTransform:"uppercase"},h4='"Roboto", "Helvetica", "Arial", sans-serif';function Yp(e,t){const{fontFamily:n=h4,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:l=500,fontWeightBold:d=700,htmlFontSize:c=16,allVariants:u,pxToRem:p,...f}=typeof t=="function"?t(e):t,h=o/14,m=p||(y=>y/c*h+"rem"),g=(y,v,b,C,k)=>{return{fontFamily:n,fontWeight:y,fontSize:m(v),lineHeight:b,...n===h4?{letterSpacing:(E=C/v,Math.round(1e5*E)/1e5+"em")}:{},...k,...u};var E},x={h1:g(r,96,1.167,-1.5),h2:g(r,60,1.2,-.5),h3:g(i,48,1.167,0),h4:g(i,34,1.235,.25),h5:g(i,24,1.334,0),h6:g(l,20,1.6,.15),subtitle1:g(i,16,1.75,.15),subtitle2:g(l,14,1.57,.1),body1:g(i,16,1.5,.15),body2:g(i,14,1.43,.15),button:g(l,14,1.75,.4,u4),caption:g(i,12,1.66,.4),overline:g(i,12,2.66,1,u4),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return yr({htmlFontSize:c,pxToRem:m,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:l,fontWeightBold:d,...x},f,{clone:!1})}function Jn(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const SS=["none",Jn(0,2,1,-1,0,1,1,0,0,1,3,0),Jn(0,3,1,-2,0,2,2,0,0,1,5,0),Jn(0,3,3,-2,0,3,4,0,0,1,8,0),Jn(0,2,4,-1,0,4,5,0,0,1,10,0),Jn(0,3,5,-1,0,5,8,0,0,1,14,0),Jn(0,3,5,-1,0,6,10,0,0,1,18,0),Jn(0,4,5,-2,0,7,10,1,0,2,16,1),Jn(0,5,5,-3,0,8,10,1,0,3,14,2),Jn(0,5,6,-3,0,9,12,1,0,3,16,2),Jn(0,6,6,-3,0,10,14,1,0,4,18,3),Jn(0,6,7,-4,0,11,15,1,0,4,20,3),Jn(0,7,8,-4,0,12,17,2,0,5,22,4),Jn(0,7,8,-4,0,13,19,2,0,5,24,4),Jn(0,7,9,-4,0,14,21,2,0,5,26,4),Jn(0,8,9,-5,0,15,22,2,0,6,28,5),Jn(0,8,10,-5,0,16,24,2,0,6,30,5),Jn(0,8,11,-5,0,17,26,2,0,6,32,5),Jn(0,9,11,-5,0,18,28,2,0,7,34,6),Jn(0,9,12,-6,0,19,29,2,0,7,36,6),Jn(0,10,13,-6,0,20,31,3,0,8,38,7),Jn(0,10,13,-6,0,21,33,3,0,8,40,7),Jn(0,10,14,-6,0,22,35,3,0,8,42,7),Jn(0,11,14,-7,0,23,36,3,0,9,44,8),Jn(0,11,15,-7,0,24,38,3,0,9,46,8)],CS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},kS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function p4(e){return`${Math.round(e)}ms`}function ES(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function _S(e){const t={...CS,...e.easing},n={...kS,...e.duration};return{getAutoHeightDuration:ES,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:l=t.easeInOut,delay:d=0,...c}=r;return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:p4(i)} ${l} ${typeof d=="string"?d:p4(d)}`).join(",")},...e,easing:t,duration:n}}const TS={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function jS(e){return p0(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Jp(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[l,d]=r[i];!jS(d)||l.startsWith("unstable_")?delete o[l]:p0(d)&&(o[l]={...d},n(o[l]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
38
38
|
|
|
39
39
|
const theme = ${JSON.stringify(t,null,2)};
|
|
40
40
|
|
|
@@ -59,7 +59,7 @@ Please use Chrome or Edge if external copy and paste is required.`,Perms:Uc,Perm
|
|
|
59
59
|
|
|
60
60
|
The formatting is not applied.`,shortcut:{key:"V",modifiers:[ke.Ctrl,ke.Shift]}}),new je("pasteFormats",D,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
61
61
|
|
|
62
|
-
The content is not applied.`}),new je("pasteFormulas",D,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new je("pasteTranspose",D,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new je("pasteLinks",D,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];g.addCommands(L,!0)},[g,f]),s.useEffect(()=>{if(!g)return;const D={disabled:!h.getProtection().isFormatCellsAllowed()};g.getCommand("pasteValues").updateCallback(L=>M.paste({...kk,...L})).update(D),g.getCommand("pasteFormats").updateCallback((L,N)=>M.paste({...Ek,description:N.label(),...L})).update(D),g.getCommand("pasteFormulas").updateCallback((L,N)=>M.paste({..._k,description:N.label(),...L})).update(D),g.getCommand("pasteTranspose").updateCallback((L,N)=>M.paste({...Tk,description:N.label(),...L})).update(D),g.getCommand("pasteLinks").updateCallback((L,N)=>M.paste({...jk,description:N.label(),...L})).update(D),g.getCommand("cut").update(D),g.getCommand("paste").update(D)},[h,g]);const A=s.useMemo(()=>{if(!w||!T.current)return;const D=w.key;if(D!=="copy"&&D!=="cut"&&D!=="formatPainter")return;const L=T.current.getItem();if(L.getSource()!==h)return;const N=T.current.isCut?.(),W=N?E:k,I=N?C:b,U=L.getCoords(),G=U?[U]:null;return G&&G.length!==0?Q=>{const H=[];for(let $=0;$<G.length;$++){const F=G[$],X=Q.toClipBounds(Q.getRangeCoordsBounds(F,{top:0,left:0,right:1,bottom:1}),Ko);X&&(H.push(B({range:F,key:`copy-selection-background-${$}`,x:X.x,y:X.y,width:Math.max(X.width,0),height:Math.max(X.height,0),stroke:W,strokeWidth:2})),H.push(B({range:F,key:`copy-selection-foreground-${$}`,x:X.x+(X.width<=2?-1:0),y:X.y,width:Math.max(X.width,3),height:Math.max(X.height,3),stroke:I,strokeWidth:2,isAnimatedStroke:!0})))}return H}:null},[w,h,m,b,k,C,E]);return{...M,clipboard:P,overlays:A}})({element:o,sheet:r,sheetView:u,commands:l,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:d});return Xt(r?.getSelection(),{onChange(f){}}),s.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),Rk={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ik={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Dk={key:"dragCopy",description:"Drag selection to copy cell contents."},Lk={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},b7=(e,t)=>t.ctrlKey&&t.shiftKey?Lk:t.ctrlKey?Dk:t.shiftKey?Ik:Rk,Ok={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Pk=s.memo(s.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:l,onShowTooltip:d,onCloseTooltip:c,sheet:u,gridRef:p,gridStyle:f,isActive:h,editingCoords:m,...g}=e,x=n?.getBounds(),y=ue(d,[d]),v=ue(c,[c]),[b,C]=s.useState(()=>u?.getSelection().getCoords()),k=ue(J=>{vo.isEqualSelectionCoords(J,b)||u&&u.getSelection().updateCoords(J)},[u,b]),E=$r(),R=s.useRef(null),[j,B]=s.useState(u?.getProtection().isLocked()),[T,_]=s.useState(u?.getView().getMovableSelection().length>0),w=gn.detectIt().primaryInput==="touch",S=!w&&h,O=m!==null||T,P=ue(J=>{const re=vo.cellToRange(J);if(u.isClosed())return re;const fe=u.getRange(re,{excludeHidden:!0}).getMerges();return fe.length===0?re:fe[0]},[u]),M=ue((J,re,fe,ie,ee,pe)=>{const Te=u.getSelectedRange().getExtended(ie,J).getCoords();switch(ie){case z.IRange.Direction.Up:return Te.rowStart;case z.IRange.Direction.Down:return Te.rowEnd;case z.IRange.Direction.Left:return Te.colStart;case z.IRange.Direction.Right:return Te.colEnd}},[u]),A=ue(()=>{const J=u.getUsedRange()?.getCoords(),re=u.getRowHeaders().getUsedRange()?.getCoords(),fe=u.getColumnHeaders().getUsedRange()?.getCoords();return{...J,colEnd:Math.max(J?.colEnd??0,fe?.max??0),rowEnd:Math.max(J?.rowEnd??0,re?.max??0)}},[u]),D=ue((J,re)=>u.getRowHeaders().hiddenHeadersAt(J,re),[u]),L=ue((J,re)=>u.getColumnHeaders().hiddenHeadersAt(J,re),[u]),N=ue(J=>u.getRange(J,{excludeHidden:!0}).getMerges(),[u]),W=ue(J=>{u?.getSelection().setAdjusting(J)},[u]),I=ue(async()=>{u?.getSelection().setAdjusting(null),E.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),E.setMode(null))},[E,b,u,o]),U=s.useMemo(()=>{const J=E.getMode();return J?.key==="cut"||J?.key==="copy"},[E]);Xt(u?.getView(),{onMovableSelectionChange:()=>{_(u.getView().getMovableSelection().length>0)}}),Xt(u?.getSelection(),{onChange(J){const re=u.getSelection().getCoords();C(re)}}),Xt(u,{onProtectionChange:()=>{B(u.getProtection().isLocked())}});const{body:G={}}=f||{},Q=n.getLayout(),H=!(S&&b.ranges.length<=1&&m===null&&!j&&(!E.getMode()||U)),{overlay:$,onPointerDown:F}=L9({gridRef:p,commands:o,layout:Q,getCellCoordsAsRangeCoords:P,selection:b,fillHandleBorderColor:G.fill,selectionBackgroundColor:h?f.selection.fill:f.selectionInactive.fill,selectionBorderColor:h?f.selection.strokeFill:f.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?f.selectionRemove.fill:f.selectionInactive.fill,selectionRemoveBorderColor:h?f.selectionRemove.strokeFill:f.selectionInactive.strokeFill,disableFillDrag:H,disableMoveDrag:w||!(h&&b.ranges.length<=1&&m===null&&!j),disableTouchSelection:O,onSelectionChange:k,onSelectionDragStart:W,onSelectionDragEnd:I,onMoveDragStart:(J,re,fe)=>{E.setMode(b7(0,fe))},onMoveDragUpdate:(J,re,fe)=>{E.setMode(b7(0,fe))},onMoveDragEnd:(J,re)=>{E.setMode(null)},onMoveDragDone:async(J,re,fe)=>{if(vo.isEqualRanges(J,re))return;const ie=u.getRange(re);if(l?.showOptions){const ae=ie.getDifferences(J);let he=!1;for(let we=0;!he&&we<ae.getCount();we++)he=ae.at(we).isContentful();if(he&&await l?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ee=!fe.ctrlKey,pe=fe.shiftKey,Te=pe?ee?"Insert Moved Cells":"Insert Copied Cells":ee?"Move Cells":"Copy Cells",Ae=await l?.showBusy?.(Te);try{const ae=u.getRange(J);await ie.doBatch(async()=>{pe?await ie.insertFrom(J,{isCut:ee,undoRange:ae}):await ie.copyFrom(J,{isCut:ee,undoRange:ae}),ae.autoFit({skipCustomSize:!0,orientations:z.IRange.Orientations.Row,minContent:!0}),ie.autoFit({skipCustomSize:!0,orientations:z.IRange.Orientations.Row,minContent:!0})},{description:Te,autoSelect:!0})}catch(ae){l?.showError?.(ae)}finally{Ae?.()}},contentfulCellFinder:M,hiddenRowsAt:D,hiddenColumnsAt:L,mergedRanges:N,getDataCoords:A,canSelectionSpanMergedCells:J=>{const re=u.getRange(J);return re.isEntireColumns()||re.isEntireRows()},onFill:async(J,re)=>{const fe="Auto Fill",ie=await l?.showBusy?.(fe);try{await u.doBatch(()=>{u.getRange(J).autoFill(re),u.getRange(re).autoFit({orientations:z.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:fe,autoSelect:!0})}catch(ee){l?.showError?.(ee)}finally{R.current=null,ie?.()}},onFillPreview:(J,re,fe)=>{if(p.current&&y){E.setMode(Ok);try{R.current?.direction!==fe&&(R.current=null,u.getRange(J).autoFill(re,{previewOnly:we=>{R.current={callback:we,direction:fe}}}));const ie=R.current?.callback?.(re);if(!ie||ie.isEmpty())return;const ee=ie.toText();if(!ee)return;const pe=vo.cellToRange(ie.getCoords()),Te=n.getRelativePointFromClient(0,0);let Ae=0,ae=0,he=fc;if(fe===z.IRange.Direction.Down){Ae=Q.getColOffset(pe.colEnd+1)-Te.x;const we=Q.getRowOffset(pe.rowEnd),He=Q.getRowOffset(pe.rowEnd+1);ae=He-(He-we)/2-Te.y,he=Cd}else if(fe===z.IRange.Direction.Right){ae=Q.getRowOffset(pe.rowEnd+1)-Te.y;const we=Q.getColOffset(pe.colEnd),He=Q.getColOffset(pe.colEnd+1);Ae=He-(He-we)/2-Te.x,he=fc}else if(fe===z.IRange.Direction.Up){Ae=Q.getColOffset(pe.colEnd+1)-Te.x;const we=Q.getRowOffset(pe.rowStart),He=Q.getRowOffset(pe.rowStart+1);ae=He-(He-we)/2-Te.y,he=Cd}else if(fe===z.IRange.Direction.Left){ae=Q.getRowOffset(pe.rowEnd+1)-Te.y;const we=Q.getColOffset(pe.colStart),He=Q.getColOffset(pe.colStart+1);Ae=He-(He-we)/2-Te.x,he=fc}y({anchor:{x:Ae,y:ae},display:ee,placement:he})}catch(ie){l?.showError?.(ie)}}},onFillDone:()=>{R.current=null,E.setMode(null),v?.()}}),X=ue(J=>{F(gn.createSyntheticEvent(J))},[F,m]);s.useEffect(()=>{const J=n?.getStage();if(J)return J.addEventListener("pointerdown",X),()=>{J.removeEventListener("pointerdown",X)}},[n?.getStage()]);const K=Ro(t,()=>({}),[]),ne=s.useRef(null);return a.jsx("div",{className:cr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:sl([K,ne]),...g,children:$(n)})})),Ss=Object.freeze({x:0,y:0,width:0,height:0}),Ak={fireOnModelChange:!1},Fk=s.memo(s.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:l,onHide:d,onShow:c,onUnFocus:u,isDragging:p,updateFrameBounds:f,dragStart:h,style:m,disabled:g,renderMovable:x,...y}=e,[v,b]=s.useState(Ss),[C,k]=s.useState(null),[E,R]=s.useState(!1),j=s.useRef(null);s.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const _=o.toViewBounds(T);b(_??Ss),f(_??Ss)},[o?.getBounds()]),Xt(r,{onBoundsChange:T=>{const _=T.getBounds();if(!_)return;const w=o.toViewBounds(_);b(w??Ss),f(w)},onSelectionChange:()=>{const T=Ht.hasFocus(j.current,!0);!E&&!T||r.isSelected()||u()}}),Xt(r,{onRequestFocus:()=>Ht.whenFocus(j.current,!0)},Ak),s.useEffect(()=>{const T=j.current;return i(T),()=>{l(T)}},[]);const B=s.useMemo(()=>{if(!v)return null;let{width:T,height:_}=v;return x({view:o,movable:r,disabled:g,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:_},onHide:d,onShow:c})},[o,r,v.width,v.height,g,p]);return a.jsx("div",{className:"movable",tabIndex:0,ref:sl([j,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...m},onMouseDown:async T=>{const _=T.shiftKey||T.ctrlKey,w=r.isSelected(),S=T.currentTarget;_&&w?r.unselect():(w&&!_||await r.select({addToSelection:_}),h(T.nativeEvent,S),S.focus())},onFocus:T=>{T.relatedTarget&&!C&&k(T.relatedTarget),R(!0)},onBlur:T=>{C&&!j?.current?.contains(T.relatedTarget)&&k(null),T.relatedTarget&&R(!1)},...y,children:B})})),zk=s.memo(s.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:l,onUnFocus:d,onFocus:c,disabled:u=!1,disableDrag:p=!1,disableResize:f=!1,className:h,style:m,renderDirections:g=["nw","n","ne","w","e","sw","s","se"],onFirstRender:x,...y}=e,v=n.getBounds(),b=ue(x,[x]),C=ue(d,[d]),k=ue(c,[c]),[E,R]=s.useState([]),[j,B]=s.useState(!1),[T,_]=s.useState(!1),w=s.useRef(!0),S=s.useRef(new Map),O=s.useRef(new Map),P=s.useRef(new Map),M=s.useRef(new Map),A=s.useRef(new Map),D=s.useRef({onRequestFocus:Ee=>(fe(Ee),null)}),L=s.useRef(null),N=s.useRef(null),W=s.useRef(null),[I,U]=s.useReducer(Ee=>Ee+1,0);s.useLayoutEffect(()=>{U()},[n,o]),Xt(o,{onCollectionChange:()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ie=A.current;Ie.forEach($e=>{$e()}),Ie.clear();const ft=D.current;for(let $e=0;$e<Ee.length;$e++){const yt=Ee[$e];if(yt.isClosed())continue;const tt=yt.addListeners(ft);Ie.set(yt,tt)}U()},onInvalidated:()=>{U()}}),Xt(r,{onMovableSelectionChange(Ee){Q(),U()}});const G=s.useCallback((Ee,Ie)=>{const ft=P.current.get(Ee);W.current&&(W.current.getTargets().forEach($e=>{if($e===ft)return $e.style.left=Ie.x+"px",$e.style.top=Ie.y+"px",$e.style.width=Ie.width+"px",void($e.style.height=Ie.height+"px")}),W.current.updateRect())},[]),Q=()=>{const Ee=[],Ie=r.getMovableSelection();Ie.forEach(ft=>{const $e=P.current.get(ft);$e&&Ie.indexOf(ft)!==-1&&Ee.push($e)}),R(ft=>Ht.isEqualArrays(ft,Ee)?ft:Ee)},H=s.useRef(null),$=s.useMemo(()=>new Promise(Ee=>{H.current=Ee}),[]),F=s.useRef(null),X=ue(async(Ee,Ie)=>{F.current=Ie,await(async()=>!(!await $.then()||!W.current))()&&F.current===Ie&&W.current.dragStart(Ee,Ie)},[E]),[K,ne]=s.useState(!1),J=s.useRef(null),re=s.useRef(null),fe=ue(async(Ee=null)=>{if(Ee||(Ee=r.getMovableSelection()[0]),!Ee)return C?.(),!1;const Ie=P.current.get(Ee);Ie?(await Ht.whenFocus(Ie),Ie.focus(),re.current=Ie,J.current=null):J.current=Ee},[r]);s.useEffect(()=>{K&&E.length>0&&re.current!==E[0]&&fe(),w.current&&(b?.(),w.current=!1)},[E]);const ie=s.useMemo(()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(Ee.length===0&&S.current.size===0)return null;const Ie=(oe,Ve,xe,be=!0)=>{const te=oe.isSelected(),Me={tabIndex:xe,view:n,movable:oe,onRefLoad:_e=>{J.current===oe&&(_e.focus(),re.current=_e,J.current=null),P.current.set(oe,_e),O.current.set(_e,oe),Ve.rendered=!0,Q()},onRefUnload:_e=>{P.current.delete(oe),O.current.delete(_e),Ve.rendered=!1,Q()},onUnFocus:C,onHide:_e=>{Ve.onHide=_e},onShow:_e=>{Ve.onShow=_e},isDragging:te&&(T||j),disabled:u,renderMovable:i,updateFrameBounds:_e=>{G(oe,_e)},dragStart:X,onMouseUp:()=>{if(F.current=null,N.current){B(!1),_(!1);let _e=!1;M.current?.forEach(ve=>{Ht.isEqualBounds(ve.movable.getBounds(),ve.startBounds)||(_e=!0)}),_e?pe():Te()}},style:{opacity:be?j&&te?.7:void 0:0,zIndex:j&&te?oe.getZIndex()+Ee.length:void 0,pointerEvents:be?void 0:"none",cursor:T&&te?"grabbing":u||p?"initial":"move",boxShadow:!te||T&&!j?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return a.jsx(Fk,{...Me},`movable-${oe.getUUID()}`)},ft=S.current,$e=new Map,yt=[];for(let oe=0;oe<Ee.length;oe++){const Ve=Ee[oe];if(Ve.isClosed())continue;let xe=ft.get(Ve);xe||(xe={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(be,te)=>{if(!te||te.shown===!0)return;te.shown=!0;const Me=++te.visibilityRequestId;requestAnimationFrame(()=>{const _e=S.current.get(be);_e&&Me===te.visibilityRequestId&&(te.onShow?.(be),_e.shown=!0)})},doHide:async(be,te)=>{if(!te||te?.shown===!1)return;te.shown=!1;const Me=++te.visibilityRequestId,_e=await Promise.resolve(te.onHide?.(be));Me===te.visibilityRequestId&&_e!==!1&&(te.shown=!1,S.current.delete(be),U())},visibilityRequestId:0}),xe.frame=Ie(Ve,xe,oe,!0),yt.push(xe.frame),xe.doShow(Ve,xe),ft.delete(Ve),$e.set(Ve,xe)}const tt=[];return r.getMovableSelection().forEach(oe=>{const Ve=ft.get(oe);Ve&&(Ve.frame=Ie(oe,Ve,-1,!1),tt.push(Ve.frame),ft.delete(oe),$e.set(oe,Ve))}),ft.forEach((oe,Ve)=>{oe.frame=Ie(Ve,oe,-1,!1),tt.push(oe.frame),oe.doHide(Ve,oe),ft.delete(Ve),$e.set(Ve,oe)}),S.current=$e,Q(),[...tt,...yt]},[I,n,i,u,p,f,j,T]),ee=ue((Ee,Ie)=>{const ft=`${Ie} ${E.length===1?z.TextUtils.capitalize(O.current?.get(E[0]).getContent().getType()):"Drawings"}`;N.current&&(console.warn(`Transaction ${N.current.getDescription()} is being replaced by ${ft}`),N.current.rollback(),N.current=null),N.current=l.beginCommit({description:ft}),M.current.clear();for(let $e=0;$e<E.length;$e++){const yt=E[$e],tt=O.current?.get(yt);tt?M.current.set(yt,{movable:tt,startBounds:n.toViewBounds(tt.getBounds())}):console.warn("invalid element",tt)}},[l,n,E]),pe=s.useCallback(()=>{if(!N.current)return;const Ee=[];M.current?.forEach(Ie=>{Ee.push(Ie.movable)}),N.current.commit({viewAfter:{view:r,movableSelection:Ee}}),M.current.clear(),N.current=null},[]),Te=s.useCallback(()=>{N.current&&(N.current.rollback(),N.current=null)},[]),Ae=s.useRef(null);s.useEffect(()=>{Ae.current&&(Ae.current.onscroll=Ee=>{Ee.preventDefault(),Ee.srcElement.scrollTop=0,Ee.srcElement.scrollLeft=0})},[Ae.current]);const ae=Ro(t,()=>({isMovableArea:()=>!0,focusMovable:fe,focus:()=>{fe()}}),[r]),[he,we]=s.useState(null),He=s.useRef(!1),Ye=s.useRef(!1),wt=s.useRef(!1);s.useEffect(()=>{if(u||E.length===0||wt.current||He.current)return;if(Ye.current)return void requestAnimationFrame(()=>{W.current&&L.current&&W.current.refTargets.length>0&&(wt.current=!0,H.current?.(!0)),R([...E])});He.current=!0;const Ee=s.lazy(async()=>{try{const Ie=await Promise.resolve().then(()=>require("./BTJCgtyeGTpr8d7i.cjs"));return He.current=!1,Ye.current=!0,R([...E]),Ie}catch(Ie){return console.warn(Ie),H.current?.(!1),null}});we(Ee)},[E,u,p,f]);const Ct=s.useMemo(()=>!he||u?null:a.jsx(s.Suspense,{children:a.jsx(he,{className:cr({dragging:j||T,resizing:j,moving:T}),container:null,ref:W,target:W.current?E:[],draggable:!u&&!p,resizable:!u&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:g,onResizeStart:Ee=>{ee(Ee.target,"Resize")},onResize:Ee=>{if(!N.current)return Ee.stopDrag(),void U();B(!0);const Ie=Ee.direction[0]!==0&&Ee.direction[1]!==0;let ft=0,$e=0;for(let yt=0;yt<E.length;yt++){const tt=E[yt],oe=M.current.get(tt),Ve=O.current.get(tt);if(!oe||!Ve){console.warn("invalid element");continue}let xe=Ee.dist[0],be=Ee.dist[1],te=Ee.drag.dist[0],Me=Ee.drag.dist[1],_e=oe.startBounds.width,ve=oe.startBounds.height;yt===0?(ft=_e,$e=ve):(xe*=_e/ft,te*=_e/ft,be*=ve/$e,Me*=ve/$e);const Oe={...oe.startBounds};if(Oe.width=Math.max(0,_e+xe),Oe.height=Math.max(0,ve+be),Ee.direction[0]===-1&&(Oe.width=Math.max(0,Math.min(oe.startBounds.x+_e,_e-te))),Ee.direction[1]===-1&&(Oe.height=Math.max(0,Math.min(oe.startBounds.y+ve,ve-Me))),Ie&&(Ve.isLockAspectRatio()||Ee.inputEvent?.shiftKey)){const Y=_e/ve,se=Oe.width/Oe.height;se>Y?Oe.height=Oe.width/Y:se<Y&&(Oe.width=Oe.height*Y)}Ee.direction[0]===-1&&(Oe.x=Math.max(0,Math.min(oe.startBounds.x+_e,oe.startBounds.x+_e-Oe.width))),Ee.direction[1]===-1&&(Oe.y=Math.min(oe.startBounds.y+ve,oe.startBounds.y+ve-Oe.height)),oe.movable.setBounds(n.toAbsoluteBounds(Oe))}},onResizeEnd:Ee=>{B(!1),pe()},onDragStart:Ee=>{ee(Ee.target,"Move")},onDrag:Ee=>{if(!N.current)return Ee.stopDrag(),void U();_(!0);for(let Ie=0;Ie<E.length;Ie++){const ft=E[Ie],$e=M.current.get(ft);$e?$e.movable.setBounds(n.toAbsoluteBounds({...$e.startBounds,x:$e.startBounds.x+Ee.translate[0],y:$e.startBounds.y+Ee.translate[1]})):console.warn("invalid element")}},onDragEnd:Ee=>{},onMouseUp:Ee=>{}})}),[I,he,E,n,u,p,f,j,T]);return a.jsx("div",{className:cr(h,"movable-area","_movable-area_314c6_5"),style:{width:v.width,height:v.height,...m,position:"absolute",overflow:"hidden",willChange:"transform"},ref:sl([ae,Ae]),...y,children:a.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:v.width,height:v.height},...y,children:a.jsxs("div",{ref:L,style:{position:"absolute",pointerEvents:"auto"},onFocus:Ee=>{k?.(),ne(!0)},onBlur:Ee=>{ne(!1)},onKeyDownCapture:Ee=>{if(Ee.isDefaultPrevented())return;const Ie=Ee.nativeEvent.ctrlKey,ft=Ee.nativeEvent.altKey,$e=Ee.nativeEvent.shiftKey;if(Ee.which===Zt.Escape){const xe=r.getMovableSelection();let be=[...xe];return E.forEach(te=>{if(be.length===0)return;const Me=O.current.get(te);let _e=be.indexOf(Me);be.splice(_e,1)}),be.length!==xe.length&&r.selectMovables(be),be.length===0&&C?.(),void Ee.preventDefault()}const yt=.1,tt=xe=>{o.updateSelected(be=>{be.setRotation(be.getRotation()+xe)},"Rotate")},oe=(xe,be=!0)=>{o.updateSelected(te=>{const Me=te.getBounds();let _e=1+xe;be||(_e=1/_e);const ve=Math.sqrt(Math.pow(Me.width,2)+Math.pow(Me.height,2)),Oe=Math.atan2(Me.height,Me.width),Y=_e*ve;if(Y<10)return;const se=Y*Math.cos(Oe),Ce=Y*Math.sin(Oe),Pe={x:Me.x+(Me.width-se)/2,y:Me.y+(Me.height-Ce)/2,width:se,height:Ce};te.setBounds(Pe)},"Resize")},Ve=xe=>{o.updateSelected(be=>{const te=be.getBounds(),Me={x:te.x+(xe.x??0),y:te.y+(xe.y??0),width:te.width+(xe.width??0),height:te.height+(xe.height??0)};be.setBounds(Me)},"Nudge")};if(Ee.which===Zt.Delete)o.updateSelected(xe=>{xe.delete()},"Delete"),Ee.preventDefault();else if(Ee.key==="a"&&Ie){const xe=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(xe,!0),Ee.preventDefault()}else Ee.key==="ArrowLeft"?($e?oe(yt,!1):ft?tt(-10):Ve({x:Ie?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowRight"?($e?oe(yt,!0):ft?tt(10):Ve({x:Ie?10:1}),Ee.preventDefault()):Ee.key==="ArrowUp"?($e?oe(yt,!0):Ve({y:Ie?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowDown"&&($e?oe(yt,!1):Ve({y:Ie?10:1}),Ee.preventDefault())},children:[ie,Ct]})})})})),ki=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const l=e[i].getBounds();t=Math.min(l.x,t),n=Math.min(l.y,n),o=Math.max(l.x+l.width,o),r=Math.max(l.y+l.height,r)}return{x:t,y:n,width:o-t,height:r-n}},v7=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let l=0,d=Number.MAX_SAFE_INTEGER,c=0;for(let f=0;f<e.length;f++){const h=e[f],m=h.getBounds();l+=m[i],d=Math.min(m[o],d),c=Math.max(m[o]+m[i],c),n.push({bounds:m,movable:h})}const u=(c-d-l)/(e.length-1);n.sort((f,h)=>{const m=f.bounds[o],g=h.bounds[o];return m!==g?m-g:f.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let f=1;f<n.length-1;f++){const h=n[f-1].bounds,m={...n[f].bounds};m[o]=h[o]+h[i]+u,n[f].bounds=m,p.set(n[f].movable,m)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},Bk=s.memo(s.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:l,onHide:d,onShow:c,...u}=e;s.useEffect(()=>{},[r]);const p=Ro(t,()=>({isEmptyFrame:()=>!0}),[]),[f,{height:h,width:m}]=pi();return a.jsx("div",{...u,ref:sl([p,f]),children:a.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:l?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:a.jsx("div",{style:{textAlign:"center"},children:r})})})})),Nk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:l,target:d,notifier:c,onRepeatCommandChange:u}=e,p=function(h){const{movables:m,movablesView:g,transactional:x,commands:y,target:v,onRepeatCommandChange:b,notifier:C}=h,k=$r();s.useRef(k.getMode()).current=k.getMode();const E=ue(async(M,A,D=null,L=!0)=>{const N=async()=>{const W=await Promise.resolve(C?.showBusy?.(M.label()));try{await A();const I=D??M?.label?.();if(b){let U=null;M&&I!==!1&&(U=new vt(M.key(),v,{label:I,description:I},N)),b(U)}W?.(),L&&k.setMode(null)}catch(I){W?.(),C?.showError?.(I)}};await N()},[b,C]),[R,j]=s.useReducer(M=>M+1,0),B=ue((M,A,D)=>{if(!g)return;const L=g.getMovableSelection();if(L.length===0)return;let N="Drawings";if(L.length===1){const I=L[0];N=z.TextUtils.capitalize(I.getContent().getType())??"Drawing"}const W=`${M.label()} ${N}`;E(M,()=>{let I=null;x&&(I=x.beginCommit(W));const U=g.getMovableSelection();if(U.length===0)return;const G=D?.(U);for(let Q=0;Q<U.length;Q++){const H=U[Q];A(H,G)}I?.commit()})},[g,x]),[T,_]=s.useState(g.getMovableSelection()[0]??null),[w,S]=s.useState(!T||T?.isProtected()),O=s.useMemo(()=>[new je("moveToFront",v,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[ke.Ctrl,ke.Shift]}},function(){B(this,M=>{M.moveToFront()})}),new je("moveForward",v,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[ke.Ctrl]}},function(){B(this,M=>{M.moveForward()})}),new je("moveToBack",v,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[ke.Ctrl,ke.Shift]}},function(){B(this,M=>{M.moveToBack()})}),new je("moveBackward",v,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[ke.Ctrl]}},function(){B(this,M=>{M.moveBackward()})}),new je("toggleLockAspectRatio",v,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){B(this,M=>{M.setLockAspectRatio(!M.isLockAspectRatio())})}),new je("formatAnchorTypeTwoCell",v,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.TwoCell)})}),new je("formatAnchorTypeOneCell",v,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.OneCell)})}),new je("formatAnchorTypeAbsolute",v,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.Absolute)})}),new je("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){B(this,(M,A)=>{M.setBounds({x:A.x})},ki)}),new je("formatDrawAlignCenter",v,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){B(this,(M,A)=>{M.setBounds({x:(A.width-M.getBounds().width)/2+A.x})},ki)}),new je("formatDrawAlignRight",v,{label:"Align Right",description:"Align the selected drawings to the right."},function(){B(this,(M,A)=>{M.setBounds({x:A.width-M.getBounds().width+A.x})},ki)}),new je("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){B(this,(M,A)=>{M.setBounds({y:A.y})},ki)}),new je("formatDrawAlignMiddle",v,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){B(this,(M,A)=>{M.setBounds({y:(A.height-M.getBounds().height)/2+A.y})},ki)}),new je("formatDrawAlignBottom",v,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){B(this,(M,A)=>{M.setBounds({y:A.height-M.getBounds().height+A.y})},ki)}),new je("formatDrawDistributeHorz",v,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){B(this,(M,A)=>{M.setBounds(A.get(M))},M=>v7(M))}),new je("formatDrawDistributeVert",v,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){B(this,(M,A)=>{M.setBounds(A.get(M))},M=>v7(M,!1))}),new je("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new je("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new je("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new je("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new je("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new je("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new je("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[g,T]);s.useEffect(()=>{},[k]);const P=s.useMemo(()=>{let M=null;return M=y?y.createChildGroup(v,"movable",!1):new rl(v,"movable"),M.addCommands(O,!0),M},[y,O]);return Xt(T,{onAnyChange:()=>{P.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===z.IAnchored.Type.TwoCell}),P.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===z.IAnchored.Type.OneCell}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===z.IAnchored.Type.Absolute}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===z.IAnchored.Type.Absolute}),P.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:M=>{S(M.isProtected())},onDelete:()=>{}}),Xt(g,{onMovableSelectionChange:()=>{const M=g.getMovableSelection()[0]??null;_(M),S(!M||M.isProtected()),j()}}),Xt(m,{onCollectionChange:()=>{j()}}),s.useEffect(()=>{const M={disabled:w};P.getCommand("formatAnchorTypeTwoCell").update(M),P.getCommand("formatAnchorTypeOneCell").update(M),P.getCommand("formatAnchorTypeAbsolute").update(M),P.getCommand("toggleLockAspectRatio").update(M);const A=m.getCount(),D=g.getMovableSelection(),L=w||A<=1||D.length===0;let N={disabled:L},W=N;if(!L&&D.length===1){const G=D[0];G.getZIndex()===0&&(N={disabled:!0}),G.getZIndex()===A-1&&(W={disabled:!0})}P.getCommand("moveToFront").update(W),P.getCommand("moveForward").update(W),P.getCommand("moveToBack").update(N),P.getCommand("moveBackward").update(N);const I={disabled:w||D.length<=1};P.getCommand("formatDrawAlignLeft").update(I),P.getCommand("formatDrawAlignCenter").update(I),P.getCommand("formatDrawAlignRight").update(I),P.getCommand("formatDrawAlignTop").update(I),P.getCommand("formatDrawAlignMiddle").update(I),P.getCommand("formatDrawAlignBottom").update(I),P.getCommand("formatDrawFlipHorz").update(I),P.getCommand("formatDrawFlipVert").update(I),P.getCommand("formatDrawGroup").update(I),P.getCommand("formatDrawUngroup").update(I),P.getCommand("formatDrawSwapShapes").update(I),P.getCommand("formatDrawSwapShapesHorz").update(I),P.getCommand("formatDrawSwapShapesVert").update(I);const U={disabled:w||D.length<=2};P.getCommand("formatDrawDistributeHorz").update(U),P.getCommand("formatDrawDistributeVert").update(U)},[R,w,R]),P}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:u,commands:l,target:d,notifier:c});s.useEffect(()=>{n?.getStage()},[n?.getStage()]);const f=s.useMemo(()=>a.jsx(zk,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,l,p]);return f&&n?f:null})),Vk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:l,setEditingCoords:d,commands:c,notifier:u=Ys}=e,p=$r(),[f,h]=s.useState(null),[m,g]=s.useState(null),[x,y]=s.useState(null),[v,b]=s.useState(null),[C,k]=s.useState(null);s.useLayoutEffect(()=>{if(x===null)return b(null),void k(null);const D=()=>{const L=o.getRange(x).getCell(),N=L.getStyle();let W,I=N.getFill()?.toCSS(r.body.darkMode);I.background!=="none"&&I.background!=="transparent"||(I=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),I.background!=="none"&&I.background!=="transparent"||(I={background:r.body.fill}),b({style:I}),L&&!L.getFormula()&&(W=L?.getRenderHorizontalAlignment()),k(W??lg)};return D(),o.getRange(x).addListener(()=>{D()})},[o,x,r?.body]);const E=ue(()=>{let D=m.editState.dirty??"";if(m.editState.dirty!==void 0){const L=z.TextUtils.clampString(D);try{const N=m.sheet.getRange(m.coords),W=`Typing '${L}' into ${N.toString()}`;return N.setValue(D,{description:W,autoFit:!0}),y(null),g(null),p.setMode(null),d(null),!0}catch(N){throw u.showError(new Error(`Unable to enter '${L}'.`,{cause:N})),N}}},[o,m,u]),R=ue(D=>o.getRange(D).getCell().getExtrusions()??vo.cellToRange(D),[o]);ue(D=>{let L=z.IRange.Orientation.Row,N=!1;D!==z.IRange.Direction.Up&&D!==z.IRange.Direction.Down||(L=z.IRange.Orientation.Column),D!==z.IRange.Direction.Left&&D!==z.IRange.Direction.Up||(N=!0),o.getSelection().traverse(L,N)},[o]);const j=s.useCallback((D,L)=>{if(i)return i(D,L);if(!o)return null;const{ref:N,...W}=D;return a.jsx(B9,{ref:N,...W,sheet:o,bodyStyle:r?.body,activeCoords:L,commands:c,onChangeEdit:I=>{const U={sheet:o,coords:L,editState:I};p.setMode(G=>({...G,description:U.editState.editMode?"Edit":"Enter",args:{...G?.args,stateAndCoords:U}}))},editState:m.editState})},[o,v,i,m,x]),{overlay:B,startEdit:T,submitEdit:_,cancelEdit:w,onKeyboardEventNative:S,onPointerEventNative:O}=(D=>{const{view:L,canEdit:N=FC,getCellEditor:W,onBeforeStartEdit:I,onStartEdit:U,onSubmitEdit:G,onCancelEdit:Q,onDoneEdit:H,isEditorStartKeyEvent:$=zC,isEditorStartPointerEvent:F=BC,containerProps:X,borderStrokeFill:K,borderStrokeWidth:ne=2,getRangeCoords:J=null,activeCoords:re,alignment:fe=Kl.Left}=D,[ie,ee]=s.useState(!1),[pe,Te]=s.useState(void 0),Ae=ct((Y,se,Ce,Pe,Qe,Ge)=>{if(!se)return null;const Be=Qe?.(se,Y),ot=Y.getRangeCoordsBounds(Be),Ze=Y.toClipBounds(ot),et=ot,mt=Y.getZoom();if(!Ze)return null;Ce&&(Ce*=mt),Pe&&(Pe*=mt);let pt=et,it=!1;if(Ce!==void 0){let Vt={...Be},nn=0;for(;!it&&pt.width<=Ce&&nn<20;){nn++,nn>19&&console.warn("max width reached");const bn=Y.getTotalRangeCoords(),kn=Y.getLayout();Ge===Kl.Left?Vt.colEnd+1<bn.colEnd?Vt.colEnd=kn.getColIndex(pt.x+Ce):it=!0:Ge===Kl.Right?Vt.colStart-1>=0?Vt.colStart=kn.getColIndex(pt.x-(Ce-pt.width)):it=!0:Ge===Kl.Center&&Vt.colEnd+1<bn.colEnd&&Vt.colStart-1>=0?(Vt.colStart=kn.getColIndex(pt.x-(Ce-pt.width)/2),Vt.colEnd=kn.getColIndex(pt.x+pt.width+(Ce-pt.width)/2)):it=!0,it||(pt=Y.getRangeCoordsBounds(Vt))}}pt.height=et.height,Pe!==void 0&&(pt.height=Math.max(Pe+1,et.height));const{width:Wt,height:qt}=Y.getViewportSize();return{x:pt.x??0,y:pt.y??0,height:Math.min(qt-pt.y,pt.height)+1,width:Math.min(Wt-pt.x,pt.width)+1}},[fe]),ae=ct(N,[N]),he=s.useCallback(()=>{L?.getStage()?.focus()},[L]),we=s.useRef(null),He=ct(Y=>{I?.(Y),Ve(),ee(!0),we.current=null},[I]),Ye=ct(Y=>{U?.(Y.coords)},[U]),wt=ct(Y=>{Y.isSubmitted||Y.isCancelled||(Ie.current.isEditorClosed=!0,he(),Y.isCancelled=!0,Q?.(Y.coords),Ve())},[Q]),Ct=ct(Y=>{if(Y.isSubmitted||Y.isCancelled)return!1;try{return we.current=Y.coords,Y.isEditorClosing=!0,Y.isSubmitted=!0,Y.isEditorSubmitted||(Y.isEditorSubmitted=!0,Y.editorRefs[0]?.submitEdit?.()),Y.coords,G?.(Y.coords),Y.isEditorClosed=!0,he(),Ve(),!0}catch(se){throw Y.isEditorClosing=!1,Y.isSubmitted=!1,se}},[G]),Ee=ct(Y=>{ee(!1),H?.(Y.coords),Ve()},[H]),Ie=s.useRef(null),ft=s.useRef(null),$e=s.useRef(null),yt=s.useRef([]),[tt,oe]=s.useReducer(Y=>Y+1,0),Ve=s.useCallback(Y=>{Y&&yt.current.push(Y),oe()},[]),xe=ct(Y=>{if(Y.defaultPrevented||Y.isSynthetic||!L)return;const se=L?.getCellCoordsFromClient(Y.clientX,Y.clientY);se&&Ve({eventType:"pointer",event:Y,coords:se})},[L]),be=ct(Y=>{const se=Y.nativeEvent;xe(se)},[L]),te=ct(Y=>{if(Y.defaultPrevented||Y.isSynthetic||!L?.getStage())return;const se=ft.current;$(Y,se)&&(Y.stopPropagation(),Y.preventDefault()),Y.key,Ve({eventType:"keyboard",event:Y,coords:se})},[L]);s.useLayoutEffect(()=>{const Y=(Pe,Qe)=>{const Ge=Qe?.cell??Pe;if(!Ge)return null;const Be=Ge;if(!ae(Ge))return null;He?.(Ge);const ot=Eo.uuidV4();Qe=Object.freeze({autoFocus:!0,...Qe}),$e.current=Ge;const Ze={coords:Be,startEvent:Qe,uuid:ot,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:et=>{Ze.isMounted||(Ze.isMounted=!0,Ve())},onUnmount:et=>{if(Ze.editorRefs.length===0){const mt=()=>{Ze.isMounted=!1,Ve()};if(document.activeElement!==document.body)mt();else{const pt=it=>{it.defaultPrevented||it.target!==document.body||te(it)};window.addEventListener("keydown",pt,!0),L.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",pt),mt()},{once:!0}),he()}}}};return Ze};if(yt.current.length<=0&&!Ie.current)return;const se=yt.current[0];q4(se),(Pe=>{const Qe=[],Ge=Pe?.length??0;for(let Be=0;Be<Ge;Be++){const ot=Pe[Be];Qe.push(q4(ot))}})(yt.current),Ie.current,Ie.current;let Ce=Ie.current;if(Ie.current){if(Ie.current.isDone)Ie.current=null;else if(Ie.current.isSubmitted||Ie.current.isCancelled){if(Ie.current.isMounted)return;Ie.current.isDone||(Ee(Ie.current),Ie.current.isDone=!0)}}if(se){if(se.eventType==="start"){const Pe=se,Qe=Pe.startEvent?.cell??ft.current;Ie.current&&Pt.isEqualCells(Ie.current.coords,Qe)||(Ie.current=Y(Qe,Pe.startEvent))}else if(se.eventType==="keyboard"){const Pe=se.event;if(Ie.current){let Qe=!1;switch(Pe.which){case 37:case 39:case 38:case 40:case 13:case 9:Qe=!0}if(!Qe){Ie.current.events.push(se);for(let Ge=0;Ge<Ie.current.editorRefsDispatchEditorEvent.length;Ge++)Ie.current.editorRefsDispatchEditorEvent[Ge](se)}}else if($(Pe,se.coords)){const Ge=Y(ft.current,void 0);Ge&&Ge.events.push(se),Ie.current=Ge}}else if(se.eventType==="pointer"){const Pe=se.event;if(Ie.current){Ie.current.events.push(se);for(let Qe=0;Qe<Ie.current.editorRefsDispatchEditorEvent.length;Qe++)Ie.current.editorRefsDispatchEditorEvent[Qe](se)}else{const Qe=se?.coords??ft.current,Ge=F(Pe,Qe);if(Ge){let Be;typeof Be!="boolean"&&(Be=Ge);const ot=Y(Qe,Be);ot&&ot.events.push(se),Ie.current=ot}}}else if(se.eventType==="submit"){if(Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;Ct(Ie.current)}}else if(se.eventType==="cancel"){if(Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;wt(Ie.current)}}else if(se.eventType==="coordsChange"){const Pe=se;if(ft.current=Pe.activeCoords,Ie.current,Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;try{Ct(Ie.current)}catch{}}}}yt.current.length>0&&(yt.current.shift(),Ve()),yt.current.length===0&&(!Ie.current||Ie.current.isEditorClosing||Ie.current.isEditorClosed?!Ie.current&&Ce&&he():Ie.current.isMounted&&!Ie.current.isStarted&&(Ie.current.isStarted=!0,Ie.current.startEvent.autoFocus&&(typeof Ie.current.startEvent.autoFocus=="string"?Ie.current.editorRefs[0]?.autoFocus(Ie.current.startEvent.autoFocus):Ie.current.editorRefs[0]?.autoFocus()),Ye?.(Ie.current),requestAnimationFrame(()=>{L&&Ie.current?.coords&&L.scrollCellCoordsIntoView(Ie.current.coords)})))},[tt]),s.useEffect(()=>{$e.current=re;const Y=Ie.current?.coords;Pt.isEqualCells(Y,re)||(Ie.current&&(Ie.current.isEditorClosing=!0),Ve({eventType:"coordsChange",activeCoords:re}))},[re]);const Me=s.useCallback(Y=>{te(Y.nativeEvent)},[]),{width:_e=0,height:ve=0}=pe??{width:0,height:0},Oe=ct(W,[W]);return{overlay:ct(Y=>{if(!Ie.current||Ie.current.isEditorClosed)return Ie.current,null;Ie.current.coords;let se=Ae(Y,Ie.current.coords,_e,ve,J,fe),Ce=!0;se&&se.width!==0&&se.height!==0||(se={x:0,y:0,width:_e,height:_e},Ce=!1);const Pe=Y.getZoom(),Qe={containerBounds:{x:0,y:0,width:se.width/Pe,height:se.height/Pe},setNaturalDimensions:Te,zoom:Pe};return a.jsx(NC,{session:Ie.current,refLatestCoords:$e,handleSubmitEdit:Ct,handleCancelEdit:wt,cellBounds:se,borderStrokeWidth:ne,borderStrokeFill:K,isInBounds:Ce,getCellEditor:Oe,propsEditor:Qe,alignment:fe,...X},"editor:"+Ie.current.uuid)},[W,J,tt,_e,ve,fe,ne,K]),startEdit:s.useCallback(Y=>{Ve({eventType:"start",startEvent:Y})},[]),submitEdit:s.useCallback(()=>{Ve({eventType:"submit"})},[]),cancelEdit:s.useCallback(()=>{Ve({eventType:"cancel"})},[]),onKeyboardEvent:Me,onPointerEvent:be,onKeyboardEventNative:te,onPointerEventNative:xe,isEditing:ie}})({view:n,activeCoords:f,getCellEditor:j,canEdit:()=>{const D=!o.getProtection().isLocked();return D||l(),D},onBeforeStartEdit:D=>{const L=N9(()=>o.getRange(D).getCell()),N={sheet:o,coords:D,editState:Object.freeze(L)};p.setMode({key:"edit",args:{stateAndCoords:N}}),g(N)},onStartEdit:D=>{y(D),d(D)},onSubmitEdit:E,onCancelEdit:D=>{y(null),g(null),p.setMode(null),d(null)},onDoneEdit:D=>{p.setMode(null)},containerProps:v,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:C,getRangeCoords:R});Xt(o.getSelection(),{onChange(D){h(o.getSelection().getCoords().cell)}});const P=ue(D=>{O(D),x&&_()},[O,w,x]),M=s.useCallback(D=>{O(D)},[O]),A=s.useCallback(D=>{S(D)},[S]);return s.useEffect(()=>{const D=n?.getStage();if(D)return D.addEventListener("pointerdown",P),D.addEventListener("dblclick",M),D.addEventListener("keydown",A),()=>{D.removeEventListener("pointerdown",P),D.removeEventListener("dblclick",M),D.removeEventListener("keydown",A)}},[n?.getStage()]),s.useEffect(()=>{const D=p.getMode(),L=D?.key;L==="edit"||L==="enter"?m?D.args?.cancel?w():D.args?.submit?_():g(D.args?.stateAndCoords):T(D.args?.start):x&&w()},[p]),B(n,t)})),U9="white",q9="black",Hk=`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='${q9}' fill='${U9}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,$k=`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='${q9}' fill='${U9}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Wk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=s.useState(o.getTables().getCount()>0),[l,d]=s.useState(null),[c,u]=s.useState(null),[p,f]=s.useState(null),[h,m]=s.useState(null),g=ue(()=>{if(o.getTables().getCount()>0){i(!0);const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)}else i(!1),d(null)},[o,n]),x=ue(E=>{E.preventDefault(),E.stopPropagation();const R=n.getCellCoordsFromClient(E.clientX,E.clientY),j=o.getTables().search({address:R});j.length===1&&j[0].select()},[n,o]),y=ue(E=>{E.preventDefault(),E.stopPropagation();const R=n.getCellCoordsFromClient(E.clientX,E.clientY),j=o.getTables().search({address:R});if(j.length===1){const B=j[0].getRange().getCoords(),T={colStart:B.colStart,rowStart:R.rowIndex,colEnd:B.colEnd,rowEnd:R.rowIndex};o.getRange(T).select()}},[n,o]),v=ue(()=>{if(!r)return;const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)},[o,r,n]);Xt(o?.getSelection(),{onChange(E){u(o.getSelection().getCoords().cell)}}),Xt(p,{onAnyChange(E){g(),v()}}),Xt(h,{onAnyChange(E){v()}}),Xt(o,{onTablesChange(E){g(),v()},onInvalidated(E){g(),v()}});const b=s.useMemo(()=>Ht.debounce(Ht.throttle(v,300),300),[]);s.useEffect(()=>{b()},[n]),s.useEffect(()=>{let E=null;if(l)for(let R=0;R<l.length&&!E;R++){const j=l[R],B=j.getRange().getCoords();z.CoordUtils.isCellWithinRange(c,B)&&(E=j)}f(E)},[c,l]);const C=ue(E=>{let R=null;if(l)for(let j=0;j<l.length;j++){const B=l[j],T=B.getRange().getCoords();let _=n.getRangeCoordsBounds(T);const w=n.getRelativePointFromClient(E.clientX,E.clientY),S=w.x,O=w.y;if(S>=_.x&&S<=_.x+_.width&&O>=_.y&&O<=_.y+_.height){const P=n.getViewportSize();S<=0||O<=0||S>=P.width||O>=P.height||(R=B)}}m(R)},[n,l]);if(s.useEffect(()=>{const E=n?.getStage();if(E&&l)return E.addEventListener("mousemove",C),E.addEventListener("mouseleave",C),()=>{E.removeEventListener("mousemove",C),E.removeEventListener("mouseleave",C)}},[l,n?.getStage()]),!n||!l||l.length===0)return null;const k=[];for(let E=0;E<l.length;E++){const R=l[E];if(R.isClosed())continue;const j=R===h,B=R===p,T=R.getRange().getCoords(),_=n.getRangeCoordsBounds(T);let w;if(j||B){const S=R.getStyle().getProperties(),O=S.headerRow?.fill?.background??S.wholeTable?.border?.top?.color?.toString();if(O&&o){const P=o.getStyles().parseColor(O);P&&(w=P.toCSS())}w||(w="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(a.jsx("div",{style:{position:"absolute",left:_.x,top:_.y,width:Math.min(16,_.width),height:_.height,pointerEvents:"all",cursor:Hk},onMouseDown:y},`table-select-row-${R.getName()}`)),k.push(a.jsx("div",{style:{position:"absolute",left:_.x,top:_.y,width:Math.min(16,_.width),height:Math.min(16,_.height),pointerEvents:"all",cursor:$k},onMouseDown:x},`table-select-${R.getName()}`)),k.push(a.jsx(q1,{x:_.x,y:_.y,width:_.width,height:_.height,range:T,strokeWidth:B?.5:0,stroke:w??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:j?`${w} 0px 0px 1px 1px`:void 0}},`table-outline-${R.getName()}`))}return k})),Uk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,l]=s.useState(null),[d,c]=s.useState(null),u=s.useRef(null),p=ue(()=>{const y=o.getSelectedCell(),v=y.getSpill()?.getCoords()??null;vo.isEqualRanges(v,i)||(c(v?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(v),coords:v}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),l(v))},[o,n,i]);s.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),d&&(u.current=setTimeout(()=>{c(null),u.current=null},r)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[d,r]);const f=s.useMemo(()=>Ht.debounce(Ht.throttle(p,80),80),[]);if(Xt(o?.getSelection(),{onChange(y){f()}}),Xt(o,{onSpillsChange(y){p()},onInvalidated(y){p()}}),!n||!i&&!d)return null;const h=o.getRange(i).getValue()instanceof z.FormulaError.Spill,m=[];let g=d?.bounds??n.getRangeCoordsBounds(i);if(d&&!Ht.isEqualBounds(d.bounds,n.getRangeCoordsBounds(d.coords))&&c(null),g=n.toClipBounds(g,-10),!g)return;const x="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return m.push(a.jsx(q1,{x:g.x,y:g.y,width:g.width,height:g.height,range:i,strokeWidth:1,stroke:x,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:d?.transition==="out"?0:1,transition:d?.transition?d.transition==="in"||d.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${x} 0px 0px 4px 0px`}},"spill-outline}")),m})),qk={position:"absolute",top:0,left:0,bottom:0,right:0},w7=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},l=n.body=Ht.mergeContentful(e.body,i);return n.body=Ht.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},l),n.buttonSurface=Ht.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=Ht.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Ht.mergeContentful(n.header,i),n.headerSelect=Ht.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Ht.mergeContentful(n.headerSelect,i),n.headerSelectAll=Ht.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Ht.mergeContentful(n.headerSelectAll,i),n},Zk={fireOnModelChange:!1},S7={},Z9=s.memo(s.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=S7,headersStyle:r=S7,onSheetContextMenu:i,showColumnHeaders:l,columnHeaderProps:d,showRowHeaders:c,rowHeaderProps:u,showScrollbars:p=!0,scrollPaneProps:f,onViewportChange:h,commands:m,onRepeatCommandChange:g,onMoveCell:x,overlays:y,renderMovable:v,viewportComponent:b,onElementLoad:C,getCellEditor:k,onFocus:E,onBlur:R,style:j=gn.EmptyCssProperties,notifier:B,onShowTooltip:T,onShowColumnTooltip:_,onShowRowTooltip:w,onCloseTooltip:S,gridProps:O,cellRenderProps:P,...M}=e;if(s.useEffect(()=>{z.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[A,D]=s.useReducer(Le=>Le+1,0),[L,{width:N,height:W}]=pi(),I=ue(T,[T]),U=ue(_,[_]),G=ue(w,[w]),Q=ue(S,[S]),H=s.useRef(!1);s.useLayoutEffect(()=>{H.current=!0},[n]);const $=n?.getStyles(),F=s.useMemo(()=>w7(o,$),[o,$]),X=s.useMemo(()=>w7(r,$),[r,$]),{body:K={},buttonSurface:ne={}}=F,{header:J={},headerSelect:re={},headerSelectAll:fe={}}=X,ie=s.useRef(null),[ee,pe]=s.useState(()=>n?.getView()),Te=(ee?.getZoomScale()??100)/100,Ae=s.useMemo(()=>({vertical:ee.isShowColumnGridlines()&&Te>=.4,horizontal:ee.isShowRowGridlines()&&Te>=.4}),[ee?.isShowColumnGridlines(),ee?.isShowRowGridlines(),Te]),ae=s.useMemo(()=>{if(ee?.getGridLineColor())return{strokeDasharray:"1,1"}},[ee?.getGridLineColor(),F]),he=l??ee?.isShowColumnHeaders(),we=c??ee?.isShowRowHeaders(),[He,Ye]=s.useState({width:0,height:0}),wt=s.useMemo(()=>{let Le=40,le=20;const ut=n?.getStyles().getNormal().getFont();if(He.width>0&&He.height>0){const bt=ut?.toCSS()?.fontFamily??F.header.text.fontFamily,q=ut?.getSize()??F.header.text.fontSize,Z=z.IFont.getSharedMeasurer()(""+He.height,Math.ceil(q*z.IFont.getDeviceScale()),bt);Le=Z.width,le=Z.lineHeight}return{width:Math.round(Le+5),height:Math.round(le+3)}},[He,F?.header.text,n]),Ct=we?Te*wt.width:J.edgeStrokeWidth,Ee=he?Te*wt.height:J.edgeStrokeWidth,Ie=Math.max(N,(n?.getColumnHeaders().getDefaultSize()??wt.width)+Ct+1),ft=Math.max(W,(n?.getRowHeaders().getDefaultSize()??wt.height)+Ee+1),$e=s.useRef(new Map),yt=s.useRef(null),tt=()=>({getColOffset:Le=>n.getColumnHeaders().findOffset(Le),getColIndex:Le=>n.getColumnHeaders().findIndex(Le),getRowOffset:Le=>n.getRowHeaders().findOffset(Le),getRowIndex:Le=>n.getRowHeaders().findIndex(Le)}),[oe,Ve]=s.useState(()=>tt()),[xe,be]=s.useState(!1),[te,Me]=s.useState(null),_e=!0,ve=F.selection?.strokeFill,Oe=s.useCallback(()=>Oo.current,[]),[Y,se]=s.useState(),Ce=ue(Le=>{se(Le),n&&n.getView()&&n.getView().setTopLeft(Le?{left:Le.left,top:Le.top}:null),h?.(Le)},[n,h]),Pe=s.useRef(null);s.useEffect(()=>{if(!Y||!n)return;const Le=n.getRangeAtBounds({x:Y.left,y:Y.top,width:Y.width,height:Y.height});Pe.current?.(),Pe.current=Le.addListener(()=>{const le=Le.getCoords();ie?.current?.invalidate(le)})},[Y,n]);const[Qe,Ge]=s.useState(()=>n?.getView().getTopLeft()),Be=ue(Le=>{const le=vo.cellToRange(Le);if(n.isClosed())return le;const ut=n.getRange(le,{excludeHidden:!0}).getMerges();return ut.length===0?le:ut[0]},[n]),ot=Le=>{if(!Le||Le.coords.colIndex===0&&Le.coords.rowIndex===0)return null;const le={};return Le.coords.colIndex>0&&(le[uo.Left]={index:Le.coords.colIndex,scrollOffset:Le.topLeft.left}),Le.coords.rowIndex>0&&(le[uo.Top]={index:Le.coords.rowIndex,scrollOffset:Le.topLeft.top}),le},[Ze,et]=s.useState(()=>ot(n.getView().getFreezePanes())),mt=$r(),pt=s.useCallback(()=>ie.current,[]),it=ue(Le=>{mt.setMode(le=>le?.key==="edit"?{...le,args:{...le.args}}:{key:"edit",args:{stateAndCoords:null,start:Le}})},[]),Wt=ue(()=>Y,[Y]),qt=function(Le){const{sheet:le,onRepeatCommandChange:ut,bodyStyle:bt,commands:q,target:Z,notifier:ce,onStartEdit:me,getViewport:Fe}=Le,[Je,We]=s.useState(null),[_t,Dt]=s.useState(null),Rt=s.useRef(null),Ft=ue(me,[me]),hn=ue(Fe,[Fe]),[Ot,At]=s.useState(),[An,ht]=s.useState(()=>le?.getStyles().parseColor(z.IColor.Scheme.Bg2)),[Yt,Xn]=s.useState(()=>le?.getStyles().getNormal().getFont().getFill()),Nt=$r();s.useRef(Nt.getMode()).current=Nt.getMode();const ln=eh(),[On,or]=s.useState(Ht.EmptyArray),y0=s.useCallback(()=>{if(Rt.current!==le)return;const de=le.getSelectedRanges();let Ne=null;On.length>0&&vo.isCellWithinRange(Je,On[0].getRange().getCoords())&&(Ne=On[0]);const Xe=le?.getSelectedCell(),De=Xe?.getCoords()??null;wo.unstable_batchedUpdates(()=>{oc(Ne),We(De),Dt(de)})},[le,On,_t,Je]),Ha=s.useCallback(Ht.debounce(y0,210),[y0]);s.useEffect(()=>{Rt.current=le,y0()},[le]);const Io=ue(()=>le.getRange(Je).getCell(),[le,Je]),ho=ue(async(de,Ne,Xe=null,De=!1,nt=!0)=>{const at=de?.label?.(),an=async()=>{const en=await Promise.resolve(nt&&ce?.showBusy?.(at??"Busy..."));try{await le.doBatch(async()=>Ne(le),at),De&&Nt.setMode(null),en&&en()}catch(Hn){if(en&&en(),!Hn)return;ce?.showError?.(Hn)}},sn=[];let Kt=!1;const pn=async()=>(sn.push(an),(async()=>{if(!Kt){for(Kt=!0;sn.length>0;){const en=sn.shift();en&&await en()}Kt=!1}})());if(ut){let en=null;if(Xe!==!1&&de){const Hn=Xe??at;en=new vt(de.key(),Z,{label:Hn,description:Hn},pn)}ut(en)}return pn()},[le,ut,ce]),zt=ue((de,Ne,Xe=!1,De)=>ho(de,nt=>{const at=nt.getSelectedRanges();Xe&&at.updateStyle(null,De),at.updateStyle(Ne,De),at.autoFit({expandOnly:z.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[le]),qu=ue((de,Ne,Xe)=>{ho(de,De=>{let nt=Ne;(Xe||Ne?.address)&&(nt=nt??{},!Xe&&Ne?.address?.startsWith("#")?Xe=Ne?.address.substring(1):Xe&&(nt.displayText=Xe)),De.getSelectedRange().setHyperlink(nt)})},[le]),Zu=ue((de,Ne)=>{ho(de,Xe=>{Xe.getSelectedRange().setComments(Ne)})},[le]),ul=ue((de,Ne)=>{ho(de,Xe=>{Xe.getSelectedRanges().clear(Ne)})},[le]),H0=ue(async(de,Ne,Xe=!1,De=!1)=>ho(de,async nt=>{let at=nt.getSelectedRanges();Xe&&(Ne===z.IRange.Orientation.Row?at=at.getEntireRows(De):Ne===z.IRange.Orientation.Column&&(at=at.getEntireColumns(De)));let an=null;const sn=Nt.getMode()?.key;if(sn==="copy"||sn==="cut"){const Kt=await ln.getClipboard().readReference();Kt&&Kt.getItemType()==="range"&&(an=Kt.getItem(),an.getCoords()||(an=null))}if(an){const Kt=await at.insertFrom(an,{...an.getMarkOptions(),orientation:Ne,autoSelect:!0});!Kt||Kt.isEntireRows()||Kt.isEntireColumns()||Kt.autoFit({orientations:z.IRange.Orientations.Row,minContent:!0}),Nt.setMode(null)}else at.insert(Ne,{autoSelect:!0})},"Insert Cells",!1),[Nt]),[l0,oc]=s.useState(null),Tm=ue(de=>le.getStyles().setDefaultTableStyle(de),[le]),jm=ue(de=>{le.getStyles().getTableStyle(de)?.delete()},[le]),hl=ue((de,Ne)=>{ho(de,async Xe=>{const De=Xe.getSelectedRange(),nt=Xe.getSelectedCell().getCoords();let at=null,an=0;const sn=nt.rowIndex>0?Xe.getRange({rowIndex:nt.rowIndex,colIndex:nt.colIndex}).getExtended(z.IRange.Direction.Up):null;sn&&Xe.getRange({colStart:nt.colIndex,rowStart:sn.getCoords().rowStart,colEnd:nt.colIndex,rowEnd:sn.getCoords().rowStart}).isContentful()&&(at=z.IRange.Direction.Up,an=nt.rowIndex-sn.getCoords().rowEnd);const Kt=nt.colIndex>0?Xe.getRange({rowIndex:nt.rowIndex,colIndex:nt.colIndex-1}).getExtended(z.IRange.Direction.Left):null;if(Kt&&Xe.getRange({colStart:Kt.getCoords().colStart,rowStart:nt.rowIndex,colEnd:Kt.getCoords().colStart,rowEnd:nt.rowIndex}).isContentful()){const en=nt.colIndex-Kt.getCoords().colEnd;(en<an||!at)&&(at=z.IRange.Direction.Left,an=en)}let pn=null;if(at===z.IRange.Direction.Up){if(pn={...sn.getCoords()},(pn.rowEnd===nt.rowIndex||!Xe.getRange({colIndex:nt.colIndex,rowIndex:nt.rowIndex-1}).isContentful())&&pn.rowStart>0&&Xe.getRange({colIndex:nt.colIndex,rowIndex:pn.rowStart-1}).isContentful()){const en=sn.getExtended(z.IRange.Direction.Up);pn={colStart:nt.colIndex,rowStart:en.getCoords().rowStart,colEnd:nt.colIndex,rowEnd:sn.getCoords().rowEnd}}pn.rowEnd=nt.rowIndex-1}else if(at===z.IRange.Direction.Left){if(pn={...Kt.getCoords()},(pn.colEnd===nt.colIndex||!Xe.getRange({colIndex:nt.colIndex-1,rowIndex:nt.rowIndex}).isContentful())&&pn.colStart>0&&Xe.getRange({colIndex:pn.colStart-1,rowIndex:nt.rowIndex}).isContentful()){const en=Kt.getExtended(z.IRange.Direction.Left);pn={colStart:en.getCoords().colStart,rowStart:nt.rowIndex,colEnd:en.getCoords().colEnd,rowEnd:nt.rowIndex}}pn.colEnd=nt.colIndex-1}if(De.size!==1&&at){const en=De.getCoords(),Hn=De.startIncrementalUpdates({orientation:z.IRange.Orientation.Column}),io={...pn},$o=en.rowStart,Ar=en.rowEnd,Fr=en.colStart,zr=en.colEnd,rr=at===z.IRange.Direction.Up;for(let Ao=Fr;Ao<=zr;Ao++){io.colStart=rr?Ao:pn.colStart+(Ao-Fr),io.colEnd=rr?Ao:pn.colEnd+(Ao-Fr);for(let po=$o;po<=Ar;po++){io.rowStart=rr?pn.rowStart+(po-$o):po,io.rowEnd=rr?pn.rowEnd+(po-$o):po;const yn=Xe.getRange(io).toString();Hn.pushAt(po,Ao,`=${Ne}(${yn})`)}}Hn.apply()}else{const en=pn?Xe.getRange(pn).toString():"",Hn=`=${Ne}(`;Ft?.({text:`${Hn}${en})`,editMode:!0,initialSelection:{start:Hn.length,end:Hn.length+en.length}})}},!1)},[le]),$a=ue((de,Ne,Xe=!1,De=!0)=>{ho(de,async nt=>{let at=null;if(l0)return void l0.updateStyleOptions(Ne);{const Kt=nt.getSelectedRanges().getFixed(!0),pn=nt.getSelectedRange().getDefaultSortCriteria();let en={ranges:Kt,hasHeader:pn?.options?.hasHeader??!1};at=De?new Promise((Hn,io)=>{const $o={tableOptions:en,onCancel:()=>{io()},onDone:Ar=>{Hn(Ar)},context:{getNames:()=>nt.getNames()}};ce.showWindow?.("tableNew",$o)}):{option:"Ok",tableOptions:en}}const an=await Promise.resolve(at);if(an?.option!=="Ok")throw null;const sn=await Promise.resolve(ce?.showBusy?.(de.label()));try{await nt.getTables().add(an.tableOptions.ranges.at(0),{styleName:Ne?.name,clearFormatting:Xe,hasHeader:an.tableOptions.hasHeader}).getRange().select()}catch(Kt){sn(),ce?.showError?.(Kt)}sn()},!1,!0,!1)},[l0]),Gu=ue(()=>bt,[bt]),Ku=ue(de=>({styles:()=>le.getStyles(),table:()=>de,bodyStyle:Gu,getNames:()=>le.getNames()}),[le]),Mm=ue(async(de,Ne,Xe,De=!0)=>{let nt=null;if(!Ne){let at=le.getSelectedRange();at.size===1&&(at=at.getSurrounding());let an=le.getTables().search({address:le.getSelectedRange()});an.length>0&&(Ne=an[0]),await at.select()}if(Ne){if(De){try{Xe&&await Ne.select()}catch{}nt=new Promise(async(at,an)=>{de.update({context:Ku(Ne)});const sn={command:de,commands:ge,notifier:ce,onDone:pn=>{at(pn)}},Kt=await ce.showWindow?.("tableDetails",sn,{disableAutoDestroy:!0});setTimeout(()=>{Kt.focus()},180)})}Promise.resolve(nt).then(at=>{},at=>{ce?.showError?.(at)})}},[ce]),Xu=ue(async(de,Ne,Xe=!1)=>{let De=null;if(Ne)Ne.isITable?De=Ne:Ne.getValue()&&(De=Ne.getValue());else{const nt=le.getTables().search({address:le.getSelectedRange()});nt.length>0&&(De=nt[0])}if(De){if(!Xe){const nt=De.getRange().getCoords(),at=(nt.colEnd-nt.colStart+1)*(nt.rowEnd-nt.rowStart+1);if(at>1e4&&await ce?.showOptions({title:"Confirm",description:`Converting a table to range with '${at}' cells will set a large number of cell styles and may affect performance.
|
|
62
|
+
The content is not applied.`}),new je("pasteFormulas",D,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new je("pasteTranspose",D,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new je("pasteLinks",D,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];g.addCommands(L,!0)},[g,f]),s.useEffect(()=>{if(!g)return;const D={disabled:!h.getProtection().isFormatCellsAllowed()};g.getCommand("pasteValues").updateCallback(L=>M.paste({...kk,...L})).update(D),g.getCommand("pasteFormats").updateCallback((L,N)=>M.paste({...Ek,description:N.label(),...L})).update(D),g.getCommand("pasteFormulas").updateCallback((L,N)=>M.paste({..._k,description:N.label(),...L})).update(D),g.getCommand("pasteTranspose").updateCallback((L,N)=>M.paste({...Tk,description:N.label(),...L})).update(D),g.getCommand("pasteLinks").updateCallback((L,N)=>M.paste({...jk,description:N.label(),...L})).update(D),g.getCommand("cut").update(D),g.getCommand("paste").update(D)},[h,g]);const A=s.useMemo(()=>{if(!w||!T.current)return;const D=w.key;if(D!=="copy"&&D!=="cut"&&D!=="formatPainter")return;const L=T.current.getItem();if(L.getSource()!==h)return;const N=T.current.isCut?.(),W=N?E:k,I=N?C:b,U=L.getCoords(),G=U?[U]:null;return G&&G.length!==0?Q=>{const H=[];for(let $=0;$<G.length;$++){const F=G[$],X=Q.toClipBounds(Q.getRangeCoordsBounds(F,{top:0,left:0,right:1,bottom:1}),Ko);X&&(H.push(B({range:F,key:`copy-selection-background-${$}`,x:X.x,y:X.y,width:Math.max(X.width,0),height:Math.max(X.height,0),stroke:W,strokeWidth:2})),H.push(B({range:F,key:`copy-selection-foreground-${$}`,x:X.x+(X.width<=2?-1:0),y:X.y,width:Math.max(X.width,3),height:Math.max(X.height,3),stroke:I,strokeWidth:2,isAnimatedStroke:!0})))}return H}:null},[w,h,m,b,k,C,E]);return{...M,clipboard:P,overlays:A}})({element:o,sheet:r,sheetView:u,commands:l,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:d});return Xt(r?.getSelection(),{onChange(f){}}),s.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),Rk={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ik={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Dk={key:"dragCopy",description:"Drag selection to copy cell contents."},Lk={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},b7=(e,t)=>t.ctrlKey&&t.shiftKey?Lk:t.ctrlKey?Dk:t.shiftKey?Ik:Rk,Ok={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Pk=s.memo(s.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:l,onShowTooltip:d,onCloseTooltip:c,sheet:u,gridRef:p,gridStyle:f,isActive:h,editingCoords:m,...g}=e,x=n?.getBounds(),y=ue(d,[d]),v=ue(c,[c]),[b,C]=s.useState(()=>u?.getSelection().getCoords()),k=ue(J=>{vo.isEqualSelectionCoords(J,b)||u&&u.getSelection().updateCoords(J)},[u,b]),E=$r(),R=s.useRef(null),[j,B]=s.useState(u?.getProtection().isLocked()),[T,_]=s.useState(u?.getView().getMovableSelection().length>0),w=gn.detectIt().primaryInput==="touch",S=!w&&h,O=m!==null||T,P=ue(J=>{const re=vo.cellToRange(J);if(u.isClosed())return re;const fe=u.getRange(re,{excludeHidden:!0}).getMerges();return fe.length===0?re:fe[0]},[u]),M=ue((J,re,fe,ie,ee,pe)=>{const Te=u.getSelectedRange().getExtended(ie,J).getCoords();switch(ie){case z.IRange.Direction.Up:return Te.rowStart;case z.IRange.Direction.Down:return Te.rowEnd;case z.IRange.Direction.Left:return Te.colStart;case z.IRange.Direction.Right:return Te.colEnd}},[u]),A=ue(()=>{const J=u.getUsedRange()?.getCoords(),re=u.getRowHeaders().getUsedRange()?.getCoords(),fe=u.getColumnHeaders().getUsedRange()?.getCoords();return{...J,colEnd:Math.max(J?.colEnd??0,fe?.max??0),rowEnd:Math.max(J?.rowEnd??0,re?.max??0)}},[u]),D=ue((J,re)=>u.getRowHeaders().hiddenHeadersAt(J,re),[u]),L=ue((J,re)=>u.getColumnHeaders().hiddenHeadersAt(J,re),[u]),N=ue(J=>u.getRange(J,{excludeHidden:!0}).getMerges(),[u]),W=ue(J=>{u?.getSelection().setAdjusting(J)},[u]),I=ue(async()=>{u?.getSelection().setAdjusting(null),E.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),E.setMode(null))},[E,b,u,o]),U=s.useMemo(()=>{const J=E.getMode();return J?.key==="cut"||J?.key==="copy"},[E]);Xt(u?.getView(),{onMovableSelectionChange:()=>{_(u.getView().getMovableSelection().length>0)}}),Xt(u?.getSelection(),{onChange(J){const re=u.getSelection().getCoords();C(re)}}),Xt(u,{onProtectionChange:()=>{B(u.getProtection().isLocked())}});const{body:G={}}=f||{},Q=n.getLayout(),H=!(S&&b.ranges.length<=1&&m===null&&!j&&(!E.getMode()||U)),{overlay:$,onPointerDown:F}=L9({gridRef:p,commands:o,layout:Q,getCellCoordsAsRangeCoords:P,selection:b,fillHandleBorderColor:G.fill,selectionBackgroundColor:h?f.selection.fill:f.selectionInactive.fill,selectionBorderColor:h?f.selection.strokeFill:f.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?f.selectionRemove.fill:f.selectionInactive.fill,selectionRemoveBorderColor:h?f.selectionRemove.strokeFill:f.selectionInactive.strokeFill,disableFillDrag:H,disableMoveDrag:w||!(h&&b.ranges.length<=1&&m===null&&!j),disableTouchSelection:O,onSelectionChange:k,onSelectionDragStart:W,onSelectionDragEnd:I,onMoveDragStart:(J,re,fe)=>{E.setMode(b7(0,fe))},onMoveDragUpdate:(J,re,fe)=>{E.setMode(b7(0,fe))},onMoveDragEnd:(J,re)=>{E.setMode(null)},onMoveDragDone:async(J,re,fe)=>{if(vo.isEqualRanges(J,re))return;const ie=u.getRange(re);if(l?.showOptions){const ae=ie.getDifferences(J);let he=!1;for(let we=0;!he&&we<ae.getCount();we++)he=ae.at(we).isContentful();if(he&&await l?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ee=!fe.ctrlKey,pe=fe.shiftKey,Te=pe?ee?"Insert Moved Cells":"Insert Copied Cells":ee?"Move Cells":"Copy Cells",Ae=await l?.showBusy?.(Te);try{const ae=u.getRange(J);await ie.doBatch(async()=>{pe?await ie.insertFrom(J,{isCut:ee,undoRange:ae}):await ie.copyFrom(J,{isCut:ee,undoRange:ae}),ae.autoFit({skipCustomSize:!0,orientations:z.IRange.Orientations.Row,minContent:!0}),ie.autoFit({skipCustomSize:!0,orientations:z.IRange.Orientations.Row,minContent:!0})},{description:Te,autoSelect:!0})}catch(ae){l?.showError?.(ae)}finally{Ae?.()}},contentfulCellFinder:M,hiddenRowsAt:D,hiddenColumnsAt:L,mergedRanges:N,getDataCoords:A,canSelectionSpanMergedCells:J=>{const re=u.getRange(J);return re.isEntireColumns()||re.isEntireRows()},onFill:async(J,re)=>{const fe="Auto Fill",ie=await l?.showBusy?.(fe);try{await u.doBatch(()=>{u.getRange(J).autoFill(re),u.getRange(re).autoFit({orientations:z.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:fe,autoSelect:!0})}catch(ee){l?.showError?.(ee)}finally{R.current=null,ie?.()}},onFillPreview:(J,re,fe)=>{if(p.current&&y){E.setMode(Ok);try{R.current?.direction!==fe&&(R.current=null,u.getRange(J).autoFill(re,{previewOnly:we=>{R.current={callback:we,direction:fe}}}));const ie=R.current?.callback?.(re);if(!ie||ie.isEmpty())return;const ee=ie.toText();if(!ee)return;const pe=vo.cellToRange(ie.getCoords()),Te=n.getRelativePointFromClient(0,0);let Ae=0,ae=0,he=fc;if(fe===z.IRange.Direction.Down){Ae=Q.getColOffset(pe.colEnd+1)-Te.x;const we=Q.getRowOffset(pe.rowEnd),He=Q.getRowOffset(pe.rowEnd+1);ae=He-(He-we)/2-Te.y,he=Cd}else if(fe===z.IRange.Direction.Right){ae=Q.getRowOffset(pe.rowEnd+1)-Te.y;const we=Q.getColOffset(pe.colEnd),He=Q.getColOffset(pe.colEnd+1);Ae=He-(He-we)/2-Te.x,he=fc}else if(fe===z.IRange.Direction.Up){Ae=Q.getColOffset(pe.colEnd+1)-Te.x;const we=Q.getRowOffset(pe.rowStart),He=Q.getRowOffset(pe.rowStart+1);ae=He-(He-we)/2-Te.y,he=Cd}else if(fe===z.IRange.Direction.Left){ae=Q.getRowOffset(pe.rowEnd+1)-Te.y;const we=Q.getColOffset(pe.colStart),He=Q.getColOffset(pe.colStart+1);Ae=He-(He-we)/2-Te.x,he=fc}y({anchor:{x:Ae,y:ae},display:ee,placement:he})}catch(ie){l?.showError?.(ie)}}},onFillDone:()=>{R.current=null,E.setMode(null),v?.()}}),X=ue(J=>{F(gn.createSyntheticEvent(J))},[F,m]);s.useEffect(()=>{const J=n?.getStage();if(J)return J.addEventListener("pointerdown",X),()=>{J.removeEventListener("pointerdown",X)}},[n?.getStage()]);const K=Ro(t,()=>({}),[]),ne=s.useRef(null);return a.jsx("div",{className:cr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:sl([K,ne]),...g,children:$(n)})})),Ss=Object.freeze({x:0,y:0,width:0,height:0}),Ak={fireOnModelChange:!1},Fk=s.memo(s.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:l,onHide:d,onShow:c,onUnFocus:u,isDragging:p,updateFrameBounds:f,dragStart:h,style:m,disabled:g,renderMovable:x,...y}=e,[v,b]=s.useState(Ss),[C,k]=s.useState(null),[E,R]=s.useState(!1),j=s.useRef(null);s.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const _=o.toViewBounds(T);b(_??Ss),f(_??Ss)},[o?.getBounds()]),Xt(r,{onBoundsChange:T=>{const _=T.getBounds();if(!_)return;const w=o.toViewBounds(_);b(w??Ss),f(w)},onSelectionChange:()=>{const T=Ht.hasFocus(j.current,!0);!E&&!T||r.isSelected()||u()}}),Xt(r,{onRequestFocus:()=>Ht.whenFocus(j.current,!0)},Ak),s.useEffect(()=>{const T=j.current;return i(T),()=>{l(T)}},[]);const B=s.useMemo(()=>{if(!v)return null;let{width:T,height:_}=v;return x({view:o,movable:r,disabled:g,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:_},onHide:d,onShow:c})},[o,r,v.width,v.height,g,p]);return a.jsx("div",{className:"movable",tabIndex:0,ref:sl([j,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...m},onMouseDown:async T=>{const _=T.shiftKey||T.ctrlKey,w=r.isSelected(),S=T.currentTarget;_&&w?r.unselect():(w&&!_||await r.select({addToSelection:_}),h(T.nativeEvent,S),S.focus())},onFocus:T=>{T.relatedTarget&&!C&&k(T.relatedTarget),R(!0)},onBlur:T=>{C&&!j?.current?.contains(T.relatedTarget)&&k(null),T.relatedTarget&&R(!1)},...y,children:B})})),zk=s.memo(s.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:l,onUnFocus:d,onFocus:c,disabled:u=!1,disableDrag:p=!1,disableResize:f=!1,className:h,style:m,renderDirections:g=["nw","n","ne","w","e","sw","s","se"],onFirstRender:x,...y}=e,v=n.getBounds(),b=ue(x,[x]),C=ue(d,[d]),k=ue(c,[c]),[E,R]=s.useState([]),[j,B]=s.useState(!1),[T,_]=s.useState(!1),w=s.useRef(!0),S=s.useRef(new Map),O=s.useRef(new Map),P=s.useRef(new Map),M=s.useRef(new Map),A=s.useRef(new Map),D=s.useRef({onRequestFocus:Ee=>(fe(Ee),null)}),L=s.useRef(null),N=s.useRef(null),W=s.useRef(null),[I,U]=s.useReducer(Ee=>Ee+1,0);s.useLayoutEffect(()=>{U()},[n,o]),Xt(o,{onCollectionChange:()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ie=A.current;Ie.forEach($e=>{$e()}),Ie.clear();const ft=D.current;for(let $e=0;$e<Ee.length;$e++){const yt=Ee[$e];if(yt.isClosed())continue;const tt=yt.addListeners(ft);Ie.set(yt,tt)}U()},onInvalidated:()=>{U()}}),Xt(r,{onMovableSelectionChange(Ee){Q(),U()}});const G=s.useCallback((Ee,Ie)=>{const ft=P.current.get(Ee);W.current&&(W.current.getTargets().forEach($e=>{if($e===ft)return $e.style.left=Ie.x+"px",$e.style.top=Ie.y+"px",$e.style.width=Ie.width+"px",void($e.style.height=Ie.height+"px")}),W.current.updateRect())},[]),Q=()=>{const Ee=[],Ie=r.getMovableSelection();Ie.forEach(ft=>{const $e=P.current.get(ft);$e&&Ie.indexOf(ft)!==-1&&Ee.push($e)}),R(ft=>Ht.isEqualArrays(ft,Ee)?ft:Ee)},H=s.useRef(null),$=s.useMemo(()=>new Promise(Ee=>{H.current=Ee}),[]),F=s.useRef(null),X=ue(async(Ee,Ie)=>{F.current=Ie,await(async()=>!(!await $.then()||!W.current))()&&F.current===Ie&&W.current.dragStart(Ee,Ie)},[E]),[K,ne]=s.useState(!1),J=s.useRef(null),re=s.useRef(null),fe=ue(async(Ee=null)=>{if(Ee||(Ee=r.getMovableSelection()[0]),!Ee)return C?.(),!1;const Ie=P.current.get(Ee);Ie?(await Ht.whenFocus(Ie),Ie.focus(),re.current=Ie,J.current=null):J.current=Ee},[r]);s.useEffect(()=>{K&&E.length>0&&re.current!==E[0]&&fe(),w.current&&(b?.(),w.current=!1)},[E]);const ie=s.useMemo(()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(Ee.length===0&&S.current.size===0)return null;const Ie=(oe,Ve,xe,be=!0)=>{const te=oe.isSelected(),Me={tabIndex:xe,view:n,movable:oe,onRefLoad:_e=>{J.current===oe&&(_e.focus(),re.current=_e,J.current=null),P.current.set(oe,_e),O.current.set(_e,oe),Ve.rendered=!0,Q()},onRefUnload:_e=>{P.current.delete(oe),O.current.delete(_e),Ve.rendered=!1,Q()},onUnFocus:C,onHide:_e=>{Ve.onHide=_e},onShow:_e=>{Ve.onShow=_e},isDragging:te&&(T||j),disabled:u,renderMovable:i,updateFrameBounds:_e=>{G(oe,_e)},dragStart:X,onMouseUp:()=>{if(F.current=null,N.current){B(!1),_(!1);let _e=!1;M.current?.forEach(ve=>{Ht.isEqualBounds(ve.movable.getBounds(),ve.startBounds)||(_e=!0)}),_e?pe():Te()}},style:{opacity:be?j&&te?.7:void 0:0,zIndex:j&&te?oe.getZIndex()+Ee.length:void 0,pointerEvents:be?void 0:"none",cursor:T&&te?"grabbing":u||p?"initial":"move",boxShadow:!te||T&&!j?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return a.jsx(Fk,{...Me},`movable-${oe.getUUID()}`)},ft=S.current,$e=new Map,yt=[];for(let oe=0;oe<Ee.length;oe++){const Ve=Ee[oe];if(Ve.isClosed())continue;let xe=ft.get(Ve);xe||(xe={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(be,te)=>{if(!te||te.shown===!0)return;te.shown=!0;const Me=++te.visibilityRequestId;requestAnimationFrame(()=>{const _e=S.current.get(be);_e&&Me===te.visibilityRequestId&&(te.onShow?.(be),_e.shown=!0)})},doHide:async(be,te)=>{if(!te||te?.shown===!1)return;te.shown=!1;const Me=++te.visibilityRequestId,_e=await Promise.resolve(te.onHide?.(be));Me===te.visibilityRequestId&&_e!==!1&&(te.shown=!1,S.current.delete(be),U())},visibilityRequestId:0}),xe.frame=Ie(Ve,xe,oe,!0),yt.push(xe.frame),xe.doShow(Ve,xe),ft.delete(Ve),$e.set(Ve,xe)}const tt=[];return r.getMovableSelection().forEach(oe=>{const Ve=ft.get(oe);Ve&&(Ve.frame=Ie(oe,Ve,-1,!1),tt.push(Ve.frame),ft.delete(oe),$e.set(oe,Ve))}),ft.forEach((oe,Ve)=>{oe.frame=Ie(Ve,oe,-1,!1),tt.push(oe.frame),oe.doHide(Ve,oe),ft.delete(Ve),$e.set(Ve,oe)}),S.current=$e,Q(),[...tt,...yt]},[I,n,i,u,p,f,j,T]),ee=ue((Ee,Ie)=>{const ft=`${Ie} ${E.length===1?z.TextUtils.capitalize(O.current?.get(E[0]).getContent().getType()):"Drawings"}`;N.current&&(console.warn(`Transaction ${N.current.getDescription()} is being replaced by ${ft}`),N.current.rollback(),N.current=null),N.current=l.beginCommit({description:ft}),M.current.clear();for(let $e=0;$e<E.length;$e++){const yt=E[$e],tt=O.current?.get(yt);tt?M.current.set(yt,{movable:tt,startBounds:n.toViewBounds(tt.getBounds())}):console.warn("invalid element",tt)}},[l,n,E]),pe=s.useCallback(()=>{if(!N.current)return;const Ee=[];M.current?.forEach(Ie=>{Ee.push(Ie.movable)}),N.current.commit({viewAfter:{view:r,movableSelection:Ee}}),M.current.clear(),N.current=null},[]),Te=s.useCallback(()=>{N.current&&(N.current.rollback(),N.current=null)},[]),Ae=s.useRef(null);s.useEffect(()=>{Ae.current&&(Ae.current.onscroll=Ee=>{Ee.preventDefault(),Ee.srcElement.scrollTop=0,Ee.srcElement.scrollLeft=0})},[Ae.current]);const ae=Ro(t,()=>({isMovableArea:()=>!0,focusMovable:fe,focus:()=>{fe()}}),[r]),[he,we]=s.useState(null),He=s.useRef(!1),Ye=s.useRef(!1),wt=s.useRef(!1);s.useEffect(()=>{if(u||E.length===0||wt.current||He.current)return;if(Ye.current)return void requestAnimationFrame(()=>{W.current&&L.current&&W.current.refTargets.length>0&&(wt.current=!0,H.current?.(!0)),R([...E])});He.current=!0;const Ee=s.lazy(async()=>{try{const Ie=await Promise.resolve().then(()=>require("./s_IQJahtZWmMiA6H.cjs"));return He.current=!1,Ye.current=!0,R([...E]),Ie}catch(Ie){return console.warn(Ie),H.current?.(!1),null}});we(Ee)},[E,u,p,f]);const Ct=s.useMemo(()=>!he||u?null:a.jsx(s.Suspense,{children:a.jsx(he,{className:cr({dragging:j||T,resizing:j,moving:T}),container:null,ref:W,target:W.current?E:[],draggable:!u&&!p,resizable:!u&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:g,onResizeStart:Ee=>{ee(Ee.target,"Resize")},onResize:Ee=>{if(!N.current)return Ee.stopDrag(),void U();B(!0);const Ie=Ee.direction[0]!==0&&Ee.direction[1]!==0;let ft=0,$e=0;for(let yt=0;yt<E.length;yt++){const tt=E[yt],oe=M.current.get(tt),Ve=O.current.get(tt);if(!oe||!Ve){console.warn("invalid element");continue}let xe=Ee.dist[0],be=Ee.dist[1],te=Ee.drag.dist[0],Me=Ee.drag.dist[1],_e=oe.startBounds.width,ve=oe.startBounds.height;yt===0?(ft=_e,$e=ve):(xe*=_e/ft,te*=_e/ft,be*=ve/$e,Me*=ve/$e);const Oe={...oe.startBounds};if(Oe.width=Math.max(0,_e+xe),Oe.height=Math.max(0,ve+be),Ee.direction[0]===-1&&(Oe.width=Math.max(0,Math.min(oe.startBounds.x+_e,_e-te))),Ee.direction[1]===-1&&(Oe.height=Math.max(0,Math.min(oe.startBounds.y+ve,ve-Me))),Ie&&(Ve.isLockAspectRatio()||Ee.inputEvent?.shiftKey)){const Y=_e/ve,se=Oe.width/Oe.height;se>Y?Oe.height=Oe.width/Y:se<Y&&(Oe.width=Oe.height*Y)}Ee.direction[0]===-1&&(Oe.x=Math.max(0,Math.min(oe.startBounds.x+_e,oe.startBounds.x+_e-Oe.width))),Ee.direction[1]===-1&&(Oe.y=Math.min(oe.startBounds.y+ve,oe.startBounds.y+ve-Oe.height)),oe.movable.setBounds(n.toAbsoluteBounds(Oe))}},onResizeEnd:Ee=>{B(!1),pe()},onDragStart:Ee=>{ee(Ee.target,"Move")},onDrag:Ee=>{if(!N.current)return Ee.stopDrag(),void U();_(!0);for(let Ie=0;Ie<E.length;Ie++){const ft=E[Ie],$e=M.current.get(ft);$e?$e.movable.setBounds(n.toAbsoluteBounds({...$e.startBounds,x:$e.startBounds.x+Ee.translate[0],y:$e.startBounds.y+Ee.translate[1]})):console.warn("invalid element")}},onDragEnd:Ee=>{},onMouseUp:Ee=>{}})}),[I,he,E,n,u,p,f,j,T]);return a.jsx("div",{className:cr(h,"movable-area","_movable-area_314c6_5"),style:{width:v.width,height:v.height,...m,position:"absolute",overflow:"hidden",willChange:"transform"},ref:sl([ae,Ae]),...y,children:a.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:v.width,height:v.height},...y,children:a.jsxs("div",{ref:L,style:{position:"absolute",pointerEvents:"auto"},onFocus:Ee=>{k?.(),ne(!0)},onBlur:Ee=>{ne(!1)},onKeyDownCapture:Ee=>{if(Ee.isDefaultPrevented())return;const Ie=Ee.nativeEvent.ctrlKey,ft=Ee.nativeEvent.altKey,$e=Ee.nativeEvent.shiftKey;if(Ee.which===Zt.Escape){const xe=r.getMovableSelection();let be=[...xe];return E.forEach(te=>{if(be.length===0)return;const Me=O.current.get(te);let _e=be.indexOf(Me);be.splice(_e,1)}),be.length!==xe.length&&r.selectMovables(be),be.length===0&&C?.(),void Ee.preventDefault()}const yt=.1,tt=xe=>{o.updateSelected(be=>{be.setRotation(be.getRotation()+xe)},"Rotate")},oe=(xe,be=!0)=>{o.updateSelected(te=>{const Me=te.getBounds();let _e=1+xe;be||(_e=1/_e);const ve=Math.sqrt(Math.pow(Me.width,2)+Math.pow(Me.height,2)),Oe=Math.atan2(Me.height,Me.width),Y=_e*ve;if(Y<10)return;const se=Y*Math.cos(Oe),Ce=Y*Math.sin(Oe),Pe={x:Me.x+(Me.width-se)/2,y:Me.y+(Me.height-Ce)/2,width:se,height:Ce};te.setBounds(Pe)},"Resize")},Ve=xe=>{o.updateSelected(be=>{const te=be.getBounds(),Me={x:te.x+(xe.x??0),y:te.y+(xe.y??0),width:te.width+(xe.width??0),height:te.height+(xe.height??0)};be.setBounds(Me)},"Nudge")};if(Ee.which===Zt.Delete)o.updateSelected(xe=>{xe.delete()},"Delete"),Ee.preventDefault();else if(Ee.key==="a"&&Ie){const xe=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(xe,!0),Ee.preventDefault()}else Ee.key==="ArrowLeft"?($e?oe(yt,!1):ft?tt(-10):Ve({x:Ie?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowRight"?($e?oe(yt,!0):ft?tt(10):Ve({x:Ie?10:1}),Ee.preventDefault()):Ee.key==="ArrowUp"?($e?oe(yt,!0):Ve({y:Ie?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowDown"&&($e?oe(yt,!1):Ve({y:Ie?10:1}),Ee.preventDefault())},children:[ie,Ct]})})})})),ki=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const l=e[i].getBounds();t=Math.min(l.x,t),n=Math.min(l.y,n),o=Math.max(l.x+l.width,o),r=Math.max(l.y+l.height,r)}return{x:t,y:n,width:o-t,height:r-n}},v7=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let l=0,d=Number.MAX_SAFE_INTEGER,c=0;for(let f=0;f<e.length;f++){const h=e[f],m=h.getBounds();l+=m[i],d=Math.min(m[o],d),c=Math.max(m[o]+m[i],c),n.push({bounds:m,movable:h})}const u=(c-d-l)/(e.length-1);n.sort((f,h)=>{const m=f.bounds[o],g=h.bounds[o];return m!==g?m-g:f.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let f=1;f<n.length-1;f++){const h=n[f-1].bounds,m={...n[f].bounds};m[o]=h[o]+h[i]+u,n[f].bounds=m,p.set(n[f].movable,m)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},Bk=s.memo(s.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:l,onHide:d,onShow:c,...u}=e;s.useEffect(()=>{},[r]);const p=Ro(t,()=>({isEmptyFrame:()=>!0}),[]),[f,{height:h,width:m}]=pi();return a.jsx("div",{...u,ref:sl([p,f]),children:a.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:l?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:a.jsx("div",{style:{textAlign:"center"},children:r})})})})),Nk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:l,target:d,notifier:c,onRepeatCommandChange:u}=e,p=function(h){const{movables:m,movablesView:g,transactional:x,commands:y,target:v,onRepeatCommandChange:b,notifier:C}=h,k=$r();s.useRef(k.getMode()).current=k.getMode();const E=ue(async(M,A,D=null,L=!0)=>{const N=async()=>{const W=await Promise.resolve(C?.showBusy?.(M.label()));try{await A();const I=D??M?.label?.();if(b){let U=null;M&&I!==!1&&(U=new vt(M.key(),v,{label:I,description:I},N)),b(U)}W?.(),L&&k.setMode(null)}catch(I){W?.(),C?.showError?.(I)}};await N()},[b,C]),[R,j]=s.useReducer(M=>M+1,0),B=ue((M,A,D)=>{if(!g)return;const L=g.getMovableSelection();if(L.length===0)return;let N="Drawings";if(L.length===1){const I=L[0];N=z.TextUtils.capitalize(I.getContent().getType())??"Drawing"}const W=`${M.label()} ${N}`;E(M,()=>{let I=null;x&&(I=x.beginCommit(W));const U=g.getMovableSelection();if(U.length===0)return;const G=D?.(U);for(let Q=0;Q<U.length;Q++){const H=U[Q];A(H,G)}I?.commit()})},[g,x]),[T,_]=s.useState(g.getMovableSelection()[0]??null),[w,S]=s.useState(!T||T?.isProtected()),O=s.useMemo(()=>[new je("moveToFront",v,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[ke.Ctrl,ke.Shift]}},function(){B(this,M=>{M.moveToFront()})}),new je("moveForward",v,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[ke.Ctrl]}},function(){B(this,M=>{M.moveForward()})}),new je("moveToBack",v,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[ke.Ctrl,ke.Shift]}},function(){B(this,M=>{M.moveToBack()})}),new je("moveBackward",v,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[ke.Ctrl]}},function(){B(this,M=>{M.moveBackward()})}),new je("toggleLockAspectRatio",v,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){B(this,M=>{M.setLockAspectRatio(!M.isLockAspectRatio())})}),new je("formatAnchorTypeTwoCell",v,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.TwoCell)})}),new je("formatAnchorTypeOneCell",v,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.OneCell)})}),new je("formatAnchorTypeAbsolute",v,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){B(this,M=>{M.setAnchorType(z.IAnchored.Type.Absolute)})}),new je("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){B(this,(M,A)=>{M.setBounds({x:A.x})},ki)}),new je("formatDrawAlignCenter",v,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){B(this,(M,A)=>{M.setBounds({x:(A.width-M.getBounds().width)/2+A.x})},ki)}),new je("formatDrawAlignRight",v,{label:"Align Right",description:"Align the selected drawings to the right."},function(){B(this,(M,A)=>{M.setBounds({x:A.width-M.getBounds().width+A.x})},ki)}),new je("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){B(this,(M,A)=>{M.setBounds({y:A.y})},ki)}),new je("formatDrawAlignMiddle",v,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){B(this,(M,A)=>{M.setBounds({y:(A.height-M.getBounds().height)/2+A.y})},ki)}),new je("formatDrawAlignBottom",v,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){B(this,(M,A)=>{M.setBounds({y:A.height-M.getBounds().height+A.y})},ki)}),new je("formatDrawDistributeHorz",v,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){B(this,(M,A)=>{M.setBounds(A.get(M))},M=>v7(M))}),new je("formatDrawDistributeVert",v,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){B(this,(M,A)=>{M.setBounds(A.get(M))},M=>v7(M,!1))}),new je("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new je("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new je("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new je("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new je("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new je("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new je("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[g,T]);s.useEffect(()=>{},[k]);const P=s.useMemo(()=>{let M=null;return M=y?y.createChildGroup(v,"movable",!1):new rl(v,"movable"),M.addCommands(O,!0),M},[y,O]);return Xt(T,{onAnyChange:()=>{P.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===z.IAnchored.Type.TwoCell}),P.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===z.IAnchored.Type.OneCell}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===z.IAnchored.Type.Absolute}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===z.IAnchored.Type.Absolute}),P.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:M=>{S(M.isProtected())},onDelete:()=>{}}),Xt(g,{onMovableSelectionChange:()=>{const M=g.getMovableSelection()[0]??null;_(M),S(!M||M.isProtected()),j()}}),Xt(m,{onCollectionChange:()=>{j()}}),s.useEffect(()=>{const M={disabled:w};P.getCommand("formatAnchorTypeTwoCell").update(M),P.getCommand("formatAnchorTypeOneCell").update(M),P.getCommand("formatAnchorTypeAbsolute").update(M),P.getCommand("toggleLockAspectRatio").update(M);const A=m.getCount(),D=g.getMovableSelection(),L=w||A<=1||D.length===0;let N={disabled:L},W=N;if(!L&&D.length===1){const G=D[0];G.getZIndex()===0&&(N={disabled:!0}),G.getZIndex()===A-1&&(W={disabled:!0})}P.getCommand("moveToFront").update(W),P.getCommand("moveForward").update(W),P.getCommand("moveToBack").update(N),P.getCommand("moveBackward").update(N);const I={disabled:w||D.length<=1};P.getCommand("formatDrawAlignLeft").update(I),P.getCommand("formatDrawAlignCenter").update(I),P.getCommand("formatDrawAlignRight").update(I),P.getCommand("formatDrawAlignTop").update(I),P.getCommand("formatDrawAlignMiddle").update(I),P.getCommand("formatDrawAlignBottom").update(I),P.getCommand("formatDrawFlipHorz").update(I),P.getCommand("formatDrawFlipVert").update(I),P.getCommand("formatDrawGroup").update(I),P.getCommand("formatDrawUngroup").update(I),P.getCommand("formatDrawSwapShapes").update(I),P.getCommand("formatDrawSwapShapesHorz").update(I),P.getCommand("formatDrawSwapShapesVert").update(I);const U={disabled:w||D.length<=2};P.getCommand("formatDrawDistributeHorz").update(U),P.getCommand("formatDrawDistributeVert").update(U)},[R,w,R]),P}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:u,commands:l,target:d,notifier:c});s.useEffect(()=>{n?.getStage()},[n?.getStage()]);const f=s.useMemo(()=>a.jsx(zk,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,l,p]);return f&&n?f:null})),Vk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:l,setEditingCoords:d,commands:c,notifier:u=Ys}=e,p=$r(),[f,h]=s.useState(null),[m,g]=s.useState(null),[x,y]=s.useState(null),[v,b]=s.useState(null),[C,k]=s.useState(null);s.useLayoutEffect(()=>{if(x===null)return b(null),void k(null);const D=()=>{const L=o.getRange(x).getCell(),N=L.getStyle();let W,I=N.getFill()?.toCSS(r.body.darkMode);I.background!=="none"&&I.background!=="transparent"||(I=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),I.background!=="none"&&I.background!=="transparent"||(I={background:r.body.fill}),b({style:I}),L&&!L.getFormula()&&(W=L?.getRenderHorizontalAlignment()),k(W??lg)};return D(),o.getRange(x).addListener(()=>{D()})},[o,x,r?.body]);const E=ue(()=>{let D=m.editState.dirty??"";if(m.editState.dirty!==void 0){const L=z.TextUtils.clampString(D);try{const N=m.sheet.getRange(m.coords),W=`Typing '${L}' into ${N.toString()}`;return N.setValue(D,{description:W,autoFit:!0}),y(null),g(null),p.setMode(null),d(null),!0}catch(N){throw u.showError(new Error(`Unable to enter '${L}'.`,{cause:N})),N}}},[o,m,u]),R=ue(D=>o.getRange(D).getCell().getExtrusions()??vo.cellToRange(D),[o]);ue(D=>{let L=z.IRange.Orientation.Row,N=!1;D!==z.IRange.Direction.Up&&D!==z.IRange.Direction.Down||(L=z.IRange.Orientation.Column),D!==z.IRange.Direction.Left&&D!==z.IRange.Direction.Up||(N=!0),o.getSelection().traverse(L,N)},[o]);const j=s.useCallback((D,L)=>{if(i)return i(D,L);if(!o)return null;const{ref:N,...W}=D;return a.jsx(B9,{ref:N,...W,sheet:o,bodyStyle:r?.body,activeCoords:L,commands:c,onChangeEdit:I=>{const U={sheet:o,coords:L,editState:I};p.setMode(G=>({...G,description:U.editState.editMode?"Edit":"Enter",args:{...G?.args,stateAndCoords:U}}))},editState:m.editState})},[o,v,i,m,x]),{overlay:B,startEdit:T,submitEdit:_,cancelEdit:w,onKeyboardEventNative:S,onPointerEventNative:O}=(D=>{const{view:L,canEdit:N=FC,getCellEditor:W,onBeforeStartEdit:I,onStartEdit:U,onSubmitEdit:G,onCancelEdit:Q,onDoneEdit:H,isEditorStartKeyEvent:$=zC,isEditorStartPointerEvent:F=BC,containerProps:X,borderStrokeFill:K,borderStrokeWidth:ne=2,getRangeCoords:J=null,activeCoords:re,alignment:fe=Kl.Left}=D,[ie,ee]=s.useState(!1),[pe,Te]=s.useState(void 0),Ae=ct((Y,se,Ce,Pe,Qe,Ge)=>{if(!se)return null;const Be=Qe?.(se,Y),ot=Y.getRangeCoordsBounds(Be),Ze=Y.toClipBounds(ot),et=ot,mt=Y.getZoom();if(!Ze)return null;Ce&&(Ce*=mt),Pe&&(Pe*=mt);let pt=et,it=!1;if(Ce!==void 0){let Vt={...Be},nn=0;for(;!it&&pt.width<=Ce&&nn<20;){nn++,nn>19&&console.warn("max width reached");const bn=Y.getTotalRangeCoords(),kn=Y.getLayout();Ge===Kl.Left?Vt.colEnd+1<bn.colEnd?Vt.colEnd=kn.getColIndex(pt.x+Ce):it=!0:Ge===Kl.Right?Vt.colStart-1>=0?Vt.colStart=kn.getColIndex(pt.x-(Ce-pt.width)):it=!0:Ge===Kl.Center&&Vt.colEnd+1<bn.colEnd&&Vt.colStart-1>=0?(Vt.colStart=kn.getColIndex(pt.x-(Ce-pt.width)/2),Vt.colEnd=kn.getColIndex(pt.x+pt.width+(Ce-pt.width)/2)):it=!0,it||(pt=Y.getRangeCoordsBounds(Vt))}}pt.height=et.height,Pe!==void 0&&(pt.height=Math.max(Pe+1,et.height));const{width:Wt,height:qt}=Y.getViewportSize();return{x:pt.x??0,y:pt.y??0,height:Math.min(qt-pt.y,pt.height)+1,width:Math.min(Wt-pt.x,pt.width)+1}},[fe]),ae=ct(N,[N]),he=s.useCallback(()=>{L?.getStage()?.focus()},[L]),we=s.useRef(null),He=ct(Y=>{I?.(Y),Ve(),ee(!0),we.current=null},[I]),Ye=ct(Y=>{U?.(Y.coords)},[U]),wt=ct(Y=>{Y.isSubmitted||Y.isCancelled||(Ie.current.isEditorClosed=!0,he(),Y.isCancelled=!0,Q?.(Y.coords),Ve())},[Q]),Ct=ct(Y=>{if(Y.isSubmitted||Y.isCancelled)return!1;try{return we.current=Y.coords,Y.isEditorClosing=!0,Y.isSubmitted=!0,Y.isEditorSubmitted||(Y.isEditorSubmitted=!0,Y.editorRefs[0]?.submitEdit?.()),Y.coords,G?.(Y.coords),Y.isEditorClosed=!0,he(),Ve(),!0}catch(se){throw Y.isEditorClosing=!1,Y.isSubmitted=!1,se}},[G]),Ee=ct(Y=>{ee(!1),H?.(Y.coords),Ve()},[H]),Ie=s.useRef(null),ft=s.useRef(null),$e=s.useRef(null),yt=s.useRef([]),[tt,oe]=s.useReducer(Y=>Y+1,0),Ve=s.useCallback(Y=>{Y&&yt.current.push(Y),oe()},[]),xe=ct(Y=>{if(Y.defaultPrevented||Y.isSynthetic||!L)return;const se=L?.getCellCoordsFromClient(Y.clientX,Y.clientY);se&&Ve({eventType:"pointer",event:Y,coords:se})},[L]),be=ct(Y=>{const se=Y.nativeEvent;xe(se)},[L]),te=ct(Y=>{if(Y.defaultPrevented||Y.isSynthetic||!L?.getStage())return;const se=ft.current;$(Y,se)&&(Y.stopPropagation(),Y.preventDefault()),Y.key,Ve({eventType:"keyboard",event:Y,coords:se})},[L]);s.useLayoutEffect(()=>{const Y=(Pe,Qe)=>{const Ge=Qe?.cell??Pe;if(!Ge)return null;const Be=Ge;if(!ae(Ge))return null;He?.(Ge);const ot=Eo.uuidV4();Qe=Object.freeze({autoFocus:!0,...Qe}),$e.current=Ge;const Ze={coords:Be,startEvent:Qe,uuid:ot,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:et=>{Ze.isMounted||(Ze.isMounted=!0,Ve())},onUnmount:et=>{if(Ze.editorRefs.length===0){const mt=()=>{Ze.isMounted=!1,Ve()};if(document.activeElement!==document.body)mt();else{const pt=it=>{it.defaultPrevented||it.target!==document.body||te(it)};window.addEventListener("keydown",pt,!0),L.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",pt),mt()},{once:!0}),he()}}}};return Ze};if(yt.current.length<=0&&!Ie.current)return;const se=yt.current[0];q4(se),(Pe=>{const Qe=[],Ge=Pe?.length??0;for(let Be=0;Be<Ge;Be++){const ot=Pe[Be];Qe.push(q4(ot))}})(yt.current),Ie.current,Ie.current;let Ce=Ie.current;if(Ie.current){if(Ie.current.isDone)Ie.current=null;else if(Ie.current.isSubmitted||Ie.current.isCancelled){if(Ie.current.isMounted)return;Ie.current.isDone||(Ee(Ie.current),Ie.current.isDone=!0)}}if(se){if(se.eventType==="start"){const Pe=se,Qe=Pe.startEvent?.cell??ft.current;Ie.current&&Pt.isEqualCells(Ie.current.coords,Qe)||(Ie.current=Y(Qe,Pe.startEvent))}else if(se.eventType==="keyboard"){const Pe=se.event;if(Ie.current){let Qe=!1;switch(Pe.which){case 37:case 39:case 38:case 40:case 13:case 9:Qe=!0}if(!Qe){Ie.current.events.push(se);for(let Ge=0;Ge<Ie.current.editorRefsDispatchEditorEvent.length;Ge++)Ie.current.editorRefsDispatchEditorEvent[Ge](se)}}else if($(Pe,se.coords)){const Ge=Y(ft.current,void 0);Ge&&Ge.events.push(se),Ie.current=Ge}}else if(se.eventType==="pointer"){const Pe=se.event;if(Ie.current){Ie.current.events.push(se);for(let Qe=0;Qe<Ie.current.editorRefsDispatchEditorEvent.length;Qe++)Ie.current.editorRefsDispatchEditorEvent[Qe](se)}else{const Qe=se?.coords??ft.current,Ge=F(Pe,Qe);if(Ge){let Be;typeof Be!="boolean"&&(Be=Ge);const ot=Y(Qe,Be);ot&&ot.events.push(se),Ie.current=ot}}}else if(se.eventType==="submit"){if(Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;Ct(Ie.current)}}else if(se.eventType==="cancel"){if(Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;wt(Ie.current)}}else if(se.eventType==="coordsChange"){const Pe=se;if(ft.current=Pe.activeCoords,Ie.current,Ie.current&&!Ie.current.isSubmitted&&!Ie.current.isCancelled){if(!Ie.current.isMounted)return;try{Ct(Ie.current)}catch{}}}}yt.current.length>0&&(yt.current.shift(),Ve()),yt.current.length===0&&(!Ie.current||Ie.current.isEditorClosing||Ie.current.isEditorClosed?!Ie.current&&Ce&&he():Ie.current.isMounted&&!Ie.current.isStarted&&(Ie.current.isStarted=!0,Ie.current.startEvent.autoFocus&&(typeof Ie.current.startEvent.autoFocus=="string"?Ie.current.editorRefs[0]?.autoFocus(Ie.current.startEvent.autoFocus):Ie.current.editorRefs[0]?.autoFocus()),Ye?.(Ie.current),requestAnimationFrame(()=>{L&&Ie.current?.coords&&L.scrollCellCoordsIntoView(Ie.current.coords)})))},[tt]),s.useEffect(()=>{$e.current=re;const Y=Ie.current?.coords;Pt.isEqualCells(Y,re)||(Ie.current&&(Ie.current.isEditorClosing=!0),Ve({eventType:"coordsChange",activeCoords:re}))},[re]);const Me=s.useCallback(Y=>{te(Y.nativeEvent)},[]),{width:_e=0,height:ve=0}=pe??{width:0,height:0},Oe=ct(W,[W]);return{overlay:ct(Y=>{if(!Ie.current||Ie.current.isEditorClosed)return Ie.current,null;Ie.current.coords;let se=Ae(Y,Ie.current.coords,_e,ve,J,fe),Ce=!0;se&&se.width!==0&&se.height!==0||(se={x:0,y:0,width:_e,height:_e},Ce=!1);const Pe=Y.getZoom(),Qe={containerBounds:{x:0,y:0,width:se.width/Pe,height:se.height/Pe},setNaturalDimensions:Te,zoom:Pe};return a.jsx(NC,{session:Ie.current,refLatestCoords:$e,handleSubmitEdit:Ct,handleCancelEdit:wt,cellBounds:se,borderStrokeWidth:ne,borderStrokeFill:K,isInBounds:Ce,getCellEditor:Oe,propsEditor:Qe,alignment:fe,...X},"editor:"+Ie.current.uuid)},[W,J,tt,_e,ve,fe,ne,K]),startEdit:s.useCallback(Y=>{Ve({eventType:"start",startEvent:Y})},[]),submitEdit:s.useCallback(()=>{Ve({eventType:"submit"})},[]),cancelEdit:s.useCallback(()=>{Ve({eventType:"cancel"})},[]),onKeyboardEvent:Me,onPointerEvent:be,onKeyboardEventNative:te,onPointerEventNative:xe,isEditing:ie}})({view:n,activeCoords:f,getCellEditor:j,canEdit:()=>{const D=!o.getProtection().isLocked();return D||l(),D},onBeforeStartEdit:D=>{const L=N9(()=>o.getRange(D).getCell()),N={sheet:o,coords:D,editState:Object.freeze(L)};p.setMode({key:"edit",args:{stateAndCoords:N}}),g(N)},onStartEdit:D=>{y(D),d(D)},onSubmitEdit:E,onCancelEdit:D=>{y(null),g(null),p.setMode(null),d(null)},onDoneEdit:D=>{p.setMode(null)},containerProps:v,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:C,getRangeCoords:R});Xt(o.getSelection(),{onChange(D){h(o.getSelection().getCoords().cell)}});const P=ue(D=>{O(D),x&&_()},[O,w,x]),M=s.useCallback(D=>{O(D)},[O]),A=s.useCallback(D=>{S(D)},[S]);return s.useEffect(()=>{const D=n?.getStage();if(D)return D.addEventListener("pointerdown",P),D.addEventListener("dblclick",M),D.addEventListener("keydown",A),()=>{D.removeEventListener("pointerdown",P),D.removeEventListener("dblclick",M),D.removeEventListener("keydown",A)}},[n?.getStage()]),s.useEffect(()=>{const D=p.getMode(),L=D?.key;L==="edit"||L==="enter"?m?D.args?.cancel?w():D.args?.submit?_():g(D.args?.stateAndCoords):T(D.args?.start):x&&w()},[p]),B(n,t)})),U9="white",q9="black",Hk=`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='${q9}' fill='${U9}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,$k=`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='${q9}' fill='${U9}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Wk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=s.useState(o.getTables().getCount()>0),[l,d]=s.useState(null),[c,u]=s.useState(null),[p,f]=s.useState(null),[h,m]=s.useState(null),g=ue(()=>{if(o.getTables().getCount()>0){i(!0);const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)}else i(!1),d(null)},[o,n]),x=ue(E=>{E.preventDefault(),E.stopPropagation();const R=n.getCellCoordsFromClient(E.clientX,E.clientY),j=o.getTables().search({address:R});j.length===1&&j[0].select()},[n,o]),y=ue(E=>{E.preventDefault(),E.stopPropagation();const R=n.getCellCoordsFromClient(E.clientX,E.clientY),j=o.getTables().search({address:R});if(j.length===1){const B=j[0].getRange().getCoords(),T={colStart:B.colStart,rowStart:R.rowIndex,colEnd:B.colEnd,rowEnd:R.rowIndex};o.getRange(T).select()}},[n,o]),v=ue(()=>{if(!r)return;const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)},[o,r,n]);Xt(o?.getSelection(),{onChange(E){u(o.getSelection().getCoords().cell)}}),Xt(p,{onAnyChange(E){g(),v()}}),Xt(h,{onAnyChange(E){v()}}),Xt(o,{onTablesChange(E){g(),v()},onInvalidated(E){g(),v()}});const b=s.useMemo(()=>Ht.debounce(Ht.throttle(v,300),300),[]);s.useEffect(()=>{b()},[n]),s.useEffect(()=>{let E=null;if(l)for(let R=0;R<l.length&&!E;R++){const j=l[R],B=j.getRange().getCoords();z.CoordUtils.isCellWithinRange(c,B)&&(E=j)}f(E)},[c,l]);const C=ue(E=>{let R=null;if(l)for(let j=0;j<l.length;j++){const B=l[j],T=B.getRange().getCoords();let _=n.getRangeCoordsBounds(T);const w=n.getRelativePointFromClient(E.clientX,E.clientY),S=w.x,O=w.y;if(S>=_.x&&S<=_.x+_.width&&O>=_.y&&O<=_.y+_.height){const P=n.getViewportSize();S<=0||O<=0||S>=P.width||O>=P.height||(R=B)}}m(R)},[n,l]);if(s.useEffect(()=>{const E=n?.getStage();if(E&&l)return E.addEventListener("mousemove",C),E.addEventListener("mouseleave",C),()=>{E.removeEventListener("mousemove",C),E.removeEventListener("mouseleave",C)}},[l,n?.getStage()]),!n||!l||l.length===0)return null;const k=[];for(let E=0;E<l.length;E++){const R=l[E];if(R.isClosed())continue;const j=R===h,B=R===p,T=R.getRange().getCoords(),_=n.getRangeCoordsBounds(T);let w;if(j||B){const S=R.getStyle().getProperties(),O=S.headerRow?.fill?.background??S.wholeTable?.border?.top?.color?.toString();if(O&&o){const P=o.getStyles().parseColor(O);P&&(w=P.toCSS())}w||(w="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(a.jsx("div",{style:{position:"absolute",left:_.x,top:_.y,width:Math.min(16,_.width),height:_.height,pointerEvents:"all",cursor:Hk},onMouseDown:y},`table-select-row-${R.getName()}`)),k.push(a.jsx("div",{style:{position:"absolute",left:_.x,top:_.y,width:Math.min(16,_.width),height:Math.min(16,_.height),pointerEvents:"all",cursor:$k},onMouseDown:x},`table-select-${R.getName()}`)),k.push(a.jsx(q1,{x:_.x,y:_.y,width:_.width,height:_.height,range:T,strokeWidth:B?.5:0,stroke:w??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:j?`${w} 0px 0px 1px 1px`:void 0}},`table-outline-${R.getName()}`))}return k})),Uk=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,l]=s.useState(null),[d,c]=s.useState(null),u=s.useRef(null),p=ue(()=>{const y=o.getSelectedCell(),v=y.getSpill()?.getCoords()??null;vo.isEqualRanges(v,i)||(c(v?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(v),coords:v}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),l(v))},[o,n,i]);s.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),d&&(u.current=setTimeout(()=>{c(null),u.current=null},r)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[d,r]);const f=s.useMemo(()=>Ht.debounce(Ht.throttle(p,80),80),[]);if(Xt(o?.getSelection(),{onChange(y){f()}}),Xt(o,{onSpillsChange(y){p()},onInvalidated(y){p()}}),!n||!i&&!d)return null;const h=o.getRange(i).getValue()instanceof z.FormulaError.Spill,m=[];let g=d?.bounds??n.getRangeCoordsBounds(i);if(d&&!Ht.isEqualBounds(d.bounds,n.getRangeCoordsBounds(d.coords))&&c(null),g=n.toClipBounds(g,-10),!g)return;const x="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return m.push(a.jsx(q1,{x:g.x,y:g.y,width:g.width,height:g.height,range:i,strokeWidth:1,stroke:x,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:d?.transition==="out"?0:1,transition:d?.transition?d.transition==="in"||d.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${x} 0px 0px 4px 0px`}},"spill-outline}")),m})),qk={position:"absolute",top:0,left:0,bottom:0,right:0},w7=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},l=n.body=Ht.mergeContentful(e.body,i);return n.body=Ht.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},l),n.buttonSurface=Ht.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=Ht.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Ht.mergeContentful(n.header,i),n.headerSelect=Ht.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Ht.mergeContentful(n.headerSelect,i),n.headerSelectAll=Ht.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Ht.mergeContentful(n.headerSelectAll,i),n},Zk={fireOnModelChange:!1},S7={},Z9=s.memo(s.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=S7,headersStyle:r=S7,onSheetContextMenu:i,showColumnHeaders:l,columnHeaderProps:d,showRowHeaders:c,rowHeaderProps:u,showScrollbars:p=!0,scrollPaneProps:f,onViewportChange:h,commands:m,onRepeatCommandChange:g,onMoveCell:x,overlays:y,renderMovable:v,viewportComponent:b,onElementLoad:C,getCellEditor:k,onFocus:E,onBlur:R,style:j=gn.EmptyCssProperties,notifier:B,onShowTooltip:T,onShowColumnTooltip:_,onShowRowTooltip:w,onCloseTooltip:S,gridProps:O,cellRenderProps:P,...M}=e;if(s.useEffect(()=>{z.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[A,D]=s.useReducer(Le=>Le+1,0),[L,{width:N,height:W}]=pi(),I=ue(T,[T]),U=ue(_,[_]),G=ue(w,[w]),Q=ue(S,[S]),H=s.useRef(!1);s.useLayoutEffect(()=>{H.current=!0},[n]);const $=n?.getStyles(),F=s.useMemo(()=>w7(o,$),[o,$]),X=s.useMemo(()=>w7(r,$),[r,$]),{body:K={},buttonSurface:ne={}}=F,{header:J={},headerSelect:re={},headerSelectAll:fe={}}=X,ie=s.useRef(null),[ee,pe]=s.useState(()=>n?.getView()),Te=(ee?.getZoomScale()??100)/100,Ae=s.useMemo(()=>({vertical:ee.isShowColumnGridlines()&&Te>=.4,horizontal:ee.isShowRowGridlines()&&Te>=.4}),[ee?.isShowColumnGridlines(),ee?.isShowRowGridlines(),Te]),ae=s.useMemo(()=>{if(ee?.getGridLineColor())return{strokeDasharray:"1,1"}},[ee?.getGridLineColor(),F]),he=l??ee?.isShowColumnHeaders(),we=c??ee?.isShowRowHeaders(),[He,Ye]=s.useState({width:0,height:0}),wt=s.useMemo(()=>{let Le=40,le=20;const ut=n?.getStyles().getNormal().getFont();if(He.width>0&&He.height>0){const bt=ut?.toCSS()?.fontFamily??F.header.text.fontFamily,q=ut?.getSize()??F.header.text.fontSize,Z=z.IFont.getSharedMeasurer()(""+He.height,Math.ceil(q*z.IFont.getDeviceScale()),bt);Le=Z.width,le=Z.lineHeight}return{width:Math.round(Le+5),height:Math.round(le+3)}},[He,F?.header.text,n]),Ct=we?Te*wt.width:J.edgeStrokeWidth,Ee=he?Te*wt.height:J.edgeStrokeWidth,Ie=Math.max(N,(n?.getColumnHeaders().getDefaultSize()??wt.width)+Ct+1),ft=Math.max(W,(n?.getRowHeaders().getDefaultSize()??wt.height)+Ee+1),$e=s.useRef(new Map),yt=s.useRef(null),tt=()=>({getColOffset:Le=>n.getColumnHeaders().findOffset(Le),getColIndex:Le=>n.getColumnHeaders().findIndex(Le),getRowOffset:Le=>n.getRowHeaders().findOffset(Le),getRowIndex:Le=>n.getRowHeaders().findIndex(Le)}),[oe,Ve]=s.useState(()=>tt()),[xe,be]=s.useState(!1),[te,Me]=s.useState(null),_e=!0,ve=F.selection?.strokeFill,Oe=s.useCallback(()=>Oo.current,[]),[Y,se]=s.useState(),Ce=ue(Le=>{se(Le),n&&n.getView()&&n.getView().setTopLeft(Le?{left:Le.left,top:Le.top}:null),h?.(Le)},[n,h]),Pe=s.useRef(null);s.useEffect(()=>{if(!Y||!n)return;const Le=n.getRangeAtBounds({x:Y.left,y:Y.top,width:Y.width,height:Y.height});Pe.current?.(),Pe.current=Le.addListener(()=>{const le=Le.getCoords();ie?.current?.invalidate(le)})},[Y,n]);const[Qe,Ge]=s.useState(()=>n?.getView().getTopLeft()),Be=ue(Le=>{const le=vo.cellToRange(Le);if(n.isClosed())return le;const ut=n.getRange(le,{excludeHidden:!0}).getMerges();return ut.length===0?le:ut[0]},[n]),ot=Le=>{if(!Le||Le.coords.colIndex===0&&Le.coords.rowIndex===0)return null;const le={};return Le.coords.colIndex>0&&(le[uo.Left]={index:Le.coords.colIndex,scrollOffset:Le.topLeft.left}),Le.coords.rowIndex>0&&(le[uo.Top]={index:Le.coords.rowIndex,scrollOffset:Le.topLeft.top}),le},[Ze,et]=s.useState(()=>ot(n.getView().getFreezePanes())),mt=$r(),pt=s.useCallback(()=>ie.current,[]),it=ue(Le=>{mt.setMode(le=>le?.key==="edit"?{...le,args:{...le.args}}:{key:"edit",args:{stateAndCoords:null,start:Le}})},[]),Wt=ue(()=>Y,[Y]),qt=function(Le){const{sheet:le,onRepeatCommandChange:ut,bodyStyle:bt,commands:q,target:Z,notifier:ce,onStartEdit:me,getViewport:Fe}=Le,[Je,We]=s.useState(null),[_t,Dt]=s.useState(null),Rt=s.useRef(null),Ft=ue(me,[me]),hn=ue(Fe,[Fe]),[Ot,At]=s.useState(),[An,ht]=s.useState(()=>le?.getStyles().parseColor(z.IColor.Scheme.Bg2)),[Yt,Xn]=s.useState(()=>le?.getStyles().getNormal().getFont().getFill()),Nt=$r();s.useRef(Nt.getMode()).current=Nt.getMode();const ln=eh(),[On,or]=s.useState(Ht.EmptyArray),y0=s.useCallback(()=>{if(Rt.current!==le)return;const de=le.getSelectedRanges();let Ne=null;On.length>0&&vo.isCellWithinRange(Je,On[0].getRange().getCoords())&&(Ne=On[0]);const Xe=le?.getSelectedCell(),De=Xe?.getCoords()??null;wo.unstable_batchedUpdates(()=>{oc(Ne),We(De),Dt(de)})},[le,On,_t,Je]),Ha=s.useCallback(Ht.debounce(y0,210),[y0]);s.useEffect(()=>{Rt.current=le,y0()},[le]);const Io=ue(()=>le.getRange(Je).getCell(),[le,Je]),ho=ue(async(de,Ne,Xe=null,De=!1,nt=!0)=>{const at=de?.label?.(),an=async()=>{const en=await Promise.resolve(nt&&ce?.showBusy?.(at??"Busy..."));try{await le.doBatch(async()=>Ne(le),at),De&&Nt.setMode(null),en&&en()}catch(Hn){if(en&&en(),!Hn)return;ce?.showError?.(Hn)}},sn=[];let Kt=!1;const pn=async()=>(sn.push(an),(async()=>{if(!Kt){for(Kt=!0;sn.length>0;){const en=sn.shift();en&&await en()}Kt=!1}})());if(ut){let en=null;if(Xe!==!1&&de){const Hn=Xe??at;en=new vt(de.key(),Z,{label:Hn,description:Hn},pn)}ut(en)}return pn()},[le,ut,ce]),zt=ue((de,Ne,Xe=!1,De)=>ho(de,nt=>{const at=nt.getSelectedRanges();Xe&&at.updateStyle(null,De),at.updateStyle(Ne,De),at.autoFit({expandOnly:z.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[le]),qu=ue((de,Ne,Xe)=>{ho(de,De=>{let nt=Ne;(Xe||Ne?.address)&&(nt=nt??{},!Xe&&Ne?.address?.startsWith("#")?Xe=Ne?.address.substring(1):Xe&&(nt.displayText=Xe)),De.getSelectedRange().setHyperlink(nt)})},[le]),Zu=ue((de,Ne)=>{ho(de,Xe=>{Xe.getSelectedRange().setComments(Ne)})},[le]),ul=ue((de,Ne)=>{ho(de,Xe=>{Xe.getSelectedRanges().clear(Ne)})},[le]),H0=ue(async(de,Ne,Xe=!1,De=!1)=>ho(de,async nt=>{let at=nt.getSelectedRanges();Xe&&(Ne===z.IRange.Orientation.Row?at=at.getEntireRows(De):Ne===z.IRange.Orientation.Column&&(at=at.getEntireColumns(De)));let an=null;const sn=Nt.getMode()?.key;if(sn==="copy"||sn==="cut"){const Kt=await ln.getClipboard().readReference();Kt&&Kt.getItemType()==="range"&&(an=Kt.getItem(),an.getCoords()||(an=null))}if(an){const Kt=await at.insertFrom(an,{...an.getMarkOptions(),orientation:Ne,autoSelect:!0});!Kt||Kt.isEntireRows()||Kt.isEntireColumns()||Kt.autoFit({orientations:z.IRange.Orientations.Row,minContent:!0}),Nt.setMode(null)}else at.insert(Ne,{autoSelect:!0})},"Insert Cells",!1),[Nt]),[l0,oc]=s.useState(null),Tm=ue(de=>le.getStyles().setDefaultTableStyle(de),[le]),jm=ue(de=>{le.getStyles().getTableStyle(de)?.delete()},[le]),hl=ue((de,Ne)=>{ho(de,async Xe=>{const De=Xe.getSelectedRange(),nt=Xe.getSelectedCell().getCoords();let at=null,an=0;const sn=nt.rowIndex>0?Xe.getRange({rowIndex:nt.rowIndex,colIndex:nt.colIndex}).getExtended(z.IRange.Direction.Up):null;sn&&Xe.getRange({colStart:nt.colIndex,rowStart:sn.getCoords().rowStart,colEnd:nt.colIndex,rowEnd:sn.getCoords().rowStart}).isContentful()&&(at=z.IRange.Direction.Up,an=nt.rowIndex-sn.getCoords().rowEnd);const Kt=nt.colIndex>0?Xe.getRange({rowIndex:nt.rowIndex,colIndex:nt.colIndex-1}).getExtended(z.IRange.Direction.Left):null;if(Kt&&Xe.getRange({colStart:Kt.getCoords().colStart,rowStart:nt.rowIndex,colEnd:Kt.getCoords().colStart,rowEnd:nt.rowIndex}).isContentful()){const en=nt.colIndex-Kt.getCoords().colEnd;(en<an||!at)&&(at=z.IRange.Direction.Left,an=en)}let pn=null;if(at===z.IRange.Direction.Up){if(pn={...sn.getCoords()},(pn.rowEnd===nt.rowIndex||!Xe.getRange({colIndex:nt.colIndex,rowIndex:nt.rowIndex-1}).isContentful())&&pn.rowStart>0&&Xe.getRange({colIndex:nt.colIndex,rowIndex:pn.rowStart-1}).isContentful()){const en=sn.getExtended(z.IRange.Direction.Up);pn={colStart:nt.colIndex,rowStart:en.getCoords().rowStart,colEnd:nt.colIndex,rowEnd:sn.getCoords().rowEnd}}pn.rowEnd=nt.rowIndex-1}else if(at===z.IRange.Direction.Left){if(pn={...Kt.getCoords()},(pn.colEnd===nt.colIndex||!Xe.getRange({colIndex:nt.colIndex-1,rowIndex:nt.rowIndex}).isContentful())&&pn.colStart>0&&Xe.getRange({colIndex:pn.colStart-1,rowIndex:nt.rowIndex}).isContentful()){const en=Kt.getExtended(z.IRange.Direction.Left);pn={colStart:en.getCoords().colStart,rowStart:nt.rowIndex,colEnd:en.getCoords().colEnd,rowEnd:nt.rowIndex}}pn.colEnd=nt.colIndex-1}if(De.size!==1&&at){const en=De.getCoords(),Hn=De.startIncrementalUpdates({orientation:z.IRange.Orientation.Column}),io={...pn},$o=en.rowStart,Ar=en.rowEnd,Fr=en.colStart,zr=en.colEnd,rr=at===z.IRange.Direction.Up;for(let Ao=Fr;Ao<=zr;Ao++){io.colStart=rr?Ao:pn.colStart+(Ao-Fr),io.colEnd=rr?Ao:pn.colEnd+(Ao-Fr);for(let po=$o;po<=Ar;po++){io.rowStart=rr?pn.rowStart+(po-$o):po,io.rowEnd=rr?pn.rowEnd+(po-$o):po;const yn=Xe.getRange(io).toString();Hn.pushAt(po,Ao,`=${Ne}(${yn})`)}}Hn.apply()}else{const en=pn?Xe.getRange(pn).toString():"",Hn=`=${Ne}(`;Ft?.({text:`${Hn}${en})`,editMode:!0,initialSelection:{start:Hn.length,end:Hn.length+en.length}})}},!1)},[le]),$a=ue((de,Ne,Xe=!1,De=!0)=>{ho(de,async nt=>{let at=null;if(l0)return void l0.updateStyleOptions(Ne);{const Kt=nt.getSelectedRanges().getFixed(!0),pn=nt.getSelectedRange().getDefaultSortCriteria();let en={ranges:Kt,hasHeader:pn?.options?.hasHeader??!1};at=De?new Promise((Hn,io)=>{const $o={tableOptions:en,onCancel:()=>{io()},onDone:Ar=>{Hn(Ar)},context:{getNames:()=>nt.getNames()}};ce.showWindow?.("tableNew",$o)}):{option:"Ok",tableOptions:en}}const an=await Promise.resolve(at);if(an?.option!=="Ok")throw null;const sn=await Promise.resolve(ce?.showBusy?.(de.label()));try{await nt.getTables().add(an.tableOptions.ranges.at(0),{styleName:Ne?.name,clearFormatting:Xe,hasHeader:an.tableOptions.hasHeader}).getRange().select()}catch(Kt){sn(),ce?.showError?.(Kt)}sn()},!1,!0,!1)},[l0]),Gu=ue(()=>bt,[bt]),Ku=ue(de=>({styles:()=>le.getStyles(),table:()=>de,bodyStyle:Gu,getNames:()=>le.getNames()}),[le]),Mm=ue(async(de,Ne,Xe,De=!0)=>{let nt=null;if(!Ne){let at=le.getSelectedRange();at.size===1&&(at=at.getSurrounding());let an=le.getTables().search({address:le.getSelectedRange()});an.length>0&&(Ne=an[0]),await at.select()}if(Ne){if(De){try{Xe&&await Ne.select()}catch{}nt=new Promise(async(at,an)=>{de.update({context:Ku(Ne)});const sn={command:de,commands:ge,notifier:ce,onDone:pn=>{at(pn)}},Kt=await ce.showWindow?.("tableDetails",sn,{disableAutoDestroy:!0});setTimeout(()=>{Kt.focus()},180)})}Promise.resolve(nt).then(at=>{},at=>{ce?.showError?.(at)})}},[ce]),Xu=ue(async(de,Ne,Xe=!1)=>{let De=null;if(Ne)Ne.isITable?De=Ne:Ne.getValue()&&(De=Ne.getValue());else{const nt=le.getTables().search({address:le.getSelectedRange()});nt.length>0&&(De=nt[0])}if(De){if(!Xe){const nt=De.getRange().getCoords(),at=(nt.colEnd-nt.colStart+1)*(nt.rowEnd-nt.rowStart+1);if(at>1e4&&await ce?.showOptions({title:"Confirm",description:`Converting a table to range with '${at}' cells will set a large number of cell styles and may affect performance.
|
|
63
63
|
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}ho(de,async()=>{Xe?De.delete():De.convertToRange()},!1,!0)}},[ce]),rc=ue((de,Ne,Xe)=>{ho(de,async De=>{let nt=De.getSelectedRanges();if(nt.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let at=nt.at(0);at.size===1&&(at=at.getSurrounding());const an=De.getSelection().getCoords().cell;let sn=at.getDefaultSortCriteria(z.IRange.Orientation.Row,an);if(!sn){if(Xe)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let Kt=sn.options;if(Xe&&(Kt=new Promise((en,Hn)=>{const io={range:at,options:sn.options,cell:an,onCancel:()=>{Hn()},onDone:$o=>{$o?en($o.options):Hn()}};ce.showWindow?.("sort",io)})),Kt=await Promise.resolve(Kt),!Kt)return;const pn=await Promise.resolve(ce?.showBusy?.(de.label()));try{at.doBatch(()=>{const en={...Kt,...Ne};at.sort(en),at.autoFit({orientations:en?.orientation===z.IRange.Orientation.Column?z.IRange.Orientations.Column:z.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},de?.label?.())}catch(en){pn(),ce?.showError?.(en)}pn()},!1,!1,!1)},[ce]),Rm=ue(()=>{console.log("compactedSelection");const de=le.getSelection().getCoords(),Ne=le.getSelectedRanges().getFlattened().getCoords(),Xe=(()=>{const at=new Blob(["console.log('hello from worker');"],{type:"application/javascript"}),an=URL.createObjectURL(at),sn=new Worker(an);return URL.revokeObjectURL(an),sn})();setTimeout(()=>{Xe.terminate(),console.log("Worker terminated")},5e3);let De=-1;for(let at=0;De===-1&&at<Ne.length;at++)vo.isCellWithinRange(de.cell,Ne[at])&&(De=at);if(vo.isEqualRangesArrays(de.ranges,Ne))return;const nt={cell:de.cell,ranges:Ne,rangeIndex:De};le.getSelection().updateCoords(nt)},[le]),Im=ue(()=>{console.log("selectComments")},[le]),Yu=ue(async(de=!1,Ne=!1)=>{let Xe=null;if(Ne)Xe=le.getEntireRange();else{const De=le.getSelectedRange();if(De.isEntireRange()){const nt=le.getSelection().getCoords().cell,at=le.getRange(nt);Xe=at.getSurrounding(),Xe.isEntireRange()&&(Xe=at)}else Xe=De.getSurrounding({contentOnly:de})}Xe&&await Xe.select()},[le]),pl=ue((de,Ne,Xe)=>{ho(de,async De=>{let nt=De.getSelectedRanges();Xe&&(Ne===z.IRange.Orientation.Row?nt=nt.getEntireRows():Ne===z.IRange.Orientation.Column&&(nt=nt.getEntireColumns())),nt.delete(Ne)},"Delete Cells")},[le]);ue(async de=>{let Ne=null;const Xe=hn(),De=Math.min(Xe.width-8,480),nt=Math.min(Xe.height-8,288);try{le.getSelectedRanges(),Ne=await le.getMovables().add({bounds:{x:Xe.left+(Xe.width-De)/2,y:Xe.top+(Xe.height-nt)/2,width:De,height:nt},type:"chart",json:de.template}),Ne.select(),Nt.setMode(null)}catch(at){ce?.showError?.(at)}return Ne},[le,ce]);const Ju=ue(async(de,Ne,Xe)=>{const De=await ce?.showBusy?.(de.label());try{const nt=await le.getMovables().addImage(Ne,{autoSelect:!0,...Xe});return De(),Nt.setMode(null),nt}catch(nt){De();let at=nt;typeof at!="string"&&(console.warn(nt),at="Unable to resolve image."),ce?.showMessage?.(at,{type:r0.Error})}},[le,ce]),Wa=ue((de,Ne)=>{ho(de,async Xe=>{const De=Xe.getSelectedRanges();De.doBatch(()=>{const nt=Ne===z.IRange.Direction.Up||Ne===z.IRange.Direction.Down,at=De.getCoords().slice().sort(vo.createRangeComparator(nt?z.IRange.Orientation.Row:z.IRange.Orientation.Column));for(let an=0;an<at.length;an++){const sn=at[an];let Kt=sn;const pn=Xe.getRange(Kt).getMerges();let en=0,Hn=0;if(pn.length>0){const io=pn[0];en=io.rowEnd-io.rowStart,Hn=io.colEnd-io.colStart}Ne===z.IRange.Direction.Left?Kt={...sn,colStart:sn.colEnd+Hn}:Ne===z.IRange.Direction.Right?Kt={...sn,colEnd:sn.colStart+Hn}:Ne===z.IRange.Direction.Up?Kt={...sn,rowStart:sn.rowEnd+en}:Ne===z.IRange.Direction.Down&&(Kt={...sn,rowEnd:sn.rowStart+en}),Xe.getRange(Kt).autoFill(sn,{filler:z.AutoFill.Types.Copy}),Xe.getRange(sn).autoFit({orientations:z.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:de.label()})})},[ce]),Dm=ue(()=>{let de=null;const Ne=le.getSelectedCell().getCoords();if(Ne?.rowIndex>0){const Xe=le.getRange({rowIndex:Ne.rowIndex-1,colIndex:Ne.colIndex}).getCell();Xe&&(de=Xe.toTextUnformatted(!0))}Ft?.({text:de})},[le]),[fl,Lm]=s.useReducer(de=>de+1,0),[Ua,mi]=s.useReducer(de=>de+1,0),Qu=s.useMemo(()=>[new je("gridlinesToggle",Z,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new je("sheetViewToggleGridlinesRows",Z,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new je("sheetViewToggleGridlinesColumns",Z,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new je("sheetViewFormatGridlinesColor",Z,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new je("sheetViewToggleShowHeadings",Z,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new je("sheetViewToggleShowHeadingRows",Z,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new je("sheetViewToggleShowHeadingColumns",Z,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new je("sheetViewToggleShowHeadingsNumeric",Z,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[ke.Ctrl,ke.Shift]}}),new je("sheetViewToggleFormulaView",Z,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[ke.Ctrl]},{key:"`",modifiers:[ke.Ctrl,ke.Shift]}]}),new je("sheetViewToggleShowZeros",Z,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new vt("selectComments",Z,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[ke.Ctrl,ke.Shift]}},()=>Im()),new je("selectAll",Z,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[ke.Ctrl]},{key:"Space",modifiers:[ke.Ctrl,ke.Shift]}]},(de=!1)=>Yu(!1,de)),new vt("selectRegion",Z,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[ke.Ctrl,ke.Shift]}},()=>Yu(!0,!1)),new vt("breakSelection",Z,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[ke.Ctrl,ke.Alt]}},()=>Rm()),new vt("formatTextRotate0",Z,{label:"No Text Rotation",description:"Remove all text rotation."}),new vt("formatTextRotate45",Z,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new vt("formatTextRotate90",Z,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new vt("formatTextRotate270",Z,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new vt("formatTextRotate315",Z,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new je("formatTextRotateCustom",Z,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new vt("formatTextRotateVertical",Z,{label:"Vertical Text",description:"Stack text vertically."}),new vt("sortAscending",Z,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){rc(this,{reverse:!1},!1)}),new vt("sortDescending",Z,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){rc(this,{reverse:!0},!1)}),new vt("sortCustom",Z,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){rc(this,{},!0)}),new je("protectionSheetToggle",Z,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
64
64
|
For example, you can prevent people from editing locked cells or making formatting changes.`}),new je("formatSheetTabColor",Z,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new je("formatCellStyle",Z,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(de){zt(this,{named:de.getName()},!0)}),new je("formatTableStyle",Z,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(de){$a(this,de)}),new je("formatTableStyleClearCellStyles",Z,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(de){$a(this,de,!0)}),new je("formatTableStyleClearTableStyle",Z,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){$a(this,{name:null},!0)}),new je("setDefaultTableStyle",Z,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Tm),new je("deleteTableStyle",Z,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},jm),new je("formatBorder",Z,{label:"Border",description:"Create an outline border."},function(de){zt(this,{border:de})}),new je("formatFillColor",Z,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(de){zt(this,{fill:de})}),new je("formatFontColor",Z,{label:"Font Color",description:"Change the color of your text."},function(de){zt(this,{font:{fill:de}})}),new je("formatBoldToggle",Z,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[ke.Ctrl]},{key:"2",modifiers:[ke.Ctrl]}]}),new je("formatItalicToggle",Z,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[ke.Ctrl]},{key:"3",modifiers:[ke.Ctrl]}]}),new je("formatUnderlinedToggle",Z,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[ke.Ctrl]},{key:"4",modifiers:[ke.Ctrl]}]}),new je("formatUnderlinedDoubleToggle",Z,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new je("formatUnderlinedAccountingToggle",Z,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new je("formatUnderlinedAccountingDoubleToggle",Z,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new je("formatStrikeThroughToggle",Z,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[ke.Ctrl]}}),new je("formatSuperscriptToggle",Z,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new je("formatSubscriptToggle",Z,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new je("formatAlignTopToggle",Z,{label:"Align Top",description:"Align text to the top."}),new je("formatTextOverflowVisibleToggle",Z,{label:"Overflow Text",description:"Overflow text to the next cells."}),new je("formatTextOverflowWrapToggle",Z,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new je("formatTextOverflowClipToggle",Z,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new je("formatTextOverflowShrinkToggle",Z,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new je("formatTextOverflowEllipsisToggle",Z,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new je("formatAlignMiddleToggle",Z,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new je("formatAlignBottomToggle",Z,{label:"Align Bottom",description:"Align text to the bottom."}),new je("formatAlignJustifyVerticalToggle",Z,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new je("formatAlignDistributedVerticalToggle",Z,{label:"Distribute Vertically",description:"Justify your content vertically."}),new je("formatAlignLeftToggle",Z,{label:"Align Left",description:"Align your content to the left."}),new je("formatAlignCenterToggle",Z,{label:"Align Center",description:"Center your content."}),new je("formatAlignRightToggle",Z,{label:"Align Right",description:"Align your content to the right."}),new je("formatAlignJustifyToggle",Z,{label:"Align Justify",description:"Justify your content."}),new je("formatAlignCenterContinuousToggle",Z,{label:"Center Across",description:"Center your content across multiple cells."}),new je("formatAlignFillToggle",Z,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new je("formatAlignDistributedHorizontalToggle",Z,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new vt("formatFontSizeIncrease",Z,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,de=>({font:{size:m2(de.getFont().getSize(),!0)}}))}),new vt("formatFontSizeDecrease",Z,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,de=>({font:{size:m2(de.getFont().getSize(),!1)}}))}),new je("formatFontFamily",Z,{label:"Font",description:"Select the font your text."},function(de){zt(this,{font:{family:de}})}),new je("formatFontSize",Z,{label:"Font Size",description:"Change the size of your text."},function(de){zt(this,{font:{size:de}})}),new je("formatNumberDialog",Z,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[ke.Ctrl]},{key:"1",modifiers:[ke.Ctrl,ke.Alt]}]},function(de,Ne){const Xe=this,De={initialValue:de??Ne.state(),context:Ne.context(),onInputOption:(nt,at)=>{zt(Xe,{numberFormat:nt})}};ce.showWindow?.("numberFormat",De)}),new je("formatNumberFormat",Z,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(de){zt(this,{numberFormat:de})}),new je("formatNumberFormatGeneralStyle",Z,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:z.NumberFormat.Type.General})}),new je("formatNumberFormatNumberStyle",Z,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:"#,##0.00"})}),new je("formatNumberFormatTimeStyle",Z,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:"h:mm AM/PM"})}),new je("formatNumberFormatDateStyle",Z,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:"d-mmm-yy"})}),new je("formatNumberFormatAccountingStyle",Z,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[ke.Ctrl,ke.Shift]}},function(de){zt(this,{numberFormat:de??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new je("formatNumberFormatPercentStyle",Z,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:"0%"})}),new je("formatNumberFormatScientificStyle",Z,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[ke.Ctrl,ke.Shift]}},function(){zt(this,{numberFormat:"0.00E+00"})}),new je("formatNumberFormatCommaStyle",Z,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[ke.Ctrl]}},function(){zt(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new je("formatNumberFormatIncreaseDecimal",Z,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){zt(this,de=>({numberFormat:z.NumberFormat.Parser.adjustDecimalPlaces(de.getNumberFormat(),1)}))}),new je("formatNumberFormatDecreaseDecimal",Z,{label:"Decrease Decimal",description:"Show few decimal places."},function(){zt(this,de=>({numberFormat:z.NumberFormat.Parser.adjustDecimalPlaces(de.getNumberFormat(),-1)}))}),new je("displayPlaceholdersToggle",Z,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[ke.Ctrl]}}),new vt("noOp",Z,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[ke.Ctrl]}},function(){}),new je("displayOutlineSymbolsToggle",Z,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[ke.Ctrl]}}),new je("hideRows",Z,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[ke.Ctrl]}}),new je("unhideRows",Z,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[ke.Ctrl,ke.Shift]}}),new je("hideColumns",Z,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[ke.Ctrl]},{key:"0",modifiers:[ke.Ctrl,ke.Alt]}]}),new je("unhideColumns",Z,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[ke.Ctrl,ke.Shift]}}),new je("quickFormulaSum",Z,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[ke.Alt]}},function(){hl(this,"SUM")}),new je("quickFormulaAverage",Z,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){hl(this,"AVERAGE")}),new je("quickFormulaCount",Z,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){hl(this,"COUNT")}),new je("quickFormulaMax",Z,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){hl(this,"MAX")}),new je("quickFormulaMin",Z,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){hl(this,"MIN")}),new je("startEditCurrentTime",Z,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[ke.Ctrl,ke.Shift]}},function(){Ft?.({text:le.createTemporaryCell({value:Ea(),style:{numberFormat:"Medium Time"}}).toText()})}),new je("startEditCurrentDate",Z,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[ke.Ctrl]}},function(){Ft?.({text:le.createTemporaryCell({value:Ea(),style:{numberFormat:"Short Date"}}).toText()})}),new vt("sheetZoomOut",Z,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[ke.Ctrl,ke.Alt]},{key:"NumpadSubtract",modifiers:[ke.Ctrl,ke.Alt]}]}),new vt("sheetZoomIn",Z,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[ke.Ctrl,ke.Alt]},{key:"NumpadAdd",modifiers:[ke.Ctrl,ke.Alt]}]}),new vt("sheetZoom100",Z,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[ke.Ctrl,ke.Alt]}}),new je("insertFunction",Z,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[ke.Shift]}},function(de,Ne){console.log("insertFunction")}),new je("updateHyperlink",Z,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>Io,shortcut:[{key:"K",modifiers:[ke.Ctrl]},{key:"K",modifiers:[ke.Ctrl,ke.Alt]}]},async function(de,Ne){const Xe=this,De={context:Ne.context(),onUpdateHyperlink:(nt,at)=>{qu(Xe,nt,at)}};ce.showWindow?.("hyperlink",De)}),new je("openHyperlink",Z,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[ke.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>Io},async(de,Ne)=>{const Xe=Ne.context()();if(!Xe)return;const De=Xe.getHyperlink();if(De)try{await De.open()}catch(nt){ce?.showError?.(nt)}}),new je("deleteHyperlink",Z,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>Io},function(de,Ne){qu(this,null,null)}),new vt("insertNote",Z,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[ke.Shift]},description:"Add a note to the cell."},(de,Ne)=>{((Xe,De)=>{Xe?.showMessage?.(a.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[De," is not yet implemented.",a.jsx("br",{}),a.jsx("br",{}),"Please see the ",a.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(ce,Ne.label())}),new je("updateComments",Z,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[ke.Ctrl,ke.Alt]},description:"Add a comment to the current cell.",context:()=>Io},async function(de,Ne){const Xe=this,De={context:Ne.context(),onUpdateComments:nt=>{Zu(Xe,nt)}};ce.showWindow?.("comments",De)}),new je("deleteComments",Z,{label:"Delete Comments",description:"Remove any comments.",context:()=>Io},function(de,Ne){Zu(this,null)}),new je("insertImageFromFile",Z,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(de=null){let Ne=null,Xe=null;typeof de=="string"?Xe=de:Ne=de?.file?de.file:de,(Ne||(Ne=await Ht.openFileDialog(Xe??"image/*"),Ne))&&await Ju(this,{file:Ne},de?.options)}),new je("insertImageFromURL",Z,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(de){if(!de){const Ne=await ce?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(Ne.option!=="Insert")return;de=Ne.input}de&&Ju(this,{fetch:de})}),new vt("insertTable",Z,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[ke.Ctrl]},{key:"T",modifiers:[ke.Alt,ke.Ctrl]}]},function(){$a(this)}),new je("editTable",Z,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(de){let Ne=null,Xe=!1;de.isITable?Ne=de:de.getValue()&&(Ne=de.getValue(),Xe=!0),Mm(this,Ne,Xe)}),new je("deleteTable",Z,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
65
65
|
|
|
@@ -73,15 +73,15 @@ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[ke.C
|
|
|
73
73
|
To pick up a draggable item, press the space bar.
|
|
74
74
|
While dragging, use the arrow keys to move the item.
|
|
75
75
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
76
|
-
`},nE={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 oE(e){let{announcements:t=nE,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=tE}=e;const{announce:i,announcement:l}=function(){const[f,h]=s.useState("");return{announce:s.useCallback(m=>{m!=null&&h(m)},[]),announcement:f}}(),d=_a("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),function(f){const h=s.useContext(Y9);s.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(f)},[f,h])}(s.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:m}=f;t.onDragMove&&i(t.onDragMove({active:h,over:m}))},onDragOver(f){let{active:h,over:m}=f;i(t.onDragOver({active:h,over:m}))},onDragEnd(f){let{active:h,over:m}=f;i(t.onDragEnd({active:h,over:m}))},onDragCancel(f){let{active:h,over:m}=f;i(t.onDragCancel({active:h,over:m}))}}),[i,t])),!c)return null;const p=s.createElement(s.Fragment,null,s.createElement(Qk,{id:o,value:r.draggable}),s.createElement(eE,{id:d,announcement:l}));return n?wo.createPortal(p,n):p}var jo;function T1(){}function od(e,t){return s.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"})(jo||(jo={}));const Wr=Object.freeze({x:0,y:0});function J9(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rE(e,t){const n=_1(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Q9(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function iE(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function E7(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ef(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _7(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 lE=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=_7(t,t.left,t.top),i=[];for(const l of o){const{id:d}=l,c=n.get(d);if(c){const u=J9(_7(c),r);i.push({id:d,data:{droppableContainer:l,value:u}})}}return i.sort(Q9)};function aE(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,d=i-n;if(o<r&&n<i){const c=t.width*t.height,u=e.width*e.height,p=l*d;return Number((p/(c+u-p)).toFixed(4))}return 0}const sE=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:l}=i,d=n.get(l);if(d){const c=aE(d,t);c>0&&r.push({id:l,data:{droppableContainer:i,value:c}})}}return r.sort(iE)};function T7(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Wr}const cE=function(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...t})}}(1);function tf(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 dE={ignoreTransform:!1};function dl(e,t){t===void 0&&(t=dE);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:p}=nr(e).getComputedStyle(e);u&&(n=function(f,h,m){const g=tf(h);if(!g)return f;const{scaleX:x,scaleY:y,x:v,y:b}=g,C=f.left-v-(1-x)*parseFloat(m),k=f.top-b-(1-y)*parseFloat(m.slice(m.indexOf(" ")+1)),E=x?f.width/x:f.width,R=y?f.height/y:f.height;return{width:E,height:R,top:k,right:C+E,bottom:k+R,left:C}}(n,u,p))}const{top:o,left:r,width:i,height:l,bottom:d,right:c}=n;return{top:o,left:r,width:i,height:l,bottom:d,right:c}}function j7(e){return dl(e,{ignoreTransform:!0})}function Y1(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(gu(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Va(r)||K9(r)||n.includes(r))return n;const i=nr(e).getComputedStyle(r);return r!==e&&function(c,u){u===void 0&&(u=nr(c).getComputedStyle(c));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(f=>{const h=u[f];return typeof h=="string"&&p.test(h)})}(r,i)&&n.push(r),l=r,(d=i)===void 0&&(d=nr(l).getComputedStyle(l)),d.position==="fixed"?n:o(r.parentNode);var l,d}(e):n}function nf(e){const[t]=Y1(e,1);return t??null}function rd(e){return G1&&e?cl(e)?e:mu(e)?gu(e)||e===nl(e).scrollingElement?window:Va(e)?e:null:null:null}function of(e){return cl(e)?e.scrollX:e.scrollLeft}function rf(e){return cl(e)?e.scrollY:e.scrollTop}function g2(e){return{x:of(e),y:rf(e)}}var Lo;function lf(e){return!(!G1||!e)&&e===document.scrollingElement}function af(e){const t={x:0,y:0},n=lf(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Lo||(Lo={}));const uE={x:.2,y:.2};function hE(e,t,n,o,r){let{top:i,left:l,right:d,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=uE);const{isTop:u,isBottom:p,isLeft:f,isRight:h}=af(e),m={x:0,y:0},g={x:0,y:0},x=t.height*r.y,y=t.width*r.x;return!u&&i<=t.top+x?(m.y=Lo.Backward,g.y=o*Math.abs((t.top+x-i)/x)):!p&&c>=t.bottom-x&&(m.y=Lo.Forward,g.y=o*Math.abs((t.bottom-x-c)/x)),!h&&d>=t.right-y?(m.x=Lo.Forward,g.x=o*Math.abs((t.right-y-d)/y)):!f&&l<=t.left+y&&(m.x=Lo.Backward,g.x=o*Math.abs((t.left+y-l)/y)),{direction:m,speed:g}}function pE(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function sf(e){return e.reduce((t,n)=>zi(t,g2(n)),Wr)}function cf(e,t){if(t===void 0&&(t=dl),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);nf(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fE=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+of(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+rf(n),0)}]];class x2{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 o=Y1(n),r=sf(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,l,d]of fE)for(const c of l)Object.defineProperty(this,c,{get:()=>{const u=d(o),p=r[i]-u;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class la{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function id(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Er,jn;function M7(e){e.preventDefault()}function mE(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"})(Er||(Er={})),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"}(jn||(jn={}));const df={start:[jn.Space,jn.Enter],cancel:[jn.Esc],end:[jn.Space,jn.Enter,jn.Tab]},gE=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case jn.Right:return{...n,x:n.x+25};case jn.Left:return{...n,x:n.x-25};case jn.Down:return{...n,y:n.y+25};case jn.Up:return{...n,y:n.y-25}}};class xu{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 la(nl(n)),this.windowListeners=new la(nr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Er.Resize,this.handleCancel),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&cf(o),n(Wr)}handleKeyDown(t){if(X1(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=df,coordinateGetter:l=gE,scrollBehavior:d="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:u}=o.current,p=u?{x:u.left,y:u.top}:Wr;this.referenceCoordinates||(this.referenceCoordinates=p);const f=l(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=Ta(f,p),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const x of g){const y=t.code,{isTop:v,isRight:b,isLeft:C,isBottom:k,maxScroll:E,minScroll:R}=af(x),j=pE(x),B={x:Math.min(y===jn.Right?j.right-j.width/2:j.right,Math.max(y===jn.Right?j.left:j.left+j.width/2,f.x)),y:Math.min(y===jn.Down?j.bottom-j.height/2:j.bottom,Math.max(y===jn.Down?j.top:j.top+j.height/2,f.y))},T=y===jn.Right&&!b||y===jn.Left&&!C,_=y===jn.Down&&!k||y===jn.Up&&!v;if(T&&B.x!==f.x){const w=x.scrollLeft+h.x,S=y===jn.Right&&w<=E.x||y===jn.Left&&w>=R.x;if(S&&!h.y)return void x.scrollTo({left:w,behavior:d});m.x=S?x.scrollLeft-w:y===jn.Right?x.scrollLeft-E.x:x.scrollLeft-R.x,m.x&&x.scrollBy({left:-m.x,behavior:d});break}if(_&&B.y!==f.y){const w=x.scrollTop+h.y,S=y===jn.Down&&w<=E.y||y===jn.Up&&w>=R.y;if(S&&!h.x)return void x.scrollTo({top:w,behavior:d});m.y=S?x.scrollTop-w:y===jn.Down?x.scrollTop-E.y:x.scrollTop-R.y,m.y&&x.scrollBy({top:-m.y,behavior:d});break}}this.handleMove(t,zi(Ta(f,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(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 R7(e){return!(!e||!("distance"in e))}function I7(e){return!(!e||!("delay"in e))}xu.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=df,onActivation:r}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(o.start.includes(l)){const d=i.activatorNode.current;return!(d&&e.target!==d||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class yu{constructor(t,n,o){var r;o===void 0&&(o=function(d){const{EventTarget:c}=nr(d);return d instanceof c?d:nl(d)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=nl(l),this.documentListeners=new la(this.document),this.listeners=new la(o),this.windowListeners=new la(nr(l)),this.initialCoordinates=(r=_1(i))!=null?r:Wr,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:o}}}=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(Er.Resize,this.handleCancel),this.windowListeners.add(Er.DragStart,M7),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),this.windowListeners.add(Er.ContextMenu,M7),this.documentListeners.add(Er.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(I7(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(R7(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:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Er.Click,mE,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Er.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:l,options:{activationConstraint:d}}=i;if(!r)return;const c=(n=_1(t))!=null?n:Wr,u=Ta(r,c);if(!o&&d){if(R7(d)){if(d.tolerance!=null&&id(u,d.tolerance))return this.handleCancel();if(id(u,d.distance))return this.handleStart()}return I7(d)&&id(u,d.tolerance)?this.handleCancel():void this.handlePending(d,u)}t.cancelable&&t.preventDefault(),l(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===jn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uf extends yu{constructor(t){const{event:n}=t,o=nl(n.target);super(t,xE,o)}}uf.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const yE={move:{name:"mousemove"},end:{name:"mouseup"}};var y2;(function(e){e[e.RightClick=2]="RightClick"})(y2||(y2={}));class hf extends yu{constructor(t){super(t,yE,nl(t.event.target))}}hf.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==y2.RightClick&&(o?.({event:n}),!0)}}];const ld={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pf extends yu{constructor(t){super(t,ld)}static setup(){return window.addEventListener(ld.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ld.move.name,t)};function t(){}}}var aa,j1;pf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(aa||(aa={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(j1||(j1={}));const bE={x:{[Lo.Backward]:!1,[Lo.Forward]:!1},y:{[Lo.Backward]:!1,[Lo.Forward]:!1}};var ja,b2;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ja||(ja={})),(b2||(b2={})).Optimized="optimized";const D7=new Map;function v2(e,t){return Yl(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function M1(e){let{callback:t,disabled:n}=e;const o=K1(t),r=s.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return s.useEffect(()=>()=>r?.disconnect(),[r]),r}function vE(e){return new x2(dl(e),e)}function L7(e,t,n){t===void 0&&(t=vE);const[o,r]=s.useState(null);function i(){r(c=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=c??n)!=null?u:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const l=function(c){let{callback:u,disabled:p}=c;const f=K1(u),h=s.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:m}=window;return new m(f)},[f,p]);return s.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const u of c){const{type:p,target:f}=u;if(p==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),d=M1({callback:i});return Hr(()=>{i(),e?(d?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),l?.disconnect())},[e]),o}const O7=[];function P7(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const o=e!==Wr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Ta(e,n.current):Wr}function A7(e){return s.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const F7=[];function ff(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Va(t)?t:e}const wE=[{sensor:uf,options:{}},{sensor:xu,options:{}}],SE={current:{}},Gs={draggable:{measure:j7},droppable:{measure:j7,strategy:ja.WhileDragging,frequency:b2.Optimized},dragOverlay:{measure:dl}};class sa 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,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const CE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sa,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:T1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Gs,measureDroppableContainers:T1,windowRect:null,measuringScheduled:!1},mf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:T1,draggableNodes:new Map,over:null,measureDroppableContainers:T1},Ma=s.createContext(mf),gf=s.createContext(CE);function kE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sa}}}function EE(e,t){switch(t.type){case jo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case jo.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 jo.DragEnd:case jo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case jo.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new sa(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case jo.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const l=new sa(e.droppable.containers);return l.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:l}}}case jo.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new sa(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function _E(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=s.useContext(Ma),i=E1(o),l=E1(n?.id);return s.useEffect(()=>{if(!t&&!o&&i&&l!=null){if(!X1(i)||document.activeElement===i.target)return;const d=r.get(l);if(!d)return;const{activatorNode:c,node:u}=d;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const p of[c.current,u.current]){if(!p)continue;const f=Yk(p);if(f){f.focus();break}}})}},[o,t,r,l,i]),null}function xf(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const J1=s.createContext({...Wr,scaleX:1,scaleY:1});var D0;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(D0||(D0={}));const TE=s.memo(function(e){var t,n,o,r;let{id:i,accessibility:l,autoScroll:d=!0,children:c,sensors:u=wE,collisionDetection:p=sE,measuring:f,modifiers:h,...m}=e;const g=s.useReducer(EE,void 0,kE),[x,y]=g,[v,b]=function(){const[Y]=s.useState(()=>new Set),se=s.useCallback(Ce=>(Y.add(Ce),()=>Y.delete(Ce)),[Y]);return[s.useCallback(Ce=>{let{type:Pe,event:Qe}=Ce;Y.forEach(Ge=>{var Be;return(Be=Ge[Pe])==null?void 0:Be.call(Ge,Qe)})},[Y]),se]}(),[C,k]=s.useState(D0.Uninitialized),E=C===D0.Initialized,{draggable:{active:R,nodes:j,translate:B},droppable:{containers:T}}=x,_=R!=null?j.get(R):null,w=s.useRef({initial:null,translated:null}),S=s.useMemo(()=>{var Y;return R!=null?{id:R,data:(Y=_?.data)!=null?Y:SE,rect:w}:null},[R,_]),O=s.useRef(null),[P,M]=s.useState(null),[A,D]=s.useState(null),L=ia(m,Object.values(m)),N=_a("DndDescribedBy",i),W=s.useMemo(()=>T.getEnabled(),[T]),I=s.useMemo(()=>({draggable:{...Gs.draggable,...U?.draggable},droppable:{...Gs.droppable,...U?.droppable},dragOverlay:{...Gs.dragOverlay,...U?.dragOverlay}}),[(U=f)==null?void 0:U.draggable,U?.droppable,U?.dragOverlay]);var U;const{droppableRects:G,measureDroppableContainers:Q,measuringScheduled:H}=function(Y,se){let{dragging:Ce,dependencies:Pe,config:Qe}=se;const[Ge,Be]=s.useState(null),{frequency:ot,measure:Ze,strategy:et}=Qe,mt=s.useRef(Y),pt=function(){switch(et){case ja.Always:return!1;case ja.BeforeDragging:return Ce;default:return!Ce}}(),it=ia(pt),Wt=s.useCallback(function(nn){nn===void 0&&(nn=[]),it.current||Be(bn=>bn===null?nn:bn.concat(nn.filter(kn=>!bn.includes(kn))))},[it]),qt=s.useRef(null),Vt=Yl(nn=>{if(pt&&!Ce)return D7;if(!nn||nn===D7||mt.current!==Y||Ge!=null){const bn=new Map;for(let kn of Y){if(!kn)continue;if(Ge&&Ge.length>0&&!Ge.includes(kn.id)&&kn.rect.current){bn.set(kn.id,kn.rect.current);continue}const Gn=kn.node.current,eo=Gn?new x2(Ze(Gn),Gn):null;kn.rect.current=eo,eo&&bn.set(kn.id,eo)}return bn}return nn},[Y,Ge,Ce,pt,Ze]);return s.useEffect(()=>{mt.current=Y},[Y]),s.useEffect(()=>{pt||Wt()},[Ce,pt]),s.useEffect(()=>{Ge&&Ge.length>0&&Be(null)},[JSON.stringify(Ge)]),s.useEffect(()=>{pt||typeof ot!="number"||qt.current!==null||(qt.current=setTimeout(()=>{Wt(),qt.current=null},ot))},[ot,pt,Wt,...Pe]),{droppableRects:Vt,measureDroppableContainers:Wt,measuringScheduled:Ge!=null}}(W,{dragging:E,dependencies:[B.x,B.y],config:I.droppable}),$=function(Y,se){const Ce=se!=null?Y.get(se):void 0,Pe=Ce?Ce.node.current:null;return Yl(Qe=>{var Ge;return se==null?null:(Ge=Pe??Qe)!=null?Ge:null},[Pe,se])}(j,R),F=s.useMemo(()=>A?_1(A):null,[A]),X=function(){const Y=P?.autoScrollEnabled===!1,se=typeof d=="object"?d.enabled===!1:d===!1,Ce=E&&!Y&&!se;return typeof d=="object"?{...d,enabled:Ce}:{enabled:Ce}}(),K=function(Y,se){return v2(Y,se)}($,I.draggable.measure);(function(Y){let{activeNode:se,measure:Ce,initialRect:Pe,config:Qe=!0}=Y;const Ge=s.useRef(!1),{x:Be,y:ot}=typeof Qe=="boolean"?{x:Qe,y:Qe}:Qe;Hr(()=>{if(!Be&&!ot||!se)return void(Ge.current=!1);if(Ge.current||!Pe)return;const Ze=se?.node.current;if(!Ze||Ze.isConnected===!1)return;const et=T7(Ce(Ze),Pe);if(Be||(et.x=0),ot||(et.y=0),Ge.current=!0,Math.abs(et.x)>0||Math.abs(et.y)>0){const mt=nf(Ze);mt&&mt.scrollBy({top:et.y,left:et.x})}},[se,Be,ot,Pe,Ce])})({activeNode:R!=null?j.get(R):null,config:X.layoutShiftCompensation,initialRect:K,measure:I.draggable.measure});const ne=L7($,I.draggable.measure,K),J=L7($?$.parentElement:null),re=s.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=T.getNodeFor((t=re.current.over)==null?void 0:t.id),ie=function(Y){let{measure:se}=Y;const[Ce,Pe]=s.useState(null),Qe=M1({callback:s.useCallback(Ze=>{for(const{target:et}of Ze)if(Va(et)){Pe(mt=>{const pt=se(et);return mt?{...mt,width:pt.width,height:pt.height}:pt});break}},[se])}),Ge=s.useCallback(Ze=>{const et=ff(Ze);Qe?.disconnect(),et&&Qe?.observe(et),Pe(et?se(et):null)},[se,Qe]),[Be,ot]=Zs(Ge);return s.useMemo(()=>({nodeRef:Be,rect:Ce,setRef:ot}),[Ce,Be,ot])}({measure:I.dragOverlay.measure}),ee=(n=ie.nodeRef.current)!=null?n:$,pe=E?(o=ie.rect)!=null?o:ne:null,Te=!(!ie.nodeRef.current||!ie.rect),Ae=T7(ae=Te?null:ne,v2(ae));var ae;const he=A7(ee?nr(ee):null),we=function(Y){const se=s.useRef(Y),Ce=Yl(Pe=>Y?Pe&&Pe!==O7&&Y&&se.current&&Y.parentNode===se.current.parentNode?Pe:Y1(Y):O7,[Y]);return s.useEffect(()=>{se.current=Y},[Y]),Ce}(E?fe??$:null),He=function(Y,se){se===void 0&&(se=dl);const[Ce]=Y,Pe=A7(Ce?nr(Ce):null),[Qe,Ge]=s.useState(F7);function Be(){Ge(()=>Y.length?Y.map(Ze=>lf(Ze)?Pe:new x2(se(Ze),Ze)):F7)}const ot=M1({callback:Be});return Hr(()=>{ot?.disconnect(),Be(),Y.forEach(Ze=>ot?.observe(Ze))},[Y]),Qe}(we),Ye=xf(h,{transform:{x:B.x-Ae.x,y:B.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:A,active:S,activeNodeRect:ne,containerNodeRect:J,draggingNodeRect:pe,over:re.current.over,overlayNodeRect:ie.rect,scrollableAncestors:we,scrollableAncestorRects:He,windowRect:he}),wt=F?zi(F,B):null,Ct=function(Y){const[se,Ce]=s.useState(null),Pe=s.useRef(Y),Qe=s.useCallback(Ge=>{const Be=rd(Ge.target);Be&&Ce(ot=>ot?(ot.set(Be,g2(Be)),new Map(ot)):null)},[]);return s.useEffect(()=>{const Ge=Pe.current;if(Y!==Ge){Be(Ge);const ot=Y.map(Ze=>{const et=rd(Ze);return et?(et.addEventListener("scroll",Qe,{passive:!0}),[et,g2(et)]):null}).filter(Ze=>Ze!=null);Ce(ot.length?new Map(ot):null),Pe.current=Y}return()=>{Be(Y),Be(Ge)};function Be(ot){ot.forEach(Ze=>{rd(Ze)?.removeEventListener("scroll",Qe)})}},[Qe,Y]),s.useMemo(()=>Y.length?se?Array.from(se.values()).reduce((Ge,Be)=>zi(Ge,Be),Wr):sf(Y):Wr,[Y,se])}(we),Ee=P7(Ct),Ie=P7(Ct,[ne]),ft=zi(Ye,Ee),$e=pe?cE(pe,Ye):null,yt=S&&$e?p({active:S,collisionRect:$e,droppableRects:G,droppableContainers:W,pointerCoordinates:wt}):null,tt=ef(yt,"id"),[oe,Ve]=s.useState(null),xe=function(Y,se,Ce){return{...Y,scaleX:se&&Ce?se.width/Ce.width:1,scaleY:se&&Ce?se.height/Ce.height:1}}(Te?Ye:zi(Ye,Ie),(r=oe?.rect)!=null?r:null,ne),be=s.useRef(null),te=s.useCallback((Y,se)=>{let{sensor:Ce,options:Pe}=se;if(O.current==null)return;const Qe=j.get(O.current);if(!Qe)return;const Ge=Y.nativeEvent,Be=new Ce({active:O.current,activeNode:Qe,event:Ge,options:Pe,context:re,onAbort(Ze){if(!j.get(Ze))return;const{onDragAbort:et}=L.current,mt={id:Ze};et?.(mt),v({type:"onDragAbort",event:mt})},onPending(Ze,et,mt,pt){if(!j.get(Ze))return;const{onDragPending:it}=L.current,Wt={id:Ze,constraint:et,initialCoordinates:mt,offset:pt};it?.(Wt),v({type:"onDragPending",event:Wt})},onStart(Ze){const et=O.current;if(et==null)return;const mt=j.get(et);if(!mt)return;const{onDragStart:pt}=L.current,it={activatorEvent:Ge,active:{id:et,data:mt.data,rect:w}};wo.unstable_batchedUpdates(()=>{pt?.(it),k(D0.Initializing),y({type:jo.DragStart,initialCoordinates:Ze,active:et}),v({type:"onDragStart",event:it}),M(be.current),D(Ge)})},onMove(Ze){y({type:jo.DragMove,coordinates:Ze})},onEnd:ot(jo.DragEnd),onCancel:ot(jo.DragCancel)});function ot(Ze){return async function(){const{active:et,collisions:mt,over:pt,scrollAdjustedTranslate:it}=re.current;let Wt=null;if(et&&it){const{cancelDrop:qt}=L.current;Wt={activatorEvent:Ge,active:et,collisions:mt,delta:it,over:pt},Ze===jo.DragEnd&&typeof qt=="function"&&await Promise.resolve(qt(Wt))&&(Ze=jo.DragCancel)}O.current=null,wo.unstable_batchedUpdates(()=>{y({type:Ze}),k(D0.Uninitialized),Ve(null),M(null),D(null),be.current=null;const qt=Ze===jo.DragEnd?"onDragEnd":"onDragCancel";if(Wt){const Vt=L.current[qt];Vt?.(Wt),v({type:qt,event:Wt})}})}}be.current=Be},[j]),Me=s.useCallback((Y,se)=>(Ce,Pe)=>{const Qe=Ce.nativeEvent,Ge=j.get(Pe);if(O.current!==null||!Ge||Qe.dndKit||Qe.defaultPrevented)return;const Be={active:Ge};Y(Ce,se.options,Be)===!0&&(Qe.dndKit={capturedBy:se.sensor},O.current=Pe,te(Ce,se))},[j,te]),_e=function(Y,se){return s.useMemo(()=>Y.reduce((Ce,Pe)=>{const{sensor:Qe}=Pe;return[...Ce,...Qe.activators.map(Ge=>({eventName:Ge.eventName,handler:se(Ge.handler,Pe)}))]},[]),[Y,se])}(u,Me);(function(Y){s.useEffect(()=>{if(!G1)return;const se=Y.map(Ce=>{let{sensor:Pe}=Ce;return Pe.setup==null?void 0:Pe.setup()});return()=>{for(const Ce of se)Ce?.()}},Y.map(se=>{let{sensor:Ce}=se;return Ce}))})(u),Hr(()=>{ne&&C===D0.Initializing&&k(D0.Initialized)},[ne,C]),s.useEffect(()=>{const{onDragMove:Y}=L.current,{active:se,activatorEvent:Ce,collisions:Pe,over:Qe}=re.current;if(!se||!Ce)return;const Ge={active:se,activatorEvent:Ce,collisions:Pe,delta:{x:ft.x,y:ft.y},over:Qe};wo.unstable_batchedUpdates(()=>{Y?.(Ge),v({type:"onDragMove",event:Ge})})},[ft.x,ft.y]),s.useEffect(()=>{const{active:Y,activatorEvent:se,collisions:Ce,droppableContainers:Pe,scrollAdjustedTranslate:Qe}=re.current;if(!Y||O.current==null||!se||!Qe)return;const{onDragOver:Ge}=L.current,Be=Pe.get(tt),ot=Be&&Be.rect.current?{id:Be.id,rect:Be.rect.current,data:Be.data,disabled:Be.disabled}:null,Ze={active:Y,activatorEvent:se,collisions:Ce,delta:{x:Qe.x,y:Qe.y},over:ot};wo.unstable_batchedUpdates(()=>{Ve(ot),Ge?.(Ze),v({type:"onDragOver",event:Ze})})},[tt]),Hr(()=>{re.current={activatorEvent:A,active:S,activeNode:$,collisionRect:$e,collisions:yt,droppableRects:G,draggableNodes:j,draggingNode:ee,draggingNodeRect:pe,droppableContainers:T,over:oe,scrollableAncestors:we,scrollAdjustedTranslate:ft},w.current={initial:pe,translated:$e}},[S,$,yt,$e,j,ee,pe,G,T,oe,we,ft]),function(Y){let{acceleration:se,activator:Ce=aa.Pointer,canScroll:Pe,draggingRect:Qe,enabled:Ge,interval:Be=5,order:ot=j1.TreeOrder,pointerCoordinates:Ze,scrollableAncestors:et,scrollableAncestorRects:mt,delta:pt,threshold:it}=Y;const Wt=function(dt){let{delta:Jt,disabled:Sn}=dt;const vn=E1(Jt);return Yl(En=>{if(Sn||!vn||!En)return bE;const on=Math.sign(Jt.x-vn.x),to=Math.sign(Jt.y-vn.y);return{x:{[Lo.Backward]:En.x[Lo.Backward]||on===-1,[Lo.Forward]:En.x[Lo.Forward]||on===1},y:{[Lo.Backward]:En.y[Lo.Backward]||to===-1,[Lo.Forward]:En.y[Lo.Forward]||to===1}}},[Sn,Jt,vn])}({delta:pt,disabled:!Ge}),[qt,Vt]=function(){const dt=s.useRef(null);return[s.useCallback((Jt,Sn)=>{dt.current=setInterval(Jt,Sn)},[]),s.useCallback(()=>{dt.current!==null&&(clearInterval(dt.current),dt.current=null)},[])]}(),nn=s.useRef({x:0,y:0}),bn=s.useRef({x:0,y:0}),kn=s.useMemo(()=>{switch(Ce){case aa.Pointer:return Ze?{top:Ze.y,bottom:Ze.y,left:Ze.x,right:Ze.x}:null;case aa.DraggableRect:return Qe}},[Ce,Qe,Ze]),Gn=s.useRef(null),eo=s.useCallback(()=>{const dt=Gn.current;if(!dt)return;const Jt=nn.current.x*bn.current.x,Sn=nn.current.y*bn.current.y;dt.scrollBy(Jt,Sn)},[]),Tn=s.useMemo(()=>ot===j1.TreeOrder?[...et].reverse():et,[ot,et]);s.useEffect(()=>{if(Ge&&et.length&&kn){for(const dt of Tn){if(Pe?.(dt)===!1)continue;const Jt=et.indexOf(dt),Sn=mt[Jt];if(!Sn)continue;const{direction:vn,speed:En}=hE(dt,Sn,kn,se,it);for(const on of["x","y"])Wt[on][vn[on]]||(En[on]=0,vn[on]=0);if(En.x>0||En.y>0)return Vt(),Gn.current=dt,qt(eo,Be),nn.current=En,void(bn.current=vn)}nn.current={x:0,y:0},bn.current={x:0,y:0},Vt()}else Vt()},[se,eo,Pe,Vt,Ge,Be,JSON.stringify(kn),JSON.stringify(Wt),qt,et,Tn,mt,JSON.stringify(it)])}({...X,delta:B,draggingRect:$e,pointerCoordinates:wt,scrollableAncestors:we,scrollableAncestorRects:He});const ve=s.useMemo(()=>({active:S,activeNode:$,activeNodeRect:ne,activatorEvent:A,collisions:yt,containerNodeRect:J,dragOverlay:ie,draggableNodes:j,droppableContainers:T,droppableRects:G,over:oe,measureDroppableContainers:Q,scrollableAncestors:we,scrollableAncestorRects:He,measuringConfiguration:I,measuringScheduled:H,windowRect:he}),[S,$,ne,A,yt,J,ie,j,T,G,oe,Q,we,He,I,H,he]),Oe=s.useMemo(()=>({activatorEvent:A,activators:_e,active:S,activeNodeRect:ne,ariaDescribedById:{draggable:N},dispatch:y,draggableNodes:j,over:oe,measureDroppableContainers:Q}),[A,_e,S,ne,y,N,j,oe,Q]);return s.createElement(Y9.Provider,{value:b},s.createElement(Ma.Provider,{value:Oe},s.createElement(gf.Provider,{value:ve},s.createElement(J1.Provider,{value:xe},c)),s.createElement(_E,{disabled:l?.restoreFocus===!1})),s.createElement(oE,{...l,hiddenTextDescribedById:N}))}),jE=s.createContext(null),z7="button";function yf(){return s.useContext(gf)}const ME={timeout:25};function RE(e){let{animation:t,children:n}=e;const[o,r]=s.useState(null),[i,l]=s.useState(null),d=E1(n);return n||o||!d||r(d),Hr(()=>{if(!i)return;const c=o?.key,u=o?.props.id;c!=null&&u!=null?Promise.resolve(t(u,i)).then(()=>{r(null)}):r(null)},[t,o,i]),s.createElement(s.Fragment,null,n,o?s.cloneElement(o,{ref:l}):null)}const IE={x:0,y:0,scaleX:1,scaleY:1};function DE(e){let{children:t}=e;return s.createElement(Ma.Provider,{value:mf},s.createElement(J1.Provider,{value:IE},t))}const LE={position:"fixed",touchAction:"none"},OE=e=>X1(e)?"transform 250ms ease":void 0,PE=s.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:l,rect:d,style:c,transform:u,transition:p=OE}=e;if(!d)return null;const f=r?u:{...u,scaleX:1,scaleY:1},h={...LE,width:d.width,height:d.height,top:d.top,left:d.left,transform:fi.Transform.toString(f),transformOrigin:r&&o?rE(o,d):void 0,transition:typeof p=="function"?p(o):p,...c};return s.createElement(n,{className:l,style:h,ref:t},i)}),bf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fi.Transform.toString(t)},{transform:fi.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:l}=e;if(i!=null&&i.active)for(const[d,c]of Object.entries(i.active))c!==void 0&&(r[d]=n.node.style.getPropertyValue(d),n.node.style.setProperty(d,c));if(i!=null&&i.dragOverlay)for(const[d,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(d,c);return l!=null&&l.active&&n.node.classList.add(l.active),l!=null&&l.dragOverlay&&o.node.classList.add(l.dragOverlay),function(){for(const[d,c]of Object.entries(r))n.node.style.setProperty(d,c);l!=null&&l.active&&n.node.classList.remove(l.active)}})({styles:{active:{opacity:"0"}}})};let B7=0;const AE=s.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:l,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:m,draggableNodes:g,droppableContainers:x,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:k,windowRect:E}=yf(),R=s.useContext(J1),j=function(S){return s.useMemo(()=>{if(S!=null)return B7++,B7},[S])}(f?.id),B=xf(l,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:k,transform:R,windowRect:E}),T=v2(h),_=function(S){let{config:O,draggableNodes:P,droppableContainers:M,measuringConfiguration:A}=S;return K1((D,L)=>{if(O===null)return;const N=P.get(D);if(!N)return;const W=N.node.current;if(!W)return;const I=ff(L);if(!I)return;const{transform:U}=nr(L).getComputedStyle(L),G=tf(U);if(!G)return;const Q=typeof O=="function"?O:function(H){const{duration:$,easing:F,sideEffects:X,keyframes:K}={...bf,...H};return ne=>{let{active:J,dragOverlay:re,transform:fe,...ie}=ne;if(!$)return;const ee=re.rect.left-J.rect.left,pe=re.rect.top-J.rect.top,Te={scaleX:fe.scaleX!==1?J.rect.width*fe.scaleX/re.rect.width:1,scaleY:fe.scaleY!==1?J.rect.height*fe.scaleY/re.rect.height:1},Ae={x:fe.x-ee,y:fe.y-pe,...Te},ae=K({...ie,active:J,dragOverlay:re,transform:{initial:fe,final:Ae}}),[he]=ae,we=ae[ae.length-1];if(JSON.stringify(he)===JSON.stringify(we))return;const He=X?.({active:J,dragOverlay:re,...ie}),Ye=re.node.animate(ae,{duration:$,easing:F,fill:"forwards"});return new Promise(wt=>{Ye.onfinish=()=>{He?.(),wt()}})}}(O);return cf(W,A.draggable.measure),Q({active:{id:D,data:N.data,node:W,rect:A.draggable.measure(W)},draggableNodes:P,dragOverlay:{node:L,rect:A.dragOverlay.measure(I)},droppableContainers:M,measuringConfiguration:A,transform:G})})}({config:o,draggableNodes:g,droppableContainers:x,measuringConfiguration:b}),w=T?y.setRef:void 0;return s.createElement(DE,null,s.createElement(RE,{animation:_},f&&j?s.createElement(PE,{key:j,id:f.id,ref:w,as:d,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:T,style:{zIndex:u,...r},transform:B},n):null))});function bu(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function FE(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Cs(e){return e!==null&&e>=0}const ks={scaleX:1,scaleY:1},zE=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:l}=e;const d=(t=n[r])!=null?t:o;if(!d)return null;const c=function(u,p,f){const h=u[p],m=u[p-1],g=u[p+1];return h&&(m||g)?f<p?m?h.left-(m.left+m.width):g.left-(h.left+h.width):g?g.left-(h.left+h.width):h.left-(m.left+m.width):0}(n,l,r);if(l===r){const u=n[i];return u?{x:r<i?u.left+u.width-(d.left+d.width):u.left-d.left,y:0,...ks}:null}return l>r&&l<=i?{x:-d.width-c,y:0,...ks}:l<r&&l>=i?{x:d.width+c,y:0,...ks}:{x:0,y:0,...ks}},vu=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=bu(t,o,n),l=t[r],d=i[r];return d&&l?{x:d.left-l.left,y:d.top-l.top,scaleX:d.width/l.width,scaleY:d.height/l.height}:null},vf="Sortable",wf=s.createContext({activeIndex:-1,containerId:vf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vu,disabled:{draggable:!1,droppable:!1}});function BE(e){let{children:t,id:n,items:o,strategy:r=vu,disabled:i=!1}=e;const{active:l,dragOverlay:d,droppableRects:c,over:u,measureDroppableContainers:p}=yf(),f=_a(vf,n),h=d.rect!==null,m=s.useMemo(()=>o.map(R=>typeof R=="object"&&"id"in R?R.id:R),[o]),g=l!=null,x=l?m.indexOf(l.id):-1,y=u?m.indexOf(u.id):-1,v=s.useRef(m),b=!function(R,j){if(R===j)return!0;if(R.length!==j.length)return!1;for(let B=0;B<R.length;B++)if(R[B]!==j[B])return!1;return!0}(m,v.current),C=y!==-1&&x===-1||b,k=function(R){return typeof R=="boolean"?{draggable:R,droppable:R}:R}(i);Hr(()=>{b&&g&&p(m)},[b,m,g,p]),s.useEffect(()=>{v.current=m},[m]);const E=s.useMemo(()=>({activeIndex:x,containerId:f,disabled:k,disableTransforms:C,items:m,overIndex:y,useDragOverlay:h,sortedRects:FE(m,c),strategy:r}),[x,f,k.draggable,k.droppable,C,m,y,c,h,r]);return s.createElement(wf.Provider,{value:E},t)}const NE=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bu(n,o,r).indexOf(t)},VE=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:l,previousItems:d,previousContainerId:c,transition:u}=e;return!(!u||!o||d!==i&&r===l||!n&&(l===r||t!==c))},HE={duration:200,easing:"ease"},Sf="transform",$E=fi.Transition.toString({property:Sf,duration:0,easing:"linear"}),WE={roleDescription:"sortable"};function UE(e){let{animateLayoutChanges:t=VE,attributes:n,disabled:o,data:r,getNewIndex:i=NE,id:l,strategy:d,resizeObserverConfig:c,transition:u=HE}=e;const{items:p,containerId:f,activeIndex:h,disabled:m,disableTransforms:g,sortedRects:x,overIndex:y,useDragOverlay:v,strategy:b}=s.useContext(wf),C=function(re,fe){var ie,ee;return typeof re=="boolean"?{draggable:re,droppable:!1}:{draggable:(ie=re?.draggable)!=null?ie:fe.draggable,droppable:(ee=re?.droppable)!=null?ee:fe.droppable}}(o,m),k=p.indexOf(l),E=s.useMemo(()=>({sortable:{containerId:f,index:k,items:p},...r}),[f,r,k,p]),R=s.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:j,node:B,isOver:T,setNodeRef:_}=function(re){let{data:fe,disabled:ie=!1,id:ee,resizeObserverConfig:pe}=re;const Te=_a("Droppable"),{active:Ae,dispatch:ae,over:he,measureDroppableContainers:we}=s.useContext(Ma),He=s.useRef({disabled:ie}),Ye=s.useRef(!1),wt=s.useRef(null),Ct=s.useRef(null),{disabled:Ee,updateMeasurementsFor:Ie,timeout:ft}={...ME,...pe},$e=ia(Ie??ee),yt=M1({callback:s.useCallback(()=>{Ye.current?(Ct.current!=null&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{we(Array.isArray($e.current)?$e.current:[$e.current]),Ct.current=null},ft)):Ye.current=!0},[ft]),disabled:Ee||!Ae}),tt=s.useCallback((be,te)=>{yt&&(te&&(yt.unobserve(te),Ye.current=!1),be&&yt.observe(be))},[yt]),[oe,Ve]=Zs(tt),xe=ia(fe);return s.useEffect(()=>{yt&&oe.current&&(yt.disconnect(),Ye.current=!1,yt.observe(oe.current))},[oe,yt]),s.useEffect(()=>(ae({type:jo.RegisterDroppable,element:{id:ee,key:Te,disabled:ie,node:oe,rect:wt,data:xe}}),()=>ae({type:jo.UnregisterDroppable,key:Te,id:ee})),[ee]),s.useEffect(()=>{ie!==He.current.disabled&&(ae({type:jo.SetDroppableDisabled,id:ee,key:Te,disabled:ie}),He.current.disabled=ie)},[ee,Te,ie,ae]),{active:Ae,rect:wt,isOver:he?.id===ee,node:oe,over:he,setNodeRef:Ve}}({id:l,data:E,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...c}}),{active:w,activatorEvent:S,activeNodeRect:O,attributes:P,setNodeRef:M,listeners:A,isDragging:D,over:L,setActivatorNodeRef:N,transform:W}=function(re){let{id:fe,data:ie,disabled:ee=!1,attributes:pe}=re;const Te=_a("Draggable"),{activators:Ae,activatorEvent:ae,active:he,activeNodeRect:we,ariaDescribedById:He,draggableNodes:Ye,over:wt}=s.useContext(Ma),{role:Ct=z7,roleDescription:Ee="draggable",tabIndex:Ie=0}=pe??{},ft=he?.id===fe,$e=s.useContext(ft?J1:jE),[yt,tt]=Zs(),[oe,Ve]=Zs(),xe=function(te,Me){return s.useMemo(()=>te.reduce((_e,ve)=>{let{eventName:Oe,handler:Y}=ve;return _e[Oe]=se=>{Y(se,Me)},_e},{}),[te,Me])}(Ae,fe),be=ia(ie);return Hr(()=>(Ye.set(fe,{id:fe,key:Te,node:yt,activatorNode:oe,data:be}),()=>{const te=Ye.get(fe);te&&te.key===Te&&Ye.delete(fe)}),[Ye,fe]),{active:he,activatorEvent:ae,activeNodeRect:we,attributes:s.useMemo(()=>({role:Ct,tabIndex:Ie,"aria-disabled":ee,"aria-pressed":!(!ft||Ct!==z7)||void 0,"aria-roledescription":Ee,"aria-describedby":He.draggable}),[ee,Ct,Ie,ft,Ee,He.draggable]),isDragging:ft,listeners:ee?void 0:xe,node:yt,over:wt,setNodeRef:tt,setActivatorNodeRef:Ve,transform:$e}}({id:l,data:E,attributes:{...WE,...n},disabled:C.draggable}),I=function(){for(var re=arguments.length,fe=new Array(re),ie=0;ie<re;ie++)fe[ie]=arguments[ie];return s.useMemo(()=>ee=>{fe.forEach(pe=>pe(ee))},fe)}(_,M),U=!!w,G=U&&!g&&Cs(h)&&Cs(y),Q=!v&&D,H=G?(Q&&G?W:null)??(d??b)({rects:x,activeNodeRect:O,activeIndex:h,overIndex:y,index:k}):null,$=Cs(h)&&Cs(y)?i({id:l,items:p,activeIndex:h,overIndex:y}):k,F=w?.id,X=s.useRef({activeId:F,items:p,newIndex:$,containerId:f}),K=p!==X.current.items,ne=t({active:w,containerId:f,isDragging:D,isSorting:U,id:l,index:k,items:p,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:u,wasDragging:X.current.activeId!=null}),J=function(re){let{disabled:fe,index:ie,node:ee,rect:pe}=re;const[Te,Ae]=s.useState(null),ae=s.useRef(ie);return Hr(()=>{if(!fe&&ie!==ae.current&&ee.current){const he=pe.current;if(he){const we=dl(ee.current,{ignoreTransform:!0}),He={x:he.left-we.left,y:he.top-we.top,scaleX:he.width/we.width,scaleY:he.height/we.height};(He.x||He.y)&&Ae(He)}}ie!==ae.current&&(ae.current=ie)},[fe,ie,ee,pe]),s.useEffect(()=>{Te&&Ae(null)},[Te]),Te}({disabled:!ne,index:k,node:B,rect:j});return s.useEffect(()=>{U&&X.current.newIndex!==$&&(X.current.newIndex=$),f!==X.current.containerId&&(X.current.containerId=f),p!==X.current.items&&(X.current.items=p)},[U,$,f,p]),s.useEffect(()=>{if(F===X.current.activeId)return;if(F!=null&&X.current.activeId==null)return void(X.current.activeId=F);const re=setTimeout(()=>{X.current.activeId=F},50);return()=>clearTimeout(re)},[F]),{active:w,activeIndex:h,attributes:P,data:E,rect:j,index:k,newIndex:$,items:p,isOver:T,isSorting:U,isDragging:D,listeners:A,node:B,overIndex:y,over:L,setNodeRef:I,setActivatorNodeRef:N,setDroppableNodeRef:_,setDraggableNodeRef:M,transform:J??H,transition:J||K&&X.current.newIndex===k?$E:Q&&!X1(S)||!u||!U&&!ne?void 0:fi.Transition.toString({...u,property:Sf})}}function R1(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 qE=[jn.Down,jn.Right,jn.Up,jn.Left],ZE=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:l,scrollableAncestors:d}}=t;if(qE.includes(e.code)){if(e.preventDefault(),!n||!o)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=r.get(f.id);if(h)switch(e.code){case jn.Down:o.top<h.top&&c.push(f);break;case jn.Up:o.top>h.top&&c.push(f);break;case jn.Left:o.left>h.left&&c.push(f);break;case jn.Right:o.left<h.left&&c.push(f)}});const u=(f=>{let{collisionRect:h,droppableRects:m,droppableContainers:g}=f;const x=E7(h),y=[];for(const v of g){const{id:b}=v,C=m.get(b);if(C){const k=E7(C),E=x.reduce((j,B,T)=>j+J9(k[T],B),0),R=Number((E/4).toFixed(4));y.push({id:b,data:{droppableContainer:v,value:R}})}}return y.sort(Q9)})({collisionRect:o,droppableRects:r,droppableContainers:c});let p=ef(u,"id");if(p===l?.id&&u.length>1&&(p=u[1].id),p!=null){const f=i.get(n.id),h=i.get(p),m=h?r.get(h.id):null,g=h?.node.current;if(g&&m&&f&&h){const x=Y1(g).some((k,E)=>d[E]!==k),y=N7(f,h),v=function(k,E){return!!(R1(k)&&R1(E)&&N7(k,E))&&k.data.current.sortable.index<E.data.current.sortable.index}(f,h),b=x||!y?{x:0,y:0}:{x:v?o.width-m.width:0,y:v?o.height-m.height:0},C={x:m.left,y:m.top};return b.x&&b.y?C:Ta(C,b)}}}};function N7(e,t){return!(!R1(e)||!R1(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const GE=e=>{let{transform:t}=e;return{...t,y:0}},KE=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:l,editable:d,selectedIndex:c,background:u,activeColor:p,borderColor:f,borderWidth:h,dragging:m,...g}=e;return a.jsxs("div",{ref:t,className:cr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...g,children:[a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[a.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?a.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):a.jsx(a.Fragment,{})]}),a.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Br={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},Cf=s.memo(s.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:l,index:d,listeners:c,onRemove:u,renderItem:p,sorting:f,style:h,transition:m,transform:g,value:x,wrapperStyle:y,...v},b)=>{s.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const C=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!f,index:d,fadeIn:!!r,listeners:c,ref:b,style:h,transform:g,transition:m,value:x}):a.jsx(a.Fragment,{children:x});return a.jsx("div",{className:cr("tab-item",Br.Wrapper,r&&Br.fadeIn,f&&Br.sorting,t&&Br.dragOverlay),style:{...y,transition:[m,y?.transition].filter(Boolean).join(", "),"--translate-x":g?`${Math.round(g.x)}px`:void 0,"--translate-y":g?`${Math.round(g.y)}px`:void 0,"--scale-x":g?.scaleX?`${g.scaleX}`:void 0,"--scale-y":g?.scaleY?`${g.scaleY}`:void 0,"--index":d},ref:b,children:a.jsx("div",{className:cr(Br.Item,n&&Br.dragging,i&&Br.withHandle,t&&Br.dragOverlay,o&&Br.disabled,e&&Br.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...v,tabIndex:i?void 0:-1,children:C})})})),V7={Row:"_Row_1kr10_1"},XE=s.memo(s.forwardRef(({children:e,horizontal:t,style:n},o)=>a.jsx("div",{ref:o,style:{...n},className:cr(V7.Row,t&&V7.horizontal),children:e}))),YE={...bf},JE=s.memo(s.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:l=lE,coordinateGetter:d=ZE,dropAnimation:c=YE,getItemStyles:u=()=>({}),getNewIndex:p,handle:f=!1,items:h,onMove:m,isDisabled:g=()=>!1,measuring:x,modifiers:y,renderItem:v,renderDivider:b,reorderItems:C=bu,strategy:k=vu,style:E,useDragOverlay:R=!0,onDragStart:j,wrapperStyle:B=()=>({})}=e,[T,_]=s.useState(()=>h);s.useEffect(()=>{_(h)},[h]);const[w,S]=s.useState(null),O=function(){for(var L=arguments.length,N=new Array(L),W=0;W<L;W++)N[W]=arguments[W];return s.useMemo(()=>[...N].filter(I=>I!=null),[...N])}(od(hf,{activationConstraint:o}),od(pf,{activationConstraint:o}),od(xu,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:d})),P=T.indexOf.bind(T),M=w?P(w):-1,A=[];T.map((L,N)=>{A.push(a.jsx(QE,{id:L,handle:f,index:N,style:u,wrapperStyle:B,disabled:g(L),renderItem:v,animateLayoutChanges:r,useDragOverlay:R,getNewIndex:p},L+"-"+N));const W=b?.({key:"divider-"+N});W&&A.push(W)});const{getPortalContainer:D}=(s.useEffect(()=>{function L(){const N=document.fullscreenElement;if(!N)return;let W=N.querySelector(".fullscreen-portal-root");W||(W=document.createElement("div"),W.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",N.appendChild(W))}return Ja++,L(),document.addEventListener("fullscreenchange",L),()=>{document.removeEventListener("fullscreenchange",L),Ja--,Ja<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(N=>{N.parentNode&&N.parentNode.removeChild(N)}),Ja=0)}},[]),{getPortalContainer:kg});return a.jsxs(TE,{sensors:O,collisionDetection:l,onDragStart:L=>{const{active:N}=L;N&&(j?.(L),S(N.id))},autoScroll:{canScroll:L=>!0},onDragEnd:L=>{if(S(null),L.over){const N=P(L.over.id);M!==N&&(_(W=>C(W,M,N)),m?.(M,N))}},onDragCancel:()=>{S(null)},measuring:x,modifiers:y,children:[a.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...E},className:cr(n,Br.Wrapper),children:a.jsx(BE,{items:T,strategy:k,children:a.jsx(XE,{ref:t,children:A})})}),R?wo.createPortal(a.jsx(AE,{adjustScale:i,dropAnimation:c,children:w?a.jsx(Cf,{value:T[M],handle:f,renderItem:v,wrapperStyle:B({index:M,isDragging:!0,id:T[M]}),index:M,dragging:!0,style:u({id:T[M],index:M,isSorting:w!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),D()):null]})}));function QE({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:l,style:d,renderItem:c,useDragOverlay:u,wrapperStyle:p}){const{attributes:f,isDragging:h,isSorting:m,listeners:g,overIndex:x,setNodeRef:y,transform:v,transition:b}=UE({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return a.jsx(Cf,{ref:y,value:r,disabled:e,dragging:h,sorting:m,handle:o,renderItem:c,index:i,style:d({index:i,id:r,isDragging:h,isSorting:m,overIndex:x}),onRemove:l?()=>l(r):void 0,transform:v,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:g,"data-index":i,"data-id":r,dragOverlay:!u&&h,...f})}const e_=new z.Color("rgb(33, 115, 70)"),t_="#eee",n_=e=>a.jsx(KE,{...e}),kf=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:l=[],onSelectedTabIndexChange:d,onTabNameChange:c,onTabMove:u,createScrollStartButton:p=N8,createScrollEndButton:f=V8,createScrollEdgeButton:h=cg,createTabButton:m=n_,createTabDivider:g,editLabelProps:x,disabled:y=!1,disableDrag:v=!1,background:b="white",activeColor:C=e_,borderColor:k=t_,borderWidth:E=1}=e,[R,j]=s.useState(i),[B,T]=s.useState(l),_=s.useCallback(Ae=>{const ae=D.current?.[Ae]?.closest(".tab-item")??D.current?.[Ae];ae&&Q.current?.scrollTo({top:ae.offsetTop,left:ae.offsetLeft,behavior:"smooth"})},[]);s.useEffect(()=>{_(i)},[i]);const w=s.useCallback((Ae,ae)=>{ae!==R&&(j(ae),d?.(ae)),_(ae)},[d,R]),S=s.useCallback((Ae,ae)=>{u?.(Ae,ae)},[u]),O=s.useRef(null),[P,M]=s.useState(-1),A=s.useCallback((Ae,ae)=>{c?.(Ae,ae)},[c]);s.useLayoutEffect(()=>{j(i)},[i]),s.useLayoutEffect(()=>{T(l)},[l]);const D=s.useRef([]),L=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign({startEdit(Ae){D.current?.[Ae]?.startEdit()},cancel(Ae){D.current?.[Ae]?.cancel()}},L.current),[R,P]);const N=s.useCallback(({value:Ae,index:ae,dragging:he})=>{const{style:we,maxLength:He,...Ye}=x||{},wt=a.jsx(Xk,{ref:Ct=>{D.current[ae]=Ct},value:Ae,disabled:y,maxLength:He,style:{color:R===ae&&C?C?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...we},styleHover:{},onSubmit:Ct=>(O.current=!1,M(-1),A(ae,Ct)),onCancel:()=>{O.current=!1,M(-1)},onChange:Ct=>{O.current=!0,M(ae)},...Ye});return m({onClick:Ct=>w(Ct,ae),value:Ae,index:ae,editing:P===ae&&O.current,editable:!0,disabled:y,selectedIndex:R,background:b,activeColor:C,borderColor:k,borderWidth:E,dragging:he,children:wt})},[R,A,w,x,y,P,m]),[W,{width:I}]=pi(),[U,{width:G}]=pi(),Q=s.useRef(null),[H,$]=s.useState({left:0,top:0,width:0,height:0}),[F,X]=s.useState(null);s.useEffect(()=>{F!==null&&Q.current&&Q.current.scrollTo({left:F,behavior:"smooth"})},[F]);const K=s.useCallback((Ae,ae=!1)=>{if(!Q.current)return 0;let he=Q.current.firstChild.getBoundingClientRect(),we=Q.current.firstChild.firstChild.children,He=0;return He=ae?0:k5.getScrollTo(Ae,he.left,we,!0,Math.max(0,Ae-200)),X(He),Math.max(0,He)},[]),ne=s.useCallback((Ae,ae=!1)=>{if(!Q.current)return 0;let he=Q.current.firstChild.getBoundingClientRect(),we=Q.current.firstChild.firstChild.children,He=0;const Ye=Math.ceil(G-I);return He=ae?Ye:k5.getScrollTo(Ae,he.left,we,!1,Math.max(0,Ae+200)),X(He),Math.min(Ye,He)},[G,I]),J=s.useRef(null),re=s.useRef(null),fe=s.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null,J.current=null)},[]),ie=s.useCallback((Ae,ae,he=260)=>{J.current=Ae,re.current=setTimeout(()=>{const we=ae?K(J.current||Ae):ne(J.current||Ae);we!==J.current?ie(we,ae,120):fe()},he)},[K,ne,fe]);s.useEffect(()=>()=>fe(),[fe]);const ee=s.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(H.left)<=0||Math.floor(G-I)===0,orientation:zo.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>ie(Q.current.scrollLeft,!0),onClick:Ae=>K(Math.min(Q.current.scrollLeft,F??Number.MAX_SAFE_INTEGER),Ae.ctrlKey)}),[H,F,G,I]),pe=s.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(G-I)<=Math.ceil(H.left),orientation:zo.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>ie(Q.current.scrollLeft,!1),onClick:Ae=>ne(Math.max(Q.current.scrollLeft,F??0),Ae.ctrlKey)}),[H,F,G,I]),Te=s.useMemo(()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{minWidth:"16px"}}),n,h?.(ee)]}),[ee,pe,p,f,n,h]);return a.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:cr("_TabStrip_3x0dp_1",r),ref:L,children:[a.jsx("div",{style:{borderTop:`solid ${k} ${E}px`,position:"absolute",width:"100%"}}),a.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Te}),a.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:a.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Q,onScroll:Ae=>{$({left:Ae.target.scrollLeft,top:Ae.target.scrollTop,width:Ae.target.scrollWidth,height:Ae.target.scrollHeight})},children:a.jsx(JE,{isDisabled:Ae=>y||v,items:B,strategy:zE,modifiers:[GE],ref:U,renderItem:N,renderDivider:g,onMove:S,activationConstraint:{distance:15}})})}),a.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(pe)})]})}));kf.displayName="TabStrip";const o_=s.createContext(null),wu=()=>{const e=s.useContext(o_),[t]=s.useState(()=>new z.ThemeCollection);return s.useMemo(()=>e||t,[e])},r_=s.lazy(()=>Promise.resolve().then(()=>require("./5Ny9bRWrQUPFU3rr.cjs"))),i_={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"},H7=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),l=await i.getNavigationTree(o.uri.toString()),d=e.getPosition();let c={...d};c.lineNumber=1,c.column=1;let u=!1;for(let x=d.lineNumber;x>=1;x--)if(o.getLineContent(x).trim()===""){const y=Su(l,o.getOffsetAt({lineNumber:x,column:1}),"function");if(!y||a_(y)){u=!0,c.lineNumber=x+1;break}{const v=y.spans[0].start;x=o.getPositionAt(v).lineNumber,c.lineNumber=x}}let p=n,f=!1;!u&&!p.startsWith(`
|
|
76
|
+
`},nE={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 oE(e){let{announcements:t=nE,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=tE}=e;const{announce:i,announcement:l}=function(){const[f,h]=s.useState("");return{announce:s.useCallback(m=>{m!=null&&h(m)},[]),announcement:f}}(),d=_a("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),function(f){const h=s.useContext(Y9);s.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(f)},[f,h])}(s.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:m}=f;t.onDragMove&&i(t.onDragMove({active:h,over:m}))},onDragOver(f){let{active:h,over:m}=f;i(t.onDragOver({active:h,over:m}))},onDragEnd(f){let{active:h,over:m}=f;i(t.onDragEnd({active:h,over:m}))},onDragCancel(f){let{active:h,over:m}=f;i(t.onDragCancel({active:h,over:m}))}}),[i,t])),!c)return null;const p=s.createElement(s.Fragment,null,s.createElement(Qk,{id:o,value:r.draggable}),s.createElement(eE,{id:d,announcement:l}));return n?wo.createPortal(p,n):p}var jo;function T1(){}function od(e,t){return s.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"})(jo||(jo={}));const Wr=Object.freeze({x:0,y:0});function J9(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rE(e,t){const n=_1(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Q9(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function iE(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function E7(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ef(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _7(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 lE=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=_7(t,t.left,t.top),i=[];for(const l of o){const{id:d}=l,c=n.get(d);if(c){const u=J9(_7(c),r);i.push({id:d,data:{droppableContainer:l,value:u}})}}return i.sort(Q9)};function aE(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,d=i-n;if(o<r&&n<i){const c=t.width*t.height,u=e.width*e.height,p=l*d;return Number((p/(c+u-p)).toFixed(4))}return 0}const sE=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:l}=i,d=n.get(l);if(d){const c=aE(d,t);c>0&&r.push({id:l,data:{droppableContainer:i,value:c}})}}return r.sort(iE)};function T7(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Wr}const cE=function(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...t})}}(1);function tf(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 dE={ignoreTransform:!1};function dl(e,t){t===void 0&&(t=dE);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:p}=nr(e).getComputedStyle(e);u&&(n=function(f,h,m){const g=tf(h);if(!g)return f;const{scaleX:x,scaleY:y,x:v,y:b}=g,C=f.left-v-(1-x)*parseFloat(m),k=f.top-b-(1-y)*parseFloat(m.slice(m.indexOf(" ")+1)),E=x?f.width/x:f.width,R=y?f.height/y:f.height;return{width:E,height:R,top:k,right:C+E,bottom:k+R,left:C}}(n,u,p))}const{top:o,left:r,width:i,height:l,bottom:d,right:c}=n;return{top:o,left:r,width:i,height:l,bottom:d,right:c}}function j7(e){return dl(e,{ignoreTransform:!0})}function Y1(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(gu(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Va(r)||K9(r)||n.includes(r))return n;const i=nr(e).getComputedStyle(r);return r!==e&&function(c,u){u===void 0&&(u=nr(c).getComputedStyle(c));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(f=>{const h=u[f];return typeof h=="string"&&p.test(h)})}(r,i)&&n.push(r),l=r,(d=i)===void 0&&(d=nr(l).getComputedStyle(l)),d.position==="fixed"?n:o(r.parentNode);var l,d}(e):n}function nf(e){const[t]=Y1(e,1);return t??null}function rd(e){return G1&&e?cl(e)?e:mu(e)?gu(e)||e===nl(e).scrollingElement?window:Va(e)?e:null:null:null}function of(e){return cl(e)?e.scrollX:e.scrollLeft}function rf(e){return cl(e)?e.scrollY:e.scrollTop}function g2(e){return{x:of(e),y:rf(e)}}var Lo;function lf(e){return!(!G1||!e)&&e===document.scrollingElement}function af(e){const t={x:0,y:0},n=lf(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Lo||(Lo={}));const uE={x:.2,y:.2};function hE(e,t,n,o,r){let{top:i,left:l,right:d,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=uE);const{isTop:u,isBottom:p,isLeft:f,isRight:h}=af(e),m={x:0,y:0},g={x:0,y:0},x=t.height*r.y,y=t.width*r.x;return!u&&i<=t.top+x?(m.y=Lo.Backward,g.y=o*Math.abs((t.top+x-i)/x)):!p&&c>=t.bottom-x&&(m.y=Lo.Forward,g.y=o*Math.abs((t.bottom-x-c)/x)),!h&&d>=t.right-y?(m.x=Lo.Forward,g.x=o*Math.abs((t.right-y-d)/y)):!f&&l<=t.left+y&&(m.x=Lo.Backward,g.x=o*Math.abs((t.left+y-l)/y)),{direction:m,speed:g}}function pE(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function sf(e){return e.reduce((t,n)=>zi(t,g2(n)),Wr)}function cf(e,t){if(t===void 0&&(t=dl),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);nf(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fE=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+of(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+rf(n),0)}]];class x2{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 o=Y1(n),r=sf(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,l,d]of fE)for(const c of l)Object.defineProperty(this,c,{get:()=>{const u=d(o),p=r[i]-u;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class la{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function id(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Er,jn;function M7(e){e.preventDefault()}function mE(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"})(Er||(Er={})),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"}(jn||(jn={}));const df={start:[jn.Space,jn.Enter],cancel:[jn.Esc],end:[jn.Space,jn.Enter,jn.Tab]},gE=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case jn.Right:return{...n,x:n.x+25};case jn.Left:return{...n,x:n.x-25};case jn.Down:return{...n,y:n.y+25};case jn.Up:return{...n,y:n.y-25}}};class xu{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 la(nl(n)),this.windowListeners=new la(nr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Er.Resize,this.handleCancel),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&cf(o),n(Wr)}handleKeyDown(t){if(X1(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=df,coordinateGetter:l=gE,scrollBehavior:d="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:u}=o.current,p=u?{x:u.left,y:u.top}:Wr;this.referenceCoordinates||(this.referenceCoordinates=p);const f=l(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=Ta(f,p),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const x of g){const y=t.code,{isTop:v,isRight:b,isLeft:C,isBottom:k,maxScroll:E,minScroll:R}=af(x),j=pE(x),B={x:Math.min(y===jn.Right?j.right-j.width/2:j.right,Math.max(y===jn.Right?j.left:j.left+j.width/2,f.x)),y:Math.min(y===jn.Down?j.bottom-j.height/2:j.bottom,Math.max(y===jn.Down?j.top:j.top+j.height/2,f.y))},T=y===jn.Right&&!b||y===jn.Left&&!C,_=y===jn.Down&&!k||y===jn.Up&&!v;if(T&&B.x!==f.x){const w=x.scrollLeft+h.x,S=y===jn.Right&&w<=E.x||y===jn.Left&&w>=R.x;if(S&&!h.y)return void x.scrollTo({left:w,behavior:d});m.x=S?x.scrollLeft-w:y===jn.Right?x.scrollLeft-E.x:x.scrollLeft-R.x,m.x&&x.scrollBy({left:-m.x,behavior:d});break}if(_&&B.y!==f.y){const w=x.scrollTop+h.y,S=y===jn.Down&&w<=E.y||y===jn.Up&&w>=R.y;if(S&&!h.x)return void x.scrollTo({top:w,behavior:d});m.y=S?x.scrollTop-w:y===jn.Down?x.scrollTop-E.y:x.scrollTop-R.y,m.y&&x.scrollBy({top:-m.y,behavior:d});break}}this.handleMove(t,zi(Ta(f,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(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 R7(e){return!(!e||!("distance"in e))}function I7(e){return!(!e||!("delay"in e))}xu.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=df,onActivation:r}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(o.start.includes(l)){const d=i.activatorNode.current;return!(d&&e.target!==d||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class yu{constructor(t,n,o){var r;o===void 0&&(o=function(d){const{EventTarget:c}=nr(d);return d instanceof c?d:nl(d)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=nl(l),this.documentListeners=new la(this.document),this.listeners=new la(o),this.windowListeners=new la(nr(l)),this.initialCoordinates=(r=_1(i))!=null?r:Wr,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:o}}}=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(Er.Resize,this.handleCancel),this.windowListeners.add(Er.DragStart,M7),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),this.windowListeners.add(Er.ContextMenu,M7),this.documentListeners.add(Er.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(I7(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(R7(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:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Er.Click,mE,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Er.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:l,options:{activationConstraint:d}}=i;if(!r)return;const c=(n=_1(t))!=null?n:Wr,u=Ta(r,c);if(!o&&d){if(R7(d)){if(d.tolerance!=null&&id(u,d.tolerance))return this.handleCancel();if(id(u,d.distance))return this.handleStart()}return I7(d)&&id(u,d.tolerance)?this.handleCancel():void this.handlePending(d,u)}t.cancelable&&t.preventDefault(),l(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===jn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uf extends yu{constructor(t){const{event:n}=t,o=nl(n.target);super(t,xE,o)}}uf.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const yE={move:{name:"mousemove"},end:{name:"mouseup"}};var y2;(function(e){e[e.RightClick=2]="RightClick"})(y2||(y2={}));class hf extends yu{constructor(t){super(t,yE,nl(t.event.target))}}hf.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==y2.RightClick&&(o?.({event:n}),!0)}}];const ld={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pf extends yu{constructor(t){super(t,ld)}static setup(){return window.addEventListener(ld.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ld.move.name,t)};function t(){}}}var aa,j1;pf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(aa||(aa={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(j1||(j1={}));const bE={x:{[Lo.Backward]:!1,[Lo.Forward]:!1},y:{[Lo.Backward]:!1,[Lo.Forward]:!1}};var ja,b2;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ja||(ja={})),(b2||(b2={})).Optimized="optimized";const D7=new Map;function v2(e,t){return Yl(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function M1(e){let{callback:t,disabled:n}=e;const o=K1(t),r=s.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return s.useEffect(()=>()=>r?.disconnect(),[r]),r}function vE(e){return new x2(dl(e),e)}function L7(e,t,n){t===void 0&&(t=vE);const[o,r]=s.useState(null);function i(){r(c=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=c??n)!=null?u:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const l=function(c){let{callback:u,disabled:p}=c;const f=K1(u),h=s.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:m}=window;return new m(f)},[f,p]);return s.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const u of c){const{type:p,target:f}=u;if(p==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),d=M1({callback:i});return Hr(()=>{i(),e?(d?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),l?.disconnect())},[e]),o}const O7=[];function P7(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const o=e!==Wr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Ta(e,n.current):Wr}function A7(e){return s.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const F7=[];function ff(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Va(t)?t:e}const wE=[{sensor:uf,options:{}},{sensor:xu,options:{}}],SE={current:{}},Gs={draggable:{measure:j7},droppable:{measure:j7,strategy:ja.WhileDragging,frequency:b2.Optimized},dragOverlay:{measure:dl}};class sa 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,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const CE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sa,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:T1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Gs,measureDroppableContainers:T1,windowRect:null,measuringScheduled:!1},mf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:T1,draggableNodes:new Map,over:null,measureDroppableContainers:T1},Ma=s.createContext(mf),gf=s.createContext(CE);function kE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sa}}}function EE(e,t){switch(t.type){case jo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case jo.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 jo.DragEnd:case jo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case jo.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new sa(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case jo.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const l=new sa(e.droppable.containers);return l.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:l}}}case jo.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new sa(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function _E(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=s.useContext(Ma),i=E1(o),l=E1(n?.id);return s.useEffect(()=>{if(!t&&!o&&i&&l!=null){if(!X1(i)||document.activeElement===i.target)return;const d=r.get(l);if(!d)return;const{activatorNode:c,node:u}=d;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const p of[c.current,u.current]){if(!p)continue;const f=Yk(p);if(f){f.focus();break}}})}},[o,t,r,l,i]),null}function xf(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const J1=s.createContext({...Wr,scaleX:1,scaleY:1});var D0;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(D0||(D0={}));const TE=s.memo(function(e){var t,n,o,r;let{id:i,accessibility:l,autoScroll:d=!0,children:c,sensors:u=wE,collisionDetection:p=sE,measuring:f,modifiers:h,...m}=e;const g=s.useReducer(EE,void 0,kE),[x,y]=g,[v,b]=function(){const[Y]=s.useState(()=>new Set),se=s.useCallback(Ce=>(Y.add(Ce),()=>Y.delete(Ce)),[Y]);return[s.useCallback(Ce=>{let{type:Pe,event:Qe}=Ce;Y.forEach(Ge=>{var Be;return(Be=Ge[Pe])==null?void 0:Be.call(Ge,Qe)})},[Y]),se]}(),[C,k]=s.useState(D0.Uninitialized),E=C===D0.Initialized,{draggable:{active:R,nodes:j,translate:B},droppable:{containers:T}}=x,_=R!=null?j.get(R):null,w=s.useRef({initial:null,translated:null}),S=s.useMemo(()=>{var Y;return R!=null?{id:R,data:(Y=_?.data)!=null?Y:SE,rect:w}:null},[R,_]),O=s.useRef(null),[P,M]=s.useState(null),[A,D]=s.useState(null),L=ia(m,Object.values(m)),N=_a("DndDescribedBy",i),W=s.useMemo(()=>T.getEnabled(),[T]),I=s.useMemo(()=>({draggable:{...Gs.draggable,...U?.draggable},droppable:{...Gs.droppable,...U?.droppable},dragOverlay:{...Gs.dragOverlay,...U?.dragOverlay}}),[(U=f)==null?void 0:U.draggable,U?.droppable,U?.dragOverlay]);var U;const{droppableRects:G,measureDroppableContainers:Q,measuringScheduled:H}=function(Y,se){let{dragging:Ce,dependencies:Pe,config:Qe}=se;const[Ge,Be]=s.useState(null),{frequency:ot,measure:Ze,strategy:et}=Qe,mt=s.useRef(Y),pt=function(){switch(et){case ja.Always:return!1;case ja.BeforeDragging:return Ce;default:return!Ce}}(),it=ia(pt),Wt=s.useCallback(function(nn){nn===void 0&&(nn=[]),it.current||Be(bn=>bn===null?nn:bn.concat(nn.filter(kn=>!bn.includes(kn))))},[it]),qt=s.useRef(null),Vt=Yl(nn=>{if(pt&&!Ce)return D7;if(!nn||nn===D7||mt.current!==Y||Ge!=null){const bn=new Map;for(let kn of Y){if(!kn)continue;if(Ge&&Ge.length>0&&!Ge.includes(kn.id)&&kn.rect.current){bn.set(kn.id,kn.rect.current);continue}const Gn=kn.node.current,eo=Gn?new x2(Ze(Gn),Gn):null;kn.rect.current=eo,eo&&bn.set(kn.id,eo)}return bn}return nn},[Y,Ge,Ce,pt,Ze]);return s.useEffect(()=>{mt.current=Y},[Y]),s.useEffect(()=>{pt||Wt()},[Ce,pt]),s.useEffect(()=>{Ge&&Ge.length>0&&Be(null)},[JSON.stringify(Ge)]),s.useEffect(()=>{pt||typeof ot!="number"||qt.current!==null||(qt.current=setTimeout(()=>{Wt(),qt.current=null},ot))},[ot,pt,Wt,...Pe]),{droppableRects:Vt,measureDroppableContainers:Wt,measuringScheduled:Ge!=null}}(W,{dragging:E,dependencies:[B.x,B.y],config:I.droppable}),$=function(Y,se){const Ce=se!=null?Y.get(se):void 0,Pe=Ce?Ce.node.current:null;return Yl(Qe=>{var Ge;return se==null?null:(Ge=Pe??Qe)!=null?Ge:null},[Pe,se])}(j,R),F=s.useMemo(()=>A?_1(A):null,[A]),X=function(){const Y=P?.autoScrollEnabled===!1,se=typeof d=="object"?d.enabled===!1:d===!1,Ce=E&&!Y&&!se;return typeof d=="object"?{...d,enabled:Ce}:{enabled:Ce}}(),K=function(Y,se){return v2(Y,se)}($,I.draggable.measure);(function(Y){let{activeNode:se,measure:Ce,initialRect:Pe,config:Qe=!0}=Y;const Ge=s.useRef(!1),{x:Be,y:ot}=typeof Qe=="boolean"?{x:Qe,y:Qe}:Qe;Hr(()=>{if(!Be&&!ot||!se)return void(Ge.current=!1);if(Ge.current||!Pe)return;const Ze=se?.node.current;if(!Ze||Ze.isConnected===!1)return;const et=T7(Ce(Ze),Pe);if(Be||(et.x=0),ot||(et.y=0),Ge.current=!0,Math.abs(et.x)>0||Math.abs(et.y)>0){const mt=nf(Ze);mt&&mt.scrollBy({top:et.y,left:et.x})}},[se,Be,ot,Pe,Ce])})({activeNode:R!=null?j.get(R):null,config:X.layoutShiftCompensation,initialRect:K,measure:I.draggable.measure});const ne=L7($,I.draggable.measure,K),J=L7($?$.parentElement:null),re=s.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=T.getNodeFor((t=re.current.over)==null?void 0:t.id),ie=function(Y){let{measure:se}=Y;const[Ce,Pe]=s.useState(null),Qe=M1({callback:s.useCallback(Ze=>{for(const{target:et}of Ze)if(Va(et)){Pe(mt=>{const pt=se(et);return mt?{...mt,width:pt.width,height:pt.height}:pt});break}},[se])}),Ge=s.useCallback(Ze=>{const et=ff(Ze);Qe?.disconnect(),et&&Qe?.observe(et),Pe(et?se(et):null)},[se,Qe]),[Be,ot]=Zs(Ge);return s.useMemo(()=>({nodeRef:Be,rect:Ce,setRef:ot}),[Ce,Be,ot])}({measure:I.dragOverlay.measure}),ee=(n=ie.nodeRef.current)!=null?n:$,pe=E?(o=ie.rect)!=null?o:ne:null,Te=!(!ie.nodeRef.current||!ie.rect),Ae=T7(ae=Te?null:ne,v2(ae));var ae;const he=A7(ee?nr(ee):null),we=function(Y){const se=s.useRef(Y),Ce=Yl(Pe=>Y?Pe&&Pe!==O7&&Y&&se.current&&Y.parentNode===se.current.parentNode?Pe:Y1(Y):O7,[Y]);return s.useEffect(()=>{se.current=Y},[Y]),Ce}(E?fe??$:null),He=function(Y,se){se===void 0&&(se=dl);const[Ce]=Y,Pe=A7(Ce?nr(Ce):null),[Qe,Ge]=s.useState(F7);function Be(){Ge(()=>Y.length?Y.map(Ze=>lf(Ze)?Pe:new x2(se(Ze),Ze)):F7)}const ot=M1({callback:Be});return Hr(()=>{ot?.disconnect(),Be(),Y.forEach(Ze=>ot?.observe(Ze))},[Y]),Qe}(we),Ye=xf(h,{transform:{x:B.x-Ae.x,y:B.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:A,active:S,activeNodeRect:ne,containerNodeRect:J,draggingNodeRect:pe,over:re.current.over,overlayNodeRect:ie.rect,scrollableAncestors:we,scrollableAncestorRects:He,windowRect:he}),wt=F?zi(F,B):null,Ct=function(Y){const[se,Ce]=s.useState(null),Pe=s.useRef(Y),Qe=s.useCallback(Ge=>{const Be=rd(Ge.target);Be&&Ce(ot=>ot?(ot.set(Be,g2(Be)),new Map(ot)):null)},[]);return s.useEffect(()=>{const Ge=Pe.current;if(Y!==Ge){Be(Ge);const ot=Y.map(Ze=>{const et=rd(Ze);return et?(et.addEventListener("scroll",Qe,{passive:!0}),[et,g2(et)]):null}).filter(Ze=>Ze!=null);Ce(ot.length?new Map(ot):null),Pe.current=Y}return()=>{Be(Y),Be(Ge)};function Be(ot){ot.forEach(Ze=>{rd(Ze)?.removeEventListener("scroll",Qe)})}},[Qe,Y]),s.useMemo(()=>Y.length?se?Array.from(se.values()).reduce((Ge,Be)=>zi(Ge,Be),Wr):sf(Y):Wr,[Y,se])}(we),Ee=P7(Ct),Ie=P7(Ct,[ne]),ft=zi(Ye,Ee),$e=pe?cE(pe,Ye):null,yt=S&&$e?p({active:S,collisionRect:$e,droppableRects:G,droppableContainers:W,pointerCoordinates:wt}):null,tt=ef(yt,"id"),[oe,Ve]=s.useState(null),xe=function(Y,se,Ce){return{...Y,scaleX:se&&Ce?se.width/Ce.width:1,scaleY:se&&Ce?se.height/Ce.height:1}}(Te?Ye:zi(Ye,Ie),(r=oe?.rect)!=null?r:null,ne),be=s.useRef(null),te=s.useCallback((Y,se)=>{let{sensor:Ce,options:Pe}=se;if(O.current==null)return;const Qe=j.get(O.current);if(!Qe)return;const Ge=Y.nativeEvent,Be=new Ce({active:O.current,activeNode:Qe,event:Ge,options:Pe,context:re,onAbort(Ze){if(!j.get(Ze))return;const{onDragAbort:et}=L.current,mt={id:Ze};et?.(mt),v({type:"onDragAbort",event:mt})},onPending(Ze,et,mt,pt){if(!j.get(Ze))return;const{onDragPending:it}=L.current,Wt={id:Ze,constraint:et,initialCoordinates:mt,offset:pt};it?.(Wt),v({type:"onDragPending",event:Wt})},onStart(Ze){const et=O.current;if(et==null)return;const mt=j.get(et);if(!mt)return;const{onDragStart:pt}=L.current,it={activatorEvent:Ge,active:{id:et,data:mt.data,rect:w}};wo.unstable_batchedUpdates(()=>{pt?.(it),k(D0.Initializing),y({type:jo.DragStart,initialCoordinates:Ze,active:et}),v({type:"onDragStart",event:it}),M(be.current),D(Ge)})},onMove(Ze){y({type:jo.DragMove,coordinates:Ze})},onEnd:ot(jo.DragEnd),onCancel:ot(jo.DragCancel)});function ot(Ze){return async function(){const{active:et,collisions:mt,over:pt,scrollAdjustedTranslate:it}=re.current;let Wt=null;if(et&&it){const{cancelDrop:qt}=L.current;Wt={activatorEvent:Ge,active:et,collisions:mt,delta:it,over:pt},Ze===jo.DragEnd&&typeof qt=="function"&&await Promise.resolve(qt(Wt))&&(Ze=jo.DragCancel)}O.current=null,wo.unstable_batchedUpdates(()=>{y({type:Ze}),k(D0.Uninitialized),Ve(null),M(null),D(null),be.current=null;const qt=Ze===jo.DragEnd?"onDragEnd":"onDragCancel";if(Wt){const Vt=L.current[qt];Vt?.(Wt),v({type:qt,event:Wt})}})}}be.current=Be},[j]),Me=s.useCallback((Y,se)=>(Ce,Pe)=>{const Qe=Ce.nativeEvent,Ge=j.get(Pe);if(O.current!==null||!Ge||Qe.dndKit||Qe.defaultPrevented)return;const Be={active:Ge};Y(Ce,se.options,Be)===!0&&(Qe.dndKit={capturedBy:se.sensor},O.current=Pe,te(Ce,se))},[j,te]),_e=function(Y,se){return s.useMemo(()=>Y.reduce((Ce,Pe)=>{const{sensor:Qe}=Pe;return[...Ce,...Qe.activators.map(Ge=>({eventName:Ge.eventName,handler:se(Ge.handler,Pe)}))]},[]),[Y,se])}(u,Me);(function(Y){s.useEffect(()=>{if(!G1)return;const se=Y.map(Ce=>{let{sensor:Pe}=Ce;return Pe.setup==null?void 0:Pe.setup()});return()=>{for(const Ce of se)Ce?.()}},Y.map(se=>{let{sensor:Ce}=se;return Ce}))})(u),Hr(()=>{ne&&C===D0.Initializing&&k(D0.Initialized)},[ne,C]),s.useEffect(()=>{const{onDragMove:Y}=L.current,{active:se,activatorEvent:Ce,collisions:Pe,over:Qe}=re.current;if(!se||!Ce)return;const Ge={active:se,activatorEvent:Ce,collisions:Pe,delta:{x:ft.x,y:ft.y},over:Qe};wo.unstable_batchedUpdates(()=>{Y?.(Ge),v({type:"onDragMove",event:Ge})})},[ft.x,ft.y]),s.useEffect(()=>{const{active:Y,activatorEvent:se,collisions:Ce,droppableContainers:Pe,scrollAdjustedTranslate:Qe}=re.current;if(!Y||O.current==null||!se||!Qe)return;const{onDragOver:Ge}=L.current,Be=Pe.get(tt),ot=Be&&Be.rect.current?{id:Be.id,rect:Be.rect.current,data:Be.data,disabled:Be.disabled}:null,Ze={active:Y,activatorEvent:se,collisions:Ce,delta:{x:Qe.x,y:Qe.y},over:ot};wo.unstable_batchedUpdates(()=>{Ve(ot),Ge?.(Ze),v({type:"onDragOver",event:Ze})})},[tt]),Hr(()=>{re.current={activatorEvent:A,active:S,activeNode:$,collisionRect:$e,collisions:yt,droppableRects:G,draggableNodes:j,draggingNode:ee,draggingNodeRect:pe,droppableContainers:T,over:oe,scrollableAncestors:we,scrollAdjustedTranslate:ft},w.current={initial:pe,translated:$e}},[S,$,yt,$e,j,ee,pe,G,T,oe,we,ft]),function(Y){let{acceleration:se,activator:Ce=aa.Pointer,canScroll:Pe,draggingRect:Qe,enabled:Ge,interval:Be=5,order:ot=j1.TreeOrder,pointerCoordinates:Ze,scrollableAncestors:et,scrollableAncestorRects:mt,delta:pt,threshold:it}=Y;const Wt=function(dt){let{delta:Jt,disabled:Sn}=dt;const vn=E1(Jt);return Yl(En=>{if(Sn||!vn||!En)return bE;const on=Math.sign(Jt.x-vn.x),to=Math.sign(Jt.y-vn.y);return{x:{[Lo.Backward]:En.x[Lo.Backward]||on===-1,[Lo.Forward]:En.x[Lo.Forward]||on===1},y:{[Lo.Backward]:En.y[Lo.Backward]||to===-1,[Lo.Forward]:En.y[Lo.Forward]||to===1}}},[Sn,Jt,vn])}({delta:pt,disabled:!Ge}),[qt,Vt]=function(){const dt=s.useRef(null);return[s.useCallback((Jt,Sn)=>{dt.current=setInterval(Jt,Sn)},[]),s.useCallback(()=>{dt.current!==null&&(clearInterval(dt.current),dt.current=null)},[])]}(),nn=s.useRef({x:0,y:0}),bn=s.useRef({x:0,y:0}),kn=s.useMemo(()=>{switch(Ce){case aa.Pointer:return Ze?{top:Ze.y,bottom:Ze.y,left:Ze.x,right:Ze.x}:null;case aa.DraggableRect:return Qe}},[Ce,Qe,Ze]),Gn=s.useRef(null),eo=s.useCallback(()=>{const dt=Gn.current;if(!dt)return;const Jt=nn.current.x*bn.current.x,Sn=nn.current.y*bn.current.y;dt.scrollBy(Jt,Sn)},[]),Tn=s.useMemo(()=>ot===j1.TreeOrder?[...et].reverse():et,[ot,et]);s.useEffect(()=>{if(Ge&&et.length&&kn){for(const dt of Tn){if(Pe?.(dt)===!1)continue;const Jt=et.indexOf(dt),Sn=mt[Jt];if(!Sn)continue;const{direction:vn,speed:En}=hE(dt,Sn,kn,se,it);for(const on of["x","y"])Wt[on][vn[on]]||(En[on]=0,vn[on]=0);if(En.x>0||En.y>0)return Vt(),Gn.current=dt,qt(eo,Be),nn.current=En,void(bn.current=vn)}nn.current={x:0,y:0},bn.current={x:0,y:0},Vt()}else Vt()},[se,eo,Pe,Vt,Ge,Be,JSON.stringify(kn),JSON.stringify(Wt),qt,et,Tn,mt,JSON.stringify(it)])}({...X,delta:B,draggingRect:$e,pointerCoordinates:wt,scrollableAncestors:we,scrollableAncestorRects:He});const ve=s.useMemo(()=>({active:S,activeNode:$,activeNodeRect:ne,activatorEvent:A,collisions:yt,containerNodeRect:J,dragOverlay:ie,draggableNodes:j,droppableContainers:T,droppableRects:G,over:oe,measureDroppableContainers:Q,scrollableAncestors:we,scrollableAncestorRects:He,measuringConfiguration:I,measuringScheduled:H,windowRect:he}),[S,$,ne,A,yt,J,ie,j,T,G,oe,Q,we,He,I,H,he]),Oe=s.useMemo(()=>({activatorEvent:A,activators:_e,active:S,activeNodeRect:ne,ariaDescribedById:{draggable:N},dispatch:y,draggableNodes:j,over:oe,measureDroppableContainers:Q}),[A,_e,S,ne,y,N,j,oe,Q]);return s.createElement(Y9.Provider,{value:b},s.createElement(Ma.Provider,{value:Oe},s.createElement(gf.Provider,{value:ve},s.createElement(J1.Provider,{value:xe},c)),s.createElement(_E,{disabled:l?.restoreFocus===!1})),s.createElement(oE,{...l,hiddenTextDescribedById:N}))}),jE=s.createContext(null),z7="button";function yf(){return s.useContext(gf)}const ME={timeout:25};function RE(e){let{animation:t,children:n}=e;const[o,r]=s.useState(null),[i,l]=s.useState(null),d=E1(n);return n||o||!d||r(d),Hr(()=>{if(!i)return;const c=o?.key,u=o?.props.id;c!=null&&u!=null?Promise.resolve(t(u,i)).then(()=>{r(null)}):r(null)},[t,o,i]),s.createElement(s.Fragment,null,n,o?s.cloneElement(o,{ref:l}):null)}const IE={x:0,y:0,scaleX:1,scaleY:1};function DE(e){let{children:t}=e;return s.createElement(Ma.Provider,{value:mf},s.createElement(J1.Provider,{value:IE},t))}const LE={position:"fixed",touchAction:"none"},OE=e=>X1(e)?"transform 250ms ease":void 0,PE=s.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:l,rect:d,style:c,transform:u,transition:p=OE}=e;if(!d)return null;const f=r?u:{...u,scaleX:1,scaleY:1},h={...LE,width:d.width,height:d.height,top:d.top,left:d.left,transform:fi.Transform.toString(f),transformOrigin:r&&o?rE(o,d):void 0,transition:typeof p=="function"?p(o):p,...c};return s.createElement(n,{className:l,style:h,ref:t},i)}),bf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fi.Transform.toString(t)},{transform:fi.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:l}=e;if(i!=null&&i.active)for(const[d,c]of Object.entries(i.active))c!==void 0&&(r[d]=n.node.style.getPropertyValue(d),n.node.style.setProperty(d,c));if(i!=null&&i.dragOverlay)for(const[d,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(d,c);return l!=null&&l.active&&n.node.classList.add(l.active),l!=null&&l.dragOverlay&&o.node.classList.add(l.dragOverlay),function(){for(const[d,c]of Object.entries(r))n.node.style.setProperty(d,c);l!=null&&l.active&&n.node.classList.remove(l.active)}})({styles:{active:{opacity:"0"}}})};let B7=0;const AE=s.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:l,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:m,draggableNodes:g,droppableContainers:x,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:k,windowRect:E}=yf(),R=s.useContext(J1),j=function(S){return s.useMemo(()=>{if(S!=null)return B7++,B7},[S])}(f?.id),B=xf(l,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:k,transform:R,windowRect:E}),T=v2(h),_=function(S){let{config:O,draggableNodes:P,droppableContainers:M,measuringConfiguration:A}=S;return K1((D,L)=>{if(O===null)return;const N=P.get(D);if(!N)return;const W=N.node.current;if(!W)return;const I=ff(L);if(!I)return;const{transform:U}=nr(L).getComputedStyle(L),G=tf(U);if(!G)return;const Q=typeof O=="function"?O:function(H){const{duration:$,easing:F,sideEffects:X,keyframes:K}={...bf,...H};return ne=>{let{active:J,dragOverlay:re,transform:fe,...ie}=ne;if(!$)return;const ee=re.rect.left-J.rect.left,pe=re.rect.top-J.rect.top,Te={scaleX:fe.scaleX!==1?J.rect.width*fe.scaleX/re.rect.width:1,scaleY:fe.scaleY!==1?J.rect.height*fe.scaleY/re.rect.height:1},Ae={x:fe.x-ee,y:fe.y-pe,...Te},ae=K({...ie,active:J,dragOverlay:re,transform:{initial:fe,final:Ae}}),[he]=ae,we=ae[ae.length-1];if(JSON.stringify(he)===JSON.stringify(we))return;const He=X?.({active:J,dragOverlay:re,...ie}),Ye=re.node.animate(ae,{duration:$,easing:F,fill:"forwards"});return new Promise(wt=>{Ye.onfinish=()=>{He?.(),wt()}})}}(O);return cf(W,A.draggable.measure),Q({active:{id:D,data:N.data,node:W,rect:A.draggable.measure(W)},draggableNodes:P,dragOverlay:{node:L,rect:A.dragOverlay.measure(I)},droppableContainers:M,measuringConfiguration:A,transform:G})})}({config:o,draggableNodes:g,droppableContainers:x,measuringConfiguration:b}),w=T?y.setRef:void 0;return s.createElement(DE,null,s.createElement(RE,{animation:_},f&&j?s.createElement(PE,{key:j,id:f.id,ref:w,as:d,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:T,style:{zIndex:u,...r},transform:B},n):null))});function bu(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function FE(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Cs(e){return e!==null&&e>=0}const ks={scaleX:1,scaleY:1},zE=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:l}=e;const d=(t=n[r])!=null?t:o;if(!d)return null;const c=function(u,p,f){const h=u[p],m=u[p-1],g=u[p+1];return h&&(m||g)?f<p?m?h.left-(m.left+m.width):g.left-(h.left+h.width):g?g.left-(h.left+h.width):h.left-(m.left+m.width):0}(n,l,r);if(l===r){const u=n[i];return u?{x:r<i?u.left+u.width-(d.left+d.width):u.left-d.left,y:0,...ks}:null}return l>r&&l<=i?{x:-d.width-c,y:0,...ks}:l<r&&l>=i?{x:d.width+c,y:0,...ks}:{x:0,y:0,...ks}},vu=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=bu(t,o,n),l=t[r],d=i[r];return d&&l?{x:d.left-l.left,y:d.top-l.top,scaleX:d.width/l.width,scaleY:d.height/l.height}:null},vf="Sortable",wf=s.createContext({activeIndex:-1,containerId:vf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vu,disabled:{draggable:!1,droppable:!1}});function BE(e){let{children:t,id:n,items:o,strategy:r=vu,disabled:i=!1}=e;const{active:l,dragOverlay:d,droppableRects:c,over:u,measureDroppableContainers:p}=yf(),f=_a(vf,n),h=d.rect!==null,m=s.useMemo(()=>o.map(R=>typeof R=="object"&&"id"in R?R.id:R),[o]),g=l!=null,x=l?m.indexOf(l.id):-1,y=u?m.indexOf(u.id):-1,v=s.useRef(m),b=!function(R,j){if(R===j)return!0;if(R.length!==j.length)return!1;for(let B=0;B<R.length;B++)if(R[B]!==j[B])return!1;return!0}(m,v.current),C=y!==-1&&x===-1||b,k=function(R){return typeof R=="boolean"?{draggable:R,droppable:R}:R}(i);Hr(()=>{b&&g&&p(m)},[b,m,g,p]),s.useEffect(()=>{v.current=m},[m]);const E=s.useMemo(()=>({activeIndex:x,containerId:f,disabled:k,disableTransforms:C,items:m,overIndex:y,useDragOverlay:h,sortedRects:FE(m,c),strategy:r}),[x,f,k.draggable,k.droppable,C,m,y,c,h,r]);return s.createElement(wf.Provider,{value:E},t)}const NE=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bu(n,o,r).indexOf(t)},VE=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:l,previousItems:d,previousContainerId:c,transition:u}=e;return!(!u||!o||d!==i&&r===l||!n&&(l===r||t!==c))},HE={duration:200,easing:"ease"},Sf="transform",$E=fi.Transition.toString({property:Sf,duration:0,easing:"linear"}),WE={roleDescription:"sortable"};function UE(e){let{animateLayoutChanges:t=VE,attributes:n,disabled:o,data:r,getNewIndex:i=NE,id:l,strategy:d,resizeObserverConfig:c,transition:u=HE}=e;const{items:p,containerId:f,activeIndex:h,disabled:m,disableTransforms:g,sortedRects:x,overIndex:y,useDragOverlay:v,strategy:b}=s.useContext(wf),C=function(re,fe){var ie,ee;return typeof re=="boolean"?{draggable:re,droppable:!1}:{draggable:(ie=re?.draggable)!=null?ie:fe.draggable,droppable:(ee=re?.droppable)!=null?ee:fe.droppable}}(o,m),k=p.indexOf(l),E=s.useMemo(()=>({sortable:{containerId:f,index:k,items:p},...r}),[f,r,k,p]),R=s.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:j,node:B,isOver:T,setNodeRef:_}=function(re){let{data:fe,disabled:ie=!1,id:ee,resizeObserverConfig:pe}=re;const Te=_a("Droppable"),{active:Ae,dispatch:ae,over:he,measureDroppableContainers:we}=s.useContext(Ma),He=s.useRef({disabled:ie}),Ye=s.useRef(!1),wt=s.useRef(null),Ct=s.useRef(null),{disabled:Ee,updateMeasurementsFor:Ie,timeout:ft}={...ME,...pe},$e=ia(Ie??ee),yt=M1({callback:s.useCallback(()=>{Ye.current?(Ct.current!=null&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{we(Array.isArray($e.current)?$e.current:[$e.current]),Ct.current=null},ft)):Ye.current=!0},[ft]),disabled:Ee||!Ae}),tt=s.useCallback((be,te)=>{yt&&(te&&(yt.unobserve(te),Ye.current=!1),be&&yt.observe(be))},[yt]),[oe,Ve]=Zs(tt),xe=ia(fe);return s.useEffect(()=>{yt&&oe.current&&(yt.disconnect(),Ye.current=!1,yt.observe(oe.current))},[oe,yt]),s.useEffect(()=>(ae({type:jo.RegisterDroppable,element:{id:ee,key:Te,disabled:ie,node:oe,rect:wt,data:xe}}),()=>ae({type:jo.UnregisterDroppable,key:Te,id:ee})),[ee]),s.useEffect(()=>{ie!==He.current.disabled&&(ae({type:jo.SetDroppableDisabled,id:ee,key:Te,disabled:ie}),He.current.disabled=ie)},[ee,Te,ie,ae]),{active:Ae,rect:wt,isOver:he?.id===ee,node:oe,over:he,setNodeRef:Ve}}({id:l,data:E,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...c}}),{active:w,activatorEvent:S,activeNodeRect:O,attributes:P,setNodeRef:M,listeners:A,isDragging:D,over:L,setActivatorNodeRef:N,transform:W}=function(re){let{id:fe,data:ie,disabled:ee=!1,attributes:pe}=re;const Te=_a("Draggable"),{activators:Ae,activatorEvent:ae,active:he,activeNodeRect:we,ariaDescribedById:He,draggableNodes:Ye,over:wt}=s.useContext(Ma),{role:Ct=z7,roleDescription:Ee="draggable",tabIndex:Ie=0}=pe??{},ft=he?.id===fe,$e=s.useContext(ft?J1:jE),[yt,tt]=Zs(),[oe,Ve]=Zs(),xe=function(te,Me){return s.useMemo(()=>te.reduce((_e,ve)=>{let{eventName:Oe,handler:Y}=ve;return _e[Oe]=se=>{Y(se,Me)},_e},{}),[te,Me])}(Ae,fe),be=ia(ie);return Hr(()=>(Ye.set(fe,{id:fe,key:Te,node:yt,activatorNode:oe,data:be}),()=>{const te=Ye.get(fe);te&&te.key===Te&&Ye.delete(fe)}),[Ye,fe]),{active:he,activatorEvent:ae,activeNodeRect:we,attributes:s.useMemo(()=>({role:Ct,tabIndex:Ie,"aria-disabled":ee,"aria-pressed":!(!ft||Ct!==z7)||void 0,"aria-roledescription":Ee,"aria-describedby":He.draggable}),[ee,Ct,Ie,ft,Ee,He.draggable]),isDragging:ft,listeners:ee?void 0:xe,node:yt,over:wt,setNodeRef:tt,setActivatorNodeRef:Ve,transform:$e}}({id:l,data:E,attributes:{...WE,...n},disabled:C.draggable}),I=function(){for(var re=arguments.length,fe=new Array(re),ie=0;ie<re;ie++)fe[ie]=arguments[ie];return s.useMemo(()=>ee=>{fe.forEach(pe=>pe(ee))},fe)}(_,M),U=!!w,G=U&&!g&&Cs(h)&&Cs(y),Q=!v&&D,H=G?(Q&&G?W:null)??(d??b)({rects:x,activeNodeRect:O,activeIndex:h,overIndex:y,index:k}):null,$=Cs(h)&&Cs(y)?i({id:l,items:p,activeIndex:h,overIndex:y}):k,F=w?.id,X=s.useRef({activeId:F,items:p,newIndex:$,containerId:f}),K=p!==X.current.items,ne=t({active:w,containerId:f,isDragging:D,isSorting:U,id:l,index:k,items:p,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:u,wasDragging:X.current.activeId!=null}),J=function(re){let{disabled:fe,index:ie,node:ee,rect:pe}=re;const[Te,Ae]=s.useState(null),ae=s.useRef(ie);return Hr(()=>{if(!fe&&ie!==ae.current&&ee.current){const he=pe.current;if(he){const we=dl(ee.current,{ignoreTransform:!0}),He={x:he.left-we.left,y:he.top-we.top,scaleX:he.width/we.width,scaleY:he.height/we.height};(He.x||He.y)&&Ae(He)}}ie!==ae.current&&(ae.current=ie)},[fe,ie,ee,pe]),s.useEffect(()=>{Te&&Ae(null)},[Te]),Te}({disabled:!ne,index:k,node:B,rect:j});return s.useEffect(()=>{U&&X.current.newIndex!==$&&(X.current.newIndex=$),f!==X.current.containerId&&(X.current.containerId=f),p!==X.current.items&&(X.current.items=p)},[U,$,f,p]),s.useEffect(()=>{if(F===X.current.activeId)return;if(F!=null&&X.current.activeId==null)return void(X.current.activeId=F);const re=setTimeout(()=>{X.current.activeId=F},50);return()=>clearTimeout(re)},[F]),{active:w,activeIndex:h,attributes:P,data:E,rect:j,index:k,newIndex:$,items:p,isOver:T,isSorting:U,isDragging:D,listeners:A,node:B,overIndex:y,over:L,setNodeRef:I,setActivatorNodeRef:N,setDroppableNodeRef:_,setDraggableNodeRef:M,transform:J??H,transition:J||K&&X.current.newIndex===k?$E:Q&&!X1(S)||!u||!U&&!ne?void 0:fi.Transition.toString({...u,property:Sf})}}function R1(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 qE=[jn.Down,jn.Right,jn.Up,jn.Left],ZE=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:l,scrollableAncestors:d}}=t;if(qE.includes(e.code)){if(e.preventDefault(),!n||!o)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=r.get(f.id);if(h)switch(e.code){case jn.Down:o.top<h.top&&c.push(f);break;case jn.Up:o.top>h.top&&c.push(f);break;case jn.Left:o.left>h.left&&c.push(f);break;case jn.Right:o.left<h.left&&c.push(f)}});const u=(f=>{let{collisionRect:h,droppableRects:m,droppableContainers:g}=f;const x=E7(h),y=[];for(const v of g){const{id:b}=v,C=m.get(b);if(C){const k=E7(C),E=x.reduce((j,B,T)=>j+J9(k[T],B),0),R=Number((E/4).toFixed(4));y.push({id:b,data:{droppableContainer:v,value:R}})}}return y.sort(Q9)})({collisionRect:o,droppableRects:r,droppableContainers:c});let p=ef(u,"id");if(p===l?.id&&u.length>1&&(p=u[1].id),p!=null){const f=i.get(n.id),h=i.get(p),m=h?r.get(h.id):null,g=h?.node.current;if(g&&m&&f&&h){const x=Y1(g).some((k,E)=>d[E]!==k),y=N7(f,h),v=function(k,E){return!!(R1(k)&&R1(E)&&N7(k,E))&&k.data.current.sortable.index<E.data.current.sortable.index}(f,h),b=x||!y?{x:0,y:0}:{x:v?o.width-m.width:0,y:v?o.height-m.height:0},C={x:m.left,y:m.top};return b.x&&b.y?C:Ta(C,b)}}}};function N7(e,t){return!(!R1(e)||!R1(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const GE=e=>{let{transform:t}=e;return{...t,y:0}},KE=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:l,editable:d,selectedIndex:c,background:u,activeColor:p,borderColor:f,borderWidth:h,dragging:m,...g}=e;return a.jsxs("div",{ref:t,className:cr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...g,children:[a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[a.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?a.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):a.jsx(a.Fragment,{})]}),a.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Br={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},Cf=s.memo(s.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:l,index:d,listeners:c,onRemove:u,renderItem:p,sorting:f,style:h,transition:m,transform:g,value:x,wrapperStyle:y,...v},b)=>{s.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const C=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!f,index:d,fadeIn:!!r,listeners:c,ref:b,style:h,transform:g,transition:m,value:x}):a.jsx(a.Fragment,{children:x});return a.jsx("div",{className:cr("tab-item",Br.Wrapper,r&&Br.fadeIn,f&&Br.sorting,t&&Br.dragOverlay),style:{...y,transition:[m,y?.transition].filter(Boolean).join(", "),"--translate-x":g?`${Math.round(g.x)}px`:void 0,"--translate-y":g?`${Math.round(g.y)}px`:void 0,"--scale-x":g?.scaleX?`${g.scaleX}`:void 0,"--scale-y":g?.scaleY?`${g.scaleY}`:void 0,"--index":d},ref:b,children:a.jsx("div",{className:cr(Br.Item,n&&Br.dragging,i&&Br.withHandle,t&&Br.dragOverlay,o&&Br.disabled,e&&Br.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...v,tabIndex:i?void 0:-1,children:C})})})),V7={Row:"_Row_1kr10_1"},XE=s.memo(s.forwardRef(({children:e,horizontal:t,style:n},o)=>a.jsx("div",{ref:o,style:{...n},className:cr(V7.Row,t&&V7.horizontal),children:e}))),YE={...bf},JE=s.memo(s.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:l=lE,coordinateGetter:d=ZE,dropAnimation:c=YE,getItemStyles:u=()=>({}),getNewIndex:p,handle:f=!1,items:h,onMove:m,isDisabled:g=()=>!1,measuring:x,modifiers:y,renderItem:v,renderDivider:b,reorderItems:C=bu,strategy:k=vu,style:E,useDragOverlay:R=!0,onDragStart:j,wrapperStyle:B=()=>({})}=e,[T,_]=s.useState(()=>h);s.useEffect(()=>{_(h)},[h]);const[w,S]=s.useState(null),O=function(){for(var L=arguments.length,N=new Array(L),W=0;W<L;W++)N[W]=arguments[W];return s.useMemo(()=>[...N].filter(I=>I!=null),[...N])}(od(hf,{activationConstraint:o}),od(pf,{activationConstraint:o}),od(xu,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:d})),P=T.indexOf.bind(T),M=w?P(w):-1,A=[];T.map((L,N)=>{A.push(a.jsx(QE,{id:L,handle:f,index:N,style:u,wrapperStyle:B,disabled:g(L),renderItem:v,animateLayoutChanges:r,useDragOverlay:R,getNewIndex:p},L+"-"+N));const W=b?.({key:"divider-"+N});W&&A.push(W)});const{getPortalContainer:D}=(s.useEffect(()=>{function L(){const N=document.fullscreenElement;if(!N)return;let W=N.querySelector(".fullscreen-portal-root");W||(W=document.createElement("div"),W.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",N.appendChild(W))}return Ja++,L(),document.addEventListener("fullscreenchange",L),()=>{document.removeEventListener("fullscreenchange",L),Ja--,Ja<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(N=>{N.parentNode&&N.parentNode.removeChild(N)}),Ja=0)}},[]),{getPortalContainer:kg});return a.jsxs(TE,{sensors:O,collisionDetection:l,onDragStart:L=>{const{active:N}=L;N&&(j?.(L),S(N.id))},autoScroll:{canScroll:L=>!0},onDragEnd:L=>{if(S(null),L.over){const N=P(L.over.id);M!==N&&(_(W=>C(W,M,N)),m?.(M,N))}},onDragCancel:()=>{S(null)},measuring:x,modifiers:y,children:[a.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...E},className:cr(n,Br.Wrapper),children:a.jsx(BE,{items:T,strategy:k,children:a.jsx(XE,{ref:t,children:A})})}),R?wo.createPortal(a.jsx(AE,{adjustScale:i,dropAnimation:c,children:w?a.jsx(Cf,{value:T[M],handle:f,renderItem:v,wrapperStyle:B({index:M,isDragging:!0,id:T[M]}),index:M,dragging:!0,style:u({id:T[M],index:M,isSorting:w!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),D()):null]})}));function QE({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:l,style:d,renderItem:c,useDragOverlay:u,wrapperStyle:p}){const{attributes:f,isDragging:h,isSorting:m,listeners:g,overIndex:x,setNodeRef:y,transform:v,transition:b}=UE({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return a.jsx(Cf,{ref:y,value:r,disabled:e,dragging:h,sorting:m,handle:o,renderItem:c,index:i,style:d({index:i,id:r,isDragging:h,isSorting:m,overIndex:x}),onRemove:l?()=>l(r):void 0,transform:v,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:g,"data-index":i,"data-id":r,dragOverlay:!u&&h,...f})}const e_=new z.Color("rgb(33, 115, 70)"),t_="#eee",n_=e=>a.jsx(KE,{...e}),kf=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:l=[],onSelectedTabIndexChange:d,onTabNameChange:c,onTabMove:u,createScrollStartButton:p=N8,createScrollEndButton:f=V8,createScrollEdgeButton:h=cg,createTabButton:m=n_,createTabDivider:g,editLabelProps:x,disabled:y=!1,disableDrag:v=!1,background:b="white",activeColor:C=e_,borderColor:k=t_,borderWidth:E=1}=e,[R,j]=s.useState(i),[B,T]=s.useState(l),_=s.useCallback(Ae=>{const ae=D.current?.[Ae]?.closest(".tab-item")??D.current?.[Ae];ae&&Q.current?.scrollTo({top:ae.offsetTop,left:ae.offsetLeft,behavior:"smooth"})},[]);s.useEffect(()=>{_(i)},[i]);const w=s.useCallback((Ae,ae)=>{ae!==R&&(j(ae),d?.(ae)),_(ae)},[d,R]),S=s.useCallback((Ae,ae)=>{u?.(Ae,ae)},[u]),O=s.useRef(null),[P,M]=s.useState(-1),A=s.useCallback((Ae,ae)=>{c?.(Ae,ae)},[c]);s.useLayoutEffect(()=>{j(i)},[i]),s.useLayoutEffect(()=>{T(l)},[l]);const D=s.useRef([]),L=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign({startEdit(Ae){D.current?.[Ae]?.startEdit()},cancel(Ae){D.current?.[Ae]?.cancel()}},L.current),[R,P]);const N=s.useCallback(({value:Ae,index:ae,dragging:he})=>{const{style:we,maxLength:He,...Ye}=x||{},wt=a.jsx(Xk,{ref:Ct=>{D.current[ae]=Ct},value:Ae,disabled:y,maxLength:He,style:{color:R===ae&&C?C?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...we},styleHover:{},onSubmit:Ct=>(O.current=!1,M(-1),A(ae,Ct)),onCancel:()=>{O.current=!1,M(-1)},onChange:Ct=>{O.current=!0,M(ae)},...Ye});return m({onClick:Ct=>w(Ct,ae),value:Ae,index:ae,editing:P===ae&&O.current,editable:!0,disabled:y,selectedIndex:R,background:b,activeColor:C,borderColor:k,borderWidth:E,dragging:he,children:wt})},[R,A,w,x,y,P,m]),[W,{width:I}]=pi(),[U,{width:G}]=pi(),Q=s.useRef(null),[H,$]=s.useState({left:0,top:0,width:0,height:0}),[F,X]=s.useState(null);s.useEffect(()=>{F!==null&&Q.current&&Q.current.scrollTo({left:F,behavior:"smooth"})},[F]);const K=s.useCallback((Ae,ae=!1)=>{if(!Q.current)return 0;let he=Q.current.firstChild.getBoundingClientRect(),we=Q.current.firstChild.firstChild.children,He=0;return He=ae?0:k5.getScrollTo(Ae,he.left,we,!0,Math.max(0,Ae-200)),X(He),Math.max(0,He)},[]),ne=s.useCallback((Ae,ae=!1)=>{if(!Q.current)return 0;let he=Q.current.firstChild.getBoundingClientRect(),we=Q.current.firstChild.firstChild.children,He=0;const Ye=Math.ceil(G-I);return He=ae?Ye:k5.getScrollTo(Ae,he.left,we,!1,Math.max(0,Ae+200)),X(He),Math.min(Ye,He)},[G,I]),J=s.useRef(null),re=s.useRef(null),fe=s.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null,J.current=null)},[]),ie=s.useCallback((Ae,ae,he=260)=>{J.current=Ae,re.current=setTimeout(()=>{const we=ae?K(J.current||Ae):ne(J.current||Ae);we!==J.current?ie(we,ae,120):fe()},he)},[K,ne,fe]);s.useEffect(()=>()=>fe(),[fe]);const ee=s.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(H.left)<=0||Math.floor(G-I)===0,orientation:zo.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>ie(Q.current.scrollLeft,!0),onClick:Ae=>K(Math.min(Q.current.scrollLeft,F??Number.MAX_SAFE_INTEGER),Ae.ctrlKey)}),[H,F,G,I]),pe=s.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(G-I)<=Math.ceil(H.left),orientation:zo.Horizontal,onMouseUp:fe,onMouseLeave:fe,onMouseDown:()=>ie(Q.current.scrollLeft,!1),onClick:Ae=>ne(Math.max(Q.current.scrollLeft,F??0),Ae.ctrlKey)}),[H,F,G,I]),Te=s.useMemo(()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{minWidth:"16px"}}),n,h?.(ee)]}),[ee,pe,p,f,n,h]);return a.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:cr("_TabStrip_3x0dp_1",r),ref:L,children:[a.jsx("div",{style:{borderTop:`solid ${k} ${E}px`,position:"absolute",width:"100%"}}),a.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Te}),a.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:a.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Q,onScroll:Ae=>{$({left:Ae.target.scrollLeft,top:Ae.target.scrollTop,width:Ae.target.scrollWidth,height:Ae.target.scrollHeight})},children:a.jsx(JE,{isDisabled:Ae=>y||v,items:B,strategy:zE,modifiers:[GE],ref:U,renderItem:N,renderDivider:g,onMove:S,activationConstraint:{distance:15}})})}),a.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(pe)})]})}));kf.displayName="TabStrip";const o_=s.createContext(null),wu=()=>{const e=s.useContext(o_),[t]=s.useState(()=>new z.ThemeCollection);return s.useMemo(()=>e||t,[e])},r_=s.lazy(()=>Promise.resolve().then(()=>require("./Rw2yrV19tzTGGBPV.cjs"))),i_={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"},H7=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),l=await i.getNavigationTree(o.uri.toString()),d=e.getPosition();let c={...d};c.lineNumber=1,c.column=1;let u=!1;for(let x=d.lineNumber;x>=1;x--)if(o.getLineContent(x).trim()===""){const y=Su(l,o.getOffsetAt({lineNumber:x,column:1}),"function");if(!y||a_(y)){u=!0,c.lineNumber=x+1;break}{const v=y.spans[0].start;x=o.getPositionAt(v).lineNumber,c.lineNumber=x}}let p=n,f=!1;!u&&!p.startsWith(`
|
|
77
77
|
`)&&c.lineNumber>1&&(p=`
|
|
78
78
|
`+p,f=!0);let h=!1;o.getLineCount()>1&&(p.endsWith(`
|
|
79
79
|
|
|
80
80
|
`)||(p+=`
|
|
81
81
|
|
|
82
|
-
`,h=!0));const m=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let g=null;o.pushEditOperations([],m,x=>(g=x[0].range,f&&g.startLineNumber++,h&&g.endLineNumber--,[new t.Selection(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)])),e.setSelection({startLineNumber:g.endLineNumber,startColumn:g.endColumn,endLineNumber:g.startLineNumber,endColumn:g.startColumn})};function l_(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function w2(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,l=e.getPositionAt(i);r.push({name:o.text,type:l_(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const i of o.childItems)w2(e,t,n,i,r);return r}function Su(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const l=r[i];if(l.start<=t&&t<l.start+l.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const d of e.childItems||[]){const c=Su(d,t,n,o);if(c)return c}}return null}}function a_(e){return e.kind==="comment"}const s_=s.memo(s.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:l,darkMode:d,loadingPanel:c,autoFocus:u=!0,onStatusChange:p,...f}=e,h=s.useRef(null),m=ue(l,[l]),g=s.useRef(!1),x=s.useMemo(()=>({contains(L){if(!h.current)return;const N=h.current.editor;return N&&N.getDomNode()?.contains(L)},focus(){if(!h.current)return;const L=h.current.editor;return L&&L.getDomNode()?.focus()}}),[]),y=s.useMemo(()=>[new je("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=s.useMemo(()=>{let L=null;const N=()=>x;return L=r?r.createChildGroup(N,"scriptEditor",!1):new rl(N,"scriptEditor"),L.addCommands(y,!0),L},[r,y]),b=ro(v,["executeSelectedScript"])[0],C=b?.context(),k=ue(L=>{b?.execute(L)},[b]),E=s.useRef(""),[R,j]=s.useState(!1),B=ue(async()=>{if(!h.current)return null;const L=h.current,N=L.editor;if(!N)return null;const W=L.monaco,I=await(async(U,G,Q="export")=>{const H=U.getModel();if(!H)return null;const $=await G.languages.typescript.getTypeScriptWorker(),F=await $(H.uri),X=await F.getNavigationTree(H.uri.toString());let K=null,ne=U.getSelection();const J=ne.startLineNumber===ne.endLineNumber&&ne.startColumn===ne.endColumn?H.getLineCount():Math.min(ne.endLineNumber,H.getLineCount());for(let re=ne.startLineNumber;!K&&re<=J;re++){const fe=Su(X,H.getOffsetAt({lineNumber:re,column:1}),"function",Q);fe&&(K=fe.text)}return K})(N,W);return p?.({message:(I??"").toUpperCase()}),I?{source:N.getValue(),name:I}:null},[p]),T=ue(async(L,N,W)=>{const I=await C.getScripts().createModule({source:W?.getValue(),declarationsOnly:!0}),U=I?I.getFunctions().search():Ht.EmptyArray;I&&(async function(G,Q){const H=[];for(let $=1;$<G.getLineCount()+1;$++){const F={startLineNumber:$,startColumn:1,endLineNumber:$,endColumn:G.getLineLength($)+1},X=G.getValueInRange(F).indexOf("modelt");X!==-1&&H.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:Q.MarkerSeverity.Hint,startLineNumber:F.startLineNumber,startColumn:X+1,endLineNumber:F.startLineNumber,endColumn:X+5})}Q.editor.setModelMarkers(G,"owner",H)}(L,N),async function(G,Q,H,$){const F=await Q.languages.typescript.getTypeScriptWorker(),X=await F(G.uri),K=await X.getNavigationTree(G.uri.toString()),ne=w2(G,Q,$,K).map(J=>{let re=null,fe=null;return J.type==="formula"?(re="formula.margin-icon",fe="Formula"):J.type==="macro"?(re="macro.margin-icon",fe="Macro"):J.type==="autoRun"&&(re="autorun.margin-icon",fe="Auto Run"),{range:new Q.Range(J.lineNumber,1,J.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:re,glyphMarginHoverMessage:fe,stickiness:Q.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});O.current&&O.current.clear(),O.current=H.createDecorationsCollection(ne)}(L,N,W,U))},[C]),_=ue(Ht.debounce(T,580),[]),w=ue(async(L=void 0)=>{if(!h.current||!C)return;const N=h.current.editor.getPosition(),W={cursor:N?N.toString():""};L!==void 0&&(W.message=L),p?.(W);const I=B();C.setSelectedFunction(I)},[C,p]);s.useEffect(()=>{if(!C)return;const L={insertSnippet:W=>{h.current?.editor&&(R?H7(h.current.editor,h.current.monaco,W):E.current=W)}};C.setEditor(L),C.setSelectedFunction(B());const N=C.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,I=C?.getScripts().getModules().getByName("scripting"),U=I?.getSource(),G=W.getValue();if((U?.length??0)===G.length&&U===G)return;await C.saveSource(W.getValue());const Q=(U?.length??0)!==G.length||U!==G;p?.({dirty:Q})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,I=C.getScripts().getModules().search()[0]?.getSource()??"";W.setValue(I)}});return()=>{N(),C.setSelectedFunction(null),C.setEditor(null)}},[C,R]),s.useEffect(()=>()=>{if(!h.current?.editor)return;const L=h.current.editor;C?.saveSource(L.getValue())},[]);const S=ue(L=>{const N=h.current;if(!N)return!1;const W=N.editor;return!!W&&(W.focus(),!0)},[]),O=s.useRef(null),P=ue((L,N)=>{h.current={monaco:N,editor:L},j(!0),w("Loading Types");const W=C.getScripts().getModules().search()[0]?.getSource()??"";L.setValue(W),Promise.resolve().then(()=>require("./DKb4LAbZQrysUK06.cjs")).then(U=>U.c).then(U=>{w(""),U.AutoTypings.create(L,{shareCache:!0,monaco:N,onError:G=>{G==="Not implemented yet"&&(G="Compile Errors"),console.warn("Error compiling types",G)}}).then(async G=>{const Q=L.getModel();_(Q,N,L)})}),L.addCommand("executeScript",function(U,...G){G?.[0]&&k({functionName:G?.[0]})},""),L.addAction({id:"executeScript",label:"Execute",keybindings:[N.KeyCode.F8],run:async U=>{const G=B();C.setSelectedFunction(G);const Q=await G;k(Q)}}),L.addAction({id:"saveScript",label:"Save Script",keybindings:[N.KeyMod.CtrlCmd|N.KeyCode.KeyS],run:U=>{C?.saveSource(L.getValue()).then(()=>{const G=C?.getScripts().getModules().getByName("scripting"),Q=G?.getSource(),H=L.getValue(),$=(Q?.length??0)!==H.length||Q!==H;p?.({dirty:$})})}}),L.onMouseDown(async U=>{if(U.target.type===N.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const G=U.target.position.lineNumber,Q=await N.languages.typescript.getTypeScriptWorker(),H=await Q(I.uri),$=await H.getNavigationTree(I.uri.toString()),F=L?.getValue(),X=(await C?.saveSource(F)).getFunctions().search(),K=w2(I,N,X,$).find(ne=>ne.lineNumber===G);if(K){const ne=U.event.browserEvent.button;ne===0?K.type==="macro"||K.type==="autoRun"?k({functionName:K.name}):K.type==="formula"&&C.quickInsertFunction?.(K.name):ne===2&&(console.log("Context menu for function:",K.name),U.event.browserEvent.preventDefault())}}}),L.onDidChangeModelContent(()=>{const U=L.getModel();_(U,N,L)});const I=L.getModel();(function(U,G){G.languages.registerInlayHintsProvider("typescript",{provideInlayHints(Q,H,$){const F=[];for(let X=1;X<Q.getLineCount()+1;X++){const K={startLineNumber:X,startColumn:1,endLineNumber:X,endColumn:Q.getLineLength(X)+1},ne="hint",J=Q.getValueInRange(K).indexOf("hint");J!==-1&&F.push({kind:G.languages.InlayHintKind.Type,position:{lineNumber:K.startLineNumber,column:J+ne.length+1},label:"[hint]"})}return{hints:F,dispose:()=>{}}}})})(0,N),I.onDidChangeContent(U=>{const G=C?.getScripts().getModules().getByName("scripting"),Q=G?.getSource(),H=L.getValue(),$=(Q?.length??0)!==H.length||Q!==H;p?.({dirty:$})}),L.onDidChangeCursorPosition(U=>{w()})},[C,p]),M=s.useMemo(()=>R?null:c||a.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[R,c]),A=s.useMemo(()=>{const L=C?.getScripts().getModules().getByName("scripting")?.getSource()??"";return a.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[a.jsx(s.Suspense,{children:a.jsx(r_,{theme:d?"extended-dark":"extended",options:{...i_,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:L,onValidate:N=>{let W=!1;for(let I=0;!W&&I<N?.length;I++)N[I].severity===8&&(W=!0)},beforeMount:N=>{N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),N.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),N.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),N.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let W=!1;try{const U=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),G=N.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),Q=N.editor.createModel(U,"typescript",G);N.editor.setModelMarkers(Q,"default",[]),W=!0}catch(U){console.warn("cant load types",U)}N.languages.registerLinkProvider("*",{provideLinks:(U,G)=>{const Q=[],H={links:Q},$=U.getLinesContent();for(let F=1;F<=$.length;F++){const X=$[F-1],K=N.editor.tokenize(X,"typescript");for(let ne=0;ne<K[0].length;ne++){const J=K[0]?.[ne];if(J&&J.type.startsWith("string")){let re=J.offset,fe=K[0]?.[ne+1]?.offset??X.length,ie=new N.Range(F,re+1,F,fe+1),ee=U.getValueInRange(ie);const pe=ee[0];pe!=="`"&&pe!=="'"&&pe!=='"'||(re++,ee=ee.substring(1));const Te=ee[ee.length-1];Te!=="`"&&Te!=="'"&&Te!=='"'||(re++,ee=ee.substring(0,ee.length-1));try{C.getRanges(ee)&&Q.push({range:{endColumn:fe,endLineNumber:F,startColumn:re,startLineNumber:F},tooltip:`Goto range '${ee}'`,url:`/range/${ee}`})}catch(Ae){console.warn(Ae)}}}}return H}}),N.editor.registerLinkOpener({open(U){if(U?.path?.startsWith("/range/")){try{C.getRanges(U.path.substring(7))?.select()}catch(G){console.warn("invalid range",G)}return!0}return!1}});const I=N.languages.typescript.typescriptDefaults.getCompilerOptions();N.languages.typescript.typescriptDefaults.setCompilerOptions({...I,target:N.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:N.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),E.current&&(await H7(h.current.editor,h.current.monaco,E.current),E.current=null),g.current&&requestAnimationFrame(async()=>{g.current&&N.editor.focus()}),N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),j(!0)})()},onMount:P})}),M]})},[C,v,i,M,d]),D=Ro(t,()=>({isScriptEditorElement:()=>!0,focus:L=>{S(L)},close:()=>{m?.()},getEditor:()=>C?.getEditor()}),[C]);return s.useEffect(()=>(u&&requestAnimationFrame(()=>{S()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{D.current?.contains(document.activeElement)&&S()})}),[]),a.jsx("div",{className:cr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:D,...f,children:A})})),Ef={Preset:"preset",Custom:"custom"},Wi={Start:"start",End:"end"},ad={},c_=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(ad[r])return ad[r];const i=((l,d,c,u)=>{if(typeof document>"u"&&!u)return null;const p=u?new u:document.createElement("canvas");p.width=2*c,p.height=2*c;const f=p.getContext("2d");return f?(f.fillStyle=l,f.fillRect(0,0,p.width,p.height),f.fillStyle=d,f.fillRect(0,0,c,c),f.translate(c,c),f.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return ad[r]=i,i},d_={},_f=s.memo(e=>{const{className:t,style:n=gn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:l,boxShadow:d,renderers:c=d_,children:u,...p}=e,f=u,h=s.useMemo(()=>Object.assign({borderRadius:l,boxShadow:d,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${c_(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return s.isValidElement(u)?s.cloneElement(u,{...f.props}):a.jsx("div",{style:h,...p})}),u_=s.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:l,onMouseLeave:d,onFocus:c,style:u=gn.EmptyCssProperties,children:p,alphaWhite:f,alphaGrey:h,darkMode:m,alphaCheckSize:g=7,...x}=e;if(!t)throw new Error("a selectedColor is required");const y=s.useCallback(R=>{r?.(R),R.isDefaultPrevented()||(R.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=s.useCallback(R=>{l?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,l,t]),b=s.useCallback(R=>{d?.(R),R.isDefaultPrevented()},[o,d]),C=s.useCallback(R=>{c?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),k=s.useCallback(R=>{i?.(R),R.isDefaultPrevented()||R.keyCode===Zt.Enter&&n?.(t.toRGBA())},[n,i,t]),E=s.useMemo(()=>t.toRGBA().alpha===1?null:a.jsx(_f,{size:g,white:f,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[f,h,t]);return a.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...u},tabIndex:0,...x,onClick:y,onKeyDown:k,onMouseOver:v,onMouseLeave:b,onFocus:C,children:[E,a.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(m)},children:p})]})}),Q1=s.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:l,swatchProps:d,defaultButtonSize:c=24,isLarge:u=!1,compareRGB:p=!1,darkMode:f=!1,...h}=e,m=new z.Color({val:r.definition.val,adjs:r.definition.adjs},E=>t(E)),g=p?m.toRGBA().toString():m.toString(),x=n&&(p?n.toRGBA().toString():n.toString())===g,y=o&&(p?o.toRGBA().toString():o.toString())===g,v=[];v.push({[z.IColor.AdjustmentType.Inv]:!0}),v.push({[z.IColor.AdjustmentType.Alpha]:100});const b=m.adjust(v),C=s.useCallback(()=>{i?.(r)},[i,r]),k=s.useCallback(E=>{l?.(E?r:null)},[l,r]);return a.jsx(vr,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:a.jsx("div",{style:{width:c*(u?1.2:1)+"px",height:c*(u?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:a.jsxs(u_,{selectedColor:m,title:null,onSelectColor:C,onPreviewColor:k,alphaCheckSize:u?9:void 0,darkMode:f,...d,children:[a.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(f).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:x?"1":"0"}}),a.jsx("div",{style:{position:"absolute",width:.33*c*(u?1.2:1)+"px",height:.33*c*(u?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(f).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Es=s.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:l,onPreviewColorDef:d,style:c=gn.EmptyCssProperties,compareRGB:u=!1,darkMode:p,swatchProps:f,...h}=e;let m;if(Array.isArray(o[0]))m=o;else{m=[];for(let b=0;b<o.length;b++)m.push([o[b]])}const g=s.useCallback(b=>{l?.(b)},[l]),x=s.useCallback(b=>{d?.(b)},[d]),y=s.useMemo(()=>{let b=[];for(let C=0;C<m.length;C++){let k=[],E=m[C];for(let j=0;j<E.length;j++){let B=E[j];k.push(a.jsx(Q1,{schemeColorLookup:n,colorDef:B,selectedColor:r,previewColor:i,onSelectColorDef:g,onPreviewColorDef:x,swatchProps:f,compareRGB:u,darkMode:p},C+" "+j))}let R=a.jsx(V.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:j=>j.shadows[2],borderRadius:"2px",overflow:"hidden"},children:k},""+C);b.push(R)}return b},[m,r,i,g,x]),v=s.useMemo(()=>t?a.jsx(V.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:b=>b.palette.text.secondary},children:t}):null,[t]);return a.jsxs(V.Box,{style:{...c},children:[v,a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:y})]})}),Nr=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),go=(e,t,n,o,r,i)=>{const l=Nr(e,t);o?.push(l);const d=new z.Color({val:l.definition.val,adjs:l.definition.adjs},n),c=d.toString();r?.set(c,d);const u=d.toRGBA().toString();i?.set(u,d)},h_=s.lazy(()=>Promise.resolve().then(()=>require("./BIer7D14Ee-tvsvO.cjs"))),Tf=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:l=!1,previewDebounceTime:d=100,initialPanelType:c,defaultButtonSize:u=24,width:p,onElementLoad:f,onDone:h,onEyeDropStart:m,onEyeDropStop:g,onPreviewColor:x,onPreviewColorImmediate:y,onSelectColor:v,autoColor:b,autoColorLabel:C="Automatic",autoColorPosition:k=Wi.Start,compareRGB:E=!1,darkMode:R=!1,...j}=e,B=o||n,T=ue(x,[x]),_=ue(y,[y]),w=ue(v,[v]),S=ue(m,[m]),O=ue(g,[g]),[P,M]=s.useState(!1),A=qr(),D=s.useMemo(()=>i||z.Color.getDefaultSchemeLookup(),[i]),L=s.useMemo(()=>{const ee=new Map,pe=new Map,Te=[];go("Primary Background","bg1",D,Te,ee,pe),go("Primary Text","tx1",D,Te,ee,pe),go("Secondary Background","bg2",D,Te,ee,pe),go("Secondary Text","tx2",D,Te,ee,pe),go("Accent 1","accent1",D,Te,ee,pe),go("Accent 2","accent2",D,Te,ee,pe),go("Accent 3","accent3",D,Te,ee,pe),go("Accent 4","accent4",D,Te,ee,pe),go("Accent 5","accent5",D,Te,ee,pe),go("Accent 6","accent6",D,Te,ee,pe);const Ae=z.ITheme.buildPalette(Te,D,ee,pe),ae=[];if(go("Dark Red","C00000",D,ae,ee,pe),go("Red","FF0000",D,ae,ee,pe),go("Orange","FFC000",D,ae,ee,pe),go("Yellow","FFFF00",D,ae,ee,pe),go("Light Green","92D050",D,ae,ee,pe),go("Green","00B050",D,ae,ee,pe),go("Light Blue","00B0F0",D,ae,ee,pe),go("Blue","0070C0",D,ae,ee,pe),go("Dark Blue","002060",D,ae,ee,pe),l?go("Purple Is A Fruit","7030A0",D,ae,ee,pe):go("Transparent","00000000",D,ae,ee,pe),b){const Ye=b.toString();ee.set(Ye,b)}const he=new Map,we=typeof r=="function"?r():r,He=[];for(let Ye=0;we&&Ye<we.length;Ye++){const wt=we[Ye].toString();he.set(wt,we[Ye]),He.push({description:"Recent "+(Ye+1),definition:{val:we[Ye].toString()}})}return{primaryColors:Te,modifiedPresets:Ae,standardColors:ae,recentColorsLimited:He,mapAllPresets:ee,mapAllPresetsRGB:pe,mapRecent:he}},[D,r,l,b]);s.useEffect(()=>{f?.()},[]);const[N,W]=s.useState(!1),I=s.useCallback(()=>{W(ee=>!ee)},[]);s.useEffect(()=>{if(c)W(c===Ef.Custom);else if(n){let ee=n.toString(),pe=L.mapAllPresets.get(ee);pe||(ee=n.toRGBA().toString(),pe=L.mapAllPresetsRGB.get(ee));const Te=L.mapRecent.get(ee);W(!pe&&!Te)}},[n,c]);const U=s.useCallback(z.CommonUtils.debounce(ee=>{T?.(ee)},d),[T,d]),[G,Q]=s.useState();s.useEffect(()=>{Q(o||n)},[o,n]);const H=ue(ee=>{_&&(_(ee),U(ee))},[_]),$=ue(ee=>{H(ee?new z.Color({val:ee.definition.val,adjs:ee.definition.adjs},D):null)},[D]),F=s.useCallback(ee=>{ee.ctrlKey&&W(!0)},[]),X=ue(ee=>{let pe=!1;if(ee){const Te=ee.toString();pe=!L.mapAllPresets.has(Te)}w?.(ee,pe)},[w,L]),K=ue(ee=>{const pe=ee?new z.Color({val:ee.definition.val,adjs:ee.definition.adjs},D):null;Promise.resolve(h?.()).then(()=>{X(pe)})},[D,h]),ne=ue(ee=>{H(ee?new z.Color(ee,D):null)},[D]),J=s.useMemo(()=>window.EyeDropper===void 0?a.jsx(a.Fragment,{}):a.jsx(V.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:ee=>ee.palette.text.icon??ee.palette.action.active},onClick:async()=>{M(!0),S?.(),await new EyeDropper().open().then(ee=>{M(!1),O?.();let pe=new z.Color(ee.sRGBHex),Te=pe.toString(),Ae=L.mapAllPresets.get(Te);if(Ae||(Te=pe.toRGBA().toString(),Ae=L.mapAllPresetsRGB.get(Te)),!Ae){const ae=pe.toRGBA(),he=3;let we=255;L.mapAllPresetsRGB.forEach((He,Ye)=>{const wt=He.toRGBA(),Ct=Math.abs(wt.red-ae.red)+Math.abs(wt.blue-ae.blue)+Math.abs(wt.green-ae.green);Ct<he&&Ct<we&&(Ae=He)})}W(!Ae),H(Ae||pe)}).catch(ee=>{M(!1),ee?.name!=="AbortError"&&console.error(ee)})},children:a.jsx(wn.Colorize,{})}),[L,R]),re=s.useMemo(()=>{if(!N)return;const ee={opacity:N?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return a.jsx(s.Suspense,{fallback:a.jsx("div",{style:ee,children:a.jsx(il,{})}),children:a.jsx(h_,{style:ee,selectedColor:B?B.toRGBA().toString():"transparent",onColorChange:ne,disableAlpha:l})})},[N,B]),fe=s.useMemo(()=>({onClick:F,alphaGrey:A.palette.text.icon??A.palette.action.active}),[F,A]),ie=s.useMemo(()=>{if(!b)return null;const ee={description:C,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return a.jsx(a.Fragment,{children:a.jsxs(V.MenuItem,{sx:{display:"flex",color:pe=>pe.palette.text.secondary},onMouseOver:()=>{$(null)},onClick:()=>{K(null)},children:[a.jsx(V.Box,{sx:{flex:"none",boxShadow:pe=>pe.shadows[2],borderRadius:pe=>pe.spacing(.5),overflow:"hidden"},children:a.jsx(Q1,{schemeColorLookup:D,colorDef:ee,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:u,isLarge:!0,darkMode:R,compareRGB:E,swatchProps:fe})}),a.jsx(V.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:C})]})})},[b,C,D,n,o]);return a.jsxs(V.Box,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...j,children:[a.jsxs("div",{style:{position:"relative",display:"flex"},children:[a.jsxs("div",{style:{opacity:N?"0":1},children:[ie&&k===Wi.Start?a.jsxs(a.Fragment,{children:[ie,a.jsx(V.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,a.jsx(Es,{title:"Theme Colors",schemeColorLookup:D,colorDefs:L.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsx(Es,{schemeColorLookup:D,colorDefs:L.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsx(Es,{title:"Standard Colors",schemeColorLookup:D,colorDefs:L.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsxs("div",{style:{opacity:L.recentColorsLimited.length===0?"0":void 0,display:L.recentColorsLimited.length===0?"none":void 0},children:[a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsx(Es,{title:"Recent Colors",schemeColorLookup:D,colorDefs:L.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R})]}),ie&&k===Wi.End?a.jsxs(a.Fragment,{children:[a.jsx(V.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ie,a.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),re]}),a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[J,a.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),a.jsx(V.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{I()},children:N?a.jsx("div",{children:"Preset"}):a.jsx("div",{children:"Custom"})}),a.jsx(V.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{X(G)})},children:"Done"})]})]})})),p_=a.jsx(oy,{}),Cu=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=p_,tooltip:i,label:l,onPreviewColor:d,onPreviewColorImmediate:c,onSelectColor:u,variant:p=Ir.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:m=!1,darkMode:g=!1,...x}=e,y=ue(d,[d]),v=ue(c,[c]),b=ue(u,[u]),[C,k]=s.useState(()=>{}),E=o||C||n||f?.autoColor,R=r,j=s.useRef(!1),B=s.useCallback(()=>{},[]),T=ue(()=>{k(n)},[n]),_=ue(N=>{j.current||(k(N),y?.(N))},[y]),w=ue(N=>{j.current||(k(N),v?.(N))},[v]),S=ue((N,W)=>{j.current||(k(void 0),b?.(N,W))},[b]),O=s.useMemo(()=>a.jsx(V.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${E?.toCSS(g)??"transparent"}`,"& .activeColor":{fill:`${E?.toCSS(g)??"transparent"}`},"& .style_grey":{fill:N=>N.palette.text.icon??N.palette.action.active}},children:R}),[E,R,g]),P=ue(N=>{b?.(o,!1)},[b,o]),[M,A]=s.useState(!1),D=s.useCallback(N=>{const{closeFloat:W,closeFloatAll:I}=N;return a.jsx(Tf,{...f,selectedColor:n,previewColor:C,onDone:h?I:W,onKeyDown:U=>{U.which===Zt.Enter&&(h?I():W())},onPreviewColorImmediate:w,onPreviewColor:_,onSelectColor:S,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:m,darkMode:g})},[n,C,h,E,f?.autoColor,g]),L={onQuickClick:o?P:void 0,createPopupPanel:D,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:T,onPopupClose:B,tooltip:i||l||"Color",label:l,icon:O,...x};return p===Ir.Toolbar?a.jsx(Ur,{ref:t,...L}):a.jsx(Pa,{ref:t,...L})})),Ks=82,S2=e=>{const{styleColor:t,length:n=Ks,width:o=1,dashArray:r=null,sx:i,isDouble:l=!1,isAngled:d=!1,darkMode:c=!1,...u}=e;return a.jsx(V.SvgIcon,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...u,children:a.jsx(V9,{length:n,width:o,dashArray:r,isDouble:l,isAngled:d,className:"activeColor"})})},jf=s.memo(s.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:l,selectedStyle:d,onSelectStyle:c,showNone:u=!0,darkMode:p,sx:f,...h}=e,m=ue(c,[]),g=s.useCallback(b=>{const{popupContainer:C,floatReference:k,closeFloat:E,...R}=b,j=[],B=z.IBorder.BuiltInDefinitionsArray;for(let T=0;T<B.length;T++){const _=B[T];if(_.description==="None"&&!u)continue;const w=a.jsx(S2,{styleColor:l,length:Ks,width:_.width,darkMode:p,dashArray:_.pattern,isDouble:_.description.toLowerCase().includes("double"),isAngled:_.description.toLowerCase().includes("slant")});let S=null;S=o?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{marginRight:"6px"},children:_.description}),a.jsxs(V.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[a.jsx("div",{style:{flex:"1 1 100%"}}),w]})]}):_.description==="None"?"None":w,j.push(a.jsx(sr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:j3(4)},paddingLeft:"16px",background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},tooltipProps:{description:o?"":_.description},icon:null,disabled:r,onMouseDown:O=>O.preventDefault(),onMouseUp:()=>{E(),m(_.style)},onKeyDown:O=>{O.which===Zt.Enter&&E()},selected:_.style===d,parentFloat:k,children:S},T))}return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:j})},[r,u,l,d,p]),x=s.useMemo(()=>{const b=z.IBorder.BuiltInDefinitions.get(d);let C;return C=b.description==="None"?a.jsx(V.Box,{sx:{minWidth:`${Ks}px`},children:"None"}):a.jsx(S2,{styleColor:l,length:Ks,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),a.jsx(V.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:j3()}},children:C})},[d,l]),y=s.useMemo(()=>z.IBorder.BuiltInDefinitions.get(d),[d]),v={disabled:r,icon:x,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...f},createPopupPanel:g,...h};return n===Ir.Toolbar?a.jsx(Ur,{...v}):a.jsx(Pa,{...v})})),Mf=s.memo(s.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=z.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:l=!1,showStylingBefore:d=!0,onSelectBorder:c,onPreviewBorder:u,selectedBorder:p,createTemporaryBorder:f,...h}=e,m=ue(c,[c]),g=ue(u,[u]),[x,y]=s.useState(),[v,b]=s.useState(),C=x??r,k=v??n,E=p||{bottom:{style:r,color:n?.toString()}},R=ue(S=>{const O={},P=S?Object.keys(S):[];let M=!1;for(let G=0;G<P.length;G++)S[P[G]]?.style&&(O[P[G]]={style:S[P[G]].style,color:S[P[G]].color},M||O[P[G]].style===z.IBorder.StrokeStyle.None||(M=!0));P.length<6&&(M=!0);const A=M?O.left:null,D=M?O.top:null,L=M?O.right:null,N=M?O.bottom:null,W=M?O.vertical:null,I=M?O.horizontal:null;let U="";return D||A||(U+="M 3,5 H 5 V 3 H 3 "),D||(U+="M 7,5 H 9 V 3 H 7 "),D||W||(U+="M 11,5 h 2 V 3 h -2 "),D||(U+="M 15,5 h 2 V 3 h -2 "),D||L||(U+="M 19,5 h 2 V 3 h -2 "),A||(U+="M 3,9 H 5 V 7 H 3 "),W||(U+="M 11,9 h 2 V 7 h -2 "),L||(U+="M 19,9 h 2 V 7 h -2 "),I||A||(U+="M 3,13 H 5 V 11 H 3 "),I||(U+="M 7,13 H 9 V 11 H 7 "),I||W||(U+="M 11,13 h 2 v -2 h -2 "),I||L||(U+="M 19,13 h 2 v -2 h -2 "),I||(U+="M 15,13 h 2 v -2 h -2 "),A||(U+="M 3,17 H 5 V 15 H 3 "),W||(U+="M 11,17 h 2 v -2 h -2 "),L||(U+="M 19,17 h 2 v -2 h -2 "),N||A||(U+="M 3,21 H 5 V 19 H 3 "),N||(U+="M 7,21 H 9 V 19 H 7 "),N||W||(U+="M 11,21 h 2 v -2 h -2 "),N||(U+="M 15,21 h 2 v -2 h -2 "),N||L||(U+="M 19,21 h 2 v -2 h -2 "),a.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[a.jsx(V.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:a.jsx("path",{d:U})}),a.jsx(V.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:Oa}},children:a.jsx(fu,{getBorderAt:(G,Q)=>{if(!f||P.length===0)return null;const H=G.rowIndex,$=G.colIndex,F={};return H===0?(F.top=O.top,F.bottom=O.horizontal):(F.top=O.horizontal,F.bottom=O.bottom),$===0?(F.left=O.left,F.right=O.vertical):(F.left=O.vertical,F.right=O.right),f?.(F)},width:18,height:18,darkMode:l,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[k,C,l]),j=s.useCallback((S,O,P)=>{let M=null;if(S&&S.length>0){let A=null;(O||P)&&(A={style:P,color:O?.toString()??null}),M={};for(let D=0;D<S.length;D++)M[S[D]]=A}return M},[]),B=s.useCallback(S=>{m?.(S)},[]),T=s.useCallback(S=>{g?.(S)},[]),_=s.useCallback(S=>{const{closeFloatAll:O,floatReference:P}=S,M=(L,N,W="bottom",I=!1)=>{const U=j(L,k??null,I?z.IBorder.StrokeStyle.None:C??null),G=I?j([],k??null,C??null):U;return a.jsx(xr,{icon:R(G),sx:{background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},tooltipProps:{label:N,simple:!0,placement:W},onClick:()=>{O(),T(U),B(U)}})},A=a.jsxs(a.Fragment,{children:[a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom,z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical],"All Borders","top"),M([z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical],"Inner Borders","top"),M([z.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),M([z.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom],"Outside Borders","top")]}),a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[M([z.IBorder.Edge.Left],"Left Borders"),M([z.IBorder.Edge.Top],"Top Borders"),M([z.IBorder.Edge.Right],"Right Borders"),M([z.IBorder.Edge.Bottom],"Bottom Borders"),M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom,z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical,z.IBorder.Edge.DiagonalUp,z.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),D=a.jsx(a.Fragment,{children:a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[a.jsx(Cu,{variant:Ir.Toolbar,icon:a.jsx(V2,{}),selectedColor:C===z.IBorder.StrokeStyle.None?new z.Color("transparent"):k,onPreviewColor:L=>{b(L)},onSelectColor:(L,N)=>{b(L)},darkMode:l,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||C===z.IBorder.StrokeStyle.None,parentFloat:P,shouldCloseFloatAll:!1}),a.jsx(jf,{selectedStyle:C,onSelectStyle:y,styleColor:k,darkMode:l,variant:Ir.Toolbar,parentFloat:P})]})});return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:L=>L.stopPropagation(),children:[d?D:A,a.jsx(Lt,{orientation:"horizontal"}),d?A:D]})},[C,k,n,o,l]),w=s.useMemo(()=>R(E),[E,l]);return a.jsx(Ur,{ref:t,createPopupPanel:_,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:S},O)=>a.jsx(No,{label:"Borders",description:"Set the borders.",disabled:O,children:S}),onQuickClick:()=>{m?.(E)},quickButtonProps:{sx:{}},disabled:i,icon:w,...h})})),Rf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=$t.Toolbar,disabled:l=!1,autoColor:d,autoStrokeStyle:c,schemeLookup:u,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:m,...g}=e,x=ro(n,["formatBorder"]),y=o??x[0],v=y?.context()??null,b=v?.autoColor??d,C=v?.autoStyle??c,k=f??v?.quickBorder,E=m??v?.darkMode,R=p??v?.createTemporaryBorder,j=u??v?.schemeLookup,B=ue(_=>{v?.onBorderSelect&&v.onBorderSelect(_),h?.(_),y?.execute(_,r)},[y,h,r]),T=s.useCallback((_,w)=>{const{children:S,title:O,...P}=_;let M=_.children;return(y?.disabled()||l)&&(M=a.jsx("div",{children:M})),a.jsx(ll,{command:y,placement:i===$t.Toolbar?"bottom-start":"right-start",disabled:w,...P,children:M})},[y,l]);return a.jsx(Mf,{ref:t,autoColor:b,darkMode:E,autoStrokeStyle:C,createTemporaryBorder:R,schemeLookup:j,selectedBorder:k,onSelectBorder:B,createTooltip:T,disabled:l||!y||y.disabled(),...g})})),If=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("mergeToggle"),icon:ye(a.jsx(M3,{}))}),a.jsx(Re,{...p,command:u.getCommand("mergeHorizontal"),icon:ye(a.jsx(ry,{}))}),a.jsx(Re,{...p,command:u.getCommand("mergeVertical"),icon:ye(a.jsx(iy,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:u.getCommand("unmerge"),icon:ye(a.jsx(Dh,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:d,icon:ye(a.jsx(M3,{})),...l})})),Df=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("freezeToggle"),icon:ye(a.jsx(cy,{}))}),a.jsx(Re,{...p,command:u.getCommand("freezeToggleHorizontal"),icon:ye(a.jsx(ay,{}))}),a.jsx(Re,{...p,command:u.getCommand("freezeToggleVertical"),icon:ye(a.jsx(sy,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:u.getCommand("unfreeze"),icon:a.jsx(Dh,{})})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:d,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:a.jsx(ly,{}),...l})})),Lf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("find"),icon:ye(a.jsx(Y3,{}))}),a.jsx(Re,{...p,command:u.getCommand("findReplace"),icon:ye(a.jsx(Gh,{}))}),a.jsx(Re,{...p,command:u.getCommand("goto"),icon:ye(a.jsx(Mb,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:d,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:ye(a.jsx(Y3,{})),...l})})),Of=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:l=lk.DefaultFontSizes,disabled:d=!1,parentFloat:c,sx:u,...p}=e;V0(n);const f=()=>n?.state()?.toString()||"11",[h,m]=s.useState(f),g=ue(()=>{const R=parseFloat(h);isNaN(R)?m(f()):parseFloat(f())!==R&&n.execute(R,o)},[f,n,h,o]);s.useEffect(()=>{m(f())},[n?.state()]);const x=s.useMemo(()=>{if(!o)return null;const R={...o};return delete R.beforeExecute,R},[o]),y=ro(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),v=s.useMemo(()=>y?a.jsxs(V.Box,{className:Qn("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:R=>R.stopPropagation(),children:[a.jsx(Re,{command:y[0],commandHook:x,icon:ye(a.jsx(pb,{}))}),a.jsx(Re,{command:y[1],icon:ye(a.jsx(fb,{}))})]}):null,[y]),b=qr(),C=s.useMemo(()=>`${z.IFont.getSharedMeasurer()("12.3",Math.round(b.typography.fontSize),b.typography.fontFamily).width}px`,[b]),k=s.useCallback(R=>{const{onMouseDown:j,onMouseUp:B,...T}=R;return a.jsx(V.IconButton,{component:"div",...T,disableRipple:!0,children:a.jsx(V.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:_=>`1px solid ${_.palette.text.icon??_.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:_=>`1px solid ${_.palette.error.main}`},"::after":{borderBottom:_=>`1px solid ${_.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:_=>`${Math.round(_.typography.fontSize)}px`,width:C,color:_=>_.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:_=>_.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:_=>_.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:h,onFocus:_=>{_.target?.select()},onKeyDown:_=>{if(_.which===Zt.Enter)f()!==h&&(_.stopPropagation(),_.preventDefault(),g());else if(_.which===Zt.Escape)f()!==h&&(m(f()),setTimeout(()=>{_.target?.select()},0),_.stopPropagation(),_.preventDefault());else{if(_.key.match("[-]")||_.key.match("[0-9.]")&&(h+_.key).length>4)return _.stopPropagation(),void _.preventDefault();if(_.which===Zt.Space)return void _.preventDefault()}},onBlur:()=>{g()},onChange:_=>{if(_.target.value.length>4)return _.stopPropagation(),void _.preventDefault();m(_.target.value)}})})},[h,d,n]),E=s.useCallback(R=>{const j=w=>{n?.execute(w,o)},B=n?.state(),T=[];for(let w=0;w<l.length;w++){const S=l[w]===B;T.push(a.jsx(sr,{selected:S,icon:S?a.jsx(Aa,{}):void 0,disabled:d||!n||n.disabled(),onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&j(l[w])},onKeyDown:O=>{O.keyCode!==Zt.Enter&&O.keyCode!==Zt.Space||j(l[w])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:l[w]})},"fontSize-"+w))}const _=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[v,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})]});return _n({...R,children:_})},[d,n?.state(),o]);return a.jsx(Ur,{ref:t,sx:{...u},tabIndex:-1,outlined:!0,disabled:d,parentFloat:c,createPopupPanel:E,createTooltip:({children:R},j)=>a.jsx(No,{label:n?.label(),description:n?.description(),disabled:j||n?.disabled(),children:R}),createQuickButton:k,...p})})),$7=s.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:l,...d}=e;return a.jsx(sr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...l},disabled:n,selected:t,icon:t?a.jsx(Aa,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==Zt.Enter&&c.keyCode!==Zt.Space||r(i.numberFormat)},...d,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[a.jsxs(V.Typography,{component:"div",children:[i.formatType,i.formatType===z.NumberFormat.Type.Custom?"…":""]}),a.jsx(V.Typography,{variant:"caption",component:"div",sx:{color:c=>gt.alpha(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),Pf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:l=!1,parentFloat:d,...c}=e,u=ro(n,["formatNumberFormat"])[0],p=u?.state()?z.NumberFormat.Styles.lookupStyle(u?.state()).formatType:z.NumberFormat.Type.General,f=s.useMemo(()=>{if(!o)return null;const x={...o};return delete x.beforeExecute,x},[o]),h=s.useCallback((x,y)=>{const v=_=>{o?.beforeExecute?.(u,u?.state()),u.execute(_,o),o?.onExecute?.(u,u?.state())},b=u?.context()(),C=z.NumberFormat.Styles.lookupPrimary(),k=[];for(let _=0;_<C.length;_++){let w="";if(b&&!b.isEmpty())try{w=b.getNumberFormat(C[_].numberFormat).displayText}catch(O){console.warn(O)}w===""&&C[_].formatType===z.NumberFormat.Type.General&&(w="No specific format");const S=C[_].formatType===p;k.push(a.jsx($7,{selected:S,disabled:l||!u||u.disabled(),formattedValue:w,handleSetFormat:v,format:C[_]},C[_].formatType))}const E={numberFormat:"",formatType:z.NumberFormat.Type.Custom},R=p===z.NumberFormat.Type.Custom,j=a.jsx($7,{selected:R,disabled:l||!u||u.disabled(),formattedValue:R?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(u,u?.state()),y.getCommand("formatNumberDialog")?.execute(u?.state()),o?.onExecute?.(u,u?.state())},format:E,sx:{flex:"0",width:"100%"}},z.NumberFormat.Type.Custom),B=a.jsxs(V.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:_=>_.stopPropagation(),children:[a.jsx(Re,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:a.jsx(fy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:a.jsx(uy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:a.jsx(dy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ye(a.jsx(hy,{}))}),a.jsx(Re,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ye(a.jsx(py,{}))})]}),T=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[B,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),a.jsx(Lt,{orientation:"horizontal"}),j]});return _n({...x,children:T})},[u?.context(),u?.state(),o,r]),m=qr(),g=s.useMemo(()=>{const x=z.NumberFormat.Type.MediumTime;return`${z.IFont.getSharedMeasurer()(x,Math.round(m.typography.fontSize),m.typography.fontFamily).width}px`},[m]);return a.jsx(Pn,{ref:t,commands:n,sx:i,outlined:!0,disabled:l,parentFloat:d,createPopupPanel:h,createTooltip:({children:x},y)=>a.jsx(No,{label:u?.label(),description:u?.description(),disabled:y,children:x}),icon:a.jsx(V.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:x=>`${Math.round(x.typography.fontSize)}px`,color:x=>x.palette.text.secondary,fontFamily:x=>x.typography.fontFamily,width:g},children:a.jsx(V.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),ku=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"clear",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("clearAll"),icon:a.jsx(n3,{})}),a.jsx(Re,{...p,command:u.getCommand("clearFormats"),icon:ye(a.jsx(mh,{}))}),a.jsx(Re,{...p,command:u.getCommand("clearContents"),icon:ye(a.jsx(sx,{}))}),a.jsx(Re,{...p,command:u.getCommand("clearComments")}),a.jsx(Re,{...p,command:u.getCommand("clearHyperlinks")})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:d,icon:a.jsx(n3,{}),...l})})),Af=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"fill",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("fillDown"),icon:ye(a.jsx(kl,{}))}),a.jsx(Re,{...p,command:u.getCommand("fillRight"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(270deg)"}}))}),a.jsx(Re,{...p,command:u.getCommand("fillUp"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(180deg)"}}))}),a.jsx(Re,{...p,command:u.getCommand("fillLeft"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(90deg)"}}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:d,icon:ye(a.jsx(kl,{})),...l})})),Eu=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:l=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=$t.Toolbar,...p}=e,f=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=ro(n,f),{singleCommand:m,allDisabled:g}=s.useMemo(()=>{let v=null,b=0;for(let C=0;C<h.length;C++)h[C]&&!h[C]?.disabled()&&(d&&u===$t.Menuitem&&(v=b===0?h[C]:null),b++);return{singleCommand:v,allDisabled:b===0}},[h]),x=s.useMemo(()=>{const v=new Map;return v.set("insertCellsShiftDown",ye(a.jsx(z3,{}))),v.set("insertCellsShiftRight",ye(a.jsx(z3,{sx:{transform:"rotate(270deg)"}}))),v.set("insertRows",ye(a.jsx(ab,{}))),v.set("insertColumns",ye(a.jsx(B3,{}))),v},[]),y=s.useCallback((v,b)=>{let C=null;const k={variant:$t.Menuitem,commandHook:o,scope:"insertCells",disabled:i};l||(C=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:b.getCommand("addSheet"),icon:ye(a.jsx(Gi,{}))})]}));const E=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...k,command:h[0],icon:x.get(f[0])}),a.jsx(Re,{...k,command:h[1],icon:x.get(f[1])}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:h[2],icon:x.get(f[2])}),a.jsx(Re,{...k,command:h[3],icon:x.get(f[3])}),C]});return _n({...v,children:E})},[i,h,o,r,x]);return m?a.jsx(Re,{ref:t,variant:u,commandHook:o,disabled:i,command:m,icon:x.get(m.key()),...p}):a.jsx(Pn,{ref:t,variant:u,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),a.jsx("br",{}),a.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:y,icon:ye(a.jsx(B3,{})),...p})})),_u=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:l=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=$t.Toolbar,...p}=e,f=ro(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:m}=s.useMemo(()=>{let y=null,v=0;for(let b=0;b<f.length;b++)f[b]&&!f[b]?.disabled()&&(d&&u===$t.Menuitem&&(y=v===0?f[b]:null),v++);return{singleCommand:y,allDisabled:v===0}},[f]),g=s.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",ye(a.jsx(N3,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",ye(a.jsx(N3,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",ye(a.jsx(sb,{}))),y.set("deleteColumns",ye(a.jsx(V3,{}))),y},[]),x=s.useCallback((y,v)=>{const b={variant:$t.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let C=null;l||(C=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...b,command:v.getCommand("deleteSheet"),icon:ye(a.jsx(Gi,{}))})]}));const k=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:g.get("deleteCellsShiftUp")}),a.jsx(Re,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:g.get("deleteCellsShiftLeft")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...b,command:v.getCommand("deleteRows"),icon:g.get("deleteRows")}),a.jsx(Re,{...b,command:v.getCommand("deleteColumns"),icon:g.get("deleteColumns")}),C]});return _n({...y,children:k})},[i,o,r,g]);return h?a.jsx(Re,{ref:t,variant:u,commandHook:o,disabled:i,command:h,icon:g.get(h.key()),...p}):a.jsx(Pn,{ref:t,variant:u,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||m,tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),a.jsx("br",{}),a.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:x,icon:ye(a.jsx(V3,{})),...p})})),ol=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:l=$t.Toolbar,quickColor:d,panelProps:c,isSplit:u=!1,darkMode:p,icon:f,...h}=e,{autoColor:m,schemeLookup:g,recentColors:x,...y}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");V0(n);const v=n?.context();let b=d??v?.quickColor;u&&!b&&(b=new z.Color("transparent"));const C=m??v?.autoColor,k=g??v?.schemeLookup,E=x??v?.recentColors,R=p??v?.darkMode,j=s.useMemo(()=>({autoColor:C,schemeLookup:k,recentColors:E,darkMode:R,...y}),[C,k,E,R]),B=ue((_,w)=>{_&&w&&v?.addRecentColor&&v.addRecentColor(_),v?.onColorSelect&&v.onColorSelect(_),r?.(_,w),n?.execute(_,o)},[n,r,o,v]),T=s.useCallback((_,w)=>{const{children:S,title:O,...P}=_;let M=_.children;return(n?.disabled()||i)&&(M=a.jsx("div",{children:M})),a.jsx(ll,{command:n,placement:l===$t.Toolbar?"bottom-start":"right-start",disabled:w,...P,children:M})},[n,i]);return a.jsx(Cu,{ref:t,panelProps:j,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:B,variant:l===$t.Menuitem?Ir.Menuitem:Ir.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:R,...h})}));ol.displayName="ColorCommandButton";const Ff=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),u=s.useCallback((p,f)=>{const h={variant:$t.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},m=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...h,command:f.getCommand("gridlinesToggle")}),a.jsx(ol,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:a.jsx(V2,{}),panelProps:{disableAlpha:!0}}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleGridlinesRows")})]});return _n({...p,children:m})},[i,o]);return a.jsx(Pn,{ref:t,parentFloat:l,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:a.jsx(el,{command:c[0],scope:"view"}),...d})})),Tu=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"sort",disabled:i},f=u.getCommand("sortCustom"),h=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("sortAscending"),icon:ye(a.jsx($d,{}))}),a.jsx(Re,{...p,command:u.getCommand("sortDescending"),icon:ye(a.jsx(Wh,{}))}),f?a.jsx(Re,{...p,command:f,icon:ye(a.jsx(hb,{}))}):null,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:ye(a.jsx(Pd,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:ye(a.jsx(Lh,{}))})]});return _n({...c,children:h})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Organize your data so it's easier to analyze."}),a.jsx("br",{}),a.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:ye(a.jsx($d,{})),...l})})),f_=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"sort",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:ye(a.jsx(Pd,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:ye(a.jsx(Lh,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Organize your data so it's easier to analyze."}),a.jsx("br",{}),a.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:ye(a.jsx(Pd,{})),...l})})),ju=s.memo(s.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:l,scope:d,sx:c,disabled:u,commands:p,...f}=e,h=[n];!r&&i&&h.push("redo");const m=ro(p,h),g=m[0],x=m[1],y=l??g?.context?.()?.undoManager;let v=u;u||(v=!g||g.disabled(),x&&!x.disabled()&&(v=!1));const[b,C]=s.useState(0),k=s.useCallback((E,R)=>{let j=b===0?"Cancel":`${g.label()} ${b} Action${b===1?"":"s"}`,B=!1;y||(B=!0),B||(B=i?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const T=M=>{g.execute(M)},_=a.jsx(sr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:B?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{C(0)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&T(b)},onKeyDown:M=>{M.isDefaultPrevented()||M.keyCode!==Zt.Enter&&M.keyCode!==Zt.Space||T(b)},children:a.jsx(V.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:j})});if(B)return _;const w=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),S=[];for(let M=0;M<w.length;M++){const A=w[M];S.push(a.jsx(sr,{sx:{maxWidth:"360px",display:"flex"},icon:a.jsx(Gi,{}),disabled:v,selected:M<b,onMouseEnter:()=>{C(M+1)},onMouseDown:D=>{D.button===0&&D.preventDefault()},onMouseUp:D=>{D.button===0&&T(M+1)},onKeyDown:D=>{D.isDefaultPrevented()||D.keyCode!==Zt.Enter&&D.keyCode!==Zt.Space||T(M+1)},children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[a.jsx(V.Typography,{component:"div",children:A}),a.jsx(Gi,{})]})},`action:${M}`))}let O=null;if(!r&&i){const M={scope:"undo",commands:R,variant:$t.Menuitem,parentFloat:E.floatReference};O=[],O.push(a.jsx(ju,{...M,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&O.push(a.jsx(Lt,{orientation:"horizontal"},"action:redo-div"))}const P=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{E.closeFloatAll()},onMouseLeave:()=>{C(0)},children:[O,a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:S}),a.jsx(Lt,{orientation:"horizontal"}),_]});return _n({...E,children:P})},[g?.context(),g?.state(),d,y,b,v]);return a.jsx(Pn,{ref:t,commands:p,quickCommand:n,scope:d,disabled:v,label:g?.label()??(r?"Redo":"Undo"),tooltip:a.jsx(a.Fragment,{children:a.jsx("span",{children:`${g?.label()??"No"} last actions.`})}),createPopupPanel:k,icon:o??ye(r?a.jsx(Jb,{}):a.jsx(Yb,{})),selected:!1,...f})})),Ui=z.IFontCollection.getFontList(),zf=new Map;for(let e=0;e<Ui.length;e++)zf.set(Ui[e].fontRef.getFamily(),Ui[e]);const Bf=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:l,...d}=e;V0(n);const c=n?.state(),u=qr(),p=s.useMemo(()=>`${z.IFont.getSharedMeasurer()("Times New Roman",Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`,[u]),f=s.useCallback(h=>{const m=v=>{n?.execute(v,o)},g=[];for(let v=0;v<Ui.length;v++)g.push({key:Ui[v].fontRef.getFamily(),description:Ui[v].fontRef.getFamily()});zf.get(c)||g.unshift({key:c,description:c});const x=[];for(let v=0;v<g.length;v++){const b=g[v].key===c;x.push(a.jsx(sr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:b,disabled:i||!n||n.disabled(),icon:b?a.jsx(Aa,{}):void 0,onMouseUp:C=>{C.button===0&&m(g[v].key)},onMouseDown:C=>{C.button===0&&C.preventDefault()},onKeyDown:C=>{C.keyCode!==Zt.Enter&&C.keyCode!==Zt.Space||m(g[v].key)},children:a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:a.jsx(V.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>g[v]?.key},children:g[v].description})})},v+""+g[v].key))}const y=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})});return _n({...h,children:y})},[i,n?.state()]);return a.jsx(Ur,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:l,createPopupPanel:f,createTooltip:({children:h},m)=>a.jsx(No,{label:n?.label(),description:n?.description(),disabled:m,children:h}),icon:a.jsx(V.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:p},children:a.jsx(V.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:c})}),...d})})),Nf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatStrikeThroughToggle",ye(a.jsx(H3,{}))),f.set("formatSuperscriptToggle",ye(a.jsx(mb,{}))),f.set("formatSubscriptToggle",ye(a.jsx(gb,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:"textEffects",disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatStrikeThroughToggle"),icon:u.get("formatStrikeThroughToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatSuperscriptToggle"),icon:u.get("formatSuperscriptToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatSubscriptToggle"),icon:u.get("formatSubscriptToggle")})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:u.get(c)??ye(a.jsx(H3,{})),...l})})),Vf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatUnderlinedToggle",ye(a.jsx(Ic,{}))),f.set("formatUnderlinedDoubleToggle",ye(a.jsx($3,{}))),f.set("formatUnderlinedAccountingToggle",ye(a.jsx(W3,{}))),f.set("formatUnderlinedAccountingDoubleToggle",ye(a.jsx(U3,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:"underline",disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedToggle"),icon:ye(a.jsx(Ic,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ye(a.jsx($3,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ye(a.jsx(W3,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:ye(a.jsx(U3,{}))})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:u.get(c)??ye(a.jsx(Ic,{})),...l})})),Mu=s.memo(s.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:l=!0,disabled:d=!1,...c}=e,u=ue((p,f)=>{const h={variant:$t.Menuitem,commandHook:r,scope:"paste",disabled:d},m=[];return l&&(m.push(s.createElement(Re,{...h,command:f.getCommand("paste"),key:"paste",icon:a.jsx(F3,{})})),m.push(a.jsx(Lt,{orientation:"horizontal"},"paste-div"))),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ye(a.jsx(Jy,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ye(a.jsx(Qy,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ye(a.jsx(eb,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ye(a.jsx(tb,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ye(a.jsx(nb,{}))})),_n({...p,children:m})},[d,r,i,l]);return a.jsx(Pn,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:u,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:a.jsx(F3,{}),...c})})),Hf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),u=s.useCallback((p,f)=>{const h={variant:$t.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},m=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingRows")})]});return _n({...p,children:m})},[i,o,r]);return a.jsx(Pn,{ref:t,parentFloat:l,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:a.jsx(el,{command:c[0],scope:"view"}),...d})})),$f=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...l}=e,d=s.useCallback(c=>{const u={variant:$t.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowFormulaBar")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowTabs")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowStatusBar")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return _n({...c,children:p})},[i,n,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:d,icon:a.jsx(el,{icon:null,label:"Workbook View"}),...l})})),Wf=s.memo(s.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:l,sx:d,borderProps:c,disabled:u,...p}=e,f=s.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=s.useMemo(()=>f.getStyle(),[f,l]),m=s.useMemo(()=>h.getFill().toCSS(l?.darkMode??!1),[h]),g=h.getInsets(),x=h.getFont(),y=s.useCallback(()=>h.getBorder(),[h]);return a.jsx(V.Box,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:l?.fill,filter:u?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...m},"& .text":{flex:"1 1 100%",...x.toCSS(l?.darkMode??!1,1),boxSizing:"border-box",padding:`${g.top}px ${g.right}px ${g.bottom}px ${g.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:x.toCSS().textDecoration,textAlign:z.ITextFrame.toCSSHorizontalTextAlign(f.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...d},...p,children:a.jsx(fu,{getBorderAt:y,darkMode:l?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:a.jsx(V.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:a.jsx(V.Box,{className:"text",children:n})})})})})),m_=s.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:l,createTemporaryCell:d,parentFloat:c,commands:u,disabled:p,commandHook:f,...h}=e,m=s.useCallback(y=>{const v={variant:$t.Menuitem,commandHook:f,context:"cellStyle"},b=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...v,sx:{fontWeight:550},command:u.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...v,command:u.getCommand("modifyCellStyle"),commandState:{named:n}}),a.jsx(Re,{...v,command:u.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===z.IStyle.BuiltInName.Normal})]}),C=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return _n({...y,children:C})},[]),g=n?.getName()===o?.getName();let x=a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${g?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{l?.(n)},...h,children:a.jsx(Wf,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:d,bodyStyle:i})},n.getName());return r&&(x=a.jsx(up,{label:n.getName(),parentFloat:c,createPopupPanel:m,children:x})),x}),Uf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:l,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!0,...p}=e;V0(o);const f=o?.context(),h=f?.styles,m=i??f?.named(),g=c??f?.bodyStyle(),x=ue(k=>{l?.(k),o?.execute(k,r)},[o,l,r]),y=s.useCallback((k,E)=>{const R={onSelectNamed:x,styles:h(),parentFloat:k.floatReference},j=h().getCustomNamed(),B=new Map,T=[];for(let D=0;D<j.length;D++)B.set(j[D].getName(),j[D]),h().getNamed(j[D].getName()).getBuiltInID()===null&&T.push(j[D].getName());const _=D=>{let L=B.get(D);return L||(L=h().getNamed(D)),!L||L.isHidden()?null:a.jsx(m_,{namedStyle:L,selectedNamed:m,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...R},D)},w=(D,L,N=!0)=>{const W=[];for(let I=0;I<L.length;I++){const U=_(L[I]);U&&W.push(U)}return W.length===0?null:a.jsxs(V.Box,{children:[N?a.jsx(Lt,{orientation:"horizontal"}):null,a.jsx(Ji,{children:D},D+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:W},D+"-presets")]},D)},S=(D,L)=>{const N=[];for(let W=0;W<L.length;W++){const I=_(L[W]);I&&N.push(I)}return N.length===0?null:a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:N},D+"-presets")},O=[];O.push(w("Custom",T,!1)),O.push(w("Good, Bad and Neutral",[z.IStyle.BuiltInName.Normal,z.IStyle.BuiltInName.Bad,z.IStyle.BuiltInName.Good,z.IStyle.BuiltInName.Neutral],T.length>0)),O.push(w("Data and Model",[z.IStyle.BuiltInName.Calculation,z.IStyle.BuiltInName.CheckCell,z.IStyle.BuiltInName.ExplanatoryText,z.IStyle.BuiltInName.FollowedHyperlink,z.IStyle.BuiltInName.Hyperlink,z.IStyle.BuiltInName.Input,z.IStyle.BuiltInName.LinkedCell,z.IStyle.BuiltInName.Note,z.IStyle.BuiltInName.Output,z.IStyle.BuiltInName.WarningText])),O.push(w("Titles and Headings",[z.IStyle.BuiltInName.Heading1,z.IStyle.BuiltInName.Heading2,z.IStyle.BuiltInName.Heading3,z.IStyle.BuiltInName.Heading4,z.IStyle.BuiltInName.Title,z.IStyle.BuiltInName.Total]));let P=[];var M,A;return P.push(S("Accent 1",[z.IStyle.BuiltInName.Accent1_20,z.IStyle.BuiltInName.Accent1_40,z.IStyle.BuiltInName.Accent1_60,z.IStyle.BuiltInName.Accent1])),P.push(S("Accent 2",[z.IStyle.BuiltInName.Accent2_20,z.IStyle.BuiltInName.Accent2_40,z.IStyle.BuiltInName.Accent2_60,z.IStyle.BuiltInName.Accent2])),P.push(S("Accent 3",[z.IStyle.BuiltInName.Accent3_20,z.IStyle.BuiltInName.Accent3_40,z.IStyle.BuiltInName.Accent3_60,z.IStyle.BuiltInName.Accent3])),P.push(S("Accent 4",[z.IStyle.BuiltInName.Accent4_20,z.IStyle.BuiltInName.Accent4_40,z.IStyle.BuiltInName.Accent4_60,z.IStyle.BuiltInName.Accent4])),P.push(S("Accent 5",[z.IStyle.BuiltInName.Accent5_20,z.IStyle.BuiltInName.Accent5_40,z.IStyle.BuiltInName.Accent5_60,z.IStyle.BuiltInName.Accent5])),P.push(S("Accent 6",[z.IStyle.BuiltInName.Accent6_20,z.IStyle.BuiltInName.Accent6_40,z.IStyle.BuiltInName.Accent6_60,z.IStyle.BuiltInName.Accent6])),O.push((M="Themed Cell Styles",A=P,a.jsxs(V.Box,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Ji,{children:M},M+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:A},M+"-presets")]},M))),O.push(w("Number Format",[z.IStyle.BuiltInName.Comma,z.IStyle.BuiltInName.Comma0,z.IStyle.BuiltInName.Currency,z.IStyle.BuiltInName.Currency0,z.IStyle.BuiltInName.Percent])),a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:D=>`${D.shape.borderRadius}px`,paddingBottom:D=>`${D.shape.borderRadius}px`},children:[a.jsx(V.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:O}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{variant:$t.Menuitem,commandState:m,command:E.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:d,icon:ye(a.jsx(vb,{}))})]})},[m,h?.().getTheme(),g]),v=ue(k=>{const E=18/z.IFont.getDeviceScale(),R=f?.createTemporaryCell(k);return R.getStyle().getFont().getSize()<=E?R:R.createTemporaryCell({style:{font:{size:E}}})},[f?.createTemporaryCell]),b=d||!o||o.disabled(),C=s.useMemo(()=>f&&u?a.jsx(Wf,{value:m?.getName()??"Custom",cellStyle:m?{named:m.getName()}:void 0,styles:f.styles(),createTemporaryCell:v,bodyStyle:f.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:k=>`1px solid ${k.palette.action.hover}`},borderProps:{}}):ye(a.jsx(ya,{})),[m,g,b]);return a.jsx(Pn,{ref:t,createPopupPanel:y,outlined:u,commands:n,createTooltip:({children:k},E)=>a.jsx(No,{label:o?.label(),description:o?.description(),disabled:E,children:k}),selected:!1,disabled:b,label:o?.label(),icon:C,...p})})),qf="_sheetxl-reset_ods65_1",g_=10,Zf=s.memo(s.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:l,disabled:d,className:c,forceThinBorder:u,cellHeight:p=g_,isLive:f=!1,...h}=e,m=Math.ceil(1.3*p),[g,x]=s.useReducer(k=>k+1,0);s.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{x()}})},[o,f]);const y=s.useMemo(()=>{let k=o?.toJSON()??{};const E={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return k&&(k.styleOptions={...k.styleOptions,name:r.getName()}),k.ref=E,new z.Table({initialAnchor:E,json:k,styles:n})},[g,o,r,n]),v=s.useMemo(()=>{const k=[];for(let E=0;E<5;E++)for(let R=0;R<5;R++){const j=y.getStyleAt({colIndex:R,rowIndex:E});k.push(j)}return k},[y]),b=s.useMemo(()=>{const k=(R,j,B)=>{let T=B.getFill().toCSS(i?.darkMode??!1);const _=m-(j<4?1:0),w=p-(R<4?1:0),S=B.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:j*(m-1),top:R*(p-1),width:_,height:w},a.jsx("td",{className:`table-style-fill ${R}-${j}`,style:T,children:a.jsx("div",{className:`table-style-text ${R}-${j}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(_-6)/2,top:(w-1)/2,borderTop:`1px solid ${S}`}})},`${R}-${j}`)},E=[];for(let R=0;R<5;R++){const j=[];for(let B=0;B<5;B++){const T=v[5*R+B];j.push(k(R,B,T))}E.push(a.jsx("tr",{children:j},R))}return E},[y,r,i]),C=s.useCallback((k,E)=>v[E].getBorder()??null,[v]);return a.jsx(V.Box,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...l},...h,children:a.jsx(fu,{getBorderAt:C,rowCount:5,columnCount:5,forceThinBorder:u,width:5*(m-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:a.jsx("table",{className:Qn(c,"sheetxl-table-preview",qf),style:{borderCollapse:"collapse",width:5*(m-1)+1,height:5*(p-1)+1},children:a.jsx("tbody",{children:b})})})})})),Ol=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},Gf=s.memo(s.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:l,style:d,className:c,canvas:u,...p}=e,f=s.useMemo(()=>{const g=n.toJSON(),x={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return g.styleOptions={...g.styleOptions,name:o.getName()},g.ref=x,new z.Table({initialAnchor:x,json:g,styles:r})},[n,o,r]),h=s.useMemo(()=>{const g=[];for(let x=0;x<5;x++)for(let y=0;y<5;y++){const v=f.getStyleAt({colIndex:y,rowIndex:x});g.push(v)}return g},[f]),m=s.useMemo(()=>{let g=u;if(u||(g=document.createElement("canvas")),!g)return null;g.width!==61&&(g.width=61),g.height!==46&&(g.height=46);const x=g.getContext("2d",{alpha:!1});if(!x)return null;const y=12,v=i?.darkMode??!1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C].getFill();let E=i?.fill;k.getType()===z.IFill.Type.Solid?E=k.getColor().toCSS(v,!1):k.getType()===z.IFill.Type.Gradient?E=k.getStops[0]?.color.toCSS(v,!1):k.getType()===z.IFill.Type.Pattern&&(E=k.getForeground().toCSS(v,!1)),x.fillStyle=E;const R=C*y,j=9*b;x.fillRect(R,j,13,10)}x.lineWidth=1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C],E=C*y,R=9*b,j=k.getBorder();if(!j.isEmpty()){const _=j.getLeft();_.isNone()||(x.strokeStyle=_.getColor().toCSS(v,!1),Ol(x,E,R,E,R+9));const w=j.getTop();w.isNone()||(x.strokeStyle=w.getColor().toCSS(v,!1),Ol(x,E,R,E+y,9*b));const S=j.getRight();S.isNone()||(x.strokeStyle=S.getColor().toCSS(v,!1),Ol(x,E+y,R,E+y,R+9));const O=j.getBottom();O.isNone()||(x.strokeStyle=O.getColor().toCSS(v,!1),Ol(x,E,R+9,E+y,R+9))}x.strokeStyle=k.getFont().getFill().toCSS(v,!1);const B=4,T=2.5;Ol(x,C*y+T,9*b+B,C*y+T+7,9*b+B)}return`url(${g.toDataURL()})`},[u,f,o,i]);return a.jsx("div",{ref:t,className:Qn("table-style-preview",c),style:{backgroundImage:m,width:61,height:46,...d},...p})})),x_=s.memo(s.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:l,onShowTotalRowChange:d,showFilterButton:c,onShowFilterButtonChange:u,sx:p,disabled:f,...h}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:m=>`${m.spacing(2)}`,marginRight:m=>`${m.spacing(2)}`},"& .MuiCheckbox-root":{padding:m=>`${m.spacing(.5)}`},...p},...h,ref:t,children:[i&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),d&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:l??!1,indeterminate:l==null,onChange:()=>d(!l),disabled:f||l==null}),label:"Total Row",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),u&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>u(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),y_=s.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:l=!0,bodyStyle:d,parentFloat:c,commands:u,disabled:p,commandHook:f,useCanvasPreview:h=!0,canvas:m,...g}=e,x=s.useCallback(C=>{const k={variant:$t.Menuitem,commandHook:f,context:"table"},E=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...k,command:u.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Re,{...k,sx:{fontWeight:550},command:u.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:u.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:u.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]}),R=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})});return _n({...C,children:R})},[u]),y=n?.getName()===o,v=s.useMemo(()=>{const C={table:t,tableStyle:n,styles:i,bodyStyle:d};return h?a.jsx(Gf,{canvas:m,...C}):a.jsx(Zf,{...C})},[t,n,i,d]);let b=a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${y?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...g,children:v},n.getName());return l&&(b=a.jsx(up,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:x,children:b})),b}),Kf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:l,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!1,...p}=e;V0(o);const f=o?.context(),h=f?.styles,m=i??f?.table?.();let g="insertTable";m&&(g="editTable");const x=s.useMemo(()=>((T,_)=>{const w={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new z.Table({initialAnchor:w,styles:_,json:{name:"PreviewTable",ref:w,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:T}})})(m?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),m?.getStyleOptions()]),y=m??x,[v,b]=s.useState(y);s.useEffect(()=>{b(y)},[y]);const C=c??f?.bodyStyle(),k=ue(T=>{l?.(T),o?.execute({name:T},r)},[o,l,r]),E=s.useRef(null),R=s.useCallback((T,_)=>{const w={onSelectTableStyleName:k,styles:h(),parentFloat:T.floatReference};E.current||(E.current=document.createElement("canvas"));const S=I=>{const U=h().getTableStyle(I);return U?a.jsx(y_,{table:v,tableStyle:U,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:_,commandHook:r,canvas:E.current,...w},I):null},O=(I,U,G=!0)=>{const Q=[];for(let H=0;H<U.length;H++){const $=S(U[H]);$&&Q.push($)}return Q.length===0?null:a.jsxs(V.Box,{children:[G?a.jsx(Lt,{orientation:"horizontal"}):null,a.jsx(Ji,{children:I},I+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:Q},I+"-presets")]},I)},P=[],M=h().getCustomTableStyles(),A=[];if(M.length>0){for(let I=0;I<M.length;I++)M[I].isShownInTableStyles()&&A.push(M[I].getName());P.push(O("Custom",A,!1))}const D=[];m&&!m.getStyleOptions().name&&D.push(null);for(let I=0;I<21;I++)D.push("TableStyleLight"+(I+1));P.push(O("Light",D,A.length>0));const L=[];for(let I=0;I<28;I++)L.push("TableStyleMedium"+(I+1));P.push(O("Medium",L));const N=[];for(let I=0;I<11;I++)N.push("TableStyleDark"+(I+1));P.push(O("Dark",N));let W=null;return m&&(W=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{variant:$t.Menuitem,command:_.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:d,icon:ye(a.jsx(mh,{}))})]})),a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[a.jsx(V.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:P}),W]})},[h,h?.().getTheme(),C,v]),j=d||!o||o.disabled(),B=s.useMemo(()=>{if(!f||!u)return ye(a.jsx(ya,{}))},[v,C,j]);return a.jsx(Pn,{ref:t,quickCommand:g,createPopupPanel:R,commands:n,label:o?.label(),commandState:m,commandHook:r,selected:m!==null,createTooltip:({children:T},_)=>a.jsx(No,{label:o?.label(),description:o?.description(),disabled:_,children:T}),disabled:j,icon:B,...p})})),kr=[];kr.push(Nr("Primary Background","bg1")),kr.push(Nr("Primary Text","tx1")),kr.push(Nr("Secondary Background","bg2")),kr.push(Nr("Secondary Text","tx2")),kr.push(Nr("Accent 1","accent1")),kr.push(Nr("Accent 2","accent2")),kr.push(Nr("Accent 3","accent3")),kr.push(Nr("Accent 4","accent4")),kr.push(Nr("Accent 5","accent5")),kr.push(Nr("Accent 6","accent6"));const Xf=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:l,...d}=e,c=qr(),u=s.useMemo(()=>{let p=[];for(let f=0;f<kr.length;f++){const h=kr[f];p.push(a.jsx(Q1,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:a.jsx(V.Box,{sx:{display:"flex",boxShadow:f=>f.shadows[2]},children:p})})},[t,c]);return a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...d,children:a.jsxs(V.Box,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[a.jsx(V.Box,{sx:{},children:t.getName()}),a.jsxs(V.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[u,a.jsx(V.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:a.jsx(vr,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:a.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
|
|
82
|
+
`,h=!0));const m=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let g=null;o.pushEditOperations([],m,x=>(g=x[0].range,f&&g.startLineNumber++,h&&g.endLineNumber--,[new t.Selection(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)])),e.setSelection({startLineNumber:g.endLineNumber,startColumn:g.endColumn,endLineNumber:g.startLineNumber,endColumn:g.startColumn})};function l_(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function w2(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,l=e.getPositionAt(i);r.push({name:o.text,type:l_(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const i of o.childItems)w2(e,t,n,i,r);return r}function Su(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const l=r[i];if(l.start<=t&&t<l.start+l.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const d of e.childItems||[]){const c=Su(d,t,n,o);if(c)return c}}return null}}function a_(e){return e.kind==="comment"}const s_=s.memo(s.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:l,darkMode:d,loadingPanel:c,autoFocus:u=!0,onStatusChange:p,...f}=e,h=s.useRef(null),m=ue(l,[l]),g=s.useRef(!1),x=s.useMemo(()=>({contains(L){if(!h.current)return;const N=h.current.editor;return N&&N.getDomNode()?.contains(L)},focus(){if(!h.current)return;const L=h.current.editor;return L&&L.getDomNode()?.focus()}}),[]),y=s.useMemo(()=>[new je("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=s.useMemo(()=>{let L=null;const N=()=>x;return L=r?r.createChildGroup(N,"scriptEditor",!1):new rl(N,"scriptEditor"),L.addCommands(y,!0),L},[r,y]),b=ro(v,["executeSelectedScript"])[0],C=b?.context(),k=ue(L=>{b?.execute(L)},[b]),E=s.useRef(""),[R,j]=s.useState(!1),B=ue(async()=>{if(!h.current)return null;const L=h.current,N=L.editor;if(!N)return null;const W=L.monaco,I=await(async(U,G,Q="export")=>{const H=U.getModel();if(!H)return null;const $=await G.languages.typescript.getTypeScriptWorker(),F=await $(H.uri),X=await F.getNavigationTree(H.uri.toString());let K=null,ne=U.getSelection();const J=ne.startLineNumber===ne.endLineNumber&&ne.startColumn===ne.endColumn?H.getLineCount():Math.min(ne.endLineNumber,H.getLineCount());for(let re=ne.startLineNumber;!K&&re<=J;re++){const fe=Su(X,H.getOffsetAt({lineNumber:re,column:1}),"function",Q);fe&&(K=fe.text)}return K})(N,W);return p?.({message:(I??"").toUpperCase()}),I?{source:N.getValue(),name:I}:null},[p]),T=ue(async(L,N,W)=>{const I=await C.getScripts().createModule({source:W?.getValue(),declarationsOnly:!0}),U=I?I.getFunctions().search():Ht.EmptyArray;I&&(async function(G,Q){const H=[];for(let $=1;$<G.getLineCount()+1;$++){const F={startLineNumber:$,startColumn:1,endLineNumber:$,endColumn:G.getLineLength($)+1},X=G.getValueInRange(F).indexOf("modelt");X!==-1&&H.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:Q.MarkerSeverity.Hint,startLineNumber:F.startLineNumber,startColumn:X+1,endLineNumber:F.startLineNumber,endColumn:X+5})}Q.editor.setModelMarkers(G,"owner",H)}(L,N),async function(G,Q,H,$){const F=await Q.languages.typescript.getTypeScriptWorker(),X=await F(G.uri),K=await X.getNavigationTree(G.uri.toString()),ne=w2(G,Q,$,K).map(J=>{let re=null,fe=null;return J.type==="formula"?(re="formula.margin-icon",fe="Formula"):J.type==="macro"?(re="macro.margin-icon",fe="Macro"):J.type==="autoRun"&&(re="autorun.margin-icon",fe="Auto Run"),{range:new Q.Range(J.lineNumber,1,J.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:re,glyphMarginHoverMessage:fe,stickiness:Q.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});O.current&&O.current.clear(),O.current=H.createDecorationsCollection(ne)}(L,N,W,U))},[C]),_=ue(Ht.debounce(T,580),[]),w=ue(async(L=void 0)=>{if(!h.current||!C)return;const N=h.current.editor.getPosition(),W={cursor:N?N.toString():""};L!==void 0&&(W.message=L),p?.(W);const I=B();C.setSelectedFunction(I)},[C,p]);s.useEffect(()=>{if(!C)return;const L={insertSnippet:W=>{h.current?.editor&&(R?H7(h.current.editor,h.current.monaco,W):E.current=W)}};C.setEditor(L),C.setSelectedFunction(B());const N=C.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,I=C?.getScripts().getModules().getByName("scripting"),U=I?.getSource(),G=W.getValue();if((U?.length??0)===G.length&&U===G)return;await C.saveSource(W.getValue());const Q=(U?.length??0)!==G.length||U!==G;p?.({dirty:Q})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,I=C.getScripts().getModules().search()[0]?.getSource()??"";W.setValue(I)}});return()=>{N(),C.setSelectedFunction(null),C.setEditor(null)}},[C,R]),s.useEffect(()=>()=>{if(!h.current?.editor)return;const L=h.current.editor;C?.saveSource(L.getValue())},[]);const S=ue(L=>{const N=h.current;if(!N)return!1;const W=N.editor;return!!W&&(W.focus(),!0)},[]),O=s.useRef(null),P=ue((L,N)=>{h.current={monaco:N,editor:L},j(!0),w("Loading Types");const W=C.getScripts().getModules().search()[0]?.getSource()??"";L.setValue(W),Promise.resolve().then(()=>require("./Da2vqZhCoygWa4Gd.cjs")).then(U=>U.c).then(U=>{w(""),U.AutoTypings.create(L,{shareCache:!0,monaco:N,onError:G=>{G==="Not implemented yet"&&(G="Compile Errors"),console.warn("Error compiling types",G)}}).then(async G=>{const Q=L.getModel();_(Q,N,L)})}),L.addCommand("executeScript",function(U,...G){G?.[0]&&k({functionName:G?.[0]})},""),L.addAction({id:"executeScript",label:"Execute",keybindings:[N.KeyCode.F8],run:async U=>{const G=B();C.setSelectedFunction(G);const Q=await G;k(Q)}}),L.addAction({id:"saveScript",label:"Save Script",keybindings:[N.KeyMod.CtrlCmd|N.KeyCode.KeyS],run:U=>{C?.saveSource(L.getValue()).then(()=>{const G=C?.getScripts().getModules().getByName("scripting"),Q=G?.getSource(),H=L.getValue(),$=(Q?.length??0)!==H.length||Q!==H;p?.({dirty:$})})}}),L.onMouseDown(async U=>{if(U.target.type===N.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const G=U.target.position.lineNumber,Q=await N.languages.typescript.getTypeScriptWorker(),H=await Q(I.uri),$=await H.getNavigationTree(I.uri.toString()),F=L?.getValue(),X=(await C?.saveSource(F)).getFunctions().search(),K=w2(I,N,X,$).find(ne=>ne.lineNumber===G);if(K){const ne=U.event.browserEvent.button;ne===0?K.type==="macro"||K.type==="autoRun"?k({functionName:K.name}):K.type==="formula"&&C.quickInsertFunction?.(K.name):ne===2&&(console.log("Context menu for function:",K.name),U.event.browserEvent.preventDefault())}}}),L.onDidChangeModelContent(()=>{const U=L.getModel();_(U,N,L)});const I=L.getModel();(function(U,G){G.languages.registerInlayHintsProvider("typescript",{provideInlayHints(Q,H,$){const F=[];for(let X=1;X<Q.getLineCount()+1;X++){const K={startLineNumber:X,startColumn:1,endLineNumber:X,endColumn:Q.getLineLength(X)+1},ne="hint",J=Q.getValueInRange(K).indexOf("hint");J!==-1&&F.push({kind:G.languages.InlayHintKind.Type,position:{lineNumber:K.startLineNumber,column:J+ne.length+1},label:"[hint]"})}return{hints:F,dispose:()=>{}}}})})(0,N),I.onDidChangeContent(U=>{const G=C?.getScripts().getModules().getByName("scripting"),Q=G?.getSource(),H=L.getValue(),$=(Q?.length??0)!==H.length||Q!==H;p?.({dirty:$})}),L.onDidChangeCursorPosition(U=>{w()})},[C,p]),M=s.useMemo(()=>R?null:c||a.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[R,c]),A=s.useMemo(()=>{const L=C?.getScripts().getModules().getByName("scripting")?.getSource()??"";return a.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[a.jsx(s.Suspense,{children:a.jsx(r_,{theme:d?"extended-dark":"extended",options:{...i_,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:L,onValidate:N=>{let W=!1;for(let I=0;!W&&I<N?.length;I++)N[I].severity===8&&(W=!0)},beforeMount:N=>{N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),N.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),N.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),N.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let W=!1;try{const U=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),G=N.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),Q=N.editor.createModel(U,"typescript",G);N.editor.setModelMarkers(Q,"default",[]),W=!0}catch(U){console.warn("cant load types",U)}N.languages.registerLinkProvider("*",{provideLinks:(U,G)=>{const Q=[],H={links:Q},$=U.getLinesContent();for(let F=1;F<=$.length;F++){const X=$[F-1],K=N.editor.tokenize(X,"typescript");for(let ne=0;ne<K[0].length;ne++){const J=K[0]?.[ne];if(J&&J.type.startsWith("string")){let re=J.offset,fe=K[0]?.[ne+1]?.offset??X.length,ie=new N.Range(F,re+1,F,fe+1),ee=U.getValueInRange(ie);const pe=ee[0];pe!=="`"&&pe!=="'"&&pe!=='"'||(re++,ee=ee.substring(1));const Te=ee[ee.length-1];Te!=="`"&&Te!=="'"&&Te!=='"'||(re++,ee=ee.substring(0,ee.length-1));try{C.getRanges(ee)&&Q.push({range:{endColumn:fe,endLineNumber:F,startColumn:re,startLineNumber:F},tooltip:`Goto range '${ee}'`,url:`/range/${ee}`})}catch(Ae){console.warn(Ae)}}}}return H}}),N.editor.registerLinkOpener({open(U){if(U?.path?.startsWith("/range/")){try{C.getRanges(U.path.substring(7))?.select()}catch(G){console.warn("invalid range",G)}return!0}return!1}});const I=N.languages.typescript.typescriptDefaults.getCompilerOptions();N.languages.typescript.typescriptDefaults.setCompilerOptions({...I,target:N.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:N.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),E.current&&(await H7(h.current.editor,h.current.monaco,E.current),E.current=null),g.current&&requestAnimationFrame(async()=>{g.current&&N.editor.focus()}),N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),j(!0)})()},onMount:P})}),M]})},[C,v,i,M,d]),D=Ro(t,()=>({isScriptEditorElement:()=>!0,focus:L=>{S(L)},close:()=>{m?.()},getEditor:()=>C?.getEditor()}),[C]);return s.useEffect(()=>(u&&requestAnimationFrame(()=>{S()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{D.current?.contains(document.activeElement)&&S()})}),[]),a.jsx("div",{className:cr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:D,...f,children:A})})),Ef={Preset:"preset",Custom:"custom"},Wi={Start:"start",End:"end"},ad={},c_=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(ad[r])return ad[r];const i=((l,d,c,u)=>{if(typeof document>"u"&&!u)return null;const p=u?new u:document.createElement("canvas");p.width=2*c,p.height=2*c;const f=p.getContext("2d");return f?(f.fillStyle=l,f.fillRect(0,0,p.width,p.height),f.fillStyle=d,f.fillRect(0,0,c,c),f.translate(c,c),f.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return ad[r]=i,i},d_={},_f=s.memo(e=>{const{className:t,style:n=gn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:l,boxShadow:d,renderers:c=d_,children:u,...p}=e,f=u,h=s.useMemo(()=>Object.assign({borderRadius:l,boxShadow:d,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${c_(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return s.isValidElement(u)?s.cloneElement(u,{...f.props}):a.jsx("div",{style:h,...p})}),u_=s.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:l,onMouseLeave:d,onFocus:c,style:u=gn.EmptyCssProperties,children:p,alphaWhite:f,alphaGrey:h,darkMode:m,alphaCheckSize:g=7,...x}=e;if(!t)throw new Error("a selectedColor is required");const y=s.useCallback(R=>{r?.(R),R.isDefaultPrevented()||(R.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=s.useCallback(R=>{l?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,l,t]),b=s.useCallback(R=>{d?.(R),R.isDefaultPrevented()},[o,d]),C=s.useCallback(R=>{c?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),k=s.useCallback(R=>{i?.(R),R.isDefaultPrevented()||R.keyCode===Zt.Enter&&n?.(t.toRGBA())},[n,i,t]),E=s.useMemo(()=>t.toRGBA().alpha===1?null:a.jsx(_f,{size:g,white:f,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[f,h,t]);return a.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...u},tabIndex:0,...x,onClick:y,onKeyDown:k,onMouseOver:v,onMouseLeave:b,onFocus:C,children:[E,a.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(m)},children:p})]})}),Q1=s.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:l,swatchProps:d,defaultButtonSize:c=24,isLarge:u=!1,compareRGB:p=!1,darkMode:f=!1,...h}=e,m=new z.Color({val:r.definition.val,adjs:r.definition.adjs},E=>t(E)),g=p?m.toRGBA().toString():m.toString(),x=n&&(p?n.toRGBA().toString():n.toString())===g,y=o&&(p?o.toRGBA().toString():o.toString())===g,v=[];v.push({[z.IColor.AdjustmentType.Inv]:!0}),v.push({[z.IColor.AdjustmentType.Alpha]:100});const b=m.adjust(v),C=s.useCallback(()=>{i?.(r)},[i,r]),k=s.useCallback(E=>{l?.(E?r:null)},[l,r]);return a.jsx(vr,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:a.jsx("div",{style:{width:c*(u?1.2:1)+"px",height:c*(u?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:a.jsxs(u_,{selectedColor:m,title:null,onSelectColor:C,onPreviewColor:k,alphaCheckSize:u?9:void 0,darkMode:f,...d,children:[a.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(f).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:x?"1":"0"}}),a.jsx("div",{style:{position:"absolute",width:.33*c*(u?1.2:1)+"px",height:.33*c*(u?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(f).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Es=s.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:l,onPreviewColorDef:d,style:c=gn.EmptyCssProperties,compareRGB:u=!1,darkMode:p,swatchProps:f,...h}=e;let m;if(Array.isArray(o[0]))m=o;else{m=[];for(let b=0;b<o.length;b++)m.push([o[b]])}const g=s.useCallback(b=>{l?.(b)},[l]),x=s.useCallback(b=>{d?.(b)},[d]),y=s.useMemo(()=>{let b=[];for(let C=0;C<m.length;C++){let k=[],E=m[C];for(let j=0;j<E.length;j++){let B=E[j];k.push(a.jsx(Q1,{schemeColorLookup:n,colorDef:B,selectedColor:r,previewColor:i,onSelectColorDef:g,onPreviewColorDef:x,swatchProps:f,compareRGB:u,darkMode:p},C+" "+j))}let R=a.jsx(V.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:j=>j.shadows[2],borderRadius:"2px",overflow:"hidden"},children:k},""+C);b.push(R)}return b},[m,r,i,g,x]),v=s.useMemo(()=>t?a.jsx(V.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:b=>b.palette.text.secondary},children:t}):null,[t]);return a.jsxs(V.Box,{style:{...c},children:[v,a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:y})]})}),Nr=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),go=(e,t,n,o,r,i)=>{const l=Nr(e,t);o?.push(l);const d=new z.Color({val:l.definition.val,adjs:l.definition.adjs},n),c=d.toString();r?.set(c,d);const u=d.toRGBA().toString();i?.set(u,d)},h_=s.lazy(()=>Promise.resolve().then(()=>require("./CfR-erRBEERmc9wX.cjs"))),Tf=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:l=!1,previewDebounceTime:d=100,initialPanelType:c,defaultButtonSize:u=24,width:p,onElementLoad:f,onDone:h,onEyeDropStart:m,onEyeDropStop:g,onPreviewColor:x,onPreviewColorImmediate:y,onSelectColor:v,autoColor:b,autoColorLabel:C="Automatic",autoColorPosition:k=Wi.Start,compareRGB:E=!1,darkMode:R=!1,...j}=e,B=o||n,T=ue(x,[x]),_=ue(y,[y]),w=ue(v,[v]),S=ue(m,[m]),O=ue(g,[g]),[P,M]=s.useState(!1),A=qr(),D=s.useMemo(()=>i||z.Color.getDefaultSchemeLookup(),[i]),L=s.useMemo(()=>{const ee=new Map,pe=new Map,Te=[];go("Primary Background","bg1",D,Te,ee,pe),go("Primary Text","tx1",D,Te,ee,pe),go("Secondary Background","bg2",D,Te,ee,pe),go("Secondary Text","tx2",D,Te,ee,pe),go("Accent 1","accent1",D,Te,ee,pe),go("Accent 2","accent2",D,Te,ee,pe),go("Accent 3","accent3",D,Te,ee,pe),go("Accent 4","accent4",D,Te,ee,pe),go("Accent 5","accent5",D,Te,ee,pe),go("Accent 6","accent6",D,Te,ee,pe);const Ae=z.ITheme.buildPalette(Te,D,ee,pe),ae=[];if(go("Dark Red","C00000",D,ae,ee,pe),go("Red","FF0000",D,ae,ee,pe),go("Orange","FFC000",D,ae,ee,pe),go("Yellow","FFFF00",D,ae,ee,pe),go("Light Green","92D050",D,ae,ee,pe),go("Green","00B050",D,ae,ee,pe),go("Light Blue","00B0F0",D,ae,ee,pe),go("Blue","0070C0",D,ae,ee,pe),go("Dark Blue","002060",D,ae,ee,pe),l?go("Purple Is A Fruit","7030A0",D,ae,ee,pe):go("Transparent","00000000",D,ae,ee,pe),b){const Ye=b.toString();ee.set(Ye,b)}const he=new Map,we=typeof r=="function"?r():r,He=[];for(let Ye=0;we&&Ye<we.length;Ye++){const wt=we[Ye].toString();he.set(wt,we[Ye]),He.push({description:"Recent "+(Ye+1),definition:{val:we[Ye].toString()}})}return{primaryColors:Te,modifiedPresets:Ae,standardColors:ae,recentColorsLimited:He,mapAllPresets:ee,mapAllPresetsRGB:pe,mapRecent:he}},[D,r,l,b]);s.useEffect(()=>{f?.()},[]);const[N,W]=s.useState(!1),I=s.useCallback(()=>{W(ee=>!ee)},[]);s.useEffect(()=>{if(c)W(c===Ef.Custom);else if(n){let ee=n.toString(),pe=L.mapAllPresets.get(ee);pe||(ee=n.toRGBA().toString(),pe=L.mapAllPresetsRGB.get(ee));const Te=L.mapRecent.get(ee);W(!pe&&!Te)}},[n,c]);const U=s.useCallback(z.CommonUtils.debounce(ee=>{T?.(ee)},d),[T,d]),[G,Q]=s.useState();s.useEffect(()=>{Q(o||n)},[o,n]);const H=ue(ee=>{_&&(_(ee),U(ee))},[_]),$=ue(ee=>{H(ee?new z.Color({val:ee.definition.val,adjs:ee.definition.adjs},D):null)},[D]),F=s.useCallback(ee=>{ee.ctrlKey&&W(!0)},[]),X=ue(ee=>{let pe=!1;if(ee){const Te=ee.toString();pe=!L.mapAllPresets.has(Te)}w?.(ee,pe)},[w,L]),K=ue(ee=>{const pe=ee?new z.Color({val:ee.definition.val,adjs:ee.definition.adjs},D):null;Promise.resolve(h?.()).then(()=>{X(pe)})},[D,h]),ne=ue(ee=>{H(ee?new z.Color(ee,D):null)},[D]),J=s.useMemo(()=>window.EyeDropper===void 0?a.jsx(a.Fragment,{}):a.jsx(V.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:ee=>ee.palette.text.icon??ee.palette.action.active},onClick:async()=>{M(!0),S?.(),await new EyeDropper().open().then(ee=>{M(!1),O?.();let pe=new z.Color(ee.sRGBHex),Te=pe.toString(),Ae=L.mapAllPresets.get(Te);if(Ae||(Te=pe.toRGBA().toString(),Ae=L.mapAllPresetsRGB.get(Te)),!Ae){const ae=pe.toRGBA(),he=3;let we=255;L.mapAllPresetsRGB.forEach((He,Ye)=>{const wt=He.toRGBA(),Ct=Math.abs(wt.red-ae.red)+Math.abs(wt.blue-ae.blue)+Math.abs(wt.green-ae.green);Ct<he&&Ct<we&&(Ae=He)})}W(!Ae),H(Ae||pe)}).catch(ee=>{M(!1),ee?.name!=="AbortError"&&console.error(ee)})},children:a.jsx(wn.Colorize,{})}),[L,R]),re=s.useMemo(()=>{if(!N)return;const ee={opacity:N?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return a.jsx(s.Suspense,{fallback:a.jsx("div",{style:ee,children:a.jsx(il,{})}),children:a.jsx(h_,{style:ee,selectedColor:B?B.toRGBA().toString():"transparent",onColorChange:ne,disableAlpha:l})})},[N,B]),fe=s.useMemo(()=>({onClick:F,alphaGrey:A.palette.text.icon??A.palette.action.active}),[F,A]),ie=s.useMemo(()=>{if(!b)return null;const ee={description:C,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return a.jsx(a.Fragment,{children:a.jsxs(V.MenuItem,{sx:{display:"flex",color:pe=>pe.palette.text.secondary},onMouseOver:()=>{$(null)},onClick:()=>{K(null)},children:[a.jsx(V.Box,{sx:{flex:"none",boxShadow:pe=>pe.shadows[2],borderRadius:pe=>pe.spacing(.5),overflow:"hidden"},children:a.jsx(Q1,{schemeColorLookup:D,colorDef:ee,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:u,isLarge:!0,darkMode:R,compareRGB:E,swatchProps:fe})}),a.jsx(V.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:C})]})})},[b,C,D,n,o]);return a.jsxs(V.Box,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...j,children:[a.jsxs("div",{style:{position:"relative",display:"flex"},children:[a.jsxs("div",{style:{opacity:N?"0":1},children:[ie&&k===Wi.Start?a.jsxs(a.Fragment,{children:[ie,a.jsx(V.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,a.jsx(Es,{title:"Theme Colors",schemeColorLookup:D,colorDefs:L.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsx(Es,{schemeColorLookup:D,colorDefs:L.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsx(Es,{title:"Standard Colors",schemeColorLookup:D,colorDefs:L.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R}),a.jsxs("div",{style:{opacity:L.recentColorsLimited.length===0?"0":void 0,display:L.recentColorsLimited.length===0?"none":void 0},children:[a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsx(Es,{title:"Recent Colors",schemeColorLookup:D,colorDefs:L.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:fe,onPreviewColorDef:$,onSelectColorDef:K,compareRGB:E,darkMode:R})]}),ie&&k===Wi.End?a.jsxs(a.Fragment,{children:[a.jsx(V.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ie,a.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),re]}),a.jsx(V.Divider,{light:!0,style:{marginBottom:"10px"}}),a.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[J,a.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),a.jsx(V.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{I()},children:N?a.jsx("div",{children:"Preset"}):a.jsx("div",{children:"Custom"})}),a.jsx(V.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{X(G)})},children:"Done"})]})]})})),p_=a.jsx(oy,{}),Cu=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=p_,tooltip:i,label:l,onPreviewColor:d,onPreviewColorImmediate:c,onSelectColor:u,variant:p=Ir.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:m=!1,darkMode:g=!1,...x}=e,y=ue(d,[d]),v=ue(c,[c]),b=ue(u,[u]),[C,k]=s.useState(()=>{}),E=o||C||n||f?.autoColor,R=r,j=s.useRef(!1),B=s.useCallback(()=>{},[]),T=ue(()=>{k(n)},[n]),_=ue(N=>{j.current||(k(N),y?.(N))},[y]),w=ue(N=>{j.current||(k(N),v?.(N))},[v]),S=ue((N,W)=>{j.current||(k(void 0),b?.(N,W))},[b]),O=s.useMemo(()=>a.jsx(V.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${E?.toCSS(g)??"transparent"}`,"& .activeColor":{fill:`${E?.toCSS(g)??"transparent"}`},"& .style_grey":{fill:N=>N.palette.text.icon??N.palette.action.active}},children:R}),[E,R,g]),P=ue(N=>{b?.(o,!1)},[b,o]),[M,A]=s.useState(!1),D=s.useCallback(N=>{const{closeFloat:W,closeFloatAll:I}=N;return a.jsx(Tf,{...f,selectedColor:n,previewColor:C,onDone:h?I:W,onKeyDown:U=>{U.which===Zt.Enter&&(h?I():W())},onPreviewColorImmediate:w,onPreviewColor:_,onSelectColor:S,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:m,darkMode:g})},[n,C,h,E,f?.autoColor,g]),L={onQuickClick:o?P:void 0,createPopupPanel:D,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:T,onPopupClose:B,tooltip:i||l||"Color",label:l,icon:O,...x};return p===Ir.Toolbar?a.jsx(Ur,{ref:t,...L}):a.jsx(Pa,{ref:t,...L})})),Ks=82,S2=e=>{const{styleColor:t,length:n=Ks,width:o=1,dashArray:r=null,sx:i,isDouble:l=!1,isAngled:d=!1,darkMode:c=!1,...u}=e;return a.jsx(V.SvgIcon,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...u,children:a.jsx(V9,{length:n,width:o,dashArray:r,isDouble:l,isAngled:d,className:"activeColor"})})},jf=s.memo(s.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:l,selectedStyle:d,onSelectStyle:c,showNone:u=!0,darkMode:p,sx:f,...h}=e,m=ue(c,[]),g=s.useCallback(b=>{const{popupContainer:C,floatReference:k,closeFloat:E,...R}=b,j=[],B=z.IBorder.BuiltInDefinitionsArray;for(let T=0;T<B.length;T++){const _=B[T];if(_.description==="None"&&!u)continue;const w=a.jsx(S2,{styleColor:l,length:Ks,width:_.width,darkMode:p,dashArray:_.pattern,isDouble:_.description.toLowerCase().includes("double"),isAngled:_.description.toLowerCase().includes("slant")});let S=null;S=o?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{marginRight:"6px"},children:_.description}),a.jsxs(V.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[a.jsx("div",{style:{flex:"1 1 100%"}}),w]})]}):_.description==="None"?"None":w,j.push(a.jsx(sr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:j3(4)},paddingLeft:"16px",background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},tooltipProps:{description:o?"":_.description},icon:null,disabled:r,onMouseDown:O=>O.preventDefault(),onMouseUp:()=>{E(),m(_.style)},onKeyDown:O=>{O.which===Zt.Enter&&E()},selected:_.style===d,parentFloat:k,children:S},T))}return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:j})},[r,u,l,d,p]),x=s.useMemo(()=>{const b=z.IBorder.BuiltInDefinitions.get(d);let C;return C=b.description==="None"?a.jsx(V.Box,{sx:{minWidth:`${Ks}px`},children:"None"}):a.jsx(S2,{styleColor:l,length:Ks,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),a.jsx(V.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:j3()}},children:C})},[d,l]),y=s.useMemo(()=>z.IBorder.BuiltInDefinitions.get(d),[d]),v={disabled:r,icon:x,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...f},createPopupPanel:g,...h};return n===Ir.Toolbar?a.jsx(Ur,{...v}):a.jsx(Pa,{...v})})),Mf=s.memo(s.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=z.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:l=!1,showStylingBefore:d=!0,onSelectBorder:c,onPreviewBorder:u,selectedBorder:p,createTemporaryBorder:f,...h}=e,m=ue(c,[c]),g=ue(u,[u]),[x,y]=s.useState(),[v,b]=s.useState(),C=x??r,k=v??n,E=p||{bottom:{style:r,color:n?.toString()}},R=ue(S=>{const O={},P=S?Object.keys(S):[];let M=!1;for(let G=0;G<P.length;G++)S[P[G]]?.style&&(O[P[G]]={style:S[P[G]].style,color:S[P[G]].color},M||O[P[G]].style===z.IBorder.StrokeStyle.None||(M=!0));P.length<6&&(M=!0);const A=M?O.left:null,D=M?O.top:null,L=M?O.right:null,N=M?O.bottom:null,W=M?O.vertical:null,I=M?O.horizontal:null;let U="";return D||A||(U+="M 3,5 H 5 V 3 H 3 "),D||(U+="M 7,5 H 9 V 3 H 7 "),D||W||(U+="M 11,5 h 2 V 3 h -2 "),D||(U+="M 15,5 h 2 V 3 h -2 "),D||L||(U+="M 19,5 h 2 V 3 h -2 "),A||(U+="M 3,9 H 5 V 7 H 3 "),W||(U+="M 11,9 h 2 V 7 h -2 "),L||(U+="M 19,9 h 2 V 7 h -2 "),I||A||(U+="M 3,13 H 5 V 11 H 3 "),I||(U+="M 7,13 H 9 V 11 H 7 "),I||W||(U+="M 11,13 h 2 v -2 h -2 "),I||L||(U+="M 19,13 h 2 v -2 h -2 "),I||(U+="M 15,13 h 2 v -2 h -2 "),A||(U+="M 3,17 H 5 V 15 H 3 "),W||(U+="M 11,17 h 2 v -2 h -2 "),L||(U+="M 19,17 h 2 v -2 h -2 "),N||A||(U+="M 3,21 H 5 V 19 H 3 "),N||(U+="M 7,21 H 9 V 19 H 7 "),N||W||(U+="M 11,21 h 2 v -2 h -2 "),N||(U+="M 15,21 h 2 v -2 h -2 "),N||L||(U+="M 19,21 h 2 v -2 h -2 "),a.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[a.jsx(V.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:a.jsx("path",{d:U})}),a.jsx(V.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:Oa}},children:a.jsx(fu,{getBorderAt:(G,Q)=>{if(!f||P.length===0)return null;const H=G.rowIndex,$=G.colIndex,F={};return H===0?(F.top=O.top,F.bottom=O.horizontal):(F.top=O.horizontal,F.bottom=O.bottom),$===0?(F.left=O.left,F.right=O.vertical):(F.left=O.vertical,F.right=O.right),f?.(F)},width:18,height:18,darkMode:l,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[k,C,l]),j=s.useCallback((S,O,P)=>{let M=null;if(S&&S.length>0){let A=null;(O||P)&&(A={style:P,color:O?.toString()??null}),M={};for(let D=0;D<S.length;D++)M[S[D]]=A}return M},[]),B=s.useCallback(S=>{m?.(S)},[]),T=s.useCallback(S=>{g?.(S)},[]),_=s.useCallback(S=>{const{closeFloatAll:O,floatReference:P}=S,M=(L,N,W="bottom",I=!1)=>{const U=j(L,k??null,I?z.IBorder.StrokeStyle.None:C??null),G=I?j([],k??null,C??null):U;return a.jsx(xr,{icon:R(G),sx:{background:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},tooltipProps:{label:N,simple:!0,placement:W},onClick:()=>{O(),T(U),B(U)}})},A=a.jsxs(a.Fragment,{children:[a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom,z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical],"All Borders","top"),M([z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical],"Inner Borders","top"),M([z.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),M([z.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom],"Outside Borders","top")]}),a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[M([z.IBorder.Edge.Left],"Left Borders"),M([z.IBorder.Edge.Top],"Top Borders"),M([z.IBorder.Edge.Right],"Right Borders"),M([z.IBorder.Edge.Bottom],"Bottom Borders"),M([z.IBorder.Edge.Left,z.IBorder.Edge.Top,z.IBorder.Edge.Right,z.IBorder.Edge.Bottom,z.IBorder.Edge.Horizontal,z.IBorder.Edge.Vertical,z.IBorder.Edge.DiagonalUp,z.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),D=a.jsx(a.Fragment,{children:a.jsxs(V.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[a.jsx(Cu,{variant:Ir.Toolbar,icon:a.jsx(V2,{}),selectedColor:C===z.IBorder.StrokeStyle.None?new z.Color("transparent"):k,onPreviewColor:L=>{b(L)},onSelectColor:(L,N)=>{b(L)},darkMode:l,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||C===z.IBorder.StrokeStyle.None,parentFloat:P,shouldCloseFloatAll:!1}),a.jsx(jf,{selectedStyle:C,onSelectStyle:y,styleColor:k,darkMode:l,variant:Ir.Toolbar,parentFloat:P})]})});return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:L=>L.stopPropagation(),children:[d?D:A,a.jsx(Lt,{orientation:"horizontal"}),d?A:D]})},[C,k,n,o,l]),w=s.useMemo(()=>R(E),[E,l]);return a.jsx(Ur,{ref:t,createPopupPanel:_,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:S},O)=>a.jsx(No,{label:"Borders",description:"Set the borders.",disabled:O,children:S}),onQuickClick:()=>{m?.(E)},quickButtonProps:{sx:{}},disabled:i,icon:w,...h})})),Rf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=$t.Toolbar,disabled:l=!1,autoColor:d,autoStrokeStyle:c,schemeLookup:u,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:m,...g}=e,x=ro(n,["formatBorder"]),y=o??x[0],v=y?.context()??null,b=v?.autoColor??d,C=v?.autoStyle??c,k=f??v?.quickBorder,E=m??v?.darkMode,R=p??v?.createTemporaryBorder,j=u??v?.schemeLookup,B=ue(_=>{v?.onBorderSelect&&v.onBorderSelect(_),h?.(_),y?.execute(_,r)},[y,h,r]),T=s.useCallback((_,w)=>{const{children:S,title:O,...P}=_;let M=_.children;return(y?.disabled()||l)&&(M=a.jsx("div",{children:M})),a.jsx(ll,{command:y,placement:i===$t.Toolbar?"bottom-start":"right-start",disabled:w,...P,children:M})},[y,l]);return a.jsx(Mf,{ref:t,autoColor:b,darkMode:E,autoStrokeStyle:C,createTemporaryBorder:R,schemeLookup:j,selectedBorder:k,onSelectBorder:B,createTooltip:T,disabled:l||!y||y.disabled(),...g})})),If=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("mergeToggle"),icon:ye(a.jsx(M3,{}))}),a.jsx(Re,{...p,command:u.getCommand("mergeHorizontal"),icon:ye(a.jsx(ry,{}))}),a.jsx(Re,{...p,command:u.getCommand("mergeVertical"),icon:ye(a.jsx(iy,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:u.getCommand("unmerge"),icon:ye(a.jsx(Dh,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:d,icon:ye(a.jsx(M3,{})),...l})})),Df=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("freezeToggle"),icon:ye(a.jsx(cy,{}))}),a.jsx(Re,{...p,command:u.getCommand("freezeToggleHorizontal"),icon:ye(a.jsx(ay,{}))}),a.jsx(Re,{...p,command:u.getCommand("freezeToggleVertical"),icon:ye(a.jsx(sy,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:u.getCommand("unfreeze"),icon:a.jsx(Dh,{})})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:d,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:a.jsx(ly,{}),...l})})),Lf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:r,disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("find"),icon:ye(a.jsx(Y3,{}))}),a.jsx(Re,{...p,command:u.getCommand("findReplace"),icon:ye(a.jsx(Gh,{}))}),a.jsx(Re,{...p,command:u.getCommand("goto"),icon:ye(a.jsx(Mb,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:d,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:ye(a.jsx(Y3,{})),...l})})),Of=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:l=lk.DefaultFontSizes,disabled:d=!1,parentFloat:c,sx:u,...p}=e;V0(n);const f=()=>n?.state()?.toString()||"11",[h,m]=s.useState(f),g=ue(()=>{const R=parseFloat(h);isNaN(R)?m(f()):parseFloat(f())!==R&&n.execute(R,o)},[f,n,h,o]);s.useEffect(()=>{m(f())},[n?.state()]);const x=s.useMemo(()=>{if(!o)return null;const R={...o};return delete R.beforeExecute,R},[o]),y=ro(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),v=s.useMemo(()=>y?a.jsxs(V.Box,{className:Qn("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:R=>R.stopPropagation(),children:[a.jsx(Re,{command:y[0],commandHook:x,icon:ye(a.jsx(pb,{}))}),a.jsx(Re,{command:y[1],icon:ye(a.jsx(fb,{}))})]}):null,[y]),b=qr(),C=s.useMemo(()=>`${z.IFont.getSharedMeasurer()("12.3",Math.round(b.typography.fontSize),b.typography.fontFamily).width}px`,[b]),k=s.useCallback(R=>{const{onMouseDown:j,onMouseUp:B,...T}=R;return a.jsx(V.IconButton,{component:"div",...T,disableRipple:!0,children:a.jsx(V.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:_=>`1px solid ${_.palette.text.icon??_.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:_=>`1px solid ${_.palette.error.main}`},"::after":{borderBottom:_=>`1px solid ${_.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:_=>`${Math.round(_.typography.fontSize)}px`,width:C,color:_=>_.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:_=>_.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:_=>_.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:h,onFocus:_=>{_.target?.select()},onKeyDown:_=>{if(_.which===Zt.Enter)f()!==h&&(_.stopPropagation(),_.preventDefault(),g());else if(_.which===Zt.Escape)f()!==h&&(m(f()),setTimeout(()=>{_.target?.select()},0),_.stopPropagation(),_.preventDefault());else{if(_.key.match("[-]")||_.key.match("[0-9.]")&&(h+_.key).length>4)return _.stopPropagation(),void _.preventDefault();if(_.which===Zt.Space)return void _.preventDefault()}},onBlur:()=>{g()},onChange:_=>{if(_.target.value.length>4)return _.stopPropagation(),void _.preventDefault();m(_.target.value)}})})},[h,d,n]),E=s.useCallback(R=>{const j=w=>{n?.execute(w,o)},B=n?.state(),T=[];for(let w=0;w<l.length;w++){const S=l[w]===B;T.push(a.jsx(sr,{selected:S,icon:S?a.jsx(Aa,{}):void 0,disabled:d||!n||n.disabled(),onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&j(l[w])},onKeyDown:O=>{O.keyCode!==Zt.Enter&&O.keyCode!==Zt.Space||j(l[w])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:l[w]})},"fontSize-"+w))}const _=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[v,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})]});return _n({...R,children:_})},[d,n?.state(),o]);return a.jsx(Ur,{ref:t,sx:{...u},tabIndex:-1,outlined:!0,disabled:d,parentFloat:c,createPopupPanel:E,createTooltip:({children:R},j)=>a.jsx(No,{label:n?.label(),description:n?.description(),disabled:j||n?.disabled(),children:R}),createQuickButton:k,...p})})),$7=s.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:l,...d}=e;return a.jsx(sr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...l},disabled:n,selected:t,icon:t?a.jsx(Aa,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==Zt.Enter&&c.keyCode!==Zt.Space||r(i.numberFormat)},...d,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[a.jsxs(V.Typography,{component:"div",children:[i.formatType,i.formatType===z.NumberFormat.Type.Custom?"…":""]}),a.jsx(V.Typography,{variant:"caption",component:"div",sx:{color:c=>gt.alpha(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),Pf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:l=!1,parentFloat:d,...c}=e,u=ro(n,["formatNumberFormat"])[0],p=u?.state()?z.NumberFormat.Styles.lookupStyle(u?.state()).formatType:z.NumberFormat.Type.General,f=s.useMemo(()=>{if(!o)return null;const x={...o};return delete x.beforeExecute,x},[o]),h=s.useCallback((x,y)=>{const v=_=>{o?.beforeExecute?.(u,u?.state()),u.execute(_,o),o?.onExecute?.(u,u?.state())},b=u?.context()(),C=z.NumberFormat.Styles.lookupPrimary(),k=[];for(let _=0;_<C.length;_++){let w="";if(b&&!b.isEmpty())try{w=b.getNumberFormat(C[_].numberFormat).displayText}catch(O){console.warn(O)}w===""&&C[_].formatType===z.NumberFormat.Type.General&&(w="No specific format");const S=C[_].formatType===p;k.push(a.jsx($7,{selected:S,disabled:l||!u||u.disabled(),formattedValue:w,handleSetFormat:v,format:C[_]},C[_].formatType))}const E={numberFormat:"",formatType:z.NumberFormat.Type.Custom},R=p===z.NumberFormat.Type.Custom,j=a.jsx($7,{selected:R,disabled:l||!u||u.disabled(),formattedValue:R?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(u,u?.state()),y.getCommand("formatNumberDialog")?.execute(u?.state()),o?.onExecute?.(u,u?.state())},format:E,sx:{flex:"0",width:"100%"}},z.NumberFormat.Type.Custom),B=a.jsxs(V.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:_=>_.stopPropagation(),children:[a.jsx(Re,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:a.jsx(fy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:a.jsx(uy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:a.jsx(dy,{})}),a.jsx(Re,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ye(a.jsx(hy,{}))}),a.jsx(Re,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ye(a.jsx(py,{}))})]}),T=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[B,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),a.jsx(Lt,{orientation:"horizontal"}),j]});return _n({...x,children:T})},[u?.context(),u?.state(),o,r]),m=qr(),g=s.useMemo(()=>{const x=z.NumberFormat.Type.MediumTime;return`${z.IFont.getSharedMeasurer()(x,Math.round(m.typography.fontSize),m.typography.fontFamily).width}px`},[m]);return a.jsx(Pn,{ref:t,commands:n,sx:i,outlined:!0,disabled:l,parentFloat:d,createPopupPanel:h,createTooltip:({children:x},y)=>a.jsx(No,{label:u?.label(),description:u?.description(),disabled:y,children:x}),icon:a.jsx(V.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:x=>`${Math.round(x.typography.fontSize)}px`,color:x=>x.palette.text.secondary,fontFamily:x=>x.typography.fontFamily,width:g},children:a.jsx(V.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),ku=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"clear",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("clearAll"),icon:a.jsx(n3,{})}),a.jsx(Re,{...p,command:u.getCommand("clearFormats"),icon:ye(a.jsx(mh,{}))}),a.jsx(Re,{...p,command:u.getCommand("clearContents"),icon:ye(a.jsx(sx,{}))}),a.jsx(Re,{...p,command:u.getCommand("clearComments")}),a.jsx(Re,{...p,command:u.getCommand("clearHyperlinks")})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:d,icon:a.jsx(n3,{}),...l})})),Af=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"fill",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("fillDown"),icon:ye(a.jsx(kl,{}))}),a.jsx(Re,{...p,command:u.getCommand("fillRight"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(270deg)"}}))}),a.jsx(Re,{...p,command:u.getCommand("fillUp"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(180deg)"}}))}),a.jsx(Re,{...p,command:u.getCommand("fillLeft"),icon:ye(a.jsx(kl,{sx:{transform:"rotate(90deg)"}}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:d,icon:ye(a.jsx(kl,{})),...l})})),Eu=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:l=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=$t.Toolbar,...p}=e,f=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=ro(n,f),{singleCommand:m,allDisabled:g}=s.useMemo(()=>{let v=null,b=0;for(let C=0;C<h.length;C++)h[C]&&!h[C]?.disabled()&&(d&&u===$t.Menuitem&&(v=b===0?h[C]:null),b++);return{singleCommand:v,allDisabled:b===0}},[h]),x=s.useMemo(()=>{const v=new Map;return v.set("insertCellsShiftDown",ye(a.jsx(z3,{}))),v.set("insertCellsShiftRight",ye(a.jsx(z3,{sx:{transform:"rotate(270deg)"}}))),v.set("insertRows",ye(a.jsx(ab,{}))),v.set("insertColumns",ye(a.jsx(B3,{}))),v},[]),y=s.useCallback((v,b)=>{let C=null;const k={variant:$t.Menuitem,commandHook:o,scope:"insertCells",disabled:i};l||(C=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:b.getCommand("addSheet"),icon:ye(a.jsx(Gi,{}))})]}));const E=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...k,command:h[0],icon:x.get(f[0])}),a.jsx(Re,{...k,command:h[1],icon:x.get(f[1])}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:h[2],icon:x.get(f[2])}),a.jsx(Re,{...k,command:h[3],icon:x.get(f[3])}),C]});return _n({...v,children:E})},[i,h,o,r,x]);return m?a.jsx(Re,{ref:t,variant:u,commandHook:o,disabled:i,command:m,icon:x.get(m.key()),...p}):a.jsx(Pn,{ref:t,variant:u,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),a.jsx("br",{}),a.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:y,icon:ye(a.jsx(B3,{})),...p})})),_u=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:l=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=$t.Toolbar,...p}=e,f=ro(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:m}=s.useMemo(()=>{let y=null,v=0;for(let b=0;b<f.length;b++)f[b]&&!f[b]?.disabled()&&(d&&u===$t.Menuitem&&(y=v===0?f[b]:null),v++);return{singleCommand:y,allDisabled:v===0}},[f]),g=s.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",ye(a.jsx(N3,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",ye(a.jsx(N3,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",ye(a.jsx(sb,{}))),y.set("deleteColumns",ye(a.jsx(V3,{}))),y},[]),x=s.useCallback((y,v)=>{const b={variant:$t.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let C=null;l||(C=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...b,command:v.getCommand("deleteSheet"),icon:ye(a.jsx(Gi,{}))})]}));const k=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:g.get("deleteCellsShiftUp")}),a.jsx(Re,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:g.get("deleteCellsShiftLeft")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...b,command:v.getCommand("deleteRows"),icon:g.get("deleteRows")}),a.jsx(Re,{...b,command:v.getCommand("deleteColumns"),icon:g.get("deleteColumns")}),C]});return _n({...y,children:k})},[i,o,r,g]);return h?a.jsx(Re,{ref:t,variant:u,commandHook:o,disabled:i,command:h,icon:g.get(h.key()),...p}):a.jsx(Pn,{ref:t,variant:u,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||m,tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),a.jsx("br",{}),a.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:x,icon:ye(a.jsx(V3,{})),...p})})),ol=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:l=$t.Toolbar,quickColor:d,panelProps:c,isSplit:u=!1,darkMode:p,icon:f,...h}=e,{autoColor:m,schemeLookup:g,recentColors:x,...y}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");V0(n);const v=n?.context();let b=d??v?.quickColor;u&&!b&&(b=new z.Color("transparent"));const C=m??v?.autoColor,k=g??v?.schemeLookup,E=x??v?.recentColors,R=p??v?.darkMode,j=s.useMemo(()=>({autoColor:C,schemeLookup:k,recentColors:E,darkMode:R,...y}),[C,k,E,R]),B=ue((_,w)=>{_&&w&&v?.addRecentColor&&v.addRecentColor(_),v?.onColorSelect&&v.onColorSelect(_),r?.(_,w),n?.execute(_,o)},[n,r,o,v]),T=s.useCallback((_,w)=>{const{children:S,title:O,...P}=_;let M=_.children;return(n?.disabled()||i)&&(M=a.jsx("div",{children:M})),a.jsx(ll,{command:n,placement:l===$t.Toolbar?"bottom-start":"right-start",disabled:w,...P,children:M})},[n,i]);return a.jsx(Cu,{ref:t,panelProps:j,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:B,variant:l===$t.Menuitem?Ir.Menuitem:Ir.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:R,...h})}));ol.displayName="ColorCommandButton";const Ff=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),u=s.useCallback((p,f)=>{const h={variant:$t.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},m=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...h,command:f.getCommand("gridlinesToggle")}),a.jsx(ol,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:a.jsx(V2,{}),panelProps:{disableAlpha:!0}}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleGridlinesRows")})]});return _n({...p,children:m})},[i,o]);return a.jsx(Pn,{ref:t,parentFloat:l,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:a.jsx(el,{command:c[0],scope:"view"}),...d})})),Tu=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"sort",disabled:i},f=u.getCommand("sortCustom"),h=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:u.getCommand("sortAscending"),icon:ye(a.jsx($d,{}))}),a.jsx(Re,{...p,command:u.getCommand("sortDescending"),icon:ye(a.jsx(Wh,{}))}),f?a.jsx(Re,{...p,command:f,icon:ye(a.jsx(hb,{}))}):null,a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:ye(a.jsx(Pd,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:ye(a.jsx(Lh,{}))})]});return _n({...c,children:h})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Organize your data so it's easier to analyze."}),a.jsx("br",{}),a.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:ye(a.jsx($d,{})),...l})})),f_=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=s.useCallback((c,u)=>{const p={variant:$t.Menuitem,commandHook:o,scope:"sort",disabled:i},f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:ye(a.jsx(Pd,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),a.jsx(Re,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:ye(a.jsx(Lh,{}))})]});return _n({...c,children:f})},[i,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Organize your data so it's easier to analyze."}),a.jsx("br",{}),a.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:ye(a.jsx(Pd,{})),...l})})),ju=s.memo(s.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:l,scope:d,sx:c,disabled:u,commands:p,...f}=e,h=[n];!r&&i&&h.push("redo");const m=ro(p,h),g=m[0],x=m[1],y=l??g?.context?.()?.undoManager;let v=u;u||(v=!g||g.disabled(),x&&!x.disabled()&&(v=!1));const[b,C]=s.useState(0),k=s.useCallback((E,R)=>{let j=b===0?"Cancel":`${g.label()} ${b} Action${b===1?"":"s"}`,B=!1;y||(B=!0),B||(B=i?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const T=M=>{g.execute(M)},_=a.jsx(sr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:B?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{C(0)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&T(b)},onKeyDown:M=>{M.isDefaultPrevented()||M.keyCode!==Zt.Enter&&M.keyCode!==Zt.Space||T(b)},children:a.jsx(V.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:j})});if(B)return _;const w=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),S=[];for(let M=0;M<w.length;M++){const A=w[M];S.push(a.jsx(sr,{sx:{maxWidth:"360px",display:"flex"},icon:a.jsx(Gi,{}),disabled:v,selected:M<b,onMouseEnter:()=>{C(M+1)},onMouseDown:D=>{D.button===0&&D.preventDefault()},onMouseUp:D=>{D.button===0&&T(M+1)},onKeyDown:D=>{D.isDefaultPrevented()||D.keyCode!==Zt.Enter&&D.keyCode!==Zt.Space||T(M+1)},children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[a.jsx(V.Typography,{component:"div",children:A}),a.jsx(Gi,{})]})},`action:${M}`))}let O=null;if(!r&&i){const M={scope:"undo",commands:R,variant:$t.Menuitem,parentFloat:E.floatReference};O=[],O.push(a.jsx(ju,{...M,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&O.push(a.jsx(Lt,{orientation:"horizontal"},"action:redo-div"))}const P=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{E.closeFloatAll()},onMouseLeave:()=>{C(0)},children:[O,a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:S}),a.jsx(Lt,{orientation:"horizontal"}),_]});return _n({...E,children:P})},[g?.context(),g?.state(),d,y,b,v]);return a.jsx(Pn,{ref:t,commands:p,quickCommand:n,scope:d,disabled:v,label:g?.label()??(r?"Redo":"Undo"),tooltip:a.jsx(a.Fragment,{children:a.jsx("span",{children:`${g?.label()??"No"} last actions.`})}),createPopupPanel:k,icon:o??ye(r?a.jsx(Jb,{}):a.jsx(Yb,{})),selected:!1,...f})})),Ui=z.IFontCollection.getFontList(),zf=new Map;for(let e=0;e<Ui.length;e++)zf.set(Ui[e].fontRef.getFamily(),Ui[e]);const Bf=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:l,...d}=e;V0(n);const c=n?.state(),u=qr(),p=s.useMemo(()=>`${z.IFont.getSharedMeasurer()("Times New Roman",Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`,[u]),f=s.useCallback(h=>{const m=v=>{n?.execute(v,o)},g=[];for(let v=0;v<Ui.length;v++)g.push({key:Ui[v].fontRef.getFamily(),description:Ui[v].fontRef.getFamily()});zf.get(c)||g.unshift({key:c,description:c});const x=[];for(let v=0;v<g.length;v++){const b=g[v].key===c;x.push(a.jsx(sr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:b,disabled:i||!n||n.disabled(),icon:b?a.jsx(Aa,{}):void 0,onMouseUp:C=>{C.button===0&&m(g[v].key)},onMouseDown:C=>{C.button===0&&C.preventDefault()},onKeyDown:C=>{C.keyCode!==Zt.Enter&&C.keyCode!==Zt.Space||m(g[v].key)},children:a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:a.jsx(V.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>g[v]?.key},children:g[v].description})})},v+""+g[v].key))}const y=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})});return _n({...h,children:y})},[i,n?.state()]);return a.jsx(Ur,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:l,createPopupPanel:f,createTooltip:({children:h},m)=>a.jsx(No,{label:n?.label(),description:n?.description(),disabled:m,children:h}),icon:a.jsx(V.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:p},children:a.jsx(V.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:c})}),...d})})),Nf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatStrikeThroughToggle",ye(a.jsx(H3,{}))),f.set("formatSuperscriptToggle",ye(a.jsx(mb,{}))),f.set("formatSubscriptToggle",ye(a.jsx(gb,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:"textEffects",disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatStrikeThroughToggle"),icon:u.get("formatStrikeThroughToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatSuperscriptToggle"),icon:u.get("formatSuperscriptToggle")}),a.jsx(Re,{...m,command:h.getCommand("formatSubscriptToggle"),icon:u.get("formatSubscriptToggle")})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:u.get(c)??ye(a.jsx(H3,{})),...l})})),Vf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=s.useMemo(()=>{for(let f=0;f<d.length;f++)if(d[f]?.state())return d[f].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const f=new Map;return f.set("formatUnderlinedToggle",ye(a.jsx(Ic,{}))),f.set("formatUnderlinedDoubleToggle",ye(a.jsx($3,{}))),f.set("formatUnderlinedAccountingToggle",ye(a.jsx(W3,{}))),f.set("formatUnderlinedAccountingDoubleToggle",ye(a.jsx(U3,{}))),f},[]),p=s.useCallback((f,h)=>{const m={variant:$t.Menuitem,commandHook:o,scope:"underline",disabled:i},g=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedToggle"),icon:ye(a.jsx(Ic,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ye(a.jsx($3,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ye(a.jsx(W3,{}))}),a.jsx(Re,{...m,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:ye(a.jsx(U3,{}))})]});return _n({...f,children:g})},[i,o,r]);return a.jsx(Pn,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:u.get(c)??ye(a.jsx(Ic,{})),...l})})),Mu=s.memo(s.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:l=!0,disabled:d=!1,...c}=e,u=ue((p,f)=>{const h={variant:$t.Menuitem,commandHook:r,scope:"paste",disabled:d},m=[];return l&&(m.push(s.createElement(Re,{...h,command:f.getCommand("paste"),key:"paste",icon:a.jsx(F3,{})})),m.push(a.jsx(Lt,{orientation:"horizontal"},"paste-div"))),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ye(a.jsx(Jy,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ye(a.jsx(Qy,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ye(a.jsx(eb,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ye(a.jsx(tb,{}))})),m.push(s.createElement(Re,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ye(a.jsx(nb,{}))})),_n({...p,children:m})},[d,r,i,l]);return a.jsx(Pn,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:u,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:a.jsx(F3,{}),...c})})),Hf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:l,...d}=e,c=ro(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),u=s.useCallback((p,f)=>{const h={variant:$t.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},m=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),a.jsx(Re,{...h,command:f.getCommand("sheetViewToggleShowHeadingRows")})]});return _n({...p,children:m})},[i,o,r]);return a.jsx(Pn,{ref:t,parentFloat:l,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:a.jsx(el,{command:c[0],scope:"view"}),...d})})),$f=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...l}=e,d=s.useCallback(c=>{const u={variant:$t.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowFormulaBar")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowTabs")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowStatusBar")}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),a.jsx(Re,{...u,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return _n({...c,children:p})},[i,n,o,r]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:d,icon:a.jsx(el,{icon:null,label:"Workbook View"}),...l})})),Wf=s.memo(s.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:l,sx:d,borderProps:c,disabled:u,...p}=e,f=s.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=s.useMemo(()=>f.getStyle(),[f,l]),m=s.useMemo(()=>h.getFill().toCSS(l?.darkMode??!1),[h]),g=h.getInsets(),x=h.getFont(),y=s.useCallback(()=>h.getBorder(),[h]);return a.jsx(V.Box,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:l?.fill,filter:u?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...m},"& .text":{flex:"1 1 100%",...x.toCSS(l?.darkMode??!1,1),boxSizing:"border-box",padding:`${g.top}px ${g.right}px ${g.bottom}px ${g.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:x.toCSS().textDecoration,textAlign:z.ITextFrame.toCSSHorizontalTextAlign(f.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...d},...p,children:a.jsx(fu,{getBorderAt:y,darkMode:l?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:a.jsx(V.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:a.jsx(V.Box,{className:"text",children:n})})})})})),m_=s.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:l,createTemporaryCell:d,parentFloat:c,commands:u,disabled:p,commandHook:f,...h}=e,m=s.useCallback(y=>{const v={variant:$t.Menuitem,commandHook:f,context:"cellStyle"},b=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...v,sx:{fontWeight:550},command:u.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...v,command:u.getCommand("modifyCellStyle"),commandState:{named:n}}),a.jsx(Re,{...v,command:u.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===z.IStyle.BuiltInName.Normal})]}),C=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return _n({...y,children:C})},[]),g=n?.getName()===o?.getName();let x=a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${g?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{l?.(n)},...h,children:a.jsx(Wf,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:d,bodyStyle:i})},n.getName());return r&&(x=a.jsx(up,{label:n.getName(),parentFloat:c,createPopupPanel:m,children:x})),x}),Uf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:l,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!0,...p}=e;V0(o);const f=o?.context(),h=f?.styles,m=i??f?.named(),g=c??f?.bodyStyle(),x=ue(k=>{l?.(k),o?.execute(k,r)},[o,l,r]),y=s.useCallback((k,E)=>{const R={onSelectNamed:x,styles:h(),parentFloat:k.floatReference},j=h().getCustomNamed(),B=new Map,T=[];for(let D=0;D<j.length;D++)B.set(j[D].getName(),j[D]),h().getNamed(j[D].getName()).getBuiltInID()===null&&T.push(j[D].getName());const _=D=>{let L=B.get(D);return L||(L=h().getNamed(D)),!L||L.isHidden()?null:a.jsx(m_,{namedStyle:L,selectedNamed:m,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...R},D)},w=(D,L,N=!0)=>{const W=[];for(let I=0;I<L.length;I++){const U=_(L[I]);U&&W.push(U)}return W.length===0?null:a.jsxs(V.Box,{children:[N?a.jsx(Lt,{orientation:"horizontal"}):null,a.jsx(Ji,{children:D},D+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:W},D+"-presets")]},D)},S=(D,L)=>{const N=[];for(let W=0;W<L.length;W++){const I=_(L[W]);I&&N.push(I)}return N.length===0?null:a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:N},D+"-presets")},O=[];O.push(w("Custom",T,!1)),O.push(w("Good, Bad and Neutral",[z.IStyle.BuiltInName.Normal,z.IStyle.BuiltInName.Bad,z.IStyle.BuiltInName.Good,z.IStyle.BuiltInName.Neutral],T.length>0)),O.push(w("Data and Model",[z.IStyle.BuiltInName.Calculation,z.IStyle.BuiltInName.CheckCell,z.IStyle.BuiltInName.ExplanatoryText,z.IStyle.BuiltInName.FollowedHyperlink,z.IStyle.BuiltInName.Hyperlink,z.IStyle.BuiltInName.Input,z.IStyle.BuiltInName.LinkedCell,z.IStyle.BuiltInName.Note,z.IStyle.BuiltInName.Output,z.IStyle.BuiltInName.WarningText])),O.push(w("Titles and Headings",[z.IStyle.BuiltInName.Heading1,z.IStyle.BuiltInName.Heading2,z.IStyle.BuiltInName.Heading3,z.IStyle.BuiltInName.Heading4,z.IStyle.BuiltInName.Title,z.IStyle.BuiltInName.Total]));let P=[];var M,A;return P.push(S("Accent 1",[z.IStyle.BuiltInName.Accent1_20,z.IStyle.BuiltInName.Accent1_40,z.IStyle.BuiltInName.Accent1_60,z.IStyle.BuiltInName.Accent1])),P.push(S("Accent 2",[z.IStyle.BuiltInName.Accent2_20,z.IStyle.BuiltInName.Accent2_40,z.IStyle.BuiltInName.Accent2_60,z.IStyle.BuiltInName.Accent2])),P.push(S("Accent 3",[z.IStyle.BuiltInName.Accent3_20,z.IStyle.BuiltInName.Accent3_40,z.IStyle.BuiltInName.Accent3_60,z.IStyle.BuiltInName.Accent3])),P.push(S("Accent 4",[z.IStyle.BuiltInName.Accent4_20,z.IStyle.BuiltInName.Accent4_40,z.IStyle.BuiltInName.Accent4_60,z.IStyle.BuiltInName.Accent4])),P.push(S("Accent 5",[z.IStyle.BuiltInName.Accent5_20,z.IStyle.BuiltInName.Accent5_40,z.IStyle.BuiltInName.Accent5_60,z.IStyle.BuiltInName.Accent5])),P.push(S("Accent 6",[z.IStyle.BuiltInName.Accent6_20,z.IStyle.BuiltInName.Accent6_40,z.IStyle.BuiltInName.Accent6_60,z.IStyle.BuiltInName.Accent6])),O.push((M="Themed Cell Styles",A=P,a.jsxs(V.Box,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Ji,{children:M},M+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:A},M+"-presets")]},M))),O.push(w("Number Format",[z.IStyle.BuiltInName.Comma,z.IStyle.BuiltInName.Comma0,z.IStyle.BuiltInName.Currency,z.IStyle.BuiltInName.Currency0,z.IStyle.BuiltInName.Percent])),a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:D=>`${D.shape.borderRadius}px`,paddingBottom:D=>`${D.shape.borderRadius}px`},children:[a.jsx(V.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:O}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{variant:$t.Menuitem,commandState:m,command:E.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:d,icon:ye(a.jsx(vb,{}))})]})},[m,h?.().getTheme(),g]),v=ue(k=>{const E=18/z.IFont.getDeviceScale(),R=f?.createTemporaryCell(k);return R.getStyle().getFont().getSize()<=E?R:R.createTemporaryCell({style:{font:{size:E}}})},[f?.createTemporaryCell]),b=d||!o||o.disabled(),C=s.useMemo(()=>f&&u?a.jsx(Wf,{value:m?.getName()??"Custom",cellStyle:m?{named:m.getName()}:void 0,styles:f.styles(),createTemporaryCell:v,bodyStyle:f.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:k=>`1px solid ${k.palette.action.hover}`},borderProps:{}}):ye(a.jsx(ya,{})),[m,g,b]);return a.jsx(Pn,{ref:t,createPopupPanel:y,outlined:u,commands:n,createTooltip:({children:k},E)=>a.jsx(No,{label:o?.label(),description:o?.description(),disabled:E,children:k}),selected:!1,disabled:b,label:o?.label(),icon:C,...p})})),qf="_sheetxl-reset_ods65_1",g_=10,Zf=s.memo(s.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:l,disabled:d,className:c,forceThinBorder:u,cellHeight:p=g_,isLive:f=!1,...h}=e,m=Math.ceil(1.3*p),[g,x]=s.useReducer(k=>k+1,0);s.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{x()}})},[o,f]);const y=s.useMemo(()=>{let k=o?.toJSON()??{};const E={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return k&&(k.styleOptions={...k.styleOptions,name:r.getName()}),k.ref=E,new z.Table({initialAnchor:E,json:k,styles:n})},[g,o,r,n]),v=s.useMemo(()=>{const k=[];for(let E=0;E<5;E++)for(let R=0;R<5;R++){const j=y.getStyleAt({colIndex:R,rowIndex:E});k.push(j)}return k},[y]),b=s.useMemo(()=>{const k=(R,j,B)=>{let T=B.getFill().toCSS(i?.darkMode??!1);const _=m-(j<4?1:0),w=p-(R<4?1:0),S=B.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:j*(m-1),top:R*(p-1),width:_,height:w},a.jsx("td",{className:`table-style-fill ${R}-${j}`,style:T,children:a.jsx("div",{className:`table-style-text ${R}-${j}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(_-6)/2,top:(w-1)/2,borderTop:`1px solid ${S}`}})},`${R}-${j}`)},E=[];for(let R=0;R<5;R++){const j=[];for(let B=0;B<5;B++){const T=v[5*R+B];j.push(k(R,B,T))}E.push(a.jsx("tr",{children:j},R))}return E},[y,r,i]),C=s.useCallback((k,E)=>v[E].getBorder()??null,[v]);return a.jsx(V.Box,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...l},...h,children:a.jsx(fu,{getBorderAt:C,rowCount:5,columnCount:5,forceThinBorder:u,width:5*(m-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:a.jsx("table",{className:Qn(c,"sheetxl-table-preview",qf),style:{borderCollapse:"collapse",width:5*(m-1)+1,height:5*(p-1)+1},children:a.jsx("tbody",{children:b})})})})})),Ol=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},Gf=s.memo(s.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:l,style:d,className:c,canvas:u,...p}=e,f=s.useMemo(()=>{const g=n.toJSON(),x={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return g.styleOptions={...g.styleOptions,name:o.getName()},g.ref=x,new z.Table({initialAnchor:x,json:g,styles:r})},[n,o,r]),h=s.useMemo(()=>{const g=[];for(let x=0;x<5;x++)for(let y=0;y<5;y++){const v=f.getStyleAt({colIndex:y,rowIndex:x});g.push(v)}return g},[f]),m=s.useMemo(()=>{let g=u;if(u||(g=document.createElement("canvas")),!g)return null;g.width!==61&&(g.width=61),g.height!==46&&(g.height=46);const x=g.getContext("2d",{alpha:!1});if(!x)return null;const y=12,v=i?.darkMode??!1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C].getFill();let E=i?.fill;k.getType()===z.IFill.Type.Solid?E=k.getColor().toCSS(v,!1):k.getType()===z.IFill.Type.Gradient?E=k.getStops[0]?.color.toCSS(v,!1):k.getType()===z.IFill.Type.Pattern&&(E=k.getForeground().toCSS(v,!1)),x.fillStyle=E;const R=C*y,j=9*b;x.fillRect(R,j,13,10)}x.lineWidth=1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C],E=C*y,R=9*b,j=k.getBorder();if(!j.isEmpty()){const _=j.getLeft();_.isNone()||(x.strokeStyle=_.getColor().toCSS(v,!1),Ol(x,E,R,E,R+9));const w=j.getTop();w.isNone()||(x.strokeStyle=w.getColor().toCSS(v,!1),Ol(x,E,R,E+y,9*b));const S=j.getRight();S.isNone()||(x.strokeStyle=S.getColor().toCSS(v,!1),Ol(x,E+y,R,E+y,R+9));const O=j.getBottom();O.isNone()||(x.strokeStyle=O.getColor().toCSS(v,!1),Ol(x,E,R+9,E+y,R+9))}x.strokeStyle=k.getFont().getFill().toCSS(v,!1);const B=4,T=2.5;Ol(x,C*y+T,9*b+B,C*y+T+7,9*b+B)}return`url(${g.toDataURL()})`},[u,f,o,i]);return a.jsx("div",{ref:t,className:Qn("table-style-preview",c),style:{backgroundImage:m,width:61,height:46,...d},...p})})),x_=s.memo(s.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:l,onShowTotalRowChange:d,showFilterButton:c,onShowFilterButtonChange:u,sx:p,disabled:f,...h}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:m=>`${m.spacing(2)}`,marginRight:m=>`${m.spacing(2)}`},"& .MuiCheckbox-root":{padding:m=>`${m.spacing(.5)}`},...p},...h,ref:t,children:[i&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),d&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:l??!1,indeterminate:l==null,onChange:()=>d(!l),disabled:f||l==null}),label:"Total Row",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),u&&a.jsx(V.FormControlLabel,{control:a.jsx(V.Checkbox,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>u(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),y_=s.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:l=!0,bodyStyle:d,parentFloat:c,commands:u,disabled:p,commandHook:f,useCanvasPreview:h=!0,canvas:m,...g}=e,x=s.useCallback(C=>{const k={variant:$t.Menuitem,commandHook:f,context:"table"},E=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...k,command:u.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Re,{...k,sx:{fontWeight:550},command:u.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ye(a.jsx(ya,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:u.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...k,command:u.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]}),R=a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})});return _n({...C,children:R})},[u]),y=n?.getName()===o,v=s.useMemo(()=>{const C={table:t,tableStyle:n,styles:i,bodyStyle:d};return h?a.jsx(Gf,{canvas:m,...C}):a.jsx(Zf,{...C})},[t,n,i,d]);let b=a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${y?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...g,children:v},n.getName());return l&&(b=a.jsx(up,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:x,children:b})),b}),Kf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:l,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!1,...p}=e;V0(o);const f=o?.context(),h=f?.styles,m=i??f?.table?.();let g="insertTable";m&&(g="editTable");const x=s.useMemo(()=>((T,_)=>{const w={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new z.Table({initialAnchor:w,styles:_,json:{name:"PreviewTable",ref:w,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:T}})})(m?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),m?.getStyleOptions()]),y=m??x,[v,b]=s.useState(y);s.useEffect(()=>{b(y)},[y]);const C=c??f?.bodyStyle(),k=ue(T=>{l?.(T),o?.execute({name:T},r)},[o,l,r]),E=s.useRef(null),R=s.useCallback((T,_)=>{const w={onSelectTableStyleName:k,styles:h(),parentFloat:T.floatReference};E.current||(E.current=document.createElement("canvas"));const S=I=>{const U=h().getTableStyle(I);return U?a.jsx(y_,{table:v,tableStyle:U,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:_,commandHook:r,canvas:E.current,...w},I):null},O=(I,U,G=!0)=>{const Q=[];for(let H=0;H<U.length;H++){const $=S(U[H]);$&&Q.push($)}return Q.length===0?null:a.jsxs(V.Box,{children:[G?a.jsx(Lt,{orientation:"horizontal"}):null,a.jsx(Ji,{children:I},I+"-header"),a.jsx(V.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:Q},I+"-presets")]},I)},P=[],M=h().getCustomTableStyles(),A=[];if(M.length>0){for(let I=0;I<M.length;I++)M[I].isShownInTableStyles()&&A.push(M[I].getName());P.push(O("Custom",A,!1))}const D=[];m&&!m.getStyleOptions().name&&D.push(null);for(let I=0;I<21;I++)D.push("TableStyleLight"+(I+1));P.push(O("Light",D,A.length>0));const L=[];for(let I=0;I<28;I++)L.push("TableStyleMedium"+(I+1));P.push(O("Medium",L));const N=[];for(let I=0;I<11;I++)N.push("TableStyleDark"+(I+1));P.push(O("Dark",N));let W=null;return m&&(W=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{variant:$t.Menuitem,command:_.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:d,icon:ye(a.jsx(mh,{}))})]})),a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[a.jsx(V.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:P}),W]})},[h,h?.().getTheme(),C,v]),j=d||!o||o.disabled(),B=s.useMemo(()=>{if(!f||!u)return ye(a.jsx(ya,{}))},[v,C,j]);return a.jsx(Pn,{ref:t,quickCommand:g,createPopupPanel:R,commands:n,label:o?.label(),commandState:m,commandHook:r,selected:m!==null,createTooltip:({children:T},_)=>a.jsx(No,{label:o?.label(),description:o?.description(),disabled:_,children:T}),disabled:j,icon:B,...p})})),kr=[];kr.push(Nr("Primary Background","bg1")),kr.push(Nr("Primary Text","tx1")),kr.push(Nr("Secondary Background","bg2")),kr.push(Nr("Secondary Text","tx2")),kr.push(Nr("Accent 1","accent1")),kr.push(Nr("Accent 2","accent2")),kr.push(Nr("Accent 3","accent3")),kr.push(Nr("Accent 4","accent4")),kr.push(Nr("Accent 5","accent5")),kr.push(Nr("Accent 6","accent6"));const Xf=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:l,...d}=e,c=qr(),u=s.useMemo(()=>{let p=[];for(let f=0;f<kr.length;f++){const h=kr[f];p.push(a.jsx(Q1,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:a.jsx(V.Box,{sx:{display:"flex",boxShadow:f=>f.shadows[2]},children:p})})},[t,c]);return a.jsx(xr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...d,children:a.jsxs(V.Box,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[a.jsx(V.Box,{sx:{},children:t.getName()}),a.jsxs(V.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[u,a.jsx(V.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:a.jsx(vr,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:a.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
|
|
83
83
|
The heading font is '${t.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:a.jsx("div",{children:t.getFontScheme().getMinorFont()})})})]})]})})},Yf=s.memo(s.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,sx:i,disabled:l=!1,darkMode:d,...c}=e,u=s.useMemo(()=>{const p=n?.search({selected:o})??[],f=[];if(p.length===0)return a.jsx(Ji,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});for(let h=0;h<p.length;h++){const m=p[h],g=o&&m?.getName()===o.getName(),x=p[h+1];x&&x.isCustom()!==m.isCustom()&&f.push(a.jsx(Lt,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${h}`)),f.push(a.jsx(Xf,{docTheme:m,onSelectTheme:()=>r(m),isSelected:g,disabled:l,darkMode:d,onMouseDown:y=>{y.button===0&&y.preventDefault()},onMouseUp:y=>{y.button===0&&r(m)},onKeyDown:y=>{y.keyCode!==Zt.Enter&&y.keyCode!==Zt.Space||r(m)}},m.getName()))}return f},[o,r,d]);return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:t,...c,children:a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[a.jsx(Ji,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),a.jsx(Lt,{}),a.jsx(V.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:u})]})})})),Jf=s.memo(s.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,icon:i,tooltip:l,label:d,variant:c=Ir.Toolbar,darkMode:u,panelProps:p,...f}=e,h=i||ye(a.jsx(Uh,{})),m=s.useCallback(x=>{const{closeFloatAll:y}=x;return a.jsx(Yf,{...p,themes:n,selectedTheme:o,onSelectTheme:r,darkMode:u,onKeyDown:v=>{v.which===Zt.Enter&&y()}})},[n,o,r,p,u]),g={createPopupPanel:m,tooltip:l||d||"Theme",label:d,icon:h,...f};return c===Ir.Toolbar?a.jsx(Ur,{ref:t,...g}):a.jsx(Pa,{ref:t,...g})})),Qf=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,selectedTheme:r,onSelectTheme:i,disabled:l=!1,darkMode:d,variant:c,...u}=e;V0(n);const p=n?.context()?.themes,f=r||n?.context()?.theme,h=d??n?.context()?.darkMode,m=ue(x=>{i?.(x),n?.execute(x,o)},[i,o]),g=s.useCallback((x,y)=>{const{children:v,title:b,...C}=x;let k=x.children;return(n?.disabled()||l)&&(k=a.jsx("div",{children:k})),a.jsx(ll,{command:n,placement:c===$t.Toolbar?"bottom-start":"right-start",disabled:y,...C,children:k})},[n,l]);return a.jsx(Jf,{ref:t,themes:p,selectedTheme:f,onSelectTheme:m,variant:c===$t.Menuitem?Ir.Menuitem:Ir.Toolbar,createTooltip:g,disabled:l,darkMode:h,icon:ye(a.jsx(Uh,{})),...u})})),b_=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["themeMode"])[0],c=d?.state(),u=d?.state()!==null,p=V.useMediaQuery("(prefers-color-scheme: dark)"),f=c==="dark"||c===null&&p,h=ue((m,g)=>{const x={variant:$t.Menuitem,commandHook:o,scope:"appearance",disabled:i},y=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...x,command:d,icon:ye(f?a.jsx(wn.DarkMode,{}):a.jsx(wn.LightMode,{}))}),a.jsx(Re,{...x,command:g.getCommand("defaultThemeMode"),icon:ye(p?a.jsx(Cb,{}):a.jsx(kb,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...x,command:g.getCommand("forceLightGrid")}),a.jsx(Re,{...x,command:g.getCommand("forceLightImages")})]});return _n({...m,children:y})},[i,d,o,r,p,c,u]);return a.jsx(Pn,{ref:t,quickCommand:"themeMode",commands:n,commandHook:o,createPopupPanel:h,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{d?.execute(f?"light":"dark",o)},selected:u,icon:ye(f?a.jsx(wn.DarkMode,{}):a.jsx(wn.LightMode,{})),...l})})),v_=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,sx:l,...d}=e,c=s.useCallback((u,p)=>{const f={variant:$t.Menuitem,scope:"help",commandHook:{...o,beforeExecute:(m,g)=>o?.beforeExecute?.(m,g)!==!1&&u.floatReference.closeAll()},disabled:i},h=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...f,command:p.getCommand("showKeyboardShortcuts"),icon:ye(a.jsx(wn.Keyboard,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...f,command:p.getCommand("gotoUrlGithub"),icon:ye(a.jsx(jb,{}))}),a.jsx(Re,{...f,command:p.getCommand("gotoUrlDiscord"),icon:ye(a.jsx(Tb,{}))}),a.jsx(Re,{...f,command:p.getCommand("gotoUrlDocumentation"),icon:ye(a.jsx(Zh,{}))}),a.jsx(Re,{...f,command:p.getCommand("gotoUrlIssue"),icon:ye(a.jsx(_b,{}))})]});return _n({...u,children:h})},[i,o]);return a.jsx(Pn,{ref:t,sx:l,commands:n,disabled:i,commandHook:o,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:c,icon:ye(a.jsx(Eb,{sx:{transform:"scale(0.75)"}})),...d})})),Ru=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,preferSingleMenu:l=!0,showQuickButton:d=!0,variant:c=$t.Toolbar,...u}=e,p=ro(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:f,allDisabled:h}=s.useMemo(()=>{let g=null,x=0;for(let y=0;y<p.length;y++)p[y]&&!p[y]?.disabled()&&(l&&c===$t.Menuitem&&(g=x===0?p[y]:null),x++);return{singleMenuCommand:g,allDisabled:x===0}},[p]),m=s.useCallback((g,x)=>{const y={variant:$t.Menuitem,commandHook:o,scope:"insertImage",disabled:i},v=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...y,command:x.getCommand("insertImageFromFile"),icon:ye(a.jsx(ss,{}))}),a.jsx(Re,{...y,command:x.getCommand("insertImageFromURL"),icon:ye(a.jsx(ss,{}))})]});return _n({...g,children:v})},[i,o,r]);return f?a.jsx(Re,{ref:t,variant:c,commandHook:o,disabled:i,command:f,icon:ye(a.jsx(ss,{})),...u}):a.jsx(Pn,{ref:t,variant:c,quickCommand:"insertImageFromFile",commands:n,commandHook:o,scope:r,disabled:i||h,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:m,icon:ye(a.jsx(ss,{})),...u})})),ec=s.memo(s.forwardRef((e,t)=>{const{command:n,...o}=e,r=$r(),[i,l]=s.useState(!1),[d,c]=s.useState("info");return s.useEffect(()=>{const u=r.getMode();l(u?.key==="copy"||u?.key==="cut"),c(u?.key==="cut"?"warning":"info")},[r]),a.jsx(Re,{ref:t,command:n,icon:ye(a.jsx(Yy,{isWalking:i,themedType:d})),...o})})),w_=s.memo(s.forwardRef((e,t)=>{const{...n}=e;return a.jsx(o0,{ref:t,...n,popupCommandKeys:["quickFormulaSum","quickFormulaAverage","quickFormulaCount","quickFormulaMax","quickFormulaMin",null,"insertFunction"],quickCommand:"quickFormulaSum",popupScope:"quickFormula",label:"Quick Formulas",tooltip:"More quick functions.",icon:o=>{switch(o?.key()){case"quickFormulaSum":return ye(a.jsx(tv,{}));case"insertFunction":return ye(a.jsx(ev,{}));default:return null}}})})),em=s.createContext(null);em.displayName="HookFormContext";const tm=()=>s.useContext(em),nm=s.memo(s.forwardRef((e,t)=>{const{disabled:n,style:o,className:r,sx:i,defaultInput:l,value:d,formName:c,formOptions:u,onChangeInput:p,onValidate:f,onKeyDown:h,...m}=e,g=tm(),x=c&&g?g.register(c,u):null,[y,v]=s.useState(""),[b,C]=s.useState(""),[k,E]=s.useState(d);s.useEffect(()=>{E(d),C("")},[d]);const R=ue(w=>{let S="";try{E(w),f?.(w),p?.(w)}catch(O){S=O.message??"Invalid Name"}c&&g&&(S?g.setError(c,{message:S}):g.clearErrors(c)),C(S)},[d,f,p]),j=ue(async w=>{w.keyCode===Zt.Escape&&y!==d&&(R(y),g?.setValue(c,y),g?.clearErrors(c),w.stopPropagation()),h?.(w)},[h,y,d,g]),B=ue(w=>{v(w.target.value??"")},[]),T=ue(w=>{v(""),x?.onBlur(w)},[]),_=s.useCallback(w=>{R(w.target.value),x?.onChange(w)},[x]);return a.jsx(V.FormControl,{sx:{paddingTop:w=>w.spacing(1.5),minWidth:135,width:"100%",...i},size:"small",ref:t,className:Qn("named-input",r),...m,children:a.jsx(V.TextField,{label:"Name",placeholder:l,onFocus:B,onBlur:T,inputRef:x?.ref,disabled:n,error:!!b,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:w=>w.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:c,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:w=>w.spacing(1.25),paddingBottom:w=>w.spacing(.75),backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`}}},value:k??"",onChange:_,onKeyDownCapture:j,onContextMenu:w=>{w.stopPropagation()}})})}));nm.displayName="NamedInput";const _s=e=>e===null?"":e.toString(),om=s.memo(s.forwardRef((e,t)=>{const{formName:n,formOptions:o,disabled:r,style:i,className:l,sx:d,onKeyDown:c,value:u,onChangeInput:p,resolvedAddress:f,...h}=e,m=tm(),g=n&&m?m.register(n,o):null,[x,y]=s.useState(""),[v,b]=s.useState(!1),[C,k]=s.useState(()=>_s(u));s.useEffect(()=>{k(_s(u)),y(""),n&&m&&m.clearErrors(n),b(!1)},[u]);const E=ue(S=>{let O="";try{k(S);const P=_s(u),M=f(S);M.toString()!==P&&p?.(M)}catch{O="Invalid Range"}n&&m&&(O?m.setError(n,{message:O}):m.clearErrors(n)),y(O),b(!0)},[C,p,n,m]),R=ue(async S=>{if(v&&S.keyCode===Zt.Escape){const O=_s(u);k(O),y(""),b(!1),S.stopPropagation()}c?.(S)},[u,p,c,v]),j=ue(S=>{g?.onBlur(S)},[g]),B=s.useCallback(S=>{E(S.target.value),g?.onChange(S)},[g]),[T,_]=s.useState(!1),w=s.useMemo(()=>a.jsx(V.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:a.jsx(hp,{disabled:!0,selected:T,onSelectToggle:S=>{_(S)},label:"Select Range",icon:ye(a.jsx(Xb,{}))})}),[T]);return a.jsx(V.FormControl,{sx:{paddingTop:S=>S.spacing(1.5),minWidth:135,width:"100%",...d},size:"small",ref:t,className:Qn("range-input",l),...h,children:a.jsx(V.TextField,{label:"Range",placeholder:"Enter Range",onBlur:j,disabled:r,error:!!x,inputRef:g?.ref,helperText:x||" ",sx:{"& .MuiFormHelperText-root":{marginTop:S=>S.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",readOnly:r,name:n,sx:{paddingTop:S=>S.spacing(1.25),paddingBottom:S=>S.spacing(.75)}},sx:{backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},endAdornment:w},value:C??"",onChange:B,onKeyDownCapture:R,onContextMenu:S=>{S.stopPropagation()}})})}));om.displayName="RangeInput";const Iu=s.memo(s.forwardRef((e,t)=>{const{sheet:n,className:o,debounceDelay:r=220,sx:i,...l}=e,[d,c]=s.useState(()=>n.getView().getZoomScale()),[u,p]=s.useState(null),f=s.useRef(0);Xt(n,{onViewChange:()=>{p(!0),f.current===0&&c(n.getView().getZoomScale())}}),s.useEffect(()=>{f.current=0,p(!1),c(n.getView().getZoomScale())},[n]),s.useEffect(()=>{f.current!==0&&z.CommonUtils.debounce(()=>{d===f.current&&(f.current=0,n.getView().update({zoomScale:d}))},r)()},[d,r]);const h=ue(j=>{let B=j;j<100?B=Math.round(j/(10/9)+10):j>100&&(B=Math.round(3*j-200)),f.current=B,p(!0),c(B)},[n]),m=j=>{let B=j;return j<100?B=10/9*(j-10):j>100&&(B=(j+200)/3),B},g=m(d),[x,y]=s.useState(null),v=s.useRef(null),b=s.useCallback(()=>{const j=x;j&&requestAnimationFrame(()=>{v.current?.contains(document.activeElement)&&j.focus()})},[]),C=I5(()=>{h(m(z.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10)))}),k=I5(()=>h(m(z.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),E=qr(),R=s.useMemo(()=>`${z.IFont.getSharedMeasurer()("100%",Math.round(E.typography.fontSize),E.typography.fontFamily).width}px`,[E]);return a.jsxs(V.Box,{ref:t,className:Qn(o),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:j=>j.palette.text.secondary,...i},onFocus:j=>{j.relatedTarget&&!x&&y(j.relatedTarget)},onBlur:j=>{x&&!v?.current?.contains(j.relatedTarget)&&y(null)},onMouseDown:j=>{j.button===0&&j.preventDefault()},onMouseUp:j=>{j.button===0&&b()},...l,children:[a.jsx(vr,{disableInteractive:!0,title:"Zoom Out",children:a.jsx(V.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:j=>j.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:j=>{j.button!==0?j.preventDefault():C(j)},children:a.jsx(wn.Remove,{})})}),a.jsx(V.Slider,{ref:v,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:j=>`0px 0px 0px 3px ${Kd(j.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:j=>`0px 0px 0px 2px ${Kd(j.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:u?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:g,max:200,marks:[{value:100}],onAnimationEnd:()=>p(!1),onWheel:j=>{h(m(z.CommonUtils.findNextStep(n.getView().getZoomScale(),j.deltaY<0,10)))},onKeyDown:j=>{j.which===Zt.Down||j.which===Zt.Right?(h(m(z.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),j.preventDefault()):j.which===Zt.Up||j.which===Zt.Left?(h(m(z.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),j.preventDefault()):j.which!==Zt.Enter&&j.which!==Zt.Escape||b()},onChange:(j,B)=>{Math.abs(B-100)<3?h(100):h(B)},valueLabelFormat:(j,B)=>`Zoom: ${Math.round(d)}%`}),a.jsx(vr,{disableInteractive:!0,title:"Zoom In",children:a.jsx(V.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:j=>j.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:j=>{j.button!==0?j.preventDefault():k(j)},children:a.jsx(wn.Add,{})})}),a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row"},children:[a.jsx(V.Box,{sx:{minWidth:"8px"}}),a.jsx(V.Typography,{noWrap:!0,component:"div",onClick:()=>{h(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:R},children:a.jsx("div",{children:Math.round(d)+"%"})})]})]})}));Iu.displayName="SheetZoomScale";const Du=s.memo(s.forwardRef((e,t)=>{const{sx:n,sheet:o,gridStyle:r,children:i,childrenEnd:l,...d}=e;s.useImperativeHandle(t,()=>({}));const c=s.useRef(null);s.useEffect(()=>{const m=g=>g.preventDefault();return c.current?.addEventListener("wheel",m,{passive:!1}),()=>{c.current?.removeEventListener("wheel",m)}},[]);const u=$r(),p=s.useMemo(()=>{const m=u.getMode();return m?.description?m.description:"Ready"},[u]),[f,h]=s.useState(!1);return a.jsxs(V.Box,{ref:c,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:f?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...n},onMouseOver:()=>h(!0),onMouseLeave:()=>h(!1),...d,children:[i,a.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:m=>m.palette.text.secondary},variant:"caption",children:p})}),l?a.jsx(V.Box,{sx:{display:"flex",alignItems:"center"},children:l}):null,a.jsx(Lt,{style:{marginTop:"6px",marginBottom:"6px"}}),a.jsx(Iu,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:o})]})}));Du.displayName="StatusBar";var W7,Ts={exports:{}},Pl={},Al={exports:{}},U7={},js={exports:{}},q7,xo={},E0={};function tc(){return q7||(q7=1,Object.defineProperty(E0,"__esModule",{value:!0}),E0.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},E0.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},E0.int=function(e){return parseInt(e,10)},E0.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},E0.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),E0}var Z7,G7,_0={};function Lu(){if(G7)return xo;G7=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.addClassName=l,xo.addEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.addEventListener?c.addEventListener(u,p,h):c.attachEvent?c.attachEvent("on"+u,p):c["on"+u]=p},xo.addUserSelectStyles=function(c){if(!c)return;let u=c.getElementById("react-draggable-style-el");u||(u=c.createElement("style"),u.type="text/css",u.id="react-draggable-style-el",u.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
84
84
|
`,u.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
85
|
-
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&l(c.body,"react-draggable-transparent-selection")},xo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},xo.createSVGTransform=function(c,u){return r(c,u,"")},xo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},xo.getTouchIdentifier=function(c){if(c.targetTouches&&c.targetTouches[0])return c.targetTouches[0].identifier;if(c.changedTouches&&c.changedTouches[0])return c.changedTouches[0].identifier},xo.getTranslation=r,xo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},xo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},xo.matchesSelector=o,xo.matchesSelectorAndParentsTo=function(c,u,p){let f=c;do{if(o(f,u))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},xo.offsetXYFromParent=function(c,u,p){const f=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect(),h=(c.clientX+u.scrollLeft-f.left)/p,m=(c.clientY+u.scrollTop-f.top)/p;return{x:h,y:m}},xo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},xo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},xo.removeClassName=d,xo.removeEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},xo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=tc(),t=function(c,u){if(typeof WeakMap=="function")var p=new WeakMap,f=new WeakMap;return function(h,m){if(!m&&h&&h.__esModule)return h;var g,x,y={__proto__:null,default:h};if(h===null||typeof h!="object"&&typeof h!="function")return y;if(g=m?f:p){if(g.has(h))return g.get(h);g.set(h,y)}for(const v in h)v!=="default"&&{}.hasOwnProperty.call(h,v)&&((x=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(h,v))&&(x.get||x.set)?g(y,v,x):y[v]=h[v]);return y}(c,u)}(function(){if(Z7)return _0;Z7=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.browserPrefixToKey=p,_0.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},_0.default=void 0,_0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let m=0;m<c.length;m++)if(p(f,c[m])in h)return c[m];return""}function p(f,h){return h?`${h}${function(m){let g="",x=!0;for(let y=0;y<m.length;y++)x?(g+=m[y].toUpperCase(),x=!1):m[y]==="-"?x=!0:g+=m[y];return g}(f)}`:f}return _0.default=u(),_0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:f,y:h}=c,m=`translate(${f}${p},${h}${p})`;return u&&(m=`translate(${`${typeof u.x=="string"?u.x:u.x+p}`}, ${`${typeof u.y=="string"?u.y:u.y+p}`})`+m),m}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function l(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return xo}var K7,Jr={};function rm(){if(K7)return Jr;K7=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Jr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Jr.createCoreData=function(o,r,i){const l=!(0,e.isNum)(o.lastX),d=n(o);return l?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Jr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Jr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:l}=o.props;l=typeof l=="string"?l:function(c){return{left:c.left,top:c.top,right:c.right,bottom:c.bottom}}(l);const d=n(o);if(typeof l=="string"){const{ownerDocument:c}=d,u=c.defaultView;let p;if(l==="parent"?p=d.parentNode:p=d.getRootNode().querySelector(l),!(p instanceof u.HTMLElement))throw new Error('Bounds selector "'+l+'" could not find an element.');const f=p,h=u.getComputedStyle(d),m=u.getComputedStyle(f);l={left:-d.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(h.marginLeft),top:-d.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(h.marginTop),right:(0,t.innerWidth)(f)-(0,t.outerWidth)(d)-d.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(h.marginRight),bottom:(0,t.innerHeight)(f)-(0,t.outerHeight)(d)-d.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(h.marginBottom)}}return(0,e.isNum)(l.right)&&(r=Math.min(r,l.right)),(0,e.isNum)(l.bottom)&&(i=Math.min(i,l.bottom)),(0,e.isNum)(l.left)&&(r=Math.max(r,l.left)),(0,e.isNum)(l.top)&&(i=Math.max(i,l.top)),[r,i]},Jr.getControlPosition=function(o,r,i){const l=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!l)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(l||o,c,i.props.scale)},Jr.snapToGrid=function(o,r,i){const l=Math.round(r/o[0])*o[0],d=Math.round(i/o[1])*o[1];return[l,d]};var e=tc(),t=Lu();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Jr}var X7,Y7,J7,Q7,Fl={},Ms={};function im(){return X7||(X7=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.default=function(){}),Ms}function S_(){if(Y7)return Fl;Y7=1,Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.default=void 0;var e=function(m,g){if(typeof WeakMap=="function")var x=new WeakMap,y=new WeakMap;return function(v,b){if(!b&&v&&v.__esModule)return v;var C,k,E={__proto__:null,default:v};if(v===null||typeof v!="object"&&typeof v!="function")return E;if(C=b?y:x){if(C.has(v))return C.get(v);C.set(v,E)}for(const R in v)R!=="default"&&{}.hasOwnProperty.call(v,R)&&((k=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(v,R))&&(k.get||k.set)?C(E,R,k):E[R]=v[R]);return E}(m,g)}(s),t=d(za()),n=d(wo),o=Lu(),r=rm(),i=tc(),l=d(im());function d(m){return m&&m.__esModule?m:{default:m}}function c(m,g,x){return(g=function(y){var v=function(b,C){if(typeof b!="object"||!b)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof v=="symbol"?v:v+""}(g))in m?Object.defineProperty(m,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[g]=x,m}const u={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let f=p,h=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",m=>{if(this.props.onMouseDown(m),!this.props.allowAnyClick&&typeof m.button=="number"&&m.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:x}=g;if(this.props.disabled||!(m.target instanceof x.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(m.target,this.props.handle,g)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(m.target,this.props.cancel,g))return;m.type!=="touchstart"||this.props.allowMobileScroll||m.preventDefault();const y=(0,o.getTouchIdentifier)(m);this.touchIdentifier=y;const v=(0,r.getControlPosition)(m,y,this);if(v==null)return;const{x:b,y:C}=v,k=(0,r.createCoreData)(this,b,C);(0,l.default)("DraggableCore: handleDragStart: %j",k),(0,l.default)("calling",this.props.onStart),this.props.onStart(m,k)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(x),this.dragging=!0,this.lastX=b,this.lastY=C,(0,o.addEvent)(x,f.move,this.handleDrag),(0,o.addEvent)(x,f.stop,this.handleDragStop))}),c(this,"handleDrag",m=>{const g=(0,r.getControlPosition)(m,this.touchIdentifier,this);if(g==null)return;let{x,y}=g;if(Array.isArray(this.props.grid)){let b=x-this.lastX,C=y-this.lastY;if([b,C]=(0,r.snapToGrid)(this.props.grid,b,C),!b&&!C)return;x=this.lastX+b,y=this.lastY+C}const v=(0,r.createCoreData)(this,x,y);if((0,l.default)("DraggableCore: handleDrag: %j",v),this.props.onDrag(m,v)!==!1&&this.mounted!==!1)this.lastX=x,this.lastY=y;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}}),c(this,"handleDragStop",m=>{if(!this.dragging)return;const g=(0,r.getControlPosition)(m,this.touchIdentifier,this);if(g==null)return;let{x,y}=g;if(Array.isArray(this.props.grid)){let C=x-this.lastX||0,k=y-this.lastY||0;[C,k]=(0,r.snapToGrid)(this.props.grid,C,k),x=this.lastX+C,y=this.lastY+k}const v=(0,r.createCoreData)(this,x,y);if(this.props.onStop(m,v)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(b.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",v),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,l.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(b.ownerDocument,f.move,this.handleDrag),(0,o.removeEvent)(b.ownerDocument,f.stop,this.handleDragStop))}),c(this,"onMouseDown",m=>(f=p,this.handleDragStart(m))),c(this,"onMouseUp",m=>(f=p,this.handleDragStop(m))),c(this,"onTouchStart",m=>(f=u,this.handleDragStart(m))),c(this,"onTouchEnd",m=>(f=u,this.handleDragStop(m)))}componentDidMount(){this.mounted=!0;const m=this.findDOMNode();m&&(0,o.addEvent)(m,u.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const m=this.findDOMNode();if(m){const{ownerDocument:g}=m;(0,o.removeEvent)(g,p.move,this.handleDrag),(0,o.removeEvent)(g,u.move,this.handleDrag),(0,o.removeEvent)(g,p.stop,this.handleDragStop),(0,o.removeEvent)(g,u.stop,this.handleDragStop),(0,o.removeEvent)(m,u.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(g)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Fl.default=h,c(h,"displayName","DraggableCore"),c(h,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(m,g){if(m[g]&&m[g].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),c(h,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Fl}function C_(){return J7||(J7=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(g,x){if(typeof WeakMap=="function")var y=new WeakMap,v=new WeakMap;return function(b,C){if(!C&&b&&b.__esModule)return b;var k,E,R={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return R;if(k=C?v:y){if(k.has(b))return k.get(b);k.set(b,R)}for(const j in b)j!=="default"&&{}.hasOwnProperty.call(b,j)&&((E=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,j))&&(E.get||E.set)?k(R,j,E):R[j]=b[j]);return R}(g,x)}(s),n=p(za()),o=p(wo),r=function(){if(W7)return js.exports;function g(y){var v,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(v=0;v<k;v++)y[v]&&(b=g(y[v]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,v,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(v=g(y))&&(C&&(C+=" "),C+=v);return C}return W7=1,js.exports=x,js.exports.clsx=x,js.exports}(),i=Lu(),l=rm(),d=tc(),c=p(S_()),u=p(im());function p(g){return g&&g.__esModule?g:{default:g}}function f(){return f=Object.assign?Object.assign.bind():function(g){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var v in y)({}).hasOwnProperty.call(y,v)&&(g[v]=y[v])}return g},f.apply(null,arguments)}function h(g,x,y){return(x=function(v){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var R=E.call(C,k);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(C)}(v,"string");return typeof b=="symbol"?b:b+""}(x))in g?Object.defineProperty(g,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[x]=y,g}class m extends t.Component{static getDerivedStateFromProps(x,y){let{position:v}=x,{prevPropsPosition:b}=y;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(x){super(x),h(this,"onDragStart",(y,v)=>{if((0,u.default)("Draggable: onDragStart: %j",v),this.props.onStart(y,(0,l.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,v)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",v);const b=(0,l.createDraggableData)(this,v),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[R,j]=(0,l.getBoundPosition)(this,C.x,C.y);C.x=R,C.y=j,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,v)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,v))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:v,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:R,positionOffset:j,scale:B,...T}=this.props;let _={},w=null;const S=!R||this.state.dragging,O=R||b,P={x:(0,l.canDragX)(this)&&S?this.state.x:O.x,y:(0,l.canDragY)(this)&&S?this.state.y:O.y};this.state.isElementSVG?w=(0,i.createSVGTransform)(P,j):_=(0,i.createCSSTransform)(P,j);const M=(0,r.clsx)(v.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:M,style:{...v.props.style,..._},transform:w}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(m,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(U7)),U7}function lm(){if(Q7)return Al.exports;Q7=1;const{default:e,DraggableCore:t}=C_();return Al.exports=e,Al.exports.default=e,Al.exports.DraggableCore=t,Al.exports}var e8,Rs={};function k_(){if(e8)return Rs;e8=1,Rs.__esModule=!0,Rs.cloneElement=function(i,l){return l.style&&i.props.style&&(l.style=o(o({},i.props.style),l.style)),l.className&&i.props.className&&(l.className=i.props.className+" "+l.className),t.default.cloneElement(i,l)};var e,t=(e=s)&&e.__esModule?e:{default:e};function n(i,l){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);l&&(c=c.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),d.push.apply(d,c)}return d}function o(i){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?n(Object(d),!0).forEach(function(c){r(i,c,d[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(d,c))})}return i}function r(i,l,d){return(l=function(c){var u=function(p,f){if(typeof p!="object"||p===null)return p;var h=p[Symbol.toPrimitive];if(h!==void 0){var m=h.call(p,f);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(p)}(c,"string");return typeof u=="symbol"?u:String(u)}(l))in i?Object.defineProperty(i,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[l]=d,i}return Rs}var t8,n8,zl={};function am(){if(t8)return zl;t8=1,zl.__esModule=!0,zl.resizableProps=void 0;var e,t=(e=za())&&e.__esModule?e:{default:e};lm();var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var l,d=r[0];return d.axis==="both"||d.axis==="y"?(l=t.default.number).isRequired.apply(l,r):t.default.number.apply(t.default,r)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var l,d=r[0];return d.axis==="both"||d.axis==="x"?(l=t.default.number).isRequired.apply(l,r):t.default.number.apply(t.default,r)}};return zl.resizableProps=n,zl}function sm(){if(n8)return Pl;n8=1,Pl.__esModule=!0,Pl.default=void 0;var e=function(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=i(m);if(g&&g.has(h))return g.get(h);var x={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var b=y?Object.getOwnPropertyDescriptor(h,v):null;b&&(b.get||b.set)?Object.defineProperty(x,v,b):x[v]=h[v]}return x.default=h,g&&g.set(h,x),x}(s),t=lm(),n=k_(),o=am(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(i=function(x){return x?g:m})(h)}function l(){return l=Object.assign?Object.assign.bind():function(h){for(var m=1;m<arguments.length;m++){var g=arguments[m];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&(h[x]=g[x])}return h},l.apply(this,arguments)}function d(h,m){var g=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);m&&(x=x.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),g.push.apply(g,x)}return g}function c(h){for(var m=1;m<arguments.length;m++){var g=arguments[m]!=null?arguments[m]:{};m%2?d(Object(g),!0).forEach(function(x){u(h,x,g[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(g)):d(Object(g)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(g,x))})}return h}function u(h,m,g){return(m=function(x){var y=function(v,b){if(typeof v!="object"||v===null)return v;var C=v[Symbol.toPrimitive];if(C!==void 0){var k=C.call(v,b);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(v)}(x,"string");return typeof y=="symbol"?y:String(y)}(m))in h?Object.defineProperty(h,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):h[m]=g,h}function p(h,m){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,x){return g.__proto__=x,g},p(h,m)}var f=function(h){var m,g;function x(){for(var v,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(v=h.call.apply(h,[this].concat(C))||this).handleRefs={},v.lastHandleRect=null,v.slack=null,v}g=h,(m=x).prototype=Object.create(g.prototype),m.prototype.constructor=m,p(m,g);var y=x.prototype;return y.componentWillUnmount=function(){this.resetData()},y.resetData=function(){this.lastHandleRect=this.slack=null},y.runConstraints=function(v,b){var C=this.props,k=C.minConstraints,E=C.maxConstraints,R=C.lockAspectRatio;if(!k&&!E&&!R)return[v,b];if(R){var j=this.props.width/this.props.height,B=v-this.props.width,T=b-this.props.height;Math.abs(B)>Math.abs(T*j)?b=v/j:v=b*j}var _=v,w=b,S=this.slack||[0,0],O=S[0],P=S[1];return v+=O,b+=P,k&&(v=Math.max(k[0],v),b=Math.max(k[1],b)),E&&(v=Math.min(E[0],v),b=Math.min(E[1],b)),this.slack=[O+(_-v),P+(w-b)],[v,b]},y.resizeHandler=function(v,b){var C=this;return function(k,E){var R=E.node,j=E.deltaX,B=E.deltaY;v==="onResizeStart"&&C.resetData();var T=(C.props.axis==="both"||C.props.axis==="x")&&b!=="n"&&b!=="s",_=(C.props.axis==="both"||C.props.axis==="y")&&b!=="e"&&b!=="w";if(T||_){var w=b[0],S=b[b.length-1],O=R.getBoundingClientRect();C.lastHandleRect!=null&&(S==="w"&&(j+=O.left-C.lastHandleRect.left),w==="n"&&(B+=O.top-C.lastHandleRect.top)),C.lastHandleRect=O,S==="w"&&(j=-j),w==="n"&&(B=-B);var P=C.props.width+(T?j/C.props.transformScale:0),M=C.props.height+(_?B/C.props.transformScale:0),A=C.runConstraints(P,M);P=A[0],M=A[1];var D=P!==C.props.width||M!==C.props.height,L=typeof C.props[v]=="function"?C.props[v]:null;L&&!(v==="onResize"&&!D)&&(k.persist==null||k.persist(),L(k,{node:R,size:{width:P,height:M},handle:b})),v==="onResizeStop"&&C.resetData()}}},y.renderResizeHandle=function(v,b){var C=this.props.handle;if(!C)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+v,ref:b});if(typeof C=="function")return C(v,b);var k=c({ref:b},typeof C.type=="string"?{}:{handleAxis:v});return e.cloneElement(C,k)},y.render=function(){var v=this,b=this.props,C=b.children,k=b.className,E=b.draggableOpts;b.width,b.height,b.handle,b.handleSize,b.lockAspectRatio,b.axis,b.minConstraints,b.maxConstraints,b.onResize,b.onResizeStop,b.onResizeStart;var R=b.resizeHandles;b.transformScale;var j=function(B,T){if(B==null)return{};var _,w,S={},O=Object.keys(B);for(w=0;w<O.length;w++)_=O[w],T.indexOf(_)>=0||(S[_]=B[_]);return S}(b,r);return(0,n.cloneElement)(C,c(c({},j),{},{className:(k?k+" ":"")+"react-resizable",children:[].concat(C.props.children,R.map(function(B){var T,_=(T=v.handleRefs[B])!=null?T:v.handleRefs[B]=e.createRef();return e.createElement(t.DraggableCore,l({},E,{nodeRef:_,key:"resizableHandle-"+B,onStop:v.resizeHandler("onResizeStop",B),onStart:v.resizeHandler("onResizeStart",B),onDrag:v.resizeHandler("onResize",B)}),v.renderResizeHandle(B,_))}))}))},x}(e.Component);return Pl.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Pl}var o8,r8,Bl={};function E_(){if(o8)return Bl;o8=1,Bl.__esModule=!0,Bl.default=void 0;var e=function(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var x=l(g);if(x&&x.has(m))return x.get(m);var y={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in m)if(b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)){var C=v?Object.getOwnPropertyDescriptor(m,b):null;C&&(C.get||C.set)?Object.defineProperty(y,b,C):y[b]=m[b]}return y.default=m,x&&x.set(m,y),y}(s),t=i(za()),n=i(sm()),o=am(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(m){return m&&m.__esModule?m:{default:m}}function l(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,x=new WeakMap;return(l=function(y){return y?x:g})(m)}function d(){return d=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var x=arguments[g];for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(m[y]=x[y])}return m},d.apply(this,arguments)}function c(m,g){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(m);g&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(m,v).enumerable})),x.push.apply(x,y)}return x}function u(m){for(var g=1;g<arguments.length;g++){var x=arguments[g]!=null?arguments[g]:{};g%2?c(Object(x),!0).forEach(function(y){p(m,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(x)):c(Object(x)).forEach(function(y){Object.defineProperty(m,y,Object.getOwnPropertyDescriptor(x,y))})}return m}function p(m,g,x){return(g=function(y){var v=function(b,C){if(typeof b!="object"||b===null)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof v=="symbol"?v:String(v)}(g))in m?Object.defineProperty(m,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[g]=x,m}function f(m,g){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,y){return x.__proto__=y,x},f(m,g)}var h=function(m){var g,x;function y(){for(var v,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(v=m.call.apply(m,[this].concat(C))||this).state={width:v.props.width,height:v.props.height,propsWidth:v.props.width,propsHeight:v.props.height},v.onResize=function(E,R){var j=R.size;v.props.onResize?(E.persist==null||E.persist(),v.setState(j,function(){return v.props.onResize&&v.props.onResize(E,R)})):v.setState(j)},v}return x=m,(g=y).prototype=Object.create(x.prototype),g.prototype.constructor=g,f(g,x),y.getDerivedStateFromProps=function(v,b){return b.propsWidth!==v.width||b.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null},y.prototype.render=function(){var v=this.props,b=v.handle,C=v.handleSize;v.onResize;var k=v.onResizeStart,E=v.onResizeStop,R=v.draggableOpts,j=v.minConstraints,B=v.maxConstraints,T=v.lockAspectRatio,_=v.axis;v.width,v.height;var w=v.resizeHandles,S=v.style,O=v.transformScale,P=function(M,A){if(M==null)return{};var D,L,N={},W=Object.keys(M);for(L=0;L<W.length;L++)D=W[L],A.indexOf(D)>=0||(N[D]=M[D]);return N}(v,r);return e.createElement(n.default,{axis:_,draggableOpts:R,handle:b,handleSize:C,height:this.state.height,lockAspectRatio:T,maxConstraints:B,minConstraints:j,onResizeStart:k,onResize:this.onResize,onResizeStop:E,resizeHandles:w,transformScale:O,width:this.state.width},e.createElement("div",d({},P,{style:u(u({},S),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},y}(e.Component);return Bl.default=h,h.propTypes=u(u({},o.resizableProps),{},{children:t.default.element}),Bl}var __=(r8||(r8=1,Ts.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ts.exports.Resizable=sm().default,Ts.exports.ResizableBox=E_().default),Ts.exports);function sd(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var nc=parseInt(s.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=sd(o,t),i=typeof r=="function";n.push(i?r:()=>sd(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)sd(n,t)}};const Ou=s.memo(s.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,disabled:l=!1,commandPopupButtonProps:d,sx:c,notifier:u,...p}=e,[f,h]=s.useState(null),[m,g]=s.useState(()=>r.getSelectedRanges().getCoords()),[x,y]=s.useState(!1),{reference:v}=i0({parentFloat:d?.parentFloat}),b=()=>f?.text??"",[C,k]=s.useState(b),E=ue(()=>{if(v?.closeAll(),!C){const U=b();return k(b()),U}if(b()===C)return C;const N=C.trim().toLowerCase();if(N==="r"||N==="c")return C;try{const U=r.getRanges(C);if(U)return U.toString()}catch{}const W=o.getByName(C);if(W&&W.getRanges())return C;let I=null;try{const U=r.getRanges(C),G=U.getCoords().map(Q=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...Q}));I=r.getRanges(G)}catch{}if(!I){const U=r.getSelectedRanges().getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));I=r.getRanges(U)}try{let U=o.getByName(C);U||(U=o.addReference(C,I)),h({text:U.getName()})}catch(U){k(b()),u.showMessage?.(U.message,{type:r0.Error})}return null},[C,o,v]),R=ue(()=>{if(r.isClosed())return;const N=[];for(let U=0;U<m.length;U++){const G=m[U];N.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G})}let W=null;try{W=o.lookupByRanges(N)}catch{}let I=null;I=W?.length>0?W[0].getName():r.getSelectedSheet().getSelectedRange().toString(),h({text:I})},[r,m]),[j,B]=s.useState(()=>o?.search()??null);Xt(o,{onCollectionChange(N){B(o.search()),R()},onClose(N){B([])}}),s.useEffect(()=>{k(b())},[f,m]);const[T,_]=s.useState(r?.getSelectedSheet());Xt(r,{onSheetsChange:N=>{_(N?.getSelectedSheet())},onViewChange(N){_(N?.getSelectedSheet())}});const[w,S]=s.useState(null),O=ue(z.CommonUtils.debounce(R,w?320:0),[]);Xt(T.getSelection(),{onChange:()=>{g(N=>{const W=r.getSelectedRanges().getCoords();return z.CoordUtils.isEqualRangesArrays(W,N)?N:W})},onAdjustingChange:N=>{S(N.getAdjusting())}}),s.useEffect(()=>{if(w){const N=r.getSelectedRange(),W=N.getRowCount(),I=N.getColumnCount();let U=`${W}R x ${I}C`;if(U.length>17&&(U=`${W}x${I}`),W>1||I>1)return void h({text:U,fontStyle:"italic",justifyContent:"center"})}h({text:r.getSelectedSheet().getSelectedRange().toString()}),O()},[m,r,w]);const P=s.useRef(null),M=s.useCallback(N=>{const{onMouseDown:W,onMouseUp:I,...U}=N;return a.jsx(V.IconButton,{...U,sx:{...U?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:a.jsx(V.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:P},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.text.icon??G.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},"::after":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*z.IFont.getDeviceScale(),fontStyle:f?.fontStyle,paddingLeft:G=>G.spacing(.75),paddingRight:G=>G.spacing(.75),boxShadow:"none",flex:"1",color:G=>G.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary}}},value:C,onFocus:G=>{G.target?.select()},onKeyDown:G=>{if(G.which===Zt.Enter||G.which===Zt.Tab){let Q=C;b()!==C&&(G.stopPropagation(),G.preventDefault(),Q=E()),Q?A(Q):i?.()}else if(G.which===Zt.Escape)b()!==C?(k(b()),setTimeout(()=>{G.target?.select()},0),G.stopPropagation(),G.preventDefault()):i?.();else if(G.which===Zt.Space)return void G.stopPropagation()},onBlur:()=>{k(b())},onChange:G=>{k(G.target.value)}})})},[C,f]),A=ue(async N=>{try{v?.closeAll();const W=o.lookupByRanges(N)?.[0];W&&await W?.select(),await r.getRanges(N)?.select()}catch(W){u.showMessage?.(W.message,{type:r0.Error})}},[o,u,r]),D=s.useCallback(N=>{setTimeout(()=>{y(!0)},0);const W={variant:$t.Menuitem,parentFloat:N.floatReference,commandHook:{...d?.commandHook,beforeExecute:(Q,H)=>(v?.closeAll(),d?.commandHook?.beforeExecute?.(Q,H))},scope:d?.scope,commands:d?.commands};let I=o.search({scope:r?.getSelectedSheet().getName()});I=I.sort((Q,H)=>Q.getType()===H.getType()?Q.getName().localeCompare(H.getName()):Q.getType()==="range"?-1:1);const U=[];for(let Q=0;Q<I.length;Q++){const H=I[Q],$=H.getRanges();if(!$||H.isHidden())continue;const F=H.getType();F!==I[Q-1]?.getType()&&(Q>0&&U.push(a.jsx(Lt,{orientation:"horizontal"},`type-divider-${U.length}`)),U.push(a.jsx(Ji,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:H.getType()==="reference"?"Ranges":"Tables"},`type-header-${U.length}`))),F==="reference"?U.push(s.createElement(o0,{...W,key:"named-"+U.length,popupCommandKeys:["editNamedReference","deleteNamedReference"],popupScope:"namedItem",scope:"namedItem",commandState:H,commands:d?.commands,label:H.getName(),quickCommand:"selectNamed",disabled:!H.getRanges()||l,icon:X=>{switch(X.key()){case"editNamedReference":return ye(a.jsx(Ob,{}));case"deleteNamedReference":return ye(a.jsx(Pb,{}));default:return ye(a.jsx(Db,{}))}}})):F==="table"&&U.push(s.createElement(o0,{...W,key:"namedItem-"+U.length,popupCommandKeys:["editTable",null,"convertTableToRange","deleteTable"],popupScope:"namedItem",scope:"namedItem",commands:d?.commands,commandState:H,label:H.getName(),quickCommand:"selectNamed",disabled:!$||l,icon:X=>(X.key(),ye(a.jsx(xa,{})))}))}const G=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[a.jsx(Re,{...W,scope:"namedItem",command:d?.commands.getCommand("addNamedReference"),icon:ye(a.jsx(Lb,{}))}),U&&U.length>0?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:U})]}):null]});return _n({...N,children:G})},[r,j,o,f]),L=Ro(t,()=>({focus(N){P.current?.focus(N)}}),[]);return a.jsx(V.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:nc([L,t]),...p,children:a.jsx(Ur,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...c},buttonProps:{sx:{backgroundColor:N=>N.palette.background.paper,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`}},tabIndex:-1,outlined:{color:N=>n?N.palette.action.disabled:gt.alpha(N.palette.divider,.2)},parentFloat:v,createPopupPanel:D,onPopupOpen:()=>y(!0),onPopupClose:()=>y(!1),createTooltip:({children:N},W)=>a.jsx(No,{title:W||x?"":"Name Box",disabled:W,leaveDelay:0,sx:{opacity:W||x?0:1},children:N}),createQuickButton:M})})}));Ou.displayName="NamedCollectionEditor";const T_=(e,t)=>a.jsx(Ou,{ref:t,...e}),Pu=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,sheetElement:r,gridStyle:i,showNamedCollectionEditor:l=!0,NamedCollectionEditorProps:d,renderNamedCollectionEditor:c=T_,disabled:u,commands:p,...f}=e,[h,m]=s.useState(o?.getSelectedSheet());Xt(o,{onSheetsChange:$=>{m($?.getSelectedSheet())},onViewChange($){m($?.getSelectedSheet())}});const[g,x]=s.useState(h.getSelection().getCoords().cell),y=h.getRange(g).getCell(),v=u||!y.isEditAllowed(),b=s.useRef(null),C=s.useMemo(()=>({fontSize:11}),[]);Xt(h.getSelection(),{onChange:()=>{x(h.getSelection().getCoords().cell)}}),Xt(h,{onProtectionChange(){x(h.getSelection().getCoords().cell)}});const k=b.current?.getLineHeight()??20,[E,R]=s.useState(k),[j,B]=s.useState(5),[T,_]=s.useState(1),w=ue(($,{size:F})=>{$.preventDefault(),$.stopPropagation();const X=Math.floor(F.height/k);R(X*k+1),X>1&&B(X)},[k]),S=ue(($,{size:F})=>{const X=Math.floor(F.height/k);_(X)},[k]),O=$r(),P=O.getMode();let M=null;P?.key==="edit"&&(M=P.args?.stateAndCoords);const A=s.useMemo(()=>{let $=M?.editState;return $||($=N9(()=>h.getRange(g).getCell())),a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:a.jsx(B9,{ref:b,activeCoords:g,sheet:h,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:g})},defaultTextStyle:C,useRichStyling:!1,disabled:v,onChangeEdit:F=>{if(F.dirty!==void 0){const X={sheet:h,coords:g,editState:F};O.setMode(K=>({...K,args:{...K?.args,stateAndCoords:X}}))}},editState:$,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,M,g,T,r]),D=s.useRef(null),L=s.useMemo(()=>l?c({names:o.getNames(),workbook:o,...d},D):null,[c,d,l,h,o,v]),N=s.useMemo(()=>a.jsxs(V.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,border:$=>`solid ${v?$.palette.action.disabled:gt.alpha($.palette.divider,.2)} 1px`},children:[a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:ye(a.jsx(Rb,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||M===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.cancelEdit()}}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:ye(a.jsx(Ib,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||M===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.submitEdit()}}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:ye(a.jsx(Qb,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()}})]}),[v,M]),W=qr(),[I,U]=s.useState(!1),G=s.useMemo(()=>a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:$=>$.spacing(.5),alignItems:"start"},children:[N,a.jsxs(V.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:$=>$.typography.fontFamily,fontSize:11*z.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:$=>`${$.shape.borderRadius}px`,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,border:$=>`solid ${v?$.palette.action.disabled:gt.alpha($.palette.divider,.2)} 1px`,"& textarea":{color:$=>v?`${$.palette.text.disabled} !important`:$.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>U(!0),onBlur:()=>U(!1),onMouseDown:$=>{$.target?.classList.contains("react-resizable-handle")&&$.preventDefault()},children:[a.jsx(V.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:$=>$.spacing(1),paddingRight:$=>$.spacing(1)},children:a.jsx(__.ResizableBox,{height:E,draggableOpts:{grid:[k,k]},minConstraints:[k,k],maxConstraints:[15*k,15*k],onResize:S,onResizeStop:w,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:A})}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:ye(T>1?a.jsx(wn.ExpandLess,{}):a.jsx(wn.ExpandMore,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{const $=T>1?1:j;R($*k+1),_($)}}),a.jsx(V.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:I?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:$=>$.palette.primary.main,borderRadius:$=>`${$.shape.borderRadius}px`}})]})]}),[N,A,I,T,k]),Q=s.useMemo(()=>L||G?!L&&G?G:L&&!G?L:a.jsx(a.Fragment,{children:a.jsx(kd,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${W.palette.text.icon??W.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:L,elementAfter:G})}):null,[L,G]),H=Ro(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>D.current}),[]);return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",gap:$=>$.spacing(.5),...n},ref:H,...f,children:Q})}));Pu.displayName="FormulaBar";const Au=s.memo(s.forwardRef((e,t)=>{const{filter:n,commands:o,disabled:r,sx:i,floatReference:l,...d}=e,c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(h,m)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:l}),[r,l]),p=s.useMemo(()=>({...c,...u,variant:$t.Menuitem}),[c,u]),f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:o.getCommand("sortAscending"),icon:ye(a.jsx($d,{}))}),a.jsx(Re,{...p,command:o.getCommand("sortDescending"),icon:ye(a.jsx(Wh,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:o.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),[]]});return a.jsx(V.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...i},...d,children:f})}));Au.displayName="FilterColumnMenu";const cm=s.memo(s.forwardRef((e,t)=>{const{children:n,className:o,disabled:r,style:i,filter:l,...d}=e,c=Ro(t,()=>({isFilters:()=>!0}),[]);return a.jsx("div",{ref:c,className:Qn("filters",o),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...i},...d,children:a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[a.jsx("div",{children:l.getName()}),a.jsx("div",{children:"Filter Widget"})]})})}));cm.displayName="Filters";const Fu=s.memo(s.forwardRef((e,t)=>{const{children:n,sheet:o,style:r,className:i,value:l,index:d,editing:c,editable:u,disabled:p,selectedIndex:f,dragging:h,borderColor:m,borderWidth:g,activeColor:x,background:y="white",tabRadius:v=4,gridTheme:b,...C}=e,[k,E]=s.useState(()=>!!o&&o.getProtection().isLocked()),[R,j]=s.useState(()=>o?o.getTabColor():null);Xt(o,{onProtectionChange:()=>{E(o.getProtection().isLocked())},onTabColorChange:()=>{j(o.getTabColor())},onStyleChange:()=>{j(o.getTabColor())}});const B=qr(),T=f===d;let _=null,w=null;if(R||h){let P=y;R?(w=R.toBlackOrWhite().toCSS(),P=R?.toCSS()):T||(P=B.palette.background.paper),_=a.jsx(V.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:T?"50%":"100%",borderRadius:"4px",border:M=>T?`${y} solid 1px`:`${M.palette.divider} solid 1px`,background:T&&R?`linear-gradient(0deg, ${P} 0%, transparent)`:P}})}let S=null;typeof m=="string"?S=m:m?.toCSS&&(S=m.toCSS());const O=T?a.jsx(V.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:P=>P.palette.primary.main}}):null;return a.jsx(t9,{theme:T?b??B:B,children:a.jsx(V.Box,{ref:t,className:Qn(i),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:h?"grabbing":void 0},...C,children:a.jsx(Ig,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?S:"transparent",children:a.jsx(V.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:h?"grabbing":void 0,color:T?"primary":w||"text.secondary",backgroundColor:T?y:"transparent","&:hover:not([disabled])":{backgroundColor:T?y:"transparent"},"& input":{color:P=>`${P.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:a.jsxs(a.Fragment,{children:[_,a.jsxs(V.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,O]}),k?a.jsx(wn.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):a.jsx(V.Box,{sx:{minHeight:"22px"}})]})]})},l+":"+d)})})})}));Fu.displayName="SheetTab";const zu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,index:o,commands:r,scope:i="sheet",disabled:l,floatReference:d,sx:c,className:u,tabStripRef:p,...f}=e,[h,m]=s.useState(n?.getProtection());Xt(n,{onProtectionChange:b=>{m(b?.getProtection())}});const g=s.useMemo(()=>({}),[]),x=s.useMemo(()=>({commandHook:{beforeExecute:(b,C)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:i,commandState:o,disabled:l||o===void 0,parentFloat:d}),[l,d]),y=s.useMemo(()=>({...g,...x}),[g,x]),v=a.jsxs(a.Fragment,{children:[a.jsx(Re,{command:r.getCommand("addSheet"),commandState:o,...y,variant:$t.Menuitem}),a.jsx(Re,{command:r.getCommand("deleteSheet"),...y,variant:$t.Menuitem}),a.jsxs(sr,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(d.closeAll()).then(()=>{p?.startEdit(o)})},disabled:l||!h.isStructureAllowed(),parentFloat:d,children:["Rename",i!=="sheet"?" Sheet":""]}),a.jsx(Re,{command:r.getCommand("duplicateSheet"),...y,variant:$t.Menuitem}),a.jsx(Re,{command:r?.getCommand("protectionSheetToggle"),...y,variant:$t.Menuitem,icon:a.jsx(wn.Lock,{})}),a.jsx(ol,{variant:$t.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:a.jsx(V2,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Wi.End},parentFloat:d}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{command:r.getCommand("hideSheet"),...y,variant:$t.Menuitem,icon:ye(a.jsx(qh,{}))})]});return a.jsx(V.Box,{ref:t,className:Qn("menu",u),sx:{...c},...f,children:v})}));zu.displayName="SheetTabMenu";const Bu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,gridStyle:o,floatReference:r,closeFloatAll:i,className:l,...d}=e,[c,u]=s.useState(n?.getSheets().search()),[p,f]=s.useState(n?.getProtection());Xt(n,{onSheetsChange:m=>{u(m.getSheets().search())},onProtectionChange:m=>{f(m?.getProtection())}});const h=s.useMemo(()=>{const m=[],g=n.getSheets().search({visibility:z.ISheet.Visibility.Hidden}),x=n.getSelectedSheet();for(let y=0;y<g.length;y++){const v=g[y],b=v.getVisibility();if(b===z.ISheet.Visibility.VeryHidden)continue;const C=x===v,k=v.getProtection().isLocked(),E=v.getTabColor(),R=o?.body.fill??"transparent";let j=null,B=null,T=R;E&&(T=E.toCSS(),C||(B=E.toBlackOrWhite().toCSS()),j=a.jsx(V.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:C?T:"transparent",borderRadius:"4px",border:`solid 1px ${o.header.edgeStrokeFill}`},children:a.jsx(V.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:C||b===z.ISheet.Visibility.Hidden?"50%":"100%",border:w=>C?`${R} solid 1.5px`:`${w.palette.divider} solid 1px`,background:C&&E?`linear-gradient(0deg, ${T} 0%, ${R})`:T,borderRadius:"4px"}})}));let _=null;k&&(_=a.jsx(wn.Lock,{color:"secondary"})),b!==z.ISheet.Visibility.Visible&&(_=ye(a.jsx(qh,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),_&&(_=a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:_})),m.push(a.jsx(sr,{disabled:!p.isStructureAllowed()&&b===z.ISheet.Visibility.Hidden,sx:{color:w=>{let S=C?w.palette.primary.main:w.palette.text.secondary;return B&&(S=B),b===z.ISheet.Visibility.Hidden&&(S=gt.alpha(S,w.palette.action.disabledOpacity)),S},borderLeft:w=>`${C?w.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:C?"700":"400","&:hover":{fontWeight:"700"}},icon:C?a.jsx(Aa,{}):void 0,onMouseDown:w=>w.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(w){console.error(w)}})},children:a.jsxs(a.Fragment,{children:[j,a.jsxs(V.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[a.jsxs(V.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),a.jsx(V.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),_]})]})},""+y))}return m},[n,p,c,r,o]);return a.jsx(V.Box,{ref:t,className:Qn("menu",l),...d,children:h})}));Bu.displayName="SheetsAllMenu";var j_=function(){},dm=typeof window<"u",M_=dm?s.useLayoutEffect:s.useEffect,i8={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ra=dm&&window.ResizeObserver!==void 0?function(){var e=s.useState(null),t=e[0],n=e[1],o=s.useState(i8),r=o[0],i=o[1],l=s.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var c=d[0].contentRect,u=c.x,p=c.y,f=c.width,h=c.height,m=c.top,g=c.left,x=c.bottom,y=c.right;i({x:u,y:p,width:f,height:h,top:m,left:g,bottom:x,right:y})}})},[]);return M_(function(){if(t)return l.observe(t),function(){l.disconnect()}},[t]),[n,r]}:function(){return[j_,i8]};function I1(){return I1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},I1.apply(null,arguments)}function Nu(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function D1(e,t){return D1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},D1(e,t)}function um(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D1(e,t)}function l8(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const a8=!1,hm=s.createContext(null);var pm=function(e){return e.scrollTop},Jl="unmounted",K0="exited",X0="entering",Ti="entered",C2="exiting",d0=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var l,d=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?d?(l=K0,i.appearStatus=X0):l=Ti:l=o.unmountOnExit||o.mountOnEnter?Jl:K0,i.state={status:l},i.nextCallback=null,i}um(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===Jl?{status:K0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==X0&&i!==Ti&&(r=X0):i!==X0&&i!==Ti||(r=C2)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,l=this.props.timeout;return o=r=i=l,l!=null&&typeof l!="number"&&(o=l.exit,r=l.enter,i=l.appear!==void 0?l.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===X0){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:wo.findDOMNode(this);i&&pm(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===K0&&this.setState({status:Jl})},n.performEnter=function(o){var r=this,i=this.props.enter,l=this.context?this.context.isMounting:o,d=this.props.nodeRef?[l]:[wo.findDOMNode(this),l],c=d[0],u=d[1],p=this.getTimeouts(),f=l?p.appear:p.enter;!o&&!i||a8?this.safeSetState({status:Ti},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:X0},function(){r.props.onEntering(c,u),r.onTransitionEnd(f,function(){r.safeSetState({status:Ti},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:wo.findDOMNode(this);r&&!a8?(this.props.onExit(l),this.safeSetState({status:C2},function(){o.props.onExiting(l),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:K0},function(){o.props.onExited(l)})})})):this.safeSetState({status:K0},function(){o.props.onExited(l)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(l){i&&(i=!1,r.nextCallback=null,o(l))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:wo.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(i&&!l){if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=d[0],u=d[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===Jl)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var l=Nu(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s.createElement(hm.Provider,{value:null},typeof i=="function"?i(o,l):s.cloneElement(s.Children.only(i),l))},t}(s.Component);function Ei(){}d0.contextType=hm,d0.propTypes={},d0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ei,onEntering:Ei,onEntered:Ei,onExit:Ei,onExiting:Ei,onExited:Ei},d0.UNMOUNTED=Jl,d0.EXITED=K0,d0.ENTERING=X0,d0.ENTERED=Ti,d0.EXITING=C2;var cd=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=l8(o.className,r):o.setAttribute("class",l8(o.className&&o.className.baseVal||"",r)));var o,r})},k2=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1];o.removeClasses(p,"exit"),o.addClass(p,f?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(d,c)},o.onEntering=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1]?"appear":"enter";o.addClass(p,f,"active"),o.props.onEntering&&o.props.onEntering(d,c)},o.onEntered=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1]?"appear":"enter";o.removeClasses(p,f),o.addClass(p,f,"done"),o.props.onEntered&&o.props.onEntered(d,c)},o.onExit=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(d)},o.onExiting=function(d){var c=o.resolveArguments(d)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(d)},o.onExited=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(d)},o.resolveArguments=function(d,c){return o.props.nodeRef?[o.props.nodeRef.current,d]:[d,c]},o.getClassNames=function(d){var c=o.props.classNames,u=typeof c=="string",p=u?(u&&c?c+"-":"")+d:c[d];return{baseClassName:p,activeClassName:u?p+"-active":c[d+"Active"],doneClassName:u?p+"-done":c[d+"Done"]}},o}um(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var l=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(l+=" "+d),i==="active"&&o&&pm(o),l&&(this.appliedClasses[r][i]=l,function(c,u){c&&u&&u.split(" ").forEach(function(p){return h=p,void((f=c).classList?f.classList.add(h):function(m,g){return m.classList?!!g&&m.classList.contains(g):(" "+(m.className.baseVal||m.className)+" ").indexOf(" "+g+" ")!==-1}(f,h)||(typeof f.className=="string"?f.className=f.className+" "+h:f.setAttribute("class",(f.className&&f.className.baseVal||"")+" "+h)));var f,h})}(o,l))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],l=i.base,d=i.active,c=i.done;this.appliedClasses[r]={},l&&cd(o,l),d&&cd(o,d),c&&cd(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Nu(o,["classNames"]);return s.createElement(d0,I1({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.Component);k2.defaultProps={classNames:""},k2.propTypes={};const dd=.12,E2=(e,t)=>{const n={},o=c=>{const u=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:u,strokeFill:Cr(u,dd,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:Cr(n.body.fill,dd,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:Cr(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:Cr(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:Cr(c?.fill??n.body.fill,.22,e.palette?.mode),fill:Cr(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=Cr(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:gt.alpha(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:gt.alpha(i,.7)},n.headerSelectAll={...n.headerSelect,fill:gt.alpha(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:Cr(r.fill,dd,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:Cr(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:Cr(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?gt.alpha(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?gt.alpha(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const l=t??e,d=l.palette.mode==="dark";return n.selection={fill:l.palette?.primary?.main?gt.alpha(l.palette?.primary?.main,.1):void 0,strokeFill:l.palette?.primary?.main},n.selectionInactive={...n.selection,fill:l.palette?.divider?gt.alpha(l.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:gt.alpha(l.palette.warning.light,.05),strokeFill:l.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=gt.alpha(l.palette.action.active,.5),n.colorGrey=l.palette.action.active,n.filterDarkInvert=d?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function s8(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function c8(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Ia=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,l=Ro(t,()=>({}),[]),[d,c]=Ra(),u=s.useRef(null),p=s.useRef(null),[f,h]=s.useReducer(E=>E+1,0),[m,g]=s.useState(null),[x,y]=s.useState(null),[v,b]=s.useState(null),{reference:C}=i0({parentFloat:r,label:"overflow"});s.useLayoutEffect(()=>{p.current={refs:[]};const E=[],R=s.Children.toArray(n);let j=0;R.forEach((B,T)=>{E.push(a.jsx(V.Box,{sx:{display:"flex"},ref:_=>{j++,j===R.length&&h();const w={current:null};w.current=_,p.current.refs[T]=w},children:B},T))}),g(E)},[n,c]),s.useLayoutEffect(()=>{if(!m)return;const E=p.current.refs;if(!l.current||!E||E.length===0)return y(null),void b(null);const R=l.current?.getBoundingClientRect(),j=[],B=[];let T=0,_=!1;for(let S=0;!_&&S<E.length;S++){const O=E[S];if(!O)continue;if(!O.current){_=!0;continue}const P=O.current.getBoundingClientRect();T+=P?.width,T>R.width&&(_=!0)}if(!_)return y(null),void b([]);const w=u.current?.getBoundingClientRect();T=0;for(let S=0;S<E.length;S++){const O=E[S];let P=!1;if(O.current){const M=O.current.getBoundingClientRect();T+=M?.width,T<R.width-w.width&&(P=!0)}P?j.push(m[S]):B.push(m[S])}y(j.length>0?j:null),b(B.length>0?B:null)},[n,m,c,C,f]);const k=ue(E=>{const R=[];for(let B=0;B<v.length;B++){let T=s.Children.toArray(v[B]);const _=T[0];T=s.Children.toArray(_.props.children?.props.children??_.props.children);const w=T[0],S={...w.props};S.parentFloat&&(S.parentFloat=E.floatReference);const O=s.cloneElement(w,S);R.push(O)}const j=a.jsx(V.Box,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:B=>B.spacing(.5),paddingBottom:B=>B.spacing(.5),paddingLeft:B=>B.spacing(1),paddingRight:B=>B.spacing(1),overflow:"hidden"},children:R});return _n({...E,children:j})},[v]);return a.jsxs(V.Box,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:nc([l,d,t]),...i,children:[a.jsx(V.Box,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:x??m}),a.jsx(V.Box,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:a.jsx(Ur,{createPopupPanel:k,ref:u,parentFloat:C,createTooltip:({children:E},R)=>a.jsx(No,{label:"More",description:"More toolbar options…",disabled:R,children:E}),icon:a.jsx(Ih,{children:a.jsx(wn.MoreHoriz,{})})})})]})})),fm="https://unpkg.com/@sheetxl/scripting-templates/dist",R_=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./C2I6DLwxf-YSb_jE.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DZqxCC2NnSaeVA6T.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D2lk9iDkETqiNlM-.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],I_=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./C2I6DLwxf-YSb_jE.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DZqxCC2NnSaeVA6T.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D2lk9iDkETqiNlM-.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class mm{constructor(t=R_,n=I_){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const l={...o,...o?.typedConstructorOptions?.[n]};let d;delete l.typedConstructorOptions;try{d=await i(t,l)}catch(c){throw new Error("Unable to import",{cause:c})}return d}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const l=n;return await this._fromFile(l,t)}case"base64":{let l;if(n&&typeof n=="object"&&"base64"in n)l=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,u]=n.split(",");l=u}else l=n;const d=eg.base64ToArrayBuffer(l),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(d,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let l,d,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const x=n;c=x.input,l=x.init,d=x.timeout}}const u=d||3e4,p=new AbortController,f=setTimeout(()=>p.abort(),u),h=typeof c=="string"?c:c.toString(),m=r||z.TextUtils.getFileNameExtension(h),g=this.getReadFormatTypeForExt(m)||this._readFormatTypes[0];try{const x=await fetch(c,{...l,signal:p.signal});if(clearTimeout(f),!x.ok)throw new Error(`Failed to fetch: ${x.status} ${x.statusText}`);const y=await x.arrayBuffer();if(!g)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(y,g.key,t),title:o||z.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:g}}catch(x){throw clearTimeout(f),x.name==="AbortError"?new Error(`Fetch timeout after ${u}ms: ${h}`):x}}case"buffer":{const l=n,d=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!d)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(l,d.key,t),title:o||"buffer-file",formatType:d}}case"stream":{const l=n.getReader(),d=[];let c=0;try{for(;;){const{done:m,value:g}=await l.read();if(m)break;d.push(g),c+=g.length}}finally{l.releaseLock()}const u=new ArrayBuffer(c),p=new Uint8Array(u);let f=0;for(const m of d)p.set(m,f),f+=m.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(u,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${z.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt(z.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${z.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const l=await t.arrayBuffer(),d=new Uint8Array(l),c={...n,...n?.typedConstructorOptions?.[i.key]};delete c.typedConstructorOptions;const u=i.handler;if(!u)throw new Error(`Unable to resolve handler for type: ${i?.description??z.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await c.onStart?.(r);const p=await u(d,c);o=new D_(t,p,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=z.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const l=this.getWriteFormats(),d=l.length;for(let p=0;!i&&p<d;p++)(l[p].ext===r||!r&&l[p].isDefault)&&(i=l[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let u=null;try{u=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,f)=>{(function(h,m){const g=URL.createObjectURL(h),x=document.createElement("a");x.style.display="none",x.href=g,x.download=m,document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(g)})(new Blob([f],{type:"application/octet-stream"}),p)})(c,u)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class D_{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const L_=new mm;var d8,u8,O_=function(){if(u8)return d8;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,l="",d=0,c=-1,u=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&u!==1)if(c!==p-1&&u===2){if(l.length<2||d!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var f=l.lastIndexOf("/");if(f!==l.length-1){f===-1?(l="",d=0):d=(l=l.slice(0,f)).length-1-l.lastIndexOf("/"),c=p,u=0;continue}}else if(l.length===2||l.length===1){l="",d=0,c=p,u=0;continue}}r&&(l.length>0?l+="/..":l="..",d=2)}else l.length>0?l+="/"+o.slice(c+1,p):l=o.slice(c+1,p),d=p-c-1;c=p,u=0}else i===46&&u!==-1?++u:u=-1}return l}u8=1;var n={resolve:function(){for(var o,r="",i=!1,l=arguments.length-1;l>=-1&&!i;l--){var d;l>=0?d=arguments[l]:(o===void 0&&(o=process.cwd()),d=o),e(d),d.length!==0&&(r=d+"/"+r,i=d.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var l=o.length,d=l-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var u=r.length-c,p=d<u?d:u,f=-1,h=0;h<=p;++h){if(h===p){if(u>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else d>p&&(o.charCodeAt(i+h)===47?f=h:h===0&&(f=0));break}var m=o.charCodeAt(i+h);if(m!==r.charCodeAt(c+h))break;m===47&&(f=h)}var g="";for(h=i+f+1;h<=l;++h)h!==l&&o.charCodeAt(h)!==47||(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(c+f):(c+=f,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,l=-1,d=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!d){l=c;break}}else d=!1;return l===-1?i?"/":".":i&&l===1?"//":o.slice(0,l)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,l=0,d=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var u=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var f=o.charCodeAt(i);if(f===47){if(!c){l=i+1;break}}else p===-1&&(c=!1,p=i+1),u>=0&&(f===r.charCodeAt(u)?--u===-1&&(d=i):(u=-1,d=p))}return l===d?d=p:d===-1&&(d=o.length),o.slice(l,d)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){l=i+1;break}}else d===-1&&(c=!1,d=i+1);return d===-1?"":o.slice(l,d)},extname:function(o){e(o);for(var r=-1,i=0,l=-1,d=!0,c=0,u=o.length-1;u>=0;--u){var p=o.charCodeAt(u);if(p!==47)l===-1&&(d=!1,l=u+1),p===46?r===-1?r=u:c!==1&&(c=1):r!==-1&&(c=-1);else if(!d){i=u+1;break}}return r===-1||l===-1||c===0||c===1&&r===l-1&&r===i+1?"":o.slice(r,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i=(r=o).dir||r.root,l=r.base||(r.name||"")+(r.ext||""),i?i===r.root?i+l:i+"/"+l:l;var r,i,l},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,l=o.charCodeAt(0),d=l===47;d?(r.root="/",i=1):i=0;for(var c=-1,u=0,p=-1,f=!0,h=o.length-1,m=0;h>=i;--h)if((l=o.charCodeAt(h))!==47)p===-1&&(f=!1,p=h+1),l===46?c===-1?c=h:m!==1&&(m=1):c!==-1&&(m=-1);else if(!f){u=h+1;break}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===u+1?p!==-1&&(r.base=r.name=u===0&&d?o.slice(1,p):o.slice(u,p)):(u===0&&d?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(u,c),r.base=o.slice(u,p)),r.ext=o.slice(c,p)),u>0?r.dir=o.slice(0,u-1):d&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,d8=n}();const h8=/^(con|prn|aux|nul|com\d|lpt\d)$/i,p8=/[<>:"/\\|?*\u0000-\u001F]/g,ei=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:p8,WINDOW_FILENAME_RESERVED_REGEX:h8,isValidWindowsFilename:e=>!(!e||e.length>255||p8.test(e)||h8.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return O_.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),f8=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:mm,IOUtils:ei,WorkbookIO:L_},Symbol.toStringTag,{value:"Module"})),P_=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},gm=async e=>{const t=ei.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new yd(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new yd(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(l){throw new Error(`Failed to parse directory: ${l.message}. Ensure the file is valid JSON.`)}const i=r.map(async l=>{try{const d=ei.relativePath(e,l.path),c=await fetch(d);if(!c.ok)throw new Error(`Failed to fetch file at '${l.path}': ${c.statusText}`);const u=await c.text();let p=l.metadata;return p?.title||(p={title:P_(l),...p}),{path:l.path,content:u,metadata:p}}catch(d){console.error(d.message)}return null});return(await Promise.all(i)).filter(l=>l!==null)},ud={fontSize:"0.8rem",marginRight:"4px"},A_=s.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...l}=e;let d;return d=n.metadata?.icon==="formula"?a.jsx(Kh,{sx:ud}):n.metadata?.icon==="macro"?a.jsx(G2,{sx:ud}):a.jsx(wn.WebhookOutlined,{sx:ud}),a.jsx(sr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:d,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==Zt.Enter&&c.keyCode!==Zt.Space||r(n)},...l,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[a.jsx(V.Typography,{component:"div",children:n.metadata?.title??n.path}),a.jsx(V.Typography,{variant:"caption",component:"div",sx:{color:c=>gt.alpha(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),xm=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:l=fm,...d}=e,[c,u]=s.useState([]),[p,f]=s.useState(!0),h=ro(n,["executeSelectedScript"]),m=h[0]?.context?.();s.useEffect(()=>{(async()=>{try{const x=await gm(l);u(x)}catch{}finally{f(!1)}})()},[l]);const g=s.useCallback((x,y)=>{if(p)return a.jsx("div",{children:"Loading..."});const v={variant:$t.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=E=>{m.getEditor()?.insertSnippet(E.content),x.closeFloat()},C=[];for(let E=0;E<c.length;E++){const R=c[E];R&&C.push(a.jsx(A_,{handleInsert:b,snippet:R},R.path))}const k=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[C.length>0?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C}),a.jsx(Lt,{orientation:"horizontal"})]}):null,s.createElement(Re,{...v,key:"help",command:n.getCommand("help"),icon:ye(a.jsx(Zh,{}))})]});return _n({...x,children:k})},[i,o,r,p,m]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:g,icon:ye(a.jsx(ov,{})),...d})})),Vu=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsx(a.Fragment,{children:a.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[a.jsx("div",{children:a.jsx(Ia,{parentFloat:o,style:{},children:a.jsx(Re,{...c,command:n.getCommand("saveScripts"),icon:ye(a.jsx(rv,{}))})})}),a.jsx("div",{style:{flex:"1 1 100%"}}),a.jsx("div",{children:a.jsx(Ia,{parentFloat:o,style:{},children:a.jsx(xm,{...c,commands:n})})})]})})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})}));Vu.displayName="ScriptEditorToolbar";const hd={fontSize:"1rem"},ym=s.memo(s.forwardRef((e,t)=>{const{scriptPath:n=fm,onScriptSelect:o,sx:r=gn.EmptyCssProperties,className:i,buttonMinWidth:l=210,buttonMinHeight:d=80,gap:c=12,...u}=e,[p,f]=s.useState([]),[h,m]=s.useState(!0),[g,x]=s.useState(null);if(s.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{m(!0),x(null);const C=await gm(n);for(let k=0;k<C.length;k++){const E=C[k];E&&b.push(E)}}catch(C){x(C instanceof Error?C.message:"Failed to load scripts"),C instanceof yd||console.error("Error loading scripts:",C)}finally{f(b),m(!1)}})()},[n]),h)return a.jsx(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Qn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...r},...u,children:a.jsx(V.CircularProgress,{})});let y=null;g&&(y=a.jsxs(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",className:Qn(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},...u,children:[a.jsx(V.Typography,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),a.jsx(V.Typography,{color:"error",component:"div",children:g})]}));const v=b=>{const C=b.metadata?.icon;return C==="macro"?a.jsx(G2,{sx:hd}):C==="formula"?a.jsx(Kh,{sx:hd}):C==="autostart"?a.jsx(wn.WebhookOutlined,{sx:hd}):null};return a.jsxs(V.Box,{ref:t,className:Qn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...r},...u,children:[a.jsxs(V.Box,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[a.jsx(V.Typography,{variant:"h6",gutterBottom:!0,children:"Script Template"}),a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),a.jsx(V.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${l}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,C)=>a.jsxs(V.Button,{variant:"outlined",sx:{minWidth:l,minHeight:d,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...C===0&&{borderStyle:"dashed",marginBottom:"8px"},...C===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[a.jsx(V.Typography,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${C}`))})]}),y]})}));ym.displayName="TemplateSelectPanel";const Hu=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:l=!1,onClose:d,autoFocusSel:c,autoFocus:u=!0,scripts:p,...f}=e,h=qr(),[m,g]=s.useState(!1),x=s.useRef(!1),[y,v]=s.useState({message:"Loading",cursor:"",dirty:!1}),[b,C]=s.useState(null);s.useEffect(()=>{let L=!1;return C(null),async function(){if(p&&(await p.start(),!L)){const N=p.getModules().search()[0]?.getSource();C({source:N||null})}}(),()=>{L=!0}},[p]);const k=s.useCallback(L=>{v(N=>({...N,...L}))},[]),E=s.useRef(null),R=s.useRef(null),[j,B]=s.useState(null),T=s.useRef(null),_=ue(L=>{if(j)return j.focus(L),!0;if(c){const N=R.current?.querySelectorAll?.(c);if(N&&N.length>0)return N[0]?.focus?.(L),!0}return R.current?.focus?.(L),!1},[j,c,u]),w=s.useMemo(()=>a.jsx(il,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),S=s.useMemo(()=>a.jsx(V.Paper,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,marginLeft:L=>L.spacing(.5),marginRight:L=>L.spacing(.5),marginTop:L=>L.spacing(1),marginBottom:L=>L.spacing(1)},children:a.jsx(Vu,{commands:i})}),[h,i]),O=s.useMemo(()=>a.jsx(V.Box,{className:Qn("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:L=>L.palette.text.secondary},variant:"caption",children:y.message}),a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:L=>L.palette.text.secondary},variant:"caption",children:y.dirty?"Unsaved":""}),a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:L=>L.palette.text.secondary},variant:"caption",children:y.cursor})]})}),[y]),P=s.useMemo(()=>a.jsxs(V.Box,{className:Qn("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[S,a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:a.jsx(s_,{ref:R,loadingPanel:w,readOnly:l,onClose:d,autoFocus:u,commands:i,onStatusChange:k,darkMode:h.palette.mode==="dark",...r})}),O]}),[h,i,S,O,m,w,l,r,u,c,d,k]),M=s.useMemo(()=>a.jsx(V.DialogTitle,{className:Qn({"Mui-selected":x.current}),sx:{display:"flex",color:L=>L.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:L=>`${L.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:L=>L.transitions.duration.shortest/2+"ms"},backgroundColor:L=>gt.alpha(L.palette.action.hover,.03),borderBottom:L=>`solid ${gt.alpha(L.palette.divider,.2)} 1px`},onPointerDown:L=>{L.isDefaultPrevented()||(L.preventDefault(),_())},children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:L=>L.spacing(.25),marginBottom:L=>L.spacing(.25),marginLeft:L=>L.spacing(1),marginRight:L=>L.spacing(1)},children:[a.jsx(V.Box,{sx:{flex:"1 1 100%",paddingLeft:L=>L.spacing(1)},children:"Script (Typescript)"}),a.jsx(No,{label:"Close",children:a.jsx(V.IconButton,{"aria-label":"close",sx:{color:L=>L.palette.text.icon??L.palette.action.active},touchRippleRef:E,onPointerDown:L=>{E.current?.start(L,{center:!1}),L.stopPropagation(),L.preventDefault()},onPointerUp:()=>{R.current?.close()},children:a.jsx(wn.Close,{})})})]})}),[h,m]),A=s.useMemo(()=>{let L;return b===null?null:(b.source===null&&(L=a.jsx(ym,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:N=>{R.current?.getEditor().insertSnippet(N.content),C({source:N.content??""})}})),a.jsxs(V.Box,{tabIndex:0,className:Qn("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},onPointerDown:N=>{N.isDefaultPrevented()||R.current?.focus()},children:[M,a.jsxs(V.Box,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[P,L]})]}))},[S,P,n,b]),D=Ro(t,()=>({isScriptWorkspaceElement:()=>!0,focus:L=>{_(L)}}),[]);return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:D,...f,onFocus:L=>{g(!0),x.current=!0,D.current?.contains(L.target)&&L.target!==D.current&&B(L.target),L.relatedTarget&&!T.current&&(T.current=L.relatedTarget),f?.onFocus?.(L)},onBlur:L=>{D?.current?.contains(L.relatedTarget)||D?.current===L.relatedTarget||(T.current=null,x.current=!1,g(!1)),f?.onBlur?.(L)},children:A})}));Hu.displayName="ScriptWorkspace";const $u=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["executeScript"])[0].context();ro(n,["showScriptEditor"]);const c=s.useCallback((u,p)=>{const f={variant:$t.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=d?.getScripts(),m=h?.searchFunction({type:"macro"}),g=[];if(m)for(let y=0;y<m.length;y++){const v=m[y];g.push(a.jsx(Re,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ye(a.jsx(G2,{})),labelOverride:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${y}`))}const x=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[g.length>0?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:g}),a.jsx(Lt,{orientation:"horizontal"})]}):null,s.createElement(Re,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ye(a.jsx(Kb,{}))})]});return _n({...u,children:x})},[i,d,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:ye(a.jsx(nv,{})),...l})})),F_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ro(n,["executeScript","showScriptEditor"]),d=l[0]?.context?.(),c=s.useCallback(u=>{const{commandButtonProps:p,commandPopupProps:f}=u,h=a.jsx(ol,{...f,command:n.getCommand("formatFontColor"),icon:a.jsx(ny,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),m=a.jsx(ol,{...f,command:n.getCommand("formatFillColor"),icon:a.jsx(ty,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Wi.End}}),g=n.getCommand("undo")?a.jsx(a.Fragment,{children:a.jsx(ju,{...f,quickCommand:"undo"})}):null,x=n.getCommand("find")?a.jsx(a.Fragment,{children:a.jsx(Lf,{...f})}):null;let y=null;const v=d?.getScripts();if(l[1]?.state?.()||v){let b=l[1]?.state?.();const C=v?.searchFunction({type:"macro"});for(let k=0;C&&!b&&k<C?.length;k++)b=!0;b&&(y=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{}),a.jsx($u,{...f})]}))}return a.jsxs(Ia,{parentFloat:o,children:[g,null,g?a.jsx(Lt,{}):null,a.jsx(Mu,{...f,command:n.getCommand("paste")}),a.jsx(Re,{...p,command:n.getCommand("formatPainterToggle"),icon:ye(a.jsx(ub,{}))}),a.jsx(ec,{...p,command:n.getCommand("copy")}),a.jsx(Lt,{}),a.jsx(Bf,{...f,command:n.getCommand("formatFontFamily")}),a.jsx(Of,{...f,command:n.getCommand("formatFontSize")}),a.jsx(Re,{...p,command:n.getCommand("formatBoldToggle"),icon:a.jsx(ax,{})}),a.jsx(Re,{...p,command:n.getCommand("formatItalicToggle"),icon:a.jsx(lx,{})}),a.jsx(Vf,{...f}),a.jsx(Nf,{...f}),h,a.jsx(Lt,{}),m,a.jsx(Rf,{...f}),a.jsx(If,{...f}),a.jsx(Lt,{}),a.jsx(Fp,{...f}),a.jsx(zp,{...f}),a.jsx(Bp,{...f}),a.jsx(Np,{...f}),a.jsx(Lt,{}),a.jsx(Pf,{...f}),a.jsx(Uf,{command:n.getCommand("formatCellStyle"),...f}),a.jsx(Kf,{command:n.getCommand("formatTableStyle"),...f}),a.jsx(Lt,{}),a.jsx(Eu,{...f}),a.jsx(_u,{...f}),a.jsx(Lt,{}),a.jsx(Af,{...f}),null,a.jsx(ku,{...f}),a.jsx(Tu,{...f}),x,y]})},[n,l]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),z_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsxs(Ia,{parentFloat:o,children:[null,a.jsx(Re,{...c,command:n.getCommand("updateHyperlink"),icon:ye(a.jsx(Vd,{}))}),a.jsx(Re,{...c,command:n.getCommand("updateComments"),icon:ye(a.jsx(Hd,{}))}),a.jsx(Ru,{...u}),a.jsx(Re,{...c,command:n.getCommand("insertTable"),icon:ye(a.jsx(xa,{}))})]})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})})),B_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsxs(Ia,{parentFloat:o,children:[a.jsx(Df,{...u}),a.jsx(Re,{...c,command:n.getCommand("protectionSheetToggle"),icon:a.jsx(wn.Lock,{color:"secondary"})}),a.jsx(Lt,{}),a.jsx(Ff,{...u}),a.jsx(Hf,{...u}),a.jsx(Lt,{}),a.jsx(Re,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:a.jsx(el,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),a.jsx(Re,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:a.jsx(el,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),a.jsx(Lt,{}),a.jsx($f,{...u}),a.jsx(Qf,{command:n.getCommand("selectTheme"),...u}),a.jsx(Lt,{}),a.jsx($u,{...u,scope:"view"}),a.jsx(Lt,{}),a.jsx(Re,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ye(n.getCommand("fullScreenToggle").state()?a.jsx(Sb,{}):a.jsx(wb,{}))})]})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})})),bm=e=>a.jsx($_,{...e}),N_=s.memo(e=>{const{sx:t,...n}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${gt.alpha(o.palette.primary.main,.35)} solid 2px`}},children:[a.jsx(V.Tab,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),a.jsx(V.Box,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),V_=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,l=s.useMemo(()=>{const d=[];for(let c=0;c<t.length;c++)d.push(a.jsx(N_,{label:t[c].label},t[c].label));return d},[t]);return a.jsx(V.Tabs,{value:n,onChange:(d,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:d=>d.spacing(1.5),paddingRight:d=>d.spacing(1.5),paddingTop:d=>d.spacing(0),paddingBottom:d=>d.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:d=>d.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:a.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:l})}),H_=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,l=s.useCallback(c=>{o?.(c.target.value)},[o]),d=s.useMemo(()=>{const c=[];for(let u=0;u<t.length;u++){const p=t[u].label;c.push(a.jsx(V.MenuItem,{value:u,sx:{color:f=>{if(n===u)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return a.jsx(V.FormControl,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:a.jsx(V.Select,{value:n,onChange:l,variant:"outlined",sx:{backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},...i,children:d})})}),$_=s.memo(s.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:l,toolbarsProps:d,paletteProps:c={},workbook:u,sx:p,...f}=e,h=s.useMemo(()=>{const E=[];return E.push({label:"Home",component:a.jsx(F_,{commands:n,...d?.Home})}),E.push({label:"Insert",component:a.jsx(z_,{commands:n,...d?.Insert})}),E.push({label:"View",component:a.jsx(B_,{commands:n,...d?.View})}),E},[n]),m=s.useMemo(()=>{const E=[];for(let R=0;R<h.length;R++)E.push(s.cloneElement(h[R].component,{...h[R].component.props,key:h[R].key??h[R].label}));return E},[h]),[g,x]=s.useState(0),y=E=>{x(E)},v=s.useMemo(()=>i?a.jsx(H_,{toolbars:h,value:g,onToolbarChange:y,sx:r}):a.jsx(V_,{toolbars:h,value:g,onToolbarChange:y,sx:r}),[h,g,r,i]),{sx:b,...C}=c,k=a.jsx(V.Paper,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,marginLeft:E=>E.spacing(1),marginRight:E=>E.spacing(1),marginTop:E=>E.spacing(.5),marginBottom:E=>E.spacing(.5),...b},...C,children:m[g]});return a.jsxs(V.Box,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:E=>E.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,l?l(k):k]})})),W_=e=>a.jsx(zu,{...e}),U_=e=>a.jsx(Bu,{...e}),q_=e=>a.jsx(Fu,{...e}),Wu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:l=!1,readOnly:d=!1,contextMenuProps:c,renderContextMenu:u=W_,sheetsAllProps:p,renderSheetsAll:f=U_,sheetTabProps:h,renderSheetTab:m,background:g="transparent",className:x,notifier:y,sx:v,borderWidth:b,borderColor:C,gridTheme:k,gridStyle:E,...R}=e,[j,B]=s.useState(n?.getSelectedSheetIndex()),[T,_]=s.useState(n?.getSheets().search()),[w,S]=s.useState(n?.getProtection());Xt(n,{onViewChange(ie){B(ie?.getSelectedSheetIndex())},onSheetsChange:ie=>{_(ie.getSheets().search())},onProtectionChange:ie=>{S(ie?.getProtection())}});const O=s.useMemo(()=>{const ie=[];for(let ee=0;ee<T.length;ee++)ie.push(T[ee].getName());return ie},[T]),P=s.useCallback(ie=>{r?.(ie)!==!1&&(n.getSheetAt(ie).select(),i?.(ie))},[n,r,i]),M=s.useCallback((ie,ee)=>{n.getSheetAt(ie).setName(ee),i?.(ie)},[n,i]),A=s.useCallback((ie,ee)=>{n.getSheetAt(ie).setPosition(ee),i?.(ee)},[n,i]),D=ue(()=>{if(r?.(j)===!1)return;const ie=j+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ie)},[n,r,i,j]),L=s.useMemo(()=>({placement:"top-start"}),[]),N=s.useRef(null),[W,I]=s.useState(!1),U=s.useCallback(ie=>{const{closeFloatAll:ee,floatReference:pe}=ie;return f({workbook:n,gridStyle:E,floatReference:pe,closeFloatAll:ee,...p})},[f,p,l,n,E]),{reference:G,component:Q}=i0({label:"allSheet",popperProps:L,anchor:N.current,onOpen:()=>I(!0),onClose:()=>I(!1),createPopupPanel:U}),H=s.useRef(null),[$,F]=s.useState(null),X=s.useCallback(ie=>{const{floatReference:ee}=ie;return u?.({workbook:n,index:$?.index,tabStripRef:H.current,commands:o,disabled:l,floatReference:ee,...c})},[u,c,l,n,o,$]),{reference:K,component:ne}=i0({label:"sheetTab",popperProps:L,anchor:{getBoundingClientRect:()=>new DOMRect($?.left||0,$?.top||0,0,0)},onClose:()=>F(null),createPopupPanel:X});s.useEffect(()=>{$?K.open(0):K.close(0)},[$]);const J=s.useCallback((ie,ee)=>{ie.preventDefault(),F({left:ie.clientX-2,top:ie.clientY-4,index:ee})},[]),re=ue(ie=>{let ee;try{ee=n?.getSheetAt(ie.index)}catch{}return ee?(m??q_)({sheet:ee,gridTheme:k,onContextMenu:pe=>{P(ie.index),J(pe,ie.index)},...ie,...h}):null},[m,h,n,k]),fe=s.useMemo(()=>d||!w?.isStructureAllowed()?null:a.jsx(vr,{disableInteractive:!0,title:"New sheet",children:a.jsx(V.IconButton,{disabled:l,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ie=>ie.palette.primary.main},color:ie=>ie.palette.text.icon??ie.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ie=>{ie.button===0&&ie.preventDefault()},onClick:()=>D(),children:a.jsx(wn.AddCircleOutline,{})})}),[d,l,w,D]);return a.jsxs(V.Box,{ref:t,className:Qn(x),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...R,children:[a.jsx(kf,{ref:H,selectedTabIndex:j,tabNames:O,onSelectedTabIndexChange:P,onTabNameChange:M,onTabMove:A,background:g,borderColor:C,borderWidth:b,activeColor:null,disabled:l,disableDrag:d||!w.isStructureAllowed(),createScrollStartButton:lv,createScrollEndButton:av,createScrollEdgeButton:iv,createTabButton:re,createTabDivider:ie=>{const{key:ee,...pe}=ie;return a.jsx(Lt,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Te=>gt.alpha(Te.palette.divider,.25)},...pe},ee)},editLabelProps:{maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ie=>{n.isValidSheetNameCharacter(ie.key)||ie.preventDefault()},onCancel:()=>{i?.(j)},notifier:y},children:a.jsx(vr,{disableInteractive:!0,title:W?"":"List all sheets",children:a.jsx(xr,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:ie=>ie.palette.text.icon??ie.palette.action.active},ref:N,dense:!0,outlined:!1,selected:W,color:"primary","aria-label":"menu",onMouseDown:ie=>{ie.button===0&&ie.preventDefault()},onClick:()=>{W?G.close(0):G.open(0)},icon:a.jsx(wn.Menu,{})})})}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,minWidth:"4px"}}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:fe}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:1,minWidth:"24px"}}),ne,Q]})}));Wu.displayName="WorkbookStrip";const Uu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:l,className:d,...c}=e,[u,p]=s.useReducer(S=>S+1,0),[f,h]=s.useState(n.getSelectedSheet()),[m,g]=s.useState(f.getSelectedRanges()),[x,y]=s.useState(f.getSelectedCell());Xt(n,{onSheetsChange(){h(n.getSelectedSheet())}}),Xt(f.getSelection(),{onChange(){g(f.getSelectedRanges()),y(f.getSelectedCell())}}),ro(o,[],{onChange:()=>{p()}});const v=s.useMemo(()=>({}),[]),b=s.useMemo(()=>({commandHook:{beforeExecute:(S,O)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:l}),[r,l]),C=s.useMemo(()=>({...v,...b,variant:$t.Menuitem}),[v,b]),k=s.useMemo(()=>({commands:o,variant:$t.Menuitem,parentFloat:l,...b}),[o,b,l]),E=[];let R=m.isEntireRows(),j=m.isEntireColumns();m&&(R&&(E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(Re,{command:o.getCommand("hideColumns"),...C,icon:ye(a.jsx(rb,{})),key:"context:"+E.length})),E.push(s.createElement(Re,{command:o.getCommand("unhideColumns"),...C,icon:ye(a.jsx(ob,{})),key:"context:"+E.length}))),j&&(E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(Re,{command:o.getCommand("hideRows"),...C,icon:ye(a.jsx(lb,{})),key:"context:"+E.length})),E.push(s.createElement(Re,{command:o.getCommand("unhideRows"),...C,icon:ye(a.jsx(ib,{})),key:"context:"+E.length}))),(R||j)&&E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),R&&E.push(s.createElement(Re,{command:o.getCommand("autoFitColumns"),...C,icon:ye(a.jsx(Ab,{})),key:"context:"+E.length})),j&&E.push(s.createElement(Re,{command:o.getCommand("autoFitRows"),...C,icon:ye(a.jsx(Fb,{})),key:"context:"+E.length})));const B=[],T=o.getCommand("formatTableStyle"),_=T?.context()?.table();if(V0(T),!R&&!j){if(B.push(a.jsx(Lt,{orientation:"horizontal"},"contextBefore:"+B.length)),x?.getHyperlink())B.push(s.createElement(o0,{...k,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+B.length,quickCommand:"openHyperlink",icon:S=>S.key()==="openHyperlink"?ye(a.jsx(Vd,{})):null}));else{const S=o.getCommand("updateHyperlink");B.push(s.createElement(Re,{command:S,...C,icon:ye(a.jsx(Vd,{})),key:"contextBefore:"+B.length}))}if(x?.getComments())B.push(s.createElement(o0,{...k,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+B.length,quickCommand:"updateComments",icon:S=>S.key()==="updateComments"?ye(a.jsx(Hd,{})):null}));else{const S=o.getCommand("updateComments");B.push(s.createElement(Re,{command:S,...C,icon:ye(a.jsx(Hd,{})),key:"contextBefore:"+B.length}))}_?B.push(s.createElement(o0,{...k,variant:$t.Menuitem,key:"contextBefore:"+B.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:_,quickCommand:"editTable",icon:S=>(S.key(),ye(a.jsx(xa,{})))})):B.push(s.createElement(Re,{command:o.getCommand("insertTable"),...C,icon:ye(a.jsx(xa,{})),key:"context:"+E.length})),B.push(s.createElement(Ru,{...k,key:"contextBefore:"+B.length}))}const w=a.jsxs(a.Fragment,{children:[a.jsx(Re,{command:o.getCommand("cut"),...C,icon:a.jsx(my,{})}),a.jsx(ec,{command:o.getCommand("copy"),...C}),a.jsx(Mu,{command:o.getCommand("paste"),...k,includePasteAllInPopup:!1}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Tu,{...k}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Eu,{commands:o,...k,disableSheet:!0}),a.jsx(_u,{commands:o,...k,disableSheet:!0}),a.jsx(ku,{...k}),B,E]});return a.jsx(V.Box,{ref:t,className:Qn("menu",d),sx:{...i},...c,children:w})}));var m8,g8;Uu.displayName="WorkbookContextMenu",function(){if(g8)return m8;g8=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof Li=="object"&&Li&&Li.Object===Object&&Li,l=typeof self=="object"&&self&&self.Object===Object&&self,d=i||l||Function("return this")(),c=Object.prototype.toString,u=Math.max,p=Math.min,f=function(){return d.Date.now()};function h(g){var x=typeof g;return!!g&&(x=="object"||x=="function")}function m(g){if(typeof g=="number")return g;if(function(v){return typeof v=="symbol"||function(b){return!!b&&typeof b=="object"}(v)&&c.call(v)=="[object Symbol]"}(g))return NaN;if(h(g)){var x=typeof g.valueOf=="function"?g.valueOf():g;g=h(x)?x+"":x}if(typeof g!="string")return g===0?g:+g;g=g.replace(e,"");var y=n.test(g);return y||o.test(g)?r(g.slice(2),y?2:8):t.test(g)?NaN:+g}m8=function(g,x,y){var v,b,C,k,E,R,j=0,B=!1,T=!1,_=!0;if(typeof g!="function")throw new TypeError("Expected a function");function w(A){var D=v,L=b;return v=b=void 0,j=A,k=g.apply(L,D)}function S(A){var D=A-R;return R===void 0||D>=x||D<0||T&&A-j>=C}function O(){var A=f();if(S(A))return P(A);E=setTimeout(O,function(D){var L=x-(D-R);return T?p(L,C-(D-j)):L}(A))}function P(A){return E=void 0,_&&v?w(A):(v=b=void 0,k)}function M(){var A=f(),D=S(A);if(v=arguments,b=this,R=A,D){if(E===void 0)return function(L){return j=L,E=setTimeout(O,x),B?w(L):k}(R);if(T)return E=setTimeout(O,x),w(R)}return E===void 0&&(E=setTimeout(O,x)),k}return x=m(x)||0,h(y)&&(B=!!y.leading,C=(T="maxWait"in y)?u(m(y.maxWait)||0,x):C,_="trailing"in y?!!y.trailing:_),M.cancel=function(){E!==void 0&&clearTimeout(E),j=0,v=R=b=E=void 0},M.flush=function(){return E===void 0?k:P(f())},M}}();var x8,y8,b8={exports:{}},pd={};y8||(y8=1,b8.exports=function(){if(x8)return pd;x8=1;var e=s,t=typeof Object.is=="function"?Object.is:function(c,u){return c===u&&(c!==0||1/c==1/u)||c!=c&&u!=u},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function l(c){var u=c.getSnapshot;c=c.value;try{var p=u();return!t(c,p)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,u){return u()}:function(c,u){var p=u(),f=n({inst:{value:p,getSnapshot:u}}),h=f[0].inst,m=f[1];return r(function(){h.value=p,h.getSnapshot=u,l(h)&&m({inst:h})},[c,p,u]),o(function(){return l(h)&&m({inst:h}),c(function(){l(h)&&m({inst:h})})},[c]),i(p),p};return pd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,pd}()),b8.exports;var v8,w8,Nl={exports:{}},ji={exports:{}},Z_=ji.exports;(function(){if(w8)return Nl.exports;w8=1;for(var e=(v8||(v8=1,function(){var f,h,m,g,x,y;typeof performance<"u"&&performance!==null&&performance.now?ji.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ji.exports=function(){return(f()-x)/1e6},h=process.hrtime,f=function(){var v;return 1e9*(v=h())[0]+v[1]},g=f(),y=1e9*process.uptime(),x=g-y):Date.now?(ji.exports=function(){return Date.now()-m},m=Date.now()):(ji.exports=function(){return new Date().getTime()-m},m=new Date().getTime())}.call(Z_)),ji.exports),t=typeof window>"u"?Li:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],l=0;!r&&l<n.length;l++)r=t[n[l]+"Request"+o],i=t[n[l]+"Cancel"+o]||t[n[l]+"CancelRequest"+o];if(!r||!i){var d=0,c=0,u=[],p=1e3/60;r=function(f){if(u.length===0){var h=e(),m=Math.max(0,p-(h-d));d=m+h,setTimeout(function(){var g=u.slice(0);u.length=0;for(var x=0;x<g.length;x++)if(!g[x].cancelled)try{g[x].callback(d)}catch(y){setTimeout(function(){throw y},0)}},Math.round(m))}return u.push({handle:++c,callback:f,cancelled:!1}),c},i=function(f){for(var h=0;h<u.length;h++)u[h].handle===f&&(u[h].cancelled=!0)}}Nl.exports=function(f){return r.call(t,f)},Nl.exports.cancel=function(){i.apply(t,arguments)},Nl.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i},Nl.exports})();var Qr={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const vm=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:l,onShowSidebar:d,onNewWorkbook:c=wm}=e,[u,p]=s.useState(t?.getSelectedSheet()),[f,h]=s.useState(t?.getSheets().search()),m=ue(d,[d]),g=ue(c,[c]),x=s.useMemo(()=>[new vt("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[ke.Ctrl,ke.Shift]}}),new je("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new je("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new je("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new vt("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[ke.Ctrl]},{key:"F5",modifiers:[ke.Shift]}]}),new vt("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[ke.Ctrl]},{key:"H",modifiers:[ke.Ctrl,ke.Alt]}]}),new vt("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[ke.Ctrl]}]}),new vt("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new vt("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new vt("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new vt("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new vt("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new je("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new je("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new je("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[ke.Shift]},{key:"F1",modifiers:[ke.Alt,ke.Shift]}]}),new je("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new je("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[ke.Ctrl]}]}),new je("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[ke.Ctrl]}]}),new je("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[ke.Ctrl,ke.Shift]}]}),new je("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[ke.Ctrl,ke.Shift]}]}),new je("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new je("selectNamed",r,{label:S=>S?.getName()??"Select Named Item",scopedLabels:{namedItem:S=>S?.getName()??"Select"},description:"Select the item."}),new je("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new je("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new je("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new vt("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[ke.Alt]}}),new vt("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
|
|
85
|
+
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&l(c.body,"react-draggable-transparent-selection")},xo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},xo.createSVGTransform=function(c,u){return r(c,u,"")},xo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},xo.getTouchIdentifier=function(c){if(c.targetTouches&&c.targetTouches[0])return c.targetTouches[0].identifier;if(c.changedTouches&&c.changedTouches[0])return c.changedTouches[0].identifier},xo.getTranslation=r,xo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},xo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},xo.matchesSelector=o,xo.matchesSelectorAndParentsTo=function(c,u,p){let f=c;do{if(o(f,u))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},xo.offsetXYFromParent=function(c,u,p){const f=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect(),h=(c.clientX+u.scrollLeft-f.left)/p,m=(c.clientY+u.scrollTop-f.top)/p;return{x:h,y:m}},xo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},xo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},xo.removeClassName=d,xo.removeEvent=function(c,u,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},xo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=tc(),t=function(c,u){if(typeof WeakMap=="function")var p=new WeakMap,f=new WeakMap;return function(h,m){if(!m&&h&&h.__esModule)return h;var g,x,y={__proto__:null,default:h};if(h===null||typeof h!="object"&&typeof h!="function")return y;if(g=m?f:p){if(g.has(h))return g.get(h);g.set(h,y)}for(const v in h)v!=="default"&&{}.hasOwnProperty.call(h,v)&&((x=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(h,v))&&(x.get||x.set)?g(y,v,x):y[v]=h[v]);return y}(c,u)}(function(){if(Z7)return _0;Z7=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.browserPrefixToKey=p,_0.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},_0.default=void 0,_0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let m=0;m<c.length;m++)if(p(f,c[m])in h)return c[m];return""}function p(f,h){return h?`${h}${function(m){let g="",x=!0;for(let y=0;y<m.length;y++)x?(g+=m[y].toUpperCase(),x=!1):m[y]==="-"?x=!0:g+=m[y];return g}(f)}`:f}return _0.default=u(),_0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:f,y:h}=c,m=`translate(${f}${p},${h}${p})`;return u&&(m=`translate(${`${typeof u.x=="string"?u.x:u.x+p}`}, ${`${typeof u.y=="string"?u.y:u.y+p}`})`+m),m}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function l(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return xo}var K7,Jr={};function rm(){if(K7)return Jr;K7=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Jr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Jr.createCoreData=function(o,r,i){const l=!(0,e.isNum)(o.lastX),d=n(o);return l?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Jr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Jr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:l}=o.props;l=typeof l=="string"?l:function(c){return{left:c.left,top:c.top,right:c.right,bottom:c.bottom}}(l);const d=n(o);if(typeof l=="string"){const{ownerDocument:c}=d,u=c.defaultView;let p;if(l==="parent"?p=d.parentNode:p=d.getRootNode().querySelector(l),!(p instanceof u.HTMLElement))throw new Error('Bounds selector "'+l+'" could not find an element.');const f=p,h=u.getComputedStyle(d),m=u.getComputedStyle(f);l={left:-d.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(h.marginLeft),top:-d.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(h.marginTop),right:(0,t.innerWidth)(f)-(0,t.outerWidth)(d)-d.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(h.marginRight),bottom:(0,t.innerHeight)(f)-(0,t.outerHeight)(d)-d.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(h.marginBottom)}}return(0,e.isNum)(l.right)&&(r=Math.min(r,l.right)),(0,e.isNum)(l.bottom)&&(i=Math.min(i,l.bottom)),(0,e.isNum)(l.left)&&(r=Math.max(r,l.left)),(0,e.isNum)(l.top)&&(i=Math.max(i,l.top)),[r,i]},Jr.getControlPosition=function(o,r,i){const l=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!l)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(l||o,c,i.props.scale)},Jr.snapToGrid=function(o,r,i){const l=Math.round(r/o[0])*o[0],d=Math.round(i/o[1])*o[1];return[l,d]};var e=tc(),t=Lu();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Jr}var X7,Y7,J7,Q7,Fl={},Ms={};function im(){return X7||(X7=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.default=function(){}),Ms}function S_(){if(Y7)return Fl;Y7=1,Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.default=void 0;var e=function(m,g){if(typeof WeakMap=="function")var x=new WeakMap,y=new WeakMap;return function(v,b){if(!b&&v&&v.__esModule)return v;var C,k,E={__proto__:null,default:v};if(v===null||typeof v!="object"&&typeof v!="function")return E;if(C=b?y:x){if(C.has(v))return C.get(v);C.set(v,E)}for(const R in v)R!=="default"&&{}.hasOwnProperty.call(v,R)&&((k=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(v,R))&&(k.get||k.set)?C(E,R,k):E[R]=v[R]);return E}(m,g)}(s),t=d(za()),n=d(wo),o=Lu(),r=rm(),i=tc(),l=d(im());function d(m){return m&&m.__esModule?m:{default:m}}function c(m,g,x){return(g=function(y){var v=function(b,C){if(typeof b!="object"||!b)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof v=="symbol"?v:v+""}(g))in m?Object.defineProperty(m,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[g]=x,m}const u={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let f=p,h=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",m=>{if(this.props.onMouseDown(m),!this.props.allowAnyClick&&typeof m.button=="number"&&m.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:x}=g;if(this.props.disabled||!(m.target instanceof x.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(m.target,this.props.handle,g)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(m.target,this.props.cancel,g))return;m.type!=="touchstart"||this.props.allowMobileScroll||m.preventDefault();const y=(0,o.getTouchIdentifier)(m);this.touchIdentifier=y;const v=(0,r.getControlPosition)(m,y,this);if(v==null)return;const{x:b,y:C}=v,k=(0,r.createCoreData)(this,b,C);(0,l.default)("DraggableCore: handleDragStart: %j",k),(0,l.default)("calling",this.props.onStart),this.props.onStart(m,k)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(x),this.dragging=!0,this.lastX=b,this.lastY=C,(0,o.addEvent)(x,f.move,this.handleDrag),(0,o.addEvent)(x,f.stop,this.handleDragStop))}),c(this,"handleDrag",m=>{const g=(0,r.getControlPosition)(m,this.touchIdentifier,this);if(g==null)return;let{x,y}=g;if(Array.isArray(this.props.grid)){let b=x-this.lastX,C=y-this.lastY;if([b,C]=(0,r.snapToGrid)(this.props.grid,b,C),!b&&!C)return;x=this.lastX+b,y=this.lastY+C}const v=(0,r.createCoreData)(this,x,y);if((0,l.default)("DraggableCore: handleDrag: %j",v),this.props.onDrag(m,v)!==!1&&this.mounted!==!1)this.lastX=x,this.lastY=y;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}}),c(this,"handleDragStop",m=>{if(!this.dragging)return;const g=(0,r.getControlPosition)(m,this.touchIdentifier,this);if(g==null)return;let{x,y}=g;if(Array.isArray(this.props.grid)){let C=x-this.lastX||0,k=y-this.lastY||0;[C,k]=(0,r.snapToGrid)(this.props.grid,C,k),x=this.lastX+C,y=this.lastY+k}const v=(0,r.createCoreData)(this,x,y);if(this.props.onStop(m,v)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(b.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",v),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,l.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(b.ownerDocument,f.move,this.handleDrag),(0,o.removeEvent)(b.ownerDocument,f.stop,this.handleDragStop))}),c(this,"onMouseDown",m=>(f=p,this.handleDragStart(m))),c(this,"onMouseUp",m=>(f=p,this.handleDragStop(m))),c(this,"onTouchStart",m=>(f=u,this.handleDragStart(m))),c(this,"onTouchEnd",m=>(f=u,this.handleDragStop(m)))}componentDidMount(){this.mounted=!0;const m=this.findDOMNode();m&&(0,o.addEvent)(m,u.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const m=this.findDOMNode();if(m){const{ownerDocument:g}=m;(0,o.removeEvent)(g,p.move,this.handleDrag),(0,o.removeEvent)(g,u.move,this.handleDrag),(0,o.removeEvent)(g,p.stop,this.handleDragStop),(0,o.removeEvent)(g,u.stop,this.handleDragStop),(0,o.removeEvent)(m,u.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(g)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Fl.default=h,c(h,"displayName","DraggableCore"),c(h,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(m,g){if(m[g]&&m[g].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),c(h,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Fl}function C_(){return J7||(J7=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(g,x){if(typeof WeakMap=="function")var y=new WeakMap,v=new WeakMap;return function(b,C){if(!C&&b&&b.__esModule)return b;var k,E,R={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return R;if(k=C?v:y){if(k.has(b))return k.get(b);k.set(b,R)}for(const j in b)j!=="default"&&{}.hasOwnProperty.call(b,j)&&((E=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,j))&&(E.get||E.set)?k(R,j,E):R[j]=b[j]);return R}(g,x)}(s),n=p(za()),o=p(wo),r=function(){if(W7)return js.exports;function g(y){var v,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(v=0;v<k;v++)y[v]&&(b=g(y[v]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,v,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(v=g(y))&&(C&&(C+=" "),C+=v);return C}return W7=1,js.exports=x,js.exports.clsx=x,js.exports}(),i=Lu(),l=rm(),d=tc(),c=p(S_()),u=p(im());function p(g){return g&&g.__esModule?g:{default:g}}function f(){return f=Object.assign?Object.assign.bind():function(g){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var v in y)({}).hasOwnProperty.call(y,v)&&(g[v]=y[v])}return g},f.apply(null,arguments)}function h(g,x,y){return(x=function(v){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var R=E.call(C,k);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(C)}(v,"string");return typeof b=="symbol"?b:b+""}(x))in g?Object.defineProperty(g,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[x]=y,g}class m extends t.Component{static getDerivedStateFromProps(x,y){let{position:v}=x,{prevPropsPosition:b}=y;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(x){super(x),h(this,"onDragStart",(y,v)=>{if((0,u.default)("Draggable: onDragStart: %j",v),this.props.onStart(y,(0,l.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,v)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",v);const b=(0,l.createDraggableData)(this,v),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[R,j]=(0,l.getBoundPosition)(this,C.x,C.y);C.x=R,C.y=j,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,v)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,v))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:v,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:R,positionOffset:j,scale:B,...T}=this.props;let _={},w=null;const S=!R||this.state.dragging,O=R||b,P={x:(0,l.canDragX)(this)&&S?this.state.x:O.x,y:(0,l.canDragY)(this)&&S?this.state.y:O.y};this.state.isElementSVG?w=(0,i.createSVGTransform)(P,j):_=(0,i.createCSSTransform)(P,j);const M=(0,r.clsx)(v.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:M,style:{...v.props.style,..._},transform:w}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(m,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(U7)),U7}function lm(){if(Q7)return Al.exports;Q7=1;const{default:e,DraggableCore:t}=C_();return Al.exports=e,Al.exports.default=e,Al.exports.DraggableCore=t,Al.exports}var e8,Rs={};function k_(){if(e8)return Rs;e8=1,Rs.__esModule=!0,Rs.cloneElement=function(i,l){return l.style&&i.props.style&&(l.style=o(o({},i.props.style),l.style)),l.className&&i.props.className&&(l.className=i.props.className+" "+l.className),t.default.cloneElement(i,l)};var e,t=(e=s)&&e.__esModule?e:{default:e};function n(i,l){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);l&&(c=c.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),d.push.apply(d,c)}return d}function o(i){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?n(Object(d),!0).forEach(function(c){r(i,c,d[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(d,c))})}return i}function r(i,l,d){return(l=function(c){var u=function(p,f){if(typeof p!="object"||p===null)return p;var h=p[Symbol.toPrimitive];if(h!==void 0){var m=h.call(p,f);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(p)}(c,"string");return typeof u=="symbol"?u:String(u)}(l))in i?Object.defineProperty(i,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[l]=d,i}return Rs}var t8,n8,zl={};function am(){if(t8)return zl;t8=1,zl.__esModule=!0,zl.resizableProps=void 0;var e,t=(e=za())&&e.__esModule?e:{default:e};lm();var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var l,d=r[0];return d.axis==="both"||d.axis==="y"?(l=t.default.number).isRequired.apply(l,r):t.default.number.apply(t.default,r)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var l,d=r[0];return d.axis==="both"||d.axis==="x"?(l=t.default.number).isRequired.apply(l,r):t.default.number.apply(t.default,r)}};return zl.resizableProps=n,zl}function sm(){if(n8)return Pl;n8=1,Pl.__esModule=!0,Pl.default=void 0;var e=function(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=i(m);if(g&&g.has(h))return g.get(h);var x={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var b=y?Object.getOwnPropertyDescriptor(h,v):null;b&&(b.get||b.set)?Object.defineProperty(x,v,b):x[v]=h[v]}return x.default=h,g&&g.set(h,x),x}(s),t=lm(),n=k_(),o=am(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(i=function(x){return x?g:m})(h)}function l(){return l=Object.assign?Object.assign.bind():function(h){for(var m=1;m<arguments.length;m++){var g=arguments[m];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&(h[x]=g[x])}return h},l.apply(this,arguments)}function d(h,m){var g=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);m&&(x=x.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),g.push.apply(g,x)}return g}function c(h){for(var m=1;m<arguments.length;m++){var g=arguments[m]!=null?arguments[m]:{};m%2?d(Object(g),!0).forEach(function(x){u(h,x,g[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(g)):d(Object(g)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(g,x))})}return h}function u(h,m,g){return(m=function(x){var y=function(v,b){if(typeof v!="object"||v===null)return v;var C=v[Symbol.toPrimitive];if(C!==void 0){var k=C.call(v,b);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(v)}(x,"string");return typeof y=="symbol"?y:String(y)}(m))in h?Object.defineProperty(h,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):h[m]=g,h}function p(h,m){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,x){return g.__proto__=x,g},p(h,m)}var f=function(h){var m,g;function x(){for(var v,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(v=h.call.apply(h,[this].concat(C))||this).handleRefs={},v.lastHandleRect=null,v.slack=null,v}g=h,(m=x).prototype=Object.create(g.prototype),m.prototype.constructor=m,p(m,g);var y=x.prototype;return y.componentWillUnmount=function(){this.resetData()},y.resetData=function(){this.lastHandleRect=this.slack=null},y.runConstraints=function(v,b){var C=this.props,k=C.minConstraints,E=C.maxConstraints,R=C.lockAspectRatio;if(!k&&!E&&!R)return[v,b];if(R){var j=this.props.width/this.props.height,B=v-this.props.width,T=b-this.props.height;Math.abs(B)>Math.abs(T*j)?b=v/j:v=b*j}var _=v,w=b,S=this.slack||[0,0],O=S[0],P=S[1];return v+=O,b+=P,k&&(v=Math.max(k[0],v),b=Math.max(k[1],b)),E&&(v=Math.min(E[0],v),b=Math.min(E[1],b)),this.slack=[O+(_-v),P+(w-b)],[v,b]},y.resizeHandler=function(v,b){var C=this;return function(k,E){var R=E.node,j=E.deltaX,B=E.deltaY;v==="onResizeStart"&&C.resetData();var T=(C.props.axis==="both"||C.props.axis==="x")&&b!=="n"&&b!=="s",_=(C.props.axis==="both"||C.props.axis==="y")&&b!=="e"&&b!=="w";if(T||_){var w=b[0],S=b[b.length-1],O=R.getBoundingClientRect();C.lastHandleRect!=null&&(S==="w"&&(j+=O.left-C.lastHandleRect.left),w==="n"&&(B+=O.top-C.lastHandleRect.top)),C.lastHandleRect=O,S==="w"&&(j=-j),w==="n"&&(B=-B);var P=C.props.width+(T?j/C.props.transformScale:0),M=C.props.height+(_?B/C.props.transformScale:0),A=C.runConstraints(P,M);P=A[0],M=A[1];var D=P!==C.props.width||M!==C.props.height,L=typeof C.props[v]=="function"?C.props[v]:null;L&&!(v==="onResize"&&!D)&&(k.persist==null||k.persist(),L(k,{node:R,size:{width:P,height:M},handle:b})),v==="onResizeStop"&&C.resetData()}}},y.renderResizeHandle=function(v,b){var C=this.props.handle;if(!C)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+v,ref:b});if(typeof C=="function")return C(v,b);var k=c({ref:b},typeof C.type=="string"?{}:{handleAxis:v});return e.cloneElement(C,k)},y.render=function(){var v=this,b=this.props,C=b.children,k=b.className,E=b.draggableOpts;b.width,b.height,b.handle,b.handleSize,b.lockAspectRatio,b.axis,b.minConstraints,b.maxConstraints,b.onResize,b.onResizeStop,b.onResizeStart;var R=b.resizeHandles;b.transformScale;var j=function(B,T){if(B==null)return{};var _,w,S={},O=Object.keys(B);for(w=0;w<O.length;w++)_=O[w],T.indexOf(_)>=0||(S[_]=B[_]);return S}(b,r);return(0,n.cloneElement)(C,c(c({},j),{},{className:(k?k+" ":"")+"react-resizable",children:[].concat(C.props.children,R.map(function(B){var T,_=(T=v.handleRefs[B])!=null?T:v.handleRefs[B]=e.createRef();return e.createElement(t.DraggableCore,l({},E,{nodeRef:_,key:"resizableHandle-"+B,onStop:v.resizeHandler("onResizeStop",B),onStart:v.resizeHandler("onResizeStart",B),onDrag:v.resizeHandler("onResize",B)}),v.renderResizeHandle(B,_))}))}))},x}(e.Component);return Pl.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Pl}var o8,r8,Bl={};function E_(){if(o8)return Bl;o8=1,Bl.__esModule=!0,Bl.default=void 0;var e=function(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var x=l(g);if(x&&x.has(m))return x.get(m);var y={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in m)if(b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)){var C=v?Object.getOwnPropertyDescriptor(m,b):null;C&&(C.get||C.set)?Object.defineProperty(y,b,C):y[b]=m[b]}return y.default=m,x&&x.set(m,y),y}(s),t=i(za()),n=i(sm()),o=am(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(m){return m&&m.__esModule?m:{default:m}}function l(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,x=new WeakMap;return(l=function(y){return y?x:g})(m)}function d(){return d=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var x=arguments[g];for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(m[y]=x[y])}return m},d.apply(this,arguments)}function c(m,g){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(m);g&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(m,v).enumerable})),x.push.apply(x,y)}return x}function u(m){for(var g=1;g<arguments.length;g++){var x=arguments[g]!=null?arguments[g]:{};g%2?c(Object(x),!0).forEach(function(y){p(m,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(x)):c(Object(x)).forEach(function(y){Object.defineProperty(m,y,Object.getOwnPropertyDescriptor(x,y))})}return m}function p(m,g,x){return(g=function(y){var v=function(b,C){if(typeof b!="object"||b===null)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof v=="symbol"?v:String(v)}(g))in m?Object.defineProperty(m,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[g]=x,m}function f(m,g){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,y){return x.__proto__=y,x},f(m,g)}var h=function(m){var g,x;function y(){for(var v,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(v=m.call.apply(m,[this].concat(C))||this).state={width:v.props.width,height:v.props.height,propsWidth:v.props.width,propsHeight:v.props.height},v.onResize=function(E,R){var j=R.size;v.props.onResize?(E.persist==null||E.persist(),v.setState(j,function(){return v.props.onResize&&v.props.onResize(E,R)})):v.setState(j)},v}return x=m,(g=y).prototype=Object.create(x.prototype),g.prototype.constructor=g,f(g,x),y.getDerivedStateFromProps=function(v,b){return b.propsWidth!==v.width||b.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null},y.prototype.render=function(){var v=this.props,b=v.handle,C=v.handleSize;v.onResize;var k=v.onResizeStart,E=v.onResizeStop,R=v.draggableOpts,j=v.minConstraints,B=v.maxConstraints,T=v.lockAspectRatio,_=v.axis;v.width,v.height;var w=v.resizeHandles,S=v.style,O=v.transformScale,P=function(M,A){if(M==null)return{};var D,L,N={},W=Object.keys(M);for(L=0;L<W.length;L++)D=W[L],A.indexOf(D)>=0||(N[D]=M[D]);return N}(v,r);return e.createElement(n.default,{axis:_,draggableOpts:R,handle:b,handleSize:C,height:this.state.height,lockAspectRatio:T,maxConstraints:B,minConstraints:j,onResizeStart:k,onResize:this.onResize,onResizeStop:E,resizeHandles:w,transformScale:O,width:this.state.width},e.createElement("div",d({},P,{style:u(u({},S),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},y}(e.Component);return Bl.default=h,h.propTypes=u(u({},o.resizableProps),{},{children:t.default.element}),Bl}var __=(r8||(r8=1,Ts.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ts.exports.Resizable=sm().default,Ts.exports.ResizableBox=E_().default),Ts.exports);function sd(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var nc=parseInt(s.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=sd(o,t),i=typeof r=="function";n.push(i?r:()=>sd(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)sd(n,t)}};const Ou=s.memo(s.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,disabled:l=!1,commandPopupButtonProps:d,sx:c,notifier:u,...p}=e,[f,h]=s.useState(null),[m,g]=s.useState(()=>r.getSelectedRanges().getCoords()),[x,y]=s.useState(!1),{reference:v}=i0({parentFloat:d?.parentFloat}),b=()=>f?.text??"",[C,k]=s.useState(b),E=ue(()=>{if(v?.closeAll(),!C){const U=b();return k(b()),U}if(b()===C)return C;const N=C.trim().toLowerCase();if(N==="r"||N==="c")return C;try{const U=r.getRanges(C);if(U)return U.toString()}catch{}const W=o.getByName(C);if(W&&W.getRanges())return C;let I=null;try{const U=r.getRanges(C),G=U.getCoords().map(Q=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...Q}));I=r.getRanges(G)}catch{}if(!I){const U=r.getSelectedRanges().getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));I=r.getRanges(U)}try{let U=o.getByName(C);U||(U=o.addReference(C,I)),h({text:U.getName()})}catch(U){k(b()),u.showMessage?.(U.message,{type:r0.Error})}return null},[C,o,v]),R=ue(()=>{if(r.isClosed())return;const N=[];for(let U=0;U<m.length;U++){const G=m[U];N.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G})}let W=null;try{W=o.lookupByRanges(N)}catch{}let I=null;I=W?.length>0?W[0].getName():r.getSelectedSheet().getSelectedRange().toString(),h({text:I})},[r,m]),[j,B]=s.useState(()=>o?.search()??null);Xt(o,{onCollectionChange(N){B(o.search()),R()},onClose(N){B([])}}),s.useEffect(()=>{k(b())},[f,m]);const[T,_]=s.useState(r?.getSelectedSheet());Xt(r,{onSheetsChange:N=>{_(N?.getSelectedSheet())},onViewChange(N){_(N?.getSelectedSheet())}});const[w,S]=s.useState(null),O=ue(z.CommonUtils.debounce(R,w?320:0),[]);Xt(T.getSelection(),{onChange:()=>{g(N=>{const W=r.getSelectedRanges().getCoords();return z.CoordUtils.isEqualRangesArrays(W,N)?N:W})},onAdjustingChange:N=>{S(N.getAdjusting())}}),s.useEffect(()=>{if(w){const N=r.getSelectedRange(),W=N.getRowCount(),I=N.getColumnCount();let U=`${W}R x ${I}C`;if(U.length>17&&(U=`${W}x${I}`),W>1||I>1)return void h({text:U,fontStyle:"italic",justifyContent:"center"})}h({text:r.getSelectedSheet().getSelectedRange().toString()}),O()},[m,r,w]);const P=s.useRef(null),M=s.useCallback(N=>{const{onMouseDown:W,onMouseUp:I,...U}=N;return a.jsx(V.IconButton,{...U,sx:{...U?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:a.jsx(V.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:P},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.text.icon??G.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},"::after":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*z.IFont.getDeviceScale(),fontStyle:f?.fontStyle,paddingLeft:G=>G.spacing(.75),paddingRight:G=>G.spacing(.75),boxShadow:"none",flex:"1",color:G=>G.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary}}},value:C,onFocus:G=>{G.target?.select()},onKeyDown:G=>{if(G.which===Zt.Enter||G.which===Zt.Tab){let Q=C;b()!==C&&(G.stopPropagation(),G.preventDefault(),Q=E()),Q?A(Q):i?.()}else if(G.which===Zt.Escape)b()!==C?(k(b()),setTimeout(()=>{G.target?.select()},0),G.stopPropagation(),G.preventDefault()):i?.();else if(G.which===Zt.Space)return void G.stopPropagation()},onBlur:()=>{k(b())},onChange:G=>{k(G.target.value)}})})},[C,f]),A=ue(async N=>{try{v?.closeAll();const W=o.lookupByRanges(N)?.[0];W&&await W?.select(),await r.getRanges(N)?.select()}catch(W){u.showMessage?.(W.message,{type:r0.Error})}},[o,u,r]),D=s.useCallback(N=>{setTimeout(()=>{y(!0)},0);const W={variant:$t.Menuitem,parentFloat:N.floatReference,commandHook:{...d?.commandHook,beforeExecute:(Q,H)=>(v?.closeAll(),d?.commandHook?.beforeExecute?.(Q,H))},scope:d?.scope,commands:d?.commands};let I=o.search({scope:r?.getSelectedSheet().getName()});I=I.sort((Q,H)=>Q.getType()===H.getType()?Q.getName().localeCompare(H.getName()):Q.getType()==="range"?-1:1);const U=[];for(let Q=0;Q<I.length;Q++){const H=I[Q],$=H.getRanges();if(!$||H.isHidden())continue;const F=H.getType();F!==I[Q-1]?.getType()&&(Q>0&&U.push(a.jsx(Lt,{orientation:"horizontal"},`type-divider-${U.length}`)),U.push(a.jsx(Ji,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:H.getType()==="reference"?"Ranges":"Tables"},`type-header-${U.length}`))),F==="reference"?U.push(s.createElement(o0,{...W,key:"named-"+U.length,popupCommandKeys:["editNamedReference","deleteNamedReference"],popupScope:"namedItem",scope:"namedItem",commandState:H,commands:d?.commands,label:H.getName(),quickCommand:"selectNamed",disabled:!H.getRanges()||l,icon:X=>{switch(X.key()){case"editNamedReference":return ye(a.jsx(Ob,{}));case"deleteNamedReference":return ye(a.jsx(Pb,{}));default:return ye(a.jsx(Db,{}))}}})):F==="table"&&U.push(s.createElement(o0,{...W,key:"namedItem-"+U.length,popupCommandKeys:["editTable",null,"convertTableToRange","deleteTable"],popupScope:"namedItem",scope:"namedItem",commands:d?.commands,commandState:H,label:H.getName(),quickCommand:"selectNamed",disabled:!$||l,icon:X=>(X.key(),ye(a.jsx(xa,{})))}))}const G=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[a.jsx(Re,{...W,scope:"namedItem",command:d?.commands.getCommand("addNamedReference"),icon:ye(a.jsx(Lb,{}))}),U&&U.length>0?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{orientation:"horizontal"}),a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:U})]}):null]});return _n({...N,children:G})},[r,j,o,f]),L=Ro(t,()=>({focus(N){P.current?.focus(N)}}),[]);return a.jsx(V.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:nc([L,t]),...p,children:a.jsx(Ur,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...c},buttonProps:{sx:{backgroundColor:N=>N.palette.background.paper,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`}},tabIndex:-1,outlined:{color:N=>n?N.palette.action.disabled:gt.alpha(N.palette.divider,.2)},parentFloat:v,createPopupPanel:D,onPopupOpen:()=>y(!0),onPopupClose:()=>y(!1),createTooltip:({children:N},W)=>a.jsx(No,{title:W||x?"":"Name Box",disabled:W,leaveDelay:0,sx:{opacity:W||x?0:1},children:N}),createQuickButton:M})})}));Ou.displayName="NamedCollectionEditor";const T_=(e,t)=>a.jsx(Ou,{ref:t,...e}),Pu=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,sheetElement:r,gridStyle:i,showNamedCollectionEditor:l=!0,NamedCollectionEditorProps:d,renderNamedCollectionEditor:c=T_,disabled:u,commands:p,...f}=e,[h,m]=s.useState(o?.getSelectedSheet());Xt(o,{onSheetsChange:$=>{m($?.getSelectedSheet())},onViewChange($){m($?.getSelectedSheet())}});const[g,x]=s.useState(h.getSelection().getCoords().cell),y=h.getRange(g).getCell(),v=u||!y.isEditAllowed(),b=s.useRef(null),C=s.useMemo(()=>({fontSize:11}),[]);Xt(h.getSelection(),{onChange:()=>{x(h.getSelection().getCoords().cell)}}),Xt(h,{onProtectionChange(){x(h.getSelection().getCoords().cell)}});const k=b.current?.getLineHeight()??20,[E,R]=s.useState(k),[j,B]=s.useState(5),[T,_]=s.useState(1),w=ue(($,{size:F})=>{$.preventDefault(),$.stopPropagation();const X=Math.floor(F.height/k);R(X*k+1),X>1&&B(X)},[k]),S=ue(($,{size:F})=>{const X=Math.floor(F.height/k);_(X)},[k]),O=$r(),P=O.getMode();let M=null;P?.key==="edit"&&(M=P.args?.stateAndCoords);const A=s.useMemo(()=>{let $=M?.editState;return $||($=N9(()=>h.getRange(g).getCell())),a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:a.jsx(B9,{ref:b,activeCoords:g,sheet:h,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:g})},defaultTextStyle:C,useRichStyling:!1,disabled:v,onChangeEdit:F=>{if(F.dirty!==void 0){const X={sheet:h,coords:g,editState:F};O.setMode(K=>({...K,args:{...K?.args,stateAndCoords:X}}))}},editState:$,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,M,g,T,r]),D=s.useRef(null),L=s.useMemo(()=>l?c({names:o.getNames(),workbook:o,...d},D):null,[c,d,l,h,o,v]),N=s.useMemo(()=>a.jsxs(V.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,border:$=>`solid ${v?$.palette.action.disabled:gt.alpha($.palette.divider,.2)} 1px`},children:[a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:ye(a.jsx(Rb,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||M===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.cancelEdit()}}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:ye(a.jsx(Ib,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||M===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.submitEdit()}}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:ye(a.jsx(Qb,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()}})]}),[v,M]),W=qr(),[I,U]=s.useState(!1),G=s.useMemo(()=>a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:$=>$.spacing(.5),alignItems:"start"},children:[N,a.jsxs(V.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:$=>$.typography.fontFamily,fontSize:11*z.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:$=>`${$.shape.borderRadius}px`,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,border:$=>`solid ${v?$.palette.action.disabled:gt.alpha($.palette.divider,.2)} 1px`,"& textarea":{color:$=>v?`${$.palette.text.disabled} !important`:$.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>U(!0),onBlur:()=>U(!1),onMouseDown:$=>{$.target?.classList.contains("react-resizable-handle")&&$.preventDefault()},children:[a.jsx(V.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:$=>$.spacing(1),paddingRight:$=>$.spacing(1)},children:a.jsx(__.ResizableBox,{height:E,draggableOpts:{grid:[k,k]},minConstraints:[k,k],maxConstraints:[15*k,15*k],onResize:S,onResizeStop:w,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:A})}),a.jsx(xr,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:ye(T>1?a.jsx(wn.ExpandLess,{}):a.jsx(wn.ExpandMore,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{const $=T>1?1:j;R($*k+1),_($)}}),a.jsx(V.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:I?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:$=>$.palette.primary.main,borderRadius:$=>`${$.shape.borderRadius}px`}})]})]}),[N,A,I,T,k]),Q=s.useMemo(()=>L||G?!L&&G?G:L&&!G?L:a.jsx(a.Fragment,{children:a.jsx(kd,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${W.palette.text.icon??W.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:L,elementAfter:G})}):null,[L,G]),H=Ro(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>D.current}),[]);return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",gap:$=>$.spacing(.5),...n},ref:H,...f,children:Q})}));Pu.displayName="FormulaBar";const Au=s.memo(s.forwardRef((e,t)=>{const{filter:n,commands:o,disabled:r,sx:i,floatReference:l,...d}=e,c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(h,m)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:l}),[r,l]),p=s.useMemo(()=>({...c,...u,variant:$t.Menuitem}),[c,u]),f=a.jsxs(a.Fragment,{children:[a.jsx(Re,{...p,command:o.getCommand("sortAscending"),icon:ye(a.jsx($d,{}))}),a.jsx(Re,{...p,command:o.getCommand("sortDescending"),icon:ye(a.jsx(Wh,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:o.getCommand("autoFilterClear"),icon:ye(a.jsx(H2,{}))}),[]]});return a.jsx(V.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...i},...d,children:f})}));Au.displayName="FilterColumnMenu";const cm=s.memo(s.forwardRef((e,t)=>{const{children:n,className:o,disabled:r,style:i,filter:l,...d}=e,c=Ro(t,()=>({isFilters:()=>!0}),[]);return a.jsx("div",{ref:c,className:Qn("filters",o),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...i},...d,children:a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[a.jsx("div",{children:l.getName()}),a.jsx("div",{children:"Filter Widget"})]})})}));cm.displayName="Filters";const Fu=s.memo(s.forwardRef((e,t)=>{const{children:n,sheet:o,style:r,className:i,value:l,index:d,editing:c,editable:u,disabled:p,selectedIndex:f,dragging:h,borderColor:m,borderWidth:g,activeColor:x,background:y="white",tabRadius:v=4,gridTheme:b,...C}=e,[k,E]=s.useState(()=>!!o&&o.getProtection().isLocked()),[R,j]=s.useState(()=>o?o.getTabColor():null);Xt(o,{onProtectionChange:()=>{E(o.getProtection().isLocked())},onTabColorChange:()=>{j(o.getTabColor())},onStyleChange:()=>{j(o.getTabColor())}});const B=qr(),T=f===d;let _=null,w=null;if(R||h){let P=y;R?(w=R.toBlackOrWhite().toCSS(),P=R?.toCSS()):T||(P=B.palette.background.paper),_=a.jsx(V.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:T?"50%":"100%",borderRadius:"4px",border:M=>T?`${y} solid 1px`:`${M.palette.divider} solid 1px`,background:T&&R?`linear-gradient(0deg, ${P} 0%, transparent)`:P}})}let S=null;typeof m=="string"?S=m:m?.toCSS&&(S=m.toCSS());const O=T?a.jsx(V.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:P=>P.palette.primary.main}}):null;return a.jsx(t9,{theme:T?b??B:B,children:a.jsx(V.Box,{ref:t,className:Qn(i),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:h?"grabbing":void 0},...C,children:a.jsx(Ig,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?S:"transparent",children:a.jsx(V.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:h?"grabbing":void 0,color:T?"primary":w||"text.secondary",backgroundColor:T?y:"transparent","&:hover:not([disabled])":{backgroundColor:T?y:"transparent"},"& input":{color:P=>`${P.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:a.jsxs(a.Fragment,{children:[_,a.jsxs(V.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,O]}),k?a.jsx(wn.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):a.jsx(V.Box,{sx:{minHeight:"22px"}})]})]})},l+":"+d)})})})}));Fu.displayName="SheetTab";const zu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,index:o,commands:r,scope:i="sheet",disabled:l,floatReference:d,sx:c,className:u,tabStripRef:p,...f}=e,[h,m]=s.useState(n?.getProtection());Xt(n,{onProtectionChange:b=>{m(b?.getProtection())}});const g=s.useMemo(()=>({}),[]),x=s.useMemo(()=>({commandHook:{beforeExecute:(b,C)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:i,commandState:o,disabled:l||o===void 0,parentFloat:d}),[l,d]),y=s.useMemo(()=>({...g,...x}),[g,x]),v=a.jsxs(a.Fragment,{children:[a.jsx(Re,{command:r.getCommand("addSheet"),commandState:o,...y,variant:$t.Menuitem}),a.jsx(Re,{command:r.getCommand("deleteSheet"),...y,variant:$t.Menuitem}),a.jsxs(sr,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(d.closeAll()).then(()=>{p?.startEdit(o)})},disabled:l||!h.isStructureAllowed(),parentFloat:d,children:["Rename",i!=="sheet"?" Sheet":""]}),a.jsx(Re,{command:r.getCommand("duplicateSheet"),...y,variant:$t.Menuitem}),a.jsx(Re,{command:r?.getCommand("protectionSheetToggle"),...y,variant:$t.Menuitem,icon:a.jsx(wn.Lock,{})}),a.jsx(ol,{variant:$t.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:a.jsx(V2,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Wi.End},parentFloat:d}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{command:r.getCommand("hideSheet"),...y,variant:$t.Menuitem,icon:ye(a.jsx(qh,{}))})]});return a.jsx(V.Box,{ref:t,className:Qn("menu",u),sx:{...c},...f,children:v})}));zu.displayName="SheetTabMenu";const Bu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,gridStyle:o,floatReference:r,closeFloatAll:i,className:l,...d}=e,[c,u]=s.useState(n?.getSheets().search()),[p,f]=s.useState(n?.getProtection());Xt(n,{onSheetsChange:m=>{u(m.getSheets().search())},onProtectionChange:m=>{f(m?.getProtection())}});const h=s.useMemo(()=>{const m=[],g=n.getSheets().search({visibility:z.ISheet.Visibility.Hidden}),x=n.getSelectedSheet();for(let y=0;y<g.length;y++){const v=g[y],b=v.getVisibility();if(b===z.ISheet.Visibility.VeryHidden)continue;const C=x===v,k=v.getProtection().isLocked(),E=v.getTabColor(),R=o?.body.fill??"transparent";let j=null,B=null,T=R;E&&(T=E.toCSS(),C||(B=E.toBlackOrWhite().toCSS()),j=a.jsx(V.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:C?T:"transparent",borderRadius:"4px",border:`solid 1px ${o.header.edgeStrokeFill}`},children:a.jsx(V.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:C||b===z.ISheet.Visibility.Hidden?"50%":"100%",border:w=>C?`${R} solid 1.5px`:`${w.palette.divider} solid 1px`,background:C&&E?`linear-gradient(0deg, ${T} 0%, ${R})`:T,borderRadius:"4px"}})}));let _=null;k&&(_=a.jsx(wn.Lock,{color:"secondary"})),b!==z.ISheet.Visibility.Visible&&(_=ye(a.jsx(qh,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),_&&(_=a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:_})),m.push(a.jsx(sr,{disabled:!p.isStructureAllowed()&&b===z.ISheet.Visibility.Hidden,sx:{color:w=>{let S=C?w.palette.primary.main:w.palette.text.secondary;return B&&(S=B),b===z.ISheet.Visibility.Hidden&&(S=gt.alpha(S,w.palette.action.disabledOpacity)),S},borderLeft:w=>`${C?w.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:C?"700":"400","&:hover":{fontWeight:"700"}},icon:C?a.jsx(Aa,{}):void 0,onMouseDown:w=>w.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(w){console.error(w)}})},children:a.jsxs(a.Fragment,{children:[j,a.jsxs(V.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[a.jsxs(V.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),a.jsx(V.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),_]})]})},""+y))}return m},[n,p,c,r,o]);return a.jsx(V.Box,{ref:t,className:Qn("menu",l),...d,children:h})}));Bu.displayName="SheetsAllMenu";var j_=function(){},dm=typeof window<"u",M_=dm?s.useLayoutEffect:s.useEffect,i8={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ra=dm&&window.ResizeObserver!==void 0?function(){var e=s.useState(null),t=e[0],n=e[1],o=s.useState(i8),r=o[0],i=o[1],l=s.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var c=d[0].contentRect,u=c.x,p=c.y,f=c.width,h=c.height,m=c.top,g=c.left,x=c.bottom,y=c.right;i({x:u,y:p,width:f,height:h,top:m,left:g,bottom:x,right:y})}})},[]);return M_(function(){if(t)return l.observe(t),function(){l.disconnect()}},[t]),[n,r]}:function(){return[j_,i8]};function I1(){return I1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},I1.apply(null,arguments)}function Nu(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function D1(e,t){return D1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},D1(e,t)}function um(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D1(e,t)}function l8(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const a8=!1,hm=s.createContext(null);var pm=function(e){return e.scrollTop},Jl="unmounted",K0="exited",X0="entering",Ti="entered",C2="exiting",d0=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var l,d=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?d?(l=K0,i.appearStatus=X0):l=Ti:l=o.unmountOnExit||o.mountOnEnter?Jl:K0,i.state={status:l},i.nextCallback=null,i}um(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===Jl?{status:K0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==X0&&i!==Ti&&(r=X0):i!==X0&&i!==Ti||(r=C2)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,l=this.props.timeout;return o=r=i=l,l!=null&&typeof l!="number"&&(o=l.exit,r=l.enter,i=l.appear!==void 0?l.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===X0){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:wo.findDOMNode(this);i&&pm(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===K0&&this.setState({status:Jl})},n.performEnter=function(o){var r=this,i=this.props.enter,l=this.context?this.context.isMounting:o,d=this.props.nodeRef?[l]:[wo.findDOMNode(this),l],c=d[0],u=d[1],p=this.getTimeouts(),f=l?p.appear:p.enter;!o&&!i||a8?this.safeSetState({status:Ti},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:X0},function(){r.props.onEntering(c,u),r.onTransitionEnd(f,function(){r.safeSetState({status:Ti},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:wo.findDOMNode(this);r&&!a8?(this.props.onExit(l),this.safeSetState({status:C2},function(){o.props.onExiting(l),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:K0},function(){o.props.onExited(l)})})})):this.safeSetState({status:K0},function(){o.props.onExited(l)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(l){i&&(i=!1,r.nextCallback=null,o(l))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:wo.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(i&&!l){if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=d[0],u=d[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===Jl)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var l=Nu(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s.createElement(hm.Provider,{value:null},typeof i=="function"?i(o,l):s.cloneElement(s.Children.only(i),l))},t}(s.Component);function Ei(){}d0.contextType=hm,d0.propTypes={},d0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ei,onEntering:Ei,onEntered:Ei,onExit:Ei,onExiting:Ei,onExited:Ei},d0.UNMOUNTED=Jl,d0.EXITED=K0,d0.ENTERING=X0,d0.ENTERED=Ti,d0.EXITING=C2;var cd=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=l8(o.className,r):o.setAttribute("class",l8(o.className&&o.className.baseVal||"",r)));var o,r})},k2=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1];o.removeClasses(p,"exit"),o.addClass(p,f?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(d,c)},o.onEntering=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1]?"appear":"enter";o.addClass(p,f,"active"),o.props.onEntering&&o.props.onEntering(d,c)},o.onEntered=function(d,c){var u=o.resolveArguments(d,c),p=u[0],f=u[1]?"appear":"enter";o.removeClasses(p,f),o.addClass(p,f,"done"),o.props.onEntered&&o.props.onEntered(d,c)},o.onExit=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(d)},o.onExiting=function(d){var c=o.resolveArguments(d)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(d)},o.onExited=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(d)},o.resolveArguments=function(d,c){return o.props.nodeRef?[o.props.nodeRef.current,d]:[d,c]},o.getClassNames=function(d){var c=o.props.classNames,u=typeof c=="string",p=u?(u&&c?c+"-":"")+d:c[d];return{baseClassName:p,activeClassName:u?p+"-active":c[d+"Active"],doneClassName:u?p+"-done":c[d+"Done"]}},o}um(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var l=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(l+=" "+d),i==="active"&&o&&pm(o),l&&(this.appliedClasses[r][i]=l,function(c,u){c&&u&&u.split(" ").forEach(function(p){return h=p,void((f=c).classList?f.classList.add(h):function(m,g){return m.classList?!!g&&m.classList.contains(g):(" "+(m.className.baseVal||m.className)+" ").indexOf(" "+g+" ")!==-1}(f,h)||(typeof f.className=="string"?f.className=f.className+" "+h:f.setAttribute("class",(f.className&&f.className.baseVal||"")+" "+h)));var f,h})}(o,l))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],l=i.base,d=i.active,c=i.done;this.appliedClasses[r]={},l&&cd(o,l),d&&cd(o,d),c&&cd(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Nu(o,["classNames"]);return s.createElement(d0,I1({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.Component);k2.defaultProps={classNames:""},k2.propTypes={};const dd=.12,E2=(e,t)=>{const n={},o=c=>{const u=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:u,strokeFill:Cr(u,dd,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:Cr(n.body.fill,dd,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:Cr(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:Cr(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:Cr(c?.fill??n.body.fill,.22,e.palette?.mode),fill:Cr(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=Cr(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:gt.alpha(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:gt.alpha(i,.7)},n.headerSelectAll={...n.headerSelect,fill:gt.alpha(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:Cr(r.fill,dd,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:Cr(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:Cr(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?gt.alpha(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?gt.alpha(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const l=t??e,d=l.palette.mode==="dark";return n.selection={fill:l.palette?.primary?.main?gt.alpha(l.palette?.primary?.main,.1):void 0,strokeFill:l.palette?.primary?.main},n.selectionInactive={...n.selection,fill:l.palette?.divider?gt.alpha(l.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:gt.alpha(l.palette.warning.light,.05),strokeFill:l.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=gt.alpha(l.palette.action.active,.5),n.colorGrey=l.palette.action.active,n.filterDarkInvert=d?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function s8(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function c8(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Ia=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,l=Ro(t,()=>({}),[]),[d,c]=Ra(),u=s.useRef(null),p=s.useRef(null),[f,h]=s.useReducer(E=>E+1,0),[m,g]=s.useState(null),[x,y]=s.useState(null),[v,b]=s.useState(null),{reference:C}=i0({parentFloat:r,label:"overflow"});s.useLayoutEffect(()=>{p.current={refs:[]};const E=[],R=s.Children.toArray(n);let j=0;R.forEach((B,T)=>{E.push(a.jsx(V.Box,{sx:{display:"flex"},ref:_=>{j++,j===R.length&&h();const w={current:null};w.current=_,p.current.refs[T]=w},children:B},T))}),g(E)},[n,c]),s.useLayoutEffect(()=>{if(!m)return;const E=p.current.refs;if(!l.current||!E||E.length===0)return y(null),void b(null);const R=l.current?.getBoundingClientRect(),j=[],B=[];let T=0,_=!1;for(let S=0;!_&&S<E.length;S++){const O=E[S];if(!O)continue;if(!O.current){_=!0;continue}const P=O.current.getBoundingClientRect();T+=P?.width,T>R.width&&(_=!0)}if(!_)return y(null),void b([]);const w=u.current?.getBoundingClientRect();T=0;for(let S=0;S<E.length;S++){const O=E[S];let P=!1;if(O.current){const M=O.current.getBoundingClientRect();T+=M?.width,T<R.width-w.width&&(P=!0)}P?j.push(m[S]):B.push(m[S])}y(j.length>0?j:null),b(B.length>0?B:null)},[n,m,c,C,f]);const k=ue(E=>{const R=[];for(let B=0;B<v.length;B++){let T=s.Children.toArray(v[B]);const _=T[0];T=s.Children.toArray(_.props.children?.props.children??_.props.children);const w=T[0],S={...w.props};S.parentFloat&&(S.parentFloat=E.floatReference);const O=s.cloneElement(w,S);R.push(O)}const j=a.jsx(V.Box,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:B=>B.spacing(.5),paddingBottom:B=>B.spacing(.5),paddingLeft:B=>B.spacing(1),paddingRight:B=>B.spacing(1),overflow:"hidden"},children:R});return _n({...E,children:j})},[v]);return a.jsxs(V.Box,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:nc([l,d,t]),...i,children:[a.jsx(V.Box,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:x??m}),a.jsx(V.Box,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:a.jsx(Ur,{createPopupPanel:k,ref:u,parentFloat:C,createTooltip:({children:E},R)=>a.jsx(No,{label:"More",description:"More toolbar options…",disabled:R,children:E}),icon:a.jsx(Ih,{children:a.jsx(wn.MoreHoriz,{})})})})]})})),fm="https://unpkg.com/@sheetxl/scripting-templates/dist",R_=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CODNX35VkrQ_uYLp.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CnFS2z2aIkAOecZl.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Vl02t3Ty3ttvNkaF.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],I_=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CODNX35VkrQ_uYLp.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CnFS2z2aIkAOecZl.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Vl02t3Ty3ttvNkaF.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class mm{constructor(t=R_,n=I_){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const l={...o,...o?.typedConstructorOptions?.[n]};let d;delete l.typedConstructorOptions;try{d=await i(t,l)}catch(c){throw new Error("Unable to import",{cause:c})}return d}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const l=n;return await this._fromFile(l,t)}case"base64":{let l;if(n&&typeof n=="object"&&"base64"in n)l=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,u]=n.split(",");l=u}else l=n;const d=eg.base64ToArrayBuffer(l),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(d,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let l,d,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const x=n;c=x.input,l=x.init,d=x.timeout}}const u=d||3e4,p=new AbortController,f=setTimeout(()=>p.abort(),u),h=typeof c=="string"?c:c.toString(),m=r||z.TextUtils.getFileNameExtension(h),g=this.getReadFormatTypeForExt(m)||this._readFormatTypes[0];try{const x=await fetch(c,{...l,signal:p.signal});if(clearTimeout(f),!x.ok)throw new Error(`Failed to fetch: ${x.status} ${x.statusText}`);const y=await x.arrayBuffer();if(!g)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(y,g.key,t),title:o||z.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:g}}catch(x){throw clearTimeout(f),x.name==="AbortError"?new Error(`Fetch timeout after ${u}ms: ${h}`):x}}case"buffer":{const l=n,d=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!d)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(l,d.key,t),title:o||"buffer-file",formatType:d}}case"stream":{const l=n.getReader(),d=[];let c=0;try{for(;;){const{done:m,value:g}=await l.read();if(m)break;d.push(g),c+=g.length}}finally{l.releaseLock()}const u=new ArrayBuffer(c),p=new Uint8Array(u);let f=0;for(const m of d)p.set(m,f),f+=m.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(u,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${z.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt(z.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${z.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const l=await t.arrayBuffer(),d=new Uint8Array(l),c={...n,...n?.typedConstructorOptions?.[i.key]};delete c.typedConstructorOptions;const u=i.handler;if(!u)throw new Error(`Unable to resolve handler for type: ${i?.description??z.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await c.onStart?.(r);const p=await u(d,c);o=new D_(t,p,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=z.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const l=this.getWriteFormats(),d=l.length;for(let p=0;!i&&p<d;p++)(l[p].ext===r||!r&&l[p].isDefault)&&(i=l[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let u=null;try{u=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,f)=>{(function(h,m){const g=URL.createObjectURL(h),x=document.createElement("a");x.style.display="none",x.href=g,x.download=m,document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(g)})(new Blob([f],{type:"application/octet-stream"}),p)})(c,u)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class D_{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const L_=new mm;var d8,u8,O_=function(){if(u8)return d8;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,l="",d=0,c=-1,u=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&u!==1)if(c!==p-1&&u===2){if(l.length<2||d!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var f=l.lastIndexOf("/");if(f!==l.length-1){f===-1?(l="",d=0):d=(l=l.slice(0,f)).length-1-l.lastIndexOf("/"),c=p,u=0;continue}}else if(l.length===2||l.length===1){l="",d=0,c=p,u=0;continue}}r&&(l.length>0?l+="/..":l="..",d=2)}else l.length>0?l+="/"+o.slice(c+1,p):l=o.slice(c+1,p),d=p-c-1;c=p,u=0}else i===46&&u!==-1?++u:u=-1}return l}u8=1;var n={resolve:function(){for(var o,r="",i=!1,l=arguments.length-1;l>=-1&&!i;l--){var d;l>=0?d=arguments[l]:(o===void 0&&(o=process.cwd()),d=o),e(d),d.length!==0&&(r=d+"/"+r,i=d.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var l=o.length,d=l-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var u=r.length-c,p=d<u?d:u,f=-1,h=0;h<=p;++h){if(h===p){if(u>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else d>p&&(o.charCodeAt(i+h)===47?f=h:h===0&&(f=0));break}var m=o.charCodeAt(i+h);if(m!==r.charCodeAt(c+h))break;m===47&&(f=h)}var g="";for(h=i+f+1;h<=l;++h)h!==l&&o.charCodeAt(h)!==47||(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(c+f):(c+=f,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,l=-1,d=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!d){l=c;break}}else d=!1;return l===-1?i?"/":".":i&&l===1?"//":o.slice(0,l)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,l=0,d=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var u=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var f=o.charCodeAt(i);if(f===47){if(!c){l=i+1;break}}else p===-1&&(c=!1,p=i+1),u>=0&&(f===r.charCodeAt(u)?--u===-1&&(d=i):(u=-1,d=p))}return l===d?d=p:d===-1&&(d=o.length),o.slice(l,d)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){l=i+1;break}}else d===-1&&(c=!1,d=i+1);return d===-1?"":o.slice(l,d)},extname:function(o){e(o);for(var r=-1,i=0,l=-1,d=!0,c=0,u=o.length-1;u>=0;--u){var p=o.charCodeAt(u);if(p!==47)l===-1&&(d=!1,l=u+1),p===46?r===-1?r=u:c!==1&&(c=1):r!==-1&&(c=-1);else if(!d){i=u+1;break}}return r===-1||l===-1||c===0||c===1&&r===l-1&&r===i+1?"":o.slice(r,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i=(r=o).dir||r.root,l=r.base||(r.name||"")+(r.ext||""),i?i===r.root?i+l:i+"/"+l:l;var r,i,l},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,l=o.charCodeAt(0),d=l===47;d?(r.root="/",i=1):i=0;for(var c=-1,u=0,p=-1,f=!0,h=o.length-1,m=0;h>=i;--h)if((l=o.charCodeAt(h))!==47)p===-1&&(f=!1,p=h+1),l===46?c===-1?c=h:m!==1&&(m=1):c!==-1&&(m=-1);else if(!f){u=h+1;break}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===u+1?p!==-1&&(r.base=r.name=u===0&&d?o.slice(1,p):o.slice(u,p)):(u===0&&d?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(u,c),r.base=o.slice(u,p)),r.ext=o.slice(c,p)),u>0?r.dir=o.slice(0,u-1):d&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,d8=n}();const h8=/^(con|prn|aux|nul|com\d|lpt\d)$/i,p8=/[<>:"/\\|?*\u0000-\u001F]/g,ei=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:p8,WINDOW_FILENAME_RESERVED_REGEX:h8,isValidWindowsFilename:e=>!(!e||e.length>255||p8.test(e)||h8.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return O_.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),f8=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:mm,IOUtils:ei,WorkbookIO:L_},Symbol.toStringTag,{value:"Module"})),P_=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},gm=async e=>{const t=ei.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new yd(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new yd(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(l){throw new Error(`Failed to parse directory: ${l.message}. Ensure the file is valid JSON.`)}const i=r.map(async l=>{try{const d=ei.relativePath(e,l.path),c=await fetch(d);if(!c.ok)throw new Error(`Failed to fetch file at '${l.path}': ${c.statusText}`);const u=await c.text();let p=l.metadata;return p?.title||(p={title:P_(l),...p}),{path:l.path,content:u,metadata:p}}catch(d){console.error(d.message)}return null});return(await Promise.all(i)).filter(l=>l!==null)},ud={fontSize:"0.8rem",marginRight:"4px"},A_=s.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...l}=e;let d;return d=n.metadata?.icon==="formula"?a.jsx(Kh,{sx:ud}):n.metadata?.icon==="macro"?a.jsx(G2,{sx:ud}):a.jsx(wn.WebhookOutlined,{sx:ud}),a.jsx(sr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:d,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==Zt.Enter&&c.keyCode!==Zt.Space||r(n)},...l,children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[a.jsx(V.Typography,{component:"div",children:n.metadata?.title??n.path}),a.jsx(V.Typography,{variant:"caption",component:"div",sx:{color:c=>gt.alpha(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),xm=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:l=fm,...d}=e,[c,u]=s.useState([]),[p,f]=s.useState(!0),h=ro(n,["executeSelectedScript"]),m=h[0]?.context?.();s.useEffect(()=>{(async()=>{try{const x=await gm(l);u(x)}catch{}finally{f(!1)}})()},[l]);const g=s.useCallback((x,y)=>{if(p)return a.jsx("div",{children:"Loading..."});const v={variant:$t.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=E=>{m.getEditor()?.insertSnippet(E.content),x.closeFloat()},C=[];for(let E=0;E<c.length;E++){const R=c[E];R&&C.push(a.jsx(A_,{handleInsert:b,snippet:R},R.path))}const k=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[C.length>0?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C}),a.jsx(Lt,{orientation:"horizontal"})]}):null,s.createElement(Re,{...v,key:"help",command:n.getCommand("help"),icon:ye(a.jsx(Zh,{}))})]});return _n({...x,children:k})},[i,o,r,p,m]);return a.jsx(Pn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:g,icon:ye(a.jsx(ov,{})),...d})})),Vu=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsx(a.Fragment,{children:a.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[a.jsx("div",{children:a.jsx(Ia,{parentFloat:o,style:{},children:a.jsx(Re,{...c,command:n.getCommand("saveScripts"),icon:ye(a.jsx(rv,{}))})})}),a.jsx("div",{style:{flex:"1 1 100%"}}),a.jsx("div",{children:a.jsx(Ia,{parentFloat:o,style:{},children:a.jsx(xm,{...c,commands:n})})})]})})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})}));Vu.displayName="ScriptEditorToolbar";const hd={fontSize:"1rem"},ym=s.memo(s.forwardRef((e,t)=>{const{scriptPath:n=fm,onScriptSelect:o,sx:r=gn.EmptyCssProperties,className:i,buttonMinWidth:l=210,buttonMinHeight:d=80,gap:c=12,...u}=e,[p,f]=s.useState([]),[h,m]=s.useState(!0),[g,x]=s.useState(null);if(s.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{m(!0),x(null);const C=await gm(n);for(let k=0;k<C.length;k++){const E=C[k];E&&b.push(E)}}catch(C){x(C instanceof Error?C.message:"Failed to load scripts"),C instanceof yd||console.error("Error loading scripts:",C)}finally{f(b),m(!1)}})()},[n]),h)return a.jsx(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Qn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...r},...u,children:a.jsx(V.CircularProgress,{})});let y=null;g&&(y=a.jsxs(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",className:Qn(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},...u,children:[a.jsx(V.Typography,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),a.jsx(V.Typography,{color:"error",component:"div",children:g})]}));const v=b=>{const C=b.metadata?.icon;return C==="macro"?a.jsx(G2,{sx:hd}):C==="formula"?a.jsx(Kh,{sx:hd}):C==="autostart"?a.jsx(wn.WebhookOutlined,{sx:hd}):null};return a.jsxs(V.Box,{ref:t,className:Qn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,...r},...u,children:[a.jsxs(V.Box,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[a.jsx(V.Typography,{variant:"h6",gutterBottom:!0,children:"Script Template"}),a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),a.jsx(V.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${l}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,C)=>a.jsxs(V.Button,{variant:"outlined",sx:{minWidth:l,minHeight:d,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...C===0&&{borderStyle:"dashed",marginBottom:"8px"},...C===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[a.jsx(V.Typography,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&a.jsx(V.Typography,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${C}`))})]}),y]})}));ym.displayName="TemplateSelectPanel";const Hu=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:l=!1,onClose:d,autoFocusSel:c,autoFocus:u=!0,scripts:p,...f}=e,h=qr(),[m,g]=s.useState(!1),x=s.useRef(!1),[y,v]=s.useState({message:"Loading",cursor:"",dirty:!1}),[b,C]=s.useState(null);s.useEffect(()=>{let L=!1;return C(null),async function(){if(p&&(await p.start(),!L)){const N=p.getModules().search()[0]?.getSource();C({source:N||null})}}(),()=>{L=!0}},[p]);const k=s.useCallback(L=>{v(N=>({...N,...L}))},[]),E=s.useRef(null),R=s.useRef(null),[j,B]=s.useState(null),T=s.useRef(null),_=ue(L=>{if(j)return j.focus(L),!0;if(c){const N=R.current?.querySelectorAll?.(c);if(N&&N.length>0)return N[0]?.focus?.(L),!0}return R.current?.focus?.(L),!1},[j,c,u]),w=s.useMemo(()=>a.jsx(il,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),S=s.useMemo(()=>a.jsx(V.Paper,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,marginLeft:L=>L.spacing(.5),marginRight:L=>L.spacing(.5),marginTop:L=>L.spacing(1),marginBottom:L=>L.spacing(1)},children:a.jsx(Vu,{commands:i})}),[h,i]),O=s.useMemo(()=>a.jsx(V.Box,{className:Qn("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:a.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:L=>L.palette.text.secondary},variant:"caption",children:y.message}),a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:L=>L.palette.text.secondary},variant:"caption",children:y.dirty?"Unsaved":""}),a.jsx(V.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:L=>L.palette.text.secondary},variant:"caption",children:y.cursor})]})}),[y]),P=s.useMemo(()=>a.jsxs(V.Box,{className:Qn("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[S,a.jsx(V.Box,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:a.jsx(s_,{ref:R,loadingPanel:w,readOnly:l,onClose:d,autoFocus:u,commands:i,onStatusChange:k,darkMode:h.palette.mode==="dark",...r})}),O]}),[h,i,S,O,m,w,l,r,u,c,d,k]),M=s.useMemo(()=>a.jsx(V.DialogTitle,{className:Qn({"Mui-selected":x.current}),sx:{display:"flex",color:L=>L.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:L=>`${L.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:L=>L.transitions.duration.shortest/2+"ms"},backgroundColor:L=>gt.alpha(L.palette.action.hover,.03),borderBottom:L=>`solid ${gt.alpha(L.palette.divider,.2)} 1px`},onPointerDown:L=>{L.isDefaultPrevented()||(L.preventDefault(),_())},children:a.jsxs(V.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:L=>L.spacing(.25),marginBottom:L=>L.spacing(.25),marginLeft:L=>L.spacing(1),marginRight:L=>L.spacing(1)},children:[a.jsx(V.Box,{sx:{flex:"1 1 100%",paddingLeft:L=>L.spacing(1)},children:"Script (Typescript)"}),a.jsx(No,{label:"Close",children:a.jsx(V.IconButton,{"aria-label":"close",sx:{color:L=>L.palette.text.icon??L.palette.action.active},touchRippleRef:E,onPointerDown:L=>{E.current?.start(L,{center:!1}),L.stopPropagation(),L.preventDefault()},onPointerUp:()=>{R.current?.close()},children:a.jsx(wn.Close,{})})})]})}),[h,m]),A=s.useMemo(()=>{let L;return b===null?null:(b.source===null&&(L=a.jsx(ym,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:N=>{R.current?.getEditor().insertSnippet(N.content),C({source:N.content??""})}})),a.jsxs(V.Box,{tabIndex:0,className:Qn("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},onPointerDown:N=>{N.isDefaultPrevented()||R.current?.focus()},children:[M,a.jsxs(V.Box,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[P,L]})]}))},[S,P,n,b]),D=Ro(t,()=>({isScriptWorkspaceElement:()=>!0,focus:L=>{_(L)}}),[]);return a.jsx(V.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:D,...f,onFocus:L=>{g(!0),x.current=!0,D.current?.contains(L.target)&&L.target!==D.current&&B(L.target),L.relatedTarget&&!T.current&&(T.current=L.relatedTarget),f?.onFocus?.(L)},onBlur:L=>{D?.current?.contains(L.relatedTarget)||D?.current===L.relatedTarget||(T.current=null,x.current=!1,g(!1)),f?.onBlur?.(L)},children:A})}));Hu.displayName="ScriptWorkspace";const $u=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...l}=e,d=ro(n,["executeScript"])[0].context();ro(n,["showScriptEditor"]);const c=s.useCallback((u,p)=>{const f={variant:$t.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=d?.getScripts(),m=h?.searchFunction({type:"macro"}),g=[];if(m)for(let y=0;y<m.length;y++){const v=m[y];g.push(a.jsx(Re,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ye(a.jsx(G2,{})),labelOverride:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${y}`))}const x=a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[g.length>0?a.jsxs(a.Fragment,{children:[a.jsx(V.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:g}),a.jsx(Lt,{orientation:"horizontal"})]}):null,s.createElement(Re,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ye(a.jsx(Kb,{}))})]});return _n({...u,children:x})},[i,d,o,r]);return a.jsx(Pn,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:ye(a.jsx(nv,{})),...l})})),F_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ro(n,["executeScript","showScriptEditor"]),d=l[0]?.context?.(),c=s.useCallback(u=>{const{commandButtonProps:p,commandPopupProps:f}=u,h=a.jsx(ol,{...f,command:n.getCommand("formatFontColor"),icon:a.jsx(ny,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),m=a.jsx(ol,{...f,command:n.getCommand("formatFillColor"),icon:a.jsx(ty,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Wi.End}}),g=n.getCommand("undo")?a.jsx(a.Fragment,{children:a.jsx(ju,{...f,quickCommand:"undo"})}):null,x=n.getCommand("find")?a.jsx(a.Fragment,{children:a.jsx(Lf,{...f})}):null;let y=null;const v=d?.getScripts();if(l[1]?.state?.()||v){let b=l[1]?.state?.();const C=v?.searchFunction({type:"macro"});for(let k=0;C&&!b&&k<C?.length;k++)b=!0;b&&(y=a.jsxs(a.Fragment,{children:[a.jsx(Lt,{}),a.jsx($u,{...f})]}))}return a.jsxs(Ia,{parentFloat:o,children:[g,null,g?a.jsx(Lt,{}):null,a.jsx(Mu,{...f,command:n.getCommand("paste")}),a.jsx(Re,{...p,command:n.getCommand("formatPainterToggle"),icon:ye(a.jsx(ub,{}))}),a.jsx(ec,{...p,command:n.getCommand("copy")}),a.jsx(Lt,{}),a.jsx(Bf,{...f,command:n.getCommand("formatFontFamily")}),a.jsx(Of,{...f,command:n.getCommand("formatFontSize")}),a.jsx(Re,{...p,command:n.getCommand("formatBoldToggle"),icon:a.jsx(ax,{})}),a.jsx(Re,{...p,command:n.getCommand("formatItalicToggle"),icon:a.jsx(lx,{})}),a.jsx(Vf,{...f}),a.jsx(Nf,{...f}),h,a.jsx(Lt,{}),m,a.jsx(Rf,{...f}),a.jsx(If,{...f}),a.jsx(Lt,{}),a.jsx(Fp,{...f}),a.jsx(zp,{...f}),a.jsx(Bp,{...f}),a.jsx(Np,{...f}),a.jsx(Lt,{}),a.jsx(Pf,{...f}),a.jsx(Uf,{command:n.getCommand("formatCellStyle"),...f}),a.jsx(Kf,{command:n.getCommand("formatTableStyle"),...f}),a.jsx(Lt,{}),a.jsx(Eu,{...f}),a.jsx(_u,{...f}),a.jsx(Lt,{}),a.jsx(Af,{...f}),null,a.jsx(ku,{...f}),a.jsx(Tu,{...f}),x,y]})},[n,l]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),z_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsxs(Ia,{parentFloat:o,children:[null,a.jsx(Re,{...c,command:n.getCommand("updateHyperlink"),icon:ye(a.jsx(Vd,{}))}),a.jsx(Re,{...c,command:n.getCommand("updateComments"),icon:ye(a.jsx(Hd,{}))}),a.jsx(Ru,{...u}),a.jsx(Re,{...c,command:n.getCommand("insertTable"),icon:ye(a.jsx(xa,{}))})]})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})})),B_=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,l=ue(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return a.jsxs(Ia,{parentFloat:o,children:[a.jsx(Df,{...u}),a.jsx(Re,{...c,command:n.getCommand("protectionSheetToggle"),icon:a.jsx(wn.Lock,{color:"secondary"})}),a.jsx(Lt,{}),a.jsx(Ff,{...u}),a.jsx(Hf,{...u}),a.jsx(Lt,{}),a.jsx(Re,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:a.jsx(el,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),a.jsx(Re,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:a.jsx(el,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),a.jsx(Lt,{}),a.jsx($f,{...u}),a.jsx(Qf,{command:n.getCommand("selectTheme"),...u}),a.jsx(Lt,{}),a.jsx($u,{...u,scope:"view"}),a.jsx(Lt,{}),a.jsx(Re,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ye(n.getCommand("fullScreenToggle").state()?a.jsx(Sb,{}):a.jsx(wb,{}))})]})},[n]);return a.jsx(Fa,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:l,...i})})),bm=e=>a.jsx($_,{...e}),N_=s.memo(e=>{const{sx:t,...n}=e;return a.jsxs(V.Box,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${gt.alpha(o.palette.primary.main,.35)} solid 2px`}},children:[a.jsx(V.Tab,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),a.jsx(V.Box,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),V_=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,l=s.useMemo(()=>{const d=[];for(let c=0;c<t.length;c++)d.push(a.jsx(N_,{label:t[c].label},t[c].label));return d},[t]);return a.jsx(V.Tabs,{value:n,onChange:(d,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:d=>d.spacing(1.5),paddingRight:d=>d.spacing(1.5),paddingTop:d=>d.spacing(0),paddingBottom:d=>d.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:d=>d.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:a.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:l})}),H_=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,l=s.useCallback(c=>{o?.(c.target.value)},[o]),d=s.useMemo(()=>{const c=[];for(let u=0;u<t.length;u++){const p=t[u].label;c.push(a.jsx(V.MenuItem,{value:u,sx:{color:f=>{if(n===u)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return a.jsx(V.FormControl,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:a.jsx(V.Select,{value:n,onChange:l,variant:"outlined",sx:{backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`},...i,children:d})})}),$_=s.memo(s.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:l,toolbarsProps:d,paletteProps:c={},workbook:u,sx:p,...f}=e,h=s.useMemo(()=>{const E=[];return E.push({label:"Home",component:a.jsx(F_,{commands:n,...d?.Home})}),E.push({label:"Insert",component:a.jsx(z_,{commands:n,...d?.Insert})}),E.push({label:"View",component:a.jsx(B_,{commands:n,...d?.View})}),E},[n]),m=s.useMemo(()=>{const E=[];for(let R=0;R<h.length;R++)E.push(s.cloneElement(h[R].component,{...h[R].component.props,key:h[R].key??h[R].label}));return E},[h]),[g,x]=s.useState(0),y=E=>{x(E)},v=s.useMemo(()=>i?a.jsx(H_,{toolbars:h,value:g,onToolbarChange:y,sx:r}):a.jsx(V_,{toolbars:h,value:g,onToolbarChange:y,sx:r}),[h,g,r,i]),{sx:b,...C}=c,k=a.jsx(V.Paper,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`,marginLeft:E=>E.spacing(1),marginRight:E=>E.spacing(1),marginTop:E=>E.spacing(.5),marginBottom:E=>E.spacing(.5),...b},...C,children:m[g]});return a.jsxs(V.Box,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:E=>E.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,l?l(k):k]})})),W_=e=>a.jsx(zu,{...e}),U_=e=>a.jsx(Bu,{...e}),q_=e=>a.jsx(Fu,{...e}),Wu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:l=!1,readOnly:d=!1,contextMenuProps:c,renderContextMenu:u=W_,sheetsAllProps:p,renderSheetsAll:f=U_,sheetTabProps:h,renderSheetTab:m,background:g="transparent",className:x,notifier:y,sx:v,borderWidth:b,borderColor:C,gridTheme:k,gridStyle:E,...R}=e,[j,B]=s.useState(n?.getSelectedSheetIndex()),[T,_]=s.useState(n?.getSheets().search()),[w,S]=s.useState(n?.getProtection());Xt(n,{onViewChange(ie){B(ie?.getSelectedSheetIndex())},onSheetsChange:ie=>{_(ie.getSheets().search())},onProtectionChange:ie=>{S(ie?.getProtection())}});const O=s.useMemo(()=>{const ie=[];for(let ee=0;ee<T.length;ee++)ie.push(T[ee].getName());return ie},[T]),P=s.useCallback(ie=>{r?.(ie)!==!1&&(n.getSheetAt(ie).select(),i?.(ie))},[n,r,i]),M=s.useCallback((ie,ee)=>{n.getSheetAt(ie).setName(ee),i?.(ie)},[n,i]),A=s.useCallback((ie,ee)=>{n.getSheetAt(ie).setPosition(ee),i?.(ee)},[n,i]),D=ue(()=>{if(r?.(j)===!1)return;const ie=j+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ie)},[n,r,i,j]),L=s.useMemo(()=>({placement:"top-start"}),[]),N=s.useRef(null),[W,I]=s.useState(!1),U=s.useCallback(ie=>{const{closeFloatAll:ee,floatReference:pe}=ie;return f({workbook:n,gridStyle:E,floatReference:pe,closeFloatAll:ee,...p})},[f,p,l,n,E]),{reference:G,component:Q}=i0({label:"allSheet",popperProps:L,anchor:N.current,onOpen:()=>I(!0),onClose:()=>I(!1),createPopupPanel:U}),H=s.useRef(null),[$,F]=s.useState(null),X=s.useCallback(ie=>{const{floatReference:ee}=ie;return u?.({workbook:n,index:$?.index,tabStripRef:H.current,commands:o,disabled:l,floatReference:ee,...c})},[u,c,l,n,o,$]),{reference:K,component:ne}=i0({label:"sheetTab",popperProps:L,anchor:{getBoundingClientRect:()=>new DOMRect($?.left||0,$?.top||0,0,0)},onClose:()=>F(null),createPopupPanel:X});s.useEffect(()=>{$?K.open(0):K.close(0)},[$]);const J=s.useCallback((ie,ee)=>{ie.preventDefault(),F({left:ie.clientX-2,top:ie.clientY-4,index:ee})},[]),re=ue(ie=>{let ee;try{ee=n?.getSheetAt(ie.index)}catch{}return ee?(m??q_)({sheet:ee,gridTheme:k,onContextMenu:pe=>{P(ie.index),J(pe,ie.index)},...ie,...h}):null},[m,h,n,k]),fe=s.useMemo(()=>d||!w?.isStructureAllowed()?null:a.jsx(vr,{disableInteractive:!0,title:"New sheet",children:a.jsx(V.IconButton,{disabled:l,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ie=>ie.palette.primary.main},color:ie=>ie.palette.text.icon??ie.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ie=>{ie.button===0&&ie.preventDefault()},onClick:()=>D(),children:a.jsx(wn.AddCircleOutline,{})})}),[d,l,w,D]);return a.jsxs(V.Box,{ref:t,className:Qn(x),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...R,children:[a.jsx(kf,{ref:H,selectedTabIndex:j,tabNames:O,onSelectedTabIndexChange:P,onTabNameChange:M,onTabMove:A,background:g,borderColor:C,borderWidth:b,activeColor:null,disabled:l,disableDrag:d||!w.isStructureAllowed(),createScrollStartButton:lv,createScrollEndButton:av,createScrollEdgeButton:iv,createTabButton:re,createTabDivider:ie=>{const{key:ee,...pe}=ie;return a.jsx(Lt,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Te=>gt.alpha(Te.palette.divider,.25)},...pe},ee)},editLabelProps:{maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ie=>{n.isValidSheetNameCharacter(ie.key)||ie.preventDefault()},onCancel:()=>{i?.(j)},notifier:y},children:a.jsx(vr,{disableInteractive:!0,title:W?"":"List all sheets",children:a.jsx(xr,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:ie=>ie.palette.text.icon??ie.palette.action.active},ref:N,dense:!0,outlined:!1,selected:W,color:"primary","aria-label":"menu",onMouseDown:ie=>{ie.button===0&&ie.preventDefault()},onClick:()=>{W?G.close(0):G.open(0)},icon:a.jsx(wn.Menu,{})})})}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,minWidth:"4px"}}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:fe}),a.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:1,minWidth:"24px"}}),ne,Q]})}));Wu.displayName="WorkbookStrip";const Uu=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:l,className:d,...c}=e,[u,p]=s.useReducer(S=>S+1,0),[f,h]=s.useState(n.getSelectedSheet()),[m,g]=s.useState(f.getSelectedRanges()),[x,y]=s.useState(f.getSelectedCell());Xt(n,{onSheetsChange(){h(n.getSelectedSheet())}}),Xt(f.getSelection(),{onChange(){g(f.getSelectedRanges()),y(f.getSelectedCell())}}),ro(o,[],{onChange:()=>{p()}});const v=s.useMemo(()=>({}),[]),b=s.useMemo(()=>({commandHook:{beforeExecute:(S,O)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:l}),[r,l]),C=s.useMemo(()=>({...v,...b,variant:$t.Menuitem}),[v,b]),k=s.useMemo(()=>({commands:o,variant:$t.Menuitem,parentFloat:l,...b}),[o,b,l]),E=[];let R=m.isEntireRows(),j=m.isEntireColumns();m&&(R&&(E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(Re,{command:o.getCommand("hideColumns"),...C,icon:ye(a.jsx(rb,{})),key:"context:"+E.length})),E.push(s.createElement(Re,{command:o.getCommand("unhideColumns"),...C,icon:ye(a.jsx(ob,{})),key:"context:"+E.length}))),j&&(E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(Re,{command:o.getCommand("hideRows"),...C,icon:ye(a.jsx(lb,{})),key:"context:"+E.length})),E.push(s.createElement(Re,{command:o.getCommand("unhideRows"),...C,icon:ye(a.jsx(ib,{})),key:"context:"+E.length}))),(R||j)&&E.push(a.jsx(Lt,{orientation:"horizontal"},"context:"+E.length)),R&&E.push(s.createElement(Re,{command:o.getCommand("autoFitColumns"),...C,icon:ye(a.jsx(Ab,{})),key:"context:"+E.length})),j&&E.push(s.createElement(Re,{command:o.getCommand("autoFitRows"),...C,icon:ye(a.jsx(Fb,{})),key:"context:"+E.length})));const B=[],T=o.getCommand("formatTableStyle"),_=T?.context()?.table();if(V0(T),!R&&!j){if(B.push(a.jsx(Lt,{orientation:"horizontal"},"contextBefore:"+B.length)),x?.getHyperlink())B.push(s.createElement(o0,{...k,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+B.length,quickCommand:"openHyperlink",icon:S=>S.key()==="openHyperlink"?ye(a.jsx(Vd,{})):null}));else{const S=o.getCommand("updateHyperlink");B.push(s.createElement(Re,{command:S,...C,icon:ye(a.jsx(Vd,{})),key:"contextBefore:"+B.length}))}if(x?.getComments())B.push(s.createElement(o0,{...k,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+B.length,quickCommand:"updateComments",icon:S=>S.key()==="updateComments"?ye(a.jsx(Hd,{})):null}));else{const S=o.getCommand("updateComments");B.push(s.createElement(Re,{command:S,...C,icon:ye(a.jsx(Hd,{})),key:"contextBefore:"+B.length}))}_?B.push(s.createElement(o0,{...k,variant:$t.Menuitem,key:"contextBefore:"+B.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:_,quickCommand:"editTable",icon:S=>(S.key(),ye(a.jsx(xa,{})))})):B.push(s.createElement(Re,{command:o.getCommand("insertTable"),...C,icon:ye(a.jsx(xa,{})),key:"context:"+E.length})),B.push(s.createElement(Ru,{...k,key:"contextBefore:"+B.length}))}const w=a.jsxs(a.Fragment,{children:[a.jsx(Re,{command:o.getCommand("cut"),...C,icon:a.jsx(my,{})}),a.jsx(ec,{command:o.getCommand("copy"),...C}),a.jsx(Mu,{command:o.getCommand("paste"),...k,includePasteAllInPopup:!1}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Tu,{...k}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Eu,{commands:o,...k,disableSheet:!0}),a.jsx(_u,{commands:o,...k,disableSheet:!0}),a.jsx(ku,{...k}),B,E]});return a.jsx(V.Box,{ref:t,className:Qn("menu",d),sx:{...i},...c,children:w})}));var m8,g8;Uu.displayName="WorkbookContextMenu",function(){if(g8)return m8;g8=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof Li=="object"&&Li&&Li.Object===Object&&Li,l=typeof self=="object"&&self&&self.Object===Object&&self,d=i||l||Function("return this")(),c=Object.prototype.toString,u=Math.max,p=Math.min,f=function(){return d.Date.now()};function h(g){var x=typeof g;return!!g&&(x=="object"||x=="function")}function m(g){if(typeof g=="number")return g;if(function(v){return typeof v=="symbol"||function(b){return!!b&&typeof b=="object"}(v)&&c.call(v)=="[object Symbol]"}(g))return NaN;if(h(g)){var x=typeof g.valueOf=="function"?g.valueOf():g;g=h(x)?x+"":x}if(typeof g!="string")return g===0?g:+g;g=g.replace(e,"");var y=n.test(g);return y||o.test(g)?r(g.slice(2),y?2:8):t.test(g)?NaN:+g}m8=function(g,x,y){var v,b,C,k,E,R,j=0,B=!1,T=!1,_=!0;if(typeof g!="function")throw new TypeError("Expected a function");function w(A){var D=v,L=b;return v=b=void 0,j=A,k=g.apply(L,D)}function S(A){var D=A-R;return R===void 0||D>=x||D<0||T&&A-j>=C}function O(){var A=f();if(S(A))return P(A);E=setTimeout(O,function(D){var L=x-(D-R);return T?p(L,C-(D-j)):L}(A))}function P(A){return E=void 0,_&&v?w(A):(v=b=void 0,k)}function M(){var A=f(),D=S(A);if(v=arguments,b=this,R=A,D){if(E===void 0)return function(L){return j=L,E=setTimeout(O,x),B?w(L):k}(R);if(T)return E=setTimeout(O,x),w(R)}return E===void 0&&(E=setTimeout(O,x)),k}return x=m(x)||0,h(y)&&(B=!!y.leading,C=(T="maxWait"in y)?u(m(y.maxWait)||0,x):C,_="trailing"in y?!!y.trailing:_),M.cancel=function(){E!==void 0&&clearTimeout(E),j=0,v=R=b=E=void 0},M.flush=function(){return E===void 0?k:P(f())},M}}();var x8,y8,b8={exports:{}},pd={};y8||(y8=1,b8.exports=function(){if(x8)return pd;x8=1;var e=s,t=typeof Object.is=="function"?Object.is:function(c,u){return c===u&&(c!==0||1/c==1/u)||c!=c&&u!=u},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function l(c){var u=c.getSnapshot;c=c.value;try{var p=u();return!t(c,p)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,u){return u()}:function(c,u){var p=u(),f=n({inst:{value:p,getSnapshot:u}}),h=f[0].inst,m=f[1];return r(function(){h.value=p,h.getSnapshot=u,l(h)&&m({inst:h})},[c,p,u]),o(function(){return l(h)&&m({inst:h}),c(function(){l(h)&&m({inst:h})})},[c]),i(p),p};return pd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,pd}()),b8.exports;var v8,w8,Nl={exports:{}},ji={exports:{}},Z_=ji.exports;(function(){if(w8)return Nl.exports;w8=1;for(var e=(v8||(v8=1,function(){var f,h,m,g,x,y;typeof performance<"u"&&performance!==null&&performance.now?ji.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ji.exports=function(){return(f()-x)/1e6},h=process.hrtime,f=function(){var v;return 1e9*(v=h())[0]+v[1]},g=f(),y=1e9*process.uptime(),x=g-y):Date.now?(ji.exports=function(){return Date.now()-m},m=Date.now()):(ji.exports=function(){return new Date().getTime()-m},m=new Date().getTime())}.call(Z_)),ji.exports),t=typeof window>"u"?Li:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],l=0;!r&&l<n.length;l++)r=t[n[l]+"Request"+o],i=t[n[l]+"Cancel"+o]||t[n[l]+"CancelRequest"+o];if(!r||!i){var d=0,c=0,u=[],p=1e3/60;r=function(f){if(u.length===0){var h=e(),m=Math.max(0,p-(h-d));d=m+h,setTimeout(function(){var g=u.slice(0);u.length=0;for(var x=0;x<g.length;x++)if(!g[x].cancelled)try{g[x].callback(d)}catch(y){setTimeout(function(){throw y},0)}},Math.round(m))}return u.push({handle:++c,callback:f,cancelled:!1}),c},i=function(f){for(var h=0;h<u.length;h++)u[h].handle===f&&(u[h].cancelled=!0)}}Nl.exports=function(f){return r.call(t,f)},Nl.exports.cancel=function(){i.apply(t,arguments)},Nl.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i},Nl.exports})();var Qr={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const vm=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:l,onShowSidebar:d,onNewWorkbook:c=wm}=e,[u,p]=s.useState(t?.getSelectedSheet()),[f,h]=s.useState(t?.getSheets().search()),m=ue(d,[d]),g=ue(c,[c]),x=s.useMemo(()=>[new vt("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[ke.Ctrl,ke.Shift]}}),new je("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new je("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new je("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new vt("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[ke.Ctrl]},{key:"F5",modifiers:[ke.Shift]}]}),new vt("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[ke.Ctrl]},{key:"H",modifiers:[ke.Ctrl,ke.Alt]}]}),new vt("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[ke.Ctrl]}]}),new vt("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new vt("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new vt("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new vt("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new vt("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new je("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new je("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new je("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[ke.Shift]},{key:"F1",modifiers:[ke.Alt,ke.Shift]}]}),new je("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new je("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[ke.Ctrl]}]}),new je("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[ke.Ctrl]}]}),new je("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[ke.Ctrl,ke.Shift]}]}),new je("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[ke.Ctrl,ke.Shift]}]}),new je("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new je("selectNamed",r,{label:S=>S?.getName()??"Select Named Item",scopedLabels:{namedItem:S=>S?.getName()??"Select"},description:"Select the item."}),new je("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new je("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new je("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new vt("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[ke.Alt]}}),new vt("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[ke.Ctrl,ke.Shift]}}),new vt("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
|
|
86
86
|
|
|
87
|
-
Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[ke.Ctrl]}}),new je("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new je("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[ke.Alt]}]},function(S=!0){m?.()}),new je("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new je("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new je("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new je("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[ke.Ctrl]}}),new je("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new je("calculateAll",r,{label:"Calculate Now",description:"Recalculate all formulas.",shortcut:{key:"F9"}}),new vt("calculate",r,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[ke.Ctrl]}}),new vt("closeWorkbook",r,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[ke.Ctrl]}}),new vt("newWorkbook",r,{label:"New Workbook",description:"Create a new workbook in another tab.",shortcut:{key:"N",modifiers:[ke.Ctrl]}})],[]),y=s.useMemo(()=>{let S=null;return S=i?i.createChildGroup(r,"workbook",!1):new rl(r,"workbook"),S.addCommands(x,!0),S},[i,x]),v=$r(),b=s.useRef(null),C=ue(()=>{let S,O=null;const P=y.getCommand("executeScript");if(P.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!P)return;const M=y.getCommand("executeSelectedScript");if(!M)return;const A={saveSource:async D=>{let L=null,N=null;const W=t.getScripts();try{D&&(N=await o?.showBusy?.("Saving Scripts..."),L=await W.createModule({source:D})),W.addModule("scripts",L,{replace:!0}),N?.()}catch(I){N?.(),console.warn("Unable to compile",I),o?.showError?.(I)}return L},addContainerListener:D=>(k.current=D,()=>{k.current=null}),setSelectedFunction:D=>{S=D??b.current??null,Promise.resolve(S).then(L=>{M.update({disabled:L===null})})},quickInsertFunction:D=>{const L=`=${D.toUpperCase()}(`,N={text:L+")",editMode:!0,initialSelection:{start:L.length,end:L.length+0}};v.setMode(W=>W?.key==="edit"?{...W,args:{...W.args}}:{key:"edit",args:{stateAndCoords:null,start:N}})},getSelectedFunction:()=>S,setEditor:D=>{O=D??null,y.getCommand("showScriptEditor")?.update({state:D!==null})},getEditor:()=>O,getRanges:D=>{try{return t.getRanges(D)}catch{}return null},getScripts:()=>t.getScripts(),isReadonly:()=>t.getProtection().isStructureAllowed()===!1};M.update({context:A})},[y,t,n,o]),k=s.useRef(null);Xt(t,{onBeforeSave:async()=>{await k.current?.onBeforeSave()},onProtectionChange:()=>{k.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),k.current?.onScriptChange()))()}}),Xt(t,{onSheetsChange:S=>{h(S.getSheets().search())},onViewChange(S){p(S?.getSelectedSheet())},onProtectionChange:S=>{const O={disabled:!S.getProtection().isStructureAllowed()};y.getCommand("hideSheet").update(O),y.getCommand("deleteSheet").update(O),y.getCommand("addSheet").update(O),y.getCommand("duplicateSheet").update(O)},onScriptsChange:S=>{C()}});const{isFullscreenAvailable:E,isFullscreenEnabled:R,toggleFullscreen:j}=function(S={}){const{target:O,onChange:P,onError:M,requestFullScreenOptions:A}=S,[D,L]=s.useState(!1),[N,W]=s.useState(null),[I,U]=s.useState(!1),G=s.useCallback(()=>Qr.requestFullscreen(O?.current||null,A),[O,A]),Q=s.useCallback(()=>Qr.exitFullscreen(),[]),H=s.useCallback(()=>Qr.fullscreenElement?Q():G(),[G,Q]),$=s.useCallback(X=>{const K=Qr.fullscreenElement;W(K),U(!!K),P?.(X)},[P]),F=s.useCallback(X=>{const K=Qr.fullscreenElement;W(K),U(!!K),M?.(X)},[M]);return s.useEffect(()=>{L(Qr.fullscreenEnabled)},[]),s.useEffect(()=>(Qr.on("change",$),Qr.on("error",F),()=>{Qr.off("change",$),Qr.off("error",F)}),[$,F]),{isFullscreenAvailable:D,fullscreenElement:N,isFullscreenEnabled:I,enableFullscreen:G,disableFullscreen:Q,toggleFullscreen:H}}({target:{current:n??document.body}}),B=wu();s.useEffect(()=>{y.getCommand("selectTheme").update({state:()=>t.getTheme(),context:()=>({theme:t.getTheme(),themes:B,darkMode:l})})},[t?.getTheme(),l]);const T=ue(async function(S,O){let P=null;const M=t.getScripts();if(S?.declaration||S?.functionName){const A=S.declaration?S.declaration.getName():S.functionName;M.searchFunction({name:A}).length>0&&(P=A)}if(P)try{await M.executeMacro(P),b.current=Promise.resolve({source:null,name:P})}catch(A){return void o?.showError?.(A)}},[t,o]);s.useEffect(()=>{y.getCommand("newCellStyle").updateCallback(S=>{o?.showInputOptions?.({initialValue:(()=>{let O=0;for(;;){O++;const P=`Style ${O}`;try{return t.getStyles().validateStyleName(P,!0),P}catch{}}})(),title:y.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInputOption:async(O,P)=>{let M=null;try{t.getStyles().validateStyleName(O,!1)}catch(L){M=L.message}let A=t.getStyles().getNamed(O),D=M;return!D&&A&&(D=`Update style '${A.getName()}'.`),{valid:M===null,message:D}}}).then(({input:O,option:P})=>{const M=t.getSelectedSheet().getSelectedRange();if(P!=="Ok")return;const A=t.getStyles().setNamed({name:O,style:M.getCell().getStyle()});M.updateStyle({named:A.getName()})})}),y.getCommand("deleteCellStyle").updateCallback(S=>{S.delete()}),y.getCommand("modifyCellStyle").updateCallback(({named:S})=>{const O=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:S.getName(),style:O.getCell().getStyle()})}),y.getCommand("hideSheet").updateCallback(S=>{t.getSheetAt(S).setVisibility(z.ISheet.Visibility.Hidden)}),y.getCommand("deleteSheet").updateCallback(async S=>{t.getSheetAt(S??t.getSelectedSheetIndex())?.delete()}),y.getCommand("addSheet").updateCallback(S=>{t.getSheets().add({index:S,autoSelect:!0})}),y.getCommand("duplicateSheet").updateCallback(async S=>{(await t.getSheetAt(S??t.getSelectedSheetIndex())?.duplicate())?.select()}),y.getCommand("nextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("previousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectNextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectPreviousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectTheme").updateCallback(S=>{t.setTheme(S)}),y.getCommand("calculateAll").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("calculate").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("closeWorkbook").updateCallback(async()=>{await o?.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),y.getCommand("newWorkbook").updateCallback(()=>{g?.()}),y.getCommand("executeScript").updateCallback(T),y.getCommand("executeSelectedScript").updateCallback(T)},[t,o]);const _=ue(async S=>{let O=0,P=null,M="Find & Replace";S?.replace&&!S?.replaceOptions?.maxCount&&(M="Replace All");const A=await o?.showBusy?.(M);try{const D=S?.scope??"sheet";let L=null;const N=t.getSelectedSheet(),W={from:N.getSelectedCell(),...S.findOptions};if(L=D==="sheet"?t.getSelectedSheet().find(S.findText,W):t.find(S.findText,W),S.replace){const I=t.replace(L,S.replaceText,S.replaceOptions);O=I.count,S.replaceOptions.maxCount&&(P=I.last)}else{let I=L.next();I.done||(O++,P=I.value)}P?.select({autoFocus:!1}),A?.(),!S.replaceOptions.maxCount&&O>1&&o?.showMessage?.(`We replaced ${O} cells.`)}catch(D){A?.(),o?.showError?.(D)}return O},[t,n]),w=ue(S=>{const O={value:S,context:{selection:()=>{const P=t.getSelectedRanges(),M=[];for(let A=0;A<P.getCount();A++){const D=P.at(A).getFixed(!0).getCoords();M.push(D)}return t.getRanges(M)},getNames:()=>t.getNames()},onUpdate:async P=>{try{await P.select()}catch(M){o?.showMessage?.(M.message,{type:r0.Error})}}};return o.showWindow?.("namedDetails",O)},[o,t,n]);return s.useEffect(()=>{const S=(O=!1)=>{const P=t.getSelectedCell(),M={onFindOrReplace:_,onKeyDown:A=>{y.findCommandByEvent(A)!==y.getCommand("find")&&y.findCommandByEvent(A)!==y.getCommand("findReplace")||A.preventDefault()},findOptions:{},findText:P.toTextUnformatted(!0)};M.replace=O,o.showWindow?.("find",M,{disableAutoDestroy:!0})};y.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S()}),y.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S(!0)}),y.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const O={onInputOption:async P=>{try{await t.getRanges(P).select()}catch(M){o?.showMessage?.(M.message,{type:r0.Error})}},onKeyDown:P=>{y.findCommandByEvent(P)===y.getCommand("goto")&&P.preventDefault()},title:y.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(O)}),y.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async O=>{if(O)try{await O.select()}catch(P){o?.showError?.(P)}}),y.getCommand("addNamedReference")?.updateCallback(async function(O){w(null)}),y.getCommand("editNamedReference")?.updateCallback(async function(O){w(O)}),y.getCommand("deleteNamedReference")?.updateCallback(async function(O){O?.delete?.()}),y.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),Xt(t?.getView(),{onViewChange:S=>{y.getCommand("workbookViewToggleShowFormulaBar").update({state:S.isShowFormulaBar()}).updateCallback(()=>{S.setShowFormulaBar(!S.isShowFormulaBar())}),y.getCommand("workbookViewToggleShowTabs").update({state:S.isShowTabs()}).updateCallback(()=>{S.setShowTabs(!S.isShowTabs())}),y.getCommand("workbookViewToggleShowStatusBar").update({state:S.isShowStatusBar()}).updateCallback(()=>{S.setShowStatusBar(!S.isShowStatusBar())}),y.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:S.isShowHorizontalScrollbar()}).updateCallback(()=>{S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar())}),y.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:S.isShowVerticalScrollbar()}).updateCallback(()=>{S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar())})}}),s.useEffect(()=>{y.getCommand("fullScreenToggle").update({state:R,disabled:!E}).updateCallback(()=>{j()})},[R,E]),s.useEffect(()=>{const S=t.getProtection().isStructureAllowed();y.getCommand("hideSheet").update({disabled:f.length<=1||!S}),y.getCommand("deleteSheet").update({disabled:f.length<=1||!S})},[f,u]),y},wm=()=>{window.open(window.origin.toString(),"sheetxl-"+z.CommonUtils.uuidV4(),"popup=true")},Sm=s.memo(s.forwardRef((e,t)=>{const{movable:n,commands:o,disabled:r,sx:i,floatReference:l,...d}=e;Xt(n,{onAnyChange(g){}});const c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(g,x)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:l}),[r,l]),p=s.useMemo(()=>({variant:$t.Menuitem,...c,...u}),[c,u]),f=s.useMemo(()=>({commands:o,variant:$t.Menuitem,parentFloat:l,...u}),[o,u,l]),h=g=>{switch(g?.key()){case"moveToFront":return ye(a.jsx(Bb,{}));case"moveForward":return ye(a.jsx(Nb,{}));case"moveToBack":return ye(a.jsx(zb,{}));case"moveBackward":return ye(a.jsx(Vb,{}));case"toggleLockAspectRatio":return ye(a.jsx(J3,{}));case"formatDrawAlignLeft":return ye(a.jsx(e6,{}));case"formatDrawAlignCenter":return ye(a.jsx(Hb,{}));case"formatDrawAlignRight":return ye(a.jsx($b,{}));case"formatDrawAlignTop":return ye(a.jsx(Wb,{}));case"formatDrawAlignMiddle":return ye(a.jsx(Ub,{}));case"formatDrawAlignBottom":return ye(a.jsx(qb,{}));case"formatDrawDistributeHorz":return ye(a.jsx(Zb,{}));case"formatDrawDistributeVert":return ye(a.jsx(Gb,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ye(a.jsx(Q3,{}));default:return null}},m=a.jsxs(a.Fragment,{children:[a.jsx(ec,{command:o.getCommand("copy"),...p,variant:$t.Menuitem}),[],a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),a.jsx(o0,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ye(a.jsx(J3,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:g=>h(g)||ye(a.jsx(e6,{})),tooltip:"Quickly change the placement of your drawings."}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:g=>h(g)||ye(a.jsx(Q3,{})),tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return a.jsx(V.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...d,children:m})}));Sm.displayName="MovableContextMenu";const G_="_sheetxl-theme_4opcr_2",K_="_sheetxl-workbook_1j3lu_5",X_={fireOnModelChange:!1},fd={flex:"1 1 100%",display:"flex"},Y_=e=>a.jsx(Du,{...e}),J_=e=>a.jsx(Wu,{...e}),Q_=e=>a.jsx(Sm,{...e}),eT=e=>a.jsx(Uu,{...e}),tT=e=>a.jsx(Au,{...e}),nT=(e,t)=>a.jsx(Pu,{ref:t,...e}),oT=e=>a.jsx(il,{...e}),rT=(e,t)=>a.jsx(Z9,{ref:t,...e}),Cm=s.memo(s.forwardRef((e,t)=>{const{workbook:n,createWorkbookOptions:o,onNewWorkbook:r,onElementLoad:i,notifier:l,autoFocus:d=!1,sx:c,style:u,className:p,onFocus:f,onBlur:h,onKeyDown:m,onRepeatCommandChange:g,commands:x,showFormulaBar:y,formulaBarProps:v,renderFormulaBar:b=nT,showTabs:C,tabsProps:k,renderTabs:E=J_,showStatusBar:R,statusBarProps:j,renderStatusBar:B=Y_,toolbarProps:T,renderToolbar:_=bm,contextMenuSx:w,renderContextMenu:S=eT,renderFilterMenu:O=tT,renderMovableMenu:P=Q_,renderLoadingPanel:M=oT,loadingPanelProps:A,sheetProps:D,renderSheet:L=rT,showHorizontalScrollbar:N,showVerticalScrollbar:W,gridTheme:I,headersTheme:U,forceLightImages:G,...Q}=e,H=qr(),$=wu(),F=s.useMemo(()=>{const Se={theme:$.getDefaultTheme(),...o};return n??new z.Workbook(Se)},[n]),X=s.useRef(null),[K,ne]=s.useState(!1),J=s.useRef(null),re=s.useMemo(()=>a.jsx(V.Box,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:J}),[]),[fe,ie]=s.useState(!1),[ee,pe]=s.useState(!1),Te=s.useCallback(()=>{ie(!0)},[]),Ae=s.useRef(null),ae=Ro(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>F,getSheetElement:()=>X.current,getViewportElement:()=>J.current,getFormulaBarElement:()=>Ae.current,focus(){X&&X.current&&X.current.focus()}}),[F]),he=s.useRef(null);s.useLayoutEffect(()=>{fe&&ae.current&&(pe(!0),he.current!==i&&(i?.({source:ae.current}),he.current=i))},[fe,ae.current]),ae.current;const we=s.useCallback(Se=>(X.current?.submitEdit(),!0),[]),He=s.useCallback(()=>{requestAnimationFrame(()=>{X?.current?.focus()})},[]),[Ye,wt]=s.useState(F?.getSelectedSheet()),[Ct,Ee]=s.useState(F?.getProtection());Xt(F,{onSheetsChange:Se=>{wt(Se?.getSelectedSheet())},onViewChange(Se){wt(Se?.getSelectedSheet())},onProtectionChange:Se=>{Ee(Se?.getProtection())}}),Xt(F,{onRequestSelect:async(Se,xt)=>new Promise(jt=>{X.current.getSheet()!==xt?X.current.getGridElement()?.onViewChangeOnce(()=>{X.current.getSheet()!==xt&&jt(!1),jt(!0)}):jt(!0)})},X_);const[Ie,ft]=s.useReducer(Se=>Se+1,0),$e=F?.getView();Xt($e,{onViewChange:Se=>{ft()}});const yt=I??H,tt=s.useMemo(()=>E2(H,yt),[H,yt]),oe=U??H,Ve=s.useMemo(()=>E2(H,oe),[H,oe]),[xe,be]=s.useState(null);s.useCallback(()=>{X.current.focus()},[]);const[te,Me]=s.useState(!1),_e=s.useRef(null),ve=vm({workbook:F,workbookElement:ae.current,commandTarget:()=>X.current,notifier:l,commands:x,darkMode:tt.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{te?_e.current?.focus():Me(!0)}}),Oe=s.useRef(null),[Y,se]=s.useState(!1),[Ce,Pe]=s.useState(null),[Qe,Ge]=s.useState(mc),[Be,ot]=s.useState(z.TypesUtils.EmptyBounds),Ze=()=>{se(!1),Pe(null)},et=(Se,xt,jt=mc)=>{ot(Se),Ge(jt),Pe(xt),Oe.current!==null&&Oe.current.update(),se(!0)},[mt,pt]=s.useState("sheet"),it=C??$e?.isShowTabs(),Wt=N??$e?.isShowHorizontalScrollbar(),qt=y??$e?.isShowFormulaBar(),Vt=R??$e?.isShowStatusBar(),nn=W??$e?.isShowVerticalScrollbar(),bn=tt?.header?.edgeStrokeFill||"rgb(171,171,171)",kn=s.useMemo(()=>Vt?B({sheet:Ye,gridStyle:tt,...j}):null,[B,j,Vt,tt,Ye]),Gn=s.useMemo(()=>_({commands:ve,workbook:ae.current,...T}),[ve,_,T,H]),[eo,{width:Tn}]=Ra(),dt=Tn===0||Tn>560,Jt=s.useMemo(()=>{if(!it)return null;let Se=E({background:tt.body.fill,borderWidth:1,borderColor:bn,gridTheme:yt,gridStyle:tt,onBeforeUserChange:we,onUserChange:He,workbook:F,commands:ve,sheetTabProps:{},notifier:l,...k});return dt||(Se=a.jsx("div",{style:{flex:"none",display:"flex"},children:Se})),Se},[E,k,l,H,F,yt,dt,ve,it]),Sn=s.useCallback(Se=>{const xt=z.CommonUtils.getOS()===z.CommonUtils.OSType.Firefox;let jt=null,un=null,tn=null;if(Wt&&(un=a.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${bn} 1px`,maxWidth:"100%"},children:a.jsx(k1,{style:{alignItems:"center",borderTop:(xt?6:3)+"px solid transparent",borderBottom:(dt?6:3)+"px solid transparent",borderLeft:(xt?3:0)+"px solid transparent",borderRight:(xt?3:0)+"px solid transparent"},...Se,endGap:700,sheet:Ye,showCustomScrollButtons:!xt,onShowTooltip:St=>{et({x:St.anchor.x,y:St.anchor.y,width:0,height:0},St.display,St.placement)},onCloseTooltip:()=>Ze()})})),it&&dt&&(tn=Jt),it&&dt&&!Wt&&(tn=a.jsxs(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[tn,a.jsx(V.Box,{sx:{borderTop:`solid ${bn} 1px`,flex:"1"}})]})),tn&&Wt)jt=a.jsx(kd,{position:F.getView().getTabRatio()/10+"%",onPositionChange:({percent:St})=>{F.getView().setTabRatio(Math.round(10*St))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${H.palette.text.icon??H.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${bn} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:tn,elementAfter:un});else if(Wt)jt=un;else{if(!tn)return a.jsx(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:Vt?null:`solid ${bn} 1px`}});jt=tn}return a.jsx(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:jt})},[Ye,we,F,tt,yt,ve,it,Wt,Vt,dt]),[vn,En]=s.useState(null),on=s.useMemo(()=>({placement:"right-start",...vn?.popperProps}),[vn?.popperProps]),{reference:to,component:_o}=i0({label:"contextMenu",popperProps:on,anchor:vn?.anchor??{getBoundingClientRect:()=>new DOMRect(vn?.clientX||0,vn?.clientY||0)},onClose:()=>En(null),createPopupPanel:vn?.createPopupPanel});s.useEffect(()=>{vn?to.open(0):to.close(0)},[vn]);const Vo=ue((Se,xt)=>{if(Se?.isDefaultPrevented())return!0;Se.preventDefault(),vn&&vn.anchor===Se.currentTarget?En(null):En({anchor:Se.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:jt=>{const{floatReference:un}=jt;return O({filter:xt,commands:ve,floatReference:un,sx:{...w}})}})},[O,w,ve,F,vn]),Zo=ue(Se=>{if(Se.originalEvent?.isDefaultPrevented())return!0;Se.originalEvent?.preventDefault(),En({clientX:Se.clientX,clientY:Se.clientY,createPopupPanel:xt=>{const{floatReference:jt}=xt;return S({commands:ve,workbook:F,floatReference:jt,sx:{...w}})}})},[S,w,ve,F]),Or=ue((Se,xt)=>{if(Se?.isDefaultPrevented())return!0;Se.preventDefault(),En({clientX:Se.clientX,clientY:Se.clientY,createPopupPanel:jt=>{const{floatReference:un}=jt;return P({movable:xt,commands:ve,floatReference:un,sx:{...w}})}})},[P,w,ve]);s.useMemo(()=>{const Se=[new vt("openContextMenu",()=>X.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[ke.Shift]},{key:"ContextMenu"}]})];ve.addCommands(Se,!0)},[ve]),s.useEffect(()=>{ve.getCommand("openContextMenu").updateCallback(()=>{const Se=Ye.getSelection().getCoords().cell;X.current?.getGridElement()?.scrollCellCoordsIntoView(Se).then(xt=>{requestAnimationFrame(()=>{const jt=Ye.getView().getZoomScale()/100,un=Ye.getColumnHeaders().findOffset(Se.colIndex+1)*jt,tn=Ye.getRowHeaders().findOffset(Se.rowIndex+1)*jt,St=X.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};Zo({clientX:un-St.x-xt.left+6,clientY:tn-St.y-xt.top+6})})})})},[Ye]);const Go=ue(Se=>{ve?.dispatchToFocusedCommand(Se)},[ve]),wr=ue(()=>{ae.current},[F,ae.current]),Zr=s.useCallback(()=>{pt("sheet")},[]),Sr=s.useCallback(()=>{pt("formulaBar")},[]),Oo=ue(Se=>{const xt=z.CommonUtils.getOS()===z.CommonUtils.OSType.Firefox;return a.jsx(k1,{style:{borderLeft:"3px solid transparent",borderRight:"0px solid transparent",borderTop:(xt?3:0)+"px solid transparent",borderBottom:(xt?3:0)+"px solid transparent",width:xt?"13px":void 0},...Se,sheet:Ye,endGap:700,showCustomScrollButtons:!xt,onShowTooltip:jt=>{et(jt.anchor,jt.display,Rg)},onCloseTooltip:()=>Ze()})},[Ye]);s.useEffect(()=>{d&&X&&X.current&&X.current.focus()},[]);const[ze,rt]=s.useState(null),lt=s.useCallback(Se=>{ve?.getCommand("openWorkbook")&&(Se.type==="dragenter"||Se.type==="dragover"?Se.dataTransfer?.types.includes("Files")?Se.dataTransfer.files[0]?.type?.startsWith("image/")||Se.dataTransfer.items[0]?.type?.startsWith("image/")||Se.dataTransfer.types.length===1&&rt("Drop to open"):(Se.dataTransfer?.types.includes("text/html")||Se.dataTransfer?.types.includes("text/plain"),Se.dataTransfer.effectAllowed="none",Se.dataTransfer.dropEffect="none"):Se.type==="dragleave"&&rt(null),Se.preventDefault())},[ve]),Ke=ue(Se=>{if(ve?.getCommand("openWorkbook")&&(Se.preventDefault(),Se.stopPropagation(),rt(null),Se.dataTransfer.files&&Se.dataTransfer.files.length>0)){const xt=Se.dataTransfer.files[0];if(!xt)return;if(xt?.type?.startsWith("image/")){const jt=X.current?.getGridElement().getViewFromClient(Se.clientX,Se.clientY);if(!jt)return;const un=jt.getRelativePointFromClient(Se.clientX,Se.clientY),tn=jt.toAbsoluteBounds({...un,width:0,height:0}),St=jt.getCellCoordsFromClient(Se.clientX,Se.clientY);if(!St)return;ve?.getCommand("insertImageFromFile")?.execute({file:xt,options:{bounds:{x:tn.x,y:tn.y}},goto:{range:{...St}}})}else ve?.getCommand("openWorkbook")?.execute(xt)}},[ve,ze]),st=s.useMemo(()=>ze?a.jsx(V.Box,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:Se=>Se.palette.divider,color:Se=>Se.palette.primary.dark},children:a.jsx(V.Typography,{variant:"h4",children:ze})}):null,[ze]),kt=s.useRef(null),Tt=s.useMemo(()=>a.jsx(k2,{in:!ee,nodeRef:kt,timeout:500,classNames:"animating",unmountOnExit:!0,children:M({ref:kt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:ee?0:c?.opacity,pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...A}})}),[ee,M,A]),Et=s.useMemo(()=>b({sx:{marginTop:Se=>Se.spacing(.25),marginLeft:Se=>Se.spacing(1),marginRight:Se=>Se.spacing(1)},workbook:F,sheetElement:X.current,gridStyle:tt,onFocus:Sr,...v,NamedCollectionEditorProps:{restoreFocus:Se=>X.current.focus(Se),notifier:l,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:ve,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},Ae),[b,v,F,tt,ve,ee]),It=s.useCallback(Se=>{const{movable:xt,...jt}=Se,un={movable:xt,onContextMenuCapture:Gt=>{Or(Gt,xt)},...jt},tn=xt.getContent().getType();let St=null;if(tn==="picture")return a.jsx(G9,{loadingPanel:a.jsx(il,{transitionDelay:"100",style:{position:"absolute"},sx:{border:Gt=>`solid 1px ${Gt.palette.action.active}`}}),picture:xt.getContent(),description:xt.getDescription()??xt?.getName(),...un});if(tn==="chart"){const Gt={...un,chart:xt.getContent()};return a.jsx(Gk,{...Gt})}if(St=`Float of type '${tn}'.`,typeof St=="string"){const Gt={...un,description:St};St=a.jsx(Bk,{...Gt})}return a.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:St},xt.getUUID())},[]),Mt=s.useMemo(()=>L({style:fd,onFocus:Zr,notifier:l,gridStyle:tt,headersStyle:Ve,sheet:Ye,commands:ve,onSheetContextMenu:Zo,onViewportChange:Se=>{be(Se)},showScrollbars:!1,viewportComponent:re,onRepeatCommandChange:g,onElementLoad:Te,onShowColumnTooltip:Se=>{et(Se.anchor,Se.display,mc)},onShowRowTooltip:Se=>{et(Se.anchor,Se.display,Cd)},onShowTooltip:Se=>{et({x:Se.anchor.x,y:Se.anchor.y,width:0,height:0},Se.display,Se.placement)},onCloseTooltip:()=>Ze(),renderMovable:It,...D,cellRenderProps:{onFilterButtonMouseDown:(Se,xt)=>{D?.cellRenderProps?.onFilterButtonMouseDown(Se,xt),Vo(Se,xt)},...D?.cellRenderProps}},X),[L,ve,D,Ye,tt,l,g]),rn=s.useMemo(()=>{if(!te)return null;const Se=!Ct.isStructureAllowed();return a.jsx(Hu,{sx:{marginBottom:xt=>xt.spacing(.5),border:xt=>`solid ${Se?xt.palette.action.disabled:gt.alpha(xt.palette.divider,.2)} 1px`,borderRadius:xt=>`${xt.shape.borderRadius}px`,overflow:"hidden"},onClose:()=>{Me(!1),requestAnimationFrame(()=>{X.current.focus()})},readOnly:Se,commands:ve,ref:_e,scripts:F.getScripts()})},[te,ve,F,l,Ct]),Cn=s.useMemo(()=>{const Se=a.jsx(M2,{style:{...fd,marginRight:rn&&dt?"0px":"6px"},viewport:xe,touchElement:X.current?.getGridElement()?.stage,onScrollViewport:St=>{X.current?.getGridElement()?.scrollTo(St)},showHorizontalScrollbar:Wt||it,showVerticalScrollbar:nn,createHorizontalScrollbar:Sn,createVerticalScrollbar:Oo,children:Mt});let xt=Se;dt||(xt=a.jsxs(a.Fragment,{children:[Se,Jt]}));let jt=null,un=4,tn=13;return dt?jt="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(jt="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",un=13,tn=4),a.jsx(kd,{fixedPane:"after",position:"40%",minAfter:dt?"280px":"120px",splitDirection:dt?"row":"column",style:fd,ref:eo,resizerProps:{className:"styled-resizer",style:{minWidth:dt?"6px":void 0,minHeight:dt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${un}' height='${tn}' viewBox='0 0 ${un} ${tn}' version='1.1' fill='${H.palette.text.icon??H.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${jt}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:dt?"left center":"top center"}},elementBefore:xt,paneBeforeProps:{style:{flexDirection:"column"}},elementAfter:rn,paneAfterProps:{style:{marginLeft:dt?"0px":"4px",marginRight:dt?"8px":"4px"}}})},[Wt,it,Sn,nn,xe,rn,Mt,Jt,H,dt]),dn=s.useMemo(()=>({boxSizing:"border-box",background:Se=>Se.palette.mode!=="dark"?tt.header.fill:Se.palette.background.paper,"& *":{...J2(H),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${bn} 1px`},...c}),[c,tt]);return a.jsxs(V.Paper,{className:Qn("sheetxl-workbook",K_,{"Mui-focusVisible":K},G_,p),sx:dn,style:u,square:!1,...Q,ref:ae,onFocus:Se=>{ne(!0),wr(),f?.(Se)},onBlur:Se=>{ne(!1),h?.(Se)},onKeyDown:Se=>{Go(Se),m?.(Se)},onDragStart:Se=>{if(Se.target.src){const xt=new Image;xt.src=Se.target.src,Se.dataTransfer.setDragImage(xt,1,1)}},onDragEnter:lt,onDragLeave:lt,onDragOver:lt,onDrop:Ke,children:[a.jsxs("div",{className:Qn(qf),style:{flex:"1 1 100%",display:"flex",flexDirection:"column",opacity:ee?void 0:0,"--sxl-app-color-high-contrast":H.palette.primary.main,"--sxl-app-color-primary":H.palette.primary.main,"--sxl-app-color-primary-dark":H.palette.primary.dark,"--sxl-app-color-primary-light":H.palette.primary.light,"--sxl-app-color-info":H.palette.info.main,"--sxl-app-color-info-dark":H.palette.info.dark,"--sxl-app-color-info-light":H.palette.info.light,"--sxl-app-color-secondary":H.palette.secondary.main,"--sxl-app-color-secondary-dark":H.palette.secondary.dark,"--sxl-app-color-secondary-light":H.palette.secondary.light,"--sxl-app-color-success":H.palette.success.main,"--sxl-app-color-success-dark":H.palette.success.dark,"--sxl-app-color-success-light":H.palette.success.light,"--sxl-app-color-warning":H.palette.warning.main,"--sxl-app-color-warning-dark":H.palette.warning.dark,"--sxl-app-color-warning-light":H.palette.warning.light,"--sxl-app-color-error":H.palette.error.main,"--sxl-app-color-error-dark":H.palette.error.dark,"--sxl-app-color-error-light":H.palette.error.light,"--sxl-app-color-text":H.palette.text.primary,"--sxl-app-color-text-secondary":H.palette.text.secondary,"--sxl-app-color-text-disabled":H.palette.text.disabled,"--sxl-app-color-background":H.palette.background.paper,"--sxl-app-color-button-surface":H.palette.grey[600],"--sxl-app-color-shadow":H.palette.action.focus,"--sxl-app-color-grey":H.palette.grey[500],"--sxl-app-filter-dark-invert":tt.body.darkMode&&!G?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":tt.body.darkMode?`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`:void 0},children:[Gn,qt?Et:null,a.jsx(V.Box,{sx:{marginBottom:Se=>Se.spacing(.75)}}),Cn,kn,a.jsx(vr,{arrow:!0,disableInteractive:!0,open:Y,title:a.jsx(V.Typography,{variant:"subtitle2",component:"div",children:Ce}),placement:Qe,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:Oe,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:Y?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(Be.x,Be.y,Be.width,Be.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:a.jsx(V.Box,{})}),_o,st]}),Tt]})}));Cm.displayName="WorkbookElement";const iT=(e=!1,t=!1)=>t?null:{"& input:not(:focus):not(:hover)":{color:n=>n.palette.text.secondary},backgroundColor:n=>gt.alpha(n.palette.background.paper,.6),borderRadius:n=>`${n.shape.borderRadius}px`,border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:n=>n.palette.background.paper},"&:hover:not([disabled])":{border:n=>`solid ${e?n.palette.text?.primary:n.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:n=>`solid ${n.palette.primary.main} 1px !important`,border:n=>`1px solid ${n.palette?.primary?.main} !important`}},km=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,title:r="",placeHolder:i="Untitled",onTitleChange:l,readOnly:d=!1,hidden:c,...u}=e,[p,f]=s.useState(!1),[h,m]=s.useState(!1),[g,x]=s.useState(r??""),[y,v]=s.useState(""),[b,{width:C}]=Ra(),[k,{width:E}]=Ra(),[R,j]=s.useState(!1),B=s.useRef(null),T=s.useRef(null),_=Ro(t,()=>({requestWorkbookTitle:(w=null,S)=>{T.current={onAccept:w,requestReason:S?.requestReason},S?.selectAll&&B.current?.select(),B.current?.focus(S)},focus:w=>{B.current?.focus(w)}}),[]);return s.useLayoutEffect(()=>{j(r!==g),v(r),x(r)},[r]),s.useEffect(()=>{R&&C!==0&&Ht.debounce(()=>{j(!1)},300)()},[R,C]),s.useEffect(()=>{m(g&&!ei.isValidWindowsFilename(g))},[g]),c?null:a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:R?"0":"1",transition:R?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:nc([_,k,t]),...u,children:a.jsx(No,{label:T.current?.requestReason??"Workbook Name",children:a.jsxs(V.Box,{className:Qn({"Mui-focusVisible":p}),sx:{visibility:C===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...iT(!0,d),...n},children:[d?a.jsx(V.Typography,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:g!==y?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:w=>h?w.palette.error.dark:void 0},children:r??i}):a.jsx(V.Input,{sx:{width:`${Math.min(C+3,Math.max(E,_.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:w=>h?w.palette.error.dark:void 0,fontStyle:g!==y?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:d,spellCheck:!1,placeholder:i,onFocus:w=>{f(!0),w.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:B},onBlur:()=>{f(!1),h?x(y):(g!==y&&(l?.(g),g&&T.current?.onAccept?.(g,"blur")),T.current=null)},onChange:w=>{if(w.target.value.length>ei.MAX_WORKBOOK_NAME_SIZE)return w.stopPropagation(),void w.preventDefault();x(w.target.value)},onKeyDown:w=>{(ei.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(w.key)||w.target?.value.length>ei.MAX_WORKBOOK_NAME_SIZE)&&w.preventDefault(),w.which===Zt.Enter||w.which===Zt.Tab?(h?x(y):(l?.(g),g&&(T.current?.onAccept?.(g,"keydown"),T.current=null)),w.stopPropagation(),w.preventDefault(),o?.focus()):w.which===Zt.Escape&&(g===y?o?.focus():(x(y),setTimeout(()=>{w.target?.select()},0)),T.current=null,w.stopPropagation(),w.preventDefault())},value:g}),a.jsx(V.Box,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:g!==y?"italic":void 0,fontFamily:w=>w.typography.fontFamily,letterSpacing:"0.00938em"},children:g||i})]})})})}));km.displayName="WorkbookTitle";const lT=s.lazy(()=>Promise.resolve().then(()=>require("./CTcK6J2u4hz3iU3I.cjs")).then(e=>e.EagerStandaloneWorkbook)),Em=s.memo(s.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,...l}=e;return i&&z.LicenseManager.setLicenseKey(i),a.jsx(a.Fragment,{children:a.jsx(lT,{...l,className:r,sx:n,style:o,ref:t})})}));Em.displayName="StandaloneWorkbook";const aT=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],sT=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class _m{constructor(t=aT,n=sT){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const t=[],n=this._readFormatType;for(let o=0;o<n.length;o++)for(let r=0;r<n[o].exts.length;r++)t.push("."+n[o].exts[r]);return t}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");try{return(await Promise.resolve().then(()=>f8)).WorkbookIO.writeFile(t,n,o)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(t,n){let o,r;const i=await n?.showBusy?.(`Opening${t.name?` ${t.name}`:""}...`);try{r=await Promise.resolve().then(()=>f8)}catch(l){throw l}try{return await r.WorkbookIO.read({...t,async onStart(l){await t?.onStart?.(l),o=await n?.showBusy?.(`Opening '${l}'...`)}})}catch(l){throw i?.(),o?.(),l}finally{i?.(),o?.()}}}const cT=new _m;exports.$i=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),a.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.A0=Mo,exports.AppearanceCommandButton=b_,exports.AutoColorPosition=Wi,exports.Be=Ys,exports.Bi=Gh,exports.Bn=kp,exports.BorderCommandButton=Rf,exports.BorderPopupButton=Mf,exports.BorderStyleButton=jf,exports.Checkboard=_f,exports.ClearCommandButton=ku,exports.ColorButton=Q1,exports.ColorCommandButton=ol,exports.ColorPanel=Tf,exports.ColorPanelType=Ef,exports.ColorPopupButton=Cu,exports.D8=e2,exports.DeleteCellsCommandButton=_u,exports.DocThemeCommandButton=Qf,exports.E5=ds,exports.Fi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),a.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.FillCommandButton=Af,exports.FilterColumnMenu=Au,exports.FilterCommandButton=f_,exports.Filters=cm,exports.FindCommandButton=Lf,exports.FontFamilyCommandButton=Bf,exports.FontSizeCommandButton=Of,exports.FormulaBar=Pu,exports.FreezeCommandButton=Df,exports.He=rl,exports.HelpCommandButton=v_,exports.Hi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731423 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605952 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z "}),a.jsx("path",{className:"styled secondary_light",d:"m 7.7187557,5.6810989 h 3.9153913 c 0.116687,0 0.211776,0.096094 0.211776,0.2127813 v 0.8457422 c 0,0.1166881 -0.09489,0.2117769 -0.211776,0.2117769 H 7.7187557 c -0.116688,0 -0.2117768,-0.094892 -0.2117768,-0.2117769 V 5.8938802 c 0,-0.116688 0.094893,-0.2127813 0.2117768,-0.2127813 z M 8.7772903,9.7481656 V 12.094422 H 13.203582 V 9.7481656 Z m 0,3.6164134 v 2.346263 H 13.203582 V 13.364579 Z M 14.473445,12.094422 H 17.03249 V 9.7481656 h -2.559045 z m 2.559045,1.270157 h -2.559045 v 2.346263 h 2.559045 z m 1.270159,-3.8291948 v 7.2330098 c 0,0.116688 -0.09489,0.211766 -0.211767,0.211766 H 7.7185701 c -0.116688,0 -0.2117768,-0.09489 -0.2117768,-0.211766 V 8.6898058 c 0,-0.116688 0.094893,-0.2117769 0.2117768,-0.2117769 H 18.090882 c 0.116688,0 0.211767,0.094893 0.211767,0.2117769 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.HorizontalAlignCommandButton=Fp,exports.Ie=Mh,exports.Ii=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),a.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),a.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.InsertCellsCommandButton=Eu,exports.InsertImageCommandButton=Ru,exports.InsertScriptCommandButton=xm,exports.Ka=dv,exports.L5=_n,exports.Li=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),a.jsx("path",{className:"styled secondary_light",d:"M 10.363689,16.028891 10.345659,15.996611 9.4734966,14.37091 8.5619879,16.028912 H 7.3633702 L 8.8418569,13.567063 7.3668314,10.90392 H 8.63729 l 0.018027,0.03581 0.872161,1.729842 0.907731,-1.765668 h 1.198618 l -1.478485,2.616296 1.482266,2.512154 z m 4.665607,0 h -2.953777 v -5.124987 h 1.137804 l -2.54e-4,4.102093 h 1.833979 z m 3.309014,-0.330196 h -2.55e-4 c -0.364996,0.290393 -0.822367,0.439348 -1.288281,0.419821 -0.483409,-0.01051 -0.964575,-0.07059 -1.43568,-0.179494 l -0.319438,-0.06109 0.118416,-0.907988 h 0.06109 c 0.496925,0.07435 0.997838,0.118671 1.500281,0.132932 0.484409,0 0.717711,-0.193763 0.717711,-0.585048 0.0084,-0.126168 -0.05033,-0.247587 -0.154462,-0.319436 -0.217293,-0.125426 -0.451866,-0.218549 -0.696178,-0.276375 -0.450111,-0.10039 -0.871457,-0.302915 -1.230924,-0.592056 -0.250844,-0.261105 -0.380767,-0.61484 -0.358989,-0.976048 -0.03205,-0.442856 0.145944,-0.875173 0.480903,-1.16658 0.372757,-0.27187 0.827876,-0.4063 1.288473,-0.380266 0.468637,0.0088 0.935799,0.05808 1.396139,0.147202 l 0.322941,0.06109 -0.09338,0.922278 h -0.0646 c -0.685413,-0.07536 -1.17709,-0.1149 -1.456957,-0.1149 -0.739246,0 -0.739246,0.35899 -0.739246,0.46663 v -2.53e-4 c -2.54e-4,0.124163 0.06334,0.239575 0.168479,0.305162 0.293896,0.149452 0.601566,0.269614 0.918754,0.35899 0.387778,0.100895 0.747253,0.288643 1.05167,0.548998 0.22756,0.265109 0.339963,0.610077 0.312175,0.958295 0.03504,0.464132 -0.141691,0.919267 -0.480905,1.238164 z m 3.631947,0.330195 v -0.03228 l -0.879468,-1.625958 -0.911511,1.658 -1.1951,2.55e-4 1.482273,-2.461843 -1.475286,-2.663143 h 1.270463 l 0.01803,0.0358 0.872162,1.729842 0.907988,-1.765667 h 1.184331 l -1.478492,2.616295 1.482272,2.512152 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.MergeCommandButton=If,exports.NamedCollectionEditor=Ou,exports.NamedInput=nm,exports.NumberFormatCommandButton=Pf,exports.PasteCommandButton=Mu,exports.PresetCellStylesCommandButton=Uf,exports.PresetTableStylesCommandButton=Kf,exports.Qt=je,exports.QuickFormulaSumCommandPopupButton=w_,exports.RangeInput=om,exports.Rd=wu,exports.RunScriptCommandButton=$u,exports.ScriptEditorToolbar=Vu,exports.ScriptWorkspace=Hu,exports.SheetTab=Fu,exports.SheetTabMenu=zu,exports.SheetZoomScale=Iu,exports.SheetsAllMenu=Bu,exports.So=({manager:e,commands:t,disabled:n,notifier:o=Ys})=>{const r=ue(l=>{try{e?.undo(l)}catch(d){o.showError?.(d)}},[e]),i=ue(l=>{try{e?.redo(l)}catch(d){o.showError?.(d)}},[e]);return s.useMemo(()=>{if(!t)return;const l={contains:c=>!0,focus(){}},d=[new je("undo",l,{label:"Undo",description:D5,shortcut:{key:"z",modifiers:[ke.Ctrl]},disabled:!0},r),new je("redo",l,{label:"Redo",description:L5,shortcut:[{key:"y",modifiers:[ke.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[ke.Alt]}],disabled:!0},i)];t?.addCommands(d,!0)},[t]),s.useEffect(()=>{if(!t)return;const l=()=>{const c=e?.getTopUndoDescription(),u={};var p;t.getCommand("undo").update({disabled:n||!e||!e.hasUndo(),description:c?(p=c,`Undo ${p}`):D5,state:u,context:{undoManager:e}});const f=e?.getTopRedoDescription();t.getCommand("redo").update({disabled:n||!e||!e.hasRedo(),description:f?Ng(f):L5,state:u,context:{undoManager:e}})};if(l(),!e)return;const d=e.addListener({onStackChange(){l()}});return()=>d?.()},[e,t,n]),{undo:r,redo:i}},exports.SortFilterCommandButton=Tu,exports.StandaloneWorkbook=Em,exports.StatusBar=Du,exports.StyledStrokeIcon=S2,exports.T=ue,exports.THEME_ID=A0,exports.TableStyleCanvasPreview=Gf,exports.TableStyleOptionsPanel=x_,exports.TableStylePreview=Zf,exports.TextEffectsCommandButton=Nf,exports.TextOverflowCommandButton=Bp,exports.TextRotateCommandButton=Np,exports.ThemeMode={Light:"light",Dark:"dark"},exports.ThemeProvider=t9,exports.ThemeSelectButton=Xf,exports.ThemeSelectPanel=Yf,exports.ThemeSelectPopupButton=Jf,exports.Ui=e=>a.jsx(V.SvgIcon,{...e,children:a.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.UnderlineCommandButton=Vf,exports.UndoRedoCommandButton=ju,exports.VerticalAlignCommandButton=zp,exports.Vi=e=>a.jsx(V.SvgIcon,{...e,children:a.jsx("path",{d:"m 21.230627,10.984379 c -0.103549,0.265939 -0.204749,0.531861 -0.308302,0.80018 -0.244758,0.640136 -0.491882,1.277905 -0.736619,1.918041 -0.296532,0.77195 -0.595423,1.546223 -0.891972,2.31813 -0.256524,0.666043 -0.513056,1.332042 -0.769584,2.000408 -0.122381,0.320068 -0.244757,0.640136 -0.369488,0.960183 -0.0071,0.01647 -0.01412,0.03295 -0.01883,0.04942 0.0306,-0.07531 0.06355,-0.15062 0.09414,-0.22593 -0.05884,0.138855 -0.129439,0.273001 -0.218868,0.393024 0.04942,-0.06354 0.09885,-0.127085 0.148266,-0.190629 -0.05884,0.07531 -0.122381,0.141204 -0.197691,0.200041 0.06354,-0.04942 0.127084,-0.09885 0.190629,-0.148266 -0.05648,0.04001 -0.112965,0.07531 -0.17651,0.103549 0.07531,-0.0306 0.150621,-0.06355 0.225931,-0.09414 -0.08002,0.03295 -0.160037,0.05413 -0.244758,0.06825 0.08237,-0.01177 0.167093,-0.02353 0.249466,-0.03295 -0.17651,0.02354 -0.360077,0.01177 -0.536596,0.01177 H 16.596651 12.981767 8.5974282 4.7848441 c -0.6071714,0 -1.2143859,0.0047 -1.8239241,0 -0.037655,0 -0.07531,-0.0024 -0.115319,-0.0047 0.082372,0.01177 0.1670935,0.02353 0.2494657,0.03295 -0.070602,-0.0094 -0.1388548,-0.02824 -0.204749,-0.05177 0.07531,0.03059 0.1506203,0.06354 0.2259303,0.09414 -0.063545,-0.02824 -0.1247306,-0.06119 -0.1812132,-0.1012 0.063544,0.04942 0.1270848,0.09885 0.1906293,0.148266 -0.063544,-0.04942 -0.120027,-0.105903 -0.1694477,-0.169447 0.080018,0.138854 0.1623858,0.277705 0.2424039,0.416559 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023534,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063544,-0.216514 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.22593 0.1529742,-0.338895 0.2777048,-0.689539 0.4094974,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366189,-1.915717 0.2965322,-0.771949 0.593056,-1.546223 0.8919727,-2.31813 0.2565232,-0.670733 0.5154222,-1.3391 0.7719499,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765505,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.225931 0.058836,-0.131793 0.1270845,-0.256524 0.2141645,-0.371843 -0.049421,0.06354 -0.098846,0.127085 -0.1482661,0.190629 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223576 -0.063544,0.04942 -0.1270845,0.09885 -0.190629,0.148266 0.070602,-0.05413 0.1435581,-0.09649 0.2259303,-0.134146 -0.07531,0.03059 -0.1506203,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670939,0.02353 -0.2494658,0.03295 0.1718016,-0.02118 0.3506609,-0.0094 0.5224799,-0.0094 h 1.1014247 3.6642876 4.441143 3.777253 c 0.569517,0 1.139076,-0.0024 1.708592,0 0.09414,0 0.19063,0.0024 0.284768,0.01412 -0.08237,-0.01177 -0.167094,-0.02353 -0.249466,-0.03295 0.06119,0.0094 0.122381,0.02353 0.178859,0.04472 -0.07531,-0.03059 -0.15062,-0.06354 -0.22593,-0.09414 0.0353,0.01412 0.06589,0.03295 0.09649,0.05413 -0.06354,-0.04942 -0.127084,-0.09885 -0.190629,-0.148267 0.01883,0.01647 0.0353,0.03059 0.04942,0.04942 -0.04942,-0.06354 -0.09885,-0.127085 -0.148266,-0.190629 0.01412,0.01883 0.02589,0.04001 0.03765,0.06354 -0.03059,-0.07531 -0.06354,-0.15062 -0.09414,-0.22593 0.01177,0.03295 0.02118,0.06354 0.02589,0.09885 -0.01177,-0.08237 -0.02353,-0.167094 -0.03295,-0.249466 0.0024,0.04001 0.0024,0.08002 -0.0024,0.122381 0.01177,-0.08237 0.02353,-0.167094 0.03295,-0.249466 -0.01647,0.112965 -0.05177,0.221223 -0.09414,0.32713 0.03059,-0.07531 0.06354,-0.15062 0.09414,-0.22593 -0.0047,0.01412 -0.01177,0.02589 -0.01647,0.04001 -0.06825,0.108258 -0.105904,0.223577 -0.110612,0.350661 -0.02824,0.124731 -0.02353,0.249466 0.01647,0.376551 0.06119,0.218868 0.228284,0.454227 0.433011,0.562459 0.218868,0.115319 0.482458,0.174155 0.72487,0.09414 0.216515,-0.0706 0.468343,-0.214164 0.562459,-0.433011 0.07296,-0.171802 0.162386,-0.348312 0.197691,-0.534229 0.04707,-0.254169 0.05884,-0.449493 0.0071,-0.698963 C 23.085384,10.14653 22.838276,9.83117 22.534673,9.68055 22.233432,9.527576 21.908652,9.485213 21.572124,9.482859 h -0.400086 -2.167511 -3.348932 -3.68077 -3.2453915 -1.96512 c -0.1341464,0 -0.270647,-0.0047 -0.4047895,0.0094 -0.3341874,0.03765 -0.6542509,0.115319 -0.9366854,0.310656 -0.2918244,0.200041 -0.5295376,0.449494 -0.7083882,0.757792 -0.094138,0.160036 -0.1600361,0.336541 -0.2282842,0.508321 -0.2777051,0.724871 -0.5577682,1.449741 -0.8354688,2.172245 -0.4330112,1.127284 -0.866066,2.254612 -1.3014443,3.381896 -0.2894748,0.750734 -0.5789408,1.503835 -0.8660659,2.254612 -0.014121,0.03766 -0.028241,0.07531 -0.044717,0.112965 0.030595,-0.07531 0.063544,-0.15062 0.094138,-0.22593 -0.1200271,0.263585 -0.2000409,0.47071 -0.2118109,0.762525 -0.00471,0.120027 0.014121,0.24005 0.035302,0.355369 0.040009,0.195337 0.1412041,0.353015 0.2659393,0.508322 0.2165145,0.270647 0.5765741,0.491882 0.9178362,0.557768 0.1506203,0.02824 0.3012406,0.04707 0.4542277,0.04707 h 0.5106883 2.3134399 3.3748389 3.6501724 3.139484 1.840407 c 0.256523,0 0.513055,-0.0024 0.764849,-0.07531 0.30124,-0.08708 0.578941,-0.249466 0.800181,-0.473034 0.263585,-0.263585 0.418913,-0.578941 0.557768,-0.920203 0.01883,-0.04942 0.03765,-0.09885 0.05648,-0.148266 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.430688,-1.117903 0.859008,-2.235763 1.289696,-3.353666 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.01412,-0.03766 0.02824,-0.07296 0.04236,-0.110611 0.08237,-0.214165 0.01647,-0.534228 -0.09414,-0.72487 -0.115319,-0.195338 -0.338895,-0.381259 -0.562458,-0.433012 -0.24005,-0.05413 -0.510689,-0.04236 -0.724871,0.09414 -0.209457,0.143558 -0.331833,0.32713 -0.425971,0.567192 z M 17.898048,6.835008 v 3.146542 0.437745 c 0.313006,-0.313006 0.628388,-0.628388 0.941376,-0.941376 H 17.872141 15.462219 12.379196 9.3644251 7.1686842 c -0.6048476,0 -1.2308681,-0.04472 -1.7556719,0.329479 -0.4259712,0.303595 -0.7036976,0.69664 -0.8942966,1.179055 -0.016474,0.04001 -0.030595,0.08237 -0.047071,0.124731 -0.08943,0.232992 -0.1788593,0.465976 -0.2682935,0.698963 -0.3247757,0.844894 -0.6495602,1.68742 -0.9743401,2.532313 -0.3647851,0.948434 -0.7295611,1.899235 -1.0943633,2.847668 -0.2212223,0.571884 -0.4401122,1.146134 -0.6613086,1.718017 -0.011767,0.02824 -0.021181,0.05648 -0.032948,0.08473 0.030595,-0.07531 0.063544,-0.15062 0.094137,-0.22593 -0.1176729,0.258877 -0.1835671,0.44717 -0.2094567,0.729561 -0.01412,0.157682 0.00471,0.329479 0.056483,0.480091 0.5742503,-0.242404 1.1461337,-0.482458 1.7203839,-0.72487 -0.035302,-0.04942 -0.065894,-0.1012 -0.091784,-0.157683 0.030595,0.07531 0.063545,0.150621 0.094137,0.225931 -0.028241,-0.0706 -0.049421,-0.138855 -0.06119,-0.214165 0.011767,0.08237 0.023534,0.167094 0.032948,0.249466 -0.018827,-0.160036 -0.00706,-0.32713 -0.00706,-0.489516 V 17.813782 14.311863 10.0639 6.4019361 c 0,-0.5813076 -0.00471,-1.1649394 0,-1.7462474 0,-0.037655 0.00235,-0.077664 0.00471,-0.115319 -0.011767,0.082372 -0.023535,0.1670938 -0.032948,0.2494657 0.00941,-0.072956 0.028241,-0.1435583 0.056483,-0.2118106 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.2259303 0.028241,-0.065894 0.063544,-0.1270848 0.108257,-0.1859212 -0.049421,0.063544 -0.098845,0.1270845 -0.1482661,0.190629 0.044717,-0.056483 0.094138,-0.1059032 0.1506203,-0.15062 -0.063544,0.049421 -0.1270848,0.098846 -0.1906293,0.1482661 0.058836,-0.042362 0.1200271,-0.077664 0.1859213,-0.1082571 -0.07531,0.030595 -0.1506203,0.063544 -0.2259303,0.094137 0.068248,-0.028241 0.1388545,-0.044717 0.2118106,-0.056483 -0.082372,0.011768 -0.1670935,0.023535 -0.2494658,0.032948 0.1929832,-0.018827 0.3906703,-0.00471 0.5836318,-0.00471 h 1.2473072 2.873532 0.6636754 C 7.9429095,4.60862 7.6722712,4.453292 7.401628,4.2979723 7.8887769,4.938108 8.3736017,5.578244 8.8607503,6.2183797 8.9289983,6.3101637 8.9996049,6.3995929 9.0678531,6.4913809 9.2184733,6.6890719 9.3785094,6.8726392 9.6350456,6.929126 9.7056476,6.9456 9.8186129,6.959721 9.891569,6.962074 h 0.049421 0.642503 2.704105 3.071232 c 0.548343,0 1.099053,-0.00471 1.647397,0 0.03765,0 0.07531,0.00235 0.115319,0.00471 -0.08237,-0.011767 -0.167094,-0.023534 -0.249466,-0.032948 0.07296,0.00941 0.143559,0.028241 0.211811,0.056483 -0.07531,-0.030595 -0.15062,-0.063545 -0.22593,-0.094137 0.06589,0.028241 0.127085,0.063544 0.185921,0.108257 -0.06354,-0.049421 -0.127085,-0.098845 -0.190629,-0.1482661 0.05648,0.044717 0.105903,0.094137 0.15062,0.15062 -0.04942,-0.063545 -0.09885,-0.1270845 -0.148266,-0.190629 0.04236,0.058836 0.07766,0.1200271 0.108257,0.1859213 -0.03059,-0.07531 -0.06354,-0.1506203 -0.09414,-0.2259303 0.02824,0.068248 0.04472,0.1388545 0.05648,0.2118106 -0.01177,-0.082372 -0.02354,-0.1670938 -0.03295,-0.2494658 0.0024,0.032948 0.0047,0.065894 0.0047,0.096492 0.0047,0.2447577 0.1012,0.4918825 0.275351,0.6660425 0.162386,0.1623858 0.430688,0.2871209 0.666043,0.2753509 0.501263,-0.023534 0.9508,-0.4142054 0.941376,-0.9413763 -0.01883,-0.9672827 -0.793123,-1.7415564 -1.760363,-1.7556716 -0.110611,-0.00235 -0.218868,0 -0.32948,0 h -1.795679 -2.525255 -2.311073 c -0.383613,0 -0.769583,-0.00941 -1.1531914,0 H 9.8892086 C 10.159856,5.2346612 10.430495,5.3899892 10.701138,5.5453089 10.183391,4.8651512 9.6679691,4.1850366 9.150223,3.5048786 9.117275,3.4601618 9.0819748,3.415449 9.0490234,3.3707322 9.0419632,3.3636719 9.0372561,3.354258 9.0301959,3.347198 8.8960493,3.1730422 8.7854381,3.0483116 8.5783352,2.9612316 8.4300691,2.8976871 8.4182991,2.8859213 8.2135504,2.8812136 c -0.070602,-0.00235 -0.1388545,0 -0.2094567,0 H 6.80619 3.5984533 c -0.2188681,0 -0.4353783,-0.00471 -0.6542509,0 -0.3271299,0.00471 -0.6731002,0.091784 -0.9460669,0.2800586 -0.3412493,0.2329922 -0.5671925,0.5318615 -0.715446,0.9178366 -0.072956,0.1859213 -0.094137,0.3930238 -0.094137,0.593056 -0.00235,0.4353786 0,0.8707569 0,1.3061785 v 2.6711407 3.372472 3.334817 2.635853 c 0,0.409498 -0.00235,0.818987 0,1.228502 0.00235,0.338895 0.091784,0.70133 0.2894748,0.979031 0.1388545,0.195337 0.3177138,0.37655 0.5624586,0.433011 0.2094567,0.04707 0.4142057,0.03766 0.6119054,-0.04707 0.4071434,-0.171801 0.6989637,-0.663675 0.5460196,-1.110802 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023535,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063545,-0.216514 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.22593 0.1529742,-0.338895 0.2777051,-0.689539 0.4094977,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366186,-1.915717 0.2965325,-0.771949 0.5930563,-1.546223 0.8919727,-2.31813 0.2565235,-0.670733 0.5154225,-1.3391 0.7719502,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765502,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094138,0.22593 0.058837,-0.131793 0.1270848,-0.256523 0.2141648,-0.371843 -0.049421,0.06354 -0.098845,0.127085 -0.1482661,0.19063 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223577 -0.063544,0.04942 -0.1270848,0.09885 -0.1906293,0.148267 0.070602,-0.05413 0.1435584,-0.09649 0.2259303,-0.134147 -0.07531,0.03059 -0.15062,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670936,0.02354 -0.2494658,0.03295 0.1435584,-0.01647 0.2941786,-0.0094 0.4401122,-0.0094 h 0.8731262 2.9394612 3.574862 3.120678 c 0.503631,0 1.004938,0.0071 1.508569,0 h 0.02118 c 0.508321,0 0.941376,-0.430688 0.941376,-0.941376 V 7.2703743 6.8326289 c 0,-0.4918825 -0.433011,-0.9649159 -0.941376,-0.9413759 -0.508322,0.025888 -0.941376,0.4165592 -0.941376,0.9437427 z"})}),exports.ViewGridLinesCommandButton=Ff,exports.ViewHeadingsCommandButton=Hf,exports.WalkingCopyCommandButton=ec,exports.Wi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),a.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),a.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.WorkbookContextMenu=Uu,exports.WorkbookElement=Cm,exports.WorkbookIO=cT,exports.WorkbookStrip=Wu,exports.WorkbookTitle=km,exports.WorkbookViewCommandButton=$f,exports.Yt=Ht,exports.Yt$1=Qh,exports.Z=ke,exports.Z0=Bo,exports.Zt=Lt,exports._WorkbookIO=_m,exports._extends=I1,exports._objectWithoutPropertiesLoose=Nu,exports._setPrototypeOf=D1,exports.cl=()=>{const{showModal:e}=ds();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const l=e(hw,{defaultOption:n,cancelOption:o,...r,onOption(d){r?.onOption?.(d,d===o,d===n),i({input:"",option:d})},onInputOption(d,c){r?.onInputOption?.(d,c),i({input:d,option:c})},onDone:()=>{r?.onDone?.(),l.hide()}})})}},exports.clsx=Qn,exports.commonjsGlobal=Li,exports.createGridStyleFromMUITheme=E2,exports.createTheme=Xp,exports.defaultNewWorkbook=wm,exports.defaultTheme=e9,exports.ed=e=>a.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[a.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),a.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),a.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),a.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.eo=Zt,exports.g4=Pn,exports.getDefaultExportFromCjs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.getOverlayAlpha=Mn,exports.go=V0,exports.gr=Re,exports.gt=Xt,exports.il=function(e){var t=e.children,n=e.legacy,o=n!==void 0&&n,r=e.suspense,i=r===void 0||r,l=e.fallback,d=l===void 0?null:l,c=s.useReducer(Mv,jv),u=c[0],p=c[1],f=s.useCallback(function(v,b){var C=pp(b,Rv);v?p({type:Mr.UPDATE,payload:{id:v,props:C}}):console.error(Pc)},[p]),h=s.useCallback(function(v){v?p({type:Mr.HIDE,payload:{id:v}}):console.error(Pc)},[p]),m=s.useCallback(function(v){v?p({type:Mr.DESTROY,payload:{id:v}}):console.error(Pc)},[p]),g=s.useCallback(function(v){v?p({type:Mr.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),x=s.useCallback(function(v,b,C){var k=mp(8);return C&&C.rootId&&(k=C.rootId+"."+k),p({type:Mr.SHOW,payload:{id:k,component:v,props:b,options:C}}),{id:k,hide:function(){return h(k)},destroy:function(){return m(k)},update:function(E){return f(k,E)}}},[p,h,m,f]),y=i?s.Suspense:s.Fragment;return s.createElement(fp.Provider,{value:{state:u,updateModal:f,hideModal:h,destroyModal:m,showModal:x,destroyModalsByRootId:g}},t,s.createElement(y,Object.assign({},i&&{fallback:d}),Object.keys(u).map(function(v){var b,C=u[v],k=C.component,E=C.props,R=C.options,j=function(){var B,T;E!=null&&E.onExited&&E.onExited.apply(E,arguments),E!=null&&(B=E.TransitionProps)!=null&&B.onExited&&(T=E.TransitionProps).onExited.apply(T,arguments),m(v)};return b=o?{onExited:j}:{TransitionProps:qo({},E?.TransitionProps,{onExited:j})},s.createElement(k,Object.assign({},E,{key:v,onClose:function(){R&&R.hideOnClose&&h(v),R&&R.destroyOnClose&&R.hideOnClose&&m(v),E&&E.onClose&&E.onClose.apply(E,arguments)}},R&&!R.destroyOnClose&&b))})))},exports.isPlainObject=p0,exports.j7=Q2,exports.ji=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),a.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),a.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports.jt=vt,exports.jt$1=il,exports.k7=X2,exports.ki=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),a.jsx("path",{className:"styled secondary_light",d:"m 22.499719,10.752378 -1.867399,5.486926 h -1.267987 l -1.859714,-5.486926 h 1.175769 l 1.02976,3.266027 q 0.03074,0.08453 0.08453,0.315076 0.06148,0.222858 0.122956,0.476455 0.06148,0.245913 0.08453,0.414978 0.02305,-0.169065 0.07685,-0.414978 0.06148,-0.253597 0.122956,-0.476455 0.06148,-0.230544 0.08453,-0.315076 l 1.037444,-3.266027 z m -5.302496,3.965341 q 0,0.730053 -0.530249,1.168085 -0.522565,0.430347 -1.490846,0.430347 -0.868379,0 -1.552323,-0.330445 v -1.083552 q 0.391923,0.169065 0.8069,0.315075 0.422663,0.138326 0.83764,0.138326 0.430348,0 0.607097,-0.16138 0.184435,-0.169065 0.184435,-0.422663 0,-0.207488 -0.146011,-0.353499 -0.138326,-0.146011 -0.376554,-0.268967 -0.238228,-0.130641 -0.545618,-0.276652 -0.19212,-0.09222 -0.414978,-0.215173 -0.222858,-0.130641 -0.430347,-0.315076 -0.199804,-0.192119 -0.330445,-0.461086 -0.130641,-0.268967 -0.130641,-0.645521 0,-0.737738 0.49951,-1.14503 0.49951,-0.414978 1.360204,-0.414978 0.430347,0 0.814586,0.0999 0.391923,0.0999 0.814585,0.284337 l -0.376553,0.906802 q -0.376554,-0.153695 -0.67626,-0.238227 -0.299706,-0.08453 -0.614782,-0.08453 -0.330445,0 -0.507195,0.153695 -0.176749,0.153696 -0.176749,0.399609 0,0.292021 0.261282,0.461086 0.261282,0.169065 0.776162,0.414977 0.422662,0.199804 0.714683,0.414978 0.299706,0.215173 0.461087,0.507195 0.16138,0.292021 0.16138,0.722368 z m -5.801995,-3.073908 q -0.668575,0 -1.022074,0.49951 -0.3535,0.49951 -0.3535,1.367889 0,0.876064 0.322761,1.360205 0.330445,0.476455 1.052813,0.476455 0.33813,0 0.668575,-0.07685 0.33813,-0.07685 0.730053,-0.215174 v 0.975966 q -0.361184,0.14601 -0.714683,0.215173 -0.3535,0.06916 -0.791532,0.06916 -0.845324,0 -1.3986278,-0.345814 -0.5456187,-0.3535 -0.8069009,-0.983651 -0.2612821,-0.637836 -0.2612821,-1.483161 0,-0.829955 0.299706,-1.467791 0.299706,-0.637836 0.868379,-0.99902 0.5763578,-0.361184 1.4063128,-0.361184 0.407293,0 0.814586,0.107587 0.414977,0.0999 0.791531,0.276652 l -0.376554,0.945226 q -0.30739,-0.14601 -0.622466,-0.253597 -0.307391,-0.107587 -0.607097,-0.107587 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.ko=xa,exports.la=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1z"}),a.jsx("path",{d:"M11 7h2v6h-2zm0 8h2v2h-2z"})]}),exports.ll=function(){const[e,t]=s.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=ds({disableAutoDestroy:!0});return(l,d,c,u)=>new Promise((p,f)=>{const h={...c,onHide:()=>{const y=e.get(l);c?.onHide?.(),t(v=>(v.delete(l),v)),i(y.id)},onDone:y=>{const v=e.get(l);t(b=>(b.delete(l),b)),c?.onDone?.(y),v&&v.id&&!u?.disableAutoDestroy&&r(v.id)},onShown:y=>{t(v=>{const b=v.get(l);return v.set(l,{...b,element:y}),v}),p(y)},open:!0},m=e.get(l);if(m)return o(m.id,h),void p(m.element);if(!d)return void f("invalid function");const g=s.lazy(d),x=n(g,h,{destroyOnClose:!u?.disableAutoDestroy});t(y=>(y.set(l,{id:x.id,element:null}),y))})},exports.mergeRefs=nc,exports.n2=No,exports.ol=hp,exports.renderWorkbookToolbars=bm,exports.requirePropTypes=za,exports.ro=gn,exports.s0=fn,exports.sl=()=>{const{showModal:e}=ds();return t=>new Promise(n=>{const o=e(uw,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.styleFunctionSx=al,exports.tl=(e,t)=>{let n=Od({palette:{mode:e?"dark":"light"}}),o={typography:{},palette:{mode:e?"dark":"light",text:{secondary:e?n.palette.text.secondary:gt.alpha(n.palette.text.secondary,.75),icon:e?gt.alpha(n.palette.text.secondary,.7):gt.alpha(n.palette.text.primary,.75)}},components:{MuiDialogTitle:{styleOverrides:{root:{fontWeight:"normal"}}},MuiSelect:{styleOverrides:{iconOutlined:{top:"unset"}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"0px !important",overflow:"hidden",marginLeft:"0px",marginRight:"6px",padding:"1px 1px",border:"solid transparent 1px"}}},MuiMenuItem:{styleOverrides:{root:{paddingTop:"2px",paddingBottom:"2px",marginLeft:"4px",marginRight:"4px",paddingLeft:"6px",paddingRight:"18px",borderRadius:"4px",fontSize:"0.875em","@media (pointer: coarse)":{fontSize:"1em"},"&.Mui-selected":{}}}},MuiDivider:{styleOverrides:{root:{marginTop:"4px !important",marginBottom:"4px !important",marginLeft:"0px",marginRight:"0px"}}},MuiPopper:{styleOverrides:{root:{"& .menu":{marginTop:"4px",marginBottom:"4px",borderRadius:"4px"}}}},SmartInputField:{styleOverrides:{automatic:{transition:"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",color:function(){return n.palette.text.secondary}},dirty:{fontStyle:"italic",color:function(){return n.palette.text.secondary}}}}}},r=o;return t&&(r=S8.deepmerge(o,t)),Od(r)},exports.ul=el,exports.useMeasure=Ra,exports.useResolvedThemeMode=function(e){const{mode:t}=e||{},[n,o]=s.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=s8();if(r)return{themeMode:r,source:"class"}}return{themeMode:c8(),source:"media"}});return s.useEffect(()=>{if(t&&t!==n?.themeMode)return void o({themeMode:t,source:"prop"});const r=()=>{const c=s8();if(c)o({themeMode:c,source:"class"});else{const u=c8();o({themeMode:u,source:"media"})}},i=new MutationObserver(r),l=[document.documentElement,document.body].filter(Boolean);for(const c of l)i.observe(c,{attributes:!0,attributeFilter:["class"]});const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",r),r(),()=>{i.disconnect(),d.removeEventListener("change",r)}},[t]),n},exports.useTheme=qr,exports.useWorkbookCommands=vm,exports.vo=$t,exports.x5=ye,exports.y3=i0,exports.ye=r0,exports.zi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 6.3819062,2.5159671 c -0.4338889,0 -0.7857055,0.3518167 -0.7857055,0.7857177 V 20.587402 c 0,0.433902 0.3518166,0.785718 0.7857055,0.785718 H 18.953342 c 0.433889,0 0.785705,-0.351816 0.785705,-0.785718 V 7.2302615 h -3.928564 c -0.433901,0 -0.785718,-0.3518167 -0.785718,-0.7857178 V 2.5159671 Z m -2.357141,0.7857177 c 0,-1.3018621 1.0552788,-2.35714102 2.357141,-2.35714102 h 9.4285768 c 0.208352,0 0.408296,0.0827447 0.555609,0.23010782 l 4.714283,4.7142821 c 0.147327,0.1473145 0.230107,0.3472578 0.230107,0.55561 V 20.587402 c 0,1.301863 -1.055278,2.357142 -2.35714,2.357142 H 6.3819062 c -1.3018622,0 -2.357141,-1.055279 -2.357141,-2.357142 z"}),a.jsx("path",{className:"styled info",d:"M 13.729115,7.5208126 H 11.903278 V 11.108007 H 8.3163096 v 1.825837 h 3.5869684 v 3.586969 h 1.825837 v -3.586969 h 3.587195 v -1.825837 h -3.587195 z"})]});
|
|
87
|
+
Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[ke.Ctrl]}}),new je("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new je("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[ke.Alt]}]},function(S=!0){m?.()}),new je("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new je("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new je("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new je("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[ke.Ctrl]}}),new je("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new je("calculateAll",r,{label:"Calculate Now",description:"Recalculate all formulas.",shortcut:{key:"F9"}}),new vt("calculate",r,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[ke.Ctrl]}}),new vt("closeWorkbook",r,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[ke.Ctrl]}}),new vt("newWorkbook",r,{label:"New Workbook",description:"Create a new workbook in another tab.",shortcut:{key:"N",modifiers:[ke.Ctrl]}})],[]),y=s.useMemo(()=>{let S=null;return S=i?i.createChildGroup(r,"workbook",!1):new rl(r,"workbook"),S.addCommands(x,!0),S},[i,x]),v=$r(),b=s.useRef(null),C=ue(()=>{let S,O=null;const P=y.getCommand("executeScript");if(P.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!P)return;const M=y.getCommand("executeSelectedScript");if(!M)return;const A={saveSource:async D=>{let L=null,N=null;const W=t.getScripts();try{D&&(N=await o?.showBusy?.("Saving Scripts..."),L=await W.createModule({source:D})),W.addModule("scripts",L,{replace:!0}),N?.()}catch(I){N?.(),console.warn("Unable to compile",I),o?.showError?.(I)}return L},addContainerListener:D=>(k.current=D,()=>{k.current=null}),setSelectedFunction:D=>{S=D??b.current??null,Promise.resolve(S).then(L=>{M.update({disabled:L===null})})},quickInsertFunction:D=>{const L=`=${D.toUpperCase()}(`,N={text:L+")",editMode:!0,initialSelection:{start:L.length,end:L.length+0}};v.setMode(W=>W?.key==="edit"?{...W,args:{...W.args}}:{key:"edit",args:{stateAndCoords:null,start:N}})},getSelectedFunction:()=>S,setEditor:D=>{O=D??null,y.getCommand("showScriptEditor")?.update({state:D!==null})},getEditor:()=>O,getRanges:D=>{try{return t.getRanges(D)}catch{}return null},getScripts:()=>t.getScripts(),isReadonly:()=>t.getProtection().isStructureAllowed()===!1};M.update({context:A})},[y,t,n,o]),k=s.useRef(null);Xt(t,{onBeforeSave:async()=>{await k.current?.onBeforeSave()},onProtectionChange:()=>{k.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),k.current?.onScriptChange()))()}}),Xt(t,{onSheetsChange:S=>{h(S.getSheets().search())},onViewChange(S){p(S?.getSelectedSheet())},onProtectionChange:S=>{const O={disabled:!S.getProtection().isStructureAllowed()};y.getCommand("hideSheet").update(O),y.getCommand("deleteSheet").update(O),y.getCommand("addSheet").update(O),y.getCommand("duplicateSheet").update(O)},onScriptsChange:S=>{C()}});const{isFullscreenAvailable:E,isFullscreenEnabled:R,toggleFullscreen:j}=function(S={}){const{target:O,onChange:P,onError:M,requestFullScreenOptions:A}=S,[D,L]=s.useState(!1),[N,W]=s.useState(null),[I,U]=s.useState(!1),G=s.useCallback(()=>Qr.requestFullscreen(O?.current||null,A),[O,A]),Q=s.useCallback(()=>Qr.exitFullscreen(),[]),H=s.useCallback(()=>Qr.fullscreenElement?Q():G(),[G,Q]),$=s.useCallback(X=>{const K=Qr.fullscreenElement;W(K),U(!!K),P?.(X)},[P]),F=s.useCallback(X=>{const K=Qr.fullscreenElement;W(K),U(!!K),M?.(X)},[M]);return s.useEffect(()=>{L(Qr.fullscreenEnabled)},[]),s.useEffect(()=>(Qr.on("change",$),Qr.on("error",F),()=>{Qr.off("change",$),Qr.off("error",F)}),[$,F]),{isFullscreenAvailable:D,fullscreenElement:N,isFullscreenEnabled:I,enableFullscreen:G,disableFullscreen:Q,toggleFullscreen:H}}({target:{current:n??document.body}}),B=wu();s.useEffect(()=>{y.getCommand("selectTheme").update({state:()=>t.getTheme(),context:()=>({theme:t.getTheme(),themes:B,darkMode:l})})},[t?.getTheme(),l]);const T=ue(async function(S,O){let P=null;const M=t.getScripts();if(S?.declaration||S?.functionName){const A=S.declaration?S.declaration.getName():S.functionName;M.searchFunction({name:A}).length>0&&(P=A)}if(P)try{await M.executeMacro(P),b.current=Promise.resolve({source:null,name:P})}catch(A){return void o?.showError?.(A)}},[t,o]);s.useEffect(()=>{y.getCommand("newCellStyle").updateCallback(S=>{o?.showInputOptions?.({initialValue:(()=>{let O=0;for(;;){O++;const P=`Style ${O}`;try{return t.getStyles().validateStyleName(P,!0),P}catch{}}})(),title:y.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInputOption:async(O,P)=>{let M=null;try{t.getStyles().validateStyleName(O,!1)}catch(L){M=L.message}let A=t.getStyles().getNamed(O),D=M;return!D&&A&&(D=`Update style '${A.getName()}'.`),{valid:M===null,message:D}}}).then(({input:O,option:P})=>{const M=t.getSelectedSheet().getSelectedRange();if(P!=="Ok")return;const A=t.getStyles().setNamed({name:O,style:M.getCell().getStyle()});M.updateStyle({named:A.getName()})})}),y.getCommand("deleteCellStyle").updateCallback(S=>{S.delete()}),y.getCommand("modifyCellStyle").updateCallback(({named:S})=>{const O=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:S.getName(),style:O.getCell().getStyle()})}),y.getCommand("hideSheet").updateCallback(S=>{t.getSheetAt(S).setVisibility(z.ISheet.Visibility.Hidden)}),y.getCommand("deleteSheet").updateCallback(async S=>{t.getSheetAt(S??t.getSelectedSheetIndex())?.delete()}),y.getCommand("addSheet").updateCallback(S=>{t.getSheets().add({index:S,autoSelect:!0})}),y.getCommand("duplicateSheet").updateCallback(async S=>{(await t.getSheetAt(S??t.getSelectedSheetIndex())?.duplicate())?.select()}),y.getCommand("nextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("previousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectNextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectPreviousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),y.getCommand("selectTheme").updateCallback(S=>{t.setTheme(S)}),y.getCommand("calculateAll").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("calculate").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("closeWorkbook").updateCallback(async()=>{await o?.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),y.getCommand("newWorkbook").updateCallback(()=>{g?.()}),y.getCommand("executeScript").updateCallback(T),y.getCommand("executeSelectedScript").updateCallback(T)},[t,o]);const _=ue(async S=>{let O=0,P=null,M="Find & Replace";S?.replace&&!S?.replaceOptions?.maxCount&&(M="Replace All");const A=await o?.showBusy?.(M);try{const D=S?.scope??"sheet";let L=null;const N=t.getSelectedSheet(),W={from:N.getSelectedCell(),...S.findOptions};if(L=D==="sheet"?t.getSelectedSheet().find(S.findText,W):t.find(S.findText,W),S.replace){const I=t.replace(L,S.replaceText,S.replaceOptions);O=I.count,S.replaceOptions.maxCount&&(P=I.last)}else{let I=L.next();I.done||(O++,P=I.value)}P?.select({autoFocus:!1}),A?.(),!S.replaceOptions.maxCount&&O>1&&o?.showMessage?.(`We replaced ${O} cells.`)}catch(D){A?.(),o?.showError?.(D)}return O},[t,n]),w=ue(S=>{const O={value:S,context:{selection:()=>{const P=t.getSelectedRanges(),M=[];for(let A=0;A<P.getCount();A++){const D=P.at(A).getFixed(!0).getCoords();M.push(D)}return t.getRanges(M)},getNames:()=>t.getNames()},onUpdate:async P=>{try{await P.select()}catch(M){o?.showMessage?.(M.message,{type:r0.Error})}}};return o.showWindow?.("namedDetails",O)},[o,t,n]);return s.useEffect(()=>{const S=(O=!1)=>{const P=t.getSelectedCell(),M={onFindOrReplace:_,onKeyDown:A=>{y.findCommandByEvent(A)!==y.getCommand("find")&&y.findCommandByEvent(A)!==y.getCommand("findReplace")||A.preventDefault()},findOptions:{},findText:P.toTextUnformatted(!0)};M.replace=O,o.showWindow?.("find",M,{disableAutoDestroy:!0})};y.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S()}),y.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S(!0)}),y.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const O={onInputOption:async P=>{try{await t.getRanges(P).select()}catch(M){o?.showMessage?.(M.message,{type:r0.Error})}},onKeyDown:P=>{y.findCommandByEvent(P)===y.getCommand("goto")&&P.preventDefault()},title:y.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(O)}),y.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async O=>{if(O)try{await O.select()}catch(P){o?.showError?.(P)}}),y.getCommand("addNamedReference")?.updateCallback(async function(O){w(null)}),y.getCommand("editNamedReference")?.updateCallback(async function(O){w(O)}),y.getCommand("deleteNamedReference")?.updateCallback(async function(O){O?.delete?.()}),y.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),Xt(t?.getView(),{onViewChange:S=>{y.getCommand("workbookViewToggleShowFormulaBar").update({state:S.isShowFormulaBar()}).updateCallback(()=>{S.setShowFormulaBar(!S.isShowFormulaBar())}),y.getCommand("workbookViewToggleShowTabs").update({state:S.isShowTabs()}).updateCallback(()=>{S.setShowTabs(!S.isShowTabs())}),y.getCommand("workbookViewToggleShowStatusBar").update({state:S.isShowStatusBar()}).updateCallback(()=>{S.setShowStatusBar(!S.isShowStatusBar())}),y.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:S.isShowHorizontalScrollbar()}).updateCallback(()=>{S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar())}),y.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:S.isShowVerticalScrollbar()}).updateCallback(()=>{S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar())})}}),s.useEffect(()=>{y.getCommand("fullScreenToggle").update({state:R,disabled:!E}).updateCallback(()=>{j()})},[R,E]),s.useEffect(()=>{const S=t.getProtection().isStructureAllowed();y.getCommand("hideSheet").update({disabled:f.length<=1||!S}),y.getCommand("deleteSheet").update({disabled:f.length<=1||!S})},[f,u]),y},wm=()=>{window.open(window.origin.toString(),"sheetxl-"+z.CommonUtils.uuidV4(),"popup=true")},Sm=s.memo(s.forwardRef((e,t)=>{const{movable:n,commands:o,disabled:r,sx:i,floatReference:l,...d}=e;Xt(n,{onAnyChange(g){}});const c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(g,x)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:l}),[r,l]),p=s.useMemo(()=>({variant:$t.Menuitem,...c,...u}),[c,u]),f=s.useMemo(()=>({commands:o,variant:$t.Menuitem,parentFloat:l,...u}),[o,u,l]),h=g=>{switch(g?.key()){case"moveToFront":return ye(a.jsx(Bb,{}));case"moveForward":return ye(a.jsx(Nb,{}));case"moveToBack":return ye(a.jsx(zb,{}));case"moveBackward":return ye(a.jsx(Vb,{}));case"toggleLockAspectRatio":return ye(a.jsx(J3,{}));case"formatDrawAlignLeft":return ye(a.jsx(e6,{}));case"formatDrawAlignCenter":return ye(a.jsx(Hb,{}));case"formatDrawAlignRight":return ye(a.jsx($b,{}));case"formatDrawAlignTop":return ye(a.jsx(Wb,{}));case"formatDrawAlignMiddle":return ye(a.jsx(Ub,{}));case"formatDrawAlignBottom":return ye(a.jsx(qb,{}));case"formatDrawDistributeHorz":return ye(a.jsx(Zb,{}));case"formatDrawDistributeVert":return ye(a.jsx(Gb,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ye(a.jsx(Q3,{}));default:return null}},m=a.jsxs(a.Fragment,{children:[a.jsx(ec,{command:o.getCommand("copy"),...p,variant:$t.Menuitem}),[],a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),a.jsx(o0,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(Re,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ye(a.jsx(J3,{}))}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:g=>h(g)||ye(a.jsx(e6,{})),tooltip:"Quickly change the placement of your drawings."}),a.jsx(Lt,{orientation:"horizontal"}),a.jsx(o0,{...f,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:g=>h(g)||ye(a.jsx(Q3,{})),tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return a.jsx(V.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...d,children:m})}));Sm.displayName="MovableContextMenu";const G_="_sheetxl-theme_4opcr_2",K_="_sheetxl-workbook_1j3lu_5",X_={fireOnModelChange:!1},fd={flex:"1 1 100%",display:"flex"},Y_=e=>a.jsx(Du,{...e}),J_=e=>a.jsx(Wu,{...e}),Q_=e=>a.jsx(Sm,{...e}),eT=e=>a.jsx(Uu,{...e}),tT=e=>a.jsx(Au,{...e}),nT=(e,t)=>a.jsx(Pu,{ref:t,...e}),oT=e=>a.jsx(il,{...e}),rT=(e,t)=>a.jsx(Z9,{ref:t,...e}),Cm=s.memo(s.forwardRef((e,t)=>{const{workbook:n,createWorkbookOptions:o,onNewWorkbook:r,onElementLoad:i,notifier:l,autoFocus:d=!1,sx:c,style:u,className:p,onFocus:f,onBlur:h,onKeyDown:m,onRepeatCommandChange:g,commands:x,showFormulaBar:y,formulaBarProps:v,renderFormulaBar:b=nT,showTabs:C,tabsProps:k,renderTabs:E=J_,showStatusBar:R,statusBarProps:j,renderStatusBar:B=Y_,toolbarProps:T,renderToolbar:_=bm,contextMenuSx:w,renderContextMenu:S=eT,renderFilterMenu:O=tT,renderMovableMenu:P=Q_,renderLoadingPanel:M=oT,loadingPanelProps:A,sheetProps:D,renderSheet:L=rT,showHorizontalScrollbar:N,showVerticalScrollbar:W,gridTheme:I,headersTheme:U,forceLightImages:G,...Q}=e,H=qr(),$=wu(),F=s.useMemo(()=>{const Se={theme:$.getDefaultTheme(),...o};return n??new z.Workbook(Se)},[n]),X=s.useRef(null),[K,ne]=s.useState(!1),J=s.useRef(null),re=s.useMemo(()=>a.jsx(V.Box,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:J}),[]),[fe,ie]=s.useState(!1),[ee,pe]=s.useState(!1),Te=s.useCallback(()=>{ie(!0)},[]),Ae=s.useRef(null),ae=Ro(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>F,getSheetElement:()=>X.current,getViewportElement:()=>J.current,getFormulaBarElement:()=>Ae.current,focus(){X&&X.current&&X.current.focus()}}),[F]),he=s.useRef(null);s.useLayoutEffect(()=>{fe&&ae.current&&(pe(!0),he.current!==i&&(i?.({source:ae.current}),he.current=i))},[fe,ae.current]),ae.current;const we=s.useCallback(Se=>(X.current?.submitEdit(),!0),[]),He=s.useCallback(()=>{requestAnimationFrame(()=>{X?.current?.focus()})},[]),[Ye,wt]=s.useState(F?.getSelectedSheet()),[Ct,Ee]=s.useState(F?.getProtection());Xt(F,{onSheetsChange:Se=>{wt(Se?.getSelectedSheet())},onViewChange(Se){wt(Se?.getSelectedSheet())},onProtectionChange:Se=>{Ee(Se?.getProtection())}}),Xt(F,{onRequestSelect:async(Se,xt)=>new Promise(jt=>{X.current.getSheet()!==xt?X.current.getGridElement()?.onViewChangeOnce(()=>{X.current.getSheet()!==xt&&jt(!1),jt(!0)}):jt(!0)})},X_);const[Ie,ft]=s.useReducer(Se=>Se+1,0),$e=F?.getView();Xt($e,{onViewChange:Se=>{ft()}});const yt=I??H,tt=s.useMemo(()=>E2(H,yt),[H,yt]),oe=U??H,Ve=s.useMemo(()=>E2(H,oe),[H,oe]),[xe,be]=s.useState(null);s.useCallback(()=>{X.current.focus()},[]);const[te,Me]=s.useState(!1),_e=s.useRef(null),ve=vm({workbook:F,workbookElement:ae.current,commandTarget:()=>X.current,notifier:l,commands:x,darkMode:tt.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{te?_e.current?.focus():Me(!0)}}),Oe=s.useRef(null),[Y,se]=s.useState(!1),[Ce,Pe]=s.useState(null),[Qe,Ge]=s.useState(mc),[Be,ot]=s.useState(z.TypesUtils.EmptyBounds),Ze=()=>{se(!1),Pe(null)},et=(Se,xt,jt=mc)=>{ot(Se),Ge(jt),Pe(xt),Oe.current!==null&&Oe.current.update(),se(!0)},[mt,pt]=s.useState("sheet"),it=C??$e?.isShowTabs(),Wt=N??$e?.isShowHorizontalScrollbar(),qt=y??$e?.isShowFormulaBar(),Vt=R??$e?.isShowStatusBar(),nn=W??$e?.isShowVerticalScrollbar(),bn=tt?.header?.edgeStrokeFill||"rgb(171,171,171)",kn=s.useMemo(()=>Vt?B({sheet:Ye,gridStyle:tt,...j}):null,[B,j,Vt,tt,Ye]),Gn=s.useMemo(()=>_({commands:ve,workbook:ae.current,...T}),[ve,_,T,H]),[eo,{width:Tn}]=Ra(),dt=Tn===0||Tn>560,Jt=s.useMemo(()=>{if(!it)return null;let Se=E({background:tt.body.fill,borderWidth:1,borderColor:bn,gridTheme:yt,gridStyle:tt,onBeforeUserChange:we,onUserChange:He,workbook:F,commands:ve,sheetTabProps:{},notifier:l,...k});return dt||(Se=a.jsx("div",{style:{flex:"none",display:"flex"},children:Se})),Se},[E,k,l,H,F,yt,dt,ve,it]),Sn=s.useCallback(Se=>{const xt=z.CommonUtils.getOS()===z.CommonUtils.OSType.Firefox;let jt=null,un=null,tn=null;if(Wt&&(un=a.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${bn} 1px`,maxWidth:"100%"},children:a.jsx(k1,{style:{alignItems:"center",borderTop:(xt?6:3)+"px solid transparent",borderBottom:(dt?6:3)+"px solid transparent",borderLeft:(xt?3:0)+"px solid transparent",borderRight:(xt?3:0)+"px solid transparent"},...Se,endGap:700,sheet:Ye,showCustomScrollButtons:!xt,onShowTooltip:St=>{et({x:St.anchor.x,y:St.anchor.y,width:0,height:0},St.display,St.placement)},onCloseTooltip:()=>Ze()})})),it&&dt&&(tn=Jt),it&&dt&&!Wt&&(tn=a.jsxs(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[tn,a.jsx(V.Box,{sx:{borderTop:`solid ${bn} 1px`,flex:"1"}})]})),tn&&Wt)jt=a.jsx(kd,{position:F.getView().getTabRatio()/10+"%",onPositionChange:({percent:St})=>{F.getView().setTabRatio(Math.round(10*St))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${H.palette.text.icon??H.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${bn} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:tn,elementAfter:un});else if(Wt)jt=un;else{if(!tn)return a.jsx(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:Vt?null:`solid ${bn} 1px`}});jt=tn}return a.jsx(V.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:jt})},[Ye,we,F,tt,yt,ve,it,Wt,Vt,dt]),[vn,En]=s.useState(null),on=s.useMemo(()=>({placement:"right-start",...vn?.popperProps}),[vn?.popperProps]),{reference:to,component:_o}=i0({label:"contextMenu",popperProps:on,anchor:vn?.anchor??{getBoundingClientRect:()=>new DOMRect(vn?.clientX||0,vn?.clientY||0)},onClose:()=>En(null),createPopupPanel:vn?.createPopupPanel});s.useEffect(()=>{vn?to.open(0):to.close(0)},[vn]);const Vo=ue((Se,xt)=>{if(Se?.isDefaultPrevented())return!0;Se.preventDefault(),vn&&vn.anchor===Se.currentTarget?En(null):En({anchor:Se.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:jt=>{const{floatReference:un}=jt;return O({filter:xt,commands:ve,floatReference:un,sx:{...w}})}})},[O,w,ve,F,vn]),Zo=ue(Se=>{if(Se.originalEvent?.isDefaultPrevented())return!0;Se.originalEvent?.preventDefault(),En({clientX:Se.clientX,clientY:Se.clientY,createPopupPanel:xt=>{const{floatReference:jt}=xt;return S({commands:ve,workbook:F,floatReference:jt,sx:{...w}})}})},[S,w,ve,F]),Or=ue((Se,xt)=>{if(Se?.isDefaultPrevented())return!0;Se.preventDefault(),En({clientX:Se.clientX,clientY:Se.clientY,createPopupPanel:jt=>{const{floatReference:un}=jt;return P({movable:xt,commands:ve,floatReference:un,sx:{...w}})}})},[P,w,ve]);s.useMemo(()=>{const Se=[new vt("openContextMenu",()=>X.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[ke.Shift]},{key:"ContextMenu"}]})];ve.addCommands(Se,!0)},[ve]),s.useEffect(()=>{ve.getCommand("openContextMenu").updateCallback(()=>{const Se=Ye.getSelection().getCoords().cell;X.current?.getGridElement()?.scrollCellCoordsIntoView(Se).then(xt=>{requestAnimationFrame(()=>{const jt=Ye.getView().getZoomScale()/100,un=Ye.getColumnHeaders().findOffset(Se.colIndex+1)*jt,tn=Ye.getRowHeaders().findOffset(Se.rowIndex+1)*jt,St=X.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};Zo({clientX:un-St.x-xt.left+6,clientY:tn-St.y-xt.top+6})})})})},[Ye]);const Go=ue(Se=>{ve?.dispatchToFocusedCommand(Se)},[ve]),wr=ue(()=>{ae.current},[F,ae.current]),Zr=s.useCallback(()=>{pt("sheet")},[]),Sr=s.useCallback(()=>{pt("formulaBar")},[]),Oo=ue(Se=>{const xt=z.CommonUtils.getOS()===z.CommonUtils.OSType.Firefox;return a.jsx(k1,{style:{borderLeft:"3px solid transparent",borderRight:"0px solid transparent",borderTop:(xt?3:0)+"px solid transparent",borderBottom:(xt?3:0)+"px solid transparent",width:xt?"13px":void 0},...Se,sheet:Ye,endGap:700,showCustomScrollButtons:!xt,onShowTooltip:jt=>{et(jt.anchor,jt.display,Rg)},onCloseTooltip:()=>Ze()})},[Ye]);s.useEffect(()=>{d&&X&&X.current&&X.current.focus()},[]);const[ze,rt]=s.useState(null),lt=s.useCallback(Se=>{ve?.getCommand("openWorkbook")&&(Se.type==="dragenter"||Se.type==="dragover"?Se.dataTransfer?.types.includes("Files")?Se.dataTransfer.files[0]?.type?.startsWith("image/")||Se.dataTransfer.items[0]?.type?.startsWith("image/")||Se.dataTransfer.types.length===1&&rt("Drop to open"):(Se.dataTransfer?.types.includes("text/html")||Se.dataTransfer?.types.includes("text/plain"),Se.dataTransfer.effectAllowed="none",Se.dataTransfer.dropEffect="none"):Se.type==="dragleave"&&rt(null),Se.preventDefault())},[ve]),Ke=ue(Se=>{if(ve?.getCommand("openWorkbook")&&(Se.preventDefault(),Se.stopPropagation(),rt(null),Se.dataTransfer.files&&Se.dataTransfer.files.length>0)){const xt=Se.dataTransfer.files[0];if(!xt)return;if(xt?.type?.startsWith("image/")){const jt=X.current?.getGridElement().getViewFromClient(Se.clientX,Se.clientY);if(!jt)return;const un=jt.getRelativePointFromClient(Se.clientX,Se.clientY),tn=jt.toAbsoluteBounds({...un,width:0,height:0}),St=jt.getCellCoordsFromClient(Se.clientX,Se.clientY);if(!St)return;ve?.getCommand("insertImageFromFile")?.execute({file:xt,options:{bounds:{x:tn.x,y:tn.y}},goto:{range:{...St}}})}else ve?.getCommand("openWorkbook")?.execute(xt)}},[ve,ze]),st=s.useMemo(()=>ze?a.jsx(V.Box,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:Se=>Se.palette.divider,color:Se=>Se.palette.primary.dark},children:a.jsx(V.Typography,{variant:"h4",children:ze})}):null,[ze]),kt=s.useRef(null),Tt=s.useMemo(()=>a.jsx(k2,{in:!ee,nodeRef:kt,timeout:500,classNames:"animating",unmountOnExit:!0,children:M({ref:kt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:ee?0:c?.opacity,pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...A}})}),[ee,M,A]),Et=s.useMemo(()=>b({sx:{marginTop:Se=>Se.spacing(.25),marginLeft:Se=>Se.spacing(1),marginRight:Se=>Se.spacing(1)},workbook:F,sheetElement:X.current,gridStyle:tt,onFocus:Sr,...v,NamedCollectionEditorProps:{restoreFocus:Se=>X.current.focus(Se),notifier:l,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:ve,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},Ae),[b,v,F,tt,ve,ee]),It=s.useCallback(Se=>{const{movable:xt,...jt}=Se,un={movable:xt,onContextMenuCapture:Gt=>{Or(Gt,xt)},...jt},tn=xt.getContent().getType();let St=null;if(tn==="picture")return a.jsx(G9,{loadingPanel:a.jsx(il,{transitionDelay:"100",style:{position:"absolute"},sx:{border:Gt=>`solid 1px ${Gt.palette.action.active}`}}),picture:xt.getContent(),description:xt.getDescription()??xt?.getName(),...un});if(tn==="chart"){const Gt={...un,chart:xt.getContent()};return a.jsx(Gk,{...Gt})}if(St=`Float of type '${tn}'.`,typeof St=="string"){const Gt={...un,description:St};St=a.jsx(Bk,{...Gt})}return a.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:St},xt.getUUID())},[]),Mt=s.useMemo(()=>L({style:fd,onFocus:Zr,notifier:l,gridStyle:tt,headersStyle:Ve,sheet:Ye,commands:ve,onSheetContextMenu:Zo,onViewportChange:Se=>{be(Se)},showScrollbars:!1,viewportComponent:re,onRepeatCommandChange:g,onElementLoad:Te,onShowColumnTooltip:Se=>{et(Se.anchor,Se.display,mc)},onShowRowTooltip:Se=>{et(Se.anchor,Se.display,Cd)},onShowTooltip:Se=>{et({x:Se.anchor.x,y:Se.anchor.y,width:0,height:0},Se.display,Se.placement)},onCloseTooltip:()=>Ze(),renderMovable:It,...D,cellRenderProps:{onFilterButtonMouseDown:(Se,xt)=>{D?.cellRenderProps?.onFilterButtonMouseDown(Se,xt),Vo(Se,xt)},...D?.cellRenderProps}},X),[L,ve,D,Ye,tt,l,g]),rn=s.useMemo(()=>{if(!te)return null;const Se=!Ct.isStructureAllowed();return a.jsx(Hu,{sx:{marginBottom:xt=>xt.spacing(.5),border:xt=>`solid ${Se?xt.palette.action.disabled:gt.alpha(xt.palette.divider,.2)} 1px`,borderRadius:xt=>`${xt.shape.borderRadius}px`,overflow:"hidden"},onClose:()=>{Me(!1),requestAnimationFrame(()=>{X.current.focus()})},readOnly:Se,commands:ve,ref:_e,scripts:F.getScripts()})},[te,ve,F,l,Ct]),Cn=s.useMemo(()=>{const Se=a.jsx(M2,{style:{...fd,marginRight:rn&&dt?"0px":"6px"},viewport:xe,touchElement:X.current?.getGridElement()?.stage,onScrollViewport:St=>{X.current?.getGridElement()?.scrollTo(St)},showHorizontalScrollbar:Wt||it,showVerticalScrollbar:nn,createHorizontalScrollbar:Sn,createVerticalScrollbar:Oo,children:Mt});let xt=Se;dt||(xt=a.jsxs(a.Fragment,{children:[Se,Jt]}));let jt=null,un=4,tn=13;return dt?jt="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(jt="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",un=13,tn=4),a.jsx(kd,{fixedPane:"after",position:"40%",minAfter:dt?"280px":"120px",splitDirection:dt?"row":"column",style:fd,ref:eo,resizerProps:{className:"styled-resizer",style:{minWidth:dt?"6px":void 0,minHeight:dt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${un}' height='${tn}' viewBox='0 0 ${un} ${tn}' version='1.1' fill='${H.palette.text.icon??H.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${jt}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:dt?"left center":"top center"}},elementBefore:xt,paneBeforeProps:{style:{flexDirection:"column"}},elementAfter:rn,paneAfterProps:{style:{marginLeft:dt?"0px":"4px",marginRight:dt?"8px":"4px"}}})},[Wt,it,Sn,nn,xe,rn,Mt,Jt,H,dt]),dn=s.useMemo(()=>({boxSizing:"border-box",background:Se=>Se.palette.mode!=="dark"?tt.header.fill:Se.palette.background.paper,"& *":{...J2(H),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${bn} 1px`},...c}),[c,tt]);return a.jsxs(V.Paper,{className:Qn("sheetxl-workbook",K_,{"Mui-focusVisible":K},G_,p),sx:dn,style:u,square:!1,...Q,ref:ae,onFocus:Se=>{ne(!0),wr(),f?.(Se)},onBlur:Se=>{ne(!1),h?.(Se)},onKeyDown:Se=>{Go(Se),m?.(Se)},onDragStart:Se=>{if(Se.target.src){const xt=new Image;xt.src=Se.target.src,Se.dataTransfer.setDragImage(xt,1,1)}},onDragEnter:lt,onDragLeave:lt,onDragOver:lt,onDrop:Ke,children:[a.jsxs("div",{className:Qn(qf),style:{flex:"1 1 100%",display:"flex",flexDirection:"column",opacity:ee?void 0:0,"--sxl-app-color-high-contrast":H.palette.primary.main,"--sxl-app-color-primary":H.palette.primary.main,"--sxl-app-color-primary-dark":H.palette.primary.dark,"--sxl-app-color-primary-light":H.palette.primary.light,"--sxl-app-color-info":H.palette.info.main,"--sxl-app-color-info-dark":H.palette.info.dark,"--sxl-app-color-info-light":H.palette.info.light,"--sxl-app-color-secondary":H.palette.secondary.main,"--sxl-app-color-secondary-dark":H.palette.secondary.dark,"--sxl-app-color-secondary-light":H.palette.secondary.light,"--sxl-app-color-success":H.palette.success.main,"--sxl-app-color-success-dark":H.palette.success.dark,"--sxl-app-color-success-light":H.palette.success.light,"--sxl-app-color-warning":H.palette.warning.main,"--sxl-app-color-warning-dark":H.palette.warning.dark,"--sxl-app-color-warning-light":H.palette.warning.light,"--sxl-app-color-error":H.palette.error.main,"--sxl-app-color-error-dark":H.palette.error.dark,"--sxl-app-color-error-light":H.palette.error.light,"--sxl-app-color-text":H.palette.text.primary,"--sxl-app-color-text-secondary":H.palette.text.secondary,"--sxl-app-color-text-disabled":H.palette.text.disabled,"--sxl-app-color-background":H.palette.background.paper,"--sxl-app-color-button-surface":H.palette.grey[600],"--sxl-app-color-shadow":H.palette.action.focus,"--sxl-app-color-grey":H.palette.grey[500],"--sxl-app-filter-dark-invert":tt.body.darkMode&&!G?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":tt.body.darkMode?`linear-gradient(${gt.alpha("#fff",Mn(5))}, ${gt.alpha("#fff",Mn(5))})`:void 0},children:[Gn,qt?Et:null,a.jsx(V.Box,{sx:{marginBottom:Se=>Se.spacing(.75)}}),Cn,kn,a.jsx(vr,{arrow:!0,disableInteractive:!0,open:Y,title:a.jsx(V.Typography,{variant:"subtitle2",component:"div",children:Ce}),placement:Qe,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:Oe,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:Y?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(Be.x,Be.y,Be.width,Be.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:a.jsx(V.Box,{})}),_o,st]}),Tt]})}));Cm.displayName="WorkbookElement";const iT=(e=!1,t=!1)=>t?null:{"& input:not(:focus):not(:hover)":{color:n=>n.palette.text.secondary},backgroundColor:n=>gt.alpha(n.palette.background.paper,.6),borderRadius:n=>`${n.shape.borderRadius}px`,border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:n=>n.palette.background.paper},"&:hover:not([disabled])":{border:n=>`solid ${e?n.palette.text?.primary:n.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:n=>`solid ${n.palette.primary.main} 1px !important`,border:n=>`1px solid ${n.palette?.primary?.main} !important`}},km=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,title:r="",placeHolder:i="Untitled",onTitleChange:l,readOnly:d=!1,hidden:c,...u}=e,[p,f]=s.useState(!1),[h,m]=s.useState(!1),[g,x]=s.useState(r??""),[y,v]=s.useState(""),[b,{width:C}]=Ra(),[k,{width:E}]=Ra(),[R,j]=s.useState(!1),B=s.useRef(null),T=s.useRef(null),_=Ro(t,()=>({requestWorkbookTitle:(w=null,S)=>{T.current={onAccept:w,requestReason:S?.requestReason},S?.selectAll&&B.current?.select(),B.current?.focus(S)},focus:w=>{B.current?.focus(w)}}),[]);return s.useLayoutEffect(()=>{j(r!==g),v(r),x(r)},[r]),s.useEffect(()=>{R&&C!==0&&Ht.debounce(()=>{j(!1)},300)()},[R,C]),s.useEffect(()=>{m(g&&!ei.isValidWindowsFilename(g))},[g]),c?null:a.jsx(V.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:R?"0":"1",transition:R?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:nc([_,k,t]),...u,children:a.jsx(No,{label:T.current?.requestReason??"Workbook Name",children:a.jsxs(V.Box,{className:Qn({"Mui-focusVisible":p}),sx:{visibility:C===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...iT(!0,d),...n},children:[d?a.jsx(V.Typography,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:g!==y?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:w=>h?w.palette.error.dark:void 0},children:r??i}):a.jsx(V.Input,{sx:{width:`${Math.min(C+3,Math.max(E,_.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:w=>h?w.palette.error.dark:void 0,fontStyle:g!==y?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:d,spellCheck:!1,placeholder:i,onFocus:w=>{f(!0),w.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:B},onBlur:()=>{f(!1),h?x(y):(g!==y&&(l?.(g),g&&T.current?.onAccept?.(g,"blur")),T.current=null)},onChange:w=>{if(w.target.value.length>ei.MAX_WORKBOOK_NAME_SIZE)return w.stopPropagation(),void w.preventDefault();x(w.target.value)},onKeyDown:w=>{(ei.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(w.key)||w.target?.value.length>ei.MAX_WORKBOOK_NAME_SIZE)&&w.preventDefault(),w.which===Zt.Enter||w.which===Zt.Tab?(h?x(y):(l?.(g),g&&(T.current?.onAccept?.(g,"keydown"),T.current=null)),w.stopPropagation(),w.preventDefault(),o?.focus()):w.which===Zt.Escape&&(g===y?o?.focus():(x(y),setTimeout(()=>{w.target?.select()},0)),T.current=null,w.stopPropagation(),w.preventDefault())},value:g}),a.jsx(V.Box,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:g!==y?"italic":void 0,fontFamily:w=>w.typography.fontFamily,letterSpacing:"0.00938em"},children:g||i})]})})})}));km.displayName="WorkbookTitle";const lT=s.lazy(()=>Promise.resolve().then(()=>require("./Dd-24dPmZyIm2GZn.cjs")).then(e=>e.EagerStandaloneWorkbook)),Em=s.memo(s.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,...l}=e;return i&&z.LicenseManager.setLicenseKey(i),a.jsx(a.Fragment,{children:a.jsx(lT,{...l,className:r,sx:n,style:o,ref:t})})}));Em.displayName="StandaloneWorkbook";const aT=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],sT=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class _m{constructor(t=aT,n=sT){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const t=[],n=this._readFormatType;for(let o=0;o<n.length;o++)for(let r=0;r<n[o].exts.length;r++)t.push("."+n[o].exts[r]);return t}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");try{return(await Promise.resolve().then(()=>f8)).WorkbookIO.writeFile(t,n,o)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(t,n){let o,r;const i=await n?.showBusy?.(`Opening${t.name?` ${t.name}`:""}...`);try{r=await Promise.resolve().then(()=>f8)}catch(l){throw l}try{return await r.WorkbookIO.read({...t,async onStart(l){await t?.onStart?.(l),o=await n?.showBusy?.(`Opening '${l}'...`)}})}catch(l){throw i?.(),o?.(),l}finally{i?.(),o?.()}}}const cT=new _m;exports.$i=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),a.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.A0=Mo,exports.AppearanceCommandButton=b_,exports.AutoColorPosition=Wi,exports.Be=Ys,exports.Bi=Gh,exports.Bn=kp,exports.BorderCommandButton=Rf,exports.BorderPopupButton=Mf,exports.BorderStyleButton=jf,exports.Checkboard=_f,exports.ClearCommandButton=ku,exports.ColorButton=Q1,exports.ColorCommandButton=ol,exports.ColorPanel=Tf,exports.ColorPanelType=Ef,exports.ColorPopupButton=Cu,exports.D8=e2,exports.DeleteCellsCommandButton=_u,exports.DocThemeCommandButton=Qf,exports.E5=ds,exports.Fi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),a.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.FillCommandButton=Af,exports.FilterColumnMenu=Au,exports.FilterCommandButton=f_,exports.Filters=cm,exports.FindCommandButton=Lf,exports.FontFamilyCommandButton=Bf,exports.FontSizeCommandButton=Of,exports.FormulaBar=Pu,exports.FreezeCommandButton=Df,exports.He=rl,exports.HelpCommandButton=v_,exports.Hi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731423 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605952 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z "}),a.jsx("path",{className:"styled secondary_light",d:"m 7.7187557,5.6810989 h 3.9153913 c 0.116687,0 0.211776,0.096094 0.211776,0.2127813 v 0.8457422 c 0,0.1166881 -0.09489,0.2117769 -0.211776,0.2117769 H 7.7187557 c -0.116688,0 -0.2117768,-0.094892 -0.2117768,-0.2117769 V 5.8938802 c 0,-0.116688 0.094893,-0.2127813 0.2117768,-0.2127813 z M 8.7772903,9.7481656 V 12.094422 H 13.203582 V 9.7481656 Z m 0,3.6164134 v 2.346263 H 13.203582 V 13.364579 Z M 14.473445,12.094422 H 17.03249 V 9.7481656 h -2.559045 z m 2.559045,1.270157 h -2.559045 v 2.346263 h 2.559045 z m 1.270159,-3.8291948 v 7.2330098 c 0,0.116688 -0.09489,0.211766 -0.211767,0.211766 H 7.7185701 c -0.116688,0 -0.2117768,-0.09489 -0.2117768,-0.211766 V 8.6898058 c 0,-0.116688 0.094893,-0.2117769 0.2117768,-0.2117769 H 18.090882 c 0.116688,0 0.211767,0.094893 0.211767,0.2117769 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.HorizontalAlignCommandButton=Fp,exports.Ie=Mh,exports.Ii=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),a.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),a.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.InsertCellsCommandButton=Eu,exports.InsertImageCommandButton=Ru,exports.InsertScriptCommandButton=xm,exports.Ka=dv,exports.L5=_n,exports.Li=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),a.jsx("path",{className:"styled secondary_light",d:"M 10.363689,16.028891 10.345659,15.996611 9.4734966,14.37091 8.5619879,16.028912 H 7.3633702 L 8.8418569,13.567063 7.3668314,10.90392 H 8.63729 l 0.018027,0.03581 0.872161,1.729842 0.907731,-1.765668 h 1.198618 l -1.478485,2.616296 1.482266,2.512154 z m 4.665607,0 h -2.953777 v -5.124987 h 1.137804 l -2.54e-4,4.102093 h 1.833979 z m 3.309014,-0.330196 h -2.55e-4 c -0.364996,0.290393 -0.822367,0.439348 -1.288281,0.419821 -0.483409,-0.01051 -0.964575,-0.07059 -1.43568,-0.179494 l -0.319438,-0.06109 0.118416,-0.907988 h 0.06109 c 0.496925,0.07435 0.997838,0.118671 1.500281,0.132932 0.484409,0 0.717711,-0.193763 0.717711,-0.585048 0.0084,-0.126168 -0.05033,-0.247587 -0.154462,-0.319436 -0.217293,-0.125426 -0.451866,-0.218549 -0.696178,-0.276375 -0.450111,-0.10039 -0.871457,-0.302915 -1.230924,-0.592056 -0.250844,-0.261105 -0.380767,-0.61484 -0.358989,-0.976048 -0.03205,-0.442856 0.145944,-0.875173 0.480903,-1.16658 0.372757,-0.27187 0.827876,-0.4063 1.288473,-0.380266 0.468637,0.0088 0.935799,0.05808 1.396139,0.147202 l 0.322941,0.06109 -0.09338,0.922278 h -0.0646 c -0.685413,-0.07536 -1.17709,-0.1149 -1.456957,-0.1149 -0.739246,0 -0.739246,0.35899 -0.739246,0.46663 v -2.53e-4 c -2.54e-4,0.124163 0.06334,0.239575 0.168479,0.305162 0.293896,0.149452 0.601566,0.269614 0.918754,0.35899 0.387778,0.100895 0.747253,0.288643 1.05167,0.548998 0.22756,0.265109 0.339963,0.610077 0.312175,0.958295 0.03504,0.464132 -0.141691,0.919267 -0.480905,1.238164 z m 3.631947,0.330195 v -0.03228 l -0.879468,-1.625958 -0.911511,1.658 -1.1951,2.55e-4 1.482273,-2.461843 -1.475286,-2.663143 h 1.270463 l 0.01803,0.0358 0.872162,1.729842 0.907988,-1.765667 h 1.184331 l -1.478492,2.616295 1.482272,2.512152 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.MergeCommandButton=If,exports.NamedCollectionEditor=Ou,exports.NamedInput=nm,exports.NumberFormatCommandButton=Pf,exports.PasteCommandButton=Mu,exports.PresetCellStylesCommandButton=Uf,exports.PresetTableStylesCommandButton=Kf,exports.Qt=je,exports.QuickFormulaSumCommandPopupButton=w_,exports.RangeInput=om,exports.Rd=wu,exports.RunScriptCommandButton=$u,exports.ScriptEditorToolbar=Vu,exports.ScriptWorkspace=Hu,exports.SheetTab=Fu,exports.SheetTabMenu=zu,exports.SheetZoomScale=Iu,exports.SheetsAllMenu=Bu,exports.So=({manager:e,commands:t,disabled:n,notifier:o=Ys})=>{const r=ue(l=>{try{e?.undo(l)}catch(d){o.showError?.(d)}},[e]),i=ue(l=>{try{e?.redo(l)}catch(d){o.showError?.(d)}},[e]);return s.useMemo(()=>{if(!t)return;const l={contains:c=>!0,focus(){}},d=[new je("undo",l,{label:"Undo",description:D5,shortcut:{key:"z",modifiers:[ke.Ctrl]},disabled:!0},r),new je("redo",l,{label:"Redo",description:L5,shortcut:[{key:"y",modifiers:[ke.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[ke.Alt]}],disabled:!0},i)];t?.addCommands(d,!0)},[t]),s.useEffect(()=>{if(!t)return;const l=()=>{const c=e?.getTopUndoDescription(),u={};var p;t.getCommand("undo").update({disabled:n||!e||!e.hasUndo(),description:c?(p=c,`Undo ${p}`):D5,state:u,context:{undoManager:e}});const f=e?.getTopRedoDescription();t.getCommand("redo").update({disabled:n||!e||!e.hasRedo(),description:f?Ng(f):L5,state:u,context:{undoManager:e}})};if(l(),!e)return;const d=e.addListener({onStackChange(){l()}});return()=>d?.()},[e,t,n]),{undo:r,redo:i}},exports.SortFilterCommandButton=Tu,exports.StandaloneWorkbook=Em,exports.StatusBar=Du,exports.StyledStrokeIcon=S2,exports.T=ue,exports.THEME_ID=A0,exports.TableStyleCanvasPreview=Gf,exports.TableStyleOptionsPanel=x_,exports.TableStylePreview=Zf,exports.TextEffectsCommandButton=Nf,exports.TextOverflowCommandButton=Bp,exports.TextRotateCommandButton=Np,exports.ThemeMode={Light:"light",Dark:"dark"},exports.ThemeProvider=t9,exports.ThemeSelectButton=Xf,exports.ThemeSelectPanel=Yf,exports.ThemeSelectPopupButton=Jf,exports.Ui=e=>a.jsx(V.SvgIcon,{...e,children:a.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.UnderlineCommandButton=Vf,exports.UndoRedoCommandButton=ju,exports.VerticalAlignCommandButton=zp,exports.Vi=e=>a.jsx(V.SvgIcon,{...e,children:a.jsx("path",{d:"m 21.230627,10.984379 c -0.103549,0.265939 -0.204749,0.531861 -0.308302,0.80018 -0.244758,0.640136 -0.491882,1.277905 -0.736619,1.918041 -0.296532,0.77195 -0.595423,1.546223 -0.891972,2.31813 -0.256524,0.666043 -0.513056,1.332042 -0.769584,2.000408 -0.122381,0.320068 -0.244757,0.640136 -0.369488,0.960183 -0.0071,0.01647 -0.01412,0.03295 -0.01883,0.04942 0.0306,-0.07531 0.06355,-0.15062 0.09414,-0.22593 -0.05884,0.138855 -0.129439,0.273001 -0.218868,0.393024 0.04942,-0.06354 0.09885,-0.127085 0.148266,-0.190629 -0.05884,0.07531 -0.122381,0.141204 -0.197691,0.200041 0.06354,-0.04942 0.127084,-0.09885 0.190629,-0.148266 -0.05648,0.04001 -0.112965,0.07531 -0.17651,0.103549 0.07531,-0.0306 0.150621,-0.06355 0.225931,-0.09414 -0.08002,0.03295 -0.160037,0.05413 -0.244758,0.06825 0.08237,-0.01177 0.167093,-0.02353 0.249466,-0.03295 -0.17651,0.02354 -0.360077,0.01177 -0.536596,0.01177 H 16.596651 12.981767 8.5974282 4.7848441 c -0.6071714,0 -1.2143859,0.0047 -1.8239241,0 -0.037655,0 -0.07531,-0.0024 -0.115319,-0.0047 0.082372,0.01177 0.1670935,0.02353 0.2494657,0.03295 -0.070602,-0.0094 -0.1388548,-0.02824 -0.204749,-0.05177 0.07531,0.03059 0.1506203,0.06354 0.2259303,0.09414 -0.063545,-0.02824 -0.1247306,-0.06119 -0.1812132,-0.1012 0.063544,0.04942 0.1270848,0.09885 0.1906293,0.148266 -0.063544,-0.04942 -0.120027,-0.105903 -0.1694477,-0.169447 0.080018,0.138854 0.1623858,0.277705 0.2424039,0.416559 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023534,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063544,-0.216514 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.22593 0.1529742,-0.338895 0.2777048,-0.689539 0.4094974,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366189,-1.915717 0.2965322,-0.771949 0.593056,-1.546223 0.8919727,-2.31813 0.2565232,-0.670733 0.5154222,-1.3391 0.7719499,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765505,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.225931 0.058836,-0.131793 0.1270845,-0.256524 0.2141645,-0.371843 -0.049421,0.06354 -0.098846,0.127085 -0.1482661,0.190629 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223576 -0.063544,0.04942 -0.1270845,0.09885 -0.190629,0.148266 0.070602,-0.05413 0.1435581,-0.09649 0.2259303,-0.134146 -0.07531,0.03059 -0.1506203,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670939,0.02353 -0.2494658,0.03295 0.1718016,-0.02118 0.3506609,-0.0094 0.5224799,-0.0094 h 1.1014247 3.6642876 4.441143 3.777253 c 0.569517,0 1.139076,-0.0024 1.708592,0 0.09414,0 0.19063,0.0024 0.284768,0.01412 -0.08237,-0.01177 -0.167094,-0.02353 -0.249466,-0.03295 0.06119,0.0094 0.122381,0.02353 0.178859,0.04472 -0.07531,-0.03059 -0.15062,-0.06354 -0.22593,-0.09414 0.0353,0.01412 0.06589,0.03295 0.09649,0.05413 -0.06354,-0.04942 -0.127084,-0.09885 -0.190629,-0.148267 0.01883,0.01647 0.0353,0.03059 0.04942,0.04942 -0.04942,-0.06354 -0.09885,-0.127085 -0.148266,-0.190629 0.01412,0.01883 0.02589,0.04001 0.03765,0.06354 -0.03059,-0.07531 -0.06354,-0.15062 -0.09414,-0.22593 0.01177,0.03295 0.02118,0.06354 0.02589,0.09885 -0.01177,-0.08237 -0.02353,-0.167094 -0.03295,-0.249466 0.0024,0.04001 0.0024,0.08002 -0.0024,0.122381 0.01177,-0.08237 0.02353,-0.167094 0.03295,-0.249466 -0.01647,0.112965 -0.05177,0.221223 -0.09414,0.32713 0.03059,-0.07531 0.06354,-0.15062 0.09414,-0.22593 -0.0047,0.01412 -0.01177,0.02589 -0.01647,0.04001 -0.06825,0.108258 -0.105904,0.223577 -0.110612,0.350661 -0.02824,0.124731 -0.02353,0.249466 0.01647,0.376551 0.06119,0.218868 0.228284,0.454227 0.433011,0.562459 0.218868,0.115319 0.482458,0.174155 0.72487,0.09414 0.216515,-0.0706 0.468343,-0.214164 0.562459,-0.433011 0.07296,-0.171802 0.162386,-0.348312 0.197691,-0.534229 0.04707,-0.254169 0.05884,-0.449493 0.0071,-0.698963 C 23.085384,10.14653 22.838276,9.83117 22.534673,9.68055 22.233432,9.527576 21.908652,9.485213 21.572124,9.482859 h -0.400086 -2.167511 -3.348932 -3.68077 -3.2453915 -1.96512 c -0.1341464,0 -0.270647,-0.0047 -0.4047895,0.0094 -0.3341874,0.03765 -0.6542509,0.115319 -0.9366854,0.310656 -0.2918244,0.200041 -0.5295376,0.449494 -0.7083882,0.757792 -0.094138,0.160036 -0.1600361,0.336541 -0.2282842,0.508321 -0.2777051,0.724871 -0.5577682,1.449741 -0.8354688,2.172245 -0.4330112,1.127284 -0.866066,2.254612 -1.3014443,3.381896 -0.2894748,0.750734 -0.5789408,1.503835 -0.8660659,2.254612 -0.014121,0.03766 -0.028241,0.07531 -0.044717,0.112965 0.030595,-0.07531 0.063544,-0.15062 0.094138,-0.22593 -0.1200271,0.263585 -0.2000409,0.47071 -0.2118109,0.762525 -0.00471,0.120027 0.014121,0.24005 0.035302,0.355369 0.040009,0.195337 0.1412041,0.353015 0.2659393,0.508322 0.2165145,0.270647 0.5765741,0.491882 0.9178362,0.557768 0.1506203,0.02824 0.3012406,0.04707 0.4542277,0.04707 h 0.5106883 2.3134399 3.3748389 3.6501724 3.139484 1.840407 c 0.256523,0 0.513055,-0.0024 0.764849,-0.07531 0.30124,-0.08708 0.578941,-0.249466 0.800181,-0.473034 0.263585,-0.263585 0.418913,-0.578941 0.557768,-0.920203 0.01883,-0.04942 0.03765,-0.09885 0.05648,-0.148266 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.430688,-1.117903 0.859008,-2.235763 1.289696,-3.353666 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.01412,-0.03766 0.02824,-0.07296 0.04236,-0.110611 0.08237,-0.214165 0.01647,-0.534228 -0.09414,-0.72487 -0.115319,-0.195338 -0.338895,-0.381259 -0.562458,-0.433012 -0.24005,-0.05413 -0.510689,-0.04236 -0.724871,0.09414 -0.209457,0.143558 -0.331833,0.32713 -0.425971,0.567192 z M 17.898048,6.835008 v 3.146542 0.437745 c 0.313006,-0.313006 0.628388,-0.628388 0.941376,-0.941376 H 17.872141 15.462219 12.379196 9.3644251 7.1686842 c -0.6048476,0 -1.2308681,-0.04472 -1.7556719,0.329479 -0.4259712,0.303595 -0.7036976,0.69664 -0.8942966,1.179055 -0.016474,0.04001 -0.030595,0.08237 -0.047071,0.124731 -0.08943,0.232992 -0.1788593,0.465976 -0.2682935,0.698963 -0.3247757,0.844894 -0.6495602,1.68742 -0.9743401,2.532313 -0.3647851,0.948434 -0.7295611,1.899235 -1.0943633,2.847668 -0.2212223,0.571884 -0.4401122,1.146134 -0.6613086,1.718017 -0.011767,0.02824 -0.021181,0.05648 -0.032948,0.08473 0.030595,-0.07531 0.063544,-0.15062 0.094137,-0.22593 -0.1176729,0.258877 -0.1835671,0.44717 -0.2094567,0.729561 -0.01412,0.157682 0.00471,0.329479 0.056483,0.480091 0.5742503,-0.242404 1.1461337,-0.482458 1.7203839,-0.72487 -0.035302,-0.04942 -0.065894,-0.1012 -0.091784,-0.157683 0.030595,0.07531 0.063545,0.150621 0.094137,0.225931 -0.028241,-0.0706 -0.049421,-0.138855 -0.06119,-0.214165 0.011767,0.08237 0.023534,0.167094 0.032948,0.249466 -0.018827,-0.160036 -0.00706,-0.32713 -0.00706,-0.489516 V 17.813782 14.311863 10.0639 6.4019361 c 0,-0.5813076 -0.00471,-1.1649394 0,-1.7462474 0,-0.037655 0.00235,-0.077664 0.00471,-0.115319 -0.011767,0.082372 -0.023535,0.1670938 -0.032948,0.2494657 0.00941,-0.072956 0.028241,-0.1435583 0.056483,-0.2118106 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.2259303 0.028241,-0.065894 0.063544,-0.1270848 0.108257,-0.1859212 -0.049421,0.063544 -0.098845,0.1270845 -0.1482661,0.190629 0.044717,-0.056483 0.094138,-0.1059032 0.1506203,-0.15062 -0.063544,0.049421 -0.1270848,0.098846 -0.1906293,0.1482661 0.058836,-0.042362 0.1200271,-0.077664 0.1859213,-0.1082571 -0.07531,0.030595 -0.1506203,0.063544 -0.2259303,0.094137 0.068248,-0.028241 0.1388545,-0.044717 0.2118106,-0.056483 -0.082372,0.011768 -0.1670935,0.023535 -0.2494658,0.032948 0.1929832,-0.018827 0.3906703,-0.00471 0.5836318,-0.00471 h 1.2473072 2.873532 0.6636754 C 7.9429095,4.60862 7.6722712,4.453292 7.401628,4.2979723 7.8887769,4.938108 8.3736017,5.578244 8.8607503,6.2183797 8.9289983,6.3101637 8.9996049,6.3995929 9.0678531,6.4913809 9.2184733,6.6890719 9.3785094,6.8726392 9.6350456,6.929126 9.7056476,6.9456 9.8186129,6.959721 9.891569,6.962074 h 0.049421 0.642503 2.704105 3.071232 c 0.548343,0 1.099053,-0.00471 1.647397,0 0.03765,0 0.07531,0.00235 0.115319,0.00471 -0.08237,-0.011767 -0.167094,-0.023534 -0.249466,-0.032948 0.07296,0.00941 0.143559,0.028241 0.211811,0.056483 -0.07531,-0.030595 -0.15062,-0.063545 -0.22593,-0.094137 0.06589,0.028241 0.127085,0.063544 0.185921,0.108257 -0.06354,-0.049421 -0.127085,-0.098845 -0.190629,-0.1482661 0.05648,0.044717 0.105903,0.094137 0.15062,0.15062 -0.04942,-0.063545 -0.09885,-0.1270845 -0.148266,-0.190629 0.04236,0.058836 0.07766,0.1200271 0.108257,0.1859213 -0.03059,-0.07531 -0.06354,-0.1506203 -0.09414,-0.2259303 0.02824,0.068248 0.04472,0.1388545 0.05648,0.2118106 -0.01177,-0.082372 -0.02354,-0.1670938 -0.03295,-0.2494658 0.0024,0.032948 0.0047,0.065894 0.0047,0.096492 0.0047,0.2447577 0.1012,0.4918825 0.275351,0.6660425 0.162386,0.1623858 0.430688,0.2871209 0.666043,0.2753509 0.501263,-0.023534 0.9508,-0.4142054 0.941376,-0.9413763 -0.01883,-0.9672827 -0.793123,-1.7415564 -1.760363,-1.7556716 -0.110611,-0.00235 -0.218868,0 -0.32948,0 h -1.795679 -2.525255 -2.311073 c -0.383613,0 -0.769583,-0.00941 -1.1531914,0 H 9.8892086 C 10.159856,5.2346612 10.430495,5.3899892 10.701138,5.5453089 10.183391,4.8651512 9.6679691,4.1850366 9.150223,3.5048786 9.117275,3.4601618 9.0819748,3.415449 9.0490234,3.3707322 9.0419632,3.3636719 9.0372561,3.354258 9.0301959,3.347198 8.8960493,3.1730422 8.7854381,3.0483116 8.5783352,2.9612316 8.4300691,2.8976871 8.4182991,2.8859213 8.2135504,2.8812136 c -0.070602,-0.00235 -0.1388545,0 -0.2094567,0 H 6.80619 3.5984533 c -0.2188681,0 -0.4353783,-0.00471 -0.6542509,0 -0.3271299,0.00471 -0.6731002,0.091784 -0.9460669,0.2800586 -0.3412493,0.2329922 -0.5671925,0.5318615 -0.715446,0.9178366 -0.072956,0.1859213 -0.094137,0.3930238 -0.094137,0.593056 -0.00235,0.4353786 0,0.8707569 0,1.3061785 v 2.6711407 3.372472 3.334817 2.635853 c 0,0.409498 -0.00235,0.818987 0,1.228502 0.00235,0.338895 0.091784,0.70133 0.2894748,0.979031 0.1388545,0.195337 0.3177138,0.37655 0.5624586,0.433011 0.2094567,0.04707 0.4142057,0.03766 0.6119054,-0.04707 0.4071434,-0.171801 0.6989637,-0.663675 0.5460196,-1.110802 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023535,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063545,-0.216514 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.22593 0.1529742,-0.338895 0.2777051,-0.689539 0.4094977,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366186,-1.915717 0.2965325,-0.771949 0.5930563,-1.546223 0.8919727,-2.31813 0.2565235,-0.670733 0.5154225,-1.3391 0.7719502,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765502,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094138,0.22593 0.058837,-0.131793 0.1270848,-0.256523 0.2141648,-0.371843 -0.049421,0.06354 -0.098845,0.127085 -0.1482661,0.19063 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223577 -0.063544,0.04942 -0.1270848,0.09885 -0.1906293,0.148267 0.070602,-0.05413 0.1435584,-0.09649 0.2259303,-0.134147 -0.07531,0.03059 -0.15062,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670936,0.02354 -0.2494658,0.03295 0.1435584,-0.01647 0.2941786,-0.0094 0.4401122,-0.0094 h 0.8731262 2.9394612 3.574862 3.120678 c 0.503631,0 1.004938,0.0071 1.508569,0 h 0.02118 c 0.508321,0 0.941376,-0.430688 0.941376,-0.941376 V 7.2703743 6.8326289 c 0,-0.4918825 -0.433011,-0.9649159 -0.941376,-0.9413759 -0.508322,0.025888 -0.941376,0.4165592 -0.941376,0.9437427 z"})}),exports.ViewGridLinesCommandButton=Ff,exports.ViewHeadingsCommandButton=Hf,exports.WalkingCopyCommandButton=ec,exports.Wi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),a.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),a.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.WorkbookContextMenu=Uu,exports.WorkbookElement=Cm,exports.WorkbookIO=cT,exports.WorkbookStrip=Wu,exports.WorkbookTitle=km,exports.WorkbookViewCommandButton=$f,exports.Yt=Ht,exports.Yt$1=Qh,exports.Z=ke,exports.Z0=Bo,exports.Zt=Lt,exports._WorkbookIO=_m,exports._extends=I1,exports._objectWithoutPropertiesLoose=Nu,exports._setPrototypeOf=D1,exports.cl=()=>{const{showModal:e}=ds();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const l=e(hw,{defaultOption:n,cancelOption:o,...r,onOption(d){r?.onOption?.(d,d===o,d===n),i({input:"",option:d})},onInputOption(d,c){r?.onInputOption?.(d,c),i({input:d,option:c})},onDone:()=>{r?.onDone?.(),l.hide()}})})}},exports.clsx=Qn,exports.commonjsGlobal=Li,exports.createGridStyleFromMUITheme=E2,exports.createTheme=Xp,exports.defaultNewWorkbook=wm,exports.defaultTheme=e9,exports.ed=e=>a.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[a.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),a.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),a.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),a.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.eo=Zt,exports.g4=Pn,exports.getDefaultExportFromCjs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.getOverlayAlpha=Mn,exports.go=V0,exports.gr=Re,exports.gt=Xt,exports.il=function(e){var t=e.children,n=e.legacy,o=n!==void 0&&n,r=e.suspense,i=r===void 0||r,l=e.fallback,d=l===void 0?null:l,c=s.useReducer(Mv,jv),u=c[0],p=c[1],f=s.useCallback(function(v,b){var C=pp(b,Rv);v?p({type:Mr.UPDATE,payload:{id:v,props:C}}):console.error(Pc)},[p]),h=s.useCallback(function(v){v?p({type:Mr.HIDE,payload:{id:v}}):console.error(Pc)},[p]),m=s.useCallback(function(v){v?p({type:Mr.DESTROY,payload:{id:v}}):console.error(Pc)},[p]),g=s.useCallback(function(v){v?p({type:Mr.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),x=s.useCallback(function(v,b,C){var k=mp(8);return C&&C.rootId&&(k=C.rootId+"."+k),p({type:Mr.SHOW,payload:{id:k,component:v,props:b,options:C}}),{id:k,hide:function(){return h(k)},destroy:function(){return m(k)},update:function(E){return f(k,E)}}},[p,h,m,f]),y=i?s.Suspense:s.Fragment;return s.createElement(fp.Provider,{value:{state:u,updateModal:f,hideModal:h,destroyModal:m,showModal:x,destroyModalsByRootId:g}},t,s.createElement(y,Object.assign({},i&&{fallback:d}),Object.keys(u).map(function(v){var b,C=u[v],k=C.component,E=C.props,R=C.options,j=function(){var B,T;E!=null&&E.onExited&&E.onExited.apply(E,arguments),E!=null&&(B=E.TransitionProps)!=null&&B.onExited&&(T=E.TransitionProps).onExited.apply(T,arguments),m(v)};return b=o?{onExited:j}:{TransitionProps:qo({},E?.TransitionProps,{onExited:j})},s.createElement(k,Object.assign({},E,{key:v,onClose:function(){R&&R.hideOnClose&&h(v),R&&R.destroyOnClose&&R.hideOnClose&&m(v),E&&E.onClose&&E.onClose.apply(E,arguments)}},R&&!R.destroyOnClose&&b))})))},exports.isPlainObject=p0,exports.j7=Q2,exports.ji=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),a.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),a.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports.jt=vt,exports.jt$1=il,exports.k7=X2,exports.ki=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),a.jsx("path",{className:"styled secondary_light",d:"m 22.499719,10.752378 -1.867399,5.486926 h -1.267987 l -1.859714,-5.486926 h 1.175769 l 1.02976,3.266027 q 0.03074,0.08453 0.08453,0.315076 0.06148,0.222858 0.122956,0.476455 0.06148,0.245913 0.08453,0.414978 0.02305,-0.169065 0.07685,-0.414978 0.06148,-0.253597 0.122956,-0.476455 0.06148,-0.230544 0.08453,-0.315076 l 1.037444,-3.266027 z m -5.302496,3.965341 q 0,0.730053 -0.530249,1.168085 -0.522565,0.430347 -1.490846,0.430347 -0.868379,0 -1.552323,-0.330445 v -1.083552 q 0.391923,0.169065 0.8069,0.315075 0.422663,0.138326 0.83764,0.138326 0.430348,0 0.607097,-0.16138 0.184435,-0.169065 0.184435,-0.422663 0,-0.207488 -0.146011,-0.353499 -0.138326,-0.146011 -0.376554,-0.268967 -0.238228,-0.130641 -0.545618,-0.276652 -0.19212,-0.09222 -0.414978,-0.215173 -0.222858,-0.130641 -0.430347,-0.315076 -0.199804,-0.192119 -0.330445,-0.461086 -0.130641,-0.268967 -0.130641,-0.645521 0,-0.737738 0.49951,-1.14503 0.49951,-0.414978 1.360204,-0.414978 0.430347,0 0.814586,0.0999 0.391923,0.0999 0.814585,0.284337 l -0.376553,0.906802 q -0.376554,-0.153695 -0.67626,-0.238227 -0.299706,-0.08453 -0.614782,-0.08453 -0.330445,0 -0.507195,0.153695 -0.176749,0.153696 -0.176749,0.399609 0,0.292021 0.261282,0.461086 0.261282,0.169065 0.776162,0.414977 0.422662,0.199804 0.714683,0.414978 0.299706,0.215173 0.461087,0.507195 0.16138,0.292021 0.16138,0.722368 z m -5.801995,-3.073908 q -0.668575,0 -1.022074,0.49951 -0.3535,0.49951 -0.3535,1.367889 0,0.876064 0.322761,1.360205 0.330445,0.476455 1.052813,0.476455 0.33813,0 0.668575,-0.07685 0.33813,-0.07685 0.730053,-0.215174 v 0.975966 q -0.361184,0.14601 -0.714683,0.215173 -0.3535,0.06916 -0.791532,0.06916 -0.845324,0 -1.3986278,-0.345814 -0.5456187,-0.3535 -0.8069009,-0.983651 -0.2612821,-0.637836 -0.2612821,-1.483161 0,-0.829955 0.299706,-1.467791 0.299706,-0.637836 0.868379,-0.99902 0.5763578,-0.361184 1.4063128,-0.361184 0.407293,0 0.814586,0.107587 0.414977,0.0999 0.791531,0.276652 l -0.376554,0.945226 q -0.30739,-0.14601 -0.622466,-0.253597 -0.307391,-0.107587 -0.607097,-0.107587 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),a.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.ko=xa,exports.la=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1z"}),a.jsx("path",{d:"M11 7h2v6h-2zm0 8h2v2h-2z"})]}),exports.ll=function(){const[e,t]=s.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=ds({disableAutoDestroy:!0});return(l,d,c,u)=>new Promise((p,f)=>{const h={...c,onHide:()=>{const y=e.get(l);c?.onHide?.(),t(v=>(v.delete(l),v)),i(y.id)},onDone:y=>{const v=e.get(l);t(b=>(b.delete(l),b)),c?.onDone?.(y),v&&v.id&&!u?.disableAutoDestroy&&r(v.id)},onShown:y=>{t(v=>{const b=v.get(l);return v.set(l,{...b,element:y}),v}),p(y)},open:!0},m=e.get(l);if(m)return o(m.id,h),void p(m.element);if(!d)return void f("invalid function");const g=s.lazy(d),x=n(g,h,{destroyOnClose:!u?.disableAutoDestroy});t(y=>(y.set(l,{id:x.id,element:null}),y))})},exports.mergeRefs=nc,exports.n2=No,exports.ol=hp,exports.renderWorkbookToolbars=bm,exports.requirePropTypes=za,exports.ro=gn,exports.s0=fn,exports.sl=()=>{const{showModal:e}=ds();return t=>new Promise(n=>{const o=e(uw,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.styleFunctionSx=al,exports.tl=(e,t)=>{let n=Od({palette:{mode:e?"dark":"light"}}),o={typography:{},palette:{mode:e?"dark":"light",text:{secondary:e?n.palette.text.secondary:gt.alpha(n.palette.text.secondary,.75),icon:e?gt.alpha(n.palette.text.secondary,.7):gt.alpha(n.palette.text.primary,.75)}},components:{MuiDialogTitle:{styleOverrides:{root:{fontWeight:"normal"}}},MuiSelect:{styleOverrides:{iconOutlined:{top:"unset"}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"0px !important",overflow:"hidden",marginLeft:"0px",marginRight:"6px",padding:"1px 1px",border:"solid transparent 1px"}}},MuiMenuItem:{styleOverrides:{root:{paddingTop:"2px",paddingBottom:"2px",marginLeft:"4px",marginRight:"4px",paddingLeft:"6px",paddingRight:"18px",borderRadius:"4px",fontSize:"0.875em","@media (pointer: coarse)":{fontSize:"1em"},"&.Mui-selected":{}}}},MuiDivider:{styleOverrides:{root:{marginTop:"4px !important",marginBottom:"4px !important",marginLeft:"0px",marginRight:"0px"}}},MuiPopper:{styleOverrides:{root:{"& .menu":{marginTop:"4px",marginBottom:"4px",borderRadius:"4px"}}}},SmartInputField:{styleOverrides:{automatic:{transition:"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",color:function(){return n.palette.text.secondary}},dirty:{fontStyle:"italic",color:function(){return n.palette.text.secondary}}}}}},r=o;return t&&(r=S8.deepmerge(o,t)),Od(r)},exports.ul=el,exports.useMeasure=Ra,exports.useResolvedThemeMode=function(e){const{mode:t}=e||{},[n,o]=s.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=s8();if(r)return{themeMode:r,source:"class"}}return{themeMode:c8(),source:"media"}});return s.useEffect(()=>{if(t&&t!==n?.themeMode)return void o({themeMode:t,source:"prop"});const r=()=>{const c=s8();if(c)o({themeMode:c,source:"class"});else{const u=c8();o({themeMode:u,source:"media"})}},i=new MutationObserver(r),l=[document.documentElement,document.body].filter(Boolean);for(const c of l)i.observe(c,{attributes:!0,attributeFilter:["class"]});const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",r),r(),()=>{i.disconnect(),d.removeEventListener("change",r)}},[t]),n},exports.useTheme=qr,exports.useWorkbookCommands=vm,exports.vo=$t,exports.x5=ye,exports.y3=i0,exports.ye=r0,exports.zi=e=>a.jsxs(V.SvgIcon,{...e,children:[a.jsx("path",{d:"m 6.3819062,2.5159671 c -0.4338889,0 -0.7857055,0.3518167 -0.7857055,0.7857177 V 20.587402 c 0,0.433902 0.3518166,0.785718 0.7857055,0.785718 H 18.953342 c 0.433889,0 0.785705,-0.351816 0.785705,-0.785718 V 7.2302615 h -3.928564 c -0.433901,0 -0.785718,-0.3518167 -0.785718,-0.7857178 V 2.5159671 Z m -2.357141,0.7857177 c 0,-1.3018621 1.0552788,-2.35714102 2.357141,-2.35714102 h 9.4285768 c 0.208352,0 0.408296,0.0827447 0.555609,0.23010782 l 4.714283,4.7142821 c 0.147327,0.1473145 0.230107,0.3472578 0.230107,0.55561 V 20.587402 c 0,1.301863 -1.055278,2.357142 -2.35714,2.357142 H 6.3819062 c -1.3018622,0 -2.357141,-1.055279 -2.357141,-2.357142 z"}),a.jsx("path",{className:"styled info",d:"M 13.729115,7.5208126 H 11.903278 V 11.108007 H 8.3163096 v 1.825837 h 3.5869684 v 3.586969 h 1.825837 v -3.586969 h 3.587195 v -1.825837 h -3.587195 z"})]});
|