@sheetxl/studio-mui 0.6.8 → 0.6.9

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/{BfFOZEWQLNDtV64Z.cjs → BK-SPf2iAdtY2v2r.cjs} +2 -2
  2. package/browser/cjs/{5otKot37H6vcYOUU.cjs → BMUK7WDOHjdCTlnL.cjs} +2 -2
  3. package/browser/cjs/{CCskuVvL-LAdq6gD.cjs → Bo0KAIoyc8wjrX0Z.cjs} +4 -4
  4. package/browser/cjs/{2jMsSveHxIeW9vc-.cjs → CybaPr_tDqBYYm7l.cjs} +1 -1
  5. package/browser/cjs/{3XmMvO6_kJ7FXT7X.cjs → D11dQP9ASVFsBy2m.cjs} +1 -1
  6. package/browser/cjs/{Dq_l1pds9lpMnj-J.cjs → DQUtpkYC0M_fQv5_.cjs} +1 -1
  7. package/browser/cjs/{nko0JKeI81_5dAMe.cjs → DSWZ0c6YrATHKT05.cjs} +2 -2
  8. package/browser/cjs/{CH1F9benjH9bHO_7.cjs → Dy8tMdAvieDNFyNN.cjs} +1 -1
  9. package/browser/cjs/{BbzapT5WI3CiGf1M.cjs → LeRvKTH-iRno1m6n.cjs} +3 -3
  10. package/browser/cjs/{Ch_6Tr0DuGgUaQZJ.cjs → NYv7o9QPsXmI71mF.cjs} +2 -2
  11. package/browser/cjs/{Ckb0CwUnJxeHWWDK.cjs → P_MTTr3k6LbqArTi.cjs} +1 -1
  12. package/browser/cjs/{CWjovJuzONezFAQF.cjs → StodJUERc9sXjDM3.cjs} +2 -2
  13. package/browser/cjs/index.cjs +2 -2
  14. package/browser/esm/{BiQFT-WlOzD_j4Ru.mjs → 5ec1MS8QFxg_wTk6.mjs} +3 -3
  15. package/browser/esm/{_YOmXt1suyvp8BEA.mjs → 7bB6IyFR78AK_xsc.mjs} +2 -2
  16. package/browser/esm/{Cn3VjET_1xEAlu_q.mjs → BrkDPL7uUPTUnJf1.mjs} +2 -2
  17. package/browser/esm/{DQD-g2K2jGKlZMPc.mjs → C-SjjwB782n9nBYJ.mjs} +1 -1
  18. package/browser/esm/{Bo42D_sQtYgV9ScL.mjs → CQdHuWRKrc46Ov6t.mjs} +1 -1
  19. package/browser/esm/{B2PqCU6GPlE3eDD1.mjs → CjX3_GVACz2x1KDj.mjs} +4 -4
  20. package/browser/esm/{DXNqs-21xgljmyEf.mjs → CkNOojlllvYRHHW-.mjs} +1 -1
  21. package/browser/esm/{DZqhrQSeTgeOq9dS.mjs → D0-6I_5PCSF8a7L7.mjs} +1 -1
  22. package/browser/esm/index.mjs +2 -2
  23. package/browser/esm/{BD-fH8NEfIElOMgo.mjs → oJGEc64Ccgag_PQZ.mjs} +2 -2
  24. package/browser/esm/{CKBBeWaxfaYSHsce.mjs → q6UgUqJldJL6n2-x.mjs} +2 -2
  25. package/browser/esm/{BRR2vuFbSpVqdm9A.mjs → q8P-1V6WnCy4m7sv.mjs} +2 -2
  26. package/browser/esm/{DTev1OU-RstyyEF3.mjs → qGhUWftd5xiC-hxc.mjs} +1 -1
  27. package/node/esm/{DYmzWjYW7v2waD5l.mjs → BTK5i03GS-FeY98T.mjs} +1 -1
  28. package/node/esm/{BQBgYidb7jJOnIIE.mjs → BTkpV3euK14xAUB8.mjs} +1 -1
  29. package/node/esm/{BvlmWwsKbzFjTlz8.mjs → BVBW-cMRTjK6KVFg.mjs} +1 -1
  30. package/node/esm/{CvPNM5OTMpLK0B1B.mjs → BYoYizxJTZD7MEGg.mjs} +1 -1
  31. package/node/esm/{CPgVGR_Py37P6eec.mjs → BqgO5jB5pGXA3Hk4.mjs} +1 -1
  32. package/node/esm/{D9Twl23-5S9JqLPY.mjs → CLc5xV4p8QWx-rjD.mjs} +1 -1
  33. package/node/esm/{swsNTAtlcfh2QiUq.mjs → CNeOpyGVrqmfLHyT.mjs} +1 -1
  34. package/node/esm/{B6HOgYadEWJcQld2.mjs → D1dqpyBV7ZLrMRVk.mjs} +1 -1
  35. package/node/esm/{NKMueEYZmtL2qnXF.mjs → DeCgfM0e20R-VV0G.mjs} +1 -1
  36. package/node/esm/{BxRPA2P896KAO75c.mjs → cm-ecS0S68xhC_Yj.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 Bl=Object.create;var Mn=Object.defineProperty;var El=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=El(i,r))||t.enumerable});return l};var Pn=(l,i,n)=>(n=l!=null?Bl(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.8
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.9
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"),B=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]),f=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,h)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignLeftToggle"),icon:f.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignCenterToggle"),icon:f.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignRightToggle"),icon:f.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignJustifyToggle"),icon:f.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignCenterContinuousToggle"),icon:f.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignFillToggle"),icon:f.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignDistributedHorizontalToggle"),icon:f.get("formatAlignDistributedHorizontalToggle")})]}),C=e.jsxs(B.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:h.getCommand("formatIndentDecrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:h.getCommand("formatIndentIncrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),b=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...g,children:[C,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.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:f.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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},h=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:h})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,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})})),Br=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},[]),f=k.useCallbackRef((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},h=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:h})},[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:f,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Er=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 h=g[u];if(h?.state())return h.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},[]),f=a.useCallback((x,u)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...h,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:f,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 f=d?new d:document.createElement("canvas");f.width=2*s,f.height=2*s;const p=f.getContext("2d");return p?(p.fillStyle=m,p.fillRect(0,0,f.width,f.height),p.fillStyle=g,p.fillRect(0,0,s,s),p.translate(s,s),p.fillRect(0,0,s,s),f.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,...f}=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,...f})}),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:f,alphaWhite:p,alphaGrey:x,darkMode:u,alphaCheckSize:h=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const y=a.useCallback(E=>{r?.(E),E.isDefaultPrevented()||(E.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),C=a.useCallback(E=>{m?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),b=a.useCallback(E=>{g?.(E),E.isDefaultPrevented()},[t,g]),w=a.useCallback(E=>{s?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),T=a.useCallback(E=>{c?.(E),E.isDefaultPrevented()||E.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),j=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Rr,{size:h,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:T,onMouseOver:C,onMouseLeave:b,onFocus:w,children:[j,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:f})]})}),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:f=!1,darkMode:p=!1,...x}=l,u=new O.Color({val:r.definition.val,adjs:r.definition.adjs},j=>i(j)),h=f?u.toRGBA().toString():u.toString(),S=n&&(f?n.toRGBA().toString():n.toString())===h,y=t&&(f?t.toRGBA().toString():t.toString())===h,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]),T=a.useCallback(j=>{m?.(j?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:T,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:f,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 h=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 T=[],j=u[w];for(let I=0;I<j.length;I++){let P=j[I];T.push(e.jsx(ao,{schemeColorLookup:n,colorDef:P,selectedColor:r,previewColor:c,onSelectColorDef:h,onPreviewColorDef:S,swatchProps:p,compareRGB:d,darkMode:f},w+" "+I))}let E=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:T},""+w);b.push(E)}return b},[u,r,c,h,S]),C=a.useMemo(()=>i?e.jsx(B.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(B.Box,{style:{...s},children:[C,e.jsx(B.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("./CWjovJuzONezFAQF.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:f,onElementLoad:p,onDone:x,onEyeDropStart:u,onEyeDropStop:h,onPreviewColor:S,onPreviewColorImmediate:y,onSelectColor:C,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:T=dt.Start,compareRGB:j=!1,darkMode:E=!1,...I}=l,P=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(y,[y]),M=k.useCallbackRef(C,[C]),v=k.useCallbackRef(u,[u]),D=k.useCallbackRef(h,[h]),[H,A]=a.useState(!1),$=G.useTheme(),F=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",F,ce,z,J),ye("Primary Text","tx1",F,ce,z,J),ye("Secondary Background","bg2",F,ce,z,J),ye("Secondary Text","tx2",F,ce,z,J),ye("Accent 1","accent1",F,ce,z,J),ye("Accent 2","accent2",F,ce,z,J),ye("Accent 3","accent3",F,ce,z,J),ye("Accent 4","accent4",F,ce,z,J),ye("Accent 5","accent5",F,ce,z,J),ye("Accent 6","accent6",F,ce,z,J);const re=O.ITheme.buildPalette(ce,F,z,J),ae=[];if(ye("Dark Red","C00000",F,ae,z,J),ye("Red","FF0000",F,ae,z,J),ye("Orange","FFC000",F,ae,z,J),ye("Yellow","FFFF00",F,ae,z,J),ye("Light Green","92D050",F,ae,z,J),ye("Green","00B050",F,ae,z,J),ye("Light Blue","00B0F0",F,ae,z,J),ye("Blue","0070C0",F,ae,z,J),ye("Dark Blue","002060",F,ae,z,J),m?ye("Purple Is A Fruit","7030A0",F,ae,z,J):ye("Transparent","00000000",F,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}},[F,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},F):null)},[F]),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},F):null;Promise.resolve(x?.()).then(()=>{ne(J)})},[F,x]),ge=k.useCallbackRef(z=>{K(z?new O.Color(z,F):null)},[F]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.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),D?.();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,E]),Ee=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:P?P.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[q,P]),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(B.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:F,colorDef:z,selectedColor:n===null?b:n,previewColor:t===null?b:t,defaultButtonSize:d,isLarge:!0,darkMode:E,compareRGB:j,swatchProps:se})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,F,n,t]);return e.jsxs(B.Box,{ref:i,sx:{width:f,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&&T===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:F,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsx(Ht,{schemeColorLookup:F,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:F,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:F,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E})]}),Se&&T===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Ee]}),e.jsx(B.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(B.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(B.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:f=o.PopupButtonType.Toolbar,panelProps:p,shouldCloseFloatAll:x=!0,compareRGB:u=!1,darkMode:h=!1,...S}=l,y=k.useCallbackRef(g,[g]),C=k.useCallbackRef(s,[s]),b=k.useCallbackRef(d,[d]),[w,T]=a.useState(()=>{}),j=t||w||n||p?.autoColor,E=a.useRef(!1),I=a.useCallback(()=>{},[]),P=k.useCallbackRef(()=>{T(n)},[n]),N=k.useCallbackRef(R=>{E.current||(T(R),y?.(R))},[y]),L=k.useCallbackRef(R=>{E.current||(T(R),C?.(R))},[C]),M=k.useCallbackRef((R,q)=>{E.current||(T(void 0),b?.(R,q))},[b]),v=a.useMemo(()=>e.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${j?.toCSS(h)??"transparent"}`,"& .activeColor":{fill:`${j?.toCSS(h)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[j,r,h]),D=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:h})},[n,w,x,j,p?.autoColor,h]),F={onQuickClick:t?D:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:P,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return f===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...F}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...F})})),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(B.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:f=>`${i?i.toRGBA(s).toString():f.palette.text.icon??f.palette.action.active}`},"& .style_grey":{stroke:f=>f.palette.text.icon??f.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:f,sx:p,...x}=l,u=k.useCallbackRef(s,[]),h=a.useCallback(b=>{const{popupContainer:w,floatReference:T,closeFloat:j,...E}=b,I=[],P=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<P.length;N++){const L=P[N];if(L.description==="None"&&!d)continue;const M=e.jsx(Fo,{styleColor:m,length:Qt,width:L.width,darkMode:f,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(B.Box,{sx:{marginRight:"6px"},children:L.description}),e.jsxs(B.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:D=>D.preventDefault(),onMouseUp:()=>{j(),u(L.style)},onKeyDown:D=>{D.which===k.KeyCodes.Enter&&j()},selected:L.style===g,parentFloat:T,children:v},N))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,g,f]),S=a.useMemo(()=>{const b=O.IBorder.BuiltInDefinitions.get(g);let w;return w=b.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Fo,{styleColor:m,length:Qt,width:b.width,dashArray:b.pattern,darkMode:f,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),e.jsx(B.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:h,...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:f,createTemporaryBorder:p,...x}=l,u=k.useCallbackRef(s,[s]),h=k.useCallbackRef(d,[d]),[S,y]=a.useState(),[C,b]=a.useState(),w=S??r,T=C??n,j=f||{bottom:{style:r,color:n?.toString()}},E=k.useCallbackRef(v=>{const D={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(D[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||D[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?D.left:null,F=A?D.top:null,R=A?D.right:null,q=A?D.bottom:null,Y=A?D.vertical:null,_=A?D.horizontal:null;let U="";return F||$||(U+="M 3,5 H 5 V 3 H 3 "),F||(U+="M 7,5 H 9 V 3 H 7 "),F||Y||(U+="M 11,5 h 2 V 3 h -2 "),F||(U+="M 15,5 h 2 V 3 h -2 "),F||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(B.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(B.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=D.top,Z.bottom=D.horizontal):(Z.top=D.horizontal,Z.bottom=D.bottom),W===0?(Z.left=D.left,Z.right=D.vertical):(Z.left=D.vertical,Z.right=D.right),p?.(Z)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[T,w,m]),I=a.useCallback((v,D,H)=>{let A=null;if(v&&v.length>0){let $=null;(D||H)&&($={style:H,color:D?.toString()??null}),A={};for(let F=0;F<v.length;F++)A[v[F]]=$}return A},[]),P=a.useCallback(v=>{u?.(v)},[]),N=a.useCallback(v=>{h?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:D,floatReference:H}=v,A=(R,q,Y="bottom",_=!1)=>{const U=I(R,T??null,_?O.IBorder.StrokeStyle.None:w??null),Q=_?I([],T??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:E(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:()=>{D(),N(U),P(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(B.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(B.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)]})]}),F=e.jsx(e.Fragment,{children:e.jsxs(B.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"):T,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:T,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[g?F:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),g?$:F]})},[w,T,n,t,m]),M=a.useMemo(()=>E(j),[j,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},D)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:D,children:v}),onQuickClick:()=>{u?.(j)},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:f,selectedBorder:p,onSelectBorder:x,darkMode:u,icon:h,label:S,...y}=l,C=k.useCommands(n,["formatBorder"]),b=t??C[0],w=b?.context()??null,T=w?.autoColor??g,j=w?.autoStyle??s,E=p??w?.quickBorder,I=u??w?.darkMode,P=f??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,D)=>{const{children:H,title:A,...$}=v;let F=v.children;return(b?.disabled()||m)&&(F=e.jsx("div",{children:F})),e.jsx(o.CommandTooltip,{command:b,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:D,...$,children:F})},[b,m]);return e.jsx(Dr,{ref:i,autoColor:T,darkMode:I,autoStrokeStyle:j,createTemporaryBorder:P,schemeLookup:N,selectedBorder:E,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...f,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:f,sx:p,...x}=l;k.useCommand(n);const u=()=>n?.state()?.toString()||"11",[h,S]=a.useState(u),y=k.useCallbackRef(()=>{const P=parseFloat(h);isNaN(P)?S(u()):parseFloat(u())!==P&&n.execute(P,t)},[u,n,h,t]);a.useEffect(()=>{S(u())},[n?.state()]);const C=a.useMemo(()=>{if(!t)return null;const P={...t};return delete P.beforeExecute,P},[t]),b=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>b?e.jsxs(B.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:P=>P.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]),T=G.useTheme(),j=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(T.typography.fontSize),T.typography.fontFamily).width}px`,[T]),E=a.useCallback(P=>{const{onMouseDown:N,onMouseUp:L,...M}=P;return e.jsx(B.IconButton,{component:"div",...M,disableRipple:!0,children:e.jsx(B.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:j,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:h,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)u()!==h&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===k.KeyCodes.Escape)u()!==h&&(S(u()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(h+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)}})})},[h,g,n]),I=a.useCallback(P=>{const N=D=>{n?.execute(D,t)},L=n?.state(),M=[];for(let D=0;D<m.length;D++){const H=m[D]===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[D])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[D])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[D]})},"fontSize-"+D))}const v=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...x,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:M})]});return o.defaultCreatePopupPanel({...P,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:P},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:P}),createQuickButton:E,...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(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.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],f=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(),T=[];for(let L=0;L<w.length;L++){let M="";if(b&&!b.isEmpty())try{M=b.getNumberFormat(w[L].numberFormat).displayText}catch(D){console.warn(D)}M===""&&w[L].formatType===O.NumberFormat.Type.General&&(M="No specific format");const v=w[L].formatType===f;T.push(e.jsx(Dn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:M,handleSetFormat:C,format:w[L]},w[L].formatType))}const j={numberFormat:"",formatType:O.NumberFormat.Type.Custom},E=f===O.NumberFormat.Type.Custom,I=e.jsx(Dn,{selected:E,disabled:m||!d||d.disabled(),formattedValue:E?b.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),y.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:j,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),P=e.jsxs(B.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(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[P,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),u=G.useTheme(),h=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(B.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:h},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:f})}),...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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...f,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,...f}=l,p=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],x=k.useCommands(n,p),{singleCommand:u,allDisabled:h}=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 T={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,{...T,command:b.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...T,command:x[0],icon:S.get(p[0])}),e.jsx(o.CommandButton,{...T,command:x[1],icon:S.get(p[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:x[2],icon:S.get(p[2])}),e.jsx(o.CommandButton,{...T,command:x[3],icon:S.get(p[3])}),w]});return o.defaultCreatePopupPanel({...C,children:j})},[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()),...f}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||h,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,{})),...f})})),$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,...f}=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]),h=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 T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftUp"),icon:h.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftLeft"),icon:h.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteRows"),icon:h.get("deleteRows")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteColumns"),icon:h.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...y,children:T})},[c,t,r,h]);return x?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:x,icon:h.get(x.key()),...f}):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,{})),...f})})),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:f,icon:p,...x}=l,{autoColor:u,schemeLookup:h,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,T=h??C?.schemeLookup,j=S??C?.recentColors,E=f??C?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:T,recentColors:j,darkMode:E,...y}),[w,T,j,E]),P=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:D,...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:P,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:E,...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((f,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:f.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({...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=d.getCommand("sortCustom"),x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),p?e.jsx(o.CommandButton,{...f,command:p,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...f,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:f,...p}=l,x=[n];!r&&c&&x.push("redo");const u=k.useCommands(f,x),h=u[0],S=u[1],y=m??h?.context?.()?.undoManager;let C=d;d||(C=!h||h.disabled(),S&&!S.disabled()&&(C=!1));const[b,w]=a.useState(0),T=a.useCallback((j,E)=>{let I=b===0?"Cancel":`${h.label()} ${b} Action${b===1?"":"s"}`,P=!1;y||(P=!0),P||(P=c?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const N=A=>{h.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:P?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(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(P)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:F=>{F.button===0&&F.preventDefault()},onMouseUp:F=>{F.button===0&&N(A+1)},onKeyDown:F=>{F.isDefaultPrevented()||F.keyCode!==k.KeyCodes.Enter&&F.keyCode!==k.KeyCodes.Space||N(A+1)},children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(B.Typography,{component:"div",children:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let D=null;if(!r&&c){const A={scope:"undo",commands:E,variant:k.CommandButtonType.Menuitem,parentFloat:j.floatReference};D=[],D.push(e.jsx(_o,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&D.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{j.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[D,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...j,children:H})},[h?.context(),h?.state(),g,y,b,C]);return e.jsx(o.CommandPopupButton,{ref:i,commands:f,quickCommand:n,scope:g,disabled:C,label:h?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${h?.label()??"No"} last actions.`})}),createPopupPanel:T,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 f=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(h=>{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(f)||y.unshift({key:f,description:f});const C=[];for(let w=0;w<y.length;w++){const T=y[w].key===f;C.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:T,disabled:c||!n||n.disabled(),icon:T?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:j=>{j.button===0&&S(y[w].key)},onMouseDown:j=>{j.button===0&&j.preventDefault()},onKeyDown:j=>{j.keyCode!==k.KeyCodes.Enter&&j.keyCode!==k.KeyCodes.Space||S(y[w].key)},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(B.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(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})});return o.defaultCreatePopupPanel({...h,children:b})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:u,createTooltip:({children:h},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:h}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:x},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:f})}),...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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},h=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:h})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:f,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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},h=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:h})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:f,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((f,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({...f,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((f,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:f.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({...f,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},f=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:f})},[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,...f}=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]),h=x.getInsets(),S=x.getFont(),y=a.useCallback(()=>x.getBorder(),[x]);return e.jsx(B.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:`${h.top}px ${h.right}px ${h.bottom}px ${h.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},...f,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(B.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(B.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:f,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:f,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:f||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return o.defaultCreatePopupPanel({...y,children:w})},[]),h=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${h?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:f,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,...f}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.named(),h=s??p?.bodyStyle(),S=k.useCallbackRef(T=>{m?.(T),t?.execute(T,r)},[t,m,r]),y=a.useCallback((T,j)=>{const E={onSelectNamed:S,styles:x(),parentFloat:T.floatReference},I=x().getCustomNamed(),P=new Map,N=[];for(let F=0;F<I.length;F++)P.set(I[F].getName(),I[F]),x().getNamed(I[F].getName()).getBuiltInID()===null&&N.push(I[F].getName());const L=F=>{let R=P.get(F);return R||(R=x().getNamed(F)),!R||R.isHidden()?null:e.jsx(Hl,{namedStyle:R,selectedNamed:u,bodyStyle:p.bodyStyle(),createTemporaryCell:p.createTemporaryCell,commands:n,commandHook:r,...E},F)},M=(F,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(B.Box,{children:[q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:F},F+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:Y},F+"-presets")]},F)},v=(F,R)=>{const q=[];for(let Y=0;Y<R.length;Y++){const _=L(R[Y]);_&&q.push(_)}return q.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:q},F+"-presets")},D=[];D.push(M("Custom",N,!1)),D.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)),D.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])),D.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])),D.push((A="Themed Cell Styles",$=H,e.jsxs(B.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),D.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(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:F=>`${F.shape.borderRadius}px`,paddingBottom:F=>`${F.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:D}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:u,command:j.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[u,x?.().getTheme(),h]),C=k.useCallbackRef(T=>{const j=18/O.IFont.getDeviceScale(),E=p?.createTemporaryCell(T);return E.getStyle().getFont().getSize()<=j?E:E.createTemporaryCell({style:{font:{size:j}}})},[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:T=>`1px solid ${T.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[u,h,b]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:y,outlined:d,commands:n,createTooltip:({children:T},j)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:j,children:T}),selected:!1,disabled:b,label:t?.label(),icon:w,...f})})),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:f=zl,isLive:p=!1,...x}=l,u=Math.ceil(1.3*f),[h,S]=a.useReducer(T=>T+1,0);a.useEffect(()=>{if(p&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,p]);const y=a.useMemo(()=>{let T=t?.toJSON()??{};const j={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return T&&(T.styleOptions={...T.styleOptions,name:r.getName()}),T.ref=j,new O.Table({initialAnchor:j,json:T,styles:n})},[h,t,r,n]),C=a.useMemo(()=>{const T=[];for(let j=0;j<5;j++)for(let E=0;E<5;E++){const I=y.getStyleAt({colIndex:E,rowIndex:j});T.push(I)}return T},[y]),b=a.useMemo(()=>{const T=(E,I,P)=>{let N=P.getFill().toCSS(c?.darkMode??!1);const L=u-(I<4?1:0),M=f-(E<4?1:0),v=P.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(u-1),top:E*(f-1),width:L,height:M},e.jsx("td",{className:`table-style-fill ${E}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${E}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(M-1)/2,borderTop:`1px solid ${v}`}})},`${E}-${I}`)},j=[];for(let E=0;E<5;E++){const I=[];for(let P=0;P<5;P++){const N=C[5*E+P];I.push(T(E,P,N))}j.push(e.jsx("tr",{children:I},E))}return j},[y,r,c]),w=a.useCallback((T,j)=>C[j].getBorder()??null,[C]);return e.jsx(B.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*(f-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*(f-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,...f}=l,p=a.useMemo(()=>{const h=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return h.styleOptions={...h.styleOptions,name:t.getName()},h.ref=S,new O.Table({initialAnchor:S,json:h,styles:r})},[n,t,r]),x=a.useMemo(()=>{const h=[];for(let S=0;S<5;S++)for(let y=0;y<5;y++){const C=p.getStyleAt({colIndex:y,rowIndex:S});h.push(C)}return h},[p]),u=a.useMemo(()=>{let h=d;if(d||(h=document.createElement("canvas")),!h)return null;h.width!==61&&(h.width=61),h.height!==46&&(h.height=46);const S=h.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 T=x[5*b+w].getFill();let j=c?.fill;T.getType()===O.IFill.Type.Solid?j=T.getColor().toCSS(C,!1):T.getType()===O.IFill.Type.Gradient?j=T.getStops[0]?.color.toCSS(C,!1):T.getType()===O.IFill.Type.Pattern&&(j=T.getForeground().toCSS(C,!1)),S.fillStyle=j;const E=w*y,I=9*b;S.fillRect(E,I,13,10)}S.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const T=x[5*b+w],j=w*y,E=9*b,I=T.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(C,!1),bt(S,j,E,j,E+9));const M=I.getTop();M.isNone()||(S.strokeStyle=M.getColor().toCSS(C,!1),bt(S,j,E,j+y,9*b));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(C,!1),bt(S,j+y,E,j+y,E+9));const D=I.getBottom();D.isNone()||(S.strokeStyle=D.getColor().toCSS(C,!1),bt(S,j,E+9,j+y,E+9))}S.strokeStyle=T.getFont().getFill().toCSS(C,!1);const P=4,N=2.5;bt(S,w*y+N,9*b+P,w*y+N+7,9*b+P)}return`url(${h.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},...f})})),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:f,disabled:p,...x}=l;return e.jsxs(B.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)}`},...f},...x,ref:i,children:[c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:p||r==null}),label:"Header Row",labelPlacement:"end"}),g&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>g(!m),disabled:p||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(B.FormControlLabel,{control:e.jsx(B.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:f,commandHook:p,useCanvasPreview:x=!0,canvas:u,...h}=l,S=a.useCallback(w=>{const T={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"table"},j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...T,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:f,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...T,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:f,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:f}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:f||!n||n.isBuiltIn()})]}),E=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j})});return o.defaultCreatePopupPanel({...w,children:E})},[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:f,icon:null,onClick:()=>{r?.(n?.getName())},...h,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,...f}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.table?.();let h="insertTable";u&&(h="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(),T=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),j=a.useRef(null),E=a.useCallback((N,L)=>{const M={onSelectTableStyleName:T,styles:x(),parentFloat:N.floatReference};j.current||(j.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:j.current,...M},_):null},D=(_,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(B.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:_},_+"-header"),e.jsx(B.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(D("Custom",$,!1))}const F=[];u&&!u.getStyleOptions().name&&F.push(null);for(let _=0;_<21;_++)F.push("TableStyleLight"+(_+1));H.push(D("Light",F,$.length>0));const R=[];for(let _=0;_<28;_++)R.push("TableStyleMedium"+(_+1));H.push(D("Medium",R));const q=[];for(let _=0;_<11;_++)q.push("TableStyleDark"+(_+1));H.push(D("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(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:_=>`${_.shape.borderRadius}px`,paddingBottom:_=>`${_.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),Y]})},[x,x?.().getTheme(),w,C]),I=g||!t||t.disabled(),P=a.useMemo(()=>{if(!p||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[C,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:h,createPopupPanel:E,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:P,...f})})),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 f=[];for(let p=0;p<Ie.length;p++){const x=Ie[p];f.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:x,darkMode:t,selectedColor:null},p+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:p=>p.shadows[2]},children:f})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:f=>`solid ${r?f.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:f=>`solid ${f.palette.text.primary} 1px !important`}},icon:null,...g,children:e.jsxs(B.Box,{sx:{border:f=>`solid ${f.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:f=>r?f.palette.text.primary:void 0,"&:hover:not([disabled])":{color:f=>f.palette.text.primary}},children:[e.jsx(B.Box,{sx:{},children:i.getName()}),e.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,e.jsx(B.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"),B=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]),f=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,h)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignLeftToggle"),icon:f.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignCenterToggle"),icon:f.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignRightToggle"),icon:f.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignJustifyToggle"),icon:f.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignCenterContinuousToggle"),icon:f.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignFillToggle"),icon:f.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("formatAlignDistributedHorizontalToggle"),icon:f.get("formatAlignDistributedHorizontalToggle")})]}),C=e.jsxs(B.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:h.getCommand("formatIndentDecrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:h.getCommand("formatIndentIncrease"),commandHook:p,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),b=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...g,children:[C,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.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:f.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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},h=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:h})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,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})})),Br=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},[]),f=k.useCallbackRef((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},h=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:h})},[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:f,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Er=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 h=g[u];if(h?.state())return h.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},[]),f=a.useCallback((x,u)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...h,command:u.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...h,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:f,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 f=d?new d:document.createElement("canvas");f.width=2*s,f.height=2*s;const p=f.getContext("2d");return p?(p.fillStyle=m,p.fillRect(0,0,f.width,f.height),p.fillStyle=g,p.fillRect(0,0,s,s),p.translate(s,s),p.fillRect(0,0,s,s),f.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,...f}=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,...f})}),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:f,alphaWhite:p,alphaGrey:x,darkMode:u,alphaCheckSize:h=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const y=a.useCallback(E=>{r?.(E),E.isDefaultPrevented()||(E.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),C=a.useCallback(E=>{m?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),b=a.useCallback(E=>{g?.(E),E.isDefaultPrevented()},[t,g]),w=a.useCallback(E=>{s?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),T=a.useCallback(E=>{c?.(E),E.isDefaultPrevented()||E.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),j=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Rr,{size:h,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:T,onMouseOver:C,onMouseLeave:b,onFocus:w,children:[j,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:f})]})}),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:f=!1,darkMode:p=!1,...x}=l,u=new O.Color({val:r.definition.val,adjs:r.definition.adjs},j=>i(j)),h=f?u.toRGBA().toString():u.toString(),S=n&&(f?n.toRGBA().toString():n.toString())===h,y=t&&(f?t.toRGBA().toString():t.toString())===h,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]),T=a.useCallback(j=>{m?.(j?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:T,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:f,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 h=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 T=[],j=u[w];for(let I=0;I<j.length;I++){let P=j[I];T.push(e.jsx(ao,{schemeColorLookup:n,colorDef:P,selectedColor:r,previewColor:c,onSelectColorDef:h,onPreviewColorDef:S,swatchProps:p,compareRGB:d,darkMode:f},w+" "+I))}let E=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:T},""+w);b.push(E)}return b},[u,r,c,h,S]),C=a.useMemo(()=>i?e.jsx(B.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(B.Box,{style:{...s},children:[C,e.jsx(B.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("./StodJUERc9sXjDM3.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:f,onElementLoad:p,onDone:x,onEyeDropStart:u,onEyeDropStop:h,onPreviewColor:S,onPreviewColorImmediate:y,onSelectColor:C,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:T=dt.Start,compareRGB:j=!1,darkMode:E=!1,...I}=l,P=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(y,[y]),M=k.useCallbackRef(C,[C]),v=k.useCallbackRef(u,[u]),D=k.useCallbackRef(h,[h]),[H,A]=a.useState(!1),$=G.useTheme(),F=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",F,ce,z,J),ye("Primary Text","tx1",F,ce,z,J),ye("Secondary Background","bg2",F,ce,z,J),ye("Secondary Text","tx2",F,ce,z,J),ye("Accent 1","accent1",F,ce,z,J),ye("Accent 2","accent2",F,ce,z,J),ye("Accent 3","accent3",F,ce,z,J),ye("Accent 4","accent4",F,ce,z,J),ye("Accent 5","accent5",F,ce,z,J),ye("Accent 6","accent6",F,ce,z,J);const re=O.ITheme.buildPalette(ce,F,z,J),ae=[];if(ye("Dark Red","C00000",F,ae,z,J),ye("Red","FF0000",F,ae,z,J),ye("Orange","FFC000",F,ae,z,J),ye("Yellow","FFFF00",F,ae,z,J),ye("Light Green","92D050",F,ae,z,J),ye("Green","00B050",F,ae,z,J),ye("Light Blue","00B0F0",F,ae,z,J),ye("Blue","0070C0",F,ae,z,J),ye("Dark Blue","002060",F,ae,z,J),m?ye("Purple Is A Fruit","7030A0",F,ae,z,J):ye("Transparent","00000000",F,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}},[F,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},F):null)},[F]),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},F):null;Promise.resolve(x?.()).then(()=>{ne(J)})},[F,x]),ge=k.useCallbackRef(z=>{K(z?new O.Color(z,F):null)},[F]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.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),D?.();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,E]),Ee=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:P?P.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[q,P]),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(B.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:F,colorDef:z,selectedColor:n===null?b:n,previewColor:t===null?b:t,defaultButtonSize:d,isLarge:!0,darkMode:E,compareRGB:j,swatchProps:se})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,F,n,t]);return e.jsxs(B.Box,{ref:i,sx:{width:f,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&&T===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:F,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsx(Ht,{schemeColorLookup:F,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:F,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:F,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:j,darkMode:E})]}),Se&&T===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Ee]}),e.jsx(B.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(B.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(B.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:f=o.PopupButtonType.Toolbar,panelProps:p,shouldCloseFloatAll:x=!0,compareRGB:u=!1,darkMode:h=!1,...S}=l,y=k.useCallbackRef(g,[g]),C=k.useCallbackRef(s,[s]),b=k.useCallbackRef(d,[d]),[w,T]=a.useState(()=>{}),j=t||w||n||p?.autoColor,E=a.useRef(!1),I=a.useCallback(()=>{},[]),P=k.useCallbackRef(()=>{T(n)},[n]),N=k.useCallbackRef(R=>{E.current||(T(R),y?.(R))},[y]),L=k.useCallbackRef(R=>{E.current||(T(R),C?.(R))},[C]),M=k.useCallbackRef((R,q)=>{E.current||(T(void 0),b?.(R,q))},[b]),v=a.useMemo(()=>e.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${j?.toCSS(h)??"transparent"}`,"& .activeColor":{fill:`${j?.toCSS(h)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[j,r,h]),D=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:h})},[n,w,x,j,p?.autoColor,h]),F={onQuickClick:t?D:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:P,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return f===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...F}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...F})})),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(B.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:f=>`${i?i.toRGBA(s).toString():f.palette.text.icon??f.palette.action.active}`},"& .style_grey":{stroke:f=>f.palette.text.icon??f.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:f,sx:p,...x}=l,u=k.useCallbackRef(s,[]),h=a.useCallback(b=>{const{popupContainer:w,floatReference:T,closeFloat:j,...E}=b,I=[],P=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<P.length;N++){const L=P[N];if(L.description==="None"&&!d)continue;const M=e.jsx(Fo,{styleColor:m,length:Qt,width:L.width,darkMode:f,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(B.Box,{sx:{marginRight:"6px"},children:L.description}),e.jsxs(B.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:D=>D.preventDefault(),onMouseUp:()=>{j(),u(L.style)},onKeyDown:D=>{D.which===k.KeyCodes.Enter&&j()},selected:L.style===g,parentFloat:T,children:v},N))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,g,f]),S=a.useMemo(()=>{const b=O.IBorder.BuiltInDefinitions.get(g);let w;return w=b.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Fo,{styleColor:m,length:Qt,width:b.width,dashArray:b.pattern,darkMode:f,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),e.jsx(B.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:h,...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:f,createTemporaryBorder:p,...x}=l,u=k.useCallbackRef(s,[s]),h=k.useCallbackRef(d,[d]),[S,y]=a.useState(),[C,b]=a.useState(),w=S??r,T=C??n,j=f||{bottom:{style:r,color:n?.toString()}},E=k.useCallbackRef(v=>{const D={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(D[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||D[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?D.left:null,F=A?D.top:null,R=A?D.right:null,q=A?D.bottom:null,Y=A?D.vertical:null,_=A?D.horizontal:null;let U="";return F||$||(U+="M 3,5 H 5 V 3 H 3 "),F||(U+="M 7,5 H 9 V 3 H 7 "),F||Y||(U+="M 11,5 h 2 V 3 h -2 "),F||(U+="M 15,5 h 2 V 3 h -2 "),F||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(B.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(B.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=D.top,Z.bottom=D.horizontal):(Z.top=D.horizontal,Z.bottom=D.bottom),W===0?(Z.left=D.left,Z.right=D.vertical):(Z.left=D.vertical,Z.right=D.right),p?.(Z)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[T,w,m]),I=a.useCallback((v,D,H)=>{let A=null;if(v&&v.length>0){let $=null;(D||H)&&($={style:H,color:D?.toString()??null}),A={};for(let F=0;F<v.length;F++)A[v[F]]=$}return A},[]),P=a.useCallback(v=>{u?.(v)},[]),N=a.useCallback(v=>{h?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:D,floatReference:H}=v,A=(R,q,Y="bottom",_=!1)=>{const U=I(R,T??null,_?O.IBorder.StrokeStyle.None:w??null),Q=_?I([],T??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:E(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:()=>{D(),N(U),P(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(B.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(B.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)]})]}),F=e.jsx(e.Fragment,{children:e.jsxs(B.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"):T,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:T,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[g?F:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),g?$:F]})},[w,T,n,t,m]),M=a.useMemo(()=>E(j),[j,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},D)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:D,children:v}),onQuickClick:()=>{u?.(j)},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:f,selectedBorder:p,onSelectBorder:x,darkMode:u,icon:h,label:S,...y}=l,C=k.useCommands(n,["formatBorder"]),b=t??C[0],w=b?.context()??null,T=w?.autoColor??g,j=w?.autoStyle??s,E=p??w?.quickBorder,I=u??w?.darkMode,P=f??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,D)=>{const{children:H,title:A,...$}=v;let F=v.children;return(b?.disabled()||m)&&(F=e.jsx("div",{children:F})),e.jsx(o.CommandTooltip,{command:b,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:D,...$,children:F})},[b,m]);return e.jsx(Dr,{ref:i,autoColor:T,darkMode:I,autoStrokeStyle:j,createTemporaryBorder:P,schemeLookup:N,selectedBorder:E,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...f,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:f,sx:p,...x}=l;k.useCommand(n);const u=()=>n?.state()?.toString()||"11",[h,S]=a.useState(u),y=k.useCallbackRef(()=>{const P=parseFloat(h);isNaN(P)?S(u()):parseFloat(u())!==P&&n.execute(P,t)},[u,n,h,t]);a.useEffect(()=>{S(u())},[n?.state()]);const C=a.useMemo(()=>{if(!t)return null;const P={...t};return delete P.beforeExecute,P},[t]),b=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>b?e.jsxs(B.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:P=>P.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]),T=G.useTheme(),j=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(T.typography.fontSize),T.typography.fontFamily).width}px`,[T]),E=a.useCallback(P=>{const{onMouseDown:N,onMouseUp:L,...M}=P;return e.jsx(B.IconButton,{component:"div",...M,disableRipple:!0,children:e.jsx(B.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:j,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:h,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)u()!==h&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===k.KeyCodes.Escape)u()!==h&&(S(u()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(h+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)}})})},[h,g,n]),I=a.useCallback(P=>{const N=D=>{n?.execute(D,t)},L=n?.state(),M=[];for(let D=0;D<m.length;D++){const H=m[D]===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[D])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[D])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[D]})},"fontSize-"+D))}const v=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...x,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:M})]});return o.defaultCreatePopupPanel({...P,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:P},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:P}),createQuickButton:E,...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(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.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],f=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(),T=[];for(let L=0;L<w.length;L++){let M="";if(b&&!b.isEmpty())try{M=b.getNumberFormat(w[L].numberFormat).displayText}catch(D){console.warn(D)}M===""&&w[L].formatType===O.NumberFormat.Type.General&&(M="No specific format");const v=w[L].formatType===f;T.push(e.jsx(Dn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:M,handleSetFormat:C,format:w[L]},w[L].formatType))}const j={numberFormat:"",formatType:O.NumberFormat.Type.Custom},E=f===O.NumberFormat.Type.Custom,I=e.jsx(Dn,{selected:E,disabled:m||!d||d.disabled(),formattedValue:E?b.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),y.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:j,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),P=e.jsxs(B.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(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[P,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:T}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),u=G.useTheme(),h=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(B.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:h},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:f})}),...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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...f,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,...f}=l,p=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],x=k.useCommands(n,p),{singleCommand:u,allDisabled:h}=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 T={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,{...T,command:b.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...T,command:x[0],icon:S.get(p[0])}),e.jsx(o.CommandButton,{...T,command:x[1],icon:S.get(p[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:x[2],icon:S.get(p[2])}),e.jsx(o.CommandButton,{...T,command:x[3],icon:S.get(p[3])}),w]});return o.defaultCreatePopupPanel({...C,children:j})},[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()),...f}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||h,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,{})),...f})})),$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,...f}=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]),h=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 T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftUp"),icon:h.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteCellsShiftLeft"),icon:h.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteRows"),icon:h.get("deleteRows")}),e.jsx(o.CommandButton,{...b,command:C.getCommand("deleteColumns"),icon:h.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...y,children:T})},[c,t,r,h]);return x?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:x,icon:h.get(x.key()),...f}):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,{})),...f})})),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:f,icon:p,...x}=l,{autoColor:u,schemeLookup:h,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,T=h??C?.schemeLookup,j=S??C?.recentColors,E=f??C?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:T,recentColors:j,darkMode:E,...y}),[w,T,j,E]),P=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:D,...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:P,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:E,...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((f,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:f.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({...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=d.getCommand("sortCustom"),x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...f,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),p?e.jsx(o.CommandButton,{...f,command:p,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...f,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 f={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...f,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...f,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:f,...p}=l,x=[n];!r&&c&&x.push("redo");const u=k.useCommands(f,x),h=u[0],S=u[1],y=m??h?.context?.()?.undoManager;let C=d;d||(C=!h||h.disabled(),S&&!S.disabled()&&(C=!1));const[b,w]=a.useState(0),T=a.useCallback((j,E)=>{let I=b===0?"Cancel":`${h.label()} ${b} Action${b===1?"":"s"}`,P=!1;y||(P=!0),P||(P=c?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const N=A=>{h.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:P?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(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(P)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:F=>{F.button===0&&F.preventDefault()},onMouseUp:F=>{F.button===0&&N(A+1)},onKeyDown:F=>{F.isDefaultPrevented()||F.keyCode!==k.KeyCodes.Enter&&F.keyCode!==k.KeyCodes.Space||N(A+1)},children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(B.Typography,{component:"div",children:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let D=null;if(!r&&c){const A={scope:"undo",commands:E,variant:k.CommandButtonType.Menuitem,parentFloat:j.floatReference};D=[],D.push(e.jsx(_o,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&D.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{j.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[D,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...j,children:H})},[h?.context(),h?.state(),g,y,b,C]);return e.jsx(o.CommandPopupButton,{ref:i,commands:f,quickCommand:n,scope:g,disabled:C,label:h?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${h?.label()??"No"} last actions.`})}),createPopupPanel:T,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 f=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(h=>{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(f)||y.unshift({key:f,description:f});const C=[];for(let w=0;w<y.length;w++){const T=y[w].key===f;C.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:T,disabled:c||!n||n.disabled(),icon:T?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:j=>{j.button===0&&S(y[w].key)},onMouseDown:j=>{j.button===0&&j.preventDefault()},onKeyDown:j=>{j.keyCode!==k.KeyCodes.Enter&&j.keyCode!==k.KeyCodes.Space||S(y[w].key)},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(B.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(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})});return o.defaultCreatePopupPanel({...h,children:b})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:u,createTooltip:({children:h},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:h}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:x},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:f})}),...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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},h=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:h})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:f,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},[]),f=a.useCallback((p,x)=>{const u={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},h=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:h})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:f,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((f,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({...f,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((f,p)=>{const x={variant:k.CommandButtonType.Menuitem,parentFloat:f.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({...f,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},f=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:f})},[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,...f}=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]),h=x.getInsets(),S=x.getFont(),y=a.useCallback(()=>x.getBorder(),[x]);return e.jsx(B.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:`${h.top}px ${h.right}px ${h.bottom}px ${h.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},...f,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(B.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(B.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:f,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:f,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:f||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return o.defaultCreatePopupPanel({...y,children:w})},[]),h=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${h?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:f,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,...f}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.named(),h=s??p?.bodyStyle(),S=k.useCallbackRef(T=>{m?.(T),t?.execute(T,r)},[t,m,r]),y=a.useCallback((T,j)=>{const E={onSelectNamed:S,styles:x(),parentFloat:T.floatReference},I=x().getCustomNamed(),P=new Map,N=[];for(let F=0;F<I.length;F++)P.set(I[F].getName(),I[F]),x().getNamed(I[F].getName()).getBuiltInID()===null&&N.push(I[F].getName());const L=F=>{let R=P.get(F);return R||(R=x().getNamed(F)),!R||R.isHidden()?null:e.jsx(Hl,{namedStyle:R,selectedNamed:u,bodyStyle:p.bodyStyle(),createTemporaryCell:p.createTemporaryCell,commands:n,commandHook:r,...E},F)},M=(F,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(B.Box,{children:[q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:F},F+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:Y},F+"-presets")]},F)},v=(F,R)=>{const q=[];for(let Y=0;Y<R.length;Y++){const _=L(R[Y]);_&&q.push(_)}return q.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:q},F+"-presets")},D=[];D.push(M("Custom",N,!1)),D.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)),D.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])),D.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])),D.push((A="Themed Cell Styles",$=H,e.jsxs(B.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),D.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(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:F=>`${F.shape.borderRadius}px`,paddingBottom:F=>`${F.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:D}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:u,command:j.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:g,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[u,x?.().getTheme(),h]),C=k.useCallbackRef(T=>{const j=18/O.IFont.getDeviceScale(),E=p?.createTemporaryCell(T);return E.getStyle().getFont().getSize()<=j?E:E.createTemporaryCell({style:{font:{size:j}}})},[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:T=>`1px solid ${T.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[u,h,b]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:y,outlined:d,commands:n,createTooltip:({children:T},j)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:j,children:T}),selected:!1,disabled:b,label:t?.label(),icon:w,...f})})),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:f=zl,isLive:p=!1,...x}=l,u=Math.ceil(1.3*f),[h,S]=a.useReducer(T=>T+1,0);a.useEffect(()=>{if(p&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,p]);const y=a.useMemo(()=>{let T=t?.toJSON()??{};const j={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return T&&(T.styleOptions={...T.styleOptions,name:r.getName()}),T.ref=j,new O.Table({initialAnchor:j,json:T,styles:n})},[h,t,r,n]),C=a.useMemo(()=>{const T=[];for(let j=0;j<5;j++)for(let E=0;E<5;E++){const I=y.getStyleAt({colIndex:E,rowIndex:j});T.push(I)}return T},[y]),b=a.useMemo(()=>{const T=(E,I,P)=>{let N=P.getFill().toCSS(c?.darkMode??!1);const L=u-(I<4?1:0),M=f-(E<4?1:0),v=P.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(u-1),top:E*(f-1),width:L,height:M},e.jsx("td",{className:`table-style-fill ${E}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${E}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(M-1)/2,borderTop:`1px solid ${v}`}})},`${E}-${I}`)},j=[];for(let E=0;E<5;E++){const I=[];for(let P=0;P<5;P++){const N=C[5*E+P];I.push(T(E,P,N))}j.push(e.jsx("tr",{children:I},E))}return j},[y,r,c]),w=a.useCallback((T,j)=>C[j].getBorder()??null,[C]);return e.jsx(B.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*(f-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*(f-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,...f}=l,p=a.useMemo(()=>{const h=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return h.styleOptions={...h.styleOptions,name:t.getName()},h.ref=S,new O.Table({initialAnchor:S,json:h,styles:r})},[n,t,r]),x=a.useMemo(()=>{const h=[];for(let S=0;S<5;S++)for(let y=0;y<5;y++){const C=p.getStyleAt({colIndex:y,rowIndex:S});h.push(C)}return h},[p]),u=a.useMemo(()=>{let h=d;if(d||(h=document.createElement("canvas")),!h)return null;h.width!==61&&(h.width=61),h.height!==46&&(h.height=46);const S=h.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 T=x[5*b+w].getFill();let j=c?.fill;T.getType()===O.IFill.Type.Solid?j=T.getColor().toCSS(C,!1):T.getType()===O.IFill.Type.Gradient?j=T.getStops[0]?.color.toCSS(C,!1):T.getType()===O.IFill.Type.Pattern&&(j=T.getForeground().toCSS(C,!1)),S.fillStyle=j;const E=w*y,I=9*b;S.fillRect(E,I,13,10)}S.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const T=x[5*b+w],j=w*y,E=9*b,I=T.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(C,!1),bt(S,j,E,j,E+9));const M=I.getTop();M.isNone()||(S.strokeStyle=M.getColor().toCSS(C,!1),bt(S,j,E,j+y,9*b));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(C,!1),bt(S,j+y,E,j+y,E+9));const D=I.getBottom();D.isNone()||(S.strokeStyle=D.getColor().toCSS(C,!1),bt(S,j,E+9,j+y,E+9))}S.strokeStyle=T.getFont().getFill().toCSS(C,!1);const P=4,N=2.5;bt(S,w*y+N,9*b+P,w*y+N+7,9*b+P)}return`url(${h.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},...f})})),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:f,disabled:p,...x}=l;return e.jsxs(B.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)}`},...f},...x,ref:i,children:[c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:p||r==null}),label:"Header Row",labelPlacement:"end"}),g&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>g(!m),disabled:p||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:p||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(B.FormControlLabel,{control:e.jsx(B.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:f,commandHook:p,useCanvasPreview:x=!0,canvas:u,...h}=l,S=a.useCallback(w=>{const T={variant:k.CommandButtonType.Menuitem,commandHook:p,context:"table"},j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...T,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:f,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...T,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:f,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:f}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...T,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:f||!n||n.isBuiltIn()})]}),E=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j})});return o.defaultCreatePopupPanel({...w,children:E})},[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:f,icon:null,onClick:()=>{r?.(n?.getName())},...h,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,...f}=l;k.useCommand(t);const p=t?.context(),x=p?.styles,u=c??p?.table?.();let h="insertTable";u&&(h="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(),T=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),j=a.useRef(null),E=a.useCallback((N,L)=>{const M={onSelectTableStyleName:T,styles:x(),parentFloat:N.floatReference};j.current||(j.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:j.current,...M},_):null},D=(_,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(B.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:_},_+"-header"),e.jsx(B.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(D("Custom",$,!1))}const F=[];u&&!u.getStyleOptions().name&&F.push(null);for(let _=0;_<21;_++)F.push("TableStyleLight"+(_+1));H.push(D("Light",F,$.length>0));const R=[];for(let _=0;_<28;_++)R.push("TableStyleMedium"+(_+1));H.push(D("Medium",R));const q=[];for(let _=0;_<11;_++)q.push("TableStyleDark"+(_+1));H.push(D("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(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:_=>`${_.shape.borderRadius}px`,paddingBottom:_=>`${_.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),Y]})},[x,x?.().getTheme(),w,C]),I=g||!t||t.disabled(),P=a.useMemo(()=>{if(!p||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[C,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:h,createPopupPanel:E,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:P,...f})})),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 f=[];for(let p=0;p<Ie.length;p++){const x=Ie[p];f.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:x,darkMode:t,selectedColor:null},p+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:p=>p.shadows[2]},children:f})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:f=>`solid ${r?f.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:f=>`solid ${f.palette.text.primary} 1px !important`}},icon:null,...g,children:e.jsxs(B.Box,{sx:{border:f=>`solid ${f.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:f=>r?f.palette.text.primary:void 0,"&:hover:not([disabled])":{color:f=>f.palette.text.primary}},children:[e.jsx(B.Box,{sx:{},children:i.getName()}),e.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,e.jsx(B.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 f=n?.getItems({selected:t})??[],p=[];if(f.length===0)return e.jsx(o.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});const x=f.length;for(let u=0;u<x;u++){const h=f[u],S=t&&h?.getName()===t.getName(),y=f[u+1];y&&y.isCustom()!==h.isCustom()&&p.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${u}`)),p.push(e.jsx(ea,{docTheme:h,onSelectTheme:()=>r(h),isSelected:S,disabled:m,darkMode:g,onMouseDown:C=>{C.button===0&&C.preventDefault()},onMouseUp:C=>{C.button===0&&r(h)},onKeyDown:C=>{C.keyCode!==k.KeyCodes.Enter&&C.keyCode!==k.KeyCodes.Space||r(h)}},h.getName()))}return p},[t,r,g]);return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:i,...s,children:e.jsxs(B.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(B.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:f,...p}=l,x=c||o.themeIcon(e.jsx(o.Theme2Icon,{})),u=a.useCallback(S=>{const{closeFloatAll:y}=S;return e.jsx(ta,{...f,themes:n,selectedTheme:t,onSelectTheme:r,darkMode:d,onKeyDown:C=>{C.which===k.KeyCodes.Enter&&y()}})},[n,t,r,f,d]),h={createPopupPanel:u,tooltip:m||g||"Theme",label:g,icon:x,...p};return s===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...h}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...h})})),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:f,...p}=l;k.useCommand(n);const x=n?.context()?.themes,u=r||n?.context()?.theme,h=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:T,title:j,...E}=b;let I=b.children;return(S||w)&&(I=e.jsx("div",{children:I})),e.jsx(o.CommandTooltip,{command:n,placement:f===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:S||w,...E,children:I})},[n,S]);return e.jsx(oa,{ref:i,themes:x,selectedTheme:u,onSelectTheme:y,variant:f===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:C,disabled:S,darkMode:h,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,f=B.useMediaQuery("(prefers-color-scheme: dark)"),p=s==="dark"||s===null&&f,x=k.useCallbackRef((u,h)=>{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:h.getCommand("defaultThemeMode"),icon:o.themeIcon(f?e.jsx(o.SystemDefaultDarkMode,{}):e.jsx(o.SystemDefaultLightMode,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:h.getCommand("enableDarkGrid")}),e.jsx(o.CommandButton,{...S,command:h.getCommand("enableDarkImages")})]});return o.defaultCreatePopupPanel({...u,children:y})},[c,g,t,r,f,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,f)=>{const p={variant:k.CommandButtonType.Menuitem,scope:"help",commandHook:{...t,beforeExecute:(u,h)=>t?.beforeExecute?.(u,h)!==!1&&d.floatReference.closeAll()},disabled:c},x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:f.getCommand("showKeyboardShortcuts"),icon:o.themeIcon(e.jsx(me.Keyboard,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:f.getCommand("gotoUrlGithub"),icon:o.themeIcon(e.jsx(o.GithubIcon,{}))}),e.jsx(o.CommandButton,{...p,command:f.getCommand("gotoUrlDiscord"),icon:o.themeIcon(e.jsx(o.DiscordIcon,{}))}),e.jsx(o.CommandButton,{...p,command:f.getCommand("gotoUrlDocumentation"),icon:o.themeIcon(e.jsx(o.DocumentationIcon,{}))}),e.jsx(o.CommandButton,{...p,command:f.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,f=k.useCommands(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:p,allDisabled:x}=a.useMemo(()=>{let h=null,S=0;for(let y=0;y<f.length;y++)f[y]&&!f[y]?.disabled()&&(m&&s===k.CommandButtonType.Menuitem&&(h=S===0?f[y]:null),S++);return{singleMenuCommand:h,allDisabled:S===0}},[f]),u=a.useCallback((h,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({...h,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]));a.memo(l=>{const{command:i,formulaFunction:n,commandHook:t,disabled:r=!1,parentFloat:c,handleInsert:m,icon:g,label:s,sx:d,...f}=l;return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...d},disabled:r,onMouseDown:p=>{p.button===0&&p.preventDefault()},onMouseUp:p=>{p.button===0&&m(n)},onKeyDown:p=>{p.keyCode===k.KeyCodes.Enter||(p.keyCode,k.KeyCodes.Space)},...f,children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(B.Typography,{component:"div",children:"Formula Function Here"})})})});const 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,f=k.useCommands(t,["insertFunction"])[0],p=a.useCallback((u,h)=>{const S=yo.get(n);if(!S)return console.warn("invalidate category",n),null;const y=e.jsx(Ul,{category:S.label,...u,commands:h});return o.defaultCreatePopupPanel({...u,children:y})},[n,f,r,c]),x=yo.get(n);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,createPopupPanel:p,label:x.label??"Insert Function",tooltip:x.label,icon:o.themeIcon(yo.get(n)?.icon??e.jsx(o.FormulaGroupIcon,{})),...d})}));ia.displayName="InsertFunctionCommandPopupButton";const Ul=a.memo(a.forwardRef((l,i)=>{const{commands:n,category:t,...r}=l,c=k.useCommands(n,["insertFunction"]),[m,g]=a.useState([]),[s,d]=a.useState(!1);a.useEffect(()=>{(async()=>{d(!0);const h=c[0]?.context(),S=await h.searchByCategory(t);g(S),d(!1)})()},[]);const f={variant:k.CommandButtonType.Menuitem,parentFloat:l.floatReference,scope:"scripts",shortcut:null},p=[],x=m.length;for(let h=0;h<x;h++){const S=m[h];p.push(e.jsx(o.CommandButton,{...f,command:n.getCommand("executeScript"),commandState:{declaration:S},tooltipProps:{description:`Insert ${S.getName()??"formula"}`},label:S.getName()??`Script '${S.getName()}'`},`formula-${S.getName()}-${h}`))}const u=e.jsx(B.Box,{ref:i,sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:p.length>0?e.jsx(e.Fragment,{children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:p})}):null});return o.defaultCreatePopupPanel({...r,children:u})})),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:f,onValidate:p,onKeyDown:x,...u}=l,h=ca(),S=s&&h?h.register(s,d):null,[y,C]=a.useState(""),[b,w]=a.useState(""),[T,j]=a.useState(g);a.useEffect(()=>{j(g),w("")},[g]);const E=k.useCallbackRef(M=>{let v="";try{j(M),p?.(M),f?.(M)}catch(D){v=D.message??"Invalid Name"}s&&h&&(v?h.setError(s,{message:v}):h.clearErrors(s)),w(v)},[g,p,f]),I=k.useCallbackRef(async M=>{M.keyCode===k.KeyCodes.Escape&&y!==g&&(E(y),h?.setValue(s,y),h?.clearErrors(s),M.stopPropagation()),x?.(M)},[x,y,g,h]),P=k.useCallbackRef(M=>{C(M.target.value??"")},[]),N=k.useCallbackRef(M=>{C(""),S?.onBlur(M)},[]),L=a.useCallback(M=>{E(M.target.value),S?.onChange(M)},[S]);return e.jsx(B.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(B.TextField,{label:"Name",placeholder:m,onFocus:P,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:T??"",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:f,resolvedAddress:p,...x}=l,u=ca(),h=n&&u?u.register(n,t):null,[S,y]=a.useState(""),[C,b]=a.useState(!1),[w,T]=a.useState(()=>zt(d));a.useEffect(()=>{T(zt(d)),y(""),n&&u&&u.clearErrors(n),b(!1)},[d]);const j=k.useCallbackRef(v=>{let D="";try{T(v);const H=zt(d),A=p(v);A.toString()!==H&&f?.(A)}catch{D="Invalid Range"}n&&u&&(D?u.setError(n,{message:D}):u.clearErrors(n)),y(D),b(!0)},[w,f,n,u]),E=k.useCallbackRef(async v=>{if(C&&v.keyCode===k.KeyCodes.Escape){const D=zt(d);T(D),y(""),b(!1),v.stopPropagation()}s?.(v)},[d,f,s,C]),I=k.useCallbackRef(v=>{h?.onBlur(v)},[h]),P=a.useCallback(v=>{j(v.target.value),h?.onChange(v)},[h]),[N,L]=a.useState(!1),M=a.useMemo(()=>e.jsx(B.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(B.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(B.TextField,{label:"Range",placeholder:"Enter Range",onBlur:I,disabled:r,error:!!S,inputRef:h?.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:P,onKeyDownCapture:E,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,f]=a.useState(null),p=a.useRef(0);le.useModelListener(n,{onViewChange:()=>{f(!0),p.current===0&&s(n.getView().getZoomScale())}}),a.useEffect(()=>{p.current=0,f(!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 P=I;I<100?P=Math.round(I/(10/9)+10):I>100&&(P=Math.round(3*I-200)),p.current=P,f(!0),s(P)},[n]),u=I=>{let P=I;return I<100?P=10/9*(I-10):I>100&&(P=(I+200)/3),P},h=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)))}),T=k.useMouseDownAndHoldListener(()=>x(u(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),j=G.useTheme(),E=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("100%",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]);return e.jsxs(B.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(B.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(B.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:h,max:200,marks:[{value:100}],onAnimationEnd:()=>f(!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,P)=>{Math.abs(P-100)<3?x(100):x(P)},valueLabelFormat:(I,P)=>`Zoom: ${Math.round(g)}%`}),e.jsx(o.SimpleTooltip,{disableInteractive:!0,title:"Zoom In",children:e.jsx(B.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():T(I)},children:e.jsx(me.Add,{})})}),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row"},children:[e.jsx(B.Box,{sx:{minWidth:"8px"}}),e.jsx(B.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:E},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=h=>h.preventDefault();return s.current?.addEventListener("wheel",u,{passive:!1}),()=>{s.current?.removeEventListener("wheel",u)}},[]);const d=k.useEditMode(),f=a.useMemo(()=>{const u=d.getMode();return u?.description?u.description:"Ready"},[d]),[p,x]=a.useState(!1);return e.jsxs(B.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(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:u=>u.palette.text.secondary},variant:"caption",children:f})}),m?e.jsx(B.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 _l(){return Nn?Fn:(Nn=1,Fn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Kl(){if(An)return Co;An=1;var l=_l();function i(){}function n(){}return n.resetWarningCache=i,Co=function(){function t(m,g,s,d,f,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=Kl()()),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,f,p){if(!s)return;const x={capture:!0,...p};s.addEventListener?s.addEventListener(d,f,x):s.attachEvent?s.attachEvent("on"+d,f):s["on"+d]=f},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 f=r(s,d,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:f}},Ce.createSVGTransform=function(s,d){return r(s,d,"")},Ce.getTouch=function(s,d){return s.targetTouches&&(0,l.findInArray)(s.targetTouches,f=>d===f.identifier)||s.changedTouches&&(0,l.findInArray)(s.changedTouches,f=>d===f.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 f=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(f.paddingTop),d-=(0,l.int)(f.paddingBottom),d},Ce.innerWidth=function(s){let d=s.clientWidth;const f=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(f.paddingLeft),d-=(0,l.int)(f.paddingRight),d},Ce.matchesSelector=t,Ce.matchesSelectorAndParentsTo=function(s,d,f){let p=s;do{if(t(p,d))return!0;if(p===f)return!1;p=p.parentNode}while(p);return!1},Ce.offsetXYFromParent=function(s,d,f){const p=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect(),x=(s.clientX+d.scrollLeft-p.left)/f,u=(s.clientY+d.scrollTop-p.top)/f;return{x,y:u}},Ce.outerHeight=function(s){let d=s.clientHeight;const f=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(f.borderTopWidth),d+=(0,l.int)(f.borderBottomWidth),d},Ce.outerWidth=function(s){let d=s.clientWidth;const f=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(f.borderLeftWidth),d+=(0,l.int)(f.borderRightWidth),d},Ce.removeClassName=g,Ce.removeEvent=function(s,d,f,p){if(!s)return;const x={capture:!0,...p};s.removeEventListener?s.removeEventListener(d,f,x):s.detachEvent?s.detachEvent("on"+d,f):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 f=new WeakMap,p=new WeakMap;return(function(x,u){if(!u&&x&&x.__esModule)return x;var h,S,y={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return y;if(h=u?p:f){if(h.has(x))return h.get(x);h.set(x,y)}for(const C in x)C!=="default"&&{}.hasOwnProperty.call(x,C)&&((S=(h=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,C))&&(S.get||S.set)?h(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=f,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(f(p,s[u])in x)return s[u];return""}function f(p,x){return x?`${x}${(function(u){let h="",S=!0;for(let y=0;y<u.length;y++)S?(h+=u[y].toUpperCase(),S=!1):u[y]==="-"?S=!0:h+=u[y];return h})(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(f){return(0,l.isFunction)(s[f])})),!!(0,l.isFunction)(s[n])&&s[n](d)}function r(s,d,f){let{x:p,y:x}=s,u=`translate(${p}${f},${x}${f})`;return d&&(u=`translate(${`${typeof d.x=="string"?d.x:d.x+f}`}, ${`${typeof d.y=="string"?d.y:d.y+f}`})`+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 f;if(m==="parent"?f=g.parentNode:f=g.getRootNode().querySelector(m),!(f instanceof d.HTMLElement))throw new Error('Bounds selector "'+m+'" could not find an element.');const p=f,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 ql(){if(Kn)return St;Kn=1,Object.defineProperty(St,"__esModule",{value:!0}),St.default=void 0;var l=(function(u,h){if(typeof WeakMap=="function")var S=new WeakMap,y=new WeakMap;return(function(C,b){if(!b&&C&&C.__esModule)return C;var w,T,j={__proto__:null,default:C};if(C===null||typeof C!="object"&&typeof C!="function")return j;if(w=b?y:S){if(w.has(C))return w.get(C);w.set(C,j)}for(const E in C)E!=="default"&&{}.hasOwnProperty.call(C,E)&&((T=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(C,E))&&(T.get||T.set)?w(j,E,T):j[E]=C[E]);return j})(u,h)})(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,h,S){return(h=(function(y){var C=(function(b,w){if(typeof b!="object"||!b)return b;var T=b[Symbol.toPrimitive];if(T!==void 0){var j=T.call(b,w);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)})(y,"string");return typeof C=="symbol"?C:C+""})(h))in u?Object.defineProperty(u,h,{value:S,enumerable:!0,configurable:!0,writable:!0}):u[h]=S,u}const d={start:"touchstart",move:"touchmove",stop:"touchend"},f={start:"mousedown",move:"mousemove",stop:"mouseup"};let p=f,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 h=this.findDOMNode();if(!h||!h.ownerDocument||!h.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:S}=h;if(this.props.disabled||!(u.target instanceof S.defaultView.Node)||this.props.handle&&!(0,t.matchesSelectorAndParentsTo)(u.target,this.props.handle,h)||this.props.cancel&&(0,t.matchesSelectorAndParentsTo)(u.target,this.props.cancel,h))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,T=(0,r.createCoreData)(this,b,w);(0,m.default)("DraggableCore: handleDragStart: %j",T),(0,m.default)("calling",this.props.onStart),this.props.onStart(u,T)!==!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 h=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(h==null)return;let{x:S,y}=h;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 h=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(h==null)return;let{x:S,y}=h;if(Array.isArray(this.props.grid)){let w=S-this.lastX||0,T=y-this.lastY||0;[w,T]=(0,r.snapToGrid)(this.props.grid,w,T),S=this.lastX+w,y=this.lastY+T}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=f,this.handleDragStart(u))),s(this,"onMouseUp",u=>(p=f,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:h}=u;(0,t.removeEvent)(h,f.move,this.handleDrag),(0,t.removeEvent)(h,d.move,this.handleDrag),(0,t.removeEvent)(h,f.stop,this.handleDragStop),(0,t.removeEvent)(h,d.stop,this.handleDragStop),(0,t.removeEvent)(u,d.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(h)}}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,h){if(u[h]&&u[h].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 Gl(){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(h,S){if(typeof WeakMap=="function")var y=new WeakMap,C=new WeakMap;return(function(b,w){if(!w&&b&&b.__esModule)return b;var T,j,E={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return E;if(T=w?C:y){if(T.has(b))return T.get(b);T.set(b,E)}for(const I in b)I!=="default"&&{}.hasOwnProperty.call(b,I)&&((j=(T=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,I))&&(j.get||j.set)?T(E,I,j):E[I]=b[I]);return E})(h,S)})(a),n=f(Pt()),t=f(Je),r=(function(){if(zn)return Vt.exports;function h(y){var C,b,w="";if(typeof y=="string"||typeof y=="number")w+=y;else if(typeof y=="object")if(Array.isArray(y)){var T=y.length;for(C=0;C<T;C++)y[C]&&(b=h(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="",T=arguments.length;b<T;b++)(y=arguments[b])&&(C=h(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=f(ql()),d=f(pa());function f(h){return h&&h.__esModule?h:{default:h}}function p(){return p=Object.assign?Object.assign.bind():function(h){for(var S=1;S<arguments.length;S++){var y=arguments[S];for(var C in y)({}).hasOwnProperty.call(y,C)&&(h[C]=y[C])}return h},p.apply(null,arguments)}function x(h,S,y){return(S=(function(C){var b=(function(w,T){if(typeof w!="object"||!w)return w;var j=w[Symbol.toPrimitive];if(j!==void 0){var E=j.call(w,T);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(w)})(C,"string");return typeof b=="symbol"?b:b+""})(S))in h?Object.defineProperty(h,S,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[S]=y,h}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:T,y:j}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[E,I]=(0,m.getBoundPosition)(this,w.x,w.y);w.x=E,w.y=I,w.slackX=this.state.slackX+(T-w.x),w.slackY=this.state.slackY+(j-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:T}=this.props.position;b.x=w,b.y=T}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:T,defaultClassNameDragged:j,position:E,positionOffset:I,scale:P,...N}=this.props;let L={},M=null;const v=!E||this.state.dragging,D=E||b,H={x:(0,m.canDragX)(this)&&v?this.state.x:D.x,y:(0,m.canDragY)(this)&&v?this.state.y:D.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,{[T]:this.state.dragging,[j]: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}=Gl();return Ct.exports=l,Ct.exports.default=l,Ct.exports.DraggableCore=i,Ct.exports}var Xn,Ut={};function Xl(){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(f,p){if(typeof f!="object"||f===null)return f;var x=f[Symbol.toPrimitive];if(x!==void 0){var u=x.call(f,p);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(f)})(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 h=c(u);if(h&&h.has(x))return h.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,h&&h.set(x,S),S})(a),i=ha(),n=Xl(),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,h=new WeakMap;return(c=function(S){return S?h:u})(x)}function m(){return m=Object.assign?Object.assign.bind():function(x){for(var u=1;u<arguments.length;u++){var h=arguments[u];for(var S in h)Object.prototype.hasOwnProperty.call(h,S)&&(x[S]=h[S])}return x},m.apply(this,arguments)}function g(x,u){var h=Object.keys(x);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(x);u&&(S=S.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),h.push.apply(h,S)}return h}function s(x){for(var u=1;u<arguments.length;u++){var h=arguments[u]!=null?arguments[u]:{};u%2?g(Object(h),!0).forEach(function(S){d(x,S,h[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(h)):g(Object(h)).forEach(function(S){Object.defineProperty(x,S,Object.getOwnPropertyDescriptor(h,S))})}return x}function d(x,u,h){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 T=w.call(C,b);if(typeof T!="object")return T;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:h,enumerable:!0,configurable:!0,writable:!0}):x[u]=h,x}function f(x,u){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,S){return h.__proto__=S,h},f(x,u)}var p=(function(x){var u,h;function S(){for(var C,b=arguments.length,w=new Array(b),T=0;T<b;T++)w[T]=arguments[T];return(C=x.call.apply(x,[this].concat(w))||this).handleRefs={},C.lastHandleRect=null,C.slack=null,C}h=x,(u=S).prototype=Object.create(h.prototype),u.prototype.constructor=u,f(u,h);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,T=w.minConstraints,j=w.maxConstraints,E=w.lockAspectRatio;if(!T&&!j&&!E)return[C,b];if(E){var I=this.props.width/this.props.height,P=C-this.props.width,N=b-this.props.height;Math.abs(P)>Math.abs(N*I)?b=C/I:C=b*I}var L=C,M=b,v=this.slack||[0,0],D=v[0],H=v[1];return C+=D,b+=H,T&&(C=Math.max(T[0],C),b=Math.max(T[1],b)),j&&(C=Math.min(j[0],C),b=Math.min(j[1],b)),this.slack=[D+(L-C),H+(M-b)],[C,b]},y.resizeHandler=function(C,b){var w=this;return function(T,j){var E=j.node,I=j.deltaX,P=j.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],D=E.getBoundingClientRect();w.lastHandleRect!=null&&(v==="w"&&(I+=D.left-w.lastHandleRect.left),M==="n"&&(P+=D.top-w.lastHandleRect.top)),w.lastHandleRect=D,v==="w"&&(I=-I),M==="n"&&(P=-P);var H=w.props.width+(N?I/w.props.transformScale:0),A=w.props.height+(L?P/w.props.transformScale:0),$=w.runConstraints(H,A);H=$[0],A=$[1];var F=H!==w.props.width||A!==w.props.height,R=typeof w.props[C]=="function"?w.props[C]:null;R&&!(C==="onResize"&&!F)&&(T.persist==null||T.persist(),R(T,{node:E,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 T=s({ref:b},typeof w.type=="string"?{}:{handleAxis:C});return l.cloneElement(w,T)},y.render=function(){var C=this,b=this.props,w=b.children,T=b.className,j=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 E=b.resizeHandles;b.transformScale;var I=(function(P,N){if(P==null)return{};var L,M,v={},D=Object.keys(P);for(M=0;M<D.length;M++)L=D[M],N.indexOf(L)>=0||(v[L]=P[L]);return v})(b,r);return(0,n.cloneElement)(w,s(s({},I),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(w.props.children,E.map(function(P){var N,L=(N=C.handleRefs[P])!=null?N:C.handleRefs[P]=l.createRef();return l.createElement(i.DraggableCore,m({},j,{nodeRef:L,key:"resizableHandle-"+P,onStop:C.resizeHandler("onResizeStop",P),onStart:C.resizeHandler("onResizeStart",P),onDrag:C.resizeHandler("onResize",P)}),C.renderResizeHandle(P,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 Yl(){if(Jn)return kt;Jn=1,kt.__esModule=!0,kt.default=void 0;var l=(function(u,h){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var S=m(h);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 h=new WeakMap,S=new WeakMap;return(m=function(y){return y?S:h})(u)}function g(){return g=Object.assign?Object.assign.bind():function(u){for(var h=1;h<arguments.length;h++){var S=arguments[h];for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(u[y]=S[y])}return u},g.apply(this,arguments)}function s(u,h){var S=Object.keys(u);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(u);h&&(y=y.filter(function(C){return Object.getOwnPropertyDescriptor(u,C).enumerable})),S.push.apply(S,y)}return S}function d(u){for(var h=1;h<arguments.length;h++){var S=arguments[h]!=null?arguments[h]:{};h%2?s(Object(S),!0).forEach(function(y){f(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 f(u,h,S){return(h=(function(y){var C=(function(b,w){if(typeof b!="object"||b===null)return b;var T=b[Symbol.toPrimitive];if(T!==void 0){var j=T.call(b,w);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)})(y,"string");return typeof C=="symbol"?C:String(C)})(h))in u?Object.defineProperty(u,h,{value:S,enumerable:!0,configurable:!0,writable:!0}):u[h]=S,u}function p(u,h){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,y){return S.__proto__=y,S},p(u,h)}var x=(function(u){var h,S;function y(){for(var C,b=arguments.length,w=new Array(b),T=0;T<b;T++)w[T]=arguments[T];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(j,E){var I=E.size;C.props.onResize?(j.persist==null||j.persist(),C.setState(I,function(){return C.props.onResize&&C.props.onResize(j,E)})):C.setState(I)},C}return S=u,(h=y).prototype=Object.create(S.prototype),h.prototype.constructor=h,p(h,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 T=C.onResizeStart,j=C.onResizeStop,E=C.draggableOpts,I=C.minConstraints,P=C.maxConstraints,N=C.lockAspectRatio,L=C.axis;C.width,C.height;var M=C.resizeHandles,v=C.style,D=C.transformScale,H=(function(A,$){if(A==null)return{};var F,R,q={},Y=Object.keys(A);for(R=0;R<Y.length;R++)F=Y[R],$.indexOf(F)>=0||(q[F]=A[F]);return q})(C,r);return l.createElement(n.default,{axis:L,draggableOpts:E,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:N,maxConstraints:P,minConstraints:I,onResizeStart:T,onResize:this.onResize,onResizeStop:j,resizeHandles:M,transformScale:D,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 Zl=(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=Yl().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:f,...p}=l,[x,u]=a.useState(null),[h,S]=a.useState(()=>r.getSelectedRanges().getCoords()),[y,C]=a.useState(!1),{reference:b}=o.useFloatStack({parentFloat:s?.parentFloat}),[w,T]=a.useState(()=>m||!r.getProtection().isStructureAllowed()),j=()=>x?.text??"",[E,I]=a.useState(j),P=k.useCallbackRef(()=>{if(b?.closeAll(),!E){const K=j();return I(j()),K}if(j()===E)return E;const U=E.trim().toLowerCase();if(U==="r"||U==="c")return E;try{const K=r.getRanges(E);if(K)return K.toString()}catch{}const Q=t.getByName(E);if(Q&&Q.getRanges())return E;let ee=null;try{const K=r.getRanges(E),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(E);w||K||(K=t.addReference(E,ee)),K&&u({text:K.getName()})}catch(K){I(j()),f.showMessage?.(K.message,{type:k.NotificationType.Error})}return null},[E,t,b,w]),N=k.useCallbackRef(()=>{if(r.isClosed())return;const U=[];for(let K=0;K<h.length;K++){const W=h[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,h]),[L,M]=a.useState(()=>t?.getItems()??null);le.useModelListener(t,{onCollectionChange(U){M(t.getItems()),N()},onClose(U){M([])}}),a.useEffect(()=>{I(j())},[x,h]);const[v,D]=a.useState(r?.getSelectedSheet());le.useModelListener(r,{onProtectionChange:U=>{T(m||!U.getProtection().isStructureAllowed())},onSheetsChange:U=>{D(U?.getSelectedSheet())},onViewChange(U){D(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()}),$()},[h,r,H]);const F=a.useRef(null),R=a.useCallback(U=>{const{onMouseDown:Q,onMouseUp:ee,...K}=U;return e.jsx(B.IconButton,{...K,sx:{...K?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:e.jsx(B.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:F},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:E,onFocus:W=>{W.target?.select()},onKeyDown:W=>{if(W.which===k.KeyCodes.Enter||W.which===k.KeyCodes.Tab){let Z=E;j()!==E&&(W.stopPropagation(),W.preventDefault(),Z=P()),Z?q(Z):c?.()}else if(W.which===k.KeyCodes.Escape)j()!==E?(I(j()),setTimeout(()=>{W.target?.select()},0),W.stopPropagation(),W.preventDefault()):c?.();else if(W.which===k.KeyCodes.Space)return void W.stopPropagation()},onBlur:()=>{I(j())},onChange:W=>{I(W.target.value)}})})},[E,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){f.showMessage?.(Q.message,{type:k.NotificationType.Error})}},[t,f,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],Ee=xe.getRanges();if(!Ee||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:!Ee||g,icon:Se=>(Se.key(),o.themeIcon(e.jsx(o.InsertTableIcon,{})))}))}const be=e.jsxs(B.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(B.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){F.current?.focus(U)}}),[]);return e.jsx(B.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 Jl=(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=Jl,disabled:d,commands:f,...p}=l,[x,u]=a.useState(t?.getSelectedSheet());le.useModelListener(t,{onSheetsChange:W=>{u(W?.getSelectedSheet())},onViewChange(W){u(W?.getSelectedSheet())}});const[h,S]=a.useState(x.getSelection().getCoords().cell),y=x.getRange(h).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 T=b.current?.getLineHeight()??20,[j,E]=a.useState(T),[I,P]=a.useState(5),[N,L]=a.useState(1),M=k.useCallbackRef((W,{size:Z})=>{W.preventDefault(),W.stopPropagation();const ne=Math.floor(Z.height/T);E(ne*T+1),ne>1&&P(ne)},[T]),v=k.useCallbackRef((W,{size:Z})=>{const ne=Math.floor(Z.height/T);L(ne)},[T]),D=k.useEditMode(),H=D.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(h).getCell())),e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:e.jsx(le.SheetCellEditor,{ref:b,activeCoords:h,sheet:x,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:h})},defaultTextStyle:w,useRichStyling:!1,disabled:C,onChangeEdit:Z=>{if(Z.dirty!==void 0){const ne={sheet:x,coords:h,editState:Z};D.setMode(be=>({...be,args:{...be?.args,stateAndCoords:ne}}))}},editState:W,commands:f,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:N})})},[x,A,h,N,r]),F=a.useRef(null),R=a.useMemo(()=>m?s({names:t.getNames(),workbook:t,...g},F):null,[s,g,m,x,t,C]),q=a.useMemo(()=>e.jsxs(B.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(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:W=>W.spacing(.5),alignItems:"start"},children:[q,e.jsxs(B.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(B.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(Zl.ResizableBox,{height:j,draggableOpts:{grid:[T,T]},minConstraints:[T,T],maxConstraints:[15*T,15*T],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;E(W*T+1),L(W)}}),e.jsx(B.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,T]),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:()=>F.current}),[]);return e.jsx(B.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]),f=a.useMemo(()=>({...s,...d,variant:k.CommandButtonType.Menuitem}),[s,d]),p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:t.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...f,command:t.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,command:t.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),[]]});return e.jsx(B.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:f,selectedIndex:p,dragging:x,borderColor:u,borderWidth:h,activeColor:S,background:y="white",tabRadius:C=4,gridTheme:b,...w}=l,[T,j]=a.useState(()=>!!t&&t.getProtection().isLocked()),[E,I]=a.useState(()=>t?t.getTabColor():null);le.useModelListener(t,{onProtectionChange:()=>{j(t.getProtection().isLocked())},onTabColorChange:()=>{I(t.getTabColor())},onStyleChange:()=>{I(t.getTabColor())}});const P=G.useTheme(),N=p===g;let L=null,M=null;if(E||x){let H=y;E?(M=E.toBlackOrWhite().toCSS(),H=E?.toCSS()):N||(H=P.palette.background.paper),L=e.jsx(B.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&&E?`linear-gradient(0deg, ${H} 0%, transparent)`:H}})}let v=null;typeof u=="string"?v=u:u?.toCSS&&(v=u.toCSS());const D=N?e.jsx(B.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??P:P,children:e.jsx(B.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(B.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:f,disableRipple:s,component:"div",children:e.jsxs(e.Fragment,{children:[L,e.jsxs(B.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:N?void 0:"1px"},children:[n,D]}),T?e.jsx(me.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):e.jsx(B.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:f,...p}=l,[x,u]=a.useState(n?.getProtection());le.useModelListener(n,{onProtectionChange:b=>{u(b?.getProtection())}});const h=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(()=>({...h,...S}),[h,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(()=>{f?.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(B.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()),[f,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=[],h=n.getSheets().getItems({visibility:O.ISheet.Visibility.Hidden}),S=n.getSelectedSheet();for(let y=0;y<h.length;y++){const C=h[y],b=C.getVisibility();if(b===O.ISheet.Visibility.VeryHidden)continue;const w=S===C,T=C.getProtection().isLocked(),j=C.getTabColor(),E=t?.body.fill??"transparent";let I=null,P=null,N=E;j&&(N=j.toCSS(),w||(P=j.toBlackOrWhite().toCSS()),I=e.jsx(B.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(B.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===O.ISheet.Visibility.Hidden?"50%":"100%",border:M=>w?`${E} solid 1.5px`:`${M.palette.divider} solid 1px`,background:w&&j?`linear-gradient(0deg, ${N} 0%, ${E})`:N,borderRadius:"4px"}})}));let L=null;T&&(L=e.jsx(me.Lock,{color:"secondary"})),b!==O.ISheet.Visibility.Visible&&(L=o.themeIcon(e.jsx(o.VisibilityOffIcon,{style:{opacity:f.isStructureAllowed()?1:.7},color:"secondary"}))),L&&(L=e.jsx(B.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:!f.isStructureAllowed()&&b===O.ISheet.Visibility.Hidden,sx:{color:M=>{let v=w?M.palette.primary.main:M.palette.text.secondary;return P&&(v=P),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(B.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[e.jsxs(B.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[C.getName(),e.jsx(B.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:C.getName()})]}),L]})]})},""+y))}return u},[n,f,s,r,t]);return e.jsx(B.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().updateStyle({ fill: 'accent4' })":{Summary:"Set fill to theme color 4."},"SheetXL.getRange('E:L').updateStyle({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:"Set some columns to a modified theme color."},"SheetXL.getRange('e5:f10').updateStyle({ 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).updateStyle({ 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').updateStyle({ 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`}))},Di=function(){return a.createElement(so,null,a.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Fi=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`}))},Ni=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(Pi,null),warning:a.createElement(Di,null),error:a.createElement(Fi,null),info:a.createElement(Ni,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Ua,transitionDuration:{enter:225,exit:195}},Ai=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(f,p){return p.some(function(x){return typeof f===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 Oi="notistack-SnackbarContainer",Li="notistack-Snackbar",_a="notistack-CollapseWrapper",Hi="notistack-MuiContent",zi=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 f=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=f+"px",d.style.transitionTimingFunction=u||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Va(d);var f=no({timeout:175,mode:"exit"}),p=f.duration,x=f.easing;d.style.transitionDuration=typeof p=="string"?p:p+"ms",d.style.height=Ro,d.style.transitionTimingFunction=x||""},nodeRef:m,timeout:175},function(d,f){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"})},f),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"},Wi=function(l){return"anchorOrigin"+un(l)},Vi=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)}},Vi)}var $i=typeof window<"u"?a.useLayoutEffect:a.useEffect;function Cr(l){var i=a.useRef(l);return $i(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,f=l.SnackbarProps,p=f===void 0?{}:f,x=a.useRef(),u=Cr(function(){g&&g.apply(void 0,arguments)}),h=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&&h(r),function(){x.current&&clearTimeout(x.current)}},[d,r,h]);var S=function(){x.current&&clearTimeout(x.current)},y=a.useCallback(function(){r!=null&&h(.5*r)},[r,h]);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(Li,t),onMouseEnter:function(C){p.onMouseEnter&&p.onMouseEnter(C),S()},onMouseLeave:function(C){p.onMouseLeave&&p.onMouseLeave(C),y()}}),n)});qa.displayName="Snackbar";var Ui=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(Ui.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,f=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(Hi,zi(m),Tt.root,Tt[m],d,!g&&f&&Tt.lessPadding)},a.createElement("div",{id:Sr,className:Tt.message},g?null:f,t),p&&a.createElement("div",{className:Tt.action},p))});Ga.displayName="MaterialDesignContent";var Bt,Po,Xt,Yt,Do,_i=a.memo(Ga),Ki=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),qi=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(P){return!P})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var g,s=l.snack,d=l.classes,f=l.Component,p=f===void 0?_i:f,x=a.useMemo(function(){return(function(P){P===void 0&&(P={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(P).filter(function(L){return!N[L]}).reduce(function(L,M){var v;return he({},L,((v={})[M]=P[M],v))},{})})(d)},[d]),u=s.open,h=s.SnackbarProps,S=s.TransitionComponent,y=s.TransitionProps,C=s.transitionDuration,b=s.disableWindowBlurListener,w=s.content,T=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),j=he({direction:(g=T.anchorOrigin,g.horizontal!=="center"?yr[g.horizontal]:yr[g.vertical]),timeout:C},y),E=w;typeof E=="function"&&(E=E(T.id,T.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(P,N){var L;return he({},P,((L={})[N]=Rt([l.snack[N],l[N]],T.id),L))},{});return a.createElement(Ka,{in:t,onExited:I.onExited},a.createElement(qa,{open:u,id:T.id,disableWindowBlurListener:b,autoHideDuration:T.autoHideDuration,className:$e(Ki.wrappedRoot,x.root,x[Wi(T.anchorOrigin)]),SnackbarProps:h,onClose:c},a.createElement(S,Object.assign({},j,{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)}],T.id)}),E||a.createElement(p,Object.assign({},T)))))},Et={default:20},Zt={default:6,dense:2},wr="."+_a,Jt=Nt({root:(Bt={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"},Bt[wr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Bt.maxWidth="calc(100% - "+2*Et.default+"px)",Bt[Io]={width:"100%",maxWidth:"calc(100% - 32px)"},Bt),rootDense:(Po={},Po[wr]={padding:Zt.dense+"px 0px"},Po),top:{top:Et.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Et.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Et.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Io]={left:"16px"},Xt),right:(Yt={right:Et.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Io]={right:"16px"},Yt),center:(Do={left:"50%",transform:"translateX(-50%)"},Do[eo]={alignItems:"center"},Do)}),Gi=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Oi,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+un(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Xi=a.memo(Gi),kr=function(l){return!(typeof l=="string"||a.isValidElement(l))},Yi=(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,f=Ft(m,["key","preventDuplicate"]),p=Kt(s),x=p?s:new Date().getTime()+Math.random(),u=Ai(f,t.props),h=he({id:x},f,{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,f.className)});return h.persist&&(h.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,[h])}))}),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,f=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:f.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,f=d===void 0?{}:d,p=r.classes,x=this.state.snacks.reduce(function(h,S){var y,C=un(S.anchorOrigin),b=h[C]||[];return he({},h,((y={})[C]=[].concat(b,[S]),y))},{}),u=Object.keys(x).map(function(h){var S=x[h],y=S[0];return a.createElement(Xi,{key:h,dense:s,anchorOrigin:y.anchorOrigin,classes:p},S.map(function(C){return a.createElement(qi,{key:C.id,snack:C,classes:p,Component:f[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 Zi=[{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}],Ji=[{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=Zi,n=Ji){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(),[f,p]=a.useState(!1),x=a.useCallback(()=>{p(S=>!S)},[]),u=a.useCallback(()=>{s(n)},[n,s]);let h=c?.message;return!h&&a.isValidElement(t)&&(h=t),h||typeof t!="string"||(h=t),h||(h=`Unknown Error: ${t}`),e.jsx(hn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(B.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(B.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(B.Typography,{variant:"body2",component:"div",className:Le.typography,children:h}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:f}),onClick:x,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(B.IconButton,{size:"small",className:Le.expand,onClick:u,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(B.Collapse,{in:f,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 f={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...f,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:x=>{const u={...f,parentFloat:x.floatReference,scope:"saveWorkbook"},h=[];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?h.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:h,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 Qi=e.jsx(o.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(B.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=Qi,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:g=!0,...s}=l,{reference:d}=o.useFloatStack(),[f,{width:p}]=pt(),x=p<530,u=m?e.jsx(Ja,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,h=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(B.Box,{ref:Dt([y,f,i]),...s,children:Ma({commands:n,renderCompact:x,workbook:t,selectWrapper:C=>e.jsxs(B.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(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:b=>b.spacing(.5)},children:[r,e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:b=>b.spacing(.25)},children:[u,C]})]}),e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!h?"0 0 auto":"1 1 100%"},children:h})]}),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:f,importExportDisabled:p,themeOptions:x}=l,u=Xa(),h=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}))},[]),T={},j=o.useLazyWindow(T),E=o.useOptionsDialog(T),I=o.useInputDialog(T),P=a.useRef(new Set),N=a.useMemo(()=>{const $=(F,R)=>{if(R?.onceKey){if(P.current.has(R.onceKey))return;const Y=new Set(P.current);Y.add(R.onceKey),P.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(B.IconButton,{onClick:()=>S(Y),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(q,R.enqueueProps),F||console.log("message is 'null'",R),h(F??"Alert",q)};return{showMessage:$,showBusy:(F,R)=>{let q=null;const Y=new Promise(_=>{q=_});return C(_=>{const U=new Map(_.starting);return U.set(Y,q),{..._,label:F,starting:U}}),Y},showWindow:(F,R,q)=>{const Y={...R,onKeyDown:_=>{f?.dispatchToFocusedCommand(_),_.isDefaultPrevented()||_.isPropagationStopped()||R?.onKeyDown?.(_)}};return j(F,{sort:()=>Promise.resolve().then(()=>require("./2jMsSveHxIeW9vc-.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./CH1F9benjH9bHO_7.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./3XmMvO6_kJ7FXT7X.cjs")),comments:()=>Promise.resolve().then(()=>require("./Ckb0CwUnJxeHWWDK.cjs")),find:()=>Promise.resolve().then(()=>require("./5otKot37H6vcYOUU.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./nko0JKeI81_5dAMe.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./BfFOZEWQLNDtV64Z.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./Ch_6Tr0DuGgUaQZJ.cjs"))}[F],Y,q)},showOptions:E,showInputOptions:I,showError:F=>{let R,q=k.NotificationType.Error,Y="Unknown Error";typeof F=="string"?Y=F:F instanceof Error&&(R=F,F.message&&(Y=F.message)),F instanceof Fe.PartialError&&(q=k.NotificationType.Info),$(Y,{type:q,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),M=($=>{const{workbook:F,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(Pi,null),warning:a.createElement(Di,null),error:a.createElement(Fi,null),info:a.createElement(Ni,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Ua,transitionDuration:{enter:225,exit:195}},Ai=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(f,p){return p.some(function(x){return typeof f===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 Oi="notistack-SnackbarContainer",Li="notistack-Snackbar",_a="notistack-CollapseWrapper",Hi="notistack-MuiContent",zi=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 f=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=f+"px",d.style.transitionTimingFunction=u||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Va(d);var f=no({timeout:175,mode:"exit"}),p=f.duration,x=f.easing;d.style.transitionDuration=typeof p=="string"?p:p+"ms",d.style.height=Ro,d.style.transitionTimingFunction=x||""},nodeRef:m,timeout:175},function(d,f){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"})},f),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"},Wi=function(l){return"anchorOrigin"+un(l)},Vi=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)}},Vi)}var $i=typeof window<"u"?a.useLayoutEffect:a.useEffect;function Cr(l){var i=a.useRef(l);return $i(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,f=l.SnackbarProps,p=f===void 0?{}:f,x=a.useRef(),u=Cr(function(){g&&g.apply(void 0,arguments)}),h=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&&h(r),function(){x.current&&clearTimeout(x.current)}},[d,r,h]);var S=function(){x.current&&clearTimeout(x.current)},y=a.useCallback(function(){r!=null&&h(.5*r)},[r,h]);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(Li,t),onMouseEnter:function(C){p.onMouseEnter&&p.onMouseEnter(C),S()},onMouseLeave:function(C){p.onMouseLeave&&p.onMouseLeave(C),y()}}),n)});qa.displayName="Snackbar";var Ui=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(Ui.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,f=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(Hi,zi(m),Tt.root,Tt[m],d,!g&&f&&Tt.lessPadding)},a.createElement("div",{id:Sr,className:Tt.message},g?null:f,t),p&&a.createElement("div",{className:Tt.action},p))});Ga.displayName="MaterialDesignContent";var Bt,Po,Xt,Yt,Do,_i=a.memo(Ga),Ki=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),qi=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(P){return!P})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var g,s=l.snack,d=l.classes,f=l.Component,p=f===void 0?_i:f,x=a.useMemo(function(){return(function(P){P===void 0&&(P={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(P).filter(function(L){return!N[L]}).reduce(function(L,M){var v;return he({},L,((v={})[M]=P[M],v))},{})})(d)},[d]),u=s.open,h=s.SnackbarProps,S=s.TransitionComponent,y=s.TransitionProps,C=s.transitionDuration,b=s.disableWindowBlurListener,w=s.content,T=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),j=he({direction:(g=T.anchorOrigin,g.horizontal!=="center"?yr[g.horizontal]:yr[g.vertical]),timeout:C},y),E=w;typeof E=="function"&&(E=E(T.id,T.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(P,N){var L;return he({},P,((L={})[N]=Rt([l.snack[N],l[N]],T.id),L))},{});return a.createElement(Ka,{in:t,onExited:I.onExited},a.createElement(qa,{open:u,id:T.id,disableWindowBlurListener:b,autoHideDuration:T.autoHideDuration,className:$e(Ki.wrappedRoot,x.root,x[Wi(T.anchorOrigin)]),SnackbarProps:h,onClose:c},a.createElement(S,Object.assign({},j,{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)}],T.id)}),E||a.createElement(p,Object.assign({},T)))))},Et={default:20},Zt={default:6,dense:2},wr="."+_a,Jt=Nt({root:(Bt={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"},Bt[wr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Bt.maxWidth="calc(100% - "+2*Et.default+"px)",Bt[Io]={width:"100%",maxWidth:"calc(100% - 32px)"},Bt),rootDense:(Po={},Po[wr]={padding:Zt.dense+"px 0px"},Po),top:{top:Et.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Et.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Et.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Io]={left:"16px"},Xt),right:(Yt={right:Et.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Io]={right:"16px"},Yt),center:(Do={left:"50%",transform:"translateX(-50%)"},Do[eo]={alignItems:"center"},Do)}),Gi=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Oi,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+un(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Xi=a.memo(Gi),kr=function(l){return!(typeof l=="string"||a.isValidElement(l))},Yi=(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,f=Ft(m,["key","preventDuplicate"]),p=Kt(s),x=p?s:new Date().getTime()+Math.random(),u=Ai(f,t.props),h=he({id:x},f,{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,f.className)});return h.persist&&(h.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,[h])}))}),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,f=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:f.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,f=d===void 0?{}:d,p=r.classes,x=this.state.snacks.reduce(function(h,S){var y,C=un(S.anchorOrigin),b=h[C]||[];return he({},h,((y={})[C]=[].concat(b,[S]),y))},{}),u=Object.keys(x).map(function(h){var S=x[h],y=S[0];return a.createElement(Xi,{key:h,dense:s,anchorOrigin:y.anchorOrigin,classes:p},S.map(function(C){return a.createElement(qi,{key:C.id,snack:C,classes:p,Component:f[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 Zi=[{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}],Ji=[{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=Zi,n=Ji){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(),[f,p]=a.useState(!1),x=a.useCallback(()=>{p(S=>!S)},[]),u=a.useCallback(()=>{s(n)},[n,s]);let h=c?.message;return!h&&a.isValidElement(t)&&(h=t),h||typeof t!="string"||(h=t),h||(h=`Unknown Error: ${t}`),e.jsx(hn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(B.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(B.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(B.Typography,{variant:"body2",component:"div",className:Le.typography,children:h}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:f}),onClick:x,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(B.IconButton,{size:"small",className:Le.expand,onClick:u,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(B.Collapse,{in:f,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 f={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...f,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...f,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...f,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:x=>{const u={...f,parentFloat:x.floatReference,scope:"saveWorkbook"},h=[];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?h.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:h,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 Qi=e.jsx(o.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(B.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=Qi,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:g=!0,...s}=l,{reference:d}=o.useFloatStack(),[f,{width:p}]=pt(),x=p<530,u=m?e.jsx(Ja,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(C,b,w){}}}):null,h=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(B.Box,{ref:Dt([y,f,i]),...s,children:Ma({commands:n,renderCompact:x,workbook:t,selectWrapper:C=>e.jsxs(B.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(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:b=>b.spacing(.5)},children:[r,e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:b=>b.spacing(.25)},children:[u,C]})]}),e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!h?"0 0 auto":"1 1 100%"},children:h})]}),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:f,importExportDisabled:p,themeOptions:x}=l,u=Xa(),h=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}))},[]),T={},j=o.useLazyWindow(T),E=o.useOptionsDialog(T),I=o.useInputDialog(T),P=a.useRef(new Set),N=a.useMemo(()=>{const $=(F,R)=>{if(R?.onceKey){if(P.current.has(R.onceKey))return;const Y=new Set(P.current);Y.add(R.onceKey),P.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(B.IconButton,{onClick:()=>S(Y),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(q,R.enqueueProps),F||console.log("message is 'null'",R),h(F??"Alert",q)};return{showMessage:$,showBusy:(F,R)=>{let q=null;const Y=new Promise(_=>{q=_});return C(_=>{const U=new Map(_.starting);return U.set(Y,q),{..._,label:F,starting:U}}),Y},showWindow:(F,R,q)=>{const Y={...R,onKeyDown:_=>{f?.dispatchToFocusedCommand(_),_.isDefaultPrevented()||_.isPropagationStopped()||R?.onKeyDown?.(_)}};return j(F,{sort:()=>Promise.resolve().then(()=>require("./CybaPr_tDqBYYm7l.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./Dy8tMdAvieDNFyNN.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./D11dQP9ASVFsBy2m.cjs")),comments:()=>Promise.resolve().then(()=>require("./P_MTTr3k6LbqArTi.cjs")),find:()=>Promise.resolve().then(()=>require("./BMUK7WDOHjdCTlnL.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./DSWZ0c6YrATHKT05.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./BK-SPf2iAdtY2v2r.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./NYv7o9QPsXmI71mF.cjs"))}[F],Y,q)},showOptions:E,showInputOptions:I,showError:F=>{let R,q=k.NotificationType.Error,Y="Unknown Error";typeof F=="string"?Y=F:F instanceof Error&&(R=F,F.message&&(Y=F.message)),F instanceof Fe.PartialError&&(q=k.NotificationType.Info),$(Y,{type:q,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),M=($=>{const{workbook:F,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,F]),Ee=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,F,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."},()=>{Ee(F,null,X).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${X.key}`;re.push(new k.Command(ie,se,ue,je=>{Ee(F,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:F.isDate1904(),...F.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=F.findValidSheetName(ie);await F.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await F.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else F?.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")})]},[F,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("./BbzapT5WI3CiGf1M.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:f,requestWorkbookTitle:$=>new Promise(F=>{r.current?r.current.requestWorkbookTitle((R,q)=>{F(R)},{selectAll:!0,requestReason:$}):F(g)}),themeOptions:x,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{y.starting.size<=0||!y.isMounted||C($=>{const F=new Map($.running);return $.starting.forEach((R,q)=>{const Y=()=>{C(_=>{const U=new Map(_.running);return U.delete(q),{..._,running:U}})};F.set(q,Y),R(Y)}),{...$,starting:new Map,running:F}})},[y]);const[v,D]=a.useState(null);a.useEffect(()=>{y.starting.size!==0||y.running.size!==0?D(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"}})):D(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:f,createWorkbookOptions:p,onWorkbookChange:x,logo:u,importExportDisabled:h=!1,themeOptions:S,autoFocus:y=!1,commands:C,title:b,onTitleChange:w,titleProps:T,renderLoadingPanel:j,...E}=l,I=a.useRef(null),P=k.useCallbackRef(x,[x]),N=k.useCallbackRef(w??T?.onTitleChange,[w??T?.onTitleChange]),L=T?.placeHolder??"Untitled",M=S?.mode,{themeMode:v,source:D}=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,[$,F]=a.useState(null);a.useEffect(()=>{F(g??new Fe.UndoManager)},[g]);const[R,q]=a.useState(null),[Y,_]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!f||Object.keys(f).length===0&&!Fe.CommonUtils.isPromiseLike(f)){const X={theme:U.getDefaultTheme(),...p};_(new O.Workbook(X))}else _(f)},[f]),a.useLayoutEffect(()=>{if(Y){if(Y instanceof O.Workbook)return q({workbook:Y}),void(f!==Y&&P?.(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,P?.(X),q({workbook:X})}catch(X){P?.(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??T?.title??"");a.useEffect(()=>{Z(b??T?.title??"")},[b??T?.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 Ee=a.useRef(null),se=a.useCallback(X=>{let te=null;return T?.hidden||(te=e.jsx(mn,{...T,style:{maxWidth:"100%",...T?.style},workbook:I.current,ref:Ee,title:W,placeHolder:L,onTitleChange:ue=>{Z(ue)}})),e.jsx(Qa,{...X,logo:u,mainElement:te,showFileMenu:!h,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[u,W,T,H,h,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(B.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:j?.(X)??e.jsx(o.LoadingPanel,{...X})})},[t,r,j]),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:j,gridTheme:te,headersTheme:X,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...E},"WorkbookElement")},[R,W,$,Se,j,H,E,se,J]);let ae=e.jsx(ki,{fallbackRender:z,children:e.jsx(Yi,{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(B.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:h,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Z,refWorkbookTitle:Ee,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(B.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const es=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=Br,exports.TextRotateCommandButton=Er,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,F]),Ee=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,F,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."},()=>{Ee(F,null,X).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${X.key}`;re.push(new k.Command(ie,se,ue,je=>{Ee(F,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:F.isDate1904(),...F.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=F.findValidSheetName(ie);await F.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await F.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else F?.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")})]},[F,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("./LeRvKTH-iRno1m6n.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:f,requestWorkbookTitle:$=>new Promise(F=>{r.current?r.current.requestWorkbookTitle((R,q)=>{F(R)},{selectAll:!0,requestReason:$}):F(g)}),themeOptions:x,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{y.starting.size<=0||!y.isMounted||C($=>{const F=new Map($.running);return $.starting.forEach((R,q)=>{const Y=()=>{C(_=>{const U=new Map(_.running);return U.delete(q),{..._,running:U}})};F.set(q,Y),R(Y)}),{...$,starting:new Map,running:F}})},[y]);const[v,D]=a.useState(null);a.useEffect(()=>{y.starting.size!==0||y.running.size!==0?D(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"}})):D(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:f,createWorkbookOptions:p,onWorkbookChange:x,logo:u,importExportDisabled:h=!1,themeOptions:S,autoFocus:y=!1,commands:C,title:b,onTitleChange:w,titleProps:T,renderLoadingPanel:j,...E}=l,I=a.useRef(null),P=k.useCallbackRef(x,[x]),N=k.useCallbackRef(w??T?.onTitleChange,[w??T?.onTitleChange]),L=T?.placeHolder??"Untitled",M=S?.mode,{themeMode:v,source:D}=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,[$,F]=a.useState(null);a.useEffect(()=>{F(g??new Fe.UndoManager)},[g]);const[R,q]=a.useState(null),[Y,_]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!f||Object.keys(f).length===0&&!Fe.CommonUtils.isPromiseLike(f)){const X={theme:U.getDefaultTheme(),...p};_(new O.Workbook(X))}else _(f)},[f]),a.useLayoutEffect(()=>{if(Y){if(Y instanceof O.Workbook)return q({workbook:Y}),void(f!==Y&&P?.(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,P?.(X),q({workbook:X})}catch(X){P?.(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??T?.title??"");a.useEffect(()=>{Z(b??T?.title??"")},[b??T?.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 Ee=a.useRef(null),se=a.useCallback(X=>{let te=null;return T?.hidden||(te=e.jsx(mn,{...T,style:{maxWidth:"100%",...T?.style},workbook:I.current,ref:Ee,title:W,placeHolder:L,onTitleChange:ue=>{Z(ue)}})),e.jsx(Qa,{...X,logo:u,mainElement:te,showFileMenu:!h,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[u,W,T,H,h,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(B.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:j?.(X)??e.jsx(o.LoadingPanel,{...X})})},[t,r,j]),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:j,gridTheme:te,headersTheme:X,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...E},"WorkbookElement")},[R,W,$,Se,j,H,E,se,J]);let ae=e.jsx(ki,{fallbackRender:z,children:e.jsx(Yi,{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(B.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:h,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Z,refWorkbookTitle:Ee,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(B.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const es=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=Br,exports.TextRotateCommandButton=Er,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;