file-viewer3 1.0.26 → 2.0.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/README.en.md +7 -377
- package/README.md +8 -352
- package/dist/file-viewer3.css +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +27 -129
- package/dist/components/3MFLoader.js +0 -527
- package/dist/components/AMFLoader.js +0 -188
- package/dist/components/ArchiveViewer.js +0 -526
- package/dist/components/AudioViewer.js +0 -66
- package/dist/components/CadViewer.js +0 -9040
- package/dist/components/CodeViewer.js +0 -151
- package/dist/components/ColladaLoader.js +0 -2282
- package/dist/components/DrawingViewer.js +0 -295
- package/dist/components/EdaViewer.js +0 -630
- package/dist/components/EmailViewer.js +0 -276
- package/dist/components/EpubViewer.js +0 -172
- package/dist/components/FBXLoader.js +0 -1574
- package/dist/components/GLTFLoader.js +0 -1383
- package/dist/components/ImageViewer.js +0 -1519
- package/dist/components/KMZLoader.js +0 -45
- package/dist/components/MarkdownViewer.js +0 -1476
- package/dist/components/ModelViewer.js +0 -797
- package/dist/components/OBJLoader.js +0 -287
- package/dist/components/OfdViewer.js +0 -133
- package/dist/components/PCDLoader.js +0 -141
- package/dist/components/PLYLoader.js +0 -305
- package/dist/components/PdfView.js +0 -27667
- package/dist/components/PptxRender.js +0 -11217
- package/dist/components/STLLoader.js +0 -83
- package/dist/components/TDSLoader.js +0 -228
- package/dist/components/TypstViewer.js +0 -1697
- package/dist/components/USDLoader.js +0 -2526
- package/dist/components/UmdViewer.js +0 -1873
- package/dist/components/VRMLLoader.js +0 -6422
- package/dist/components/VTKLoader.js +0 -337
- package/dist/components/XYZLoader.js +0 -30
- package/dist/components/XlsxTable.js +0 -7879
- package/dist/components/__vite-browser-external.js +0 -7
- package/dist/components/_plugin-vue_export-helper.js +0 -8
- package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
- package/dist/components/arc.js +0 -79
- package/dist/components/architecture-7EHR7CIX.js +0 -3
- package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
- package/dist/components/archive.js +0 -24
- package/dist/components/asyncToGenerator.js +0 -29
- package/dist/components/audio.js +0 -19
- package/dist/components/az-AZ-76LH7QW2.js +0 -523
- package/dist/components/bash.js +0 -169
- package/dist/components/bg-BG-XCXSNQG7.js +0 -523
- package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
- package/dist/components/bn-BD-2XOGV67Q.js +0 -523
- package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
- package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
- package/dist/components/cad.js +0 -23
- package/dist/components/cfb.js +0 -1174
- package/dist/components/channel.js +0 -5
- package/dist/components/chunk-2J33WTMH.js +0 -26
- package/dist/components/chunk-3OPIFGDE.js +0 -4167
- package/dist/components/chunk-4BX2VUAB.js +0 -19
- package/dist/components/chunk-55IACEB6.js +0 -9
- package/dist/components/chunk-5ZQYHXKU.js +0 -669
- package/dist/components/chunk-6U3AYISY.js +0 -624
- package/dist/components/chunk-727SXJPM.js +0 -3356
- package/dist/components/chunk-AGHRB4JF.js +0 -324
- package/dist/components/chunk-AQP2D5EJ.js +0 -2055
- package/dist/components/chunk-BSJP7CBP.js +0 -83
- package/dist/components/chunk-CSCIHK7Q.js +0 -3500
- package/dist/components/chunk-EIO257PC.js +0 -1836
- package/dist/components/chunk-FMBD7UC4.js +0 -5
- package/dist/components/chunk-K2UTITRG.js +0 -17627
- package/dist/components/chunk-KSCS5N6A.js +0 -572
- package/dist/components/chunk-L5ZTLDWV.js +0 -40
- package/dist/components/chunk-LZXEDZCA.js +0 -60
- package/dist/components/chunk-ND2GUHAM.js +0 -61
- package/dist/components/chunk-NNHCCRGN.js +0 -20425
- package/dist/components/chunk-NZK2D7GU.js +0 -68
- package/dist/components/chunk-O5CBEL6O.js +0 -1894
- package/dist/components/chunk-QZHKN3VN.js +0 -12
- package/dist/components/chunk-SRAX5OIU.js +0 -22
- package/dist/components/chunk-WU5MYG2G.js +0 -14
- package/dist/components/chunk-XPW4576I.js +0 -1146
- package/dist/components/chunk-Z3N5DIM6.js +0 -59
- package/dist/components/chunk-ZUYEQ4TG.js +0 -22
- package/dist/components/chunk.js +0 -23
- package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
- package/dist/components/compiler.js +0 -2
- package/dist/components/core.js +0 -845
- package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
- package/dist/components/cpp.js +0 -225
- package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
- package/dist/components/csharp.js +0 -260
- package/dist/components/css.js +0 -140
- package/dist/components/cytoscape.esm.js +0 -18114
- package/dist/components/da-DK-5WZEPLOC.js +0 -523
- package/dist/components/dagre-BM42HDAG.js +0 -325
- package/dist/components/dagre.js +0 -1936
- package/dist/components/de-DE-XR44H4JA.js +0 -523
- package/dist/components/defaultLocale.js +0 -201
- package/dist/components/defineProperty.js +0 -50
- package/dist/components/diagram-2AECGRRQ.js +0 -229
- package/dist/components/diagram-5GNKFQAL.js +0 -108
- package/dist/components/diagram-KO2AKTUF.js +0 -443
- package/dist/components/diagram-LMA3HP47.js +0 -139
- package/dist/components/diagram-OG6HWLK6.js +0 -541
- package/dist/components/diff.js +0 -39
- package/dist/components/directory-open-01563666.js +0 -26
- package/dist/components/directory-open-4ed118d0.js +0 -83
- package/dist/components/dist.js +0 -50
- package/dist/components/dist2.js +0 -3291
- package/dist/components/dist3.js +0 -1593
- package/dist/components/documentSearch.js +0 -378
- package/dist/components/docx-preview.js +0 -3113
- package/dist/components/drawing.js +0 -19
- package/dist/components/ebook.js +0 -16
- package/dist/components/eda.js +0 -20
- package/dist/components/el-GR-BZB4AONW.js +0 -523
- package/dist/components/email.js +0 -21
- package/dist/components/en-B4ZKOASM.js +0 -3
- package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
- package/dist/components/es-ES-U4NZUMDT.js +0 -523
- package/dist/components/eu-ES-A7QVB2H4.js +0 -523
- package/dist/components/eventmodeling-FCH6USID.js +0 -3
- package/dist/components/fa-IR-HGAKTJCU.js +0 -523
- package/dist/components/fflate.module.js +0 -323
- package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
- package/dist/components/file-open-002ab408.js +0 -38
- package/dist/components/file-open-7c801643.js +0 -24
- package/dist/components/file-save-3189631c.js +0 -40
- package/dist/components/file-save-745eba88.js +0 -36
- package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
- package/dist/components/fr-FR-RHASNOE6.js +0 -523
- package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
- package/dist/components/gitGraph-WXDBUCRP.js +0 -3
- package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
- package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
- package/dist/components/global-compiler.js +0 -23
- package/dist/components/global-renderer.js +0 -23
- package/dist/components/go.js +0 -140
- package/dist/components/graphlib.js +0 -1267
- package/dist/components/he-IL-6SHJWFNN.js +0 -523
- package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
- package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
- package/dist/components/id-ID-SAP4L64H.js +0 -523
- package/dist/components/image-GAAHSSAO.js +0 -3
- package/dist/components/image-blob-reduce.esm.js +0 -1429
- package/dist/components/image.js +0 -17
- package/dist/components/info-J43DQDTF.js +0 -3
- package/dist/components/infoDiagram-5YYISTIA.js +0 -26
- package/dist/components/ini.js +0 -88
- package/dist/components/init.js +0 -15
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
- package/dist/components/it-IT-JPQ66NNP.js +0 -523
- package/dist/components/ja-JP-DBVTYXUO.js +0 -523
- package/dist/components/java.js +0 -169
- package/dist/components/javascript.js +0 -436
- package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
- package/dist/components/json.js +0 -36
- package/dist/components/jszip.min.js +0 -3033
- package/dist/components/kaa-6HZHGXH3.js +0 -523
- package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
- package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
- package/dist/components/katex.js +0 -21979
- package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
- package/dist/components/km-KH-HSX4SM5Z.js +0 -523
- package/dist/components/ko-KR-MTYHY66A.js +0 -523
- package/dist/components/ku-TR-6OUDTVRD.js +0 -523
- package/dist/components/lib.js +0 -4877
- package/dist/components/libarchive.js +0 -360
- package/dist/components/linear.js +0 -289
- package/dist/components/lt-LT-XHIRWOB4.js +0 -523
- package/dist/components/lv-LV-5QDEKY6T.js +0 -523
- package/dist/components/markdown.js +0 -181
- package/dist/components/md.js +0 -17
- package/dist/components/mermaid-parser.core.js +0 -328
- package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
- package/dist/components/model.js +0 -21
- package/dist/components/mp4.js +0 -12
- package/dist/components/mr-IN-CRQNXWMA.js +0 -523
- package/dist/components/my-MM-5M5IBNSE.js +0 -523
- package/dist/components/nb-NO-T6EIAALU.js +0 -523
- package/dist/components/nestedRender.js +0 -158
- package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
- package/dist/components/nn-NO-6E72VCQL.js +0 -523
- package/dist/components/objectSpread2.js +0 -29
- package/dist/components/objectWithoutProperties.js +0 -28
- package/dist/components/oc-FR-POXYY2M6.js +0 -523
- package/dist/components/ofd.js +0 -5261
- package/dist/components/ofd2.js +0 -16
- package/dist/components/ordinal.js +0 -65
- package/dist/components/pa-IN-N4M65BXN.js +0 -523
- package/dist/components/packet-YPE3B663.js +0 -3
- package/dist/components/pdf.js +0 -24
- package/dist/components/percentages-BXMCSKIN.js +0 -3
- package/dist/components/php.js +0 -294
- package/dist/components/pica.js +0 -1009
- package/dist/components/pie-LRSECV5Y.js +0 -3
- package/dist/components/pie.js +0 -47
- package/dist/components/pieDiagram-4H26LBE5.js +0 -130
- package/dist/components/pl-PL-T2D74RX3.js +0 -523
- package/dist/components/postal-mime.js +0 -3146
- package/dist/components/pptx.js +0 -15
- package/dist/components/printLayout.js +0 -42
- package/dist/components/prod.js +0 -21770
- package/dist/components/pt-BR-5N22H2LF.js +0 -523
- package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
- package/dist/components/python.js +0 -238
- package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
- package/dist/components/radar-GUYGQ44K.js +0 -3
- package/dist/components/renderer.js +0 -2
- package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
- package/dist/components/ro-RO-JPDTUUEW.js +0 -523
- package/dist/components/rough.esm.js +0 -1355
- package/dist/components/roundRect.js +0 -90
- package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
- package/dist/components/rust.js +0 -169
- package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
- package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
- package/dist/components/shared.js +0 -175
- package/dist/components/shared2.js +0 -4
- package/dist/components/si-LK-N5RQ5JYF.js +0 -523
- package/dist/components/sk-SK-C5VTKIMK.js +0 -523
- package/dist/components/sl-SI-NN7IZMDC.js +0 -523
- package/dist/components/sourceLoading.js +0 -134
- package/dist/components/sql.js +0 -118
- package/dist/components/src.js +0 -2664
- package/dist/components/src2.js +0 -10722
- package/dist/components/stateDiagram-AJRCARHV.js +0 -217
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
- package/dist/components/subset-shared.chunk.js +0 -3
- package/dist/components/subset-worker.chunk.js +0 -21
- package/dist/components/sv-SE-XGPEYMSR.js +0 -523
- package/dist/components/ta-IN-2NMHFXQM.js +0 -523
- package/dist/components/text.js +0 -20
- package/dist/components/th-TH-HPSO5L25.js +0 -523
- package/dist/components/three.module.js +0 -13134
- package/dist/components/time.js +0 -910
- package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
- package/dist/components/tr-TR-DEFEU3FU.js +0 -523
- package/dist/components/treeView-BLDUP644.js +0 -3
- package/dist/components/treemap-LRROVOQU.js +0 -3
- package/dist/components/typescript.js +0 -521
- package/dist/components/typst.js +0 -25
- package/dist/components/uk-UA-QMV73CPH.js +0 -523
- package/dist/components/umd.js +0 -16
- package/dist/components/use.js +0 -422
- package/dist/components/util.js +0 -49
- package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
- package/dist/components/vi-VN-M7AON7JQ.js +0 -523
- package/dist/components/viewerZoom.js +0 -92
- package/dist/components/wardley-L42UT6IY.js +0 -3
- package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
- package/dist/components/wasm-pack-shim.js +0 -1711
- package/dist/components/wasm-pack-shim2.js +0 -934
- package/dist/components/wasm.js +0 -97
- package/dist/components/word.js +0 -3055
- package/dist/components/worker-ref.js +0 -16
- package/dist/components/xlsx.js +0 -21
- package/dist/components/xml.js +0 -166
- package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
- package/dist/components/yaml.js +0 -144
- package/dist/components/zh-CN-LNUGB5OW.js +0 -523
- package/dist/components/zh-HK-E62DVLB3.js +0 -523
- package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
- package/dist/index.mjs +0 -3293
- package/dist/src/App.vue.d.ts +0 -3
- package/dist/src/compare/CompareApp.vue.d.ts +0 -3
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
- package/dist/src/components/HelloWorld.vue.d.ts +0 -3
- package/dist/src/components/utils.d.ts +0 -4
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +0 -27
- package/dist/src/package/common/printLayout.d.ts +0 -16
- package/dist/src/package/common/sourceLoading.d.ts +0 -10
- package/dist/src/package/common/type.d.ts +0 -544
- package/dist/src/package/common/util.d.ts +0 -5
- package/dist/src/package/common/worker-ref.d.ts +0 -12
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
- package/dist/src/package/components/FileViewer/index.d.ts +0 -2
- package/dist/src/package/components/FileViewer/util.d.ts +0 -3
- package/dist/src/package/index.d.ts +0 -22
- package/dist/src/package/use/documentLocation.d.ts +0 -15
- package/dist/src/package/use/documentSearch.d.ts +0 -234
- package/dist/src/package/use/index.d.ts +0 -5
- package/dist/src/package/use/loading.d.ts +0 -33
- package/dist/src/package/use/viewerZoom.d.ts +0 -42
- package/dist/src/package/use/worker.d.ts +0 -24
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/archive/cache.d.ts +0 -10
- package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
- package/dist/src/package/vendors/archive/index.d.ts +0 -3
- package/dist/src/package/vendors/archive/shared.d.ts +0 -24
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/audio/index.d.ts +0 -7
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/cad/index.d.ts +0 -8
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/drawing/index.d.ts +0 -7
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ebook/index.d.ts +0 -7
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/eda/index.d.ts +0 -2
- package/dist/src/package/vendors/eda/parser.d.ts +0 -77
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
- package/dist/src/package/vendors/email/index.d.ts +0 -2
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/image/index.d.ts +0 -4
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/md/index.d.ts +0 -4
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/model/index.d.ts +0 -3
- package/dist/src/package/vendors/model/shared.d.ts +0 -1
- package/dist/src/package/vendors/mp4/index.d.ts +0 -4
- package/dist/src/package/vendors/nestedRender.d.ts +0 -10
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ofd/index.d.ts +0 -7
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
- package/dist/src/package/vendors/pdf/index.d.ts +0 -2
- package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
- package/dist/src/package/vendors/pptx/index.d.ts +0 -6
- package/dist/src/package/vendors/pptx/options.d.ts +0 -39
- package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
- package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/renders.d.ts +0 -3
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/text/index.d.ts +0 -10
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/typst/index.d.ts +0 -8
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/umd/index.d.ts +0 -7
- package/dist/src/package/vendors/umd/parser.d.ts +0 -30
- package/dist/src/package/vendors/word/doc.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
- package/dist/src/package/vendors/word/index.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
- package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
- package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +0 -24
- package/dist/wasm/cad/libredwg-web.js +0 -15
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { WorkSheet } from 'styled-exceljs';
|
|
2
|
-
import { CellMerge, SheetColumn, SheetModel, SheetStructure, SheetWindow } from '../type';
|
|
3
|
-
export declare const defaults: {
|
|
4
|
-
rowHeight: number;
|
|
5
|
-
colWidth: number;
|
|
6
|
-
};
|
|
7
|
-
interface SheetSliceOptions {
|
|
8
|
-
startRow?: number;
|
|
9
|
-
pageSize?: number;
|
|
10
|
-
totalRows?: number;
|
|
11
|
-
totalCols?: number;
|
|
12
|
-
}
|
|
13
|
-
type SheetCellMeta = {
|
|
14
|
-
className?: string;
|
|
15
|
-
style: Record<string, string>;
|
|
16
|
-
};
|
|
17
|
-
export default class SheetJsModel implements SheetModel {
|
|
18
|
-
private readonly _ws;
|
|
19
|
-
private readonly _startRow;
|
|
20
|
-
private readonly _pageSize;
|
|
21
|
-
private readonly _totalRows?;
|
|
22
|
-
private readonly _totalCols?;
|
|
23
|
-
private static readonly defaults;
|
|
24
|
-
private _data;
|
|
25
|
-
private _cell;
|
|
26
|
-
private _merge;
|
|
27
|
-
private _rowHeights;
|
|
28
|
-
private _colWidths;
|
|
29
|
-
private _autoFitColumns;
|
|
30
|
-
private _columns;
|
|
31
|
-
private _structure;
|
|
32
|
-
private _meta;
|
|
33
|
-
private readonly range;
|
|
34
|
-
static create(ws: WorkSheet, options?: SheetSliceOptions): SheetJsModel;
|
|
35
|
-
private constructor();
|
|
36
|
-
private get ws();
|
|
37
|
-
get defaults(): {
|
|
38
|
-
rowHeight: number;
|
|
39
|
-
colWidth: number;
|
|
40
|
-
};
|
|
41
|
-
get data(): string[][];
|
|
42
|
-
get cell(): Record<string, SheetCellMeta>;
|
|
43
|
-
get merge(): CellMerge[];
|
|
44
|
-
get columns(): SheetColumn[];
|
|
45
|
-
get structure(): SheetStructure;
|
|
46
|
-
get rowHeights(): number | number[];
|
|
47
|
-
get colWidths(): number | number[];
|
|
48
|
-
get meta(): SheetWindow;
|
|
49
|
-
private get totalRows();
|
|
50
|
-
private get totalCols();
|
|
51
|
-
private get startRow();
|
|
52
|
-
private get endRow();
|
|
53
|
-
private get denseRows();
|
|
54
|
-
private getCellAt;
|
|
55
|
-
private getAxisOffset;
|
|
56
|
-
private getMarkerLeft;
|
|
57
|
-
private getMarkerTop;
|
|
58
|
-
private getImages;
|
|
59
|
-
private getAllMerge;
|
|
60
|
-
private getData;
|
|
61
|
-
private getCell;
|
|
62
|
-
private getMerge;
|
|
63
|
-
private getRowHeights;
|
|
64
|
-
private getAllRowHeights;
|
|
65
|
-
private getAutoFitColumns;
|
|
66
|
-
private get autoFitColumns();
|
|
67
|
-
private getColumnMeta;
|
|
68
|
-
private getColWidths;
|
|
69
|
-
private getColumns;
|
|
70
|
-
private getStructure;
|
|
71
|
-
toObject(): object;
|
|
72
|
-
}
|
|
73
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
Binary file
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var Hn=Object.defineProperty;var Kn=(t,n,a)=>n in t?Hn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var S=(t,n,a)=>Kn(t,typeof n!="symbol"?n+"":n,a);const Vn="modulepreload",$n=function(t){return"/"+t},kt={},Xt=function(n,a,e){let i=Promise.resolve();if(a&&a.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=o?.nonce||o?.getAttribute("nonce");i=Promise.allSettled(a.map(_=>{if(_=$n(_),_ in kt)return;kt[_]=!0;const d=_.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${_}"]${l}`))return;const c=document.createElement("link");if(c.rel=d?"stylesheet":Vn,d||(c.as="script"),c.crossOrigin="",c.href=_,s&&c.setAttribute("nonce",s),document.head.appendChild(c),d)return new Promise((u,E)=>{c.addEventListener("load",u),c.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${_}`)))})}))}function r(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&r(s.reason);return n().catch(r)})};function zn(t){return{format:t.format,sourceName:t.sourceName,units:t.units,header:t.header??{},layers:t.layers??{},blocks:t.blocks??{},entities:t.entities??[],pages:t.pages,metadata:t.metadata??{},warnings:t.warnings??[],raw:t.raw}}function Ht(t){switch(String(t??"").toUpperCase()){case"LINE":return"line";case"CIRCLE":return"circle";case"ARC":return"arc";case"LWPOLYLINE":case"POLYLINE":case"POLYLINE_2D":case"POLYLINE2D":case"POLYLINE_3D":case"POLYLINE3D":case"LEADER":case"MULTILEADER":return"polyline";case"ELLIPSE":return"ellipse";case"TEXT":case"MTEXT":case"ATTRIB":case"ATTDEF":case"DIMENSION":return"text";case"POINT":return"point";case"INSERT":return"insert";case"SOLID":case"TRACE":case"3DFACE":return"solid";case"HATCH":return"hatch";case"SPLINE":return"spline";case"PATH":case"XPS_PATH":case"DWF_PATH":return"path";case"IMAGE":case"RASTER_IMAGE":case"DWF_IMAGE":return"image";case"VIEWPORT":return"viewport";default:return"unsupported"}}function Jn(t,n,a={}){const e=n??String(t.type??t.entityType??t.objectName??"UNKNOWN").toUpperCase(),i=a.includeUnknownProperties===!1?{type:e,kind:Ht(e)}:{...t,type:e,kind:Ht(e)};a.keepRaw&&(i.raw=t),i.handle=y(t.handle??t.id),i.layer=y(t.layer??t.layerName),i.lineType=y(t.lineType??t.linetype);const r=a.numericColorMode??"auto",o=N(t.color),s=N(t.colorIndex??t.colorNumber??t.aci??t.aciColor??t.color_index);i.colorIndex=s??(r!=="rgb"&&o!==void 0&&Math.abs(o)<=257?o:void 0);const _=t.trueColor??t.true_color??t.truecolor??t.colorRGB??t.colorRgb??t.rgbColor??t.rgb,d=o!==void 0&&o>=0&&o<=16777215&&(r==="rgb"||r==="auto"&&Math.abs(o)>257);i.trueColor=_??(d?o:void 0),(typeof t.color=="string"||typeof t.color=="number")&&(i.color=t.color),i.colorNumber=N(t.colorNumber)??i.colorNumber,i.colorName=y(t.colorName??t.color_name)??i.colorName,i.fillColor=t.fillColor??t.fill_color,i.fillColorIndex=N(t.fillColorIndex??t.fill_color_index??t.fillColorNumber)??i.fillColorIndex,i.opacity=N(t.opacity??t.alpha)??i.opacity,i.lineweight=N(t.lineweight??t.lineWeight),i.isVisible=!(t.isVisible===!1||t.visible===!1),i.startPoint=b(t.startPoint??t.start??t.p0??t.from)??i.startPoint,i.endPoint=b(t.endPoint??t.end??t.p1??t.to)??i.endPoint,i.center=b(t.center??t.centerPoint)??i.center,i.insertionPoint=b(t.insertionPoint??t.position??t.location??t.point??t.basePoint)??i.insertionPoint,i.radius=N(t.radius)??i.radius,i.startAngle=N(t.startAngle??t.start_angle)??i.startAngle,i.endAngle=N(t.endAngle??t.end_angle)??i.endAngle,i.majorAxisEndPoint=b(t.majorAxisEndPoint??t.majorAxis??t.major)??i.majorAxisEndPoint,i.axisRatio=N(t.axisRatio??t.ratio)??i.axisRatio,i.height=N(t.height??t.textHeight)??i.height,i.textHeight=N(t.textHeight??t.height)??i.textHeight,i.rotation=N(t.rotation??t.angle)??i.rotation,i.text=y(t.text??t.value??t.string??t.contents)??i.text,i.name=y(t.name??t.blockName)??i.name,i.blockName=y(t.blockName??t.name)??i.blockName;const l=Pt(t.vertices??t.points);l.length>0&&(i.vertices=l);const c=Pt(t.controlPoints??t.control_points);c.length>0&&(i.controlPoints=c);const u=Pt(t.fitPoints??t.fit_points);return u.length>0&&(i.fitPoints=u),i}function b(t){if(!t||typeof t!="object")return;const n=t,a=Number(n.x??n.X??n[0]),e=Number(n.y??n.Y??n[1]),i=n.z??n.Z??n[2],r=i===void 0?void 0:Number(i);if(!(!Number.isFinite(a)||!Number.isFinite(e)))return Number.isFinite(r)?{x:a,y:e,z:r}:{x:a,y:e}}function Pt(t){if(!Array.isArray(t))return[];const n=[];for(const a of t){const e=b(a);if(!e)continue;const i=a,r=e,o=N(i.bulge);o!==void 0&&(r.bulge=o);const s=N(i.startWidth??i.start_width);s!==void 0&&(r.startWidth=s);const _=N(i.endWidth??i.end_width);_!==void 0&&(r.endWidth=_),n.push(r)}return n}function Zn(t,n){n.name&&(t[n.name]=n,t[n.name.toLowerCase()]=n)}function qn(t,n){n.name&&(t[n.name]=n,t[n.name.toLowerCase()]=n)}function N(t){const n=Number(t);return Number.isFinite(n)?n:void 0}function y(t){if(typeof t!="string"&&typeof t!="number")return;const n=String(t);return n.length>0?n:void 0}function Qn(t){return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.slice().buffer}const jn={AC1009:"R12",AC1012:"R13",AC1014:"R14",AC1015:"R2000",AC1018:"R2004",AC1021:"R2007",AC1024:"R2010",AC1027:"R2013",AC1032:"R2018"};function te(t){const n=Array.from(t.slice(0,6),e=>String.fromCharCode(e)).join(""),a=jn[n]??"UNKNOWN";return{signature:n,release:a,supportedByOpenDesignSpec:a!=="UNKNOWN",notes:a==="UNKNOWN"?"Unknown or unsupported DWG signature.":void 0}}const Kt=new Map;async function ne(t,n={}){const a=performance.now(),e=n.sourceName;n.onProgress?.({phase:"detect",format:"dwg",message:"Validating DWG header…",total:t.byteLength});const i=te(t);if(!i.signature.startsWith("AC"))throw new Error(`Invalid DWG header: ${JSON.stringify(i.signature)}.`);n.onProgress?.({phase:"wasm-init",format:"dwg",message:"Initializing LibreDWG WebAssembly…",total:t.byteLength});const r=await Zt(n.wasmPath??"/wasm/");n.onProgress?.({phase:"parse",format:"dwg",message:`Decoding ${i.signature} DWG…`,total:t.byteLength,percent:35});const o=Qn(t),s=r.Dwg_File_Type?.DWG??0,_=r.instance.dwg_read_data(o,s);if(!_)throw new Error("LibreDWG returned an empty DWG result.");if(typeof _.error=="number"&&_.error!==0)throw new Error(`LibreDWG parse error code: ${_.error}.`);n.onProgress?.({phase:"normalize",format:"dwg",message:"Normalizing DWG database…",total:t.byteLength,percent:72});const d=typeof r.instance.convert=="function"?r.instance.convert(_):_;try{typeof r.instance.dwg_free=="function"&&r.instance.dwg_free(_)}catch{}const l=ee(d,e,i,{keepRaw:!!n.keepRaw}),c=performance.now()-a;return n.onProgress?.({phase:"done",format:"dwg",message:"DWG loaded.",total:t.byteLength,percent:100,elapsedMs:c}),{document:l,raw:n.keepRaw?d:void 0,bytes:t.byteLength,elapsedMs:c,format:"dwg",warnings:l.warnings}}async function Zt(t="/wasm/"){const n=se(t);let a=Kt.get(n);a||(a=Xt(()=>Promise.resolve().then(()=>Jt),[]).then(async r=>{const o=r,s=o.LibreDwg;if(!s||typeof s.create!="function")throw new Error("@mlightcad/libredwg-web did not expose LibreDwg.create().");try{if(typeof o.createModule=="function"&&typeof s.createByWasmInstance=="function"){const _=Vt(n),d=await de(_),l=await o.createModule({wasmBinary:d,locateFile:c=>new URL(c,jt(n)).href});return s.createByWasmInstance(l)}return await s.create(n)}catch(_){const d=_ instanceof Error?_.message:String(_);throw new Error(`Failed to initialize LibreDWG WebAssembly from ${n}. Ensure libredwg-web.wasm is deployed at ${Vt(n)} and wasmPath is resolved relative to the page, not the worker script. Run npm run copy:wasm before dev/build. Original error: ${d}`)}}),Kt.set(n,a));const e=await a,i=await Xt(()=>Promise.resolve().then(()=>Jt),void 0);return{module:i,instance:e,Dwg_File_Type:i.Dwg_File_Type}}function ee(t,n,a,e={}){const i=t&&typeof t=="object"?t:{},r=oe(i,e),o=re(i,e),s=Array.isArray(i.entities)?i.entities:[],_={keepRaw:!!e.keepRaw,includeUnknownProperties:!!e.keepRaw},d=s.filter(c=>!!c&&typeof c=="object").map(c=>qt(c,_)),l=zn({format:"dwg",sourceName:n,header:ie(i.header,a),layers:r,blocks:o,entities:d,metadata:{parser:"@mlightcad/libredwg-web",parserMode:"wasm",version:a},warnings:[],raw:e.keepRaw?t:void 0});return d.length===0&&l.warnings.push("DWG parsed successfully but no model-space entities were exposed by the converter. Check layout/paper-space content or unsupported proxy objects."),l}function qt(t,n){const a=Jn(t,void 0,{...n,numericColorMode:"rgb"}),e=N(t.color);return e!==void 0&&e>=0&&e<=16777215&&(a.color=e,a.trueColor=e),a.colorIndex=N(t.colorIndex??t.colorNumber??t.aci)??a.colorIndex,a.colorName=y(t.colorName??t.color_name)??a.colorName,a}function ae(t){return typeof t=="number"&&Number.isFinite(t)&&Math.abs(Math.trunc(t))>=1&&Math.abs(Math.trunc(t))<=255}function ie(t,n){const a=t&&typeof t=="object"?{...t}:{};return n&&(a.dwgVersion=n),a}function oe(t,n){const a={},e=[],i=t.tables;for(const r of["LAYER","layer","layers"]){const o=t[r]??i?.[r];o&&e.push(o)}for(const r of e)for(const o of Qt(r)){const s=o,_=y(s.name??s.layerName??s.entryName);if(!_)continue;const d=N(s.colorIndex??s.colorNumber),l=N(s.trueColor??s.true_color??s.truecolor??s.colorRGB??s.colorRgb??s.rgbColor??s.rgb),c=N(s.color),u=ae(d),E=l??(!u&&c!==void 0&&c>=0&&c<=16777215?c:void 0),f={name:_,color:u?void 0:s.color??s.colorName,colorIndex:d??(c!==void 0&&Math.abs(c)<=257?c:void 0),trueColor:E,lineType:y(s.lineType??s.linetype),lineweight:N(s.lineweight??s.lineWeight),isVisible:!(s.isVisible===!1||s.off===!0||Number(d??s.color??1)<0),isFrozen:!!(s.isFrozen??s.frozen),isLocked:!!(s.isLocked??s.locked),raw:n.keepRaw?s:void 0};Zn(a,f)}return a}function re(t,n){const a={},e=[t.blocks,t.blockHeaders,t.block_records,t.blockRecords],i=t.tables;e.push(i?.BLOCK,i?.BLOCK_RECORD,i?.blocks);const r={keepRaw:!!n.keepRaw,includeUnknownProperties:!!n.keepRaw};for(const o of e)for(const s of Qt(o)){const _=s,d=y(_.name??_.blockName??_.name2);if(!d)continue;const c=(Array.isArray(_.entities)?_.entities:Array.isArray(_.ownedObjects)?_.ownedObjects:[]).filter(u=>!!u&&typeof u=="object").map(u=>qt(u,r));qn(a,{name:d,basePoint:b(_.basePoint??_.origin)??{x:0,y:0},entities:c,raw:n.keepRaw?_:void 0})}return a}function Qt(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t!="object")return[];const n=t,a=Object.values(n).filter(i=>i&&typeof i=="object"),e=["entries","records","items","values","layers","blocks"].flatMap(i=>Array.isArray(n[i])?n[i]:[]);return e.length>0?e:a}function se(t){const n=t.trim()||"/wasm";if(n==="/")return $t();const a=n.replace(/\/+$/,"");return _e(a)?a:a.startsWith("/")?`${$t()}${a}`:new URL(a,tn()).href.replace(/\/+$/,"")}function Vt(t){return new URL("libredwg-web.wasm",jt(t)).href}function jt(t){return t.endsWith("/")?t:`${t}/`}function _e(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)}function tn(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof location<"u"&&location.href?location.href:"http://localhost/"}function $t(){return typeof location<"u"&&location.origin?location.origin:new URL(tn()).origin}async function de(t){if(typeof fetch!="function")throw new Error("fetch() is not available, so the LibreDWG WASM binary cannot be loaded.");const n=await fetch(t,{credentials:"same-origin",cache:"force-cache"});if(!n.ok)throw new Error(`WASM asset request failed with HTTP ${n.status} for ${t}.`);const a=new Uint8Array(await n.arrayBuffer());if(!le(a)){const e=Ee(a),i=n.headers.get("content-type")??"unknown content-type";throw new Error(`Invalid WASM asset at ${t}. Expected bytes 00 61 73 6d, got ${ce(a)} (${i}). The server probably returned an HTML fallback page instead of libredwg-web.wasm. Response preview: ${e}`)}return a}function le(t){return t.length>=4&&t[0]===0&&t[1]===97&&t[2]===115&&t[3]===109}function ce(t){return Array.from(t.slice(0,4)).map(n=>n.toString(16).padStart(2,"0")).join(" ")}function Ee(t){const n=Array.from(t.slice(0,32)).map(a=>a>=32&&a<=126?String.fromCharCode(a):".").join("");return JSON.stringify(n)}const H=self;H.postMessage({type:"ready"});H.onmessage=async t=>{const n=t.data;if(!n)return;const a=performance.now(),e=i=>{H.postMessage({type:"progress",requestId:n.requestId,progress:i})};try{if(n.type==="warmup"){e({phase:"wasm-init",format:"dwg",message:"Warming LibreDWG WebAssembly instance…"}),await Zt(n.options?.wasmPath??"/wasm/"),H.postMessage({type:"warmup-result",requestId:n.requestId,elapsedMs:performance.now()-a});return}if(n.type!=="load")return;e({phase:"worker-ready",format:"dwg",message:"DWG worker received file bytes.",total:n.bytes.byteLength});const i=await ne(new Uint8Array(n.bytes),{...n.options,sourceName:n.fileName,keepRaw:!!n.options?.keepRaw,onProgress:e});i.document.metadata.loaderMode="worker",i.elapsedMs=performance.now()-a,H.postMessage({type:"result",requestId:n.requestId,result:i})}catch(i){const r=ue(i);H.postMessage({type:"error",requestId:n.requestId,error:r})}};function ue(t){return t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:{message:String(t)}}var ft;(function(t){t[t.CP_UTF8=0]="CP_UTF8",t[t.CP_US_ASCII=1]="CP_US_ASCII",t[t.CP_ISO_8859_1=2]="CP_ISO_8859_1",t[t.CP_ISO_8859_2=3]="CP_ISO_8859_2",t[t.CP_ISO_8859_3=4]="CP_ISO_8859_3",t[t.CP_ISO_8859_4=5]="CP_ISO_8859_4",t[t.CP_ISO_8859_5=6]="CP_ISO_8859_5",t[t.CP_ISO_8859_6=7]="CP_ISO_8859_6",t[t.CP_ISO_8859_7=8]="CP_ISO_8859_7",t[t.CP_ISO_8859_8=9]="CP_ISO_8859_8",t[t.CP_ISO_8859_9=10]="CP_ISO_8859_9",t[t.CP_CP437=11]="CP_CP437",t[t.CP_CP850=12]="CP_CP850",t[t.CP_CP852=13]="CP_CP852",t[t.CP_CP855=14]="CP_CP855",t[t.CP_CP857=15]="CP_CP857",t[t.CP_CP860=16]="CP_CP860",t[t.CP_CP861=17]="CP_CP861",t[t.CP_CP863=18]="CP_CP863",t[t.CP_CP864=19]="CP_CP864",t[t.CP_CP865=20]="CP_CP865",t[t.CP_CP869=21]="CP_CP869",t[t.CP_CP932=22]="CP_CP932",t[t.CP_MACINTOSH=23]="CP_MACINTOSH",t[t.CP_BIG5=24]="CP_BIG5",t[t.CP_CP949=25]="CP_CP949",t[t.CP_JOHAB=26]="CP_JOHAB",t[t.CP_CP866=27]="CP_CP866",t[t.CP_ANSI_1250=28]="CP_ANSI_1250",t[t.CP_ANSI_1251=29]="CP_ANSI_1251",t[t.CP_ANSI_1252=30]="CP_ANSI_1252",t[t.CP_GB2312=31]="CP_GB2312",t[t.CP_ANSI_1253=32]="CP_ANSI_1253",t[t.CP_ANSI_1254=33]="CP_ANSI_1254",t[t.CP_ANSI_1255=34]="CP_ANSI_1255",t[t.CP_ANSI_1256=35]="CP_ANSI_1256",t[t.CP_ANSI_1257=36]="CP_ANSI_1257",t[t.CP_ANSI_874=37]="CP_ANSI_874",t[t.CP_ANSI_932=38]="CP_ANSI_932",t[t.CP_ANSI_936=39]="CP_ANSI_936",t[t.CP_ANSI_949=40]="CP_ANSI_949",t[t.CP_ANSI_950=41]="CP_ANSI_950",t[t.CP_ANSI_1361=42]="CP_ANSI_1361",t[t.CP_UTF16=43]="CP_UTF16",t[t.CP_ANSI_1258=44]="CP_ANSI_1258",t[t.CP_UNDEFINED=255]="CP_UNDEFINED"})(ft||(ft={}));const Ae=["utf-8","utf-8","iso-8859-1","iso-8859-2","iso-8859-3","iso-8859-4","iso-8859-5","iso-8859-6","iso-8859-7","iso-8859-8","iso-8859-9","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","shift-jis","macintosh","big5","utf-8","utf-8","ibm866","windows-1250","windows-1251","windows-1252","gbk","windows-1253","windows-1254","windows-1255","windows-1256","windows-1257","windows-874","shift-jis","gbk","euc-kr","big5","utf-8","utf-16le","windows-1258"],ht=t=>Ae[t];var Ct;(function(t){t[t.Rotated=0]="Rotated",t[t.Aligned=1]="Aligned",t[t.Angular=2]="Angular",t[t.Diameter=3]="Diameter",t[t.Radius=4]="Radius",t[t.Angular3Point=5]="Angular3Point",t[t.Ordinate=6]="Ordinate",t[t.ReferenceIsExclusive=32]="ReferenceIsExclusive",t[t.IsOrdinateXTypeFlag=64]="IsOrdinateXTypeFlag",t[t.IsCustomTextPositionFlag=128]="IsCustomTextPositionFlag"})(Ct||(Ct={}));var w;(function(t){t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"})(w||(w={}));var Rt;(function(t){t[t.AtLeast=1]="AtLeast",t[t.Exact=2]="Exact"})(Rt||(Rt={}));var Yt;(function(t){t[t.Center=0]="Center",t[t.Above=1]="Above",t[t.Outside=2]="Outside",t[t.JIS=3]="JIS",t[t.Below=4]="Below"})(Yt||(Yt={}));var gt;(function(t){t[t.Feet=0]="Feet",t[t.None=1]="None",t[t.Inch=2]="Inch",t[t.FeetAndInch=3]="FeetAndInch",t[t.Leading=4]="Leading",t[t.Trailing=8]="Trailing",t[t.LeadingAndTrailing=12]="LeadingAndTrailing"})(gt||(gt={}));var Lt;(function(t){t[t.None=0]="None",t[t.Leading=1]="Leading",t[t.Trailing=2]="Trailing",t[t.LeadingAndTrailing=3]="LeadingAndTrailing"})(Lt||(Lt={}));var vt;(function(t){t[t.Center=0]="Center",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.OverFirst=3]="OverFirst",t[t.OverSecond=4]="OverSecond"})(vt||(vt={}));var Nt;(function(t){t[t.Bottom=0]="Bottom",t[t.Center=1]="Center",t[t.Top=2]="Top"})(Nt||(Nt={}));var Q;(function(t){t[t.PatternFill=0]="PatternFill",t[t.SolidFill=1]="SolidFill"})(Q||(Q={}));var j;(function(t){t[t.NonAssociative=0]="NonAssociative",t[t.Associative=1]="Associative"})(j||(j={}));var St;(function(t){t[t.Normal=0]="Normal",t[t.Outer=1]="Outer",t[t.Ignore=2]="Ignore"})(St||(St={}));var Gt;(function(t){t[t.UserDefined=0]="UserDefined",t[t.Predefined=1]="Predefined",t[t.Custom=2]="Custom"})(Gt||(Gt={}));var Dt;(function(t){t[t.NotAnnotated=0]="NotAnnotated",t[t.Annotated=1]="Annotated"})(Dt||(Dt={}));var at;(function(t){t[t.Solid=0]="Solid",t[t.Gradient=1]="Gradient"})(at||(at={}));var tt;(function(t){t[t.TwoColor=0]="TwoColor",t[t.OneColor=1]="OneColor"})(tt||(tt={}));var pt;(function(t){t[t.Default=0]="Default",t[t.External=1]="External",t[t.Polyline=2]="Polyline",t[t.Derived=4]="Derived",t[t.Textbox=8]="Textbox",t[t.Outermost=16]="Outermost"})(pt||(pt={}));var F;(function(t){t[t.Line=1]="Line",t[t.Circular=2]="Circular",t[t.Elliptic=3]="Elliptic",t[t.Spline=4]="Spline"})(F||(F={}));var yt;(function(t){t[t.CLOSED_POLYLINE=1]="CLOSED_POLYLINE",t[t.CURVE_FIT=2]="CURVE_FIT",t[t.SPLINE_FIT=4]="SPLINE_FIT",t[t.POLYLINE_3D=8]="POLYLINE_3D",t[t.POLYGON_3D=16]="POLYGON_3D",t[t.CLOSED_POLYGON=32]="CLOSED_POLYGON",t[t.POLYFACE=64]="POLYFACE",t[t.CONTINUOUS=128]="CONTINUOUS"})(yt||(yt={}));var Wt;(function(t){t[t.NONE=0]="NONE",t[t.QUADRATIC=5]="QUADRATIC",t[t.CUBIC=6]="CUBIC",t[t.BEZIER=8]="BEZIER"})(Wt||(Wt={}));var Mt;(function(t){t[t.NONE=0]="NONE",t[t.MIRRORED_X=2]="MIRRORED_X",t[t.MIRRORED_Y=4]="MIRRORED_Y"})(Mt||(Mt={}));var nt;(function(t){t[t.LEFT=0]="LEFT",t[t.CENTER=1]="CENTER",t[t.RIGHT=2]="RIGHT",t[t.ALIGNED=3]="ALIGNED",t[t.MIDDLE=4]="MIDDLE",t[t.FIT=5]="FIT"})(nt||(nt={}));var mt;(function(t){t[t.BASELINE=0]="BASELINE",t[t.BOTTOM=1]="BOTTOM",t[t.MIDDLE=2]="MIDDLE",t[t.TOP=3]="TOP"})(mt||(mt={}));const nn=Object.freeze(["ACADMAINTVER","ACADVER","ANGBASE","ANGDIR","ATTMODE","AUNITS","AUPREC","CECOLOR","CELTSCALE","CELTYPE","CELWEIGHT","CEPSNID","CEPSNTYPE","CHAMFERA","CHAMFERB","CHAMFERC","CHAMFERD","CLAYER","CMLJUST","CMLSCALE","CMLSTYLE","CSHADOW","DIMADEC","DIMALT","DIMALTD","DIMALTF","DIMALTRND","DIMALTTD","DIMALTTZ","DIMALTU","DIMALTZ","DIMAPOST","DIMASO","DIMASSOC","DIMASZ","DIMATFIT","DIMAUNIT","DIMAZIN","DIMBLK","DIMBLK1","DIMBLK2","DIMCEN","DIMCLRD","DIMCLRE","DIMCLRT","DIMDEC","DIMDLE","DIMDLI","DIMDSEP","DIMEXE","DIMEXO","DIMFAC","DIMGAP","DIMJUST","DIMLDRBLK","DIMLFAC","DIMLIM","DIMLUNIT","DIMLWD","DIMLWE","DIMPOST","DIMRND","DIMSAH","DIMSCALE","DIMSD1","DIMSD2","DIMSE1","DIMSE2","DIMSHO","DIMSOXD","DIMSTYLE","DIMTAD","DIMTDEC","DIMTFAC","DIMTIH","DIMTIX","DIMTM","DIMTMOVE","DIMTOFL","DIMTOH","DIMTOL","DIMTOLJ","DIMTP","DIMTSZ","DIMTVP","DIMTXSTY","DIMTXT","DIMTZIN","DIMUPT","DIMZIN","DISPSILH","DRAGVS","DWGCODEPAGE","ELEVATION","ENDCAPS","EXTMAX","EXTMIN","EXTNAMES","FILLETRAD","FILLMODE","FINGERPRINTGUID","HALOGAP","HANDSEED","HIDETEXT","HYPERLINKBASE","INDEXCTL","INSBASE","INSUNITS","INTERFERECOLOR","INTERFEREOBJVS","INTERFEREVPVS","INTERSECTIONCOLOR","INTERSECTIONDISPLAY","JOINSTYLE","LIMCHECK","LIMMAX","LIMMIN","LTSCALE","LUNITS","LUPREC","LWDISPLAY","MAXACTVP","MEASUREMENT","MENU","MIRRTEXT","OBSCOLOR","OBSLTYPE","ORTHOMODE","PDMODE","PDSIZE","PELEVATION","PEXTMAX","PEXTMIN","PINSBASE","PLIMCHECK","PLIMMAX","PLIMMIN","PLINEGEN","PLINEWID","PROJECTNAME","PROXYGRAPHICS","PSLTSCALE","PSTYLEMODE","PSVPSCALE","PUCSBASE","PUCSNAME","PUCSORG","PUCSORGBACK","PUCSORGBOTTOM","PUCSORGFRONT","PUCSORGLEFT","PUCSORGRIGHT","PUCSORGTOP","PUCSORTHOREF","PUCSORTHOVIEW","PUCSXDIR","PUCSYDIR","QTEXTMODE","REGENMODE","SHADEDGE","SHADEDIF","SHADOWPLANELOCATION","SKETCHINC","SKPOLY","SORTENTS","SPLINESEGS","SPLINETYPE","SURFTAB1","SURFTAB2","SURFTYPE","SURFU","SURFV","TDCREATE","TDINDWG","TDUCREATE","TDUPDATE","TDUSRTIMER","TDUUPDATE","TEXTSIZE","TEXTSTYLE","THICKNESS","TILEMODE","TRACEWID","TREEDEPTH","UCSBASE","UCSNAME","UCSORG","UCSORGBACK","UCSORGBOTTOM","UCSORGFRONT","UCSORGLEFT","UCSORGRIGHT","UCSORGTOP","UCSORTHOREF","UCSORTHOVIEW","UCSXDIR","UCSYDIR","UNITMODE","USERI1","USERI2","USERI3","USERI4","USERI5","USERR1","USERR2","USERR3","USERR4","USERR5","USRTIMER","VERSIONGUID","VISRETAIN","WORLDVIEW","XCLIPFRAME","XEDIT"]);var xt;(function(t){t[t.NotApplicable=0]="NotApplicable",t[t.KeepExisting=1]="KeepExisting",t[t.UseClone=2]="UseClone",t[t.XrefName=3]="XrefName",t[t.Name=4]="Name",t[t.UnmangleName=5]="UnmangleName"})(xt||(xt={}));const en=[{type:"invalid",hdr:"INVALI",description:"No DWG",version:0},{type:"r1.1",hdr:"MC0.0",description:"MicroCAD Release 1.1",version:0},{type:"r1.2",hdr:"AC1.2",description:"AutoCAD Release 1.2",version:0},{type:"r1.3",hdr:"AC1.3",description:"AutoCAD Release 1.3",version:1},{type:"r1.4",hdr:"AC1.40",description:"AutoCAD Release 1.4",version:2},{type:"r2.0b",hdr:"AC1.50",description:"AutoCAD 2.0 beta",version:3},{type:"r2.0",hdr:"AC1.50",description:"AutoCAD Release 2.0",version:4},{type:"r2.10",hdr:"AC2.10",description:"AutoCAD Release 2.10",version:5},{type:"r2.21",hdr:"AC2.21",description:"AutoCAD Release 2.21",version:6},{type:"r2.22",hdr:"AC2.22",description:"AutoCAD Release 2.22",version:7},{type:"r2.4",hdr:"AC1001",description:"AutoCAD Release 2.4",version:8},{type:"r2.5",hdr:"AC1002",description:"AutoCAD Release 2.5",version:9},{type:"r2.6",hdr:"AC1003",description:"AutoCAD Release 2.6",version:10},{type:"r9",hdr:"AC1004",description:"AutoCAD Release 9",version:11},{type:"r9c1",hdr:"AC1005",description:"AutoCAD Release 9c1",version:12},{type:"r10",hdr:"AC1006",description:"AutoCAD Release 10",version:13},{type:"r11b1",hdr:"AC1007",description:"AutoCAD 11 beta 1",version:14},{type:"r11b2",hdr:"AC1008",description:"AutoCAD 11 beta 2",version:15},{type:"r11",hdr:"AC1009",description:"AutoCAD Release 11/12 (LT R1/R2)",version:16},{type:"r13b1",hdr:"AC1010",description:"AutoCAD pre-R13 a",version:17},{type:"r13b2",hdr:"AC1011",description:"AutoCAD pre-R13 b",version:18},{type:"r13",hdr:"AC1012",description:"AutoCAD Release 13",version:19},{type:"r13c3",hdr:"AC1013",description:"AutoCAD Release 13c3",version:20},{type:"r14",hdr:"AC1014",description:"AutoCAD Release 14",version:21},{type:"r2000b",hdr:"AC1500",description:"AutoCAD 2000 beta",version:22},{type:"r2000",hdr:"AC1015",description:"AutoCAD Release 2000",version:23},{type:"r2000i",hdr:"AC1016",description:"AutoCAD Release 2000i",version:23},{type:"r2002",hdr:"AC1017",description:"AutoCAD Release 2002",version:23},{type:"r2004a",hdr:"AC402a",description:"AutoCAD 2004 alpha a",version:24},{type:"r2004b",hdr:"AC402b",description:"AutoCAD 2004 alpha b",version:24},{type:"r2004c",hdr:"AC1018",description:"AutoCAD 2004 beta",version:24},{type:"r2004",hdr:"AC1018",description:"AutoCAD Release 2004",version:25},{type:"r2007a",hdr:"AC701a",description:"AutoCAD 2007 alpha",version:26},{type:"r2007b",hdr:"AC1021",description:"AutoCAD 2007 beta",version:26},{type:"r2007",hdr:"AC1021",description:"AutoCAD Release 2007",version:27},{type:"r2010b",hdr:"AC1024",description:"AutoCAD 2010 beta",version:28},{type:"r2010",hdr:"AC1024",description:"AutoCAD Release 2010",version:29},{type:"r2013b",hdr:"AC1027",description:"AutoCAD 2013 beta",version:30},{type:"r2013",hdr:"AC1027",description:"AutoCAD Release 2013",version:31},{type:"r2018b",hdr:"AC1032",description:"AutoCAD 2018 beta",version:32},{type:"r2018",hdr:"AC1032",description:"AutoCAD Release 2018",version:33},{type:"r2022b",hdr:"AC103-4",description:"AutoCAD 2022 beta",version:36},{type:"r>2022",hdr:"",description:"AutoCAD Release >2022",version:0}];async function Ot(t={}){const n=Ie(t),a=await import(n),e=a.default??a.createModule??a;if(typeof e!="function")throw new Error(`LibreDWG runtime module at ${n} did not export a createModule function.`);return e(t)}function Ie(t){const n=t.locateFile;if(typeof n=="function")try{const a=n("libredwg-web.js","");if(typeof a=="string"&&a.length>0)return a}catch{}return typeof document<"u"&&document.baseURI?new URL("wasm/libredwg-web.js",document.baseURI).href:typeof location<"u"&&location.href?new URL("/wasm/libredwg-web.js",location.origin).href:"/wasm/libredwg-web.js"}var wt;(function(t){t[t.DWG_SUPERTYPE_ENTITY=0]="DWG_SUPERTYPE_ENTITY",t[t.DWG_SUPERTYPE_OBJECT=1]="DWG_SUPERTYPE_OBJECT"})(wt||(wt={}));var P;(function(t){t[t.DWG_TYPE_UNUSED=0]="DWG_TYPE_UNUSED",t[t.DWG_TYPE_TEXT=1]="DWG_TYPE_TEXT",t[t.DWG_TYPE_ATTRIB=2]="DWG_TYPE_ATTRIB",t[t.DWG_TYPE_ATTDEF=3]="DWG_TYPE_ATTDEF",t[t.DWG_TYPE_BLOCK=4]="DWG_TYPE_BLOCK",t[t.DWG_TYPE_ENDBLK=5]="DWG_TYPE_ENDBLK",t[t.DWG_TYPE_SEQEND=6]="DWG_TYPE_SEQEND",t[t.DWG_TYPE_INSERT=7]="DWG_TYPE_INSERT",t[t.DWG_TYPE_MINSERT=8]="DWG_TYPE_MINSERT",t[t.DWG_TYPE_VERTEX_2D=10]="DWG_TYPE_VERTEX_2D",t[t.DWG_TYPE_VERTEX_3D=11]="DWG_TYPE_VERTEX_3D",t[t.DWG_TYPE_VERTEX_MESH=12]="DWG_TYPE_VERTEX_MESH",t[t.DWG_TYPE_VERTEX_PFACE=13]="DWG_TYPE_VERTEX_PFACE",t[t.DWG_TYPE_VERTEX_PFACE_FACE=14]="DWG_TYPE_VERTEX_PFACE_FACE",t[t.DWG_TYPE_POLYLINE_2D=15]="DWG_TYPE_POLYLINE_2D",t[t.DWG_TYPE_POLYLINE_3D=16]="DWG_TYPE_POLYLINE_3D",t[t.DWG_TYPE_ARC=17]="DWG_TYPE_ARC",t[t.DWG_TYPE_CIRCLE=18]="DWG_TYPE_CIRCLE",t[t.DWG_TYPE_LINE=19]="DWG_TYPE_LINE",t[t.DWG_TYPE_DIMENSION_ORDINATE=20]="DWG_TYPE_DIMENSION_ORDINATE",t[t.DWG_TYPE_DIMENSION_LINEAR=21]="DWG_TYPE_DIMENSION_LINEAR",t[t.DWG_TYPE_DIMENSION_ALIGNED=22]="DWG_TYPE_DIMENSION_ALIGNED",t[t.DWG_TYPE_DIMENSION_ANG3PT=23]="DWG_TYPE_DIMENSION_ANG3PT",t[t.DWG_TYPE_DIMENSION_ANG2LN=24]="DWG_TYPE_DIMENSION_ANG2LN",t[t.DWG_TYPE_DIMENSION_RADIUS=25]="DWG_TYPE_DIMENSION_RADIUS",t[t.DWG_TYPE_DIMENSION_DIAMETER=26]="DWG_TYPE_DIMENSION_DIAMETER",t[t.DWG_TYPE_POINT=27]="DWG_TYPE_POINT",t[t.DWG_TYPE_3DFACE=28]="DWG_TYPE_3DFACE",t[t.DWG_TYPE_POLYLINE_PFACE=29]="DWG_TYPE_POLYLINE_PFACE",t[t.DWG_TYPE_POLYLINE_MESH=30]="DWG_TYPE_POLYLINE_MESH",t[t.DWG_TYPE_SOLID=31]="DWG_TYPE_SOLID",t[t.DWG_TYPE_TRACE=32]="DWG_TYPE_TRACE",t[t.DWG_TYPE_SHAPE=33]="DWG_TYPE_SHAPE",t[t.DWG_TYPE_VIEWPORT=34]="DWG_TYPE_VIEWPORT",t[t.DWG_TYPE_ELLIPSE=35]="DWG_TYPE_ELLIPSE",t[t.DWG_TYPE_SPLINE=36]="DWG_TYPE_SPLINE",t[t.DWG_TYPE_REGION=37]="DWG_TYPE_REGION",t[t.DWG_TYPE_3DSOLID=38]="DWG_TYPE_3DSOLID",t[t.DWG_TYPE_BODY=39]="DWG_TYPE_BODY",t[t.DWG_TYPE_RAY=40]="DWG_TYPE_RAY",t[t.DWG_TYPE_XLINE=41]="DWG_TYPE_XLINE",t[t.DWG_TYPE_DICTIONARY=42]="DWG_TYPE_DICTIONARY",t[t.DWG_TYPE_OLEFRAME=43]="DWG_TYPE_OLEFRAME",t[t.DWG_TYPE_MTEXT=44]="DWG_TYPE_MTEXT",t[t.DWG_TYPE_LEADER=45]="DWG_TYPE_LEADER",t[t.DWG_TYPE_TOLERANCE=46]="DWG_TYPE_TOLERANCE",t[t.DWG_TYPE_MLINE=47]="DWG_TYPE_MLINE",t[t.DWG_TYPE_BLOCK_CONTROL=48]="DWG_TYPE_BLOCK_CONTROL",t[t.DWG_TYPE_BLOCK_HEADER=49]="DWG_TYPE_BLOCK_HEADER",t[t.DWG_TYPE_LAYER_CONTROL=50]="DWG_TYPE_LAYER_CONTROL",t[t.DWG_TYPE_LAYER=51]="DWG_TYPE_LAYER",t[t.DWG_TYPE_STYLE_CONTROL=52]="DWG_TYPE_STYLE_CONTROL",t[t.DWG_TYPE_STYLE=53]="DWG_TYPE_STYLE",t[t.DWG_TYPE_LTYPE_CONTROL=56]="DWG_TYPE_LTYPE_CONTROL",t[t.DWG_TYPE_LTYPE=57]="DWG_TYPE_LTYPE",t[t.DWG_TYPE_VIEW_CONTROL=60]="DWG_TYPE_VIEW_CONTROL",t[t.DWG_TYPE_VIEW=61]="DWG_TYPE_VIEW",t[t.DWG_TYPE_UCS_CONTROL=62]="DWG_TYPE_UCS_CONTROL",t[t.DWG_TYPE_UCS=63]="DWG_TYPE_UCS",t[t.DWG_TYPE_VPORT_CONTROL=64]="DWG_TYPE_VPORT_CONTROL",t[t.DWG_TYPE_VPORT=65]="DWG_TYPE_VPORT",t[t.DWG_TYPE_APPID_CONTROL=66]="DWG_TYPE_APPID_CONTROL",t[t.DWG_TYPE_APPID=67]="DWG_TYPE_APPID",t[t.DWG_TYPE_DIMSTYLE_CONTROL=68]="DWG_TYPE_DIMSTYLE_CONTROL",t[t.DWG_TYPE_DIMSTYLE=69]="DWG_TYPE_DIMSTYLE",t[t.DWG_TYPE_VX_CONTROL=70]="DWG_TYPE_VX_CONTROL",t[t.DWG_TYPE_VX_TABLE_RECORD=71]="DWG_TYPE_VX_TABLE_RECORD",t[t.DWG_TYPE_GROUP=72]="DWG_TYPE_GROUP",t[t.DWG_TYPE_MLINESTYLE=73]="DWG_TYPE_MLINESTYLE",t[t.DWG_TYPE_OLE2FRAME=74]="DWG_TYPE_OLE2FRAME",t[t.DWG_TYPE_DUMMY=75]="DWG_TYPE_DUMMY",t[t.DWG_TYPE_LONG_TRANSACTION=76]="DWG_TYPE_LONG_TRANSACTION",t[t.DWG_TYPE_LWPOLYLINE=77]="DWG_TYPE_LWPOLYLINE",t[t.DWG_TYPE_HATCH=78]="DWG_TYPE_HATCH",t[t.DWG_TYPE_XRECORD=79]="DWG_TYPE_XRECORD",t[t.DWG_TYPE_PLACEHOLDER=80]="DWG_TYPE_PLACEHOLDER",t[t.DWG_TYPE_VBA_PROJECT=81]="DWG_TYPE_VBA_PROJECT",t[t.DWG_TYPE_LAYOUT=82]="DWG_TYPE_LAYOUT",t[t.DWG_TYPE_PROXY_ENTITY=498]="DWG_TYPE_PROXY_ENTITY",t[t.DWG_TYPE_PROXY_OBJECT=499]="DWG_TYPE_PROXY_OBJECT",t[t.DWG_TYPE_ACDSRECORD=500]="DWG_TYPE_ACDSRECORD",t[t.DWG_TYPE_ACDSSCHEMA=501]="DWG_TYPE_ACDSSCHEMA",t[t.DWG_TYPE_ACMECOMMANDHISTORY=502]="DWG_TYPE_ACMECOMMANDHISTORY",t[t.DWG_TYPE_ACMESCOPE=503]="DWG_TYPE_ACMESCOPE",t[t.DWG_TYPE_ACMESTATEMGR=504]="DWG_TYPE_ACMESTATEMGR",t[t.DWG_TYPE_ACSH_BOOLEAN_CLASS=505]="DWG_TYPE_ACSH_BOOLEAN_CLASS",t[t.DWG_TYPE_ACSH_BOX_CLASS=506]="DWG_TYPE_ACSH_BOX_CLASS",t[t.DWG_TYPE_ACSH_BREP_CLASS=507]="DWG_TYPE_ACSH_BREP_CLASS",t[t.DWG_TYPE_ACSH_CHAMFER_CLASS=508]="DWG_TYPE_ACSH_CHAMFER_CLASS",t[t.DWG_TYPE_ACSH_CONE_CLASS=509]="DWG_TYPE_ACSH_CONE_CLASS",t[t.DWG_TYPE_ACSH_CYLINDER_CLASS=510]="DWG_TYPE_ACSH_CYLINDER_CLASS",t[t.DWG_TYPE_ACSH_EXTRUSION_CLASS=511]="DWG_TYPE_ACSH_EXTRUSION_CLASS",t[t.DWG_TYPE_ACSH_FILLET_CLASS=512]="DWG_TYPE_ACSH_FILLET_CLASS",t[t.DWG_TYPE_ACSH_HISTORY_CLASS=513]="DWG_TYPE_ACSH_HISTORY_CLASS",t[t.DWG_TYPE_ACSH_LOFT_CLASS=514]="DWG_TYPE_ACSH_LOFT_CLASS",t[t.DWG_TYPE_ACSH_PYRAMID_CLASS=515]="DWG_TYPE_ACSH_PYRAMID_CLASS",t[t.DWG_TYPE_ACSH_REVOLVE_CLASS=516]="DWG_TYPE_ACSH_REVOLVE_CLASS",t[t.DWG_TYPE_ACSH_SPHERE_CLASS=517]="DWG_TYPE_ACSH_SPHERE_CLASS",t[t.DWG_TYPE_ACSH_SWEEP_CLASS=518]="DWG_TYPE_ACSH_SWEEP_CLASS",t[t.DWG_TYPE_ACSH_TORUS_CLASS=519]="DWG_TYPE_ACSH_TORUS_CLASS",t[t.DWG_TYPE_ACSH_WEDGE_CLASS=520]="DWG_TYPE_ACSH_WEDGE_CLASS",t[t.DWG_TYPE_ALDIMOBJECTCONTEXTDATA=521]="DWG_TYPE_ALDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_ALIGNMENTPARAMETERENTITY=522]="DWG_TYPE_ALIGNMENTPARAMETERENTITY",t[t.DWG_TYPE_ANGDIMOBJECTCONTEXTDATA=523]="DWG_TYPE_ANGDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA=524]="DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA",t[t.DWG_TYPE_ARCALIGNEDTEXT=525]="DWG_TYPE_ARCALIGNEDTEXT",t[t.DWG_TYPE_ARC_DIMENSION=526]="DWG_TYPE_ARC_DIMENSION",t[t.DWG_TYPE_ASSOC2DCONSTRAINTGROUP=527]="DWG_TYPE_ASSOC2DCONSTRAINTGROUP",t[t.DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY=528]="DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY",t[t.DWG_TYPE_ASSOCACTION=529]="DWG_TYPE_ASSOCACTION",t[t.DWG_TYPE_ASSOCACTIONPARAM=530]="DWG_TYPE_ASSOCACTIONPARAM",t[t.DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY=531]="DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYACTIONBODY=532]="DWG_TYPE_ASSOCARRAYACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY=533]="DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS=534]="DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYPATHPARAMETERS=535]="DWG_TYPE_ASSOCARRAYPATHPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYPOLARPARAMETERS=536]="DWG_TYPE_ASSOCARRAYPOLARPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS=537]="DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS",t[t.DWG_TYPE_ASSOCASMBODYACTIONPARAM=538]="DWG_TYPE_ASSOCASMBODYACTIONPARAM",t[t.DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY=539]="DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM=540]="DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM",t[t.DWG_TYPE_ASSOCDEPENDENCY=541]="DWG_TYPE_ASSOCDEPENDENCY",t[t.DWG_TYPE_ASSOCDIMDEPENDENCYBODY=542]="DWG_TYPE_ASSOCDIMDEPENDENCYBODY",t[t.DWG_TYPE_ASSOCEDGEACTIONPARAM=543]="DWG_TYPE_ASSOCEDGEACTIONPARAM",t[t.DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY=544]="DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY",t[t.DWG_TYPE_ASSOCEDGEFILLETACTIONBODY=545]="DWG_TYPE_ASSOCEDGEFILLETACTIONBODY",t[t.DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY=546]="DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY=547]="DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCFACEACTIONPARAM=548]="DWG_TYPE_ASSOCFACEACTIONPARAM",t[t.DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY=549]="DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCGEOMDEPENDENCY=550]="DWG_TYPE_ASSOCGEOMDEPENDENCY",t[t.DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY=551]="DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCMLEADERACTIONBODY=552]="DWG_TYPE_ASSOCMLEADERACTIONBODY",t[t.DWG_TYPE_ASSOCNETWORK=553]="DWG_TYPE_ASSOCNETWORK",t[t.DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY=554]="DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCOBJECTACTIONPARAM=555]="DWG_TYPE_ASSOCOBJECTACTIONPARAM",t[t.DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY=556]="DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCORDINATEDIMACTIONBODY=557]="DWG_TYPE_ASSOCORDINATEDIMACTIONBODY",t[t.DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM=558]="DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM",t[t.DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY=559]="DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCPATHACTIONPARAM=560]="DWG_TYPE_ASSOCPATHACTIONPARAM",t[t.DWG_TYPE_ASSOCPERSSUBENTMANAGER=561]="DWG_TYPE_ASSOCPERSSUBENTMANAGER",t[t.DWG_TYPE_ASSOCPLANESURFACEACTIONBODY=562]="DWG_TYPE_ASSOCPLANESURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCPOINTREFACTIONPARAM=563]="DWG_TYPE_ASSOCPOINTREFACTIONPARAM",t[t.DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY=564]="DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY",t[t.DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY=565]="DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCROTATEDDIMACTIONBODY=566]="DWG_TYPE_ASSOCROTATEDDIMACTIONBODY",t[t.DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY=567]="DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY=568]="DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCVALUEDEPENDENCY=569]="DWG_TYPE_ASSOCVALUEDEPENDENCY",t[t.DWG_TYPE_ASSOCVARIABLE=570]="DWG_TYPE_ASSOCVARIABLE",t[t.DWG_TYPE_ASSOCVERTEXACTIONPARAM=571]="DWG_TYPE_ASSOCVERTEXACTIONPARAM",t[t.DWG_TYPE_BASEPOINTPARAMETERENTITY=572]="DWG_TYPE_BASEPOINTPARAMETERENTITY",t[t.DWG_TYPE_BLKREFOBJECTCONTEXTDATA=573]="DWG_TYPE_BLKREFOBJECTCONTEXTDATA",t[t.DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER=574]="DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKALIGNMENTGRIP=575]="DWG_TYPE_BLOCKALIGNMENTGRIP",t[t.DWG_TYPE_BLOCKALIGNMENTPARAMETER=576]="DWG_TYPE_BLOCKALIGNMENTPARAMETER",t[t.DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER=577]="DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKARRAYACTION=578]="DWG_TYPE_BLOCKARRAYACTION",t[t.DWG_TYPE_BLOCKBASEPOINTPARAMETER=579]="DWG_TYPE_BLOCKBASEPOINTPARAMETER",t[t.DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER=580]="DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKFLIPACTION=581]="DWG_TYPE_BLOCKFLIPACTION",t[t.DWG_TYPE_BLOCKFLIPGRIP=582]="DWG_TYPE_BLOCKFLIPGRIP",t[t.DWG_TYPE_BLOCKFLIPPARAMETER=583]="DWG_TYPE_BLOCKFLIPPARAMETER",t[t.DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT=584]="DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT",t[t.DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER=585]="DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER=586]="DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKLINEARGRIP=587]="DWG_TYPE_BLOCKLINEARGRIP",t[t.DWG_TYPE_BLOCKLINEARPARAMETER=588]="DWG_TYPE_BLOCKLINEARPARAMETER",t[t.DWG_TYPE_BLOCKLOOKUPACTION=589]="DWG_TYPE_BLOCKLOOKUPACTION",t[t.DWG_TYPE_BLOCKLOOKUPGRIP=590]="DWG_TYPE_BLOCKLOOKUPGRIP",t[t.DWG_TYPE_BLOCKLOOKUPPARAMETER=591]="DWG_TYPE_BLOCKLOOKUPPARAMETER",t[t.DWG_TYPE_BLOCKMOVEACTION=592]="DWG_TYPE_BLOCKMOVEACTION",t[t.DWG_TYPE_BLOCKPARAMDEPENDENCYBODY=593]="DWG_TYPE_BLOCKPARAMDEPENDENCYBODY",t[t.DWG_TYPE_BLOCKPOINTPARAMETER=594]="DWG_TYPE_BLOCKPOINTPARAMETER",t[t.DWG_TYPE_BLOCKPOLARGRIP=595]="DWG_TYPE_BLOCKPOLARGRIP",t[t.DWG_TYPE_BLOCKPOLARPARAMETER=596]="DWG_TYPE_BLOCKPOLARPARAMETER",t[t.DWG_TYPE_BLOCKPOLARSTRETCHACTION=597]="DWG_TYPE_BLOCKPOLARSTRETCHACTION",t[t.DWG_TYPE_BLOCKPROPERTIESTABLE=598]="DWG_TYPE_BLOCKPROPERTIESTABLE",t[t.DWG_TYPE_BLOCKPROPERTIESTABLEGRIP=599]="DWG_TYPE_BLOCKPROPERTIESTABLEGRIP",t[t.DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER=600]="DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKREPRESENTATION=601]="DWG_TYPE_BLOCKREPRESENTATION",t[t.DWG_TYPE_BLOCKROTATEACTION=602]="DWG_TYPE_BLOCKROTATEACTION",t[t.DWG_TYPE_BLOCKROTATIONGRIP=603]="DWG_TYPE_BLOCKROTATIONGRIP",t[t.DWG_TYPE_BLOCKROTATIONPARAMETER=604]="DWG_TYPE_BLOCKROTATIONPARAMETER",t[t.DWG_TYPE_BLOCKSCALEACTION=605]="DWG_TYPE_BLOCKSCALEACTION",t[t.DWG_TYPE_BLOCKSTRETCHACTION=606]="DWG_TYPE_BLOCKSTRETCHACTION",t[t.DWG_TYPE_BLOCKUSERPARAMETER=607]="DWG_TYPE_BLOCKUSERPARAMETER",t[t.DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER=608]="DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKVISIBILITYGRIP=609]="DWG_TYPE_BLOCKVISIBILITYGRIP",t[t.DWG_TYPE_BLOCKVISIBILITYPARAMETER=610]="DWG_TYPE_BLOCKVISIBILITYPARAMETER",t[t.DWG_TYPE_BLOCKXYGRIP=611]="DWG_TYPE_BLOCKXYGRIP",t[t.DWG_TYPE_BLOCKXYPARAMETER=612]="DWG_TYPE_BLOCKXYPARAMETER",t[t.DWG_TYPE_CAMERA=613]="DWG_TYPE_CAMERA",t[t.DWG_TYPE_CELLSTYLEMAP=614]="DWG_TYPE_CELLSTYLEMAP",t[t.DWG_TYPE_CONTEXTDATAMANAGER=615]="DWG_TYPE_CONTEXTDATAMANAGER",t[t.DWG_TYPE_CSACDOCUMENTOPTIONS=616]="DWG_TYPE_CSACDOCUMENTOPTIONS",t[t.DWG_TYPE_CURVEPATH=617]="DWG_TYPE_CURVEPATH",t[t.DWG_TYPE_DATALINK=618]="DWG_TYPE_DATALINK",t[t.DWG_TYPE_DATATABLE=619]="DWG_TYPE_DATATABLE",t[t.DWG_TYPE_DBCOLOR=620]="DWG_TYPE_DBCOLOR",t[t.DWG_TYPE_DETAILVIEWSTYLE=621]="DWG_TYPE_DETAILVIEWSTYLE",t[t.DWG_TYPE_DGNDEFINITION=622]="DWG_TYPE_DGNDEFINITION",t[t.DWG_TYPE_DGNUNDERLAY=623]="DWG_TYPE_DGNUNDERLAY",t[t.DWG_TYPE_DICTIONARYVAR=624]="DWG_TYPE_DICTIONARYVAR",t[t.DWG_TYPE_DICTIONARYWDFLT=625]="DWG_TYPE_DICTIONARYWDFLT",t[t.DWG_TYPE_DIMASSOC=626]="DWG_TYPE_DIMASSOC",t[t.DWG_TYPE_DMDIMOBJECTCONTEXTDATA=627]="DWG_TYPE_DMDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_DWFDEFINITION=628]="DWG_TYPE_DWFDEFINITION",t[t.DWG_TYPE_DWFUNDERLAY=629]="DWG_TYPE_DWFUNDERLAY",t[t.DWG_TYPE_DYNAMICBLOCKPROXYNODE=630]="DWG_TYPE_DYNAMICBLOCKPROXYNODE",t[t.DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER=631]="DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER",t[t.DWG_TYPE_EVALUATION_GRAPH=632]="DWG_TYPE_EVALUATION_GRAPH",t[t.DWG_TYPE_EXTRUDEDSURFACE=633]="DWG_TYPE_EXTRUDEDSURFACE",t[t.DWG_TYPE_FCFOBJECTCONTEXTDATA=634]="DWG_TYPE_FCFOBJECTCONTEXTDATA",t[t.DWG_TYPE_FIELD=635]="DWG_TYPE_FIELD",t[t.DWG_TYPE_FIELDLIST=636]="DWG_TYPE_FIELDLIST",t[t.DWG_TYPE_FLIPPARAMETERENTITY=637]="DWG_TYPE_FLIPPARAMETERENTITY",t[t.DWG_TYPE_FLIPACTIONENTITY=638]="DWG_TYPE_FLIPACTIONENTITY",t[t.DWG_TYPE_GEODATA=639]="DWG_TYPE_GEODATA",t[t.DWG_TYPE_GEOMAPIMAGE=640]="DWG_TYPE_GEOMAPIMAGE",t[t.DWG_TYPE_GEOPOSITIONMARKER=641]="DWG_TYPE_GEOPOSITIONMARKER",t[t.DWG_TYPE_GRADIENT_BACKGROUND=642]="DWG_TYPE_GRADIENT_BACKGROUND",t[t.DWG_TYPE_GROUND_PLANE_BACKGROUND=643]="DWG_TYPE_GROUND_PLANE_BACKGROUND",t[t.DWG_TYPE_HELIX=644]="DWG_TYPE_HELIX",t[t.DWG_TYPE_IBL_BACKGROUND=645]="DWG_TYPE_IBL_BACKGROUND",t[t.DWG_TYPE_IDBUFFER=646]="DWG_TYPE_IDBUFFER",t[t.DWG_TYPE_IMAGE=647]="DWG_TYPE_IMAGE",t[t.DWG_TYPE_IMAGEDEF=648]="DWG_TYPE_IMAGEDEF",t[t.DWG_TYPE_IMAGEDEF_REACTOR=649]="DWG_TYPE_IMAGEDEF_REACTOR",t[t.DWG_TYPE_IMAGE_BACKGROUND=650]="DWG_TYPE_IMAGE_BACKGROUND",t[t.DWG_TYPE_INDEX=651]="DWG_TYPE_INDEX",t[t.DWG_TYPE_LARGE_RADIAL_DIMENSION=652]="DWG_TYPE_LARGE_RADIAL_DIMENSION",t[t.DWG_TYPE_LAYERFILTER=653]="DWG_TYPE_LAYERFILTER",t[t.DWG_TYPE_LAYER_INDEX=654]="DWG_TYPE_LAYER_INDEX",t[t.DWG_TYPE_LAYOUTPRINTCONFIG=655]="DWG_TYPE_LAYOUTPRINTCONFIG",t[t.DWG_TYPE_LEADEROBJECTCONTEXTDATA=656]="DWG_TYPE_LEADEROBJECTCONTEXTDATA",t[t.DWG_TYPE_LIGHT=657]="DWG_TYPE_LIGHT",t[t.DWG_TYPE_LIGHTLIST=658]="DWG_TYPE_LIGHTLIST",t[t.DWG_TYPE_LINEARPARAMETERENTITY=659]="DWG_TYPE_LINEARPARAMETERENTITY",t[t.DWG_TYPE_LOFTEDSURFACE=660]="DWG_TYPE_LOFTEDSURFACE",t[t.DWG_TYPE_MATERIAL=661]="DWG_TYPE_MATERIAL",t[t.DWG_TYPE_MENTALRAYRENDERSETTINGS=662]="DWG_TYPE_MENTALRAYRENDERSETTINGS",t[t.DWG_TYPE_MESH=663]="DWG_TYPE_MESH",t[t.DWG_TYPE_MLEADEROBJECTCONTEXTDATA=664]="DWG_TYPE_MLEADEROBJECTCONTEXTDATA",t[t.DWG_TYPE_MLEADERSTYLE=665]="DWG_TYPE_MLEADERSTYLE",t[t.DWG_TYPE_MOVEACTIONENTITY=666]="DWG_TYPE_MOVEACTIONENTITY",t[t.DWG_TYPE_MOTIONPATH=667]="DWG_TYPE_MOTIONPATH",t[t.DWG_TYPE_MPOLYGON=668]="DWG_TYPE_MPOLYGON",t[t.DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA=669]="DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA",t[t.DWG_TYPE_MTEXTOBJECTCONTEXTDATA=670]="DWG_TYPE_MTEXTOBJECTCONTEXTDATA",t[t.DWG_TYPE_MULTILEADER=671]="DWG_TYPE_MULTILEADER",t[t.DWG_TYPE_NAVISWORKSMODEL=672]="DWG_TYPE_NAVISWORKSMODEL",t[t.DWG_TYPE_NAVISWORKSMODELDEF=673]="DWG_TYPE_NAVISWORKSMODELDEF",t[t.DWG_TYPE_NPOCOLLECTION=674]="DWG_TYPE_NPOCOLLECTION",t[t.DWG_TYPE_NURBSURFACE=675]="DWG_TYPE_NURBSURFACE",t[t.DWG_TYPE_OBJECT_PTR=676]="DWG_TYPE_OBJECT_PTR",t[t.DWG_TYPE_ORDDIMOBJECTCONTEXTDATA=677]="DWG_TYPE_ORDDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_PARTIAL_VIEWING_INDEX=678]="DWG_TYPE_PARTIAL_VIEWING_INDEX",t[t.DWG_TYPE_PDFDEFINITION=679]="DWG_TYPE_PDFDEFINITION",t[t.DWG_TYPE_PDFUNDERLAY=680]="DWG_TYPE_PDFUNDERLAY",t[t.DWG_TYPE_PERSUBENTMGR=681]="DWG_TYPE_PERSUBENTMGR",t[t.DWG_TYPE_PLANESURFACE=682]="DWG_TYPE_PLANESURFACE",t[t.DWG_TYPE_PLOTSETTINGS=683]="DWG_TYPE_PLOTSETTINGS",t[t.DWG_TYPE_POINTCLOUD=684]="DWG_TYPE_POINTCLOUD",t[t.DWG_TYPE_POINTCLOUDCOLORMAP=685]="DWG_TYPE_POINTCLOUDCOLORMAP",t[t.DWG_TYPE_POINTCLOUDDEF=686]="DWG_TYPE_POINTCLOUDDEF",t[t.DWG_TYPE_POINTCLOUDDEFEX=687]="DWG_TYPE_POINTCLOUDDEFEX",t[t.DWG_TYPE_POINTCLOUDDEF_REACTOR=688]="DWG_TYPE_POINTCLOUDDEF_REACTOR",t[t.DWG_TYPE_POINTCLOUDDEF_REACTOR_EX=689]="DWG_TYPE_POINTCLOUDDEF_REACTOR_EX",t[t.DWG_TYPE_POINTCLOUDEX=690]="DWG_TYPE_POINTCLOUDEX",t[t.DWG_TYPE_POINTPARAMETERENTITY=691]="DWG_TYPE_POINTPARAMETERENTITY",t[t.DWG_TYPE_POINTPATH=692]="DWG_TYPE_POINTPATH",t[t.DWG_TYPE_POLARGRIPENTITY=693]="DWG_TYPE_POLARGRIPENTITY",t[t.DWG_TYPE_RADIMLGOBJECTCONTEXTDATA=694]="DWG_TYPE_RADIMLGOBJECTCONTEXTDATA",t[t.DWG_TYPE_RADIMOBJECTCONTEXTDATA=695]="DWG_TYPE_RADIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_RAPIDRTRENDERSETTINGS=696]="DWG_TYPE_RAPIDRTRENDERSETTINGS",t[t.DWG_TYPE_RASTERVARIABLES=697]="DWG_TYPE_RASTERVARIABLES",t[t.DWG_TYPE_RENDERENTRY=698]="DWG_TYPE_RENDERENTRY",t[t.DWG_TYPE_RENDERENVIRONMENT=699]="DWG_TYPE_RENDERENVIRONMENT",t[t.DWG_TYPE_RENDERGLOBAL=700]="DWG_TYPE_RENDERGLOBAL",t[t.DWG_TYPE_RENDERSETTINGS=701]="DWG_TYPE_RENDERSETTINGS",t[t.DWG_TYPE_REVOLVEDSURFACE=702]="DWG_TYPE_REVOLVEDSURFACE",t[t.DWG_TYPE_ROTATIONPARAMETERENTITY=703]="DWG_TYPE_ROTATIONPARAMETERENTITY",t[t.DWG_TYPE_ROTATEACTIONENTITY=704]="DWG_TYPE_ROTATEACTIONENTITY",t[t.DWG_TYPE_RTEXT=705]="DWG_TYPE_RTEXT",t[t.DWG_TYPE_SCALE=706]="DWG_TYPE_SCALE",t[t.DWG_TYPE_SCALEACTIONENTITY=707]="DWG_TYPE_SCALEACTIONENTITY",t[t.DWG_TYPE_SECTIONOBJECT=708]="DWG_TYPE_SECTIONOBJECT",t[t.DWG_TYPE_SECTIONVIEWSTYLE=709]="DWG_TYPE_SECTIONVIEWSTYLE",t[t.DWG_TYPE_SECTION_MANAGER=710]="DWG_TYPE_SECTION_MANAGER",t[t.DWG_TYPE_SECTION_SETTINGS=711]="DWG_TYPE_SECTION_SETTINGS",t[t.DWG_TYPE_SKYLIGHT_BACKGROUND=712]="DWG_TYPE_SKYLIGHT_BACKGROUND",t[t.DWG_TYPE_SOLID_BACKGROUND=713]="DWG_TYPE_SOLID_BACKGROUND",t[t.DWG_TYPE_SORTENTSTABLE=714]="DWG_TYPE_SORTENTSTABLE",t[t.DWG_TYPE_SPATIAL_FILTER=715]="DWG_TYPE_SPATIAL_FILTER",t[t.DWG_TYPE_SPATIAL_INDEX=716]="DWG_TYPE_SPATIAL_INDEX",t[t.DWG_TYPE_STRETCHACTIONENTITY=717]="DWG_TYPE_STRETCHACTIONENTITY",t[t.DWG_TYPE_SUN=718]="DWG_TYPE_SUN",t[t.DWG_TYPE_SUNSTUDY=719]="DWG_TYPE_SUNSTUDY",t[t.DWG_TYPE_SWEPTSURFACE=720]="DWG_TYPE_SWEPTSURFACE",t[t.DWG_TYPE_TABLE=721]="DWG_TYPE_TABLE",t[t.DWG_TYPE_TABLECONTENT=722]="DWG_TYPE_TABLECONTENT",t[t.DWG_TYPE_TABLEGEOMETRY=723]="DWG_TYPE_TABLEGEOMETRY",t[t.DWG_TYPE_TABLESTYLE=724]="DWG_TYPE_TABLESTYLE",t[t.DWG_TYPE_TEXTOBJECTCONTEXTDATA=725]="DWG_TYPE_TEXTOBJECTCONTEXTDATA",t[t.DWG_TYPE_TVDEVICEPROPERTIES=726]="DWG_TYPE_TVDEVICEPROPERTIES",t[t.DWG_TYPE_VISIBILITYGRIPENTITY=727]="DWG_TYPE_VISIBILITYGRIPENTITY",t[t.DWG_TYPE_VISIBILITYPARAMETERENTITY=728]="DWG_TYPE_VISIBILITYPARAMETERENTITY",t[t.DWG_TYPE_VISUALSTYLE=729]="DWG_TYPE_VISUALSTYLE",t[t.DWG_TYPE_WIPEOUT=730]="DWG_TYPE_WIPEOUT",t[t.DWG_TYPE_WIPEOUTVARIABLES=731]="DWG_TYPE_WIPEOUTVARIABLES",t[t.DWG_TYPE_XREFPANELOBJECT=732]="DWG_TYPE_XREFPANELOBJECT",t[t.DWG_TYPE_XYPARAMETERENTITY=733]="DWG_TYPE_XYPARAMETERENTITY",t[t.DWG_TYPE_BREAKDATA=734]="DWG_TYPE_BREAKDATA",t[t.DWG_TYPE_BREAKPOINTREF=735]="DWG_TYPE_BREAKPOINTREF",t[t.DWG_TYPE_FLIPGRIPENTITY=736]="DWG_TYPE_FLIPGRIPENTITY",t[t.DWG_TYPE_LINEARGRIPENTITY=737]="DWG_TYPE_LINEARGRIPENTITY",t[t.DWG_TYPE_ROTATIONGRIPENTITY=738]="DWG_TYPE_ROTATIONGRIPENTITY",t[t.DWG_TYPE_XYGRIPENTITY=739]="DWG_TYPE_XYGRIPENTITY",t[t.DWG_TYPE__3DLINE=740]="DWG_TYPE__3DLINE",t[t.DWG_TYPE_REPEAT=741]="DWG_TYPE_REPEAT",t[t.DWG_TYPE_ENDREP=742]="DWG_TYPE_ENDREP",t[t.DWG_TYPE_JUMP=743]="DWG_TYPE_JUMP",t[t.DWG_TYPE_LOAD=744]="DWG_TYPE_LOAD",t[t.DWG_TYPE_FREED=65533]="DWG_TYPE_FREED",t[t.DWG_TYPE_UNKNOWN_ENT=65534]="DWG_TYPE_UNKNOWN_ENT",t[t.DWG_TYPE_UNKNOWN_OBJ=65535]="DWG_TYPE_UNKNOWN_OBJ"})(P||(P={}));const Pe=Object.fromEntries(Object.entries(P).map(([t,n])=>[n,t]));var it;(function(t){t[t.DWG=0]="DWG",t[t.DXF=1]="DXF"})(it||(it={}));var U;(function(t){t[t.Line=1]="Line",t[t.CircularArc=2]="CircularArc",t[t.EllipticArc=3]="EllipticArc",t[t.Spline=4]="Spline"})(U||(U={}));var Bt;(function(t){t[t.ByLayer=192]="ByLayer",t[t.ByBlock=193]="ByBlock",t[t.Entities=194]="Entities",t[t.TrueColor=195]="TrueColor",t[t.ForegroundColor=197]="ForegroundColor",t[t.None=200]="None"})(Bt||(Bt={}));const Te="*MODEL_SPACE",fe="*PAPER_SPACE",an=t=>t&&t.toUpperCase()==Te,he=t=>t&&t.toUpperCase().startsWith(fe),L=t=>t.toString(16).toUpperCase();class Ce{constructor(n){S(this,"libredwg");S(this,"layers",new Map);S(this,"ltypes",new Map);S(this,"unknownEntityCount");this.libredwg=n,this.unknownEntityCount=0}prepare(n,a=!1){(a||this.layers.size==0)&&(this.layers.clear(),n.tables.LAYER.entries.forEach(e=>{this.layers.set(e.handle,e.name)})),(a||this.ltypes.size==0)&&(this.ltypes.clear(),n.tables.LTYPE.entries.forEach(e=>{this.ltypes.set(e.handle,e.name)})),this.unknownEntityCount=0}clear(){this.layers.clear(),this.ltypes.clear(),this.unknownEntityCount=0}convert(n){const a=this.libredwg,e=a.dwg_object_to_entity(n),i=a.dwg_object_to_entity_tio(n);if(e&&i){const r=this.getCommonAttrs(e),o=a.dwg_object_get_fixedtype(n);if(o==P.DWG_TYPE_3DFACE)return this.convert3dFace(i,r);if(o==P.DWG_TYPE_ARC)return this.convertArc(i,r);if(o==P.DWG_TYPE_ATTDEF)return this.convertAttdef(i,r);if(o==P.DWG_TYPE_CIRCLE)return this.convertCircle(i,r);if(o==P.DWG_TYPE_DIMENSION_ALIGNED||o==P.DWG_TYPE_DIMENSION_LINEAR)return this.convertAlignedDimension(i,r);if(o==P.DWG_TYPE_DIMENSION_ANG3PT)return this.convert3PointAngularDimension(i,r);if(o==P.DWG_TYPE_DIMENSION_DIAMETER)return this.convertDiameterDimension(i,r);if(o==P.DWG_TYPE_DIMENSION_ORDINATE)return this.convertOrdinateDimension(i,r);if(o==P.DWG_TYPE_DIMENSION_RADIUS)return this.convertRadiusDimension(i,r);if(o==P.DWG_TYPE_ELLIPSE)return this.convertEllise(i,r);if(o==P.DWG_TYPE_HATCH)return this.convertHatch(i,r);if(o==P.DWG_TYPE_IMAGE)return this.convertImage(i,r);if(o==P.DWG_TYPE_INSERT)return this.convertInsert(i,r);if(o==P.DWG_TYPE_LEADER)return this.convertLeader(i,r);if(o==P.DWG_TYPE_LINE)return this.convertLine(i,r);if(o==P.DWG_TYPE_LWPOLYLINE)return this.convertLWPolyline(i,r);if(o==P.DWG_TYPE_MLINE)return this.convertMLine(i,r);if(o==P.DWG_TYPE_MTEXT)return this.convertMText(i,r);if(o==P.DWG_TYPE_OLE2FRAME)return this.convertOle2Frame(i,r);if(o==P.DWG_TYPE_OLEFRAME)return this.convertOleFrame(i,r);if(o==P.DWG_TYPE_POINT)return this.convertPoint(i,r);if(o==P.DWG_TYPE_POLYLINE_2D)return this.convertPolyline2d(i,r,n);if(o==P.DWG_TYPE_POLYLINE_3D)return this.convertPolyline3d(i,r,n);if(o==P.DWG_TYPE_PROXY_ENTITY)return this.convertProxy(i,r);if(o==P.DWG_TYPE_RAY)return this.convertRay(i,r);if(o==P.DWG_TYPE_SECTIONOBJECT)return this.convertSection(i,r);if(o==P.DWG_TYPE_SOLID)return this.convertSolid(i,r);if(o==P.DWG_TYPE_SPLINE)return this.convertSpline(i,r);if(o==P.DWG_TYPE_TABLE)return this.convertTable(i,r);if(o==P.DWG_TYPE_TEXT)return this.convertText(i,r);if(o==P.DWG_TYPE_TOLERANCE)return this.convertTolerance(i,r);if(o==P.DWG_TYPE_VIEWPORT)return this.convertViewport(i,r);if(o==P.DWG_TYPE_WIPEOUT)return this.convertWipeout(i,r);if(o==P.DWG_TYPE_XLINE)return this.convertXline(i,r);o===P.DWG_TYPE_UNKNOWN_ENT&&this.unknownEntityCount++}}convert3dFace(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"corner1").data,r=e.dwg_dynapi_entity_value(n,"corner2").data,o=e.dwg_dynapi_entity_value(n,"corner3").data,s=e.dwg_dynapi_entity_value(n,"corner4").data,_=e.dwg_dynapi_entity_value(n,"invis_flags").data;return{type:"3DFACE",...a,corner1:i,corner2:r,corner3:o,corner4:s,flag:_}}convertArc(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"center").data,r=e.dwg_dynapi_entity_value(n,"radius").data,o=e.dwg_dynapi_entity_value(n,"thickness").data,s=e.dwg_dynapi_entity_value(n,"extrusion").data,_=e.dwg_dynapi_entity_value(n,"start_angle").data,d=e.dwg_dynapi_entity_value(n,"end_angle").data;return{type:"ARC",...a,thickness:o,center:i,radius:r,startAngle:_,endAngle:d,extrusionDirection:s}}convertEmbeddedMText(n,a){const e=this.libredwg,i=e.dwg_dynapi_subclass_value(n,a,"attachment").data,r=e.dwg_dynapi_subclass_value(n,a,"ins_pt").data,o=e.dwg_dynapi_subclass_value(n,a,"x_axis_dir").data,s=e.dwg_dynapi_subclass_value(n,a,"rect_height").data,_=e.dwg_dynapi_subclass_value(n,a,"rect_width").data,d=e.dwg_dynapi_subclass_value(n,a,"extents_height").data,l=e.dwg_dynapi_subclass_value(n,a,"extents_width").data;return{insertionPoint:r,rectHeight:s,rectWidth:_,extentsHeight:d,extentsWidth:l,attachmentPoint:i,direction:o}}convertAttdef(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"default_value").data,r=this.convertTextBase(n);r.text=i;const o=e.dwg_dynapi_entity_value(n,"prompt").data,s=e.dwg_dynapi_entity_value(n,"tag").data,_=e.dwg_dynapi_entity_value(n,"flags").data,d=e.dwg_dynapi_entity_value(n,"field_length").data,l=e.dwg_dynapi_entity_value(n,"lock_position_flag").data,c=e.dwg_dynapi_entity_value(n,"keep_duplicate_records").data,u=e.dwg_dynapi_entity_value(n,"is_really_locked").data,E=e.dwg_dynapi_entity_value(n,"mtext_type").data,f=e.dwg_dynapi_entity_value(n,"alignment_pt").data;return{type:"ATTDEF",...a,text:this.convertTextBase(n),prompt:o,tag:s,flags:_,fieldLength:d,lockPositionFlag:l>0,duplicateRecordCloningFlag:c>0,mtextFlag:E,isReallyLocked:u>0,alignmentPoint:f,annotationScale:1,attrTag:"",mtext:this.convertEmbeddedMText(n,"ATTDEF_mtext")}}convertAttrib(n,a){const e=this.libredwg,i=this.convertTextBase(n),r=e.dwg_dynapi_entity_value(n,"tag").data,o=e.dwg_dynapi_entity_value(n,"flags").data,s=e.dwg_dynapi_entity_value(n,"field_length").data,_=e.dwg_dynapi_entity_value(n,"lock_position_flag").data,d=e.dwg_dynapi_entity_value(n,"keep_duplicate_records").data,l=e.dwg_dynapi_entity_value(n,"mtext_type").data,c=e.dwg_dynapi_entity_value(n,"is_really_locked").data,u=e.dwg_dynapi_entity_value(n,"alignment_pt").data;return{type:"ATTRIB",...a,text:i,tag:r,flags:o,fieldLength:s,lockPositionFlag:!!_,duplicateRecordCloningFlag:!!d,mtextFlag:l,isReallyLocked:!!c,numberOfSecondaryAttrs:0,secondaryAttrsHardId:"0",alignmentPoint:{...u,z:0},annotationScale:1,attrTag:"",mtext:this.convertEmbeddedMText(n,"ATTDEF_mtext")}}convertCircle(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"center").data,r=e.dwg_dynapi_entity_value(n,"radius").data,o=e.dwg_dynapi_entity_value(n,"thickness").data,s=e.dwg_dynapi_entity_value(n,"extrusion").data;return{type:"CIRCLE",...a,thickness:o,center:i,radius:r,extrusionDirection:s}}convertAlignedDimension(n,a){const e=this.libredwg,i=this.getDimensionCommonAttrs(n),r=e.dwg_dynapi_entity_value(n,"clone_ins_pt").data,o=e.dwg_dynapi_entity_value(n,"xline1_pt").data,s=e.dwg_dynapi_entity_value(n,"xline2_pt").data,_=e.dwg_dynapi_entity_value(n,"ins_rotation").data,d=e.dwg_dynapi_entity_value(n,"oblique_angle").data;return{subclassMarker:"AcDbAlignedDimension",...a,...i,insertionPoint:r,subDefinitionPoint1:o,subDefinitionPoint2:s,rotationAngle:_??0,obliqueAngle:d}}convert3PointAngularDimension(n,a){const e=this.libredwg,i=this.getDimensionCommonAttrs(n),r=e.dwg_dynapi_entity_value(n,"xline1_pt").data,o=e.dwg_dynapi_entity_value(n,"xline2_pt").data,s=e.dwg_dynapi_entity_value(n,"center_pt").data,_=e.dwg_dynapi_entity_value(n,"xline2end_pt").data;return{subclassMarker:"AcDb3PointAngularDimension",...a,...i,subDefinitionPoint1:r,subDefinitionPoint2:o,centerPoint:s,arcPoint:_}}convertDiameterDimension(n,a){const e=this.libredwg,i=this.getDimensionCommonAttrs(n),r=e.dwg_dynapi_entity_value(n,"first_arc_pt").data,o=e.dwg_dynapi_entity_value(n,"leader_len").data;return{subclassMarker:"AcDbDiametricDimension",...a,...i,centerPoint:r,leaderLength:o}}convertOrdinateDimension(n,a){const e=this.libredwg,i=this.getDimensionCommonAttrs(n),r=e.dwg_dynapi_entity_value(n,"feature_location_pt").data,o=e.dwg_dynapi_entity_value(n,"leader_endpt").data;return{subclassMarker:"AcDbOrdinateDimension",...a,...i,subDefinitionPoint1:r,subDefinitionPoint2:o}}convertRadiusDimension(n,a){const e=this.libredwg,i=this.getDimensionCommonAttrs(n),r=e.dwg_dynapi_entity_value(n,"first_arc_pt").data,o=e.dwg_dynapi_entity_value(n,"leader_len").data;return{subclassMarker:"AcDbRadialDimension",...a,...i,centerPoint:r,leaderLength:o}}convertEllise(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"center").data,r=e.dwg_dynapi_entity_value(n,"sm_axis").data,o=e.dwg_dynapi_entity_value(n,"extrusion").data,s=e.dwg_dynapi_entity_value(n,"axis_ratio").data,_=e.dwg_dynapi_entity_value(n,"start_angle").data,d=e.dwg_dynapi_entity_value(n,"end_angle").data;return{type:"ELLIPSE",...a,center:i,majorAxisEndPoint:r,extrusionDirection:o,axisRatio:s,startAngle:_,endAngle:d}}convertHatch(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"extrusion").data,r=e.dwg_dynapi_entity_value(n,"name").data,o=e.dwg_dynapi_entity_value(n,"is_solid_fill").data,s=e.dwg_dynapi_entity_value(n,"is_associative").data,_=e.dwg_dynapi_entity_value(n,"num_paths").data,d=e.dwg_dynapi_entity_value(n,"paths").data,l=e.dwg_ptr_to_hatch_path_array(d,_),c=e.dwg_dynapi_entity_value(n,"style").data,u=e.dwg_dynapi_entity_value(n,"pattern_type").data,E=e.dwg_dynapi_entity_value(n,"angle").data,f=e.dwg_dynapi_entity_value(n,"scale_spacing").data,I=e.dwg_dynapi_entity_value(n,"num_deflines").data,A=e.dwg_dynapi_entity_value(n,"deflines").data,T=e.dwg_ptr_to_hatch_defline_array(A,I),h=e.dwg_dynapi_entity_value(n,"pixel_size").data,C=e.dwg_dynapi_entity_value(n,"num_seeds").data,R=e.dwg_dynapi_entity_value(n,"seeds").data,Y=e.dwg_ptr_to_point2d_array(R,C),g={...a,extrusionDirection:i,patternName:r,solidFill:o?Q.SolidFill:Q.PatternFill,associativity:s?j.Associative:j.NonAssociative,numberOfBoundaryPaths:_,boundaryPaths:this.convertHatchBoundaryPaths(l),hatchStyle:c,patternType:u,patternAngle:E,patternScale:f,numberOfDefinitionLines:I,definitionLines:T.map(v=>({angle:v.angle,base:v.pt0,offset:v.offset,numberOfDashLengths:v.dashes.length,dashLengths:v.dashes})),pixelSize:h,numberOfSeedPoints:C,seedPoints:Y};if(e.dwg_dynapi_entity_value(n,"is_gradient_fill").data>0){const v=e.dwg_dynapi_entity_value(n,"gradient_name").data,m=e.dwg_dynapi_entity_value(n,"gradient_angle").data,x=e.dwg_dynapi_entity_value(n,"gradient_shift").data,W=e.dwg_dynapi_entity_value(n,"gradient_tint").data,M=e.dwg_dynapi_entity_value(n,"single_color_gradient").data,O=e.dwg_dynapi_entity_value(n,"colors").data,B=e.dwg_ptr_to_hatch_gradient_color_array(O,M==1?1:2);return{type:"HATCH",...g,gradientFlag:at.Gradient,gradientColorFlag:M==1?tt.OneColor:tt.TwoColor,gradientName:v,gradientRotation:m,gradientDefinition:x,colorTint:W,gradientColors:B}}else return{type:"HATCH",...g}}convertHatchBoundaryPaths(n){return n.filter(e=>e.num_segs_or_paths>0).map(e=>{const i={boundaryPathTypeFlag:e.flag};if(e.flag&2)return{...i,hasBulge:e.bulges_present,isClosed:e.closed,numberOfVertices:e.num_segs_or_paths,vertices:e.polyline_paths.map(r=>({x:r.point.x,y:r.point.y,bulge:r.bulge}))};{const r=e.segs.map(o=>{if(o.curve_type==U.Line)return{type:F.Line,start:o.first_endpoint,end:o.second_endpoint};if(o.curve_type==U.CircularArc)return{type:F.Circular,center:o.center,radius:o.radius,startAngle:o.start_angle,endAngle:o.end_angle,isCCW:o.is_ccw};if(o.curve_type==U.EllipticArc)return{type:F.Elliptic,center:o.center,end:o.endpoint,lengthOfMinorAxis:o.minor_major_ratio,startAngle:o.start_angle,endAngle:o.end_angle,isCCW:o.is_ccw};if(o.curve_type==U.Spline)return{type:F.Spline,degree:o.degree,isRational:o.is_rational,isPeriodic:o.is_periodic,numberOfKnots:o.num_knots,numberOfControlPoints:o.num_control_points,knots:o.knots,controlPoints:o.control_points,numberOfFitData:o.num_fitpts,fitDatum:o.fitpts,startTangent:o.start_tangent,endTangent:o.end_tangent}});return{...i,numberOfEdges:e.num_segs_or_paths,edges:r}}})}convertImage(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"class_version").data,r=e.dwg_dynapi_entity_value(n,"pt0").data,o=e.dwg_dynapi_entity_value(n,"uvec").data,s=e.dwg_dynapi_entity_value(n,"vvec").data,_=e.dwg_dynapi_entity_value(n,"image_size").data,d=e.dwg_dynapi_entity_value(n,"display_props").data,l=e.dwg_dynapi_entity_value(n,"clipping").data,c=e.dwg_dynapi_entity_value(n,"brightness").data,u=e.dwg_dynapi_entity_value(n,"contrast").data,E=e.dwg_dynapi_entity_value(n,"fade").data,f=e.dwg_dynapi_entity_value(n,"clip_mode").data,I=e.dwg_dynapi_entity_value(n,"clip_boundary_type").data,A=e.dwg_dynapi_entity_value(n,"num_clip_verts").data,T=e.dwg_dynapi_entity_value(n,"clip_verts").data,h=e.dwg_ptr_to_point3d_array(T,A),C=e.dwg_dynapi_entity_value(n,"imagedef").data,R=L(e.dwg_ref_get_absref(C)),Y=e.dwg_dynapi_entity_value(n,"imagedefreactor").data,g=L(e.dwg_ref_get_absref(Y));return{type:"IMAGE",...a,version:i,position:r,uPixel:o,vPixel:s,imageSize:_,imageDefHandle:R,flags:d,clipping:l,brightness:c,contrast:u,fade:E,imageDefReactorHandle:g,clippingBoundaryType:I,countBoundaryPoints:A,clippingBoundaryPath:h,clipMode:f}}convertInsert(n,a){const e=this.libredwg;let i="";const r=e.dwg_dynapi_entity_value(n,"block_header").data;if(r){const A=e.dwg_ref_get_object(r);if(A){const T=e.dwg_object_to_object_tio(A);T&&(i=e.dwg_entity_block_header_get_block(T).name)}}i||(i=e.dwg_dynapi_entity_value(n,"block_name").data);const o=e.dwg_dynapi_entity_value(n,"ins_pt").data,s=e.dwg_dynapi_entity_value(n,"scale").data,_=e.dwg_dynapi_entity_value(n,"rotation").data,d=e.dwg_dynapi_entity_value(n,"num_cols").data,l=e.dwg_dynapi_entity_value(n,"num_rows").data,c=e.dwg_dynapi_entity_value(n,"col_spacing").data,u=e.dwg_dynapi_entity_value(n,"row_spacing").data,E=e.dwg_dynapi_entity_value(n,"extrusion").data,f=e.dwg_entity_insert_get_attribs(n),I=[];return f.forEach(A=>{const T=e.dwg_object_to_entity(A),h=e.dwg_object_to_entity_tio(A);if(T&&h){const C=this.getCommonAttrs(T);e.dwg_object_get_fixedtype(A)==P.DWG_TYPE_ATTRIB&&I.push(this.convertAttrib(h,C))}}),{type:"INSERT",...a,name:i,insertionPoint:o,xScale:s?s.x:1,yScale:s?s.y:1,zScale:s?s.z:1,rotation:_,columnCount:d,rowCount:l,columnSpacing:c,rowSpacing:u,extrusionDirection:E,attribs:I}}convertLeader(n,a){const e=this.libredwg,i=e.dwg_entity_mtext_get_style_name(n),r=e.dwg_dynapi_entity_value(n,"arrowhead_type").data,o=e.dwg_dynapi_entity_value(n,"path_type").data,s=e.dwg_dynapi_entity_value(n,"annot_type").data,_=e.dwg_dynapi_entity_value(n,"hookline_dir").data,d=e.dwg_dynapi_entity_value(n,"hookline_on").data,l=e.dwg_dynapi_entity_value(n,"box_height").data,c=e.dwg_dynapi_entity_value(n,"box_width").data,u=e.dwg_dynapi_entity_value(n,"num_points").data,E=e.dwg_dynapi_entity_value(n,"points").data,f=u>0?e.dwg_ptr_to_point3d_array(E,u):[],I=e.dwg_dynapi_entity_value(n,"byblock_color").data,A=e.dwg_dynapi_entity_value(n,"extrusion").data,T=e.dwg_dynapi_entity_value(n,"x_direction").data,h=e.dwg_dynapi_entity_value(n,"inspt_offset").data,C=e.dwg_dynapi_entity_value(n,"endptproj").data;return{type:"LEADER",...a,styleName:i,isArrowheadEnabled:r>0,isSpline:o>0,leaderCreationFlag:s,isHooklineSameDirection:_>0,isHooklineExists:d>0,textHeight:l,textWidth:c,numberOfVertices:u,vertices:f,byBlockColor:I,normal:A,horizontalDirection:T,offsetFromBlock:h,offsetFromAnnotation:C}}convertLine(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"start").data,r=e.dwg_dynapi_entity_value(n,"end").data,o=e.dwg_dynapi_entity_value(n,"thickness").data,s=e.dwg_dynapi_entity_value(n,"extrusion").data;return{type:"LINE",...a,thickness:o,startPoint:i,endPoint:r,extrusionDirection:s}}convertLWPolyline(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"num_points").data,r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"const_width").data,s=e.dwg_dynapi_entity_value(n,"elevation").data,_=e.dwg_dynapi_entity_value(n,"thickness").data,d=e.dwg_dynapi_entity_value(n,"extrusion").data,l=[],c=e.dwg_dynapi_entity_value(n,"num_points").data,u=e.dwg_dynapi_entity_value(n,"points").data,E=e.dwg_ptr_to_point2d_array(u,c),f=e.dwg_dynapi_entity_value(n,"num_bulges").data,I=e.dwg_dynapi_entity_value(n,"bulges").data,A=e.dwg_ptr_to_double_array(I,f);return E.forEach((T,h)=>{l.push({id:h,x:T.x,y:T.y,bulge:A.length>h?A[h]:0})}),{type:"LWPOLYLINE",...a,numberOfVertices:i,flag:r,constantWidth:o,elevation:s,thickness:_,extrusionDirection:d,vertices:l}}convertMLine(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"scale").data,r=e.dwg_dynapi_entity_value(n,"flags").data,o=e.dwg_dynapi_entity_value(n,"justification").data,s=e.dwg_dynapi_entity_value(n,"base_point").data,_=e.dwg_dynapi_entity_value(n,"extrusion").data,d=e.dwg_dynapi_entity_value(n,"num_lines").data,l=e.dwg_dynapi_entity_value(n,"num_verts").data,c=e.dwg_dynapi_entity_value(n,"verts").data,u=e.dwg_ptr_to_mline_vertex_array(c,l),E=[];return u.forEach(f=>{E.push({vertex:f.vertex,vertexDirection:f.vertex_direction,miterDirection:f.miter_direction,numberOfLines:f.num_lines,lines:f.lines.map(I=>({numberOfSegmentParams:I.num_segparms,segmentParams:I.segparms,numberOfAreaFillParams:I.num_areafillparms,areaFillParams:I.areafillparms}))})}),{type:"MLINE",...a,scale:i,flags:r,justification:o,startPoint:s,extrusionDirection:_,numberOfLines:d,numberOfVertices:l,vertices:E,mlineStyle:""}}convertOle2Frame(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"oleversion").data,r=e.dwg_dynapi_entity_value(n,"oleclient").data,o=e.dwg_dynapi_entity_value(n,"data_size").data,s=e.dwg_dynapi_entity_value(n,"pt1").data,_=e.dwg_dynapi_entity_value(n,"pt2").data,d=e.dwg_dynapi_entity_value(n,"lock_aspect").data,l=e.dwg_dynapi_entity_value(n,"type").data,c=e.dwg_dynapi_entity_value(n,"mode").data,u=e.dwg_dynapi_entity_value(n,"data").data;return{type:"OLE2FRAME",...a,oleVersion:i,oleClient:r,dataSize:o,leftUpPoint:s,rightDownPoint:_,lockAspect:d,oleObjectType:l,tileModeDescriptor:c,binaryData:u}}convertOleFrame(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"flag").data,r=e.dwg_dynapi_entity_value(n,"mode").data,o=e.dwg_dynapi_entity_value(n,"data_size").data,s=e.dwg_dynapi_entity_value(n,"data").data;return{type:"OLEFRAME",...a,flag:i,mode:r,dataSize:o,binaryData:s}}convertMText(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"ins_pt").data,r=e.dwg_dynapi_entity_value(n,"text_height").data,o=e.dwg_dynapi_entity_value(n,"rect_height").data,s=e.dwg_dynapi_entity_value(n,"rect_width").data,_=e.dwg_dynapi_entity_value(n,"extents_width").data,d=e.dwg_dynapi_entity_value(n,"extents_height").data,l=e.dwg_dynapi_entity_value(n,"attachment").data,c=e.dwg_dynapi_entity_value(n,"flow_dir").data,u=e.dwg_dynapi_entity_value(n,"text").data,E=e.dwg_entity_mtext_get_style_name(n),f=e.dwg_dynapi_entity_value(n,"extrusion").data,I=e.dwg_dynapi_entity_value(n,"x_axis_dir").data,A=e.dwg_dynapi_entity_value(n,"linespace_style").data,T=e.dwg_dynapi_entity_value(n,"linespace_factor").data,h=e.dwg_dynapi_entity_value(n,"bg_fill_flag").data,C=e.dwg_dynapi_entity_value(n,"bg_fill_scale").data,R=e.dwg_dynapi_entity_value(n,"bg_fill_color").data,Y=e.dwg_dynapi_entity_value(n,"bg_fill_trans").data,g=e.dwg_dynapi_entity_value(n,"column_type").data,G=e.dwg_dynapi_entity_value(n,"flow_reversed").data,v=e.dwg_dynapi_entity_value(n,"auto_height").data,m=e.dwg_dynapi_entity_value(n,"column_width").data,x=e.dwg_dynapi_entity_value(n,"gutter").data,W=e.dwg_dynapi_entity_value(n,"num_column_heights").data,M=e.dwg_dynapi_entity_value(n,"column_heights").data,O=e.dwg_ptr_to_double_array(M,W);return{type:"MTEXT",...a,insertionPoint:i,textHeight:r,rectHeight:o,rectWidth:s,extentsHeight:d,extentsWidth:_,attachmentPoint:l,drawingDirection:c,text:u,styleName:E,extrusionDirection:f,direction:I,rotation:0,lineSpacingStyle:A,lineSpacing:T,backgroundFill:h,fillBoxScale:C,backgroundFillColor:R.rgb,backgroundFillTransparency:Y,columnType:g,columnFlowReversed:G,columnAutoHeight:v,columnWidth:m,columnGutter:x,columnHeightCount:W,columnHeights:O}}convertPoint(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"x").data,r=e.dwg_dynapi_entity_value(n,"y").data,o=e.dwg_dynapi_entity_value(n,"z").data,s=e.dwg_dynapi_entity_value(n,"thickness").data,_=e.dwg_dynapi_entity_value(n,"extrusion").data,d=e.dwg_dynapi_entity_value(n,"x_ang").data;return{type:"POINT",...a,position:{x:i,y:r,z:o},thickness:s,extrusionDirection:_,angle:d}}convertPolyline2d(n,a,e){const i=this.libredwg,r=i.dwg_dynapi_entity_value(n,"flag").data,o=i.dwg_dynapi_entity_value(n,"curve_type").data,s=i.dwg_dynapi_entity_value(n,"start_width").data,_=i.dwg_dynapi_entity_value(n,"end_width").data,d=i.dwg_dynapi_entity_value(n,"elevation").data,l=i.dwg_dynapi_entity_value(n,"thickness").data,c=i.dwg_dynapi_entity_value(n,"extrusion").data,u=i.dwg_entity_polyline_2d_get_vertices(e);return{type:"POLYLINE2D",...a,flag:r,smoothType:o,startWidth:s,endWidth:_,elevation:d,thickness:l,extrusionDirection:c,vertices:u.map(E=>({x:E.point.x,y:E.point.y,z:E.point.z,startWidth:E.start_width,endWidth:E.end_width,bulge:E.bulge,flag:E.flag,tangentDirection:E.tangent_dir})),meshMVertexCount:0,meshNVertexCount:0,surfaceMDensity:0,surfaceNDensity:0}}convertPolyline3d(n,a,e){const i=this.libredwg,r=i.dwg_dynapi_entity_value(n,"flag").data,o=i.dwg_dynapi_entity_value(n,"curve_type").data,s=i.dwg_dynapi_entity_value(n,"start_width").data,_=i.dwg_dynapi_entity_value(n,"end_width").data,d=i.dwg_dynapi_entity_value(n,"extrusion").data,l=i.dwg_entity_polyline_3d_get_vertices(e);return{type:"POLYLINE3D",...a,flag:r,smoothType:o,startWidth:s,endWidth:_,extrusionDirection:d,vertices:l.map(c=>({x:c.point.x,y:c.point.y,z:c.point.z,flag:c.flag}))}}convertProxy(n,a){const i=this.libredwg.dwg_dynapi_entity_value(n,"class_id").data;return{type:"PROXY",...a,applicationEntityClassId:i}}convertRay(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"point").data,r=e.dwg_dynapi_entity_value(n,"vector").data;return{type:"RAY",...a,firstPoint:i,unitDirection:r}}convertSection(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"state").data,r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"name").data,s=e.dwg_dynapi_entity_value(n,"vert_dir").data,_=e.dwg_dynapi_entity_value(n,"top_height").data,d=e.dwg_dynapi_entity_value(n,"bottom_height").data,l=e.dwg_dynapi_entity_value(n,"indicator_alpha").data,c=e.dwg_dynapi_entity_value(n,"indicator_color").data,u=e.dwg_dynapi_entity_value(n,"num_verts").data,E=e.dwg_dynapi_entity_value(n,"verts").data,f=u>0?e.dwg_ptr_to_point3d_array(E,u):[],I=e.dwg_dynapi_entity_value(n,"num_blverts").data,A=e.dwg_dynapi_entity_value(n,"blverts").data,T=I>0?e.dwg_ptr_to_point3d_array(A,I):[],h=e.dwg_dynapi_entity_value(n,"geometrySettingHardId").data,C=e.dwg_ref_get_handle_absolute_ref(h);return{type:"SECTION",...a,state:i,flags:r,name:o,verticalDirection:s,topHeight:_,bottomHeight:d,indicatorTransparency:l,indicatorColor:c.rgb,numberOfVertices:u,vertices:f,numberOfBackLineVertices:I,backLineVertices:T,geometrySettingHardId:C}}convertSolid(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"corner1").data,r=e.dwg_dynapi_entity_value(n,"corner2").data,o=e.dwg_dynapi_entity_value(n,"corner3").data,s=e.dwg_dynapi_entity_value(n,"corner4").data,_=e.dwg_dynapi_entity_value(n,"thickness").data,d=e.dwg_dynapi_entity_value(n,"extrusion").data;return{type:"SOLID",...a,corner1:i,corner2:r,corner3:o,corner4:s,thickness:_,extrusionDirection:d}}convertSpline(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"splineflags").data,r=e.dwg_dynapi_entity_value(n,"degree").data,o=e.dwg_dynapi_entity_value(n,"knot_tol").data,s=e.dwg_dynapi_entity_value(n,"num_knots").data,_=e.dwg_dynapi_entity_value(n,"knots").data,d=e.dwg_ptr_to_double_array(_,s),l=e.dwg_dynapi_entity_value(n,"fit_tol").data,c=e.dwg_dynapi_entity_value(n,"num_fit_pts").data,u=e.dwg_dynapi_entity_value(n,"fit_pts").data,E=e.dwg_ptr_to_point3d_array(u,c),f=e.dwg_dynapi_entity_value(n,"weighted").data,I=e.dwg_dynapi_entity_value(n,"ctrl_tol").data,A=e.dwg_dynapi_entity_value(n,"num_ctrl_pts").data,T=e.dwg_dynapi_entity_value(n,"ctrl_pts").data,h=e.dwg_ptr_to_point4d_array(T,A),C=e.dwg_dynapi_entity_value(n,"beg_tan_vec").data,R=e.dwg_dynapi_entity_value(n,"end_tan_vec").data;return{type:"SPLINE",...a,flag:i,degree:r,numberOfKnots:s,numberOfControlPoints:A,numberOfFitPoints:c,knotTolerance:o,controlTolerance:I,fitTolerance:l,startTangent:C,endTangent:R,knots:d,weights:f?h.map(Y=>Y.w):void 0,controlPoints:h.map(Y=>({x:Y.x,y:Y.y,z:Y.z})),fitPoints:E}}convertTable(n,a){const e=this.libredwg,i=e.dwg_dynapi_subclass_value(n,"ldata","name").data,r=e.dwg_dynapi_entity_value(n,"ins_pt").data,o=e.dwg_dynapi_entity_value(n,"horiz_direction").data,s=e.dwg_dynapi_entity_value(n,"flag_for_table_value").data,_=e.dwg_dynapi_entity_value(n,"num_rows").data,d=e.dwg_dynapi_entity_value(n,"num_cols").data,l=e.dwg_dynapi_entity_value(n,"row_heights").data,c=e.dwg_ptr_to_double_array(l,_),u=e.dwg_dynapi_entity_value(n,"col_widths").data,E=e.dwg_ptr_to_double_array(u,d),f=e.dwg_dynapi_entity_value(n,"tablestyle").data,I=L(e.dwg_ref_get_absref(f)),A=e.dwg_dynapi_entity_value(n,"block_header").data,T=L(e.dwg_ref_get_absref(A)),h=e.dwg_dynapi_entity_value(n,"table_flag_override").data,C=e.dwg_dynapi_entity_value(n,"border_color_overrides_flag").data,R=e.dwg_dynapi_entity_value(n,"border_lineweight_overrides_flag").data,Y=e.dwg_dynapi_entity_value(n,"border_visibility_overrides_flag").data,g=e.dwg_dynapi_entity_value(n,"num_cells").data,G=e.dwg_dynapi_entity_value(n,"cells").data,v=e.dwg_ptr_to_table_cell_array(G,g);return{type:"ACAD_TABLE",...a,name:i,startPoint:r,directionVector:o,tableValue:s,rowCount:_,columnCount:d,overrideFlag:h,borderColorOverrideFlag:C,borderLineWeightOverrideFlag:R,borderVisibilityOverrideFlag:Y,rowHeightArr:c,columnWidthArr:E,tableStyleId:I,blockRecordHandle:T,cells:this.convertTableCells(v),bmpPreview:""}}convertTableCells(n){const a=[];return n.forEach(e=>({text:e.text_value,attachmentPoint:e.cell_alignment,textStyle:e.text_style,rotation:e.rotation,cellType:e.type,flagValue:e.flags,mergedValue:e.is_merged_value,autoFit:e.is_autofit_flag,topBorderVisibility:e.top_visibility,bottomBorderVisibility:e.bottom_visibility,leftBorderVisibility:e.left_visibility,rightBorderVisibility:e.right_visibility,overrideFlag:e.cell_flag_override,virtualEdgeFlag:e.virtual_edge_flag,blockTableRecordI:e.block_handle.absolute_ref,blockScale:e.block_scale,blockAttrNum:e.attr_defs.length,attrDefineId:e.attr_defs.map(i=>i.attdef.absolute_ref),extendedCellFlags:e.additional_data_flag})),a}convertTextBase(n){const a=this.libredwg,e=a.dwg_dynapi_entity_value(n,"text_value").data,i=a.dwg_dynapi_entity_value(n,"thickness").data,r=a.dwg_dynapi_entity_value(n,"ins_pt").data,o=a.dwg_dynapi_entity_value(n,"alignment_pt").data,s=a.dwg_dynapi_entity_value(n,"rotation").data,_=a.dwg_dynapi_entity_value(n,"height").data,d=a.dwg_dynapi_entity_value(n,"width_factor").data,l=a.dwg_dynapi_entity_value(n,"oblique_angle").data,c=a.dwg_entity_text_get_style_name(n),u=a.dwg_dynapi_entity_value(n,"generation").data,E=a.dwg_dynapi_entity_value(n,"horiz_alignment").data,f=a.dwg_dynapi_entity_value(n,"vert_alignment").data,I=a.dwg_dynapi_entity_value(n,"extrusion").data;return{text:e,thickness:i,startPoint:r,endPoint:o,textHeight:_,rotation:s,xScale:d,obliqueAngle:l,styleName:c,generationFlag:u,halign:E,valign:f,extrusionDirection:I}}convertText(n,a){return{type:"TEXT",...a,...this.convertTextBase(n)}}convertTolerance(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"ins_pt").data,r=e.dwg_dynapi_entity_value(n,"text_value").data,o=e.dwg_dynapi_entity_value(n,"x_direction").data,s=e.dwg_dynapi_entity_value(n,"extrusion").data,_=e.dwg_entity_get_dimstyle_name(n);return{type:"TOLERANCE",...a,styleName:_,insertionPoint:i,text:r,extrusionDirection:s,xAxisDirection:o}}convertViewport(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"center").data,r=e.dwg_dynapi_entity_value(n,"width").data,o=e.dwg_dynapi_entity_value(n,"height").data,s=e.dwg_dynapi_entity_value(n,"on_off").data,_=e.dwg_dynapi_entity_value(n,"VIEWCTR").data,d=e.dwg_dynapi_entity_value(n,"SNAPBASE").data,l=e.dwg_dynapi_entity_value(n,"SNAPUNIT").data,c=e.dwg_dynapi_entity_value(n,"GRIDUNIT").data,u=e.dwg_dynapi_entity_value(n,"VIEWDIR").data,E=e.dwg_dynapi_entity_value(n,"view_target").data,f=e.dwg_dynapi_entity_value(n,"lens_length").data,I=e.dwg_dynapi_entity_value(n,"front_clip_z").data,A=e.dwg_dynapi_entity_value(n,"back_clip_z").data,T=e.dwg_dynapi_entity_value(n,"VIEWSIZE").data,h=e.dwg_dynapi_entity_value(n,"SNAPANG").data,C=e.dwg_dynapi_entity_value(n,"twist_angle").data,R=e.dwg_dynapi_entity_value(n,"circle_zoom").data,Y=e.dwg_dynapi_entity_value(n,"status_flag").data,g=e.dwg_dynapi_entity_value(n,"style_sheet").data,G=e.dwg_dynapi_entity_value(n,"render_mode").data,v=e.dwg_dynapi_entity_value(n,"UCSVP").data,m=e.dwg_dynapi_entity_value(n,"ucsorg").data,x=e.dwg_dynapi_entity_value(n,"ucsxdir").data,W=e.dwg_dynapi_entity_value(n,"ucsydir").data,M=e.dwg_dynapi_entity_value(n,"named_ucs").data,O=e.dwg_ref_get_absref(M),B=e.dwg_dynapi_entity_value(n,"base_ucs").data,K=e.dwg_ref_get_absref(B),V=e.dwg_dynapi_entity_value(n,"UCSORTHOVIEW").data,$=e.dwg_dynapi_entity_value(n,"ucs_elevation").data,z=e.dwg_dynapi_entity_value(n,"shadeplot_mode").data,k=e.dwg_dynapi_entity_value(n,"use_default_lights").data,J=e.dwg_dynapi_entity_value(n,"default_lighting_type").data,X=e.dwg_dynapi_entity_value(n,"brightness").data,Z=e.dwg_dynapi_entity_value(n,"contrast").data,st=e.dwg_dynapi_entity_value(n,"grid_major").data,_t=e.dwg_dynapi_entity_value(n,"background").data,dt=e.dwg_ref_get_absref(_t),lt=e.dwg_dynapi_entity_value(n,"shadeplot").data,ct=e.dwg_ref_get_absref(lt),Et=e.dwg_dynapi_entity_value(n,"visualstyle").data,ut=e.dwg_ref_get_absref(Et),At=e.dwg_dynapi_entity_value(n,"sun").data,It=e.dwg_ref_get_absref(At);return{type:"VIEWPORT",...a,viewportCenter:i,width:r,height:o,status:s,viewportId:0,displayCenter:_,snapBase:d,snapSpacing:l,gridSpacing:c,viewDirection:u,targetPoint:E,perspectiveLensLength:f,frontClipZ:I,backClipZ:A,viewHeight:T,snapAngle:h,viewTwistAngle:C,circleZoomPercent:R,statusBitFlags:Y,sheetName:g,renderMode:G,ucsPerViewport:v,ucsOrigin:m,ucsXAxis:x,ucsYAxis:W,ucsId:L(O),ucsBaseId:L(K),orthographicType:V,elevation:$,shadePlotMode:z,majorGridFrequency:st,backgroundId:L(dt),shadePlotId:L(ct),visualStyleId:L(ut),isDefaultLighting:!!k,defaultLightingType:J,brightness:X,contrast:Z,sunId:L(It)}}convertWipeout(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"class_version").data,r=e.dwg_dynapi_entity_value(n,"pt0").data,o=e.dwg_dynapi_entity_value(n,"uvec").data,s=e.dwg_dynapi_entity_value(n,"vvec").data,_=e.dwg_dynapi_entity_value(n,"image_size").data,d=e.dwg_dynapi_entity_value(n,"display_props").data,l=e.dwg_dynapi_entity_value(n,"clipping").data,c=e.dwg_dynapi_entity_value(n,"brightness").data,u=e.dwg_dynapi_entity_value(n,"contrast").data,E=e.dwg_dynapi_entity_value(n,"fade").data,f=e.dwg_dynapi_entity_value(n,"clip_mode").data,I=e.dwg_dynapi_entity_value(n,"clip_boundary_type").data,A=e.dwg_dynapi_entity_value(n,"num_clip_verts").data,T=e.dwg_dynapi_entity_value(n,"clip_verts").data,h=e.dwg_ptr_to_point2d_array(T,A),C=e.dwg_dynapi_entity_value(n,"imagedef").data,R=e.dwg_ref_get_absref(C),Y=e.dwg_dynapi_entity_value(n,"imagedefreactor").data,g=e.dwg_ref_get_absref(Y);return{type:"WIPEOUT",...a,version:i,position:r,uPixel:o,vPixel:s,imageSize:_,imageDefHandle:R,flags:d,clipping:l,brightness:c,contrast:u,fade:E,imageDefReactorHandle:g,clippingBoundaryType:I,countBoundaryPoints:A,clippingBoundaryPath:h,clipMode:f}}convertXline(n,a){const e=this.libredwg,i=e.dwg_dynapi_entity_value(n,"point").data,r=e.dwg_dynapi_entity_value(n,"vector").data;return{type:"XLINE",...a,firstPoint:i,unitDirection:r}}getDimensionCommonAttrs(n){const a=this.libredwg,e=a.dwg_dynapi_entity_value(n,"class_version").data,i=a.dwg_entity_get_block_name(n,"block"),r=a.dwg_dynapi_entity_value(n,"def_pt").data,o=a.dwg_dynapi_entity_value(n,"text_midpt").data,s=a.dwg_dynapi_entity_value(n,"attachmentPoint").data,_=a.dwg_dynapi_entity_value(n,"flag").data,d=a.dwg_dynapi_entity_value(n,"lspace_factor").data,l=a.dwg_dynapi_entity_value(n,"lspace_factor").data,c=a.dwg_dynapi_entity_value(n,"act_measurement").data,u=a.dwg_dynapi_entity_value(n,"user_text").data,E=a.dwg_dynapi_entity_value(n,"text_rotation").data,f=a.dwg_dynapi_entity_value(n,"ins_rotation").data,I=a.dwg_dynapi_entity_value(n,"extrusion").data,A=a.dwg_entity_get_dimstyle_name(n);return{type:"DIMENSION",version:e,name:i,definitionPoint:r,textPoint:o,dimensionType:_,attachmentPoint:s,textLineSpacingStyle:d,textLineSpacingFactor:l||1,measurement:c,text:u,textRotation:E,ocsRotation:f,extrusionDirection:I,styleName:A}}getCommonAttrs(n){const a=this.libredwg,e=a.dwg_object_entity_get_color_object(n),i=e.method,r=e.index;let o;(i==194||(e.rgb>>>24&255)===194)&&(o=e.rgb&16777215);const s=this.getLayerName(n),_=a.dwg_object_entity_get_handle_object(n),d=a.dwg_object_entity_get_ownerhandle_object(n),l=a.dwg_object_entity_get_xdicobjhandle_object(n),c=this.getLtypeName(n),u=a.dwg_object_entity_get_line_weight(n),E=a.dwg_object_entity_get_ltype_scale(n),f=!a.dwg_object_entity_get_invisible(n),I=a.dwg_object_entity_get_xdata(n);return{handle:L(_.value),ownerDictionaryHardId:L(l.absolute_ref),ownerBlockRecordSoftId:L(d.absolute_ref),layer:s,color:o,colorIndex:r,colorName:e.name,lineType:c,lineweight:u,lineTypeScale:E,isVisible:f,transparency:e.alpha,transparencyType:e.alpha_type,xdata:I}}getLayerName(n){const e=this.libredwg.dwg_object_entity_get_layer_object_ref(n);return this.layers.get(L(e.handleref.value))??"0"}getLtypeName(n){const e=this.libredwg.dwg_object_entity_get_ltype_object_ref(n);return this.ltypes.get(L(e.handleref.value))??""}}class zt{constructor(n){S(this,"libredwg");S(this,"entityConverter");this.libredwg=n,this.entityConverter=new Ce(n)}convert(n){this.entityConverter.clear();const a={tables:{APPID:{entries:[]},BLOCK_RECORD:{entries:[]},DIMSTYLE:{entries:[]},LAYER:{entries:[]},LTYPE:{entries:[]},STYLE:{entries:[]},VPORT:{entries:[]}},objects:{DICTIONARY:[],IMAGEDEF:[],LAYOUT:[],SPATIAL_FILTER:[]},header:{},entities:[],classes:[]},e=this.libredwg;this.convertHeader(n,a.header),this.convertClasses(n,a.classes);const i=e.dwg_get_num_objects(n);for(let o=0;o<i;o++){const s=e.dwg_get_object(n,o);if(s){const _=e.dwg_object_to_object_tio(s);if(_)switch(e.dwg_object_get_fixedtype(s)){case P.DWG_TYPE_LAYER:{const l=this.convertLayer(_,s);a.tables.LAYER.entries.push(l),this.entityConverter.layers.set(l.handle,l.name)}break;case P.DWG_TYPE_LTYPE:{const l=this.convertLineType(_,s);a.tables.LTYPE.entries.push(l),this.entityConverter.ltypes.set(l.handle,l.name)}break}}}for(let o=0;o<i;o++){const s=e.dwg_get_object(n,o);if(s){const _=e.dwg_object_to_object_tio(s);if(_)switch(e.dwg_object_get_fixedtype(s)){case P.DWG_TYPE_APPID:a.tables.APPID.entries.push(this.convertAppId(_));break;case P.DWG_TYPE_BLOCK_HEADER:{const l=this.convertBlockRecord(_,s);a.tables.BLOCK_RECORD.entries.push(l),(an(l.name)||he(l.name))&&l.entities.forEach(c=>{a.entities.push(c),c.type==="INSERT"&&c.attribs.forEach(u=>{a.entities.push(u)})})}break;case P.DWG_TYPE_DIMSTYLE:a.tables.DIMSTYLE.entries.push(this.convertDimStyle(_,s));break;case P.DWG_TYPE_STYLE:a.tables.STYLE.entries.push(this.convertStyle(_,s));break;case P.DWG_TYPE_VPORT:a.tables.VPORT.entries.push(this.convertViewport(_,s));break;case P.DWG_TYPE_DICTIONARY:a.objects.DICTIONARY.push(this.convertDictionary(_,s));break;case P.DWG_TYPE_IMAGEDEF:a.objects.IMAGEDEF.push(this.convertImageDef(_,s));break;case P.DWG_TYPE_LAYOUT:a.objects.LAYOUT.push(this.convertLayout(_,s));break;case P.DWG_TYPE_SPATIAL_FILTER:a.objects.SPATIAL_FILTER.push(this.convertSpatialFilter(_,s));break}}}const r=a.entities.filter(o=>o.type==="VIEWPORT");return r.sort((o,s)=>{const _=parseInt(o.handle,16),d=parseInt(s.handle,16);return _-d}),r.forEach((o,s)=>{o.viewportId=s+1}),a}getConversionStats(){return{unknownEntityCount:this.entityConverter.unknownEntityCount}}convertHeader(n,a){const e=this.libredwg;nn.forEach(i=>{let r=i;(i=="DIMBLK"||i=="DIMBLK1"||i=="DIMBLK2")&&(r=r+"_T");let o=e.dwg_dynapi_header_value(n,r).data;i=="CELTYPE"||i=="CLAYER"||i=="CLAYER"||i=="DIMSTYLE"||i=="DIMTXSTY"||i=="TEXTSTYLE"?o=o?e.dwg_ref_get_object_name(o):"":i=="DRAGVS"&&(o=o?e.dwg_ref_get_absref(o):2),a[i]=o})}convertClasses(n,a){const e=this.libredwg,i=e.dwg_get_num_classes(n);for(let r=0;r<i;r++){const o=e.dwg_get_class(n,r);a.push({dxfName:o.dxfname,cppName:o.cppname,appName:o.appname,capabilitiesFlag:o.proxyflag,instanceCount:o.num_instances,wasAProxyFlag:o.s_zombie,isAnEntityFlag:o.item_class_id===498})}}convertAppId(n){const a=this.libredwg,e=a.dwg_dynapi_entity_value(n,"name").data,i=a.dwg_dynapi_entity_value(n,"flag").data;return{name:e,standardFlag:i}}convertBlockRecord(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_entity_block_header_get_block(n);r.name&&(i.name=r.name);const o=e.dwg_dynapi_entity_value(n,"num_owned").data,s=e.dwg_dynapi_entity_value(n,"flag").data,_=e.dwg_dynapi_entity_value(n,"description").data,d=e.dwg_dynapi_entity_value(n,"base_pt").data,l=e.dwg_dynapi_entity_value(n,"insert_units").data,c=e.dwg_dynapi_entity_value(n,"explodable").data,u=e.dwg_dynapi_entity_value(n,"block_scaling").data,E=e.dwg_dynapi_entity_value(n,"layout").data,f=L(e.dwg_ref_get_absref(E));let I="";const A=C=>{const R=new Array(C.length);for(let Y=0;Y<C.length;Y++)R[Y]=C[Y].toString(16).toUpperCase();return R.join("")},T=e.dwg_entity_block_header_get_preview(n);T&&T.length>0&&(I=A(T));let h=this.convertEntities(a,i.handle);if(!h||h.length==0){h=[];const C=e.dwg_dynapi_entity_value(n,"entities").data;if(C){const R=e.dwg_ptr_to_object_ref_ptr_array(C,o),Y=this.entityConverter;for(let g=0;g<o;g++){const G=e.dwg_ref_get_object(R[g]),v=Y.convert(G);v&&(v.ownerBlockRecordSoftId=i.handle,h.push(v))}}}return{...i,flags:s,description:_,basePoint:d,layout:f,insertionUnits:l,explodability:c,scalability:u,bmpPreview:I,entities:h}}convertEntities(n,a){const e=this.libredwg,i=this.entityConverter,r=[];let o=e.get_first_owned_entity(n);for(;o;){const s=i.convert(o);s&&(s.ownerBlockRecordSoftId=a,r.push(s)),o=e.get_next_owned_entity(n,o)}return r}convertDimStyle(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_dynapi_entity_value(n,"DIMTOL").data,o=e.dwg_dynapi_entity_value(n,"DIMLIM").data,s=e.dwg_dynapi_entity_value(n,"DIMTIH").data,_=e.dwg_dynapi_entity_value(n,"DIMTOH").data,d=e.dwg_dynapi_entity_value(n,"DIMSE1").data,l=e.dwg_dynapi_entity_value(n,"DIMSE2").data,c=e.dwg_dynapi_entity_value(n,"DIMALT").data,u=e.dwg_dynapi_entity_value(n,"DIMTOFL").data,E=e.dwg_dynapi_entity_value(n,"DIMSAH").data,f=e.dwg_dynapi_entity_value(n,"DIMTIX").data,I=e.dwg_dynapi_entity_value(n,"DIMSOXD").data,A=e.dwg_dynapi_entity_value(n,"DIMALTD").data,T=e.dwg_dynapi_entity_value(n,"DIMZIN").data,h=e.dwg_dynapi_entity_value(n,"DIMSD1").data,C=e.dwg_dynapi_entity_value(n,"DIMSD2").data,R=e.dwg_dynapi_entity_value(n,"DIMTOLJ").data,Y=e.dwg_dynapi_entity_value(n,"DIMJUST").data,g=e.dwg_dynapi_entity_value(n,"DIMFIT").data,G=e.dwg_dynapi_entity_value(n,"DIMUPT").data,v=e.dwg_dynapi_entity_value(n,"DIMTZIN").data,m=e.dwg_dynapi_entity_value(n,"DIMALTZ").data,x=e.dwg_dynapi_entity_value(n,"DIMALTTZ").data,W=e.dwg_dynapi_entity_value(n,"DIMTAD").data,M=e.dwg_dynapi_entity_value(n,"DIMUNIT").data,O=e.dwg_dynapi_entity_value(n,"DIMAUNIT").data,B=e.dwg_dynapi_entity_value(n,"DIMDEC").data,K=e.dwg_dynapi_entity_value(n,"DIMTDEC").data,V=e.dwg_dynapi_entity_value(n,"DIMALTU").data,$=e.dwg_dynapi_entity_value(n,"DIMALTTD").data,z=e.dwg_dynapi_entity_value(n,"DIMSCALE").data,k=e.dwg_dynapi_entity_value(n,"DIMASZ").data,J=e.dwg_dynapi_entity_value(n,"DIMEXO").data,X=e.dwg_dynapi_entity_value(n,"DIMDLI").data,Z=e.dwg_dynapi_entity_value(n,"DIMEXE").data,st=e.dwg_dynapi_entity_value(n,"DIMRND").data,_t=e.dwg_dynapi_entity_value(n,"DIMDLE").data,dt=e.dwg_dynapi_entity_value(n,"DIMTP").data,lt=e.dwg_dynapi_entity_value(n,"DIMTM").data,ct=e.dwg_dynapi_entity_value(n,"DIMFXL").data,Et=e.dwg_dynapi_entity_value(n,"DIMJOGANG").data,ut=e.dwg_dynapi_entity_value(n,"DIMTFILL").data,At=e.dwg_dynapi_entity_value(n,"DIMTFILLCLR").data,It=e.dwg_dynapi_entity_value(n,"DIMAZIN").data,on=e.dwg_dynapi_entity_value(n,"DIMARCSYM").data,rn=e.dwg_dynapi_entity_value(n,"DIMTXT").data,sn=e.dwg_dynapi_entity_value(n,"DIMCEN").data,_n=e.dwg_dynapi_entity_value(n,"DIMTSZ").data,dn=e.dwg_dynapi_entity_value(n,"DIMALTF").data,ln=e.dwg_dynapi_entity_value(n,"DIMLFAC").data,cn=e.dwg_dynapi_entity_value(n,"DIMTVP").data,En=e.dwg_dynapi_entity_value(n,"DIMTFAC").data,un=e.dwg_dynapi_entity_value(n,"DIMGAP").data,An=e.dwg_dynapi_entity_value(n,"DIMPOST").data,In=e.dwg_dynapi_entity_value(n,"DIMAPOST").data,Pn=e.dwg_dynapi_entity_value(n,"DIMBLK_T").data,Tn=e.dwg_dynapi_entity_value(n,"DIMBLK1_T").data,fn=e.dwg_dynapi_entity_value(n,"DIMBLK2_T").data,hn=e.dwg_dynapi_entity_value(n,"DIMALTRND").data,Cn=e.dwg_dynapi_entity_value(n,"DIMCLRD_N").data,Rn=e.dwg_dynapi_entity_value(n,"DIMCLRE_N").data,Yn=e.dwg_dynapi_entity_value(n,"DIMCLRT_N").data,gn=e.dwg_dynapi_entity_value(n,"DIMCLRD").data,Ln=e.dwg_dynapi_entity_value(n,"DIMCLRE").data,vn=e.dwg_dynapi_entity_value(n,"DIMCLRT").data,Nn=e.dwg_dynapi_entity_value(n,"DIMADEC").data,Sn=e.dwg_dynapi_entity_value(n,"DIMFRAC").data,Gn=e.dwg_dynapi_entity_value(n,"DIMLUNIT").data,Dn=e.dwg_dynapi_entity_value(n,"DIMDSEP").data,pn=e.dwg_dynapi_entity_value(n,"DIMTMOVE").data,yn=e.dwg_dynapi_entity_value(n,"DIMATFIT").data,Wn=e.dwg_dynapi_entity_value(n,"DIMFXLON").data,Mn=e.dwg_dynapi_entity_value(n,"DIMTXTDIRECTION").data,mn=e.dwg_dynapi_entity_value(n,"DIMALTMZF").data,xn=e.dwg_dynapi_entity_value(n,"DIMALTMZS").data,On=e.dwg_dynapi_entity_value(n,"DIMMZF").data,wn=e.dwg_dynapi_entity_value(n,"DIMMZS").data,Bn=e.dwg_dynapi_entity_value(n,"DIMLWD").data,bn=e.dwg_dynapi_entity_value(n,"DIMLWE").data,Fn=e.dwg_dynapi_entity_value(n,"DIMTXSTY").data,Un=e.dwg_ref_get_absref(Fn),kn=e.dwg_dynapi_entity_value(n,"DIMLDRBLK").data,Xn=e.dwg_ref_get_absref(kn);return{...i,DIMPOST:An,DIMAPOST:In,DIMBLK:Pn,DIMBLK1:Tn,DIMBLK2:fn,DIMSCALE:z,DIMASZ:k,DIMEXO:J,DIMDLI:X,DIMEXE:Z,DIMRND:st,DIMDLE:_t,DIMTP:dt,DIMTM:lt,DIMTXT:rn,DIMCEN:sn,DIMTSZ:_n,DIMALTF:dn,DIMLFAC:ln,DIMTVP:cn,DIMTFAC:En,DIMGAP:un,DIMALTRND:hn,DIMTOL:r,DIMLIM:o,DIMTIH:s,DIMTOH:_,DIMSE1:d,DIMSE2:l,DIMTAD:W,DIMZIN:T,DIMAZIN:It,DIMALT:c,DIMALTD:A,DIMTOFL:u,DIMSAH:E,DIMTIX:f,DIMSOXD:I,DIMCLRD:gn,DIMCLRE:Ln,DIMCLRT:vn,DIMADEC:Nn,DIMUNIT:M,DIMDEC:B,DIMTDEC:K,DIMALTU:V,DIMALTTD:$,DIMAUNIT:O,DIMFRAC:Sn,DIMLUNIT:Gn,DIMDSEP:String.fromCharCode(Dn),DIMTMOVE:pn,DIMJUST:Y,DIMSD1:h,DIMSD2:C,DIMTOLJ:R,DIMTZIN:v,DIMALTZ:m,DIMALTTZ:x,DIMFIT:g,DIMUPT:G,DIMATFIT:yn,DIMTXSTY:Un,DIMLDRBLK:Xn,DIMLWD:Bn,DIMLWE:bn,DIMFXL:ct,DIMJOGANG:Et,DIMTFILL:ut,DIMTFILLCLR:At,DIMARCSYM:on,DIMCLRD_N:Cn,DIMCLRE_N:Rn,DIMCLRT_N:Yn,DIMFXLON:Wn,DIMTXTDIRECTION:Mn,DIMALTMZF:mn,DIMALTMZS:xn,DIMMZF:On,DIMMZS:wn}}convertLayer(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"frozen").data,s=e.dwg_dynapi_entity_value(n,"off").data,_=e.dwg_dynapi_entity_value(n,"frozen_in_new").data,d=e.dwg_dynapi_entity_value(n,"plotflockedlag").data,l=e.dwg_dynapi_entity_value(n,"plotflag").data,c=e.dwg_dynapi_entity_value(n,"linewt").data,u=e.dwg_dynapi_entity_value(n,"color").data,E=e.dwg_dynapi_entity_value(n,"ltype").data;let f="Continuous";if(E)try{f=e.dwg_ref_get_object_name(E)}catch{}const I=u.method;let A=256,T=16777215;return I===195||(u.rgb>>>24&255)===195?A=u.rgb&255:I==194||(u.rgb>>>24&255)===194?T=u.rgb&16777215:u.index>=1&&u.index<=255&&(A=u.index),{...i,standardFlag:r,colorIndex:A,color:T,colorName:u.name,transparency:u.alpha,lineType:f,frozen:o!=0,off:s!=0,frozenInNew:_!=0,locked:d!=0,plotFlag:l,lineweight:c,plotStyleNameObjectId:"",materialObjectId:""}}convertLineType(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"description").data,s=e.dwg_dynapi_entity_value(n,"numdashes").data,_=e.dwg_dynapi_entity_value(n,"pattern_len").data,d=e.dwg_dynapi_entity_value(n,"dashes").data,l=d?e.dwg_ptr_to_ltype_dash_array(d,s):[];return{...i,description:o,standardFlag:r,numberOfLineTypes:s,totalPatternLength:_,pattern:this.convertLineTypePattern(l)}}convertLineTypePattern(n){const a=[];return n.forEach(e=>{a.push({elementLength:e.length||0,elementTypeFlag:e.complex_shapecode,shapeNumber:e.shape_flag,scale:e.scale,rotation:e.rotation,offsetX:e.x_offset,offsetY:e.y_offset,text:e.text})}),a}convertStyle(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"width_factor").data,s=e.dwg_dynapi_entity_value(n,"oblique_angle").data,_=e.dwg_dynapi_entity_value(n,"generation").data,d=e.dwg_dynapi_entity_value(n,"last_height").data,l=e.dwg_dynapi_entity_value(n,"font_file").data,c=e.dwg_dynapi_entity_value(n,"bigfont_file").data;return{...i,standardFlag:r,fixedTextHeight:0,widthFactor:o,obliqueAngle:s,textGenerationFlag:_,lastHeight:d,font:l,bigFont:c}}convertViewport(n,a){const e=this.libredwg,i=this.getCommonTableEntryAttrs(n,a),r=e.dwg_dynapi_entity_value(n,"flag").data,o=e.dwg_dynapi_entity_value(n,"VIEWSIZE").data,s=e.dwg_dynapi_entity_value(n,"aspect_ratio").data,_=e.dwg_dynapi_entity_value(n,"VIEWCTR").data,d=e.dwg_dynapi_entity_value(n,"view_target").data,l=e.dwg_dynapi_entity_value(n,"VIEWDIR").data,c=e.dwg_dynapi_entity_value(n,"view_twist").data,u=e.dwg_dynapi_entity_value(n,"lens_length").data,E=e.dwg_dynapi_entity_value(n,"front_clip_z").data,f=e.dwg_dynapi_entity_value(n,"back_clip_z").data,I=e.dwg_dynapi_entity_value(n,"VIEWMODE").data,A=e.dwg_dynapi_entity_value(n,"render_mode").data,T=e.dwg_dynapi_entity_value(n,"use_default_lights").data!=0,h=e.dwg_dynapi_entity_value(n,"default_lightning_type").data,C=e.dwg_dynapi_entity_value(n,"brightness").data,R=e.dwg_dynapi_entity_value(n,"contrast").data,Y=e.dwg_dynapi_entity_value(n,"ambient_color").data,g=e.dwg_dynapi_entity_value(n,"lower_left").data,G=e.dwg_dynapi_entity_value(n,"upper_right").data,v=e.dwg_dynapi_entity_value(n,"circle_zoom").data,m=e.dwg_dynapi_entity_value(n,"UCSICON").data,x=e.dwg_dynapi_entity_value(n,"GRIDUNIT").data,W=e.dwg_dynapi_entity_value(n,"SNAPANG").data,M=e.dwg_dynapi_entity_value(n,"SNAPBASE").data,O=e.dwg_dynapi_entity_value(n,"SNAPUNIT").data,B=e.dwg_dynapi_entity_value(n,"ucsorg").data,K=e.dwg_dynapi_entity_value(n,"ucsxdir").data,V=e.dwg_dynapi_entity_value(n,"ucsydir").data,$=e.dwg_dynapi_entity_value(n,"ucs_elevation").data,z=e.dwg_dynapi_entity_value(n,"grid_major").data,k=e.dwg_dynapi_entity_value(n,"background").data,J=k?L(e.dwg_ref_get_absref(k)):void 0,X=e.dwg_dynapi_entity_value(n,"visualstyle").data,Z=X?L(e.dwg_ref_get_absref(X)):void 0;return{...i,standardFlag:r,lowerLeftCorner:g,upperRightCorner:G,center:_,snapBasePoint:M,snapSpacing:O,gridSpacing:x,viewDirectionFromTarget:l,viewTarget:d,lensLength:u,frontClippingPlane:E,backClippingPlane:f,viewHeight:o,aspectRatio:s,snapRotationAngle:W,viewTwistAngle:c,circleSides:v,frozenLayers:[],styleSheet:"",renderMode:A,viewMode:I,ucsIconSetting:m,ucsOrigin:B,ucsXAxis:K,ucsYAxis:V,orthographicType:0,elevation:$,shadePlotSetting:0,majorGridLines:z,backgroundObjectId:J,visualStyleObjectId:Z,isDefaultLightingOn:T,defaultLightingType:h,brightness:C,contrast:R,ambientColor:Y.index}}getCommonTableEntryAttrs(n,a){const e=this.libredwg,i=e.dwg_object_get_tio(a),r=e.dwg_object_object_get_ownerhandle_object(i),o=e.dwg_object_get_handle_object(a);return{handle:L(o.value),ownerHandle:L(r.absolute_ref),name:e.dwg_dynapi_entity_value(n,"name").data}}convertDictionary(n,a){const e=this.libredwg,i=this.getCommonObjectAttrs(a),r=e.dwg_dynapi_entity_value(n,"is_hardowner").data,o=e.dwg_dynapi_entity_value(n,"cloning").data,s=e.dwg_dynapi_entity_value(n,"numitems").data,_=e.dwg_dynapi_entity_value(n,"itemhandles").data,d=e.dwg_ptr_to_object_ref_array(_,s),l=e.dwg_object_dictionary_get_texts(a),c={};return d.forEach((u,E)=>c[l[E]]=L(u.absolute_ref)),{...i,isHardOwner:!!r,cloningFlag:o,entries:c}}convertImageDef(n,a){const e=this.libredwg,i=this.getCommonObjectAttrs(a),r=e.dwg_dynapi_entity_value(n,"image_size").data,o=e.dwg_dynapi_entity_value(n,"file_path").data,s=e.dwg_dynapi_entity_value(n,"is_loaded").data,_=e.dwg_dynapi_entity_value(n,"pixel_size").data,d=e.dwg_dynapi_entity_value(n,"resunits").data;return{...i,fileName:o,size:r,sizeOfOnePixel:_,isLoaded:s,resolutionUnits:d}}convertLayout(n,a){const e=this.libredwg,i=this.getCommonObjectAttrs(a),r=e.dwg_dynapi_entity_value(n,"layout_name").data,o=e.dwg_dynapi_entity_value(n,"tab_order").data,s=e.dwg_dynapi_entity_value(n,"layout_flags").data,_=e.dwg_dynapi_entity_value(n,"INSBASE").data,d=e.dwg_dynapi_entity_value(n,"LIMMIN").data,l=e.dwg_dynapi_entity_value(n,"LIMMAX").data,c=e.dwg_dynapi_entity_value(n,"UCSORG").data,u=e.dwg_dynapi_entity_value(n,"UCSXDIR").data,E=e.dwg_dynapi_entity_value(n,"UCSYDIR").data,f=e.dwg_dynapi_entity_value(n,"UCSORTHOVIEW").data,I=e.dwg_dynapi_entity_value(n,"EXTMIN").data,A=e.dwg_dynapi_entity_value(n,"EXTMAX").data,T=e.dwg_dynapi_entity_value(n,"ucs_elevation").data,h=e.dwg_dynapi_entity_value(n,"block_header").data,C=L(e.dwg_ref_get_absref(h)),R=e.dwg_dynapi_entity_value(n,"active_viewport").data,Y=L(e.dwg_ref_get_absref(R)),g=e.dwg_dynapi_entity_value(n,"named_ucs").data,G=g?L(e.dwg_ref_get_absref(g)):void 0;return{...i,layoutName:r,controlFlag:s,tabOrder:o,minLimit:d,maxLimit:l,insertionPoint:_,minExtent:I,maxExtent:A,elevation:T,ucsOrigin:c,ucsXAxis:u,ucsYAxis:E,orthographicType:f,paperSpaceTableId:C,viewportId:Y,namedUcsId:G,shadePlotId:""}}convertSpatialFilter(n,a){const e=this.libredwg,i=this.getCommonObjectAttrs(a),r=e.dwg_dynapi_entity_value(n,"origin").data,o=e.dwg_dynapi_entity_value(n,"num_clip_verts").data,s=e.dwg_dynapi_entity_value(n,"clip_verts").data,_=e.dwg_ptr_to_point2d_array(s,o),d=e.dwg_dynapi_entity_value(n,"extrusion").data,l=e.dwg_dynapi_entity_value(n,"display_boundary_on").data,c=e.dwg_dynapi_entity_value(n,"front_clip_on").data,u=e.dwg_dynapi_entity_value(n,"front_clip_z").data,E=e.dwg_dynapi_entity_value(n,"back_clip_on").data,f=e.dwg_dynapi_entity_value(n,"back_clip_z").data,I=e.dwg_dynapi_entity_value(n,"transform").data,A=e.dwg_ptr_to_double_array(I,12),T=e.dwg_dynapi_entity_value(n,"inverse_transform").data,h=e.dwg_ptr_to_double_array(T,12);return{...i,origin:r,numberOfPointsOnClipBoundary:o,vertices:_,extrusionDirection:d,clipBoundaryVisible:!!l,frontClippingPlaneFlag:!!c,frontClippingPlaneDistance:u,backClippingPlaneFlag:!!E,backClippingPlaneDistance:f,matrix:A,invertBlockMatrix:h}}getCommonObjectAttrs(n){const a=this.libredwg,e=a.dwg_object_get_tio(n),i=a.dwg_object_object_get_ownerhandle_object(e),r=a.dwg_object_get_handle_object(n);return{handle:L(r.value),ownerHandle:L(i.absolute_ref)}}}class D{constructor(){S(this,"min");S(this,"max");S(this,"valid");this.min={x:1/0,y:1/0},this.max={x:-1/0,y:-1/0},this.valid=!1}expandByPoint(n){return this.min.x=Math.min(this.min.x,n.x),this.min.y=Math.min(this.min.y,n.y),this.max.x=Math.max(this.max.x,n.x),this.max.y=Math.max(this.max.y,n.y),this.valid=!0,this}transform(n,a){const e=this.getCorners().map(i=>({x:i.x*n.x+a.x,y:i.y*n.y+a.y}));this.reset();for(const i of e)this.expandByPoint(i);return this}rotate(n,a){const e=Math.cos(n),i=Math.sin(n),r=this.getCorners().map(o=>{const s=o.x-a.x,_=o.y-a.y;return{x:a.x+s*e-_*i,y:a.y+s*i+_*e}});this.reset();for(const o of r)this.expandByPoint(o);return this}clone(){const n=new D;return n.min={x:this.min.x,y:this.min.y},n.max={x:this.max.x,y:this.max.y},n.valid=this.valid,n}reset(){this.min={x:1/0,y:1/0},this.max={x:-1/0,y:-1/0},this.valid=!1}getCorners(){return[{x:this.min.x,y:this.min.y},{x:this.min.x,y:this.max.y},{x:this.max.x,y:this.min.y},{x:this.max.x,y:this.max.y}]}}function Re(t,n,a,e,i){const r=a.length;if(r===0)throw new Error("points must not be empty");const o=a[0].length;if(t<0||t>1)throw new Error(`t out of bounds [0,1]: ${t}`);if(n<1)throw new Error("degree must be at least 1 (linear)");if(n>r-1)throw new Error("degree must be less than or equal to point count - 1");const s=i??new Array(r).fill(1),_=e??(()=>{const I=[];for(let A=0;A<r+n+1;A++)I.push(A);return I})();if(_.length!==r+n+1)throw new Error("bad knot vector length");const d=[n,_.length-1-n],l=_[d[0]],c=_[d[1]];t=t*(c-l)+l,t=Math.max(t,l),t=Math.min(t,c);let u=d[0];for(;u<d[1]&&!(t>=_[u]&&t<=_[u+1]);u++);const E=new Array(r);for(let I=0;I<r;I++){E[I]=new Array(o+1);for(let A=0;A<o;A++)E[I][A]=a[I][A]*s[I];E[I][o]=s[I]}for(let I=1;I<=n+1;I++)for(let A=u;A>u-n-1+I;A--){const T=_[A+n+1-I]-_[A],h=T===0?0:(t-_[A])/T;for(let C=0;C<o+1;C++)E[A][C]=(1-h)*E[A-1][C]+h*E[A][C]}const f=new Array(o);for(let I=0;I<o;I++)f[I]=Ye(E[u][I]/E[u][o],-9);return f}function Ye(t,n){if(isNaN(t)||!Number.isInteger(n))return NaN;const[a,e="0"]=t.toString().split("e"),i=Math.round(+`${a}e${+e-n}`),[r,o="0"]=i.toString().split("e");return+`${r}e${+o+n}`}const et={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Tt=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];function q(t,n,a){return Math.max(n,Math.min(a,t))}const ot=class ot{constructor(){S(this,"_colorIndex");S(this,"_color");S(this,"_colorName");this._colorIndex=256,this._color=null,this._colorName=null}get color(){return this._color}set color(n){n==null?this._color=null:(this._color=Math.round(q(n,0,256*256*256-1)),this._colorIndex=this.getColorIndexByValue(this._color),this._colorName=this.getColorNameByValue(this._color))}get hexColor(){if(this._color&&this._color>0&&this._color<=16777215){let n=this._color.toString(16).toUpperCase();for(;n.length<6;)n="0"+n;return`0x${n}`}return""}get cssColor(){return`rgb(${this.red},${this.green},${this.blue})`}get red(){return this.color!=null?this.color>>16&255:null}get green(){return this.color!=null?this.color>>8&255:null}get blue(){return this.color!=null?this.color&255:null}get colorIndex(){return this._colorIndex}set colorIndex(n){n==null?this._colorIndex=null:(this._colorIndex=q(n,0,256),this._color=Tt[n],this._colorName=this.getColorNameByValue(this._color))}get colorName(){return this._colorName}set colorName(n){if(n){const a=et[n.toLowerCase()];a!==void 0?(this._colorName=n,this._color=a,this._colorIndex=this.getColorIndexByValue(this._color)):console.warn("Unknown color: "+n)}else this._colorName=null}get hasColorName(){return this._colorName==null}get hasColorIndex(){return this._colorIndex==null}get isByLayer(){return this.colorIndex==256}setByLayer(){return this.colorIndex=256,this}get isByBlock(){return this.colorIndex==0}setByBlock(){return this.colorIndex=0,this}setScalar(n){return this.setRGB(n,n,n),this}setRGB(n,a,e){const i=Math.round(q(n,0,255)),r=Math.round(q(a,0,255)),o=Math.round(q(e,0,255));return this.color=(i<<16)+(r<<8)+o,this}setColorName(n){const a=et[n.toLowerCase()];return a!==void 0?this.color=a:console.warn("Unknown color "+n),this}clone(){const n=new ot;return n.colorIndex=this.colorIndex,n.color=this.color,n._colorName=this._colorName,this}copy(n){return this.colorIndex=n.colorIndex,this.color=n.color,this._colorName=n._colorName,this}equals(n){return n.color==this.color&&n.colorIndex==this.colorIndex&&n._colorName==this._colorName}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this.colorName?this.colorName:this.hexColor}getColorNameByValue(n){for(const[a,e]of Object.entries(et))if(e===n)return a;return null}getColorIndexByValue(n){const a=Tt.length-1;for(let e=1;e<a;++e)if(Tt[e]===n)return e;return null}};S(ot,"NAMES",et);let bt=ot;class p{constructor(n,a){S(this,"x");S(this,"y");this.x=n,this.y=a}add(n){return new p(this.x+n.x,this.y+n.y)}sub(n){return new p(this.x-n.x,this.y-n.y)}multiply(n){return new p(this.x*n,this.y*n)}length(){return Math.sqrt(this.x**2+this.y**2)}norm(){const n=this.length();return n===0?new p(0,0):new p(this.x/n,this.y/n)}}function ge(t,n,a,e=5){let i,r,o;a<0?(i=Math.atan(-a)*4,r=new p(t.x,t.y),o=new p(n.x,n.y)):(i=Math.atan(a)*4,r=new p(n.x,n.y),o=new p(t.x,t.y));const s=o.sub(r),_=s.length(),d=r.add(s.multiply(.5)),l=Math.abs(_/2/Math.tan(i/2)),c=s.norm(),u=new p(c.x*Math.cos(Math.PI/2)-c.y*Math.sin(Math.PI/2),c.y*Math.cos(Math.PI/2)+c.x*Math.sin(Math.PI/2)),E=i<Math.PI?d.add(u.multiply(-l)):d.add(u.multiply(l)),f=Math.atan2(o.y-E.y,o.x-E.x)/Math.PI*180;let I=Math.atan2(r.y-E.y,r.x-E.x)/Math.PI*180;I<f&&(I+=360);const A=o.sub(E).length(),T=Math.floor(f/e)*e+e,h=Math.ceil(I/e)*e-e,C=[];for(let R=T;R<=h;R+=e){const Y=R/180*Math.PI,g=E.add(new p(Math.cos(Y)*A,Math.sin(Y)*A));C.push(g)}return a<0&&C.reverse(),C}function Le(t,n=!1){let a=[];const e=t.vertices.map(i=>({x:i.x,y:i.y,bulge:i.bulge}));n&&e.push(e[0]);for(let i=0,r=e.length;i<r-1;++i){const o=e[i],s=e[i+1];a.push(o),e[i].bulge&&(a=a.concat(ge(o,s,t.vertices[i].bulge))),i===r-2&&a.push(s)}return a}class ve{constructor(){S(this,"blockMap",new Map)}rotate(n,a){const e=Math.cos(a),i=Math.sin(a);return{x:n.x*e-n.y*i,y:n.x*i+n.y*e}}interpolateBSpline(n,a,e,i=25,r){const o=[],s=n.map(l=>[l.x,l.y]),_=[e[a]],d=[e[a],e[e.length-1-a]];for(let l=a+1;l<e.length-a;++l)_[_.length-1]!==e[l]&&_.push(e[l]);for(let l=1;l<_.length;++l){const c=_[l-1],u=_[l];for(let E=0;E<=i;++E){let I=(E/i*(u-c)+c-d[0])/(d[1]-d[0]);I=Math.max(0,Math.min(1,I));const A=Re(I,a,s,e,r);o.push({x:A[0],y:A[1]})}}return o}addFlipXIfApplicable(n,{bbox:a,element:e}){return"extrusionDirection"in n&&n.extrusionDirection.z===-1?{bbox:new D().expandByPoint({x:-a.min.x,y:a.min.y}).expandByPoint({x:-a.max.x,y:a.max.y}),element:`<g transform="matrix(-1 0 0 1 0 0)">${e}</g>`}:{bbox:a,element:e}}line(n){const a=new D().expandByPoint({x:n.startPoint.x,y:n.startPoint.y}).expandByPoint({x:n.endPoint.x,y:n.endPoint.y}),e=`<line x1="${n.startPoint.x}" y1="${n.startPoint.y}" x2="${n.endPoint.x}" y2="${n.endPoint.y}" />`;return{bbox:a,element:e}}ray(n){const e=n.firstPoint,i={x:e.x+n.unitDirection.x*1e4,y:e.y+n.unitDirection.y*1e4},r=new D().expandByPoint(e).expandByPoint(i),o=`<line x1="${e.x}" y1="${e.y}" x2="${i.x}" y2="${i.y}" />`;return{bbox:r,element:o}}xline(n){const e={x:n.firstPoint.x-n.unitDirection.x*1e4,y:n.firstPoint.y-n.unitDirection.y*1e4},i={x:n.firstPoint.x+n.unitDirection.x*1e4,y:n.firstPoint.y+n.unitDirection.y*1e4},r=new D().expandByPoint(e).expandByPoint(i),o=`<line x1="${e.x}" y1="${e.y}" x2="${i.x}" y2="${i.y}" />`;return{bbox:r,element:o}}extractMTextLines(n){return n.replace(/\\U\+([0-9A-Fa-f]{4})/g,(a,e)=>String.fromCharCode(parseInt(e,16))).replace(/\\P/g,`
|
|
2
|
-
`).replace(/\\[LOlo]/g,"").replace(/\\[Ff][^;\\]*?(?:\|[^;\\]*)*;/g,"").replace(/\\[KkCcHhWwTtAa][^;\\]*;?/g,"").replace(/\\[a-zA-Z]+;?/g,"").replace(/%%(d|p|c|%)/gi,"").replace(/\\\\/g,"\\").replace(/\\~/g," ").replace(/[{}]/g,"").split(`
|
|
3
|
-
`).map(a=>a.trim()).filter(a=>a.length>0)}lines(n,a,e,i,r="start"){const o=new D().expandByPoint({x:e.x,y:e.y}).expandByPoint({x:e.x+i,y:e.y-n.length*a*1.5}),s=n.map((_,d)=>{const l=e.x,c=e.y-d*a*1.5,u=`translate(${l},${c}) scale(1,-1) translate(${-l},${-c})`;return`<text x="${l}" y="${c}" font-size="${a}" text-anchor="${r}" transform="${u}">${_}</text>`});return{bbox:o,element:s.join(`
|
|
4
|
-
`)}}mtext(n){const a=n.textHeight,e=n.insertionPoint,i=this.extractMTextLines(n.text),r=n.attachmentPoint;let o="start";return r==w.BottomCenter||r==w.MiddleCenter||r==w.TopCenter?o="middle":(r==w.BottomRight||r==w.MiddleRight||r==w.TopRight)&&(o="end"),this.lines(i,a,e,n.extentsWidth,o)}table(n){const{rowCount:a,columnCount:e,rowHeightArr:i,columnWidthArr:r,startPoint:o,cells:s}=n,_=o.x,d=o.y,l=[];for(let A=0,T=d;A<a;A++){const h=i[A];let C=_;for(let R=0;R<e;R++){const Y=A*e+R,g=s[Y],G=r[R];l.push({x:C,y:T,width:G,height:h,cell:g,row:A,col:R}),C+=G}T+=h}const c=l.map(({x:A,y:T,width:h,height:C,cell:R})=>{const Y=[];R.topBorderVisibility&&Y.push(`<line x1="${A}" y1="${T}" x2="${A+h}" y2="${T}" stroke="black" />`),R.bottomBorderVisibility&&Y.push(`<line x1="${A}" y1="${T+C}" x2="${A+h}" y2="${T+C}" stroke="black" />`),R.leftBorderVisibility&&Y.push(`<line x1="${A}" y1="${T}" x2="${A}" y2="${T+C}" stroke="black" />`),R.rightBorderVisibility&&Y.push(`<line x1="${A+h}" y1="${T}" x2="${A+h}" y2="${T+C}" stroke="black" />`);const g=A+h/2,G=T+C/2+R.textHeight/3,v=`<text x="${g}" y="${G}" font-size="${R.textHeight}" text-anchor="middle" dominant-baseline="middle">${R.text}</text>`;return[...Y,v].join(`
|
|
5
|
-
`)}).join(`
|
|
6
|
-
`),u=r.reduce((A,T)=>A+T,0),E=i.reduce((A,T)=>A+T,0),f=new D().expandByPoint({x:_,y:d}).expandByPoint({x:_+u,y:d+E}),I=`
|
|
7
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${E}" viewBox="${_} ${d} ${u} ${E}">
|
|
8
|
-
${c}
|
|
9
|
-
</svg>
|
|
10
|
-
`.trim();return{bbox:f,element:I}}text(n){const a=n.textHeight,e=n.startPoint,i=[n.text];let r=n.endPoint.x-n.endPoint.x;n.halign==0&&(r=n.text.length*a+n.startPoint.x);let o="start";return n.halign==nt.CENTER?o="middle":n.halign==nt.RIGHT&&(o="end"),this.lines(i,a,e,r,o)}vertices(n,a=!1){const e=n.reduce((r,o)=>r.expandByPoint(o),new D);let i=n.reduce((r,o,s)=>(r+=s===0?"M":"L",r+=o.x+","+o.y,r),"");return a&&(i+="Z"),{bbox:e,element:`<path d="${i}" />`}}circle(n){const a=new D().expandByPoint({x:n.center.x+n.radius,y:n.center.y+n.radius}).expandByPoint({x:n.center.x-n.radius,y:n.center.y-n.radius}),e=`<circle cx="${n.center.x}" cy="${n.center.y}" r="${n.radius}" />`;return{bbox:a,element:e}}ellipseOrArc(n,a,e,i,r,o,s){const _=Math.sqrt(e*e+i*i),d=r*_,l=-Math.atan2(-i,e),c=this.bboxEllipseOrArc(n,a,e,i,r,o,s);if(Math.abs(o-s)<1e-9||Math.abs(o-s+Math.PI*2)<1e-9){const u=`<g transform="rotate(${l/Math.PI*180} ${n}, ${a})"><ellipse cx="${n}" cy="${a}" rx="${_}" ry="${d}" /></g>`;return{bbox:c,element:u}}else{const u=this.rotate({x:Math.cos(o)*_,y:Math.sin(o)*d},l),E={x:n+u.x,y:a+u.y},f=this.rotate({x:Math.cos(s)*_,y:Math.sin(s)*d},l),I={x:n+f.x,y:a+f.y},T=(s<o?s+Math.PI*2:s)-o<Math.PI?0:1,C=`<path d="${`M ${E.x} ${E.y} A ${_} ${d} ${l/Math.PI*180} ${T} 1 ${I.x} ${I.y}`}" />`;return{bbox:c,element:C}}}bboxEllipseOrArc(n,a,e,i,r,o,s){for(;o<0;)o+=Math.PI*2;for(;s<=o;)s+=Math.PI*2;const _=[];if(Math.abs(e)<1e-12||Math.abs(i)<1e-12)for(let E=0;E<4;E++)_.push(E/2*Math.PI);else _[0]=Math.atan(-i*r/e)-Math.PI,_[1]=Math.atan(e*r/i)-Math.PI,_[2]=_[0]-Math.PI,_[3]=_[1]-Math.PI;for(let E=4;E>=0;E--){for(;_[E]<o;)_[E]+=Math.PI*2;_[E]>s&&_.splice(E,1)}_.push(o),_.push(s);const d=_.map(E=>({x:Math.cos(E),y:Math.sin(E)})),l=[[e,-i*r],[i,e*r]];return d.map(E=>({x:E.x*l[0][0]+E.y*l[0][1]+n,y:E.x*l[1][0]+E.y*l[1][1]+a})).reduce((E,f)=>(E.expandByPoint(f),E),new D)}ellipse(n){const{bbox:a,element:e}=this.ellipseOrArc(n.center.x,n.center.y,n.majorAxisEndPoint.x,n.majorAxisEndPoint.y,n.axisRatio,n.startAngle,n.endAngle);return{bbox:a,element:e}}arc(n){const{bbox:a,element:e}=this.ellipseOrArc(n.center.x,n.center.y,n.radius,0,1,n.startAngle,n.endAngle);return{bbox:a,element:e}}dimension(n){const a=this.blockMap.get(n.name);return a?{bbox:a.bbox,element:`<use href="#${n.name}" />`}:null}insert(n){const a=this.blockMap.get(n.name);if(a){const e=n.insertionPoint,i=n.rotation*(180/Math.PI),r=`translate(${e.x},${e.y}) rotate(${i}) scale(${n.xScale},${n.yScale})`;return{bbox:a.bbox.clone().transform({x:n.xScale,y:n.yScale},{x:e.x,y:e.y}).rotate(n.rotation,e),element:`<use href="#${n.name}" transform="${r}" />`}}return null}block(n,a){const e=n.entities,{bbox:i,elements:r}=e.reduce((o,s)=>{const _=this.entityToBoundsAndElement(s);if(_){const{bbox:d,element:l}=_;d.valid&&(o.bbox.expandByPoint(d.min),o.bbox.expandByPoint(d.max));const c=this.getEntityColor(a.tables.LAYER.entries,s),u=s.type=="TEXT"||s.type=="MTEXT"?c.cssColor:"none";c.isByBlock?o.elements.push(`<g id="${s.handle}">${l}</g>`):o.elements.push(`<g id="${s.handle}" stroke="${c.cssColor}" fill="${u}">${l}</g>`)}return o},{bbox:new D,elements:[]});return i.valid?{bbox:i,element:`<g id="${n.name}">${r.join(`
|
|
11
|
-
`)}</g>`}:null}entityToBoundsAndElement(n){let a=null;switch(n.type){case"ARC":a=this.arc(n);break;case"CIRCLE":a=this.circle(n);break;case"DIMENSION":a=this.dimension(n);break;case"ELLIPSE":a=this.ellipse(n);break;case"INSERT":a=this.insert(n);break;case"LINE":a=this.line(n);break;case"LWPOLYLINE":{const e=n,i=!!(e.flag&512),r=Le(e,i);a=this.vertices(r,i);break}case"MTEXT":a=this.mtext(n);break;case"SPLINE":{const e=n;a=this.vertices(this.interpolateBSpline(e.controlPoints,e.degree,e.knots,25,e.weights));break}case"POLYLINE":break;case"RAY":a=this.ray(n);break;case"TABLE":a=this.table(n);break;case"TEXT":a=this.text(n);break;case"XLINE":a=this.xline(n);break;default:a=null;break}return a?this.addFlipXIfApplicable(n,a):null}getEntityColor(n,a){const e=new bt;if(a.colorIndex!=null?e.colorIndex=a.colorIndex:a.colorName?e.colorName=a.colorName:a.color!=null&&(e.color=a.color),e.colorIndex==7&&(e.colorIndex=256),e.isByLayer){const i=n.find(r=>r.name===a.layer);i!=null&&(e.colorIndex=i.colorIndex)}return e.color==null&&(e.color=16777215),e}convert(n){let a=null;this.blockMap.clear();let e="";n.tables.BLOCK_RECORD.entries.forEach(o=>{if(an(o.name))a=o;else{const s=this.block(o,n);s&&(e+=s.element,this.blockMap.set(o.name,s))}});const i=this.block(a,n),r=i&&i.bbox.valid?{x:i.bbox.min.x,y:-i.bbox.max.y,width:i.bbox.max.x-i.bbox.min.x,height:i.bbox.max.y-i.bbox.min.y}:{x:0,y:0,width:0,height:0};return`<?xml version="1.0"?>
|
|
12
|
-
<svg
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
|
|
15
|
-
preserveAspectRatio="xMinYMin meet"
|
|
16
|
-
viewBox="${r.x} ${r.y} ${r.width} ${r.height}"
|
|
17
|
-
width="100%" height="100%"
|
|
18
|
-
>
|
|
19
|
-
<defs>${e}</defs>
|
|
20
|
-
<g stroke="#000000" stroke-width="0.1%" fill="none" transform="matrix(1,0,0,-1,0,0)">
|
|
21
|
-
${i?i.element:""}
|
|
22
|
-
</g>
|
|
23
|
-
</svg>`}}var Ft;(function(t){t[t.BMP=2]="BMP",t[t.WMF=3]="WMF",t[t.PNG=6]="PNG"})(Ft||(Ft={}));const rt=class rt{constructor(n){S(this,"wasmInstance");S(this,"decoder");return this.wasmInstance=n,new Proxy(this,{get:(a,e,i)=>e in a?Reflect.get(a,e,i):Reflect.get(a.wasmInstance,e,i)})}dwg_read_data(n,a){if(a==it.DWG){const e="tmp.dwg";try{this.wasmInstance.FS.writeFile(e,new Uint8Array(n));const i=this.wasmInstance.dwg_read_file(e);return i.error!=0&&console.log("Open dwg file with error code: ",i.error),i.data}finally{this.wasmInstance.FS.analyzePath(e,!1).exists&&this.wasmInstance.FS.unlink(e)}}}dwg_write_dxf(n){const a="tmp.dwg",e="tmp.dxf";try{this.wasmInstance.FS.writeFile(a,new Uint8Array(n));const i=this.wasmInstance.dwg_write_dxf(a,e);return i!=0?(console.log("Convert dwg to dxf with error code: ",i),null):this.wasmInstance.FS.readFile(e)}finally{this.wasmInstance.FS.analyzePath(a,!1).exists&&this.wasmInstance.FS.unlink(a),this.wasmInstance.FS.analyzePath(e,!1).exists&&this.wasmInstance.FS.unlink(e)}}dwg_get_version_type(n){const a=this.wasmInstance.dwg_get_version_type(n);return en[a]}dwg_get_codepage(n){return this.wasmInstance.dwg_get_codepage(n)}dwg_bmp(n){return this.wasmInstance.dwg_bmp(n)}dwg_get_num_classes(n){return this.wasmInstance.dwg_get_num_classes(n)}dwg_get_class(n,a){return this.wasmInstance.dwg_get_class(n,a)}convert(n){const a=this.dwg_get_codepage(n),e=ht(a);return this.decoder=new TextDecoder(e),new zt(this).convert(n)}convertEx(n){const a=this.dwg_get_codepage(n),e=ht(a);this.decoder=new TextDecoder(e);const i=new zt(this);return{database:i.convert(n),stats:i.getConversionStats()}}dwg_to_svg(n){return new ve().convert(n)}dwg_free(n){this.wasmInstance.dwg_free(n)}dwg_free_object(n){this.wasmInstance.dwg_free_object(n)}dwg_ref_object(n,a){return this.wasmInstance.dwg_ref_object(n,a)}dwg_ref_object_silent(n,a){return this.wasmInstance.dwg_ref_object_silent(n,a)}dwg_ref_object_relative(n,a,e){return this.wasmInstance.dwg_ref_object_relative(n,a,e)}dwg_resolve_handle(n,a){return this.wasmInstance.dwg_resolve_handle(n,a)}dwg_resolve_handle_silent(n,a){return this.wasmInstance.dwg_resolve_handle_silent(n,a)}dwg_resolve_handleref(n,a){return this.wasmInstance.dwg_resolve_handleref(n,a)}dwg_ref_get_object_name(n){const a=this.wasmInstance,e=a.dwg_ref_get_object(n),i=a.dwg_object_to_object_tio(e);return this.dwg_dynapi_entity_value(i,"name").data}dwg_obj_obj_to_object(n){return this.wasmInstance.dwg_obj_obj_to_object(n)}dwg_obj_generic_to_object(n){return this.wasmInstance.dwg_obj_generic_to_object(n)}dwg_object_to_object(n){return this.wasmInstance.dwg_object_to_object(n)}dwg_object_to_object_tio(n){return this.wasmInstance.dwg_object_to_object_tio(n)}dwg_object_to_entity(n){return this.wasmInstance.dwg_object_to_entity(n)}dwg_object_to_entity_tio(n){return this.wasmInstance.dwg_object_to_entity_tio(n)}dwg_getall_entities_in_model_space(n){const a=this.wasmInstance,e=a.dwg_model_space_object(n),i=[];let r=a.get_first_owned_entity(e);for(;r;)i.push(r),r=a.get_next_owned_entity(e,r);return i}dwg_getall_object_by_type(n,a){const e=this.wasmInstance,i=e.dwg_get_num_objects(n),r=[];for(let o=0;o<i;o++){const s=e.dwg_get_object(n,o),_=e.dwg_object_to_object_tio(s);_&&e.dwg_object_get_fixedtype(s)==a&&r.push(_)}return r}dwg_getall_entity_by_type(n,a){const e=this.wasmInstance,i=e.dwg_get_num_objects(n),r=[];for(let o=0;o<i;o++){const s=e.dwg_get_object(n,o),_=e.dwg_object_to_entity_tio(s);_&&e.dwg_object_get_fixedtype(s)==a&&r.push(_)}return r}dwg_getall_LAYER(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_LAYER)}dwg_getall_LTYPE(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_LTYPE)}dwg_getall_STYLE(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_STYLE)}dwg_getall_DIMSTYLE(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_DIMSTYLE)}dwg_getall_VPORT(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_VPORT)}dwg_getall_LAYOUT(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_LAYOUT)}dwg_getall_BLOCK(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_BLOCK)}dwg_getall_BLOCK_HEADER(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_BLOCK_HEADER)}dwg_getall_IMAGEDEF(n){return this.dwg_getall_object_by_type(n,P.DWG_TYPE_IMAGEDEF)}dwg_getall_VERTEX_2D(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_VERTEX_2D)}dwg_getall_VERTEX_3D(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_VERTEX_3D)}dwg_getall_POLYLINE_2D(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_POLYLINE_2D)}dwg_getall_POLYLINE_3D(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_POLYLINE_3D)}dwg_getall_IMAGE(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_IMAGE)}dwg_getall_LWPOLYLINE(n){return this.dwg_getall_entity_by_type(n,P.DWG_TYPE_LWPOLYLINE)}dwg_ptr_to_object_ref_array(n,a){return this.wasmInstance.dwg_ptr_to_object_ref_array(n,a)}dwg_ptr_to_object_ref_ptr_array(n,a){return this.wasmInstance.dwg_ptr_to_object_ref_ptr_array(n,a)}dwg_ptr_to_wchar_string_array(n,a){return this.wasmInstance.dwg_ptr_to_wchar_string_array(n,a)}dwg_ptr_to_unsigned_char_array(n,a){return this.wasmInstance.dwg_ptr_to_unsigned_char_array(n,a)}dwg_ptr_to_signed_char_array(n,a){return this.wasmInstance.dwg_ptr_to_signed_char_array(n,a)}dwg_ptr_to_uint16_t_array(n,a){return this.wasmInstance.dwg_ptr_to_uint16_t_array(n,a)}dwg_ptr_to_int16_t_array(n,a){return this.wasmInstance.dwg_ptr_to_int16_t_array(n,a)}dwg_ptr_to_uint32_t_array(n,a){return this.wasmInstance.dwg_ptr_to_uint32_t_array(n,a)}dwg_ptr_to_int32_t_array(n,a){return this.wasmInstance.dwg_ptr_to_int32_t_array(n,a)}dwg_ptr_to_uint64_t_array(n,a){return this.wasmInstance.dwg_ptr_to_uint64_t_array(n,a)}dwg_ptr_to_int64_t_array(n,a){return this.wasmInstance.dwg_ptr_to_int64_t_array(n,a)}dwg_ptr_to_double_array(n,a){return this.wasmInstance.dwg_ptr_to_double_array(n,a)}dwg_ptr_to_point2d_array(n,a){return this.wasmInstance.dwg_ptr_to_point2d_array(n,a)}dwg_ptr_to_point3d_array(n,a){return this.wasmInstance.dwg_ptr_to_point3d_array(n,a)}dwg_ptr_to_point4d_array(n,a){return this.wasmInstance.dwg_ptr_to_point4d_array(n,a)}dwg_ptr_to_ltype_dash_array(n,a){return this.wasmInstance.dwg_ptr_to_ltype_dash_array(n,a)}dwg_ptr_to_table_cell_array(n,a){return this.wasmInstance.dwg_ptr_to_table_cell_array(n,a)}dwg_ptr_to_hatch_defline_array(n,a){return this.wasmInstance.dwg_ptr_to_hatch_defline_array(n,a)}dwg_ptr_to_hatch_path_array(n,a){return this.wasmInstance.dwg_ptr_to_hatch_path_array(n,a)}dwg_ptr_to_hatch_gradient_color_array(n,a){return this.wasmInstance.dwg_ptr_to_hatch_gradient_color_array(n,a)}dwg_ptr_to_mline_vertex_array(n,a){return this.wasmInstance.dwg_ptr_to_mline_vertex_array(n,a)}dwg_dynapi_entity_value(n,a){const e=this.wasmInstance.dwg_dynapi_entity_value(n,a);return e.bin&&this.decoder&&(e.data=this.decoder.decode(e.bin)),e}dwg_dynapi_header_value(n,a){return this.wasmInstance.dwg_dynapi_header_value(n,a)}dwg_dynapi_common_value(n,a){return this.wasmInstance.dwg_dynapi_common_value(n,a)}dwg_dynapi_subclass_value(n,a,e){return this.wasmInstance.dwg_dynapi_subclass_value(n,a,e)}dwg_object_get_handle_object(n){return this.wasmInstance.dwg_object_get_handle_object(n)}dwg_object_object_get_handle_object(n){return this.wasmInstance.dwg_object_object_get_handle_object(n)}dwg_object_object_get_ownerhandle_object(n){return this.wasmInstance.dwg_object_object_get_ownerhandle_object(n)}dwg_object_entity_get_handle_object(n){return this.wasmInstance.dwg_object_entity_get_handle_object(n)}dwg_object_entity_get_ownerhandle_object(n){return this.wasmInstance.dwg_object_entity_get_ownerhandle_object(n)}dwg_object_entity_get_xdicobjhandle_object(n){return this.wasmInstance.dwg_object_entity_get_xdicobjhandle_object(n)}dwg_object_entity_get_layer_object_ref(n){return this.wasmInstance.dwg_object_entity_get_layer_object_ref(n)}dwg_object_entity_get_ltype_object_ref(n){return this.wasmInstance.dwg_object_entity_get_ltype_object_ref(n)}dwg_object_entity_get_color_object(n){return this.wasmInstance.dwg_object_entity_get_color_object(n)}dwg_object_entity_get_xdata(n){return this.wasmInstance.dwg_object_entity_get_xdata(n)}dwg_entity_owner(n){return this.wasmInstance.dwg_entity_owner(n)}dwg_entity_get_block_name(n,a){const e=this.wasmInstance,i=e.dwg_dynapi_entity_value(n,a).data,r=e.dwg_ref_get_object(i),o=e.dwg_object_to_object_tio(r);return this.dwg_entity_block_header_get_block(o).name}dwg_entity_get_dimstyle_name(n,a="dimstyle"){const e=this.wasmInstance,i=e.dwg_dynapi_entity_value(n,a).data,r=e.dwg_ref_get_object(i),o=e.dwg_object_to_object_tio(r);return this.dwg_dynapi_entity_value(o,"name").data}dwg_entity_block_header_get_block(n){const a=this.wasmInstance,e=a.dwg_dynapi_entity_value(n,"block_entity").data,i=a.dwg_ref_get_object(e),r=a.dwg_object_to_entity_tio(i),o=a.dwg_dynapi_entity_value(r,"name").data,s=a.dwg_dynapi_entity_value(r,"base_pt").data;return{name:o,base_pt:s}}dwg_entity_block_header_get_preview(n){return this.wasmInstance.dwg_entity_block_header_get_preview(n).data}get_first_owned_entity(n){return this.wasmInstance.get_first_owned_entity(n)}get_next_owned_entity(n,a){return this.wasmInstance.get_next_owned_entity(n,a)}dwg_entity_mtext_get_style_name(n){const a=this.wasmInstance,e=a.dwg_dynapi_entity_value(n,"style").data,i=a.dwg_ref_get_object(e),r=a.dwg_object_to_object_tio(i);return a.dwg_dynapi_entity_value(r,"name").data}dwg_entity_text_get_style_name(n){return this.dwg_entity_mtext_get_style_name(n)}dwg_entity_polyline_2d_get_numpoints(n){return this.wasmInstance.dwg_entity_polyline_2d_get_numpoints(n).data}dwg_entity_polyline_2d_get_points(n){return this.wasmInstance.dwg_entity_polyline_2d_get_points(n).data}dwg_entity_polyline_2d_get_vertices(n){return this.wasmInstance.dwg_entity_polyline_2d_get_vertices(n).data}dwg_entity_polyline_3d_get_numpoints(n){return this.wasmInstance.dwg_entity_polyline_3d_get_numpoints(n).data}dwg_entity_polyline_3d_get_points(n){return this.wasmInstance.dwg_entity_polyline_3d_get_points(n).data}dwg_entity_polyline_3d_get_vertices(n){return this.wasmInstance.dwg_entity_polyline_3d_get_vertices(n).data}dwg_entity_insert_get_attribs(n){return this.wasmInstance.dwg_entity_insert_get_attribs(n).data}dwg_object_dictionary_get_texts(n){return this.wasmInstance.dwg_object_dictionary_get_texts(n).data}static createByWasmInstance(n){return this.instance==null?new rt(n):this.instance}static async create(n){const a=n==null?await Ot():await Ot({locateFile:e=>`${n}/${e}`});return this.createByWasmInstance(a)}};S(rt,"instance");let Ut=rt;const Jt=Object.freeze(Object.defineProperty({__proto__:null,get DwgAttachmentPoint(){return w},get DwgBoundaryPathEdgeType(){return F},get DwgBoundaryPathTypeFlag(){return pt},get DwgCodePage(){return ft},get DwgDictionaryCloningFlags(){return xt},get DwgDimensionTextHorizontal(){return vt},get DwgDimensionTextLineSpacing(){return Rt},get DwgDimensionTextVertical(){return Yt},get DwgDimensionToleranceTextVertical(){return Nt},get DwgDimensionType(){return Ct},get DwgDimensionZeroSuppression(){return gt},get DwgDimensionZeroSuppressionAngular(){return Lt},get DwgHatchAssociativity(){return j},get DwgHatchBoundaryAnnotation(){return Dt},get DwgHatchGradientColorFlag(){return tt},get DwgHatchGradientFlag(){return at},get DwgHatchPatternType(){return Gt},get DwgHatchSolidFill(){return Q},get DwgHatchStyle(){return St},get DwgPolylineFlag(){return yt},get DwgSmoothType(){return Wt},get DwgTextGenerationFlag(){return Mt},get DwgTextHorizontalAlign(){return nt},get DwgTextVerticalAlign(){return mt},get DwgThumbnailImageType(){return Ft},get Dwg_Color_Method(){return Bt},get Dwg_File_Type(){return it},get Dwg_Hatch_Edge_Type(){return U},get Dwg_Object_Supertype(){return wt},get Dwg_Object_Type(){return P},Dwg_Object_Type_Inverted:Pe,HEADER_VARIABLES:nn,LibreDwg:Ut,createModule:Ot,dwgCodePageToEncoding:ht,dwgVersions:en},Symbol.toStringTag,{value:"Module"}));
|
|
24
|
-
//# sourceMappingURL=dwg-worker.js.map
|