@sheetxl/studio-mui 0.6.17 → 0.6.18

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.
Files changed (38) hide show
  1. package/browser/cjs/{C9BPJY6JdfqxC-N2.cjs → BN4aFZRab6VVCDRf.cjs} +1 -1
  2. package/browser/cjs/{BdTQ83hJlfAjrSHE.cjs → BNykDmn-jxiYcIQj.cjs} +1 -1
  3. package/browser/cjs/{CYT4DxEbW1ffcGcf.cjs → BYTvEMkYL0RP_ps4.cjs} +2 -2
  4. package/browser/cjs/{CDIueroivzT9JX83.cjs → CUkp30ObmoYCJQ1t.cjs} +2 -2
  5. package/browser/cjs/{D9kjw86UIk_mSbIA.cjs → CdB9FUSOOcgfgefd.cjs} +1 -1
  6. package/browser/cjs/{BnlDMBjbtlxRdeGI.cjs → D9hFxTxVmINH11I5.cjs} +2 -2
  7. package/browser/cjs/{DpPTCw6UGCWqpvJm.cjs → DA6AaNv2yQwpHkNX.cjs} +2 -2
  8. package/browser/cjs/{COUujnMxQON551RK.cjs → DQVEvZcBdQ5wUgah.cjs} +3 -3
  9. package/browser/cjs/{D1vtoOMofYXyPjfs.cjs → DTF-sH8eYVxIMWj1.cjs} +1 -1
  10. package/browser/cjs/{BrISuxNuulzjYG6D.cjs → Dkrv98Pt_gBc35aF.cjs} +2 -2
  11. package/browser/cjs/{DaMS46ubq-CvkGAz.cjs → I-JJQgHQPDyvk6HH.cjs} +1 -1
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/{rusNkCEiRwudCFJP.cjs → rE5-I8fnfIULvQXU.cjs} +4 -4
  14. package/browser/esm/{CSPAQ9ecny14VVfY.mjs → BKOIurW3mYEcnCTS.mjs} +2 -2
  15. package/browser/esm/{D791knE1ZDTUU7RM.mjs → BWjaUMYWGFwkVa5H.mjs} +4 -4
  16. package/browser/esm/{CPf_MwBTmafa9y3J.mjs → BlCa3HIR23dHGfTM.mjs} +1 -1
  17. package/browser/esm/{C_K6SZoRnkzjKhzi.mjs → BmrGIoLQK76R0aN6.mjs} +2 -2
  18. package/browser/esm/{DFSPa2QQ7VIBhJyO.mjs → C2GUfkj50aw_nr70.mjs} +1 -1
  19. package/browser/esm/{4s_HY7CZU1sb08hV.mjs → C8oyzGVcvYnR6Jw8.mjs} +2 -2
  20. package/browser/esm/{DI4NEyf_YQMCmDkO.mjs → CAFSDtARvE6zD6L_.mjs} +1 -1
  21. package/browser/esm/{DwmUJBpeHRsqE34s.mjs → CIgXbeqCnCfVQrLW.mjs} +2 -2
  22. package/browser/esm/{Bp2HqaxWofhwHGFt.mjs → DdXINikeTgiJnXFw.mjs} +3 -3
  23. package/browser/esm/{fG_bsWGpSZMY9S5w.mjs → DrHM88KIJrh6rDV1.mjs} +2 -2
  24. package/browser/esm/{D1rAn-JqY4A4_lvT.mjs → WCbdqe0I4CQAyhax.mjs} +1 -1
  25. package/browser/esm/index.mjs +2 -2
  26. package/browser/esm/{Cp3eCRiUcCWg_Gr-.mjs → ns8UMyaw-8Mb76pu.mjs} +1 -1
  27. package/node/esm/{DGkXEeZi7ZznpSUW.mjs → B14zbQ6YYVVNISVd.mjs} +1 -1
  28. package/node/esm/{DB3g7AAaJDuvuOn_.mjs → BthUgPPH-I3a5EDi.mjs} +1 -1
  29. package/node/esm/{CP1u5t60rlnwgLJT.mjs → C2BsnfIZHmFJow9U.mjs} +1 -1
  30. package/node/esm/{g8yqhj0UM1YmL6pO.mjs → CD5iSnfD-urKHi6O.mjs} +1 -1
  31. package/node/esm/{DnebVabwlZHVdBAR.mjs → CdYw8eNVbzodCDva.mjs} +1 -1
  32. package/node/esm/{DSOo9oOzd7dfe7zz.mjs → CnVeHGEuzAOXhq-V.mjs} +1 -1
  33. package/node/esm/{iPgqd1TUZlJYevu_.mjs → DQI5z6JQBCOqFS7x.mjs} +1 -1
  34. package/node/esm/{BmS_Uj9oafebf8_Y.mjs → DiVBqpFMiK2Bdi3T.mjs} +1 -1
  35. package/node/esm/{EO_oSkn9dEzznzqn.mjs → DnG1pT1raJ-k6z1l.mjs} +1 -1
  36. package/node/esm/{8_QeqcrbChb6isAo.mjs → bKzQAG3c-526EaEs.mjs} +1 -1
  37. package/node/esm/index.mjs +4 -4
  38. package/package.json +8 -8
