@sheetxl/studio-mui 0.4.11 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/browser/cjs/{xp2ZII-PuLk9tHK3.cjs → 34mwIxXhbXYv5xsc.cjs} +1 -1
  2. package/browser/cjs/{Cfb0T6htsh82UPK-.cjs → 3OIgTi54FC0IBzyK.cjs} +2 -2
  3. package/browser/cjs/{Df5v6knUJ4dqHmmo.cjs → B-Aq2h8aSDrc_0iZ.cjs} +1 -1
  4. package/browser/cjs/{B29yIlf_FSHx9q3M.cjs → BDhT8qcsUqUILki7.cjs} +1 -1
  5. package/browser/cjs/{uoBAuXnlUz8scSA1.cjs → BKJsMQHem8u-jMiR.cjs} +1 -1
  6. package/browser/cjs/{Bhh0dqxUzzOzHWMc.cjs → BO7LEbRChpLg-xKv.cjs} +1 -1
  7. package/browser/cjs/{D7xmeRe-f7IifEKc.cjs → BZR-qDCIYdiDtD-U.cjs} +1 -1
  8. package/browser/cjs/{BbvcxaJzfy7H6xfa.cjs → BfE1_C2EpBrmB7bt.cjs} +1 -1
  9. package/browser/cjs/{Clbakb5VUTDTlofM.cjs → Brij8vl9GntSQBer.cjs} +2 -2
  10. package/browser/cjs/{xq-CJbsvm7BQO8lK.cjs → C61z_849Y2mg6eYL.cjs} +2 -2
  11. package/browser/cjs/{CH50hiw_7LBSC6dR.cjs → CaKjImRkCm3-QSAI.cjs} +2 -2
  12. package/browser/cjs/{DCV-6w2JGk_faE3x.cjs → Cw7iXqLfwZMRGb3J.cjs} +2 -2
  13. package/browser/cjs/{BQ-G2ABc3FYN-D50.cjs → CwwItA5xvSx0QgDn.cjs} +2 -2
  14. package/browser/cjs/{BE6O6K7i1mHBC3et.cjs → DPTcPoZ3PiOOW7lp.cjs} +2 -2
  15. package/browser/cjs/{DY2PuDSgw0TrB5-_.cjs → DhmN913n5MBAZsij.cjs} +2 -2
  16. package/browser/cjs/{aOmlMJRAkQEF59EX.cjs → DhoDW4ohnPkwiE_o.cjs} +2 -2
  17. package/browser/cjs/{QB_8kWYEsfOH_HwK.cjs → Dj_PjsvImW3tjX0i.cjs} +2 -2
  18. package/browser/cjs/{DyzVC_iq7ceqC2fj.cjs → Dl4WPIJFTvpCXOs3.cjs} +2 -2
  19. package/browser/cjs/{B783moVfFT70yQuK.cjs → QCtfu4qn-ovJa_wL.cjs} +2 -2
  20. package/browser/cjs/{u0WmWLGlCwhnhL9i.cjs → VQ4Cuzvkmtel1iE_.cjs} +2 -2
  21. package/browser/cjs/{li-J7BWV6WUzY5aq.cjs → VTMW1yjPzEJGyBmh.cjs} +1 -1
  22. package/browser/cjs/{CisYglNTHGrj9oMH.cjs → hY59MepmKCIoN0hM.cjs} +2 -2
  23. package/browser/cjs/index.cjs +2 -2
  24. package/browser/cjs/{BabvaPi1dUIPt5AG.cjs → pKp_fof7vGupYAM2.cjs} +2 -2
  25. package/browser/cjs/{BCtVyhxIZSUPH_Z4.cjs → t-9gaLqrOnGiw-3T.cjs} +1 -1
  26. package/browser/esm/{BVRUNnRvnt7aVCDD.mjs → 5U4XS5qxb3oJ33qK.mjs} +1 -1
  27. package/browser/esm/{_ZR9nT54xwy-C6ow.mjs → BPMMuKIe5xb3-D8V.mjs} +2 -2
  28. package/browser/esm/{BauTkiamxm0HDt6M.mjs → BXartMrqQuAXu0Qz.mjs} +1 -1
  29. package/browser/esm/{BTD5k7gtFcqDwslB.mjs → Bc8N72T3wtTApPEG.mjs} +2 -2
  30. package/browser/esm/{Djo2IS-ivmVSrO3v.mjs → BjoQXBQuDry5Fgc_.mjs} +2 -2
  31. package/browser/esm/{7jSMnphGrNRPUa_S.mjs → BlUq84tk9v01SQgx.mjs} +2 -2
  32. package/browser/esm/{CJawFB555VEY-Vge.mjs → C5iuJTeAtknnUEIE.mjs} +1 -1
  33. package/browser/esm/{Csk8rXNpaXmf5g7O.mjs → CN67iG3xuQhXAPad.mjs} +2 -2
  34. package/browser/esm/{12Ttun7hzbiInyVr.mjs → CQgUOqCEwTc61uuT.mjs} +1 -1
  35. package/browser/esm/{Z1_72ZY8rW2Mc3g_.mjs → Cq1DtQcbtmTtKOc4.mjs} +2 -2
  36. package/browser/esm/{Cu-5HDPN8B0qE77-.mjs → Cqz35dsi-gZArS0S.mjs} +2 -2
  37. package/browser/esm/{B-Ut_yUCD9THCz0T.mjs → D9wzPAaUYfW5yKFN.mjs} +1 -1
  38. package/browser/esm/{Hy95ExHvIFgzxQb-.mjs → DRRzJ8Ep6_Tyd6ne.mjs} +1 -1
  39. package/browser/esm/{BpGexBYtmHbTIJz2.mjs → DSGJzNzS8OeMxUW1.mjs} +1 -1
  40. package/browser/esm/{AnCmK-idMDJ2vI8H.mjs → DSIpyed_o2mrjd0r.mjs} +2 -2
  41. package/browser/esm/{Cr46Bo9bGoz0LbWq.mjs → DWgrVUwlK4kwFJn-.mjs} +2 -2
  42. package/browser/esm/{CWogLlWYHiL4W6CH.mjs → Dr6QLJSwckbF9K_u.mjs} +2 -2
  43. package/browser/esm/{CzgR8PxJ_89IC4Mr.mjs → DuSF-rjIFFvyCoo8.mjs} +2 -2
  44. package/browser/esm/{Bi_0z0hyhFuz5Ta3.mjs → EiBc8VBUeU8VXEhw.mjs} +1 -1
  45. package/browser/esm/{csxyptiqbJZO0pQA.mjs → R3CPiIXdp_rdc-Bw.mjs} +2 -2
  46. package/browser/esm/{BkDEdK7zOlsoUKCZ.mjs → eXqnYk6V-QI6pGI5.mjs} +2 -2
  47. package/browser/esm/{BcIp2mxLBfjUBE0q.mjs → hdx26DrfopUuM4j1.mjs} +1 -1
  48. package/browser/esm/index.mjs +2 -2
  49. package/browser/esm/{DMUXpRbV3ahdB1lN.mjs → oXfsh9SiDjQuu2ZE.mjs} +2 -2
  50. package/browser/esm/{DiIX5KzrWnbDWjGE.mjs → zBIGDTI8z3bRbFxO.mjs} +2 -2
  51. package/licenses/dependencies.txt +6 -6
  52. package/node/esm/{BSUbQzac78SXiAJe.mjs → -mcJjjdCwl8lh-eg.mjs} +1 -1
  53. package/node/esm/{CCZepFZNn1pIXrnd.mjs → 4WfRn0Og_yApP_Q8.mjs} +1 -1
  54. package/node/esm/{DyMCnCG9LzH5Mgw0.mjs → BEWR_Oinb-P8gswu.mjs} +1 -1
  55. package/node/esm/{CXSwyUs6BuNGCic0.mjs → BO6cKQ_efCO2YTyW.mjs} +1 -1
  56. package/node/esm/{DIGsHHDexzj0uG_T.mjs → BPG7zfcXK20urqr_.mjs} +5 -5
  57. package/node/esm/{Ui3_6RhrEZQDOXwg.mjs → BZ8BYhQCAcmtqV_l.mjs} +3 -3
  58. package/node/esm/{8THCZRGNmI2nPqMR.mjs → BqcpB9wQAjq0QKR1.mjs} +1 -1
  59. package/node/esm/{C6jxZQrvMLctjLZM.mjs → BqsJ9biuGwjU2xgY.mjs} +1 -1
  60. package/node/esm/{DLiw-2C_tqGgJIQ6.mjs → BxJ8RdpZW49RjtqB.mjs} +1 -1
  61. package/node/esm/{DHj9iDuBImdwscIb.mjs → CQ1mTChRFSKFU2O1.mjs} +1 -1
  62. package/node/esm/{D481dAOp77EZbV5s.mjs → CcOchU9ZOmdG4JFr.mjs} +1 -1
  63. package/node/esm/{qI75rORek8T0-Kpf.mjs → CdLN7JEivNllaQ6w.mjs} +1 -1
  64. package/node/esm/{Dd2OFQJQyYp6bAeP.mjs → CfO2Xok0ch8kylzr.mjs} +1 -1
  65. package/node/esm/{DNJVdt9TbBsUE8Jm.mjs → CsPaYpANdd8Rpel-.mjs} +1 -1
  66. package/node/esm/{BPylexVHXa-t0sqJ.mjs → DKho7vhsoPr3NuMl.mjs} +1 -1
  67. package/node/esm/{DkpAjhQeaZn_Ipxg.mjs → DW7i1Qv4kcmwOTvD.mjs} +1 -1
  68. package/node/esm/{BDm0y2dv7wLZhYj1.mjs → DvKUmpzXvELOJbAq.mjs} +1 -1
  69. package/node/esm/{BeNXnrWMr5S34Oxb.mjs → RpUFmc_WL9-PMYhx.mjs} +1 -1
  70. package/node/esm/{RV-AvxVzzFKWjYFM.mjs → VnhwCsWDUmo5-K5N.mjs} +1 -1
  71. package/node/esm/index.mjs +9 -9
  72. package/node/esm/{CaV6SH-PMyHlXUhx.mjs → nmVSg6Qpwj9V1oA0.mjs} +1 -1
  73. package/node/esm/{BQYQg7lfqFbWaf8x.mjs → o-JVx3HFrRjVjKmi.mjs} +2 -2
  74. package/node/esm/{DaCmut490aSCGvX8.mjs → uAAAbPd_k3kmgO5f.mjs} +1 -1
  75. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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
