@sheetxl/io-xlsx 0.7.23-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/README.md +23 -0
- package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +1 -0
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +1 -0
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +1 -0
- package/browser/cjs/BE7AtU1GCShmJ8Yu.cjs +1 -0
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +6 -0
- package/browser/cjs/Chkqh5BZ-MJjAcPF.cjs +5 -0
- package/browser/cjs/D-8WoJkvdPf-79sB.cjs +2 -0
- package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +2 -0
- package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +1 -0
- package/browser/cjs/index.cjs +1 -0
- package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +1 -0
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +1 -0
- package/browser/esm/B20zuEvdeypuSU5s.mjs +3851 -0
- package/browser/esm/BVAAJynubTdvPOQA.mjs +24 -0
- package/browser/esm/CLo2oPoIised6GbD.mjs +3617 -0
- package/browser/esm/COSdjubnJ_UgB-Gr.mjs +111 -0
- package/browser/esm/CS1t46OUALKkZxTa.mjs +494 -0
- package/browser/esm/CS8eRkAhoCN8KdGO.mjs +52 -0
- package/browser/esm/CcXnQZ4Fk_nkbq2G.mjs +99 -0
- package/browser/esm/Ch5gA6g56cOtRvJA.mjs +2193 -0
- package/browser/esm/DRuB-nlH4kq_OQJ5.mjs +196 -0
- package/browser/esm/DoKP-E832M9vPWgU.mjs +4675 -0
- package/browser/esm/XoDWB6uCJVrra-pE.mjs +2623 -0
- package/browser/esm/index.mjs +8 -0
- package/licenses/dependencies.txt +60 -0
- package/node/esm/B3Hb3GSFs_FIoXoI.mjs +209 -0
- package/node/esm/BqwG-e5ddQ45fg8w.mjs +2702 -0
- package/node/esm/C81WoKHbCRwhcHWd.mjs +2413 -0
- package/node/esm/CIzCy_gyysEIa_HI.mjs +3700 -0
- package/node/esm/CL8002u21KKQkkL0.mjs +108 -0
- package/node/esm/DF893ovKIDS88O7b.mjs +2237 -0
- package/node/esm/DTuPlHBTHnbLGvxd.mjs +504 -0
- package/node/esm/DVJuJqAXDwgA-ge8.mjs +118 -0
- package/node/esm/index.mjs +52 -0
- package/package.json +55 -0
- package/types/index.d.ts +2 -0
- package/types/src/ConditionalFormatRules.d.ts +86 -0
- package/types/src/ConditionalFormatRules.d.ts.map +1 -0
- package/types/src/DataValidationRules.d.ts +59 -0
- package/types/src/DataValidationRules.d.ts.map +1 -0
- package/types/src/ExcelCompat.d.ts +142 -0
- package/types/src/ExcelCompat.d.ts.map +1 -0
- package/types/src/ExcelFunctionFacts.d.ts +375 -0
- package/types/src/ExcelFunctionFacts.d.ts.map +1 -0
- package/types/src/ExcelReservedNames.d.ts +67 -0
- package/types/src/ExcelReservedNames.d.ts.map +1 -0
- package/types/src/LegacyFormula.d.ts +74 -0
- package/types/src/LegacyFormula.d.ts.map +1 -0
- package/types/src/OOXMLEscape.d.ts +28 -0
- package/types/src/OOXMLEscape.d.ts.map +1 -0
- package/types/src/OOXMLExtensions.d.ts +53 -0
- package/types/src/OOXMLExtensions.d.ts.map +1 -0
- package/types/src/OperandLiterals.d.ts +34 -0
- package/types/src/OperandLiterals.d.ts.map +1 -0
- package/types/src/Plugin.d.ts +16 -0
- package/types/src/Plugin.d.ts.map +1 -0
- package/types/src/SourcePackage.d.ts +76 -0
- package/types/src/SourcePackage.d.ts.map +1 -0
- package/types/src/Types.d.ts +44 -0
- package/types/src/Types.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileReader.d.ts +73 -0
- package/types/src/cfb/CompoundFileReader.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileWriter.d.ts +57 -0
- package/types/src/cfb/CompoundFileWriter.d.ts.map +1 -0
- package/types/src/cfb/index.d.ts +3 -0
- package/types/src/cfb/index.d.ts.map +1 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts +8 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts +78 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts.map +1 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +30 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts.map +1 -0
- package/types/src/offcrypto/AgileCrypto.d.ts +85 -0
- package/types/src/offcrypto/AgileCrypto.d.ts.map +1 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts +109 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts.map +1 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts +18 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts +15 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/index.d.ts +5 -0
- package/types/src/offcrypto/index.d.ts.map +1 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +58 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts.map +1 -0
- package/types/src/reader/ReaderProfiler.d.ts +45 -0
- package/types/src/reader/ReaderProfiler.d.ts.map +1 -0
- package/types/src/reader/ReaderUtils.d.ts +66 -0
- package/types/src/reader/ReaderUtils.d.ts.map +1 -0
- package/types/src/reader/XLSXReader.d.ts +11 -0
- package/types/src/reader/XLSXReader.d.ts.map +1 -0
- package/types/src/reader/ZipReader.d.ts +62 -0
- package/types/src/reader/ZipReader.d.ts.map +1 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +22 -0
- package/types/src/reader/dom/DOMTransformer.d.ts.map +1 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts +8 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts.map +1 -0
- package/types/src/reader/dom/ExecutionContext.d.ts +78 -0
- package/types/src/reader/dom/ExecutionContext.d.ts.map +1 -0
- package/types/src/reader/dom/NumberUtils.d.ts +17 -0
- package/types/src/reader/dom/NumberUtils.d.ts.map +1 -0
- package/types/src/reader/dom/Types.d.ts +27 -0
- package/types/src/reader/dom/Types.d.ts.map +1 -0
- package/types/src/reader/dom/VisitContext.d.ts +10 -0
- package/types/src/reader/dom/VisitContext.d.ts.map +1 -0
- package/types/src/reader/dom/Visitor.d.ts +23 -0
- package/types/src/reader/dom/Visitor.d.ts.map +1 -0
- package/types/src/reader/dom/VisitorUtils.d.ts +16 -0
- package/types/src/reader/dom/VisitorUtils.d.ts.map +1 -0
- package/types/src/reader/dom/index.d.ts +7 -0
- package/types/src/reader/dom/index.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +25 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +12 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +37 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +32 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +22 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts +104 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts +3 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +28 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +20 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts +10 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts +6 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +30 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/index.d.ts +101 -0
- package/types/src/reader/domVisitors/index.d.ts.map +1 -0
- package/types/src/reader/sax/SaxParser.d.ts +34 -0
- package/types/src/reader/sax/SaxParser.d.ts.map +1 -0
- package/types/src/reader/sax/SaxVisitor.d.ts +59 -0
- package/types/src/reader/sax/SaxVisitor.d.ts.map +1 -0
- package/types/src/reader/sax/Saxes.d.ts +641 -0
- package/types/src/reader/sax/Saxes.d.ts.map +1 -0
- package/types/src/reader/sax/index.d.ts +3 -0
- package/types/src/reader/sax/index.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts +32 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts +52 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts +74 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts +29 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +54 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +22 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +25 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts.map +1 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts +37 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts.map +1 -0
- package/types/src/vba/VBAProject.d.ts +47 -0
- package/types/src/vba/VBAProject.d.ts.map +1 -0
- package/types/src/vba/index.d.ts +3 -0
- package/types/src/vba/index.d.ts.map +1 -0
- package/types/src/writer/XLSXWriter.d.ts +4 -0
- package/types/src/writer/XLSXWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ContentTypes.d.ts +18 -0
- package/types/src/writer/builder/ContentTypes.d.ts.map +1 -0
- package/types/src/writer/builder/Emitter.d.ts +25 -0
- package/types/src/writer/builder/Emitter.d.ts.map +1 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts +29 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts.map +1 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts +26 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts.map +1 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +148 -0
- package/types/src/writer/builder/PackageBuilder.d.ts.map +1 -0
- package/types/src/writer/builder/PartWriter.d.ts +24 -0
- package/types/src/writer/builder/PartWriter.d.ts.map +1 -0
- package/types/src/writer/builder/RelationshipSet.d.ts +18 -0
- package/types/src/writer/builder/RelationshipSet.d.ts.map +1 -0
- package/types/src/writer/builder/Types.d.ts +311 -0
- package/types/src/writer/builder/Types.d.ts.map +1 -0
- package/types/src/writer/builder/Utils.d.ts +63 -0
- package/types/src/writer/builder/Utils.d.ts.map +1 -0
- package/types/src/writer/builder/XmlWriter.d.ts +3 -0
- package/types/src/writer/builder/XmlWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ZipBackend.d.ts +21 -0
- package/types/src/writer/builder/ZipBackend.d.ts.map +1 -0
- package/types/src/writer/builder/_Types.d.ts +102 -0
- package/types/src/writer/builder/_Types.d.ts.map +1 -0
- package/types/src/writer/builder/index.d.ts +6 -0
- package/types/src/writer/builder/index.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +7 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts +14 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +46 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts +15 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts +8 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts +12 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts +8 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +28 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +10 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +13 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +17 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/TableEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts +16 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +11 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +18 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/index.d.ts +3 -0
- package/types/src/writer/emitters/index.d.ts.map +1 -0
- package/types/src/writer/utils/AutoFilter.d.ts +15 -0
- package/types/src/writer/utils/AutoFilter.d.ts.map +1 -0
- package/types/src/writer/utils/ColorUtils.d.ts +46 -0
- package/types/src/writer/utils/ColorUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +26 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DummyFunction.d.ts +66 -0
- package/types/src/writer/utils/DummyFunction.d.ts.map +1 -0
- package/types/src/writer/utils/DxfCollector.d.ts +22 -0
- package/types/src/writer/utils/DxfCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts +3 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts.map +1 -0
- package/types/src/writer/utils/IDUtils.d.ts +2 -0
- package/types/src/writer/utils/IDUtils.d.ts.map +1 -0
- package/types/src/writer/utils/MetadataCollector.d.ts +146 -0
- package/types/src/writer/utils/MetadataCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts +3 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts.map +1 -0
- package/types/src/writer/utils/RichValueCollector.d.ts +200 -0
- package/types/src/writer/utils/RichValueCollector.d.ts.map +1 -0
- package/types/src/writer/utils/TextUtils.d.ts +8 -0
- package/types/src/writer/utils/TextUtils.d.ts.map +1 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +19 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts.map +1 -0
- package/types/src/writer/utils/VersionUtils.d.ts +26 -0
- package/types/src/writer/utils/VersionUtils.d.ts.map +1 -0
|
@@ -0,0 +1,2193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.23-beta.1
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { n as e } from "./BVAAJynubTdvPOQA.mjs";
|
|
8
|
+
import { a as t, d as n, f as r, i, n as a, o, p as s, r as c, t as l } from "./CcXnQZ4Fk_nkbq2G.mjs";
|
|
9
|
+
import { CommonUtils as u } from "@sheetxl/utils";
|
|
10
|
+
import { AddressUtils as d, FormulaError as f, IBorder as p, ICondition as m, IEffect as h, IFill as g, IFont as _, IRange as v, IStyle as y, ITextFrame as b, Sort as x, Tuple as ee } from "@sheetxl/sdk";
|
|
11
|
+
var te = class {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.list = e;
|
|
14
|
+
}
|
|
15
|
+
get length() {
|
|
16
|
+
return this.list.length;
|
|
17
|
+
}
|
|
18
|
+
item(e) {
|
|
19
|
+
return this.list[e];
|
|
20
|
+
}
|
|
21
|
+
forEach(e, t) {
|
|
22
|
+
let n = this.list, r = n.length;
|
|
23
|
+
for (let t = 0; t < r; t++) e(n[t], t, this);
|
|
24
|
+
}
|
|
25
|
+
entries() {
|
|
26
|
+
return this.list.entries();
|
|
27
|
+
}
|
|
28
|
+
keys() {
|
|
29
|
+
return this.list.keys();
|
|
30
|
+
}
|
|
31
|
+
values() {
|
|
32
|
+
return this.list.values();
|
|
33
|
+
}
|
|
34
|
+
[Symbol.iterator]() {
|
|
35
|
+
return this.list.values();
|
|
36
|
+
}
|
|
37
|
+
}, ne = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, re = (e) => {
|
|
38
|
+
let t = parseInt(e);
|
|
39
|
+
return isNaN(t) ? null : t;
|
|
40
|
+
}, ie = (e) => {
|
|
41
|
+
let t = parseFloat(e);
|
|
42
|
+
return isNaN(t) ? null : t;
|
|
43
|
+
}, ae = /* @__PURE__ */ new Map(), S = class {
|
|
44
|
+
constructor(e, t, n, r, i, a = null, o = u.EmptyObject) {
|
|
45
|
+
this._fileLocation = "";
|
|
46
|
+
let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
|
|
47
|
+
this._parent = e, this.sharedShared = t, this.currentPath = n, this.elemRoot = r, this.jsonRoot = i, e ? (this._fileLocation = e._fileLocation, this._getRef = e._getRef, this._getRefs = e._getRefs, this._serializeElement = e._serializeElement) : (a && (this._fileLocation = a), o?.getRef && (this._getRef = s), o?.getRefs && (this._getRefs = c), this._onWarning = o?.onWarning, this._addPerson = o?.addPerson, this._serializeElement = o?.serializeElement);
|
|
48
|
+
}
|
|
49
|
+
getRef(e, t = !1) {
|
|
50
|
+
return this._getRef?.(e, this._fileLocation, t) ?? null;
|
|
51
|
+
}
|
|
52
|
+
getRelationships() {
|
|
53
|
+
return this._getRefs?.(this._fileLocation) ?? ae;
|
|
54
|
+
}
|
|
55
|
+
getPath() {
|
|
56
|
+
return this.currentPath;
|
|
57
|
+
}
|
|
58
|
+
getFileLocation() {
|
|
59
|
+
return this._fileLocation;
|
|
60
|
+
}
|
|
61
|
+
getElemRoot() {
|
|
62
|
+
return this.elemRoot;
|
|
63
|
+
}
|
|
64
|
+
getJsonRoot() {
|
|
65
|
+
return this.jsonRoot;
|
|
66
|
+
}
|
|
67
|
+
warn(e) {
|
|
68
|
+
this._onWarning ? this._onWarning(e) : this._parent ? this._parent?.warn?.(e) : console.warn(e);
|
|
69
|
+
}
|
|
70
|
+
serializeElement(e) {
|
|
71
|
+
return this._serializeElement?.(e) ?? null;
|
|
72
|
+
}
|
|
73
|
+
addPerson(e) {
|
|
74
|
+
return typeof e == "string" && (e = { displayName: e }), this._addPerson ? this._addPerson(e) : this._parent ? this._parent?._addPerson?.(e) ?? null : null;
|
|
75
|
+
}
|
|
76
|
+
getVisitorParamsState() {
|
|
77
|
+
return this.sharedShared.getVisitorParamsState();
|
|
78
|
+
}
|
|
79
|
+
evaluate(e, t) {
|
|
80
|
+
if (!e) return t;
|
|
81
|
+
let n = [t], r = e.split("/"), i = r.length;
|
|
82
|
+
for (let e = 0; e < i; e++) {
|
|
83
|
+
let t = r[e];
|
|
84
|
+
if (t === "" || t === ".") continue;
|
|
85
|
+
let a = [], o = (t === "*" || t === "**") && e !== i - 1;
|
|
86
|
+
for (let i of n) if (i) if (o) {
|
|
87
|
+
let t = r[e + 1];
|
|
88
|
+
t && t !== "" && t !== "." && (this._findDescendants(i, t, a), e++);
|
|
89
|
+
} else if (t === "*" || t === "**") {
|
|
90
|
+
if (!i.childNodes) continue;
|
|
91
|
+
let e = i.childNodes, t = e.length;
|
|
92
|
+
for (let n = 0; n < t; n++) {
|
|
93
|
+
let t = e[n];
|
|
94
|
+
t.nodeType === 1 && a.push(t);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (!i.childNodes) continue;
|
|
98
|
+
let e = i.childNodes, n = e.length;
|
|
99
|
+
for (let r = 0; r < n; r++) {
|
|
100
|
+
let n = e[r];
|
|
101
|
+
if (n.nodeType !== 1) continue;
|
|
102
|
+
let i = n;
|
|
103
|
+
this._matchesElementName(i, t) && a.push(i);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (n = a, n.length === 0) return null;
|
|
107
|
+
}
|
|
108
|
+
return n.length === 1 ? n[0] : n.length === 0 ? null : new te(n);
|
|
109
|
+
}
|
|
110
|
+
_matchesElementName(e, t) {
|
|
111
|
+
return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
|
|
112
|
+
}
|
|
113
|
+
_findDescendants(e, t, n) {
|
|
114
|
+
if (!e || !e.childNodes) return;
|
|
115
|
+
let r = e.childNodes, i = r.length;
|
|
116
|
+
for (let e = 0; e < i; e++) {
|
|
117
|
+
let i = r[e];
|
|
118
|
+
if (i.nodeType !== 1) continue;
|
|
119
|
+
let a = i;
|
|
120
|
+
this._matchesElementName(a, t) && n.push(a), this._findDescendants(a, t, n);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
getFromPath(e, t) {
|
|
124
|
+
return u.getFromPath(e, t);
|
|
125
|
+
}
|
|
126
|
+
setToPath(e, t, n) {
|
|
127
|
+
return u.setToPath(e, t, n);
|
|
128
|
+
}
|
|
129
|
+
getValAttrAsString(e, t) {
|
|
130
|
+
let n = this.evaluate(e, t);
|
|
131
|
+
return n && n.hasAttribute("val") ? n.getAttribute("val") ?? null : null;
|
|
132
|
+
}
|
|
133
|
+
getValAttrAsBoolean(e, t, n = !1) {
|
|
134
|
+
let r = this.evaluate(e, t);
|
|
135
|
+
if (!r) return null;
|
|
136
|
+
let i = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
|
|
137
|
+
return i == null ? n : i === "1" || i === "on" || i === "true" || i !== "0" && i !== "off" && i !== "false" && n;
|
|
138
|
+
}
|
|
139
|
+
getValAttrAsInteger(e, t) {
|
|
140
|
+
let n = this.evaluate(e, t);
|
|
141
|
+
return n && n.hasAttribute("val") ? parseInt(n.getAttribute("val")) ?? null : null;
|
|
142
|
+
}
|
|
143
|
+
getValAttrAsFloat(e, t) {
|
|
144
|
+
let n = this.evaluate(e, t);
|
|
145
|
+
return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
|
|
146
|
+
}
|
|
147
|
+
get BOOLEAN_COPY() {
|
|
148
|
+
return ne;
|
|
149
|
+
}
|
|
150
|
+
get INT_COPY() {
|
|
151
|
+
return re;
|
|
152
|
+
}
|
|
153
|
+
get FLOAT_COPY() {
|
|
154
|
+
return ie;
|
|
155
|
+
}
|
|
156
|
+
copyFromAttribute(e, t, n, r = t, i = null) {
|
|
157
|
+
if (!e || !n || !e.hasAttribute(t)) return;
|
|
158
|
+
let a = e.getAttribute(t);
|
|
159
|
+
if (i) {
|
|
160
|
+
if (Array.isArray(i)) {
|
|
161
|
+
let e = i.length;
|
|
162
|
+
for (let t = 0; t < e; t++) if (a == null || (a = i[t](a), a == null)) return;
|
|
163
|
+
} else if (a == null || (a = i(a), a == null)) return;
|
|
164
|
+
}
|
|
165
|
+
this.setToPath(n, r, a);
|
|
166
|
+
}
|
|
167
|
+
}, C = e({
|
|
168
|
+
isBlank: () => k,
|
|
169
|
+
isNotBlank: () => A,
|
|
170
|
+
length: () => j,
|
|
171
|
+
parseRotation: () => w,
|
|
172
|
+
parseValAttrAsBoolean: () => E,
|
|
173
|
+
parseValAttrAsFloat: () => O,
|
|
174
|
+
parseValAttrAsInteger: () => D,
|
|
175
|
+
parseValAttrAsString: () => T
|
|
176
|
+
}), w = (e, t) => {
|
|
177
|
+
if (!e || !e.hasAttribute("rot")) return;
|
|
178
|
+
let n = e.getAttribute("rot"), r = u.roundAccurately(a(n), 2);
|
|
179
|
+
r !== -1e3 && (t.rotation = r);
|
|
180
|
+
}, T = (e, t, n, r, i) => {
|
|
181
|
+
let a = e.getValAttrAsString(r, t);
|
|
182
|
+
a !== null && (n[i] = a);
|
|
183
|
+
}, E = (e, t, n, r, i = r, a = null) => {
|
|
184
|
+
let o = e.getValAttrAsBoolean(r, t, a);
|
|
185
|
+
o !== null && (n[i] = o);
|
|
186
|
+
}, D = (e, t, n, r, i) => {
|
|
187
|
+
let a = e.getValAttrAsInteger(r, t);
|
|
188
|
+
a !== null && (n[i] = a);
|
|
189
|
+
}, O = (e, t, n, r, i, a = 1) => {
|
|
190
|
+
let o = e.getValAttrAsFloat(r, t);
|
|
191
|
+
o !== null && (n[i] = o * a);
|
|
192
|
+
}, k = (e) => !e || e.trim().length === 0, A = (e) => !k(e), j = (e) => e?.length ?? 0, M = class {
|
|
193
|
+
constructor(e) {
|
|
194
|
+
this.jsonKey = e;
|
|
195
|
+
}
|
|
196
|
+
visit(e, t, n) {
|
|
197
|
+
let r = {};
|
|
198
|
+
return n[this.jsonKey] = r, r;
|
|
199
|
+
}
|
|
200
|
+
}, N = class {
|
|
201
|
+
visit(e, t, n) {}
|
|
202
|
+
getStroke(e, t) {
|
|
203
|
+
let n = e.evaluate("ln", t);
|
|
204
|
+
return n ? this.parseLn(e, n) : {};
|
|
205
|
+
}
|
|
206
|
+
parseLn(e, t) {
|
|
207
|
+
let n = {};
|
|
208
|
+
t.hasAttribute("algn") && (n.align = t.getAttribute("algn")), t.hasAttribute("cap") && (n.lineCap = se(t.getAttribute("cap"))), t.hasAttribute("cmpd") && (n.compound = t.getAttribute("cmpd")), t.hasAttribute("w") && (n.width = o(t.getAttribute("w")));
|
|
209
|
+
let r = e.evaluate("miter", t);
|
|
210
|
+
r && (n.lineJoin = "miter", r.hasAttribute("lim") && (n.miterLimit = parseFloat(r.getAttribute("lim")) / 1e5)), e.evaluate("bevel", t) && (n.lineJoin = "bevel"), e.evaluate("round", t) && (n.lineJoin = "round");
|
|
211
|
+
let a = e.evaluate("custDash", t);
|
|
212
|
+
if (a) {
|
|
213
|
+
let t = e.evaluate("ds", a);
|
|
214
|
+
if (t && t.length > 0) {
|
|
215
|
+
let e = [];
|
|
216
|
+
for (let n = 0; n < t.length; n++) {
|
|
217
|
+
let r = t.item(n);
|
|
218
|
+
e.push(i(r.getAttribute("d") ?? "")), e.push(i(r.getAttribute("sp") ?? ""));
|
|
219
|
+
}
|
|
220
|
+
n.dash = e;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
let s = e.evaluate("prstDash", t);
|
|
224
|
+
s && s.hasAttribute("val") && (n.dash = s.getAttribute("val")), this.parseEndElement(e, t, n, "headEnd", "head"), this.parseEndElement(e, t, n, "tailEnd", "tail");
|
|
225
|
+
let c = this.getFill(e, t);
|
|
226
|
+
return c && (n.fill = c), n;
|
|
227
|
+
}
|
|
228
|
+
parseEndElement(e, t, n, r, i) {
|
|
229
|
+
let a = e.evaluate(r, t);
|
|
230
|
+
if (a && (a.hasAttribute("type") && (n[i + "Type"] = a.getAttribute("type")), a.hasAttribute("len") || a.hasAttribute("w"))) {
|
|
231
|
+
let e = a.getAttribute("len") || "med", t = a.getAttribute("w") || "med";
|
|
232
|
+
n[i + "Size"] = e + "-" + t;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
getEffects(e, t) {
|
|
236
|
+
let n = e.evaluate("effectLst", t);
|
|
237
|
+
if (!n) return null;
|
|
238
|
+
let r = [], i = n.childNodes, a = i.length;
|
|
239
|
+
for (let t = 0; t < a; t++) {
|
|
240
|
+
let n = i.item(t);
|
|
241
|
+
if (n.nodeType !== 1) continue;
|
|
242
|
+
let a = this.processEffectElement(e, n, n.localName);
|
|
243
|
+
if (a === void 0) return;
|
|
244
|
+
r.push(a);
|
|
245
|
+
}
|
|
246
|
+
return r;
|
|
247
|
+
}
|
|
248
|
+
processEffectElement(e, t, n) {
|
|
249
|
+
switch (n) {
|
|
250
|
+
case "outerShdw": {
|
|
251
|
+
let n = {
|
|
252
|
+
type: h.Type.OuterShadow,
|
|
253
|
+
color: this.processAdjColor(e, t)
|
|
254
|
+
};
|
|
255
|
+
return t.hasAttribute("dist") && (n.distance = o(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = a(t.getAttribute("dir"))), t.hasAttribute("blurRad") && (n.blur = o(t.getAttribute("blurRad"))), t.hasAttribute("algn") && (n.alignment = t.getAttribute("algn")), t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = c(t.getAttribute("rotWithShape"))), t.hasAttribute("sx") && (n.scaleX = i(t.getAttribute("sx"))), t.hasAttribute("sy") && (n.scaleY = i(t.getAttribute("sy"))), t.hasAttribute("kx") && (n.skewX = a(t.getAttribute("kx"))), t.hasAttribute("ky") && (n.skewY = a(t.getAttribute("ky"))), n;
|
|
256
|
+
}
|
|
257
|
+
case "innerShdw": {
|
|
258
|
+
let n = {
|
|
259
|
+
type: h.Type.InnerShadow,
|
|
260
|
+
color: this.processAdjColor(e, t)
|
|
261
|
+
};
|
|
262
|
+
return t.hasAttribute("dist") && (n.distance = o(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = a(t.getAttribute("dir"))), t.hasAttribute("blurRad") && (n.blur = o(t.getAttribute("blurRad"))), n;
|
|
263
|
+
}
|
|
264
|
+
case "prstShdw": {
|
|
265
|
+
let n = {
|
|
266
|
+
type: h.Type.PresetShadow,
|
|
267
|
+
color: this.processAdjColor(e, t),
|
|
268
|
+
preset: t.getAttribute("prst") ?? void 0
|
|
269
|
+
};
|
|
270
|
+
return t.hasAttribute("dist") && (n.distance = o(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = a(t.getAttribute("dir"))), n;
|
|
271
|
+
}
|
|
272
|
+
case "glow": {
|
|
273
|
+
let n = {
|
|
274
|
+
type: h.Type.Glow,
|
|
275
|
+
color: this.processAdjColor(e, t)
|
|
276
|
+
};
|
|
277
|
+
return t.hasAttribute("rad") && (n.radius = o(t.getAttribute("rad"))), n;
|
|
278
|
+
}
|
|
279
|
+
case "softEdge": {
|
|
280
|
+
let e = { type: h.Type.SoftEdge };
|
|
281
|
+
return t.hasAttribute("rad") && (e.radius = o(t.getAttribute("rad"))), e;
|
|
282
|
+
}
|
|
283
|
+
case "reflection": {
|
|
284
|
+
let e = { type: h.Type.Reflection };
|
|
285
|
+
return t.hasAttribute("blurRad") && (e.blur = o(t.getAttribute("blurRad"))), t.hasAttribute("dist") && (e.distance = o(t.getAttribute("dist"))), t.hasAttribute("dir") && (e.angle = a(t.getAttribute("dir"))), t.hasAttribute("fadeDir") && (e.fadeAngle = a(t.getAttribute("fadeDir"))), t.hasAttribute("stA") && (e.startAlpha = i(t.getAttribute("stA"))), t.hasAttribute("stPos") && (e.startPosition = i(t.getAttribute("stPos"))), t.hasAttribute("endA") && (e.endAlpha = i(t.getAttribute("endA"))), t.hasAttribute("endPos") && (e.endPosition = i(t.getAttribute("endPos"))), t.hasAttribute("sx") && (e.scaleX = i(t.getAttribute("sx"))), t.hasAttribute("sy") && (e.scaleY = i(t.getAttribute("sy"))), t.hasAttribute("kx") && (e.skewX = a(t.getAttribute("kx"))), t.hasAttribute("ky") && (e.skewY = a(t.getAttribute("ky"))), t.hasAttribute("algn") && (e.alignment = t.getAttribute("algn")), t.hasAttribute("rotWithShape") && (e.isRotatedWithShape = c(t.getAttribute("rotWithShape"))), e;
|
|
286
|
+
}
|
|
287
|
+
default: return;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
getFill(e, t) {
|
|
291
|
+
if (e.evaluate("noFill", t)) return { type: g.Type.None };
|
|
292
|
+
let n = e.evaluate("solidFill", t);
|
|
293
|
+
if (n) {
|
|
294
|
+
let t = this.processAdjColor(e, n);
|
|
295
|
+
if (t) return {
|
|
296
|
+
type: g.Type.Solid,
|
|
297
|
+
color: t
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
let r = e.evaluate("gradFill", t);
|
|
301
|
+
if (r) return this.processGradFill(e, r);
|
|
302
|
+
let i = e.evaluate("pattFill", t);
|
|
303
|
+
if (i) return this.processPatternFill(e, i);
|
|
304
|
+
let a = e.evaluate("blipFill", t);
|
|
305
|
+
return a ? this.processImageFill(e, a) : null;
|
|
306
|
+
}
|
|
307
|
+
processGradFill(e, t) {
|
|
308
|
+
let n = { type: g.Type.Gradient };
|
|
309
|
+
t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = t.getAttribute("rotWithShape") === "1");
|
|
310
|
+
let r = e.evaluate("lin", t);
|
|
311
|
+
r && (n.gradientType = g.GradientType.Linear, r.hasAttribute("ang") && (n.angle = a(r.getAttribute("ang"))), r.hasAttribute("scaled") && (n.scaled = c(r.getAttribute("scaled"))));
|
|
312
|
+
let o = {};
|
|
313
|
+
t.hasAttribute("flip") && (o.mirror = t.getAttribute("flip")), Object.keys(o).length > 0 && (n.tile = o);
|
|
314
|
+
let s = e.evaluate("path", t);
|
|
315
|
+
if (s) {
|
|
316
|
+
s.hasAttribute("path") && (n.gradientType = oe(s.getAttribute("path")));
|
|
317
|
+
let t = e.evaluate("fillToRect", s);
|
|
318
|
+
t && (n.focus = this.getRect(t));
|
|
319
|
+
}
|
|
320
|
+
let l = e.evaluate("tileRect", t);
|
|
321
|
+
l && (n.tile ||= {}, n.tile.bounds = this.getRect(l));
|
|
322
|
+
let u = [], d = e.evaluate("gsLst/gs", t), f = d ? d.length : 0;
|
|
323
|
+
for (let t = 0; t < f; t++) {
|
|
324
|
+
let n = d.item(t), r = {
|
|
325
|
+
offset: i(n.getAttribute("pos") ?? ""),
|
|
326
|
+
color: this.processAdjColor(e, n)
|
|
327
|
+
};
|
|
328
|
+
u.push(r);
|
|
329
|
+
}
|
|
330
|
+
return u.length > 0 && (n.stops = u), n;
|
|
331
|
+
}
|
|
332
|
+
getRect(e) {
|
|
333
|
+
let t = {};
|
|
334
|
+
return e.hasAttribute("t") && (t.t = i(e.getAttribute("t"))), e.hasAttribute("l") && (t.l = i(e.getAttribute("l"))), e.hasAttribute("b") && (t.b = i(e.getAttribute("b"))), e.hasAttribute("r") && (t.r = i(e.getAttribute("r"))), Object.keys(t).length === 0 ? null : t;
|
|
335
|
+
}
|
|
336
|
+
processImageFill(e, t) {
|
|
337
|
+
let n = { type: g.Type.Image };
|
|
338
|
+
return t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = c(t.getAttribute("rotWithShape"))), t.hasAttribute("dpi") && (n.dpi = t.getAttribute("dpi")), n.ref = "https://www.sheetxl.com/logo-color-padded-white.jpg", n.tile = !1, n;
|
|
339
|
+
}
|
|
340
|
+
processPatternFill(e, t) {
|
|
341
|
+
let n = { type: g.Type.Pattern };
|
|
342
|
+
n.patternType = t.getAttribute("prst");
|
|
343
|
+
let r = e.evaluate("bgClr", t);
|
|
344
|
+
if (r) {
|
|
345
|
+
let t = this.processAdjColor(e, r);
|
|
346
|
+
t && (n.background = t);
|
|
347
|
+
}
|
|
348
|
+
let i = e.evaluate("fgClr", t);
|
|
349
|
+
if (i) {
|
|
350
|
+
let t = this.processAdjColor(e, i);
|
|
351
|
+
t && (n.foreground = t);
|
|
352
|
+
}
|
|
353
|
+
return n;
|
|
354
|
+
}
|
|
355
|
+
processAdjColor(e, t) {
|
|
356
|
+
let n = e.evaluate("hslClr", t);
|
|
357
|
+
if (n) return this.processHslClr(e, n);
|
|
358
|
+
let r = e.evaluate("prstClr", t);
|
|
359
|
+
if (r) return this.processClrWithValAttribute(e, r);
|
|
360
|
+
let i = e.evaluate("schemeClr", t);
|
|
361
|
+
if (i) return this.processClrWithValAttribute(e, i);
|
|
362
|
+
let a = e.evaluate("sysClr", t);
|
|
363
|
+
if (a) {
|
|
364
|
+
let t = this.processClrWithValAttribute(e, a), n = a.getAttribute("lastClr");
|
|
365
|
+
return t && n && (t += ` lastClr ${n}`), t;
|
|
366
|
+
}
|
|
367
|
+
let o = e.evaluate("scrgbClr", t);
|
|
368
|
+
if (o) return this.processScrgbClrElement(e, o);
|
|
369
|
+
let s = e.evaluate("srgbClr", t);
|
|
370
|
+
return s ? this.processSrgbClrElement(e, s) : null;
|
|
371
|
+
}
|
|
372
|
+
processScrgbClrElement(e, t) {
|
|
373
|
+
let n = "lrgba(" + i(t.getAttribute("r") ?? "") + "," + i(t.getAttribute("g") ?? "") + "," + i(t.getAttribute("b") ?? "") + ")";
|
|
374
|
+
return n += this.processAdjustments(e, t), n;
|
|
375
|
+
}
|
|
376
|
+
processSrgbClrElement(e, t) {
|
|
377
|
+
let n = t.getAttribute("val");
|
|
378
|
+
return n += this.processAdjustments(e, t), n;
|
|
379
|
+
}
|
|
380
|
+
processHslClr(e, t) {
|
|
381
|
+
let n = "hsl(" + a(t.getAttribute("hue") ?? "") + "," + i(t.getAttribute("sat") ?? "") + "," + i(t.getAttribute("lum") ?? "") + ")";
|
|
382
|
+
return n += this.processAdjustments(e, t), n;
|
|
383
|
+
}
|
|
384
|
+
processClrWithValAttribute(e, t) {
|
|
385
|
+
let n = t.getAttribute("val");
|
|
386
|
+
if (!n) return null;
|
|
387
|
+
let r = n;
|
|
388
|
+
return r += this.processAdjustments(e, t), r;
|
|
389
|
+
}
|
|
390
|
+
processAdjustments(e, t) {
|
|
391
|
+
let n = "", r = t.childNodes, i = r.length;
|
|
392
|
+
for (let t = 0; t < i; t++) {
|
|
393
|
+
let i = r.item(t);
|
|
394
|
+
if (i.nodeType === 1) {
|
|
395
|
+
let t = i.localName;
|
|
396
|
+
n += t === "hue" || t === "hueOff" || t === "hueMod" ? this.processAdjustmentElement(e, i, t, 6e4) : t === "gray" || t === "comp" || t === "inv" || t === "gamma" || t === "invGamma" ? this.processAdjustmentElement(e, i, t, 1) : t === "alpha" || t === "alphaOff" || t === "alphaMod" ? this.processAdjustmentElement(e, i, t, 1e5) : this.processAdjustmentElement(e, i, t);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return n;
|
|
400
|
+
}
|
|
401
|
+
processAdjustmentElement(e, t, n, r = 1e3) {
|
|
402
|
+
let i = t.getAttribute("val");
|
|
403
|
+
return i ? ` ${n} ${!i || parseFloat(i) / r}` : ` ${n}`;
|
|
404
|
+
}
|
|
405
|
+
}, oe = (e) => e === "circle" ? "radial" : e, se = (e) => {
|
|
406
|
+
if (e === "rnd") return "round";
|
|
407
|
+
if (e === "flat") return "butt";
|
|
408
|
+
if (e === "sq") return "square";
|
|
409
|
+
throw Error("Invalid lineCap type: " + e);
|
|
410
|
+
}, P = class extends N {
|
|
411
|
+
visit(e, n, r) {
|
|
412
|
+
try {
|
|
413
|
+
let i = e.evaluate("xfrm", n);
|
|
414
|
+
if (i) {
|
|
415
|
+
w(i, r);
|
|
416
|
+
let n = {
|
|
417
|
+
x: 0,
|
|
418
|
+
y: 0,
|
|
419
|
+
width: 0,
|
|
420
|
+
height: 0
|
|
421
|
+
}, a = e.evaluate("off", i);
|
|
422
|
+
a && (n.x = t(a.getAttribute("x")) ?? 0, n.y = t(a.getAttribute("y")) ?? 0);
|
|
423
|
+
let o = e.evaluate("ext", i);
|
|
424
|
+
a && (n.width = t(o.getAttribute("cx")) ?? 0, n.height = t(o.getAttribute("cy")) ?? 0), r.bounds = n;
|
|
425
|
+
}
|
|
426
|
+
let a = e.evaluate("prstGeom", n);
|
|
427
|
+
a?.hasAttribute("prst") ? r.geometry = a?.getAttribute("prst") : e.evaluate("customGeom", n) && console.warn("customGeom not supported yet");
|
|
428
|
+
let o = this.getFill(e, n);
|
|
429
|
+
o && Object.keys(o).length > 0 && (r.fill = o);
|
|
430
|
+
let s = this.getStroke(e, n);
|
|
431
|
+
return s && Object.keys(s).length > 0 && (r.stroke = s), r;
|
|
432
|
+
} catch (e) {
|
|
433
|
+
console.warn(e);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}, F = class {
|
|
437
|
+
visit(e, t, n) {
|
|
438
|
+
let r = {};
|
|
439
|
+
if (T(e, t, r, "grouping", "grouping"), E(e, t, r, "varyColors", "varyColors"), O(e, t, r, "gapWidth", "gapWidth", .01), O(e, t, r, "overlap", "overlap", .01), this.parseType(e, t, r), D(e, t, r, "bubbleScale", "bubbleScale"), E(e, t, r, "showNegBubbles", "showNegativeBubbleValues"), E(e, t, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), D(e, t, r, "firstSliceAng", "startAngle"), D(e, t, r, "holeSize", "holeSize"), T(e, t, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(e, t, r), Object.keys(r).length > 0) {
|
|
440
|
+
let t = e.getVisitorParamsState().get("types");
|
|
441
|
+
t || (console.warn("Uninitialized types array in ChartTypeVisitor"), t = [], e.getVisitorParamsState().set("types", t)), t.push(r);
|
|
442
|
+
}
|
|
443
|
+
return r;
|
|
444
|
+
}
|
|
445
|
+
parseType(e, t, n) {
|
|
446
|
+
switch (t.localName) {
|
|
447
|
+
case "areaChart":
|
|
448
|
+
n.type = "area";
|
|
449
|
+
break;
|
|
450
|
+
case "bubbleChart":
|
|
451
|
+
n.type = "bubble";
|
|
452
|
+
break;
|
|
453
|
+
case "doughnutChart":
|
|
454
|
+
case "ofPieType":
|
|
455
|
+
case "pieChart":
|
|
456
|
+
n.type = "pie";
|
|
457
|
+
break;
|
|
458
|
+
case "lineChart":
|
|
459
|
+
n.type = "line";
|
|
460
|
+
break;
|
|
461
|
+
case "scatterChart": n.type = "scatter";
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
parseAxisIds(e, t, n) {
|
|
465
|
+
let r = e.evaluate("axId", t);
|
|
466
|
+
r && r.length !== 0 && (n.xAxisId = r.item(0).getAttribute("val"), n.yAxisId = r.item(1).getAttribute("val"));
|
|
467
|
+
}
|
|
468
|
+
}, I = (e, t, n) => {
|
|
469
|
+
if (!0 === e.getValAttrAsBoolean("invertIfNegative", t)) if (e.evaluate("extLst/ext/invertSolidFillFmt", t)) {
|
|
470
|
+
if (n.fill && n.fillNegative) {
|
|
471
|
+
let t = e.getFromPath(n, "fill.solid.adjs");
|
|
472
|
+
t && e.setToPath(n, "fillNegative.solid.adjs", t);
|
|
473
|
+
}
|
|
474
|
+
} else {
|
|
475
|
+
let e = { val: "FFFFFF" }, t = {};
|
|
476
|
+
t.solid = e, n.fillNegative = t;
|
|
477
|
+
let r = { val: "000000" }, i = {};
|
|
478
|
+
i.solid = r;
|
|
479
|
+
let a = {};
|
|
480
|
+
a.fill = i, n.strokeNegative = a;
|
|
481
|
+
}
|
|
482
|
+
}, L = class extends N {
|
|
483
|
+
constructor(e = "text") {
|
|
484
|
+
super(), this._jsonKey = e;
|
|
485
|
+
}
|
|
486
|
+
getTextPath() {
|
|
487
|
+
return this._jsonKey;
|
|
488
|
+
}
|
|
489
|
+
visit(e, t, n) {
|
|
490
|
+
let r = e.getFromPath(n, this.getTextPath());
|
|
491
|
+
return r ||= {}, this.parseTextElement(e, t, r, !1), Object.keys(r).length > 0 && e.setToPath(n, this.getTextPath(), r), n;
|
|
492
|
+
}
|
|
493
|
+
parseTextElement(e, t, n, r) {
|
|
494
|
+
let i = e.evaluate("p/pPr/defRPr", t) ?? e.evaluate("defRPr", t);
|
|
495
|
+
i && (this.parseTextProperties(e, i, n), new P().visit(e, i, n));
|
|
496
|
+
let a = n.runs ?? [], o = e.evaluate("p/r", t) ?? e.evaluate("r", t), s = (t) => {
|
|
497
|
+
let n = {}, r = e.evaluate("t", t), i = e.evaluate("rPr", t);
|
|
498
|
+
i && this.parseTextProperties(e, i, n), r && r.firstChild ? n.text = r.firstChild.textContent ?? "" : t.textContent && (n.text = t.textContent ?? ""), Object.keys(n).length > 0 && a.push(n);
|
|
499
|
+
};
|
|
500
|
+
if (o?.length !== void 0) for (let e = 0; o && e < o.length; e++) s(o.item(e));
|
|
501
|
+
else s(o || t);
|
|
502
|
+
a.length > 0 && (n.runs = a);
|
|
503
|
+
let c = e.evaluate("bodyPr", t);
|
|
504
|
+
c && w(c, n);
|
|
505
|
+
}
|
|
506
|
+
parseTextProperties(e, t, n) {
|
|
507
|
+
if (!t) return;
|
|
508
|
+
t.hasAttribute("sz") && (n.size = parseFloat(t.getAttribute("sz")) / 100), t.hasAttribute("b") && (n.weight = t.getAttribute("b") === "1" ? 700 : 400), t.hasAttribute("i") && (n.italic = t.getAttribute("i") === "1"), t.hasAttribute("u") && (n.underline = t.getAttribute("u")), t.hasAttribute("strike") && (n.strike = t.getAttribute("strike"));
|
|
509
|
+
let r = this.getFill(e, t);
|
|
510
|
+
r && Object.keys(r).length > 0 && (n.color = r);
|
|
511
|
+
let i = e.evaluate("latin", t);
|
|
512
|
+
if (i && !i.getAttribute("typeface").startsWith("+")) {
|
|
513
|
+
let e = n.font ?? {};
|
|
514
|
+
if (i.hasAttribute("typeface") && (e.family = i.getAttribute("typeface")), i.hasAttribute("panose")) {
|
|
515
|
+
let t = i.getAttribute("panose");
|
|
516
|
+
t && (e.fallbacks = [_.getPanoseFallback(t)]);
|
|
517
|
+
}
|
|
518
|
+
i.hasAttribute("pitchFamily") && (e.pitch = i.getAttribute("pitchFamily")), i.hasAttribute("charset") && (e.charset = i.getAttribute("charset")), Object.keys(e).length > 0 && (n.font = e);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}, R = class {
|
|
522
|
+
visit(e, t, n) {}
|
|
523
|
+
processDataBarColor(e, t, r, i, a = "auto") {
|
|
524
|
+
if (!t) return;
|
|
525
|
+
let o = n((e) => t.getAttribute(e), a);
|
|
526
|
+
return o && (r[i] = o), r;
|
|
527
|
+
}
|
|
528
|
+
processFonts(e, t, n) {
|
|
529
|
+
if (!t) return;
|
|
530
|
+
let r = t.childNodes, i = 0, a = r.length;
|
|
531
|
+
for (let t = 0; t < a; t++) {
|
|
532
|
+
let a = r.item(t);
|
|
533
|
+
if (a.nodeType === 1 && a.localName === "font") {
|
|
534
|
+
let t = {};
|
|
535
|
+
this.processFont(e, a, t), n[i++] = t;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return n;
|
|
539
|
+
}
|
|
540
|
+
processFont(e, t, n) {
|
|
541
|
+
e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style = _.Style.Italic), e.getValAttrAsBoolean("strike", t, !0) && (n.strike = !0);
|
|
542
|
+
let r = e.evaluate("u", t);
|
|
543
|
+
r && (n.underline = r.getAttribute("val") || _.UnderlineStyle.Single), T(e, t, n, "vertAlign", "verticalAlign"), n.verticalAlign === "superscript" ? n.verticalAlign = _.VerticalAlignment.Super : n.verticalAlign === "subscript" && (n.verticalAlign = _.VerticalAlignment.Sub), O(e, t, n, "sz", "size");
|
|
544
|
+
let i = e.evaluate("color", t);
|
|
545
|
+
this.processDataBarColor(e, i, n, "color"), n.color ||= "auto", T(e, t, n, "name", "family"), T(e, t, n, "rFont", "family");
|
|
546
|
+
let a = e.evaluate("family", t);
|
|
547
|
+
if (a) {
|
|
548
|
+
let e = a.getAttribute("val");
|
|
549
|
+
if (e) switch (e) {
|
|
550
|
+
case "1":
|
|
551
|
+
n.fallbacks = ["serif"];
|
|
552
|
+
break;
|
|
553
|
+
case "2":
|
|
554
|
+
n.fallbacks = ["sans-serif"];
|
|
555
|
+
break;
|
|
556
|
+
case "3":
|
|
557
|
+
n.fallbacks = ["monospace"];
|
|
558
|
+
break;
|
|
559
|
+
case "4":
|
|
560
|
+
n.fallbacks = ["cursive"];
|
|
561
|
+
break;
|
|
562
|
+
case "5": n.fallbacks = ["fantasy"];
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return T(e, t, n, "scheme", "scheme"), E(e, t, n, "shadow", "shadow", !0), E(e, t, n, "outline", "outline", !0), e.getValAttrAsBoolean("condense", t, !0) && (n.letterSpacing = -1), e.getValAttrAsBoolean("extend", t, !0) && (n.letterSpacing = 1), D(e, t, n, "charset", "charset"), n;
|
|
566
|
+
}
|
|
567
|
+
processFills(e, t, n) {
|
|
568
|
+
if (!t) return;
|
|
569
|
+
let r = t.childNodes, i = 0, a = r.length;
|
|
570
|
+
for (let t = 0; t < a; t++) {
|
|
571
|
+
let a = r.item(t);
|
|
572
|
+
a.nodeType === 1 && a.localName === "fill" && this.processFill(e, a, n, i++);
|
|
573
|
+
}
|
|
574
|
+
return n;
|
|
575
|
+
}
|
|
576
|
+
processFill(e, t, n, r) {
|
|
577
|
+
let i = { type: g.Type.None }, a = t.childNodes, o = !1, s = a.length;
|
|
578
|
+
for (let t = 0; !o && t < s; t++) {
|
|
579
|
+
let n = a.item(t);
|
|
580
|
+
n.nodeType === 1 && (n.localName === "gradientFill" ? (this.processGradientFill(e, n, i), o = !0) : n.localName === "patternFill" && (this.processPatternFill(e, n, i), o = !0));
|
|
581
|
+
}
|
|
582
|
+
return n[r] = i, n;
|
|
583
|
+
}
|
|
584
|
+
processGradientFill(e, t, n) {
|
|
585
|
+
if (!t) return;
|
|
586
|
+
n.type = g.Type.Gradient;
|
|
587
|
+
let r = [];
|
|
588
|
+
n.stops = r;
|
|
589
|
+
let i = t.getAttribute("type");
|
|
590
|
+
i && (n.gradientType = i);
|
|
591
|
+
let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
|
|
592
|
+
(a + 90) % 360 != 0 && (n.angle = (a + 90) % 360), (t.hasAttribute("left") || t.hasAttribute("top") || t.hasAttribute("right") || t.hasAttribute("bottom")) && (n.focus = {
|
|
593
|
+
left: z(t.getAttribute("left")),
|
|
594
|
+
top: z(t.getAttribute("top")),
|
|
595
|
+
right: z(t.getAttribute("right")),
|
|
596
|
+
bottom: z(t.getAttribute("bottom"))
|
|
597
|
+
});
|
|
598
|
+
let o = t.childNodes, s = o.length;
|
|
599
|
+
for (let t = 0; t < s; t++) {
|
|
600
|
+
let n = o.item(t);
|
|
601
|
+
if (n.nodeType === 1 && n.localName === "stop") {
|
|
602
|
+
let t = {};
|
|
603
|
+
r.push(t), t.offset = parseFloat(n.getAttribute("position") ?? "");
|
|
604
|
+
let i = e.evaluate("color", n);
|
|
605
|
+
this.processDataBarColor(e, i, t, "color");
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return n;
|
|
609
|
+
}
|
|
610
|
+
processPatternFill(e, t, n) {
|
|
611
|
+
if (!t) return;
|
|
612
|
+
let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ? g.BuiltInSheetPattern.Solid : g.BuiltInSheetPattern.None);
|
|
613
|
+
if (i === g.BuiltInSheetPattern.None) return { none: !0 };
|
|
614
|
+
n.type = g.Type.Pattern, i && (n.patternType = i);
|
|
615
|
+
let a = "foreground", o = "background", s = n.patternType === g.BuiltInSheetPattern.Solid && r, c = s ? "dk1" : "lt1", l = s ? "lt1" : "dk1";
|
|
616
|
+
if (s) {
|
|
617
|
+
let e = a;
|
|
618
|
+
a = o, o = e;
|
|
619
|
+
}
|
|
620
|
+
let u = e.evaluate("fgColor", t);
|
|
621
|
+
this.processDataBarColor(e, u, n, a, c);
|
|
622
|
+
let d = e.evaluate("bgColor", t);
|
|
623
|
+
return this.processDataBarColor(e, d, n, o, l), s && (n.foreground ||= "lt1", n.background ||= "dk1"), n;
|
|
624
|
+
}
|
|
625
|
+
processBorders(e, t, n, r) {
|
|
626
|
+
if (!t) return;
|
|
627
|
+
let i = t.childNodes, a = 0, o = i.length;
|
|
628
|
+
for (let t = 0; t < o; t++) {
|
|
629
|
+
let o = i.item(t);
|
|
630
|
+
o.nodeType === 1 && o.localName === "border" && this.processBorder(e, o, n, a++, r);
|
|
631
|
+
}
|
|
632
|
+
return n;
|
|
633
|
+
}
|
|
634
|
+
processBorder(e, t, n, r, i) {
|
|
635
|
+
if (!t) return;
|
|
636
|
+
let a = {};
|
|
637
|
+
return this.processBorderStroke(e, t, a, p.Edge.Left), this.processBorderStroke(e, t, a, p.Edge.Right), i ? (a.right || a.left) && (a.right ? a.vertical = { ...a.right } : a.vertical = { ...a.left }) : this.processBorderStroke(e, t, a, p.Edge.Vertical), this.processBorderStroke(e, t, a, p.Edge.Top), this.processBorderStroke(e, t, a, p.Edge.Bottom), i ? (a.bottom || a.top) && (a.bottom ? a.horizontal = { ...a.bottom } : a.horizontal = { ...a.top }) : this.processBorderStroke(e, t, a, p.Edge.Horizontal), n[r] = a, n;
|
|
638
|
+
}
|
|
639
|
+
processBorderStroke(e, t, n, r) {
|
|
640
|
+
if (!t) return;
|
|
641
|
+
let i = e.evaluate(r, t);
|
|
642
|
+
if (!i) return;
|
|
643
|
+
let a = {};
|
|
644
|
+
i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = p.StrokeStyle.None);
|
|
645
|
+
let o = e.evaluate("color", i);
|
|
646
|
+
return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
|
|
647
|
+
}
|
|
648
|
+
}, z = (e) => {
|
|
649
|
+
if (!e) return 0;
|
|
650
|
+
let t = parseFloat(e);
|
|
651
|
+
return isNaN(t) ? 0 : t;
|
|
652
|
+
}, B = class {
|
|
653
|
+
visit(e, t, n) {
|
|
654
|
+
if (!t) return;
|
|
655
|
+
let r = e.evaluate("*/cNvPr", t);
|
|
656
|
+
return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), e.copyFromAttribute(r, "id", n)), n;
|
|
657
|
+
}
|
|
658
|
+
}, V = class extends B {
|
|
659
|
+
visit(e, t, n) {
|
|
660
|
+
if (!t) return;
|
|
661
|
+
if (e.getPath().includes("Fallback") && n.content) return n;
|
|
662
|
+
n = super.visit(e, t, n);
|
|
663
|
+
let r = e.evaluate("nvSpPr/cNvSpPr", t);
|
|
664
|
+
if (r) {
|
|
665
|
+
let t = e.evaluate("spLocks", r);
|
|
666
|
+
if (t) {
|
|
667
|
+
t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
|
|
668
|
+
let e = {};
|
|
669
|
+
Object.keys(e).length > 0 && (n.locks = e);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
e.warn(`'${n.name}' is not editable; imported as a fixed drawing.`);
|
|
673
|
+
let i = e.evaluate("*/cNvPr", t);
|
|
674
|
+
i?.item && (i = i.item(0));
|
|
675
|
+
let a = i?.getAttribute?.("id"), o = a ? parseInt(a, 10) : void 0, s = {
|
|
676
|
+
type: "sp",
|
|
677
|
+
xml: e.serializeElement(t) ?? void 0,
|
|
678
|
+
sourceId: o === void 0 || isNaN(o) ? void 0 : o
|
|
679
|
+
};
|
|
680
|
+
return n.content = {
|
|
681
|
+
type: "sp",
|
|
682
|
+
json: s
|
|
683
|
+
}, s;
|
|
684
|
+
}
|
|
685
|
+
}, H = "richTypes", U = "richData", W = class {
|
|
686
|
+
visit(e, t, n) {
|
|
687
|
+
if (!t) return;
|
|
688
|
+
let r = t.childNodes, i = r.length;
|
|
689
|
+
for (let t = 0; t < i; t++) {
|
|
690
|
+
let i = r.item(t);
|
|
691
|
+
i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(e, i, n);
|
|
692
|
+
}
|
|
693
|
+
return n;
|
|
694
|
+
}
|
|
695
|
+
processRelationship(e, t, n) {
|
|
696
|
+
let r = {};
|
|
697
|
+
e.copyFromAttribute(t, "Target", r, "target"), e.copyFromAttribute(t, "Type", r, "type"), e.copyFromAttribute(t, "TargetMode", r, "targetMode"), n[t.getAttribute("Id")] = r;
|
|
698
|
+
}
|
|
699
|
+
}, G = class {
|
|
700
|
+
visit(e, t, n) {
|
|
701
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
702
|
+
for (let t = 0; t < a; t++) {
|
|
703
|
+
let n = i.item(t);
|
|
704
|
+
if (n.nodeType !== 1) continue;
|
|
705
|
+
let a = this.processProperty(e, n);
|
|
706
|
+
a && r.push(a);
|
|
707
|
+
}
|
|
708
|
+
return r.length > 0 && (n.properties = r), r;
|
|
709
|
+
}
|
|
710
|
+
processProperty(e, t) {
|
|
711
|
+
if (t) return t.getAttribute("xsi:type"), {
|
|
712
|
+
key: t.localName,
|
|
713
|
+
value: t.textContent || ""
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
}, K = class {
|
|
717
|
+
visit(e, t, n) {
|
|
718
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
719
|
+
for (let t = 0; t < a; t++) {
|
|
720
|
+
let n = i.item(t);
|
|
721
|
+
if (n.nodeType !== 1) continue;
|
|
722
|
+
let a = this.processProperty(e, n);
|
|
723
|
+
a && r.push(a);
|
|
724
|
+
}
|
|
725
|
+
return r.length > 0 && (n.properties = r), r;
|
|
726
|
+
}
|
|
727
|
+
processProperty(e, t) {
|
|
728
|
+
if (t) return {
|
|
729
|
+
key: t.localName,
|
|
730
|
+
value: t.textContent || ""
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
}, ce = class {
|
|
734
|
+
visit(e, t, n) {
|
|
735
|
+
return E(e, t, n, "roundedCorners", "roundedCorners"), D(e, t, n, ".//AlternateContent/Fallback/style", "styleId"), e.getVisitorParamsState().set("types", []), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), n.range = null, n;
|
|
736
|
+
}
|
|
737
|
+
afterVisit(e, t, n) {
|
|
738
|
+
let r = {};
|
|
739
|
+
n.types = r;
|
|
740
|
+
let i = {}, a = 0, o = {}, s = 0, c = e.getVisitorParamsState().get("axes"), l = e.getVisitorParamsState().get("types"), u = l.length;
|
|
741
|
+
for (let e = 0; e < u; e++) {
|
|
742
|
+
let t = l[e];
|
|
743
|
+
if (t.xAxisId) {
|
|
744
|
+
let r = t.xAxisId, o = c.get(r);
|
|
745
|
+
i[e + ""] = o, t.offsetXAxis = e, delete t.xAxisId, n.xAxes = i, i.length = ++a;
|
|
746
|
+
}
|
|
747
|
+
if (t.yAxisId) {
|
|
748
|
+
let r = t.yAxisId, i = c.get(r);
|
|
749
|
+
o[e + ""] = i, t.offsetYAxis = e, delete t.yAxisId, n.yAxes = o, o.length = ++s;
|
|
750
|
+
}
|
|
751
|
+
r[e + ""] = t;
|
|
752
|
+
}
|
|
753
|
+
r.length = l.length;
|
|
754
|
+
let d = e.getVisitorParamsState().get("series");
|
|
755
|
+
if (!d || d.length === 0) return;
|
|
756
|
+
let f = {};
|
|
757
|
+
n.series = f;
|
|
758
|
+
let p = d.length;
|
|
759
|
+
for (let e = 0; e < p; e++) f[e + ""] = d[e];
|
|
760
|
+
f.length = p, e.getVisitorParamsState().delete("types"), e.getVisitorParamsState().delete("axes"), e.getVisitorParamsState().delete("series");
|
|
761
|
+
}
|
|
762
|
+
}, le = class {
|
|
763
|
+
visit(e, t, n) {
|
|
764
|
+
let r = {};
|
|
765
|
+
return n.plotArea = r, r;
|
|
766
|
+
}
|
|
767
|
+
}, ue = P, de = class extends F {
|
|
768
|
+
parseType(e, t, n) {
|
|
769
|
+
let r = e.getValAttrAsString("barDir", t);
|
|
770
|
+
r && (n.type = r === "col" ? "column" : "bar");
|
|
771
|
+
}
|
|
772
|
+
}, q = F, J = class {
|
|
773
|
+
constructor(e) {
|
|
774
|
+
this.jsonKey = e;
|
|
775
|
+
}
|
|
776
|
+
visit(e, t, n) {
|
|
777
|
+
let r = {}, i = r, a = e.getValAttrAsString("idx", t);
|
|
778
|
+
a !== null && (i = {}, i[a] = r);
|
|
779
|
+
let o = e.getValAttrAsBoolean("delete", t);
|
|
780
|
+
this.parseNumFormat(e, t, r), !0 === o ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (E(e, t, r, "showBubbleSize", "showBubbleSize"), E(e, t, r, "showCatName", "showCatName"), E(e, t, r, "showLeaderLines", "showLeaderLines"), E(e, t, r, "showPercent", "showPercentage"), E(e, t, r, "showSerName", "showSerName"), E(e, t, r, "showVal", "showVal"), E(e, t, r, "showLegendKey", "showLegendKey"));
|
|
781
|
+
let s = e.evaluate("separator", t);
|
|
782
|
+
return s !== null && (r.separator = s.textContent), T(e, t, r, "dLblPos", "position"), n[this.jsonKey] = i, r;
|
|
783
|
+
}
|
|
784
|
+
parseNumFormat(e, t, n) {
|
|
785
|
+
let r = e.evaluate("numFmt", t);
|
|
786
|
+
r && (n.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (n.sourceLinked = r.getAttribute("sourceLinked") === "1"));
|
|
787
|
+
}
|
|
788
|
+
}, fe = class {
|
|
789
|
+
visit(e, t, n) {
|
|
790
|
+
let r = {};
|
|
791
|
+
D(e, t, r, "explosion", "explosion");
|
|
792
|
+
let i = e.evaluate("cat/*/f", t);
|
|
793
|
+
i ||= e.evaluate("xVal/*/f", t);
|
|
794
|
+
let a = null;
|
|
795
|
+
i !== null && i.firstChild !== null && (a = i.firstChild.nodeValue), i || (i = e.evaluate("cat/strLit", t), i ||= e.evaluate("cat/numLit", t), i && (a = this.parsePointsAsString(e, i))), a !== null && (r.xRange = a);
|
|
796
|
+
let o = e.evaluate("val/*/f", t);
|
|
797
|
+
o ||= e.evaluate("yVal/*/f", t);
|
|
798
|
+
let s = null;
|
|
799
|
+
o && o.firstChild && (s = o.firstChild.nodeValue), o || (o = e.evaluate("val/numLit", t), o !== null && (s = this.parsePointsAsString(e, o))), s !== null && (r.valRange = s), this.parseTitleRangeOrValue(e, t, r), D(e, t, r, "idx", "idx"), E(e, t, r, "smooth", "smooth"), r.offsetChart = e.getVisitorParamsState().get("types").length - 1;
|
|
800
|
+
let c = e.getVisitorParamsState().get("series");
|
|
801
|
+
return c || (c = [], e.getVisitorParamsState().set("series", c)), c.push(r), r;
|
|
802
|
+
}
|
|
803
|
+
parseTitleRangeOrValue(e, t, n) {
|
|
804
|
+
let r = e.evaluate("tx/strRef/f", t);
|
|
805
|
+
if (r !== null) {
|
|
806
|
+
let t = r.firstChild.nodeValue;
|
|
807
|
+
e.setToPath(n, "title.range", t);
|
|
808
|
+
} else {
|
|
809
|
+
let r = e.evaluate("tx/v", t);
|
|
810
|
+
r !== null && e.setToPath(n, "title.text.simpleRun", r.firstChild.nodeValue);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
parsePointsAsString(e, t) {
|
|
814
|
+
let n = "{", r = e.getValAttrAsInteger("ptCount", t), i = e.evaluate("pt", t), a = [];
|
|
815
|
+
for (let n = 0; i && r && n < r; n++) {
|
|
816
|
+
let r = null, i = e.evaluate("pt[@idx='" + n + "']/v", t);
|
|
817
|
+
i && (r = i.textContent), a[n] = r;
|
|
818
|
+
}
|
|
819
|
+
for (let e = 0; e < a.length; e++) e > 0 && (n += ","), a[e] !== void 0 && (n += a[e]);
|
|
820
|
+
return n += "}", n;
|
|
821
|
+
}
|
|
822
|
+
afterVisit(e, t, n) {
|
|
823
|
+
I(e, t, n);
|
|
824
|
+
let r = e.getFromPath(n, "points");
|
|
825
|
+
if (r) {
|
|
826
|
+
let t = Object.keys(r);
|
|
827
|
+
for (let i = 0; i < t.length; i++) {
|
|
828
|
+
let a = t[i], o = e.getFromPath(r, a);
|
|
829
|
+
if (!o) continue;
|
|
830
|
+
let s = e.getFromPath(o, "markers");
|
|
831
|
+
s && (e.setToPath(n, "markers.points." + a, s), delete o.markers);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}, pe = class {
|
|
836
|
+
DataPointVisitor() {}
|
|
837
|
+
visit(e, t, n) {
|
|
838
|
+
let r = e.getFromPath(n, "points"), i = null;
|
|
839
|
+
r ? i = r : (i = {}, e.setToPath(n, "points", i));
|
|
840
|
+
let a = {}, o = e.getValAttrAsString("idx", t);
|
|
841
|
+
return o !== null && (i[o] = a), E(e, t, a, "bubble3D", "bubble3D"), D(e, t, a, "explosion", "explosion"), I(e, t, a), a;
|
|
842
|
+
}
|
|
843
|
+
}, me = class {
|
|
844
|
+
visit(e, t, n) {
|
|
845
|
+
let r = t.parentNode.localName;
|
|
846
|
+
if (r === "ser" || r === "dPt") {
|
|
847
|
+
let r = {}, i = e.getValAttrAsString("size", t);
|
|
848
|
+
i !== null && (r.size = i);
|
|
849
|
+
let a = e.getValAttrAsString("symbol", t);
|
|
850
|
+
return a && (r.type = a), n.markers = r, r;
|
|
851
|
+
}
|
|
852
|
+
return null;
|
|
853
|
+
}
|
|
854
|
+
}, Y = class {
|
|
855
|
+
visit(e, t, n) {
|
|
856
|
+
let r = {};
|
|
857
|
+
this.parseScaling(e, t, r), O(e, t, r, "majorUnit", "majorUnits"), O(e, t, r, "minorUnit", "minorUnits"), E(e, t, r, "delete", "shown"), this.parseOrientation(e, t, r), this.parseNumFormat(e, t, r), T(e, t, r, "majorTickMark", "majorTickMarks"), T(e, t, r, "minorTickMark", "minorTickMarks"), T(e, t, r, "crosses", "crosses"), O(e, t, r, "crossesAt", "crosses"), T(e, t, r, "crossBetween", "crossBetween"), this.parseLabelAlign(e, t, r), D(e, t, r, "lblOffset", "labelOffset"), T(e, t, r, "tickLblPos", "labelPosition");
|
|
858
|
+
let i = e.getValAttrAsInteger("noMultiLvlLbl", t);
|
|
859
|
+
r.labelMultiLevel = i !== null && i === 0, D(e, t, r, "tickMarkSkip", "tickMarkSkip"), D(e, t, r, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(t, e, r), this.parseTimeUnits(e, t, r, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(e, t, r, "minorUnitDates", "minorTimeUnit", "minorUnit"), T(e, t, r, "baseTimeUnit", "baseUnitDates"), e.getVisitorParamsState().get("axes") || (console.warn("Uninitialized axes map in AxisVisitor"), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
|
|
860
|
+
let a = e.getValAttrAsString("axId", t);
|
|
861
|
+
return e.getVisitorParamsState().get("axes").set(a, r), r;
|
|
862
|
+
}
|
|
863
|
+
parseTimeUnits(e, t, n, r, i, a) {
|
|
864
|
+
let o = {}, s = e.getValAttrAsString(i, t);
|
|
865
|
+
s !== null && (o.dem = s, o.amt = e.getValAttrAsString(a, t)), Object.keys(o).length > 0 && (n[r] = o);
|
|
866
|
+
}
|
|
867
|
+
parseDisplayCustOrBuiltInUnit(e, t, n) {
|
|
868
|
+
let r = t.getValAttrAsString("dispUnits/builtInUnit", e);
|
|
869
|
+
r ||= t.getValAttrAsString("dispUnits/custUnit", e), r && (n.displayUnits = r);
|
|
870
|
+
}
|
|
871
|
+
parseLabelAlign(e, t, n) {
|
|
872
|
+
let r = e.getValAttrAsString("lblAlgn", t);
|
|
873
|
+
r !== null && (r === "ctr" ? n.labelAlign = "center" : r === "l" ? n.labelAlign = "left" : r === "r" && (n.labelAlign = "right"));
|
|
874
|
+
}
|
|
875
|
+
parseOrientation(e, t, n) {
|
|
876
|
+
let r = e.getValAttrAsString("AxPos", t);
|
|
877
|
+
r !== null && (r === "b" ? n.orientation = "bottom" : r === "l" ? n.orientation = "left" : r === "r" ? n.orientation = "right" : r === "t" && (n.orientation = "top"));
|
|
878
|
+
}
|
|
879
|
+
parseNumFormat(e, t, n) {
|
|
880
|
+
let r = {}, i = e.evaluate("numFmt", t);
|
|
881
|
+
i !== null && (i.hasAttribute("formatCode") && (r.formatCode = i.getAttribute("formatCode")), i.hasAttribute("sourceLinked") && (r.sourceLinked = i.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (n.labels = r);
|
|
882
|
+
}
|
|
883
|
+
parseScaling(e, t, n) {
|
|
884
|
+
let r = e.getValAttrAsString("scaling/orientation", t);
|
|
885
|
+
r !== null && (n.inverted = r !== "minMax");
|
|
886
|
+
let i = e.getValAttrAsFloat("scaling/logBase", t);
|
|
887
|
+
i !== null && (n.logBase = i, n.scaleType = "log"), O(e, t, n, "scaling/max", "max"), O(e, t, n, "scaling/min", "min");
|
|
888
|
+
}
|
|
889
|
+
afterVisit(e, t, n) {
|
|
890
|
+
n.fill && n.labels && (n.labels.fill = n.fill, delete n.fill);
|
|
891
|
+
let r = e.getValAttrAsBoolean("delete", t);
|
|
892
|
+
r !== null && (e.setToPath(n, "labels.shown", !0 !== r), e.setToPath(n, "shown", !0 !== r));
|
|
893
|
+
let i = e.getFromPath(n, "dispUnits.displayUnitsLabel");
|
|
894
|
+
i && (e.setToPath(n, "displayUnitsLabel", i), delete n.dispUnits);
|
|
895
|
+
let a = e.evaluate("title", t);
|
|
896
|
+
e.setToPath(n, "title.shown", a !== null);
|
|
897
|
+
let o = e.evaluate("minorGridlines", t);
|
|
898
|
+
e.setToPath(n, "gridLinesMinor.shown", o !== null);
|
|
899
|
+
let s = e.evaluate("majorGridlines", t);
|
|
900
|
+
e.setToPath(n, "gridLinesMajor.shown", s !== null);
|
|
901
|
+
}
|
|
902
|
+
}, X = L, he = class {
|
|
903
|
+
visit(e, t, n) {
|
|
904
|
+
let r = e.getVisitorParamsState().get("series"), i = e.getValAttrAsInteger("idx", t), a = i === null ? void 0 : r[i];
|
|
905
|
+
if (a) {
|
|
906
|
+
let n = e.getFromPath(a, "title");
|
|
907
|
+
n || (n = {}, e.setToPath(a, "title", n));
|
|
908
|
+
let r = n, i = e.getValAttrAsBoolean("delete", t);
|
|
909
|
+
return i !== null && (r.shown = !i), r;
|
|
910
|
+
}
|
|
911
|
+
return n;
|
|
912
|
+
}
|
|
913
|
+
}, ge = class {
|
|
914
|
+
visit(e, t, n) {
|
|
915
|
+
let r = {};
|
|
916
|
+
return E(e, t, r, "overlay", "overlay"), T(e, t, r, "legendPos", "position"), n.legend = r, r;
|
|
917
|
+
}
|
|
918
|
+
}, _e = class extends P {
|
|
919
|
+
visit(e, t, n) {
|
|
920
|
+
let r = this.getFill(e, t);
|
|
921
|
+
Object.keys(r).length > 0 && (n.fillNegative = r);
|
|
922
|
+
let i = this.getStroke(e, t);
|
|
923
|
+
return Object.keys(i).length > 0 && (n.strokeNegative = i), n;
|
|
924
|
+
}
|
|
925
|
+
}, Z = class extends L {
|
|
926
|
+
constructor(e = "title") {
|
|
927
|
+
super(e);
|
|
928
|
+
}
|
|
929
|
+
parseTitleRangeOrValue(e, t, n) {
|
|
930
|
+
let r = e.evaluate("tx/strRef/f", t) ?? null;
|
|
931
|
+
if (r) {
|
|
932
|
+
let t = r.firstElementChild.nodeValue;
|
|
933
|
+
e.setToPath(n, "range", t);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
visit(e, t, n) {
|
|
937
|
+
let r = {};
|
|
938
|
+
E(e, t, r, "overlay", "overlay"), n[this._jsonKey] = r;
|
|
939
|
+
let i = e.getFromPath(r, this.getTextPath());
|
|
940
|
+
i ||= {}, this.parseTitleRangeOrValue(e, t, r);
|
|
941
|
+
let a = e.evaluate("txPr", t);
|
|
942
|
+
a && this.parseTextElement(e, a, i, !1);
|
|
943
|
+
let o = e.evaluate("tx/rich", t);
|
|
944
|
+
return o && this.parseTextElement(e, o, i, !0), Object.keys(i).length > 0 && e.setToPath(r, "text", i), r;
|
|
945
|
+
}
|
|
946
|
+
afterVisit(e, t, n) {
|
|
947
|
+
if (n?.text) {
|
|
948
|
+
let e = n.text?.rotation ?? null;
|
|
949
|
+
e !== null && (n.rotation = parseInt(e), delete n.title.rotation);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}, ve = class {
|
|
953
|
+
visit(e, t, n) {
|
|
954
|
+
let r = e.evaluate("manualLayout", t);
|
|
955
|
+
if (r) {
|
|
956
|
+
let t = {};
|
|
957
|
+
O(e, r, t, "x", "x"), O(e, r, t, "y", "y"), O(e, r, t, "w", "w"), O(e, r, t, "h", "h"), T(e, r, t, "xMode", "xMode"), T(e, r, t, "yMode", "yMode"), T(e, r, t, "wMode", "wMode"), T(e, r, t, "hMode", "hMode"), Object.keys(t).length > 0 && (n.manualLayout = t);
|
|
958
|
+
}
|
|
959
|
+
return n;
|
|
960
|
+
}
|
|
961
|
+
}, ye = class {
|
|
962
|
+
visit(e, t, n) {
|
|
963
|
+
return n.name = t.getAttribute("name"), n;
|
|
964
|
+
}
|
|
965
|
+
}, be = class extends N {
|
|
966
|
+
visit(e, t, n) {
|
|
967
|
+
let r = {};
|
|
968
|
+
r.name = t.getAttribute("name");
|
|
969
|
+
let i = t.childNodes, a = i.length;
|
|
970
|
+
for (let n = 0; n < a; n++) {
|
|
971
|
+
let a = i.item(n);
|
|
972
|
+
if (a.nodeType === 1) {
|
|
973
|
+
let n = a.localName, i = e.evaluate(n, t);
|
|
974
|
+
r[n] = this.processAdjColor(e, i);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
return Object.keys(r).length > 0 && (n.colors = r), r;
|
|
978
|
+
}
|
|
979
|
+
}, xe = class {
|
|
980
|
+
visit(e, t, n) {
|
|
981
|
+
let r = {};
|
|
982
|
+
r.name = t.getAttribute("name");
|
|
983
|
+
let i = e.evaluate("majorFont", t), a = this.processFontElement(e, i, {});
|
|
984
|
+
a && (r.majorFont = a.family, a.fallbacks && (r.majorFallbacks = a.fallbacks));
|
|
985
|
+
let o = e.evaluate("minorFont", t), s = this.processFontElement(e, o, {});
|
|
986
|
+
return s && (r.minorFont = s.family, s.fallbacks && (r.minorFallbacks = s.fallbacks)), n.fonts = r, r;
|
|
987
|
+
}
|
|
988
|
+
processFontElement(e, t, n) {
|
|
989
|
+
if (!t) return;
|
|
990
|
+
let r = e.evaluate("latin", t);
|
|
991
|
+
if (!r) return;
|
|
992
|
+
let i = r.getAttribute("typeface");
|
|
993
|
+
i && (n.family = i);
|
|
994
|
+
let a = r.getAttribute("panose");
|
|
995
|
+
return a && (n.fallbacks = [_.getPanoseFallback(a)]), n;
|
|
996
|
+
}
|
|
997
|
+
}, Se = class extends N {
|
|
998
|
+
visit(e, t, n) {
|
|
999
|
+
let r = this.parseFillList(e, t, "fillStyleLst"), i = this.parseLnList(e, t, "lnStyleLst"), a = this.parseEffectStyleList(e, t, "effectStyleLst"), o = this.parseFillList(e, t, "bgFillStyleLst");
|
|
1000
|
+
if (r && i && a && o) return n.fillStyleLst = r, n.lnStyleLst = i, n.effectStyleLst = a, void (n.bgFillStyleLst = o);
|
|
1001
|
+
let s = e.serializeElement(t);
|
|
1002
|
+
s && (n.formatSchemeXml = s);
|
|
1003
|
+
}
|
|
1004
|
+
parseFillList(e, t, n) {
|
|
1005
|
+
let r = e.evaluate(n, t);
|
|
1006
|
+
if (!r) return;
|
|
1007
|
+
let i = [], a = r.childNodes, o = a.length;
|
|
1008
|
+
for (let t = 0; t < o; t++) {
|
|
1009
|
+
let n = a.item(t);
|
|
1010
|
+
if (n.nodeType !== 1) continue;
|
|
1011
|
+
let r = this.parseFillListItem(e, n);
|
|
1012
|
+
if (r === void 0) return;
|
|
1013
|
+
i.push(r);
|
|
1014
|
+
}
|
|
1015
|
+
return i;
|
|
1016
|
+
}
|
|
1017
|
+
parseFillListItem(e, t) {
|
|
1018
|
+
switch (t.localName) {
|
|
1019
|
+
case "noFill": return { type: g.Type.None };
|
|
1020
|
+
case "solidFill": {
|
|
1021
|
+
let n = this.processAdjColor(e, t);
|
|
1022
|
+
return n ? {
|
|
1023
|
+
type: g.Type.Solid,
|
|
1024
|
+
color: n
|
|
1025
|
+
} : void 0;
|
|
1026
|
+
}
|
|
1027
|
+
case "gradFill": return this.processGradFill(e, t);
|
|
1028
|
+
case "pattFill": return this.processPatternFill(e, t);
|
|
1029
|
+
default: return;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
parseLnList(e, t, n) {
|
|
1033
|
+
let r = e.evaluate(n, t);
|
|
1034
|
+
if (!r) return;
|
|
1035
|
+
let i = [], a = r.childNodes, o = a.length;
|
|
1036
|
+
for (let t = 0; t < o; t++) {
|
|
1037
|
+
let n = a.item(t);
|
|
1038
|
+
if (n.nodeType === 1) {
|
|
1039
|
+
if (e.evaluate("headEnd", n) || e.evaluate("tailEnd", n)) return;
|
|
1040
|
+
i.push(this.parseLn(e, n));
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
return i;
|
|
1044
|
+
}
|
|
1045
|
+
parseEffectStyleList(e, t, n) {
|
|
1046
|
+
let r = e.evaluate(n, t);
|
|
1047
|
+
if (!r) return;
|
|
1048
|
+
let i = [], a = r.childNodes, o = a.length;
|
|
1049
|
+
for (let t = 0; t < o; t++) {
|
|
1050
|
+
let n = a.item(t);
|
|
1051
|
+
if (n.nodeType !== 1) continue;
|
|
1052
|
+
if (e.evaluate("scene3d", n) || e.evaluate("sp3d", n)) return;
|
|
1053
|
+
let r = this.getEffects(e, n);
|
|
1054
|
+
if (r === void 0) return;
|
|
1055
|
+
i.push(r ?? []);
|
|
1056
|
+
}
|
|
1057
|
+
return i;
|
|
1058
|
+
}
|
|
1059
|
+
}, Ce = class {
|
|
1060
|
+
visit(e, t, n) {
|
|
1061
|
+
if (!t) return;
|
|
1062
|
+
let r = {}, i = t.getAttribute("r:id");
|
|
1063
|
+
if (i) {
|
|
1064
|
+
let t = e.getRef(i);
|
|
1065
|
+
typeof t == "string" && (r.address = t);
|
|
1066
|
+
}
|
|
1067
|
+
return e.copyFromAttribute(t, "tooltip", r, "screenTip"), e.copyFromAttribute(t, "history", r, "history", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tgtFrame", r, "target"), n.hyperlink = r, r;
|
|
1068
|
+
}
|
|
1069
|
+
}, we = class {
|
|
1070
|
+
visit(e, t, n) {
|
|
1071
|
+
if (!t) return;
|
|
1072
|
+
let r = {}, i = [];
|
|
1073
|
+
return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r), r;
|
|
1074
|
+
}
|
|
1075
|
+
processColorFilter(e, t) {
|
|
1076
|
+
let n = {}, r = {
|
|
1077
|
+
operator: m.BuiltInOperatorNames.Color,
|
|
1078
|
+
param: n
|
|
1079
|
+
};
|
|
1080
|
+
return e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY), e.copyFromAttribute(t, "dxfId", n, "styleId", e.INT_COPY), r;
|
|
1081
|
+
}
|
|
1082
|
+
processCustomFilter(e, t) {
|
|
1083
|
+
return {
|
|
1084
|
+
operator: t.getAttribute("operator"),
|
|
1085
|
+
param: t.getAttribute("val")
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
processCustomFilters(e, t) {
|
|
1089
|
+
let n = t.getAttribute("and"), r = n === "and" || n === "1";
|
|
1090
|
+
t.getAttribute("val");
|
|
1091
|
+
let i = [], a = {
|
|
1092
|
+
operator: r ? m.BuiltInOperatorNames.And : m.BuiltInOperatorNames.Or,
|
|
1093
|
+
param: i
|
|
1094
|
+
}, o = t.childNodes, s = o.length;
|
|
1095
|
+
for (let t = 0; t < s; t++) {
|
|
1096
|
+
let n = o.item(t);
|
|
1097
|
+
if (n.nodeType !== 1) continue;
|
|
1098
|
+
let r = null;
|
|
1099
|
+
n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
|
|
1100
|
+
}
|
|
1101
|
+
return a;
|
|
1102
|
+
}
|
|
1103
|
+
processDynamicFilter(e, t) {
|
|
1104
|
+
let n = {}, r = {
|
|
1105
|
+
operator: m.BuiltInOperatorNames.TimePeriod,
|
|
1106
|
+
param: n
|
|
1107
|
+
}, i = t.getAttribute("type");
|
|
1108
|
+
return i === "aboveAverage" ? i = m.AverageType.Above : i === "belowAverage" && (i = m.AverageType.Below), Object.values(m.AverageType).includes(i) ? (r.operator = m.BuiltInOperatorNames.Average, e.copyFromAttribute(t, "val", n, "stdDevs", e.INT_COPY)) : e.copyFromAttribute(t, "val", n, "anchorDate", e.INT_COPY), e.copyFromAttribute(t, "type", n, "operator"), e.copyFromAttribute(t, "maxVal", n, "maxVal", e.INT_COPY), r;
|
|
1109
|
+
}
|
|
1110
|
+
processDateGroupItem(e, t) {
|
|
1111
|
+
let n = {};
|
|
1112
|
+
return e.copyFromAttribute(t, "dateTimeGrouping", n, "group"), e.copyFromAttribute(t, "day", n, "day", e.INT_COPY), e.copyFromAttribute(t, "hour", n, "hour", e.INT_COPY), e.copyFromAttribute(t, "minute", n, "minute", e.INT_COPY), e.copyFromAttribute(t, "month", n, "month", e.INT_COPY), e.copyFromAttribute(t, "second", n, "second", e.INT_COPY), e.copyFromAttribute(t, "year", n, "year", e.INT_COPY), n;
|
|
1113
|
+
}
|
|
1114
|
+
processFilterItem(e, t) {
|
|
1115
|
+
if (t.hasAttribute("val")) return t.getAttribute("val");
|
|
1116
|
+
}
|
|
1117
|
+
processFilters(e, t) {
|
|
1118
|
+
let n = {}, r = {
|
|
1119
|
+
operator: m.BuiltInOperatorNames.InSet,
|
|
1120
|
+
param: n
|
|
1121
|
+
};
|
|
1122
|
+
e.copyFromAttribute(t, "blank", r, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", r, "calendarType");
|
|
1123
|
+
let i = [], a = [], o = t.childNodes, s = o.length;
|
|
1124
|
+
for (let t = 0; t < s; t++) {
|
|
1125
|
+
let n = o.item(t);
|
|
1126
|
+
if (n.nodeType === 1) {
|
|
1127
|
+
if (n.localName === "dateGroupItem") {
|
|
1128
|
+
let t = this.processDateGroupItem(e, n);
|
|
1129
|
+
t && i.push(t);
|
|
1130
|
+
} else if (n.localName === "filter") {
|
|
1131
|
+
let t = this.processFilterItem(e, n);
|
|
1132
|
+
t !== void 0 && a.push(t);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
return i.length > 0 && (n.dateGroups = i), a.length > 0 && (n.items = a), r;
|
|
1137
|
+
}
|
|
1138
|
+
processIcon(e, t) {
|
|
1139
|
+
let n = {}, r = {
|
|
1140
|
+
operator: m.BuiltInOperatorNames.Icon,
|
|
1141
|
+
param: n
|
|
1142
|
+
};
|
|
1143
|
+
return e.copyFromAttribute(t, "iconId", n, "iconId", e.INT_COPY), e.copyFromAttribute(t, "iconSet", n), r;
|
|
1144
|
+
}
|
|
1145
|
+
processTop10(e, t) {
|
|
1146
|
+
let n = {}, r = {
|
|
1147
|
+
operator: m.BuiltInOperatorNames.TopN,
|
|
1148
|
+
param: n
|
|
1149
|
+
};
|
|
1150
|
+
return e.copyFromAttribute(t, "filterVal", n, "filterVal", e.FLOAT_COPY), e.copyFromAttribute(t, "percent", n, "percent", e.BOOLEAN_COPY), e.copyFromAttribute(t, "top", n, "top", e.BOOLEAN_COPY), e.copyFromAttribute(t, "val", n, "val", e.FLOAT_COPY), r;
|
|
1151
|
+
}
|
|
1152
|
+
processFilterCriteria(e, t) {
|
|
1153
|
+
if (!t) return;
|
|
1154
|
+
let n = t.childNodes, r, i = n.length;
|
|
1155
|
+
for (let t = 0; t < i; t++) {
|
|
1156
|
+
let i = n.item(t);
|
|
1157
|
+
i.nodeType === 1 && (i.localName === "colorFilter" ? r = this.processColorFilter(e, i) : i.localName === "customFilters" ? r = this.processCustomFilters(e, i) : i.localName === "dynamicFilter" ? r = this.processDynamicFilter(e, i) : i.localName === "filters" ? r = this.processFilters(e, i) : i.localName === "iconFilter" ? r = this.processIcon(e, i) : i.localName === "top10" && (r = this.processTop10(e, i)));
|
|
1158
|
+
}
|
|
1159
|
+
return r;
|
|
1160
|
+
}
|
|
1161
|
+
processFilterColumn(e, t, n) {
|
|
1162
|
+
if (!t) return null;
|
|
1163
|
+
if (!t.hasAttribute("colId")) return;
|
|
1164
|
+
let r = parseInt(t.getAttribute("colId")), i = !1;
|
|
1165
|
+
if (t.hasAttribute("hiddenButton") && (i = c(t.getAttribute("hiddenButton"))), i && n) {
|
|
1166
|
+
let e = n.hiddenButtons;
|
|
1167
|
+
e || (e = [], n.hiddenButtons = e), e.push(r);
|
|
1168
|
+
}
|
|
1169
|
+
let a = !1;
|
|
1170
|
+
if (t.hasAttribute("showButton") && (a = c(t.getAttribute("showButton"))), a && n) {
|
|
1171
|
+
let e = n.showButtons;
|
|
1172
|
+
!0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
|
|
1173
|
+
}
|
|
1174
|
+
let o = this.processFilterCriteria(e, t);
|
|
1175
|
+
return o ? (o.index = r, o) : null;
|
|
1176
|
+
}
|
|
1177
|
+
processFilterColumns(e, t, n, r) {
|
|
1178
|
+
if (!t) return;
|
|
1179
|
+
let i = t.childNodes, a = i.length;
|
|
1180
|
+
for (let t = 0; t < a; t++) {
|
|
1181
|
+
let a = i.item(t);
|
|
1182
|
+
if (a.nodeType === 1 && a.localName === "filterColumn") {
|
|
1183
|
+
let t = this.processFilterColumn(e, a, r);
|
|
1184
|
+
t && n.push(t);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return n;
|
|
1188
|
+
}
|
|
1189
|
+
}, Te = class {
|
|
1190
|
+
visit(e, t, n) {
|
|
1191
|
+
if (!t) return;
|
|
1192
|
+
let r = t.getAttribute("ref"), i = {};
|
|
1193
|
+
t.hasAttribute("caseSensitive") && (i.collatorOptions = c(t.getAttribute("caseSensitive")) ? x.CaseSensitiveOptions : x.CaseInsensitiveOptions);
|
|
1194
|
+
let a = t.getAttribute("sortMethod");
|
|
1195
|
+
a != null && a !== "none" && (a === "stroke" ? i.collatorOptions = {
|
|
1196
|
+
...i.collatorOptions,
|
|
1197
|
+
collation: "stroke"
|
|
1198
|
+
} : a === "pinYin" && (i.collatorOptions = {
|
|
1199
|
+
...i.collatorOptions,
|
|
1200
|
+
collation: "pinyin"
|
|
1201
|
+
}));
|
|
1202
|
+
let o = {};
|
|
1203
|
+
t.hasAttribute("columnSort") && c(t.getAttribute("columnSort")) && (o.axis = v.Axis.Column);
|
|
1204
|
+
let s = d.fastStringToRange(r), l = [];
|
|
1205
|
+
return this.processSortConditions(e, t, l, s, i), l.length > 0 && (o.sorts = l), Object.keys(l).length > 0 && (n.sort = o), o;
|
|
1206
|
+
}
|
|
1207
|
+
processSortCondition(e, t, n, r) {
|
|
1208
|
+
if (!t) return null;
|
|
1209
|
+
let i = {};
|
|
1210
|
+
if (!t.hasAttribute("ref")) return void console.warn("no ref for sort conditional", e.getPath());
|
|
1211
|
+
if (t.hasAttribute("ref")) {
|
|
1212
|
+
let e = t.getAttribute("ref"), r = d.fastStringToRange(e);
|
|
1213
|
+
i.index = n ? r.colStart - n.colStart : r.colStart;
|
|
1214
|
+
}
|
|
1215
|
+
let a = { ...r };
|
|
1216
|
+
return i.criteria = a, a.reverse = !1, t.hasAttribute("descending") && (a.reverse = c(t.getAttribute("descending"))), e.copyFromAttribute(t, "sortBy", a, "sortOn"), e.copyFromAttribute(t, "dxfId", a), e.copyFromAttribute(t, "iconSet", a), e.copyFromAttribute(t, "customList", a), i;
|
|
1217
|
+
}
|
|
1218
|
+
processSortConditions(e, t, n, r, i) {
|
|
1219
|
+
if (!t) return;
|
|
1220
|
+
let a = t.childNodes, o = a.length;
|
|
1221
|
+
for (let t = 0; t < o; t++) {
|
|
1222
|
+
let o = a.item(t);
|
|
1223
|
+
if (o.nodeType === 1 && o.localName === "sortCondition") {
|
|
1224
|
+
let t = this.processSortCondition(e, o, r, i);
|
|
1225
|
+
t && n.push(t);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}, Ee = class extends R {
|
|
1230
|
+
visit(e, t, n) {
|
|
1231
|
+
this.processNumFmts(e, e.evaluate("numFmts", t), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1232
|
+
let r = {
|
|
1233
|
+
fills: {},
|
|
1234
|
+
fonts: {},
|
|
1235
|
+
borders: {}
|
|
1236
|
+
};
|
|
1237
|
+
this.processFonts(e, e.evaluate("fonts", t), r.fonts), this.processFills(e, e.evaluate("fills", t), r.fills), this.processBorders(e, e.evaluate("borders", t), r.borders, !0), r.fills[0] = { type: g.Type.None }, r.fills[1] = {
|
|
1238
|
+
type: g.Type.Pattern,
|
|
1239
|
+
patternType: g.BuiltInSheetPattern.Gray125
|
|
1240
|
+
}, r.borders[0] = {
|
|
1241
|
+
bottom: { style: p.StrokeStyle.None },
|
|
1242
|
+
left: { style: p.StrokeStyle.None },
|
|
1243
|
+
right: { style: p.StrokeStyle.None },
|
|
1244
|
+
top: { style: p.StrokeStyle.None }
|
|
1245
|
+
};
|
|
1246
|
+
let i = [];
|
|
1247
|
+
this.processXFs(e, e.evaluate("cellStyleXfs", t), i, r, null, !1);
|
|
1248
|
+
let a = /* @__PURE__ */ new Map();
|
|
1249
|
+
if (i.length > 0) {
|
|
1250
|
+
let r = [];
|
|
1251
|
+
this.processCellStyles(e, e.evaluate("cellStyles", t), r, i, a), n.named = r;
|
|
1252
|
+
}
|
|
1253
|
+
let o = [];
|
|
1254
|
+
this.processXFs(e, e.evaluate("cellXfs", t), o, r, a), Object.keys(o).length > 0 && (n.direct = o);
|
|
1255
|
+
let s = [];
|
|
1256
|
+
return this.processDXFs(e, e.evaluate("dxfs", t), s), this.processTableStyles(e, e.evaluate("tableStyles", t), n, s), this.processIndexColors(e, e.evaluate("colors/indexedColors", t), n), this.processMruColors(e, e.evaluate("colors/mruColors", t), n), n;
|
|
1257
|
+
}
|
|
1258
|
+
processIndexColors(e, t, n) {
|
|
1259
|
+
if (!t) return;
|
|
1260
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
1261
|
+
for (let t = 0; t < a; t++) {
|
|
1262
|
+
let n = i.item(t);
|
|
1263
|
+
if (n.nodeType === 1 && n.localName === "rgbColor") {
|
|
1264
|
+
let t = { color: null };
|
|
1265
|
+
this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
n.indexedColors = r;
|
|
1269
|
+
}
|
|
1270
|
+
processMruColors(e, t, n) {
|
|
1271
|
+
if (!t) return;
|
|
1272
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
1273
|
+
for (let t = 0; t < a; t++) {
|
|
1274
|
+
let n = i.item(t);
|
|
1275
|
+
if (n.nodeType === 1 && n.localName === "color") {
|
|
1276
|
+
let t = { color: null };
|
|
1277
|
+
this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
r.length > 0 && (n.mruColors = r);
|
|
1281
|
+
}
|
|
1282
|
+
processNumFmts(e, t, n) {
|
|
1283
|
+
if (!t) return;
|
|
1284
|
+
let r = /* @__PURE__ */ new Map();
|
|
1285
|
+
if (e.getVisitorParamsState().set("numFmts", r), !t) return;
|
|
1286
|
+
let i = t.childNodes, a = i.length;
|
|
1287
|
+
for (let e = 0; e < a; e++) {
|
|
1288
|
+
let t = i.item(e);
|
|
1289
|
+
if (t.nodeType === 1 && t.localName === "numFmt") {
|
|
1290
|
+
let e = t.getAttribute("numFmtId"), n = t.getAttribute("formatCode");
|
|
1291
|
+
if (e && n) {
|
|
1292
|
+
let t = n;
|
|
1293
|
+
r.set(parseInt(e), t);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
processXFs(e, t, n, r, i = null, a = !0) {
|
|
1299
|
+
if (!t) return;
|
|
1300
|
+
let o = t.childNodes, s = o.length;
|
|
1301
|
+
for (let t = 0; t < s; t++) {
|
|
1302
|
+
let s = o.item(t);
|
|
1303
|
+
if (s.nodeType === 1 && s.localName === "xf") {
|
|
1304
|
+
let t = {};
|
|
1305
|
+
this.processXF(e, s, t, r, i, a), n.push(t);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
processXF(e, t, n, r, i, a) {
|
|
1310
|
+
if (!t) return;
|
|
1311
|
+
let o = t.getAttribute("xfId");
|
|
1312
|
+
if (o && i) {
|
|
1313
|
+
let e = i.get(parseInt(o));
|
|
1314
|
+
e && e !== y.BuiltInName.Normal && (n.named = e);
|
|
1315
|
+
}
|
|
1316
|
+
let s = (e) => !(!a && t.hasAttribute(e)) || c(t.getAttribute(e)), l = (e) => !a || t.hasAttribute(e) && c(t.getAttribute(e)), u = a ? "0" : void 0;
|
|
1317
|
+
if (s("applyFont")) {
|
|
1318
|
+
let e = t.getAttribute("fontId") ?? u;
|
|
1319
|
+
if (e !== void 0 && (e !== "0" || l("applyFont"))) {
|
|
1320
|
+
let t = r.fonts[e];
|
|
1321
|
+
t !== void 0 && (n.font = t);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
if (s("applyFill")) {
|
|
1325
|
+
let e = t.getAttribute("fillId") ?? u;
|
|
1326
|
+
if (e !== void 0 && (e !== "0" || l("applyFill"))) {
|
|
1327
|
+
let t = r.fills[e];
|
|
1328
|
+
t !== void 0 && Object.keys(t).length > 0 && (n.fill = t);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
if (s("applyBorder")) {
|
|
1332
|
+
let e = t.getAttribute("borderId") ?? u;
|
|
1333
|
+
if (e !== void 0 && (e !== "0" || l("applyBorder"))) {
|
|
1334
|
+
let t = r.borders[e];
|
|
1335
|
+
t !== void 0 && (n.border = t);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
if (s("applyNumberFormat")) {
|
|
1339
|
+
let r = t.getAttribute("numFmtId") ?? u;
|
|
1340
|
+
if (r !== void 0 && (r !== "0" || l("applyNumberFormat"))) {
|
|
1341
|
+
let t = parseInt(r), i, a = e.getVisitorParamsState();
|
|
1342
|
+
if (a) {
|
|
1343
|
+
let e = a.get("numFmts");
|
|
1344
|
+
e && (i = e.get(t)), n.numberFormat = i ?? t;
|
|
1345
|
+
} else console.warn("no visitor params state");
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
if (s("applyAlignment")) {
|
|
1349
|
+
let r = e.evaluate("alignment", t);
|
|
1350
|
+
(r || l("applyAlignment")) && this.processAlignment(e, r, n);
|
|
1351
|
+
}
|
|
1352
|
+
if (s("applyProtection")) {
|
|
1353
|
+
let r = e.evaluate("protection", t);
|
|
1354
|
+
(r || l("applyProtection")) && this.processProtection(e, r, n);
|
|
1355
|
+
}
|
|
1356
|
+
let d = c(t.getAttribute("quotePrefix") ?? "");
|
|
1357
|
+
d && (n.quotePrefix = d);
|
|
1358
|
+
}
|
|
1359
|
+
processAlignment(e, t, n) {
|
|
1360
|
+
let r = {};
|
|
1361
|
+
if (t?.hasAttribute("horizontal") ? r.horizontal = t.getAttribute("horizontal") : r.horizontal = b.HorizontalAlignment.General, t?.hasAttribute("vertical") ? r.vertical = t.getAttribute("vertical") : r.vertical = b.VerticalAlignment.Bottom, t?.hasAttribute("indent") ? r.indent = parseInt(t.getAttribute("indent")) : r.indent = 0, t?.hasAttribute("relativeIndent") ? r.relativeIndent = parseInt(t.getAttribute("relativeIndent")) : r.relativeIndent = 0, c(t?.getAttribute("wrapText") ?? "") ? r.overflow = b.Overflow.Wrap : r.overflow = b.Overflow.Visible, c(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = b.Overflow.Shrink), t?.hasAttribute("textRotation")) {
|
|
1362
|
+
let e = parseFloat(t.getAttribute("textRotation"));
|
|
1363
|
+
e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
|
|
1364
|
+
} else r.rotation = 0;
|
|
1365
|
+
t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = c(t.getAttribute("justifyLastLine")));
|
|
1366
|
+
let i = t?.getAttribute("readingOrder");
|
|
1367
|
+
return i && (i === "0" ? r.readingDirection = b.ReadingDirection.Auto : i === "1" ? r.readingDirection = b.ReadingDirection.LeftToRight : i === "2" ? r.readingDirection = b.ReadingDirection.RightToLeft : console.warn(`invalid readingOrder: ${i}`)), Object.keys(r).length > 0 && (n.alignment = r), n;
|
|
1368
|
+
}
|
|
1369
|
+
processProtection(e, t, n) {
|
|
1370
|
+
if (!t) return;
|
|
1371
|
+
let r = {}, i = t.getAttribute("locked");
|
|
1372
|
+
i && !c(i) && (r.edit = !0);
|
|
1373
|
+
let a = t.getAttribute("hidden");
|
|
1374
|
+
return a && c(a) && (r.formulaHidden = !0), Object.keys(r).length > 0 && (n.protection = r), n;
|
|
1375
|
+
}
|
|
1376
|
+
processDXF(e, t, n) {
|
|
1377
|
+
if (!t) return;
|
|
1378
|
+
let r = t.childNodes, i = r.length;
|
|
1379
|
+
for (let t = 0; t < i; t++) {
|
|
1380
|
+
let i = r.item(t);
|
|
1381
|
+
if (i.nodeType === 1 && i.localName === "font") {
|
|
1382
|
+
let t = {};
|
|
1383
|
+
this.processFont(e, i, t), n.font = t;
|
|
1384
|
+
} else if (i.nodeType === 1 && i.localName === "fill") {
|
|
1385
|
+
let t = [];
|
|
1386
|
+
this.processFill(e, i, t, 0), t.length > 0 && t[0] && (n.fill = t[0]);
|
|
1387
|
+
} else if (i.nodeType === 1 && i.localName === "border") {
|
|
1388
|
+
let t = [];
|
|
1389
|
+
this.processBorder(e, i, t, 0, !1), t.length > 0 && t[0] && (n.border = t[0]);
|
|
1390
|
+
} else if (i.nodeType === 1 && i.localName === "numFmt") {
|
|
1391
|
+
let e = i.getAttribute("formatCode");
|
|
1392
|
+
if (e) n.numberFormat = e;
|
|
1393
|
+
else {
|
|
1394
|
+
let e = i.getAttribute("numFmtId");
|
|
1395
|
+
e && (n.numberFormat = Number(e));
|
|
1396
|
+
}
|
|
1397
|
+
} else i.nodeType === 1 && i.localName === "alignment" && this.processAlignment(e, i, n);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
processDXFs(e, t, n) {
|
|
1401
|
+
if (!t) return;
|
|
1402
|
+
e.getVisitorParamsState().set("processingDXFs", !0);
|
|
1403
|
+
let r = /* @__PURE__ */ new Map();
|
|
1404
|
+
e.getVisitorParamsState().set("dxfs", r);
|
|
1405
|
+
let i = t.childNodes, a = i.length;
|
|
1406
|
+
for (let t = 0; t < a; t++) {
|
|
1407
|
+
let a = i.item(t);
|
|
1408
|
+
if (a.nodeType === 1 && a.localName === "dxf") {
|
|
1409
|
+
let t = {};
|
|
1410
|
+
this.processDXF(e, a, t);
|
|
1411
|
+
let i = n.length;
|
|
1412
|
+
r.set(i, t), n.push(t);
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
e.getVisitorParamsState().delete("processingDXFs");
|
|
1416
|
+
}
|
|
1417
|
+
processTableStyle(e, t, n, r, i = !1) {
|
|
1418
|
+
let a = t.getAttribute("name"), o = { name: a };
|
|
1419
|
+
t.hasAttribute("table") && (o.table = c(t.getAttribute("table"))), t.hasAttribute("pivot") && (o.pivot = c(t.getAttribute("pivot"))), i && !o.pivot && r.unshift(null);
|
|
1420
|
+
let s = t.childNodes, l = s.length;
|
|
1421
|
+
for (let e = 0; e < l; e++) {
|
|
1422
|
+
let t = s.item(e);
|
|
1423
|
+
if (t.nodeType === 1 && t.localName === "tableStyleElement") {
|
|
1424
|
+
let e = t.getAttribute("type"), n = t.getAttribute("dxfId"), i = n == null ? void 0 : r?.[n];
|
|
1425
|
+
i ||= (console.warn("invalid dfx id", n), {}), o[e] = i;
|
|
1426
|
+
let a = null;
|
|
1427
|
+
t.hasAttribute("size") && (a = parseInt(t.getAttribute("size"))), a && !isNaN(a) && (i.size = a);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
delete o.name, n[a] = o;
|
|
1431
|
+
}
|
|
1432
|
+
processTableStyles(e, t, n, r, i) {
|
|
1433
|
+
if (!t) return;
|
|
1434
|
+
let a = {}, o = t.getAttribute("defaultTableStyle");
|
|
1435
|
+
o && (a.defaultTableStyle = o);
|
|
1436
|
+
let s = t.getAttribute("defaultPivotStyle");
|
|
1437
|
+
s && (a.defaultPivotStyle = s);
|
|
1438
|
+
let c = t.childNodes, l = {}, u = c.length;
|
|
1439
|
+
for (let t = 0; t < u; t++) {
|
|
1440
|
+
let n = c.item(t);
|
|
1441
|
+
n.nodeType === 1 && n.localName === "tableStyle" && this.processTableStyle(e, n, l, r, i);
|
|
1442
|
+
}
|
|
1443
|
+
return Object.keys(l).length > 0 && (a.styles = l), Object.keys(a).length > 0 && (n.tables = a), n;
|
|
1444
|
+
}
|
|
1445
|
+
processCellStyles(e, t, n, r, i) {
|
|
1446
|
+
if (!t) return;
|
|
1447
|
+
let a = t.childNodes, o = a.length;
|
|
1448
|
+
for (let e = 0; e < o; e++) {
|
|
1449
|
+
let t = a.item(e);
|
|
1450
|
+
if (t.nodeType === 1 && t.localName === "cellStyle") {
|
|
1451
|
+
let e = parseInt(t.getAttribute("xfId") ?? ""), a = t.getAttribute("name"), o = t.getAttribute("builtinId"), s = a;
|
|
1452
|
+
if (o !== null) {
|
|
1453
|
+
let e = y.builtInNameFromId(parseInt(o));
|
|
1454
|
+
e !== void 0 && (s = e);
|
|
1455
|
+
}
|
|
1456
|
+
if (i.set(e, s), !r[e]) continue;
|
|
1457
|
+
let l = {
|
|
1458
|
+
name: s,
|
|
1459
|
+
style: r[e]
|
|
1460
|
+
};
|
|
1461
|
+
t.getAttribute("hidden") && (l.hidden = c(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (l.iLevel = parseInt(t.getAttribute("iLevel"))), n.push(l);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
afterVisit(e, t, n) {}
|
|
1466
|
+
}, De = class extends R {
|
|
1467
|
+
visit(e, t, n) {
|
|
1468
|
+
return this.processSheetRefs(e, e.evaluate("sheets", t), n), this.processExternalReferences(e, e.evaluate("externalReferences", t), n), this.processBookViews(e, e.evaluate("bookViews", t), n), this.processDefinedNames(e, e.evaluate("definedNames", t), n), this.processCalcPr(e, e.evaluate("calcPr", t), n), this.processWorkbookProtection(e, e.evaluate("workbookProtection", t), n), this.processWorkbookPr(e, e.evaluate("workbookPr", t), n), n;
|
|
1469
|
+
}
|
|
1470
|
+
processPassword(e, t, n, r = "workbook", i = "password") {
|
|
1471
|
+
if (!t) return;
|
|
1472
|
+
let a = {};
|
|
1473
|
+
e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), Object.keys(a).length > 0 && (n[i] = a);
|
|
1474
|
+
}
|
|
1475
|
+
processWorkbookProtection(e, t, n) {
|
|
1476
|
+
if (!t) return;
|
|
1477
|
+
let r = {};
|
|
1478
|
+
return this.processPassword(e, t, r, "workbook", "password"), this.processPassword(e, t, r, "revisions", "revisionsPassword"), e.copyFromAttribute(t, "lockStructure", r, "structure", e.BOOLEAN_COPY), e.copyFromAttribute(t, "lockWindows", r, "windows", e.BOOLEAN_COPY), e.copyFromAttribute(t, "lockRevision", r, "revision", e.BOOLEAN_COPY), n.protection = r, n;
|
|
1479
|
+
}
|
|
1480
|
+
processCalcPr(e, t, n) {
|
|
1481
|
+
t && (n.calc = {});
|
|
1482
|
+
}
|
|
1483
|
+
processSheetRefs(e, t, n) {
|
|
1484
|
+
if (!t) return;
|
|
1485
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
1486
|
+
for (let t = 0; t < a; t++) {
|
|
1487
|
+
let n = i.item(t);
|
|
1488
|
+
n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(e, n, r);
|
|
1489
|
+
}
|
|
1490
|
+
n.sheets = r;
|
|
1491
|
+
}
|
|
1492
|
+
processSheetRef(e, t, n) {
|
|
1493
|
+
let r = {};
|
|
1494
|
+
e.copyFromAttribute(t, "name", r, "name"), e.copyFromAttribute(t, "state", r, "visibility");
|
|
1495
|
+
let i = t.getAttribute("r:id"), a = e.getRef(i);
|
|
1496
|
+
a && (r.sheet = a), n.push(r);
|
|
1497
|
+
}
|
|
1498
|
+
processExternalReferences(e, t, n) {
|
|
1499
|
+
if (!t) return;
|
|
1500
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
1501
|
+
for (let t = 0; t < a; t++) {
|
|
1502
|
+
let n = i.item(t);
|
|
1503
|
+
if (n.nodeType === 1 && n.localName === "externalReference") {
|
|
1504
|
+
let t = n.getAttribute("r:id"), i = t ? e.getRef(t) : null;
|
|
1505
|
+
r.push(i ?? null);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
r.length > 0 && (n.externalBooks = r);
|
|
1509
|
+
}
|
|
1510
|
+
processBookViews(e, t, n) {
|
|
1511
|
+
if (!t) return;
|
|
1512
|
+
let r = t.childNodes, i = 0, a = r.length;
|
|
1513
|
+
for (let t = 0; i < 1 && t < a; t++) {
|
|
1514
|
+
let a = r.item(t);
|
|
1515
|
+
a.nodeType === 1 && a.localName === "workbookView" && (this.processWorkbookView(e, a, n), i++);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
processWorkbookView(e, t, n) {
|
|
1519
|
+
if (!t) return;
|
|
1520
|
+
let r = {};
|
|
1521
|
+
e.copyFromAttribute(t, "activeTab", r, "activeSheetId", [e.INT_COPY, (e) => e]), t.hasAttribute("activeTab") || (r.activeSheetId = 0), e.copyFromAttribute(t, "showHorizontalScroll", r, "showHorizontalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showVerticalScroll", r, "showVerticalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showSheetTabs", r, "showTabs", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tabRatio", r, "tabRatio", [e.FLOAT_COPY, (e) => e]), Object.keys(r).length > 0 && (n.view = r);
|
|
1522
|
+
}
|
|
1523
|
+
processDefineName(e, t, n, r) {
|
|
1524
|
+
if (!t) return;
|
|
1525
|
+
let i = {}, a = t.firstChild;
|
|
1526
|
+
if (a && a.nodeType === 3 && (i.ref = a.textContent), e.copyFromAttribute(t, "name", i), e.copyFromAttribute(t, "comment", i), e.copyFromAttribute(t, "hidden", i, "hidden", e.BOOLEAN_COPY), t.hasAttribute("localSheetId")) {
|
|
1527
|
+
let e = t.getAttribute("localSheetId");
|
|
1528
|
+
if (!r[e]?.name) return void console.warn(`Defined name '${t.getAttribute("name")}' references a sheet with localSheetId '${e}' which does not exist.`);
|
|
1529
|
+
i.scope = r[e].name;
|
|
1530
|
+
}
|
|
1531
|
+
e.copyFromAttribute(t, "customMenu", i), e.copyFromAttribute(t, "description", i), e.copyFromAttribute(t, "statusBar", i), e.copyFromAttribute(t, "help", i), e.copyFromAttribute(t, "shortcutKey", i), e.copyFromAttribute(t, "function", i, "function", e.BOOLEAN_COPY), e.copyFromAttribute(t, "functionGroupId", i, "functionGroupId", e.INT_COPY), e.copyFromAttribute(t, "publishToServer", i, "publishToServer", e.BOOLEAN_COPY), e.copyFromAttribute(t, "vbProcedure", i, "vbProcedure", e.BOOLEAN_COPY), e.copyFromAttribute(t, "xlm", i, "xlm", e.BOOLEAN_COPY), Object.keys(i).length > 0 && n.push(i);
|
|
1532
|
+
}
|
|
1533
|
+
processDefinedNames(e, t, n) {
|
|
1534
|
+
if (!t) return;
|
|
1535
|
+
let r = [], i = t.childNodes, a = i.length;
|
|
1536
|
+
for (let t = 0; t < a; t++) {
|
|
1537
|
+
let a = i.item(t);
|
|
1538
|
+
a.nodeType === 1 && a.localName === "definedName" && this.processDefineName(e, a, r, n.sheets);
|
|
1539
|
+
}
|
|
1540
|
+
r.length > 0 && (n.names = r);
|
|
1541
|
+
}
|
|
1542
|
+
processWorkbookPr(e, t, n) {
|
|
1543
|
+
t && e.copyFromAttribute(t, "date1904", n, "date1904", e.BOOLEAN_COPY);
|
|
1544
|
+
}
|
|
1545
|
+
afterVisit(e, t, n) {}
|
|
1546
|
+
}, Oe = class {
|
|
1547
|
+
visit(e, t, n) {
|
|
1548
|
+
let r = {};
|
|
1549
|
+
return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), e.copyFromAttribute(t, "totalsRowShown", r, "totalsRowShown", e.BOOLEAN_COPY), r;
|
|
1550
|
+
}
|
|
1551
|
+
afterVisit(e, t, n) {
|
|
1552
|
+
let r = n.v;
|
|
1553
|
+
if (e.evaluate("autoFilter", t)) {
|
|
1554
|
+
if (Array.isArray(r.hiddenButtons)) {
|
|
1555
|
+
let e = r.hiddenButtons.length;
|
|
1556
|
+
e === 0 ? r.hiddenButtons = !1 : e === r.columns?.length && (r.hiddenButtons = !0);
|
|
1557
|
+
}
|
|
1558
|
+
} else r.hiddenButtons = !0, r.showButtons = !1;
|
|
1559
|
+
return r;
|
|
1560
|
+
}
|
|
1561
|
+
processTableStyleInfo(e, t, n) {
|
|
1562
|
+
if (!t) return;
|
|
1563
|
+
let r = t.childNodes, i = {}, a = r.length;
|
|
1564
|
+
for (let t = 0; t < a; t++) {
|
|
1565
|
+
let n = r.item(t);
|
|
1566
|
+
n.nodeType === 1 && n.localName === "tableStyleInfo" && (e.copyFromAttribute(n, "name", i), e.copyFromAttribute(n, "showColumnStripes", i, "showColumnStripes", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showFirstColumn", i, "showFirstColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showLastColumn", i, "showLastColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showRowStripes", i, "showRowStripes", e.BOOLEAN_COPY));
|
|
1567
|
+
}
|
|
1568
|
+
Object.keys(i).length > 0 && (n.style = i);
|
|
1569
|
+
}
|
|
1570
|
+
processTableColumn(e, t, n) {
|
|
1571
|
+
if (!t) return null;
|
|
1572
|
+
let r = t.childNodes, i = r.length;
|
|
1573
|
+
for (let t = 0; t < i; t++) {
|
|
1574
|
+
let i = r.item(t);
|
|
1575
|
+
if (i.nodeType === 1 && i.localName === "tableColumn") {
|
|
1576
|
+
let t = {};
|
|
1577
|
+
e.copyFromAttribute(i, "name", t), e.copyFromAttribute(i, "id", t), e.copyFromAttribute(i, "uniqueName", t), e.copyFromAttribute(i, "queryTableFieldId", t), e.copyFromAttribute(i, "totalsRowLabel", t);
|
|
1578
|
+
let r = i.getAttribute("totalsRowFunction");
|
|
1579
|
+
if (r !== null) if (r === "custom") {
|
|
1580
|
+
let n = e.evaluate("totalsRowFormula", i);
|
|
1581
|
+
n && (t.totalsRowFormula = n.textContent);
|
|
1582
|
+
} else t.totalsRowFormula = r;
|
|
1583
|
+
e.copyFromAttribute(i, "totalsRowLabel", t), n.push(t);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
return n;
|
|
1587
|
+
}
|
|
1588
|
+
processTableColumns(e, t, n) {
|
|
1589
|
+
let r = t.childNodes, i = [], a = r.length;
|
|
1590
|
+
for (let t = 0; t < a; t++) {
|
|
1591
|
+
let n = r.item(t);
|
|
1592
|
+
n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(e, n, i);
|
|
1593
|
+
}
|
|
1594
|
+
i.length > 0 && (n.columns = i);
|
|
1595
|
+
}
|
|
1596
|
+
}, ke = class {
|
|
1597
|
+
visit(e, t, n) {
|
|
1598
|
+
let r = e.getVisitorParamsState().get("ref");
|
|
1599
|
+
if (r) {
|
|
1600
|
+
let n = e.getVisitorParamsState().get("descriptions");
|
|
1601
|
+
n && (n.add(r, t.getAttribute("altText")), n.add(r, t.getAttribute("altTextSummary")));
|
|
1602
|
+
}
|
|
1603
|
+
return e.copyFromAttribute(t, "altText", n), e.copyFromAttribute(t, "altTextSummary", n), n;
|
|
1604
|
+
}
|
|
1605
|
+
}, Ae = class {
|
|
1606
|
+
visit(e, t, n) {
|
|
1607
|
+
let r = t.childNodes, i = r.length, a = null;
|
|
1608
|
+
for (let e = 0; e < i; e++) {
|
|
1609
|
+
let t = r.item(e);
|
|
1610
|
+
if (t.nodeType === 1) {
|
|
1611
|
+
t.localName === "externalBook" && (a = t);
|
|
1612
|
+
break;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
return a ? (t.getAttribute("mc:Ignorable") && (n.mceIgnorable = !0), n.sheetNames = [], this.processSheetNames(e, a, n), this.processDefinedNames(e, a, n), this.processSheetDataSet(e, a, n), n) : n;
|
|
1616
|
+
}
|
|
1617
|
+
processSheetNames(e, t, n) {
|
|
1618
|
+
let r = this._findChild(t, "sheetNames");
|
|
1619
|
+
if (!r) return;
|
|
1620
|
+
let i = r.childNodes, a = i.length;
|
|
1621
|
+
for (let e = 0; e < a; e++) {
|
|
1622
|
+
let t = i.item(e);
|
|
1623
|
+
t.nodeType === 1 && t.localName === "sheetName" && n.sheetNames.push(t.getAttribute("val") ?? "");
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
processDefinedNames(e, t, n) {
|
|
1627
|
+
let r = this._findChild(t, "definedNames");
|
|
1628
|
+
if (!r) return;
|
|
1629
|
+
let i = [], a = r.childNodes, o = a.length;
|
|
1630
|
+
for (let e = 0; e < o; e++) {
|
|
1631
|
+
let t = a.item(e);
|
|
1632
|
+
if (t.nodeType !== 1 || t.localName !== "definedName") continue;
|
|
1633
|
+
let n = t.getAttribute("name");
|
|
1634
|
+
if (!n) continue;
|
|
1635
|
+
let r = {
|
|
1636
|
+
name: n,
|
|
1637
|
+
refersTo: t.getAttribute("refersTo") ?? ""
|
|
1638
|
+
}, o = t.getAttribute("sheetId");
|
|
1639
|
+
o !== null && (r.sheetIndex = parseInt(o, 10)), i.push(r);
|
|
1640
|
+
}
|
|
1641
|
+
i.length > 0 && (n.definedNames = i);
|
|
1642
|
+
}
|
|
1643
|
+
processSheetDataSet(e, t, n) {
|
|
1644
|
+
let r = this._findChild(t, "sheetDataSet");
|
|
1645
|
+
if (!r) return;
|
|
1646
|
+
let i = [], a = r.childNodes, o = a.length;
|
|
1647
|
+
for (let t = 0; t < o; t++) {
|
|
1648
|
+
let n = a.item(t);
|
|
1649
|
+
if (n.nodeType !== 1 || n.localName !== "sheetData") continue;
|
|
1650
|
+
let r = n.getAttribute("sheetId");
|
|
1651
|
+
if (r === null) continue;
|
|
1652
|
+
let o = this.processSheetData(e, n);
|
|
1653
|
+
o.sheetIndex = parseInt(r, 10), n.getAttribute("refreshError") === "1" && (o.refreshError = !0), i.push(o);
|
|
1654
|
+
}
|
|
1655
|
+
i.length > 0 && (n.sheetDataSet = i);
|
|
1656
|
+
}
|
|
1657
|
+
processSheetData(e, t) {
|
|
1658
|
+
let n = new ee.Builder(), r = t.childNodes, i = r.length;
|
|
1659
|
+
for (let e = 0; e < i; e++) {
|
|
1660
|
+
let t = r.item(e);
|
|
1661
|
+
if (t.nodeType !== 1 || t.localName !== "row") continue;
|
|
1662
|
+
let i = t.childNodes, a = i.length;
|
|
1663
|
+
for (let e = 0; e < a; e++) {
|
|
1664
|
+
let t = i.item(e);
|
|
1665
|
+
if (t.nodeType !== 1 || t.localName !== "cell") continue;
|
|
1666
|
+
let r = t.getAttribute("r");
|
|
1667
|
+
if (!r) continue;
|
|
1668
|
+
let a = d.fastStringToCell(r);
|
|
1669
|
+
if (a?.rowIndex === void 0 || a?.colIndex === void 0) continue;
|
|
1670
|
+
let o = this._readCellValue(t);
|
|
1671
|
+
o !== void 0 && n.pushAt(a.rowIndex, a.colIndex, o);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return {
|
|
1675
|
+
sheetIndex: -1,
|
|
1676
|
+
data: n.build()?.tuples ?? []
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
_readCellValue(e) {
|
|
1680
|
+
let t = this._findChild(e, "v")?.textContent?.trim();
|
|
1681
|
+
if (t !== void 0 && t !== "") switch (e.getAttribute("t")) {
|
|
1682
|
+
case null:
|
|
1683
|
+
case "n": return parseFloat(t);
|
|
1684
|
+
case "b": return t === "1" || t === "true";
|
|
1685
|
+
case "str":
|
|
1686
|
+
default: return t;
|
|
1687
|
+
case "e": {
|
|
1688
|
+
let e = f.getBuiltInByLabel(t);
|
|
1689
|
+
return e ? {
|
|
1690
|
+
t: "e",
|
|
1691
|
+
v: e.getCode()
|
|
1692
|
+
} : t;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
_findChild(e, t) {
|
|
1697
|
+
let n = e.childNodes, r = n.length;
|
|
1698
|
+
for (let e = 0; e < r; e++) {
|
|
1699
|
+
let r = n.item(e);
|
|
1700
|
+
if (r.nodeType === 1 && r.localName === t) return r;
|
|
1701
|
+
}
|
|
1702
|
+
return null;
|
|
1703
|
+
}
|
|
1704
|
+
}, je = class {
|
|
1705
|
+
visit(e, t, n) {
|
|
1706
|
+
e.copyFromAttribute(t, "name", n), e.copyFromAttribute(t, "sourceName", n);
|
|
1707
|
+
let r = e.evaluate("*/tableSlicerCache", t);
|
|
1708
|
+
return r ? (e.copyFromAttribute(r, "tableId", n), e.copyFromAttribute(r, "column", n, "columnId"), e.copyFromAttribute(r, "crossFilter", n), n) : (console.warn("SlicerCacheDefinitionVisitor: missing tableSlicerCache element"), n);
|
|
1709
|
+
}
|
|
1710
|
+
}, Me = class {
|
|
1711
|
+
visit(e, t, n) {
|
|
1712
|
+
let r = n.slicers;
|
|
1713
|
+
r || (r = {}, n.slicers = r);
|
|
1714
|
+
let i = t.childNodes, a = i.length;
|
|
1715
|
+
for (let t = 0; t < a; t++) {
|
|
1716
|
+
let n = i.item(t);
|
|
1717
|
+
n.nodeType === 1 && n.localName === "slicer" && this.processSlicer(e, n, r);
|
|
1718
|
+
}
|
|
1719
|
+
return r;
|
|
1720
|
+
}
|
|
1721
|
+
processSlicer(e, t, n) {
|
|
1722
|
+
if (!t) return;
|
|
1723
|
+
let r = {};
|
|
1724
|
+
n[t.getAttribute("name")] = r;
|
|
1725
|
+
let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches");
|
|
1726
|
+
if (i) {
|
|
1727
|
+
let e = a.get(i);
|
|
1728
|
+
e && (r.columnId = e.columnId, r.tableId = e.tableId);
|
|
1729
|
+
}
|
|
1730
|
+
e.copyFromAttribute(t, "caption", r), e.copyFromAttribute(t, "startItem", r, "startItem", e.INT_COPY), e.copyFromAttribute(t, "columnCount", r, "columnCount", e.INT_COPY), e.copyFromAttribute(t, "showCaption", r, "showCaption", e.BOOLEAN_COPY), e.copyFromAttribute(t, "level", r, "level", e.INT_COPY), e.copyFromAttribute(t, "style", r), e.copyFromAttribute(t, "locked", r, "locked", e.BOOLEAN_COPY), e.copyFromAttribute(t, "rowHeight", r, "rowHeight", e.INT_COPY);
|
|
1731
|
+
}
|
|
1732
|
+
}, Ne = class {
|
|
1733
|
+
visit(e, t, n) {
|
|
1734
|
+
return n;
|
|
1735
|
+
}
|
|
1736
|
+
}, Q = class {
|
|
1737
|
+
visit(e, t, n) {
|
|
1738
|
+
if (!t) return;
|
|
1739
|
+
let r = {};
|
|
1740
|
+
return e.copyFromAttribute(t, "editAs", r, "anchorType"), r.anchor = {}, t.localName === "absoluteAnchor" ? (r.anchorType = "absolute", this.processAbsoluteCoord(e, e.evaluate("xdr:pos", t), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : t.localName === "oneCellAnchor" ? (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processOffsetCoord(e, e.evaluate("to", t), r.anchor, "to")), n.movables ||= [], n.movables.push(r), r;
|
|
1741
|
+
}
|
|
1742
|
+
processAbsoluteCoord(e, n, r, i, a, o) {
|
|
1743
|
+
if (!n) return;
|
|
1744
|
+
let s = {
|
|
1745
|
+
x: 0,
|
|
1746
|
+
y: 0
|
|
1747
|
+
};
|
|
1748
|
+
return s.x = t(n.getAttribute(a)), s.y = t(n.getAttribute(o)), i === "from" ? r.tl = s : r.br = s, r;
|
|
1749
|
+
}
|
|
1750
|
+
processOffsetCoord(e, n, r, i) {
|
|
1751
|
+
if (!n) return;
|
|
1752
|
+
let a = {
|
|
1753
|
+
c: 0,
|
|
1754
|
+
r: 0,
|
|
1755
|
+
x: 0,
|
|
1756
|
+
y: 0
|
|
1757
|
+
};
|
|
1758
|
+
return e.evaluate("col", n) && (a.c = parseInt(e.evaluate("col", n).textContent)), e.evaluate("row", n) && (a.r = parseInt(e.evaluate("row", n).textContent)), e.evaluate("colOff", n) && (a.x = t(e.evaluate("colOff", n).textContent)), e.evaluate("rowOff", n) && (a.y = t(e.evaluate("rowOff", n).textContent)), i === "from" ? r.tl = a : r.br = a, r;
|
|
1759
|
+
}
|
|
1760
|
+
}, Pe = class extends B {
|
|
1761
|
+
visit(e, t, n) {
|
|
1762
|
+
if (!t) return;
|
|
1763
|
+
n = super.visit(e, t, n);
|
|
1764
|
+
let r = e.evaluate("nvGraphicFramePr/cNvGraphicFramePr", t);
|
|
1765
|
+
if (r) {
|
|
1766
|
+
let t = e.evaluate("graphicFrameLocks", r);
|
|
1767
|
+
if (t) {
|
|
1768
|
+
t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
|
|
1769
|
+
let e = {};
|
|
1770
|
+
Object.keys(e).length > 0 && (n.locks = e);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
let i = {
|
|
1774
|
+
type: "graphicFrame",
|
|
1775
|
+
json: {}
|
|
1776
|
+
}, a = e.evaluate("graphic/graphicData", t).childNodes, o = a.length;
|
|
1777
|
+
for (let n = 0; n < o; n++) {
|
|
1778
|
+
let r = a.item(n);
|
|
1779
|
+
if (r.nodeType === 1) try {
|
|
1780
|
+
let n = r.localName;
|
|
1781
|
+
n === "chart" ? n = "chart" : n === "slicer" && (n = "slicer"), i.type = n;
|
|
1782
|
+
let a = r.getAttribute("r:id");
|
|
1783
|
+
if (n === "chart" && a) {
|
|
1784
|
+
let n = e.evaluate("*/cNvPr", t);
|
|
1785
|
+
n?.item && (n = n.item(0));
|
|
1786
|
+
let r = n?.getAttribute?.("id"), o = r ? parseInt(r, 10) : void 0, c = e.getRelationships().get(a), l;
|
|
1787
|
+
if (c?.target) {
|
|
1788
|
+
let t = e.getFileLocation(), n = t.slice(0, t.lastIndexOf("/") + 1);
|
|
1789
|
+
l = s(c.target.startsWith("/") ? c.target : n + c.target);
|
|
1790
|
+
}
|
|
1791
|
+
i.json = {
|
|
1792
|
+
xml: e.serializeElement(t) ?? void 0,
|
|
1793
|
+
sourceId: o === void 0 || isNaN(o) ? void 0 : o,
|
|
1794
|
+
chartRelId: a,
|
|
1795
|
+
chartTargetPath: l
|
|
1796
|
+
};
|
|
1797
|
+
} else a && (i.json = e.getRef(a));
|
|
1798
|
+
} catch (e) {
|
|
1799
|
+
console.warn("Unable to parse graphicFrame", e);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
return i && (n.content = i), i;
|
|
1803
|
+
}
|
|
1804
|
+
}, $ = V, Fe = class extends B {
|
|
1805
|
+
visit(e, t, n) {
|
|
1806
|
+
if (!t) return;
|
|
1807
|
+
let r = super.visit(e, t, n), i = e.evaluate("nvPicPr/cNvPicPr", t);
|
|
1808
|
+
if (i) {
|
|
1809
|
+
e.copyFromAttribute(t, "preferRelativeResize", r, "preferRelativeResize", e.BOOLEAN_COPY);
|
|
1810
|
+
let n = e.evaluate("picLocks", i);
|
|
1811
|
+
if (n) {
|
|
1812
|
+
n.hasAttribute("noChangeAspect") && (r.lockAspect = n.getAttribute("noChangeAspect") === "1");
|
|
1813
|
+
let t = {};
|
|
1814
|
+
e.copyFromAttribute(n, "noChangeArrowheads", r, "noChangeArrowheads", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noChangeShapeType", r, "noChangeShapeType", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noEditPoints", r, "noEditPoints", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noAdjustHandles", r, "noAdjustHandles", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noCrop", r, "noCrop", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noGrp", r, "noGrp", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noMove", r, "noMove", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noResize", r, "noResize", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noRot", r, "noRot", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noSelect", r, "noSelect", e.BOOLEAN_COPY), Object.keys(t).length > 0 && (r.locks = t);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
let a = e.evaluate("blipFill/blip", t), o;
|
|
1818
|
+
if (a) {
|
|
1819
|
+
let t;
|
|
1820
|
+
if (t = a.getAttribute("r:embed") ?? a.getAttribute("embed"), t ||= a.getAttribute("r:link") ?? a.getAttribute("link"), !t) return void console.warn("no rId found for blip", a);
|
|
1821
|
+
o = e.getRef(t, !0);
|
|
1822
|
+
}
|
|
1823
|
+
return n.content = {
|
|
1824
|
+
type: "picture",
|
|
1825
|
+
json: { resId: o }
|
|
1826
|
+
}, r;
|
|
1827
|
+
}
|
|
1828
|
+
}, Ie = class extends V {
|
|
1829
|
+
visit(e, t, n) {
|
|
1830
|
+
if (!t) return;
|
|
1831
|
+
n = super.visit(e, t, n);
|
|
1832
|
+
let r = e.evaluate("nvGrpSpPr/cNvGrpSpPr", t);
|
|
1833
|
+
if (r) {
|
|
1834
|
+
let t = e.evaluate("grpSpLocks", r);
|
|
1835
|
+
if (t) {
|
|
1836
|
+
t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
|
|
1837
|
+
let e = {};
|
|
1838
|
+
Object.keys(e).length > 0 && (n.locks = e);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
e.warn(`Unable to import '${n.name}', group shapes are not supported.`);
|
|
1842
|
+
let i = {};
|
|
1843
|
+
return n.content = {
|
|
1844
|
+
type: "grpSp",
|
|
1845
|
+
json: i
|
|
1846
|
+
}, i;
|
|
1847
|
+
}
|
|
1848
|
+
}, Le = class extends V {
|
|
1849
|
+
visit(e, t, n) {
|
|
1850
|
+
if (!t) return;
|
|
1851
|
+
n = super.visit(e, t, n);
|
|
1852
|
+
let r = e.evaluate("nvCxnSpPr/cNvCxnSpPr", t);
|
|
1853
|
+
if (r) {
|
|
1854
|
+
let t = e.evaluate("cxnSpLocks", r);
|
|
1855
|
+
if (t) {
|
|
1856
|
+
t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
|
|
1857
|
+
let e = {};
|
|
1858
|
+
Object.keys(e).length > 0 && (n.locks = e);
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
e.warn(`'${n.name}' is not editable; imported as a fixed drawing.`);
|
|
1862
|
+
let i = e.evaluate("*/cNvPr", t);
|
|
1863
|
+
i?.item && (i = i.item(0));
|
|
1864
|
+
let a = i?.getAttribute?.("id"), o = a ? parseInt(a, 10) : void 0, s = {
|
|
1865
|
+
type: "cxnSp",
|
|
1866
|
+
xml: e.serializeElement(t) ?? void 0,
|
|
1867
|
+
sourceId: o === void 0 || isNaN(o) ? void 0 : o
|
|
1868
|
+
};
|
|
1869
|
+
return n.content = {
|
|
1870
|
+
type: "cxnSp",
|
|
1871
|
+
json: s
|
|
1872
|
+
}, s;
|
|
1873
|
+
}
|
|
1874
|
+
}, Re = class {
|
|
1875
|
+
visit(e, t, n) {
|
|
1876
|
+
let r = [], i = /* @__PURE__ */ new Map(), a = {
|
|
1877
|
+
cells: [],
|
|
1878
|
+
values: []
|
|
1879
|
+
}, o = t.childNodes;
|
|
1880
|
+
for (let e = 0; e < o.length; e++) {
|
|
1881
|
+
let t = o.item(e);
|
|
1882
|
+
if (t.nodeType === 1) switch (t.localName) {
|
|
1883
|
+
case "metadataTypes":
|
|
1884
|
+
this._parseMetadataTypes(t, r, i);
|
|
1885
|
+
break;
|
|
1886
|
+
case "futureMetadata":
|
|
1887
|
+
this._attachFutureMetadata(t, i);
|
|
1888
|
+
break;
|
|
1889
|
+
case "cellMetadata":
|
|
1890
|
+
this._resolveBlocks(t, r, a.cells);
|
|
1891
|
+
break;
|
|
1892
|
+
case "valueMetadata": this._resolveBlocks(t, r, a.values);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
return n.metadata = a, a;
|
|
1896
|
+
}
|
|
1897
|
+
_parseMetadataTypes(e, t, n) {
|
|
1898
|
+
let r = e.childNodes;
|
|
1899
|
+
for (let e = 0; e < r.length; e++) {
|
|
1900
|
+
let i = r.item(e);
|
|
1901
|
+
if (i.nodeType === 1 && i.localName === "metadataType") {
|
|
1902
|
+
let e = this._parseMetadataType(i);
|
|
1903
|
+
t.push(e), n.set(e.name, e);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
_parseMetadataType(e) {
|
|
1908
|
+
let t = {
|
|
1909
|
+
name: e.getAttribute("name") ?? "",
|
|
1910
|
+
_blocks: []
|
|
1911
|
+
}, n = e.getAttribute("minSupportedVersion");
|
|
1912
|
+
n != null && (t.minSupportedVersion = Number(n));
|
|
1913
|
+
for (let n of [
|
|
1914
|
+
"copy",
|
|
1915
|
+
"pasteAll",
|
|
1916
|
+
"pasteValues",
|
|
1917
|
+
"merge",
|
|
1918
|
+
"splitFirst",
|
|
1919
|
+
"splitAll",
|
|
1920
|
+
"rowColShift",
|
|
1921
|
+
"clearFormats",
|
|
1922
|
+
"clearComments",
|
|
1923
|
+
"assign",
|
|
1924
|
+
"coerce",
|
|
1925
|
+
"cellMeta",
|
|
1926
|
+
"adjust",
|
|
1927
|
+
"trans",
|
|
1928
|
+
"delete",
|
|
1929
|
+
"edit"
|
|
1930
|
+
]) e.getAttribute(n) === "1" && (t[n] = !0);
|
|
1931
|
+
return t;
|
|
1932
|
+
}
|
|
1933
|
+
_attachFutureMetadata(e, t) {
|
|
1934
|
+
let n = e.getAttribute("name") ?? "", r = t.get(n);
|
|
1935
|
+
if (!r) return;
|
|
1936
|
+
let i = e.childNodes;
|
|
1937
|
+
for (let e = 0; e < i.length; e++) {
|
|
1938
|
+
let t = i.item(e);
|
|
1939
|
+
t.nodeType === 1 && t.localName === "bk" && r._blocks.push(this._parseFutureBlock(t));
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
_parseFutureBlock(e) {
|
|
1943
|
+
let t = {}, n = e.childNodes;
|
|
1944
|
+
for (let e = 0; e < n.length; e++) {
|
|
1945
|
+
let r = n.item(e);
|
|
1946
|
+
if (r.nodeType !== 1 || r.localName !== "extLst") continue;
|
|
1947
|
+
let i = r.childNodes;
|
|
1948
|
+
for (let e = 0; e < i.length; e++) {
|
|
1949
|
+
let n = i.item(e);
|
|
1950
|
+
if (n.nodeType !== 1 || n.localName !== "ext") continue;
|
|
1951
|
+
let r = n.childNodes;
|
|
1952
|
+
for (let e = 0; e < r.length; e++) {
|
|
1953
|
+
let n = r.item(e);
|
|
1954
|
+
n.nodeType === 1 && (n.localName === "dynamicArrayProperties" ? (t.fDynamic = n.getAttribute("fDynamic") === "1", t.fCollapsed = n.getAttribute("fCollapsed") === "1") : n.localName === "rvb" && (t.richValueIndex = Number(n.getAttribute("i") ?? "0")));
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
return t;
|
|
1959
|
+
}
|
|
1960
|
+
_resolveBlocks(e, t, n) {
|
|
1961
|
+
let r = e.childNodes;
|
|
1962
|
+
for (let e = 0; e < r.length; e++) {
|
|
1963
|
+
let i = r.item(e);
|
|
1964
|
+
i.nodeType === 1 && i.localName === "bk" && n.push(this._resolveBlock(i, t));
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
_resolveBlock(e, t) {
|
|
1968
|
+
let n = /* @__PURE__ */ new Map(), r = e.childNodes;
|
|
1969
|
+
for (let e = 0; e < r.length; e++) {
|
|
1970
|
+
let i = r.item(e);
|
|
1971
|
+
if (i.nodeType !== 1 || i.localName !== "rc") continue;
|
|
1972
|
+
let a = Number(i.getAttribute("t")), o = Number(i.getAttribute("v")), s = t[a - 1];
|
|
1973
|
+
if (!s) continue;
|
|
1974
|
+
let { _blocks: c, ...l } = s, u = { ...l };
|
|
1975
|
+
for (let e of Object.keys(u)) u[e] === void 0 && delete u[e];
|
|
1976
|
+
let d = c[o];
|
|
1977
|
+
d && (d.fDynamic !== void 0 && (u.fDynamic = d.fDynamic, u.fCollapsed = d.fCollapsed ?? !1), d.richValueIndex !== void 0 && (u.richValueIndex = d.richValueIndex)), n.set(s.name, u);
|
|
1978
|
+
}
|
|
1979
|
+
return n;
|
|
1980
|
+
}
|
|
1981
|
+
}, ze = class {
|
|
1982
|
+
visit(e, t, n) {
|
|
1983
|
+
let r = e.getVisitorParamsState().get(H);
|
|
1984
|
+
r || (r = [], e.getVisitorParamsState().set(H, r));
|
|
1985
|
+
let i = t.childNodes, a = i.length;
|
|
1986
|
+
for (let t = 0; t < a; t++) {
|
|
1987
|
+
let n = i.item(t);
|
|
1988
|
+
if (n.nodeType === 1 && n.localName === "s") {
|
|
1989
|
+
let t = {
|
|
1990
|
+
type: n.getAttribute("t") ?? "n",
|
|
1991
|
+
keys: []
|
|
1992
|
+
};
|
|
1993
|
+
this.processKeys(e, n, t), r.push(t);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return n.richTypes = r, r;
|
|
1997
|
+
}
|
|
1998
|
+
processKeys(e, t, n) {
|
|
1999
|
+
let r = t.childNodes, i = r.length, a = n.keys;
|
|
2000
|
+
for (let e = 0; e < i; e++) {
|
|
2001
|
+
let t = r.item(e);
|
|
2002
|
+
if (t.nodeType === 1 && t.localName === "k") {
|
|
2003
|
+
let e = t.getAttribute("n"), n = t.getAttribute("t");
|
|
2004
|
+
a.push([e, n]);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
}, Be = class {
|
|
2009
|
+
visit(e, t, n) {
|
|
2010
|
+
let r = e.getVisitorParamsState().get("richTypes");
|
|
2011
|
+
if (!r) return void e.warn("RichValueFound but not type.");
|
|
2012
|
+
let i = e.getVisitorParamsState().get(U);
|
|
2013
|
+
i || (i = [], e.getVisitorParamsState().set(U, i));
|
|
2014
|
+
let a = t.childNodes, o = a.length;
|
|
2015
|
+
for (let t = 0; t < o; t++) {
|
|
2016
|
+
let n = a.item(t);
|
|
2017
|
+
if (n.nodeType === 1 && n.localName === "rv") {
|
|
2018
|
+
let t = r[n.getAttribute("s")], a = { type: t.type };
|
|
2019
|
+
this.processValues(e, n, a, t);
|
|
2020
|
+
let o = this.mapType(e, a);
|
|
2021
|
+
i.push(o);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
return n.richData = i, i;
|
|
2025
|
+
}
|
|
2026
|
+
mapType(e, t) {
|
|
2027
|
+
if (t.type === "_error") {
|
|
2028
|
+
let e = t.errorType;
|
|
2029
|
+
if (e) try {
|
|
2030
|
+
t = f.getBuiltInByCode(e + 1) ?? f.BuiltIn.Unknown;
|
|
2031
|
+
} catch {}
|
|
2032
|
+
}
|
|
2033
|
+
return t;
|
|
2034
|
+
}
|
|
2035
|
+
processValues(e, t, n, r) {
|
|
2036
|
+
let i = t.childNodes, a = i.length;
|
|
2037
|
+
r.type;
|
|
2038
|
+
let o = r.keys;
|
|
2039
|
+
for (let t = 0; t < a; t++) {
|
|
2040
|
+
let r = i.item(t);
|
|
2041
|
+
if (r.nodeType === 1 && r.localName === "v") {
|
|
2042
|
+
let i = o[t];
|
|
2043
|
+
if (!i) return void e.warn("Invalid richData");
|
|
2044
|
+
let a = i[0], s = i[1], c = r.textContent;
|
|
2045
|
+
s === "i" && (c = Number(c)), n[a] = c;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
}, Ve = class {
|
|
2050
|
+
visit(e, t, n) {
|
|
2051
|
+
if (!t) return;
|
|
2052
|
+
let r = [];
|
|
2053
|
+
this.processAuthors(e, e.evaluate("authors", t), r), r.length > 0 && (n.authors = r);
|
|
2054
|
+
let i = [];
|
|
2055
|
+
return n.comments = i, i;
|
|
2056
|
+
}
|
|
2057
|
+
processAuthors(e, t, n) {
|
|
2058
|
+
if (!t) return;
|
|
2059
|
+
let r = t.childNodes, i = r.length;
|
|
2060
|
+
for (let e = 0; e < i; e++) {
|
|
2061
|
+
let t = r.item(e);
|
|
2062
|
+
if (t.nodeType === 1 && t.localName === "author") {
|
|
2063
|
+
let e = t.firstChild;
|
|
2064
|
+
e && e.nodeType === 3 && n.push(e.textContent);
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
}, He = class {
|
|
2069
|
+
visit(e, t, n) {
|
|
2070
|
+
if (!t) return;
|
|
2071
|
+
let r = {}, i = t.getAttribute("ref");
|
|
2072
|
+
e.copyFromAttribute(t, "authorId", r, "personId", e.INT_COPY), r.asNote = !0;
|
|
2073
|
+
let a = {
|
|
2074
|
+
r: i,
|
|
2075
|
+
v: r
|
|
2076
|
+
};
|
|
2077
|
+
return n.push(a), r;
|
|
2078
|
+
}
|
|
2079
|
+
}, Ue = class {
|
|
2080
|
+
visit(e, t, n) {
|
|
2081
|
+
if (!t) return;
|
|
2082
|
+
let r = [];
|
|
2083
|
+
return n.comments = r, r;
|
|
2084
|
+
}
|
|
2085
|
+
}, We = class {
|
|
2086
|
+
visit(e, t, n) {
|
|
2087
|
+
if (!t) return;
|
|
2088
|
+
let i = {};
|
|
2089
|
+
e.copyFromAttribute(t, "id", i, "id", r);
|
|
2090
|
+
let a = t.getAttribute("ref");
|
|
2091
|
+
e.copyFromAttribute(t, "personId", i, "personId", r), e.copyFromAttribute(t, "parentId", i, "parentId", r), e.copyFromAttribute(t, "dT", i), t.hasAttribute("done") && (i.done = c(t.getAttribute("done")));
|
|
2092
|
+
let o = {
|
|
2093
|
+
r: a,
|
|
2094
|
+
v: i
|
|
2095
|
+
};
|
|
2096
|
+
return n.push(o), i;
|
|
2097
|
+
}
|
|
2098
|
+
}, Ge = class {
|
|
2099
|
+
visit(e, t, n) {
|
|
2100
|
+
let i = [], a = t.childNodes, o = a.length;
|
|
2101
|
+
for (let t = 0; t < o; t++) {
|
|
2102
|
+
let n = a.item(t);
|
|
2103
|
+
if (n.nodeType === 1 && n.localName === "person") {
|
|
2104
|
+
let t = {};
|
|
2105
|
+
e.copyFromAttribute(n, "id", t, "id", r), e.copyFromAttribute(n, "displayName", t), e.copyFromAttribute(n, "userId", t, "userId", r), e.copyFromAttribute(n, "providerId", t), i.push(t);
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
return i.length > 0 && (n.persons = i), i;
|
|
2109
|
+
}
|
|
2110
|
+
}, Ke = class {
|
|
2111
|
+
constructor(e, t) {
|
|
2112
|
+
this.path = e, this.visitor = t;
|
|
2113
|
+
}
|
|
2114
|
+
}, qe = class {
|
|
2115
|
+
constructor() {
|
|
2116
|
+
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new W()), this.registerVisitor("cp:coreProperties", new G()), this.registerVisitor("Properties", new K()), this.registerVisitor("spPr", new ue()), this.registerVisitor("txBody", new X()), this.registerVisitor("txPr", new X()), this.registerVisitor("c:chartSpace", new ce()), this.registerVisitor("c:plotArea", new le()), this.registerVisitor("c:barChart", new de()), this.registerVisitor("c:doughnutChart", new q()), this.registerVisitor("c:lineChart", new q()), this.registerVisitor("c:ofPieType", new q()), this.registerVisitor("c:pieChart", new q()), this.registerVisitor("c:scatterChart", new q()), this.registerVisitor("c:barChart", new J("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new J("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new J("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new J("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new J("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new J("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new fe()), this.registerVisitor("c:dPt", new pe()), this.registerVisitor("c:marker", new me()), this.registerVisitor("c:catAx", new Y()), this.registerVisitor("c:valAx", new Y()), this.registerVisitor("c:dateAx", new Y()), this.registerVisitor("c:majorGridlines", new M("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new M("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new X("labels.text"), "txPr"), this.registerVisitor("c:valAx", new X("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new X("labels.text"), "txPr"), this.registerVisitor("c:legend", new ge()), this.registerVisitor("c:legend", new X("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new he()), this.registerVisitor("c:ser", new _e(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new J("labels"), "dLbls"), this.registerVisitor("c:dLbl", new J("points")), this.registerVisitor("c:title", new Z()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new ve()), this.registerVisitor("c:dispUnits", new M("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new Z("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new X(), "tx/rich"), this.registerVisitor("a:theme", new ye()), this.registerVisitor("a:theme", new be(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new xe(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Se(), "themeElements/fmtScheme"), this.registerVisitor("autoFilter", new we()), this.registerVisitor("sortState", new Te()), this.registerVisitor("s:workbook", new De()), this.registerVisitor("styleSheet", new Ee()), this.registerVisitor("x14:table", new ke()), this.registerVisitor("table", new Oe()), this.registerVisitor("externalLink", new Ae()), this.registerVisitor("hlinkClick", new Ce()), this.registerVisitor("wsDr", new Ne()), this.registerVisitor("twoCellAnchor", new Q()), this.registerVisitor("oneCellAnchor", new Q()), this.registerVisitor("absoluteAnchor", new Q()), this.registerVisitor("graphicFrame", new Pe()), this.registerVisitor("sp", new $()), this.registerVisitor("grpSp", new Ie()), this.registerVisitor("cxnSp", new Le()), this.registerVisitor("pic", new Fe()), this.registerVisitor("metadata", new Re()), this.registerVisitor("rvStructures", new ze()), this.registerVisitor("rvData", new Be()), this.registerVisitor("comments", new Ve()), this.registerVisitor("comment", new He()), this.registerVisitor("comment", new X("content"), "text"), this.registerVisitor("ThreadedComments", new Ue()), this.registerVisitor("threadedComment", new We()), this.registerVisitor("threadedComment", new X("content"), "text"), this.registerVisitor("personList", new Ge()), this.registerVisitor("slicerCacheDefinition", new je()), this.registerVisitor("slicers", new Me());
|
|
2117
|
+
}
|
|
2118
|
+
registerVisitor(e, t, n = null) {
|
|
2119
|
+
e.indexOf(":") === -1 && (e = "*:" + e);
|
|
2120
|
+
let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
|
|
2121
|
+
if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
|
|
2122
|
+
let a = this.scopedVisitorsByXmlTagName.get(i);
|
|
2123
|
+
a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new Ke(n, t));
|
|
2124
|
+
}
|
|
2125
|
+
getVisitorParamsState() {
|
|
2126
|
+
return this.visitorParamsState;
|
|
2127
|
+
}
|
|
2128
|
+
transform(e, t, n = u.EmptyObject) {
|
|
2129
|
+
let r = e.documentElement;
|
|
2130
|
+
this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
|
|
2131
|
+
let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
|
|
2132
|
+
if (a ||= this.visitorsByXmlTagName.get(r.localName), !a) throw Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
|
|
2133
|
+
let o = "/" + r.localName, s = new S(null, this, o, r, i, t, n), c = [];
|
|
2134
|
+
this._doWalk(a, s, c, r, i, t, n);
|
|
2135
|
+
let l = c.length;
|
|
2136
|
+
for (let e = 0; e < l; e++) {
|
|
2137
|
+
let t = c[e];
|
|
2138
|
+
try {
|
|
2139
|
+
t.visitor?.afterVisit?.(t.context, t.elemParent, t.jsonParent);
|
|
2140
|
+
} catch (e) {
|
|
2141
|
+
console.warn(`Error in afterVisit: ${t.context.getPath()}`, e);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
return i;
|
|
2145
|
+
}
|
|
2146
|
+
_walkScoped(e, t, n, r, i, a, o) {
|
|
2147
|
+
let s = this.scopedVisitorsByXmlTagName.get(e), c = s ? s.length : 0;
|
|
2148
|
+
for (let l = 0; l < c; l++) {
|
|
2149
|
+
let c = s[l], u = null;
|
|
2150
|
+
try {
|
|
2151
|
+
u = t.evaluate(c.path, r);
|
|
2152
|
+
} catch {
|
|
2153
|
+
console.warn(`"Invalid path '${c.path}' for '${e}'.`);
|
|
2154
|
+
}
|
|
2155
|
+
if (!u) continue;
|
|
2156
|
+
let d = (e) => {
|
|
2157
|
+
let s = e.localName, l = e.parentNode;
|
|
2158
|
+
for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
|
|
2159
|
+
let u = t.getPath() + "/" + s;
|
|
2160
|
+
if (c.visitor) {
|
|
2161
|
+
let r = new S(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
|
|
2162
|
+
this._doWalk(c.visitor, r, n, e, i, a, o);
|
|
2163
|
+
}
|
|
2164
|
+
};
|
|
2165
|
+
if (u.length > 0) {
|
|
2166
|
+
let e = u, t = e.length;
|
|
2167
|
+
for (let n = 0; n < t; n++) d(e.item(n));
|
|
2168
|
+
} else d(u);
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
_doWalk(e, t, n, r, i, a, o) {
|
|
2172
|
+
let s = null;
|
|
2173
|
+
e && (n.push({
|
|
2174
|
+
visitor: e,
|
|
2175
|
+
context: t,
|
|
2176
|
+
elemParent: r,
|
|
2177
|
+
jsonParent: i
|
|
2178
|
+
}), s = e.visit(t, r, i)), s ||= i;
|
|
2179
|
+
let c = r.localName;
|
|
2180
|
+
this._walkScoped(c, t, n, r, s, a, o);
|
|
2181
|
+
let l = this.visitorsByXmlTagName, u = t.getElemRoot(), d = t.getJsonRoot(), f = r.childNodes, p = f.length;
|
|
2182
|
+
for (let e = 0; e < p; e++) {
|
|
2183
|
+
let r = f.item(e);
|
|
2184
|
+
if (r.nodeType !== 1) continue;
|
|
2185
|
+
let c = r, p = c.nodeName, m = l.get(p);
|
|
2186
|
+
m ||= (p = c.localName, l.get(p));
|
|
2187
|
+
let h = t.getPath() + "/" + p, g = new S(t, this, h, u, d, a, o);
|
|
2188
|
+
this._doWalk(m, g, n, c, s ?? i, a, o);
|
|
2189
|
+
}
|
|
2190
|
+
return s;
|
|
2191
|
+
}
|
|
2192
|
+
};
|
|
2193
|
+
export { qe as DOMTransformer, S as ExecutionContext, l as NumberUtils, C as VisitorUtils };
|