@@ -1,9 +1,9 @@
1
1
  "use strict";var El=Object.create;var Mn=Object.defineProperty;var Bl=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var Rl=Object.getPrototypeOf,Ml=Object.prototype.hasOwnProperty;var Pl=(l,i,n,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Il(i))!Ml.call(l,r)&&r!==n&&Mn(l,r,{get:()=>i[r],enumerable:!(t=Bl(i,r))||t.enumerable});return l};var Pn=(l,i,n)=>(n=l!=null?El(Rl(l)):{},Pl(i||!l||!l.__esModule?Mn(n,"default",{value:l,enumerable:!0}):n,l));/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.17
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.18
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.
6
- */const O=require("@sheetxl/sdk"),e=require("react/jsx-runtime"),a=require("react"),E=require("@mui/material"),o=require("@sheetxl/utils-mui"),me=require("@mui/icons-material"),k=require("@sheetxl/utils-react"),G=require("@mui/material/styles"),le=require("@sheetxl/react"),Re=require("@mui/system"),Je=require("react-dom"),Fe=require("@sheetxl/utils"),it=require("@sheetxl/io");function vr(l){var i,n,t="";if(typeof l=="string"||typeof l=="number")t+=l;else if(typeof l=="object")if(Array.isArray(l)){var r=l.length;for(i=0;i<r;i++)l[i]&&(n=vr(l[i]))&&(t&&(t+=" "),t+=n)}else for(n in l)l[n]&&(t&&(t+=" "),t+=n);return t}function fe(){for(var l,i,n=0,t="",r=arguments.length;n<r;n++)(l=arguments[n])&&(i=vr(l))&&(t&&(t+=" "),t+=i);return t}const jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=a.useMemo(()=>{for(let u=0;u<s.length;u++)if(s[u]?.state())return s[u].key();return s[0]?.key()},[s]),h=a.useMemo(()=>{const u=new Map;return u.set("formatAlignLeftToggle",o.themeIcon(e.jsx(me.FormatAlignLeft,{}))),u.set("formatAlignCenterToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),u.set("formatAlignRightToggle",o.themeIcon(e.jsx(me.FormatAlignRight,{}))),u.set("formatAlignJustifyToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignCenterContinuousToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),u.set("formatAlignFillToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignDistributedHorizontalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u},[]),p=a.useMemo(()=>{if(!t)return null;const u={...t};return delete u.beforeExecute,u},[t]),x=a.useCallback((u,f)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignLeftToggle"),icon:h.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignCenterToggle"),icon:h.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignRightToggle"),icon:h.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignJustifyToggle"),icon:h.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignCenterContinuousToggle"),icon:h.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignFillToggle"),icon:h.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignDistributedHorizontalToggle"),icon:h.get("formatAlignDistributedHorizontalToggle")})]}),C=e.jsxs(E.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:f.getCommand("formatIndentDecrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:f.getCommand("formatIndentIncrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),b=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...g,children:[C,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return o.defaultCreatePopupPanel({...u,children:b})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,commands:n,commandHook:t,scope:r,createPopupPanel:x,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:h.get(d)??e.jsx(me.FormatAlignLeft,{}),...g})})),Tr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatAlignTopToggle",o.themeIcon(e.jsx(o.TextVerticalTopIcon,{}))),p.set("formatAlignMiddleToggle",o.themeIcon(e.jsx(o.TextVerticalCenterIcon,{}))),p.set("formatAlignBottomToggle",o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{}))),p.set("formatAlignJustifyVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignDistributedVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:h,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{})),...m})})),Er=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatTextOverflowVisibleToggle",o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{}))),p.set("formatTextOverflowWrapToggle",o.themeIcon(e.jsx(o.TextHorizontalWrapIcon,{}))),p.set("formatTextOverflowClipToggle",o.themeIcon(e.jsx(o.TextHorizontalClipIcon,{}))),p.set("formatTextOverflowShrinkToggle",o.themeIcon(e.jsx(o.TextHorizontalShrinkIcon,{}))),p},[]),h=k.useCallbackRef((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Br=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),s=a.useMemo(()=>{const x=g.length;for(let u=0;u<x;u++){const f=g[u];if(f?.state())return f.key()}return g[1]?.key()},[g]),d=a.useMemo(()=>{const x=new Map;return x.set("formatTextRotate0",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),x.set("formatTextRotate315",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),x.set("formatTextRotate45",o.themeIcon(e.jsx(o.TextRotation45Icon,{}))),x.set("formatTextRotate90",o.themeIcon(e.jsx(o.TextRotation90Icon,{}))),x.set("formatTextRotate270",o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))),x.set("formatTextRotateCustom",o.themeIcon(e.jsx(o.TextRotationCustomIcon,{}))),x},[]),h=a.useCallback((x,u)=>{const f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...f,command:u.getCommand("formatTextRotateCustom"),icon:o.themeIcon(e.jsx(o.TextRotationCustomIcon,{})),label:"Custom"})]});return o.defaultCreatePopupPanel({...x,children:S})},[c,t,r,n]),p=a.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[g]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,selected:p,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:h,quickCommand:p?"formatTextRotate0":"formatTextRotate315",icon:o.themeIcon(d.get(s)??e.jsx(o.TextRotation315Icon,{})),...m})})),Ir={Preset:"preset",Custom:"custom"},dt={Start:"start",End:"end"},bo={},Dl=(l,i,n,t)=>{const r=l+"-"+i+"-"+n+(t?"-server":"");if(bo[r])return bo[r];const c=((m,g,s,d)=>{if(typeof document>"u"&&!d)return null;const h=d?new d:document.createElement("canvas");h.width=2*s,h.height=2*s;const p=h.getContext("2d");return p?(p.fillStyle=m,p.fillRect(0,0,h.width,h.height),p.fillStyle=g,p.fillRect(0,0,s,s),p.translate(s,s),p.fillRect(0,0,s,s),h.toDataURL()):null})(l,i,n,t);return bo[r]=c,c},Fl={},Rr=a.memo(l=>{const{className:i,style:n=k.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:c=8,borderRadius:m,boxShadow:g,renderers:s=Fl,children:d,...h}=l,p=d,x=a.useMemo(()=>Object.assign({borderRadius:m,boxShadow:g,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${Dl(t,r,c,s?.canvas)}) center left`},n),[t,r,c,s]);return a.isValidElement(d)?a.cloneElement(d,{...p.props}):e.jsx("div",{style:x,...h})}),Nl=a.memo(l=>{const{selectedColor:i,onSelectColor:n,onPreviewColor:t,onClick:r,onKeyDown:c,onMouseOver:m,onMouseLeave:g,onFocus:s,style:d=k.ReactUtils.EmptyCssProperties,children:h,alphaWhite:p,alphaGrey:x,darkMode:u,alphaCheckSize:f=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const y=a.useCallback(B=>{r?.(B),B.isDefaultPrevented()||(B.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),C=a.useCallback(B=>{m?.(B),B.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),b=a.useCallback(B=>{g?.(B),B.isDefaultPrevented()},[t,g]),w=a.useCallback(B=>{s?.(B),B.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),j=a.useCallback(B=>{c?.(B),B.isDefaultPrevented()||B.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),T=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Rr,{size:f,white:p,grey:x,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[p,x,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...S,onClick:y,onKeyDown:j,onMouseOver:C,onMouseLeave:b,onFocus:w,children:[T,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:h})]})}),ao=a.memo(l=>{const{schemeColorLookup:i,selectedColor:n,previewColor:t,colorDef:r,onSelectColorDef:c,onPreviewColorDef:m,swatchProps:g,defaultButtonSize:s=24,isLarge:d=!1,compareRGB:h=!1,darkMode:p=!1,...x}=l,u=new O.Color({val:r.definition.val,adjs:r.definition.adjs},T=>i(T)),f=h?u.toRGBA().toString():u.toString(),S=n&&(h?n.toRGBA().toString():n.toString())===f,y=t&&(h?t.toRGBA().toString():t.toString())===f,C=[];C.push({[O.IColor.AdjustmentType.Inv]:!0}),C.push({[O.IColor.AdjustmentType.Alpha]:100});const b=u.adjust(C),w=a.useCallback(()=>{c?.(r)},[c,r]),j=a.useCallback(T=>{m?.(T?r:null)},[m,r]);return e.jsx(o.SimpleTooltip,{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:e.jsx("div",{style:{width:s*(d?1.2:1)+"px",height:s*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...x,children:e.jsxs(Nl,{selectedColor:u,title:null,onSelectColor:w,onPreviewColor:j,alphaCheckSize:d?9:void 0,darkMode:p,...g,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(p).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:S?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*s*(d?1.2:1)+"px",height:.33*s*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(p).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Ht=a.memo(l=>{const{title:i,schemeColorLookup:n,colorDefs:t,selectedColor:r,previewColor:c,onSelectColorDef:m,onPreviewColorDef:g,style:s=k.ReactUtils.EmptyCssProperties,compareRGB:d=!1,darkMode:h,swatchProps:p,...x}=l;let u;if(Array.isArray(t[0]))u=t;else{u=[];for(let b=0;b<t.length;b++)u.push([t[b]])}const f=a.useCallback(b=>{m?.(b)},[m]),S=a.useCallback(b=>{g?.(b)},[g]),y=a.useMemo(()=>{let b=[];for(let w=0;w<u.length;w++){let j=[],T=u[w];for(let I=0;I<T.length;I++){let F=T[I];j.push(e.jsx(ao,{schemeColorLookup:n,colorDef:F,selectedColor:r,previewColor:c,onSelectColorDef:f,onPreviewColorDef:S,swatchProps:p,compareRGB:d,darkMode:h},w+" "+I))}let B=e.jsx(E.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+w);b.push(B)}return b},[u,r,c,f,S]),C=a.useMemo(()=>i?e.jsx(E.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:i}):null,[i]);return e.jsxs(E.Box,{style:{...s},children:[C,e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...x,children:y})]})}),De=(l,i)=>({description:l,definition:{val:i,adjs:[]}}),ye=(l,i,n,t,r,c)=>{const m=De(l,i);t?.push(m);const g=new O.Color({val:m.definition.val,adjs:m.definition.adjs},n),s=g.toString();r?.set(s,g);const d=g.toRGBA().toString();c?.set(d,g)},Al=a.lazy(()=>Promise.resolve().then(()=>require("./BrISuxNuulzjYG6D.cjs"))),Mr=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n=null,previewColor:t=l.selectedColor??null,recentColors:r,schemeLookup:c,disableAlpha:m=!1,previewDebounceTime:g=100,initialPanelType:s,defaultButtonSize:d=24,width:h,onElementLoad:p,onDone:x,onEyeDropStart:u,onEyeDropStop:f,onPreviewColor:S,onPreviewColorImmediate:y,onSelectColor:C,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:j=dt.Start,compareRGB:T=!1,darkMode:B=!1,...I}=l,F=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(y,[y]),M=k.useCallbackRef(C,[C]),v=k.useCallbackRef(u,[u]),P=k.useCallbackRef(f,[f]),[H,A]=a.useState(!1),$=G.useTheme(),D=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",D,ce,z,J),ye("Primary Text","tx1",D,ce,z,J),ye("Secondary Background","bg2",D,ce,z,J),ye("Secondary Text","tx2",D,ce,z,J),ye("Accent 1","accent1",D,ce,z,J),ye("Accent 2","accent2",D,ce,z,J),ye("Accent 3","accent3",D,ce,z,J),ye("Accent 4","accent4",D,ce,z,J),ye("Accent 5","accent5",D,ce,z,J),ye("Accent 6","accent6",D,ce,z,J);const re=O.ITheme.buildPalette(ce,D,z,J),ae=[];if(ye("Dark Red","C00000",D,ae,z,J),ye("Red","FF0000",D,ae,z,J),ye("Orange","FFC000",D,ae,z,J),ye("Yellow","FFFF00",D,ae,z,J),ye("Light Green","92D050",D,ae,z,J),ye("Green","00B050",D,ae,z,J),ye("Light Blue","00B0F0",D,ae,z,J),ye("Blue","0070C0",D,ae,z,J),ye("Dark Blue","002060",D,ae,z,J),m?ye("Purple Is A Fruit","7030A0",D,ae,z,J):ye("Transparent","00000000",D,ae,z,J),b){const ie=b.toString();z.set(ie,b)}const X=new Map,te=typeof r=="function"?r():r,ue=[];for(let ie=0;te&&ie<te.length;ie++){const je=te[ie].toString();X.set(je,te[ie]),ue.push({description:"Recent "+(ie+1),definition:{val:te[ie].toString()}})}return{primaryColors:ce,modifiedPresets:re,standardColors:ae,recentColorsLimited:ue,mapAllPresets:z,mapAllPresetsRGB:J,mapRecent:X}},[D,r,m,b]);a.useEffect(()=>{p?.()},[]);const[q,Y]=a.useState(!1),_=a.useCallback(()=>{Y(z=>!z)},[]);a.useEffect(()=>{if(s)Y(s===Ir.Custom);else if(n){let z=n.toString(),J=R.mapAllPresets.get(z);J||(z=n.toRGBA().toString(),J=R.mapAllPresetsRGB.get(z));const ce=R.mapRecent.get(z);Y(!J&&!ce)}},[n,s]);const U=a.useCallback(O.CommonUtils.debounce(z=>{N?.(z)},g),[N,g]),[Q,ee]=a.useState();a.useEffect(()=>{ee(t||n)},[t,n]);const K=k.useCallbackRef(z=>{L&&(L(z),U(z))},[L]),W=k.useCallbackRef(z=>{K(z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},D):null)},[D]),Z=a.useCallback(z=>{z.ctrlKey&&Y(!0)},[]),ne=k.useCallbackRef(z=>{let J=!1;if(z){const ce=z.toString();J=!R.mapAllPresets.has(ce)}M?.(z,J)},[M,R]),be=k.useCallbackRef(z=>{const J=z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},D):null;Promise.resolve(x?.()).then(()=>{ne(J)})},[D,x]),ge=k.useCallbackRef(z=>{K(z?new O.Color(z,D):null)},[D]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(E.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:z=>z.palette.text.icon??z.palette.action.active},onClick:async()=>{A(!0),v?.(),await new EyeDropper().open().then(z=>{A(!1),P?.();let J=new O.Color(z.sRGBHex),ce=J.toString(),re=R.mapAllPresets.get(ce);if(re||(ce=J.toRGBA().toString(),re=R.mapAllPresetsRGB.get(ce)),!re){const ae=J.toRGBA(),X=3;let te=255;R.mapAllPresetsRGB.forEach((ue,ie)=>{const je=ue.toRGBA(),Me=Math.abs(je.red-ae.red)+Math.abs(je.blue-ae.blue)+Math.abs(je.green-ae.green);Me<X&&Me<te&&(re=ue)})}Y(!re),K(re||J)}).catch(z=>{A(!1),z?.name!=="AbortError"&&console.error(z)})},children:e.jsx(me.Colorize,{})}),[R,B]),Be=a.useMemo(()=>{if(!q)return;const z={opacity:q?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(a.Suspense,{fallback:e.jsx("div",{style:z,children:e.jsx(o.LoadingPanel,{})}),children:e.jsx(Al,{style:z,selectedColor:F?F.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[q,F]),se=a.useMemo(()=>({onClick:Z,alphaGrey:$.palette.text.icon??$.palette.action.active}),[Z,$]),Se=a.useMemo(()=>{if(!b)return null;const z={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(E.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(E.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:D,colorDef:z,selectedColor:n===null?b:n,previewColor:t===null?b:t,defaultButtonSize:d,isLarge:!0,darkMode:B,compareRGB:T,swatchProps:se})}),e.jsx(E.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,D,n,t]);return e.jsxs(E.Box,{ref:i,sx:{width:h,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...I,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:q?"0":1},children:[Se&&j===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(E.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:D,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsx(Ht,{schemeColorLookup:D,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:D,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:D,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B})]}),Se&&j===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(E.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Be]}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[xe,e.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),e.jsx(E.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{_()},children:q?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(E.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(x?.()).then(()=>{ne(Q)})},children:"Done"})]})]})})),Ol=e.jsx(o.ColorizedCircleIcon,{}),zo=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n,quickColor:t,icon:r=Ol,tooltip:c,label:m,onPreviewColor:g,onPreviewColorImmediate:s,onSelectColor:d,variant:h=o.PopupButtonType.Toolbar,panelProps:p,shouldCloseFloatAll:x=!0,compareRGB:u=!1,darkMode:f=!1,...S}=l,y=k.useCallbackRef(g,[g]),C=k.useCallbackRef(s,[s]),b=k.useCallbackRef(d,[d]),[w,j]=a.useState(()=>{}),T=t||w||n||p?.autoColor,B=a.useRef(!1),I=a.useCallback(()=>{},[]),F=k.useCallbackRef(()=>{j(n)},[n]),N=k.useCallbackRef(R=>{B.current||(j(R),y?.(R))},[y]),L=k.useCallbackRef(R=>{B.current||(j(R),C?.(R))},[C]),M=k.useCallbackRef((R,q)=>{B.current||(j(void 0),b?.(R,q))},[b]),v=a.useMemo(()=>e.jsx(E.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${T?.toCSS(f)??"transparent"}`,"& .activeColor":{fill:`${T?.toCSS(f)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[T,r,f]),P=k.useCallbackRef(R=>{b?.(t,!1)},[b,t]),[H,A]=a.useState(!1),$=a.useCallback(R=>{const{closeFloat:q,closeFloatAll:Y}=R;return e.jsx(Mr,{...p,selectedColor:n,previewColor:w,onDone:x?Y:q,onKeyDown:_=>{_.which===k.KeyCodes.Enter&&(x?Y():q())},onPreviewColorImmediate:L,onPreviewColor:N,onSelectColor:M,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:u,darkMode:f})},[n,w,x,T,p?.autoColor,f]),D={onQuickClick:t?P:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:F,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return h===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...D}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...D})})),Qt=82,Fo=l=>{const{styleColor:i,length:n=Qt,width:t=1,dashArray:r=null,sx:c,isDouble:m=!1,isAngled:g=!1,darkMode:s=!1,...d}=l;return e.jsx(E.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:h=>`${i?i.toRGBA(s).toString():h.palette.text.icon??h.palette.action.active}`},"& .style_grey":{stroke:h=>h.palette.text.icon??h.palette.action.active},...c},height:t,width:n,viewBox:`0 0 ${n} ${t}`,...d,children:e.jsx(le.StyledStrokePath,{length:n,width:t,dashArray:r,isDouble:m,isAngled:g,className:"activeColor"})})},Pr=a.memo(a.forwardRef((l,i)=>{const{variant:n,showLabels:t=!1,disabled:r=!1,createPopupPanel:c,styleColor:m,selectedStyle:g,onSelectStyle:s,showNone:d=!0,darkMode:h,sx:p,...x}=l,u=k.useCallbackRef(s,[]),f=a.useCallback(b=>{const{popupContainer:w,floatReference:j,closeFloat:T,...B}=b,I=[],F=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<F.length;N++){const L=F[N];if(L.description==="None"&&!d)continue;const M=e.jsx(Fo,{styleColor:m,length:Qt,width:L.width,darkMode:h,dashArray:L.pattern,isDouble:L.description.toLowerCase().includes("double"),isAngled:L.description.toLowerCase().includes("slant")});let v=null;v=t?e.jsxs(e.Fragment,{children:[e.jsx(E.Box,{sx:{marginRight:"6px"},children:L.description}),e.jsxs(E.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[e.jsx("div",{style:{flex:"1 1 100%"}}),M]})]}):L.description==="None"?"None":M,I.push(e.jsx(o.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:o.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":L.description},icon:null,disabled:r,onMouseDown:P=>P.preventDefault(),onMouseUp:()=>{T(),u(L.style)},onKeyDown:P=>{P.which===k.KeyCodes.Enter&&T()},selected:L.style===g,parentFloat:j,children:v},N))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,g,h]),S=a.useMemo(()=>{const b=O.IBorder.BuiltInDefinitions.get(g);let w;return w=b.description==="None"?e.jsx(E.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Fo,{styleColor:m,length:Qt,width:b.width,dashArray:b.pattern,darkMode:h,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),e.jsx(E.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:o.createStrokeShadowFilter()}},children:w})},[g,m]),y=a.useMemo(()=>O.IBorder.BuiltInDefinitions.get(g),[g]),C={disabled:r,icon:S,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,...p},createPopupPanel:f,...x};return n===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{...C}):e.jsx(o.ExhibitPopupMenuItem,{...C})})),Dr=a.memo(a.forwardRef((l,i)=>{const{autoColor:n=null,schemeLookup:t,autoStrokeStyle:r=O.IBorder.StrokeStyle.Thin,disabled:c=!1,darkMode:m=!1,showStylingBefore:g=!0,onSelectBorder:s,onPreviewBorder:d,selectedBorder:h,createTemporaryBorder:p,...x}=l,u=k.useCallbackRef(s,[s]),f=k.useCallbackRef(d,[d]),[S,y]=a.useState(),[C,b]=a.useState(),w=S??r,j=C??n,T=h||{bottom:{style:r,color:n?.toString()}},B=k.useCallbackRef(v=>{const P={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(P[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||P[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?P.left:null,D=A?P.top:null,R=A?P.right:null,q=A?P.bottom:null,Y=A?P.vertical:null,_=A?P.horizontal:null;let U="";return D||$||(U+="M 3,5 H 5 V 3 H 3 "),D||(U+="M 7,5 H 9 V 3 H 7 "),D||Y||(U+="M 11,5 h 2 V 3 h -2 "),D||(U+="M 15,5 h 2 V 3 h -2 "),D||R||(U+="M 19,5 h 2 V 3 h -2 "),$||(U+="M 3,9 H 5 V 7 H 3 "),Y||(U+="M 11,9 h 2 V 7 h -2 "),R||(U+="M 19,9 h 2 V 7 h -2 "),_||$||(U+="M 3,13 H 5 V 11 H 3 "),_||(U+="M 7,13 H 9 V 11 H 7 "),_||Y||(U+="M 11,13 h 2 v -2 h -2 "),_||R||(U+="M 19,13 h 2 v -2 h -2 "),_||(U+="M 15,13 h 2 v -2 h -2 "),$||(U+="M 3,17 H 5 V 15 H 3 "),Y||(U+="M 11,17 h 2 v -2 h -2 "),R||(U+="M 19,17 h 2 v -2 h -2 "),q||$||(U+="M 3,21 H 5 V 19 H 3 "),q||(U+="M 7,21 H 9 V 19 H 7 "),q||Y||(U+="M 11,21 h 2 v -2 h -2 "),q||(U+="M 15,21 h 2 v -2 h -2 "),q||R||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[e.jsx(E.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:e.jsx("path",{d:U})}),e.jsx(E.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:o.strokeShadowFilter}},children:e.jsx(le.StaticBorderRenderer,{getBorderAt:(Q,ee)=>{if(!p||H.length===0)return null;const K=Q.rowIndex,W=Q.colIndex,Z={};return K===0?(Z.top=P.top,Z.bottom=P.horizontal):(Z.top=P.horizontal,Z.bottom=P.bottom),W===0?(Z.left=P.left,Z.right=P.vertical):(Z.left=P.vertical,Z.right=P.right),p?.(Z)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[j,w,m]),I=a.useCallback((v,P,H)=>{let A=null;if(v&&v.length>0){let $=null;(P||H)&&($={style:H,color:P?.toString()??null}),A={};for(let D=0;D<v.length;D++)A[v[D]]=$}return A},[]),F=a.useCallback(v=>{u?.(v)},[]),N=a.useCallback(v=>{f?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:P,floatReference:H}=v,A=(R,q,Y="bottom",_=!1)=>{const U=I(R,j??null,_?O.IBorder.StrokeStyle.None:w??null),Q=_?I([],j??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:B(Q),sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{label:q,simple:!0,placement:Y},onClick:()=>{P(),N(U),F(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"All Borders","top"),A([O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"Inner Borders","top"),A([O.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),A([O.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left],"Left Borders"),A([O.IBorder.Edge.Top],"Top Borders"),A([O.IBorder.Edge.Right],"Right Borders"),A([O.IBorder.Edge.Bottom],"Bottom Borders"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical,O.IBorder.Edge.DiagonalUp,O.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),D=e.jsx(e.Fragment,{children:e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(zo,{variant:o.PopupButtonType.Toolbar,icon:e.jsx(o.ColorizedStrokeIcon,{}),selectedColor:w===O.IBorder.StrokeStyle.None?new O.Color("transparent"):j,onPreviewColor:R=>{b(R)},onSelectColor:(R,q)=>{b(R)},darkMode:m,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:t},disabled:c||w===O.IBorder.StrokeStyle.None,parentFloat:H,shouldCloseFloatAll:!1}),e.jsx(Pr,{selectedStyle:w,onSelectStyle:y,styleColor:j,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[g?D:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),g?$:D]})},[w,j,n,t,m]),M=a.useMemo(()=>B(T),[T,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},P)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:P,children:v}),onQuickClick:()=>{u?.(T)},quickButtonProps:{sx:{}},disabled:c,icon:M,...x})})),Fr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,variant:c=k.CommandButtonType.Toolbar,disabled:m=!1,autoColor:g,autoStrokeStyle:s,schemeLookup:d,createTemporaryBorder:h,selectedBorder:p,onSelectBorder:x,darkMode:u,icon:f,label:S,...y}=l,C=k.useCommands(n,["formatBorder"]),b=t??C[0],w=b?.context()??null,j=w?.autoColor??g,T=w?.autoStyle??s,B=p??w?.quickBorder,I=u??w?.darkMode,F=h??w?.createTemporaryBorder,N=d??w?.schemeLookup,L=k.useCallbackRef(v=>{w?.onBorderSelect&&w.onBorderSelect(v),x?.(v),b?.execute(v,r)},[b,x,r]),M=a.useCallback((v,P)=>{const{children:H,title:A,...$}=v;let D=v.children;return(b?.disabled()||m)&&(D=e.jsx("div",{children:D})),e.jsx(o.CommandTooltip,{command:b,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:P,...$,children:D})},[b,m]);return e.jsx(Dr,{ref:i,autoColor:j,darkMode:I,autoStrokeStyle:T,createTemporaryBorder:F,schemeLookup:N,selectedBorder:B,onSelectBorder:L,createTooltip:M,disabled:m||!b||b.disabled(),...y})})),Nr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unmerge"),icon:o.themeIcon(e.jsx(o.MergeUnMergeIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:g,icon:o.themeIcon(e.jsx(o.MergeAllIcon,{})),...m})})),Ar=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unfreeze"),icon:e.jsx(o.MergeUnMergeIcon,{})})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:g,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:e.jsx(o.FreezeIcon,{}),...m})})),Or=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("goto"),icon:o.themeIcon(e.jsx(o.GotoIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:g,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:o.themeIcon(e.jsx(o.FindIcon,{})),...m})})),Lr=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,showQuickButtons:r=!!l.commands,commands:c,fontSizes:m=le.FontUtils.DefaultFontSizes,disabled:g=!1,parentFloat:s,icon:d,label:h,sx:p,...x}=l;k.useCommand(n);const u=()=>n?.state()?.toString()||"11",[f,S]=a.useState(u),y=k.useCallbackRef(()=>{const F=parseFloat(f);isNaN(F)?S(u()):parseFloat(u())!==F&&n.execute(F,t)},[u,n,f,t]);a.useEffect(()=>{S(u())},[n?.state()]);const C=a.useMemo(()=>{if(!t)return null;const F={...t};return delete F.beforeExecute,F},[t]),b=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>b?e.jsxs(E.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[e.jsx(o.CommandButton,{command:b[0],commandHook:C,icon:o.themeIcon(e.jsx(o.TextSizeIncreaseIcon,{}))}),e.jsx(o.CommandButton,{command:b[1],icon:o.themeIcon(e.jsx(o.TextSizeDecreaseIcon,{}))})]}):null,[b]),j=G.useTheme(),T=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),B=a.useCallback(F=>{const{onMouseDown:N,onMouseUp:L,...M}=F;return e.jsx(E.IconButton,{component:"div",...M,disableRipple:!0,children:e.jsx(E.Input,{inputMode:"numeric",disabled:g||!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:v=>`1px solid ${v.palette.text.icon??v.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:v=>`1px solid ${v.palette.error.main}`},"::after":{borderBottom:v=>`1px solid ${v.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:v=>`${Math.round(v.typography.fontSize)}px`,width:T,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:f,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)u()!==f&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===k.KeyCodes.Escape)u()!==f&&(S(u()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(f+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===k.KeyCodes.Space)return void v.preventDefault()}},onBlur:()=>{y()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();S(v.target.value)}})})},[f,g,n]),I=a.useCallback(F=>{const N=P=>{n?.execute(P,t)},L=n?.state(),M=[];for(let P=0;P<m.length;P++){const H=m[P]===L;M.push(e.jsx(o.ExhibitMenuItem,{selected:H,icon:H?e.jsx(o.SelectedIcon,{}):void 0,disabled:g||!n||n.disabled(),onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(m[P])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[P])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[P]})},"fontSize-"+P))}const v=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...x,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:M})]});return o.defaultCreatePopupPanel({...F,children:v})},[g,n?.state(),t]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...p},tabIndex:-1,outlined:!0,disabled:g,parentFloat:s,createPopupPanel:I,createTooltip:({children:F},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:F}),createQuickButton:B,...x})})),Dn=a.memo(l=>{const{selected:i,disabled:n,formattedValue:t,handleSetFormat:r,format:c,sx:m,...g}=l;return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...m},disabled:n,selected:i,icon:i?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:s=>{s.button===0&&s.preventDefault()},onMouseUp:s=>{s.button===0&&r(c.numberFormat)},onKeyDown:s=>{s.keyCode!==k.KeyCodes.Enter&&s.keyCode!==k.KeyCodes.Space||r(c.numberFormat)},...g,children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(E.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(E.Typography,{variant:"caption",component:"div",sx:{color:s=>Re.alpha(s.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),Hr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,sx:c,disabled:m=!1,parentFloat:g,...s}=l,d=k.useCommands(n,["formatNumberFormat"])[0],h=d?.state()?O.NumberFormat.Styles.lookupStyle(d?.state()).formatType:O.NumberFormat.Type.General,p=a.useMemo(()=>{if(!t)return null;const S={...t};return delete S.beforeExecute,S},[t]),x=a.useCallback((S,y)=>{const C=L=>{t?.beforeExecute?.(d,d?.state()),d.execute(L,t),t?.onExecute?.(d,d?.state())},b=d?.context()(),w=O.NumberFormat.Styles.lookupPrimary(),j=[];for(let L=0;L<w.length;L++){let M="";if(b&&!b.isEmpty())try{M=b.getNumberFormat(w[L].numberFormat).displayText}catch(P){console.warn(P)}M===""&&w[L].formatType===O.NumberFormat.Type.General&&(M="No specific format");const v=w[L].formatType===h;j.push(e.jsx(Dn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:M,handleSetFormat:C,format:w[L]},w[L].formatType))}const T={numberFormat:"",formatType:O.NumberFormat.Type.Custom},B=h===O.NumberFormat.Type.Custom,I=e.jsx(Dn,{selected:B,disabled:m||!d||d.disabled(),formattedValue:B?b.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),y.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:T,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),F=e.jsxs(E.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:p,scope:r,icon:e.jsx(o.CurrencyDollarIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:p,scope:r,icon:e.jsx(o.PercentIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:p,scope:r,icon:e.jsx(o.CommaIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:p,scope:r,icon:o.themeIcon(e.jsx(o.IncreaseDecimalIcon2,{}))}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:p,scope:r,icon:o.themeIcon(e.jsx(o.DecreaseDecimalIcon2,{}))})]}),N=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[F,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),u=G.useTheme(),f=a.useMemo(()=>{const S=O.NumberFormat.Type.MediumTime;return`${O.IFont.getSharedMeasurer()(S,Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`},[u]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,sx:c,outlined:!0,disabled:m,parentFloat:g,createPopupPanel:x,createTooltip:({children:S},y)=>e.jsx(o.ExhibitTooltip,{label:d?.label(),description:d?.description(),disabled:y,children:S}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,color:S=>S.palette.text.secondary,fontFamily:S=>S.typography.fontFamily,width:f},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...s})})),Wo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearHyperlinks")})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:g,icon:e.jsx(o.ClearAllIcon,{}),...m})})),zr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillLeft"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(90deg)"}}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:g,icon:o.themeIcon(e.jsx(o.FillDownIcon,{})),...m})})),Vo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:g=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,p=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],x=k.useCommands(n,p),{singleCommand:u,allDisabled:f}=a.useMemo(()=>{let C=null,b=0;for(let w=0;w<x.length;w++)x[w]&&!x[w]?.disabled()&&(g&&d===k.CommandButtonType.Menuitem&&(C=b===0?x[w]:null),b++);return{singleCommand:C,allDisabled:b===0}},[x]),S=a.useMemo(()=>{const C=new Map;return C.set("insertCellsShiftDown",o.themeIcon(e.jsx(o.InsertCells,{}))),C.set("insertCellsShiftRight",o.themeIcon(e.jsx(o.InsertCells,{sx:{transform:"rotate(270deg)"}}))),C.set("insertRows",o.themeIcon(e.jsx(o.InsertRowIcon,{}))),C.set("insertColumns",o.themeIcon(e.jsx(o.InsertColumn2Icon,{}))),C},[]),y=a.useCallback((C,b)=>{let w=null;const j={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:c};m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:b.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:x[0],icon:S.get(p[0])}),e.jsx(o.CommandButton,{...j,command:x[1],icon:S.get(p[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:x[2],icon:S.get(p[2])}),e.jsx(o.CommandButton,{...j,command:x[3],icon:S.get(p[3])}),w]});return o.defaultCreatePopupPanel({...C,children:T})},[c,x,t,r,S]);return u?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:u,icon:S.get(u.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||f,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),e.jsx("br",{}),e.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:o.themeIcon(e.jsx(o.InsertColumn2Icon,{})),...h})})),$o=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:g=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,p=k.useCommands(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:x,allDisabled:u}=a.useMemo(()=>{let y=null,C=0;for(let b=0;b<p.length;b++)p[b]&&!p[b]?.disabled()&&(g&&d===k.CommandButtonType.Menuitem&&(y=C===0?p[b]:null),C++);return{singleCommand:y,allDisabled:C===0}},[p]),f=a.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",o.themeIcon(e.jsx(o.RemoveRowIcon,{}))),y.set("deleteColumns",o.themeIcon(e.jsx(o.RemoveColumn2Icon,{}))),y},[]),S=a.useCallback((y,C)=>{const b={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:c};let w=null;m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftUp"),icon:f.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftLeft"),icon:f.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteRows"),icon:f.get("deleteRows")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteColumns"),icon:f.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...y,children:j})},[c,t,r,f]);return x?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:x,icon:f.get(x.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"deleteCells",commands:n,commandHook:t,scope:r,disabled:c||u,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:S,icon:o.themeIcon(e.jsx(o.RemoveColumn2Icon,{})),...h})})),ut=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,onSelectColor:r,disabled:c=!1,variant:m=k.CommandButtonType.Toolbar,quickColor:g,panelProps:s,isSplit:d=!1,darkMode:h,icon:p,...x}=l,{autoColor:u,schemeLookup:f,recentColors:S,...y}=s;if(x.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");k.useCommand(n);const C=n?.context();let b=g??C?.quickColor;d&&!b&&(b=new O.Color("transparent"));const w=u??C?.autoColor,j=f??C?.schemeLookup,T=S??C?.recentColors,B=h??C?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:j,recentColors:T,darkMode:B,...y}),[w,j,T,B]),F=k.useCallbackRef((L,M)=>{L&&M&&C?.addRecentColor&&C.addRecentColor(L),C?.onColorSelect&&C.onColorSelect(L),r?.(L,M),n?.execute(L,t)},[n,r,t,C]),N=a.useCallback((L,M)=>{const{children:v,title:P,...H}=L;let A=L.children;return(n?.disabled()||c)&&(A=e.jsx("div",{children:A})),e.jsx(o.CommandTooltip,{command:n,placement:m===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:M,...H,children:A})},[n,c]);return e.jsx(zo,{ref:i,panelProps:I,icon:p,quickColor:b,selectedColor:n?.state(),onSelectColor:F,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:B,...x})}));ut.displayName="ColorCommandButton";const Wr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=a.useCallback((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:p.getCommand("gridlinesToggle")}),e.jsx(ut,{...x,command:p.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0}}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleGridlinesRows")})]});return o.defaultCreatePopupPanel({...h,children:u})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...g})})),Uo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=d.getCommand("sortCustom"),x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),p?e.jsx(o.CommandButton,{...h,command:p,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:x})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,label:"Sort",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:g,icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{})),...m})})),Ll=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,label:"Filter",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:g,icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{})),...m})})),_o=a.memo(a.forwardRef((l,i)=>{const{quickCommand:n,icon:t,isRedo:r=!1,nestRedo:c=!0,undoManager:m,scope:g,sx:s,disabled:d,commands:h,...p}=l,x=[n];!r&&c&&x.push("redo");const u=k.useCommands(h,x),f=u[0],S=u[1],y=m??f?.context?.()?.undoManager;let C=d;d||(C=!f||f.disabled(),S&&!S.disabled()&&(C=!1));const[b,w]=a.useState(0),j=a.useCallback((T,B)=>{let I=b===0?"Cancel":`${f.label()} ${b} Action${b===1?"":"s"}`,F=!1;y||(F=!0),F||(F=c?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const N=A=>{f.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:F?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(b)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(b)},children:e.jsx(E.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(F)return L;const M=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),v=[];for(let A=0;A<M.length;A++){const $=M[A];v.push(e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},icon:e.jsx(o.BlankIcon,{}),disabled:C,selected:A<b,onMouseEnter:()=>{w(A+1)},onMouseDown:D=>{D.button===0&&D.preventDefault()},onMouseUp:D=>{D.button===0&&N(A+1)},onKeyDown:D=>{D.isDefaultPrevented()||D.keyCode!==k.KeyCodes.Enter&&D.keyCode!==k.KeyCodes.Space||N(A+1)},children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(E.Typography,{component:"div",children:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let P=null;if(!r&&c){const A={scope:"undo",commands:B,variant:k.CommandButtonType.Menuitem,parentFloat:T.floatReference};P=[],P.push(e.jsx(_o,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&P.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{T.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[P,e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...T,children:H})},[f?.context(),f?.state(),g,y,b,C]);return e.jsx(o.CommandPopupButton,{ref:i,commands:h,quickCommand:n,scope:g,disabled:C,label:f?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${f?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??o.themeIcon(r?e.jsx(o.RedoIcon,{}):e.jsx(o.UndoIcon,{})),selected:!1,...p})})),mt=O.IFontCollection.getFontList(),Vr=new Map;for(let l=0;l<mt.length;l++)Vr.set(mt[l].fontRef.getFamily(),mt[l]);const $r=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,sx:r,disabled:c=!1,parentFloat:m,icon:g,label:s,...d}=l;k.useCommand(n);const h=n?.state(),p=G.useTheme(),x=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("Times New Roman",Math.round(p.typography.fontSize),p.typography.fontFamily).width}px`,[p]),u=a.useCallback(f=>{const S=w=>{n?.execute(w,t)},y=[];for(let w=0;w<mt.length;w++)y.push({key:mt[w].fontRef.getFamily(),description:mt[w].fontRef.getFamily()});Vr.get(h)||y.unshift({key:h,description:h});const C=[];for(let w=0;w<y.length;w++){const j=y[w].key===h;C.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:c||!n||n.disabled(),icon:j?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:T=>{T.button===0&&S(y[w].key)},onMouseDown:T=>{T.button===0&&T.preventDefault()},onKeyDown:T=>{T.keyCode!==k.KeyCodes.Enter&&T.keyCode!==k.KeyCodes.Space||S(y[w].key)},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>y[w]?.key},children:y[w].description})})},w+""+y[w].key))}const b=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})});return o.defaultCreatePopupPanel({...f,children:b})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:u,createTooltip:({children:f},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:f}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:f=>`${Math.round(f.typography.fontSize)}px`,fontFamily:f=>f.typography.fontFamily,color:f=>f.palette.text.secondary,width:x},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...d})})),Ur=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatStrikeThroughToggle",o.themeIcon(e.jsx(o.TextStrikeIcon,{}))),p.set("formatSuperscriptToggle",o.themeIcon(e.jsx(o.TextSuperscriptIcon,{}))),p.set("formatSubscriptToggle",o.themeIcon(e.jsx(o.TextSubscriptIcon,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:h,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextStrikeIcon,{})),...m})})),_r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatUnderlinedToggle",o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))),p.set("formatUnderlinedDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))),p.set("formatUnderlinedAccountingToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))),p.set("formatUnderlinedAccountingDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedAccountingToggle"),commandHook:t,icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextUnderlineIcon,{})),...m})})),Ko=a.memo(a.forwardRef((l,i)=>{const{command:n,commands:t,commandHook:r,scope:c,includePasteAllInPopup:m=!0,disabled:g=!1,...s}=l,d=k.useCallbackRef((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:g},u=[];return m&&(u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("paste"),key:"paste",icon:e.jsx(o.PasteIcon,{})})),u.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteValues"),key:"pasteValues",icon:o.themeIcon(e.jsx(o.PasteValuesIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteFormats"),key:"pasteFormats",icon:o.themeIcon(e.jsx(o.PasteFormatsIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteFormulas"),key:"pasteFormulas",icon:o.themeIcon(e.jsx(o.PasteFormulasIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteTranspose"),key:"pasteTranspose",icon:o.themeIcon(e.jsx(o.PasteTransposeIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteLinks"),key:"pasteLinks",icon:o.themeIcon(e.jsx(o.PasteLinksIcon,{}))})),o.defaultCreatePopupPanel({...h,children:u})},[g,r,c,m]);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:c,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:e.jsx(o.PasteIcon,{}),...s})})),Kr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=a.useCallback((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadings")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingRows")})]});return o.defaultCreatePopupPanel({...h,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...g})})),qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="view",disabled:c=!1,...m}=l,g=a.useCallback(s=>{const d={variant:k.CommandButtonType.Menuitem,parentFloat:s.floatReference,commandHook:t,scope:r,disabled:c},h=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return o.defaultCreatePopupPanel({...s,children:h})},[c,n,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:g,icon:e.jsx(o.LabelIcon,{icon:null,label:"Workbook View"}),...m})})),Gr=a.memo(a.forwardRef((l,i)=>{const{value:n,cellStyle:t,styles:r,createTemporaryCell:c,bodyStyle:m,sx:g,borderProps:s,disabled:d,...h}=l,p=a.useMemo(()=>c({value:n,style:t}),[n,t,c]),x=a.useMemo(()=>p.getStyle(),[p,m]),u=a.useMemo(()=>x.getFill().toCSS(m?.darkMode??!1),[x]),f=x.getInsets(),S=x.getFont(),y=a.useCallback(()=>x.getBorder(),[x]);return e.jsx(E.Box,{ref:i,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:m?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...u},"& .text":{flex:"1 1 100%",...S.toCSS(m?.darkMode??!1,1),boxSizing:"border-box",padding:`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:S.toCSS().textDecoration,textAlign:O.ITextFrame.toCSSHorizontalTextAlign(p.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...g},...h,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:y,darkMode:m?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...s?.style},...s,children:e.jsx(E.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:e.jsx(E.Box,{className:"text",children:n})})})})})),Hl=a.memo(l=>{const{styles:i,namedStyle:n,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:c,onSelectNamed:m,createTemporaryCell:g,parentFloat:s,commands:d,disabled:h,commandHook:p,...x}=l,u=a.useCallback(y=>{const C={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"cellStyle"},b=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...C,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...C,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),e.jsx(o.CommandButton,{...C,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:h||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return o.defaultCreatePopupPanel({...y,children:w})},[]),f=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${f?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{m?.(n)},...x,children:e.jsx(Gr,{value:n.getName(),cellStyle:{named:n.getName()},styles:i,createTemporaryCell:g,bodyStyle:c})},n.getName());return r&&(S=e.jsx(o.ContextMenu,{label:n.getName(),parentFloat:s,createPopupPanel:u,children:S})),S}),Xr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedNamed:c,onSelectNamed:m,disabled:g=!1,bodyStyle:s,usePreviewIcon:d=!0,...h}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.named(),f=s??p?.bodyStyle(),S=k.useCallbackRef(j=>{m?.(j),t?.execute(j,r)},[t,m,r]),y=a.useCallback((j,T)=>{const B={onSelectNamed:S,styles:x(),parentFloat:j.floatReference},I=x().getCustomNamed(),F=new Map,N=[];for(let D=0;D<I.length;D++)F.set(I[D].getName(),I[D]),x().getNamed(I[D].getName()).getBuiltInID()===null&&N.push(I[D].getName());const L=D=>{let R=F.get(D);return R||(R=x().getNamed(D)),!R||R.isHidden()?null:e.jsx(Hl,{namedStyle:R,selectedNamed:u,bodyStyle:p.bodyStyle(),createTemporaryCell:p.createTemporaryCell,commands:n,commandHook:r,...B},D)},M=(D,R,q=!0)=>{const Y=[];for(let _=0;_<R.length;_++){const U=L(R[_]);U&&Y.push(U)}return Y.length===0?null:e.jsxs(E.Box,{children:[q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:D},D+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:Y},D+"-presets")]},D)},v=(D,R)=>{const q=[];for(let Y=0;Y<R.length;Y++){const _=L(R[Y]);_&&q.push(_)}return q.length===0?null:e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:q},D+"-presets")},P=[];P.push(M("Custom",N,!1)),P.push(M("Good, Bad and Neutral",[O.IStyle.BuiltInName.Normal,O.IStyle.BuiltInName.Bad,O.IStyle.BuiltInName.Good,O.IStyle.BuiltInName.Neutral],N.length>0)),P.push(M("Data and Model",[O.IStyle.BuiltInName.Calculation,O.IStyle.BuiltInName.CheckCell,O.IStyle.BuiltInName.ExplanatoryText,O.IStyle.BuiltInName.FollowedHyperlink,O.IStyle.BuiltInName.Hyperlink,O.IStyle.BuiltInName.Input,O.IStyle.BuiltInName.LinkedCell,O.IStyle.BuiltInName.Note,O.IStyle.BuiltInName.Output,O.IStyle.BuiltInName.WarningText])),P.push(M("Titles and Headings",[O.IStyle.BuiltInName.Heading1,O.IStyle.BuiltInName.Heading2,O.IStyle.BuiltInName.Heading3,O.IStyle.BuiltInName.Heading4,O.IStyle.BuiltInName.Title,O.IStyle.BuiltInName.Total]));let H=[];var A,$;return H.push(v("Accent 1",[O.IStyle.BuiltInName.Accent1_20,O.IStyle.BuiltInName.Accent1_40,O.IStyle.BuiltInName.Accent1_60,O.IStyle.BuiltInName.Accent1])),H.push(v("Accent 2",[O.IStyle.BuiltInName.Accent2_20,O.IStyle.BuiltInName.Accent2_40,O.IStyle.BuiltInName.Accent2_60,O.IStyle.BuiltInName.Accent2])),H.push(v("Accent 3",[O.IStyle.BuiltInName.Accent3_20,O.IStyle.BuiltInName.Accent3_40,O.IStyle.BuiltInName.Accent3_60,O.IStyle.BuiltInName.Accent3])),H.push(v("Accent 4",[O.IStyle.BuiltInName.Accent4_20,O.IStyle.BuiltInName.Accent4_40,O.IStyle.BuiltInName.Accent4_60,O.IStyle.BuiltInName.Accent4])),H.push(v("Accent 5",[O.IStyle.BuiltInName.Accent5_20,O.IStyle.BuiltInName.Accent5_40,O.IStyle.BuiltInName.Accent5_60,O.IStyle.BuiltInName.Accent5])),H.push(v("Accent 6",[O.IStyle.BuiltInName.Accent6_20,O.IStyle.BuiltInName.Accent6_40,O.IStyle.BuiltInName.Accent6_60,O.IStyle.BuiltInName.Accent6])),P.push((A="Themed Cell Styles",$=H,e.jsxs(E.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),P.push(M("Number Format",[O.IStyle.BuiltInName.Comma,O.IStyle.BuiltInName.Comma0,O.IStyle.BuiltInName.Currency,O.IStyle.BuiltInName.Currency0,O.IStyle.BuiltInName.Percent])),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:D=>`${D.shape.borderRadius}px`,paddingBottom:D=>`${D.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:P}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:u,command:T.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[u,x?.().getTheme(),f]),C=k.useCallbackRef(j=>{const T=18/O.IFont.getDeviceScale(),B=p?.createTemporaryCell(j);return B.getStyle().getFont().getSize()<=T?B:B.createTemporaryCell({style:{font:{size:T}}})},[p?.createTemporaryCell]),b=g||!t||t.disabled(),w=a.useMemo(()=>p&&d?e.jsx(Gr,{value:u?.getName()??"Custom",cellStyle:u?{named:u.getName()}:void 0,styles:p.styles(),createTemporaryCell:C,bodyStyle:p.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[u,f,b]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:y,outlined:d,commands:n,createTooltip:({children:j},T)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:T,children:j}),selected:!1,disabled:b,label:t?.label(),icon:w,...h})})),Yr="_sheetxl-reset_ods65_1",zl=10,Zr=a.memo(a.forwardRef((l,i)=>{const{styles:n,table:t,tableStyle:r=t?.getStyle()??n.getDefaultTableStyle(),bodyStyle:c,sx:m,disabled:g,className:s,forceThinBorder:d,cellHeight:h=zl,isLive:p=!1,...x}=l,u=Math.ceil(1.3*h),[f,S]=a.useReducer(j=>j+1,0);a.useEffect(()=>{if(p&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,p]);const y=a.useMemo(()=>{let j=t?.toJSON()??{};const T={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=T,new O.Table({initialAnchor:T,json:j,styles:n})},[f,t,r,n]),C=a.useMemo(()=>{const j=[];for(let T=0;T<5;T++)for(let B=0;B<5;B++){const I=y.getStyleAt({colIndex:B,rowIndex:T});j.push(I)}return j},[y]),b=a.useMemo(()=>{const j=(B,I,F)=>{let N=F.getFill().toCSS(c?.darkMode??!1);const L=u-(I<4?1:0),M=h-(B<4?1:0),v=F.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(u-1),top:B*(h-1),width:L,height:M},e.jsx("td",{className:`table-style-fill ${B}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${B}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(M-1)/2,borderTop:`1px solid ${v}`}})},`${B}-${I}`)},T=[];for(let B=0;B<5;B++){const I=[];for(let F=0;F<5;F++){const N=C[5*B+F];I.push(j(B,F,N))}T.push(e.jsx("tr",{children:I},B))}return T},[y,r,c]),w=a.useCallback((j,T)=>C[T].getBorder()??null,[C]);return e.jsx(E.Box,{ref:i,className:"table-format-preview",sx:{background:c?.fill,filter:g?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...m},...x,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(u-1)+1,height:5*(h-1)+1,darkMode:c?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:fe(s,"sheetxl-table-preview",Yr),style:{borderCollapse:"collapse",width:5*(u-1)+1,height:5*(h-1)+1},children:e.jsx("tbody",{children:b})})})})})),bt=(l,i,n,t,r)=>{l.beginPath(),l.moveTo(i+.5,n+.5),l.lineTo(t+.5,r+.5),l.stroke()},Jr=a.memo(a.forwardRef((l,i)=>{const{table:n,tableStyle:t,styles:r,bodyStyle:c,disabled:m,style:g,className:s,canvas:d,...h}=l,p=a.useMemo(()=>{const f=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return f.styleOptions={...f.styleOptions,name:t.getName()},f.ref=S,new O.Table({initialAnchor:S,json:f,styles:r})},[n,t,r]),x=a.useMemo(()=>{const f=[];for(let S=0;S<5;S++)for(let y=0;y<5;y++){const C=p.getStyleAt({colIndex:y,rowIndex:S});f.push(C)}return f},[p]),u=a.useMemo(()=>{let f=d;if(d||(f=document.createElement("canvas")),!f)return null;f.width!==61&&(f.width=61),f.height!==46&&(f.height=46);const S=f.getContext("2d",{alpha:!1});if(!S)return null;const y=12,C=c?.darkMode??!1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const j=x[5*b+w].getFill();let T=c?.fill;j.getType()===O.IFill.Type.Solid?T=j.getColor().toCSS(C,!1):j.getType()===O.IFill.Type.Gradient?T=j.getStops[0]?.color.toCSS(C,!1):j.getType()===O.IFill.Type.Pattern&&(T=j.getForeground().toCSS(C,!1)),S.fillStyle=T;const B=w*y,I=9*b;S.fillRect(B,I,13,10)}S.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const j=x[5*b+w],T=w*y,B=9*b,I=j.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(C,!1),bt(S,T,B,T,B+9));const M=I.getTop();M.isNone()||(S.strokeStyle=M.getColor().toCSS(C,!1),bt(S,T,B,T+y,9*b));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(C,!1),bt(S,T+y,B,T+y,B+9));const P=I.getBottom();P.isNone()||(S.strokeStyle=P.getColor().toCSS(C,!1),bt(S,T,B+9,T+y,B+9))}S.strokeStyle=j.getFont().getFill().toCSS(C,!1);const F=4,N=2.5;bt(S,w*y+N,9*b+F,w*y+N+7,9*b+F)}return`url(${f.toDataURL()})`},[d,p,t,c]);return e.jsx("div",{ref:i,className:fe("table-style-preview",s),style:{backgroundImage:u,width:61,height:46,...g},...h})})),Wl=a.memo(a.forwardRef((l,i)=>{const{styleOptions:n,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:c,showTotalRow:m,onShowTotalRowChange:g,showFilterButton:s,onShowFilterButtonChange:d,sx:h,disabled:p,...x}=l;return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:u=>`${u.spacing(2)}`,marginRight:u=>`${u.spacing(2)}`},"& .MuiCheckbox-root":{padding:u=>`${u.spacing(.5)}`},...h},...x,ref:i,children:[c&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:p||r==null}),label:"Header Row",labelPlacement:"end"}),g&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>g(!m),disabled:p||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:s??!1,indeterminate:s==null,disabled:p||!n||s==null,onChange:()=>d(!s)}),label:"Filter Button",labelPlacement:"end"})]})})),Vl=a.memo(l=>{const{table:i,tableStyle:n,selectedTableStyleName:t,onSelectTableStyleName:r,styles:c,hasContextMenu:m=!0,bodyStyle:g,parentFloat:s,commands:d,disabled:h,commandHook:p,useCanvasPreview:x=!0,canvas:u,...f}=l,S=a.useCallback(w=>{const j={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"table"},T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...j,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:h}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:h||!n||n.isBuiltIn()})]}),B=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})});return o.defaultCreatePopupPanel({...w,children:B})},[d]),y=n?.getName()===t,C=a.useMemo(()=>{const w={table:i,tableStyle:n,styles:c,bodyStyle:g};return x?e.jsx(Jr,{canvas:u,...w}):e.jsx(Zr,{...w})},[i,n,c,g]);let b=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${y?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{r?.(n?.getName())},...f,children:C},n.getName());return m&&(b=e.jsx(o.ContextMenu,{label:i.getStyleOptions().name,parentFloat:s,createPopupPanel:S,children:b})),b}),Qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedTable:c,onSelectTableStyleName:m,disabled:g=!1,bodyStyle:s,usePreviewIcon:d=!1,...h}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.table?.();let f="insertTable";u&&(f="editTable");const S=a.useMemo(()=>((N,L)=>{const M={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new O.Table({initialAnchor:M,styles:L,json:{name:"PreviewTable",ref:M,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:N}})})(u?.getStyleOptions(),x?.()),[x?.().getDefaultTableStyle(),u?.getStyleOptions()]),y=u??S,[C,b]=a.useState(y);a.useEffect(()=>{b(y)},[y]);const w=s??p?.bodyStyle(),j=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),T=a.useRef(null),B=a.useCallback((N,L)=>{const M={onSelectTableStyleName:j,styles:x(),parentFloat:N.floatReference};T.current||(T.current=document.createElement("canvas"));const v=_=>{const U=x().getTableStyle(_);return U?e.jsx(Vl,{table:C,tableStyle:U,selectedTableStyleName:C.getStyleOptions().name,bodyStyle:p.bodyStyle(),commands:L,commandHook:r,canvas:T.current,...M},_):null},P=(_,U,Q=!0)=>{const ee=[];for(let K=0;K<U.length;K++){const W=v(U[K]);W&&ee.push(W)}return ee.length===0?null:e.jsxs(E.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:_},_+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},_+"-presets")]},_)},H=[],A=x().getCustomTableStyles(),$=[];if(A.length>0){for(let _=0;_<A.length;_++)A[_].isShownInTableStyles()&&$.push(A[_].getName());H.push(P("Custom",$,!1))}const D=[];u&&!u.getStyleOptions().name&&D.push(null);for(let _=0;_<21;_++)D.push("TableStyleLight"+(_+1));H.push(P("Light",D,$.length>0));const R=[];for(let _=0;_<28;_++)R.push("TableStyleMedium"+(_+1));H.push(P("Medium",R));const q=[];for(let _=0;_<11;_++)q.push("TableStyleDark"+(_+1));H.push(P("Dark",q));let Y=null;return u&&(Y=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,command:L.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))})]})),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:_=>`${_.shape.borderRadius}px`,paddingBottom:_=>`${_.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),Y]})},[x,x?.().getTheme(),w,C]),I=g||!t||t.disabled(),F=a.useMemo(()=>{if(!p||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[C,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:f,createPopupPanel:B,commands:n,label:t?.label(),commandState:u,commandHook:r,selected:u!==null,createTooltip:({children:N},L)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:L,children:N}),disabled:I,icon:F,...h})})),Ie=[];Ie.push(De("Primary Background","bg1")),Ie.push(De("Primary Text","tx1")),Ie.push(De("Secondary Background","bg2")),Ie.push(De("Secondary Text","tx2")),Ie.push(De("Accent 1","accent1")),Ie.push(De("Accent 2","accent2")),Ie.push(De("Accent 3","accent3")),Ie.push(De("Accent 4","accent4")),Ie.push(De("Accent 5","accent5")),Ie.push(De("Accent 6","accent6"));const ea=l=>{const{docTheme:i,onSelectTheme:n,darkMode:t,isSelected:r,outlined:c,sx:m,...g}=l,s=G.useTheme(),d=a.useMemo(()=>{let h=[];for(let p=0;p<Ie.length;p++){const x=Ie[p];h.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:x,darkMode:t,selectedColor:null},p+"-colorDef"))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(E.Box,{sx:{display:"flex",boxShadow:p=>p.shadows[2]},children:h})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:h=>`solid ${r?h.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:h=>`solid ${h.palette.text.primary} 1px !important`}},icon:null,...g,children:e.jsxs(E.Box,{sx:{border:h=>`solid ${h.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:h=>r?h.palette.text.primary:void 0,"&:hover:not([disabled])":{color:h=>h.palette.text.primary}},children:[e.jsx(E.Box,{sx:{},children:i.getName()}),e.jsxs(E.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,e.jsx(E.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(o.SimpleTooltip,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
6
+ */const O=require("@sheetxl/sdk"),e=require("react/jsx-runtime"),a=require("react"),E=require("@mui/material"),o=require("@sheetxl/utils-mui"),me=require("@mui/icons-material"),k=require("@sheetxl/utils-react"),G=require("@mui/material/styles"),le=require("@sheetxl/react"),Re=require("@mui/system"),Je=require("react-dom"),Fe=require("@sheetxl/utils"),it=require("@sheetxl/io");function vr(l){var i,n,t="";if(typeof l=="string"||typeof l=="number")t+=l;else if(typeof l=="object")if(Array.isArray(l)){var r=l.length;for(i=0;i<r;i++)l[i]&&(n=vr(l[i]))&&(t&&(t+=" "),t+=n)}else for(n in l)l[n]&&(t&&(t+=" "),t+=n);return t}function fe(){for(var l,i,n=0,t="",r=arguments.length;n<r;n++)(l=arguments[n])&&(i=vr(l))&&(t&&(t+=" "),t+=i);return t}const jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=a.useMemo(()=>{for(let u=0;u<s.length;u++)if(s[u]?.state())return s[u].key();return s[0]?.key()},[s]),h=a.useMemo(()=>{const u=new Map;return u.set("formatAlignLeftToggle",o.themeIcon(e.jsx(me.FormatAlignLeft,{}))),u.set("formatAlignCenterToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),u.set("formatAlignRightToggle",o.themeIcon(e.jsx(me.FormatAlignRight,{}))),u.set("formatAlignJustifyToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignCenterContinuousToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),u.set("formatAlignFillToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignDistributedHorizontalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u},[]),p=a.useMemo(()=>{if(!t)return null;const u={...t};return delete u.beforeExecute,u},[t]),x=a.useCallback((u,f)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignLeftToggle"),icon:h.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignCenterToggle"),icon:h.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignRightToggle"),icon:h.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignJustifyToggle"),icon:h.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignCenterContinuousToggle"),icon:h.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignFillToggle"),icon:h.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("formatAlignDistributedHorizontalToggle"),icon:h.get("formatAlignDistributedHorizontalToggle")})]}),C=e.jsxs(E.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:f.getCommand("formatIndentDecrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:f.getCommand("formatIndentIncrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),b=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...g,children:[C,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return o.defaultCreatePopupPanel({...u,children:b})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,commands:n,commandHook:t,scope:r,createPopupPanel:x,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:h.get(d)??e.jsx(me.FormatAlignLeft,{}),...g})})),Tr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatAlignTopToggle",o.themeIcon(e.jsx(o.TextVerticalTopIcon,{}))),p.set("formatAlignMiddleToggle",o.themeIcon(e.jsx(o.TextVerticalCenterIcon,{}))),p.set("formatAlignBottomToggle",o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{}))),p.set("formatAlignJustifyVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignDistributedVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:h,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{})),...m})})),Er=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatTextOverflowVisibleToggle",o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{}))),p.set("formatTextOverflowWrapToggle",o.themeIcon(e.jsx(o.TextHorizontalWrapIcon,{}))),p.set("formatTextOverflowClipToggle",o.themeIcon(e.jsx(o.TextHorizontalClipIcon,{}))),p.set("formatTextOverflowShrinkToggle",o.themeIcon(e.jsx(o.TextHorizontalShrinkIcon,{}))),p},[]),h=k.useCallbackRef((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Br=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),s=a.useMemo(()=>{const x=g.length;for(let u=0;u<x;u++){const f=g[u];if(f?.state())return f.key()}return g[1]?.key()},[g]),d=a.useMemo(()=>{const x=new Map;return x.set("formatTextRotate0",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),x.set("formatTextRotate315",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),x.set("formatTextRotate45",o.themeIcon(e.jsx(o.TextRotation45Icon,{}))),x.set("formatTextRotate90",o.themeIcon(e.jsx(o.TextRotation90Icon,{}))),x.set("formatTextRotate270",o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))),x.set("formatTextRotateCustom",o.themeIcon(e.jsx(o.TextRotationCustomIcon,{}))),x},[]),h=a.useCallback((x,u)=>{const f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...f,command:u.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...f,command:u.getCommand("formatTextRotateCustom"),icon:o.themeIcon(e.jsx(o.TextRotationCustomIcon,{})),label:"Custom"})]});return o.defaultCreatePopupPanel({...x,children:S})},[c,t,r,n]),p=a.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[g]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,selected:p,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:h,quickCommand:p?"formatTextRotate0":"formatTextRotate315",icon:o.themeIcon(d.get(s)??e.jsx(o.TextRotation315Icon,{})),...m})})),Ir={Preset:"preset",Custom:"custom"},dt={Start:"start",End:"end"},bo={},Dl=(l,i,n,t)=>{const r=l+"-"+i+"-"+n+(t?"-server":"");if(bo[r])return bo[r];const c=((m,g,s,d)=>{if(typeof document>"u"&&!d)return null;const h=d?new d:document.createElement("canvas");h.width=2*s,h.height=2*s;const p=h.getContext("2d");return p?(p.fillStyle=m,p.fillRect(0,0,h.width,h.height),p.fillStyle=g,p.fillRect(0,0,s,s),p.translate(s,s),p.fillRect(0,0,s,s),h.toDataURL()):null})(l,i,n,t);return bo[r]=c,c},Fl={},Rr=a.memo(l=>{const{className:i,style:n=k.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:c=8,borderRadius:m,boxShadow:g,renderers:s=Fl,children:d,...h}=l,p=d,x=a.useMemo(()=>Object.assign({borderRadius:m,boxShadow:g,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${Dl(t,r,c,s?.canvas)}) center left`},n),[t,r,c,s]);return a.isValidElement(d)?a.cloneElement(d,{...p.props}):e.jsx("div",{style:x,...h})}),Nl=a.memo(l=>{const{selectedColor:i,onSelectColor:n,onPreviewColor:t,onClick:r,onKeyDown:c,onMouseOver:m,onMouseLeave:g,onFocus:s,style:d=k.ReactUtils.EmptyCssProperties,children:h,alphaWhite:p,alphaGrey:x,darkMode:u,alphaCheckSize:f=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const y=a.useCallback(B=>{r?.(B),B.isDefaultPrevented()||(B.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),C=a.useCallback(B=>{m?.(B),B.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),b=a.useCallback(B=>{g?.(B),B.isDefaultPrevented()},[t,g]),w=a.useCallback(B=>{s?.(B),B.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),j=a.useCallback(B=>{c?.(B),B.isDefaultPrevented()||B.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),T=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Rr,{size:f,white:p,grey:x,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[p,x,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...S,onClick:y,onKeyDown:j,onMouseOver:C,onMouseLeave:b,onFocus:w,children:[T,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:h})]})}),ao=a.memo(l=>{const{schemeColorLookup:i,selectedColor:n,previewColor:t,colorDef:r,onSelectColorDef:c,onPreviewColorDef:m,swatchProps:g,defaultButtonSize:s=24,isLarge:d=!1,compareRGB:h=!1,darkMode:p=!1,...x}=l,u=new O.Color({val:r.definition.val,adjs:r.definition.adjs},T=>i(T)),f=h?u.toRGBA().toString():u.toString(),S=n&&(h?n.toRGBA().toString():n.toString())===f,y=t&&(h?t.toRGBA().toString():t.toString())===f,C=[];C.push({[O.IColor.AdjustmentType.Inv]:!0}),C.push({[O.IColor.AdjustmentType.Alpha]:100});const b=u.adjust(C),w=a.useCallback(()=>{c?.(r)},[c,r]),j=a.useCallback(T=>{m?.(T?r:null)},[m,r]);return e.jsx(o.SimpleTooltip,{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:e.jsx("div",{style:{width:s*(d?1.2:1)+"px",height:s*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...x,children:e.jsxs(Nl,{selectedColor:u,title:null,onSelectColor:w,onPreviewColor:j,alphaCheckSize:d?9:void 0,darkMode:p,...g,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(p).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:S?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*s*(d?1.2:1)+"px",height:.33*s*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(p).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Ht=a.memo(l=>{const{title:i,schemeColorLookup:n,colorDefs:t,selectedColor:r,previewColor:c,onSelectColorDef:m,onPreviewColorDef:g,style:s=k.ReactUtils.EmptyCssProperties,compareRGB:d=!1,darkMode:h,swatchProps:p,...x}=l;let u;if(Array.isArray(t[0]))u=t;else{u=[];for(let b=0;b<t.length;b++)u.push([t[b]])}const f=a.useCallback(b=>{m?.(b)},[m]),S=a.useCallback(b=>{g?.(b)},[g]),y=a.useMemo(()=>{let b=[];for(let w=0;w<u.length;w++){let j=[],T=u[w];for(let I=0;I<T.length;I++){let F=T[I];j.push(e.jsx(ao,{schemeColorLookup:n,colorDef:F,selectedColor:r,previewColor:c,onSelectColorDef:f,onPreviewColorDef:S,swatchProps:p,compareRGB:d,darkMode:h},w+" "+I))}let B=e.jsx(E.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+w);b.push(B)}return b},[u,r,c,f,S]),C=a.useMemo(()=>i?e.jsx(E.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:i}):null,[i]);return e.jsxs(E.Box,{style:{...s},children:[C,e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...x,children:y})]})}),De=(l,i)=>({description:l,definition:{val:i,adjs:[]}}),ye=(l,i,n,t,r,c)=>{const m=De(l,i);t?.push(m);const g=new O.Color({val:m.definition.val,adjs:m.definition.adjs},n),s=g.toString();r?.set(s,g);const d=g.toRGBA().toString();c?.set(d,g)},Al=a.lazy(()=>Promise.resolve().then(()=>require("./Dkrv98Pt_gBc35aF.cjs"))),Mr=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n=null,previewColor:t=l.selectedColor??null,recentColors:r,schemeLookup:c,disableAlpha:m=!1,previewDebounceTime:g=100,initialPanelType:s,defaultButtonSize:d=24,width:h,onElementLoad:p,onDone:x,onEyeDropStart:u,onEyeDropStop:f,onPreviewColor:S,onPreviewColorImmediate:y,onSelectColor:C,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:j=dt.Start,compareRGB:T=!1,darkMode:B=!1,...I}=l,F=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(y,[y]),M=k.useCallbackRef(C,[C]),v=k.useCallbackRef(u,[u]),P=k.useCallbackRef(f,[f]),[H,A]=a.useState(!1),$=G.useTheme(),D=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",D,ce,z,J),ye("Primary Text","tx1",D,ce,z,J),ye("Secondary Background","bg2",D,ce,z,J),ye("Secondary Text","tx2",D,ce,z,J),ye("Accent 1","accent1",D,ce,z,J),ye("Accent 2","accent2",D,ce,z,J),ye("Accent 3","accent3",D,ce,z,J),ye("Accent 4","accent4",D,ce,z,J),ye("Accent 5","accent5",D,ce,z,J),ye("Accent 6","accent6",D,ce,z,J);const re=O.ITheme.buildPalette(ce,D,z,J),ae=[];if(ye("Dark Red","C00000",D,ae,z,J),ye("Red","FF0000",D,ae,z,J),ye("Orange","FFC000",D,ae,z,J),ye("Yellow","FFFF00",D,ae,z,J),ye("Light Green","92D050",D,ae,z,J),ye("Green","00B050",D,ae,z,J),ye("Light Blue","00B0F0",D,ae,z,J),ye("Blue","0070C0",D,ae,z,J),ye("Dark Blue","002060",D,ae,z,J),m?ye("Purple Is A Fruit","7030A0",D,ae,z,J):ye("Transparent","00000000",D,ae,z,J),b){const ie=b.toString();z.set(ie,b)}const X=new Map,te=typeof r=="function"?r():r,ue=[];for(let ie=0;te&&ie<te.length;ie++){const je=te[ie].toString();X.set(je,te[ie]),ue.push({description:"Recent "+(ie+1),definition:{val:te[ie].toString()}})}return{primaryColors:ce,modifiedPresets:re,standardColors:ae,recentColorsLimited:ue,mapAllPresets:z,mapAllPresetsRGB:J,mapRecent:X}},[D,r,m,b]);a.useEffect(()=>{p?.()},[]);const[q,Y]=a.useState(!1),_=a.useCallback(()=>{Y(z=>!z)},[]);a.useEffect(()=>{if(s)Y(s===Ir.Custom);else if(n){let z=n.toString(),J=R.mapAllPresets.get(z);J||(z=n.toRGBA().toString(),J=R.mapAllPresetsRGB.get(z));const ce=R.mapRecent.get(z);Y(!J&&!ce)}},[n,s]);const U=a.useCallback(O.CommonUtils.debounce(z=>{N?.(z)},g),[N,g]),[Q,ee]=a.useState();a.useEffect(()=>{ee(t||n)},[t,n]);const K=k.useCallbackRef(z=>{L&&(L(z),U(z))},[L]),W=k.useCallbackRef(z=>{K(z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},D):null)},[D]),Z=a.useCallback(z=>{z.ctrlKey&&Y(!0)},[]),ne=k.useCallbackRef(z=>{let J=!1;if(z){const ce=z.toString();J=!R.mapAllPresets.has(ce)}M?.(z,J)},[M,R]),be=k.useCallbackRef(z=>{const J=z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},D):null;Promise.resolve(x?.()).then(()=>{ne(J)})},[D,x]),ge=k.useCallbackRef(z=>{K(z?new O.Color(z,D):null)},[D]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(E.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:z=>z.palette.text.icon??z.palette.action.active},onClick:async()=>{A(!0),v?.(),await new EyeDropper().open().then(z=>{A(!1),P?.();let J=new O.Color(z.sRGBHex),ce=J.toString(),re=R.mapAllPresets.get(ce);if(re||(ce=J.toRGBA().toString(),re=R.mapAllPresetsRGB.get(ce)),!re){const ae=J.toRGBA(),X=3;let te=255;R.mapAllPresetsRGB.forEach((ue,ie)=>{const je=ue.toRGBA(),Me=Math.abs(je.red-ae.red)+Math.abs(je.blue-ae.blue)+Math.abs(je.green-ae.green);Me<X&&Me<te&&(re=ue)})}Y(!re),K(re||J)}).catch(z=>{A(!1),z?.name!=="AbortError"&&console.error(z)})},children:e.jsx(me.Colorize,{})}),[R,B]),Be=a.useMemo(()=>{if(!q)return;const z={opacity:q?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(a.Suspense,{fallback:e.jsx("div",{style:z,children:e.jsx(o.LoadingPanel,{})}),children:e.jsx(Al,{style:z,selectedColor:F?F.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[q,F]),se=a.useMemo(()=>({onClick:Z,alphaGrey:$.palette.text.icon??$.palette.action.active}),[Z,$]),Se=a.useMemo(()=>{if(!b)return null;const z={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(E.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(E.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:D,colorDef:z,selectedColor:n===null?b:n,previewColor:t===null?b:t,defaultButtonSize:d,isLarge:!0,darkMode:B,compareRGB:T,swatchProps:se})}),e.jsx(E.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,D,n,t]);return e.jsxs(E.Box,{ref:i,sx:{width:h,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...I,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:q?"0":1},children:[Se&&j===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(E.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:D,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsx(Ht,{schemeColorLookup:D,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:D,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:D,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:B})]}),Se&&j===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(E.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Be]}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[xe,e.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),e.jsx(E.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{_()},children:q?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(E.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(x?.()).then(()=>{ne(Q)})},children:"Done"})]})]})})),Ol=e.jsx(o.ColorizedCircleIcon,{}),zo=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n,quickColor:t,icon:r=Ol,tooltip:c,label:m,onPreviewColor:g,onPreviewColorImmediate:s,onSelectColor:d,variant:h=o.PopupButtonType.Toolbar,panelProps:p,shouldCloseFloatAll:x=!0,compareRGB:u=!1,darkMode:f=!1,...S}=l,y=k.useCallbackRef(g,[g]),C=k.useCallbackRef(s,[s]),b=k.useCallbackRef(d,[d]),[w,j]=a.useState(()=>{}),T=t||w||n||p?.autoColor,B=a.useRef(!1),I=a.useCallback(()=>{},[]),F=k.useCallbackRef(()=>{j(n)},[n]),N=k.useCallbackRef(R=>{B.current||(j(R),y?.(R))},[y]),L=k.useCallbackRef(R=>{B.current||(j(R),C?.(R))},[C]),M=k.useCallbackRef((R,q)=>{B.current||(j(void 0),b?.(R,q))},[b]),v=a.useMemo(()=>e.jsx(E.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${T?.toCSS(f)??"transparent"}`,"& .activeColor":{fill:`${T?.toCSS(f)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[T,r,f]),P=k.useCallbackRef(R=>{b?.(t,!1)},[b,t]),[H,A]=a.useState(!1),$=a.useCallback(R=>{const{closeFloat:q,closeFloatAll:Y}=R;return e.jsx(Mr,{...p,selectedColor:n,previewColor:w,onDone:x?Y:q,onKeyDown:_=>{_.which===k.KeyCodes.Enter&&(x?Y():q())},onPreviewColorImmediate:L,onPreviewColor:N,onSelectColor:M,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:u,darkMode:f})},[n,w,x,T,p?.autoColor,f]),D={onQuickClick:t?P:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:F,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return h===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...D}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...D})})),Qt=82,Fo=l=>{const{styleColor:i,length:n=Qt,width:t=1,dashArray:r=null,sx:c,isDouble:m=!1,isAngled:g=!1,darkMode:s=!1,...d}=l;return e.jsx(E.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:h=>`${i?i.toRGBA(s).toString():h.palette.text.icon??h.palette.action.active}`},"& .style_grey":{stroke:h=>h.palette.text.icon??h.palette.action.active},...c},height:t,width:n,viewBox:`0 0 ${n} ${t}`,...d,children:e.jsx(le.StyledStrokePath,{length:n,width:t,dashArray:r,isDouble:m,isAngled:g,className:"activeColor"})})},Pr=a.memo(a.forwardRef((l,i)=>{const{variant:n,showLabels:t=!1,disabled:r=!1,createPopupPanel:c,styleColor:m,selectedStyle:g,onSelectStyle:s,showNone:d=!0,darkMode:h,sx:p,...x}=l,u=k.useCallbackRef(s,[]),f=a.useCallback(b=>{const{popupContainer:w,floatReference:j,closeFloat:T,...B}=b,I=[],F=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<F.length;N++){const L=F[N];if(L.description==="None"&&!d)continue;const M=e.jsx(Fo,{styleColor:m,length:Qt,width:L.width,darkMode:h,dashArray:L.pattern,isDouble:L.description.toLowerCase().includes("double"),isAngled:L.description.toLowerCase().includes("slant")});let v=null;v=t?e.jsxs(e.Fragment,{children:[e.jsx(E.Box,{sx:{marginRight:"6px"},children:L.description}),e.jsxs(E.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[e.jsx("div",{style:{flex:"1 1 100%"}}),M]})]}):L.description==="None"?"None":M,I.push(e.jsx(o.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:o.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":L.description},icon:null,disabled:r,onMouseDown:P=>P.preventDefault(),onMouseUp:()=>{T(),u(L.style)},onKeyDown:P=>{P.which===k.KeyCodes.Enter&&T()},selected:L.style===g,parentFloat:j,children:v},N))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,g,h]),S=a.useMemo(()=>{const b=O.IBorder.BuiltInDefinitions.get(g);let w;return w=b.description==="None"?e.jsx(E.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Fo,{styleColor:m,length:Qt,width:b.width,dashArray:b.pattern,darkMode:h,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),e.jsx(E.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:o.createStrokeShadowFilter()}},children:w})},[g,m]),y=a.useMemo(()=>O.IBorder.BuiltInDefinitions.get(g),[g]),C={disabled:r,icon:S,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,...p},createPopupPanel:f,...x};return n===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{...C}):e.jsx(o.ExhibitPopupMenuItem,{...C})})),Dr=a.memo(a.forwardRef((l,i)=>{const{autoColor:n=null,schemeLookup:t,autoStrokeStyle:r=O.IBorder.StrokeStyle.Thin,disabled:c=!1,darkMode:m=!1,showStylingBefore:g=!0,onSelectBorder:s,onPreviewBorder:d,selectedBorder:h,createTemporaryBorder:p,...x}=l,u=k.useCallbackRef(s,[s]),f=k.useCallbackRef(d,[d]),[S,y]=a.useState(),[C,b]=a.useState(),w=S??r,j=C??n,T=h||{bottom:{style:r,color:n?.toString()}},B=k.useCallbackRef(v=>{const P={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(P[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||P[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?P.left:null,D=A?P.top:null,R=A?P.right:null,q=A?P.bottom:null,Y=A?P.vertical:null,_=A?P.horizontal:null;let U="";return D||$||(U+="M 3,5 H 5 V 3 H 3 "),D||(U+="M 7,5 H 9 V 3 H 7 "),D||Y||(U+="M 11,5 h 2 V 3 h -2 "),D||(U+="M 15,5 h 2 V 3 h -2 "),D||R||(U+="M 19,5 h 2 V 3 h -2 "),$||(U+="M 3,9 H 5 V 7 H 3 "),Y||(U+="M 11,9 h 2 V 7 h -2 "),R||(U+="M 19,9 h 2 V 7 h -2 "),_||$||(U+="M 3,13 H 5 V 11 H 3 "),_||(U+="M 7,13 H 9 V 11 H 7 "),_||Y||(U+="M 11,13 h 2 v -2 h -2 "),_||R||(U+="M 19,13 h 2 v -2 h -2 "),_||(U+="M 15,13 h 2 v -2 h -2 "),$||(U+="M 3,17 H 5 V 15 H 3 "),Y||(U+="M 11,17 h 2 v -2 h -2 "),R||(U+="M 19,17 h 2 v -2 h -2 "),q||$||(U+="M 3,21 H 5 V 19 H 3 "),q||(U+="M 7,21 H 9 V 19 H 7 "),q||Y||(U+="M 11,21 h 2 v -2 h -2 "),q||(U+="M 15,21 h 2 v -2 h -2 "),q||R||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[e.jsx(E.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:e.jsx("path",{d:U})}),e.jsx(E.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:o.strokeShadowFilter}},children:e.jsx(le.StaticBorderRenderer,{getBorderAt:(Q,ee)=>{if(!p||H.length===0)return null;const K=Q.rowIndex,W=Q.colIndex,Z={};return K===0?(Z.top=P.top,Z.bottom=P.horizontal):(Z.top=P.horizontal,Z.bottom=P.bottom),W===0?(Z.left=P.left,Z.right=P.vertical):(Z.left=P.vertical,Z.right=P.right),p?.(Z)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[j,w,m]),I=a.useCallback((v,P,H)=>{let A=null;if(v&&v.length>0){let $=null;(P||H)&&($={style:H,color:P?.toString()??null}),A={};for(let D=0;D<v.length;D++)A[v[D]]=$}return A},[]),F=a.useCallback(v=>{u?.(v)},[]),N=a.useCallback(v=>{f?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:P,floatReference:H}=v,A=(R,q,Y="bottom",_=!1)=>{const U=I(R,j??null,_?O.IBorder.StrokeStyle.None:w??null),Q=_?I([],j??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:B(Q),sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{label:q,simple:!0,placement:Y},onClick:()=>{P(),N(U),F(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"All Borders","top"),A([O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"Inner Borders","top"),A([O.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),A([O.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left],"Left Borders"),A([O.IBorder.Edge.Top],"Top Borders"),A([O.IBorder.Edge.Right],"Right Borders"),A([O.IBorder.Edge.Bottom],"Bottom Borders"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical,O.IBorder.Edge.DiagonalUp,O.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),D=e.jsx(e.Fragment,{children:e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(zo,{variant:o.PopupButtonType.Toolbar,icon:e.jsx(o.ColorizedStrokeIcon,{}),selectedColor:w===O.IBorder.StrokeStyle.None?new O.Color("transparent"):j,onPreviewColor:R=>{b(R)},onSelectColor:(R,q)=>{b(R)},darkMode:m,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:t},disabled:c||w===O.IBorder.StrokeStyle.None,parentFloat:H,shouldCloseFloatAll:!1}),e.jsx(Pr,{selectedStyle:w,onSelectStyle:y,styleColor:j,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[g?D:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),g?$:D]})},[w,j,n,t,m]),M=a.useMemo(()=>B(T),[T,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},P)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:P,children:v}),onQuickClick:()=>{u?.(T)},quickButtonProps:{sx:{}},disabled:c,icon:M,...x})})),Fr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,variant:c=k.CommandButtonType.Toolbar,disabled:m=!1,autoColor:g,autoStrokeStyle:s,schemeLookup:d,createTemporaryBorder:h,selectedBorder:p,onSelectBorder:x,darkMode:u,icon:f,label:S,...y}=l,C=k.useCommands(n,["formatBorder"]),b=t??C[0],w=b?.context()??null,j=w?.autoColor??g,T=w?.autoStyle??s,B=p??w?.quickBorder,I=u??w?.darkMode,F=h??w?.createTemporaryBorder,N=d??w?.schemeLookup,L=k.useCallbackRef(v=>{w?.onBorderSelect&&w.onBorderSelect(v),x?.(v),b?.execute(v,r)},[b,x,r]),M=a.useCallback((v,P)=>{const{children:H,title:A,...$}=v;let D=v.children;return(b?.disabled()||m)&&(D=e.jsx("div",{children:D})),e.jsx(o.CommandTooltip,{command:b,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:P,...$,children:D})},[b,m]);return e.jsx(Dr,{ref:i,autoColor:j,darkMode:I,autoStrokeStyle:T,createTemporaryBorder:F,schemeLookup:N,selectedBorder:B,onSelectBorder:L,createTooltip:M,disabled:m||!b||b.disabled(),...y})})),Nr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unmerge"),icon:o.themeIcon(e.jsx(o.MergeUnMergeIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:g,icon:o.themeIcon(e.jsx(o.MergeAllIcon,{})),...m})})),Ar=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unfreeze"),icon:e.jsx(o.MergeUnMergeIcon,{})})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:g,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:e.jsx(o.FreezeIcon,{}),...m})})),Or=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("goto"),icon:o.themeIcon(e.jsx(o.GotoIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:g,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:o.themeIcon(e.jsx(o.FindIcon,{})),...m})})),Lr=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,showQuickButtons:r=!!l.commands,commands:c,fontSizes:m=le.FontUtils.DefaultFontSizes,disabled:g=!1,parentFloat:s,icon:d,label:h,sx:p,...x}=l;k.useCommand(n);const u=()=>n?.state()?.toString()||"11",[f,S]=a.useState(u),y=k.useCallbackRef(()=>{const F=parseFloat(f);isNaN(F)?S(u()):parseFloat(u())!==F&&n.execute(F,t)},[u,n,f,t]);a.useEffect(()=>{S(u())},[n?.state()]);const C=a.useMemo(()=>{if(!t)return null;const F={...t};return delete F.beforeExecute,F},[t]),b=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>b?e.jsxs(E.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[e.jsx(o.CommandButton,{command:b[0],commandHook:C,icon:o.themeIcon(e.jsx(o.TextSizeIncreaseIcon,{}))}),e.jsx(o.CommandButton,{command:b[1],icon:o.themeIcon(e.jsx(o.TextSizeDecreaseIcon,{}))})]}):null,[b]),j=G.useTheme(),T=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),B=a.useCallback(F=>{const{onMouseDown:N,onMouseUp:L,...M}=F;return e.jsx(E.IconButton,{component:"div",...M,disableRipple:!0,children:e.jsx(E.Input,{inputMode:"numeric",disabled:g||!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:v=>`1px solid ${v.palette.text.icon??v.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:v=>`1px solid ${v.palette.error.main}`},"::after":{borderBottom:v=>`1px solid ${v.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:v=>`${Math.round(v.typography.fontSize)}px`,width:T,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:f,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)u()!==f&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===k.KeyCodes.Escape)u()!==f&&(S(u()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(f+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===k.KeyCodes.Space)return void v.preventDefault()}},onBlur:()=>{y()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();S(v.target.value)}})})},[f,g,n]),I=a.useCallback(F=>{const N=P=>{n?.execute(P,t)},L=n?.state(),M=[];for(let P=0;P<m.length;P++){const H=m[P]===L;M.push(e.jsx(o.ExhibitMenuItem,{selected:H,icon:H?e.jsx(o.SelectedIcon,{}):void 0,disabled:g||!n||n.disabled(),onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(m[P])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[P])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[P]})},"fontSize-"+P))}const v=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...x,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:M})]});return o.defaultCreatePopupPanel({...F,children:v})},[g,n?.state(),t]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...p},tabIndex:-1,outlined:!0,disabled:g,parentFloat:s,createPopupPanel:I,createTooltip:({children:F},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:F}),createQuickButton:B,...x})})),Dn=a.memo(l=>{const{selected:i,disabled:n,formattedValue:t,handleSetFormat:r,format:c,sx:m,...g}=l;return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...m},disabled:n,selected:i,icon:i?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:s=>{s.button===0&&s.preventDefault()},onMouseUp:s=>{s.button===0&&r(c.numberFormat)},onKeyDown:s=>{s.keyCode!==k.KeyCodes.Enter&&s.keyCode!==k.KeyCodes.Space||r(c.numberFormat)},...g,children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(E.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(E.Typography,{variant:"caption",component:"div",sx:{color:s=>Re.alpha(s.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),Hr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,sx:c,disabled:m=!1,parentFloat:g,...s}=l,d=k.useCommands(n,["formatNumberFormat"])[0],h=d?.state()?O.NumberFormat.Styles.lookupStyle(d?.state()).formatType:O.NumberFormat.Type.General,p=a.useMemo(()=>{if(!t)return null;const S={...t};return delete S.beforeExecute,S},[t]),x=a.useCallback((S,y)=>{const C=L=>{t?.beforeExecute?.(d,d?.state()),d.execute(L,t),t?.onExecute?.(d,d?.state())},b=d?.context()(),w=O.NumberFormat.Styles.lookupPrimary(),j=[];for(let L=0;L<w.length;L++){let M="";if(b&&!b.isEmpty())try{M=b.getNumberFormat(w[L].numberFormat).displayText}catch(P){console.warn(P)}M===""&&w[L].formatType===O.NumberFormat.Type.General&&(M="No specific format");const v=w[L].formatType===h;j.push(e.jsx(Dn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:M,handleSetFormat:C,format:w[L]},w[L].formatType))}const T={numberFormat:"",formatType:O.NumberFormat.Type.Custom},B=h===O.NumberFormat.Type.Custom,I=e.jsx(Dn,{selected:B,disabled:m||!d||d.disabled(),formattedValue:B?b.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),y.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:T,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),F=e.jsxs(E.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:p,scope:r,icon:e.jsx(o.CurrencyDollarIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:p,scope:r,icon:e.jsx(o.PercentIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:p,scope:r,icon:e.jsx(o.CommaIcon,{})}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:p,scope:r,icon:o.themeIcon(e.jsx(o.IncreaseDecimalIcon2,{}))}),e.jsx(o.CommandButton,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:p,scope:r,icon:o.themeIcon(e.jsx(o.DecreaseDecimalIcon2,{}))})]}),N=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[F,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),u=G.useTheme(),f=a.useMemo(()=>{const S=O.NumberFormat.Type.MediumTime;return`${O.IFont.getSharedMeasurer()(S,Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`},[u]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,sx:c,outlined:!0,disabled:m,parentFloat:g,createPopupPanel:x,createTooltip:({children:S},y)=>e.jsx(o.ExhibitTooltip,{label:d?.label(),description:d?.description(),disabled:y,children:S}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,color:S=>S.palette.text.secondary,fontFamily:S=>S.typography.fontFamily,width:f},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...s})})),Wo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearHyperlinks")})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:g,icon:e.jsx(o.ClearAllIcon,{}),...m})})),zr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillLeft"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(90deg)"}}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:g,icon:o.themeIcon(e.jsx(o.FillDownIcon,{})),...m})})),Vo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:g=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,p=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],x=k.useCommands(n,p),{singleCommand:u,allDisabled:f}=a.useMemo(()=>{let C=null,b=0;for(let w=0;w<x.length;w++)x[w]&&!x[w]?.disabled()&&(g&&d===k.CommandButtonType.Menuitem&&(C=b===0?x[w]:null),b++);return{singleCommand:C,allDisabled:b===0}},[x]),S=a.useMemo(()=>{const C=new Map;return C.set("insertCellsShiftDown",o.themeIcon(e.jsx(o.InsertCells,{}))),C.set("insertCellsShiftRight",o.themeIcon(e.jsx(o.InsertCells,{sx:{transform:"rotate(270deg)"}}))),C.set("insertRows",o.themeIcon(e.jsx(o.InsertRowIcon,{}))),C.set("insertColumns",o.themeIcon(e.jsx(o.InsertColumn2Icon,{}))),C},[]),y=a.useCallback((C,b)=>{let w=null;const j={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:c};m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:b.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:x[0],icon:S.get(p[0])}),e.jsx(o.CommandButton,{...j,command:x[1],icon:S.get(p[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:x[2],icon:S.get(p[2])}),e.jsx(o.CommandButton,{...j,command:x[3],icon:S.get(p[3])}),w]});return o.defaultCreatePopupPanel({...C,children:T})},[c,x,t,r,S]);return u?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:u,icon:S.get(u.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||f,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),e.jsx("br",{}),e.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:o.themeIcon(e.jsx(o.InsertColumn2Icon,{})),...h})})),$o=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:g=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,p=k.useCommands(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:x,allDisabled:u}=a.useMemo(()=>{let y=null,C=0;for(let b=0;b<p.length;b++)p[b]&&!p[b]?.disabled()&&(g&&d===k.CommandButtonType.Menuitem&&(y=C===0?p[b]:null),C++);return{singleCommand:y,allDisabled:C===0}},[p]),f=a.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",o.themeIcon(e.jsx(o.RemoveRowIcon,{}))),y.set("deleteColumns",o.themeIcon(e.jsx(o.RemoveColumn2Icon,{}))),y},[]),S=a.useCallback((y,C)=>{const b={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:c};let w=null;m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftUp"),icon:f.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftLeft"),icon:f.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteRows"),icon:f.get("deleteRows")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteColumns"),icon:f.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...y,children:j})},[c,t,r,f]);return x?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:x,icon:f.get(x.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"deleteCells",commands:n,commandHook:t,scope:r,disabled:c||u,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:S,icon:o.themeIcon(e.jsx(o.RemoveColumn2Icon,{})),...h})})),ut=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,onSelectColor:r,disabled:c=!1,variant:m=k.CommandButtonType.Toolbar,quickColor:g,panelProps:s,isSplit:d=!1,darkMode:h,icon:p,...x}=l,{autoColor:u,schemeLookup:f,recentColors:S,...y}=s;if(x.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");k.useCommand(n);const C=n?.context();let b=g??C?.quickColor;d&&!b&&(b=new O.Color("transparent"));const w=u??C?.autoColor,j=f??C?.schemeLookup,T=S??C?.recentColors,B=h??C?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:j,recentColors:T,darkMode:B,...y}),[w,j,T,B]),F=k.useCallbackRef((L,M)=>{L&&M&&C?.addRecentColor&&C.addRecentColor(L),C?.onColorSelect&&C.onColorSelect(L),r?.(L,M),n?.execute(L,t)},[n,r,t,C]),N=a.useCallback((L,M)=>{const{children:v,title:P,...H}=L;let A=L.children;return(n?.disabled()||c)&&(A=e.jsx("div",{children:A})),e.jsx(o.CommandTooltip,{command:n,placement:m===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:M,...H,children:A})},[n,c]);return e.jsx(zo,{ref:i,panelProps:I,icon:p,quickColor:b,selectedColor:n?.state(),onSelectColor:F,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:B,...x})}));ut.displayName="ColorCommandButton";const Wr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=a.useCallback((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:p.getCommand("gridlinesToggle")}),e.jsx(ut,{...x,command:p.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0}}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleGridlinesRows")})]});return o.defaultCreatePopupPanel({...h,children:u})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...g})})),Uo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=d.getCommand("sortCustom"),x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),p?e.jsx(o.CommandButton,{...h,command:p,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:x})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,label:"Sort",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:g,icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{})),...m})})),Ll=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,label:"Filter",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:g,icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{})),...m})})),_o=a.memo(a.forwardRef((l,i)=>{const{quickCommand:n,icon:t,isRedo:r=!1,nestRedo:c=!0,undoManager:m,scope:g,sx:s,disabled:d,commands:h,...p}=l,x=[n];!r&&c&&x.push("redo");const u=k.useCommands(h,x),f=u[0],S=u[1],y=m??f?.context?.()?.undoManager;let C=d;d||(C=!f||f.disabled(),S&&!S.disabled()&&(C=!1));const[b,w]=a.useState(0),j=a.useCallback((T,B)=>{let I=b===0?"Cancel":`${f.label()} ${b} Action${b===1?"":"s"}`,F=!1;y||(F=!0),F||(F=c?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const N=A=>{f.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:F?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(b)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(b)},children:e.jsx(E.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(F)return L;const M=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),v=[];for(let A=0;A<M.length;A++){const $=M[A];v.push(e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},icon:e.jsx(o.BlankIcon,{}),disabled:C,selected:A<b,onMouseEnter:()=>{w(A+1)},onMouseDown:D=>{D.button===0&&D.preventDefault()},onMouseUp:D=>{D.button===0&&N(A+1)},onKeyDown:D=>{D.isDefaultPrevented()||D.keyCode!==k.KeyCodes.Enter&&D.keyCode!==k.KeyCodes.Space||N(A+1)},children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(E.Typography,{component:"div",children:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let P=null;if(!r&&c){const A={scope:"undo",commands:B,variant:k.CommandButtonType.Menuitem,parentFloat:T.floatReference};P=[],P.push(e.jsx(_o,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&P.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{T.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[P,e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...T,children:H})},[f?.context(),f?.state(),g,y,b,C]);return e.jsx(o.CommandPopupButton,{ref:i,commands:h,quickCommand:n,scope:g,disabled:C,label:f?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${f?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??o.themeIcon(r?e.jsx(o.RedoIcon,{}):e.jsx(o.UndoIcon,{})),selected:!1,...p})})),mt=O.IFontCollection.getFontList(),Vr=new Map;for(let l=0;l<mt.length;l++)Vr.set(mt[l].fontRef.getFamily(),mt[l]);const $r=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,sx:r,disabled:c=!1,parentFloat:m,icon:g,label:s,...d}=l;k.useCommand(n);const h=n?.state(),p=G.useTheme(),x=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("Times New Roman",Math.round(p.typography.fontSize),p.typography.fontFamily).width}px`,[p]),u=a.useCallback(f=>{const S=w=>{n?.execute(w,t)},y=[];for(let w=0;w<mt.length;w++)y.push({key:mt[w].fontRef.getFamily(),description:mt[w].fontRef.getFamily()});Vr.get(h)||y.unshift({key:h,description:h});const C=[];for(let w=0;w<y.length;w++){const j=y[w].key===h;C.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:c||!n||n.disabled(),icon:j?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:T=>{T.button===0&&S(y[w].key)},onMouseDown:T=>{T.button===0&&T.preventDefault()},onKeyDown:T=>{T.keyCode!==k.KeyCodes.Enter&&T.keyCode!==k.KeyCodes.Space||S(y[w].key)},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>y[w]?.key},children:y[w].description})})},w+""+y[w].key))}const b=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})});return o.defaultCreatePopupPanel({...f,children:b})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:u,createTooltip:({children:f},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:f}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:f=>`${Math.round(f.typography.fontSize)}px`,fontFamily:f=>f.typography.fontFamily,color:f=>f.palette.text.secondary,width:x},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...d})})),Ur=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatStrikeThroughToggle",o.themeIcon(e.jsx(o.TextStrikeIcon,{}))),p.set("formatSuperscriptToggle",o.themeIcon(e.jsx(o.TextSuperscriptIcon,{}))),p.set("formatSubscriptToggle",o.themeIcon(e.jsx(o.TextSubscriptIcon,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:h,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextStrikeIcon,{})),...m})})),_r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),s=a.useMemo(()=>{for(let p=0;p<g.length;p++)if(g[p]?.state())return g[p].key();return g[0]?.key()},[g]),d=a.useMemo(()=>{const p=new Map;return p.set("formatUnderlinedToggle",o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))),p.set("formatUnderlinedDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))),p.set("formatUnderlinedAccountingToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))),p.set("formatUnderlinedAccountingDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))),p},[]),h=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},f=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedAccountingToggle"),commandHook:t,icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))}),e.jsx(o.CommandButton,{...u,command:x.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))})]});return o.defaultCreatePopupPanel({...p,children:f})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextUnderlineIcon,{})),...m})})),Ko=a.memo(a.forwardRef((l,i)=>{const{command:n,commands:t,commandHook:r,scope:c,includePasteAllInPopup:m=!0,disabled:g=!1,...s}=l,d=k.useCallbackRef((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:g},u=[];return m&&(u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("paste"),key:"paste",icon:e.jsx(o.PasteIcon,{})})),u.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteValues"),key:"pasteValues",icon:o.themeIcon(e.jsx(o.PasteValuesIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteFormats"),key:"pasteFormats",icon:o.themeIcon(e.jsx(o.PasteFormatsIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteFormulas"),key:"pasteFormulas",icon:o.themeIcon(e.jsx(o.PasteFormulasIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteTranspose"),key:"pasteTranspose",icon:o.themeIcon(e.jsx(o.PasteTransposeIcon,{}))})),u.push(a.createElement(o.CommandButton,{...x,command:p.getCommand("pasteLinks"),key:"pasteLinks",icon:o.themeIcon(e.jsx(o.PasteLinksIcon,{}))})),o.defaultCreatePopupPanel({...h,children:u})},[g,r,c,m]);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:c,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:e.jsx(o.PasteIcon,{}),...s})})),Kr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...g}=l,s=k.useCommands(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=a.useCallback((h,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadings")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(o.CommandButton,{...x,command:p.getCommand("sheetViewToggleShowHeadingRows")})]});return o.defaultCreatePopupPanel({...h,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...g})})),qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="view",disabled:c=!1,...m}=l,g=a.useCallback(s=>{const d={variant:k.CommandButtonType.Menuitem,parentFloat:s.floatReference,commandHook:t,scope:r,disabled:c},h=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return o.defaultCreatePopupPanel({...s,children:h})},[c,n,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:g,icon:e.jsx(o.LabelIcon,{icon:null,label:"Workbook View"}),...m})})),Gr=a.memo(a.forwardRef((l,i)=>{const{value:n,cellStyle:t,styles:r,createTemporaryCell:c,bodyStyle:m,sx:g,borderProps:s,disabled:d,...h}=l,p=a.useMemo(()=>c({value:n,style:t}),[n,t,c]),x=a.useMemo(()=>p.getStyle(),[p,m]),u=a.useMemo(()=>x.getFill().toCSS(m?.darkMode??!1),[x]),f=x.getInsets(),S=x.getFont(),y=a.useCallback(()=>x.getBorder(),[x]);return e.jsx(E.Box,{ref:i,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:m?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...u},"& .text":{flex:"1 1 100%",...S.toCSS(m?.darkMode??!1,1),boxSizing:"border-box",padding:`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:S.toCSS().textDecoration,textAlign:O.ITextFrame.toCSSHorizontalTextAlign(p.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...g},...h,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:y,darkMode:m?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...s?.style},...s,children:e.jsx(E.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:e.jsx(E.Box,{className:"text",children:n})})})})})),Hl=a.memo(l=>{const{styles:i,namedStyle:n,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:c,onSelectNamed:m,createTemporaryCell:g,parentFloat:s,commands:d,disabled:h,commandHook:p,...x}=l,u=a.useCallback(y=>{const C={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"cellStyle"},b=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...C,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...C,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),e.jsx(o.CommandButton,{...C,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:h||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return o.defaultCreatePopupPanel({...y,children:w})},[]),f=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${f?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{m?.(n)},...x,children:e.jsx(Gr,{value:n.getName(),cellStyle:{named:n.getName()},styles:i,createTemporaryCell:g,bodyStyle:c})},n.getName());return r&&(S=e.jsx(o.ContextMenu,{label:n.getName(),parentFloat:s,createPopupPanel:u,children:S})),S}),Xr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedNamed:c,onSelectNamed:m,disabled:g=!1,bodyStyle:s,usePreviewIcon:d=!0,...h}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.named(),f=s??p?.bodyStyle(),S=k.useCallbackRef(j=>{m?.(j),t?.execute(j,r)},[t,m,r]),y=a.useCallback((j,T)=>{const B={onSelectNamed:S,styles:x(),parentFloat:j.floatReference},I=x().getCustomNamed(),F=new Map,N=[];for(let D=0;D<I.length;D++)F.set(I[D].getName(),I[D]),x().getNamed(I[D].getName()).getBuiltInID()===null&&N.push(I[D].getName());const L=D=>{let R=F.get(D);return R||(R=x().getNamed(D)),!R||R.isHidden()?null:e.jsx(Hl,{namedStyle:R,selectedNamed:u,bodyStyle:p.bodyStyle(),createTemporaryCell:p.createTemporaryCell,commands:n,commandHook:r,...B},D)},M=(D,R,q=!0)=>{const Y=[];for(let _=0;_<R.length;_++){const U=L(R[_]);U&&Y.push(U)}return Y.length===0?null:e.jsxs(E.Box,{children:[q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:D},D+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:Y},D+"-presets")]},D)},v=(D,R)=>{const q=[];for(let Y=0;Y<R.length;Y++){const _=L(R[Y]);_&&q.push(_)}return q.length===0?null:e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:q},D+"-presets")},P=[];P.push(M("Custom",N,!1)),P.push(M("Good, Bad and Neutral",[O.IStyle.BuiltInName.Normal,O.IStyle.BuiltInName.Bad,O.IStyle.BuiltInName.Good,O.IStyle.BuiltInName.Neutral],N.length>0)),P.push(M("Data and Model",[O.IStyle.BuiltInName.Calculation,O.IStyle.BuiltInName.CheckCell,O.IStyle.BuiltInName.ExplanatoryText,O.IStyle.BuiltInName.FollowedHyperlink,O.IStyle.BuiltInName.Hyperlink,O.IStyle.BuiltInName.Input,O.IStyle.BuiltInName.LinkedCell,O.IStyle.BuiltInName.Note,O.IStyle.BuiltInName.Output,O.IStyle.BuiltInName.WarningText])),P.push(M("Titles and Headings",[O.IStyle.BuiltInName.Heading1,O.IStyle.BuiltInName.Heading2,O.IStyle.BuiltInName.Heading3,O.IStyle.BuiltInName.Heading4,O.IStyle.BuiltInName.Title,O.IStyle.BuiltInName.Total]));let H=[];var A,$;return H.push(v("Accent 1",[O.IStyle.BuiltInName.Accent1_20,O.IStyle.BuiltInName.Accent1_40,O.IStyle.BuiltInName.Accent1_60,O.IStyle.BuiltInName.Accent1])),H.push(v("Accent 2",[O.IStyle.BuiltInName.Accent2_20,O.IStyle.BuiltInName.Accent2_40,O.IStyle.BuiltInName.Accent2_60,O.IStyle.BuiltInName.Accent2])),H.push(v("Accent 3",[O.IStyle.BuiltInName.Accent3_20,O.IStyle.BuiltInName.Accent3_40,O.IStyle.BuiltInName.Accent3_60,O.IStyle.BuiltInName.Accent3])),H.push(v("Accent 4",[O.IStyle.BuiltInName.Accent4_20,O.IStyle.BuiltInName.Accent4_40,O.IStyle.BuiltInName.Accent4_60,O.IStyle.BuiltInName.Accent4])),H.push(v("Accent 5",[O.IStyle.BuiltInName.Accent5_20,O.IStyle.BuiltInName.Accent5_40,O.IStyle.BuiltInName.Accent5_60,O.IStyle.BuiltInName.Accent5])),H.push(v("Accent 6",[O.IStyle.BuiltInName.Accent6_20,O.IStyle.BuiltInName.Accent6_40,O.IStyle.BuiltInName.Accent6_60,O.IStyle.BuiltInName.Accent6])),P.push((A="Themed Cell Styles",$=H,e.jsxs(E.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),P.push(M("Number Format",[O.IStyle.BuiltInName.Comma,O.IStyle.BuiltInName.Comma0,O.IStyle.BuiltInName.Currency,O.IStyle.BuiltInName.Currency0,O.IStyle.BuiltInName.Percent])),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:D=>`${D.shape.borderRadius}px`,paddingBottom:D=>`${D.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:P}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:u,command:T.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[u,x?.().getTheme(),f]),C=k.useCallbackRef(j=>{const T=18/O.IFont.getDeviceScale(),B=p?.createTemporaryCell(j);return B.getStyle().getFont().getSize()<=T?B:B.createTemporaryCell({style:{font:{size:T}}})},[p?.createTemporaryCell]),b=g||!t||t.disabled(),w=a.useMemo(()=>p&&d?e.jsx(Gr,{value:u?.getName()??"Custom",cellStyle:u?{named:u.getName()}:void 0,styles:p.styles(),createTemporaryCell:C,bodyStyle:p.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[u,f,b]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:y,outlined:d,commands:n,createTooltip:({children:j},T)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:T,children:j}),selected:!1,disabled:b,label:t?.label(),icon:w,...h})})),Yr="_sheetxl-reset_ods65_1",zl=10,Zr=a.memo(a.forwardRef((l,i)=>{const{styles:n,table:t,tableStyle:r=t?.getStyle()??n.getDefaultTableStyle(),bodyStyle:c,sx:m,disabled:g,className:s,forceThinBorder:d,cellHeight:h=zl,isLive:p=!1,...x}=l,u=Math.ceil(1.3*h),[f,S]=a.useReducer(j=>j+1,0);a.useEffect(()=>{if(p&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,p]);const y=a.useMemo(()=>{let j=t?.toJSON()??{};const T={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=T,new O.Table({initialAnchor:T,json:j,styles:n})},[f,t,r,n]),C=a.useMemo(()=>{const j=[];for(let T=0;T<5;T++)for(let B=0;B<5;B++){const I=y.getStyleAt({colIndex:B,rowIndex:T});j.push(I)}return j},[y]),b=a.useMemo(()=>{const j=(B,I,F)=>{let N=F.getFill().toCSS(c?.darkMode??!1);const L=u-(I<4?1:0),M=h-(B<4?1:0),v=F.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(u-1),top:B*(h-1),width:L,height:M},e.jsx("td",{className:`table-style-fill ${B}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${B}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(M-1)/2,borderTop:`1px solid ${v}`}})},`${B}-${I}`)},T=[];for(let B=0;B<5;B++){const I=[];for(let F=0;F<5;F++){const N=C[5*B+F];I.push(j(B,F,N))}T.push(e.jsx("tr",{children:I},B))}return T},[y,r,c]),w=a.useCallback((j,T)=>C[T].getBorder()??null,[C]);return e.jsx(E.Box,{ref:i,className:"table-format-preview",sx:{background:c?.fill,filter:g?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...m},...x,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(u-1)+1,height:5*(h-1)+1,darkMode:c?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:fe(s,"sheetxl-table-preview",Yr),style:{borderCollapse:"collapse",width:5*(u-1)+1,height:5*(h-1)+1},children:e.jsx("tbody",{children:b})})})})})),bt=(l,i,n,t,r)=>{l.beginPath(),l.moveTo(i+.5,n+.5),l.lineTo(t+.5,r+.5),l.stroke()},Jr=a.memo(a.forwardRef((l,i)=>{const{table:n,tableStyle:t,styles:r,bodyStyle:c,disabled:m,style:g,className:s,canvas:d,...h}=l,p=a.useMemo(()=>{const f=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return f.styleOptions={...f.styleOptions,name:t.getName()},f.ref=S,new O.Table({initialAnchor:S,json:f,styles:r})},[n,t,r]),x=a.useMemo(()=>{const f=[];for(let S=0;S<5;S++)for(let y=0;y<5;y++){const C=p.getStyleAt({colIndex:y,rowIndex:S});f.push(C)}return f},[p]),u=a.useMemo(()=>{let f=d;if(d||(f=document.createElement("canvas")),!f)return null;f.width!==61&&(f.width=61),f.height!==46&&(f.height=46);const S=f.getContext("2d",{alpha:!1});if(!S)return null;const y=12,C=c?.darkMode??!1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const j=x[5*b+w].getFill();let T=c?.fill;j.getType()===O.IFill.Type.Solid?T=j.getColor().toCSS(C,!1):j.getType()===O.IFill.Type.Gradient?T=j.getStops[0]?.color.toCSS(C,!1):j.getType()===O.IFill.Type.Pattern&&(T=j.getForeground().toCSS(C,!1)),S.fillStyle=T;const B=w*y,I=9*b;S.fillRect(B,I,13,10)}S.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const j=x[5*b+w],T=w*y,B=9*b,I=j.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(C,!1),bt(S,T,B,T,B+9));const M=I.getTop();M.isNone()||(S.strokeStyle=M.getColor().toCSS(C,!1),bt(S,T,B,T+y,9*b));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(C,!1),bt(S,T+y,B,T+y,B+9));const P=I.getBottom();P.isNone()||(S.strokeStyle=P.getColor().toCSS(C,!1),bt(S,T,B+9,T+y,B+9))}S.strokeStyle=j.getFont().getFill().toCSS(C,!1);const F=4,N=2.5;bt(S,w*y+N,9*b+F,w*y+N+7,9*b+F)}return`url(${f.toDataURL()})`},[d,p,t,c]);return e.jsx("div",{ref:i,className:fe("table-style-preview",s),style:{backgroundImage:u,width:61,height:46,...g},...h})})),Wl=a.memo(a.forwardRef((l,i)=>{const{styleOptions:n,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:c,showTotalRow:m,onShowTotalRowChange:g,showFilterButton:s,onShowFilterButtonChange:d,sx:h,disabled:p,...x}=l;return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:u=>`${u.spacing(2)}`,marginRight:u=>`${u.spacing(2)}`},"& .MuiCheckbox-root":{padding:u=>`${u.spacing(.5)}`},...h},...x,ref:i,children:[c&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:p||r==null}),label:"Header Row",labelPlacement:"end"}),g&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>g(!m),disabled:p||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:s??!1,indeterminate:s==null,disabled:p||!n||s==null,onChange:()=>d(!s)}),label:"Filter Button",labelPlacement:"end"})]})})),Vl=a.memo(l=>{const{table:i,tableStyle:n,selectedTableStyleName:t,onSelectTableStyleName:r,styles:c,hasContextMenu:m=!0,bodyStyle:g,parentFloat:s,commands:d,disabled:h,commandHook:p,useCanvasPreview:x=!0,canvas:u,...f}=l,S=a.useCallback(w=>{const j={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"table"},T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...j,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:h}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:h||!n||n.isBuiltIn()})]}),B=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})});return o.defaultCreatePopupPanel({...w,children:B})},[d]),y=n?.getName()===t,C=a.useMemo(()=>{const w={table:i,tableStyle:n,styles:c,bodyStyle:g};return x?e.jsx(Jr,{canvas:u,...w}):e.jsx(Zr,{...w})},[i,n,c,g]);let b=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${y?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{r?.(n?.getName())},...f,children:C},n.getName());return m&&(b=e.jsx(o.ContextMenu,{label:i.getStyleOptions().name,parentFloat:s,createPopupPanel:S,children:b})),b}),Qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedTable:c,onSelectTableStyleName:m,disabled:g=!1,bodyStyle:s,usePreviewIcon:d=!1,...h}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.table?.();let f="insertTable";u&&(f="editTable");const S=a.useMemo(()=>((N,L)=>{const M={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new O.Table({initialAnchor:M,styles:L,json:{name:"PreviewTable",ref:M,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:N}})})(u?.getStyleOptions(),x?.()),[x?.().getDefaultTableStyle(),u?.getStyleOptions()]),y=u??S,[C,b]=a.useState(y);a.useEffect(()=>{b(y)},[y]);const w=s??p?.bodyStyle(),j=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),T=a.useRef(null),B=a.useCallback((N,L)=>{const M={onSelectTableStyleName:j,styles:x(),parentFloat:N.floatReference};T.current||(T.current=document.createElement("canvas"));const v=_=>{const U=x().getTableStyle(_);return U?e.jsx(Vl,{table:C,tableStyle:U,selectedTableStyleName:C.getStyleOptions().name,bodyStyle:p.bodyStyle(),commands:L,commandHook:r,canvas:T.current,...M},_):null},P=(_,U,Q=!0)=>{const ee=[];for(let K=0;K<U.length;K++){const W=v(U[K]);W&&ee.push(W)}return ee.length===0?null:e.jsxs(E.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:_},_+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},_+"-presets")]},_)},H=[],A=x().getCustomTableStyles(),$=[];if(A.length>0){for(let _=0;_<A.length;_++)A[_].isShownInTableStyles()&&$.push(A[_].getName());H.push(P("Custom",$,!1))}const D=[];u&&!u.getStyleOptions().name&&D.push(null);for(let _=0;_<21;_++)D.push("TableStyleLight"+(_+1));H.push(P("Light",D,$.length>0));const R=[];for(let _=0;_<28;_++)R.push("TableStyleMedium"+(_+1));H.push(P("Medium",R));const q=[];for(let _=0;_<11;_++)q.push("TableStyleDark"+(_+1));H.push(P("Dark",q));let Y=null;return u&&(Y=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,command:L.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))})]})),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:_=>`${_.shape.borderRadius}px`,paddingBottom:_=>`${_.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),Y]})},[x,x?.().getTheme(),w,C]),I=g||!t||t.disabled(),F=a.useMemo(()=>{if(!p||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[C,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:f,createPopupPanel:B,commands:n,label:t?.label(),commandState:u,commandHook:r,selected:u!==null,createTooltip:({children:N},L)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:L,children:N}),disabled:I,icon:F,...h})})),Ie=[];Ie.push(De("Primary Background","bg1")),Ie.push(De("Primary Text","tx1")),Ie.push(De("Secondary Background","bg2")),Ie.push(De("Secondary Text","tx2")),Ie.push(De("Accent 1","accent1")),Ie.push(De("Accent 2","accent2")),Ie.push(De("Accent 3","accent3")),Ie.push(De("Accent 4","accent4")),Ie.push(De("Accent 5","accent5")),Ie.push(De("Accent 6","accent6"));const ea=l=>{const{docTheme:i,onSelectTheme:n,darkMode:t,isSelected:r,outlined:c,sx:m,...g}=l,s=G.useTheme(),d=a.useMemo(()=>{let h=[];for(let p=0;p<Ie.length;p++){const x=Ie[p];h.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:x,darkMode:t,selectedColor:null},p+"-colorDef"))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(E.Box,{sx:{display:"flex",boxShadow:p=>p.shadows[2]},children:h})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:h=>`solid ${r?h.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:h=>`solid ${h.palette.text.primary} 1px !important`}},icon:null,...g,children:e.jsxs(E.Box,{sx:{border:h=>`solid ${h.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:h=>r?h.palette.text.primary:void 0,"&:hover:not([disabled])":{color:h=>h.palette.text.primary}},children:[e.jsx(E.Box,{sx:{},children:i.getName()}),e.jsxs(E.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,e.jsx(E.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(o.SimpleTooltip,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
7
7
  The heading font is '${i.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:e.jsx("div",{children:i.getFontScheme().getMinorFont()})})})]})]})})},ta=a.memo(a.forwardRef((l,i)=>{const{themes:n,selectedTheme:t,onSelectTheme:r,sx:c,disabled:m=!1,darkMode:g,...s}=l,d=a.useMemo(()=>{const h=n?.getItems({selected:t})??[],p=[];if(h.length===0)return e.jsx(o.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});const x=h.length;for(let u=0;u<x;u++){const f=h[u],S=t&&f?.getName()===t.getName(),y=h[u+1];y&&y.isCustom()!==f.isCustom()&&p.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${u}`)),p.push(e.jsx(ea,{docTheme:f,onSelectTheme:()=>r(f),isSelected:S,disabled:m,darkMode:g,onMouseDown:C=>{C.button===0&&C.preventDefault()},onMouseUp:C=>{C.button===0&&r(f)},onKeyDown:C=>{C.keyCode!==k.KeyCodes.Enter&&C.keyCode!==k.KeyCodes.Space||r(f)}},f.getName()))}return p},[t,r,g]);return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:i,...s,children:e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(o.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),e.jsx(o.ExhibitDivider,{}),e.jsx(E.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:d})]})})})),oa=a.memo(a.forwardRef((l,i)=>{const{themes:n,selectedTheme:t,onSelectTheme:r,icon:c,tooltip:m,label:g,variant:s=o.PopupButtonType.Toolbar,darkMode:d,panelProps:h,...p}=l,x=c||o.themeIcon(e.jsx(o.Theme2Icon,{})),u=a.useCallback(S=>{const{closeFloatAll:y}=S;return e.jsx(ta,{...h,themes:n,selectedTheme:t,onSelectTheme:r,darkMode:d,onKeyDown:C=>{C.which===k.KeyCodes.Enter&&y()}})},[n,t,r,h,d]),f={createPopupPanel:u,tooltip:m||g||"Theme",label:g,icon:x,...p};return s===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...f}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...f})})),na=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,selectedTheme:r,onSelectTheme:c,disabled:m=!1,darkMode:g,label:s,icon:d,variant:h,...p}=l;k.useCommand(n);const x=n?.context()?.themes,u=r||n?.context()?.theme,f=g??n?.context()?.darkMode,S=m||n?.disabled(),y=k.useCallbackRef(b=>{c?.(b),n?.execute(b,t)},[c,t]),C=a.useCallback((b,w)=>{const{children:j,title:T,...B}=b;let I=b.children;return(S||w)&&(I=e.jsx("div",{children:I})),e.jsx(o.CommandTooltip,{command:n,placement:h===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:S||w,...B,children:I})},[n,S]);return e.jsx(oa,{ref:i,themes:x,selectedTheme:u,onSelectTheme:y,variant:h===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:C,disabled:S,darkMode:f,icon:o.themeIcon(e.jsx(o.Theme2Icon,{})),...p})})),ra=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,g=k.useCommands(n,["themeMode"])[0],s=g?.state(),d=g?.state()!==null,h=E.useMediaQuery("(prefers-color-scheme: dark)"),p=s==="dark"||s===null&&h,x=k.useCallbackRef((u,f)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"appearance",disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:g,icon:o.themeIcon(p?e.jsx(me.DarkMode,{}):e.jsx(me.LightMode,{}))}),e.jsx(o.CommandButton,{...S,command:f.getCommand("defaultThemeMode"),icon:o.themeIcon(h?e.jsx(o.SystemDefaultDarkMode,{}):e.jsx(o.SystemDefaultLightMode,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:f.getCommand("enableDarkGrid")}),e.jsx(o.CommandButton,{...S,command:f.getCommand("enableDarkImages")})]});return o.defaultCreatePopupPanel({...u,children:y})},[c,g,t,r,h,s,d]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:"themeMode",commands:n,commandHook:t,createPopupPanel:x,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{g?.execute(p?"light":"dark",t)},selected:d,icon:o.themeIcon(p?e.jsx(me.DarkMode,{}):e.jsx(me.LightMode,{})),...m})})),aa=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,sx:m,...g}=l,s=a.useCallback((d,h)=>{const p={variant:k.CommandButtonType.Menuitem,scope:"help",commandHook:{...t,beforeExecute:(u,f)=>t?.beforeExecute?.(u,f)!==!1&&d.floatReference.closeAll()},disabled:c},x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:h.getCommand("showKeyboardShortcuts"),icon:o.themeIcon(e.jsx(me.Keyboard,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:h.getCommand("gotoUrlGithub"),icon:o.themeIcon(e.jsx(o.GithubIcon,{}))}),e.jsx(o.CommandButton,{...p,command:h.getCommand("gotoUrlDiscord"),icon:o.themeIcon(e.jsx(o.DiscordIcon,{}))}),e.jsx(o.CommandButton,{...p,command:h.getCommand("gotoUrlDocumentation"),icon:o.themeIcon(e.jsx(o.DocumentationIcon,{}))}),e.jsx(o.CommandButton,{...p,command:h.getCommand("gotoUrlIssue"),icon:o.themeIcon(e.jsx(o.TicketIcon,{}))})]});return o.defaultCreatePopupPanel({...d,children:x})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,sx:m,commands:n,disabled:c,commandHook:t,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:s,icon:o.themeIcon(e.jsx(o.HelpIcon,{sx:{transform:"scale(0.75)"}})),...g})})),qo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,preferSingleMenu:m=!0,showQuickButton:g=!0,variant:s=k.CommandButtonType.Toolbar,...d}=l,h=k.useCommands(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:p,allDisabled:x}=a.useMemo(()=>{let f=null,S=0;for(let y=0;y<h.length;y++)h[y]&&!h[y]?.disabled()&&(m&&s===k.CommandButtonType.Menuitem&&(f=S===0?h[y]:null),S++);return{singleMenuCommand:f,allDisabled:S===0}},[h]),u=a.useCallback((f,S)=>{const y={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertImage",disabled:c},C=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...y,command:S.getCommand("insertImageFromFile"),icon:o.themeIcon(e.jsx(o.InsertImageIcon,{}))}),e.jsx(o.CommandButton,{...y,command:S.getCommand("insertImageFromURL"),icon:o.themeIcon(e.jsx(o.InsertImageIcon,{}))})]});return o.defaultCreatePopupPanel({...f,children:C})},[c,t,r]);return p?e.jsx(o.CommandButton,{ref:i,variant:s,commandHook:t,disabled:c,command:p,icon:o.themeIcon(e.jsx(o.InsertImageIcon,{})),...d}):e.jsx(o.CommandPopupButton,{ref:i,variant:s,quickCommand:"insertImageFromFile",commands:n,commandHook:t,scope:r,disabled:c||x,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:u,icon:o.themeIcon(e.jsx(o.InsertImageIcon,{})),...d})})),lo=a.memo(a.forwardRef((l,i)=>{const{command:n,...t}=l,r=k.useEditMode(),[c,m]=a.useState(!1),[g,s]=a.useState("info");return a.useEffect(()=>{const d=r.getMode();m(d?.key==="copy"||d?.key==="cut"),s(d?.key==="cut"?"warning":"info")},[r]),e.jsx(o.CommandButton,{ref:i,command:n,icon:o.themeIcon(e.jsx(o.WalkingCopyIcon,{isWalking:c,themedType:g})),...t})})),la=a.memo(a.forwardRef((l,i)=>{const{...n}=l;return e.jsx(o.SimpleCommandPopupButton,{ref:i,...n,popupCommandKeys:["insertFunctionSum","insertFunctionAverage","insertFunctionCount","insertFunctionMax","insertFunctionMin",null,"insertFunction"],quickCommand:"insertFunctionSum",popupScope:"insertFunction",label:"Quick Function",tooltip:"More functions.",icon:t=>{switch(t?.key()){case"insertFunctionSum":return o.themeIcon(e.jsx(o.FunctionSumIcon,{}));case"insertFunction":return o.themeIcon(e.jsx(o.FunctionThinIcon,{}));default:return null}}})}));la.displayName="InsertFunctionSumCommandPopupButton";const $l=[{key:"financial",label:"Financial",icon:e.jsx(o.FormulaFinancialIcon,{})},{key:"logical",label:"Logical",icon:e.jsx(o.FormulaLogicalIcon,{})},{key:"text",label:"Text",icon:e.jsx(o.FormulaTextIcon,{})},{key:"dateTime",label:"Date & Time",icon:e.jsx(o.FormulaDateTimeIcon,{})},{key:"lookupReference",label:"Lookup & Reference",icon:e.jsx(o.FormulaLookupReferenceIcon,{})},{key:"mathTrig",label:"Math & Trig",icon:e.jsx(o.FormulaMathTrigIcon,{})},{key:"statDist",label:"Statistical",icon:e.jsx(o.FormulaStatisticalIcon,{})},{key:"engineering",label:"Engineering",icon:e.jsx(o.FormulaEngineeringIcon,{})},{key:"information",label:"Information",icon:e.jsx(o.FormulaInformationIcon,{})},{key:"cube",label:"Cube",icon:e.jsx(o.FormulaCubeIcon,{})},{key:"database",label:"Database",icon:e.jsx(o.FormulaDatabaseIcon,{})},{key:"web",label:"Web",icon:e.jsx(o.FormulaWebIcon,{})},{key:"custom",label:"Custom",icon:e.jsx(o.FormulaCustomIcon,{})}],yo=new Map($l.map(l=>[l.key,l])),Ul=a.memo(l=>{const{command:i,formulaFunction:n,commandHook:t,disabled:r=!1,parentFloat:c,handleInsert:m,icon:g,label:s,sx:d,...h}=l,p=new Promise(x=>{n.getDescriptor().then(u=>{x(u.getSummary())})});return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...d},disabled:r,tooltipProps:{label:p,maxWidth:1e3},onMouseDown:x=>{x.button===0&&x.preventDefault()},onMouseUp:x=>{x.button===0&&m(n)},onKeyDown:x=>{x.keyCode===k.KeyCodes.Enter||(x.keyCode,k.KeyCodes.Space)},...h,children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",children:n.getName()})})})}),ia=a.memo(a.forwardRef((l,i)=>{const{category:n,commands:t,commandHook:r,scope:c,sx:m,disabled:g=!1,parentFloat:s,...d}=l,h=k.useCommands(t,["insertFunction"])[0],p=a.useCallback((u,f)=>{const S=yo.get(n);if(!S)return console.warn("invalidate category",n),null;const y={commandHook:r,...u},C=e.jsx(_l,{category:S.label,...y,commands:f});return o.defaultCreatePopupPanel({...u,children:C})},[n,h,r,c]),x=yo.get(n);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,createPopupPanel:p,label:x.label,tooltip:"Insert Function",icon:o.themeIcon(yo.get(n)?.icon??e.jsx(o.FormulaGroupIcon,{})),...d})}));ia.displayName="InsertFunctionCommandPopupButton";const _l=a.memo(a.forwardRef((l,i)=>{const{commands:n,category:t,commandHook:r,...c}=l,m=k.useCommands(n,["insertFunction"]),[g,s]=a.useState([]),[d,h]=a.useState(!1);a.useEffect(()=>{(async()=>{h(!0);const y=m[0]?.context(),C=await y.searchByCategory(t);s(C),h(!1)})()},[]);const p=g.length,x=new Array(p),u=n.getCommand("insertFunction"),f=y=>{r?.beforeExecute?.(u,u?.state()),u.execute(y),r?.onExecute?.(u,u?.state())};for(let y=0;y<p;y++){const C=g[y];x[y]=e.jsx(Ul,{command:u,formulaFunction:C,handleInsert:f},`formula-${C.getName()}-${y}`)}const S=e.jsx(E.Box,{ref:i,sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:p>0?e.jsx(e.Fragment,{children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})}):null});return o.defaultCreatePopupPanel({...c,children:S})})),sa=a.createContext(null);sa.displayName="HookFormContext";const ca=()=>a.useContext(sa);typeof window<"u"?a.useLayoutEffect:a.useEffect;const da=a.memo(a.forwardRef((l,i)=>{const{disabled:n,style:t,className:r,sx:c,defaultInput:m,value:g,formName:s,formOptions:d,onChangeInput:h,onValidate:p,onKeyDown:x,...u}=l,f=ca(),S=s&&f?f.register(s,d):null,[y,C]=a.useState(""),[b,w]=a.useState(""),[j,T]=a.useState(g);a.useEffect(()=>{T(g),w("")},[g]);const B=k.useCallbackRef(M=>{let v="";try{T(M),p?.(M),h?.(M)}catch(P){v=P.message??"Invalid Name"}s&&f&&(v?f.setError(s,{message:v}):f.clearErrors(s)),w(v)},[g,p,h]),I=k.useCallbackRef(async M=>{M.keyCode===k.KeyCodes.Escape&&y!==g&&(B(y),f?.setValue(s,y),f?.clearErrors(s),M.stopPropagation()),x?.(M)},[x,y,g,f]),F=k.useCallbackRef(M=>{C(M.target.value??"")},[]),N=k.useCallbackRef(M=>{C(""),S?.onBlur(M)},[]),L=a.useCallback(M=>{B(M.target.value),S?.onChange(M)},[S]);return e.jsx(E.FormControl,{sx:{paddingTop:M=>M.spacing(1.5),minWidth:135,width:"100%",...c},size:"small",ref:i,className:fe("named-input",r),...u,children:e.jsx(E.TextField,{label:"Name",placeholder:m,onFocus:F,onBlur:N,inputRef:S?.ref,disabled:n,error:!!b,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:M=>M.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:s,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:M=>M.spacing(1.25),paddingBottom:M=>M.spacing(.75),backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`}}},value:j??"",onChange:L,onKeyDownCapture:I,onContextMenu:M=>{M.stopPropagation()}})})}));da.displayName="NamedInput";const zt=l=>l===null?"":l.toString(),ma=a.memo(a.forwardRef((l,i)=>{const{formName:n,formOptions:t,disabled:r,style:c,className:m,sx:g,onKeyDown:s,value:d,onChangeInput:h,resolvedAddress:p,...x}=l,u=ca(),f=n&&u?u.register(n,t):null,[S,y]=a.useState(""),[C,b]=a.useState(!1),[w,j]=a.useState(()=>zt(d));a.useEffect(()=>{j(zt(d)),y(""),n&&u&&u.clearErrors(n),b(!1)},[d]);const T=k.useCallbackRef(v=>{let P="";try{j(v);const H=zt(d),A=p(v);A.toString()!==H&&h?.(A)}catch{P="Invalid Range"}n&&u&&(P?u.setError(n,{message:P}):u.clearErrors(n)),y(P),b(!0)},[w,h,n,u]),B=k.useCallbackRef(async v=>{if(C&&v.keyCode===k.KeyCodes.Escape){const P=zt(d);j(P),y(""),b(!1),v.stopPropagation()}s?.(v)},[d,h,s,C]),I=k.useCallbackRef(v=>{f?.onBlur(v)},[f]),F=a.useCallback(v=>{T(v.target.value),f?.onChange(v)},[f]),[N,L]=a.useState(!1),M=a.useMemo(()=>e.jsx(E.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:e.jsx(o.ExhibitOptionButton,{disabled:!0,selected:N,onSelectToggle:v=>{L(v)},label:"Select Range",icon:o.themeIcon(e.jsx(o.SelectRangeModeIcon,{}))})}),[N]);return e.jsx(E.FormControl,{sx:{paddingTop:v=>v.spacing(1.5),minWidth:135,width:"100%",...g},size:"small",ref:i,className:fe("range-input",m),...x,children:e.jsx(E.TextField,{label:"Range",placeholder:"Enter Range",onBlur:I,disabled:r,error:!!S,inputRef:f?.ref,helperText:S||" ",sx:{"& .MuiFormHelperText-root":{marginTop:v=>v.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",readOnly:r,name:n,sx:{paddingTop:v=>v.spacing(1.25),paddingBottom:v=>v.spacing(.75)}},sx:{backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},endAdornment:M},value:w??"",onChange:F,onKeyDownCapture:B,onContextMenu:v=>{v.stopPropagation()}})})}));ma.displayName="RangeInput";const Go=a.memo(a.forwardRef((l,i)=>{const{sheet:n,className:t,debounceDelay:r=220,sx:c,...m}=l,[g,s]=a.useState(()=>n.getView().getZoomScale()),[d,h]=a.useState(null),p=a.useRef(0);le.useModelListener(n,{onViewChange:()=>{h(!0),p.current===0&&s(n.getView().getZoomScale())}}),a.useEffect(()=>{p.current=0,h(!1),s(n.getView().getZoomScale())},[n]),a.useEffect(()=>{p.current!==0&&O.CommonUtils.debounce(()=>{g===p.current&&(p.current=0,n.getView().update({zoomScale:g}))},r)()},[g,r]);const x=k.useCallbackRef(I=>{let F=I;I<100?F=Math.round(I/(10/9)+10):I>100&&(F=Math.round(3*I-200)),p.current=F,h(!0),s(F)},[n]),u=I=>{let F=I;return I<100?F=10/9*(I-10):I>100&&(F=(I+200)/3),F},f=u(g),[S,y]=a.useState(null),C=a.useRef(null),b=a.useCallback(()=>{const I=S;I&&requestAnimationFrame(()=>{C.current?.contains(document.activeElement)&&I.focus()})},[]),w=k.useMouseDownAndHoldListener(()=>{x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10)))}),j=k.useMouseDownAndHoldListener(()=>x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),T=G.useTheme(),B=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("100%",Math.round(T.typography.fontSize),T.typography.fontFamily).width}px`,[T]);return e.jsxs(E.Box,{ref:i,className:fe(t),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:I=>I.palette.text.secondary,...c},onFocus:I=>{I.relatedTarget&&!S&&y(I.relatedTarget)},onBlur:I=>{S&&!C?.current?.contains(I.relatedTarget)&&y(null)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&b()},...m,children:[e.jsx(o.SimpleTooltip,{disableInteractive:!0,title:"Zoom Out",children:e.jsx(E.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:I=>I.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:I=>{I.button!==0?I.preventDefault():w(I)},children:e.jsx(me.Remove,{})})}),e.jsx(E.Slider,{ref:C,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:I=>`0px 0px 0px 3px ${o.hexToRGB(I.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:I=>`0px 0px 0px 2px ${o.hexToRGB(I.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:d?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:f,max:200,marks:[{value:100}],onAnimationEnd:()=>h(!1),onWheel:I=>{x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),I.deltaY<0,10)))},onKeyDown:I=>{I.which===k.KeyCodes.Down||I.which===k.KeyCodes.Right?(x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),I.preventDefault()):I.which===k.KeyCodes.Up||I.which===k.KeyCodes.Left?(x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),I.preventDefault()):I.which!==k.KeyCodes.Enter&&I.which!==k.KeyCodes.Escape||b()},onChange:(I,F)=>{Math.abs(F-100)<3?x(100):x(F)},valueLabelFormat:(I,F)=>`Zoom: ${Math.round(g)}%`}),e.jsx(o.SimpleTooltip,{disableInteractive:!0,title:"Zoom In",children:e.jsx(E.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:I=>I.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:I=>{I.button!==0?I.preventDefault():j(I)},children:e.jsx(me.Add,{})})}),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row"},children:[e.jsx(E.Box,{sx:{minWidth:"8px"}}),e.jsx(E.Typography,{noWrap:!0,component:"div",onClick:()=>{x(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:B},children:e.jsx("div",{children:Math.round(g)+"%"})})]})]})}));Go.displayName="SheetZoomScale";const Xo=a.memo(a.forwardRef((l,i)=>{const{sx:n,sheet:t,gridStyle:r,children:c,childrenEnd:m,...g}=l;a.useImperativeHandle(i,()=>({}));const s=a.useRef(null);a.useEffect(()=>{const u=f=>f.preventDefault();return s.current?.addEventListener("wheel",u,{passive:!1}),()=>{s.current?.removeEventListener("wheel",u)}},[]);const d=k.useEditMode(),h=a.useMemo(()=>{const u=d.getMode();return u?.description?u.description:"Ready"},[d]),[p,x]=a.useState(!1);return e.jsxs(E.Box,{ref:s,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:p?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...n},onMouseOver:()=>x(!0),onMouseLeave:()=>x(!1),...g,children:[c,e.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:u=>u.palette.text.secondary},variant:"caption",children:h})}),m?e.jsx(E.Box,{sx:{display:"flex",alignItems:"center"},children:m}):null,e.jsx(o.ExhibitDivider,{style:{marginTop:"6px",marginBottom:"6px"}}),e.jsx(Go,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:t})]})}));Xo.displayName="StatusBar";var st=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fn,Nn,Co,An,On,Wt={exports:{}},yt={},Ct={exports:{}},Ln={},Hn={exports:{}};function Kl(){return Nn?Fn:(Nn=1,Fn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function ql(){if(An)return Co;An=1;var l=Kl();function i(){}function n(){}return n.resetWarningCache=i,Co=function(){function t(m,g,s,d,h,p){if(p!==l){var x=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 x.name="Invariant Violation",x}}function r(){return t}t.isRequired=t;var c={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:r,element:t,elementType:t,instanceOf:r,node:t,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:i};return c.PropTypes=c,c},Co}function Pt(){return On||(On=1,Hn.exports=ql()()),Hn.exports}var zn,Vt={exports:{}},Wn,Ce={},ze={};function io(){return Wn||(Wn=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.dontSetMe=function(l,i,n){if(l[i])return new Error(`Invalid prop ${i} passed to ${n} - do not set this, set it on the child.`)},ze.findInArray=function(l,i){for(let n=0,t=l.length;n<t;n++)if(i.apply(i,[l[n],n,l]))return l[n]},ze.int=function(l){return parseInt(l,10)},ze.isFunction=function(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Function]"},ze.isNum=function(l){return typeof l=="number"&&!isNaN(l)}),ze}var Vn,$n,We={};function Yo(){if($n)return Ce;$n=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.addClassName=m,Ce.addEvent=function(s,d,h,p){if(!s)return;const x={capture:!0,...p};s.addEventListener?s.addEventListener(d,h,x):s.attachEvent?s.attachEvent("on"+d,h):s["on"+d]=h},Ce.addUserSelectStyles=function(s){if(!s)return;let d=s.getElementById("react-draggable-style-el");d||(d=s.createElement("style"),d.type="text/css",d.id="react-draggable-style-el",d.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
8
  `,d.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
9
  `,s.getElementsByTagName("head")[0].appendChild(d)),s.body&&m(s.body,"react-draggable-transparent-selection")},Ce.createCSSTransform=function(s,d){const h=r(s,d,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:h}},Ce.createSVGTransform=function(s,d){return r(s,d,"")},Ce.getTouch=function(s,d){return s.targetTouches&&(0,l.findInArray)(s.targetTouches,h=>d===h.identifier)||s.changedTouches&&(0,l.findInArray)(s.changedTouches,h=>d===h.identifier)},Ce.getTouchIdentifier=function(s){if(s.targetTouches&&s.targetTouches[0])return s.targetTouches[0].identifier;if(s.changedTouches&&s.changedTouches[0])return s.changedTouches[0].identifier},Ce.getTranslation=r,Ce.innerHeight=function(s){let d=s.clientHeight;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(h.paddingTop),d-=(0,l.int)(h.paddingBottom),d},Ce.innerWidth=function(s){let d=s.clientWidth;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(h.paddingLeft),d-=(0,l.int)(h.paddingRight),d},Ce.matchesSelector=t,Ce.matchesSelectorAndParentsTo=function(s,d,h){let p=s;do{if(t(p,d))return!0;if(p===h)return!1;p=p.parentNode}while(p);return!1},Ce.offsetXYFromParent=function(s,d,h){const p=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect(),x=(s.clientX+d.scrollLeft-p.left)/h,u=(s.clientY+d.scrollTop-p.top)/h;return{x,y:u}},Ce.outerHeight=function(s){let d=s.clientHeight;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(h.borderTopWidth),d+=(0,l.int)(h.borderBottomWidth),d},Ce.outerWidth=function(s){let d=s.clientWidth;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(h.borderLeftWidth),d+=(0,l.int)(h.borderRightWidth),d},Ce.removeClassName=g,Ce.removeEvent=function(s,d,h,p){if(!s)return;const x={capture:!0,...p};s.removeEventListener?s.removeEventListener(d,h,x):s.detachEvent?s.detachEvent("on"+d,h):s["on"+d]=null},Ce.scheduleRemoveUserSelectStyles=function(s){window.requestAnimationFrame?window.requestAnimationFrame(()=>{c(s)}):c(s)};var l=io(),i=(function(s,d){if(typeof WeakMap=="function")var h=new WeakMap,p=new WeakMap;return(function(x,u){if(!u&&x&&x.__esModule)return x;var f,S,y={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return y;if(f=u?p:h){if(f.has(x))return f.get(x);f.set(x,y)}for(const C in x)C!=="default"&&{}.hasOwnProperty.call(x,C)&&((S=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,C))&&(S.get||S.set)?f(y,C,S):y[C]=x[C]);return y})(s,d)})((function(){if(Vn)return We;Vn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.browserPrefixToKey=h,We.browserPrefixToStyle=function(p,x){return x?`-${x.toLowerCase()}-${p}`:p},We.default=void 0,We.getPrefix=d;const s=["Moz","Webkit","O","ms"];function d(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const x=window.document?.documentElement?.style;if(!x||p in x)return"";for(let u=0;u<s.length;u++)if(h(p,s[u])in x)return s[u];return""}function h(p,x){return x?`${x}${(function(u){let f="",S=!0;for(let y=0;y<u.length;y++)S?(f+=u[y].toUpperCase(),S=!1):u[y]==="-"?S=!0:f+=u[y];return f})(p)}`:p}return We.default=d(),We})());let n="";function t(s,d){return n||(n=(0,l.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(h){return(0,l.isFunction)(s[h])})),!!(0,l.isFunction)(s[n])&&s[n](d)}function r(s,d,h){let{x:p,y:x}=s,u=`translate(${p}${h},${x}${h})`;return d&&(u=`translate(${`${typeof d.x=="string"?d.x:d.x+h}`}, ${`${typeof d.y=="string"?d.y:d.y+h}`})`+u),u}function c(s){if(s)try{if(s.body&&g(s.body,"react-draggable-transparent-selection"),s.selection)s.selection.empty();else{const d=(s.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function m(s,d){s.classList?s.classList.add(d):s.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(s.className+=` ${d}`)}function g(s,d){s.classList?s.classList.remove(d):s.className=s.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return Ce}var Un,Ne={};function ua(){if(Un)return Ne;Un=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=function(t){return t.props.axis==="both"||t.props.axis==="x"},Ne.canDragY=function(t){return t.props.axis==="both"||t.props.axis==="y"},Ne.createCoreData=function(t,r,c){const m=!(0,l.isNum)(t.lastX),g=n(t);return m?{node:g,deltaX:0,deltaY:0,lastX:r,lastY:c,x:r,y:c}:{node:g,deltaX:r-t.lastX,deltaY:c-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:c}},Ne.createDraggableData=function(t,r){const c=t.props.scale;return{node:r.node,x:t.state.x+r.deltaX/c,y:t.state.y+r.deltaY/c,deltaX:r.deltaX/c,deltaY:r.deltaY/c,lastX:t.state.x,lastY:t.state.y}},Ne.getBoundPosition=function(t,r,c){if(!t.props.bounds)return[r,c];let{bounds:m}=t.props;m=typeof m=="string"?m:(function(s){return{left:s.left,top:s.top,right:s.right,bottom:s.bottom}})(m);const g=n(t);if(typeof m=="string"){const{ownerDocument:s}=g,d=s.defaultView;let h;if(m==="parent"?h=g.parentNode:h=g.getRootNode().querySelector(m),!(h instanceof d.HTMLElement))throw new Error('Bounds selector "'+m+'" could not find an element.');const p=h,x=d.getComputedStyle(g),u=d.getComputedStyle(p);m={left:-g.offsetLeft+(0,l.int)(u.paddingLeft)+(0,l.int)(x.marginLeft),top:-g.offsetTop+(0,l.int)(u.paddingTop)+(0,l.int)(x.marginTop),right:(0,i.innerWidth)(p)-(0,i.outerWidth)(g)-g.offsetLeft+(0,l.int)(u.paddingRight)-(0,l.int)(x.marginRight),bottom:(0,i.innerHeight)(p)-(0,i.outerHeight)(g)-g.offsetTop+(0,l.int)(u.paddingBottom)-(0,l.int)(x.marginBottom)}}return(0,l.isNum)(m.right)&&(r=Math.min(r,m.right)),(0,l.isNum)(m.bottom)&&(c=Math.min(c,m.bottom)),(0,l.isNum)(m.left)&&(r=Math.max(r,m.left)),(0,l.isNum)(m.top)&&(c=Math.max(c,m.top)),[r,c]},Ne.getControlPosition=function(t,r,c){const m=typeof r=="number"?(0,i.getTouch)(t,r):null;if(typeof r=="number"&&!m)return null;const g=n(c),s=c.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,i.offsetXYFromParent)(m||t,s,c.props.scale)},Ne.snapToGrid=function(t,r,c){const m=Math.round(r/t[0])*t[0],g=Math.round(c/t[1])*t[1];return[m,g]};var l=io(),i=Yo();function n(t){const r=t.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Ne}var _n,Kn,qn,Gn,St={},$t={};function pa(){return _n||(_n=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.default=function(){}),$t}function Gl(){if(Kn)return St;Kn=1,Object.defineProperty(St,"__esModule",{value:!0}),St.default=void 0;var l=(function(u,f){if(typeof WeakMap=="function")var S=new WeakMap,y=new WeakMap;return(function(C,b){if(!b&&C&&C.__esModule)return C;var w,j,T={__proto__:null,default:C};if(C===null||typeof C!="object"&&typeof C!="function")return T;if(w=b?y:S){if(w.has(C))return w.get(C);w.set(C,T)}for(const B in C)B!=="default"&&{}.hasOwnProperty.call(C,B)&&((j=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(C,B))&&(j.get||j.set)?w(T,B,j):T[B]=C[B]);return T})(u,f)})(a),i=g(Pt()),n=g(Je),t=Yo(),r=ua(),c=io(),m=g(pa());function g(u){return u&&u.__esModule?u:{default:u}}function s(u,f,S){return(f=(function(y){var C=(function(b,w){if(typeof b!="object"||!b)return b;var j=b[Symbol.toPrimitive];if(j!==void 0){var T=j.call(b,w);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)})(y,"string");return typeof C=="symbol"?C:C+""})(f))in u?Object.defineProperty(u,f,{value:S,enumerable:!0,configurable:!0,writable:!0}):u[f]=S,u}const d={start:"touchstart",move:"touchmove",stop:"touchend"},h={start:"mousedown",move:"mousemove",stop:"mouseup"};let p=h,x=class extends l.Component{constructor(){super(...arguments),s(this,"dragging",!1),s(this,"lastX",NaN),s(this,"lastY",NaN),s(this,"touchIdentifier",null),s(this,"mounted",!1),s(this,"handleDragStart",u=>{if(this.props.onMouseDown(u),!this.props.allowAnyClick&&typeof u.button=="number"&&u.button!==0)return!1;const f=this.findDOMNode();if(!f||!f.ownerDocument||!f.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:S}=f;if(this.props.disabled||!(u.target instanceof S.defaultView.Node)||this.props.handle&&!(0,t.matchesSelectorAndParentsTo)(u.target,this.props.handle,f)||this.props.cancel&&(0,t.matchesSelectorAndParentsTo)(u.target,this.props.cancel,f))return;u.type!=="touchstart"||this.props.allowMobileScroll||u.preventDefault();const y=(0,t.getTouchIdentifier)(u);this.touchIdentifier=y;const C=(0,r.getControlPosition)(u,y,this);if(C==null)return;const{x:b,y:w}=C,j=(0,r.createCoreData)(this,b,w);(0,m.default)("DraggableCore: handleDragStart: %j",j),(0,m.default)("calling",this.props.onStart),this.props.onStart(u,j)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,t.addUserSelectStyles)(S),this.dragging=!0,this.lastX=b,this.lastY=w,(0,t.addEvent)(S,p.move,this.handleDrag),(0,t.addEvent)(S,p.stop,this.handleDragStop))}),s(this,"handleDrag",u=>{const f=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(f==null)return;let{x:S,y}=f;if(Array.isArray(this.props.grid)){let b=S-this.lastX,w=y-this.lastY;if([b,w]=(0,r.snapToGrid)(this.props.grid,b,w),!b&&!w)return;S=this.lastX+b,y=this.lastY+w}const C=(0,r.createCoreData)(this,S,y);if((0,m.default)("DraggableCore: handleDrag: %j",C),this.props.onDrag(u,C)!==!1&&this.mounted!==!1)this.lastX=S,this.lastY=y;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const w=document.createEvent("MouseEvents");w.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(w)}}),s(this,"handleDragStop",u=>{if(!this.dragging)return;const f=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(f==null)return;let{x:S,y}=f;if(Array.isArray(this.props.grid)){let w=S-this.lastX||0,j=y-this.lastY||0;[w,j]=(0,r.snapToGrid)(this.props.grid,w,j),S=this.lastX+w,y=this.lastY+j}const C=(0,r.createCoreData)(this,S,y);if(this.props.onStop(u,C)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(b.ownerDocument),(0,m.default)("DraggableCore: handleDragStop: %j",C),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,m.default)("DraggableCore: Removing handlers"),(0,t.removeEvent)(b.ownerDocument,p.move,this.handleDrag),(0,t.removeEvent)(b.ownerDocument,p.stop,this.handleDragStop))}),s(this,"onMouseDown",u=>(p=h,this.handleDragStart(u))),s(this,"onMouseUp",u=>(p=h,this.handleDragStop(u))),s(this,"onTouchStart",u=>(p=d,this.handleDragStart(u))),s(this,"onTouchEnd",u=>(p=d,this.handleDragStop(u)))}componentDidMount(){this.mounted=!0;const u=this.findDOMNode();u&&(0,t.addEvent)(u,d.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const u=this.findDOMNode();if(u){const{ownerDocument:f}=u;(0,t.removeEvent)(f,h.move,this.handleDrag),(0,t.removeEvent)(f,d.move,this.handleDrag),(0,t.removeEvent)(f,h.stop,this.handleDragStop),(0,t.removeEvent)(f,d.stop,this.handleDragStop),(0,t.removeEvent)(u,d.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(f)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return l.cloneElement(l.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return St.default=x,s(x,"displayName","DraggableCore"),s(x,"propTypes",{allowAnyClick:i.default.bool,allowMobileScroll:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(u,f){if(u[f]&&u[f].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),s(x,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),St}function Xl(){return qn||(qn=1,(function(l){Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),l.default=void 0;var i=(function(f,S){if(typeof WeakMap=="function")var y=new WeakMap,C=new WeakMap;return(function(b,w){if(!w&&b&&b.__esModule)return b;var j,T,B={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return B;if(j=w?C:y){if(j.has(b))return j.get(b);j.set(b,B)}for(const I in b)I!=="default"&&{}.hasOwnProperty.call(b,I)&&((T=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,I))&&(T.get||T.set)?j(B,I,T):B[I]=b[I]);return B})(f,S)})(a),n=h(Pt()),t=h(Je),r=(function(){if(zn)return Vt.exports;function f(y){var C,b,w="";if(typeof y=="string"||typeof y=="number")w+=y;else if(typeof y=="object")if(Array.isArray(y)){var j=y.length;for(C=0;C<j;C++)y[C]&&(b=f(y[C]))&&(w&&(w+=" "),w+=b)}else for(b in y)y[b]&&(w&&(w+=" "),w+=b);return w}function S(){for(var y,C,b=0,w="",j=arguments.length;b<j;b++)(y=arguments[b])&&(C=f(y))&&(w&&(w+=" "),w+=C);return w}return zn=1,Vt.exports=S,Vt.exports.clsx=S,Vt.exports})(),c=Yo(),m=ua(),g=io(),s=h(Gl()),d=h(pa());function h(f){return f&&f.__esModule?f:{default:f}}function p(){return p=Object.assign?Object.assign.bind():function(f){for(var S=1;S<arguments.length;S++){var y=arguments[S];for(var C in y)({}).hasOwnProperty.call(y,C)&&(f[C]=y[C])}return f},p.apply(null,arguments)}function x(f,S,y){return(S=(function(C){var b=(function(w,j){if(typeof w!="object"||!w)return w;var T=w[Symbol.toPrimitive];if(T!==void 0){var B=T.call(w,j);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(w)})(C,"string");return typeof b=="symbol"?b:b+""})(S))in f?Object.defineProperty(f,S,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[S]=y,f}class u extends i.Component{static getDerivedStateFromProps(S,y){let{position:C}=S,{prevPropsPosition:b}=y;return!C||b&&C.x===b.x&&C.y===b.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:b}),{x:C.x,y:C.y,prevPropsPosition:{...C}})}constructor(S){super(S),x(this,"onDragStart",(y,C)=>{if((0,d.default)("Draggable: onDragStart: %j",C),this.props.onStart(y,(0,m.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),x(this,"onDrag",(y,C)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",C);const b=(0,m.createDraggableData)(this,C),w={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:T}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[B,I]=(0,m.getBoundPosition)(this,w.x,w.y);w.x=B,w.y=I,w.slackX=this.state.slackX+(j-w.x),w.slackY=this.state.slackY+(T-w.y),b.x=w.x,b.y=w.y,b.deltaX=w.x-this.state.x,b.deltaY=w.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(w)}),x(this,"onDragStop",(y,C)=>{if(!this.state.dragging||this.props.onStop(y,(0,m.createDraggableData)(this,C))===!1)return!1;(0,d.default)("Draggable: onDragStop: %j",C);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:w,y:j}=this.props.position;b.x=w,b.y=j}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},!S.position||S.onDrag||S.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??t.default.findDOMNode(this)}render(){const{axis:S,bounds:y,children:C,defaultPosition:b,defaultClassName:w,defaultClassNameDragging:j,defaultClassNameDragged:T,position:B,positionOffset:I,scale:F,...N}=this.props;let L={},M=null;const v=!B||this.state.dragging,P=B||b,H={x:(0,m.canDragX)(this)&&v?this.state.x:P.x,y:(0,m.canDragY)(this)&&v?this.state.y:P.y};this.state.isElementSVG?M=(0,c.createSVGTransform)(H,I):L=(0,c.createCSSTransform)(H,I);const A=(0,r.clsx)(C.props.className||"",w,{[j]:this.state.dragging,[T]:this.state.dragged});return i.createElement(s.default,p({},N,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),i.cloneElement(i.Children.only(C),{className:A,style:{...C.props.style,...L},transform:M}))}}l.default=u,x(u,"displayName","Draggable"),x(u,"propTypes",{...s.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:g.dontSetMe,style:g.dontSetMe,transform:g.dontSetMe}),x(u,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Ln)),Ln}function ha(){if(Gn)return Ct.exports;Gn=1;const{default:l,DraggableCore:i}=Xl();return Ct.exports=l,Ct.exports.default=l,Ct.exports.DraggableCore=i,Ct.exports}var Xn,Ut={};function Yl(){if(Xn)return Ut;Xn=1,Ut.__esModule=!0,Ut.cloneElement=function(c,m){return m.style&&c.props.style&&(m.style=t(t({},c.props.style),m.style)),m.className&&c.props.className&&(m.className=c.props.className+" "+m.className),i.default.cloneElement(c,m)};var l,i=(l=a)&&l.__esModule?l:{default:l};function n(c,m){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(c);m&&(s=s.filter(function(d){return Object.getOwnPropertyDescriptor(c,d).enumerable})),g.push.apply(g,s)}return g}function t(c){for(var m=1;m<arguments.length;m++){var g=arguments[m]!=null?arguments[m]:{};m%2?n(Object(g),!0).forEach(function(s){r(c,s,g[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):n(Object(g)).forEach(function(s){Object.defineProperty(c,s,Object.getOwnPropertyDescriptor(g,s))})}return c}function r(c,m,g){return(m=(function(s){var d=(function(h,p){if(typeof h!="object"||h===null)return h;var x=h[Symbol.toPrimitive];if(x!==void 0){var u=x.call(h,p);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(h)})(s,"string");return typeof d=="symbol"?d:String(d)})(m))in c?Object.defineProperty(c,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):c[m]=g,c}return Ut}var Yn,Zn,wt={};function fa(){if(Yn)return wt;Yn=1,wt.__esModule=!0,wt.resizableProps=void 0;var l,i=(l=Pt())&&l.__esModule?l:{default:l};ha();var n={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var t=arguments.length,r=new Array(t),c=0;c<t;c++)r[c]=arguments[c];var m,g=r[0];return g.axis==="both"||g.axis==="y"?(m=i.default.number).isRequired.apply(m,r):i.default.number.apply(i.default,r)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var t=arguments.length,r=new Array(t),c=0;c<t;c++)r[c]=arguments[c];var m,g=r[0];return g.axis==="both"||g.axis==="x"?(m=i.default.number).isRequired.apply(m,r):i.default.number.apply(i.default,r)}};return wt.resizableProps=n,wt}function ga(){if(Zn)return yt;Zn=1,yt.__esModule=!0,yt.default=void 0;var l=(function(x,u){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var f=c(u);if(f&&f.has(x))return f.get(x);var S={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in x)if(C!=="default"&&Object.prototype.hasOwnProperty.call(x,C)){var b=y?Object.getOwnPropertyDescriptor(x,C):null;b&&(b.get||b.set)?Object.defineProperty(S,C,b):S[C]=x[C]}return S.default=x,f&&f.set(x,S),S})(a),i=ha(),n=Yl(),t=fa(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function c(x){if(typeof WeakMap!="function")return null;var u=new WeakMap,f=new WeakMap;return(c=function(S){return S?f:u})(x)}function m(){return m=Object.assign?Object.assign.bind():function(x){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var S in f)Object.prototype.hasOwnProperty.call(f,S)&&(x[S]=f[S])}return x},m.apply(this,arguments)}function g(x,u){var f=Object.keys(x);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(x);u&&(S=S.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),f.push.apply(f,S)}return f}function s(x){for(var u=1;u<arguments.length;u++){var f=arguments[u]!=null?arguments[u]:{};u%2?g(Object(f),!0).forEach(function(S){d(x,S,f[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(f)):g(Object(f)).forEach(function(S){Object.defineProperty(x,S,Object.getOwnPropertyDescriptor(f,S))})}return x}function d(x,u,f){return(u=(function(S){var y=(function(C,b){if(typeof C!="object"||C===null)return C;var w=C[Symbol.toPrimitive];if(w!==void 0){var j=w.call(C,b);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(C)})(S,"string");return typeof y=="symbol"?y:String(y)})(u))in x?Object.defineProperty(x,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):x[u]=f,x}function h(x,u){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,S){return f.__proto__=S,f},h(x,u)}var p=(function(x){var u,f;function S(){for(var C,b=arguments.length,w=new Array(b),j=0;j<b;j++)w[j]=arguments[j];return(C=x.call.apply(x,[this].concat(w))||this).handleRefs={},C.lastHandleRect=null,C.slack=null,C}f=x,(u=S).prototype=Object.create(f.prototype),u.prototype.constructor=u,h(u,f);var y=S.prototype;return y.componentWillUnmount=function(){this.resetData()},y.resetData=function(){this.lastHandleRect=this.slack=null},y.runConstraints=function(C,b){var w=this.props,j=w.minConstraints,T=w.maxConstraints,B=w.lockAspectRatio;if(!j&&!T&&!B)return[C,b];if(B){var I=this.props.width/this.props.height,F=C-this.props.width,N=b-this.props.height;Math.abs(F)>Math.abs(N*I)?b=C/I:C=b*I}var L=C,M=b,v=this.slack||[0,0],P=v[0],H=v[1];return C+=P,b+=H,j&&(C=Math.max(j[0],C),b=Math.max(j[1],b)),T&&(C=Math.min(T[0],C),b=Math.min(T[1],b)),this.slack=[P+(L-C),H+(M-b)],[C,b]},y.resizeHandler=function(C,b){var w=this;return function(j,T){var B=T.node,I=T.deltaX,F=T.deltaY;C==="onResizeStart"&&w.resetData();var N=(w.props.axis==="both"||w.props.axis==="x")&&b!=="n"&&b!=="s",L=(w.props.axis==="both"||w.props.axis==="y")&&b!=="e"&&b!=="w";if(N||L){var M=b[0],v=b[b.length-1],P=B.getBoundingClientRect();w.lastHandleRect!=null&&(v==="w"&&(I+=P.left-w.lastHandleRect.left),M==="n"&&(F+=P.top-w.lastHandleRect.top)),w.lastHandleRect=P,v==="w"&&(I=-I),M==="n"&&(F=-F);var H=w.props.width+(N?I/w.props.transformScale:0),A=w.props.height+(L?F/w.props.transformScale:0),$=w.runConstraints(H,A);H=$[0],A=$[1];var D=H!==w.props.width||A!==w.props.height,R=typeof w.props[C]=="function"?w.props[C]:null;R&&!(C==="onResize"&&!D)&&(j.persist==null||j.persist(),R(j,{node:B,size:{width:H,height:A},handle:b})),C==="onResizeStop"&&w.resetData()}}},y.renderResizeHandle=function(C,b){var w=this.props.handle;if(!w)return l.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+C,ref:b});if(typeof w=="function")return w(C,b);var j=s({ref:b},typeof w.type=="string"?{}:{handleAxis:C});return l.cloneElement(w,j)},y.render=function(){var C=this,b=this.props,w=b.children,j=b.className,T=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 B=b.resizeHandles;b.transformScale;var I=(function(F,N){if(F==null)return{};var L,M,v={},P=Object.keys(F);for(M=0;M<P.length;M++)L=P[M],N.indexOf(L)>=0||(v[L]=F[L]);return v})(b,r);return(0,n.cloneElement)(w,s(s({},I),{},{className:(j?j+" ":"")+"react-resizable",children:[].concat(w.props.children,B.map(function(F){var N,L=(N=C.handleRefs[F])!=null?N:C.handleRefs[F]=l.createRef();return l.createElement(i.DraggableCore,m({},T,{nodeRef:L,key:"resizableHandle-"+F,onStop:C.resizeHandler("onResizeStop",F),onStart:C.resizeHandler("onResizeStart",F),onDrag:C.resizeHandler("onResize",F)}),C.renderResizeHandle(F,L))}))}))},S})(l.Component);return yt.default=p,p.propTypes=t.resizableProps,p.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},yt}var Jn,Qn,kt={};function Zl(){if(Jn)return kt;Jn=1,kt.__esModule=!0,kt.default=void 0;var l=(function(u,f){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var S=m(f);if(S&&S.has(u))return S.get(u);var y={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in u)if(b!=="default"&&Object.prototype.hasOwnProperty.call(u,b)){var w=C?Object.getOwnPropertyDescriptor(u,b):null;w&&(w.get||w.set)?Object.defineProperty(y,b,w):y[b]=u[b]}return y.default=u,S&&S.set(u,y),y})(a),i=c(Pt()),n=c(ga()),t=fa(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function c(u){return u&&u.__esModule?u:{default:u}}function m(u){if(typeof WeakMap!="function")return null;var f=new WeakMap,S=new WeakMap;return(m=function(y){return y?S:f})(u)}function g(){return g=Object.assign?Object.assign.bind():function(u){for(var f=1;f<arguments.length;f++){var S=arguments[f];for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(u[y]=S[y])}return u},g.apply(this,arguments)}function s(u,f){var S=Object.keys(u);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(u);f&&(y=y.filter(function(C){return Object.getOwnPropertyDescriptor(u,C).enumerable})),S.push.apply(S,y)}return S}function d(u){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?s(Object(S),!0).forEach(function(y){h(u,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(S)):s(Object(S)).forEach(function(y){Object.defineProperty(u,y,Object.getOwnPropertyDescriptor(S,y))})}return u}function h(u,f,S){return(f=(function(y){var C=(function(b,w){if(typeof b!="object"||b===null)return b;var j=b[Symbol.toPrimitive];if(j!==void 0){var T=j.call(b,w);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)})(y,"string");return typeof C=="symbol"?C:String(C)})(f))in u?Object.defineProperty(u,f,{value:S,enumerable:!0,configurable:!0,writable:!0}):u[f]=S,u}function p(u,f){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,y){return S.__proto__=y,S},p(u,f)}var x=(function(u){var f,S;function y(){for(var C,b=arguments.length,w=new Array(b),j=0;j<b;j++)w[j]=arguments[j];return(C=u.call.apply(u,[this].concat(w))||this).state={width:C.props.width,height:C.props.height,propsWidth:C.props.width,propsHeight:C.props.height},C.onResize=function(T,B){var I=B.size;C.props.onResize?(T.persist==null||T.persist(),C.setState(I,function(){return C.props.onResize&&C.props.onResize(T,B)})):C.setState(I)},C}return S=u,(f=y).prototype=Object.create(S.prototype),f.prototype.constructor=f,p(f,S),y.getDerivedStateFromProps=function(C,b){return b.propsWidth!==C.width||b.propsHeight!==C.height?{width:C.width,height:C.height,propsWidth:C.width,propsHeight:C.height}:null},y.prototype.render=function(){var C=this.props,b=C.handle,w=C.handleSize;C.onResize;var j=C.onResizeStart,T=C.onResizeStop,B=C.draggableOpts,I=C.minConstraints,F=C.maxConstraints,N=C.lockAspectRatio,L=C.axis;C.width,C.height;var M=C.resizeHandles,v=C.style,P=C.transformScale,H=(function(A,$){if(A==null)return{};var D,R,q={},Y=Object.keys(A);for(R=0;R<Y.length;R++)D=Y[R],$.indexOf(D)>=0||(q[D]=A[D]);return q})(C,r);return l.createElement(n.default,{axis:L,draggableOpts:B,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:N,maxConstraints:F,minConstraints:I,onResizeStart:j,onResize:this.onResize,onResizeStop:T,resizeHandles:M,transformScale:P,width:this.state.width},l.createElement("div",g({},H,{style:d(d({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},y})(l.Component);return kt.default=x,x.propTypes=d(d({},t.resizableProps),{},{children:i.default.element}),kt}var Jl=(Qn||(Qn=1,Wt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Wt.exports.Resizable=ga().default,Wt.exports.ResizableBox=Zl().default),Wt.exports);function So(l,i){if(typeof l=="function")return l(i);l&&(l.current=i)}var Dt=parseInt(a.version.split(".")[0],10)>=19?function(l){return i=>{const n=[];for(const t of l){const r=So(t,i),c=typeof r=="function";n.push(c?r:()=>So(t,null))}return()=>{for(const t of n)t()}}}:function(l){return i=>{for(const n of l)So(n,i)}};const Zo=a.memo(a.forwardRef((l,i)=>{const{disabled:n,names:t,workbook:r,restoreFocus:c,readonly:m=!1,disabled:g=!1,commandPopupButtonProps:s,sx:d,notifier:h,...p}=l,[x,u]=a.useState(null),[f,S]=a.useState(()=>r.getSelectedRanges().getCoords()),[y,C]=a.useState(!1),{reference:b}=o.useFloatStack({parentFloat:s?.parentFloat}),[w,j]=a.useState(()=>m||!r.getProtection().isStructureAllowed()),T=()=>x?.text??"",[B,I]=a.useState(T),F=k.useCallbackRef(()=>{if(b?.closeAll(),!B){const K=T();return I(T()),K}if(T()===B)return B;const U=B.trim().toLowerCase();if(U==="r"||U==="c")return B;try{const K=r.getRanges(B);if(K)return K.toString()}catch{}const Q=t.getByName(B);if(Q&&Q.getRanges())return B;let ee=null;try{const K=r.getRanges(B),W=K.getCoords().map(Z=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...Z}));ee=r.getRanges(W)}catch{}if(!ee){const K=r.getSelectedRanges().getCoords().map(W=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...W}));ee=r.getRanges(K)}try{let K=t.getByName(B);w||K||(K=t.addReference(B,ee)),K&&u({text:K.getName()})}catch(K){I(T()),h.showMessage?.(K.message,{type:k.NotificationType.Error})}return null},[B,t,b,w]),N=k.useCallbackRef(()=>{if(r.isClosed())return;const U=[];for(let K=0;K<f.length;K++){const W=f[K];U.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...W})}let Q=null;try{Q=t.lookupByRanges(U)}catch{}let ee=null;ee=Q?.length>0?Q[0].getName():r.getSelectedSheet().getSelectedRange().toString(),u({text:ee})},[r,f]),[L,M]=a.useState(()=>t?.getItems()??null);le.useModelListener(t,{onCollectionChange(U){M(t.getItems()),N()},onClose(U){M([])}}),a.useEffect(()=>{I(T())},[x,f]);const[v,P]=a.useState(r?.getSelectedSheet());le.useModelListener(r,{onProtectionChange:U=>{j(m||!U.getProtection().isStructureAllowed())},onSheetsChange:U=>{P(U?.getSelectedSheet())},onViewChange(U){P(U?.getSelectedSheet())}});const[H,A]=a.useState(null),$=k.useCallbackRef(O.CommonUtils.debounce(N,H?320:0),[]);le.useModelListener(v.getSelection(),{onChange:()=>{S(U=>{const Q=r.getSelectedRanges().getCoords();return O.CoordUtils.isEqualRangesArrays(Q,U)?U:Q})},onAdjustingChange:U=>{A(U.getAdjusting())}}),a.useEffect(()=>{if(H){const U=r.getSelectedRange(),Q=U.getRowCount(),ee=U.getColumnCount();let K=`${Q}R x ${ee}C`;if(K.length>17&&(K=`${Q}x${ee}`),Q>1||ee>1)return void u({text:K,fontStyle:"italic",justifyContent:"center"})}u({text:r.getSelectedSheet().getSelectedRange().toString()}),$()},[f,r,H]);const D=a.useRef(null),R=a.useCallback(U=>{const{onMouseDown:Q,onMouseUp:ee,...K}=U;return e.jsx(E.IconButton,{...K,sx:{...K?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:e.jsx(E.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:D},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:W=>`1px solid ${W.palette.text.icon??W.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:W=>`1px solid ${W.palette.primary.main}`},"::after":{borderBottom:W=>`1px solid ${W.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*O.IFont.getDeviceScale(),fontStyle:x?.fontStyle,paddingLeft:W=>W.spacing(.75),paddingRight:W=>W.spacing(.75),boxShadow:"none",flex:"1",color:W=>W.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:W=>W.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:W=>W.palette.text.primary}}},value:B,onFocus:W=>{W.target?.select()},onKeyDown:W=>{if(W.which===k.KeyCodes.Enter||W.which===k.KeyCodes.Tab){let Z=B;T()!==B&&(W.stopPropagation(),W.preventDefault(),Z=F()),Z?q(Z):c?.()}else if(W.which===k.KeyCodes.Escape)T()!==B?(I(T()),setTimeout(()=>{W.target?.select()},0),W.stopPropagation(),W.preventDefault()):c?.();else if(W.which===k.KeyCodes.Space)return void W.stopPropagation()},onBlur:()=>{I(T())},onChange:W=>{I(W.target.value)}})})},[B,x]),q=k.useCallbackRef(async U=>{try{b?.closeAll();const Q=t.lookupByRanges(U)?.[0];Q&&await Q?.select(),await r.getRanges(U)?.select()}catch(Q){h.showMessage?.(Q.message,{type:k.NotificationType.Error})}},[t,h,r]),Y=a.useCallback(U=>{setTimeout(()=>{C(!0)},0);const Q={variant:k.CommandButtonType.Menuitem,parentFloat:U.floatReference,commandHook:{...s?.commandHook,beforeExecute:(ge,xe)=>(b?.closeAll(),s?.commandHook?.beforeExecute?.(ge,xe))},scope:s?.scope,commands:s?.commands};let ee=t.getItems({scope:r?.getSelectedSheet().getName()});ee=ee.sort((ge,xe)=>ge.getType()===xe.getType()?ge.getName().localeCompare(xe.getName()):ge.getType()==="range"?-1:1);const K=w?null:["editNamedReference","deleteNamedReference"],W=w?null:["editTable",null,"convertTableToRange","deleteTable"],Z=[],ne=ee.length;for(let ge=0;ge<ne;ge++){const xe=ee[ge],Be=xe.getRanges();if(!Be||xe.isHidden())continue;const se=xe.getType();se!==ee[ge-1]?.getType()&&(ge>0&&Z.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},`type-divider-${Z.length}`)),Z.push(e.jsx(o.ExhibitMenuHeader,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:xe.getType()==="reference"?"Ranges":"Tables"},`type-header-${Z.length}`))),se==="reference"?Z.push(a.createElement(o.SimpleCommandPopupButton,{...Q,key:"named-"+Z.length,popupCommandKeys:K,popupScope:"namedItem",scope:"namedItem",commandState:xe,commands:s?.commands,label:xe.getName(),quickCommand:"selectNamed",disabled:!xe.getRanges()||g,icon:Se=>{switch(Se.key()){case"editNamedReference":return o.themeIcon(e.jsx(o.CellSelectionEditIcon,{}));case"deleteNamedReference":return o.themeIcon(e.jsx(o.CellSelectionRemoveIcon,{}));default:return o.themeIcon(e.jsx(o.CellSelectionIcon,{}))}}})):se==="table"&&Z.push(a.createElement(o.SimpleCommandPopupButton,{...Q,key:"namedItem-"+Z.length,popupCommandKeys:W,popupScope:"namedItem",scope:"namedItem",commands:s?.commands,commandState:xe,label:xe.getName(),quickCommand:"selectNamed",disabled:!Be||g,icon:Se=>(Se.key(),o.themeIcon(e.jsx(o.InsertTableIcon,{})))}))}const be=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[w?null:e.jsx(o.CommandButton,{...Q,scope:"namedItem",command:s?.commands.getCommand("addNamedReference"),icon:o.themeIcon(e.jsx(o.CellSelectionInsertIcon,{}))}),Z&&Z.length>0?e.jsxs(e.Fragment,{children:[w?null:e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:Z})]}):null]});return o.defaultCreatePopupPanel({...U,children:be})},[r,L,t,x,w]),_=k.useImperativeElement(i,()=>({focus(U){D.current?.focus(U)}}),[]);return e.jsx(E.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...d},ref:Dt([_,i]),...p,children:e.jsx(o.ExhibitPopupIconButton,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...d},buttonProps:{sx:{backgroundColor:U=>U.palette.background.paper,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`}},tabIndex:-1,outlined:{color:U=>n?U.palette.action.disabled:G.alpha(U.palette.divider,.2)},parentFloat:b,createPopupPanel:Y,onPopupOpen:()=>C(!0),onPopupClose:()=>C(!1),createTooltip:({children:U},Q)=>e.jsx(o.ExhibitTooltip,{title:Q||y?"":"Name Box",disabled:Q,leaveDelay:0,sx:{opacity:Q||y?0:1},children:U}),createQuickButton:R})})}));Zo.displayName="NamedCollectionEditor";const Ql=(l,i)=>e.jsx(Zo,{ref:i,...l}),Jo=a.memo(a.forwardRef((l,i)=>{const{sx:n,workbook:t,sheetElement:r,gridStyle:c,showNamedCollectionEditor:m=!0,NamedCollectionEditorProps:g,renderNamedCollectionEditor:s=Ql,disabled:d,commands:h,...p}=l,[x,u]=a.useState(t?.getSelectedSheet());le.useModelListener(t,{onSheetsChange:W=>{u(W?.getSelectedSheet())},onViewChange(W){u(W?.getSelectedSheet())}});const[f,S]=a.useState(x.getSelection().getCoords().cell),y=x.getRange(f).getCell(),C=d||!y.isEditAllowed(),b=a.useRef(null),w=a.useMemo(()=>({fontSize:11}),[]);le.useModelListener(x.getSelection(),{onChange:()=>{S(x.getSelection().getCoords().cell)}}),le.useModelListener(x,{onProtectionChange(){S(x.getSelection().getCoords().cell)}});const j=b.current?.getLineHeight()??20,[T,B]=a.useState(j),[I,F]=a.useState(5),[N,L]=a.useState(1),M=k.useCallbackRef((W,{size:Z})=>{W.preventDefault(),W.stopPropagation();const ne=Math.floor(Z.height/j);B(ne*j+1),ne>1&&F(ne)},[j]),v=k.useCallbackRef((W,{size:Z})=>{const ne=Math.floor(Z.height/j);L(ne)},[j]),P=k.useEditMode(),H=P.getMode();let A=null;H?.key==="edit"&&(A=H.args?.stateAndCoords);const $=a.useMemo(()=>{let W=A?.editState;return W||(W=le.createCellEditStateFromCell(()=>x.getRange(f).getCell())),e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:e.jsx(le.SheetCellEditor,{ref:b,activeCoords:f,sheet:x,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:f})},defaultTextStyle:w,useRichStyling:!1,disabled:C,onChangeEdit:Z=>{if(Z.dirty!==void 0){const ne={sheet:x,coords:f,editState:Z};P.setMode(be=>({...be,args:{...be?.args,stateAndCoords:ne}}))}},editState:W,commands:h,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:N})})},[x,A,f,N,r]),D=a.useRef(null),R=a.useMemo(()=>m?s({names:t.getNames(),workbook:t,...g},D):null,[s,g,m,x,t,C]),q=a.useMemo(()=>e.jsxs(E.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,border:W=>`solid ${C?W.palette.action.disabled:G.alpha(W.palette.divider,.2)} 1px`},children:[e.jsx(o.ExhibitIconButton,{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:o.themeIcon(e.jsx(o.CloseErrorIcon,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:C||A===null,onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{r.cancelEdit()}}),e.jsx(o.ExhibitIconButton,{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:o.themeIcon(e.jsx(o.CheckSuccessIcon,{})),tooltipProps:{label:"Enter",simple:!0},disabled:C||A===null,onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{r.submitEdit()}}),e.jsx(o.ExhibitIconButton,{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:o.themeIcon(e.jsx(o.FunctionIcon,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:W=>{W.button===0&&W.preventDefault()}})]}),[C,A]),Y=G.useTheme(),[_,U]=a.useState(!1),Q=a.useMemo(()=>e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:W=>W.spacing(.5),alignItems:"start"},children:[q,e.jsxs(E.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:W=>W.typography.fontFamily,fontSize:11*O.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:W=>`${W.shape.borderRadius}px`,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,border:W=>`solid ${C?W.palette.action.disabled:G.alpha(W.palette.divider,.2)} 1px`,"& textarea":{color:W=>C?`${W.palette.text.disabled} !important`:W.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:W=>{W.target?.classList.contains("react-resizable-handle")&&W.preventDefault()},children:[e.jsx(E.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:W=>W.spacing(1),paddingRight:W=>W.spacing(1)},children:e.jsx(Jl.ResizableBox,{height:T,draggableOpts:{grid:[j,j]},minConstraints:[j,j],maxConstraints:[15*j,15*j],onResize:v,onResizeStop:M,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:$})}),e.jsx(o.ExhibitIconButton,{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:o.themeIcon(N>1?e.jsx(me.ExpandLess,{}):e.jsx(me.ExpandMore,{})),tooltipProps:{label:(N>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{const W=N>1?1:I;B(W*j+1),L(W)}}),e.jsx(E.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:_?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:W=>W.palette.primary.main,borderRadius:W=>`${W.shape.borderRadius}px`}})]})]}),[q,$,_,N,j]),ee=a.useMemo(()=>R||Q?!R&&Q?Q:R&&!Q?R:e.jsx(e.Fragment,{children:e.jsx(k.SplitPane,{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='${Y.palette.text.icon??Y.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:R,elementAfter:Q})}):null,[R,Q]),K=k.useImperativeElement(i,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>D.current}),[]);return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",gap:W=>W.spacing(.5),...n},ref:K,...p,children:ee})}));Jo.displayName="FormulaBar";const Qo=a.memo(a.forwardRef((l,i)=>{const{filter:n,commands:t,disabled:r,sx:c,floatReference:m,...g}=l,s=a.useMemo(()=>({}),[]),d=a.useMemo(()=>({commandHook:{beforeExecute:(x,u)=>m.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:m}),[r,m]),h=a.useMemo(()=>({...s,...d,variant:k.CommandButtonType.Menuitem}),[s,d]),p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:t.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:t.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:t.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),[]]});return e.jsx(E.Box,{ref:i,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...c},...g,children:p})}));Qo.displayName="FilterColumnMenu";const xa=a.memo(a.forwardRef((l,i)=>{const{children:n,className:t,disabled:r,style:c,filter:m,...g}=l,s=k.useImperativeElement(i,()=>({isFilters:()=>!0}),[]);return e.jsx("div",{ref:s,className:fe("filters",t),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...c},...g,children:e.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:[e.jsx("div",{children:m.getName()}),e.jsx("div",{children:"Filter Widget"})]})})}));xa.displayName="Filters";const en=a.memo(a.forwardRef((l,i)=>{const{children:n,sheet:t,style:r,className:c,value:m,index:g,editing:s,editable:d,disabled:h,selectedIndex:p,dragging:x,borderColor:u,borderWidth:f,activeColor:S,background:y="white",tabRadius:C=4,gridTheme:b,...w}=l,[j,T]=a.useState(()=>!!t&&t.getProtection().isLocked()),[B,I]=a.useState(()=>t?t.getTabColor():null);le.useModelListener(t,{onProtectionChange:()=>{T(t.getProtection().isLocked())},onTabColorChange:()=>{I(t.getTabColor())},onStyleChange:()=>{I(t.getTabColor())}});const F=G.useTheme(),N=p===g;let L=null,M=null;if(B||x){let H=y;B?(M=B.toBlackOrWhite().toCSS(),H=B?.toCSS()):N||(H=F.palette.background.paper),L=e.jsx(E.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:N?"50%":"100%",borderRadius:"4px",border:A=>N?`${y} solid 1px`:`${A.palette.divider} solid 1px`,background:N&&B?`linear-gradient(0deg, ${H} 0%, transparent)`:H}})}let v=null;typeof u=="string"?v=u:u?.toCSS&&(v=u.toCSS());const P=N?e.jsx(E.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:H=>H.palette.primary.main}}):null;return e.jsx(G.ThemeProvider,{theme:N?b??F:F,children:e.jsx(E.Box,{ref:i,className:fe(c),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:N?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:x?"grabbing":void 0},...w,children:e.jsx(k.RoundedTab,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:C,strokeColor:N?v:"transparent",children:e.jsx(E.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:N?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:x?"grabbing":void 0,color:N?"primary":M||"text.secondary",backgroundColor:N?y:"transparent","&:hover:not([disabled])":{backgroundColor:N?y:"transparent"},"& input":{color:H=>`${H.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:h,disableRipple:s,component:"div",children:e.jsxs(e.Fragment,{children:[L,e.jsxs(E.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:N?void 0:"1px"},children:[n,P]}),j?e.jsx(me.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):e.jsx(E.Box,{sx:{minHeight:"22px"}})]})]})},m+":"+g)})})})}));en.displayName="SheetTab";const tn=a.memo(a.forwardRef((l,i)=>{const{workbook:n,index:t,commands:r,scope:c="sheet",disabled:m,floatReference:g,sx:s,className:d,tabStripRef:h,...p}=l,[x,u]=a.useState(n?.getProtection());le.useModelListener(n,{onProtectionChange:b=>{u(b?.getProtection())}});const f=a.useMemo(()=>({}),[]),S=a.useMemo(()=>({commandHook:{beforeExecute:(b,w)=>g.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:c,commandState:t,disabled:m||t===void 0,parentFloat:g}),[m,g]),y=a.useMemo(()=>({...f,...S}),[f,S]),C=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{command:r.getCommand("addSheet"),commandState:t,...y,variant:k.CommandButtonType.Menuitem}),e.jsx(o.CommandButton,{command:r.getCommand("deleteSheet"),...y,variant:k.CommandButtonType.Menuitem}),e.jsxs(o.ExhibitMenuItem,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(g.closeAll()).then(()=>{h?.startEdit(t)})},disabled:m||!x.isStructureAllowed(),parentFloat:g,children:["Rename",c!=="sheet"?" Sheet":""]}),e.jsx(o.CommandButton,{command:r.getCommand("duplicateSheet"),...y,variant:k.CommandButtonType.Menuitem}),e.jsx(o.CommandButton,{command:r?.getCommand("protectionSheetToggle"),...y,variant:k.CommandButtonType.Menuitem,icon:e.jsx(me.Lock,{})}),e.jsx(ut,{variant:k.CommandButtonType.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:dt.End},parentFloat:g}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{command:r.getCommand("hideSheet"),...y,variant:k.CommandButtonType.Menuitem,icon:o.themeIcon(e.jsx(o.VisibilityOffIcon,{}))})]});return e.jsx(E.Box,{ref:i,className:fe("menu",d),sx:{...s},...p,children:C})}));tn.displayName="SheetTabMenu";const on=a.memo(a.forwardRef((l,i)=>{const{workbook:n,gridStyle:t,floatReference:r,closeFloatAll:c,className:m,...g}=l,[s,d]=a.useState(n?.getSheets().getItems()),[h,p]=a.useState(n?.getProtection());le.useModelListener(n,{onSheetsChange:u=>{d(u.getSheets().getItems())},onProtectionChange:u=>{p(u?.getProtection())}});const x=a.useMemo(()=>{const u=[],f=n.getSheets().getItems({visibility:O.ISheet.Visibility.Hidden}),S=n.getSelectedSheet();for(let y=0;y<f.length;y++){const C=f[y],b=C.getVisibility();if(b===O.ISheet.Visibility.VeryHidden)continue;const w=S===C,j=C.getProtection().isLocked(),T=C.getTabColor(),B=t?.body.fill??"transparent";let I=null,F=null,N=B;T&&(N=T.toCSS(),w||(F=T.toBlackOrWhite().toCSS()),I=e.jsx(E.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:w?N:"transparent",borderRadius:"4px",border:`solid 1px ${t.header.edgeStrokeFill}`},children:e.jsx(E.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===O.ISheet.Visibility.Hidden?"50%":"100%",border:M=>w?`${B} solid 1.5px`:`${M.palette.divider} solid 1px`,background:w&&T?`linear-gradient(0deg, ${N} 0%, ${B})`:N,borderRadius:"4px"}})}));let L=null;j&&(L=e.jsx(me.Lock,{color:"secondary"})),b!==O.ISheet.Visibility.Visible&&(L=o.themeIcon(e.jsx(o.VisibilityOffIcon,{style:{opacity:h.isStructureAllowed()?1:.7},color:"secondary"}))),L&&(L=e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:L})),u.push(e.jsx(o.ExhibitMenuItem,{disabled:!h.isStructureAllowed()&&b===O.ISheet.Visibility.Hidden,sx:{color:M=>{let v=w?M.palette.primary.main:M.palette.text.secondary;return F&&(v=F),b===O.ISheet.Visibility.Hidden&&(v=Re.alpha(v,M.palette.action.disabledOpacity)),v},borderLeft:M=>`${w?M.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:M=>M.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{C.select()}catch(M){console.error(M)}})},children:e.jsxs(e.Fragment,{children:[I,e.jsxs(E.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[e.jsxs(E.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[C.getName(),e.jsx(E.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:C.getName()})]}),L]})]})},""+y))}return u},[n,h,s,r,t]);return e.jsx(E.Box,{ref:i,className:fe("menu",m),...g,children:x})}));on.displayName="SheetsAllMenu";let _t=!1,ba=!1,qe=null;const er=async l=>{const i=await O.LicenseManager.getDetails();if(ba||i.isEval()){try{const n=top??window;n.SheetXL||(n.SheetXL=Object.freeze({getSelectedWorkbook:()=>qe?.getWorkbook(),getSelectedSheet:()=>qe?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>qe?.getWorkbook().getSelectedRange(),getRange:t=>qe?.getWorkbook().getRange(t),getSelectedWorkbookElement:()=>qe,getLicenseManager:()=>O.LicenseManager,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:"Set an array of values."},"SheetXL.getRange('a1:e5').setValue(100)":{Summary:"Set a single repeating value to a range."},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:"Get the values as a 2d array (see forEach)."},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:"Set current date/time using Javascript Date."},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:"Set current date/time using string."},"SheetXL.getSelectedSheet().getUsedRange().getValues()":{Summary:"Get all of the values in a sheet."},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:"Set fill to theme color 4."},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:"Set some columns to a modified theme color."},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:"Set border."},"SheetXL.getCell().getStyle().fill.toCSS()":{Summary:"Get the fill style as css for the selected cell."},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:"Autofill down."},"SheetXL.getRange('e7:i9').merge({ orientation: 'rows' })":{Summary:"Merge cells horizontally."},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:"Sort selected cells ascending with a header."},"SheetXL.getSelectedRange().clear('all')":{Summary:"Clear the current range a different way."},"SheetXL.getSelectedSheet().getTables().add('b2:e9')":{Summary:"Create a 4x8 table at b2 for current sheet."},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:"Copy cells."},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:"Set the size of columns to 30 pixels."},"SheetXL.getRange('2:3').delete()":{Summary:"Remove rows 2 and 3 and shift up."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg')":{Summary:"Add an image."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:"Add an image of height 100."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:"Set value to 100 and numberformat to 0% as a single."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:"Set a value and style to Note style and autofit text."},"SheetXL.getSelectedWorkbook().getNames().addReference('Small_Range', 'A2:E5');":{Summary:"Add a named range."},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:"Listen for updates at a range."}})}}))}catch(n){n instanceof DOMException||console.error(n),_t=!0}if(qe!==l&&(qe=l,!_t))try{_t=!0,(top??window).SheetXL&&(await O.LicenseManager._validate(!0),O.LicenseManager.wasPrinted()&&(()=>{Fe.CommonUtils.consoleWithNoSource(`%cTip: You can access the API directly in the console.
@@ -15,6 +15,6 @@ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modif
15
15
  10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},Fi=function(){return a.createElement(so,null,a.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Ni=function(){return a.createElement(so,null,a.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
16
16
  6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
17
17
  13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},Ai=function(){return a.createElement(so,null,a.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
18
- 0 22,12A10,10 0 0,0 12,2Z`}))},Ye={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Di,null),warning:a.createElement(Fi,null),error:a.createElement(Ni,null),info:a.createElement(Ai,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Ua,transitionDuration:{enter:225,exit:195}},Oi=function(l,i){return function(n,t){return t===void 0&&(t=!1),t?he({},Ye[n],{},i[n],{},l[n]):n==="autoHideDuration"?(r=l.autoHideDuration,c=i.autoHideDuration,(m=function(g){return typeof g=="number"||g===null})(r)?r:m(c)?c:Ye.autoHideDuration):n==="transitionDuration"?(function(g,s){var d=function(h,p){return p.some(function(x){return typeof h===x})};return d(g,["string","number"])?g:d(g,["object"])?he({},Ye.transitionDuration,{},d(s,["object"])&&s,{},g):d(s,["string","number"])?s:d(s,["object"])?he({},Ye.transitionDuration,{},s):Ye.transitionDuration})(l.transitionDuration,i.transitionDuration):l[n]||i[n]||Ye[n];var r,c,m}};function Nt(l){return Object.entries(l).reduce(function(i,n){var t,r=n[0],c=n[1];return he({},i,((t={})[r]=Lo(c),t))},{})}var Li="notistack-SnackbarContainer",Hi="notistack-Snackbar",_a="notistack-CollapseWrapper",zi="notistack-MuiContent",Wi=function(l){return"notistack-MuiContent-"+l},br=Nt({root:{height:0},entered:{height:"auto"}}),Ro="0px",Ka=a.forwardRef(function(l,i){var n=l.children,t=l.in,r=l.onExited,c=a.useRef(null),m=a.useRef(null),g=Ho(i,m),s=function(){return c.current?c.current.clientHeight:0};return a.createElement(pn,{in:t,unmountOnExit:!0,onEnter:function(d){d.style.height=Ro},onEntered:function(d){d.style.height="auto"},onEntering:function(d){var h=s(),p=no({timeout:175,mode:"enter"}),x=p.duration,u=p.easing;d.style.transitionDuration=typeof x=="string"?x:x+"ms",d.style.height=h+"px",d.style.transitionTimingFunction=u||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Va(d);var h=no({timeout:175,mode:"exit"}),p=h.duration,x=h.easing;d.style.transitionDuration=typeof p=="string"?p:p+"ms",d.style.height=Ro,d.style.transitionTimingFunction=x||""},nodeRef:m,timeout:175},function(d,h){return a.createElement("div",Object.assign({ref:g,className:$e(br.root,d==="entered"&&br.entered),style:he({pointerEvents:"all",overflow:"hidden",minHeight:Ro,transition:ct("height")},d==="entered"&&{overflow:"visible"},{},d==="exited"&&!t&&{visibility:"hidden"})},h),a.createElement("div",{ref:c,className:_a,style:{display:"flex",width:"100%"}},n))})});Ka.displayName="Collapse";var yr={right:"left",left:"right",bottom:"up",top:"down"},Vi=function(l){return"anchorOrigin"+un(l)},$i=function(){};function Rt(l,i){return l.reduce(function(n,t){return t==null?n:function(){for(var r=arguments.length,c=new Array(r),m=0;m<r;m++)c[m]=arguments[m];var g=[].concat(c);i&&g.indexOf(i)===-1&&g.push(i),n.apply(this,g),t.apply(this,g)}},$i)}var Ui=typeof window<"u"?a.useLayoutEffect:a.useEffect;function Cr(l){var i=a.useRef(l);return Ui(function(){i.current=l}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Mo,qa=a.forwardRef(function(l,i){var n=l.children,t=l.className,r=l.autoHideDuration,c=l.disableWindowBlurListener,m=c!==void 0&&c,g=l.onClose,s=l.id,d=l.open,h=l.SnackbarProps,p=h===void 0?{}:h,x=a.useRef(),u=Cr(function(){g&&g.apply(void 0,arguments)}),f=Cr(function(C){g&&C!=null&&(x.current&&clearTimeout(x.current),x.current=setTimeout(function(){u(null,"timeout",s)},C))});a.useEffect(function(){return d&&f(r),function(){x.current&&clearTimeout(x.current)}},[d,r,f]);var S=function(){x.current&&clearTimeout(x.current)},y=a.useCallback(function(){r!=null&&f(.5*r)},[r,f]);return a.useEffect(function(){if(!m&&d)return window.addEventListener("focus",y),window.addEventListener("blur",S),function(){window.removeEventListener("focus",y),window.removeEventListener("blur",S)}},[m,y,d]),a.createElement("div",Object.assign({ref:i},p,{className:$e(Hi,t),onMouseEnter:function(C){p.onMouseEnter&&p.onMouseEnter(C),S()},onMouseLeave:function(C){p.onMouseLeave&&p.onMouseLeave(C),y()}}),n)});qa.displayName="Snackbar";var _i=Nt({root:(Mo={display:"flex",flexWrap:"wrap",flexGrow:1},Mo[eo]={flexGrow:"initial",minWidth:"288px"},Mo)}),hn=a.forwardRef(function(l,i){var n=l.className,t=Ft(l,["className"]);return a.createElement("div",Object.assign({ref:i,className:$e(_i.root,n)},t))});hn.displayName="SnackbarContent";var Tt=Nt({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),Sr="notistack-snackbar",Ga=a.forwardRef(function(l,i){var n=l.id,t=l.message,r=l.action,c=l.iconVariant,m=l.variant,g=l.hideIconVariant,s=l.style,d=l.className,h=c[m],p=r;return typeof p=="function"&&(p=p(n)),a.createElement(hn,{ref:i,role:"alert","aria-describedby":Sr,style:s,className:$e(zi,Wi(m),Tt.root,Tt[m],d,!g&&h&&Tt.lessPadding)},a.createElement("div",{id:Sr,className:Tt.message},g?null:h,t),p&&a.createElement("div",{className:Tt.action},p))});Ga.displayName="MaterialDesignContent";var Et,Po,Xt,Yt,Do,Ki=a.memo(Ga),qi=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),Gi=function(l){var i=a.useRef(),n=a.useState(!0),t=n[0],r=n[1],c=Rt([l.snack.onClose,l.onClose]),m=a.useCallback(function(){i.current=setTimeout(function(){r(function(F){return!F})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var g,s=l.snack,d=l.classes,h=l.Component,p=h===void 0?Ki:h,x=a.useMemo(function(){return(function(F){F===void 0&&(F={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(F).filter(function(L){return!N[L]}).reduce(function(L,M){var v;return he({},L,((v={})[M]=F[M],v))},{})})(d)},[d]),u=s.open,f=s.SnackbarProps,S=s.TransitionComponent,y=s.TransitionProps,C=s.transitionDuration,b=s.disableWindowBlurListener,w=s.content,j=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),T=he({direction:(g=j.anchorOrigin,g.horizontal!=="center"?yr[g.horizontal]:yr[g.vertical]),timeout:C},y),B=w;typeof B=="function"&&(B=B(j.id,j.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(F,N){var L;return he({},F,((L={})[N]=Rt([l.snack[N],l[N]],j.id),L))},{});return a.createElement(Ka,{in:t,onExited:I.onExited},a.createElement(qa,{open:u,id:j.id,disableWindowBlurListener:b,autoHideDuration:j.autoHideDuration,className:$e(qi.wrappedRoot,x.root,x[Vi(j.anchorOrigin)]),SnackbarProps:f,onClose:c},a.createElement(S,Object.assign({},T,{appear:!0,in:u,onExit:I.onExit,onExited:m,onEnter:I.onEnter,onEntered:Rt([I.onEntered,function(){l.snack.requestClose&&c(null,"instructed",l.snack.id)}],j.id)}),B||a.createElement(p,Object.assign({},j)))))},Bt={default:20},Zt={default:6,dense:2},wr="."+_a,Jt=Nt({root:(Et={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:ct(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Et[wr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Et.maxWidth="calc(100% - "+2*Bt.default+"px)",Et[Io]={width:"100%",maxWidth:"calc(100% - 32px)"},Et),rootDense:(Po={},Po[wr]={padding:Zt.dense+"px 0px"},Po),top:{top:Bt.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Bt.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Bt.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Io]={left:"16px"},Xt),right:(Yt={right:Bt.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Io]={right:"16px"},Yt),center:(Do={left:"50%",transform:"translateX(-50%)"},Do[eo]={alignItems:"center"},Do)}),Xi=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Li,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+un(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Yi=a.memo(Xi),kr=function(l){return!(typeof l=="string"||a.isValidElement(l))},Zi=(function(l){function i(n){var t;return(t=l.call(this,n)||this).enqueueSnackbar=function(r,c){if(c===void 0&&(c={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var m=kr(r)?r:c,g=kr(r)?r.message:r,s=m.key,d=m.preventDuplicate,h=Ft(m,["key","preventDuplicate"]),p=Kt(s),x=p?s:new Date().getTime()+Math.random(),u=Oi(h,t.props),f=he({id:x},h,{message:g,open:!0,entered:!1,requestClose:!1,persist:u("persist"),action:u("action"),content:u("content"),variant:u("variant"),anchorOrigin:u("anchorOrigin"),disableWindowBlurListener:u("disableWindowBlurListener"),autoHideDuration:u("autoHideDuration"),hideIconVariant:u("hideIconVariant"),TransitionComponent:u("TransitionComponent"),transitionDuration:u("transitionDuration"),TransitionProps:u("TransitionProps",!0),iconVariant:u("iconVariant",!0),style:u("style",!0),SnackbarProps:u("SnackbarProps",!0),className:$e(t.props.className,h.className)});return f.persist&&(f.autoHideDuration=void 0),t.setState(function(S){if(d===void 0&&t.props.preventDuplicate||d){var y=function(w){return p?w.id===x:w.message===g},C=S.queue.findIndex(y)>-1,b=S.snacks.findIndex(y)>-1;if(C||b)return S}return t.handleDisplaySnack(he({},S,{queue:[].concat(S.queue,[f])}))}),x},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var c=r.queue,m=r.snacks;return c.length>0?he({},r,{snacks:[].concat(m,[c[0]]),queue:c.slice(1,c.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(s){return!s.open||s.requestClose}))return r;var c=!1,m=!1;r.snacks.reduce(function(s,d){return s+(d.open&&d.persist?1:0)},0)===t.maxSnack&&(m=!0);var g=r.snacks.map(function(s){return c||s.persist&&!m?he({},s):(c=!0,s.entered?(s.onClose&&s.onClose(null,"maxsnack",s.id),t.props.onClose&&t.props.onClose(null,"maxsnack",s.id),he({},s,{open:!1})):he({},s,{requestClose:!0}))});return he({},r,{snacks:g})},t.handleEnteredSnack=function(r,c,m){if(!Kt(m))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(g){return{snacks:g.snacks.map(function(s){return s.id===m?he({},s,{entered:!0}):he({},s)})}})},t.handleCloseSnack=function(r,c,m){t.props.onClose&&t.props.onClose(r,c,m);var g=m===void 0;t.setState(function(s){var d=s.snacks,h=s.queue;return{snacks:d.map(function(p){return g||p.id===m?p.entered?he({},p,{open:!1}):he({},p,{requestClose:!0}):he({},p)}),queue:h.filter(function(p){return p.id!==m})}})},t.closeSnackbar=function(r){var c=t.state.snacks.find(function(m){return m.id===r});Kt(r)&&c&&c.onClose&&c.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,c){if(!Kt(c))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(m){var g=t.processQueue(he({},m,{snacks:m.snacks.filter(function(s){return s.id!==c})}));return g.queue.length===0?g:t.handleDismissOldest(g)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(ur(t)),closeSnackbar:t.closeSnackbar.bind(ur(t))}},t}return za(i,l),i.prototype.render=function(){var n=this,t=this.state.contextValue,r=this.props,c=r.domRoot,m=r.children,g=r.dense,s=g!==void 0&&g,d=r.Components,h=d===void 0?{}:d,p=r.classes,x=this.state.snacks.reduce(function(f,S){var y,C=un(S.anchorOrigin),b=f[C]||[];return he({},f,((y={})[C]=[].concat(b,[S]),y))},{}),u=Object.keys(x).map(function(f){var S=x[f],y=S[0];return a.createElement(Yi,{key:f,dense:s,anchorOrigin:y.anchorOrigin,classes:p},S.map(function(C){return a.createElement(Gi,{key:C.id,snack:C,classes:p,Component:h[C.variant],onClose:n.handleCloseSnack,onEnter:n.props.onEnter,onExit:n.props.onExit,onExited:Rt([n.handleExitedSnack,n.props.onExited],C.id),onEntered:Rt([n.handleEnteredSnack,n.props.onEntered],C.id)})}))});return a.createElement(Wa.Provider,{value:t},m,c?Je.createPortal(u,c):u)},Ha(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Ye.maxSnack}}]),i})(a.Component),Xa=function(){return a.useContext(Wa)};const Ji=[{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}],Qi=[{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 Ya{constructor(i=Ji,n=Qi){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],n=this._readFormatType;for(let t=0;t<n.length;t++)for(let r=0;r<n[t].exts.length;r++)i.push("."+n[t].exts[r]);return i}async writeFile(i,n,t){if(!n||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,n,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,n){let t,r;const c=await n?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(m){throw m}try{return await r.WorkbookIO.read({...i,async onStart(m){await i?.onStart?.(m),t=await n?.showBusy?.(`Opening '${m}'...`)}})}catch(m){throw c?.(),t?.(),m}finally{c?.(),t?.()}}}const Ve=new Ya,Le={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},Za=a.forwardRef((l,i)=>{const{id:n,message:t,iconVariant:r,error:c,hideIconVariant:m,...g}=l,{closeSnackbar:s}=Xa(),d=G.useTheme(),[h,p]=a.useState(!1),x=a.useCallback(()=>{p(S=>!S)},[]),u=a.useCallback(()=>{s(n)},[n,s]);let f=c?.message;return!f&&a.isValidElement(t)&&(f=t),f||typeof t!="string"||(f=t),f||(f=`Unknown Error: ${t}`),e.jsx(hn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(E.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(E.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(E.Typography,{variant:"body2",component:"div",className:Le.typography,children:f}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(E.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:h}),onClick:x,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(E.IconButton,{size:"small",className:Le.expand,onClick:u,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(E.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx("div",{className:Le.stackTraceContainer,style:{backgroundColor:d.palette.error.light,borderTop:`1px solid ${d.palette.error.main}`},children:e.jsx(o.StackTrace,{error:c,hideLineNumbers:!0})})}):null]})})});Za.displayName="ToastError";const Ja=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="workbook",disabled:c=!1,...m}=l,g=k.useCallbackRef(d=>{const h={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...h,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:x=>{const u={...h,parentFloat:x.floatReference,scope:"saveWorkbook"},f=[];return Ve.getWriteFormats().forEach(S=>{if(S.isDefault)return;let y=null;S.key==="CSV"?y=o.themeIcon(e.jsx(o.FileDownloadAsCSVIcon,{})):S.key==="Excel"&&(y=o.themeIcon(e.jsx(o.FileDownloadAsExcelIcon,{})));const C=n.getCommand(`saveWorkbookAs${S.key}`);C?f.push(a.createElement(o.CommandButton,{...u,key:S.key,command:C,icon:y})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S.key}'`)}),o.defaultCreatePopupPanel({...x,children:f,onClick:()=>{x.closeFloatAll()}})}})]});return o.defaultCreatePopupPanel({...d,children:p,onClick:x=>{x.isDefaultPrevented||d.closeFloatAll()}})},[c,n,t,r]),s="File";return e.jsx(o.CommandPopupButton,{commands:n,disabled:c,commandHook:t,scope:r,label:s,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:d=>`calc(1.25rem + ${d.spacing(2)}px)`}},...m,createPopupPanel:g,icon:e.jsx(o.LabelIcon,{className:"label",icon:null,label:s})})}));Ja.displayName="StandaloneFileCommandButton";const es=e.jsx(o.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(E.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:e.jsx(le.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Qa=a.memo(a.forwardRef((l,i)=>{const{commands:n,workbook:t,logo:r=es,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:g=!0,...s}=l,{reference:d}=o.useFloatStack(),[h,{width:p}]=pt(),x=p<530,u=m?e.jsx(Ja,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,f=g?e.jsx(ra,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,S=a.useMemo(()=>({paddingLeft:C=>C.spacing(1),paddingRight:C=>C.spacing(1)}),[]),y=a.useRef(null);return e.jsx(E.Box,{ref:Dt([y,h,i]),...s,children:Ma({commands:n,renderCompact:x,workbook:t,selectWrapper:C=>e.jsxs(E.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:b=>b.spacing(1),paddingLeft:b=>b.spacing(1),paddingRight:b=>b.spacing(1)},children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:b=>b.spacing(.5)},children:[r,e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:b=>b.spacing(.25)},children:[u,C]})]}),e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(E.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!f?"0 0 auto":"1 1 100%"},children:f})]}),selectProps:S,toolbarsProps:{Home:{sx:{}}}})})}));Qa.displayName="StudioToolbar";const el=a.memo(a.forwardRef((l,i)=>{const{workbook:n,setWorkbook:t,refWorkbookTitle:r,titleWorkbook:c,setWorkbookTitle:m,titlePlaceHolder:g,children:s,undoManager:d,commands:h,importExportDisabled:p,themeOptions:x}=l,u=Xa(),f=u?u.enqueueSnackbar:()=>{},S=u?u.closeSnackbar:()=>{},[y,C]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),b=a.useCallback(()=>{C($=>({...$,isMounted:!0}))},[]),w=a.useCallback(()=>{C($=>({...$,isMounted:!1}))},[]),j={},T=o.useLazyWindow(j),B=o.useOptionsDialog(j),I=o.useInputDialog(j),F=a.useRef(new Set),N=a.useMemo(()=>{const $=(D,R)=>{if(R?.onceKey){if(F.current.has(R.onceKey))return;const Y=new Set(F.current);Y.add(R.onceKey),F.current=Y}const q={variant:R?.type??k.NotificationType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:R?.preventDuplicate,persist:R?.persist??R?.type===k.NotificationType.Error,action:Y=>e.jsx(E.IconButton,{onClick:()=>S(Y),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(q,R.enqueueProps),D||console.log("message is 'null'",R),f(D??"Alert",q)};return{showMessage:$,showBusy:(D,R)=>{let q=null;const Y=new Promise(_=>{q=_});return C(_=>{const U=new Map(_.starting);return U.set(Y,q),{..._,label:D,starting:U}}),Y},showWindow:(D,R,q)=>{const Y={...R,onKeyDown:_=>{h?.dispatchToFocusedCommand(_),_.isDefaultPrevented()||_.isPropagationStopped()||R?.onKeyDown?.(_)}};return T(D,{sort:()=>Promise.resolve().then(()=>require("./C9BPJY6JdfqxC-N2.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./D1vtoOMofYXyPjfs.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./BdTQ83hJlfAjrSHE.cjs")),comments:()=>Promise.resolve().then(()=>require("./D9kjw86UIk_mSbIA.cjs")),find:()=>Promise.resolve().then(()=>require("./CDIueroivzT9JX83.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./BnlDMBjbtlxRdeGI.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./DpPTCw6UGCWqpvJm.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./CYT4DxEbW1ffcGcf.cjs"))}[D],Y,q)},showOptions:B,showInputOptions:I,showError:D=>{let R,q=k.NotificationType.Error,Y="Unknown Error";typeof D=="string"?Y=D:D instanceof Error&&(R=D,D.message&&(Y=D.message)),D instanceof Fe.PartialError&&(q=k.NotificationType.Info),$(Y,{type:q,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),M=($=>{const{workbook:D,setWorkbook:R,importExportDisabled:q,workbookTitle:Y="export",setWorkbookTitle:_,notifier:U,requestWorkbookTitle:Q,themeOptions:ee,undoManager:K,commands:W,onExecute:Z}=$,ne=k.useCallbackRef(ee?.onModeChange,[ee?.onModeChange]),be=k.useCallbackRef(ee?.onEnabledDarkGridChange,[ee?.onEnabledDarkGridChange]),ge=k.useCallbackRef(ee?.onEnabledDarkImagesChange,[ee?.onEnabledDarkImagesChange]),xe=k.useCallbackRef(async(re=null,ae=null)=>{const X=[];let te,ue=null,ie=null;if(typeof re=="string"?ie=re:ue=re,te=ue?re:await Fe.CommonUtils.openFileDialog(ie??Ve.getAllReadFormatTypeAsString().join(",")),!te)return null;const je={source:te,createWorkbookOptions:ae,onWarning:ht=>{X.push(ht)}},Me=await Ve.read(je,U);return X.length>0&&(U?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
18
+ 0 22,12A10,10 0 0,0 12,2Z`}))},Ye={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Di,null),warning:a.createElement(Fi,null),error:a.createElement(Ni,null),info:a.createElement(Ai,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Ua,transitionDuration:{enter:225,exit:195}},Oi=function(l,i){return function(n,t){return t===void 0&&(t=!1),t?he({},Ye[n],{},i[n],{},l[n]):n==="autoHideDuration"?(r=l.autoHideDuration,c=i.autoHideDuration,(m=function(g){return typeof g=="number"||g===null})(r)?r:m(c)?c:Ye.autoHideDuration):n==="transitionDuration"?(function(g,s){var d=function(h,p){return p.some(function(x){return typeof h===x})};return d(g,["string","number"])?g:d(g,["object"])?he({},Ye.transitionDuration,{},d(s,["object"])&&s,{},g):d(s,["string","number"])?s:d(s,["object"])?he({},Ye.transitionDuration,{},s):Ye.transitionDuration})(l.transitionDuration,i.transitionDuration):l[n]||i[n]||Ye[n];var r,c,m}};function Nt(l){return Object.entries(l).reduce(function(i,n){var t,r=n[0],c=n[1];return he({},i,((t={})[r]=Lo(c),t))},{})}var Li="notistack-SnackbarContainer",Hi="notistack-Snackbar",_a="notistack-CollapseWrapper",zi="notistack-MuiContent",Wi=function(l){return"notistack-MuiContent-"+l},br=Nt({root:{height:0},entered:{height:"auto"}}),Ro="0px",Ka=a.forwardRef(function(l,i){var n=l.children,t=l.in,r=l.onExited,c=a.useRef(null),m=a.useRef(null),g=Ho(i,m),s=function(){return c.current?c.current.clientHeight:0};return a.createElement(pn,{in:t,unmountOnExit:!0,onEnter:function(d){d.style.height=Ro},onEntered:function(d){d.style.height="auto"},onEntering:function(d){var h=s(),p=no({timeout:175,mode:"enter"}),x=p.duration,u=p.easing;d.style.transitionDuration=typeof x=="string"?x:x+"ms",d.style.height=h+"px",d.style.transitionTimingFunction=u||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Va(d);var h=no({timeout:175,mode:"exit"}),p=h.duration,x=h.easing;d.style.transitionDuration=typeof p=="string"?p:p+"ms",d.style.height=Ro,d.style.transitionTimingFunction=x||""},nodeRef:m,timeout:175},function(d,h){return a.createElement("div",Object.assign({ref:g,className:$e(br.root,d==="entered"&&br.entered),style:he({pointerEvents:"all",overflow:"hidden",minHeight:Ro,transition:ct("height")},d==="entered"&&{overflow:"visible"},{},d==="exited"&&!t&&{visibility:"hidden"})},h),a.createElement("div",{ref:c,className:_a,style:{display:"flex",width:"100%"}},n))})});Ka.displayName="Collapse";var yr={right:"left",left:"right",bottom:"up",top:"down"},Vi=function(l){return"anchorOrigin"+un(l)},$i=function(){};function Rt(l,i){return l.reduce(function(n,t){return t==null?n:function(){for(var r=arguments.length,c=new Array(r),m=0;m<r;m++)c[m]=arguments[m];var g=[].concat(c);i&&g.indexOf(i)===-1&&g.push(i),n.apply(this,g),t.apply(this,g)}},$i)}var Ui=typeof window<"u"?a.useLayoutEffect:a.useEffect;function Cr(l){var i=a.useRef(l);return Ui(function(){i.current=l}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Mo,qa=a.forwardRef(function(l,i){var n=l.children,t=l.className,r=l.autoHideDuration,c=l.disableWindowBlurListener,m=c!==void 0&&c,g=l.onClose,s=l.id,d=l.open,h=l.SnackbarProps,p=h===void 0?{}:h,x=a.useRef(),u=Cr(function(){g&&g.apply(void 0,arguments)}),f=Cr(function(C){g&&C!=null&&(x.current&&clearTimeout(x.current),x.current=setTimeout(function(){u(null,"timeout",s)},C))});a.useEffect(function(){return d&&f(r),function(){x.current&&clearTimeout(x.current)}},[d,r,f]);var S=function(){x.current&&clearTimeout(x.current)},y=a.useCallback(function(){r!=null&&f(.5*r)},[r,f]);return a.useEffect(function(){if(!m&&d)return window.addEventListener("focus",y),window.addEventListener("blur",S),function(){window.removeEventListener("focus",y),window.removeEventListener("blur",S)}},[m,y,d]),a.createElement("div",Object.assign({ref:i},p,{className:$e(Hi,t),onMouseEnter:function(C){p.onMouseEnter&&p.onMouseEnter(C),S()},onMouseLeave:function(C){p.onMouseLeave&&p.onMouseLeave(C),y()}}),n)});qa.displayName="Snackbar";var _i=Nt({root:(Mo={display:"flex",flexWrap:"wrap",flexGrow:1},Mo[eo]={flexGrow:"initial",minWidth:"288px"},Mo)}),hn=a.forwardRef(function(l,i){var n=l.className,t=Ft(l,["className"]);return a.createElement("div",Object.assign({ref:i,className:$e(_i.root,n)},t))});hn.displayName="SnackbarContent";var Tt=Nt({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),Sr="notistack-snackbar",Ga=a.forwardRef(function(l,i){var n=l.id,t=l.message,r=l.action,c=l.iconVariant,m=l.variant,g=l.hideIconVariant,s=l.style,d=l.className,h=c[m],p=r;return typeof p=="function"&&(p=p(n)),a.createElement(hn,{ref:i,role:"alert","aria-describedby":Sr,style:s,className:$e(zi,Wi(m),Tt.root,Tt[m],d,!g&&h&&Tt.lessPadding)},a.createElement("div",{id:Sr,className:Tt.message},g?null:h,t),p&&a.createElement("div",{className:Tt.action},p))});Ga.displayName="MaterialDesignContent";var Et,Po,Xt,Yt,Do,Ki=a.memo(Ga),qi=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),Gi=function(l){var i=a.useRef(),n=a.useState(!0),t=n[0],r=n[1],c=Rt([l.snack.onClose,l.onClose]),m=a.useCallback(function(){i.current=setTimeout(function(){r(function(F){return!F})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var g,s=l.snack,d=l.classes,h=l.Component,p=h===void 0?Ki:h,x=a.useMemo(function(){return(function(F){F===void 0&&(F={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(F).filter(function(L){return!N[L]}).reduce(function(L,M){var v;return he({},L,((v={})[M]=F[M],v))},{})})(d)},[d]),u=s.open,f=s.SnackbarProps,S=s.TransitionComponent,y=s.TransitionProps,C=s.transitionDuration,b=s.disableWindowBlurListener,w=s.content,j=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),T=he({direction:(g=j.anchorOrigin,g.horizontal!=="center"?yr[g.horizontal]:yr[g.vertical]),timeout:C},y),B=w;typeof B=="function"&&(B=B(j.id,j.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(F,N){var L;return he({},F,((L={})[N]=Rt([l.snack[N],l[N]],j.id),L))},{});return a.createElement(Ka,{in:t,onExited:I.onExited},a.createElement(qa,{open:u,id:j.id,disableWindowBlurListener:b,autoHideDuration:j.autoHideDuration,className:$e(qi.wrappedRoot,x.root,x[Vi(j.anchorOrigin)]),SnackbarProps:f,onClose:c},a.createElement(S,Object.assign({},T,{appear:!0,in:u,onExit:I.onExit,onExited:m,onEnter:I.onEnter,onEntered:Rt([I.onEntered,function(){l.snack.requestClose&&c(null,"instructed",l.snack.id)}],j.id)}),B||a.createElement(p,Object.assign({},j)))))},Bt={default:20},Zt={default:6,dense:2},wr="."+_a,Jt=Nt({root:(Et={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:ct(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Et[wr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Et.maxWidth="calc(100% - "+2*Bt.default+"px)",Et[Io]={width:"100%",maxWidth:"calc(100% - 32px)"},Et),rootDense:(Po={},Po[wr]={padding:Zt.dense+"px 0px"},Po),top:{top:Bt.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Bt.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Bt.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Io]={left:"16px"},Xt),right:(Yt={right:Bt.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Io]={right:"16px"},Yt),center:(Do={left:"50%",transform:"translateX(-50%)"},Do[eo]={alignItems:"center"},Do)}),Xi=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Li,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+un(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Yi=a.memo(Xi),kr=function(l){return!(typeof l=="string"||a.isValidElement(l))},Zi=(function(l){function i(n){var t;return(t=l.call(this,n)||this).enqueueSnackbar=function(r,c){if(c===void 0&&(c={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var m=kr(r)?r:c,g=kr(r)?r.message:r,s=m.key,d=m.preventDuplicate,h=Ft(m,["key","preventDuplicate"]),p=Kt(s),x=p?s:new Date().getTime()+Math.random(),u=Oi(h,t.props),f=he({id:x},h,{message:g,open:!0,entered:!1,requestClose:!1,persist:u("persist"),action:u("action"),content:u("content"),variant:u("variant"),anchorOrigin:u("anchorOrigin"),disableWindowBlurListener:u("disableWindowBlurListener"),autoHideDuration:u("autoHideDuration"),hideIconVariant:u("hideIconVariant"),TransitionComponent:u("TransitionComponent"),transitionDuration:u("transitionDuration"),TransitionProps:u("TransitionProps",!0),iconVariant:u("iconVariant",!0),style:u("style",!0),SnackbarProps:u("SnackbarProps",!0),className:$e(t.props.className,h.className)});return f.persist&&(f.autoHideDuration=void 0),t.setState(function(S){if(d===void 0&&t.props.preventDuplicate||d){var y=function(w){return p?w.id===x:w.message===g},C=S.queue.findIndex(y)>-1,b=S.snacks.findIndex(y)>-1;if(C||b)return S}return t.handleDisplaySnack(he({},S,{queue:[].concat(S.queue,[f])}))}),x},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var c=r.queue,m=r.snacks;return c.length>0?he({},r,{snacks:[].concat(m,[c[0]]),queue:c.slice(1,c.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(s){return!s.open||s.requestClose}))return r;var c=!1,m=!1;r.snacks.reduce(function(s,d){return s+(d.open&&d.persist?1:0)},0)===t.maxSnack&&(m=!0);var g=r.snacks.map(function(s){return c||s.persist&&!m?he({},s):(c=!0,s.entered?(s.onClose&&s.onClose(null,"maxsnack",s.id),t.props.onClose&&t.props.onClose(null,"maxsnack",s.id),he({},s,{open:!1})):he({},s,{requestClose:!0}))});return he({},r,{snacks:g})},t.handleEnteredSnack=function(r,c,m){if(!Kt(m))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(g){return{snacks:g.snacks.map(function(s){return s.id===m?he({},s,{entered:!0}):he({},s)})}})},t.handleCloseSnack=function(r,c,m){t.props.onClose&&t.props.onClose(r,c,m);var g=m===void 0;t.setState(function(s){var d=s.snacks,h=s.queue;return{snacks:d.map(function(p){return g||p.id===m?p.entered?he({},p,{open:!1}):he({},p,{requestClose:!0}):he({},p)}),queue:h.filter(function(p){return p.id!==m})}})},t.closeSnackbar=function(r){var c=t.state.snacks.find(function(m){return m.id===r});Kt(r)&&c&&c.onClose&&c.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,c){if(!Kt(c))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(m){var g=t.processQueue(he({},m,{snacks:m.snacks.filter(function(s){return s.id!==c})}));return g.queue.length===0?g:t.handleDismissOldest(g)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(ur(t)),closeSnackbar:t.closeSnackbar.bind(ur(t))}},t}return za(i,l),i.prototype.render=function(){var n=this,t=this.state.contextValue,r=this.props,c=r.domRoot,m=r.children,g=r.dense,s=g!==void 0&&g,d=r.Components,h=d===void 0?{}:d,p=r.classes,x=this.state.snacks.reduce(function(f,S){var y,C=un(S.anchorOrigin),b=f[C]||[];return he({},f,((y={})[C]=[].concat(b,[S]),y))},{}),u=Object.keys(x).map(function(f){var S=x[f],y=S[0];return a.createElement(Yi,{key:f,dense:s,anchorOrigin:y.anchorOrigin,classes:p},S.map(function(C){return a.createElement(Gi,{key:C.id,snack:C,classes:p,Component:h[C.variant],onClose:n.handleCloseSnack,onEnter:n.props.onEnter,onExit:n.props.onExit,onExited:Rt([n.handleExitedSnack,n.props.onExited],C.id),onEntered:Rt([n.handleEnteredSnack,n.props.onEntered],C.id)})}))});return a.createElement(Wa.Provider,{value:t},m,c?Je.createPortal(u,c):u)},Ha(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Ye.maxSnack}}]),i})(a.Component),Xa=function(){return a.useContext(Wa)};const Ji=[{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}],Qi=[{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 Ya{constructor(i=Ji,n=Qi){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],n=this._readFormatType;for(let t=0;t<n.length;t++)for(let r=0;r<n[t].exts.length;r++)i.push("."+n[t].exts[r]);return i}async writeFile(i,n,t){if(!n||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,n,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,n){let t,r;const c=await n?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(m){throw m}try{return await r.WorkbookIO.read({...i,async onStart(m){await i?.onStart?.(m),t=await n?.showBusy?.(`Opening '${m}'...`)}})}catch(m){throw c?.(),t?.(),m}finally{c?.(),t?.()}}}const Ve=new Ya,Le={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},Za=a.forwardRef((l,i)=>{const{id:n,message:t,iconVariant:r,error:c,hideIconVariant:m,...g}=l,{closeSnackbar:s}=Xa(),d=G.useTheme(),[h,p]=a.useState(!1),x=a.useCallback(()=>{p(S=>!S)},[]),u=a.useCallback(()=>{s(n)},[n,s]);let f=c?.message;return!f&&a.isValidElement(t)&&(f=t),f||typeof t!="string"||(f=t),f||(f=`Unknown Error: ${t}`),e.jsx(hn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(E.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(E.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(E.Typography,{variant:"body2",component:"div",className:Le.typography,children:f}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(E.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:h}),onClick:x,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(E.IconButton,{size:"small",className:Le.expand,onClick:u,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(E.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx("div",{className:Le.stackTraceContainer,style:{backgroundColor:d.palette.error.light,borderTop:`1px solid ${d.palette.error.main}`},children:e.jsx(o.StackTrace,{error:c,hideLineNumbers:!0})})}):null]})})});Za.displayName="ToastError";const Ja=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="workbook",disabled:c=!1,...m}=l,g=k.useCallbackRef(d=>{const h={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...h,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:x=>{const u={...h,parentFloat:x.floatReference,scope:"saveWorkbook"},f=[];return Ve.getWriteFormats().forEach(S=>{if(S.isDefault)return;let y=null;S.key==="CSV"?y=o.themeIcon(e.jsx(o.FileDownloadAsCSVIcon,{})):S.key==="Excel"&&(y=o.themeIcon(e.jsx(o.FileDownloadAsExcelIcon,{})));const C=n.getCommand(`saveWorkbookAs${S.key}`);C?f.push(a.createElement(o.CommandButton,{...u,key:S.key,command:C,icon:y})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S.key}'`)}),o.defaultCreatePopupPanel({...x,children:f,onClick:()=>{x.closeFloatAll()}})}})]});return o.defaultCreatePopupPanel({...d,children:p,onClick:x=>{x.isDefaultPrevented||d.closeFloatAll()}})},[c,n,t,r]),s="File";return e.jsx(o.CommandPopupButton,{commands:n,disabled:c,commandHook:t,scope:r,label:s,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:d=>`calc(1.25rem + ${d.spacing(2)}px)`}},...m,createPopupPanel:g,icon:e.jsx(o.LabelIcon,{className:"label",icon:null,label:s})})}));Ja.displayName="StandaloneFileCommandButton";const es=e.jsx(o.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(E.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:e.jsx(le.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Qa=a.memo(a.forwardRef((l,i)=>{const{commands:n,workbook:t,logo:r=es,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:g=!0,...s}=l,{reference:d}=o.useFloatStack(),[h,{width:p}]=pt(),x=p<530,u=m?e.jsx(Ja,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,f=g?e.jsx(ra,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,S=a.useMemo(()=>({paddingLeft:C=>C.spacing(1),paddingRight:C=>C.spacing(1)}),[]),y=a.useRef(null);return e.jsx(E.Box,{ref:Dt([y,h,i]),...s,children:Ma({commands:n,renderCompact:x,workbook:t,selectWrapper:C=>e.jsxs(E.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:b=>b.spacing(1),paddingLeft:b=>b.spacing(1),paddingRight:b=>b.spacing(1)},children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:b=>b.spacing(.5)},children:[r,e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:b=>b.spacing(.25)},children:[u,C]})]}),e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(E.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!f?"0 0 auto":"1 1 100%"},children:f})]}),selectProps:S,toolbarsProps:{Home:{sx:{}}}})})}));Qa.displayName="StudioToolbar";const el=a.memo(a.forwardRef((l,i)=>{const{workbook:n,setWorkbook:t,refWorkbookTitle:r,titleWorkbook:c,setWorkbookTitle:m,titlePlaceHolder:g,children:s,undoManager:d,commands:h,importExportDisabled:p,themeOptions:x}=l,u=Xa(),f=u?u.enqueueSnackbar:()=>{},S=u?u.closeSnackbar:()=>{},[y,C]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),b=a.useCallback(()=>{C($=>({...$,isMounted:!0}))},[]),w=a.useCallback(()=>{C($=>({...$,isMounted:!1}))},[]),j={},T=o.useLazyWindow(j),B=o.useOptionsDialog(j),I=o.useInputDialog(j),F=a.useRef(new Set),N=a.useMemo(()=>{const $=(D,R)=>{if(R?.onceKey){if(F.current.has(R.onceKey))return;const Y=new Set(F.current);Y.add(R.onceKey),F.current=Y}const q={variant:R?.type??k.NotificationType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:R?.preventDuplicate,persist:R?.persist??R?.type===k.NotificationType.Error,action:Y=>e.jsx(E.IconButton,{onClick:()=>S(Y),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(q,R.enqueueProps),D||console.log("message is 'null'",R),f(D??"Alert",q)};return{showMessage:$,showBusy:(D,R)=>{let q=null;const Y=new Promise(_=>{q=_});return C(_=>{const U=new Map(_.starting);return U.set(Y,q),{..._,label:D,starting:U}}),Y},showWindow:(D,R,q)=>{const Y={...R,onKeyDown:_=>{h?.dispatchToFocusedCommand(_),_.isDefaultPrevented()||_.isPropagationStopped()||R?.onKeyDown?.(_)}};return T(D,{sort:()=>Promise.resolve().then(()=>require("./BN4aFZRab6VVCDRf.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./DTF-sH8eYVxIMWj1.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./BNykDmn-jxiYcIQj.cjs")),comments:()=>Promise.resolve().then(()=>require("./CdB9FUSOOcgfgefd.cjs")),find:()=>Promise.resolve().then(()=>require("./CUkp30ObmoYCJQ1t.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./D9hFxTxVmINH11I5.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./DA6AaNv2yQwpHkNX.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./BYTvEMkYL0RP_ps4.cjs"))}[D],Y,q)},showOptions:B,showInputOptions:I,showError:D=>{let R,q=k.NotificationType.Error,Y="Unknown Error";typeof D=="string"?Y=D:D instanceof Error&&(R=D,D.message&&(Y=D.message)),D instanceof Fe.PartialError&&(q=k.NotificationType.Info),$(Y,{type:q,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),M=($=>{const{workbook:D,setWorkbook:R,importExportDisabled:q,workbookTitle:Y="export",setWorkbookTitle:_,notifier:U,requestWorkbookTitle:Q,themeOptions:ee,undoManager:K,commands:W,onExecute:Z}=$,ne=k.useCallbackRef(ee?.onModeChange,[ee?.onModeChange]),be=k.useCallbackRef(ee?.onEnabledDarkGridChange,[ee?.onEnabledDarkGridChange]),ge=k.useCallbackRef(ee?.onEnabledDarkImagesChange,[ee?.onEnabledDarkImagesChange]),xe=k.useCallbackRef(async(re=null,ae=null)=>{const X=[];let te,ue=null,ie=null;if(typeof re=="string"?ie=re:ue=re,te=ue?re:await Fe.CommonUtils.openFileDialog(ie??Ve.getAllReadFormatTypeAsString().join(",")),!te)return null;const je={source:te,createWorkbookOptions:ae,onWarning:ht=>{X.push(ht)}},Me=await Ve.read(je,U);return X.length>0&&(U?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
19
19
  `+X.join(`
20
- `))),Me},[Z,U,D]),Be=k.useCallbackRef(async(re,ae,X)=>{if(!ae&&Q){const te=await Q("Enter Workbook name to "+(X.isDefault?"Save.":`Export as ${X.description}.`));return te!==null&&Ve.writeFile(te,re,{formatType:X.key})}return Ve.writeFile(ae,re,{formatType:X.key})},[U,D,Q]),se=a.useCallback(()=>({contains:re=>!0,focus(){}}),[]),Se=a.useMemo(()=>{const re=[];q||(Ve.getWriteFormats().forEach(X=>{const te=X.isDefault,ue={label:te?"Save Workbook":`Save Workbook as ${X.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${X.description}`},tags:X.tags,description:`Save the workbook to the desktop${te?"":` as ${X.description}`}.`};te&&(ue.shortcut={key:"S",modifiers:[k.KeyModifiers.Ctrl]},re.push(new k.Command("saveWorkbookAs",se,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[k.KeyModifiers.Shift,k.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{Be(D,null,X).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${X.key}`;re.push(new k.Command(ie,se,ue,je=>{Be(D,je??Y,X).catch(Me=>{U?.showError?.(Me)})}))}),re.push(new k.Command("openWorkbook",se,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[k.KeyModifiers.Ctrl]}},async(X=null)=>{const te={date1904:D.isDate1904(),...D.options};try{const ue=await xe(X,te);if(!ue)return;const ie=ue.title,je=ue.workbook,Me=je.getSelectedSheet();if(ue.formatType.mimeType==="text/csv"){const ht=D.findValidSheetName(ie);await D.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await D.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else D?.close(),_?.(ie),R(je)}catch(ue){U?.showError?.(ue)}})),re.push(new k.Command("openWorkbookFromUrl",se,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(X){if(!X){const te=await U?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(te.option!=="Open")return;X=te.input}X&&console.log("openWorkbookFromUrl",X)})));let ae=[];return ee&&(ae=[new k.Command("themeMode",se,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new k.Command("defaultThemeMode",se,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new k.Command("enableDarkGrid",se,{label:"Enable Dark Grid",description:"Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new k.Command("enableDarkImages",se,{label:"Enable Dark Images",description:"Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...re,...ae,new k.SimpleCommand("help",se,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new k.SimpleCommand("showKeyboardShortcuts",se,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[k.KeyModifiers.Ctrl]}},()=>{}),new k.Command("gotoUrlGithub",se,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new k.Command("gotoUrlDiscord",se,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new k.Command("gotoUrlDocumentation",se,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new k.Command("gotoUrlIssue",se,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[D,Y,U,q,ee,W,K]),z=a.useMemo(()=>{let re=null;return re=W?W.createChildGroup(se,"standaloneWorkbook",!1):new k.CommandGroup(se,"standaloneWorkbook"),re.addCommands(Se,!0),re},[W,Se]);k.useUndoManager({manager:K,commands:z,notifier:U});const{themeMode:J}=o.useResolvedThemeMode();a.useEffect(()=>{if(!ee||!z)return;const re=ee.mode==="dark"||!ee.mode&&J==="dark";z.getCommand("themeMode").update({state:ee.mode??null,label:re?"Dark Mode":"Light Mode",scopedLabels:{appearance:re?"Dark Mode":"Light Mode"}}).updateCallback(()=>{ne(re?o.ThemeMode.Light:o.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!ee.mode}).updateCallback(()=>{ne(null)}),z.getCommand("enableDarkGrid").update({state:ee.enableDarkGrid}).updateCallback(()=>{be(!ee.enableDarkGrid)}),z.getCommand("enableDarkImages").update({state:ee.enableDarkImages}).updateCallback(()=>{ge(!ee.enableDarkImages)})},[J,ee,Se]);const{showModal:ce}=o.useModal();return a.useEffect(()=>{const re=()=>new Promise((ae,X)=>{const te=a.lazy(()=>Promise.resolve().then(()=>require("./COUujnMxQON551RK.cjs"))),ue=ce(te,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{ue.hide()},TransitionProps:{onExited:()=>{ae(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>re()),z.getCommand("help").updateCallback(()=>re())},[Se,z]),z})({workbook:n,setWorkbook:t,importExportDisabled:p,workbookTitle:c,setWorkbookTitle:m,commands:h,requestWorkbookTitle:$=>new Promise(D=>{r.current?r.current.requestWorkbookTitle((R,q)=>{D(R)},{selectAll:!0,requestReason:$}):D(g)}),themeOptions:x,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{y.starting.size<=0||!y.isMounted||C($=>{const D=new Map($.running);return $.starting.forEach((R,q)=>{const Y=()=>{C(_=>{const U=new Map(_.running);return U.delete(q),{..._,running:U}})};D.set(q,Y),R(Y)}),{...$,starting:new Map,running:D}})},[y]);const[v,P]=a.useState(null);a.useEffect(()=>{y.starting.size!==0||y.running.size!==0?P(e.jsx(o.LoadingPanel,{icon:e.jsx(o.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:y.label,onMount:b,onUnmount:w,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):P(null)},[y.starting,y.running]);const H=a.useMemo(()=>e.jsx(aa,{commands:M,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[M]),A={notifier:N,commands:M};return n&&(A.statusBarProps={childrenEnd:H}),e.jsxs(e.Fragment,{children:[v,s?a.cloneElement(s,A):null]})}));el.displayName="SnackbarAndCommandsWrapper";const ro=a.memo(a.forwardRef((l,i)=>{const{className:n,sx:t,style:r,onElementLoad:c,onError:m,undoManager:g,errorPanel:s=o.ErrorPanel,onKeyDown:d,workbook:h,createWorkbookOptions:p,onWorkbookChange:x,logo:u,importExportDisabled:f=!1,themeOptions:S,autoFocus:y=!1,commands:C,title:b,onTitleChange:w,titleProps:j,renderLoadingPanel:T,...B}=l,I=a.useRef(null),F=k.useCallbackRef(x,[x]),N=k.useCallbackRef(w??j?.onTitleChange,[w??j?.onTitleChange]),L=j?.placeHolder??"Untitled",M=S?.mode,{themeMode:v,source:P}=o.useResolvedThemeMode({mode:M}),H=a.useMemo(()=>({...S,light:o.createExhibitTheme(!1,Fe.CommonUtils.deepMerge(S?.theme??{},S?.light??{})),dark:o.createExhibitTheme(!0,Fe.CommonUtils.deepMerge(S?.theme??{},S?.dark??{}))}),[S]),A=v===o.ThemeMode.Dark,[$,D]=a.useState(null);a.useEffect(()=>{D(g??new Fe.UndoManager)},[g]);const[R,q]=a.useState(null),[Y,_]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!h||Object.keys(h).length===0&&!Fe.CommonUtils.isPromiseLike(h)){const X={theme:U.getDefaultTheme(),...p};_(new O.Workbook(X))}else _(h)},[h]),a.useLayoutEffect(()=>{if(Y){if(Y instanceof O.Workbook)return q({workbook:Y}),void(h!==Y&&F?.(Y));(async()=>{try{let X,te=await Promise.resolve(Y);te&&te.source&&(te=await Ve.read(te)),te.workbook?(Z(te.title),X=te.workbook):X=te,F?.(X),q({workbook:X})}catch(X){F?.(null),q({error:X})}})()}},[Y]);const[Q,ee]=a.useState(null);a.useEffect(()=>{if(!$||!R)return;$.clear();const X=R?.workbook?.getTransactions();if(X)return X.addListener({onCommitEnd:te=>{te.getDescription()?$.addUndoOperation({description:te.getDescription(),undo:()=>(X.revert(te.getId()),Q.source?.focus(),()=>{X.restore(te.getId()),Q.source?.focus()})}):console.warn("commit has no description",te)}})},[$,R,Q]);const K=k.useCallbackRef(X=>{X?$.setRepeatableOperation({description:X.label(),repeat:async()=>X.execute()}):$.setRepeatableOperation(null)},[$]),[W,Z]=a.useState(b??j?.title??"");a.useEffect(()=>{Z(b??j?.title??"")},[b??j?.title]),a.useEffect(()=>{N?.(W)},[W]);const[ne,be]=a.useState(null),ge=a.useMemo(()=>{const X=()=>({contains:te=>!0,focus(){}});return C?C.createChildGroup(X,"application",!1):new k.CommandGroup(X,"application")},[C]),xe=k.useCallbackRef(X=>{be(X.source.getViewportElement()),ee(X),ge.activate("sheet"),c?.(X)},[ge]);a.useEffect(()=>{Q&&y&&Q.source?.focus(typeof y=="object"?y:void 0)},[Q]);const Be=a.useRef(null),se=a.useCallback(X=>{let te=null;return j?.hidden||(te=e.jsx(mn,{...j,style:{maxWidth:"100%",...j?.style},workbook:I.current,ref:Be,title:W,placeHolder:L,onTitleChange:ue=>{Z(ue)}})),e.jsx(Qa,{...X,logo:u,mainElement:te,showFileMenu:!f,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[u,W,j,H,f,ge]);a.useEffect(()=>{const X=te=>te.preventDefault();return I.current?.addEventListener("wheel",X,{passive:!1}),()=>{I.current?.removeEventListener("wheel",X)}},[]);const Se=a.useMemo(()=>{const X={transparentBackground:!0};return e.jsx(E.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:T?.(X)??e.jsx(o.LoadingPanel,{...X})})},[t,r,T]),z=a.useCallback(({error:X})=>(m?.(X),e.jsx(s,{sx:t,style:r,error:X??"Unable to display empty workbook."})),[t,r,m]),J=a.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-SnackbarContainer > div":{maxWidth:"100%"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-Snackbar > .error-snackbar .MuiTypography-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-MuiContent *":{fontFamily:X=>X.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),ce=Dt([I,i]),re=a.useMemo(()=>{if(!R)return Se;if(R.error||!R.workbook)return z({error:R.error});let X=null,te=null,ue=!1;return H&&(X=A?H.dark:H.light,te=A&&H.enableDarkGrid?H.dark:H.light,ue=H.enableDarkImages),e.jsx(dn,{sx:J,style:r,tabIndex:0,autoFocus:!0,workbook:R.workbook,ref:ce,renderToolbar:se,onElementLoad:xe,onRepeatCommandChange:K,onKeyDown:ie=>{d?.(ie)},renderLoadingPanel:T,gridTheme:te,headersTheme:X,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...B},"WorkbookElement")},[R,W,$,Se,T,H,B,se,J]);let ae=e.jsx(vi,{fallbackRender:z,children:e.jsx(Zi,{maxSnack:3,domRoot:ne,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(X,te,ue)=>{I.current?.focus()},Components:{error:Za},iconVariant:{success:e.jsx(E.SvgIcon,{style:{marginRight:"8px"},children:e.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:e.jsx(o.ErrorAlertIcon,{style:{marginRight:"8px"}})},children:e.jsx(o.ModalProvider,{children:e.jsx(el,{workbook:R?.workbook,setWorkbook:_,importExportDisabled:f,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Z,refWorkbookTitle:Be,commands:ge,undoManager:$,themeOptions:H,children:re})})})});return H&&(ae=e.jsxs(G.ThemeProvider,{theme:A?H.dark:H.light,children:[H.cssBaseline?e.jsx(E.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const ts=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=ra,exports.AutoColorPosition=dt,exports.BorderCommandButton=Fr,exports.BorderPopupButton=Dr,exports.BorderStyleButton=Pr,exports.Checkboard=Rr,exports.ClearCommandButton=Wo,exports.ColorButton=ao,exports.ColorCommandButton=ut,exports.ColorPanel=Mr,exports.ColorPanelType=Ir,exports.ColorPopupButton=zo,exports.DeleteCellsCommandButton=$o,exports.DocThemeCommandButton=na,exports.EagerStudio=ro,exports.FillCommandButton=zr,exports.FilterColumnMenu=Qo,exports.FilterCommandButton=Ll,exports.Filters=xa,exports.FindCommandButton=Or,exports.FontFamilyCommandButton=$r,exports.FontSizeCommandButton=Lr,exports.FormulaBar=Jo,exports.FreezeCommandButton=Ar,exports.HelpCommandButton=aa,exports.HorizontalAlignCommandButton=jr,exports.InsertCellsCommandButton=Vo,exports.InsertFunctionCommandPopupButton=ia,exports.InsertFunctionSumCommandPopupButton=la,exports.InsertImageCommandButton=qo,exports.InsertScriptCommandButton=ja,exports.MergeCommandButton=Nr,exports.NamedCollectionEditor=Zo,exports.NamedInput=da,exports.NumberFormatCommandButton=Hr,exports.PasteCommandButton=Ko,exports.PresetCellStylesCommandButton=Xr,exports.PresetTableStylesCommandButton=Qr,exports.RangeInput=ma,exports.RunScriptCommandButton=ln,exports.ScriptEditorToolbar=rn,exports.ScriptWorkspace=an,exports.SheetTab=en,exports.SheetTabMenu=tn,exports.SheetZoomScale=Go,exports.SheetsAllMenu=on,exports.SortFilterCommandButton=Uo,exports.StatusBar=Xo,exports.Studio=Aa,exports.StyledStrokeIcon=Fo,exports.TableStyleCanvasPreview=Jr,exports.TableStyleOptionsPanel=Wl,exports.TableStylePreview=Zr,exports.TextEffectsCommandButton=Ur,exports.TextOverflowCommandButton=Er,exports.TextRotateCommandButton=Br,exports.ThemeSelectButton=ea,exports.ThemeSelectPanel=ta,exports.ThemeSelectPopupButton=oa,exports.UnderlineCommandButton=_r,exports.UndoRedoCommandButton=_o,exports.VerticalAlignCommandButton=Tr,exports.ViewGridLinesCommandButton=Wr,exports.ViewHeadingsCommandButton=Kr,exports.WalkingCopyCommandButton=lo,exports.WorkbookContextMenu=cn,exports.WorkbookElement=dn,exports.WorkbookIO=Ve,exports.WorkbookStrip=sn,exports.WorkbookTitle=mn,exports.WorkbookViewCommandButton=qr,exports._WorkbookIO=Ya,exports._extends=to,exports._objectWithoutPropertiesLoose=nn,exports._setPrototypeOf=oo,exports.clsx=$e,exports.clsx$1=fe,exports.commonjsGlobal=st,exports.createGridStyleFromMUITheme=Oo,exports.defaultNewWorkbook=Fa,exports.getDefaultExportFromCjs=function(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l},exports.requirePropTypes=Pt,exports.setPrintExamplesOnLoad=l=>{ba=l},exports.useMeasure=pt,exports.useWorkbookCommands=Da;
20
+ `))),Me},[Z,U,D]),Be=k.useCallbackRef(async(re,ae,X)=>{if(!ae&&Q){const te=await Q("Enter Workbook name to "+(X.isDefault?"Save.":`Export as ${X.description}.`));return te!==null&&Ve.writeFile(te,re,{formatType:X.key})}return Ve.writeFile(ae,re,{formatType:X.key})},[U,D,Q]),se=a.useCallback(()=>({contains:re=>!0,focus(){}}),[]),Se=a.useMemo(()=>{const re=[];q||(Ve.getWriteFormats().forEach(X=>{const te=X.isDefault,ue={label:te?"Save Workbook":`Save Workbook as ${X.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${X.description}`},tags:X.tags,description:`Save the workbook to the desktop${te?"":` as ${X.description}`}.`};te&&(ue.shortcut={key:"S",modifiers:[k.KeyModifiers.Ctrl]},re.push(new k.Command("saveWorkbookAs",se,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[k.KeyModifiers.Shift,k.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{Be(D,null,X).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${X.key}`;re.push(new k.Command(ie,se,ue,je=>{Be(D,je??Y,X).catch(Me=>{U?.showError?.(Me)})}))}),re.push(new k.Command("openWorkbook",se,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[k.KeyModifiers.Ctrl]}},async(X=null)=>{const te={date1904:D.isDate1904(),...D.options};try{const ue=await xe(X,te);if(!ue)return;const ie=ue.title,je=ue.workbook,Me=je.getSelectedSheet();if(ue.formatType.mimeType==="text/csv"){const ht=D.findValidSheetName(ie);await D.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await D.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else D?.close(),_?.(ie),R(je)}catch(ue){U?.showError?.(ue)}})),re.push(new k.Command("openWorkbookFromUrl",se,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(X){if(!X){const te=await U?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(te.option!=="Open")return;X=te.input}X&&console.log("openWorkbookFromUrl",X)})));let ae=[];return ee&&(ae=[new k.Command("themeMode",se,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new k.Command("defaultThemeMode",se,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new k.Command("enableDarkGrid",se,{label:"Enable Dark Grid",description:"Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new k.Command("enableDarkImages",se,{label:"Enable Dark Images",description:"Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...re,...ae,new k.SimpleCommand("help",se,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new k.SimpleCommand("showKeyboardShortcuts",se,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[k.KeyModifiers.Ctrl]}},()=>{}),new k.Command("gotoUrlGithub",se,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new k.Command("gotoUrlDiscord",se,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new k.Command("gotoUrlDocumentation",se,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new k.Command("gotoUrlIssue",se,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[D,Y,U,q,ee,W,K]),z=a.useMemo(()=>{let re=null;return re=W?W.createChildGroup(se,"standaloneWorkbook",!1):new k.CommandGroup(se,"standaloneWorkbook"),re.addCommands(Se,!0),re},[W,Se]);k.useUndoManager({manager:K,commands:z,notifier:U});const{themeMode:J}=o.useResolvedThemeMode();a.useEffect(()=>{if(!ee||!z)return;const re=ee.mode==="dark"||!ee.mode&&J==="dark";z.getCommand("themeMode").update({state:ee.mode??null,label:re?"Dark Mode":"Light Mode",scopedLabels:{appearance:re?"Dark Mode":"Light Mode"}}).updateCallback(()=>{ne(re?o.ThemeMode.Light:o.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!ee.mode}).updateCallback(()=>{ne(null)}),z.getCommand("enableDarkGrid").update({state:ee.enableDarkGrid}).updateCallback(()=>{be(!ee.enableDarkGrid)}),z.getCommand("enableDarkImages").update({state:ee.enableDarkImages}).updateCallback(()=>{ge(!ee.enableDarkImages)})},[J,ee,Se]);const{showModal:ce}=o.useModal();return a.useEffect(()=>{const re=()=>new Promise((ae,X)=>{const te=a.lazy(()=>Promise.resolve().then(()=>require("./DQVEvZcBdQ5wUgah.cjs"))),ue=ce(te,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{ue.hide()},TransitionProps:{onExited:()=>{ae(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>re()),z.getCommand("help").updateCallback(()=>re())},[Se,z]),z})({workbook:n,setWorkbook:t,importExportDisabled:p,workbookTitle:c,setWorkbookTitle:m,commands:h,requestWorkbookTitle:$=>new Promise(D=>{r.current?r.current.requestWorkbookTitle((R,q)=>{D(R)},{selectAll:!0,requestReason:$}):D(g)}),themeOptions:x,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{y.starting.size<=0||!y.isMounted||C($=>{const D=new Map($.running);return $.starting.forEach((R,q)=>{const Y=()=>{C(_=>{const U=new Map(_.running);return U.delete(q),{..._,running:U}})};D.set(q,Y),R(Y)}),{...$,starting:new Map,running:D}})},[y]);const[v,P]=a.useState(null);a.useEffect(()=>{y.starting.size!==0||y.running.size!==0?P(e.jsx(o.LoadingPanel,{icon:e.jsx(o.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:y.label,onMount:b,onUnmount:w,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):P(null)},[y.starting,y.running]);const H=a.useMemo(()=>e.jsx(aa,{commands:M,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[M]),A={notifier:N,commands:M};return n&&(A.statusBarProps={childrenEnd:H}),e.jsxs(e.Fragment,{children:[v,s?a.cloneElement(s,A):null]})}));el.displayName="SnackbarAndCommandsWrapper";const ro=a.memo(a.forwardRef((l,i)=>{const{className:n,sx:t,style:r,onElementLoad:c,onError:m,undoManager:g,errorPanel:s=o.ErrorPanel,onKeyDown:d,workbook:h,createWorkbookOptions:p,onWorkbookChange:x,logo:u,importExportDisabled:f=!1,themeOptions:S,autoFocus:y=!1,commands:C,title:b,onTitleChange:w,titleProps:j,renderLoadingPanel:T,...B}=l,I=a.useRef(null),F=k.useCallbackRef(x,[x]),N=k.useCallbackRef(w??j?.onTitleChange,[w??j?.onTitleChange]),L=j?.placeHolder??"Untitled",M=S?.mode,{themeMode:v,source:P}=o.useResolvedThemeMode({mode:M}),H=a.useMemo(()=>({...S,light:o.createExhibitTheme(!1,Fe.CommonUtils.deepMerge(S?.theme??{},S?.light??{})),dark:o.createExhibitTheme(!0,Fe.CommonUtils.deepMerge(S?.theme??{},S?.dark??{}))}),[S]),A=v===o.ThemeMode.Dark,[$,D]=a.useState(null);a.useEffect(()=>{D(g??new Fe.UndoManager)},[g]);const[R,q]=a.useState(null),[Y,_]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!h||Object.keys(h).length===0&&!Fe.CommonUtils.isPromiseLike(h)){const X={theme:U.getDefaultTheme(),...p};_(new O.Workbook(X))}else _(h)},[h]),a.useLayoutEffect(()=>{if(Y){if(Y instanceof O.Workbook)return q({workbook:Y}),void(h!==Y&&F?.(Y));(async()=>{try{let X,te=await Promise.resolve(Y);te&&te.source&&(te=await Ve.read(te)),te.workbook?(Z(te.title),X=te.workbook):X=te,F?.(X),q({workbook:X})}catch(X){F?.(null),q({error:X})}})()}},[Y]);const[Q,ee]=a.useState(null);a.useEffect(()=>{if(!$||!R)return;$.clear();const X=R?.workbook?.getTransactions();if(X)return X.addListener({onCommitEnd:te=>{te.getDescription()?$.addUndoOperation({description:te.getDescription(),undo:()=>(X.revert(te.getId()),Q.source?.focus(),()=>{X.restore(te.getId()),Q.source?.focus()})}):console.warn("commit has no description",te)}})},[$,R,Q]);const K=k.useCallbackRef(X=>{X?$.setRepeatableOperation({description:X.label(),repeat:async()=>X.execute()}):$.setRepeatableOperation(null)},[$]),[W,Z]=a.useState(b??j?.title??"");a.useEffect(()=>{Z(b??j?.title??"")},[b??j?.title]),a.useEffect(()=>{N?.(W)},[W]);const[ne,be]=a.useState(null),ge=a.useMemo(()=>{const X=()=>({contains:te=>!0,focus(){}});return C?C.createChildGroup(X,"application",!1):new k.CommandGroup(X,"application")},[C]),xe=k.useCallbackRef(X=>{be(X.source.getViewportElement()),ee(X),ge.activate("sheet"),c?.(X)},[ge]);a.useEffect(()=>{Q&&y&&Q.source?.focus(typeof y=="object"?y:void 0)},[Q]);const Be=a.useRef(null),se=a.useCallback(X=>{let te=null;return j?.hidden||(te=e.jsx(mn,{...j,style:{maxWidth:"100%",...j?.style},workbook:I.current,ref:Be,title:W,placeHolder:L,onTitleChange:ue=>{Z(ue)}})),e.jsx(Qa,{...X,logo:u,mainElement:te,showFileMenu:!f,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[u,W,j,H,f,ge]);a.useEffect(()=>{const X=te=>te.preventDefault();return I.current?.addEventListener("wheel",X,{passive:!1}),()=>{I.current?.removeEventListener("wheel",X)}},[]);const Se=a.useMemo(()=>{const X={transparentBackground:!0};return e.jsx(E.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:T?.(X)??e.jsx(o.LoadingPanel,{...X})})},[t,r,T]),z=a.useCallback(({error:X})=>(m?.(X),e.jsx(s,{sx:t,style:r,error:X??"Unable to display empty workbook."})),[t,r,m]),J=a.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-SnackbarContainer > div":{maxWidth:"100%"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-Snackbar > .error-snackbar .MuiTypography-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root":{color:X=>X.palette.getContrastText(X.palette.error.main)},"& .notistack-MuiContent *":{fontFamily:X=>X.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),ce=Dt([I,i]),re=a.useMemo(()=>{if(!R)return Se;if(R.error||!R.workbook)return z({error:R.error});let X=null,te=null,ue=!1;return H&&(X=A?H.dark:H.light,te=A&&H.enableDarkGrid?H.dark:H.light,ue=H.enableDarkImages),e.jsx(dn,{sx:J,style:r,tabIndex:0,autoFocus:!0,workbook:R.workbook,ref:ce,renderToolbar:se,onElementLoad:xe,onRepeatCommandChange:K,onKeyDown:ie=>{d?.(ie)},renderLoadingPanel:T,gridTheme:te,headersTheme:X,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...B},"WorkbookElement")},[R,W,$,Se,T,H,B,se,J]);let ae=e.jsx(vi,{fallbackRender:z,children:e.jsx(Zi,{maxSnack:3,domRoot:ne,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(X,te,ue)=>{I.current?.focus()},Components:{error:Za},iconVariant:{success:e.jsx(E.SvgIcon,{style:{marginRight:"8px"},children:e.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:e.jsx(o.ErrorAlertIcon,{style:{marginRight:"8px"}})},children:e.jsx(o.ModalProvider,{children:e.jsx(el,{workbook:R?.workbook,setWorkbook:_,importExportDisabled:f,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Z,refWorkbookTitle:Be,commands:ge,undoManager:$,themeOptions:H,children:re})})})});return H&&(ae=e.jsxs(G.ThemeProvider,{theme:A?H.dark:H.light,children:[H.cssBaseline?e.jsx(E.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const ts=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=ra,exports.AutoColorPosition=dt,exports.BorderCommandButton=Fr,exports.BorderPopupButton=Dr,exports.BorderStyleButton=Pr,exports.Checkboard=Rr,exports.ClearCommandButton=Wo,exports.ColorButton=ao,exports.ColorCommandButton=ut,exports.ColorPanel=Mr,exports.ColorPanelType=Ir,exports.ColorPopupButton=zo,exports.DeleteCellsCommandButton=$o,exports.DocThemeCommandButton=na,exports.EagerStudio=ro,exports.FillCommandButton=zr,exports.FilterColumnMenu=Qo,exports.FilterCommandButton=Ll,exports.Filters=xa,exports.FindCommandButton=Or,exports.FontFamilyCommandButton=$r,exports.FontSizeCommandButton=Lr,exports.FormulaBar=Jo,exports.FreezeCommandButton=Ar,exports.HelpCommandButton=aa,exports.HorizontalAlignCommandButton=jr,exports.InsertCellsCommandButton=Vo,exports.InsertFunctionCommandPopupButton=ia,exports.InsertFunctionSumCommandPopupButton=la,exports.InsertImageCommandButton=qo,exports.InsertScriptCommandButton=ja,exports.MergeCommandButton=Nr,exports.NamedCollectionEditor=Zo,exports.NamedInput=da,exports.NumberFormatCommandButton=Hr,exports.PasteCommandButton=Ko,exports.PresetCellStylesCommandButton=Xr,exports.PresetTableStylesCommandButton=Qr,exports.RangeInput=ma,exports.RunScriptCommandButton=ln,exports.ScriptEditorToolbar=rn,exports.ScriptWorkspace=an,exports.SheetTab=en,exports.SheetTabMenu=tn,exports.SheetZoomScale=Go,exports.SheetsAllMenu=on,exports.SortFilterCommandButton=Uo,exports.StatusBar=Xo,exports.Studio=Aa,exports.StyledStrokeIcon=Fo,exports.TableStyleCanvasPreview=Jr,exports.TableStyleOptionsPanel=Wl,exports.TableStylePreview=Zr,exports.TextEffectsCommandButton=Ur,exports.TextOverflowCommandButton=Er,exports.TextRotateCommandButton=Br,exports.ThemeSelectButton=ea,exports.ThemeSelectPanel=ta,exports.ThemeSelectPopupButton=oa,exports.UnderlineCommandButton=_r,exports.UndoRedoCommandButton=_o,exports.VerticalAlignCommandButton=Tr,exports.ViewGridLinesCommandButton=Wr,exports.ViewHeadingsCommandButton=Kr,exports.WalkingCopyCommandButton=lo,exports.WorkbookContextMenu=cn,exports.WorkbookElement=dn,exports.WorkbookIO=Ve,exports.WorkbookStrip=sn,exports.WorkbookTitle=mn,exports.WorkbookViewCommandButton=qr,exports._WorkbookIO=Ya,exports._extends=to,exports._objectWithoutPropertiesLoose=nn,exports._setPrototypeOf=oo,exports.clsx=$e,exports.clsx$1=fe,exports.commonjsGlobal=st,exports.createGridStyleFromMUITheme=Oo,exports.defaultNewWorkbook=Fa,exports.getDefaultExportFromCjs=function(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l},exports.requirePropTypes=Pt,exports.setPrintExamplesOnLoad=l=>{ba=l},exports.useMeasure=pt,exports.useWorkbookCommands=Da;