6
  */
7
- import{e as t}from"./_ZR9nT54xwy-C6ow.mjs";import{c as e,b as s,r,t as o,a as i,p as n,d as l}from"./DiIX5KzrWnbDWjGE.mjs";import{IFont as a,IAutoFilter as c,Sort as u,IRange as h,AddressUtils as p,IFill as g,IStyle as d,ITextFrame as m,FormulaError as b,IBorder as f}from"@sheetxl/sdk";class A{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const y=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,v=t=>{const e=parseInt(t);return isNaN(e)?null:e},F=t=>{const e=parseFloat(t);return isNaN(e)?null:e},C=new Map;class w{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??C}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let t=0;t<r.length;t++){const e=r[t];if(""===e||"."===e)continue;let o=[];for(let t=0;t<s.length;t++){const r=s[t],i=r.childNodes;for(let t=0;i&&t<i.length;t++){const s=r.childNodes[t];s.localName!==e&&"*"!==e||o.push(s)}}s=o}return 1===s.length?s[0]:0===s.length?null:new A(s)}getFromPath(e,s){return t.getFromPath(e,s)}setToPath(e,s,r){return t.setToPath(e,s,r)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return y}get INT_COPY(){return v}get FLOAT_COPY(){return F}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class P{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class N{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const O=(e,s)=>{if(e||!e.hasAttribute("rot"))return;const r=e.getAttribute("rot"),o=t.roundAccurately(n(r),2);-1e3!==o&&(s.rotation=o)},T=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},V=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},S=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},k=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class x{visit(t,e,s){return V(t,e,s,"roundedCorners","roundedCorners"),S(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class L{visit(t,e,s){return V(t,e,s,"plotVisOnly","plotVisOnly"),T(t,e,s,"dispBlanksAs","dispBlanksAs"),V(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),V(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class I{visit(t,e,s){let r={};return s.plotArea=r,r}}class B{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class j{visit(t,e,s){}processStroke(t,e,s){const r={},n=t.evaluate("ln",e);if(n){n.hasAttribute("algn")&&(r.align=B.fromOoxmlAlignment(n.getAttribute("algn"))),n.hasAttribute("cap")&&(r.lineCap=B.fromOoxmlLineCap(n.getAttribute("cap"))),n.hasAttribute("cmpd")&&(r.compound=B.fromOoxmlCompound(n.getAttribute("cmpd"))),n.hasAttribute("w")&&(r.width=o(n.getAttribute("w")));const e=t.evaluate("miter",n);e&&(r.lineJoin="miter",e.hasAttribute("lim")&&(r.miter=parseFloat(e.getAttribute("lim")))),t.evaluate("bevel",n)&&(r.lineJoin="bevel"),t.evaluate("round",n)&&(r.lineJoin="round");const l=t.evaluate("custDash",n);if(l){const e=t.evaluate("ds",l);if(e&&e.length>0){let t="";for(let s=0;s<e.length;s++){const r=e.item(s);t+=i(r.getAttribute("d"))+","+i(r.getAttribute("sp"))}r.dash=t}}const a=t.evaluate("prstDash",n);a&&a.hasAttribute("val")&&(r.dash=a.getAttribute("val")),this.parseEndElement(t,n,r,"headEnd","head"),this.parseEndElement(t,n,r,"tailEnd","tail");const c=this.processFill(t,n,s);r.fill=c}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,e,r){const o={};if(t.evaluate("noFill",e))return o.none=!0,o;const i=t.evaluate("solidFill",e);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",e);if(n){n.hasAttribute("rotWithShape")&&(o.isRotated="1"===n.getAttribute("rotWithShape"));const e=this.processGradFill(t,n);return o.gradient=e,o}const l=t.evaluate("pattFill",e);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",e);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=s(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const e=this.processImageFill(t,a);return o.image=e,o}return o.none=!0,o}processGradFill(t,e){const r={},o=t.evaluate("lin",e);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=n(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=s(o.getAttribute("scaled"));r.scaled=t}}const l={};e.hasAttribute("flip")&&(l.mirror=e.getAttribute("flip")),Object.keys(l).length>0&&(r.tile=l);const a=t.evaluate("path",e);if(a){a.hasAttribute("path")&&(r.type=B.fromOoxmlGradientType(a.getAttribute("path")));const e=t.evaluate("fillToRect",a);e&&(r.fillTo=this.getRect(e))}const c=t.evaluate("tileRect",e);c&&(r.tile.bounds=this.getRect(c));const u=[],h=t.evaluate("gsLst/gs",e);for(let e=0;h&&e<h.length;e++){const s=h.item(e),r={offset:i(s.getAttribute("pos")),color:this.processAdjColor(t,s)};u.push(r)}return u.length>0&&(r.stops=u),r}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=i(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=i(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=i(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=i(t.getAttribute("r"))),0===Object.keys(e).length?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+i(e.getAttribute("r"))+","+i(e.getAttribute("g"))+","+i(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+n(e.getAttribute("hue"))+","+i(e.getAttribute("sat"))+","+i(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class _ extends j{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){O(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e(i.getAttribute("x"))??0,s.y=e(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e(n.getAttribute("cx"))??0,s.height=e(n.getAttribute("cy"))??0),r.bounds=s}const i=t.evaluate("prstGeom",s);i?.hasAttribute("prst")?r.geometry=i?.getAttribute("prst"):t.evaluate("customGeom",s)&&console.warn("customGeom not supported yet");const n=this.processFill(t,s,r);n&&Object.keys(n).length>0&&(r.fill=n);const l=this.processStroke(t,s,r);return l&&Object.keys(l).length>0&&(r.stroke=l),r}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class R{visit(t,e,s){let r={};if(T(t,e,r,"grouping","grouping"),V(t,e,r,"varyColors","varyColors"),k(t,e,r,"gapWidth","gapWidth",.01),k(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),S(t,e,r,"bubbleScale","bubbleScale"),V(t,e,r,"showNegBubbles","showNegativeBubbleValues"),V(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),S(t,e,r,"firstSliceAng","startAngle"),S(t,e,r,"holeSize","holeSize"),T(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class E extends R{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class Y{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(V(t,e,r,"showBubbleSize","showBubbleSize"),V(t,e,r,"showCatName","showCatName"),V(t,e,r,"showLeaderLines","showLeaderLines"),V(t,e,r,"showPercent","showPercentage"),V(t,e,r,"showSerName","showSerName"),V(t,e,r,"showVal","showVal"),V(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),T(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const D=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class M{visit(t,e,s){const r={};S(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),S(t,e,r,"idx","idx"),V(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){D(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class U{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),V(t,e,i,"bubble3D","bubble3D"),S(t,e,i,"explosion","explosion"),D(t,e,i),i}}class z{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class G{visit(t,e,s){let r={};this.parseScaling(t,e,r),k(t,e,r,"majorUnit","majorUnits"),k(t,e,r,"minorUnit","minorUnits"),V(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),T(t,e,r,"majorTickMark","majorTickMarks"),T(t,e,r,"minorTickMark","minorTickMarks"),T(t,e,r,"crosses","crosses"),k(t,e,r,"crossesAt","crosses"),T(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),S(t,e,r,"lblOffset","labelOffset"),T(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,S(t,e,r,"tickMarkSkip","tickMarkSkip"),S(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),T(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),k(t,e,s,"scaling/max","max"),k(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class W{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new _).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&O(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight="1"===e.getAttribute("b")?700:400),e.hasAttribute("i")&&(s.italic="1"===e.getAttribute("i")),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const t=s.font??{};if(r.hasAttribute("typeface")&&(t.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const e=r.getAttribute("panose");e&&(t.fallbacks=[a.getPanoseFallback(e)])}r.hasAttribute("pitchFamily")&&(t.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(t.charset=r.getAttribute("charset")),Object.keys(t).length>0&&(s.font=t)}}}class X{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class ${visit(t,e,s){const r={};return V(t,e,r,"overlay","overlay"),T(t,e,r,"legendPos","position"),s.legend=r,r}}class K extends _{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class H extends W{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};V(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class J{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};k(t,r,e,"x","x"),k(t,r,e,"y","y"),k(t,r,e,"w","w"),k(t,r,e,"h","h"),T(t,r,e,"xMode","xMode"),T(t,r,e,"yMode","yMode"),T(t,r,e,"wMode","wMode"),T(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class q{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class Q extends j{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class Z{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[a.getPanoseFallback(i)]),s}}class tt{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class et{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const s={type:c.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const s={type:c.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let e=0;e<r.length;e++){const o=r.item(e);if(1!==o.nodeType)continue;let i=null;"customFilter"===o.localName&&(i=this.processCustomFilter(t,o)),i&&s.filters.push(i)}return s}processDynamicFilter(t,e){const s={type:c.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const s={type:c.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&r.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&o.push(e)}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:c.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:c.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const r={};if(!e.hasAttribute("colId"))return;r.offset=parseInt(e.getAttribute("colId"));let o=!1;return e.hasAttribute("hiddenButton")&&(o=s(e.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),e.hasAttribute("showButton")&&(r.showButton=s(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,r),r}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class st{visit(t,e,r){if(!e)return;const o={};if(t.copyFromAttribute(e,"ref",o),e.hasAttribute("caseSensitive")){const t=s(e.getAttribute("caseSensitive"));o.collatorOptions=t?u.CaseSensitiveOptions:u.CaseInsensitiveOptions}const i=e.getAttribute("sortMethod");null!=i&&"none"!==i&&("stroke"===i?o.collatorOptions={...o.collatorOptions,collation:"stroke"}:"pinYin"===i&&(o.collatorOptions={...o.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&s(e.getAttribute("columnSort"))&&(o.orientation=h.Orientation.Column);const n=p.fastStringToRange(o.ref);return this.processSortConditions(t,e,o,n),Object.keys(o).length>0&&(r.sort=o),o}processSortCondition(t,e,r){if(!e)return null;const o={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const t=e.getAttribute("ref"),s=p.fastStringToRange(t);o.offset=r?s.colStart-r.colStart:s.colStart}return o.reverse=!1,e.hasAttribute("descending")&&(o.reverse=s(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",o,"sortOn"),t.copyFromAttribute(e,"dxfId",o),t.copyFromAttribute(e,"iconSet",o),t.copyFromAttribute(e,"customList",o),o}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class rt{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=l(t=>e.getAttribute(t),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(t,e,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=a.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const t=r.getAttribute("val");s.underline=t||a.UnderlineStyle.Single}T(t,e,s,"vertAlign","verticalAlign"),"superscript"===s.verticalAlign?s.verticalAlign=a.VerticalAlignment.Super:"subscript"===s.verticalAlign&&(s.verticalAlign=a.VerticalAlignment.Sub),k(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),T(t,e,s,"name","family"),T(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const t=i.getAttribute("val");if(t)switch(t){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return T(t,e,s,"scheme","scheme"),V(t,e,s,"shadow","shadow",!0),V(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),T(t,e,s,"charset","charset"),s}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(t,e,s,r){const o={type:g.Type.None},i=e.childNodes;let n=!1;for(let e=0;!n&&e<i.length;e++){const s=i.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,o),n=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=g.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};r.push(e);const o=parseFloat(s.getAttribute("position"));e.offset=o;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?g.BuiltInSheetPattern.Solid:g.BuiltInSheetPattern.None);if(o===g.BuiltInSheetPattern.None)return{none:!0};s.type=g.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===g.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const t=n;n=l,l=t}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const u=t.evaluate("bgColor",e);return this.processDataBarColor(t,u,s,l,i),a&&!s.foreground&&(s.foreground=i),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,f.Edge.Left),this.processBorderStroke(t,e,i,f.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,f.Edge.Vertical),this.processBorderStroke(t,e,i,f.Edge.Top),this.processBorderStroke(t,e,i,f.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,f.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class ot extends rt{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:g.Type.None},r.fills[1]={type:g.Type.Pattern,patternType:g.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const r=[];this.processCellStyles(t,t.evaluate("cellStyles",e),r,o,i),s.named=r}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(t,e,r,o,i,n){if(!e)return;const l=e.getAttribute("xfId");if(l&&i){const t=i.get(parseInt(l));t&&t!==d.BuiltInName.Normal&&(r.named=t)}const a=t=>!(!n&&e.hasAttribute(t))||s(e.getAttribute("applyFont"));if(a("applyFont")){const t=o.fonts[e.getAttribute("fontId")];t&&(r.font=t)}if(a("applyFill")){const t=o.fills[e.getAttribute("fillId")];t&&Object.keys(t).length>0&&(r.fill=t)}if(a("applyBorder")){const t=o.borders[e.getAttribute("borderId")];t&&Object.keys(t).length>0&&(r.border=t)}if(a("applyNumberFormat")){const s=e.getAttribute("numFmtId");if(s){const e=parseInt(s);let o;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(o=t.get(e)),r.numberFormat=o??e}else console.warn("no visitor params state")}}a("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),r),a("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),r);const c=s(e.getAttribute("quotePrefix"));c&&(r.quotePrefix=c)}processAlignment(t,e,r){const o={};if(e?.hasAttribute("horizontal")?o.horizontal=e.getAttribute("horizontal"):o.horizontal=m.HorizontalAlignment.General,e?.hasAttribute("vertical")?o.vertical=e.getAttribute("vertical"):o.vertical=m.VerticalAlignment.Bottom,e?.hasAttribute("indent")?o.indent=parseInt(e.getAttribute("indent")):o.indent=0,e?.hasAttribute("relativeIndent")?o.relativeIndent=parseInt(e.getAttribute("relativeIndent")):o.relativeIndent=0,s(e?.getAttribute("wrapText"))?o.overflow=m.Overflow.Wrap:o.overflow=m.Overflow.Visible,s(e?.getAttribute("shrinkToFit"))&&(o.overflow=m.Overflow.Shrink),e?.hasAttribute("textRotation")){let t=parseFloat(e.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,o.stacked=!0),o.rotation=t}else o.rotation=0;e?.hasAttribute("justifyLastLine")&&(o.justifyLastLine=s(e.getAttribute("justifyLastLine")));const i=e?.getAttribute("readingOrder");return i&&("0"===i?o.readingDirection=m.ReadingDirection.Auto:"1"===i?o.readingDirection=m.ReadingDirection.LeftToRight:"2"===i?o.readingDirection=m.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${i}`)),Object.keys(o).length>0&&(r.alignment=o),r}processProtection(t,e,r){if(!e)return;const o={},i=e.getAttribute("locked");i&&!s(i)&&(o.edit=!0);const n=e.getAttribute("hidden");return n&&s(n)&&(o.formulaHidden=!0),Object.keys(o).length>0&&(r.protection=o),r}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,r,o,i=!1){const n=e.getAttribute("name"),l={name:n};e.hasAttribute("table")&&(l.table=s(e.getAttribute("table"))),e.hasAttribute("pivot")&&(l.pivot=s(e.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=e.childNodes;for(let t=0;t<a.length;t++){const e=a.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let r=o?.[s];r||(console.warn("invalid dfx id",s),r={}),l[t]=r;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(r.size=i)}}delete l.name,r[n]=l}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,r,o,i){if(!e)return;const n=e.childNodes;for(let t=0;t<n.length;t++){const e=n.item(t);if(1===e.nodeType&&"cellStyle"===e.localName){const t=parseInt(e.getAttribute("xfId")),n=e.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};e.getAttribute("hidden")&&(l.hidden=s(e.getAttribute("hidden"))),e.getAttribute("iLevel")&&(l.iLevel=parseInt(e.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class it extends rt{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class nt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class lt{visit(t,e,s){return s}}class at{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,s,r,o){if(!s)return;const i={c:0,r:0,x:0,y:0};return t.evaluate("col",s)&&(i.c=parseInt(t.evaluate("col",s).textContent)),t.evaluate("row",s)&&(i.r=parseInt(t.evaluate("row",s).textContent)),t.evaluate("colOff",s)&&(i.x=e(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class ct{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class ut extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class ht extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class pt extends ct{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class gt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class dt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const mt="richTypes";class bt{visit(t,e,s){let r=t.getVisitorParamsState().get(mt);r||(r=[],t.getVisitorParamsState().set(mt,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const ft="richData";class At{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(ft);o||(o=[],t.getVisitorParamsState().set(ft,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(t,e){if("_error"===e.type){const s=e.errorType;if(s)try{e=b.getBuiltInById(s+1)}catch(t){}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class yt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class vt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Ft{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ct{visit(t,e,o){if(!e)return;const i={};return t.copyFromAttribute(e,"id",i,"id",r),t.copyFromAttribute(e,"personId",i,"personId",r),t.copyFromAttribute(e,"ref",i),t.copyFromAttribute(e,"parentId",i,"parentId",r),t.copyFromAttribute(e,"dT",i),e.hasAttribute("done")&&(i.done=s(e.getAttribute("done"))),o.push(i),i}}class wt{visit(t,e,s){const o=[],i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType&&"person"===s.localName){const e={};t.copyFromAttribute(s,"id",e,"id",r),t.copyFromAttribute(s,"displayName",e),t.copyFromAttribute(s,"userId",e,"userId",r),t.copyFromAttribute(s,"providerId",e),o.push(e)}}return o.length>0&&(s.persons=o),o}}const Pt={};class Nt{constructor(t,e){this.path=t,this.visitor=e}}class Ot{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new N),this.registerVisitor("spPr",new _),this.registerVisitor("txBody",new W),this.registerVisitor("txPr",new W),this.registerVisitor("c:chartSpace",new x),this.registerVisitor("c:chartSpace",new L,"chart"),this.registerVisitor("c:plotArea",new I),this.registerVisitor("c:barChart",new E),this.registerVisitor("c:doughnutChart",new R),this.registerVisitor("c:lineChart",new R),this.registerVisitor("c:ofPieType",new R),this.registerVisitor("c:pieChart",new R),this.registerVisitor("c:scatterChart",new R),this.registerVisitor("c:barChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new M),this.registerVisitor("c:dPt",new U),this.registerVisitor("c:marker",new z),this.registerVisitor("c:catAx",new G),this.registerVisitor("c:valAx",new G),this.registerVisitor("c:dateAx",new G),this.registerVisitor("c:majorGridlines",new P("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new P("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new W("labels.text"),"txPr"),this.registerVisitor("c:valAx",new W("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new W("labels.text"),"txPr"),this.registerVisitor("c:legend",new $),this.registerVisitor("c:legend",new W("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new X),this.registerVisitor("c:ser",new K,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new Y("labels"),"dLbls"),this.registerVisitor("c:dLbl",new Y("points")),this.registerVisitor("c:title",new H),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new J),this.registerVisitor("c:dispUnits",new P("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new H("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new W,"tx/rich"),this.registerVisitor("a:theme",new q),this.registerVisitor("a:theme",new Q,"themeElements/clrScheme"),this.registerVisitor("a:theme",new Z,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new et),this.registerVisitor("sortState",new st),this.registerVisitor("s:workbook",new it),this.registerVisitor("styleSheet",new ot),this.registerVisitor("table",new nt),this.registerVisitor("hlinkClick",new tt),this.registerVisitor("wsDr",new lt),this.registerVisitor("twoCellAnchor",new at),this.registerVisitor("oneCellAnchor",new at),this.registerVisitor("absoluteAnchor",new at),this.registerVisitor("graphicFrame",new ut),this.registerVisitor("sp",new ht),this.registerVisitor("grpSp",new gt),this.registerVisitor("cxnSp",new dt),this.registerVisitor("pic",new pt),this.registerVisitor("rvStructures",new bt),this.registerVisitor("rvData",new At),this.registerVisitor("comments",new yt),this.registerVisitor("commentList",new vt,"comment"),this.registerVisitor("comment",new W("content"),"text"),this.registerVisitor("ThreadedComments",new Ft),this.registerVisitor("threadedComment",new Ct),this.registerVisitor("threadedComment",new W("content"),"text"),this.registerVisitor("personList",new wt)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new Nt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=Pt){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new w(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let e=0;e<a.length;e++){const s=a[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let u=null;try{u=e.evaluate(c.path,r)}catch(e){console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!u)continue;const h=t=>{let l=t.localName,a=t.parentNode;for(;a&&a!==r;)l=a.localName+"/"+l,a=a.parentNode;const u=e.getPath()+"/"+l;if(c.visitor){const r=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,r,s,t,o,i,n)}};if(u.length>0){const t=u;for(let e=0;e<t.length;e++)h(t.item(e))}else h(u)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let t=0;t<c.length;t++){const r=c.item(t);if(1===r.nodeType){const t=r,a=t.localName,c=this.visitorsByXmlTagName.get(a),u=e.getPath()+"/"+a,h=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c,h,s,t,l??o,i,n)}}return l}}export{Ot as FromOOXMLConverter,Ot as default};
7
+ import{e as t}from"./BPMMuKIe5xb3-D8V.mjs";import{c as e,b as s,r,t as o,a as i,p as n,d as l}from"./zBIGDTI8z3bRbFxO.mjs";import{IFont as a,IAutoFilter as c,Sort as u,IRange as h,AddressUtils as p,IFill as g,IStyle as d,ITextFrame as m,FormulaError as b,IBorder as f}from"@sheetxl/sdk";class A{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const y=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,v=t=>{const e=parseInt(t);return isNaN(e)?null:e},F=t=>{const e=parseFloat(t);return isNaN(e)?null:e},C=new Map;class w{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??C}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let t=0;t<r.length;t++){const e=r[t];if(""===e||"."===e)continue;let o=[];for(let t=0;t<s.length;t++){const r=s[t],i=r.childNodes;for(let t=0;i&&t<i.length;t++){const s=r.childNodes[t];s.localName!==e&&"*"!==e||o.push(s)}}s=o}return 1===s.length?s[0]:0===s.length?null:new A(s)}getFromPath(e,s){return t.getFromPath(e,s)}setToPath(e,s,r){return t.setToPath(e,s,r)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return y}get INT_COPY(){return v}get FLOAT_COPY(){return F}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class P{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class N{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const O=(e,s)=>{if(e||!e.hasAttribute("rot"))return;const r=e.getAttribute("rot"),o=t.roundAccurately(n(r),2);-1e3!==o&&(s.rotation=o)},T=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},V=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},S=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},k=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class x{visit(t,e,s){return V(t,e,s,"roundedCorners","roundedCorners"),S(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class L{visit(t,e,s){return V(t,e,s,"plotVisOnly","plotVisOnly"),T(t,e,s,"dispBlanksAs","dispBlanksAs"),V(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),V(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class I{visit(t,e,s){let r={};return s.plotArea=r,r}}class B{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class j{visit(t,e,s){}processStroke(t,e,s){const r={},n=t.evaluate("ln",e);if(n){n.hasAttribute("algn")&&(r.align=B.fromOoxmlAlignment(n.getAttribute("algn"))),n.hasAttribute("cap")&&(r.lineCap=B.fromOoxmlLineCap(n.getAttribute("cap"))),n.hasAttribute("cmpd")&&(r.compound=B.fromOoxmlCompound(n.getAttribute("cmpd"))),n.hasAttribute("w")&&(r.width=o(n.getAttribute("w")));const e=t.evaluate("miter",n);e&&(r.lineJoin="miter",e.hasAttribute("lim")&&(r.miter=parseFloat(e.getAttribute("lim")))),t.evaluate("bevel",n)&&(r.lineJoin="bevel"),t.evaluate("round",n)&&(r.lineJoin="round");const l=t.evaluate("custDash",n);if(l){const e=t.evaluate("ds",l);if(e&&e.length>0){let t="";for(let s=0;s<e.length;s++){const r=e.item(s);t+=i(r.getAttribute("d"))+","+i(r.getAttribute("sp"))}r.dash=t}}const a=t.evaluate("prstDash",n);a&&a.hasAttribute("val")&&(r.dash=a.getAttribute("val")),this.parseEndElement(t,n,r,"headEnd","head"),this.parseEndElement(t,n,r,"tailEnd","tail");const c=this.processFill(t,n,s);r.fill=c}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,e,r){const o={};if(t.evaluate("noFill",e))return o.none=!0,o;const i=t.evaluate("solidFill",e);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",e);if(n){n.hasAttribute("rotWithShape")&&(o.isRotated="1"===n.getAttribute("rotWithShape"));const e=this.processGradFill(t,n);return o.gradient=e,o}const l=t.evaluate("pattFill",e);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",e);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=s(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const e=this.processImageFill(t,a);return o.image=e,o}return o.none=!0,o}processGradFill(t,e){const r={},o=t.evaluate("lin",e);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=n(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=s(o.getAttribute("scaled"));r.scaled=t}}const l={};e.hasAttribute("flip")&&(l.mirror=e.getAttribute("flip")),Object.keys(l).length>0&&(r.tile=l);const a=t.evaluate("path",e);if(a){a.hasAttribute("path")&&(r.type=B.fromOoxmlGradientType(a.getAttribute("path")));const e=t.evaluate("fillToRect",a);e&&(r.fillTo=this.getRect(e))}const c=t.evaluate("tileRect",e);c&&(r.tile.bounds=this.getRect(c));const u=[],h=t.evaluate("gsLst/gs",e);for(let e=0;h&&e<h.length;e++){const s=h.item(e),r={offset:i(s.getAttribute("pos")),color:this.processAdjColor(t,s)};u.push(r)}return u.length>0&&(r.stops=u),r}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=i(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=i(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=i(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=i(t.getAttribute("r"))),0===Object.keys(e).length?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+i(e.getAttribute("r"))+","+i(e.getAttribute("g"))+","+i(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+n(e.getAttribute("hue"))+","+i(e.getAttribute("sat"))+","+i(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class _ extends j{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){O(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e(i.getAttribute("x"))??0,s.y=e(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e(n.getAttribute("cx"))??0,s.height=e(n.getAttribute("cy"))??0),r.bounds=s}const i=t.evaluate("prstGeom",s);i?.hasAttribute("prst")?r.geometry=i?.getAttribute("prst"):t.evaluate("customGeom",s)&&console.warn("customGeom not supported yet");const n=this.processFill(t,s,r);n&&Object.keys(n).length>0&&(r.fill=n);const l=this.processStroke(t,s,r);return l&&Object.keys(l).length>0&&(r.stroke=l),r}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class R{visit(t,e,s){let r={};if(T(t,e,r,"grouping","grouping"),V(t,e,r,"varyColors","varyColors"),k(t,e,r,"gapWidth","gapWidth",.01),k(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),S(t,e,r,"bubbleScale","bubbleScale"),V(t,e,r,"showNegBubbles","showNegativeBubbleValues"),V(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),S(t,e,r,"firstSliceAng","startAngle"),S(t,e,r,"holeSize","holeSize"),T(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class E extends R{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class Y{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(V(t,e,r,"showBubbleSize","showBubbleSize"),V(t,e,r,"showCatName","showCatName"),V(t,e,r,"showLeaderLines","showLeaderLines"),V(t,e,r,"showPercent","showPercentage"),V(t,e,r,"showSerName","showSerName"),V(t,e,r,"showVal","showVal"),V(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),T(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const D=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class M{visit(t,e,s){const r={};S(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),S(t,e,r,"idx","idx"),V(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){D(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class U{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),V(t,e,i,"bubble3D","bubble3D"),S(t,e,i,"explosion","explosion"),D(t,e,i),i}}class z{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class G{visit(t,e,s){let r={};this.parseScaling(t,e,r),k(t,e,r,"majorUnit","majorUnits"),k(t,e,r,"minorUnit","minorUnits"),V(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),T(t,e,r,"majorTickMark","majorTickMarks"),T(t,e,r,"minorTickMark","minorTickMarks"),T(t,e,r,"crosses","crosses"),k(t,e,r,"crossesAt","crosses"),T(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),S(t,e,r,"lblOffset","labelOffset"),T(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,S(t,e,r,"tickMarkSkip","tickMarkSkip"),S(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),T(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),k(t,e,s,"scaling/max","max"),k(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class W{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new _).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&O(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight="1"===e.getAttribute("b")?700:400),e.hasAttribute("i")&&(s.italic="1"===e.getAttribute("i")),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const t=s.font??{};if(r.hasAttribute("typeface")&&(t.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const e=r.getAttribute("panose");e&&(t.fallbacks=[a.getPanoseFallback(e)])}r.hasAttribute("pitchFamily")&&(t.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(t.charset=r.getAttribute("charset")),Object.keys(t).length>0&&(s.font=t)}}}class X{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class ${visit(t,e,s){const r={};return V(t,e,r,"overlay","overlay"),T(t,e,r,"legendPos","position"),s.legend=r,r}}class K extends _{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class H extends W{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};V(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class J{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};k(t,r,e,"x","x"),k(t,r,e,"y","y"),k(t,r,e,"w","w"),k(t,r,e,"h","h"),T(t,r,e,"xMode","xMode"),T(t,r,e,"yMode","yMode"),T(t,r,e,"wMode","wMode"),T(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class q{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class Q extends j{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class Z{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[a.getPanoseFallback(i)]),s}}class tt{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class et{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const s={type:c.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const s={type:c.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let e=0;e<r.length;e++){const o=r.item(e);if(1!==o.nodeType)continue;let i=null;"customFilter"===o.localName&&(i=this.processCustomFilter(t,o)),i&&s.filters.push(i)}return s}processDynamicFilter(t,e){const s={type:c.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const s={type:c.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&r.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&o.push(e)}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:c.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:c.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const r={};if(!e.hasAttribute("colId"))return;r.offset=parseInt(e.getAttribute("colId"));let o=!1;return e.hasAttribute("hiddenButton")&&(o=s(e.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),e.hasAttribute("showButton")&&(r.showButton=s(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,r),r}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class st{visit(t,e,r){if(!e)return;const o={};if(t.copyFromAttribute(e,"ref",o),e.hasAttribute("caseSensitive")){const t=s(e.getAttribute("caseSensitive"));o.collatorOptions=t?u.CaseSensitiveOptions:u.CaseInsensitiveOptions}const i=e.getAttribute("sortMethod");null!=i&&"none"!==i&&("stroke"===i?o.collatorOptions={...o.collatorOptions,collation:"stroke"}:"pinYin"===i&&(o.collatorOptions={...o.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&s(e.getAttribute("columnSort"))&&(o.orientation=h.Orientation.Column);const n=p.fastStringToRange(o.ref);return this.processSortConditions(t,e,o,n),Object.keys(o).length>0&&(r.sort=o),o}processSortCondition(t,e,r){if(!e)return null;const o={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const t=e.getAttribute("ref"),s=p.fastStringToRange(t);o.offset=r?s.colStart-r.colStart:s.colStart}return o.reverse=!1,e.hasAttribute("descending")&&(o.reverse=s(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",o,"sortOn"),t.copyFromAttribute(e,"dxfId",o),t.copyFromAttribute(e,"iconSet",o),t.copyFromAttribute(e,"customList",o),o}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class rt{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=l(t=>e.getAttribute(t),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(t,e,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=a.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const t=r.getAttribute("val");s.underline=t||a.UnderlineStyle.Single}T(t,e,s,"vertAlign","verticalAlign"),"superscript"===s.verticalAlign?s.verticalAlign=a.VerticalAlignment.Super:"subscript"===s.verticalAlign&&(s.verticalAlign=a.VerticalAlignment.Sub),k(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),T(t,e,s,"name","family"),T(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const t=i.getAttribute("val");if(t)switch(t){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return T(t,e,s,"scheme","scheme"),V(t,e,s,"shadow","shadow",!0),V(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),T(t,e,s,"charset","charset"),s}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(t,e,s,r){const o={type:g.Type.None},i=e.childNodes;let n=!1;for(let e=0;!n&&e<i.length;e++){const s=i.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,o),n=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=g.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};r.push(e);const o=parseFloat(s.getAttribute("position"));e.offset=o;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?g.BuiltInSheetPattern.Solid:g.BuiltInSheetPattern.None);if(o===g.BuiltInSheetPattern.None)return{none:!0};s.type=g.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===g.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const t=n;n=l,l=t}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const u=t.evaluate("bgColor",e);return this.processDataBarColor(t,u,s,l,i),a&&!s.foreground&&(s.foreground=i),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,f.Edge.Left),this.processBorderStroke(t,e,i,f.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,f.Edge.Vertical),this.processBorderStroke(t,e,i,f.Edge.Top),this.processBorderStroke(t,e,i,f.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,f.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class ot extends rt{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:g.Type.None},r.fills[1]={type:g.Type.Pattern,patternType:g.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const r=[];this.processCellStyles(t,t.evaluate("cellStyles",e),r,o,i),s.named=r}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(t,e,r,o,i,n){if(!e)return;const l=e.getAttribute("xfId");if(l&&i){const t=i.get(parseInt(l));t&&t!==d.BuiltInName.Normal&&(r.named=t)}const a=t=>!(!n&&e.hasAttribute(t))||s(e.getAttribute("applyFont"));if(a("applyFont")){const t=o.fonts[e.getAttribute("fontId")];t&&(r.font=t)}if(a("applyFill")){const t=o.fills[e.getAttribute("fillId")];t&&Object.keys(t).length>0&&(r.fill=t)}if(a("applyBorder")){const t=o.borders[e.getAttribute("borderId")];t&&Object.keys(t).length>0&&(r.border=t)}if(a("applyNumberFormat")){const s=e.getAttribute("numFmtId");if(s){const e=parseInt(s);let o;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(o=t.get(e)),r.numberFormat=o??e}else console.warn("no visitor params state")}}a("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),r),a("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),r);const c=s(e.getAttribute("quotePrefix"));c&&(r.quotePrefix=c)}processAlignment(t,e,r){const o={};if(e?.hasAttribute("horizontal")?o.horizontal=e.getAttribute("horizontal"):o.horizontal=m.HorizontalAlignment.General,e?.hasAttribute("vertical")?o.vertical=e.getAttribute("vertical"):o.vertical=m.VerticalAlignment.Bottom,e?.hasAttribute("indent")?o.indent=parseInt(e.getAttribute("indent")):o.indent=0,e?.hasAttribute("relativeIndent")?o.relativeIndent=parseInt(e.getAttribute("relativeIndent")):o.relativeIndent=0,s(e?.getAttribute("wrapText"))?o.overflow=m.Overflow.Wrap:o.overflow=m.Overflow.Visible,s(e?.getAttribute("shrinkToFit"))&&(o.overflow=m.Overflow.Shrink),e?.hasAttribute("textRotation")){let t=parseFloat(e.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,o.stacked=!0),o.rotation=t}else o.rotation=0;e?.hasAttribute("justifyLastLine")&&(o.justifyLastLine=s(e.getAttribute("justifyLastLine")));const i=e?.getAttribute("readingOrder");return i&&("0"===i?o.readingDirection=m.ReadingDirection.Auto:"1"===i?o.readingDirection=m.ReadingDirection.LeftToRight:"2"===i?o.readingDirection=m.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${i}`)),Object.keys(o).length>0&&(r.alignment=o),r}processProtection(t,e,r){if(!e)return;const o={},i=e.getAttribute("locked");i&&!s(i)&&(o.edit=!0);const n=e.getAttribute("hidden");return n&&s(n)&&(o.formulaHidden=!0),Object.keys(o).length>0&&(r.protection=o),r}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,r,o,i=!1){const n=e.getAttribute("name"),l={name:n};e.hasAttribute("table")&&(l.table=s(e.getAttribute("table"))),e.hasAttribute("pivot")&&(l.pivot=s(e.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=e.childNodes;for(let t=0;t<a.length;t++){const e=a.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let r=o?.[s];r||(console.warn("invalid dfx id",s),r={}),l[t]=r;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(r.size=i)}}delete l.name,r[n]=l}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,r,o,i){if(!e)return;const n=e.childNodes;for(let t=0;t<n.length;t++){const e=n.item(t);if(1===e.nodeType&&"cellStyle"===e.localName){const t=parseInt(e.getAttribute("xfId")),n=e.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};e.getAttribute("hidden")&&(l.hidden=s(e.getAttribute("hidden"))),e.getAttribute("iLevel")&&(l.iLevel=parseInt(e.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class it extends rt{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class nt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class lt{visit(t,e,s){return s}}class at{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,s,r,o){if(!s)return;const i={c:0,r:0,x:0,y:0};return t.evaluate("col",s)&&(i.c=parseInt(t.evaluate("col",s).textContent)),t.evaluate("row",s)&&(i.r=parseInt(t.evaluate("row",s).textContent)),t.evaluate("colOff",s)&&(i.x=e(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class ct{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class ut extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class ht extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class pt extends ct{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class gt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class dt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const mt="richTypes";class bt{visit(t,e,s){let r=t.getVisitorParamsState().get(mt);r||(r=[],t.getVisitorParamsState().set(mt,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const ft="richData";class At{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(ft);o||(o=[],t.getVisitorParamsState().set(ft,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(t,e){if("_error"===e.type){const s=e.errorType;if(s)try{e=b.getBuiltInById(s+1)}catch(t){}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class yt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class vt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Ft{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ct{visit(t,e,o){if(!e)return;const i={};return t.copyFromAttribute(e,"id",i,"id",r),t.copyFromAttribute(e,"personId",i,"personId",r),t.copyFromAttribute(e,"ref",i),t.copyFromAttribute(e,"parentId",i,"parentId",r),t.copyFromAttribute(e,"dT",i),e.hasAttribute("done")&&(i.done=s(e.getAttribute("done"))),o.push(i),i}}class wt{visit(t,e,s){const o=[],i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType&&"person"===s.localName){const e={};t.copyFromAttribute(s,"id",e,"id",r),t.copyFromAttribute(s,"displayName",e),t.copyFromAttribute(s,"userId",e,"userId",r),t.copyFromAttribute(s,"providerId",e),o.push(e)}}return o.length>0&&(s.persons=o),o}}const Pt={};class Nt{constructor(t,e){this.path=t,this.visitor=e}}class Ot{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new N),this.registerVisitor("spPr",new _),this.registerVisitor("txBody",new W),this.registerVisitor("txPr",new W),this.registerVisitor("c:chartSpace",new x),this.registerVisitor("c:chartSpace",new L,"chart"),this.registerVisitor("c:plotArea",new I),this.registerVisitor("c:barChart",new E),this.registerVisitor("c:doughnutChart",new R),this.registerVisitor("c:lineChart",new R),this.registerVisitor("c:ofPieType",new R),this.registerVisitor("c:pieChart",new R),this.registerVisitor("c:scatterChart",new R),this.registerVisitor("c:barChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new M),this.registerVisitor("c:dPt",new U),this.registerVisitor("c:marker",new z),this.registerVisitor("c:catAx",new G),this.registerVisitor("c:valAx",new G),this.registerVisitor("c:dateAx",new G),this.registerVisitor("c:majorGridlines",new P("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new P("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new W("labels.text"),"txPr"),this.registerVisitor("c:valAx",new W("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new W("labels.text"),"txPr"),this.registerVisitor("c:legend",new $),this.registerVisitor("c:legend",new W("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new X),this.registerVisitor("c:ser",new K,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new Y("labels"),"dLbls"),this.registerVisitor("c:dLbl",new Y("points")),this.registerVisitor("c:title",new H),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new J),this.registerVisitor("c:dispUnits",new P("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new H("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new W,"tx/rich"),this.registerVisitor("a:theme",new q),this.registerVisitor("a:theme",new Q,"themeElements/clrScheme"),this.registerVisitor("a:theme",new Z,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new et),this.registerVisitor("sortState",new st),this.registerVisitor("s:workbook",new it),this.registerVisitor("styleSheet",new ot),this.registerVisitor("table",new nt),this.registerVisitor("hlinkClick",new tt),this.registerVisitor("wsDr",new lt),this.registerVisitor("twoCellAnchor",new at),this.registerVisitor("oneCellAnchor",new at),this.registerVisitor("absoluteAnchor",new at),this.registerVisitor("graphicFrame",new ut),this.registerVisitor("sp",new ht),this.registerVisitor("grpSp",new gt),this.registerVisitor("cxnSp",new dt),this.registerVisitor("pic",new pt),this.registerVisitor("rvStructures",new bt),this.registerVisitor("rvData",new At),this.registerVisitor("comments",new yt),this.registerVisitor("commentList",new vt,"comment"),this.registerVisitor("comment",new W("content"),"text"),this.registerVisitor("ThreadedComments",new Ft),this.registerVisitor("threadedComment",new Ct),this.registerVisitor("threadedComment",new W("content"),"text"),this.registerVisitor("personList",new wt)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new Nt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=Pt){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new w(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let e=0;e<a.length;e++){const s=a[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let u=null;try{u=e.evaluate(c.path,r)}catch(e){console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!u)continue;const h=t=>{let l=t.localName,a=t.parentNode;for(;a&&a!==r;)l=a.localName+"/"+l,a=a.parentNode;const u=e.getPath()+"/"+l;if(c.visitor){const r=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,r,s,t,o,i,n)}};if(u.length>0){const t=u;for(let e=0;e<t.length;e++)h(t.item(e))}else h(u)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let t=0;t<c.length;t++){const r=c.item(t);if(1===r.nodeType){const t=r,a=t.localName,c=this.visitorsByXmlTagName.get(a),u=e.getPath()+"/"+a,h=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c,h,s,t,l??o,i,n)}}return l}}export{Ot as FromOOXMLConverter,Ot as default};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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
6
  */
7
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{memo as o,useState as a,useCallback as n,useEffect as i,useMemo as r}from"react";import{Box as l,FormControl as s,InputLabel as p,Select as c,TextField as u,Typography as d,MenuItem as m}from"@mui/material";import{NumberFormat as g}from"@sheetxl/sdk";import{B as f,L as y,p as h,a as x}from"./_ZR9nT54xwy-C6ow.mjs";import{alpha as C}from"@mui/system";const v=["Ok","Cancel"],b=o(o=>{const{initialValue:b,context:T,onOption:k,onValidateOption:O,onInputOption:w,onDone:F,options:P=v,defaultOption:S=P?.[0],cancelOption:$="Cancel",sx:D,...I}=o,[V,j]=a(b),[N,z]=a(!1),B=n(async(e,t)=>!0,[]),L=f(async e=>{w?.(V,e),k?.(e,e===$,e===S),F?.()},[V,w,F,k,$,S]),M=f(async e=>{if(e.keyCode===y.Enter){!1!==await(B?.(V,null))&&L(S)}},[V,L]),R=f(e=>{j(e.target.value),B?.(e.target.value,null)},[O]),W=f(async e=>{let t=await Promise.resolve(O?.(e));try{!1!==t&&(t=await Promise.resolve(B?.(V,e))??!0)}catch(e){}return t??!0},[O]),[E,G]=a(g.Styles.lookupStyle(V).formatType??g.Type.Custom);i(()=>{G(g.Styles.lookupStyle(V).formatType??g.Type.Custom)},[V]);const H=r(()=>{const t=g.Styles.lookupPrimary(),o=t=>e(m,{value:t,children:t},t),a=Object.keys(t).map(e=>o(t[e].formatType));return a.push(o(g.Type.Custom)),a},[]),K=n(e=>{const t=e.target.value;G(t);const o=g.Styles.lookupDefault(t);o&&j(o)},[]),q=r(()=>{const e=T();return e.createTemporaryCell({value:e.getValue()??12345,style:{numberFormat:V}})},[E,V,T]);return e(h,{title:"Number Format",options:P,onDone:F,onOption:e=>L(e),onValidateOption:W,defaultOption:S,cancelOption:$,autoFocusSel:".autoFocus",sx:{width:"580px",...D},...I,children:t(l,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[t(s,{sx:{minWidth:135},size:"small",children:[e(p,{children:"Category"}),e(c,{value:E,label:"Category",onChange:K,sx:{backgroundImage:`linear-gradient(${C("#fff",x(5))}, ${C("#fff",x(5))})`},children:H})]}),e(s,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:e(u,{label:"Code",onFocus:e=>{N||e.target?.select(),z(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${C("#fff",x(5))}, ${C("#fff",x(5))})`}}},value:V,onChange:R,onKeyDown:M,onContextMenu:e=>{e.stopPropagation()}})}),t(l,{children:[e(d,{variant:"caption",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:"Preview"}),e(d,{variant:"body2",component:"div",sx:{borderRadius:e=>`${e.shape.borderRadius}px`,padding:e=>e.spacing(1),border:e=>`1px solid ${e.palette.grey[400]}`},children:q.getNumberFormat().displayText||"(empty)"})]})]})})});export{b as NumberFormatDialog,b as default};
7
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{memo as o,useState as a,useCallback as n,useEffect as i,useMemo as r}from"react";import{Box as l,FormControl as s,InputLabel as p,Select as c,TextField as u,Typography as d,MenuItem as m}from"@mui/material";import{NumberFormat as g}from"@sheetxl/sdk";import{B as f,L as y,p as h,a as x}from"./BPMMuKIe5xb3-D8V.mjs";import{alpha as C}from"@mui/system";const v=["Ok","Cancel"],b=o(o=>{const{initialValue:b,context:T,onOption:k,onValidateOption:O,onInputOption:w,onDone:F,options:P=v,defaultOption:S=P?.[0],cancelOption:$="Cancel",sx:D,...I}=o,[V,j]=a(b),[N,z]=a(!1),B=n(async(e,t)=>!0,[]),L=f(async e=>{w?.(V,e),k?.(e,e===$,e===S),F?.()},[V,w,F,k,$,S]),M=f(async e=>{if(e.keyCode===y.Enter){!1!==await(B?.(V,null))&&L(S)}},[V,L]),R=f(e=>{j(e.target.value),B?.(e.target.value,null)},[O]),W=f(async e=>{let t=await Promise.resolve(O?.(e));try{!1!==t&&(t=await Promise.resolve(B?.(V,e))??!0)}catch(e){}return t??!0},[O]),[E,G]=a(g.Styles.lookupStyle(V).formatType??g.Type.Custom);i(()=>{G(g.Styles.lookupStyle(V).formatType??g.Type.Custom)},[V]);const H=r(()=>{const t=g.Styles.lookupPrimary(),o=t=>e(m,{value:t,children:t},t),a=Object.keys(t).map(e=>o(t[e].formatType));return a.push(o(g.Type.Custom)),a},[]),K=n(e=>{const t=e.target.value;G(t);const o=g.Styles.lookupDefault(t);o&&j(o)},[]),q=r(()=>{const e=T();return e.createTemporaryCell({value:e.getValue()??12345,style:{numberFormat:V}})},[E,V,T]);return e(h,{title:"Number Format",options:P,onDone:F,onOption:e=>L(e),onValidateOption:W,defaultOption:S,cancelOption:$,autoFocusSel:".autoFocus",sx:{width:"580px",...D},...I,children:t(l,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[t(s,{sx:{minWidth:135},size:"small",children:[e(p,{children:"Category"}),e(c,{value:E,label:"Category",onChange:K,sx:{backgroundImage:`linear-gradient(${C("#fff",x(5))}, ${C("#fff",x(5))})`},children:H})]}),e(s,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:e(u,{label:"Code",onFocus:e=>{N||e.target?.select(),z(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${C("#fff",x(5))}, ${C("#fff",x(5))})`}}},value:V,onChange:R,onKeyDown:M,onContextMenu:e=>{e.stopPropagation()}})}),t(l,{children:[e(d,{variant:"caption",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:"Preview"}),e(d,{variant:"body2",component:"div",sx:{borderRadius:e=>`${e.shape.borderRadius}px`,padding:e=>e.spacing(1),border:e=>`1px solid ${e.palette.grey[400]}`},children:q.getNumberFormat().displayText||"(empty)"})]})]})})});export{b as NumberFormatDialog,b as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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
6
  */
7
- import{Workbook as e,IRange as t}from"@sheetxl/sdk";const n=async(e,t)=>{const{trimLeadingBlankRow:n=!0,trimLeadingBlankColumn:r=!0,excludeHidden:o=!1,sheetKey:s=null,papaParseConfig:a={}}=t||{},l=await import("./BVRUNnRvnt7aVCDD.mjs").then(e=>e.p);if(!e)throw new Error("workbook must be specified");let i=null;if(null===s?i=e.getSelectedSheet():"number"==typeof s?i=e.getSheets().search()[s]:"string"==typeof s&&(i=e.getSheets().getByName(s)),!i)throw new Error("invalid sheetKey specified");let d=null;const c=[];let p=null,f=i.getUsedRange({excludeHidden:o});if(!f)throw new Error("Nothing to export");if(!n||!r){const e=n?f.getRowStart():0,t=r?f.getColumnStart():0;f=f.getOffsetTo(e,t)}f.forEach((e,t)=>{const n=t.getCoords(),r=t.getCell();d!==n.rowIndex&&(p&&c.push(p),p=[],d=n.rowIndex);const o=r.toTextUnformatted()??"";p.push(o)},{includeEmpty:!0,address:null}),p&&c.push(p);const u={...a},g=l.unparse(c,u);return(new TextEncoder).encode(g).buffer},r=async(n,r)=>{const{papaParseConfig:o,setValuesOptions:s,createWorkbookOptions:a}=r??{},l=await import("./BVRUNnRvnt7aVCDD.mjs").then(e=>e.p),i=(new TextDecoder).decode(n);let d=-1;const c=new e(a),p=c.getSelectedSheet().getEntireRange().startIncrementalUpdates({orientation:t.Orientation.Row}),f=r?.onProgress;let u=0;const g={...o,transform:(e,t)=>{o?.transform&&(e=o.transform(e,t));const n=t;0===n&&d++;let r=e??"";return p.pushAt(d,n,r),u++,u%1e5==0&&f?.(u),e}};return l.parse(i,g).data,p.apply({textParser:!0,...s}),c};export{r as fromBufferCSV,n as toBufferCSV};
7
+ import{Workbook as e,IRange as t}from"@sheetxl/sdk";const n=async(e,t)=>{const{trimLeadingBlankRow:n=!0,trimLeadingBlankColumn:r=!0,excludeHidden:o=!1,sheetKey:s=null,papaParseConfig:a={}}=t||{},l=await import("./5U4XS5qxb3oJ33qK.mjs").then(e=>e.p);if(!e)throw new Error("workbook must be specified");let i=null;if(null===s?i=e.getSelectedSheet():"number"==typeof s?i=e.getSheets().search()[s]:"string"==typeof s&&(i=e.getSheets().getByName(s)),!i)throw new Error("invalid sheetKey specified");let d=null;const c=[];let p=null,f=i.getUsedRange({excludeHidden:o});if(!f)throw new Error("Nothing to export");if(!n||!r){const e=n?f.getRowStart():0,t=r?f.getColumnStart():0;f=f.getOffsetTo(e,t)}f.forEach((e,t)=>{const n=t.getCoords(),r=t.getCell();d!==n.rowIndex&&(p&&c.push(p),p=[],d=n.rowIndex);const o=r.toTextUnformatted()??"";p.push(o)},{includeEmpty:!0,address:null}),p&&c.push(p);const u={...a},g=l.unparse(c,u);return(new TextEncoder).encode(g).buffer},r=async(n,r)=>{const{papaParseConfig:o,setValuesOptions:s,createWorkbookOptions:a}=r??{},l=await import("./5U4XS5qxb3oJ33qK.mjs").then(e=>e.p),i=(new TextDecoder).decode(n);let d=-1;const c=new e(a),p=c.getSelectedSheet().getEntireRange().startIncrementalUpdates({orientation:t.Orientation.Row}),f=r?.onProgress;let u=0;const g={...o,transform:(e,t)=>{o?.transform&&(e=o.transform(e,t));const n=t;0===n&&d++;let r=e??"";return p.pushAt(d,n,r),u++,u%1e5==0&&f?.(u),e}};return l.parse(i,g).data,p.apply({textParser:!0,...s}),c};export{r as fromBufferCSV,n as toBufferCSV};
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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
6
  */
7
- import{jsx as t}from"react/jsx-runtime";import{memo as o,forwardRef as n,useState as a}from"react";import{G as e,I as i,p,d as r,D as s}from"./_ZR9nT54xwy-C6ow.mjs";import{Box as l,FormControl as u,TextField as c}from"@mui/material";import{alpha as d}from"@mui/system";const m=["Input"],g=o(n((o,n)=>{const{initialValue:g="",onOption:f,onValidateOption:h,onInputOption:y,onValidateInputOption:O,onDone:x,inputProps:w,inputLabel:I,inputType:T,inputPlaceHolder:F,options:P=m,autoFocusSel:v=".autoFocus",cancelOption:C,defaultOption:b=P?.[0],...k}=o,[D,V]=a(!1),[j,B]=a(g),[H,L]=a(""),[M,N]=a(!0),S=e(async(t,o)=>{if(!O)return!0;const n=await(O?.(t,o));L(n?.message??"");const a=n?.valid??!0;return N(a),a},[O]),$=e(async t=>{y?.(j,t)},[j,y,x,f,C,b]),z=e(async t=>{t.keyCode===i.Enter&&await(S?.(j,null))},[j,$]),E=e(t=>{B(t.target.value),S?.(t.target.value,null)},[h]),G=e(async t=>{let o=await S(j,t);try{!1!==o&&(o=await S(j,t))}catch(t){}return o??!0},[j,h]);return t(p,{options:P,onDone:x,onOption:(t,o)=>{o||$(t)},onValidateOption:G,cancelOption:C,defaultOption:b,autoFocusSel:v,ref:n,...k,children:t(l,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0)},children:t(u,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t(c,{onFocus:t=>{D||t.target?.select(),V(!0)},type:T,label:I,helperText:H||" ",sx:{width:"100%","& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5),color:M?void 0:"error.main"}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{placeholder:F,spellCheck:!1,autoComplete:"off",...w,className:r("autoFocus",w?.className),sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${d("#fff",s(5))}, ${d("#fff",s(5))})`}}},value:j,onChange:E,onKeyDown:z,onContextMenu:t=>{t.stopPropagation()}})})})})}));export{g as default};
7
+ import{jsx as t}from"react/jsx-runtime";import{memo as o,forwardRef as n,useState as a}from"react";import{G as e,I as i,p,d as r,D as s}from"./BPMMuKIe5xb3-D8V.mjs";import{Box as l,FormControl as u,TextField as c}from"@mui/material";import{alpha as d}from"@mui/system";const m=["Input"],g=o(n((o,n)=>{const{initialValue:g="",onOption:f,onValidateOption:h,onInputOption:y,onValidateInputOption:O,onDone:x,inputProps:w,inputLabel:I,inputType:T,inputPlaceHolder:F,options:P=m,autoFocusSel:v=".autoFocus",cancelOption:C,defaultOption:b=P?.[0],...k}=o,[D,V]=a(!1),[j,B]=a(g),[H,L]=a(""),[M,N]=a(!0),S=e(async(t,o)=>{if(!O)return!0;const n=await(O?.(t,o));L(n?.message??"");const a=n?.valid??!0;return N(a),a},[O]),$=e(async t=>{y?.(j,t)},[j,y,x,f,C,b]),z=e(async t=>{t.keyCode===i.Enter&&await(S?.(j,null))},[j,$]),E=e(t=>{B(t.target.value),S?.(t.target.value,null)},[h]),G=e(async t=>{let o=await S(j,t);try{!1!==o&&(o=await S(j,t))}catch(t){}return o??!0},[j,h]);return t(p,{options:P,onDone:x,onOption:(t,o)=>{o||$(t)},onValidateOption:G,cancelOption:C,defaultOption:b,autoFocusSel:v,ref:n,...k,children:t(l,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0)},children:t(u,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t(c,{onFocus:t=>{D||t.target?.select(),V(!0)},type:T,label:I,helperText:H||" ",sx:{width:"100%","& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5),color:M?void 0:"error.main"}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{placeholder:F,spellCheck:!1,autoComplete:"off",...w,className:r("autoFocus",w?.className),sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${d("#fff",s(5))}, ${d("#fff",s(5))})`}}},value:j,onChange:E,onKeyDown:z,onContextMenu:t=>{t.stopPropagation()}})})})})}));export{g as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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
6
  */
7
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{memo as t,useMemo as n,useState as l,useCallback as o}from"react";import{Box as r}from"@mui/material";import{B as i,p as s,N as d,R as p}from"./_ZR9nT54xwy-C6ow.mjs";const u=["Ok","Cancel"],c=t(t=>{const{value:c=null,context:m,onOption:g,onValidateOption:x,onDone:f,onUpdate:N,options:y=u,defaultOption:T=y?.[0],cancelOption:O="Cancel",sx:V,...h}=t,R=n(()=>m?.getNames().findValidName("Range1"),[]),v=n(()=>{if(!c)return!0},[]),[C,w]=l({displayText:c?.getName()??R,errorText:null}),[F,D]=l({displayValue:c?.getRanges()??m?.selection()??null,errorText:null}),[I,j]=l(!1),B=o(async e=>!C.errorText&&!F.errorText,[m]),E=i((e,a,t)=>{if(!a){let e=null;v?e=m?.getNames().addReference(C?.displayText,F?.displayValue,!1):("reference"===c.getType()&&c.doBatch(()=>{c.setName(C?.displayText),c.setReference(F?.displayValue)},`Edit Named '${C?.displayText}'`),e=c),e&&(e.select(),N(e,v))}g?.(e,a,t),f?.()},[m,C,F,f,g,T,O,N]),L=i(e=>{let a=null;try{m?.getNames().validateName(e)}catch(e){a=e.message}w({displayText:e,errorText:a})},[]),b=i(e=>{c&&c.getName().toLowerCase()===e.toLowerCase()||m?.getNames().validateName(e)},[m,c]),k=o(e=>{D({displayValue:e??null,errorText:null})},[]);return e(s,{title:(v?"Define":"Edit")+" Range",options:y,onOption:E,onValidateOption:B,defaultOption:T,cancelOption:O,autoFocusSel:".autoFocus",sx:{width:"460px",...V},...h,children:a(r,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),range:"flex",flexDirection:"column"},children:[e(d,{formName:"name",defaultInput:R,value:C.displayText,onChangeInput:L,onValidate:b,onFocus:e=>{I||e.target?.select(),j(!0)}}),e(p,{formName:"range",value:F.displayValue,onChangeInput:k,resolvedAddress:m.getNames().getRanges.bind(m.getNames()),onFocus:e=>{I||e.target?.select(),j(!0)}})]})})});export{c as NamedReferenceDialog,c as default};
7
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{memo as t,useMemo as n,useState as l,useCallback as o}from"react";import{Box as r}from"@mui/material";import{B as i,p as s,N as d,R as p}from"./BPMMuKIe5xb3-D8V.mjs";const u=["Ok","Cancel"],c=t(t=>{const{value:c=null,context:m,onOption:g,onValidateOption:x,onDone:f,onUpdate:N,options:y=u,defaultOption:T=y?.[0],cancelOption:O="Cancel",sx:V,...h}=t,R=n(()=>m?.getNames().findValidName("Range1"),[]),v=n(()=>{if(!c)return!0},[]),[C,w]=l({displayText:c?.getName()??R,errorText:null}),[F,D]=l({displayValue:c?.getRanges()??m?.selection()??null,errorText:null}),[I,j]=l(!1),B=o(async e=>!C.errorText&&!F.errorText,[m]),E=i((e,a,t)=>{if(!a){let e=null;v?e=m?.getNames().addReference(C?.displayText,F?.displayValue,!1):("reference"===c.getType()&&c.doBatch(()=>{c.setName(C?.displayText),c.setReference(F?.displayValue)},`Edit Named '${C?.displayText}'`),e=c),e&&(e.select(),N(e,v))}g?.(e,a,t),f?.()},[m,C,F,f,g,T,O,N]),L=i(e=>{let a=null;try{m?.getNames().validateName(e)}catch(e){a=e.message}w({displayText:e,errorText:a})},[]),b=i(e=>{c&&c.getName().toLowerCase()===e.toLowerCase()||m?.getNames().validateName(e)},[m,c]),k=o(e=>{D({displayValue:e??null,errorText:null})},[]);return e(s,{title:(v?"Define":"Edit")+" Range",options:y,onOption:E,onValidateOption:B,defaultOption:T,cancelOption:O,autoFocusSel:".autoFocus",sx:{width:"460px",...V},...h,children:a(r,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),range:"flex",flexDirection:"column"},children:[e(d,{formName:"name",defaultInput:R,value:C.displayText,onChangeInput:L,onValidate:b,onFocus:e=>{I||e.target?.select(),j(!0)}}),e(p,{formName:"range",value:F.displayValue,onChangeInput:k,resolvedAddress:m.getNames().getRanges.bind(m.getNames()),onFocus:e=>{I||e.target?.select(),j(!0)}})]})})});export{c as NamedReferenceDialog,c as default};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
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.