@sheetxl/studio-mui 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{X9sJMKafafBPpNpK.cjs → 3eFeaOE8BdZL1wxv.cjs} +1 -1
- package/browser/cjs/{Cq2L49XjSKiIAsND.cjs → B7jcDdJUMAjZpGWo.cjs} +1 -1
- package/browser/cjs/{Cpo-h2pMpScosT7r.cjs → BNGY-twelLFkYYI6.cjs} +1 -1
- package/browser/cjs/{Blfxp7Ec3Yjx3gNU.cjs → BsjtiKh23e6v8G0f.cjs} +2 -2
- package/browser/cjs/{klnhoS0cqBpCC5fo.cjs → BzMxZOWpUV_RYST5.cjs} +2 -2
- package/browser/cjs/{BknKSPzyXctJohHb.cjs → C5nAx9uKHMANWBcf.cjs} +2 -2
- package/browser/cjs/{DwLcsRl4-LumKl6l.cjs → CQN6CMOb4-vmBky4.cjs} +2 -2
- package/browser/cjs/{DpZ5HlIMG95q2uIe.cjs → CVQnn-QAlTwmCcqi.cjs} +8 -8
- package/browser/cjs/{Gj8MlEhOCg_o7idM.cjs → CXs0QRWS8JCF5XHE.cjs} +2 -2
- package/browser/cjs/{C-pPuqiWtgMU4NgZ.cjs → CXwNI8k-NCP-Xytq.cjs} +1 -1
- package/browser/cjs/{BqFEcpPZjpwULlZk.cjs → CgzOmQLgtPYoapZz.cjs} +2 -2
- package/browser/cjs/{DZJO-_8PnMFRZMpg.cjs → Crjro8zyw3_OPSdv.cjs} +2 -2
- package/browser/cjs/{CB6DGRkCA3BLDEFr.cjs → Ctj6jurjmyOjmyC_.cjs} +2 -2
- package/browser/cjs/{BNHQPLsVdLmkPgyG.cjs → D3DP2KHrlCUvr5GM.cjs} +1 -1
- package/browser/cjs/{DmCCEKhedSOg163M.cjs → D6vlAfPBLlktoBgq.cjs} +2 -2
- package/browser/cjs/{CU900NraHPDHMGJt.cjs → DFqjzGGReUL-7MoI.cjs} +3 -3
- package/browser/cjs/{J3xq71qTV9LqCUzu.cjs → DKYqcrXsQ_6SuhnP.cjs} +1 -1
- package/browser/cjs/{Dy2vYVhrEqTHdzfD.cjs → DRXfWFboy9pbnpXC.cjs} +3 -3
- package/browser/cjs/{CO4rZgb0ObTZh6NO.cjs → Die-N4kV2bzafWfb.cjs} +2 -2
- package/browser/cjs/{BX8hkPMsPd9PSv0Z.cjs → DoxscTb4o7M2CzO-.cjs} +1 -1
- package/browser/cjs/{BUU_z9x81l1Qnv1t.cjs → htqwuaRLOx8unJxi.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{IllnWqWVClWDW1ot.cjs → nyCcUTXcNQz4oeHS.cjs} +2 -2
- package/browser/cjs/{C9eqE9OnPkiI-5Zd.cjs → omjToo5UJ4DJDaQ_.cjs} +1 -1
- package/browser/cjs/{D9X3UXVH6b_NJFeo.cjs → ovadKV9YIel9XeoD.cjs} +1 -1
- package/browser/esm/{BiQfhG8JMHeWuT63.mjs → B6X8Qvia5W098Liv.mjs} +1 -1
- package/browser/esm/{YS19x3zzRUKQqXu_.mjs → BHgGHdonH-Pv6AWm.mjs} +2 -2
- package/browser/esm/{D4DvAg7aaaWl0TPV.mjs → BKiH_cfuFpIWR0Kh.mjs} +6 -6
- package/browser/esm/{jqoS02EUPE2WEY1t.mjs → BPW1-Hf2PHIk0e2L.mjs} +1 -1
- package/browser/esm/{BQNKKCtIvfOMph3T.mjs → BSJUiUM1YTsyAkO6.mjs} +3 -3
- package/browser/esm/{CwjVlrJJqEGZX6q2.mjs → BWsWm5Ktnddf-7sU.mjs} +2 -2
- package/browser/esm/{Bvr3QlWdnOSnskWL.mjs → Be60UaEY4-jBg5EP.mjs} +1 -1
- package/browser/esm/{FZoe4QJ2ecSD1pjB.mjs → BfgjY48NUV6xeZZz.mjs} +2 -2
- package/browser/esm/{VpP_qw0lmgCaHdHR.mjs → Bm9oowz3XGKUJAwu.mjs} +2 -2
- package/browser/esm/{DSCE3cCea5d5Ip-N.mjs → C1PvMvQkRbbPczX9.mjs} +3 -3
- package/browser/esm/{UWejV3W_nMwWqnxY.mjs → CSJOA0MduTRibCPc.mjs} +2 -2
- package/browser/esm/{UCJVaz3qX1u53mgI.mjs → CVxFHP2hSU8M4x8L.mjs} +1 -1
- package/browser/esm/{DGoy2q9hDB7kive6.mjs → CYkAU_Fwrj5HpveQ.mjs} +2 -2
- package/browser/esm/{DGUm6rEOgO8WrVtT.mjs → CnpSLh6bctHwICAg.mjs} +2 -2
- package/browser/esm/{DAZNeiMI9sOM-xd8.mjs → DlVsPuV-HRiRBisB.mjs} +1 -1
- package/browser/esm/{Btyp6us1Vzz3ZfHk.mjs → DnqJg0A5zWCsTH6-.mjs} +1 -1
- package/browser/esm/{D0v3VaJtA3LjHpWR.mjs → DqaP59JHe_yjCNLN.mjs} +115 -115
- package/browser/esm/{HI5oLhcn8kfiky1k.mjs → DsE9LT7djZNC_bpr.mjs} +1 -1
- package/browser/esm/{CYpvNksOw1PyhLpA.mjs → DtYTMRjYASQHh47Z.mjs} +2 -2
- package/browser/esm/{DuzycndVID_eag8V.mjs → DusKklXwfexZKIz3.mjs} +1 -1
- package/browser/esm/{CcZUaOkODU7h0onP.mjs → RjtykFbCcbv4qS7T.mjs} +2 -2
- package/browser/esm/{DrTLuc1VQWQfDAej.mjs → bgdZRJ8Fv13W0mzX.mjs} +2 -2
- package/browser/esm/{CnXUhdLB8blNUvSr.mjs → i2tBquKvd69Lntmu.mjs} +1 -1
- package/browser/esm/{T2YlNqs-LGJBm08C.mjs → iUN2PzjdPItUTr7H.mjs} +3 -3
- package/browser/esm/index.mjs +11 -10
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{CvYpf-Km1Rvg15q4.mjs → -nq4m1_-YnMSpDz2.mjs} +1 -1
- package/node/esm/{DCrdGvQ_vOB2o-ca.mjs → -wKDYIC7nV2UawT2.mjs} +1 -1
- package/node/esm/{CxhzSvAqksnasp3g.mjs → 6L31NM1-LL-KdFrd.mjs} +1 -1
- package/node/esm/{BGYSS0lvjSMTtreq.mjs → BKhroikdnIEO-cch.mjs} +1 -1
- package/node/esm/{DkhnVkboeZsdMJxH.mjs → BVDB8yUgU4Pe3e3J.mjs} +1 -1
- package/node/esm/{BGZpuIQG7RsGY_HH.mjs → BmnB45A5Kcks8H37.mjs} +1 -1
- package/node/esm/{Bnkt1wiWaLEq8xla.mjs → C-K2oA0Q20MmV5RC.mjs} +1 -1
- package/node/esm/{BTnlaEz7yZqa7QHP.mjs → CC2vphWASQ4iYaeu.mjs} +1 -1
- package/node/esm/{BwbOSLs2gcxOaV0i.mjs → CKJI-uruL_zkUxDv.mjs} +1 -1
- package/node/esm/{DnMRqYWKDGXlNm42.mjs → Cr0a6BIKIyYJjP1S.mjs} +1 -1
- package/node/esm/{imk332niB0MxWuGl.mjs → CtQxIh_WsWd2Iqtp.mjs} +5 -5
- package/node/esm/{BiJ5CZBAxg4-QDHh.mjs → DLPeWl4zrLTgco5e.mjs} +1 -1
- package/node/esm/{FzVegyt0upYkLobF.mjs → DavolEdR41s-e_Fj.mjs} +2 -2
- package/node/esm/{3htalFC0z5xbRnmH.mjs → DfkGEyNA6RPSKyEP.mjs} +1 -1
- package/node/esm/{DuyHq4Fs-_RQkwF_.mjs → Dn5QZmzECuToX8GV.mjs} +1 -1
- package/node/esm/{DhGXQOOW9FBpgCqI.mjs → DqZDYIleTnvpbErd.mjs} +1 -1
- package/node/esm/{BfUEFSGuAZXw2fvO.mjs → KPnfLrtriahFI_c0.mjs} +1 -1
- package/node/esm/{B-pzKiKMkbB9Es-9.mjs → OpLz9iqEueYpbPNa.mjs} +1 -1
- package/node/esm/{DsS5U5rJ5tNVEGXs.mjs → RM7navTE1C8IL9a9.mjs} +1 -1
- package/node/esm/{BFxzGj5sPFwrklFi.mjs → fYYkAOtCehA-pVps.mjs} +3 -3
- package/node/esm/{CAWLE2N0nA-FjUkH.mjs → iZ76esdFvFKIFxbE.mjs} +1 -1
- package/node/esm/index.mjs +736 -735
- package/node/esm/{CSnI8PJEgxEQEj1B.mjs → xiFL_cTYqzecUPE9.mjs} +1 -1
- package/package.json +8 -8
- package/types/index.d.ts +3 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.16
|
|
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 N=require("@sheetxl/sdk"),l=require("react/jsx-runtime"),s=require("react"),B=require("@mui/material"),gn=require("@mui/icons-material"),p2=require("react-dom/client"),uo=require("react-dom"),dt=require("@mui/system"),o0=require("@mui/styled-engine"),Mp=require("@mui/utils");function lx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const H0=lx(s);function Rp(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Rp(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Zn(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Rp(e))&&(o&&(o+=" "),o+=t);return o}const co={TopLeft:"tl",Top:"t",TopRight:"tr",Left:"l",Center:"c",Right:"r",BottomLeft:"bl",Bottom:"b",BottomRight:"br"},$o="text/html",h0="text/plain",r1="image/png",sx=Object.freeze({left:0,top:0}),cx=Object.freeze({left:0,top:0,bottom:0,right:0}),dx=Object.freeze({x:0,y:0,width:0,height:0}),Tl=Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:dx,EmptyRect:cx,EmptyTopLeft:sx},Symbol.toStringTag,{value:"Module"})),ui="column",jl="row",ux=Object.freeze({colIndex:0,rowIndex:0}),px=Object.freeze({colStart:0,rowStart:0,colEnd:0,rowEnd:0}),Ip=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Dp=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,hx=(e,t)=>e.rowEnd===t.rowEnd?t.colEnd-e.colEnd:t.rowEnd-e.rowEnd,mx=(e,t)=>e.colEnd===t.colEnd?t.rowEnd-e.rowEnd:t.colEnd-e.colEnd,G5=(e,t)=>e.colIndex===t.colIndex?e.rowIndex-t.rowIndex:e.colIndex-t.colIndex,K5=(e,t)=>e.rowIndex===t.rowIndex?e.colIndex-t.colIndex:e.rowIndex-t.rowIndex,Lp=(e=jl,t=!1)=>t?e!==ui?hx:mx:e!==ui?Dp:Ip,X5=(e,t)=>e===t||!(!e||!t)&&e.rowIndex===t.rowIndex&&e.colIndex===t.colIndex,Qd=(e,t)=>e===t||!(!e||!t)&&e.rowStart===t.rowStart&&e.rowEnd===t.rowEnd&&e.colStart===t.colStart&&e.colEnd===t.colEnd,eu=(e,t)=>!(!e||!t||e.colStart>t.colEnd||t.colStart>e.colEnd||e.rowStart>t.rowEnd||t.rowStart>e.rowEnd),Y5=(e,t)=>{if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Qd(e[n],t[n]))return!1;return!0},Nc=(e,t,n)=>{if(!e&&!t)return null;if(!e)return n?t:{...t};if(!t)return n?e:{...e};const o=Math.min(e.colStart,t.colStart),r=Math.min(e.rowStart,t.rowStart),i=Math.max(e.colEnd,t.colEnd),a=Math.max(e.rowEnd,t.rowEnd);let d=n;return d?(d.colStart=o,d.rowStart=r,d.colEnd=i,d.rowEnd=a):d={colStart:o,rowStart:r,colEnd:i,rowEnd:a},d},J5=(e,t)=>{if(!t||t.length===0)return e;const n={...e};for(let o=0;o<t.length;o++){const r=t[o];eu(n,r)&&(n.rowStart=Math.min(n.rowStart,r.rowStart),n.colStart=Math.min(n.colStart,r.colStart),n.rowEnd=Math.max(n.rowEnd,r.rowEnd),n.colEnd=Math.max(n.colEnd,r.colEnd))}return n},fx=[null,null],gx=(e,t,n)=>{if(e[0].value===e[1].value)return t};function Q5(e,t=2,n,o=jl,r){let i=[...e];if(t<=0||e.length<=1)return i;let a=o===ui,d=0,c=!1;do{const u=i.sort(Lp(a?jl:ui));i=[],i.push(u[0]);const p=u.length;let m=0,h=u[0],g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd;for(let w=1;w<p;w++){const b=u[w];let C=!1;if(C=a?h&&f===b.rowStart&&y===b.rowEnd&&x+1===b.colStart:h&&g===b.colStart&&x===b.colEnd&&y+1===b.rowStart,C){let k={colStart:g,rowStart:f,colEnd:a?b.colEnd:x,rowEnd:a?y:b.rowEnd};if(h.value!==void 0&&(k.value=h.value),n){const E=r??[null,null];E[0]=h,E[1]=b,k=n(E,k,o)}if(k){i[m]=k,c=!0,h=k,g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd;continue}}i[++m]=b,h=b,g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd}d++,a=!a,d===1&&(c=!0)}while(d<t&&c&&i.length>1);return i}const vo=Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:ux,EmptyRange:px,cellToRange:(e,t)=>{if(!e)return null;let n=t;return n||(n={...e},delete n.colIndex,delete n.rowIndex),n.colStart=e.colIndex??0,n.rowStart=e.rowIndex??0,n.colEnd=e.colIndex??0,n.rowEnd=e.rowIndex??0,n},columnFirstCellComparator:G5,columnFirstRangeComparator:Ip,createCellComparator:(e=jl,t=!1)=>t?e!==ui?(n,o)=>n.rowIndex===o.rowIndex?o.colIndex-n.colIndex:o.rowIndex-n.rowIndex:(n,o)=>n.colIndex===o.colIndex?o.rowIndex-n.rowIndex:o.colIndex-n.colIndex:e!==ui?K5:G5,createConflatingRanges:(e,t=!1)=>{const n=[];let o,r,i=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;return{append:(d,c,u)=>{let p=!0;const m=u!==void 0;if(m){const f=e?e(r,u,t):r===u?u:void 0;f===void 0?p=!1:u=f}if(p&&c===a+1&&d===i)return t?o.rowEnd=c:o.colEnd=c,a=c,void(r=u);o&&n.push(o);const h=t?d:c,g=t?c:d;o={colStart:h,rowStart:g,colEnd:h,rowEnd:g},m&&(o.value=u),i=d,a=c,r=u},done:d=>(o&&(n.push(o),o=null),d?Q5(n,3,d===!0?gx:d,t?ui:jl,fx):n)}},createRangeComparator:Lp,defaultRange:(e,t,n)=>e?n?(n.colStart=e.colStart??t.colStart,n.rowStart=e.rowStart??t.rowStart,n.colEnd=e.colEnd??t.colEnd,n.rowEnd=e.rowEnd??t.rowEnd,n):{colStart:e.colStart??t.colStart,rowStart:e.rowStart??t.rowStart,colEnd:e.colEnd??t.colEnd,rowEnd:e.rowEnd??t.rowEnd}:t,extendRangeToIntersectingRanges:J5,extendRangeToUnionRanges:(e,t)=>{if(!t||t.length===0)return e;let n=e,o=null;for(;!Qd(n,o);)o=n,n=J5(o,t);return n},indexOfCoords:(e,t)=>{const n={colStart:e.colIndex,rowStart:e.rowIndex,colEnd:e.colIndex,rowEnd:e.rowIndex};for(let o=t.length-1;o>=0;o--)if(eu(n,t[o]))return o;return-1},intersectRanges:(e,t,n)=>{if(!e)return n?t:{...t};if(!t)return n?e:{...e};if(!e&&!t||e.rowStart>t.rowEnd||e.rowEnd<t.rowStart||e.colStart>t.colEnd||e.colEnd<t.colStart)return null;const o=Math.max(e.colStart,t.colStart),r=Math.max(e.rowStart,t.rowStart),i=Math.min(e.colEnd,t.colEnd),a=Math.min(e.rowEnd,t.rowEnd);let d=n;return d?(d.colStart=o,d.rowStart=r,d.colEnd=i,d.rowEnd=a):d={colStart:o,rowStart:r,colEnd:i,rowEnd:a},d},isCellWithinRange:(e,t)=>!(!e||!t||e.rowIndex<t.rowStart||e.rowIndex>t.rowEnd||e.colIndex<t.colStart||e.colIndex>t.colEnd),isEqualCells:X5,isEqualRanges:Qd,isEqualRangesArrays:Y5,isEqualSelectionCoords:(e,t)=>e===t||!(!e||!t)&&e.rangeIndex===t.rangeIndex&&!!X5(e.cell,t.cell)&&Y5(e.ranges,t.ranges),isRangeWithinRange:(e,t)=>!(e.rowStart<t.rowStart||e.rowEnd>t.rowEnd||e.colStart<t.colStart||e.colEnd>t.colEnd),isRangesIntersect:eu,isSingleCell:e=>!!e&&e.rowEnd===e.rowStart&&e.colStart===e.colEnd,isValidRange:e=>!(!e||typeof e.colStart!="number"||e.colStart<0||typeof e.colEnd!="number"||e.colEnd<e.colStart||typeof e.rowStart!="number"||e.rowStart<0||typeof e.rowEnd!="number"||e.rowEnd<e.rowStart),mergeRangedValues:Q5,rowFirstCellComparator:K5,rowFirstRangeComparator:Dp,sanitizeRange:e=>e?{colStart:e.colIndex??e.colStart??0,rowStart:e.rowIndex??e.rowStart??0,colEnd:e.colIndex??e.colEnd??0,rowEnd:e.rowIndex??e.rowEnd??0}:null,translateRange:(e,t=-e.rowStart,n=-e.colStart,o)=>o?(o.colStart=e.colStart+n,o.rowStart=e.rowStart+t,o.colEnd=e.colEnd+n,o.rowEnd=e.rowEnd+t,o):{colStart:e.colStart+n,rowStart:e.rowStart+t,colEnd:e.colEnd+n,rowEnd:e.rowEnd+t},unionRanges:Nc,unionRangesArrays:(e,t,n)=>{if(!e||e.length===0)return null;if(e.length===1&&!t)return e[0];let o=e[0];for(let r=1;r<e.length;r++)o=Nc(o,e[r],n);return t&&(o=Nc(o,t,n)),o}},Symbol.toStringTag,{value:"Module"})),xx=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function yx(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){const n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||function(o){return o.$$typeof===xx}(t)}(e)}function rl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?fi((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function bx(e,t,n){return e.concat(t).map(function(o){return rl(o,n)})}function e3(e){return Object.keys(e).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}(e))}function t3(e,t){try{return t in e}catch{return!1}}function fi(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||bx,n.isMergeableObject=n.isMergeableObject||yx,n.cloneUnlessOtherwiseSpecified=rl;const o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):function(r,i,a){const d={};return a.isMergeableObject(r)&&e3(r).forEach(function(c){d[c]=rl(r[c],a)}),e3(i).forEach(function(c){(function(u,p){return t3(u,p)&&!(Object.hasOwnProperty.call(u,p)&&Object.propertyIsEnumerable.call(u,p))})(r,c)||(t3(r,c)&&a.isMergeableObject(i[c])?d[c]=function(u,p){if(!p.customMerge)return fi;const m=p.customMerge(u);return typeof m=="function"?m:fi}(c,a)(r[c],i[c],a):d[c]=rl(i[c],a))}),d}(e,t,n):rl(t,n)}fi.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return fi(n,o,t)},{})};const wx=Object.freeze([]),vx=Object.freeze({}),n3=e=>e,i1=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)}),Op=(e,t)=>e===t||!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((n,o)=>n===t[o]),Da=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,Ap=e=>typeof e!="object"||Array.isArray(e)||e===null?e:(Object.keys(e).forEach(function(t){e[t]&&typeof e[t]=="object"?Ap(e[t]):e[t]!==null&&e[t]!==void 0||delete e[t],typeof e[t]=="object"&&Object.keys(e[t]).length===0&&delete e[t]}),Object.keys(e).length===0?null:e),Sx=(e,t)=>!(e!==t&&!Op(e,t)&&!e.isEqual?.(t)),Pp=(e,t,n=Sx)=>{if(e==null||e===t)return null;if(!e||typeof e!="object"||Array.isArray(e)||e.isImmutable?.())return n(e,t)?null:e;const o=Object.keys(e);if(o.length===0)return null;let r=!1;for(let i=0;i<o.length;i++){const a=o[i];Pp(e[a],t?.[a],n)===null&&(r=!0,delete e[a])}return r&&Object.keys(e).length===0?null:void 0},o3=typeof performance=="object"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now(),r3=e=>e==null,i3=(e,t)=>!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top),a3=!(typeof window>"u"||!window.document||!window.document.createElement),Go={Windows:"windows",MacOS:"macos",IOS:"ios",Linux:"linux",Android:"android",Safari:"safari",Firefox:"firefox",Node:"node",Unknown:"unknown"},Ml=()=>{if(Fp())return Go.Node;const e=globalThis.navigator!==void 0&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";return e?/(win32|win64|windows|wince)/i.test(e)?Go.Windows:/(macintosh|macintel|macppc|mac68k|macos)/i.test(e)?Go.MacOS:/(iphone|ipad|ipod)/i.test(e)?Go.IOS:/android/.test(e)?Go.Android:/linux/.test(e)?Go.Linux:/^((?!chrome|android|).)*safari/i.test(e)?Go.Safari:/^((?!chrome|android|Seamonkey).)*firefox/i.test(e)?Go.Firefox:Go.Unknown:Go.Unknown};function Fp(){return typeof process<"u"&&process.release?.name==="node"||(typeof process<"u"&&process.browser,!1)}const l3=(e,t=!1)=>(document.hasFocus()||t)&&(e===document.activeElement||e?.contains(document.activeElement)),zt=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:wx,EmptyObject:vx,OSType:Go,arrayMove:function(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o},asNumber:e=>{const t=(n=>1*n)(e);return Number.isFinite(t)?t:0},camelToPrettyCase:e=>e.length===1?e.toUpperCase():e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:a3,cancelTimeout:e=>{cancelAnimationFrame(e.id)},castToString:e=>e==null||e===void 0?"":typeof e!="string"?""+e:e,cloneObject:e=>r3(e)?e:JSON.parse(JSON.stringify(e)),consoleWithNoSource:(...e)=>new Promise(t=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,e),t()})}),debounce:function(e,t=300,n=!1){let o,r,i,a,d=0;function c(){let p=Date.now()-d;p<t&&p>=0?o=setTimeout(c,t-p):(o=null,n||(a=e.apply(i,r),i=r=null))}t==null&&(t=100);const u=function(){i=globalThis,r=arguments,d=Date.now();var p=n&&!o;return o||(o=setTimeout(c,t)),p&&(a=e.apply(i,r),i=r=null),a};return u.clear=function(){o&&(clearTimeout(o),o=null)},u.flush=function(){o&&(a=e.apply(i,r),i=r=null,clearTimeout(o),o=null)},u},deepEqual:function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;let o,r,i;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){let a=i[r];if(!(a==="_owner"&&t.$$typeof||e(t[a],n[a])))return!1}return!0}return t!=t&&n!=n},deepFreeze:function e(t){return Object.freeze(t),Object.keys(t).forEach(n=>{typeof t[n]!="object"||t[n]===null||Object.isFrozen(t[n])||e(t[n])}),t},deepMerge:fi,diffValues:(e,t)=>{const n={},o=Object.keys(t),r=o.length;for(let i=0;i<r;i++){const a=o[i];e[a]!==t[a]&&(e[a]===void 0?n[a]=t[a]:n[a]=e[a])}return Object.keys(n).length===0?null:n},findEqualOrGreater:function(e,t,n=n3){let o=0,r=e.length-1;for(;o<=r;){let i=Math.floor((o+r)/2),a=n(e[i]);if(a===t)return i;a<t?o=i+1:r=i-1}return o},findEqualOrLesser:function(e,t,n=n3){let o=e.length-1,r=0;for(;o>=r;){let i=Math.floor((o+r)/2),a=n(e[i]);if(a===t)return i;a>t?o=i-1:r=i+1}return o},findNextStep:(e,t=!0,n=15,o=10,r=400)=>{const i=Math.max(e-o,0)+(t?1:-1);return Math.min(r,Math[t?"ceil":"floor"](i/n)*n+o)},getDPI:()=>{let e=1;return typeof window=="object"&&(e=window.devicePixelRatio||1),e},getFromPath:(e,t)=>{const n=t.split(".");let o=e;for(let r=0;r<n.length;r++){const i=n[r];if(!o)return null;let a=o[i];if(typeof a=="function"&&(a=a.bind(o)()),!a||!Da(a))return a;o=a}return o??null},getOS:Ml,hasFocus:l3,isDefined:e=>e!=null,isEmpty:e=>e==null||e==="",isEqualArrays:Op,isEqualBounds:(e,t)=>e===t||!(e&&!t||t&&!e)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,isEqualObjectKeys:(e,t)=>{if(e===t)return!0;if(e&&!t||t&&!e)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++)if(e[n[o]]!==t[n[o]])return!1;return!0},isNode:Fp,isNullOrUndefined:r3,isNumeric:e=>{const t=1*e;return Number.isFinite(t)&&typeof t=="number"},isObject:Da,isPromiseLike:e=>!!e&&typeof e.then=="function",isRectInsideRect:(e,t)=>e.top>=t.top&&e.bottom<=t.bottom&&e.left>=t.left&&e.right<=t.right,isRectIntersect:i3,mergeContentful:(...e)=>{const t=e.length;if(t>0&&e[t-1]!==void 0&&!Da(e[t-1]))return e[t-1];let n=e[0]||{};for(let o=1;o<t;o++)n=fi(n,e[o]||{},{arrayMerge:(r,i)=>[...i]});return n},nextTick:e=>{typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{e()}):(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{e()})},openFileDialog:(e="*.*")=>new Promise((t,n)=>{if(!a3)return void n("Unable to open dialog with no dom.");const o=document.createElement("input");o.type="file",o.accept=e;let r=null,i=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{r||i||(i=!0,t(null))},1e3)},{once:!0,passive:!0}),o.onchange=()=>{if(r=o.files[0],r){if(i)return void console.warn("File open detected after faux cancel.",r);t(r)}},o.autofocus=!0,o.click()}),rafThrottle:e=>{let t,n=!1,o=function(){n=!1,e(t)};return function(r){t=r,t&&t.persist&&t.persist(),n||(n=!0,requestAnimationFrame(o))}},removeEmptyProperties:Ap,removeEqualValues:Pp,removeListenerAll:e=>{if(!e)return[];for(let t=0;t<e.length;t++)e[t]&&e[t]();return[]},requestTimeout:(e,t)=>{const n=o3(),o={id:requestAnimationFrame(function r(){o3()-n>=t?e.call(null):o.id=requestAnimationFrame(r)})};return o},roundAccurately:(e,t=0)=>{if(e==null||!isFinite(e))return null;const n=10**t;return Number(Math.round(e*n)/n)},setToPath:(e,t,n)=>{const o=t.split(".");let r=e;if(!r)throw new Error("Can not set path to a null path.");for(let i=0;r&&i<o.length-1;i++){const a=o[i];let d=r[a];if(d==null&&(d={},r[a]=d),!Da(d))throw new Error("Can not set path to a non object path.");r=d}if(typeof n!="number"&&typeof n!="boolean"&&typeof n!="string"&&!Da(n))throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);return r[o[o.length-1]]=n,e},splitNumber:e=>{let t=Math.abs(e);if(isNaN(t)||!isFinite(e))return null;let n=0|t,o=t-n,r=0,i=0,a=1;if(o>5e-8)for(;i<8&&Math.abs(r/a-o)>5e-8;)i++,a*=10,r=Math.round(o*a);return{ip:Math.trunc(e),fp:r,ipLength:Math.ceil(Math.log10(n+1)),fpLength:i}},subtractRect:(e,t,n=!1)=>{if(!t)return[e];if(!i3(e,t))return[];const o=[];let r=e;const i=()=>{t.top>r.top&&t.top<r.bottom&&(o.push({...r,bottom:t.top}),r={...r,top:t.top})},a=()=>{t.bottom>r.top&&t.bottom<r.bottom&&(o.push({...r,top:t.bottom}),r={...r,bottom:t.bottom})},d=()=>{t.right>r.left&&t.right<r.right&&(o.push({...r,left:t.right}),r={...r,right:t.right})},c=()=>{t.left>r.left&&t.left<r.right&&(o.push({...r,right:t.left}),r={...r,left:t.left})};return n?(c(),d(),i(),a()):(i(),a(),d(),c()),o},textToKey:e=>e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(e,t){let n=null;return(...o)=>{const r=Date.now();(!n||r-n>=t)&&(n=r,e(...o))}},toSafeJSON:function e(t){if(t===null||typeof t!="object")return t;if(typeof t.toJSON=="function")return t.toJSON();if(Array.isArray(t))return t.map(o=>e(o));if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();const n={};for(const o in t)t.hasOwnProperty(o)&&(n[o]=e(t[o]));return n},transpose:e=>{if(!e)return e;const t=e.length,n=e[0].length,o=[];for(let r=0;r<n;r++)o[r]=Array(t);for(let r=0;r<t;r++)for(let i=0;i<n;i++)o[i][r]=e[r][i];return o},uuidV4:i1,validEnumValue:(e,t)=>{if(!Object.values(e).includes(t))throw new Error(`Invalid type: ${t??"null"}. Must be one of: ${Object.values(t).join(", ")}.`)},whenFocus:async(e,t=!1)=>new Promise(n=>{l3(e,t)?n(!0):e.addEventListener("focusin",()=>{n(!0)},{once:!0}),e.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:e=>`Invalid argument: '${e}'.`},Symbol.toStringTag,{value:"Module"}));const zp=e=>{const t=new Uint8Array(e),n=t.byteLength;let o="";for(let r=0;r<n;r++)o+=String.fromCharCode(t[r]);if(typeof window<"u"&&typeof globalThis.btoa=="function")return globalThis.btoa(o);if(typeof Buffer<"u")return Buffer.from(o,"binary").toString("base64");throw new Error("Unsupported environment")},tu=e=>new Promise((t,n)=>{if(e)if(typeof FileReader<"u"){const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{n(o.error)},o.readAsText(e)}else if(typeof Buffer<"u"){const o=r=>Buffer.from(r).toString("utf-8");e.arrayBuffer().then(r=>{t(o(r))}).catch(r=>{n(r)})}else n(new Error("Unsupported environment"));else t("")}),Cx=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:zp,base64ToArrayBuffer:e=>{const t=typeof window<"u"&&typeof globalThis.atob=="function"?globalThis.atob(e):Buffer.from(e,"base64").toString("binary"),n=t.length,o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=t.charCodeAt(r);return o.buffer},blobToString:tu},Symbol.toStringTag,{value:"Module"})),Bp="data:image/png;base64,",Np="Unable to resolve image.",s3=e=>new Promise(async(t,n)=>{let o=null;try{o=new Image,o.src=e,o.addEventListener("load",function(){t({width:o.naturalWidth,height:o.naturalHeight})},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(e),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(Np)}),Vc="image/svg+xml";var c3,d3;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Bp,getImageDataUrl:(e,t=1)=>new Promise(async(n,o)=>{let r=null;try{r=new Image,r.src=e,r.addEventListener("load",function(){try{const i=document.createElement("canvas");i.width=r.naturalWidth,i.height=r.naturalHeight,i.getContext("2d").drawImage(r,0,0);const a=i.toDataURL("image/png",t);n({elemImg:r,dataUrl:a})}catch(i){URL.revokeObjectURL(e),o(i)}},{once:!0}),r.addEventListener("error",function(){URL.revokeObjectURL(e),o("Invalid Image")},{once:!0}),await r.decode("sync")}catch{r?.src&&URL.revokeObjectURL(r.src)}r||o(Np)}),loadImageDetails:async(e,t=null)=>{let n=null;const o=async()=>{try{const i=t??"image/*",a=URL.createObjectURL(new Blob([e],{type:i})),d=await s3(a);n={mimeType:i,naturalDimensions:d,asUrl:a}}catch{}},r=async()=>{try{const i=new TextDecoder().decode(e),a=URL.createObjectURL(new Blob([i],{type:Vc})),d=await s3(a);n={mimeType:t??Vc,naturalDimensions:d,asUrl:a,asSVGText:i}}catch{}};if(t===Vc?await r():t.startsWith("image/")?await o():(await o(),n||await r()),!n)throw new Error("Failed to load image");return n}},Symbol.toStringTag,{value:"Module"})),(d3=c3||(c3={})).resolveTypedUpdates=(e,t,n,o)=>{if(e===null)return e;if(e===void 0)return o;let r=e;if(t?.shorthand){const c=t?.shorthand(e,n);c!==void 0&&(r=c)}if(r!==null&&t?.getSubType){const c=t.getSubType(r);c&&(t=c)}const i=t?.properties,a=t?.arrayType??!1;let d=r;if(t&&t.merge&&d&&o)d=t.merge(d,o,n);else if(!a&&i){const c=Object.keys({...r,...o});d=null;for(let u=0;u<c.length;u++){const p=c[u];let m,h=r[p];if(h!==void 0){const g=i[p];m=g?(0,d3.resolveTypedUpdates)(h,g,n,o?.[p]):h}else m=o?.[p];m!=null&&(d=d??{},d[p]=m)}}return d};let nu=class extends Error{constructor(e,t=null){super(e,t),this.name="ChainedError",this._cause=t}get cause(){return this._cause}};const u3=`The Safari browser does not support advanced copy and paste.
|
|
6
|
+
*/const N=require("@sheetxl/sdk"),l=require("react/jsx-runtime"),s=require("react"),B=require("@mui/material"),dt=require("@mui/system"),p2=require("react-dom/client"),uo=require("react-dom"),o0=require("@mui/styled-engine"),gn=require("@mui/icons-material"),Mp=require("@mui/utils");function lx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const H0=lx(s);function Rp(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Rp(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Zn(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Rp(e))&&(o&&(o+=" "),o+=t);return o}const co={TopLeft:"tl",Top:"t",TopRight:"tr",Left:"l",Center:"c",Right:"r",BottomLeft:"bl",Bottom:"b",BottomRight:"br"},$o="text/html",h0="text/plain",r1="image/png",sx=Object.freeze({left:0,top:0}),cx=Object.freeze({left:0,top:0,bottom:0,right:0}),dx=Object.freeze({x:0,y:0,width:0,height:0}),Tl=Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:dx,EmptyRect:cx,EmptyTopLeft:sx},Symbol.toStringTag,{value:"Module"})),ui="column",jl="row",ux=Object.freeze({colIndex:0,rowIndex:0}),px=Object.freeze({colStart:0,rowStart:0,colEnd:0,rowEnd:0}),Ip=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Dp=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,hx=(e,t)=>e.rowEnd===t.rowEnd?t.colEnd-e.colEnd:t.rowEnd-e.rowEnd,mx=(e,t)=>e.colEnd===t.colEnd?t.rowEnd-e.rowEnd:t.colEnd-e.colEnd,G5=(e,t)=>e.colIndex===t.colIndex?e.rowIndex-t.rowIndex:e.colIndex-t.colIndex,K5=(e,t)=>e.rowIndex===t.rowIndex?e.colIndex-t.colIndex:e.rowIndex-t.rowIndex,Lp=(e=jl,t=!1)=>t?e!==ui?hx:mx:e!==ui?Dp:Ip,X5=(e,t)=>e===t||!(!e||!t)&&e.rowIndex===t.rowIndex&&e.colIndex===t.colIndex,Qd=(e,t)=>e===t||!(!e||!t)&&e.rowStart===t.rowStart&&e.rowEnd===t.rowEnd&&e.colStart===t.colStart&&e.colEnd===t.colEnd,eu=(e,t)=>!(!e||!t||e.colStart>t.colEnd||t.colStart>e.colEnd||e.rowStart>t.rowEnd||t.rowStart>e.rowEnd),Y5=(e,t)=>{if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Qd(e[n],t[n]))return!1;return!0},Nc=(e,t,n)=>{if(!e&&!t)return null;if(!e)return n?t:{...t};if(!t)return n?e:{...e};const o=Math.min(e.colStart,t.colStart),r=Math.min(e.rowStart,t.rowStart),i=Math.max(e.colEnd,t.colEnd),a=Math.max(e.rowEnd,t.rowEnd);let d=n;return d?(d.colStart=o,d.rowStart=r,d.colEnd=i,d.rowEnd=a):d={colStart:o,rowStart:r,colEnd:i,rowEnd:a},d},J5=(e,t)=>{if(!t||t.length===0)return e;const n={...e};for(let o=0;o<t.length;o++){const r=t[o];eu(n,r)&&(n.rowStart=Math.min(n.rowStart,r.rowStart),n.colStart=Math.min(n.colStart,r.colStart),n.rowEnd=Math.max(n.rowEnd,r.rowEnd),n.colEnd=Math.max(n.colEnd,r.colEnd))}return n},fx=[null,null],gx=(e,t,n)=>{if(e[0].value===e[1].value)return t};function Q5(e,t=2,n,o=jl,r){let i=[...e];if(t<=0||e.length<=1)return i;let a=o===ui,d=0,c=!1;do{const u=i.sort(Lp(a?jl:ui));i=[],i.push(u[0]);const p=u.length;let m=0,h=u[0],g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd;for(let w=1;w<p;w++){const b=u[w];let C=!1;if(C=a?h&&f===b.rowStart&&y===b.rowEnd&&x+1===b.colStart:h&&g===b.colStart&&x===b.colEnd&&y+1===b.rowStart,C){let k={colStart:g,rowStart:f,colEnd:a?b.colEnd:x,rowEnd:a?y:b.rowEnd};if(h.value!==void 0&&(k.value=h.value),n){const E=r??[null,null];E[0]=h,E[1]=b,k=n(E,k,o)}if(k){i[m]=k,c=!0,h=k,g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd;continue}}i[++m]=b,h=b,g=h.colStart,f=h.rowStart,x=h.colEnd,y=h.rowEnd}d++,a=!a,d===1&&(c=!0)}while(d<t&&c&&i.length>1);return i}const vo=Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:ux,EmptyRange:px,cellToRange:(e,t)=>{if(!e)return null;let n=t;return n||(n={...e},delete n.colIndex,delete n.rowIndex),n.colStart=e.colIndex??0,n.rowStart=e.rowIndex??0,n.colEnd=e.colIndex??0,n.rowEnd=e.rowIndex??0,n},columnFirstCellComparator:G5,columnFirstRangeComparator:Ip,createCellComparator:(e=jl,t=!1)=>t?e!==ui?(n,o)=>n.rowIndex===o.rowIndex?o.colIndex-n.colIndex:o.rowIndex-n.rowIndex:(n,o)=>n.colIndex===o.colIndex?o.rowIndex-n.rowIndex:o.colIndex-n.colIndex:e!==ui?K5:G5,createConflatingRanges:(e,t=!1)=>{const n=[];let o,r,i=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;return{append:(d,c,u)=>{let p=!0;const m=u!==void 0;if(m){const f=e?e(r,u,t):r===u?u:void 0;f===void 0?p=!1:u=f}if(p&&c===a+1&&d===i)return t?o.rowEnd=c:o.colEnd=c,a=c,void(r=u);o&&n.push(o);const h=t?d:c,g=t?c:d;o={colStart:h,rowStart:g,colEnd:h,rowEnd:g},m&&(o.value=u),i=d,a=c,r=u},done:d=>(o&&(n.push(o),o=null),d?Q5(n,3,d===!0?gx:d,t?ui:jl,fx):n)}},createRangeComparator:Lp,defaultRange:(e,t,n)=>e?n?(n.colStart=e.colStart??t.colStart,n.rowStart=e.rowStart??t.rowStart,n.colEnd=e.colEnd??t.colEnd,n.rowEnd=e.rowEnd??t.rowEnd,n):{colStart:e.colStart??t.colStart,rowStart:e.rowStart??t.rowStart,colEnd:e.colEnd??t.colEnd,rowEnd:e.rowEnd??t.rowEnd}:t,extendRangeToIntersectingRanges:J5,extendRangeToUnionRanges:(e,t)=>{if(!t||t.length===0)return e;let n=e,o=null;for(;!Qd(n,o);)o=n,n=J5(o,t);return n},indexOfCoords:(e,t)=>{const n={colStart:e.colIndex,rowStart:e.rowIndex,colEnd:e.colIndex,rowEnd:e.rowIndex};for(let o=t.length-1;o>=0;o--)if(eu(n,t[o]))return o;return-1},intersectRanges:(e,t,n)=>{if(!e)return n?t:{...t};if(!t)return n?e:{...e};if(!e&&!t||e.rowStart>t.rowEnd||e.rowEnd<t.rowStart||e.colStart>t.colEnd||e.colEnd<t.colStart)return null;const o=Math.max(e.colStart,t.colStart),r=Math.max(e.rowStart,t.rowStart),i=Math.min(e.colEnd,t.colEnd),a=Math.min(e.rowEnd,t.rowEnd);let d=n;return d?(d.colStart=o,d.rowStart=r,d.colEnd=i,d.rowEnd=a):d={colStart:o,rowStart:r,colEnd:i,rowEnd:a},d},isCellWithinRange:(e,t)=>!(!e||!t||e.rowIndex<t.rowStart||e.rowIndex>t.rowEnd||e.colIndex<t.colStart||e.colIndex>t.colEnd),isEqualCells:X5,isEqualRanges:Qd,isEqualRangesArrays:Y5,isEqualSelectionCoords:(e,t)=>e===t||!(!e||!t)&&e.rangeIndex===t.rangeIndex&&!!X5(e.cell,t.cell)&&Y5(e.ranges,t.ranges),isRangeWithinRange:(e,t)=>!(e.rowStart<t.rowStart||e.rowEnd>t.rowEnd||e.colStart<t.colStart||e.colEnd>t.colEnd),isRangesIntersect:eu,isSingleCell:e=>!!e&&e.rowEnd===e.rowStart&&e.colStart===e.colEnd,isValidRange:e=>!(!e||typeof e.colStart!="number"||e.colStart<0||typeof e.colEnd!="number"||e.colEnd<e.colStart||typeof e.rowStart!="number"||e.rowStart<0||typeof e.rowEnd!="number"||e.rowEnd<e.rowStart),mergeRangedValues:Q5,rowFirstCellComparator:K5,rowFirstRangeComparator:Dp,sanitizeRange:e=>e?{colStart:e.colIndex??e.colStart??0,rowStart:e.rowIndex??e.rowStart??0,colEnd:e.colIndex??e.colEnd??0,rowEnd:e.rowIndex??e.rowEnd??0}:null,translateRange:(e,t=-e.rowStart,n=-e.colStart,o)=>o?(o.colStart=e.colStart+n,o.rowStart=e.rowStart+t,o.colEnd=e.colEnd+n,o.rowEnd=e.rowEnd+t,o):{colStart:e.colStart+n,rowStart:e.rowStart+t,colEnd:e.colEnd+n,rowEnd:e.rowEnd+t},unionRanges:Nc,unionRangesArrays:(e,t,n)=>{if(!e||e.length===0)return null;if(e.length===1&&!t)return e[0];let o=e[0];for(let r=1;r<e.length;r++)o=Nc(o,e[r],n);return t&&(o=Nc(o,t,n)),o}},Symbol.toStringTag,{value:"Module"})),xx=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function yx(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){const n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||function(o){return o.$$typeof===xx}(t)}(e)}function rl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?fi((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function bx(e,t,n){return e.concat(t).map(function(o){return rl(o,n)})}function e3(e){return Object.keys(e).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}(e))}function t3(e,t){try{return t in e}catch{return!1}}function fi(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||bx,n.isMergeableObject=n.isMergeableObject||yx,n.cloneUnlessOtherwiseSpecified=rl;const o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):function(r,i,a){const d={};return a.isMergeableObject(r)&&e3(r).forEach(function(c){d[c]=rl(r[c],a)}),e3(i).forEach(function(c){(function(u,p){return t3(u,p)&&!(Object.hasOwnProperty.call(u,p)&&Object.propertyIsEnumerable.call(u,p))})(r,c)||(t3(r,c)&&a.isMergeableObject(i[c])?d[c]=function(u,p){if(!p.customMerge)return fi;const m=p.customMerge(u);return typeof m=="function"?m:fi}(c,a)(r[c],i[c],a):d[c]=rl(i[c],a))}),d}(e,t,n):rl(t,n)}fi.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return fi(n,o,t)},{})};const wx=Object.freeze([]),vx=Object.freeze({}),n3=e=>e,i1=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)}),Op=(e,t)=>e===t||!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((n,o)=>n===t[o]),Da=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,Ap=e=>typeof e!="object"||Array.isArray(e)||e===null?e:(Object.keys(e).forEach(function(t){e[t]&&typeof e[t]=="object"?Ap(e[t]):e[t]!==null&&e[t]!==void 0||delete e[t],typeof e[t]=="object"&&Object.keys(e[t]).length===0&&delete e[t]}),Object.keys(e).length===0?null:e),Sx=(e,t)=>!(e!==t&&!Op(e,t)&&!e.isEqual?.(t)),Pp=(e,t,n=Sx)=>{if(e==null||e===t)return null;if(!e||typeof e!="object"||Array.isArray(e)||e.isImmutable?.())return n(e,t)?null:e;const o=Object.keys(e);if(o.length===0)return null;let r=!1;for(let i=0;i<o.length;i++){const a=o[i];Pp(e[a],t?.[a],n)===null&&(r=!0,delete e[a])}return r&&Object.keys(e).length===0?null:void 0},o3=typeof performance=="object"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now(),r3=e=>e==null,i3=(e,t)=>!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top),a3=!(typeof window>"u"||!window.document||!window.document.createElement),Go={Windows:"windows",MacOS:"macos",IOS:"ios",Linux:"linux",Android:"android",Safari:"safari",Firefox:"firefox",Node:"node",Unknown:"unknown"},Ml=()=>{if(Fp())return Go.Node;const e=globalThis.navigator!==void 0&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";return e?/(win32|win64|windows|wince)/i.test(e)?Go.Windows:/(macintosh|macintel|macppc|mac68k|macos)/i.test(e)?Go.MacOS:/(iphone|ipad|ipod)/i.test(e)?Go.IOS:/android/.test(e)?Go.Android:/linux/.test(e)?Go.Linux:/^((?!chrome|android|).)*safari/i.test(e)?Go.Safari:/^((?!chrome|android|Seamonkey).)*firefox/i.test(e)?Go.Firefox:Go.Unknown:Go.Unknown};function Fp(){return typeof process<"u"&&process.release?.name==="node"||(typeof process<"u"&&process.browser,!1)}const l3=(e,t=!1)=>(document.hasFocus()||t)&&(e===document.activeElement||e?.contains(document.activeElement)),zt=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:wx,EmptyObject:vx,OSType:Go,arrayMove:function(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o},asNumber:e=>{const t=(n=>1*n)(e);return Number.isFinite(t)?t:0},camelToPrettyCase:e=>e.length===1?e.toUpperCase():e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:a3,cancelTimeout:e=>{cancelAnimationFrame(e.id)},castToString:e=>e==null||e===void 0?"":typeof e!="string"?""+e:e,cloneObject:e=>r3(e)?e:JSON.parse(JSON.stringify(e)),consoleWithNoSource:(...e)=>new Promise(t=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,e),t()})}),debounce:function(e,t=300,n=!1){let o,r,i,a,d=0;function c(){let p=Date.now()-d;p<t&&p>=0?o=setTimeout(c,t-p):(o=null,n||(a=e.apply(i,r),i=r=null))}t==null&&(t=100);const u=function(){i=globalThis,r=arguments,d=Date.now();var p=n&&!o;return o||(o=setTimeout(c,t)),p&&(a=e.apply(i,r),i=r=null),a};return u.clear=function(){o&&(clearTimeout(o),o=null)},u.flush=function(){o&&(a=e.apply(i,r),i=r=null,clearTimeout(o),o=null)},u},deepEqual:function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;let o,r,i;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){let a=i[r];if(!(a==="_owner"&&t.$$typeof||e(t[a],n[a])))return!1}return!0}return t!=t&&n!=n},deepFreeze:function e(t){return Object.freeze(t),Object.keys(t).forEach(n=>{typeof t[n]!="object"||t[n]===null||Object.isFrozen(t[n])||e(t[n])}),t},deepMerge:fi,diffValues:(e,t)=>{const n={},o=Object.keys(t),r=o.length;for(let i=0;i<r;i++){const a=o[i];e[a]!==t[a]&&(e[a]===void 0?n[a]=t[a]:n[a]=e[a])}return Object.keys(n).length===0?null:n},findEqualOrGreater:function(e,t,n=n3){let o=0,r=e.length-1;for(;o<=r;){let i=Math.floor((o+r)/2),a=n(e[i]);if(a===t)return i;a<t?o=i+1:r=i-1}return o},findEqualOrLesser:function(e,t,n=n3){let o=e.length-1,r=0;for(;o>=r;){let i=Math.floor((o+r)/2),a=n(e[i]);if(a===t)return i;a>t?o=i-1:r=i+1}return o},findNextStep:(e,t=!0,n=15,o=10,r=400)=>{const i=Math.max(e-o,0)+(t?1:-1);return Math.min(r,Math[t?"ceil":"floor"](i/n)*n+o)},getDPI:()=>{let e=1;return typeof window=="object"&&(e=window.devicePixelRatio||1),e},getFromPath:(e,t)=>{const n=t.split(".");let o=e;for(let r=0;r<n.length;r++){const i=n[r];if(!o)return null;let a=o[i];if(typeof a=="function"&&(a=a.bind(o)()),!a||!Da(a))return a;o=a}return o??null},getOS:Ml,hasFocus:l3,isDefined:e=>e!=null,isEmpty:e=>e==null||e==="",isEqualArrays:Op,isEqualBounds:(e,t)=>e===t||!(e&&!t||t&&!e)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,isEqualObjectKeys:(e,t)=>{if(e===t)return!0;if(e&&!t||t&&!e)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++)if(e[n[o]]!==t[n[o]])return!1;return!0},isNode:Fp,isNullOrUndefined:r3,isNumeric:e=>{const t=1*e;return Number.isFinite(t)&&typeof t=="number"},isObject:Da,isPromiseLike:e=>!!e&&typeof e.then=="function",isRectInsideRect:(e,t)=>e.top>=t.top&&e.bottom<=t.bottom&&e.left>=t.left&&e.right<=t.right,isRectIntersect:i3,mergeContentful:(...e)=>{const t=e.length;if(t>0&&e[t-1]!==void 0&&!Da(e[t-1]))return e[t-1];let n=e[0]||{};for(let o=1;o<t;o++)n=fi(n,e[o]||{},{arrayMerge:(r,i)=>[...i]});return n},nextTick:e=>{typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{e()}):(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{e()})},openFileDialog:(e="*.*")=>new Promise((t,n)=>{if(!a3)return void n("Unable to open dialog with no dom.");const o=document.createElement("input");o.type="file",o.accept=e;let r=null,i=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{r||i||(i=!0,t(null))},1e3)},{once:!0,passive:!0}),o.onchange=()=>{if(r=o.files[0],r){if(i)return void console.warn("File open detected after faux cancel.",r);t(r)}},o.autofocus=!0,o.click()}),rafThrottle:e=>{let t,n=!1,o=function(){n=!1,e(t)};return function(r){t=r,t&&t.persist&&t.persist(),n||(n=!0,requestAnimationFrame(o))}},removeEmptyProperties:Ap,removeEqualValues:Pp,removeListenerAll:e=>{if(!e)return[];for(let t=0;t<e.length;t++)e[t]&&e[t]();return[]},requestTimeout:(e,t)=>{const n=o3(),o={id:requestAnimationFrame(function r(){o3()-n>=t?e.call(null):o.id=requestAnimationFrame(r)})};return o},roundAccurately:(e,t=0)=>{if(e==null||!isFinite(e))return null;const n=10**t;return Number(Math.round(e*n)/n)},setToPath:(e,t,n)=>{const o=t.split(".");let r=e;if(!r)throw new Error("Can not set path to a null path.");for(let i=0;r&&i<o.length-1;i++){const a=o[i];let d=r[a];if(d==null&&(d={},r[a]=d),!Da(d))throw new Error("Can not set path to a non object path.");r=d}if(typeof n!="number"&&typeof n!="boolean"&&typeof n!="string"&&!Da(n))throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);return r[o[o.length-1]]=n,e},splitNumber:e=>{let t=Math.abs(e);if(isNaN(t)||!isFinite(e))return null;let n=0|t,o=t-n,r=0,i=0,a=1;if(o>5e-8)for(;i<8&&Math.abs(r/a-o)>5e-8;)i++,a*=10,r=Math.round(o*a);return{ip:Math.trunc(e),fp:r,ipLength:Math.ceil(Math.log10(n+1)),fpLength:i}},subtractRect:(e,t,n=!1)=>{if(!t)return[e];if(!i3(e,t))return[];const o=[];let r=e;const i=()=>{t.top>r.top&&t.top<r.bottom&&(o.push({...r,bottom:t.top}),r={...r,top:t.top})},a=()=>{t.bottom>r.top&&t.bottom<r.bottom&&(o.push({...r,top:t.bottom}),r={...r,bottom:t.bottom})},d=()=>{t.right>r.left&&t.right<r.right&&(o.push({...r,left:t.right}),r={...r,right:t.right})},c=()=>{t.left>r.left&&t.left<r.right&&(o.push({...r,right:t.left}),r={...r,left:t.left})};return n?(c(),d(),i(),a()):(i(),a(),d(),c()),o},textToKey:e=>e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(e,t){let n=null;return(...o)=>{const r=Date.now();(!n||r-n>=t)&&(n=r,e(...o))}},toSafeJSON:function e(t){if(t===null||typeof t!="object")return t;if(typeof t.toJSON=="function")return t.toJSON();if(Array.isArray(t))return t.map(o=>e(o));if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();const n={};for(const o in t)t.hasOwnProperty(o)&&(n[o]=e(t[o]));return n},transpose:e=>{if(!e)return e;const t=e.length,n=e[0].length,o=[];for(let r=0;r<n;r++)o[r]=Array(t);for(let r=0;r<t;r++)for(let i=0;i<n;i++)o[i][r]=e[r][i];return o},uuidV4:i1,validEnumValue:(e,t)=>{if(!Object.values(e).includes(t))throw new Error(`Invalid type: ${t??"null"}. Must be one of: ${Object.values(t).join(", ")}.`)},whenFocus:async(e,t=!1)=>new Promise(n=>{l3(e,t)?n(!0):e.addEventListener("focusin",()=>{n(!0)},{once:!0}),e.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:e=>`Invalid argument: '${e}'.`},Symbol.toStringTag,{value:"Module"}));const zp=e=>{const t=new Uint8Array(e),n=t.byteLength;let o="";for(let r=0;r<n;r++)o+=String.fromCharCode(t[r]);if(typeof window<"u"&&typeof globalThis.btoa=="function")return globalThis.btoa(o);if(typeof Buffer<"u")return Buffer.from(o,"binary").toString("base64");throw new Error("Unsupported environment")},tu=e=>new Promise((t,n)=>{if(e)if(typeof FileReader<"u"){const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{n(o.error)},o.readAsText(e)}else if(typeof Buffer<"u"){const o=r=>Buffer.from(r).toString("utf-8");e.arrayBuffer().then(r=>{t(o(r))}).catch(r=>{n(r)})}else n(new Error("Unsupported environment"));else t("")}),Cx=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:zp,base64ToArrayBuffer:e=>{const t=typeof window<"u"&&typeof globalThis.atob=="function"?globalThis.atob(e):Buffer.from(e,"base64").toString("binary"),n=t.length,o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=t.charCodeAt(r);return o.buffer},blobToString:tu},Symbol.toStringTag,{value:"Module"})),Bp="data:image/png;base64,",Np="Unable to resolve image.",s3=e=>new Promise(async(t,n)=>{let o=null;try{o=new Image,o.src=e,o.addEventListener("load",function(){t({width:o.naturalWidth,height:o.naturalHeight})},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(e),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(Np)}),Vc="image/svg+xml";var c3,d3;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Bp,getImageDataUrl:(e,t=1)=>new Promise(async(n,o)=>{let r=null;try{r=new Image,r.src=e,r.addEventListener("load",function(){try{const i=document.createElement("canvas");i.width=r.naturalWidth,i.height=r.naturalHeight,i.getContext("2d").drawImage(r,0,0);const a=i.toDataURL("image/png",t);n({elemImg:r,dataUrl:a})}catch(i){URL.revokeObjectURL(e),o(i)}},{once:!0}),r.addEventListener("error",function(){URL.revokeObjectURL(e),o("Invalid Image")},{once:!0}),await r.decode("sync")}catch{r?.src&&URL.revokeObjectURL(r.src)}r||o(Np)}),loadImageDetails:async(e,t=null)=>{let n=null;const o=async()=>{try{const i=t??"image/*",a=URL.createObjectURL(new Blob([e],{type:i})),d=await s3(a);n={mimeType:i,naturalDimensions:d,asUrl:a}}catch{}},r=async()=>{try{const i=new TextDecoder().decode(e),a=URL.createObjectURL(new Blob([i],{type:Vc})),d=await s3(a);n={mimeType:t??Vc,naturalDimensions:d,asUrl:a,asSVGText:i}}catch{}};if(t===Vc?await r():t.startsWith("image/")?await o():(await o(),n||await r()),!n)throw new Error("Failed to load image");return n}},Symbol.toStringTag,{value:"Module"})),(d3=c3||(c3={})).resolveTypedUpdates=(e,t,n,o)=>{if(e===null)return e;if(e===void 0)return o;let r=e;if(t?.shorthand){const c=t?.shorthand(e,n);c!==void 0&&(r=c)}if(r!==null&&t?.getSubType){const c=t.getSubType(r);c&&(t=c)}const i=t?.properties,a=t?.arrayType??!1;let d=r;if(t&&t.merge&&d&&o)d=t.merge(d,o,n);else if(!a&&i){const c=Object.keys({...r,...o});d=null;for(let u=0;u<c.length;u++){const p=c[u];let m,h=r[p];if(h!==void 0){const g=i[p];m=g?(0,d3.resolveTypedUpdates)(h,g,n,o?.[p]):h}else m=o?.[p];m!=null&&(d=d??{},d[p]=m)}}return d};let nu=class extends Error{constructor(e,t=null){super(e,t),this.name="ChainedError",this._cause=t}get cause(){return this._cause}};const u3=`The Safari browser does not support advanced copy and paste.
|
|
7
7
|
Copy and paste will be limited to within the browser tab.
|
|
8
8
|
|
|
9
9
|
Please use Chrome or Edge if external copy and paste is required.`,Hc=`You do not have permissions to access the clipboard.
|
|
@@ -34,7 +34,7 @@ export default theme;`}function xu(e={},...t){const{breakpoints:n,mixins:o={},sp
|
|
|
34
34
|
`);await navigator.clipboard.writeText(p),r("Copied!"),setTimeout(()=>r(null),2e3)}catch(u){r("Can't copy!"),console.warn("Failed to copy stack trace:",u)}},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Copy stack trace",children:l.jsx(gn.ContentCopy,{sx:{fontSize:"0.875rem"}})}),l.jsx(B.IconButton,{size:"small",onClick:()=>{console.log(e)},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Log error to console",children:l.jsx(gn.BugReport,{sx:{fontSize:"0.875rem"}})})]}),l.jsxs(B.Box,{sx:{mt:1,backgroundColor:"rgba(0, 0, 0, 0.2)",borderRadius:1,p:1,maxHeight:"300px",overflow:"auto",fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.4},children:[d.map((u,p)=>u.isBoundary?l.jsx(B.Box,{sx:{py:1,mt:p>0?1:0,mb:.5,borderTop:p>0?"1px solid rgba(255, 255, 255, 0.1)":"none"},children:l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",fontWeight:"bold",color:m=>u.isBoundary?m.palette.text.primary:m.palette.text.secondary,display:"block"},children:u.line})},`error-${p}`):l.jsxs(B.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,py:.25,pl:1,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},children:[!n&&l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.5,minWidth:"20px",textAlign:"right",userSelect:"none"},children:p+1}),l.jsxs(B.Box,{sx:{flex:1,overflow:"hidden"},children:[l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"inherit"},children:u.line}),u.location&&u.line!==u.location&&l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic"},children:u.location})]})]},`stack-${p}`)),c&&l.jsxs(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic",textAlign:"center",display:"block",mt:1},children:["... and ",a.length-t," more frames"]})]})]})});A2.displayName="StackTrace";const r9=s.memo(s.forwardRef((e,t)=>{const{sx:n,icon:o=l.jsx(gn.Error,{style:{fontSize:48}}),error:r,hideStackTrace:i=!1,stackTraceExpanded:a=!1,...d}=e,c=s.useMemo(()=>((u,p=!1)=>{if(s.isValidElement(u))return u;if(u instanceof Error)return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"500px",width:"100%"},children:[l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,mb:1},children:u.message}),u.cause?l.jsxs(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",mb:1,opacity:.8},children:["Caused by: ",u.cause instanceof Error?u.cause.message:String(u.cause)]}):null,!p&&l.jsx(A2,{error:u,hideLineNumbers:!0})]});const m=u==="string"?u:`Unknown Error: ${String(u)}`;return l.jsx(B.Typography,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em"},children:m})})(r,i,a),[r,i,a]);return s.useMemo(()=>l.jsx(B.Box,{ref:t,sx:{boxSizing:"border-box",alignItems:"center",justifyContent:"center",display:"flex",flexDirection:"row",overflow:"hidden",width:"100%",height:"100%",...n},...d,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",height:"100%",alignItems:"center",justifyContent:"center",boxSizing:"border-box",position:"relative"},children:[l.jsx(B.Box,{className:"backdrop",sx:{backdropFilter:"blur(4px)",borderRadius:u=>`${u.shape.borderRadius}px`,zIndex:-1,position:"absolute",width:"100%",height:"100%",boxSizing:"border-box"}}),l.jsx(B.Paper,{elevation:0,sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",rowGap:"8px",alignSelf:"center",marginBottom:"5%",backgroundColor:u=>u.palette.error.light,color:u=>u.palette.error.contrastText,paddingLeft:u=>u.spacing(2),paddingRight:u=>u.spacing(2),paddingTop:u=>u.spacing(2),paddingBottom:u=>u.spacing(2),borderRadius:u=>`${u.shape.borderRadius}px`,boxShadow:u=>u.shadows[2],"& .primary":{background:u=>`${u.palette.error.contrastText} !important`,border:"solid transparent"},zIndex:1},children:l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:u=>u.spacing(2),width:"100%",maxWidth:"600px"},children:l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:u=>u.spacing(2)},children:[o,c]})})})]})}),[n])}));r9.displayName="ErrorPanel";const i9=s.memo(s.forwardRef((e,t)=>{const{chips:n,sx:o,...r}=e,i=s.useMemo(()=>{if(!n)return null;let a=null;a=Array.isArray(n)?n:[n];const d=[];for(let c=0;c<a.length;c++){const u=a[c];let p=null;typeof u=="string"?p=l.jsx(B.Chip,{label:u,color:"primary",size:"small",sx:{scale:"0.8"}},"chip-"+c):s.cloneElement(u,{key:"chip-"+c}),d.push(p)}return d},[n]);return l.jsx(B.Box,{ref:t,sx:{display:"flex",flexDirection:"row",marginLeft:"4px",gap:"2px",...o},...r,children:i})}));var ju="top",p1="bottom",Mu="right",a9="left",Wv=[ju,p1,Mu,a9],l9="viewport",za="popper";function si(e){return e?(e.nodeName||"").toLowerCase():null}function v0(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ua(e){return e instanceof v0(e).Element||e instanceof Element}function ea(e){return e instanceof v0(e).HTMLElement||e instanceof HTMLElement}function Ru(e){return typeof ShadowRoot<"u"&&(e instanceof v0(e).ShadowRoot||e instanceof ShadowRoot)}var xl=Math.max,X6=Math.min,Y6=Math.round;function Iu(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function s9(){return!/^((?!chrome|android).)*safari/i.test(Iu())}function P2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&ea(e)&&(r=e.offsetWidth>0&&Y6(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Y6(o.height)/e.offsetHeight||1);var a=(ua(e)?v0(e):window).visualViewport,d=!s9()&&n,c=(o.left+(d&&a?a.offsetLeft:0))/r,u=(o.top+(d&&a?a.offsetTop:0))/i,p=o.width/r,m=o.height/i;return{width:p,height:m,top:u,right:c+p,bottom:u+m,left:c,x:c,y:u}}function F0(e){return v0(e).getComputedStyle(e)}function Uv(e){return["table","td","th"].indexOf(si(e))>=0}function ta(e){return((ua(e)?e.ownerDocument:e.document)||window.document).documentElement}function P1(e){return si(e)==="html"?e:e.assignedSlot||e.parentNode||(Ru(e)?e.host:null)||ta(e)}function J6(e){return ea(e)&&F0(e).position!=="fixed"?e.offsetParent:null}function c9(e){var t=v0(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q6(e){return P2(ta(e)).left+c9(e).scrollLeft}function d9(e){var t=F0(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function u9(e){return["html","body","#document"].indexOf(si(e))>=0?e.ownerDocument.body:ea(e)&&d9(e)?e:u9(P1(e))}function p9(e,t){var n;t===void 0&&(t=[]);var o=u9(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=v0(o),a=r?[i].concat(i.visualViewport||[],d9(o)?o:[]):o,d=t.concat(a);return r?d:d.concat(p9(P1(a)))}function Du(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function e4(e,t,n){return t===l9?Du(function(o,r){var i=v0(o),a=ta(o),d=i.visualViewport,c=a.clientWidth,u=a.clientHeight,p=0,m=0;if(d){c=d.width,u=d.height;var h=s9();(h||!h&&r==="fixed")&&(p=d.offsetLeft,m=d.offsetTop)}return{width:c,height:u,x:p+Q6(o),y:m}}(e,n)):ua(t)?function(o,r){var i=P2(o,!1,r==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(t,n):Du(function(o){var r,i=ta(o),a=c9(o),d=(r=o.ownerDocument)==null?void 0:r.body,c=xl(i.scrollWidth,i.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),u=xl(i.scrollHeight,i.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),p=-a.scrollLeft+Q6(o),m=-a.scrollTop;return F0(d||i).direction==="rtl"&&(p+=xl(i.clientWidth,d?d.clientWidth:0)-c),{width:c,height:u,x:p,y:m}}(ta(e)))}function qv(e){var t=p9(P1(e)),n=["absolute","fixed"].indexOf(F0(e).position)>=0&&ea(e)?function(o){for(var r=v0(o),i=J6(o);i&&Uv(i)&&F0(i).position==="static";)i=J6(i);return i&&(si(i)==="html"||si(i)==="body"&&F0(i).position==="static")?r:i||function(a){var d=/firefox/i.test(Iu());if(/Trident/i.test(Iu())&&ea(a)&&F0(a).position==="fixed")return null;var c=P1(a);for(Ru(c)&&(c=c.host);ea(c)&&["html","body"].indexOf(si(c))<0;){var u=F0(c);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||d&&u.willChange==="filter"||d&&u.filter&&u.filter!=="none")return c;c=c.parentNode}return null}(o)||r}(e):e;return ua(n)?t.filter(function(o){return ua(o)&&function(r,i){var a=i.getRootNode&&i.getRootNode();if(r.contains(i))return!0;if(a&&Ru(a)){var d=i;do{if(d&&r.isSameNode(d))return!0;d=d.parentNode||d.host}while(d)}return!1}(o,n)&&si(o)!=="body"}):[]}const Zv={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(e){var t=e.state,n=e.name,o=function(g,f){f===void 0&&(f={});var x,y=f,w=y.placement,b=w===void 0?g.placement:w,C=y.strategy,k=C===void 0?g.strategy:C,E=y.boundary,M=E===void 0?"clippingParents":E,T=y.rootBoundary,F=T===void 0?l9:T,_=y.elementContext,O=_===void 0?za:_,S=y.altBoundary,v=S!==void 0&&S,D=y.padding,j=D===void 0?0:D,R=function(z){return Object.assign({},{top:0,right:0,bottom:0,left:0},z)}(typeof j!="number"?j:(x=j,Wv.reduce(function(z,q){return z[q]=x,z},{}))),P=O===za?"reference":za,I=g.rects.popper,L=g.elements[v?P:O],H=function(z,q,G,Q){var Y=q==="clippingParents"?qv(z):[].concat(q),te=[].concat(Y,[G]),re=te[0],ge=te.reduce(function(J,se){var Se=e4(z,se,Q);return J.top=xl(Se.top,J.top),J.right=X6(Se.right,J.right),J.bottom=X6(Se.bottom,J.bottom),J.left=xl(Se.left,J.left),J},e4(z,re,Q));return ge.width=ge.right-ge.left,ge.height=ge.bottom-ge.top,ge.x=ge.left,ge.y=ge.top,ge}(ua(L)?L:L.contextElement||ta(g.elements.popper),M,F,k),W=P2(g.elements.reference),A=function(z){var q,G=z.reference,Q=z.element,Y=z.placement,te=Y?Y.split("-")[0]:null,re=Y?Y.split("-")[1]:null,ge=G.x+G.width/2-Q.width/2,J=G.y+G.height/2-Q.height/2;switch(te){case ju:q={x:ge,y:G.y-Q.height};break;case p1:q={x:ge,y:G.y+G.height};break;case Mu:q={x:G.x+G.width,y:J};break;case a9:q={x:G.x-Q.width,y:J};break;default:q={x:G.x,y:G.y}}var se=te?function(Me){return["top","bottom"].indexOf(Me)>=0?"x":"y"}(te):null;if(se!=null){var Se=se==="y"?"height":"width";switch(re){case"start":q[se]=q[se]-(G[Se]/2-Q[Se]/2);break;case"end":q[se]=q[se]+(G[Se]/2-Q[Se]/2)}}return q}({reference:W,element:I,placement:b}),U=Du(Object.assign({},I,A)),X=O===za?U:W,ee={top:H.top-X.top+R.top,bottom:X.bottom-H.bottom+R.bottom,left:H.left-X.left+R.left,right:X.right-H.right+R.right},V=g.modifiersData.offset;if(O===za&&V){var $=V[b];Object.keys(ee).forEach(function(z){var q=[Mu,p1].indexOf(z)>=0?1:-1,G=[ju,p1].indexOf(z)>=0?"y":"x";ee[z]+=$[G]*q})}return ee}(t,e.options),r=t.modifiersData.preventOverflow||{x:0,y:0},i=r.x,a=r.y;let d=t.rects.popper,c=d.width,u=d.height,p=t.placement.split("-")[0],m=p==="left"?"left":"right",h=p==="top"?"top":"bottom";t.modifiersData[n]={width:c-o[m]-i,height:u-o[h]-a}}},Gv=[0,2],h9=s.memo(s.forwardRef((e,t)=>{const{sx:n,open:o,children:r,label:i,offsets:a=Gv,anchorEl:d,anchorPosition:c,onMount:u,onOpening:p,onOpen:m,onClosing:h,onClose:g,resizeOnOverflow:f=!0,...x}=e;if(Array.isArray(r))throw new Error("children can not be an array");const y=_2(),w={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:H}){const{height:W}=H.modifiersData.maxSize;H.styles.popper.maxHeight=W-10+"px"}},b=s.useMemo(()=>{const H=[{name:"offset",options:{offset:a}},{name:"flip",enabled:!0,options:{rootBoundary:"document"}}];return f&&H.unshift(Zv,w),H},[f,a]),[C,k]=s.useState(!1),E=s.useRef(null),M=un(()=>{u?.(D.current,E.current)},[p]),T=un(p,[p]),F=un(m,[m]),_=un(h,[h]),O=un(()=>{k(!1),g?.()},[g]),[S,v]=s.useState(!1),D=s.useRef(null),j=s.useRef(!0),R=s.useMemo(()=>({onFirstUpdate:()=>{j.current&&(v(!0),M?.(),j.current=!1)}}),[o,C]);s.useEffect(()=>{o&&S?T?.():!o&&C&&_?.(),o&&k(o)},[o,S]);const P=s.useMemo(()=>({getBoundingClientRect:()=>c?new DOMRect(c?.left||0,c?.top||0,0,0):d.getBoundingClientRect()}),[c,d]);s.useImperativeHandle(t,()=>({instance:()=>E.current,element:()=>D.current}),[]);const{getPortalContainer:I}=I2(),L=s.useMemo(()=>({zIndex:o?"1300":"1299",display:"flex",pointerEvents:C&&o?void 0:"none",maxWidth:"100%",maxHeight:"100%",...n}),[n,o,C]);return l.jsx(B.Popper,{ref:D,popperRef:E,container:I,anchorEl:P,open:C,role:void 0,popperOptions:R,transition:!0,sx:L,placement:"bottom-start",modifiers:b,...x,children:({TransitionProps:H,placement:W,...A})=>{const{in:U,onEnter:X,onExited:ee,...V}=H??{};return l.jsx(B.Grow,{...V,in:o,onEnter:()=>{X?.(),F()},onExited:()=>{ee?.(),O()},timeout:{enter:y.transitions.duration.shorter,exit:0},style:{transformOrigin:W==="bottom-start"?"left top":"center bottom"},children:typeof r=="function"?r({TransitionProps:H,placement:W,...A}):r||{}})}})}));h9.displayName="ExhibitPopper";const Lr={Toolbar:"toolbar",Menuitem:"menuitem"},wn=e=>{const{closeFloat:t,closeFloatAll:n,floatReference:o,popupContainer:r,children:i,className:a,sx:d,...c}=e;return l.jsx(B.Box,{className:jo("menu",a),sx:{display:"flex",flexDirection:"column",...d},...c,children:i})},t4=(e,t,n)=>l.jsx(gn.ArrowDropDown,{sx:{marginLeft:e?void 0:t?"-5px":"-3px",marginRight:e?void 0:t?"-5px":"-6px",transform:()=>{let o;return t&&(o=(o?o+" ":"")+"scale(0.8)"),n&&(o=(o?o+" ":"")+"rotate(180deg)"),o}},color:"inherit"}),Kv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Xv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Lu=function(e,t=null){if(!e)return e;e=e.replace(Kv,function(o,r,i,a){return r+r+i+i+a+a});let n=Xv.exec(e);return n?t===null?`rgb(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)})`:`rgb(${parseInt(n[1],16)} ${parseInt(n[2],16)} ${parseInt(n[3],16)} / ${100*t}%)`:e},Er=function(e,t=.2,n="light"){if(!e)return e;let o=n!=="dark";return t<0&&(o=!o,t*=-1),e=Lu(e),o?dt.darken(e,Math.max(0,Math.min(1,1*t))):dt.lighten(e,Math.max(0,Math.min(1,1.5*t)))},n4=(e,t)=>{let n=yu({palette:{mode:e?"dark":"light"}}),o={typography:{},palette:{mode:e?"dark":"light",text:{secondary:e?n.palette.text.secondary:dt.alpha(n.palette.text.secondary,.75),icon:e?dt.alpha(n.palette.text.secondary,.7):dt.alpha(n.palette.text.primary,.75)}},components:{MuiDialogTitle:{styleOverrides:{root:{fontWeight:"normal"}}},MuiSelect:{styleOverrides:{iconOutlined:{top:"unset"}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"0px !important",overflow:"hidden",marginLeft:"0px",marginRight:"6px",padding:"1px 1px",border:"solid transparent 1px"}}},MuiMenuItem:{styleOverrides:{root:{paddingTop:"2px",paddingBottom:"2px",marginLeft:"4px",marginRight:"4px",paddingLeft:"6px",paddingRight:"18px",borderRadius:"4px",fontSize:"0.875em","@media (pointer: coarse)":{fontSize:"1em"},"&.Mui-selected":{}}}},MuiDivider:{styleOverrides:{root:{marginTop:"4px !important",marginBottom:"4px !important",marginLeft:"0px",marginRight:"0px"}}},MuiPopper:{styleOverrides:{root:{"& .menu":{marginTop:"4px",marginBottom:"4px",borderRadius:"4px"}}}},SmartInputField:{styleOverrides:{automatic:{transition:"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",color:function(){return n.palette.text.secondary}},dirty:{fontStyle:"italic",color:function(){return n.palette.text.secondary}}}}}},r=o;return t&&(r=Mp.deepmerge(o,t)),yu(r)};function F2(e,t){t=Mp.deepmerge({track:Er(e.palette.background.paper,.05,e?.palette.mode),thumb:Er(e.palette.background.paper,.3,e?.palette.mode),active:e.palette.primary.main,corner:e.palette.background.paper,outline:!1},t||{});const n={"&::-webkit-scrollbar, & *::-webkit-scrollbar":{backgroundColor:dt.alpha(t.track,.2),width:"13px",height:"13px"},"&::-webkit-scrollbar-button":{display:"none"},"& .scrollbar-button":{fill:t.thumb,backgroundColor:"transparent",transition:"fill opacity 260ms ease",width:"13px",height:"13px"},"& .scrollbar-button:hover:not([disabled])":{fill:t.active},"& .scrollbar-button:disabled":{opacity:.8},"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track":{},"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece":{},"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb":{borderRadius:8,backgroundColor:t.thumb,minHeight:"24px",minWidth:"24px",border:`2px solid ${t.track}`},"&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner":{backgroundColor:t.corner||t.thumb}};return to.getOS()===to.OSType.Firefox&&(n["* .pseudo-scrollbar"]={scrollbarColor:`${t.thumb} transparent`},n["* .pseudo-scrollbar:hover:not([disabled])"]={scrollbarColor:`${t.active} transparent`}),n}const m9=s.memo(s.forwardRef((e,t)=>{const{open:n,anchorEl:o,anchorPosition:r,label:i,floatReference:a,createPopupPanel:d=wn,popperProps:c,onMount:u,onClosing:p,onClose:m,onOpening:h,onOpen:g,children:f,sx:x,...y}=e,w=un(p,[p]),b=un(m,[m]),C=un(h,[h]),k=un(g,[g]),[E,M]=s.useState(),T=s.useRef(null),F=un((O,S)=>{M(O),u?.(T.current,S)},[u]),_=s.useMemo(()=>{const O={popupContainer:E,floatReference:a,children:f,...y},S=d(O);return l.jsx(B.Paper,{elevation:8,ref:T,sx:{display:"flex",overflow:"auto",outline:"none","&.MuiPaper-root":v=>F2(v)},tabIndex:0,children:S})},[d,f,E,a]);return l.jsx(h9,{ref:t,anchorEl:o,anchorPosition:r,label:i,open:n,onMount:F,onOpening:C,onOpen:k,onClosing:w,onClose:b,...c,children:_})}));m9.displayName="ExhibitFloatPanel";const I0=new Map;let ud=null;const D0=new Map;let g0=null;const pd=(e=null,t,n,o)=>(g0&&(g0.fn.clear(),g0=null),e===0?t:(e===null&&(e=120),g0={fn:to.debounce(()=>t(),e),setReferences:n,isClose:o},g0.fn)),f9=(e,t)=>{if(t===null)return;e.add(t);const n=I0.get(t.key);if(!n)return;const o=D0.get(n);o&&f9(e,o)},o4=e=>{const t=new Set;return f9(t,e),t},l0=e=>{const{anchor:t,label:n=null,parentFloat:o=null,onOpen:r,onClose:i,popperProps:a,createPopupPanel:d=wn}=e??{},c=un(r,[r]),u=un(i,[i]),[p,m]=s.useState(null),[h,g]=s.useState(!1),[f,x]=s.useState(!1),y=s.useMemo(()=>o===null?(ud===null&&(ud={key:{label:"root"},isRoot:!0,parent:null,open:()=>null,close:z=>null,closeChild:z=>null,onChildVisible:()=>{},onChildHidden:()=>{},closeAll:()=>P(0),floatElement:()=>null,anchorElement:()=>null}),ud):o,[]),w=s.useMemo(()=>({label:n}),[]),b=s.useRef(null),C=s.useRef(t);s.useEffect(()=>{C.current=t},[t]);const k=z=>{const q=I0.get(z);let G=null;return q&&(G=D0.get(q)?.close(0)),G},E=()=>k(H.key),[M,T]=s.useState(),F=()=>{if(!p)return void v();const z=new Promise((q,G)=>{T(Q=>({resolve:q,reject:G}))});return E(),I0.delete(y.key),m(!1),z};s.useEffect(()=>{M&&(M.resolve(),T(null))},[h,f,M]);const _=s.useCallback(()=>{let z=y;for(;z.parent;)z=z.parent;return k(z.key)},[]),O=()=>{if(p)return void v();y&&D0.get(y.key)?.open(0);const z=I0.get(y.key);z&&z!==w&&D0.get(z)?.close(0),requestAnimationFrame(()=>{I0.set(y.key,H.key),m(!0)})},[S,v]=s.useReducer(z=>z+1,0),D=s.useCallback(z=>d===null?null:d({closeFloat:P,closeFloatAll:L,...z}),[d]),j=d===null,R=un((z=120)=>pd(z,O,new Set([H]),!1)(),[O]),P=un((z=60)=>pd(z,F,o4(H),!0)(),[F]),I=un((z=360)=>pd(z,E,o4((q=>{const G=I0.get(q.key);return G&&D0.get(G)||null})(H)),!0)(),[E]),L=un(_,[_]),H=s.useMemo(()=>({key:w,isRoot:!1,label:n,parent:y,onChildVisible:()=>{x(!0)},onChildHidden:()=>{x(!1)},open:R,close:P,closeChild:I,closeAll:L,floatElement:()=>b.current,anchorElement:()=>C.current}),[]);s.useEffect(()=>{D0.set(w,H)},[H]),s.useEffect(()=>()=>{D0.delete(w),P(0)},[]),s.useEffect(()=>{p&&!j&&(g(!0),y.onChildVisible())},[p,j]);const W=s.useCallback(z=>{z.which===zo.Escape&&(z.preventDefault(),z.stopPropagation(),P(0))},[]),A=s.useRef(null),U=s.useCallback(()=>{const z=A.current,q=b.current;z&&q&&(requestAnimationFrame(()=>{(q.contains(document.activeElement)||document.activeElement===document.body)&&z.focus()}),A.current=null),u?.()},[]),X=s.useCallback(z=>{b.current=z,z.addEventListener("focus",G=>{A.current=G.relatedTarget},{once:!0,passive:!0});const q=document.activeElement;requestAnimationFrame(()=>{q===document.activeElement&&z.focus()})},[]),[ee,V]=s.useState();s.useEffect(()=>{j&&(p?c?.():p===!1&&u?.()),V(h?l.jsx(m9,{floatReference:H,open:p,label:n,anchorEl:t,onOpening:()=>{c?.(),y.onChildVisible()},onClosing:U,onClose:()=>{g(!1),y.onChildHidden()},onMount:X,popperProps:{onKeyDown:W,onMouseEnter:z=>{p&&g0?.isClose&&g0.setReferences.has(H)&&(g0.fn.clear(),g0=null,H.closeChild())},...a},createPopupPanel:D}):null)},[h,p,n,j,a,D,S]);const $=un(z=>{if(I0.size===0)return;let q=!1;I0.forEach(G=>{const Q=D0.get(G);!q&&Q&&(Q.floatElement()?.contains?.(z.target)&&(q=!0),Q.anchorElement()?.contains?.(z.target)&&(q=!0))}),q||_()},[_]);return s.useEffect(()=>{if(!p||!y.isRoot)return;const z=q=>{$(q)};return document.addEventListener("mousedown",z),document.addEventListener("touchstart",z),document.addEventListener("focus",z),()=>{document.removeEventListener("mousedown",z),document.removeEventListener("touchstart",z),document.removeEventListener("focus",z)}},[p,y]),{component:ee,reference:H}},Yv=s.memo(s.forwardRef((e,t)=>{const{nestedChildren:n,variant:o,disabled:r=!1,createPopupPanel:i,...a}=e,d={disabled:r,createPopupPanel:un(c=>{if(!n||n.length===0)return null;const{popupContainer:u,floatReference:p,ref:m,...h}=c,g=[];for(let f=0;f<n.length;f++){const x=n[f];x&&g.push(l.jsx(Yv,{parentFloat:p,...h,...x},f))}return l.jsxs(B.Box,{ref:t,sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:["Children here",g,l.jsx(lr,{parentFloat:p,children:"Close other children"})]})},[n]),...a};return l.jsx(o===Lr.Toolbar?Gr:Jl,{...d})})),Jv={placement:"right-start"},g9=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,createPopupPanel:i,popperProps:a=Jv,label:d,...c}=e;(function(y){if(!y)throw new Error("Invariant failed")})(s.isValidElement(n));const u=n,p=s.useMemo(()=>({...u?.props,...c,onContextMenu:y=>{u?.props?.onContextMenu?.(y),y.isDefaultPrevented()||(c?.onContextMenu?.(y),y.isDefaultPrevented()||(g(y),y.preventDefault()))}}),[c,u?.props]),m=un(i,[i]),[h,g]=s.useState(null),{reference:f,component:x}=l0({label:d??"contextMenu",popperProps:a,parentFloat:r,anchor:{getBoundingClientRect:()=>new DOMRect(h?.clientX||0,h?.clientY||0)},onClose:()=>g(null),createPopupPanel:m});return s.useEffect(()=>{h?f.open(0):f.close(0)},[h]),l.jsxs(l.Fragment,{children:[s.cloneElement(n,p),x]})})),br=s.forwardRef((e,t)=>{const{slotProps:n,...o}=e,{getPortalContainer:r}=I2();return l.jsx(B.Tooltip,{ref:t,slotProps:{...n,popper:{container:r,...n?.popper||{}}},...o})});br.displayName="SimpleTooltip";const Ba=s.memo(e=>{const{modifier:t,sx:n,...o}=e;return l.jsx(B.Box,{sx:{marginLeft:"1px",marginRight:"1px",borderRadius:"4px",borderStyle:"solid",borderTopWidth:"1px",borderLeftWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"2px",borderTopColor:r=>dt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderLeftColor:r=>dt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderRightColor:r=>dt.alpha(r.palette.background.paper,r.palette.action.disabledOpacity),borderBottomColor:r=>dt.alpha(r.palette.background.paper,1-r.palette.action.disabledOpacity),backgroundColor:r=>dt.alpha(r.palette.action.hover,r.palette.action.disabledOpacity),paddingLeft:"4px",paddingRight:"4px",minHeight:"1.6em",display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"content-box",overflow:"hidden",...n},...o,children:l.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center","& *":{fontWeight:"500"}},children:t})})}),Qv=to.getOS()===to.OSType.MacOS||to.getOS()===to.OSType.IOS?"Cmd":"Ctrl",z2=(e,t=!1,n=null)=>{if(Array.isArray(e)){let i=[],a=e;for(let d=0;d<a.length;d++)i.push(z2(a[d],t,n??""+d));return l.jsx(B.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:i},n)}if(!e?.key)return null;const o={};for(let i=0;e.modifiers&&i<e.modifiers.length;i++)o[e.modifiers[i]]=!0;const r=[];return o?.ctrl&&(r.push(l.jsx(Ba,{modifier:t?"^":l.jsx("div",{style:{paddingRight:"1px"},children:Qv})},"ctrl")),r.push("+")),o?.alt&&(r.push(l.jsx(Ba,{modifier:t?"⌥":"Alt"},"alt")),r.push("+")),o?.shift&&(r.push(l.jsx(Ba,{modifier:t?"⇧":l.jsx("div",{style:{paddingRight:"1px"},children:"Shift"})},"shift")),r.push("+")),o?.meta&&(r.push(l.jsx(Ba,{modifier:t?l.jsx("div",{style:{paddingTop:"1px"},children:"⌘"}):"Meta"},"meta")),r.push("+")),r.push(l.jsx(Ba,{modifier:nw.toPrettyKeyCode(e.key)},"character")),l.jsx(B.Box,{sx:{display:"flex",alignItems:"center"},children:r},n)},Bo=s.memo(s.forwardRef((e,t)=>{const{disabled:n=!1,label:o,shortcut:r,chips:i,description:a,maxWidth:d=280,useModifierSymbols:c=!1,children:u,simple:p,componentDisabled:m=!1,sx:h,...g}=e;let f=null;return r&&(f=z2(r,c)),l.jsx(br,{slotProps:{popper:{sx:{"& .MuiTooltip-tooltip":{marginTop:"0px !important"},...h},modifiers:[{name:"offset",options:{offset:[0,14]}}]}},className:"tooltip-wrapper",tabIndex:-1,title:!n&&o?l.jsxs(B.Box,{sx:{maxWidth:`${d}px`},ref:t,children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",marginBottom:a?"4px":"0px"},children:[l.jsx(B.Typography,{variant:"subtitle1",component:"div",flex:"1 1 100%",children:o}),i?l.jsx(i9,{chips:i}):null,f?l.jsx(B.Box,{sx:{marginLeft:"8px"}},"leadingSpace"):l.jsx(l.Fragment,{}),f]}),a?l.jsx(B.Typography,{variant:"caption",sx:{whiteSpace:"pre-line",lineHeight:"1.4"},children:a}):l.jsx(l.Fragment,{})]}):"",enterDelay:260,enterNextDelay:130,leaveDelay:230,disableInteractive:!0,...g,children:l.jsx("div",{style:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},children:u})})})),xc=l.jsx(sa,{}),eS=xe(l.jsx(g2,{})),gr=s.memo(s.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,disableHover:r=!1,parentFloat:i,selected:a,icon:d,tooltipProps:c,children:u,primary:p,sx:m,className:h,onFocus:g,onBlur:f,...x}=e,[y,w]=s.useState(!1),b={marginRight:"0px",padding:n?"2px":"7px",borderRadius:T=>`${T.shape.borderRadius}px`,color:T=>p?void 0:T.palette.text.icon??T.palette.action.active,border:T=>`solid ${o?T.palette.divider:"transparent"} 1px`,"& .MuiTouchRipple-child":{borderRadius:T=>`${T.shape.borderRadius}px !important`},"&.Mui-selected":{backgroundColor:T=>dt.alpha(T.palette.text.primary,T.palette.action.selectedOpacity),border:T=>`solid ${o?T.palette.text?.primary:T.palette.divider} 1px`},"&.Mui-disabled":{border:T=>`solid ${o?T.palette.divider:"transparent"} 1px`},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},"&.Mui-focusVisible":{outline:"solid transparent 1px",border:"1px solid transparent"},...m},C={"&:hover:not(.Mui-disabled, [disabled])":{color:T=>T.palette.text.primary,border:T=>`solid ${o?T.palette.text?.primary:T.palette.divider} 1px`,"&.Mui-selected":{backgroundColor:T=>dt.alpha(T.palette.text.primary,T.palette.action.selectedOpacity+T.palette.action.hoverOpacity)},"> .outline-hover":{outline:T=>`solid ${o?T.palette.text?.primary:T.palette.divider} 1px`},backgroundColor:null},"&.Mui-focusVisible":{outline:T=>`solid ${T.palette.primary.main} 1px`,border:T=>`1px solid ${T.palette?.primary?.main}`,zIndex:1}};let k=b;r||(k=to.mergeContentful(b,C));const E=s.useMemo(()=>{let T=typeof d=="function"?d():d;return T===null?T:T||(a===void 0?xc:eS)},[d,a]);let M=l.jsxs(B.IconButton,{component:"div",ref:t,className:jo({"Mui-focusVisible":y,"Mui-selected":a},h),onFocus:T=>{w(!0),g?.(T)},onBlur:T=>{w(!1),f?.(T)},size:"small",TouchRippleProps:{center:!1},sx:k,edge:"end",...x,children:[E,u]});if(c)if(c.simple&&c.label&&!c.disabled){const{label:T,description:F,maxWidth:_,shortcut:O,useModifierSymbols:S,componentDisabled:v,simple:D,chips:j,ref:R,...P}=c;M=l.jsx(br,{disableInteractive:!0,title:T??"",...P,children:l.jsx(B.Box,{sx:{display:"flex"},children:M})})}else M=l.jsx(Bo,{children:M,...c});return M})),tS=e=>e.icon,lr=s.memo(s.forwardRef((e,t)=>{const{icon:n=xc,renderIcon:o=tS,parentFloat:r,className:i,onFocus:a,selected:d,onBlur:c,onMouseOver:u,onMouseOut:p,onMouseEnter:m,disabled:h,children:g,sx:f,tooltipProps:x,chips:y,primary:w,...b}=e,[C,k]=s.useState(!1),[E,M]=s.useState(!1),T=s.useMemo(()=>{const _=o?.({icon:n,disabled:h,selected:d});return _?l.jsx(B.ListItemIcon,{className:jo({"Mui-focusVisible":C,"Mui-hovered":E}),sx:{"& .MuiSvgIcon-root":{color:O=>w?void 0:O.palette.text.icon??O.palette.action.active},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{"& .MuiSvgIcon-root":{color:O=>O.palette.text.primary}}},children:_}):null},[o,h,n,C,E,w,d]);let F=l.jsxs(B.MenuItem,{ref:t,disabled:h,onMouseOver:_=>{u?.(_),_.isDefaultPrevented()||M(!0)},onMouseOut:_=>{p?.(_),_.isDefaultPrevented()||M(!1)},onMouseEnter:_=>{m?.(_),_.isDefaultPrevented()||r?.closeChild()},TouchRippleProps:{center:!1},className:jo({"Mui-focusVisible":C,"Mui-hovered":E},i),onFocus:_=>{a?.(_),k(!0)},onBlur:_=>{c?.(_),k(!1)},sx:{flex:"1 1 100%","&.Mui-disabled path.styled":{filter:"grayscale(65%)"},"&.Mui-selected":{color:_=>_.palette.text.primary},color:_=>_.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:_=>_.palette.text.primary},...f},...b,children:[T,g,y?l.jsx(i9,{chips:y}):null]});return x&&(F=l.jsx(Bo,{children:F,placement:"right-start",...x})),F})),pa=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,primary:r=!1,variant:i="subtitle1",...a}=e;return l.jsx(l.Fragment,{children:l.jsx(B.Typography,{ref:t,variant:i,component:"div",sx:{userSelect:"none",fontWeight:"500",paddingLeft:"8px",paddingTop:i==="subtitle1"?"2px":void 0,paddingBottom:i==="subtitle1"?"2px":void 0,color:d=>r?void 0:d.palette.text.secondary,...o},...a,children:n})})})),Gr=s.memo(s.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,label:r,selected:i=!1,onQuickClick:a,parentFloat:d,createPopupPanel:c,popupProps:u,onPopupOpen:p,onPopupClose:m,quickButtonProps:h,createQuickButton:g,tooltip:f="",createTooltip:x,icon:y,disabled:w,buttonProps:b=to.EmptyObject,disableHover:C,touchRippleRef:k,primary:E,children:M,sx:T,className:F,..._}=e,O=_2(),S=s.useMemo(()=>{const J=(se,Se,Me,oe=Me)=>{const ne=typeof o=="boolean"?null:o[se];return typeof ne=="function"?ne(Se):ne||(o?Me:oe)};return{outline:{color:se=>J("color",se,se.palette.divider,"transparent"),hoverColor:se=>J("hoverColor",se,se.palette.text?.primary,se.palette.divider),focusColor:se=>J("focusColor",se,se.palette?.primary?.main)},active:O.palette.mode==="dark"?O.palette.text.secondary:O.palette.text.primary,text:O.palette.text.icon??O.palette.action.active}},[o,O]),[v,D]=s.useState(!1),[j,R]=s.useState(!1),[P,I]=s.useState(!1),L=s.useRef(null),H=s.useRef(null),W=l0({anchor:L.current,label:r,createPopupPanel:c,parentFloat:d,popperProps:u?.popperProps,onClose:()=>{D(!1),m?.()},onOpen:()=>{D(!0),p?.()}}),A=un(J=>{a?.(J),W.reference.close(0)},[a,W]),U=un(()=>{v?W.reference.close(0):W.reference.open(0)},[v,W,d,r]),X=s.useMemo(()=>{const J={"&.bordered":{borderWidth:"1px",borderRadius:"0px",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:he=>S.outline.color(he),"&.Mui-focusVisible":{border:he=>`1px solid ${S.outline.focusColor(he)} !important`},"&:hover:not(.Mui-disabled, [disabled])":{borderColor:()=>C?"transparent":void 0,backgroundColor:()=>C?"transparent":void 0},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{borderColor:he=>S.outline.hoverColor(he)},"&.Mui-selected:not(.Mui-disabled, [disabled])":{borderColor:he=>S.outline.hoverColor(he)},"&.left":{borderTopLeftRadius:he=>`${he.shape.borderRadius}px`,borderBottomLeftRadius:he=>`${he.shape.borderRadius}px`,borderLeftStyle:"solid"},"&.hard-right":{borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:he=>S.outline.color(he)},"&.right":{borderTopRightRadius:he=>`${he.shape.borderRadius}px`,borderBottomRightRadius:he=>`${he.shape.borderRadius}px`,borderRightStyle:"solid"},"&.divider":{borderLeftWidth:"0px !important"}},"& .MuiTouchRipple-child":{borderRadius:he=>`${he.shape.borderRadius}px !important`}},se={"&.Mui-selected":{backgroundColor:he=>dt.alpha(he.palette.primary.main,he.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:he=>dt.alpha(he.palette.primary.main,he.palette.action.selectedOpacity+he.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:he=>dt.alpha(he.palette.primary.main,he.palette.action.selectedOpacity)}}}},Se={maxHeight:"100%","&.Mui-selected":{backgroundColor:he=>dt.alpha(he.palette.text.icon??he.palette.action.active,he.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:he=>dt.alpha(he.palette.text.icon??he.palette.action.active,he.palette.action.selectedOpacity+he.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:he=>dt.alpha(he.palette.text.icon??he.palette.action.active,he.palette.action.selectedOpacity)}}},"&:hover:not(.Mui-disabled, [disabled])":{color:he=>he.palette.text.primary},backgroundColor:()=>C?"transparent":void 0,color:he=>he.palette.text.icon,"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},padding:()=>n?"2px 3px":"7px",marginRight:"0"},Me=to.mergeContentful(Se,J),oe=to.mergeContentful(Me,se),ne=to.mergeContentful(Se,J);return{quickButtonStyling:Me,openQuickButtonStyling:oe,compoundStyling:ne,openCompoundStyling:to.mergeContentful(ne,se)}},[S,C]),ee=un(J=>{const{children:se,ref:Se,...Me}=J;return l.jsx(br,{ref:Se,...Me,disableInteractive:!0,children:se})},[]),V=a||g,$=V&&(h?.tooltip||h?.createTooltip),z=J=>{const{tooltip:se,createTooltip:Se,sx:Me,...oe}=J;let ne=l.jsx(B.IconButton,{sx:{...Me},component:"div",...oe});return $&&(ne=(Se??ee)({title:v?"":se??f,children:l.jsx("div",{children:ne})},v)),ne},q={onKeyDown:J=>{J.keyCode===zo.Space?U():J.keyCode===zo.F4||J.keyCode===zo.Down?W.reference.open(0):J.keyCode===zo.Up&&W.reference.close(0)}};let G=l.jsx(l.Fragment,{});const Q=s.useMemo(()=>typeof y=="function"?y():y,[y]);if(V){let J=v?X.openQuickButtonStyling:X.quickButtonStyling;const se=(g||z)({tabIndex:-1,disabled:w,size:"small",edge:"end",onMouseEnter:()=>{W.reference.parent.closeChild()},onMouseDown:Me=>{Me.button===0&&(Me.preventDefault(),A(Me))},touchRippleRef:k,children:Q,...h,className:jo({"Mui-focusVisible":j||v,"Mui-selected":i,"Mui-hovered":P||v,"Mui-disabled":w,bordered:!0,left:!0,"hard-right":!0},h?.className),sx:{...X.quickButtonStyling,height:"100%",...h?.sx}});let Se=t4(!0,n,v);$&&(Se=(x??ee)({title:v?"":f,children:Se},v)),G=l.jsxs(l.Fragment,{children:[se,l.jsx(B.IconButton,{ref:H,component:"div",className:jo({"Mui-selected":v,"Mui-hovered":P||v,"Mui-disabled":w,"Mui-focusVisible":j||v,bordered:!0,right:!0,divider:!0}),sx:{paddingLeft:(n?0:2)+"px",paddingRight:(n?0:2)+"px",width:()=>"1em",...X.quickButtonStyling,...J},TouchRippleProps:{center:!1},tabIndex:-1,disabled:w,size:"small",edge:"end",onMouseDown:Me=>{Me.button===0&&(Me.preventDefault(),U())},children:Se})]})}else{let J=v?X.openCompoundStyling:X.compoundStyling;G=l.jsx(gr,{ref:H,tabIndex:-1,disabled:w,size:"small",icon:Q,className:jo({"Mui-selected":v||i,"Mui-hovered":P,"Mui-disabled":w,"Mui-focusVisible":j||v,bordered:!0,left:!0,right:!0}),sx:{...X.quickButtonStyling,...J},onMouseDown:se=>{se.button===0&&(se.preventDefault(),U())},children:t4(!1,n,v)})}const{className:Y,sx:te,...re}=b;let ge=l.jsx(B.Box,{onFocus:()=>R(!0),onBlur:()=>R(!1),onMouseOver:()=>I(!0),onMouseOut:()=>I(!1),...q,"aria-label":"split button",ref:L,tabIndex:w?void 0:0,className:jo(Y,"split-button-root",{"Mui-focusVisible":j||v,"Mui-selected":v||i,"Mui-hovered":P,"Mui-disabled":w}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","&:not(.Mui-disabled)":{cursor:"pointer"},marginLeft:o?"1px":"0px",marginRight:o?"1px":"0px",borderRadius:J=>`${J.shape.borderRadius}px`,"&.Mui-focusVisible":{outline:J=>`solid ${J.palette.primary.main} 1px`,zIndex:2},...te},...re,children:G});return $||(ge=(x??ee)({title:v?"":f,children:ge},v)),l.jsxs(B.Box,{className:jo(F,"popupIconButton"),ref:t,..._,sx:{zIndex:j||v?2:void 0,display:"flex",alignItems:"center",...T},children:[ge,W.component]})}));Gr.displayName="ExhibitPopupIconButton";const nS={},Jl=s.memo(s.forwardRef((e,t)=>{const{selected:n=!1,label:o,onQuickClick:r,parentFloat:i,createPopupPanel:a,popupProps:d=nS,onPopupOpen:c,onPopupClose:u,quickButtonProps:p,createQuickButton:m,tooltip:h="",createTooltip:g,icon:f,disabled:x,touchRippleRef:y,primary:w,children:b,sx:C,...k}=e,[E,M]=s.useState(!1),[T,F]=s.useState(!1),[_,O]=s.useState(!1),[S,v]=s.useState(!1),D=s.useRef(null),j=s.useRef(null),R=s.useMemo(()=>{if(!d)return;const{popperProps:$}=d;return{placement:"right-start",offsets:[-4,-2],...$}},[d]),P=l0({anchor:D.current,label:o,createPopupPanel:a,parentFloat:i,popperProps:R,onClose:()=>{M(!1),u?.()},onOpen:()=>{M(!0),c?.()}}),I=un($=>{$.button===0&&(r?.($),P.reference.close(0))},[r]),L=l.jsx(gn.ArrowRight,{sx:{transform:()=>{}}}),H={"&.Mui-selected":{color:$=>$.palette.text.primary,"& svg * ":{color:$=>$.palette.text.primary}}},W=s.useCallback($=>{const{children:z,ref:q,...G}=$;return l.jsx(br,{ref:q,...G,disableInteractive:!0,children:z})},[]),A=r||m,U=$=>{const{tooltip:z,createTooltip:q,...G}=$;return l.jsx(lr,{icon:f,className:jo({"Mui-hovered":_}),sx:{flex:"1 1 100%",...H},...G,children:o})},X={onFocus:()=>{F(!0)},onBlur:()=>F(!1),onMouseOver:()=>{O(!0)},onMouseLeave:()=>{O(!1)},onMouseEnter:()=>{P.reference.open()},onMouseDown:$=>{$.button===0&&$.preventDefault()}};let ee=l.jsx(l.Fragment,{});if(A){const $=(m||U)({tabIndex:-1,disabled:x,onMouseEnter:()=>{P.reference.parent.closeChild()},onMouseDown:z=>{z.button===0&&(z.preventDefault(),I(z))},className:jo("quick-left",{},p?.className),...p});ee=l.jsxs(l.Fragment,{children:[$,l.jsx(B.Divider,{sx:{ml:"0px",mr:"0px"},orientation:"vertical",variant:"middle",flexItem:!0}),l.jsx(B.MenuItem,{ref:j,className:jo({"Mui-selected":E,"Mui-hovered":_}),sx:{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px",paddingLeft:"0px",paddingRight:"0px",marginLeft:"0px",color:z=>w?void 0:z.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:z=>z.palette.text.primary},...H},tabIndex:-1,disabled:x,...X,children:l.jsx(B.Box,{className:"expand-icon",sx:{flex:"none",display:"flex",border:"1px solid transparent",paddingTop:"1px",paddingBottom:"1px",color:z=>w?void 0:z.palette.text.icon??z.palette.action.active},onMouseOver:z=>{z.preventDefault(),v(!0)},onMouseLeave:()=>{v(!1)},onClick:z=>{z.preventDefault(),E?P.reference.close():P.reference.open()},children:L})})]})}else ee=l.jsxs(lr,{ref:j,tabIndex:-1,disabled:x,icon:f,className:jo({"Mui-selected":E||n,"Mui-hovered":_}),sx:{flex:"1 1 100%",paddingRight:"0px",...H},onClick:$=>{$.preventDefault(),E?P.reference.close():P.reference.open()},...X,children:[l.jsx("div",{style:{flex:"1 1 100%"},children:o}),l.jsx(B.Box,{className:"expand-icon2",sx:{flex:"none",display:"flex",color:$=>w?void 0:$.palette.text.icon??$.palette.action.active},children:L})]});let V=l.jsx(B.Box,{"aria-label":"split button",ref:D,tabIndex:x?void 0:0,className:jo({"Mui-disabled":x,"Mui-selected":E,"Mui-focusVisible":T||E,"Mui-hovered":_}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","& .quick-left":{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",marginRight:"-1px"},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},...C},...k,children:ee});return A&&!S&&(p?.tooltip||p?.createTooltip)&&(V=(p?.createTooltip??W)({title:E?"":V??p?.tooltip,children:V},E)),l.jsxs(B.Box,{ref:t,sx:{zIndex:T||E?2:void 0,display:"flex"," .tooltip-wrapper":{display:"flex",flex:"1 1 100%"}},children:[V,P.component]})})),x9=s.memo(s.forwardRef((e,t)=>{const{onSelectToggle:n,selected:o=!1,label:r,shortcut:i,tabIndex:a=0,preventFocus:d=!1,...c}=e;return l.jsx(Bo,{label:r,shortcut:i,children:l.jsx(gr,{ref:t,outlined:!1,tabIndex:a,selected:o,onMouseDown:u=>{d&&u.preventDefault()},onClick:()=>{n?.(!o)},...c})})})),Ql=s.memo(s.forwardRef((e,t)=>{const{children:n,selected:o=!0,outlined:r=!0,sx:i,...a}=e,d={display:"flex",border:u=>o?`solid ${r?u.palette.divider:"transparent"} 1px`:"solid transparent 1px",borderRadius:u=>`${u.shape.borderRadius}px`,backgroundColor:u=>{if(o)return dt.alpha(u.palette.text.icon??u.palette.action.active,u.palette.action.selectedOpacity)}};let c=n;return c===null&&(c=l.jsx(sa,{})),c||(c=l.jsx(g2,{})),c=xe(c),l.jsx(B.Box,{ref:t,sx:{...d,...i},...a,children:c})}));function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wo.apply(null,arguments)}function y9(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}var Ir,oS={state:{},updateModal:function(){},hideModal:function(){},destroyModal:function(){},destroyModalsByRootId:function(){},showModal:function(){return{id:"id",hide:function(){},destroy:function(){},update:function(){}}}},b9=s.createContext(void 0);(function(e){e.SHOW="SHOW",e.HIDE="HIDE",e.UPDATE="UPDATE",e.DESTROY="DESTROY",e.DESTROY_BY_ROOT_ID="DESTROY_BY_ROOT_ID",e.UNKNOWN="UNKNOWN"})(Ir||(Ir={}));var rS={};function iS(e,t){switch(t.type){case Ir.SHOW:var n,o=t.payload,r=o.id,i=o.component,a=o.props,d=o.options;return Wo({},e,((n={})[r]={component:i,props:Wo({},a,{open:!0}),options:d},n));case Ir.HIDE:var c,u=t.payload.id;return e[u]?Wo({},e,((c={})[u]=Wo({},e[u],{props:Wo({},e[u].props,{open:!1})}),c)):e;case Ir.UPDATE:var p,m=t.payload,h=m.id,g=m.props;return e[h]?Wo({},e,((p={})[h]=Wo({},e[h],{props:Wo({},e[h].props,g)}),p)):e;case Ir.DESTROY:var f=t.payload.id,x=Wo({},e);return delete x[f],x;case Ir.DESTROY_BY_ROOT_ID:var y=t.payload.rootId;return Object.keys(e).filter(function(w){return w.split(".")[0]!==y}).reduce(function(w,b){var C;return Wo({},w,((C={})[b]=e[b],C))},{});default:throw new Error("Unexpected action")}}var hd="[ERROR]: Modal ID is missing",w9=function(e){e===void 0&&(e=8);for(var t=[],n=0;n<e;n++)t[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t.join("")},aS=["open"];function lS(e){var t=e.children,n=e.legacy,o=n!==void 0&&n,r=e.suspense,i=r===void 0||r,a=e.fallback,d=a===void 0?null:a,c=s.useReducer(iS,rS),u=c[0],p=c[1],m=s.useCallback(function(w,b){var C=y9(b,aS);w?p({type:Ir.UPDATE,payload:{id:w,props:C}}):console.error(hd)},[p]),h=s.useCallback(function(w){w?p({type:Ir.HIDE,payload:{id:w}}):console.error(hd)},[p]),g=s.useCallback(function(w){w?p({type:Ir.DESTROY,payload:{id:w}}):console.error(hd)},[p]),f=s.useCallback(function(w){w?p({type:Ir.DESTROY_BY_ROOT_ID,payload:{rootId:w}}):console.error("[ERROR]: Modal root ID is missing")},[p]),x=s.useCallback(function(w,b,C){var k=w9(8);return C&&C.rootId&&(k=C.rootId+"."+k),p({type:Ir.SHOW,payload:{id:k,component:w,props:b,options:C}}),{id:k,hide:function(){return h(k)},destroy:function(){return g(k)},update:function(E){return m(k,E)}}},[p,h,g,m]),y=i?s.Suspense:s.Fragment;return s.createElement(b9.Provider,{value:{state:u,updateModal:m,hideModal:h,destroyModal:g,showModal:x,destroyModalsByRootId:f}},t,s.createElement(y,Object.assign({},i&&{fallback:d}),Object.keys(u).map(function(w){var b,C=u[w],k=C.component,E=C.props,M=C.options,T=function(){var F,_;E!=null&&E.onExited&&E.onExited.apply(E,arguments),E!=null&&(F=E.TransitionProps)!=null&&F.onExited&&(_=E.TransitionProps).onExited.apply(_,arguments),g(w)};return b=o?{onExited:T}:{TransitionProps:Wo({},E?.TransitionProps,{onExited:T})},s.createElement(k,Object.assign({},E,{key:w,onClose:function(){M&&M.hideOnClose&&h(w),M&&M.destroyOnClose&&M.hideOnClose&&g(w),E&&E.onClose&&E.onClose.apply(E,arguments)}},M&&!M.destroyOnClose&&b))})))}var sS=["showModal","destroyModalsByRootId"],r4={disableAutoDestroy:!1};function h1(e){e===void 0&&(e=r4);var t=Wo({},r4,e).disableAutoDestroy,n=s.useContext(b9)||oS,o=n.showModal,r=n.destroyModalsByRootId,i=y9(n,sS),a=s.useRef(w9(6));return s.useEffect(function(){return function(){!t&&r&&r(a.current)}},[t,r]),Wo({showModal:s.useCallback(function(d,c,u){return o(d,c,Wo({rootId:a.current,hideOnClose:!0},u))},[o]),destroyModalsByRootId:r},i)}var v9=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],F1=v9.join(","),S9=typeof Element>"u",hi=S9?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,m1=!S9&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},z1=function e(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert");return r===""||r==="true"||n&&t&&e(t.parentNode)},C9=function(e,t,n){if(z1(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(F1));return t&&hi.call(e,F1)&&o.unshift(e),o.filter(n)},k9=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!z1(a,!1))if(a.tagName==="SLOT"){var d=a.assignedElements(),c=e(d.length?d:a.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{hi.call(a,F1)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),p=!z1(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&p){var m=e(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:a,candidates:m})}else i.unshift.apply(i,a.children)}}return r},E9=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},z0=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!E9(e)?0:e.tabIndex},cS=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_9=function(e){return e.tagName==="INPUT"},i4=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},B1=function(e,t){return!(t.disabled||z1(t)||function(n){return _9(n)&&n.type==="hidden"}(t)||function(n,o){var r=o.displayCheck,i=o.getShadowRoot;if(getComputedStyle(n).visibility==="hidden")return!0;var a=hi.call(n,"details>summary:first-of-type")?n.parentElement:n;if(hi.call(a,"details:not([open]) *"))return!0;if(r&&r!=="full"&&r!=="legacy-full"){if(r==="non-zero-area")return i4(n)}else{if(typeof i=="function"){for(var d=n;n;){var c=n.parentElement,u=m1(n);if(c&&!c.shadowRoot&&i(c)===!0)return i4(n);n=n.assignedSlot?n.assignedSlot:c||u===n.ownerDocument?c:u.host}n=d}if(function(p){var m,h,g,f,x=p&&m1(p),y=(m=x)===null||m===void 0?void 0:m.host,w=!1;if(x&&x!==p)for(w=!!((h=y)!==null&&h!==void 0&&(g=h.ownerDocument)!==null&&g!==void 0&&g.contains(y)||p!=null&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(p));!w&&y;){var b,C,k;w=!((C=y=(b=x=m1(y))===null||b===void 0?void 0:b.host)===null||C===void 0||(k=C.ownerDocument)===null||k===void 0||!k.contains(y))}return w}(n))return!n.getClientRects().length;if(r!=="legacy-full")return!0}return!1}(t,e)||function(n){return n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"})}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var o=n.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!hi.call(o,"fieldset[disabled] *")||!i.contains(n)}return!0}o=o.parentElement}return!1}(t))},Ou=function(e,t){return!(function(n){return function(o){return _9(o)&&o.type==="radio"}(n)&&!function(o){if(!o.name)return!0;var r,i=o.form||m1(o),a=function(c){return i.querySelectorAll('input[type="radio"][name="'+c+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")r=a(window.CSS.escape(o.name));else try{r=a(o.name)}catch(c){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",c.message),!1}var d=function(c,u){for(var p=0;p<c.length;p++)if(c[p].checked&&c[p].form===u)return c[p]}(r,o.form);return!d||d===o}(n)}(t)||z0(t)<0||!B1(e,t))},dS=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},uS=function e(t){var n=[],o=[];return t.forEach(function(r,i){var a=!!r.scopeParent,d=a?r.scopeParent:r,c=function(p,m){var h=z0(p);return h<0&&m&&!E9(p)?0:h}(d,a),u=a?e(r.candidates):d;c===0?a?n.push.apply(n,u):n.push(d):o.push({documentOrder:i,tabIndex:c,item:r,isScope:a,content:u})}),o.sort(cS).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},T9=function(e,t){var n;return n=(t=t||{}).getShadowRoot?k9([e],t.includeContainer,{filter:Ou.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dS}):C9(e,t.includeContainer,Ou.bind(null,t)),uS(n)},j9=function(e,t){return(t=t||{}).getShadowRoot?k9([e],t.includeContainer,{filter:B1.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):C9(e,t.includeContainer,B1.bind(null,t))},ni=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return hi.call(e,F1)!==!1&&Ou(t,e)},pS=v9.concat("iframe").join(","),f1=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return hi.call(e,pS)!==!1&&B1(t,e)};const hS=Object.freeze(Object.defineProperty({__proto__:null,focusable:j9,getTabIndex:z0,isFocusable:f1,isTabbable:ni,tabbable:T9},Symbol.toStringTag,{value:"Module"}));function md(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function mS(e,t,n){return(t=function(o){var r=function(i,a){if(typeof i!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var c=d.call(i,a);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function l4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a4(Object(n),!0).forEach(function(o){mS(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a4(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}var yl=function(e){return e?.key==="Tab"||e?.keyCode===9},fS=function(e){return yl(e)&&!e.shiftKey},gS=function(e){return yl(e)&&e.shiftKey},s4=function(e){return setTimeout(e,0)},Na=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return typeof e=="function"?e.apply(void 0,n):e},Rs=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},xS=[];const yS=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(e,t){var n,o=t?.document||document,r=t?.trapStack||xS,i=l4({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:fS,isKeyBackward:gS},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},d=function(_,O,S){return _&&_[O]!==void 0?_[O]:i[S||O]},c=function(_,O){var S=typeof O?.composedPath=="function"?O.composedPath():void 0;return a.containerGroups.findIndex(function(v){var D=v.container,j=v.tabbableNodes;return D.contains(_)||S?.includes(D)||j.find(function(R){return R===_})})},u=function(_){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=O.hasFallback,v=S!==void 0&&S,D=O.params,j=D===void 0?[]:D,R=i[_];if(typeof R=="function"&&(R=R.apply(void 0,function(I){return function(L){if(Array.isArray(L))return md(L)}(I)||function(L){if(typeof Symbol<"u"&&L[Symbol.iterator]!=null||L["@@iterator"]!=null)return Array.from(L)}(I)||function(L,H){if(L){if(typeof L=="string")return md(L,H);var W={}.toString.call(L).slice(8,-1);return W==="Object"&&L.constructor&&(W=L.constructor.name),W==="Map"||W==="Set"?Array.from(L):W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W)?md(L,H):void 0}}(I)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
35
35
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}(j))),R===!0&&(R=void 0),!R){if(R===void 0||R===!1)return R;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var P=R;if(typeof R=="string"){try{P=o.querySelector(R)}catch(I){throw new Error("`".concat(_,'` appears to be an invalid selector; error="').concat(I.message,'"'))}if(!P&&!v)throw new Error("`".concat(_,"` as selector refers to no known node"))}return P},p=function(){var _=u("initialFocus",{hasFallback:!0});if(_===!1)return!1;if(_===void 0||_&&!f1(_,i.tabbableOptions))if(c(o.activeElement)>=0)_=o.activeElement;else{var O=a.tabbableGroups[0];_=O&&O.firstTabbableNode||u("fallbackFocus")}else _===null&&(_=u("fallbackFocus"));if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},m=function(){if(a.containerGroups=a.containers.map(function(_){var O=T9(_,i.tabbableOptions),S=j9(_,i.tabbableOptions),v=O.length>0?O[0]:void 0,D=O.length>0?O[O.length-1]:void 0,j=S.find(function(I){return ni(I)}),R=S.slice().reverse().find(function(I){return ni(I)}),P=!!O.find(function(I){return z0(I)>0});return{container:_,tabbableNodes:O,focusableNodes:S,posTabIndexesFound:P,firstTabbableNode:v,lastTabbableNode:D,firstDomTabbableNode:j,lastDomTabbableNode:R,nextTabbableNode:function(I){var L=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],H=O.indexOf(I);return H<0?L?S.slice(S.indexOf(I)+1).find(function(W){return ni(W)}):S.slice(0,S.indexOf(I)).reverse().find(function(W){return ni(W)}):O[H+(L?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(_){return _.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(_){var O=_.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?h(O.shadowRoot):O},g=function(_){_!==!1&&_!==h(document)&&(_&&_.focus?(_.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=_,function(O){return O.tagName&&O.tagName.toLowerCase()==="input"&&typeof O.select=="function"}(_)&&_.select()):g(p()))},f=function(_){var O=u("setReturnFocus",{params:[_]});return O||O!==!1&&_},x=function(_){var O=_.target,S=_.event,v=_.isBackward,D=v!==void 0&&v;O=O||Rs(S),m();var j=null;if(a.tabbableGroups.length>0){var R=c(O,S),P=R>=0?a.containerGroups[R]:void 0;if(R<0)j=D?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(D){var I=a.tabbableGroups.findIndex(function(X){var ee=X.firstTabbableNode;return O===ee});if(I<0&&(P.container===O||f1(O,i.tabbableOptions)&&!ni(O,i.tabbableOptions)&&!P.nextTabbableNode(O,!1))&&(I=R),I>=0){var L=I===0?a.tabbableGroups.length-1:I-1,H=a.tabbableGroups[L];j=z0(O)>=0?H.lastTabbableNode:H.lastDomTabbableNode}else yl(S)||(j=P.nextTabbableNode(O,!1))}else{var W=a.tabbableGroups.findIndex(function(X){var ee=X.lastTabbableNode;return O===ee});if(W<0&&(P.container===O||f1(O,i.tabbableOptions)&&!ni(O,i.tabbableOptions)&&!P.nextTabbableNode(O))&&(W=R),W>=0){var A=W===a.tabbableGroups.length-1?0:W+1,U=a.tabbableGroups[A];j=z0(O)>=0?U.firstTabbableNode:U.firstDomTabbableNode}else yl(S)||(j=P.nextTabbableNode(O))}}else j=u("fallbackFocus");return j},y=function(_){var O=Rs(_);c(O,_)>=0||(Na(i.clickOutsideDeactivates,_)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Na(i.allowOutsideClick,_)||_.preventDefault())},w=function(_){var O=Rs(_),S=c(O,_)>=0;if(S||O instanceof Document)S&&(a.mostRecentlyFocusedNode=O);else{var v;_.stopImmediatePropagation();var D=!0;if(a.mostRecentlyFocusedNode)if(z0(a.mostRecentlyFocusedNode)>0){var j=c(a.mostRecentlyFocusedNode),R=a.containerGroups[j].tabbableNodes;if(R.length>0){var P=R.findIndex(function(I){return I===a.mostRecentlyFocusedNode});P>=0&&(i.isKeyForward(a.recentNavEvent)?P+1<R.length&&(v=R[P+1],D=!1):P-1>=0&&(v=R[P-1],D=!1))}}else a.containerGroups.some(function(I){return I.tabbableNodes.some(function(L){return z0(L)>0})})||(D=!1);else D=!1;D&&(v=x({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),g(v||a.mostRecentlyFocusedNode||p())}a.recentNavEvent=void 0},b=function(_){(i.isKeyForward(_)||i.isKeyBackward(_))&&function(O){var S=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=O;var v=x({event:O,isBackward:S});v&&(yl(O)&&O.preventDefault(),g(v))}(_,i.isKeyBackward(_))},C=function(_){var O;((O=_)==null?void 0:O.key)!=="Escape"&&O?.key!=="Esc"&&O?.keyCode!==27||Na(i.escapeDeactivates,_)===!1||(_.preventDefault(),n.deactivate())},k=function(_){var O=Rs(_);c(O,_)>=0||Na(i.clickOutsideDeactivates,_)||Na(i.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},E=function(){if(a.active)return function(_,O){if(_.length>0){var S=_[_.length-1];S!==O&&S._setPausedState(!0)}var v=_.indexOf(O);v===-1||_.splice(v,1),_.push(O)}(r,n),a.delayInitialFocusTimer=i.delayInitialFocus?s4(function(){g(p())}):g(p()),o.addEventListener("focusin",w,!0),o.addEventListener("mousedown",y,{capture:!0,passive:!1}),o.addEventListener("touchstart",y,{capture:!0,passive:!1}),o.addEventListener("click",k,{capture:!0,passive:!1}),o.addEventListener("keydown",b,{capture:!0,passive:!1}),o.addEventListener("keydown",C),n},M=function(){if(a.active)return o.removeEventListener("focusin",w,!0),o.removeEventListener("mousedown",y,!0),o.removeEventListener("touchstart",y,!0),o.removeEventListener("click",k,!0),o.removeEventListener("keydown",b,!0),o.removeEventListener("keydown",C),n},T=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(function(_){_.some(function(O){return Array.from(O.removedNodes).some(function(S){return S===a.mostRecentlyFocusedNode})})&&g(p())}):void 0,F=function(){T&&(T.disconnect(),a.active&&!a.paused&&a.containers.map(function(_){T.observe(_,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(_){if(a.active)return this;var O=d(_,"onActivate"),S=d(_,"onPostActivate"),v=d(_,"checkCanFocusTrap");v||m(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=h(o),O?.();var D=function(){v&&m(),E(),F(),S?.()};return v?(v(a.containers.concat()).then(D,D),this):(D(),this)},deactivate:function(_){if(!a.active)return this;var O=l4({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},_);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,M(),a.active=!1,a.paused=!1,F(),function(P,I){var L=P.indexOf(I);L!==-1&&P.splice(L,1),P.length>0&&!P[P.length-1]._isManuallyPaused()&&P[P.length-1]._setPausedState(!1)}(r,n);var S=d(O,"onDeactivate"),v=d(O,"onPostDeactivate"),D=d(O,"checkCanReturnFocus"),j=d(O,"returnFocus","returnFocusOnDeactivate");S?.();var R=function(){s4(function(){j&&g(f(a.nodeFocusedBeforeActivation)),v?.()})};return j&&D?(D(f(a.nodeFocusedBeforeActivation)).then(R,R),this):(R(),this)},pause:function(_){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,_)):this},unpause:function(_){return a.active?(a.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,_)):this},updateContainerElements:function(_){var O=[].concat(_).filter(Boolean);return a.containers=O.map(function(S){return typeof S=="string"?o.querySelector(S):S}),a.active&&m(),F(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(_,O){if(a.paused===_)return this;if(a.paused=_,_){var S=d(O,"onPause"),v=d(O,"onPostPause");S?.(),M(),F(),v?.()}else{var D=d(O,"onUnpause"),j=d(O,"onPostUnpause");D?.(),m(),E(),F(),j?.()}return this}}}),n.updateContainerElements(e),n}},Symbol.toStringTag,{value:"Module"})),bS=Ch(yS),wS=Ch(hS);var c4,d4,vS=function(){if(d4)return c4;function e(m){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(m)}function t(){try{var m=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t=function(){return!!m})()}function n(m){return(n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)})(m)}function o(m,h){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,f){return g.__proto__=f,g},o(m,h)}function r(m){var h=function(g,f){if(e(g)!="object"||!g)return g;var x=g[Symbol.toPrimitive];if(x!==void 0){var y=x.call(g,f);if(e(y)!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}(m,"string");return e(h)=="symbol"?h:h+""}d4=1;var i=s,a=gu(),d=bS.createFocusTrap,c=wS.isFocusable,u=function(m){function h(g){var f;(function(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")})(this,h),function(w,b,C){(b=r(b))in w?Object.defineProperty(w,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):w[b]=C}(f=function(w,b,C){return b=n(b),function(k,E){if(E&&(e(E)=="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}(k)}(w,t()?Reflect.construct(b,C||[],n(w).constructor):b.apply(w,C))}(this,h,[g]),"getNodeForOption",function(w){var b,C=(b=this.internalOptions[w])!==null&&b!==void 0?b:this.originalOptions[w];if(typeof C=="function"){for(var k=arguments.length,E=new Array(k>1?k-1:0),M=1;M<k;M++)E[M-1]=arguments[M];C=C.apply(void 0,E)}if(C===!0&&(C=void 0),!C){if(C===void 0||C===!1)return C;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var T,F=C;if(typeof C=="string"&&!(F=(T=this.getDocument())===null||T===void 0?void 0:T.querySelector(C)))throw new Error("`".concat(w,"` as selector refers to no known node"));return F}),f.handleDeactivate=f.handleDeactivate.bind(f),f.handlePostDeactivate=f.handlePostDeactivate.bind(f),f.handleClickOutsideDeactivates=f.handleClickOutsideDeactivates.bind(f),f.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:f.handleDeactivate,onPostDeactivate:f.handlePostDeactivate,clickOutsideDeactivates:f.handleClickOutsideDeactivates},f.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var x=g.focusTrapOptions;for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(y!=="returnFocusOnDeactivate"&&y!=="onDeactivate"&&y!=="onPostDeactivate"&&y!=="checkCanReturnFocus"&&y!=="clickOutsideDeactivates"?f.internalOptions[y]=x[y]:f.originalOptions[y]=x[y]);return f.outsideClick=null,f.focusTrapElements=g.containerElements||[],f.updatePreviousElement(),f}return function(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),f&&o(g,f)}(h,m),function(g,f){return f&&function(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,r(b.key),b)}}(g.prototype,f),Object.defineProperty(g,"prototype",{writable:!1}),g}(h,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var g=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return g||g!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var g=this.getDocument();g&&(this.previouslyFocusedElement=g.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(g){var f=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,g):this.originalOptions.clickOutsideDeactivates;return f&&(this.outsideClick={target:g.target,allowDeactivation:f}),f}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var g=this,f=function(){var x=g.getReturnFocusNode(),y=!(!g.originalOptions.returnFocusOnDeactivate||x==null||!x.focus||g.outsideClick&&(!g.outsideClick.allowDeactivation||c(g.outsideClick.target,g.internalOptions.tabbableOptions))),w=g.internalOptions.preventScroll,b=w!==void 0&&w;y&&x.focus({preventScroll:b}),g.originalOptions.onPostDeactivate&&g.originalOptions.onPostDeactivate.call(null),g.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(f,f):f()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(g){if(this.focusTrap){g.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var f=!g.active&&this.props.active,x=g.active&&!this.props.active,y=!g.paused&&this.props.paused,w=g.paused&&!this.props.paused;if(f&&(this.updatePreviousElement(),this.focusTrap.activate()),x)return void this.deactivateTrap();y&&this.focusTrap.pause(),w&&this.focusTrap.unpause()}else g.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var g=this,f=this.props.children?i.Children.only(this.props.children):void 0;if(f){if(f.type&&f.type===i.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return i.cloneElement(f,{ref:function(x){var y=g.props.containerElements;f&&(typeof f.ref=="function"?f.ref(x):f.ref&&(f.ref.current=x)),g.focusTrapElements=y||[x]}})}return null}}])}(i.Component),p=typeof Element>"u"?Function:Element;return u.propTypes={active:a.bool,paused:a.bool,focusTrapOptions:a.shape({document:a.object,onActivate:a.func,onPostActivate:a.func,checkCanFocusTrap:a.func,onPause:a.func,onPostPause:a.func,onUnpause:a.func,onPostUnpause:a.func,onDeactivate:a.func,onPostDeactivate:a.func,checkCanReturnFocus:a.func,initialFocus:a.oneOfType([a.instanceOf(p),a.string,a.bool,a.func]),fallbackFocus:a.oneOfType([a.instanceOf(p),a.string,a.func]),escapeDeactivates:a.oneOfType([a.bool,a.func]),clickOutsideDeactivates:a.oneOfType([a.bool,a.func]),returnFocusOnDeactivate:a.bool,setReturnFocus:a.oneOfType([a.instanceOf(p),a.string,a.bool,a.func]),allowOutsideClick:a.oneOfType([a.bool,a.func]),preventScroll:a.bool,tabbableOptions:a.shape({displayCheck:a.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:a.oneOfType([a.bool,a.func])}),trapStack:a.array,isKeyForward:a.func,isKeyBackward:a.func}),containerElements:a.arrayOf(a.instanceOf(p)),children:a.oneOfType([a.element,a.instanceOf(p)])},u.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:d},c4=u}();const SS=Sh(vS);var u4,p4,Va={exports:{}},h4={},Is={exports:{}},fo={},J0={};function N1(){return p4||(p4=1,Object.defineProperty(J0,"__esModule",{value:!0}),J0.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},J0.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},J0.int=function(e){return parseInt(e,10)},J0.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},J0.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),J0}var m4,f4,_0={};function Au(){if(f4)return fo;f4=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.addClassName=a,fo.addEvent=function(c,u,p,m){if(!c)return;const h={capture:!0,...m};c.addEventListener?c.addEventListener(u,p,h):c.attachEvent?c.attachEvent("on"+u,p):c["on"+u]=p},fo.addUserSelectStyles=function(c){if(!c)return;let u=c.getElementById("react-draggable-style-el");u||(u=c.createElement("style"),u.type="text/css",u.id="react-draggable-style-el",u.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
36
36
|
`,u.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
37
|
-
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&a(c.body,"react-draggable-transparent-selection")},fo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},fo.createSVGTransform=function(c,u){return r(c,u,"")},fo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},fo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},fo.getTranslation=r,fo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},fo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},fo.matchesSelector=o,fo.matchesSelectorAndParentsTo=function(c,u,p){let m=c;do{if(o(m,u))return!0;if(m===p)return!1;m=m.parentNode}while(m);return!1},fo.offsetXYFromParent=function(c,u,p){const m=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect();return{x:(c.clientX+u.scrollLeft-m.left)/p,y:(c.clientY+u.scrollTop-m.top)/p}},fo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},fo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},fo.removeClassName=d,fo.removeEvent=function(c,u,p,m){if(!c)return;const h={capture:!0,...m};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},fo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=N1(),t=function(c){if(typeof WeakMap=="function")var u=new WeakMap;return function(p){if(p&&p.__esModule)return p;var m,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(m=u){if(m.has(p))return m.get(p);m.set(p,g)}for(const f in p)f!=="default"&&{}.hasOwnProperty.call(p,f)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,f))&&(h.get||h.set)?m(g,f,h):g[f]=p[f]);return g}(c)}(function(){if(m4)return _0;m4=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.browserPrefixToKey=p,_0.browserPrefixToStyle=function(m,h){return h?`-${h.toLowerCase()}-${m}`:m},_0.default=void 0,_0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||m in h)return"";for(let g=0;g<c.length;g++)if(p(m,c[g])in h)return c[g];return""}function p(m,h){return h?`${h}${function(g){let f="",x=!0;for(let y=0;y<g.length;y++)x?(f+=g[y].toUpperCase(),x=!1):g[y]==="-"?x=!0:f+=g[y];return f}(m)}`:m}return _0.default=u(),_0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:m,y:h}=c,g=`translate(${m}${p},${h}${p})`;return u&&(g=`translate(${typeof u.x=="string"?u.x:u.x+p}, ${typeof u.y=="string"?u.y:u.y+p})`+g),g}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function a(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return fo}var g4,Yr={};function x4(){if(g4)return Yr;g4=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Yr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Yr.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),d=n(o);return a?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Yr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Yr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;a=typeof a=="string"?a:function(c){return{left:c.left,top:c.top,right:c.right,bottom:c.bottom}}(a);const d=n(o);if(typeof a=="string"){const{ownerDocument:c}=d,u=c.defaultView;let p;if(p=a==="parent"?d.parentNode:d.getRootNode().querySelector(a),!(p instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const m=p,h=u.getComputedStyle(d),g=u.getComputedStyle(m);a={left:-d.offsetLeft+(0,e.int)(g.paddingLeft)+(0,e.int)(h.marginLeft),top:-d.offsetTop+(0,e.int)(g.paddingTop)+(0,e.int)(h.marginTop),right:(0,t.innerWidth)(m)-(0,t.outerWidth)(d)-d.offsetLeft+(0,e.int)(g.paddingRight)-(0,e.int)(h.marginRight),bottom:(0,t.innerHeight)(m)-(0,t.outerHeight)(d)-d.offsetTop+(0,e.int)(g.paddingBottom)-(0,e.int)(h.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},Yr.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},Yr.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=N1(),t=Au();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Yr}var y4,b4,w4,v4,Ha={},fd={};function S4(){return y4||(y4=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.default=function(){}),fd}function CS(){return w4||(w4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(f){if(typeof WeakMap=="function")var x=new WeakMap;return function(y){if(y&&y.__esModule)return y;var w,b,C={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return C;if(w=x){if(w.has(y))return w.get(y);w.set(y,C)}for(const k in y)k!=="default"&&{}.hasOwnProperty.call(y,k)&&((b=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,k))&&(b.get||b.set)?w(C,k,b):C[k]=y[k]);return C}(f)}(s),n=p(gu()),o=p(uo),r=function(){if(u4)return Is.exports;function f(y){var w,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(w=0;w<k;w++)y[w]&&(b=f(y[w]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,w,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(w=f(y))&&(C&&(C+=" "),C+=w);return C}return u4=1,Is.exports=x,Is.exports.clsx=x,Is.exports}(),i=Au(),a=x4(),d=N1(),c=p(function(){if(b4)return Ha;b4=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.default=void 0;var f=function(S){if(typeof WeakMap=="function")var v=new WeakMap;return function(D){if(D&&D.__esModule)return D;var j,R,P={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return P;if(j=v){if(j.has(D))return j.get(D);j.set(D,P)}for(const I in D)I!=="default"&&{}.hasOwnProperty.call(D,I)&&((R=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,I))&&(R.get||R.set)?j(P,I,R):P[I]=D[I]);return P}(S)}(s),x=E(gu()),y=E(uo),w=Au(),b=x4(),C=N1(),k=E(S4());function E(S){return S&&S.__esModule?S:{default:S}}function M(S,v,D){return(v=function(j){var R=function(P,I){if(typeof P!="object"||!P)return P;var L=P[Symbol.toPrimitive];if(L!==void 0){var H=L.call(P,I);if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(P)}(j,"string");return typeof R=="symbol"?R:R+""}(v))in S?Object.defineProperty(S,v,{value:D,enumerable:!0,configurable:!0,writable:!0}):S[v]=D,S}const T={start:"touchstart",move:"touchmove",stop:"touchend"},F={start:"mousedown",move:"mousemove",stop:"mouseup"};let _=F,O=class extends f.Component{constructor(){super(...arguments),M(this,"dragging",!1),M(this,"lastX",NaN),M(this,"lastY",NaN),M(this,"touchIdentifier",null),M(this,"mounted",!1),M(this,"handleDragStart",S=>{if(this.props.onMouseDown(S),!this.props.allowAnyClick&&typeof S.button=="number"&&S.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:D}=v;if(this.props.disabled||!(S.target instanceof D.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(S.target,this.props.handle,v)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(S.target,this.props.cancel,v))return;S.type!=="touchstart"||this.props.allowMobileScroll||S.preventDefault();const j=(0,w.getTouchIdentifier)(S);this.touchIdentifier=j;const R=(0,b.getControlPosition)(S,j,this);if(R==null)return;const{x:P,y:I}=R,L=(0,b.createCoreData)(this,P,I);(0,k.default)("DraggableCore: handleDragStart: %j",L),(0,k.default)("calling",this.props.onStart),this.props.onStart(S,L)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(D),this.dragging=!0,this.lastX=P,this.lastY=I,(0,w.addEvent)(D,_.move,this.handleDrag),(0,w.addEvent)(D,_.stop,this.handleDragStop))}),M(this,"handleDrag",S=>{const v=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(v==null)return;let{x:D,y:j}=v;if(Array.isArray(this.props.grid)){let P=D-this.lastX,I=j-this.lastY;if([P,I]=(0,b.snapToGrid)(this.props.grid,P,I),!P&&!I)return;D=this.lastX+P,j=this.lastY+I}const R=(0,b.createCoreData)(this,D,j);if((0,k.default)("DraggableCore: handleDrag: %j",R),this.props.onDrag(S,R)!==!1&&this.mounted!==!1)this.lastX=D,this.lastY=j;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const P=document.createEvent("MouseEvents");P.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(P)}}),M(this,"handleDragStop",S=>{if(!this.dragging)return;const v=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(v==null)return;let{x:D,y:j}=v;if(Array.isArray(this.props.grid)){let I=D-this.lastX||0,L=j-this.lastY||0;[I,L]=(0,b.snapToGrid)(this.props.grid,I,L),D=this.lastX+I,j=this.lastY+L}const R=(0,b.createCoreData)(this,D,j);if(this.props.onStop(S,R)===!1||this.mounted===!1)return!1;const P=this.findDOMNode();P&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(P.ownerDocument),(0,k.default)("DraggableCore: handleDragStop: %j",R),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,P&&((0,k.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(P.ownerDocument,_.move,this.handleDrag),(0,w.removeEvent)(P.ownerDocument,_.stop,this.handleDragStop))}),M(this,"onMouseDown",S=>(_=F,this.handleDragStart(S))),M(this,"onMouseUp",S=>(_=F,this.handleDragStop(S))),M(this,"onTouchStart",S=>(_=T,this.handleDragStart(S))),M(this,"onTouchEnd",S=>(_=T,this.handleDragStop(S)))}componentDidMount(){this.mounted=!0;const S=this.findDOMNode();S&&(0,w.addEvent)(S,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const S=this.findDOMNode();if(S){const{ownerDocument:v}=S;(0,w.removeEvent)(v,F.move,this.handleDrag),(0,w.removeEvent)(v,T.move,this.handleDrag),(0,w.removeEvent)(v,F.stop,this.handleDragStop),(0,w.removeEvent)(v,T.stop,this.handleDragStop),(0,w.removeEvent)(S,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(v)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:y.default.findDOMNode(this)}render(){return f.cloneElement(f.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ha.default=O,M(O,"displayName","DraggableCore"),M(O,"propTypes",{allowAnyClick:x.default.bool,allowMobileScroll:x.default.bool,children:x.default.node.isRequired,disabled:x.default.bool,enableUserSelectHack:x.default.bool,offsetParent:function(S,v){if(S[v]&&S[v].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:x.default.arrayOf(x.default.number),handle:x.default.string,cancel:x.default.string,nodeRef:x.default.object,onStart:x.default.func,onDrag:x.default.func,onStop:x.default.func,onMouseDown:x.default.func,scale:x.default.number,className:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),M(O,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ha}()),u=p(S4());function p(f){return f&&f.__esModule?f:{default:f}}function m(){return m=Object.assign?Object.assign.bind():function(f){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var w in y)({}).hasOwnProperty.call(y,w)&&(f[w]=y[w])}return f},m.apply(null,arguments)}function h(f,x,y){return(x=function(w){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var M=E.call(C,k);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(w,"string");return typeof b=="symbol"?b:b+""}(x))in f?Object.defineProperty(f,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[x]=y,f}class g extends t.Component{static getDerivedStateFromProps(x,y){let{position:w}=x,{prevPropsPosition:b}=y;return!w||b&&w.x===b.x&&w.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:b}),{x:w.x,y:w.y,prevPropsPosition:{...w}})}constructor(x){super(x),h(this,"onDragStart",(y,w)=>{if((0,u.default)("Draggable: onDragStart: %j",w),this.props.onStart(y,(0,a.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,w)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",w);const b=(0,a.createDraggableData)(this,w),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[M,T]=(0,a.getBoundPosition)(this,C.x,C.y);C.x=M,C.y=T,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,w)=>{if(!this.state.dragging||this.props.onStop(y,(0,a.createDraggableData)(this,w))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",w);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:w,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:M,positionOffset:T,scale:F,..._}=this.props;let O={},S=null;const v=!M||this.state.dragging,D=M||b,j={x:(0,a.canDragX)(this)&&v?this.state.x:D.x,y:(0,a.canDragY)(this)&&v?this.state.y:D.y};this.state.isElementSVG?S=(0,i.createSVGTransform)(j,T):O=(0,i.createCSSTransform)(j,T);const R=(0,r.clsx)(w.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,m({},_,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:R,style:{...w.props.style,...O},transform:S}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(h4)),h4}var kS=function(){if(v4)return Va.exports;v4=1;const{default:e,DraggableCore:t}=CS();return Va.exports=e,Va.exports.default=e,Va.exports.DraggableCore=t,Va.exports}();const ES=Sh(kS),C4={x:0,y:0},_S=s.memo(s.forwardRef((e,t)=>{const{defaultPosition:n=C4,PaperComponent:o=B.Paper,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:a=".draggable-title",titleSize:d,rootSize:c,...u}=e,p=s.useRef(null),m=s.useMemo(()=>d&&c?{left:0,top:0,right:c.width-d.width,bottom:c.height-d.height}:null,[d,c]),[h,g]=s.useState(null),[f,x]=s.useState(null),[y,w]=s.useState(null);return s.useLayoutEffect(()=>{!h&&n&&g(n??C4)},[n]),s.useEffect(()=>{m&&h&&x({x:Math.max(0,Math.min(h.x,m.right)),y:Math.max(0,Math.min(h.y,m.bottom))})},[h,m]),l.jsx(ES,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:f,bounds:m??".MuiModal-root",onStop:r,onStart:(b,C)=>{const k=b;w({x:(k.clientX??k.touches?.[0]?.clientX)-C.x,y:(k.clientY??k.touches?.[0]?.clientY)-C.y})},onDrag:(b,C)=>{const k=b,E=k.clientX??k.touches?.[0]?.clientX,M=k.clientY??k.touches?.[0]?.clientY;g({x:E-y.x,y:M-y.y})},children:l.jsx(o,{ref:A1([p,t]),...u})})})),TS={x:"50",y:"50"},M9=s.memo(s.forwardRef((e,t)=>{const n=function({props:ne,name:he}){return bb({props:ne,name:he,defaultTheme:E2,themeId:x2})}({props:e,name:"MuiDialog"}),o=_2(),r={enter:.66*o.transitions.duration.enteringScreen,exit:.66*o.transitions.duration.leavingScreen},{title:i="SheetXL",key:a="draggable-window",onCancel:d,onDone:c,onShow:u,onShown:p,onHide:m,open:h,autoFocusSel:g,children:f,TransitionComponent:x=B.Fade,TransitionProps:y,transitionDuration:w=r,BackdropComponent:b=B.Backdrop,BackdropProps:C,PaperComponent:k=B.Paper,PaperProps:E,onBackdropClick:M,sx:T,className:F,onMouseDown:_,initialPosition:O=TS,isModal:S=!1,...v}=n,D=s.useRef(null),[j,R]=s.useState(null),[P,I]=s.useState(!1),[L,H]=s.useState(!1),W=s.useRef(null),[A,U]=G6(),X=s.useRef(null),[ee,V]=G6(),$=s.useRef(null);s.useEffect(()=>{j&&I(h)},[h,j]);const z=un(()=>{d?.(),I(!1)},[d]);s.useEffect(()=>{if(U.width===0&&U.height===0||j)return;const ne=$.current?.getBoundingClientRect(),he=U.height-ne.height,ze=U.width-ne.width;let Ne=.5*ze,gt=.5*he;typeof O?.x=="number"?Ne=O.x:typeof O?.x=="string"&&(Ne=ze*(parseFloat(O.x)/100)),typeof O?.y=="number"?gt=O.y:typeof O?.y=="string"&&(gt=he*(parseFloat(O.y)/100)),R({x:Ne,y:gt})},[U,V]);const[q,G]=s.useState(!1),[Q,Y]=s.useState(null),[te,re]=s.useState(null),ge=un(ne=>{if(Q)return Q.focus(ne),!0;if(g){const he=X.current?.querySelectorAll?.(g);if(he&&he.length>0)return he[0]?.focus?.(ne),!0}return X.current?.focus?.(ne),!1},[Q,g]),J=gc(t,()=>({focus:ne=>{ge(ne)}}),[]),se={...y,onExited:ne=>{c?.(null),y?.onExited?.(ne)},onExit:ne=>{const he=te;he&&requestAnimationFrame(()=>{J.current?.contains(document.activeElement)&&he.focus()}),m?.(),H(!1),y?.onExit?.(ne)},onEntered:(ne,he)=>{u?.(),y?.onEntered?.(ne,he)},onEntering:(ne,he)=>{H(!0),p?.(J.current)}};s.useEffect(()=>{L&&ge()},[L]);const Se=l.jsx(SS,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:D,active:L,children:l.jsx(x,{in:P,timeout:w,role:"presentation",...se,children:l.jsx(B.Box,{className:"MuiDialog-container",ref:X,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:ne=>{ne.which===zo.Escape&&(z(),W.current?.start(ne,{center:!1}),setTimeout(()=>W.current?.stop(ne),180)),ne.stopPropagation()},children:l.jsxs(_S,{ref:A1([$,t]),className:jo({"Mui-focusVisible":q},F),sx:{"& *":ne=>F2(ne),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:ne=>`solid ${dt.alpha(ne.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:ne=>`solid ${dt.alpha(ne.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",...T},defaultPosition:j,titleSize:V,rootSize:U,PaperComponent:k,...v,...E,children:[i?l.jsx(B.DialogTitle,{className:jo({"Mui-selected":q},"draggable-title"),sx:{cursor:"move",display:"flex",color:ne=>ne.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:ne=>`${ne.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:ne=>ne.transitions.duration.shortest/2+"ms"},backgroundColor:ne=>dt.alpha(ne.palette.action.hover,.03)},ref:ee,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:ne=>ne.spacing(1),marginLeft:ne=>ne.spacing(1),marginRight:ne=>ne.spacing(1)},children:[l.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:ne=>ne.spacing(1)},children:i}),l.jsx(Bo,{label:"Close",children:l.jsx(B.IconButton,{"aria-label":"close",sx:{color:ne=>ne.palette.text.icon??ne.palette.action.active},touchRippleRef:W,onPointerDown:ne=>{W.current?.start(ne,{center:!1}),ne.stopPropagation(),ne.preventDefault()},onPointerUp:z,children:l.jsx(gn.Close,{})})})]})}):null,f]})})})});let Me=null;S&&(Me=l.jsx(b,{...C,open:P,onMouseDown:ne=>{z(),C?.onMouseDown?.(ne)},onClick:ne=>{M?.(ne),C?.onClick?.(ne)},sx:{pointerEvents:"auto",...C?.sx}}));const{getPortalContainer:oe}=I2();return uo.createPortal(l.jsxs(B.Box,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:A1([J,A]),onPointerDown:ne=>{q&&(ne.target===X.current||ne.target.tabIndex<0)&&X.current?.contains(document.activeElement)},onContextMenu:ne=>{ne.isPropagationStopped()||ne.preventDefault()},onFocus:ne=>{!q&&(ne.target===X.current||ne.target.tabIndex<0)&&setTimeout(()=>{ge()},100),D.current?.focusTrap?.unpause(),G(!0),X.current?.contains(ne.target)&&ne.target!==X.current&&Y(ne.target),ne.relatedTarget&&!te&&re(ne.relatedTarget)},onBlur:ne=>{J?.current?.contains(ne.relatedTarget)||(re(null),D.current?.focusTrap?.pause(),G(!1))},children:[Me,Se]}),oe(),a+"")}));var Dr=typeof window<"u"?window:{screen:{},navigator:{}},ha=(Dr.matchMedia||function(){return{matches:!1}}).bind(Dr),jS={get passive(){return!0}},k4=function(){};Dr.addEventListener&&Dr.addEventListener("p",k4,jS),Dr.removeEventListener&&Dr.removeEventListener("p",k4,!1);var B2="ontouchstart"in Dr,MS=B2||"TouchEvent"in Dr&&ha("(any-pointer: coarse)").matches,E4=(Dr.navigator.maxTouchPoints||0)>0||MS,R9=Dr.navigator.userAgent||"",RS=ha("(pointer: coarse)").matches&&/iPad|Macintosh/.test(R9)&&Math.min(Dr.screen.width||0,Dr.screen.height||0)>=768,I9=(ha("(pointer: coarse)").matches||!ha("(pointer: fine)").matches&&B2)&&!/Windows.*Firefox/.test(R9),IS=ha("(any-pointer: fine)").matches||ha("(any-hover: hover)").matches||RS||!B2,_4=!E4||!IS&&I9?E4?"touchOnly":"mouseOnly":"hybrid",DS=_4==="mouseOnly"?"mouse":_4==="touchOnly"||I9?"touch":"mouse",bl=e=>e.type==="checkbox",ci=e=>e instanceof Date,Qo=e=>e==null;const D9=e=>typeof e=="object";var So=e=>!Qo(e)&&!Array.isArray(e)&&D9(e)&&!ci(e),N2=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Ho(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(N2&&(e instanceof Blob||o)||!n&&!So(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return So(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ho(e[r]));else t=e}return t}var yc=e=>/^\w*$/.test(e),ko=e=>e===void 0,Pu=e=>Array.isArray(e)?e.filter(Boolean):[],V2=e=>Pu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ft=(e,t,n)=>{if(!t||!So(e))return n;const o=(yc(t)?[t]:V2(t)).reduce((r,i)=>Qo(r)?r:r[i],e);return ko(o)||o===e?ko(e[t])?n:e[t]:o},n0=e=>typeof e=="boolean",Kn=(e,t,n)=>{let o=-1;const r=yc(t)?[t]:V2(t),i=r.length,a=i-1;for(;++o<i;){const d=r[o];let c=n;if(o!==a){const u=e[d];c=So(u)||Array.isArray(u)?u:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=c,e=e[d]}};const L9="onChange",O9="onSubmit",Fl="all",T4="pattern",j4="required",A9=s.createContext(null);A9.displayName="HookFormContext";const LS=e=>{const{children:t,...n}=e;return s.createElement(A9.Provider,{value:n},t)},OS=typeof window<"u"?H0.useLayoutEffect:H0.useEffect;var r0=e=>typeof e=="string",AS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},sl=e=>Array.isArray(e)?e:[e],M4=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Fu=e=>Qo(e)||!D9(e);function B0(e,t){if(Fu(e)||Fu(t))return e===t;if(ci(e)&&ci(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const a=t[r];if(ci(i)&&ci(a)||So(i)&&So(a)||Array.isArray(i)&&Array.isArray(a)?!B0(i,a):i!==a)return!1}}return!0}var rr=e=>So(e)&&!Object.keys(e).length,H2=e=>e.type==="file",Wr=e=>typeof e=="function",V1=e=>{if(!N2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P9=e=>e.type==="select-multiple",$2=e=>e.type==="radio",gd=e=>V1(e)&&e.isConnected;function _o(e,t){const n=Array.isArray(t)?t:yc(t)?[t]:V2(t),o=n.length===1?e:function(a,d){const c=d.slice(0,-1).length;let u=0;for(;u<c;)a=ko(a)?u++:a[d[u++]];return a}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(So(o)&&rr(o)||Array.isArray(o)&&function(a){for(const d in a)if(a.hasOwnProperty(d)&&!ko(a[d]))return!1;return!0}(o))&&_o(e,n.slice(0,-1)),e}var F9=e=>{for(const t in e)if(Wr(e[t]))return!0;return!1};function H1(e,t={}){const n=Array.isArray(e);if(So(e)||n)for(const o in e)Array.isArray(e[o])||So(e[o])&&!F9(e[o])?(t[o]=Array.isArray(e[o])?[]:{},H1(e[o],t[o])):Qo(e[o])||(t[o]=!0);return t}function z9(e,t,n){const o=Array.isArray(e);if(So(e)||o)for(const r in e)Array.isArray(e[r])||So(e[r])&&!F9(e[r])?ko(t)||Fu(n[r])?n[r]=Array.isArray(e[r])?H1(e[r],[]):{...H1(e[r])}:z9(e[r],Qo(t)?{}:t[r],n[r]):n[r]=!B0(e[r],t[r]);return n}var $a=(e,t)=>z9(e,t,H1(t));const R4={value:!1,isValid:!1},I4={value:!0,isValid:!0};var B9=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ko(e[0].attributes.value)?ko(e[0].value)||e[0].value===""?I4:{value:e[0].value,isValid:!0}:I4:R4}return R4},N9=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>ko(e)?e:t?e===""?NaN:e&&+e:n&&r0(e)?new Date(e):o?o(e):e;const D4={isValid:!1,value:null};var V9=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,D4):D4;function L4(e){const t=e.ref;return H2(t)?t.files:$2(t)?V9(e.refs).value:P9(t)?[...t.selectedOptions].map(({value:n})=>n):bl(t)?B9(e.refs).value:N9(ko(t.value)?e.ref.value:t.value,e)}var $1=e=>e instanceof RegExp,Wa=e=>ko(e)?e:$1(e)?e.source:So(e)?$1(e.value)?e.value.source:e.value:e,O4=e=>({isOnSubmit:!e||e===O9,isOnBlur:e==="onBlur",isOnChange:e===L9,isOnAll:e===Fl,isOnTouch:e==="onTouched"});const A4="AsyncFunction";var PS=e=>!!e&&!!e.validate&&!!(Wr(e.validate)&&e.validate.constructor.name===A4||So(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===A4)),P4=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const wl=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ft(e,r);if(i){const{_f:a,...d}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o||a.ref&&t(a.ref,a.name)&&!o)return!0;if(wl(d,t))break}else if(So(d)&&wl(d,t))break}}};function F4(e,t,n){const o=Ft(e,n);if(o||yc(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Ft(t,i),d=Ft(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var FS=(e,t,n)=>{const o=sl(Ft(e,n));return Kn(o,"root",t[n]),Kn(e,n,o),e},g1=e=>r0(e);function z4(e,t,n="validate"){if(g1(e)||Array.isArray(e)&&e.every(g1)||n0(e)&&!e)return{type:n,message:g1(e)?e:"",ref:t}}var Di=e=>So(e)&&!$1(e)?e:{value:e,message:""},B4=async(e,t,n,o,r,i)=>{const{ref:a,refs:d,required:c,maxLength:u,minLength:p,min:m,max:h,pattern:g,validate:f,name:x,valueAsNumber:y,mount:w}=e._f,b=Ft(n,x);if(!w||t.has(x))return{};const C=d?d[0]:a,k=v=>{r&&C.reportValidity&&(C.setCustomValidity(n0(v)?"":v||""),C.reportValidity())},E={},M=$2(a),T=bl(a),F=M||T,_=(y||H2(a))&&ko(a.value)&&ko(b)||V1(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,O=AS.bind(null,x,o,E),S=(v,D,j,R="maxLength",P="minLength")=>{const I=v?D:j;E[x]={type:v?R:P,message:I,ref:a,...O(v?R:P,I)}};if(i?!Array.isArray(b)||!b.length:c&&(!F&&(_||Qo(b))||n0(b)&&!b||T&&!B9(d).isValid||M&&!V9(d).isValid)){const{value:v,message:D}=g1(c)?{value:!!c,message:c}:Di(c);if(v&&(E[x]={type:j4,message:D,ref:C,...O(j4,D)},!o))return k(D),E}if(!(_||Qo(m)&&Qo(h))){let v,D;const j=Di(h),R=Di(m);if(Qo(b)||isNaN(b)){const P=a.valueAsDate||new Date(b),I=W=>new Date(new Date().toDateString()+" "+W),L=a.type=="time",H=a.type=="week";r0(j.value)&&b&&(v=L?I(b)>I(j.value):H?b>j.value:P>new Date(j.value)),r0(R.value)&&b&&(D=L?I(b)<I(R.value):H?b<R.value:P<new Date(R.value))}else{const P=a.valueAsNumber||b&&+b;Qo(j.value)||(v=P>j.value),Qo(R.value)||(D=P<R.value)}if((v||D)&&(S(!!v,j.message,R.message,"max","min"),!o))return k(E[x].message),E}if((u||p)&&!_&&(r0(b)||i&&Array.isArray(b))){const v=Di(u),D=Di(p),j=!Qo(v.value)&&b.length>+v.value,R=!Qo(D.value)&&b.length<+D.value;if((j||R)&&(S(j,v.message,D.message),!o))return k(E[x].message),E}if(g&&!_&&r0(b)){const{value:v,message:D}=Di(g);if($1(v)&&!b.match(v)&&(E[x]={type:T4,message:D,ref:a,...O(T4,D)},!o))return k(D),E}if(f){if(Wr(f)){const v=z4(await f(b,n),C);if(v&&(E[x]={...v,...O("validate",v.message)},!o))return k(v.message),E}else if(So(f)){let v={};for(const D in f){if(!rr(v)&&!o)break;const j=z4(await f[D](b,n),C,D);j&&(v={...j,...O(D,j.message)},k(j.message),o&&(E[x]=v))}if(!rr(v)&&(E[x]={ref:C,...v},!o))return E}}return k(!0),E};const zS={mode:O9,reValidateMode:L9,shouldFocusError:!0};function BS(e={}){let t={...zS,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const o={};let r,i=(So(t.defaultValues)||So(t.values))&&Ho(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:Ho(i),d={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let m={...p};const h={array:M4(),state:M4()},g=t.criteriaMode===Fl,f=async V=>{if(!t.disabled&&(p.isValid||m.isValid||V)){const $=t.resolver?rr((await b()).errors):await C(o,!0);$!==n.isValid&&h.state.next({isValid:$})}},x=(V,$)=>{!t.disabled&&(p.isValidating||p.validatingFields||m.isValidating||m.validatingFields)&&((V||Array.from(c.mount)).forEach(z=>{z&&($?Kn(n.validatingFields,z,$):_o(n.validatingFields,z))}),h.state.next({validatingFields:n.validatingFields,isValidating:!rr(n.validatingFields)}))},y=(V,$,z,q)=>{const G=Ft(o,V);if(G){const Q=Ft(a,V,ko(z)?Ft(i,V):z);ko(Q)||q&&q.defaultChecked||$?Kn(a,V,$?Q:L4(G._f)):M(V,Q),d.mount&&f()}},w=(V,$,z,q,G)=>{let Q=!1,Y=!1;const te={name:V};if(!t.disabled){if(!z||q){(p.isDirty||m.isDirty)&&(Y=n.isDirty,n.isDirty=te.isDirty=k(),Q=Y!==te.isDirty);const re=B0(Ft(i,V),$);Y=!!Ft(n.dirtyFields,V),re?_o(n.dirtyFields,V):Kn(n.dirtyFields,V,!0),te.dirtyFields=n.dirtyFields,Q=Q||(p.dirtyFields||m.dirtyFields)&&Y!==!re}if(z){const re=Ft(n.touchedFields,V);re||(Kn(n.touchedFields,V,z),te.touchedFields=n.touchedFields,Q=Q||(p.touchedFields||m.touchedFields)&&re!==z)}Q&&G&&h.state.next(te)}return Q?te:{}},b=async V=>{x(V,!0);const $=await t.resolver(a,t.context,((z,q,G,Q)=>{const Y={};for(const te of z){const re=Ft(q,te);re&&Kn(Y,te,re._f)}return{criteriaMode:G,names:[...z],fields:Y,shouldUseNativeValidation:Q}})(V||c.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return x(V),$},C=async(V,$,z={valid:!0})=>{for(const q in V){const G=V[q];if(G){const{_f:Q,...Y}=G;if(Q){const te=c.array.has(Q.name),re=G._f&&PS(G._f);re&&p.validatingFields&&x([q],!0);const ge=await B4(G,c.disabled,a,g,t.shouldUseNativeValidation&&!$,te);if(re&&p.validatingFields&&x([q]),ge[Q.name]&&(z.valid=!1,$))break;!$&&(Ft(ge,Q.name)?te?FS(n.errors,ge,Q.name):Kn(n.errors,Q.name,ge[Q.name]):_o(n.errors,Q.name))}!rr(Y)&&await C(Y,$,z)}}return z.valid},k=(V,$)=>!t.disabled&&(V&&$&&Kn(a,V,$),!B0(v(),i)),E=(V,$,z)=>((q,G,Q,Y,te)=>r0(q)?(Y&&G.watch.add(q),Ft(Q,q,te)):Array.isArray(q)?q.map(re=>(Y&&G.watch.add(re),Ft(Q,re))):(Y&&(G.watchAll=!0),Q))(V,c,{...d.mount?a:ko($)?i:r0(V)?{[V]:$}:$},z,$),M=(V,$,z={})=>{const q=Ft(o,V);let G=$;if(q){const Q=q._f;Q&&(!Q.disabled&&Kn(a,V,N9($,Q)),G=V1(Q.ref)&&Qo($)?"":$,P9(Q.ref)?[...Q.ref.options].forEach(Y=>Y.selected=G.includes(Y.value)):Q.refs?bl(Q.ref)?Q.refs.forEach(Y=>{Y.defaultChecked&&Y.disabled||(Array.isArray(G)?Y.checked=!!G.find(te=>te===Y.value):Y.checked=G===Y.value||!!G)}):Q.refs.forEach(Y=>Y.checked=Y.value===G):H2(Q.ref)?Q.ref.value="":(Q.ref.value=G,Q.ref.type||h.state.next({name:V,values:Ho(a)})))}(z.shouldDirty||z.shouldTouch)&&w(V,G,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&S(V)},T=(V,$,z)=>{for(const q in $){if(!$.hasOwnProperty(q))return;const G=$[q],Q=V+"."+q,Y=Ft(o,Q);(c.array.has(V)||So(G)||Y&&!Y._f)&&!ci(G)?T(Q,G,z):M(Q,G,z)}},F=(V,$,z={})=>{const q=Ft(o,V),G=c.array.has(V),Q=Ho($);Kn(a,V,Q),G?(h.array.next({name:V,values:Ho(a)}),(p.isDirty||p.dirtyFields||m.isDirty||m.dirtyFields)&&z.shouldDirty&&h.state.next({name:V,dirtyFields:$a(i,a),isDirty:k(V,Q)})):!q||q._f||Qo(Q)?M(V,Q,z):T(V,Q,z),P4(V,c)&&h.state.next({...n}),h.state.next({name:d.mount?V:void 0,values:Ho(a)})},_=async V=>{d.mount=!0;const $=V.target;let z=$.name,q=!0;const G=Ft(o,z),Q=ge=>{q=Number.isNaN(ge)||ci(ge)&&isNaN(ge.getTime())||B0(ge,Ft(a,z,ge))},Y=O4(t.mode),te=O4(t.reValidateMode);if(G){let ge,J;const se=$.type?L4(G._f):So(re=V)&&re.target?bl(re.target)?re.target.checked:re.target.value:re,Se=V.type==="blur"||V.type==="focusout",Me=!(ze=>ze.mount&&(ze.required||ze.min||ze.max||ze.maxLength||ze.minLength||ze.pattern||ze.validate))(G._f)&&!t.resolver&&!Ft(n.errors,z)&&!G._f.deps||((ze,Ne,gt,bt,ke)=>!ke.isOnAll&&(!gt&&ke.isOnTouch?!(Ne||ze):(gt?bt.isOnBlur:ke.isOnBlur)?!ze:!(gt?bt.isOnChange:ke.isOnChange)||ze))(Se,Ft(n.touchedFields,z),n.isSubmitted,te,Y),oe=P4(z,c,Se);Kn(a,z,se),Se?(G._f.onBlur&&G._f.onBlur(V),r&&r(0)):G._f.onChange&&G._f.onChange(V);const ne=w(z,se,Se),he=!rr(ne)||oe;if(!Se&&h.state.next({name:z,type:V.type,values:Ho(a)}),Me)return(p.isValid||m.isValid)&&(t.mode==="onBlur"?Se&&f():Se||f()),he&&h.state.next({name:z,...oe?{}:ne});if(!Se&&oe&&h.state.next({...n}),t.resolver){const{errors:ze}=await b([z]);if(Q(se),q){const Ne=F4(n.errors,o,z),gt=F4(ze,o,Ne.name||z);ge=gt.error,z=gt.name,J=rr(ze)}}else x([z],!0),ge=(await B4(G,c.disabled,a,g,t.shouldUseNativeValidation))[z],x([z]),Q(se),q&&(ge?J=!1:(p.isValid||m.isValid)&&(J=await C(o,!0)));q&&(G._f.deps&&S(G._f.deps),((ze,Ne,gt,bt)=>{const ke=Ft(n.errors,ze),pt=(p.isValid||m.isValid)&&n0(Ne)&&n.isValid!==Ne;var xt;if(t.delayError&>?(xt=()=>((Ve,wt)=>{Kn(n.errors,Ve,wt),h.state.next({errors:n.errors})})(ze,gt),r=Ve=>{clearTimeout(u),u=setTimeout(xt,Ve)},r(t.delayError)):(clearTimeout(u),r=null,gt?Kn(n.errors,ze,gt):_o(n.errors,ze)),(gt?!B0(ke,gt):ke)||!rr(bt)||pt){const Ve={...bt,...pt&&n0(Ne)?{isValid:Ne}:{},errors:n.errors,name:ze};n={...n,...Ve},h.state.next(Ve)}})(z,J,ge,ne))}var re},O=(V,$)=>{if(Ft(n.errors,$)&&V.focus)return V.focus(),1},S=async(V,$={})=>{let z,q;const G=sl(V);if(t.resolver){const Q=await(async Y=>{const{errors:te}=await b(Y);if(Y)for(const re of Y){const ge=Ft(te,re);ge?Kn(n.errors,re,ge):_o(n.errors,re)}else n.errors=te;return te})(ko(V)?V:G);z=rr(Q),q=V?!G.some(Y=>Ft(Q,Y)):z}else V?(q=(await Promise.all(G.map(async Q=>{const Y=Ft(o,Q);return await C(Y&&Y._f?{[Q]:Y}:Y)}))).every(Boolean),(q||n.isValid)&&f()):q=z=await C(o);return h.state.next({...!r0(V)||(p.isValid||m.isValid)&&z!==n.isValid?{}:{name:V},...t.resolver||!V?{isValid:z}:{},errors:n.errors}),$.shouldFocus&&!q&&wl(o,O,V?G:c.mount),q},v=V=>{const $={...d.mount?a:i};return ko(V)?$:r0(V)?Ft($,V):V.map(z=>Ft($,z))},D=(V,$)=>({invalid:!!Ft(($||n).errors,V),isDirty:!!Ft(($||n).dirtyFields,V),error:Ft(($||n).errors,V),isValidating:!!Ft(n.validatingFields,V),isTouched:!!Ft(($||n).touchedFields,V)}),j=(V,$,z)=>{const q=(Ft(o,V,{_f:{}})._f||{}).ref,G=Ft(n.errors,V)||{},{ref:Q,message:Y,type:te,...re}=G;Kn(n.errors,V,{...re,...$,ref:q}),h.state.next({name:V,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&q&&q.focus&&q.focus()},R=V=>h.state.subscribe({next:$=>{var z,q,G;z=V.name,q=$.name,G=V.exact,z&&q&&z!==q&&!sl(z).some(Q=>Q&&(G?Q===q:Q.startsWith(q)||q.startsWith(Q)))||!((Q,Y,te,re)=>{te(Q);const{name:ge,...J}=Q;return rr(J)||Object.keys(J).length>=Object.keys(Y).length||Object.keys(J).find(se=>Y[se]===(!re||Fl))})($,V.formState||p,X,V.reRenderRoot)||V.callback({values:{...a},...n,...$})}}).unsubscribe,P=(V,$={})=>{for(const z of V?sl(V):c.mount)c.mount.delete(z),c.array.delete(z),$.keepValue||(_o(o,z),_o(a,z)),!$.keepError&&_o(n.errors,z),!$.keepDirty&&_o(n.dirtyFields,z),!$.keepTouched&&_o(n.touchedFields,z),!$.keepIsValidating&&_o(n.validatingFields,z),!t.shouldUnregister&&!$.keepDefaultValue&&_o(i,z);h.state.next({values:Ho(a)}),h.state.next({...n,...$.keepDirty?{isDirty:k()}:{}}),!$.keepIsValid&&f()},I=({disabled:V,name:$})=>{(n0(V)&&d.mount||V||c.disabled.has($))&&(V?c.disabled.add($):c.disabled.delete($))},L=(V,$={})=>{let z=Ft(o,V);const q=n0($.disabled)||n0(t.disabled);return Kn(o,V,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:V}},name:V,mount:!0,...$}}),c.mount.add(V),z?I({disabled:n0($.disabled)?$.disabled:t.disabled,name:V}):y(V,!0,$.value),{...q?{disabled:$.disabled||t.disabled}:{},...t.progressive?{required:!!$.required,min:Wa($.min),max:Wa($.max),minLength:Wa($.minLength),maxLength:Wa($.maxLength),pattern:Wa($.pattern)}:{},name:V,onChange:_,onBlur:_,ref:G=>{if(G){L(V,$),z=Ft(o,V);const Q=ko(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,Y=(re=>$2(re)||bl(re))(Q),te=z._f.refs||[];if(Y?te.find(re=>re===Q):Q===z._f.ref)return;Kn(o,V,{_f:{...z._f,...Y?{refs:[...te.filter(gd),Q,...Array.isArray(Ft(i,V))?[{}]:[]],ref:{type:Q.type,name:V}}:{ref:Q}}}),y(V,!1,void 0,Q)}else z=Ft(o,V,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||$.shouldUnregister)&&(!((Q,Y)=>Q.has((te=>te.substring(0,te.search(/\.\d+(\.|$)/))||te)(Y)))(c.array,V)||!d.action)&&c.unMount.add(V)}}},H=()=>t.shouldFocusError&&wl(o,O,c.mount),W=(V,$)=>async z=>{let q;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let G=Ho(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Q,values:Y}=await b();n.errors=Q,G=Y}else await C(o);if(c.disabled.size)for(const Q of c.disabled)Kn(G,Q,void 0);if(_o(n.errors,"root"),rr(n.errors)){h.state.next({errors:{}});try{await V(G,z)}catch(Q){q=Q}}else $&&await $({...n.errors},z),H(),setTimeout(H);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rr(n.errors)&&!q,submitCount:n.submitCount+1,errors:n.errors}),q)throw q},A=(V,$={})=>{const z=V?Ho(V):i,q=Ho(z),G=rr(V),Q=G?i:q;if($.keepDefaultValues||(i=z),!$.keepValues){if($.keepDirtyValues){const Y=new Set([...c.mount,...Object.keys($a(i,a))]);for(const te of Array.from(Y))Ft(n.dirtyFields,te)?Kn(Q,te,Ft(a,te)):F(te,Ft(Q,te))}else{if(N2&&ko(V))for(const Y of c.mount){const te=Ft(o,Y);if(te&&te._f){const re=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(V1(re)){const ge=re.closest("form");if(ge){ge.reset();break}}}}for(const Y of c.mount)F(Y,Ft(Q,Y))}a=Ho(Q),h.array.next({values:{...Q}}),h.state.next({values:{...Q}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!p.isValid||!!$.keepIsValid||!!$.keepDirtyValues,d.watch=!!t.shouldUnregister,h.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:!G&&($.keepDirty?n.isDirty:!(!$.keepDefaultValues||B0(V,i))),isSubmitted:!!$.keepIsSubmitted&&n.isSubmitted,dirtyFields:G?{}:$.keepDirtyValues?$.keepDefaultValues&&a?$a(i,a):n.dirtyFields:$.keepDefaultValues&&V?$a(i,V):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:!!$.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},U=(V,$)=>A(Wr(V)?V(a):V,$),X=V=>{n={...n,...V}},ee={control:{register:L,unregister:P,getFieldState:D,handleSubmit:W,setError:j,_subscribe:R,_runSchema:b,_focusError:H,_getWatch:E,_getDirty:k,_setValid:f,_setFieldArray:(V,$=[],z,q,G=!0,Q=!0)=>{if(q&&z&&!t.disabled){if(d.action=!0,Q&&Array.isArray(Ft(o,V))){const Y=z(Ft(o,V),q.argA,q.argB);G&&Kn(o,V,Y)}if(Q&&Array.isArray(Ft(n.errors,V))){const Y=z(Ft(n.errors,V),q.argA,q.argB);G&&Kn(n.errors,V,Y),((te,re)=>{!Pu(Ft(te,re)).length&&_o(te,re)})(n.errors,V)}if((p.touchedFields||m.touchedFields)&&Q&&Array.isArray(Ft(n.touchedFields,V))){const Y=z(Ft(n.touchedFields,V),q.argA,q.argB);G&&Kn(n.touchedFields,V,Y)}(p.dirtyFields||m.dirtyFields)&&(n.dirtyFields=$a(i,a)),h.state.next({name:V,isDirty:k(V,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Kn(a,V,$)},_setDisabledField:I,_setErrors:V=>{n.errors=V,h.state.next({errors:n.errors,isValid:!1})},_getFieldArray:V=>Pu(Ft(d.mount?a:i,V,t.shouldUnregister?Ft(i,V,[]):[])),_reset:A,_resetDefaultValues:()=>Wr(t.defaultValues)&&t.defaultValues().then(V=>{U(V,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const V of c.unMount){const $=Ft(o,V);$&&($._f.refs?$._f.refs.every(z=>!gd(z)):!gd($._f.ref))&&P(V)}c.unMount=new Set},_disableForm:V=>{n0(V)&&(h.state.next({disabled:V}),wl(o,($,z)=>{const q=Ft(o,z);q&&($.disabled=q._f.disabled||V,Array.isArray(q._f.refs)&&q._f.refs.forEach(G=>{G.disabled=q._f.disabled||V}))},0,!1))},_subjects:h,_proxyFormState:p,get _fields(){return o},get _formValues(){return a},get _state(){return d},set _state(V){d=V},get _defaultValues(){return i},get _names(){return c},set _names(V){c=V},get _formState(){return n},get _options(){return t},set _options(V){t={...t,...V}}},subscribe:V=>(d.mount=!0,m={...m,...V.formState},R({...V,formState:m})),trigger:S,register:L,handleSubmit:W,watch:(V,$)=>Wr(V)?h.state.subscribe({next:z=>V(E(void 0,$),z)}):E(V,$,!0),setValue:F,getValues:v,reset:U,resetField:(V,$={})=>{Ft(o,V)&&(ko($.defaultValue)?F(V,Ho(Ft(i,V))):(F(V,$.defaultValue),Kn(i,V,Ho($.defaultValue))),$.keepTouched||_o(n.touchedFields,V),$.keepDirty||(_o(n.dirtyFields,V),n.isDirty=$.defaultValue?k(V,Ho(Ft(i,V))):k()),$.keepError||(_o(n.errors,V),p.isValid&&f()),h.state.next({...n}))},clearErrors:V=>{V&&sl(V).forEach($=>_o(n.errors,$)),h.state.next({errors:V?n.errors:{}})},unregister:P,setError:j,setFocus:(V,$={})=>{const z=Ft(o,V),q=z&&z._f;if(q){const G=q.refs?q.refs[0]:q.ref;G.focus&&(G.focus(),$.shouldSelect&&Wr(G.select)&&G.select())}},getFieldState:D};return{...ee,formControl:ee}}const NS=["Ok","Cancel"],zu=s.memo(s.forwardRef((e,t)=>{const{description:n,icon:o,onCancel:r,onOption:i,onDone:a,onValidateOption:d,createOptionsButton:c,options:u=NS,autoFocusSel:p=".defaultOption",defaultOption:m=u[0],cancelOption:h="Cancel",children:g,...f}=e,x=function(S={}){const v=s.useRef(void 0),D=s.useRef(void 0),[j,R]=s.useState({isDirty:!1,isValidating:!1,isLoading:Wr(S.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:S.errors||{},disabled:S.disabled||!1,isReady:!1,defaultValues:Wr(S.defaultValues)?void 0:S.defaultValues});if(!v.current)if(S.formControl)v.current={...S.formControl,formState:j},S.defaultValues&&!Wr(S.defaultValues)&&S.formControl.reset(S.defaultValues,S.resetOptions);else{const{formControl:I,...L}=BS(S);v.current={...L,formState:j}}const P=v.current.control;return P._options=S,OS(()=>{const I=P._subscribe({formState:P._proxyFormState,callback:()=>R({...P._formState}),reRenderRoot:!0});return R(L=>({...L,isReady:!0})),P._formState.isReady=!0,I},[P]),s.useEffect(()=>P._disableForm(S.disabled),[P,S.disabled]),s.useEffect(()=>{S.mode&&(P._options.mode=S.mode),S.reValidateMode&&(P._options.reValidateMode=S.reValidateMode)},[P,S.mode,S.reValidateMode]),s.useEffect(()=>{S.errors&&(P._setErrors(S.errors),P._focusError())},[P,S.errors]),s.useEffect(()=>{S.shouldUnregister&&P._subjects.state.next({values:P._getWatch()})},[P,S.shouldUnregister]),s.useEffect(()=>{if(P._proxyFormState.isDirty){const I=P._getDirty();I!==j.isDirty&&P._subjects.state.next({isDirty:I})}},[P,j.isDirty]),s.useEffect(()=>{S.values&&!B0(S.values,D.current)?(P._reset(S.values,P._options.resetOptions),D.current=S.values,R(I=>({...I}))):P._resetDefaultValues()},[P,S.values]),s.useEffect(()=>{P._state.mount||(P._setValid(),P._state.mount=!0),P._state.watch&&(P._state.watch=!1,P._subjects.state.next({...P._formState})),P._removeUnmounted()}),v.current.formState=((I,L,H,W=!0)=>{const A={defaultValues:L._defaultValues};for(const U in I)Object.defineProperty(A,U,{get:()=>{const X=U;return L._proxyFormState[X]!==Fl&&(L._proxyFormState[X]=!W||Fl),I[X]}});return A})(j,P),v.current}({shouldUseNativeValidation:!1}),{handleSubmit:y,formState:w}=x,b=s.useRef(null),C=s.useRef(null),k=s.useRef(null),E=un(async S=>{let v;try{if(v=await Promise.resolve(d?.(S))??!0,v!==!0)return;await Promise.resolve(i?.(S,S===h,S===m)),a?.(S)}catch{}},[i,a,d,h,m]),M=un((S,v)=>{setTimeout(()=>{E(m)},180)},[E]),T=un(()=>{i?.(h,!0,!1),r?.(),a?.(null)},[i,h,r,a]),F=w&&(Object.keys(w.errors).length>0||w.disabled||w.isSubmitted),_=un((S,v)=>{const D=S===h,j={className:v?"defaultOption":"action",type:v?"submit":"button",style:{minWidth:"75px"},onClick:()=>{D?T():v||E(S)}};if(c)return c(S,j,v);const R={className:v?"defaultOption":"action",variant:v?"contained":"outlined",size:"small",disabled:!D&&F,color:"primary",...j};if(v||D){const P=v?b:C;R.touchRippleRef=P,R.onPointerDown=I=>{P.current?.start(I,{center:!1}),I.stopPropagation(),I.preventDefault()}}return l.jsx(B.Button,{...R,children:l.jsx("div",{style:{paddingTop:"3px"},children:S})},`action:${S}`)},[u,m,h,c,w]),O=s.useMemo(()=>{const S=[];for(let v=0;v<u.length;v++){const D=u[v],j=m?D===m:v===0;S.push(_(D,j))}return S},[u,m,w]);return l.jsx(M9,{onCancel:T,initialPosition:{y:DS==="touch"?"15":"35"},onDone:a,autoFocusSel:p,isModal:!0,ref:t,PaperProps:{},...f,children:l.jsx(LS,{...x,children:l.jsxs("form",{ref:k,onSubmit:y(M),children:[l.jsx(B.DialogContent,{dividers:!0,onKeyDown:S=>{if(S.isDefaultPrevented())return;S.stopPropagation();let v=null,D=null;const j=S.which===zo.Escape&&h;if(j)v=h,D=C;else{if(F)return;S.which===zo.Enter&&(v=m??u[0],D=b)}v&&(D.current?.start(S,{center:!1}),setTimeout(()=>{D.current?.stop(S),j&&E(v)},180))},children:l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:S=>S.spacing(o||n?1.5:0)},children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column"},children:[o,n]}),g]})}),l.jsx(B.DialogActions,{sx:{paddingTop:S=>S.spacing(1),paddingBottom:S=>S.spacing(1),paddingLeft:S=>S.spacing(1),paddingRight:S=>S.spacing(1),backgroundColor:S=>dt.alpha(S.palette.action.hover,.03)},children:O})]})})})})),VS=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:zu,default:zu},Symbol.toStringTag,{value:"Module"})),HS=s.lazy(()=>Promise.resolve().then(()=>VS)),$S=s.lazy(()=>Promise.resolve().then(()=>require("./BUU_z9x81l1Qnv1t.cjs"))),ba=s.memo(s.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return D2(n),l.jsx(Bo,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...a,children:l.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),je=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,label:d,disabled:c=!1,variant:u=Rr.Toolbar,shortcut:p,commandState:m,tooltipProps:h,...g}=e,f=s.useRef(null),x=s.useRef(!1),y=s.useMemo(()=>{const F={onExecute(_,O){o?.onExecute?.(_,O),x.current||(f.current?.start({center:!1}),setTimeout(()=>f.current?.stop({}),180)),x.current=!1},onError(_,O,S){o?.onError(_,O,S)}};return o?.beforeExecute&&(F.beforeExecute=o.beforeExecute),F},[o]),w=D2(n,y),b=s.useCallback(F=>{F.button===0&&F.preventDefault()},[]),C=s.useCallback(F=>{F.button===0&&n?.execute(m,o)},[w,o,m]),k=s.useCallback(F=>{F.keyCode!==zo.Enter&&F.keyCode!==zo.Space||n?.execute(m,o)},[w,o,m]),E=s.useMemo(()=>a||u===Rr.Toolbar||n?.state()?typeof a=="function"?a(n):a:xc,[w,a]),M=s.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:u===Rr.Toolbar?E:l.jsx(Ql,{selected:n?.state()??!1,children:E}),touchRippleRef:f,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:C,onKeyDown:k}),[w,o,c,E]);let T;return T=u===Rr.Menuitem?l.jsx(lr,{...g,chips:n?.tags(),...M,children:d??n?.label(r,i)}):l.jsx(gr,{...g,...M}),(d||n?.label())&&((n.disabled()||c)&&(T=l.jsx("div",{children:T})),T=l.jsx(ba,{command:n,placement:u===Rr.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:T})),T})),WS=s.memo(s.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=xc,label:i,variant:a=Rr.Toolbar,disabled:d=!1,commandHook:c,...u}=e,p=s.useRef(null),m=s.useRef(!1),h=s.useMemo(()=>{const T={onExecute(F,_){c?.onExecute?.(F,_),m.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),m.current=!1},onError(F,_,O){c?.onError(F,_,O)}};return c?.beforeExecute&&(T.beforeExecute=c.beforeExecute),T},[c]),g=D2(n,h),f=()=>n?.state()?.toString()||"0",[x,y]=s.useState(f),w=un(()=>{const T=parseFloat(x);isNaN(T)?y(f()):parseFloat(f())!==T&&n.execute(T,c)},[f,n,x,c]);s.useEffect(()=>{y(f())},[n?.state()]);const b=s.useMemo(()=>typeof r=="function"?r(n):r,[g,r]),C=s.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[g]),k=s.useMemo(()=>l.jsx(B.IconButton,{...u,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:T=>T.stopPropagation(),onMouseDown:T=>{T.button===0&&T.stopPropagation()},onMouseUp:T=>{T.button===0&&T.stopPropagation()},children:l.jsx(B.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:T=>`${Math.round(T.typography.fontSize)}px`,width:T=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:x,onFocus:T=>{T.target?.select()},onKeyDown:T=>{if(T.which===zo.Enter)f()!==x&&(T.stopPropagation(),T.preventDefault(),w());else if(T.which===zo.Escape)f()!==x&&(y(f()),setTimeout(()=>{T.target?.select()},0),T.stopPropagation(),T.preventDefault());else{if(T.key.match("[-]")||T.key.match("[0-9.]")&&(x+T.key).length>4)return T.stopPropagation(),void T.preventDefault();if(T.which===zo.Space)return void T.preventDefault()}},onBlur:()=>{w()},onChange:T=>{if(T.target.value.length>4)return T.stopPropagation(),void T.preventDefault();y(T.target.value)}})}),[x,d,n]),E={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:d||!n||n.disabled(),onMouseDown:T=>{T.button===0&&T.preventDefault()},onMouseUp:T=>{T.button!==0||T.isPropagationStopped()||T.isDefaultPrevented()||T.isDefaultPrevented()||(T.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:T=>{T.keyCode!==zo.Enter&&T.keyCode!==zo.Space||n?.execute(!n?.state?.(),h)}};let M;return M=a===Rr.Menuitem?l.jsxs(lr,{...u,chips:n?.tags(),...E,children:[C,k]}):l.jsx(gr,{...u,...E}),n?.label()&&((n.disabled()||d)&&(M=l.jsx("div",{children:M})),M=l.jsx(ba,{command:n,placement:a===Rr.Toolbar?"bottom-start":"right-start",children:M})),M})),In=s.memo(s.forwardRef((e,t)=>{const{variant:n=Rr.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:a,commandHook:d,disabled:c,label:u,icon:p,createPopupPanel:m,tooltip:h,selected:g,scope:f,...x}=e,y=s.useRef(null),w=s.useRef(!1),b=s.useMemo(()=>{const O={onExecute(S,v){d?.onExecute?.(S,v),w.current||(y.current?.start({center:!1}),setTimeout(()=>y.current?.stop({}),180)),w.current=!1},onError(S,v,D){d?.onError(S,v,D)}};return d?.beforeExecute&&(O.beforeExecute=d.beforeExecute),O},[d]),C=L2(i,[o],null,[o]),k=C[0],{label:E,icon:M}=s.useMemo(()=>{let O=null;u&&(O=typeof u=="function"?u(k):u),O||(O=k?.label?.(f));let S=null;return p&&(S=typeof p=="function"?p(k):p),S||(S=k?.icon?.()),{label:O,icon:S}},[C,u,p]),T={disabled:c,scope:f,touchRippleRef:y,onQuickClick:r,tooltip:h,label:E,icon:M};(E||h)&&(T.createTooltip=({children:O},S)=>l.jsx(Bo,{label:E,description:h,disabled:S,children:O}));const F=un(O=>m?.(O,i),[m,C]),_=un(O=>k?.execute(a,b),[k]);return k?(T.quickButtonProps={},T.quickButtonProps.createTooltip=({children:O,placement:S},v)=>l.jsx(ba,{command:k,placement:S??n===Rr.Toolbar?"bottom-start":"right-start",disabled:v,children:O}),T.disabled=T.disabled??k?.disabled(),r||(T.onQuickClick=_)):o&&(T.onQuickClick=()=>{}),T.selected=g??k?.state(),T.createPopupPanel=F,n===Rr.Toolbar?l.jsx(Gr,{...x,...T,ref:t}):l.jsx(Jl,{...x,...T,ref:t})}));In.displayName="CommandPopupButton";const ma=e=>{const{command:t,label:n,scope:o,icon:r=l.jsx(g2,{}),sx:i,...a}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:d=>d.typography.subtitle2.fontSize,...i},...a,children:[r?xe(r):null,l.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:d=>d.spacing(.25),paddingRight:d=>d.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},es=s.memo(s.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:d,...c}=e,u=gc(t,()=>({}),[]),[p,m]=s.useState(null),{reference:h}=l0({label:"toolbar",anchor:u.current,parentFloat:i,createPopupPanel:null}),g=s.useCallback(()=>{const T=p;T&&requestAnimationFrame(()=>{u.current?.contains(document.activeElement)&&T.focus()})},[]),f=s.useMemo(()=>({dense:!0,outlined:!1}),[]),x=s.useMemo(()=>{const{commandHook:T,...F}=r||{};return{commandHook:{beforeExecute:(_,O)=>T?.beforeExecute?.(_,O)!==!1&&h.closeAll(),onExecute(_,O){T?.onExecute?.(_,O),g()},onError(_,O,S){T?.onError?.(_,O,S)}},...F}},[h,r]),y=s.useMemo(()=>({...f,...x}),[f,x]),[w,b]=s.useReducer(T=>T+1,0);L2(o,[],{onChange:()=>{b()}});const C=s.useMemo(()=>({commands:o,parentFloat:h,...x}),[w,y,h,r]);let k=0;f.dense||(k+=2),f.outlined&&k++;let E=2;f.dense||(E=4);const M=s.useMemo(()=>a({commands:o,commandButtonProps:y,commandPopupProps:{commands:o,...C,...r}}),[w,y,C,a]);return l.jsx(B.Toolbar,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${E}px`,paddingBottom:`${E}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:u,onFocus:T=>{T.relatedTarget&&!p&&m(T.relatedTarget)},onBlur:T=>{p&&!u?.current?.contains(T.relatedTarget)&&m(null)},onKeyDown:T=>{p&&T.which===zo.Escape&&p.focus()},...c,children:l.jsx("div",{ref:u,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${E}px`,columnGap:`${k}px`,alignItems:"center",maxWidth:"100%"},children:M})})}));es.displayName="CommandToolbar";const US=e=>{const{key:t,...n}=e;return l.jsx(je,{...n},t)},i0=s.memo(s.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o=US,scope:r,commands:i,icon:a,quickCommand:d,popupScope:c=d,commandState:u,commandHook:p,disabled:m=!1,...h}=e,g=L2(i,n?[d,...n]:[d]),f=s.useCallback((x,y)=>{const w={variant:Rr.Menuitem,commandHook:p,commandState:u,icon:a,scope:c,disabled:m},b=[];for(let C=0;C<n?.length;C++){const k=n[C];if(k===null||k==="-"){b.push(l.jsx(Mt,{orientation:"horizontal"},`element-${b.length}`));continue}const E=y.getCommand(k),M={key:`${k}-${b.length}`,command:E,...w},T=o(M);T&&b.push(T)}return wn({...x,children:b})},[m,p,u,c,n,a,o]);return n?l.jsx(In,{ref:t,commands:i,disabled:m,commandHook:p,commandState:u,scope:r,quickCommand:d,icon:a,createPopupPanel:f,...h}):o({ref:t,disabled:m,commandHook:p,commandState:u,scope:r,command:g[0],icon:a,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const H9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),u=s.useMemo(()=>{for(let g=0;g<c.length;g++)if(c[g]?.state())return c[g].key();return c[0]?.key()},[c]),p=s.useMemo(()=>{const g=new Map;return g.set("formatAlignLeftToggle",xe(l.jsx(gn.FormatAlignLeft,{}))),g.set("formatAlignCenterToggle",xe(l.jsx(gn.FormatAlignCenter,{}))),g.set("formatAlignRightToggle",xe(l.jsx(gn.FormatAlignRight,{}))),g.set("formatAlignJustifyToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g.set("formatAlignCenterContinuousToggle",xe(l.jsx(gn.FormatAlignCenter,{}))),g.set("formatAlignFillToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g.set("formatAlignDistributedHorizontalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g},[]),m=s.useMemo(()=>{if(!o)return null;const g={...o};return delete g.beforeExecute,g},[o]),h=s.useCallback((g,f)=>{const x={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},y=l.jsxs(l.Fragment,{children:[l.jsx(je,{...x,command:f.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...x,command:f.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),w=l.jsxs(B.Box,{sx:{className:Zn("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:C=>C.stopPropagation(),children:[l.jsx(je,{command:f.getCommand("formatIndentDecrease"),commandHook:m,scope:r,disabled:i,icon:xe(l.jsx(Ow,{}))}),l.jsx(je,{command:f.getCommand("formatIndentIncrease"),commandHook:m,scope:r,disabled:i,icon:xe(l.jsx(Lw,{}))})]}),b=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...d,children:[w,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return wn({...g,children:b})},[i,o]);return l.jsx(In,{ref:t,parentFloat:a,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:u,icon:p.get(u)??l.jsx(gn.FormatAlignLeft,{}),...d})})),$9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatAlignTopToggle",xe(l.jsx(Hw,{}))),m.set("formatAlignMiddleToggle",xe(l.jsx($w,{}))),m.set("formatAlignBottomToggle",xe(l.jsx(H6,{}))),m.set("formatAlignJustifyVerticalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),m.set("formatAlignDistributedVerticalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatAlignTopToggle"),icon:u.get("formatAlignTopToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:u.get("formatAlignMiddleToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:u.get("formatAlignBottomToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:u.get("formatAlignJustifyVerticalToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:u.get("formatAlignDistributedVerticalToggle")})]});return wn({...m,children:f})},[i,o,u]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:u.get(c)??xe(l.jsx(H6,{})),...a})})),W9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatTextOverflowVisibleToggle",xe(l.jsx(Z3,{}))),m.set("formatTextOverflowWrapToggle",xe(l.jsx(Ty,{}))),m.set("formatTextOverflowClipToggle",xe(l.jsx(jy,{}))),m.set("formatTextOverflowShrinkToggle",xe(l.jsx(My,{}))),m},[]),p=de((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:u.get("formatTextOverflowVisibleToggle")}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:u.get("formatTextOverflowWrapToggle")}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:u.get("formatTextOverflowClipToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:u.get("formatTextOverflowShrinkToggle")})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:u.get(c)??xe(l.jsx(Z3,{})),...a})})),U9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=s.useMemo(()=>{const h=d.length;for(let g=0;g<h;g++){const f=d[g];if(f?.state())return f.key()}return d[1]?.key()},[d]),u=s.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",xe(l.jsx(Ms,{}))),h.set("formatTextRotate315",xe(l.jsx(Ms,{}))),h.set("formatTextRotate45",xe(l.jsx(z6,{}))),h.set("formatTextRotate90",xe(l.jsx(B6,{}))),h.set("formatTextRotate270",xe(l.jsx(N6,{}))),h.set("formatTextRotateCustom",xe(l.jsx(V6,{}))),h},[]),p=s.useCallback((h,g)=>{const f={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},x=l.jsxs(l.Fragment,{children:[l.jsx(je,{...f,command:g.getCommand("formatTextRotate0"),icon:xe(l.jsx(Vw,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate315"),icon:xe(l.jsx(Ms,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate45"),icon:xe(l.jsx(z6,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate90"),icon:xe(l.jsx(B6,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate270"),icon:xe(l.jsx(N6,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(WS,{...f,command:g.getCommand("formatTextRotateCustom"),icon:xe(l.jsx(V6,{})),label:"Custom"})]});return wn({...h,children:x})},[i,o,r,n]),m=s.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[d]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,selected:m,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:m?"formatTextRotate0":"formatTextRotate315",icon:xe(u.get(c)??l.jsx(Ms,{})),...a})}));function wi(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const V0="$$material";function qS(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5,...r}=e,i=(p=>{const m=Object.keys(p).map(h=>({key:h,val:p[h]}))||[];return m.sort((h,g)=>h.val-g.val),m.reduce((h,g)=>({...h,[g.key]:g.val}),{})})(t),a=Object.keys(i);function d(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-o/100}${n})`}function u(p,m){const h=a.indexOf(m);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(h!==-1&&typeof t[a[h]]=="number"?t[a[h]]:m)-o/100}${n})`}return{keys:a,values:i,up:d,down:c,between:u,only:function(p){return a.indexOf(p)+1<a.length?u(p,a[a.indexOf(p)+1]):d(p)},not:function(p){const m=a.indexOf(p);return m===0?d(a[1]):m===a.length-1?c(a[m]):u(p,a[a.indexOf(p)+1]).replace("@media","@media not all and")},unit:n,...r}}var qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},N4,V4,H4={exports:{}},Bn={};function ZS(){if(N4)return Bn;N4=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function f(x){if(typeof x=="object"&&x!==null){var y=x.$$typeof;switch(y){case e:switch(x=x.type){case n:case r:case o:case c:case u:case h:return x;default:switch(x=x&&x.$$typeof){case a:case d:case m:case p:case i:return x;default:return y}}case t:return y}}}return Bn.ContextConsumer=i,Bn.ContextProvider=a,Bn.Element=e,Bn.ForwardRef=d,Bn.Fragment=n,Bn.Lazy=m,Bn.Memo=p,Bn.Portal=t,Bn.Profiler=r,Bn.StrictMode=o,Bn.Suspense=c,Bn.SuspenseList=u,Bn.isContextConsumer=function(x){return f(x)===i},Bn.isContextProvider=function(x){return f(x)===a},Bn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Bn.isForwardRef=function(x){return f(x)===d},Bn.isFragment=function(x){return f(x)===n},Bn.isLazy=function(x){return f(x)===m},Bn.isMemo=function(x){return f(x)===p},Bn.isPortal=function(x){return f(x)===t},Bn.isProfiler=function(x){return f(x)===r},Bn.isStrictMode=function(x){return f(x)===o},Bn.isSuspense=function(x){return f(x)===c},Bn.isSuspenseList=function(x){return f(x)===u},Bn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===r||x===o||x===c||x===u||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===p||x.$$typeof===a||x.$$typeof===i||x.$$typeof===d||x.$$typeof===g||x.getModuleId!==void 0)},Bn.typeOf=f,Bn}function GS(){return V4||(V4=1,H4.exports=ZS()),H4.exports}var q9=GS();function x0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function Z9(e){if(H0.isValidElement(e)||q9.isValidElementType(e)||!x0(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Z9(e[n])}),t}function xr(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return x0(e)&&x0(t)&&Object.keys(t).forEach(r=>{H0.isValidElement(t[r])||q9.isValidElementType(t[r])?o[r]=t[r]:x0(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&x0(e[r])?o[r]=xr(e[r],t[r],n):n.clone?o[r]=x0(t[r])?Z9(t[r]):t[r]:o[r]=t[r]}),o}function W2(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function W0(e){if(e.type)return e;if(e.charAt(0)==="#")return W0(function(i){i=i.slice(1);const a=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let d=i.match(a);return d&&d[0].length===1&&(d=d.map(c=>c+c)),d?`rgb${d.length===4?"a":""}(${d.map((c,u)=>u<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(wi(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(wi(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const cl=(e,t)=>{try{return(n=>{const o=W0(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function bc(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function G9(e){e=W0(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),a=(u,p=(u+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let d="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return e.type==="hsla"&&(d+="a",c.push(t[3])),bc({type:d,values:c})}function Bu(e){let t=(e=W0(e)).type==="hsl"||e.type==="hsla"?W0(G9(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ds(e,t,n){try{return function(o,r){return o=W0(o),r=W2(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,bc(o)}(e,t)}catch{return e}}function U2(e,t){if(e=W0(e),t=W2(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return bc(e)}function Un(e,t,n){try{return U2(e,t)}catch{return e}}function q2(e,t){if(e=W0(e),t=W2(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return bc(e)}function qn(e,t,n){try{return q2(e,t)}catch{return e}}function Ls(e,t,n){try{return function(o,r=.15){return Bu(o)>.5?U2(o,r):q2(o,r)}(e,t)}catch{return e}}const zl={black:"#000",white:"#fff"},KS={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},XS="#f3e5f5",YS="#ce93d8",JS="#ba68c8",QS="#ab47bc",eC="#9c27b0",tC="#7b1fa2",nC="#e57373",oC="#ef5350",rC="#f44336",$4="#d32f2f",iC="#c62828",aC="#ffb74d",lC="#ffa726",sC="#ff9800",cC="#f57c00",dC="#e65100",uC="#e3f2fd",pC="#90caf9",W4="#42a5f5",hC="#1976d2",mC="#1565c0",fC="#4fc3f7",gC="#29b6f6",xC="#03a9f4",U4="#0288d1",yC="#01579b",bC="#81c784",wC="#66bb6a",vC="#4caf50",SC="#388e3c",CC="#2e7d32",kC="#1b5e20";function K9(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:zl.white,default:zl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const EC=K9();function X9(){return{text:{primary:zl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:zl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const q4=X9();function Z4(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=q2(e.main,r):t==="dark"&&(e.dark=U2(e.main,i)))}function Z2(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(f="light"){return f==="dark"?{main:pC,light:uC,dark:W4}:{main:hC,light:W4,dark:mC}}(t),a=e.secondary||function(f="light"){return f==="dark"?{main:YS,light:XS,dark:QS}:{main:eC,light:JS,dark:tC}}(t),d=e.error||function(f="light"){return f==="dark"?{main:rC,light:nC,dark:$4}:{main:$4,light:oC,dark:iC}}(t),c=e.info||function(f="light"){return f==="dark"?{main:gC,light:fC,dark:U4}:{main:U4,light:xC,dark:yC}}(t),u=e.success||function(f="light"){return f==="dark"?{main:wC,light:bC,dark:SC}:{main:CC,light:vC,dark:kC}}(t),p=e.warning||function(f="light"){return f==="dark"?{main:lC,light:aC,dark:cC}:{main:"#ed6c02",light:sC,dark:dC}}(t);function m(f){return function(y,w){const b=Bu(y),C=Bu(w);return(Math.max(b,C)+.05)/(Math.min(b,C)+.05)}(f,q4.text.primary)>=n?q4.text.primary:EC.text.primary}const h=({color:f,name:x,mainShade:y=500,lightShade:w=300,darkShade:b=700})=>{if(!(f={...f}).main&&f[y]&&(f.main=f[y]),!f.hasOwnProperty("main"))throw new Error(wi(11,x?` (${x})`:"",y));if(typeof f.main!="string")throw new Error(wi(12,x?` (${x})`:"",JSON.stringify(f.main)));return Z4(f,"light",w,o),Z4(f,"dark",b,o),f.contrastText||(f.contrastText=m(f.main)),f};let g;return t==="light"?g=K9():t==="dark"&&(g=X9()),xr({common:{...zl},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:d,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:u,name:"success"}),grey:KS,contrastThreshold:n,getContrastText:m,augmentColor:h,tonalOffset:o,...g},r)}var G4,K4,xd,X4,Y4,J4={exports:{}};function _C(){return K4?G4:(K4=1,G4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function TC(){if(X4)return xd;X4=1;var e=_C();function t(){}function n(){}return n.resetWarningCache=t,xd=function(){function o(a,d,c,u,p,m){if(m!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},xd}function ts(){return Y4||(Y4=1,J4.exports=TC()()),J4.exports}function vl(e,t){return t?xr(e,t,{clone:!1}):e}function Q4(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const wc={xs:0,sm:600,md:900,lg:1200,xl:1536},e7={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${wc[e]}px)`},jC={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:wc[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function w0(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||e7;return t.reduce((i,a,d)=>(i[r.up(r.keys[d])]=n(t[d]),i),{})}if(typeof t=="object"){const r=o.breakpoints||e7;return Object.keys(t).reduce((i,a)=>{if(d=r.keys,(c=a)==="@"||c.startsWith("@")&&(d.some(u=>c.startsWith(`@${u}`))||c.match(/^@\d/))){const u=function(p,m){const h=m.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,g,f]=h,x=Number.isNaN(+g)?g||0:+g;return p.containerQueries(f).up(x)}(o.containerQueries?o:jC,a);u&&(i[u]=n(t[a],a))}else if(Object.keys(r.values||wc).includes(a))i[r.up(a)]=n(t[a],a);else{const u=a;i[u]=t[u]}var d,c;return i},{})}return n(t)}function t7(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function Y9(e){if(typeof e!="string")throw new Error(wi(7));return e.charAt(0).toUpperCase()+e.slice(1)}function vc(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function W1(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:vc(e,n)||o,t&&(r=t(r,o,e)),r}function wo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=a=>{if(a[t]==null)return null;const d=a[t],c=vc(a.theme,o)||{};return w0(a,d,u=>{let p=W1(c,r,u);return u===p&&typeof u=="string"&&(p=W1(c,r,`${t}${u==="default"?"":Y9(u)}`,u)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const MC={m:"margin",p:"padding"},RC={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},n7={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},IC=function(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!n7[e])return[e];e=n7[e]}const[t,n]=e.split(""),o=MC[t],r=RC[n]||"";return Array.isArray(r)?r.map(i=>o+i):[o+r]}),J9=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Q9=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function ns(e,t,n,o){const r=vc(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),d=r[a];return i>=0?d:typeof d=="number"?-d:`-${d}`}:typeof r=="function"?r:()=>{}}function G2(e){return ns(e,"spacing",8)}function os(e,t){return typeof t=="string"||t==null?t:e(t)}function DC(e,t,n,o){if(!t.includes(n))return null;const r=function(i,a){return d=>i.reduce((c,u)=>(c[u]=os(a,d),c),{})}(IC(n),o);return w0(e,e[n],r)}function em(e,t){const n=G2(e.theme);return Object.keys(e).map(o=>DC(e,t,o,n)).reduce(vl,{})}function lo(e){return em(e,J9)}function so(e){return em(e,Q9)}lo.propTypes={},lo.filterProps=J9,so.propTypes={},so.filterProps=Q9;const LC={borderRadius:4};function Sc(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?vl(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function Mr(e){return typeof e!="number"?e:`${e}px solid`}function Ar(e,t){return wo({prop:e,themeKey:"borders",transform:t})}const OC=Ar("border",Mr),AC=Ar("borderTop",Mr),PC=Ar("borderRight",Mr),FC=Ar("borderBottom",Mr),zC=Ar("borderLeft",Mr),BC=Ar("borderColor"),NC=Ar("borderTopColor"),VC=Ar("borderRightColor"),HC=Ar("borderBottomColor"),$C=Ar("borderLeftColor"),WC=Ar("outline",Mr),UC=Ar("outlineColor"),x1=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ns(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:os(t,o)});return w0(e,e.borderRadius,n)}return null};x1.propTypes={},x1.filterProps=["borderRadius"],Sc(OC,AC,PC,FC,zC,BC,NC,VC,HC,$C,x1,WC,UC);const U1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ns(e.theme,"spacing",8),n=o=>({gap:os(t,o)});return w0(e,e.gap,n)}return null};U1.propTypes={},U1.filterProps=["gap"];const q1=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ns(e.theme,"spacing",8),n=o=>({columnGap:os(t,o)});return w0(e,e.columnGap,n)}return null};q1.propTypes={},q1.filterProps=["columnGap"];const Z1=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ns(e.theme,"spacing",8),n=o=>({rowGap:os(t,o)});return w0(e,e.rowGap,n)}return null};Z1.propTypes={},Z1.filterProps=["rowGap"];function na(e,t){return t==="grey"?t:e}Sc(U1,q1,Z1,wo({prop:"gridColumn"}),wo({prop:"gridRow"}),wo({prop:"gridAutoFlow"}),wo({prop:"gridAutoColumns"}),wo({prop:"gridAutoRows"}),wo({prop:"gridTemplateColumns"}),wo({prop:"gridTemplateRows"}),wo({prop:"gridTemplateAreas"}),wo({prop:"gridArea"}));function pr(e){return e<=1&&e!==0?100*e+"%":e}Sc(wo({prop:"color",themeKey:"palette",transform:na}),wo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:na}),wo({prop:"backgroundColor",themeKey:"palette",transform:na}));const qC=wo({prop:"width",transform:pr}),K2=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||wc[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:pr(n)}};return w0(e,e.maxWidth,t)}return null};K2.filterProps=["maxWidth"];const ZC=wo({prop:"minWidth",transform:pr}),GC=wo({prop:"height",transform:pr}),KC=wo({prop:"maxHeight",transform:pr}),XC=wo({prop:"minHeight",transform:pr});wo({prop:"size",cssProperty:"width",transform:pr}),wo({prop:"size",cssProperty:"height",transform:pr});Sc(qC,K2,ZC,GC,KC,XC,wo({prop:"boxSizing"}));const Cc={border:{themeKey:"borders",transform:Mr},borderTop:{themeKey:"borders",transform:Mr},borderRight:{themeKey:"borders",transform:Mr},borderBottom:{themeKey:"borders",transform:Mr},borderLeft:{themeKey:"borders",transform:Mr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:x1},color:{themeKey:"palette",transform:na},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:na},backgroundColor:{themeKey:"palette",transform:na},p:{style:so},pt:{style:so},pr:{style:so},pb:{style:so},pl:{style:so},px:{style:so},py:{style:so},padding:{style:so},paddingTop:{style:so},paddingRight:{style:so},paddingBottom:{style:so},paddingLeft:{style:so},paddingX:{style:so},paddingY:{style:so},paddingInline:{style:so},paddingInlineStart:{style:so},paddingInlineEnd:{style:so},paddingBlock:{style:so},paddingBlockStart:{style:so},paddingBlockEnd:{style:so},m:{style:lo},mt:{style:lo},mr:{style:lo},mb:{style:lo},ml:{style:lo},mx:{style:lo},my:{style:lo},margin:{style:lo},marginTop:{style:lo},marginRight:{style:lo},marginBottom:{style:lo},marginLeft:{style:lo},marginX:{style:lo},marginY:{style:lo},marginInline:{style:lo},marginInlineStart:{style:lo},marginInlineEnd:{style:lo},marginBlock:{style:lo},marginBlockStart:{style:lo},marginBlockEnd:{style:lo},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:U1},rowGap:{style:Z1},columnGap:{style:q1},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:pr},maxWidth:{style:K2},minWidth:{transform:pr},height:{transform:pr},maxHeight:{transform:pr},minHeight:{transform:pr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},wa=function(){function e(t,n,o,r){const i={[t]:n,theme:o},a=r[t];if(!a)return{[t]:n};const{cssProperty:d=t,themeKey:c,transform:u,style:p}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const m=vc(o,c)||{};return p?p(i):w0(i,n,h=>{let g=W1(m,u,h);return h===g&&typeof h=="string"&&(g=W1(m,u,`${t}${h==="default"?"":Y9(h)}`,h)),d===!1?g:{[d]:g}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const a=r.unstable_sxConfig??Cc;function d(c){let u=c;if(typeof c=="function")u=c(r);else if(typeof c!="object")return c;if(!u)return null;const p=function(g={}){return g.keys?.reduce((x,y)=>(x[g.up(y)]={},x),{})||{}}(r.breakpoints),m=Object.keys(p);let h=p;return Object.keys(u).forEach(g=>{const f=(x=u[g],y=r,typeof x=="function"?x(y):x);var x,y;if(f!=null)if(typeof f=="object")if(a[g])h=vl(h,e(g,f,r,a));else{const w=w0({theme:r},f,b=>({[g]:b}));(function(...b){const C=b.reduce((E,M)=>E.concat(Object.keys(M)),[]),k=new Set(C);return b.every(E=>k.size===Object.keys(E).length)})(w,f)?h[g]=t({sx:f,theme:r,nested:!0}):h=vl(h,w)}else h=vl(h,e(g,f,r,a))}),!i&&r.modularCssLayers?{"@layer sx":Q4(r,t7(m,h))}:Q4(r,t7(m,h))}return Array.isArray(o)?o.map(d):d(o)}}();function YC(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function tm(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...a}=e,d=qS(n),c=function(p=8,m=G2({spacing:p})){if(p.mui)return p;const h=(...g)=>(g.length===0?[1]:g).map(f=>{const x=m(f);return typeof x=="number"?`${x}px`:x}).join(" ");return h.mui=!0,h}(r);let u=xr({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:c,shape:{...LC,...i}},a);return u=function(p){const m=(x,y)=>x.replace("@media",y?`@container ${y}`:"@container");function h(x,y){x.up=(...w)=>m(p.breakpoints.up(...w),y),x.down=(...w)=>m(p.breakpoints.down(...w),y),x.between=(...w)=>m(p.breakpoints.between(...w),y),x.only=(...w)=>m(p.breakpoints.only(...w),y),x.not=(...w)=>{const b=m(p.breakpoints.not(...w),y);return b.includes("not all and")?b.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):b}}const g={},f=x=>(h(g,x),g);return h(f),{...p,containerQueries:f}}(u),u.applyStyles=YC,u=t.reduce((p,m)=>xr(p,m),u),u.unstable_sxConfig={...Cc,...a?.unstable_sxConfig},u.unstable_sx=function(p){return wa({sx:p,theme:this})},u}wa.filterProps=["sx"];const o7=(e,t,n,o=[])=>{let r=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function yd(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},a={};var d,c;return d=(u,p,m)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(u,p))){const h=`--${n?`${n}-`:""}${u.join("-")}`,g=((f,x)=>typeof x=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(y=>f.includes(y))||f[f.length-1].toLowerCase().includes("opacity")?x:`${x}px`:x)(u,p);Object.assign(r,{[h]:g}),o7(i,u,`var(${h})`,m),o7(a,u,`var(${h}, ${g})`,m)}},c=u=>u[0]==="vars",function u(p,m=[],h=[]){Object.entries(p).forEach(([g,f])=>{(!c||c&&!c([...m,g]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?u(f,[...m,g],Array.isArray(f)?[...h,g]:h):d([...m,g],f,h))})}(e),{css:r,vars:i,varsWithDefaults:a}}function JC(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}function QC(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}const r7={textTransform:"uppercase"},i7='"Roboto", "Helvetica", "Arial", sans-serif';function nm(e,t){const{fontFamily:n=i7,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:d=700,htmlFontSize:c=16,allVariants:u,pxToRem:p,...m}=typeof t=="function"?t(e):t,h=o/14,g=p||(y=>y/c*h+"rem"),f=(y,w,b,C,k)=>{return{fontFamily:n,fontWeight:y,fontSize:g(w),lineHeight:b,...n===i7?{letterSpacing:(E=C/w,Math.round(1e5*E)/1e5+"em")}:{},...k,...u};var E},x={h1:f(r,96,1.167,-1.5),h2:f(r,60,1.2,-.5),h3:f(i,48,1.167,0),h4:f(i,34,1.235,.25),h5:f(i,24,1.334,0),h6:f(a,20,1.6,.15),subtitle1:f(i,16,1.75,.15),subtitle2:f(a,14,1.57,.1),body1:f(i,16,1.5,.15),body2:f(i,14,1.43,.15),button:f(a,14,1.75,.4,r7),caption:f(i,12,1.66,.4),overline:f(i,12,2.66,1,r7),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return xr({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:d,...x},m,{clone:!1})}function Qn(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const ek=["none",Qn(0,2,1,-1,0,1,1,0,0,1,3,0),Qn(0,3,1,-2,0,2,2,0,0,1,5,0),Qn(0,3,3,-2,0,3,4,0,0,1,8,0),Qn(0,2,4,-1,0,4,5,0,0,1,10,0),Qn(0,3,5,-1,0,5,8,0,0,1,14,0),Qn(0,3,5,-1,0,6,10,0,0,1,18,0),Qn(0,4,5,-2,0,7,10,1,0,2,16,1),Qn(0,5,5,-3,0,8,10,1,0,3,14,2),Qn(0,5,6,-3,0,9,12,1,0,3,16,2),Qn(0,6,6,-3,0,10,14,1,0,4,18,3),Qn(0,6,7,-4,0,11,15,1,0,4,20,3),Qn(0,7,8,-4,0,12,17,2,0,5,22,4),Qn(0,7,8,-4,0,13,19,2,0,5,24,4),Qn(0,7,9,-4,0,14,21,2,0,5,26,4),Qn(0,8,9,-5,0,15,22,2,0,6,28,5),Qn(0,8,10,-5,0,16,24,2,0,6,30,5),Qn(0,8,11,-5,0,17,26,2,0,6,32,5),Qn(0,9,11,-5,0,18,28,2,0,7,34,6),Qn(0,9,12,-6,0,19,29,2,0,7,36,6),Qn(0,10,13,-6,0,20,31,3,0,8,38,7),Qn(0,10,13,-6,0,21,33,3,0,8,40,7),Qn(0,10,14,-6,0,22,35,3,0,8,42,7),Qn(0,11,14,-7,0,23,36,3,0,9,44,8),Qn(0,11,15,-7,0,24,38,3,0,9,46,8)],tk={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},nk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a7(e){return`${Math.round(e)}ms`}function ok(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function rk(e){const t={...tk,...e.easing},n={...nk,...e.duration};return{getAutoHeightDuration:ok,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:d=0,...c}=r;return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:a7(i)} ${a} ${typeof d=="string"?d:a7(d)}`).join(",")},...e,easing:t,duration:n}}const ik={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function ak(e){return x0(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function om(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[a,d]=r[i];!ak(d)||a.startsWith("unstable_")?delete o[a]:x0(d)&&(o[a]={...d},n(o[a]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
37
|
+
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&a(c.body,"react-draggable-transparent-selection")},fo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},fo.createSVGTransform=function(c,u){return r(c,u,"")},fo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},fo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},fo.getTranslation=r,fo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},fo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},fo.matchesSelector=o,fo.matchesSelectorAndParentsTo=function(c,u,p){let m=c;do{if(o(m,u))return!0;if(m===p)return!1;m=m.parentNode}while(m);return!1},fo.offsetXYFromParent=function(c,u,p){const m=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect();return{x:(c.clientX+u.scrollLeft-m.left)/p,y:(c.clientY+u.scrollTop-m.top)/p}},fo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},fo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},fo.removeClassName=d,fo.removeEvent=function(c,u,p,m){if(!c)return;const h={capture:!0,...m};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},fo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=N1(),t=function(c){if(typeof WeakMap=="function")var u=new WeakMap;return function(p){if(p&&p.__esModule)return p;var m,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(m=u){if(m.has(p))return m.get(p);m.set(p,g)}for(const f in p)f!=="default"&&{}.hasOwnProperty.call(p,f)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,f))&&(h.get||h.set)?m(g,f,h):g[f]=p[f]);return g}(c)}(function(){if(m4)return _0;m4=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.browserPrefixToKey=p,_0.browserPrefixToStyle=function(m,h){return h?`-${h.toLowerCase()}-${m}`:m},_0.default=void 0,_0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||m in h)return"";for(let g=0;g<c.length;g++)if(p(m,c[g])in h)return c[g];return""}function p(m,h){return h?`${h}${function(g){let f="",x=!0;for(let y=0;y<g.length;y++)x?(f+=g[y].toUpperCase(),x=!1):g[y]==="-"?x=!0:f+=g[y];return f}(m)}`:m}return _0.default=u(),_0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:m,y:h}=c,g=`translate(${m}${p},${h}${p})`;return u&&(g=`translate(${typeof u.x=="string"?u.x:u.x+p}, ${typeof u.y=="string"?u.y:u.y+p})`+g),g}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function a(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return fo}var g4,Yr={};function x4(){if(g4)return Yr;g4=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Yr.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Yr.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),d=n(o);return a?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Yr.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Yr.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;a=typeof a=="string"?a:function(c){return{left:c.left,top:c.top,right:c.right,bottom:c.bottom}}(a);const d=n(o);if(typeof a=="string"){const{ownerDocument:c}=d,u=c.defaultView;let p;if(p=a==="parent"?d.parentNode:d.getRootNode().querySelector(a),!(p instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const m=p,h=u.getComputedStyle(d),g=u.getComputedStyle(m);a={left:-d.offsetLeft+(0,e.int)(g.paddingLeft)+(0,e.int)(h.marginLeft),top:-d.offsetTop+(0,e.int)(g.paddingTop)+(0,e.int)(h.marginTop),right:(0,t.innerWidth)(m)-(0,t.outerWidth)(d)-d.offsetLeft+(0,e.int)(g.paddingRight)-(0,e.int)(h.marginRight),bottom:(0,t.innerHeight)(m)-(0,t.outerHeight)(d)-d.offsetTop+(0,e.int)(g.paddingBottom)-(0,e.int)(h.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},Yr.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},Yr.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=N1(),t=Au();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Yr}var y4,b4,w4,v4,Ha={},fd={};function S4(){return y4||(y4=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.default=function(){}),fd}function CS(){return w4||(w4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(f){if(typeof WeakMap=="function")var x=new WeakMap;return function(y){if(y&&y.__esModule)return y;var w,b,C={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return C;if(w=x){if(w.has(y))return w.get(y);w.set(y,C)}for(const k in y)k!=="default"&&{}.hasOwnProperty.call(y,k)&&((b=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,k))&&(b.get||b.set)?w(C,k,b):C[k]=y[k]);return C}(f)}(s),n=p(gu()),o=p(uo),r=function(){if(u4)return Is.exports;function f(y){var w,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(w=0;w<k;w++)y[w]&&(b=f(y[w]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,w,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(w=f(y))&&(C&&(C+=" "),C+=w);return C}return u4=1,Is.exports=x,Is.exports.clsx=x,Is.exports}(),i=Au(),a=x4(),d=N1(),c=p(function(){if(b4)return Ha;b4=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.default=void 0;var f=function(S){if(typeof WeakMap=="function")var v=new WeakMap;return function(D){if(D&&D.__esModule)return D;var j,R,P={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return P;if(j=v){if(j.has(D))return j.get(D);j.set(D,P)}for(const I in D)I!=="default"&&{}.hasOwnProperty.call(D,I)&&((R=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,I))&&(R.get||R.set)?j(P,I,R):P[I]=D[I]);return P}(S)}(s),x=E(gu()),y=E(uo),w=Au(),b=x4(),C=N1(),k=E(S4());function E(S){return S&&S.__esModule?S:{default:S}}function M(S,v,D){return(v=function(j){var R=function(P,I){if(typeof P!="object"||!P)return P;var L=P[Symbol.toPrimitive];if(L!==void 0){var H=L.call(P,I);if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(P)}(j,"string");return typeof R=="symbol"?R:R+""}(v))in S?Object.defineProperty(S,v,{value:D,enumerable:!0,configurable:!0,writable:!0}):S[v]=D,S}const T={start:"touchstart",move:"touchmove",stop:"touchend"},F={start:"mousedown",move:"mousemove",stop:"mouseup"};let _=F,O=class extends f.Component{constructor(){super(...arguments),M(this,"dragging",!1),M(this,"lastX",NaN),M(this,"lastY",NaN),M(this,"touchIdentifier",null),M(this,"mounted",!1),M(this,"handleDragStart",S=>{if(this.props.onMouseDown(S),!this.props.allowAnyClick&&typeof S.button=="number"&&S.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:D}=v;if(this.props.disabled||!(S.target instanceof D.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(S.target,this.props.handle,v)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(S.target,this.props.cancel,v))return;S.type!=="touchstart"||this.props.allowMobileScroll||S.preventDefault();const j=(0,w.getTouchIdentifier)(S);this.touchIdentifier=j;const R=(0,b.getControlPosition)(S,j,this);if(R==null)return;const{x:P,y:I}=R,L=(0,b.createCoreData)(this,P,I);(0,k.default)("DraggableCore: handleDragStart: %j",L),(0,k.default)("calling",this.props.onStart),this.props.onStart(S,L)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(D),this.dragging=!0,this.lastX=P,this.lastY=I,(0,w.addEvent)(D,_.move,this.handleDrag),(0,w.addEvent)(D,_.stop,this.handleDragStop))}),M(this,"handleDrag",S=>{const v=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(v==null)return;let{x:D,y:j}=v;if(Array.isArray(this.props.grid)){let P=D-this.lastX,I=j-this.lastY;if([P,I]=(0,b.snapToGrid)(this.props.grid,P,I),!P&&!I)return;D=this.lastX+P,j=this.lastY+I}const R=(0,b.createCoreData)(this,D,j);if((0,k.default)("DraggableCore: handleDrag: %j",R),this.props.onDrag(S,R)!==!1&&this.mounted!==!1)this.lastX=D,this.lastY=j;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const P=document.createEvent("MouseEvents");P.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(P)}}),M(this,"handleDragStop",S=>{if(!this.dragging)return;const v=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(v==null)return;let{x:D,y:j}=v;if(Array.isArray(this.props.grid)){let I=D-this.lastX||0,L=j-this.lastY||0;[I,L]=(0,b.snapToGrid)(this.props.grid,I,L),D=this.lastX+I,j=this.lastY+L}const R=(0,b.createCoreData)(this,D,j);if(this.props.onStop(S,R)===!1||this.mounted===!1)return!1;const P=this.findDOMNode();P&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(P.ownerDocument),(0,k.default)("DraggableCore: handleDragStop: %j",R),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,P&&((0,k.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(P.ownerDocument,_.move,this.handleDrag),(0,w.removeEvent)(P.ownerDocument,_.stop,this.handleDragStop))}),M(this,"onMouseDown",S=>(_=F,this.handleDragStart(S))),M(this,"onMouseUp",S=>(_=F,this.handleDragStop(S))),M(this,"onTouchStart",S=>(_=T,this.handleDragStart(S))),M(this,"onTouchEnd",S=>(_=T,this.handleDragStop(S)))}componentDidMount(){this.mounted=!0;const S=this.findDOMNode();S&&(0,w.addEvent)(S,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const S=this.findDOMNode();if(S){const{ownerDocument:v}=S;(0,w.removeEvent)(v,F.move,this.handleDrag),(0,w.removeEvent)(v,T.move,this.handleDrag),(0,w.removeEvent)(v,F.stop,this.handleDragStop),(0,w.removeEvent)(v,T.stop,this.handleDragStop),(0,w.removeEvent)(S,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(v)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:y.default.findDOMNode(this)}render(){return f.cloneElement(f.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ha.default=O,M(O,"displayName","DraggableCore"),M(O,"propTypes",{allowAnyClick:x.default.bool,allowMobileScroll:x.default.bool,children:x.default.node.isRequired,disabled:x.default.bool,enableUserSelectHack:x.default.bool,offsetParent:function(S,v){if(S[v]&&S[v].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:x.default.arrayOf(x.default.number),handle:x.default.string,cancel:x.default.string,nodeRef:x.default.object,onStart:x.default.func,onDrag:x.default.func,onStop:x.default.func,onMouseDown:x.default.func,scale:x.default.number,className:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),M(O,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ha}()),u=p(S4());function p(f){return f&&f.__esModule?f:{default:f}}function m(){return m=Object.assign?Object.assign.bind():function(f){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var w in y)({}).hasOwnProperty.call(y,w)&&(f[w]=y[w])}return f},m.apply(null,arguments)}function h(f,x,y){return(x=function(w){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var M=E.call(C,k);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(w,"string");return typeof b=="symbol"?b:b+""}(x))in f?Object.defineProperty(f,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[x]=y,f}class g extends t.Component{static getDerivedStateFromProps(x,y){let{position:w}=x,{prevPropsPosition:b}=y;return!w||b&&w.x===b.x&&w.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:b}),{x:w.x,y:w.y,prevPropsPosition:{...w}})}constructor(x){super(x),h(this,"onDragStart",(y,w)=>{if((0,u.default)("Draggable: onDragStart: %j",w),this.props.onStart(y,(0,a.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,w)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",w);const b=(0,a.createDraggableData)(this,w),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[M,T]=(0,a.getBoundPosition)(this,C.x,C.y);C.x=M,C.y=T,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,w)=>{if(!this.state.dragging||this.props.onStop(y,(0,a.createDraggableData)(this,w))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",w);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:w,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:M,positionOffset:T,scale:F,..._}=this.props;let O={},S=null;const v=!M||this.state.dragging,D=M||b,j={x:(0,a.canDragX)(this)&&v?this.state.x:D.x,y:(0,a.canDragY)(this)&&v?this.state.y:D.y};this.state.isElementSVG?S=(0,i.createSVGTransform)(j,T):O=(0,i.createCSSTransform)(j,T);const R=(0,r.clsx)(w.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,m({},_,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:R,style:{...w.props.style,...O},transform:S}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(h4)),h4}var kS=function(){if(v4)return Va.exports;v4=1;const{default:e,DraggableCore:t}=CS();return Va.exports=e,Va.exports.default=e,Va.exports.DraggableCore=t,Va.exports}();const ES=Sh(kS),C4={x:0,y:0},_S=s.memo(s.forwardRef((e,t)=>{const{defaultPosition:n=C4,PaperComponent:o=B.Paper,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:a=".draggable-title",titleSize:d,rootSize:c,...u}=e,p=s.useRef(null),m=s.useMemo(()=>d&&c?{left:0,top:0,right:c.width-d.width,bottom:c.height-d.height}:null,[d,c]),[h,g]=s.useState(null),[f,x]=s.useState(null),[y,w]=s.useState(null);return s.useLayoutEffect(()=>{!h&&n&&g(n??C4)},[n]),s.useEffect(()=>{m&&h&&x({x:Math.max(0,Math.min(h.x,m.right)),y:Math.max(0,Math.min(h.y,m.bottom))})},[h,m]),l.jsx(ES,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:f,bounds:m??".MuiModal-root",onStop:r,onStart:(b,C)=>{const k=b;w({x:(k.clientX??k.touches?.[0]?.clientX)-C.x,y:(k.clientY??k.touches?.[0]?.clientY)-C.y})},onDrag:(b,C)=>{const k=b,E=k.clientX??k.touches?.[0]?.clientX,M=k.clientY??k.touches?.[0]?.clientY;g({x:E-y.x,y:M-y.y})},children:l.jsx(o,{ref:A1([p,t]),...u})})})),TS={x:"50",y:"50"},M9=s.memo(s.forwardRef((e,t)=>{const n=function({props:ne,name:he}){return bb({props:ne,name:he,defaultTheme:E2,themeId:x2})}({props:e,name:"MuiDialog"}),o=_2(),r={enter:.66*o.transitions.duration.enteringScreen,exit:.66*o.transitions.duration.leavingScreen},{title:i="SheetXL",key:a="draggable-window",onCancel:d,onDone:c,onShow:u,onShown:p,onHide:m,open:h,autoFocusSel:g,children:f,TransitionComponent:x=B.Fade,TransitionProps:y,transitionDuration:w=r,BackdropComponent:b=B.Backdrop,BackdropProps:C,PaperComponent:k=B.Paper,PaperProps:E,onBackdropClick:M,sx:T,className:F,onMouseDown:_,initialPosition:O=TS,isModal:S=!1,...v}=n,D=s.useRef(null),[j,R]=s.useState(null),[P,I]=s.useState(!1),[L,H]=s.useState(!1),W=s.useRef(null),[A,U]=G6(),X=s.useRef(null),[ee,V]=G6(),$=s.useRef(null);s.useEffect(()=>{j&&I(h)},[h,j]);const z=un(()=>{d?.(),I(!1)},[d]);s.useEffect(()=>{if(U.width===0&&U.height===0||j)return;const ne=$.current?.getBoundingClientRect(),he=U.height-ne.height,ze=U.width-ne.width;let Ne=.5*ze,gt=.5*he;typeof O?.x=="number"?Ne=O.x:typeof O?.x=="string"&&(Ne=ze*(parseFloat(O.x)/100)),typeof O?.y=="number"?gt=O.y:typeof O?.y=="string"&&(gt=he*(parseFloat(O.y)/100)),R({x:Ne,y:gt})},[U,V]);const[q,G]=s.useState(!1),[Q,Y]=s.useState(null),[te,re]=s.useState(null),ge=un(ne=>{if(Q)return Q.focus(ne),!0;if(g){const he=X.current?.querySelectorAll?.(g);if(he&&he.length>0)return he[0]?.focus?.(ne),!0}return X.current?.focus?.(ne),!1},[Q,g]),J=gc(t,()=>({focus:ne=>{ge(ne)}}),[]),se={...y,onExited:ne=>{c?.(null),y?.onExited?.(ne)},onExit:ne=>{const he=te;he&&requestAnimationFrame(()=>{J.current?.contains(document.activeElement)&&he.focus()}),m?.(),H(!1),y?.onExit?.(ne)},onEntered:(ne,he)=>{u?.(),y?.onEntered?.(ne,he)},onEntering:(ne,he)=>{H(!0),p?.(J.current)}};s.useEffect(()=>{L&&ge()},[L]);const Se=l.jsx(SS,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:D,active:L,children:l.jsx(x,{in:P,timeout:w,role:"presentation",...se,children:l.jsx(B.Box,{className:"MuiDialog-container",ref:X,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:ne=>{ne.which===zo.Escape&&(z(),W.current?.start(ne,{center:!1}),setTimeout(()=>W.current?.stop(ne),180)),ne.stopPropagation()},children:l.jsxs(_S,{ref:A1([$,t]),className:jo({"Mui-focusVisible":q},F),sx:{"& *":ne=>F2(ne),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:ne=>`solid ${dt.alpha(ne.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:ne=>`solid ${dt.alpha(ne.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",...T},defaultPosition:j,titleSize:V,rootSize:U,PaperComponent:k,...v,...E,children:[i?l.jsx(B.DialogTitle,{className:jo({"Mui-selected":q},"draggable-title"),sx:{cursor:"move",display:"flex",color:ne=>ne.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:ne=>`${ne.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:ne=>ne.transitions.duration.shortest/2+"ms"},backgroundColor:ne=>dt.alpha(ne.palette.action.hover,.03)},ref:ee,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:ne=>ne.spacing(1),marginLeft:ne=>ne.spacing(1),marginRight:ne=>ne.spacing(1)},children:[l.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:ne=>ne.spacing(1)},children:i}),l.jsx(Bo,{label:"Close",children:l.jsx(B.IconButton,{"aria-label":"close",sx:{color:ne=>ne.palette.text.icon??ne.palette.action.active},touchRippleRef:W,onPointerDown:ne=>{W.current?.start(ne,{center:!1}),ne.stopPropagation(),ne.preventDefault()},onPointerUp:z,children:l.jsx(gn.Close,{})})})]})}):null,f]})})})});let Me=null;S&&(Me=l.jsx(b,{...C,open:P,onMouseDown:ne=>{z(),C?.onMouseDown?.(ne)},onClick:ne=>{M?.(ne),C?.onClick?.(ne)},sx:{pointerEvents:"auto",...C?.sx}}));const{getPortalContainer:oe}=I2();return uo.createPortal(l.jsxs(B.Box,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:A1([J,A]),onPointerDown:ne=>{q&&(ne.target===X.current||ne.target.tabIndex<0)&&X.current?.contains(document.activeElement)},onContextMenu:ne=>{ne.isPropagationStopped()||ne.preventDefault()},onFocus:ne=>{!q&&(ne.target===X.current||ne.target.tabIndex<0)&&setTimeout(()=>{ge()},100),D.current?.focusTrap?.unpause(),G(!0),X.current?.contains(ne.target)&&ne.target!==X.current&&Y(ne.target),ne.relatedTarget&&!te&&re(ne.relatedTarget)},onBlur:ne=>{J?.current?.contains(ne.relatedTarget)||(re(null),D.current?.focusTrap?.pause(),G(!1))},children:[Me,Se]}),oe(),a+"")}));var Dr=typeof window<"u"?window:{screen:{},navigator:{}},ha=(Dr.matchMedia||function(){return{matches:!1}}).bind(Dr),jS={get passive(){return!0}},k4=function(){};Dr.addEventListener&&Dr.addEventListener("p",k4,jS),Dr.removeEventListener&&Dr.removeEventListener("p",k4,!1);var B2="ontouchstart"in Dr,MS=B2||"TouchEvent"in Dr&&ha("(any-pointer: coarse)").matches,E4=(Dr.navigator.maxTouchPoints||0)>0||MS,R9=Dr.navigator.userAgent||"",RS=ha("(pointer: coarse)").matches&&/iPad|Macintosh/.test(R9)&&Math.min(Dr.screen.width||0,Dr.screen.height||0)>=768,I9=(ha("(pointer: coarse)").matches||!ha("(pointer: fine)").matches&&B2)&&!/Windows.*Firefox/.test(R9),IS=ha("(any-pointer: fine)").matches||ha("(any-hover: hover)").matches||RS||!B2,_4=!E4||!IS&&I9?E4?"touchOnly":"mouseOnly":"hybrid",DS=_4==="mouseOnly"?"mouse":_4==="touchOnly"||I9?"touch":"mouse",bl=e=>e.type==="checkbox",ci=e=>e instanceof Date,Qo=e=>e==null;const D9=e=>typeof e=="object";var So=e=>!Qo(e)&&!Array.isArray(e)&&D9(e)&&!ci(e),N2=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Ho(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(N2&&(e instanceof Blob||o)||!n&&!So(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return So(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ho(e[r]));else t=e}return t}var yc=e=>/^\w*$/.test(e),ko=e=>e===void 0,Pu=e=>Array.isArray(e)?e.filter(Boolean):[],V2=e=>Pu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ft=(e,t,n)=>{if(!t||!So(e))return n;const o=(yc(t)?[t]:V2(t)).reduce((r,i)=>Qo(r)?r:r[i],e);return ko(o)||o===e?ko(e[t])?n:e[t]:o},n0=e=>typeof e=="boolean",Kn=(e,t,n)=>{let o=-1;const r=yc(t)?[t]:V2(t),i=r.length,a=i-1;for(;++o<i;){const d=r[o];let c=n;if(o!==a){const u=e[d];c=So(u)||Array.isArray(u)?u:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=c,e=e[d]}};const L9="onChange",O9="onSubmit",Fl="all",T4="pattern",j4="required",A9=s.createContext(null);A9.displayName="HookFormContext";const LS=e=>{const{children:t,...n}=e;return s.createElement(A9.Provider,{value:n},t)},OS=typeof window<"u"?H0.useLayoutEffect:H0.useEffect;var r0=e=>typeof e=="string",AS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},sl=e=>Array.isArray(e)?e:[e],M4=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Fu=e=>Qo(e)||!D9(e);function B0(e,t){if(Fu(e)||Fu(t))return e===t;if(ci(e)&&ci(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const a=t[r];if(ci(i)&&ci(a)||So(i)&&So(a)||Array.isArray(i)&&Array.isArray(a)?!B0(i,a):i!==a)return!1}}return!0}var rr=e=>So(e)&&!Object.keys(e).length,H2=e=>e.type==="file",Wr=e=>typeof e=="function",V1=e=>{if(!N2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P9=e=>e.type==="select-multiple",$2=e=>e.type==="radio",gd=e=>V1(e)&&e.isConnected;function _o(e,t){const n=Array.isArray(t)?t:yc(t)?[t]:V2(t),o=n.length===1?e:function(a,d){const c=d.slice(0,-1).length;let u=0;for(;u<c;)a=ko(a)?u++:a[d[u++]];return a}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(So(o)&&rr(o)||Array.isArray(o)&&function(a){for(const d in a)if(a.hasOwnProperty(d)&&!ko(a[d]))return!1;return!0}(o))&&_o(e,n.slice(0,-1)),e}var F9=e=>{for(const t in e)if(Wr(e[t]))return!0;return!1};function H1(e,t={}){const n=Array.isArray(e);if(So(e)||n)for(const o in e)Array.isArray(e[o])||So(e[o])&&!F9(e[o])?(t[o]=Array.isArray(e[o])?[]:{},H1(e[o],t[o])):Qo(e[o])||(t[o]=!0);return t}function z9(e,t,n){const o=Array.isArray(e);if(So(e)||o)for(const r in e)Array.isArray(e[r])||So(e[r])&&!F9(e[r])?ko(t)||Fu(n[r])?n[r]=Array.isArray(e[r])?H1(e[r],[]):{...H1(e[r])}:z9(e[r],Qo(t)?{}:t[r],n[r]):n[r]=!B0(e[r],t[r]);return n}var $a=(e,t)=>z9(e,t,H1(t));const R4={value:!1,isValid:!1},I4={value:!0,isValid:!0};var B9=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ko(e[0].attributes.value)?ko(e[0].value)||e[0].value===""?I4:{value:e[0].value,isValid:!0}:I4:R4}return R4},N9=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>ko(e)?e:t?e===""?NaN:e&&+e:n&&r0(e)?new Date(e):o?o(e):e;const D4={isValid:!1,value:null};var V9=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,D4):D4;function L4(e){const t=e.ref;return H2(t)?t.files:$2(t)?V9(e.refs).value:P9(t)?[...t.selectedOptions].map(({value:n})=>n):bl(t)?B9(e.refs).value:N9(ko(t.value)?e.ref.value:t.value,e)}var $1=e=>e instanceof RegExp,Wa=e=>ko(e)?e:$1(e)?e.source:So(e)?$1(e.value)?e.value.source:e.value:e,O4=e=>({isOnSubmit:!e||e===O9,isOnBlur:e==="onBlur",isOnChange:e===L9,isOnAll:e===Fl,isOnTouch:e==="onTouched"});const A4="AsyncFunction";var PS=e=>!!e&&!!e.validate&&!!(Wr(e.validate)&&e.validate.constructor.name===A4||So(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===A4)),P4=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const wl=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ft(e,r);if(i){const{_f:a,...d}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o||a.ref&&t(a.ref,a.name)&&!o)return!0;if(wl(d,t))break}else if(So(d)&&wl(d,t))break}}};function F4(e,t,n){const o=Ft(e,n);if(o||yc(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Ft(t,i),d=Ft(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var FS=(e,t,n)=>{const o=sl(Ft(e,n));return Kn(o,"root",t[n]),Kn(e,n,o),e},g1=e=>r0(e);function z4(e,t,n="validate"){if(g1(e)||Array.isArray(e)&&e.every(g1)||n0(e)&&!e)return{type:n,message:g1(e)?e:"",ref:t}}var Di=e=>So(e)&&!$1(e)?e:{value:e,message:""},B4=async(e,t,n,o,r,i)=>{const{ref:a,refs:d,required:c,maxLength:u,minLength:p,min:m,max:h,pattern:g,validate:f,name:x,valueAsNumber:y,mount:w}=e._f,b=Ft(n,x);if(!w||t.has(x))return{};const C=d?d[0]:a,k=v=>{r&&C.reportValidity&&(C.setCustomValidity(n0(v)?"":v||""),C.reportValidity())},E={},M=$2(a),T=bl(a),F=M||T,_=(y||H2(a))&&ko(a.value)&&ko(b)||V1(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,O=AS.bind(null,x,o,E),S=(v,D,j,R="maxLength",P="minLength")=>{const I=v?D:j;E[x]={type:v?R:P,message:I,ref:a,...O(v?R:P,I)}};if(i?!Array.isArray(b)||!b.length:c&&(!F&&(_||Qo(b))||n0(b)&&!b||T&&!B9(d).isValid||M&&!V9(d).isValid)){const{value:v,message:D}=g1(c)?{value:!!c,message:c}:Di(c);if(v&&(E[x]={type:j4,message:D,ref:C,...O(j4,D)},!o))return k(D),E}if(!(_||Qo(m)&&Qo(h))){let v,D;const j=Di(h),R=Di(m);if(Qo(b)||isNaN(b)){const P=a.valueAsDate||new Date(b),I=W=>new Date(new Date().toDateString()+" "+W),L=a.type=="time",H=a.type=="week";r0(j.value)&&b&&(v=L?I(b)>I(j.value):H?b>j.value:P>new Date(j.value)),r0(R.value)&&b&&(D=L?I(b)<I(R.value):H?b<R.value:P<new Date(R.value))}else{const P=a.valueAsNumber||b&&+b;Qo(j.value)||(v=P>j.value),Qo(R.value)||(D=P<R.value)}if((v||D)&&(S(!!v,j.message,R.message,"max","min"),!o))return k(E[x].message),E}if((u||p)&&!_&&(r0(b)||i&&Array.isArray(b))){const v=Di(u),D=Di(p),j=!Qo(v.value)&&b.length>+v.value,R=!Qo(D.value)&&b.length<+D.value;if((j||R)&&(S(j,v.message,D.message),!o))return k(E[x].message),E}if(g&&!_&&r0(b)){const{value:v,message:D}=Di(g);if($1(v)&&!b.match(v)&&(E[x]={type:T4,message:D,ref:a,...O(T4,D)},!o))return k(D),E}if(f){if(Wr(f)){const v=z4(await f(b,n),C);if(v&&(E[x]={...v,...O("validate",v.message)},!o))return k(v.message),E}else if(So(f)){let v={};for(const D in f){if(!rr(v)&&!o)break;const j=z4(await f[D](b,n),C,D);j&&(v={...j,...O(D,j.message)},k(j.message),o&&(E[x]=v))}if(!rr(v)&&(E[x]={ref:C,...v},!o))return E}}return k(!0),E};const zS={mode:O9,reValidateMode:L9,shouldFocusError:!0};function BS(e={}){let t={...zS,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const o={};let r,i=(So(t.defaultValues)||So(t.values))&&Ho(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:Ho(i),d={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let m={...p};const h={array:M4(),state:M4()},g=t.criteriaMode===Fl,f=async V=>{if(!t.disabled&&(p.isValid||m.isValid||V)){const $=t.resolver?rr((await b()).errors):await C(o,!0);$!==n.isValid&&h.state.next({isValid:$})}},x=(V,$)=>{!t.disabled&&(p.isValidating||p.validatingFields||m.isValidating||m.validatingFields)&&((V||Array.from(c.mount)).forEach(z=>{z&&($?Kn(n.validatingFields,z,$):_o(n.validatingFields,z))}),h.state.next({validatingFields:n.validatingFields,isValidating:!rr(n.validatingFields)}))},y=(V,$,z,q)=>{const G=Ft(o,V);if(G){const Q=Ft(a,V,ko(z)?Ft(i,V):z);ko(Q)||q&&q.defaultChecked||$?Kn(a,V,$?Q:L4(G._f)):M(V,Q),d.mount&&f()}},w=(V,$,z,q,G)=>{let Q=!1,Y=!1;const te={name:V};if(!t.disabled){if(!z||q){(p.isDirty||m.isDirty)&&(Y=n.isDirty,n.isDirty=te.isDirty=k(),Q=Y!==te.isDirty);const re=B0(Ft(i,V),$);Y=!!Ft(n.dirtyFields,V),re?_o(n.dirtyFields,V):Kn(n.dirtyFields,V,!0),te.dirtyFields=n.dirtyFields,Q=Q||(p.dirtyFields||m.dirtyFields)&&Y!==!re}if(z){const re=Ft(n.touchedFields,V);re||(Kn(n.touchedFields,V,z),te.touchedFields=n.touchedFields,Q=Q||(p.touchedFields||m.touchedFields)&&re!==z)}Q&&G&&h.state.next(te)}return Q?te:{}},b=async V=>{x(V,!0);const $=await t.resolver(a,t.context,((z,q,G,Q)=>{const Y={};for(const te of z){const re=Ft(q,te);re&&Kn(Y,te,re._f)}return{criteriaMode:G,names:[...z],fields:Y,shouldUseNativeValidation:Q}})(V||c.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return x(V),$},C=async(V,$,z={valid:!0})=>{for(const q in V){const G=V[q];if(G){const{_f:Q,...Y}=G;if(Q){const te=c.array.has(Q.name),re=G._f&&PS(G._f);re&&p.validatingFields&&x([q],!0);const ge=await B4(G,c.disabled,a,g,t.shouldUseNativeValidation&&!$,te);if(re&&p.validatingFields&&x([q]),ge[Q.name]&&(z.valid=!1,$))break;!$&&(Ft(ge,Q.name)?te?FS(n.errors,ge,Q.name):Kn(n.errors,Q.name,ge[Q.name]):_o(n.errors,Q.name))}!rr(Y)&&await C(Y,$,z)}}return z.valid},k=(V,$)=>!t.disabled&&(V&&$&&Kn(a,V,$),!B0(v(),i)),E=(V,$,z)=>((q,G,Q,Y,te)=>r0(q)?(Y&&G.watch.add(q),Ft(Q,q,te)):Array.isArray(q)?q.map(re=>(Y&&G.watch.add(re),Ft(Q,re))):(Y&&(G.watchAll=!0),Q))(V,c,{...d.mount?a:ko($)?i:r0(V)?{[V]:$}:$},z,$),M=(V,$,z={})=>{const q=Ft(o,V);let G=$;if(q){const Q=q._f;Q&&(!Q.disabled&&Kn(a,V,N9($,Q)),G=V1(Q.ref)&&Qo($)?"":$,P9(Q.ref)?[...Q.ref.options].forEach(Y=>Y.selected=G.includes(Y.value)):Q.refs?bl(Q.ref)?Q.refs.forEach(Y=>{Y.defaultChecked&&Y.disabled||(Array.isArray(G)?Y.checked=!!G.find(te=>te===Y.value):Y.checked=G===Y.value||!!G)}):Q.refs.forEach(Y=>Y.checked=Y.value===G):H2(Q.ref)?Q.ref.value="":(Q.ref.value=G,Q.ref.type||h.state.next({name:V,values:Ho(a)})))}(z.shouldDirty||z.shouldTouch)&&w(V,G,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&S(V)},T=(V,$,z)=>{for(const q in $){if(!$.hasOwnProperty(q))return;const G=$[q],Q=V+"."+q,Y=Ft(o,Q);(c.array.has(V)||So(G)||Y&&!Y._f)&&!ci(G)?T(Q,G,z):M(Q,G,z)}},F=(V,$,z={})=>{const q=Ft(o,V),G=c.array.has(V),Q=Ho($);Kn(a,V,Q),G?(h.array.next({name:V,values:Ho(a)}),(p.isDirty||p.dirtyFields||m.isDirty||m.dirtyFields)&&z.shouldDirty&&h.state.next({name:V,dirtyFields:$a(i,a),isDirty:k(V,Q)})):!q||q._f||Qo(Q)?M(V,Q,z):T(V,Q,z),P4(V,c)&&h.state.next({...n}),h.state.next({name:d.mount?V:void 0,values:Ho(a)})},_=async V=>{d.mount=!0;const $=V.target;let z=$.name,q=!0;const G=Ft(o,z),Q=ge=>{q=Number.isNaN(ge)||ci(ge)&&isNaN(ge.getTime())||B0(ge,Ft(a,z,ge))},Y=O4(t.mode),te=O4(t.reValidateMode);if(G){let ge,J;const se=$.type?L4(G._f):So(re=V)&&re.target?bl(re.target)?re.target.checked:re.target.value:re,Se=V.type==="blur"||V.type==="focusout",Me=!(ze=>ze.mount&&(ze.required||ze.min||ze.max||ze.maxLength||ze.minLength||ze.pattern||ze.validate))(G._f)&&!t.resolver&&!Ft(n.errors,z)&&!G._f.deps||((ze,Ne,gt,bt,ke)=>!ke.isOnAll&&(!gt&&ke.isOnTouch?!(Ne||ze):(gt?bt.isOnBlur:ke.isOnBlur)?!ze:!(gt?bt.isOnChange:ke.isOnChange)||ze))(Se,Ft(n.touchedFields,z),n.isSubmitted,te,Y),oe=P4(z,c,Se);Kn(a,z,se),Se?(G._f.onBlur&&G._f.onBlur(V),r&&r(0)):G._f.onChange&&G._f.onChange(V);const ne=w(z,se,Se),he=!rr(ne)||oe;if(!Se&&h.state.next({name:z,type:V.type,values:Ho(a)}),Me)return(p.isValid||m.isValid)&&(t.mode==="onBlur"?Se&&f():Se||f()),he&&h.state.next({name:z,...oe?{}:ne});if(!Se&&oe&&h.state.next({...n}),t.resolver){const{errors:ze}=await b([z]);if(Q(se),q){const Ne=F4(n.errors,o,z),gt=F4(ze,o,Ne.name||z);ge=gt.error,z=gt.name,J=rr(ze)}}else x([z],!0),ge=(await B4(G,c.disabled,a,g,t.shouldUseNativeValidation))[z],x([z]),Q(se),q&&(ge?J=!1:(p.isValid||m.isValid)&&(J=await C(o,!0)));q&&(G._f.deps&&S(G._f.deps),((ze,Ne,gt,bt)=>{const ke=Ft(n.errors,ze),pt=(p.isValid||m.isValid)&&n0(Ne)&&n.isValid!==Ne;var xt;if(t.delayError&>?(xt=()=>((Ve,wt)=>{Kn(n.errors,Ve,wt),h.state.next({errors:n.errors})})(ze,gt),r=Ve=>{clearTimeout(u),u=setTimeout(xt,Ve)},r(t.delayError)):(clearTimeout(u),r=null,gt?Kn(n.errors,ze,gt):_o(n.errors,ze)),(gt?!B0(ke,gt):ke)||!rr(bt)||pt){const Ve={...bt,...pt&&n0(Ne)?{isValid:Ne}:{},errors:n.errors,name:ze};n={...n,...Ve},h.state.next(Ve)}})(z,J,ge,ne))}var re},O=(V,$)=>{if(Ft(n.errors,$)&&V.focus)return V.focus(),1},S=async(V,$={})=>{let z,q;const G=sl(V);if(t.resolver){const Q=await(async Y=>{const{errors:te}=await b(Y);if(Y)for(const re of Y){const ge=Ft(te,re);ge?Kn(n.errors,re,ge):_o(n.errors,re)}else n.errors=te;return te})(ko(V)?V:G);z=rr(Q),q=V?!G.some(Y=>Ft(Q,Y)):z}else V?(q=(await Promise.all(G.map(async Q=>{const Y=Ft(o,Q);return await C(Y&&Y._f?{[Q]:Y}:Y)}))).every(Boolean),(q||n.isValid)&&f()):q=z=await C(o);return h.state.next({...!r0(V)||(p.isValid||m.isValid)&&z!==n.isValid?{}:{name:V},...t.resolver||!V?{isValid:z}:{},errors:n.errors}),$.shouldFocus&&!q&&wl(o,O,V?G:c.mount),q},v=V=>{const $={...d.mount?a:i};return ko(V)?$:r0(V)?Ft($,V):V.map(z=>Ft($,z))},D=(V,$)=>({invalid:!!Ft(($||n).errors,V),isDirty:!!Ft(($||n).dirtyFields,V),error:Ft(($||n).errors,V),isValidating:!!Ft(n.validatingFields,V),isTouched:!!Ft(($||n).touchedFields,V)}),j=(V,$,z)=>{const q=(Ft(o,V,{_f:{}})._f||{}).ref,G=Ft(n.errors,V)||{},{ref:Q,message:Y,type:te,...re}=G;Kn(n.errors,V,{...re,...$,ref:q}),h.state.next({name:V,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&q&&q.focus&&q.focus()},R=V=>h.state.subscribe({next:$=>{var z,q,G;z=V.name,q=$.name,G=V.exact,z&&q&&z!==q&&!sl(z).some(Q=>Q&&(G?Q===q:Q.startsWith(q)||q.startsWith(Q)))||!((Q,Y,te,re)=>{te(Q);const{name:ge,...J}=Q;return rr(J)||Object.keys(J).length>=Object.keys(Y).length||Object.keys(J).find(se=>Y[se]===(!re||Fl))})($,V.formState||p,X,V.reRenderRoot)||V.callback({values:{...a},...n,...$})}}).unsubscribe,P=(V,$={})=>{for(const z of V?sl(V):c.mount)c.mount.delete(z),c.array.delete(z),$.keepValue||(_o(o,z),_o(a,z)),!$.keepError&&_o(n.errors,z),!$.keepDirty&&_o(n.dirtyFields,z),!$.keepTouched&&_o(n.touchedFields,z),!$.keepIsValidating&&_o(n.validatingFields,z),!t.shouldUnregister&&!$.keepDefaultValue&&_o(i,z);h.state.next({values:Ho(a)}),h.state.next({...n,...$.keepDirty?{isDirty:k()}:{}}),!$.keepIsValid&&f()},I=({disabled:V,name:$})=>{(n0(V)&&d.mount||V||c.disabled.has($))&&(V?c.disabled.add($):c.disabled.delete($))},L=(V,$={})=>{let z=Ft(o,V);const q=n0($.disabled)||n0(t.disabled);return Kn(o,V,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:V}},name:V,mount:!0,...$}}),c.mount.add(V),z?I({disabled:n0($.disabled)?$.disabled:t.disabled,name:V}):y(V,!0,$.value),{...q?{disabled:$.disabled||t.disabled}:{},...t.progressive?{required:!!$.required,min:Wa($.min),max:Wa($.max),minLength:Wa($.minLength),maxLength:Wa($.maxLength),pattern:Wa($.pattern)}:{},name:V,onChange:_,onBlur:_,ref:G=>{if(G){L(V,$),z=Ft(o,V);const Q=ko(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,Y=(re=>$2(re)||bl(re))(Q),te=z._f.refs||[];if(Y?te.find(re=>re===Q):Q===z._f.ref)return;Kn(o,V,{_f:{...z._f,...Y?{refs:[...te.filter(gd),Q,...Array.isArray(Ft(i,V))?[{}]:[]],ref:{type:Q.type,name:V}}:{ref:Q}}}),y(V,!1,void 0,Q)}else z=Ft(o,V,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||$.shouldUnregister)&&(!((Q,Y)=>Q.has((te=>te.substring(0,te.search(/\.\d+(\.|$)/))||te)(Y)))(c.array,V)||!d.action)&&c.unMount.add(V)}}},H=()=>t.shouldFocusError&&wl(o,O,c.mount),W=(V,$)=>async z=>{let q;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let G=Ho(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Q,values:Y}=await b();n.errors=Q,G=Y}else await C(o);if(c.disabled.size)for(const Q of c.disabled)Kn(G,Q,void 0);if(_o(n.errors,"root"),rr(n.errors)){h.state.next({errors:{}});try{await V(G,z)}catch(Q){q=Q}}else $&&await $({...n.errors},z),H(),setTimeout(H);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rr(n.errors)&&!q,submitCount:n.submitCount+1,errors:n.errors}),q)throw q},A=(V,$={})=>{const z=V?Ho(V):i,q=Ho(z),G=rr(V),Q=G?i:q;if($.keepDefaultValues||(i=z),!$.keepValues){if($.keepDirtyValues){const Y=new Set([...c.mount,...Object.keys($a(i,a))]);for(const te of Array.from(Y))Ft(n.dirtyFields,te)?Kn(Q,te,Ft(a,te)):F(te,Ft(Q,te))}else{if(N2&&ko(V))for(const Y of c.mount){const te=Ft(o,Y);if(te&&te._f){const re=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(V1(re)){const ge=re.closest("form");if(ge){ge.reset();break}}}}for(const Y of c.mount)F(Y,Ft(Q,Y))}a=Ho(Q),h.array.next({values:{...Q}}),h.state.next({values:{...Q}})}c={mount:$.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!p.isValid||!!$.keepIsValid||!!$.keepDirtyValues,d.watch=!!t.shouldUnregister,h.state.next({submitCount:$.keepSubmitCount?n.submitCount:0,isDirty:!G&&($.keepDirty?n.isDirty:!(!$.keepDefaultValues||B0(V,i))),isSubmitted:!!$.keepIsSubmitted&&n.isSubmitted,dirtyFields:G?{}:$.keepDirtyValues?$.keepDefaultValues&&a?$a(i,a):n.dirtyFields:$.keepDefaultValues&&V?$a(i,V):$.keepDirty?n.dirtyFields:{},touchedFields:$.keepTouched?n.touchedFields:{},errors:$.keepErrors?n.errors:{},isSubmitSuccessful:!!$.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},U=(V,$)=>A(Wr(V)?V(a):V,$),X=V=>{n={...n,...V}},ee={control:{register:L,unregister:P,getFieldState:D,handleSubmit:W,setError:j,_subscribe:R,_runSchema:b,_focusError:H,_getWatch:E,_getDirty:k,_setValid:f,_setFieldArray:(V,$=[],z,q,G=!0,Q=!0)=>{if(q&&z&&!t.disabled){if(d.action=!0,Q&&Array.isArray(Ft(o,V))){const Y=z(Ft(o,V),q.argA,q.argB);G&&Kn(o,V,Y)}if(Q&&Array.isArray(Ft(n.errors,V))){const Y=z(Ft(n.errors,V),q.argA,q.argB);G&&Kn(n.errors,V,Y),((te,re)=>{!Pu(Ft(te,re)).length&&_o(te,re)})(n.errors,V)}if((p.touchedFields||m.touchedFields)&&Q&&Array.isArray(Ft(n.touchedFields,V))){const Y=z(Ft(n.touchedFields,V),q.argA,q.argB);G&&Kn(n.touchedFields,V,Y)}(p.dirtyFields||m.dirtyFields)&&(n.dirtyFields=$a(i,a)),h.state.next({name:V,isDirty:k(V,$),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Kn(a,V,$)},_setDisabledField:I,_setErrors:V=>{n.errors=V,h.state.next({errors:n.errors,isValid:!1})},_getFieldArray:V=>Pu(Ft(d.mount?a:i,V,t.shouldUnregister?Ft(i,V,[]):[])),_reset:A,_resetDefaultValues:()=>Wr(t.defaultValues)&&t.defaultValues().then(V=>{U(V,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const V of c.unMount){const $=Ft(o,V);$&&($._f.refs?$._f.refs.every(z=>!gd(z)):!gd($._f.ref))&&P(V)}c.unMount=new Set},_disableForm:V=>{n0(V)&&(h.state.next({disabled:V}),wl(o,($,z)=>{const q=Ft(o,z);q&&($.disabled=q._f.disabled||V,Array.isArray(q._f.refs)&&q._f.refs.forEach(G=>{G.disabled=q._f.disabled||V}))},0,!1))},_subjects:h,_proxyFormState:p,get _fields(){return o},get _formValues(){return a},get _state(){return d},set _state(V){d=V},get _defaultValues(){return i},get _names(){return c},set _names(V){c=V},get _formState(){return n},get _options(){return t},set _options(V){t={...t,...V}}},subscribe:V=>(d.mount=!0,m={...m,...V.formState},R({...V,formState:m})),trigger:S,register:L,handleSubmit:W,watch:(V,$)=>Wr(V)?h.state.subscribe({next:z=>V(E(void 0,$),z)}):E(V,$,!0),setValue:F,getValues:v,reset:U,resetField:(V,$={})=>{Ft(o,V)&&(ko($.defaultValue)?F(V,Ho(Ft(i,V))):(F(V,$.defaultValue),Kn(i,V,Ho($.defaultValue))),$.keepTouched||_o(n.touchedFields,V),$.keepDirty||(_o(n.dirtyFields,V),n.isDirty=$.defaultValue?k(V,Ho(Ft(i,V))):k()),$.keepError||(_o(n.errors,V),p.isValid&&f()),h.state.next({...n}))},clearErrors:V=>{V&&sl(V).forEach($=>_o(n.errors,$)),h.state.next({errors:V?n.errors:{}})},unregister:P,setError:j,setFocus:(V,$={})=>{const z=Ft(o,V),q=z&&z._f;if(q){const G=q.refs?q.refs[0]:q.ref;G.focus&&(G.focus(),$.shouldSelect&&Wr(G.select)&&G.select())}},getFieldState:D};return{...ee,formControl:ee}}const NS=["Ok","Cancel"],zu=s.memo(s.forwardRef((e,t)=>{const{description:n,icon:o,onCancel:r,onOption:i,onDone:a,onValidateOption:d,createOptionsButton:c,options:u=NS,autoFocusSel:p=".defaultOption",defaultOption:m=u[0],cancelOption:h="Cancel",children:g,...f}=e,x=function(S={}){const v=s.useRef(void 0),D=s.useRef(void 0),[j,R]=s.useState({isDirty:!1,isValidating:!1,isLoading:Wr(S.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:S.errors||{},disabled:S.disabled||!1,isReady:!1,defaultValues:Wr(S.defaultValues)?void 0:S.defaultValues});if(!v.current)if(S.formControl)v.current={...S.formControl,formState:j},S.defaultValues&&!Wr(S.defaultValues)&&S.formControl.reset(S.defaultValues,S.resetOptions);else{const{formControl:I,...L}=BS(S);v.current={...L,formState:j}}const P=v.current.control;return P._options=S,OS(()=>{const I=P._subscribe({formState:P._proxyFormState,callback:()=>R({...P._formState}),reRenderRoot:!0});return R(L=>({...L,isReady:!0})),P._formState.isReady=!0,I},[P]),s.useEffect(()=>P._disableForm(S.disabled),[P,S.disabled]),s.useEffect(()=>{S.mode&&(P._options.mode=S.mode),S.reValidateMode&&(P._options.reValidateMode=S.reValidateMode)},[P,S.mode,S.reValidateMode]),s.useEffect(()=>{S.errors&&(P._setErrors(S.errors),P._focusError())},[P,S.errors]),s.useEffect(()=>{S.shouldUnregister&&P._subjects.state.next({values:P._getWatch()})},[P,S.shouldUnregister]),s.useEffect(()=>{if(P._proxyFormState.isDirty){const I=P._getDirty();I!==j.isDirty&&P._subjects.state.next({isDirty:I})}},[P,j.isDirty]),s.useEffect(()=>{S.values&&!B0(S.values,D.current)?(P._reset(S.values,P._options.resetOptions),D.current=S.values,R(I=>({...I}))):P._resetDefaultValues()},[P,S.values]),s.useEffect(()=>{P._state.mount||(P._setValid(),P._state.mount=!0),P._state.watch&&(P._state.watch=!1,P._subjects.state.next({...P._formState})),P._removeUnmounted()}),v.current.formState=((I,L,H,W=!0)=>{const A={defaultValues:L._defaultValues};for(const U in I)Object.defineProperty(A,U,{get:()=>{const X=U;return L._proxyFormState[X]!==Fl&&(L._proxyFormState[X]=!W||Fl),I[X]}});return A})(j,P),v.current}({shouldUseNativeValidation:!1}),{handleSubmit:y,formState:w}=x,b=s.useRef(null),C=s.useRef(null),k=s.useRef(null),E=un(async S=>{let v;try{if(v=await Promise.resolve(d?.(S))??!0,v!==!0)return;await Promise.resolve(i?.(S,S===h,S===m)),a?.(S)}catch{}},[i,a,d,h,m]),M=un((S,v)=>{setTimeout(()=>{E(m)},180)},[E]),T=un(()=>{i?.(h,!0,!1),r?.(),a?.(null)},[i,h,r,a]),F=w&&(Object.keys(w.errors).length>0||w.disabled||w.isSubmitted),_=un((S,v)=>{const D=S===h,j={className:v?"defaultOption":"action",type:v?"submit":"button",style:{minWidth:"75px"},onClick:()=>{D?T():v||E(S)}};if(c)return c(S,j,v);const R={className:v?"defaultOption":"action",variant:v?"contained":"outlined",size:"small",disabled:!D&&F,color:"primary",...j};if(v||D){const P=v?b:C;R.touchRippleRef=P,R.onPointerDown=I=>{P.current?.start(I,{center:!1}),I.stopPropagation(),I.preventDefault()}}return l.jsx(B.Button,{...R,children:l.jsx("div",{style:{paddingTop:"3px"},children:S})},`action:${S}`)},[u,m,h,c,w]),O=s.useMemo(()=>{const S=[];for(let v=0;v<u.length;v++){const D=u[v],j=m?D===m:v===0;S.push(_(D,j))}return S},[u,m,w]);return l.jsx(M9,{onCancel:T,initialPosition:{y:DS==="touch"?"15":"35"},onDone:a,autoFocusSel:p,isModal:!0,ref:t,PaperProps:{},...f,children:l.jsx(LS,{...x,children:l.jsxs("form",{ref:k,onSubmit:y(M),children:[l.jsx(B.DialogContent,{dividers:!0,onKeyDown:S=>{if(S.isDefaultPrevented())return;S.stopPropagation();let v=null,D=null;const j=S.which===zo.Escape&&h;if(j)v=h,D=C;else{if(F)return;S.which===zo.Enter&&(v=m??u[0],D=b)}v&&(D.current?.start(S,{center:!1}),setTimeout(()=>{D.current?.stop(S),j&&E(v)},180))},children:l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:S=>S.spacing(o||n?1.5:0)},children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column"},children:[o,n]}),g]})}),l.jsx(B.DialogActions,{sx:{paddingTop:S=>S.spacing(1),paddingBottom:S=>S.spacing(1),paddingLeft:S=>S.spacing(1),paddingRight:S=>S.spacing(1),backgroundColor:S=>dt.alpha(S.palette.action.hover,.03)},children:O})]})})})})),VS=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:zu,default:zu},Symbol.toStringTag,{value:"Module"})),HS=s.lazy(()=>Promise.resolve().then(()=>VS)),$S=s.lazy(()=>Promise.resolve().then(()=>require("./htqwuaRLOx8unJxi.cjs"))),ba=s.memo(s.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return D2(n),l.jsx(Bo,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...a,children:l.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),je=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,label:d,disabled:c=!1,variant:u=Rr.Toolbar,shortcut:p,commandState:m,tooltipProps:h,...g}=e,f=s.useRef(null),x=s.useRef(!1),y=s.useMemo(()=>{const F={onExecute(_,O){o?.onExecute?.(_,O),x.current||(f.current?.start({center:!1}),setTimeout(()=>f.current?.stop({}),180)),x.current=!1},onError(_,O,S){o?.onError(_,O,S)}};return o?.beforeExecute&&(F.beforeExecute=o.beforeExecute),F},[o]),w=D2(n,y),b=s.useCallback(F=>{F.button===0&&F.preventDefault()},[]),C=s.useCallback(F=>{F.button===0&&n?.execute(m,o)},[w,o,m]),k=s.useCallback(F=>{F.keyCode!==zo.Enter&&F.keyCode!==zo.Space||n?.execute(m,o)},[w,o,m]),E=s.useMemo(()=>a||u===Rr.Toolbar||n?.state()?typeof a=="function"?a(n):a:xc,[w,a]),M=s.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:u===Rr.Toolbar?E:l.jsx(Ql,{selected:n?.state()??!1,children:E}),touchRippleRef:f,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:C,onKeyDown:k}),[w,o,c,E]);let T;return T=u===Rr.Menuitem?l.jsx(lr,{...g,chips:n?.tags(),...M,children:d??n?.label(r,i)}):l.jsx(gr,{...g,...M}),(d||n?.label())&&((n.disabled()||c)&&(T=l.jsx("div",{children:T})),T=l.jsx(ba,{command:n,placement:u===Rr.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:T})),T})),WS=s.memo(s.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=xc,label:i,variant:a=Rr.Toolbar,disabled:d=!1,commandHook:c,...u}=e,p=s.useRef(null),m=s.useRef(!1),h=s.useMemo(()=>{const T={onExecute(F,_){c?.onExecute?.(F,_),m.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),m.current=!1},onError(F,_,O){c?.onError(F,_,O)}};return c?.beforeExecute&&(T.beforeExecute=c.beforeExecute),T},[c]),g=D2(n,h),f=()=>n?.state()?.toString()||"0",[x,y]=s.useState(f),w=un(()=>{const T=parseFloat(x);isNaN(T)?y(f()):parseFloat(f())!==T&&n.execute(T,c)},[f,n,x,c]);s.useEffect(()=>{y(f())},[n?.state()]);const b=s.useMemo(()=>typeof r=="function"?r(n):r,[g,r]),C=s.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[g]),k=s.useMemo(()=>l.jsx(B.IconButton,{...u,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:T=>T.stopPropagation(),onMouseDown:T=>{T.button===0&&T.stopPropagation()},onMouseUp:T=>{T.button===0&&T.stopPropagation()},children:l.jsx(B.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:T=>`${Math.round(T.typography.fontSize)}px`,width:T=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:x,onFocus:T=>{T.target?.select()},onKeyDown:T=>{if(T.which===zo.Enter)f()!==x&&(T.stopPropagation(),T.preventDefault(),w());else if(T.which===zo.Escape)f()!==x&&(y(f()),setTimeout(()=>{T.target?.select()},0),T.stopPropagation(),T.preventDefault());else{if(T.key.match("[-]")||T.key.match("[0-9.]")&&(x+T.key).length>4)return T.stopPropagation(),void T.preventDefault();if(T.which===zo.Space)return void T.preventDefault()}},onBlur:()=>{w()},onChange:T=>{if(T.target.value.length>4)return T.stopPropagation(),void T.preventDefault();y(T.target.value)}})}),[x,d,n]),E={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:d||!n||n.disabled(),onMouseDown:T=>{T.button===0&&T.preventDefault()},onMouseUp:T=>{T.button!==0||T.isPropagationStopped()||T.isDefaultPrevented()||T.isDefaultPrevented()||(T.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:T=>{T.keyCode!==zo.Enter&&T.keyCode!==zo.Space||n?.execute(!n?.state?.(),h)}};let M;return M=a===Rr.Menuitem?l.jsxs(lr,{...u,chips:n?.tags(),...E,children:[C,k]}):l.jsx(gr,{...u,...E}),n?.label()&&((n.disabled()||d)&&(M=l.jsx("div",{children:M})),M=l.jsx(ba,{command:n,placement:a===Rr.Toolbar?"bottom-start":"right-start",children:M})),M})),In=s.memo(s.forwardRef((e,t)=>{const{variant:n=Rr.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:a,commandHook:d,disabled:c,label:u,icon:p,createPopupPanel:m,tooltip:h,selected:g,scope:f,...x}=e,y=s.useRef(null),w=s.useRef(!1),b=s.useMemo(()=>{const O={onExecute(S,v){d?.onExecute?.(S,v),w.current||(y.current?.start({center:!1}),setTimeout(()=>y.current?.stop({}),180)),w.current=!1},onError(S,v,D){d?.onError(S,v,D)}};return d?.beforeExecute&&(O.beforeExecute=d.beforeExecute),O},[d]),C=L2(i,[o],null,[o]),k=C[0],{label:E,icon:M}=s.useMemo(()=>{let O=null;u&&(O=typeof u=="function"?u(k):u),O||(O=k?.label?.(f));let S=null;return p&&(S=typeof p=="function"?p(k):p),S||(S=k?.icon?.()),{label:O,icon:S}},[C,u,p]),T={disabled:c,scope:f,touchRippleRef:y,onQuickClick:r,tooltip:h,label:E,icon:M};(E||h)&&(T.createTooltip=({children:O},S)=>l.jsx(Bo,{label:E,description:h,disabled:S,children:O}));const F=un(O=>m?.(O,i),[m,C]),_=un(O=>k?.execute(a,b),[k]);return k?(T.quickButtonProps={},T.quickButtonProps.createTooltip=({children:O,placement:S},v)=>l.jsx(ba,{command:k,placement:S??n===Rr.Toolbar?"bottom-start":"right-start",disabled:v,children:O}),T.disabled=T.disabled??k?.disabled(),r||(T.onQuickClick=_)):o&&(T.onQuickClick=()=>{}),T.selected=g??k?.state(),T.createPopupPanel=F,n===Rr.Toolbar?l.jsx(Gr,{...x,...T,ref:t}):l.jsx(Jl,{...x,...T,ref:t})}));In.displayName="CommandPopupButton";const ma=e=>{const{command:t,label:n,scope:o,icon:r=l.jsx(g2,{}),sx:i,...a}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:d=>d.typography.subtitle2.fontSize,...i},...a,children:[r?xe(r):null,l.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:d=>d.spacing(.25),paddingRight:d=>d.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},es=s.memo(s.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:d,...c}=e,u=gc(t,()=>({}),[]),[p,m]=s.useState(null),{reference:h}=l0({label:"toolbar",anchor:u.current,parentFloat:i,createPopupPanel:null}),g=s.useCallback(()=>{const T=p;T&&requestAnimationFrame(()=>{u.current?.contains(document.activeElement)&&T.focus()})},[]),f=s.useMemo(()=>({dense:!0,outlined:!1}),[]),x=s.useMemo(()=>{const{commandHook:T,...F}=r||{};return{commandHook:{beforeExecute:(_,O)=>T?.beforeExecute?.(_,O)!==!1&&h.closeAll(),onExecute(_,O){T?.onExecute?.(_,O),g()},onError(_,O,S){T?.onError?.(_,O,S)}},...F}},[h,r]),y=s.useMemo(()=>({...f,...x}),[f,x]),[w,b]=s.useReducer(T=>T+1,0);L2(o,[],{onChange:()=>{b()}});const C=s.useMemo(()=>({commands:o,parentFloat:h,...x}),[w,y,h,r]);let k=0;f.dense||(k+=2),f.outlined&&k++;let E=2;f.dense||(E=4);const M=s.useMemo(()=>a({commands:o,commandButtonProps:y,commandPopupProps:{commands:o,...C,...r}}),[w,y,C,a]);return l.jsx(B.Toolbar,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${E}px`,paddingBottom:`${E}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:u,onFocus:T=>{T.relatedTarget&&!p&&m(T.relatedTarget)},onBlur:T=>{p&&!u?.current?.contains(T.relatedTarget)&&m(null)},onKeyDown:T=>{p&&T.which===zo.Escape&&p.focus()},...c,children:l.jsx("div",{ref:u,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${E}px`,columnGap:`${k}px`,alignItems:"center",maxWidth:"100%"},children:M})})}));es.displayName="CommandToolbar";const US=e=>{const{key:t,...n}=e;return l.jsx(je,{...n},t)},i0=s.memo(s.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o=US,scope:r,commands:i,icon:a,quickCommand:d,popupScope:c=d,commandState:u,commandHook:p,disabled:m=!1,...h}=e,g=L2(i,n?[d,...n]:[d]),f=s.useCallback((x,y)=>{const w={variant:Rr.Menuitem,commandHook:p,commandState:u,icon:a,scope:c,disabled:m},b=[];for(let C=0;C<n?.length;C++){const k=n[C];if(k===null||k==="-"){b.push(l.jsx(Mt,{orientation:"horizontal"},`element-${b.length}`));continue}const E=y.getCommand(k),M={key:`${k}-${b.length}`,command:E,...w},T=o(M);T&&b.push(T)}return wn({...x,children:b})},[m,p,u,c,n,a,o]);return n?l.jsx(In,{ref:t,commands:i,disabled:m,commandHook:p,commandState:u,scope:r,quickCommand:d,icon:a,createPopupPanel:f,...h}):o({ref:t,disabled:m,commandHook:p,commandState:u,scope:r,command:g[0],icon:a,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const H9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),u=s.useMemo(()=>{for(let g=0;g<c.length;g++)if(c[g]?.state())return c[g].key();return c[0]?.key()},[c]),p=s.useMemo(()=>{const g=new Map;return g.set("formatAlignLeftToggle",xe(l.jsx(gn.FormatAlignLeft,{}))),g.set("formatAlignCenterToggle",xe(l.jsx(gn.FormatAlignCenter,{}))),g.set("formatAlignRightToggle",xe(l.jsx(gn.FormatAlignRight,{}))),g.set("formatAlignJustifyToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g.set("formatAlignCenterContinuousToggle",xe(l.jsx(gn.FormatAlignCenter,{}))),g.set("formatAlignFillToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g.set("formatAlignDistributedHorizontalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),g},[]),m=s.useMemo(()=>{if(!o)return null;const g={...o};return delete g.beforeExecute,g},[o]),h=s.useCallback((g,f)=>{const x={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},y=l.jsxs(l.Fragment,{children:[l.jsx(je,{...x,command:f.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...x,command:f.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),l.jsx(je,{...x,command:f.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),w=l.jsxs(B.Box,{sx:{className:Zn("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:C=>C.stopPropagation(),children:[l.jsx(je,{command:f.getCommand("formatIndentDecrease"),commandHook:m,scope:r,disabled:i,icon:xe(l.jsx(Ow,{}))}),l.jsx(je,{command:f.getCommand("formatIndentIncrease"),commandHook:m,scope:r,disabled:i,icon:xe(l.jsx(Lw,{}))})]}),b=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...d,children:[w,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return wn({...g,children:b})},[i,o]);return l.jsx(In,{ref:t,parentFloat:a,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:u,icon:p.get(u)??l.jsx(gn.FormatAlignLeft,{}),...d})})),$9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatAlignTopToggle",xe(l.jsx(Hw,{}))),m.set("formatAlignMiddleToggle",xe(l.jsx($w,{}))),m.set("formatAlignBottomToggle",xe(l.jsx(H6,{}))),m.set("formatAlignJustifyVerticalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),m.set("formatAlignDistributedVerticalToggle",xe(l.jsx(gn.FormatAlignJustify,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatAlignTopToggle"),icon:u.get("formatAlignTopToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:u.get("formatAlignMiddleToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:u.get("formatAlignBottomToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:u.get("formatAlignJustifyVerticalToggle")}),l.jsx(je,{...g,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:u.get("formatAlignDistributedVerticalToggle")})]});return wn({...m,children:f})},[i,o,u]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:u.get(c)??xe(l.jsx(H6,{})),...a})})),W9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatTextOverflowVisibleToggle",xe(l.jsx(Z3,{}))),m.set("formatTextOverflowWrapToggle",xe(l.jsx(Ty,{}))),m.set("formatTextOverflowClipToggle",xe(l.jsx(jy,{}))),m.set("formatTextOverflowShrinkToggle",xe(l.jsx(My,{}))),m},[]),p=de((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:u.get("formatTextOverflowVisibleToggle")}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:u.get("formatTextOverflowWrapToggle")}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:u.get("formatTextOverflowClipToggle")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...g,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:u.get("formatTextOverflowShrinkToggle")})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:u.get(c)??xe(l.jsx(Z3,{})),...a})})),U9=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=s.useMemo(()=>{const h=d.length;for(let g=0;g<h;g++){const f=d[g];if(f?.state())return f.key()}return d[1]?.key()},[d]),u=s.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",xe(l.jsx(Ms,{}))),h.set("formatTextRotate315",xe(l.jsx(Ms,{}))),h.set("formatTextRotate45",xe(l.jsx(z6,{}))),h.set("formatTextRotate90",xe(l.jsx(B6,{}))),h.set("formatTextRotate270",xe(l.jsx(N6,{}))),h.set("formatTextRotateCustom",xe(l.jsx(V6,{}))),h},[]),p=s.useCallback((h,g)=>{const f={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},x=l.jsxs(l.Fragment,{children:[l.jsx(je,{...f,command:g.getCommand("formatTextRotate0"),icon:xe(l.jsx(Vw,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate315"),icon:xe(l.jsx(Ms,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate45"),icon:xe(l.jsx(z6,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate90"),icon:xe(l.jsx(B6,{}))}),l.jsx(je,{...f,command:g.getCommand("formatTextRotate270"),icon:xe(l.jsx(N6,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(WS,{...f,command:g.getCommand("formatTextRotateCustom"),icon:xe(l.jsx(V6,{})),label:"Custom"})]});return wn({...h,children:x})},[i,o,r,n]),m=s.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[d]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,selected:m,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:m?"formatTextRotate0":"formatTextRotate315",icon:xe(u.get(c)??l.jsx(Ms,{})),...a})}));function wi(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const V0="$$material";function qS(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5,...r}=e,i=(p=>{const m=Object.keys(p).map(h=>({key:h,val:p[h]}))||[];return m.sort((h,g)=>h.val-g.val),m.reduce((h,g)=>({...h,[g.key]:g.val}),{})})(t),a=Object.keys(i);function d(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-o/100}${n})`}function u(p,m){const h=a.indexOf(m);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(h!==-1&&typeof t[a[h]]=="number"?t[a[h]]:m)-o/100}${n})`}return{keys:a,values:i,up:d,down:c,between:u,only:function(p){return a.indexOf(p)+1<a.length?u(p,a[a.indexOf(p)+1]):d(p)},not:function(p){const m=a.indexOf(p);return m===0?d(a[1]):m===a.length-1?c(a[m]):u(p,a[a.indexOf(p)+1]).replace("@media","@media not all and")},unit:n,...r}}var qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},N4,V4,H4={exports:{}},Bn={};function ZS(){if(N4)return Bn;N4=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function f(x){if(typeof x=="object"&&x!==null){var y=x.$$typeof;switch(y){case e:switch(x=x.type){case n:case r:case o:case c:case u:case h:return x;default:switch(x=x&&x.$$typeof){case a:case d:case m:case p:case i:return x;default:return y}}case t:return y}}}return Bn.ContextConsumer=i,Bn.ContextProvider=a,Bn.Element=e,Bn.ForwardRef=d,Bn.Fragment=n,Bn.Lazy=m,Bn.Memo=p,Bn.Portal=t,Bn.Profiler=r,Bn.StrictMode=o,Bn.Suspense=c,Bn.SuspenseList=u,Bn.isContextConsumer=function(x){return f(x)===i},Bn.isContextProvider=function(x){return f(x)===a},Bn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Bn.isForwardRef=function(x){return f(x)===d},Bn.isFragment=function(x){return f(x)===n},Bn.isLazy=function(x){return f(x)===m},Bn.isMemo=function(x){return f(x)===p},Bn.isPortal=function(x){return f(x)===t},Bn.isProfiler=function(x){return f(x)===r},Bn.isStrictMode=function(x){return f(x)===o},Bn.isSuspense=function(x){return f(x)===c},Bn.isSuspenseList=function(x){return f(x)===u},Bn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===r||x===o||x===c||x===u||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===p||x.$$typeof===a||x.$$typeof===i||x.$$typeof===d||x.$$typeof===g||x.getModuleId!==void 0)},Bn.typeOf=f,Bn}function GS(){return V4||(V4=1,H4.exports=ZS()),H4.exports}var q9=GS();function x0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function Z9(e){if(H0.isValidElement(e)||q9.isValidElementType(e)||!x0(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Z9(e[n])}),t}function xr(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return x0(e)&&x0(t)&&Object.keys(t).forEach(r=>{H0.isValidElement(t[r])||q9.isValidElementType(t[r])?o[r]=t[r]:x0(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&x0(e[r])?o[r]=xr(e[r],t[r],n):n.clone?o[r]=x0(t[r])?Z9(t[r]):t[r]:o[r]=t[r]}),o}function W2(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function W0(e){if(e.type)return e;if(e.charAt(0)==="#")return W0(function(i){i=i.slice(1);const a=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let d=i.match(a);return d&&d[0].length===1&&(d=d.map(c=>c+c)),d?`rgb${d.length===4?"a":""}(${d.map((c,u)=>u<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(wi(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(wi(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const cl=(e,t)=>{try{return(n=>{const o=W0(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function bc(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function G9(e){e=W0(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),a=(u,p=(u+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let d="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return e.type==="hsla"&&(d+="a",c.push(t[3])),bc({type:d,values:c})}function Bu(e){let t=(e=W0(e)).type==="hsl"||e.type==="hsla"?W0(G9(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ds(e,t,n){try{return function(o,r){return o=W0(o),r=W2(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,bc(o)}(e,t)}catch{return e}}function U2(e,t){if(e=W0(e),t=W2(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return bc(e)}function Un(e,t,n){try{return U2(e,t)}catch{return e}}function q2(e,t){if(e=W0(e),t=W2(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return bc(e)}function qn(e,t,n){try{return q2(e,t)}catch{return e}}function Ls(e,t,n){try{return function(o,r=.15){return Bu(o)>.5?U2(o,r):q2(o,r)}(e,t)}catch{return e}}const zl={black:"#000",white:"#fff"},KS={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},XS="#f3e5f5",YS="#ce93d8",JS="#ba68c8",QS="#ab47bc",eC="#9c27b0",tC="#7b1fa2",nC="#e57373",oC="#ef5350",rC="#f44336",$4="#d32f2f",iC="#c62828",aC="#ffb74d",lC="#ffa726",sC="#ff9800",cC="#f57c00",dC="#e65100",uC="#e3f2fd",pC="#90caf9",W4="#42a5f5",hC="#1976d2",mC="#1565c0",fC="#4fc3f7",gC="#29b6f6",xC="#03a9f4",U4="#0288d1",yC="#01579b",bC="#81c784",wC="#66bb6a",vC="#4caf50",SC="#388e3c",CC="#2e7d32",kC="#1b5e20";function K9(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:zl.white,default:zl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const EC=K9();function X9(){return{text:{primary:zl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:zl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const q4=X9();function Z4(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=q2(e.main,r):t==="dark"&&(e.dark=U2(e.main,i)))}function Z2(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(f="light"){return f==="dark"?{main:pC,light:uC,dark:W4}:{main:hC,light:W4,dark:mC}}(t),a=e.secondary||function(f="light"){return f==="dark"?{main:YS,light:XS,dark:QS}:{main:eC,light:JS,dark:tC}}(t),d=e.error||function(f="light"){return f==="dark"?{main:rC,light:nC,dark:$4}:{main:$4,light:oC,dark:iC}}(t),c=e.info||function(f="light"){return f==="dark"?{main:gC,light:fC,dark:U4}:{main:U4,light:xC,dark:yC}}(t),u=e.success||function(f="light"){return f==="dark"?{main:wC,light:bC,dark:SC}:{main:CC,light:vC,dark:kC}}(t),p=e.warning||function(f="light"){return f==="dark"?{main:lC,light:aC,dark:cC}:{main:"#ed6c02",light:sC,dark:dC}}(t);function m(f){return function(y,w){const b=Bu(y),C=Bu(w);return(Math.max(b,C)+.05)/(Math.min(b,C)+.05)}(f,q4.text.primary)>=n?q4.text.primary:EC.text.primary}const h=({color:f,name:x,mainShade:y=500,lightShade:w=300,darkShade:b=700})=>{if(!(f={...f}).main&&f[y]&&(f.main=f[y]),!f.hasOwnProperty("main"))throw new Error(wi(11,x?` (${x})`:"",y));if(typeof f.main!="string")throw new Error(wi(12,x?` (${x})`:"",JSON.stringify(f.main)));return Z4(f,"light",w,o),Z4(f,"dark",b,o),f.contrastText||(f.contrastText=m(f.main)),f};let g;return t==="light"?g=K9():t==="dark"&&(g=X9()),xr({common:{...zl},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:d,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:u,name:"success"}),grey:KS,contrastThreshold:n,getContrastText:m,augmentColor:h,tonalOffset:o,...g},r)}var G4,K4,xd,X4,Y4,J4={exports:{}};function _C(){return K4?G4:(K4=1,G4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function TC(){if(X4)return xd;X4=1;var e=_C();function t(){}function n(){}return n.resetWarningCache=t,xd=function(){function o(a,d,c,u,p,m){if(m!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},xd}function ts(){return Y4||(Y4=1,J4.exports=TC()()),J4.exports}function vl(e,t){return t?xr(e,t,{clone:!1}):e}function Q4(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const wc={xs:0,sm:600,md:900,lg:1200,xl:1536},e7={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${wc[e]}px)`},jC={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:wc[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function w0(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||e7;return t.reduce((i,a,d)=>(i[r.up(r.keys[d])]=n(t[d]),i),{})}if(typeof t=="object"){const r=o.breakpoints||e7;return Object.keys(t).reduce((i,a)=>{if(d=r.keys,(c=a)==="@"||c.startsWith("@")&&(d.some(u=>c.startsWith(`@${u}`))||c.match(/^@\d/))){const u=function(p,m){const h=m.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,g,f]=h,x=Number.isNaN(+g)?g||0:+g;return p.containerQueries(f).up(x)}(o.containerQueries?o:jC,a);u&&(i[u]=n(t[a],a))}else if(Object.keys(r.values||wc).includes(a))i[r.up(a)]=n(t[a],a);else{const u=a;i[u]=t[u]}var d,c;return i},{})}return n(t)}function t7(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function Y9(e){if(typeof e!="string")throw new Error(wi(7));return e.charAt(0).toUpperCase()+e.slice(1)}function vc(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function W1(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:vc(e,n)||o,t&&(r=t(r,o,e)),r}function wo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=a=>{if(a[t]==null)return null;const d=a[t],c=vc(a.theme,o)||{};return w0(a,d,u=>{let p=W1(c,r,u);return u===p&&typeof u=="string"&&(p=W1(c,r,`${t}${u==="default"?"":Y9(u)}`,u)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const MC={m:"margin",p:"padding"},RC={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},n7={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},IC=function(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!n7[e])return[e];e=n7[e]}const[t,n]=e.split(""),o=MC[t],r=RC[n]||"";return Array.isArray(r)?r.map(i=>o+i):[o+r]}),J9=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Q9=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function ns(e,t,n,o){const r=vc(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),d=r[a];return i>=0?d:typeof d=="number"?-d:`-${d}`}:typeof r=="function"?r:()=>{}}function G2(e){return ns(e,"spacing",8)}function os(e,t){return typeof t=="string"||t==null?t:e(t)}function DC(e,t,n,o){if(!t.includes(n))return null;const r=function(i,a){return d=>i.reduce((c,u)=>(c[u]=os(a,d),c),{})}(IC(n),o);return w0(e,e[n],r)}function em(e,t){const n=G2(e.theme);return Object.keys(e).map(o=>DC(e,t,o,n)).reduce(vl,{})}function lo(e){return em(e,J9)}function so(e){return em(e,Q9)}lo.propTypes={},lo.filterProps=J9,so.propTypes={},so.filterProps=Q9;const LC={borderRadius:4};function Sc(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?vl(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function Mr(e){return typeof e!="number"?e:`${e}px solid`}function Ar(e,t){return wo({prop:e,themeKey:"borders",transform:t})}const OC=Ar("border",Mr),AC=Ar("borderTop",Mr),PC=Ar("borderRight",Mr),FC=Ar("borderBottom",Mr),zC=Ar("borderLeft",Mr),BC=Ar("borderColor"),NC=Ar("borderTopColor"),VC=Ar("borderRightColor"),HC=Ar("borderBottomColor"),$C=Ar("borderLeftColor"),WC=Ar("outline",Mr),UC=Ar("outlineColor"),x1=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ns(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:os(t,o)});return w0(e,e.borderRadius,n)}return null};x1.propTypes={},x1.filterProps=["borderRadius"],Sc(OC,AC,PC,FC,zC,BC,NC,VC,HC,$C,x1,WC,UC);const U1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ns(e.theme,"spacing",8),n=o=>({gap:os(t,o)});return w0(e,e.gap,n)}return null};U1.propTypes={},U1.filterProps=["gap"];const q1=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ns(e.theme,"spacing",8),n=o=>({columnGap:os(t,o)});return w0(e,e.columnGap,n)}return null};q1.propTypes={},q1.filterProps=["columnGap"];const Z1=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ns(e.theme,"spacing",8),n=o=>({rowGap:os(t,o)});return w0(e,e.rowGap,n)}return null};Z1.propTypes={},Z1.filterProps=["rowGap"];function na(e,t){return t==="grey"?t:e}Sc(U1,q1,Z1,wo({prop:"gridColumn"}),wo({prop:"gridRow"}),wo({prop:"gridAutoFlow"}),wo({prop:"gridAutoColumns"}),wo({prop:"gridAutoRows"}),wo({prop:"gridTemplateColumns"}),wo({prop:"gridTemplateRows"}),wo({prop:"gridTemplateAreas"}),wo({prop:"gridArea"}));function pr(e){return e<=1&&e!==0?100*e+"%":e}Sc(wo({prop:"color",themeKey:"palette",transform:na}),wo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:na}),wo({prop:"backgroundColor",themeKey:"palette",transform:na}));const qC=wo({prop:"width",transform:pr}),K2=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||wc[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:pr(n)}};return w0(e,e.maxWidth,t)}return null};K2.filterProps=["maxWidth"];const ZC=wo({prop:"minWidth",transform:pr}),GC=wo({prop:"height",transform:pr}),KC=wo({prop:"maxHeight",transform:pr}),XC=wo({prop:"minHeight",transform:pr});wo({prop:"size",cssProperty:"width",transform:pr}),wo({prop:"size",cssProperty:"height",transform:pr});Sc(qC,K2,ZC,GC,KC,XC,wo({prop:"boxSizing"}));const Cc={border:{themeKey:"borders",transform:Mr},borderTop:{themeKey:"borders",transform:Mr},borderRight:{themeKey:"borders",transform:Mr},borderBottom:{themeKey:"borders",transform:Mr},borderLeft:{themeKey:"borders",transform:Mr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:x1},color:{themeKey:"palette",transform:na},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:na},backgroundColor:{themeKey:"palette",transform:na},p:{style:so},pt:{style:so},pr:{style:so},pb:{style:so},pl:{style:so},px:{style:so},py:{style:so},padding:{style:so},paddingTop:{style:so},paddingRight:{style:so},paddingBottom:{style:so},paddingLeft:{style:so},paddingX:{style:so},paddingY:{style:so},paddingInline:{style:so},paddingInlineStart:{style:so},paddingInlineEnd:{style:so},paddingBlock:{style:so},paddingBlockStart:{style:so},paddingBlockEnd:{style:so},m:{style:lo},mt:{style:lo},mr:{style:lo},mb:{style:lo},ml:{style:lo},mx:{style:lo},my:{style:lo},margin:{style:lo},marginTop:{style:lo},marginRight:{style:lo},marginBottom:{style:lo},marginLeft:{style:lo},marginX:{style:lo},marginY:{style:lo},marginInline:{style:lo},marginInlineStart:{style:lo},marginInlineEnd:{style:lo},marginBlock:{style:lo},marginBlockStart:{style:lo},marginBlockEnd:{style:lo},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:U1},rowGap:{style:Z1},columnGap:{style:q1},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:pr},maxWidth:{style:K2},minWidth:{transform:pr},height:{transform:pr},maxHeight:{transform:pr},minHeight:{transform:pr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},wa=function(){function e(t,n,o,r){const i={[t]:n,theme:o},a=r[t];if(!a)return{[t]:n};const{cssProperty:d=t,themeKey:c,transform:u,style:p}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const m=vc(o,c)||{};return p?p(i):w0(i,n,h=>{let g=W1(m,u,h);return h===g&&typeof h=="string"&&(g=W1(m,u,`${t}${h==="default"?"":Y9(h)}`,h)),d===!1?g:{[d]:g}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const a=r.unstable_sxConfig??Cc;function d(c){let u=c;if(typeof c=="function")u=c(r);else if(typeof c!="object")return c;if(!u)return null;const p=function(g={}){return g.keys?.reduce((x,y)=>(x[g.up(y)]={},x),{})||{}}(r.breakpoints),m=Object.keys(p);let h=p;return Object.keys(u).forEach(g=>{const f=(x=u[g],y=r,typeof x=="function"?x(y):x);var x,y;if(f!=null)if(typeof f=="object")if(a[g])h=vl(h,e(g,f,r,a));else{const w=w0({theme:r},f,b=>({[g]:b}));(function(...b){const C=b.reduce((E,M)=>E.concat(Object.keys(M)),[]),k=new Set(C);return b.every(E=>k.size===Object.keys(E).length)})(w,f)?h[g]=t({sx:f,theme:r,nested:!0}):h=vl(h,w)}else h=vl(h,e(g,f,r,a))}),!i&&r.modularCssLayers?{"@layer sx":Q4(r,t7(m,h))}:Q4(r,t7(m,h))}return Array.isArray(o)?o.map(d):d(o)}}();function YC(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function tm(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...a}=e,d=qS(n),c=function(p=8,m=G2({spacing:p})){if(p.mui)return p;const h=(...g)=>(g.length===0?[1]:g).map(f=>{const x=m(f);return typeof x=="number"?`${x}px`:x}).join(" ");return h.mui=!0,h}(r);let u=xr({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:c,shape:{...LC,...i}},a);return u=function(p){const m=(x,y)=>x.replace("@media",y?`@container ${y}`:"@container");function h(x,y){x.up=(...w)=>m(p.breakpoints.up(...w),y),x.down=(...w)=>m(p.breakpoints.down(...w),y),x.between=(...w)=>m(p.breakpoints.between(...w),y),x.only=(...w)=>m(p.breakpoints.only(...w),y),x.not=(...w)=>{const b=m(p.breakpoints.not(...w),y);return b.includes("not all and")?b.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):b}}const g={},f=x=>(h(g,x),g);return h(f),{...p,containerQueries:f}}(u),u.applyStyles=YC,u=t.reduce((p,m)=>xr(p,m),u),u.unstable_sxConfig={...Cc,...a?.unstable_sxConfig},u.unstable_sx=function(p){return wa({sx:p,theme:this})},u}wa.filterProps=["sx"];const o7=(e,t,n,o=[])=>{let r=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function yd(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},a={};var d,c;return d=(u,p,m)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(u,p))){const h=`--${n?`${n}-`:""}${u.join("-")}`,g=((f,x)=>typeof x=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(y=>f.includes(y))||f[f.length-1].toLowerCase().includes("opacity")?x:`${x}px`:x)(u,p);Object.assign(r,{[h]:g}),o7(i,u,`var(${h})`,m),o7(a,u,`var(${h}, ${g})`,m)}},c=u=>u[0]==="vars",function u(p,m=[],h=[]){Object.entries(p).forEach(([g,f])=>{(!c||c&&!c([...m,g]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?u(f,[...m,g],Array.isArray(f)?[...h,g]:h):d([...m,g],f,h))})}(e),{css:r,vars:i,varsWithDefaults:a}}function JC(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}function QC(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}const r7={textTransform:"uppercase"},i7='"Roboto", "Helvetica", "Arial", sans-serif';function nm(e,t){const{fontFamily:n=i7,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:d=700,htmlFontSize:c=16,allVariants:u,pxToRem:p,...m}=typeof t=="function"?t(e):t,h=o/14,g=p||(y=>y/c*h+"rem"),f=(y,w,b,C,k)=>{return{fontFamily:n,fontWeight:y,fontSize:g(w),lineHeight:b,...n===i7?{letterSpacing:(E=C/w,Math.round(1e5*E)/1e5+"em")}:{},...k,...u};var E},x={h1:f(r,96,1.167,-1.5),h2:f(r,60,1.2,-.5),h3:f(i,48,1.167,0),h4:f(i,34,1.235,.25),h5:f(i,24,1.334,0),h6:f(a,20,1.6,.15),subtitle1:f(i,16,1.75,.15),subtitle2:f(a,14,1.57,.1),body1:f(i,16,1.5,.15),body2:f(i,14,1.43,.15),button:f(a,14,1.75,.4,r7),caption:f(i,12,1.66,.4),overline:f(i,12,2.66,1,r7),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return xr({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:d,...x},m,{clone:!1})}function Qn(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const ek=["none",Qn(0,2,1,-1,0,1,1,0,0,1,3,0),Qn(0,3,1,-2,0,2,2,0,0,1,5,0),Qn(0,3,3,-2,0,3,4,0,0,1,8,0),Qn(0,2,4,-1,0,4,5,0,0,1,10,0),Qn(0,3,5,-1,0,5,8,0,0,1,14,0),Qn(0,3,5,-1,0,6,10,0,0,1,18,0),Qn(0,4,5,-2,0,7,10,1,0,2,16,1),Qn(0,5,5,-3,0,8,10,1,0,3,14,2),Qn(0,5,6,-3,0,9,12,1,0,3,16,2),Qn(0,6,6,-3,0,10,14,1,0,4,18,3),Qn(0,6,7,-4,0,11,15,1,0,4,20,3),Qn(0,7,8,-4,0,12,17,2,0,5,22,4),Qn(0,7,8,-4,0,13,19,2,0,5,24,4),Qn(0,7,9,-4,0,14,21,2,0,5,26,4),Qn(0,8,9,-5,0,15,22,2,0,6,28,5),Qn(0,8,10,-5,0,16,24,2,0,6,30,5),Qn(0,8,11,-5,0,17,26,2,0,6,32,5),Qn(0,9,11,-5,0,18,28,2,0,7,34,6),Qn(0,9,12,-6,0,19,29,2,0,7,36,6),Qn(0,10,13,-6,0,20,31,3,0,8,38,7),Qn(0,10,13,-6,0,21,33,3,0,8,40,7),Qn(0,10,14,-6,0,22,35,3,0,8,42,7),Qn(0,11,14,-7,0,23,36,3,0,9,44,8),Qn(0,11,15,-7,0,24,38,3,0,9,46,8)],tk={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},nk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a7(e){return`${Math.round(e)}ms`}function ok(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function rk(e){const t={...tk,...e.easing},n={...nk,...e.duration};return{getAutoHeightDuration:ok,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:d=0,...c}=r;return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:a7(i)} ${a} ${typeof d=="string"?d:a7(d)}`).join(",")},...e,easing:t,duration:n}}const ik={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function ak(e){return x0(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function om(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[a,d]=r[i];!ak(d)||a.startsWith("unstable_")?delete o[a]:x0(d)&&(o[a]={...d},n(o[a]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
38
38
|
|
|
39
39
|
const theme = ${JSON.stringify(t,null,2)};
|
|
40
40
|
|
|
@@ -59,7 +59,7 @@ Please use Chrome or Edge if external copy and paste is required.`,Perms:Cd,Perm
|
|
|
59
59
|
|
|
60
60
|
The formatting is not applied.`,shortcut:{key:"V",modifiers:[we.Ctrl,we.Shift]}}),new _e("pasteFormats",I,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
61
61
|
|
|
62
|
-
The content is not applied.`}),new _e("pasteFormulas",I,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new _e("pasteTranspose",I,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new _e("pasteLinks",I,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];f.addCommands(L,!0)},[f,m]),s.useEffect(()=>{if(!f)return;const I={disabled:!h.getProtection().isFormatCellsAllowed()};f.getCommand("pasteValues").updateCallback(L=>R.paste({...r_,...L})).update(I),f.getCommand("pasteFormats").updateCallback((L,H)=>R.paste({...i_,description:H.label(),...L})).update(I),f.getCommand("pasteFormulas").updateCallback((L,H)=>R.paste({...a_,description:H.label(),...L})).update(I),f.getCommand("pasteTranspose").updateCallback((L,H)=>R.paste({...l_,description:H.label(),...L})).update(I),f.getCommand("pasteLinks").updateCallback((L,H)=>R.paste({...s_,description:H.label(),...L})).update(I),f.getCommand("cut").update(I),f.getCommand("paste").update(I)},[h,f]);const P=s.useMemo(()=>{if(!S||!_.current)return;const I=S.key;if(I!=="copy"&&I!=="cut"&&I!=="formatPainter")return;const L=_.current.getItem();if(L.getSource()!==h)return;const H=_.current.isCut?.(),W=H?E:k,A=H?C:b,U=L.getCoords(),X=U?[U]:null;return X&&X.length!==0?ee=>{const V=[];for(let $=0;$<X.length;$++){const z=X[$],q=ee.toClipBounds(ee.getRangeCoordsBounds(z,{top:0,left:0,right:1,bottom:1}),Zo);q&&(V.push(F({range:z,key:`copy-selection-background-${$}`,x:q.x,y:q.y,width:Math.max(q.width,0),height:Math.max(q.height,0),stroke:W,strokeWidth:2})),V.push(F({range:z,key:`copy-selection-foreground-${$}`,x:q.x+(q.width<=2?-1:0),y:q.y,width:Math.max(q.width,3),height:Math.max(q.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[S,h,g,b,k,C,E]);return{...R,clipboard:j,overlays:P}})({element:o,sheet:r,sheetView:u,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:d});return Gt(r?.getSelection(),{onChange(m){}}),s.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),d_={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},u_={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},p_={key:"dragCopy",description:"Drag selection to copy cell contents."},h_={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},p8=(e,t)=>t.ctrlKey&&t.shiftKey?h_:t.ctrlKey?p_:t.shiftKey?u_:d_,m_={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},f_=s.memo(s.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:a,onShowTooltip:d,onCloseTooltip:c,sheet:u,gridRef:p,gridStyle:m,isActive:h,editingCoords:g,...f}=e,x=n?.getBounds(),y=de(d,[d]),w=de(c,[c]),[b,C]=s.useState(()=>u?.getSelection().getCoords()),k=de(Y=>{vo.isEqualSelectionCoords(Y,b)||u&&u.getSelection().updateCoords(Y)},[u,b]),E=qr(),M=s.useRef(null),[T,F]=s.useState(u?.getProtection().isLocked()),[_,O]=s.useState(u?.getView().getMovableSelection().length>0),S=hn.detectIt().primaryInput==="touch",v=!S&&h,D=g!==null||_,j=de(Y=>{const te=vo.cellToRange(Y);if(u.isClosed())return te;const re=u.getRange(te,{excludeHidden:!0}).getMerges();return re.length===0?te:re[0]},[u]),R=de((Y,te,re,ge,J,se)=>{const Se=u.getSelectedRange().getExtended(ge,Y).getCoords();switch(ge){case N.IRange.Direction.Up:return Se.rowStart;case N.IRange.Direction.Down:return Se.rowEnd;case N.IRange.Direction.Left:return Se.colStart;case N.IRange.Direction.Right:return Se.colEnd}},[u]),P=de(()=>{const Y=u.getUsedRange()?.getCoords(),te=u.getRowHeaders().getUsedRange()?.getCoords(),re=u.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,re?.max??0),rowEnd:Math.max(Y?.rowEnd??0,te?.max??0)}},[u]),I=de((Y,te)=>u.getRowHeaders().hiddenHeadersAt(Y,te),[u]),L=de((Y,te)=>u.getColumnHeaders().hiddenHeadersAt(Y,te),[u]),H=de(Y=>u.getRange(Y,{excludeHidden:!0}).getMerges(),[u]),W=de(Y=>{u?.getSelection().setAdjusting(Y)},[u]),A=de(async()=>{u?.getSelection().setAdjusting(null),E.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),E.setMode(null))},[E,b,u,o]),U=s.useMemo(()=>{const Y=E.getMode();return Y?.key==="cut"||Y?.key==="copy"},[E]);Gt(u?.getView(),{onMovableSelectionChange:()=>{O(u.getView().getMovableSelection().length>0)}}),Gt(u?.getSelection(),{onChange(Y){const te=u.getSelection().getCoords();C(te)}}),Gt(u,{onProtectionChange:()=>{F(u.getProtection().isLocked())}});const{body:X={}}=m||{},ee=n.getLayout(),V=!(v&&b.ranges.length<=1&&g===null&&!T&&(!E.getMode()||U)),{overlay:$,onPointerDown:z}=Fm({gridRef:p,commands:o,layout:ee,getCellCoordsAsRangeCoords:j,selection:b,fillHandleBorderColor:X.fill,selectionBackgroundColor:h?m.selection.fill:m.selectionInactive.fill,selectionBorderColor:h?m.selection.strokeFill:m.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?m.selectionRemove.fill:m.selectionInactive.fill,selectionRemoveBorderColor:h?m.selectionRemove.strokeFill:m.selectionInactive.strokeFill,disableFillDrag:V,disableMoveDrag:S||!(h&&b.ranges.length<=1&&g===null&&!T),disableTouchSelection:D,onSelectionChange:k,onSelectionDragStart:W,onSelectionDragEnd:A,onMoveDragStart:(Y,te,re)=>{E.setMode(p8(0,re))},onMoveDragUpdate:(Y,te,re)=>{E.setMode(p8(0,re))},onMoveDragEnd:(Y,te)=>{E.setMode(null)},onMoveDragDone:async(Y,te,re)=>{if(vo.isEqualRanges(Y,te))return;const ge=u.getRange(te);if(a?.showOptions){const oe=ge.getDifferences(Y);let ne=!1;for(let he=0;!ne&&he<oe.getCount();he++)ne=oe.at(he).isContentful();if(ne&&await a?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const J=!re.ctrlKey,se=re.shiftKey,Se=se?J?"Insert Moved Cells":"Insert Copied Cells":J?"Move Cells":"Copy Cells",Me=await a?.showBusy?.(Se);try{const oe=u.getRange(Y);await ge.doBatch(async()=>{se?await ge.insertFrom(Y,{isCut:J,undoRange:oe}):await ge.copyFrom(Y,{isCut:J,undoRange:oe}),oe.autoFit({skipCustomSize:!0,orientations:N.IRange.Orientations.Row,minContent:!0}),ge.autoFit({skipCustomSize:!0,orientations:N.IRange.Orientations.Row,minContent:!0})},{description:Se,autoSelect:!0})}catch(oe){a?.showError?.(oe)}finally{Me?.()}},contentfulCellFinder:R,hiddenRowsAt:I,hiddenColumnsAt:L,mergedRanges:H,getDataCoords:P,canSelectionSpanMergedCells:Y=>{const te=u.getRange(Y);return te.isEntireColumns()||te.isEntireRows()},onFill:async(Y,te)=>{const re="Auto Fill",ge=await a?.showBusy?.(re);try{await u.doBatch(()=>{u.getRange(Y).autoFill(te),u.getRange(te).autoFit({orientations:N.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:re,autoSelect:!0})}catch(J){a?.showError?.(J)}finally{M.current=null,ge?.()}},onFillPreview:(Y,te,re)=>{if(p.current&&y){E.setMode(m_);try{M.current?.direction!==re&&(M.current=null,u.getRange(Y).autoFill(te,{previewOnly:he=>{M.current={callback:he,direction:re}}}));const ge=M.current?.callback?.(te);if(!ge||ge.isEmpty())return;const J=ge.toText();if(!J)return;const se=vo.cellToRange(ge.getCoords()),Se=n.getRelativePointFromClient(0,0);let Me=0,oe=0,ne=qc;if(re===N.IRange.Direction.Down){Me=ee.getColOffset(se.colEnd+1)-Se.x;const he=ee.getRowOffset(se.rowEnd),ze=ee.getRowOffset(se.rowEnd+1);oe=ze-(ze-he)/2-Se.y,ne=lu}else if(re===N.IRange.Direction.Right){oe=ee.getRowOffset(se.rowEnd+1)-Se.y;const he=ee.getColOffset(se.colEnd),ze=ee.getColOffset(se.colEnd+1);Me=ze-(ze-he)/2-Se.x,ne=qc}else if(re===N.IRange.Direction.Up){Me=ee.getColOffset(se.colEnd+1)-Se.x;const he=ee.getRowOffset(se.rowStart),ze=ee.getRowOffset(se.rowStart+1);oe=ze-(ze-he)/2-Se.y,ne=lu}else if(re===N.IRange.Direction.Left){oe=ee.getRowOffset(se.rowEnd+1)-Se.y;const he=ee.getColOffset(se.colStart),ze=ee.getColOffset(se.colStart+1);Me=ze-(ze-he)/2-Se.x,ne=qc}y({anchor:{x:Me,y:oe},display:J,placement:ne})}catch(ge){a?.showError?.(ge)}}},onFillDone:()=>{M.current=null,E.setMode(null),w?.()}}),q=de(Y=>{z(hn.createSyntheticEvent(Y))},[z,g]);s.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",q),()=>{Y.removeEventListener("pointerdown",q)}},[n?.getStage()]);const G=Mo(t,()=>({}),[]),Q=s.useRef(null);return l.jsx("div",{className:sr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:va([G,Q]),...f,children:$(n)})})),Vs=Object.freeze({x:0,y:0,width:0,height:0}),g_={fireOnModelChange:!1},x_=s.memo(s.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:a,onHide:d,onShow:c,onUnFocus:u,isDragging:p,updateFrameBounds:m,dragStart:h,style:g,disabled:f,renderMovable:x,...y}=e,[w,b]=s.useState(Vs),[C,k]=s.useState(null),[E,M]=s.useState(!1),T=s.useRef(null);s.useLayoutEffect(()=>{if(r.isClosed())return;const _=r.getBounds();if(!_)return;const O=o.toViewBounds(_);b(O??Vs),m(O??Vs)},[o?.getBounds()]),Gt(r,{onBoundsChange:_=>{const O=_.getBounds();if(!O)return;const S=o.toViewBounds(O);b(S??Vs),m(S)},onSelectionChange:()=>{const _=zt.hasFocus(T.current,!0);!E&&!_||r.isSelected()||u()}}),Gt(r,{onRequestFocus:()=>zt.whenFocus(T.current,!0)},g_),s.useEffect(()=>{const _=T.current;return i(_),()=>{a(_)}},[]);const F=s.useMemo(()=>{if(!w)return null;let{width:_,height:O}=w;return x({view:o,movable:r,disabled:f,isDragging:p,style:{position:"relative",left:0,top:0,width:_,height:O},onHide:d,onShow:c})},[o,r,w.width,w.height,f,p]);return l.jsx("div",{className:"movable",tabIndex:0,ref:va([T,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:w.x,top:w.y,width:w.width,height:w.height,...g},onMouseDown:async _=>{const O=_.shiftKey||_.ctrlKey,S=r.isSelected(),v=_.currentTarget;O&&S?r.unselect():(S&&!O||await r.select({addToSelection:O}),h(_.nativeEvent,v),v.focus())},onFocus:_=>{_.relatedTarget&&!C&&k(_.relatedTarget),M(!0)},onBlur:_=>{C&&!T?.current?.contains(_.relatedTarget)&&k(null),_.relatedTarget&&M(!1)},...y,children:F})})),y_=s.memo(s.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:a,onUnFocus:d,onFocus:c,disabled:u=!1,disableDrag:p=!1,disableResize:m=!1,className:h,style:g,renderDirections:f=["nw","n","ne","w","e","sw","s","se"],onFirstRender:x,...y}=e,w=n.getBounds(),b=de(x,[x]),C=de(d,[d]),k=de(c,[c]),[E,M]=s.useState([]),[T,F]=s.useState(!1),[_,O]=s.useState(!1),S=s.useRef(!0),v=s.useRef(new Map),D=s.useRef(new Map),j=s.useRef(new Map),R=s.useRef(new Map),P=s.useRef(new Map),I=s.useRef({onRequestFocus:ke=>(re(ke),null)}),L=s.useRef(null),H=s.useRef(null),W=s.useRef(null),[A,U]=s.useReducer(ke=>ke+1,0);s.useLayoutEffect(()=>{U()},[n,o]),Gt(o,{onCollectionChange:()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),pt=P.current;pt.forEach(Ve=>{Ve()}),pt.clear();const xt=I.current;for(let Ve=0;Ve<ke.length;Ve++){const wt=ke[Ve];if(wt.isClosed())continue;const Ye=wt.addListeners(xt);pt.set(wt,Ye)}U()},onInvalidated:()=>{U()}}),Gt(r,{onMovableSelectionChange(ke){ee(),U()}});const X=s.useCallback((ke,pt)=>{const xt=j.current.get(ke);W.current&&(W.current.getTargets().forEach(Ve=>{if(Ve===xt)return Ve.style.left=pt.x+"px",Ve.style.top=pt.y+"px",Ve.style.width=pt.width+"px",void(Ve.style.height=pt.height+"px")}),W.current.updateRect())},[]),ee=()=>{const ke=[],pt=r.getMovableSelection();pt.forEach(xt=>{const Ve=j.current.get(xt);Ve&&pt.indexOf(xt)!==-1&&ke.push(Ve)}),M(xt=>zt.isEqualArrays(xt,ke)?xt:ke)},V=s.useRef(null),$=s.useMemo(()=>new Promise(ke=>{V.current=ke}),[]),z=s.useRef(null),q=de(async(ke,pt)=>{z.current=pt,await(async()=>!(!await $.then()||!W.current))()&&z.current===pt&&W.current.dragStart(ke,pt)},[E]),[G,Q]=s.useState(!1),Y=s.useRef(null),te=s.useRef(null),re=de(async(ke=null)=>{if(ke||(ke=r.getMovableSelection()[0]),!ke)return C?.(),!1;const pt=j.current.get(ke);pt?(await zt.whenFocus(pt),pt.focus(),te.current=pt,Y.current=null):Y.current=ke},[r]);s.useEffect(()=>{G&&E.length>0&&te.current!==E[0]&&re(),S.current&&(b?.(),S.current=!1)},[E]);const ge=s.useMemo(()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ke.length===0&&v.current.size===0)return null;const pt=(ae,Ue,ye,ve=!0)=>{const le=ae.isSelected(),Ie={tabIndex:ye,view:n,movable:ae,onRefLoad:Re=>{Y.current===ae&&(Re.focus(),te.current=Re,Y.current=null),j.current.set(ae,Re),D.current.set(Re,ae),Ue.rendered=!0,ee()},onRefUnload:Re=>{j.current.delete(ae),D.current.delete(Re),Ue.rendered=!1,ee()},onUnFocus:C,onHide:Re=>{Ue.onHide=Re},onShow:Re=>{Ue.onShow=Re},isDragging:le&&(_||T),disabled:u,renderMovable:i,updateFrameBounds:Re=>{X(ae,Re)},dragStart:q,onMouseUp:()=>{if(z.current=null,H.current){F(!1),O(!1);let Re=!1;R.current?.forEach(be=>{zt.isEqualBounds(be.movable.getBounds(),be.startBounds)||(Re=!0)}),Re?se():Se()}},style:{opacity:ve?T&&le?.7:void 0:0,zIndex:T&&le?ae.getZIndex()+ke.length:void 0,pointerEvents:ve?void 0:"none",cursor:_&&le?"grabbing":u||p?"initial":"move",boxShadow:!le||_&&!T?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return l.jsx(x_,{...Ie},`movable-${ae.getUUID()}`)},xt=v.current,Ve=new Map,wt=[];for(let ae=0;ae<ke.length;ae++){const Ue=ke[ae];if(Ue.isClosed())continue;let ye=xt.get(Ue);ye||(ye={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(ve,le)=>{if(!le||le.shown===!0)return;le.shown=!0;const Ie=++le.visibilityRequestId;requestAnimationFrame(()=>{const Re=v.current.get(ve);Re&&Ie===le.visibilityRequestId&&(le.onShow?.(ve),Re.shown=!0)})},doHide:async(ve,le)=>{if(!le||le?.shown===!1)return;le.shown=!1;const Ie=++le.visibilityRequestId,Re=await Promise.resolve(le.onHide?.(ve));Ie===le.visibilityRequestId&&Re!==!1&&(le.shown=!1,v.current.delete(ve),U())},visibilityRequestId:0}),ye.frame=pt(Ue,ye,ae,!0),wt.push(ye.frame),ye.doShow(Ue,ye),xt.delete(Ue),Ve.set(Ue,ye)}const Ye=[];return r.getMovableSelection().forEach(ae=>{const Ue=xt.get(ae);Ue&&(Ue.frame=pt(ae,Ue,-1,!1),Ye.push(Ue.frame),xt.delete(ae),Ve.set(ae,Ue))}),xt.forEach((ae,Ue)=>{ae.frame=pt(Ue,ae,-1,!1),Ye.push(ae.frame),ae.doHide(Ue,ae),xt.delete(Ue),Ve.set(Ue,ae)}),v.current=Ve,ee(),[...Ye,...wt]},[A,n,i,u,p,m,T,_]),J=de((ke,pt)=>{const xt=`${pt} ${E.length===1?N.TextUtils.capitalize(D.current?.get(E[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${xt}`),H.current.rollback(),H.current=null),H.current=a.beginCommit({description:xt}),R.current.clear();for(let Ve=0;Ve<E.length;Ve++){const wt=E[Ve],Ye=D.current?.get(wt);Ye?R.current.set(wt,{movable:Ye,startBounds:n.toViewBounds(Ye.getBounds())}):console.warn("invalid element",Ye)}},[a,n,E]),se=s.useCallback(()=>{if(!H.current)return;const ke=[];R.current?.forEach(pt=>{ke.push(pt.movable)}),H.current.commit({viewAfter:{view:r,movableSelection:ke}}),R.current.clear(),H.current=null},[]),Se=s.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),Me=s.useRef(null);s.useEffect(()=>{Me.current&&(Me.current.onscroll=ke=>{ke.preventDefault(),ke.srcElement.scrollTop=0,ke.srcElement.scrollLeft=0})},[Me.current]);const oe=Mo(t,()=>({isMovableArea:()=>!0,focusMovable:re,focus:()=>{re()}}),[r]),[ne,he]=s.useState(null),ze=s.useRef(!1),Ne=s.useRef(!1),gt=s.useRef(!1);s.useEffect(()=>{if(u||E.length===0||gt.current||ze.current)return;if(Ne.current)return void requestAnimationFrame(()=>{W.current&&L.current&&W.current.refTargets.length>0&&(gt.current=!0,V.current?.(!0)),M([...E])});ze.current=!0;const ke=s.lazy(async()=>{try{const pt=await Promise.resolve().then(()=>require("./BX8hkPMsPd9PSv0Z.cjs"));return ze.current=!1,Ne.current=!0,M([...E]),pt}catch(pt){return console.warn(pt),V.current?.(!1),null}});he(ke)},[E,u,p,m]);const bt=s.useMemo(()=>!ne||u?null:l.jsx(s.Suspense,{children:l.jsx(ne,{className:sr({dragging:T||_,resizing:T,moving:_}),container:null,ref:W,target:W.current?E:[],draggable:!u&&!p,resizable:!u&&!m,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:f,onResizeStart:ke=>{J(ke.target,"Resize")},onResize:ke=>{if(!H.current)return ke.stopDrag(),void U();F(!0);const pt=ke.direction[0]!==0&&ke.direction[1]!==0;let xt=0,Ve=0;for(let wt=0;wt<E.length;wt++){const Ye=E[wt],ae=R.current.get(Ye),Ue=D.current.get(Ye);if(!ae||!Ue){console.warn("invalid element");continue}let ye=ke.dist[0],ve=ke.dist[1],le=ke.drag.dist[0],Ie=ke.drag.dist[1],Re=ae.startBounds.width,be=ae.startBounds.height;wt===0?(xt=Re,Ve=be):(ye*=Re/xt,le*=Re/xt,ve*=be/Ve,Ie*=be/Ve);const Oe={...ae.startBounds};if(Oe.width=Math.max(0,Re+ye),Oe.height=Math.max(0,be+ve),ke.direction[0]===-1&&(Oe.width=Math.max(0,Math.min(ae.startBounds.x+Re,Re-le))),ke.direction[1]===-1&&(Oe.height=Math.max(0,Math.min(ae.startBounds.y+be,be-Ie))),pt&&(Ue.isLockAspectRatio()||ke.inputEvent?.shiftKey)){const ie=Re/be,Ee=Oe.width/Oe.height;Ee>ie?Oe.height=Oe.width/ie:Ee<ie&&(Oe.width=Oe.height*ie)}ke.direction[0]===-1&&(Oe.x=Math.max(0,Math.min(ae.startBounds.x+Re,ae.startBounds.x+Re-Oe.width))),ke.direction[1]===-1&&(Oe.y=Math.min(ae.startBounds.y+be,ae.startBounds.y+be-Oe.height)),ae.movable.setBounds(n.toAbsoluteBounds(Oe))}},onResizeEnd:ke=>{F(!1),se()},onDragStart:ke=>{J(ke.target,"Move")},onDrag:ke=>{if(!H.current)return ke.stopDrag(),void U();O(!0);for(let pt=0;pt<E.length;pt++){const xt=E[pt],Ve=R.current.get(xt);Ve?Ve.movable.setBounds(n.toAbsoluteBounds({...Ve.startBounds,x:Ve.startBounds.x+ke.translate[0],y:Ve.startBounds.y+ke.translate[1]})):console.warn("invalid element")}},onDragEnd:ke=>{},onMouseUp:ke=>{}})}),[A,ne,E,n,u,p,m,T,_]);return l.jsx("div",{className:sr(h,"movable-area","_movable-area_314c6_5"),style:{width:w.width,height:w.height,...g,position:"absolute",overflow:"hidden",willChange:"transform"},ref:va([oe,Me]),...y,children:l.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:w.width,height:w.height},...y,children:l.jsxs("div",{ref:L,style:{position:"absolute",pointerEvents:"auto"},onFocus:ke=>{k?.(),Q(!0)},onBlur:ke=>{Q(!1)},onKeyDownCapture:ke=>{if(ke.isDefaultPrevented())return;const pt=ke.nativeEvent.ctrlKey,xt=ke.nativeEvent.altKey,Ve=ke.nativeEvent.shiftKey;if(ke.which===Wt.Escape){const ye=r.getMovableSelection();let ve=[...ye];return E.forEach(le=>{if(ve.length===0)return;const Ie=D.current.get(le);let Re=ve.indexOf(Ie);ve.splice(Re,1)}),ve.length!==ye.length&&r.selectMovables(ve),ve.length===0&&C?.(),void ke.preventDefault()}const wt=.1,Ye=ye=>{o.updateSelected(ve=>{ve.setRotation(ve.getRotation()+ye)},"Rotate")},ae=(ye,ve=!0)=>{o.updateSelected(le=>{const Ie=le.getBounds();let Re=1+ye;ve||(Re=1/Re);const be=Math.sqrt(Math.pow(Ie.width,2)+Math.pow(Ie.height,2)),Oe=Math.atan2(Ie.height,Ie.width),ie=Re*be;if(ie<10)return;const Ee=ie*Math.cos(Oe),Le=ie*Math.sin(Oe),qe={x:Ie.x+(Ie.width-Ee)/2,y:Ie.y+(Ie.height-Le)/2,width:Ee,height:Le};le.setBounds(qe)},"Resize")},Ue=ye=>{o.updateSelected(ve=>{const le=ve.getBounds(),Ie={x:le.x+(ye.x??0),y:le.y+(ye.y??0),width:le.width+(ye.width??0),height:le.height+(ye.height??0)};ve.setBounds(Ie)},"Nudge")};if(ke.which===Wt.Delete)o.updateSelected(ye=>{ye.delete()},"Delete"),ke.preventDefault();else if(ke.key==="a"&&pt){const ye=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(ye,!0),ke.preventDefault()}else ke.key==="ArrowLeft"?(Ve?ae(wt,!1):xt?Ye(-10):Ue({x:pt?-10:-1}),ke.preventDefault()):ke.key==="ArrowRight"?(Ve?ae(wt,!0):xt?Ye(10):Ue({x:pt?10:1}),ke.preventDefault()):ke.key==="ArrowUp"?(Ve?ae(wt,!0):Ue({y:pt?-10:-1}),ke.preventDefault()):ke.key==="ArrowDown"&&(Ve?ae(wt,!1):Ue({y:pt?10:1}),ke.preventDefault())},children:[ge,bt]})})})})),Oi=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const a=e[i].getBounds();t=Math.min(a.x,t),n=Math.min(a.y,n),o=Math.max(a.x+a.width,o),r=Math.max(a.y+a.height,r)}return{x:t,y:n,width:o-t,height:r-n}},h8=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let a=0,d=Number.MAX_SAFE_INTEGER,c=0;for(let m=0;m<e.length;m++){const h=e[m],g=h.getBounds();a+=g[i],d=Math.min(g[o],d),c=Math.max(g[o]+g[i],c),n.push({bounds:g,movable:h})}const u=(c-d-a)/(e.length-1);n.sort((m,h)=>{const g=m.bounds[o],f=h.bounds[o];return g!==f?g-f:m.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let m=1;m<n.length-1;m++){const h=n[m-1].bounds,g={...n[m].bounds};g[o]=h[o]+h[i]+u,n[m].bounds=g,p.set(n[m].movable,g)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},b_=s.memo(s.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:a,onHide:d,onShow:c,...u}=e;s.useEffect(()=>{},[r]);const p=Mo(t,()=>({isEmptyFrame:()=>!0}),[]),[m,{height:h,width:g}]=Ci();return l.jsx("div",{...u,ref:va([p,m]),children:l.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:a?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:l.jsx("div",{style:{textAlign:"center"},children:r})})})})),w_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:a,target:d,notifier:c,onRepeatCommandChange:u}=e,p=function(h){const{movables:g,movablesView:f,transactional:x,commands:y,target:w,onRepeatCommandChange:b,notifier:C}=h,k=qr();s.useRef(k.getMode()).current=k.getMode();const E=de(async(R,P,I=null,L=!0)=>{const H=async()=>{const W=await Promise.resolve(C?.showBusy?.(R.label()));try{await P();const A=I??R?.label?.();if(b){let U=null;R&&A!==!1&&(U=new ft(R.key(),w,{label:A,description:A},H)),b(U)}W?.(),L&&k.setMode(null)}catch(A){W?.(),C?.showError?.(A)}};await H()},[b,C]),[M,T]=s.useReducer(R=>R+1,0),F=de((R,P,I)=>{if(!f)return;const L=f.getMovableSelection();if(L.length===0)return;let H="Drawings";if(L.length===1){const A=L[0];H=N.TextUtils.capitalize(A.getContent().getType())??"Drawing"}const W=`${R.label()} ${H}`;E(R,()=>{let A=null;x&&(A=x.beginCommit(W));const U=f.getMovableSelection();if(U.length===0)return;const X=I?.(U);for(let ee=0;ee<U.length;ee++){const V=U[ee];P(V,X)}A?.commit()})},[f,x]),[_,O]=s.useState(f.getMovableSelection()[0]??null),[S,v]=s.useState(!_||_?.isProtected()),D=s.useMemo(()=>[new _e("moveToFront",w,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[we.Ctrl,we.Shift]}},function(){F(this,R=>{R.moveToFront()})}),new _e("moveForward",w,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[we.Ctrl]}},function(){F(this,R=>{R.moveForward()})}),new _e("moveToBack",w,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[we.Ctrl,we.Shift]}},function(){F(this,R=>{R.moveToBack()})}),new _e("moveBackward",w,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[we.Ctrl]}},function(){F(this,R=>{R.moveBackward()})}),new _e("toggleLockAspectRatio",w,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){F(this,R=>{R.setLockAspectRatio(!R.isLockAspectRatio())})}),new _e("formatAnchorTypeTwoCell",w,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.TwoCell)})}),new _e("formatAnchorTypeOneCell",w,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.OneCell)})}),new _e("formatAnchorTypeAbsolute",w,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.Absolute)})}),new _e("formatDrawAlignLeft",w,{label:"Align Left",description:"Align the selected drawings to the left."},function(){F(this,(R,P)=>{R.setBounds({x:P.x})},Oi)}),new _e("formatDrawAlignCenter",w,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){F(this,(R,P)=>{R.setBounds({x:(P.width-R.getBounds().width)/2+P.x})},Oi)}),new _e("formatDrawAlignRight",w,{label:"Align Right",description:"Align the selected drawings to the right."},function(){F(this,(R,P)=>{R.setBounds({x:P.width-R.getBounds().width+P.x})},Oi)}),new _e("formatDrawAlignTop",w,{label:"Align Top",description:"Align the selected drawings to the top."},function(){F(this,(R,P)=>{R.setBounds({y:P.y})},Oi)}),new _e("formatDrawAlignMiddle",w,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){F(this,(R,P)=>{R.setBounds({y:(P.height-R.getBounds().height)/2+P.y})},Oi)}),new _e("formatDrawAlignBottom",w,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){F(this,(R,P)=>{R.setBounds({y:P.height-R.getBounds().height+P.y})},Oi)}),new _e("formatDrawDistributeHorz",w,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){F(this,(R,P)=>{R.setBounds(P.get(R))},R=>h8(R))}),new _e("formatDrawDistributeVert",w,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){F(this,(R,P)=>{R.setBounds(P.get(R))},R=>h8(R,!1))}),new _e("formatDrawFlipHorz",w,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new _e("formatDrawFlipVert",w,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new _e("formatDrawGroup",w,{label:"Group",description:"Group the selected drawings into a single drawing."}),new _e("formatDrawUngroup",w,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new _e("formatDrawSwapShapes",w,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new _e("formatDrawSwapShapesHorz",w,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new _e("formatDrawSwapShapesVert",w,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[f,_]);s.useEffect(()=>{},[k]);const j=s.useMemo(()=>{let R=null;return R=y?y.createChildGroup(w,"movable",!1):new Ei(w,"movable"),R.addCommands(D,!0),R},[y,D]);return Gt(_,{onAnyChange:()=>{j.getCommand("formatAnchorTypeTwoCell").update({state:_?.getAnchorType()===N.IAnchored.Type.TwoCell}),j.getCommand("formatAnchorTypeOneCell").update({state:_?.getAnchorType()===N.IAnchored.Type.OneCell}),j.getCommand("formatAnchorTypeAbsolute").update({state:_?.getAnchorType()===N.IAnchored.Type.Absolute}),j.getCommand("formatAnchorTypeAbsolute").update({state:_?.getAnchorType()===N.IAnchored.Type.Absolute}),j.getCommand("toggleLockAspectRatio").update({state:_?.isLockAspectRatio()})},onProtectedChange:R=>{v(R.isProtected())},onDelete:()=>{}}),Gt(f,{onMovableSelectionChange:()=>{const R=f.getMovableSelection()[0]??null;O(R),v(!R||R.isProtected()),T()}}),Gt(g,{onCollectionChange:()=>{T()}}),s.useEffect(()=>{const R={disabled:S};j.getCommand("formatAnchorTypeTwoCell").update(R),j.getCommand("formatAnchorTypeOneCell").update(R),j.getCommand("formatAnchorTypeAbsolute").update(R),j.getCommand("toggleLockAspectRatio").update(R);const P=g.getCount(),I=f.getMovableSelection(),L=S||P<=1||I.length===0;let H={disabled:L},W=H;if(!L&&I.length===1){const X=I[0];X.getZIndex()===0&&(H={disabled:!0}),X.getZIndex()===P-1&&(W={disabled:!0})}j.getCommand("moveToFront").update(W),j.getCommand("moveForward").update(W),j.getCommand("moveToBack").update(H),j.getCommand("moveBackward").update(H);const A={disabled:S||I.length<=1};j.getCommand("formatDrawAlignLeft").update(A),j.getCommand("formatDrawAlignCenter").update(A),j.getCommand("formatDrawAlignRight").update(A),j.getCommand("formatDrawAlignTop").update(A),j.getCommand("formatDrawAlignMiddle").update(A),j.getCommand("formatDrawAlignBottom").update(A),j.getCommand("formatDrawFlipHorz").update(A),j.getCommand("formatDrawFlipVert").update(A),j.getCommand("formatDrawGroup").update(A),j.getCommand("formatDrawUngroup").update(A),j.getCommand("formatDrawSwapShapes").update(A),j.getCommand("formatDrawSwapShapesHorz").update(A),j.getCommand("formatDrawSwapShapesVert").update(A);const U={disabled:S||I.length<=2};j.getCommand("formatDrawDistributeHorz").update(U),j.getCommand("formatDrawDistributeVert").update(U)},[M,S,M]),j}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:u,commands:a,target:d,notifier:c});s.useEffect(()=>{n?.getStage()},[n?.getStage()]);const m=s.useMemo(()=>l.jsx(y_,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,a,p]);return m&&n?m:null})),v_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:d,commands:c,notifier:u=uc}=e,p=qr(),[m,h]=s.useState(null),[g,f]=s.useState(null),[x,y]=s.useState(null),[w,b]=s.useState(null),[C,k]=s.useState(null);s.useLayoutEffect(()=>{if(x===null)return b(null),void k(null);const I=()=>{const L=o.getRange(x).getCell(),H=L.getStyle();let W,A=H.getFill()?.toCSS(r.body.darkMode);A.background!=="none"&&A.background!=="transparent"||(A=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),A.background!=="none"&&A.background!=="transparent"||(A={background:r.body.fill}),b({style:A}),L&&!L.getFormula()&&(W=L?.getRenderHorizontalAlignment()),k(W??Mx)};return I(),o.getRange(x).addListener(()=>{I()})},[o,x,r?.body]);const E=de(()=>{let I=g.editState.dirty??"";if(g.editState.dirty!==void 0){const L=N.TextUtils.clampString(I);try{const H=g.sheet.getRange(g.coords),W=`Typing '${L}' into ${H.toString()}`;return H.setValue(I,{description:W,autoFit:!0}),y(null),f(null),p.setMode(null),d(null),!0}catch(H){throw u.showError(new Error(`Unable to enter '${L}'.`,{cause:H})),H}}},[o,g,u]),M=de(I=>o.getRange(I).getCell().getExtrusions()??vo.cellToRange(I),[o]);de(I=>{let L=N.IRange.Orientation.Row,H=!1;I!==N.IRange.Direction.Up&&I!==N.IRange.Direction.Down||(L=N.IRange.Orientation.Column),I!==N.IRange.Direction.Left&&I!==N.IRange.Direction.Up||(H=!0),o.getSelection().traverse(L,H)},[o]);const T=s.useCallback((I,L)=>{if(i)return i(I,L);if(!o)return null;const{ref:H,...W}=I;return l.jsx($m,{ref:H,...W,sheet:o,bodyStyle:r?.body,activeCoords:L,commands:c,onChangeEdit:A=>{const U={sheet:o,coords:L,editState:A};p.setMode(X=>({...X,description:U.editState.editMode?"Edit":"Enter",args:{...X?.args,stateAndCoords:U}}))},editState:g.editState})},[o,w,i,g,x]),{overlay:F,startEdit:_,submitEdit:O,cancelEdit:S,onKeyboardEventNative:v,onPointerEventNative:D}=bE({view:n,activeCoords:m,getCellEditor:T,canEdit:()=>{const I=o.getProtection();if(I.isReadOnly())return!1;const L=I.isLocked();return L&&a(),!L},onBeforeStartEdit:I=>{const L=Wm(()=>o.getRange(I).getCell()),H={sheet:o,coords:I,editState:Object.freeze(L)};p.setMode({key:"edit",args:{stateAndCoords:H}}),f(H)},onStartEdit:I=>{y(I),d(I)},onSubmitEdit:E,onCancelEdit:I=>{y(null),f(null),p.setMode(null),d(null)},onDoneEdit:I=>{p.setMode(null)},containerProps:w,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:C,getRangeCoords:M});Gt(o.getSelection(),{onChange(I){h(o.getSelection().getCoords().cell)}});const j=de(I=>{D(I),x&&O()},[D,S,x]),R=s.useCallback(I=>{D(I)},[D]),P=s.useCallback(I=>{v(I)},[v]);return s.useEffect(()=>{const I=n?.getStage();if(I)return I.addEventListener("pointerdown",j),I.addEventListener("dblclick",R),I.addEventListener("keydown",P),()=>{I.removeEventListener("pointerdown",j),I.removeEventListener("dblclick",R),I.removeEventListener("keydown",P)}},[n?.getStage()]),s.useEffect(()=>{const I=p.getMode(),L=I?.key;L==="edit"||L==="enter"?g?I.args?.cancel?S():I.args?.submit?O():f(I.args?.stateAndCoords):_(I.args?.start):x&&S()},[p]),F(n,t)})),Km="white",Xm="black",S_=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Xm}' fill='${Km}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,C_=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Xm}' fill='${Km}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,k_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=s.useState(o.getTables().getCount()>0),[a,d]=s.useState(null),[c,u]=s.useState(null),[p,m]=s.useState(null),[h,g]=s.useState(null),f=de(()=>{if(o.getTables().getCount()>0){i(!0);const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)}else i(!1),d(null)},[o,n]),x=de(E=>{E.preventDefault(),E.stopPropagation();const M=n.getCellCoordsFromClient(E.clientX,E.clientY),T=o.getTables().search({address:M});T.length===1&&T[0].select()},[n,o]),y=de(E=>{E.preventDefault(),E.stopPropagation();const M=n.getCellCoordsFromClient(E.clientX,E.clientY),T=o.getTables().search({address:M});if(T.length===1){const F=T[0].getRange().getCoords(),_={colStart:F.colStart,rowStart:M.rowIndex,colEnd:F.colEnd,rowEnd:M.rowIndex};o.getRange(_).select()}},[n,o]),w=de(()=>{if(!r)return;const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)},[o,r,n]);Gt(o?.getSelection(),{onChange(E){u(o.getSelection().getCoords().cell)}}),Gt(p,{onAnyChange(E){f(),w()}}),Gt(h,{onAnyChange(E){w()}}),Gt(o,{onTablesChange(E){f(),w()},onInvalidated(E){f(),w()}});const b=s.useMemo(()=>zt.debounce(zt.throttle(w,300),300),[]);s.useEffect(()=>{b()},[n]),s.useEffect(()=>{let E=null;if(a)for(let M=0;M<a.length&&!E;M++){const T=a[M],F=T.getRange().getCoords();N.CoordUtils.isCellWithinRange(c,F)&&(E=T)}m(E)},[c,a]);const C=de(E=>{let M=null;if(a)for(let T=0;T<a.length;T++){const F=a[T],_=F.getRange().getCoords();let O=n.getRangeCoordsBounds(_);const S=n.getRelativePointFromClient(E.clientX,E.clientY),v=S.x,D=S.y;if(v>=O.x&&v<=O.x+O.width&&D>=O.y&&D<=O.y+O.height){const j=n.getViewportSize();v<=0||D<=0||v>=j.width||D>=j.height||(M=F)}}g(M)},[n,a]);if(s.useEffect(()=>{const E=n?.getStage();if(E&&a)return E.addEventListener("mousemove",C),E.addEventListener("mouseleave",C),()=>{E.removeEventListener("mousemove",C),E.removeEventListener("mouseleave",C)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const k=[];for(let E=0;E<a.length;E++){const M=a[E];if(M.isClosed())continue;const T=M===h,F=M===p,_=M.getRange().getCoords(),O=n.getRangeCoordsBounds(_);let S;if(T||F){const v=M.getStyle().getProperties(),D=v.headerRow?.fill?.background??v.wholeTable?.border?.top?.color?.toString();if(D&&o){const j=o.getStyles().parseColor(D);j&&(S=j.toCSS())}S||(S="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(l.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:O.height,pointerEvents:"all",cursor:S_},onMouseDown:y},`table-select-row-${M.getName()}`)),k.push(l.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:Math.min(16,O.height),pointerEvents:"all",cursor:C_},onMouseDown:x},`table-select-${M.getName()}`)),k.push(l.jsx(Ec,{x:O.x,y:O.y,width:O.width,height:O.height,range:_,strokeWidth:F?.5:0,stroke:S??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:T?`${S} 0px 0px 1px 1px`:void 0}},`table-outline-${M.getName()}`))}return k})),E_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,a]=s.useState(null),[d,c]=s.useState(null),u=s.useRef(null),p=de(()=>{const y=o.getSelectedCell(),w=y.getSpill()?.getCoords()??null;vo.isEqualRanges(w,i)||(c(w?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(w),coords:w}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),a(w))},[o,n,i]);s.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),d&&(u.current=setTimeout(()=>{c(null),u.current=null},r)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[d,r]);const m=s.useMemo(()=>zt.debounce(zt.throttle(p,80),80),[]);if(Gt(o?.getSelection(),{onChange(y){m()}}),Gt(o,{onSpillsChange(y){p()},onInvalidated(y){p()}}),!n||!i&&!d)return null;const h=o.getRange(i).getValue()instanceof N.FormulaError.Spill,g=[];let f=d?.bounds??n.getRangeCoordsBounds(i);if(d&&!zt.isEqualBounds(d.bounds,n.getRangeCoordsBounds(d.coords))&&c(null),f=n.toClipBounds(f,-10),!f)return;const x="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return g.push(l.jsx(Ec,{x:f.x,y:f.y,width:f.width,height:f.height,range:i,strokeWidth:1,stroke:x,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:d?.transition==="out"?0:1,transition:d?.transition?d.transition==="in"||d.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${x} 0px 0px 4px 0px`}},"spill-outline}")),g})),__={position:"absolute",top:0,left:0,bottom:0,right:0},m8=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},a=n.body=zt.mergeContentful(e.body,i);return n.body=zt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=zt.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=zt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=zt.mergeContentful(n.header,i),n.headerSelect=zt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=zt.mergeContentful(n.headerSelect,i),n.headerSelectAll=zt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=zt.mergeContentful(n.headerSelectAll,i),n},T_={fireOnModelChange:!1},f8={},Ym=s.memo(s.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=f8,headersStyle:r=f8,onSheetContextMenu:i,showColumnHeaders:a,columnHeaderProps:d,showRowHeaders:c,rowHeaderProps:u,showScrollbars:p=!0,scrollPaneProps:m,onViewportChange:h,commands:g,onRepeatCommandChange:f,onMoveCell:x,overlays:y,renderMovable:w,viewportComponent:b,onElementLoad:C,getCellEditor:k,onFocus:E,onBlur:M,style:T=hn.EmptyCssProperties,notifier:F,onShowTooltip:_,onShowColumnTooltip:O,onShowRowTooltip:S,onCloseTooltip:v,gridProps:D,cellRenderProps:j,...R}=e;if(s.useEffect(()=>{N.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[P,I]=s.useReducer(De=>De+1,0),[L,{width:H,height:W}]=Ci(),A=de(_,[_]),U=de(O,[O]),X=de(S,[S]),ee=de(v,[v]),V=s.useRef(!1);s.useLayoutEffect(()=>{V.current=!0},[n]);const $=n?.getStyles(),z=s.useMemo(()=>m8(o,$),[o,$]),q=s.useMemo(()=>m8(r,$),[r,$]),{body:G={},buttonSurface:Q={}}=z,{header:Y={},headerSelect:te={},headerSelectAll:re={}}=q,ge=s.useRef(null),[J,se]=s.useState(()=>n?.getView()),Se=(J?.getZoomScale()??100)/100,Me=s.useMemo(()=>({vertical:J.isShowColumnGridlines()&&Se>=.4,horizontal:J.isShowRowGridlines()&&Se>=.4}),[J?.isShowColumnGridlines(),J?.isShowRowGridlines(),Se]),oe=s.useMemo(()=>{if(J?.getGridLineColor())return{strokeDasharray:"1,1"}},[J?.getGridLineColor(),z]),ne=a??J?.isShowColumnHeaders(),he=c??J?.isShowRowHeaders(),[ze,Ne]=s.useState({width:0,height:0}),gt=s.useMemo(()=>{let De=40,ce=20;const at=n?.getStyles().getNormal().getFont();if(ze.width>0&&ze.height>0){const mt=at?.toCSS()?.fontFamily??z.header.text.fontFamily,Z=at?.getSize()??z.header.text.fontSize,K=N.IFont.getSharedMeasurer()(""+ze.height,Math.ceil(Z*N.IFont.getDeviceScale()),mt);De=K.width,ce=K.lineHeight}return{width:Math.round(De+5),height:Math.round(ce+3)}},[ze,z?.header.text,n]),bt=he?Se*gt.width:Y.edgeStrokeWidth,ke=ne?Se*gt.height:Y.edgeStrokeWidth,pt=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??gt.width)+bt+1),xt=Math.max(W,(n?.getRowHeaders().getDefaultSize()??gt.height)+ke+1),Ve=s.useRef(new Map),wt=s.useRef(null),Ye=()=>({getColOffset:De=>n.getColumnHeaders().findOffset(De),getColIndex:De=>n.getColumnHeaders().findIndex(De),getRowOffset:De=>n.getRowHeaders().findOffset(De),getRowIndex:De=>n.getRowHeaders().findIndex(De)}),[ae,Ue]=s.useState(()=>Ye()),[ye,ve]=s.useState(!1),[le,Ie]=s.useState(null),Re=!0,be=z.selection?.strokeFill,Oe=s.useCallback(()=>Lo.current,[]),[ie,Ee]=s.useState(),Le=de(De=>{Ee(De),n&&n.getView()&&n.getView().setTopLeft(De?{left:De.left,top:De.top}:null),h?.(De)},[n,h]),qe=s.useRef(null);s.useEffect(()=>{if(!ie||!n)return;const De=n.getRangeAtBounds({x:ie.left,y:ie.top,width:ie.width,height:ie.height});qe.current?.(),qe.current=De.addListener(()=>{const ce=De.getCoords();ge?.current?.invalidate(ce)})},[ie,n]);const[ht,ot]=s.useState(()=>n?.getView().getTopLeft()),We=de(De=>{const ce=vo.cellToRange(De);if(n.isClosed())return ce;const at=n.getRange(ce,{excludeHidden:!0}).getMerges();return at.length===0?ce:at[0]},[n]),st=De=>{if(!De||De.coords.colIndex===0&&De.coords.rowIndex===0)return null;const ce={};return De.coords.colIndex>0&&(ce[co.Left]={index:De.coords.colIndex,scrollOffset:De.topLeft.left}),De.coords.rowIndex>0&&(ce[co.Top]={index:De.coords.rowIndex,scrollOffset:De.topLeft.top}),ce},[Xe,Qe]=s.useState(()=>st(n.getView().getFreezePanes())),kt=qr(),Vt=s.useCallback(()=>ge.current,[]),ct=de(De=>{kt.setMode(ce=>ce?.key==="edit"?{...ce,args:{...ce.args}}:{key:"edit",args:{stateAndCoords:null,start:De}})},[]),Ut=de(()=>ie,[ie]),Qt=function(De){const{sheet:ce,onRepeatCommandChange:at,bodyStyle:mt,commands:Z,target:K,notifier:ue,onStartEdit:fe,getViewport:Ae}=De,[Ke,Be]=s.useState(null),[Ct,It]=s.useState(null),jt=s.useRef(null),At=de(fe,[fe]),cn=de(Ae,[Ae]),[Dt,Ot]=s.useState(),[Ln,lt]=s.useState(()=>ce?.getStyles().parseColor(N.IColor.Scheme.Bg2)),[Kt,Yn]=s.useState(()=>ce?.getStyles().getNormal().getFont().getFill()),Nt=qr();s.useRef(Nt.getMode()).current=Nt.getMode();const tn=ah(),[Dn,nr]=s.useState(zt.EmptyArray),S0=s.useCallback(()=>{if(jt.current!==ce)return;const pe=ce.getSelectedRanges();let Pe=null;Dn.length>0&&vo.isCellWithinRange(Ke,Dn[0].getRange().getCoords())&&(Pe=Dn[0]);const Ge=ce?.getSelectedCell(),Te=Ge?.getCoords()??null;uo.unstable_batchedUpdates(()=>{Pc(Pe),Be(Te),It(pe)})},[ce,Dn,Ct,Ke]),ss=s.useCallback(zt.debounce(S0,210),[S0]);s.useEffect(()=>{jt.current=ce,S0()},[ce]);const Ro=de(()=>ce.getRange(Ke).getCell(),[ce,Ke]),ho=de(async(pe,Pe,Ge=null,Te=!1,Je=!0)=>{const nt=pe?.label?.(),nn=async()=>{const Yt=await Promise.resolve(Je&&ue?.showBusy?.(nt??"Busy..."));try{await ce.doBatch(async()=>Pe(ce),nt),Te&&Nt.setMode(null),Yt&&Yt()}catch(Hn){if(Yt&&Yt(),!Hn)return;ue?.showError?.(Hn)}},on=[];let Zt=!1;const dn=async()=>(on.push(nn),(async()=>{if(!Zt){for(Zt=!0;on.length>0;){const Yt=on.shift();Yt&&await Yt()}Zt=!1}})());if(at){let Yt=null;if(Ge!==!1&&pe){const Hn=Ge??nt;Yt=new ft(pe.key(),K,{label:Hn,description:Hn},dn)}at(Yt)}return dn()},[ce,at,ue]),Pt=de((pe,Pe,Ge=!1,Te)=>ho(pe,Je=>{const nt=Je.getSelectedRanges();Ge&&nt.updateStyle(null,Te),nt.updateStyle(Pe,Te),nt.autoFit({expandOnly:N.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[ce]),F5=de((pe,Pe,Ge)=>{ho(pe,Te=>{let Je=Pe;(Ge||Pe?.address)&&(Je=Je??{},!Ge&&Pe?.address?.startsWith("#")?Ge=Pe?.address.substring(1):Ge&&(Je.displayText=Ge)),Te.getSelectedRange().setHyperlink(Je)})},[ce]),z5=de((pe,Pe)=>{ho(pe,Ge=>{Ge.getSelectedRange().setComments(Pe)})},[ce]),ka=de((pe,Pe)=>{ho(pe,Ge=>{Ge.getSelectedRanges().clear(Pe)})},[ce]),K0=de(async(pe,Pe,Ge=!1,Te=!1)=>ho(pe,async Je=>{let nt=Je.getSelectedRanges();Ge&&(Pe===N.IRange.Orientation.Row?nt=nt.getEntireRows(Te):Pe===N.IRange.Orientation.Column&&(nt=nt.getEntireColumns(Te)));let nn=null;const on=Nt.getMode()?.key;if(on==="copy"||on==="cut"){const Zt=await tn.getClipboard().readReference();Zt&&Zt.getItemType()==="range"&&(nn=Zt.getItem(),nn.getCoords()||(nn=null))}if(nn){const Zt=await nt.insertFrom(nn,{...nn.getMarkOptions(),orientation:Pe,autoSelect:!0});!Zt||Zt.isEntireRows()||Zt.isEntireColumns()||Zt.autoFit({orientations:N.IRange.Orientations.Row,minContent:!0}),Nt.setMode(null)}else nt.insert(Pe,{autoSelect:!0})},"Insert Cells",!1),[Nt]),[s0,Pc]=s.useState(null),Xg=de(pe=>ce.getStyles().setDefaultTableStyle(pe),[ce]),Yg=de(pe=>{ce.getStyles().getTableStyle(pe)?.delete()},[ce]),Ea=de((pe,Pe)=>{ho(pe,async Ge=>{const Te=Ge.getSelectedRange(),Je=Ge.getSelectedCell().getCoords();let nt=null,nn=0;const on=Je.rowIndex>0?Ge.getRange({rowIndex:Je.rowIndex,colIndex:Je.colIndex}).getExtended(N.IRange.Direction.Up):null;on&&Ge.getRange({colStart:Je.colIndex,rowStart:on.getCoords().rowStart,colEnd:Je.colIndex,rowEnd:on.getCoords().rowStart}).isContentful()&&(nt=N.IRange.Direction.Up,nn=Je.rowIndex-on.getCoords().rowEnd);const Zt=Je.colIndex>0?Ge.getRange({rowIndex:Je.rowIndex,colIndex:Je.colIndex-1}).getExtended(N.IRange.Direction.Left):null;if(Zt&&Ge.getRange({colStart:Zt.getCoords().colStart,rowStart:Je.rowIndex,colEnd:Zt.getCoords().colStart,rowEnd:Je.rowIndex}).isContentful()){const Yt=Je.colIndex-Zt.getCoords().colEnd;(Yt<nn||!nt)&&(nt=N.IRange.Direction.Left,nn=Yt)}let dn=null;if(nt===N.IRange.Direction.Up){if(dn={...on.getCoords()},(dn.rowEnd===Je.rowIndex||!Ge.getRange({colIndex:Je.colIndex,rowIndex:Je.rowIndex-1}).isContentful())&&dn.rowStart>0&&Ge.getRange({colIndex:Je.colIndex,rowIndex:dn.rowStart-1}).isContentful()){const Yt=on.getExtended(N.IRange.Direction.Up);dn={colStart:Je.colIndex,rowStart:Yt.getCoords().rowStart,colEnd:Je.colIndex,rowEnd:on.getCoords().rowEnd}}dn.rowEnd=Je.rowIndex-1}else if(nt===N.IRange.Direction.Left){if(dn={...Zt.getCoords()},(dn.colEnd===Je.colIndex||!Ge.getRange({colIndex:Je.colIndex-1,rowIndex:Je.rowIndex}).isContentful())&&dn.colStart>0&&Ge.getRange({colIndex:dn.colStart-1,rowIndex:Je.rowIndex}).isContentful()){const Yt=Zt.getExtended(N.IRange.Direction.Left);dn={colStart:Yt.getCoords().colStart,rowStart:Je.rowIndex,colEnd:Yt.getCoords().colEnd,rowEnd:Je.rowIndex}}dn.colEnd=Je.colIndex-1}if(Te.size!==1&&nt){const Yt=Te.getCoords(),Hn=Te.startIncrementalUpdates({orientation:N.IRange.Orientation.Column}),ro={...dn},Vo=Yt.rowStart,Br=Yt.rowEnd,Nr=Yt.colStart,Vr=Yt.colEnd,or=nt===N.IRange.Direction.Up;for(let Ao=Nr;Ao<=Vr;Ao++){ro.colStart=or?Ao:dn.colStart+(Ao-Nr),ro.colEnd=or?Ao:dn.colEnd+(Ao-Nr);for(let mo=Vo;mo<=Br;mo++){ro.rowStart=or?dn.rowStart+(mo-Vo):mo,ro.rowEnd=or?dn.rowEnd+(mo-Vo):mo;const kr=Ge.getRange(ro).toString();Hn.pushAt(mo,Ao,`=${Pe}(${kr})`)}}Hn.apply()}else{const Yt=dn?Ge.getRange(dn).toString():"",Hn=`=${Pe}(`;At?.({text:`${Hn}${Yt})`,editMode:!0,initialSelection:{start:Hn.length,end:Hn.length+Yt.length}})}},!1)},[ce]),cs=de((pe,Pe,Ge=!1,Te=!0)=>{ho(pe,async Je=>{let nt=null;if(s0)return void s0.updateStyleOptions(Pe);{const Zt=Je.getSelectedRanges().getFixed(!0),dn=Je.getSelectedRange().getDefaultSortCriteria();let Yt={ranges:Zt,hasHeader:dn?.options?.hasHeader??!1};nt=Te?new Promise((Hn,ro)=>{const Vo={tableOptions:Yt,onCancel:()=>{ro()},onDone:Br=>{Hn(Br)},context:{getNames:()=>Je.getNames()}};ue.showWindow?.("tableNew",Vo)}):{option:"Ok",tableOptions:Yt}}const nn=await Promise.resolve(nt);if(nn?.option!=="Ok")throw null;const on=await Promise.resolve(ue?.showBusy?.(pe.label()));try{await Je.getTables().add(nn.tableOptions.ranges.at(0),{styleName:Pe?.name,clearFormatting:Ge,hasHeader:nn.tableOptions.hasHeader}).getRange().select()}catch(Zt){on(),ue?.showError?.(Zt)}on()},!1,!0,!1)},[s0]),B5=de(()=>mt,[mt]),N5=de(pe=>({styles:()=>ce.getStyles(),table:()=>pe,bodyStyle:B5,getNames:()=>ce.getNames()}),[ce]),Jg=de(async(pe,Pe,Ge,Te=!0)=>{let Je=null;if(!Pe){let nt=ce.getSelectedRange();nt.size===1&&(nt=nt.getSurrounding());let nn=ce.getTables().search({address:ce.getSelectedRange()});nn.length>0&&(Pe=nn[0]),await nt.select()}if(Pe){if(Te){try{Ge&&await Pe.select()}catch{}Je=new Promise(async(nt,nn)=>{pe.update({context:N5(Pe)});const on={command:pe,commands:me,notifier:ue,onDone:dn=>{nt(dn)}},Zt=await ue.showWindow?.("tableDetails",on,{disableAutoDestroy:!0});setTimeout(()=>{Zt.focus()},180)})}Promise.resolve(Je).then(nt=>{},nt=>{ue?.showError?.(nt)})}},[ue]),V5=de(async(pe,Pe,Ge=!1)=>{let Te=null;if(Pe)Pe.isITable?Te=Pe:Pe.getValue()&&(Te=Pe.getValue());else{const Je=ce.getTables().search({address:ce.getSelectedRange()});Je.length>0&&(Te=Je[0])}if(Te){if(!Ge){const Je=Te.getRange().getCoords(),nt=(Je.colEnd-Je.colStart+1)*(Je.rowEnd-Je.rowStart+1);if(nt>1e4&&await ue?.showOptions({title:"Confirm",description:`Converting a table to range with '${nt}' cells will set a large number of cell styles and may affect performance.
|
|
62
|
+
The content is not applied.`}),new _e("pasteFormulas",I,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new _e("pasteTranspose",I,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new _e("pasteLinks",I,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];f.addCommands(L,!0)},[f,m]),s.useEffect(()=>{if(!f)return;const I={disabled:!h.getProtection().isFormatCellsAllowed()};f.getCommand("pasteValues").updateCallback(L=>R.paste({...r_,...L})).update(I),f.getCommand("pasteFormats").updateCallback((L,H)=>R.paste({...i_,description:H.label(),...L})).update(I),f.getCommand("pasteFormulas").updateCallback((L,H)=>R.paste({...a_,description:H.label(),...L})).update(I),f.getCommand("pasteTranspose").updateCallback((L,H)=>R.paste({...l_,description:H.label(),...L})).update(I),f.getCommand("pasteLinks").updateCallback((L,H)=>R.paste({...s_,description:H.label(),...L})).update(I),f.getCommand("cut").update(I),f.getCommand("paste").update(I)},[h,f]);const P=s.useMemo(()=>{if(!S||!_.current)return;const I=S.key;if(I!=="copy"&&I!=="cut"&&I!=="formatPainter")return;const L=_.current.getItem();if(L.getSource()!==h)return;const H=_.current.isCut?.(),W=H?E:k,A=H?C:b,U=L.getCoords(),X=U?[U]:null;return X&&X.length!==0?ee=>{const V=[];for(let $=0;$<X.length;$++){const z=X[$],q=ee.toClipBounds(ee.getRangeCoordsBounds(z,{top:0,left:0,right:1,bottom:1}),Zo);q&&(V.push(F({range:z,key:`copy-selection-background-${$}`,x:q.x,y:q.y,width:Math.max(q.width,0),height:Math.max(q.height,0),stroke:W,strokeWidth:2})),V.push(F({range:z,key:`copy-selection-foreground-${$}`,x:q.x+(q.width<=2?-1:0),y:q.y,width:Math.max(q.width,3),height:Math.max(q.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[S,h,g,b,k,C,E]);return{...R,clipboard:j,overlays:P}})({element:o,sheet:r,sheetView:u,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:d});return Gt(r?.getSelection(),{onChange(m){}}),s.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),d_={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},u_={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},p_={key:"dragCopy",description:"Drag selection to copy cell contents."},h_={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},p8=(e,t)=>t.ctrlKey&&t.shiftKey?h_:t.ctrlKey?p_:t.shiftKey?u_:d_,m_={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},f_=s.memo(s.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:a,onShowTooltip:d,onCloseTooltip:c,sheet:u,gridRef:p,gridStyle:m,isActive:h,editingCoords:g,...f}=e,x=n?.getBounds(),y=de(d,[d]),w=de(c,[c]),[b,C]=s.useState(()=>u?.getSelection().getCoords()),k=de(Y=>{vo.isEqualSelectionCoords(Y,b)||u&&u.getSelection().updateCoords(Y)},[u,b]),E=qr(),M=s.useRef(null),[T,F]=s.useState(u?.getProtection().isLocked()),[_,O]=s.useState(u?.getView().getMovableSelection().length>0),S=hn.detectIt().primaryInput==="touch",v=!S&&h,D=g!==null||_,j=de(Y=>{const te=vo.cellToRange(Y);if(u.isClosed())return te;const re=u.getRange(te,{excludeHidden:!0}).getMerges();return re.length===0?te:re[0]},[u]),R=de((Y,te,re,ge,J,se)=>{const Se=u.getSelectedRange().getExtended(ge,Y).getCoords();switch(ge){case N.IRange.Direction.Up:return Se.rowStart;case N.IRange.Direction.Down:return Se.rowEnd;case N.IRange.Direction.Left:return Se.colStart;case N.IRange.Direction.Right:return Se.colEnd}},[u]),P=de(()=>{const Y=u.getUsedRange()?.getCoords(),te=u.getRowHeaders().getUsedRange()?.getCoords(),re=u.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,re?.max??0),rowEnd:Math.max(Y?.rowEnd??0,te?.max??0)}},[u]),I=de((Y,te)=>u.getRowHeaders().hiddenHeadersAt(Y,te),[u]),L=de((Y,te)=>u.getColumnHeaders().hiddenHeadersAt(Y,te),[u]),H=de(Y=>u.getRange(Y,{excludeHidden:!0}).getMerges(),[u]),W=de(Y=>{u?.getSelection().setAdjusting(Y)},[u]),A=de(async()=>{u?.getSelection().setAdjusting(null),E.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),E.setMode(null))},[E,b,u,o]),U=s.useMemo(()=>{const Y=E.getMode();return Y?.key==="cut"||Y?.key==="copy"},[E]);Gt(u?.getView(),{onMovableSelectionChange:()=>{O(u.getView().getMovableSelection().length>0)}}),Gt(u?.getSelection(),{onChange(Y){const te=u.getSelection().getCoords();C(te)}}),Gt(u,{onProtectionChange:()=>{F(u.getProtection().isLocked())}});const{body:X={}}=m||{},ee=n.getLayout(),V=!(v&&b.ranges.length<=1&&g===null&&!T&&(!E.getMode()||U)),{overlay:$,onPointerDown:z}=Fm({gridRef:p,commands:o,layout:ee,getCellCoordsAsRangeCoords:j,selection:b,fillHandleBorderColor:X.fill,selectionBackgroundColor:h?m.selection.fill:m.selectionInactive.fill,selectionBorderColor:h?m.selection.strokeFill:m.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?m.selectionRemove.fill:m.selectionInactive.fill,selectionRemoveBorderColor:h?m.selectionRemove.strokeFill:m.selectionInactive.strokeFill,disableFillDrag:V,disableMoveDrag:S||!(h&&b.ranges.length<=1&&g===null&&!T),disableTouchSelection:D,onSelectionChange:k,onSelectionDragStart:W,onSelectionDragEnd:A,onMoveDragStart:(Y,te,re)=>{E.setMode(p8(0,re))},onMoveDragUpdate:(Y,te,re)=>{E.setMode(p8(0,re))},onMoveDragEnd:(Y,te)=>{E.setMode(null)},onMoveDragDone:async(Y,te,re)=>{if(vo.isEqualRanges(Y,te))return;const ge=u.getRange(te);if(a?.showOptions){const oe=ge.getDifferences(Y);let ne=!1;for(let he=0;!ne&&he<oe.getCount();he++)ne=oe.at(he).isContentful();if(ne&&await a?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const J=!re.ctrlKey,se=re.shiftKey,Se=se?J?"Insert Moved Cells":"Insert Copied Cells":J?"Move Cells":"Copy Cells",Me=await a?.showBusy?.(Se);try{const oe=u.getRange(Y);await ge.doBatch(async()=>{se?await ge.insertFrom(Y,{isCut:J,undoRange:oe}):await ge.copyFrom(Y,{isCut:J,undoRange:oe}),oe.autoFit({skipCustomSize:!0,orientations:N.IRange.Orientations.Row,minContent:!0}),ge.autoFit({skipCustomSize:!0,orientations:N.IRange.Orientations.Row,minContent:!0})},{description:Se,autoSelect:!0})}catch(oe){a?.showError?.(oe)}finally{Me?.()}},contentfulCellFinder:R,hiddenRowsAt:I,hiddenColumnsAt:L,mergedRanges:H,getDataCoords:P,canSelectionSpanMergedCells:Y=>{const te=u.getRange(Y);return te.isEntireColumns()||te.isEntireRows()},onFill:async(Y,te)=>{const re="Auto Fill",ge=await a?.showBusy?.(re);try{await u.doBatch(()=>{u.getRange(Y).autoFill(te),u.getRange(te).autoFit({orientations:N.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:re,autoSelect:!0})}catch(J){a?.showError?.(J)}finally{M.current=null,ge?.()}},onFillPreview:(Y,te,re)=>{if(p.current&&y){E.setMode(m_);try{M.current?.direction!==re&&(M.current=null,u.getRange(Y).autoFill(te,{previewOnly:he=>{M.current={callback:he,direction:re}}}));const ge=M.current?.callback?.(te);if(!ge||ge.isEmpty())return;const J=ge.toText();if(!J)return;const se=vo.cellToRange(ge.getCoords()),Se=n.getRelativePointFromClient(0,0);let Me=0,oe=0,ne=qc;if(re===N.IRange.Direction.Down){Me=ee.getColOffset(se.colEnd+1)-Se.x;const he=ee.getRowOffset(se.rowEnd),ze=ee.getRowOffset(se.rowEnd+1);oe=ze-(ze-he)/2-Se.y,ne=lu}else if(re===N.IRange.Direction.Right){oe=ee.getRowOffset(se.rowEnd+1)-Se.y;const he=ee.getColOffset(se.colEnd),ze=ee.getColOffset(se.colEnd+1);Me=ze-(ze-he)/2-Se.x,ne=qc}else if(re===N.IRange.Direction.Up){Me=ee.getColOffset(se.colEnd+1)-Se.x;const he=ee.getRowOffset(se.rowStart),ze=ee.getRowOffset(se.rowStart+1);oe=ze-(ze-he)/2-Se.y,ne=lu}else if(re===N.IRange.Direction.Left){oe=ee.getRowOffset(se.rowEnd+1)-Se.y;const he=ee.getColOffset(se.colStart),ze=ee.getColOffset(se.colStart+1);Me=ze-(ze-he)/2-Se.x,ne=qc}y({anchor:{x:Me,y:oe},display:J,placement:ne})}catch(ge){a?.showError?.(ge)}}},onFillDone:()=>{M.current=null,E.setMode(null),w?.()}}),q=de(Y=>{z(hn.createSyntheticEvent(Y))},[z,g]);s.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",q),()=>{Y.removeEventListener("pointerdown",q)}},[n?.getStage()]);const G=Mo(t,()=>({}),[]),Q=s.useRef(null);return l.jsx("div",{className:sr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:x?.width,height:x?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:va([G,Q]),...f,children:$(n)})})),Vs=Object.freeze({x:0,y:0,width:0,height:0}),g_={fireOnModelChange:!1},x_=s.memo(s.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:a,onHide:d,onShow:c,onUnFocus:u,isDragging:p,updateFrameBounds:m,dragStart:h,style:g,disabled:f,renderMovable:x,...y}=e,[w,b]=s.useState(Vs),[C,k]=s.useState(null),[E,M]=s.useState(!1),T=s.useRef(null);s.useLayoutEffect(()=>{if(r.isClosed())return;const _=r.getBounds();if(!_)return;const O=o.toViewBounds(_);b(O??Vs),m(O??Vs)},[o?.getBounds()]),Gt(r,{onBoundsChange:_=>{const O=_.getBounds();if(!O)return;const S=o.toViewBounds(O);b(S??Vs),m(S)},onSelectionChange:()=>{const _=zt.hasFocus(T.current,!0);!E&&!_||r.isSelected()||u()}}),Gt(r,{onRequestFocus:()=>zt.whenFocus(T.current,!0)},g_),s.useEffect(()=>{const _=T.current;return i(_),()=>{a(_)}},[]);const F=s.useMemo(()=>{if(!w)return null;let{width:_,height:O}=w;return x({view:o,movable:r,disabled:f,isDragging:p,style:{position:"relative",left:0,top:0,width:_,height:O},onHide:d,onShow:c})},[o,r,w.width,w.height,f,p]);return l.jsx("div",{className:"movable",tabIndex:0,ref:va([T,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:w.x,top:w.y,width:w.width,height:w.height,...g},onMouseDown:async _=>{const O=_.shiftKey||_.ctrlKey,S=r.isSelected(),v=_.currentTarget;O&&S?r.unselect():(S&&!O||await r.select({addToSelection:O}),h(_.nativeEvent,v),v.focus())},onFocus:_=>{_.relatedTarget&&!C&&k(_.relatedTarget),M(!0)},onBlur:_=>{C&&!T?.current?.contains(_.relatedTarget)&&k(null),_.relatedTarget&&M(!1)},...y,children:F})})),y_=s.memo(s.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:a,onUnFocus:d,onFocus:c,disabled:u=!1,disableDrag:p=!1,disableResize:m=!1,className:h,style:g,renderDirections:f=["nw","n","ne","w","e","sw","s","se"],onFirstRender:x,...y}=e,w=n.getBounds(),b=de(x,[x]),C=de(d,[d]),k=de(c,[c]),[E,M]=s.useState([]),[T,F]=s.useState(!1),[_,O]=s.useState(!1),S=s.useRef(!0),v=s.useRef(new Map),D=s.useRef(new Map),j=s.useRef(new Map),R=s.useRef(new Map),P=s.useRef(new Map),I=s.useRef({onRequestFocus:ke=>(re(ke),null)}),L=s.useRef(null),H=s.useRef(null),W=s.useRef(null),[A,U]=s.useReducer(ke=>ke+1,0);s.useLayoutEffect(()=>{U()},[n,o]),Gt(o,{onCollectionChange:()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),pt=P.current;pt.forEach(Ve=>{Ve()}),pt.clear();const xt=I.current;for(let Ve=0;Ve<ke.length;Ve++){const wt=ke[Ve];if(wt.isClosed())continue;const Ye=wt.addListeners(xt);pt.set(wt,Ye)}U()},onInvalidated:()=>{U()}}),Gt(r,{onMovableSelectionChange(ke){ee(),U()}});const X=s.useCallback((ke,pt)=>{const xt=j.current.get(ke);W.current&&(W.current.getTargets().forEach(Ve=>{if(Ve===xt)return Ve.style.left=pt.x+"px",Ve.style.top=pt.y+"px",Ve.style.width=pt.width+"px",void(Ve.style.height=pt.height+"px")}),W.current.updateRect())},[]),ee=()=>{const ke=[],pt=r.getMovableSelection();pt.forEach(xt=>{const Ve=j.current.get(xt);Ve&&pt.indexOf(xt)!==-1&&ke.push(Ve)}),M(xt=>zt.isEqualArrays(xt,ke)?xt:ke)},V=s.useRef(null),$=s.useMemo(()=>new Promise(ke=>{V.current=ke}),[]),z=s.useRef(null),q=de(async(ke,pt)=>{z.current=pt,await(async()=>!(!await $.then()||!W.current))()&&z.current===pt&&W.current.dragStart(ke,pt)},[E]),[G,Q]=s.useState(!1),Y=s.useRef(null),te=s.useRef(null),re=de(async(ke=null)=>{if(ke||(ke=r.getMovableSelection()[0]),!ke)return C?.(),!1;const pt=j.current.get(ke);pt?(await zt.whenFocus(pt),pt.focus(),te.current=pt,Y.current=null):Y.current=ke},[r]);s.useEffect(()=>{G&&E.length>0&&te.current!==E[0]&&re(),S.current&&(b?.(),S.current=!1)},[E]);const ge=s.useMemo(()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ke.length===0&&v.current.size===0)return null;const pt=(ae,Ue,ye,ve=!0)=>{const le=ae.isSelected(),Ie={tabIndex:ye,view:n,movable:ae,onRefLoad:Re=>{Y.current===ae&&(Re.focus(),te.current=Re,Y.current=null),j.current.set(ae,Re),D.current.set(Re,ae),Ue.rendered=!0,ee()},onRefUnload:Re=>{j.current.delete(ae),D.current.delete(Re),Ue.rendered=!1,ee()},onUnFocus:C,onHide:Re=>{Ue.onHide=Re},onShow:Re=>{Ue.onShow=Re},isDragging:le&&(_||T),disabled:u,renderMovable:i,updateFrameBounds:Re=>{X(ae,Re)},dragStart:q,onMouseUp:()=>{if(z.current=null,H.current){F(!1),O(!1);let Re=!1;R.current?.forEach(be=>{zt.isEqualBounds(be.movable.getBounds(),be.startBounds)||(Re=!0)}),Re?se():Se()}},style:{opacity:ve?T&&le?.7:void 0:0,zIndex:T&&le?ae.getZIndex()+ke.length:void 0,pointerEvents:ve?void 0:"none",cursor:_&&le?"grabbing":u||p?"initial":"move",boxShadow:!le||_&&!T?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return l.jsx(x_,{...Ie},`movable-${ae.getUUID()}`)},xt=v.current,Ve=new Map,wt=[];for(let ae=0;ae<ke.length;ae++){const Ue=ke[ae];if(Ue.isClosed())continue;let ye=xt.get(Ue);ye||(ye={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(ve,le)=>{if(!le||le.shown===!0)return;le.shown=!0;const Ie=++le.visibilityRequestId;requestAnimationFrame(()=>{const Re=v.current.get(ve);Re&&Ie===le.visibilityRequestId&&(le.onShow?.(ve),Re.shown=!0)})},doHide:async(ve,le)=>{if(!le||le?.shown===!1)return;le.shown=!1;const Ie=++le.visibilityRequestId,Re=await Promise.resolve(le.onHide?.(ve));Ie===le.visibilityRequestId&&Re!==!1&&(le.shown=!1,v.current.delete(ve),U())},visibilityRequestId:0}),ye.frame=pt(Ue,ye,ae,!0),wt.push(ye.frame),ye.doShow(Ue,ye),xt.delete(Ue),Ve.set(Ue,ye)}const Ye=[];return r.getMovableSelection().forEach(ae=>{const Ue=xt.get(ae);Ue&&(Ue.frame=pt(ae,Ue,-1,!1),Ye.push(Ue.frame),xt.delete(ae),Ve.set(ae,Ue))}),xt.forEach((ae,Ue)=>{ae.frame=pt(Ue,ae,-1,!1),Ye.push(ae.frame),ae.doHide(Ue,ae),xt.delete(Ue),Ve.set(Ue,ae)}),v.current=Ve,ee(),[...Ye,...wt]},[A,n,i,u,p,m,T,_]),J=de((ke,pt)=>{const xt=`${pt} ${E.length===1?N.TextUtils.capitalize(D.current?.get(E[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${xt}`),H.current.rollback(),H.current=null),H.current=a.beginCommit({description:xt}),R.current.clear();for(let Ve=0;Ve<E.length;Ve++){const wt=E[Ve],Ye=D.current?.get(wt);Ye?R.current.set(wt,{movable:Ye,startBounds:n.toViewBounds(Ye.getBounds())}):console.warn("invalid element",Ye)}},[a,n,E]),se=s.useCallback(()=>{if(!H.current)return;const ke=[];R.current?.forEach(pt=>{ke.push(pt.movable)}),H.current.commit({viewAfter:{view:r,movableSelection:ke}}),R.current.clear(),H.current=null},[]),Se=s.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),Me=s.useRef(null);s.useEffect(()=>{Me.current&&(Me.current.onscroll=ke=>{ke.preventDefault(),ke.srcElement.scrollTop=0,ke.srcElement.scrollLeft=0})},[Me.current]);const oe=Mo(t,()=>({isMovableArea:()=>!0,focusMovable:re,focus:()=>{re()}}),[r]),[ne,he]=s.useState(null),ze=s.useRef(!1),Ne=s.useRef(!1),gt=s.useRef(!1);s.useEffect(()=>{if(u||E.length===0||gt.current||ze.current)return;if(Ne.current)return void requestAnimationFrame(()=>{W.current&&L.current&&W.current.refTargets.length>0&&(gt.current=!0,V.current?.(!0)),M([...E])});ze.current=!0;const ke=s.lazy(async()=>{try{const pt=await Promise.resolve().then(()=>require("./DoxscTb4o7M2CzO-.cjs"));return ze.current=!1,Ne.current=!0,M([...E]),pt}catch(pt){return console.warn(pt),V.current?.(!1),null}});he(ke)},[E,u,p,m]);const bt=s.useMemo(()=>!ne||u?null:l.jsx(s.Suspense,{children:l.jsx(ne,{className:sr({dragging:T||_,resizing:T,moving:_}),container:null,ref:W,target:W.current?E:[],draggable:!u&&!p,resizable:!u&&!m,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:f,onResizeStart:ke=>{J(ke.target,"Resize")},onResize:ke=>{if(!H.current)return ke.stopDrag(),void U();F(!0);const pt=ke.direction[0]!==0&&ke.direction[1]!==0;let xt=0,Ve=0;for(let wt=0;wt<E.length;wt++){const Ye=E[wt],ae=R.current.get(Ye),Ue=D.current.get(Ye);if(!ae||!Ue){console.warn("invalid element");continue}let ye=ke.dist[0],ve=ke.dist[1],le=ke.drag.dist[0],Ie=ke.drag.dist[1],Re=ae.startBounds.width,be=ae.startBounds.height;wt===0?(xt=Re,Ve=be):(ye*=Re/xt,le*=Re/xt,ve*=be/Ve,Ie*=be/Ve);const Oe={...ae.startBounds};if(Oe.width=Math.max(0,Re+ye),Oe.height=Math.max(0,be+ve),ke.direction[0]===-1&&(Oe.width=Math.max(0,Math.min(ae.startBounds.x+Re,Re-le))),ke.direction[1]===-1&&(Oe.height=Math.max(0,Math.min(ae.startBounds.y+be,be-Ie))),pt&&(Ue.isLockAspectRatio()||ke.inputEvent?.shiftKey)){const ie=Re/be,Ee=Oe.width/Oe.height;Ee>ie?Oe.height=Oe.width/ie:Ee<ie&&(Oe.width=Oe.height*ie)}ke.direction[0]===-1&&(Oe.x=Math.max(0,Math.min(ae.startBounds.x+Re,ae.startBounds.x+Re-Oe.width))),ke.direction[1]===-1&&(Oe.y=Math.min(ae.startBounds.y+be,ae.startBounds.y+be-Oe.height)),ae.movable.setBounds(n.toAbsoluteBounds(Oe))}},onResizeEnd:ke=>{F(!1),se()},onDragStart:ke=>{J(ke.target,"Move")},onDrag:ke=>{if(!H.current)return ke.stopDrag(),void U();O(!0);for(let pt=0;pt<E.length;pt++){const xt=E[pt],Ve=R.current.get(xt);Ve?Ve.movable.setBounds(n.toAbsoluteBounds({...Ve.startBounds,x:Ve.startBounds.x+ke.translate[0],y:Ve.startBounds.y+ke.translate[1]})):console.warn("invalid element")}},onDragEnd:ke=>{},onMouseUp:ke=>{}})}),[A,ne,E,n,u,p,m,T,_]);return l.jsx("div",{className:sr(h,"movable-area","_movable-area_314c6_5"),style:{width:w.width,height:w.height,...g,position:"absolute",overflow:"hidden",willChange:"transform"},ref:va([oe,Me]),...y,children:l.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:w.width,height:w.height},...y,children:l.jsxs("div",{ref:L,style:{position:"absolute",pointerEvents:"auto"},onFocus:ke=>{k?.(),Q(!0)},onBlur:ke=>{Q(!1)},onKeyDownCapture:ke=>{if(ke.isDefaultPrevented())return;const pt=ke.nativeEvent.ctrlKey,xt=ke.nativeEvent.altKey,Ve=ke.nativeEvent.shiftKey;if(ke.which===Wt.Escape){const ye=r.getMovableSelection();let ve=[...ye];return E.forEach(le=>{if(ve.length===0)return;const Ie=D.current.get(le);let Re=ve.indexOf(Ie);ve.splice(Re,1)}),ve.length!==ye.length&&r.selectMovables(ve),ve.length===0&&C?.(),void ke.preventDefault()}const wt=.1,Ye=ye=>{o.updateSelected(ve=>{ve.setRotation(ve.getRotation()+ye)},"Rotate")},ae=(ye,ve=!0)=>{o.updateSelected(le=>{const Ie=le.getBounds();let Re=1+ye;ve||(Re=1/Re);const be=Math.sqrt(Math.pow(Ie.width,2)+Math.pow(Ie.height,2)),Oe=Math.atan2(Ie.height,Ie.width),ie=Re*be;if(ie<10)return;const Ee=ie*Math.cos(Oe),Le=ie*Math.sin(Oe),qe={x:Ie.x+(Ie.width-Ee)/2,y:Ie.y+(Ie.height-Le)/2,width:Ee,height:Le};le.setBounds(qe)},"Resize")},Ue=ye=>{o.updateSelected(ve=>{const le=ve.getBounds(),Ie={x:le.x+(ye.x??0),y:le.y+(ye.y??0),width:le.width+(ye.width??0),height:le.height+(ye.height??0)};ve.setBounds(Ie)},"Nudge")};if(ke.which===Wt.Delete)o.updateSelected(ye=>{ye.delete()},"Delete"),ke.preventDefault();else if(ke.key==="a"&&pt){const ye=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(ye,!0),ke.preventDefault()}else ke.key==="ArrowLeft"?(Ve?ae(wt,!1):xt?Ye(-10):Ue({x:pt?-10:-1}),ke.preventDefault()):ke.key==="ArrowRight"?(Ve?ae(wt,!0):xt?Ye(10):Ue({x:pt?10:1}),ke.preventDefault()):ke.key==="ArrowUp"?(Ve?ae(wt,!0):Ue({y:pt?-10:-1}),ke.preventDefault()):ke.key==="ArrowDown"&&(Ve?ae(wt,!1):Ue({y:pt?10:1}),ke.preventDefault())},children:[ge,bt]})})})})),Oi=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const a=e[i].getBounds();t=Math.min(a.x,t),n=Math.min(a.y,n),o=Math.max(a.x+a.width,o),r=Math.max(a.y+a.height,r)}return{x:t,y:n,width:o-t,height:r-n}},h8=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let a=0,d=Number.MAX_SAFE_INTEGER,c=0;for(let m=0;m<e.length;m++){const h=e[m],g=h.getBounds();a+=g[i],d=Math.min(g[o],d),c=Math.max(g[o]+g[i],c),n.push({bounds:g,movable:h})}const u=(c-d-a)/(e.length-1);n.sort((m,h)=>{const g=m.bounds[o],f=h.bounds[o];return g!==f?g-f:m.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let m=1;m<n.length-1;m++){const h=n[m-1].bounds,g={...n[m].bounds};g[o]=h[o]+h[i]+u,n[m].bounds=g,p.set(n[m].movable,g)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},b_=s.memo(s.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:a,onHide:d,onShow:c,...u}=e;s.useEffect(()=>{},[r]);const p=Mo(t,()=>({isEmptyFrame:()=>!0}),[]),[m,{height:h,width:g}]=Ci();return l.jsx("div",{...u,ref:va([p,m]),children:l.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:a?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:l.jsx("div",{style:{textAlign:"center"},children:r})})})})),w_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:a,target:d,notifier:c,onRepeatCommandChange:u}=e,p=function(h){const{movables:g,movablesView:f,transactional:x,commands:y,target:w,onRepeatCommandChange:b,notifier:C}=h,k=qr();s.useRef(k.getMode()).current=k.getMode();const E=de(async(R,P,I=null,L=!0)=>{const H=async()=>{const W=await Promise.resolve(C?.showBusy?.(R.label()));try{await P();const A=I??R?.label?.();if(b){let U=null;R&&A!==!1&&(U=new ft(R.key(),w,{label:A,description:A},H)),b(U)}W?.(),L&&k.setMode(null)}catch(A){W?.(),C?.showError?.(A)}};await H()},[b,C]),[M,T]=s.useReducer(R=>R+1,0),F=de((R,P,I)=>{if(!f)return;const L=f.getMovableSelection();if(L.length===0)return;let H="Drawings";if(L.length===1){const A=L[0];H=N.TextUtils.capitalize(A.getContent().getType())??"Drawing"}const W=`${R.label()} ${H}`;E(R,()=>{let A=null;x&&(A=x.beginCommit(W));const U=f.getMovableSelection();if(U.length===0)return;const X=I?.(U);for(let ee=0;ee<U.length;ee++){const V=U[ee];P(V,X)}A?.commit()})},[f,x]),[_,O]=s.useState(f.getMovableSelection()[0]??null),[S,v]=s.useState(!_||_?.isProtected()),D=s.useMemo(()=>[new _e("moveToFront",w,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[we.Ctrl,we.Shift]}},function(){F(this,R=>{R.moveToFront()})}),new _e("moveForward",w,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[we.Ctrl]}},function(){F(this,R=>{R.moveForward()})}),new _e("moveToBack",w,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[we.Ctrl,we.Shift]}},function(){F(this,R=>{R.moveToBack()})}),new _e("moveBackward",w,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[we.Ctrl]}},function(){F(this,R=>{R.moveBackward()})}),new _e("toggleLockAspectRatio",w,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){F(this,R=>{R.setLockAspectRatio(!R.isLockAspectRatio())})}),new _e("formatAnchorTypeTwoCell",w,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.TwoCell)})}),new _e("formatAnchorTypeOneCell",w,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.OneCell)})}),new _e("formatAnchorTypeAbsolute",w,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){F(this,R=>{R.setAnchorType(N.IAnchored.Type.Absolute)})}),new _e("formatDrawAlignLeft",w,{label:"Align Left",description:"Align the selected drawings to the left."},function(){F(this,(R,P)=>{R.setBounds({x:P.x})},Oi)}),new _e("formatDrawAlignCenter",w,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){F(this,(R,P)=>{R.setBounds({x:(P.width-R.getBounds().width)/2+P.x})},Oi)}),new _e("formatDrawAlignRight",w,{label:"Align Right",description:"Align the selected drawings to the right."},function(){F(this,(R,P)=>{R.setBounds({x:P.width-R.getBounds().width+P.x})},Oi)}),new _e("formatDrawAlignTop",w,{label:"Align Top",description:"Align the selected drawings to the top."},function(){F(this,(R,P)=>{R.setBounds({y:P.y})},Oi)}),new _e("formatDrawAlignMiddle",w,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){F(this,(R,P)=>{R.setBounds({y:(P.height-R.getBounds().height)/2+P.y})},Oi)}),new _e("formatDrawAlignBottom",w,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){F(this,(R,P)=>{R.setBounds({y:P.height-R.getBounds().height+P.y})},Oi)}),new _e("formatDrawDistributeHorz",w,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){F(this,(R,P)=>{R.setBounds(P.get(R))},R=>h8(R))}),new _e("formatDrawDistributeVert",w,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){F(this,(R,P)=>{R.setBounds(P.get(R))},R=>h8(R,!1))}),new _e("formatDrawFlipHorz",w,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new _e("formatDrawFlipVert",w,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new _e("formatDrawGroup",w,{label:"Group",description:"Group the selected drawings into a single drawing."}),new _e("formatDrawUngroup",w,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new _e("formatDrawSwapShapes",w,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new _e("formatDrawSwapShapesHorz",w,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new _e("formatDrawSwapShapesVert",w,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[f,_]);s.useEffect(()=>{},[k]);const j=s.useMemo(()=>{let R=null;return R=y?y.createChildGroup(w,"movable",!1):new Ei(w,"movable"),R.addCommands(D,!0),R},[y,D]);return Gt(_,{onAnyChange:()=>{j.getCommand("formatAnchorTypeTwoCell").update({state:_?.getAnchorType()===N.IAnchored.Type.TwoCell}),j.getCommand("formatAnchorTypeOneCell").update({state:_?.getAnchorType()===N.IAnchored.Type.OneCell}),j.getCommand("formatAnchorTypeAbsolute").update({state:_?.getAnchorType()===N.IAnchored.Type.Absolute}),j.getCommand("formatAnchorTypeAbsolute").update({state:_?.getAnchorType()===N.IAnchored.Type.Absolute}),j.getCommand("toggleLockAspectRatio").update({state:_?.isLockAspectRatio()})},onProtectedChange:R=>{v(R.isProtected())},onDelete:()=>{}}),Gt(f,{onMovableSelectionChange:()=>{const R=f.getMovableSelection()[0]??null;O(R),v(!R||R.isProtected()),T()}}),Gt(g,{onCollectionChange:()=>{T()}}),s.useEffect(()=>{const R={disabled:S};j.getCommand("formatAnchorTypeTwoCell").update(R),j.getCommand("formatAnchorTypeOneCell").update(R),j.getCommand("formatAnchorTypeAbsolute").update(R),j.getCommand("toggleLockAspectRatio").update(R);const P=g.getCount(),I=f.getMovableSelection(),L=S||P<=1||I.length===0;let H={disabled:L},W=H;if(!L&&I.length===1){const X=I[0];X.getZIndex()===0&&(H={disabled:!0}),X.getZIndex()===P-1&&(W={disabled:!0})}j.getCommand("moveToFront").update(W),j.getCommand("moveForward").update(W),j.getCommand("moveToBack").update(H),j.getCommand("moveBackward").update(H);const A={disabled:S||I.length<=1};j.getCommand("formatDrawAlignLeft").update(A),j.getCommand("formatDrawAlignCenter").update(A),j.getCommand("formatDrawAlignRight").update(A),j.getCommand("formatDrawAlignTop").update(A),j.getCommand("formatDrawAlignMiddle").update(A),j.getCommand("formatDrawAlignBottom").update(A),j.getCommand("formatDrawFlipHorz").update(A),j.getCommand("formatDrawFlipVert").update(A),j.getCommand("formatDrawGroup").update(A),j.getCommand("formatDrawUngroup").update(A),j.getCommand("formatDrawSwapShapes").update(A),j.getCommand("formatDrawSwapShapesHorz").update(A),j.getCommand("formatDrawSwapShapesVert").update(A);const U={disabled:S||I.length<=2};j.getCommand("formatDrawDistributeHorz").update(U),j.getCommand("formatDrawDistributeVert").update(U)},[M,S,M]),j}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:u,commands:a,target:d,notifier:c});s.useEffect(()=>{n?.getStage()},[n?.getStage()]);const m=s.useMemo(()=>l.jsx(y_,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,a,p]);return m&&n?m:null})),v_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:d,commands:c,notifier:u=uc}=e,p=qr(),[m,h]=s.useState(null),[g,f]=s.useState(null),[x,y]=s.useState(null),[w,b]=s.useState(null),[C,k]=s.useState(null);s.useLayoutEffect(()=>{if(x===null)return b(null),void k(null);const I=()=>{const L=o.getRange(x).getCell(),H=L.getStyle();let W,A=H.getFill()?.toCSS(r.body.darkMode);A.background!=="none"&&A.background!=="transparent"||(A=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),A.background!=="none"&&A.background!=="transparent"||(A={background:r.body.fill}),b({style:A}),L&&!L.getFormula()&&(W=L?.getRenderHorizontalAlignment()),k(W??Mx)};return I(),o.getRange(x).addListener(()=>{I()})},[o,x,r?.body]);const E=de(()=>{let I=g.editState.dirty??"";if(g.editState.dirty!==void 0){const L=N.TextUtils.clampString(I);try{const H=g.sheet.getRange(g.coords),W=`Typing '${L}' into ${H.toString()}`;return H.setValue(I,{description:W,autoFit:!0}),y(null),f(null),p.setMode(null),d(null),!0}catch(H){throw u.showError(new Error(`Unable to enter '${L}'.`,{cause:H})),H}}},[o,g,u]),M=de(I=>o.getRange(I).getCell().getExtrusions()??vo.cellToRange(I),[o]);de(I=>{let L=N.IRange.Orientation.Row,H=!1;I!==N.IRange.Direction.Up&&I!==N.IRange.Direction.Down||(L=N.IRange.Orientation.Column),I!==N.IRange.Direction.Left&&I!==N.IRange.Direction.Up||(H=!0),o.getSelection().traverse(L,H)},[o]);const T=s.useCallback((I,L)=>{if(i)return i(I,L);if(!o)return null;const{ref:H,...W}=I;return l.jsx($m,{ref:H,...W,sheet:o,bodyStyle:r?.body,activeCoords:L,commands:c,onChangeEdit:A=>{const U={sheet:o,coords:L,editState:A};p.setMode(X=>({...X,description:U.editState.editMode?"Edit":"Enter",args:{...X?.args,stateAndCoords:U}}))},editState:g.editState})},[o,w,i,g,x]),{overlay:F,startEdit:_,submitEdit:O,cancelEdit:S,onKeyboardEventNative:v,onPointerEventNative:D}=bE({view:n,activeCoords:m,getCellEditor:T,canEdit:()=>{const I=o.getProtection();if(I.isReadOnly())return!1;const L=I.isLocked();return L&&a(),!L},onBeforeStartEdit:I=>{const L=Wm(()=>o.getRange(I).getCell()),H={sheet:o,coords:I,editState:Object.freeze(L)};p.setMode({key:"edit",args:{stateAndCoords:H}}),f(H)},onStartEdit:I=>{y(I),d(I)},onSubmitEdit:E,onCancelEdit:I=>{y(null),f(null),p.setMode(null),d(null)},onDoneEdit:I=>{p.setMode(null)},containerProps:w,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:C,getRangeCoords:M});Gt(o.getSelection(),{onChange(I){h(o.getSelection().getCoords().cell)}});const j=de(I=>{D(I),x&&O()},[D,S,x]),R=s.useCallback(I=>{D(I)},[D]),P=s.useCallback(I=>{v(I)},[v]);return s.useEffect(()=>{const I=n?.getStage();if(I)return I.addEventListener("pointerdown",j),I.addEventListener("dblclick",R),I.addEventListener("keydown",P),()=>{I.removeEventListener("pointerdown",j),I.removeEventListener("dblclick",R),I.removeEventListener("keydown",P)}},[n?.getStage()]),s.useEffect(()=>{const I=p.getMode(),L=I?.key;L==="edit"||L==="enter"?g?I.args?.cancel?S():I.args?.submit?O():f(I.args?.stateAndCoords):_(I.args?.start):x&&S()},[p]),F(n,t)})),Km="white",Xm="black",S_=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Xm}' fill='${Km}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,C_=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Xm}' fill='${Km}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,k_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=s.useState(o.getTables().getCount()>0),[a,d]=s.useState(null),[c,u]=s.useState(null),[p,m]=s.useState(null),[h,g]=s.useState(null),f=de(()=>{if(o.getTables().getCount()>0){i(!0);const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)}else i(!1),d(null)},[o,n]),x=de(E=>{E.preventDefault(),E.stopPropagation();const M=n.getCellCoordsFromClient(E.clientX,E.clientY),T=o.getTables().search({address:M});T.length===1&&T[0].select()},[n,o]),y=de(E=>{E.preventDefault(),E.stopPropagation();const M=n.getCellCoordsFromClient(E.clientX,E.clientY),T=o.getTables().search({address:M});if(T.length===1){const F=T[0].getRange().getCoords(),_={colStart:F.colStart,rowStart:M.rowIndex,colEnd:F.colEnd,rowEnd:M.rowIndex};o.getRange(_).select()}},[n,o]),w=de(()=>{if(!r)return;const E=o.getTables().search({address:n.getVisibleRangeCoords()});d(E.length>0?E:null)},[o,r,n]);Gt(o?.getSelection(),{onChange(E){u(o.getSelection().getCoords().cell)}}),Gt(p,{onAnyChange(E){f(),w()}}),Gt(h,{onAnyChange(E){w()}}),Gt(o,{onTablesChange(E){f(),w()},onInvalidated(E){f(),w()}});const b=s.useMemo(()=>zt.debounce(zt.throttle(w,300),300),[]);s.useEffect(()=>{b()},[n]),s.useEffect(()=>{let E=null;if(a)for(let M=0;M<a.length&&!E;M++){const T=a[M],F=T.getRange().getCoords();N.CoordUtils.isCellWithinRange(c,F)&&(E=T)}m(E)},[c,a]);const C=de(E=>{let M=null;if(a)for(let T=0;T<a.length;T++){const F=a[T],_=F.getRange().getCoords();let O=n.getRangeCoordsBounds(_);const S=n.getRelativePointFromClient(E.clientX,E.clientY),v=S.x,D=S.y;if(v>=O.x&&v<=O.x+O.width&&D>=O.y&&D<=O.y+O.height){const j=n.getViewportSize();v<=0||D<=0||v>=j.width||D>=j.height||(M=F)}}g(M)},[n,a]);if(s.useEffect(()=>{const E=n?.getStage();if(E&&a)return E.addEventListener("mousemove",C),E.addEventListener("mouseleave",C),()=>{E.removeEventListener("mousemove",C),E.removeEventListener("mouseleave",C)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const k=[];for(let E=0;E<a.length;E++){const M=a[E];if(M.isClosed())continue;const T=M===h,F=M===p,_=M.getRange().getCoords(),O=n.getRangeCoordsBounds(_);let S;if(T||F){const v=M.getStyle().getProperties(),D=v.headerRow?.fill?.background??v.wholeTable?.border?.top?.color?.toString();if(D&&o){const j=o.getStyles().parseColor(D);j&&(S=j.toCSS())}S||(S="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(l.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:O.height,pointerEvents:"all",cursor:S_},onMouseDown:y},`table-select-row-${M.getName()}`)),k.push(l.jsx("div",{style:{position:"absolute",left:O.x,top:O.y,width:Math.min(16,O.width),height:Math.min(16,O.height),pointerEvents:"all",cursor:C_},onMouseDown:x},`table-select-${M.getName()}`)),k.push(l.jsx(Ec,{x:O.x,y:O.y,width:O.width,height:O.height,range:_,strokeWidth:F?.5:0,stroke:S??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:T?`${S} 0px 0px 1px 1px`:void 0}},`table-outline-${M.getName()}`))}return k})),E_=s.memo(s.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,a]=s.useState(null),[d,c]=s.useState(null),u=s.useRef(null),p=de(()=>{const y=o.getSelectedCell(),w=y.getSpill()?.getCoords()??null;vo.isEqualRanges(w,i)||(c(w?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(w),coords:w}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),a(w))},[o,n,i]);s.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),d&&(u.current=setTimeout(()=>{c(null),u.current=null},r)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[d,r]);const m=s.useMemo(()=>zt.debounce(zt.throttle(p,80),80),[]);if(Gt(o?.getSelection(),{onChange(y){m()}}),Gt(o,{onSpillsChange(y){p()},onInvalidated(y){p()}}),!n||!i&&!d)return null;const h=o.getRange(i).getValue()instanceof N.FormulaError.Spill,g=[];let f=d?.bounds??n.getRangeCoordsBounds(i);if(d&&!zt.isEqualBounds(d.bounds,n.getRangeCoordsBounds(d.coords))&&c(null),f=n.toClipBounds(f,-10),!f)return;const x="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return g.push(l.jsx(Ec,{x:f.x,y:f.y,width:f.width,height:f.height,range:i,strokeWidth:1,stroke:x,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:d?.transition==="out"?0:1,transition:d?.transition?d.transition==="in"||d.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${x} 0px 0px 4px 0px`}},"spill-outline}")),g})),__={position:"absolute",top:0,left:0,bottom:0,right:0},m8=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},a=n.body=zt.mergeContentful(e.body,i);return n.body=zt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=zt.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=zt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=zt.mergeContentful(n.header,i),n.headerSelect=zt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=zt.mergeContentful(n.headerSelect,i),n.headerSelectAll=zt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=zt.mergeContentful(n.headerSelectAll,i),n},T_={fireOnModelChange:!1},f8={},Ym=s.memo(s.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=f8,headersStyle:r=f8,onSheetContextMenu:i,showColumnHeaders:a,columnHeaderProps:d,showRowHeaders:c,rowHeaderProps:u,showScrollbars:p=!0,scrollPaneProps:m,onViewportChange:h,commands:g,onRepeatCommandChange:f,onMoveCell:x,overlays:y,renderMovable:w,viewportComponent:b,onElementLoad:C,getCellEditor:k,onFocus:E,onBlur:M,style:T=hn.EmptyCssProperties,notifier:F,onShowTooltip:_,onShowColumnTooltip:O,onShowRowTooltip:S,onCloseTooltip:v,gridProps:D,cellRenderProps:j,...R}=e;if(s.useEffect(()=>{N.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[P,I]=s.useReducer(De=>De+1,0),[L,{width:H,height:W}]=Ci(),A=de(_,[_]),U=de(O,[O]),X=de(S,[S]),ee=de(v,[v]),V=s.useRef(!1);s.useLayoutEffect(()=>{V.current=!0},[n]);const $=n?.getStyles(),z=s.useMemo(()=>m8(o,$),[o,$]),q=s.useMemo(()=>m8(r,$),[r,$]),{body:G={},buttonSurface:Q={}}=z,{header:Y={},headerSelect:te={},headerSelectAll:re={}}=q,ge=s.useRef(null),[J,se]=s.useState(()=>n?.getView()),Se=(J?.getZoomScale()??100)/100,Me=s.useMemo(()=>({vertical:J.isShowColumnGridlines()&&Se>=.4,horizontal:J.isShowRowGridlines()&&Se>=.4}),[J?.isShowColumnGridlines(),J?.isShowRowGridlines(),Se]),oe=s.useMemo(()=>{if(J?.getGridLineColor())return{strokeDasharray:"1,1"}},[J?.getGridLineColor(),z]),ne=a??J?.isShowColumnHeaders(),he=c??J?.isShowRowHeaders(),[ze,Ne]=s.useState({width:0,height:0}),gt=s.useMemo(()=>{let De=40,ce=20;const at=n?.getStyles().getNormal().getFont();if(ze.width>0&&ze.height>0){const mt=at?.toCSS()?.fontFamily??z.header.text.fontFamily,Z=at?.getSize()??z.header.text.fontSize,K=N.IFont.getSharedMeasurer()(""+ze.height,Math.ceil(Z*N.IFont.getDeviceScale()),mt);De=K.width,ce=K.lineHeight}return{width:Math.round(De+5),height:Math.round(ce+3)}},[ze,z?.header.text,n]),bt=he?Se*gt.width:Y.edgeStrokeWidth,ke=ne?Se*gt.height:Y.edgeStrokeWidth,pt=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??gt.width)+bt+1),xt=Math.max(W,(n?.getRowHeaders().getDefaultSize()??gt.height)+ke+1),Ve=s.useRef(new Map),wt=s.useRef(null),Ye=()=>({getColOffset:De=>n.getColumnHeaders().findOffset(De),getColIndex:De=>n.getColumnHeaders().findIndex(De),getRowOffset:De=>n.getRowHeaders().findOffset(De),getRowIndex:De=>n.getRowHeaders().findIndex(De)}),[ae,Ue]=s.useState(()=>Ye()),[ye,ve]=s.useState(!1),[le,Ie]=s.useState(null),Re=!0,be=z.selection?.strokeFill,Oe=s.useCallback(()=>Lo.current,[]),[ie,Ee]=s.useState(),Le=de(De=>{Ee(De),n&&n.getView()&&n.getView().setTopLeft(De?{left:De.left,top:De.top}:null),h?.(De)},[n,h]),qe=s.useRef(null);s.useEffect(()=>{if(!ie||!n)return;const De=n.getRangeAtBounds({x:ie.left,y:ie.top,width:ie.width,height:ie.height});qe.current?.(),qe.current=De.addListener(()=>{const ce=De.getCoords();ge?.current?.invalidate(ce)})},[ie,n]);const[ht,ot]=s.useState(()=>n?.getView().getTopLeft()),We=de(De=>{const ce=vo.cellToRange(De);if(n.isClosed())return ce;const at=n.getRange(ce,{excludeHidden:!0}).getMerges();return at.length===0?ce:at[0]},[n]),st=De=>{if(!De||De.coords.colIndex===0&&De.coords.rowIndex===0)return null;const ce={};return De.coords.colIndex>0&&(ce[co.Left]={index:De.coords.colIndex,scrollOffset:De.topLeft.left}),De.coords.rowIndex>0&&(ce[co.Top]={index:De.coords.rowIndex,scrollOffset:De.topLeft.top}),ce},[Xe,Qe]=s.useState(()=>st(n.getView().getFreezePanes())),kt=qr(),Vt=s.useCallback(()=>ge.current,[]),ct=de(De=>{kt.setMode(ce=>ce?.key==="edit"?{...ce,args:{...ce.args}}:{key:"edit",args:{stateAndCoords:null,start:De}})},[]),Ut=de(()=>ie,[ie]),Qt=function(De){const{sheet:ce,onRepeatCommandChange:at,bodyStyle:mt,commands:Z,target:K,notifier:ue,onStartEdit:fe,getViewport:Ae}=De,[Ke,Be]=s.useState(null),[Ct,It]=s.useState(null),jt=s.useRef(null),At=de(fe,[fe]),cn=de(Ae,[Ae]),[Dt,Ot]=s.useState(),[Ln,lt]=s.useState(()=>ce?.getStyles().parseColor(N.IColor.Scheme.Bg2)),[Kt,Yn]=s.useState(()=>ce?.getStyles().getNormal().getFont().getFill()),Nt=qr();s.useRef(Nt.getMode()).current=Nt.getMode();const tn=ah(),[Dn,nr]=s.useState(zt.EmptyArray),S0=s.useCallback(()=>{if(jt.current!==ce)return;const pe=ce.getSelectedRanges();let Pe=null;Dn.length>0&&vo.isCellWithinRange(Ke,Dn[0].getRange().getCoords())&&(Pe=Dn[0]);const Ge=ce?.getSelectedCell(),Te=Ge?.getCoords()??null;uo.unstable_batchedUpdates(()=>{Pc(Pe),Be(Te),It(pe)})},[ce,Dn,Ct,Ke]),ss=s.useCallback(zt.debounce(S0,210),[S0]);s.useEffect(()=>{jt.current=ce,S0()},[ce]);const Ro=de(()=>ce.getRange(Ke).getCell(),[ce,Ke]),ho=de(async(pe,Pe,Ge=null,Te=!1,Je=!0)=>{const nt=pe?.label?.(),nn=async()=>{const Yt=await Promise.resolve(Je&&ue?.showBusy?.(nt??"Busy..."));try{await ce.doBatch(async()=>Pe(ce),nt),Te&&Nt.setMode(null),Yt&&Yt()}catch(Hn){if(Yt&&Yt(),!Hn)return;ue?.showError?.(Hn)}},on=[];let Zt=!1;const dn=async()=>(on.push(nn),(async()=>{if(!Zt){for(Zt=!0;on.length>0;){const Yt=on.shift();Yt&&await Yt()}Zt=!1}})());if(at){let Yt=null;if(Ge!==!1&&pe){const Hn=Ge??nt;Yt=new ft(pe.key(),K,{label:Hn,description:Hn},dn)}at(Yt)}return dn()},[ce,at,ue]),Pt=de((pe,Pe,Ge=!1,Te)=>ho(pe,Je=>{const nt=Je.getSelectedRanges();Ge&&nt.updateStyle(null,Te),nt.updateStyle(Pe,Te),nt.autoFit({expandOnly:N.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[ce]),F5=de((pe,Pe,Ge)=>{ho(pe,Te=>{let Je=Pe;(Ge||Pe?.address)&&(Je=Je??{},!Ge&&Pe?.address?.startsWith("#")?Ge=Pe?.address.substring(1):Ge&&(Je.displayText=Ge)),Te.getSelectedRange().setHyperlink(Je)})},[ce]),z5=de((pe,Pe)=>{ho(pe,Ge=>{Ge.getSelectedRange().setComments(Pe)})},[ce]),ka=de((pe,Pe)=>{ho(pe,Ge=>{Ge.getSelectedRanges().clear(Pe)})},[ce]),K0=de(async(pe,Pe,Ge=!1,Te=!1)=>ho(pe,async Je=>{let nt=Je.getSelectedRanges();Ge&&(Pe===N.IRange.Orientation.Row?nt=nt.getEntireRows(Te):Pe===N.IRange.Orientation.Column&&(nt=nt.getEntireColumns(Te)));let nn=null;const on=Nt.getMode()?.key;if(on==="copy"||on==="cut"){const Zt=await tn.getClipboard().readReference();Zt&&Zt.getItemType()==="range"&&(nn=Zt.getItem(),nn.getCoords()||(nn=null))}if(nn){const Zt=await nt.insertFrom(nn,{...nn.getMarkOptions(),orientation:Pe,autoSelect:!0});!Zt||Zt.isEntireRows()||Zt.isEntireColumns()||Zt.autoFit({orientations:N.IRange.Orientations.Row,minContent:!0}),Nt.setMode(null)}else nt.insert(Pe,{autoSelect:!0})},"Insert Cells",!1),[Nt]),[s0,Pc]=s.useState(null),Xg=de(pe=>ce.getStyles().setDefaultTableStyle(pe),[ce]),Yg=de(pe=>{ce.getStyles().getTableStyle(pe)?.delete()},[ce]),Ea=de((pe,Pe)=>{ho(pe,async Ge=>{const Te=Ge.getSelectedRange(),Je=Ge.getSelectedCell().getCoords();let nt=null,nn=0;const on=Je.rowIndex>0?Ge.getRange({rowIndex:Je.rowIndex,colIndex:Je.colIndex}).getExtended(N.IRange.Direction.Up):null;on&&Ge.getRange({colStart:Je.colIndex,rowStart:on.getCoords().rowStart,colEnd:Je.colIndex,rowEnd:on.getCoords().rowStart}).isContentful()&&(nt=N.IRange.Direction.Up,nn=Je.rowIndex-on.getCoords().rowEnd);const Zt=Je.colIndex>0?Ge.getRange({rowIndex:Je.rowIndex,colIndex:Je.colIndex-1}).getExtended(N.IRange.Direction.Left):null;if(Zt&&Ge.getRange({colStart:Zt.getCoords().colStart,rowStart:Je.rowIndex,colEnd:Zt.getCoords().colStart,rowEnd:Je.rowIndex}).isContentful()){const Yt=Je.colIndex-Zt.getCoords().colEnd;(Yt<nn||!nt)&&(nt=N.IRange.Direction.Left,nn=Yt)}let dn=null;if(nt===N.IRange.Direction.Up){if(dn={...on.getCoords()},(dn.rowEnd===Je.rowIndex||!Ge.getRange({colIndex:Je.colIndex,rowIndex:Je.rowIndex-1}).isContentful())&&dn.rowStart>0&&Ge.getRange({colIndex:Je.colIndex,rowIndex:dn.rowStart-1}).isContentful()){const Yt=on.getExtended(N.IRange.Direction.Up);dn={colStart:Je.colIndex,rowStart:Yt.getCoords().rowStart,colEnd:Je.colIndex,rowEnd:on.getCoords().rowEnd}}dn.rowEnd=Je.rowIndex-1}else if(nt===N.IRange.Direction.Left){if(dn={...Zt.getCoords()},(dn.colEnd===Je.colIndex||!Ge.getRange({colIndex:Je.colIndex-1,rowIndex:Je.rowIndex}).isContentful())&&dn.colStart>0&&Ge.getRange({colIndex:dn.colStart-1,rowIndex:Je.rowIndex}).isContentful()){const Yt=Zt.getExtended(N.IRange.Direction.Left);dn={colStart:Yt.getCoords().colStart,rowStart:Je.rowIndex,colEnd:Yt.getCoords().colEnd,rowEnd:Je.rowIndex}}dn.colEnd=Je.colIndex-1}if(Te.size!==1&&nt){const Yt=Te.getCoords(),Hn=Te.startIncrementalUpdates({orientation:N.IRange.Orientation.Column}),ro={...dn},Vo=Yt.rowStart,Br=Yt.rowEnd,Nr=Yt.colStart,Vr=Yt.colEnd,or=nt===N.IRange.Direction.Up;for(let Ao=Nr;Ao<=Vr;Ao++){ro.colStart=or?Ao:dn.colStart+(Ao-Nr),ro.colEnd=or?Ao:dn.colEnd+(Ao-Nr);for(let mo=Vo;mo<=Br;mo++){ro.rowStart=or?dn.rowStart+(mo-Vo):mo,ro.rowEnd=or?dn.rowEnd+(mo-Vo):mo;const kr=Ge.getRange(ro).toString();Hn.pushAt(mo,Ao,`=${Pe}(${kr})`)}}Hn.apply()}else{const Yt=dn?Ge.getRange(dn).toString():"",Hn=`=${Pe}(`;At?.({text:`${Hn}${Yt})`,editMode:!0,initialSelection:{start:Hn.length,end:Hn.length+Yt.length}})}},!1)},[ce]),cs=de((pe,Pe,Ge=!1,Te=!0)=>{ho(pe,async Je=>{let nt=null;if(s0)return void s0.updateStyleOptions(Pe);{const Zt=Je.getSelectedRanges().getFixed(!0),dn=Je.getSelectedRange().getDefaultSortCriteria();let Yt={ranges:Zt,hasHeader:dn?.options?.hasHeader??!1};nt=Te?new Promise((Hn,ro)=>{const Vo={tableOptions:Yt,onCancel:()=>{ro()},onDone:Br=>{Hn(Br)},context:{getNames:()=>Je.getNames()}};ue.showWindow?.("tableNew",Vo)}):{option:"Ok",tableOptions:Yt}}const nn=await Promise.resolve(nt);if(nn?.option!=="Ok")throw null;const on=await Promise.resolve(ue?.showBusy?.(pe.label()));try{await Je.getTables().add(nn.tableOptions.ranges.at(0),{styleName:Pe?.name,clearFormatting:Ge,hasHeader:nn.tableOptions.hasHeader}).getRange().select()}catch(Zt){on(),ue?.showError?.(Zt)}on()},!1,!0,!1)},[s0]),B5=de(()=>mt,[mt]),N5=de(pe=>({styles:()=>ce.getStyles(),table:()=>pe,bodyStyle:B5,getNames:()=>ce.getNames()}),[ce]),Jg=de(async(pe,Pe,Ge,Te=!0)=>{let Je=null;if(!Pe){let nt=ce.getSelectedRange();nt.size===1&&(nt=nt.getSurrounding());let nn=ce.getTables().search({address:ce.getSelectedRange()});nn.length>0&&(Pe=nn[0]),await nt.select()}if(Pe){if(Te){try{Ge&&await Pe.select()}catch{}Je=new Promise(async(nt,nn)=>{pe.update({context:N5(Pe)});const on={command:pe,commands:me,notifier:ue,onDone:dn=>{nt(dn)}},Zt=await ue.showWindow?.("tableDetails",on,{disableAutoDestroy:!0});setTimeout(()=>{Zt.focus()},180)})}Promise.resolve(Je).then(nt=>{},nt=>{ue?.showError?.(nt)})}},[ue]),V5=de(async(pe,Pe,Ge=!1)=>{let Te=null;if(Pe)Pe.isITable?Te=Pe:Pe.getValue()&&(Te=Pe.getValue());else{const Je=ce.getTables().search({address:ce.getSelectedRange()});Je.length>0&&(Te=Je[0])}if(Te){if(!Ge){const Je=Te.getRange().getCoords(),nt=(Je.colEnd-Je.colStart+1)*(Je.rowEnd-Je.rowStart+1);if(nt>1e4&&await ue?.showOptions({title:"Confirm",description:`Converting a table to range with '${nt}' cells will set a large number of cell styles and may affect performance.
|
|
63
63
|
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}ho(pe,async()=>{Ge?Te.delete():Te.convertToRange()},!1,!0)}},[ue]),Fc=de((pe,Pe,Ge)=>{ho(pe,async Te=>{let Je=Te.getSelectedRanges();if(Je.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let nt=Je.at(0);nt.size===1&&(nt=nt.getSurrounding());const nn=Te.getSelection().getCoords().cell;let on=nt.getDefaultSortCriteria(N.IRange.Orientation.Row,nn);if(!on){if(Ge)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let Zt=on.options;if(Ge&&(Zt=new Promise((Yt,Hn)=>{const ro={range:nt,options:on.options,cell:nn,onCancel:()=>{Hn()},onDone:Vo=>{Vo?Yt(Vo.options):Hn()}};ue.showWindow?.("sort",ro)})),Zt=await Promise.resolve(Zt),!Zt)return;const dn=await Promise.resolve(ue?.showBusy?.(pe.label()));try{nt.doBatch(()=>{const Yt={...Zt,...Pe};nt.sort(Yt),nt.autoFit({orientations:Yt?.orientation===N.IRange.Orientation.Column?N.IRange.Orientations.Column:N.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},pe?.label?.())}catch(Yt){dn(),ue?.showError?.(Yt)}dn()},!1,!1,!1)},[ue]),Qg=de(()=>{console.log("compactedSelection");const pe=ce.getSelection().getCoords(),Pe=ce.getSelectedRanges().getFlattened().getCoords(),Ge=(()=>{const nt=new Blob(["console.log('hello from worker');"],{type:"application/javascript"}),nn=URL.createObjectURL(nt),on=new Worker(nn);return URL.revokeObjectURL(nn),on})();setTimeout(()=>{Ge.terminate(),console.log("Worker terminated")},5e3);let Te=-1;for(let nt=0;Te===-1&&nt<Pe.length;nt++)vo.isCellWithinRange(pe.cell,Pe[nt])&&(Te=nt);if(vo.isEqualRangesArrays(pe.ranges,Pe))return;const Je={cell:pe.cell,ranges:Pe,rangeIndex:Te};ce.getSelection().updateCoords(Je)},[ce]),ex=de(()=>{console.log("selectComments")},[ce]),H5=de(async(pe=!1,Pe=!1)=>{let Ge=null;if(Pe)Ge=ce.getEntireRange();else{const Te=ce.getSelectedRange();if(Te.isEntireRange()){const Je=ce.getSelection().getCoords().cell,nt=ce.getRange(Je);Ge=nt.getSurrounding(),Ge.isEntireRange()&&(Ge=nt)}else Ge=Te.getSurrounding({contentOnly:pe})}Ge&&await Ge.select()},[ce]),_a=de((pe,Pe,Ge)=>{ho(pe,async Te=>{let Je=Te.getSelectedRanges();Ge&&(Pe===N.IRange.Orientation.Row?Je=Je.getEntireRows():Pe===N.IRange.Orientation.Column&&(Je=Je.getEntireColumns())),Je.delete(Pe)},"Delete Cells")},[ce]);de(async pe=>{let Pe=null;const Ge=cn(),Te=Math.min(Ge.width-8,480),Je=Math.min(Ge.height-8,288);try{ce.getSelectedRanges(),Pe=await ce.getMovables().add({bounds:{x:Ge.left+(Ge.width-Te)/2,y:Ge.top+(Ge.height-Je)/2,width:Te,height:Je},type:"chart",json:pe.template}),Pe.select(),Nt.setMode(null)}catch(nt){ue?.showError?.(nt)}return Pe},[ce,ue]);const $5=de(async(pe,Pe,Ge)=>{const Te=await ue?.showBusy?.(pe.label());try{const Je=await ce.getMovables().addImage(Pe,{autoSelect:!0,...Ge});return Te(),Nt.setMode(null),Je}catch(Je){Te();let nt=Je;typeof nt!="string"&&(console.warn(Je),nt="Unable to resolve image."),ue?.showMessage?.(nt,{type:a0})}},[ce,ue]),ds=de((pe,Pe)=>{ho(pe,async Ge=>{const Te=Ge.getSelectedRanges();Te.doBatch(()=>{const Je=Pe===N.IRange.Direction.Up||Pe===N.IRange.Direction.Down,nt=Te.getCoords().slice().sort(vo.createRangeComparator(Je?N.IRange.Orientation.Row:N.IRange.Orientation.Column));for(let nn=0;nn<nt.length;nn++){const on=nt[nn];let Zt=on;const dn=Ge.getRange(Zt).getMerges();let Yt=0,Hn=0;if(dn.length>0){const ro=dn[0];Yt=ro.rowEnd-ro.rowStart,Hn=ro.colEnd-ro.colStart}Pe===N.IRange.Direction.Left?Zt={...on,colStart:on.colEnd+Hn}:Pe===N.IRange.Direction.Right?Zt={...on,colEnd:on.colStart+Hn}:Pe===N.IRange.Direction.Up?Zt={...on,rowStart:on.rowEnd+Yt}:Pe===N.IRange.Direction.Down&&(Zt={...on,rowEnd:on.rowStart+Yt}),Ge.getRange(Zt).autoFill(on,{filler:N.AutoFill.Types.Copy}),Ge.getRange(on).autoFit({orientations:N.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:pe.label()})})},[ue]),tx=de(()=>{let pe=null;const Pe=ce.getSelectedCell().getCoords();if(Pe?.rowIndex>0){const Ge=ce.getRange({rowIndex:Pe.rowIndex-1,colIndex:Pe.colIndex}).getCell();Ge&&(pe=Ge.toTextUnformatted(!0))}At?.({text:pe})},[ce]),[Ta,nx]=s.useReducer(pe=>pe+1,0),[us,_i]=s.useReducer(pe=>pe+1,0),W5=s.useMemo(()=>[new _e("gridlinesToggle",K,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new _e("sheetViewToggleGridlinesRows",K,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new _e("sheetViewToggleGridlinesColumns",K,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new _e("sheetViewFormatGridlinesColor",K,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new _e("sheetViewToggleShowHeadings",K,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new _e("sheetViewToggleShowHeadingRows",K,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new _e("sheetViewToggleShowHeadingColumns",K,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new _e("sheetViewToggleShowHeadingsNumeric",K,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[we.Ctrl,we.Shift]}}),new _e("sheetViewToggleFormulaView",K,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[we.Ctrl]},{key:"`",modifiers:[we.Ctrl,we.Shift]}]}),new _e("sheetViewToggleShowZeros",K,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new ft("selectComments",K,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[we.Ctrl,we.Shift]}},()=>ex()),new _e("selectAll",K,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[we.Ctrl]},{key:"Space",modifiers:[we.Ctrl,we.Shift]}]},(pe=!1)=>H5(!1,pe)),new ft("selectRegion",K,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[we.Ctrl,we.Shift]}},()=>H5(!0,!1)),new ft("breakSelection",K,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[we.Ctrl,we.Alt]}},()=>Qg()),new ft("formatTextRotate0",K,{label:"No Text Rotation",description:"Remove all text rotation."}),new ft("formatTextRotate45",K,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new ft("formatTextRotate90",K,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new ft("formatTextRotate270",K,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new ft("formatTextRotate315",K,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new _e("formatTextRotateCustom",K,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new ft("formatTextRotateVertical",K,{label:"Vertical Text",description:"Stack text vertically."}),new ft("sortAscending",K,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){Fc(this,{reverse:!1},!1)}),new ft("sortDescending",K,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){Fc(this,{reverse:!0},!1)}),new ft("sortCustom",K,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){Fc(this,{},!0)}),new _e("protectionSheetToggle",K,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
64
64
|
For example, you can prevent people from editing locked cells or making formatting changes.`}),new _e("formatSheetTabColor",K,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new _e("formatCellStyle",K,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(pe){Pt(this,{named:pe.getName()},!0)}),new _e("formatTableStyle",K,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(pe){cs(this,pe)}),new _e("formatTableStyleClearCellStyles",K,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(pe){cs(this,pe,!0)}),new _e("formatTableStyleClearTableStyle",K,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){cs(this,{name:null},!0)}),new _e("setDefaultTableStyle",K,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Xg),new _e("deleteTableStyle",K,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Yg),new _e("formatBorder",K,{label:"Border",description:"Create an outline border."},function(pe){Pt(this,{border:pe})}),new _e("formatFillColor",K,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(pe){Pt(this,{fill:pe})}),new _e("formatFontColor",K,{label:"Font Color",description:"Change the color of your text."},function(pe){Pt(this,{font:{fill:pe}})}),new _e("formatBoldToggle",K,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[we.Ctrl]},{key:"2",modifiers:[we.Ctrl]}]}),new _e("formatItalicToggle",K,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[we.Ctrl]},{key:"3",modifiers:[we.Ctrl]}]}),new _e("formatUnderlinedToggle",K,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[we.Ctrl]},{key:"4",modifiers:[we.Ctrl]}]}),new _e("formatUnderlinedDoubleToggle",K,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new _e("formatUnderlinedAccountingToggle",K,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new _e("formatUnderlinedAccountingDoubleToggle",K,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new _e("formatStrikeThroughToggle",K,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[we.Ctrl]}}),new _e("formatSuperscriptToggle",K,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new _e("formatSubscriptToggle",K,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new _e("formatAlignTopToggle",K,{label:"Align Top",description:"Align text to the top."}),new _e("formatTextOverflowVisibleToggle",K,{label:"Overflow Text",description:"Overflow text to the next cells."}),new _e("formatTextOverflowWrapToggle",K,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new _e("formatTextOverflowClipToggle",K,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new _e("formatTextOverflowShrinkToggle",K,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new _e("formatTextOverflowEllipsisToggle",K,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new _e("formatAlignMiddleToggle",K,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new _e("formatAlignBottomToggle",K,{label:"Align Bottom",description:"Align text to the bottom."}),new _e("formatAlignJustifyVerticalToggle",K,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new _e("formatAlignDistributedVerticalToggle",K,{label:"Distribute Vertically",description:"Justify your content vertically."}),new _e("formatAlignLeftToggle",K,{label:"Align Left",description:"Align your content to the left."}),new _e("formatAlignCenterToggle",K,{label:"Align Center",description:"Center your content."}),new _e("formatAlignRightToggle",K,{label:"Align Right",description:"Align your content to the right."}),new _e("formatAlignJustifyToggle",K,{label:"Align Justify",description:"Justify your content."}),new _e("formatAlignCenterContinuousToggle",K,{label:"Center Across",description:"Center your content across multiple cells."}),new _e("formatAlignFillToggle",K,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new _e("formatAlignDistributedHorizontalToggle",K,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new ft("formatFontSizeIncrease",K,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,pe=>({font:{size:Qu(pe.getFont().getSize(),!0)}}))}),new ft("formatFontSizeDecrease",K,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,pe=>({font:{size:Qu(pe.getFont().getSize(),!1)}}))}),new _e("formatFontFamily",K,{label:"Font",description:"Select the font your text."},function(pe){Pt(this,{font:{family:pe}})}),new _e("formatFontSize",K,{label:"Font Size",description:"Change the size of your text."},function(pe){Pt(this,{font:{size:pe}})}),new _e("formatNumberDialog",K,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[we.Ctrl]},{key:"1",modifiers:[we.Ctrl,we.Alt]}]},function(pe,Pe){const Ge=this,Te={initialValue:pe??Pe.state(),context:Pe.context(),onInputOption:(Je,nt)=>{Pt(Ge,{numberFormat:Je})}};ue.showWindow?.("numberFormat",Te)}),new _e("formatNumberFormat",K,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(pe){Pt(this,{numberFormat:pe})}),new _e("formatNumberFormatGeneralStyle",K,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:N.NumberFormat.Type.General})}),new _e("formatNumberFormatNumberStyle",K,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:"#,##0.00"})}),new _e("formatNumberFormatTimeStyle",K,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:"h:mm AM/PM"})}),new _e("formatNumberFormatDateStyle",K,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:"d-mmm-yy"})}),new _e("formatNumberFormatAccountingStyle",K,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[we.Ctrl,we.Shift]}},function(pe){Pt(this,{numberFormat:pe??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new _e("formatNumberFormatPercentStyle",K,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:"0%"})}),new _e("formatNumberFormatScientificStyle",K,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[we.Ctrl,we.Shift]}},function(){Pt(this,{numberFormat:"0.00E+00"})}),new _e("formatNumberFormatCommaStyle",K,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[we.Ctrl]}},function(){Pt(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new _e("formatNumberFormatIncreaseDecimal",K,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){Pt(this,pe=>({numberFormat:N.NumberFormat.Parser.adjustDecimalPlaces(pe.getNumberFormat(),1)}))}),new _e("formatNumberFormatDecreaseDecimal",K,{label:"Decrease Decimal",description:"Show few decimal places."},function(){Pt(this,pe=>({numberFormat:N.NumberFormat.Parser.adjustDecimalPlaces(pe.getNumberFormat(),-1)}))}),new _e("displayPlaceholdersToggle",K,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[we.Ctrl]}}),new ft("noOp",K,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[we.Ctrl]}},function(){}),new _e("displayOutlineSymbolsToggle",K,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[we.Ctrl]}}),new _e("hideRows",K,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[we.Ctrl]}}),new _e("unhideRows",K,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[we.Ctrl,we.Shift]}}),new _e("hideColumns",K,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[we.Ctrl]},{key:"0",modifiers:[we.Ctrl,we.Alt]}]}),new _e("unhideColumns",K,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[we.Ctrl,we.Shift]}}),new _e("quickFormulaSum",K,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[we.Alt]}},function(){Ea(this,"SUM")}),new _e("quickFormulaAverage",K,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){Ea(this,"AVERAGE")}),new _e("quickFormulaCount",K,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){Ea(this,"COUNT")}),new _e("quickFormulaMax",K,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){Ea(this,"MAX")}),new _e("quickFormulaMin",K,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){Ea(this,"MIN")}),new _e("startEditCurrentTime",K,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[we.Ctrl,we.Shift]}},function(){At?.({text:ce.createTemporaryCell({value:$l(),style:{numberFormat:"Medium Time"}}).toText()})}),new _e("startEditCurrentDate",K,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[we.Ctrl]}},function(){At?.({text:ce.createTemporaryCell({value:$l(),style:{numberFormat:"Short Date"}}).toText()})}),new ft("sheetZoomOut",K,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[we.Ctrl,we.Alt]},{key:"NumpadSubtract",modifiers:[we.Ctrl,we.Alt]}]}),new ft("sheetZoomIn",K,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[we.Ctrl,we.Alt]},{key:"NumpadAdd",modifiers:[we.Ctrl,we.Alt]}]}),new ft("sheetZoom100",K,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[we.Ctrl,we.Alt]}}),new _e("insertFunction",K,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[we.Shift]}},function(pe,Pe){console.log("insertFunction")}),new _e("updateHyperlink",K,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>Ro,shortcut:[{key:"K",modifiers:[we.Ctrl]},{key:"K",modifiers:[we.Ctrl,we.Alt]}]},async function(pe,Pe){const Ge=this,Te={context:Pe.context(),onUpdateHyperlink:(Je,nt)=>{F5(Ge,Je,nt)}};ue.showWindow?.("hyperlink",Te)}),new _e("openHyperlink",K,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[we.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>Ro},async(pe,Pe)=>{const Ge=Pe.context()();if(!Ge)return;const Te=Ge.getHyperlink();if(Te)try{await Te.open()}catch(Je){ue?.showError?.(Je)}}),new _e("deleteHyperlink",K,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>Ro},function(pe,Pe){F5(this,null,null)}),new ft("insertNote",K,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[we.Shift]},description:"Add a note to the cell."},(pe,Pe)=>{((Ge,Te)=>{Ge?.showMessage?.(l.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[Te," is not yet implemented.",l.jsx("br",{}),l.jsx("br",{}),"Please see the ",l.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(ue,Pe.label())}),new _e("updateComments",K,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[we.Ctrl,we.Alt]},description:"Add a comment to the current cell.",context:()=>Ro},async function(pe,Pe){const Ge=this,Te={context:Pe.context(),onUpdateComments:Je=>{z5(Ge,Je)}};ue.showWindow?.("comments",Te)}),new _e("deleteComments",K,{label:"Delete Comments",description:"Remove any comments.",context:()=>Ro},function(pe,Pe){z5(this,null)}),new _e("insertImageFromFile",K,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(pe=null){let Pe=null,Ge=null;typeof pe=="string"?Ge=pe:Pe=pe?.file?pe.file:pe,(Pe||(Pe=await zt.openFileDialog(Ge??"image/*"),Pe))&&await $5(this,{file:Pe},pe?.options)}),new _e("insertImageFromURL",K,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(pe){if(!pe){const Pe=await ue?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(Pe.option!=="Insert")return;pe=Pe.input}pe&&$5(this,{fetch:pe})}),new ft("insertTable",K,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[we.Ctrl]},{key:"T",modifiers:[we.Alt,we.Ctrl]}]},function(){cs(this)}),new _e("editTable",K,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(pe){let Pe=null,Ge=!1;pe.isITable?Pe=pe:pe.getValue()&&(Pe=pe.getValue(),Ge=!0),Jg(this,Pe,Ge)}),new _e("deleteTable",K,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
65
65
|
|
|
@@ -73,19 +73,19 @@ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[we.C
|
|
|
73
73
|
To pick up a draggable item, press the space bar.
|
|
74
74
|
While dragging, use the arrow keys to move the item.
|
|
75
75
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
76
|
-
`},P_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function F_(e){let{announcements:t=P_,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=A_}=e;const{announce:i,announcement:a}=function(){const[m,h]=s.useState("");return{announce:s.useCallback(g=>{g!=null&&h(g)},[]),announcement:m}}(),d=Wl("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),function(m){const h=s.useContext(tf);s.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(m)},[m,h])}(s.useMemo(()=>({onDragStart(m){let{active:h}=m;i(t.onDragStart({active:h}))},onDragMove(m){let{active:h,over:g}=m;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(m){let{active:h,over:g}=m;i(t.onDragOver({active:h,over:g}))},onDragEnd(m){let{active:h,over:g}=m;i(t.onDragEnd({active:h,over:g}))},onDragCancel(m){let{active:h,over:g}=m;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const p=s.createElement(s.Fragment,null,s.createElement(L_,{id:o,value:r.draggable}),s.createElement(O_,{id:d,announcement:a}));return n?uo.createPortal(p,n):p}var To;function nc(){}function Ad(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(To||(To={}));const Zr=Object.freeze({x:0,y:0});function nf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function z_(e,t){const n=tc(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function of(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function B_(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function y8(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function rf(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function b8(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const N_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=b8(t,t.left,t.top),i=[];for(const a of o){const{id:d}=a,c=n.get(d);if(c){const u=nf(b8(c),r);i.push({id:d,data:{droppableContainer:a,value:u}})}}return i.sort(of)};function V_(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-o,d=i-n;if(o<r&&n<i){const c=t.width*t.height,u=e.width*e.height,p=a*d;return Number((p/(c+u-p)).toFixed(4))}return 0}const H_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:a}=i,d=n.get(a);if(d){const c=V_(d,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(B_)};function w8(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zr}const $_=function(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...t})}}(1);function af(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const W_={ignoreTransform:!1};function Ca(e,t){t===void 0&&(t=W_);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:p}=er(e).getComputedStyle(e);u&&(n=function(m,h,g){const f=af(h);if(!f)return m;const{scaleX:x,scaleY:y,x:w,y:b}=f,C=m.left-w-(1-x)*parseFloat(g),k=m.top-b-(1-y)*parseFloat(g.slice(g.indexOf(" ")+1)),E=x?m.width/x:m.width,M=y?m.height/y:m.height;return{width:E,height:M,top:k,right:C+E,bottom:k+M,left:C}}(n,u,p))}const{top:o,left:r,width:i,height:a,bottom:d,right:c}=n;return{top:o,left:r,width:i,height:a,bottom:d,right:c}}function v8(e){return Ca(e,{ignoreTransform:!0})}function Rc(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(t5(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!rs(r)||Qm(r)||n.includes(r))return n;const i=er(e).getComputedStyle(r);return r!==e&&function(a,d){d===void 0&&(d=er(a).getComputedStyle(a));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const p=d[u];return typeof p=="string"&&c.test(p)})}(r,i)&&n.push(r),function(a,d){return d===void 0&&(d=er(a).getComputedStyle(a)),d.position==="fixed"}(r,i)?n:o(r.parentNode)}(e):n}function lf(e){const[t]=Rc(e,1);return t??null}function Pd(e){return Tc&&e?Sa(e)?e:e5(e)?t5(e)||e===ga(e).scrollingElement?window:rs(e)?e:null:null:null}function sf(e){return Sa(e)?e.scrollX:e.scrollLeft}function cf(e){return Sa(e)?e.scrollY:e.scrollTop}function e2(e){return{x:sf(e),y:cf(e)}}var Do;function df(e){return!(!Tc||!e)&&e===document.scrollingElement}function uf(e){const t={x:0,y:0},n=df(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Do||(Do={}));const U_={x:.2,y:.2};function q_(e,t,n,o,r){let{top:i,left:a,right:d,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=U_);const{isTop:u,isBottom:p,isLeft:m,isRight:h}=uf(e),g={x:0,y:0},f={x:0,y:0},x=t.height*r.y,y=t.width*r.x;return!u&&i<=t.top+x?(g.y=Do.Backward,f.y=o*Math.abs((t.top+x-i)/x)):!p&&c>=t.bottom-x&&(g.y=Do.Forward,f.y=o*Math.abs((t.bottom-x-c)/x)),!h&&d>=t.right-y?(g.x=Do.Forward,f.x=o*Math.abs((t.right-y-d)/y)):!m&&a<=t.left+y&&(g.x=Do.Backward,f.x=o*Math.abs((t.left+y-a)/y)),{direction:g,speed:f}}function Z_(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function pf(e){return e.reduce((t,n)=>Yi(t,e2(n)),Zr)}function hf(e,t){if(t===void 0&&(t=Ca),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);lf(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const G_=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+sf(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+cf(n),0)}]];class t2{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Rc(n),r=pf(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,d]of G_)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=d(o),p=r[i]-u;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cl{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function Fd(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Tr,Sn;function S8(e){e.preventDefault()}function K_(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tr||(Tr={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Sn||(Sn={}));const mf={start:[Sn.Space,Sn.Enter],cancel:[Sn.Esc],end:[Sn.Space,Sn.Enter,Sn.Tab]},X_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Sn.Right:return{...n,x:n.x+25};case Sn.Left:return{...n,x:n.x-25};case Sn.Down:return{...n,y:n.y+25};case Sn.Up:return{...n,y:n.y-25}}};class n5{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Cl(ga(n)),this.windowListeners=new Cl(er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&hf(o),n(Zr)}handleKeyDown(t){if(Mc(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=mf,coordinateGetter:a=X_,scrollBehavior:d="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:u}=o.current,p=u?{x:u.left,y:u.top}:Zr;this.referenceCoordinates||(this.referenceCoordinates=p);const m=a(t,{active:n,context:o.current,currentCoordinates:p});if(m){const h=Ul(m,p),g={x:0,y:0},{scrollableAncestors:f}=o.current;for(const x of f){const y=t.code,{isTop:w,isRight:b,isLeft:C,isBottom:k,maxScroll:E,minScroll:M}=uf(x),T=Z_(x),F={x:Math.min(y===Sn.Right?T.right-T.width/2:T.right,Math.max(y===Sn.Right?T.left:T.left+T.width/2,m.x)),y:Math.min(y===Sn.Down?T.bottom-T.height/2:T.bottom,Math.max(y===Sn.Down?T.top:T.top+T.height/2,m.y))},_=y===Sn.Right&&!b||y===Sn.Left&&!C,O=y===Sn.Down&&!k||y===Sn.Up&&!w;if(_&&F.x!==m.x){const S=x.scrollLeft+h.x,v=y===Sn.Right&&S<=E.x||y===Sn.Left&&S>=M.x;if(v&&!h.y)return void x.scrollTo({left:S,behavior:d});g.x=v?x.scrollLeft-S:y===Sn.Right?x.scrollLeft-E.x:x.scrollLeft-M.x,g.x&&x.scrollBy({left:-g.x,behavior:d});break}if(O&&F.y!==m.y){const S=x.scrollTop+h.y,v=y===Sn.Down&&S<=E.y||y===Sn.Up&&S>=M.y;if(v&&!h.x)return void x.scrollTo({top:S,behavior:d});g.y=v?x.scrollTop-S:y===Sn.Down?x.scrollTop-E.y:x.scrollTop-M.y,g.y&&x.scrollBy({top:-g.y,behavior:d});break}}this.handleMove(t,Yi(Ul(m,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function C8(e){return!(!e||!("distance"in e))}function k8(e){return!(!e||!("delay"in e))}n5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=mf,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const d=i.activatorNode.current;return!(d&&e.target!==d||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class o5{constructor(t,n,o){var r;o===void 0&&(o=function(d){const{EventTarget:c}=er(d);return d instanceof c?d:ga(d)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=ga(a),this.documentListeners=new Cl(this.document),this.listeners=new Cl(o),this.windowListeners=new Cl(er(a)),this.initialCoordinates=(r=tc(i))!=null?r:Zr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.DragStart,S8),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),this.windowListeners.add(Tr.ContextMenu,S8),this.documentListeners.add(Tr.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(k8(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(C8(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tr.Click,K_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:d}}=i;if(!r)return;const c=(n=tc(t))!=null?n:Zr,u=Ul(r,c);if(!o&&d){if(C8(d)){if(d.tolerance!=null&&Fd(u,d.tolerance))return this.handleCancel();if(Fd(u,d.distance))return this.handleStart()}return k8(d)&&Fd(u,d.tolerance)?this.handleCancel():void this.handlePending(d,u)}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Sn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Y_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ff extends o5{constructor(t){const{event:n}=t,o=ga(n.target);super(t,Y_,o)}}ff.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const J_={move:{name:"mousemove"},end:{name:"mouseup"}};var n2;(function(e){e[e.RightClick=2]="RightClick"})(n2||(n2={}));class gf extends o5{constructor(t){super(t,J_,ga(t.event.target))}}gf.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==n2.RightClick&&(o?.({event:n}),!0)}}];const zd={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xf extends o5{constructor(t){super(t,zd)}static setup(){return window.addEventListener(zd.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zd.move.name,t)};function t(){}}}var kl,oc;xf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(kl||(kl={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(oc||(oc={}));const Q_={x:{[Do.Backward]:!1,[Do.Forward]:!1},y:{[Do.Backward]:!1,[Do.Forward]:!1}};var ql,o2;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ql||(ql={})),(o2||(o2={})).Optimized="optimized";const E8=new Map;function r2(e,t){return ml(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rc(e){let{callback:t,disabled:n}=e;const o=jc(t),r=s.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return s.useEffect(()=>()=>r?.disconnect(),[r]),r}function eT(e){return new t2(Ca(e),e)}function _8(e,t,n){t===void 0&&(t=eT);const[o,r]=s.useState(null);function i(){r(c=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=c??n)!=null?u:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const a=function(c){let{callback:u,disabled:p}=c;const m=jc(u),h=s.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:g}=window;return new g(m)},[m,p]);return s.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const u of c){const{type:p,target:m}=u;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){i();break}}}}),d=rc({callback:i});return Ur(()=>{i(),e?(d?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),a?.disconnect())},[e]),o}const T8=[];function j8(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const o=e!==Zr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Ul(e,n.current):Zr}function M8(e){return s.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const R8=[];function yf(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return rs(t)?t:e}const tT=[{sensor:ff,options:{}},{sensor:n5,options:{}}],nT={current:{}},S1={draggable:{measure:v8},droppable:{measure:v8,strategy:ql.WhileDragging,frequency:o2.Optimized},dragOverlay:{measure:Ca}};class El extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const oT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new El,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:S1,measureDroppableContainers:nc,windowRect:null,measuringScheduled:!1},bf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nc,draggableNodes:new Map,over:null,measureDroppableContainers:nc},Zl=s.createContext(bf),wf=s.createContext(oT);function rT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new El}}}function iT(e,t){switch(t.type){case To.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case To.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case To.DragEnd:case To.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case To.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new El(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case To.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new El(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case To.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new El(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function aT(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=s.useContext(Zl),i=ec(o),a=ec(n?.id);return s.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!Mc(i)||document.activeElement===i.target)return;const d=r.get(a);if(!d)return;const{activatorNode:c,node:u}=d;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const p of[c.current,u.current]){if(!p)continue;const m=I_(p);if(m){m.focus();break}}})}},[o,t,r,a,i]),null}function vf(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const Ic=s.createContext({...Zr,scaleX:1,scaleY:1});var P0;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(P0||(P0={}));const lT=s.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:d=!0,children:c,sensors:u=tT,collisionDetection:p=H_,measuring:m,modifiers:h,...g}=e;const f=s.useReducer(iT,void 0,rT),[x,y]=f,[w,b]=function(){const[ie]=s.useState(()=>new Set),Ee=s.useCallback(Le=>(ie.add(Le),()=>ie.delete(Le)),[ie]);return[s.useCallback(Le=>{let{type:qe,event:ht}=Le;ie.forEach(ot=>{var We;return(We=ot[qe])==null?void 0:We.call(ot,ht)})},[ie]),Ee]}(),[C,k]=s.useState(P0.Uninitialized),E=C===P0.Initialized,{draggable:{active:M,nodes:T,translate:F},droppable:{containers:_}}=x,O=M!=null?T.get(M):null,S=s.useRef({initial:null,translated:null}),v=s.useMemo(()=>{var ie;return M!=null?{id:M,data:(ie=O?.data)!=null?ie:nT,rect:S}:null},[M,O]),D=s.useRef(null),[j,R]=s.useState(null),[P,I]=s.useState(null),L=Sl(g,Object.values(g)),H=Wl("DndDescribedBy",i),W=s.useMemo(()=>_.getEnabled(),[_]),A=s.useMemo(()=>({draggable:{...S1.draggable,...U?.draggable},droppable:{...S1.droppable,...U?.droppable},dragOverlay:{...S1.dragOverlay,...U?.dragOverlay}}),[(U=m)==null?void 0:U.draggable,U?.droppable,U?.dragOverlay]);var U;const{droppableRects:X,measureDroppableContainers:ee,measuringScheduled:V}=function(ie,Ee){let{dragging:Le,dependencies:qe,config:ht}=Ee;const[ot,We]=s.useState(null),{frequency:st,measure:Xe,strategy:Qe}=ht,kt=s.useRef(ie),Vt=function(){switch(Qe){case ql.Always:return!1;case ql.BeforeDragging:return Le;default:return!Le}}(),ct=Sl(Vt),Ut=s.useCallback(function(xn){xn===void 0&&(xn=[]),ct.current||We(En=>En===null?xn:En.concat(xn.filter(Vn=>!En.includes(Vn))))},[ct]),Qt=s.useRef(null),an=ml(xn=>{if(Vt&&!Le)return E8;if(!xn||xn===E8||kt.current!==ie||ot!=null){const En=new Map;for(let Vn of ie){if(!Vn)continue;if(ot&&ot.length>0&&!ot.includes(Vn.id)&&Vn.rect.current){En.set(Vn.id,Vn.rect.current);continue}const oo=Vn.node.current,po=oo?new t2(Xe(oo),oo):null;Vn.rect.current=po,po&&En.set(Vn.id,po)}return En}return xn},[ie,ot,Le,Vt,Xe]);return s.useEffect(()=>{kt.current=ie},[ie]),s.useEffect(()=>{Vt||Ut()},[Le,Vt]),s.useEffect(()=>{ot&&ot.length>0&&We(null)},[JSON.stringify(ot)]),s.useEffect(()=>{Vt||typeof st!="number"||Qt.current!==null||(Qt.current=setTimeout(()=>{Ut(),Qt.current=null},st))},[st,Vt,Ut,...qe]),{droppableRects:an,measureDroppableContainers:Ut,measuringScheduled:ot!=null}}(W,{dragging:E,dependencies:[F.x,F.y],config:A.droppable}),$=function(ie,Ee){const Le=Ee!=null?ie.get(Ee):void 0,qe=Le?Le.node.current:null;return ml(ht=>{var ot;return Ee==null?null:(ot=qe??ht)!=null?ot:null},[qe,Ee])}(T,M),z=s.useMemo(()=>P?tc(P):null,[P]),q=function(){const ie=j?.autoScrollEnabled===!1,Ee=typeof d=="object"?d.enabled===!1:d===!1,Le=E&&!ie&&!Ee;return typeof d=="object"?{...d,enabled:Le}:{enabled:Le}}(),G=function(ie,Ee){return r2(ie,Ee)}($,A.draggable.measure);(function(ie){let{activeNode:Ee,measure:Le,initialRect:qe,config:ht=!0}=ie;const ot=s.useRef(!1),{x:We,y:st}=typeof ht=="boolean"?{x:ht,y:ht}:ht;Ur(()=>{if(!We&&!st||!Ee)return void(ot.current=!1);if(ot.current||!qe)return;const Xe=Ee?.node.current;if(!Xe||Xe.isConnected===!1)return;const Qe=w8(Le(Xe),qe);if(We||(Qe.x=0),st||(Qe.y=0),ot.current=!0,Math.abs(Qe.x)>0||Math.abs(Qe.y)>0){const kt=lf(Xe);kt&&kt.scrollBy({top:Qe.y,left:Qe.x})}},[Ee,We,st,qe,Le])})({activeNode:M!=null?T.get(M):null,config:q.layoutShiftCompensation,initialRect:G,measure:A.draggable.measure});const Q=_8($,A.draggable.measure,G),Y=_8($?$.parentElement:null),te=s.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=_.getNodeFor((t=te.current.over)==null?void 0:t.id),ge=function(ie){let{measure:Ee}=ie;const[Le,qe]=s.useState(null),ht=rc({callback:s.useCallback(Xe=>{for(const{target:Qe}of Xe)if(rs(Qe)){qe(kt=>{const Vt=Ee(Qe);return kt?{...kt,width:Vt.width,height:Vt.height}:Vt});break}},[Ee])}),ot=s.useCallback(Xe=>{const Qe=yf(Xe);ht?.disconnect(),Qe&&ht?.observe(Qe),qe(Qe?Ee(Qe):null)},[Ee,ht]),[We,st]=v1(ot);return s.useMemo(()=>({nodeRef:We,rect:Le,setRef:st}),[Le,We,st])}({measure:A.dragOverlay.measure}),J=(n=ge.nodeRef.current)!=null?n:$,se=E?(o=ge.rect)!=null?o:Q:null,Se=!(!ge.nodeRef.current||!ge.rect),Me=w8(oe=Se?null:Q,r2(oe));var oe;const ne=M8(J?er(J):null),he=function(ie){const Ee=s.useRef(ie),Le=ml(qe=>ie?qe&&qe!==T8&&ie&&Ee.current&&ie.parentNode===Ee.current.parentNode?qe:Rc(ie):T8,[ie]);return s.useEffect(()=>{Ee.current=ie},[ie]),Le}(E?re??$:null),ze=function(ie,Ee){Ee===void 0&&(Ee=Ca);const[Le]=ie,qe=M8(Le?er(Le):null),[ht,ot]=s.useState(R8);function We(){ot(()=>ie.length?ie.map(Xe=>df(Xe)?qe:new t2(Ee(Xe),Xe)):R8)}const st=rc({callback:We});return Ur(()=>{st?.disconnect(),We(),ie.forEach(Xe=>st?.observe(Xe))},[ie]),ht}(he),Ne=vf(h,{transform:{x:F.x-Me.x,y:F.y-Me.y,scaleX:1,scaleY:1},activatorEvent:P,active:v,activeNodeRect:Q,containerNodeRect:Y,draggingNodeRect:se,over:te.current.over,overlayNodeRect:ge.rect,scrollableAncestors:he,scrollableAncestorRects:ze,windowRect:ne}),gt=z?Yi(z,F):null,bt=function(ie){const[Ee,Le]=s.useState(null),qe=s.useRef(ie),ht=s.useCallback(ot=>{const We=Pd(ot.target);We&&Le(st=>st?(st.set(We,e2(We)),new Map(st)):null)},[]);return s.useEffect(()=>{const ot=qe.current;if(ie!==ot){We(ot);const st=ie.map(Xe=>{const Qe=Pd(Xe);return Qe?(Qe.addEventListener("scroll",ht,{passive:!0}),[Qe,e2(Qe)]):null}).filter(Xe=>Xe!=null);Le(st.length?new Map(st):null),qe.current=ie}return()=>{We(ie),We(ot)};function We(st){st.forEach(Xe=>{Pd(Xe)?.removeEventListener("scroll",ht)})}},[ht,ie]),s.useMemo(()=>ie.length?Ee?Array.from(Ee.values()).reduce((ot,We)=>Yi(ot,We),Zr):pf(ie):Zr,[ie,Ee])}(he),ke=j8(bt),pt=j8(bt,[Q]),xt=Yi(Ne,ke),Ve=se?$_(se,Ne):null,wt=v&&Ve?p({active:v,collisionRect:Ve,droppableRects:X,droppableContainers:W,pointerCoordinates:gt}):null,Ye=rf(wt,"id"),[ae,Ue]=s.useState(null),ye=function(ie,Ee,Le){return{...ie,scaleX:Ee&&Le?Ee.width/Le.width:1,scaleY:Ee&&Le?Ee.height/Le.height:1}}(Se?Ne:Yi(Ne,pt),(r=ae?.rect)!=null?r:null,Q),ve=s.useRef(null),le=s.useCallback((ie,Ee)=>{let{sensor:Le,options:qe}=Ee;if(D.current==null)return;const ht=T.get(D.current);if(!ht)return;const ot=ie.nativeEvent,We=new Le({active:D.current,activeNode:ht,event:ot,options:qe,context:te,onAbort(Xe){if(!T.get(Xe))return;const{onDragAbort:Qe}=L.current,kt={id:Xe};Qe?.(kt),w({type:"onDragAbort",event:kt})},onPending(Xe,Qe,kt,Vt){if(!T.get(Xe))return;const{onDragPending:ct}=L.current,Ut={id:Xe,constraint:Qe,initialCoordinates:kt,offset:Vt};ct?.(Ut),w({type:"onDragPending",event:Ut})},onStart(Xe){const Qe=D.current;if(Qe==null)return;const kt=T.get(Qe);if(!kt)return;const{onDragStart:Vt}=L.current,ct={activatorEvent:ot,active:{id:Qe,data:kt.data,rect:S}};uo.unstable_batchedUpdates(()=>{Vt?.(ct),k(P0.Initializing),y({type:To.DragStart,initialCoordinates:Xe,active:Qe}),w({type:"onDragStart",event:ct}),R(ve.current),I(ot)})},onMove(Xe){y({type:To.DragMove,coordinates:Xe})},onEnd:st(To.DragEnd),onCancel:st(To.DragCancel)});function st(Xe){return async function(){const{active:Qe,collisions:kt,over:Vt,scrollAdjustedTranslate:ct}=te.current;let Ut=null;if(Qe&&ct){const{cancelDrop:Qt}=L.current;Ut={activatorEvent:ot,active:Qe,collisions:kt,delta:ct,over:Vt},Xe===To.DragEnd&&typeof Qt=="function"&&await Promise.resolve(Qt(Ut))&&(Xe=To.DragCancel)}D.current=null,uo.unstable_batchedUpdates(()=>{y({type:Xe}),k(P0.Uninitialized),Ue(null),R(null),I(null),ve.current=null;const Qt=Xe===To.DragEnd?"onDragEnd":"onDragCancel";if(Ut){const an=L.current[Qt];an?.(Ut),w({type:Qt,event:Ut})}})}}ve.current=We},[T]),Ie=s.useCallback((ie,Ee)=>(Le,qe)=>{const ht=Le.nativeEvent,ot=T.get(qe);if(D.current!==null||!ot||ht.dndKit||ht.defaultPrevented)return;const We={active:ot};ie(Le,Ee.options,We)===!0&&(ht.dndKit={capturedBy:Ee.sensor},D.current=qe,le(Le,Ee))},[T,le]),Re=function(ie,Ee){return s.useMemo(()=>ie.reduce((Le,qe)=>{const{sensor:ht}=qe;return[...Le,...ht.activators.map(ot=>({eventName:ot.eventName,handler:Ee(ot.handler,qe)}))]},[]),[ie,Ee])}(u,Ie);(function(ie){s.useEffect(()=>{if(!Tc)return;const Ee=ie.map(Le=>{let{sensor:qe}=Le;return qe.setup==null?void 0:qe.setup()});return()=>{for(const Le of Ee)Le?.()}},ie.map(Ee=>{let{sensor:Le}=Ee;return Le}))})(u),Ur(()=>{Q&&C===P0.Initializing&&k(P0.Initialized)},[Q,C]),s.useEffect(()=>{const{onDragMove:ie}=L.current,{active:Ee,activatorEvent:Le,collisions:qe,over:ht}=te.current;if(!Ee||!Le)return;const ot={active:Ee,activatorEvent:Le,collisions:qe,delta:{x:xt.x,y:xt.y},over:ht};uo.unstable_batchedUpdates(()=>{ie?.(ot),w({type:"onDragMove",event:ot})})},[xt.x,xt.y]),s.useEffect(()=>{const{active:ie,activatorEvent:Ee,collisions:Le,droppableContainers:qe,scrollAdjustedTranslate:ht}=te.current;if(!ie||D.current==null||!Ee||!ht)return;const{onDragOver:ot}=L.current,We=qe.get(Ye),st=We&&We.rect.current?{id:We.id,rect:We.rect.current,data:We.data,disabled:We.disabled}:null,Xe={active:ie,activatorEvent:Ee,collisions:Le,delta:{x:ht.x,y:ht.y},over:st};uo.unstable_batchedUpdates(()=>{Ue(st),ot?.(Xe),w({type:"onDragOver",event:Xe})})},[Ye]),Ur(()=>{te.current={activatorEvent:P,active:v,activeNode:$,collisionRect:Ve,collisions:wt,droppableRects:X,draggableNodes:T,draggingNode:J,draggingNodeRect:se,droppableContainers:_,over:ae,scrollableAncestors:he,scrollAdjustedTranslate:xt},S.current={initial:se,translated:Ve}},[v,$,wt,Ve,T,J,se,X,_,ae,he,xt]),function(ie){let{acceleration:Ee,activator:Le=kl.Pointer,canScroll:qe,draggingRect:ht,enabled:ot,interval:We=5,order:st=oc.TreeOrder,pointerCoordinates:Xe,scrollableAncestors:Qe,scrollableAncestorRects:kt,delta:Vt,threshold:ct}=ie;const Ut=function(Bt){let{delta:Fn,disabled:Gn}=Bt;const vn=ec(Fn);return ml(Cn=>{if(Gn||!vn||!Cn)return Q_;const mn=Math.sign(Fn.x-vn.x),tr=Math.sign(Fn.y-vn.y);return{x:{[Do.Backward]:Cn.x[Do.Backward]||mn===-1,[Do.Forward]:Cn.x[Do.Forward]||mn===1},y:{[Do.Backward]:Cn.y[Do.Backward]||tr===-1,[Do.Forward]:Cn.y[Do.Forward]||tr===1}}},[Gn,Fn,vn])}({delta:Vt,disabled:!ot}),[Qt,an]=function(){const Bt=s.useRef(null);return[s.useCallback((Fn,Gn)=>{Bt.current=setInterval(Fn,Gn)},[]),s.useCallback(()=>{Bt.current!==null&&(clearInterval(Bt.current),Bt.current=null)},[])]}(),xn=s.useRef({x:0,y:0}),En=s.useRef({x:0,y:0}),Vn=s.useMemo(()=>{switch(Le){case kl.Pointer:return Xe?{top:Xe.y,bottom:Xe.y,left:Xe.x,right:Xe.x}:null;case kl.DraggableRect:return ht}},[Le,ht,Xe]),oo=s.useRef(null),po=s.useCallback(()=>{const Bt=oo.current;if(!Bt)return;const Fn=xn.current.x*En.current.x,Gn=xn.current.y*En.current.y;Bt.scrollBy(Fn,Gn)},[]),_n=s.useMemo(()=>st===oc.TreeOrder?[...Qe].reverse():Qe,[st,Qe]);s.useEffect(()=>{if(ot&&Qe.length&&Vn){for(const Bt of _n){if(qe?.(Bt)===!1)continue;const Fn=Qe.indexOf(Bt),Gn=kt[Fn];if(!Gn)continue;const{direction:vn,speed:Cn}=q_(Bt,Gn,Vn,Ee,ct);for(const mn of["x","y"])Ut[mn][vn[mn]]||(Cn[mn]=0,vn[mn]=0);if(Cn.x>0||Cn.y>0)return an(),oo.current=Bt,Qt(po,We),xn.current=Cn,void(En.current=vn)}xn.current={x:0,y:0},En.current={x:0,y:0},an()}else an()},[Ee,po,qe,an,ot,We,JSON.stringify(Vn),JSON.stringify(Ut),Qt,Qe,_n,kt,JSON.stringify(ct)])}({...q,delta:F,draggingRect:Ve,pointerCoordinates:gt,scrollableAncestors:he,scrollableAncestorRects:ze});const be=s.useMemo(()=>({active:v,activeNode:$,activeNodeRect:Q,activatorEvent:P,collisions:wt,containerNodeRect:Y,dragOverlay:ge,draggableNodes:T,droppableContainers:_,droppableRects:X,over:ae,measureDroppableContainers:ee,scrollableAncestors:he,scrollableAncestorRects:ze,measuringConfiguration:A,measuringScheduled:V,windowRect:ne}),[v,$,Q,P,wt,Y,ge,T,_,X,ae,ee,he,ze,A,V,ne]),Oe=s.useMemo(()=>({activatorEvent:P,activators:Re,active:v,activeNodeRect:Q,ariaDescribedById:{draggable:H},dispatch:y,draggableNodes:T,over:ae,measureDroppableContainers:ee}),[P,Re,v,Q,y,H,T,ae,ee]);return s.createElement(tf.Provider,{value:b},s.createElement(Zl.Provider,{value:Oe},s.createElement(wf.Provider,{value:be},s.createElement(Ic.Provider,{value:ye},c)),s.createElement(aT,{disabled:a?.restoreFocus===!1})),s.createElement(F_,{...a,hiddenTextDescribedById:H}))}),sT=s.createContext(null),I8="button";function Sf(){return s.useContext(wf)}const cT={timeout:25};function dT(e){let{animation:t,children:n}=e;const[o,r]=s.useState(null),[i,a]=s.useState(null),d=ec(n);return n||o||!d||r(d),Ur(()=>{if(!i)return;const c=o?.key,u=o?.props.id;c!=null&&u!=null?Promise.resolve(t(u,i)).then(()=>{r(null)}):r(null)},[t,o,i]),s.createElement(s.Fragment,null,n,o?s.cloneElement(o,{ref:a}):null)}const uT={x:0,y:0,scaleX:1,scaleY:1};function pT(e){let{children:t}=e;return s.createElement(Zl.Provider,{value:bf},s.createElement(Ic.Provider,{value:uT},t))}const hT={position:"fixed",touchAction:"none"},mT=e=>Mc(e)?"transform 250ms ease":void 0,fT=s.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:d,style:c,transform:u,transition:p=mT}=e;if(!d)return null;const m=r?u:{...u,scaleX:1,scaleY:1},h={...hT,width:d.width,height:d.height,top:d.top,left:d.left,transform:ki.Transform.toString(m),transformOrigin:r&&o?z_(o,d):void 0,transition:typeof p=="function"?p(o):p,...c};return s.createElement(n,{className:a,style:h,ref:t},i)}),Cf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ki.Transform.toString(t)},{transform:ki.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[d,c]of Object.entries(i.active))c!==void 0&&(r[d]=n.node.style.getPropertyValue(d),n.node.style.setProperty(d,c));if(i!=null&&i.dragOverlay)for(const[d,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(d,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&o.node.classList.add(a.dragOverlay),function(){for(const[d,c]of Object.entries(r))n.node.style.setProperty(d,c);a!=null&&a.active&&n.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};let D8=0;const gT=s.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:a,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:g,draggableNodes:f,droppableContainers:x,dragOverlay:y,over:w,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:k,windowRect:E}=Sf(),M=s.useContext(Ic),T=function(v){return s.useMemo(()=>{if(v!=null)return D8++,D8},[v])}(m?.id),F=vf(a,{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:y.rect,over:w,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:k,transform:M,windowRect:E}),_=r2(h),O=function(v){let{config:D,draggableNodes:j,droppableContainers:R,measuringConfiguration:P}=v;return jc((I,L)=>{if(D===null)return;const H=j.get(I);if(!H)return;const W=H.node.current;if(!W)return;const A=yf(L);if(!A)return;const{transform:U}=er(L).getComputedStyle(L),X=af(U);if(!X)return;const ee=typeof D=="function"?D:function(V){const{duration:$,easing:z,sideEffects:q,keyframes:G}={...Cf,...V};return Q=>{let{active:Y,dragOverlay:te,transform:re,...ge}=Q;if(!$)return;const J=te.rect.left-Y.rect.left,se=te.rect.top-Y.rect.top,Se={scaleX:re.scaleX!==1?Y.rect.width*re.scaleX/te.rect.width:1,scaleY:re.scaleY!==1?Y.rect.height*re.scaleY/te.rect.height:1},Me={x:re.x-J,y:re.y-se,...Se},oe=G({...ge,active:Y,dragOverlay:te,transform:{initial:re,final:Me}}),[ne]=oe,he=oe[oe.length-1];if(JSON.stringify(ne)===JSON.stringify(he))return;const ze=q?.({active:Y,dragOverlay:te,...ge}),Ne=te.node.animate(oe,{duration:$,easing:z,fill:"forwards"});return new Promise(gt=>{Ne.onfinish=()=>{ze?.(),gt()}})}}(D);return hf(W,P.draggable.measure),ee({active:{id:I,data:H.data,node:W,rect:P.draggable.measure(W)},draggableNodes:j,dragOverlay:{node:L,rect:P.dragOverlay.measure(A)},droppableContainers:R,measuringConfiguration:P,transform:X})})}({config:o,draggableNodes:f,droppableContainers:x,measuringConfiguration:b}),S=_?y.setRef:void 0;return s.createElement(pT,null,s.createElement(dT,{animation:O},m&&T?s.createElement(fT,{key:T,id:m.id,ref:S,as:d,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:_,style:{zIndex:u,...r},transform:F},n):null))});function r5(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function xT(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Hs(e){return e!==null&&e>=0}const $s={scaleX:1,scaleY:1},yT=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:a}=e;const d=(t=n[r])!=null?t:o;if(!d)return null;const c=function(u,p,m){const h=u[p],g=u[p-1],f=u[p+1];return h&&(g||f)?m<p?g?h.left-(g.left+g.width):f.left-(h.left+h.width):f?f.left-(h.left+h.width):h.left-(g.left+g.width):0}(n,a,r);if(a===r){const u=n[i];return u?{x:r<i?u.left+u.width-(d.left+d.width):u.left-d.left,y:0,...$s}:null}return a>r&&a<=i?{x:-d.width-c,y:0,...$s}:a<r&&a>=i?{x:d.width+c,y:0,...$s}:{x:0,y:0,...$s}},i5=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=r5(t,o,n),a=t[r],d=i[r];return d&&a?{x:d.left-a.left,y:d.top-a.top,scaleX:d.width/a.width,scaleY:d.height/a.height}:null},kf="Sortable",Ef=s.createContext({activeIndex:-1,containerId:kf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i5,disabled:{draggable:!1,droppable:!1}});function bT(e){let{children:t,id:n,items:o,strategy:r=i5,disabled:i=!1}=e;const{active:a,dragOverlay:d,droppableRects:c,over:u,measureDroppableContainers:p}=Sf(),m=Wl(kf,n),h=d.rect!==null,g=s.useMemo(()=>o.map(M=>typeof M=="object"&&"id"in M?M.id:M),[o]),f=a!=null,x=a?g.indexOf(a.id):-1,y=u?g.indexOf(u.id):-1,w=s.useRef(g),b=!function(M,T){if(M===T)return!0;if(M.length!==T.length)return!1;for(let F=0;F<M.length;F++)if(M[F]!==T[F])return!1;return!0}(g,w.current),C=y!==-1&&x===-1||b,k=function(M){return typeof M=="boolean"?{draggable:M,droppable:M}:M}(i);Ur(()=>{b&&f&&p(g)},[b,g,f,p]),s.useEffect(()=>{w.current=g},[g]);const E=s.useMemo(()=>({activeIndex:x,containerId:m,disabled:k,disableTransforms:C,items:g,overIndex:y,useDragOverlay:h,sortedRects:xT(g,c),strategy:r}),[x,m,k.draggable,k.droppable,C,g,y,c,h,r]);return s.createElement(Ef.Provider,{value:E},t)}const wT=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return r5(n,o,r).indexOf(t)},vT=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:d,previousContainerId:c,transition:u}=e;return!(!u||!o||d!==i&&r===a||!n&&(a===r||t!==c))},ST={duration:200,easing:"ease"},_f="transform",CT=ki.Transition.toString({property:_f,duration:0,easing:"linear"}),kT={roleDescription:"sortable"};function ET(e){let{animateLayoutChanges:t=vT,attributes:n,disabled:o,data:r,getNewIndex:i=wT,id:a,strategy:d,resizeObserverConfig:c,transition:u=ST}=e;const{items:p,containerId:m,activeIndex:h,disabled:g,disableTransforms:f,sortedRects:x,overIndex:y,useDragOverlay:w,strategy:b}=s.useContext(Ef),C=function(te,re){var ge,J;return typeof te=="boolean"?{draggable:te,droppable:!1}:{draggable:(ge=te?.draggable)!=null?ge:re.draggable,droppable:(J=te?.droppable)!=null?J:re.droppable}}(o,g),k=p.indexOf(a),E=s.useMemo(()=>({sortable:{containerId:m,index:k,items:p},...r}),[m,r,k,p]),M=s.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:T,node:F,isOver:_,setNodeRef:O}=function(te){let{data:re,disabled:ge=!1,id:J,resizeObserverConfig:se}=te;const Se=Wl("Droppable"),{active:Me,dispatch:oe,over:ne,measureDroppableContainers:he}=s.useContext(Zl),ze=s.useRef({disabled:ge}),Ne=s.useRef(!1),gt=s.useRef(null),bt=s.useRef(null),{disabled:ke,updateMeasurementsFor:pt,timeout:xt}={...cT,...se},Ve=Sl(pt??J),wt=rc({callback:s.useCallback(()=>{Ne.current?(bt.current!=null&&clearTimeout(bt.current),bt.current=setTimeout(()=>{he(Array.isArray(Ve.current)?Ve.current:[Ve.current]),bt.current=null},xt)):Ne.current=!0},[xt]),disabled:ke||!Me}),Ye=s.useCallback((ve,le)=>{wt&&(le&&(wt.unobserve(le),Ne.current=!1),ve&&wt.observe(ve))},[wt]),[ae,Ue]=v1(Ye),ye=Sl(re);return s.useEffect(()=>{wt&&ae.current&&(wt.disconnect(),Ne.current=!1,wt.observe(ae.current))},[ae,wt]),s.useEffect(()=>(oe({type:To.RegisterDroppable,element:{id:J,key:Se,disabled:ge,node:ae,rect:gt,data:ye}}),()=>oe({type:To.UnregisterDroppable,key:Se,id:J})),[J]),s.useEffect(()=>{ge!==ze.current.disabled&&(oe({type:To.SetDroppableDisabled,id:J,key:Se,disabled:ge}),ze.current.disabled=ge)},[J,Se,ge,oe]),{active:Me,rect:gt,isOver:ne?.id===J,node:ae,over:ne,setNodeRef:Ue}}({id:a,data:E,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...c}}),{active:S,activatorEvent:v,activeNodeRect:D,attributes:j,setNodeRef:R,listeners:P,isDragging:I,over:L,setActivatorNodeRef:H,transform:W}=function(te){let{id:re,data:ge,disabled:J=!1,attributes:se}=te;const Se=Wl("Draggable"),{activators:Me,activatorEvent:oe,active:ne,activeNodeRect:he,ariaDescribedById:ze,draggableNodes:Ne,over:gt}=s.useContext(Zl),{role:bt=I8,roleDescription:ke="draggable",tabIndex:pt=0}=se??{},xt=ne?.id===re,Ve=s.useContext(xt?Ic:sT),[wt,Ye]=v1(),[ae,Ue]=v1(),ye=function(le,Ie){return s.useMemo(()=>le.reduce((Re,be)=>{let{eventName:Oe,handler:ie}=be;return Re[Oe]=Ee=>{ie(Ee,Ie)},Re},{}),[le,Ie])}(Me,re),ve=Sl(ge);return Ur(()=>(Ne.set(re,{id:re,key:Se,node:wt,activatorNode:ae,data:ve}),()=>{const le=Ne.get(re);le&&le.key===Se&&Ne.delete(re)}),[Ne,re]),{active:ne,activatorEvent:oe,activeNodeRect:he,attributes:s.useMemo(()=>({role:bt,tabIndex:pt,"aria-disabled":J,"aria-pressed":!(!xt||bt!==I8)||void 0,"aria-roledescription":ke,"aria-describedby":ze.draggable}),[J,bt,pt,xt,ke,ze.draggable]),isDragging:xt,listeners:J?void 0:ye,node:wt,over:gt,setNodeRef:Ye,setActivatorNodeRef:Ue,transform:Ve}}({id:a,data:E,attributes:{...kT,...n},disabled:C.draggable}),A=function(){for(var te=arguments.length,re=new Array(te),ge=0;ge<te;ge++)re[ge]=arguments[ge];return s.useMemo(()=>J=>{re.forEach(se=>se(J))},re)}(O,R),U=!!S,X=U&&!f&&Hs(h)&&Hs(y),ee=!w&&I,V=X?(ee&&X?W:null)??(d??b)({rects:x,activeNodeRect:D,activeIndex:h,overIndex:y,index:k}):null,$=Hs(h)&&Hs(y)?i({id:a,items:p,activeIndex:h,overIndex:y}):k,z=S?.id,q=s.useRef({activeId:z,items:p,newIndex:$,containerId:m}),G=p!==q.current.items,Q=t({active:S,containerId:m,isDragging:I,isSorting:U,id:a,index:k,items:p,newIndex:q.current.newIndex,previousItems:q.current.items,previousContainerId:q.current.containerId,transition:u,wasDragging:q.current.activeId!=null}),Y=function(te){let{disabled:re,index:ge,node:J,rect:se}=te;const[Se,Me]=s.useState(null),oe=s.useRef(ge);return Ur(()=>{if(!re&&ge!==oe.current&&J.current){const ne=se.current;if(ne){const he=Ca(J.current,{ignoreTransform:!0}),ze={x:ne.left-he.left,y:ne.top-he.top,scaleX:ne.width/he.width,scaleY:ne.height/he.height};(ze.x||ze.y)&&Me(ze)}}ge!==oe.current&&(oe.current=ge)},[re,ge,J,se]),s.useEffect(()=>{Se&&Me(null)},[Se]),Se}({disabled:!Q,index:k,node:F,rect:T});return s.useEffect(()=>{U&&q.current.newIndex!==$&&(q.current.newIndex=$),m!==q.current.containerId&&(q.current.containerId=m),p!==q.current.items&&(q.current.items=p)},[U,$,m,p]),s.useEffect(()=>{if(z===q.current.activeId)return;if(z!=null&&q.current.activeId==null)return void(q.current.activeId=z);const te=setTimeout(()=>{q.current.activeId=z},50);return()=>clearTimeout(te)},[z]),{active:S,activeIndex:h,attributes:j,data:E,rect:T,index:k,newIndex:$,items:p,isOver:_,isSorting:U,isDragging:I,listeners:P,node:F,overIndex:y,over:L,setNodeRef:A,setActivatorNodeRef:H,setDroppableNodeRef:O,setDraggableNodeRef:R,transform:Y??V,transition:Y||G&&q.current.newIndex===k?CT:ee&&!Mc(v)||!u||!U&&!Q?void 0:ki.Transition.toString({...u,property:_f})}}function ic(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _T=[Sn.Down,Sn.Right,Sn.Up,Sn.Left],TT=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:d}}=t;if(_T.includes(e.code)){if(e.preventDefault(),!n||!o)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const h=r.get(m.id);if(h)switch(e.code){case Sn.Down:o.top<h.top&&c.push(m);break;case Sn.Up:o.top>h.top&&c.push(m);break;case Sn.Left:o.left>h.left&&c.push(m);break;case Sn.Right:o.left<h.left&&c.push(m)}});const u=(m=>{let{collisionRect:h,droppableRects:g,droppableContainers:f}=m;const x=y8(h),y=[];for(const w of f){const{id:b}=w,C=g.get(b);if(C){const k=y8(C),E=x.reduce((T,F,_)=>T+nf(k[_],F),0),M=Number((E/4).toFixed(4));y.push({id:b,data:{droppableContainer:w,value:M}})}}return y.sort(of)})({collisionRect:o,droppableRects:r,droppableContainers:c});let p=rf(u,"id");if(p===a?.id&&u.length>1&&(p=u[1].id),p!=null){const m=i.get(n.id),h=i.get(p),g=h?r.get(h.id):null,f=h?.node.current;if(f&&g&&m&&h){const x=Rc(f).some((k,E)=>d[E]!==k),y=L8(m,h),w=function(k,E){return!!(ic(k)&&ic(E)&&L8(k,E))&&k.data.current.sortable.index<E.data.current.sortable.index}(m,h),b=x||!y?{x:0,y:0}:{x:w?o.width-g.width:0,y:w?o.height-g.height:0},C={x:g.left,y:g.top};return b.x&&b.y?C:Ul(C,b)}}}};function L8(e,t){return!(!ic(e)||!ic(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const jT=e=>{let{transform:t}=e;return{...t,y:0}},MT=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:a,editable:d,selectedIndex:c,background:u,activeColor:p,borderColor:m,borderWidth:h,dragging:g,...f}=e;return l.jsxs("div",{ref:t,className:sr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...f,children:[l.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[l.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?l.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):l.jsx(l.Fragment,{})]}),l.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Hr={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},Tf=s.memo(s.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:a,index:d,listeners:c,onRemove:u,renderItem:p,sorting:m,style:h,transition:g,transform:f,value:x,wrapperStyle:y,...w},b)=>{s.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const C=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!m,index:d,fadeIn:!!r,listeners:c,ref:b,style:h,transform:f,transition:g,value:x}):l.jsx(l.Fragment,{children:x});return l.jsx("div",{className:sr("tab-item",Hr.Wrapper,r&&Hr.fadeIn,m&&Hr.sorting,t&&Hr.dragOverlay),style:{...y,transition:[g,y?.transition].filter(Boolean).join(", "),"--translate-x":f?`${Math.round(f.x)}px`:void 0,"--translate-y":f?`${Math.round(f.y)}px`:void 0,"--scale-x":f?.scaleX?`${f.scaleX}`:void 0,"--scale-y":f?.scaleY?`${f.scaleY}`:void 0,"--index":d},ref:b,children:l.jsx("div",{className:sr(Hr.Item,n&&Hr.dragging,i&&Hr.withHandle,t&&Hr.dragOverlay,o&&Hr.disabled,e&&Hr.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...w,tabIndex:i?void 0:-1,children:C})})})),O8={Row:"_Row_1kr10_1"},RT=s.memo(s.forwardRef(({children:e,horizontal:t,style:n},o)=>l.jsx("div",{ref:o,style:{...n},className:sr(O8.Row,t&&O8.horizontal),children:e}))),IT={...Cf},DT=s.memo(s.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=N_,coordinateGetter:d=TT,dropAnimation:c=IT,getItemStyles:u=()=>({}),getNewIndex:p,handle:m=!1,items:h,onMove:g,isDisabled:f=()=>!1,measuring:x,modifiers:y,renderItem:w,renderDivider:b,reorderItems:C=r5,strategy:k=i5,style:E,useDragOverlay:M=!0,onDragStart:T,wrapperStyle:F=()=>({})}=e,[_,O]=s.useState(()=>h);s.useEffect(()=>{O(h)},[h]);const[S,v]=s.useState(null),D=function(){for(var L=arguments.length,H=new Array(L),W=0;W<L;W++)H[W]=arguments[W];return s.useMemo(()=>[...H].filter(A=>A!=null),[...H])}(Ad(gf,{activationConstraint:o}),Ad(xf,{activationConstraint:o}),Ad(n5,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:d})),j=_.indexOf.bind(_),R=S?j(S):-1,P=[];_.map((L,H)=>{P.push(l.jsx(LT,{id:L,handle:m,index:H,style:u,wrapperStyle:F,disabled:f(L),renderItem:w,animateLayoutChanges:r,useDragOverlay:M,getNewIndex:p},L+"-"+H));const W=b?.({key:"divider-"+H});W&&P.push(W)});const{getPortalContainer:I}=(s.useEffect(()=>{function L(){const H=document.fullscreenElement;if(!H)return;let W=H.querySelector(".fullscreen-portal-root");W||(W=document.createElement("div"),W.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",H.appendChild(W))}return ys++,L(),document.addEventListener("fullscreenchange",L),()=>{document.removeEventListener("fullscreenchange",L),ys--,ys<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(H=>{H.parentNode&&H.parentNode.removeChild(H)}),ys=0)}},[]),{getPortalContainer:Gx});return l.jsxs(lT,{sensors:D,collisionDetection:a,onDragStart:L=>{const{active:H}=L;H&&(T?.(L),v(H.id))},autoScroll:{canScroll:L=>!0},onDragEnd:L=>{if(v(null),L.over){const H=j(L.over.id);R!==H&&(O(W=>C(W,R,H)),g?.(R,H))}},onDragCancel:()=>{v(null)},measuring:x,modifiers:y,children:[l.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...E},className:sr(n,Hr.Wrapper),children:l.jsx(bT,{items:_,strategy:k,children:l.jsx(RT,{ref:t,children:P})})}),M?uo.createPortal(l.jsx(gT,{adjustScale:i,dropAnimation:c,children:S?l.jsx(Tf,{value:_[R],handle:m,renderItem:w,wrapperStyle:F({index:R,isDragging:!0,id:_[R]}),index:R,dragging:!0,style:u({id:_[R],index:R,isSorting:S!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),I()):null]})}));function LT({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:a,style:d,renderItem:c,useDragOverlay:u,wrapperStyle:p}){const{attributes:m,isDragging:h,isSorting:g,listeners:f,overIndex:x,setNodeRef:y,transform:w,transition:b}=ET({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return l.jsx(Tf,{ref:y,value:r,disabled:e,dragging:h,sorting:g,handle:o,renderItem:c,index:i,style:d({index:i,id:r,isDragging:h,isSorting:g,overIndex:x}),onRemove:a?()=>a(r):void 0,transform:w,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:f,"data-index":i,"data-id":r,dragOverlay:!u&&h,...m})}const OT=new N.Color("rgb(33, 115, 70)"),AT="#eee",PT=e=>l.jsx(MT,{...e}),jf=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:a=[],onSelectedTabIndexChange:d,onTabNameChange:c,onTabMove:u,createScrollStartButton:p=Zp,createScrollEndButton:m=Gp,createScrollEdgeButton:h=Dx,createTabButton:g=PT,createTabDivider:f,editLabelProps:x,disabled:y=!1,disableDrag:w=!1,background:b="white",activeColor:C=OT,borderColor:k=AT,borderWidth:E=1}=e,[M,T]=s.useState(i),[F,_]=s.useState(a),O=s.useCallback(Me=>{const oe=I.current?.[Me]?.closest(".tab-item")??I.current?.[Me];oe&&ee.current?.scrollTo({top:oe.offsetTop,left:oe.offsetLeft,behavior:"smooth"})},[]);s.useEffect(()=>{O(i)},[i]);const S=s.useCallback((Me,oe)=>{oe!==M&&(T(oe),d?.(oe)),O(oe)},[d,M]),v=s.useCallback((Me,oe)=>{u?.(Me,oe)},[u]),D=s.useRef(null),[j,R]=s.useState(-1),P=s.useCallback((Me,oe)=>{c?.(Me,oe)},[c]);s.useLayoutEffect(()=>{T(i)},[i]),s.useLayoutEffect(()=>{_(a)},[a]);const I=s.useRef([]),L=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign({startEdit(Me){I.current?.[Me]?.startEdit()},cancel(Me){I.current?.[Me]?.cancel()}},L.current),[M,j]);const H=s.useCallback(({value:Me,index:oe,dragging:ne})=>{const{style:he,maxLength:ze,...Ne}=x||{},gt=l.jsx(R_,{ref:bt=>{I.current[oe]=bt},value:Me,disabled:y,maxLength:ze,style:{color:M===oe&&C?C?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...he},styleHover:{},onSubmit:bt=>(D.current=!1,R(-1),P(oe,bt)),onCancel:()=>{D.current=!1,R(-1)},onChange:bt=>{D.current=!0,R(oe)},...Ne});return g({onClick:bt=>S(bt,oe),value:Me,index:oe,editing:j===oe&&D.current,editable:!0,disabled:y,selectedIndex:M,background:b,activeColor:C,borderColor:k,borderWidth:E,dragging:ne,children:gt})},[M,P,S,x,y,j,g]),[W,{width:A}]=Ci(),[U,{width:X}]=Ci(),ee=s.useRef(null),[V,$]=s.useState({left:0,top:0,width:0,height:0}),[z,q]=s.useState(null);s.useEffect(()=>{z!==null&&ee.current&&ee.current.scrollTo({left:z,behavior:"smooth"})},[z]);const G=s.useCallback((Me,oe=!1)=>{if(!ee.current)return 0;let ne=ee.current.firstChild.getBoundingClientRect(),he=ee.current.firstChild.firstChild.children,ze=0;return ze=oe?0:f3.getScrollTo(Me,ne.left,he,!0,Math.max(0,Me-200)),q(ze),Math.max(0,ze)},[]),Q=s.useCallback((Me,oe=!1)=>{if(!ee.current)return 0;let ne=ee.current.firstChild.getBoundingClientRect(),he=ee.current.firstChild.firstChild.children,ze=0;const Ne=Math.ceil(X-A);return ze=oe?Ne:f3.getScrollTo(Me,ne.left,he,!1,Math.max(0,Me+200)),q(ze),Math.min(Ne,ze)},[X,A]),Y=s.useRef(null),te=s.useRef(null),re=s.useCallback(()=>{te.current&&(clearTimeout(te.current),te.current=null,Y.current=null)},[]),ge=s.useCallback((Me,oe,ne=260)=>{Y.current=Me,te.current=setTimeout(()=>{const he=oe?G(Y.current||Me):Q(Y.current||Me);he!==Y.current?ge(he,oe,120):re()},ne)},[G,Q,re]);s.useEffect(()=>()=>re(),[re]);const J=s.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(V.left)<=0||Math.floor(X-A)===0,orientation:Fo.Horizontal,onMouseUp:re,onMouseLeave:re,onMouseDown:()=>ge(ee.current.scrollLeft,!0),onClick:Me=>G(Math.min(ee.current.scrollLeft,z??Number.MAX_SAFE_INTEGER),Me.ctrlKey)}),[V,z,X,A]),se=s.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-A)<=Math.ceil(V.left),orientation:Fo.Horizontal,onMouseUp:re,onMouseLeave:re,onMouseDown:()=>ge(ee.current.scrollLeft,!1),onClick:Me=>Q(Math.max(ee.current.scrollLeft,z??0),Me.ctrlKey)}),[V,z,X,A]),Se=s.useMemo(()=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{minWidth:"16px"}}),n,h?.(J)]}),[J,se,p,m,n,h]);return l.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:sr("_TabStrip_3x0dp_1",r),ref:L,children:[l.jsx("div",{style:{borderTop:`solid ${k} ${E}px`,position:"absolute",width:"100%"}}),l.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),l.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:l.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:ee,onScroll:Me=>{$({left:Me.target.scrollLeft,top:Me.target.scrollTop,width:Me.target.scrollWidth,height:Me.target.scrollHeight})},children:l.jsx(DT,{isDisabled:Me=>y||w,items:F,strategy:yT,modifiers:[jT],ref:U,renderItem:H,renderDivider:f,onMove:v,activationConstraint:{distance:15}})})}),l.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(se)})]})}));jf.displayName="TabStrip";const FT=e=>l.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[l.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),l.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),l.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),l.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),zT=s.createContext(null),a5=()=>{const e=s.useContext(zT),[t]=s.useState(()=>new N.ThemeCollection);return s.useMemo(()=>e||t,[e])},BT=s.lazy(()=>Promise.resolve().then(()=>require("./X9sJMKafafBPpNpK.cjs"))),NT={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},A8=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),a=await i.getNavigationTree(o.uri.toString()),d=e.getPosition();let c={...d};c.lineNumber=1,c.column=1;let u=!1;for(let x=d.lineNumber;x>=1;x--)if(o.getLineContent(x).trim()===""){const y=l5(a,o.getOffsetAt({lineNumber:x,column:1}),"function");if(!y||HT(y)){u=!0,c.lineNumber=x+1;break}{const w=y.spans[0].start;x=o.getPositionAt(w).lineNumber,c.lineNumber=x}}let p=n,m=!1;!u&&!p.startsWith(`
|
|
76
|
+
`},P_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function F_(e){let{announcements:t=P_,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=A_}=e;const{announce:i,announcement:a}=function(){const[m,h]=s.useState("");return{announce:s.useCallback(g=>{g!=null&&h(g)},[]),announcement:m}}(),d=Wl("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),function(m){const h=s.useContext(tf);s.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(m)},[m,h])}(s.useMemo(()=>({onDragStart(m){let{active:h}=m;i(t.onDragStart({active:h}))},onDragMove(m){let{active:h,over:g}=m;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(m){let{active:h,over:g}=m;i(t.onDragOver({active:h,over:g}))},onDragEnd(m){let{active:h,over:g}=m;i(t.onDragEnd({active:h,over:g}))},onDragCancel(m){let{active:h,over:g}=m;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const p=s.createElement(s.Fragment,null,s.createElement(L_,{id:o,value:r.draggable}),s.createElement(O_,{id:d,announcement:a}));return n?uo.createPortal(p,n):p}var To;function nc(){}function Ad(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(To||(To={}));const Zr=Object.freeze({x:0,y:0});function nf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function z_(e,t){const n=tc(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function of(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function B_(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function y8(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function rf(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function b8(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const N_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=b8(t,t.left,t.top),i=[];for(const a of o){const{id:d}=a,c=n.get(d);if(c){const u=nf(b8(c),r);i.push({id:d,data:{droppableContainer:a,value:u}})}}return i.sort(of)};function V_(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-o,d=i-n;if(o<r&&n<i){const c=t.width*t.height,u=e.width*e.height,p=a*d;return Number((p/(c+u-p)).toFixed(4))}return 0}const H_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:a}=i,d=n.get(a);if(d){const c=V_(d,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(B_)};function w8(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zr}const $_=function(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...t})}}(1);function af(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const W_={ignoreTransform:!1};function Ca(e,t){t===void 0&&(t=W_);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:p}=er(e).getComputedStyle(e);u&&(n=function(m,h,g){const f=af(h);if(!f)return m;const{scaleX:x,scaleY:y,x:w,y:b}=f,C=m.left-w-(1-x)*parseFloat(g),k=m.top-b-(1-y)*parseFloat(g.slice(g.indexOf(" ")+1)),E=x?m.width/x:m.width,M=y?m.height/y:m.height;return{width:E,height:M,top:k,right:C+E,bottom:k+M,left:C}}(n,u,p))}const{top:o,left:r,width:i,height:a,bottom:d,right:c}=n;return{top:o,left:r,width:i,height:a,bottom:d,right:c}}function v8(e){return Ca(e,{ignoreTransform:!0})}function Rc(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(t5(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!rs(r)||Qm(r)||n.includes(r))return n;const i=er(e).getComputedStyle(r);return r!==e&&function(a,d){d===void 0&&(d=er(a).getComputedStyle(a));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const p=d[u];return typeof p=="string"&&c.test(p)})}(r,i)&&n.push(r),function(a,d){return d===void 0&&(d=er(a).getComputedStyle(a)),d.position==="fixed"}(r,i)?n:o(r.parentNode)}(e):n}function lf(e){const[t]=Rc(e,1);return t??null}function Pd(e){return Tc&&e?Sa(e)?e:e5(e)?t5(e)||e===ga(e).scrollingElement?window:rs(e)?e:null:null:null}function sf(e){return Sa(e)?e.scrollX:e.scrollLeft}function cf(e){return Sa(e)?e.scrollY:e.scrollTop}function e2(e){return{x:sf(e),y:cf(e)}}var Do;function df(e){return!(!Tc||!e)&&e===document.scrollingElement}function uf(e){const t={x:0,y:0},n=df(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Do||(Do={}));const U_={x:.2,y:.2};function q_(e,t,n,o,r){let{top:i,left:a,right:d,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=U_);const{isTop:u,isBottom:p,isLeft:m,isRight:h}=uf(e),g={x:0,y:0},f={x:0,y:0},x=t.height*r.y,y=t.width*r.x;return!u&&i<=t.top+x?(g.y=Do.Backward,f.y=o*Math.abs((t.top+x-i)/x)):!p&&c>=t.bottom-x&&(g.y=Do.Forward,f.y=o*Math.abs((t.bottom-x-c)/x)),!h&&d>=t.right-y?(g.x=Do.Forward,f.x=o*Math.abs((t.right-y-d)/y)):!m&&a<=t.left+y&&(g.x=Do.Backward,f.x=o*Math.abs((t.left+y-a)/y)),{direction:g,speed:f}}function Z_(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function pf(e){return e.reduce((t,n)=>Yi(t,e2(n)),Zr)}function hf(e,t){if(t===void 0&&(t=Ca),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);lf(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const G_=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+sf(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+cf(n),0)}]];class t2{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Rc(n),r=pf(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,d]of G_)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=d(o),p=r[i]-u;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cl{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function Fd(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Tr,Sn;function S8(e){e.preventDefault()}function K_(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tr||(Tr={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Sn||(Sn={}));const mf={start:[Sn.Space,Sn.Enter],cancel:[Sn.Esc],end:[Sn.Space,Sn.Enter,Sn.Tab]},X_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Sn.Right:return{...n,x:n.x+25};case Sn.Left:return{...n,x:n.x-25};case Sn.Down:return{...n,y:n.y+25};case Sn.Up:return{...n,y:n.y-25}}};class n5{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Cl(ga(n)),this.windowListeners=new Cl(er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&hf(o),n(Zr)}handleKeyDown(t){if(Mc(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=mf,coordinateGetter:a=X_,scrollBehavior:d="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:u}=o.current,p=u?{x:u.left,y:u.top}:Zr;this.referenceCoordinates||(this.referenceCoordinates=p);const m=a(t,{active:n,context:o.current,currentCoordinates:p});if(m){const h=Ul(m,p),g={x:0,y:0},{scrollableAncestors:f}=o.current;for(const x of f){const y=t.code,{isTop:w,isRight:b,isLeft:C,isBottom:k,maxScroll:E,minScroll:M}=uf(x),T=Z_(x),F={x:Math.min(y===Sn.Right?T.right-T.width/2:T.right,Math.max(y===Sn.Right?T.left:T.left+T.width/2,m.x)),y:Math.min(y===Sn.Down?T.bottom-T.height/2:T.bottom,Math.max(y===Sn.Down?T.top:T.top+T.height/2,m.y))},_=y===Sn.Right&&!b||y===Sn.Left&&!C,O=y===Sn.Down&&!k||y===Sn.Up&&!w;if(_&&F.x!==m.x){const S=x.scrollLeft+h.x,v=y===Sn.Right&&S<=E.x||y===Sn.Left&&S>=M.x;if(v&&!h.y)return void x.scrollTo({left:S,behavior:d});g.x=v?x.scrollLeft-S:y===Sn.Right?x.scrollLeft-E.x:x.scrollLeft-M.x,g.x&&x.scrollBy({left:-g.x,behavior:d});break}if(O&&F.y!==m.y){const S=x.scrollTop+h.y,v=y===Sn.Down&&S<=E.y||y===Sn.Up&&S>=M.y;if(v&&!h.x)return void x.scrollTo({top:S,behavior:d});g.y=v?x.scrollTop-S:y===Sn.Down?x.scrollTop-E.y:x.scrollTop-M.y,g.y&&x.scrollBy({top:-g.y,behavior:d});break}}this.handleMove(t,Yi(Ul(m,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function C8(e){return!(!e||!("distance"in e))}function k8(e){return!(!e||!("delay"in e))}n5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=mf,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const d=i.activatorNode.current;return!(d&&e.target!==d||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class o5{constructor(t,n,o){var r;o===void 0&&(o=function(d){const{EventTarget:c}=er(d);return d instanceof c?d:ga(d)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=ga(a),this.documentListeners=new Cl(this.document),this.listeners=new Cl(o),this.windowListeners=new Cl(er(a)),this.initialCoordinates=(r=tc(i))!=null?r:Zr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.DragStart,S8),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),this.windowListeners.add(Tr.ContextMenu,S8),this.documentListeners.add(Tr.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(k8(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(C8(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tr.Click,K_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:d}}=i;if(!r)return;const c=(n=tc(t))!=null?n:Zr,u=Ul(r,c);if(!o&&d){if(C8(d)){if(d.tolerance!=null&&Fd(u,d.tolerance))return this.handleCancel();if(Fd(u,d.distance))return this.handleStart()}return k8(d)&&Fd(u,d.tolerance)?this.handleCancel():void this.handlePending(d,u)}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Sn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Y_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ff extends o5{constructor(t){const{event:n}=t,o=ga(n.target);super(t,Y_,o)}}ff.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const J_={move:{name:"mousemove"},end:{name:"mouseup"}};var n2;(function(e){e[e.RightClick=2]="RightClick"})(n2||(n2={}));class gf extends o5{constructor(t){super(t,J_,ga(t.event.target))}}gf.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==n2.RightClick&&(o?.({event:n}),!0)}}];const zd={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xf extends o5{constructor(t){super(t,zd)}static setup(){return window.addEventListener(zd.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zd.move.name,t)};function t(){}}}var kl,oc;xf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(kl||(kl={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(oc||(oc={}));const Q_={x:{[Do.Backward]:!1,[Do.Forward]:!1},y:{[Do.Backward]:!1,[Do.Forward]:!1}};var ql,o2;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ql||(ql={})),(o2||(o2={})).Optimized="optimized";const E8=new Map;function r2(e,t){return ml(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rc(e){let{callback:t,disabled:n}=e;const o=jc(t),r=s.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return s.useEffect(()=>()=>r?.disconnect(),[r]),r}function eT(e){return new t2(Ca(e),e)}function _8(e,t,n){t===void 0&&(t=eT);const[o,r]=s.useState(null);function i(){r(c=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=c??n)!=null?u:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const a=function(c){let{callback:u,disabled:p}=c;const m=jc(u),h=s.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:g}=window;return new g(m)},[m,p]);return s.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const u of c){const{type:p,target:m}=u;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){i();break}}}}),d=rc({callback:i});return Ur(()=>{i(),e?(d?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),a?.disconnect())},[e]),o}const T8=[];function j8(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const o=e!==Zr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Ul(e,n.current):Zr}function M8(e){return s.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const R8=[];function yf(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return rs(t)?t:e}const tT=[{sensor:ff,options:{}},{sensor:n5,options:{}}],nT={current:{}},S1={draggable:{measure:v8},droppable:{measure:v8,strategy:ql.WhileDragging,frequency:o2.Optimized},dragOverlay:{measure:Ca}};class El extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const oT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new El,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:S1,measureDroppableContainers:nc,windowRect:null,measuringScheduled:!1},bf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nc,draggableNodes:new Map,over:null,measureDroppableContainers:nc},Zl=s.createContext(bf),wf=s.createContext(oT);function rT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new El}}}function iT(e,t){switch(t.type){case To.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case To.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case To.DragEnd:case To.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case To.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new El(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case To.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new El(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case To.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new El(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function aT(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=s.useContext(Zl),i=ec(o),a=ec(n?.id);return s.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!Mc(i)||document.activeElement===i.target)return;const d=r.get(a);if(!d)return;const{activatorNode:c,node:u}=d;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const p of[c.current,u.current]){if(!p)continue;const m=I_(p);if(m){m.focus();break}}})}},[o,t,r,a,i]),null}function vf(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const Ic=s.createContext({...Zr,scaleX:1,scaleY:1});var P0;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(P0||(P0={}));const lT=s.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:d=!0,children:c,sensors:u=tT,collisionDetection:p=H_,measuring:m,modifiers:h,...g}=e;const f=s.useReducer(iT,void 0,rT),[x,y]=f,[w,b]=function(){const[ie]=s.useState(()=>new Set),Ee=s.useCallback(Le=>(ie.add(Le),()=>ie.delete(Le)),[ie]);return[s.useCallback(Le=>{let{type:qe,event:ht}=Le;ie.forEach(ot=>{var We;return(We=ot[qe])==null?void 0:We.call(ot,ht)})},[ie]),Ee]}(),[C,k]=s.useState(P0.Uninitialized),E=C===P0.Initialized,{draggable:{active:M,nodes:T,translate:F},droppable:{containers:_}}=x,O=M!=null?T.get(M):null,S=s.useRef({initial:null,translated:null}),v=s.useMemo(()=>{var ie;return M!=null?{id:M,data:(ie=O?.data)!=null?ie:nT,rect:S}:null},[M,O]),D=s.useRef(null),[j,R]=s.useState(null),[P,I]=s.useState(null),L=Sl(g,Object.values(g)),H=Wl("DndDescribedBy",i),W=s.useMemo(()=>_.getEnabled(),[_]),A=s.useMemo(()=>({draggable:{...S1.draggable,...U?.draggable},droppable:{...S1.droppable,...U?.droppable},dragOverlay:{...S1.dragOverlay,...U?.dragOverlay}}),[(U=m)==null?void 0:U.draggable,U?.droppable,U?.dragOverlay]);var U;const{droppableRects:X,measureDroppableContainers:ee,measuringScheduled:V}=function(ie,Ee){let{dragging:Le,dependencies:qe,config:ht}=Ee;const[ot,We]=s.useState(null),{frequency:st,measure:Xe,strategy:Qe}=ht,kt=s.useRef(ie),Vt=function(){switch(Qe){case ql.Always:return!1;case ql.BeforeDragging:return Le;default:return!Le}}(),ct=Sl(Vt),Ut=s.useCallback(function(xn){xn===void 0&&(xn=[]),ct.current||We(En=>En===null?xn:En.concat(xn.filter(Vn=>!En.includes(Vn))))},[ct]),Qt=s.useRef(null),an=ml(xn=>{if(Vt&&!Le)return E8;if(!xn||xn===E8||kt.current!==ie||ot!=null){const En=new Map;for(let Vn of ie){if(!Vn)continue;if(ot&&ot.length>0&&!ot.includes(Vn.id)&&Vn.rect.current){En.set(Vn.id,Vn.rect.current);continue}const oo=Vn.node.current,po=oo?new t2(Xe(oo),oo):null;Vn.rect.current=po,po&&En.set(Vn.id,po)}return En}return xn},[ie,ot,Le,Vt,Xe]);return s.useEffect(()=>{kt.current=ie},[ie]),s.useEffect(()=>{Vt||Ut()},[Le,Vt]),s.useEffect(()=>{ot&&ot.length>0&&We(null)},[JSON.stringify(ot)]),s.useEffect(()=>{Vt||typeof st!="number"||Qt.current!==null||(Qt.current=setTimeout(()=>{Ut(),Qt.current=null},st))},[st,Vt,Ut,...qe]),{droppableRects:an,measureDroppableContainers:Ut,measuringScheduled:ot!=null}}(W,{dragging:E,dependencies:[F.x,F.y],config:A.droppable}),$=function(ie,Ee){const Le=Ee!=null?ie.get(Ee):void 0,qe=Le?Le.node.current:null;return ml(ht=>{var ot;return Ee==null?null:(ot=qe??ht)!=null?ot:null},[qe,Ee])}(T,M),z=s.useMemo(()=>P?tc(P):null,[P]),q=function(){const ie=j?.autoScrollEnabled===!1,Ee=typeof d=="object"?d.enabled===!1:d===!1,Le=E&&!ie&&!Ee;return typeof d=="object"?{...d,enabled:Le}:{enabled:Le}}(),G=function(ie,Ee){return r2(ie,Ee)}($,A.draggable.measure);(function(ie){let{activeNode:Ee,measure:Le,initialRect:qe,config:ht=!0}=ie;const ot=s.useRef(!1),{x:We,y:st}=typeof ht=="boolean"?{x:ht,y:ht}:ht;Ur(()=>{if(!We&&!st||!Ee)return void(ot.current=!1);if(ot.current||!qe)return;const Xe=Ee?.node.current;if(!Xe||Xe.isConnected===!1)return;const Qe=w8(Le(Xe),qe);if(We||(Qe.x=0),st||(Qe.y=0),ot.current=!0,Math.abs(Qe.x)>0||Math.abs(Qe.y)>0){const kt=lf(Xe);kt&&kt.scrollBy({top:Qe.y,left:Qe.x})}},[Ee,We,st,qe,Le])})({activeNode:M!=null?T.get(M):null,config:q.layoutShiftCompensation,initialRect:G,measure:A.draggable.measure});const Q=_8($,A.draggable.measure,G),Y=_8($?$.parentElement:null),te=s.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=_.getNodeFor((t=te.current.over)==null?void 0:t.id),ge=function(ie){let{measure:Ee}=ie;const[Le,qe]=s.useState(null),ht=rc({callback:s.useCallback(Xe=>{for(const{target:Qe}of Xe)if(rs(Qe)){qe(kt=>{const Vt=Ee(Qe);return kt?{...kt,width:Vt.width,height:Vt.height}:Vt});break}},[Ee])}),ot=s.useCallback(Xe=>{const Qe=yf(Xe);ht?.disconnect(),Qe&&ht?.observe(Qe),qe(Qe?Ee(Qe):null)},[Ee,ht]),[We,st]=v1(ot);return s.useMemo(()=>({nodeRef:We,rect:Le,setRef:st}),[Le,We,st])}({measure:A.dragOverlay.measure}),J=(n=ge.nodeRef.current)!=null?n:$,se=E?(o=ge.rect)!=null?o:Q:null,Se=!(!ge.nodeRef.current||!ge.rect),Me=w8(oe=Se?null:Q,r2(oe));var oe;const ne=M8(J?er(J):null),he=function(ie){const Ee=s.useRef(ie),Le=ml(qe=>ie?qe&&qe!==T8&&ie&&Ee.current&&ie.parentNode===Ee.current.parentNode?qe:Rc(ie):T8,[ie]);return s.useEffect(()=>{Ee.current=ie},[ie]),Le}(E?re??$:null),ze=function(ie,Ee){Ee===void 0&&(Ee=Ca);const[Le]=ie,qe=M8(Le?er(Le):null),[ht,ot]=s.useState(R8);function We(){ot(()=>ie.length?ie.map(Xe=>df(Xe)?qe:new t2(Ee(Xe),Xe)):R8)}const st=rc({callback:We});return Ur(()=>{st?.disconnect(),We(),ie.forEach(Xe=>st?.observe(Xe))},[ie]),ht}(he),Ne=vf(h,{transform:{x:F.x-Me.x,y:F.y-Me.y,scaleX:1,scaleY:1},activatorEvent:P,active:v,activeNodeRect:Q,containerNodeRect:Y,draggingNodeRect:se,over:te.current.over,overlayNodeRect:ge.rect,scrollableAncestors:he,scrollableAncestorRects:ze,windowRect:ne}),gt=z?Yi(z,F):null,bt=function(ie){const[Ee,Le]=s.useState(null),qe=s.useRef(ie),ht=s.useCallback(ot=>{const We=Pd(ot.target);We&&Le(st=>st?(st.set(We,e2(We)),new Map(st)):null)},[]);return s.useEffect(()=>{const ot=qe.current;if(ie!==ot){We(ot);const st=ie.map(Xe=>{const Qe=Pd(Xe);return Qe?(Qe.addEventListener("scroll",ht,{passive:!0}),[Qe,e2(Qe)]):null}).filter(Xe=>Xe!=null);Le(st.length?new Map(st):null),qe.current=ie}return()=>{We(ie),We(ot)};function We(st){st.forEach(Xe=>{Pd(Xe)?.removeEventListener("scroll",ht)})}},[ht,ie]),s.useMemo(()=>ie.length?Ee?Array.from(Ee.values()).reduce((ot,We)=>Yi(ot,We),Zr):pf(ie):Zr,[ie,Ee])}(he),ke=j8(bt),pt=j8(bt,[Q]),xt=Yi(Ne,ke),Ve=se?$_(se,Ne):null,wt=v&&Ve?p({active:v,collisionRect:Ve,droppableRects:X,droppableContainers:W,pointerCoordinates:gt}):null,Ye=rf(wt,"id"),[ae,Ue]=s.useState(null),ye=function(ie,Ee,Le){return{...ie,scaleX:Ee&&Le?Ee.width/Le.width:1,scaleY:Ee&&Le?Ee.height/Le.height:1}}(Se?Ne:Yi(Ne,pt),(r=ae?.rect)!=null?r:null,Q),ve=s.useRef(null),le=s.useCallback((ie,Ee)=>{let{sensor:Le,options:qe}=Ee;if(D.current==null)return;const ht=T.get(D.current);if(!ht)return;const ot=ie.nativeEvent,We=new Le({active:D.current,activeNode:ht,event:ot,options:qe,context:te,onAbort(Xe){if(!T.get(Xe))return;const{onDragAbort:Qe}=L.current,kt={id:Xe};Qe?.(kt),w({type:"onDragAbort",event:kt})},onPending(Xe,Qe,kt,Vt){if(!T.get(Xe))return;const{onDragPending:ct}=L.current,Ut={id:Xe,constraint:Qe,initialCoordinates:kt,offset:Vt};ct?.(Ut),w({type:"onDragPending",event:Ut})},onStart(Xe){const Qe=D.current;if(Qe==null)return;const kt=T.get(Qe);if(!kt)return;const{onDragStart:Vt}=L.current,ct={activatorEvent:ot,active:{id:Qe,data:kt.data,rect:S}};uo.unstable_batchedUpdates(()=>{Vt?.(ct),k(P0.Initializing),y({type:To.DragStart,initialCoordinates:Xe,active:Qe}),w({type:"onDragStart",event:ct}),R(ve.current),I(ot)})},onMove(Xe){y({type:To.DragMove,coordinates:Xe})},onEnd:st(To.DragEnd),onCancel:st(To.DragCancel)});function st(Xe){return async function(){const{active:Qe,collisions:kt,over:Vt,scrollAdjustedTranslate:ct}=te.current;let Ut=null;if(Qe&&ct){const{cancelDrop:Qt}=L.current;Ut={activatorEvent:ot,active:Qe,collisions:kt,delta:ct,over:Vt},Xe===To.DragEnd&&typeof Qt=="function"&&await Promise.resolve(Qt(Ut))&&(Xe=To.DragCancel)}D.current=null,uo.unstable_batchedUpdates(()=>{y({type:Xe}),k(P0.Uninitialized),Ue(null),R(null),I(null),ve.current=null;const Qt=Xe===To.DragEnd?"onDragEnd":"onDragCancel";if(Ut){const an=L.current[Qt];an?.(Ut),w({type:Qt,event:Ut})}})}}ve.current=We},[T]),Ie=s.useCallback((ie,Ee)=>(Le,qe)=>{const ht=Le.nativeEvent,ot=T.get(qe);if(D.current!==null||!ot||ht.dndKit||ht.defaultPrevented)return;const We={active:ot};ie(Le,Ee.options,We)===!0&&(ht.dndKit={capturedBy:Ee.sensor},D.current=qe,le(Le,Ee))},[T,le]),Re=function(ie,Ee){return s.useMemo(()=>ie.reduce((Le,qe)=>{const{sensor:ht}=qe;return[...Le,...ht.activators.map(ot=>({eventName:ot.eventName,handler:Ee(ot.handler,qe)}))]},[]),[ie,Ee])}(u,Ie);(function(ie){s.useEffect(()=>{if(!Tc)return;const Ee=ie.map(Le=>{let{sensor:qe}=Le;return qe.setup==null?void 0:qe.setup()});return()=>{for(const Le of Ee)Le?.()}},ie.map(Ee=>{let{sensor:Le}=Ee;return Le}))})(u),Ur(()=>{Q&&C===P0.Initializing&&k(P0.Initialized)},[Q,C]),s.useEffect(()=>{const{onDragMove:ie}=L.current,{active:Ee,activatorEvent:Le,collisions:qe,over:ht}=te.current;if(!Ee||!Le)return;const ot={active:Ee,activatorEvent:Le,collisions:qe,delta:{x:xt.x,y:xt.y},over:ht};uo.unstable_batchedUpdates(()=>{ie?.(ot),w({type:"onDragMove",event:ot})})},[xt.x,xt.y]),s.useEffect(()=>{const{active:ie,activatorEvent:Ee,collisions:Le,droppableContainers:qe,scrollAdjustedTranslate:ht}=te.current;if(!ie||D.current==null||!Ee||!ht)return;const{onDragOver:ot}=L.current,We=qe.get(Ye),st=We&&We.rect.current?{id:We.id,rect:We.rect.current,data:We.data,disabled:We.disabled}:null,Xe={active:ie,activatorEvent:Ee,collisions:Le,delta:{x:ht.x,y:ht.y},over:st};uo.unstable_batchedUpdates(()=>{Ue(st),ot?.(Xe),w({type:"onDragOver",event:Xe})})},[Ye]),Ur(()=>{te.current={activatorEvent:P,active:v,activeNode:$,collisionRect:Ve,collisions:wt,droppableRects:X,draggableNodes:T,draggingNode:J,draggingNodeRect:se,droppableContainers:_,over:ae,scrollableAncestors:he,scrollAdjustedTranslate:xt},S.current={initial:se,translated:Ve}},[v,$,wt,Ve,T,J,se,X,_,ae,he,xt]),function(ie){let{acceleration:Ee,activator:Le=kl.Pointer,canScroll:qe,draggingRect:ht,enabled:ot,interval:We=5,order:st=oc.TreeOrder,pointerCoordinates:Xe,scrollableAncestors:Qe,scrollableAncestorRects:kt,delta:Vt,threshold:ct}=ie;const Ut=function(Bt){let{delta:Fn,disabled:Gn}=Bt;const vn=ec(Fn);return ml(Cn=>{if(Gn||!vn||!Cn)return Q_;const mn=Math.sign(Fn.x-vn.x),tr=Math.sign(Fn.y-vn.y);return{x:{[Do.Backward]:Cn.x[Do.Backward]||mn===-1,[Do.Forward]:Cn.x[Do.Forward]||mn===1},y:{[Do.Backward]:Cn.y[Do.Backward]||tr===-1,[Do.Forward]:Cn.y[Do.Forward]||tr===1}}},[Gn,Fn,vn])}({delta:Vt,disabled:!ot}),[Qt,an]=function(){const Bt=s.useRef(null);return[s.useCallback((Fn,Gn)=>{Bt.current=setInterval(Fn,Gn)},[]),s.useCallback(()=>{Bt.current!==null&&(clearInterval(Bt.current),Bt.current=null)},[])]}(),xn=s.useRef({x:0,y:0}),En=s.useRef({x:0,y:0}),Vn=s.useMemo(()=>{switch(Le){case kl.Pointer:return Xe?{top:Xe.y,bottom:Xe.y,left:Xe.x,right:Xe.x}:null;case kl.DraggableRect:return ht}},[Le,ht,Xe]),oo=s.useRef(null),po=s.useCallback(()=>{const Bt=oo.current;if(!Bt)return;const Fn=xn.current.x*En.current.x,Gn=xn.current.y*En.current.y;Bt.scrollBy(Fn,Gn)},[]),_n=s.useMemo(()=>st===oc.TreeOrder?[...Qe].reverse():Qe,[st,Qe]);s.useEffect(()=>{if(ot&&Qe.length&&Vn){for(const Bt of _n){if(qe?.(Bt)===!1)continue;const Fn=Qe.indexOf(Bt),Gn=kt[Fn];if(!Gn)continue;const{direction:vn,speed:Cn}=q_(Bt,Gn,Vn,Ee,ct);for(const mn of["x","y"])Ut[mn][vn[mn]]||(Cn[mn]=0,vn[mn]=0);if(Cn.x>0||Cn.y>0)return an(),oo.current=Bt,Qt(po,We),xn.current=Cn,void(En.current=vn)}xn.current={x:0,y:0},En.current={x:0,y:0},an()}else an()},[Ee,po,qe,an,ot,We,JSON.stringify(Vn),JSON.stringify(Ut),Qt,Qe,_n,kt,JSON.stringify(ct)])}({...q,delta:F,draggingRect:Ve,pointerCoordinates:gt,scrollableAncestors:he,scrollableAncestorRects:ze});const be=s.useMemo(()=>({active:v,activeNode:$,activeNodeRect:Q,activatorEvent:P,collisions:wt,containerNodeRect:Y,dragOverlay:ge,draggableNodes:T,droppableContainers:_,droppableRects:X,over:ae,measureDroppableContainers:ee,scrollableAncestors:he,scrollableAncestorRects:ze,measuringConfiguration:A,measuringScheduled:V,windowRect:ne}),[v,$,Q,P,wt,Y,ge,T,_,X,ae,ee,he,ze,A,V,ne]),Oe=s.useMemo(()=>({activatorEvent:P,activators:Re,active:v,activeNodeRect:Q,ariaDescribedById:{draggable:H},dispatch:y,draggableNodes:T,over:ae,measureDroppableContainers:ee}),[P,Re,v,Q,y,H,T,ae,ee]);return s.createElement(tf.Provider,{value:b},s.createElement(Zl.Provider,{value:Oe},s.createElement(wf.Provider,{value:be},s.createElement(Ic.Provider,{value:ye},c)),s.createElement(aT,{disabled:a?.restoreFocus===!1})),s.createElement(F_,{...a,hiddenTextDescribedById:H}))}),sT=s.createContext(null),I8="button";function Sf(){return s.useContext(wf)}const cT={timeout:25};function dT(e){let{animation:t,children:n}=e;const[o,r]=s.useState(null),[i,a]=s.useState(null),d=ec(n);return n||o||!d||r(d),Ur(()=>{if(!i)return;const c=o?.key,u=o?.props.id;c!=null&&u!=null?Promise.resolve(t(u,i)).then(()=>{r(null)}):r(null)},[t,o,i]),s.createElement(s.Fragment,null,n,o?s.cloneElement(o,{ref:a}):null)}const uT={x:0,y:0,scaleX:1,scaleY:1};function pT(e){let{children:t}=e;return s.createElement(Zl.Provider,{value:bf},s.createElement(Ic.Provider,{value:uT},t))}const hT={position:"fixed",touchAction:"none"},mT=e=>Mc(e)?"transform 250ms ease":void 0,fT=s.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:d,style:c,transform:u,transition:p=mT}=e;if(!d)return null;const m=r?u:{...u,scaleX:1,scaleY:1},h={...hT,width:d.width,height:d.height,top:d.top,left:d.left,transform:ki.Transform.toString(m),transformOrigin:r&&o?z_(o,d):void 0,transition:typeof p=="function"?p(o):p,...c};return s.createElement(n,{className:a,style:h,ref:t},i)}),Cf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ki.Transform.toString(t)},{transform:ki.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[d,c]of Object.entries(i.active))c!==void 0&&(r[d]=n.node.style.getPropertyValue(d),n.node.style.setProperty(d,c));if(i!=null&&i.dragOverlay)for(const[d,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(d,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&o.node.classList.add(a.dragOverlay),function(){for(const[d,c]of Object.entries(r))n.node.style.setProperty(d,c);a!=null&&a.active&&n.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};let D8=0;const gT=s.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:a,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:g,draggableNodes:f,droppableContainers:x,dragOverlay:y,over:w,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:k,windowRect:E}=Sf(),M=s.useContext(Ic),T=function(v){return s.useMemo(()=>{if(v!=null)return D8++,D8},[v])}(m?.id),F=vf(a,{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:y.rect,over:w,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:k,transform:M,windowRect:E}),_=r2(h),O=function(v){let{config:D,draggableNodes:j,droppableContainers:R,measuringConfiguration:P}=v;return jc((I,L)=>{if(D===null)return;const H=j.get(I);if(!H)return;const W=H.node.current;if(!W)return;const A=yf(L);if(!A)return;const{transform:U}=er(L).getComputedStyle(L),X=af(U);if(!X)return;const ee=typeof D=="function"?D:function(V){const{duration:$,easing:z,sideEffects:q,keyframes:G}={...Cf,...V};return Q=>{let{active:Y,dragOverlay:te,transform:re,...ge}=Q;if(!$)return;const J=te.rect.left-Y.rect.left,se=te.rect.top-Y.rect.top,Se={scaleX:re.scaleX!==1?Y.rect.width*re.scaleX/te.rect.width:1,scaleY:re.scaleY!==1?Y.rect.height*re.scaleY/te.rect.height:1},Me={x:re.x-J,y:re.y-se,...Se},oe=G({...ge,active:Y,dragOverlay:te,transform:{initial:re,final:Me}}),[ne]=oe,he=oe[oe.length-1];if(JSON.stringify(ne)===JSON.stringify(he))return;const ze=q?.({active:Y,dragOverlay:te,...ge}),Ne=te.node.animate(oe,{duration:$,easing:z,fill:"forwards"});return new Promise(gt=>{Ne.onfinish=()=>{ze?.(),gt()}})}}(D);return hf(W,P.draggable.measure),ee({active:{id:I,data:H.data,node:W,rect:P.draggable.measure(W)},draggableNodes:j,dragOverlay:{node:L,rect:P.dragOverlay.measure(A)},droppableContainers:R,measuringConfiguration:P,transform:X})})}({config:o,draggableNodes:f,droppableContainers:x,measuringConfiguration:b}),S=_?y.setRef:void 0;return s.createElement(pT,null,s.createElement(dT,{animation:O},m&&T?s.createElement(fT,{key:T,id:m.id,ref:S,as:d,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:_,style:{zIndex:u,...r},transform:F},n):null))});function r5(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function xT(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Hs(e){return e!==null&&e>=0}const $s={scaleX:1,scaleY:1},yT=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:a}=e;const d=(t=n[r])!=null?t:o;if(!d)return null;const c=function(u,p,m){const h=u[p],g=u[p-1],f=u[p+1];return h&&(g||f)?m<p?g?h.left-(g.left+g.width):f.left-(h.left+h.width):f?f.left-(h.left+h.width):h.left-(g.left+g.width):0}(n,a,r);if(a===r){const u=n[i];return u?{x:r<i?u.left+u.width-(d.left+d.width):u.left-d.left,y:0,...$s}:null}return a>r&&a<=i?{x:-d.width-c,y:0,...$s}:a<r&&a>=i?{x:d.width+c,y:0,...$s}:{x:0,y:0,...$s}},i5=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=r5(t,o,n),a=t[r],d=i[r];return d&&a?{x:d.left-a.left,y:d.top-a.top,scaleX:d.width/a.width,scaleY:d.height/a.height}:null},kf="Sortable",Ef=s.createContext({activeIndex:-1,containerId:kf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i5,disabled:{draggable:!1,droppable:!1}});function bT(e){let{children:t,id:n,items:o,strategy:r=i5,disabled:i=!1}=e;const{active:a,dragOverlay:d,droppableRects:c,over:u,measureDroppableContainers:p}=Sf(),m=Wl(kf,n),h=d.rect!==null,g=s.useMemo(()=>o.map(M=>typeof M=="object"&&"id"in M?M.id:M),[o]),f=a!=null,x=a?g.indexOf(a.id):-1,y=u?g.indexOf(u.id):-1,w=s.useRef(g),b=!function(M,T){if(M===T)return!0;if(M.length!==T.length)return!1;for(let F=0;F<M.length;F++)if(M[F]!==T[F])return!1;return!0}(g,w.current),C=y!==-1&&x===-1||b,k=function(M){return typeof M=="boolean"?{draggable:M,droppable:M}:M}(i);Ur(()=>{b&&f&&p(g)},[b,g,f,p]),s.useEffect(()=>{w.current=g},[g]);const E=s.useMemo(()=>({activeIndex:x,containerId:m,disabled:k,disableTransforms:C,items:g,overIndex:y,useDragOverlay:h,sortedRects:xT(g,c),strategy:r}),[x,m,k.draggable,k.droppable,C,g,y,c,h,r]);return s.createElement(Ef.Provider,{value:E},t)}const wT=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return r5(n,o,r).indexOf(t)},vT=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:d,previousContainerId:c,transition:u}=e;return!(!u||!o||d!==i&&r===a||!n&&(a===r||t!==c))},ST={duration:200,easing:"ease"},_f="transform",CT=ki.Transition.toString({property:_f,duration:0,easing:"linear"}),kT={roleDescription:"sortable"};function ET(e){let{animateLayoutChanges:t=vT,attributes:n,disabled:o,data:r,getNewIndex:i=wT,id:a,strategy:d,resizeObserverConfig:c,transition:u=ST}=e;const{items:p,containerId:m,activeIndex:h,disabled:g,disableTransforms:f,sortedRects:x,overIndex:y,useDragOverlay:w,strategy:b}=s.useContext(Ef),C=function(te,re){var ge,J;return typeof te=="boolean"?{draggable:te,droppable:!1}:{draggable:(ge=te?.draggable)!=null?ge:re.draggable,droppable:(J=te?.droppable)!=null?J:re.droppable}}(o,g),k=p.indexOf(a),E=s.useMemo(()=>({sortable:{containerId:m,index:k,items:p},...r}),[m,r,k,p]),M=s.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:T,node:F,isOver:_,setNodeRef:O}=function(te){let{data:re,disabled:ge=!1,id:J,resizeObserverConfig:se}=te;const Se=Wl("Droppable"),{active:Me,dispatch:oe,over:ne,measureDroppableContainers:he}=s.useContext(Zl),ze=s.useRef({disabled:ge}),Ne=s.useRef(!1),gt=s.useRef(null),bt=s.useRef(null),{disabled:ke,updateMeasurementsFor:pt,timeout:xt}={...cT,...se},Ve=Sl(pt??J),wt=rc({callback:s.useCallback(()=>{Ne.current?(bt.current!=null&&clearTimeout(bt.current),bt.current=setTimeout(()=>{he(Array.isArray(Ve.current)?Ve.current:[Ve.current]),bt.current=null},xt)):Ne.current=!0},[xt]),disabled:ke||!Me}),Ye=s.useCallback((ve,le)=>{wt&&(le&&(wt.unobserve(le),Ne.current=!1),ve&&wt.observe(ve))},[wt]),[ae,Ue]=v1(Ye),ye=Sl(re);return s.useEffect(()=>{wt&&ae.current&&(wt.disconnect(),Ne.current=!1,wt.observe(ae.current))},[ae,wt]),s.useEffect(()=>(oe({type:To.RegisterDroppable,element:{id:J,key:Se,disabled:ge,node:ae,rect:gt,data:ye}}),()=>oe({type:To.UnregisterDroppable,key:Se,id:J})),[J]),s.useEffect(()=>{ge!==ze.current.disabled&&(oe({type:To.SetDroppableDisabled,id:J,key:Se,disabled:ge}),ze.current.disabled=ge)},[J,Se,ge,oe]),{active:Me,rect:gt,isOver:ne?.id===J,node:ae,over:ne,setNodeRef:Ue}}({id:a,data:E,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...c}}),{active:S,activatorEvent:v,activeNodeRect:D,attributes:j,setNodeRef:R,listeners:P,isDragging:I,over:L,setActivatorNodeRef:H,transform:W}=function(te){let{id:re,data:ge,disabled:J=!1,attributes:se}=te;const Se=Wl("Draggable"),{activators:Me,activatorEvent:oe,active:ne,activeNodeRect:he,ariaDescribedById:ze,draggableNodes:Ne,over:gt}=s.useContext(Zl),{role:bt=I8,roleDescription:ke="draggable",tabIndex:pt=0}=se??{},xt=ne?.id===re,Ve=s.useContext(xt?Ic:sT),[wt,Ye]=v1(),[ae,Ue]=v1(),ye=function(le,Ie){return s.useMemo(()=>le.reduce((Re,be)=>{let{eventName:Oe,handler:ie}=be;return Re[Oe]=Ee=>{ie(Ee,Ie)},Re},{}),[le,Ie])}(Me,re),ve=Sl(ge);return Ur(()=>(Ne.set(re,{id:re,key:Se,node:wt,activatorNode:ae,data:ve}),()=>{const le=Ne.get(re);le&&le.key===Se&&Ne.delete(re)}),[Ne,re]),{active:ne,activatorEvent:oe,activeNodeRect:he,attributes:s.useMemo(()=>({role:bt,tabIndex:pt,"aria-disabled":J,"aria-pressed":!(!xt||bt!==I8)||void 0,"aria-roledescription":ke,"aria-describedby":ze.draggable}),[J,bt,pt,xt,ke,ze.draggable]),isDragging:xt,listeners:J?void 0:ye,node:wt,over:gt,setNodeRef:Ye,setActivatorNodeRef:Ue,transform:Ve}}({id:a,data:E,attributes:{...kT,...n},disabled:C.draggable}),A=function(){for(var te=arguments.length,re=new Array(te),ge=0;ge<te;ge++)re[ge]=arguments[ge];return s.useMemo(()=>J=>{re.forEach(se=>se(J))},re)}(O,R),U=!!S,X=U&&!f&&Hs(h)&&Hs(y),ee=!w&&I,V=X?(ee&&X?W:null)??(d??b)({rects:x,activeNodeRect:D,activeIndex:h,overIndex:y,index:k}):null,$=Hs(h)&&Hs(y)?i({id:a,items:p,activeIndex:h,overIndex:y}):k,z=S?.id,q=s.useRef({activeId:z,items:p,newIndex:$,containerId:m}),G=p!==q.current.items,Q=t({active:S,containerId:m,isDragging:I,isSorting:U,id:a,index:k,items:p,newIndex:q.current.newIndex,previousItems:q.current.items,previousContainerId:q.current.containerId,transition:u,wasDragging:q.current.activeId!=null}),Y=function(te){let{disabled:re,index:ge,node:J,rect:se}=te;const[Se,Me]=s.useState(null),oe=s.useRef(ge);return Ur(()=>{if(!re&&ge!==oe.current&&J.current){const ne=se.current;if(ne){const he=Ca(J.current,{ignoreTransform:!0}),ze={x:ne.left-he.left,y:ne.top-he.top,scaleX:ne.width/he.width,scaleY:ne.height/he.height};(ze.x||ze.y)&&Me(ze)}}ge!==oe.current&&(oe.current=ge)},[re,ge,J,se]),s.useEffect(()=>{Se&&Me(null)},[Se]),Se}({disabled:!Q,index:k,node:F,rect:T});return s.useEffect(()=>{U&&q.current.newIndex!==$&&(q.current.newIndex=$),m!==q.current.containerId&&(q.current.containerId=m),p!==q.current.items&&(q.current.items=p)},[U,$,m,p]),s.useEffect(()=>{if(z===q.current.activeId)return;if(z!=null&&q.current.activeId==null)return void(q.current.activeId=z);const te=setTimeout(()=>{q.current.activeId=z},50);return()=>clearTimeout(te)},[z]),{active:S,activeIndex:h,attributes:j,data:E,rect:T,index:k,newIndex:$,items:p,isOver:_,isSorting:U,isDragging:I,listeners:P,node:F,overIndex:y,over:L,setNodeRef:A,setActivatorNodeRef:H,setDroppableNodeRef:O,setDraggableNodeRef:R,transform:Y??V,transition:Y||G&&q.current.newIndex===k?CT:ee&&!Mc(v)||!u||!U&&!Q?void 0:ki.Transition.toString({...u,property:_f})}}function ic(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _T=[Sn.Down,Sn.Right,Sn.Up,Sn.Left],TT=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:d}}=t;if(_T.includes(e.code)){if(e.preventDefault(),!n||!o)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const h=r.get(m.id);if(h)switch(e.code){case Sn.Down:o.top<h.top&&c.push(m);break;case Sn.Up:o.top>h.top&&c.push(m);break;case Sn.Left:o.left>h.left&&c.push(m);break;case Sn.Right:o.left<h.left&&c.push(m)}});const u=(m=>{let{collisionRect:h,droppableRects:g,droppableContainers:f}=m;const x=y8(h),y=[];for(const w of f){const{id:b}=w,C=g.get(b);if(C){const k=y8(C),E=x.reduce((T,F,_)=>T+nf(k[_],F),0),M=Number((E/4).toFixed(4));y.push({id:b,data:{droppableContainer:w,value:M}})}}return y.sort(of)})({collisionRect:o,droppableRects:r,droppableContainers:c});let p=rf(u,"id");if(p===a?.id&&u.length>1&&(p=u[1].id),p!=null){const m=i.get(n.id),h=i.get(p),g=h?r.get(h.id):null,f=h?.node.current;if(f&&g&&m&&h){const x=Rc(f).some((k,E)=>d[E]!==k),y=L8(m,h),w=function(k,E){return!!(ic(k)&&ic(E)&&L8(k,E))&&k.data.current.sortable.index<E.data.current.sortable.index}(m,h),b=x||!y?{x:0,y:0}:{x:w?o.width-g.width:0,y:w?o.height-g.height:0},C={x:g.left,y:g.top};return b.x&&b.y?C:Ul(C,b)}}}};function L8(e,t){return!(!ic(e)||!ic(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const jT=e=>{let{transform:t}=e;return{...t,y:0}},MT=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:a,editable:d,selectedIndex:c,background:u,activeColor:p,borderColor:m,borderWidth:h,dragging:g,...f}=e;return l.jsxs("div",{ref:t,className:sr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...f,children:[l.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[l.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?l.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):l.jsx(l.Fragment,{})]}),l.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Hr={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},Tf=s.memo(s.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:a,index:d,listeners:c,onRemove:u,renderItem:p,sorting:m,style:h,transition:g,transform:f,value:x,wrapperStyle:y,...w},b)=>{s.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const C=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!m,index:d,fadeIn:!!r,listeners:c,ref:b,style:h,transform:f,transition:g,value:x}):l.jsx(l.Fragment,{children:x});return l.jsx("div",{className:sr("tab-item",Hr.Wrapper,r&&Hr.fadeIn,m&&Hr.sorting,t&&Hr.dragOverlay),style:{...y,transition:[g,y?.transition].filter(Boolean).join(", "),"--translate-x":f?`${Math.round(f.x)}px`:void 0,"--translate-y":f?`${Math.round(f.y)}px`:void 0,"--scale-x":f?.scaleX?`${f.scaleX}`:void 0,"--scale-y":f?.scaleY?`${f.scaleY}`:void 0,"--index":d},ref:b,children:l.jsx("div",{className:sr(Hr.Item,n&&Hr.dragging,i&&Hr.withHandle,t&&Hr.dragOverlay,o&&Hr.disabled,e&&Hr.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...w,tabIndex:i?void 0:-1,children:C})})})),O8={Row:"_Row_1kr10_1"},RT=s.memo(s.forwardRef(({children:e,horizontal:t,style:n},o)=>l.jsx("div",{ref:o,style:{...n},className:sr(O8.Row,t&&O8.horizontal),children:e}))),IT={...Cf},DT=s.memo(s.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=N_,coordinateGetter:d=TT,dropAnimation:c=IT,getItemStyles:u=()=>({}),getNewIndex:p,handle:m=!1,items:h,onMove:g,isDisabled:f=()=>!1,measuring:x,modifiers:y,renderItem:w,renderDivider:b,reorderItems:C=r5,strategy:k=i5,style:E,useDragOverlay:M=!0,onDragStart:T,wrapperStyle:F=()=>({})}=e,[_,O]=s.useState(()=>h);s.useEffect(()=>{O(h)},[h]);const[S,v]=s.useState(null),D=function(){for(var L=arguments.length,H=new Array(L),W=0;W<L;W++)H[W]=arguments[W];return s.useMemo(()=>[...H].filter(A=>A!=null),[...H])}(Ad(gf,{activationConstraint:o}),Ad(xf,{activationConstraint:o}),Ad(n5,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:d})),j=_.indexOf.bind(_),R=S?j(S):-1,P=[];_.map((L,H)=>{P.push(l.jsx(LT,{id:L,handle:m,index:H,style:u,wrapperStyle:F,disabled:f(L),renderItem:w,animateLayoutChanges:r,useDragOverlay:M,getNewIndex:p},L+"-"+H));const W=b?.({key:"divider-"+H});W&&P.push(W)});const{getPortalContainer:I}=(s.useEffect(()=>{function L(){const H=document.fullscreenElement;if(!H)return;let W=H.querySelector(".fullscreen-portal-root");W||(W=document.createElement("div"),W.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",H.appendChild(W))}return ys++,L(),document.addEventListener("fullscreenchange",L),()=>{document.removeEventListener("fullscreenchange",L),ys--,ys<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(H=>{H.parentNode&&H.parentNode.removeChild(H)}),ys=0)}},[]),{getPortalContainer:Gx});return l.jsxs(lT,{sensors:D,collisionDetection:a,onDragStart:L=>{const{active:H}=L;H&&(T?.(L),v(H.id))},autoScroll:{canScroll:L=>!0},onDragEnd:L=>{if(v(null),L.over){const H=j(L.over.id);R!==H&&(O(W=>C(W,R,H)),g?.(R,H))}},onDragCancel:()=>{v(null)},measuring:x,modifiers:y,children:[l.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...E},className:sr(n,Hr.Wrapper),children:l.jsx(bT,{items:_,strategy:k,children:l.jsx(RT,{ref:t,children:P})})}),M?uo.createPortal(l.jsx(gT,{adjustScale:i,dropAnimation:c,children:S?l.jsx(Tf,{value:_[R],handle:m,renderItem:w,wrapperStyle:F({index:R,isDragging:!0,id:_[R]}),index:R,dragging:!0,style:u({id:_[R],index:R,isSorting:S!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),I()):null]})}));function LT({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:a,style:d,renderItem:c,useDragOverlay:u,wrapperStyle:p}){const{attributes:m,isDragging:h,isSorting:g,listeners:f,overIndex:x,setNodeRef:y,transform:w,transition:b}=ET({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return l.jsx(Tf,{ref:y,value:r,disabled:e,dragging:h,sorting:g,handle:o,renderItem:c,index:i,style:d({index:i,id:r,isDragging:h,isSorting:g,overIndex:x}),onRemove:a?()=>a(r):void 0,transform:w,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:f,"data-index":i,"data-id":r,dragOverlay:!u&&h,...m})}const OT=new N.Color("rgb(33, 115, 70)"),AT="#eee",PT=e=>l.jsx(MT,{...e}),jf=s.memo(s.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:a=[],onSelectedTabIndexChange:d,onTabNameChange:c,onTabMove:u,createScrollStartButton:p=Zp,createScrollEndButton:m=Gp,createScrollEdgeButton:h=Dx,createTabButton:g=PT,createTabDivider:f,editLabelProps:x,disabled:y=!1,disableDrag:w=!1,background:b="white",activeColor:C=OT,borderColor:k=AT,borderWidth:E=1}=e,[M,T]=s.useState(i),[F,_]=s.useState(a),O=s.useCallback(Me=>{const oe=I.current?.[Me]?.closest(".tab-item")??I.current?.[Me];oe&&ee.current?.scrollTo({top:oe.offsetTop,left:oe.offsetLeft,behavior:"smooth"})},[]);s.useEffect(()=>{O(i)},[i]);const S=s.useCallback((Me,oe)=>{oe!==M&&(T(oe),d?.(oe)),O(oe)},[d,M]),v=s.useCallback((Me,oe)=>{u?.(Me,oe)},[u]),D=s.useRef(null),[j,R]=s.useState(-1),P=s.useCallback((Me,oe)=>{c?.(Me,oe)},[c]);s.useLayoutEffect(()=>{T(i)},[i]),s.useLayoutEffect(()=>{_(a)},[a]);const I=s.useRef([]),L=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign({startEdit(Me){I.current?.[Me]?.startEdit()},cancel(Me){I.current?.[Me]?.cancel()}},L.current),[M,j]);const H=s.useCallback(({value:Me,index:oe,dragging:ne})=>{const{style:he,maxLength:ze,...Ne}=x||{},gt=l.jsx(R_,{ref:bt=>{I.current[oe]=bt},value:Me,disabled:y,maxLength:ze,style:{color:M===oe&&C?C?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...he},styleHover:{},onSubmit:bt=>(D.current=!1,R(-1),P(oe,bt)),onCancel:()=>{D.current=!1,R(-1)},onChange:bt=>{D.current=!0,R(oe)},...Ne});return g({onClick:bt=>S(bt,oe),value:Me,index:oe,editing:j===oe&&D.current,editable:!0,disabled:y,selectedIndex:M,background:b,activeColor:C,borderColor:k,borderWidth:E,dragging:ne,children:gt})},[M,P,S,x,y,j,g]),[W,{width:A}]=Ci(),[U,{width:X}]=Ci(),ee=s.useRef(null),[V,$]=s.useState({left:0,top:0,width:0,height:0}),[z,q]=s.useState(null);s.useEffect(()=>{z!==null&&ee.current&&ee.current.scrollTo({left:z,behavior:"smooth"})},[z]);const G=s.useCallback((Me,oe=!1)=>{if(!ee.current)return 0;let ne=ee.current.firstChild.getBoundingClientRect(),he=ee.current.firstChild.firstChild.children,ze=0;return ze=oe?0:f3.getScrollTo(Me,ne.left,he,!0,Math.max(0,Me-200)),q(ze),Math.max(0,ze)},[]),Q=s.useCallback((Me,oe=!1)=>{if(!ee.current)return 0;let ne=ee.current.firstChild.getBoundingClientRect(),he=ee.current.firstChild.firstChild.children,ze=0;const Ne=Math.ceil(X-A);return ze=oe?Ne:f3.getScrollTo(Me,ne.left,he,!1,Math.max(0,Me+200)),q(ze),Math.min(Ne,ze)},[X,A]),Y=s.useRef(null),te=s.useRef(null),re=s.useCallback(()=>{te.current&&(clearTimeout(te.current),te.current=null,Y.current=null)},[]),ge=s.useCallback((Me,oe,ne=260)=>{Y.current=Me,te.current=setTimeout(()=>{const he=oe?G(Y.current||Me):Q(Y.current||Me);he!==Y.current?ge(he,oe,120):re()},ne)},[G,Q,re]);s.useEffect(()=>()=>re(),[re]);const J=s.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(V.left)<=0||Math.floor(X-A)===0,orientation:Fo.Horizontal,onMouseUp:re,onMouseLeave:re,onMouseDown:()=>ge(ee.current.scrollLeft,!0),onClick:Me=>G(Math.min(ee.current.scrollLeft,z??Number.MAX_SAFE_INTEGER),Me.ctrlKey)}),[V,z,X,A]),se=s.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-A)<=Math.ceil(V.left),orientation:Fo.Horizontal,onMouseUp:re,onMouseLeave:re,onMouseDown:()=>ge(ee.current.scrollLeft,!1),onClick:Me=>Q(Math.max(ee.current.scrollLeft,z??0),Me.ctrlKey)}),[V,z,X,A]),Se=s.useMemo(()=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{minWidth:"16px"}}),n,h?.(J)]}),[J,se,p,m,n,h]);return l.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:sr("_TabStrip_3x0dp_1",r),ref:L,children:[l.jsx("div",{style:{borderTop:`solid ${k} ${E}px`,position:"absolute",width:"100%"}}),l.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),l.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:l.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:ee,onScroll:Me=>{$({left:Me.target.scrollLeft,top:Me.target.scrollTop,width:Me.target.scrollWidth,height:Me.target.scrollHeight})},children:l.jsx(DT,{isDisabled:Me=>y||w,items:F,strategy:yT,modifiers:[jT],ref:U,renderItem:H,renderDivider:f,onMove:v,activationConstraint:{distance:15}})})}),l.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(se)})]})}));jf.displayName="TabStrip";const FT=e=>l.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[l.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),l.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),l.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),l.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),zT=s.createContext(null),a5=()=>{const e=s.useContext(zT),[t]=s.useState(()=>new N.ThemeCollection);return s.useMemo(()=>e||t,[e])},BT=s.lazy(()=>Promise.resolve().then(()=>require("./3eFeaOE8BdZL1wxv.cjs"))),NT={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},A8=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),a=await i.getNavigationTree(o.uri.toString()),d=e.getPosition();let c={...d};c.lineNumber=1,c.column=1;let u=!1;for(let x=d.lineNumber;x>=1;x--)if(o.getLineContent(x).trim()===""){const y=l5(a,o.getOffsetAt({lineNumber:x,column:1}),"function");if(!y||HT(y)){u=!0,c.lineNumber=x+1;break}{const w=y.spans[0].start;x=o.getPositionAt(w).lineNumber,c.lineNumber=x}}let p=n,m=!1;!u&&!p.startsWith(`
|
|
77
77
|
`)&&c.lineNumber>1&&(p=`
|
|
78
78
|
`+p,m=!0);let h=!1;o.getLineCount()>1&&(p.endsWith(`
|
|
79
79
|
|
|
80
80
|
`)||(p+=`
|
|
81
81
|
|
|
82
|
-
`,h=!0));const g=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let f=null;o.pushEditOperations([],g,x=>(f=x[0].range,m&&f.startLineNumber++,h&&f.endLineNumber--,[new t.Selection(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)])),e.setSelection({startLineNumber:f.endLineNumber,startColumn:f.endColumn,endLineNumber:f.startLineNumber,endColumn:f.startColumn})};function VT(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function i2(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,a=e.getPositionAt(i);r.push({name:o.text,type:VT(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)i2(e,t,n,i,r);return r}function l5(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const a=r[i];if(a.start<=t&&t<a.start+a.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const d of e.childItems||[]){const c=l5(d,t,n,o);if(c)return c}}return null}}function HT(e){return e.kind==="comment"}const $T=s.memo(s.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:a,darkMode:d,loadingPanel:c,autoFocus:u=!0,onStatusChange:p,...m}=e,h=s.useRef(null),g=de(a,[a]),f=s.useRef(!1),x=s.useMemo(()=>({contains(L){if(!h.current)return;const H=h.current.editor;return H&&H.getDomNode()?.contains(L)},focus(){if(!h.current)return;const L=h.current.editor;return L&&L.getDomNode()?.focus()}}),[]),y=s.useMemo(()=>[new _e("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),w=s.useMemo(()=>{let L=null;const H=()=>x;return L=r?r.createChildGroup(H,"scriptEditor",!1):new Ei(H,"scriptEditor"),L.addCommands(y,!0),L},[r,y]),b=no(w,["executeSelectedScript"])[0],C=b?.context(),k=de(L=>{b?.execute(L)},[b]),E=s.useRef(""),[M,T]=s.useState(!1),F=de(async()=>{if(!h.current)return null;const L=h.current,H=L.editor;if(!H)return null;const W=L.monaco,A=await(async(U,X,ee="export")=>{const V=U.getModel();if(!V)return null;const $=await X.languages.typescript.getTypeScriptWorker(),z=await $(V.uri),q=await z.getNavigationTree(V.uri.toString());let G=null,Q=U.getSelection();const Y=Q.startLineNumber===Q.endLineNumber&&Q.startColumn===Q.endColumn?V.getLineCount():Math.min(Q.endLineNumber,V.getLineCount());for(let te=Q.startLineNumber;!G&&te<=Y;te++){const re=l5(q,V.getOffsetAt({lineNumber:te,column:1}),"function",ee);re&&(G=re.text)}return G})(H,W);return p?.({message:(A??"").toUpperCase()}),A?{source:H.getValue(),name:A}:null},[p]),_=de(async(L,H,W)=>{const A=await C.getScripts().createModule({source:W?.getValue(),declarationsOnly:!0}),U=A?A.getFunctions().search():zt.EmptyArray;A&&(async function(X,ee){const V=[];for(let $=1;$<X.getLineCount()+1;$++){const z={startLineNumber:$,startColumn:1,endLineNumber:$,endColumn:X.getLineLength($)+1},q=X.getValueInRange(z).indexOf("modelt");q!==-1&&V.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ee.MarkerSeverity.Hint,startLineNumber:z.startLineNumber,startColumn:q+1,endLineNumber:z.startLineNumber,endColumn:q+5})}ee.editor.setModelMarkers(X,"owner",V)}(L,H),async function(X,ee,V,$){const z=await ee.languages.typescript.getTypeScriptWorker(),q=await z(X.uri),G=await q.getNavigationTree(X.uri.toString()),Q=i2(X,ee,$,G).map(Y=>{let te=null,re=null;return Y.type==="formula"?(te="formula.margin-icon",re="Formula"):Y.type==="macro"?(te="macro.margin-icon",re="Macro"):Y.type==="autoRun"&&(te="autorun.margin-icon",re="Auto Run"),{range:new ee.Range(Y.lineNumber,1,Y.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:te,glyphMarginHoverMessage:re,stickiness:ee.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});D.current&&D.current.clear(),D.current=V.createDecorationsCollection(Q)}(L,H,W,U))},[C]),O=de(zt.debounce(_,580),[]),S=de(async(L=void 0)=>{if(!h.current||!C)return;const H=h.current.editor.getPosition(),W={cursor:H?H.toString():""};L!==void 0&&(W.message=L),p?.(W);const A=F();C.setSelectedFunction(A)},[C,p]);s.useEffect(()=>{if(!C)return;const L={insertSnippet:W=>{h.current?.editor&&(M?A8(h.current.editor,h.current.monaco,W):E.current=W)}};C.setEditor(L),C.setSelectedFunction(F());const H=C.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,A=C?.getScripts().getModules().getByName("scripting"),U=A?.getSource(),X=W.getValue();if((U?.length??0)===X.length&&U===X)return;await C.saveSource(W.getValue());const ee=(U?.length??0)!==X.length||U!==X;p?.({dirty:ee})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,A=C.getScripts().getModules().search()[0]?.getSource()??"";W.setValue(A)}});return()=>{H(),C.setSelectedFunction(null),C.setEditor(null)}},[C,M]),s.useEffect(()=>()=>{if(!h.current?.editor)return;const L=h.current.editor;C?.saveSource(L.getValue())},[]);const v=de(L=>{const H=h.current;if(!H)return!1;const W=H.editor;return!!W&&(W.focus(),!0)},[]),D=s.useRef(null),j=de((L,H)=>{h.current={monaco:H,editor:L},T(!0),S("Loading Types");const W=C.getScripts().getModules().search()[0]?.getSource()??"";L.setValue(W),Promise.resolve().then(()=>require("./C9eqE9OnPkiI-5Zd.cjs")).then(U=>U.c).then(U=>{S(""),U.AutoTypings.create(L,{shareCache:!0,monaco:H,onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(async X=>{const ee=L.getModel();O(ee,H,L)})}),L.addCommand("executeScript",function(U,...X){X?.[0]&&k({functionName:X?.[0]})},""),L.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async U=>{const X=F();C.setSelectedFunction(X);const ee=await X;k(ee)}}),L.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:U=>{C?.saveSource(L.getValue()).then(()=>{const X=C?.getScripts().getModules().getByName("scripting"),ee=X?.getSource(),V=L.getValue(),$=(ee?.length??0)!==V.length||ee!==V;p?.({dirty:$})})}}),L.onMouseDown(async U=>{if(U.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=U.target.position.lineNumber,ee=await H.languages.typescript.getTypeScriptWorker(),V=await ee(A.uri),$=await V.getNavigationTree(A.uri.toString()),z=L?.getValue(),q=(await C?.saveSource(z)).getFunctions().search(),G=i2(A,H,q,$).find(Q=>Q.lineNumber===X);if(G){const Q=U.event.browserEvent.button;Q===0?G.type==="macro"||G.type==="autoRun"?k({functionName:G.name}):G.type==="formula"&&C.quickInsertFunction?.(G.name):Q===2&&(console.log("Context menu for function:",G.name),U.event.browserEvent.preventDefault())}}}),L.onDidChangeModelContent(()=>{const U=L.getModel();O(U,H,L)});const A=L.getModel();(function(U,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ee,V,$){const z=[];for(let q=1;q<ee.getLineCount()+1;q++){const G={startLineNumber:q,startColumn:1,endLineNumber:q,endColumn:ee.getLineLength(q)+1},Q="hint",Y=ee.getValueInRange(G).indexOf("hint");Y!==-1&&z.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:G.startLineNumber,column:Y+Q.length+1},label:"[hint]"})}return{hints:z,dispose:()=>{}}}})})(0,H),A.onDidChangeContent(U=>{const X=C?.getScripts().getModules().getByName("scripting"),ee=X?.getSource(),V=L.getValue(),$=(ee?.length??0)!==V.length||ee!==V;p?.({dirty:$})}),L.onDidChangeCursorPosition(U=>{S()})},[C,p]),R=s.useMemo(()=>M?null:c||l.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[M,c]),P=s.useMemo(()=>{const L=C?.getScripts().getModules().getByName("scripting")?.getSource()??"";return l.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[l.jsx(s.Suspense,{children:l.jsx(BT,{theme:d?"extended-dark":"extended",options:{...NT,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:L,onValidate:H=>{let W=!1;for(let A=0;!W&&A<H?.length;A++)H[A].severity===8&&(W=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let W=!1;try{const U=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),X=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),ee=H.editor.createModel(U,"typescript",X);H.editor.setModelMarkers(ee,"default",[]),W=!0}catch(U){console.warn("cant load types",U)}H.languages.registerLinkProvider("*",{provideLinks:(U,X)=>{const ee=[],V={links:ee},$=U.getLinesContent();for(let z=1;z<=$.length;z++){const q=$[z-1],G=H.editor.tokenize(q,"typescript");for(let Q=0;Q<G[0].length;Q++){const Y=G[0]?.[Q];if(Y&&Y.type.startsWith("string")){let te=Y.offset,re=G[0]?.[Q+1]?.offset??q.length,ge=new H.Range(z,te+1,z,re+1),J=U.getValueInRange(ge);const se=J[0];se!=="`"&&se!=="'"&&se!=='"'||(te++,J=J.substring(1));const Se=J[J.length-1];Se!=="`"&&Se!=="'"&&Se!=='"'||(te++,J=J.substring(0,J.length-1));try{C.getRanges(J)&&ee.push({range:{endColumn:re,endLineNumber:z,startColumn:te,startLineNumber:z},tooltip:`Goto range '${J}'`,url:`/range/${J}`})}catch(Me){console.warn(Me)}}}}return V}}),H.editor.registerLinkOpener({open(U){if(U?.path?.startsWith("/range/")){try{C.getRanges(U.path.substring(7))?.select()}catch(X){console.warn("invalid range",X)}return!0}return!1}});const A=H.languages.typescript.typescriptDefaults.getCompilerOptions();H.languages.typescript.typescriptDefaults.setCompilerOptions({...A,target:H.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:H.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),E.current&&(await A8(h.current.editor,h.current.monaco,E.current),E.current=null),f.current&&requestAnimationFrame(async()=>{f.current&&H.editor.focus()}),H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),T(!0)})()},onMount:j})}),R]})},[C,w,i,R,d]),I=Mo(t,()=>({isScriptEditorElement:()=>!0,focus:L=>{v(L)},close:()=>{g?.()},getEditor:()=>C?.getEditor()}),[C]);return s.useEffect(()=>(u&&requestAnimationFrame(()=>{v()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{I.current?.contains(document.activeElement)&&v()})}),[]),l.jsx("div",{className:sr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:I,...m,children:P})})),Mf={Preset:"preset",Custom:"custom"},ra={Start:"start",End:"end"},Bd={},WT=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(Bd[r])return Bd[r];const i=((a,d,c,u)=>{if(typeof document>"u"&&!u)return null;const p=u?new u:document.createElement("canvas");p.width=2*c,p.height=2*c;const m=p.getContext("2d");return m?(m.fillStyle=a,m.fillRect(0,0,p.width,p.height),m.fillStyle=d,m.fillRect(0,0,c,c),m.translate(c,c),m.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return Bd[r]=i,i},UT={},Rf=s.memo(e=>{const{className:t,style:n=hn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:d,renderers:c=UT,children:u,...p}=e,m=u,h=s.useMemo(()=>Object.assign({borderRadius:a,boxShadow:d,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${WT(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return s.isValidElement(u)?s.cloneElement(u,{...m.props}):l.jsx("div",{style:h,...p})}),qT=s.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:d,onFocus:c,style:u=hn.EmptyCssProperties,children:p,alphaWhite:m,alphaGrey:h,darkMode:g,alphaCheckSize:f=7,...x}=e;if(!t)throw new Error("a selectedColor is required");const y=s.useCallback(M=>{r?.(M),M.isDefaultPrevented()||(M.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),w=s.useCallback(M=>{a?.(M),M.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=s.useCallback(M=>{d?.(M),M.isDefaultPrevented()},[o,d]),C=s.useCallback(M=>{c?.(M),M.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),k=s.useCallback(M=>{i?.(M),M.isDefaultPrevented()||M.keyCode===Wt.Enter&&n?.(t.toRGBA())},[n,i,t]),E=s.useMemo(()=>t.toRGBA().alpha===1?null:l.jsx(Rf,{size:f,white:m,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[m,h,t]);return l.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...u},tabIndex:0,...x,onClick:y,onKeyDown:k,onMouseOver:w,onMouseLeave:b,onFocus:C,children:[E,l.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),Dc=s.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:a,swatchProps:d,defaultButtonSize:c=24,isLarge:u=!1,compareRGB:p=!1,darkMode:m=!1,...h}=e,g=new N.Color({val:r.definition.val,adjs:r.definition.adjs},E=>t(E)),f=p?g.toRGBA().toString():g.toString(),x=n&&(p?n.toRGBA().toString():n.toString())===f,y=o&&(p?o.toRGBA().toString():o.toString())===f,w=[];w.push({[N.IColor.AdjustmentType.Inv]:!0}),w.push({[N.IColor.AdjustmentType.Alpha]:100});const b=g.adjust(w),C=s.useCallback(()=>{i?.(r)},[i,r]),k=s.useCallback(E=>{a?.(E?r:null)},[a,r]);return l.jsx(br,{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:l.jsx("div",{style:{width:c*(u?1.2:1)+"px",height:c*(u?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:l.jsxs(qT,{selectedColor:g,title:null,onSelectColor:C,onPreviewColor:k,alphaCheckSize:u?9:void 0,darkMode:m,...d,children:[l.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(m).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:x?"1":"0"}}),l.jsx("div",{style:{position:"absolute",width:.33*c*(u?1.2:1)+"px",height:.33*c*(u?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(m).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Ws=s.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:d,style:c=hn.EmptyCssProperties,compareRGB:u=!1,darkMode:p,swatchProps:m,...h}=e;let g;if(Array.isArray(o[0]))g=o;else{g=[];for(let b=0;b<o.length;b++)g.push([o[b]])}const f=s.useCallback(b=>{a?.(b)},[a]),x=s.useCallback(b=>{d?.(b)},[d]),y=s.useMemo(()=>{let b=[];for(let C=0;C<g.length;C++){let k=[],E=g[C];for(let T=0;T<E.length;T++){let F=E[T];k.push(l.jsx(Dc,{schemeColorLookup:n,colorDef:F,selectedColor:r,previewColor:i,onSelectColorDef:f,onPreviewColorDef:x,swatchProps:m,compareRGB:u,darkMode:p},C+" "+T))}let M=l.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:T=>T.shadows[2],borderRadius:"2px",overflow:"hidden"},children:k},""+C);b.push(M)}return b},[g,r,i,f,x]),w=s.useMemo(()=>t?l.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:t}):null,[t]);return l.jsxs(B.Box,{style:{...c},children:[w,l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:y})]})}),$r=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),xo=(e,t,n,o,r,i)=>{const a=$r(e,t);o?.push(a);const d=new N.Color({val:a.definition.val,adjs:a.definition.adjs},n),c=d.toString();r?.set(c,d);const u=d.toRGBA().toString();i?.set(u,d)},ZT=s.lazy(()=>Promise.resolve().then(()=>require("./DwLcsRl4-LumKl6l.cjs"))),If=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:a=!1,previewDebounceTime:d=100,initialPanelType:c,defaultButtonSize:u=24,width:p,onElementLoad:m,onDone:h,onEyeDropStart:g,onEyeDropStop:f,onPreviewColor:x,onPreviewColorImmediate:y,onSelectColor:w,autoColor:b,autoColorLabel:C="Automatic",autoColorPosition:k=ra.Start,compareRGB:E=!1,darkMode:M=!1,...T}=e,F=o||n,_=de(x,[x]),O=de(y,[y]),S=de(w,[w]),v=de(g,[g]),D=de(f,[f]),[j,R]=s.useState(!1),P=Pr(),I=s.useMemo(()=>i||N.Color.getDefaultSchemeLookup(),[i]),L=s.useMemo(()=>{const J=new Map,se=new Map,Se=[];xo("Primary Background","bg1",I,Se,J,se),xo("Primary Text","tx1",I,Se,J,se),xo("Secondary Background","bg2",I,Se,J,se),xo("Secondary Text","tx2",I,Se,J,se),xo("Accent 1","accent1",I,Se,J,se),xo("Accent 2","accent2",I,Se,J,se),xo("Accent 3","accent3",I,Se,J,se),xo("Accent 4","accent4",I,Se,J,se),xo("Accent 5","accent5",I,Se,J,se),xo("Accent 6","accent6",I,Se,J,se);const Me=N.ITheme.buildPalette(Se,I,J,se),oe=[];if(xo("Dark Red","C00000",I,oe,J,se),xo("Red","FF0000",I,oe,J,se),xo("Orange","FFC000",I,oe,J,se),xo("Yellow","FFFF00",I,oe,J,se),xo("Light Green","92D050",I,oe,J,se),xo("Green","00B050",I,oe,J,se),xo("Light Blue","00B0F0",I,oe,J,se),xo("Blue","0070C0",I,oe,J,se),xo("Dark Blue","002060",I,oe,J,se),a?xo("Purple Is A Fruit","7030A0",I,oe,J,se):xo("Transparent","00000000",I,oe,J,se),b){const Ne=b.toString();J.set(Ne,b)}const ne=new Map,he=typeof r=="function"?r():r,ze=[];for(let Ne=0;he&&Ne<he.length;Ne++){const gt=he[Ne].toString();ne.set(gt,he[Ne]),ze.push({description:"Recent "+(Ne+1),definition:{val:he[Ne].toString()}})}return{primaryColors:Se,modifiedPresets:Me,standardColors:oe,recentColorsLimited:ze,mapAllPresets:J,mapAllPresetsRGB:se,mapRecent:ne}},[I,r,a,b]);s.useEffect(()=>{m?.()},[]);const[H,W]=s.useState(!1),A=s.useCallback(()=>{W(J=>!J)},[]);s.useEffect(()=>{if(c)W(c===Mf.Custom);else if(n){let J=n.toString(),se=L.mapAllPresets.get(J);se||(J=n.toRGBA().toString(),se=L.mapAllPresetsRGB.get(J));const Se=L.mapRecent.get(J);W(!se&&!Se)}},[n,c]);const U=s.useCallback(N.CommonUtils.debounce(J=>{_?.(J)},d),[_,d]),[X,ee]=s.useState();s.useEffect(()=>{ee(o||n)},[o,n]);const V=de(J=>{O&&(O(J),U(J))},[O]),$=de(J=>{V(J?new N.Color({val:J.definition.val,adjs:J.definition.adjs},I):null)},[I]),z=s.useCallback(J=>{J.ctrlKey&&W(!0)},[]),q=de(J=>{let se=!1;if(J){const Se=J.toString();se=!L.mapAllPresets.has(Se)}S?.(J,se)},[S,L]),G=de(J=>{const se=J?new N.Color({val:J.definition.val,adjs:J.definition.adjs},I):null;Promise.resolve(h?.()).then(()=>{q(se)})},[I,h]),Q=de(J=>{V(J?new N.Color(J,I):null)},[I]),Y=s.useMemo(()=>window.EyeDropper===void 0?l.jsx(l.Fragment,{}):l.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:J=>J.palette.text.icon??J.palette.action.active},onClick:async()=>{R(!0),v?.(),await new EyeDropper().open().then(J=>{R(!1),D?.();let se=new N.Color(J.sRGBHex),Se=se.toString(),Me=L.mapAllPresets.get(Se);if(Me||(Se=se.toRGBA().toString(),Me=L.mapAllPresetsRGB.get(Se)),!Me){const oe=se.toRGBA(),ne=3;let he=255;L.mapAllPresetsRGB.forEach((ze,Ne)=>{const gt=ze.toRGBA(),bt=Math.abs(gt.red-oe.red)+Math.abs(gt.blue-oe.blue)+Math.abs(gt.green-oe.green);bt<ne&&bt<he&&(Me=ze)})}W(!Me),V(Me||se)}).catch(J=>{R(!1),J?.name!=="AbortError"&&console.error(J)})},children:l.jsx(gn.Colorize,{})}),[L,M]),te=s.useMemo(()=>{if(!H)return;const J={opacity:H?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return l.jsx(s.Suspense,{fallback:l.jsx("div",{style:J,children:l.jsx(Z0,{})}),children:l.jsx(ZT,{style:J,selectedColor:F?F.toRGBA().toString():"transparent",onColorChange:Q,disableAlpha:a})})},[H,F]),re=s.useMemo(()=>({onClick:z,alphaGrey:P.palette.text.icon??P.palette.action.active}),[z,P]),ge=s.useMemo(()=>{if(!b)return null;const J={description:C,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return l.jsx(l.Fragment,{children:l.jsxs(B.MenuItem,{sx:{display:"flex",color:se=>se.palette.text.secondary},onMouseOver:()=>{$(null)},onClick:()=>{G(null)},children:[l.jsx(B.Box,{sx:{flex:"none",boxShadow:se=>se.shadows[2],borderRadius:se=>se.spacing(.5),overflow:"hidden"},children:l.jsx(Dc,{schemeColorLookup:I,colorDef:J,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:u,isLarge:!0,darkMode:M,compareRGB:E,swatchProps:re})}),l.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:C})]})})},[b,C,I,n,o]);return l.jsxs(B.Box,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...T,children:[l.jsxs("div",{style:{position:"relative",display:"flex"},children:[l.jsxs("div",{style:{opacity:H?"0":1},children:[ge&&k===ra.Start?l.jsxs(l.Fragment,{children:[ge,l.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,l.jsx(Ws,{title:"Theme Colors",schemeColorLookup:I,colorDefs:L.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsx(Ws,{schemeColorLookup:I,colorDefs:L.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsx(Ws,{title:"Standard Colors",schemeColorLookup:I,colorDefs:L.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsxs("div",{style:{opacity:L.recentColorsLimited.length===0?"0":void 0,display:L.recentColorsLimited.length===0?"none":void 0},children:[l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsx(Ws,{title:"Recent Colors",schemeColorLookup:I,colorDefs:L.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M})]}),ge&&k===ra.End?l.jsxs(l.Fragment,{children:[l.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ge,l.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),te]}),l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[Y,l.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),l.jsx(B.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{A()},children:H?l.jsx("div",{children:"Preset"}):l.jsx("div",{children:"Custom"})}),l.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{q(X)})},children:"Done"})]})]})})),GT=l.jsx(Tb,{}),s5=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=GT,tooltip:i,label:a,onPreviewColor:d,onPreviewColorImmediate:c,onSelectColor:u,variant:p=Lr.Toolbar,panelProps:m,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:f=!1,...x}=e,y=de(d,[d]),w=de(c,[c]),b=de(u,[u]),[C,k]=s.useState(()=>{}),E=o||C||n||m?.autoColor,M=s.useRef(!1),T=s.useCallback(()=>{},[]),F=de(()=>{k(n)},[n]),_=de(L=>{M.current||(k(L),y?.(L))},[y]),O=de(L=>{M.current||(k(L),w?.(L))},[w]),S=de((L,H)=>{M.current||(k(void 0),b?.(L,H))},[b]),v=s.useMemo(()=>l.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${E?.toCSS(f)??"transparent"}`,"& .activeColor":{fill:`${E?.toCSS(f)??"transparent"}`},"& .style_grey":{fill:L=>L.palette.text.icon??L.palette.action.active}},children:typeof r=="function"?r():r}),[E,r,f]),D=de(L=>{b?.(o,!1)},[b,o]),[j,R]=s.useState(!1),P=s.useCallback(L=>{const{closeFloat:H,closeFloatAll:W}=L;return l.jsx(If,{...m,selectedColor:n,previewColor:C,onDone:h?W:H,onKeyDown:A=>{A.which===Wt.Enter&&(h?W():H())},onPreviewColorImmediate:O,onPreviewColor:_,onSelectColor:S,onEyeDropStart:()=>R(!0),onEyeDropStop:()=>R(!1),compareRGB:g,darkMode:f})},[n,C,h,E,m?.autoColor,f]),I={onQuickClick:o?D:void 0,createPopupPanel:P,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:F,onPopupClose:T,tooltip:i||a||"Color",label:a,icon:v,...x};return p===Lr.Toolbar?l.jsx(Gr,{ref:t,...I}):l.jsx(Jl,{ref:t,...I})})),C1=82,a2=e=>{const{styleColor:t,length:n=C1,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:d=!1,darkMode:c=!1,...u}=e;return l.jsx(B.SvgIcon,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...u,children:l.jsx(Um,{length:n,width:o,dashArray:r,isDouble:a,isAngled:d,className:"activeColor"})})},Df=s.memo(s.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:a,selectedStyle:d,onSelectStyle:c,showNone:u=!0,darkMode:p,sx:m,...h}=e,g=de(c,[]),f=s.useCallback(b=>{const{popupContainer:C,floatReference:k,closeFloat:E,...M}=b,T=[],F=N.IBorder.BuiltInDefinitionsArray;for(let _=0;_<F.length;_++){const O=F[_];if(O.description==="None"&&!u)continue;const S=l.jsx(a2,{styleColor:a,length:C1,width:O.width,darkMode:p,dashArray:O.pattern,isDouble:O.description.toLowerCase().includes("double"),isAngled:O.description.toLowerCase().includes("slant")});let v=null;v=o?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{marginRight:"6px"},children:O.description}),l.jsxs(B.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[l.jsx("div",{style:{flex:"1 1 100%"}}),S]})]}):O.description==="None"?"None":S,T.push(l.jsx(lr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:w6(4)},paddingLeft:"16px",background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},tooltipProps:{description:o?"":O.description},icon:null,disabled:r,onMouseDown:D=>D.preventDefault(),onMouseUp:()=>{E(),g(O.style)},onKeyDown:D=>{D.which===Wt.Enter&&E()},selected:O.style===d,parentFloat:k,children:v},_))}return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:T})},[r,u,a,d,p]),x=s.useMemo(()=>{const b=N.IBorder.BuiltInDefinitions.get(d);let C;return C=b.description==="None"?l.jsx(B.Box,{sx:{minWidth:`${C1}px`},children:"None"}):l.jsx(a2,{styleColor:a,length:C1,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),l.jsx(B.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:w6()}},children:C})},[d,a]),y=s.useMemo(()=>N.IBorder.BuiltInDefinitions.get(d),[d]),w={disabled:r,icon:x,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...m},createPopupPanel:f,...h};return n===Lr.Toolbar?l.jsx(Gr,{...w}):l.jsx(Jl,{...w})})),Lf=s.memo(s.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=N.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:a=!1,showStylingBefore:d=!0,onSelectBorder:c,onPreviewBorder:u,selectedBorder:p,createTemporaryBorder:m,...h}=e,g=de(c,[c]),f=de(u,[u]),[x,y]=s.useState(),[w,b]=s.useState(),C=x??r,k=w??n,E=p||{bottom:{style:r,color:n?.toString()}},M=de(v=>{const D={},j=v?Object.keys(v):[];let R=!1;for(let X=0;X<j.length;X++)v[j[X]]?.style&&(D[j[X]]={style:v[j[X]].style,color:v[j[X]].color},R||D[j[X]].style===N.IBorder.StrokeStyle.None||(R=!0));j.length<6&&(R=!0);const P=R?D.left:null,I=R?D.top:null,L=R?D.right:null,H=R?D.bottom:null,W=R?D.vertical:null,A=R?D.horizontal:null;let U="";return I||P||(U+="M 3,5 H 5 V 3 H 3 "),I||(U+="M 7,5 H 9 V 3 H 7 "),I||W||(U+="M 11,5 h 2 V 3 h -2 "),I||(U+="M 15,5 h 2 V 3 h -2 "),I||L||(U+="M 19,5 h 2 V 3 h -2 "),P||(U+="M 3,9 H 5 V 7 H 3 "),W||(U+="M 11,9 h 2 V 7 h -2 "),L||(U+="M 19,9 h 2 V 7 h -2 "),A||P||(U+="M 3,13 H 5 V 11 H 3 "),A||(U+="M 7,13 H 9 V 11 H 7 "),A||W||(U+="M 11,13 h 2 v -2 h -2 "),A||L||(U+="M 19,13 h 2 v -2 h -2 "),A||(U+="M 15,13 h 2 v -2 h -2 "),P||(U+="M 3,17 H 5 V 15 H 3 "),W||(U+="M 11,17 h 2 v -2 h -2 "),L||(U+="M 19,17 h 2 v -2 h -2 "),H||P||(U+="M 3,21 H 5 V 19 H 3 "),H||(U+="M 7,21 H 9 V 19 H 7 "),H||W||(U+="M 11,21 h 2 v -2 h -2 "),H||(U+="M 15,21 h 2 v -2 h -2 "),H||L||(U+="M 19,21 h 2 v -2 h -2 "),l.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[l.jsx(B.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:l.jsx("path",{d:U})}),l.jsx(B.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:Yl}},children:l.jsx(Q2,{getBorderAt:(X,ee)=>{if(!m||j.length===0)return null;const V=X.rowIndex,$=X.colIndex,z={};return V===0?(z.top=D.top,z.bottom=D.horizontal):(z.top=D.horizontal,z.bottom=D.bottom),$===0?(z.left=D.left,z.right=D.vertical):(z.left=D.vertical,z.right=D.right),m?.(z)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[k,C,a]),T=s.useCallback((v,D,j)=>{let R=null;if(v&&v.length>0){let P=null;(D||j)&&(P={style:j,color:D?.toString()??null}),R={};for(let I=0;I<v.length;I++)R[v[I]]=P}return R},[]),F=s.useCallback(v=>{g?.(v)},[]),_=s.useCallback(v=>{f?.(v)},[]),O=s.useCallback(v=>{const{closeFloatAll:D,floatReference:j}=v,R=(L,H,W="bottom",A=!1)=>{const U=T(L,k??null,A?N.IBorder.StrokeStyle.None:C??null),X=A?T([],k??null,C??null):U;return l.jsx(gr,{icon:M(X),sx:{background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},tooltipProps:{label:H,simple:!0,placement:W},onClick:()=>{D(),_(U),F(U)}})},P=l.jsxs(l.Fragment,{children:[l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom,N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical],"All Borders","top"),R([N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical],"Inner Borders","top"),R([N.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),R([N.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom],"Outside Borders","top")]}),l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[R([N.IBorder.Edge.Left],"Left Borders"),R([N.IBorder.Edge.Top],"Top Borders"),R([N.IBorder.Edge.Right],"Right Borders"),R([N.IBorder.Edge.Bottom],"Bottom Borders"),R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom,N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical,N.IBorder.Edge.DiagonalUp,N.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),I=l.jsx(l.Fragment,{children:l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[l.jsx(s5,{variant:Lr.Toolbar,icon:l.jsx(T2,{}),selectedColor:C===N.IBorder.StrokeStyle.None?new N.Color("transparent"):k,onPreviewColor:L=>{b(L)},onSelectColor:(L,H)=>{b(L)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||C===N.IBorder.StrokeStyle.None,parentFloat:j,shouldCloseFloatAll:!1}),l.jsx(Df,{selectedStyle:C,onSelectStyle:y,styleColor:k,darkMode:a,variant:Lr.Toolbar,parentFloat:j})]})});return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:L=>L.stopPropagation(),children:[d?I:P,l.jsx(Mt,{orientation:"horizontal"}),d?P:I]})},[C,k,n,o,a]),S=s.useMemo(()=>M(E),[E,a]);return l.jsx(Gr,{ref:t,createPopupPanel:O,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},D)=>l.jsx(Bo,{label:"Borders",description:"Set the borders.",disabled:D,children:v}),onQuickClick:()=>{g?.(E)},quickButtonProps:{sx:{}},disabled:i,icon:S,...h})})),Of=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Ht.Toolbar,disabled:a=!1,autoColor:d,autoStrokeStyle:c,schemeLookup:u,createTemporaryBorder:p,selectedBorder:m,onSelectBorder:h,darkMode:g,icon:f,label:x,...y}=e,w=no(n,["formatBorder"]),b=o??w[0],C=b?.context()??null,k=C?.autoColor??d,E=C?.autoStyle??c,M=m??C?.quickBorder,T=g??C?.darkMode,F=p??C?.createTemporaryBorder,_=u??C?.schemeLookup,O=de(v=>{C?.onBorderSelect&&C.onBorderSelect(v),h?.(v),b?.execute(v,r)},[b,h,r]),S=s.useCallback((v,D)=>{const{children:j,title:R,...P}=v;let I=v.children;return(b?.disabled()||a)&&(I=l.jsx("div",{children:I})),l.jsx(ba,{command:b,placement:i===Ht.Toolbar?"bottom-start":"right-start",disabled:D,...P,children:I})},[b,a]);return l.jsx(Lf,{ref:t,autoColor:k,darkMode:T,autoStrokeStyle:E,createTemporaryBorder:F,schemeLookup:_,selectedBorder:M,onSelectBorder:O,createTooltip:S,disabled:a||!b||b.disabled(),...y})})),Af=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("mergeToggle"),icon:xe(l.jsx(v6,{}))}),l.jsx(je,{...p,command:u.getCommand("mergeHorizontal"),icon:xe(l.jsx(jb,{}))}),l.jsx(je,{...p,command:u.getCommand("mergeVertical"),icon:xe(l.jsx(Mb,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:u.getCommand("unmerge"),icon:xe(l.jsx(zh,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:d,icon:xe(l.jsx(v6,{})),...a})})),Pf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("freezeToggle"),icon:xe(l.jsx(Lb,{}))}),l.jsx(je,{...p,command:u.getCommand("freezeToggleHorizontal"),icon:xe(l.jsx(Ib,{}))}),l.jsx(je,{...p,command:u.getCommand("freezeToggleVertical"),icon:xe(l.jsx(Db,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:u.getCommand("unfreeze"),icon:l.jsx(zh,{})})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:d,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:l.jsx(Rb,{}),...a})})),Ff=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("find"),icon:xe(l.jsx($6,{}))}),l.jsx(je,{...p,command:u.getCommand("findReplace"),icon:xe(l.jsx(Qh,{}))}),l.jsx(je,{...p,command:u.getCommand("goto"),icon:xe(l.jsx(rv,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:d,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:xe(l.jsx($6,{})),...a})})),zf=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:a=NE.DefaultFontSizes,disabled:d=!1,parentFloat:c,icon:u,label:p,sx:m,...h}=e;q0(n);const g=()=>n?.state()?.toString()||"11",[f,x]=s.useState(g),y=de(()=>{const F=parseFloat(f);isNaN(F)?x(g()):parseFloat(g())!==F&&n.execute(F,o)},[g,n,f,o]);s.useEffect(()=>{x(g())},[n?.state()]);const w=s.useMemo(()=>{if(!o)return null;const F={...o};return delete F.beforeExecute,F},[o]),b=no(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),C=s.useMemo(()=>b?l.jsxs(B.Box,{className:Zn("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[l.jsx(je,{command:b[0],commandHook:w,icon:xe(l.jsx(Fw,{}))}),l.jsx(je,{command:b[1],icon:xe(l.jsx(zw,{}))})]}):null,[b]),k=Pr(),E=s.useMemo(()=>`${N.IFont.getSharedMeasurer()("12.3",Math.round(k.typography.fontSize),k.typography.fontFamily).width}px`,[k]),M=s.useCallback(F=>{const{onMouseDown:_,onMouseUp:O,...S}=F;return l.jsx(B.IconButton,{component:"div",...S,disableRipple:!0,children:l.jsx(B.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom: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:E,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:f,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===Wt.Enter)g()!==f&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===Wt.Escape)g()!==f&&(x(g()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(f+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===Wt.Space)return void v.preventDefault()}},onBlur:()=>{y()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();x(v.target.value)}})})},[f,d,n]),T=s.useCallback(F=>{const _=D=>{n?.execute(D,o)},O=n?.state(),S=[];for(let D=0;D<a.length;D++){const j=a[D]===O;S.push(l.jsx(lr,{selected:j,icon:j?l.jsx(Ql,{}):void 0,disabled:d||!n||n.disabled(),onMouseDown:R=>{R.button===0&&R.preventDefault()},onMouseUp:R=>{R.button===0&&_(a[D])},onKeyDown:R=>{R.keyCode!==Wt.Enter&&R.keyCode!==Wt.Space||_(a[D])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[D]})},"fontSize-"+D))}const v=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...h,children:[C,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:S})]});return wn({...F,children:v})},[d,n?.state(),o]);return l.jsx(Gr,{ref:t,sx:{...m},tabIndex:-1,outlined:!0,disabled:d,parentFloat:c,createPopupPanel:T,createTooltip:({children:F},_)=>l.jsx(Bo,{label:n?.label(),description:n?.description(),disabled:_||n?.disabled(),children:F}),createQuickButton:M,...h})})),P8=s.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:a,...d}=e;return l.jsx(lr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...a},disabled:n,selected:t,icon:t?l.jsx(Ql,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==Wt.Enter&&c.keyCode!==Wt.Space||r(i.numberFormat)},...d,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[l.jsxs(B.Typography,{component:"div",children:[i.formatType,i.formatType===N.NumberFormat.Type.Custom?"…":""]}),l.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:c=>dt.alpha(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),Bf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:a=!1,parentFloat:d,...c}=e,u=no(n,["formatNumberFormat"])[0],p=u?.state()?N.NumberFormat.Styles.lookupStyle(u?.state()).formatType:N.NumberFormat.Type.General,m=s.useMemo(()=>{if(!o)return null;const x={...o};return delete x.beforeExecute,x},[o]),h=s.useCallback((x,y)=>{const w=O=>{o?.beforeExecute?.(u,u?.state()),u.execute(O,o),o?.onExecute?.(u,u?.state())},b=u?.context()(),C=N.NumberFormat.Styles.lookupPrimary(),k=[];for(let O=0;O<C.length;O++){let S="";if(b&&!b.isEmpty())try{S=b.getNumberFormat(C[O].numberFormat).displayText}catch(D){console.warn(D)}S===""&&C[O].formatType===N.NumberFormat.Type.General&&(S="No specific format");const v=C[O].formatType===p;k.push(l.jsx(P8,{selected:v,disabled:a||!u||u.disabled(),formattedValue:S,handleSetFormat:w,format:C[O]},C[O].formatType))}const E={numberFormat:"",formatType:N.NumberFormat.Type.Custom},M=p===N.NumberFormat.Type.Custom,T=l.jsx(P8,{selected:M,disabled:a||!u||u.disabled(),formattedValue:M?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(u,u?.state()),y.getCommand("formatNumberDialog")?.execute(u?.state()),o?.onExecute?.(u,u?.state())},format:E,sx:{flex:"0",width:"100%"}},N.NumberFormat.Type.Custom),F=l.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:O=>O.stopPropagation(),children:[l.jsx(je,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:m,scope:r,icon:l.jsx(zb,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:m,scope:r,icon:l.jsx(Ab,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:m,scope:r,icon:l.jsx(Ob,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:m,scope:r,icon:xe(l.jsx(Pb,{}))}),l.jsx(je,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:m,scope:r,icon:xe(l.jsx(Fb,{}))})]}),_=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[F,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),l.jsx(Mt,{orientation:"horizontal"}),T]});return wn({...x,children:_})},[u?.context(),u?.state(),o,r]),g=Pr(),f=s.useMemo(()=>{const x=N.NumberFormat.Type.MediumTime;return`${N.IFont.getSharedMeasurer()(x,Math.round(g.typography.fontSize),g.typography.fontFamily).width}px`},[g]);return l.jsx(In,{ref:t,commands:n,sx:i,outlined:!0,disabled:a,parentFloat:d,createPopupPanel:h,createTooltip:({children:x},y)=>l.jsx(Bo,{label:u?.label(),description:u?.description(),disabled:y,children:x}),icon:l.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:x=>`${Math.round(x.typography.fontSize)}px`,color:x=>x.palette.text.secondary,fontFamily:x=>x.typography.fontFamily,width:f},children:l.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),c5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"clear",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("clearAll"),icon:l.jsx(G3,{})}),l.jsx(je,{...p,command:u.getCommand("clearFormats"),icon:xe(l.jsx(vh,{}))}),l.jsx(je,{...p,command:u.getCommand("clearContents"),icon:xe(l.jsx(Dy,{}))}),l.jsx(je,{...p,command:u.getCommand("clearComments")}),l.jsx(je,{...p,command:u.getCommand("clearHyperlinks")})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:d,icon:l.jsx(G3,{}),...a})})),Nf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"fill",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("fillDown"),icon:xe(l.jsx(Fa,{}))}),l.jsx(je,{...p,command:u.getCommand("fillRight"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(270deg)"}}))}),l.jsx(je,{...p,command:u.getCommand("fillUp"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(180deg)"}}))}),l.jsx(je,{...p,command:u.getCommand("fillLeft"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(90deg)"}}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:d,icon:xe(l.jsx(Fa,{})),...a})})),d5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=Ht.Toolbar,...p}=e,m=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=no(n,m),{singleCommand:g,allDisabled:f}=s.useMemo(()=>{let w=null,b=0;for(let C=0;C<h.length;C++)h[C]&&!h[C]?.disabled()&&(d&&u===Ht.Menuitem&&(w=b===0?h[C]:null),b++);return{singleCommand:w,allDisabled:b===0}},[h]),x=s.useMemo(()=>{const w=new Map;return w.set("insertCellsShiftDown",xe(l.jsx(R6,{}))),w.set("insertCellsShiftRight",xe(l.jsx(R6,{sx:{transform:"rotate(270deg)"}}))),w.set("insertRows",xe(l.jsx(Iw,{}))),w.set("insertColumns",xe(l.jsx(I6,{}))),w},[]),y=s.useCallback((w,b)=>{let C=null;const k={variant:Ht.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(C=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:b.getCommand("addSheet"),icon:xe(l.jsx(sa,{}))})]}));const E=l.jsxs(l.Fragment,{children:[l.jsx(je,{...k,command:h[0],icon:x.get(m[0])}),l.jsx(je,{...k,command:h[1],icon:x.get(m[1])}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:h[2],icon:x.get(m[2])}),l.jsx(je,{...k,command:h[3],icon:x.get(m[3])}),C]});return wn({...w,children:E})},[i,h,o,r,x]);return g?l.jsx(je,{ref:t,variant:u,commandHook:o,disabled:i,command:g,icon:x.get(g.key()),...p}):l.jsx(In,{ref:t,variant:u,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||f,tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),l.jsx("br",{}),l.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:xe(l.jsx(I6,{})),...p})})),u5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=Ht.Toolbar,...p}=e,m=no(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:g}=s.useMemo(()=>{let y=null,w=0;for(let b=0;b<m.length;b++)m[b]&&!m[b]?.disabled()&&(d&&u===Ht.Menuitem&&(y=w===0?m[b]:null),w++);return{singleCommand:y,allDisabled:w===0}},[m]),f=s.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",xe(l.jsx(D6,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",xe(l.jsx(D6,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",xe(l.jsx(Dw,{}))),y.set("deleteColumns",xe(l.jsx(L6,{}))),y},[]),x=s.useCallback((y,w)=>{const b={variant:Ht.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let C=null;a||(C=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...b,command:w.getCommand("deleteSheet"),icon:xe(l.jsx(sa,{}))})]}));const k=l.jsxs(l.Fragment,{children:[l.jsx(je,{...b,command:w.getCommand("deleteCellsShiftUp"),icon:f.get("deleteCellsShiftUp")}),l.jsx(je,{...b,command:w.getCommand("deleteCellsShiftLeft"),icon:f.get("deleteCellsShiftLeft")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...b,command:w.getCommand("deleteRows"),icon:f.get("deleteRows")}),l.jsx(je,{...b,command:w.getCommand("deleteColumns"),icon:f.get("deleteColumns")}),C]});return wn({...y,children:k})},[i,o,r,f]);return h?l.jsx(je,{ref:t,variant:u,commandHook:o,disabled:i,command:h,icon:f.get(h.key()),...p}):l.jsx(In,{ref:t,variant:u,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),l.jsx("br",{}),l.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:x,icon:xe(l.jsx(L6,{})),...p})})),xa=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Ht.Toolbar,quickColor:d,panelProps:c,isSplit:u=!1,darkMode:p,icon:m,...h}=e,{autoColor:g,schemeLookup:f,recentColors:x,...y}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");q0(n);const w=n?.context();let b=d??w?.quickColor;u&&!b&&(b=new N.Color("transparent"));const C=g??w?.autoColor,k=f??w?.schemeLookup,E=x??w?.recentColors,M=p??w?.darkMode,T=s.useMemo(()=>({autoColor:C,schemeLookup:k,recentColors:E,darkMode:M,...y}),[C,k,E,M]),F=de((O,S)=>{O&&S&&w?.addRecentColor&&w.addRecentColor(O),w?.onColorSelect&&w.onColorSelect(O),r?.(O,S),n?.execute(O,o)},[n,r,o,w]),_=s.useCallback((O,S)=>{const{children:v,title:D,...j}=O;let R=O.children;return(n?.disabled()||i)&&(R=l.jsx("div",{children:R})),l.jsx(ba,{command:n,placement:a===Ht.Toolbar?"bottom-start":"right-start",disabled:S,...j,children:R})},[n,i]);return l.jsx(s5,{ref:t,panelProps:T,icon:m,quickColor:b,selectedColor:n?.state(),onSelectColor:F,variant:a===Ht.Menuitem?Lr.Menuitem:Lr.Toolbar,createTooltip:_,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:M,...h})}));xa.displayName="ColorCommandButton";const Vf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),u=s.useCallback((p,m)=>{const h={variant:Ht.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=l.jsxs(l.Fragment,{children:[l.jsx(je,{...h,command:m.getCommand("gridlinesToggle")}),l.jsx(xa,{...h,command:m.getCommand("sheetViewFormatGridlinesColor"),icon:l.jsx(T2,{}),panelProps:{disableAlpha:!0}}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleGridlinesColumns")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleGridlinesRows")})]});return wn({...p,children:g})},[i,o]);return l.jsx(In,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:l.jsx(ma,{command:c[0],scope:"view"}),...d})})),p5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"sort",disabled:i},m=u.getCommand("sortCustom"),h=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("sortAscending"),icon:xe(l.jsx(Tu,{}))}),l.jsx(je,{...p,command:u.getCommand("sortDescending"),icon:xe(l.jsx(Kh,{}))}),m?l.jsx(je,{...p,command:m,icon:xe(l.jsx(Pw,{}))}):null,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:xe(l.jsx(bu,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:xe(l.jsx(j2,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:xe(l.jsx(Bh,{}))})]});return wn({...c,children:h})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Organize your data so it's easier to analyze."}),l.jsx("br",{}),l.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:xe(l.jsx(Tu,{})),...a})})),KT=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"sort",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:xe(l.jsx(bu,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:xe(l.jsx(j2,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:xe(l.jsx(Bh,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Organize your data so it's easier to analyze."}),l.jsx("br",{}),l.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:xe(l.jsx(bu,{})),...a})})),h5=s.memo(s.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:a,scope:d,sx:c,disabled:u,commands:p,...m}=e,h=[n];!r&&i&&h.push("redo");const g=no(p,h),f=g[0],x=g[1],y=a??f?.context?.()?.undoManager;let w=u;u||(w=!f||f.disabled(),x&&!x.disabled()&&(w=!1));const[b,C]=s.useState(0),k=s.useCallback((E,M)=>{let T=b===0?"Cancel":`${f.label()} ${b} Action${b===1?"":"s"}`,F=!1;y||(F=!0),F||(F=i?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const _=R=>{f.execute(R)},O=l.jsx(lr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:F?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{C(0)},onMouseDown:R=>{R.button===0&&R.preventDefault()},onMouseUp:R=>{R.button===0&&_(b)},onKeyDown:R=>{R.isDefaultPrevented()||R.keyCode!==Wt.Enter&&R.keyCode!==Wt.Space||_(b)},children:l.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:T})});if(F)return O;const S=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),v=[];for(let R=0;R<S.length;R++){const P=S[R];v.push(l.jsx(lr,{sx:{maxWidth:"360px",display:"flex"},icon:l.jsx(sa,{}),disabled:w,selected:R<b,onMouseEnter:()=>{C(R+1)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&_(R+1)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==Wt.Enter&&I.keyCode!==Wt.Space||_(R+1)},children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[l.jsx(B.Typography,{component:"div",children:P}),l.jsx(sa,{})]})},`action:${R}`))}let D=null;if(!r&&i){const R={scope:"undo",commands:M,variant:Ht.Menuitem,parentFloat:E.floatReference};D=[],D.push(l.jsx(h5,{...R,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&D.push(l.jsx(Mt,{orientation:"horizontal"},"action:redo-div"))}const j=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{E.closeFloatAll()},onMouseLeave:()=>{C(0)},children:[D,l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),l.jsx(Mt,{orientation:"horizontal"}),O]});return wn({...E,children:j})},[f?.context(),f?.state(),d,y,b,w]);return l.jsx(In,{ref:t,commands:p,quickCommand:n,scope:d,disabled:w,label:f?.label()??(r?"Redo":"Undo"),tooltip:l.jsx(l.Fragment,{children:l.jsx("span",{children:`${f?.label()??"No"} last actions.`})}),createPopupPanel:k,icon:o??xe(r?l.jsx(jv,{}):l.jsx(Tv,{})),selected:!1,...m})})),ia=N.IFontCollection.getFontList(),Hf=new Map;for(let e=0;e<ia.length;e++)Hf.set(ia[e].fontRef.getFamily(),ia[e]);const $f=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,icon:d,label:c,...u}=e;q0(n);const p=n?.state(),m=Pr(),h=s.useMemo(()=>`${N.IFont.getSharedMeasurer()("Times New Roman",Math.round(m.typography.fontSize),m.typography.fontFamily).width}px`,[m]),g=s.useCallback(f=>{const x=C=>{n?.execute(C,o)},y=[];for(let C=0;C<ia.length;C++)y.push({key:ia[C].fontRef.getFamily(),description:ia[C].fontRef.getFamily()});Hf.get(p)||y.unshift({key:p,description:p});const w=[];for(let C=0;C<y.length;C++){const k=y[C].key===p;w.push(l.jsx(lr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:k,disabled:i||!n||n.disabled(),icon:k?l.jsx(Ql,{}):void 0,onMouseUp:E=>{E.button===0&&x(y[C].key)},onMouseDown:E=>{E.button===0&&E.preventDefault()},onKeyDown:E=>{E.keyCode!==Wt.Enter&&E.keyCode!==Wt.Space||x(y[C].key)},children:l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:l.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>y[C]?.key},children:y[C].description})})},C+""+y[C].key))}const b=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...u,children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:w})});return wn({...f,children:b})},[i,n?.state()]);return l.jsx(Gr,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:g,createTooltip:({children:f},x)=>l.jsx(Bo,{label:n?.label(),description:n?.description(),disabled:x,children:f}),icon:l.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:f=>`${Math.round(f.typography.fontSize)}px`,fontFamily:f=>f.typography.fontFamily,color:f=>f.palette.text.secondary,width:h},children:l.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...u})})),Wf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatStrikeThroughToggle",xe(l.jsx(O6,{}))),m.set("formatSuperscriptToggle",xe(l.jsx(Bw,{}))),m.set("formatSubscriptToggle",xe(l.jsx(Nw,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:"textEffects",disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:u.get("formatStrikeThroughToggle")}),l.jsx(je,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:u.get("formatSuperscriptToggle")}),l.jsx(je,{...g,command:h.getCommand("formatSubscriptToggle"),icon:u.get("formatSubscriptToggle")})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:u.get(c)??xe(l.jsx(O6,{})),...a})})),Uf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatUnderlinedToggle",xe(l.jsx(cd,{}))),m.set("formatUnderlinedDoubleToggle",xe(l.jsx(A6,{}))),m.set("formatUnderlinedAccountingToggle",xe(l.jsx(P6,{}))),m.set("formatUnderlinedAccountingDoubleToggle",xe(l.jsx(F6,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:"underline",disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:xe(l.jsx(cd,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:xe(l.jsx(A6,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:xe(l.jsx(P6,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:xe(l.jsx(F6,{}))})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:u.get(c)??xe(l.jsx(cd,{})),...a})})),m5=s.memo(s.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:a=!0,disabled:d=!1,...c}=e,u=de((p,m)=>{const h={variant:Ht.Menuitem,commandHook:r,scope:"paste",disabled:d},g=[];return a&&(g.push(s.createElement(je,{...h,command:m.getCommand("paste"),key:"paste",icon:l.jsx(M6,{})})),g.push(l.jsx(Mt,{orientation:"horizontal"},"paste-div"))),g.push(s.createElement(je,{...h,command:m.getCommand("pasteValues"),key:"pasteValues",icon:xe(l.jsx(Sw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteFormats"),key:"pasteFormats",icon:xe(l.jsx(Cw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteFormulas"),key:"pasteFormulas",icon:xe(l.jsx(kw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteTranspose"),key:"pasteTranspose",icon:xe(l.jsx(Ew,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteLinks"),key:"pasteLinks",icon:xe(l.jsx(_w,{}))})),wn({...p,children:g})},[d,r,i,a]);return l.jsx(In,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:u,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:l.jsx(M6,{}),...c})})),qf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),u=s.useCallback((p,m)=>{const h={variant:Ht.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=l.jsxs(l.Fragment,{children:[l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadings")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingsNumeric")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingColumns")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingRows")})]});return wn({...p,children:g})},[i,o,r]);return l.jsx(In,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:l.jsx(ma,{command:c[0],scope:"view"}),...d})})),Zf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...a}=e,d=s.useCallback(c=>{const u={variant:Ht.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=l.jsxs(l.Fragment,{children:[l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowFormulaBar")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowTabs")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowStatusBar")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return wn({...c,children:p})},[i,n,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:d,icon:l.jsx(ma,{icon:null,label:"Workbook View"}),...a})})),Gf=s.memo(s.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:a,sx:d,borderProps:c,disabled:u,...p}=e,m=s.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=s.useMemo(()=>m.getStyle(),[m,a]),g=s.useMemo(()=>h.getFill().toCSS(a?.darkMode??!1),[h]),f=h.getInsets(),x=h.getFont(),y=s.useCallback(()=>h.getBorder(),[h]);return l.jsx(B.Box,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:a?.fill,filter:u?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...g},"& .text":{flex:"1 1 100%",...x.toCSS(a?.darkMode??!1,1),boxSizing:"border-box",padding:`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:x.toCSS().textDecoration,textAlign:N.ITextFrame.toCSSHorizontalTextAlign(m.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...d},...p,children:l.jsx(Q2,{getBorderAt:y,darkMode:a?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:l.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:l.jsx(B.Box,{className:"text",children:n})})})})})),XT=s.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:a,createTemporaryCell:d,parentFloat:c,commands:u,disabled:p,commandHook:m,...h}=e,g=s.useCallback(y=>{const w={variant:Ht.Menuitem,commandHook:m,context:"cellStyle"},b=l.jsxs(l.Fragment,{children:[l.jsx(je,{...w,sx:{fontWeight:550},command:u.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...w,command:u.getCommand("modifyCellStyle"),commandState:{named:n}}),l.jsx(je,{...w,command:u.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===N.IStyle.BuiltInName.Normal})]}),C=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return wn({...y,children:C})},[]),f=n?.getName()===o?.getName();let x=l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${f?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{a?.(n)},...h,children:l.jsx(Gf,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:d,bodyStyle:i})},n.getName());return r&&(x=l.jsx(g9,{label:n.getName(),parentFloat:c,createPopupPanel:g,children:x})),x}),Kf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:a,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!0,...p}=e;q0(o);const m=o?.context(),h=m?.styles,g=i??m?.named(),f=c??m?.bodyStyle(),x=de(k=>{a?.(k),o?.execute(k,r)},[o,a,r]),y=s.useCallback((k,E)=>{const M={onSelectNamed:x,styles:h(),parentFloat:k.floatReference},T=h().getCustomNamed(),F=new Map,_=[];for(let I=0;I<T.length;I++)F.set(T[I].getName(),T[I]),h().getNamed(T[I].getName()).getBuiltInID()===null&&_.push(T[I].getName());const O=I=>{let L=F.get(I);return L||(L=h().getNamed(I)),!L||L.isHidden()?null:l.jsx(XT,{namedStyle:L,selectedNamed:g,bodyStyle:m.bodyStyle(),createTemporaryCell:m.createTemporaryCell,commands:n,commandHook:r,...M},I)},S=(I,L,H=!0)=>{const W=[];for(let A=0;A<L.length;A++){const U=O(L[A]);U&&W.push(U)}return W.length===0?null:l.jsxs(B.Box,{children:[H?l.jsx(Mt,{orientation:"horizontal"}):null,l.jsx(pa,{children:I},I+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:W},I+"-presets")]},I)},v=(I,L)=>{const H=[];for(let W=0;W<L.length;W++){const A=O(L[W]);A&&H.push(A)}return H.length===0?null:l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:H},I+"-presets")},D=[];D.push(S("Custom",_,!1)),D.push(S("Good, Bad and Neutral",[N.IStyle.BuiltInName.Normal,N.IStyle.BuiltInName.Bad,N.IStyle.BuiltInName.Good,N.IStyle.BuiltInName.Neutral],_.length>0)),D.push(S("Data and Model",[N.IStyle.BuiltInName.Calculation,N.IStyle.BuiltInName.CheckCell,N.IStyle.BuiltInName.ExplanatoryText,N.IStyle.BuiltInName.FollowedHyperlink,N.IStyle.BuiltInName.Hyperlink,N.IStyle.BuiltInName.Input,N.IStyle.BuiltInName.LinkedCell,N.IStyle.BuiltInName.Note,N.IStyle.BuiltInName.Output,N.IStyle.BuiltInName.WarningText])),D.push(S("Titles and Headings",[N.IStyle.BuiltInName.Heading1,N.IStyle.BuiltInName.Heading2,N.IStyle.BuiltInName.Heading3,N.IStyle.BuiltInName.Heading4,N.IStyle.BuiltInName.Title,N.IStyle.BuiltInName.Total]));let j=[];var R,P;return j.push(v("Accent 1",[N.IStyle.BuiltInName.Accent1_20,N.IStyle.BuiltInName.Accent1_40,N.IStyle.BuiltInName.Accent1_60,N.IStyle.BuiltInName.Accent1])),j.push(v("Accent 2",[N.IStyle.BuiltInName.Accent2_20,N.IStyle.BuiltInName.Accent2_40,N.IStyle.BuiltInName.Accent2_60,N.IStyle.BuiltInName.Accent2])),j.push(v("Accent 3",[N.IStyle.BuiltInName.Accent3_20,N.IStyle.BuiltInName.Accent3_40,N.IStyle.BuiltInName.Accent3_60,N.IStyle.BuiltInName.Accent3])),j.push(v("Accent 4",[N.IStyle.BuiltInName.Accent4_20,N.IStyle.BuiltInName.Accent4_40,N.IStyle.BuiltInName.Accent4_60,N.IStyle.BuiltInName.Accent4])),j.push(v("Accent 5",[N.IStyle.BuiltInName.Accent5_20,N.IStyle.BuiltInName.Accent5_40,N.IStyle.BuiltInName.Accent5_60,N.IStyle.BuiltInName.Accent5])),j.push(v("Accent 6",[N.IStyle.BuiltInName.Accent6_20,N.IStyle.BuiltInName.Accent6_40,N.IStyle.BuiltInName.Accent6_60,N.IStyle.BuiltInName.Accent6])),D.push((R="Themed Cell Styles",P=j,l.jsxs(B.Box,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(pa,{children:R},R+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:P},R+"-presets")]},R))),D.push(S("Number Format",[N.IStyle.BuiltInName.Comma,N.IStyle.BuiltInName.Comma0,N.IStyle.BuiltInName.Currency,N.IStyle.BuiltInName.Currency0,N.IStyle.BuiltInName.Percent])),l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[l.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:D}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{variant:Ht.Menuitem,commandState:g,command:E.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:d,icon:xe(l.jsx(Ww,{}))})]})},[g,h?.().getTheme(),f]),w=de(k=>{const E=18/N.IFont.getDeviceScale(),M=m?.createTemporaryCell(k);return M.getStyle().getFont().getSize()<=E?M:M.createTemporaryCell({style:{font:{size:E}}})},[m?.createTemporaryCell]),b=d||!o||o.disabled(),C=s.useMemo(()=>m&&u?l.jsx(Gf,{value:g?.getName()??"Custom",cellStyle:g?{named:g.getName()}:void 0,styles:m.styles(),createTemporaryCell:w,bodyStyle:m.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:k=>`1px solid ${k.palette.action.hover}`},borderProps:{}}):xe(l.jsx(Pl,{})),[g,f,b]);return l.jsx(In,{ref:t,createPopupPanel:y,outlined:u,commands:n,createTooltip:({children:k},E)=>l.jsx(Bo,{label:o?.label(),description:o?.description(),disabled:E,children:k}),selected:!1,disabled:b,label:o?.label(),icon:C,...p})})),Xf="_sheetxl-reset_ods65_1",YT=10,Yf=s.memo(s.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:a,disabled:d,className:c,forceThinBorder:u,cellHeight:p=YT,isLive:m=!1,...h}=e,g=Math.ceil(1.3*p),[f,x]=s.useReducer(k=>k+1,0);s.useEffect(()=>{if(m&&o)return o.addListeners({onAnyChange:()=>{x()}})},[o,m]);const y=s.useMemo(()=>{let k=o?.toJSON()??{};const E={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return k&&(k.styleOptions={...k.styleOptions,name:r.getName()}),k.ref=E,new N.Table({initialAnchor:E,json:k,styles:n})},[f,o,r,n]),w=s.useMemo(()=>{const k=[];for(let E=0;E<5;E++)for(let M=0;M<5;M++){const T=y.getStyleAt({colIndex:M,rowIndex:E});k.push(T)}return k},[y]),b=s.useMemo(()=>{const k=(M,T,F)=>{let _=F.getFill().toCSS(i?.darkMode??!1);const O=g-(T<4?1:0),S=p-(M<4?1:0),v=F.getFont().getFill().toCSS(i?.darkMode??!1);return _={..._,position:"absolute",boxSizing:"border-box",left:T*(g-1),top:M*(p-1),width:O,height:S},l.jsx("td",{className:`table-style-fill ${M}-${T}`,style:_,children:l.jsx("div",{className:`table-style-text ${M}-${T}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(O-6)/2,top:(S-1)/2,borderTop:`1px solid ${v}`}})},`${M}-${T}`)},E=[];for(let M=0;M<5;M++){const T=[];for(let F=0;F<5;F++){const _=w[5*M+F];T.push(k(M,F,_))}E.push(l.jsx("tr",{children:T},M))}return E},[y,r,i]),C=s.useCallback((k,E)=>w[E].getBorder()??null,[w]);return l.jsx(B.Box,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...a},...h,children:l.jsx(Q2,{getBorderAt:C,rowCount:5,columnCount:5,forceThinBorder:u,width:5*(g-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:l.jsx("table",{className:Zn(c,"sheetxl-table-preview",Xf),style:{borderCollapse:"collapse",width:5*(g-1)+1,height:5*(p-1)+1},children:l.jsx("tbody",{children:b})})})})})),Za=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},Jf=s.memo(s.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:a,style:d,className:c,canvas:u,...p}=e,m=s.useMemo(()=>{const f=n.toJSON(),x={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return f.styleOptions={...f.styleOptions,name:o.getName()},f.ref=x,new N.Table({initialAnchor:x,json:f,styles:r})},[n,o,r]),h=s.useMemo(()=>{const f=[];for(let x=0;x<5;x++)for(let y=0;y<5;y++){const w=m.getStyleAt({colIndex:y,rowIndex:x});f.push(w)}return f},[m]),g=s.useMemo(()=>{let f=u;if(u||(f=document.createElement("canvas")),!f)return null;f.width!==61&&(f.width=61),f.height!==46&&(f.height=46);const x=f.getContext("2d",{alpha:!1});if(!x)return null;const y=12,w=i?.darkMode??!1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C].getFill();let E=i?.fill;k.getType()===N.IFill.Type.Solid?E=k.getColor().toCSS(w,!1):k.getType()===N.IFill.Type.Gradient?E=k.getStops[0]?.color.toCSS(w,!1):k.getType()===N.IFill.Type.Pattern&&(E=k.getForeground().toCSS(w,!1)),x.fillStyle=E;const M=C*y,T=9*b;x.fillRect(M,T,13,10)}x.lineWidth=1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C],E=C*y,M=9*b,T=k.getBorder();if(!T.isEmpty()){const O=T.getLeft();O.isNone()||(x.strokeStyle=O.getColor().toCSS(w,!1),Za(x,E,M,E,M+9));const S=T.getTop();S.isNone()||(x.strokeStyle=S.getColor().toCSS(w,!1),Za(x,E,M,E+y,9*b));const v=T.getRight();v.isNone()||(x.strokeStyle=v.getColor().toCSS(w,!1),Za(x,E+y,M,E+y,M+9));const D=T.getBottom();D.isNone()||(x.strokeStyle=D.getColor().toCSS(w,!1),Za(x,E,M+9,E+y,M+9))}x.strokeStyle=k.getFont().getFill().toCSS(w,!1);const F=4,_=2.5;Za(x,C*y+_,9*b+F,C*y+_+7,9*b+F)}return`url(${f.toDataURL()})`},[u,m,o,i]);return l.jsx("div",{ref:t,className:Zn("table-style-preview",c),style:{backgroundImage:g,width:61,height:46,...d},...p})})),JT=s.memo(s.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:a,onShowTotalRowChange:d,showFilterButton:c,onShowFilterButtonChange:u,sx:p,disabled:m,...h}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:g=>`${g.spacing(2)}`,marginRight:g=>`${g.spacing(2)}`},"& .MuiCheckbox-root":{padding:g=>`${g.spacing(.5)}`},...p},...h,ref:t,children:[i&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:m||r==null}),label:"Header Row",labelPlacement:"end"}),d&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:a??!1,indeterminate:a==null,onChange:()=>d(!a),disabled:m||a==null}),label:"Total Row",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),u&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:c??!1,indeterminate:c==null,disabled:m||!n||c==null,onChange:()=>u(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),QT=s.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:a=!0,bodyStyle:d,parentFloat:c,commands:u,disabled:p,commandHook:m,useCanvasPreview:h=!0,canvas:g,...f}=e,x=s.useCallback(C=>{const k={variant:Ht.Menuitem,commandHook:m,context:"table"},E=l.jsxs(l.Fragment,{children:[l.jsx(je,{...k,command:u.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(je,{...k,sx:{fontWeight:550},command:u.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:u.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:u.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]}),M=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})});return wn({...C,children:M})},[u]),y=n?.getName()===o,w=s.useMemo(()=>{const C={table:t,tableStyle:n,styles:i,bodyStyle:d};return h?l.jsx(Jf,{canvas:g,...C}):l.jsx(Yf,{...C})},[t,n,i,d]);let b=l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${y?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...f,children:w},n.getName());return a&&(b=l.jsx(g9,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:x,children:b})),b}),Qf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:a,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!1,...p}=e;q0(o);const m=o?.context(),h=m?.styles,g=i??m?.table?.();let f="insertTable";g&&(f="editTable");const x=s.useMemo(()=>((_,O)=>{const S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new N.Table({initialAnchor:S,styles:O,json:{name:"PreviewTable",ref:S,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:_}})})(g?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),g?.getStyleOptions()]),y=g??x,[w,b]=s.useState(y);s.useEffect(()=>{b(y)},[y]);const C=c??m?.bodyStyle(),k=de(_=>{a?.(_),o?.execute({name:_},r)},[o,a,r]),E=s.useRef(null),M=s.useCallback((_,O)=>{const S={onSelectTableStyleName:k,styles:h(),parentFloat:_.floatReference};E.current||(E.current=document.createElement("canvas"));const v=A=>{const U=h().getTableStyle(A);return U?l.jsx(QT,{table:w,tableStyle:U,selectedTableStyleName:w.getStyleOptions().name,bodyStyle:m.bodyStyle(),commands:O,commandHook:r,canvas:E.current,...S},A):null},D=(A,U,X=!0)=>{const ee=[];for(let V=0;V<U.length;V++){const $=v(U[V]);$&&ee.push($)}return ee.length===0?null:l.jsxs(B.Box,{children:[X?l.jsx(Mt,{orientation:"horizontal"}):null,l.jsx(pa,{children:A},A+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},A+"-presets")]},A)},j=[],R=h().getCustomTableStyles(),P=[];if(R.length>0){for(let A=0;A<R.length;A++)R[A].isShownInTableStyles()&&P.push(R[A].getName());j.push(D("Custom",P,!1))}const I=[];g&&!g.getStyleOptions().name&&I.push(null);for(let A=0;A<21;A++)I.push("TableStyleLight"+(A+1));j.push(D("Light",I,P.length>0));const L=[];for(let A=0;A<28;A++)L.push("TableStyleMedium"+(A+1));j.push(D("Medium",L));const H=[];for(let A=0;A<11;A++)H.push("TableStyleDark"+(A+1));j.push(D("Dark",H));let W=null;return g&&(W=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{variant:Ht.Menuitem,command:O.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:d,icon:xe(l.jsx(vh,{}))})]})),l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[l.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:j}),W]})},[h,h?.().getTheme(),C,w]),T=d||!o||o.disabled(),F=s.useMemo(()=>{if(!m||!u)return xe(l.jsx(Pl,{}))},[w,C,T]);return l.jsx(In,{ref:t,quickCommand:f,createPopupPanel:M,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:_},O)=>l.jsx(Bo,{label:o?.label(),description:o?.description(),disabled:O,children:_}),disabled:T,icon:F,...p})})),_r=[];_r.push($r("Primary Background","bg1")),_r.push($r("Primary Text","tx1")),_r.push($r("Secondary Background","bg2")),_r.push($r("Secondary Text","tx2")),_r.push($r("Accent 1","accent1")),_r.push($r("Accent 2","accent2")),_r.push($r("Accent 3","accent3")),_r.push($r("Accent 4","accent4")),_r.push($r("Accent 5","accent5")),_r.push($r("Accent 6","accent6"));const eg=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...d}=e,c=Pr(),u=s.useMemo(()=>{let p=[];for(let m=0;m<_r.length;m++){const h=_r[m];p.push(l.jsx(Dc,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},m+"-colorDef"))}return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:l.jsx(B.Box,{sx:{display:"flex",boxShadow:m=>m.shadows[2]},children:p})})},[t,c]);return l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...d,children:l.jsxs(B.Box,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[l.jsx(B.Box,{sx:{},children:t.getName()}),l.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[u,l.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:l.jsx(br,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:l.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
|
|
82
|
+
`,h=!0));const g=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let f=null;o.pushEditOperations([],g,x=>(f=x[0].range,m&&f.startLineNumber++,h&&f.endLineNumber--,[new t.Selection(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)])),e.setSelection({startLineNumber:f.endLineNumber,startColumn:f.endColumn,endLineNumber:f.startLineNumber,endColumn:f.startColumn})};function VT(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function i2(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,a=e.getPositionAt(i);r.push({name:o.text,type:VT(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)i2(e,t,n,i,r);return r}function l5(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const a=r[i];if(a.start<=t&&t<a.start+a.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const d of e.childItems||[]){const c=l5(d,t,n,o);if(c)return c}}return null}}function HT(e){return e.kind==="comment"}const $T=s.memo(s.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:a,darkMode:d,loadingPanel:c,autoFocus:u=!0,onStatusChange:p,...m}=e,h=s.useRef(null),g=de(a,[a]),f=s.useRef(!1),x=s.useMemo(()=>({contains(L){if(!h.current)return;const H=h.current.editor;return H&&H.getDomNode()?.contains(L)},focus(){if(!h.current)return;const L=h.current.editor;return L&&L.getDomNode()?.focus()}}),[]),y=s.useMemo(()=>[new _e("help",x,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),w=s.useMemo(()=>{let L=null;const H=()=>x;return L=r?r.createChildGroup(H,"scriptEditor",!1):new Ei(H,"scriptEditor"),L.addCommands(y,!0),L},[r,y]),b=no(w,["executeSelectedScript"])[0],C=b?.context(),k=de(L=>{b?.execute(L)},[b]),E=s.useRef(""),[M,T]=s.useState(!1),F=de(async()=>{if(!h.current)return null;const L=h.current,H=L.editor;if(!H)return null;const W=L.monaco,A=await(async(U,X,ee="export")=>{const V=U.getModel();if(!V)return null;const $=await X.languages.typescript.getTypeScriptWorker(),z=await $(V.uri),q=await z.getNavigationTree(V.uri.toString());let G=null,Q=U.getSelection();const Y=Q.startLineNumber===Q.endLineNumber&&Q.startColumn===Q.endColumn?V.getLineCount():Math.min(Q.endLineNumber,V.getLineCount());for(let te=Q.startLineNumber;!G&&te<=Y;te++){const re=l5(q,V.getOffsetAt({lineNumber:te,column:1}),"function",ee);re&&(G=re.text)}return G})(H,W);return p?.({message:(A??"").toUpperCase()}),A?{source:H.getValue(),name:A}:null},[p]),_=de(async(L,H,W)=>{const A=await C.getScripts().createModule({source:W?.getValue(),declarationsOnly:!0}),U=A?A.getFunctions().search():zt.EmptyArray;A&&(async function(X,ee){const V=[];for(let $=1;$<X.getLineCount()+1;$++){const z={startLineNumber:$,startColumn:1,endLineNumber:$,endColumn:X.getLineLength($)+1},q=X.getValueInRange(z).indexOf("modelt");q!==-1&&V.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ee.MarkerSeverity.Hint,startLineNumber:z.startLineNumber,startColumn:q+1,endLineNumber:z.startLineNumber,endColumn:q+5})}ee.editor.setModelMarkers(X,"owner",V)}(L,H),async function(X,ee,V,$){const z=await ee.languages.typescript.getTypeScriptWorker(),q=await z(X.uri),G=await q.getNavigationTree(X.uri.toString()),Q=i2(X,ee,$,G).map(Y=>{let te=null,re=null;return Y.type==="formula"?(te="formula.margin-icon",re="Formula"):Y.type==="macro"?(te="macro.margin-icon",re="Macro"):Y.type==="autoRun"&&(te="autorun.margin-icon",re="Auto Run"),{range:new ee.Range(Y.lineNumber,1,Y.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:te,glyphMarginHoverMessage:re,stickiness:ee.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});D.current&&D.current.clear(),D.current=V.createDecorationsCollection(Q)}(L,H,W,U))},[C]),O=de(zt.debounce(_,580),[]),S=de(async(L=void 0)=>{if(!h.current||!C)return;const H=h.current.editor.getPosition(),W={cursor:H?H.toString():""};L!==void 0&&(W.message=L),p?.(W);const A=F();C.setSelectedFunction(A)},[C,p]);s.useEffect(()=>{if(!C)return;const L={insertSnippet:W=>{h.current?.editor&&(M?A8(h.current.editor,h.current.monaco,W):E.current=W)}};C.setEditor(L),C.setSelectedFunction(F());const H=C.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,A=C?.getScripts().getModules().getByName("scripting"),U=A?.getSource(),X=W.getValue();if((U?.length??0)===X.length&&U===X)return;await C.saveSource(W.getValue());const ee=(U?.length??0)!==X.length||U!==X;p?.({dirty:ee})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!C)return;const W=h.current.editor,A=C.getScripts().getModules().search()[0]?.getSource()??"";W.setValue(A)}});return()=>{H(),C.setSelectedFunction(null),C.setEditor(null)}},[C,M]),s.useEffect(()=>()=>{if(!h.current?.editor)return;const L=h.current.editor;C?.saveSource(L.getValue())},[]);const v=de(L=>{const H=h.current;if(!H)return!1;const W=H.editor;return!!W&&(W.focus(),!0)},[]),D=s.useRef(null),j=de((L,H)=>{h.current={monaco:H,editor:L},T(!0),S("Loading Types");const W=C.getScripts().getModules().search()[0]?.getSource()??"";L.setValue(W),Promise.resolve().then(()=>require("./omjToo5UJ4DJDaQ_.cjs")).then(U=>U.c).then(U=>{S(""),U.AutoTypings.create(L,{shareCache:!0,monaco:H,onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(async X=>{const ee=L.getModel();O(ee,H,L)})}),L.addCommand("executeScript",function(U,...X){X?.[0]&&k({functionName:X?.[0]})},""),L.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async U=>{const X=F();C.setSelectedFunction(X);const ee=await X;k(ee)}}),L.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:U=>{C?.saveSource(L.getValue()).then(()=>{const X=C?.getScripts().getModules().getByName("scripting"),ee=X?.getSource(),V=L.getValue(),$=(ee?.length??0)!==V.length||ee!==V;p?.({dirty:$})})}}),L.onMouseDown(async U=>{if(U.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=U.target.position.lineNumber,ee=await H.languages.typescript.getTypeScriptWorker(),V=await ee(A.uri),$=await V.getNavigationTree(A.uri.toString()),z=L?.getValue(),q=(await C?.saveSource(z)).getFunctions().search(),G=i2(A,H,q,$).find(Q=>Q.lineNumber===X);if(G){const Q=U.event.browserEvent.button;Q===0?G.type==="macro"||G.type==="autoRun"?k({functionName:G.name}):G.type==="formula"&&C.quickInsertFunction?.(G.name):Q===2&&(console.log("Context menu for function:",G.name),U.event.browserEvent.preventDefault())}}}),L.onDidChangeModelContent(()=>{const U=L.getModel();O(U,H,L)});const A=L.getModel();(function(U,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ee,V,$){const z=[];for(let q=1;q<ee.getLineCount()+1;q++){const G={startLineNumber:q,startColumn:1,endLineNumber:q,endColumn:ee.getLineLength(q)+1},Q="hint",Y=ee.getValueInRange(G).indexOf("hint");Y!==-1&&z.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:G.startLineNumber,column:Y+Q.length+1},label:"[hint]"})}return{hints:z,dispose:()=>{}}}})})(0,H),A.onDidChangeContent(U=>{const X=C?.getScripts().getModules().getByName("scripting"),ee=X?.getSource(),V=L.getValue(),$=(ee?.length??0)!==V.length||ee!==V;p?.({dirty:$})}),L.onDidChangeCursorPosition(U=>{S()})},[C,p]),R=s.useMemo(()=>M?null:c||l.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[M,c]),P=s.useMemo(()=>{const L=C?.getScripts().getModules().getByName("scripting")?.getSource()??"";return l.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[l.jsx(s.Suspense,{children:l.jsx(BT,{theme:d?"extended-dark":"extended",options:{...NT,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:L,onValidate:H=>{let W=!1;for(let A=0;!W&&A<H?.length;A++)H[A].severity===8&&(W=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let W=!1;try{const U=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),X=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),ee=H.editor.createModel(U,"typescript",X);H.editor.setModelMarkers(ee,"default",[]),W=!0}catch(U){console.warn("cant load types",U)}H.languages.registerLinkProvider("*",{provideLinks:(U,X)=>{const ee=[],V={links:ee},$=U.getLinesContent();for(let z=1;z<=$.length;z++){const q=$[z-1],G=H.editor.tokenize(q,"typescript");for(let Q=0;Q<G[0].length;Q++){const Y=G[0]?.[Q];if(Y&&Y.type.startsWith("string")){let te=Y.offset,re=G[0]?.[Q+1]?.offset??q.length,ge=new H.Range(z,te+1,z,re+1),J=U.getValueInRange(ge);const se=J[0];se!=="`"&&se!=="'"&&se!=='"'||(te++,J=J.substring(1));const Se=J[J.length-1];Se!=="`"&&Se!=="'"&&Se!=='"'||(te++,J=J.substring(0,J.length-1));try{C.getRanges(J)&&ee.push({range:{endColumn:re,endLineNumber:z,startColumn:te,startLineNumber:z},tooltip:`Goto range '${J}'`,url:`/range/${J}`})}catch(Me){console.warn(Me)}}}}return V}}),H.editor.registerLinkOpener({open(U){if(U?.path?.startsWith("/range/")){try{C.getRanges(U.path.substring(7))?.select()}catch(X){console.warn("invalid range",X)}return!0}return!1}});const A=H.languages.typescript.typescriptDefaults.getCompilerOptions();H.languages.typescript.typescriptDefaults.setCompilerOptions({...A,target:H.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:H.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),E.current&&(await A8(h.current.editor,h.current.monaco,E.current),E.current=null),f.current&&requestAnimationFrame(async()=>{f.current&&H.editor.focus()}),H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),T(!0)})()},onMount:j})}),R]})},[C,w,i,R,d]),I=Mo(t,()=>({isScriptEditorElement:()=>!0,focus:L=>{v(L)},close:()=>{g?.()},getEditor:()=>C?.getEditor()}),[C]);return s.useEffect(()=>(u&&requestAnimationFrame(()=>{v()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{I.current?.contains(document.activeElement)&&v()})}),[]),l.jsx("div",{className:sr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:I,...m,children:P})})),Mf={Preset:"preset",Custom:"custom"},ra={Start:"start",End:"end"},Bd={},WT=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(Bd[r])return Bd[r];const i=((a,d,c,u)=>{if(typeof document>"u"&&!u)return null;const p=u?new u:document.createElement("canvas");p.width=2*c,p.height=2*c;const m=p.getContext("2d");return m?(m.fillStyle=a,m.fillRect(0,0,p.width,p.height),m.fillStyle=d,m.fillRect(0,0,c,c),m.translate(c,c),m.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return Bd[r]=i,i},UT={},Rf=s.memo(e=>{const{className:t,style:n=hn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:d,renderers:c=UT,children:u,...p}=e,m=u,h=s.useMemo(()=>Object.assign({borderRadius:a,boxShadow:d,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${WT(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return s.isValidElement(u)?s.cloneElement(u,{...m.props}):l.jsx("div",{style:h,...p})}),qT=s.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:d,onFocus:c,style:u=hn.EmptyCssProperties,children:p,alphaWhite:m,alphaGrey:h,darkMode:g,alphaCheckSize:f=7,...x}=e;if(!t)throw new Error("a selectedColor is required");const y=s.useCallback(M=>{r?.(M),M.isDefaultPrevented()||(M.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),w=s.useCallback(M=>{a?.(M),M.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=s.useCallback(M=>{d?.(M),M.isDefaultPrevented()},[o,d]),C=s.useCallback(M=>{c?.(M),M.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),k=s.useCallback(M=>{i?.(M),M.isDefaultPrevented()||M.keyCode===Wt.Enter&&n?.(t.toRGBA())},[n,i,t]),E=s.useMemo(()=>t.toRGBA().alpha===1?null:l.jsx(Rf,{size:f,white:m,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[m,h,t]);return l.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...u},tabIndex:0,...x,onClick:y,onKeyDown:k,onMouseOver:w,onMouseLeave:b,onFocus:C,children:[E,l.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),Dc=s.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:a,swatchProps:d,defaultButtonSize:c=24,isLarge:u=!1,compareRGB:p=!1,darkMode:m=!1,...h}=e,g=new N.Color({val:r.definition.val,adjs:r.definition.adjs},E=>t(E)),f=p?g.toRGBA().toString():g.toString(),x=n&&(p?n.toRGBA().toString():n.toString())===f,y=o&&(p?o.toRGBA().toString():o.toString())===f,w=[];w.push({[N.IColor.AdjustmentType.Inv]:!0}),w.push({[N.IColor.AdjustmentType.Alpha]:100});const b=g.adjust(w),C=s.useCallback(()=>{i?.(r)},[i,r]),k=s.useCallback(E=>{a?.(E?r:null)},[a,r]);return l.jsx(br,{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:l.jsx("div",{style:{width:c*(u?1.2:1)+"px",height:c*(u?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:l.jsxs(qT,{selectedColor:g,title:null,onSelectColor:C,onPreviewColor:k,alphaCheckSize:u?9:void 0,darkMode:m,...d,children:[l.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(m).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:x?"1":"0"}}),l.jsx("div",{style:{position:"absolute",width:.33*c*(u?1.2:1)+"px",height:.33*c*(u?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(m).toString(),borderRadius:"50%",opacity:y?"1":"0"}})]})})})}),Ws=s.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:d,style:c=hn.EmptyCssProperties,compareRGB:u=!1,darkMode:p,swatchProps:m,...h}=e;let g;if(Array.isArray(o[0]))g=o;else{g=[];for(let b=0;b<o.length;b++)g.push([o[b]])}const f=s.useCallback(b=>{a?.(b)},[a]),x=s.useCallback(b=>{d?.(b)},[d]),y=s.useMemo(()=>{let b=[];for(let C=0;C<g.length;C++){let k=[],E=g[C];for(let T=0;T<E.length;T++){let F=E[T];k.push(l.jsx(Dc,{schemeColorLookup:n,colorDef:F,selectedColor:r,previewColor:i,onSelectColorDef:f,onPreviewColorDef:x,swatchProps:m,compareRGB:u,darkMode:p},C+" "+T))}let M=l.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:T=>T.shadows[2],borderRadius:"2px",overflow:"hidden"},children:k},""+C);b.push(M)}return b},[g,r,i,f,x]),w=s.useMemo(()=>t?l.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:t}):null,[t]);return l.jsxs(B.Box,{style:{...c},children:[w,l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:y})]})}),$r=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),xo=(e,t,n,o,r,i)=>{const a=$r(e,t);o?.push(a);const d=new N.Color({val:a.definition.val,adjs:a.definition.adjs},n),c=d.toString();r?.set(c,d);const u=d.toRGBA().toString();i?.set(u,d)},ZT=s.lazy(()=>Promise.resolve().then(()=>require("./CQN6CMOb4-vmBky4.cjs"))),If=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:a=!1,previewDebounceTime:d=100,initialPanelType:c,defaultButtonSize:u=24,width:p,onElementLoad:m,onDone:h,onEyeDropStart:g,onEyeDropStop:f,onPreviewColor:x,onPreviewColorImmediate:y,onSelectColor:w,autoColor:b,autoColorLabel:C="Automatic",autoColorPosition:k=ra.Start,compareRGB:E=!1,darkMode:M=!1,...T}=e,F=o||n,_=de(x,[x]),O=de(y,[y]),S=de(w,[w]),v=de(g,[g]),D=de(f,[f]),[j,R]=s.useState(!1),P=Pr(),I=s.useMemo(()=>i||N.Color.getDefaultSchemeLookup(),[i]),L=s.useMemo(()=>{const J=new Map,se=new Map,Se=[];xo("Primary Background","bg1",I,Se,J,se),xo("Primary Text","tx1",I,Se,J,se),xo("Secondary Background","bg2",I,Se,J,se),xo("Secondary Text","tx2",I,Se,J,se),xo("Accent 1","accent1",I,Se,J,se),xo("Accent 2","accent2",I,Se,J,se),xo("Accent 3","accent3",I,Se,J,se),xo("Accent 4","accent4",I,Se,J,se),xo("Accent 5","accent5",I,Se,J,se),xo("Accent 6","accent6",I,Se,J,se);const Me=N.ITheme.buildPalette(Se,I,J,se),oe=[];if(xo("Dark Red","C00000",I,oe,J,se),xo("Red","FF0000",I,oe,J,se),xo("Orange","FFC000",I,oe,J,se),xo("Yellow","FFFF00",I,oe,J,se),xo("Light Green","92D050",I,oe,J,se),xo("Green","00B050",I,oe,J,se),xo("Light Blue","00B0F0",I,oe,J,se),xo("Blue","0070C0",I,oe,J,se),xo("Dark Blue","002060",I,oe,J,se),a?xo("Purple Is A Fruit","7030A0",I,oe,J,se):xo("Transparent","00000000",I,oe,J,se),b){const Ne=b.toString();J.set(Ne,b)}const ne=new Map,he=typeof r=="function"?r():r,ze=[];for(let Ne=0;he&&Ne<he.length;Ne++){const gt=he[Ne].toString();ne.set(gt,he[Ne]),ze.push({description:"Recent "+(Ne+1),definition:{val:he[Ne].toString()}})}return{primaryColors:Se,modifiedPresets:Me,standardColors:oe,recentColorsLimited:ze,mapAllPresets:J,mapAllPresetsRGB:se,mapRecent:ne}},[I,r,a,b]);s.useEffect(()=>{m?.()},[]);const[H,W]=s.useState(!1),A=s.useCallback(()=>{W(J=>!J)},[]);s.useEffect(()=>{if(c)W(c===Mf.Custom);else if(n){let J=n.toString(),se=L.mapAllPresets.get(J);se||(J=n.toRGBA().toString(),se=L.mapAllPresetsRGB.get(J));const Se=L.mapRecent.get(J);W(!se&&!Se)}},[n,c]);const U=s.useCallback(N.CommonUtils.debounce(J=>{_?.(J)},d),[_,d]),[X,ee]=s.useState();s.useEffect(()=>{ee(o||n)},[o,n]);const V=de(J=>{O&&(O(J),U(J))},[O]),$=de(J=>{V(J?new N.Color({val:J.definition.val,adjs:J.definition.adjs},I):null)},[I]),z=s.useCallback(J=>{J.ctrlKey&&W(!0)},[]),q=de(J=>{let se=!1;if(J){const Se=J.toString();se=!L.mapAllPresets.has(Se)}S?.(J,se)},[S,L]),G=de(J=>{const se=J?new N.Color({val:J.definition.val,adjs:J.definition.adjs},I):null;Promise.resolve(h?.()).then(()=>{q(se)})},[I,h]),Q=de(J=>{V(J?new N.Color(J,I):null)},[I]),Y=s.useMemo(()=>window.EyeDropper===void 0?l.jsx(l.Fragment,{}):l.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:J=>J.palette.text.icon??J.palette.action.active},onClick:async()=>{R(!0),v?.(),await new EyeDropper().open().then(J=>{R(!1),D?.();let se=new N.Color(J.sRGBHex),Se=se.toString(),Me=L.mapAllPresets.get(Se);if(Me||(Se=se.toRGBA().toString(),Me=L.mapAllPresetsRGB.get(Se)),!Me){const oe=se.toRGBA(),ne=3;let he=255;L.mapAllPresetsRGB.forEach((ze,Ne)=>{const gt=ze.toRGBA(),bt=Math.abs(gt.red-oe.red)+Math.abs(gt.blue-oe.blue)+Math.abs(gt.green-oe.green);bt<ne&&bt<he&&(Me=ze)})}W(!Me),V(Me||se)}).catch(J=>{R(!1),J?.name!=="AbortError"&&console.error(J)})},children:l.jsx(gn.Colorize,{})}),[L,M]),te=s.useMemo(()=>{if(!H)return;const J={opacity:H?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return l.jsx(s.Suspense,{fallback:l.jsx("div",{style:J,children:l.jsx(Z0,{})}),children:l.jsx(ZT,{style:J,selectedColor:F?F.toRGBA().toString():"transparent",onColorChange:Q,disableAlpha:a})})},[H,F]),re=s.useMemo(()=>({onClick:z,alphaGrey:P.palette.text.icon??P.palette.action.active}),[z,P]),ge=s.useMemo(()=>{if(!b)return null;const J={description:C,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return l.jsx(l.Fragment,{children:l.jsxs(B.MenuItem,{sx:{display:"flex",color:se=>se.palette.text.secondary},onMouseOver:()=>{$(null)},onClick:()=>{G(null)},children:[l.jsx(B.Box,{sx:{flex:"none",boxShadow:se=>se.shadows[2],borderRadius:se=>se.spacing(.5),overflow:"hidden"},children:l.jsx(Dc,{schemeColorLookup:I,colorDef:J,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:u,isLarge:!0,darkMode:M,compareRGB:E,swatchProps:re})}),l.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:C})]})})},[b,C,I,n,o]);return l.jsxs(B.Box,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...T,children:[l.jsxs("div",{style:{position:"relative",display:"flex"},children:[l.jsxs("div",{style:{opacity:H?"0":1},children:[ge&&k===ra.Start?l.jsxs(l.Fragment,{children:[ge,l.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,l.jsx(Ws,{title:"Theme Colors",schemeColorLookup:I,colorDefs:L.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsx(Ws,{schemeColorLookup:I,colorDefs:L.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsx(Ws,{title:"Standard Colors",schemeColorLookup:I,colorDefs:L.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M}),l.jsxs("div",{style:{opacity:L.recentColorsLimited.length===0?"0":void 0,display:L.recentColorsLimited.length===0?"none":void 0},children:[l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsx(Ws,{title:"Recent Colors",schemeColorLookup:I,colorDefs:L.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:re,onPreviewColorDef:$,onSelectColorDef:G,compareRGB:E,darkMode:M})]}),ge&&k===ra.End?l.jsxs(l.Fragment,{children:[l.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ge,l.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),te]}),l.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[Y,l.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),l.jsx(B.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{A()},children:H?l.jsx("div",{children:"Preset"}):l.jsx("div",{children:"Custom"})}),l.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{q(X)})},children:"Done"})]})]})})),GT=l.jsx(Tb,{}),s5=s.memo(s.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=GT,tooltip:i,label:a,onPreviewColor:d,onPreviewColorImmediate:c,onSelectColor:u,variant:p=Lr.Toolbar,panelProps:m,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:f=!1,...x}=e,y=de(d,[d]),w=de(c,[c]),b=de(u,[u]),[C,k]=s.useState(()=>{}),E=o||C||n||m?.autoColor,M=s.useRef(!1),T=s.useCallback(()=>{},[]),F=de(()=>{k(n)},[n]),_=de(L=>{M.current||(k(L),y?.(L))},[y]),O=de(L=>{M.current||(k(L),w?.(L))},[w]),S=de((L,H)=>{M.current||(k(void 0),b?.(L,H))},[b]),v=s.useMemo(()=>l.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${E?.toCSS(f)??"transparent"}`,"& .activeColor":{fill:`${E?.toCSS(f)??"transparent"}`},"& .style_grey":{fill:L=>L.palette.text.icon??L.palette.action.active}},children:typeof r=="function"?r():r}),[E,r,f]),D=de(L=>{b?.(o,!1)},[b,o]),[j,R]=s.useState(!1),P=s.useCallback(L=>{const{closeFloat:H,closeFloatAll:W}=L;return l.jsx(If,{...m,selectedColor:n,previewColor:C,onDone:h?W:H,onKeyDown:A=>{A.which===Wt.Enter&&(h?W():H())},onPreviewColorImmediate:O,onPreviewColor:_,onSelectColor:S,onEyeDropStart:()=>R(!0),onEyeDropStop:()=>R(!1),compareRGB:g,darkMode:f})},[n,C,h,E,m?.autoColor,f]),I={onQuickClick:o?D:void 0,createPopupPanel:P,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:F,onPopupClose:T,tooltip:i||a||"Color",label:a,icon:v,...x};return p===Lr.Toolbar?l.jsx(Gr,{ref:t,...I}):l.jsx(Jl,{ref:t,...I})})),C1=82,a2=e=>{const{styleColor:t,length:n=C1,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:d=!1,darkMode:c=!1,...u}=e;return l.jsx(B.SvgIcon,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...u,children:l.jsx(Um,{length:n,width:o,dashArray:r,isDouble:a,isAngled:d,className:"activeColor"})})},Df=s.memo(s.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:a,selectedStyle:d,onSelectStyle:c,showNone:u=!0,darkMode:p,sx:m,...h}=e,g=de(c,[]),f=s.useCallback(b=>{const{popupContainer:C,floatReference:k,closeFloat:E,...M}=b,T=[],F=N.IBorder.BuiltInDefinitionsArray;for(let _=0;_<F.length;_++){const O=F[_];if(O.description==="None"&&!u)continue;const S=l.jsx(a2,{styleColor:a,length:C1,width:O.width,darkMode:p,dashArray:O.pattern,isDouble:O.description.toLowerCase().includes("double"),isAngled:O.description.toLowerCase().includes("slant")});let v=null;v=o?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{marginRight:"6px"},children:O.description}),l.jsxs(B.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[l.jsx("div",{style:{flex:"1 1 100%"}}),S]})]}):O.description==="None"?"None":S,T.push(l.jsx(lr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:w6(4)},paddingLeft:"16px",background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},tooltipProps:{description:o?"":O.description},icon:null,disabled:r,onMouseDown:D=>D.preventDefault(),onMouseUp:()=>{E(),g(O.style)},onKeyDown:D=>{D.which===Wt.Enter&&E()},selected:O.style===d,parentFloat:k,children:v},_))}return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:T})},[r,u,a,d,p]),x=s.useMemo(()=>{const b=N.IBorder.BuiltInDefinitions.get(d);let C;return C=b.description==="None"?l.jsx(B.Box,{sx:{minWidth:`${C1}px`},children:"None"}):l.jsx(a2,{styleColor:a,length:C1,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),l.jsx(B.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:w6()}},children:C})},[d,a]),y=s.useMemo(()=>N.IBorder.BuiltInDefinitions.get(d),[d]),w={disabled:r,icon:x,tooltip:"Border Style: "+y.description,sx:{background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...m},createPopupPanel:f,...h};return n===Lr.Toolbar?l.jsx(Gr,{...w}):l.jsx(Jl,{...w})})),Lf=s.memo(s.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=N.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:a=!1,showStylingBefore:d=!0,onSelectBorder:c,onPreviewBorder:u,selectedBorder:p,createTemporaryBorder:m,...h}=e,g=de(c,[c]),f=de(u,[u]),[x,y]=s.useState(),[w,b]=s.useState(),C=x??r,k=w??n,E=p||{bottom:{style:r,color:n?.toString()}},M=de(v=>{const D={},j=v?Object.keys(v):[];let R=!1;for(let X=0;X<j.length;X++)v[j[X]]?.style&&(D[j[X]]={style:v[j[X]].style,color:v[j[X]].color},R||D[j[X]].style===N.IBorder.StrokeStyle.None||(R=!0));j.length<6&&(R=!0);const P=R?D.left:null,I=R?D.top:null,L=R?D.right:null,H=R?D.bottom:null,W=R?D.vertical:null,A=R?D.horizontal:null;let U="";return I||P||(U+="M 3,5 H 5 V 3 H 3 "),I||(U+="M 7,5 H 9 V 3 H 7 "),I||W||(U+="M 11,5 h 2 V 3 h -2 "),I||(U+="M 15,5 h 2 V 3 h -2 "),I||L||(U+="M 19,5 h 2 V 3 h -2 "),P||(U+="M 3,9 H 5 V 7 H 3 "),W||(U+="M 11,9 h 2 V 7 h -2 "),L||(U+="M 19,9 h 2 V 7 h -2 "),A||P||(U+="M 3,13 H 5 V 11 H 3 "),A||(U+="M 7,13 H 9 V 11 H 7 "),A||W||(U+="M 11,13 h 2 v -2 h -2 "),A||L||(U+="M 19,13 h 2 v -2 h -2 "),A||(U+="M 15,13 h 2 v -2 h -2 "),P||(U+="M 3,17 H 5 V 15 H 3 "),W||(U+="M 11,17 h 2 v -2 h -2 "),L||(U+="M 19,17 h 2 v -2 h -2 "),H||P||(U+="M 3,21 H 5 V 19 H 3 "),H||(U+="M 7,21 H 9 V 19 H 7 "),H||W||(U+="M 11,21 h 2 v -2 h -2 "),H||(U+="M 15,21 h 2 v -2 h -2 "),H||L||(U+="M 19,21 h 2 v -2 h -2 "),l.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[l.jsx(B.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:l.jsx("path",{d:U})}),l.jsx(B.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:Yl}},children:l.jsx(Q2,{getBorderAt:(X,ee)=>{if(!m||j.length===0)return null;const V=X.rowIndex,$=X.colIndex,z={};return V===0?(z.top=D.top,z.bottom=D.horizontal):(z.top=D.horizontal,z.bottom=D.bottom),$===0?(z.left=D.left,z.right=D.vertical):(z.left=D.vertical,z.right=D.right),m?.(z)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[k,C,a]),T=s.useCallback((v,D,j)=>{let R=null;if(v&&v.length>0){let P=null;(D||j)&&(P={style:j,color:D?.toString()??null}),R={};for(let I=0;I<v.length;I++)R[v[I]]=P}return R},[]),F=s.useCallback(v=>{g?.(v)},[]),_=s.useCallback(v=>{f?.(v)},[]),O=s.useCallback(v=>{const{closeFloatAll:D,floatReference:j}=v,R=(L,H,W="bottom",A=!1)=>{const U=T(L,k??null,A?N.IBorder.StrokeStyle.None:C??null),X=A?T([],k??null,C??null):U;return l.jsx(gr,{icon:M(X),sx:{background:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},tooltipProps:{label:H,simple:!0,placement:W},onClick:()=>{D(),_(U),F(U)}})},P=l.jsxs(l.Fragment,{children:[l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom,N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical],"All Borders","top"),R([N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical],"Inner Borders","top"),R([N.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),R([N.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom],"Outside Borders","top")]}),l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[R([N.IBorder.Edge.Left],"Left Borders"),R([N.IBorder.Edge.Top],"Top Borders"),R([N.IBorder.Edge.Right],"Right Borders"),R([N.IBorder.Edge.Bottom],"Bottom Borders"),R([N.IBorder.Edge.Left,N.IBorder.Edge.Top,N.IBorder.Edge.Right,N.IBorder.Edge.Bottom,N.IBorder.Edge.Horizontal,N.IBorder.Edge.Vertical,N.IBorder.Edge.DiagonalUp,N.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),I=l.jsx(l.Fragment,{children:l.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[l.jsx(s5,{variant:Lr.Toolbar,icon:l.jsx(T2,{}),selectedColor:C===N.IBorder.StrokeStyle.None?new N.Color("transparent"):k,onPreviewColor:L=>{b(L)},onSelectColor:(L,H)=>{b(L)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||C===N.IBorder.StrokeStyle.None,parentFloat:j,shouldCloseFloatAll:!1}),l.jsx(Df,{selectedStyle:C,onSelectStyle:y,styleColor:k,darkMode:a,variant:Lr.Toolbar,parentFloat:j})]})});return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:L=>L.stopPropagation(),children:[d?I:P,l.jsx(Mt,{orientation:"horizontal"}),d?P:I]})},[C,k,n,o,a]),S=s.useMemo(()=>M(E),[E,a]);return l.jsx(Gr,{ref:t,createPopupPanel:O,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},D)=>l.jsx(Bo,{label:"Borders",description:"Set the borders.",disabled:D,children:v}),onQuickClick:()=>{g?.(E)},quickButtonProps:{sx:{}},disabled:i,icon:S,...h})})),Of=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Ht.Toolbar,disabled:a=!1,autoColor:d,autoStrokeStyle:c,schemeLookup:u,createTemporaryBorder:p,selectedBorder:m,onSelectBorder:h,darkMode:g,icon:f,label:x,...y}=e,w=no(n,["formatBorder"]),b=o??w[0],C=b?.context()??null,k=C?.autoColor??d,E=C?.autoStyle??c,M=m??C?.quickBorder,T=g??C?.darkMode,F=p??C?.createTemporaryBorder,_=u??C?.schemeLookup,O=de(v=>{C?.onBorderSelect&&C.onBorderSelect(v),h?.(v),b?.execute(v,r)},[b,h,r]),S=s.useCallback((v,D)=>{const{children:j,title:R,...P}=v;let I=v.children;return(b?.disabled()||a)&&(I=l.jsx("div",{children:I})),l.jsx(ba,{command:b,placement:i===Ht.Toolbar?"bottom-start":"right-start",disabled:D,...P,children:I})},[b,a]);return l.jsx(Lf,{ref:t,autoColor:k,darkMode:T,autoStrokeStyle:E,createTemporaryBorder:F,schemeLookup:_,selectedBorder:M,onSelectBorder:O,createTooltip:S,disabled:a||!b||b.disabled(),...y})})),Af=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("mergeToggle"),icon:xe(l.jsx(v6,{}))}),l.jsx(je,{...p,command:u.getCommand("mergeHorizontal"),icon:xe(l.jsx(jb,{}))}),l.jsx(je,{...p,command:u.getCommand("mergeVertical"),icon:xe(l.jsx(Mb,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:u.getCommand("unmerge"),icon:xe(l.jsx(zh,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:d,icon:xe(l.jsx(v6,{})),...a})})),Pf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("freezeToggle"),icon:xe(l.jsx(Lb,{}))}),l.jsx(je,{...p,command:u.getCommand("freezeToggleHorizontal"),icon:xe(l.jsx(Ib,{}))}),l.jsx(je,{...p,command:u.getCommand("freezeToggleVertical"),icon:xe(l.jsx(Db,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:u.getCommand("unfreeze"),icon:l.jsx(zh,{})})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:d,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:l.jsx(Rb,{}),...a})})),Ff=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("find"),icon:xe(l.jsx($6,{}))}),l.jsx(je,{...p,command:u.getCommand("findReplace"),icon:xe(l.jsx(Qh,{}))}),l.jsx(je,{...p,command:u.getCommand("goto"),icon:xe(l.jsx(rv,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:d,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:xe(l.jsx($6,{})),...a})})),zf=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:a=NE.DefaultFontSizes,disabled:d=!1,parentFloat:c,icon:u,label:p,sx:m,...h}=e;q0(n);const g=()=>n?.state()?.toString()||"11",[f,x]=s.useState(g),y=de(()=>{const F=parseFloat(f);isNaN(F)?x(g()):parseFloat(g())!==F&&n.execute(F,o)},[g,n,f,o]);s.useEffect(()=>{x(g())},[n?.state()]);const w=s.useMemo(()=>{if(!o)return null;const F={...o};return delete F.beforeExecute,F},[o]),b=no(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),C=s.useMemo(()=>b?l.jsxs(B.Box,{className:Zn("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[l.jsx(je,{command:b[0],commandHook:w,icon:xe(l.jsx(Fw,{}))}),l.jsx(je,{command:b[1],icon:xe(l.jsx(zw,{}))})]}):null,[b]),k=Pr(),E=s.useMemo(()=>`${N.IFont.getSharedMeasurer()("12.3",Math.round(k.typography.fontSize),k.typography.fontFamily).width}px`,[k]),M=s.useCallback(F=>{const{onMouseDown:_,onMouseUp:O,...S}=F;return l.jsx(B.IconButton,{component:"div",...S,disableRipple:!0,children:l.jsx(B.Input,{inputMode:"numeric",disabled:d||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom: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:E,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:f,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===Wt.Enter)g()!==f&&(v.stopPropagation(),v.preventDefault(),y());else if(v.which===Wt.Escape)g()!==f&&(x(g()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(f+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===Wt.Space)return void v.preventDefault()}},onBlur:()=>{y()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();x(v.target.value)}})})},[f,d,n]),T=s.useCallback(F=>{const _=D=>{n?.execute(D,o)},O=n?.state(),S=[];for(let D=0;D<a.length;D++){const j=a[D]===O;S.push(l.jsx(lr,{selected:j,icon:j?l.jsx(Ql,{}):void 0,disabled:d||!n||n.disabled(),onMouseDown:R=>{R.button===0&&R.preventDefault()},onMouseUp:R=>{R.button===0&&_(a[D])},onKeyDown:R=>{R.keyCode!==Wt.Enter&&R.keyCode!==Wt.Space||_(a[D])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[D]})},"fontSize-"+D))}const v=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...h,children:[C,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:S})]});return wn({...F,children:v})},[d,n?.state(),o]);return l.jsx(Gr,{ref:t,sx:{...m},tabIndex:-1,outlined:!0,disabled:d,parentFloat:c,createPopupPanel:T,createTooltip:({children:F},_)=>l.jsx(Bo,{label:n?.label(),description:n?.description(),disabled:_||n?.disabled(),children:F}),createQuickButton:M,...h})})),P8=s.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:a,...d}=e;return l.jsx(lr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...a},disabled:n,selected:t,icon:t?l.jsx(Ql,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==Wt.Enter&&c.keyCode!==Wt.Space||r(i.numberFormat)},...d,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[l.jsxs(B.Typography,{component:"div",children:[i.formatType,i.formatType===N.NumberFormat.Type.Custom?"…":""]}),l.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:c=>dt.alpha(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),Bf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:a=!1,parentFloat:d,...c}=e,u=no(n,["formatNumberFormat"])[0],p=u?.state()?N.NumberFormat.Styles.lookupStyle(u?.state()).formatType:N.NumberFormat.Type.General,m=s.useMemo(()=>{if(!o)return null;const x={...o};return delete x.beforeExecute,x},[o]),h=s.useCallback((x,y)=>{const w=O=>{o?.beforeExecute?.(u,u?.state()),u.execute(O,o),o?.onExecute?.(u,u?.state())},b=u?.context()(),C=N.NumberFormat.Styles.lookupPrimary(),k=[];for(let O=0;O<C.length;O++){let S="";if(b&&!b.isEmpty())try{S=b.getNumberFormat(C[O].numberFormat).displayText}catch(D){console.warn(D)}S===""&&C[O].formatType===N.NumberFormat.Type.General&&(S="No specific format");const v=C[O].formatType===p;k.push(l.jsx(P8,{selected:v,disabled:a||!u||u.disabled(),formattedValue:S,handleSetFormat:w,format:C[O]},C[O].formatType))}const E={numberFormat:"",formatType:N.NumberFormat.Type.Custom},M=p===N.NumberFormat.Type.Custom,T=l.jsx(P8,{selected:M,disabled:a||!u||u.disabled(),formattedValue:M?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(u,u?.state()),y.getCommand("formatNumberDialog")?.execute(u?.state()),o?.onExecute?.(u,u?.state())},format:E,sx:{flex:"0",width:"100%"}},N.NumberFormat.Type.Custom),F=l.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:O=>O.stopPropagation(),children:[l.jsx(je,{command:y.getCommand("formatNumberFormatAccountingStyle"),commandHook:m,scope:r,icon:l.jsx(zb,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatPercentStyle"),commandHook:m,scope:r,icon:l.jsx(Ab,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatCommaStyle"),commandHook:m,scope:r,icon:l.jsx(Ob,{})}),l.jsx(je,{command:y.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:m,scope:r,icon:xe(l.jsx(Pb,{}))}),l.jsx(je,{command:y.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:m,scope:r,icon:xe(l.jsx(Fb,{}))})]}),_=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[F,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),l.jsx(Mt,{orientation:"horizontal"}),T]});return wn({...x,children:_})},[u?.context(),u?.state(),o,r]),g=Pr(),f=s.useMemo(()=>{const x=N.NumberFormat.Type.MediumTime;return`${N.IFont.getSharedMeasurer()(x,Math.round(g.typography.fontSize),g.typography.fontFamily).width}px`},[g]);return l.jsx(In,{ref:t,commands:n,sx:i,outlined:!0,disabled:a,parentFloat:d,createPopupPanel:h,createTooltip:({children:x},y)=>l.jsx(Bo,{label:u?.label(),description:u?.description(),disabled:y,children:x}),icon:l.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:x=>`${Math.round(x.typography.fontSize)}px`,color:x=>x.palette.text.secondary,fontFamily:x=>x.typography.fontFamily,width:f},children:l.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),c5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"clear",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("clearAll"),icon:l.jsx(G3,{})}),l.jsx(je,{...p,command:u.getCommand("clearFormats"),icon:xe(l.jsx(vh,{}))}),l.jsx(je,{...p,command:u.getCommand("clearContents"),icon:xe(l.jsx(Dy,{}))}),l.jsx(je,{...p,command:u.getCommand("clearComments")}),l.jsx(je,{...p,command:u.getCommand("clearHyperlinks")})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:d,icon:l.jsx(G3,{}),...a})})),Nf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"fill",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("fillDown"),icon:xe(l.jsx(Fa,{}))}),l.jsx(je,{...p,command:u.getCommand("fillRight"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(270deg)"}}))}),l.jsx(je,{...p,command:u.getCommand("fillUp"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(180deg)"}}))}),l.jsx(je,{...p,command:u.getCommand("fillLeft"),icon:xe(l.jsx(Fa,{sx:{transform:"rotate(90deg)"}}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:d,icon:xe(l.jsx(Fa,{})),...a})})),d5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=Ht.Toolbar,...p}=e,m=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=no(n,m),{singleCommand:g,allDisabled:f}=s.useMemo(()=>{let w=null,b=0;for(let C=0;C<h.length;C++)h[C]&&!h[C]?.disabled()&&(d&&u===Ht.Menuitem&&(w=b===0?h[C]:null),b++);return{singleCommand:w,allDisabled:b===0}},[h]),x=s.useMemo(()=>{const w=new Map;return w.set("insertCellsShiftDown",xe(l.jsx(R6,{}))),w.set("insertCellsShiftRight",xe(l.jsx(R6,{sx:{transform:"rotate(270deg)"}}))),w.set("insertRows",xe(l.jsx(Iw,{}))),w.set("insertColumns",xe(l.jsx(I6,{}))),w},[]),y=s.useCallback((w,b)=>{let C=null;const k={variant:Ht.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(C=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:b.getCommand("addSheet"),icon:xe(l.jsx(sa,{}))})]}));const E=l.jsxs(l.Fragment,{children:[l.jsx(je,{...k,command:h[0],icon:x.get(m[0])}),l.jsx(je,{...k,command:h[1],icon:x.get(m[1])}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:h[2],icon:x.get(m[2])}),l.jsx(je,{...k,command:h[3],icon:x.get(m[3])}),C]});return wn({...w,children:E})},[i,h,o,r,x]);return g?l.jsx(je,{ref:t,variant:u,commandHook:o,disabled:i,command:g,icon:x.get(g.key()),...p}):l.jsx(In,{ref:t,variant:u,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||f,tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),l.jsx("br",{}),l.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:xe(l.jsx(I6,{})),...p})})),u5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:d=!0,showQuickButton:c=!0,variant:u=Ht.Toolbar,...p}=e,m=no(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:g}=s.useMemo(()=>{let y=null,w=0;for(let b=0;b<m.length;b++)m[b]&&!m[b]?.disabled()&&(d&&u===Ht.Menuitem&&(y=w===0?m[b]:null),w++);return{singleCommand:y,allDisabled:w===0}},[m]),f=s.useMemo(()=>{const y=new Map;return y.set("deleteCellsShiftUp",xe(l.jsx(D6,{sx:{transform:"rotate(0deg)"}}))),y.set("deleteCellsShiftLeft",xe(l.jsx(D6,{sx:{transform:"rotate(270deg)"}}))),y.set("deleteRows",xe(l.jsx(Dw,{}))),y.set("deleteColumns",xe(l.jsx(L6,{}))),y},[]),x=s.useCallback((y,w)=>{const b={variant:Ht.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let C=null;a||(C=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...b,command:w.getCommand("deleteSheet"),icon:xe(l.jsx(sa,{}))})]}));const k=l.jsxs(l.Fragment,{children:[l.jsx(je,{...b,command:w.getCommand("deleteCellsShiftUp"),icon:f.get("deleteCellsShiftUp")}),l.jsx(je,{...b,command:w.getCommand("deleteCellsShiftLeft"),icon:f.get("deleteCellsShiftLeft")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...b,command:w.getCommand("deleteRows"),icon:f.get("deleteRows")}),l.jsx(je,{...b,command:w.getCommand("deleteColumns"),icon:f.get("deleteColumns")}),C]});return wn({...y,children:k})},[i,o,r,f]);return h?l.jsx(je,{ref:t,variant:u,commandHook:o,disabled:i,command:h,icon:f.get(h.key()),...p}):l.jsx(In,{ref:t,variant:u,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),l.jsx("br",{}),l.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:x,icon:xe(l.jsx(L6,{})),...p})})),xa=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Ht.Toolbar,quickColor:d,panelProps:c,isSplit:u=!1,darkMode:p,icon:m,...h}=e,{autoColor:g,schemeLookup:f,recentColors:x,...y}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");q0(n);const w=n?.context();let b=d??w?.quickColor;u&&!b&&(b=new N.Color("transparent"));const C=g??w?.autoColor,k=f??w?.schemeLookup,E=x??w?.recentColors,M=p??w?.darkMode,T=s.useMemo(()=>({autoColor:C,schemeLookup:k,recentColors:E,darkMode:M,...y}),[C,k,E,M]),F=de((O,S)=>{O&&S&&w?.addRecentColor&&w.addRecentColor(O),w?.onColorSelect&&w.onColorSelect(O),r?.(O,S),n?.execute(O,o)},[n,r,o,w]),_=s.useCallback((O,S)=>{const{children:v,title:D,...j}=O;let R=O.children;return(n?.disabled()||i)&&(R=l.jsx("div",{children:R})),l.jsx(ba,{command:n,placement:a===Ht.Toolbar?"bottom-start":"right-start",disabled:S,...j,children:R})},[n,i]);return l.jsx(s5,{ref:t,panelProps:T,icon:m,quickColor:b,selectedColor:n?.state(),onSelectColor:F,variant:a===Ht.Menuitem?Lr.Menuitem:Lr.Toolbar,createTooltip:_,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:M,...h})}));xa.displayName="ColorCommandButton";const Vf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),u=s.useCallback((p,m)=>{const h={variant:Ht.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=l.jsxs(l.Fragment,{children:[l.jsx(je,{...h,command:m.getCommand("gridlinesToggle")}),l.jsx(xa,{...h,command:m.getCommand("sheetViewFormatGridlinesColor"),icon:l.jsx(T2,{}),panelProps:{disableAlpha:!0}}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleGridlinesColumns")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleGridlinesRows")})]});return wn({...p,children:g})},[i,o]);return l.jsx(In,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:l.jsx(ma,{command:c[0],scope:"view"}),...d})})),p5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"sort",disabled:i},m=u.getCommand("sortCustom"),h=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:u.getCommand("sortAscending"),icon:xe(l.jsx(Tu,{}))}),l.jsx(je,{...p,command:u.getCommand("sortDescending"),icon:xe(l.jsx(Kh,{}))}),m?l.jsx(je,{...p,command:m,icon:xe(l.jsx(Pw,{}))}):null,l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:xe(l.jsx(bu,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:xe(l.jsx(j2,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:xe(l.jsx(Bh,{}))})]});return wn({...c,children:h})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Organize your data so it's easier to analyze."}),l.jsx("br",{}),l.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:xe(l.jsx(Tu,{})),...a})})),KT=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=s.useCallback((c,u)=>{const p={variant:Ht.Menuitem,commandHook:o,scope:"sort",disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterToggle"),icon:xe(l.jsx(bu,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterClear"),icon:xe(l.jsx(j2,{}))}),l.jsx(je,{...p,scope:"filter",command:u.getCommand("autoFilterReapply"),icon:xe(l.jsx(Bh,{}))})]});return wn({...c,children:m})},[i,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Organize your data so it's easier to analyze."}),l.jsx("br",{}),l.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:d,icon:xe(l.jsx(bu,{})),...a})})),h5=s.memo(s.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:a,scope:d,sx:c,disabled:u,commands:p,...m}=e,h=[n];!r&&i&&h.push("redo");const g=no(p,h),f=g[0],x=g[1],y=a??f?.context?.()?.undoManager;let w=u;u||(w=!f||f.disabled(),x&&!x.disabled()&&(w=!1));const[b,C]=s.useState(0),k=s.useCallback((E,M)=>{let T=b===0?"Cancel":`${f.label()} ${b} Action${b===1?"":"s"}`,F=!1;y||(F=!0),F||(F=i?!y.hasRedo()&&!y.hasUndo():!y.hasRedo());const _=R=>{f.execute(R)},O=l.jsx(lr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:F?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{C(0)},onMouseDown:R=>{R.button===0&&R.preventDefault()},onMouseUp:R=>{R.button===0&&_(b)},onKeyDown:R=>{R.isDefaultPrevented()||R.keyCode!==Wt.Enter&&R.keyCode!==Wt.Space||_(b)},children:l.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:T})});if(F)return O;const S=r?y?.getRedoDescriptions():y?.getUndoDescriptions(),v=[];for(let R=0;R<S.length;R++){const P=S[R];v.push(l.jsx(lr,{sx:{maxWidth:"360px",display:"flex"},icon:l.jsx(sa,{}),disabled:w,selected:R<b,onMouseEnter:()=>{C(R+1)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&_(R+1)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==Wt.Enter&&I.keyCode!==Wt.Space||_(R+1)},children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[l.jsx(B.Typography,{component:"div",children:P}),l.jsx(sa,{})]})},`action:${R}`))}let D=null;if(!r&&i){const R={scope:"undo",commands:M,variant:Ht.Menuitem,parentFloat:E.floatReference};D=[],D.push(l.jsx(h5,{...R,quickCommand:"redo",isRedo:!0},"nested:redo")),y.hasRedo()&&y.hasUndo()&&D.push(l.jsx(Mt,{orientation:"horizontal"},"action:redo-div"))}const j=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{E.closeFloatAll()},onMouseLeave:()=>{C(0)},children:[D,l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),l.jsx(Mt,{orientation:"horizontal"}),O]});return wn({...E,children:j})},[f?.context(),f?.state(),d,y,b,w]);return l.jsx(In,{ref:t,commands:p,quickCommand:n,scope:d,disabled:w,label:f?.label()??(r?"Redo":"Undo"),tooltip:l.jsx(l.Fragment,{children:l.jsx("span",{children:`${f?.label()??"No"} last actions.`})}),createPopupPanel:k,icon:o??xe(r?l.jsx(jv,{}):l.jsx(Tv,{})),selected:!1,...m})})),ia=N.IFontCollection.getFontList(),Hf=new Map;for(let e=0;e<ia.length;e++)Hf.set(ia[e].fontRef.getFamily(),ia[e]);const $f=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,icon:d,label:c,...u}=e;q0(n);const p=n?.state(),m=Pr(),h=s.useMemo(()=>`${N.IFont.getSharedMeasurer()("Times New Roman",Math.round(m.typography.fontSize),m.typography.fontFamily).width}px`,[m]),g=s.useCallback(f=>{const x=C=>{n?.execute(C,o)},y=[];for(let C=0;C<ia.length;C++)y.push({key:ia[C].fontRef.getFamily(),description:ia[C].fontRef.getFamily()});Hf.get(p)||y.unshift({key:p,description:p});const w=[];for(let C=0;C<y.length;C++){const k=y[C].key===p;w.push(l.jsx(lr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:k,disabled:i||!n||n.disabled(),icon:k?l.jsx(Ql,{}):void 0,onMouseUp:E=>{E.button===0&&x(y[C].key)},onMouseDown:E=>{E.button===0&&E.preventDefault()},onKeyDown:E=>{E.keyCode!==Wt.Enter&&E.keyCode!==Wt.Space||x(y[C].key)},children:l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:l.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>y[C]?.key},children:y[C].description})})},C+""+y[C].key))}const b=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...u,children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:w})});return wn({...f,children:b})},[i,n?.state()]);return l.jsx(Gr,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:g,createTooltip:({children:f},x)=>l.jsx(Bo,{label:n?.label(),description:n?.description(),disabled:x,children:f}),icon:l.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:f=>`${Math.round(f.typography.fontSize)}px`,fontFamily:f=>f.typography.fontFamily,color:f=>f.palette.text.secondary,width:h},children:l.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...u})})),Wf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatStrikeThroughToggle",xe(l.jsx(O6,{}))),m.set("formatSuperscriptToggle",xe(l.jsx(Bw,{}))),m.set("formatSubscriptToggle",xe(l.jsx(Nw,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:"textEffects",disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:u.get("formatStrikeThroughToggle")}),l.jsx(je,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:u.get("formatSuperscriptToggle")}),l.jsx(je,{...g,command:h.getCommand("formatSubscriptToggle"),icon:u.get("formatSubscriptToggle")})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:u.get(c)??xe(l.jsx(O6,{})),...a})})),Uf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=s.useMemo(()=>{for(let m=0;m<d.length;m++)if(d[m]?.state())return d[m].key();return d[0]?.key()},[d]),u=s.useMemo(()=>{const m=new Map;return m.set("formatUnderlinedToggle",xe(l.jsx(cd,{}))),m.set("formatUnderlinedDoubleToggle",xe(l.jsx(A6,{}))),m.set("formatUnderlinedAccountingToggle",xe(l.jsx(P6,{}))),m.set("formatUnderlinedAccountingDoubleToggle",xe(l.jsx(F6,{}))),m},[]),p=s.useCallback((m,h)=>{const g={variant:Ht.Menuitem,commandHook:o,scope:"underline",disabled:i},f=l.jsxs(l.Fragment,{children:[l.jsx(je,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:xe(l.jsx(cd,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:xe(l.jsx(A6,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:xe(l.jsx(P6,{}))}),l.jsx(je,{...g,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:xe(l.jsx(F6,{}))})]});return wn({...m,children:f})},[i,o,r]);return l.jsx(In,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:u.get(c)??xe(l.jsx(cd,{})),...a})})),m5=s.memo(s.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:a=!0,disabled:d=!1,...c}=e,u=de((p,m)=>{const h={variant:Ht.Menuitem,commandHook:r,scope:"paste",disabled:d},g=[];return a&&(g.push(s.createElement(je,{...h,command:m.getCommand("paste"),key:"paste",icon:l.jsx(M6,{})})),g.push(l.jsx(Mt,{orientation:"horizontal"},"paste-div"))),g.push(s.createElement(je,{...h,command:m.getCommand("pasteValues"),key:"pasteValues",icon:xe(l.jsx(Sw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteFormats"),key:"pasteFormats",icon:xe(l.jsx(Cw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteFormulas"),key:"pasteFormulas",icon:xe(l.jsx(kw,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteTranspose"),key:"pasteTranspose",icon:xe(l.jsx(Ew,{}))})),g.push(s.createElement(je,{...h,command:m.getCommand("pasteLinks"),key:"pasteLinks",icon:xe(l.jsx(_w,{}))})),wn({...p,children:g})},[d,r,i,a]);return l.jsx(In,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:u,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:l.jsx(M6,{}),...c})})),qf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...d}=e,c=no(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),u=s.useCallback((p,m)=>{const h={variant:Ht.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=l.jsxs(l.Fragment,{children:[l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadings")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingsNumeric")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingColumns")}),l.jsx(je,{...h,command:m.getCommand("sheetViewToggleShowHeadingRows")})]});return wn({...p,children:g})},[i,o,r]);return l.jsx(In,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:u,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:l.jsx(ma,{command:c[0],scope:"view"}),...d})})),Zf=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...a}=e,d=s.useCallback(c=>{const u={variant:Ht.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=l.jsxs(l.Fragment,{children:[l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowFormulaBar")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowTabs")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowStatusBar")}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),l.jsx(je,{...u,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return wn({...c,children:p})},[i,n,o,r]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:d,icon:l.jsx(ma,{icon:null,label:"Workbook View"}),...a})})),Gf=s.memo(s.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:a,sx:d,borderProps:c,disabled:u,...p}=e,m=s.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=s.useMemo(()=>m.getStyle(),[m,a]),g=s.useMemo(()=>h.getFill().toCSS(a?.darkMode??!1),[h]),f=h.getInsets(),x=h.getFont(),y=s.useCallback(()=>h.getBorder(),[h]);return l.jsx(B.Box,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:a?.fill,filter:u?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...g},"& .text":{flex:"1 1 100%",...x.toCSS(a?.darkMode??!1,1),boxSizing:"border-box",padding:`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:x.toCSS().textDecoration,textAlign:N.ITextFrame.toCSSHorizontalTextAlign(m.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...d},...p,children:l.jsx(Q2,{getBorderAt:y,darkMode:a?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:l.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:l.jsx(B.Box,{className:"text",children:n})})})})})),XT=s.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:a,createTemporaryCell:d,parentFloat:c,commands:u,disabled:p,commandHook:m,...h}=e,g=s.useCallback(y=>{const w={variant:Ht.Menuitem,commandHook:m,context:"cellStyle"},b=l.jsxs(l.Fragment,{children:[l.jsx(je,{...w,sx:{fontWeight:550},command:u.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...w,command:u.getCommand("modifyCellStyle"),commandState:{named:n}}),l.jsx(je,{...w,command:u.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===N.IStyle.BuiltInName.Normal})]}),C=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})});return wn({...y,children:C})},[]),f=n?.getName()===o?.getName();let x=l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:y=>`solid ${f?y.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{a?.(n)},...h,children:l.jsx(Gf,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:d,bodyStyle:i})},n.getName());return r&&(x=l.jsx(g9,{label:n.getName(),parentFloat:c,createPopupPanel:g,children:x})),x}),Kf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:a,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!0,...p}=e;q0(o);const m=o?.context(),h=m?.styles,g=i??m?.named(),f=c??m?.bodyStyle(),x=de(k=>{a?.(k),o?.execute(k,r)},[o,a,r]),y=s.useCallback((k,E)=>{const M={onSelectNamed:x,styles:h(),parentFloat:k.floatReference},T=h().getCustomNamed(),F=new Map,_=[];for(let I=0;I<T.length;I++)F.set(T[I].getName(),T[I]),h().getNamed(T[I].getName()).getBuiltInID()===null&&_.push(T[I].getName());const O=I=>{let L=F.get(I);return L||(L=h().getNamed(I)),!L||L.isHidden()?null:l.jsx(XT,{namedStyle:L,selectedNamed:g,bodyStyle:m.bodyStyle(),createTemporaryCell:m.createTemporaryCell,commands:n,commandHook:r,...M},I)},S=(I,L,H=!0)=>{const W=[];for(let A=0;A<L.length;A++){const U=O(L[A]);U&&W.push(U)}return W.length===0?null:l.jsxs(B.Box,{children:[H?l.jsx(Mt,{orientation:"horizontal"}):null,l.jsx(pa,{children:I},I+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:W},I+"-presets")]},I)},v=(I,L)=>{const H=[];for(let W=0;W<L.length;W++){const A=O(L[W]);A&&H.push(A)}return H.length===0?null:l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:H},I+"-presets")},D=[];D.push(S("Custom",_,!1)),D.push(S("Good, Bad and Neutral",[N.IStyle.BuiltInName.Normal,N.IStyle.BuiltInName.Bad,N.IStyle.BuiltInName.Good,N.IStyle.BuiltInName.Neutral],_.length>0)),D.push(S("Data and Model",[N.IStyle.BuiltInName.Calculation,N.IStyle.BuiltInName.CheckCell,N.IStyle.BuiltInName.ExplanatoryText,N.IStyle.BuiltInName.FollowedHyperlink,N.IStyle.BuiltInName.Hyperlink,N.IStyle.BuiltInName.Input,N.IStyle.BuiltInName.LinkedCell,N.IStyle.BuiltInName.Note,N.IStyle.BuiltInName.Output,N.IStyle.BuiltInName.WarningText])),D.push(S("Titles and Headings",[N.IStyle.BuiltInName.Heading1,N.IStyle.BuiltInName.Heading2,N.IStyle.BuiltInName.Heading3,N.IStyle.BuiltInName.Heading4,N.IStyle.BuiltInName.Title,N.IStyle.BuiltInName.Total]));let j=[];var R,P;return j.push(v("Accent 1",[N.IStyle.BuiltInName.Accent1_20,N.IStyle.BuiltInName.Accent1_40,N.IStyle.BuiltInName.Accent1_60,N.IStyle.BuiltInName.Accent1])),j.push(v("Accent 2",[N.IStyle.BuiltInName.Accent2_20,N.IStyle.BuiltInName.Accent2_40,N.IStyle.BuiltInName.Accent2_60,N.IStyle.BuiltInName.Accent2])),j.push(v("Accent 3",[N.IStyle.BuiltInName.Accent3_20,N.IStyle.BuiltInName.Accent3_40,N.IStyle.BuiltInName.Accent3_60,N.IStyle.BuiltInName.Accent3])),j.push(v("Accent 4",[N.IStyle.BuiltInName.Accent4_20,N.IStyle.BuiltInName.Accent4_40,N.IStyle.BuiltInName.Accent4_60,N.IStyle.BuiltInName.Accent4])),j.push(v("Accent 5",[N.IStyle.BuiltInName.Accent5_20,N.IStyle.BuiltInName.Accent5_40,N.IStyle.BuiltInName.Accent5_60,N.IStyle.BuiltInName.Accent5])),j.push(v("Accent 6",[N.IStyle.BuiltInName.Accent6_20,N.IStyle.BuiltInName.Accent6_40,N.IStyle.BuiltInName.Accent6_60,N.IStyle.BuiltInName.Accent6])),D.push((R="Themed Cell Styles",P=j,l.jsxs(B.Box,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(pa,{children:R},R+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:P},R+"-presets")]},R))),D.push(S("Number Format",[N.IStyle.BuiltInName.Comma,N.IStyle.BuiltInName.Comma0,N.IStyle.BuiltInName.Currency,N.IStyle.BuiltInName.Currency0,N.IStyle.BuiltInName.Percent])),l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[l.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:D}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{variant:Ht.Menuitem,commandState:g,command:E.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:d,icon:xe(l.jsx(Ww,{}))})]})},[g,h?.().getTheme(),f]),w=de(k=>{const E=18/N.IFont.getDeviceScale(),M=m?.createTemporaryCell(k);return M.getStyle().getFont().getSize()<=E?M:M.createTemporaryCell({style:{font:{size:E}}})},[m?.createTemporaryCell]),b=d||!o||o.disabled(),C=s.useMemo(()=>m&&u?l.jsx(Gf,{value:g?.getName()??"Custom",cellStyle:g?{named:g.getName()}:void 0,styles:m.styles(),createTemporaryCell:w,bodyStyle:m.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:k=>`1px solid ${k.palette.action.hover}`},borderProps:{}}):xe(l.jsx(Pl,{})),[g,f,b]);return l.jsx(In,{ref:t,createPopupPanel:y,outlined:u,commands:n,createTooltip:({children:k},E)=>l.jsx(Bo,{label:o?.label(),description:o?.description(),disabled:E,children:k}),selected:!1,disabled:b,label:o?.label(),icon:C,...p})})),Xf="_sheetxl-reset_ods65_1",YT=10,Yf=s.memo(s.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:a,disabled:d,className:c,forceThinBorder:u,cellHeight:p=YT,isLive:m=!1,...h}=e,g=Math.ceil(1.3*p),[f,x]=s.useReducer(k=>k+1,0);s.useEffect(()=>{if(m&&o)return o.addListeners({onAnyChange:()=>{x()}})},[o,m]);const y=s.useMemo(()=>{let k=o?.toJSON()??{};const E={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return k&&(k.styleOptions={...k.styleOptions,name:r.getName()}),k.ref=E,new N.Table({initialAnchor:E,json:k,styles:n})},[f,o,r,n]),w=s.useMemo(()=>{const k=[];for(let E=0;E<5;E++)for(let M=0;M<5;M++){const T=y.getStyleAt({colIndex:M,rowIndex:E});k.push(T)}return k},[y]),b=s.useMemo(()=>{const k=(M,T,F)=>{let _=F.getFill().toCSS(i?.darkMode??!1);const O=g-(T<4?1:0),S=p-(M<4?1:0),v=F.getFont().getFill().toCSS(i?.darkMode??!1);return _={..._,position:"absolute",boxSizing:"border-box",left:T*(g-1),top:M*(p-1),width:O,height:S},l.jsx("td",{className:`table-style-fill ${M}-${T}`,style:_,children:l.jsx("div",{className:`table-style-text ${M}-${T}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(O-6)/2,top:(S-1)/2,borderTop:`1px solid ${v}`}})},`${M}-${T}`)},E=[];for(let M=0;M<5;M++){const T=[];for(let F=0;F<5;F++){const _=w[5*M+F];T.push(k(M,F,_))}E.push(l.jsx("tr",{children:T},M))}return E},[y,r,i]),C=s.useCallback((k,E)=>w[E].getBorder()??null,[w]);return l.jsx(B.Box,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...a},...h,children:l.jsx(Q2,{getBorderAt:C,rowCount:5,columnCount:5,forceThinBorder:u,width:5*(g-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:l.jsx("table",{className:Zn(c,"sheetxl-table-preview",Xf),style:{borderCollapse:"collapse",width:5*(g-1)+1,height:5*(p-1)+1},children:l.jsx("tbody",{children:b})})})})})),Za=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},Jf=s.memo(s.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:a,style:d,className:c,canvas:u,...p}=e,m=s.useMemo(()=>{const f=n.toJSON(),x={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return f.styleOptions={...f.styleOptions,name:o.getName()},f.ref=x,new N.Table({initialAnchor:x,json:f,styles:r})},[n,o,r]),h=s.useMemo(()=>{const f=[];for(let x=0;x<5;x++)for(let y=0;y<5;y++){const w=m.getStyleAt({colIndex:y,rowIndex:x});f.push(w)}return f},[m]),g=s.useMemo(()=>{let f=u;if(u||(f=document.createElement("canvas")),!f)return null;f.width!==61&&(f.width=61),f.height!==46&&(f.height=46);const x=f.getContext("2d",{alpha:!1});if(!x)return null;const y=12,w=i?.darkMode??!1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C].getFill();let E=i?.fill;k.getType()===N.IFill.Type.Solid?E=k.getColor().toCSS(w,!1):k.getType()===N.IFill.Type.Gradient?E=k.getStops[0]?.color.toCSS(w,!1):k.getType()===N.IFill.Type.Pattern&&(E=k.getForeground().toCSS(w,!1)),x.fillStyle=E;const M=C*y,T=9*b;x.fillRect(M,T,13,10)}x.lineWidth=1;for(let b=0;b<5;b++)for(let C=0;C<5;C++){const k=h[5*b+C],E=C*y,M=9*b,T=k.getBorder();if(!T.isEmpty()){const O=T.getLeft();O.isNone()||(x.strokeStyle=O.getColor().toCSS(w,!1),Za(x,E,M,E,M+9));const S=T.getTop();S.isNone()||(x.strokeStyle=S.getColor().toCSS(w,!1),Za(x,E,M,E+y,9*b));const v=T.getRight();v.isNone()||(x.strokeStyle=v.getColor().toCSS(w,!1),Za(x,E+y,M,E+y,M+9));const D=T.getBottom();D.isNone()||(x.strokeStyle=D.getColor().toCSS(w,!1),Za(x,E,M+9,E+y,M+9))}x.strokeStyle=k.getFont().getFill().toCSS(w,!1);const F=4,_=2.5;Za(x,C*y+_,9*b+F,C*y+_+7,9*b+F)}return`url(${f.toDataURL()})`},[u,m,o,i]);return l.jsx("div",{ref:t,className:Zn("table-style-preview",c),style:{backgroundImage:g,width:61,height:46,...d},...p})})),JT=s.memo(s.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:a,onShowTotalRowChange:d,showFilterButton:c,onShowFilterButtonChange:u,sx:p,disabled:m,...h}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:g=>`${g.spacing(2)}`,marginRight:g=>`${g.spacing(2)}`},"& .MuiCheckbox-root":{padding:g=>`${g.spacing(.5)}`},...p},...h,ref:t,children:[i&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:m||r==null}),label:"Header Row",labelPlacement:"end"}),d&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:a??!1,indeterminate:a==null,onChange:()=>d(!a),disabled:m||a==null}),label:"Total Row",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:m||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),u&&l.jsx(B.FormControlLabel,{control:l.jsx(B.Checkbox,{checked:c??!1,indeterminate:c==null,disabled:m||!n||c==null,onChange:()=>u(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),QT=s.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:a=!0,bodyStyle:d,parentFloat:c,commands:u,disabled:p,commandHook:m,useCanvasPreview:h=!0,canvas:g,...f}=e,x=s.useCallback(C=>{const k={variant:Ht.Menuitem,commandHook:m,context:"table"},E=l.jsxs(l.Fragment,{children:[l.jsx(je,{...k,command:u.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(je,{...k,sx:{fontWeight:550},command:u.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:xe(l.jsx(Pl,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:u.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...k,command:u.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]}),M=l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})});return wn({...C,children:M})},[u]),y=n?.getName()===o,w=s.useMemo(()=>{const C={table:t,tableStyle:n,styles:i,bodyStyle:d};return h?l.jsx(Jf,{canvas:g,...C}):l.jsx(Yf,{...C})},[t,n,i,d]);let b=l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${y?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...f,children:w},n.getName());return a&&(b=l.jsx(g9,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:x,children:b})),b}),Qf=s.memo(s.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:a,disabled:d=!1,bodyStyle:c,usePreviewIcon:u=!1,...p}=e;q0(o);const m=o?.context(),h=m?.styles,g=i??m?.table?.();let f="insertTable";g&&(f="editTable");const x=s.useMemo(()=>((_,O)=>{const S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new N.Table({initialAnchor:S,styles:O,json:{name:"PreviewTable",ref:S,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:_}})})(g?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),g?.getStyleOptions()]),y=g??x,[w,b]=s.useState(y);s.useEffect(()=>{b(y)},[y]);const C=c??m?.bodyStyle(),k=de(_=>{a?.(_),o?.execute({name:_},r)},[o,a,r]),E=s.useRef(null),M=s.useCallback((_,O)=>{const S={onSelectTableStyleName:k,styles:h(),parentFloat:_.floatReference};E.current||(E.current=document.createElement("canvas"));const v=A=>{const U=h().getTableStyle(A);return U?l.jsx(QT,{table:w,tableStyle:U,selectedTableStyleName:w.getStyleOptions().name,bodyStyle:m.bodyStyle(),commands:O,commandHook:r,canvas:E.current,...S},A):null},D=(A,U,X=!0)=>{const ee=[];for(let V=0;V<U.length;V++){const $=v(U[V]);$&&ee.push($)}return ee.length===0?null:l.jsxs(B.Box,{children:[X?l.jsx(Mt,{orientation:"horizontal"}):null,l.jsx(pa,{children:A},A+"-header"),l.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},A+"-presets")]},A)},j=[],R=h().getCustomTableStyles(),P=[];if(R.length>0){for(let A=0;A<R.length;A++)R[A].isShownInTableStyles()&&P.push(R[A].getName());j.push(D("Custom",P,!1))}const I=[];g&&!g.getStyleOptions().name&&I.push(null);for(let A=0;A<21;A++)I.push("TableStyleLight"+(A+1));j.push(D("Light",I,P.length>0));const L=[];for(let A=0;A<28;A++)L.push("TableStyleMedium"+(A+1));j.push(D("Medium",L));const H=[];for(let A=0;A<11;A++)H.push("TableStyleDark"+(A+1));j.push(D("Dark",H));let W=null;return g&&(W=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{variant:Ht.Menuitem,command:O.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:d,icon:xe(l.jsx(vh,{}))})]})),l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[l.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:j}),W]})},[h,h?.().getTheme(),C,w]),T=d||!o||o.disabled(),F=s.useMemo(()=>{if(!m||!u)return xe(l.jsx(Pl,{}))},[w,C,T]);return l.jsx(In,{ref:t,quickCommand:f,createPopupPanel:M,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:_},O)=>l.jsx(Bo,{label:o?.label(),description:o?.description(),disabled:O,children:_}),disabled:T,icon:F,...p})})),_r=[];_r.push($r("Primary Background","bg1")),_r.push($r("Primary Text","tx1")),_r.push($r("Secondary Background","bg2")),_r.push($r("Secondary Text","tx2")),_r.push($r("Accent 1","accent1")),_r.push($r("Accent 2","accent2")),_r.push($r("Accent 3","accent3")),_r.push($r("Accent 4","accent4")),_r.push($r("Accent 5","accent5")),_r.push($r("Accent 6","accent6"));const eg=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...d}=e,c=Pr(),u=s.useMemo(()=>{let p=[];for(let m=0;m<_r.length;m++){const h=_r[m];p.push(l.jsx(Dc,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},m+"-colorDef"))}return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:l.jsx(B.Box,{sx:{display:"flex",boxShadow:m=>m.shadows[2]},children:p})})},[t,c]);return l.jsx(gr,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...d,children:l.jsxs(B.Box,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[l.jsx(B.Box,{sx:{},children:t.getName()}),l.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[u,l.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:l.jsx(br,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:l.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
|
|
83
83
|
The heading font is '${t.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:l.jsx("div",{children:t.getFontScheme().getMinorFont()})})})]})]})})},tg=s.memo(s.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,sx:i,disabled:a=!1,darkMode:d,...c}=e,u=s.useMemo(()=>{const p=n?.search({selected:o})??[],m=[];if(p.length===0)return l.jsx(pa,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});for(let h=0;h<p.length;h++){const g=p[h],f=o&&g?.getName()===o.getName(),x=p[h+1];x&&x.isCustom()!==g.isCustom()&&m.push(l.jsx(Mt,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${h}`)),m.push(l.jsx(eg,{docTheme:g,onSelectTheme:()=>r(g),isSelected:f,disabled:a,darkMode:d,onMouseDown:y=>{y.button===0&&y.preventDefault()},onMouseUp:y=>{y.button===0&&r(g)},onKeyDown:y=>{y.keyCode!==Wt.Enter&&y.keyCode!==Wt.Space||r(g)}},g.getName()))}return m},[o,r,d]);return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:t,...c,children:l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[l.jsx(pa,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),l.jsx(Mt,{}),l.jsx(B.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:u})]})})})),ng=s.memo(s.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,icon:i,tooltip:a,label:d,variant:c=Lr.Toolbar,darkMode:u,panelProps:p,...m}=e,h=i||xe(l.jsx(Xh,{})),g=s.useCallback(x=>{const{closeFloatAll:y}=x;return l.jsx(tg,{...p,themes:n,selectedTheme:o,onSelectTheme:r,darkMode:u,onKeyDown:w=>{w.which===Wt.Enter&&y()}})},[n,o,r,p,u]),f={createPopupPanel:g,tooltip:a||d||"Theme",label:d,icon:h,...m};return c===Lr.Toolbar?l.jsx(Gr,{ref:t,...f}):l.jsx(Jl,{ref:t,...f})})),og=s.memo(s.forwardRef((e,t)=>{const{command:n,commandHook:o,selectedTheme:r,onSelectTheme:i,disabled:a=!1,darkMode:d,label:c,icon:u,variant:p,...m}=e;q0(n);const h=n?.context()?.themes,g=r||n?.context()?.theme,f=d??n?.context()?.darkMode,x=a||n?.disabled(),y=de(b=>{i?.(b),n?.execute(b,o)},[i,o]),w=s.useCallback((b,C)=>{const{children:k,title:E,...M}=b;let T=b.children;return(x||C)&&(T=l.jsx("div",{children:T})),l.jsx(ba,{command:n,placement:p===Ht.Toolbar?"bottom-start":"right-start",disabled:x||C,...M,children:T})},[n,x]);return l.jsx(ng,{ref:t,themes:h,selectedTheme:g,onSelectTheme:y,variant:p===Ht.Menuitem?Lr.Menuitem:Lr.Toolbar,createTooltip:w,disabled:x,darkMode:f,icon:xe(l.jsx(Xh,{})),...m})})),rg=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["themeMode"])[0],c=d?.state(),u=d?.state()!==null,p=B.useMediaQuery("(prefers-color-scheme: dark)"),m=c==="dark"||c===null&&p,h=de((g,f)=>{const x={variant:Ht.Menuitem,commandHook:o,scope:"appearance",disabled:i},y=l.jsxs(l.Fragment,{children:[l.jsx(je,{...x,command:d,icon:xe(m?l.jsx(gn.DarkMode,{}):l.jsx(gn.LightMode,{}))}),l.jsx(je,{...x,command:f.getCommand("defaultThemeMode"),icon:xe(p?l.jsx(Jw,{}):l.jsx(Qw,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...x,command:f.getCommand("enableDarkGrid")}),l.jsx(je,{...x,command:f.getCommand("enableDarkImages")})]});return wn({...g,children:y})},[i,d,o,r,p,c,u]);return l.jsx(In,{ref:t,quickCommand:"themeMode",commands:n,commandHook:o,createPopupPanel:h,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{d?.execute(m?"light":"dark",o)},selected:u,icon:xe(m?l.jsx(gn.DarkMode,{}):l.jsx(gn.LightMode,{})),...a})})),ig=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,sx:a,...d}=e,c=s.useCallback((u,p)=>{const m={variant:Ht.Menuitem,scope:"help",commandHook:{...o,beforeExecute:(g,f)=>o?.beforeExecute?.(g,f)!==!1&&u.floatReference.closeAll()},disabled:i},h=l.jsxs(l.Fragment,{children:[l.jsx(je,{...m,command:p.getCommand("showKeyboardShortcuts"),icon:xe(l.jsx(gn.Keyboard,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...m,command:p.getCommand("gotoUrlGithub"),icon:xe(l.jsx(ov,{}))}),l.jsx(je,{...m,command:p.getCommand("gotoUrlDiscord"),icon:xe(l.jsx(nv,{}))}),l.jsx(je,{...m,command:p.getCommand("gotoUrlDocumentation"),icon:xe(l.jsx(Jh,{}))}),l.jsx(je,{...m,command:p.getCommand("gotoUrlIssue"),icon:xe(l.jsx(tv,{}))})]});return wn({...u,children:h})},[i,o]);return l.jsx(In,{ref:t,sx:a,commands:n,disabled:i,commandHook:o,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:c,icon:xe(l.jsx(ev,{sx:{transform:"scale(0.75)"}})),...d})})),f5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,preferSingleMenu:a=!0,showQuickButton:d=!0,variant:c=Ht.Toolbar,...u}=e,p=no(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:m,allDisabled:h}=s.useMemo(()=>{let f=null,x=0;for(let y=0;y<p.length;y++)p[y]&&!p[y]?.disabled()&&(a&&c===Ht.Menuitem&&(f=x===0?p[y]:null),x++);return{singleMenuCommand:f,allDisabled:x===0}},[p]),g=s.useCallback((f,x)=>{const y={variant:Ht.Menuitem,commandHook:o,scope:"insertImage",disabled:i},w=l.jsxs(l.Fragment,{children:[l.jsx(je,{...y,command:x.getCommand("insertImageFromFile"),icon:xe(l.jsx(js,{}))}),l.jsx(je,{...y,command:x.getCommand("insertImageFromURL"),icon:xe(l.jsx(js,{}))})]});return wn({...f,children:w})},[i,o,r]);return m?l.jsx(je,{ref:t,variant:c,commandHook:o,disabled:i,command:m,icon:xe(l.jsx(js,{})),...u}):l.jsx(In,{ref:t,variant:c,quickCommand:"insertImageFromFile",commands:n,commandHook:o,scope:r,disabled:i||h,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:g,icon:xe(l.jsx(js,{})),...u})})),Lc=s.memo(s.forwardRef((e,t)=>{const{command:n,...o}=e,r=qr(),[i,a]=s.useState(!1),[d,c]=s.useState("info");return s.useEffect(()=>{const u=r.getMode();a(u?.key==="copy"||u?.key==="cut"),c(u?.key==="cut"?"warning":"info")},[r]),l.jsx(je,{ref:t,command:n,icon:xe(l.jsx(vw,{isWalking:i,themedType:d})),...o})})),ej=s.memo(s.forwardRef((e,t)=>{const{...n}=e;return l.jsx(i0,{ref:t,...n,popupCommandKeys:["quickFormulaSum","quickFormulaAverage","quickFormulaCount","quickFormulaMax","quickFormulaMin",null,"insertFunction"],quickCommand:"quickFormulaSum",popupScope:"quickFormula",label:"Quick Formulas",tooltip:"More quick functions.",icon:o=>{switch(o?.key()){case"quickFormulaSum":return xe(l.jsx(Iv,{}));case"insertFunction":return xe(l.jsx(Rv,{}));default:return null}}})})),ag=s.createContext(null);ag.displayName="HookFormContext";const lg=()=>s.useContext(ag),sg=s.memo(s.forwardRef((e,t)=>{const{disabled:n,style:o,className:r,sx:i,defaultInput:a,value:d,formName:c,formOptions:u,onChangeInput:p,onValidate:m,onKeyDown:h,...g}=e,f=lg(),x=c&&f?f.register(c,u):null,[y,w]=s.useState(""),[b,C]=s.useState(""),[k,E]=s.useState(d);s.useEffect(()=>{E(d),C("")},[d]);const M=de(S=>{let v="";try{E(S),m?.(S),p?.(S)}catch(D){v=D.message??"Invalid Name"}c&&f&&(v?f.setError(c,{message:v}):f.clearErrors(c)),C(v)},[d,m,p]),T=de(async S=>{S.keyCode===Wt.Escape&&y!==d&&(M(y),f?.setValue(c,y),f?.clearErrors(c),S.stopPropagation()),h?.(S)},[h,y,d,f]),F=de(S=>{w(S.target.value??"")},[]),_=de(S=>{w(""),x?.onBlur(S)},[]),O=s.useCallback(S=>{M(S.target.value),x?.onChange(S)},[x]);return l.jsx(B.FormControl,{sx:{paddingTop:S=>S.spacing(1.5),minWidth:135,width:"100%",...i},size:"small",ref:t,className:Zn("named-input",r),...g,children:l.jsx(B.TextField,{label:"Name",placeholder:a,onFocus:F,onBlur:_,inputRef:x?.ref,disabled:n,error:!!b,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:S=>S.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:c,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:S=>S.spacing(1.25),paddingBottom:S=>S.spacing(.75),backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`}}},value:k??"",onChange:O,onKeyDownCapture:T,onContextMenu:S=>{S.stopPropagation()}})})}));sg.displayName="NamedInput";const Us=e=>e===null?"":e.toString(),cg=s.memo(s.forwardRef((e,t)=>{const{formName:n,formOptions:o,disabled:r,style:i,className:a,sx:d,onKeyDown:c,value:u,onChangeInput:p,resolvedAddress:m,...h}=e,g=lg(),f=n&&g?g.register(n,o):null,[x,y]=s.useState(""),[w,b]=s.useState(!1),[C,k]=s.useState(()=>Us(u));s.useEffect(()=>{k(Us(u)),y(""),n&&g&&g.clearErrors(n),b(!1)},[u]);const E=de(v=>{let D="";try{k(v);const j=Us(u),R=m(v);R.toString()!==j&&p?.(R)}catch{D="Invalid Range"}n&&g&&(D?g.setError(n,{message:D}):g.clearErrors(n)),y(D),b(!0)},[C,p,n,g]),M=de(async v=>{if(w&&v.keyCode===Wt.Escape){const D=Us(u);k(D),y(""),b(!1),v.stopPropagation()}c?.(v)},[u,p,c,w]),T=de(v=>{f?.onBlur(v)},[f]),F=s.useCallback(v=>{E(v.target.value),f?.onChange(v)},[f]),[_,O]=s.useState(!1),S=s.useMemo(()=>l.jsx(B.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:l.jsx(x9,{disabled:!0,selected:_,onSelectToggle:v=>{O(v)},label:"Select Range",icon:xe(l.jsx(_v,{}))})}),[_]);return l.jsx(B.FormControl,{sx:{paddingTop:v=>v.spacing(1.5),minWidth:135,width:"100%",...d},size:"small",ref:t,className:Zn("range-input",a),...h,children:l.jsx(B.TextField,{label:"Range",placeholder:"Enter Range",onBlur:T,disabled:r,error:!!x,inputRef:f?.ref,helperText:x||" ",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(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},endAdornment:S},value:C??"",onChange:F,onKeyDownCapture:M,onContextMenu:v=>{v.stopPropagation()}})})}));cg.displayName="RangeInput";const g5=s.memo(s.forwardRef((e,t)=>{const{sheet:n,className:o,debounceDelay:r=220,sx:i,...a}=e,[d,c]=s.useState(()=>n.getView().getZoomScale()),[u,p]=s.useState(null),m=s.useRef(0);Gt(n,{onViewChange:()=>{p(!0),m.current===0&&c(n.getView().getZoomScale())}}),s.useEffect(()=>{m.current=0,p(!1),c(n.getView().getZoomScale())},[n]),s.useEffect(()=>{m.current!==0&&N.CommonUtils.debounce(()=>{d===m.current&&(m.current=0,n.getView().update({zoomScale:d}))},r)()},[d,r]);const h=de(T=>{let F=T;T<100?F=Math.round(T/(10/9)+10):T>100&&(F=Math.round(3*T-200)),m.current=F,p(!0),c(F)},[n]),g=T=>{let F=T;return T<100?F=10/9*(T-10):T>100&&(F=(T+200)/3),F},f=g(d),[x,y]=s.useState(null),w=s.useRef(null),b=s.useCallback(()=>{const T=x;T&&requestAnimationFrame(()=>{w.current?.contains(document.activeElement)&&T.focus()})},[]),C=C3(()=>{h(g(N.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10)))}),k=C3(()=>h(g(N.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),E=Pr(),M=s.useMemo(()=>`${N.IFont.getSharedMeasurer()("100%",Math.round(E.typography.fontSize),E.typography.fontFamily).width}px`,[E]);return l.jsxs(B.Box,{ref:t,className:Zn(o),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:T=>T.palette.text.secondary,...i},onFocus:T=>{T.relatedTarget&&!x&&y(T.relatedTarget)},onBlur:T=>{x&&!w?.current?.contains(T.relatedTarget)&&y(null)},onMouseDown:T=>{T.button===0&&T.preventDefault()},onMouseUp:T=>{T.button===0&&b()},...a,children:[l.jsx(br,{disableInteractive:!0,title:"Zoom Out",children:l.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:T=>T.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:T=>{T.button!==0?T.preventDefault():C(T)},children:l.jsx(gn.Remove,{})})}),l.jsx(B.Slider,{ref:w,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:T=>`0px 0px 0px 3px ${Lu(T.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:T=>`0px 0px 0px 2px ${Lu(T.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:u?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:f,max:200,marks:[{value:100}],onAnimationEnd:()=>p(!1),onWheel:T=>{h(g(N.CommonUtils.findNextStep(n.getView().getZoomScale(),T.deltaY<0,10)))},onKeyDown:T=>{T.which===Wt.Down||T.which===Wt.Right?(h(g(N.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),T.preventDefault()):T.which===Wt.Up||T.which===Wt.Left?(h(g(N.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),T.preventDefault()):T.which!==Wt.Enter&&T.which!==Wt.Escape||b()},onChange:(T,F)=>{Math.abs(F-100)<3?h(100):h(F)},valueLabelFormat:(T,F)=>`Zoom: ${Math.round(d)}%`}),l.jsx(br,{disableInteractive:!0,title:"Zoom In",children:l.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:T=>T.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:T=>{T.button!==0?T.preventDefault():k(T)},children:l.jsx(gn.Add,{})})}),l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row"},children:[l.jsx(B.Box,{sx:{minWidth:"8px"}}),l.jsx(B.Typography,{noWrap:!0,component:"div",onClick:()=>{h(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:M},children:l.jsx("div",{children:Math.round(d)+"%"})})]})]})}));g5.displayName="SheetZoomScale";const x5=s.memo(s.forwardRef((e,t)=>{const{sx:n,sheet:o,gridStyle:r,children:i,childrenEnd:a,...d}=e;s.useImperativeHandle(t,()=>({}));const c=s.useRef(null);s.useEffect(()=>{const g=f=>f.preventDefault();return c.current?.addEventListener("wheel",g,{passive:!1}),()=>{c.current?.removeEventListener("wheel",g)}},[]);const u=qr(),p=s.useMemo(()=>{const g=u.getMode();return g?.description?g.description:"Ready"},[u]),[m,h]=s.useState(!1);return l.jsxs(B.Box,{ref:c,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:m?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...n},onMouseOver:()=>h(!0),onMouseLeave:()=>h(!1),...d,children:[i,l.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:g=>g.palette.text.secondary},variant:"caption",children:p})}),a?l.jsx(B.Box,{sx:{display:"flex",alignItems:"center"},children:a}):null,l.jsx(Mt,{style:{marginTop:"6px",marginBottom:"6px"}}),l.jsx(g5,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:o})]})}));x5.displayName="StatusBar";var F8,qs={exports:{}},Ga={},Ka={exports:{}},z8={},Zs={exports:{}},B8,yo={},M0={};function Oc(){return B8||(B8=1,Object.defineProperty(M0,"__esModule",{value:!0}),M0.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},M0.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},M0.int=function(e){return parseInt(e,10)},M0.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},M0.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),M0}var N8,V8,R0={};function y5(){if(V8)return yo;V8=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.addClassName=a,yo.addEvent=function(c,u,p,m){if(!c)return;const h={capture:!0,...m};c.addEventListener?c.addEventListener(u,p,h):c.attachEvent?c.attachEvent("on"+u,p):c["on"+u]=p},yo.addUserSelectStyles=function(c){if(!c)return;let u=c.getElementById("react-draggable-style-el");u||(u=c.createElement("style"),u.type="text/css",u.id="react-draggable-style-el",u.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
84
84
|
`,u.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
85
85
|
`,c.getElementsByTagName("head")[0].appendChild(u)),c.body&&a(c.body,"react-draggable-transparent-selection")},yo.createCSSTransform=function(c,u){const p=r(c,u,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},yo.createSVGTransform=function(c,u){return r(c,u,"")},yo.getTouch=function(c,u){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>u===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>u===p.identifier)},yo.getTouchIdentifier=function(c){if(c.targetTouches&&c.targetTouches[0])return c.targetTouches[0].identifier;if(c.changedTouches&&c.changedTouches[0])return c.changedTouches[0].identifier},yo.getTranslation=r,yo.innerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingTop),u-=(0,e.int)(p.paddingBottom),u},yo.innerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u-=(0,e.int)(p.paddingLeft),u-=(0,e.int)(p.paddingRight),u},yo.matchesSelector=o,yo.matchesSelectorAndParentsTo=function(c,u,p){let m=c;do{if(o(m,u))return!0;if(m===p)return!1;m=m.parentNode}while(m);return!1},yo.offsetXYFromParent=function(c,u,p){const m=u===u.ownerDocument.body?{left:0,top:0}:u.getBoundingClientRect(),h=(c.clientX+u.scrollLeft-m.left)/p,g=(c.clientY+u.scrollTop-m.top)/p;return{x:h,y:g}},yo.outerHeight=function(c){let u=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderTopWidth),u+=(0,e.int)(p.borderBottomWidth),u},yo.outerWidth=function(c){let u=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return u+=(0,e.int)(p.borderLeftWidth),u+=(0,e.int)(p.borderRightWidth),u},yo.removeClassName=d,yo.removeEvent=function(c,u,p,m){if(!c)return;const h={capture:!0,...m};c.removeEventListener?c.removeEventListener(u,p,h):c.detachEvent?c.detachEvent("on"+u,p):c["on"+u]=null},yo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=Oc(),t=function(c,u){if(typeof WeakMap=="function")var p=new WeakMap,m=new WeakMap;return function(h,g){if(!g&&h&&h.__esModule)return h;var f,x,y={__proto__:null,default:h};if(h===null||typeof h!="object"&&typeof h!="function")return y;if(f=g?m:p){if(f.has(h))return f.get(h);f.set(h,y)}for(const w in h)w!=="default"&&{}.hasOwnProperty.call(h,w)&&((x=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(h,w))&&(x.get||x.set)?f(y,w,x):y[w]=h[w]);return y}(c,u)}(function(){if(N8)return R0;N8=1,Object.defineProperty(R0,"__esModule",{value:!0}),R0.browserPrefixToKey=p,R0.browserPrefixToStyle=function(m,h){return h?`-${h.toLowerCase()}-${m}`:m},R0.default=void 0,R0.getPrefix=u;const c=["Moz","Webkit","O","ms"];function u(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||m in h)return"";for(let g=0;g<c.length;g++)if(p(m,c[g])in h)return c[g];return""}function p(m,h){return h?`${h}${function(g){let f="",x=!0;for(let y=0;y<g.length;y++)x?(f+=g[y].toUpperCase(),x=!1):g[y]==="-"?x=!0:f+=g[y];return f}(m)}`:m}return R0.default=u(),R0}());let n="";function o(c,u){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](u)}function r(c,u,p){let{x:m,y:h}=c,g=`translate(${m}${p},${h}${p})`;return u&&(g=`translate(${`${typeof u.x=="string"?u.x:u.x+p}`}, ${`${typeof u.y=="string"?u.y:u.y+p}`})`+g),g}function i(c){if(c)try{if(c.body&&d(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const u=(c.defaultView||window).getSelection();u&&u.type!=="Caret"&&u.removeAllRanges()}}catch{}}function a(c,u){c.classList?c.classList.add(u):c.className.match(new RegExp(`(?:^|\\s)${u}(?!\\S)`))||(c.className+=` ${u}`)}function d(c,u){c.classList?c.classList.remove(u):c.className=c.className.replace(new RegExp(`(?:^|\\s)${u}(?!\\S)`,"g"),"")}return yo}var H8,e0={};function dg(){if(H8)return e0;H8=1,Object.defineProperty(e0,"__esModule",{value:!0}),e0.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},e0.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},e0.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),d=n(o);return a?{node:d,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:d,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},e0.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},e0.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;a=typeof a=="string"?a:function(c){return{left:c.left,top:c.top,right:c.right,bottom:c.bottom}}(a);const d=n(o);if(typeof a=="string"){const{ownerDocument:c}=d,u=c.defaultView;let p;if(a==="parent"?p=d.parentNode:p=d.getRootNode().querySelector(a),!(p instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const m=p,h=u.getComputedStyle(d),g=u.getComputedStyle(m);a={left:-d.offsetLeft+(0,e.int)(g.paddingLeft)+(0,e.int)(h.marginLeft),top:-d.offsetTop+(0,e.int)(g.paddingTop)+(0,e.int)(h.marginTop),right:(0,t.innerWidth)(m)-(0,t.outerWidth)(d)-d.offsetLeft+(0,e.int)(g.paddingRight)-(0,e.int)(h.marginRight),bottom:(0,t.innerHeight)(m)-(0,t.outerHeight)(d)-d.offsetTop+(0,e.int)(g.paddingBottom)-(0,e.int)(h.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},e0.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const d=n(i),c=i.props.offsetParent||d.offsetParent||d.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},e0.snapToGrid=function(o,r,i){const a=Math.round(r/o[0])*o[0],d=Math.round(i/o[1])*o[1];return[a,d]};var e=Oc(),t=y5();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return e0}var $8,W8,U8,q8,Xa={},Gs={};function ug(){return $8||($8=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.default=function(){}),Gs}function tj(){if(W8)return Xa;W8=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=void 0;var e=function(g,f){if(typeof WeakMap=="function")var x=new WeakMap,y=new WeakMap;return function(w,b){if(!b&&w&&w.__esModule)return w;var C,k,E={__proto__:null,default:w};if(w===null||typeof w!="object"&&typeof w!="function")return E;if(C=b?y:x){if(C.has(w))return C.get(w);C.set(w,E)}for(const M in w)M!=="default"&&{}.hasOwnProperty.call(w,M)&&((k=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(w,M))&&(k.get||k.set)?C(E,M,k):E[M]=w[M]);return E}(g,f)}(s),t=d(ts()),n=d(uo),o=y5(),r=dg(),i=Oc(),a=d(ug());function d(g){return g&&g.__esModule?g:{default:g}}function c(g,f,x){return(f=function(y){var w=function(b,C){if(typeof b!="object"||!b)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof w=="symbol"?w:w+""}(f))in g?Object.defineProperty(g,f,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[f]=x,g}const u={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let m=p,h=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",g=>{if(this.props.onMouseDown(g),!this.props.allowAnyClick&&typeof g.button=="number"&&g.button!==0)return!1;const f=this.findDOMNode();if(!f||!f.ownerDocument||!f.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:x}=f;if(this.props.disabled||!(g.target instanceof x.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(g.target,this.props.handle,f)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(g.target,this.props.cancel,f))return;g.type!=="touchstart"||this.props.allowMobileScroll||g.preventDefault();const y=(0,o.getTouchIdentifier)(g);this.touchIdentifier=y;const w=(0,r.getControlPosition)(g,y,this);if(w==null)return;const{x:b,y:C}=w,k=(0,r.createCoreData)(this,b,C);(0,a.default)("DraggableCore: handleDragStart: %j",k),(0,a.default)("calling",this.props.onStart),this.props.onStart(g,k)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(x),this.dragging=!0,this.lastX=b,this.lastY=C,(0,o.addEvent)(x,m.move,this.handleDrag),(0,o.addEvent)(x,m.stop,this.handleDragStop))}),c(this,"handleDrag",g=>{const f=(0,r.getControlPosition)(g,this.touchIdentifier,this);if(f==null)return;let{x,y}=f;if(Array.isArray(this.props.grid)){let b=x-this.lastX,C=y-this.lastY;if([b,C]=(0,r.snapToGrid)(this.props.grid,b,C),!b&&!C)return;x=this.lastX+b,y=this.lastY+C}const w=(0,r.createCoreData)(this,x,y);if((0,a.default)("DraggableCore: handleDrag: %j",w),this.props.onDrag(g,w)!==!1&&this.mounted!==!1)this.lastX=x,this.lastY=y;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}}),c(this,"handleDragStop",g=>{if(!this.dragging)return;const f=(0,r.getControlPosition)(g,this.touchIdentifier,this);if(f==null)return;let{x,y}=f;if(Array.isArray(this.props.grid)){let C=x-this.lastX||0,k=y-this.lastY||0;[C,k]=(0,r.snapToGrid)(this.props.grid,C,k),x=this.lastX+C,y=this.lastY+k}const w=(0,r.createCoreData)(this,x,y);if(this.props.onStop(g,w)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(b.ownerDocument),(0,a.default)("DraggableCore: handleDragStop: %j",w),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,a.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(b.ownerDocument,m.move,this.handleDrag),(0,o.removeEvent)(b.ownerDocument,m.stop,this.handleDragStop))}),c(this,"onMouseDown",g=>(m=p,this.handleDragStart(g))),c(this,"onMouseUp",g=>(m=p,this.handleDragStop(g))),c(this,"onTouchStart",g=>(m=u,this.handleDragStart(g))),c(this,"onTouchEnd",g=>(m=u,this.handleDragStop(g)))}componentDidMount(){this.mounted=!0;const g=this.findDOMNode();g&&(0,o.addEvent)(g,u.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const g=this.findDOMNode();if(g){const{ownerDocument:f}=g;(0,o.removeEvent)(f,p.move,this.handleDrag),(0,o.removeEvent)(f,u.move,this.handleDrag),(0,o.removeEvent)(f,p.stop,this.handleDragStop),(0,o.removeEvent)(f,u.stop,this.handleDragStop),(0,o.removeEvent)(g,u.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(f)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Xa.default=h,c(h,"displayName","DraggableCore"),c(h,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(g,f){if(g[f]&&g[f].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),c(h,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Xa}function nj(){return U8||(U8=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(f,x){if(typeof WeakMap=="function")var y=new WeakMap,w=new WeakMap;return function(b,C){if(!C&&b&&b.__esModule)return b;var k,E,M={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return M;if(k=C?w:y){if(k.has(b))return k.get(b);k.set(b,M)}for(const T in b)T!=="default"&&{}.hasOwnProperty.call(b,T)&&((E=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,T))&&(E.get||E.set)?k(M,T,E):M[T]=b[T]);return M}(f,x)}(s),n=p(ts()),o=p(uo),r=function(){if(F8)return Zs.exports;function f(y){var w,b,C="";if(typeof y=="string"||typeof y=="number")C+=y;else if(typeof y=="object")if(Array.isArray(y)){var k=y.length;for(w=0;w<k;w++)y[w]&&(b=f(y[w]))&&(C&&(C+=" "),C+=b)}else for(b in y)y[b]&&(C&&(C+=" "),C+=b);return C}function x(){for(var y,w,b=0,C="",k=arguments.length;b<k;b++)(y=arguments[b])&&(w=f(y))&&(C&&(C+=" "),C+=w);return C}return F8=1,Zs.exports=x,Zs.exports.clsx=x,Zs.exports}(),i=y5(),a=dg(),d=Oc(),c=p(tj()),u=p(ug());function p(f){return f&&f.__esModule?f:{default:f}}function m(){return m=Object.assign?Object.assign.bind():function(f){for(var x=1;x<arguments.length;x++){var y=arguments[x];for(var w in y)({}).hasOwnProperty.call(y,w)&&(f[w]=y[w])}return f},m.apply(null,arguments)}function h(f,x,y){return(x=function(w){var b=function(C,k){if(typeof C!="object"||!C)return C;var E=C[Symbol.toPrimitive];if(E!==void 0){var M=E.call(C,k);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(C)}(w,"string");return typeof b=="symbol"?b:b+""}(x))in f?Object.defineProperty(f,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[x]=y,f}class g extends t.Component{static getDerivedStateFromProps(x,y){let{position:w}=x,{prevPropsPosition:b}=y;return!w||b&&w.x===b.x&&w.y===b.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:b}),{x:w.x,y:w.y,prevPropsPosition:{...w}})}constructor(x){super(x),h(this,"onDragStart",(y,w)=>{if((0,u.default)("Draggable: onDragStart: %j",w),this.props.onStart(y,(0,a.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(y,w)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",w);const b=(0,a.createDraggableData)(this,w),C={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[M,T]=(0,a.getBoundPosition)(this,C.x,C.y);C.x=M,C.y=T,C.slackX=this.state.slackX+(k-C.x),C.slackY=this.state.slackY+(E-C.y),b.x=C.x,b.y=C.y,b.deltaX=C.x-this.state.x,b.deltaY=C.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(C)}),h(this,"onDragStop",(y,w)=>{if(!this.state.dragging||this.props.onStop(y,(0,a.createDraggableData)(this,w))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",w);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:k}=this.props.position;b.x=C,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},!x.position||x.onDrag||x.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:x,bounds:y,children:w,defaultPosition:b,defaultClassName:C,defaultClassNameDragging:k,defaultClassNameDragged:E,position:M,positionOffset:T,scale:F,..._}=this.props;let O={},S=null;const v=!M||this.state.dragging,D=M||b,j={x:(0,a.canDragX)(this)&&v?this.state.x:D.x,y:(0,a.canDragY)(this)&&v?this.state.y:D.y};this.state.isElementSVG?S=(0,i.createSVGTransform)(j,T):O=(0,i.createCSSTransform)(j,T);const R=(0,r.clsx)(w.props.className||"",C,{[k]:this.state.dragging,[E]:this.state.dragged});return t.createElement(c.default,m({},_,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:R,style:{...w.props.style,...O},transform:S}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),h(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(z8)),z8}function pg(){if(q8)return Ka.exports;q8=1;const{default:e,DraggableCore:t}=nj();return Ka.exports=e,Ka.exports.default=e,Ka.exports.DraggableCore=t,Ka.exports}var Z8,Ks={};function oj(){if(Z8)return Ks;Z8=1,Ks.__esModule=!0,Ks.cloneElement=function(i,a){return a.style&&i.props.style&&(a.style=o(o({},i.props.style),a.style)),a.className&&i.props.className&&(a.className=i.props.className+" "+a.className),t.default.cloneElement(i,a)};var e,t=(e=s)&&e.__esModule?e:{default:e};function n(i,a){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);a&&(c=c.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),d.push.apply(d,c)}return d}function o(i){for(var a=1;a<arguments.length;a++){var d=arguments[a]!=null?arguments[a]:{};a%2?n(Object(d),!0).forEach(function(c){r(i,c,d[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(d,c))})}return i}function r(i,a,d){return(a=function(c){var u=function(p,m){if(typeof p!="object"||p===null)return p;var h=p[Symbol.toPrimitive];if(h!==void 0){var g=h.call(p,m);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(p)}(c,"string");return typeof u=="symbol"?u:String(u)}(a))in i?Object.defineProperty(i,a,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[a]=d,i}return Ks}var G8,K8,Ya={};function hg(){if(G8)return Ya;G8=1,Ya.__esModule=!0,Ya.resizableProps=void 0;var e,t=(e=ts())&&e.__esModule?e:{default:e};pg();var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,d=r[0];return d.axis==="both"||d.axis==="y"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,d=r[0];return d.axis==="both"||d.axis==="x"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)}};return Ya.resizableProps=n,Ya}function mg(){if(K8)return Ga;K8=1,Ga.__esModule=!0,Ga.default=void 0;var e=function(h,g){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var f=i(g);if(f&&f.has(h))return f.get(h);var x={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var w in h)if(w!=="default"&&Object.prototype.hasOwnProperty.call(h,w)){var b=y?Object.getOwnPropertyDescriptor(h,w):null;b&&(b.get||b.set)?Object.defineProperty(x,w,b):x[w]=h[w]}return x.default=h,f&&f.set(h,x),x}(s),t=pg(),n=oj(),o=hg(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(h){if(typeof WeakMap!="function")return null;var g=new WeakMap,f=new WeakMap;return(i=function(x){return x?f:g})(h)}function a(){return a=Object.assign?Object.assign.bind():function(h){for(var g=1;g<arguments.length;g++){var f=arguments[g];for(var x in f)Object.prototype.hasOwnProperty.call(f,x)&&(h[x]=f[x])}return h},a.apply(this,arguments)}function d(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);g&&(x=x.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),f.push.apply(f,x)}return f}function c(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?d(Object(f),!0).forEach(function(x){u(h,x,f[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):d(Object(f)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(f,x))})}return h}function u(h,g,f){return(g=function(x){var y=function(w,b){if(typeof w!="object"||w===null)return w;var C=w[Symbol.toPrimitive];if(C!==void 0){var k=C.call(w,b);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}(x,"string");return typeof y=="symbol"?y:String(y)}(g))in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}function p(h,g){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,x){return f.__proto__=x,f},p(h,g)}var m=function(h){var g,f;function x(){for(var w,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(w=h.call.apply(h,[this].concat(C))||this).handleRefs={},w.lastHandleRect=null,w.slack=null,w}f=h,(g=x).prototype=Object.create(f.prototype),g.prototype.constructor=g,p(g,f);var y=x.prototype;return y.componentWillUnmount=function(){this.resetData()},y.resetData=function(){this.lastHandleRect=this.slack=null},y.runConstraints=function(w,b){var C=this.props,k=C.minConstraints,E=C.maxConstraints,M=C.lockAspectRatio;if(!k&&!E&&!M)return[w,b];if(M){var T=this.props.width/this.props.height,F=w-this.props.width,_=b-this.props.height;Math.abs(F)>Math.abs(_*T)?b=w/T:w=b*T}var O=w,S=b,v=this.slack||[0,0],D=v[0],j=v[1];return w+=D,b+=j,k&&(w=Math.max(k[0],w),b=Math.max(k[1],b)),E&&(w=Math.min(E[0],w),b=Math.min(E[1],b)),this.slack=[D+(O-w),j+(S-b)],[w,b]},y.resizeHandler=function(w,b){var C=this;return function(k,E){var M=E.node,T=E.deltaX,F=E.deltaY;w==="onResizeStart"&&C.resetData();var _=(C.props.axis==="both"||C.props.axis==="x")&&b!=="n"&&b!=="s",O=(C.props.axis==="both"||C.props.axis==="y")&&b!=="e"&&b!=="w";if(_||O){var S=b[0],v=b[b.length-1],D=M.getBoundingClientRect();C.lastHandleRect!=null&&(v==="w"&&(T+=D.left-C.lastHandleRect.left),S==="n"&&(F+=D.top-C.lastHandleRect.top)),C.lastHandleRect=D,v==="w"&&(T=-T),S==="n"&&(F=-F);var j=C.props.width+(_?T/C.props.transformScale:0),R=C.props.height+(O?F/C.props.transformScale:0),P=C.runConstraints(j,R);j=P[0],R=P[1];var I=j!==C.props.width||R!==C.props.height,L=typeof C.props[w]=="function"?C.props[w]:null;L&&!(w==="onResize"&&!I)&&(k.persist==null||k.persist(),L(k,{node:M,size:{width:j,height:R},handle:b})),w==="onResizeStop"&&C.resetData()}}},y.renderResizeHandle=function(w,b){var C=this.props.handle;if(!C)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+w,ref:b});if(typeof C=="function")return C(w,b);var k=c({ref:b},typeof C.type=="string"?{}:{handleAxis:w});return e.cloneElement(C,k)},y.render=function(){var w=this,b=this.props,C=b.children,k=b.className,E=b.draggableOpts;b.width,b.height,b.handle,b.handleSize,b.lockAspectRatio,b.axis,b.minConstraints,b.maxConstraints,b.onResize,b.onResizeStop,b.onResizeStart;var M=b.resizeHandles;b.transformScale;var T=function(F,_){if(F==null)return{};var O,S,v={},D=Object.keys(F);for(S=0;S<D.length;S++)O=D[S],_.indexOf(O)>=0||(v[O]=F[O]);return v}(b,r);return(0,n.cloneElement)(C,c(c({},T),{},{className:(k?k+" ":"")+"react-resizable",children:[].concat(C.props.children,M.map(function(F){var _,O=(_=w.handleRefs[F])!=null?_:w.handleRefs[F]=e.createRef();return e.createElement(t.DraggableCore,a({},E,{nodeRef:O,key:"resizableHandle-"+F,onStop:w.resizeHandler("onResizeStop",F),onStart:w.resizeHandler("onResizeStart",F),onDrag:w.resizeHandler("onResize",F)}),w.renderResizeHandle(F,O))}))}))},x}(e.Component);return Ga.default=m,m.propTypes=o.resizableProps,m.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ga}var X8,Y8,Ja={};function rj(){if(X8)return Ja;X8=1,Ja.__esModule=!0,Ja.default=void 0;var e=function(g,f){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var x=a(f);if(x&&x.has(g))return x.get(g);var y={},w=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in g)if(b!=="default"&&Object.prototype.hasOwnProperty.call(g,b)){var C=w?Object.getOwnPropertyDescriptor(g,b):null;C&&(C.get||C.set)?Object.defineProperty(y,b,C):y[b]=g[b]}return y.default=g,x&&x.set(g,y),y}(s),t=i(ts()),n=i(mg()),o=hg(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(g){return g&&g.__esModule?g:{default:g}}function a(g){if(typeof WeakMap!="function")return null;var f=new WeakMap,x=new WeakMap;return(a=function(y){return y?x:f})(g)}function d(){return d=Object.assign?Object.assign.bind():function(g){for(var f=1;f<arguments.length;f++){var x=arguments[f];for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(g[y]=x[y])}return g},d.apply(this,arguments)}function c(g,f){var x=Object.keys(g);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);f&&(y=y.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),x.push.apply(x,y)}return x}function u(g){for(var f=1;f<arguments.length;f++){var x=arguments[f]!=null?arguments[f]:{};f%2?c(Object(x),!0).forEach(function(y){p(g,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(x)):c(Object(x)).forEach(function(y){Object.defineProperty(g,y,Object.getOwnPropertyDescriptor(x,y))})}return g}function p(g,f,x){return(f=function(y){var w=function(b,C){if(typeof b!="object"||b===null)return b;var k=b[Symbol.toPrimitive];if(k!==void 0){var E=k.call(b,C);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(b)}(y,"string");return typeof w=="symbol"?w:String(w)}(f))in g?Object.defineProperty(g,f,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[f]=x,g}function m(g,f){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,y){return x.__proto__=y,x},m(g,f)}var h=function(g){var f,x;function y(){for(var w,b=arguments.length,C=new Array(b),k=0;k<b;k++)C[k]=arguments[k];return(w=g.call.apply(g,[this].concat(C))||this).state={width:w.props.width,height:w.props.height,propsWidth:w.props.width,propsHeight:w.props.height},w.onResize=function(E,M){var T=M.size;w.props.onResize?(E.persist==null||E.persist(),w.setState(T,function(){return w.props.onResize&&w.props.onResize(E,M)})):w.setState(T)},w}return x=g,(f=y).prototype=Object.create(x.prototype),f.prototype.constructor=f,m(f,x),y.getDerivedStateFromProps=function(w,b){return b.propsWidth!==w.width||b.propsHeight!==w.height?{width:w.width,height:w.height,propsWidth:w.width,propsHeight:w.height}:null},y.prototype.render=function(){var w=this.props,b=w.handle,C=w.handleSize;w.onResize;var k=w.onResizeStart,E=w.onResizeStop,M=w.draggableOpts,T=w.minConstraints,F=w.maxConstraints,_=w.lockAspectRatio,O=w.axis;w.width,w.height;var S=w.resizeHandles,v=w.style,D=w.transformScale,j=function(R,P){if(R==null)return{};var I,L,H={},W=Object.keys(R);for(L=0;L<W.length;L++)I=W[L],P.indexOf(I)>=0||(H[I]=R[I]);return H}(w,r);return e.createElement(n.default,{axis:O,draggableOpts:M,handle:b,handleSize:C,height:this.state.height,lockAspectRatio:_,maxConstraints:F,minConstraints:T,onResizeStart:k,onResize:this.onResize,onResizeStop:E,resizeHandles:S,transformScale:D,width:this.state.width},e.createElement("div",d({},j,{style:u(u({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},y}(e.Component);return Ja.default=h,h.propTypes=u(u({},o.resizableProps),{},{children:t.default.element}),Ja}var ij=(Y8||(Y8=1,qs.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},qs.exports.Resizable=mg().default,qs.exports.ResizableBox=rj().default),qs.exports);function Nd(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var is=parseInt(s.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=Nd(o,t),i=typeof r=="function";n.push(i?r:()=>Nd(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)Nd(n,t)}};const b5=s.memo(s.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,readonly:a=!1,disabled:d=!1,commandPopupButtonProps:c,sx:u,notifier:p,...m}=e,[h,g]=s.useState(null),[f,x]=s.useState(()=>r.getSelectedRanges().getCoords()),[y,w]=s.useState(!1),{reference:b}=l0({parentFloat:c?.parentFloat}),[C,k]=s.useState(()=>a||!r.getProtection().isStructureAllowed()),E=()=>h?.text??"",[M,T]=s.useState(E),F=de(()=>{if(b?.closeAll(),!M){const V=E();return T(E()),V}if(E()===M)return M;const U=M.trim().toLowerCase();if(U==="r"||U==="c")return M;try{const V=r.getRanges(M);if(V)return V.toString()}catch{}const X=o.getByName(M);if(X&&X.getRanges())return M;let ee=null;try{const V=r.getRanges(M),$=V.getCoords().map(z=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...z}));ee=r.getRanges($)}catch{}if(!ee){const V=r.getSelectedRanges().getCoords().map($=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...$}));ee=r.getRanges(V)}try{let V=o.getByName(M);C||V||(V=o.addReference(M,ee)),V&&g({text:V.getName()})}catch(V){T(E()),p.showMessage?.(V.message,{type:a0})}return null},[M,o,b,C]),_=de(()=>{if(r.isClosed())return;const U=[];for(let V=0;V<f.length;V++){const $=f[V];U.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...$})}let X=null;try{X=o.lookupByRanges(U)}catch{}let ee=null;ee=X?.length>0?X[0].getName():r.getSelectedSheet().getSelectedRange().toString(),g({text:ee})},[r,f]),[O,S]=s.useState(()=>o?.search()??null);Gt(o,{onCollectionChange(U){S(o.search()),_()},onClose(U){S([])}}),s.useEffect(()=>{T(E())},[h,f]);const[v,D]=s.useState(r?.getSelectedSheet());Gt(r,{onProtectionChange:U=>{k(a||!U.getProtection().isStructureAllowed())},onSheetsChange:U=>{D(U?.getSelectedSheet())},onViewChange(U){D(U?.getSelectedSheet())}});const[j,R]=s.useState(null),P=de(N.CommonUtils.debounce(_,j?320:0),[]);Gt(v.getSelection(),{onChange:()=>{x(U=>{const X=r.getSelectedRanges().getCoords();return N.CoordUtils.isEqualRangesArrays(X,U)?U:X})},onAdjustingChange:U=>{R(U.getAdjusting())}}),s.useEffect(()=>{if(j){const U=r.getSelectedRange(),X=U.getRowCount(),ee=U.getColumnCount();let V=`${X}R x ${ee}C`;if(V.length>17&&(V=`${X}x${ee}`),X>1||ee>1)return void g({text:V,fontStyle:"italic",justifyContent:"center"})}g({text:r.getSelectedSheet().getSelectedRange().toString()}),P()},[f,r,j]);const I=s.useRef(null),L=s.useCallback(U=>{const{onMouseDown:X,onMouseUp:ee,...V}=U;return l.jsx(B.IconButton,{...V,sx:{...V?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:l.jsx(B.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:I},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:$=>`1px solid ${$.palette.text.icon??$.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:$=>`1px solid ${$.palette.primary.main}`},"::after":{borderBottom:$=>`1px solid ${$.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*N.IFont.getDeviceScale(),fontStyle:h?.fontStyle,paddingLeft:$=>$.spacing(.75),paddingRight:$=>$.spacing(.75),boxShadow:"none",flex:"1",color:$=>$.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:$=>$.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:$=>$.palette.text.primary}}},value:M,onFocus:$=>{$.target?.select()},onKeyDown:$=>{if($.which===Wt.Enter||$.which===Wt.Tab){let z=M;E()!==M&&($.stopPropagation(),$.preventDefault(),z=F()),z?H(z):i?.()}else if($.which===Wt.Escape)E()!==M?(T(E()),setTimeout(()=>{$.target?.select()},0),$.stopPropagation(),$.preventDefault()):i?.();else if($.which===Wt.Space)return void $.stopPropagation()},onBlur:()=>{T(E())},onChange:$=>{T($.target.value)}})})},[M,h]),H=de(async U=>{try{b?.closeAll();const X=o.lookupByRanges(U)?.[0];X&&await X?.select(),await r.getRanges(U)?.select()}catch(X){p.showMessage?.(X.message,{type:a0})}},[o,p,r]),W=s.useCallback(U=>{setTimeout(()=>{w(!0)},0);const X={variant:Ht.Menuitem,parentFloat:U.floatReference,commandHook:{...c?.commandHook,beforeExecute:(Q,Y)=>(b?.closeAll(),c?.commandHook?.beforeExecute?.(Q,Y))},scope:c?.scope,commands:c?.commands};let ee=o.search({scope:r?.getSelectedSheet().getName()});ee=ee.sort((Q,Y)=>Q.getType()===Y.getType()?Q.getName().localeCompare(Y.getName()):Q.getType()==="range"?-1:1);const V=C?null:["editNamedReference","deleteNamedReference"],$=C?null:["editTable",null,"convertTableToRange","deleteTable"],z=[],q=ee.length;for(let Q=0;Q<q;Q++){const Y=ee[Q],te=Y.getRanges();if(!te||Y.isHidden())continue;const re=Y.getType();re!==ee[Q-1]?.getType()&&(Q>0&&z.push(l.jsx(Mt,{orientation:"horizontal"},`type-divider-${z.length}`)),z.push(l.jsx(pa,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:Y.getType()==="reference"?"Ranges":"Tables"},`type-header-${z.length}`))),re==="reference"?z.push(s.createElement(i0,{...X,key:"named-"+z.length,popupCommandKeys:V,popupScope:"namedItem",scope:"namedItem",commandState:Y,commands:c?.commands,label:Y.getName(),quickCommand:"selectNamed",disabled:!Y.getRanges()||d,icon:ge=>{switch(ge.key()){case"editNamedReference":return xe(l.jsx(cv,{}));case"deleteNamedReference":return xe(l.jsx(dv,{}));default:return xe(l.jsx(lv,{}))}}})):re==="table"&&z.push(s.createElement(i0,{...X,key:"namedItem-"+z.length,popupCommandKeys:$,popupScope:"namedItem",scope:"namedItem",commands:c?.commands,commandState:Y,label:Y.getName(),quickCommand:"selectNamed",disabled:!te||d,icon:ge=>(ge.key(),xe(l.jsx(Al,{})))}))}const G=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...m,children:[C?null:l.jsx(je,{...X,scope:"namedItem",command:c?.commands.getCommand("addNamedReference"),icon:xe(l.jsx(sv,{}))}),z&&z.length>0?l.jsxs(l.Fragment,{children:[C?null:l.jsx(Mt,{orientation:"horizontal"}),l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:z})]}):null]});return wn({...U,children:G})},[r,O,o,h,C]),A=Mo(t,()=>({focus(U){I.current?.focus(U)}}),[]);return l.jsx(B.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...u},ref:is([A,t]),...m,children:l.jsx(Gr,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...u},buttonProps:{sx:{backgroundColor:U=>U.palette.background.paper,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`}},tabIndex:-1,outlined:{color:U=>n?U.palette.action.disabled:dt.alpha(U.palette.divider,.2)},parentFloat:b,createPopupPanel:W,onPopupOpen:()=>w(!0),onPopupClose:()=>w(!1),createTooltip:({children:U},X)=>l.jsx(Bo,{title:X||y?"":"Name Box",disabled:X,leaveDelay:0,sx:{opacity:X||y?0:1},children:U}),createQuickButton:L})})}));b5.displayName="NamedCollectionEditor";const aj=(e,t)=>l.jsx(b5,{ref:t,...e}),w5=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,sheetElement:r,gridStyle:i,showNamedCollectionEditor:a=!0,NamedCollectionEditorProps:d,renderNamedCollectionEditor:c=aj,disabled:u,commands:p,...m}=e,[h,g]=s.useState(o?.getSelectedSheet());Gt(o,{onSheetsChange:$=>{g($?.getSelectedSheet())},onViewChange($){g($?.getSelectedSheet())}});const[f,x]=s.useState(h.getSelection().getCoords().cell),y=h.getRange(f).getCell(),w=u||!y.isEditAllowed(),b=s.useRef(null),C=s.useMemo(()=>({fontSize:11}),[]);Gt(h.getSelection(),{onChange:()=>{x(h.getSelection().getCoords().cell)}}),Gt(h,{onProtectionChange(){x(h.getSelection().getCoords().cell)}});const k=b.current?.getLineHeight()??20,[E,M]=s.useState(k),[T,F]=s.useState(5),[_,O]=s.useState(1),S=de(($,{size:z})=>{$.preventDefault(),$.stopPropagation();const q=Math.floor(z.height/k);M(q*k+1),q>1&&F(q)},[k]),v=de(($,{size:z})=>{const q=Math.floor(z.height/k);O(q)},[k]),D=qr(),j=D.getMode();let R=null;j?.key==="edit"&&(R=j.args?.stateAndCoords);const P=s.useMemo(()=>{let $=R?.editState;return $||($=Wm(()=>h.getRange(f).getCell())),l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:l.jsx($m,{ref:b,activeCoords:f,sheet:h,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:f})},defaultTextStyle:C,useRichStyling:!1,disabled:w,onChangeEdit:z=>{if(z.dirty!==void 0){const q={sheet:h,coords:f,editState:z};D.setMode(G=>({...G,args:{...G?.args,stateAndCoords:q}}))}},editState:$,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:_})})},[h,R,f,_,r]),I=s.useRef(null),L=s.useMemo(()=>a?c({names:o.getNames(),workbook:o,...d},I):null,[c,d,a,h,o,w]),H=s.useMemo(()=>l.jsxs(B.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,border:$=>`solid ${w?$.palette.action.disabled:dt.alpha($.palette.divider,.2)} 1px`},children:[l.jsx(gr,{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:xe(l.jsx(iv,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:w||R===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.cancelEdit()}}),l.jsx(gr,{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:xe(l.jsx(av,{})),tooltipProps:{label:"Enter",simple:!0},disabled:w||R===null,onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{r.submitEdit()}}),l.jsx(gr,{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:xe(l.jsx(Mv,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()}})]}),[w,R]),W=Pr(),[A,U]=s.useState(!1),X=s.useMemo(()=>l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:$=>$.spacing(.5),alignItems:"start"},children:[H,l.jsxs(B.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:$=>$.typography.fontFamily,fontSize:11*N.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:$=>`${$.shape.borderRadius}px`,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,border:$=>`solid ${w?$.palette.action.disabled:dt.alpha($.palette.divider,.2)} 1px`,"& textarea":{color:$=>w?`${$.palette.text.disabled} !important`:$.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>U(!0),onBlur:()=>U(!1),onMouseDown:$=>{$.target?.classList.contains("react-resizable-handle")&&$.preventDefault()},children:[l.jsx(B.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:$=>$.spacing(1),paddingRight:$=>$.spacing(1)},children:l.jsx(ij.ResizableBox,{height:E,draggableOpts:{grid:[k,k]},minConstraints:[k,k],maxConstraints:[15*k,15*k],onResize:v,onResizeStop:S,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:P})}),l.jsx(gr,{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:xe(_>1?l.jsx(gn.ExpandLess,{}):l.jsx(gn.ExpandMore,{})),tooltipProps:{label:(_>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:$=>{$.button===0&&$.preventDefault()},onClick:()=>{const $=_>1?1:T;M($*k+1),O($)}}),l.jsx(B.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:A?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:$=>$.palette.primary.main,borderRadius:$=>`${$.shape.borderRadius}px`}})]})]}),[H,P,A,_,k]),ee=s.useMemo(()=>L||X?!L&&X?X:L&&!X?L:l.jsx(l.Fragment,{children:l.jsx(su,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${W.palette.text.icon??W.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:L,elementAfter:X})}):null,[L,X]),V=Mo(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>I.current}),[]);return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:$=>$.spacing(.5),...n},ref:V,...m,children:ee})}));w5.displayName="FormulaBar";const v5=s.memo(s.forwardRef((e,t)=>{const{filter:n,commands:o,disabled:r,sx:i,floatReference:a,...d}=e,c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(h,g)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=s.useMemo(()=>({...c,...u,variant:Ht.Menuitem}),[c,u]),m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:o.getCommand("sortAscending"),icon:xe(l.jsx(Tu,{}))}),l.jsx(je,{...p,command:o.getCommand("sortDescending"),icon:xe(l.jsx(Kh,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:o.getCommand("autoFilterClear"),icon:xe(l.jsx(j2,{}))}),[]]});return l.jsx(B.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...i},...d,children:m})}));v5.displayName="FilterColumnMenu";const fg=s.memo(s.forwardRef((e,t)=>{const{children:n,className:o,disabled:r,style:i,filter:a,...d}=e,c=Mo(t,()=>({isFilters:()=>!0}),[]);return l.jsx("div",{ref:c,className:Zn("filters",o),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...i},...d,children:l.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:[l.jsx("div",{children:a.getName()}),l.jsx("div",{children:"Filter Widget"})]})})}));fg.displayName="Filters";const S5=s.memo(s.forwardRef((e,t)=>{const{children:n,sheet:o,style:r,className:i,value:a,index:d,editing:c,editable:u,disabled:p,selectedIndex:m,dragging:h,borderColor:g,borderWidth:f,activeColor:x,background:y="white",tabRadius:w=4,gridTheme:b,...C}=e,[k,E]=s.useState(()=>!!o&&o.getProtection().isLocked()),[M,T]=s.useState(()=>o?o.getTabColor():null);Gt(o,{onProtectionChange:()=>{E(o.getProtection().isLocked())},onTabColorChange:()=>{T(o.getTabColor())},onStyleChange:()=>{T(o.getTabColor())}});const F=Pr(),_=m===d;let O=null,S=null;if(M||h){let j=y;M?(S=M.toBlackOrWhite().toCSS(),j=M?.toCSS()):_||(j=F.palette.background.paper),O=l.jsx(B.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:_?"50%":"100%",borderRadius:"4px",border:R=>_?`${y} solid 1px`:`${R.palette.divider} solid 1px`,background:_&&M?`linear-gradient(0deg, ${j} 0%, transparent)`:j}})}let v=null;typeof g=="string"?v=g:g?.toCSS&&(v=g.toCSS());const D=_?l.jsx(B.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:j=>j.palette.primary.main}}):null;return l.jsx(am,{theme:_?b??F:F,children:l.jsx(B.Box,{ref:t,className:Zn(i),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:_?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:h?"grabbing":void 0},...C,children:l.jsx(ty,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:w,strokeColor:_?v:"transparent",children:l.jsx(B.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:_?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:h?"grabbing":void 0,color:_?"primary":S||"text.secondary",backgroundColor:_?y:"transparent","&:hover:not([disabled])":{backgroundColor:_?y:"transparent"},"& input":{color:j=>`${j.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:l.jsxs(l.Fragment,{children:[O,l.jsxs(B.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:_?void 0:"1px"},children:[n,D]}),k?l.jsx(gn.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):l.jsx(B.Box,{sx:{minHeight:"22px"}})]})]})},a+":"+d)})})})}));S5.displayName="SheetTab";const C5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,index:o,commands:r,scope:i="sheet",disabled:a,floatReference:d,sx:c,className:u,tabStripRef:p,...m}=e,[h,g]=s.useState(n?.getProtection());Gt(n,{onProtectionChange:b=>{g(b?.getProtection())}});const f=s.useMemo(()=>({}),[]),x=s.useMemo(()=>({commandHook:{beforeExecute:(b,C)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:i,commandState:o,disabled:a||o===void 0,parentFloat:d}),[a,d]),y=s.useMemo(()=>({...f,...x}),[f,x]),w=l.jsxs(l.Fragment,{children:[l.jsx(je,{command:r.getCommand("addSheet"),commandState:o,...y,variant:Ht.Menuitem}),l.jsx(je,{command:r.getCommand("deleteSheet"),...y,variant:Ht.Menuitem}),l.jsxs(lr,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(d.closeAll()).then(()=>{p?.startEdit(o)})},disabled:a||!h.isStructureAllowed(),parentFloat:d,children:["Rename",i!=="sheet"?" Sheet":""]}),l.jsx(je,{command:r.getCommand("duplicateSheet"),...y,variant:Ht.Menuitem}),l.jsx(je,{command:r?.getCommand("protectionSheetToggle"),...y,variant:Ht.Menuitem,icon:l.jsx(gn.Lock,{})}),l.jsx(xa,{variant:Ht.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:l.jsx(T2,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:ra.End},parentFloat:d}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{command:r.getCommand("hideSheet"),...y,variant:Ht.Menuitem,icon:xe(l.jsx(Yh,{}))})]});return l.jsx(B.Box,{ref:t,className:Zn("menu",u),sx:{...c},...m,children:w})}));C5.displayName="SheetTabMenu";const k5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,gridStyle:o,floatReference:r,closeFloatAll:i,className:a,...d}=e,[c,u]=s.useState(n?.getSheets().search()),[p,m]=s.useState(n?.getProtection());Gt(n,{onSheetsChange:g=>{u(g.getSheets().search())},onProtectionChange:g=>{m(g?.getProtection())}});const h=s.useMemo(()=>{const g=[],f=n.getSheets().search({visibility:N.ISheet.Visibility.Hidden}),x=n.getSelectedSheet();for(let y=0;y<f.length;y++){const w=f[y],b=w.getVisibility();if(b===N.ISheet.Visibility.VeryHidden)continue;const C=x===w,k=w.getProtection().isLocked(),E=w.getTabColor(),M=o?.body.fill??"transparent";let T=null,F=null,_=M;E&&(_=E.toCSS(),C||(F=E.toBlackOrWhite().toCSS()),T=l.jsx(B.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:C?_:"transparent",borderRadius:"4px",border:`solid 1px ${o.header.edgeStrokeFill}`},children:l.jsx(B.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:C||b===N.ISheet.Visibility.Hidden?"50%":"100%",border:S=>C?`${M} solid 1.5px`:`${S.palette.divider} solid 1px`,background:C&&E?`linear-gradient(0deg, ${_} 0%, ${M})`:_,borderRadius:"4px"}})}));let O=null;k&&(O=l.jsx(gn.Lock,{color:"secondary"})),b!==N.ISheet.Visibility.Visible&&(O=xe(l.jsx(Yh,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),O&&(O=l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:O})),g.push(l.jsx(lr,{disabled:!p.isStructureAllowed()&&b===N.ISheet.Visibility.Hidden,sx:{color:S=>{let v=C?S.palette.primary.main:S.palette.text.secondary;return F&&(v=F),b===N.ISheet.Visibility.Hidden&&(v=dt.alpha(v,S.palette.action.disabledOpacity)),v},borderLeft:S=>`${C?S.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:C?"700":"400","&:hover":{fontWeight:"700"}},icon:C?l.jsx(Ql,{}):void 0,onMouseDown:S=>S.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{w.select()}catch(S){console.error(S)}})},children:l.jsxs(l.Fragment,{children:[T,l.jsxs(B.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[l.jsxs(B.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[w.getName(),l.jsx(B.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:w.getName()})]}),O]})]})},""+y))}return g},[n,p,c,r,o]);return l.jsx(B.Box,{ref:t,className:Zn("menu",a),...d,children:h})}));k5.displayName="SheetsAllMenu";let Xs=!1,gg=!1,ti=null;const J8=async e=>{const t=await N.LicenseManager.getDetails();if(gg||t.isEval()){try{const n=top??window;n.SheetXL||(n.SheetXL=Object.freeze({getSelectedWorkbook:()=>ti?.getWorkbook(),getSelectedSheet:()=>ti?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>ti?.getWorkbook().getSelectedRange(),getRange:o=>ti?.getWorkbook().getRange(o),getSelectedWorkbookElement:()=>ti,getLicenseManager:()=>N.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),Xs=!0}if(ti!==e&&(ti=e,!Xs))try{Xs=!0,(top??window).SheetXL&&(await N.LicenseManager._validate(!0),N.LicenseManager.wasPrinted()&&(()=>{zt.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
86
86
|
Try
|
|
87
87
|
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
88
|
-
>%c SheetXL.moreExamples()`,"color:#ffa726;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;"),Xs=!0;const n=document.getElementById("openEditorLink");n&&n.addEventListener("click",o=>{o.preventDefault(),console.log("openScriptEditor called from console")})})())}catch(n){n instanceof DOMException||console.error(n)}}};var lj=function(){},xg=typeof window<"u",sj=xg?s.useLayoutEffect:s.useEffect,Q8={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const ya=xg&&window.ResizeObserver!==void 0?function(){var e=s.useState(null),t=e[0],n=e[1],o=s.useState(Q8),r=o[0],i=o[1],a=s.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var c=d[0].contentRect,u=c.x,p=c.y,m=c.width,h=c.height,g=c.top,f=c.left,x=c.bottom,y=c.right;i({x:u,y:p,width:m,height:h,top:g,left:f,bottom:x,right:y})}})},[]);return sj(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[lj,Q8]};function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ac.apply(null,arguments)}function E5(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function lc(e,t){return lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lc(e,t)}function yg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,lc(e,t)}function ep(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const tp=!1,bg=s.createContext(null);var wg=function(e){return e.scrollTop},fl="unmounted",oi="exited",ri="entering",Ni="entered",l2="exiting",m0=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,d=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?d?(a=oi,i.appearStatus=ri):a=Ni:a=o.unmountOnExit||o.mountOnEnter?fl:oi,i.state={status:a},i.nextCallback=null,i}yg(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===fl?{status:oi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==ri&&i!==Ni&&(r=ri):i!==ri&&i!==Ni||(r=l2)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===ri){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:uo.findDOMNode(this);i&&wg(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===oi&&this.setState({status:fl})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,d=this.props.nodeRef?[a]:[uo.findDOMNode(this),a],c=d[0],u=d[1],p=this.getTimeouts(),m=a?p.appear:p.enter;!o&&!i||tp?this.safeSetState({status:Ni},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:ri},function(){r.props.onEntering(c,u),r.onTransitionEnd(m,function(){r.safeSetState({status:Ni},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:uo.findDOMNode(this);r&&!tp?(this.props.onExit(a),this.safeSetState({status:l2},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:oi},function(){o.props.onExited(a)})})})):this.safeSetState({status:oi},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:uo.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=d[0],u=d[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===fl)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=E5(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s.createElement(bg.Provider,{value:null},typeof i=="function"?i(o,a):s.cloneElement(s.Children.only(i),a))},t}(s.Component);function Ai(){}m0.contextType=bg,m0.propTypes={},m0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ai,onEntering:Ai,onEntered:Ai,onExit:Ai,onExiting:Ai,onExited:Ai},m0.UNMOUNTED=fl,m0.EXITED=oi,m0.ENTERING=ri,m0.ENTERED=Ni,m0.EXITING=l2;var Vd=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=ep(o.className,r):o.setAttribute("class",ep(o.className&&o.className.baseVal||"",r)));var o,r})},s2=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1];o.removeClasses(p,"exit"),o.addClass(p,m?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(d,c)},o.onEntering=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1]?"appear":"enter";o.addClass(p,m,"active"),o.props.onEntering&&o.props.onEntering(d,c)},o.onEntered=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1]?"appear":"enter";o.removeClasses(p,m),o.addClass(p,m,"done"),o.props.onEntered&&o.props.onEntered(d,c)},o.onExit=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(d)},o.onExiting=function(d){var c=o.resolveArguments(d)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(d)},o.onExited=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(d)},o.resolveArguments=function(d,c){return o.props.nodeRef?[o.props.nodeRef.current,d]:[d,c]},o.getClassNames=function(d){var c=o.props.classNames,u=typeof c=="string",p=u?(u&&c?c+"-":"")+d:c[d];return{baseClassName:p,activeClassName:u?p+"-active":c[d+"Active"],doneClassName:u?p+"-done":c[d+"Done"]}},o}yg(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var a=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(a+=" "+d),i==="active"&&o&&wg(o),a&&(this.appliedClasses[r][i]=a,function(c,u){c&&u&&u.split(" ").forEach(function(p){return h=p,void((m=c).classList?m.classList.add(h):function(g,f){return g.classList?!!f&&g.classList.contains(f):(" "+(g.className.baseVal||g.className)+" ").indexOf(" "+f+" ")!==-1}(m,h)||(typeof m.className=="string"?m.className=m.className+" "+h:m.setAttribute("class",(m.className&&m.className.baseVal||"")+" "+h)));var m,h})}(o,a))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],a=i.base,d=i.active,c=i.done;this.appliedClasses[r]={},a&&Vd(o,a),d&&Vd(o,d),c&&Vd(o,c)},n.render=function(){var o=this.props;o.classNames;var r=E5(o,["classNames"]);return s.createElement(m0,ac({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.Component);s2.defaultProps={classNames:""},s2.propTypes={};const sc={Light:"light",Dark:"dark"},Hd=.12,c2=(e,t)=>{const n={},o=c=>{const u=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:u,strokeFill:Er(u,Hd,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:Er(n.body.fill,Hd,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:Er(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:Er(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:Er(c?.fill??n.body.fill,.22,e.palette?.mode),fill:Er(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=Er(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:dt.alpha(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:dt.alpha(i,.7)},n.headerSelectAll={...n.headerSelect,fill:dt.alpha(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:Er(r.fill,Hd,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:Er(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:Er(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?dt.alpha(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?dt.alpha(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const a=t??e,d=a.palette.mode==="dark";return n.selection={fill:a.palette?.primary?.main?dt.alpha(a.palette?.primary?.main,.1):void 0,strokeFill:a.palette?.primary?.main},n.selectionInactive={...n.selection,fill:a.palette?.divider?dt.alpha(a.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:dt.alpha(a.palette.warning.light,.05),strokeFill:a.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=dt.alpha(a.palette.action.active,.5),n.colorGrey=a.palette.action.active,n.filterDarkInvert=d?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function _5(e){const{mode:t}=e||{},[n,o]=s.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=np();if(r)return{themeMode:r,source:"class"}}return{themeMode:op(),source:"media"}});return s.useEffect(()=>{if(t&&t!==n?.themeMode)return void o({themeMode:t,source:"prop"});const r=()=>{const c=np();if(c)o({themeMode:c,source:"class"});else{const u=op();o({themeMode:u,source:"media"})}},i=new MutationObserver(r),a=[document.documentElement,document.body].filter(Boolean);for(const c of a)i.observe(c,{attributes:!0,attributeFilter:["class"]});const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",r),r(),()=>{i.disconnect(),d.removeEventListener("change",r)}},[t]),n}function np(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function op(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Gl=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=Mo(t,()=>({}),[]),[d,c]=ya(),u=s.useRef(null),p=s.useRef(null),[m,h]=s.useReducer(E=>E+1,0),[g,f]=s.useState(null),[x,y]=s.useState(null),[w,b]=s.useState(null),{reference:C}=l0({parentFloat:r,label:"overflow"});s.useLayoutEffect(()=>{p.current={refs:[]};const E=[],M=s.Children.toArray(n);let T=0;M.forEach((F,_)=>{E.push(l.jsx(B.Box,{sx:{display:"flex"},ref:O=>{T++,T===M.length&&h();const S={current:null};S.current=O,p.current.refs[_]=S},children:F},_))}),f(E)},[n,c]),s.useLayoutEffect(()=>{if(!g)return;const E=p.current.refs;if(!a.current||!E||E.length===0)return y(null),void b(null);const M=a.current?.getBoundingClientRect(),T=[],F=[];let _=0,O=!1;for(let v=0;!O&&v<E.length;v++){const D=E[v];if(!D)continue;if(!D.current){O=!0;continue}const j=D.current.getBoundingClientRect();_+=j?.width,_>M.width&&(O=!0)}if(!O)return y(null),void b([]);const S=u.current?.getBoundingClientRect();_=0;for(let v=0;v<E.length;v++){const D=E[v];let j=!1;if(D.current){const R=D.current.getBoundingClientRect();_+=R?.width,_<M.width-S.width&&(j=!0)}j?T.push(g[v]):F.push(g[v])}y(T.length>0?T:null),b(F.length>0?F:null)},[n,g,c,C,m]);const k=de(E=>{const M=[];for(let F=0;F<w.length;F++){let _=s.Children.toArray(w[F]);const O=_[0];_=s.Children.toArray(O.props.children?.props.children??O.props.children);const S=_[0],v={...S.props};v.parentFloat&&(v.parentFloat=E.floatReference);const D=s.cloneElement(S,v);M.push(D)}const T=l.jsx(B.Box,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:F=>F.spacing(.5),paddingBottom:F=>F.spacing(.5),paddingLeft:F=>F.spacing(1),paddingRight:F=>F.spacing(1),overflow:"hidden"},children:M});return wn({...E,children:T})},[w]);return l.jsxs(B.Box,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:is([a,d,t]),...i,children:[l.jsx(B.Box,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:x??g}),l.jsx(B.Box,{sx:{display:w!==null&&w.length===0?"none":"flex",flex:"1 1 0"},children:l.jsx(Gr,{createPopupPanel:k,ref:u,parentFloat:C,createTooltip:({children:E},M)=>l.jsx(Bo,{label:"More",description:"More toolbar options…",disabled:M,children:E}),icon:l.jsx(Fh,{children:l.jsx(gn.MoreHoriz,{})})})})]})})),vg="https://unpkg.com/@sheetxl/scripting-templates/dist",cj=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D9X3UXVH6b_NJFeo.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DZJO-_8PnMFRZMpg.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Dy2vYVhrEqTHdzfD.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],dj=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D9X3UXVH6b_NJFeo.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DZJO-_8PnMFRZMpg.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Dy2vYVhrEqTHdzfD.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class Sg{constructor(t=cj,n=dj){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const a={...o,...o?.typedCreateWorkbookOptions?.[n]};let d;delete a.typedCreateWorkbookOptions;try{d=await i(t,a)}catch(c){throw new Error("Unable to import",{cause:c})}return d}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const a=n;return await this._fromFile(a,t)}case"base64":{let a;if(n&&typeof n=="object"&&"base64"in n)a=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,u]=n.split(",");a=u}else a=n;const d=Cx.base64ToArrayBuffer(a),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(d,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let a,d,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const x=n;c=x.input,a=x.init,d=x.timeout}}const u=d||3e4,p=new AbortController,m=setTimeout(()=>p.abort(),u),h=typeof c=="string"?c:c.toString(),g=r||N.TextUtils.getFileNameExtension(h),f=this.getReadFormatTypeForExt(g)||this._readFormatTypes[0];try{const x=await fetch(c,{...a,signal:p.signal});if(clearTimeout(m),!x.ok)throw new Error(`Failed to fetch: ${x.status} ${x.statusText}`);const y=await x.arrayBuffer();if(!f)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(y,f.key,t),title:o||N.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:f}}catch(x){throw clearTimeout(m),x.name==="AbortError"?new Error(`Fetch timeout after ${u}ms: ${h}`):x}}case"buffer":{const a=n,d=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!d)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(a,d.key,t),title:o||"buffer-file",formatType:d}}case"stream":{const a=n.getReader(),d=[];let c=0;try{for(;;){const{done:g,value:f}=await a.read();if(g)break;d.push(f),c+=f.length}}finally{a.releaseLock()}const u=new ArrayBuffer(c),p=new Uint8Array(u);let m=0;for(const g of d)p.set(g,m),m+=g.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(u,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${N.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt(N.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${N.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const a=await t.arrayBuffer(),d={...n,...n?.typedCreateWorkbookOptions?.[i.key]};delete d.typedCreateWorkbookOptions;const c=i.handler;if(!c)throw new Error(`Unable to resolve handler for type: ${i?.description??N.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await d.onStart?.(r);const u=await c(a,d);o=new uj(t,u,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=N.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const a=this.getWriteFormats(),d=a.length;for(let p=0;!i&&p<d;p++)(a[p].ext===r||!r&&a[p].isDefault)&&(i=a[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let u=null;try{u=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,m)=>{let h;typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer?(h=new ArrayBuffer(m.byteLength),new Uint8Array(h).set(new Uint8Array(m))):h=m,function(g,f){const x=URL.createObjectURL(g),y=document.createElement("a");y.style.display="none",y.href=x,y.download=f,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(x)}(new Blob([h],{type:"application/octet-stream"}),p)})(c,u)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class uj{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const pj=new Sg;var rp,ip,hj=function(){if(ip)return rp;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,a="",d=0,c=-1,u=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&u!==1)if(c!==p-1&&u===2){if(a.length<2||d!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",d=0):d=(a=a.slice(0,m)).length-1-a.lastIndexOf("/"),c=p,u=0;continue}}else if(a.length===2||a.length===1){a="",d=0,c=p,u=0;continue}}r&&(a.length>0?a+="/..":a="..",d=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),d=p-c-1;c=p,u=0}else i===46&&u!==-1?++u:u=-1}return a}ip=1;var n={resolve:function(){for(var o,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var d;a>=0?d=arguments[a]:(o===void 0&&(o=process.cwd()),d=o),e(d),d.length!==0&&(r=d+"/"+r,i=d.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var a=o.length,d=a-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var u=r.length-c,p=d<u?d:u,m=-1,h=0;h<=p;++h){if(h===p){if(u>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else d>p&&(o.charCodeAt(i+h)===47?m=h:h===0&&(m=0));break}var g=o.charCodeAt(i+h);if(g!==r.charCodeAt(c+h))break;g===47&&(m=h)}var f="";for(h=i+m+1;h<=a;++h)h!==a&&o.charCodeAt(h)!==47||(f.length===0?f+="..":f+="/..");return f.length>0?f+r.slice(c+m):(c+=m,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,a=-1,d=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!d){a=c;break}}else d=!1;return a===-1?i?"/":".":i&&a===1?"//":o.slice(0,a)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,a=0,d=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var u=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var m=o.charCodeAt(i);if(m===47){if(!c){a=i+1;break}}else p===-1&&(c=!1,p=i+1),u>=0&&(m===r.charCodeAt(u)?--u===-1&&(d=i):(u=-1,d=p))}return a===d?d=p:d===-1&&(d=o.length),o.slice(a,d)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){a=i+1;break}}else d===-1&&(c=!1,d=i+1);return d===-1?"":o.slice(a,d)},extname:function(o){e(o);for(var r=-1,i=0,a=-1,d=!0,c=0,u=o.length-1;u>=0;--u){var p=o.charCodeAt(u);if(p!==47)a===-1&&(d=!1,a=u+1),p===46?r===-1?r=u:c!==1&&(c=1):r!==-1&&(c=-1);else if(!d){i=u+1;break}}return r===-1||a===-1||c===0||c===1&&r===a-1&&r===i+1?"":o.slice(r,a)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return function(r,i){var a=i.dir||i.root,d=i.base||(i.name||"")+(i.ext||"");return a?a===i.root?a+d:a+"/"+d:d}(0,o)},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,a=o.charCodeAt(0),d=a===47;d?(r.root="/",i=1):i=0;for(var c=-1,u=0,p=-1,m=!0,h=o.length-1,g=0;h>=i;--h)if((a=o.charCodeAt(h))!==47)p===-1&&(m=!1,p=h+1),a===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1);else if(!m){u=h+1;break}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===u+1?p!==-1&&(r.base=r.name=u===0&&d?o.slice(1,p):o.slice(u,p)):(u===0&&d?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(u,c),r.base=o.slice(u,p)),r.ext=o.slice(c,p)),u>0?r.dir=o.slice(0,u-1):d&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,rp=n}();const ap=/^(con|prn|aux|nul|com\d|lpt\d)$/i,lp=/[<>:"/\\|?*\u0000-\u001F]/g,di=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:lp,WINDOW_FILENAME_RESERVED_REGEX:ap,isValidWindowsFilename:e=>!(!e||e.length>255||lp.test(e)||ap.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return hj.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),sp=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:Sg,IOUtils:di,WorkbookIO:pj},Symbol.toStringTag,{value:"Module"})),mj=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},Cg=async e=>{const t=di.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new nu(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new nu(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(a){throw new Error(`Failed to parse directory: ${a.message}. Ensure the file is valid JSON.`)}const i=r.map(async a=>{try{const d=di.relativePath(e,a.path),c=await fetch(d);if(!c.ok)throw new Error(`Failed to fetch file at '${a.path}': ${c.statusText}`);const u=await c.text();let p=a.metadata;return p?.title||(p={title:mj(a),...p}),{path:a.path,content:u,metadata:p}}catch(d){console.error(d.message)}return null});return(await Promise.all(i)).filter(a=>a!==null)},$d={fontSize:"0.8rem",marginRight:"4px"},fj=s.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...a}=e;let d;return d=n.metadata?.icon==="formula"?l.jsx(e9,{sx:$d}):n.metadata?.icon==="macro"?l.jsx(O2,{sx:$d}):l.jsx(gn.WebhookOutlined,{sx:$d}),l.jsx(lr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:d,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==Wt.Enter&&c.keyCode!==Wt.Space||r(n)},...a,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[l.jsx(B.Typography,{component:"div",children:n.metadata?.title??n.path}),l.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:c=>dt.alpha(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),kg=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:a=vg,...d}=e,[c,u]=s.useState([]),[p,m]=s.useState(!0),h=no(n,["executeSelectedScript"]),g=h[0]?.context?.();s.useEffect(()=>{(async()=>{try{const x=await Cg(a);u(x)}catch{}finally{m(!1)}})()},[a]);const f=s.useCallback((x,y)=>{if(p)return l.jsx("div",{children:"Loading..."});const w={variant:Ht.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=E=>{g.getEditor()?.insertSnippet(E.content),x.closeFloat()},C=[];for(let E=0;E<c.length;E++){const M=c[E];M&&C.push(l.jsx(fj,{handleInsert:b,snippet:M},M.path))}const k=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[C.length>0?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C}),l.jsx(Mt,{orientation:"horizontal"})]}):null,s.createElement(je,{...w,key:"help",command:n.getCommand("help"),icon:xe(l.jsx(Jh,{}))})]});return wn({...x,children:k})},[i,o,r,p,g]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:f,icon:xe(l.jsx(Lv,{})),...d})})),T5=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[l.jsx("div",{children:l.jsx(Gl,{parentFloat:o,style:{},children:l.jsx(je,{...c,command:n.getCommand("saveScripts"),icon:xe(l.jsx(Ov,{}))})})}),l.jsx("div",{style:{flex:"1 1 100%"}}),l.jsx("div",{children:l.jsx(Gl,{parentFloat:o,style:{},children:l.jsx(kg,{...c,commands:n})})})]})})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));T5.displayName="ScriptEditorToolbar";const Wd={fontSize:"1rem"},Eg=s.memo(s.forwardRef((e,t)=>{const{scriptPath:n=vg,onScriptSelect:o,sx:r=hn.EmptyCssProperties,className:i,buttonMinWidth:a=210,buttonMinHeight:d=80,gap:c=12,...u}=e,[p,m]=s.useState([]),[h,g]=s.useState(!0),[f,x]=s.useState(null);if(s.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{g(!0),x(null);const C=await Cg(n);for(let k=0;k<C.length;k++){const E=C[k];E&&b.push(E)}}catch(C){x(C instanceof Error?C.message:"Failed to load scripts"),C instanceof nu||console.error("Error loading scripts:",C)}finally{m(b),g(!1)}})()},[n]),h)return l.jsx(B.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Zn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...r},...u,children:l.jsx(B.CircularProgress,{})});let y=null;f&&(y=l.jsxs(B.Box,{display:"flex",justifyContent:"center",alignItems:"center",className:Zn(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},...u,children:[l.jsx(B.Typography,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),l.jsx(B.Typography,{color:"error",component:"div",children:f})]}));const w=b=>{const C=b.metadata?.icon;return C==="macro"?l.jsx(O2,{sx:Wd}):C==="formula"?l.jsx(e9,{sx:Wd}):C==="autostart"?l.jsx(gn.WebhookOutlined,{sx:Wd}):null};return l.jsxs(B.Box,{ref:t,className:Zn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...r},...u,children:[l.jsxs(B.Box,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[l.jsx(B.Typography,{variant:"h6",gutterBottom:!0,children:"Script Template"}),l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),l.jsx(B.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,C)=>l.jsxs(B.Button,{variant:"outlined",sx:{minWidth:a,minHeight:d,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...C===0&&{borderStyle:"dashed",marginBottom:"8px"},...C===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[l.jsx(B.Typography,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),w(b)]}),b.metadata?.summary&&l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${C}`))})]}),y]})}));Eg.displayName="TemplateSelectPanel";const j5=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:a=!1,onClose:d,autoFocusSel:c,autoFocus:u=!0,scripts:p,...m}=e,h=Pr(),[g,f]=s.useState(!1),x=s.useRef(!1),[y,w]=s.useState({message:"Loading",cursor:"",dirty:!1}),[b,C]=s.useState(null);s.useEffect(()=>{let L=!1;return C(null),async function(){if(p&&(await p.start(),!L)){const H=p.getModules().search()[0]?.getSource();C({source:H||null})}}(),()=>{L=!0}},[p]);const k=s.useCallback(L=>{w(H=>({...H,...L}))},[]),E=s.useRef(null),M=s.useRef(null),[T,F]=s.useState(null),_=s.useRef(null),O=de(L=>{if(T)return T.focus(L),!0;if(c){const H=M.current?.querySelectorAll?.(c);if(H&&H.length>0)return H[0]?.focus?.(L),!0}return M.current?.focus?.(L),!1},[T,c,u]),S=s.useMemo(()=>l.jsx(Z0,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),v=s.useMemo(()=>l.jsx(B.Paper,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,marginLeft:L=>L.spacing(.5),marginRight:L=>L.spacing(.5),marginTop:L=>L.spacing(1),marginBottom:L=>L.spacing(1)},children:l.jsx(T5,{commands:i})}),[h,i]),D=s.useMemo(()=>l.jsx(B.Box,{className:Zn("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:l.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:L=>L.palette.text.secondary},variant:"caption",children:y.message}),l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:L=>L.palette.text.secondary},variant:"caption",children:y.dirty?"Unsaved":""}),l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:L=>L.palette.text.secondary},variant:"caption",children:y.cursor})]})}),[y]),j=s.useMemo(()=>l.jsxs(B.Box,{className:Zn("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[v,l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:l.jsx($T,{ref:M,loadingPanel:S,readOnly:a,onClose:d,autoFocus:u,commands:i,onStatusChange:k,darkMode:h.palette.mode==="dark",...r})}),D]}),[h,i,v,D,g,S,a,r,u,c,d,k]),R=s.useMemo(()=>l.jsx(B.DialogTitle,{className:Zn({"Mui-selected":x.current}),sx:{display:"flex",color:L=>L.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:L=>`${L.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:L=>L.transitions.duration.shortest/2+"ms"},backgroundColor:L=>dt.alpha(L.palette.action.hover,.03),borderBottom:L=>`solid ${dt.alpha(L.palette.divider,.2)} 1px`},onPointerDown:L=>{L.isDefaultPrevented()||(L.preventDefault(),O())},children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:L=>L.spacing(.25),marginBottom:L=>L.spacing(.25),marginLeft:L=>L.spacing(1),marginRight:L=>L.spacing(1)},children:[l.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:L=>L.spacing(1)},children:"Script (Typescript)"}),l.jsx(Bo,{label:"Close",children:l.jsx(B.IconButton,{"aria-label":"close",sx:{color:L=>L.palette.text.icon??L.palette.action.active},touchRippleRef:E,onPointerDown:L=>{E.current?.start(L,{center:!1}),L.stopPropagation(),L.preventDefault()},onPointerUp:()=>{M.current?.close()},children:l.jsx(gn.Close,{})})})]})}),[h,g]),P=s.useMemo(()=>{let L;return b===null?null:(b.source===null&&(L=l.jsx(Eg,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:H=>{M.current?.getEditor().insertSnippet(H.content),C({source:H.content??""})}})),l.jsxs(B.Box,{tabIndex:0,className:Zn("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},onPointerDown:H=>{H.isDefaultPrevented()||M.current?.focus()},children:[R,l.jsxs(B.Box,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[j,L]})]}))},[v,j,n,b]),I=Mo(t,()=>({isScriptWorkspaceElement:()=>!0,focus:L=>{O(L)}}),[]);return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:I,...m,onFocus:L=>{f(!0),x.current=!0,I.current?.contains(L.target)&&L.target!==I.current&&F(L.target),L.relatedTarget&&!_.current&&(_.current=L.relatedTarget),m?.onFocus?.(L)},onBlur:L=>{I?.current?.contains(L.relatedTarget)||I?.current===L.relatedTarget||(_.current=null,x.current=!1,f(!1)),m?.onBlur?.(L)},children:P})}));j5.displayName="ScriptWorkspace";const M5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["executeScript"])[0].context();no(n,["showScriptEditor"]);const c=s.useCallback((u,p)=>{const m={variant:Ht.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=d?.getScripts(),g=h?.searchFunction({type:"macro"}),f=[];if(g)for(let y=0;y<g.length;y++){const w=g[y];f.push(l.jsx(je,{...m,command:p.getCommand("executeScript"),commandState:{declaration:w},tooltipProps:{description:`Execute ${w.getName()??"script"}`},icon:xe(l.jsx(O2,{})),label:w.getName()??`Script '${w.getName()}'`},`script-${w.getName()}-${y}`))}const x=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[f.length>0?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:f}),l.jsx(Mt,{orientation:"horizontal"})]}):null,s.createElement(je,{...m,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:xe(l.jsx(Ev,{}))})]});return wn({...u,children:x})},[i,d,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:xe(l.jsx(Dv,{})),...a})})),gj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=no(n,["executeScript","showScriptEditor"]),d=a[0]?.context?.(),c=s.useCallback(u=>{const{commandButtonProps:p,commandPopupProps:m}=u,h=l.jsx(xa,{...m,command:n.getCommand("formatFontColor"),icon:l.jsx(_b,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=l.jsx(xa,{...m,command:n.getCommand("formatFillColor"),icon:l.jsx(Eb,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:ra.End}}),f=n.getCommand("undo")?l.jsx(l.Fragment,{children:l.jsx(h5,{...m,quickCommand:"undo"})}):null,x=n.getCommand("find")?l.jsx(l.Fragment,{children:l.jsx(Ff,{...m})}):null;let y=null;const w=d?.getScripts();if(a[1]?.state?.()||w){let b=a[1]?.state?.();const C=w?.searchFunction({type:"macro"});for(let k=0;C&&!b&&k<C?.length;k++)b=!0;b&&(y=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{}),l.jsx(M5,{...m})]}))}return l.jsxs(Gl,{parentFloat:o,children:[f,null,f?l.jsx(Mt,{}):null,l.jsx(m5,{...m,command:n.getCommand("paste")}),l.jsx(je,{...p,command:n.getCommand("formatPainterToggle"),icon:xe(l.jsx(Aw,{}))}),l.jsx(Lc,{...p,command:n.getCommand("copy")}),l.jsx(Mt,{}),l.jsx($f,{...m,command:n.getCommand("formatFontFamily")}),l.jsx(zf,{...m,command:n.getCommand("formatFontSize")}),l.jsx(je,{...p,command:n.getCommand("formatBoldToggle"),icon:l.jsx(Iy,{})}),l.jsx(je,{...p,command:n.getCommand("formatItalicToggle"),icon:l.jsx(Ry,{})}),l.jsx(Uf,{...m}),l.jsx(Wf,{...m}),h,l.jsx(Mt,{}),g,l.jsx(Of,{...m}),l.jsx(Af,{...m}),l.jsx(Mt,{}),l.jsx(H9,{...m}),l.jsx($9,{...m}),l.jsx(W9,{...m}),l.jsx(U9,{...m}),l.jsx(Mt,{}),l.jsx(Bf,{...m}),l.jsx(Kf,{command:n.getCommand("formatCellStyle"),...m}),l.jsx(Qf,{command:n.getCommand("formatTableStyle"),...m}),l.jsx(Mt,{}),l.jsx(d5,{...m}),l.jsx(u5,{...m}),l.jsx(Mt,{}),l.jsx(Nf,{...m}),null,l.jsx(c5,{...m}),l.jsx(p5,{...m}),x,y]})},[n,a]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),xj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsxs(Gl,{parentFloat:o,children:[null,l.jsx(je,{...c,command:n.getCommand("updateHyperlink"),icon:xe(l.jsx(Eu,{}))}),l.jsx(je,{...c,command:n.getCommand("updateComments"),icon:xe(l.jsx(_u,{}))}),l.jsx(f5,{...u}),l.jsx(je,{...c,command:n.getCommand("insertTable"),icon:xe(l.jsx(Al,{}))})]})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),yj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsxs(Gl,{parentFloat:o,children:[l.jsx(Pf,{...u}),l.jsx(je,{...c,command:n.getCommand("protectionSheetToggle"),icon:l.jsx(gn.Lock,{color:"secondary"})}),l.jsx(Mt,{}),l.jsx(Vf,{...u}),l.jsx(qf,{...u}),l.jsx(Mt,{}),l.jsx(je,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:l.jsx(ma,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),l.jsx(je,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:l.jsx(ma,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),l.jsx(Mt,{}),l.jsx(Zf,{...u}),l.jsx(og,{command:n.getCommand("selectTheme"),...u}),l.jsx(Mt,{}),l.jsx(M5,{...u,scope:"view"}),l.jsx(Mt,{}),l.jsx(je,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>xe(n.getCommand("fullScreenToggle").state()?l.jsx(qw,{}):l.jsx(Uw,{}))})]})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_g=e=>l.jsx(Sj,{...e}),bj=s.memo(e=>{const{sx:t,...n}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${dt.alpha(o.palette.primary.main,.35)} solid 2px`}},children:[l.jsx(B.Tab,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),l.jsx(B.Box,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),wj=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,a=s.useMemo(()=>{const d=[];for(let c=0;c<t.length;c++)d.push(l.jsx(bj,{label:t[c].label},t[c].label));return d},[t]);return l.jsx(B.Tabs,{value:n,onChange:(d,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:d=>d.spacing(1.5),paddingRight:d=>d.spacing(1.5),paddingTop:d=>d.spacing(0),paddingBottom:d=>d.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:d=>d.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:l.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:a})}),vj=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,a=s.useCallback(c=>{o?.(c.target.value)},[o]),d=s.useMemo(()=>{const c=[];for(let u=0;u<t.length;u++){const p=t[u].label;c.push(l.jsx(B.MenuItem,{value:u,sx:{color:m=>{if(n===u)return m.palette.primary.main}},children:p},p))}return c},[t,n]);return l.jsx(B.FormControl,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:l.jsx(B.Select,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},...i,children:d})})}),Sj=s.memo(s.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:a,toolbarsProps:d,paletteProps:c={},workbook:u,sx:p,...m}=e,h=s.useMemo(()=>{const E=[],{ref:M,...T}=d?.Home||{};E.push({label:"Home",component:l.jsx(gj,{commands:n,...T})});const{ref:F,..._}=d?.Insert||{};E.push({label:"Insert",component:l.jsx(xj,{commands:n,..._})});const{ref:O,...S}=d?.View||{};return E.push({label:"View",component:l.jsx(yj,{commands:n,...S})}),E},[n]),g=s.useMemo(()=>{const E=[];for(let M=0;M<h.length;M++)E.push(s.cloneElement(h[M].component,{...h[M].component.props,key:h[M].key??h[M].label}));return E},[h]),[f,x]=s.useState(0),y=E=>{x(E)},w=s.useMemo(()=>i?l.jsx(vj,{toolbars:h,value:f,onToolbarChange:y,sx:r}):l.jsx(wj,{toolbars:h,value:f,onToolbarChange:y,sx:r}),[h,f,r,i]),{sx:b,...C}=c,k=l.jsx(B.Paper,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,marginLeft:E=>E.spacing(1),marginRight:E=>E.spacing(1),marginTop:E=>E.spacing(.5),marginBottom:E=>E.spacing(.5),...b},...C,children:g[f]});return l.jsxs(B.Box,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:E=>E.spacing(.5),"*":{userSelect:"none"},...p},...m,children:[o?o(w):w,a?a(k):k]})})),Cj=e=>l.jsx(C5,{...e}),kj=e=>l.jsx(k5,{...e}),Ej=e=>l.jsx(S5,{...e}),R5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:a=!1,readOnly:d=!1,contextMenuProps:c,renderContextMenu:u=Cj,sheetsAllProps:p,renderSheetsAll:m=kj,sheetTabProps:h,renderSheetTab:g,background:f="transparent",className:x,notifier:y,sx:w,borderWidth:b,borderColor:C,gridTheme:k,gridStyle:E,...M}=e,[T,F]=s.useState(n?.getSelectedSheetIndex()),[_,O]=s.useState(n?.getSheets().search()),[S,v]=s.useState(n?.getProtection());Gt(n,{onViewChange(J){F(J?.getSelectedSheetIndex())},onSheetsChange:J=>{O(J.getSheets().search())},onProtectionChange:J=>{v(J?.getProtection())}});const D=d||!S.isStructureAllowed(),j=s.useMemo(()=>{const J=[];for(let se=0;se<_.length;se++)J.push(_[se].getName());return J},[_]),R=s.useCallback(J=>{r?.(J)!==!1&&(n.getSheetAt(J).select(),i?.(J))},[n,r,i]),P=s.useCallback((J,se)=>{n.getSheetAt(J).setName(se),i?.(J)},[n,i]),I=s.useCallback((J,se)=>{n.getSheetAt(J).setPosition(se),i?.(se)},[n,i]),L=de(()=>{if(r?.(T)===!1)return;const J=T+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(J)},[n,r,i,T]),H=s.useMemo(()=>({placement:"top-start"}),[]),W=s.useRef(null),[A,U]=s.useState(!1),X=s.useCallback(J=>{const{closeFloatAll:se,floatReference:Se}=J;return m({workbook:n,gridStyle:E,floatReference:Se,closeFloatAll:se,...p})},[m,p,a,n,E]),{reference:ee,component:V}=l0({label:"allSheet",popperProps:H,anchor:W.current,onOpen:()=>U(!0),onClose:()=>U(!1),createPopupPanel:X}),$=s.useRef(null),[z,q]=s.useState(null),G=s.useCallback(J=>{const{floatReference:se}=J;return u?.({workbook:n,index:z?.index,tabStripRef:$.current,commands:o,disabled:a,floatReference:se,...c})},[u,c,a,n,o,z]),{reference:Q,component:Y}=l0({label:"sheetTab",popperProps:H,anchor:{getBoundingClientRect:()=>new DOMRect(z?.left||0,z?.top||0,0,0)},onClose:()=>q(null),createPopupPanel:G});s.useEffect(()=>{z?Q.open(0):Q.close(0)},[z]);const te=s.useCallback((J,se)=>{J.preventDefault(),q({left:J.clientX-2,top:J.clientY-4,index:se})},[]),re=de(J=>{let se;try{se=n?.getSheetAt(J.index)}catch{}return se?(g??Ej)({sheet:se,gridTheme:k,onContextMenu:Se=>{R(J.index),te(Se,J.index)},...J,...h}):null},[g,h,n,k]),ge=s.useMemo(()=>D?null:l.jsx(br,{disableInteractive:!0,title:"New sheet",children:l.jsx(B.IconButton,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:J=>J.palette.primary.main},color:J=>J.palette.text.icon??J.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>L(),children:l.jsx(gn.AddCircleOutline,{})})}),[a,D,L]);return l.jsxs(B.Box,{ref:t,className:Zn(x),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...w},...M,children:[l.jsx(jf,{ref:$,selectedTabIndex:T,tabNames:j,onSelectedTabIndexChange:R,onTabNameChange:P,onTabMove:I,background:f,borderColor:C,borderWidth:b,activeColor:null,disabled:a,disableDrag:D,createScrollStartButton:Pv,createScrollEndButton:Fv,createScrollEdgeButton:Av,createTabButton:re,createTabDivider:J=>{const{key:se,...Se}=J;return l.jsx(Mt,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Me=>dt.alpha(Me.palette.divider,.25)},...Se},se)},editLabelProps:{readOnly:D,maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:J=>{n.isValidSheetNameCharacter(J.key)||J.preventDefault()},onCancel:()=>{i?.(T)},notifier:y},children:l.jsx(br,{disableInteractive:!0,title:A?"":"List all sheets",children:l.jsx(gr,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:J=>J.palette.text.icon??J.palette.action.active},ref:W,dense:!0,outlined:!1,selected:A,color:"primary","aria-label":"menu",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>{A?ee.close(0):ee.open(0)},icon:l.jsx(gn.Menu,{})})})}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,minWidth:"4px"}}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:ge}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:1,minWidth:"24px"}}),Y,V]})}));R5.displayName="WorkbookStrip";const I5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:a,className:d,...c}=e,[u,p]=s.useReducer(v=>v+1,0),[m,h]=s.useState(n.getSelectedSheet()),[g,f]=s.useState(m.getSelectedRanges()),[x,y]=s.useState(m.getSelectedCell());Gt(n,{onSheetsChange(){h(n.getSelectedSheet())}}),Gt(m.getSelection(),{onChange(){f(m.getSelectedRanges()),y(m.getSelectedCell())}}),no(o,[],{onChange:()=>{p()}});const w=s.useMemo(()=>({}),[]),b=s.useMemo(()=>({commandHook:{beforeExecute:(v,D)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),C=s.useMemo(()=>({...w,...b,variant:Ht.Menuitem}),[w,b]),k=s.useMemo(()=>({commands:o,variant:Ht.Menuitem,parentFloat:a,...b}),[o,b,a]),E=[];let M=g.isEntireRows(),T=g.isEntireColumns();g&&(M&&(E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(je,{command:o.getCommand("hideColumns"),...C,icon:xe(l.jsx(jw,{})),key:"context:"+E.length})),E.push(s.createElement(je,{command:o.getCommand("unhideColumns"),...C,icon:xe(l.jsx(Tw,{})),key:"context:"+E.length}))),T&&(E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(je,{command:o.getCommand("hideRows"),...C,icon:xe(l.jsx(Rw,{})),key:"context:"+E.length})),E.push(s.createElement(je,{command:o.getCommand("unhideRows"),...C,icon:xe(l.jsx(Mw,{})),key:"context:"+E.length}))),(M||T)&&E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),M&&E.push(s.createElement(je,{command:o.getCommand("autoFitColumns"),...C,icon:xe(l.jsx(uv,{})),key:"context:"+E.length})),T&&E.push(s.createElement(je,{command:o.getCommand("autoFitRows"),...C,icon:xe(l.jsx(pv,{})),key:"context:"+E.length})));const F=[],_=o.getCommand("formatTableStyle"),O=_?.context()?.table();if(q0(_),!M&&!T){if(F.push(l.jsx(Mt,{orientation:"horizontal"},"contextBefore:"+F.length)),x?.getHyperlink())F.push(s.createElement(i0,{...k,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+F.length,quickCommand:"openHyperlink",icon:v=>v.key()==="openHyperlink"?xe(l.jsx(Eu,{})):null}));else{const v=o.getCommand("updateHyperlink");F.push(s.createElement(je,{command:v,...C,icon:xe(l.jsx(Eu,{})),key:"contextBefore:"+F.length}))}if(x?.getComments())F.push(s.createElement(i0,{...k,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+F.length,quickCommand:"updateComments",icon:v=>v.key()==="updateComments"?xe(l.jsx(_u,{})):null}));else{const v=o.getCommand("updateComments");F.push(s.createElement(je,{command:v,...C,icon:xe(l.jsx(_u,{})),key:"contextBefore:"+F.length}))}O?F.push(s.createElement(i0,{...k,variant:Ht.Menuitem,key:"contextBefore:"+F.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:O,quickCommand:"editTable",icon:v=>(v.key(),xe(l.jsx(Al,{})))})):F.push(s.createElement(je,{command:o.getCommand("insertTable"),...C,icon:xe(l.jsx(Al,{})),key:"context:"+E.length})),F.push(s.createElement(f5,{...k,key:"contextBefore:"+F.length}))}const S=l.jsxs(l.Fragment,{children:[l.jsx(je,{command:o.getCommand("cut"),...C,icon:l.jsx(Bb,{})}),l.jsx(Lc,{command:o.getCommand("copy"),...C}),l.jsx(m5,{command:o.getCommand("paste"),...k,includePasteAllInPopup:!1}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(p5,{...k}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(d5,{commands:o,...k,disableSheet:!0}),l.jsx(u5,{commands:o,...k,disableSheet:!0}),l.jsx(c5,{...k}),F,E]});return l.jsx(B.Box,{ref:t,className:Zn("menu",d),sx:{...i},...c,children:S})}));var cp,dp;I5.displayName="WorkbookContextMenu",function(){if(dp)return cp;dp=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof qi=="object"&&qi&&qi.Object===Object&&qi,a=typeof self=="object"&&self&&self.Object===Object&&self,d=i||a||Function("return this")(),c=Object.prototype.toString,u=Math.max,p=Math.min,m=function(){return d.Date.now()};function h(f){var x=typeof f;return!!f&&(x=="object"||x=="function")}function g(f){if(typeof f=="number")return f;if(function(w){return typeof w=="symbol"||function(b){return!!b&&typeof b=="object"}(w)&&c.call(w)=="[object Symbol]"}(f))return NaN;if(h(f)){var x=typeof f.valueOf=="function"?f.valueOf():f;f=h(x)?x+"":x}if(typeof f!="string")return f===0?f:+f;f=f.replace(e,"");var y=n.test(f);return y||o.test(f)?r(f.slice(2),y?2:8):t.test(f)?NaN:+f}cp=function(f,x,y){var w,b,C,k,E,M,T=0,F=!1,_=!1,O=!0;if(typeof f!="function")throw new TypeError("Expected a function");function S(P){var I=w,L=b;return w=b=void 0,T=P,k=f.apply(L,I)}function v(P){var I=P-M;return M===void 0||I>=x||I<0||_&&P-T>=C}function D(){var P=m();if(v(P))return j(P);E=setTimeout(D,function(I){var L=x-(I-M);return _?p(L,C-(I-T)):L}(P))}function j(P){return E=void 0,O&&w?S(P):(w=b=void 0,k)}function R(){var P=m(),I=v(P);if(w=arguments,b=this,M=P,I){if(E===void 0)return function(L){return T=L,E=setTimeout(D,x),F?S(L):k}(M);if(_)return E=setTimeout(D,x),S(M)}return E===void 0&&(E=setTimeout(D,x)),k}return x=g(x)||0,h(y)&&(F=!!y.leading,C=(_="maxWait"in y)?u(g(y.maxWait)||0,x):C,O="trailing"in y?!!y.trailing:O),R.cancel=function(){E!==void 0&&clearTimeout(E),T=0,w=M=b=E=void 0},R.flush=function(){return E===void 0?k:j(m())},R}}();var up,pp,hp={exports:{}},Ud={};pp||(pp=1,hp.exports=function(){if(up)return Ud;up=1;var e=s,t=typeof Object.is=="function"?Object.is:function(c,u){return c===u&&(c!==0||1/c==1/u)||c!=c&&u!=u},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function a(c){var u=c.getSnapshot;c=c.value;try{var p=u();return!t(c,p)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,u){return u()}:function(c,u){var p=u(),m=n({inst:{value:p,getSnapshot:u}}),h=m[0].inst,g=m[1];return r(function(){h.value=p,h.getSnapshot=u,a(h)&&g({inst:h})},[c,p,u]),o(function(){return a(h)&&g({inst:h}),c(function(){a(h)&&g({inst:h})})},[c]),i(p),p};return Ud.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ud}()),hp.exports;var mp,fp,Qa={exports:{}},Vi={exports:{}},_j=Vi.exports;(function(){if(fp)return Qa.exports;fp=1;for(var e=(mp||(mp=1,function(){var m,h,g,f,x,y;typeof performance<"u"&&performance!==null&&performance.now?Vi.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Vi.exports=function(){return(m()-x)/1e6},h=process.hrtime,m=function(){var w;return 1e9*(w=h())[0]+w[1]},f=m(),y=1e9*process.uptime(),x=f-y):Date.now?(Vi.exports=function(){return Date.now()-g},g=Date.now()):(Vi.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(_j)),Vi.exports),t=typeof window>"u"?qi:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],a=0;!r&&a<n.length;a++)r=t[n[a]+"Request"+o],i=t[n[a]+"Cancel"+o]||t[n[a]+"CancelRequest"+o];if(!r||!i){var d=0,c=0,u=[],p=1e3/60;r=function(m){if(u.length===0){var h=e(),g=Math.max(0,p-(h-d));d=g+h,setTimeout(function(){var f=u.slice(0);u.length=0;for(var x=0;x<f.length;x++)if(!f[x].cancelled)try{f[x].callback(d)}catch(y){setTimeout(function(){throw y},0)}},Math.round(g))}return u.push({handle:++c,callback:m,cancelled:!1}),c},i=function(m){for(var h=0;h<u.length;h++)u[h].handle===m&&(u[h].cancelled=!0)}}Qa.exports=function(m){return r.call(t,m)},Qa.exports.cancel=function(){i.apply(t,arguments)},Qa.exports.polyfill=function(m){m||(m=t),m.requestAnimationFrame=r,m.cancelAnimationFrame=i},Qa.exports})();var t0={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const Tg=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:a,onShowSidebar:d,onNewWorkbook:c=jg}=e,[u,p]=s.useState(t?.getSelectedSheet()),[m,h]=s.useState(t?.getSheets().search()),g=de(d,[d]),f=de(c,[c]),x=s.useMemo(()=>[new ft("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[we.Ctrl,we.Shift]}}),new ft("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[we.Ctrl,we.Shift]}}),new _e("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new _e("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new _e("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new ft("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[we.Ctrl]},{key:"F5",modifiers:[we.Shift]}]}),new ft("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[we.Ctrl]},{key:"H",modifiers:[we.Ctrl,we.Alt]}]}),new ft("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[we.Ctrl]}]}),new ft("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[we.Ctrl,we.Shift]}}),new ft("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new ft("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new ft("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new ft("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new ft("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new _e("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new _e("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new _e("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[we.Shift]},{key:"F1",modifiers:[we.Alt,we.Shift]}]}),new _e("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new _e("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[we.Ctrl]}]}),new _e("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[we.Ctrl]}]}),new _e("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[we.Ctrl,we.Shift]}]}),new _e("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[we.Ctrl,we.Shift]}]}),new _e("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new _e("selectNamed",r,{label:v=>v?.getName()??"Select Named Item",scopedLabels:{namedItem:v=>v?.getName()??"Select"},description:"Select the item."}),new _e("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new _e("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new _e("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new ft("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[we.Alt]}}),new ft("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[we.Ctrl,we.Shift]}}),new ft("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
|
|
88
|
+
>%c SheetXL.moreExamples()`,"color:#ffa726;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;"),Xs=!0;const n=document.getElementById("openEditorLink");n&&n.addEventListener("click",o=>{o.preventDefault(),console.log("openScriptEditor called from console")})})())}catch(n){n instanceof DOMException||console.error(n)}}};var lj=function(){},xg=typeof window<"u",sj=xg?s.useLayoutEffect:s.useEffect,Q8={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const ya=xg&&window.ResizeObserver!==void 0?function(){var e=s.useState(null),t=e[0],n=e[1],o=s.useState(Q8),r=o[0],i=o[1],a=s.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var c=d[0].contentRect,u=c.x,p=c.y,m=c.width,h=c.height,g=c.top,f=c.left,x=c.bottom,y=c.right;i({x:u,y:p,width:m,height:h,top:g,left:f,bottom:x,right:y})}})},[]);return sj(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[lj,Q8]};function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ac.apply(null,arguments)}function E5(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function lc(e,t){return lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lc(e,t)}function yg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,lc(e,t)}function ep(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const tp=!1,bg=s.createContext(null);var wg=function(e){return e.scrollTop},fl="unmounted",oi="exited",ri="entering",Ni="entered",l2="exiting",m0=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,d=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?d?(a=oi,i.appearStatus=ri):a=Ni:a=o.unmountOnExit||o.mountOnEnter?fl:oi,i.state={status:a},i.nextCallback=null,i}yg(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===fl?{status:oi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==ri&&i!==Ni&&(r=ri):i!==ri&&i!==Ni||(r=l2)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===ri){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:uo.findDOMNode(this);i&&wg(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===oi&&this.setState({status:fl})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,d=this.props.nodeRef?[a]:[uo.findDOMNode(this),a],c=d[0],u=d[1],p=this.getTimeouts(),m=a?p.appear:p.enter;!o&&!i||tp?this.safeSetState({status:Ni},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:ri},function(){r.props.onEntering(c,u),r.onTransitionEnd(m,function(){r.safeSetState({status:Ni},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:uo.findDOMNode(this);r&&!tp?(this.props.onExit(a),this.safeSetState({status:l2},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:oi},function(){o.props.onExited(a)})})})):this.safeSetState({status:oi},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:uo.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=d[0],u=d[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===fl)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=E5(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s.createElement(bg.Provider,{value:null},typeof i=="function"?i(o,a):s.cloneElement(s.Children.only(i),a))},t}(s.Component);function Ai(){}m0.contextType=bg,m0.propTypes={},m0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ai,onEntering:Ai,onEntered:Ai,onExit:Ai,onExiting:Ai,onExited:Ai},m0.UNMOUNTED=fl,m0.EXITED=oi,m0.ENTERING=ri,m0.ENTERED=Ni,m0.EXITING=l2;var Vd=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=ep(o.className,r):o.setAttribute("class",ep(o.className&&o.className.baseVal||"",r)));var o,r})},s2=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1];o.removeClasses(p,"exit"),o.addClass(p,m?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(d,c)},o.onEntering=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1]?"appear":"enter";o.addClass(p,m,"active"),o.props.onEntering&&o.props.onEntering(d,c)},o.onEntered=function(d,c){var u=o.resolveArguments(d,c),p=u[0],m=u[1]?"appear":"enter";o.removeClasses(p,m),o.addClass(p,m,"done"),o.props.onEntered&&o.props.onEntered(d,c)},o.onExit=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(d)},o.onExiting=function(d){var c=o.resolveArguments(d)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(d)},o.onExited=function(d){var c=o.resolveArguments(d)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(d)},o.resolveArguments=function(d,c){return o.props.nodeRef?[o.props.nodeRef.current,d]:[d,c]},o.getClassNames=function(d){var c=o.props.classNames,u=typeof c=="string",p=u?(u&&c?c+"-":"")+d:c[d];return{baseClassName:p,activeClassName:u?p+"-active":c[d+"Active"],doneClassName:u?p+"-done":c[d+"Done"]}},o}yg(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var a=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(a+=" "+d),i==="active"&&o&&wg(o),a&&(this.appliedClasses[r][i]=a,function(c,u){c&&u&&u.split(" ").forEach(function(p){return h=p,void((m=c).classList?m.classList.add(h):function(g,f){return g.classList?!!f&&g.classList.contains(f):(" "+(g.className.baseVal||g.className)+" ").indexOf(" "+f+" ")!==-1}(m,h)||(typeof m.className=="string"?m.className=m.className+" "+h:m.setAttribute("class",(m.className&&m.className.baseVal||"")+" "+h)));var m,h})}(o,a))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],a=i.base,d=i.active,c=i.done;this.appliedClasses[r]={},a&&Vd(o,a),d&&Vd(o,d),c&&Vd(o,c)},n.render=function(){var o=this.props;o.classNames;var r=E5(o,["classNames"]);return s.createElement(m0,ac({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.Component);s2.defaultProps={classNames:""},s2.propTypes={};const sc={Light:"light",Dark:"dark"},Hd=.12,c2=(e,t)=>{const n={},o=c=>{const u=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:u,strokeFill:Er(u,Hd,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:Er(n.body.fill,Hd,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:Er(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:Er(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:Er(c?.fill??n.body.fill,.22,e.palette?.mode),fill:Er(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=Er(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:dt.alpha(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:dt.alpha(i,.7)},n.headerSelectAll={...n.headerSelect,fill:dt.alpha(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:Er(r.fill,Hd,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:Er(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:Er(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?dt.alpha(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?dt.alpha(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const a=t??e,d=a.palette.mode==="dark";return n.selection={fill:a.palette?.primary?.main?dt.alpha(a.palette?.primary?.main,.1):void 0,strokeFill:a.palette?.primary?.main},n.selectionInactive={...n.selection,fill:a.palette?.divider?dt.alpha(a.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:dt.alpha(a.palette.warning.light,.05),strokeFill:a.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=dt.alpha(a.palette.action.active,.5),n.colorGrey=a.palette.action.active,n.filterDarkInvert=d?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function _5(e){const{mode:t}=e||{},[n,o]=s.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=np();if(r)return{themeMode:r,source:"class"}}return{themeMode:op(),source:"media"}});return s.useEffect(()=>{const r=()=>{if(t)return void(t===n.themeMode&&n.source==="prop"||o(u=>({...u,themeMode:t,source:"prop"})));const c=np();if(c)o({themeMode:c,source:"class"});else{const u=op();o({themeMode:u,source:"media"})}},i=new MutationObserver(r),a=[document.documentElement,document.body].filter(Boolean);for(const c of a)i.observe(c,{attributes:!0,attributeFilter:["class"]});const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",r),r(),()=>{i.disconnect(),d.removeEventListener("change",r)}},[t]),n}function np(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function op(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Gl=s.memo(s.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=Mo(t,()=>({}),[]),[d,c]=ya(),u=s.useRef(null),p=s.useRef(null),[m,h]=s.useReducer(E=>E+1,0),[g,f]=s.useState(null),[x,y]=s.useState(null),[w,b]=s.useState(null),{reference:C}=l0({parentFloat:r,label:"overflow"});s.useLayoutEffect(()=>{p.current={refs:[]};const E=[],M=s.Children.toArray(n);let T=0;M.forEach((F,_)=>{E.push(l.jsx(B.Box,{sx:{display:"flex"},ref:O=>{T++,T===M.length&&h();const S={current:null};S.current=O,p.current.refs[_]=S},children:F},_))}),f(E)},[n,c]),s.useLayoutEffect(()=>{if(!g)return;const E=p.current.refs;if(!a.current||!E||E.length===0)return y(null),void b(null);const M=a.current?.getBoundingClientRect(),T=[],F=[];let _=0,O=!1;for(let v=0;!O&&v<E.length;v++){const D=E[v];if(!D)continue;if(!D.current){O=!0;continue}const j=D.current.getBoundingClientRect();_+=j?.width,_>M.width&&(O=!0)}if(!O)return y(null),void b([]);const S=u.current?.getBoundingClientRect();_=0;for(let v=0;v<E.length;v++){const D=E[v];let j=!1;if(D.current){const R=D.current.getBoundingClientRect();_+=R?.width,_<M.width-S.width&&(j=!0)}j?T.push(g[v]):F.push(g[v])}y(T.length>0?T:null),b(F.length>0?F:null)},[n,g,c,C,m]);const k=de(E=>{const M=[];for(let F=0;F<w.length;F++){let _=s.Children.toArray(w[F]);const O=_[0];_=s.Children.toArray(O.props.children?.props.children??O.props.children);const S=_[0],v={...S.props};v.parentFloat&&(v.parentFloat=E.floatReference);const D=s.cloneElement(S,v);M.push(D)}const T=l.jsx(B.Box,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:F=>F.spacing(.5),paddingBottom:F=>F.spacing(.5),paddingLeft:F=>F.spacing(1),paddingRight:F=>F.spacing(1),overflow:"hidden"},children:M});return wn({...E,children:T})},[w]);return l.jsxs(B.Box,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:is([a,d,t]),...i,children:[l.jsx(B.Box,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:x??g}),l.jsx(B.Box,{sx:{display:w!==null&&w.length===0?"none":"flex",flex:"1 1 0"},children:l.jsx(Gr,{createPopupPanel:k,ref:u,parentFloat:C,createTooltip:({children:E},M)=>l.jsx(Bo,{label:"More",description:"More toolbar options…",disabled:M,children:E}),icon:l.jsx(Fh,{children:l.jsx(gn.MoreHoriz,{})})})})]})})),vg="https://unpkg.com/@sheetxl/scripting-templates/dist",cj=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./ovadKV9YIel9XeoD.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Crjro8zyw3_OPSdv.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DRXfWFboy9pbnpXC.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],dj=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./ovadKV9YIel9XeoD.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./Crjro8zyw3_OPSdv.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DRXfWFboy9pbnpXC.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class Sg{constructor(t=cj,n=dj){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const a={...o,...o?.typedCreateWorkbookOptions?.[n]};let d;delete a.typedCreateWorkbookOptions;try{d=await i(t,a)}catch(c){throw new Error("Unable to import",{cause:c})}return d}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const a=n;return await this._fromFile(a,t)}case"base64":{let a;if(n&&typeof n=="object"&&"base64"in n)a=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,u]=n.split(",");a=u}else a=n;const d=Cx.base64ToArrayBuffer(a),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(d,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let a,d,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const x=n;c=x.input,a=x.init,d=x.timeout}}const u=d||3e4,p=new AbortController,m=setTimeout(()=>p.abort(),u),h=typeof c=="string"?c:c.toString(),g=r||N.TextUtils.getFileNameExtension(h),f=this.getReadFormatTypeForExt(g)||this._readFormatTypes[0];try{const x=await fetch(c,{...a,signal:p.signal});if(clearTimeout(m),!x.ok)throw new Error(`Failed to fetch: ${x.status} ${x.statusText}`);const y=await x.arrayBuffer();if(!f)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(y,f.key,t),title:o||N.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:f}}catch(x){throw clearTimeout(m),x.name==="AbortError"?new Error(`Fetch timeout after ${u}ms: ${h}`):x}}case"buffer":{const a=n,d=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!d)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(a,d.key,t),title:o||"buffer-file",formatType:d}}case"stream":{const a=n.getReader(),d=[];let c=0;try{for(;;){const{done:g,value:f}=await a.read();if(g)break;d.push(f),c+=f.length}}finally{a.releaseLock()}const u=new ArrayBuffer(c),p=new Uint8Array(u);let m=0;for(const g of d)p.set(g,m),m+=g.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(u,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${N.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt(N.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${N.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const a=await t.arrayBuffer(),d={...n,...n?.typedCreateWorkbookOptions?.[i.key]};delete d.typedCreateWorkbookOptions;const c=i.handler;if(!c)throw new Error(`Unable to resolve handler for type: ${i?.description??N.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await d.onStart?.(r);const u=await c(a,d);o=new uj(t,u,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=N.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const a=this.getWriteFormats(),d=a.length;for(let p=0;!i&&p<d;p++)(a[p].ext===r||!r&&a[p].isDefault)&&(i=a[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let u=null;try{u=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,m)=>{let h;typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer?(h=new ArrayBuffer(m.byteLength),new Uint8Array(h).set(new Uint8Array(m))):h=m,function(g,f){const x=URL.createObjectURL(g),y=document.createElement("a");y.style.display="none",y.href=x,y.download=f,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(x)}(new Blob([h],{type:"application/octet-stream"}),p)})(c,u)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class uj{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const pj=new Sg;var rp,ip,hj=function(){if(ip)return rp;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,a="",d=0,c=-1,u=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&u!==1)if(c!==p-1&&u===2){if(a.length<2||d!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",d=0):d=(a=a.slice(0,m)).length-1-a.lastIndexOf("/"),c=p,u=0;continue}}else if(a.length===2||a.length===1){a="",d=0,c=p,u=0;continue}}r&&(a.length>0?a+="/..":a="..",d=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),d=p-c-1;c=p,u=0}else i===46&&u!==-1?++u:u=-1}return a}ip=1;var n={resolve:function(){for(var o,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var d;a>=0?d=arguments[a]:(o===void 0&&(o=process.cwd()),d=o),e(d),d.length!==0&&(r=d+"/"+r,i=d.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var a=o.length,d=a-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var u=r.length-c,p=d<u?d:u,m=-1,h=0;h<=p;++h){if(h===p){if(u>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else d>p&&(o.charCodeAt(i+h)===47?m=h:h===0&&(m=0));break}var g=o.charCodeAt(i+h);if(g!==r.charCodeAt(c+h))break;g===47&&(m=h)}var f="";for(h=i+m+1;h<=a;++h)h!==a&&o.charCodeAt(h)!==47||(f.length===0?f+="..":f+="/..");return f.length>0?f+r.slice(c+m):(c+=m,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,a=-1,d=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!d){a=c;break}}else d=!1;return a===-1?i?"/":".":i&&a===1?"//":o.slice(0,a)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,a=0,d=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var u=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var m=o.charCodeAt(i);if(m===47){if(!c){a=i+1;break}}else p===-1&&(c=!1,p=i+1),u>=0&&(m===r.charCodeAt(u)?--u===-1&&(d=i):(u=-1,d=p))}return a===d?d=p:d===-1&&(d=o.length),o.slice(a,d)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){a=i+1;break}}else d===-1&&(c=!1,d=i+1);return d===-1?"":o.slice(a,d)},extname:function(o){e(o);for(var r=-1,i=0,a=-1,d=!0,c=0,u=o.length-1;u>=0;--u){var p=o.charCodeAt(u);if(p!==47)a===-1&&(d=!1,a=u+1),p===46?r===-1?r=u:c!==1&&(c=1):r!==-1&&(c=-1);else if(!d){i=u+1;break}}return r===-1||a===-1||c===0||c===1&&r===a-1&&r===i+1?"":o.slice(r,a)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return function(r,i){var a=i.dir||i.root,d=i.base||(i.name||"")+(i.ext||"");return a?a===i.root?a+d:a+"/"+d:d}(0,o)},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,a=o.charCodeAt(0),d=a===47;d?(r.root="/",i=1):i=0;for(var c=-1,u=0,p=-1,m=!0,h=o.length-1,g=0;h>=i;--h)if((a=o.charCodeAt(h))!==47)p===-1&&(m=!1,p=h+1),a===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1);else if(!m){u=h+1;break}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===u+1?p!==-1&&(r.base=r.name=u===0&&d?o.slice(1,p):o.slice(u,p)):(u===0&&d?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(u,c),r.base=o.slice(u,p)),r.ext=o.slice(c,p)),u>0?r.dir=o.slice(0,u-1):d&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,rp=n}();const ap=/^(con|prn|aux|nul|com\d|lpt\d)$/i,lp=/[<>:"/\\|?*\u0000-\u001F]/g,di=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:lp,WINDOW_FILENAME_RESERVED_REGEX:ap,isValidWindowsFilename:e=>!(!e||e.length>255||lp.test(e)||ap.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return hj.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),sp=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:Sg,IOUtils:di,WorkbookIO:pj},Symbol.toStringTag,{value:"Module"})),mj=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},Cg=async e=>{const t=di.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new nu(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new nu(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(a){throw new Error(`Failed to parse directory: ${a.message}. Ensure the file is valid JSON.`)}const i=r.map(async a=>{try{const d=di.relativePath(e,a.path),c=await fetch(d);if(!c.ok)throw new Error(`Failed to fetch file at '${a.path}': ${c.statusText}`);const u=await c.text();let p=a.metadata;return p?.title||(p={title:mj(a),...p}),{path:a.path,content:u,metadata:p}}catch(d){console.error(d.message)}return null});return(await Promise.all(i)).filter(a=>a!==null)},$d={fontSize:"0.8rem",marginRight:"4px"},fj=s.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...a}=e;let d;return d=n.metadata?.icon==="formula"?l.jsx(e9,{sx:$d}):n.metadata?.icon==="macro"?l.jsx(O2,{sx:$d}):l.jsx(gn.WebhookOutlined,{sx:$d}),l.jsx(lr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:d,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==Wt.Enter&&c.keyCode!==Wt.Space||r(n)},...a,children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[l.jsx(B.Typography,{component:"div",children:n.metadata?.title??n.path}),l.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:c=>dt.alpha(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),kg=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:a=vg,...d}=e,[c,u]=s.useState([]),[p,m]=s.useState(!0),h=no(n,["executeSelectedScript"]),g=h[0]?.context?.();s.useEffect(()=>{(async()=>{try{const x=await Cg(a);u(x)}catch{}finally{m(!1)}})()},[a]);const f=s.useCallback((x,y)=>{if(p)return l.jsx("div",{children:"Loading..."});const w={variant:Ht.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=E=>{g.getEditor()?.insertSnippet(E.content),x.closeFloat()},C=[];for(let E=0;E<c.length;E++){const M=c[E];M&&C.push(l.jsx(fj,{handleInsert:b,snippet:M},M.path))}const k=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[C.length>0?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C}),l.jsx(Mt,{orientation:"horizontal"})]}):null,s.createElement(je,{...w,key:"help",command:n.getCommand("help"),icon:xe(l.jsx(Jh,{}))})]});return wn({...x,children:k})},[i,o,r,p,g]);return l.jsx(In,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:f,icon:xe(l.jsx(Lv,{})),...d})})),T5=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[l.jsx("div",{children:l.jsx(Gl,{parentFloat:o,style:{},children:l.jsx(je,{...c,command:n.getCommand("saveScripts"),icon:xe(l.jsx(Ov,{}))})})}),l.jsx("div",{style:{flex:"1 1 100%"}}),l.jsx("div",{children:l.jsx(Gl,{parentFloat:o,style:{},children:l.jsx(kg,{...c,commands:n})})})]})})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));T5.displayName="ScriptEditorToolbar";const Wd={fontSize:"1rem"},Eg=s.memo(s.forwardRef((e,t)=>{const{scriptPath:n=vg,onScriptSelect:o,sx:r=hn.EmptyCssProperties,className:i,buttonMinWidth:a=210,buttonMinHeight:d=80,gap:c=12,...u}=e,[p,m]=s.useState([]),[h,g]=s.useState(!0),[f,x]=s.useState(null);if(s.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{g(!0),x(null);const C=await Cg(n);for(let k=0;k<C.length;k++){const E=C[k];E&&b.push(E)}}catch(C){x(C instanceof Error?C.message:"Failed to load scripts"),C instanceof nu||console.error("Error loading scripts:",C)}finally{m(b),g(!1)}})()},[n]),h)return l.jsx(B.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Zn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...r},...u,children:l.jsx(B.CircularProgress,{})});let y=null;f&&(y=l.jsxs(B.Box,{display:"flex",justifyContent:"center",alignItems:"center",className:Zn(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},...u,children:[l.jsx(B.Typography,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),l.jsx(B.Typography,{color:"error",component:"div",children:f})]}));const w=b=>{const C=b.metadata?.icon;return C==="macro"?l.jsx(O2,{sx:Wd}):C==="formula"?l.jsx(e9,{sx:Wd}):C==="autostart"?l.jsx(gn.WebhookOutlined,{sx:Wd}):null};return l.jsxs(B.Box,{ref:t,className:Zn(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,...r},...u,children:[l.jsxs(B.Box,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[l.jsx(B.Typography,{variant:"h6",gutterBottom:!0,children:"Script Template"}),l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),l.jsx(B.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,C)=>l.jsxs(B.Button,{variant:"outlined",sx:{minWidth:a,minHeight:d,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...C===0&&{borderStyle:"dashed",marginBottom:"8px"},...C===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[l.jsx(B.Typography,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),w(b)]}),b.metadata?.summary&&l.jsx(B.Typography,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${C}`))})]}),y]})}));Eg.displayName="TemplateSelectPanel";const j5=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:a=!1,onClose:d,autoFocusSel:c,autoFocus:u=!0,scripts:p,...m}=e,h=Pr(),[g,f]=s.useState(!1),x=s.useRef(!1),[y,w]=s.useState({message:"Loading",cursor:"",dirty:!1}),[b,C]=s.useState(null);s.useEffect(()=>{let L=!1;return C(null),async function(){if(p&&(await p.start(),!L)){const H=p.getModules().search()[0]?.getSource();C({source:H||null})}}(),()=>{L=!0}},[p]);const k=s.useCallback(L=>{w(H=>({...H,...L}))},[]),E=s.useRef(null),M=s.useRef(null),[T,F]=s.useState(null),_=s.useRef(null),O=de(L=>{if(T)return T.focus(L),!0;if(c){const H=M.current?.querySelectorAll?.(c);if(H&&H.length>0)return H[0]?.focus?.(L),!0}return M.current?.focus?.(L),!1},[T,c,u]),S=s.useMemo(()=>l.jsx(Z0,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),v=s.useMemo(()=>l.jsx(B.Paper,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,marginLeft:L=>L.spacing(.5),marginRight:L=>L.spacing(.5),marginTop:L=>L.spacing(1),marginBottom:L=>L.spacing(1)},children:l.jsx(T5,{commands:i})}),[h,i]),D=s.useMemo(()=>l.jsx(B.Box,{className:Zn("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:l.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:L=>L.palette.text.secondary},variant:"caption",children:y.message}),l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:L=>L.palette.text.secondary},variant:"caption",children:y.dirty?"Unsaved":""}),l.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:L=>L.palette.text.secondary},variant:"caption",children:y.cursor})]})}),[y]),j=s.useMemo(()=>l.jsxs(B.Box,{className:Zn("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[v,l.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:l.jsx($T,{ref:M,loadingPanel:S,readOnly:a,onClose:d,autoFocus:u,commands:i,onStatusChange:k,darkMode:h.palette.mode==="dark",...r})}),D]}),[h,i,v,D,g,S,a,r,u,c,d,k]),R=s.useMemo(()=>l.jsx(B.DialogTitle,{className:Zn({"Mui-selected":x.current}),sx:{display:"flex",color:L=>L.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:L=>`${L.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:L=>L.transitions.duration.shortest/2+"ms"},backgroundColor:L=>dt.alpha(L.palette.action.hover,.03),borderBottom:L=>`solid ${dt.alpha(L.palette.divider,.2)} 1px`},onPointerDown:L=>{L.isDefaultPrevented()||(L.preventDefault(),O())},children:l.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:L=>L.spacing(.25),marginBottom:L=>L.spacing(.25),marginLeft:L=>L.spacing(1),marginRight:L=>L.spacing(1)},children:[l.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:L=>L.spacing(1)},children:"Script (Typescript)"}),l.jsx(Bo,{label:"Close",children:l.jsx(B.IconButton,{"aria-label":"close",sx:{color:L=>L.palette.text.icon??L.palette.action.active},touchRippleRef:E,onPointerDown:L=>{E.current?.start(L,{center:!1}),L.stopPropagation(),L.preventDefault()},onPointerUp:()=>{M.current?.close()},children:l.jsx(gn.Close,{})})})]})}),[h,g]),P=s.useMemo(()=>{let L;return b===null?null:(b.source===null&&(L=l.jsx(Eg,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:H=>{M.current?.getEditor().insertSnippet(H.content),C({source:H.content??""})}})),l.jsxs(B.Box,{tabIndex:0,className:Zn("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},onPointerDown:H=>{H.isDefaultPrevented()||M.current?.focus()},children:[R,l.jsxs(B.Box,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[j,L]})]}))},[v,j,n,b]),I=Mo(t,()=>({isScriptWorkspaceElement:()=>!0,focus:L=>{O(L)}}),[]);return l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:I,...m,onFocus:L=>{f(!0),x.current=!0,I.current?.contains(L.target)&&L.target!==I.current&&F(L.target),L.relatedTarget&&!_.current&&(_.current=L.relatedTarget),m?.onFocus?.(L)},onBlur:L=>{I?.current?.contains(L.relatedTarget)||I?.current===L.relatedTarget||(_.current=null,x.current=!1,f(!1)),m?.onBlur?.(L)},children:P})}));j5.displayName="ScriptWorkspace";const M5=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,d=no(n,["executeScript"])[0].context();no(n,["showScriptEditor"]);const c=s.useCallback((u,p)=>{const m={variant:Ht.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=d?.getScripts(),g=h?.searchFunction({type:"macro"}),f=[];if(g)for(let y=0;y<g.length;y++){const w=g[y];f.push(l.jsx(je,{...m,command:p.getCommand("executeScript"),commandState:{declaration:w},tooltipProps:{description:`Execute ${w.getName()??"script"}`},icon:xe(l.jsx(O2,{})),label:w.getName()??`Script '${w.getName()}'`},`script-${w.getName()}-${y}`))}const x=l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[f.length>0?l.jsxs(l.Fragment,{children:[l.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:f}),l.jsx(Mt,{orientation:"horizontal"})]}):null,s.createElement(je,{...m,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:xe(l.jsx(Ev,{}))})]});return wn({...u,children:x})},[i,d,o,r]);return l.jsx(In,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:xe(l.jsx(Dv,{})),...a})})),gj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=no(n,["executeScript","showScriptEditor"]),d=a[0]?.context?.(),c=s.useCallback(u=>{const{commandButtonProps:p,commandPopupProps:m}=u,h=l.jsx(xa,{...m,command:n.getCommand("formatFontColor"),icon:l.jsx(_b,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=l.jsx(xa,{...m,command:n.getCommand("formatFillColor"),icon:l.jsx(Eb,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:ra.End}}),f=n.getCommand("undo")?l.jsx(l.Fragment,{children:l.jsx(h5,{...m,quickCommand:"undo"})}):null,x=n.getCommand("find")?l.jsx(l.Fragment,{children:l.jsx(Ff,{...m})}):null;let y=null;const w=d?.getScripts();if(a[1]?.state?.()||w){let b=a[1]?.state?.();const C=w?.searchFunction({type:"macro"});for(let k=0;C&&!b&&k<C?.length;k++)b=!0;b&&(y=l.jsxs(l.Fragment,{children:[l.jsx(Mt,{}),l.jsx(M5,{...m})]}))}return l.jsxs(Gl,{parentFloat:o,children:[f,null,f?l.jsx(Mt,{}):null,l.jsx(m5,{...m,command:n.getCommand("paste")}),l.jsx(je,{...p,command:n.getCommand("formatPainterToggle"),icon:xe(l.jsx(Aw,{}))}),l.jsx(Lc,{...p,command:n.getCommand("copy")}),l.jsx(Mt,{}),l.jsx($f,{...m,command:n.getCommand("formatFontFamily")}),l.jsx(zf,{...m,command:n.getCommand("formatFontSize")}),l.jsx(je,{...p,command:n.getCommand("formatBoldToggle"),icon:l.jsx(Iy,{})}),l.jsx(je,{...p,command:n.getCommand("formatItalicToggle"),icon:l.jsx(Ry,{})}),l.jsx(Uf,{...m}),l.jsx(Wf,{...m}),h,l.jsx(Mt,{}),g,l.jsx(Of,{...m}),l.jsx(Af,{...m}),l.jsx(Mt,{}),l.jsx(H9,{...m}),l.jsx($9,{...m}),l.jsx(W9,{...m}),l.jsx(U9,{...m}),l.jsx(Mt,{}),l.jsx(Bf,{...m}),l.jsx(Kf,{command:n.getCommand("formatCellStyle"),...m}),l.jsx(Qf,{command:n.getCommand("formatTableStyle"),...m}),l.jsx(Mt,{}),l.jsx(d5,{...m}),l.jsx(u5,{...m}),l.jsx(Mt,{}),l.jsx(Nf,{...m}),null,l.jsx(c5,{...m}),l.jsx(p5,{...m}),x,y]})},[n,a]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),xj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsxs(Gl,{parentFloat:o,children:[null,l.jsx(je,{...c,command:n.getCommand("updateHyperlink"),icon:xe(l.jsx(Eu,{}))}),l.jsx(je,{...c,command:n.getCommand("updateComments"),icon:xe(l.jsx(_u,{}))}),l.jsx(f5,{...u}),l.jsx(je,{...c,command:n.getCommand("insertTable"),icon:xe(l.jsx(Al,{}))})]})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),yj=s.memo(s.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=de(d=>{const{commandButtonProps:c,commandPopupProps:u}=d;return l.jsxs(Gl,{parentFloat:o,children:[l.jsx(Pf,{...u}),l.jsx(je,{...c,command:n.getCommand("protectionSheetToggle"),icon:l.jsx(gn.Lock,{color:"secondary"})}),l.jsx(Mt,{}),l.jsx(Vf,{...u}),l.jsx(qf,{...u}),l.jsx(Mt,{}),l.jsx(je,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:l.jsx(ma,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),l.jsx(je,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:l.jsx(ma,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),l.jsx(Mt,{}),l.jsx(Zf,{...u}),l.jsx(og,{command:n.getCommand("selectTheme"),...u}),l.jsx(Mt,{}),l.jsx(M5,{...u,scope:"view"}),l.jsx(Mt,{}),l.jsx(je,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>xe(n.getCommand("fullScreenToggle").state()?l.jsx(qw,{}):l.jsx(Uw,{}))})]})},[n]);return l.jsx(es,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_g=e=>l.jsx(Sj,{...e}),bj=s.memo(e=>{const{sx:t,...n}=e;return l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${dt.alpha(o.palette.primary.main,.35)} solid 2px`}},children:[l.jsx(B.Tab,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),l.jsx(B.Box,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),wj=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,a=s.useMemo(()=>{const d=[];for(let c=0;c<t.length;c++)d.push(l.jsx(bj,{label:t[c].label},t[c].label));return d},[t]);return l.jsx(B.Tabs,{value:n,onChange:(d,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:d=>d.spacing(1.5),paddingRight:d=>d.spacing(1.5),paddingTop:d=>d.spacing(0),paddingBottom:d=>d.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:d=>d.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:l.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:a})}),vj=s.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,a=s.useCallback(c=>{o?.(c.target.value)},[o]),d=s.useMemo(()=>{const c=[];for(let u=0;u<t.length;u++){const p=t[u].label;c.push(l.jsx(B.MenuItem,{value:u,sx:{color:m=>{if(n===u)return m.palette.primary.main}},children:p},p))}return c},[t,n]);return l.jsx(B.FormControl,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:l.jsx(B.Select,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`},...i,children:d})})}),Sj=s.memo(s.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:a,toolbarsProps:d,paletteProps:c={},workbook:u,sx:p,...m}=e,h=s.useMemo(()=>{const E=[],{ref:M,...T}=d?.Home||{};E.push({label:"Home",component:l.jsx(gj,{commands:n,...T})});const{ref:F,..._}=d?.Insert||{};E.push({label:"Insert",component:l.jsx(xj,{commands:n,..._})});const{ref:O,...S}=d?.View||{};return E.push({label:"View",component:l.jsx(yj,{commands:n,...S})}),E},[n]),g=s.useMemo(()=>{const E=[];for(let M=0;M<h.length;M++)E.push(s.cloneElement(h[M].component,{...h[M].component.props,key:h[M].key??h[M].label}));return E},[h]),[f,x]=s.useState(0),y=E=>{x(E)},w=s.useMemo(()=>i?l.jsx(vj,{toolbars:h,value:f,onToolbarChange:y,sx:r}):l.jsx(wj,{toolbars:h,value:f,onToolbarChange:y,sx:r}),[h,f,r,i]),{sx:b,...C}=c,k=l.jsx(B.Paper,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`,marginLeft:E=>E.spacing(1),marginRight:E=>E.spacing(1),marginTop:E=>E.spacing(.5),marginBottom:E=>E.spacing(.5),...b},...C,children:g[f]});return l.jsxs(B.Box,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:E=>E.spacing(.5),"*":{userSelect:"none"},...p},...m,children:[o?o(w):w,a?a(k):k]})})),Cj=e=>l.jsx(C5,{...e}),kj=e=>l.jsx(k5,{...e}),Ej=e=>l.jsx(S5,{...e}),R5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:a=!1,readOnly:d=!1,contextMenuProps:c,renderContextMenu:u=Cj,sheetsAllProps:p,renderSheetsAll:m=kj,sheetTabProps:h,renderSheetTab:g,background:f="transparent",className:x,notifier:y,sx:w,borderWidth:b,borderColor:C,gridTheme:k,gridStyle:E,...M}=e,[T,F]=s.useState(n?.getSelectedSheetIndex()),[_,O]=s.useState(n?.getSheets().search()),[S,v]=s.useState(n?.getProtection());Gt(n,{onViewChange(J){F(J?.getSelectedSheetIndex())},onSheetsChange:J=>{O(J.getSheets().search())},onProtectionChange:J=>{v(J?.getProtection())}});const D=d||!S.isStructureAllowed(),j=s.useMemo(()=>{const J=[];for(let se=0;se<_.length;se++)J.push(_[se].getName());return J},[_]),R=s.useCallback(J=>{r?.(J)!==!1&&(n.getSheetAt(J).select(),i?.(J))},[n,r,i]),P=s.useCallback((J,se)=>{n.getSheetAt(J).setName(se),i?.(J)},[n,i]),I=s.useCallback((J,se)=>{n.getSheetAt(J).setPosition(se),i?.(se)},[n,i]),L=de(()=>{if(r?.(T)===!1)return;const J=T+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(J)},[n,r,i,T]),H=s.useMemo(()=>({placement:"top-start"}),[]),W=s.useRef(null),[A,U]=s.useState(!1),X=s.useCallback(J=>{const{closeFloatAll:se,floatReference:Se}=J;return m({workbook:n,gridStyle:E,floatReference:Se,closeFloatAll:se,...p})},[m,p,a,n,E]),{reference:ee,component:V}=l0({label:"allSheet",popperProps:H,anchor:W.current,onOpen:()=>U(!0),onClose:()=>U(!1),createPopupPanel:X}),$=s.useRef(null),[z,q]=s.useState(null),G=s.useCallback(J=>{const{floatReference:se}=J;return u?.({workbook:n,index:z?.index,tabStripRef:$.current,commands:o,disabled:a,floatReference:se,...c})},[u,c,a,n,o,z]),{reference:Q,component:Y}=l0({label:"sheetTab",popperProps:H,anchor:{getBoundingClientRect:()=>new DOMRect(z?.left||0,z?.top||0,0,0)},onClose:()=>q(null),createPopupPanel:G});s.useEffect(()=>{z?Q.open(0):Q.close(0)},[z]);const te=s.useCallback((J,se)=>{J.preventDefault(),q({left:J.clientX-2,top:J.clientY-4,index:se})},[]),re=de(J=>{let se;try{se=n?.getSheetAt(J.index)}catch{}return se?(g??Ej)({sheet:se,gridTheme:k,onContextMenu:Se=>{R(J.index),te(Se,J.index)},...J,...h}):null},[g,h,n,k]),ge=s.useMemo(()=>D?null:l.jsx(br,{disableInteractive:!0,title:"New sheet",children:l.jsx(B.IconButton,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:J=>J.palette.primary.main},color:J=>J.palette.text.icon??J.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>L(),children:l.jsx(gn.AddCircleOutline,{})})}),[a,D,L]);return l.jsxs(B.Box,{ref:t,className:Zn(x),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...w},...M,children:[l.jsx(jf,{ref:$,selectedTabIndex:T,tabNames:j,onSelectedTabIndexChange:R,onTabNameChange:P,onTabMove:I,background:f,borderColor:C,borderWidth:b,activeColor:null,disabled:a,disableDrag:D,createScrollStartButton:Pv,createScrollEndButton:Fv,createScrollEdgeButton:Av,createTabButton:re,createTabDivider:J=>{const{key:se,...Se}=J;return l.jsx(Mt,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Me=>dt.alpha(Me.palette.divider,.25)},...Se},se)},editLabelProps:{readOnly:D,maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:J=>{n.isValidSheetNameCharacter(J.key)||J.preventDefault()},onCancel:()=>{i?.(T)},notifier:y},children:l.jsx(br,{disableInteractive:!0,title:A?"":"List all sheets",children:l.jsx(gr,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:J=>J.palette.text.icon??J.palette.action.active},ref:W,dense:!0,outlined:!1,selected:A,color:"primary","aria-label":"menu",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>{A?ee.close(0):ee.open(0)},icon:l.jsx(gn.Menu,{})})})}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,minWidth:"4px"}}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:ge}),l.jsx("div",{style:{borderTop:`solid ${C} ${b}px`,flex:1,minWidth:"24px"}}),Y,V]})}));R5.displayName="WorkbookStrip";const I5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:a,className:d,...c}=e,[u,p]=s.useReducer(v=>v+1,0),[m,h]=s.useState(n.getSelectedSheet()),[g,f]=s.useState(m.getSelectedRanges()),[x,y]=s.useState(m.getSelectedCell());Gt(n,{onSheetsChange(){h(n.getSelectedSheet())}}),Gt(m.getSelection(),{onChange(){f(m.getSelectedRanges()),y(m.getSelectedCell())}}),no(o,[],{onChange:()=>{p()}});const w=s.useMemo(()=>({}),[]),b=s.useMemo(()=>({commandHook:{beforeExecute:(v,D)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),C=s.useMemo(()=>({...w,...b,variant:Ht.Menuitem}),[w,b]),k=s.useMemo(()=>({commands:o,variant:Ht.Menuitem,parentFloat:a,...b}),[o,b,a]),E=[];let M=g.isEntireRows(),T=g.isEntireColumns();g&&(M&&(E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(je,{command:o.getCommand("hideColumns"),...C,icon:xe(l.jsx(jw,{})),key:"context:"+E.length})),E.push(s.createElement(je,{command:o.getCommand("unhideColumns"),...C,icon:xe(l.jsx(Tw,{})),key:"context:"+E.length}))),T&&(E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),E.push(s.createElement(je,{command:o.getCommand("hideRows"),...C,icon:xe(l.jsx(Rw,{})),key:"context:"+E.length})),E.push(s.createElement(je,{command:o.getCommand("unhideRows"),...C,icon:xe(l.jsx(Mw,{})),key:"context:"+E.length}))),(M||T)&&E.push(l.jsx(Mt,{orientation:"horizontal"},"context:"+E.length)),M&&E.push(s.createElement(je,{command:o.getCommand("autoFitColumns"),...C,icon:xe(l.jsx(uv,{})),key:"context:"+E.length})),T&&E.push(s.createElement(je,{command:o.getCommand("autoFitRows"),...C,icon:xe(l.jsx(pv,{})),key:"context:"+E.length})));const F=[],_=o.getCommand("formatTableStyle"),O=_?.context()?.table();if(q0(_),!M&&!T){if(F.push(l.jsx(Mt,{orientation:"horizontal"},"contextBefore:"+F.length)),x?.getHyperlink())F.push(s.createElement(i0,{...k,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+F.length,quickCommand:"openHyperlink",icon:v=>v.key()==="openHyperlink"?xe(l.jsx(Eu,{})):null}));else{const v=o.getCommand("updateHyperlink");F.push(s.createElement(je,{command:v,...C,icon:xe(l.jsx(Eu,{})),key:"contextBefore:"+F.length}))}if(x?.getComments())F.push(s.createElement(i0,{...k,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+F.length,quickCommand:"updateComments",icon:v=>v.key()==="updateComments"?xe(l.jsx(_u,{})):null}));else{const v=o.getCommand("updateComments");F.push(s.createElement(je,{command:v,...C,icon:xe(l.jsx(_u,{})),key:"contextBefore:"+F.length}))}O?F.push(s.createElement(i0,{...k,variant:Ht.Menuitem,key:"contextBefore:"+F.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:O,quickCommand:"editTable",icon:v=>(v.key(),xe(l.jsx(Al,{})))})):F.push(s.createElement(je,{command:o.getCommand("insertTable"),...C,icon:xe(l.jsx(Al,{})),key:"context:"+E.length})),F.push(s.createElement(f5,{...k,key:"contextBefore:"+F.length}))}const S=l.jsxs(l.Fragment,{children:[l.jsx(je,{command:o.getCommand("cut"),...C,icon:l.jsx(Bb,{})}),l.jsx(Lc,{command:o.getCommand("copy"),...C}),l.jsx(m5,{command:o.getCommand("paste"),...k,includePasteAllInPopup:!1}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(p5,{...k}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(d5,{commands:o,...k,disableSheet:!0}),l.jsx(u5,{commands:o,...k,disableSheet:!0}),l.jsx(c5,{...k}),F,E]});return l.jsx(B.Box,{ref:t,className:Zn("menu",d),sx:{...i},...c,children:S})}));var cp,dp;I5.displayName="WorkbookContextMenu",function(){if(dp)return cp;dp=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof qi=="object"&&qi&&qi.Object===Object&&qi,a=typeof self=="object"&&self&&self.Object===Object&&self,d=i||a||Function("return this")(),c=Object.prototype.toString,u=Math.max,p=Math.min,m=function(){return d.Date.now()};function h(f){var x=typeof f;return!!f&&(x=="object"||x=="function")}function g(f){if(typeof f=="number")return f;if(function(w){return typeof w=="symbol"||function(b){return!!b&&typeof b=="object"}(w)&&c.call(w)=="[object Symbol]"}(f))return NaN;if(h(f)){var x=typeof f.valueOf=="function"?f.valueOf():f;f=h(x)?x+"":x}if(typeof f!="string")return f===0?f:+f;f=f.replace(e,"");var y=n.test(f);return y||o.test(f)?r(f.slice(2),y?2:8):t.test(f)?NaN:+f}cp=function(f,x,y){var w,b,C,k,E,M,T=0,F=!1,_=!1,O=!0;if(typeof f!="function")throw new TypeError("Expected a function");function S(P){var I=w,L=b;return w=b=void 0,T=P,k=f.apply(L,I)}function v(P){var I=P-M;return M===void 0||I>=x||I<0||_&&P-T>=C}function D(){var P=m();if(v(P))return j(P);E=setTimeout(D,function(I){var L=x-(I-M);return _?p(L,C-(I-T)):L}(P))}function j(P){return E=void 0,O&&w?S(P):(w=b=void 0,k)}function R(){var P=m(),I=v(P);if(w=arguments,b=this,M=P,I){if(E===void 0)return function(L){return T=L,E=setTimeout(D,x),F?S(L):k}(M);if(_)return E=setTimeout(D,x),S(M)}return E===void 0&&(E=setTimeout(D,x)),k}return x=g(x)||0,h(y)&&(F=!!y.leading,C=(_="maxWait"in y)?u(g(y.maxWait)||0,x):C,O="trailing"in y?!!y.trailing:O),R.cancel=function(){E!==void 0&&clearTimeout(E),T=0,w=M=b=E=void 0},R.flush=function(){return E===void 0?k:j(m())},R}}();var up,pp,hp={exports:{}},Ud={};pp||(pp=1,hp.exports=function(){if(up)return Ud;up=1;var e=s,t=typeof Object.is=="function"?Object.is:function(c,u){return c===u&&(c!==0||1/c==1/u)||c!=c&&u!=u},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function a(c){var u=c.getSnapshot;c=c.value;try{var p=u();return!t(c,p)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,u){return u()}:function(c,u){var p=u(),m=n({inst:{value:p,getSnapshot:u}}),h=m[0].inst,g=m[1];return r(function(){h.value=p,h.getSnapshot=u,a(h)&&g({inst:h})},[c,p,u]),o(function(){return a(h)&&g({inst:h}),c(function(){a(h)&&g({inst:h})})},[c]),i(p),p};return Ud.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ud}()),hp.exports;var mp,fp,Qa={exports:{}},Vi={exports:{}},_j=Vi.exports;(function(){if(fp)return Qa.exports;fp=1;for(var e=(mp||(mp=1,function(){var m,h,g,f,x,y;typeof performance<"u"&&performance!==null&&performance.now?Vi.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Vi.exports=function(){return(m()-x)/1e6},h=process.hrtime,m=function(){var w;return 1e9*(w=h())[0]+w[1]},f=m(),y=1e9*process.uptime(),x=f-y):Date.now?(Vi.exports=function(){return Date.now()-g},g=Date.now()):(Vi.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(_j)),Vi.exports),t=typeof window>"u"?qi:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],a=0;!r&&a<n.length;a++)r=t[n[a]+"Request"+o],i=t[n[a]+"Cancel"+o]||t[n[a]+"CancelRequest"+o];if(!r||!i){var d=0,c=0,u=[],p=1e3/60;r=function(m){if(u.length===0){var h=e(),g=Math.max(0,p-(h-d));d=g+h,setTimeout(function(){var f=u.slice(0);u.length=0;for(var x=0;x<f.length;x++)if(!f[x].cancelled)try{f[x].callback(d)}catch(y){setTimeout(function(){throw y},0)}},Math.round(g))}return u.push({handle:++c,callback:m,cancelled:!1}),c},i=function(m){for(var h=0;h<u.length;h++)u[h].handle===m&&(u[h].cancelled=!0)}}Qa.exports=function(m){return r.call(t,m)},Qa.exports.cancel=function(){i.apply(t,arguments)},Qa.exports.polyfill=function(m){m||(m=t),m.requestAnimationFrame=r,m.cancelAnimationFrame=i},Qa.exports})();var t0={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const Tg=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:a,onShowSidebar:d,onNewWorkbook:c=jg}=e,[u,p]=s.useState(t?.getSelectedSheet()),[m,h]=s.useState(t?.getSheets().search()),g=de(d,[d]),f=de(c,[c]),x=s.useMemo(()=>[new ft("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[we.Ctrl,we.Shift]}}),new ft("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[we.Ctrl,we.Shift]}}),new _e("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new _e("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new _e("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new ft("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[we.Ctrl]},{key:"F5",modifiers:[we.Shift]}]}),new ft("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[we.Ctrl]},{key:"H",modifiers:[we.Ctrl,we.Alt]}]}),new ft("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[we.Ctrl]}]}),new ft("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[we.Ctrl,we.Shift]}}),new ft("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new ft("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new ft("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new ft("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new ft("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new _e("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new _e("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new _e("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[we.Shift]},{key:"F1",modifiers:[we.Alt,we.Shift]}]}),new _e("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new _e("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[we.Ctrl]}]}),new _e("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[we.Ctrl]}]}),new _e("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[we.Ctrl,we.Shift]}]}),new _e("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[we.Ctrl,we.Shift]}]}),new _e("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new _e("selectNamed",r,{label:v=>v?.getName()??"Select Named Item",scopedLabels:{namedItem:v=>v?.getName()??"Select"},description:"Select the item."}),new _e("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new _e("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new _e("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new ft("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[we.Alt]}}),new ft("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[we.Ctrl,we.Shift]}}),new ft("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
|
|
89
89
|
|
|
90
90
|
Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[we.Ctrl]}}),new _e("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new _e("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[we.Alt]}]},function(v=!0){g?.()}),new _e("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new _e("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new _e("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new _e("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[we.Ctrl]}}),new _e("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new _e("calculateAll",r,{label:"Calculate Now",description:"Recalculate all formulas.",shortcut:{key:"F9"}}),new ft("calculate",r,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[we.Ctrl]}}),new ft("closeWorkbook",r,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[we.Ctrl]}}),new ft("newWorkbook",r,{label:"New Workbook",description:"Create a new workbook in another tab.",shortcut:{key:"N",modifiers:[we.Ctrl]}})],[]),y=s.useMemo(()=>{let v=null;return v=i?i.createChildGroup(r,"workbook",!1):new Ei(r,"workbook"),v.addCommands(x,!0),v},[i,x]),w=qr(),b=s.useRef(null),C=de(()=>{let v,D=null;const j=y.getCommand("executeScript");if(j.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!j)return;const R=y.getCommand("executeSelectedScript");if(!R)return;const P={saveSource:async I=>{let L=null,H=null;const W=t.getScripts();try{I&&(H=await o?.showBusy?.("Saving Scripts..."),L=await W.createModule({source:I})),W.addModule("scripts",L,{replace:!0}),H?.()}catch(A){H?.(),console.warn("Unable to compile",A),o?.showError?.(A)}return L},addContainerListener:I=>(k.current=I,()=>{k.current=null}),setSelectedFunction:I=>{v=I??b.current??null,Promise.resolve(v).then(L=>{R.update({disabled:L===null})})},quickInsertFunction:I=>{const L=`=${I.toUpperCase()}(`,H={text:L+")",editMode:!0,initialSelection:{start:L.length,end:L.length+0}};w.setMode(W=>W?.key==="edit"?{...W,args:{...W.args}}:{key:"edit",args:{stateAndCoords:null,start:H}})},getSelectedFunction:()=>v,setEditor:I=>{D=I??null,y.getCommand("showScriptEditor")?.update({state:I!==null})},getEditor:()=>D,getRanges:I=>{try{return t.getRanges(I)}catch{}return null},getScripts:()=>t.getScripts(),isReadOnly:()=>t.getProtection().isStructureAllowed()===!1};R.update({context:P})},[y,t,n,o]),k=s.useRef(null);Gt(t,{onBeforeSave:async()=>{await k.current?.onBeforeSave()},onProtectionChange:()=>{k.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),k.current?.onScriptChange()))()}}),Gt(t,{onSheetsChange:v=>{h(v.getSheets().search())},onViewChange(v){p(v?.getSelectedSheet())},onProtectionChange:v=>{const D={disabled:!v.getProtection().isStructureAllowed()};y.getCommand("hideSheet").update(D),y.getCommand("deleteSheet").update(D),y.getCommand("addSheet").update(D),y.getCommand("duplicateSheet").update(D),y.getCommand("selectTheme").update(D),y.getCommand("addNamedReference").update(D),y.getCommand("editNamedReference").update(D),y.getCommand("deleteNamedReference").update(D)},onScriptsChange:v=>{C()}});const{isFullscreenAvailable:E,isFullscreenEnabled:M,toggleFullscreen:T}=function(v={}){const{target:D,onChange:j,onError:R,requestFullScreenOptions:P}=v,[I,L]=s.useState(!1),[H,W]=s.useState(null),[A,U]=s.useState(!1),X=s.useCallback(()=>t0.requestFullscreen(D?.current||null,P),[D,P]),ee=s.useCallback(()=>t0.exitFullscreen(),[]),V=s.useCallback(()=>t0.fullscreenElement?ee():X(),[X,ee]),$=s.useCallback(q=>{const G=t0.fullscreenElement;W(G),U(!!G),j?.(q)},[j]),z=s.useCallback(q=>{const G=t0.fullscreenElement;W(G),U(!!G),R?.(q)},[R]);return s.useEffect(()=>{L(t0.fullscreenEnabled)},[]),s.useEffect(()=>(t0.on("change",$),t0.on("error",z),()=>{t0.off("change",$),t0.off("error",z)}),[$,z]),{isFullscreenAvailable:I,fullscreenElement:H,isFullscreenEnabled:A,enableFullscreen:X,disableFullscreen:ee,toggleFullscreen:V}}({target:{current:n??document.body}}),F=a5();s.useEffect(()=>{y.getCommand("selectTheme").update({state:()=>t.getTheme(),context:()=>({theme:t.getTheme(),themes:F,darkMode:a})})},[t?.getTheme(),a]);const _=de(async function(v,D){let j=null;const R=t.getScripts();if(v?.declaration||v?.functionName){const P=v.declaration?v.declaration.getName():v.functionName;R.searchFunction({name:P}).length>0&&(j=P)}if(j)try{await R.executeMacro(j),b.current=Promise.resolve({source:null,name:j})}catch(P){return void o?.showError?.(P)}},[t,o]);s.useEffect(()=>{y.getCommand("newCellStyle").updateCallback(v=>{o?.showInputOptions?.({initialValue:(()=>{let D=0;for(;;){D++;const j=`Style ${D}`;try{return t.getStyles().validateStyleName(j,!0),j}catch{}}})(),title:y.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInputOption:async(D,j)=>{let R=null;try{t.getStyles().validateStyleName(D,!1)}catch(L){R=L.message}let P=t.getStyles().getNamed(D),I=R;return!I&&P&&(I=`Update style '${P.getName()}'.`),{valid:R===null,message:I}}}).then(({input:D,option:j})=>{const R=t.getSelectedSheet().getSelectedRange();if(j!=="Ok")return;const P=t.getStyles().setNamed({name:D,style:R.getCell().getStyle()});R.updateStyle({named:P.getName()})})}),y.getCommand("deleteCellStyle").updateCallback(v=>{v.delete()}),y.getCommand("modifyCellStyle").updateCallback(({named:v})=>{const D=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:v.getName(),style:D.getCell().getStyle()})}),y.getCommand("hideSheet").updateCallback(v=>{t.getSheetAt(v).setVisibility(N.ISheet.Visibility.Hidden)}),y.getCommand("deleteSheet").updateCallback(async v=>{t.getSheetAt(v??t.getSelectedSheetIndex())?.delete()}),y.getCommand("addSheet").updateCallback(v=>{t.getSheets().add({index:v,autoSelect:!0})}),y.getCommand("duplicateSheet").updateCallback(async v=>{(await t.getSheetAt(v??t.getSelectedSheetIndex())?.duplicate())?.select()}),y.getCommand("nextSheet").updateCallback(v=>{t.getNextSheet(v??t.getSelectedSheetIndex()).select()}),y.getCommand("previousSheet").updateCallback(v=>{t.getPreviousSheet(v??t.getSelectedSheetIndex()).select()}),y.getCommand("selectNextSheet").updateCallback(v=>{t.getNextSheet(v??t.getSelectedSheetIndex()).select()}),y.getCommand("selectPreviousSheet").updateCallback(v=>{t.getPreviousSheet(v??t.getSelectedSheetIndex()).select()}),y.getCommand("selectTheme").updateCallback(v=>{t.setTheme(v)}),y.getCommand("calculateAll").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("calculate").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("closeWorkbook").updateCallback(async()=>{await o?.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),y.getCommand("newWorkbook").updateCallback(()=>{f?.()}),y.getCommand("executeScript").updateCallback(_),y.getCommand("executeSelectedScript").updateCallback(_)},[t,o]);const O=de(async v=>{let D=0,j=null,R="Find & Replace";v?.replace&&!v?.replaceOptions?.maxCount&&(R="Replace All");const P=await o?.showBusy?.(R);try{const I=v?.scope??"sheet";let L=null;const H=t.getSelectedSheet(),W={from:H.getSelectedCell(),...v.findOptions};if(L=I==="sheet"?t.getSelectedSheet().find(v.findText,W):t.find(v.findText,W),v.replace){const A=t.replace(L,v.replaceText,v.replaceOptions);D=A.count,v.replaceOptions.maxCount&&(j=A.last)}else{let A=L.next();A.done||(D++,j=A.value)}j?.select({autoFocus:!1}),P?.(),!v.replaceOptions.maxCount&&D>1&&o?.showMessage?.(`We replaced ${D} cells.`)}catch(I){P?.(),o?.showError?.(I)}return D},[t,n]),S=de(v=>{const D={value:v,context:{selection:()=>{const j=t.getSelectedRanges(),R=[];for(let P=0;P<j.getCount();P++){const I=j.at(P).getFixed(!0).getCoords();R.push(I)}return t.getRanges(R)},getNames:()=>t.getNames()},onUpdate:async j=>{try{await j.select()}catch(R){o?.showMessage?.(R.message,{type:a0})}}};return o.showWindow?.("namedDetails",D)},[o,t,n]);return s.useEffect(()=>{const v=(D=!1)=>{const j=t.getSelectedCell(),R={onFindOrReplace:O,onKeyDown:P=>{y.findCommandByEvent(P)!==y.getCommand("find")&&y.findCommandByEvent(P)!==y.getCommand("findReplace")||P.preventDefault()},findOptions:{},findText:j.toTextUnformatted(!0)};R.replace=D,o.showWindow?.("find",R,{disableAutoDestroy:!0})};y.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{v()}),y.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{v(!0)}),y.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const D={onInputOption:async j=>{try{await t.getRanges(j).select()}catch(R){o?.showMessage?.(R.message,{type:a0})}},onKeyDown:j=>{y.findCommandByEvent(j)===y.getCommand("goto")&&j.preventDefault()},title:y.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(D)}),y.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async D=>{if(D)try{await D.select()}catch(j){o?.showError?.(j)}}),y.getCommand("addNamedReference")?.updateCallback(async function(D){S(null)}),y.getCommand("editNamedReference")?.updateCallback(async function(D){S(D)}),y.getCommand("deleteNamedReference")?.updateCallback(async function(D){D?.delete?.()}),y.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),Gt(t?.getView(),{onViewChange:v=>{y.getCommand("workbookViewToggleShowFormulaBar").update({state:v.isShowFormulaBar()}).updateCallback(()=>{v.setShowFormulaBar(!v.isShowFormulaBar())}),y.getCommand("workbookViewToggleShowTabs").update({state:v.isShowTabs()}).updateCallback(()=>{v.setShowTabs(!v.isShowTabs())}),y.getCommand("workbookViewToggleShowStatusBar").update({state:v.isShowStatusBar()}).updateCallback(()=>{v.setShowStatusBar(!v.isShowStatusBar())}),y.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:v.isShowHorizontalScrollbar()}).updateCallback(()=>{v.setShowHorizontalScrollbar(!v.isShowHorizontalScrollbar())}),y.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:v.isShowVerticalScrollbar()}).updateCallback(()=>{v.setShowVerticalScrollbar(!v.isShowVerticalScrollbar())})}}),s.useEffect(()=>{y.getCommand("fullScreenToggle").update({state:M,disabled:!E}).updateCallback(()=>{T()})},[M,E]),s.useEffect(()=>{const v=t.getProtection().isStructureAllowed();y.getCommand("hideSheet").update({disabled:m.length<=1||!v}),y.getCommand("deleteSheet").update({disabled:m.length<=1||!v})},[m,u]),y},jg=()=>{window.open(window.origin.toString(),"sheetxl-"+N.CommonUtils.uuidV4(),"popup=true")},Mg=s.memo(s.forwardRef((e,t)=>{const{movable:n,commands:o,disabled:r,sx:i,floatReference:a,...d}=e;Gt(n,{onAnyChange(f){}});const c=s.useMemo(()=>({}),[]),u=s.useMemo(()=>({commandHook:{beforeExecute:(f,x)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=s.useMemo(()=>({variant:Ht.Menuitem,...c,...u}),[c,u]),m=s.useMemo(()=>({commands:o,variant:Ht.Menuitem,parentFloat:a,...u}),[o,u,a]),h=f=>{switch(f?.key()){case"moveToFront":return xe(l.jsx(fv,{}));case"moveForward":return xe(l.jsx(gv,{}));case"moveToBack":return xe(l.jsx(mv,{}));case"moveBackward":return xe(l.jsx(xv,{}));case"toggleLockAspectRatio":return xe(l.jsx(W6,{}));case"formatDrawAlignLeft":return xe(l.jsx(q6,{}));case"formatDrawAlignCenter":return xe(l.jsx(yv,{}));case"formatDrawAlignRight":return xe(l.jsx(bv,{}));case"formatDrawAlignTop":return xe(l.jsx(wv,{}));case"formatDrawAlignMiddle":return xe(l.jsx(vv,{}));case"formatDrawAlignBottom":return xe(l.jsx(Sv,{}));case"formatDrawDistributeHorz":return xe(l.jsx(Cv,{}));case"formatDrawDistributeVert":return xe(l.jsx(kv,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return xe(l.jsx(U6,{}));default:return null}},g=l.jsxs(l.Fragment,{children:[l.jsx(Lc,{command:o.getCommand("copy"),...p,variant:Ht.Menuitem}),[],l.jsx(Mt,{orientation:"horizontal"}),l.jsx(i0,{...m,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),l.jsx(i0,{...m,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:xe(l.jsx(W6,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(i0,{...m,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:f=>h(f)||xe(l.jsx(q6,{})),tooltip:"Quickly change the placement of your drawings."}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(i0,{...m,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:f=>h(f)||xe(l.jsx(U6,{})),tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return l.jsx(B.Box,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...d,children:g})}));Mg.displayName="MovableContextMenu";const Tj="_sheetxl-theme_4opcr_2",jj="_sheetxl-workbook_1j3lu_5",Mj={fireOnModelChange:!1},qd={flex:"1 1 100%",display:"flex"},Rj=e=>l.jsx(x5,{...e}),Ij=e=>l.jsx(R5,{...e}),Dj=e=>l.jsx(Mg,{...e}),Lj=e=>l.jsx(I5,{...e}),Oj=e=>l.jsx(v5,{...e}),Aj=(e,t)=>l.jsx(w5,{ref:t,...e}),Rg=e=>l.jsx(Z0,{...e}),Pj=(e,t)=>l.jsx(Ym,{ref:t,...e}),D5=s.memo(s.forwardRef((e,t)=>{const{workbook:n,createWorkbookOptions:o,onNewWorkbook:r,onElementLoad:i,notifier:a,autoFocus:d=!1,sx:c,style:u,className:p,onFocus:m,onBlur:h,onKeyDown:g,onRepeatCommandChange:f,commands:x,showFormulaBar:y,formulaBarProps:w,renderFormulaBar:b=Aj,showTabs:C,tabsProps:k,renderTabs:E=Ij,showStatusBar:M,statusBarProps:T,renderStatusBar:F=Rj,toolbarProps:_,renderToolbar:O=_g,contextMenuSx:S,renderContextMenu:v=Lj,renderFilterMenu:D=Oj,renderMovableMenu:j=Dj,renderLoadingPanel:R=Rg,loadingPanelProps:P,sheetProps:I,renderSheet:L=Pj,showHorizontalScrollbar:H,showVerticalScrollbar:W,gridTheme:A,headersTheme:U,enableDarkImages:X,...ee}=e,V=Pr(),$=a5(),z=s.useMemo(()=>{const Ce={theme:$.getDefaultTheme(),...o};return n??new N.Workbook(Ce)},[n]),q=s.useRef(null),[G,Q]=s.useState(!1),Y=s.useRef(null),te=s.useMemo(()=>l.jsx(B.Box,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:Y}),[]),[re,ge]=s.useState(!1),[J,se]=s.useState(!1),Se=s.useCallback(()=>{ge(!0)},[]),Me=s.useRef(null),oe=Mo(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>z,getSheetElement:()=>q.current,getViewportElement:()=>Y.current,getFormulaBarElement:()=>Me.current,focus(){q&&q.current&&q.current.focus()}}),[z]),ne=s.useRef(null);s.useLayoutEffect(()=>{re&&oe.current&&(se(!0),ne.current!==i&&(i?.({source:oe.current}),ne.current=i))},[re,oe.current]),J8(oe.current);const he=s.useCallback(Ce=>(q.current?.submitEdit(),!0),[]),ze=s.useCallback(()=>{requestAnimationFrame(()=>{q?.current?.focus()})},[]),[Ne,gt]=s.useState(z?.getSelectedSheet()),[bt,ke]=s.useState(z?.getProtection());Gt(z,{onSheetsChange:Ce=>{gt(Ce?.getSelectedSheet())},onViewChange(Ce){gt(Ce?.getSelectedSheet())},onProtectionChange:Ce=>{ke(Ce?.getProtection())}}),Gt(z,{onRequestSelect:async(Ce,ut)=>new Promise(_t=>{q.current.getSheet()!==ut?q.current.getGridElement()?.onViewChangeOnce(()=>{q.current.getSheet()!==ut&&_t(!1),_t(!0)}):_t(!0)})},Mj);const[pt,xt]=s.useReducer(Ce=>Ce+1,0),Ve=z?.getView();Gt(Ve,{onViewChange:Ce=>{xt()}});const wt=A??V,Ye=s.useMemo(()=>c2(V,wt),[V,wt]),ae=U??V,Ue=s.useMemo(()=>c2(V,ae),[V,ae]),[ye,ve]=s.useState(null);s.useCallback(()=>{q.current.focus()},[]);const[le,Ie]=s.useState(!1),Re=s.useRef(null),be=Tg({workbook:z,workbookElement:oe.current,commandTarget:()=>q.current,notifier:a,commands:x,darkMode:Ye.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{le?Re.current?.focus():Ie(!0)}}),Oe=s.useRef(null),[ie,Ee]=s.useState(!1),[Le,qe]=s.useState(null),[ht,ot]=s.useState(Zc),[We,st]=s.useState(N.TypesUtils.EmptyBounds),Xe=()=>{Ee(!1),qe(null)},Qe=(Ce,ut,_t=Zc)=>{st(Ce),ot(_t),qe(ut),Oe.current!==null&&Oe.current.update(),Ee(!0)},[kt,Vt]=s.useState("sheet"),ct=C??Ve?.isShowTabs(),Ut=H??Ve?.isShowHorizontalScrollbar(),Qt=y??Ve?.isShowFormulaBar(),an=M??Ve?.isShowStatusBar(),xn=W??Ve?.isShowVerticalScrollbar(),En=Ye?.header?.edgeStrokeFill||"rgb(171,171,171)",Vn=s.useMemo(()=>an?F({sheet:Ne,gridStyle:Ye,...T}):null,[F,T,an,Ye,Ne]),oo=s.useMemo(()=>O({commands:be,workbook:oe.current,..._}),[be,O,_,V]),[po,{width:_n}]=ya(),Bt=_n===0||_n>560,Fn=s.useMemo(()=>{if(!ct)return null;let Ce=E({background:Ye.body.fill,borderWidth:1,borderColor:En,gridTheme:wt,gridStyle:Ye,onBeforeUserChange:he,onUserChange:ze,workbook:z,commands:be,sheetTabProps:{},notifier:a,...k});return Bt||(Ce=l.jsx("div",{style:{flex:"none",display:"flex"},children:Ce})),Ce},[E,k,a,V,z,wt,Bt,be,ct]),Gn=s.useCallback(Ce=>{const ut=N.CommonUtils.getOS()===N.CommonUtils.OSType.Firefox;let _t=null,sn=null,Jt=null;if(Ut&&(sn=l.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${En} 1px`,maxWidth:"100%"},children:l.jsx(Q1,{style:{alignItems:"center",borderTop:(ut?6:3)+"px solid transparent",borderBottom:(Bt?6:3)+"px solid transparent",borderLeft:(ut?3:0)+"px solid transparent",borderRight:(ut?3:0)+"px solid transparent"},...Ce,endGap:700,sheet:Ne,showCustomScrollButtons:!ut,onShowTooltip:yt=>{Qe({x:yt.anchor.x,y:yt.anchor.y,width:0,height:0},yt.display,yt.placement)},onCloseTooltip:()=>Xe()})})),ct&&Bt&&(Jt=Fn),ct&&Bt&&!Ut&&(Jt=l.jsxs(B.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[Jt,l.jsx(B.Box,{sx:{borderTop:`solid ${En} 1px`,flex:"1"}})]})),Jt&&Ut)_t=l.jsx(su,{position:z.getView().getTabRatio()/10+"%",onPositionChange:({percent:yt})=>{z.getView().setTabRatio(Math.round(10*yt))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${V.palette.text.icon??V.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${En} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:Jt,elementAfter:sn});else if(Ut)_t=sn;else{if(!Jt)return l.jsx(B.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:an?null:`solid ${En} 1px`}});_t=Jt}return l.jsx(B.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:_t})},[Ne,he,z,Ye,wt,be,ct,Ut,an,Bt]),[vn,Cn]=s.useState(null),mn=s.useMemo(()=>({placement:"right-start",...vn?.popperProps}),[vn?.popperProps]),{reference:tr,component:wr}=l0({label:"contextMenu",popperProps:mn,anchor:vn?.anchor??{getBoundingClientRect:()=>new DOMRect(vn?.clientX||0,vn?.clientY||0)},onClose:()=>Cn(null),createPopupPanel:vn?.createPopupPanel});s.useEffect(()=>{vn?tr.open(0):tr.close(0)},[vn]);const vr=de((Ce,ut)=>{if(Ce?.isDefaultPrevented())return!0;Ce.preventDefault(),vn&&vn.anchor===Ce.currentTarget?Cn(null):Cn({anchor:Ce.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:_t=>{const{floatReference:sn}=_t;return D({filter:ut,commands:be,floatReference:sn,sx:{...S}})}})},[D,S,be,z,vn]),Uo=de(Ce=>{if(Ce.originalEvent?.isDefaultPrevented())return!0;Ce.originalEvent?.preventDefault(),Cn({clientX:Ce.clientX,clientY:Ce.clientY,createPopupPanel:ut=>{const{floatReference:_t}=ut;return v({commands:be,workbook:z,floatReference:_t,sx:{...S}})}})},[v,S,be,z]),Fr=de((Ce,ut)=>{if(Ce?.isDefaultPrevented())return!0;Ce.preventDefault(),Cn({clientX:Ce.clientX,clientY:Ce.clientY,createPopupPanel:_t=>{const{floatReference:sn}=_t;return j({movable:ut,commands:be,floatReference:sn,sx:{...S}})}})},[j,S,be]);s.useMemo(()=>{const Ce=[new ft("openContextMenu",()=>q.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[we.Shift]},{key:"ContextMenu"}]})];be.addCommands(Ce,!0)},[be]),s.useEffect(()=>{be.getCommand("openContextMenu").updateCallback(()=>{const Ce=Ne.getSelection().getCoords().cell;q.current?.getGridElement()?.scrollCellCoordsIntoView(Ce).then(ut=>{requestAnimationFrame(()=>{const _t=Ne.getView().getZoomScale()/100,sn=Ne.getColumnHeaders().findOffset(Ce.colIndex+1)*_t,Jt=Ne.getRowHeaders().findOffset(Ce.rowIndex+1)*_t,yt=q.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};Uo({clientX:sn-yt.x-ut.left+6,clientY:Jt-yt.y-ut.top+6})})})})},[Ne]);const qo=de(Ce=>{be?.dispatchToFocusedCommand(Ce)},[be]),Sr=de(()=>{J8(oe.current)},[z,oe.current]),Kr=s.useCallback(()=>{Vt("sheet")},[]),Cr=s.useCallback(()=>{Vt("formulaBar")},[]),Lo=de(Ce=>{const ut=N.CommonUtils.getOS()===N.CommonUtils.OSType.Firefox;return l.jsx(Q1,{style:{borderLeft:"3px solid transparent",borderRight:"0px solid transparent",borderTop:(ut?3:0)+"px solid transparent",borderBottom:(ut?3:0)+"px solid transparent",width:ut?"13px":void 0},...Ce,sheet:Ne,endGap:700,showCustomScrollButtons:!ut,onShowTooltip:_t=>{Qe(_t.anchor,_t.display,ey)},onCloseTooltip:()=>Xe()})},[Ne]);s.useEffect(()=>{d&&q&&q.current&&q.current.focus()},[]);const[Fe,et]=s.useState(null),tt=s.useCallback(Ce=>{be?.getCommand("openWorkbook")&&(Ce.type==="dragenter"||Ce.type==="dragover"?Ce.dataTransfer?.types.includes("Files")?Ce.dataTransfer.files[0]?.type?.startsWith("image/")||Ce.dataTransfer.items[0]?.type?.startsWith("image/")||Ce.dataTransfer.types.length===1&&et("Drop to open"):(Ce.dataTransfer?.types.includes("text/html")||Ce.dataTransfer?.types.includes("text/plain"),Ce.dataTransfer.effectAllowed="none",Ce.dataTransfer.dropEffect="none"):Ce.type==="dragleave"&&et(null),Ce.preventDefault())},[be]),Ze=de(Ce=>{if(be?.getCommand("openWorkbook")&&(Ce.preventDefault(),Ce.stopPropagation(),et(null),Ce.dataTransfer.files&&Ce.dataTransfer.files.length>0)){const ut=Ce.dataTransfer.files[0];if(!ut)return;if(ut?.type?.startsWith("image/")){const _t=q.current?.getGridElement().getViewFromClient(Ce.clientX,Ce.clientY);if(!_t)return;const sn=_t.getRelativePointFromClient(Ce.clientX,Ce.clientY),Jt=_t.toAbsoluteBounds({...sn,width:0,height:0}),yt=_t.getCellCoordsFromClient(Ce.clientX,Ce.clientY);if(!yt)return;be?.getCommand("insertImageFromFile")?.execute({file:ut,options:{bounds:{x:Jt.x,y:Jt.y}},goto:{range:{...yt}}})}else be?.getCommand("openWorkbook")?.execute(ut)}},[be,Fe]),rt=s.useMemo(()=>Fe?l.jsx(B.Box,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:Ce=>Ce.palette.divider,color:Ce=>Ce.palette.primary.dark},children:l.jsx(B.Typography,{variant:"h4",children:Fe})}):null,[Fe]),vt=s.useRef(null),Et=s.useMemo(()=>l.jsx(s2,{in:!J,nodeRef:vt,timeout:500,classNames:"animating",unmountOnExit:!0,children:l.jsx(B.Box,{style:{display:"flex",alignItems:"center",justifyContent:"center",left:"0px",top:"0px",width:"100%",height:"100%",pointerEvents:J?"none":c?.pointerEvents,position:"absolute",boxSizing:"border-box"},children:R({ref:vt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:J?0:c?.opacity,pointerEvents:J?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...P}})})}),[J,R,P]),St=s.useMemo(()=>b({sx:{marginTop:Ce=>Ce.spacing(.25),marginLeft:Ce=>Ce.spacing(1),marginRight:Ce=>Ce.spacing(1)},workbook:z,sheetElement:q.current,gridStyle:Ye,onFocus:Cr,...w,NamedCollectionEditorProps:{restoreFocus:Ce=>q.current.focus(Ce),notifier:a,...w?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:be,...w?.NamedCollectionEditorProps?.commandPopupButtonProps}}},Me),[b,w,z,Ye,be,J]),Rt=s.useCallback(Ce=>{const{movable:ut,..._t}=Ce,sn={movable:ut,onContextMenuCapture:qt=>{Fr(qt,ut)},..._t},Jt=ut.getContent().getType();let yt=null;if(Jt==="picture")return l.jsx(Jm,{loadingPanel:l.jsx(Z0,{transitionDelay:"100",style:{position:"absolute"},sx:{border:qt=>`solid 1px ${qt.palette.action.active}`}}),picture:ut.getContent(),description:ut.getDescription()??ut?.getName(),...sn});if(Jt==="chart"){const qt={...sn,chart:ut.getContent()};return l.jsx(j_,{...qt})}if(yt=`Float of type '${Jt}'.`,typeof yt=="string"){const qt={...sn,description:yt};yt=l.jsx(b_,{...qt})}return l.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:yt},ut.getUUID())},[]),Tt=s.useMemo(()=>L({style:qd,onFocus:Kr,notifier:a,gridStyle:Ye,headersStyle:Ue,sheet:Ne,commands:be,onSheetContextMenu:Uo,onViewportChange:Ce=>{ve(Ce)},showScrollbars:!1,viewportComponent:te,onRepeatCommandChange:f,onElementLoad:Se,onShowColumnTooltip:Ce=>{Qe(Ce.anchor,Ce.display,Zc)},onShowRowTooltip:Ce=>{Qe(Ce.anchor,Ce.display,lu)},onShowTooltip:Ce=>{Qe({x:Ce.anchor.x,y:Ce.anchor.y,width:0,height:0},Ce.display,Ce.placement)},onCloseTooltip:()=>Xe(),renderMovable:Rt,...I,cellRenderProps:{onFilterButtonMouseDown:(Ce,ut)=>{I?.cellRenderProps?.onFilterButtonMouseDown(Ce,ut),vr(Ce,ut)},...I?.cellRenderProps}},q),[L,be,I,Ne,Ye,a,f]),en=s.useMemo(()=>{if(!le)return null;const Ce=!bt.isStructureAllowed();return l.jsx(j5,{sx:{marginBottom:ut=>ut.spacing(.5),border:ut=>`solid ${Ce?ut.palette.action.disabled:dt.alpha(ut.palette.divider,.2)} 1px`,borderRadius:ut=>`${ut.shape.borderRadius}px`,overflow:"hidden"},onClose:()=>{Ie(!1),requestAnimationFrame(()=>{q.current.focus()})},readOnly:Ce,commands:be,ref:Re,scripts:z.getScripts()})},[le,be,z,a,bt]),bn=s.useMemo(()=>{const Ce=l.jsx(f2,{style:{...qd,marginRight:en&&Bt?"0px":"6px"},viewport:ye,touchElement:q.current?.getGridElement()?.stage,onScrollViewport:yt=>{q.current?.getGridElement()?.scrollTo(yt)},showHorizontalScrollbar:Ut||ct,showVerticalScrollbar:xn,createHorizontalScrollbar:Gn,createVerticalScrollbar:Lo,children:Tt});let ut=Ce;Bt||(ut=l.jsxs(l.Fragment,{children:[Ce,Fn]}));let _t=null,sn=4,Jt=13;return Bt?_t="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(_t="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",sn=13,Jt=4),l.jsx(su,{fixedPane:"after",position:"40%",minAfter:Bt?"280px":"120px",splitDirection:Bt?"row":"column",style:qd,ref:po,resizerProps:{className:"styled-resizer",style:{minWidth:Bt?"6px":void 0,minHeight:Bt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${sn}' height='${Jt}' viewBox='0 0 ${sn} ${Jt}' version='1.1' fill='${V.palette.text.icon??V.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${_t}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:Bt?"left center":"top center"}},elementBefore:ut,paneBeforeProps:{style:{flexDirection:"column"}},elementAfter:en,paneAfterProps:{style:{marginLeft:Bt?"0px":"4px",marginRight:Bt?"8px":"4px"}}})},[Ut,ct,Gn,xn,ye,en,Tt,Fn,V,Bt]),ln=s.useMemo(()=>({boxSizing:"border-box",background:Ce=>Ce.palette.mode!=="dark"?Ye.header.fill:Ce.palette.background.paper,"& *":{...F2(V),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${En} 1px`},...c}),[c,Ye]);return l.jsxs(B.Paper,{className:Zn("sheetxl-workbook",jj,{"Mui-focusVisible":G},Tj,p),sx:ln,style:u,square:!1,...ee,ref:oe,onFocus:Ce=>{Q(!0),Sr(),m?.(Ce)},onBlur:Ce=>{Q(!1),h?.(Ce)},onKeyDown:Ce=>{qo(Ce),g?.(Ce)},onDragStart:Ce=>{if(Ce.target.src){const ut=new Image;ut.src=Ce.target.src,Ce.dataTransfer.setDragImage(ut,1,1)}},onDragEnter:tt,onDragLeave:tt,onDragOver:tt,onDrop:Ze,children:[l.jsxs("div",{className:Zn(Xf),style:{flex:"1 1 100%",width:"100%",display:"flex",flexDirection:"column",opacity:J?void 0:0,"--sxl-app-color-high-contrast":V.palette.primary.main,"--sxl-app-color-primary":V.palette.primary.main,"--sxl-app-color-primary-dark":V.palette.primary.dark,"--sxl-app-color-primary-light":V.palette.primary.light,"--sxl-app-color-info":V.palette.info.main,"--sxl-app-color-info-dark":V.palette.info.dark,"--sxl-app-color-info-light":V.palette.info.light,"--sxl-app-color-secondary":V.palette.secondary.main,"--sxl-app-color-secondary-dark":V.palette.secondary.dark,"--sxl-app-color-secondary-light":V.palette.secondary.light,"--sxl-app-color-success":V.palette.success.main,"--sxl-app-color-success-dark":V.palette.success.dark,"--sxl-app-color-success-light":V.palette.success.light,"--sxl-app-color-warning":V.palette.warning.main,"--sxl-app-color-warning-dark":V.palette.warning.dark,"--sxl-app-color-warning-light":V.palette.warning.light,"--sxl-app-color-error":V.palette.error.main,"--sxl-app-color-error-dark":V.palette.error.dark,"--sxl-app-color-error-light":V.palette.error.light,"--sxl-app-color-text":V.palette.text.primary,"--sxl-app-color-text-secondary":V.palette.text.secondary,"--sxl-app-color-text-disabled":V.palette.text.disabled,"--sxl-app-color-background":V.palette.background.paper,"--sxl-app-color-button-surface":V.palette.grey[600],"--sxl-app-color-shadow":V.palette.action.focus,"--sxl-app-color-grey":V.palette.grey[500],"--sxl-app-filter-dark-invert":Ye.body.darkMode&&X?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":Ye.body.darkMode?`linear-gradient(${dt.alpha("#fff",kn(5))}, ${dt.alpha("#fff",kn(5))})`:void 0},children:[oo,Qt?St:null,l.jsx(B.Box,{sx:{marginBottom:Ce=>Ce.spacing(.75)}}),bn,Vn,l.jsx(br,{arrow:!0,disableInteractive:!0,open:ie,title:l.jsx(B.Typography,{variant:"subtitle2",component:"div",children:Le}),placement:ht,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:Oe,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:ie?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(We.x,We.y,We.width,We.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:l.jsx(B.Box,{})}),wr,rt]}),Et]})}));D5.displayName="WorkbookElement";const Fj=(e=!1,t=!1)=>t?null:{"& input:not(:focus):not(:hover)":{color:n=>n.palette.text.secondary},backgroundColor:n=>dt.alpha(n.palette.background.paper,.6),borderRadius:n=>`${n.shape.borderRadius}px`,border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:n=>n.palette.background.paper},"&:hover:not([disabled])":{border:n=>`solid ${e?n.palette.text?.primary:n.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:n=>`solid ${n.palette.primary.main} 1px !important`,border:n=>`1px solid ${n.palette?.primary?.main} !important`}},L5=s.memo(s.forwardRef((e,t)=>{const{sx:n,workbook:o,title:r="",placeHolder:i="Untitled",onTitleChange:a,readOnly:d=!1,hidden:c,...u}=e,[p,m]=s.useState(!1),[h,g]=s.useState(!1),[f,x]=s.useState(r??""),[y,w]=s.useState(""),[b,{width:C}]=ya(),[k,{width:E}]=ya(),[M,T]=s.useState(!1),F=s.useRef(null),_=s.useRef(null),O=Mo(t,()=>({requestWorkbookTitle:(S=null,v)=>{_.current={onAccept:S,requestReason:v?.requestReason},v?.selectAll&&F.current?.select(),F.current?.focus(v)},focus:S=>{F.current?.focus(S)}}),[]);return s.useLayoutEffect(()=>{T(r!==f),w(r),x(r)},[r]),s.useEffect(()=>{M&&C!==0&&zt.debounce(()=>{T(!1)},300)()},[M,C]),s.useEffect(()=>{g(f&&!di.isValidWindowsFilename(f))},[f]),c?null:l.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:M?"0":"1",transition:M?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:is([O,k,t]),...u,children:l.jsx(Bo,{label:_.current?.requestReason??"Workbook Name",children:l.jsxs(B.Box,{className:Zn({"Mui-focusVisible":p}),sx:{visibility:C===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...Fj(!0,d),...n},children:[d?l.jsx(B.Typography,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:f!==y?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:S=>h?S.palette.error.dark:void 0},children:r??i}):l.jsx(B.Input,{sx:{width:`${Math.min(C+3,Math.max(E,O.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:S=>h?S.palette.error.dark:void 0,fontStyle:f!==y?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:d,spellCheck:!1,placeholder:i,onFocus:S=>{m(!0),S.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:F},onBlur:()=>{m(!1),h?x(y):(f!==y&&(a?.(f),f&&_.current?.onAccept?.(f,"blur")),_.current=null)},onChange:S=>{if(S.target.value.length>di.MAX_WORKBOOK_NAME_SIZE)return S.stopPropagation(),void S.preventDefault();x(S.target.value)},onKeyDown:S=>{(di.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(S.key)||S.target?.value.length>di.MAX_WORKBOOK_NAME_SIZE)&&S.preventDefault(),S.which===Wt.Enter||S.which===Wt.Tab?(h?x(y):(a?.(f),f&&(_.current?.onAccept?.(f,"keydown"),_.current=null)),S.stopPropagation(),S.preventDefault(),o?.focus()):S.which===Wt.Escape&&(f===y?o?.focus():(x(y),setTimeout(()=>{S.target?.select()},0)),_.current=null,S.stopPropagation(),S.preventDefault())},value:f}),l.jsx(B.Box,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:f!==y?"italic":void 0,fontFamily:S=>S.typography.fontFamily,letterSpacing:"0.00938em"},children:f||i})]})})})}));L5.displayName="WorkbookTitle";const Ig=s.memo(s.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,renderLoadingPanel:a,...d}=e;i&&N.LicenseManager.setLicenseKey(i);const c=s.useMemo(()=>{const p={transitionDelay:"160ms",transparentBackground:!0};return l.jsx(B.Box,{sx:n,style:{width:"100%",height:"100%",position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",...o},children:a?.(p)??l.jsx(Z0,{...p})})},[n,o,a]),u=s.useMemo(()=>s.lazy(async()=>await Promise.resolve().then(()=>xM)),[]);return l.jsx(l.Fragment,{children:l.jsx(s.Suspense,{fallback:c,children:l.jsx(u,{...d,className:r,renderLoadingPanel:a,sx:n,style:o,ref:t})})})}));Ig.displayName="Studio";const zj=s.createContext(null),Zd={didCatch:!1,error:null};class Bj extends s.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Zd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,o,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];(n=(o=this.props).onReset)===null||n===void 0||n.call(o,{args:i,reason:"imperative-api"}),this.setState(Zd)}}componentDidCatch(t,n){var o,r;(o=(r=this.props).onError)===null||o===void 0||o.call(r,t,n)}componentDidUpdate(t,n){const{didCatch:o}=this.state,{resetKeys:r}=this.props;var i,a;o&&n.error!==null&&function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return d.length!==c.length||d.some((u,p)=>!Object.is(u,c[p]))}(t.resetKeys,r)&&((i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:r,prev:t.resetKeys,reason:"keys"}),this.setState(Zd))}render(){const{children:t,fallbackRender:n,FallbackComponent:o,fallback:r}=this.props,{didCatch:i,error:a}=this.state;let d=t;if(i){const c={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")d=n(c);else if(o)d=s.createElement(o,c);else{if(r===void 0)throw a;d=r}}return s.createElement(zj.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},d)}}function Dg(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Dg(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function G0(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Dg(e))&&(o&&(o+=" "),o+=t);return o}let Nj={data:""},Vj=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Nj,Hj=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,$j=/\/\*[^]*?\*\/| +/g,gp=/\n+/g,ai=(e,t)=>{let n="",o="",r="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+a+";":o+=i[1]=="f"?ai(a,i):i+"{"+ai(a,i[1]=="k"?"":t)+"}":typeof a=="object"?o+=ai(a,t?t.replace(/([^,])+/g,d=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,d):d?d+" "+c:c)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=ai.p?ai.p(i,a):i+":"+a+";")}return n+(t&&r?t+"{"+r+"}":r)+o},u0={},Lg=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Lg(e[n]);return t}return e},Wj=(e,t,n,o,r)=>{let i=Lg(e),a=u0[i]||(u0[i]=(c=>{let u=0,p=11;for(;u<c.length;)p=101*p+c.charCodeAt(u++)>>>0;return"go"+p})(i));if(!u0[a]){let c=i!==e?e:(u=>{let p,m,h=[{}];for(;p=Hj.exec(u.replace($j,""));)p[4]?h.shift():p[3]?(m=p[3].replace(gp," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][p[1]]=p[2].replace(gp," ").trim();return h[0]})(e);u0[a]=ai(r?{["@keyframes "+a]:c}:c,n?"":"."+a)}let d=n&&u0.g?u0.g:null;return n&&(u0.g=u0[a]),((c,u,p,m)=>{m?u.data=u.data.replace(m,c):u.data.indexOf(c)===-1&&(u.data=p?c+u.data:u.data+c)})(u0[a],t,o,d),a};function d2(e){let t=this||{},n=e.call?e(t.p):e;return Wj(n.unshift?n.raw?((o,r,i)=>o.reduce((a,d,c)=>{let u=r[c];if(u&&u.call){let p=u(i),m=p&&p.props&&p.props.className||/^go/.test(p)&&p;u=m?"."+m:p&&typeof p=="object"?p.props?"":ai(p,""):p===!1?"":p}return a+d+(u??"")},""))(n,[].slice.call(arguments,1),t.p):n.reduce((o,r)=>Object.assign(o,r&&r.call?r(t.p):r),{}):n,Vj(t.target),t.g,t.o,t.k)}function Og(e,t,n){return t&&function(o,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}(e.prototype,t),e}function Nn(){return Nn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Nn.apply(this,arguments)}function Ag(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function as(e,t){if(e==null)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}function xp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}d2.bind({g:1}),d2.bind({k:1});var yp=function(){return""},Pg=s.createContext({enqueueSnackbar:yp,closeSnackbar:yp}),Gd="@media (max-width:599.95px)",k1="@media (min-width:600px)",bp=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},O5=function(e){return""+bp(e.vertical)+bp(e.horizontal)},Ys=function(e){return!!e||e===0},Js="unmounted",Pi="exited",Fi="entering",el="entered",wp="exiting",A5=function(e){function t(o){var r;r=e.call(this,o)||this;var i,a=o.appear;return r.appearStatus=null,o.in?a?(i=Pi,r.appearStatus=Fi):i=el:i=o.unmountOnExit||o.mountOnEnter?Js:Pi,r.state={status:i},r.nextCallback=null,r}Ag(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===Js?{status:Pi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==Fi&&i!==el&&(r=Fi):i!==Fi&&i!==el||(r=wp)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,r=o,i=o;return o!=null&&typeof o!="number"&&typeof o!="string"&&(i=o.exit,r=o.enter),{exit:i,enter:r}},n.updateStatus=function(o,r){o===void 0&&(o=!1),r!==null?(this.cancelNextCallback(),r===Fi?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===Pi&&this.setState({status:Js})},n.performEnter=function(o){var r=this,i=this.props.enter,a=o,d=this.getTimeouts();o||i?(this.props.onEnter&&this.props.onEnter(this.node,a),this.safeSetState({status:Fi},function(){r.props.onEntering&&r.props.onEntering(r.node,a),r.onTransitionEnd(d.enter,function(){r.safeSetState({status:el},function(){r.props.onEntered&&r.props.onEntered(r.node,a)})})})):this.safeSetState({status:el},function(){r.props.onEntered&&r.props.onEntered(r.node,a)})},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts();r?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:wp},function(){o.props.onExiting&&o.props.onExiting(o.node),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:Pi},function(){o.props.onExited&&o.props.onExited(o.node)})})})):this.safeSetState({status:Pi},function(){o.props.onExited&&o.props.onExited(o.node)})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(){i&&(i=!1,r.nextCallback=null,o())},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=o==null&&!this.props.addEndListener;this.node&&!i?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),o!=null&&setTimeout(this.nextCallback,o)):setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===Js)return null;var r=this.props;return(0,r.children)(o,as(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},Og(t,[{key:"node",get:function(){var o,r=(o=this.props.nodeRef)===null||o===void 0?void 0:o.current;if(!r)throw new Error("notistack - Custom snackbar is not refForwarding");return r}}]),t}(s.Component);function zi(){}function vp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function u2(e,t){return s.useMemo(function(){return e==null&&t==null?null:function(n){vp(e,n),vp(t,n)}},[e,t])}function cc(e){var t=e.timeout,n=e.style,o=n===void 0?{}:n,r=e.mode;return{duration:typeof t=="object"?t[r]||0:t,easing:o.transitionTimingFunction,delay:o.transitionDelay}}A5.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:zi,onEntering:zi,onEntered:zi,onExit:zi,onExiting:zi,onExited:zi};var Uj="cubic-bezier(0.4, 0, 0.2, 1)",qj="cubic-bezier(0.0, 0, 0.2, 1)",Zj="cubic-bezier(0.4, 0, 0.6, 1)",Fg=function(e){e.scrollTop=e.scrollTop},Sp=function(e){return Math.round(e)+"ms"};function Ji(e,t){e===void 0&&(e=["all"]);var n=t||{},o=n.duration,r=o===void 0?300:o,i=n.easing,a=i===void 0?Uj:i,d=n.delay,c=d===void 0?0:d;return(Array.isArray(e)?e:[e]).map(function(u){var p=typeof r=="string"?r:Sp(r),m=typeof c=="string"?c:Sp(c);return u+" "+p+" "+a+" "+m}).join(",")}function zg(e){var t=function(n){return n&&n.ownerDocument||document}(e);return t.defaultView||window}function Qs(e,t){if(t){var n=function(o,r){var i,a=r.getBoundingClientRect(),d=zg(r);if(r.fakeTransform)i=r.fakeTransform;else{var c=d.getComputedStyle(r);i=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}var u=0,p=0;if(i&&i!=="none"&&typeof i=="string"){var m=i.split("(")[1].split(")")[0].split(",");u=parseInt(m[4],10),p=parseInt(m[5],10)}switch(o){case"left":return"translateX("+(d.innerWidth+u-a.left)+"px)";case"right":return"translateX(-"+(a.left+a.width-u)+"px)";case"up":return"translateY("+(d.innerHeight+p-a.top)+"px)";default:return"translateY(-"+(a.top+a.height-p)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var Bg=s.forwardRef(function(e,t){var n=e.children,o=e.direction,r=o===void 0?"down":o,i=e.in,a=e.style,d=e.timeout,c=d===void 0?0:d,u=e.onEnter,p=e.onEntered,m=e.onExit,h=e.onExited,g=as(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),f=s.useRef(null),x=u2(n.ref,f),y=u2(x,t),w=s.useCallback(function(){f.current&&Qs(r,f.current)},[r]);return s.useEffect(function(){if(!i&&r!=="down"&&r!=="right"){var b=function(k,E){var M;function T(){for(var F=this,_=arguments.length,O=new Array(_),S=0;S<_;S++)O[S]=arguments[S];clearTimeout(M),M=setTimeout(function(){k.apply(F,O)},E)}return E===void 0&&(E=166),T.clear=function(){clearTimeout(M)},T}(function(){f.current&&Qs(r,f.current)}),C=zg(f.current);return C.addEventListener("resize",b),function(){b.clear(),C.removeEventListener("resize",b)}}},[r,i]),s.useEffect(function(){i||w()},[i,w]),s.createElement(A5,Object.assign({appear:!0,nodeRef:f,onEnter:function(b,C){Qs(r,b),Fg(b),u&&u(b,C)},onEntered:p,onEntering:function(b){var C=a?.transitionTimingFunction||qj,k=cc({timeout:c,mode:"enter",style:Nn({},a,{transitionTimingFunction:C})});b.style.webkitTransition=Ji("-webkit-transform",k),b.style.transition=Ji("transform",k),b.style.webkitTransform="none",b.style.transform="none"},onExit:function(b){var C=a?.transitionTimingFunction||Zj,k=cc({timeout:c,mode:"exit",style:Nn({},a,{transitionTimingFunction:C})});b.style.webkitTransition=Ji("-webkit-transform",k),b.style.transition=Ji("transform",k),Qs(r,b),m&&m(b)},onExited:function(b){b.style.webkitTransition="",b.style.transition="",h&&h(b)},in:i,timeout:c},g),function(b,C){return s.cloneElement(n,Nn({ref:y,style:Nn({visibility:b!=="exited"||i?void 0:"hidden"},a,{},n.props.style)},C))})});Bg.displayName="Slide";var Ac=function(e){return s.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},Gj=function(){return s.createElement(Ac,null,s.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
91
91
|
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},Kj=function(){return s.createElement(Ac,null,s.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Xj=function(){return s.createElement(Ac,null,s.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,
|
|
@@ -93,4 +93,4 @@ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modif
|
|
|
93
93
|
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},Yj=function(){return s.createElement(Ac,null,s.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
94
94
|
0 22,12A10,10 0 0,0 12,2Z`}))},ii={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:s.createElement(Gj,null),warning:s.createElement(Kj,null),error:s.createElement(Xj,null),info:s.createElement(Yj,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Bg,transitionDuration:{enter:225,exit:195}},Jj=function(e,t){return function(n,o){return o===void 0&&(o=!1),o?Nn({},ii[n],{},t[n],{},e[n]):n==="autoHideDuration"?(r=e.autoHideDuration,i=t.autoHideDuration,(a=function(d){return typeof d=="number"||d===null})(r)?r:a(i)?i:ii.autoHideDuration):n==="transitionDuration"?function(d,c){var u=function(p,m){return m.some(function(h){return typeof p===h})};return u(d,["string","number"])?d:u(d,["object"])?Nn({},ii.transitionDuration,{},u(c,["object"])&&c,{},d):u(c,["string","number"])?c:u(c,["object"])?Nn({},ii.transitionDuration,{},c):ii.transitionDuration}(e.transitionDuration,t.transitionDuration):e[n]||t[n]||ii[n];var r,i,a}};function ls(e){return Object.entries(e).reduce(function(t,n){var o,r=n[0],i=n[1];return Nn({},t,((o={})[r]=d2(i),o))},{})}var Qj="notistack-SnackbarContainer",eM="notistack-Snackbar",Ng="notistack-CollapseWrapper",tM="notistack-MuiContent",nM=function(e){return"notistack-MuiContent-"+e},Cp=ls({root:{height:0},entered:{height:"auto"}}),Kd="0px",Vg=s.forwardRef(function(e,t){var n=e.children,o=e.in,r=e.onExited,i=s.useRef(null),a=s.useRef(null),d=u2(t,a),c=function(){return i.current?i.current.clientHeight:0};return s.createElement(A5,{in:o,unmountOnExit:!0,onEnter:function(u){u.style.height=Kd},onEntered:function(u){u.style.height="auto"},onEntering:function(u){var p=c(),m=cc({timeout:175,mode:"enter"}),h=m.duration,g=m.easing;u.style.transitionDuration=typeof h=="string"?h:h+"ms",u.style.height=p+"px",u.style.transitionTimingFunction=g||""},onExit:function(u){u.style.height=c()+"px"},onExited:r,onExiting:function(u){Fg(u);var p=cc({timeout:175,mode:"exit"}),m=p.duration,h=p.easing;u.style.transitionDuration=typeof m=="string"?m:m+"ms",u.style.height=Kd,u.style.transitionTimingFunction=h||""},nodeRef:a,timeout:175},function(u,p){return s.createElement("div",Object.assign({ref:d,className:G0(Cp.root,u==="entered"&&Cp.entered),style:Nn({pointerEvents:"all",overflow:"hidden",minHeight:Kd,transition:Ji("height")},u==="entered"&&{overflow:"visible"},{},u==="exited"&&!o&&{visibility:"hidden"})},p),s.createElement("div",{ref:i,className:Ng,style:{display:"flex",width:"100%"}},n))})});Vg.displayName="Collapse";var kp={right:"left",left:"right",bottom:"up",top:"down"},oM=function(e){return"anchorOrigin"+O5(e)},rM=function(){};function _l(e,t){return e.reduce(function(n,o){return o==null?n:function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var d=[].concat(i);t&&d.indexOf(t)===-1&&d.push(t),n.apply(this,d),o.apply(this,d)}},rM)}var iM=typeof window<"u"?s.useLayoutEffect:s.useEffect;function Ep(e){var t=s.useRef(e);return iM(function(){t.current=e}),s.useCallback(function(){return t.current.apply(void 0,arguments)},[])}var Xd,Hg=s.forwardRef(function(e,t){var n=e.children,o=e.className,r=e.autoHideDuration,i=e.disableWindowBlurListener,a=i!==void 0&&i,d=e.onClose,c=e.id,u=e.open,p=e.SnackbarProps,m=p===void 0?{}:p,h=s.useRef(),g=Ep(function(){d&&d.apply(void 0,arguments)}),f=Ep(function(w){d&&w!=null&&(h.current&&clearTimeout(h.current),h.current=setTimeout(function(){g(null,"timeout",c)},w))});s.useEffect(function(){return u&&f(r),function(){h.current&&clearTimeout(h.current)}},[u,r,f]);var x=function(){h.current&&clearTimeout(h.current)},y=s.useCallback(function(){r!=null&&f(.5*r)},[r,f]);return s.useEffect(function(){if(!a&&u)return window.addEventListener("focus",y),window.addEventListener("blur",x),function(){window.removeEventListener("focus",y),window.removeEventListener("blur",x)}},[a,y,u]),s.createElement("div",Object.assign({ref:t},m,{className:G0(eM,o),onMouseEnter:function(w){m.onMouseEnter&&m.onMouseEnter(w),x()},onMouseLeave:function(w){m.onMouseLeave&&m.onMouseLeave(w),y()}}),n)});Hg.displayName="Snackbar";var aM=ls({root:(Xd={display:"flex",flexWrap:"wrap",flexGrow:1},Xd[k1]={flexGrow:"initial",minWidth:"288px"},Xd)}),P5=s.forwardRef(function(e,t){var n=e.className,o=as(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:G0(aM.root,n)},o))});P5.displayName="SnackbarContent";var tl=ls({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"}}),_p="notistack-snackbar",$g=s.forwardRef(function(e,t){var n=e.id,o=e.message,r=e.action,i=e.iconVariant,a=e.variant,d=e.hideIconVariant,c=e.style,u=e.className,p=i[a],m=r;return typeof m=="function"&&(m=m(n)),s.createElement(P5,{ref:t,role:"alert","aria-describedby":_p,style:c,className:G0(tM,nM(a),tl.root,tl[a],u,!d&&p&&tl.lessPadding)},s.createElement("div",{id:_p,className:tl.message},d?null:p,o),m&&s.createElement("div",{className:tl.action},m))});$g.displayName="MaterialDesignContent";var nl,Yd,e1,t1,Jd,lM=s.memo($g),sM=ls({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),cM=function(e){var t=s.useRef(),n=s.useState(!0),o=n[0],r=n[1],i=_l([e.snack.onClose,e.onClose]),a=s.useCallback(function(){t.current=setTimeout(function(){r(function(F){return!F})},125)},[]);s.useEffect(function(){return function(){t.current&&clearTimeout(t.current)}},[]);var d,c=e.snack,u=e.classes,p=e.Component,m=p===void 0?lM:p,h=s.useMemo(function(){return function(F){F===void 0&&(F={});var _={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(F).filter(function(O){return!_[O]}).reduce(function(O,S){var v;return Nn({},O,((v={})[S]=F[S],v))},{})}(u)},[u]),g=c.open,f=c.SnackbarProps,x=c.TransitionComponent,y=c.TransitionProps,w=c.transitionDuration,b=c.disableWindowBlurListener,C=c.content,k=as(c,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),E=Nn({direction:(d=k.anchorOrigin,d.horizontal!=="center"?kp[d.horizontal]:kp[d.vertical]),timeout:w},y),M=C;typeof M=="function"&&(M=M(k.id,k.message));var T=["onEnter","onEntered","onExit","onExited"].reduce(function(F,_){var O;return Nn({},F,((O={})[_]=_l([e.snack[_],e[_]],k.id),O))},{});return s.createElement(Vg,{in:o,onExited:T.onExited},s.createElement(Hg,{open:g,id:k.id,disableWindowBlurListener:b,autoHideDuration:k.autoHideDuration,className:G0(sM.wrappedRoot,h.root,h[oM(k.anchorOrigin)]),SnackbarProps:f,onClose:i},s.createElement(x,Object.assign({},E,{appear:!0,in:g,onExit:T.onExit,onExited:a,onEnter:T.onEnter,onEntered:_l([T.onEntered,function(){e.snack.requestClose&&i(null,"instructed",e.snack.id)}],k.id)}),M||s.createElement(m,Object.assign({},k)))))},ol={default:20},n1={default:6,dense:2},Tp="."+Ng,o1=ls({root:(nl={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:Ji(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},nl[Tp]={padding:n1.default+"px 0px",transition:"padding 300ms ease 0ms"},nl.maxWidth="calc(100% - "+2*ol.default+"px)",nl[Gd]={width:"100%",maxWidth:"calc(100% - 32px)"},nl),rootDense:(Yd={},Yd[Tp]={padding:n1.dense+"px 0px"},Yd),top:{top:ol.default-n1.default+"px",flexDirection:"column"},bottom:{bottom:ol.default-n1.default+"px",flexDirection:"column-reverse"},left:(e1={left:ol.default+"px"},e1[k1]={alignItems:"flex-start"},e1[Gd]={left:"16px"},e1),right:(t1={right:ol.default+"px"},t1[k1]={alignItems:"flex-end"},t1[Gd]={right:"16px"},t1),center:(Jd={left:"50%",transform:"translateX(-50%)"},Jd[k1]={alignItems:"center"},Jd)}),dM=function(e){var t=e.classes,n=t===void 0?{}:t,o=e.anchorOrigin,r=e.dense,i=e.children,a=G0(Qj,o1[o.vertical],o1[o.horizontal],o1.root,n.containerRoot,n["containerAnchorOrigin"+O5(o)],r&&o1.rootDense);return s.createElement("div",{className:a},i)},uM=s.memo(dM),jp=function(e){return!(typeof e=="string"||s.isValidElement(e))},pM=function(e){function t(n){var o;return(o=e.call(this,n)||this).enqueueSnackbar=function(r,i){if(i===void 0&&(i={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var a=jp(r)?r:i,d=jp(r)?r.message:r,c=a.key,u=a.preventDuplicate,p=as(a,["key","preventDuplicate"]),m=Ys(c),h=m?c:new Date().getTime()+Math.random(),g=Jj(p,o.props),f=Nn({id:h},p,{message:d,open:!0,entered:!1,requestClose:!1,persist:g("persist"),action:g("action"),content:g("content"),variant:g("variant"),anchorOrigin:g("anchorOrigin"),disableWindowBlurListener:g("disableWindowBlurListener"),autoHideDuration:g("autoHideDuration"),hideIconVariant:g("hideIconVariant"),TransitionComponent:g("TransitionComponent"),transitionDuration:g("transitionDuration"),TransitionProps:g("TransitionProps",!0),iconVariant:g("iconVariant",!0),style:g("style",!0),SnackbarProps:g("SnackbarProps",!0),className:G0(o.props.className,p.className)});return f.persist&&(f.autoHideDuration=void 0),o.setState(function(x){if(u===void 0&&o.props.preventDuplicate||u){var y=function(C){return m?C.id===h:C.message===d},w=x.queue.findIndex(y)>-1,b=x.snacks.findIndex(y)>-1;if(w||b)return x}return o.handleDisplaySnack(Nn({},x,{queue:[].concat(x.queue,[f])}))}),h},o.handleDisplaySnack=function(r){return r.snacks.length>=o.maxSnack?o.handleDismissOldest(r):o.processQueue(r)},o.processQueue=function(r){var i=r.queue,a=r.snacks;return i.length>0?Nn({},r,{snacks:[].concat(a,[i[0]]),queue:i.slice(1,i.length)}):r},o.handleDismissOldest=function(r){if(r.snacks.some(function(c){return!c.open||c.requestClose}))return r;var i=!1,a=!1;r.snacks.reduce(function(c,u){return c+(u.open&&u.persist?1:0)},0)===o.maxSnack&&(a=!0);var d=r.snacks.map(function(c){return i||c.persist&&!a?Nn({},c):(i=!0,c.entered?(c.onClose&&c.onClose(null,"maxsnack",c.id),o.props.onClose&&o.props.onClose(null,"maxsnack",c.id),Nn({},c,{open:!1})):Nn({},c,{requestClose:!0}))});return Nn({},r,{snacks:d})},o.handleEnteredSnack=function(r,i,a){if(!Ys(a))throw new Error("handleEnteredSnack Cannot be called with undefined key");o.setState(function(d){return{snacks:d.snacks.map(function(c){return c.id===a?Nn({},c,{entered:!0}):Nn({},c)})}})},o.handleCloseSnack=function(r,i,a){o.props.onClose&&o.props.onClose(r,i,a);var d=a===void 0;o.setState(function(c){var u=c.snacks,p=c.queue;return{snacks:u.map(function(m){return d||m.id===a?m.entered?Nn({},m,{open:!1}):Nn({},m,{requestClose:!0}):Nn({},m)}),queue:p.filter(function(m){return m.id!==a})}})},o.closeSnackbar=function(r){var i=o.state.snacks.find(function(a){return a.id===r});Ys(r)&&i&&i.onClose&&i.onClose(null,"instructed",r),o.handleCloseSnack(null,"instructed",r)},o.handleExitedSnack=function(r,i){if(!Ys(i))throw new Error("handleExitedSnack Cannot be called with undefined key");o.setState(function(a){var d=o.processQueue(Nn({},a,{snacks:a.snacks.filter(function(c){return c.id!==i})}));return d.queue.length===0?d:o.handleDismissOldest(d)})},o.enqueueSnackbar,o.closeSnackbar,o.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:o.enqueueSnackbar.bind(xp(o)),closeSnackbar:o.closeSnackbar.bind(xp(o))}},o}return Ag(t,e),t.prototype.render=function(){var n=this,o=this.state.contextValue,r=this.props,i=r.domRoot,a=r.children,d=r.dense,c=d!==void 0&&d,u=r.Components,p=u===void 0?{}:u,m=r.classes,h=this.state.snacks.reduce(function(f,x){var y,w=O5(x.anchorOrigin),b=f[w]||[];return Nn({},f,((y={})[w]=[].concat(b,[x]),y))},{}),g=Object.keys(h).map(function(f){var x=h[f],y=x[0];return s.createElement(uM,{key:f,dense:c,anchorOrigin:y.anchorOrigin,classes:m},x.map(function(w){return s.createElement(cM,{key:w.id,snack:w,classes:m,Component:p[w.variant],onClose:n.handleCloseSnack,onEnter:n.props.onEnter,onExit:n.props.onExit,onExited:_l([n.handleExitedSnack,n.props.onExited],w.id),onEntered:_l([n.handleEnteredSnack,n.props.onEntered],w.id)})}))});return s.createElement(Pg.Provider,{value:o},a,i?uo.createPortal(g,i):g)},Og(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||ii.maxSnack}}]),t}(s.Component),Wg=function(){return s.useContext(Pg)};const hM=[{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}],mM=[{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 Ug{constructor(t=hM,n=mM){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const t=[],n=this._readFormatType;for(let o=0;o<n.length;o++)for(let r=0;r<n[o].exts.length;r++)t.push("."+n[o].exts[r]);return t}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");try{return(await Promise.resolve().then(()=>sp)).WorkbookIO.writeFile(t,n,o)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(t,n){let o,r;const i=await n?.showBusy?.(`Opening${t.name?` ${t.name}`:""}...`);try{r=await Promise.resolve().then(()=>sp)}catch(a){throw a}try{return await r.WorkbookIO.read({...t,async onStart(a){await t?.onStart?.(a),o=await n?.showBusy?.(`Opening '${a}'...`)}})}catch(a){throw i?.(),o?.(),a}finally{i?.(),o?.()}}}const N0=new Ug,p0={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},qg=s.forwardRef((e,t)=>{const{id:n,message:o,iconVariant:r,error:i,hideIconVariant:a,...d}=e,{closeSnackbar:c}=Wg(),u=Pr(),[p,m]=s.useState(!1),h=s.useCallback(()=>{m(x=>!x)},[]),g=s.useCallback(()=>{c(n)},[n,c]);let f=i?.message;return!f&&s.isValidElement(o)&&(f=o),f||typeof o!="string"||(f=o),f||(f=`Unknown Error: ${o}`),l.jsx(P5,{ref:t,className:Zn(p0.root,"error-snackbar"),children:l.jsxs(B.Card,{className:p0.card,style:{backgroundColor:u.palette.error.dark,border:`1px solid ${u.palette.error.dark}`},children:[l.jsxs(B.CardActions,{className:p0.actionRoot,children:[a?null:r?.error,l.jsx(B.Typography,{variant:"body2",component:"div",className:p0.typography,style:{color:u.palette.text.primary},children:f}),l.jsx("div",{style:{flex:"1 1 auto"}}),l.jsxs("div",{className:p0.icons,children:[i?l.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:Zn(p0.expand,{[p0.expandOpen]:p}),style:{color:u.palette.action.active},onClick:h,children:l.jsx(gn.ExpandMore,{})}):null,l.jsx(B.IconButton,{size:"small",className:p0.expand,style:{color:u.palette.action.active},onClick:g,children:l.jsx(gn.Close,{fontSize:"small"})})]})]}),i?l.jsx(B.Collapse,{in:p,timeout:"auto",unmountOnExit:!0,children:l.jsx("div",{className:p0.stackTraceContainer,style:{backgroundColor:u.palette.error.light,borderTop:`1px solid ${u.palette.error.main}`},children:l.jsx(A2,{error:i,hideLineNumbers:!0})})}):null]})})});qg.displayName="ToastError";const Zg=s.memo(s.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="workbook",disabled:i=!1,...a}=e,d=de(u=>{const p={variant:Ht.Menuitem,parentFloat:u.floatReference,commandHook:o,scope:r,disabled:i},m=l.jsxs(l.Fragment,{children:[l.jsx(je,{...p,command:n.getCommand("newWorkbook"),icon:xe(l.jsx(Zw,{}))}),l.jsx(Mt,{orientation:"horizontal"}),l.jsx(je,{...p,command:n.getCommand("openWorkbook"),icon:xe(l.jsx(Gw,{}))}),l.jsx(In,{...p,commands:n,quickCommand:"saveWorkbook",icon:xe(l.jsx(Kw,{})),createPopupPanel:h=>{const g={...p,parentFloat:h.floatReference,scope:"saveWorkbook"},f=[];return N0.getWriteFormats().forEach(x=>{if(x.isDefault)return;let y=null;x.key==="CSV"?y=xe(l.jsx(Yw,{})):x.key==="Excel"&&(y=xe(l.jsx(Xw,{})));const w=n.getCommand(`saveWorkbookAs${x.key}`);w?f.push(s.createElement(je,{...g,key:x.key,command:w,icon:y})):console.warn(`Unable to resolve command: 'saveWorkbookAs${x.key}'`)}),wn({...h,children:f,onClick:()=>{h.closeFloatAll()}})}})]});return wn({...u,children:m,onClick:h=>{h.isDefaultPrevented||u.closeFloatAll()}})},[i,n,o,r]),c="File";return l.jsx(In,{commands:n,disabled:i,commandHook:o,scope:r,label:c,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:u=>`calc(1.25rem + ${u.spacing(2)}px)`}},...a,createPopupPanel:d,icon:l.jsx(ma,{className:"label",icon:null,label:c})})}));Zg.displayName="StandaloneFileCommandButton";const fM=l.jsx(Bo,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:l.jsx(B.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:l.jsx(FT,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Gg=s.memo(s.forwardRef((e,t)=>{const{commands:n,workbook:o,logo:r=fM,mainElement:i,showFileMenu:a=!0,showAppearanceMenu:d=!0,...c}=e,{reference:u}=l0(),[p,{width:m}]=ya(),h=m<530,g=a?l.jsx(Zg,{commands:n,commandHook:{beforeExecute(){u?.closeAll()},onError(w,b,C){}}}):null,f=d?l.jsx(rg,{commands:n,commandHook:{beforeExecute(){u?.closeAll()},onError(w,b,C){}}}):null,x=s.useMemo(()=>({paddingLeft:w=>w.spacing(1),paddingRight:w=>w.spacing(1)}),[]),y=s.useRef(null);return l.jsx(B.Box,{ref:is([y,p,t]),...c,children:_g({commands:n,renderCompact:h,workbook:o,selectWrapper:w=>l.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:[l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:b=>b.spacing(.5)},children:[r,l.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:b=>b.spacing(.25)},children:[g,w]})]}),l.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:i}),l.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:h&&!f?"0 0 auto":"1 1 100%"},children:f})]}),selectProps:x,toolbarsProps:{Home:{sx:{}}}})})}));Gg.displayName="StudioToolbar";const gM=e=>{const{workbook:t,setWorkbook:n,importExportDisabled:o,workbookTitle:r="export",setWorkbookTitle:i,notifier:a,requestWorkbookTitle:d,themeOptions:c,undoManager:u,commands:p,onExecute:m}=e,h=de(c?.onModeChange,[c?.onModeChange]),g=de(c?.onEnabledDarkGridChange,[c?.onEnabledDarkGridChange]),f=de(c?.onEnabledDarkImagesChange,[c?.onEnabledDarkImagesChange]),x=de(async(M=null,T=null)=>{const F=[];let _,O=null,S=null;if(typeof M=="string"?S=M:O=M,_=O?M:await zt.openFileDialog(S??N0.getAllReadFormatTypeAsString().join(",")),!_)return null;const v={source:_,createWorkbookOptions:T,onWarning:j=>{F.push(j)}},D=await N0.read(v,a);return F.length>0&&(a?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
|
|
95
95
|
`+F.join(`
|
|
96
|
-
`))),D},[m,a,t]),y=de(async(M,T,F)=>{if(!T&&d){const _=await d("Enter Workbook name to "+(F.isDefault?"Save.":`Export as ${F.description}.`));return _!==null&&N0.writeFile(_,M,{formatType:F.key})}return N0.writeFile(T,M,{formatType:F.key})},[a,t,d]),w=s.useCallback(()=>({contains:M=>!0,focus(){}}),[]),b=s.useMemo(()=>{const M=[];o||(N0.getWriteFormats().forEach(F=>{const _=F.isDefault,O={label:_?"Save Workbook":`Save Workbook as ${F.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${F.description}`},tags:F.tags,description:`Save the workbook to the desktop${_?"":` as ${F.description}`}.`};_&&(O.shortcut={key:"S",modifiers:[we.Ctrl]},M.push(new _e("saveWorkbookAs",w,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[we.Shift,we.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{y(t,null,F).catch(v=>{a?.showError?.(v)})})));const S=_?"saveWorkbook":`saveWorkbookAs${F.key}`;M.push(new _e(S,w,O,v=>{y(t,v??r,F).catch(D=>{a?.showError?.(D)})}))}),M.push(new _e("openWorkbook",w,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[we.Ctrl]}},async(F=null)=>{const _={date1904:t.isDate1904(),...t.options};try{const O=await x(F,_);if(!O)return;const S=O.title,v=O.workbook,D=v.getSelectedSheet();if(O.formatType.mimeType==="text/csv"){const j=t.findValidSheetName(S);await t.doBatch(async()=>{const R=D.getUsedRange();if(!R)return void a?.showMessage("The file appears to be blank.");await t.getSheets().add({name:j,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(R)},`Import CSV '${S}'`)}else t?.close(),i?.(S),n(v)}catch(O){a?.showError?.(O)}})),M.push(new _e("openWorkbookFromUrl",w,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(F){if(!F){const _=await a?.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(_.option!=="Open")return;F=_.input}F&&console.log("openWorkbookFromUrl",F)})));let T=[];return c&&(T=[new _e("themeMode",w,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new _e("defaultThemeMode",w,{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 _e("enableDarkGrid",w,{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 _e("enableDarkImages",w,{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."})]),[...M,...T,new ft("help",w,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new ft("showKeyboardShortcuts",w,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[we.Ctrl]}},()=>{}),new _e("gotoUrlGithub",w,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new _e("gotoUrlDiscord",w,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new _e("gotoUrlDocumentation",w,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new _e("gotoUrlIssue",w,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[t,r,a,o,c,p,u]),C=s.useMemo(()=>{let M=null;return M=p?p.createChildGroup(w,"standaloneWorkbook",!1):new Ei(w,"standaloneWorkbook"),M.addCommands(b,!0),M},[p,b]);(({manager:M,commands:T,disabled:F,notifier:_=uc})=>{const O=de(v=>{try{M?.undo(v)}catch(D){_.showError?.(D)}},[M]),S=de(v=>{try{M?.redo(v)}catch(D){_.showError?.(D)}},[M]);s.useMemo(()=>{if(!T)return;const v={contains:j=>!0,focus(){}},D=[new _e("undo",v,{label:"Undo",description:k3,shortcut:{key:"z",modifiers:[we.Ctrl]},disabled:!0},O),new _e("redo",v,{label:"Redo",description:E3,shortcut:[{key:"y",modifiers:[we.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[we.Alt]}],disabled:!0},S)];T?.addCommands(D,!0)},[T]),s.useEffect(()=>{if(!T)return;const v=()=>{const j=M?.getTopUndoDescription(),R={};var P;T.getCommand("undo").update({disabled:F||!M||!M.hasUndo(),description:j?(P=j,`Undo ${P}`):k3,state:R,context:{undoManager:M}});const I=M?.getTopRedoDescription();T.getCommand("redo").update({disabled:F||!M||!M.hasRedo(),description:I?dy(I):E3,state:R,context:{undoManager:M}})};if(v(),!M)return;const D=M.addListener({onStackChange(){v()}});return()=>D?.()},[M,T,F])})({manager:u,commands:C,notifier:a});const{themeMode:k}=_5();s.useEffect(()=>{if(!c||!C)return;const M=c.mode==="dark"||!c.mode&&k==="dark";C.getCommand("themeMode").update({state:c.mode??null,label:M?"Dark Mode":"Light Mode",scopedLabels:{appearance:M?"Dark Mode":"Light Mode"}}).updateCallback(()=>{h(M?sc.Light:sc.Dark)}),C.getCommand("defaultThemeMode").update({state:!c.mode}).updateCallback(()=>{h(null)}),C.getCommand("enableDarkGrid").update({state:c.enableDarkGrid}).updateCallback(()=>{g(!c.enableDarkGrid)}),C.getCommand("enableDarkImages").update({state:c.enableDarkImages}).updateCallback(()=>{f(!c.enableDarkImages)})},[k,c,b]);const{showModal:E}=h1();return s.useEffect(()=>{const M=()=>new Promise((T,F)=>{const _=s.lazy(()=>Promise.resolve().then(()=>require("./CU900NraHPDHMGJt.cjs"))),O=E(_,{title:"Shortcut Keys Reference",commands:C,onDone:()=>{O.hide()},TransitionProps:{onExited:()=>{T(!0)}}})});C.getCommand("showKeyboardShortcuts").updateCallback(()=>M()),C.getCommand("help").updateCallback(()=>M())},[b,C]),C},Kg=s.memo(s.forwardRef((e,t)=>{const{workbook:n,setWorkbook:o,refWorkbookTitle:r,titleWorkbook:i,setWorkbookTitle:a,titlePlaceHolder:d,children:c,undoManager:u,commands:p,importExportDisabled:m,themeOptions:h}=e,g=Wg(),f=g?g.enqueueSnackbar:()=>{},x=g?g.closeSnackbar:()=>{},[y,w]=s.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),b=s.useCallback(()=>{w(R=>({...R,isMounted:!0}))},[]),C=s.useCallback(()=>{w(R=>({...R,isMounted:!1}))},[]),k=function(){const[R,P]=s.useState(()=>new Map),{showModal:I,updateModal:L,destroyModal:H,hideModal:W}=h1({disableAutoDestroy:!0});return(A,U,X,ee)=>new Promise((V,$)=>{const z={...X,onHide:()=>{const Y=R.get(A);X?.onHide?.(),P(te=>(te.delete(A),te)),W(Y.id)},onDone:Y=>{const te=R.get(A);P(re=>(re.delete(A),re)),X?.onDone?.(Y),te&&te.id&&!ee?.disableAutoDestroy&&H(te.id)},onShown:Y=>{P(te=>{const re=te.get(A);return te.set(A,{...re,element:Y}),te}),V(Y)},open:!0},q=R.get(A);if(q)return L(q.id,z),void V(q.element);if(!U)return void $("invalid function");const G=s.lazy(U),Q=I(G,z,{destroyOnClose:!ee?.disableAutoDestroy});P(Y=>(Y.set(A,{id:Q.id,element:null}),Y))})}(),E=(()=>{const{showModal:R}=h1();return P=>new Promise(I=>{const L=R(HS,{...P,onOption(H){P?.onOption?.(H,H===P.cancelOption,H===P.defaultOption),I(H)},onDone:()=>{P?.onDone?.(),L.hide()}})})})(),M=(()=>{const{showModal:R}=h1();return P=>{const{defaultOption:I=P.options?.[0],cancelOption:L="Cancel",...H}=P;return new Promise(W=>{const A=R($S,{defaultOption:I,cancelOption:L,...H,onOption(U){H?.onOption?.(U,U===L,U===I),W({input:"",option:U})},onInputOption(U,X){H?.onInputOption?.(U,X),W({input:U,option:X})},onDone:()=>{H?.onDone?.(),A.hide()}})})}})(),T=s.useRef(new Set),F=s.useMemo(()=>{const R=(P,I)=>{if(I?.onceKey){if(T.current.has(I.onceKey))return;const H=new Set(T.current);H.add(I.onceKey),T.current=H}const L={variant:I?.type??v3,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:I?.preventDuplicate,persist:I?.persist??I?.type===a0,action:H=>l.jsx(B.IconButton,{onClick:()=>x(H),children:l.jsx(gn.CancelOutlined,{})})};I?.enqueueProps&&Object.assign(L,I.enqueueProps),P||console.log("message is 'null'",I),f(P??"Alert",L)};return{showMessage:R,showBusy:(P,I)=>{let L=null;const H=new Promise(W=>{L=W});return w(W=>{const A=new Map(W.starting);return A.set(H,L),{...W,label:P,starting:A}}),H},showWindow:(P,I,L)=>{const H={...I,onKeyDown:W=>{p?.dispatchToFocusedCommand(W),W.isDefaultPrevented()||W.isPropagationStopped()||I?.onKeyDown?.(W)}};return k(P,{sort:()=>Promise.resolve().then(()=>require("./IllnWqWVClWDW1ot.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./CO4rZgb0ObTZh6NO.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./CB6DGRkCA3BLDEFr.cjs")),comments:()=>Promise.resolve().then(()=>require("./klnhoS0cqBpCC5fo.cjs")),find:()=>Promise.resolve().then(()=>require("./Gj8MlEhOCg_o7idM.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./DmCCEKhedSOg163M.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./BknKSPzyXctJohHb.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./Blfxp7Ec3Yjx3gNU.cjs"))}[P],H,L)},showOptions:E,showInputOptions:M,showError:P=>{let I,L=a0,H="Unknown Error";typeof P=="string"?H=P:P instanceof Error&&(I=P,P.message&&(H=P.message)),P instanceof N.PartialError&&(L=v3),R(H,{type:L,enqueueProps:{error:I}})}}},[]),_=s.useCallback(()=>{},[]),O=gM({workbook:n,setWorkbook:o,importExportDisabled:m,workbookTitle:i,setWorkbookTitle:a,commands:p,requestWorkbookTitle:R=>new Promise(P=>{r.current?r.current.requestWorkbookTitle((I,L)=>{P(I)},{selectAll:!0,requestReason:R}):P(d)}),themeOptions:h,undoManager:u,notifier:F,onExecute:_});s.useEffect(()=>{y.starting.size<=0||!y.isMounted||w(R=>{const P=new Map(R.running);return R.starting.forEach((I,L)=>{const H=()=>{w(W=>{const A=new Map(W.running);return A.delete(L),{...W,running:A}})};P.set(L,H),I(H)}),{...R,starting:new Map,running:P}})},[y]);const[S,v]=s.useState(null);s.useEffect(()=>{y.starting.size!==0||y.running.size!==0?v(l.jsx(Z0,{icon:l.jsx(Nv,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:y.label,onMount:b,onUnmount:C,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):v(null)},[y.starting,y.running]);const D=s.useMemo(()=>l.jsx(ig,{commands:O,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[O]),j={notifier:F,commands:O};return n&&(j.statusBarProps={childrenEnd:D}),l.jsxs(l.Fragment,{children:[S,c?s.cloneElement(c,j):null]})}));Kg.displayName="SnackbarAndCommandsWrapper";const dc=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,style:r,onElementLoad:i,onError:a,undoManager:d,errorPanel:c=r9,onKeyDown:u,workbook:p,createWorkbookOptions:m,onWorkbookChange:h,logo:g,importExportDisabled:f=!1,themeOptions:x,autoFocus:y=!1,commands:w,title:b,onTitleChange:C,titleProps:k,renderLoadingPanel:E,...M}=e,T=s.useRef(null),F=de(h,[h]),_=de(C??k?.onTitleChange,[C??k?.onTitleChange]),O=k?.placeHolder??"Untitled",S=x?.mode,{themeMode:v,source:D}=_5({mode:S}),j=s.useMemo(()=>({...x,light:n4(!1,N.CommonUtils.deepMerge(x?.theme??{},x?.light??{})),dark:n4(!0,N.CommonUtils.deepMerge(x?.theme??{},x?.dark??{}))}),[x]),R=v===sc.Dark,[P,I]=s.useState(null);s.useEffect(()=>{I(d??new N.UndoManager)},[d]);const[L,H]=s.useState(null),[W,A]=s.useState(null),U=a5();s.useLayoutEffect(()=>{if(!p||Object.keys(p).length===0&&!N.CommonUtils.isPromiseLike(p)){const ne={theme:U.getDefaultTheme(),...m};A(new N.Workbook(ne))}else A(p)},[p]),s.useLayoutEffect(()=>{if(W){if(W instanceof N.Workbook)return H({workbook:W}),void(p!==W&&F?.(W));(async()=>{try{let ne,he=await Promise.resolve(W);he&&he.source&&(he=await N0.read(he)),he.workbook?(z(he.title),ne=he.workbook):ne=he,F?.(ne),H({workbook:ne})}catch(ne){F?.(null),H({error:ne})}})()}},[W]);const[X,ee]=s.useState(null);s.useEffect(()=>{if(!P||!L)return;P.clear();const ne=L?.workbook?.getTransactions();if(ne)return ne.addListener({onCommitEnd:he=>{he.getDescription()?P.addUndoOperation({description:he.getDescription(),undo:()=>(ne.revert(he.getId()),X.source?.focus(),()=>{ne.restore(he.getId()),X.source?.focus()})}):console.warn("commit has no description",he)}})},[P,L,X]);const V=de(ne=>{ne?P.setRepeatableOperation({description:ne.label(),repeat:async()=>ne.execute()}):P.setRepeatableOperation(null)},[P]),[$,z]=s.useState(b??k?.title??"");s.useEffect(()=>{z(b??k?.title??"")},[b??k?.title]),s.useEffect(()=>{_?.($)},[$]);const[q,G]=s.useState(null),Q=s.useMemo(()=>{const ne=()=>({contains:he=>!0,focus(){}});return w?w.createChildGroup(ne,"application",!1):new Ei(ne,"application")},[w]),Y=de(ne=>{G(ne.source.getViewportElement()),ee(ne),Q.activate("sheet"),i?.(ne)},[Q]);s.useEffect(()=>{X&&y&&X.source?.focus(typeof y=="object"?y:void 0)},[X]);const te=s.useRef(null),re=s.useCallback(ne=>{let he=null;return k?.hidden||(he=l.jsx(L5,{...k,style:{maxWidth:"100%",...k?.style},workbook:T.current,ref:te,title:$,placeHolder:O,onTitleChange:ze=>{z(ze)}})),l.jsx(Gg,{...ne,logo:g,mainElement:he,showFileMenu:!f,showAppearanceMenu:!!(j?.onEnabledDarkGridChange||j?.onEnabledDarkImagesChange||j?.onModeChange)})},[g,$,k,j,f,Q]);s.useEffect(()=>{const ne=he=>he.preventDefault();return T.current?.addEventListener("wheel",ne,{passive:!1}),()=>{T.current?.removeEventListener("wheel",ne)}},[]);const ge=s.useMemo(()=>{const ne={transparentBackground:!0};return l.jsx(B.Box,{sx:o,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:E?.(ne)??l.jsx(Z0,{...ne})})},[o,r,E]),J=s.useCallback(({error:ne})=>(a?.(ne),l.jsx(c,{sx:o,style:r,error:ne??"Unable to display empty workbook."})),[o,r,a]),se=s.useMemo(()=>({...o,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:ne=>ne.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[o]),Se=is([T,t]),Me=s.useMemo(()=>{if(!L)return ge;if(L.error||!L.workbook)return J({error:L.error});let ne=null,he=null,ze=!1;return j&&(ne=R?j.dark:j.light,he=R&&j.enableDarkGrid?j.dark:j.light,ze=j.enableDarkImages),l.jsx(D5,{sx:se,style:r,tabIndex:0,autoFocus:!0,workbook:L.workbook,ref:Se,renderToolbar:re,onElementLoad:Y,onRepeatCommandChange:V,onKeyDown:Ne=>{u?.(Ne)},renderLoadingPanel:E,gridTheme:he,headersTheme:ne,enableDarkImages:ze,className:Zn(n,"sheetxl-workbook"),onContextMenu:Ne=>Ne.preventDefault(),...M},"WorkbookElement")},[L,$,P,ge,E,j,M,re,se]);let oe=l.jsx(Bj,{fallbackRender:J,children:l.jsx(pM,{maxSnack:3,domRoot:q,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(ne,he,ze)=>{T.current?.focus()},Components:{error:qg},iconVariant:{success:l.jsx(B.SvgIcon,{style:{marginRight:"8px"},children:l.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:l.jsx(hv,{style:{marginRight:"8px"}})},children:l.jsx(lS,{children:l.jsx(Kg,{workbook:L?.workbook,setWorkbook:A,importExportDisabled:f,titlePlaceHolder:O,titleWorkbook:$,setWorkbookTitle:z,refWorkbookTitle:te,commands:Q,undoManager:P,themeOptions:j,children:Me})})})});return j&&(oe=l.jsxs(am,{theme:R?j.dark:j.light,children:[j.cssBaseline?l.jsx(B.CssBaseline,{}):null,oe]})),oe}));dc.displayName="EagerStudio";const xM=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:dc,default:dc},Symbol.toStringTag,{value:"Module"}));exports.$7=z2,exports.$i=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),l.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),l.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports.A0=jo,exports.AppearanceCommandButton=rg,exports.At=uc,exports.AutoColorPosition=ra,exports.Bi=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),l.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),l.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.BorderCommandButton=Of,exports.BorderPopupButton=Lf,exports.BorderStyleButton=Df,exports.Checkboard=Rf,exports.ClearCommandButton=c5,exports.ColorButton=Dc,exports.ColorCommandButton=xa,exports.ColorPanel=If,exports.ColorPanelType=Mf,exports.ColorPopupButton=s5,exports.D8=zu,exports.DeleteCellsCommandButton=u5,exports.DocThemeCommandButton=og,exports.EagerStudio=dc,exports.Fi=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),l.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.FillCommandButton=Nf,exports.FilterColumnMenu=v5,exports.FilterCommandButton=KT,exports.Filters=fg,exports.FindCommandButton=Ff,exports.FontFamilyCommandButton=$f,exports.FontSizeCommandButton=zf,exports.FormulaBar=w5,exports.FreezeCommandButton=Pf,exports.HelpCommandButton=ig,exports.HorizontalAlignCommandButton=H9,exports.Ii=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),l.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.InsertCellsCommandButton=d5,exports.InsertImageCommandButton=f5,exports.InsertScriptCommandButton=kg,exports.Lo=Al,exports.MergeCommandButton=Af,exports.NamedCollectionEditor=b5,exports.NamedInput=sg,exports.NumberFormatCommandButton=Bf,exports.PasteCommandButton=m5,exports.PresetCellStylesCommandButton=Kf,exports.PresetTableStylesCommandButton=Qf,exports.Pt=Mt,exports.QuickFormulaSumCommandPopupButton=ej,exports.RangeInput=cg,exports.Re=Ah,exports.Ri=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),l.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),l.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.RunScriptCommandButton=M5,exports.ScriptEditorToolbar=T5,exports.ScriptWorkspace=j5,exports.SheetTab=S5,exports.SheetTabMenu=C5,exports.SheetZoomScale=g5,exports.SheetsAllMenu=k5,exports.SortFilterCommandButton=p5,exports.StatusBar=x5,exports.Studio=Ig,exports.StyledStrokeIcon=a2,exports.T=de,exports.THEME_ID=V0,exports.TableStyleCanvasPreview=Jf,exports.TableStyleOptionsPanel=JT,exports.TableStylePreview=Yf,exports.TextEffectsCommandButton=Wf,exports.TextOverflowCommandButton=W9,exports.TextRotateCommandButton=U9,exports.ThemeMode=sc,exports.ThemeSelectButton=eg,exports.ThemeSelectPanel=tg,exports.ThemeSelectPopupButton=ng,exports.UnderlineCommandButton=Uf,exports.UndoRedoCommandButton=h5,exports.VerticalAlignCommandButton=$9,exports.ViewGridLinesCommandButton=Vf,exports.ViewHeadingsCommandButton=qf,exports.WalkingCopyCommandButton=Lc,exports.Wi=e=>l.jsx(B.SvgIcon,{...e,children:l.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.WorkbookContextMenu=I5,exports.WorkbookElement=D5,exports.WorkbookIO=N0,exports.WorkbookStrip=R5,exports.WorkbookTitle=L5,exports.WorkbookViewCommandButton=Zf,exports.Yt=zt,exports.Z=we,exports.Z0=zo,exports._WorkbookIO=Ug,exports._extends=ac,exports._objectWithoutPropertiesLoose=E5,exports._setPrototypeOf=lc,exports.clsx=G0,exports.clsx$1=Zn,exports.commonjsGlobal=qi,exports.createGridStyleFromMUITheme=c2,exports.createTheme=tm,exports.defaultNewWorkbook=jg,exports.defaultTheme=im,exports.eo=Wt,exports.fo=q0,exports.getDefaultExportFromCjs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.getOverlayAlpha=kn,exports.ht=Gt,exports.io=hn,exports.isPlainObject=x0,exports.ji=Qh,exports.jn=M9,exports.renderWorkbookLoadingPanel=Rg,exports.requirePropTypes=ts,exports.rl=x9,exports.s0=un,exports.setPrintExamplesOnLoad=e=>{gg=e},exports.styleFunctionSx=wa,exports.useMeasure=ya,exports.useResolvedThemeMode=_5,exports.useTheme=Pr,exports.useWorkbookCommands=Tg,exports.vr=je,exports.w5=xe,exports.yo=Ht;
|
|
96
|
+
`))),D},[m,a,t]),y=de(async(M,T,F)=>{if(!T&&d){const _=await d("Enter Workbook name to "+(F.isDefault?"Save.":`Export as ${F.description}.`));return _!==null&&N0.writeFile(_,M,{formatType:F.key})}return N0.writeFile(T,M,{formatType:F.key})},[a,t,d]),w=s.useCallback(()=>({contains:M=>!0,focus(){}}),[]),b=s.useMemo(()=>{const M=[];o||(N0.getWriteFormats().forEach(F=>{const _=F.isDefault,O={label:_?"Save Workbook":`Save Workbook as ${F.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${F.description}`},tags:F.tags,description:`Save the workbook to the desktop${_?"":` as ${F.description}`}.`};_&&(O.shortcut={key:"S",modifiers:[we.Ctrl]},M.push(new _e("saveWorkbookAs",w,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[we.Shift,we.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{y(t,null,F).catch(v=>{a?.showError?.(v)})})));const S=_?"saveWorkbook":`saveWorkbookAs${F.key}`;M.push(new _e(S,w,O,v=>{y(t,v??r,F).catch(D=>{a?.showError?.(D)})}))}),M.push(new _e("openWorkbook",w,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[we.Ctrl]}},async(F=null)=>{const _={date1904:t.isDate1904(),...t.options};try{const O=await x(F,_);if(!O)return;const S=O.title,v=O.workbook,D=v.getSelectedSheet();if(O.formatType.mimeType==="text/csv"){const j=t.findValidSheetName(S);await t.doBatch(async()=>{const R=D.getUsedRange();if(!R)return void a?.showMessage("The file appears to be blank.");await t.getSheets().add({name:j,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(R)},`Import CSV '${S}'`)}else t?.close(),i?.(S),n(v)}catch(O){a?.showError?.(O)}})),M.push(new _e("openWorkbookFromUrl",w,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(F){if(!F){const _=await a?.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(_.option!=="Open")return;F=_.input}F&&console.log("openWorkbookFromUrl",F)})));let T=[];return c&&(T=[new _e("themeMode",w,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new _e("defaultThemeMode",w,{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 _e("enableDarkGrid",w,{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 _e("enableDarkImages",w,{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."})]),[...M,...T,new ft("help",w,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new ft("showKeyboardShortcuts",w,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[we.Ctrl]}},()=>{}),new _e("gotoUrlGithub",w,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new _e("gotoUrlDiscord",w,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new _e("gotoUrlDocumentation",w,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new _e("gotoUrlIssue",w,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[t,r,a,o,c,p,u]),C=s.useMemo(()=>{let M=null;return M=p?p.createChildGroup(w,"standaloneWorkbook",!1):new Ei(w,"standaloneWorkbook"),M.addCommands(b,!0),M},[p,b]);(({manager:M,commands:T,disabled:F,notifier:_=uc})=>{const O=de(v=>{try{M?.undo(v)}catch(D){_.showError?.(D)}},[M]),S=de(v=>{try{M?.redo(v)}catch(D){_.showError?.(D)}},[M]);s.useMemo(()=>{if(!T)return;const v={contains:j=>!0,focus(){}},D=[new _e("undo",v,{label:"Undo",description:k3,shortcut:{key:"z",modifiers:[we.Ctrl]},disabled:!0},O),new _e("redo",v,{label:"Redo",description:E3,shortcut:[{key:"y",modifiers:[we.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[we.Alt]}],disabled:!0},S)];T?.addCommands(D,!0)},[T]),s.useEffect(()=>{if(!T)return;const v=()=>{const j=M?.getTopUndoDescription(),R={};var P;T.getCommand("undo").update({disabled:F||!M||!M.hasUndo(),description:j?(P=j,`Undo ${P}`):k3,state:R,context:{undoManager:M}});const I=M?.getTopRedoDescription();T.getCommand("redo").update({disabled:F||!M||!M.hasRedo(),description:I?dy(I):E3,state:R,context:{undoManager:M}})};if(v(),!M)return;const D=M.addListener({onStackChange(){v()}});return()=>D?.()},[M,T,F])})({manager:u,commands:C,notifier:a});const{themeMode:k}=_5();s.useEffect(()=>{if(!c||!C)return;const M=c.mode==="dark"||!c.mode&&k==="dark";C.getCommand("themeMode").update({state:c.mode??null,label:M?"Dark Mode":"Light Mode",scopedLabels:{appearance:M?"Dark Mode":"Light Mode"}}).updateCallback(()=>{h(M?sc.Light:sc.Dark)}),C.getCommand("defaultThemeMode").update({state:!c.mode}).updateCallback(()=>{h(null)}),C.getCommand("enableDarkGrid").update({state:c.enableDarkGrid}).updateCallback(()=>{g(!c.enableDarkGrid)}),C.getCommand("enableDarkImages").update({state:c.enableDarkImages}).updateCallback(()=>{f(!c.enableDarkImages)})},[k,c,b]);const{showModal:E}=h1();return s.useEffect(()=>{const M=()=>new Promise((T,F)=>{const _=s.lazy(()=>Promise.resolve().then(()=>require("./DFqjzGGReUL-7MoI.cjs"))),O=E(_,{title:"Shortcut Keys Reference",commands:C,onDone:()=>{O.hide()},TransitionProps:{onExited:()=>{T(!0)}}})});C.getCommand("showKeyboardShortcuts").updateCallback(()=>M()),C.getCommand("help").updateCallback(()=>M())},[b,C]),C},Kg=s.memo(s.forwardRef((e,t)=>{const{workbook:n,setWorkbook:o,refWorkbookTitle:r,titleWorkbook:i,setWorkbookTitle:a,titlePlaceHolder:d,children:c,undoManager:u,commands:p,importExportDisabled:m,themeOptions:h}=e,g=Wg(),f=g?g.enqueueSnackbar:()=>{},x=g?g.closeSnackbar:()=>{},[y,w]=s.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),b=s.useCallback(()=>{w(R=>({...R,isMounted:!0}))},[]),C=s.useCallback(()=>{w(R=>({...R,isMounted:!1}))},[]),k=function(){const[R,P]=s.useState(()=>new Map),{showModal:I,updateModal:L,destroyModal:H,hideModal:W}=h1({disableAutoDestroy:!0});return(A,U,X,ee)=>new Promise((V,$)=>{const z={...X,onHide:()=>{const Y=R.get(A);X?.onHide?.(),P(te=>(te.delete(A),te)),W(Y.id)},onDone:Y=>{const te=R.get(A);P(re=>(re.delete(A),re)),X?.onDone?.(Y),te&&te.id&&!ee?.disableAutoDestroy&&H(te.id)},onShown:Y=>{P(te=>{const re=te.get(A);return te.set(A,{...re,element:Y}),te}),V(Y)},open:!0},q=R.get(A);if(q)return L(q.id,z),void V(q.element);if(!U)return void $("invalid function");const G=s.lazy(U),Q=I(G,z,{destroyOnClose:!ee?.disableAutoDestroy});P(Y=>(Y.set(A,{id:Q.id,element:null}),Y))})}(),E=(()=>{const{showModal:R}=h1();return P=>new Promise(I=>{const L=R(HS,{...P,onOption(H){P?.onOption?.(H,H===P.cancelOption,H===P.defaultOption),I(H)},onDone:()=>{P?.onDone?.(),L.hide()}})})})(),M=(()=>{const{showModal:R}=h1();return P=>{const{defaultOption:I=P.options?.[0],cancelOption:L="Cancel",...H}=P;return new Promise(W=>{const A=R($S,{defaultOption:I,cancelOption:L,...H,onOption(U){H?.onOption?.(U,U===L,U===I),W({input:"",option:U})},onInputOption(U,X){H?.onInputOption?.(U,X),W({input:U,option:X})},onDone:()=>{H?.onDone?.(),A.hide()}})})}})(),T=s.useRef(new Set),F=s.useMemo(()=>{const R=(P,I)=>{if(I?.onceKey){if(T.current.has(I.onceKey))return;const H=new Set(T.current);H.add(I.onceKey),T.current=H}const L={variant:I?.type??v3,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:I?.preventDuplicate,persist:I?.persist??I?.type===a0,action:H=>l.jsx(B.IconButton,{onClick:()=>x(H),children:l.jsx(gn.CancelOutlined,{})})};I?.enqueueProps&&Object.assign(L,I.enqueueProps),P||console.log("message is 'null'",I),f(P??"Alert",L)};return{showMessage:R,showBusy:(P,I)=>{let L=null;const H=new Promise(W=>{L=W});return w(W=>{const A=new Map(W.starting);return A.set(H,L),{...W,label:P,starting:A}}),H},showWindow:(P,I,L)=>{const H={...I,onKeyDown:W=>{p?.dispatchToFocusedCommand(W),W.isDefaultPrevented()||W.isPropagationStopped()||I?.onKeyDown?.(W)}};return k(P,{sort:()=>Promise.resolve().then(()=>require("./nyCcUTXcNQz4oeHS.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./Die-N4kV2bzafWfb.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./Ctj6jurjmyOjmyC_.cjs")),comments:()=>Promise.resolve().then(()=>require("./BzMxZOWpUV_RYST5.cjs")),find:()=>Promise.resolve().then(()=>require("./CXs0QRWS8JCF5XHE.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./D6vlAfPBLlktoBgq.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./C5nAx9uKHMANWBcf.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./BsjtiKh23e6v8G0f.cjs"))}[P],H,L)},showOptions:E,showInputOptions:M,showError:P=>{let I,L=a0,H="Unknown Error";typeof P=="string"?H=P:P instanceof Error&&(I=P,P.message&&(H=P.message)),P instanceof N.PartialError&&(L=v3),R(H,{type:L,enqueueProps:{error:I}})}}},[]),_=s.useCallback(()=>{},[]),O=gM({workbook:n,setWorkbook:o,importExportDisabled:m,workbookTitle:i,setWorkbookTitle:a,commands:p,requestWorkbookTitle:R=>new Promise(P=>{r.current?r.current.requestWorkbookTitle((I,L)=>{P(I)},{selectAll:!0,requestReason:R}):P(d)}),themeOptions:h,undoManager:u,notifier:F,onExecute:_});s.useEffect(()=>{y.starting.size<=0||!y.isMounted||w(R=>{const P=new Map(R.running);return R.starting.forEach((I,L)=>{const H=()=>{w(W=>{const A=new Map(W.running);return A.delete(L),{...W,running:A}})};P.set(L,H),I(H)}),{...R,starting:new Map,running:P}})},[y]);const[S,v]=s.useState(null);s.useEffect(()=>{y.starting.size!==0||y.running.size!==0?v(l.jsx(Z0,{icon:l.jsx(Nv,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:y.label,onMount:b,onUnmount:C,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):v(null)},[y.starting,y.running]);const D=s.useMemo(()=>l.jsx(ig,{commands:O,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[O]),j={notifier:F,commands:O};return n&&(j.statusBarProps={childrenEnd:D}),l.jsxs(l.Fragment,{children:[S,c?s.cloneElement(c,j):null]})}));Kg.displayName="SnackbarAndCommandsWrapper";const dc=s.memo(s.forwardRef((e,t)=>{const{className:n,sx:o,style:r,onElementLoad:i,onError:a,undoManager:d,errorPanel:c=r9,onKeyDown:u,workbook:p,createWorkbookOptions:m,onWorkbookChange:h,logo:g,importExportDisabled:f=!1,themeOptions:x,autoFocus:y=!1,commands:w,title:b,onTitleChange:C,titleProps:k,renderLoadingPanel:E,...M}=e,T=s.useRef(null),F=de(h,[h]),_=de(C??k?.onTitleChange,[C??k?.onTitleChange]),O=k?.placeHolder??"Untitled",S=x?.mode,{themeMode:v,source:D}=_5({mode:S}),j=s.useMemo(()=>({...x,light:n4(!1,N.CommonUtils.deepMerge(x?.theme??{},x?.light??{})),dark:n4(!0,N.CommonUtils.deepMerge(x?.theme??{},x?.dark??{}))}),[x]),R=v===sc.Dark,[P,I]=s.useState(null);s.useEffect(()=>{I(d??new N.UndoManager)},[d]);const[L,H]=s.useState(null),[W,A]=s.useState(null),U=a5();s.useLayoutEffect(()=>{if(!p||Object.keys(p).length===0&&!N.CommonUtils.isPromiseLike(p)){const ne={theme:U.getDefaultTheme(),...m};A(new N.Workbook(ne))}else A(p)},[p]),s.useLayoutEffect(()=>{if(W){if(W instanceof N.Workbook)return H({workbook:W}),void(p!==W&&F?.(W));(async()=>{try{let ne,he=await Promise.resolve(W);he&&he.source&&(he=await N0.read(he)),he.workbook?(z(he.title),ne=he.workbook):ne=he,F?.(ne),H({workbook:ne})}catch(ne){F?.(null),H({error:ne})}})()}},[W]);const[X,ee]=s.useState(null);s.useEffect(()=>{if(!P||!L)return;P.clear();const ne=L?.workbook?.getTransactions();if(ne)return ne.addListener({onCommitEnd:he=>{he.getDescription()?P.addUndoOperation({description:he.getDescription(),undo:()=>(ne.revert(he.getId()),X.source?.focus(),()=>{ne.restore(he.getId()),X.source?.focus()})}):console.warn("commit has no description",he)}})},[P,L,X]);const V=de(ne=>{ne?P.setRepeatableOperation({description:ne.label(),repeat:async()=>ne.execute()}):P.setRepeatableOperation(null)},[P]),[$,z]=s.useState(b??k?.title??"");s.useEffect(()=>{z(b??k?.title??"")},[b??k?.title]),s.useEffect(()=>{_?.($)},[$]);const[q,G]=s.useState(null),Q=s.useMemo(()=>{const ne=()=>({contains:he=>!0,focus(){}});return w?w.createChildGroup(ne,"application",!1):new Ei(ne,"application")},[w]),Y=de(ne=>{G(ne.source.getViewportElement()),ee(ne),Q.activate("sheet"),i?.(ne)},[Q]);s.useEffect(()=>{X&&y&&X.source?.focus(typeof y=="object"?y:void 0)},[X]);const te=s.useRef(null),re=s.useCallback(ne=>{let he=null;return k?.hidden||(he=l.jsx(L5,{...k,style:{maxWidth:"100%",...k?.style},workbook:T.current,ref:te,title:$,placeHolder:O,onTitleChange:ze=>{z(ze)}})),l.jsx(Gg,{...ne,logo:g,mainElement:he,showFileMenu:!f,showAppearanceMenu:!!(j?.onEnabledDarkGridChange||j?.onEnabledDarkImagesChange||j?.onModeChange)})},[g,$,k,j,f,Q]);s.useEffect(()=>{const ne=he=>he.preventDefault();return T.current?.addEventListener("wheel",ne,{passive:!1}),()=>{T.current?.removeEventListener("wheel",ne)}},[]);const ge=s.useMemo(()=>{const ne={transparentBackground:!0};return l.jsx(B.Box,{sx:o,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:E?.(ne)??l.jsx(Z0,{...ne})})},[o,r,E]),J=s.useCallback(({error:ne})=>(a?.(ne),l.jsx(c,{sx:o,style:r,error:ne??"Unable to display empty workbook."})),[o,r,a]),se=s.useMemo(()=>({...o,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:ne=>ne.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[o]),Se=is([T,t]),Me=s.useMemo(()=>{if(!L)return ge;if(L.error||!L.workbook)return J({error:L.error});let ne=null,he=null,ze=!1;return j&&(ne=R?j.dark:j.light,he=R&&j.enableDarkGrid?j.dark:j.light,ze=j.enableDarkImages),l.jsx(D5,{sx:se,style:r,tabIndex:0,autoFocus:!0,workbook:L.workbook,ref:Se,renderToolbar:re,onElementLoad:Y,onRepeatCommandChange:V,onKeyDown:Ne=>{u?.(Ne)},renderLoadingPanel:E,gridTheme:he,headersTheme:ne,enableDarkImages:ze,className:Zn(n,"sheetxl-workbook"),onContextMenu:Ne=>Ne.preventDefault(),...M},"WorkbookElement")},[L,$,P,ge,E,j,M,re,se]);let oe=l.jsx(Bj,{fallbackRender:J,children:l.jsx(pM,{maxSnack:3,domRoot:q,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(ne,he,ze)=>{T.current?.focus()},Components:{error:qg},iconVariant:{success:l.jsx(B.SvgIcon,{style:{marginRight:"8px"},children:l.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:l.jsx(hv,{style:{marginRight:"8px"}})},children:l.jsx(lS,{children:l.jsx(Kg,{workbook:L?.workbook,setWorkbook:A,importExportDisabled:f,titlePlaceHolder:O,titleWorkbook:$,setWorkbookTitle:z,refWorkbookTitle:te,commands:Q,undoManager:P,themeOptions:j,children:Me})})})});return j&&(oe=l.jsxs(am,{theme:R?j.dark:j.light,children:[j.cssBaseline?l.jsx(B.CssBaseline,{}):null,oe]})),oe}));dc.displayName="EagerStudio";const xM=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:dc,default:dc},Symbol.toStringTag,{value:"Module"}));exports.$7=z2,exports.$i=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),l.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),l.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports.A0=jo,exports.AppearanceCommandButton=rg,exports.At=uc,exports.AutoColorPosition=ra,exports.Bi=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),l.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),l.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.BorderCommandButton=Of,exports.BorderPopupButton=Lf,exports.BorderStyleButton=Df,exports.Checkboard=Rf,exports.ClearCommandButton=c5,exports.ColorButton=Dc,exports.ColorCommandButton=xa,exports.ColorPanel=If,exports.ColorPanelType=Mf,exports.ColorPopupButton=s5,exports.D8=zu,exports.DeleteCellsCommandButton=u5,exports.DocThemeCommandButton=og,exports.EagerStudio=dc,exports.Fi=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),l.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.FillCommandButton=Nf,exports.FilterColumnMenu=v5,exports.FilterCommandButton=KT,exports.Filters=fg,exports.FindCommandButton=Ff,exports.FontFamilyCommandButton=$f,exports.FontSizeCommandButton=zf,exports.FormulaBar=w5,exports.FreezeCommandButton=Pf,exports.HelpCommandButton=ig,exports.HorizontalAlignCommandButton=H9,exports.Ii=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),l.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.InsertCellsCommandButton=d5,exports.InsertImageCommandButton=f5,exports.InsertScriptCommandButton=kg,exports.Lo=Al,exports.MergeCommandButton=Af,exports.NamedCollectionEditor=b5,exports.NamedInput=sg,exports.NumberFormatCommandButton=Bf,exports.PasteCommandButton=m5,exports.PresetCellStylesCommandButton=Kf,exports.PresetTableStylesCommandButton=Qf,exports.Pt=Mt,exports.QuickFormulaSumCommandPopupButton=ej,exports.RangeInput=cg,exports.Re=Ah,exports.Ri=e=>l.jsxs(B.SvgIcon,{...e,children:[l.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),l.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),l.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.RunScriptCommandButton=M5,exports.ScriptEditorToolbar=T5,exports.ScriptWorkspace=j5,exports.SheetTab=S5,exports.SheetTabMenu=C5,exports.SheetZoomScale=g5,exports.SheetsAllMenu=k5,exports.SortFilterCommandButton=p5,exports.StatusBar=x5,exports.Studio=Ig,exports.StyledStrokeIcon=a2,exports.T=de,exports.THEME_ID=V0,exports.TableStyleCanvasPreview=Jf,exports.TableStyleOptionsPanel=JT,exports.TableStylePreview=Yf,exports.TextEffectsCommandButton=Wf,exports.TextOverflowCommandButton=W9,exports.TextRotateCommandButton=U9,exports.ThemeMode=sc,exports.ThemeSelectButton=eg,exports.ThemeSelectPanel=tg,exports.ThemeSelectPopupButton=ng,exports.UnderlineCommandButton=Uf,exports.UndoRedoCommandButton=h5,exports.VerticalAlignCommandButton=$9,exports.ViewGridLinesCommandButton=Vf,exports.ViewHeadingsCommandButton=qf,exports.WalkingCopyCommandButton=Lc,exports.Wi=e=>l.jsx(B.SvgIcon,{...e,children:l.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.WorkbookContextMenu=I5,exports.WorkbookElement=D5,exports.WorkbookIO=N0,exports.WorkbookStrip=R5,exports.WorkbookTitle=L5,exports.WorkbookViewCommandButton=Zf,exports.Yt=zt,exports.Z=we,exports.Z0=zo,exports._WorkbookIO=Ug,exports._extends=ac,exports._objectWithoutPropertiesLoose=E5,exports._setPrototypeOf=lc,exports.clsx=G0,exports.clsx$1=Zn,exports.commonjsGlobal=qi,exports.createGridStyleFromMUITheme=c2,exports.createTheme=tm,exports.defaultNewWorkbook=jg,exports.defaultTheme=im,exports.eo=Wt,exports.fo=q0,exports.getDefaultExportFromCjs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.getOverlayAlpha=kn,exports.ht=Gt,exports.io=hn,exports.isPlainObject=x0,exports.ji=Qh,exports.jn=M9,exports.renderWorkbookLoadingPanel=Rg,exports.requirePropTypes=ts,exports.rl=x9,exports.s0=un,exports.setPrintExamplesOnLoad=e=>{gg=e},exports.styleFunctionSx=wa,exports.useMeasure=ya,exports.useResolvedThemeMode=_5,exports.useTheme=Pr,exports.useWorkbookCommands=Tg,exports.vr=je,exports.w5=xe,exports.yo=Ht;
|