var kd=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var du=Object.getOwnPropertyNames;var hu=Object.prototype.hasOwnProperty;var sr=(r,e)=>()=>(r&&(e=r(r=0)),e);var uu=(r,e)=>{for(var t in e)kd(r,t,{get:e[t],enumerable:!0})},mu=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of du(e))!hu.call(r,s)&&s!==t&&kd(r,s,{get:()=>e[s],enumerable:!(i=cu(e,s))||i.enumerable});return r};var pu=r=>mu(kd({},"__esModule",{value:!0}),r);var h,T=sr(()=>{h=class{static beginSection="SECTION";static blkRefObjectContextData="ACDB_BLKREFOBJECTCONTEXTDATA_CLASS";static blkRefToken="{BLKREFS";static block="BLOCK";static blocksSection="BLOCKS";static classEntry="CLASS";static classesSection="CLASSES";static customData="CUSTOMDATA";static dictionaryToken="{ACAD_XDICTIONARY";static endBlock="ENDBLK";static endOfFile="EOF";static endSection="ENDSEC";static endSequence="SEQEND";static endTable="ENDTAB";static entitiesSection="ENTITIES";static entity3DFace="3DFACE";static entity3DSolid="3DSOLID";static entityAecWall="AEC_WALL";static entityArc="ARC";static entityAttribute="ATTRIB";static entityAttributeDefinition="ATTDEF";static entityBody="BODY";static entityCircle="CIRCLE";static entityCoordinationModel="COORDINATION MODEL";static entityDimension="DIMENSION";static entityEllipse="ELLIPSE";static entityHatch="HATCH";static entityHelix="HELIX";static entityImage="IMAGE";static entityInsert="INSERT";static entityLeader="LEADER";static entityLight="LIGHT";static entityLine="LINE";static entityLwPolyline="LWPOLYLINE";static entityMesh="MESH";static entityMLine="MLINE";static entityMText="MTEXT";static entityMultiLeader="MULTILEADER";static entityOle2Frame="OLE2FRAME";static entityOleFrame="OLEFRAME";static entityPdfUnderlay="PDFUNDERLAY";static entityPoint="POINT";static entityPolyFaceMesh="PFACE";static entityPolyline="POLYLINE";static entityProxyEntity="ACAD_PROXY_ENTITY";static entityRay="RAY";static entityRegion="REGION";static entitySection="SECTION";static entitySeqend="SEQEND";static entityShape="SHAPE";static entitySolid="SOLID";static entitySpline="SPLINE";static entitySun="SUN";static entitySurface="SURFACE";static entityTable="ACAD_TABLE";static entityText="TEXT";static entityTolerance="TOLERANCE";static entityTrace="TRACE";static entityUnderlay="UNDERLAY";static entityVertex="VERTEX";static entityViewport="VIEWPORT";static entityWipeout="WIPEOUT";static entityXline="XLINE";static formattedTableDataColumn_BEGIN="FORMATTEDTABLEDATACOLUMN_BEGIN";static formattedTableDataColumn_END="FORMATTEDTABLEDATACOLUMN_END";static formattedTableDataRow_BEGIN="FORMATTEDTABLEDATAROW_BEGIN";static formattedTableDataRow_END="FORMATTEDTABLEDATAROW_END";static headerSection="HEADER";static linkedTableDataCell_BEGIN="LINKEDTABLEDATACELL_BEGIN";static linkedTableDataCell_END="LINKEDTABLEDATACELL_END";static linkedTableDataColumn_BEGIN="LINKEDTABLEDATACOLUMN_BEGIN";static linkedTableDataColumn_END="LINKEDTABLEDATACOLUMN_END";static linkedTableDataRow_BEGIN="LINKEDTABLEDATAROW_BEGIN";static linkedTableDataRow_END="LINKEDTABLEDATAROW_END";static mTextAttributeObjectContextData="ACDB_MTEXTATTRIBUTEOBJECTCONTEXTDATA_CLASS";static objectAecCleanupGroupDef="AEC_CLEANUP_GROUP_DEF";static objectAecWallStyle="AEC_WALL_STYLE";static objectBinRecord="BINRECORD";static objectBlockBasePointParameter="BLOCKBASEPOINTPARAMETER";static objectBlockFlipAction="BLOCKFLIPACTION";static objectBlockFlipParameter="BLOCKFLIPPARAMETER";static objectBlockGripLocationComponent="BLOCKGRIPLOCATIONCOMPONENT";static objectBlockLinearParameter="BLOCKLINEARPARAMETER";static objectBlockPointParameter="BLOCKPOINTPARAMETER";static objectBlockRepresentationData="ACDB_BLOCKREPRESENTATION_DATA";static objectBlockRotateAction="BLOCKROTATEACTION";static objectBlockRotationGrip="BLOCKROTATIONGRIP";static objectBlockRotationParameter="BLOCKROTATIONPARAMETER";static objectBlockVisibilityGrip="BLOCKVISIBILITYGRIP";static objectBlockVisibilityParameter="BLOCKVISIBILITYPARAMETER";static objectCell="CELL";static objectCellStyleMap="CELLSTYLEMAP";static objectDBColor="DBCOLOR";static objectDictionary="DICTIONARY";static objectDictionaryVar="DICTIONARYVAR";static objectDictionaryWithDefault="ACDBDICTIONARYWDFLT";static objectDimensionAssociation="DIMASSOC";static objectEvalGraph="ACAD_EVALUATION_GRAPH";static objectField="FIELD";static objectFieldList="FIELDLIST";static objectGeoData="GEODATA";static objectGroup="GROUP";static objectImageDefinition="IMAGEDEF";static objectImageDefinitionReactor="IMAGEDEF_REACTOR";static objectLayout="LAYOUT";static objectMaterial="MATERIAL";static objectMLeaderContextData="ACDB_MLEADEROBJECTCONTEXTDATA_CLASS";static objectMLeaderStyle="MLEADERSTYLE";static objectMLineStyle="MLINESTYLE";static objectPdfDefinition="PDFDEFINITION";static objectPlaceholder="ACDBPLACEHOLDER";static objectPlotSettings="PLOTSETTINGS";static objectProxyObject="ACAD_PROXY_OBJECT";static objectRasterVariables="RASTERVARIABLES";static objectScale="SCALE";static objectSortEntsTable="SORTENTSTABLE";static objectSpatialFilter="SPATIAL_FILTER";static objectsSection="OBJECTS";static objectTableColumn="COLUMN";static objectTableColumnBegin="TABLECOLUMN_BEGIN";static objectTableColumnEnd="TABLECOLUMN_END";static objectTableContent="TABLECONTENT";static objectTableRow="ROW";static objectTableRowBegin="TABLEROW_BEGIN";static objectTableRowEnd="TABLEOW_END";static objectTableStyle="TABLESTYLE";static objectVisualStyle="VISUALSTYLE";static objectXRecord="XRECORD";static reactorsToken="{ACAD_REACTORS";static tableAppId="APPID";static tableBlockRecord="BLOCK_RECORD";static tableDimstyle="DIMSTYLE";static tableEntry="TABLE";static tableGroup="GROUP";static tableLayer="LAYER";static tableLinetype="LTYPE";static tablesSection="TABLES";static tableStyle="STYLE";static tableUcs="UCS";static tableView="VIEW";static tableVport="VPORT"}});var d,D=sr(()=>{d=class{static aecWall="AecDbWall";static aecDbWallStyle="AecDbWallStyle";static aecDbCleanupGroupDef="AecDbCleanupGroupDef";static binRecord="BinRecord";static applicationId="AcDbRegAppTableRecord";static acDbPlaceHolder="AcDbPlaceHolder";static alignedDimension="AcDbAlignedDimension";static angular2LineDimension="AcDb2LineAngularDimension";static angular3PointDimension="AcDb3PointAngularDimension";static annotScaleObjectContextData="AcDbAnnotScaleObjectContextData";static arc="AcDbArc";static attribute="AcDbAttribute";static attributeDefinition="AcDbAttributeDefinition";static blkRefObjectContextData="AcDbBlkRefObjectContextData";static block1PtParameter="AcDbBlock1PtParameter";static block2PtParameter="AcDbBlock2PtParameter";static blockAction="AcDbBlockAction";static blockActionBasePt="AcDbBlockActionWithBasePt";static blockBasePointParameter="AcDbBlockBasePointParameter";static blockBegin="AcDbBlockBegin";static blockElement="AcDbBlockElement";static blockEnd="AcDbBlockEnd";static blockFlipAction="AcDbBlockFlipAction";static blockFlipGrip="AcDbBlockFlipGrip";static blockFlipParameter="AcDbBlockFlipParameter";static blockGrip="AcDbBlockGrip";static blockGripExpression="AcDbBlockGripExpr";static blockLinearParameter="AcDbBlockLinearParameter";static blockParameter="AcDbBlockParameter";static blockRecord="AcDbBlockTableRecord";static blockRepresentationData="AcDbBlockRepresentationData";static blockRotationAction="AcDbBlockRotationAction";static blockRotationGrip="AcDbBlockRotationGrip";static blockRotationParameter="AcDbBlockRotationParameter";static blockVisibilityGrip="AcDbBlockVisibilityGrip";static blockVisibilityParameter="AcDbBlockVisibilityParameter";static cellStyleMap="AcDbCellStyleMap";static circle="AcDbCircle";static dbColor="AcDbColor";static diametricDimension="AcDbDiametricDimension";static dictionary="AcDbDictionary";static dictionaryVar="AcDbDictionaryVar";static dictionaryVariables="DictionaryVariables";static dictionaryWithDefault="AcDbDictionaryWithDefault";static dimension="AcDbDimension";static dimensionStyle="AcDbDimStyleTableRecord";static dimensionStyleTable="AcDbDimStyleTable";static dimensionAssociation="AcDbDimAssoc";static ellipse="AcDbEllipse";static entity="AcDbEntity";static evalGraph="AcDbEvalGraph";static evalGraphExpr="AcDbEvalExpr";static face3d="AcDbFace";static field="AcDbField";static fieldList="AcDbFieldList";static filter="AcDbFilter";static formattedTableData="AcDbFormattedTableData";static geoData="AcDbGeoData";static group="AcDbGroup";static hatch="AcDbHatch";static helix="AcDbHelix";static idSet="AcDbIdSet";static insert="AcDbBlockReference";static layer="AcDbLayerTableRecord";static layout="AcDbLayout";static leader="AcDbLeader";static line="AcDbLine";static linearDimension="AcDbRotatedDimension";static linetype="AcDbLinetypeTableRecord";static linkedData="AcDbLinkedData";static linkedTableData="AcDbLinkedTableData";static lwPolyline="AcDbPolyline";static material="AcDbMaterial";static mesh="AcDbSubDMesh";static mInsert="AcDbMInsertBlock";static mLeaderStyle="AcDbMLeaderStyle";static mLine="AcDbMline";static mLineStyle="AcDbMlineStyle";static modelerGeometry="AcDbModelerGeometry";static mText="AcDbMText";static mTextAttributeObjectContextData="AcDbMTextAttributeObjectContextData";static multiLeader="AcDbMLeader";static multiLeaderObjectContextData="AcDbMLeaderObjectContextData";static objectContextData="AcDbObjectContextData";static ole2Frame="AcDbOle2Frame";static ordinateDimension="AcDbOrdinateDimension";static pdfDefinition="AcDbPdfDefinition";static pdfReference="AcDbPdfReference";static plotSettings="AcDbPlotSettings";static point="AcDbPoint";static polyfaceMesh="AcDbPolyFaceMesh";static polyfaceMeshFace="AcDbFaceRecord";static polyfaceMeshVertex="AcDbPolyFaceMeshVertex";static polygonMesh="AcDbPolygonMesh";static polygonMeshVertex="AcDbPolygonMeshVertex";static polyline="AcDb2dPolyline";static polyline3d="AcDb3dPolyline";static polyline3dVertex="AcDb3dPolylineVertex";static polylineVertex="AcDb2dVertex";static proxyEntity="AcDbProxyEntity";static proxyObject="AcDbProxyObject";static radialDimension="AcDbRadialDimension";static rasterImage="AcDbRasterImage";static rasterImageDef="AcDbRasterImageDef";static rasterImageDefReactor="AcDbRasterImageDefReactor";static rasterVariables="AcDbRasterVariables";static ray="AcDbRay";static scale="AcDbScale";static shape="AcDbShape";static solid="AcDbTrace";static solid3D="AcDb3dSolid";static sortentsTable="AcDbSortentsTable";static spatialFilter="AcDbSpatialFilter";static spline="AcDbSpline";static table="AcDbSymbolTable";static tableContent="AcDbTableContent";static tableEntity="AcDbTable";static tableRecord="AcDbSymbolTableRecord";static tableStyle="AcDbTableStyle";static text="AcDbText";static textStyle="AcDbTextStyleTableRecord";static tolerance="AcDbFcf";static trace="AcDbTrace";static ucs="AcDbUCSTableRecord";static underlay="AcDbUnderlayReference";static underlayDefinition="AcDbUnderlayDefinition";static vertex="AcDbVertex";static view="AcDbViewTableRecord";static viewport="AcDbViewport";static visualStyle="AcDbVisualStyle";static vPort="AcDbViewportTableRecord";static wipeout="AcDbWipeout";static xLine="AcDbXline";static xRecord="AcDbXrecord"}});var m,B=sr(()=>{(function(r){r[r.UNLISTED=-999]="UNLISTED",r[r.INVALID=-1]="INVALID",r[r.UNDEFINED=0]="UNDEFINED",r[r.TEXT=1]="TEXT",r[r.ATTRIB=2]="ATTRIB",r[r.ATTDEF=3]="ATTDEF",r[r.BLOCK=4]="BLOCK",r[r.ENDBLK=5]="ENDBLK",r[r.SEQEND=6]="SEQEND",r[r.INSERT=7]="INSERT",r[r.MINSERT=8]="MINSERT",r[r.UNKNOW_9=9]="UNKNOW_9",r[r.VERTEX_2D=10]="VERTEX_2D",r[r.VERTEX_3D=11]="VERTEX_3D",r[r.VERTEX_MESH=12]="VERTEX_MESH",r[r.VERTEX_PFACE=13]="VERTEX_PFACE",r[r.VERTEX_PFACE_FACE=14]="VERTEX_PFACE_FACE",r[r.POLYLINE_2D=15]="POLYLINE_2D",r[r.POLYLINE_3D=16]="POLYLINE_3D",r[r.ARC=17]="ARC",r[r.CIRCLE=18]="CIRCLE",r[r.LINE=19]="LINE",r[r.DIMENSION_ORDINATE=20]="DIMENSION_ORDINATE",r[r.DIMENSION_LINEAR=21]="DIMENSION_LINEAR",r[r.DIMENSION_ALIGNED=22]="DIMENSION_ALIGNED",r[r.DIMENSION_ANG_3_Pt=23]="DIMENSION_ANG_3_Pt",r[r.DIMENSION_ANG_2_Ln=24]="DIMENSION_ANG_2_Ln",r[r.DIMENSION_RADIUS=25]="DIMENSION_RADIUS",r[r.DIMENSION_DIAMETER=26]="DIMENSION_DIAMETER",r[r.POINT=27]="POINT",r[r.FACE3D=28]="FACE3D",r[r.POLYLINE_PFACE=29]="POLYLINE_PFACE",r[r.POLYLINE_MESH=30]="POLYLINE_MESH",r[r.SOLID=31]="SOLID",r[r.TRACE=32]="TRACE",r[r.SHAPE=33]="SHAPE",r[r.VIEWPORT=34]="VIEWPORT",r[r.ELLIPSE=35]="ELLIPSE",r[r.SPLINE=36]="SPLINE",r[r.REGION=37]="REGION",r[r.SOLID3D=38]="SOLID3D",r[r.BODY=39]="BODY",r[r.RAY=40]="RAY",r[r.XLINE=41]="XLINE",r[r.DICTIONARY=42]="DICTIONARY",r[r.OLEFRAME=43]="OLEFRAME",r[r.MTEXT=44]="MTEXT",r[r.LEADER=45]="LEADER",r[r.TOLERANCE=46]="TOLERANCE",r[r.MLINE=47]="MLINE",r[r.BLOCK_CONTROL_OBJ=48]="BLOCK_CONTROL_OBJ",r[r.BLOCK_HEADER=49]="BLOCK_HEADER",r[r.LAYER_CONTROL_OBJ=50]="LAYER_CONTROL_OBJ",r[r.LAYER=51]="LAYER",r[r.STYLE_CONTROL_OBJ=52]="STYLE_CONTROL_OBJ",r[r.STYLE=53]="STYLE",r[r.UNKNOW_36=54]="UNKNOW_36",r[r.UNKNOW_37=55]="UNKNOW_37",r[r.LTYPE_CONTROL_OBJ=56]="LTYPE_CONTROL_OBJ",r[r.LTYPE=57]="LTYPE",r[r.UNKNOW_3A=58]="UNKNOW_3A",r[r.UNKNOW_3B=59]="UNKNOW_3B",r[r.VIEW_CONTROL_OBJ=60]="VIEW_CONTROL_OBJ",r[r.VIEW=61]="VIEW",r[r.UCS_CONTROL_OBJ=62]="UCS_CONTROL_OBJ",r[r.UCS=63]="UCS",r[r.VPORT_CONTROL_OBJ=64]="VPORT_CONTROL_OBJ",r[r.VPORT=65]="VPORT",r[r.APPID_CONTROL_OBJ=66]="APPID_CONTROL_OBJ",r[r.APPID=67]="APPID",r[r.DIMSTYLE_CONTROL_OBJ=68]="DIMSTYLE_CONTROL_OBJ",r[r.DIMSTYLE=69]="DIMSTYLE",r[r.VP_ENT_HDR_CTRL_OBJ=70]="VP_ENT_HDR_CTRL_OBJ",r[r.VP_ENT_HDR=71]="VP_ENT_HDR",r[r.GROUP=72]="GROUP",r[r.MLINESTYLE=73]="MLINESTYLE",r[r.OLE2FRAME=74]="OLE2FRAME",r[r.DUMMY=75]="DUMMY",r[r.LONG_TRANSACTION=76]="LONG_TRANSACTION",r[r.LWPOLYLINE=77]="LWPOLYLINE",r[r.HATCH=78]="HATCH",r[r.XRECORD=79]="XRECORD",r[r.ACDBPLACEHOLDER=80]="ACDBPLACEHOLDER",r[r.VBA_PROJECT=81]="VBA_PROJECT",r[r.LAYOUT=82]="LAYOUT",r[r.ACAD_PROXY_ENTITY=498]="ACAD_PROXY_ENTITY",r[r.ACAD_PROXY_OBJECT=499]="ACAD_PROXY_OBJECT"})(m||(m={}))});var w,ie=sr(()=>{(function(r){r[r.Invalid=-9999]="Invalid",r[r.XDictionary=-6]="XDictionary",r[r.PReactors=-5]="PReactors",r[r.Operator=-4]="Operator",r[r.XDataStart=-3]="XDataStart",r[r.HeaderId=-2]="HeaderId",r[r.FirstEntityId=-2]="FirstEntityId",r[r.End=-1]="End",r[r.Start=0]="Start",r[r.Text=1]="Text",r[r.XRefPath=1]="XRefPath",r[r.ShapeName=2]="ShapeName",r[r.BlockName=2]="BlockName",r[r.AttributeTag=2]="AttributeTag",r[r.SymbolTableName=2]="SymbolTableName",r[r.MlineStyleName=2]="MlineStyleName",r[r.SymbolTableRecordName=2]="SymbolTableRecordName",r[r.AttributePrompt=3]="AttributePrompt",r[r.DimStyleName=3]="DimStyleName",r[r.LinetypeProse=3]="LinetypeProse",r[r.TextFontFile=3]="TextFontFile",r[r.Description=3]="Description",r[r.DimPostString=3]="DimPostString",r[r.TextBigFontFile=4]="TextBigFontFile",r[r.DimensionAlternativePrefixSuffix=4]="DimensionAlternativePrefixSuffix",r[r.CLShapeName=4]="CLShapeName",r[r.SymbolTableRecordComments=4]="SymbolTableRecordComments",r[r.Handle=5]="Handle",r[r.DimensionBlock=5]="DimensionBlock",r[r.DimBlk1=6]="DimBlk1",r[r.LinetypeName=6]="LinetypeName",r[r.DimBlk2=7]="DimBlk2",r[r.TextStyleName=7]="TextStyleName",r[r.LayerName=8]="LayerName",r[r.CLShapeText=9]="CLShapeText",r[r.XCoordinate=10]="XCoordinate",r[r.YCoordinate=20]="YCoordinate",r[r.ZCoordinate=30]="ZCoordinate",r[r.Elevation=38]="Elevation",r[r.Thickness=39]="Thickness",r[r.Real=40]="Real",r[r.ViewportHeight=40]="ViewportHeight",r[r.TxtSize=40]="TxtSize",r[r.TxtStyleXScale=41]="TxtStyleXScale",r[r.ViewWidth=41]="ViewWidth",r[r.ViewportAspect=41]="ViewportAspect",r[r.TxtStylePSize=42]="TxtStylePSize",r[r.ViewLensLength=42]="ViewLensLength",r[r.ViewFrontClip=43]="ViewFrontClip",r[r.ViewBackClip=44]="ViewBackClip",r[r.ShapeXOffset=44]="ShapeXOffset",r[r.ShapeYOffset=45]="ShapeYOffset",r[r.ViewHeight=45]="ViewHeight",r[r.ShapeScale=46]="ShapeScale",r[r.PixelScale=47]="PixelScale",r[r.LinetypeScale=48]="LinetypeScale",r[r.DashLength=49]="DashLength",r[r.MlineOffset=49]="MlineOffset",r[r.LinetypeElement=49]="LinetypeElement",r[r.Angle=50]="Angle",r[r.ViewportSnapAngle=50]="ViewportSnapAngle",r[r.ViewportTwist=51]="ViewportTwist",r[r.Visibility=60]="Visibility",r[r.LayerLinetype=61]="LayerLinetype",r[r.Color=62]="Color",r[r.HasSubentities=66]="HasSubentities",r[r.ViewportVisibility=67]="ViewportVisibility",r[r.ViewportActive=68]="ViewportActive",r[r.ViewportNumber=69]="ViewportNumber",r[r.Int16=70]="Int16",r[r.ViewMode=71]="ViewMode",r[r.CircleSides=72]="CircleSides",r[r.ViewportZoom=73]="ViewportZoom",r[r.ViewportIcon=74]="ViewportIcon",r[r.ViewportSnap=75]="ViewportSnap",r[r.ViewportGrid=76]="ViewportGrid",r[r.ViewportSnapStyle=77]="ViewportSnapStyle",r[r.ViewportSnapPair=78]="ViewportSnapPair",r[r.RegAppFlags=71]="RegAppFlags",r[r.TxtStyleFlags=71]="TxtStyleFlags",r[r.LinetypeAlign=72]="LinetypeAlign",r[r.LinetypePdc=73]="LinetypePdc",r[r.Int32=90]="Int32",r[r.Subclass=100]="Subclass",r[r.EmbeddedObjectStart=101]="EmbeddedObjectStart",r[r.ControlString=102]="ControlString",r[r.DimVarHandle=105]="DimVarHandle",r[r.UcsOrg=110]="UcsOrg",r[r.UcsOrientationX=111]="UcsOrientationX",r[r.UcsOrientationY=112]="UcsOrientationY",r[r.XReal=140]="XReal",r[r.ViewBrightness=141]="ViewBrightness",r[r.ViewContrast=142]="ViewContrast",r[r.Int64=160]="Int64",r[r.XInt16=170]="XInt16",r[r.NormalX=210]="NormalX",r[r.NormalY=220]="NormalY",r[r.NormalZ=230]="NormalZ",r[r.XXInt16=270]="XXInt16",r[r.Int8=280]="Int8",r[r.RenderMode=281]="RenderMode",r[r.Bool=290]="Bool",r[r.XTextString=300]="XTextString",r[r.BinaryChunk=310]="BinaryChunk",r[r.ArbitraryHandle=320]="ArbitraryHandle",r[r.SoftPointerId=330]="SoftPointerId",r[r.HardPointerId=340]="HardPointerId",r[r.SoftOwnershipId=350]="SoftOwnershipId",r[r.HardOwnershipId=360]="HardOwnershipId",r[r.LineWeight=370]="LineWeight",r[r.PlotStyleNameType=380]="PlotStyleNameType",r[r.PlotStyleNameId=390]="PlotStyleNameId",r[r.ExtendedInt16=400]="ExtendedInt16",r[r.LayoutName=410]="LayoutName",r[r.ColorRgb=420]="ColorRgb",r[r.ColorName=430]="ColorName",r[r.Alpha=440]="Alpha",r[r.GradientObjType=450]="GradientObjType",r[r.GradientPatType=451]="GradientPatType",r[r.GradientTintType=452]="GradientTintType",r[r.GradientColCount=453]="GradientColCount",r[r.GradientAngle=460]="GradientAngle",r[r.GradientShift=461]="GradientShift",r[r.GradientTintVal=462]="GradientTintVal",r[r.GradientColVal=463]="GradientColVal",r[r.GradientName=470]="GradientName",r[r.Comment=999]="Comment",r[r.ExtendedDataAsciiString=1e3]="ExtendedDataAsciiString",r[r.ExtendedDataRegAppName=1001]="ExtendedDataRegAppName",r[r.ExtendedDataControlString=1002]="ExtendedDataControlString",r[r.ExtendedDataLayerName=1003]="ExtendedDataLayerName",r[r.ExtendedDataBinaryChunk=1004]="ExtendedDataBinaryChunk",r[r.ExtendedDataHandle=1005]="ExtendedDataHandle",r[r.ExtendedDataXCoordinate=1010]="ExtendedDataXCoordinate",r[r.ExtendedDataYCoordinate=1020]="ExtendedDataYCoordinate",r[r.ExtendedDataZCoordinate=1030]="ExtendedDataZCoordinate",r[r.ExtendedDataWorldXCoordinate=1011]="ExtendedDataWorldXCoordinate",r[r.ExtendedDataWorldYCoordinate=1021]="ExtendedDataWorldYCoordinate",r[r.ExtendedDataWorldZCoordinate=1031]="ExtendedDataWorldZCoordinate",r[r.ExtendedDataWorldXDisp=1012]="ExtendedDataWorldXDisp",r[r.ExtendedDataWorldYDisp=1022]="ExtendedDataWorldYDisp",r[r.ExtendedDataWorldZDisp=1032]="ExtendedDataWorldZDisp",r[r.ExtendedDataWorldXDir=1013]="ExtendedDataWorldXDir",r[r.ExtendedDataWorldYDir=1023]="ExtendedDataWorldYDir",r[r.ExtendedDataWorldZDir=1033]="ExtendedDataWorldZDir",r[r.ExtendedDataReal=1040]="ExtendedDataReal",r[r.ExtendedDataDist=1041]="ExtendedDataDist",r[r.ExtendedDataScale=1042]="ExtendedDataScale",r[r.ExtendedDataInteger16=1070]="ExtendedDataInteger16",r[r.ExtendedDataInteger32=1071]="ExtendedDataInteger32"})(w||(w={}))});var Ii,le,ht=sr(()=>{Ii=class{get code(){return this._code}get rawValue(){return this._value}_code;_value;constructor(e,t){this._code=e,this._value=t}toString(){return`${this.code}:${this._value}`}static create(e,t){throw new Error("ExtendedDataRecord factory not initialized")}},le=class extends Ii{get value(){return this._value}set value(e){this._value=e}constructor(e,t){super(e,t)}}});var Fe,Aa=sr(()=>{ie();ht();Fe=class r extends Ii{static get open(){return new r(!1)}static get close(){return new r(!0)}isClosing;get value(){return this.isClosing?"}":"{"}constructor(e){super(w.ExtendedDataControlString,e?"}":"{"),this.isClosing=e}}});var hi,_l=sr(()=>{Aa();hi=class{records=[];constructor(e){e&&this.records.push(...e)}addControlStrings(){if(this.records.length===0){this.records.push(Fe.open),this.records.push(Fe.close);return}let e=this.records[0];e instanceof Fe?e.isClosing&&this.records.unshift(Fe.open):this.records.unshift(Fe.open);let t=this.records[this.records.length-1];t instanceof Fe?t.isClosing||this.records.push(Fe.close):this.records.push(Fe.close)}}});var xo,Pd=sr(()=>{_l();xo=class{get document(){return this.owner?.document??null}owner;_data=new Map;constructor(e){this.owner=e}addByAppId(e,t){t===void 0&&(t=new hi);let i=this.document?.appIds,s=i?.tryGetValue?.(e.name)??null;if(s==null&&i!=null){let a=i.tryGetValue("ACAD")??[...i][0]??null;a!=null&&(s=a.clone(),s.name=e.name,s=i.tryAdd(s))}s??=e,this._data.set(s,t)}addByName(e,t){this.addByAppId({name:e},t)}addWithRecords(e,t){this._data.set(e,new hi(t))}clear(){this._data.clear()}containsKey(e){return this._data.has(e)}containsKeyName(e){for(let t of this._data.keys())if(t.name===e)return!0;return!1}getByName(e){let i=this.getExtendedDataByName().get(e.toUpperCase());if(!i)throw new Error(`AppId '${e}' not found`);return i}get(e){let t=this._data.get(e);if(!t)throw new Error("AppId not found");return t}get size(){return this._data.size}entries(){return this._data.entries()}add(e,t){this._data.set(e,t)}set(e,t){this._data.set(e,t)}[Symbol.iterator](){return this._data.entries()}getExtendedDataByName(){let e=new Map;for(let[t,i]of this._data)e.set(t.name.toUpperCase(),i);return e}tryAdd(e,t){let i=this.tryGetByName(e);return i.found?i.value:(this.addByName(e,t),t)}tryGet(e){let t=this._data.get(e);return t?{value:t,found:!0}:{value:null,found:!1}}tryGetByName(e){let i=this.getExtendedDataByName().get(e.toUpperCase());return i?{value:i,found:!0}:{value:null,found:!1}}}});var va,ld=sr(()=>{va=class{oldName;newName;constructor(e,t){this.oldName=e,this.newName=t}}});var M,te=sr(()=>{De();ld();B();M=class extends A{onNameChanged=null;get name(){return this._name}set name(e){this.onNameChanged?.call(this,this,new va(this._name,e)),this._name=e}get objectType(){return m.UNLISTED}_name="";constructor(e){super(),e&&(this.name=e)}clone(){let e=super.clone();return e.onNameChanged=null,e}toString(){return this._name?`${this.objectName}:${this._name}:${this.handle}`:`${this.objectName}:${this.handle}`}}});var gr,bl=sr(()=>{gr=class{item;constructor(e){this.item=e}}});var ks,yl=sr(()=>{(function(r){r[r.NotApplicable=0]="NotApplicable",r[r.KeepExisting=1]="KeepExisting",r[r.UseClone=2]="UseClone",r[r.XrefName=3]="XrefName",r[r.Name=4]="Name",r[r.UnmangleName=5]="UnmangleName"})(ks||(ks={}))});var Vh={};uu(Vh,{CadDictionary:()=>re,DictionaryCloningFlags:()=>ks});var re,xr=sr(()=>{te();bl();T();D();B();yl();yl();re=class r extends M{onAdd=null;onRemove=null;clonningFlags=ks.NotApplicable;get entryHandles(){return[...this._entries.values()].map(e=>e.handle)}get entryNames(){return[...this._entries.keys()]}hardOwnerFlag=!1;get objectName(){return h.objectDictionary}get objectType(){return m.DICTIONARY}get subclassMarker(){return d.dictionary}static acadColor="ACAD_COLOR";static acadFieldList="ACAD_FIELDLIST";static acadGroup="ACAD_GROUP";static acadImageDict="ACAD_IMAGE_DICT";static acadLayout="ACAD_LAYOUT";static acadMaterial="ACAD_MATERIAL";static acadMLeaderStyle="ACAD_MLEADERSTYLE";static acadMLineStyle="ACAD_MLINESTYLE";static acadPdfDefinitions="ACAD_PDFDEFINITIONS";static acadPlotSettings="ACAD_PLOTSETTINGS";static acadPlotStyleName="ACAD_PLOTSTYLENAME";static acadScaleList="ACAD_SCALELIST";static acadSortEnts="ACAD_SORTENTS";static acadTableStyle="ACAD_TABLESTYLE";static acadVisualStyle="ACAD_VISUALSTYLE";static geographicData="ACAD_GEOGRAPHICDATA";static root="ROOT";static variableDictionary="AcDbVariableDictionary";_entries=new Map;constructor(e){super(e)}static createDefaultEntries(e){e.tryAdd(new r(r.acadColor)),e.tryAdd(new r(r.acadGroup)),e.tryAdd(new r(r.acadLayout)),e.tryAdd(new r(r.acadMaterial)),e.tryAdd(new r(r.acadSortEnts)),e.tryAdd(new r(r.acadMLeaderStyle)),e.tryAdd(new r(r.acadMLineStyle)),e.tryAdd(new r(r.acadTableStyle)),e.tryAdd(new r(r.acadPlotSettings)),e.tryAdd(new r(r.variableDictionary)),e.tryAdd(new r(r.acadScaleList)),e.tryAdd(new r(r.acadVisualStyle)),e.tryAdd(new r(r.acadFieldList)),e.tryAdd(new r(r.acadImageDict))}static createRoot(){let e=new r(r.root);return r.createDefaultEntries(e),e}addByKey(e,t){if(!e)throw new Error("NonGraphicalObject must have a name");this._entries.set(e.toLowerCase(),t),t.owner=this,this.onAdd?.call(this,this,new gr(t))}add(e){this.addByKey(e.name,e)}clear(){for(let[e]of this._entries)this.remove(e)}clone(){let e=super.clone();e.onAdd=null,e.onRemove=null,e._entries=new Map;for(let t of this._entries.values())e.add(t.clone());return e}containsKey(e){return this._entries.has(e.toLowerCase())}getEntry(e){return this._entries.get(e.toLowerCase())??null}remove(e){let t=this._entries.get(e.toLowerCase());return t?(this._entries.delete(e.toLowerCase()),t.owner=null,this.onRemove?.call(this,this,new gr(t)),!0):!1}tryAdd(e){return this._entries.has(e.name.toLowerCase())?!1:(this.add(e),!0)}get(e){return this._entries.get(e.toLowerCase())}[Symbol.iterator](){return this._entries.values()}}});var A,De=sr(()=>{Pd();A=class r{document=null;extendedData;handle=0;get hasDynamicSubclass(){return!1}get objectName(){return""}owner=null;get reactors(){return this._reactors}get xDictionary(){return this._xdictionary}set xDictionary(e){e!=null&&(this._xdictionary=e,this._xdictionary.owner=this,this.document!=null&&this.document.registerCollection(this._xdictionary))}_reactors=[];_xdictionary=null;constructor(){this.extendedData=new xo(this)}addReactor(e){this._reactors.push(e)}cleanReactors(){let e=[...this._reactors];for(let t of e)if(t.document!==this.document){let i=this._reactors.indexOf(t);i>=0&&this._reactors.splice(i,1)}}clone(){let e=Object.create(Object.getPrototypeOf(this));return Object.assign(e,this),e.handle=0,e.document=null,e.owner=null,e._reactors=[],e.extendedData=new xo(e),e.xDictionary=this._xdictionary?.clone()??null,e}createExtendedDictionary(){if(this._xdictionary==null){let{CadDictionary:e}=(xr(),pu(Vh));this.xDictionary=new e}return this._xdictionary}removeReactor(e){let t=this._reactors.indexOf(e);return t>=0?(this._reactors.splice(t,1),!0):!1}toString(){return`${this.objectName}:${this.handle}`}assignDocument(e){if(this.document=e,this.xDictionary!=null&&e.registerCollection(this.xDictionary),this.extendedData.size>0){let t=[...this.extendedData.entries()];this.extendedData.clear();for(let[i,s]of t)this.extendedData.add(i,s)}}unassignDocument(){if(this.xDictionary!=null&&this.document?.unregisterCollection(this.xDictionary),this.handle=0,this.document=null,this.extendedData.size>0){let e=[...this.extendedData.entries()];this.extendedData.clear();for(let[t,i]of e)this.extendedData.add(t,i)}this._reactors=[]}static updateCollection(e,t){return t==null||e==null?e:t.tryAdd(e)}static updateCollectionStatic(e,t){return r.updateCollection(e,t)}updateCollection(e,t){return r.updateCollection(e,t)}}});var u;(function(r){r[r.Unknown=-1]="Unknown",r[r.MC0_0=0]="MC0_0",r[r.AC1_2=1]="AC1_2",r[r.AC1_4=2]="AC1_4",r[r.AC1_50=3]="AC1_50",r[r.AC2_10=4]="AC2_10",r[r.AC1002=5]="AC1002",r[r.AC1003=6]="AC1003",r[r.AC1004=7]="AC1004",r[r.AC1006=8]="AC1006",r[r.AC1009=9]="AC1009",r[r.AC1012=19]="AC1012",r[r.AC1014=21]="AC1014",r[r.AC1015=23]="AC1015",r[r.AC1018=25]="AC1018",r[r.AC1021=27]="AC1021",r[r.AC1024=29]="AC1024",r[r.AC1027=31]="AC1027",r[r.AC1032=33]="AC1032"})(u||(u={}));T();D();B();var ne;(function(r){r[r.None=0]="None",r[r.Anonymous=1]="Anonymous",r[r.NonConstantAttributeDefinitions=2]="NonConstantAttributeDefinitions",r[r.XRef=4]="XRef",r[r.XRefOverlay=8]="XRefOverlay",r[r.XRefDependent=16]="XRefDependent",r[r.XRefResolved=32]="XRefResolved",r[r.Referenced=64]="Referenced"})(ne||(ne={}));De();var S=class r{static get black(){return new r(250)}static get blue(){return new r(5)}static get byBlock(){return r._fromIndex(0)}static get byEntity(){return r._fromIndex(257)}static get byLayer(){return r._fromIndex(256)}static get cyan(){return new r(4)}static get darkGray(){return new r(8)}static get default(){return new r(7)}static get green(){return new r(3)}static get lightGray(){return new r(9)}static get magenta(){return new r(6)}static get red(){return new r(1)}static get yellow(){return new r(2)}get b(){return this.getRgb()[2]}get g(){return this.getRgb()[1]}get r(){return this.getRgb()[0]}get index(){return this.isTrueColor?-1:this._color}get isByBlock(){return this.index===0}get isByLayer(){return this.index===256}get isTrueColor(){return this._color>257||this._color<0}get trueColor(){return this.isTrueColor?this._color^1<<30:-1}static _maxTrueColor=16777216;static _trueColorFlag=1073741824;static _indexRgb=[[0,0,0],[255,0,0],[255,255,0],[0,255,0],[0,255,255],[0,0,255],[255,0,255],[255,255,255],[128,128,128],[192,192,192],[255,0,0],[255,127,127],[165,0,0],[165,82,82],[127,0,0],[127,63,63],[76,0,0],[76,38,38],[38,0,0],[38,19,19],[255,63,0],[255,159,127],[165,41,0],[165,103,82],[127,31,0],[127,79,63],[76,19,0],[76,47,38],[38,9,0],[38,28,19],[255,127,0],[255,191,127],[165,82,0],[165,124,82],[127,63,0],[127,95,63],[76,38,0],[76,57,38],[38,19,0],[38,28,19],[255,191,0],[255,223,127],[165,124,0],[165,145,82],[127,95,0],[127,111,63],[76,57,0],[76,66,38],[38,28,0],[38,33,19],[255,255,0],[255,255,127],[165,165,0],[165,165,82],[127,127,0],[127,127,63],[76,76,0],[76,76,38],[38,38,0],[38,38,19],[191,255,0],[223,255,127],[124,165,0],[145,165,82],[95,127,0],[111,127,63],[57,76,0],[66,76,38],[28,38,0],[33,38,19],[127,255,0],[191,255,127],[82,165,0],[124,165,82],[63,127,0],[95,127,63],[38,76,0],[57,76,38],[19,38,0],[28,38,19],[63,255,0],[159,255,127],[41,165,0],[103,165,82],[31,127,0],[79,127,63],[19,76,0],[47,76,38],[9,38,0],[23,38,19],[0,255,0],[125,255,127],[0,165,0],[82,165,82],[0,127,0],[63,127,63],[0,76,0],[38,76,38],[0,38,0],[19,38,19],[0,255,63],[127,255,159],[0,165,41],[82,165,103],[0,127,31],[63,127,79],[0,76,19],[38,76,47],[0,38,9],[19,88,23],[0,255,127],[127,255,191],[0,165,82],[82,165,124],[0,127,63],[63,127,95],[0,76,38],[38,76,57],[0,38,19],[19,88,28],[0,255,191],[127,255,223],[0,165,124],[82,165,145],[0,127,95],[63,127,111],[0,76,57],[38,76,66],[0,38,28],[19,88,88],[0,255,255],[127,255,255],[0,165,165],[82,165,165],[0,127,127],[63,127,127],[0,76,76],[38,76,76],[0,38,38],[19,88,88],[0,191,255],[127,223,255],[0,124,165],[82,145,165],[0,95,127],[63,111,217],[0,57,76],[38,66,126],[0,28,38],[19,88,88],[0,127,255],[127,191,255],[0,82,165],[82,124,165],[0,63,127],[63,95,127],[0,38,76],[38,57,126],[0,19,38],[19,28,88],[0,63,255],[127,159,255],[0,41,165],[82,103,165],[0,31,127],[63,79,127],[0,19,76],[38,47,126],[0,9,38],[19,23,88],[0,0,255],[127,127,255],[0,0,165],[82,82,165],[0,0,127],[63,63,127],[0,0,76],[38,38,126],[0,0,38],[19,19,88],[63,0,255],[159,127,255],[41,0,165],[103,82,165],[31,0,127],[79,63,127],[19,0,76],[47,38,126],[9,0,38],[23,19,88],[127,0,255],[191,127,255],[165,0,82],[124,82,165],[63,0,127],[95,63,127],[38,0,76],[57,38,126],[19,0,38],[28,19,88],[191,0,255],[223,127,255],[124,0,165],[142,82,165],[95,0,127],[111,63,127],[57,0,76],[66,38,76],[28,0,38],[88,19,88],[255,0,255],[255,127,255],[165,0,165],[165,82,165],[127,0,127],[127,63,127],[76,0,76],[76,38,76],[38,0,38],[88,19,88],[255,0,191],[255,127,223],[165,0,124],[165,82,145],[127,0,95],[127,63,111],[76,0,57],[76,38,66],[38,0,28],[88,19,88],[255,0,127],[255,127,191],[165,0,82],[165,82,124],[127,0,63],[127,63,95],[76,0,38],[76,38,57],[38,0,19],[88,19,28],[255,0,63],[255,127,159],[165,0,41],[165,82,103],[127,0,31],[127,63,79],[76,0,19],[76,38,47],[38,0,9],[88,19,23],[0,0,0],[101,101,101],[102,102,102],[153,153,153],[204,204,204],[255,255,255]];_color;constructor(e,t,i){if(t!==void 0&&i!==void 0){let s=r._getInt24([e,t,i]);this._color=(s|r._trueColorFlag)>>>0}else{let s=e;s<0||s>257?this._color=256:this._color=s}}static _fromIndex(e){let t=new r(0);return t._color=e,t}static fromTrueColor(e){let t=new r(0);return t._color=(e|r._trueColorFlag)>>>0,t}static getIndexRGB(e){return r._indexRgb[e]}static approxIndex(e,t,i){let s=-1;for(let a=0;a>8&255,e>>16&255]}};T();D();B();var F;(function(r){r[r.ByDIPs=-4]="ByDIPs",r[r.Default=-3]="Default",r[r.ByBlock=-2]="ByBlock",r[r.ByLayer=-1]="ByLayer",r[r.W0=0]="W0",r[r.W5=5]="W5",r[r.W9=9]="W9",r[r.W13=13]="W13",r[r.W15=15]="W15",r[r.W18=18]="W18",r[r.W20=20]="W20",r[r.W25=25]="W25",r[r.W30=30]="W30",r[r.W35=35]="W35",r[r.W40=40]="W40",r[r.W50=50]="W50",r[r.W53=53]="W53",r[r.W60=60]="W60",r[r.W70=70]="W70",r[r.W80=80]="W80",r[r.W90=90]="W90",r[r.W100=100]="W100",r[r.W106=106]="W106",r[r.W120=120]="W120",r[r.W140=140]="W140",r[r.W158=158]="W158",r[r.W200=200]="W200",r[r.W211=211]="W211"})(F||(F={}));De();De();D();var ar;(function(r){r[r.None=0]="None",r[r.XrefDependent=16]="XrefDependent",r[r.XrefResolved=32]="XrefResolved",r[r.Referenced=64]="Referenced"})(ar||(ar={}));ld();var ye=class extends A{onNameChanged=null;flags=ar.None;get name(){return this._name}set name(e){if(!e||!e.trim())throw new Error(`Table entry [${this.constructor.name}] must have a name`);this.onNameChanged&&this.onNameChanged(this,new va(this._name,e)),this._name=e}get subclassMarker(){return d.tableRecord}_name="";constructor(e){if(super(),e!==void 0){if(!e)throw new Error(`${this.constructor.name} must have a name.`);this.name=e}}clone(){let e=super.clone();return e.onNameChanged=null,e}toString(){return`${this.objectName}:${this.name}`}};T();D();B();var ut;(function(r){r[r.None=0]="None",r[r.RotationIsAbsolute=1]="RotationIsAbsolute",r[r.Text=2]="Text",r[r.Shape=4]="Shape"})(ut||(ut={}));var gl=class r{length=0;shapeFlags=ut.None;shapeNumber=0;offset={x:0,y:0};rotation=0;scale=0;text="";style=null;owner=null;get isShape(){return(this.shapeFlags&ut.Shape)!==0}clone(){let e=new r;return e.length=this.length,e.shapeFlags=this.shapeFlags,e.shapeNumber=this.shapeNumber,e.offset={...this.offset},e.rotation=this.rotation,e.scale=this.scale,e.text=this.text,e.style=this.style,e.owner=null,e}},z=class r extends ye{static get byBlock(){return new r("ByBlock")}static get byLayer(){return new r("ByLayer")}static get continuous(){return new r("Continuous")}alignment="A";description=null;get hasShapes(){return this._segments.some(e=>e.isShape)}get isComplex(){return this._segments.length>0}get objectName(){return h.tableLinetype}get objectType(){return m.LTYPE}get patternLength(){return this._segments.reduce((e,t)=>e+Math.abs(t.length),0)}get segments(){return this._segments}get subclassMarker(){return d.linetype}static byBlockName="ByBlock";static byLayerName="ByLayer";static continuousName="Continuous";_segments=[];constructor(e){super(e)}addSegment(e){if(e.owner!=null)throw new Error(`Segment already assigned to a LineType: ${e.owner.name}`);e.owner=this,this._segments.push(e)}clone(){let e=super.clone();e._segments=[];for(let t of this._segments)e.addSegment(t.clone());return e}};var st;(function(r){r[r.None=0]="None",r[r.Frozen=1]="Frozen",r[r.FrozenNewViewports=2]="FrozenNewViewports",r[r.Locked=4]="Locked",r[r.XrefDependent=16]="XrefDependent",r[r.XrefResolved=32]="XrefResolved",r[r.Referenced=64]="Referenced"})(st||(st={}));var pe=class r extends ye{static get default(){return new r(r.defaultName)}static get defpoints(){let e=new r(r.defpointsName);return e.plotFlag=!1,e}get color(){return this._color}set color(e){if(e.isByLayer||e.isByBlock)throw new Error("The layer color cannot be ByLayer or ByBlock");this._color=e}get layerFlags(){return this.flags}set layerFlags(e){this.flags=e}isOn=!0;lineType=null;lineWeight=F.Default;material=null;get objectName(){return h.tableLayer}get objectType(){return m.LAYER}get plotFlag(){return this._name.toLowerCase()===r.defpointsName.toLowerCase()?!1:this._plotFlag}set plotFlag(e){this._plotFlag=e}plotStyleName=0;get subclassMarker(){return d.layer}static defaultName="0";static defpointsName="defpoints";_color=new S(7);_plotFlag=!0;constructor(e){super(e)}clone(){let e=super.clone();return e.lineType=this.lineType?.clone()??null,e.material=this.material?.clone()??null,e}assignDocument(e){super.assignDocument(e),this.lineType=A.updateCollection(this.lineType??z.continuous,e.lineTypes),this.material=A.updateCollection(this.material,e.materials)}unassignDocument(){super.unassignDocument(),this.lineType=this.lineType?.clone()??z.continuous,this.material=this.material?.clone()??null}};var Ee=class r{static get byLayer(){return new r(-1)}static get byBlock(){return new r(100)}static get opaque(){return new r(0)}get isByLayer(){return this._value===-1}get isByBlock(){return this._value===100}get value(){return this._value}set value(e){if(e===-1){this._value=e;return}if(e===100){this._value=e;return}if(e<0||e>90)throw new RangeError("Transparency must be in range from 0 to 90.");this._value=e}_value;constructor(e){this._value=-1,this.value=e}static toAlphaValue(e){let t=Math.round(255*(100-e.value)/100);return e.isByBlock?16777216:2<<24|t}static fromAlphaValue(e){let t=e&255,i=Math.round(100-t/255*100);return i===-1?r.byLayer:i===100?r.byBlock:i<0?new r(0):i>90?new r(90):new r(i)}};D();var c=class r{x;y;z;get dimension(){return 3}get 0(){return this.x}set 0(e){this.x=e}get 1(){return this.y}set 1(e){this.y=e}get 2(){return this.z}set 2(e){this.z=e}constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}static zero=new r(0,0,0);static axisX=new r(1,0,0);static axisY=new r(0,1,0);static axisZ=new r(0,0,1);static naN=new r(Number.NaN,Number.NaN,Number.NaN);getLength(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}normalize(){let e=this.getLength();return e===0?new r:new r(this.x/e,this.y/e,this.z/e)}getAngle(){return Math.atan2(this.y,this.x)}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){return new r(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}static cross(e,t){return new r(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x)}static equals(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}};var g=class r{x;y;get dimension(){return 2}get 0(){return this.x}set 0(e){this.x=e}get 1(){return this.y}set 1(e){this.y=e}constructor(e=0,t=0){this.x=e,this.y=t}static zero=new r(0,0);static axisX=new r(1,0);static axisY=new r(0,1);getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}normalize(){let e=this.getLength();return e===0?new r:new r(this.x/e,this.y/e)}getAngle(){return Math.atan2(this.y,this.x)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}static cross(e,t){return e.x*t.y-e.y*t.x}static polar(e,t,i){return new r(e.x+i*Math.cos(t),e.y+i*Math.sin(t))}static rotate(e,t){let i=Math.cos(t),s=Math.sin(t);return new r(e.x*i-e.y*s,e.x*s+e.y*i)}equals(e){return this.x===e.x&&this.y===e.y}};var mt=class r{m00=1;m01=0;m02=0;m03=0;m10=0;m11=1;m12=0;m13=0;m20=0;m21=0;m22=1;m23=0;m30=0;m31=0;m32=0;m33=1;constructor(e){if(!(!e||e.length===0)){if(e.length!==16)throw new Error("Matrix4 requires 16 values.");[this.m00,this.m01,this.m02,this.m03,this.m10,this.m11,this.m12,this.m13,this.m20,this.m21,this.m22,this.m23,this.m30,this.m31,this.m32,this.m33]=e}}static identity(){return new r}get(e,t){let i=`m${e}${t}`;return this[i]}setElement(e,t,i){let s=`m${e}${t}`;this[s]=i}};var Z=class r{translation;scale;eulerRotation;constructor(e,t,i){this.translation=e??new c(0,0,0),this.scale=t??new c(1,1,1),this.eulerRotation=i??new c(0,0,0)}get matrix(){let e=new mt,t=this.scale.x,i=this.scale.y,s=this.scale.z,a=this.eulerRotation.x,n=this.eulerRotation.y,o=this.eulerRotation.z,l=Math.cos(a),p=Math.sin(a),b=Math.cos(n),x=Math.sin(n),j=Math.cos(o),k=Math.sin(o);return e.m00=b*j*t,e.m01=-(b*k)*i,e.m02=x*s,e.m10=(l*k+j*p*x)*t,e.m11=(l*j-p*x*k)*i,e.m12=-(b*p)*s,e.m20=(p*k-l*j*x)*t,e.m21=(j*p+l*x*k)*i,e.m22=l*b*s,e.m03=this.translation.x,e.m13=this.translation.y,e.m23=this.translation.z,e}applyTransform(e){let t=this.matrix;return new c(t.m00*e.x+t.m01*e.y+t.m02*e.z+t.m03,t.m10*e.x+t.m11*e.y+t.m12*e.z+t.m13,t.m20*e.x+t.m21*e.y+t.m22*e.z+t.m23)}static createTranslation(e){return new r(e)}static createScaling(e,t){let i=new r(void 0,e);return t&&(i.translation=new c(t.x*(1-e.x),t.y*(1-e.y),t.z*(1-e.z))),i}static createRotation(e,t){let i=new r;return e.z!==0?i.eulerRotation=new c(0,0,t):e.y!==0?i.eulerRotation=new c(0,t,0):i.eulerRotation=new c(t,0,0),i}};function Ld(r){return r!=null&&typeof r=="object"&&"blockEntity"in r}var N=class extends A{bookColor=null;color=S.byLayer;isInvisible=!1;get layer(){return this._layer}set layer(e){if(e==null)throw new Error("value cannot be null");this._layer=A.updateCollection(e,this.document?.layers??null)}get lineType(){return this._lineType}set lineType(e){if(e==null)throw new Error("value cannot be null");this._lineType=A.updateCollection(e,this.document?.lineTypes??null)}lineTypeScale=1;lineWeight=F.ByLayer;material=null;get subclassMarker(){return d.entity}transparency=Ee.byLayer;_bookColor=null;_layer=pe.default;_lineType=z.byLayer;constructor(){super()}applyRotation(e,t){this.applyTransform(Z.createRotation(e,t))}applyScaling(e,t){this.applyTransform(Z.createScaling(e,t))}applyTranslation(e){this.applyTransform(Z.createTranslation(e))}clone(){let e=super.clone();return e._layer=this.layer.clone(),e._lineType=this.lineType.clone(),e.material=this.material?.clone?.()??null,e}getActiveColor(){let e;return this.color.isByLayer?e=this.layer.color:this.color.isByBlock&&Ld(this.owner)?e=this.owner.blockEntity.color:e=this.color,e}getActiveLineType(){return this.lineType.name.toUpperCase()===z.byLayerName.toUpperCase()?this.layer.lineType:this.lineType.name.toUpperCase()===z.byBlockName.toUpperCase()&&Ld(this.owner)?this.owner.blockEntity.lineType:this.lineType}getActiveLineWeightType(){switch(this.lineWeight){case F.ByLayer:return this.layer.lineWeight;case F.ByBlock:return Ld(this.owner)?this.owner.blockEntity.getActiveLineWeightType():this.lineWeight;default:return this.lineWeight}}matchProperties(e){if(e==null)throw new Error("entity cannot be null");e.handle===0||this.document!==e.document?(this.layer=e.layer.clone(),this.lineType=e.lineType.clone(),this.material=e.material?.clone?.()??null):(this.layer=e.layer,this.lineType=e.lineType,this.material=e.material),this.color=e.color,this.lineWeight=e.lineWeight,this.lineTypeScale=e.lineTypeScale,this.isInvisible=e.isInvisible,this.transparency=e.transparency}assignDocument(e){super.assignDocument(e),this._layer=A.updateCollection(this.layer,e.layers),this._lineType=A.updateCollection(this.lineType,e.lineTypes),e.layers.onRemove=this._tableOnRemove.bind(this),e.lineTypes.onRemove=this._tableOnRemove.bind(this)}unassignDocument(){super.unassignDocument(),this._layer=this.layer.clone(),this._lineType=this.lineType.clone()}applyRotationToPoints(e,t){if(e==null)throw new Error("points cannot be null");if(Math.abs(t)<1e-12)return[...e];let i=Math.sin(t),s=Math.cos(t),a=[];for(let n of e)a.push(new g(n.x*s-n.y*i,n.x*i+n.y*s));return a}applyTransformToPoint(e,t){return e instanceof Z?e.applyTransform(t):t}applyTransformToVector(e,t){if(!(e instanceof Z))return t;let i=e.applyTransform(c.zero),s=e.applyTransform(t);return new c(s.x-i.x,s.y-i.y,s.z-i.z)}getTransformAxisScale(e){if(!(e instanceof Z))return new c(1,1,1);let t=e.matrix;return new c(Math.hypot(t.m00,t.m10,t.m20),Math.hypot(t.m01,t.m11,t.m21),Math.hypot(t.m02,t.m12,t.m22))}_tableOnRemove(e,t){t.item===this.layer&&(this.layer=this.document.layers.get(pe.defaultName)),t.item===this.lineType&&(this.lineType=this.document.lineTypes.get(z.byLayerName))}transformNormal(e,t){return this.applyTransformToVector(e,t).normalize()}};T();D();B();var Ps=class extends N{get objectName(){return h.endBlock}get objectType(){return m.ENDBLK}get subclassMarker(){return d.blockEnd}constructor(e){super(),e&&(this.owner=e)}clone(){let e=super.clone(),t=this.owner;if(t!=null){let i=new U(t.name);i.blockEnd=e}return e}applyTransform(e){}getBoundingBox(){return null}};bl();var Co=class{onAdd=null;onRemove=null;owner;get count(){return this._entries.size}_entries=new Set;constructor(e){this.owner=e}getAt(e){let t=0;for(let i of this._entries){if(t===e)return i;t++}}add(e){if(e==null)throw new Error("item is null");if(e.owner!=null)throw new Error("Item already has an owner");if(this._entries.has(e))throw new Error("Item is already in the collection");this._entries.add(e),e.owner=this.owner,this.onAdd?.(this,new gr(e))}addRange(e){for(let t of e)this.add(t)}clear(){let e=[...this._entries];for(let t of e)this.remove(t)}remove(e){return this._entries.delete(e)?(e.owner=null,this.onRemove?.(this,new gr(e)),e):null}[Symbol.iterator](){return this._entries[Symbol.iterator]()}};T();D();De();T();D();B();T();D();var Mi;(function(r){r[r.None=0]="None",r[r.Backward=2]="Backward",r[r.UpsideDown=4]="UpsideDown"})(Mi||(Mi={}));B();var ui;(function(r){r[r.None=0]="None",r[r.IsShape=1]="IsShape",r[r.VerticalText=4]="VerticalText",r[r.XrefDependent=16]="XrefDependent",r[r.XrefResolved=32]="XrefResolved",r[r.Referenced=64]="Referenced"})(ui||(ui={}));var ua;(function(r){r[r.Regular=0]="Regular",r[r.Italic=1]="Italic",r[r.Bold=2]="Bold"})(ua||(ua={}));var oe=class r extends ye{static defaultName="Standard";get objectType(){return m.STYLE}get objectName(){return h.tableStyle}get subclassMarker(){return d.textStyle}static get default(){return new r(r.defaultName)}get styleFlags(){return this.flags}set styleFlags(e){this.flags=e}filename="";bigFontFilename=null;height=0;width=1;lastHeight=0;obliqueAngle=0;mirrorFlag=Mi.None;trueType=ua.Regular;get isShapeFile(){return(this.styleFlags&ui.IsShape)!==0}constructor(e){super(e)}};var Tt;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right",r[r.Aligned=3]="Aligned",r[r.Middle=4]="Middle",r[r.Fit=5]="Fit"})(Tt||(Tt={}));var St;(function(r){r[r.Baseline=0]="Baseline",r[r.Bottom=1]="Bottom",r[r.Middle=2]="Middle",r[r.Top=3]="Top"})(St||(St={}));var at=class extends N{alignmentPoint=new c(0,0,0);get height(){return this._height}set height(e){if(e<=0)throw new Error("The Text height must be greater than zero.");this._height=e}horizontalAlignment=Tt.Left;insertPoint=new c(0,0,0);get mirror(){return this._mirror}set mirror(e){this._mirror=e}normal=new c(0,0,1);get objectName(){return h.entityText}get objectType(){return m.TEXT}obliqueAngle=0;rotation=0;get style(){return this._style}set style(e){if(e==null)throw new Error("value cannot be null");this.document!=null?this._style=A.updateCollection(e,this.document.textStyles):this._style=e}get subclassMarker(){return d.text}thickness=0;get value(){return this._value}set value(e){this._value=e}verticalAlignment=St.Baseline;widthFactor=1;_height=1;_mirror=Mi.None;_style=oe.default;_value="";constructor(){super()}applyTransform(e){if(!(e instanceof Z))return;let t=e.matrix;this.insertPoint=e.applyTransform(this.insertPoint);let i=Math.hypot(t.m00,t.m10,t.m20),s=Math.hypot(t.m01,t.m11,t.m21),a=s===0?1:s;this.rotation+=e.eulerRotation.z,this.height*=a,this.widthFactor*=i/a}clone(){let e=super.clone();return e._style=this._style.clone(),e}getBoundingBox(){return null}assignDocument(e){super.assignDocument(e),this._style=A.updateCollection(this._style,e.textStyles)}unassignDocument(){super.unassignDocument(),this._style=this._style.clone()}_tableOnRemove(e,t){super._tableOnRemove(e,t),t.item===this._style&&(this._style=this.document.textStyles.get(oe.defaultName))}};var mi;(function(r){r[r.SingleLine=1]="SingleLine",r[r.MultiLine=2]="MultiLine",r[r.ConstantMultiLine=4]="ConstantMultiLine"})(mi||(mi={}));var Do;(function(r){r[r.None=0]="None",r[r.Hidden=1]="Hidden",r[r.Constant=2]="Constant",r[r.Verify=4]="Verify",r[r.Preset=8]="Preset"})(Do||(Do={}));var Ea=class extends at{attributeType=mi.SingleLine;flags=Do.None;isReallyLocked=!1;mText=null;get tag(){return this._tag}set tag(e){this._tag=e}version=0;verticalAlignment=St.Baseline;_tag="";constructor(){super()}matchAttributeProperties(e){this.matchProperties(e),this.thickness=e.thickness,this.insertPoint=e.insertPoint,this.height=e.height,this.value=e.value,this.rotation=e.rotation,this.widthFactor=e.widthFactor,this.obliqueAngle=e.obliqueAngle,this.style.document!==e.style.document?this.style=e.style.clone():this.style=e.style,this.mirror=e.mirror,this.horizontalAlignment=e.horizontalAlignment,this.alignmentPoint=e.alignmentPoint,this.normal=e.normal,this.verticalAlignment=e.verticalAlignment,this.version=e.version,this.tag=e.tag,this.flags=e.flags,this.attributeType=e.attributeType,this.isReallyLocked=e.isReallyLocked,this.insertPoint=e.insertPoint}};T();D();B();var nr=class extends Ea{get objectType(){return m.ATTDEF}get objectName(){return h.entityAttributeDefinition}get subclassMarker(){return d.attributeDefinition}prompt="";constructor(e){super(),e&&this.matchAttributeProperties(e)}};T();D();B();var xl;(function(r){r[r.OneDistantLight=0]="OneDistantLight",r[r.TwoDistantLights=1]="TwoDistantLights"})(xl||(xl={}));var E=class r{min;max;get width(){return this.max.x-this.min.x}get height(){return this.max.y-this.min.y}get center(){return new c((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,(this.min.z+this.max.z)/2)}constructor(e,t){this.min=e??new c(1/0,1/0,1/0),this.max=t??new c(-1/0,-1/0,-1/0)}static null=new r;static infinite=new r(new c(-1/0,-1/0,-1/0),new c(1/0,1/0,1/0));static fromPoints(e){if(!e||e.length===0)return r.null;let t=new r;for(let i of e)t.min=new c(Math.min(t.min.x,i.x),Math.min(t.min.y,i.y),Math.min(t.min.z,i.z)),t.max=new c(Math.max(t.max.x,i.x),Math.max(t.max.y,i.y),Math.max(t.max.z,i.z));return t}};var cd;(function(r){r[r.PerspectiveMode=1]="PerspectiveMode",r[r.FrontClipping=2]="FrontClipping",r[r.BackClipping=4]="BackClipping",r[r.UcsFollow=8]="UcsFollow",r[r.FrontClipNotAtEye=16]="FrontClipNotAtEye",r[r.UcsIconVisibility=32]="UcsIconVisibility",r[r.UcsIconAtOrigin=64]="UcsIconAtOrigin",r[r.FastZoom=128]="FastZoom",r[r.SnapMode=256]="SnapMode",r[r.GridMode=512]="GridMode",r[r.IsometricSnapStyle=1024]="IsometricSnapStyle",r[r.HidePlotMode=2048]="HidePlotMode",r[r.IsoPairTop=4096]="IsoPairTop",r[r.IsoPairRight=8192]="IsoPairRight",r[r.ViewportZoomLocking=16384]="ViewportZoomLocking",r[r.CurrentlyAlwaysEnabled=32768]="CurrentlyAlwaysEnabled",r[r.NonRectangularClipping=65536]="NonRectangularClipping",r[r.ViewportOff=131072]="ViewportOff",r[r.DisplayGridBeyondDrawingLimits=262144]="DisplayGridBeyondDrawingLimits",r[r.AdaptiveGridDisplay=524288]="AdaptiveGridDisplay",r[r.SubdivisionGridBelowSpacing=1048576]="SubdivisionGridBelowSpacing"})(cd||(cd={}));var Ue=class r extends N{ambientLightColor=null;backClipPlane=0;boundary=null;brightness=0;center=new c(0,0,0);circleZoomPercent=0;contrast=0;defaultLightingType=xl.OneDistantLight;displayUcsIcon=!1;elevation=0;frontClipPlane=0;frozenLayers=[];gridSpacing=new g(0,0);height=0;get id(){if(this._id!==0)return this._id;let e=this.owner?.entities;if(e==null)return 0;let t=0;for(let i of e)if(i instanceof r&&(t++,i===this))return t;return 0}set id(e){this._id=e}lensLength=0;majorGridLineFrequency=0;get objectName(){return h.entityViewport}get objectType(){return m.VIEWPORT}renderMode=0;get representsPaper(){return this.id===r.paperViewId}scale=null;get scaleFactor(){return this.height===0?1:1/(this.viewHeight/this.height)}shadePlotMode=0;snapAngle=0;snapBase=new g(0,0);snapSpacing=new g(0,0);status=0;styleSheetName="";get subclassMarker(){return d.viewport}twistAngle=0;ucsOrigin=new c(0,0,0);ucsOrthographicType=0;ucsPerViewport=!1;ucsXAxis=new c(1,0,0);ucsYAxis=new c(0,1,0);useDefaultLighting=!1;viewCenter=new g(0,0);viewDirection=new c(0,0,1);viewHeight=0;viewTarget=new c(0,0,0);get viewWidth(){return this.height===0?0:this.viewHeight/this.height*this.width}visualStyle=null;width=0;static asdk_xrec_annotation_scale_info="ASDK_XREC_ANNOTATION_SCALE_INFO";static paperViewId=1;applyTransform(e){if(this.boundary!=null){this.boundary.applyTransform(e);let t=this.boundary.getBoundingBox();t!=null&&(this.center=t.center,this.width=t.width,this.height=t.height)}else{let t=this.getBoundingBox(),i=[new c(t.min.x,t.min.y,t.min.z),new c(t.min.x,t.max.y,t.min.z),new c(t.max.x,t.min.y,t.min.z),new c(t.max.x,t.max.y,t.min.z)].map(a=>this.applyTransformToPoint(e,a)),s=E.fromPoints(i);this.center=s.center,this.width=s.width,this.height=s.height}this.viewTarget=this.applyTransformToPoint(e,this.viewTarget),this.viewDirection=this.applyTransformToVector(e,this.viewDirection),this.ucsOrigin=this.applyTransformToPoint(e,this.ucsOrigin),this.ucsXAxis=this.applyTransformToVector(e,this.ucsXAxis),this.ucsYAxis=this.applyTransformToVector(e,this.ucsYAxis)}clone(){let e=super.clone();return e.boundary=this.boundary?.clone()??null,e.visualStyle=this.visualStyle?.clone()??null,e.scale=this.scale?.clone()??null,e.frozenLayers=this.frozenLayers.map(t=>t.clone()),e}getBoundingBox(){return new E(new c(this.center.x-this.width/2,this.center.y-this.height/2,this.center.z),new c(this.center.x+this.width/2,this.center.y+this.height/2,this.center.z))}getModelBoundingBox(){return new E(new c(this.viewCenter.x-this.viewWidth/2,this.viewCenter.y-this.viewHeight/2,0),new c(this.viewCenter.x+this.viewWidth/2,this.viewCenter.y+this.viewHeight/2,0))}selectEntities(e=!0){if(this.document==null)throw new Error("Viewport needs to be assigned to a document.");let t=this.getModelBoundingBox(),i=n=>n.max.x>=t.min.x&&n.min.x<=t.max.x&&n.max.y>=t.min.y&&n.min.y<=t.max.y,s=n=>n.min.x>=t.min.x&&n.max.x<=t.max.x&&n.min.y>=t.min.y&&n.max.y<=t.max.y,a=[];for(let n of this.document.entities??[]){if(n===this)continue;let o=n.getBoundingBox();o!=null&&(e?i(o):s(o))&&a.push(n)}return a}assignDocument(e){super.assignDocument(e)}unassignDocument(){super.unassignDocument(),this.scale=this.scale?.clone()??null}_id=0};xr();te();T();D();B();var jd=class{},ka=class r{index=0;nextNodeIndex=0;next=null;flags=0;data1=0;data2=0;data3=0;data4=0;expression=null;clone(){let e=new r;return e.index=this.index,e.nextNodeIndex=this.nextNodeIndex,e.flags=this.flags,e.data1=this.data1,e.data2=this.data2,e.data3=this.data3,e.data4=this.data4,e.next=this.next?.clone()??null,e.expression=this.expression?.clone()??null,e}},Vt=class extends M{edges=[];nodes=[];get objectName(){return h.objectEvalGraph}get objectType(){return m.UNLISTED}get subclassMarker(){return d.evalGraph}value96=0;value97=0;static dictionaryEntryName="ACAD_ENHANCEDBLOCK";clone(){let e=super.clone();return e.nodes=this.nodes.map(t=>t.clone()),e}};te();T();D();B();var Ls;(function(r){r[r.None=0]="None",r[r.PlotViewportBorders=1]="PlotViewportBorders",r[r.ShowPlotStyles=2]="ShowPlotStyles",r[r.PlotCentered=4]="PlotCentered",r[r.PlotHidden=8]="PlotHidden",r[r.UseStandardScale=16]="UseStandardScale",r[r.PlotPlotStyles=32]="PlotPlotStyles",r[r.ScaleLineweights=64]="ScaleLineweights",r[r.PrintLineweights=128]="PrintLineweights",r[r.DrawViewportsFirst=512]="DrawViewportsFirst",r[r.ModelType=1024]="ModelType",r[r.UpdatePaper=2048]="UpdatePaper",r[r.ZoomToPaperOnUpdate=4096]="ZoomToPaperOnUpdate",r[r.Initializing=8192]="Initializing",r[r.PrevPlotInit=16384]="PrevPlotInit"})(Ls||(Ls={}));var Cl;(function(r){r[r.Inches=0]="Inches",r[r.Millimeters=1]="Millimeters",r[r.Pixels=2]="Pixels"})(Cl||(Cl={}));var pi;(function(r){r[r.NoRotation=0]="NoRotation",r[r.Degrees90=1]="Degrees90",r[r.Degrees180=2]="Degrees180",r[r.Degrees270=3]="Degrees270"})(pi||(pi={}));var To;(function(r){r[r.AsDisplayed=0]="AsDisplayed",r[r.Wireframe=1]="Wireframe",r[r.Hidden=2]="Hidden",r[r.Rendered=3]="Rendered"})(To||(To={}));var So;(function(r){r[r.Draft=0]="Draft",r[r.Preview=1]="Preview",r[r.Normal=2]="Normal",r[r.Presentation=3]="Presentation",r[r.Maximum=4]="Maximum",r[r.Custom=5]="Custom"})(So||(So={}));var Ht=class{left;bottom;right;top;get bottomLeftCorner(){return new g(this.left,this.bottom)}get topCorner(){return new g(this.right,this.top)}constructor(e=0,t=0,i=0,s=0){this.left=e,this.bottom=t,this.right=i,this.top=s}};var dd;(function(r){r[r.DrawingExtents=0]="DrawingExtents",r[r.Limits=1]="Limits",r[r.View=2]="View",r[r.Window=3]="Window",r[r.Layout=4]="Layout",r[r.Display=5]="Display"})(dd||(dd={}));var hd;(function(r){r[r.ScaleToFit=0]="ScaleToFit",r[r.UserDefined=1]="UserDefined"})(hd||(hd={}));var Bt=class extends M{_denominatorScale=1;_numeratorScale=1;_shadePlotDPI=300;get denominatorScale(){return this._denominatorScale}set denominatorScale(e){if(e<=0)throw new Error("Value must be greater than zero");this._denominatorScale=e}flags=Ls.DrawViewportsFirst|Ls.PrintLineweights|Ls.PlotPlotStyles|Ls.UseStandardScale;get numeratorScale(){return this._numeratorScale}set numeratorScale(e){if(e<=0)throw new Error("Value must be greater than zero");this._numeratorScale=e}get objectName(){return h.objectPlotSettings}get objectType(){return m.UNLISTED}pageName="none_device";paperHeight=0;paperImageOrigin=new g(0,0);paperImageOriginX=0;paperImageOriginY=0;paperRotation=pi.NoRotation;paperSize="ISO_A4_(210.00_x_297.00_MM)";paperUnits=Cl.Millimeters;paperWidth=0;plotOriginX=0;plotOriginY=0;plotType=dd.DrawingExtents;plotViewName="";get printScale(){return this.numeratorScale/this.denominatorScale}scaledFit=hd.ScaleToFit;get shadePlotDPI(){return this._shadePlotDPI}set shadePlotDPI(e){if(e<100||e>32767)throw new Error("The valid shade plot DPI values range from 100 to 32767.");this._shadePlotDPI=e}shadePlotIDHandle=0;shadePlotMode=To.AsDisplayed;shadePlotResolutionMode=So.Draft;standardScale=1;styleSheet="";get subclassMarker(){return d.plotSettings}systemPrinterName="";unprintableMargin=new Ht;windowLowerLeftX=0;windowLowerLeftY=0;windowUpperLeftX=0;windowUpperLeftY=0;constructor(e){super(e)}};T();D();B();var Bo;(function(r){r[r.None=0]="None",r[r.PaperSpaceLinetypeScaling=1]="PaperSpaceLinetypeScaling",r[r.LimitsChecking=2]="LimitsChecking"})(Bo||(Bo={}));var ke=class r extends Bt{_blockRecord=null;_lastViewport=null;get associatedBlock(){return this._blockRecord}set associatedBlock(e){if(e==null)throw new Error("value cannot be null");this._blockRecord!==e&&(this._blockRecord?.layout===this&&(this._blockRecord.layout=null),this._blockRecord=e,this._blockRecord.layout=this)}baseUCS=null;elevation=0;insertionBasePoint=new c(0,0,0);get isPaperSpace(){return this.name?.toLowerCase()!==r.modelLayoutName.toLowerCase()}get lastActiveViewport(){return this._lastViewport}set lastActiveViewport(e){this._lastViewport=e}layoutFlags=Bo.PaperSpaceLinetypeScaling;maxExtents=new c(231.3,175.5,0);maxLimits=new g(277,202.5);minExtents=new c(25.7,19.5,0);minLimits=new g(-20,-7.5);get objectName(){return h.objectLayout}get objectType(){return m.LAYOUT}origin=new c(0,0,0);get subclassMarker(){return d.layout}tabOrder=0;ucs=null;ucsOrthographicType=0;get viewports(){return this.associatedBlock?.viewports??null}xAxis=new c(1,0,0);yAxis=new c(0,1,0);static modelLayoutName="Model";static paperLayoutName="Layout1";constructor(e,t){super(),e!=null&&(this.name=e)}addViewport(e){this.associatedBlock?.entities?.add(e)}clone(){return this._cloneCore(!0)}cloneWithoutAssociatedBlock(){return this._cloneCore(!1)}toString(){return`${this.objectName}:${this.name}`}updatePaperViewport(){if(!this.isPaperSpace||this.associatedBlock==null)return;let e=this.viewports?.find(i=>i.representsPaper)??null;if(e!=null){this.lastActiveViewport??=e;return}let t=new Ue;t.id=Ue.paperViewId,this.addViewport(t),this.lastActiveViewport=t}_cloneCore(e){let t=super.clone();return t._blockRecord=null,t._lastViewport=null,!e||this._blockRecord==null||(t.associatedBlock=this._blockRecord.cloneWithoutLayout(),this._lastViewport!=null&&(t._lastViewport=t.viewports?.find(i=>i.id===this._lastViewport?.id)??null)),t}};te();T();D();B();var ud=class{sortHandle=0;entity;constructor(e,t){this.entity=e,this.sortHandle=t}toString(){return`${this.sortHandle} | ${this.entity?.toString()}`}compareTo(e){return this.sortHandlee.sortHandle?1:0}},pt=class r extends M{blockOwner=null;get objectName(){return h.objectSortEntsTable}get objectType(){return m.UNLISTED}get subclassMarker(){return d.sortentsTable}static dictionaryEntryName="ACAD_SORTENTS";_sorters=[];constructor(e){super(r.dictionaryEntryName),e&&(this.blockOwner=e)}add(e,t){this._sorters.push(new ud(e,t))}clear(){this._sorters.length=0}clone(){let e=super.clone();return e._sorters=[],e}getSorterHandle(e){let t=this._sorters.find(i=>i.entity===e);return t?t.sortHandle:e.handle}remove(e){let t=this._sorters.findIndex(i=>i.entity===e);return t<0?!1:(this._sorters.splice(t,1),!0)}[Symbol.iterator](){return[...this._sorters].sort((t,i)=>t.compareTo(i))[Symbol.iterator]()}};B();var ce;(function(r){r[r.Unitless=0]="Unitless",r[r.Inches=1]="Inches",r[r.Feet=2]="Feet",r[r.Miles=3]="Miles",r[r.Millimeters=4]="Millimeters",r[r.Centimeters=5]="Centimeters",r[r.Meters=6]="Meters",r[r.Kilometers=7]="Kilometers",r[r.Microinches=8]="Microinches",r[r.Mils=9]="Mils",r[r.Yards=10]="Yards",r[r.Angstroms=11]="Angstroms",r[r.Nanometers=12]="Nanometers",r[r.Microns=13]="Microns",r[r.Decimeters=14]="Decimeters",r[r.Decameters=15]="Decameters",r[r.Hectometers=16]="Hectometers",r[r.Gigameters=17]="Gigameters",r[r.AstronomicalUnits=18]="AstronomicalUnits",r[r.LightYears=19]="LightYears",r[r.Parsecs=20]="Parsecs",r[r.USSurveyFeet=21]="USSurveyFeet",r[r.USSurveyInches=22]="USSurveyInches",r[r.USSurveyYards=23]="USSurveyYards"})(ce||(ce={}));ie();ht();var Pa=class extends le{constructor(e,t){super(e,t)}resolveReference(e){return e.getCadObject(this.value)}};var Vi=class extends Pa{constructor(e){super(w.ExtendedDataHandle,e)}};T();D();B();var Re=class r extends ye{static get default(){return new r(r.defaultName)}get objectName(){return h.tableAppId}get objectType(){return m.APPID}get subclassMarker(){return d.applicationId}static blockRepBTag="AcDbBlockRepBTag";static blockRepETag="AcDbBlockRepETag";static defaultName="ACAD";constructor(e){if(super(e),e!==void 0&&!e)throw new Error("Application id must have a name.")}};var U=class r extends ye{static get modelSpace(){let e=new r(r.modelSpaceName),t=new ke(ke.modelLayoutName);return t.associatedBlock=e,e}static get paperSpace(){let e=new r(r.paperSpaceName),t=new ke(ke.paperLayoutName);return t.associatedBlock=e,e}get attributeDefinitions(){return Array.from(this.entities).filter(e=>e instanceof nr)}get blockEnd(){return this._blockEnd}set blockEnd(e){this._blockEnd=e,this._blockEnd.owner=this}get blockEntity(){return this._blockEntity}set blockEntity(e){this._blockEntity=e,this._blockEntity.owner=this}canScale=!0;entities;get evaluationGraph(){return this.xDictionary?.getEntry(Vt.dictionaryEntryName)??null}get blockFlags(){return this.blockEntity.flags}set blockFlags(e){this.blockEntity.flags=e}get combinedFlags(){return this.blockEntity.flags|this.flags}get hasAttributes(){return this.attributeDefinitions.length>0}get isAnonymous(){return(this.blockFlags&ne.Anonymous)!==0}set isAnonymous(e){e?this.blockFlags|=ne.Anonymous:this.blockFlags&=~ne.Anonymous}get isDynamic(){return this.evaluationGraph!=null}isExplodable=!1;insertHandles=[];ownedObjectHandles=[];get isUnloaded(){return this.blockEntity.isUnloaded}set isUnloaded(e){this.blockEntity.isUnloaded=e}get layout(){return this._layout}set layout(e){this._layout=e}get objectName(){return h.tableBlockRecord}get objectType(){return m.BLOCK_HEADER}preview=null;get sortEntitiesTable(){return this.xDictionary?.getEntry(pt.dictionaryEntryName)??null}get source(){let t=this.extendedData.getExtendedDataByName().get(Re.blockRepBTag.toUpperCase())?.records.find(s=>s instanceof Vi)??null;if(t==null||this.document==null)return null;let i=t.resolveReference(this.document);return i instanceof r&&i!==this?i:null}get subclassMarker(){return d.blockRecord}units=ce.Unitless;get viewports(){return Array.from(this.entities).filter(e=>e instanceof Ue)}static anonymousPrefix="*A";static modelSpaceName="*Model_Space";static paperSpaceName="*Paper_Space";_blockEnd;_blockEntity;_layout=null;constructor(e,t,i=!1){super(e),this._blockEntity=new fi(this),this._blockEnd=new Ps(this),this.entities=new Co(this),t!=null&&(this.blockEntity.xRefPath=t,this.blockFlags|=i?ne.XRefOverlay:ne.XRef)}clone(){return this._cloneCore(!0)}cloneWithoutLayout(){return this._cloneCore(!1)}_cloneCore(e){let t=super.clone();t._layout=null,t.insertHandles=[...this.insertHandles],t.ownedObjectHandles=[...this.ownedObjectHandles],t.entities=new Co(t);let i=new Map;for(let a of this.entities){let n=a.clone();t.entities.add(n),i.set(a,n)}if(e&&this.layout!=null){let a=this.layout.cloneWithoutAssociatedBlock();a.associatedBlock=t}let s=t.sortEntitiesTable;if(s!=null){s.blockOwner=t,s.clear();for(let a of this.sortEntitiesTable??[]){let n=i.get(a.entity);n!=null&&s.add(n,a.sortHandle)}}return t.blockEntity=this.blockEntity.clone(),t.blockEntity.owner=t,t.blockEnd=this.blockEnd.clone(),t.blockEnd.owner=t,t}createSortEntitiesTable(){let e=this.sortEntitiesTable;return e!=null||(this.xDictionary==null&&(this.xDictionary=new re),e=new pt(this),this.xDictionary.addByKey(pt.dictionaryEntryName,e)),e}getBoundingBox(){let e=null;for(let t of this.getSortedEntities()){let i=t.getBoundingBox();if(i!=null){if(e==null){e=new E(new c(i.min.x,i.min.y,i.min.z),new c(i.max.x,i.max.y,i.max.z));continue}e.min.x=Math.min(e.min.x,i.min.x),e.min.y=Math.min(e.min.y,i.min.y),e.min.z=Math.min(e.min.z,i.min.z),e.max.x=Math.max(e.max.x,i.max.x),e.max.y=Math.max(e.max.y,i.max.y),e.max.z=Math.max(e.max.z,i.max.z)}}return e}getSortedEntities(){let e=Array.from(this.entities),t=this.sortEntitiesTable;if(t==null)return e;let i=new Set(e),s=[];for(let a of t){let n=a.entity;n!=null&&i.has(n)&&(s.push(n),i.delete(n))}return s.push(...i),s}};var Hh=new c(0,0,0),fi=class extends N{basePoint=Hh;get blockOwner(){return this.owner}comments=null;flags=ne.None;isUnloaded=!1;get name(){return this.blockOwner?.name??""}set name(e){this.blockOwner&&(this.blockOwner.name=e)}get objectName(){return h.block}get objectType(){return m.BLOCK}get subclassMarker(){return d.blockBegin}xRefPath=null;constructor(e){super(),e&&(this.owner=e)}clone(){let e=super.clone();if(this.blockOwner!=null){let t=new U(this.blockOwner.name);t.blockEntity=e}return e}applyTransform(e){this.basePoint=this.applyTransformToPoint(e,this.basePoint)}getBoundingBox(){return null}};De();var wi=class{title="";subject="";author="";keywords="";comments="";lastSavedBy="";revisionNumber="";hyperlinkBase="";createdDate=new Date;modifiedDate=new Date;properties=new Map};var C;(function(r){r[r.Unknown=0]="Unknown",r[r.Usascii=20127]="Usascii",r[r.Iso88591=28591]="Iso88591",r[r.Iso88592=28592]="Iso88592",r[r.Iso88593=28593]="Iso88593",r[r.Iso88594=28594]="Iso88594",r[r.Iso88595=28595]="Iso88595",r[r.Iso88596=28596]="Iso88596",r[r.Iso88597=28597]="Iso88597",r[r.Iso88598=28598]="Iso88598",r[r.Iso88599=28599]="Iso88599",r[r.Iso885910=28600]="Iso885910",r[r.Iso885913=28603]="Iso885913",r[r.Iso885915=28605]="Iso885915",r[r.Ibm437=437]="Ibm437",r[r.Ibm737=737]="Ibm737",r[r.Ibm775=775]="Ibm775",r[r.Ibm850=850]="Ibm850",r[r.Ibm852=852]="Ibm852",r[r.Ibm855=855]="Ibm855",r[r.Ibm857=857]="Ibm857",r[r.Ibm860=860]="Ibm860",r[r.Ibm861=861]="Ibm861",r[r.Ibm863=863]="Ibm863",r[r.Ibm864=864]="Ibm864",r[r.Ibm865=865]="Ibm865",r[r.Ibm869=869]="Ibm869",r[r.Dos720=720]="Dos720",r[r.Cp866=866]="Cp866",r[r.Shift_jis=932]="Shift_jis",r[r.Gb2312=936]="Gb2312",r[r.Ksc5601=949]="Ksc5601",r[r.big5=950]="big5",r[r.Johab=1361]="Johab",r[r.Macintosh=1e4]="Macintosh",r[r.Xmacromanian=10010]="Xmacromanian",r[r.Windows874=874]="Windows874",r[r.Windows1250=1250]="Windows1250",r[r.Windows1251=1251]="Windows1251",r[r.Windows1252=1252]="Windows1252",r[r.Windows1253=1253]="Windows1253",r[r.Windows1254=1254]="Windows1254",r[r.Windows1255=1255]="Windows1255",r[r.Windows1256=1256]="Windows1256",r[r.Windows1257=1257]="Windows1257",r[r.Windows1258=1258]="Windows1258",r[r.Utf16=1200]="Utf16"})(C||(C={}));var q=class r{static _dxfEncodingMap=new Map([["gb2312",C.Gb2312],["kcs5601",C.Ksc5601],["ascii",C.Usascii],["big5",C.big5],["johab",C.Johab],["mac-roman",C.Xmacromanian],["dos437",C.Ibm437],["dos850",C.Ibm850],["dos852",C.Ibm852],["dos737",C.Ibm737],["dos866",C.Cp866],["dos855",C.Ibm855],["dos857",C.Ibm857],["dos860",C.Ibm860],["dos861",C.Ibm861],["dos863",C.Ibm863],["dos864",C.Ibm864],["dos865",C.Ibm865],["dos869",C.Ibm869],["dos720",C.Dos720],["dos775",C.Ibm775],["dos932",C.Shift_jis],["dos950",C.big5],["ansi_874",C.Windows874],["ansi_932",C.Shift_jis],["ansi_936",C.Gb2312],["ansi_950",C.big5],["ansi_1250",C.Windows1250],["ansi1250",C.Windows1250],["ansi_1251",C.Windows1251],["ansi1251",C.Windows1251],["ansi_1252",C.Windows1252],["ansi1252",C.Windows1252],["ansi_1253",C.Windows1253],["ansi1253",C.Windows1253],["ansi_1254",C.Windows1254],["ansi1254",C.Windows1254],["ansi_1255",C.Windows1255],["ansi1255",C.Windows1255],["ansi_1256",C.Windows1256],["ansi1256",C.Windows1256],["ansi_1257",C.Windows1257],["ansi1257",C.Windows1257],["iso8859-1",C.Iso88591],["iso88591",C.Iso88591],["iso8859-2",C.Iso88592],["iso88592",C.Iso88592],["iso8859-3",C.Iso88593],["iso88593",C.Iso88593],["iso8859-4",C.Iso88594],["iso88594",C.Iso88594],["iso8859-5",C.Iso88595],["iso88595",C.Iso88595],["iso8859-6",C.Iso88596],["iso88596",C.Iso88596],["iso8859-7",C.Iso88597],["iso88597",C.Iso88597],["iso8859-8",C.Iso88598],["iso88598",C.Iso88598],["iso8859-9",C.Iso88599],["iso88599",C.Iso88599],["iso8859-10",C.Iso885910],["iso885910",C.Iso885910],["iso8859-13",C.Iso885913],["iso885913",C.Iso885913],["iso885915",C.Iso885915],["iso8859-15",C.Iso885915]]);static _indexedValue=[F.W0,F.W5,F.W9,F.W13,F.W15,F.W18,F.W20,F.W25,F.W30,F.W35,F.W40,F.W50,F.W53,F.W60,F.W70,F.W80,F.W90,F.W100,F.W106,F.W120,F.W140,F.W158,F.W200,F.W211];static _pageCodes=[C.Unknown,C.Usascii,C.Iso88591,C.Iso88592,C.Iso88593,C.Iso88594,C.Iso88595,C.Iso88596,C.Iso88597,C.Iso88598,C.Iso88599,C.Ibm437,C.Ibm850,C.Ibm852,C.Ibm855,C.Ibm857,C.Ibm860,C.Ibm861,C.Ibm863,C.Ibm864,C.Ibm865,C.Ibm869,C.Shift_jis,C.Macintosh,C.big5,C.Ksc5601,C.Johab,C.Cp866,C.Windows1250,C.Windows1251,C.Windows1252,C.Gb2312,C.Windows1253,C.Windows1254,C.Windows1255,C.Windows1256,C.Windows1257,C.Windows874,C.Shift_jis,C.Gb2312,C.Ksc5601,C.big5,C.Johab,C.Utf16,C.Windows1258];static toValue(e){switch(e){case 28:case 29:return F.ByLayer;case 30:return F.ByBlock;case 31:return F.Default;default:return e<0||e>=r._indexedValue.length?F.Default:r._indexedValue[e]}}static toIndex(e){let t=0;switch(e){case F.Default:t=31;break;case F.ByBlock:t=30;break;case F.ByLayer:t=29;break;default:t=r._indexedValue.indexOf(e),t<0&&(t=31);break}return t}static getCodePage(e){return typeof e=="string"?r._dxfEncodingMap.get(e.toLowerCase())??C.Unknown:r._pageCodes[e]??C.Unknown}static getCodePageName(e){for(let[t,i]of r._dxfEncodingMap)if(i===e)return t}static getCodeIndex(e){return r._pageCodes.indexOf(e)}static getVersionFromName(e){let t=e.replace(/\./g,"_").toUpperCase(),i=u[t];return i!==void 0?i:u.Unknown}static getNameFromVersion(e){return u[e]?.replace(/_/g,".")??"Unknown"}static toJulianCalendar(e){let t=e.getFullYear(),i=e.getMonth()+1,s=e.getDate(),a=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),l=e.getMilliseconds(),p=s+a/24+n/1440+(o+l/1e3)/86400;i<3&&(t-=1,i+=12);let b=Math.floor(t/100),x=2-b+Math.floor(b/4),j;t<0?j=Math.floor(365.25*t-.75):j=Math.floor(365.25*t);let k=Math.floor(30.6001*(i+1));return x+j+k+1720995+p}static fromJulianCalendar(e){if(e<1721426||e>5373484)throw new RangeError("The valid values range from 1721426 and 5373484.");let t=Math.floor(e),i=e-t,s=Math.floor((t-186721625e-2)/36524.25),n=t+1+s-Math.floor(s/4)+1524,o=Math.floor((n-122.1)/365.25),l=Math.floor(365.25*o),p=Math.floor((n-l)/30.6001),b=p<14?p-1:p-13,x=b>2?o-4716:o-4715,j=n-l-Math.floor(30.6001*p),k=Math.floor(i*24);i-=k/24;let P=Math.floor(i*1440);i-=P/1440;let he=i*86400,$=Math.floor(he),X=Math.floor((he-$)*1e3);return new Date(x,b-1,j,k,P,$,X)}static editingTime(e){let t=Math.floor(e),i=e-t,s=Math.floor(i*24);i-=s/24;let a=Math.floor(i*1440);i-=a/1440;let n=i*86400,o=Math.floor(n),l=Math.floor((n-o)*1e3);return{days:t,hours:s,minutes:a,seconds:o,milliseconds:l}}static dateToJulian(e){let t=new Date(Date.UTC(1,0,1,12,0,0));if(e0&&n[0]==="#",b=e.toFixed(o);if(i!=="."&&(b=b.replace(".",i)),p&&b.includes(i)){for(;b.endsWith("0");)b=b.slice(0,-1);b.endsWith(i)&&(b=b.slice(0,-1))}return l&&(b.startsWith("0"+i)?b=b.slice(1):b.startsWith("-0"+i)&&(b="-"+b.slice(2))),b}};var pa;(function(r){r[r.BeforeDimensionText=0]="BeforeDimensionText",r[r.AboveDimensionText=1]="AboveDimensionText",r[r.None=2]="None"})(pa||(pa={}));var No;(function(r){r[r.NoBackground=0]="NoBackground",r[r.DrawingBackgroundColor=1]="DrawingBackgroundColor",r[r.DimensionTextBackgroundColor=2]="DimensionTextBackgroundColor"})(No||(No={}));var Ao;(function(r){r[r.Centered=0]="Centered",r[r.Left=1]="Left",r[r.Right=2]="Right",r[r.OverFirstExtLine=3]="OverFirstExtLine",r[r.OverSecondExtLine=4]="OverSecondExtLine"})(Ao||(Ao={}));var vo;(function(r){r[r.Centered=0]="Centered",r[r.Above=1]="Above",r[r.Outside=2]="Outside",r[r.JIS=3]="JIS",r[r.Below=4]="Below"})(vo||(vo={}));var Tl;(function(r){r[r.Both=0]="Both",r[r.ArrowsFirst=1]="ArrowsFirst",r[r.TextFirst=2]="TextFirst",r[r.BestFit=3]="BestFit"})(Tl||(Tl={}));var Hi;(function(r){r[r.LeftToRight=0]="LeftToRight",r[r.RightToLeft=1]="RightToLeft"})(Hi||(Hi={}));var Eo;(function(r){r[r.MoveLineWithText=0]="MoveLineWithText",r[r.AddLeaderWhenTextMoved=1]="AddLeaderWhenTextMoved",r[r.FreeTextPosition=2]="FreeTextPosition"})(Eo||(Eo={}));var ko;(function(r){r[r.Bottom=0]="Bottom",r[r.Middle=1]="Middle",r[r.Top=2]="Top"})(ko||(ko={}));var Q=class r extends ye{static get default(){return new r(r.defaultName)}alternateDimensioningSuffix="[]";alternateUnitDecimalPlaces=3;alternateUnitDimensioning=!1;alternateUnitFormat=ma.Decimal;alternateUnitRounding=0;alternateUnitScaleFactor=25.4;alternateUnitToleranceDecimalPlaces=3;alternateUnitToleranceZeroHandling=ue.SuppressZeroFeetAndInches;alternateUnitZeroHandling=ue.SuppressZeroFeetAndInches;angularDecimalPlaces=0;angularUnit=La.DecimalDegrees;angularZeroHandling=_i.DisplayAll;arcLengthSymbolPosition=pa.BeforeDimensionText;get arrowBlock(){return this._dimArrowBlock}set arrowBlock(e){this._dimArrowBlock=e}get arrowSize(){return this._arrowSize}set arrowSize(e){if(e<0)throw new Error("The arrowSize must be equals or greater than zero.");this._arrowSize=e}centerMarkSize=.09;cursorUpdate=!1;decimalPlaces=2;decimalSeparator=".";get dimArrow1(){return this._dimArrow1}set dimArrow1(e){this._dimArrow1=e}get dimArrow2(){return this._dimArrow2}set dimArrow2(e){this._dimArrow2=e}dimensionFit=0;dimensionLineColor=S.byBlock;dimensionLineExtension=0;dimensionLineGap=.625;dimensionLineIncrement=3.75;dimensionLineWeight=F.ByBlock;dimensionTextArrowFit=Tl.BestFit;dimensionUnit=2;extensionLineColor=S.byBlock;extensionLineExtension=1.25;extensionLineOffset=.625;extensionLineWeight=F.ByBlock;fixedExtensionLineLength=1;fractionFormat=or.Horizontal;generateTolerances=!1;isExtensionLineLengthFixed=!1;get joggedRadiusDimensionTransverseSegmentAngle(){return this._joggedRadiusDimensionTransverseSegmentAngle}set joggedRadiusDimensionTransverseSegmentAngle(e){let t=Math.round(e*1e6)/1e6,i=5*Math.PI/180,s=Math.PI/2;if(t<=i||t>=s)throw new Error("The joggedRadiusDimensionTransverseSegmentAngle must be in range of 5 to 90 degrees.");this._joggedRadiusDimensionTransverseSegmentAngle=e}get leaderArrow(){return this._leaderArrow}set leaderArrow(e){this._leaderArrow=e}limitsGeneration=!1;linearScaleFactor=1;linearUnitFormat=ma.Decimal;get lineType(){return this._lineType}set lineType(e){this._lineType=e}get lineTypeExt1(){return this._lineTypeExt1}set lineTypeExt1(e){this._lineTypeExt1=e}get lineTypeExt2(){return this._lineTypeExt2}set lineTypeExt2(e){this._lineTypeExt2=e}minusTolerance=0;get objectName(){return h.tableDimstyle}get objectType(){return m.DIMSTYLE}plusTolerance=0;postFix="<>";get prefix(){let{prefix:e}=this._getDimStylePrefixAndSuffix(this.postFix,"<",">");return e}set prefix(e){let{suffix:t}=this._getDimStylePrefixAndSuffix(this.postFix,"<",">");this.postFix=`${e}${this.postFix}${t}`}rounding=0;get scaleFactor(){return this._scaleFactor}set scaleFactor(e){if(e<0)throw new Error("The scaleFactor must be equals or greater than zero.");this._scaleFactor=e}separateArrowBlocks=!0;get style(){return this._style}set style(e){if(e==null)throw new Error("Style cannot be null.");this._style=e}get subclassMarker(){return d.dimensionStyle}get suffix(){let{suffix:e}=this._getDimStylePrefixAndSuffix(this.postFix,"<",">");return e}set suffix(e){let{prefix:t}=this._getDimStylePrefixAndSuffix(this.postFix,"<",">");this.postFix=`${t}${this.postFix}${e}`}suppressFirstDimensionLine=!1;suppressFirstExtensionLine=!1;suppressOutsideExtensions=!1;suppressSecondDimensionLine=!1;suppressSecondExtensionLine=!1;textBackgroundColor=S.byBlock;textBackgroundFillMode=No.NoBackground;textColor=S.byBlock;textDirection=Hi.LeftToRight;get textHeight(){return this._textHeight}set textHeight(e){if(e<=0)throw new Error("The textHeight must be greater than zero.");this._textHeight=e}textHorizontalAlignment=Ao.Centered;textInsideExtensions=!1;textInsideHorizontal=!1;textMovement=Eo.MoveLineWithText;textOutsideExtensions=!1;textOutsideHorizontal=!1;textVerticalAlignment=vo.Above;textVerticalPosition=0;tickSize=0;toleranceAlignment=ko.Bottom;toleranceDecimalPlaces=2;toleranceScaleFactor=1;toleranceZeroHandling=ue.SuppressDecimalTrailingZeroes;zeroHandling=ue.SuppressDecimalTrailingZeroes;static defaultName="Standard";static styleOverrideEntryName="DSTYLE";_arrowSize=.18;_dimArrow1=null;_dimArrow2=null;_dimArrowBlock=null;_joggedRadiusDimensionTransverseSegmentAngle=Math.PI/4;_leaderArrow=null;_lineType=null;_lineTypeExt1=null;_lineTypeExt2=null;_scaleFactor=1;_style=oe.default;_textHeight=.18;constructor(e){super(e)}applyRounding(e,t=!1){let i=t?this.alternateUnitRounding:this.rounding;return i!==0&&(e=i*Math.round(e/i)),e}clone(){let e=super.clone();return e.style=this.style?.clone(),e.leaderArrow=this.leaderArrow?.clone()??null,e.arrowBlock=this.arrowBlock?.clone()??null,e.dimArrow1=this.dimArrow1?.clone()??null,e.dimArrow2=this.dimArrow2?.clone()??null,e.lineType=this.lineType?.clone()??null,e.lineTypeExt1=this.lineTypeExt1?.clone()??null,e.lineTypeExt2=this.lineTypeExt2?.clone()??null,e}getAlternateUnitStyleFormat(){let e=new Ro;return e.linearDecimalPlaces=this.alternateUnitDecimalPlaces,e.angularDecimalPlaces=this.alternateUnitDecimalPlaces,e.decimalSeparator=this.decimalSeparator,e.fractionHeightScale=this.toleranceScaleFactor,e.fractionType=this.fractionFormat,e.linearZeroHandling=this.alternateUnitZeroHandling,e.angularZeroHandling=this.angularZeroHandling,e}getUnitStyleFormat(){let e=new Ro;return e.linearDecimalPlaces=this.decimalPlaces,e.angularDecimalPlaces=this.angularDecimalPlaces===-1?this.decimalPlaces:this.angularDecimalPlaces,e.decimalSeparator=this.decimalSeparator,e.fractionHeightScale=this.toleranceScaleFactor,e.fractionType=this.fractionFormat,e.linearZeroHandling=this.zeroHandling,e.angularZeroHandling=this.angularZeroHandling,e}_getDimStylePrefixAndSuffix(e,t,i){let s=-1;for(let a=0;a=0&&e<=4?f.String:e===5?f.Handle:e>=6&&e<=9?f.String:e>=10&&e<=39?f.Point3D:e>=40&&e<=59?f.Double:e>=60&&e<=79?f.Int16:e>=90&&e<=99?f.Int32:e===100?f.String:e===101?f.String:e===102?f.String:e===105?f.Handle:e>=110&&e<=119?f.Double:e>=120&&e<=129?f.Double:e>=130&&e<=139?f.Double:e>=140&&e<=149?f.Double:e>=160&&e<=169?f.Int64:e>=170&&e<=179?f.Int16:e>=210&&e<=239?f.Double:e>=270&&e<=279?f.Int16:e>=280&&e<=289?f.Byte:e>=290&&e<=299?f.Bool:e>=300&&e<=309?f.String:e>=310&&e<=319?f.Chunk:e>=320&&e<=329?f.Handle:e>=330&&e<=369?f.ObjectId:e>=370&&e<=379?f.Int16:e>=380&&e<=389?f.Int16:e>=390&&e<=399?f.ObjectId:e>=400&&e<=409?f.Int16:e>=410&&e<=419?f.String:e>=420&&e<=429?f.Int32:e>=430&&e<=439?f.String:e>=440&&e<=449?f.Int32:e>=450&&e<=459?f.Int32:e>=460&&e<=469?f.Double:e>=470&&e<=479?f.String:e>=480&&e<=481?f.Handle:e===999?f.Comment:e>=1e3&&e<=1003?f.ExtendedDataString:e===1004?f.ExtendedDataChunk:e>=1005&&e<=1009?f.ExtendedDataHandle:e>=1010&&e<=1059?f.ExtendedDataDouble:e>=1060&&e<=1070?f.ExtendedDataInt16:e===1071?f.ExtendedDataInt32:f.None}};function Fh(r){return r instanceof g||r instanceof c}function Oe(r){return typeof r=="number"?r:Number(r)}var ja=class{get assignedCode(){return this._assignedCode!==null?this._assignedCode:this.dxfCodes.length===1?this.dxfCodes[0]:w.Invalid}dxfCodes=[];referenceType=0;get storedValue(){return this._storedValue}set storedValue(e){this._storedValue=this.normalizeStoredValue(e)}get groupCode(){let e=this.dxfCodes[0];return Ne.transformValue(e)}_assignedCode=null;_storedValue=null;_propertyName="";_collectionCodes=null;_valueKind;constructor(e,t=[]){typeof e=="string"?(this._propertyName=e,this.dxfCodes=t,this.referenceType=0,this._valueKind=void 0):(this._propertyName=e.propertyName,this.dxfCodes=[...e.valueCodes],this.referenceType=e.referenceType,this._collectionCodes=e.collectionCodes?[...e.collectionCodes]:null,this._valueKind=e.valueKind)}setValue(e,t,i){if(!t||!this._propertyName)return;let s=this.getPropertyValue(t);if(Fh(s)){let a=Math.max(0,Math.floor(e/10)%10-1);s[a]=Oe(i),this.setPropertyValue(t,s);return}if(s instanceof S)switch(e){case 62:case 70:this.setPropertyValue(t,new S(Oe(i)));return;case 90:case 420:{let a=Oe(i)>>>0,n=a>>16&255,o=a>>8&255,l=a&255;this.setPropertyValue(t,new S(n,o,l));return}}if(s instanceof Ht){let a=s;switch(e){case 40:a=new Ht(Oe(i),a.bottom,a.right,a.top);break;case 41:a=new Ht(a.left,Oe(i),a.right,a.top);break;case 42:a=new Ht(a.left,a.bottom,Oe(i),a.top);break;case 43:a=new Ht(a.left,a.bottom,a.right,Oe(i));break}this.setPropertyValue(t,a);return}if(s instanceof Ee){this.setPropertyValue(t,Ee.fromAlphaValue(Oe(i)));return}if(this._valueKind==="date"||s instanceof Date){this.setPropertyValue(t,i instanceof Date?i:q.fromJulianCalendar(Oe(i)));return}if(this._valueKind==="timespan"){this.setPropertyValue(t,Oe(i)*864e5);return}if(typeof s=="boolean"){this.setPropertyValue(t,typeof i=="boolean"?i:Oe(i)!==0);return}if(typeof s=="string"){this.setPropertyValue(t,i==null?"":String(i));return}if(typeof s=="number"){this.setPropertyValue(t,Oe(i));return}this.setPropertyValue(t,i)}applyValues(e,t){if(!e||!this._propertyName||t.length===0)return;let i=this.getPropertyValue(e);if(t.length>1){if(i instanceof g){this.setPropertyValue(e,new g(Oe(t[0]),Oe(t[1])));return}if(i instanceof c){this.setPropertyValue(e,new c(Oe(t[0]),Oe(t[1]),Oe(t[2]??0)));return}}let s=this.assignedCode!==w.Invalid?this.assignedCode:this.dxfCodes[0];this.setValue(s,e,t[0])}getRawValue(e){return this.getRawValueByCode(this.assignedCode,e)}getPropertyValue(e){return e?.[this._propertyName]}setPropertyValue(e,t){e[this._propertyName]=t}getRawValueByCode(e,t){let i=this.getPropertyValue(t);if(i==null)return i;switch(Ne.transformValue(e)){case f.Handle:case f.ObjectId:case f.ExtendedDataHandle:return this.getHandledValue(t)}if(Fh(i)){let a=Math.max(0,Math.floor(e/10)%10-1);return i[a]}if(this._valueKind==="date"||i instanceof Date)return q.toJulianCalendar(i instanceof Date?i:new Date(Oe(i)));if(this._valueKind==="timespan")return Oe(i)/864e5;if(i instanceof S)switch(e){case 62:case 70:return i.index;case 420:return i.trueColor;default:return null}if(i instanceof Ht)switch(e){case 40:return i.left;case 41:return i.bottom;case 42:return i.right;case 43:return i.top;default:return null}return i instanceof Ee?Ee.toAlphaValue(i):i}getCounterValue(e){let t=this.getPropertyValue(e);if(t==null)return 0;if(Array.isArray(t)||typeof t=="string")return t.length;if(typeof t=="object"&&t!==null&&"length"in t){let s=t.length;if(typeof s=="number")return s}let i=0;for(let s of t)i+=1;return i}getHandledValue(e){let t=this.getPropertyValue(e);if(t==null||typeof t!="object")return null;let i=t;return typeof i.handle=="number"||typeof i.handle=="number"?i.handle:null}getNamedValue(e){let t=this.getPropertyValue(e);if(t==null||typeof t!="object")return null;let i=t;return typeof i.name=="string"||typeof i.name=="string"?i.name:null}normalizeStoredValue(e){if(e==null)return e;switch(this.groupCode){case f.String:case f.Comment:case f.ExtendedDataString:return String(e);case f.Point3D:return e;case f.Double:case f.ExtendedDataDouble:return Oe(e);case f.Byte:case f.Int16:case f.ExtendedDataInt16:case f.Int32:case f.ExtendedDataInt32:case f.Int64:return Oe(e);case f.Bool:return!!e;case f.Chunk:case f.ExtendedDataChunk:return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)?new Uint8Array(e):new Uint8Array;default:return e}}};var Qe;(function(r){r[r.None=0]="None",r[r.Handle=1]="Handle",r[r.Name=2]="Name",r[r.Count=4]="Count",r[r.Optional=8]="Optional",r[r.Ignored=16]="Ignored",r[r.IsAngle=32]="IsAngle",r[r.Unprocess=64]="Unprocess"})(Qe||(Qe={}));var kl=class extends ja{name;dxfCodes=[];isName=!1;constructor(e,t,i=[]){typeof e=="string"?(super(e,i),this.name=t??e,this.dxfCodes=[...i],this.isName=!1,this.referenceType=0):(super(e),this.name=e.name,this.dxfCodes=[...e.valueCodes],this.isName=e.isName,this.referenceType=e.referenceType)}getSystemValue(e,t){switch(this.referenceType){case Qe.Unprocess:return this.getValue(t);case Qe.Handle:return this.getHandledValue(t);case Qe.Name:return this.getNamedValue(t);case Qe.Count:return this.getCounterValue(t);case Qe.None:default:return this.getRawValueByCode(e,t)}}getValue(e){return this.getPropertyValue(e)}};var Uh=[{typeName:"Block",baseTypeName:"Entity",properties:[{propertyName:"basePoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"comments",valueCodes:[4],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"isUnloaded",valueCodes:[71],referenceType:0},{propertyName:"name",valueCodes:[2,3],referenceType:0},{propertyName:"xRefPath",valueCodes:[1],referenceType:0}],systemVariables:[],dxfName:"BLOCK",dxfSubClassName:"AcDbBlockBegin"},{typeName:"BlockEnd",baseTypeName:"Entity",properties:[],systemVariables:[],dxfName:"ENDBLK",dxfSubClassName:"AcDbBlockEnd"}];var Wh=[{typeName:"CadHeader",properties:[],systemVariables:[{name:"$ANGBASE",isName:!1,propertyName:"angleBase",valueCodes:[50],referenceType:0},{name:"$ANGDIR",isName:!1,propertyName:"angularDirection",valueCodes:[70],referenceType:0},{name:"$AUNITS",isName:!1,propertyName:"angularUnit",valueCodes:[70],referenceType:0},{name:"$AUPREC",isName:!1,propertyName:"angularUnitPrecision",valueCodes:[70],referenceType:0},{name:"$DIMLDRBLK",isName:!1,propertyName:"arrowBlockName",valueCodes:[1],referenceType:0},{name:"$DIMASO",isName:!1,propertyName:"associatedDimensions",valueCodes:[70],referenceType:0},{name:"$ATTMODE",isName:!1,propertyName:"attributeVisibility",valueCodes:[70],referenceType:0},{name:"$BLIPMODE",isName:!1,propertyName:"blipMode",valueCodes:[70],referenceType:0},{name:"$CAMERADISPLAY",isName:!1,propertyName:"cameraDisplayObjects",valueCodes:[290],referenceType:0},{name:"$CAMERAHEIGHT",isName:!1,propertyName:"cameraHeight",valueCodes:[40],referenceType:0},{name:"$CHAMFERD",isName:!1,propertyName:"chamferAngle",valueCodes:[40],referenceType:0},{name:"$CHAMFERA",isName:!1,propertyName:"chamferDistance1",valueCodes:[40],referenceType:0},{name:"$CHAMFERB",isName:!1,propertyName:"chamferDistance2",valueCodes:[40],referenceType:0},{name:"$CHAMFERC",isName:!1,propertyName:"chamferLength",valueCodes:[40],referenceType:0},{name:"$DWGCODEPAGE",isName:!1,propertyName:"codePage",valueCodes:[3],referenceType:0},{name:"$TDCREATE",isName:!1,propertyName:"createDateTime",valueCodes:[40],referenceType:0,valueKind:"date"},{name:"$PELLIPSE",isName:!1,propertyName:"createEllipseAsPolyline",valueCodes:[70],referenceType:0},{name:"$CECOLOR",isName:!1,propertyName:"currentEntityColor",valueCodes:[62],referenceType:0},{name:"$CELTSCALE",isName:!1,propertyName:"currentEntityLinetypeScale",valueCodes:[40],referenceType:0},{name:"$CELWEIGHT",isName:!1,propertyName:"currentEntityLineWeight",valueCodes:[370],referenceType:0},{name:"$CEPSNTYPE",isName:!1,propertyName:"currentEntityPlotStyle",valueCodes:[380],referenceType:0},{name:"$CLAYER",isName:!0,propertyName:"currentLayerName",valueCodes:[8],referenceType:0},{name:"$CELTYPE",isName:!0,propertyName:"currentLineTypeName",valueCodes:[6],referenceType:0},{name:"$CMLJUST",isName:!1,propertyName:"currentMultiLineJustification",valueCodes:[70],referenceType:0},{name:"$CMLSCALE",isName:!1,propertyName:"currentMultilineScale",valueCodes:[40],referenceType:0},{name:"$CMLSTYLE",isName:!0,propertyName:"currentMLineStyleName",valueCodes:[2],referenceType:0},{name:"$DGNFRAME",isName:!1,propertyName:"dgnUnderlayFramesVisibility",valueCodes:[280],referenceType:0},{name:"$DIMAPOST",isName:!1,propertyName:"dimensionAlternateDimensioningSuffix",valueCodes:[1],referenceType:0},{name:"$DIMALTD",isName:!1,propertyName:"dimensionAlternateUnitDecimalPlaces",valueCodes:[70],referenceType:0},{name:"$DIMALT",isName:!1,propertyName:"dimensionAlternateUnitDimensioning",valueCodes:[70],referenceType:0},{name:"$DIMALTU",isName:!1,propertyName:"dimensionAlternateUnitFormat",valueCodes:[70],referenceType:0},{name:"$DIMALTRND",isName:!1,propertyName:"dimensionAlternateUnitRounding",valueCodes:[40],referenceType:0},{name:"$DIMALTF",isName:!1,propertyName:"dimensionAlternateUnitScaleFactor",valueCodes:[40],referenceType:0},{name:"$DIMALTTD",isName:!1,propertyName:"dimensionAlternateUnitToleranceDecimalPlaces",valueCodes:[70],referenceType:0},{name:"$DIMALTTZ",isName:!1,propertyName:"dimensionAlternateUnitToleranceZeroHandling",valueCodes:[70],referenceType:0},{name:"$DIMALTZ",isName:!1,propertyName:"dimensionAlternateUnitZeroHandling",valueCodes:[70],referenceType:0},{name:"$DIMALTMZF",isName:!1,propertyName:"dimensionAltMzf",valueCodes:[40],referenceType:0},{name:"$DIMALTMZS",isName:!1,propertyName:"dimensionAltMzs",valueCodes:[6],referenceType:0},{name:"$DIMADEC",isName:!1,propertyName:"dimensionAngularDimensionDecimalPlaces",valueCodes:[70],referenceType:0},{name:"$DIMAUNIT",isName:!1,propertyName:"dimensionAngularUnit",valueCodes:[70],referenceType:0},{name:"$DIMAZIN",isName:!1,propertyName:"dimensionAngularZeroHandling",valueCodes:[70],referenceType:0},{name:"$DIMARCSYM",isName:!1,propertyName:"dimensionArcLengthSymbolPosition",valueCodes:[70],referenceType:0},{name:"$DIMASZ",isName:!1,propertyName:"dimensionArrowSize",valueCodes:[40],referenceType:0},{name:"$DIMASSOC",isName:!1,propertyName:"dimensionAssociativity",valueCodes:[280],referenceType:0},{name:"$DIMBLK",isName:!1,propertyName:"dimensionBlockName",valueCodes:[1],referenceType:0},{name:"$DIMBLK1",isName:!1,propertyName:"dimensionBlockNameFirst",valueCodes:[1],referenceType:0},{name:"$DIMBLK2",isName:!1,propertyName:"dimensionBlockNameSecond",valueCodes:[1],referenceType:0},{name:"$DIMCEN",isName:!1,propertyName:"dimensionCenterMarkSize",valueCodes:[40],referenceType:0},{name:"$DIMUPT",isName:!1,propertyName:"dimensionCursorUpdate",valueCodes:[70],referenceType:0},{name:"$DIMDEC",isName:!1,propertyName:"dimensionDecimalPlaces",valueCodes:[70],referenceType:0},{name:"$DIMDSEP",isName:!1,propertyName:"dimensionDecimalSeparator",valueCodes:[70],referenceType:0},{name:"$DIMATFIT",isName:!1,propertyName:"dimensionDimensionTextArrowFit",valueCodes:[70],referenceType:0},{name:"$DIMCLRE",isName:!1,propertyName:"dimensionExtensionLineColor",valueCodes:[70],referenceType:0},{name:"$DIMEXE",isName:!1,propertyName:"dimensionExtensionLineExtension",valueCodes:[40],referenceType:0},{name:"$DIMEXO",isName:!1,propertyName:"dimensionExtensionLineOffset",valueCodes:[40],referenceType:0},{name:"$DIMFIT",isName:!1,propertyName:"dimensionFit",valueCodes:[70],referenceType:0},{name:"$DIMFXL",isName:!1,propertyName:"dimensionFixedExtensionLineLength",valueCodes:[40],referenceType:0},{name:"$DIMFRAC",isName:!1,propertyName:"dimensionFractionFormat",valueCodes:[70],referenceType:0},{name:"$DIMTOL",isName:!1,propertyName:"dimensionGenerateTolerances",valueCodes:[70],referenceType:0},{name:"$DIMFXLON",isName:!1,propertyName:"dimensionIsExtensionLineLengthFixed",valueCodes:[70],referenceType:0},{name:"$DIMJOGANG",isName:!1,propertyName:"dimensionJoggedRadiusDimensionTransverseSegmentAngle",valueCodes:[40],referenceType:0},{name:"$DIMLIM",isName:!1,propertyName:"dimensionLimitsGeneration",valueCodes:[70],referenceType:0},{name:"$DIMLFAC",isName:!1,propertyName:"dimensionLinearScaleFactor",valueCodes:[40],referenceType:0},{name:"$DIMLUNIT",isName:!1,propertyName:"dimensionLinearUnitFormat",valueCodes:[70],referenceType:0},{name:"$DIMCLRD",isName:!1,propertyName:"dimensionLineColor",valueCodes:[70],referenceType:0},{name:"$DIMDLE",isName:!1,propertyName:"dimensionLineExtension",valueCodes:[40],referenceType:0},{name:"$DIMGAP",isName:!1,propertyName:"dimensionLineGap",valueCodes:[40],referenceType:0},{name:"$DIMDLI",isName:!1,propertyName:"dimensionLineIncrement",valueCodes:[40],referenceType:0},{name:"$DIMLTYPE",isName:!1,propertyName:"dimensionLineType",valueCodes:[6],referenceType:0},{name:"$DIMLWD",isName:!1,propertyName:"dimensionLineWeight",valueCodes:[70],referenceType:0},{name:"$DIMTM",isName:!1,propertyName:"dimensionMinusTolerance",valueCodes:[40],referenceType:0},{name:"$DIMMZF",isName:!1,propertyName:"dimensionMzf",valueCodes:[40],referenceType:0},{name:"$DIMMZS",isName:!1,propertyName:"dimensionMzs",valueCodes:[6],referenceType:0},{name:"$DIMTP",isName:!1,propertyName:"dimensionPlusTolerance",valueCodes:[40],referenceType:0},{name:"$DIMPOST",isName:!1,propertyName:"dimensionPostFix",valueCodes:[1],referenceType:0},{name:"$DIMRND",isName:!1,propertyName:"dimensionRounding",valueCodes:[40],referenceType:0},{name:"$DIMSCALE",isName:!1,propertyName:"dimensionScaleFactor",valueCodes:[40],referenceType:0},{name:"$DIMSAH",isName:!1,propertyName:"dimensionSeparateArrowBlocks",valueCodes:[70],referenceType:0},{name:"$DIMSTYLE",isName:!0,propertyName:"currentDimensionStyleName",valueCodes:[2],referenceType:0},{name:"$DIMSD1",isName:!1,propertyName:"dimensionSuppressFirstDimensionLine",valueCodes:[70],referenceType:0},{name:"$DIMSE1",isName:!1,propertyName:"dimensionSuppressFirstExtensionLine",valueCodes:[70],referenceType:0},{name:"$DIMSOXD",isName:!1,propertyName:"dimensionSuppressOutsideExtensions",valueCodes:[70],referenceType:0},{name:"$DIMSD2",isName:!1,propertyName:"dimensionSuppressSecondDimensionLine",valueCodes:[70],referenceType:0},{name:"$DIMSE2",isName:!1,propertyName:"dimensionSuppressSecondExtensionLine",valueCodes:[70],referenceType:0},{name:"$DIMLTEX1",isName:!1,propertyName:"dimensionTex1",valueCodes:[6],referenceType:0},{name:"$DIMLTEX2",isName:!1,propertyName:"dimensionTex2",valueCodes:[6],referenceType:0},{name:"$DIMTFILLCLR",isName:!1,propertyName:"dimensionTextBackgroundColor",valueCodes:[62],referenceType:16},{name:"$DIMTFILL",isName:!1,propertyName:"dimensionTextBackgroundFillMode",valueCodes:[70],referenceType:0},{name:"$DIMCLRT",isName:!1,propertyName:"dimensionTextColor",valueCodes:[70],referenceType:0},{name:"$DIMTXTDIRECTION",isName:!1,propertyName:"dimensionTextDirection",valueCodes:[70],referenceType:0},{name:"$DIMTXT",isName:!1,propertyName:"dimensionTextHeight",valueCodes:[40],referenceType:0},{name:"$DIMJUST",isName:!1,propertyName:"dimensionTextHorizontalAlignment",valueCodes:[70],referenceType:0},{name:"$DIMTIX",isName:!1,propertyName:"dimensionTextInsideExtensions",valueCodes:[70],referenceType:0},{name:"$DIMTIH",isName:!1,propertyName:"dimensionTextInsideHorizontal",valueCodes:[70],referenceType:0},{name:"$DIMTMOVE",isName:!1,propertyName:"dimensionTextMovement",valueCodes:[70],referenceType:0},{name:"$DIMTOFL",isName:!1,propertyName:"dimensionTextOutsideExtensions",valueCodes:[70],referenceType:0},{name:"$DIMTOH",isName:!1,propertyName:"dimensionTextOutsideHorizontal",valueCodes:[70],referenceType:0},{name:"$DIMTXSTY",isName:!0,propertyName:"dimensionTextStyleName",valueCodes:[7],referenceType:0},{name:"$DIMTAD",isName:!1,propertyName:"dimensionTextVerticalAlignment",valueCodes:[70],referenceType:0},{name:"$DIMTVP",isName:!1,propertyName:"dimensionTextVerticalPosition",valueCodes:[40],referenceType:0},{name:"$DIMTSZ",isName:!1,propertyName:"dimensionTickSize",valueCodes:[40],referenceType:0},{name:"$DIMTOLJ",isName:!1,propertyName:"dimensionToleranceAlignment",valueCodes:[70],referenceType:0},{name:"$DIMTDEC",isName:!1,propertyName:"dimensionToleranceDecimalPlaces",valueCodes:[70],referenceType:0},{name:"$DIMTFAC",isName:!1,propertyName:"dimensionToleranceScaleFactor",valueCodes:[40],referenceType:0},{name:"$DIMTZIN",isName:!1,propertyName:"dimensionToleranceZeroHandling",valueCodes:[70],referenceType:0},{name:"$DIMUNIT",isName:!1,propertyName:"dimensionUnit",valueCodes:[70],referenceType:0},{name:"$DIMZIN",isName:!1,propertyName:"dimensionZeroHandling",valueCodes:[70],referenceType:0},{name:"$LIGHTGLYPHDISPLAY",isName:!1,propertyName:"displayLightGlyphs",valueCodes:[280],referenceType:0},{name:"$LWDISPLAY",isName:!1,propertyName:"displayLineWeight",valueCodes:[290],referenceType:0},{name:"$DISPSILH",isName:!1,propertyName:"displaySilhouetteCurves",valueCodes:[70],referenceType:0},{name:"$LOFTANG1",isName:!1,propertyName:"draftAngleFirstCrossSection",valueCodes:[40],referenceType:0},{name:"$LOFTANG2",isName:!1,propertyName:"draftAngleSecondCrossSection",valueCodes:[40],referenceType:0},{name:"$LOFTMAG1",isName:!1,propertyName:"draftMagnitudeFirstCrossSection",valueCodes:[40],referenceType:0},{name:"$LOFTMAG2",isName:!1,propertyName:"draftMagnitudeSecondCrossSection",valueCodes:[40],referenceType:0},{name:"$3DDWFPREC",isName:!1,propertyName:"dw3DPrecision",valueCodes:[40],referenceType:0},{name:"$DWFFRAME",isName:!1,propertyName:"dwgUnderlayFramesVisibility",valueCodes:[280],referenceType:0},{name:"$ELEVATION",isName:!1,propertyName:"elevation",valueCodes:[40],referenceType:0},{name:"$ENDCAPS",isName:!1,propertyName:"endCaps",valueCodes:[280],referenceType:0},{name:"$SORTENTS",isName:!1,propertyName:"entitySortingFlags",valueCodes:[280],referenceType:0},{name:"$EXTNAMES",isName:!1,propertyName:"extendedNames",valueCodes:[290],referenceType:0},{name:"$DIMLWE",isName:!1,propertyName:"extensionLineWeight",valueCodes:[70],referenceType:0},{name:"$XCLIPFRAME",isName:!1,propertyName:"externalReferenceClippingBoundaryType",valueCodes:[280],referenceType:0},{name:"$FACETRES",isName:!1,propertyName:"facetResolution",valueCodes:[40],referenceType:0},{name:"$FILLETRAD",isName:!1,propertyName:"filletRadius",valueCodes:[40],referenceType:0},{name:"$FILLMODE",isName:!1,propertyName:"fillMode",valueCodes:[70],referenceType:0},{name:"$FINGERPRINTGUID",isName:!1,propertyName:"fingerPrintGuid",valueCodes:[2],referenceType:0},{name:"$HALOGAP",isName:!1,propertyName:"haloGapPercentage",valueCodes:[280],referenceType:0},{name:"$HANDSEED",isName:!1,propertyName:"handleSeed",valueCodes:[5],referenceType:0},{name:"$HYPERLINKBASE",isName:!1,propertyName:"hyperLinkBase",valueCodes:[1],referenceType:0},{name:"$INDEXCTL",isName:!1,propertyName:"indexCreationFlags",valueCodes:[280],referenceType:0},{name:"$INSUNITS",isName:!1,propertyName:"insUnits",valueCodes:[70],referenceType:0},{name:"$INTERFERECOLOR",isName:!1,propertyName:"interfereColor",valueCodes:[62],referenceType:0},{name:"$JOINSTYLE",isName:!1,propertyName:"joinStyle",valueCodes:[280],referenceType:0},{name:"$LASTSAVEDBY",isName:!1,propertyName:"lastSavedBy",valueCodes:[3],referenceType:16},{name:"$LATITUDE",isName:!1,propertyName:"latitude",valueCodes:[40],referenceType:0},{name:"$LENSLENGTH",isName:!1,propertyName:"lensLength",valueCodes:[40],referenceType:0},{name:"$LIMCHECK",isName:!1,propertyName:"limitCheckingOn",valueCodes:[70],referenceType:0},{name:"$LUNITS",isName:!1,propertyName:"linearUnitFormat",valueCodes:[70],referenceType:0},{name:"$LUPREC",isName:!1,propertyName:"linearUnitPrecision",valueCodes:[70],referenceType:0},{name:"$LTSCALE",isName:!1,propertyName:"lineTypeScale",valueCodes:[40],referenceType:0},{name:"$OLESTARTUP",isName:!1,propertyName:"loadOLEObject",valueCodes:[290],referenceType:0},{name:"$LOFTNORMALS",isName:!1,propertyName:"loftedObjectNormals",valueCodes:[280],referenceType:0},{name:"$LONGITUDE",isName:!1,propertyName:"longitude",valueCodes:[40],referenceType:0},{name:"$ACADMAINTVER",isName:!1,propertyName:"maintenanceVersion",valueCodes:[70],referenceType:16},{name:"$MAXACTVP",isName:!1,propertyName:"maxViewportCount",valueCodes:[70],referenceType:0},{name:"$MEASUREMENT",isName:!1,propertyName:"measurementUnits",valueCodes:[70],referenceType:0},{name:"$MENU",isName:!1,propertyName:"menuFileName",valueCodes:[1],referenceType:0},{name:"$MIRRTEXT",isName:!1,propertyName:"mirrorText",valueCodes:[70],referenceType:0},{name:"$EXTMAX",isName:!1,propertyName:"modelSpaceExtMax",valueCodes:[10,20,30],referenceType:0},{name:"$EXTMIN",isName:!1,propertyName:"modelSpaceExtMin",valueCodes:[10,20,30],referenceType:0},{name:"$INSBASE",isName:!1,propertyName:"modelSpaceInsertionBase",valueCodes:[10,20,30],referenceType:0},{name:"$LIMMAX",isName:!1,propertyName:"modelSpaceLimitsMax",valueCodes:[10,20],referenceType:0},{name:"$LIMMIN",isName:!1,propertyName:"modelSpaceLimitsMin",valueCodes:[10,20],referenceType:0},{name:"$UCSORG",isName:!1,propertyName:"modelSpaceOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGBACK",isName:!1,propertyName:"modelSpaceOrthographicBackDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGBOTTOM",isName:!1,propertyName:"modelSpaceOrthographicBottomDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGFRONT",isName:!1,propertyName:"modelSpaceOrthographicFrontDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGLEFT",isName:!1,propertyName:"modelSpaceOrthographicLeftDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGRIGHT",isName:!1,propertyName:"modelSpaceOrthographicRightDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSORGTOP",isName:!1,propertyName:"modelSpaceOrthographicTopDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$UCSXDIR",isName:!1,propertyName:"modelSpaceXAxis",valueCodes:[10,20,30],referenceType:0},{name:"$UCSYDIR",isName:!1,propertyName:"modelSpaceYAxis",valueCodes:[10,20,30],referenceType:0},{name:"$NORTHDIRECTION",isName:!1,propertyName:"northDirection",valueCodes:[40],referenceType:0},{name:"$SPLINESEGS",isName:!1,propertyName:"numberOfSplineSegments",valueCodes:[70],referenceType:0},{name:"$OSMODE",isName:!1,propertyName:"objectSnapMode",valueCodes:[70],referenceType:0},{name:"$ORTHOMODE",isName:!1,propertyName:"orthoMode",valueCodes:[70],referenceType:0},{name:"$PUCSBASE",isName:!0,propertyName:"paperSpaceBaseName",valueCodes:[2],referenceType:0},{name:"$PELEVATION",isName:!1,propertyName:"paperSpaceElevation",valueCodes:[40],referenceType:0},{name:"$PEXTMAX",isName:!1,propertyName:"paperSpaceExtMax",valueCodes:[10,20,30],referenceType:0},{name:"$PEXTMIN",isName:!1,propertyName:"paperSpaceExtMin",valueCodes:[10,20,30],referenceType:0},{name:"$PINSBASE",isName:!1,propertyName:"paperSpaceInsertionBase",valueCodes:[10,20,30],referenceType:0},{name:"$PLIMCHECK",isName:!1,propertyName:"paperSpaceLimitsChecking",valueCodes:[70],referenceType:0},{name:"$PLIMMAX",isName:!1,propertyName:"paperSpaceLimitsMax",valueCodes:[10,20],referenceType:0},{name:"$PLIMMIN",isName:!1,propertyName:"paperSpaceLimitsMin",valueCodes:[10,20],referenceType:0},{name:"$PSLTSCALE",isName:!1,propertyName:"paperSpaceLineTypeScaling",valueCodes:[70],referenceType:0},{name:"$PUCSNAME",isName:!0,propertyName:"paperSpaceName",valueCodes:[2],referenceType:0},{name:"$PUCSORGBACK",isName:!1,propertyName:"paperSpaceOrthographicBackDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PUCSORGBOTTOM",isName:!1,propertyName:"paperSpaceOrthographicBottomDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PUCSORGFRONT",isName:!1,propertyName:"paperSpaceOrthographicFrontDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PUCSORGLEFT",isName:!1,propertyName:"paperSpaceOrthographicLeftDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PUCSORGRIGHT",isName:!1,propertyName:"paperSpaceOrthographicRightDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PUCSORGTOP",isName:!1,propertyName:"paperSpaceOrthographicTopDOrigin",valueCodes:[10,20,30],referenceType:0},{name:"$PSTYLEMODE",isName:!1,propertyName:"plotStyleMode",valueCodes:[290],referenceType:0},{name:"$PDMODE",isName:!1,propertyName:"pointDisplayMode",valueCodes:[70],referenceType:0},{name:"$PDSIZE",isName:!1,propertyName:"pointDisplaySize",valueCodes:[40],referenceType:0},{name:"$PLINEGEN",isName:!1,propertyName:"polylineLineTypeGeneration",valueCodes:[70],referenceType:0},{name:"$PLINEWID",isName:!1,propertyName:"polylineWidthDefault",valueCodes:[40],referenceType:0},{name:"$PROJECTNAME",isName:!1,propertyName:"projectName",valueCodes:[1],referenceType:0},{name:"$PROXYGRAPHICS",isName:!1,propertyName:"proxyGraphics",valueCodes:[70],referenceType:0},{name:"$QTEXTMODE",isName:!1,propertyName:"quickTextMode",valueCodes:[70],referenceType:0},{name:"$REGENMODE",isName:!1,propertyName:"regenerationMode",valueCodes:[70],referenceType:0},{name:"$REQUIREDVERSIONS",isName:!1,propertyName:"requiredVersions",valueCodes:[70],referenceType:16},{name:"$VISRETAIN",isName:!1,propertyName:"retainXRefDependentVisibilitySettings",valueCodes:[70],referenceType:0},{name:"$SHADEDIF",isName:!1,propertyName:"shadeDiffuseToAmbientPercentage",valueCodes:[70],referenceType:0},{name:"$SHADEDGE",isName:!1,propertyName:"shadeEdge",valueCodes:[70],referenceType:0},{name:"$CSHADOW",isName:!1,propertyName:"shadowMode",valueCodes:[280],referenceType:0},{name:"$SHADOWPLANELOCATION",isName:!1,propertyName:"shadowPlaneLocation",valueCodes:[40],referenceType:0},{name:"$TILEMODE",isName:!1,propertyName:"showModelSpace",valueCodes:[70],referenceType:0},{name:"$SHOWHIST",isName:!1,propertyName:"showSolidsHistory",valueCodes:[280],referenceType:0},{name:"$SPLFRAME",isName:!1,propertyName:"showSplineControlPoints",valueCodes:[70],referenceType:0},{name:"$SKETCHINC",isName:!1,propertyName:"sketchIncrement",valueCodes:[40],referenceType:0},{name:"$LOFTPARAM",isName:!1,propertyName:"solidLoftedShape",valueCodes:[70],referenceType:0},{name:"$SOLIDHIST",isName:!1,propertyName:"solidsRetainHistory",valueCodes:[280],referenceType:0},{name:"$TREEDEPTH",isName:!1,propertyName:"spatialIndexMaxTreeDepth",valueCodes:[70],referenceType:0},{name:"$SPLINETYPE",isName:!1,propertyName:"splineType",valueCodes:[70],referenceType:0},{name:"$STEPSIZE",isName:!1,propertyName:"stepSize",valueCodes:[40],referenceType:0},{name:"$STEPSPERSEC",isName:!1,propertyName:"stepsPerSecond",valueCodes:[40],referenceType:0},{name:"$STYLESHEET",isName:!1,propertyName:"styleSheetName",valueCodes:[1],referenceType:0},{name:"$SURFTYPE",isName:!1,propertyName:"surfaceType",valueCodes:[70],referenceType:0},{name:"$PSOLHEIGHT",isName:!1,propertyName:"sweptSolidHeight",valueCodes:[40],referenceType:0},{name:"$PSOLWIDTH",isName:!1,propertyName:"sweptSolidWidth",valueCodes:[40],referenceType:0},{name:"$TEXTSIZE",isName:!1,propertyName:"textHeightDefault",valueCodes:[40],referenceType:0},{name:"$TEXTSTYLE",isName:!0,propertyName:"currentTextStyleName",valueCodes:[7],referenceType:0},{name:"$THICKNESS",isName:!1,propertyName:"thicknessDefault",valueCodes:[40],referenceType:0},{name:"$TIMEZONE",isName:!1,propertyName:"timeZone",valueCodes:[70],referenceType:0},{name:"$TDINDWG",isName:!1,propertyName:"totalEditingTime",valueCodes:[40],referenceType:0,valueKind:"timespan"},{name:"$TRACEWID",isName:!1,propertyName:"traceWidthDefault",valueCodes:[40],referenceType:0},{name:"$UCSBASE",isName:!0,propertyName:"ucsBaseName",valueCodes:[2],referenceType:0},{name:"$UCSNAME",isName:!0,propertyName:"ucsName",valueCodes:[2],referenceType:0},{name:"$UNITMODE",isName:!1,propertyName:"unitMode",valueCodes:[70],referenceType:0},{name:"$TDUCREATE",isName:!1,propertyName:"universalCreateDateTime",valueCodes:[40],referenceType:0,valueKind:"date"},{name:"$TDUUPDATE",isName:!1,propertyName:"universalUpdateDateTime",valueCodes:[40],referenceType:0,valueKind:"date"},{name:"$TDUPDATE",isName:!1,propertyName:"updateDateTime",valueCodes:[40],referenceType:0,valueKind:"date"},{name:"$DIMSHO",isName:!1,propertyName:"updateDimensionsWhileDragging",valueCodes:[70],referenceType:0},{name:"$USERR1",isName:!1,propertyName:"userDouble1",valueCodes:[40],referenceType:0},{name:"$USERR2",isName:!1,propertyName:"userDouble2",valueCodes:[40],referenceType:0},{name:"$USERR3",isName:!1,propertyName:"userDouble3",valueCodes:[40],referenceType:0},{name:"$USERR4",isName:!1,propertyName:"userDouble4",valueCodes:[40],referenceType:0},{name:"$USERR5",isName:!1,propertyName:"userDouble5",valueCodes:[40],referenceType:0},{name:"$TDUSRTIMER",isName:!1,propertyName:"userElapsedTimeSpan",valueCodes:[40],referenceType:0,valueKind:"timespan"},{name:"$USERI1",isName:!1,propertyName:"userShort1",valueCodes:[70],referenceType:0},{name:"$USERI2",isName:!1,propertyName:"userShort2",valueCodes:[70],referenceType:0},{name:"$USERI3",isName:!1,propertyName:"userShort3",valueCodes:[70],referenceType:0},{name:"$USERI4",isName:!1,propertyName:"userShort4",valueCodes:[70],referenceType:0},{name:"$USERI5",isName:!1,propertyName:"userShort5",valueCodes:[70],referenceType:0},{name:"$USRTIMER",isName:!1,propertyName:"userTimer",valueCodes:[70],referenceType:0},{name:"$VERSIONGUID",isName:!1,propertyName:"versionGuid",valueCodes:[2],referenceType:0},{name:"$ACADVER",isName:!1,propertyName:"versionString",valueCodes:[1],referenceType:0},{name:"$PSVPSCALE",isName:!1,propertyName:"viewportDefaultViewScaleFactor",valueCodes:[40],referenceType:0},{name:"$WORLDVIEW",isName:!1,propertyName:"worldView",valueCodes:[70],referenceType:0},{name:"$XEDIT",isName:!1,propertyName:"xEdit",valueCodes:[290],referenceType:0}]},{typeName:"CadObject",baseTypeName:"IHandledCadObject",properties:[{propertyName:"handle",valueCodes:[5],referenceType:0},{propertyName:"owner",valueCodes:[330],referenceType:1}],systemVariables:[]},{typeName:"CadValue",properties:[{propertyName:"flags",valueCodes:[93],referenceType:0},{propertyName:"format",valueCodes:[300],referenceType:0},{propertyName:"formattedValue",valueCodes:[302],referenceType:0},{propertyName:"units",valueCodes:[94],referenceType:0},{propertyName:"valueType",valueCodes:[90],referenceType:0}],systemVariables:[]},{typeName:"DxfClass",properties:[{propertyName:"applicationName",valueCodes:[3],referenceType:0},{propertyName:"cppClassName",valueCodes:[2],referenceType:0},{propertyName:"dxfName",valueCodes:[1],referenceType:0},{propertyName:"instanceCount",valueCodes:[91],referenceType:0},{propertyName:"isAnEntity",valueCodes:[281],referenceType:0},{propertyName:"proxyFlags",valueCodes:[90],referenceType:0},{propertyName:"wasZombie",valueCodes:[280],referenceType:0}],systemVariables:[]}];var zh=[{typeName:"Arc",baseTypeName:"Circle",properties:[{propertyName:"endAngle",valueCodes:[51],referenceType:32},{propertyName:"startAngle",valueCodes:[50],referenceType:32}],systemVariables:[],dxfName:"ARC",dxfSubClassName:"AcDbArc"},{typeName:"AttributeBase",baseTypeName:"TextEntity",properties:[{propertyName:"attributeType",valueCodes:[71],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"tag",valueCodes:[2],referenceType:0},{propertyName:"version",valueCodes:[280],referenceType:0},{propertyName:"verticalAlignment",valueCodes:[74],referenceType:0}],systemVariables:[],dxfSubClassIsEmpty:!0},{typeName:"AttributeDefinition",baseTypeName:"AttributeBase",properties:[{propertyName:"prompt",valueCodes:[3],referenceType:0}],systemVariables:[],dxfName:"ATTDEF",dxfSubClassName:"AcDbAttributeDefinition"},{typeName:"AttributeEntity",baseTypeName:"AttributeBase",properties:[],systemVariables:[],dxfName:"ATTRIB",dxfSubClassName:"AcDbAttribute"},{typeName:"CadBody",baseTypeName:"ModelerGeometry",properties:[],systemVariables:[],dxfName:"BODY"},{typeName:"CadWipeoutBase",baseTypeName:"Entity",properties:[{propertyName:"brightness",valueCodes:[281],referenceType:0},{propertyName:"classVersion",valueCodes:[90],referenceType:0},{propertyName:"clipBoundaryVertices",valueCodes:[91],referenceType:4,collectionCodes:[14,24]},{propertyName:"clipMode",valueCodes:[290],referenceType:0},{propertyName:"clippingState",valueCodes:[280],referenceType:0},{propertyName:"clipType",valueCodes:[71],referenceType:0},{propertyName:"contrast",valueCodes:[282],referenceType:0},{propertyName:"definition",valueCodes:[340],referenceType:1},{propertyName:"fade",valueCodes:[283],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"size",valueCodes:[13,23],referenceType:0},{propertyName:"uVector",valueCodes:[11,21,31],referenceType:0},{propertyName:"vVector",valueCodes:[12,22,32],referenceType:0}],systemVariables:[],dxfSubClassIsEmpty:!0},{typeName:"Circle",baseTypeName:"Entity",properties:[{propertyName:"center",valueCodes:[10,20,30],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"radius",valueCodes:[40],referenceType:0},{propertyName:"thickness",valueCodes:[39],referenceType:0}],systemVariables:[],dxfName:"CIRCLE",dxfSubClassName:"AcDbCircle"},{typeName:"Dimension",baseTypeName:"Entity",properties:[{propertyName:"attachmentPoint",valueCodes:[71],referenceType:0},{propertyName:"block",valueCodes:[2],referenceType:2},{propertyName:"definitionPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"flipArrow1",valueCodes:[74],referenceType:0},{propertyName:"flipArrow2",valueCodes:[75],referenceType:0},{propertyName:"horizontalDirection",valueCodes:[51],referenceType:8},{propertyName:"insertionPoint",valueCodes:[12,22,32],referenceType:0},{propertyName:"lineSpacingFactor",valueCodes:[41],referenceType:8},{propertyName:"lineSpacingStyle",valueCodes:[72],referenceType:8},{propertyName:"measurement",valueCodes:[42],referenceType:8},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"style",valueCodes:[3],referenceType:2},{propertyName:"text",valueCodes:[1],referenceType:8},{propertyName:"textMiddlePoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"textRotation",valueCodes:[53],referenceType:8},{propertyName:"version",valueCodes:[280],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbDimension"},{typeName:"DimensionAligned",baseTypeName:"Dimension",properties:[{propertyName:"extLineRotation",valueCodes:[52],referenceType:8},{propertyName:"firstPoint",valueCodes:[13,23,33],referenceType:0},{propertyName:"secondPoint",valueCodes:[14,24,34],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbAlignedDimension"},{typeName:"DimensionAngular2Line",baseTypeName:"Dimension",properties:[{propertyName:"angleVertex",valueCodes:[15,25,35],referenceType:0},{propertyName:"dimensionArc",valueCodes:[16,26,36],referenceType:0},{propertyName:"firstPoint",valueCodes:[13,23,33],referenceType:0},{propertyName:"secondPoint",valueCodes:[14,24,34],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDb2LineAngularDimension"},{typeName:"DimensionAngular3Pt",baseTypeName:"Dimension",properties:[{propertyName:"angleVertex",valueCodes:[15,25,35],referenceType:0},{propertyName:"firstPoint",valueCodes:[13,23,33],referenceType:0},{propertyName:"secondPoint",valueCodes:[14,24,34],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDb3PointAngularDimension"},{typeName:"DimensionDiameter",baseTypeName:"Dimension",properties:[{propertyName:"angleVertex",valueCodes:[15,25,35],referenceType:0},{propertyName:"leaderLength",valueCodes:[40],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbDiametricDimension"},{typeName:"DimensionLinear",baseTypeName:"DimensionAligned",properties:[{propertyName:"rotation",valueCodes:[50],referenceType:32}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbRotatedDimension"},{typeName:"DimensionOrdinate",baseTypeName:"Dimension",properties:[{propertyName:"featureLocation",valueCodes:[13,23,33],referenceType:0},{propertyName:"leaderEndpoint",valueCodes:[14,24,34],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbOrdinateDimension"},{typeName:"DimensionRadius",baseTypeName:"Dimension",properties:[{propertyName:"angleVertex",valueCodes:[15,25,35],referenceType:0},{propertyName:"leaderLength",valueCodes:[40],referenceType:0}],systemVariables:[],dxfName:"DIMENSION",dxfSubClassName:"AcDbRadialDimension"},{typeName:"Ellipse",baseTypeName:"Entity",properties:[{propertyName:"center",valueCodes:[10,20,30],referenceType:0},{propertyName:"endParameter",valueCodes:[42],referenceType:0},{propertyName:"majorAxisEndPoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"radiusRatio",valueCodes:[40],referenceType:0},{propertyName:"startParameter",valueCodes:[41],referenceType:0},{propertyName:"thickness",valueCodes:[39],referenceType:0}],systemVariables:[],dxfName:"ELLIPSE",dxfSubClassName:"AcDbEllipse"},{typeName:"Entity",baseTypeName:"CadObject",properties:[{propertyName:"bookColor",valueCodes:[430],referenceType:2},{propertyName:"color",valueCodes:[62,420],referenceType:0},{propertyName:"isInvisible",valueCodes:[60],referenceType:0},{propertyName:"layer",valueCodes:[8],referenceType:2},{propertyName:"lineType",valueCodes:[6],referenceType:2},{propertyName:"lineTypeScale",valueCodes:[48],referenceType:0},{propertyName:"lineWeight",valueCodes:[370],referenceType:0},{propertyName:"material",valueCodes:[347],referenceType:1},{propertyName:"transparency",valueCodes:[440],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbEntity"},{typeName:"Face3D",baseTypeName:"Entity",properties:[{propertyName:"firstCorner",valueCodes:[10,20,30],referenceType:0},{propertyName:"secondCorner",valueCodes:[11,21,31],referenceType:0},{propertyName:"thirdCorner",valueCodes:[12,22,32],referenceType:0},{propertyName:"fourthCorner",valueCodes:[13,23,33],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0}],systemVariables:[],dxfName:"3DFACE",dxfSubClassName:"AcDbFace"},{typeName:"GradientColor",properties:[{propertyName:"value",valueCodes:[463],referenceType:0},{propertyName:"color",valueCodes:[421],referenceType:0}],systemVariables:[]},{typeName:"Hatch",baseTypeName:"Entity",properties:[{propertyName:"elevation",valueCodes:[30],referenceType:0},{propertyName:"gradientColor",valueCodes:[470],referenceType:2},{propertyName:"isAssociative",valueCodes:[71],referenceType:0},{propertyName:"isDouble",valueCodes:[77],referenceType:0},{propertyName:"isSolid",valueCodes:[70],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"paths",valueCodes:[91],referenceType:4},{propertyName:"pattern",valueCodes:[2],referenceType:2},{propertyName:"patternAngle",valueCodes:[52],referenceType:32},{propertyName:"patternScale",valueCodes:[41],referenceType:0},{propertyName:"patternType",valueCodes:[76],referenceType:0},{propertyName:"pixelSize",valueCodes:[47],referenceType:0},{propertyName:"seedPoints",valueCodes:[98],referenceType:4,collectionCodes:[10,20]},{propertyName:"style",valueCodes:[75],referenceType:0}],systemVariables:[],dxfName:"HATCH",dxfSubClassName:"AcDbHatch"},{typeName:"HatchGradientPattern",properties:[{propertyName:"enabled",valueCodes:[450],referenceType:0},{propertyName:"angle",valueCodes:[460],referenceType:0},{propertyName:"shift",valueCodes:[461],referenceType:0},{propertyName:"isSingleColorGradient",valueCodes:[452],referenceType:0},{propertyName:"colorTint",valueCodes:[462],referenceType:0},{propertyName:"colors",valueCodes:[453],referenceType:0},{propertyName:"name",valueCodes:[470],referenceType:0}],systemVariables:[]},{typeName:"HatchPattern",properties:[{propertyName:"lines",valueCodes:[79],referenceType:4},{propertyName:"name",valueCodes:[2],referenceType:0}],systemVariables:[]},{typeName:"Insert",baseTypeName:"Entity",properties:[{propertyName:"block",valueCodes:[2],referenceType:2},{propertyName:"columnCount",valueCodes:[70],referenceType:8},{propertyName:"columnSpacing",valueCodes:[44],referenceType:8},{propertyName:"hasAttributes",valueCodes:[66],referenceType:16},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"rowCount",valueCodes:[71],referenceType:8},{propertyName:"rowSpacing",valueCodes:[45],referenceType:8},{propertyName:"xScale",valueCodes:[41],referenceType:0},{propertyName:"yScale",valueCodes:[42],referenceType:0},{propertyName:"zScale",valueCodes:[43],referenceType:0}],systemVariables:[],dxfName:"INSERT",dxfSubClassName:"AcDbBlockReference"},{typeName:"Leader",baseTypeName:"Entity",properties:[{propertyName:"annotationOffset",valueCodes:[213,223,233],referenceType:0},{propertyName:"arrowHeadEnabled",valueCodes:[71],referenceType:0},{propertyName:"associatedAnnotation",valueCodes:[340],referenceType:1},{propertyName:"blockOffset",valueCodes:[212,222,232],referenceType:0},{propertyName:"creationType",valueCodes:[73],referenceType:0},{propertyName:"hasHookline",valueCodes:[75],referenceType:0},{propertyName:"hookLineDirection",valueCodes:[74],referenceType:0},{propertyName:"horizontalDirection",valueCodes:[211,221,231],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"pathType",valueCodes:[72],referenceType:0},{propertyName:"style",valueCodes:[3],referenceType:2},{propertyName:"textHeight",valueCodes:[40],referenceType:0},{propertyName:"textWidth",valueCodes:[41],referenceType:0},{propertyName:"vertices",valueCodes:[76],referenceType:4,collectionCodes:[10,20,30]}],systemVariables:[],dxfName:"LEADER",dxfSubClassName:"AcDbLeader"},{typeName:"Line",baseTypeName:"Entity",properties:[{propertyName:"endPoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"startPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"thickness",valueCodes:[39],referenceType:0}],systemVariables:[],dxfName:"LINE",dxfSubClassName:"AcDbLine"},{typeName:"Mesh",baseTypeName:"Entity",properties:[{propertyName:"blendCrease",valueCodes:[72],referenceType:0},{propertyName:"edges",valueCodes:[94],referenceType:4,collectionCodes:[90]},{propertyName:"faces",valueCodes:[93],referenceType:4,collectionCodes:[90]},{propertyName:"subdivisionLevel",valueCodes:[91],referenceType:0},{propertyName:"version",valueCodes:[71],referenceType:0},{propertyName:"vertices",valueCodes:[92],referenceType:4,collectionCodes:[10,20,30]}],systemVariables:[],dxfName:"MESH",dxfSubClassName:"AcDbSubDMesh"},{typeName:"MLine",baseTypeName:"Entity",properties:[{propertyName:"flags",valueCodes:[71],referenceType:0},{propertyName:"justification",valueCodes:[70],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"scaleFactor",valueCodes:[40],referenceType:0},{propertyName:"startPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"style",valueCodes:[340],referenceType:1},{propertyName:"vertices",valueCodes:[72],referenceType:4}],systemVariables:[],dxfName:"MLINE",dxfSubClassName:"AcDbMline"},{typeName:"MText",baseTypeName:"Entity",properties:[{propertyName:"alignmentPoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"attachmentPoint",valueCodes:[71],referenceType:0},{propertyName:"backgroundColor",valueCodes:[63,421,430],referenceType:0},{propertyName:"backgroundFillFlags",valueCodes:[90],referenceType:0},{propertyName:"backgroundScale",valueCodes:[45],referenceType:0},{propertyName:"backgroundTransparency",valueCodes:[441],referenceType:0},{propertyName:"drawingDirection",valueCodes:[72],referenceType:0},{propertyName:"height",valueCodes:[40],referenceType:0},{propertyName:"horizontalWidth",valueCodes:[42],referenceType:16},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"lineSpacing",valueCodes:[44],referenceType:0},{propertyName:"lineSpacingStyle",valueCodes:[73],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"rectangleHeight",valueCodes:[46],referenceType:0},{propertyName:"rectangleWidth",valueCodes:[41],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"style",valueCodes:[7],referenceType:2},{propertyName:"value",valueCodes:[1],referenceType:0},{propertyName:"verticalHeight",valueCodes:[43],referenceType:16}],systemVariables:[],dxfName:"MTEXT",dxfSubClassName:"AcDbMText"},{typeName:"MultiLeader",baseTypeName:"Entity",properties:[{propertyName:"arrowhead",valueCodes:[342],referenceType:1},{propertyName:"arrowheadSize",valueCodes:[42],referenceType:0},{propertyName:"contentType",valueCodes:[172],referenceType:0},{propertyName:"enableAnnotationScale",valueCodes:[293],referenceType:0},{propertyName:"enableDogleg",valueCodes:[291],referenceType:0},{propertyName:"enableLanding",valueCodes:[290],referenceType:0},{propertyName:"extendedToText",valueCodes:[295],referenceType:0},{propertyName:"landingDistance",valueCodes:[41],referenceType:0},{propertyName:"leaderLineType",valueCodes:[341],referenceType:1},{propertyName:"leaderLineWeight",valueCodes:[171],referenceType:0},{propertyName:"lineColor",valueCodes:[91],referenceType:0},{propertyName:"pathType",valueCodes:[170],referenceType:0},{propertyName:"propertyOverrideFlags",valueCodes:[90],referenceType:0},{propertyName:"scaleFactor",valueCodes:[45],referenceType:0},{propertyName:"style",valueCodes:[340],referenceType:1},{propertyName:"textAligninIPE",valueCodes:[178],referenceType:0},{propertyName:"textAttachmentDirection",valueCodes:[271],referenceType:0},{propertyName:"textAttachmentPoint",valueCodes:[179],referenceType:0},{propertyName:"textBottomAttachment",valueCodes:[272],referenceType:0},{propertyName:"textDirectionNegative",valueCodes:[294],referenceType:0},{propertyName:"textTopAttachment",valueCodes:[273],referenceType:0},{propertyName:"textAlignment",valueCodes:[175],referenceType:0},{propertyName:"textAngle",valueCodes:[174],referenceType:0},{propertyName:"textColor",valueCodes:[92],referenceType:0},{propertyName:"textFrame",valueCodes:[292],referenceType:0},{propertyName:"textLeftAttachment",valueCodes:[173],referenceType:0},{propertyName:"textRightAttachment",valueCodes:[95],referenceType:0},{propertyName:"textStyle",valueCodes:[343],referenceType:1},{propertyName:"blockContentColor",valueCodes:[93],referenceType:0},{propertyName:"blockContentConnection",valueCodes:[176],referenceType:0},{propertyName:"blockContentRotation",valueCodes:[43],referenceType:32},{propertyName:"blockContentScale",valueCodes:[10,20,30],referenceType:0}],systemVariables:[],dxfName:"MULTILEADER",dxfSubClassName:"AcDbMLeader"},{typeName:"Ole2Frame",baseTypeName:"Entity",properties:[{propertyName:"binaryData",valueCodes:[310],referenceType:0},{propertyName:"isPaperSpace",valueCodes:[72],referenceType:0},{propertyName:"lowerRightCorner",valueCodes:[11,21,31],referenceType:0},{propertyName:"oleObjectType",valueCodes:[71],referenceType:0},{propertyName:"sourceApplication",valueCodes:[3],referenceType:0},{propertyName:"upperLeftCorner",valueCodes:[10,20,30],referenceType:0},{propertyName:"version",valueCodes:[70],referenceType:0}],systemVariables:[],dxfName:"OLE2FRAME",dxfSubClassName:"AcDbOle2Frame"},{typeName:"PdfUnderlay",baseTypeName:"UnderlayEntity",properties:[],systemVariables:[],dxfName:"PDFUNDERLAY",dxfSubClassName:"AcDbUnderlayReference"},{typeName:"Point",baseTypeName:"Entity",properties:[{propertyName:"location",valueCodes:[10,20,30],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"thickness",valueCodes:[39],referenceType:0}],systemVariables:[],dxfName:"POINT",dxfSubClassName:"AcDbPoint"},{typeName:"PolyfaceMesh",baseTypeName:"Polyline",properties:[{propertyName:"faces",valueCodes:[72],referenceType:4}],systemVariables:[],dxfName:"POLYLINE",dxfSubClassName:"AcDbPolyFaceMesh"},{typeName:"PolygonMesh",baseTypeName:"Polyline",properties:[{propertyName:"mSmoothSurfaceDensity",valueCodes:[73],referenceType:8},{propertyName:"mVertexCount",valueCodes:[71],referenceType:8},{propertyName:"nSmoothSurfaceDensity",valueCodes:[74],referenceType:8},{propertyName:"nVertexCount",valueCodes:[72],referenceType:8}],systemVariables:[],dxfName:"POLYLINE",dxfSubClassName:"AcDbPolygonMesh"},{typeName:"PolygonMeshVertex",baseTypeName:"Vertex",properties:[],systemVariables:[],dxfName:"VERTEX",dxfSubClassName:"AcDbPolygonMeshVertex"},{typeName:"ProxyEntity",baseTypeName:"Entity",properties:[{propertyName:"classId",valueCodes:[91],referenceType:0},{propertyName:"drawingFormat",valueCodes:[95],referenceType:0},{propertyName:"originalDataFormatDxf",valueCodes:[70],referenceType:0},{propertyName:"proxyClassId",valueCodes:[90],referenceType:0}],systemVariables:[],dxfName:"ACAD_PROXY_ENTITY",dxfSubClassName:"AcDbProxyEntity"},{typeName:"RasterImage",baseTypeName:"CadWipeoutBase",properties:[],systemVariables:[],dxfName:"IMAGE",dxfSubClassName:"AcDbRasterImage"},{typeName:"Ray",baseTypeName:"Entity",properties:[{propertyName:"direction",valueCodes:[11,21,31],referenceType:0},{propertyName:"startPoint",valueCodes:[10,20,30],referenceType:0}],systemVariables:[],dxfName:"RAY",dxfSubClassName:"AcDbRay"},{typeName:"Region",baseTypeName:"ModelerGeometry",properties:[],systemVariables:[],dxfName:"REGION"},{typeName:"Seqend",baseTypeName:"Entity",properties:[],systemVariables:[],dxfName:"SEQEND"},{typeName:"Shape",baseTypeName:"Entity",properties:[{propertyName:"thickness",valueCodes:[39],referenceType:0},{propertyName:"insertionPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"size",valueCodes:[40],referenceType:0},{propertyName:"shapeStyle",valueCodes:[2],referenceType:2},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"relativeXScale",valueCodes:[41],referenceType:0},{propertyName:"obliqueAngle",valueCodes:[51],referenceType:32},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0}],systemVariables:[],dxfName:"SHAPE",dxfSubClassName:"AcDbShape"},{typeName:"Solid",baseTypeName:"Entity",properties:[{propertyName:"firstCorner",valueCodes:[10,20,30],referenceType:0},{propertyName:"fourthCorner",valueCodes:[13,23,33],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"secondCorner",valueCodes:[11,21,31],referenceType:0},{propertyName:"thickness",valueCodes:[39],referenceType:0},{propertyName:"thirdCorner",valueCodes:[12,22,32],referenceType:0}],systemVariables:[],dxfName:"SOLID",dxfSubClassName:"AcDbTrace"},{typeName:"Solid3D",baseTypeName:"ModelerGeometry",properties:[],systemVariables:[],dxfName:"3DSOLID",dxfSubClassName:"AcDb3dSolid"},{typeName:"Spline",baseTypeName:"Entity",properties:[{propertyName:"controlPoints",valueCodes:[73],referenceType:4,collectionCodes:[10,20,30]},{propertyName:"controlPointTolerance",valueCodes:[43],referenceType:0},{propertyName:"degree",valueCodes:[71],referenceType:0},{propertyName:"endTangent",valueCodes:[13,23,33],referenceType:0},{propertyName:"fitPoints",valueCodes:[74],referenceType:4,collectionCodes:[11,21,31]},{propertyName:"fitTolerance",valueCodes:[44],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"knots",valueCodes:[72],referenceType:4,collectionCodes:[40]},{propertyName:"knotTolerance",valueCodes:[42],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"startTangent",valueCodes:[12,22,32],referenceType:0},{propertyName:"weights",valueCodes:[41],referenceType:4}],systemVariables:[],dxfName:"SPLINE",dxfSubClassName:"AcDbSpline"},{typeName:"TableContent",baseTypeName:"FormattedTableData",properties:[{propertyName:"style",valueCodes:[340],referenceType:1}],systemVariables:[],dxfName:"TABLECONTENT",dxfSubClassName:"AcDbTableContent"},{typeName:"TableEntity",baseTypeName:"Insert",properties:[{propertyName:"columns",valueCodes:[92],referenceType:4},{propertyName:"horizontalDirection",valueCodes:[11,21,31],referenceType:0},{propertyName:"overrideBorderColor",valueCodes:[94],referenceType:0},{propertyName:"overrideBorderLineWeight",valueCodes:[95],referenceType:0},{propertyName:"overrideBorderVisibility",valueCodes:[96],referenceType:0},{propertyName:"overrideFlag",valueCodes:[93],referenceType:0},{propertyName:"rows",valueCodes:[91],referenceType:4},{propertyName:"style",valueCodes:[342],referenceType:1},{propertyName:"valueFlag",valueCodes:[90],referenceType:0},{propertyName:"version",valueCodes:[280],referenceType:0}],systemVariables:[],dxfName:"ACAD_TABLE",dxfSubClassName:"AcDbTable"},{typeName:"TextEntity",baseTypeName:"Entity",properties:[{propertyName:"alignmentPoint",valueCodes:[11,21,31],referenceType:8},{propertyName:"height",valueCodes:[40],referenceType:0},{propertyName:"horizontalAlignment",valueCodes:[72],referenceType:0},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"mirror",valueCodes:[71],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"obliqueAngle",valueCodes:[51],referenceType:32},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"style",valueCodes:[7],referenceType:2},{propertyName:"thickness",valueCodes:[39],referenceType:0},{propertyName:"value",valueCodes:[1],referenceType:0},{propertyName:"verticalAlignment",valueCodes:[73],referenceType:8},{propertyName:"widthFactor",valueCodes:[41],referenceType:8}],systemVariables:[],dxfName:"TEXT",dxfSubClassName:"AcDbText"},{typeName:"Tolerance",baseTypeName:"Entity",properties:[{propertyName:"direction",valueCodes:[11,21,31],referenceType:0},{propertyName:"insertionPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"style",valueCodes:[3],referenceType:2},{propertyName:"text",valueCodes:[1],referenceType:0}],systemVariables:[],dxfName:"TOLERANCE",dxfSubClassName:"AcDbFcf"},{typeName:"UnderlayEntity",baseTypeName:"Entity",properties:[{propertyName:"contrast",valueCodes:[281],referenceType:0},{propertyName:"definition",valueCodes:[340],referenceType:1},{propertyName:"fade",valueCodes:[282],referenceType:0},{propertyName:"flags",valueCodes:[280],referenceType:0},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"xScale",valueCodes:[41],referenceType:0},{propertyName:"yScale",valueCodes:[42],referenceType:0},{propertyName:"zScale",valueCodes:[43],referenceType:0}],systemVariables:[],dxfSubClassIsEmpty:!0},{typeName:"Vertex",baseTypeName:"Entity",properties:[{propertyName:"bulge",valueCodes:[42],referenceType:8},{propertyName:"curveTangent",valueCodes:[50],referenceType:32},{propertyName:"endWidth",valueCodes:[41],referenceType:8},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"location",valueCodes:[10,20,30],referenceType:0},{propertyName:"startWidth",valueCodes:[40],referenceType:8}],systemVariables:[],dxfSubClassName:"AcDbVertex",dxfSubClassIsEmpty:!0},{typeName:"Vertex2D",baseTypeName:"Vertex",properties:[],systemVariables:[],dxfName:"VERTEX",dxfSubClassName:"AcDb2dVertex"},{typeName:"Vertex3D",baseTypeName:"Vertex",properties:[],systemVariables:[],dxfName:"VERTEX",dxfSubClassName:"AcDb3dPolylineVertex"},{typeName:"VertexFaceMesh",baseTypeName:"Vertex",properties:[],systemVariables:[],dxfName:"VERTEX",dxfSubClassName:"AcDbPolyFaceMeshVertex"},{typeName:"VertexFaceRecord",baseTypeName:"Vertex",properties:[{propertyName:"index1",valueCodes:[71],referenceType:0},{propertyName:"index2",valueCodes:[72],referenceType:0},{propertyName:"index3",valueCodes:[73],referenceType:0},{propertyName:"index4",valueCodes:[74],referenceType:0}],systemVariables:[],dxfName:"VERTEX",dxfSubClassName:"AcDbFaceRecord"},{typeName:"Viewport",baseTypeName:"Entity",properties:[{propertyName:"ambientLightColor",valueCodes:[63,421,431],referenceType:0},{propertyName:"backClipPlane",valueCodes:[44],referenceType:0},{propertyName:"boundary",valueCodes:[340],referenceType:1},{propertyName:"brightness",valueCodes:[141],referenceType:0},{propertyName:"center",valueCodes:[10,20,30],referenceType:0},{propertyName:"circleZoomPercent",valueCodes:[72],referenceType:0},{propertyName:"contrast",valueCodes:[142],referenceType:0},{propertyName:"defaultLightingType",valueCodes:[282],referenceType:0},{propertyName:"displayUcsIcon",valueCodes:[74],referenceType:0},{propertyName:"elevation",valueCodes:[146],referenceType:0},{propertyName:"frontClipPlane",valueCodes:[43],referenceType:0},{propertyName:"gridSpacing",valueCodes:[15,25],referenceType:0},{propertyName:"height",valueCodes:[41],referenceType:0},{propertyName:"id",valueCodes:[69],referenceType:0},{propertyName:"lensLength",valueCodes:[42],referenceType:0},{propertyName:"majorGridLineFrequency",valueCodes:[61],referenceType:0},{propertyName:"renderMode",valueCodes:[281],referenceType:0},{propertyName:"shadePlotMode",valueCodes:[170],referenceType:0},{propertyName:"snapAngle",valueCodes:[50],referenceType:32},{propertyName:"snapBase",valueCodes:[13,23],referenceType:0},{propertyName:"snapSpacing",valueCodes:[14,24],referenceType:0},{propertyName:"status",valueCodes:[90],referenceType:0},{propertyName:"styleSheetName",valueCodes:[1],referenceType:0},{propertyName:"twistAngle",valueCodes:[51],referenceType:32},{propertyName:"ucsOrigin",valueCodes:[110,120,130],referenceType:0},{propertyName:"ucsOrthographicType",valueCodes:[79],referenceType:0},{propertyName:"ucsPerViewport",valueCodes:[71],referenceType:0},{propertyName:"ucsXAxis",valueCodes:[111,121,131],referenceType:0},{propertyName:"ucsYAxis",valueCodes:[112,122,132],referenceType:0},{propertyName:"useDefaultLighting",valueCodes:[292],referenceType:0},{propertyName:"viewCenter",valueCodes:[12,22],referenceType:0},{propertyName:"viewDirection",valueCodes:[16,26,36],referenceType:0},{propertyName:"viewHeight",valueCodes:[45],referenceType:0},{propertyName:"viewTarget",valueCodes:[17,27,37],referenceType:0},{propertyName:"visualStyle",valueCodes:[348],referenceType:1},{propertyName:"width",valueCodes:[40],referenceType:0}],systemVariables:[],dxfName:"VIEWPORT",dxfSubClassName:"AcDbViewport"},{typeName:"Wall",baseTypeName:"Entity",properties:[],systemVariables:[],dxfName:"AEC_WALL",dxfSubClassName:"AecDbWall"},{typeName:"Wipeout",baseTypeName:"CadWipeoutBase",properties:[],systemVariables:[],dxfName:"WIPEOUT",dxfSubClassName:"AcDbWipeout"},{typeName:"XLine",baseTypeName:"Entity",properties:[{propertyName:"direction",valueCodes:[11,21,31],referenceType:0},{propertyName:"firstPoint",valueCodes:[10,20,30],referenceType:0}],systemVariables:[],dxfName:"XLINE",dxfSubClassName:"AcDbXline"}];var $h=[{typeName:"AcdbPlaceHolder",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfName:"ACDBPLACEHOLDER",dxfSubClassName:"AcDbPlaceHolder"},{typeName:"AecBinRecord",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfName:"BINRECORD",dxfSubClassName:"BinRecord"},{typeName:"AecCleanupGroup",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfName:"AEC_CLEANUP_GROUP_DEF",dxfSubClassName:"AecDbCleanupGroupDef"},{typeName:"AecWallStyle",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfName:"AEC_WALL_STYLE",dxfSubClassName:"AecDbWallStyle"},{typeName:"AnnotScaleObjectContextData",baseTypeName:"ObjectContextData",properties:[{propertyName:"scale",valueCodes:[340],referenceType:1}],systemVariables:[],dxfSubClassIsEmpty:!0},{typeName:"Block1PtParameter",baseTypeName:"BlockParameter",properties:[{propertyName:"location",valueCodes:[1010,1020,1030],referenceType:0},{propertyName:"value93",valueCodes:[93],referenceType:0},{propertyName:"value170",valueCodes:[170],referenceType:0},{propertyName:"value171",valueCodes:[171],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlock1PtParameter"},{typeName:"Block2PtParameter",baseTypeName:"BlockParameter",properties:[{propertyName:"firstPoint",valueCodes:[1010,1020,1030],referenceType:0},{propertyName:"secondPoint",valueCodes:[1011,1021,1031],referenceType:0},{propertyName:"value170",valueCodes:[170],referenceType:0},{propertyName:"value171",valueCodes:[171],referenceType:0},{propertyName:"value172",valueCodes:[172],referenceType:0},{propertyName:"value173",valueCodes:[173],referenceType:0},{propertyName:"value174",valueCodes:[174],referenceType:0},{propertyName:"value177",valueCodes:[177],referenceType:0},{propertyName:"value303",valueCodes:[303],referenceType:0},{propertyName:"value304",valueCodes:[304],referenceType:0},{propertyName:"value94",valueCodes:[94],referenceType:0},{propertyName:"value95",valueCodes:[95],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlock2PtParameter"},{typeName:"BlockAction",baseTypeName:"BlockElement",properties:[{propertyName:"actionPoint",valueCodes:[1010,1020,1030],referenceType:0},{propertyName:"entities",valueCodes:[71],referenceType:4,collectionCodes:[330]},{propertyName:"value70",valueCodes:[70],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockAction"},{typeName:"BlockActionBasePt",baseTypeName:"BlockAction",properties:[{propertyName:"value1011",valueCodes:[1011,1021,1031],referenceType:0},{propertyName:"value1012",valueCodes:[1012,1022,1032],referenceType:0},{propertyName:"value280",valueCodes:[280],referenceType:0},{propertyName:"value301",valueCodes:[301],referenceType:0},{propertyName:"value302",valueCodes:[302],referenceType:0},{propertyName:"value92",valueCodes:[92],referenceType:0},{propertyName:"value93",valueCodes:[93],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockActionWithBasePt"},{typeName:"BlockBasePointParameter",baseTypeName:"Block1PtParameter",properties:[{propertyName:"point1010",valueCodes:[1011,1021,1031],referenceType:0},{propertyName:"point1012",valueCodes:[1012,1022,1032],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockBasePointParameter"},{typeName:"BlockElement",baseTypeName:"EvaluationExpression",properties:[{propertyName:"elementName",valueCodes:[300],referenceType:0},{propertyName:"value1071",valueCodes:[1071],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockElement"},{typeName:"BlockFlipAction",baseTypeName:"BlockAction",properties:[{propertyName:"caption301",valueCodes:[301],referenceType:0},{propertyName:"caption302",valueCodes:[302],referenceType:0},{propertyName:"caption303",valueCodes:[303],referenceType:0},{propertyName:"caption304",valueCodes:[304],referenceType:0},{propertyName:"value92",valueCodes:[92],referenceType:0},{propertyName:"value93",valueCodes:[93],referenceType:0},{propertyName:"value94",valueCodes:[94],referenceType:0},{propertyName:"value95",valueCodes:[95],referenceType:0}],systemVariables:[],dxfName:"BLOCKFLIPACTION",dxfSubClassName:"AcDbBlockFlipAction"},{typeName:"BlockFlipGrip",baseTypeName:"BlockGrip",properties:[{propertyName:"value140",valueCodes:[140],referenceType:0},{propertyName:"value141",valueCodes:[141],referenceType:0},{propertyName:"value142",valueCodes:[142],referenceType:0},{propertyName:"value93N",valueCodes:[93],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockFlipGrip"},{typeName:"BlockFlipParameter",baseTypeName:"Block2PtParameter",properties:[],systemVariables:[],dxfSubClassName:"AcDbBlockFlipParameter"},{typeName:"BlockGrip",baseTypeName:"BlockElement",properties:[{propertyName:"location",valueCodes:[1010,1020,1030],referenceType:0},{propertyName:"value280",valueCodes:[280],referenceType:0},{propertyName:"value91",valueCodes:[91],referenceType:0},{propertyName:"value92",valueCodes:[92],referenceType:0},{propertyName:"value93",valueCodes:[93],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockGrip"},{typeName:"BlockGripExpression",baseTypeName:"EvaluationExpression",properties:[{propertyName:"value300",valueCodes:[300],referenceType:0},{propertyName:"value91",valueCodes:[91],referenceType:0}],systemVariables:[],dxfName:"BLOCKGRIPLOCATIONCOMPONENT",dxfSubClassName:"AcDbBlockGripExpr"},{typeName:"BlockLinearParameter",baseTypeName:"Block2PtParameter",properties:[{propertyName:"label",valueCodes:[305],referenceType:0},{propertyName:"description",valueCodes:[306],referenceType:0},{propertyName:"labelOffset",valueCodes:[140],referenceType:0}],systemVariables:[],dxfName:"BLOCKLINEARPARAMETER",dxfSubClassName:"AcDbBlockLinearParameter"},{typeName:"BlockParameter",baseTypeName:"BlockElement",properties:[{propertyName:"value280",valueCodes:[280],referenceType:0},{propertyName:"value281",valueCodes:[281],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbBlockParameter"},{typeName:"BlockReferenceObjectContextData",baseTypeName:"AnnotScaleObjectContextData",properties:[{propertyName:"insertionPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"xScale",valueCodes:[41],referenceType:0},{propertyName:"yScale",valueCodes:[42],referenceType:0},{propertyName:"zScale",valueCodes:[43],referenceType:0}],systemVariables:[],dxfName:"ACDB_BLKREFOBJECTCONTEXTDATA_CLASS",dxfSubClassName:"AcDbAnnotScaleObjectContextData"},{typeName:"BlockRepresentationData",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"block",valueCodes:[330],referenceType:1},{propertyName:"value70",valueCodes:[70],referenceType:0}],systemVariables:[],dxfName:"ACDB_BLOCKREPRESENTATION_DATA",dxfSubClassName:"AcDbBlockRepresentationData"},{typeName:"BlockRotationAction",baseTypeName:"BlockActionBasePt",properties:[{propertyName:"value303",valueCodes:[303],referenceType:0},{propertyName:"value94",valueCodes:[94],referenceType:0}],systemVariables:[],dxfName:"BLOCKROTATEACTION",dxfSubClassName:"AcDbBlockRotationAction"},{typeName:"BlockRotationGrip",baseTypeName:"BlockGrip",properties:[],systemVariables:[],dxfName:"BLOCKROTATIONGRIP",dxfSubClassName:"AcDbBlockRotationGrip"},{typeName:"BlockRotationParameter",baseTypeName:"Block2PtParameter",properties:[{propertyName:"description",valueCodes:[306],referenceType:0},{propertyName:"name",valueCodes:[305],referenceType:0},{propertyName:"nameOffset",valueCodes:[140],referenceType:0},{propertyName:"point",valueCodes:[1011,1021,1031],referenceType:0},{propertyName:"value141",valueCodes:[141],referenceType:0},{propertyName:"value142",valueCodes:[142],referenceType:0},{propertyName:"value143",valueCodes:[143],referenceType:0},{propertyName:"value175",valueCodes:[175],referenceType:0},{propertyName:"value307",valueCodes:[307],referenceType:0},{propertyName:"value96",valueCodes:[96],referenceType:0}],systemVariables:[],dxfName:"BLOCKROTATIONPARAMETER",dxfSubClassName:"AcDbBlockRotationParameter"},{typeName:"BlockVisibilityGrip",baseTypeName:"BlockGrip",properties:[],systemVariables:[],dxfName:"BLOCKVISIBILITYGRIP",dxfSubClassName:"AcDbBlockVisibilityGrip"},{typeName:"BlockVisibilityParameter",baseTypeName:"Block1PtParameter",properties:[{propertyName:"description",valueCodes:[302],referenceType:0},{propertyName:"entities",valueCodes:[93],referenceType:4},{propertyName:"name",valueCodes:[301],referenceType:0},{propertyName:"states",valueCodes:[92],referenceType:4},{propertyName:"value91",valueCodes:[91],referenceType:0}],systemVariables:[],dxfName:"BLOCKVISIBILITYPARAMETER",dxfSubClassName:"AcDbBlockVisibilityParameter"},{typeName:"BookColor",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"color",valueCodes:[62,420],referenceType:0}],systemVariables:[],dxfName:"DBCOLOR",dxfSubClassName:"AcDbColor"},{typeName:"CadDictionary",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"clonningFlags",valueCodes:[281],referenceType:0},{propertyName:"entryHandles",valueCodes:[350],referenceType:0},{propertyName:"entryNames",valueCodes:[3],referenceType:0},{propertyName:"hardOwnerFlag",valueCodes:[280],referenceType:0}],systemVariables:[],dxfName:"DICTIONARY",dxfSubClassName:"AcDbDictionary"},{typeName:"CadDictionaryWithDefault",baseTypeName:"CadDictionary",properties:[{propertyName:"defaultEntry",valueCodes:[340],referenceType:1}],systemVariables:[],dxfName:"ACDBDICTIONARYWDFLT",dxfSubClassName:"AcDbDictionaryWithDefault"},{typeName:"DictionaryVariable",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"objectSchemaNumber",valueCodes:[280],referenceType:0},{propertyName:"value",valueCodes:[1],referenceType:0}],systemVariables:[],dxfName:"DICTIONARYVAR",dxfSubClassName:"DictionaryVariables"},{typeName:"DimensionAssociation",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"associativityFlags",valueCodes:[90],referenceType:0},{propertyName:"dimension",valueCodes:[330],referenceType:1},{propertyName:"isTransSpace",valueCodes:[70],referenceType:0},{propertyName:"rotatedDimensionType",valueCodes:[71],referenceType:0}],systemVariables:[],dxfName:"DIMASSOC",dxfSubClassName:"AcDbDimAssoc"},{typeName:"EvaluationExpression",baseTypeName:"CadObject",properties:[{propertyName:"id",valueCodes:[90],referenceType:0},{propertyName:"value98",valueCodes:[98],referenceType:0},{propertyName:"value99",valueCodes:[99],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbEvalExpr"},{typeName:"EvaluationGraph",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"value96",valueCodes:[96],referenceType:0},{propertyName:"value97",valueCodes:[97],referenceType:0}],systemVariables:[],dxfName:"ACAD_EVALUATION_GRAPH",dxfSubClassName:"AcDbEvalGraph"},{typeName:"Field",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"cadObjects",valueCodes:[97],referenceType:4,collectionCodes:[331]},{propertyName:"children",valueCodes:[90],referenceType:4,collectionCodes:[360]},{propertyName:"evaluationErrorCode",valueCodes:[96],referenceType:0},{propertyName:"evaluationErrorMessage",valueCodes:[300],referenceType:0},{propertyName:"evaluationOptionFlags",valueCodes:[91],referenceType:0},{propertyName:"evaluationStatusFlags",valueCodes:[95],referenceType:0},{propertyName:"evaluatorId",valueCodes:[1],referenceType:0},{propertyName:"fieldCode",valueCodes:[2],referenceType:0},{propertyName:"fieldStateFlags",valueCodes:[94],referenceType:0},{propertyName:"filingOptionFlags",valueCodes:[92],referenceType:0},{propertyName:"formatString",valueCodes:[301],referenceType:0},{propertyName:"value",valueCodes:[7],referenceType:0},{propertyName:"values",valueCodes:[93],referenceType:4,collectionCodes:[6]}],systemVariables:[],dxfName:"FIELD",dxfSubClassName:"AcDbField"},{typeName:"FieldList",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfName:"FIELDLIST",dxfSubClassName:"AcDbFieldList"},{typeName:"Filter",baseTypeName:"NonGraphicalObject",properties:[],systemVariables:[],dxfSubClassName:"AcDbFilter"},{typeName:"FormattedTableData",baseTypeName:"LinkedTableData",properties:[{propertyName:"description",valueCodes:[300],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbFormattedTableData"},{typeName:"GeoData",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"version",valueCodes:[90],referenceType:0},{propertyName:"coordinatesType",valueCodes:[70],referenceType:0},{propertyName:"designPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"referencePoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"northDirection",valueCodes:[12,22],referenceType:0},{propertyName:"horizontalUnitScale",valueCodes:[41],referenceType:0},{propertyName:"verticalUnitScale",valueCodes:[40],referenceType:0},{propertyName:"horizontalUnits",valueCodes:[91],referenceType:0},{propertyName:"verticalUnits",valueCodes:[92],referenceType:0},{propertyName:"upDirection",valueCodes:[210,220,230],referenceType:0},{propertyName:"scaleEstimationMethod",valueCodes:[95],referenceType:0},{propertyName:"enableSeaLevelCorrection",valueCodes:[294],referenceType:0},{propertyName:"userSpecifiedScaleFactor",valueCodes:[141],referenceType:0},{propertyName:"seaLevelElevation",valueCodes:[142],referenceType:0},{propertyName:"coordinateProjectionRadius",valueCodes:[143],referenceType:0},{propertyName:"coordinateSystemDefinition",valueCodes:[301],referenceType:0},{propertyName:"geoRssTag",valueCodes:[302],referenceType:0},{propertyName:"observationFromTag",valueCodes:[305],referenceType:0},{propertyName:"observationToTag",valueCodes:[306],referenceType:0},{propertyName:"observationCoverageTag",valueCodes:[307],referenceType:0},{propertyName:"points",valueCodes:[93],referenceType:4},{propertyName:"faces",valueCodes:[96],referenceType:4}],systemVariables:[],dxfName:"GEODATA",dxfSubClassName:"AcDbGeoData"},{typeName:"Group",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"description",valueCodes:[300],referenceType:0},{propertyName:"isUnnamed",valueCodes:[70],referenceType:0},{propertyName:"selectable",valueCodes:[71],referenceType:0}],systemVariables:[],dxfName:"GROUP",dxfSubClassName:"AcDbGroup"},{typeName:"ImageDefinition",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"classVersion",valueCodes:[90],referenceType:0},{propertyName:"fileName",valueCodes:[1],referenceType:0},{propertyName:"size",valueCodes:[10,20],referenceType:0},{propertyName:"defaultSize",valueCodes:[11,21],referenceType:0},{propertyName:"isLoaded",valueCodes:[280],referenceType:0},{propertyName:"units",valueCodes:[281],referenceType:0}],systemVariables:[],dxfName:"IMAGEDEF",dxfSubClassName:"AcDbRasterImageDef"},{typeName:"ImageDefinitionReactor",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"classVersion",valueCodes:[90],referenceType:0},{propertyName:"image",valueCodes:[330],referenceType:1}],systemVariables:[],dxfName:"IMAGEDEF_REACTOR",dxfSubClassName:"AcDbRasterImageDefReactor"},{typeName:"Layout",baseTypeName:"PlotSettings",properties:[{propertyName:"associatedBlock",valueCodes:[330],referenceType:1},{propertyName:"baseUCS",valueCodes:[346],referenceType:1},{propertyName:"elevation",valueCodes:[146],referenceType:0},{propertyName:"insertionBasePoint",valueCodes:[12,22,32],referenceType:0},{propertyName:"lastActiveViewport",valueCodes:[331],referenceType:1},{propertyName:"layoutFlags",valueCodes:[70],referenceType:0},{propertyName:"maxExtents",valueCodes:[15,25,35],referenceType:0},{propertyName:"maxLimits",valueCodes:[11,21],referenceType:0},{propertyName:"minExtents",valueCodes:[14,24,34],referenceType:0},{propertyName:"minLimits",valueCodes:[10,20],referenceType:0},{propertyName:"origin",valueCodes:[13,23,33],referenceType:0},{propertyName:"tabOrder",valueCodes:[71],referenceType:0},{propertyName:"ucsOrthographicType",valueCodes:[76],referenceType:0},{propertyName:"xAxis",valueCodes:[16,26,36],referenceType:0},{propertyName:"yAxis",valueCodes:[17,27,37],referenceType:0}],systemVariables:[],dxfName:"LAYOUT",dxfSubClassName:"AcDbLayout"},{typeName:"LinkedData",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"description",valueCodes:[300],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbLinkedData"},{typeName:"LinkedTableData",baseTypeName:"LinkedData",properties:[{propertyName:"description",valueCodes:[300],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbLinkedTableData"},{typeName:"Material",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"ambientColor",valueCodes:[90],referenceType:0},{propertyName:"ambientColorFactor",valueCodes:[40],referenceType:0},{propertyName:"ambientColorMethod",valueCodes:[70],referenceType:0},{propertyName:"bumpAutoTransform",valueCodes:[272],referenceType:0},{propertyName:"bumpMapBlendFactor",valueCodes:[143],referenceType:0},{propertyName:"bumpMapFileName",valueCodes:[8],referenceType:0},{propertyName:"bumpMapSource",valueCodes:[179],referenceType:0},{propertyName:"bumpMatrix",valueCodes:[144],referenceType:0},{propertyName:"bumpProjectionMethod",valueCodes:[270],referenceType:0},{propertyName:"bumpTilingMethod",valueCodes:[271],referenceType:0},{propertyName:"channelFlags",valueCodes:[94],referenceType:0},{propertyName:"description",valueCodes:[2],referenceType:0},{propertyName:"diffuseAutoTransform",valueCodes:[75],referenceType:0},{propertyName:"diffuseColor",valueCodes:[91],referenceType:0},{propertyName:"diffuseColorFactor",valueCodes:[41],referenceType:0},{propertyName:"diffuseColorMethod",valueCodes:[71],referenceType:0},{propertyName:"diffuseMapBlendFactor",valueCodes:[42],referenceType:0},{propertyName:"diffuseMapFileName",valueCodes:[3],referenceType:0},{propertyName:"diffuseMapSource",valueCodes:[72],referenceType:0},{propertyName:"diffuseMatrix",valueCodes:[43],referenceType:0},{propertyName:"diffuseProjectionMethod",valueCodes:[73],referenceType:0},{propertyName:"diffuseTilingMethod",valueCodes:[74],referenceType:0},{propertyName:"illuminationModel",valueCodes:[93],referenceType:0},{propertyName:"opacity",valueCodes:[140],referenceType:0},{propertyName:"opacityAutoTransform",valueCodes:[178],referenceType:0},{propertyName:"opacityMapBlendFactor",valueCodes:[141],referenceType:0},{propertyName:"opacityMapFileName",valueCodes:[7],referenceType:0},{propertyName:"opacityMapSource",valueCodes:[175],referenceType:0},{propertyName:"opacityMatrix",valueCodes:[142],referenceType:0},{propertyName:"opacityProjectionMethod",valueCodes:[176],referenceType:0},{propertyName:"opacityTilingMethod",valueCodes:[177],referenceType:0},{propertyName:"reflectionAutoTransform",valueCodes:[174],referenceType:0},{propertyName:"reflectionMapBlendFactor",valueCodes:[48],referenceType:0},{propertyName:"reflectionMapFileName",valueCodes:[6],referenceType:0},{propertyName:"reflectionMapSource",valueCodes:[171],referenceType:0},{propertyName:"reflectionMatrix",valueCodes:[49],referenceType:0},{propertyName:"reflectionProjectionMethod",valueCodes:[172],referenceType:0},{propertyName:"reflectionTilingMethod",valueCodes:[173],referenceType:0},{propertyName:"reflectivity",valueCodes:[468],referenceType:0},{propertyName:"refractionAutoTransform",valueCodes:[276],referenceType:0},{propertyName:"refractionIndex",valueCodes:[145],referenceType:0},{propertyName:"refractionMapBlendFactor",valueCodes:[146],referenceType:0},{propertyName:"refractionMapFileName",valueCodes:[9],referenceType:0},{propertyName:"refractionMapSource",valueCodes:[273],referenceType:0},{propertyName:"refractionMatrix",valueCodes:[147],referenceType:0},{propertyName:"refractionProjectionMethod",valueCodes:[274],referenceType:0},{propertyName:"refractionTilingMethod",valueCodes:[275],referenceType:0},{propertyName:"specularAutoTransform",valueCodes:[170],referenceType:0},{propertyName:"specularColor",valueCodes:[92],referenceType:0},{propertyName:"specularColorFactor",valueCodes:[45],referenceType:0},{propertyName:"specularColorMethod",valueCodes:[76],referenceType:0},{propertyName:"specularGlossFactor",valueCodes:[44],referenceType:0},{propertyName:"specularMapBlendFactor",valueCodes:[46],referenceType:0},{propertyName:"specularMapFileName",valueCodes:[4],referenceType:0},{propertyName:"specularMapSource",valueCodes:[77],referenceType:0},{propertyName:"specularMatrix",valueCodes:[47],referenceType:0},{propertyName:"specularProjectionMethod",valueCodes:[78],referenceType:0},{propertyName:"specularTilingMethod",valueCodes:[79],referenceType:0},{propertyName:"translucence",valueCodes:[148],referenceType:0}],systemVariables:[],dxfName:"MATERIAL",dxfSubClassName:"AcDbMaterial"},{typeName:"MLineStyle",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"description",valueCodes:[3],referenceType:0},{propertyName:"elements",valueCodes:[71],referenceType:4},{propertyName:"endAngle",valueCodes:[52],referenceType:32},{propertyName:"fillColor",valueCodes:[62],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"startAngle",valueCodes:[51],referenceType:32}],systemVariables:[],dxfName:"MLINESTYLE",dxfSubClassName:"AcDbMlineStyle"},{typeName:"MTextAttributeObjectContextData",baseTypeName:"AnnotScaleObjectContextData",properties:[{propertyName:"alignmentPoint",valueCodes:[11,21,31],referenceType:0},{propertyName:"attachmentPoint",valueCodes:[70],referenceType:0},{propertyName:"insertPoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"rotation",valueCodes:[50],referenceType:32},{propertyName:"value290",valueCodes:[290],referenceType:0}],systemVariables:[],dxfName:"ACDB_MTEXTATTRIBUTEOBJECTCONTEXTDATA_CLASS",dxfSubClassName:"AcDbAnnotScaleObjectContextData"},{typeName:"MultiLeaderObjectContextData",baseTypeName:"AnnotScaleObjectContextData",properties:[{propertyName:"arrowheadSize",valueCodes:[140],referenceType:0},{propertyName:"backgroundFillColor",valueCodes:[91],referenceType:0},{propertyName:"backgroundFillEnabled",valueCodes:[291],referenceType:0},{propertyName:"backgroundMaskFillOn",valueCodes:[292],referenceType:0},{propertyName:"backgroundScaleFactor",valueCodes:[141],referenceType:0},{propertyName:"backgroundTransparency",valueCodes:[92],referenceType:0},{propertyName:"baseDirection",valueCodes:[111,121,131],referenceType:0},{propertyName:"basePoint",valueCodes:[110,120,130],referenceType:0},{propertyName:"baseVertical",valueCodes:[112,122,132],referenceType:0},{propertyName:"blockContent",valueCodes:[341],referenceType:1},{propertyName:"blockContentColor",valueCodes:[93],referenceType:0},{propertyName:"blockContentConnection",valueCodes:[177],referenceType:0},{propertyName:"blockContentLocation",valueCodes:[15,25,35],referenceType:0},{propertyName:"blockContentNormal",valueCodes:[14,24,34],referenceType:0},{propertyName:"blockContentRotation",valueCodes:[46],referenceType:32},{propertyName:"blockContentScale",valueCodes:[16,26,36],referenceType:0},{propertyName:"boundaryHeight",valueCodes:[44],referenceType:0},{propertyName:"boundaryWidth",valueCodes:[43],referenceType:0},{propertyName:"columnFlowReversed",valueCodes:[294],referenceType:0},{propertyName:"columnGutter",valueCodes:[143],referenceType:0},{propertyName:"columnSizes",valueCodes:[144],referenceType:0},{propertyName:"columnType",valueCodes:[173],referenceType:0},{propertyName:"columnWidth",valueCodes:[142],referenceType:0},{propertyName:"contentBasePoint",valueCodes:[10,20,30],referenceType:0},{propertyName:"direction",valueCodes:[13,23,33],referenceType:0},{propertyName:"flowDirection",valueCodes:[172],referenceType:0},{propertyName:"hasContentsBlock",valueCodes:[296],referenceType:0},{propertyName:"hasTextContents",valueCodes:[290],referenceType:0},{propertyName:"landingGap",valueCodes:[145],referenceType:0},{propertyName:"lineSpacing",valueCodes:[170],referenceType:0},{propertyName:"lineSpacingFactor",valueCodes:[45],referenceType:0},{propertyName:"normalReversed",valueCodes:[297],referenceType:0},{propertyName:"scaleFactor",valueCodes:[40],referenceType:0},{propertyName:"textAlignment",valueCodes:[176],referenceType:0},{propertyName:"textAttachmentPoint",valueCodes:[171],referenceType:0},{propertyName:"textBottomAttachment",valueCodes:[272],referenceType:0},{propertyName:"textColor",valueCodes:[90],referenceType:0},{propertyName:"textHeight",valueCodes:[41],referenceType:0},{propertyName:"textHeightAutomatic",valueCodes:[293],referenceType:0},{propertyName:"textLabel",valueCodes:[304],referenceType:0},{propertyName:"textLeftAttachment",valueCodes:[174],referenceType:0},{propertyName:"textLocation",valueCodes:[12,22,32],referenceType:0},{propertyName:"textNormal",valueCodes:[11,21,31],referenceType:0},{propertyName:"textRightAttachment",valueCodes:[175],referenceType:0},{propertyName:"textRotation",valueCodes:[42],referenceType:32},{propertyName:"textStyle",valueCodes:[340],referenceType:1},{propertyName:"textTopAttachment",valueCodes:[273],referenceType:0},{propertyName:"transformationMatrix",valueCodes:[93],referenceType:0},{propertyName:"wordBreak",valueCodes:[295],referenceType:0}],systemVariables:[],dxfName:"ACDB_MLEADEROBJECTCONTEXTDATA_CLASS",dxfSubClassName:"AcDbMLeaderObjectContextData"},{typeName:"MultiLeaderStyle",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"alignSpace",valueCodes:[46],referenceType:0},{propertyName:"arrowhead",valueCodes:[341],referenceType:1},{propertyName:"arrowheadSize",valueCodes:[44],referenceType:0},{propertyName:"blockContent",valueCodes:[343],referenceType:1},{propertyName:"blockContentColor",valueCodes:[94],referenceType:0},{propertyName:"blockContentConnection",valueCodes:[177],referenceType:0},{propertyName:"blockContentRotation",valueCodes:[141],referenceType:32},{propertyName:"blockContentScaleX",valueCodes:[47],referenceType:0},{propertyName:"blockContentScaleY",valueCodes:[49],referenceType:0},{propertyName:"blockContentScaleZ",valueCodes:[140],referenceType:0},{propertyName:"breakGapSize",valueCodes:[143],referenceType:0},{propertyName:"contentType",valueCodes:[170],referenceType:0},{propertyName:"defaultTextContents",valueCodes:[300],referenceType:0},{propertyName:"description",valueCodes:[3],referenceType:0},{propertyName:"enableBlockContentRotation",valueCodes:[294],referenceType:0},{propertyName:"enableBlockContentScale",valueCodes:[293],referenceType:0},{propertyName:"enableDogleg",valueCodes:[291],referenceType:0},{propertyName:"enableLanding",valueCodes:[290],referenceType:0},{propertyName:"firstSegmentAngleConstraint",valueCodes:[40],referenceType:0},{propertyName:"isAnnotative",valueCodes:[296],referenceType:0},{propertyName:"landingDistance",valueCodes:[43],referenceType:0},{propertyName:"landingGap",valueCodes:[42],referenceType:0},{propertyName:"leaderDrawOrder",valueCodes:[172],referenceType:0},{propertyName:"leaderLineType",valueCodes:[340],referenceType:1},{propertyName:"leaderLineWeight",valueCodes:[92],referenceType:0},{propertyName:"lineColor",valueCodes:[91],referenceType:0},{propertyName:"maxLeaderSegmentsPoints",valueCodes:[90],referenceType:0},{propertyName:"multiLeaderDrawOrder",valueCodes:[171],referenceType:0},{propertyName:"overwritePropertyValue",valueCodes:[295],referenceType:0},{propertyName:"pathType",valueCodes:[173],referenceType:0},{propertyName:"scaleFactor",valueCodes:[142],referenceType:0},{propertyName:"secondSegmentAngleConstraint",valueCodes:[41],referenceType:0},{propertyName:"textAlignAlwaysLeft",valueCodes:[297],referenceType:0},{propertyName:"textAlignment",valueCodes:[176],referenceType:0},{propertyName:"textAngle",valueCodes:[175],referenceType:0},{propertyName:"textAttachmentDirection",valueCodes:[271],referenceType:0},{propertyName:"textBottomAttachment",valueCodes:[272],referenceType:0},{propertyName:"textColor",valueCodes:[93],referenceType:0},{propertyName:"textFrame",valueCodes:[292],referenceType:0},{propertyName:"textHeight",valueCodes:[45],referenceType:0},{propertyName:"textLeftAttachment",valueCodes:[174],referenceType:0},{propertyName:"textRightAttachment",valueCodes:[178],referenceType:0},{propertyName:"textStyle",valueCodes:[342],referenceType:1},{propertyName:"textTopAttachment",valueCodes:[273],referenceType:0},{propertyName:"unknownFlag298",valueCodes:[298],referenceType:0}],systemVariables:[],dxfName:"MLEADERSTYLE",dxfSubClassName:"AcDbMLeaderStyle"},{typeName:"ObjectContextData",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"version",valueCodes:[70],referenceType:0},{propertyName:"hasFileToExtensionDictionary",valueCodes:[],referenceType:0},{propertyName:"default",valueCodes:[290],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbObjectContextData"},{typeName:"PdfUnderlayDefinition",baseTypeName:"UnderlayDefinition",properties:[{propertyName:"page",valueCodes:[2],referenceType:0}],systemVariables:[],dxfName:"PDFDEFINITION",dxfSubClassName:"AcDbUnderlayDefinition"},{typeName:"PlotSettings",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"denominatorScale",valueCodes:[143],referenceType:0},{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"numeratorScale",valueCodes:[142],referenceType:0},{propertyName:"pageName",valueCodes:[1],referenceType:0},{propertyName:"paperHeight",valueCodes:[45],referenceType:0},{propertyName:"paperImageOriginX",valueCodes:[148],referenceType:0},{propertyName:"paperImageOriginY",valueCodes:[149],referenceType:0},{propertyName:"paperRotation",valueCodes:[73],referenceType:0},{propertyName:"paperSize",valueCodes:[4],referenceType:0},{propertyName:"paperUnits",valueCodes:[72],referenceType:0},{propertyName:"paperWidth",valueCodes:[44],referenceType:0},{propertyName:"plotOriginX",valueCodes:[46],referenceType:0},{propertyName:"plotOriginY",valueCodes:[47],referenceType:0},{propertyName:"plotType",valueCodes:[74],referenceType:0},{propertyName:"plotViewName",valueCodes:[6],referenceType:0},{propertyName:"scaledFit",valueCodes:[75],referenceType:0},{propertyName:"shadePlotDPI",valueCodes:[78],referenceType:0},{propertyName:"shadePlotIDHandle",valueCodes:[333],referenceType:16},{propertyName:"shadePlotMode",valueCodes:[76],referenceType:0},{propertyName:"shadePlotResolutionMode",valueCodes:[77],referenceType:0},{propertyName:"standardScale",valueCodes:[147],referenceType:0},{propertyName:"styleSheet",valueCodes:[7],referenceType:0},{propertyName:"systemPrinterName",valueCodes:[2],referenceType:0},{propertyName:"unprintableMargin",valueCodes:[40,41,42,43],referenceType:0},{propertyName:"windowLowerLeftX",valueCodes:[48],referenceType:0},{propertyName:"windowLowerLeftY",valueCodes:[49],referenceType:0},{propertyName:"windowUpperLeftX",valueCodes:[140],referenceType:0},{propertyName:"windowUpperLeftY",valueCodes:[141],referenceType:0}],systemVariables:[],dxfName:"PLOTSETTINGS",dxfSubClassName:"AcDbPlotSettings"},{typeName:"ProxyObject",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"classId",valueCodes:[91],referenceType:0},{propertyName:"drawingFormat",valueCodes:[95],referenceType:0},{propertyName:"originalDataFormatDxf",valueCodes:[70],referenceType:0},{propertyName:"proxyClassId",valueCodes:[90],referenceType:0},{propertyName:"binaryData",valueCodes:[310],referenceType:0},{propertyName:"data",valueCodes:[311],referenceType:0}],systemVariables:[],dxfName:"ACAD_PROXY_OBJECT",dxfSubClassName:"AcDbProxyObject"},{typeName:"RasterVariables",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"classVersion",valueCodes:[90],referenceType:0},{propertyName:"displayQuality",valueCodes:[71],referenceType:0},{propertyName:"isDisplayFrameShown",valueCodes:[70],referenceType:0},{propertyName:"units",valueCodes:[72],referenceType:0}],systemVariables:[],dxfName:"RASTERVARIABLES",dxfSubClassName:"AcDbRasterVariables"},{typeName:"Scale",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"paperUnits",valueCodes:[140],referenceType:0},{propertyName:"drawingUnits",valueCodes:[141],referenceType:0},{propertyName:"isUnitScale",valueCodes:[290],referenceType:0}],systemVariables:[],dxfName:"SCALE",dxfSubClassName:"AcDbScale"},{typeName:"SortEntitiesTable",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"blockOwner",valueCodes:[330],referenceType:0}],systemVariables:[],dxfName:"SORTENTSTABLE",dxfSubClassName:"AcDbSortentsTable"},{typeName:"SpatialFilter",baseTypeName:"Filter",properties:[{propertyName:"backDistance",valueCodes:[41],referenceType:0},{propertyName:"boundaryPoints",valueCodes:[70],referenceType:4,collectionCodes:[10,20]},{propertyName:"clipBackPlane",valueCodes:[73],referenceType:0},{propertyName:"clipFrontPlane",valueCodes:[72],referenceType:0},{propertyName:"displayBoundary",valueCodes:[71],referenceType:0},{propertyName:"frontDistance",valueCodes:[40],referenceType:0},{propertyName:"normal",valueCodes:[210,220,230],referenceType:0},{propertyName:"origin",valueCodes:[11,21,31],referenceType:0}],systemVariables:[],dxfName:"SPATIAL_FILTER",dxfSubClassName:"AcDbSpatialFilter"},{typeName:"TableStyle",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"description",valueCodes:[3],referenceType:0},{propertyName:"flags",valueCodes:[71],referenceType:0},{propertyName:"flowDirection",valueCodes:[70],referenceType:0},{propertyName:"horizontalCellMargin",valueCodes:[40],referenceType:0},{propertyName:"suppressHeaderRow",valueCodes:[281],referenceType:0},{propertyName:"suppressTitle",valueCodes:[280],referenceType:0},{propertyName:"verticalCellMargin",valueCodes:[41],referenceType:0}],systemVariables:[],dxfName:"STYLE",dxfSubClassName:"AcDbTableStyle"},{typeName:"UnderlayDefinition",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"file",valueCodes:[1],referenceType:0}],systemVariables:[],dxfSubClassIsEmpty:!0},{typeName:"VisualStyle",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"brightness",valueCodes:[44],referenceType:0},{propertyName:"color",valueCodes:[62,63],referenceType:0},{propertyName:"description",valueCodes:[2],referenceType:0},{propertyName:"displaySettings",valueCodes:[93],referenceType:0},{propertyName:"edgeApplyStyleFlag",valueCodes:[174],referenceType:0},{propertyName:"edgeColor",valueCodes:[66],referenceType:0},{propertyName:"edgeCreaseAngle",valueCodes:[42],referenceType:0},{propertyName:"edgeIntersectionColor",valueCodes:[64],referenceType:0},{propertyName:"edgeIntersectionLineType",valueCodes:[175],referenceType:0},{propertyName:"edgeIsolineCount",valueCodes:[171],referenceType:0},{propertyName:"edgeJitter",valueCodes:[78],referenceType:0},{propertyName:"edgeModifiers",valueCodes:[92],referenceType:0},{propertyName:"edgeObscuredColor",valueCodes:[65],referenceType:0},{propertyName:"edgeObscuredLineType",valueCodes:[75],referenceType:0},{propertyName:"edgeOverhang",valueCodes:[77],referenceType:0},{propertyName:"edgeSilhouetteColor",valueCodes:[67],referenceType:0},{propertyName:"edgeSilhouetteWidth",valueCodes:[79],referenceType:0},{propertyName:"edgeStyle",valueCodes:[91],referenceType:0},{propertyName:"edgeStyleModel",valueCodes:[74],referenceType:0},{propertyName:"edgeWidth",valueCodes:[76],referenceType:0},{propertyName:"faceColorMode",valueCodes:[73],referenceType:0},{propertyName:"faceLightingModel",valueCodes:[71],referenceType:0},{propertyName:"faceLightingQuality",valueCodes:[72],referenceType:0},{propertyName:"faceModifiers",valueCodes:[90],referenceType:0},{propertyName:"faceOpacityLevel",valueCodes:[40],referenceType:0},{propertyName:"faceSpecularLevel",valueCodes:[41],referenceType:0},{propertyName:"faceStyleMonoColor",valueCodes:[421],referenceType:0},{propertyName:"haloGap",valueCodes:[170],referenceType:0},{propertyName:"internalFlag",valueCodes:[291],referenceType:0},{propertyName:"opacityLevel",valueCodes:[43],referenceType:0},{propertyName:"precisionFlag",valueCodes:[290],referenceType:0},{propertyName:"rasterFile",valueCodes:[1],referenceType:0},{propertyName:"shadowType",valueCodes:[173],referenceType:0},{propertyName:"type",valueCodes:[70],referenceType:0}],systemVariables:[],dxfName:"VISUALSTYLE",dxfSubClassName:"AcDbVisualStyle"},{typeName:"XRecord",baseTypeName:"NonGraphicalObject",properties:[{propertyName:"cloningFlags",valueCodes:[280],referenceType:0}],systemVariables:[],dxfName:"XRECORD",dxfSubClassName:"AcDbXrecord"}];var Gh=[{typeName:"AppId",baseTypeName:"TableEntry",properties:[],systemVariables:[],dxfName:"APPID",dxfSubClassName:"AcDbRegAppTableRecord"},{typeName:"BlockRecord",baseTypeName:"TableEntry",properties:[{propertyName:"canScale",valueCodes:[281],referenceType:8},{propertyName:"isExplodable",valueCodes:[280],referenceType:8},{propertyName:"layout",valueCodes:[340],referenceType:1},{propertyName:"preview",valueCodes:[310],referenceType:8}],systemVariables:[],dxfName:"BLOCK_RECORD",dxfSubClassName:"AcDbBlockTableRecord"},{typeName:"DimensionStyle",baseTypeName:"TableEntry",properties:[{propertyName:"alternateDimensioningSuffix",valueCodes:[4],referenceType:0},{propertyName:"alternateUnitDecimalPlaces",valueCodes:[171],referenceType:0},{propertyName:"alternateUnitDimensioning",valueCodes:[170],referenceType:0},{propertyName:"alternateUnitFormat",valueCodes:[273],referenceType:0},{propertyName:"alternateUnitRounding",valueCodes:[148],referenceType:0},{propertyName:"alternateUnitScaleFactor",valueCodes:[143],referenceType:0},{propertyName:"alternateUnitToleranceDecimalPlaces",valueCodes:[274],referenceType:0},{propertyName:"alternateUnitToleranceZeroHandling",valueCodes:[286],referenceType:0},{propertyName:"alternateUnitZeroHandling",valueCodes:[285],referenceType:0},{propertyName:"angularDecimalPlaces",valueCodes:[179],referenceType:0},{propertyName:"angularUnit",valueCodes:[275],referenceType:0},{propertyName:"angularZeroHandling",valueCodes:[79],referenceType:0},{propertyName:"arcLengthSymbolPosition",valueCodes:[90],referenceType:0},{propertyName:"arrowBlock",valueCodes:[342],referenceType:1},{propertyName:"arrowSize",valueCodes:[41],referenceType:0},{propertyName:"centerMarkSize",valueCodes:[141],referenceType:0},{propertyName:"cursorUpdate",valueCodes:[288],referenceType:0},{propertyName:"decimalPlaces",valueCodes:[271],referenceType:0},{propertyName:"decimalSeparator",valueCodes:[278],referenceType:0},{propertyName:"dimArrow1",valueCodes:[343],referenceType:1},{propertyName:"dimArrow2",valueCodes:[344],referenceType:1},{propertyName:"dimensionFit",valueCodes:[287],referenceType:0},{propertyName:"dimensionLineColor",valueCodes:[176],referenceType:0},{propertyName:"dimensionLineExtension",valueCodes:[46],referenceType:0},{propertyName:"dimensionLineGap",valueCodes:[147],referenceType:0},{propertyName:"dimensionLineIncrement",valueCodes:[43],referenceType:0},{propertyName:"dimensionLineWeight",valueCodes:[371],referenceType:0},{propertyName:"dimensionTextArrowFit",valueCodes:[289],referenceType:0},{propertyName:"dimensionUnit",valueCodes:[270],referenceType:0},{propertyName:"extensionLineColor",valueCodes:[177],referenceType:0},{propertyName:"extensionLineExtension",valueCodes:[44],referenceType:0},{propertyName:"extensionLineOffset",valueCodes:[42],referenceType:0},{propertyName:"extensionLineWeight",valueCodes:[372],referenceType:0},{propertyName:"fixedExtensionLineLength",valueCodes:[49],referenceType:0},{propertyName:"fractionFormat",valueCodes:[276],referenceType:0},{propertyName:"generateTolerances",valueCodes:[71],referenceType:0},{propertyName:"isExtensionLineLengthFixed",valueCodes:[290],referenceType:0},{propertyName:"joggedRadiusDimensionTransverseSegmentAngle",valueCodes:[50],referenceType:32},{propertyName:"leaderArrow",valueCodes:[341],referenceType:1},{propertyName:"limitsGeneration",valueCodes:[72],referenceType:0},{propertyName:"linearScaleFactor",valueCodes:[144],referenceType:0},{propertyName:"linearUnitFormat",valueCodes:[277],referenceType:0},{propertyName:"lineType",valueCodes:[345],referenceType:1},{propertyName:"lineTypeExt1",valueCodes:[346],referenceType:1},{propertyName:"lineTypeExt2",valueCodes:[347],referenceType:1},{propertyName:"minusTolerance",valueCodes:[48],referenceType:0},{propertyName:"plusTolerance",valueCodes:[47],referenceType:0},{propertyName:"postFix",valueCodes:[3],referenceType:0},{propertyName:"rounding",valueCodes:[45],referenceType:0},{propertyName:"scaleFactor",valueCodes:[40],referenceType:0},{propertyName:"separateArrowBlocks",valueCodes:[173],referenceType:0},{propertyName:"style",valueCodes:[340],referenceType:1},{propertyName:"suppressFirstDimensionLine",valueCodes:[281],referenceType:0},{propertyName:"suppressFirstExtensionLine",valueCodes:[75],referenceType:0},{propertyName:"suppressOutsideExtensions",valueCodes:[175],referenceType:0},{propertyName:"suppressSecondDimensionLine",valueCodes:[282],referenceType:0},{propertyName:"suppressSecondExtensionLine",valueCodes:[76],referenceType:0},{propertyName:"textBackgroundFillMode",valueCodes:[69],referenceType:0},{propertyName:"textColor",valueCodes:[178],referenceType:0},{propertyName:"textDirection",valueCodes:[295],referenceType:0},{propertyName:"textHeight",valueCodes:[140],referenceType:0},{propertyName:"textHorizontalAlignment",valueCodes:[280],referenceType:0},{propertyName:"textInsideExtensions",valueCodes:[174],referenceType:0},{propertyName:"textInsideHorizontal",valueCodes:[73],referenceType:0},{propertyName:"textMovement",valueCodes:[279],referenceType:0},{propertyName:"textOutsideExtensions",valueCodes:[172],referenceType:0},{propertyName:"textOutsideHorizontal",valueCodes:[74],referenceType:0},{propertyName:"textVerticalAlignment",valueCodes:[77],referenceType:0},{propertyName:"textVerticalPosition",valueCodes:[145],referenceType:0},{propertyName:"tickSize",valueCodes:[142],referenceType:0},{propertyName:"toleranceAlignment",valueCodes:[283],referenceType:0},{propertyName:"toleranceDecimalPlaces",valueCodes:[272],referenceType:0},{propertyName:"toleranceScaleFactor",valueCodes:[146],referenceType:0},{propertyName:"toleranceZeroHandling",valueCodes:[284],referenceType:0},{propertyName:"zeroHandling",valueCodes:[78],referenceType:0}],systemVariables:[],dxfName:"DIMSTYLE",dxfSubClassName:"AcDbDimStyleTableRecord"},{typeName:"Layer",baseTypeName:"TableEntry",properties:[{propertyName:"color",valueCodes:[62,420,430],referenceType:0},{propertyName:"lineType",valueCodes:[6],referenceType:2},{propertyName:"lineWeight",valueCodes:[370],referenceType:0},{propertyName:"material",valueCodes:[347],referenceType:1},{propertyName:"plotFlag",valueCodes:[290],referenceType:0},{propertyName:"plotStyleName",valueCodes:[390],referenceType:64}],systemVariables:[],dxfName:"LAYER",dxfSubClassName:"AcDbLayerTableRecord"},{typeName:"LineType",baseTypeName:"TableEntry",properties:[{propertyName:"alignment",valueCodes:[72],referenceType:0},{propertyName:"description",valueCodes:[3],referenceType:0},{propertyName:"patternLength",valueCodes:[40],referenceType:0},{propertyName:"segments",valueCodes:[73],referenceType:4}],systemVariables:[],dxfName:"LTYPE",dxfSubClassName:"AcDbLinetypeTableRecord"},{typeName:"Table",properties:[{propertyName:"count",valueCodes:[70],referenceType:4}],systemVariables:[],dxfSubClassName:"AcDbSymbolTable"},{typeName:"TableEntry",baseTypeName:"CadObject",properties:[{propertyName:"flags",valueCodes:[70],referenceType:0},{propertyName:"name",valueCodes:[2],referenceType:0}],systemVariables:[],dxfSubClassName:"AcDbSymbolTableRecord",dxfSubClassIsEmpty:!0},{typeName:"TextStyle",baseTypeName:"TableEntry",properties:[{propertyName:"filename",valueCodes:[3],referenceType:0},{propertyName:"bigFontFilename",valueCodes:[4],referenceType:0},{propertyName:"height",valueCodes:[40],referenceType:0},{propertyName:"width",valueCodes:[41],referenceType:0},{propertyName:"lastHeight",valueCodes:[42],referenceType:0},{propertyName:"obliqueAngle",valueCodes:[50],referenceType:32},{propertyName:"mirrorFlag",valueCodes:[71],referenceType:0},{propertyName:"trueType",valueCodes:[1071],referenceType:8}],systemVariables:[],dxfName:"STYLE",dxfSubClassName:"AcDbTextStyleTableRecord"},{typeName:"UCS",baseTypeName:"TableEntry",properties:[{propertyName:"origin",valueCodes:[10,20,30],referenceType:0},{propertyName:"xAxis",valueCodes:[11,21,31],referenceType:0},{propertyName:"yAxis",valueCodes:[12,22,32],referenceType:0},{propertyName:"orthographicType",valueCodes:[71],referenceType:0},{propertyName:"orthographicViewType",valueCodes:[79],referenceType:0},{propertyName:"elevation",valueCodes:[146],referenceType:0}],systemVariables:[],dxfName:"UCS",dxfSubClassName:"AcDbUCSTableRecord"},{typeName:"View",baseTypeName:"TableEntry",properties:[{propertyName:"height",valueCodes:[40],referenceType:0},{propertyName:"width",valueCodes:[41],referenceType:0},{propertyName:"lensLength",valueCodes:[42],referenceType:0},{propertyName:"frontClipping",valueCodes:[43],referenceType:0},{propertyName:"backClipping",valueCodes:[44],referenceType:0},{propertyName:"angle",valueCodes:[50],referenceType:32},{propertyName:"viewMode",valueCodes:[71],referenceType:0},{propertyName:"isUcsAssociated",valueCodes:[72],referenceType:0},{propertyName:"isPlottable",valueCodes:[73],referenceType:0},{propertyName:"renderMode",valueCodes:[281],referenceType:0},{propertyName:"center",valueCodes:[10,20],referenceType:0},{propertyName:"direction",valueCodes:[11,21,31],referenceType:0},{propertyName:"target",valueCodes:[12,22,32],referenceType:0},{propertyName:"visualStyle",valueCodes:[348],referenceType:1},{propertyName:"ucsOrigin",valueCodes:[110,120,130],referenceType:0},{propertyName:"ucsXAxis",valueCodes:[111,121,131],referenceType:0},{propertyName:"ucsYAxis",valueCodes:[112,122,132],referenceType:0},{propertyName:"ucsElevation",valueCodes:[146],referenceType:0},{propertyName:"ucsOrthographicType",valueCodes:[79],referenceType:0}],systemVariables:[],dxfName:"VIEW",dxfSubClassName:"AcDbViewTableRecord"},{typeName:"VPort",baseTypeName:"TableEntry",properties:[{propertyName:"bottomLeft",valueCodes:[10,20],referenceType:0},{propertyName:"topRight",valueCodes:[11,21],referenceType:0},{propertyName:"center",valueCodes:[12,22],referenceType:0},{propertyName:"snapBasePoint",valueCodes:[13,23],referenceType:0},{propertyName:"snapSpacing",valueCodes:[14,24],referenceType:0},{propertyName:"gridSpacing",valueCodes:[15,25],referenceType:0},{propertyName:"direction",valueCodes:[16,26,36],referenceType:0},{propertyName:"target",valueCodes:[17,27,37],referenceType:0},{propertyName:"aspectRatio",valueCodes:[41],referenceType:0},{propertyName:"lensLength",valueCodes:[42],referenceType:0},{propertyName:"frontClippingPlane",valueCodes:[43],referenceType:0},{propertyName:"backClippingPlane",valueCodes:[44],referenceType:0},{propertyName:"snapRotation",valueCodes:[50],referenceType:32},{propertyName:"twistAngle",valueCodes:[51],referenceType:32},{propertyName:"circleZoomPercent",valueCodes:[72],referenceType:0},{propertyName:"renderMode",valueCodes:[281],referenceType:0},{propertyName:"viewMode",valueCodes:[71],referenceType:0},{propertyName:"ucsIconDisplay",valueCodes:[74],referenceType:0},{propertyName:"snapOn",valueCodes:[75],referenceType:0},{propertyName:"showGrid",valueCodes:[76],referenceType:0},{propertyName:"isometricSnap",valueCodes:[77],referenceType:0},{propertyName:"snapIsoPair",valueCodes:[78],referenceType:0},{propertyName:"origin",valueCodes:[110,120,130],referenceType:0},{propertyName:"xAxis",valueCodes:[111,121,131],referenceType:0},{propertyName:"yAxis",valueCodes:[112,122,132],referenceType:0},{propertyName:"namedUcs",valueCodes:[345],referenceType:1},{propertyName:"baseUcs",valueCodes:[346],referenceType:1},{propertyName:"orthographicType",valueCodes:[79],referenceType:0},{propertyName:"elevation",valueCodes:[146],referenceType:0},{propertyName:"gridFlags",valueCodes:[60],referenceType:0},{propertyName:"minorGridLinesPerMajorGridLine",valueCodes:[61],referenceType:0},{propertyName:"visualStyle",valueCodes:[348],referenceType:1},{propertyName:"useDefaultLighting",valueCodes:[292],referenceType:0},{propertyName:"defaultLighting",valueCodes:[282],referenceType:0},{propertyName:"brightness",valueCodes:[141],referenceType:0},{propertyName:"contrast",valueCodes:[142],referenceType:0},{propertyName:"ambientColor",valueCodes:[63,421,431],referenceType:0}],systemVariables:[],dxfName:"VPORT",dxfSubClassName:"AcDbViewportTableRecord"}];var Xh=[...Wh,...Uh,...zh,...$h,...Gh];var Zh=new Map,Yh=!1;function Od(r){return{...r,valueCodes:[...r.valueCodes],collectionCodes:r.collectionCodes?[...r.collectionCodes]:void 0}}function qh(r){return{...r,properties:r.properties.map(Od),systemVariables:r.systemVariables.map(Od)}}function fu(){if(!Yh){for(let r of Xh)Zh.set(r.typeName,qh(r));Yh=!0}}function fa(r){fu();let e=typeof r=="string"?r:r.name,t=Zh.get(e);return t?qh(t):void 0}function md(r){return fa(r)?.properties??[]}function Id(r){return fa(r)?.systemVariables??[]}function Kh(r){let e=new Map;for(let t of Id(r))e.set(t.name,Od(t));return e}var Md;(function(r){r[r.Top=0]="Top",r[r.Middle=1]="Middle",r[r.Bottom=2]="Bottom"})(Md||(Md={}));var Nt=class r{static _headerMapCache=null;angleBase=0;angularDirection=Dl.ClockWise;angularUnit=La.DecimalDegrees;get angularUnitPrecision(){return this._angularUnitPrecision}set angularUnitPrecision(e){if(e<0||e>8)throw new Error("AUPREC valid values are from 0 to 8");this._angularUnitPrecision=e}arrowBlockName="";associatedDimensions=!0;attributeVisibility=Sl.Normal;blipMode=!1;cameraDisplayObjects=!1;cameraHeight=0;chamferAngle=0;chamferDistance1=0;chamferDistance2=0;chamferLength=0;codePage="ANSI_1252";createDateTime=new Date;createEllipseAsPolyline=!1;currentEntityColor=S.byLayer;currentEntityLinetypeScale=1;currentEntityLineWeight=F.ByLayer;currentEntityPlotStyle=bs.ByLayer;get currentLayer(){return this.document==null?this._currentLayer:this.document.layers.get(this.currentLayerName)}get currentLayerName(){return this._currentLayer.name}set currentLayerName(e){this.document!=null?this._currentLayer=this.document.layers.get(e):this._currentLayer=new pe(e)}get currentLineType(){return this.document==null?this._currentLineType:this.document.lineTypes.get(this.currentLineTypeName)}get currentLineTypeName(){return this._currentLineType.name}set currentLineTypeName(e){this.document!=null?this._currentLineType=this.document.lineTypes.get(e):this._currentLineType=new z(e)}currentMultiLineJustification=Md.Top;currentMultilineScale=20;currentMLineStyleName="Standard";get currentTextStyle(){return this.document==null?this._currentTextStyle:this.document.textStyles.get(this.currentTextStyleName)}get currentTextStyleName(){return this._currentTextStyle.name}set currentTextStyleName(e){this.document!=null?this._currentTextStyle=this.document.textStyles.get(e):this._currentTextStyle=new oe(e)}dgnUnderlayFramesVisibility="";get dimensionAlternateDimensioningSuffix(){return this._dimensionStyleOverrides.alternateDimensioningSuffix}set dimensionAlternateDimensioningSuffix(e){this._dimensionStyleOverrides.alternateDimensioningSuffix=e}get dimensionAlternateUnitDecimalPlaces(){return this._dimensionStyleOverrides.alternateUnitDecimalPlaces}set dimensionAlternateUnitDecimalPlaces(e){this._dimensionStyleOverrides.alternateUnitDecimalPlaces=e}get dimensionAlternateUnitDimensioning(){return this._dimensionStyleOverrides.alternateUnitDimensioning}set dimensionAlternateUnitDimensioning(e){this._dimensionStyleOverrides.alternateUnitDimensioning=e}get dimensionAlternateUnitFormat(){return this._dimensionStyleOverrides.alternateUnitFormat}set dimensionAlternateUnitFormat(e){this._dimensionStyleOverrides.alternateUnitFormat=e}get dimensionAlternateUnitRounding(){return this._dimensionStyleOverrides.alternateUnitRounding}set dimensionAlternateUnitRounding(e){this._dimensionStyleOverrides.alternateUnitRounding=e}get dimensionAlternateUnitScaleFactor(){return this._dimensionStyleOverrides.alternateUnitScaleFactor}set dimensionAlternateUnitScaleFactor(e){this._dimensionStyleOverrides.alternateUnitScaleFactor=e}get dimensionAlternateUnitToleranceDecimalPlaces(){return this._dimensionStyleOverrides.alternateUnitToleranceDecimalPlaces}set dimensionAlternateUnitToleranceDecimalPlaces(e){this._dimensionStyleOverrides.alternateUnitToleranceDecimalPlaces=e}get dimensionAlternateUnitToleranceZeroHandling(){return this._dimensionStyleOverrides.alternateUnitToleranceZeroHandling}set dimensionAlternateUnitToleranceZeroHandling(e){this._dimensionStyleOverrides.alternateUnitToleranceZeroHandling=e}get dimensionAlternateUnitZeroHandling(){return this._dimensionStyleOverrides.alternateUnitZeroHandling}set dimensionAlternateUnitZeroHandling(e){this._dimensionStyleOverrides.alternateUnitZeroHandling=e}get dimensionAngularDimensionDecimalPlaces(){return this._dimensionStyleOverrides.angularDecimalPlaces}set dimensionAngularDimensionDecimalPlaces(e){this._dimensionStyleOverrides.angularDecimalPlaces=e}get dimensionAngularUnit(){return this._dimensionStyleOverrides.angularUnit}set dimensionAngularUnit(e){this._dimensionStyleOverrides.angularUnit=e}get dimensionAngularZeroHandling(){return this._dimensionStyleOverrides.angularZeroHandling}set dimensionAngularZeroHandling(e){this._dimensionStyleOverrides.angularZeroHandling=e}get dimensionArcLengthSymbolPosition(){return this._dimensionStyleOverrides.arcLengthSymbolPosition}set dimensionArcLengthSymbolPosition(e){this._dimensionStyleOverrides.arcLengthSymbolPosition=e}get dimensionArrowSize(){return this._dimensionStyleOverrides.arrowSize}set dimensionArrowSize(e){this._dimensionStyleOverrides.arrowSize=e}dimensionAssociativity=Bl.CreateAssociativeDimensions;dimensionBlockName="";dimensionBlockNameFirst=null;dimensionBlockNameSecond=null;get dimensionCenterMarkSize(){return this._dimensionStyleOverrides.centerMarkSize}set dimensionCenterMarkSize(e){this._dimensionStyleOverrides.centerMarkSize=e}get dimensionCursorUpdate(){return this._dimensionStyleOverrides.cursorUpdate}set dimensionCursorUpdate(e){this._dimensionStyleOverrides.cursorUpdate=e}get dimensionDecimalPlaces(){return this._dimensionStyleOverrides.decimalPlaces}set dimensionDecimalPlaces(e){this._dimensionStyleOverrides.decimalPlaces=e}get dimensionDecimalSeparator(){return this._dimensionStyleOverrides.decimalSeparator}set dimensionDecimalSeparator(e){this._dimensionStyleOverrides.decimalSeparator=e}get dimensionDimensionTextArrowFit(){return this._dimensionStyleOverrides.dimensionTextArrowFit}set dimensionDimensionTextArrowFit(e){this._dimensionStyleOverrides.dimensionTextArrowFit=e}get dimensionExtensionLineColor(){return this._dimensionStyleOverrides.extensionLineColor}set dimensionExtensionLineColor(e){this._dimensionStyleOverrides.extensionLineColor=e}get dimensionExtensionLineExtension(){return this._dimensionStyleOverrides.extensionLineExtension}set dimensionExtensionLineExtension(e){this._dimensionStyleOverrides.extensionLineExtension=e}get dimensionExtensionLineOffset(){return this._dimensionStyleOverrides.extensionLineOffset}set dimensionExtensionLineOffset(e){this._dimensionStyleOverrides.extensionLineOffset=e}get dimensionFit(){return this._dimensionStyleOverrides.dimensionFit}set dimensionFit(e){this._dimensionStyleOverrides.dimensionFit=e}get dimensionFixedExtensionLineLength(){return this._dimensionStyleOverrides.fixedExtensionLineLength}set dimensionFixedExtensionLineLength(e){this._dimensionStyleOverrides.fixedExtensionLineLength=e}get dimensionFractionFormat(){return this._dimensionStyleOverrides.fractionFormat}set dimensionFractionFormat(e){this._dimensionStyleOverrides.fractionFormat=e}get dimensionGenerateTolerances(){return this._dimensionStyleOverrides.generateTolerances}set dimensionGenerateTolerances(e){this._dimensionStyleOverrides.generateTolerances=e}get dimensionIsExtensionLineLengthFixed(){return this._dimensionStyleOverrides.isExtensionLineLengthFixed}set dimensionIsExtensionLineLengthFixed(e){this._dimensionStyleOverrides.isExtensionLineLengthFixed=e}get dimensionJoggedRadiusDimensionTransverseSegmentAngle(){return this._dimensionStyleOverrides.joggedRadiusDimensionTransverseSegmentAngle}set dimensionJoggedRadiusDimensionTransverseSegmentAngle(e){this._dimensionStyleOverrides.joggedRadiusDimensionTransverseSegmentAngle=e}get dimensionLimitsGeneration(){return this._dimensionStyleOverrides.limitsGeneration}set dimensionLimitsGeneration(e){this._dimensionStyleOverrides.limitsGeneration=e}get dimensionLinearScaleFactor(){return this._dimensionStyleOverrides.linearScaleFactor}set dimensionLinearScaleFactor(e){this._dimensionStyleOverrides.linearScaleFactor=e}get dimensionLinearUnitFormat(){return this._dimensionStyleOverrides.linearUnitFormat}set dimensionLinearUnitFormat(e){this._dimensionStyleOverrides.linearUnitFormat=e}get dimensionLineColor(){return this._dimensionStyleOverrides.dimensionLineColor}set dimensionLineColor(e){this._dimensionStyleOverrides.dimensionLineColor=e}get dimensionLineExtension(){return this._dimensionStyleOverrides.dimensionLineExtension}set dimensionLineExtension(e){this._dimensionStyleOverrides.dimensionLineExtension=e}get dimensionLineGap(){return this._dimensionStyleOverrides.dimensionLineGap}set dimensionLineGap(e){this._dimensionStyleOverrides.dimensionLineGap=e}get dimensionLineIncrement(){return this._dimensionStyleOverrides.dimensionLineIncrement}set dimensionLineIncrement(e){this._dimensionStyleOverrides.dimensionLineIncrement=e}dimensionLineType="ByBlock";get dimensionLineWeight(){return this._dimensionStyleOverrides.dimensionLineWeight}set dimensionLineWeight(e){this._dimensionStyleOverrides.dimensionLineWeight=e}get dimensionMinusTolerance(){return this._dimensionStyleOverrides.minusTolerance}set dimensionMinusTolerance(e){this._dimensionStyleOverrides.minusTolerance=e}get dimensionPlusTolerance(){return this._dimensionStyleOverrides.plusTolerance}set dimensionPlusTolerance(e){this._dimensionStyleOverrides.plusTolerance=e}get dimensionPostFix(){return this._dimensionStyleOverrides.postFix}set dimensionPostFix(e){this._dimensionStyleOverrides.postFix=e}get dimensionRounding(){return this._dimensionStyleOverrides.rounding}set dimensionRounding(e){this._dimensionStyleOverrides.rounding=e}get dimensionScaleFactor(){return this._dimensionStyleOverrides.scaleFactor}set dimensionScaleFactor(e){this._dimensionStyleOverrides.scaleFactor=e}get dimensionSeparateArrowBlocks(){return this._dimensionStyleOverrides.separateArrowBlocks}set dimensionSeparateArrowBlocks(e){this._dimensionStyleOverrides.separateArrowBlocks=e}get currentDimensionStyle(){return this.document==null?this._currentDimensionStyle:this.document.dimensionStyles.get(this.currentDimensionStyleName)}get currentDimensionStyleName(){return this._currentDimensionStyle.name}set currentDimensionStyleName(e){this.document!=null?this._currentDimensionStyle=this.document.dimensionStyles.get(e):this._currentDimensionStyle=new Q(e)}get dimensionSuppressFirstDimensionLine(){return this._dimensionStyleOverrides.suppressFirstDimensionLine}set dimensionSuppressFirstDimensionLine(e){this._dimensionStyleOverrides.suppressFirstDimensionLine=e}get dimensionSuppressFirstExtensionLine(){return this._dimensionStyleOverrides.suppressFirstExtensionLine}set dimensionSuppressFirstExtensionLine(e){this._dimensionStyleOverrides.suppressFirstExtensionLine=e}get dimensionSuppressOutsideExtensions(){return this._dimensionStyleOverrides.suppressOutsideExtensions}set dimensionSuppressOutsideExtensions(e){this._dimensionStyleOverrides.suppressOutsideExtensions=e}get dimensionSuppressSecondDimensionLine(){return this._dimensionStyleOverrides.suppressSecondDimensionLine}set dimensionSuppressSecondDimensionLine(e){this._dimensionStyleOverrides.suppressSecondDimensionLine=e}get dimensionSuppressSecondExtensionLine(){return this._dimensionStyleOverrides.suppressSecondExtensionLine}set dimensionSuppressSecondExtensionLine(e){this._dimensionStyleOverrides.suppressSecondExtensionLine=e}dimensionTex1="ByBlock";dimensionTex2="ByBlock";get dimensionTextBackgroundColor(){return this._dimensionStyleOverrides.textBackgroundColor}set dimensionTextBackgroundColor(e){this._dimensionStyleOverrides.textBackgroundColor=e}get dimensionTextBackgroundFillMode(){return this._dimensionStyleOverrides.textBackgroundFillMode}set dimensionTextBackgroundFillMode(e){this._dimensionStyleOverrides.textBackgroundFillMode=e}get dimensionTextColor(){return this._dimensionStyleOverrides.textColor}set dimensionTextColor(e){this._dimensionStyleOverrides.textColor=e}get dimensionTextDirection(){return this._dimensionStyleOverrides.textDirection}set dimensionTextDirection(e){this._dimensionStyleOverrides.textDirection=e}get dimensionTextHeight(){return this._dimensionStyleOverrides.textHeight}set dimensionTextHeight(e){this._dimensionStyleOverrides.textHeight=e}get dimensionTextHorizontalAlignment(){return this._dimensionStyleOverrides.textHorizontalAlignment}set dimensionTextHorizontalAlignment(e){this._dimensionStyleOverrides.textHorizontalAlignment=e}get dimensionTextInsideExtensions(){return this._dimensionStyleOverrides.textInsideExtensions}set dimensionTextInsideExtensions(e){this._dimensionStyleOverrides.textInsideExtensions=e}get dimensionTextInsideHorizontal(){return this._dimensionStyleOverrides.textInsideHorizontal}set dimensionTextInsideHorizontal(e){this._dimensionStyleOverrides.textInsideHorizontal=e}get dimensionTextMovement(){return this._dimensionStyleOverrides.textMovement}set dimensionTextMovement(e){this._dimensionStyleOverrides.textMovement=e}get dimensionTextOutsideExtensions(){return this._dimensionStyleOverrides.textOutsideExtensions}set dimensionTextOutsideExtensions(e){this._dimensionStyleOverrides.textOutsideExtensions=e}get dimensionTextOutsideHorizontal(){return this._dimensionStyleOverrides.textOutsideHorizontal}set dimensionTextOutsideHorizontal(e){this._dimensionStyleOverrides.textOutsideHorizontal=e}get dimensionTextStyle(){return this.document==null?this._dimensionTextStyle:this.document.textStyles.get(this.dimensionTextStyleName)}get dimensionTextStyleName(){return this._dimensionTextStyle.name}set dimensionTextStyleName(e){this.document!=null?this._dimensionTextStyle=this.document.textStyles.get(e):this._dimensionTextStyle=new oe(e)}get dimensionTextVerticalAlignment(){return this._dimensionStyleOverrides.textVerticalAlignment}set dimensionTextVerticalAlignment(e){this._dimensionStyleOverrides.textVerticalAlignment=e}get dimensionTextVerticalPosition(){return this._dimensionStyleOverrides.textVerticalPosition}set dimensionTextVerticalPosition(e){this._dimensionStyleOverrides.textVerticalPosition=e}get dimensionTickSize(){return this._dimensionStyleOverrides.tickSize}set dimensionTickSize(e){this._dimensionStyleOverrides.tickSize=e}get dimensionToleranceAlignment(){return this._dimensionStyleOverrides.toleranceAlignment}set dimensionToleranceAlignment(e){this._dimensionStyleOverrides.toleranceAlignment=e}get dimensionToleranceDecimalPlaces(){return this._dimensionStyleOverrides.toleranceDecimalPlaces}set dimensionToleranceDecimalPlaces(e){this._dimensionStyleOverrides.toleranceDecimalPlaces=e}get dimensionToleranceScaleFactor(){return this._dimensionStyleOverrides.toleranceScaleFactor}set dimensionToleranceScaleFactor(e){this._dimensionStyleOverrides.toleranceScaleFactor=e}get dimensionToleranceZeroHandling(){return this._dimensionStyleOverrides.toleranceZeroHandling}set dimensionToleranceZeroHandling(e){this._dimensionStyleOverrides.toleranceZeroHandling=e}get dimensionUnit(){return this._dimensionStyleOverrides.dimensionUnit}set dimensionUnit(e){this._dimensionStyleOverrides.dimensionUnit=e}get dimensionZeroHandling(){return this._dimensionStyleOverrides.zeroHandling}set dimensionZeroHandling(e){this._dimensionStyleOverrides.zeroHandling=e}get dimensionstyleOverrides(){return this._dimensionStyleOverrides}displayLightGlyphs="";displayLineWeight=!1;displaySilhouetteCurves=!1;document=null;draftAngleFirstCrossSection=0;draftAngleSecondCrossSection=0;draftMagnitudeFirstCrossSection=0;draftMagnitudeSecondCrossSection=0;dw3DPrecision=0;dwgUnderlayFramesVisibility="";get elevation(){return this.modelSpaceUcs.elevation}set elevation(e){this.modelSpaceUcs.elevation=e}endCaps=0;entitySortingFlags=Al.Disabled;extendedNames=!0;get extensionLineWeight(){return this._dimensionStyleOverrides.extensionLineWeight}set extensionLineWeight(e){this._dimensionStyleOverrides.extensionLineWeight=e}externalReferenceClippingBoundaryType=El.DisplayNotPlot;get facetResolution(){return this._facetResolution}set facetResolution(e){if(e<.01||e>10)throw new Error("FACETRES valid values are from 0.01 to 10.0");this._facetResolution=e}filletRadius=0;fillMode=!0;fingerPrintGuid=crypto.randomUUID?.()??"";haloGapPercentage=0;handleSeed=1;hideText=0;hyperLinkBase=null;indexCreationFlags=Rl.NoIndex;insUnits=ce.Unitless;interfereColor=new S(1);intersectionDisplay=0;joinStyle=0;lastSavedBy="ACadSharp";latitude=37.795;lensLength=0;limitCheckingOn=!1;linearUnitFormat=ma.Decimal;get linearUnitPrecision(){return this._linearUnitPrecision}set linearUnitPrecision(e){if(e<0||e>8)throw new Error("LUPREC valid values are from 0 to 8");this._linearUnitPrecision=e}lineTypeScale=1;loadOLEObject=!1;loftedObjectNormals="";longitude=-122.394;maintenanceVersion=0;maxViewportCount=64;measurementUnits=Nl.Metric;menuFileName=".";mirrorText=!1;modelSpaceExtMax=new c(0,0,0);modelSpaceExtMin=new c(0,0,0);modelSpaceInsertionBase=new c(0,0,0);modelSpaceLimitsMax=new g(0,0);modelSpaceLimitsMin=new g(0,0);get modelSpaceOrigin(){return this.modelSpaceUcs.origin}set modelSpaceOrigin(e){this.modelSpaceUcs.origin=e}modelSpaceOrthographicBackDOrigin=new c(0,0,0);modelSpaceOrthographicBottomDOrigin=new c(0,0,0);modelSpaceOrthographicFrontDOrigin=new c(0,0,0);modelSpaceOrthographicLeftDOrigin=new c(0,0,0);modelSpaceOrthographicRightDOrigin=new c(0,0,0);modelSpaceOrthographicTopDOrigin=new c(0,0,0);modelSpaceUcs=new Rt;modelSpaceUcsBase=new Rt;get modelSpaceXAxis(){return this.modelSpaceUcs.xAxis}set modelSpaceXAxis(e){this.modelSpaceUcs.xAxis=e}get modelSpaceYAxis(){return this.modelSpaceUcs.yAxis}set modelSpaceYAxis(e){this.modelSpaceUcs.yAxis=e}northDirection=0;numberOfSplineSegments=8;objectSnapMode=4133;obscuredColor=new S(0);obscuredType=0;orthoMode=!1;get paperSpaceBaseName(){return this.paperSpaceUcsBase.name}set paperSpaceBaseName(e){this.paperSpaceUcsBase.name=e}get paperSpaceElevation(){return this.paperSpaceUcs.elevation}set paperSpaceElevation(e){this.paperSpaceUcs.elevation=e}paperSpaceExtMax=new c(0,0,0);paperSpaceExtMin=new c(0,0,0);paperSpaceInsertionBase=new c(0,0,0);paperSpaceLimitsChecking=!1;paperSpaceLimitsMax=new g(0,0);paperSpaceLimitsMin=new g(0,0);paperSpaceLineTypeScaling=Fi.Normal;get paperSpaceName(){return this.paperSpaceUcs.name}set paperSpaceName(e){this.paperSpaceUcs.name=e}paperSpaceOrthographicBackDOrigin=new c(0,0,0);paperSpaceOrthographicBottomDOrigin=new c(0,0,0);paperSpaceOrthographicFrontDOrigin=new c(0,0,0);paperSpaceOrthographicLeftDOrigin=new c(0,0,0);paperSpaceOrthographicRightDOrigin=new c(0,0,0);paperSpaceOrthographicTopDOrigin=new c(0,0,0);paperSpaceUcs=new Rt;paperSpaceUcsBase=new Rt;get paperSpaceXAxis(){return this.paperSpaceUcs.xAxis}set paperSpaceXAxis(e){this.paperSpaceUcs.xAxis=e}get paperSpaceYAxis(){return this.paperSpaceUcs.yAxis}set paperSpaceYAxis(e){this.paperSpaceUcs.yAxis=e}peditType=0;pickStyle=1;pointDisplayMode=0;pointDisplaySize=0;proxyGraphics=!0;regenMode=!0;get shadeEdge(){return this._shadeEdge}set shadeEdge(e){this._shadeEdge=e}shadeDiffuse=70;showModelSpaceInPaperSpace=!1;sketchIncrement=.1;sketchPolylineType=vl.None;solidVisualStyleObjectType=0;splineDegreeCurves=3;stackedTextAlignment=1;stackedTextSizePercentage=70;get stepsPerSecond(){return this._stepsPerSecond}set stepsPerSecond(e){this._stepsPerSecond=e}get surfaceIsolineCount(){return this._surfaceIsolineCount}set surfaceIsolineCount(e){this._surfaceIsolineCount=e}surfaceDensityM=6;surfaceDensityN=6;surfaceType=6;surfaceTabulation1=6;surfaceTabulation2=6;get textQuality(){return this._textQuality}set textQuality(e){this._textQuality=e}textSize=2.5;thickness=0;tileModeEnabled=!0;timeZone=0;totalEditingTime=0;traceWidthDefault=0;get ucsBaseName(){return this.modelSpaceUcsBase.name}set ucsBaseName(e){this.modelSpaceUcsBase.name=e}get ucsName(){return this.modelSpaceUcs.name}set ucsName(e){this.modelSpaceUcs.name=e}unitMode=0;universalCreateDateTime=new Date;universalUpdateDateTime=new Date;updateDateTime=new Date;updateDimensionsWhileDragging=!0;userDouble1=0;userDouble2=0;userDouble3=0;userDouble4=0;userDouble5=0;userElapsedTimeSpan=0;userShort1=0;userShort2=0;userShort3=0;userShort4=0;userShort5=0;userTimer=!1;get version(){return this._version}set version(e){switch(this._version=e,e){case u.AC1015:this.maintenanceVersion=20;break;case u.AC1018:this.maintenanceVersion=104;break;case u.AC1021:this.maintenanceVersion=50;break;case u.AC1024:this.maintenanceVersion=226;break;case u.AC1027:this.maintenanceVersion=125;break;case u.AC1032:this.maintenanceVersion=228;break;default:this.maintenanceVersion=0;break}}versionGuid=crypto.randomUUID?.()??"";get versionString(){return q.getNameFromVersion(this.version)}set versionString(e){this.version=q.getVersionFromName(e)}viewportDefaultViewScaleFactor=0;worldView=!0;xEdit=!1;_angularUnitPrecision=0;_currentLayer=pe.default;_currentLineType=z.byLayer;_currentTextStyle=oe.default;_dimensionStyleOverrides=new Q("override");_currentDimensionStyle=Q.default;_dimensionTextStyle=oe.default;_facetResolution=.5;_linearUnitPrecision=4;_stepsPerSecond=2;_surfaceIsolineCount=4;_textQuality=50;_version=u.AC1032;_shadeEdge=0;constructor(e){typeof e=="number"?this.version=e:e&&typeof e=="object"?(this.version=u.AC1032,this.document=e):this.version=u.AC1032}requiredVersions=0;dimsav=0;polylineLineTypeGeneration=!1;regenerationMode=0;quickTextMode=!1;showSplineControlPoints=!1;showModelSpace=!1;retainXRefDependentVisibilitySettings=!1;spatialIndexMaxTreeDepth=0;splineType=0;shadeDiffuseToAmbientPercentage=70;textHeightDefault=.2;thicknessDefault=0;polylineWidthDefault=0;dimensionAltMzf=0;dimensionAltMzs="";dimensionMzs="";styleSheetName="";plotStyleMode=0;projectName="";stepSize=0;solidsRetainHistory=!1;showSolidsHistory=!1;sweptSolidWidth=0;sweptSolidHeight=0;solidLoftedShape=0;shadowMode=0;shadowPlaneLocation=0;dimensionMzf=0;getValue(e){return r.getHeaderMap().get(e)?.getValue(this)}getValues(e){let t=new Map,i=r.getHeaderMap().get(e);if(!i)return t;for(let s of i.dxfCodes){let a=i.getSystemValue(s,this);a!=null&&t.set(s,a)}return t}static getHeaderMap(){if(!r._headerMapCache){r._headerMapCache=new Map;for(let e of Kh(r).values())r._headerMapCache.set(e.name,new kl(e))}return new Map(r._headerMapCache)}setValue(e,t){let i=r.getHeaderMap().get(String(e));if(!i)return;let s=Array.isArray(t)?t:[t];s.length!==0&&(i.isName&&typeof s[0]=="string"&&s[0].length===0||i.applyValues(this,s))}toString(){return`${this.version}`}};xr();var ge=class{onAdd=null;onRemove=null;get handle(){return this._dictionary.handle}_dictionary;constructor(e){if(!e)throw new Error("dictionary cannot be null");this._dictionary=e}add(e){this._dictionary.add(e)}clear(){this._dictionary.clear()}containsKey(e){return this._dictionary.containsKey(e)}remove(e){return this._dictionary.remove(e)}tryAdd(e){let t=this.tryGet(e.name);return t||(this.add(e),e)}tryGet(e){return this._dictionary.getEntry(e)}get(e){return this._dictionary.getEntry(e)}[Symbol.iterator](){let e=[];for(let t of this._dictionary)e.push(t);return e[Symbol.iterator]()}};var Pl=class extends ge{constructor(e){super(e)}};te();T();D();B();var Ft=class extends M{description="";get entities(){return this._entities}get isUnnamed(){return!this.name||this.name.startsWith("*")}get objectName(){return h.tableGroup}get objectType(){return m.GROUP}selectable=!0;get subclassMarker(){return d.group}_entities=[];constructor(e){super(e)}add(e){if(this.document!==e.document)throw new Error("The Group and the entity must belong to the same document.");this._entities.push(e),e.addReactor(this)}addRange(e){for(let t of e)this.add(t)}clear(){for(let e of this._entities)e.removeReactor(this);this._entities=[]}remove(e){e.removeReactor(this);let t=this._entities.indexOf(e);return t>=0?(this._entities.splice(t,1),!0):!1}clone(){let e=super.clone();return e._entities=[],e}};var Ll=class extends ge{constructor(e){super(e),this._dictionary=e}add(e){(!e.name||!e.name.trim())&&(e.name=this._createName("*A")),this._validateEntities(e.entities),super.add(e)}createGroup(e,t=""){this._validateEntities(e);let i=new Ft(t);return this.add(i),i.addRange(e),i}_createName(e){let t=0;for(;this.containsKey(`${e}${t}`);)t++;return`${e}${t}`}_validateEntities(e){let t=this._dictionary.document;if(t!=null){for(let i of e)if(i.document!==t)throw new Error("All group entities must belong to the same document as the group collection.")}}};var jl=class extends ge{constructor(e){super(e),this._dictionary=e}remove(e){if(e.toLowerCase()===ke.modelLayoutName.toLowerCase()||e.toLowerCase()===ke.paperLayoutName.toLowerCase())throw new Error(`The Layout ${e} cannot be removed.`);return super.remove(e)}};te();T();D();B();var Ui;(function(r){r[r.None=0]="None",r[r.NoAutoTransform=1]="NoAutoTransform",r[r.ScaleMapper=2]="ScaleMapper",r[r.IncludeCurrentBlock=4]="IncludeCurrentBlock"})(Ui||(Ui={}));var cr;(function(r){r[r.Current=0]="Current",r[r.Override=1]="Override"})(cr||(cr={}));var et;(function(r){r[r.UseCurrentScene=0]="UseCurrentScene",r[r.UseImageFile=1]="UseImageFile",r[r.Procedural=2]="Procedural"})(et||(et={}));var Wi;(function(r){r[r.None=0]="None",r[r.Planar=1]="Planar",r[r.Box=2]="Box",r[r.Cylinder=3]="Cylinder",r[r.Sphere=4]="Sphere"})(Wi||(Wi={}));var zi;(function(r){r[r.None=0]="None",r[r.Tile=1]="Tile",r[r.Crop=2]="Crop",r[r.Clamp=3]="Clamp"})(zi||(zi={}));var ft=class extends M{ambientColor=S.byLayer;_ambientColorFactor=1;get ambientColorFactor(){return this._ambientColorFactor}set ambientColorFactor(e){if(e<0||e>1)throw new Error("Value must be in range 0 to 1");this._ambientColorFactor=e}ambientColorMethod=cr.Current;bumpAutoTransform=Ui.NoAutoTransform;bumpMapBlendFactor=1;bumpMapFileName="";bumpMapSource=et.UseImageFile;bumpMatrix=[];bumpProjectionMethod=Wi.Planar;bumpTilingMethod=zi.Tile;channelFlags=0;description="";diffuseAutoTransform=Ui.NoAutoTransform;diffuseColor=S.byLayer;_diffuseColorFactor=1;get diffuseColorFactor(){return this._diffuseColorFactor}set diffuseColorFactor(e){if(e<0||e>1)throw new Error("Value must be in range 0 to 1");this._diffuseColorFactor=e}diffuseColorMethod=cr.Current;diffuseMapBlendFactor=1;diffuseMapFileName="";diffuseMapSource=et.UseImageFile;diffuseMatrix=[];diffuseProjectionMethod=Wi.Planar;diffuseTilingMethod=zi.Tile;illuminationModel=0;get objectName(){return h.objectMaterial}get objectType(){return m.UNLISTED}opacity=1;opacityAutoTransform=Ui.NoAutoTransform;opacityMapBlendFactor=1;opacityMapFileName="";opacityMapSource=et.UseImageFile;opacityMatrix=[];opacityProjectionMethod=Wi.Planar;opacityTilingMethod=zi.Tile;reflectionAutoTransform=Ui.NoAutoTransform;reflectionMapBlendFactor=1;reflectionMapFileName="";reflectionMapSource=et.UseImageFile;reflectionMatrix=[];reflectionProjectionMethod=Wi.Planar;reflectionTilingMethod=zi.Tile;reflectivity=0;refractionAutoTransform=Ui.NoAutoTransform;refractionIndex=1;refractionMapBlendFactor=1;refractionMapFileName="";refractionMapSource=et.UseImageFile;refractionMatrix=[];refractionProjectionMethod=Wi.Planar;refractionTilingMethod=zi.Tile;specularAutoTransform=Ui.NoAutoTransform;specularColor=S.byLayer;_specularColorFactor=1;get specularColorFactor(){return this._specularColorFactor}set specularColorFactor(e){if(e<0||e>1)throw new Error("Value must be in range 0 to 1");this._specularColorFactor=e}specularColorMethod=cr.Current;specularGlossFactor=.5;specularMapBlendFactor=1;specularMapFileName="";specularMapSource=et.UseImageFile;specularMatrix=[];specularProjectionMethod=Wi.Planar;specularTilingMethod=zi.Tile;get subclassMarker(){return d.material}translucence=0;static byBlockName="ByBlock";static byLayerName="ByLayer";static globalName="Global";constructor(e){super(e)}};var Ol=class extends ge{constructor(e){super(e)}createDefaults(){this._dictionary.tryAdd(new ft("Global")),this._dictionary.tryAdd(new ft("ByLayer")),this._dictionary.tryAdd(new ft("ByBlock"))}};te();De();T();D();B();var Te;(function(r){r[r.None=0]="None",r[r.FillOn=1]="FillOn",r[r.DisplayJoints=2]="DisplayJoints",r[r.StartSquareCap=16]="StartSquareCap",r[r.StartInnerArcsCap=32]="StartInnerArcsCap",r[r.StartRoundCap=64]="StartRoundCap",r[r.EndSquareCap=256]="EndSquareCap",r[r.EndInnerArcsCap=512]="EndInnerArcsCap",r[r.EndRoundCap=1024]="EndRoundCap"})(Te||(Te={}));var js=class r{color=S.byLayer;_lineType=null;get lineType(){return this._lineType}set lineType(e){this._lineType=A.updateCollectionStatic(e,this.owner?.document?.lineTypes)}offset=0;owner=null;clone(){let e=new r;return e.color=this.color,e.offset=this.offset,e.owner=null,e._lineType=this._lineType?.clone()??null,e}assignDocument(e){this._lineType=A.updateCollectionStatic(this._lineType,e.lineTypes)}unassignDocument(){this._lineType=this._lineType?.clone()??null}},At=class r extends M{static get default_(){let e=new r(r.defaultName);e.startAngle=Math.PI/2,e.endAngle=Math.PI/2;let t=new js;t.offset=.5,e.addElement(t);let i=new js;return i.offset=-.5,e.addElement(i),e}description="";get elements(){return this._elements}endAngle=Math.PI/2;fillColor=S.byLayer;flags=Te.None;get objectName(){return h.objectMLineStyle}get objectType(){return m.MLINESTYLE}startAngle=Math.PI/2;get subclassMarker(){return d.mLineStyle}static defaultName="Standard";_elements=[];constructor(e){super(e)}addElement(e){if(e.owner!=null)throw new Error(`Element already assigned to a MLineStyle: ${e.owner.name}`);e.lineType=A.updateCollection(e.lineType,this.document?.lineTypes),e.owner=this,this._elements.push(e)}clone(){let e=super.clone();e._elements=[];for(let t of this._elements)e.addElement(t.clone());return e}};var Il=class extends ge{constructor(e){super(e)}createDefaults(){this._dictionary.tryAdd(At.default_)}};De();var $i;(function(r){r[r.Outside=0]="Outside",r[r.Inside=1]="Inside"})($i||($i={}));var bi;(function(r){r[r.Rectangular=1]="Rectangular",r[r.Polygonal=2]="Polygonal"})(bi||(bi={}));var Cr;(function(r){r[r.None=0]="None",r[r.ShowImage=1]="ShowImage",r[r.ShowNotAlignedImage=2]="ShowNotAlignedImage",r[r.UseClippingBoundary=4]="UseClippingBoundary",r[r.TransparencyIsOn=8]="TransparencyIsOn"})(Cr||(Cr={}));var Os=class extends N{get brightness(){return this._brightness}set brightness(e){if(e<0||e>100)throw new Error(`Invalid Brightness value: ${e}, must be in range 0-100`);this._brightness=e}classVersion=0;clipBoundaryVertices=[];clipMode=$i.Outside;clippingState=!1;clipType=bi.Rectangular;get contrast(){return this._contrast}set contrast(e){if(e<0||e>100)throw new Error(`Invalid Contrast value: ${e}, must be in range 0-100`);this._contrast=e}get definition(){return this._definition}set definition(e){this.document!=null?this._definition=A.updateCollection(e,this.document.imageDefinitions):this._definition=e}get fade(){return this._fade}set fade(e){if(e<0||e>100)throw new Error(`Invalid Fade value: ${e}, must be in range 0-100`);this._fade=e}get flags(){return this._flags}set flags(e){this._flags=e}insertPoint=new c(0,0,0);get showImage(){return(this._flags&Cr.ShowImage)!==0}set showImage(e){e?this._flags=this._flags|Cr.ShowImage:this._flags=this._flags&~Cr.ShowImage}size=new g(0,0);uVector=new c(1,0,0);vVector=new c(0,1,0);definitionReactor=null;_brightness=50;_contrast=50;_definition=null;_fade=0;_flags=Cr.None;applyTransform(e){this.insertPoint=this.applyTransformToPoint(e,this.insertPoint),this.uVector=this.applyTransformToVector(e,this.uVector),this.vVector=this.applyTransformToVector(e,this.vVector)}clone(){let e=super.clone();return e._definition=this._definition?.clone()??null,e}getBoundingBox(){if(this.clipBoundaryVertices.length===0)return null;let e=this.clipBoundaryVertices.map(t=>new c(this.insertPoint.x+this.uVector.x*t.x+this.vVector.x*t.y,this.insertPoint.y+this.uVector.y*t.x+this.vVector.y*t.y,this.insertPoint.z+this.uVector.z*t.x+this.vVector.z*t.y));return E.fromPoints(e)}assignDocument(e){super.assignDocument(e),this._definition=A.updateCollection(this._definition,e.imageDefinitions)}unassignDocument(){super.unassignDocument(),this._definition=this._definition?.clone()??null}_imageDefinitionsOnRemove(e,t){t.item===this._definition&&(this._definition=null)}};T();D();B();var yi=class extends Os{get objectName(){return h.entityImage}get objectType(){return m.UNLISTED}get subclassMarker(){return d.rasterImage}get definition(){return super.definition}set definition(e){if(e==null)throw new Error("value cannot be null");super.definition=e}constructor(e){super(),e&&(this.definition=e)}};te();T();D();B();var Ut=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectImageDefinitionReactor}get subclassMarker(){return d.rasterImageDefReactor}classVersion=2;image=null};B();T();De();bl();T();D();var Ae=class extends A{onAdd=null;onRemove=null;get count(){return this.entries.size}get objectName(){return h.tableEntry}get subclassMarker(){return d.table}entries=new Map;constructor(){super()}add(e){(!e.name||!e.name.trim())&&(e.name=this.createName("unnamed")),this.addEntry(e.name,e)}addRange(e){for(let t of e)this.add(t)}tryAdd(e){let t=this.tryGetValue(e.name);return t!==void 0?t:(this.add(e),e)}contains(e){return this.entries.has(e.toUpperCase())}createDefaultEntries(){for(let e of this.defaultEntries)this.contains(e)}[Symbol.iterator](){return this.entries.values()[Symbol.iterator]()}remove(e){if(this.defaultEntries.some(s=>s.toUpperCase()===e.toUpperCase()))return null;let t=e.toUpperCase(),i=this.entries.get(t);return i?(this.entries.delete(t),i.owner=null,this.onRemove?.(this,new gr(i)),i.onNameChanged=null,i):null}tryGetValue(e){return this.entries.get(e.toUpperCase())}addEntry(e,t){this.entries.set(e.toUpperCase(),t),t.owner=this,t.onNameChanged=(i,s)=>{this._onEntryNameChanged(i,s)},this.onAdd?.(this,new gr(t))}addHandlePrefix(e){e.owner=this,e.onNameChanged=(i,s)=>{this._onEntryNameChanged(i,s)},this.onAdd?.(this,new gr(e));let t=`${e.handle}:${e.name}`;this.entries.set(t.toUpperCase(),e)}createName(e){let t=0;for(;this.entries.has(`${e}${t}`.toUpperCase());)t++;return`${e}${t}`}_onEntryNameChanged(e,t){if(this.defaultEntries.some(s=>s.toUpperCase()===t.oldName.toUpperCase()))throw new Error(`The name ${t.oldName} belongs to a default entry.`);let i=this.entries.get(t.oldName.toUpperCase());i&&(this.entries.set(t.newName.toUpperCase(),i),this.entries.delete(t.oldName.toUpperCase()))}get(e){let t=this.entries.get(e.toUpperCase());if(t===void 0)throw new Error(`Entry '${e}' not found in table.`);return t}};var Dr=class extends Ae{get objectType(){return m.APPID_CONTROL_OBJ}get objectName(){return h.tableAppId}get defaultEntries(){return[Re.defaultName]}createDefaultEntries(){this.contains(Re.defaultName)||this.add(Re.default)}constructor(){super()}};B();T();var Tr=class extends Ae{get objectType(){return m.BLOCK_CONTROL_OBJ}get objectName(){return h.tableBlockRecord}get defaultEntries(){return[U.modelSpaceName,U.paperSpaceName]}constructor(){super()}createDefaultEntries(){this.contains(U.modelSpaceName)||this.add(U.modelSpace),this.contains(U.paperSpaceName)||this.add(U.paperSpace)}add(e){if(e.isAnonymous&&this.contains(e.name)){let t=this.tryGetValue(e.name);if(t&&t===e)throw new Error(`The BlockRecord with name ${e.name} has already been added.`);e.name=this.createName(U.anonymousPrefix)}super.add(e)}};B();T();var Wt=class extends Ae{get objectType(){return m.DIMSTYLE_CONTROL_OBJ}get objectName(){return h.tableDimstyle}get defaultEntries(){return[Q.defaultName]}createDefaultEntries(){this.contains(Q.defaultName)||this.add(Q.default)}constructor(){super()}};B();T();var Sr=class extends Ae{get objectType(){return m.LAYER_CONTROL_OBJ}get objectName(){return h.tableLayer}get defaultEntries(){return[pe.defaultName]}constructor(){super()}createDefaultEntries(){if(!this.contains(pe.defaultName)){let e=pe.default;e.lineType=z.continuous,this.add(e)}}};B();T();var Br=class extends Ae{get objectType(){return m.LTYPE_CONTROL_OBJ}get objectName(){return h.tableLinetype}get byLayer(){return this.get(z.byLayerName)}get byBlock(){return this.get(z.byBlockName)}get continuous(){return this.get(z.continuousName)}get defaultEntries(){return[z.byLayerName,z.byBlockName,z.continuousName]}constructor(){super()}createDefaultEntries(){this.contains(z.byLayerName)||this.add(z.byLayer),this.contains(z.byBlockName)||this.add(z.byBlock),this.contains(z.continuousName)||this.add(z.continuous)}};B();T();var Rr=class extends Ae{get objectType(){return m.STYLE_CONTROL_OBJ}get objectName(){return h.tableStyle}get defaultEntries(){return[oe.defaultName]}createDefaultEntries(){this.contains(oe.defaultName)||this.add(oe.default)}constructor(){super()}};B();T();var Nr=class extends Ae{get objectType(){return m.UCS_CONTROL_OBJ}get objectName(){return h.tableUcs}get defaultEntries(){return[]}constructor(){super()}};B();var ys=class extends Ae{get objectType(){return m.VP_ENT_HDR_CTRL_OBJ}get defaultEntries(){return[]}constructor(){super()}};B();T();var Ar=class extends Ae{get objectType(){return m.VIEW_CONTROL_OBJ}get objectName(){return h.tableView}get defaultEntries(){return[]}constructor(){super()}};B();T();T();D();B();var wa;(function(r){r[r.Optimized2D=0]="Optimized2D",r[r.Wireframe=1]="Wireframe",r[r.HiddenLine=2]="HiddenLine",r[r.FlatShaded=3]="FlatShaded",r[r.GouraudShaded=4]="GouraudShaded",r[r.FlatShadedWithWireframe=5]="FlatShadedWithWireframe",r[r.GouraudShadedWithWireframe=6]="GouraudShadedWithWireframe"})(wa||(wa={}));var Po;(function(r){r[r.OneDistantLight=0]="OneDistantLight",r[r.TwoDistantLights=1]="TwoDistantLights"})(Po||(Po={}));var Oa;(function(r){r[r._0=0]="_0",r[r._1=1]="_1",r[r._2=2]="_2",r[r._3=4]="_3",r[r._4=8]="_4"})(Oa||(Oa={}));var gi;(function(r){r[r.Off=0]="Off",r[r.OnLower=1]="OnLower",r[r.OffOrigin=2]="OffOrigin",r[r.OnOrigin=3]="OnOrigin"})(gi||(gi={}));var de;(function(r){r[r.Off=0]="Off",r[r.PerspectiveView=1]="PerspectiveView",r[r.FrontClipping=2]="FrontClipping",r[r.BackClipping=4]="BackClipping",r[r.Follow=8]="Follow",r[r.FrontClippingZ=16]="FrontClippingZ"})(de||(de={}));function wu(r){let e=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z);return e===0?new c(0,0,0):new c(r.x/e,r.y/e,r.z/e)}var nt=class r extends ye{static defaultName="*Active";get objectType(){return m.VPORT}get objectName(){return h.tableVport}get subclassMarker(){return d.vPort}static get default(){return new r(r.defaultName)}bottomLeft=new g(0,0);topRight=new g(1,1);center=new g(0,0);snapBasePoint=new g(0,0);snapSpacing=new g(.5,.5);gridSpacing=new g(10,10);get direction(){return this._direction}set direction(e){this._direction=wu(e)}target=new c(0,0,0);viewHeight=10;aspectRatio=1;lensLength=50;frontClippingPlane=0;backClippingPlane=0;snapRotation=0;twistAngle=0;circleZoomPercent=1e3;renderMode=wa.Optimized2D;viewMode=de.FrontClippingZ;ucsIconDisplay=gi.OnOrigin;snapOn=!1;showGrid=!0;isometricSnap=!1;snapIsoPair=0;origin=new c(0,0,0);xAxis=new c(1,0,0);yAxis=new c(0,1,0);namedUcs=null;baseUcs=null;orthographicType=lr.None;elevation=0;gridFlags=Oa._1|Oa._2;minorGridLinesPerMajorGridLine=5;visualStyle=null;useDefaultLighting=!0;defaultLighting=Po.TwoDistantLights;brightness=0;contrast=0;ambientColor=new S(0);_direction=new c(0,0,1);constructor(e){super(e)}clone(){let e=super.clone();return e.baseUcs=this.baseUcs?this.baseUcs.clone():null,e.namedUcs=this.namedUcs?this.namedUcs.clone():null,e}};var vr=class extends Ae{get objectType(){return m.VPORT_CONTROL_OBJ}get objectName(){return h.tableVport}get defaultEntries(){return[nt.defaultName]}createDefaultEntries(){this.contains(nt.defaultName)||this.add(nt.default)}constructor(){super()}add(e){this.contains(e.name)?this.addHandlePrefix(e):this.addEntry(e.name,e)}};var v;(function(r){r[r.None=0]="None",r[r.EraseAllowed=1]="EraseAllowed",r[r.TransformAllowed=2]="TransformAllowed",r[r.ColorChangeAllowed=4]="ColorChangeAllowed",r[r.LayerChangeAllowed=8]="LayerChangeAllowed",r[r.LinetypeChangeAllowed=16]="LinetypeChangeAllowed",r[r.LinetypeScaleChangeAllowed=32]="LinetypeScaleChangeAllowed",r[r.VisibilityChangeAllowed=64]="VisibilityChangeAllowed",r[r.CloningAllowed=128]="CloningAllowed",r[r.LineweightChangeAllowed=256]="LineweightChangeAllowed",r[r.PlotStyleNameChangeAllowed=512]="PlotStyleNameChangeAllowed",r[r.AllOperationsExceptCloningAllowed=895]="AllOperationsExceptCloningAllowed",r[r.AllOperationsAllowed=1023]="AllOperationsAllowed",r[r.DisablesProxyWarningDialog=1024]="DisablesProxyWarningDialog",r[r.R13FormatProxy=32768]="R13FormatProxy"})(v||(v={}));var W=class{applicationName="ObjectDBX Classes";classNumber=0;cppClassName="";dwgVersion=0;dxfName="";instanceCount=0;get isAnEntity(){return this._isAnEntity}set isAnEntity(e){e?this._itemClassId=498:this._itemClassId=499,this._isAnEntity=e}get itemClassId(){return this._itemClassId}set itemClassId(e){e===498?this._isAnEntity=!0:this._isAnEntity=!1,this._itemClassId=e}proxyFlags=v.None;wasZombie=!1;maintenanceVersion=0;_isAnEntity=!1;_itemClassId=0;toString(){return`${this.dxfName}:${this.classNumber}`}};D();T();var Gi=class{get count(){return this._entries.size}get isReadOnly(){return!1}_entries=new Map;static updateDxfClasses(e){e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.dictionaryWithDefault,classNumber:500+e.classes.count,dwgVersion:22,dxfName:h.objectDictionaryWithDefault,itemClassId:499,maintenanceVersion:42,proxyFlags:v.R13FormatProxy,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.acDbPlaceHolder,classNumber:500+e.classes.count,dwgVersion:0,dxfName:h.objectPlaceholder,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.layout,classNumber:500+e.classes.count,dwgVersion:0,dxfName:h.objectLayout,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.dictionaryVar,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.objectDictionaryVar,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.tableStyle,classNumber:500+e.classes.count,dwgVersion:u.AC1018,dxfName:h.objectTableStyle,itemClassId:499,maintenanceVersion:0,proxyFlags:4095,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.material,classNumber:500+e.classes.count,dwgVersion:0,dxfName:h.objectMaterial,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.visualStyle,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.objectVisualStyle,itemClassId:499,maintenanceVersion:0,proxyFlags:4095,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.scale,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.objectScale,itemClassId:499,maintenanceVersion:1,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.mLeaderStyle,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.objectMLeaderStyle,itemClassId:499,maintenanceVersion:25,proxyFlags:4095,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.cellStyleMap,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.objectCellStyleMap,itemClassId:499,maintenanceVersion:25,proxyFlags:v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"ExAcXREFPanelObject",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"EXACXREFPANELOBJECT",itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbImpNonPersistentObjectsCollection",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"NPOCOLLECTION",itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbLayerIndex",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"LAYER_INDEX",itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbSpatialIndex",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"SPATIAL_INDEX",itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbIdBuffer",classNumber:500+e.classes.count,dwgVersion:u.AC1014,dxfName:"IDBUFFER",itemClassId:499,maintenanceVersion:0,proxyFlags:v.R13FormatProxy,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbSectionViewStyle",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"ACDBSECTIONVIEWSTYLE",itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbDetailViewStyle",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"ACDBDETAILVIEWSTYLE",itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.mesh,classNumber:500+e.classes.count,dwgVersion:0,dxfName:h.entityMesh,itemClassId:498,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.sortentsTable,classNumber:500+e.classes.count,dwgVersion:u.AC1014,dxfName:h.objectSortEntsTable,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbTextObjectContextData",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"ACDB_TEXTOBJECTCONTEXTDATA_CLASS",itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"WipeOut",cppClassName:d.wipeout,classNumber:500+e.classes.count,dwgVersion:u.AC1015,dxfName:h.entityWipeout,itemClassId:498,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.TransformAllowed|v.ColorChangeAllowed|v.LayerChangeAllowed|v.LinetypeChangeAllowed|v.LinetypeScaleChangeAllowed|v.VisibilityChangeAllowed|v.R13FormatProxy,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"WipeOut",cppClassName:"AcDbWipeoutVariables",classNumber:500+e.classes.count,dwgVersion:u.AC1015,dxfName:"WIPEOUTVARIABLES",itemClassId:499,maintenanceVersion:0,proxyFlags:v.R13FormatProxy,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"AcDbDimAssoc",cppClassName:"AcDbDimAssoc",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"DIMASSOC",itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.tableEntity,classNumber:500+e.classes.count,dwgVersion:u.AC1018,dxfName:h.entityTable,itemClassId:498,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.tableContent,classNumber:500+e.classes.count,dwgVersion:u.AC1018,dxfName:h.objectTableContent,itemClassId:499,maintenanceVersion:21,proxyFlags:v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:"AcDbTableGeometry",classNumber:500+e.classes.count,dwgVersion:0,dxfName:"TABLEGEOMETRY",itemClassId:499,maintenanceVersion:0,proxyFlags:v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"ISM",cppClassName:d.rasterImage,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.entityImage,itemClassId:498,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.TransformAllowed|v.ColorChangeAllowed|v.LayerChangeAllowed|v.LinetypeChangeAllowed|v.LinetypeScaleChangeAllowed|v.VisibilityChangeAllowed|v.R13FormatProxy,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"ISM",cppClassName:d.rasterImageDef,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.objectImageDefinition,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"ISM",cppClassName:d.rasterImageDefReactor,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.objectImageDefinitionReactor,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.dbColor,classNumber:500+e.classes.count,dwgVersion:u.AC1015,dxfName:h.objectDBColor,itemClassId:499,maintenanceVersion:14,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.geoData,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.objectGeoData,itemClassId:499,maintenanceVersion:45,proxyFlags:4095,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.multiLeader,classNumber:500+e.classes.count,dwgVersion:u.MC0_0,dxfName:h.entityMultiLeader,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.pdfReference,classNumber:500+e.classes.count,dwgVersion:26,dxfName:h.entityPdfUnderlay,itemClassId:498,maintenanceVersion:0,proxyFlags:4095,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.pdfDefinition,classNumber:500+e.classes.count,dwgVersion:26,dxfName:h.objectPdfDefinition,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{applicationName:"ISM",cppClassName:d.rasterVariables,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.objectRasterVariables,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.spatialFilter,classNumber:500+e.classes.count,dwgVersion:20,dxfName:h.objectSpatialFilter,itemClassId:499,maintenanceVersion:0,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.multiLeaderObjectContextData,classNumber:500+e.classes.count,dwgVersion:u.MC0_0,dxfName:h.objectMLeaderContextData,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.plotSettings,classNumber:500+e.classes.count,dwgVersion:u.AC1015,dxfName:h.objectPlotSettings,itemClassId:499,maintenanceVersion:42,proxyFlags:v.None,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.field,classNumber:500+e.classes.count,dwgVersion:u.AC1018,dxfName:h.objectField,itemClassId:499,maintenanceVersion:0,proxyFlags:v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.fieldList,classNumber:500+e.classes.count,dwgVersion:u.AC1018,dxfName:h.objectFieldList,itemClassId:499,maintenanceVersion:0,proxyFlags:v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.mTextAttributeObjectContextData,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.mTextAttributeObjectContextData,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1})),e.classes.addOrUpdate(Object.assign(new W,{cppClassName:d.blkRefObjectContextData,classNumber:500+e.classes.count,dwgVersion:u.AC1021,dxfName:h.blkRefObjectContextData,itemClassId:499,maintenanceVersion:0,proxyFlags:v.EraseAllowed|v.CloningAllowed|v.DisablesProxyWarningDialog,wasZombie:!1}))}add(e){this._entries.set(e.dxfName.toUpperCase(),e)}addOrUpdate(e){let t=e.dxfName.toUpperCase(),i=this._entries.get(t);i?i.instanceCount=e.instanceCount:this._entries.set(t,e)}clear(){this._entries.clear()}containsByName(e){return this._entries.has(e.toUpperCase())}contains(e){for(let t of this._entries.values())if(t===e)return!0;return!1}copyTo(e,t){let i=t;for(let s of this._entries.values())e[i++]=s}getByClassNumber(e){for(let t of this._entries.values())if(t.classNumber===e)return t;return null}getByName(e){return this._entries.get(e.toUpperCase())??null}[Symbol.iterator](){return this._entries.values()}remove(e){return this._entries.delete(e.dxfName.toUpperCase())}tryGetByClassNumber(e){for(let t of this._entries.values())if(t.classNumber===e)return{result:t,found:!0};return{result:null,found:!1}}tryGetByName(e){let t=this._entries.get(e.toUpperCase());return t?{result:t,found:!0}:{result:null,found:!1}}};function Vd(r){return r!=null&&typeof r=="object"&&Symbol.iterator in r}function Hd(r){return r!=null&&typeof r=="object"&&"onAdd"in r&&"onRemove"in r}function Jh(r){return r!=null&&typeof r=="object"&&"onSeqendAdded"in r&&"onSeqendRemoved"in r&&"seqend"in r}function Qh(r){return r!=null&&typeof r=="object"&&"blockEntity"in r&&r.blockEntity instanceof A&&"blockEnd"in r&&r.blockEnd instanceof A}function _u(r){return r!=null&&typeof r=="object"&&"entities"in r&&Hd(r.entities)&&Vd(r.entities)}var Is=class{appIds=null;blockRecords=null;classes=null;colors=null;dictionaryVariables=null;dimensionStyles=null;get entities(){return this.modelSpace?.entities??null}groups=null;get handle(){return 0}header=null;imageDefinitions=null;layers=null;layouts=null;lineTypes=null;materials=null;mLeaderStyles=null;mLineStyles=null;get modelSpace(){return this.blockRecords?.tryGetValue(U.modelSpaceName)??null}get paperSpace(){return this.blockRecords?.tryGetValue(U.paperSpaceName)??null}pdfDefinitions=null;get rootDictionary(){return this._rootDictionary}set rootDictionary(e){if(e==null){this._rootDictionary=null;return}this._rootDictionary=e,this._rootDictionary.owner=this,this.registerCollection(this._rootDictionary)}scales=null;summaryInfo=null;tableStyles=null;textStyles=null;uCSs=null;views=null;vPorts=null;vEntityControl=null;_cadObjects=new Map;_rootDictionary=null;constructor(e,t=!0){this._cadObjects.set(this.handle,this),t&&this.createDefaults(),e!==void 0&&this.header!=null&&(this.header.version=e)}createDefaults(){this.header==null&&(this.header=new Nt(this)),this.summaryInfo=new wi,this.classes==null&&(this.classes=new Gi),Gi.updateDxfClasses(this),this.rootDictionary==null&&(this.rootDictionary=re.createRoot()),this.appIds==null&&this.registerCollection(new Dr),this.blockRecords==null&&this.registerCollection(new Tr),this.dimensionStyles==null&&this.registerCollection(new Wt),this.layers==null&&this.registerCollection(new Sr),this.lineTypes==null&&this.registerCollection(new Br),this.textStyles==null&&this.registerCollection(new Rr),this.uCSs==null&&this.registerCollection(new Nr),this.views==null&&this.registerCollection(new Ar),this.vPorts==null&&this.registerCollection(new vr),this.lineTypes&&typeof this.lineTypes.createDefaultEntries=="function"&&this.lineTypes.createDefaultEntries(),this.layers&&typeof this.layers.createDefaultEntries=="function"&&this.layers.createDefaultEntries(),this.blockRecords&&typeof this.blockRecords.createDefaultEntries=="function"&&this.blockRecords.createDefaultEntries(),this.textStyles&&typeof this.textStyles.createDefaultEntries=="function"&&this.textStyles.createDefaultEntries(),this.dimensionStyles&&typeof this.dimensionStyles.createDefaultEntries=="function"&&this.dimensionStyles.createDefaultEntries(),this.appIds&&typeof this.appIds.createDefaultEntries=="function"&&this.appIds.createDefaultEntries(),this.vPorts&&typeof this.vPorts.createDefaultEntries=="function"&&this.vPorts.createDefaultEntries()}getCadObject(e){return this._cadObjects.get(e)??null}tryGetCadObject(e){if(e===this.handle)return{found:!1,cadObject:null};let t=this._cadObjects.get(e);return t?{found:!0,cadObject:t}:{found:!1,cadObject:null}}restoreHandles(){let e=[...this._cadObjects.values()];this._cadObjects.clear(),this.header.handleSeed=0;let t=1;this._cadObjects.set(0,this);for(let i=1;ii instanceof A).filter(i=>i.objectName===t.dxfName).length}updateImageReactors(){let e=Array.from(this._cadObjects.values()).filter(a=>a instanceof Ut),t=new Map;for(let a of e){let n=a.image?.handle;n!=null&&n!==0&&!t.has(n)&&t.set(n,a)}let i=Array.from(this._cadObjects.values()).filter(a=>a instanceof yi),s=new Set;for(let a of i){if(a.definition==null){a.definitionReactor=null;continue}let n=a.definitionReactor??t.get(a.handle)??new Ut;n.owner=a,n.image=a,a.definitionReactor=n,s.add(n),n.document==null&&this._addCadObject(n),a.definition.reactors.includes(n)||a.definition.addReactor(n)}for(let a of e)s.has(a)||this._removeCadObject(a)}registerCollection(e){if(e!=null&&(e instanceof A&&(e.owner==null&&(e.owner=this),e.document==null&&this._addCadObject(e)),Hd(e)&&(e.onAdd=this._onAdd.bind(this),e.onRemove=this._onRemove.bind(this)),e instanceof Dr?this.appIds=e:e instanceof Tr?this.blockRecords=e:e instanceof Wt?this.dimensionStyles=e:e instanceof Sr?this.layers=e:e instanceof Br?this.lineTypes=e:e instanceof Rr?this.textStyles=e:e instanceof Nr?this.uCSs=e:e instanceof Ar?this.views=e:e instanceof ys?this.vEntityControl=e:e instanceof vr&&(this.vPorts=e),Vd(e)))for(let t of e)this._wireCollectionItem(t)}unregisterCollection(e){if(e!=null){if(e instanceof Dr||e instanceof Tr||e instanceof Wt||e instanceof Sr||e instanceof Br||e instanceof Rr||e instanceof Nr||e instanceof Ar||e instanceof ys||e instanceof vr)throw new Error(`The collection ${e.constructor?.name??typeof e} cannot be removed from a document.`);if(Hd(e)&&(e.onAdd=null,e.onRemove=null),e instanceof A&&this._removeCadObject(e),Jh(e)&&(e.onSeqendAdded=null,e.onSeqendRemoved=null),Jh(e)&&e.seqend instanceof A&&this._removeCadObject(e.seqend),!!Vd(e))for(let t of e)t instanceof re?this.unregisterCollection(t):t instanceof A&&this._removeCadObject(t)}}_addCadObject(e){if(e.document!=null)throw new Error(`The item with handle ${e.handle} is already assigned to a document`);if(e.handle===0||this._cadObjects.has(e.handle)){let t=this.header?.handleSeed??this._cadObjects.size;e.handle=t,this.header&&(this.header.handleSeed=t+1)}else this.header&&e.handle>=this.header.handleSeed&&(this.header.handleSeed=e.handle+1);this._cadObjects.set(e.handle,e),e.assignDocument(this)}_onAdd(e,t){this._wireCollectionItem(t.item)}_onRemove(e,t){this._unregisterBlockMarkers(t.item),this._removeCadObject(t.item)}_registerBlockMarkers(e){if(Qh(e))for(let t of[e.blockEntity,e.blockEnd])t instanceof A&&t.document==null&&this._addCadObject(t)}_unregisterBlockMarkers(e){if(Qh(e))for(let t of[e.blockEntity,e.blockEnd])t instanceof A&&t.document===this&&this._removeCadObject(t)}_removeCadObject(e){!this.tryGetCadObject(e.handle).found||!this._cadObjects.delete(e.handle)||e.unassignDocument()}_updateCollectionDict(e,t){let i=this.rootDictionary?.getEntry(e)??null;return!i&&t&&this.rootDictionary&&(i=new re(e),this.rootDictionary.add(i)),{success:i!=null,dictionary:i}}_wireCollectionItem(e){if(e instanceof re){this.registerCollection(e);return}e instanceof A&&e.document==null&&this._addCadObject(e),this._registerBlockMarkers(e),this._wireEntityCollection(e)}_wireEntityCollection(e){if(!_u(e))return;let t=e.entities;t.onAdd=this._onAdd.bind(this),t.onRemove=this._onRemove.bind(this);for(let i of t)i instanceof A&&i.document==null&&this._addCadObject(i)}};De();var V;(function(r){r[r.Unknown=0]="Unknown",r[r.Long=1]="Long",r[r.Double=2]="Double",r[r.String=4]="String",r[r.Date=8]="Date",r[r.Point2D=16]="Point2D",r[r.Point3D=32]="Point3D",r[r.Handle=64]="Handle",r[r.Buffer=128]="Buffer",r[r.ResultBuffer=256]="ResultBuffer",r[r.General=512]="General"})(V||(V={}));var Lo;(function(r){r[r.NoUnits=0]="NoUnits",r[r.Distance=1]="Distance",r[r.Angle=2]="Angle",r[r.Area=4]="Area",r[r.Volume=8]="Volume",r[r.Currency=16]="Currency",r[r.Percentage=32]="Percentage"})(Lo||(Lo={}));var vt=class{flags=0;format="";formattedValue="";get isEmpty(){return(this.flags&1)!==0}set isEmpty(e){e?this.flags|=1:this.flags&=-2}units=Lo.NoUnits;value=null;valueType=V.Unknown;setValue(e,t){switch(t!==void 0&&(this.valueType=t),this.valueType){case V.Point2D:case V.Point3D:case V.Long:case V.Double:case V.Date:case V.Handle:case V.String:case V.General:this.value=e;break;case V.Unknown:case V.Buffer:case V.ResultBuffer:default:throw new Error("Invalid operation for value type")}}toString(){return`${this.valueType}:${this.value}`}};bl();var _a=class r{code;rawHeader;rawImage;constructor(e,t,i){this.code=e??r.PreviewType.Unknown,this.rawHeader=t??new Uint8Array(0),this.rawImage=i??new Uint8Array(0)}toBytes(){let e=!1;switch(this.code){case r.PreviewType.Bmp:case r.PreviewType.Wmf:case r.PreviewType.Png:e=!1;break;case r.PreviewType.Unknown:default:throw new Error(`Preview with code ${this.code} not supported.`)}if(e&&this.rawHeader.length>0){let t=new Uint8Array(this.rawHeader.length+this.rawImage.length);return t.set(this.rawHeader),t.set(this.rawImage,this.rawHeader.length),t}return this.rawImage.slice()}};(function(r){let e;(function(t){t[t.Unknown=0]="Unknown",t[t.Bmp=2]="Bmp",t[t.Wmf=3]="Wmf",t[t.Png=6]="Png"})(e=r.PreviewType||(r.PreviewType={}))})(_a||(_a={}));ie();ht();var ot=class extends le{constructor(e){super(w.ExtendedDataInteger16,e)}};ie();ht();var Er=class extends le{constructor(e){super(w.ExtendedDataBinaryChunk,e)}};ie();ht();var kr=class extends le{constructor(e){super(w.ExtendedDataXCoordinate,e)}};ie();ht();var Pr=class extends le{constructor(e){super(w.ExtendedDataInteger32,e)}};ie();ht();var Lr=class extends le{constructor(e){super(w.ExtendedDataReal,e)}};ht();ie();ht();var jr=class extends le{constructor(e){super(w.ExtendedDataAsciiString,e)}};Ii.create=function(e,t){switch(e){case f.Bool:return new ot(t===!0?1:0);case f.Point3D:return new kr(t);case f.Handle:case f.ObjectId:case f.ExtendedDataHandle:return new Vi(Number(t));case f.String:case f.Comment:case f.ExtendedDataString:return new jr(String(t));case f.Chunk:case f.ExtendedDataChunk:return new Er(t instanceof Uint8Array?t:new Uint8Array(t));case f.Double:case f.ExtendedDataDouble:return new Lr(Number(t));case f.Int16:case f.ExtendedDataInt16:return new ot(Number(t));case f.Int32:case f.ExtendedDataInt32:return new Pr(Number(t));case f.None:case f.Byte:case f.Int64:default:throw new Error(`Unsupported extended data group code: ${e}`)}};ht();var Ml=class extends ja{constructor(e,t,i){if(typeof e=="object")super(e);else if(typeof e=="string")super(e,t);else if(typeof t=="object"&&!Array.isArray(t)){if(super(t),!t.valueCodes.includes(e))throw new Error(`The property ${t.propertyName} does not have a mapping for code ${e}`);this._assignedCode=e}else super(t,i??[e]),this._assignedCode=e}getCollectionCodes(){return this._collectionCodes?[...this._collectionCodes]:null}getValue(e){return this.getPropertyValue(e)}toXDataRecords(){return this.storedValue===null||this.storedValue===void 0?[]:[new ot(this.assignedCode),Ii.create(this.groupCode,this.storedValue)]}toString(){let e="";for(let t of this.dxfCodes)e+=`${t}:`;return e+=this._propertyName,e}};var Ia=class r{name="";dxfProperties=new Map;static addClassProperties(e,t,i){for(let[s,a]of r.cadObjectMapDxf(t))e.dxfProperties.set(s,a),i!=null&&(a.storedValue=a.getRawValue(i))}static*cadObjectMapDxf(e){for(let t of md(e))for(let i of t.valueCodes)yield[i,new Ml(i,t)]}};var L=class r extends Ia{static _cache=new Map;constructor(e){if(super(),e instanceof r){this.name=e.name;for(let[t,i]of e.dxfProperties)this.dxfProperties.set(t,i)}else typeof e=="string"&&(this.name=e)}static createFromType(e,t){if(r._cache.has(e))return new r(r._cache.get(e));let i=new r,s=fa(e);if(!t&&s?.dxfSubClassName==null)throw new Error(`${e} is not a DXF subclass`);i.name=t??s?.dxfSubClassName??e,r.addClassProperties(i,e);let a=s?.baseTypeName?fa(s.baseTypeName):void 0;return a?.dxfSubClassIsEmpty&&r.addClassProperties(i,a.typeName),r._cache.set(e,i),new r(i)}static create(e,t){let i=typeof e=="string"?e:e.name;return r.createFromType(i,t)}clearCache(){r._cache.clear()}toString(){return`DxfClassMap:${this.name}`}};ie();T();var Ie=class r extends Ia{static _cache=new Map;subClasses=new Map;static create(e,t){let i=typeof e=="string"?e:e.name;if(r._cache.has(i))return r._clone(r._cache.get(i),t);let s=new r,a=fa(i);s.name=t??a?.dxfName??"";let n=!1,o=a;for(;o;){if(o.typeName==="DimensionStyle"&&(n=!0),o.typeName==="CadObject"){r.addClassProperties(s,o.typeName);break}if(o.dxfSubClassName&&o.dxfSubClassIsEmpty){let l=[...s.subClasses.values()].at(-1);l&&r.addClassProperties(l,o.typeName),s.subClasses.set(o.dxfSubClassName,new L(o.dxfSubClassName))}else if(o.dxfSubClassName){let l=new L(o.dxfSubClassName);r.addClassProperties(l,o.typeName),s.subClasses.set(l.name,l)}o=o.baseTypeName?fa(o.baseTypeName):void 0}return n&&s.dxfProperties.has(5)&&(s.dxfProperties.set(105,s.dxfProperties.get(5)),s.dxfProperties.delete(5)),s.subClasses.size>1&&(s.subClasses=new Map([...s.subClasses.entries()].reverse())),r._cache.set(i,s),r._clone(s,t)}static clearCache(){r._cache.clear()}toString(){return`DxfMap:${this.name}`}static _clone(e,t){let i=new r;i.name=t??e.name;for(let[s,a]of e.dxfProperties)i.dxfProperties.set(s,a);for(let[s,a]of e.subClasses)i.subClasses.set(s,a);return i}};D();B();T();D();var pd;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right",r[r.Baseline=3]="Baseline"})(pd||(pd={}));var Ma=class extends N{baseHeight=0;binRecord=null;binRecordHandle=0;cleanupGroup=null;cleanupGroupHandle=0;endPoint=new c;height=0;justification=pd.Baseline;length=0;normal=new c(0,0,1);rawData=null;startPoint=new c;style=null;version=0;width=0;get objectName(){return h.entityAecWall}get objectType(){return m.UNLISTED}get subclassMarker(){return d.aecWall}getBoundingBox(){throw new Error("Not implemented")}applyTransform(e){}};T();D();B();var Et=class extends N{center=new c(0,0,0);normal=new c(0,0,1);get objectName(){return h.entityCircle}get objectType(){return m.CIRCLE}get radius(){return this._radius}set radius(e){if(e<=0)throw new Error("The radius must be greater than 0.");this._radius=e}get radiusRatio(){return 1}get subclassMarker(){return d.circle}thickness=0;_radius=1;constructor(){super()}applyTransform(e){if(!(e instanceof Z))return;this.center=this.applyTransformToPoint(e,this.center),this.normal=this.applyTransformToVector(e,this.normal).normalize();let t=this.getTransformAxisScale(e);this.radius*=(t.x+t.y)/2}getBoundingBox(){let e=new c(this.center.x-this._radius,this.center.y-this._radius,this.center.z),t=new c(this.center.x+this._radius,this.center.y+this._radius,this.center.z);return new E(e,t)}polarCoordinateRelativeToCenter(e){return new c(this.center.x+this._radius*Math.cos(e),this.center.y+this._radius*Math.sin(e),this.center.z)}polygonalVertexes(e){if(e<2)throw new Error("The arc precision must be equal or greater than two.");let t=[],i=Math.PI*2/e;for(let s=0;s0&&(x-=Math.PI*2):x<0&&(x+=Math.PI*2),Math.tan(x/4)}static getBulgeFromAngle(e){return Math.tan(e/4)}static getCenter(e,t,i){let s=4*Math.atan(Math.abs(i)),a=t.x-e.x,n=t.y-e.y,l=Math.sqrt(a*a+n*n)/2/Math.sin(s/2),p=(Math.PI-s)/2,b=Math.atan2(n,a)+Math.sign(i)*p;return{center:new g(e.x+l*Math.cos(b),e.y+l*Math.sin(b)),radius:l}}applyTransform(e){e instanceof Z&&(super.applyTransform(e),this.startAngle+=e.eulerRotation.z,this.endAngle+=e.eulerRotation.z)}getBoundingBox(){let e=this.polygonalVertexes(64);return e.length>0?E.fromPoints(e):null}getEndVertices(){let e=this.polarCoordinateRelativeToCenter(this.startAngle),t=this.polarCoordinateRelativeToCenter(this.endAngle);return{start:e,end:t}}polygonalVertexes(e){if(e<2)throw new Error("The arc precision must be equal or greater than two.");let t=this.startAngle,i=this.endAngle;ithis.applyTransformToPoint(e,i)),t.translation=this.applyTransformToPoint(e,t.translation),t.xAxis=this.applyTransformToVector(e,t.xAxis),t.yAxis=this.applyTransformToVector(e,t.yAxis),t.zAxis=this.applyTransformToVector(e,t.zAxis);for(let t of this.silhouettes){t.viewportDirectionFromTarget=this.applyTransformToVector(e,t.viewportDirectionFromTarget),t.viewportTarget=this.applyTransformToPoint(e,t.viewportTarget),t.viewportUpDirection=this.applyTransformToVector(e,t.viewportUpDirection);for(let i of t.wires)i.points=i.points.map(s=>this.applyTransformToPoint(e,s)),i.translation=this.applyTransformToPoint(e,i.translation),i.xAxis=this.applyTransformToVector(e,i.xAxis),i.yAxis=this.applyTransformToVector(e,i.yAxis),i.zAxis=this.applyTransformToVector(e,i.zAxis)}}getBoundingBox(){let e=[this.point];for(let t of this.wires)e.push(...t.points);for(let t of this.silhouettes){e.push(t.viewportTarget);for(let i of t.wires)e.push(...i.points)}return E.fromPoints(e)}};T();B();var gs=class extends Ms{get objectType(){return m.BODY}get objectName(){return h.entityBody}};var dr;(function(r){r[r.NoColumns=0]="NoColumns",r[r.StaticColumns=1]="StaticColumns",r[r.DynamicColumns=2]="DynamicColumns"})(dr||(dr={}));De();D();var G;(function(r){r[r.Linear=0]="Linear",r[r.Aligned=1]="Aligned",r[r.Angular=2]="Angular",r[r.Diameter=3]="Diameter",r[r.Radius=4]="Radius",r[r.Angular3Point=5]="Angular3Point",r[r.Ordinate=6]="Ordinate",r[r.BlockReference=32]="BlockReference",r[r.OrdinateTypeX=64]="OrdinateTypeX",r[r.TextUserDefinedLocation=128]="TextUserDefinedLocation"})(G||(G={}));var ba;(function(r){r[r.None=0]="None",r[r.AtLeast=1]="AtLeast",r[r.Exact=2]="Exact"})(ba||(ba={}));T();D();B();var Me=class extends N{endPoint=new c(0,0,0);normal=new c(0,0,1);get objectName(){return h.entityLine}get objectType(){return m.LINE}startPoint=new c(0,0,0);get subclassMarker(){return d.line}thickness=0;constructor(e,t){super(),e&&(this.startPoint=e),t&&(this.endPoint=t)}applyTransform(e){this.startPoint=this.applyTransformToPoint(e,this.startPoint),this.endPoint=this.applyTransformToPoint(e,this.endPoint),this.normal=this.applyTransformToVector(e,this.normal).normalize()}getBoundingBox(){return E.fromPoints([this.startPoint,this.endPoint])}};De();T();D();B();var Oo;(function(r){r[r.LeftToRight=1]="LeftToRight",r[r.RightToLeft=2]="RightToLeft",r[r.TopToBottom=3]="TopToBottom",r[r.BottomToTop=4]="BottomToTop",r[r.ByStyle=5]="ByStyle"})(Oo||(Oo={}));var Hl=class r{static parse(e){let t=[];if(!e)return{result:e,groups:t};let i="",s=0,a=!1;for(;s0?e[s-1]:void 0,o=e[s],l=s+1i){let b=e.substring(i,a);s&&b.includes("}")&&(b=b.replace(/}/g,""),s=!1),t+=b}let p;switch(l){case"f":case"F":p=r._processFont(e,a),a=p;break;case"c":case"C":p=r._processColor(e,a),a=p;break;case"P":case"n":t+=` `,a+=2;break;case"r":break;case"}":case"{":case"\\":t+=l;break}i=a}return t}static _processFont(e,t){let i=e.indexOf(";",t);return i+=1,i}static _jump(e,t){let i=e.indexOf(";",t);return i+=1,i}static _processColor(e,t){let i=e.indexOf(";",t);return i+=1,i}static _processHeight(e,t){let i=e.indexOf(";",t);return i+=1,i}static _processJustification(e,t){let i=e.indexOf(";",t);return i+=1,i}};var fd=class r{columnType=dr.NoColumns;columnCount=0;flowReversed=!1;autoHeight=!1;width=0;gutter=0;heights=[];clone(){let e=new r;return e.columnType=this.columnType,e.columnCount=this.columnCount,e.flowReversed=this.flowReversed,e.autoHeight=this.autoHeight,e.width=this.width,e.gutter=this.gutter,e.heights=[...this.heights],e}},ve=class extends N{alignmentPoint=new c(0,0,0);attachmentPoint=se.TopLeft;backgroundColor=null;backgroundFillFlags=Or.None;backgroundScale=1.5;backgroundTransparency=0;get columnData(){return this._columnData}set columnData(e){this._columnData=e}drawingDirection=Oo.LeftToRight;get hasColumns(){return this._columnData!=null&&this._columnData.columnType!==dr.NoColumns}get height(){return this._height}set height(e){if(e<=0)throw new Error("The text height must be greater than zero.");this._height=e}horizontalWidth=.9;insertPoint=new c(0,0,0);isAnnotative=!1;lineSpacing=1;lineSpacingStyle=ba.AtLeast;normal=new c(0,0,1);get objectName(){return h.entityMText}get objectType(){return m.MTEXT}get plainText(){return Hl.parse(this._value).result}rectangleHeight=0;rectangleWidth=0;get rotation(){return Math.atan2(this.alignmentPoint.y,this.alignmentPoint.x)}set rotation(e){this.alignmentPoint=new c(Math.cos(e),Math.sin(e),0)}get style(){return this._style}set style(e){if(e==null)throw new Error("value cannot be null");this.document!=null?this._style=A.updateCollection(e,this.document.textStyles):this._style=e}get subclassMarker(){return d.mText}get value(){return this._value}set value(e){this._value=e}verticalHeight=.2;_height=1;_style=oe.default;_value="";_columnData=new fd;constructor(){super()}applyTransform(e){if(!(e instanceof Z))return;this.insertPoint=this.applyTransformToPoint(e,this.insertPoint);let t=this.applyTransformToVector(e,this.alignmentPoint);t.getLength()>0&&(this.alignmentPoint=t.normalize()),this.normal=this.transformNormal(e,this.normal);let i=this.getTransformAxisScale(e),s=i.x===0?1:i.x,a=i.y===0?1:i.y;this.height*=a,this.horizontalWidth*=s,this.rectangleWidth*=s,this.rectangleHeight*=a,this.verticalHeight*=a}clone(){let e=super.clone();return e._style=this._style.clone(),this._columnData&&(e._columnData=this._columnData.clone()),e}getBoundingBox(){let e=this.getPlainTextLines(),t=Math.max(1,e.length),i=this.rectangleWidth>0?this.rectangleWidth:Math.max(...e.map(p=>p.length),0)*this.height*this.horizontalWidth*.6,s=this.rectangleHeight>0?this.rectangleHeight:this.height*(1+(t-1)*this.lineSpacing),a=0;switch(this.attachmentPoint){case se.TopCenter:case se.MiddleCenter:case se.BottomCenter:a=-i/2;break;case se.TopRight:case se.MiddleRight:case se.BottomRight:a=-i;break}let n=0;switch(this.attachmentPoint){case se.MiddleLeft:case se.MiddleCenter:case se.MiddleRight:n=-s/2;break;case se.BottomLeft:case se.BottomCenter:case se.BottomRight:n=-s;break}let o=this.rotation,l=[new g(a,n),new g(a+i,n),new g(a,n+s),new g(a+i,n+s)].map(p=>{let b=g.rotate(p,o);return new c(this.insertPoint.x+b.x,this.insertPoint.y+b.y,this.insertPoint.z)});return E.fromPoints(l)}getPlainTextLines(){return this.plainText.split(/\r\n|\r|\n/)}getTextLines(){return this._value.replace(/\\P/gi,` `).split(/\r\n|\r|\n/)}assignDocument(e){super.assignDocument(e),this._style=A.updateCollection(this._style,e.textStyles)}unassignDocument(){super.unassignDocument(),this._style=this._style.clone()}_tableOnRemove(e,t){super._tableOnRemove(e,t),t.item===this._style&&(this._style=this.document.textStyles.get(oe.defaultName))}};T();D();B();var kt=class extends N{location=new c(0,0,0);normal=new c(0,0,1);get objectName(){return h.entityPoint}get objectType(){return m.POINT}rotation=0;get subclassMarker(){return d.point}thickness=0;constructor(e){super(),e&&(this.location=e)}applyTransform(e){this.location=this.applyTransformToPoint(e,this.location),this.normal=this.applyTransformToVector(e,this.normal).normalize()}getBoundingBox(){return E.fromPoints([this.location])}};_l();var K=class r extends N{attachmentPoint=se.TopLeft;get block(){return this._block}set block(e){this.document!=null?this._block=A.updateCollection(e,this.document.blockRecords):this._block=e}definitionPoint=new c(0,0,0);get flags(){return this._flags}set flags(e){this._flags=e}flipArrow1=!1;flipArrow2=!1;get hasStyleOverride(){for(let[e,t]of this.extendedData.getExtendedDataByName())if(t.records.length>0&&(e===Re.defaultName.toUpperCase()||e.startsWith(`${Re.defaultName.toUpperCase()}_DSTYLE`)))return!0;return!1}horizontalDirection=0;insertionPoint=new c(0,0,0);get isAngular(){return(this._flags&G.Angular3Point)!==0||(this._flags&G.Angular)!==0}get isTextUserDefinedLocation(){return(this._flags&G.TextUserDefinedLocation)!==0}set isTextUserDefinedLocation(e){e?this._flags=this._flags|G.TextUserDefinedLocation:this._flags=this._flags&~G.TextUserDefinedLocation}lineSpacingFactor=0;lineSpacingStyle=ba.AtLeast;normal=new c(0,0,1);get style(){return this._style}set style(e){if(e==null)throw new Error("value cannot be null");this.document!=null?this._style=A.updateCollection(e,this.document.dimensionStyles):this._style=e}get subclassMarker(){return d.dimension}text="";textMiddlePoint=new c(0,0,0);textRotation=0;version=0;_block=null;_flags;_style=Q.default;constructor(e){super(),this._flags=e,this._flags|=G.BlockReference}applyTransform(e){this.definitionPoint=this.applyTransformToPoint(e,this.definitionPoint),this.insertionPoint=this.applyTransformToPoint(e,this.insertionPoint),this.textMiddlePoint=this.applyTransformToPoint(e,this.textMiddlePoint),this.normal=this.applyTransformToVector(e,this.normal).normalize();let t=e?.eulerRotation?.z;typeof t=="number"&&(this.textRotation+=t)}clone(){let e=super.clone();return e._style=this._style.clone(),e._block=this._block?.clone()??null,e}getActiveDimensionStyle(){if(!this.hasStyleOverride)return this.style;let e=this.style.clone(),t=this.getStyleOverrideMap();if(t==null)return e;let i=L.create(Q);for(let[s,a]of t){let n=i.dxfProperties.get(s);n?.setValue(s,e,a)}return e}getMeasurementText(e){let t=e??this.getActiveDimensionStyle(),i=this._formatMeasurement(this.measurement,t);return this.text.length>0?this.text.includes("<>")?this.text.replace(/<>/g,i):this.text:`${t.prefix}${i}${t.suffix}`}getStyleOverrideMap(){let e=new Map,t=L.create(Q);for(let[i,s]of this.extendedData.getExtendedDataByName())if(!(i!==Re.defaultName.toUpperCase()&&!i.startsWith(`${Re.defaultName.toUpperCase()}_${Q.styleOverrideEntryName}`)))for(let a=0;a0?e:null}setDimensionOverride(e){let t=this.style,i=L.create(Q),s=new Map;for(let[a,n]of i.dxfProperties){let o=n.getRawValue(t),l=n.getRawValue(e);l!=null&&l!==o&&s.set(a,l)}this.setStyleOverrideMap(s)}setStyleOverrideMap(e){let t=`${Re.defaultName}_${Q.styleOverrideEntryName}`,i=[];if(e!=null){let n=L.create(Q);for(let[o,l]of e){let p=n.dxfProperties.get(o);p!=null&&(p.storedValue=l,i.push(...p.toXDataRecords()))}}let s=this.extendedData.tryGetByName(t);if(e==null||e.size===0){if(s.found&&s.value!=null)for(let[n]of this.extendedData)n.name.toUpperCase()===t.toUpperCase()&&this.extendedData.set(n,new hi);return}let a=new hi(i);if(s.found){for(let[n]of this.extendedData)n.name.toUpperCase()===t.toUpperCase()&&this.extendedData.set(n,a);return}this.extendedData.addByName(t,a)}updateBlock(){this.createBlock()}assignDocument(e){super.assignDocument(e),this._style=A.updateCollection(this._style,e.dimensionStyles),this._block=A.updateCollection(this._block,e.blockRecords),this._block!=null&&(this._block.name=this._generateBlockName()),this._block=A.updateCollection(this._block,e.blockRecords)}unassignDocument(){super.unassignDocument(),this._style=this._style?.clone(),this._block=this._block?.clone()??null}createBlock(){this._block==null&&(this._block=new U(this._generateBlockName()),this._block.isAnonymous=!0),this.document!=null&&(this._block=A.updateCollection(this._block,this.document.blockRecords)),this._block.entities.clear()}createDefinitionPoint(e){let t=new kt(new c(e.x,e.y,e.z));return t.layer=this.document?.layers.get(pe.defpointsName)??pe.defpoints,t.normal=this.normal,t}createTextEntity(e,t){let i=this.getActiveDimensionStyle(),s=new ve;return s.insertPoint=new c(e.x,e.y,e.z),s.alignmentPoint=new c(Math.cos(this.textRotation),Math.sin(this.textRotation),0),s.attachmentPoint=this.attachmentPoint,s.color=i.textColor,s.height=i.textHeight,s.layer=this.layer,s.lineSpacing=this.lineSpacingFactor===0?s.lineSpacing:this.lineSpacingFactor,s.lineSpacingStyle=this.lineSpacingStyle,s.normal=this.normal,s.rotation=this.textRotation,s.style=i.style,s.value=t,s}populateBlock(e,t,i=this.textMiddlePoint){this.createBlock();for(let[a,n]of e)this._addBlockLine(a,n);let s=new Set;for(let a of t){if(!this.isFinitePoint(a))continue;let n=`${a.x}:${a.y}:${a.z}`;s.has(n)||(s.add(n),this._block.entities.add(this.createDefinitionPoint(a)))}this.isFinitePoint(i)&&this._block.entities.add(this.createTextEntity(i,this.getMeasurementText()))}static angleBetweenVectors(e,t){let i=e.getLength()*t.getLength();if(i===0)return 0;let s=e.dot(t)/i,a=Math.max(-1,Math.min(1,s));return Math.acos(a)}static areParallel(e,t){return r.isZeroVector(e.cross(t))}isFinitePoint(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}_addBlockLine(e,t){if(!this.isFinitePoint(e)||!this.isFinitePoint(t)||e.equals(t))return;let i=new Me(new c(e.x,e.y,e.z),new c(t.x,t.y,t.z));i.layer=this.layer,i.normal=this.normal,this._block.entities.add(i)}static intersectLinesXY(e,t,i,s){let a=(e.x-t.x)*(i.y-s.y)-(e.y-t.y)*(i.x-s.x);if(Math.abs(a)<=1e-12)return c.naN;let n=e.x*t.y-e.y*t.x,o=i.x*s.y-i.y*s.x;return new c((n*(i.x-s.x)-(e.x-t.x)*o)/a,(n*(i.y-s.y)-(e.y-t.y)*o)/a,e.z)}static isZeroVector(e,t=1e-12){return Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t}static subtractPoints(e,t){return new c(e.x-t.x,e.y-t.y,e.z-t.z)}_tableOnRemove(e,t){super._tableOnRemove(e,t),t.item===this._style&&(this._style=this.document.dimensionStyles.get(Q.defaultName)),t.item===this._block&&(this._block=null)}_generateBlockName(){return`*D${this.handle}`}_formatMeasurement(e,t){if(!Number.isFinite(e))return"";let i=e;return t.rounding>0&&(i=Math.round(i/t.rounding)*t.rounding),i.toFixed(t.decimalPlaces)}};T();D();B();function eu(r,e){let t=r.x-e.x,i=r.y-e.y,s=r.z-e.z;return Math.sqrt(t*t+i*i+s*s)}var ze=class r extends K{extLineRotation=0;firstPoint=new c(0,0,0);get measurement(){return eu(this.firstPoint,this.secondPoint)}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_ALIGNED}get offset(){return eu(this.secondPoint,this.definitionPoint)}set offset(e){let t=K.subtractPoints(this.secondPoint,this.firstPoint),i=this.normal.cross(t).normalize();this.definitionPoint=new c(this.secondPoint.x+i.x*e,this.secondPoint.y+i.y*e,this.secondPoint.z+i.z*e)}secondPoint=new c(0,0,0);get subclassMarker(){return d.alignedDimension}constructor(e,t){super(G.Aligned),e&&(this.firstPoint=e),t&&(this.secondPoint=t)}static createWithType(e){let t=new r;return t._flags=e,t.definitionPoint=t.secondPoint,t}applyTransform(e){super.applyTransform(e),this.firstPoint=this.applyTransformToPoint(e,this.firstPoint),this.secondPoint=this.applyTransformToPoint(e,this.secondPoint)}getBoundingBox(){return E.fromPoints([this.firstPoint,this.secondPoint,this.definitionPoint])}updateBlock(){this.populateBlock([[this.firstPoint,this.secondPoint]],[this.firstPoint,this.secondPoint,this.definitionPoint])}};T();D();B();var $t=class extends K{angleVertex=new c(0,0,0);get center(){return K.intersectLinesXY(this.definitionPoint,this.angleVertex,this.firstPoint,this.secondPoint)}dimensionArc=new c(0,0,0);firstPoint=new c(0,0,0);get measurement(){let e=K.subtractPoints(this.secondPoint,this.firstPoint),t=K.subtractPoints(this.definitionPoint,this.angleVertex),i=K.angleBetweenVectors(e,t),s=this.center;if(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.z))return i;let a=K.subtractPoints(this.dimensionArc,s);if(K.isZeroVector(a))return i;let n=e.cross(a).dot(this.normal),o=a.cross(t).dot(this.normal);return(n<0&&o>0||n>0&&o<0)&&(i=Math.PI-i),i}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_ANG_2_Ln}get offset(){let e=this.secondPoint.x-this.definitionPoint.x,t=this.secondPoint.y-this.definitionPoint.y,i=this.secondPoint.z-this.definitionPoint.z;return Math.sqrt(e*e+t*t+i*i)}set offset(e){let t=K.subtractPoints(this.secondPoint,this.firstPoint),i=this.normal.cross(t).normalize();this.definitionPoint=new c(this.secondPoint.x+i.x*e,this.secondPoint.y+i.y*e,this.secondPoint.z+i.z*e)}secondPoint=new c(0,0,0);get subclassMarker(){return d.angular2LineDimension}constructor(){super(G.Angular)}applyTransform(e){super.applyTransform(e),this.angleVertex=this.applyTransformToPoint(e,this.angleVertex),this.dimensionArc=this.applyTransformToPoint(e,this.dimensionArc),this.firstPoint=this.applyTransformToPoint(e,this.firstPoint),this.secondPoint=this.applyTransformToPoint(e,this.secondPoint)}getBoundingBox(){return E.fromPoints([this.angleVertex,this.dimensionArc,this.firstPoint,this.secondPoint,this.definitionPoint])}updateBlock(){}};T();D();B();var Gt=class extends K{angleVertex=new c(0,0,0);firstPoint=new c(0,0,0);get measurement(){let e=K.subtractPoints(this.firstPoint,this.angleVertex),t=K.subtractPoints(this.secondPoint,this.angleVertex);return e.equals(t)?0:K.areParallel(e,t)?Math.PI:K.angleBetweenVectors(e,t)}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_ANG_3_Pt}secondPoint=new c(0,0,0);get subclassMarker(){return d.angular3PointDimension}constructor(){super(G.Angular3Point)}applyTransform(e){super.applyTransform(e),this.angleVertex=this.applyTransformToPoint(e,this.angleVertex),this.firstPoint=this.applyTransformToPoint(e,this.firstPoint),this.secondPoint=this.applyTransformToPoint(e,this.secondPoint)}getBoundingBox(){return E.fromPoints([this.angleVertex,this.firstPoint,this.secondPoint,this.definitionPoint])}updateBlock(){super.updateBlock()}};T();D();B();function bu(r,e){let t=r.x-e.x,i=r.y-e.y,s=r.z-e.z;return Math.sqrt(t*t+i*i+s*s)}function yu(r,e){return new c((r.x+e.x)/2,(r.y+e.y)/2,(r.z+e.z)/2)}var Xt=class extends K{angleVertex=new c(0,0,0);get center(){return yu(this.angleVertex,this.definitionPoint)}leaderLength=0;get measurement(){return bu(this.definitionPoint,this.angleVertex)}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_DIAMETER}get subclassMarker(){return d.diametricDimension}constructor(){super(G.Diameter)}applyTransform(e){super.applyTransform(e),this.angleVertex=this.applyTransformToPoint(e,this.angleVertex)}getBoundingBox(){return E.fromPoints([this.definitionPoint,this.angleVertex,this.insertionPoint,this.textMiddlePoint])}updateBlock(){this.populateBlock([[this.angleVertex,this.definitionPoint]],[this.angleVertex,this.definitionPoint,this.insertionPoint,this.textMiddlePoint])}};T();D();B();var _t=class extends ze{get measurement(){let e=new c(Math.cos(this.rotation),Math.sin(this.rotation),0),t=new c(this.secondPoint.x-this.firstPoint.x,this.secondPoint.y-this.firstPoint.y,this.secondPoint.z-this.firstPoint.z),i=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);if(i===0)return 0;let s=new c(t.x/i,t.y/i,t.z/i),a=Math.abs(e.x*s.x+e.y*s.y+e.z*s.z);return super.measurement*a}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_LINEAR}get offset(){return super.offset}set offset(e){let t=new c(Math.cos(this.rotation),Math.sin(this.rotation),0),i=this.normal.cross(t).normalize();this.definitionPoint=new c(this.secondPoint.x+i.x*e,this.secondPoint.y+i.y*e,this.secondPoint.z+i.z*e)}rotation=0;get subclassMarker(){return d.linearDimension}constructor(){super(),this._flags=G.Linear|G.BlockReference}updateBlock(){let e=new c(Math.cos(this.rotation),Math.sin(this.rotation),0),t=new c(this.firstPoint.x+e.x*this.measurement,this.firstPoint.y+e.y*this.measurement,this.firstPoint.z+e.z*this.measurement);this.populateBlock([[this.firstPoint,t]],[this.firstPoint,this.secondPoint,this.definitionPoint])}};T();D();B();var Yt=class extends K{featureLocation=new c(0,0,0);get isOrdinateTypeX(){return(this._flags&G.OrdinateTypeX)!==0}set isOrdinateTypeX(e){e?this._flags=this._flags|G.OrdinateTypeX:this._flags=this._flags&~G.OrdinateTypeX}leaderEndpoint=new c(0,0,0);get measurement(){let e=this.isOrdinateTypeX?new g(0,1):new g(1,0),t=Math.sin(this.horizontalDirection),i=Math.cos(this.horizontalDirection),s=new g(e.x*i-e.y*t,e.x*t+e.y*i),a=new g(this.definitionPoint.x-this.featureLocation.x,this.definitionPoint.y-this.featureLocation.y),n=s.x*a.x+s.y*a.y,o=new g(this.featureLocation.x+n*s.x,this.featureLocation.y+n*s.y),l=new g(this.definitionPoint.x-o.x,this.definitionPoint.y-o.y),p=l.x*l.x+l.y*l.y;return Math.sqrt(p)}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_ORDINATE}get subclassMarker(){return d.ordinateDimension}constructor(){super(G.Ordinate)}applyTransform(e){super.applyTransform(e),this.featureLocation=this.applyTransformToPoint(e,this.featureLocation),this.leaderEndpoint=this.applyTransformToPoint(e,this.leaderEndpoint)}getBoundingBox(){return E.fromPoints([this.featureLocation,this.leaderEndpoint,this.definitionPoint])}updateBlock(){this.populateBlock([[this.featureLocation,this.definitionPoint],[this.definitionPoint,this.leaderEndpoint]],[this.featureLocation,this.definitionPoint,this.leaderEndpoint])}};T();D();B();function gu(r,e){let t=r.x-e.x,i=r.y-e.y,s=r.z-e.z;return Math.sqrt(t*t+i*i+s*s)}var Zt=class extends K{angleVertex=new c(0,0,0);leaderLength=0;get measurement(){return gu(this.definitionPoint,this.angleVertex)}get objectName(){return h.entityDimension}get objectType(){return m.DIMENSION_RADIUS}get subclassMarker(){return d.radialDimension}constructor(){super(G.Radius)}applyTransform(e){super.applyTransform(e),this.angleVertex=this.applyTransformToPoint(e,this.angleVertex)}getBoundingBox(){return E.fromPoints([this.definitionPoint,this.angleVertex,this.insertionPoint,this.textMiddlePoint])}updateBlock(){this.populateBlock([[this.angleVertex,this.definitionPoint]],[this.angleVertex,this.definitionPoint,this.insertionPoint,this.textMiddlePoint])}};T();D();B();var bt=class extends N{center=new c(0,0,0);endParameter=Math.PI*2;get isFullEllipse(){return this.startParameter===0&&this.endParameter===Math.PI*2}get majorAxis(){return 2*Math.sqrt(this.majorAxisEndPoint.x**2+this.majorAxisEndPoint.y**2+this.majorAxisEndPoint.z**2)}majorAxisEndPoint=new c(1,0,0);get minorAxis(){return this.majorAxis*this.radiusRatio}get minorAxisEndpoint(){let e=Math.sqrt(this.majorAxisEndPoint.x**2+this.majorAxisEndPoint.y**2+this.majorAxisEndPoint.z**2);if(e===0)return new c(0,0,0);let t=this.majorAxisEndPoint.x/e,i=this.majorAxisEndPoint.y/e,s=this.majorAxisEndPoint.z/e,a=this.normal.y*s-this.normal.z*i,n=this.normal.z*t-this.normal.x*s,o=this.normal.x*i-this.normal.y*t,l=Math.sqrt(a*a+n*n+o*o);if(l===0)return new c(0,0,0);let p=this.radiusRatio*e;return new c(a/l*p,n/l*p,o/l*p)}normal=new c(0,0,1);get objectName(){return h.entityEllipse}get objectType(){return m.ELLIPSE}get radiusRatio(){return this._radiusRatio}set radiusRatio(e){if(e<=0||e>1)throw new Error("Radius ratio must be a value between 0 (not included) and 1.");this._radiusRatio=e}get rotation(){return Math.atan2(this.majorAxisEndPoint.y,this.majorAxisEndPoint.x)}startParameter=0;get subclassMarker(){return d.ellipse}thickness=0;_radiusRatio=1;applyTransform(e){if(!(e instanceof Z))return;let t=this.applyTransformToPoint(e,this.center),i=this.applyTransformToVector(e,this.majorAxisEndPoint),s=this.applyTransformToVector(e,this.minorAxisEndpoint),a=i,n=s,o=this.startParameter,l=this.endParameter;s.getLength()>i.getLength()&&(a=s,n=i,o=Math.PI/2-this.startParameter,l=Math.PI/2-this.endParameter);let p=a.getLength(),b=n.getLength();if(p>Number.EPSILON&&b>Number.EPSILON){this.majorAxisEndPoint=a,this.radiusRatio=Math.max(Number.EPSILON,Math.min(1,b/p)),this.startParameter=o,this.endParameter=l;let x=a.cross(n).normalize();!Number.isNaN(x.x)&&!Number.isNaN(x.y)&&!Number.isNaN(x.z)&&x.getLength()>0&&(this.normal=x)}this.center=t}getBoundingBox(){let e=this.polygonalVertexes(64);return e.length>0?E.fromPoints(e):null}getEndVertices(){let e=this.polarCoordinateRelativeToCenter(this.startParameter),t=this.polarCoordinateRelativeToCenter(this.endParameter);return{start:e,end:t}}polarCoordinateRelativeToCenter(e){let t=this.minorAxisEndpoint;return new c(this.center.x+this.majorAxisEndPoint.x*Math.cos(e)+t.x*Math.sin(e),this.center.y+this.majorAxisEndPoint.y*Math.cos(e)+t.y*Math.sin(e),this.center.z+this.majorAxisEndPoint.z*Math.cos(e)+t.z*Math.sin(e))}polygonalVertexes(e){if(e<2)throw new Error("The ellipse precision must be equal or greater than two.");let t=this.startParameter,i=this.endParameter;i0&&p.length>0&&p.shift(),a.push(...p)}return a.length===0&&a.push(...i.map(n=>this._toXYZ(n.location,e.elevation))),e.isClosed&&a.length>1&&c.equals(a[0],a[a.length-1])&&a.pop(),a}static _createSegment(e,t,i){let s=t.bulge??0,a=this._getElevation(e,t,i),n=this._toXYZ(t.location,a),o=this._toXYZ(i.location,a);if(Math.abs(s)<1e-12){let p=new Me(n,o);return p.thickness=e.thickness,p.normal=e.normal,e instanceof N&&p.matchProperties(e),p}let l=We.createFromBulge(this._toXY(t.location),this._toXY(i.location),s);return l.center.z=a,l.normal=e.normal,l.thickness=e.thickness,e instanceof N&&l.matchProperties(e),l}static _getSegmentPoints(e,t,i,s){let a=t.bulge??0,n=this._getElevation(e,t,i),o=this._toXYZ(t.location,n),l=this._toXYZ(i.location,n);if(Math.abs(a)<1e-12)return[o,l];let p=this._toXY(t.location),b=this._toXY(i.location),{center:x,radius:j}=We.getCenter(p,b,a),k=Math.atan2(p.y-x.y,p.x-x.x),P=Math.atan2(b.y-x.y,b.x-x.x);a>0&&Pk&&(P-=Math.PI*2);let he=Math.max(2,Math.floor(s)),$=(P-k)/(he-1),X=[];for(let ir=0;ir0&&("location"in e[0]?this.vertices=e:this.vertices=e.map(t=>new Xi(t)))}applyTransform(e){for(let t of this.vertices){let i=this.applyTransformToPoint(e,new c(t.location.x,t.location.y,this.elevation));t.location=new g(i.x,i.y)}if(this.vertices.length>0){let t=this.applyTransformToPoint(e,new c(0,0,this.elevation));this.elevation=t.z}this.normal=this.applyTransformToVector(e,this.normal).normalize()}getPoints(e=256){return ga.getPoints(this,e)}clone(){let e=super.clone();return e.vertices=this.vertices.map(t=>{let i=new Xi;return i.location=new g(t.location.x,t.location.y),i.startWidth=t.startWidth,i.endWidth=t.endWidth,i.bulge=t.bulge,i.flags=t.flags,i.curveTangent=t.curveTangent,i.id=t.id,i}),e}getBoundingBox(){let e=this.getPoints();return e.length>0?E.fromPoints(e):null}};B();var Io=class r{enabled=!1;reserved=0;angle=0;shift=0;isSingleColorGradient=!1;colorTint=0;colors=[];name="";constructor(e){e&&(this.name=e)}clone(){let e=new r;return e.enabled=this.enabled,e.reserved=this.reserved,e.angle=this.angle,e.shift=this.shift,e.isSingleColorGradient=this.isSingleColorGradient,e.colorTint=this.colorTint,e.name=this.name,e.colors=this.colors.map(t=>t.clone()),e}};var Ha=class r{angle=0;basePoint=new g(0,0);dashLengths=[];get lineOffset(){let e=Math.cos(-this.angle),t=Math.sin(-this.angle);return this.offset.x*t+this.offset.y*e}offset=new g(0,0);get shift(){let e=Math.cos(-this.angle),t=Math.sin(-this.angle);return this.offset.x*e-this.offset.y*t}clone(){let e=new r;return e.angle=this.angle,e.basePoint=new g(this.basePoint.x,this.basePoint.y),e.offset=new g(this.offset.x,this.offset.y),e.dashLengths=[...this.dashLengths],e}},xa=class r{static get solid(){return new r("SOLID")}description="";lines=[];name;constructor(e){this.name=e}clone(){let e=new r(this.name);return e.description=this.description,e.lines=this.lines.map(t=>t.clone()),e}toString(){return this.name}update(e,t,i){for(let s of this.lines){let a=new g(s.basePoint.x*i,s.basePoint.y*i),n=new g(s.offset.x*i,s.offset.y*i),o=g.rotate(a,t),l=g.rotate(n,t);s.angle+=t,s.basePoint=new g(o.x+e.x,o.y+e.y),s.offset=l,s.dashLengths=s.dashLengths.map(p=>p*i)}}};var Mo;(function(r){r[r.PatternFill=0]="PatternFill",r[r.SolidFill=1]="SolidFill",r[r.Custom=2]="Custom"})(Mo||(Mo={}));var Vo;(function(r){r[r.Normal=0]="Normal",r[r.Outer=1]="Outer",r[r.Ignore=2]="Ignore"})(Vo||(Vo={}));var ur=class r extends Array{seqend=null;constructor(...e){super(...e),Object.setPrototypeOf(this,r.prototype)}};var $e;(function(r){r[r.Default=0]="Default",r[r.ClosedPolylineOrClosedPolygonMeshInM=1]="ClosedPolylineOrClosedPolygonMeshInM",r[r.CurveFit=2]="CurveFit",r[r.SplineFit=4]="SplineFit",r[r.Polyline3D=8]="Polyline3D",r[r.PolygonMesh=16]="PolygonMesh",r[r.ClosedPolygonMeshInN=32]="ClosedPolygonMeshInN",r[r.PolyfaceMesh=64]="PolyfaceMesh",r[r.ContinuousLinetypePattern=128]="ContinuousLinetypePattern"})($e||($e={}));var Fl;(function(r){r[r.NoSmooth=0]="NoSmooth",r[r.Quadratic=5]="Quadratic",r[r.Cubic=6]="Cubic",r[r.BezierSurface=8]="BezierSurface"})(Fl||(Fl={}));var Ir=class r extends N{static matchVerticesEntityProperties=!1;elevation=0;endWidth=0;get flags(){return this._flags}set flags(e){this._flags=e}get isClosed(){return(this._flags&$e.ClosedPolylineOrClosedPolygonMeshInM)!==0}set isClosed(e){e?this._flags=this._flags|$e.ClosedPolylineOrClosedPolygonMeshInM:(this._flags=this._flags&~$e.ClosedPolylineOrClosedPolygonMeshInM,this._flags=this._flags&~$e.ClosedPolygonMeshInN)}get layer(){return super.layer}set layer(e){if(super.layer=e,r.matchVerticesEntityProperties)for(let t of this.vertices)t instanceof N&&(t.layer=e)}get lineType(){return super.lineType}set lineType(e){if(super.lineType=e,r.matchVerticesEntityProperties)for(let t of this.vertices)t instanceof N&&(t.lineType=e)}normal=new c(0,0,1);smoothSurface=Fl.NoSmooth;startWidth=0;thickness=0;vertices=new ur;_flags=0;constructor(e){super(),e&&(this.vertices=new ur(...e))}applyTransform(e){for(let t of this.vertices)t instanceof N&&t.applyTransform(e);this.normal=this.applyTransformToVector(e,this.normal).normalize()}getPoints(e=256){return ga.getPoints(this,e)}getBoundingBox(){let e=this.getPoints();return e.length>0?E.fromPoints(e):null}clone(){let e=super.clone();return e.vertices=new ur(...this.vertices.map(t=>t.clone())),e}static*explode(e,t){let i={elevation:0,isClosed:t,normal:c.axisZ,thickness:0,vertices:e};for(let s of ga.explode(i))yield s}};T();D();B();var Ge=class extends Ir{get objectName(){return h.entityPolyline}get objectType(){return m.POLYLINE_2D}get subclassMarker(){return d.polyline}getBoundingBox(){return super.getBoundingBox()}};T();D();B();var Xe;(function(r){r[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Periodic=2]="Periodic",r[r.Rational=4]="Rational",r[r.Planar=8]="Planar",r[r.Linear=16]="Linear"})(Xe||(Xe={}));var Pt;(function(r){r[r.None=0]="None",r[r.MethodFitPoints=1]="MethodFitPoints",r[r.CVFrameShow=2]="CVFrameShow",r[r.Closed=4]="Closed",r[r.UseKnotParameter=8]="UseKnotParameter"})(Pt||(Pt={}));var Yi;(function(r){r[r.Chord=0]="Chord",r[r.SquareRoot=1]="SquareRoot",r[r.Uniform=2]="Uniform",r[r.Custom=15]="Custom"})(Yi||(Yi={}));var Lt=class r extends N{controlPoints=[];controlPointTolerance=1e-7;degree=3;endTangent=new c(0,0,0);fitPoints=[];fitTolerance=1e-10;get flags(){return this._flags}set flags(e){this._flags=e}get flags1(){return this._flags1}set flags1(e){this._flags1=e}get hasValidKnotCount(){let e=this.controlPoints.length+(this.isClosed?2:1)*this.degree+1;return this.knots.length===e}get isClosed(){return(this._flags&Xe.Closed)!==0}set isClosed(e){e?(this._flags=this._flags|Xe.Closed,this._flags1=this._flags1|Pt.Closed):(this._flags=this._flags&~Xe.Closed,this._flags1=this._flags1&~Pt.Closed)}get isPeriodic(){return(this._flags&Xe.Periodic)!==0}set isPeriodic(e){e?this._flags=this._flags|Xe.Periodic:this._flags=this._flags&~Xe.Periodic}knotParametrization=Yi.Chord;knots=[];knotTolerance=1e-7;normal=new c(0,0,1);get objectName(){return h.entitySpline}get objectType(){return m.SPLINE}startTangent=new c(0,0,0);get subclassMarker(){return d.spline}weights=[];static maxDegree=10;_flags=Xe.None;_flags1=Pt.None;constructor(){super()}applyTransform(e){this.controlPoints=this.controlPoints.map(t=>this.applyTransformToPoint(e,t)),this.fitPoints=this.fitPoints.map(t=>this.applyTransformToPoint(e,t)),this.startTangent=this.applyTransformToVector(e,this.startTangent),this.endTangent=this.applyTransformToVector(e,this.endTangent),this.normal=this.applyTransformToVector(e,this.normal).normalize()}clone(){let e=super.clone();return e.controlPoints=[...this.controlPoints],e.fitPoints=[...this.fitPoints],e.weights=[...this.weights],e.knots=[...this.knots],e}getBoundingBox(){let e=this.tryPolygonalVertexes(64);if(e.success&&e.points.length>0)return E.fromPoints(e.points);let t=this.controlPoints.length>0?this.controlPoints:this.fitPoints;return t.length>0?E.fromPoints(t):null}pointOnSpline(e){if(e<0||e>1)throw new Error("The parametric position must be a value between 0 and 1.");e===1&&(e-=Number.EPSILON);let{controlPts:t,weights:i,knots:s}=this._prepare(),{uStart:a,uEnd:n}=this._getStartAndEndKnots(s),o=(n-a)*e,l=a+o;return r._c(t,i,s,this.degree,l)}polygonalVertexes(e){if(e<2)throw new Error("The precision must be equal or greater than two.");let t=[],{controlPts:i,weights:s,knots:a}=this._prepare(),{uStart:n,uEnd:o}=this._getStartAndEndKnots(a);!this.isClosed&&!this.isPeriodic&&(e-=1);let l=(o-n)/e;for(let p=0;pnew c(t.x,t.y,t.z)),this.weights=new Array(this.controlPoints.length).fill(1),this.knots=r._createKnotVector(this.controlPoints.length,this.degree,this.isPeriodic),this.fitPoints.length>=2){let t=this.fitPoints[0],i=this.fitPoints[1],s=this.fitPoints[this.fitPoints.length-2],a=this.fitPoints[this.fitPoints.length-1];this.startTangent=new c(i.x-t.x,i.y-t.y,i.z-t.z),this.endTangent=new c(a.x-s.x,a.y-s.y,a.z-s.z)}return!0}static _c(e,t,i,s,a){let n=0,o=0,l=0,p=0;for(let x=0;x0&&this.updateFromFitPoints();let e=[...this.controlPoints],t=[...this.weights],i=[...this.knots],s=e.length;if(s===0)throw new Error("A spline entity with control points is required.");(t.length===0||t.length!==s)&&(t=new Array(s).fill(1)),(i.length===0||!this.hasValidKnotCount)&&(i=r._createKnotVector(s,this.degree,this.isPeriodic));let a,n;if(this.isPeriodic){a=new Array(s+this.degree),n=new Array(s+this.degree);for(let o=0;o0?E.fromPoints(e):null}polygonalVertexes(e){return this.toEntity().polygonalVertexes(e)}toEntity(){let e=this.counterClockWise?this.startAngle:this.endAngle,t=this.counterClockWise?this.endAngle:this.startAngle;return new We(new c(this.center.x,this.center.y,0),this.radius,e,t)}},Fr=class extends Ca{center=new g(0,0);counterClockWise=!1;endAngle=0;majorAxisEndPoint=new g(0,0);minorToMajorRatio=0;startAngle=0;get type(){return Vr.EllipticArc}applyTransform(e){if(!(e instanceof Z))return;let t=this.counterClockWise,i=this.toEntity();i.applyTransform(e),this.center=new g(i.center.x,i.center.y),this.majorAxisEndPoint=new g(i.majorAxisEndPoint.x,i.majorAxisEndPoint.y),this.minorToMajorRatio=i.radiusRatio,this.startAngle=t?i.startParameter:i.endParameter,this.endAngle=t?i.endParameter:i.startParameter}getBoundingBox(){let e=this.polygonalVertexes(64);return e.length>0?E.fromPoints(e):null}polygonalVertexes(e){return this.toEntity().polygonalVertexes(e)}toEntity(){let e=new bt;return e.center=new c(this.center.x,this.center.y,0),e.majorAxisEndPoint=new c(this.majorAxisEndPoint.x,this.majorAxisEndPoint.y,0),e.radiusRatio=this.minorToMajorRatio,e.startParameter=this.counterClockWise?this.startAngle:this.endAngle,e.endParameter=this.counterClockWise?this.endAngle:this.startAngle,e}},Ur=class extends Ca{end=new g(0,0);start=new g(0,0);get type(){return Vr.Line}applyTransform(e){e instanceof Z&&(this.start=Ul(e,this.start),this.end=Ul(e,this.end))}getBoundingBox(){return E.fromPoints([new c(this.start.x,this.start.y,0),new c(this.end.x,this.end.y,0)])}toEntity(){return new Me(new c(this.start.x,this.start.y,0),new c(this.end.x,this.end.y,0))}},Mr=class extends Ca{get bulges(){return this.vertices.map(e=>e.z)}get hasBulge(){return this.bulges.some(e=>e!==0)}isClosed=!1;get type(){return Vr.Polyline}vertices=[];applyTransform(e){e instanceof Z&&(this.vertices=this.vertices.map(t=>{let i=e.applyTransform(new c(t.x,t.y,0));return new c(i.x,i.y,t.z)}))}clone(){let e=super.clone();return e.vertices=[...this.vertices],e}getBoundingBox(){return this.toEntity().getBoundingBox()}toEntity(){let e=new Ge;e.isClosed=this.isClosed;for(let t of this.vertices){let i=new yt(new c(t.x,t.y,0));i.bulge=t.z,e.vertices.push(i)}return e}},Wr=class extends Ca{controlPoints=[];degree=0;endTangent=new g(0,0);fitPoints=[];knots=[];isPeriodic=!1;isRational=!1;startTangent=new g(0,0);get weights(){return this.controlPoints.map(e=>e.z)}get type(){return Vr.Spline}applyTransform(e){if(!(e instanceof Z))return;this.controlPoints=this.controlPoints.map(s=>{let a=e.applyTransform(new c(s.x,s.y,0));return new c(a.x,a.y,s.z)}),this.fitPoints=this.fitPoints.map(s=>Ul(e,s));let t=Ud(e,new c(this.startTangent.x,this.startTangent.y,0)),i=Ud(e,new c(this.endTangent.x,this.endTangent.y,0));this.startTangent=new g(t.x,t.y),this.endTangent=new g(i.x,i.y)}clone(){let e=super.clone();return e.controlPoints=[...this.controlPoints],e.fitPoints=[...this.fitPoints],e.knots=[...this.knots],e}getBoundingBox(){return this.toEntity().getBoundingBox()}polygonalVertexes(e){let i=this.toEntity().tryPolygonalVertexes(e);return i.success?i.points:[]}toEntity(){let e=new Lt;return e.degree=Math.max(1,this.degree),e.isPeriodic=this.isPeriodic,e.knots=[...this.knots],e.controlPoints=this.controlPoints.length>0?this.controlPoints.map(t=>new c(t.x,t.y,0)):this.fitPoints.map(t=>new c(t.x,t.y,0)),e.weights=this.controlPoints.length>0?this.controlPoints.map(t=>t.z===0?1:t.z):new Array(e.controlPoints.length).fill(1),e.fitPoints=this.fitPoints.map(t=>new c(t.x,t.y,0)),e.startTangent=new c(this.startTangent.x,this.startTangent.y,0),e.endTangent=new c(this.endTangent.x,this.endTangent.y,0),e}},Wl=class r{edges=[];entities=[];get flags(){let e=this._flags;return this.isPolyline?e=e|wt.Polyline:e=e&~wt.Polyline,e}set flags(e){this._flags=e}get isPolyline(){return this.edges.some(e=>e instanceof Mr)}_flags=0;constructor(e){e&&(this.edges=[...e])}applyTransform(e){if(this.entities.length>0){for(let t of this.entities)t.applyTransform(e);this.edges.length===0&&this.updateEdges()}for(let t of this.edges)t.applyTransform(e)}clone(){let e=new r;return e._flags=this._flags,e.entities=this.entities.map(t=>t.clone()),e.edges=this.edges.map(t=>t.clone()),e}getBoundingBox(){let e=this.edges.map(i=>i.getBoundingBox()).filter(i=>i!=null);if(e.length===0)return null;let t=e.flatMap(i=>[i.min,i.max]);return E.fromPoints(t)}getPoints(e=256){let t=[];for(let i of this.edges)i instanceof Hr?t.push(...i.polygonalVertexes(e)):i instanceof Fr?t.push(...i.polygonalVertexes(e)):i instanceof Ur?(t.push(new c(i.start.x,i.start.y,0)),t.push(new c(i.end.x,i.end.y,0))):i instanceof Mr?t.push(...i.toEntity().getPoints(e)):i instanceof Wr&&t.push(...i.polygonalVertexes(e));return t}updateEdges(){if(this.entities.length!==0){this.edges=[];for(let e of this.entities)if(e instanceof Me){let t=new Ur;t.start=new g(e.startPoint.x,e.startPoint.y),t.end=new g(e.endPoint.x,e.endPoint.y),this.edges.push(t)}else if(e instanceof We){let t=new Hr;t.center=new g(e.center.x,e.center.y),t.radius=e.radius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.counterClockWise=!0,this.edges.push(t)}else if(e instanceof bt){let t=new Fr;t.center=new g(e.center.x,e.center.y),t.majorAxisEndPoint=new g(e.majorAxisEndPoint.x,e.majorAxisEndPoint.y),t.minorToMajorRatio=e.radiusRatio,t.startAngle=e.startParameter,t.endAngle=e.endParameter,t.counterClockWise=!0,this.edges.push(t)}else if(e instanceof Ge){let t=new Mr;t.isClosed=e.isClosed,t.vertices=e.vertices.filter(i=>i instanceof yt).map(i=>new c(i.location.x,i.location.y,i.bulge)),this.edges.push(t)}else if(e instanceof hr){let t=new Mr;t.isClosed=e.isClosed,t.vertices=e.vertices.map(i=>new c(i.location.x,i.location.y,i.bulge)),this.edges.push(t)}else if(e instanceof Lt){let t=new Wr;t.degree=e.degree,t.isPeriodic=e.isPeriodic,t.knots=[...e.knots],t.controlPoints=e.controlPoints.map((i,s)=>new c(i.x,i.y,e.weights[s]??1)),t.fitPoints=e.fitPoints.map(i=>new g(i.x,i.y)),t.startTangent=new g(e.startTangent.x,e.startTangent.y),t.endTangent=new g(e.endTangent.x,e.endTangent.y),this.edges.push(t)}}}},Kt=class extends N{elevation=0;gradientColor=new Io;isAssociative=!1;isDouble=!1;isSolid=!1;normal=new c(0,0,1);get objectName(){return h.entityHatch}get objectType(){return m.HATCH}paths=[];pattern=xa.solid;get patternAngle(){return this._patternAngle}set patternAngle(e){this._patternAngle=e,this.pattern?.update(new g(0,0),this._patternAngle,1)}get patternScale(){return this._patternScale}set patternScale(e){this._patternScale=e,this.pattern?.update(new g(0,0),0,this._patternScale)}patternType=Mo.PatternFill;pixelSize=0;seedPoints=[];style=Vo.Normal;get subclassMarker(){return d.hatch}_patternAngle=0;_patternScale=0;applyTransform(e){for(let t of this.paths)t.applyTransform(e);if(e instanceof Z){this.seedPoints=this.seedPoints.map(n=>Ul(e,n)),this.normal=this.applyTransformToVector(e,this.normal).normalize(),this.elevation=this.applyTransformToPoint(e,new c(0,0,this.elevation)).z;let t=Ul(e,g.zero),i=Ud(e,c.axisX),s=Math.atan2(i.y,i.x),a=Math.hypot(i.x,i.y)||1;this.pattern?.update(t,s,a),this._patternAngle+=s,this._patternScale=this._patternScale===0?a:this._patternScale*a}}clone(){let e=super.clone();return e.gradientColor=this.gradientColor?.clone(),e.pattern=this.pattern?.clone(),e.paths=this.paths.map(t=>t.clone()),e}*explode(){for(let e of this.paths)for(let t of e.edges)yield t.toEntity()}getBoundingBox(){let e=this.paths.map(t=>t.getBoundingBox()).filter(t=>t!=null);return e.length===0?null:E.fromPoints(e.flatMap(t=>[t.min,t.max]))}};var Zi;(function(r){r[r.Opposite=0]="Opposite",r[r.Same=1]="Same"})(Zi||(Zi={}));T();D();B();var Ye=class extends N{attributes=new ur;block=null;columnCount=1;columnSpacing=0;get hasAttributes(){return this.attributes.length>0}get hasDynamicSubclass(){return!0}insertPoint=new c(0,0,0);get isMultiple(){return this.rowCount>1||this.columnCount>1}normal=new c(0,0,1);get objectName(){return h.entityInsert}get objectType(){return this.rowCount>1||this.columnCount>1?m.MINSERT:m.INSERT}rotation=0;rowCount=1;rowSpacing=0;get subclassMarker(){return this.isMultiple?d.mInsert:d.insert}get xScale(){return this._xscale}set xScale(e){if(e===0)throw new Error("XScale value must be non-zero.");this._xscale=e}get yScale(){return this._yscale}set yScale(e){if(e===0)throw new Error("YScale value must be non-zero.");this._yscale=e}get zScale(){return this._zscale}set zScale(e){if(e===0)throw new Error("ZScale value must be non-zero.");this._zscale=e}_xscale=1;_yscale=1;_zscale=1;constructor(e){if(super(),e){e.document!=null?this.block=e.clone():this.block=e;let t=e.attributeDefinitions;if(t)for(let i of t){let s=new zt(i);this.attributes.push(s),this.applyAttributeTransform(s)}}}applyTransform(e){let t=this.getTransformAxisScale(e);this.insertPoint=this.applyTransformToPoint(e,this.insertPoint),this.normal=this.applyTransformToVector(e,this.normal).normalize(),this.xScale*=t.x===0?1:t.x,this.yScale*=t.y===0?1:t.y,this.zScale*=t.z===0?1:t.z,e instanceof Z&&(this.rotation+=e.eulerRotation.z);for(let i of this.attributes)i.applyTransform(e)}clone(){let e=super.clone();e.block=this.block?.clone()??null,e.attributes=new ur;for(let t of this.attributes)e.attributes.push(t.clone());return e}*explode(){if(this.block==null)return;let e=this.getTransform();for(let t of this.block.getSortedEntities()){if(t instanceof nr)continue;let i=t.clone();i.applyTransform(e),yield i}for(let t of this.attributes)yield t.clone()}getBoundingBox(){let e=this.block?.getBoundingBox(),t=[];if(e!=null){let i=this.getTransform(),s=[new c(e.min.x,e.min.y,e.min.z),new c(e.min.x,e.min.y,e.max.z),new c(e.min.x,e.max.y,e.min.z),new c(e.min.x,e.max.y,e.max.z),new c(e.max.x,e.min.y,e.min.z),new c(e.max.x,e.min.y,e.max.z),new c(e.max.x,e.max.y,e.min.z),new c(e.max.x,e.max.y,e.max.z)].map(a=>i.applyTransform(a));t.push(E.fromPoints(s))}for(let i of this.attributes){let s=i.getBoundingBox();s!=null&&t.push(s)}return t.length>0?E.fromPoints(t.flatMap(i=>[i.min,i.max])):null}getTransform(){return new Z(this.insertPoint,new c(this.xScale,this.yScale,this.zScale),new c(0,0,this.rotation))}applyAttributeTransform(e){e.applyTransform(this.getTransform())}updateAttributes(){if(!this.block)return;let e=this.block.attributeDefinitions??[],t=e.map(a=>a.tag),i=this.attributes.map(a=>a.tag),s=new ur(...this.attributes.filter(a=>t.includes(a.tag)));s.seqend=this.attributes.seqend,this.attributes=s;for(let a of e)if(!i.includes(a.tag)){let n=new zt(a);this.attributes.push(n),this.applyAttributeTransform(n)}}assignDocument(e){if(super.assignDocument(e),this.block==null)return;let t=e.blockRecords?.tryGetValue(this.block.name);t?this.block=t:e.blockRecords?.add(this.block)}unassignDocument(){this.block=this.block?.clone()??null,super.unassignDocument()}};De();T();D();B();var Ua;(function(r){r[r.CreatedWithTextAnnotation=0]="CreatedWithTextAnnotation",r[r.CreatedWithToleranceAnnotation=1]="CreatedWithToleranceAnnotation",r[r.CreatedWithBlockReferenceAnnotation=2]="CreatedWithBlockReferenceAnnotation",r[r.CreatedWithoutAnnotation=3]="CreatedWithoutAnnotation"})(Ua||(Ua={}));var Ho;(function(r){r[r.StraightLineSegments=0]="StraightLineSegments",r[r.Spline=1]="Spline"})(Ho||(Ho={}));var zr=class extends N{annotationOffset=new c(0,0,0);arrowHeadEnabled=!1;associatedAnnotation=null;blockOffset=new c(0,0,0);creationType=Ua.CreatedWithoutAnnotation;get hasHookline(){return this.vertices.length<=1?!1:this.creationType!==Ua.CreatedWithoutAnnotation&&this.horizontalDirection.getLength()>0}hookLineDirection=Zi.Opposite;horizontalDirection=new c(1,0,0);normal=new c(0,0,1);get objectName(){return h.entityLeader}get objectType(){return m.LEADER}pathType=Ho.StraightLineSegments;get style(){return this._style}set style(e){if(e==null)throw new Error("value cannot be null");this.document!=null?this._style=A.updateCollection(e,this.document.dimensionStyles):this._style=e}get subclassMarker(){return d.leader}textHeight=0;textWidth=0;vertices=[];_style=Q.default;applyTransform(e){this.annotationOffset=this.applyTransformToVector(e,this.annotationOffset),this.blockOffset=this.applyTransformToVector(e,this.blockOffset),this.horizontalDirection=this.applyTransformToVector(e,this.horizontalDirection),this.normal=this.transformNormal(e,this.normal),this.vertices=this.vertices.map(t=>this.applyTransformToPoint(e,t))}clone(){let e=super.clone();return e._style=this._style?.clone(),e}getBoundingBox(){return E.fromPoints(this.vertices)}assignDocument(e){super.assignDocument(e),this._style=A.updateCollection(this._style,e.dimensionStyles)}unassignDocument(){super.unassignDocument(),this._style=this._style.clone()}_tableOnRemove(e,t){super._tableOnRemove(e,t),t.item===this._style&&(this._style=this.document.dimensionStyles.get(Q.defaultName))}};T();D();B();var Da=class{start;end;crease=null;constructor(e,t){this.start=e,this.end=t}toString(){return`${this.start}|${this.end}|${this.crease??""}`}},$r=class extends N{blendCrease=0;edges=[];faces=[];get objectName(){return h.entityMesh}get objectType(){return m.UNLISTED}get subclassMarker(){return d.mesh}subdivisionLevel=0;version=0;vertices=[];applyTransform(e){this.vertices=this.vertices.map(t=>this.applyTransformToPoint(e,t))}clone(){let e=super.clone();return e.vertices=this.vertices.map(t=>new c(t.x,t.y,t.z)),e.edges=this.edges.map(t=>{let i=new Da(t.start,t.end);return i.crease=t.crease,i}),e.faces=this.faces.map(t=>[...t]),e}getBoundingBox(){return this.vertices.length>0?E.fromPoints(this.vertices):null}};De();T();D();B();var qi;(function(r){r[r.Has=1]="Has",r[r.Closed=2]="Closed",r[r.NoStartCaps=4]="NoStartCaps",r[r.NoEndCaps=8]="NoEndCaps"})(qi||(qi={}));var Fo;(function(r){r[r.Top=0]="Top",r[r.Zero=1]="Zero",r[r.Bottom=2]="Bottom"})(Fo||(Fo={}));function xu(r,e){return r.applyTransform(e)}function tu(r,e){let t=r.applyTransform(c.zero),i=r.applyTransform(e);return new c(i.x-t.x,i.y-t.y,i.z-t.z)}function ru(r){let e=r.matrix,t=Math.hypot(e.m00,e.m10,e.m20),i=Math.hypot(e.m01,e.m11,e.m21),s=Math.hypot(e.m02,e.m12,e.m22),a=[t,i,s].filter(n=>n>0);return a.length>0?a.reduce((n,o)=>n+o,0)/a.length:1}var Wa=class r{parameters=[];areaFillParameters=[];applyScale(e){this.parameters=this.parameters.map(t=>t*e),this.areaFillParameters=this.areaFillParameters.map(t=>t*e)}clone(){let e=new r;return e.parameters=[...this.parameters],e.areaFillParameters=[...this.areaFillParameters],e}},za=class r{position=new c(0,0,0);direction=new c(0,0,0);miter=new c(0,0,0);segments=[];applyTransform(e){if(!(e instanceof Z))return;let t=this.miter.getLength();this.position=xu(e,this.position),this.direction=tu(e,this.direction),this.miter=tu(e,this.miter);let i=this.miter.getLength(),s=t>0?i/t:ru(e);for(let a of this.segments)a.applyScale(s)}clone(){let e=new r;return e.position=new c(this.position.x,this.position.y,this.position.z),e.direction=new c(this.direction.x,this.direction.y,this.direction.z),e.miter=new c(this.miter.x,this.miter.y,this.miter.z),e.segments=this.segments.map(t=>t.clone()),e}},Gr=class extends N{flags=qi.Has;justification=Fo.Zero;normal=new c(0,0,1);get objectName(){return h.entityMLine}get objectType(){return m.MLINE}scaleFactor=1;startPoint=new c(0,0,0);get style(){return this._style}set style(e){if(!e)throw new Error("MLine style cannot be null");this._style=A.updateCollection(e,this.document?.mLineStyles??null)}get subclassMarker(){return d.mLine}vertices=[];_style=null;applyTransform(e){this.startPoint=this.applyTransformToPoint(e,this.startPoint),this.normal=this.transformNormal(e,this.normal);for(let t of this.vertices)t.applyTransform(e);e instanceof Z&&(this.scaleFactor*=ru(e))}clone(){let e=super.clone();return e._style=this.style?.clone()??null,e.vertices=this.vertices.map(t=>t.clone()),e}getBoundingBox(){let e=[this.startPoint,...this.vertices.map(t=>t.position)];return E.fromPoints(e)}assignDocument(e){super.assignDocument(e),this._style=A.updateCollection(this._style,e.mLineStyles)}unassignDocument(){super.unassignDocument(),this._style=this._style?.clone()??null}};T();D();B();var Ta;(function(r){r[r.None=0]="None",r[r.Block=1]="Block",r[r.MText=2]="MText",r[r.Tolerance=3]="Tolerance"})(Ta||(Ta={}));var Uo;(function(r){r[r.Invisible=0]="Invisible",r[r.StraightLineSegments=1]="StraightLineSegments",r[r.Spline=2]="Spline"})(Uo||(Uo={}));var Wo;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right"})(Wo||(Wo={}));var zo;(function(r){r[r.Horizontal=0]="Horizontal",r[r.Vertical=1]="Vertical"})(zo||(zo={}));var $o;(function(r){r[r.Left=1]="Left",r[r.Center=2]="Center",r[r.Right=3]="Right"})($o||($o={}));var Vs;(function(r){r[r.TopOfTopLine=0]="TopOfTopLine",r[r.MiddleOfTopLine=1]="MiddleOfTopLine",r[r.MiddleOfText=2]="MiddleOfText",r[r.MiddleOfBottomLine=3]="MiddleOfBottomLine",r[r.BottomOfBottomLine=4]="BottomOfBottomLine",r[r.BottomLine=5]="BottomLine",r[r.BottomOfTopLineUnderlineBottomLine=6]="BottomOfTopLineUnderlineBottomLine",r[r.BottomOfTopLineUnderlineTopLine=7]="BottomOfTopLineUnderlineTopLine",r[r.BottomofTopLineUnderlineAll=8]="BottomofTopLineUnderlineAll",r[r.CenterOfText=9]="CenterOfText",r[r.CenterOfTextOverline=10]="CenterOfTextOverline"})(Vs||(Vs={}));te();D();var zl=class extends M{get subclassMarker(){return d.objectContextData}version=3;hasFileToExtensionDictionary=!0;default=!1};te();T();D();B();var lt=class r extends M{static defaultName="1:1";static get default(){let e=new r;return e.name=r.defaultName,e.paperUnits=1,e.drawingUnits=1,e.isUnitScale=!0,e}get objectType(){return m.UNLISTED}get objectName(){return h.objectScale}get subclassMarker(){return d.scale}paperUnits=0;drawingUnits=0;isUnitScale=!1;get scaleFactor(){return this.paperUnits/this.drawingUnits}constructor(e){super(e)}applyTo(e){return e*this.scaleFactor}};De();D();var Hs=class extends zl{get scale(){return this._scale}set scale(e){if(!e)throw new Error("value cannot be null");this.document!=null?this._scale=A.updateCollection(e,this.document.scales):this._scale=e}get subclassMarker(){return d.annotScaleObjectContextData}_scale=lt.default;clone(){let e=super.clone();return e._scale=this._scale?.clone(),e}};De();T();D();B();var Go=class r{startPoint;endPoint;constructor(e=new c(0,0,0),t=new c(0,0,0)){this.startPoint=e,this.endPoint=t}clone(){return new r(new c(this.startPoint.x,this.startPoint.y,this.startPoint.z),new c(this.endPoint.x,this.endPoint.y,this.endPoint.z))}},$a=class r{arrowhead=null;arrowheadSize=0;breakInfoCount=0;index=0;lineColor=S.byLayer;_lineType=null;get lineType(){return this._lineType}set lineType(e){this._lineType=e}lineWeight=0;overrideFlags=0;pathType=0;points=[];segmentIndex=0;startEndPoints=[];document=null;assignDocument(e){this.document=e,this._lineType=A.updateCollectionStatic(this._lineType,e.lineTypes)}clone(){let e=new r;return e.arrowheadSize=this.arrowheadSize,e.breakInfoCount=this.breakInfoCount,e.index=this.index,e.lineColor=this.lineColor,e.lineWeight=this.lineWeight,e.overrideFlags=this.overrideFlags,e.pathType=this.pathType,e.segmentIndex=this.segmentIndex,e.arrowhead=this.arrowhead?.clone()??null,e._lineType=this._lineType?.clone()??null,e.points=this.points.map(t=>new c(t.x,t.y,t.z)),e.startEndPoints=this.startEndPoints.map(t=>t.clone()),e}unassignDocument(){this._lineType=this._lineType?.clone()??null,this.document=null}},Ga=class r{breakStartEndPointsPairs=[];connectionPoint=new c(0,0,0);contentValid=!1;direction=new c(0,0,0);landingDistance=0;leaderIndex=0;lines=[];textAttachmentDirection=0;unknown=!1;clone(){let e=new r;return e.connectionPoint=new c(this.connectionPoint.x,this.connectionPoint.y,this.connectionPoint.z),e.contentValid=this.contentValid,e.direction=new c(this.direction.x,this.direction.y,this.direction.z),e.landingDistance=this.landingDistance,e.leaderIndex=this.leaderIndex,e.textAttachmentDirection=this.textAttachmentDirection,e.unknown=this.unknown,e.breakStartEndPointsPairs=this.breakStartEndPointsPairs.map(t=>t.clone()),e.lines=this.lines.map(t=>t.clone()),e}},Jt=class extends Hs{arrowheadSize=0;backgroundFillColor=S.byLayer;backgroundFillEnabled=!1;backgroundMaskFillOn=!1;backgroundScaleFactor=0;backgroundTransparency=0;baseDirection=new c(0,0,0);basePoint=new c(0,0,0);baseVertical=new c(0,0,0);_blockContent=null;get blockContent(){return this._blockContent}set blockContent(e){this._blockContent=A.updateCollectionStatic(e,this.document?.blockRecords??null)}blockContentColor=S.byLayer;blockContentConnection=0;blockContentLocation=new c(0,0,0);blockContentNormal=new c(0,0,0);blockContentRotation=0;blockContentScale=new c(1,1,1);boundaryHeight=0;boundaryWidth=0;columnFlowReversed=!1;columnGutter=0;columnSizes=[];columnType=0;columnWidth=0;contentBasePoint=new c(0,0,0);direction=new c(0,0,0);flowDirection=0;hasContentsBlock=!1;hasTextContents=!1;landingGap=0;leaderRoots=[];lineSpacing=0;lineSpacingFactor=0;normalReversed=!1;get objectName(){return h.objectMLeaderContextData}get objectType(){return m.UNLISTED}scaleFactor=0;get subclassMarker(){return d.multiLeaderObjectContextData}textAlignment=0;textAttachmentPoint=0;textBottomAttachment=0;textColor=S.byLayer;textHeight=0;textHeightAutomatic=!1;textLabel="";textLeftAttachment=0;textLocation=new c(0,0,0);textNormal=new c(0,0,0);textRightAttachment=0;textRotation=0;_textStyle=null;get textStyle(){return this._textStyle}set textStyle(e){if(e==null)throw new Error("value cannot be null");this._textStyle=A.updateCollectionStatic(e,this.document?.textStyles??null)}textTopAttachment=0;transformationMatrix=mt.identity();wordBreak=!1;clone(){let e=super.clone();return e.leaderRoots=this.leaderRoots.map(t=>t.clone()),e._textStyle=this._textStyle?.clone()??null,e._blockContent=this._blockContent?.clone()??null,e}assignDocument(e){super.assignDocument(e),this._blockContent=A.updateCollectionStatic(this._blockContent,e.blockRecords),this._textStyle=A.updateCollectionStatic(this._textStyle,e.textStyles);for(let t of this.leaderRoots)for(let i of t.lines)i.assignDocument(e)}unassignDocument(){super.unassignDocument(),this._blockContent=this._blockContent?.clone()??null,this._textStyle=this._textStyle?.clone()??null;for(let e of this.leaderRoots)for(let t of e.lines)t.unassignDocument()}};var wd;(function(r){r[r.None=0]="None",r[r.PathType=1]="PathType",r[r.LineColor=2]="LineColor",r[r.LeaderLineType=4]="LeaderLineType",r[r.LeaderLineWeight=8]="LeaderLineWeight",r[r.EnableLanding=16]="EnableLanding",r[r.LandingGap=32]="LandingGap",r[r.EnableDogleg=64]="EnableDogleg",r[r.LandingDistance=128]="LandingDistance",r[r.Arrowhead=256]="Arrowhead",r[r.ArrowheadSize=512]="ArrowheadSize",r[r.ContentType=1024]="ContentType",r[r.TextStyle=2048]="TextStyle",r[r.TextLeftAttachment=4096]="TextLeftAttachment",r[r.TextAngle=8192]="TextAngle",r[r.TextAlignment=16384]="TextAlignment",r[r.TextColor=32768]="TextColor",r[r.TextHeight=65536]="TextHeight",r[r.TextFrame=131072]="TextFrame",r[r.EnableUseDefaultMText=262144]="EnableUseDefaultMText",r[r.BlockContent=524288]="BlockContent",r[r.BlockContentColor=1048576]="BlockContentColor",r[r.BlockContentScale=2097152]="BlockContentScale",r[r.BlockContentRotation=4194304]="BlockContentRotation",r[r.BlockContentConnection=8388608]="BlockContentConnection",r[r.ScaleFactor=16777216]="ScaleFactor",r[r.TextRightAttachment=33554432]="TextRightAttachment",r[r.TextSwitchAlignmentType=67108864]="TextSwitchAlignmentType",r[r.TextAttachmentDirection=134217728]="TextAttachmentDirection",r[r.TextTopAttachment=268435456]="TextTopAttachment",r[r.TextBottomAttachment=536870912]="TextBottomAttachment"})(wd||(wd={}));var $l=class r{attributeDefinition=null;index=0;width=0;text="";clone(){let e=new r;return e.attributeDefinition=this.attributeDefinition,e.index=this.index,e.width=this.width,e.text=this.text,e}},Xr=class extends N{arrowhead=null;arrowheadSize=0;blockAttributes=[];blockContentColor=S.byBlock;blockContentConnection=0;blockContentId=null;blockContentRotation=0;blockContentScale=new c(1,1,1);contentType=Ta.MText;contextData=new Jt;enableAnnotationScale=!1;enableDogleg=!0;enableLanding=!0;extendedToText=!1;landingDistance=0;leaderLineType=null;leaderLineWeight=0;lineColor=S.byBlock;get objectName(){return h.entityMultiLeader}get objectType(){return m.UNLISTED}pathType=Uo.StraightLineSegments;propertyOverrideFlags=0;scaleFactor=1;style=null;get subclassMarker(){return d.multiLeader}textAlignment=Wo.Left;textAngle=0;textAttachmentDirection=zo.Horizontal;textAttachmentPoint=$o.Center;textBottomAttachment=Vs.CenterOfText;textColor=S.byBlock;textFrame=!1;textLeftAttachment=Vs.MiddleOfTopLine;textRightAttachment=Vs.MiddleOfTopLine;textStyle=null;textTopAttachment=Vs.CenterOfText;textDirectionNegative=!1;textAligninIPE=!1;applyTransform(e){}clone(){let e=super.clone();return e.arrowhead=this.arrowhead?.clone()??null,e.blockContentId=this.blockContentId?.clone()??null,e.style=this.style?.clone()??null,e.textStyle=this.textStyle?.clone()??null,e.contextData=this.contextData.clone(),e.blockAttributes=this.blockAttributes.map(t=>t.clone()),e}getBoundingBox(){let e=[],t=a=>{e.push(a.startPoint,a.endPoint)},i=a=>{e.push(...a.points);for(let n of a.startEndPoints)t(n)},s=a=>{e.push(a.connectionPoint,a.direction);for(let n of a.breakStartEndPointsPairs)t(n);for(let n of a.lines)i(n)};e.push(this.contextData.basePoint,this.contextData.contentBasePoint,this.contextData.textLocation),this.contextData.hasContentsBlock&&e.push(this.contextData.blockContentLocation);for(let a of this.contextData.leaderRoots)s(a);return e.length>0?E.fromPoints(e):null}};T();D();B();var Gl;(function(r){r[r.Link=1]="Link",r[r.Embedded=2]="Embedded",r[r.Static=3]="Static"})(Gl||(Gl={}));var Yr=class extends N{binaryData=new Uint8Array(0);isPaperSpace=!1;lowerRightCorner=new c(0,0,0);get objectName(){return h.entityOle2Frame}get objectType(){return m.OLE2FRAME}oleObjectType=Gl.Embedded;sourceApplication="";get subclassMarker(){return d.ole2Frame}upperLeftCorner=new c(1,1,0);version=2;applyTransform(e){this.upperLeftCorner=this.applyTransformToPoint(e,this.upperLeftCorner),this.lowerRightCorner=this.applyTransformToPoint(e,this.lowerRightCorner)}getBoundingBox(){return E.fromPoints([this.upperLeftCorner,this.lowerRightCorner])}};D();var Xl;(function(r){r[r.ClippingOn=1]="ClippingOn",r[r.ShowUnderlay=2]="ShowUnderlay",r[r.Monochrome=4]="Monochrome",r[r.AdjustForBackground=8]="AdjustForBackground",r[r.ClipInsideMode=16]="ClipInsideMode",r[r.Default=11]="Default"})(Xl||(Xl={}));var Yl=class extends N{clipBoundaryVertices=[];get contrast(){return this._contrast}set contrast(e){if(e<0||e>100)throw new Error(`Invalid Contrast value: ${e}, must be in range 0-100`);this._contrast=e}definition=null;get fade(){return this._fade}set fade(e){if(e<0||e>100)throw new Error(`Invalid Fade value: ${e}, must be in range 0-100`);this._fade=e}flags=Xl.Default;insertPoint=new c(0,0,0);normal=new c(0,0,1);rotation=0;get subclassMarker(){return d.underlay}get xScale(){return this._xscale}set xScale(e){if(e===0)throw new Error("XScale value must be non-zero.");this._xscale=e}get yScale(){return this._yscale}set yScale(e){if(e===0)throw new Error("YScale value must be non-zero.");this._yscale=e}get zScale(){return this._zscale}set zScale(e){if(e===0)throw new Error("ZScale value must be non-zero.");this._zscale=e}_contrast=100;_fade=0;_xscale=1;_yscale=1;_zscale=1;constructor(e){super(),e&&(this.definition=e)}applyTransform(e){if(this.insertPoint=this.applyTransformToPoint(e,this.insertPoint),this.normal=this.transformNormal(e,this.normal),!(e instanceof Z))return;let t=this.getTransformAxisScale(e);this.rotation+=e.eulerRotation.z,this.xScale*=t.x===0?1:t.x,this.yScale*=t.y===0?1:t.y,this.zScale*=t.z===0?1:t.z}clone(){let e=super.clone();return e.definition=this.definition?.clone()??null,e.clipBoundaryVertices=[...this.clipBoundaryVertices],e}getBoundingBox(){if(this.clipBoundaryVertices.length===0)return null;let e=this.clipBoundaryVertices.map(t=>{let i=new g(t.x*this.xScale,t.y*this.yScale),s=g.rotate(i,this.rotation);return new c(this.insertPoint.x+s.x,this.insertPoint.y+s.y,this.insertPoint.z)});return E.fromPoints(e)}assignDocument(e){super.assignDocument(e)}unassignDocument(){super.unassignDocument(),this.definition=this.definition?.clone()??null}};T();B();var Ci=class extends Yl{get objectName(){return h.entityPdfUnderlay}get objectType(){return m.UNLISTED}constructor(e){super(e)}};T();D();B();var jt=class extends Ir{faces=[];get flags(){return super.flags|$e.PolyfaceMesh}set flags(e){super.flags=e}get objectName(){return h.entityPolyline}get objectType(){return m.POLYLINE_PFACE}get subclassMarker(){return d.polyfaceMesh}clone(){let e=super.clone();return e.faces=this.faces.map(t=>t.clone()),e}getBoundingBox(){return super.getBoundingBox()}};T();D();B();var Qt=class extends Ir{get flags(){return super.flags|$e.PolygonMesh}set flags(e){super.flags=e}mSmoothSurfaceDensity=0;mVertexCount=0;nSmoothSurfaceDensity=0;nVertexCount=0;get objectName(){return h.entityPolyline}get objectType(){return m.POLYLINE_MESH}get subclassMarker(){return d.polygonMesh}getBoundingBox(){return super.getBoundingBox()}};D();B();var xs=class extends tt{get objectType(){return m.VERTEX_MESH}get subclassMarker(){return d.polygonMeshVertex}constructor(e){super(e?new c(e.x,e.y,e.z):void 0)}};T();D();B();D();B();var Zr=class extends tt{get objectType(){return m.VERTEX_3D}get subclassMarker(){return d.polyline3dVertex}constructor(e){super(e)}};var gt=class extends Ir{get flags(){return super.flags|$e.Polyline3D}set flags(e){super.flags=e}get objectName(){return h.entityPolyline}get objectType(){return m.POLYLINE_3D}get subclassMarker(){return d.polyline3d}constructor(e){super(),e&&e.length>0&&(e[0]instanceof Zr?this.vertices=new ur(...e):this.vertices=new ur(...e.map(t=>new Zr(t))))}getBoundingBox(){return super.getBoundingBox()}};T();D();B();var Xa=class extends N{get classId(){return this.dxfClass?.classNumber??0}get drawingFormat(){return this.version|this.maintenanceVersion<<16}dxfClass=null;maintenanceVersion=0;get objectName(){return h.entityProxyEntity}get objectType(){return m.ACAD_PROXY_ENTITY}originalDataFormatDxf=!1;proxyClassId=498;get subclassMarker(){return d.proxyEntity}version=u.Unknown;applyTransform(e){}getBoundingBox(){return null}};T();D();B();var Di=class extends N{direction=new c(0,0,0);get objectName(){return h.entityRay}get objectType(){return m.RAY}startPoint=new c(0,0,0);get subclassMarker(){return d.ray}applyTransform(e){this.startPoint=this.applyTransformToPoint(e,this.startPoint);let t=this.applyTransformToVector(e,this.direction);t.getLength()>0&&(this.direction=t.normalize())}getBoundingBox(){return E.infinite}};T();B();var Cs=class extends Ms{get objectType(){return m.REGION}get objectName(){return h.entityRegion}};T();B();var Se=class extends N{get objectType(){return m.SEQEND}get objectName(){return h.entitySeqend}constructor(e){super(),e&&(this.owner=e)}getBoundingBox(){return null}applyTransform(e){}};var Wd;(function(r){r[r.CastsAndReceivesShadows=0]="CastsAndReceivesShadows",r[r.CastsShadows=1]="CastsShadows",r[r.ReceivesShadows=2]="ReceivesShadows",r[r.IgnoresShadows=3]="IgnoresShadows"})(Wd||(Wd={}));De();T();D();B();var qr=class extends N{get objectType(){return m.SHAPE}get objectName(){return h.entityShape}get subclassMarker(){return d.shape}thickness=0;insertionPoint=new c(0,0,0);size=1;get shapeStyle(){return this._style}set shapeStyle(e){if(e==null||!e.isShapeFile)throw new Error("value cannot be null and must be a shape file");this.document!=null?this._style=A.updateCollection(e,this.document.textStyles):this._style=e}rotation=0;relativeXScale=1;obliqueAngle=0;normal=new c(0,0,1);shapeIndex=0;_style;constructor(e){super(),e&&(this.shapeStyle=e)}clone(){let e=super.clone();return e._style=this._style?.clone(),e}getBoundingBox(){let e=this.size*Math.max(Math.abs(this.relativeXScale),1e-12),t=[new g(0,0),new g(e,0),new g(0,this.size),new g(e,this.size)].map(i=>{let s=g.rotate(i,this.rotation);return new c(this.insertionPoint.x+s.x,this.insertionPoint.y+s.y,this.insertionPoint.z)});return E.fromPoints(t)}applyTransform(e){if(this.insertionPoint=this.applyTransformToPoint(e,this.insertionPoint),this.normal=this.transformNormal(e,this.normal),!(e instanceof Z))return;let t=this.getTransformAxisScale(e),i=t.x===0?1:t.x,s=t.y===0?1:t.y;this.rotation+=e.eulerRotation.z,this.size*=s,this.relativeXScale*=i/s}};T();D();B();var mr=class extends N{firstCorner=new c(0,0,0);fourthCorner=new c(0,0,0);normal=new c(0,0,1);get objectName(){return h.entitySolid}get objectType(){return m.SOLID}secondCorner=new c(0,0,0);get subclassMarker(){return d.solid}thickness=0;thirdCorner=new c(0,0,0);applyTransform(e){this.firstCorner=this.applyTransformToPoint(e,this.firstCorner),this.secondCorner=this.applyTransformToPoint(e,this.secondCorner),this.thirdCorner=this.applyTransformToPoint(e,this.thirdCorner),this.fourthCorner=this.applyTransformToPoint(e,this.fourthCorner),this.normal=this.applyTransformToVector(e,this.normal).normalize()}getBoundingBox(){return E.fromPoints([this.firstCorner,this.secondCorner,this.thirdCorner,this.fourthCorner])}};T();D();B();var Ki=class extends Ms{get objectType(){return m.SOLID3D}get objectName(){return h.entity3DSolid}get subclassMarker(){return d.solid3D}};T();D();B();var _d;(function(r){r[r.Single=1]="Single",r[r.Double=2]="Double"})(_d||(_d={}));var bd;(function(r){r[r.Right=1]="Right",r[r.Vertical=2]="Vertical",r[r.Left=4]="Left"})(bd||(bd={}));var yd;(function(r){r[r.None=0]="None",r[r.EnableBreaks=1]="EnableBreaks",r[r.RepeatTopLabels=2]="RepeatTopLabels",r[r.RepeatBottomLabels=4]="RepeatBottomLabels",r[r.AllowManualPositions=8]="AllowManualPositions",r[r.AllowManualHeights=16]="AllowManualHeights"})(yd||(yd={}));var gd;(function(r){r[r.None=0]="None",r[r.TopLeft=1]="TopLeft",r[r.TopCenter=2]="TopCenter",r[r.TopRight=3]="TopRight",r[r.MiddleLeft=4]="MiddleLeft",r[r.MiddleCenter=5]="MiddleCenter",r[r.MiddleRight=6]="MiddleRight",r[r.BottomLeft=7]="BottomLeft",r[r.BottomCenter=8]="BottomCenter",r[r.BottomRight=9]="BottomRight"})(gd||(gd={}));var Ve;(function(r){r[r.Unknown=0]="Unknown",r[r.Top=1]="Top",r[r.Right=2]="Right",r[r.Bottom=4]="Bottom",r[r.Left=8]="Left",r[r.InsideVertical=16]="InsideVertical",r[r.InsideHorizontal=32]="InsideHorizontal"})(Ve||(Ve={}));var xd;(function(r){r[r.Data=1]="Data",r[r.Label=2]="Label"})(xd||(xd={}));var Cd;(function(r){r[r.Unknown=0]="Unknown",r[r.Cell=1]="Cell",r[r.Row=2]="Row",r[r.Column=3]="Column",r[r.FormattedTableData=4]="FormattedTableData",r[r.Table=5]="Table"})(Cd||(Cd={}));var Ds;(function(r){r[r.Text=1]="Text",r[r.Block=2]="Block"})(Ds||(Ds={}));var Ya;(function(r){r[r.None=0]="None",r[r.Override=1]="Override"})(Ya||(Ya={}));var zd;(function(r){r[r.None=0]="None",r[r.BorderType=1]="BorderType",r[r.LineWeight=2]="LineWeight",r[r.LineType=4]="LineType",r[r.Color=8]="Color",r[r.Invisibility=16]="Invisibility",r[r.DoubleLineSpacing=32]="DoubleLineSpacing",r[r.All=63]="All"})(zd||(zd={}));var $d;(function(r){r[r.None=0]="None",r[r.Flow=1]="Flow",r[r.StackedHorizontal=2]="StackedHorizontal",r[r.StackedVertical=4]="StackedVertical"})($d||($d={}));var Dd;(function(r){r[r.Unknown=0]="Unknown",r[r.Value=1]="Value",r[r.Field=2]="Field",r[r.Block=4]="Block"})(Dd||(Dd={}));var Gd;(function(r){r[r.None=0]="None",r[r.ContentLocked=1]="ContentLocked",r[r.ContentReadOnly=2]="ContentReadOnly",r[r.Linked=4]="Linked",r[r.ContentModifiedAfterUpdate=8]="ContentModifiedAfterUpdate",r[r.FormatLocked=16]="FormatLocked",r[r.FormatReadOnly=32]="FormatReadOnly",r[r.FormatModifiedAfterUpdate=64]="FormatModifiedAfterUpdate"})(Gd||(Gd={}));var Xd;(function(r){r[r.None=0]="None",r[r.DataType=1]="DataType",r[r.DataFormat=2]="DataFormat",r[r.Rotation=4]="Rotation",r[r.BlockScale=8]="BlockScale",r[r.Alignment=16]="Alignment",r[r.ContentColor=32]="ContentColor",r[r.TextStyle=64]="TextStyle",r[r.TextHeight=128]="TextHeight",r[r.AutoScale=256]="AutoScale",r[r.BackgroundColor=512]="BackgroundColor",r[r.MarginLeft=1024]="MarginLeft",r[r.MarginTop=2048]="MarginTop",r[r.MarginRight=4096]="MarginRight",r[r.MarginBottom=8192]="MarginBottom",r[r.ContentLayout=16384]="ContentLayout",r[r.MarginHorizontalSpacing=131072]="MarginHorizontalSpacing",r[r.MarginVerticalSpacing=262144]="MarginVerticalSpacing",r[r.MergeAll=32768]="MergeAll",r[r.FlowDirectionBottomToTop=65536]="FlowDirectionBottomToTop"})(Xd||(Xd={}));var Yd;(function(r){r[r.NoUnits=0]="NoUnits",r[r.Distance=1]="Distance",r[r.Angle=2]="Angle",r[r.Area=4]="Area",r[r.Volume=8]="Volume",r[r.Currency=16]="Currency",r[r.Percentage=32]="Percentage"})(Yd||(Yd={}));var H;(function(r){r[r.None=0]="None",r[r.TitleHorizontalTop=1]="TitleHorizontalTop",r[r.TitleHorizontalInsert=2]="TitleHorizontalInsert",r[r.TitleHorizontalBottom=4]="TitleHorizontalBottom",r[r.TitleVerticalLeft=8]="TitleVerticalLeft",r[r.TitleVerticalInsert=16]="TitleVerticalInsert",r[r.TitleVerticalRight=32]="TitleVerticalRight",r[r.HeaderHorizontalTop=64]="HeaderHorizontalTop",r[r.HeaderHorizontalInsert=128]="HeaderHorizontalInsert",r[r.HeaderHorizontalBottom=256]="HeaderHorizontalBottom",r[r.HeaderVerticalLeft=512]="HeaderVerticalLeft",r[r.HeaderVerticalInsert=1024]="HeaderVerticalInsert",r[r.HeaderVerticalRight=2048]="HeaderVerticalRight",r[r.DataHorizontalTop=4096]="DataHorizontalTop",r[r.DataHorizontalInsert=8192]="DataHorizontalInsert",r[r.DataHorizontalBottom=16384]="DataHorizontalBottom",r[r.DataVerticalLeft=32768]="DataVerticalLeft",r[r.DataVerticalInsert=65536]="DataVerticalInsert",r[r.DataVerticalRight=131072]="DataVerticalRight"})(H||(H={}));var fe;(function(r){r[r.None=0]="None",r[r.TitleSuppressed=1]="TitleSuppressed",r[r.HeaderSuppressed=2]="HeaderSuppressed",r[r.FlowDirection=4]="FlowDirection",r[r.HorizontalCellMargin=8]="HorizontalCellMargin",r[r.VerticalCellMargin=16]="VerticalCellMargin",r[r.TitleRowColor=32]="TitleRowColor",r[r.HeaderRowColor=64]="HeaderRowColor",r[r.DataRowColor=128]="DataRowColor",r[r.TitleRowFillNone=256]="TitleRowFillNone",r[r.HeaderRowFillNone=512]="HeaderRowFillNone",r[r.DataRowFillNone=1024]="DataRowFillNone",r[r.TitleRowFillColor=2048]="TitleRowFillColor",r[r.HeaderRowFillColor=4096]="HeaderRowFillColor",r[r.DataRowFillColor=8192]="DataRowFillColor",r[r.TitleRowAlign=16384]="TitleRowAlign",r[r.HeaderRowAlign=32768]="HeaderRowAlign",r[r.DataRowAlign=65536]="DataRowAlign",r[r.TitleTextStyle=131072]="TitleTextStyle",r[r.HeaderTextStyle=262144]="HeaderTextStyle",r[r.DataTextStyle=524288]="DataTextStyle",r[r.TitleRowHeight=1048576]="TitleRowHeight",r[r.HeaderRowHeight=2097152]="HeaderRowHeight",r[r.DataRowHeight=4194304]="DataRowHeight"})(fe||(fe={}));var Pe;(function(r){r[r.None=0]="None",r[r.CellAlignment=1]="CellAlignment",r[r.BackgroundFillNone=2]="BackgroundFillNone",r[r.BackgroundColor=4]="BackgroundColor",r[r.ContentColor=8]="ContentColor",r[r.TextStyle=16]="TextStyle",r[r.TextHeight=32]="TextHeight",r[r.TopGridColor=64]="TopGridColor",r[r.TopGridLineWeight=1024]="TopGridLineWeight",r[r.TopVisibility=16384]="TopVisibility",r[r.RightGridColor=128]="RightGridColor",r[r.RightGridLineWeight=2048]="RightGridLineWeight",r[r.RightVisibility=32768]="RightVisibility",r[r.BottomGridColor=256]="BottomGridColor",r[r.BottomGridLineWeight=4096]="BottomGridLineWeight",r[r.BottomVisibility=65536]="BottomVisibility",r[r.LeftGridColor=512]="LeftGridColor",r[r.LeftGridLineWeight=8192]="LeftGridLineWeight",r[r.LeftVisibility=131072]="LeftVisibility"})(Pe||(Pe={}));var Zd=class{value=""},qd=class{name="";value=new vt},Kd=class{distanceTopLeft=new c(0,0,0);distanceCenter=new c(0,0,0);contentWidth=0;contentHeight=0;width=0;height=0;flags=0},Sa=class{bottomRowIndex=0;leftColumnIndex=0;rightColumnIndex=0;topRowIndex=0},Fs=class{alignment=0;color=S.byBlock;hasData=!1;propertyFlags=0;propertyOverrideFlags=0;rotation=0;scale=0;textHeight=0;textStyle=null;valueDataType=0;valueFormatString="";valueUnitType=0},Ji=class{color=S.byBlock;doubleLineSpacing=0;edgeFlags;isInvisible=!1;lineWeight=F.Default;propertyOverrideFlags=0;type=_d.Single;constructor(e){this.edgeFlags=e}},Qi=class{contentType=Dd.Unknown;format=new Fs;cadValue=new vt},xt=class extends Fs{backgroundColor=S.byBlock;bottomBorder=new Ji(Ve.Bottom);bottomMargin=0;cellAlignment=gd.None;contentColor=S.byBlock;contentLayoutFlags=0;horizontalInsideBorder=new Ji(Ve.InsideHorizontal);horizontalMargin=.06;isFillColorOn=!1;leftBorder=new Ji(Ve.Left);marginHorizontalSpacing=0;marginOverrideFlags=0;marginVerticalSpacing=0;name="";rightBorder=new Ji(Ve.Right);rightMargin=0;styleClass=xd.Data;tableCellStylePropertyFlags=0;textColor=S.byBlock;topBorder=new Ji(Ve.Right);cellStyleType=Cd.Unknown;verticalInsideBorder=new Ji(Ve.InsideVertical);verticalMargin=.06;id=0},Us=class{autoFit=!1;blockScale=0;borderHeight=0;borderWidth=0;get content(){return this.contents==null||this.hasMultipleContent?null:this.contents.length>0?this.contents[0]:null}contents=[];customData=0;customDataCollection=[];edgeFlags=0;geometry=null;hasLinkedData=!1;get hasMultipleContent(){return this.contents!=null&&this.contents.length>1}mergedValue=0;rotation=0;stateFlags=0;styleOverride=new xt;toolTip="";type=Ds.Text;virtualEdgeFlag=0},Ws=class{name="";width=0;customData=0;cellStyleOverride=new xt;customDataCollection=[]},zs=class{height=0;customData=0;cellStyleOverride=new xt;cells=[];customDataCollection=[]},Jd=class{position=new c(0,0,0);height=0},Td=class{flags=yd.None;flowDirection=bd.Right;breakSpacing=0;heights=[]},Qd=class{position=new c(0,0,0);startRowIndex=0;endRowIndex=0},es=class extends Ye{get columns(){return this._content.columns}horizontalDirection=new c(0,0,0);get objectName(){return h.entityTable}get objectType(){return m.UNLISTED}overrideBorderColor=!1;overrideBorderLineWeight=!1;overrideBorderVisibility=!1;overrideFlag=!1;get rows(){return this._content.rows}get style(){return this._content.style}set style(e){this._content.style=e}get subclassMarker(){return d.tableEntity}valueFlag=0;version=0;breakRowRanges=[];get content(){return this._content}tableBreakData=new Td;_content=new Sd;clone(){return super.clone()}getBoundingBox(){return null}getCell(e,t){return this.rows[e].cells[t]}},Sd=class{columns=[];rows=[];style=null};De();T();D();B();var pr=class extends N{direction=new c(0,0,0);insertionPoint=new c(0,0,0);normal=new c(0,0,1);get objectName(){return h.entityTolerance}get objectType(){return m.TOLERANCE}get style(){return this._style}set style(e){if(e==null)throw new Error("value cannot be null");this.document!=null?this._style=A.updateCollection(e,this.document.dimensionStyles):this._style=e}get subclassMarker(){return d.tolerance}text="";_style=Q.default;applyTransform(e){this.direction=this.applyTransformToVector(e,this.direction),this.direction.getLength()>0&&(this.direction=this.direction.normalize()),this.insertionPoint=this.applyTransformToPoint(e,this.insertionPoint),this.normal=this.transformNormal(e,this.normal)}getBoundingBox(){let e=Math.max(this.style.textHeight,1e-12),t=Math.max(this.text.length,1)*e*.6,i=this.direction.getLength()>0?this.direction.normalize():c.axisX,s=this.normal.cross(i);s.getLength()===0?s=c.axisY:s=s.normalize();let a=[this.insertionPoint,new c(this.insertionPoint.x+i.x*t,this.insertionPoint.y+i.y*t,this.insertionPoint.z+i.z*t),new c(this.insertionPoint.x+s.x*e,this.insertionPoint.y+s.y*e,this.insertionPoint.z+s.z*e),new c(this.insertionPoint.x+i.x*t+s.x*e,this.insertionPoint.y+i.y*t+s.y*e,this.insertionPoint.z+i.z*t+s.z*e)];return E.fromPoints(a)}};B();var er=class extends N{get objectType(){return m.UNDEFINED}get objectName(){return this._objectName}get subclassMarker(){return this._subclassMarker}_objectName;_subclassMarker;constructor(e){super();let t=e instanceof W?e:e?.result??null;t?(this._objectName=t.dxfName||"",this._subclassMarker=t.cppClassName||""):(this._objectName="",this._subclassMarker="")}applyTransform(e){}getBoundingBox(){return null}};D();B();var Ti=class extends tt{get objectType(){return m.VERTEX_PFACE}get subclassMarker(){return d.polyfaceMeshVertex}};D();B();var fr=class extends tt{get objectType(){return m.VERTEX_PFACE_FACE}get subclassMarker(){return d.polyfaceMeshFace}index1=0;index2=0;index3=0;index4=0;get flags(){return this._flags|Fa.PolyfaceMeshVertex}set flags(e){this._flags=e}};var eh;(function(r){r[r.Top=0]="Top",r[r.Middle=1]="Middle",r[r.Bottom=2]="Bottom"})(eh||(eh={}));T();D();B();var Ts=class extends Os{get objectType(){return m.UNLISTED}get objectName(){return h.entityWipeout}get subclassMarker(){return d.wipeout}constructor(){super(),this.flags=Cr.ShowImage|Cr.ShowNotAlignedImage|Cr.UseClippingBoundary}};T();D();B();var Si=class extends N{direction=new c(0,0,0);firstPoint=new c(0,0,0);get objectName(){return h.entityXline}get objectType(){return m.XLINE}get subclassMarker(){return d.xLine}applyTransform(e){this.firstPoint=this.applyTransformToPoint(e,this.firstPoint);let t=this.applyTransformToVector(e,this.direction);t.getLength()>0&&(this.direction=t.normalize())}getBoundingBox(){return E.infinite}};var Ze=class extends Error{constructor(e){e!==void 0?super(`File version not supported: ${e}`):super("File version not recognized"),this.name="CadNotSupportedException"}};var Xo=class extends Error{innerError;constructor(e,t){super(e),this.name="DwgException",this.innerError=t??null}};var Bi=class extends Error{constructor(e,t){typeof e=="number"&&t!==void 0?super(`Invalid dxf code with value ${e}, at line ${t}.`):typeof e=="string"&&t!==void 0?super(`${e}, at line ${t}.`):super(e),this.name="DxfException"}};var th=class{static cloneTyped(e){return e.clone()}};var rh=class r{static invalidCharacters=["\\","/",":","*","?",'"',"<",">","|",";",",","=","`"];static isValidDxfName(e,t=u.AC1032){if(!e.name||t<=u.AC1015&&e.name.length>31)return!1;if(e.name.length>255)return!1;for(let i of r.invalidCharacters)if(e.name.includes(i))return!1;return!0}};var Zl=class{static getLineWeightValue(e){let t=Math.abs(e);return e===F.W0?.001:t/100}};var Yo;(function(r){r[r.Inches=0]="Inches",r[r.Millimeters=1]="Millimeters",r[r.Pixels=2]="Pixels"})(Yo||(Yo={}));var Za=class{static toUnits(e){switch(e){case Yo.Inches:return ce.Inches;case Yo.Millimeters:return ce.Millimeters;case Yo.Pixels:default:return ce.Unitless}}};var ih;(function(r){r[r.Horizontal=1]="Horizontal",r[r.Vertical=3]="Vertical",r[r.ByStyle=5]="ByStyle",r[r.ByStyleBadDoc=6]="ByStyleBadDoc"})(ih||(ih={}));var sh;(function(r){r[r.None=0]="None",r[r.EndPoint=1]="EndPoint",r[r.MidPoint=2]="MidPoint",r[r.Center=4]="Center",r[r.Node=8]="Node",r[r.Quadrant=16]="Quadrant",r[r.Intersection=32]="Intersection",r[r.Insertion=64]="Insertion",r[r.Perpendicular=128]="Perpendicular",r[r.Tangent=256]="Tangent",r[r.Nearest=512]="Nearest",r[r.ClearsAllObjectSnaps=1024]="ClearsAllObjectSnaps",r[r.ApparentIntersection=2048]="ApparentIntersection",r[r.Extension=4096]="Extension",r[r.Parallel=8192]="Parallel",r[r.AllModes=16383]="AllModes",r[r.SwitchedOff=16384]="SwitchedOff"})(sh||(sh={}));var ah;(function(r){r[r.FacesShadedEdgesNotHighlighted=0]="FacesShadedEdgesNotHighlighted",r[r.FacesShadedEdgesHighlightedInBlack=1]="FacesShadedEdgesHighlightedInBlack",r[r.FacesNotFilledEdgesInEntityColor=2]="FacesNotFilledEdgesInEntityColor",r[r.FacesInEntityColorEdgesInBlack=3]="FacesInEntityColorEdgesInBlack"})(ah||(ah={}));var $s=class r{static toUInt16(e,t=0){return e[t]|e[t+1]<<8}static toInt16(e,t=0){let i=r.toUInt16(e,t);return i>32767?i-65536:i}static toUInt32(e,t=0){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}static toInt32(e,t=0){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}static toFloat64(e,t=0){return new DataView(e.buffer,e.byteOffset+t,8).getFloat64(0,!0)}static toFloat32(e,t=0){return new DataView(e.buffer,e.byteOffset+t,4).getFloat32(0,!0)}static getBytes(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}static getBytes32(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}};xr();te();B();D();var Kr=class extends M{get objectType(){return m.UNDEFINED}get objectName(){return this.dxfClass?this.dxfClass.dxfName:"UNKNOWN"}get subclassMarker(){return this.dxfClass?this.dxfClass.cppClassName:d.entity}dxfClass;constructor(e){super(),this.dxfClass=e instanceof W?e:e?.result??null}};var y;(function(r){r[r.NotImplemented=-1]="NotImplemented",r[r.None=0]="None",r[r.NotSupported=1]="NotSupported",r[r.Warning=2]="Warning",r[r.Error=3]="Error"})(y||(y={}));var tr=class{message;notificationType;exception;constructor(e,t=y.None,i=null){this.message=e,this.notificationType=t,this.exception=i}};var qa=class{onNotification=null;appIds=new Dr;blockRecords=new Tr;dimensionStyles=new Wt;documentToBuild;initialHandSeed=0;layers=new Sr;lineTypesTable=new Br;textStyles=new Rr;ucSs=new Nr;version;views=new Ar;vPorts=new vr;cadObjects=new Map;cadObjectsTemplates=new Map;dictionaryTemplates=new Map;tableEntryTemplates=new Map;tableTemplates=new Map;templatesMap=new Map;unassignedObjects=[];constructor(e,t){this.version=e,this.documentToBuild=t}addTemplate(e){if(!this._addToMap(e))return;let t=e.cadObject.handle;this._isDictionaryTemplate(e)?this.dictionaryTemplates.set(t,e):this._isTableTemplate(e)?this.tableTemplates.set(t,e):this._isTableEntryTemplate(e)?this.tableEntryTemplates.set(t,e):this.cadObjectsTemplates.set(t,e)}buildDocument(){for(let e of this.tableEntryTemplates.values())e.build(this);for(let e of this.cadObjectsTemplates.values())e.build(this)}buildTable(e){let t=this.tableTemplates.get(e.handle);t?t.build(this):this.notify(`Table ${e.objectName} not found in the document`,y.Warning)}buildTables(){this.buildTable(this.appIds),this.buildTable(this.textStyles),this.buildTable(this.lineTypesTable),this.buildTable(this.layers),this.buildTable(this.ucSs),this.buildTable(this.views),this.buildTable(this.blockRecords),this.buildTable(this.dimensionStyles),this.buildTable(this.vPorts)}getObjectTemplate(e){let t=this.templatesMap.get(e);return t||null}notify(e,t=y.None,i=null){this.onNotification?.(this,new tr(e,t,i))}registerTables(){this.documentToBuild.registerCollection(this.appIds),this.documentToBuild.registerCollection(this.textStyles),this.documentToBuild.registerCollection(this.lineTypesTable),this.documentToBuild.registerCollection(this.layers),this.documentToBuild.registerCollection(this.ucSs),this.documentToBuild.registerCollection(this.views),this.documentToBuild.registerCollection(this.blockRecords),this.documentToBuild.registerCollection(this.dimensionStyles),this.documentToBuild.registerCollection(this.vPorts)}tryGetCadObject(e){if(e==null||e===0)return null;let t=this.cadObjects.get(e);return t?t instanceof er&&!this.keepUnknownEntities||t instanceof Kr&&!this.keepUnknownNonGraphicalObjects?null:t:null}tryGetObjectTemplate(e){if(e==null||e===0)return null;let t=this.templatesMap.get(e);return t||null}tryGetTableEntry(e){if(!e||e.length===0)return null;let t=[this.appIds,this.layers,this.lineTypesTable,this.ucSs,this.views,this.dimensionStyles,this.textStyles,this.vPorts,this.blockRecords];for(let i of t){let s=i.tryGetValue(e);if(s)return s}return null}buildDictionaries(){for(let e of this.dictionaryTemplates.values())e.build(this);if(!this.documentToBuild.rootDictionary){let e=[];for(let t of this.dictionaryTemplates.values())t.cadObject instanceof re&&t.cadObject.owner==null&&e.push(t.cadObject);e.length!==1?this.notify("The root dictionary could not be found.",y.Warning):this.documentToBuild.rootDictionary=e[0]}this.documentToBuild.updateCollections(!0,!1)}createMissingHandles(){let e=Number.isFinite(this.initialHandSeed)?this.initialHandSeed:0,t=this.unassignedObjects;for(this.unassignedObjects=[];t.length>0;){for(let i of t)e+=1,i.cadObject.handle=e,this.addTemplate(i);t=this.unassignedObjects,this.unassignedObjects=[]}this.initialHandSeed=e}registerTable(e,t){e?this.documentToBuild.registerCollection(e):this.documentToBuild.registerCollection(new t)}_addToMap(e){return e.cadObject.handle===0?(this._pushUnassigned(e),!1):this.templatesMap.has(e.cadObject.handle)?(this.notify(`Repeated handle found ${e.cadObject.handle}.`,y.Warning),e.cadObject.handle=0,this._pushUnassigned(e),!1):(e.cadObject.handle>this.initialHandSeed&&(this.initialHandSeed=e.cadObject.handle),this.templatesMap.set(e.cadObject.handle,e),this.cadObjects.set(e.cadObject.handle,e.cadObject),!0)}_pushUnassigned(e){Array.isArray(this.unassignedObjects)||(this.unassignedObjects=[]);try{this.unassignedObjects.push(e)}catch(t){if(t instanceof RangeError){this.notify("Resetting unassigned object queue due to invalid array length.",y.Warning,t),this.unassignedObjects=[e];return}throw t}}_isDictionaryTemplate(e){return e.cadObject instanceof re}_isTableTemplate(e){return"entryHandles"in e}_isTableEntryTemplate(e){return"type"in e&&"name"in e&&!("entryHandles"in e)}};var Cu="ANSI_1252",Du="windows-1252",Bd=63,Tu=new Set(["ascii","ibm866","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","iso-8859-10","iso-8859-13","iso-8859-15","macintosh","windows-874","windows-1250","windows-1251","windows-1252","windows-1253","windows-1254","windows-1255","windows-1256","windows-1257","windows-1258"]),iu=new Map,Su=new Map([[8364,128],[8218,130],[402,131],[8222,132],[8230,133],[8224,134],[8225,135],[710,136],[8240,137],[352,138],[8249,139],[338,140],[381,142],[8216,145],[8217,146],[8220,147],[8221,148],[8226,149],[8211,150],[8212,151],[732,152],[8482,153],[353,154],[8250,155],[339,156],[382,158],[376,159]]);function su(r){let e=r?.trim();return e||Cu}function Ss(r){let e=Eu(r);if(e)return e;switch(vu(r)){case C.Usascii:return"ascii";case C.Iso88591:return"iso-8859-1";case C.Iso88592:return"iso-8859-2";case C.Iso88593:return"iso-8859-3";case C.Iso88594:return"iso-8859-4";case C.Iso88595:return"iso-8859-5";case C.Iso88596:return"iso-8859-6";case C.Iso88597:return"iso-8859-7";case C.Iso88598:return"iso-8859-8";case C.Iso88599:return"iso-8859-9";case C.Iso885910:return"iso-8859-10";case C.Iso885913:return"iso-8859-13";case C.Iso885915:return"iso-8859-15";case C.Windows874:return"windows-874";case C.Windows1250:return"windows-1250";case C.Windows1251:return"windows-1251";case C.Windows1252:return"windows-1252";case C.Windows1253:return"windows-1253";case C.Windows1254:return"windows-1254";case C.Windows1255:return"windows-1255";case C.Windows1256:return"windows-1256";case C.Windows1257:return"windows-1257";case C.Windows1258:return"windows-1258";case C.Cp866:return"ibm866";case C.Macintosh:case C.Xmacromanian:return"macintosh";case C.Gb2312:return"gb2312";case C.Ksc5601:case C.Johab:return"euc-kr";case C.big5:return"big5";case C.Shift_jis:return"shift_jis";case C.Utf16:return"utf-16le";default:return Du}}function ts(r,e){let t=r??"",i=Ss(e);return i==="utf-8"?new TextEncoder().encode(t):i==="utf-16le"?nh(t):Tu.has(i)?Bu(t,i):Au(t)}function au(r,e){return!r||r.length===0?"":new TextDecoder(Ss(e)).decode(r)}function nh(r){let e=r??"",t=new Uint8Array(e.length*2);for(let i=0;i>>8&255}return t}function Bu(r,e){let t=Ru(e),i=new Uint8Array(r.length);for(let s=0;s>>0}static toUInt16(e,t=0){return e[t]<<8|e[t+1]}};var Bs=class r{static crcTable=new Uint16Array([0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448]);static crc32Table=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);static applyCrc8(e,t){let i=e;for(let s=0;s>8&255^r.crcTable[a&255]}return i}};var ql=class r{_data;_position=0;_seed;get seed(){return~this._seed>>>0}get length(){return this._data.length}get position(){return this._position}set position(e){this._position=e}constructor(e,t,i=!1){if(i){let s=1;for(let a=0;a>16&255;e[a]=(e[a]^n)&255}}this._data=e,this._seed=~t>>>0}static fromStream(e,t){return new r(e,t,!1)}read(e,t,i){let s=t+i,a=Math.min(i,this._data.length-this._position);for(let n=0;n>>8^Bs.crc32Table[(this._seed^this._data[this._position+n])&255])>>>0;return this._position+=a,a}write(e,t,i){let s=t+i;for(let a=t;a>>8^Bs.crc32Table[(this._seed^e[a])&255])>>>0;for(let a=0;a0;)a=r._decode(a,t[n]),n++;return a}static _decode(e,t){let i=t^e&255;return e=(e>>>8^Bs.crcTable[i])&65535,e}};var Ct=class{static magicSequence=(()=>{let e=new Uint8Array(256),t=1;for(let i=0;i<256;i++)t=t*214013+2531011|0,e[i]=t>>16&255;return e})();static compressionCalculator(e){return 31-(e+32-1)%32}static calculate(e,t,i,s){let a=e&65535,n=e>>>16&65535,o=i,l=s;for(;l!==0;){let p=Math.min(5552,l);l-=p;for(let b=0;b>>0}};var Qa=class{_handles=new Map;get cmaterial(){return this.getHandle("CMATERIAL")}set cmaterial(e){this.setHandle("CMATERIAL",e)}get clayer(){return this.getHandle("CLAYER")}set clayer(e){this.setHandle("CLAYER",e)}get textstyle(){return this.getHandle("TEXTSTYLE")}set textstyle(e){this.setHandle("TEXTSTYLE",e)}get celtype(){return this.getHandle("CELTYPE")}set celtype(e){this.setHandle("CELTYPE",e)}get dimstyle(){return this.getHandle("DIMSTYLE")}set dimstyle(e){this.setHandle("DIMSTYLE",e)}get cmlstyle(){return this.getHandle("CMLSTYLE")}set cmlstyle(e){this.setHandle("CMLSTYLE",e)}get ucsname_pspace(){return this.getHandle("UCSNAME_PSPACE")}set ucsname_pspace(e){this.setHandle("UCSNAME_PSPACE",e)}get ucsname_mspace(){return this.getHandle("UCSNAME_MSPACE")}set ucsname_mspace(e){this.setHandle("UCSNAME_MSPACE",e)}get pucsorthoref(){return this.getHandle("PUCSORTHOREF")}set pucsorthoref(e){this.setHandle("PUCSORTHOREF",e)}get pucsbase(){return this.getHandle("PUCSBASE")}set pucsbase(e){this.setHandle("PUCSBASE",e)}get ucsorthoref(){return this.getHandle("UCSORTHOREF")}set ucsorthoref(e){this.setHandle("UCSORTHOREF",e)}get dimtxsty(){return this.getHandle("DIMTXSTY")}set dimtxsty(e){this.setHandle("DIMTXSTY",e)}get dimldrblk(){return this.getHandle("DIMLDRBLK")}set dimldrblk(e){this.setHandle("DIMLDRBLK",e)}get dimblk(){return this.getHandle("DIMBLK")}set dimblk(e){this.setHandle("DIMBLK",e)}get dimblk1(){return this.getHandle("DIMBLK1")}set dimblk1(e){this.setHandle("DIMBLK1",e)}get dimblk2(){return this.getHandle("DIMBLK2")}set dimblk2(e){this.setHandle("DIMBLK2",e)}get dictionary_layouts(){return this.getHandle("DICTIONARY_LAYOUTS")}set dictionary_layouts(e){this.setHandle("DICTIONARY_LAYOUTS",e)}get dictionary_plotsettings(){return this.getHandle("DICTIONARY_PLOTSETTINGS")}set dictionary_plotsettings(e){this.setHandle("DICTIONARY_PLOTSETTINGS",e)}get dictionary_plotstyles(){return this.getHandle("DICTIONARY_PLOTSTYLES")}set dictionary_plotstyles(e){this.setHandle("DICTIONARY_PLOTSTYLES",e)}get cpsnid(){return this.getHandle("CPSNID")}set cpsnid(e){this.setHandle("CPSNID",e)}get paper_space(){return this.getHandle("PAPER_SPACE")}set paper_space(e){this.setHandle("PAPER_SPACE",e)}get model_space(){return this.getHandle("MODEL_SPACE")}set model_space(e){this.setHandle("MODEL_SPACE",e)}get bylayer(){return this.getHandle("BYLAYER")}set bylayer(e){this.setHandle("BYLAYER",e)}get byblock(){return this.getHandle("BYBLOCK")}set byblock(e){this.setHandle("BYBLOCK",e)}get continuous(){return this.getHandle("CONTINUOUS")}set continuous(e){this.setHandle("CONTINUOUS",e)}get dimltype(){return this.getHandle("DIMLTYPE")}set dimltype(e){this.setHandle("DIMLTYPE",e)}get dimltex1(){return this.getHandle("DIMLTEX1")}set dimltex1(e){this.setHandle("DIMLTEX1",e)}get dimltex2(){return this.getHandle("DIMLTEX2")}set dimltex2(e){this.setHandle("DIMLTEX2",e)}get viewport_entity_header_control_object(){return this.getHandle("VIEWPORT_ENTITY_HEADER_CONTROL_OBJECT")}set viewport_entity_header_control_object(e){this.setHandle("VIEWPORT_ENTITY_HEADER_CONTROL_OBJECT",e)}get dictionary_acad_group(){return this.getHandle("DICTIONARY_ACAD_GROUP")}set dictionary_acad_group(e){this.setHandle("DICTIONARY_ACAD_GROUP",e)}get dictionary_acad_mlinestyle(){return this.getHandle("DICTIONARY_ACAD_MLINESTYLE")}set dictionary_acad_mlinestyle(e){this.setHandle("DICTIONARY_ACAD_MLINESTYLE",e)}get dictionary_named_objects(){return this.getHandle("DICTIONARY_NAMED_OBJECTS")}set dictionary_named_objects(e){this.setHandle("DICTIONARY_NAMED_OBJECTS",e)}get block_control_object(){return this.getHandle("BLOCK_CONTROL_OBJECT")}set block_control_object(e){this.setHandle("BLOCK_CONTROL_OBJECT",e)}get layer_control_object(){return this.getHandle("LAYER_CONTROL_OBJECT")}set layer_control_object(e){this.setHandle("LAYER_CONTROL_OBJECT",e)}get style_control_object(){return this.getHandle("STYLE_CONTROL_OBJECT")}set style_control_object(e){this.setHandle("STYLE_CONTROL_OBJECT",e)}get linetype_control_object(){return this.getHandle("LINETYPE_CONTROL_OBJECT")}set linetype_control_object(e){this.setHandle("LINETYPE_CONTROL_OBJECT",e)}get view_control_object(){return this.getHandle("VIEW_CONTROL_OBJECT")}set view_control_object(e){this.setHandle("VIEW_CONTROL_OBJECT",e)}get ucs_control_object(){return this.getHandle("UCS_CONTROL_OBJECT")}set ucs_control_object(e){this.setHandle("UCS_CONTROL_OBJECT",e)}get vport_control_object(){return this.getHandle("VPORT_CONTROL_OBJECT")}set vport_control_object(e){this.setHandle("VPORT_CONTROL_OBJECT",e)}get appid_control_object(){return this.getHandle("APPID_CONTROL_OBJECT")}set appid_control_object(e){this.setHandle("APPID_CONTROL_OBJECT",e)}get dimstyle_control_object(){return this.getHandle("DIMSTYLE_CONTROL_OBJECT")}set dimstyle_control_object(e){this.setHandle("DIMSTYLE_CONTROL_OBJECT",e)}get dictionary_materials(){return this.getHandle("DICTIONARY_MATERIALS")}set dictionary_materials(e){this.setHandle("DICTIONARY_MATERIALS",e)}get dictionary_colors(){return this.getHandle("DICTIONARY_COLORS")}set dictionary_colors(e){this.setHandle("DICTIONARY_COLORS",e)}get dictionary_visualstyle(){return this.getHandle("DICTIONARY_VISUALSTYLE")}set dictionary_visualstyle(e){this.setHandle("DICTIONARY_VISUALSTYLE",e)}get interfereobjvs(){return this.getHandle("INTERFEREOBJVS")}set interfereobjvs(e){this.setHandle("INTERFEREOBJVS",e)}get interferevpvs(){return this.getHandle("INTERFEREVPVS")}set interferevpvs(e){this.setHandle("INTERFEREVPVS",e)}get dragvs(){return this.getHandle("DRAGVS")}set dragvs(e){this.setHandle("DRAGVS",e)}get ucsbase(){return this.getHandle("UCSBASE")}set ucsbase(e){this.setHandle("UCSBASE",e)}getHandle(e){return this._handles.get(e)??null}setHandle(e,t){this._handles.set(e,t)}getHandles(){return Array.from(this._handles.values())}updateHeader(e,t){let i;i=t.tryGetCadObject(this.clayer),i&&t.documentToBuild.layers?.tryGetValue(i.name)&&(e.currentLayerName=i.name),i=t.tryGetCadObject(this.celtype),i&&t.documentToBuild.lineTypes?.tryGetValue(i.name)&&(e.currentLineTypeName=i.name),i=t.tryGetCadObject(this.cmlstyle),i&&(e.currentMLineStyleName=i.name),i=t.tryGetCadObject(this.textstyle),i&&t.documentToBuild.textStyles?.tryGetValue(i.name)&&(e.currentTextStyleName=i.name),i=t.tryGetCadObject(this.dimtxsty),i&&t.documentToBuild.textStyles?.tryGetValue(i.name)&&(e.dimensionTextStyleName=i.name),i=t.tryGetCadObject(this.dimstyle),i&&t.documentToBuild.dimensionStyles?.tryGetValue(i.name)&&(e.currentDimensionStyleName=i.name);let s;s=t.tryGetCadObject(this.dimblk),s&&(e.dimensionBlockName=s.name),s=t.tryGetCadObject(this.dimldrblk),s&&(e.dimensionBlockName=s.name),s=t.tryGetCadObject(this.dimblk1),s&&(e.dimensionBlockNameFirst=s.name),s=t.tryGetCadObject(this.dimblk2),s&&(e.dimensionBlockNameSecond=s.name)}};var en=class extends qa{configuration;headerHandles=new Qa;blockRecordTemplates=[];paperSpaceEntities=[];modelSpaceEntities=[];get keepUnknownEntities(){return this.configuration.keepUnknownEntities}get keepUnknownNonGraphicalObjects(){return this.configuration.keepUnknownNonGraphicalObjects}constructor(e,t,i){super(e,t),this.configuration=i}buildDocument(){this.createMissingHandles();for(let e of this.blockRecordTemplates)e.setBlockToRecord(this,this.headerHandles);this.registerTables(),this.buildTables(),this.documentToBuild.vEntityControl&&(this.documentToBuild.registerCollection(this.documentToBuild.vEntityControl),this.buildTable(this.documentToBuild.vEntityControl)),this.buildDictionaries(),super.buildDocument(),this._ensureDefaultTableEntries(),this.headerHandles.updateHeader(this.documentToBuild.header,this)}_ensureDefaultTableEntries(){let e=this.documentToBuild;e.lineTypes&&typeof e.lineTypes.createDefaultEntries=="function"&&e.lineTypes.createDefaultEntries(),e.layers&&typeof e.layers.createDefaultEntries=="function"&&e.layers.createDefaultEntries(),e.blockRecords&&typeof e.blockRecords.createDefaultEntries=="function"&&e.blockRecords.createDefaultEntries(),e.textStyles&&typeof e.textStyles.createDefaultEntries=="function"&&e.textStyles.createDefaultEntries(),e.dimensionStyles&&typeof e.dimensionStyles.createDefaultEntries=="function"&&e.dimensionStyles.createDefaultEntries(),e.appIds&&typeof e.appIds.createDefaultEntries=="function"&&e.appIds.createDefaultEntries(),e.vPorts&&typeof e.vPorts.createDefaultEntries=="function"&&e.vPorts.createDefaultEntries()}};var oh=null,rs=class{acadVersion;previewAddress=-1;acadMaintenanceVersion=0;drawingCodePage=0;constructor(e){this.acadVersion=e??u.Unknown}static registerFactory(e){oh=e}static createFileHeader(e){if(!oh)throw new Error("DwgFileHeader factory not registered. Import DwgFileHeaderFactory first.");return oh(e)}};var R=class r{static acDbObjects="AcDb:AcDbObjects";static appInfo="AcDb:AppInfo";static auxHeader="AcDb:AuxHeader";static classes="AcDb:Classes";static fileDepList="AcDb:FileDepList";static handles="AcDb:Handles";static header="AcDb:Header";static objFreeSpace="AcDb:ObjFreeSpace";static preview="AcDb:Preview";static revHistory="AcDb:RevHistory";static summaryInfo="AcDb:SummaryInfo";static template="AcDb:Template";static endSentinels=new Map([[r.header,new Uint8Array([48,132,224,220,2,33,199,86,160,131,151,71,177,146,204,160])],[r.classes,new Uint8Array([114,94,59,71,59,86,7,58,63,35,11,160,24,48,73,117])],[r.preview,new Uint8Array([224,218,146,248,43,201,215,215,98,168,53,192,98,187,239,212])]]);static startSentinels=new Map([[r.header,new Uint8Array([207,123,31,35,253,222,56,169,95,124,104,184,78,109,51,95])],[r.classes,new Uint8Array([141,161,196,184,196,169,248,197,192,220,244,95,231,207,182,138])],[r.preview,new Uint8Array([31,37,109,7,212,54,40,40,157,87,202,63,157,68,16,43])]]);static getSectionLocatorByName(e){switch(e){case r.header:return 0;case r.classes:return 1;case r.handles:return 2;case r.objFreeSpace:return 3;case r.template:return 4;case r.auxHeader:return 5;default:return null}}};var Qr=class{pageType=1097008187;name="";compressedSize=0;pageCount=0;decompressedSize=29696;_compressed=2;get compressedCode(){return this._compressed}set compressedCode(e){if(e===1||e===2)this._compressed=e;else throw new Error("Invalid compressed code")}get isCompressed(){return this._compressed===2}sectionId=0;encrypted=0;hashCode=null;encoding=null;localSections=[];constructor(e){e!==void 0&&(this.name=e)}};var is=class extends rs{static endSentinel=new Uint8Array([149,160,78,40,153,130,26,229,94,65,224,95,157,58,77,0]);records=new Map;_descriptors=new Map;constructor(e){super(e)}addSection(e){this._descriptors.has(e)||this._descriptors.set(e,new Qr(e))}getDescriptor(e){let t=this._descriptors.get(e);if(t)return t;let i=new Qr(e),s=R.getSectionLocatorByName(e);if(s!==null){let a=this.records.get(s);a&&(i.compressedSize=a.size,i.decompressedSize=a.size,i.pageCount=1,i.compressedCode=1)}return this._descriptors.set(e,i),i}};var Rs=class extends is{dwgVersion=0;appReleaseVersion=0;summaryInfoAddr=0;securityType=0;vbaProjectAddr=0;rootTreeNodeGap=0;gapArraySize=0;crcSeed=0;lastPageId=0;lastSectionAddr=0;secondHeaderAddr=0;gapAmount=0;sectionAmount=0;sectionPageMapId=0;pageMapAddress=0;sectionMapId=0;sectionArrayPageSize=0;rigthGap=0;leftGap=0;descriptors=new Map;constructor(e){super(e)}addSection(e){this.descriptors.set(e,new Qr(e))}addSectionDescriptor(e){this.descriptors.set(e.name,e)}getDescriptor(e){return this.descriptors.get(e)}};var Kl=class extends Rs{compressedMetadata;constructor(e){super(e)}};rs.registerFactory(r=>{switch(r){case u.Unknown:throw new Ze;case u.MC0_0:case u.AC1_2:case u.AC1_4:case u.AC1_50:case u.AC2_10:case u.AC1002:case u.AC1003:case u.AC1004:case u.AC1006:case u.AC1009:throw new Ze(r);case u.AC1012:case u.AC1014:case u.AC1015:return new is(r);case u.AC1018:return new Rs(r);case u.AC1021:return new Kl(r);case u.AC1024:case u.AC1027:case u.AC1032:return new Rs(r);default:break}return null});var Ns=class{compression=2;isEmpty=!1;offset=0;compressedSize=0;pageNumber=0;decompressedSize=0;seeker=0;size=0;checksum=0;crc=0;pageSize=0;oda=0;sectionMap=0;constructor(e){e!==void 0&&(this.sectionMap=e)}};var Ot=class{number=null;seeker=0;size=0;stream=null;constructor(e,t,i){e!==void 0&&(this.number=e??null),t!==void 0&&(this.seeker=t),i!==void 0&&(this.size=i)}isInTheRecord(e){return e>=this.seeker&&e=u.AC1012&&e<=u.AC1015,this.r2000Plus=e>=u.AC1015,this.r2004Pre=e=u.AC1018,this.r2007Plus=e>=u.AC1021,this.r2010Plus=e>=u.AC1024,this.r2013Plus=e>=u.AC1027,this.r2018Plus=e>=u.AC1032}static checkSentinel(e,t){if(t.length!==e.length)return!1;for(let i=0;i>>8-this.bitShift)&255}readBytes(e){let t=new Uint8Array(e);return this._applyShiftToArr(e,t),t}setPositionByFlag(e){this.setPositionInBits(e);let t=this.readBit(),i=e;if(t){let s=this.applyFlagToPosition(e);i=s.length-s.strDataSize,this.setPositionInBits(i)}else this.isEmpty=!0,this.position=this._stream.length;return i}readBit(){if(this.bitShift===0){this.advanceByte();let t=(this._lastByte&128)===128;return this.bitShift=1,t}let e=(this._lastByte<>>6,this.bitShift=2;else if(this.bitShift===7){let t=this._lastByte<<1&2;this.advanceByte(),e=t|this._lastByte>>>7,this.bitShift=1}else e=this._lastByte>>>6-this.bitShift&3,++this.bitShift,++this.bitShift,this.bitShift&=7;return e}readBitShort(){let e;switch(this.read2Bits()){case 0:e=this.readShortLittleEndian();break;case 1:if(this.bitShift===0){this.advanceByte(),e=this._lastByte;break}e=this.applyShiftToLastByte();break;case 2:e=0;break;case 3:e=256;break;default:throw this.throwException("ReadBitShort")}return e>32767&&(e-=65536),e}readBitShortAsBool(){return this.readBitShort()!==0}readBitLong(){let e;switch(this.read2Bits()){case 0:e=this.readIntLittleEndian();break;case 1:if(this.bitShift===0){this.advanceByte(),e=this._lastByte;break}e=this.applyShiftToLastByte();break;case 2:e=0;break;default:throw new Error("Failed to read ReadBitLong")}return e}readBitLongLong(){let e=0,t=this._read3bits();for(let i=0;i0&&(e=-e);else{let t=0,i=this._lastByte&127;for(;t+=7,this.advanceByte(),(this._lastByte&128)!==0;)i|=(this._lastByte&127)<0&&(e=-e)}else{let t=this.applyShiftToLastByte();if((t&128)===0)e=t&63,(t&64)>0&&(e=-e);else{let i=0,s=t&127,a;for(;i+=7,a=this.applyShiftToLastByte(),(a&128)!==0;)s|=(a&127)<0&&(e=-e)}}return e}readModularShort(){let e=15,t=this.readByte(),i=this.readByte(),s=(i&128)===0,a=t|(i&127)<<8;for(;!s;)t=this.readByte(),i=this.readByte(),s=(i&128)===0,a|=t<>>4,s=t&15,a=i&3,n;if(i<=5)n=this._readHandle(s);else if(i===6)n=e+1;else if(i===8)n=e-1;else if(i===10){let o=this._readHandle(s);n=e+o}else if(i===12){let o=this._readHandle(s);n=e-o}else throw new Xo(`[HandleReference] invalid reference code with value: ${i}`);return{handle:n,reference:a}}_readHandle(e){let t=new Uint8Array(e),i=new Uint8Array(8);for(let o=0;o>>o)&255;i[e-1-l]=b}}for(let o=e;o<8;++o)i[o]=0;let s=new DataView(i.buffer),a=s.getUint32(0,!0),n=s.getUint32(4,!0);return a+n*4294967296}readTextUnicode(){let e=this.readShort(),t=this.readByte(),i;return e===0?i="":i=this.readStringEncoded(e,this._getEncodingFromCodePage(t)),i}readVariableText(){let e=this.readBitShort(),t;return e>0?t=this.readStringEncoded(e,this.encoding).replace(/\0/g,""):t="",t}readSentinel(){return this.readBytes(16)}read2BitDoubleWithDefault(e){return new g(this.readBitDoubleWithDefault(e.x),this.readBitDoubleWithDefault(e.y))}read3BitDoubleWithDefault(e){return new c(this.readBitDoubleWithDefault(e.x),this.readBitDoubleWithDefault(e.y),this.readBitDoubleWithDefault(e.z))}readCmColor(e=!1){let t=this.readBitShort();return new S(t)}readEnColor(){let e=this.readBitShort();return{color:new S(e),transparency:Ee.byLayer,flag:!1}}readColorByIndex(){return new S(this.readBitShort())}readObjectType(){return this.readBitShort()}readBitExtrusion(){return this.read3BitDouble()}readBitDoubleWithDefault(e){let t=new Uint8Array(8),i=new DataView(new ArrayBuffer(8));i.setFloat64(0,e,!0);for(let s=0;s<8;s++)t[s]=new Uint8Array(i.buffer)[s];switch(this.read2Bits()){case 0:return e;case 1:if(this.bitShift===0)this.advanceByte(),t[0]=this._lastByte,this.advanceByte(),t[1]=this._lastByte,this.advanceByte(),t[2]=this._lastByte,this.advanceByte(),t[3]=this._lastByte;else{let s=8-this.bitShift;t[0]=this._lastByte<>>s)&255,t[1]=this._lastByte<>>s)&255,t[2]=this._lastByte<>>s)&255,t[3]=this._lastByte<>>s)&255}return new DataView(t.buffer).getFloat64(0,!0);case 2:if(this.bitShift===0)this.advanceByte(),t[4]=this._lastByte,this.advanceByte(),t[5]=this._lastByte,this.advanceByte(),t[0]=this._lastByte,this.advanceByte(),t[1]=this._lastByte,this.advanceByte(),t[2]=this._lastByte,this.advanceByte(),t[3]=this._lastByte;else{let s=8-this.bitShift;t[4]=this._lastByte<>>s)&255,t[5]=this._lastByte<>>s)&255,t[0]=this._lastByte<>>s)&255,t[1]=this._lastByte<>>s)&255,t[2]=this._lastByte<>>s)&255,t[3]=this._lastByte<>>s)&255}return new DataView(t.buffer).getFloat64(0,!0);case 3:return this.readDouble();default:throw this.throwException("ReadBitDoubleWithDefault")}}readBitThickness(){return this.readBitDouble()}read8BitJulianDate(){return this._julianToDate(this.readInt(),this.readInt())}readDateTime(){return this._julianToDate(this.readBitLong(),this.readBitLong())}readTimeSpan(){let e=this.readBitLong(),t=this.readBitLong();return e*36e5+t}positionInBits(){let e=this._position*8;return this.bitShift>0&&(e+=this.bitShift-8),e}setPositionInBits(e){this.position=e>>3,this.bitShift=e&7,!(this.bitShift<=0)&&this.advanceByte()}advanceByte(){this._lastByte=this._stream[this._position++]}advance(e){e>1&&(this._position+=e-1),this.readByte()}resetShift(){this.bitShift>0&&(this.bitShift=0),this.advanceByte();let e=this._lastByte;return this.advanceByte(),(e|this._lastByte<<8)&65535}readShort(){let e=this.readByte(),t=this.readByte(),i=e|t<<8;return i>32767&&(i-=65536),i}readShortLittleEndian(){return this.readShort()}readShortBigEndian(){let e=this.readByte(),t=this.readByte(),i=e<<8|t;return i>32767&&(i-=65536),i}readInt(){let e=this.readByte(),t=this.readByte(),i=this.readByte(),s=this.readByte();return e|t<<8|i<<16|s<<24}readIntLittleEndian(){return this.readInt()}readUInt(){return this.readInt()>>>0}readDouble(){let e=this.readBytes(8);return new DataView(e.buffer,e.byteOffset,8).getFloat64(0,!0)}readDoubleLittleEndian(){return this.readDouble()}readUShort(){let e=this.readByte(),t=this.readByte();return(e|t<<8)&65535}readULongLittleEndian(){let e=this.readByte(),t=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),n=this.readByte(),o=this.readByte(),l=this.readByte(),p=(e|t<<8|i<<16|s<<24)>>>0,b=(a|n<<8|o<<16|l<<24)>>>0;return p+b*4294967296}readStringEncoded(e,t){let i=this.readBytes(e);return new TextDecoder(t).decode(i)}applyFlagToPosition(e){let t=e-16;this.setPositionInBits(t);let i=this.readUShort();if((i&32768)>0){t-=16,this.setPositionInBits(t),i&=32767;let s=this.readUShort();i+=(s&65535)<<15}return{length:t,strDataSize:i}}applyShiftToLastByte(){let e=this._lastByte<>>8-this.bitShift)&255}throwException(e){return new Xo(`Failed to read ${e||"unknown"}`)}_applyShiftToArr(e,t){for(let s=0;s>>i)&255;t[s]=n}}_read3bits(){let e=0;this.readBit()&&(e=1);let t=e<<1&255;this.readBit()&&(t|=1);let i=t<<1&255;return this.readBit()&&(i|=1),i}_julianToDate(e,t){let i=(e-24405875e-1)*86400;try{return new Date(i*1e3+t)}catch{return new Date(0)}}_getEncodingFromCodePage(e){switch(e){case 0:return"utf-8";case 1:return"ascii";case 28591:return"iso-8859-1";case 1252:return"windows-1252";case 1250:return"windows-1250";case 1251:return"windows-1251";case 1253:return"windows-1253";case 1254:return"windows-1254";case 1255:return"windows-1255";case 1256:return"windows-1256";case 1257:return"windows-1257";case 1258:return"windows-1258";case 932:return"shift_jis";case 936:return"gb2312";case 949:return"euc-kr";case 950:return"big5";case 65001:return"utf-8";default:return"windows-1252"}}};var rn=class extends Be{constructor(e,t){super(e,t)}};var sn=class extends rn{constructor(e,t){super(e,t)}readBitExtrusion(){return this.readBit()?c.axisZ:this.read3BitDouble()}readBitThickness(){return this.readBit()?0:this.readBitDouble()}};var Ys=class extends sn{constructor(e,t){super(e,t)}readCmColor(e=!1){let t=S.byLayer,i=this.readBitShort(),s=this.readBitLong()>>>0,a=new Uint8Array(4);a[0]=s&255,a[1]=s>>>8&255,a[2]=s>>>16&255,a[3]=s>>>24&255,s===3221225472?t=S.byLayer:(s&16777216)!==0?t=new S(a[0]):t=S.fromTrueColor(a[2]<<16|a[1]<<8|a[0]);let n=this.readByte(),o="";(n&1)===1&&(o=this.readVariableText());let l="";return(n&2)===2&&(l=this.readVariableText()),t}readEnColor(){let e=new S(0),t=Ee.byLayer,i=!1,s=this.readBitShort();if(s!==0){let a=s&65280&65535;if((a&16384)>0)e=S.byBlock,i=!0;else if((a&32768)>0){let n=this.readBitLong()>>>0,o=new Uint8Array(4);o[0]=n&255,o[1]=n>>>8&255,o[2]=n>>>16&255,o[3]=n>>>24&255,e=S.fromTrueColor(o[2]<<16|o[1]<<8|o[0])}else e=new S(s&4095);if((a&8192)>0){let n=this.readBitLong();t=Ee.fromAlphaValue(n)}else t=Ee.byLayer}else e=S.byBlock,t=Ee.opaque;return{color:e,transparency:t,flag:i}}};var an=class extends Ys{constructor(e,t){super(e,t)}readTextUnicode(){let e=this.readShortLittleEndian(),t;if(e===0)t="";else{let i=e<<1&65535;t=this.readStringEncoded(i,"utf-16le").replace(/\0/g,"")}return t}readVariableText(){let e=this.readBitShort(),t;if(e===0)t="";else{let i=e<<1&65535;t=this.readStringEncoded(i,"utf-16le").replace(/\0/g,"")}return t}};var Ql=class extends an{constructor(e,t){super(e,t)}readObjectType(){let e=this.read2Bits(),t=0;switch(e){case 0:t=this.readByte();break;case 1:t=496+this.readByte();break;case 2:t=this.readShort();break;case 3:t=this.readShort();break}return t}};tn("AC12",rn);tn("AC15",sn);tn("AC18",Ys);tn("AC21",an);tn("AC24",Ql);var As=class{get encoding(){return this._mainReader.encoding}set encoding(e){this._mainReader.encoding=e,this._textReader.encoding=e,this._handleReader.encoding=e}get stream(){throw new Error("InvalidOperation")}get bitShift(){throw new Error("InvalidOperation")}set bitShift(e){throw new Error("InvalidOperation")}get position(){return this._mainReader.position}set position(e){throw new Error("InvalidOperation")}isEmpty=!1;_mainReader;_textReader;_handleReader;constructor(e,t,i){this._mainReader=e,this._textReader=t,this._handleReader=i}advance(e){this._mainReader.advance(e)}advanceByte(){throw new Error("InvalidOperation")}handleReference(){return this._handleReader.handleReference()}handleReferenceWithRef(e){return this._handleReader.handleReferenceWithRef(e)}handleReferenceWithRefAndType(e){return this._handleReader.handleReferenceWithRefAndType(e)}positionInBits(){return this._mainReader.positionInBits()}read2Bits(){return this._mainReader.read2Bits()}read2RawDouble(){return this._mainReader.read2RawDouble()}read3RawDouble(){return this._mainReader.read3RawDouble()}read3BitDouble(){return this._mainReader.read3BitDouble()}readBit(){return this._mainReader.readBit()}readBitAsShort(){return this._mainReader.readBitAsShort()}readBitDouble(){return this._mainReader.readBitDouble()}read2BitDouble(){return this._mainReader.read2BitDouble()}readBitLong(){return this._mainReader.readBitLong()}readBitLongLong(){return this._mainReader.readBitLongLong()}readBitShort(){return this._mainReader.readBitShort()}readBitShortAsBool(){return this._mainReader.readBitShortAsBool()}readByte(){return this._mainReader.readByte()}readBytes(e){return this._mainReader.readBytes(e)}read2BitDoubleWithDefault(e){return this._mainReader.read2BitDoubleWithDefault(e)}read3BitDoubleWithDefault(e){return this._mainReader.read3BitDoubleWithDefault(e)}readCmColor(e=!1){if(!(this._mainReader instanceof Ys)&&!e)return this._mainReader.readCmColor();let t=this.readBitShort(),i=this.readBitLong()>>>0,s=new Uint8Array(4);s[0]=i&255,s[1]=i>>>8&255,s[2]=i>>>16&255,s[3]=i>>>24&255;let a;i===3221225472?a=S.byLayer:(i&16777216)!==0?a=new S(s[0]):a=S.fromTrueColor(s[2]<<16|s[1]<<8|s[0]);let n=this.readByte(),o="";(n&1)===1&&(o=this.readVariableText());let l="";return(n&2)===2&&(l=this.readVariableText()),a}readEnColor(){return this._mainReader.readEnColor()}read8BitJulianDate(){return this._mainReader.read8BitJulianDate()}readDateTime(){return this._mainReader.readDateTime()}readDouble(){return this._mainReader.readDouble()}readInt(){return this._mainReader.readInt()}readModularChar(){return this._mainReader.readModularChar()}readSignedModularChar(){return this._mainReader.readSignedModularChar()}readModularShort(){return this._mainReader.readModularShort()}readColorByIndex(){return new S(this.readBitShort())}readObjectType(){return this._mainReader.readObjectType()}readBitExtrusion(){return this._mainReader.readBitExtrusion()}readBitDoubleWithDefault(e){return this._mainReader.readBitDoubleWithDefault(e)}readBitThickness(){return this._mainReader.readBitThickness()}readRawChar(){return this._mainReader.readRawChar()}readRawLong(){return this._mainReader.readRawLong()}readRawULong(){return this._mainReader.readRawULong()}readSentinel(){return this._mainReader.readSentinel()}readShort(){return this._mainReader.readShort()}readShortBigEndian(){return this._mainReader.readShortBigEndian()}readTextUnicode(){return this._textReader.isEmpty?"":this._textReader.readTextUnicode()}readTimeSpan(){return this._mainReader.readTimeSpan()}readUInt(){return this._mainReader.readUInt()}readVariableText(){return this._textReader.isEmpty?"":this._textReader.readVariableText()}resetShift(){return this._mainReader.resetShift()}setPositionInBits(e){this._mainReader.setPositionInBits(e)}setPositionByFlag(e){throw new Error("InvalidOperation")}};var ec=class extends J{get sectionName(){return R.classes}_fileHeader;_sreader;constructor(e,t,i){super(e),this._sreader=t,this._fileHeader=i}read(){let e=new Gi;this.checkSentinel(this._sreader,R.startSentinels.get(this.sectionName));let t=this._sreader.readRawLong(),i=this._sreader.position+t;if(this._fileHeader.acadVersion>=u.AC1024&&this._fileHeader.acadMaintenanceVersion>3||this._fileHeader.acadVersion>u.AC1027){let a=this._sreader.readRawLong()}let s=0;if(this.r2007Plus){s=this._sreader.positionInBits()+this._sreader.readRawLong()-1;let a=this._sreader.positionInBits();i=this._sreader.setPositionByFlag(s),this._sreader.setPositionInBits(a);let n=Be.getStreamHandler(this._version,this._sreader.stream);n.setPositionInBits(i),this._sreader=new As(this._sreader,n,null),this._sreader.readBitLong(),this._sreader.readBit()}for(this._fileHeader.acadVersion===u.AC1018&&(this._sreader.readBitShort(),this._sreader.readRawChar(),this._sreader.readRawChar(),this._sreader.readBit());this._getCurrPos(this._sreader)2032&&(n=2032);let o=a+n;for(;this._sreader.position0?e.set(t,i):this.notify(`Negative offset: ${p} for the handle: ${t}`,y.Warning)}let l=(this._sreader.readByte()<<8)+this._sreader.readByte()}return e}};var rc=class extends J{get sectionName(){return R.header}_reader;_header;constructor(e,t,i){super(e),this._reader=t,this._header=i,this._header.version=e}read(e){let t=this._reader,i=new Qa;this.checkSentinel(this._reader,R.startSentinels.get(this.sectionName));let s=this._reader.readRawLong();if(this.r2010Plus&&e>3||this.r2018Plus){let x=this._reader.readRawLong()}let a=this._reader.positionInBits();if(this.r2007Plus){let x=this._reader.readRawLong(),j=a+x-1,k=Be.getStreamHandler(this._version,new Uint8Array(this._reader.stream));k.setPositionByFlag(j);let P=Be.getStreamHandler(this._version,new Uint8Array(this._reader.stream));P.setPositionInBits(j+1),this._reader=new As(this._reader,k,P)}this.r2013Plus&&(this._header.requiredVersions=this._reader.readBitLongLong()),this._reader.readBitDouble(),this._reader.readBitDouble(),this._reader.readBitDouble(),this._reader.readBitDouble(),this._reader.readVariableText(),this._reader.readVariableText(),this._reader.readVariableText(),this._reader.readVariableText(),this._reader.readBitLong(),this._reader.readBitLong(),this.r13_14Only&&this._reader.readBitShort(),this.r2004Pre&&this._reader.handleReference(),this._header.associatedDimensions=this._reader.readBit(),this._header.updateDimensionsWhileDragging=this._reader.readBit(),this.r13_14Only&&(this._header.dimsav=this._reader.readBit()?1:0),this._header.polylineLineTypeGeneration=this._reader.readBit(),this._header.orthoMode=this._reader.readBit(),this._header.regenerationMode=this._reader.readBit()?1:0,this._header.fillMode=this._reader.readBit(),this._header.quickTextMode=this._reader.readBit(),this._header.paperSpaceLineTypeScaling=this._reader.readBit()?Fi.Normal:Fi.Viewport,this._header.limitCheckingOn=this._reader.readBit(),this.r13_14Only&&(this._header.blipMode=this._reader.readBit()),this.r2004Plus&&this._reader.readBit(),this._header.userTimer=this._reader.readBit(),this._header.sketchPolylineType=this._reader.readBit()?1:0,this._header.angularDirection=this._reader.readBitAsShort(),this._header.showSplineControlPoints=this._reader.readBit(),this.r13_14Only&&(this._reader.readBit(),this._reader.readBit()),this._header.mirrorText=this._reader.readBit(),this._header.worldView=this._reader.readBit(),this.r13_14Only&&this._reader.readBit(),this._header.showModelSpace=this._reader.readBit(),this._header.paperSpaceLimitsChecking=this._reader.readBit(),this._header.retainXRefDependentVisibilitySettings=this._reader.readBit(),this.r13_14Only&&this._reader.readBit(),this._header.displaySilhouetteCurves=this._reader.readBit(),this._header.createEllipseAsPolyline=this._reader.readBit(),this._header.proxyGraphics=this._reader.readBitShortAsBool(),this.r13_14Only&&this._reader.readBitShort(),this._header.spatialIndexMaxTreeDepth=this._reader.readBitShort(),this._header.linearUnitFormat=this._reader.readBitShort();let n=this._reader.readBitShort();n>=0&&n<=8&&(this._header.linearUnitPrecision=n),this._header.angularUnit=this._reader.readBitShort();let o=this._reader.readBitShort();o>=0&&o<=8&&(this._header.angularUnitPrecision=o),this.r13_14Only&&(this._header.objectSnapMode=this._reader.readBitShort()),this._header.attributeVisibility=this._reader.readBitShort(),this.r13_14Only&&this._reader.readBitShort(),this._header.pointDisplayMode=this._reader.readBitShort(),this.r13_14Only&&this._reader.readBitShort(),this.r2004Plus&&(this._reader.readBitLong(),this._reader.readBitLong(),this._reader.readBitLong()),this._header.userShort1=this._reader.readBitShort(),this._header.userShort2=this._reader.readBitShort(),this._header.userShort3=this._reader.readBitShort(),this._header.userShort4=this._reader.readBitShort(),this._header.userShort5=this._reader.readBitShort(),this._header.numberOfSplineSegments=this._reader.readBitShort(),this._header.surfaceDensityM=this._reader.readBitShort(),this._header.surfaceDensityM=this._reader.readBitShort(),this._header.surfaceType=this._reader.readBitShort(),this._header.surfaceTabulation1=this._reader.readBitShort(),this._header.surfaceTabulation2=this._reader.readBitShort(),this._header.splineType=this._reader.readBitShort(),this._header.shadeEdge=this._reader.readBitShort(),this._header.shadeDiffuseToAmbientPercentage=this._reader.readBitShort(),this._header.unitMode=this._reader.readBitShort(),this._header.maxViewportCount=this._reader.readBitShort();let l=this._reader.readBitShort();l>=0&&l<=2047&&(this._header.surfaceIsolineCount=l),this._header.currentMultiLineJustification=this._reader.readBitShort();let p=this._reader.readBitShort();p>=0&&p<=100&&(this._header.textQuality=p),this._header.lineTypeScale=this._reader.readBitDouble(),this._header.textHeightDefault=this._reader.readBitDouble(),this._header.traceWidthDefault=this._reader.readBitDouble(),this._header.sketchIncrement=this._reader.readBitDouble(),this._header.filletRadius=this._reader.readBitDouble(),this._header.thicknessDefault=this._reader.readBitDouble(),this._header.angleBase=this._reader.readBitDouble(),this._header.pointDisplaySize=this._reader.readBitDouble(),this._header.polylineWidthDefault=this._reader.readBitDouble(),this._header.userDouble1=this._reader.readBitDouble(),this._header.userDouble2=this._reader.readBitDouble(),this._header.userDouble3=this._reader.readBitDouble(),this._header.userDouble4=this._reader.readBitDouble(),this._header.userDouble5=this._reader.readBitDouble(),this._header.chamferDistance1=this._reader.readBitDouble(),this._header.chamferDistance2=this._reader.readBitDouble(),this._header.chamferLength=this._reader.readBitDouble(),this._header.chamferAngle=this._reader.readBitDouble();let b=this._reader.readBitDouble();if(b>0&&b<=10&&(this._header.facetResolution=b),this._header.currentMultilineScale=this._reader.readBitDouble(),this._header.currentEntityLinetypeScale=this._reader.readBitDouble(),this._header.menuFileName=this._reader.readVariableText(),this._header.createDateTime=this._reader.readDateTime(),this._header.updateDateTime=this._reader.readDateTime(),this.r2004Plus&&(this._reader.readBitLong(),this._reader.readBitLong(),this._reader.readBitLong()),this._header.totalEditingTime=this._reader.readTimeSpan(),this._header.userElapsedTimeSpan=this._reader.readTimeSpan(),this._header.currentEntityColor=this._reader.readCmColor(),this._header.handleSeed=t.handleReference(),i.clayer=this._reader.handleReference(),i.textstyle=this._reader.handleReference(),i.celtype=this._reader.handleReference(),this.r2007Plus&&(i.cmaterial=this._reader.handleReference()),i.dimstyle=this._reader.handleReference(),i.cmlstyle=this._reader.handleReference(),this.r2000Plus&&(this._header.viewportDefaultViewScaleFactor=this._reader.readBitDouble()),this._header.paperSpaceInsertionBase=this._reader.read3BitDouble(),this._header.paperSpaceExtMin=this._reader.read3BitDouble(),this._header.paperSpaceExtMax=this._reader.read3BitDouble(),this._header.paperSpaceLimitsMin=this._reader.read2RawDouble(),this._header.paperSpaceLimitsMax=this._reader.read2RawDouble(),this._header.paperSpaceElevation=this._reader.readBitDouble(),this._header.paperSpaceUcs.origin=this._reader.read3BitDouble(),this._header.paperSpaceXAxis=this._reader.read3BitDouble(),this._header.paperSpaceYAxis=this._reader.read3BitDouble(),i.ucsname_pspace=this._reader.handleReference(),this.r2000Plus&&(i.pucsorthoref=this._reader.handleReference(),this._reader.readBitShort(),i.pucsbase=this._reader.handleReference(),this._header.paperSpaceOrthographicTopDOrigin=this._reader.read3BitDouble(),this._header.paperSpaceOrthographicBottomDOrigin=this._reader.read3BitDouble(),this._header.paperSpaceOrthographicLeftDOrigin=this._reader.read3BitDouble(),this._header.paperSpaceOrthographicRightDOrigin=this._reader.read3BitDouble(),this._header.paperSpaceOrthographicFrontDOrigin=this._reader.read3BitDouble(),this._header.paperSpaceOrthographicBackDOrigin=this._reader.read3BitDouble()),this._header.modelSpaceInsertionBase=this._reader.read3BitDouble(),this._header.modelSpaceExtMin=this._reader.read3BitDouble(),this._header.modelSpaceExtMax=this._reader.read3BitDouble(),this._header.modelSpaceLimitsMin=this._reader.read2RawDouble(),this._header.modelSpaceLimitsMax=this._reader.read2RawDouble(),this._header.elevation=this._reader.readBitDouble(),this._header.modelSpaceOrigin=this._reader.read3BitDouble(),this._header.modelSpaceXAxis=this._reader.read3BitDouble(),this._header.modelSpaceYAxis=this._reader.read3BitDouble(),i.ucsname_mspace=this._reader.handleReference(),this.r2000Plus&&(i.ucsorthoref=this._reader.handleReference(),this._reader.readBitShort(),i.ucsbase=this._reader.handleReference(),this._header.modelSpaceOrthographicTopDOrigin=this._reader.read3BitDouble(),this._header.modelSpaceOrthographicBottomDOrigin=this._reader.read3BitDouble(),this._header.modelSpaceOrthographicLeftDOrigin=this._reader.read3BitDouble(),this._header.modelSpaceOrthographicRightDOrigin=this._reader.read3BitDouble(),this._header.modelSpaceOrthographicFrontDOrigin=this._reader.read3BitDouble(),this._header.modelSpaceOrthographicBackDOrigin=this._reader.read3BitDouble(),this._header.dimensionPostFix=this._reader.readVariableText(),this._header.dimensionAlternateDimensioningSuffix=this._reader.readVariableText()),this.r13_14Only&&(this._header.dimensionGenerateTolerances=this._reader.readBit(),this._header.dimensionLimitsGeneration=this._reader.readBit(),this._header.dimensionTextInsideHorizontal=this._reader.readBit(),this._header.dimensionTextOutsideHorizontal=this._reader.readBit(),this._header.dimensionSuppressFirstExtensionLine=this._reader.readBit(),this._header.dimensionSuppressSecondExtensionLine=this._reader.readBit(),this._header.dimensionAlternateUnitDimensioning=this._reader.readBit(),this._header.dimensionTextOutsideExtensions=this._reader.readBit(),this._header.dimensionSeparateArrowBlocks=this._reader.readBit(),this._header.dimensionTextInsideExtensions=this._reader.readBit(),this._header.dimensionSuppressOutsideExtensions=this._reader.readBit(),this._header.dimensionAlternateUnitDecimalPlaces=this._reader.readRawChar(),this._header.dimensionZeroHandling=this._reader.readRawChar(),this._header.dimensionSuppressFirstDimensionLine=this._reader.readBit(),this._header.dimensionSuppressSecondDimensionLine=this._reader.readBit(),this._header.dimensionToleranceAlignment=this._reader.readRawChar(),this._header.dimensionTextHorizontalAlignment=this._reader.readRawChar(),this._header.dimensionFit=this._reader.readRawChar(),this._header.dimensionCursorUpdate=this._reader.readBit(),this._header.dimensionToleranceZeroHandling=this._reader.readRawChar(),this._header.dimensionAlternateUnitZeroHandling=this._reader.readRawChar(),this._header.dimensionAlternateUnitToleranceZeroHandling=this._reader.readRawChar(),this._header.dimensionTextVerticalAlignment=this._reader.readRawChar(),this._header.dimensionUnit=this._reader.readBitShort(),this._header.dimensionAngularDimensionDecimalPlaces=this._reader.readBitShort(),this._header.dimensionDecimalPlaces=this._reader.readBitShort(),this._header.dimensionToleranceDecimalPlaces=this._reader.readBitShort(),this._header.dimensionAlternateUnitFormat=this._reader.readBitShort(),this._header.dimensionAlternateUnitToleranceDecimalPlaces=this._reader.readBitShort(),i.dimtxsty=this._reader.handleReference()),this._header.dimensionScaleFactor=this._reader.readBitDouble(),this._header.dimensionArrowSize=this._reader.readBitDouble(),this._header.dimensionExtensionLineOffset=this._reader.readBitDouble(),this._header.dimensionLineIncrement=this._reader.readBitDouble(),this._header.dimensionExtensionLineExtension=this._reader.readBitDouble(),this._header.dimensionRounding=this._reader.readBitDouble(),this._header.dimensionLineExtension=this._reader.readBitDouble(),this._header.dimensionPlusTolerance=this._reader.readBitDouble(),this._header.dimensionMinusTolerance=this._reader.readBitDouble(),this.r2007Plus){this._header.dimensionFixedExtensionLineLength=this._reader.readBitDouble();let x=this._reader.readBitDouble(),j=Math.round(x*1e6)/1e6,k=5*Math.PI/180;j>k&&j=1&&x<=30&&(this._header.stepsPerSecond=x),this._header.stepSize=this._reader.readBitDouble(),this._header.dw3DPrecision=this._reader.readBitDouble(),this._header.lensLength=this._reader.readBitDouble(),this._header.cameraHeight=this._reader.readBitDouble(),this._header.solidsRetainHistory=this._reader.readRawChar()!==0,this._header.showSolidsHistory=this._reader.readRawChar()!==0,this._header.sweptSolidWidth=this._reader.readBitDouble(),this._header.sweptSolidHeight=this._reader.readBitDouble(),this._header.draftAngleFirstCrossSection=this._reader.readBitDouble(),this._header.draftAngleSecondCrossSection=this._reader.readBitDouble(),this._header.draftMagnitudeFirstCrossSection=this._reader.readBitDouble(),this._header.draftMagnitudeSecondCrossSection=this._reader.readBitDouble(),this._header.solidLoftedShape=this._reader.readBitShort(),this._header.loftedObjectNormals=String.fromCharCode(this._reader.readRawChar()),this._header.latitude=this._reader.readBitDouble(),this._header.longitude=this._reader.readBitDouble(),this._header.northDirection=this._reader.readBitDouble(),this._header.timeZone=this._reader.readBitLong(),this._header.displayLightGlyphs=String.fromCharCode(this._reader.readRawChar()),this._reader.readRawChar(),this._header.dwgUnderlayFramesVisibility=String.fromCharCode(this._reader.readRawChar()),this._header.dgnUnderlayFramesVisibility=String.fromCharCode(this._reader.readRawChar()),this._reader.readBit(),this._header.interfereColor=this._reader.readCmColor(),i.interfereobjvs=this._reader.handleReference(),i.interferevpvs=this._reader.handleReference(),i.dragvs=this._reader.handleReference(),this._header.shadowMode=this._reader.readByte(),this._header.shadowPlaneLocation=this._reader.readBitDouble()}try{t.setPositionInBits(a+s*8),t.resetShift(),this.checkSentinel(this._reader,R.endSentinels.get(this.sectionName))}catch(x){this.notify("An error ocurred at the end of the Header reading",y.Error,x instanceof Error?x:void 0)}return{objectPointers:i}}};B();ie();T();_l();var ei=class{cadObject;eDataTemplate=new Map;eDataTemplateByAppName=new Map;hasBeenBuilt=!1;ownerHandle=null;reactorsHandles=new Set;xDictHandle=null;constructor(e){this.cadObject=e}build(e){this.hasBeenBuilt||(this.hasBeenBuilt=!0,this._build(e))}toString(){return`${this.cadObject?.toString()}`}_build(e){let t=e.tryGetCadObject(this.xDictHandle);t&&(this.cadObject.xDictionary=t);for(let i of this.reactorsHandles){let s=e.tryGetCadObject(i);s?this.cadObject.addReactor(s):e.notify(`Reactor with handle ${i} not found`,y.Warning)}for(let[i,s]of this.eDataTemplate){let a=e.tryGetCadObject(i);a?this.cadObject.extendedData.set(a,new hi(s)):e.notify(`AppId in extended data with handle ${i} not found`,y.Warning)}for(let[i,s]of this.eDataTemplateByAppName){let a=e.tryGetTableEntry(i);a?this.cadObject.extendedData.set(a,new hi(s)):e.notify(`AppId in extended data with handle ${i} not found`,y.Warning)}}*getEntitiesCollection(e,t,i){let s=o=>{let l=e.tryGetObjectTemplate(o);return l&&l.cadObject instanceof N&&"nextEntity"in l?l:null},a=new Set,n=s(t);for(n||(e.notify(`Leading entity with handle ${t} not found.`,y.Warning),n=s(i));n;){if(a.has(n.cadObject.handle)){e.notify(`Entity chain loop detected at handle ${n.cadObject.handle}`,y.Warning);break}if(a.add(n.cadObject.handle),yield n.cadObject,n.cadObject.handle===i)break;n.nextEntity!=null?n=s(n.nextEntity):n=s(n.cadObject.handle+1)}}getTableReference(e,t,i){let s=e.tryGetCadObject(t),a=s instanceof ye?s:null;if(a)return a;let n=e.tryGetTableEntry(i);return n||((i&&i.length>0||t!=null&&t!==0)&&e.notify(`Table reference with handle: ${t} | name: ${i} not found for ${this.cadObject.constructor.name} with handle ${this.cadObject.handle}`,y.Warning),null)}};var Y=class extends ei{constructor(e){super(e)}};var O=class extends Y{bookColorName=null;colorHandle=null;entityMode=0;layerHandle=null;layerName=null;lineTypeHandle=null;lineTypeName=null;ltypeFlags=null;materialHandle=null;nextEntity=null;prevEntity=null;constructor(e){super(e)}setUnlinkedReferences(){this.layerName&&this.layerName.length>0&&(this.cadObject.layer=new pe(this.layerName)),this.lineTypeName&&this.lineTypeName.length>0&&(this.cadObject.lineType=new z(this.lineTypeName))}_build(e){super._build(e);let t=this.getTableReference(e,this.layerHandle,this.layerName??"");switch(t&&(this.cadObject.layer=t),this.ltypeFlags){case 0:this.lineTypeName=z.byLayerName;break;case 1:this.lineTypeName=z.byBlockName;break;case 2:this.lineTypeName=z.continuousName;break}let i=this.getTableReference(e,this.lineTypeHandle,this.lineTypeName??"");i&&(this.cadObject.lineType=i);let s=e.tryGetCadObject(this.colorHandle);if(s)this.cadObject.bookColor=s;else if(this.bookColorName&&this.bookColorName.length>0&&e.documentToBuild!=null&&e.documentToBuild.colors!=null){let a=e.documentToBuild.colors.tryGet(this.bookColorName);a&&(this.cadObject.bookColor=a)}}},He=class extends O{constructor(e){super(e)}};var ee=class extends Y{constructor(e){super(e)}};var xe=class extends Y{get type(){return this.cadObject.constructor.name}get name(){return this.cadObject.name}constructor(e){super(e)}_build(e){super._build(e)}};var ti=class extends xe{beginBlockHandle=null;blockEntityTemplate=null;endBlockHandle=null;firstEntityHandle=null;insertHandles=[];lastEntityHandle=null;layoutHandle=null;ownedObjectsHandlers=new Set;referenceTemplates=new Set;constructor(e){super(e??new U)}setBlockToRecord(e,t){let i=e.tryGetCadObject(this.beginBlockHandle);i&&(i.name&&i.name.length>0&&(this.cadObject.name=i.name),i.flags=this.cadObject.blockEntity.flags,i.basePoint=this.cadObject.blockEntity.basePoint,i.xRefPath=this.cadObject.blockEntity.xRefPath,i.comments=this.cadObject.blockEntity.comments,i.isUnloaded=this.cadObject.blockEntity.isUnloaded,this.cadObject.blockEntity=i);let s=e.tryGetCadObject(this.endBlockHandle);s&&(this.cadObject.blockEnd=s),this._ensureCorrectNaming(e,t.model_space,U.modelSpaceName),this._ensureCorrectNaming(e,t.paper_space,U.paperSpaceName)}_build(e){super._build(e),this.cadObject.insertHandles=[...this.insertHandles],this.cadObject.ownedObjectHandles=Array.from(this.ownedObjectsHandlers);let t=e.tryGetCadObject(this.layoutHandle);if(t&&(this.cadObject.layout=t),this.firstEntityHandle!=null&&this.firstEntityHandle!==0)for(let i of this.getEntitiesCollection(e,this.firstEntityHandle,this.lastEntityHandle))this._addEntity(e,i);else{if(this.blockEntityTemplate!==null)for(let i of this.blockEntityTemplate.ownedObjectsHandlers)this.ownedObjectsHandlers.add(i);for(let i of this.ownedObjectsHandlers){let s=e.tryGetCadObject(i);s&&this._addEntity(e,s)}}for(let i of this.referenceTemplates)this._addEntity(e,i.cadObject)}_addEntity(e,t){!e.keepUnknownEntities&&t instanceof er||this.cadObject.entities.add(t)}_ensureCorrectNaming(e,t,i){this.cadObject.handle===t&&this.cadObject.name.toLowerCase()!==i.toLowerCase()&&(e.notify(`Invalid name for ${this.cadObject.name} changed to ${i}`,y.Warning),this.cadObject.name=i)}};var rt=class extends ei{entryHandles=new Set;constructor(e){super(e)}_build(e){super._build(e);for(let t of this.entryHandles){let i=e.tryGetCadObject(t);if(i)try{this.cadObject.add(i)}catch(s){e.notify(`[${this.cadObject.subclassMarker}] error adding entry`,y.Error,s instanceof Error?s:null)}}}};var nn=class extends rt{modelSpaceHandle=null;paperSpaceHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=e.tryGetCadObject(this.modelSpaceHandle);t&&this.cadObject.add(t);let i=e.tryGetCadObject(this.paperSpaceHandle);i&&this.cadObject.add(i)}};B();var ri=class extends O{styleHandle=null;blockHandle=null;blockName=null;styleName=null;constructor(e){super(e??new on)}_build(e){super._build(e);let t=this.cadObject,i=this.getTableReference(e,this.styleHandle,this.styleName??"");i&&(t.style=i);let s=this.getTableReference(e,this.blockHandle,this.blockName??"");s&&(t.block=s)}setDimensionFlags(e){let t=this.cadObject;t.flags=e}setDimensionObject(e){e.handle=this.cadObject.handle,e.owner=this.cadObject.owner,e.xDictionary=this.cadObject.xDictionary,e.color=this.cadObject.color,e.lineWeight=this.cadObject.lineWeight,e.lineTypeScale=this.cadObject.lineTypeScale,e.isInvisible=this.cadObject.isInvisible,e.transparency=this.cadObject.transparency;let t=this.cadObject;if(e.version=t.version,e.definitionPoint=t.definitionPoint,e.textMiddlePoint=t.textMiddlePoint,e.insertionPoint=t.insertionPoint,e.normal=t.normal,e.isTextUserDefinedLocation=t.isTextUserDefinedLocation,e.attachmentPoint=t.attachmentPoint,e.lineSpacingStyle=t.lineSpacingStyle,e.lineSpacingFactor=t.lineSpacingFactor,e.text=t.text,e.textRotation=t.textRotation,e.horizontalDirection=t.horizontalDirection,e.flags=t.flags,this.cadObject instanceof ze&&e instanceof _t){let i=this.cadObject,s=e;s.firstPoint=i.firstPoint,s.secondPoint=i.secondPoint,s.extLineRotation=i.extLineRotation}this.cadObject=e}},on=class extends K{get objectType(){return m.INVALID}get measurement(){return 0}getBoundingBox(){return null}constructor(){super(G.Linear)}};var ln=class extends xe{dimbL_Name=null;dimblk=null;dimblk1=null;dimblK1_Name=null;dimblk2=null;dimblK2_Name=null;dimldrblk=null;dimltex1=0;dimltex2=0;dimltype=null;textStyle_Name=null;textStyleHandle=null;blockHandle=null;dxfFlagsAssigned=!1;constructor(e){super(e??new Q)}_build(e){super._build(e);let t=this.getTableReference(e,this.textStyleHandle,this.textStyle_Name??"");t&&(this.cadObject.style=t);let i=this.getTableReference(e,this.dimltype,"");i&&(this.cadObject.lineType=i);let s=this.getTableReference(e,this.dimltex1,"");s&&(this.cadObject.lineTypeExt1=s);let a=this.getTableReference(e,this.dimltex2,"");a&&(this.cadObject.lineTypeExt2=a);let n=this.getTableReference(e,this.dimldrblk,this.dimbL_Name??"");n&&(this.cadObject.leaderArrow=n);let o=this.getTableReference(e,this.dimblk1,this.dimblK1_Name??"");o&&(this.cadObject.dimArrow1=o);let l=this.getTableReference(e,this.dimblk2,this.dimblK2_Name??"");l&&(this.cadObject.dimArrow2=l);let p=this.getTableReference(e,this.blockHandle,"")}};var ss=class extends He{hatchPatternName=null;pathTemplates=[];constructor(e){super(e??new Kt)}_build(e){super._build(e);for(let t of this.pathTemplates)this.cadObject.paths.push(t.path),t.build(e)}};(function(r){class e{path=new Wl;handles=new Set;build(i){for(let s of this.handles){let a=i.tryGetCadObject(s);a&&this.path.entities.push(a)}}}r.CadBoundaryPathTemplate=e})(ss||(ss={}));var ii=class extends O{hasAtts=!1;ownedObjectsCount=0;blockHeaderHandle=null;blockName=null;firstAttributeHandle=null;endAttributeHandle=null;seqendHandle=null;ownedObjectsHandlers=new Set;constructor(e){super(e??new Ye)}_build(e){super._build(e);let t=this.cadObject;if(!(t instanceof Ye))return;let i=this.getTableReference(e,this.blockHeaderHandle,this.blockName??"");i?t.block=i:e.notify(`Block ${this.blockHeaderHandle} | ${this.blockName} not found for Insert ${this.cadObject.handle}`,y.Warning);let s=e.tryGetCadObject(this.seqendHandle);if(s&&(t.attributes.seqend=s,s.owner=t),this.firstAttributeHandle!=null){let a=this.getEntitiesCollection(e,this.firstAttributeHandle,this.endAttributeHandle);for(let n of a)t.attributes.push(n),n.owner=t,t.applyAttributeTransform(n)}else for(let a of this.ownedObjectsHandlers){let n=e.tryGetCadObject(a);n&&(t.attributes.push(n),n.owner=t,t.applyAttributeTransform(n))}}};var cn=class extends xe{layerControlHandle=0;plotStyleHandle=0;materialHandle=0;lineTypeHandle=null;lineTypeName=null;trueColorName=null;constructor(e){super(e??new pe)}_build(e){super._build(e);let t=e.tryGetCadObject(this.materialHandle),i=this.getTableReference(e,this.lineTypeHandle,this.lineTypeName??"");i?this.cadObject.lineType=i:e.notify(`Linetype with handle ${this.lineTypeHandle} could not be found for layer ${this.cadObject.name}`,y.Warning)}};var dn=class extends Y{paperSpaceBlockHandle=null;activeViewportHandle=null;baseUcsHandle=null;namesUcsHandle=null;lasActiveViewportHandle=null;viewportHandles=new Set;constructor(e){super(e??new ke)}_build(e){super._build(e);let t=e.tryGetCadObject(this.paperSpaceBlockHandle);t&&(this.cadObject.associatedBlock=t);let i=this.activeViewportHandle??this.lasActiveViewportHandle,s=e.tryGetCadObject(i);s instanceof Ue&&(this.cadObject.lastActiveViewport=s);let a=e.tryGetCadObject(this.baseUcsHandle);a&&(this.cadObject.baseUCS=a);let n=e.tryGetCadObject(this.namesUcsHandle);n&&(this.cadObject.ucs=n);for(let o of this.viewportHandles){let l=e.tryGetCadObject(o)}}};var hn=class extends He{dimasz=0;dimstyleHandle=0;dimstyleName="";annotationHandle=0;constructor(e){super(e??new zr)}_build(e){super._build(e);let t=this.cadObject,i=this.getTableReference(e,this.dimstyleHandle,this.dimstyleName);i&&(t.style=i);let s=e.tryGetCadObject(this.annotationHandle);s&&(t.associatedAnnotation=s)}};var as=class extends xe{ltypeControlHandle=null;totalLen=null;segmentTemplates=[];constructor(e){super(e??new z)}_build(e){super._build(e);for(let t of this.segmentTemplates)t.build(e),this.cadObject.addSegment(t.segment)}};(function(r){class e{styleHandle=null;segment=new gl;build(i){let s=i.tryGetCadObject(this.styleHandle);s&&(this.segment.style=s)}}r.SegmentTemplate=e})(as||(as={}));var ns=class extends ee{scaleHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=e.tryGetCadObject(this.scaleHandle);i&&(t.scale=i)}};var Ri=class extends ns{blockRecordHandle=0;leaderLineTemplates=[];textStyleHandle=0;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=e.tryGetCadObject(this.textStyleHandle);i&&(t.textStyle=i);let s=e.tryGetCadObject(this.blockRecordHandle);s&&(t.blockContent=s);for(let a of this.leaderLineTemplates)a.build(e)}};(function(r){class e{arrowSymbolHandle=null;leaderLine;lineTypeHandle=null;constructor(i){this.leaderLine=i??new $a}build(i){let s=i.tryGetCadObject(this.lineTypeHandle);s&&(this.leaderLine.lineType=s);let a=i.tryGetCadObject(this.arrowSymbolHandle);a&&(this.leaderLine.arrowhead=a)}}r.LeaderLineTemplate=e})(Ri||(Ri={}));var un=class extends He{arrowheadHandle=0;arrowheadHandles=new Map;blockAttributeHandles=new Map;blockContentHandle=0;cadMLeaderAnnotContextTemplate;leaderLineTypeHandle=null;leaderStyleHandle=0;mTextStyleHandle=0;constructor(e){let t=e??new Xr;super(t),this.cadMLeaderAnnotContextTemplate=new Ri(t.contextData)}_build(e){super._build(e),this.cadMLeaderAnnotContextTemplate.build(e);let t=this.cadObject,i=e.tryGetCadObject(this.leaderStyleHandle);i&&(t.style=i);let s=e.tryGetCadObject(this.leaderLineTypeHandle);s&&(t.leaderLineType=s);let a=e.tryGetCadObject(this.mTextStyleHandle);a&&(t.textStyle=a);let n=e.tryGetCadObject(this.blockContentHandle);n&&(t.blockContentId=n);let o=e.tryGetCadObject(this.arrowheadHandle);o&&(t.arrowhead=o);let l=t.contextData.leaderRoots.flatMap(p=>p.lines);for(let[p,b]of this.arrowheadHandles){let x=e.tryGetCadObject(p);if(x==null)continue;if(b){t.arrowhead??=x;continue}let j=l.find(k=>k.arrowhead==null);j!=null?j.arrowhead=x:t.arrowhead??=x}for(let p of t.blockAttributes){let b=this.blockAttributeHandles.get(p);if(b!==void 0){let x=e.tryGetCadObject(b);x&&(p.attributeDefinition=x)}}}};te();De();T();D();B();var Ko;(function(r){r[r.LeaderHeadFirst=0]="LeaderHeadFirst",r[r.LeaderTailFirst=1]="LeaderTailFirst"})(Ko||(Ko={}));var Jo;(function(r){r[r.ContentFirst=0]="ContentFirst",r[r.LeaderFirst=1]="LeaderFirst"})(Jo||(Jo={}));var ct=class r extends M{static get default_(){return new r(r.defaultName)}alignSpace=0;_arrowhead=null;get arrowhead(){return this._arrowhead}set arrowhead(e){this._arrowhead=A.updateCollectionStatic(e,this.document?.blockRecords??null)}arrowheadSize=.18;_blockContent=null;get blockContent(){return this._blockContent}set blockContent(e){this._blockContent=A.updateCollectionStatic(e,this.document?.blockRecords??null)}blockContentColor=S.byBlock;blockContentConnection=0;blockContentRotation=0;_blockContentScale=new c(1,1,1);get blockContentScale(){return this._blockContentScale}set blockContentScale(e){this._blockContentScale=e}get blockContentScaleX(){return this._blockContentScale.x}set blockContentScaleX(e){this._blockContentScale.x=e}get blockContentScaleY(){return this._blockContentScale.y}set blockContentScaleY(e){this._blockContentScale.y=e}get blockContentScaleZ(){return this._blockContentScale.z}set blockContentScaleZ(e){this._blockContentScale.z=e}breakGapSize=.125;contentType=Ta.MText;defaultTextContents="";description="";enableBlockContentRotation=!1;enableBlockContentScale=!1;enableDogleg=!0;enableLanding=!0;firstSegmentAngleConstraint=0;isAnnotative=!1;landingDistance=.36;landingGap=.09;leaderDrawOrder=Ko.LeaderHeadFirst;_leaderLineType=null;get leaderLineType(){return this._leaderLineType}set leaderLineType(e){if(e==null)throw new Error("value cannot be null");this._leaderLineType=A.updateCollectionStatic(e,this.document?.lineTypes??null)}leaderLineWeight=0;lineColor=S.byLayer;maxLeaderSegmentsPoints=2;multiLeaderDrawOrder=Jo.ContentFirst;get objectName(){return h.objectMLeaderStyle}get objectType(){return m.UNLISTED}overwritePropertyValue=!1;pathType=0;scaleFactor=1;secondSegmentAngleConstraint=0;get subclassMarker(){return d.mLeaderStyle}textAlignAlwaysLeft=!1;textAlignment=0;textAngle=0;textAttachmentDirection=0;textBottomAttachment=0;textColor=S.byBlock;textFrame=!1;textHeight=.18;textLeftAttachment=0;textRightAttachment=0;_textStyle=null;get textStyle(){return this._textStyle}set textStyle(e){if(e==null)throw new Error("value cannot be null");this._textStyle=A.updateCollectionStatic(e,this.document?.textStyles??null)}textTopAttachment=0;unknownFlag298=!1;static defaultName="Standard";constructor(e=""){super(e)}clone(){let e=super.clone();return e._textStyle=this._textStyle?.clone()??null,e._leaderLineType=this._leaderLineType?.clone()??null,e._arrowhead=this._arrowhead?.clone()??null,e._blockContent=this._blockContent?.clone()??null,e}assignDocument(e){super.assignDocument(e),this._arrowhead=A.updateCollectionStatic(this._arrowhead,e.blockRecords),this._blockContent=A.updateCollectionStatic(this._blockContent,e.blockRecords),this._leaderLineType=A.updateCollectionStatic(this._leaderLineType,e.lineTypes),this._textStyle=A.updateCollectionStatic(this._textStyle,e.textStyles)}unassignDocument(){super.unassignDocument(),this._arrowhead=this._arrowhead?.clone()??null,this._blockContent=this._blockContent?.clone()??null,this._leaderLineType=this._leaderLineType?.clone()??null,this._textStyle=this._textStyle?.clone()??null}};var mn=class extends Y{arrowheadHandle=null;blockContentHandle=null;leaderLineTypeHandle=null;mTextStyleHandle=null;constructor(e){super(e??new ct)}_build(e){super._build(e);let t=e.tryGetCadObject(this.leaderLineTypeHandle);t&&(this.cadObject.leaderLineType=t);let i=e.tryGetCadObject(this.arrowheadHandle);i&&(this.cadObject.arrowhead=i);let s=e.tryGetCadObject(this.mTextStyleHandle);s&&(this.cadObject.textStyle=s);let a=e.tryGetCadObject(this.blockContentHandle);a&&(this.cadObject.blockContent=a)}};var pn=class extends He{mLineStyleHandle=null;mLineStyleName=null;nVertex=null;nElements=null;_currVertex=null;_currSegmentElement=null;constructor(e){super(e??new Gr)}tryReadVertex(e,t){let i=this.cadObject;switch(e){case 11:return this._currVertex=new za,i.vertices.push(this._currVertex),this._currVertex.position=new c(t,this._currVertex.position.y,this._currVertex.position.z),!0;case 21:return this._currVertex&&(this._currVertex.position=new c(this._currVertex.position.x,t,this._currVertex.position.z)),!0;case 31:return this._currVertex&&(this._currVertex.position=new c(this._currVertex.position.x,this._currVertex.position.y,t)),!0;case 12:return this._currVertex&&(this._currVertex.direction=new c(t,this._currVertex.direction.y,this._currVertex.direction.z)),!0;case 22:return this._currVertex&&(this._currVertex.direction=new c(this._currVertex.direction.x,t,this._currVertex.direction.z)),!0;case 32:return this._currVertex&&(this._currVertex.direction=new c(this._currVertex.direction.x,this._currVertex.direction.y,t)),!0;case 13:return this._currVertex&&(this._currVertex.miter=new c(t,this._currVertex.miter.y,this._currVertex.miter.z)),!0;case 23:return this._currVertex&&(this._currVertex.miter=new c(this._currVertex.miter.x,t,this._currVertex.miter.z)),!0;case 33:return this._currVertex&&(this._currVertex.miter=new c(this._currVertex.miter.x,this._currVertex.miter.y,t)),!0;case 74:return this._currSegmentElement=new Wa,this._currVertex&&this._currVertex.segments.push(this._currSegmentElement),!0;case 41:return this._currSegmentElement?.parameters.push(t),!0;case 42:return this._currSegmentElement?.areaFillParameters.push(t),!0;case 75:return!0;default:return!1}}_build(e){super._build(e);let t=this.cadObject,i=e.tryGetCadObject(this.mLineStyleHandle);i&&(t.style=i)}};var os=class extends Y{elementTemplates=[];constructor(e){super(e??new At)}_build(e){super._build(e);for(let t of this.elementTemplates)t.build(e)}};(function(r){class e{element;lineTypeHandle=null;linetypeIndex=null;lineTypeName=null;constructor(i){this.element=i}build(i){let s=i.tryGetCadObject(this.lineTypeHandle);if(s)this.element.lineType=s;else if(s=i.tryGetTableEntry(this.lineTypeName??""),s)this.element.lineType=s;else if(this.linetypeIndex!=null)if(this.linetypeIndex===32767){let a=i.tryGetTableEntry(z.byLayerName);a&&(this.element.lineType=a)}else if(this.linetypeIndex===32766){let a=i.tryGetTableEntry(z.byBlockName);a&&(this.element.lineType=a)}else try{let a=i.lineTypesTable;if(a){let n=Array.from(a);this.linetypeIndex0){let t=this.chunks.reduce((a,n)=>a+n.length,0),i=new Uint8Array(t),s=0;for(let a of this.chunks)i.set(a,s),s+=a.length;this.cadObject.binaryData=i}if(this.cadObject.binaryData&&this.cadObject.binaryData.length>0){let t=new DataView(this.cadObject.binaryData.buffer,this.cadObject.binaryData.byteOffset),i=2;this.cadObject.upperLeftCorner=this._read3Double(t,i),i+=24,i+=24,this.cadObject.lowerRightCorner=this._read3Double(t,i)}}_read3Double(e,t){let i=e.getFloat64(t,!0),s=e.getFloat64(t+8,!0),a=e.getFloat64(t+16,!0);return new c(i,s,a)}};B();var wr=class extends O{firstVertexHandle=null;lastVertexHandle=null;seqendHandle=null;ownedObjectsHandlers=new Set;constructor(e){super(e||new lh)}setPolyLineObject(e){e.handle=this.cadObject.handle,e.color=this.cadObject.color,e.lineWeight=this.cadObject.lineWeight,e.lineTypeScale=this.cadObject.lineTypeScale,e.isInvisible=this.cadObject.isInvisible,e.transparency=this.cadObject.transparency,this.cadObject=e}addVertices(e,...t){let i=this.cadObject;if(i instanceof Ge)for(let s of t)i.vertices.push(s),s.owner=i;else if(i instanceof gt)for(let s of t)i.vertices.push(s),s.owner=i;else if(i instanceof jt)for(let s of t)this._addPolyfaceMeshVertex(e,i,s);else if(i instanceof Qt)for(let s of t)i.vertices.push(s),s.owner=i;else e.notify(`Unknown polyline type ${this.cadObject.subclassMarker}`,y.Warning)}_build(e){super._build(e);let t=e.tryGetCadObject(this.seqendHandle);if(t&&this.setSeqend(e,t),this.firstVertexHandle!=null){let i=Array.from(this.getEntitiesCollection(e,this.firstVertexHandle,this.lastVertexHandle));this.addVertices(e,...i)}else if(this.cadObject instanceof jt)this._buildPolyfaceMesh(this.cadObject,e);else for(let i of this.ownedObjectsHandlers){let s=e.tryGetCadObject(i);if(s)this.addVertices(e,s);else{let a=e.tryGetCadObject(i);a?this.setSeqend(e,a):e.notify(`Vertex ${i} not found for polyline ${this.cadObject.handle}`,y.Warning)}}}setSeqend(e,t){let i=this.cadObject;t.owner=i,i instanceof Ge||i instanceof gt||i instanceof jt||i instanceof Qt?i.vertices.seqend=t:e.notify(`Unknown polyline type ${this.cadObject.subclassMarker}`,y.Warning)}_buildPolyfaceMesh(e,t){for(let i of this.ownedObjectsHandlers){let s=t.tryGetCadObject(i);s&&this._addPolyfaceMeshVertex(t,e,s)}}_addPolyfaceMeshVertex(e,t,i){i instanceof Ti?(t.vertices.push(i),i.owner=t):i instanceof fr?(t.faces.push(i),i.owner=t):i instanceof Se?(t.vertices.seqend=i,i.owner=t):e.notify(`Unidentified type for PolyfaceMesh ${i.constructor.name}`)}},lh=class extends Ir{get objectType(){return m.INVALID}get subclassMarker(){return"PolyLinePlaceholder"}getBoundingBox(){return null}};var ic=class extends Y{constructor(e){super(e)}};var bn=class extends O{shapeIndex=null;shapeFileHandle=null;shapeFileName=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=this.getTableReference(e,this.shapeFileHandle,this.shapeFileName??"");i&&(i.isShapeFile?t.shapeStyle=i:e.notify(`Shape style ${this.shapeFileHandle} | ${this.shapeFileName} not found`,y.Warning))}};var yn=class extends He{historyHandle=null;constructor(e){super(e??new Ki)}};var gn=class extends He{constructor(e){super(e??new Lt)}};var si=class extends O{styleHandle=null;styleName=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=this.getTableReference(e,this.styleHandle,this.styleName??"");i&&(t.style=i)}};var Zs=class extends si{mTextTemplate=null;constructor(e){super(e)}_build(e){super._build(e),this.mTextTemplate!==null&&this.mTextTemplate.build(e)}};var xn=class extends O{dimensionStyleHandle=null;dimensionStyleName=null;constructor(e){super(e??new pr)}_build(e){super._build(e);let t=this.getTableReference(e,this.dimensionStyleHandle,this.dimensionStyleName);t&&(this.cadObject.style=t)}};var Cn=class extends xe{constructor(e){super(e??new Rt)}};T();D();B();var ls=class extends ye{get objectType(){return m.VIEW}get objectName(){return h.tableView}get subclassMarker(){return d.view}height=0;width=0;lensLength=0;frontClipping=0;backClipping=0;angle=0;viewMode=de.Off;isUcsAssociated=!1;isPlottable=!1;renderMode=wa.Optimized2D;center=new g(0,0);direction=new c(0,0,0);target=new c(0,0,0);visualStyle=null;ucsOrigin=new c(0,0,0);ucsXAxis=new c(0,0,0);ucsYAxis=new c(0,0,0);ucsElevation=0;ucsOrthographicType=lr.None;constructor(e){super(e)}clone(){let e=super.clone();return e.visualStyle=this.visualStyle?.clone()??null,e}};var Dn=class extends xe{visualStyleHandle=null;namedUcsHandle=null;ucsHandle=null;constructor(e){super(e??new ls)}_build(e){super._build(e);let t=e.tryGetCadObject(this.visualStyleHandle);t?this.cadObject.visualStyle=t:this.visualStyleHandle!=null&&this.visualStyleHandle>0&&e.notify(`Visual style ${this.visualStyleHandle} not found for view ${this.cadObject.handle}`,y.Warning);let i=n=>{this.cadObject.isUcsAssociated=!0,this.cadObject.ucsOrigin=new c(n.origin.x,n.origin.y,n.origin.z),this.cadObject.ucsXAxis=new c(n.xAxis.x,n.xAxis.y,n.xAxis.z),this.cadObject.ucsYAxis=new c(n.yAxis.x,n.yAxis.y,n.yAxis.z),this.cadObject.ucsElevation=n.elevation,this.cadObject.ucsOrthographicType=n.orthographicType},s=e.tryGetCadObject(this.ucsHandle);s?i(s):this.ucsHandle!=null&&this.ucsHandle>0&&e.notify(`Base ucs ${this.ucsHandle} not found for view ${this.cadObject.handle}`,y.Warning);let a=e.tryGetCadObject(this.namedUcsHandle);a?i(a):this.namedUcsHandle!=null&&this.namedUcsHandle>0&&e.notify(`Named ucs ${this.namedUcsHandle} not found for view ${this.cadObject.handle}`,y.Warning)}};var Tn=class extends He{viewportHeaderHandle=null;boundaryHandle=null;namedUcsHandle=null;baseUcsHandle=null;visualStyleHandle=null;viewportId=null;blockHandle=null;frozenLayerHandles=new Set;constructor(e){super(e??new Ue)}_build(e){super._build(e),this.viewportId!=null&&(this.cadObject.id=this.viewportId);let t=e.tryGetCadObject(this.boundaryHandle);t?this.cadObject.boundary=t:this.boundaryHandle!=null&&this.boundaryHandle>0&&e.notify(`Boundary ${this.boundaryHandle} not found for viewport ${this.cadObject.handle}`,y.Warning),this.namedUcsHandle!=null&&this.namedUcsHandle>0&&e.notify(`Named ucs not implemented for Viewport, handle ${this.namedUcsHandle}`),this.baseUcsHandle!=null&&this.baseUcsHandle>0&&e.notify(`Base ucs not implemented for Viewport, handle ${this.baseUcsHandle}`);for(let i of this.frozenLayerHandles){let s=e.tryGetCadObject(i);s?this.cadObject.frozenLayers.push(s):e.notify(`Frozen layer ${i} not found for viewport ${this.cadObject.handle}`,y.Warning)}}};var sc=class extends rt{constructor(){super(new ys)}};var ac=class extends xe{blockHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=e.tryGetCadObject(this.blockHandle);t?this.cadObject.blockRecord=t:this.blockHandle!=null&&this.blockHandle!==0&&e.notify(`ViewportEntityHeader block ${this.blockHandle} not found for ${this.cadObject.handle}`,y.Warning)}};var Sn=class extends xe{vportControlHandle=0;backgroundHandle=null;styleHandle=null;sunHandle=null;namedUcsHandle=null;baseUcsHandle=null;constructor(e){super(e??new nt)}_build(e){super._build(e);let t=e.tryGetCadObject(this.baseUcsHandle);t?this.cadObject.baseUcs=t:this.baseUcsHandle!=null&&this.baseUcsHandle>0&&e.notify(`Boundary ${this.baseUcsHandle} not found for viewport ${this.cadObject.handle}`,y.Warning);let i=e.tryGetCadObject(this.namedUcsHandle);i?this.cadObject.baseUcs=i:this.namedUcsHandle!=null&&this.namedUcsHandle>0&&e.notify(`Boundary ${this.baseUcsHandle} not found for viewport ${this.cadObject.handle}`,y.Warning);let s=e.tryGetCadObject(this.styleHandle)}};var Ba=class extends O{imgDefHandle=null;imgReactorHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=e.tryGetCadObject(this.imgDefHandle);i&&(t.definition=i);let s=e.tryGetCadObject(this.imgReactorHandle);s&&(t.definitionReactor=s,s.image=t,s.owner=t,e.documentToBuild.registerCollection(s))}};xr();var qs=class extends Y{entries=new Map;constructor(e){super(e??new re)}_build(e){if(super._build(e),this.ownerHandle!=null&&this.ownerHandle===0&&e.documentToBuild.rootDictionary==null)if(e instanceof en){let t=e;this.cadObject.handle===t.headerHandles.dictionary_named_objects?e.documentToBuild.rootDictionary=this.cadObject:e.documentToBuild.rootDictionary=this.cadObject}else e.documentToBuild.rootDictionary=this.cadObject;for(let[t,i]of this.entries){let s=e.tryGetCadObject(i);if(s){(!s.name||s.name.length===0)&&(s.name=t);try{this.cadObject.add(s)}catch(a){e.notify(`Error when trying to add the entry ${s.name} to ${this.cadObject.name}|${this.cadObject.handle}`,y.Error,a instanceof Error?a:null)}}else e.notify(`Entry not found ${t}|${i} for dictionary ${this.cadObject.name}|${this.cadObject.handle}`,y.Warning)}}};xr();T();D();B();var ai=class extends re{defaultEntry=null;get objectName(){return h.objectDictionaryWithDefault}get objectType(){return m.UNLISTED}get subclassMarker(){return d.dictionaryWithDefault}constructor(e,t){super(e),t&&(this.defaultEntry=t)}};var Bn=class extends qs{defaultEntryHandle=null;constructor(e){super(e??new ai)}_build(e){super._build(e);let t=e.tryGetCadObject(this.defaultEntryHandle);t&&(this.cadObject.defaultEntry=t)}};te();T();D();B();var Qo;(function(r){r[r.Unknown=0]="Unknown",r[r.LocalGrid=1]="LocalGrid",r[r.ProjectedGrid=2]="ProjectedGrid",r[r.Geographic=3]="Geographic"})(Qo||(Qo={}));var qe;(function(r){r[r.R2009=1]="R2009",r[r.R2010=2]="R2010",r[r.R2013=3]="R2013"})(qe||(qe={}));var el;(function(r){r[r.None=1]="None",r[r.UserSpecifiedScaleFactor=2]="UserSpecifiedScaleFactor",r[r.GridScaleAtReferencePoint=3]="GridScaleAtReferencePoint",r[r.Prismodial=4]="Prismodial"})(el||(el={}));var Rn=class{index1=0;index2=0;index3=0},Nn=class{source=new g(0,0);destination=new g(0,0);toString(){return`src:${this.source.x},${this.source.y} dest:${this.destination.x},${this.destination.y}`}},_r=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectGeoData}get subclassMarker(){return d.geoData}version=qe.R2013;coordinatesType=Qo.LocalGrid;hostBlock=null;designPoint=new c(0,0,0);referencePoint=new c(0,0,0);northDirection=new g(0,1);horizontalUnitScale=1;verticalUnitScale=1;horizontalUnits=0;verticalUnits=0;upDirection=new c(0,0,1);scaleEstimationMethod=el.None;enableSeaLevelCorrection=!1;userSpecifiedScaleFactor=0;seaLevelElevation=0;coordinateProjectionRadius=0;coordinateSystemDefinition="";geoRssTag="";observationFromTag="";observationToTag="";observationCoverageTag="";points=[];faces=[]};var An=class extends Y{hostBlockHandle=null;constructor(e){super(e??new _r)}_build(e){super._build(e);let t=this.getTableReference(e,this.hostBlockHandle,"");t&&(this.cadObject.hostBlock=t)}};var vn=class extends Y{handles=new Set;constructor(e){super(e??new Ft)}_build(e){super._build(e);for(let t of this.handles){let i=e.getObjectTemplate(t);if(i){i.build(e);try{this.cadObject.add(i.cadObject)}catch(s){e.notify(`Entity with handle ${t} could not be added to group ${this.cadObject.handle}`,y.Error,s instanceof Error?s:null)}}else e.notify(`Entity with handle ${t} not found for group ${this.cadObject.handle}`,y.Warning)}}};var En=class extends Y{blockOwnerHandle=null;values=[];constructor(e){super(e??new pt)}_build(e){super._build(e);let t=e.tryGetCadObject(this.blockOwnerHandle);if(t)if(t instanceof U)this.cadObject.blockOwner=t;else{e.notify(`Block owner for SortEntitiesTable ${this.cadObject.handle} is not a block ${t.constructor.name} | ${t.handle}`,y.Warning);return}else{e.notify(`Block owner for SortEntitiesTable ${this.cadObject.handle} not found`,y.Warning);return}for(let i of this.values){let s=e.tryGetCadObject(i[1]);s?this.cadObject.add(s,i[0]):e.notify(`Entity in SortEntitiesTable ${this.cadObject.handle} not found ${i[1]}`,y.Warning)}}};te();T();D();B();var tl;(function(r){r[r.Down=0]="Down",r[r.Up=1]="Up"})(tl||(tl={}));var dt=class r extends M{static get default_(){return new r(r.defaultName)}cellStyles=[];dataCellStyle=new xt;description="";flags=0;flowDirection=tl.Down;headerCellStyle=new xt;horizontalCellMargin=.06;get objectName(){return h.objectTableStyle}get objectType(){return m.UNLISTED}get subclassMarker(){return d.tableStyle}suppressHeaderRow=!1;suppressTitle=!1;tableCellStyle=new xt;titleCellStyle=new xt;verticalCellMargin=.06;static defaultName="Standard";constructor(e=""){super(e)}};var kn=class extends ii{blockOwnerHandle=null;cadTableCellTemplates=[];get currentCell(){return this.currentCellTemplate.cell}currentCellTemplate;horizontalMargin=null;nullHandle=null;styleHandle=null;get tableEntity(){return this.cadObject}_currCellIndex=0;constructor(e){super(e??new es)}createCell(e){let t=Math.floor(this._currCellIndex/this.tableEntity.columns.length),i=new Us;i.type=e,this.tableEntity.rows[t].cells.push(i),this.currentCellTemplate=new rl(i),this.cadTableCellTemplates.push(this.currentCellTemplate),this._currCellIndex++}_build(e){super._build(e);for(let t of this.cadTableCellTemplates)t.build(e)}},Pn=class{format;textStyleHandle=null;textStyleName=null;constructor(e){this.format=e}build(e){throw new Error("Not implemented")}},It=class extends Pn{borderLinetypePairs=[];get cellStyle(){return this.format}textStyleHandle=null;constructor(e){super(e??new xt)}},ch=class{attDefHandle=null;_tableAtt;constructor(e){this._tableAtt=e}build(e){throw new Error("Not implemented")}},Ln=class{blockRecordHandle=null;cadValueTemplate=null;content;fieldHandle=null;constructor(e){this.content=e}build(e){throw new Error("Not implemented")}},rl=class{attributeHandles=new Set;cell;contentTemplates=[];formatTextHeight=null;styleId=0;textStyleOverrideHandle=null;unknownHandle=null;valueHandle=null;constructor(e){this.cell=e}build(e){let t=e.tryGetCadObject(this.valueHandle)}};var jn=class extends ei{cellStyleTemplates=[];currentCellStyleTemplate;constructor(e){super(e??new dt)}createCurrentCellStyleTemplate(){return this.currentCellStyleTemplate=new It,this.cellStyleTemplates.push(this.currentCellStyleTemplate),this.currentCellStyleTemplate}_build(e){super._build(e);let t=this.cadObject;for(let i of this.cellStyleTemplates)t.cellStyles.push(i.cellStyle)}};te();De();T();D();B();yl();var Rd=class{code;value;owner;get groupCode(){return Ne.transformValue(this.code)}get hasLinkedObject(){let e=this.groupCode;return e===5||e===105}constructor(e,t,i){this.code=e,this.value=t,this.owner=i}getReference(){return this.hasLinkedObject&&this.value instanceof A?this.value.document!==this.owner.document?null:this.value:null}toString(){return`${this.code}:${this.value}`}},Mt=class extends M{cloningFlags=ks.NotApplicable;get entries(){return this._entries}get objectName(){return h.objectXRecord}get objectType(){return m.XRECORD}get subclassMarker(){return d.xRecord}_entries=[];constructor(e){super(e)}createEntry(e,t){this._entries.push(new Rd(e,t,this))}};var On=class extends ei{_entries=[];constructor(e){super(e??new Mt)}addHandleReference(e,t){this._entries.push([e,t])}_build(e){super._build(e);let t=this.cadObject;for(let i of this._entries){let s=e.tryGetCadObject(i[1]);s?t.createEntry(i[0],s):(t.createEntry(i[0],i[1]),e.notify(`XRecord reference not found ${i[0]}|${i[1]}`,y.Warning))}}};var In=class extends ee{constructor(e){super(e)}},Mn=class extends O{constructor(e){super(e)}};var Vn=class extends O{definitionHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject,i=e.tryGetCadObject(this.definitionHandle);i?t.definition=i:e.notify(`UnderlayDefinition not found for ${this.cadObject.handle}`,y.Warning)}};te();T();D();B();var we;(function(r){r[r.None=0]="None",r[r.FirstPointReference=1]="FirstPointReference",r[r.SecondPointReference=2]="SecondPointReference",r[r.ThirdPointReference=4]="ThirdPointReference",r[r.FourthPointReference=8]="FourthPointReference"})(we||(we={}));var il;(function(r){r[r.None=0]="None",r[r.Endpoint=1]="Endpoint",r[r.Midpoint=2]="Midpoint",r[r.Center=3]="Center",r[r.Node=4]="Node",r[r.Quadrant=5]="Quadrant",r[r.Intersection=6]="Intersection",r[r.Insertion=7]="Insertion",r[r.Perpendicular=8]="Perpendicular",r[r.Tangent=9]="Tangent",r[r.Nearest=10]="Nearest",r[r.ApparentIntersection=11]="ApparentIntersection",r[r.Parallel=12]="Parallel",r[r.StartPoint=13]="StartPoint"})(il||(il={}));var sl;(function(r){r[r.Unknown=0]="Unknown",r[r.Parallel=1]="Parallel",r[r.Perpendicular=2]="Perpendicular"})(sl||(sl={}));var al;(function(r){r[r.Unknown=0]="Unknown",r[r.Edge=1]="Edge",r[r.Face=2]="Face"})(al||(al={}));var vs=class{geometryParameter=0;objectOsnapType=il.None;osnapPoint=new c(0,0,0);subentType=al.Unknown;gsMarker=0;intersectionSubType=al.Unknown;intersectionGsMarker=0;hasLastPointRef=!1;geometry=null},Dt=class extends M{associativityFlags=we.None;dimension=null;firstPointRef=null;fourthPointRef=null;isTransSpace=!1;get objectName(){return h.objectDimensionAssociation}get objectType(){return m.UNLISTED}rotatedDimensionType=sl.Unknown;secondPointRef=null;get subclassMarker(){return d.dimensionAssociation}thirdPointRef=null;static osnapPointRefClassName="AcDbOsnapPointRef"};var cs=class extends Y{dimensionHandle=null;firstPointRef=null;fourthPointRef=null;secondPointRef=null;thirdPointRef=null;constructor(e){super(e??new Dt)}_build(e){super._build(e);let t=e.tryGetCadObject(this.dimensionHandle);t&&(this.cadObject.dimension=t),this.firstPointRef!==null&&(this.cadObject.firstPointRef=this.firstPointRef.osnapPointRef,this.firstPointRef.build(e)),this.secondPointRef!==null&&(this.cadObject.secondPointRef=this.secondPointRef.osnapPointRef,this.secondPointRef.build(e)),this.thirdPointRef!==null&&(this.cadObject.thirdPointRef=this.thirdPointRef.osnapPointRef,this.thirdPointRef.build(e)),this.fourthPointRef!==null&&(this.cadObject.fourthPointRef=this.fourthPointRef.osnapPointRef,this.fourthPointRef.build(e))}};(function(r){class e{objectHandle=null;osnapPointRef;constructor(i){this.osnapPointRef=i}build(i){let s=i.tryGetCadObject(this.objectHandle);s&&(this.osnapPointRef.geometry=s)}}r.OsnapPointRefTemplate=e})(cs||(cs={}));var ds=class extends Y{nodeTemplates=[];constructor(e){super(e??new Vt)}_build(e){super._build(e);for(let t of this.nodeTemplates)t.build(e),this.cadObject.nodes.push(t.node)}};(function(r){class e{node=new ka;expressionHandle=null;build(i){let s=i.tryGetCadObject(this.expressionHandle);s?this.node.expression=s:i.notify(`Evaluation graph couldn't find the EvaluationExpression with handle ${this.expressionHandle}`,y.Warning)}}r.GraphNodeTemplate=e})(ds||(ds={}));var Hn=class extends Y{constructor(e){super(e)}};var Ks=class extends Hn{get blockElement(){return this.cadObject}constructor(e){super(e)}};var Fn=class extends Ks{get blockAction(){return this.cadObject}entityHandles=new Set;constructor(e){super(e)}_build(e){super._build(e);for(let t of this.entityHandles){let i=e.tryGetCadObject(t);i?this.blockAction.entities.push(i):e.notify(`[${this.blockAction.toString()}] entity with handle ${t} not found.`)}}};var nc=class extends Fn{get blockFlipAction(){return this.cadObject}constructor(e){super(e)}};var Un=class extends Ks{get blockParameter(){return this.cadObject}constructor(e){super(e)}};var Wn=class extends Un{get block2PtParameter(){return this.cadObject}constructor(e){super(e)}};var oc=class extends Wn{get blockFlipParameter(){return this.cadObject}constructor(e){super(e)}};De();D();B();var zn=class extends A{id=0;get objectType(){return m.UNLISTED}get subclassMarker(){return d.evalGraphExpr}value98=0;value99=0};D();var Js=class extends zn{get subclassMarker(){return d.blockElement}elementName="";value1071=0};D();var $n=class extends Js{get subclassMarker(){return d.blockParameter}value280=!1;value281=!1};D();var Qs=class extends $n{firstPoint=new c(0,0,0);secondPoint=new c(0,0,0);get subclassMarker(){return d.block2PtParameter}value170=0;value171=0;value172=0;value173=0;value174=0;value177=0;value303="";value304="";value94=0;value95=0};T();D();var ea=class extends Qs{description="";name="";nameOffset=0;get objectName(){return h.objectBlockRotationParameter}point=new c(0,0,0);get subclassMarker(){return d.blockRotationParameter}value141=0;value142=0;value143=0;value175=0;value307="";value96=0};var Gn=class extends Wn{constructor(e){super(e??new ea)}};D();var Xn=class extends $n{get subclassMarker(){return d.block1PtParameter}location=new c(0,0,0);value93=0;value170=0;value171=0};T();D();var Yn=class r{name="";entities=[];expressions=[];clone(){let e=new r;return e.name=this.name,e.entities=this.entities.map(t=>t.clone()),e.expressions=this.expressions.map(t=>t.clone()),e}},ta=class extends Xn{description="";entities=[];name="";get objectName(){return h.objectBlockVisibilityParameter}_states=new Map;get states(){return this._states}get subclassMarker(){return d.blockVisibilityParameter}value91=!1;addState(e){this._states.set(e.name,e)}clone(){let e=super.clone();e.entities=this.entities.map(t=>t.clone()),e._states=new Map;for(let[t,i]of this._states){let s=i.clone();e._states.set(s.name,s)}return e}};var lc=class extends Un{get block1PtParameter(){return this.cadObject}constructor(e){super(e)}};var hs=class extends lc{entityHandles=[];stateTemplates=[];constructor(e){super(e??new ta)}_build(e){super._build(e);let t=this.cadObject;for(let i of this.entityHandles){let s=e.tryGetCadObject(i);s?t.entities.push(s):e.notify(`[${t.toString()}] entity with handle ${i} not found.`)}for(let i of this.stateTemplates)i.build(e,this.entityHandles),t.addState(i.state)}};(function(r){class e{state=new Yn;entityHandles=new Set;expressionHandles=new Set;constructor(i){i&&(this.state=i)}build(i,s){this._setEntities(i,this.state.entities,this.entityHandles,s),this._setEntities(i,this.state.expressions,this.expressionHandles,null)}_setEntities(i,s,a,n){for(let o of a){n!==null&&!n.includes(o)&&i.notify(`[${this.state.toString()}] parent does not contain handle ${o}.`);let l=i.tryGetCadObject(o);l?s.push(l):i.notify(`[${this.state.toString()}] object with handle ${o} not found.`)}}}r.StateTemplate=e})(hs||(hs={}));D();var Zn=class extends Js{actionPoint=new c(0,0,0);entities=[];get subclassMarker(){return d.blockAction}value70=0};D();var cc=class extends Zn{get subclassMarker(){return d.blockActionBasePt}value1011=new c(0,0,0);value1012=new c(0,0,0);value280=!1;value301="";value302="";value92=0;value93=0};D();var ra=class extends cc{get subclassMarker(){return d.blockRotationAction}value303="";value94=0};var dc=class extends Fn{constructor(e){super(e)}};var qn=class extends dc{constructor(e){super(e??new ra)}};te();T();D();var ni=class extends M{block=null;get objectName(){return h.objectBlockRepresentationData}get subclassMarker(){return d.blockRepresentationData}value70=0};var Kn=class extends Y{blockHandle=null;constructor(e){super(e??new ni)}_build(e){super._build(e);let t=this.getTableReference(e,this.blockHandle,"");t&&(this.cadObject.block=t)}};D();var ia=class extends Js{location=new c(0,0,0);get subclassMarker(){return d.blockGrip}value280=0;value91=0;value92=0;value93=0};T();D();var Jn=class extends ia{get objectName(){return h.objectBlockRotationGrip}get subclassMarker(){return d.blockRotationGrip}};var Qn=class extends Ks{constructor(e){super(e)}};var eo=class extends Qn{constructor(e){super(e??new Jn)}};T();D();var to=class extends ia{get objectName(){return h.objectBlockVisibilityGrip}get subclassMarker(){return d.blockVisibilityGrip}};var ro=class extends Qn{constructor(e){super(e??new to)}};T();D();var sa=class extends zn{get objectName(){return h.objectBlockGripLocationComponent}get subclassMarker(){return d.blockGripExpression}value300="";value91=0};var io=class extends Hn{constructor(e){super(e??new sa)}};var so=class extends Y{cadObjectsHandles=[];cadValueTemplates=[];childrenHandles=[];constructor(e){super(e)}_build(e){super._build(e);for(let t of this.cadObjectsHandles){let i=e.tryGetCadObject(t);i?this.cadObject.cadObjects.push(i):e.notify(`[${this.cadObject.subclassMarker}] CadObject with handle ${t} not found.`,y.Warning)}for(let t of this.childrenHandles){let i=e.tryGetCadObject(t);i?this.cadObject.children.push(i):e.notify(`[${this.cadObject.subclassMarker}] CadObject with handle ${t} not found.`,y.Warning)}}};var ao=class extends Y{ownedObjectsHandlers=new Set;constructor(e){super(e)}_build(e){super._build(e);for(let t of this.ownedObjectsHandlers){let i=e.tryGetCadObject(t);i?this.cadObject.fields.push(i):e.notify(`Field ${t} not found for FieldList ${this.cadObject.handle}`,y.Warning)}}};var no=class{cadValue;valueHandle=null;constructor(e){this.cadValue=e}build(e){let t=e.tryGetCadObject(this.valueHandle);t&&this.cadValue.setValue(t,V.Handle)}};var hc=class extends O{binRecordHandle=null;cleanupGroupHandle=null;rawData=null;styleHandle=null;constructor(e){super(e)}_build(e){super._build(e);let t=this.cadObject;this.rawData!==null&&(t.rawData=this.rawData);let i=e.tryGetCadObject(this.binRecordHandle);i&&(t.binRecord=i);let s=e.tryGetCadObject(this.styleHandle);s&&(t.style=s);let a=e.tryGetCadObject(this.cleanupGroupHandle);a&&(t.cleanupGroup=a)}};B();var oo=class extends ye{blockRecord=null;get objectType(){return m.VP_ENT_HDR}};xr();te();T();D();B();var Ke=class extends M{static currentAnnotationScale="CANNOSCALE";static currentMultiLeaderStyle="CMLEADERSTYLE";static currentTableStyle="CTABLESTYLE";static wipeoutFrame="WIPEOUTFRAME";get objectName(){return h.objectDictionaryVar}objectSchemaNumber=0;get objectType(){return m.UNLISTED}get subclassMarker(){return d.dictionaryVariables}value="";constructor(e,t){super(e),t!==void 0&&(this.value=t)}};te();T();D();B();var nl;(function(r){r[r.None=0]="None",r[r.Centimeters=2]="Centimeters",r[r.Inches=5]="Inches"})(nl||(nl={}));var oi=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectImageDefinition}get subclassMarker(){return d.rasterImageDef}classVersion=0;fileName="";size=new g(0,0);defaultSize=new g(1,1);isLoaded=!0;units=nl.None};te();T();D();var ol;(function(r){r[r.Draft=0]="Draft",r[r.High=1]="High"})(ol||(ol={}));var li=class extends M{classVersion=0;displayQuality=ol.High;isDisplayFrameShown=!1;get objectName(){return h.objectRasterVariables}get subclassMarker(){return d.rasterVariables}units=0};te();T();D();B();var uc;(function(r){r[r.NoEdges=0]="NoEdges",r[r.Isolines=1]="Isolines",r[r.FacetEdges=2]="FacetEdges"})(uc||(uc={}));var mc;(function(r){r[r.NoColor=0]="NoColor",r[r.ObjectColor=1]="ObjectColor",r[r.BackgroundColor=2]="BackgroundColor",r[r.CustomColor=3]="CustomColor",r[r.Monochrome=4]="Monochrome",r[r.Tinted=5]="Tinted",r[r.Desaturated=6]="Desaturated"})(mc||(mc={}));var pc;(function(r){r[r.Invisible=0]="Invisible",r[r.Visible=1]="Visible",r[r.Phong=2]="Phong",r[r.Gooch=3]="Gooch"})(pc||(pc={}));var fc;(function(r){r[r.NoLighting=0]="NoLighting",r[r.PerFaceLighting=1]="PerFaceLighting",r[r.PerVertexLighting=2]="PerVertexLighting"})(fc||(fc={}));var wc;(function(r){r[r.None=0]="None",r[r.Opacity=1]="Opacity",r[r.Specular=2]="Specular"})(wc||(wc={}));var Ni=class extends M{brightness=0;color=S.byLayer;description="";displaySettings=0;edgeApplyStyleFlag=0;edgeColor=0;edgeCreaseAngle=0;edgeIntersectionColor=S.byLayer;edgeIntersectionLineType=0;edgeIsolineCount=0;edgeJitter=0;edgeModifiers=0;edgeObscuredColor=S.byLayer;edgeObscuredLineType=0;edgeOverhang=0;edgeSilhouetteColor=S.byLayer;edgeSilhouetteWidth=0;edgeStyle=0;edgeStyleModel=uc.NoEdges;edgeWidth=0;faceColorMode=mc.NoColor;faceLightingModel=pc.Invisible;faceLightingQuality=fc.NoLighting;faceModifiers=wc.None;faceOpacityLevel=0;faceSpecularLevel=0;faceStyleMonoColor=S.byLayer;haloGap=0;internalFlag=!1;get objectName(){return h.objectVisualStyle}get objectType(){return m.UNLISTED}opacityLevel=0;precisionFlag=!1;rasterFile="";shadowType=0;get subclassMarker(){return d.visualStyle}type=0;static defaultName="2dWireframe"};te();D();B();var _c=class extends M{get objectType(){return m.UNLISTED}get subclassMarker(){return d.underlayDefinition}file=""};T();var Ai=class extends _c{get objectName(){return h.objectPdfDefinition}_page="";get page(){return this._page}set page(e){this._page=e||""}};te();T();D();B();var vi=class extends M{get objectType(){return m.ACDBPLACEHOLDER}get objectName(){return h.objectPlaceholder}get subclassMarker(){return d.acDbPlaceHolder}};te();T();D();var Ei=class extends M{get objectName(){return h.objectDBColor}get subclassMarker(){return d.dbColor}get name(){return this.colorName?`${this.bookName}$${this.colorName}`:""}set name(e){if(e.includes("$")){let t=e.split("$");this.bookName=t[0],this.colorName=t[t.length-1]}else this.colorName=e}colorName="";bookName="";color=S.byBlock;constructor(e,t){super(e),t&&(this.bookName=t)}};te();T();D();var ci=class extends M{get classId(){return this.dxfClass?.classNumber??0}get drawingFormat(){return this.version|this.maintenanceVersion<<16}dxfClass=null;maintenanceVersion=0;get objectName(){return h.objectProxyObject}originalDataFormatDxf=!1;proxyClassId=499;binaryData=null;data=null;get subclassMarker(){return d.proxyObject}version=u.Unknown};te();D();B();var bc=class extends M{static filterEntryName="ACAD_FILTER";get objectType(){return m.UNLISTED}get subclassMarker(){return d.filter}constructor(e){super(e)}};T();D();B();var br=class extends bc{static spatialFilterEntryName="SPATIAL";backDistance=0;boundaryPoints=[];clipBackPlane=!1;clipFrontPlane=!1;displayBoundary=!1;frontDistance=0;insertTransform=mt.identity();inverseInsertTransform=mt.identity();normal=new c(0,0,1);get objectName(){return h.objectSpatialFilter}get objectType(){return m.UNLISTED}origin=new c(0,0,1);get subclassMarker(){return d.spatialFilter}constructor(e){super(e)}};T();D();var yc=class extends Zn{caption301="";caption302="";caption303="";caption304="";get objectName(){return h.objectBlockFlipAction}get subclassMarker(){return d.blockFlipAction}value92=0;value93=0;value94=0;value95=0};T();D();var gc=class extends Qs{get objectName(){return h.objectBlockFlipParameter}get subclassMarker(){return d.blockFlipParameter}caption="";description="";baseStateName="";flippedStateName="";captionLocation=new c(0,0,0);caption309="";value96=0;caption1001="";point1010=new c(0,0,0)};T();var ki=class extends Hs{insertionPoint=new c(0,0,0);get objectName(){return h.blkRefObjectContextData}rotation=0;get xScale(){return this._xscale}set xScale(e){if(e===0)throw new Error("XScale value must be non-zero.");this._xscale=e}get yScale(){return this._yscale}set yScale(e){if(e===0)throw new Error("YScale value must be non-zero.");this._yscale=e}get zScale(){return this._zscale}set zScale(e){if(e===0)throw new Error("ZScale value must be non-zero.");this._zscale=e}_xscale=1;_yscale=1;_zscale=1};T();var Pi=class extends Hs{alignmentPoint=new c(1,0,0);attachmentPoint=se.TopLeft;insertPoint=new c(0,0,0);get objectName(){return h.mTextAttributeObjectContextData}rotation=0;value290=!1};te();T();D();var ll;(function(r){r[r.Never=0]="Never",r[r.OnOpen=1]="OnOpen",r[r.OnSave=2]="OnSave",r[r.OnPlot=4]="OnPlot",r[r.OnPackedETransmit=8]="OnPackedETransmit",r[r.OnRegeneration=16]="OnRegeneration",r[r.OnDemand=32]="OnDemand"})(ll||(ll={}));var cl;(function(r){r[r.NotEvaluated=1]="NotEvaluated",r[r.Success=2]="Success",r[r.EvaluatorNotFound=4]="EvaluatorNotFound",r[r.SyntaxError=8]="SyntaxError",r[r.InvalidCode=16]="InvalidCode",r[r.InvalidContext=32]="InvalidContext",r[r.OtherError=64]="OtherError"})(cl||(cl={}));var dl;(function(r){r[r.Unknown=0]="Unknown",r[r.Initialized=1]="Initialized",r[r.Compiled=2]="Compiled",r[r.Modified=4]="Modified",r[r.Evaluated=8]="Evaluated",r[r.Cached=16]="Cached"})(dl||(dl={}));var hl;(function(r){r[r.None=0]="None",r[r.NoFieldResult=1]="NoFieldResult"})(hl||(hl={}));var Li=class extends M{cadObjects=[];children=[];evaluationErrorCode=0;evaluationErrorMessage="";evaluationOptionFlags=ll.Never;evaluationStatusFlags=cl.NotEvaluated;evaluatorId="";fieldCode="";fieldStateFlags=dl.Unknown;filingOptionFlags=hl.None;formatString="";get objectName(){return h.objectField}get subclassMarker(){return d.field}value=new vt;values=new Map};te();T();D();B();var ji=class extends M{fields=[];get objectName(){return h.objectFieldList}get objectType(){return m.UNLISTED}get subclassMarker(){return d.fieldList}clone(){let e=super.clone();return e.fields=[...this.fields],e}};te();T();D();B();var aa=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectAecCleanupGroupDef}get subclassMarker(){return d.aecDbCleanupGroupDef}version=0;description="";rawData=null;constructor(e){super(e)}};te();T();D();B();var na=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectAecWallStyle}get subclassMarker(){return d.aecDbWallStyle}version=0;description="";rawData=null;constructor(e){super(e)}};te();T();D();B();var oa=class extends M{get objectType(){return m.UNLISTED}get objectName(){return h.objectBinRecord}get subclassMarker(){return d.binRecord}version=0;binaryData=new Uint8Array(0)};Aa();ie();var lo=class extends Pa{constructor(e){super(w.ExtendedDataLayerName,e)}};ie();ht();var us=class extends le{constructor(e){super(w.ExtendedDataWorldXDisp,e)}};ie();ht();var ms=class extends le{constructor(e){super(w.ExtendedDataDist,e)}};ie();ht();var ps=class extends le{constructor(e){super(w.ExtendedDataScale,e)}};ie();ht();var fs=class extends le{constructor(e){super(w.ExtendedDataWorldXDir,e)}};ie();ht();var ws=class extends le{constructor(e){super(w.ExtendedDataWorldXCoordinate,e)}};var xc=class r extends J{get sectionName(){return R.acDbObjects}_classes;_crcReader;_map;_memoryStream;_readedObjects=new Map;_reader;_builder;_handles;_handlesReader;_mergedReaders;_objectInitialPos=0;_objectReader;_size=0;_textReader;constructor(e,t,i,s,a,n){super(e),this._builder=t,this._reader=i,this._handles=[...s],this._map=new Map(a),this._classes=new Map;for(let o of n)this._classes.set(o.classNumber,o);this._memoryStream=i.stream,this._crcReader=Be.getStreamHandler(this._version,this._memoryStream)}read(){for(let e=0;e=u.AC1015&&this._version=u.AC1024?this._objectReader.readBitLongLong():this._objectReader.readRawLong();this._objectReader.advance(i)}this._version>=u.AC1012&&this._version<=u.AC1014&&this._updateHandleReader(),this._readEntityMode(e)}_readCommonNonEntityData(e){this._readCommonData(e),this.r13_14Only&&this._updateHandleReader(),e.ownerHandle=this._handleReference(e.cadObject.handle),this._readReactorsAndDictionaryHandle(e)}_readEntityMode(e){let t=e.cadObject;e.entityMode=this._objectReader.read2Bits(),e.entityMode===0?e.ownerHandle=this._handlesReader.handleReferenceWithRef(t.handle):e.entityMode===1?this._builder.paperSpaceEntities.push(t):e.entityMode===2&&this._builder.modelSpaceEntities.push(t),this._readReactorsAndDictionaryHandle(e),this.r13_14Only&&(e.layerHandle=this._handleReference(),this._objectReader.readBit()||(e.lineTypeHandle=this._handleReference())),!this.r2004Plus&&!this._objectReader.readBit()?(e.prevEntity=this._handleReference(t.handle),e.nextEntity=this._handleReference(t.handle)):this.r2004Plus||(this._readedObjects.has(t.handle-1)||this._handles.push(t.handle-1),this._readedObjects.has(t.handle+1)||this._handles.push(t.handle+1));let{color:i,transparency:s,flag:a}=this._objectReader.readEnColor();if(t.color=i,t.transparency=s,this._version>=u.AC1018&&a&&(e.colorHandle=this._handleReference()),t.lineTypeScale=this._objectReader.readBitDouble(),!(this._version>=u.AC1015)){t.isInvisible=(this._objectReader.readBitShort()&1)===0;return}e.layerHandle=this._handleReference(),e.ltypeFlags=this._objectReader.read2Bits(),e.ltypeFlags===3&&(e.lineTypeHandle=this._handleReference()),this.r2007Plus&&(this._objectReader.read2Bits()===3&&(e.materialHandle=this._handleReference()),this._objectReader.readByte()),this._objectReader.read2Bits()===3&&this._handleReference(),this.r2010Plus&&(this._objectReader.readBit()&&this._handleReference(),this._objectReader.readBit()&&this._handleReference(),this._objectReader.readBit()&&this._handleReference()),t.isInvisible=(this._objectReader.readBitShort()&1)===1,t.lineWeight=q.toValue(this._objectReader.readByte())}_readExtendedData(e){let t=this._objectReader.readBitShort();for(;t!==0;){let i=this._objectReader.handleReference(),s=this._objectReader.position+t,a=this._readExtendedDataRecords(s);e.eDataTemplate.set(i,a),t=this._objectReader.readBitShort()}}_readExtendedDataRecords(e){let t=[];for(;this._objectReader.position0&&(e.flags|=ar.XrefDependent);else{this._objectReader.readBit()&&(e.flags|=ar.Referenced);let t=this._objectReader.readBitShort()-1;this._objectReader.readBit()&&(e.flags|=ar.XrefDependent)}}_updateHandleReader(){let e=this._objectReader.readRawLong();this._handlesReader.setPositionInBits(e+this._objectInitialPos),this._version===u.AC1021&&(this._textReader=Be.getStreamHandler(this._version,this._memoryStream,this._reader.encoding),this._textReader.setPositionByFlag(e+this._objectInitialPos-1)),this._mergedReaders=new As(this._objectReader,this._textReader,this._handlesReader)}static _looksLikeUtf16Le(e,t){if(e==null||t<0||t+1>=e.length)return!1;let i=!1;for(let s=t;s+10&&(e.name=i),t}_readEndBlock(){let e=new Ps(new U),t=new O(e);return this._readCommonEntityData(t),t}_readSeqend(){let e=new O(new Se);return this._readCommonEntityData(e),e}_readShape(){let e=new qr,t=new bn(e);return this._readCommonEntityData(t),e.insertionPoint=this._objectReader.read3BitDouble(),e.size=this._objectReader.readBitDouble(),e.rotation=this._objectReader.readBitDouble(),e.relativeXScale=this._objectReader.readBitDouble(),e.obliqueAngle=this._objectReader.readBitDouble(),e.thickness=this._objectReader.readBitDouble(),e.shapeIndex=this._objectReader.readBitShort()&65535,e.normal=this._objectReader.read3BitDouble(),t.shapeFileHandle=this._handleReference(),t}_readTolerance(){let e=new pr,t=new xn(e);return this._readCommonEntityData(t),this.r13_14Only&&(this._objectReader.readBitShort(),this._objectReader.readBitDouble(),this._objectReader.readBitDouble()),e.insertionPoint=this._objectReader.read3BitDouble(),e.direction=this._objectReader.read3BitDouble(),e.normal=this._objectReader.read3BitDouble(),e.text=this._textReader.readVariableText(),t.dimensionStyleHandle=this._handleReference(),t}_readPlaceHolder(){let e=new ee(new vi);return this._readCommonNonEntityData(e),e}_readUnknownEntity(e){let t=new er(e),i=new Mn(t);return this._readCommonEntityData(i),i}_readUnknownNonGraphicalObject(e){let t=new Kr(e),i=new In(t);return this._readCommonNonEntityData(i),i}_readBlockControlObject(){let e=new nn(new Tr);return this._readDocumentTable(e),e.modelSpaceHandle=this._handleReference(),e.paperSpaceHandle=this._handleReference(),e}_readBlockHeader(){let e=new U,t=e.blockEntity,i=new ti(e);this._builder.blockRecordTemplates.push(i),this._readCommonNonEntityData(i);let s=this._textReader.readVariableText();(s.toLowerCase()===U.modelSpaceName.toLowerCase()||s.toLowerCase()===U.paperSpaceName.toLowerCase())&&(e.name=s),this._readXrefDependantBit(i.cadObject),this._objectReader.readBit()&&(t.flags|=ne.Anonymous);let a=this._objectReader.readBit();this._objectReader.readBit()&&(t.flags|=ne.XRef),this._objectReader.readBit()&&(t.flags|=ne.XRefOverlay),this.r2000Plus&&(t.isUnloaded=this._objectReader.readBit());let n=0;this.r2004Plus&&!(t.flags&ne.XRef)&&!(t.flags&ne.XRefOverlay)&&(n=this._objectReader.readBitLong()),t.basePoint=this._objectReader.read3BitDouble(),t.xRefPath=this._textReader.readVariableText();let o=0;if(this.r2000Plus){for(let b=this._objectReader.readByte();b!==0;b=this._objectReader.readByte())++o;t.comments=this._textReader.readVariableText();let l=this._objectReader.readBitLong(),p=[];for(let b=0;b0),this._handleReference(),i.beginBlockHandle=this._handleReference(),this._version>=u.AC1012&&this._version<=u.AC1015&&!(t.flags&ne.XRef)&&!(t.flags&ne.XRefOverlay)&&(i.firstEntityHandle=this._handleReference(),i.lastEntityHandle=this._handleReference()),this.r2004Plus)for(let l=0;l0&&(e.name=i),this._readXrefDependantBit(e),this._objectReader.readByte(),this._handleReference(),t}_readTextStyle(){let e=new oe,t=new xe(e);this._readCommonNonEntityData(t);let i=this._textReader.readVariableText();return i&&i.trim().length>0&&(e.name=i),this._readXrefDependantBit(t.cadObject),this._objectReader.readBit()&&(e.flags|=ui.IsShape),this._objectReader.readBit()&&(e.flags|=ui.VerticalText),e.height=this._objectReader.readBitDouble(),e.width=this._objectReader.readBitDouble(),e.obliqueAngle=this._objectReader.readBitDouble(),e.mirrorFlag=this._objectReader.readByte(),e.lastHeight=this._objectReader.readBitDouble(),e.filename=this._textReader.readVariableText(),e.bigFontFilename=this._textReader.readVariableText(),this._handleReference(),t}_readLayer(){let e=new pe,t=new cn(e);this._readCommonNonEntityData(t);let i=this._textReader.readVariableText();if(i&&i.trim().length>0&&(e.name=i),this._readXrefDependantBit(t.cadObject),this.r13_14Only&&(this._objectReader.readBit()&&(e.flags|=st.Frozen),e.isOn=this._objectReader.readBit(),this._objectReader.readBit()&&(e.flags|=st.FrozenNewViewports),this._objectReader.readBit()&&(e.flags|=st.Locked)),this.r2000Plus){let a=this._objectReader.readBitShort();(a&1)>0&&(e.flags|=st.Frozen),e.isOn=(a&2)===0,(a&4)>0&&(e.flags|=st.FrozenNewViewports),(a&8)>0&&(e.flags|=st.Locked),e.plotFlag=(a&16)>0;let n=(a&992)>>5;e.lineWeight=q.toValue(n)}let s=this._mergedReaders.readCmColor();return e.color=s.isByBlock||s.isByLayer?new S(30):s,t.layerControlHandle=this._handleReference(),this.r2000Plus&&(t.plotStyleHandle=this._handleReference()),this.r2007Plus&&(t.materialHandle=this._handleReference()),t.lineTypeHandle=this._handleReference(),this.r2013Plus&&this._handleReference(),t}_readLType(){let e=new z,t=new as(e);this._readCommonNonEntityData(t);let i=this._textReader.readVariableText();i&&i.trim().length>0&&(e.name=i),this._readXrefDependantBit(t.cadObject),e.description=this._textReader.readVariableText(),t.totalLen=this._objectReader.readBitDouble(),e.alignment=String.fromCharCode(this._objectReader.readRawChar());let s=this._objectReader.readByte(),a=!1;for(let o=0;o=t.length){this._builder.notify(`Unable to read linetype text segment; offset ${s} is outside the available buffer (${t.length} bytes).`,y.Warning),i.segment.text="",i.segment.shapeNumber=0;continue}i.segment.text=this._readLineTypeTextString(t,s),i.segment.shapeNumber=0}}_readLineTypeTextString(e,t){if(!e||t<0||t>=e.length)return"";if(r._looksLikeUtf16Le(e,t)){let s=t;for(;s+10&&(this._objectReader.readBytes(s),this._handleReference(),this._objectReader.readBitShort());break}}t.tag=this._textReader.readVariableText(),this._objectReader.readBitShort(),t.flags=this._objectReader.readByte(),this.r2007Plus&&(t.isReallyLocked=this._objectReader.readBit())}_readCommonTextData(e){this._readCommonEntityData(e);let t=e.cadObject,i=0,s;if(this.r13_14Only){i=this._objectReader.readBitDouble(),s=this._objectReader.read2RawDouble(),t.insertPoint=new c(s.x,s.y,i),s=this._objectReader.read2RawDouble(),t.alignmentPoint=new c(s.x,s.y,i),t.normal=this._objectReader.read3BitDouble(),t.thickness=this._objectReader.readBitDouble(),t.obliqueAngle=this._objectReader.readBitDouble(),t.rotation=this._objectReader.readBitDouble(),t.height=this._objectReader.readBitDouble(),t.widthFactor=this._objectReader.readBitDouble(),t.value=this._textReader.readVariableText(),t.mirror=this._objectReader.readBitShort(),t.horizontalAlignment=this._objectReader.readBitShort(),t.verticalAlignment=this._objectReader.readBitShort(),e.styleHandle=this._handleReference();return}let a=this._objectReader.readByte();if((a&1)===0&&(i=this._objectReader.readDouble()),s=this._objectReader.read2RawDouble(),t.insertPoint=new c(s.x,s.y,i),(a&2)===0){let n=this._objectReader.readBitDoubleWithDefault(t.insertPoint.x),o=this._objectReader.readBitDoubleWithDefault(t.insertPoint.y);t.alignmentPoint=new c(n,o,i)}t.normal=this._objectReader.readBitExtrusion(),t.thickness=this._objectReader.readBitThickness(),(a&4)===0&&(t.obliqueAngle=this._objectReader.readDouble()),(a&8)===0&&(t.rotation=this._objectReader.readDouble()),t.height=this._objectReader.readDouble(),(a&16)===0&&(t.widthFactor=this._objectReader.readDouble()),t.value=this._textReader.readVariableText(),(a&32)===0&&(t.mirror=this._objectReader.readBitShort()),(a&64)===0&&(t.horizontalAlignment=this._objectReader.readBitShort()),(a&128)===0&&(t.verticalAlignment=this._objectReader.readBitShort()),e.styleHandle=this._handleReference()}_readInsert(){let e=new ii(new Ye);return this._readInsertCommonData(e),this._readInsertCommonHandles(e),e}_readMInsert(){let e=new Ye,t=new ii(e);return this._readInsertCommonData(t),e.columnCount=this._objectReader.readBitShort()&65535,e.rowCount=this._objectReader.readBitShort()&65535,e.columnSpacing=this._objectReader.readBitDouble(),e.rowSpacing=this._objectReader.readBitDouble(),this._readInsertCommonHandles(t),t}_readInsertCommonData(e){let t=e.cadObject;if(this._readCommonEntityData(e),t.insertPoint=this._objectReader.read3BitDouble(),this.r13_14Only){let i=this._objectReader.read3BitDouble();t.xScale=i.x,t.yScale=i.y,t.zScale=i.z}if(this.r2000Plus)switch(this._objectReader.read2Bits()){case 0:t.xScale=this._objectReader.readDouble(),t.yScale=this._objectReader.readBitDoubleWithDefault(t.xScale),t.zScale=this._objectReader.readBitDoubleWithDefault(t.xScale);break;case 1:t.yScale=this._objectReader.readBitDoubleWithDefault(t.xScale),t.zScale=this._objectReader.readBitDoubleWithDefault(t.xScale);break;case 2:{let i=this._objectReader.readDouble();t.xScale=i,t.yScale=i,t.zScale=i;break}case 3:t.xScale=1,t.yScale=1,t.zScale=1;break}t.rotation=this._objectReader.readBitDouble(),t.normal=this._objectReader.read3BitDouble(),e.hasAtts=this._objectReader.readBit(),e.ownedObjectsCount=0,this.r2004Plus&&e.hasAtts&&(e.ownedObjectsCount=this._objectReader.readBitLong())}_readInsertCommonHandles(e){if(e.blockHeaderHandle=this._handleReference(),!!e.hasAtts){if(this._version>=u.AC1012&&this._version<=u.AC1015)e.firstAttributeHandle=this._handleReference(),e.endAttributeHandle=this._handleReference();else if(this.r2004Plus)for(let t=0;t=u.AC1012&&this._version<=u.AC1015&&(t.firstVertexHandle=this._handleReference(),t.lastVertexHandle=this._handleReference()),t.seqendHandle=this._handleReference(),t}_readPolyline3D(){let e=new gt,t=new wr(e);this._readCommonEntityData(t);let i=this._objectReader.readByte(),s=(i&1)>0,a=(i&2)>0;if((s||a)&&(e.flags|=$e.SplineFit),e.flags|=$e.Polyline3D,(this._objectReader.readByte()&1)>0&&(e.flags|=$e.ClosedPolylineOrClosedPolygonMeshInM),this.r2004Plus){let n=this._objectReader.readBitLong();for(let o=0;o=u.AC1012&&this._version<=u.AC1015&&(t.firstVertexHandle=this._handleReference(),t.lastVertexHandle=this._handleReference()),t.seqendHandle=this._handleReference(),t}_readPolyfaceMesh(){let e=new wr(new jt);if(this._readCommonEntityData(e),this._objectReader.readBitShort(),this._objectReader.readBitShort(),this.r2004Plus){let t=this._objectReader.readBitLong();for(let i=0;i0){let l=this._objectReader.read2RawDouble();e.vertices.push(new Xi(l));for(let p=1;pu.AC1027&&(i.backgroundFillFlags&Or.TextFrame)>0)&&(i.backgroundScale=this._objectReader.readBitDouble(),i.backgroundColor=this._mergedReaders.readCmColor(),i.backgroundTransparency=this._objectReader.readBitLong())),!this.r2018Plus)return e;if(i.isAnnotative=!this._objectReader.readBit(),!i.isAnnotative&&(this._objectReader.readBitShort(),this._objectReader.readBit(),this._handleReference(),this._objectReader.readBitLong(),this._objectReader.read3BitDouble(),this._objectReader.read3BitDouble(),this._objectReader.readBitDouble(),this._objectReader.readBitDouble(),this._objectReader.readBitDouble(),this._objectReader.readBitDouble(),i.columnData.columnType=this._objectReader.readBitShort(),i.columnData.columnType!==dr.NoColumns)){let s=this._objectReader.readBitLong();if(i.columnData.width=this._objectReader.readBitDouble(),i.columnData.gutter=this._objectReader.readBitDouble(),i.columnData.autoHeight=this._objectReader.readBit(),i.columnData.flowReversed=this._objectReader.readBit(),!i.columnData.autoHeight&&i.columnData.columnType===dr.DynamicColumns&&s>0)for(let a=0;a0,e.gradientColor.colorTint=this._objectReader.readBitDouble();let n=this._objectReader.readBitLong();for(let o=0;o0){for(let X=0;X<$;++X)k.fitPoints.push(this._objectReader.read2RawDouble());k.startTangent=this._objectReader.read2RawDouble(),k.endTangent=this._objectReader.read2RawDouble()}}o.path.edges.push(k);break}}}let p=this._objectReader.readBitLong();for(let b=0;b256?256:t,e.color=new S(t),e.acisIndex=this._mergedReaders.readBitLong();let i=this._mergedReaders.readBitLong();for(let s=0;su.AC1015&&this._mergedReaders.readVariableText(),this.r2018Plus)e.version=this._mergedReaders.readBitLong(),e.maintenanceVersion=this._mergedReaders.readBitLong();else{let s=this._mergedReaders.readBitLong();e.version=s&65535,e.maintenanceVersion=s>>16}e.originalDataFormatDxf=this._mergedReaders.readBit()}}_readDictionary(){let e=new re,t=new qs(e);return this._readCommonDictionary(t),t}_readDictionaryVar(){let e=new Ke,t=new ee(e);return this._readCommonNonEntityData(t),this._objectReader.readByte(),e.value=this._textReader.readVariableText(),t}_readDictionaryWithDefault(){let e=new ai,t=new Bn(e);return this._readCommonDictionary(t),t.defaultEntryHandle=this._handleReference(),t}_readCommonDictionary(e){this._readCommonNonEntityData(e);let t=this._objectReader.readBitLong();this._version===u.AC1014&&this._objectReader.readByte(),this.r2000Plus&&(e.cadObject.clonningFlags=this._objectReader.readBitShort(),e.cadObject.hardOwnerFlag=this._objectReader.readByte()>0);for(let i=0;i0;let i=this._objectReader.readBitLong();for(let s=0;s0);break;case f.Chunk:case f.ExtendedDataChunk:e.createEntry(a,this._objectReader.readBytes(this._objectReader.readByte()));break;case f.ObjectId:case f.ExtendedDataHandle:t.addHandleReference(a,this._objectReader.readRawULong());break;default:this.notify(`Unidentified GroupCodeValueType ${a} for XRecord [${e.handle}]`,y.Warning);break}}this.r2000Plus&&(e.cloningFlags=this._objectReader.readBitShort());let s=this._objectInitialPos+this._size*8-7;for(;this._handlesReader.positionInBits()>>0,a=this._objectReader.readByte();(a&1)>0&&(e.colorName=this._textReader.readVariableText()),(a&2)>0&&(e.bookName=this._textReader.readVariableText());let n=$s.getBytes(s);e.color=new S(n[2],n[1],n[0])}else e.color=new S(i);return t}_readDimStyle(){let e=new Q,t=new ln(e);this._readCommonNonEntityData(t);let i=this._textReader.readVariableText();return i&&i.trim().length>0&&(e.name=i),this._readXrefDependantBit(e),this.r13_14Only&&(e.generateTolerances=this._objectReader.readBit(),e.limitsGeneration=this._objectReader.readBit(),e.textOutsideHorizontal=this._objectReader.readBit(),e.suppressFirstExtensionLine=this._objectReader.readBit(),e.suppressSecondExtensionLine=this._objectReader.readBit(),e.textInsideHorizontal=this._objectReader.readBit(),e.alternateUnitDimensioning=this._objectReader.readBit(),e.textOutsideExtensions=this._objectReader.readBit(),e.separateArrowBlocks=this._objectReader.readBit(),e.textInsideExtensions=this._objectReader.readBit(),e.suppressOutsideExtensions=this._objectReader.readBit(),e.alternateUnitDecimalPlaces=this._objectReader.readByte(),e.zeroHandling=this._objectReader.readRawChar(),e.suppressFirstDimensionLine=this._objectReader.readBit(),e.suppressSecondDimensionLine=this._objectReader.readBit(),e.toleranceAlignment=this._objectReader.readRawChar(),e.textHorizontalAlignment=this._objectReader.readByte(),e.dimensionFit=this._objectReader.readRawChar(),e.cursorUpdate=this._objectReader.readBit(),e.toleranceZeroHandling=this._objectReader.readByte(),e.alternateUnitZeroHandling=this._objectReader.readByte(),e.alternateUnitToleranceZeroHandling=this._objectReader.readByte(),e.textVerticalAlignment=this._objectReader.readByte(),e.dimensionUnit=this._objectReader.readBitShort(),e.angularUnit=this._objectReader.readBitShort(),e.decimalPlaces=this._objectReader.readBitShort(),e.toleranceDecimalPlaces=this._objectReader.readBitShort(),e.alternateUnitFormat=this._objectReader.readBitShort(),e.alternateUnitToleranceDecimalPlaces=this._objectReader.readBitShort(),e.scaleFactor=this._objectReader.readBitDouble(),e.arrowSize=this._objectReader.readBitDouble(),e.extensionLineOffset=this._objectReader.readBitDouble(),e.dimensionLineIncrement=this._objectReader.readBitDouble(),e.extensionLineExtension=this._objectReader.readBitDouble(),e.rounding=this._objectReader.readBitDouble(),e.dimensionLineExtension=this._objectReader.readBitDouble(),e.plusTolerance=this._objectReader.readBitDouble(),e.minusTolerance=this._objectReader.readBitDouble(),e.textHeight=this._objectReader.readBitDouble(),e.centerMarkSize=this._objectReader.readBitDouble(),e.tickSize=this._objectReader.readBitDouble(),e.alternateUnitScaleFactor=this._objectReader.readBitDouble(),e.linearScaleFactor=this._objectReader.readBitDouble(),e.textVerticalPosition=this._objectReader.readBitDouble(),e.toleranceScaleFactor=this._objectReader.readBitDouble(),e.dimensionLineGap=this._objectReader.readBitDouble(),e.postFix=this._textReader.readVariableText(),e.alternateDimensioningSuffix=this._textReader.readVariableText(),t.dimbL_Name=this._textReader.readVariableText(),t.dimblK1_Name=this._textReader.readVariableText(),t.dimblK2_Name=this._textReader.readVariableText(),e.dimensionLineColor=this._objectReader.readColorByIndex(),e.extensionLineColor=this._objectReader.readColorByIndex(),e.textColor=this._objectReader.readColorByIndex()),this.r2000Plus&&(e.postFix=this._textReader.readVariableText(),e.alternateDimensioningSuffix=this._textReader.readVariableText(),e.scaleFactor=this._objectReader.readBitDouble(),e.arrowSize=this._objectReader.readBitDouble(),e.extensionLineOffset=this._objectReader.readBitDouble(),e.dimensionLineIncrement=this._objectReader.readBitDouble(),e.extensionLineExtension=this._objectReader.readBitDouble(),e.rounding=this._objectReader.readBitDouble(),e.dimensionLineExtension=this._objectReader.readBitDouble(),e.plusTolerance=this._objectReader.readBitDouble(),e.minusTolerance=this._objectReader.readBitDouble()),this.r2007Plus&&(e.fixedExtensionLineLength=this._objectReader.readBitDouble(),e.joggedRadiusDimensionTransverseSegmentAngle=this._objectReader.readBitDouble(),e.textBackgroundFillMode=this._objectReader.readBitShort(),e.textBackgroundColor=this._mergedReaders.readCmColor()),this.r2000Plus&&(e.generateTolerances=this._objectReader.readBit(),e.limitsGeneration=this._objectReader.readBit(),e.textInsideHorizontal=this._objectReader.readBit(),e.textOutsideHorizontal=this._objectReader.readBit(),e.suppressFirstExtensionLine=this._objectReader.readBit(),e.suppressSecondExtensionLine=this._objectReader.readBit(),e.textVerticalAlignment=this._objectReader.readBitShort(),e.zeroHandling=this._objectReader.readBitShort(),e.angularZeroHandling=this._objectReader.readBitShort()),this.r2007Plus&&(e.arcLengthSymbolPosition=this._objectReader.readBitShort()),this.r2000Plus&&(e.textHeight=this._objectReader.readBitDouble(),e.centerMarkSize=this._objectReader.readBitDouble(),e.tickSize=this._objectReader.readBitDouble(),e.alternateUnitScaleFactor=this._objectReader.readBitDouble(),e.linearScaleFactor=this._objectReader.readBitDouble(),e.textVerticalPosition=this._objectReader.readBitDouble(),e.toleranceScaleFactor=this._objectReader.readBitDouble(),e.dimensionLineGap=this._objectReader.readBitDouble(),e.alternateUnitRounding=this._objectReader.readBitDouble(),e.alternateUnitDimensioning=this._objectReader.readBit(),e.alternateUnitDecimalPlaces=this._objectReader.readBitShort(),e.textOutsideExtensions=this._objectReader.readBit(),e.separateArrowBlocks=this._objectReader.readBit(),e.textInsideExtensions=this._objectReader.readBit(),e.suppressOutsideExtensions=this._objectReader.readBit(),e.dimensionLineColor=this._mergedReaders.readCmColor(),e.extensionLineColor=this._mergedReaders.readCmColor(),e.textColor=this._mergedReaders.readCmColor(),e.angularDecimalPlaces=this._objectReader.readBitShort(),e.decimalPlaces=this._objectReader.readBitShort(),e.toleranceDecimalPlaces=this._objectReader.readBitShort(),e.alternateUnitFormat=this._objectReader.readBitShort(),e.alternateUnitToleranceDecimalPlaces=this._objectReader.readBitShort(),e.angularUnit=this._objectReader.readBitShort(),e.fractionFormat=this._objectReader.readBitShort(),e.linearUnitFormat=this._objectReader.readBitShort(),e.decimalSeparator=String.fromCharCode(this._objectReader.readBitShort()),e.textMovement=this._objectReader.readBitShort(),e.textHorizontalAlignment=this._objectReader.readBitShort(),e.suppressFirstDimensionLine=this._objectReader.readBit(),e.suppressSecondDimensionLine=this._objectReader.readBit(),e.toleranceAlignment=this._objectReader.readBitShort(),e.toleranceZeroHandling=this._objectReader.readBitShort(),e.alternateUnitZeroHandling=this._objectReader.readBitShort(),e.alternateUnitToleranceZeroHandling=this._objectReader.readBitShort(),e.cursorUpdate=this._objectReader.readBit(),e.dimensionFit=this._objectReader.readBitShort()),this.r2007Plus&&(e.isExtensionLineLengthFixed=this._objectReader.readBit()),this.r2010Plus&&(e.textDirection=this._objectReader.readBit()?Hi.RightToLeft:Hi.LeftToRight,e.altMzf=this._objectReader.readBitDouble(),e.altMzs=this._textReader.readVariableText(),e.mzf=this._objectReader.readBitDouble(),e.mzs=this._textReader.readVariableText()),this.r2000Plus&&(e.dimensionLineWeight=this._objectReader.readBitShort(),e.extensionLineWeight=this._objectReader.readBitShort()),this._objectReader.readBit(),t.blockHandle=this._handleReference(),t.textStyleHandle=this._handleReference(),this.r2000Plus&&(t.dimldrblk=this._handleReference(),t.dimblk=this._handleReference(),t.dimblk1=this._handleReference(),t.dimblk2=this._handleReference()),this.r2007Plus&&(t.dimltype=this._handleReference(),t.dimltex1=this._handleReference(),t.dimltex2=this._handleReference()),t}_readView(){let e=new ls,t=new Dn(e);return this._readCommonNonEntityData(t),e.name=this._textReader.readVariableText(),this._readXrefDependantBit(e),e.height=this._objectReader.readBitDouble(),e.width=this._objectReader.readBitDouble(),e.center=this._objectReader.read2RawDouble(),e.target=this._objectReader.read3BitDouble(),e.direction=this._objectReader.read3BitDouble(),e.angle=this._objectReader.readBitDouble(),e.lensLength=this._objectReader.readBitDouble(),e.frontClipping=this._objectReader.readBitDouble(),e.backClipping=this._objectReader.readBitDouble(),this._objectReader.readBit()&&(e.viewMode|=de.PerspectiveView),this._objectReader.readBit()&&(e.viewMode|=de.FrontClipping),this._objectReader.readBit()&&(e.viewMode|=de.BackClipping),this._objectReader.readBit()&&(e.viewMode|=de.FrontClippingZ),this.r2000Plus&&(e.renderMode=this._objectReader.readByte()),this.r2007Plus&&(this._mergedReaders.readBit(),this._mergedReaders.readByte(),this._mergedReaders.readBitDouble(),this._mergedReaders.readBitDouble(),this._mergedReaders.readCmColor()),this._objectReader.readBit()&&(e.flags|=1),this.r2000Plus&&(e.isUcsAssociated=this._objectReader.readBit(),e.isUcsAssociated&&(e.ucsOrigin=this._objectReader.read3BitDouble(),e.ucsXAxis=this._objectReader.read3BitDouble(),e.ucsYAxis=this._objectReader.read3BitDouble(),e.ucsElevation=this._objectReader.readBitDouble(),e.ucsOrthographicType=this._objectReader.readBitShort())),this._handleReference(),this.r2007Plus&&(e.isPlottable=this._objectReader.readBit(),this._handleReference(),this._handleReference(),this._handleReference()),this.r2000Plus&&e.isUcsAssociated&&(t.ucsHandle=this._handleReference(),t.namedUcsHandle=this._handleReference()),this.r2007Plus&&this._handleReference(),t}_readVPort(){let e=new nt,t=new Sn(e);if(this._readCommonNonEntityData(t),e.name=this._textReader.readVariableText(),this._readXrefDependantBit(e),e.viewHeight=this._objectReader.readBitDouble(),e.aspectRatio=this._objectReader.readBitDouble()/e.viewHeight,e.center=this._objectReader.read2RawDouble(),e.target=this._objectReader.read3BitDouble(),e.direction=this._objectReader.read3BitDouble(),e.twistAngle=this._objectReader.readBitDouble(),e.lensLength=this._objectReader.readBitDouble(),e.frontClippingPlane=this._objectReader.readBitDouble(),e.backClippingPlane=this._objectReader.readBitDouble(),this._objectReader.readBit()&&(e.viewMode|=de.PerspectiveView),this._objectReader.readBit()&&(e.viewMode|=de.FrontClipping),this._objectReader.readBit()&&(e.viewMode|=de.BackClipping),this._objectReader.readBit()&&(e.viewMode|=de.FrontClippingZ),this.r2000Plus&&(e.renderMode=this._objectReader.readByte()),this.r2007Plus&&(e.useDefaultLighting=this._objectReader.readBit(),e.defaultLighting=this._objectReader.readByte(),e.brightness=this._objectReader.readBitDouble(),e.contrast=this._objectReader.readBitDouble(),e.ambientColor=this._mergedReaders.readCmColor()),e.bottomLeft=this._objectReader.read2RawDouble(),e.topRight=this._objectReader.read2RawDouble(),this._objectReader.readBit()&&(e.viewMode|=de.Follow),e.circleZoomPercent=this._objectReader.readBitShort(),this._objectReader.readBit(),this._objectReader.readBit()&&(e.ucsIconDisplay=gi.OnLower),this._objectReader.readBit()&&(e.ucsIconDisplay=gi.OnOrigin),e.showGrid=this._objectReader.readBit(),e.gridSpacing=this._objectReader.read2RawDouble(),e.snapOn=this._objectReader.readBit(),e.isometricSnap=this._objectReader.readBit(),e.snapIsoPair=this._objectReader.readBitShort(),e.snapRotation=this._objectReader.readBitDouble(),e.snapBasePoint=this._objectReader.read2RawDouble(),e.snapSpacing=this._objectReader.read2RawDouble(),this.r2000Plus){this._objectReader.readBit();let i=this._objectReader.readBit();e.origin=this._objectReader.read3BitDouble(),e.xAxis=this._objectReader.read3BitDouble(),e.yAxis=this._objectReader.read3BitDouble(),e.elevation=this._objectReader.readBitDouble(),e.orthographicType=this._objectReader.readBitShort()}return this.r2007Plus&&(e.gridFlags=this._objectReader.readBitShort(),e.minorGridLinesPerMajorGridLine=this._objectReader.readBitShort()),t.vportControlHandle=this._handleReference(),this.r2007Plus&&(t.backgroundHandle=this._handleReference(),t.styleHandle=this._handleReference(),t.sunHandle=this._handleReference()),this.r2000Plus&&(t.namedUcsHandle=this._handleReference(),t.baseUcsHandle=this._handleReference()),t}_readUcs(){let e=new Rt,t=new Cn(e);this._readCommonNonEntityData(t),e.name=this._textReader.readVariableText(),this._readXrefDependantBit(e),e.origin=this._objectReader.read3BitDouble(),e.xAxis=this._objectReader.read3BitDouble(),e.yAxis=this._objectReader.read3BitDouble(),this.r2000Plus&&(e.elevation=this._objectReader.readBitDouble(),e.orthographicViewType=this._objectReader.readBitShort(),e.orthographicType=this._objectReader.readBitShort());let i=this._handleReference();if(this.r2000Plus){let s=this._handleReference(),a=this._handleReference()}return t}_readLayout(){let e=new ke,t=new dn(e);this._readCommonNonEntityData(t),this._readPlotSettingsData(e),e.name=this._textReader.readVariableText(),e.tabOrder=this._objectReader.readBitLong(),e.layoutFlags=this._objectReader.readBitShort(),e.origin=this._objectReader.read3BitDouble(),e.minLimits=this._objectReader.read2RawDouble(),e.maxLimits=this._objectReader.read2RawDouble(),e.insertionBasePoint=this._objectReader.read3BitDouble(),e.xAxis=this._objectReader.read3BitDouble(),e.yAxis=this._objectReader.read3BitDouble(),e.elevation=this._objectReader.readBitDouble(),e.ucsOrthographicType=this._objectReader.readBitShort(),e.minExtents=this._objectReader.read3BitDouble(),e.maxExtents=this._objectReader.read3BitDouble();let i=0;if(this.r2004Plus&&(i=this._objectReader.readBitLong()),t.paperSpaceBlockHandle=this._handleReference(),t.activeViewportHandle=this._handleReference(),t.baseUcsHandle=this._handleReference(),t.namesUcsHandle=this._handleReference(),this.r2004Plus)for(let s=0;s=u.AC1014&&(e.annotationOffset=this._objectReader.read3BitDouble()),this.r13_14Only&&(e.style.dimensionLineGap=this._objectReader.readBitDouble()),this._version<=u.AC1021&&(e.textHeight=this._objectReader.readBitDouble(),e.textWidth=this._objectReader.readBitDouble()),e.hookLineDirection=this._objectReader.readBit()?Zi.Same:Zi.Opposite,e.arrowHeadEnabled=this._objectReader.readBit(),this.r13_14Only&&(this._objectReader.readBitShort(),t.dimasz=this._objectReader.readBitDouble(),this._objectReader.readBit(),this._objectReader.readBit(),this._objectReader.readBitShort(),this._objectReader.readBitShort(),this._objectReader.readBit(),this._objectReader.readBit()),this.r2000Plus&&(this._objectReader.readBitShort(),this._objectReader.readBit(),this._objectReader.readBit()),t.annotationHandle=this._handleReference(),t.dimstyleHandle=this._handleReference(),t}_readMultiLeader(){let e=new Xr,t=new un(e);if(this._readCommonEntityData(t),this.r2010Plus){let s=this._objectReader.readBitShort()}if(this._readMultiLeaderAnnotContextData(e.contextData,t.cadMLeaderAnnotContextTemplate),t.leaderStyleHandle=this._handleReference(),e.propertyOverrideFlags=this._objectReader.readBitLong(),e.pathType=this._objectReader.readBitShort(),e.lineColor=this._mergedReaders.readCmColor(),t.leaderLineTypeHandle=this._handleReference(),e.leaderLineWeight=this._objectReader.readBitLong(),e.enableLanding=this._objectReader.readBit(),e.enableDogleg=this._objectReader.readBit(),e.landingDistance=this._objectReader.readBitDouble(),t.arrowheadHandle=this._handleReference(),e.arrowheadSize=this._objectReader.readBitDouble(),e.contentType=this._objectReader.readBitShort(),t.mTextStyleHandle=this._handleReference(),e.textLeftAttachment=this._objectReader.readBitShort(),e.textRightAttachment=this._objectReader.readBitShort(),e.textAngle=this._objectReader.readBitShort(),e.textAlignment=this._objectReader.readBitShort(),e.textColor=this._mergedReaders.readCmColor(),e.textFrame=this._objectReader.readBit(),t.blockContentHandle=this._handleReference(),e.blockContentColor=this._mergedReaders.readCmColor(),e.blockContentScale=this._objectReader.read3BitDouble(),e.blockContentRotation=this._objectReader.readBitDouble(),e.blockContentConnection=this._objectReader.readBitShort(),e.enableAnnotationScale=this._objectReader.readBit(),this.r2007Pre){let s=this._objectReader.readBitLong();for(let a=0;a>>0,s=$s.getBytes32(i);e.ambientColor=new S(s[2],s[1],s[0])}if(e.diffuseColorMethod=this._mergedReaders.readByte(),e.diffuseColorFactor=this._mergedReaders.readBitDouble(),e.diffuseColorMethod===cr.Override){let i=this._mergedReaders.readBitLong()>>>0,s=$s.getBytes32(i);e.diffuseColor=new S(s[2],s[1],s[0])}if(e.diffuseMapBlendFactor=this._mergedReaders.readBitDouble(),e.diffuseProjectionMethod=this._mergedReaders.readByte(),e.diffuseTilingMethod=this._mergedReaders.readByte(),e.diffuseAutoTransform=this._mergedReaders.readByte(),e.diffuseMatrix=this._readMatrix4(),e.diffuseMapSource=this._mergedReaders.readByte(),e.diffuseMapFileName=this._readMaterialMapFileName(e.diffuseMapSource,"diffuse"),e.specularColorMethod=this._mergedReaders.readByte(),e.specularColorFactor=this._mergedReaders.readBitDouble(),e.specularColorMethod===cr.Override){let i=this._mergedReaders.readBitLong()>>>0,s=$s.getBytes32(i);e.specularColor=new S(s[2],s[1],s[0])}return e.specularMapBlendFactor=this._mergedReaders.readBitDouble(),e.specularProjectionMethod=this._mergedReaders.readByte(),e.specularTilingMethod=this._mergedReaders.readByte(),e.specularAutoTransform=this._mergedReaders.readByte(),e.specularMatrix=this._readMatrix4(),e.specularMapSource=this._mergedReaders.readByte(),e.specularMapFileName=this._readMaterialMapFileName(e.specularMapSource,"specular"),e.specularGlossFactor=this._objectReader.readBitDouble(),e.reflectionMapBlendFactor=this._mergedReaders.readBitDouble(),e.reflectionProjectionMethod=this._mergedReaders.readByte(),e.reflectionTilingMethod=this._mergedReaders.readByte(),e.reflectionAutoTransform=this._mergedReaders.readByte(),e.reflectionMatrix=this._readMatrix4(),e.reflectionMapSource=this._mergedReaders.readByte(),e.reflectionMapFileName=this._readMaterialMapFileName(e.reflectionMapSource,"reflection"),e.opacity=this._mergedReaders.readBitDouble(),e.opacityMapBlendFactor=this._mergedReaders.readBitDouble(),e.opacityProjectionMethod=this._mergedReaders.readByte(),e.opacityTilingMethod=this._mergedReaders.readByte(),e.opacityAutoTransform=this._mergedReaders.readByte(),e.opacityMatrix=this._readMatrix4(),e.opacityMapSource=this._mergedReaders.readByte(),e.opacityMapFileName=this._readMaterialMapFileName(e.opacityMapSource,"opacity"),e.bumpMapBlendFactor=this._mergedReaders.readBitDouble(),e.bumpProjectionMethod=this._mergedReaders.readByte(),e.bumpTilingMethod=this._mergedReaders.readByte(),e.bumpAutoTransform=this._mergedReaders.readByte(),e.bumpMatrix=this._readMatrix4(),e.bumpMapSource=this._mergedReaders.readByte(),e.bumpMapFileName=this._readMaterialMapFileName(e.bumpMapSource,"bump"),e.refractionIndex=this._mergedReaders.readBitDouble(),e.refractionMapBlendFactor=this._mergedReaders.readBitDouble(),e.refractionProjectionMethod=this._mergedReaders.readByte(),e.refractionTilingMethod=this._mergedReaders.readByte(),e.refractionAutoTransform=this._mergedReaders.readByte(),e.refractionMatrix=this._readMatrix4(),e.refractionMapSource=this._mergedReaders.readByte(),e.refractionMapFileName=this._readMaterialMapFileName(e.refractionMapSource,"refraction"),t}_readMaterialMapFileName(e,t){switch(e){case et.UseCurrentScene:return"";case et.UseImageFile:return this._mergedReaders.readVariableText();case et.Procedural:return this._builder.notify(`DWG material ${t} map uses an unsupported procedural source; preserving the source flag without procedural payload details.`,y.Warning),"";default:return this._builder.notify(`DWG material ${t} map uses an unknown source value ${e}; leaving the map filename empty.`,y.Warning),""}}_readMLine(){let e=new Gr,t=new pn(e);this._readCommonEntityData(t),e.scaleFactor=this._objectReader.readBitDouble(),e.justification=this._objectReader.readByte(),e.startPoint=this._objectReader.read3BitDouble(),e.normal=this._objectReader.read3BitDouble(),e.flags|=this._objectReader.readBitShort()===3?qi.Closed:qi.Has;let i=this._objectReader.readByte(),s=this._objectReader.readBitShort();for(let a=0;a0&&(e.flags|=Te.DisplayJoints),(i&2)>0&&(e.flags|=Te.FillOn),(i&16)>0&&(e.flags|=Te.StartSquareCap),(i&32)>0&&(e.flags|=Te.StartRoundCap),(i&64)>0&&(e.flags|=Te.StartInnerArcsCap),(i&256)>0&&(e.flags|=Te.EndSquareCap),(i&512)>0&&(e.flags|=Te.EndRoundCap),(i&1024)>0&&(e.flags|=Te.EndInnerArcsCap),e.fillColor=this._mergedReaders.readCmColor(),e.startAngle=this._objectReader.readBitDouble(),e.endAngle=this._objectReader.readBitDouble();let s=this._objectReader.readByte();for(let a=0;a=u.AC1012&&this._version<=u.AC1015&&(e.plotViewName=this._textReader.readVariableText()),e.numeratorScale=this._objectReader.readBitDouble(),e.denominatorScale=this._objectReader.readBitDouble(),e.styleSheet=this._textReader.readVariableText(),e.scaledFit=this._objectReader.readBitShort(),e.standardScale=this._objectReader.readBitDouble(),e.paperImageOrigin=this._objectReader.read2BitDouble(),this.r2004Plus){e.shadePlotMode=this._objectReader.readBitShort(),e.shadePlotResolutionMode=this._objectReader.readBitShort(),e.shadePlotDPI=this._objectReader.readBitShort();let i=this._handleReference()}this.r2007Plus&&this._handleReference()}_readEvaluationGraph(){let e=new Vt,t=new ds(e);this._readCommonNonEntityData(t),e.value96=this._objectReader.readBitLong(),e.value97=this._objectReader.readBitLong();let i=this._objectReader.readBitLong();for(let a=0;a0){let n=Math.floor(a/8);n>0&&(e.rawData=this._mergedReaders.readBytes(n))}}catch(i){let s=i instanceof Error?i.message:String(i);this._builder.notify(`Error reading AEC_CLEANUP_GROUP [Handle: ${e.handle.toString(16)}]: ${s}`,y.Error,i instanceof Error?i:null)}return t}_readAecWall(){let e=new Ma,t=new hc(e);this._readCommonEntityData(t),this.r2000Plus&&(e.version=this._mergedReaders.readBitLong()),t.binRecordHandle=this._handleReference(),t.styleHandle=this._handleReference(),t.cleanupGroupHandle=this._handleReference();let i=this._objectReader.positionInBits(),a=this._handlesReader.positionInBits()-i;if(a>0){let n=Math.floor(a/8);a%8!==0&&n++;let o=this._objectReader.readBytes(n);t.rawData=o}return t}_readAecWallStyle(){let e=new na,t=new ee(e);this._readCommonNonEntityData(t),this.r2000Plus&&(e.version=this._mergedReaders.readBitLong()),e.description=this._mergedReaders.readVariableText();let i=this._mergedReaders.positionInBits(),a=this._objectInitialPos+this._size*8-i;if(a>0){let n=Math.floor(a/8);n>0&&(e.rawData=this._mergedReaders.readBytes(n))}return t}_readBinRecord(){let e=new oa,t=new ee(e);this._readCommonNonEntityData(t),this.r2000Plus&&(e.version=this._mergedReaders.readBitLong());let i=this._mergedReaders.positionInBits();this._builder.notify(`BinRecord: Handle reader at position ${i}, BinRecord Handle: ${e.handle.toString(16)}`,y.None);let a=this._objectInitialPos+this._size*8-i;if(a>0){let n=Math.floor(a/8);n>0&&(e.binaryData=this._mergedReaders.readBytes(n),this._builder.notify(`BinRecord: Read ${n} bytes of binary data. Version: ${e.version}, Handle: ${e.handle.toString(16)}`,y.None))}return t}_readTableEntity(){let e=new es,t=new kn(e);if(this._readInsertCommonData(t),this._readInsertCommonHandles(t),this.r2010Plus){this._mergedReaders.readByte(),t.nullHandle=this._handleReference();let a=this._mergedReaders.readBitLong();return this.r2013Plus?this._mergedReaders.readBitLong():this._mergedReaders.readBit(),this._readTableContent(e.content,t),t}e.valueFlag=this._mergedReaders.readBitShort(),e.horizontalDirection=this._mergedReaders.read3BitDouble();let i=this._mergedReaders.readBitLong(),s=this._mergedReaders.readBitLong();for(let a=0;a0){t.segmentIndex=this._objectReader.readBitLong();let a=this._objectReader.readBitLong();for(let n=0;n0){let s=Ne.transformValue(i);this._readEvaluationExpressionValue(s,i)}e.cadObject.id=this._objectReader.readBitLong()}_readEvaluationExpressionValue(e,t){switch(e){case f.String:case f.ExtendedDataString:case f.Comment:this._mergedReaders.readVariableText();break;case f.Point3D:this._mergedReaders.read3BitDouble();break;case f.Double:case f.ExtendedDataDouble:this._mergedReaders.readBitDouble();break;case f.Byte:this._mergedReaders.readByte();break;case f.Int16:case f.ExtendedDataInt16:this._mergedReaders.readBitShort();break;case f.Int32:case f.ExtendedDataInt32:this._mergedReaders.readBitLong();break;case f.Int64:this._mergedReaders.readBitLongLong();break;case f.Handle:case f.ObjectId:case f.ExtendedDataHandle:this._handleReference();break;case f.Bool:this._mergedReaders.readBit();break;case f.Chunk:case f.ExtendedDataChunk:this._mergedReaders.readBytes(this._mergedReaders.readBitLong());break;case f.None:default:this._builder.notify(`[EvaluationExpression] Unsupported group code ${t} (${e}); leaving the value payload unread.`,y.Warning);break}}_readRowCellStyle(e,t){let i=new It(t);e.cellStyleTemplates.push(i),i.textStyleHandle=this._handleReference(),t.textHeight=this._mergedReaders.readBitDouble(),t.cellAlignment=this._mergedReaders.readBitShort(),t.textColor=this._mergedReaders.readCmColor(this.r2004Pre),t.backgroundColor=this._mergedReaders.readCmColor(this.r2004Pre),t.isFillColorOn=this._mergedReaders.readBit(),this._readBorderStyle(t.topBorder),this._readBorderStyle(t.horizontalInsideBorder),this._readBorderStyle(t.bottomBorder),this._readBorderStyle(t.leftBorder),this._readBorderStyle(t.verticalInsideBorder),this._readBorderStyle(t.rightBorder),this.r2007Plus&&(t.valueDataType=this._mergedReaders.readBitLong(),t.valueUnitType=this._mergedReaders.readBitLong(),t.valueFormatString=this._mergedReaders.readVariableText())}_readCellStyle(e){let t=e.format;if(t.cellStyleType=this._mergedReaders.readBitLong(),t.hasData=this._mergedReaders.readBitShortAsBool(),!t.hasData)return;t.propertyOverrideFlags=this._mergedReaders.readBitLong(),t.tableCellStylePropertyFlags=this._mergedReaders.readBitLong(),t.backgroundColor=this._mergedReaders.readCmColor(this.r2004Pre),t.contentLayoutFlags=this._mergedReaders.readBitLong(),this._readCellContentFormat(e,t),t.marginOverrideFlags=this._mergedReaders.readBitShort(),(t.marginOverrideFlags&Ya.Override)!==0&&(t.verticalMargin=this._mergedReaders.readBitDouble(),t.horizontalMargin=this._mergedReaders.readBitDouble(),t.bottomMargin=this._mergedReaders.readBitDouble(),t.rightMargin=this._mergedReaders.readBitDouble(),t.marginHorizontalSpacing=this._mergedReaders.readBitDouble(),t.marginVerticalSpacing=this._mergedReaders.readBitDouble());let i=this._mergedReaders.readBitLong();for(let s=0;sthis._readUnicodeString():this._readStringMethod=()=>this._reader.readTextUnicode()}read(){let e=new wi;try{e.title=this._readStringMethod(),e.subject=this._readStringMethod(),e.author=this._readStringMethod(),e.keywords=this._readStringMethod(),e.comments=this._readStringMethod(),e.lastSavedBy=this._readStringMethod(),e.revisionNumber=this._readStringMethod(),e.hyperlinkBase=this._readStringMethod(),this._reader.readInt(),this._reader.readInt(),e.createdDate=this._reader.read8BitJulianDate(),e.modifiedDate=this._reader.read8BitJulianDate();let t=this._reader.readShort();for(let i=0;i=e.length)return;let o=e[s++];if((o&240)===0){let l=r._literalCount(o,e,{pos:s});s=r._lastSrcPos;let p=r._copy(l+3,e,s,i,a,n);s=p.srcPos,a=p.dstPos,n=p.tempBuf,o=p.nextByte}for(;o!==17;){if(s>=e.length)throw new Error(`LZ77AC18: read past end of source at srcPos=${s}, src.length=${e.length}`);let l=0,p=0;if(o<16||o>=64){p=(o>>4)-1;let $=e[s++];l=(o>>2&3|$<<2)+1}else if(o<32){let $=r._readCompressedBytes(o,7,e,{pos:s});p=$.value,s=$.srcPos,l=(o&8)<<11;let X=r._twoByteOffset(l,16384,e,s);l=X.offset,o=X.firstByte,s=X.srcPos}else if(o>=32){let $=r._readCompressedBytes(o,31,e,{pos:s});p=$.value,s=$.srcPos;let X=r._twoByteOffset(l,1,e,s);l=X.offset,o=X.firstByte,s=X.srcPos}let b=a;n.length0;){let $=Math.min(k,l);for(let X=0;X<$;X++)i[P+X]=n[X];P+=$,k-=l}a=b+p;let he=o&3;if(he===0&&(o=e[s++],(o&240)===0)){let $=r._literalCount(o,e,{pos:s});s=r._lastSrcPos,he=$+3}if(he>0){let $=r._copy(he,e,s,i,a,n);s=$.srcPos,a=$.dstPos,n=$.tempBuf,o=$.nextByte}}}static _lastSrcPos=0;static _copy(e,t,i,s,a,n){n.length>2,e|=i[s++]<<6,e+=t,{offset:e,firstByte:a,srcPos:s}}};var ho=class r{static _m_sourceOffset=0;static _m_length=0;static _m_sourceIndex=0;static _m_opCode=0;static decompress(e,t,i,s){r._m_sourceOffset=0,r._m_length=0,r._m_sourceIndex=t,r._m_opCode=e[r._m_sourceIndex];let a=0,n=r._m_sourceIndex+i;if(++r._m_sourceIndex,!(r._m_sourceIndex>=n))for((r._m_opCode&240)===32&&(r._m_sourceIndex+=3,r._m_length=e[r._m_sourceIndex-1],r._m_length&=7);r._m_sourceIndex=n));)a=r._copyDecompressedChunks(e,n,s,a)}static _nextIndex(e,t,i){return r._m_length===0&&r._readLiteralLength(e),r._copyRaw(e,r._m_sourceIndex,t,i,r._m_length),r._m_sourceIndex+=r._m_length,i+=r._m_length,i}static _copyDecompressedChunks(e,t,i,s){for(r._m_length=0,r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._readInstructions(e);r._copyBytes(i,s,r._m_length,r._m_sourceOffset),s+=r._m_length,r._m_length=r._m_opCode&7,!(r._m_length!==0||r._m_sourceIndex>=t||(r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_opCode>>4===0));)r._m_opCode>>4===15&&(r._m_opCode&=15),r._readInstructions(e);return s}static _readInstructions(e){switch(r._m_opCode>>4){case 0:r._m_length=(r._m_opCode&15)+19,r._m_sourceOffset=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_length=(r._m_opCode>>3&16)+r._m_length,r._m_sourceOffset=((r._m_opCode&120)<<5)+1+r._m_sourceOffset;break;case 1:r._m_length=(r._m_opCode&15)+3,r._m_sourceOffset=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_sourceOffset=((r._m_opCode&248)<<5)+1+r._m_sourceOffset;break;case 2:r._m_sourceOffset=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_sourceOffset=e[r._m_sourceIndex]<<8&65280|r._m_sourceOffset,++r._m_sourceIndex,r._m_length=r._m_opCode&7,(r._m_opCode&8)===0?(r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_length=(r._m_opCode&248)+r._m_length):(++r._m_sourceOffset,r._m_length=(e[r._m_sourceIndex]<<3)+r._m_length,++r._m_sourceIndex,r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_length=((r._m_opCode&248)<<8)+r._m_length+256);break;default:r._m_length=r._m_opCode>>4,r._m_sourceOffset=r._m_opCode&15,r._m_opCode=e[r._m_sourceIndex],++r._m_sourceIndex,r._m_sourceOffset=((r._m_opCode&248)<<1)+r._m_sourceOffset+1;break}}static _readLiteralLength(e){if(r._m_length=r._m_opCode+8,r._m_length===23){let t=e[r._m_sourceIndex];if(++r._m_sourceIndex,r._m_length+=t,t===255)do t=e[r._m_sourceIndex],++r._m_sourceIndex,t|=e[r._m_sourceIndex]<<8,++r._m_sourceIndex,r._m_length+=t;while(t===65535)}}static _copyBytes(e,t,i,s){let a=t-s,n=a+i;for(;a=32;a-=32)r._copy4b(e,t+24,i,s),r._copy4b(e,t+28,i,s+4),r._copy4b(e,t+16,i,s+8),r._copy4b(e,t+20,i,s+12),r._copy4b(e,t+8,i,s+16),r._copy4b(e,t+12,i,s+20),r._copy4b(e,t,i,s+24),r._copy4b(e,t+4,i,s+28),t+=32,s+=32;a<=0||r._m_copyMethods[a](e,t,i,s)}static _copy1b(e,t,i,s){i[s]=e[t]}static _copy2b(e,t,i,s){i[s]=e[t+1],i[s+1]=e[t]}static _copy3b(e,t,i,s){i[s]=e[t+2],i[s+1]=e[t+1],i[s+2]=e[t]}static _copy4b(e,t,i,s){i[s]=e[t],i[s+1]=e[t+1],i[s+2]=e[t+2],i[s+3]=e[t+3]}static _copy8b(e,t,i,s){r._copy4b(e,t,i,s),r._copy4b(e,t+4,i,s+4)}static _copy16b(e,t,i,s){r._copy8b(e,t+8,i,s),r._copy8b(e,t,i,s+8)}static _m_copyMethods=[null,(e,t,i,s)=>{r._copy1b(e,t,i,s)},(e,t,i,s)=>{r._copy2b(e,t,i,s)},(e,t,i,s)=>{r._copy3b(e,t,i,s)},(e,t,i,s)=>{r._copy4b(e,t,i,s)},(e,t,i,s)=>{r._copy1b(e,t+4,i,s),r._copy4b(e,t,i,s+1)},(e,t,i,s)=>{r._copy1b(e,t+5,i,s),r._copy4b(e,t+1,i,s+1),r._copy1b(e,t,i,s+5)},(e,t,i,s)=>{r._copy2b(e,t+5,i,s),r._copy4b(e,t+1,i,s+2),r._copy1b(e,t,i,s+6)},(e,t,i,s)=>{r._copy8b(e,t,i,s)},(e,t,i,s)=>{r._copy1b(e,t+8,i,s),r._copy8b(e,t,i,s+1)},(e,t,i,s)=>{r._copy1b(e,t+9,i,s),r._copy8b(e,t+1,i,s+1),r._copy1b(e,t,i,s+9)},(e,t,i,s)=>{r._copy2b(e,t+9,i,s),r._copy8b(e,t+1,i,s+2),r._copy1b(e,t,i,s+10)},(e,t,i,s)=>{r._copy4b(e,t+8,i,s),r._copy8b(e,t,i,s+4)},(e,t,i,s)=>{r._copy1b(e,t+12,i,s),r._copy4b(e,t+8,i,s+1),r._copy8b(e,t,i,s+5)},(e,t,i,s)=>{r._copy1b(e,t+13,i,s),r._copy4b(e,t+9,i,s+1),r._copy8b(e,t+1,i,s+5),r._copy1b(e,t,i,s+13)},(e,t,i,s)=>{r._copy2b(e,t+13,i,s),r._copy4b(e,t+9,i,s+2),r._copy8b(e,t+1,i,s+6),r._copy1b(e,t,i,s+14)},(e,t,i,s)=>{r._copy16b(e,t,i,s)},(e,t,i,s)=>{r._copy8b(e,t+9,i,s),r._copy1b(e,t+8,i,s+8),r._copy8b(e,t,i,s+9)},(e,t,i,s)=>{r._copy1b(e,t+17,i,s),r._copy16b(e,t+1,i,s+1),r._copy1b(e,t,i,s+17)},(e,t,i,s)=>{r._copy3b(e,t+16,i,s),r._copy16b(e,t,i,s+3)},(e,t,i,s)=>{r._copy4b(e,t+16,i,s),r._copy8b(e,t+8,i,s+4),r._copy8b(e,t,i,s+12)},(e,t,i,s)=>{r._copy1b(e,t+20,i,s),r._copy4b(e,t+16,i,s+1),r._copy8b(e,t+8,i,s+5),r._copy8b(e,t,i,s+13)},(e,t,i,s)=>{r._copy2b(e,t+20,i,s),r._copy4b(e,t+16,i,s+2),r._copy8b(e,t+8,i,s+6),r._copy8b(e,t,i,s+14)},(e,t,i,s)=>{r._copy3b(e,t+20,i,s),r._copy4b(e,t+16,i,s+3),r._copy8b(e,t+8,i,s+7),r._copy8b(e,t,i,s+15)},(e,t,i,s)=>{r._copy8b(e,t+16,i,s),r._copy16b(e,t,i,s+8)},(e,t,i,s)=>{r._copy8b(e,t+17,i,s),r._copy1b(e,t+16,i,s+8),r._copy16b(e,t,i,s+9)},(e,t,i,s)=>{r._copy1b(e,t+25,i,s),r._copy8b(e,t+17,i,s+1),r._copy1b(e,t+16,i,s+9),r._copy16b(e,t,i,s+10)},(e,t,i,s)=>{r._copy2b(e,t+25,i,s),r._copy8b(e,t+17,i,s+2),r._copy1b(e,t+16,i,s+10),r._copy16b(e,t,i,s+11)},(e,t,i,s)=>{r._copy4b(e,t+24,i,s),r._copy8b(e,t+16,i,s+4),r._copy8b(e,t+8,i,s+12),r._copy8b(e,t,i,s+20)},(e,t,i,s)=>{r._copy1b(e,t+28,i,s),r._copy4b(e,t+24,i,s+1),r._copy8b(e,t+16,i,s+5),r._copy8b(e,t+8,i,s+13),r._copy8b(e,t,i,s+21)},(e,t,i,s)=>{r._copy2b(e,t+28,i,s),r._copy4b(e,t+24,i,s+2),r._copy8b(e,t+16,i,s+6),r._copy8b(e,t+8,i,s+14),r._copy8b(e,t,i,s+22)},(e,t,i,s)=>{r._copy1b(e,t+30,i,s),r._copy4b(e,t+26,i,s+1),r._copy8b(e,t+18,i,s+5),r._copy8b(e,t+10,i,s+13),r._copy8b(e,t+2,i,s+21),r._copy2b(e,t,i,s+29)}]};var dh=class r extends Ka{_builder;_fileHeader;constructor(e,t=null){super(e,t)}createDefaultConfiguration(){return new qo}static readFromStream(e,t=null){return r.readFromStreamWithConfig(e,new qo,t)}static readFromStreamWithConfig(e,t,i=null){let s=new r(e,i);s.configuration=t;let a=s.read();return s.dispose(),a}read(){return this._document=new Is(void 0,!1),this._fileHeader=this.readFileHeader(),this._builder=new en(this._fileHeader.acadVersion,this._document,this.configuration),this._builder.onNotification=(e,t)=>this.onNotificationEvent(e,t),this._document.summaryInfo=this.readSummaryInfo(),this._document.header=this.readHeader(),this._document.header.document=this._document,this._document.classes=this._readClasses(),this._readObjects(),this._builder.buildDocument(),this._document}readSummaryInfo(){if(this._fileHeader=this._fileHeader??this.readFileHeader(),this._fileHeader.acadVersionthis.onNotificationEvent(a,n);let s=i.read(this._fileHeader.acadMaintenanceVersion);return this._builder&&(this._builder.headerHandles=s.objectPointers),e}readFileHeader(){let e=new Uint8Array(this._fileStream),t=String.fromCharCode(...e.slice(0,6)),i=q.getVersionFromName(t),s=rs.createFileHeader(i),a=Be.getStreamHandler(s.acadVersion,e);switch(a.position=6,s.acadVersion){case u.Unknown:throw new Ze;case u.MC0_0:case u.AC1_2:case u.AC1_4:case u.AC1_50:case u.AC2_10:case u.AC1002:case u.AC1003:case u.AC1004:case u.AC1006:case u.AC1009:throw new Ze(s.acadVersion);case u.AC1012:case u.AC1014:case u.AC1015:this._readFileHeaderAC15(s,a);break;case u.AC1018:this._readFileHeaderAC18(s,a);break;case u.AC1021:try{this._readFileHeaderAC21(s,a)}catch{a.position=6,this._readFileHeaderAC18(s,a)}break;case u.AC1024:case u.AC1027:case u.AC1032:this._readFileHeaderAC18(s,a);break;default:break}return s}_readClasses(){this._fileHeader=this._fileHeader??this.readFileHeader();let e=this._getSectionStream(R.classes),t=new ec(this._fileHeader.acadVersion,e,this._fileHeader);return t.onNotification=(i,s)=>this.onNotificationEvent(i,s),t.read()}_readHandles(){this._fileHeader=this._fileHeader??this.readFileHeader();let e=this._getSectionStream(R.handles),t=new tc(this._fileHeader.acadVersion,e);return t.onNotification=(i,s)=>this.onNotificationEvent(i,s),t.read()}_readObjFreeSpace(){if(this._fileHeader=this._fileHeader??this.readFileHeader(),this._fileHeader.acadVersiona!=null).map(a=>a);new xc(this._fileHeader.acadVersion,this._builder,t,i,e,this._document.classes).read()}_getSectionStream(e){let t=null;switch(this._fileHeader.acadVersion){case u.Unknown:throw new Ze;case u.MC0_0:case u.AC1_2:case u.AC1_4:case u.AC1_50:case u.AC2_10:case u.AC1002:case u.AC1003:case u.AC1004:case u.AC1006:case u.AC1009:throw new Ze(this._fileHeader.acadVersion);case u.AC1012:case u.AC1014:case u.AC1015:t=this._getSectionBuffer15(this._fileHeader,e);break;case u.AC1018:t=this._getSectionBuffer18(this._fileHeader,e);break;case u.AC1021:this._fileHeader.compressedMetadata?t=this._getSectionBuffer21(this._fileHeader,e):t=this._getSectionBuffer18(this._fileHeader,e);break;case u.AC1024:case u.AC1027:case u.AC1032:t=this._getSectionBuffer18(this._fileHeader,e);break;default:break}if(!t)return null;let i=Be.getStreamHandler(this._fileHeader.acadVersion,t);return i.encoding=this._encoding,i}_readFileHeaderAC15(e,t){t.readBytes(7),e.previewAddress=t.readInt(),t.readBytes(2),e.drawingCodePage=q.getCodePage(t.readShort()),this._encoding=this.getListedEncoding(e.drawingCodePage);let i=t.readRawLong();for(let a=0;a{let me=new Uint8Array(4);return s.read(me,0,4),new DataView(me.buffer).getInt32(0,!0)},l=()=>{let me=new Uint8Array(4);return s.read(me,0,4),new DataView(me.buffer).getUint32(0,!0)},p=()=>{let me=new Uint8Array(8);s.read(me,0,8);let be=new DataView(me.buffer),ha=be.getUint32(0,!0);return be.getUint32(4,!0)*4294967296+ha};o(),o(),o(),e.rootTreeNodeGap=o(),e.leftGap=o(),e.rigthGap=o(),o(),e.lastPageId=o(),e.lastSectionAddr=p(),e.secondHeaderAddr=p(),e.gapAmount=l(),e.sectionAmount=l(),o(),o(),o(),e.sectionPageMapId=l(),e.pageMapAddress=p()+256,e.sectionMapId=l(),e.sectionArrayPageSize=l(),e.gapArraySize=l(),e.crcSeed=l(),t.position=e.pageMapAddress;let b=t.readRawLong(),x=t.readRawLong(),j=t.readRawLong(),k=t.readRawLong(),P=t.readRawLong(),he=co.decompress(t.stream,t.position,x),$=256,X=0,ir=new DataView(he.buffer,he.byteOffset,he.byteLength);for(;X=0?(me.seeker=$,e.records.set(me.number,me)):X+=16,$+=me.size}t.position=e.records.get(e.sectionMapId).seeker;let di=t.readRawLong(),Ce=t.readRawLong(),Oi=t.readRawLong(),yr=t.readRawLong(),nd=t.readRawLong(),_e=co.decompress(t.stream,t.position,Ce),je=0,wl=new DataView(_e.buffer,_e.byteOffset,_e.byteLength),Je=()=>{let me=wl.getInt32(je,!0);return je+=4,me},it=()=>{let me=wl.getUint32(je,!0),be=wl.getUint32(je+4,!0);return je+=8,be*4294967296+me},od=me=>{let be="";for(let ha=0;ha0&&be.localSections.length>0&&(be.localSections[be.localSections.length-1].decompressedSize=ha),e.descriptors.set(be.name,be)}}_readFileHeaderAC21(e,t){this._readFileMetaData(e,t);let i=t.readBytes(1024),s=new Uint8Array(717);this._reedSolomonDecoding(i,s,3,239);let a=new DataView(s.buffer),n=this._readInt64(a,0),o=this._readInt64(a,8),l=this._readInt64(a,16),p=a.getInt32(24,!0),b=a.getInt32(28,!0),x=new Uint8Array(272);p<0?x.set(s.subarray(32,32+Math.abs(p))):ho.decompress(s,32,p,x);let j=new DataView(x.buffer),k=0,P=()=>{let _e=j.getUint32(k,!0),je=j.getUint32(k+4,!0);return k+=8,je*4294967296+_e};e.compressedMetadata=new Jl,e.compressedMetadata.headerSize=P(),e.compressedMetadata.fileSize=P(),e.compressedMetadata.pagesMapCrcCompressed=P(),e.compressedMetadata.pagesMapCorrectionFactor=P(),e.compressedMetadata.pagesMapCrcSeed=P(),e.compressedMetadata.map2Offset=P(),e.compressedMetadata.map2Id=P(),e.compressedMetadata.pagesMapOffset=P(),e.compressedMetadata.pagesMapId=P(),e.compressedMetadata.header2offset=P(),e.compressedMetadata.pagesMapSizeCompressed=P(),e.compressedMetadata.pagesMapSizeUncompressed=P(),e.compressedMetadata.pagesAmount=P(),e.compressedMetadata.pagesMaxId=P(),e.compressedMetadata.unknow0x20=P(),e.compressedMetadata.unknow0x40=P(),e.compressedMetadata.pagesMapCrcUncompressed=P(),e.compressedMetadata.unknown0xF800=P(),e.compressedMetadata.unknown4=P(),e.compressedMetadata.unknown1=P(),e.compressedMetadata.sectionsAmount=P(),e.compressedMetadata.sectionsMapCrcUncompressed=P(),e.compressedMetadata.sectionsMapSizeCompressed=P(),e.compressedMetadata.sectionsMap2Id=P(),e.compressedMetadata.sectionsMapId=P(),e.compressedMetadata.sectionsMapSizeUncompressed=P(),e.compressedMetadata.sectionsMapCrcCompressed=P(),e.compressedMetadata.sectionsMapCorrectionFactor=P(),e.compressedMetadata.sectionsMapCrcSeed=P(),e.compressedMetadata.streamVersion=P(),e.compressedMetadata.crcSeed=P(),e.compressedMetadata.crcSeedEncoded=P(),e.compressedMetadata.randomSeed=P(),e.compressedMetadata.headerCRC64=P();let he=this._getPageBuffer(e.compressedMetadata.pagesMapOffset,e.compressedMetadata.pagesMapSizeCompressed,e.compressedMetadata.pagesMapSizeUncompressed,e.compressedMetadata.pagesMapCorrectionFactor,239,new Uint8Array(this._fileStream)),$=new DataView(he.buffer,he.byteOffset,he.byteLength),X=0,ir=0;for(;X{let _e=Ce.getUint32(Oi,!0),je=Ce.getUint32(Oi+4,!0);return Oi+=8,je*4294967296+_e},nd=()=>{let _e=Ce.getInt32(Oi,!0),je=Ce.getInt32(Oi+4,!0);return Oi+=8,je*4294967296+_e};for(;Oi0){let Je="";for(let it=0;it0&&e.descriptors.set(_e.name,_e)}}_getSectionBuffer15(e,t){let i=R.getSectionLocatorByName(t);if(i===null)return null;let s=e.records.get(i);return s?new Uint8Array(this._fileStream).subarray(s.seeker,s.seeker+s.size):null}_getSectionBuffer18(e,t){let i=e.descriptors.get(t);if(!i)return null;let s=i.decompressedSize*i.localSections.length,a=new Uint8Array(s),n=0,o=new Uint8Array(this._fileStream);for(let l of i.localSections)if(l.isEmpty)for(let p=0;p>>0,e.checksum=(t.readRawLong()^i|0)>>>0;let l=(t.readRawLong()^i|0)>>>0}_getSectionBuffer21(e,t){let i=e.descriptors.get(t);if(!i)return null;let s=0;for(let l of i.localSections)s+=l.decompressedSize;let a=new Uint8Array(s),n=0,o=new Uint8Array(this._fileStream);for(let l of i.localSections)if(l.isEmpty)for(let p=0;p>>this.bitShift)&255,this._lastByte=i<>>this.bitShift)&255,this._lastByte=o<0&&e<256?(this.write2Bits(1),this.writeByte(e)):e===256?this.write2Bits(3):(this.write2Bits(0),this.writeByte(e&255),this.writeByte(e>>>8&255))}writeBitDouble(e){if(e===0){this.write2Bits(2);return}if(e===1){this.write2Bits(1);return}this.write2Bits(0);let t=new Uint8Array(8);new DataView(t.buffer).setFloat64(0,e,!0),this.writeBytes(t)}writeBitLong(e){if(e===0){this.write2Bits(2);return}if(e>0&&e<256){this.write2Bits(1),this.writeByte(e);return}this.write2Bits(0),this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBitLongLong(e){let t=0,i=e<0?e+18446744073709552e3:e,s=i;for(;s!==0;)s=Math.floor(s/256),t++;this._write3Bits(t),s=i;for(let a=0;a>>1&255,this._ensureCapacity(1),this._buffer[this._position++]=this._lastByte&255,this._lastByte=e<<7&255,this.bitShift=1)}writeBit(e){if(this.bitShift<7){e&&(this._lastByte|=1<<7-this.bitShift&255),this.bitShift++;return}e&&(this._lastByte|=1),this._ensureCapacity(1),this._buffer[this._position++]=this._lastByte&255,this._resetShift()}writeByte(e){if(this.bitShift===0){this._ensureCapacity(1),this._buffer[this._position++]=e&255;return}let t=8-this.bitShift;this._ensureCapacity(1),this._buffer[this._position++]=(this._lastByte|e>>>this.bitShift)&255,this._lastByte=e<>>8&255),this.writeByte(t&255)):t<16777216?(this.writeByte(i|3),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255)):t<4294967296?(this.writeByte(i|4),this.writeByte(t>>>24&255),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255)):t<1099511627776?(this.writeByte(i|5),this.writeByte(Math.floor(t/4294967296)&255),this.writeByte(t>>>24&255),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255)):t<281474976710656?(this.writeByte(i|6),this.writeByte(Math.floor(t/1099511627776)&255),this.writeByte(Math.floor(t/4294967296)&255),this.writeByte(t>>>24&255),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255)):t<72057594037927940?(this.writeByte(i|7),this.writeByte(Math.floor(t/281474976710656)&255),this.writeByte(Math.floor(t/1099511627776)&255),this.writeByte(Math.floor(t/4294967296)&255),this.writeByte(t>>>24&255),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255)):(this.writeByte(i|8),this.writeByte(Math.floor(t/72057594037927940)&255),this.writeByte(Math.floor(t/281474976710656)&255),this.writeByte(Math.floor(t/1099511627776)&255),this.writeByte(Math.floor(t/4294967296)&255),this.writeByte(t>>>24&255),this.writeByte(t>>>16&255),this.writeByte(t>>>8&255),this.writeByte(t&255))}writeSpearShift(){if(this.bitShift>0)for(let e=this.bitShift;e<8;e++)this.writeBit(!1)}writeBitThickness(e){this.writeBitDouble(e)}writeBitExtrusion(e){this.write3BitDouble(e)}write2BitDoubleWithDefault(e,t){this.writeBitDoubleWithDefault(e.x,t.x),this.writeBitDoubleWithDefault(e.y,t.y)}write3BitDoubleWithDefault(e,t){this.writeBitDoubleWithDefault(e.x,t.x),this.writeBitDoubleWithDefault(e.y,t.y),this.writeBitDoubleWithDefault(e.z,t.z)}writeBitDoubleWithDefault(e,t){if(e===t){this.write2Bits(0);return}let i=new Uint8Array(8);new DataView(i.buffer).setFloat64(0,e,!0);let a=new Uint8Array(8);new DataView(a.buffer).setFloat64(0,t,!0);let o=0,l=7;for(;l>=0&&i[l]===a[l];)o++,l--;o>=4?(this.write2Bits(1),this.writeBytesOffset(i,0,4)):o>=2?(this.write2Bits(2),this.writeByte(i[4]),this.writeByte(i[5]),this.writeByte(i[0]),this.writeByte(i[1]),this.writeByte(i[2]),this.writeByte(i[3])):(this.write2Bits(3),this.writeBytes(i))}resetStream(){this._position=0,this.bitShift=0,this._lastByte=0}savePositonForSize(){this.writeRawLong(0)}setPositionByFlag(e){if(e>=32768){if(e>=1073741824){let i=new Uint8Array(2);new DataView(i.buffer).setUint16(0,e>>>30&65535,!0),this.writeBytes(i);let s=new Uint8Array(2);new DataView(s.buffer).setUint16(0,e>>>15&32767|32768,!0),this.writeBytes(s)}else{let i=new Uint8Array(2);new DataView(i.buffer).setUint16(0,e>>>15&65535,!0),this.writeBytes(i)}let t=new Uint8Array(2);new DataView(t.buffer).setUint16(0,e&32767|32768,!0),this.writeBytes(t)}else{let t=new Uint8Array(2);new DataView(t.buffer).setUint16(0,e&65535,!0),this.writeBytes(t)}}setPositionInBits(e){let t=Math.floor(e/8);if(this.bitShift=e%8,this._position=t,this.bitShift>0){if(t>=this._buffer.length)throw new Error("EndOfStreamException");this._lastByte=this._buffer[t]}else this._lastByte=0}writeShiftValue(){if(this.bitShift>0){let e=this._position;if(e>>this.bitShift)&255;this._buffer[e]=i}}}_write3Bits(e){this.writeBit((e&4)!==0),this.writeBit((e&2)!==0),this.writeBit((e&1)!==0)}_ensureCapacity(e){let t=this._position+e;if(t>this._buffer.length){let i=Math.max(t,this._buffer.length*2),s=new Uint8Array(i);s.set(this._buffer),this._buffer=s,this._view=new DataView(s.buffer,s.byteOffset,s.byteLength)}}};var Tc=class extends J{get sectionName(){return R.appInfo}get bytesWritten(){return Math.ceil(this._writer.positionInBits/8)}get writerStream(){return this._writer.main.stream}_writer;_emptyArr=new Uint8Array(16);constructor(e,t){super(e),this._writer=Le.getStreamWriter(e,t,"utf-16le")}write(){let e="3.4.29.0";this._writer.writeInt(3),this._writer.writeTextUnicode("AppInfoDataList"),this._writer.writeInt(3),this._writer.writeBytes(this._emptyArr),this._writer.writeTextUnicode(e),this._writer.writeBytes(this._emptyArr),this._writer.writeTextUnicode("This is a comment from ACadSharp"),this._writer.writeBytes(this._emptyArr),this._writer.writeTextUnicode(``)}};var Sc=class extends J{get sectionName(){return R.auxHeader}get bytesWritten(){return Math.ceil(this._writer.positionInBits/8)}get writerStream(){return this._writer.main.stream}_stream;_encoding;_header;_writer;constructor(e,t,i){super(i.version),this._stream=e,this._encoding=t,this._header=i,this._writer=Le.getStreamWriter(this._version,this._stream,t)}write(){this._writer.writeByte(255),this._writer.writeByte(119),this._writer.writeByte(1),this._writer.writeRawShort(this._version),this._writer.writeRawShort(this._header.maintenanceVersion),this._writer.writeRawLong(1),this._writer.writeRawLong(-1),this._writer.writeRawShort(1),this._writer.writeRawShort(0),this._writer.writeRawLong(0),this._writer.writeRawShort(this._version),this._writer.writeRawShort(this._header.maintenanceVersion),this._writer.writeRawShort(this._version),this._writer.writeRawShort(this._header.maintenanceVersion),this._writer.writeRawShort(5),this._writer.writeRawShort(2195),this._writer.writeRawShort(5),this._writer.writeRawShort(2195),this._writer.writeRawShort(0),this._writer.writeRawShort(1),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.write8BitJulianDate(this._header.createDateTime),this._writer.write8BitJulianDate(this._header.updateDateTime);let e=-1,t=this._header.handleSeed;t<=2147483647&&(e=t),this._writer.writeRawLong(e),this._writer.writeRawLong(0),this._writer.writeRawShort(0),this._writer.writeRawShort(1),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(1),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this._writer.writeRawLong(0),this.r2018Plus&&(this._writer.writeRawShort(0),this._writer.writeRawShort(0))}};var Bc=class extends J{get sectionName(){return R.classes}get bytesWritten(){return Math.ceil(this._startWriter.positionInBits/8)}get startWriterStream(){return this._startWriter.main.stream}_document;_sectionBuffer=[];_startWriter;_writer;_startSentinel=new Uint8Array([141,161,196,184,196,169,248,197,192,220,244,95,231,207,182,138]);_endSentinel=new Uint8Array([114,94,59,71,59,86,7,58,63,35,11,160,24,48,73,117]);constructor(e,t,i){super(t.header.version),this._document=t,this._startWriter=Le.getStreamWriter(this._version,e,i);let s=new Uint8Array(4096);this._writer=Le.getMergedWriter(this._version,s,i)}write(){this.r2007Plus&&this._writer.savePositonForSize();let e=0,t=[...this._document.classes];t.length>0&&(e=Math.max(...t.map(i=>i.classNumber))),this.r2004Plus&&(this.r2007Plus?(this._writer.writeBitLong(e),this._writer.writeBit(!0)):(this._writer.writeBitShort(e),this._writer.writeByte(0),this._writer.writeByte(0),this._writer.writeBit(!0)));for(let i of t)this._writer.writeBitShort(i.classNumber),this._writer.writeBitShort(i.proxyFlags),this._writer.writeVariableText(i.applicationName),this._writer.writeVariableText(i.cppClassName),this._writer.writeVariableText(i.dxfName),this._writer.writeBit(i.wasZombie),this._writer.writeBitShort(i.itemClassId),this.r2004Plus&&(this._writer.writeBitLong(i.instanceCount),this._writer.writeBitLong(i.dwgVersion),this._writer.writeBitLong(i.maintenanceVersion),this._writer.writeBitLong(0),this._writer.writeBitLong(0));this._writer.writeSpearShift(),this._writeSizeAndCrc()}_writeSizeAndCrc(){this._startWriter.writeBytes(this._startSentinel);let e=Math.ceil(this._writer.main.positionInBits/8),t=new Uint8Array(this._writer.main.stream).slice(0,e),i=t.length,s=new Uint8Array(4);new DataView(s.buffer).setInt32(0,i,!0);let n=[];for(let l=0;l<4;l++)n.push(s[l]);if(this._document.header.version>=u.AC1024&&this._document.header.maintenanceVersion>3||this._document.header.version>u.AC1027)for(let l=0;l<4;l++)n.push(0);for(let l=0;l=u.AC1024&&this._document.header.maintenanceVersion>3||this._document.header.version>u.AC1027)&&this._startWriter.writeRawLong(0),this._startWriter.writeBytes(t),this._startWriter.writeRawShort(o),this._startWriter.writeBytes(this._endSentinel),this.r2004Plus&&(this._startWriter.writeRawLong(0),this._startWriter.writeRawLong(0))}};var mo=class{fileHeader;get bytesWritten(){return this._streamPosition}_document;_encoding;_stream;_streamPosition=0;_version;constructor(e,t,i,s){this._document=i,this._stream=e,this._version=i.header.version,this._encoding=t,this.fileHeader=s}applyMagicSequence(e,t){for(let i=0;i>>0,!0),this._streamPosition+=4}writeInt32ToStream(e){new DataView(this._stream.buffer,this._stream.byteOffset+this._streamPosition,4).setInt32(0,e,!0),this._streamPosition+=4}writeUint16ToStream(e){new DataView(this._stream.buffer,this._stream.byteOffset+this._streamPosition,2).setUint16(0,e&65535,!0),this._streamPosition+=2}writeByteToStream(e){this._stream[this._streamPosition++]=e&255}};var Rc=class r extends mo{get fileHeaderSize(){return 97}get handleSectionOffset(){return this.fileHeaderSize+(this._records.get(R.auxHeader).stream?.length??0)+(this._records.get(R.preview).stream?.length??0)+(this._records.get(R.header).stream?.length??0)+(this._records.get(R.classes).stream?.length??0)}static _nRecords=6;_endSentinel=new Uint8Array([149,160,78,40,153,130,26,229,94,65,224,95,157,58,77,0]);_records=new Map;constructor(e,t,i){super(e,t,i,new is),this._records.set(R.auxHeader,new Ot(5)),this._records.set(R.preview,new Ot(null)),this._records.set(R.header,new Ot(0)),this._records.set(R.classes,new Ot(1)),this._records.set(R.acDbObjects,new Ot(null)),this._records.set(R.handles,new Ot(2)),this._records.set(R.objFreeSpace,new Ot(3)),this._records.set(R.template,new Ot(4))}addSection(e,t,i,s=29696){this._records.get(e).stream=t}writeFile(){this._setSeekers(),this._writeFileHeader(),this._writeRecordStreams()}_setSeekers(){let e=this.fileHeaderSize;for(let[,t]of this._records)t.seeker=e,e+=t.stream?.length??0}_writeFileHeader(){let e=[],t={pos:0,writeByte(l){e.push(l&255)},writeBytes(l,p=0,b){let x=b??l.length;for(let j=0;j>>8&255),e.push(l>>>16&255),e.push(l>>>24&255)},writeRawShort(l){e.push(l&255),e.push(l>>>8&255)}},i=new TextEncoder().encode(this._document.header.versionString);t.writeBytes(i,0,6),t.writeBytes(new Uint8Array([0,0,0,0,0,15,1])),t.writeRawLong(this._records.get(R.preview).seeker),t.writeByte(27),t.writeByte(25),t.writeRawShort(this.getFileCodePage()),t.writeRawLong(r._nRecords),this._writeRecord(t,this._records.get(R.header)),this._writeRecord(t,this._records.get(R.classes)),this._writeRecord(t,this._records.get(R.handles)),this._writeRecord(t,this._records.get(R.objFreeSpace)),this._writeRecord(t,this._records.get(R.template)),this._writeRecord(t,this._records.get(R.auxHeader)),(8-e.length*8%8)%8>0;let a=new Uint8Array(e),n=Jr.getCRCValue(49345,a,0,a.length);t.writeRawShort(n),t.writeBytes(this._endSentinel,0,this._endSentinel.length);let o=new Uint8Array(e);this.writeToStream(o)}_writeRecord(e,t){e.writeByte(t.number),e.writeRawLong(t.seeker),e.writeRawLong(t.stream?.length??0)}_writeRecordStreams(){for(let[,e]of this._records)e.stream!=null&&this.writeToStream(e.stream)}};var Nc=class{_source;_dest;_block=new Int32Array(32768);_initialOffset=0;_currPosition=0;_currOffset=0;_totalOffset=0;constructor(){}compress(e,t,i,s){this._restartBlock(),this._source=e,this._dest=s,this._initialOffset=t,this._totalOffset=this._initialOffset+i,this._currOffset=this._initialOffset,this._currPosition=this._initialOffset+4;let a=0,n=0,o={value:0},l={value:0};for(;this._currPosition255;)e-=255,this._dest.push(0);this._dest.push(e&255)}_writeOpCode(e,t,i){if(t<=0)throw new Error("Invalid compressionOffset");if(i<=0)throw new Error("Invalid value");t<=i?this._dest.push((e|t-2)&255):(this._dest.push(e&255),this._writeLen(t-i))}_writeLiteralLength(e){if(e<=0)return;e>3&&this._writeOpCode(0,e-1,17);let t=this._currOffset;for(let i=0;i=15||e>1024?(e<=16384?(e--,this._writeOpCode(32,t,33)):(e-=16384,this._writeOpCode(16|e>>>11&8,t,9)),s=(e&255)<<2,a=e>>>6):(e--,s=t+1<<4|(e&3)<<2,a=e>>>2),i<4&&(s|=i),this._dest.push(s&255),this._dest.push(a&255)}_compressChunk(e,t){e.value=0;let n=((this._source[this._currPosition+3]<<6^this._source[this._currPosition+2])<<5^this._source[this._currPosition+1])<<5^this._source[this._currPosition],o=n+(n>>>5)&32767,l=this._block[o];if(t.value=this._currPosition-l,l>=this._initialOffset&&t.value<=49151){if(t.value>1024&&this._source[this._currPosition+3]!==this._source[l+3]&&(o=o&2047^16415,l=this._block[o],t.value=this._currPosition-l,l49151||t.value>1024&&this._source[this._currPosition+3]!==this._source[l+3]))return this._block[o]=this._currPosition,!1;if(this._source[this._currPosition]===this._source[l]&&this._source[this._currPosition+1]===this._source[l+1]&&this._source[this._currPosition+2]===this._source[l+2]){e.value=3;let p=l+3,b=this._currPosition+3;for(;b=3}};var la=class extends mo{get fileHeaderSize(){return 256}get handleSectionOffset(){return 0}get compressor(){return new Nc}get _descriptors(){return this.fileHeader.descriptors}_localSectionsMaps=[];constructor(e,t,i){super(e,t,i,new Rs);for(let s=0;s0&&!this.checkEmptyBytes(t,o,l)&&this.createLocalSection(a,t,a.decompressedSize,o,l,i)}writeFile(){this.fileHeader.sectionArrayPageSize=this._localSectionsMaps.length+2,this.fileHeader.sectionPageMapId=this.fileHeader.sectionArrayPageSize,this.fileHeader.sectionMapId=this.fileHeader.sectionArrayPageSize-1,this._writeDescriptors(),this._writeRecords(),this.writeFileMetaData()}applyCompression(e,t,i,s,a){if(a){let n=new Uint8Array(t);for(let l=0;l0&&e.pageCount++,p.size=this._streamPosition-l,e.localSections.push(p),this._localSectionsMaps.push(p)}writeFileMetaData(){this.fileHeader.secondHeaderAddr=this._streamPosition;let e=this._buildFileHeader();this.writeToStream(e);let t=this._streamPosition;this._streamPosition=0;let i=new TextEncoder().encode(this._document.header.versionString);this.writeToStream(i,0,6),this.writeToStream(new Uint8Array(5)),this.writeByteToStream(this._document.header.maintenanceVersion),this.writeByteToStream(3);let s=this._descriptors.get(R.preview);this.writeUint32ToStream(s?.localSections?.[0]?s.localSections[0].seeker+32:0),this.writeByteToStream(33),this.writeByteToStream(this._document.header.maintenanceVersion),this.writeUint16ToStream(this.getFileCodePage()),this.writeToStream(new Uint8Array(3)),this.writeInt32ToStream(0),this.writeInt32ToStream(0);let a=this._descriptors.get(R.summaryInfo);this.writeUint32ToStream(a?.localSections?.[0]?a.localSections[0].seeker+32:0),this.writeUint32ToStream(0),this.writeUint32ToStream(128);let n=this._descriptors.get(R.appInfo);this.writeUint32ToStream(n?.localSections?.[0]?n.localSections[0].seeker+32:0),this.writeToStream(new Uint8Array(80)),this.writeToStream(e),this.writeToStream(Ct.magicSequence,236,20),this._streamPosition=t}_addSectionMap(e){e.pageNumber=this._localSectionsMaps.length+1,this._localSectionsMaps.push(e)}_compressChecksum(e,t){e.decompressedSize=t.length;let i=[];this.compressor.compress(t,0,t.length,i);let s=new Uint8Array(i);e.compressedSize=s.length;let a=this._buildPageHeaderData(e);e.checksum=Ct.calculate(0,a,0,a.length),e.checksum=Ct.calculate(e.checksum,s,0,s.length);let n=this._buildPageHeaderData(e);this.writeToStream(n),this.writeToStream(s)}_setSeeker(e,t){let i=new Ns;return i.sectionMap=e,this.writeMagicNumber(),i.seeker=this._streamPosition,this._compressChecksum(i,t),i}_buildDataSection(e,t,i){let s=new Uint8Array(32),a=new DataView(s.buffer);return a.setInt32(0,i,!0),a.setInt32(4,e.sectionId,!0),a.setInt32(8,t.compressedSize,!0),a.setInt32(12,t.pageSize,!0),a.setInt32(16,t.offset&4294967295,!0),a.setInt32(20,0,!0),a.setUint32(24,t.checksum>>>0,!0),a.setUint32(28,t.oda>>>0,!0),s}_writeDescriptors(){let e=[],t=l=>{e.push(l&255),e.push(l>>>8&255),e.push(l>>>16&255),e.push(l>>>24&255)},i=l=>{t(l),t(0)},s=(l,p=0,b)=>{let x=b??l.length;for(let j=0;j0&&(t(b.pageNumber),t(b.compressedSize),i(b.offset))}let a=new Uint8Array(e),n=this._setSeeker(1097007163,a),o=Ct.compressionCalculator(this._streamPosition-n.seeker);this.writeToStream(Ct.magicSequence,0,o),n.size=this._streamPosition-n.seeker,this._addSectionMap(n)}_buildFileHeader(){let e=new Uint8Array(108),t=0,i=o=>{e[t++]=o&255,e[t++]=o>>>8&255,e[t++]=o>>>16&255,e[t++]=o>>>24&255},s=o=>{i(o),i(0)},a=new TextEncoder().encode("AcFssFcAJMB");for(let o=0;o<11;o++)e[t++]=a[o];e[t++]=0,i(0),i(108),i(4),i(this.fileHeader.rootTreeNodeGap),i(this.fileHeader.leftGap),i(this.fileHeader.rigthGap),i(1),i(this.fileHeader.lastPageId),s(this.fileHeader.lastSectionAddr),s(this.fileHeader.secondHeaderAddr),i(this.fileHeader.gapAmount),i(this.fileHeader.sectionAmount),i(32),i(128),i(64),i(this.fileHeader.sectionPageMapId),s(this.fileHeader.pageMapAddress-256),i(this.fileHeader.sectionMapId),i(this.fileHeader.sectionArrayPageSize),i(this.fileHeader.gapArraySize),i(0);let n=4294967295;for(let o=0;o<108;o++)n=(n>>>8^Bs.crc32Table[(n^e[o])&255])>>>0;return n=~n>>>0,e[104]=n&255,e[105]=n>>>8&255,e[106]=n>>>16&255,e[107]=n>>>24&255,this.applyMagicSequence(e,e.length),e}_buildPageHeaderData(e){let t=new Uint8Array(20),i=new DataView(t.buffer);return i.setInt32(0,e.sectionMap,!0),i.setInt32(4,e.decompressedSize,!0),i.setInt32(8,e.compressedSize,!0),i.setInt32(12,e.compression,!0),i.setUint32(16,e.checksum>>>0,!0),t}_writeRecords(){this.writeMagicNumber();let e=new Ns;e.sectionMap=1097010747,this._addSectionMap(e);let t=this._localSectionsMaps.length*8;e.seeker=this._streamPosition;let i=t+Ct.compressionCalculator(t);e.size=i;let s=[];for(let o of this._localSectionsMaps)if(o!=null){s.push(o.pageNumber&255),s.push(o.pageNumber>>>8&255),s.push(o.pageNumber>>>16&255),s.push(o.pageNumber>>>24&255);let l=o.size;s.push(l&255),s.push(l>>>8&255),s.push(l>>>16&255),s.push(l>>>24&255)}let a=new Uint8Array(s);this._compressChecksum(e,a);let n=this._localSectionsMaps[this._localSectionsMaps.length-1];this.fileHeader.gapAmount=0,this.fileHeader.lastPageId=n.pageNumber,this.fileHeader.lastSectionAddr=n.seeker+i-256,this.fileHeader.sectionAmount=this._localSectionsMaps.length-1,this.fileHeader.pageMapAddress=e.seeker}};var Ac=class{compress(e,t,i,s){throw new Error("AC1021 DWG compression is not supported yet.")}};var mh=class extends la{get fileHeaderSize(){return 1152}get compressor(){return new Ac}constructor(e,t,i){super(e,t,i)}createLocalSection(e,t,i,s,a,n){let o=this.applyCompression(t,i,s,a,n);this.writeMagicNumber()}};var vc=class extends J{get sectionName(){return R.handles}_buffer=[];_handleMap;constructor(e,t){super(e),this._handleMap=new Map([...t.entries()].sort((i,s)=>i[0]-s[0]))}write(e=0){let t=new Uint8Array(10),i=new Uint8Array(5),s=0,a=0,n=this._buffer.length;this._buffer.push(0),this._buffer.push(0);for(let[o,l]of this._handleMap){let p=o-s,b=l+e,x=b-a,j=this._modularShortToValue(p,t),k=this._signedModularShortToValue(x,i);if(this._buffer.length-n+(j+k)>2032){if(this._processPosition(n),s=0,a=0,n=this._buffer.length,this._buffer.push(0),this._buffer.push(0),s=0,a=0,p=o-s,p===0)throw new Error("Handle offset is zero");x=b-a,j=this._modularShortToValue(p,t),k=this._signedModularShortToValue(x,i)}for(let P=0;P=128;)t[i]=(e&127|128)&255,i++,e=e>>>7;return t[i]=e&255,i+1}_signedModularShortToValue(e,t){let i=0;if(e<0){for(e=-e;e>=64;)t[i]=(e&127|128)&255,i++,e=e>>>7;return t[i]=(e|64)&255,i+1}for(;e>=64;)t[i]=(e&127|128)&255,i++,e=e>>>7;return t[i]=e&255,i+1}_processPosition(e){let t=this._buffer.length-e;this._buffer[e]=t>>>8&255,this._buffer[e+1]=t&255;let i=new Uint8Array(this._buffer),s=Jr.getCRCValue(49345,i,e,this._buffer.length-e);this._buffer.push(s>>>8&255),this._buffer.push(s&255)}};var Ec=class extends J{get sectionName(){return R.header}get bytesWritten(){return Math.ceil(this._startWriter.positionInBits/8)}get startWriterStream(){return this._startWriter.main.stream}_msmain;_startWriter;_writer;_document;_header;_encoding;constructor(e,t,i){super(t.header.version),this._document=t,this._header=t.header,this._encoding=i,this._startWriter=Le.getStreamWriter(this._version,e,this._encoding),this._msmain=new Uint8Array(8192),this._writer=Le.getStreamWriter(this._version,this._msmain,this._encoding)}write(){if(this.r2007Plus&&(this._writer=Le.getMergedWriter(this._version,this._msmain,this._encoding),this._writer.savePositonForSize()),this.r2013Plus&&this._writer.writeBitLongLong(0),this._writer.writeBitDouble(412148564080),this._writer.writeBitDouble(1),this._writer.writeBitDouble(1),this._writer.writeBitDouble(1),this._writer.writeVariableText("m"),this._writer.writeVariableText(""),this._writer.writeVariableText(""),this._writer.writeVariableText(""),this._writer.writeBitLong(24),this._writer.writeBitLong(0),this.r13_14Only&&this._writer.writeBitShort(0),this.r2004Pre&&this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeBit(this._header.associatedDimensions),this._writer.writeBit(this._header.updateDimensionsWhileDragging),this.r13_14Only&&this._writer.writeBit(this._header.dimsav!==0),this._writer.writeBit(this._header.polylineLineTypeGeneration),this._writer.writeBit(this._header.orthoMode),this._writer.writeBit(this._header.regenerationMode!==0),this._writer.writeBit(this._header.fillMode),this._writer.writeBit(this._header.quickTextMode),this._writer.writeBit(this._header.paperSpaceLineTypeScaling===Fi.Normal),this._writer.writeBit(this._header.limitCheckingOn),this.r13_14Only&&this._writer.writeBit(this._header.blipMode),this.r2004Plus&&this._writer.writeBit(!1),this._writer.writeBit(this._header.userTimer),this._writer.writeBit(this._header.sketchPolylineType!==0),this._writer.writeBit(this._header.angularDirection!==0),this._writer.writeBit(this._header.showSplineControlPoints),this.r13_14Only&&(this._writer.writeBit(!1),this._writer.writeBit(!1)),this._writer.writeBit(this._header.mirrorText),this._writer.writeBit(this._header.worldView),this.r13_14Only&&this._writer.writeBit(!1),this._writer.writeBit(this._header.showModelSpace),this._writer.writeBit(this._header.paperSpaceLimitsChecking),this._writer.writeBit(this._header.retainXRefDependentVisibilitySettings),this.r13_14Only&&this._writer.writeBit(!1),this._writer.writeBit(this._header.displaySilhouetteCurves),this._writer.writeBit(this._header.createEllipseAsPolyline),this._writer.writeBitShort(this._header.proxyGraphics?1:0),this.r13_14Only&&this._writer.writeBitShort(0),this._writer.writeBitShort(this._header.spatialIndexMaxTreeDepth),this._writer.writeBitShort(this._header.linearUnitFormat),this._writer.writeBitShort(this._header.linearUnitPrecision),this._writer.writeBitShort(this._header.angularUnit),this._writer.writeBitShort(this._header.angularUnitPrecision),this.r13_14Only&&this._writer.writeBitShort(this._header.objectSnapMode),this._writer.writeBitShort(this._header.attributeVisibility),this.r13_14Only&&this._writer.writeBitShort(0),this._writer.writeBitShort(this._header.pointDisplayMode),this.r13_14Only&&this._writer.writeBitShort(0),this.r2004Plus&&(this._writer.writeBitLong(0),this._writer.writeBitLong(0),this._writer.writeBitLong(0)),this._writer.writeBitShort(this._header.userShort1),this._writer.writeBitShort(this._header.userShort2),this._writer.writeBitShort(this._header.userShort3),this._writer.writeBitShort(this._header.userShort4),this._writer.writeBitShort(this._header.userShort5),this._writer.writeBitShort(this._header.numberOfSplineSegments),this._writer.writeBitShort(this._header.surfaceDensityM),this._writer.writeBitShort(this._header.surfaceDensityN),this._writer.writeBitShort(this._header.surfaceType),this._writer.writeBitShort(this._header.surfaceTabulation1),this._writer.writeBitShort(this._header.surfaceTabulation2),this._writer.writeBitShort(this._header.splineType),this._writer.writeBitShort(this._header.shadeEdge),this._writer.writeBitShort(this._header.shadeDiffuseToAmbientPercentage),this._writer.writeBitShort(this._header.unitMode),this._writer.writeBitShort(this._header.maxViewportCount),this._writer.writeBitShort(this._header.surfaceIsolineCount),this._writer.writeBitShort(this._header.currentMultiLineJustification),this._writer.writeBitShort(this._header.textQuality),this._writer.writeBitDouble(this._header.lineTypeScale),this._writer.writeBitDouble(this._header.textHeightDefault),this._writer.writeBitDouble(this._header.traceWidthDefault),this._writer.writeBitDouble(this._header.sketchIncrement),this._writer.writeBitDouble(this._header.filletRadius),this._writer.writeBitDouble(this._header.thicknessDefault),this._writer.writeBitDouble(this._header.angleBase),this._writer.writeBitDouble(this._header.pointDisplaySize),this._writer.writeBitDouble(this._header.polylineWidthDefault),this._writer.writeBitDouble(this._header.userDouble1),this._writer.writeBitDouble(this._header.userDouble2),this._writer.writeBitDouble(this._header.userDouble3),this._writer.writeBitDouble(this._header.userDouble4),this._writer.writeBitDouble(this._header.userDouble5),this._writer.writeBitDouble(this._header.chamferDistance1),this._writer.writeBitDouble(this._header.chamferDistance2),this._writer.writeBitDouble(this._header.chamferLength),this._writer.writeBitDouble(this._header.chamferAngle),this._writer.writeBitDouble(this._header.facetResolution),this._writer.writeBitDouble(this._header.currentMultilineScale),this._writer.writeBitDouble(this._header.currentEntityLinetypeScale),this._writer.writeVariableText(this._header.menuFileName),this._writer.writeDateTime(this._header.createDateTime),this._writer.writeDateTime(this._header.updateDateTime),this.r2004Plus&&(this._writer.writeBitLong(0),this._writer.writeBitLong(0),this._writer.writeBitLong(0)),this._writer.writeTimeSpan(this._header.totalEditingTime),this._writer.writeTimeSpan(this._header.userElapsedTimeSpan),this._writer.writeCmColor(this._header.currentEntityColor),this._writer.main.handleReferenceHandle(this._header.handleSeed),this._writer.handleReferenceTyped(_.HardPointer,this._header.currentLayer),this._writer.handleReferenceTyped(_.HardPointer,this._header.currentTextStyle),this._writer.handleReferenceTyped(_.HardPointer,this._header.currentLineType),this.r2007Plus&&this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,this._header.currentDimensionStyle),this._writer.handleReferenceTyped(_.HardPointer,this._document.mLineStyles?.get(this._header.currentMLineStyleName)??null),this.r2000Plus&&this._writer.writeBitDouble(this._header.viewportDefaultViewScaleFactor),this._writer.write3BitDouble(this._header.paperSpaceInsertionBase),this._writer.write3BitDouble(this._header.paperSpaceExtMin),this._writer.write3BitDouble(this._header.paperSpaceExtMax),this._writer.write2RawDouble(this._header.paperSpaceLimitsMin),this._writer.write2RawDouble(this._header.paperSpaceLimitsMax),this._writer.writeBitDouble(this._header.paperSpaceElevation),this._writer.write3BitDouble(this._header.paperSpaceUcs.origin),this._writer.write3BitDouble(this._header.paperSpaceXAxis),this._writer.write3BitDouble(this._header.paperSpaceYAxis),this._writer.handleReferenceTyped(_.HardPointer,this._header.paperSpaceUcs),this.r2000Plus&&(this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeBitShort(0),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.write3BitDouble(this._header.paperSpaceOrthographicTopDOrigin),this._writer.write3BitDouble(this._header.paperSpaceOrthographicBottomDOrigin),this._writer.write3BitDouble(this._header.paperSpaceOrthographicLeftDOrigin),this._writer.write3BitDouble(this._header.paperSpaceOrthographicRightDOrigin),this._writer.write3BitDouble(this._header.paperSpaceOrthographicFrontDOrigin),this._writer.write3BitDouble(this._header.paperSpaceOrthographicBackDOrigin)),this._writer.write3BitDouble(this._header.modelSpaceInsertionBase),this._writer.write3BitDouble(this._header.modelSpaceExtMin),this._writer.write3BitDouble(this._header.modelSpaceExtMax),this._writer.write2RawDouble(this._header.modelSpaceLimitsMin),this._writer.write2RawDouble(this._header.modelSpaceLimitsMax),this._writer.writeBitDouble(this._header.elevation),this._writer.write3BitDouble(this._header.modelSpaceOrigin),this._writer.write3BitDouble(this._header.modelSpaceXAxis),this._writer.write3BitDouble(this._header.modelSpaceYAxis),this._writer.handleReferenceTyped(_.HardPointer,this._header.modelSpaceUcs),this.r2000Plus&&(this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeBitShort(0),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.write3BitDouble(this._header.modelSpaceOrthographicTopDOrigin),this._writer.write3BitDouble(this._header.modelSpaceOrthographicBottomDOrigin),this._writer.write3BitDouble(this._header.modelSpaceOrthographicLeftDOrigin),this._writer.write3BitDouble(this._header.modelSpaceOrthographicRightDOrigin),this._writer.write3BitDouble(this._header.modelSpaceOrthographicFrontDOrigin),this._writer.write3BitDouble(this._header.modelSpaceOrthographicBackDOrigin),this._writer.writeVariableText(this._header.dimensionPostFix),this._writer.writeVariableText(this._header.dimensionAlternateDimensioningSuffix)),this.r13_14Only&&(this._writer.writeBit(this._header.dimensionGenerateTolerances),this._writer.writeBit(this._header.dimensionLimitsGeneration),this._writer.writeBit(this._header.dimensionTextInsideHorizontal),this._writer.writeBit(this._header.dimensionTextOutsideHorizontal),this._writer.writeBit(this._header.dimensionSuppressFirstExtensionLine),this._writer.writeBit(this._header.dimensionSuppressSecondExtensionLine),this._writer.writeBit(this._header.dimensionAlternateUnitDimensioning),this._writer.writeBit(this._header.dimensionTextOutsideExtensions),this._writer.writeBit(this._header.dimensionSeparateArrowBlocks),this._writer.writeBit(this._header.dimensionTextInsideExtensions),this._writer.writeBit(this._header.dimensionSuppressOutsideExtensions),this._writer.writeByte(this._header.dimensionAlternateUnitDecimalPlaces),this._writer.writeByte(this._header.dimensionZeroHandling),this._writer.writeBit(this._header.dimensionSuppressFirstDimensionLine),this._writer.writeBit(this._header.dimensionSuppressSecondDimensionLine),this._writer.writeByte(this._header.dimensionToleranceAlignment),this._writer.writeByte(this._header.dimensionTextHorizontalAlignment),this._writer.writeByte(this._header.dimensionFit),this._writer.writeBit(this._header.dimensionCursorUpdate),this._writer.writeByte(this._header.dimensionToleranceZeroHandling),this._writer.writeByte(this._header.dimensionAlternateUnitZeroHandling),this._writer.writeByte(this._header.dimensionAlternateUnitToleranceZeroHandling),this._writer.writeByte(this._header.dimensionTextVerticalAlignment),this._writer.writeBitShort(this._header.dimensionUnit),this._writer.writeBitShort(this._header.dimensionAngularDimensionDecimalPlaces),this._writer.writeBitShort(this._header.dimensionDecimalPlaces),this._writer.writeBitShort(this._header.dimensionToleranceDecimalPlaces),this._writer.writeBitShort(this._header.dimensionAlternateUnitFormat),this._writer.writeBitShort(this._header.dimensionAlternateUnitToleranceDecimalPlaces),this._writer.handleReferenceTyped(_.HardPointer,this._header.dimensionTextStyle)),this._writer.writeBitDouble(this._header.dimensionScaleFactor),this._writer.writeBitDouble(this._header.dimensionArrowSize),this._writer.writeBitDouble(this._header.dimensionExtensionLineOffset),this._writer.writeBitDouble(this._header.dimensionLineIncrement),this._writer.writeBitDouble(this._header.dimensionExtensionLineExtension),this._writer.writeBitDouble(this._header.dimensionRounding),this._writer.writeBitDouble(this._header.dimensionLineExtension),this._writer.writeBitDouble(this._header.dimensionPlusTolerance),this._writer.writeBitDouble(this._header.dimensionMinusTolerance),this.r2007Plus&&(this._writer.writeBitDouble(this._header.dimensionFixedExtensionLineLength),this._writer.writeBitDouble(this._header.dimensionJoggedRadiusDimensionTransverseSegmentAngle),this._writer.writeBitShort(this._header.dimensionTextBackgroundFillMode),this._writer.writeCmColor(this._header.dimensionTextBackgroundColor)),this.r2000Plus&&(this._writer.writeBit(this._header.dimensionGenerateTolerances),this._writer.writeBit(this._header.dimensionLimitsGeneration),this._writer.writeBit(this._header.dimensionTextInsideHorizontal),this._writer.writeBit(this._header.dimensionTextOutsideHorizontal),this._writer.writeBit(this._header.dimensionSuppressFirstExtensionLine),this._writer.writeBit(this._header.dimensionSuppressSecondExtensionLine),this._writer.writeBitShort(this._header.dimensionTextVerticalAlignment),this._writer.writeBitShort(this._header.dimensionZeroHandling),this._writer.writeBitShort(this._header.dimensionAngularZeroHandling)),this.r2007Plus&&this._writer.writeBitShort(this._header.dimensionArcLengthSymbolPosition),this._writer.writeBitDouble(this._header.dimensionTextHeight),this._writer.writeBitDouble(this._header.dimensionCenterMarkSize),this._writer.writeBitDouble(this._header.dimensionTickSize),this._writer.writeBitDouble(this._header.dimensionAlternateUnitScaleFactor),this._writer.writeBitDouble(this._header.dimensionLinearScaleFactor),this._writer.writeBitDouble(this._header.dimensionTextVerticalPosition),this._writer.writeBitDouble(this._header.dimensionToleranceScaleFactor),this._writer.writeBitDouble(this._header.dimensionLineGap),this.r13_14Only&&(this._writer.writeVariableText(this._header.dimensionPostFix),this._writer.writeVariableText(this._header.dimensionAlternateDimensioningSuffix),this._writer.writeVariableText(this._header.dimensionBlockName),this._writer.writeVariableText(this._header.dimensionBlockNameFirst),this._writer.writeVariableText(this._header.dimensionBlockNameSecond)),this.r2000Plus&&(this._writer.writeBitDouble(this._header.dimensionAlternateUnitRounding),this._writer.writeBit(this._header.dimensionAlternateUnitDimensioning),this._writer.writeBitShort(this._header.dimensionAlternateUnitDecimalPlaces),this._writer.writeBit(this._header.dimensionTextOutsideExtensions),this._writer.writeBit(this._header.dimensionSeparateArrowBlocks),this._writer.writeBit(this._header.dimensionTextInsideExtensions),this._writer.writeBit(this._header.dimensionSuppressOutsideExtensions)),this._writer.writeCmColor(this._header.dimensionLineColor),this._writer.writeCmColor(this._header.dimensionExtensionLineColor),this._writer.writeCmColor(this._header.dimensionTextColor),this.r2000Plus&&(this._writer.writeBitShort(this._header.dimensionAngularDimensionDecimalPlaces),this._writer.writeBitShort(this._header.dimensionDecimalPlaces),this._writer.writeBitShort(this._header.dimensionToleranceDecimalPlaces),this._writer.writeBitShort(this._header.dimensionAlternateUnitFormat),this._writer.writeBitShort(this._header.dimensionAlternateUnitToleranceDecimalPlaces),this._writer.writeBitShort(this._header.dimensionAngularUnit),this._writer.writeBitShort(this._header.dimensionFractionFormat),this._writer.writeBitShort(this._header.dimensionLinearUnitFormat),this._writer.writeBitShort(this._header.dimensionDecimalSeparator.charCodeAt(0)||0),this._writer.writeBitShort(this._header.dimensionTextMovement),this._writer.writeBitShort(this._header.dimensionTextHorizontalAlignment),this._writer.writeBit(this._header.dimensionSuppressFirstDimensionLine),this._writer.writeBit(this._header.dimensionSuppressSecondDimensionLine),this._writer.writeBitShort(this._header.dimensionToleranceAlignment),this._writer.writeBitShort(this._header.dimensionToleranceZeroHandling),this._writer.writeBitShort(this._header.dimensionAlternateUnitZeroHandling),this._writer.writeBitShort(this._header.dimensionAlternateUnitToleranceZeroHandling),this._writer.writeBit(this._header.dimensionCursorUpdate),this._writer.writeBitShort(this._header.dimensionDimensionTextArrowFit)),this.r2007Plus&&this._writer.writeBit(this._header.dimensionIsExtensionLineLengthFixed),this.r2010Plus&&(this._writer.writeBit(this._header.dimensionTextDirection===1),this._writer.writeBitDouble(this._header.dimensionAltMzf),this._writer.writeVariableText(this._header.dimensionAltMzs),this._writer.writeBitDouble(this._header.dimensionFit),this._writer.writeVariableText(this._header.dimensionMzs)),this.r2000Plus&&(this._writer.handleReferenceTyped(_.HardPointer,this._header.dimensionTextStyle),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2007Plus&&(this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2000Plus&&(this._writer.writeBitShort(this._header.dimensionLineWeight),this._writer.writeBitShort(this._header.extensionLineWeight)),this._writer.handleReferenceTyped(_.HardOwnership,this._document.blockRecords),this._writer.handleReferenceTyped(_.HardOwnership,this._document.layers),this._writer.handleReferenceTyped(_.HardOwnership,this._document.textStyles),this._writer.handleReferenceTyped(_.HardOwnership,this._document.lineTypes),this._writer.handleReferenceTyped(_.HardOwnership,this._document.views),this._writer.handleReferenceTyped(_.HardOwnership,this._document.uCSs),this._writer.handleReferenceTyped(_.HardOwnership,this._document.vPorts),this._writer.handleReferenceTyped(_.HardOwnership,this._document.appIds),this._writer.handleReferenceTyped(_.HardOwnership,this._document.dimensionStyles),this.r13_15Only&&this._writer.handleReferenceTyped(_.HardOwnership,this._document.vEntityControl),this._writer.handleReferenceTyped(_.HardPointer,this._document.groups),this._writer.handleReferenceTyped(_.HardPointer,this._document.mLineStyles),this._writer.handleReferenceTyped(_.HardOwnership,this._document.rootDictionary),this.r2000Plus&&(this._writer.writeBitShort(this._header.stackedTextAlignment),this._writer.writeBitShort(this._header.stackedTextSizePercentage),this._writer.writeVariableText(this._header.hyperLinkBase),this._writer.writeVariableText(this._header.styleSheetName),this._writer.handleReferenceTyped(_.HardPointer,this._document.layouts),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2004Plus&&(this._writer.handleReferenceTyped(_.HardPointer,this._document.materials),this._writer.handleReferenceTyped(_.HardPointer,this._document.colors)),this.r2007Plus&&(this._writer.handleReferenceTyped(_.HardPointer,null),this.r2013Plus&&this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2000Plus){let e=this._header.currentEntityLineWeight&31|this._header.endCaps<<5|this._header.joinStyle<<7;this._header.displayLineWeight||(e|=512),this._header.xEdit||(e|=1024),this._header.extendedNames&&(e|=2048),this._header.plotStyleMode===1&&(e|=8192),this._header.loadOLEObject&&(e|=16384),this._writer.writeBitLong(e),this._writer.writeBitShort(this._header.insUnits),this._writer.writeBitShort(this._header.currentEntityPlotStyle),this._header.currentEntityPlotStyle===bs.ByObjectId&&this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeVariableText(this._header.fingerPrintGuid),this._writer.writeVariableText(this._header.versionGuid)}this.r2004Plus&&(this._writer.writeByte(this._header.entitySortingFlags),this._writer.writeByte(this._header.indexCreationFlags),this._writer.writeByte(this._header.hideText),this._writer.writeByte(this._header.externalReferenceClippingBoundaryType),this._writer.writeByte(this._header.dimensionAssociativity),this._writer.writeByte(this._header.haloGapPercentage),this._writer.writeBitShort(this._header.obscuredColor.index),this._writer.writeBitShort(this._header.interfereColor.index),this._writer.writeByte(this._header.obscuredType),this._writer.writeByte(this._header.intersectionDisplay),this._writer.writeVariableText(this._header.projectName)),this._writer.handleReferenceTyped(_.HardPointer,this._document.paperSpace),this._writer.handleReferenceTyped(_.HardPointer,this._document.modelSpace),this._writer.handleReferenceTyped(_.HardPointer,this._document.lineTypes.get("ByLayer")),this._writer.handleReferenceTyped(_.HardPointer,this._document.lineTypes.get("ByBlock")),this._writer.handleReferenceTyped(_.HardPointer,this._document.lineTypes.get("Continuous")),this.r2007Plus&&(this._writer.writeBit(this._header.cameraDisplayObjects),this._writer.writeBitLong(0),this._writer.writeBitLong(0),this._writer.writeBitDouble(0),this._writer.writeBitDouble(this._header.stepsPerSecond),this._writer.writeBitDouble(this._header.stepSize),this._writer.writeBitDouble(this._header.dw3DPrecision),this._writer.writeBitDouble(this._header.lensLength),this._writer.writeBitDouble(this._header.cameraHeight),this._writer.writeByte(this._header.solidsRetainHistory?1:0),this._writer.writeByte(this._header.showSolidsHistory?1:0),this._writer.writeBitDouble(this._header.sweptSolidWidth),this._writer.writeBitDouble(this._header.sweptSolidHeight),this._writer.writeBitDouble(this._header.draftAngleFirstCrossSection),this._writer.writeBitDouble(this._header.draftAngleSecondCrossSection),this._writer.writeBitDouble(this._header.draftMagnitudeFirstCrossSection),this._writer.writeBitDouble(this._header.draftMagnitudeSecondCrossSection),this._writer.writeBitShort(this._header.solidLoftedShape),this._writer.writeByte(this._header.loftedObjectNormals.charCodeAt(0)||0),this._writer.writeBitDouble(this._header.latitude),this._writer.writeBitDouble(this._header.longitude),this._writer.writeBitDouble(this._header.northDirection),this._writer.writeBitLong(this._header.timeZone),this._writer.writeByte(this._header.displayLightGlyphs.charCodeAt(0)||0),this._writer.writeByte(48),this._writer.writeByte(this._header.dwgUnderlayFramesVisibility.charCodeAt(0)||0),this._writer.writeByte(this._header.dgnUnderlayFramesVisibility.charCodeAt(0)||0),this._writer.writeBit(!1),this._writer.writeCmColor(this._header.interfereColor),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeByte(this._header.shadowMode),this._writer.writeBitDouble(this._header.shadowPlaneLocation)),this._header.version>=u.AC1014&&(this._writer.writeBitShort(-1),this._writer.writeBitShort(-1),this._writer.writeBitShort(-1),this._writer.writeBitShort(-1),this.r2004Plus&&(this._writer.writeBitLong(0),this._writer.writeBitLong(0),this._writer.writeBit(!1))),this._writer.writeSpearShift(),this._writeSizeAndCrc()}_writeSizeAndCrc(){this._startWriter.writeBytes(R.startSentinels.get(this.sectionName));let e=Math.ceil(this._writer.main.positionInBits/8),t=new Uint8Array(this._writer.main.stream).slice(0,e),i=t.length,s=new Uint8Array(4);new DataView(s.buffer).setInt32(0,i,!0);let n=[];for(let l=0;l<4;l++)n.push(s[l]);if(this.r2010Plus&&this._header.maintenanceVersion>3||this.r2018Plus)for(let l=0;l<4;l++)n.push(0);for(let l=0;l3||this.r2018Plus)&&this._startWriter.writeRawLong(0),this._startWriter.writeBytes(t),this._startWriter.writeRawShort(o),this._startWriter.writeBytes(R.endSentinels.get(this.sectionName))}};var ca=class{get encoding(){return this.main.encoding}main;textWriter;handleWriter;stream;savedPositionInBits=0;positionInBits=0;_savedPosition=!1;constructor(e,t,i,s){this.stream=e.buffer,this.main=t,this.textWriter=i,this.handleWriter=s}handleReference(e){this.handleWriter.handleReference(e)}handleReferenceTyped(e,t){this.handleWriter.handleReferenceTyped(e,t)}handleReferenceHandle(e){this.handleWriter.handleReferenceHandle(e)}handleReferenceTypedHandle(e,t){this.handleWriter.handleReferenceTypedHandle(e,t)}resetStream(){this.main.resetStream(),this.textWriter.resetStream(),this.handleWriter.resetStream()}savePositonForSize(){this._savedPosition=!0,this.positionInBits=this.main.positionInBits,this.main.writeRawLong(0)}write2RawDouble(e){this.main.write2RawDouble(e)}write2BitDouble(e){this.main.write2BitDouble(e)}write3BitDouble(e){this.main.write3BitDouble(e)}writeBit(e){this.main.writeBit(e)}write2Bits(e){this.main.write2Bits(e)}writeBitDouble(e){this.main.writeBitDouble(e)}write2BitDoubleWithDefault(e,t){this.main.write2BitDoubleWithDefault(e,t)}write3BitDoubleWithDefault(e,t){this.main.write3BitDoubleWithDefault(e,t)}writeBitDoubleWithDefault(e,t){this.main.writeBitDoubleWithDefault(e,t)}writeBitExtrusion(e){this.main.writeBitExtrusion(e)}writeBitLong(e){this.main.writeBitLong(e)}writeBitLongLong(e){this.main.writeBitLongLong(e)}writeBitShort(e){this.main.writeBitShort(e)}writeBitThickness(e){this.main.writeBitThickness(e)}writeByte(e){this.main.writeByte(e)}writeBytes(e){this.main.writeBytes(e)}writeBytesOffset(e,t,i){this.main.writeBytesOffset(e,t,i)}writeCmColor(e){this.main.writeCmColor(e)}writeMergedCmColor(e){this.main.writeBitShort(0);let t=new Uint8Array(4);e.isTrueColor?(t[0]=e.r,t[1]=e.g,t[2]=e.b,t[3]=194):e.isByLayer?t[3]=192:(t[0]=e.index&255,t[3]=195);let i=new DataView(t.buffer);this.main.writeBitLong(i.getInt32(0,!0)),this.main.writeByte(0)}writeEnColor(e,t){this.main.writeEnColor(e,t)}writeEnColorBook(e,t,i){this.main.writeEnColorBook(e,t,i)}writeDateTime(e){this.main.writeDateTime(e)}write8BitJulianDate(e){this.main.write8BitJulianDate(e)}writeInt(e){this.main.writeInt(e)}writeObjectType(e){this.main.writeObjectType(e)}writeObjectTypeEnum(e){this.main.writeObjectTypeEnum(e)}writeRawDouble(e){this.main.writeRawDouble(e)}writeRawLong(e){this.main.writeRawLong(e)}writeRawShort(e){this.main.writeRawShort(e)}writeSpearShift(){let e=this.main.positionInBits,t=this.textWriter.positionInBits;if(this.main.writeSpearShift(),this._savedPosition){let a=e+t+1;t>0&&(a+=16,t>=32768&&(a+=16,t>=1073741824&&(a+=16))),this.main.setPositionInBits(this.positionInBits),this.main.writeRawLong(a),this.main.writeShiftValue()}if(this.main.setPositionInBits(e),t>0){this.textWriter.writeSpearShift();let a=Math.ceil(this.textWriter.positionInBits/8),n=new Uint8Array(this.textWriter.stream).slice(0,a);this.main.writeBytes(n),this.main.writeSpearShift(),this.main.setPositionInBits(e+t),this.main.setPositionByFlag(t),this.main.writeBit(!0)}else this.main.writeBit(!1);this.handleWriter.writeSpearShift(),this.savedPositionInBits=this.main.positionInBits;let i=Math.ceil(this.handleWriter.positionInBits/8),s=new Uint8Array(this.handleWriter.stream).slice(0,i);this.main.writeBytes(s),this.main.writeSpearShift()}writeTimeSpan(e){this.main.writeTimeSpan(e)}writeVariableText(e){this.textWriter.writeVariableText(e)}writeTextUnicode(e){this.textWriter.writeTextUnicode(e)}setPositionInBits(e){this.main.setPositionInBits(e)}setPositionByFlag(e){this.main.setPositionByFlag(e)}writeShiftValue(){this.main.writeShiftValue()}};var kc=class extends ca{constructor(e,t,i){super(e,t,t,i)}writeSpearShift(){let e=this.main.positionInBits;this._savedPosition&&(this.main.writeSpearShift(),this.main.setPositionInBits(this.positionInBits),this.main.writeRawLong(e),this.main.writeShiftValue(),this.main.setPositionInBits(e)),this.handleWriter.writeSpearShift();let t=Math.ceil(this.handleWriter.positionInBits/8),i=new Uint8Array(this.handleWriter.stream).slice(0,t);this.main.writeBytes(i),this.main.writeSpearShift()}};De();B();xr();Aa();var Pc=class extends J{get sectionName(){return R.acDbObjects}map=new Map;writeXRecords;writeXData;writeShapes=!0;_dictionaries=new Map;_objects=[];_msmain;_msmainPos=0;_writer;_stream;_streamPos=0;_document;_prev=null;_next=null;constructor(e,t,i,s=!0,a=!0,n=!0){super(t.header.version),this._stream=e.length<65536?new Uint8Array(1048576):e,this._document=t,this._msmain=new Uint8Array(65536),this._writer=Le.getMergedWriter(t.header.version,this._msmain,i),this.writeXRecords=s,this.writeXData=a,this.writeShapes=n}get bytesWritten(){return this._streamPos}getWrittenData(){return this._stream.slice(0,this._streamPos)}_ensureStreamCapacity(e){if(e>this._stream.length){let t=Math.max(e,this._stream.length*2),i=new Uint8Array(t);i.set(this._stream.subarray(0,this._streamPos)),this._stream=i}}write(){this.r2004Plus&&(this._ensureStreamCapacity(this._streamPos+4),new DataView(this._stream.buffer,this._stream.byteOffset+this._streamPos).setInt32(0,3530,!0),this._streamPos+=4),this._objects.push(this._document.rootDictionary),this._writeBlockControl(),this._writeTable(this._document.layers),this._writeTable(this._document.textStyles),this._writeLTypeControlObject(),this._writeTable(this._document.views),this._writeTable(this._document.uCSs),this._writeTable(this._document.vPorts),this._writeTable(this._document.appIds),this._writeTable(this._document.dimensionStyles),this.r2004Pre&&this._document.vEntityControl&&this._writeTable(this._document.vEntityControl),this._writeBlockEntities(),this._writeObjects()}_writeLTypeControlObject(){this._writeCommonNonEntityData(this._document.lineTypes),this._writer.writeBitLong(this._document.lineTypes.count-2);for(let e of this._document.lineTypes)e.name.toLowerCase()===z.byBlockName.toLowerCase()||e.name.toLowerCase()===z.byLayerName.toLowerCase()||this._writer.handleReferenceTyped(_.SoftOwnership,e);this._writer.handleReferenceTyped(_.HardOwnership,this._document.lineTypes.byBlock),this._writer.handleReferenceTyped(_.HardOwnership,this._document.lineTypes.byLayer),this._registerObject(this._document.lineTypes),this._writeEntries(this._document.lineTypes)}_writeBlockControl(){this._writeCommonNonEntityData(this._document.blockRecords),this._writer.writeBitLong(this._document.blockRecords.count-2);for(let e of this._document.blockRecords)e.name.toLowerCase()===U.modelSpaceName.toLowerCase()||e.name.toLowerCase()===U.paperSpaceName.toLowerCase()||this._writer.handleReferenceTyped(_.SoftOwnership,e);this._writer.handleReferenceTyped(_.HardOwnership,this._document.modelSpace),this._writer.handleReferenceTyped(_.HardOwnership,this._document.paperSpace),this._registerObject(this._document.blockRecords),this._writeEntries(this._document.blockRecords)}_writeTable(e){this._writeCommonNonEntityData(e),this._writer.writeBitLong(e.count),this.r2000Plus&&e instanceof Wt&&this._writer.writeByte(0);for(let t of e)this._writer.handleReferenceTyped(_.SoftOwnership,t);this._registerObject(e),this._writeEntries(e)}_writeEntries(e){for(let t of e)t instanceof Re?this._writeAppId(t):t instanceof U?this._writeBlockRecord(t):t instanceof pe?this._writeLayer(t):t instanceof z?this._writeLineType(t):t instanceof oe?this._writeTextStyle(t):t instanceof Rt?this._writeUCS(t):t instanceof ls?this._writeView(t):t instanceof oo?this._writeViewportEntityHeader(t):t instanceof Q?this._writeDimensionStyle(t):t instanceof nt?this._writeVPort(t):this.notify(`Table entry not implemented : ${t.constructor.name}`,y.NotImplemented)}_writeBlockEntities(){for(let e of this._document.blockRecords){this._writeBlockBegin(e.blockEntity),this._prev=null,this._next=null;let t=this._getCompatibleEntities(e.entities);for(let i=0;i0?t[i-1]:null;let s=t[i];this._next=ithis._isEntitySupported(t))}_isEntitySupported(e){return e instanceof Se||e instanceof er?!1:e instanceof qr?this.writeShapes:!0}_writeAppId(e){this._writeCommonNonEntityData(e),this._writer.writeVariableText(e.name),this._writeXrefDependantBit(e),this._writer.writeByte(0),this._writer.handleReferenceTyped(_.HardPointer,0),this._registerObject(e)}_writeBlockRecord(e){this._writeBlockHeader(e)}_writeBlockHeader(e){let t=this._getCompatibleEntities(e.entities),i=t.map(p=>p.handle),s=e.layout==null&&e.ownedObjectHandles.length>0?[...e.ownedObjectHandles]:[...i];for(let p of i)s.includes(p)||s.push(p);let a=e.combinedFlags,n=Array.from(this._document.entities).filter(p=>p instanceof Ye&&p.block?.name===e.name),o=n.map(p=>p.handle);if(e.name.toUpperCase().startsWith("*T"))for(let p of e.insertHandles)o.includes(p)||o.push(p);for(let p of n)o.includes(p.handle)||o.push(p.handle);let l=new Map(n.map(p=>[p.handle,p]));if(this._writeCommonNonEntityData(e),(a&ne.Anonymous)!==0)this._writer.writeVariableText(e.name.substring(0,2));else if(e.layout!=null){let p=e.name.replace(/[0-9]/g,"");this._writer.writeVariableText(p)}else this._writer.writeVariableText(e.name);if(this._writeXrefDependantBit({flags:a}),this._writer.writeBit((a&ne.Anonymous)!==0),this._writer.writeBit(e.hasAttributes),this._writer.writeBit((a&ne.XRef)!==0),this._writer.writeBit((a&ne.XRefOverlay)!==0),this.r2000Plus&&this._writer.writeBit(e.isUnloaded),this.r2004Plus&&(a&ne.XRef)===0&&(a&ne.XRefOverlay)===0&&this._writer.writeBitLong(s.length),this._writer.write3BitDouble(e.blockEntity.basePoint),this._writer.writeVariableText(e.blockEntity.xRefPath),this.r2000Plus){for(let p of o)this._writer.writeByte(1);this._writer.writeByte(0),this._writer.writeVariableText(e.blockEntity.comments),this._writer.writeBitLong(0)}if(this.r2007Plus&&(this._writer.writeBitShort(e.units),this._writer.writeBit(e.isExplodable),this._writer.writeByte(e.canScale?1:0)),this._writer.handleReferenceTyped(_.HardPointer,0),this._writer.handleReferenceTyped(_.HardOwnership,e.blockEntity),this._version>=u.AC1012&&this._version<=u.AC1015&&(a&ne.XRef)===0&&(a&ne.XRefOverlay)===0&&(t.length>0?(this._writer.handleReferenceTyped(_.SoftPointer,t[0]),this._writer.handleReferenceTyped(_.SoftPointer,t[t.length-1])):(this._writer.handleReferenceTyped(_.SoftPointer,0),this._writer.handleReferenceTyped(_.SoftPointer,0))),this.r2004Plus)for(let p of s){let b=t.find(x=>x.handle===p);b?this._writer.handleReferenceTyped(_.HardOwnership,b):this._writer.handleReferenceTypedHandle(_.HardOwnership,p)}if(this._writer.handleReferenceTyped(_.HardOwnership,e.blockEnd),this.r2000Plus){for(let p of o){let b=l.get(p);b?this._writer.handleReferenceTyped(_.SoftPointer,b):this._writer.handleReferenceTypedHandle(_.SoftPointer,p)}this._writer.handleReferenceTyped(_.HardPointer,e.layout)}this._registerObject(e)}_writeBlockBegin(e){this._writeCommonEntityData(e),this._writer.writeVariableText(e.name),this._registerObject(e)}_writeBlockEnd(e){this._writeCommonEntityData(e),this._registerObject(e)}_writeLayer(e){if(this._writeCommonNonEntityData(e),this._writer.writeVariableText(e.name),this._writeXrefDependantBit(e),this.r13_14Only&&(this._writer.writeBit((e.flags&st.Frozen)!==0),this._writer.writeBit(e.isOn),this._writer.writeBit((e.flags&st.FrozenNewViewports)!==0),this._writer.writeBit((e.flags&st.Locked)!==0)),this.r2000Plus){let t=q.toIndex(e.lineWeight)<<5;(e.flags&st.Frozen)!==0&&(t|=1),e.isOn||(t|=2),(e.flags&st.Frozen)!==0&&(t|=4),(e.flags&st.Locked)!==0&&(t|=8),e.plotFlag&&(t|=16),this._writer.writeBitShort(t)}this._writer.writeCmColor(e.color),this._writer.handleReferenceTyped(_.HardPointer,null),this.r2000Plus&&this._writer.handleReferenceTyped(_.HardPointer,0),this.r2007Plus&&this._writer.handleReferenceTyped(_.HardPointer,0),this._writer.handleReferenceTyped(_.HardPointer,e.lineType.handle),this.r2013Plus&&this._writer.handleReferenceTyped(_.HardPointer,0),this._registerObject(e)}_writeLineType(e){this._writeCommonNonEntityData(e),this._writer.writeVariableText(e.name),this._writeXrefDependantBit(e),this._writer.writeVariableText(e.description),this._writer.writeBitDouble(e.patternLength),this._writer.writeByte((e.alignment?.charCodeAt(0)??0)&255),this._writer.writeByte(e.segments.length);let t=!1;for(let a of e.segments)if((a.shapeFlags&ut.Text)!==0){t=!0;break}let i=null,s=0;this._version<=u.AC1018?(i=new Uint8Array(256),this._version<=u.AC1014&&(s=1)):this.r2007Plus&&t&&(i=new Uint8Array(512));for(let a of e.segments){if((a.shapeFlags&ut.Text)!==0)if(i==null||!a.text)a.shapeNumber=0;else{let n=this.r2007Plus?this._encodeUtf16LE(a.text):this._encodeText(a.text),o=this.r2007Plus?2:1,l=n.length+o;if(s+l<=i.length){a.shapeNumber=s,i.set(n,s),s+=n.length;for(let p=0;p=32768){let i=new Uint8Array(4);i[0]=t&255,i[1]=t>>8&127|128,i[2]=t>>15&255,i[3]=t>>23&255,e.write(i,0,4)}else{let i=new Uint8Array(2);i[0]=t&255,i[1]=t>>8&255,e.write(i,0,2)}}_writeSizeInBits(e,t){if(t===0){e.write(new Uint8Array([0]),0,1);return}let i=t,s=i>>>7;for(;i!==0;){let a=i&127;s!==0&&(a=a|128),e.write(new Uint8Array([a]),0,1),i=s,s=i>>>7}}_writeXrefDependantBit(e){this.r2007Plus?this._writer.writeBitShort((e.flags&ar.XrefDependent)!==0?256:0):(this._writer.writeBit((e.flags&ar.Referenced)!==0),this._writer.writeBitShort(0),this._writer.writeBit((e.flags&ar.XrefDependent)!==0))}_writeCommonData(e){switch(this._writer.resetStream(),this._msmainPos=0,e.objectType){case m.LAYOUT:if(this.r2004Pre){let t=this._document.classes.tryGetByName(e.objectName);if(t.found&&t.result)this._writer.writeObjectType(t.result.classNumber);else{this.notify(`Dxf Class not found for ${e.objectType} fullname: ${e.constructor.name}`,y.Warning);return}break}this._writer.writeObjectType(e.objectType);break;case m.UNLISTED:{let t=this._document.classes.tryGetByName(e.objectName);if(t.found&&t.result)this._writer.writeObjectType(t.result.classNumber);else{this.notify(`Dxf Class not found for ${e.objectType} fullname: ${e.constructor.name}`,y.Warning);return}}break;case m.INVALID:case m.UNDEFINED:this.notify(`CadObject type: ${e.objectType} fullname: ${e.constructor.name}`,y.NotImplemented);return;default:this._writer.writeObjectType(e.objectType);break}this._version>=u.AC1015&&this._version=u.AC1012&&this._version<=u.AC1014&&this._writer.savePositonForSize(),this._writeEntityMode(e)}_writeEntityMode(e){let t=this._getEntMode(e);if(this._writer.write2Bits(t),t===0&&this._writer.handleReferenceTyped(_.SoftPointer,e.owner),this._writeReactorsAndDictionaryHandle(e),this.r13_14Only){this._writer.handleReferenceTyped(_.HardPointer,e.layer);let i=e.lineType.name===z.byLayerName;this._writer.writeBit(i),!i&&e.lineType.handle!==0&&this._writer.handleReferenceTyped(_.HardPointer,e.lineType)}if(!this.r2004Plus){let i=this._prev!=null&&this._prev.handle===e.handle-1&&this._next!=null&&this._next.handle===e.handle+1;this._writer.writeBit(i),i||(this._writer.handleReferenceTyped(_.SoftPointer,this._prev),this._writer.handleReferenceTyped(_.SoftPointer,this._next))}if(this._writer.writeEnColorBook(e.color,e.transparency,e.bookColor!=null),this._version>=u.AC1018&&e.bookColor!=null&&this._writer.handleReferenceTyped(_.HardPointer,e.bookColor),this._writer.writeBitDouble(e.lineTypeScale),!(this._version>=u.AC1015)){this._writer.writeBitShort(e.isInvisible?0:1);return}this._writer.handleReferenceTyped(_.HardPointer,e.layer),e.lineType.name===z.byLayerName?this._writer.write2Bits(0):e.lineType.name===z.byBlockName?this._writer.write2Bits(1):e.lineType.name===z.continuousName?this._writer.write2Bits(2):(this._writer.write2Bits(3),this._writer.handleReferenceTyped(_.HardPointer,e.lineType)),this.r2007Plus&&(this._writer.write2Bits(0),this._writer.writeByte(0)),this._writer.write2Bits(0),this._version>u.AC1021&&(this._writer.writeBit(!1),this._writer.writeBit(!1),this._writer.writeBit(!1)),this._writer.writeBitShort(e.isInvisible?1:0),this._writer.writeByte(q.toIndex(e.lineWeight))}_writeExtendedData(e){if(this.writeXData)for(let[t,i]of e)this._writeExtendedDataEntry(t,i);this._writer.writeBitShort(0)}_writeExtendedDataEntry(e,t){let i=[];for(let s of t.records)if(i.push(s.code-1e3),s instanceof Er){i.push(s.value.length);for(let a=0;a=0;x--)p.setUint8(x,Number(l&0xffn)),l>>=8n;let b=new Uint8Array(o);for(let x=0;x<8;x++)i.push(b[x])}else if(s instanceof jr)if(this.r2007Plus){let a=s.value.length+1,n=new ArrayBuffer(2);new DataView(n).setUint16(0,a,!0);let o=new Uint8Array(n);i.push(o[0],o[1]);let l=this._encodeUtf16LE(s.value);for(let p=0;pt.handle===e.handle)||this._objects.push(e)}_writeCommonProxyData(e){this._writer.writeBitLong(e.classId),this.r2000Plus&&(this._version>u.AC1015&&this._writer.writeVariableText(""),this.r2018Plus?(this._writer.writeBitLong(e.version),this._writer.writeBitLong(e.maintenanceVersion)):this._writer.writeBitLong(e.version|e.maintenanceVersion<<16),this._writer.writeBit(e.originalDataFormatDxf))}_writeArc(e){this._writeCircle(e),this._writer.writeBitDouble(e.startAngle),this._writer.writeBitDouble(e.endAngle)}_writeAttribute(e){this._writeCommonAttData(e)}_writeAttDefinition(e){this._writeCommonAttData(e),this.r2010Plus&&this._writer.writeByte(e.version),this._writer.writeVariableText(e.prompt)}_writeCommonAttData(e){this._writeTextEntity(e),this.r2010Plus&&this._writer.writeByte(e.version),this.r2018Plus&&(this._writer.writeByte(e.attributeType),(e.attributeType===mi.MultiLine||e.attributeType===mi.ConstantMultiLine)&&(this._writeEntityMode(e.mText),this._writeMText(e.mText),this._writer.writeBitShort(0))),this._writer.writeVariableText(e.tag),this._writer.writeBitShort(0),this._writer.writeByte(e.flags),this.r2007Plus&&this._writer.writeBit(e.isReallyLocked)}_writeCircle(e){this._writer.write3BitDouble(e.center),this._writer.writeBitDouble(e.radius),this._writer.writeBitThickness(e.thickness),this._writer.writeBitExtrusion(e.normal)}_writeCommonDimensionData(e){this.r2010Plus&&this._writer.writeByte(e.version),this._writer.write3BitDouble(e.normal),this._writer.write2RawDouble(new g(e.textMiddlePoint.x,e.textMiddlePoint.y)),this._writer.writeBitDouble(e.insertionPoint.z);let t=0;t|=e.isTextUserDefinedLocation?0:1,this._writer.writeByte(t),this._writer.writeVariableText(e.text),this._writer.writeBitDouble(e.textRotation),this._writer.writeBitDouble(e.horizontalDirection),this._writer.write3BitDouble(new c(1,1,1)),this._writer.writeBitDouble(0),this.r2000Plus&&(this._writer.writeBitShort(e.attachmentPoint),this._writer.writeBitShort(e.lineSpacingStyle),this._writer.writeBitDouble(e.lineSpacingFactor),this._writer.writeBitDouble(e.measurement)),this.r2007Plus&&(this._writer.writeBit(!1),this._writer.writeBit(e.flipArrow1),this._writer.writeBit(e.flipArrow2)),this._writer.write2RawDouble(new g(e.insertionPoint.x,e.insertionPoint.y)),this._writer.handleReferenceTyped(_.HardPointer,e.style),this._writer.handleReferenceTyped(_.HardPointer,e.block)}_writeDimensionLinear(e){this._writeDimensionAligned(e),this._writer.writeBitDouble(e.rotation)}_writeDimensionAligned(e){this._writer.write3BitDouble(e.firstPoint),this._writer.write3BitDouble(e.secondPoint),this._writer.write3BitDouble(e.definitionPoint),this._writer.writeBitDouble(e.extLineRotation)}_writeDimensionRadius(e){this._writer.write3BitDouble(e.definitionPoint),this._writer.write3BitDouble(e.angleVertex),this._writer.writeBitDouble(e.leaderLength)}_writeDimensionAngular2Line(e){this._writer.write2RawDouble(new g(e.dimensionArc.x,e.dimensionArc.y)),this._writer.write3BitDouble(e.firstPoint),this._writer.write3BitDouble(e.secondPoint),this._writer.write3BitDouble(e.angleVertex),this._writer.write3BitDouble(e.definitionPoint)}_writeDimensionAngular3Pt(e){this._writer.write3BitDouble(e.definitionPoint),this._writer.write3BitDouble(e.firstPoint),this._writer.write3BitDouble(e.secondPoint),this._writer.write3BitDouble(e.angleVertex)}_writeDimensionDiameter(e){this._writer.write3BitDouble(e.definitionPoint),this._writer.write3BitDouble(e.angleVertex),this._writer.writeBitDouble(e.leaderLength)}_writeDimensionOrdinate(e){this._writer.write3BitDouble(e.definitionPoint),this._writer.write3BitDouble(e.featureLocation),this._writer.write3BitDouble(e.leaderEndpoint),this._writer.writeByte(e.isOrdinateTypeX?1:0)}_writeEllipse(e){this._writer.write3BitDouble(e.center),this._writer.write3BitDouble(e.majorAxisEndPoint),this._writer.write3BitDouble(e.normal),this._writer.writeBitDouble(e.radiusRatio),this._writer.writeBitDouble(e.startParameter),this._writer.writeBitDouble(e.endParameter)}_writeInsert(e){if(this._writer.write3BitDouble(e.insertPoint),this.r13_14Only&&(this._writer.writeBitDouble(e.xScale),this._writer.writeBitDouble(e.yScale),this._writer.writeBitDouble(e.zScale)),this.r2000Plus&&(e.xScale===1&&e.yScale===1&&e.zScale===1?this._writer.write2Bits(3):e.xScale===e.yScale&&e.xScale===e.zScale?(this._writer.write2Bits(2),this._writer.writeRawDouble(e.xScale)):e.xScale===1?(this._writer.write2Bits(1),this._writer.writeBitDoubleWithDefault(e.yScale,1),this._writer.writeBitDoubleWithDefault(e.zScale,1)):(this._writer.write2Bits(0),this._writer.writeRawDouble(e.xScale),this._writer.writeBitDoubleWithDefault(e.yScale,e.xScale),this._writer.writeBitDoubleWithDefault(e.zScale,e.xScale))),this._writer.writeBitDouble(e.rotation),this._writer.write3BitDouble(e.normal),this._writer.writeBit(e.hasAttributes),this.r2004Plus&&e.hasAttributes&&this._writer.writeBitLong(e.attributes.length),e.isMultiple&&(this._writer.writeBitShort(e.columnCount),this._writer.writeBitShort(e.rowCount),this._writer.writeBitDouble(e.columnSpacing),this._writer.writeBitDouble(e.rowSpacing)),this._writer.handleReferenceTyped(_.HardPointer,e.block),!!e.hasAttributes){if(this._version>=u.AC1012&&this._version<=u.AC1015)this._writer.handleReferenceTyped(_.SoftPointer,e.attributes[0]),this._writer.handleReferenceTyped(_.SoftPointer,e.attributes[e.attributes.length-1]);else if(this.r2004Plus)for(let t of e.attributes)this._writer.handleReferenceTyped(_.HardOwnership,t);this._writer.handleReferenceTyped(_.HardOwnership,e.attributes.seqend)}}_writeFace3D(e){if(this.r13_14Only&&(this._writer.write3BitDouble(e.firstCorner),this._writer.write3BitDouble(e.secondCorner),this._writer.write3BitDouble(e.thirdCorner),this._writer.write3BitDouble(e.fourthCorner),this._writer.writeBitShort(e.flags)),this.r2000Plus){let t=e.flags===ya.None;this._writer.writeBit(t);let i=e.firstCorner.z===0;this._writer.writeBit(i),this._writer.writeRawDouble(e.firstCorner.x),this._writer.writeRawDouble(e.firstCorner.y),i||this._writer.writeRawDouble(e.firstCorner.z),this._writer.write3BitDoubleWithDefault(e.secondCorner,e.firstCorner),this._writer.write3BitDoubleWithDefault(e.thirdCorner,e.secondCorner),this._writer.write3BitDoubleWithDefault(e.fourthCorner,e.thirdCorner),t||this._writer.writeBitShort(e.flags)}}_writeMesh(e){this._writer.writeBitShort(e.version),this._writer.writeBit(e.blendCrease!==0),this._writer.writeBitLong(e.subdivisionLevel),this._writer.writeBitLong(e.vertices.length);for(let i of e.vertices)this._writer.write3BitDouble(i);let t=e.faces.reduce((i,s)=>i+1+s.length,0);this._writer.writeBitLong(t);for(let i of e.faces){this._writer.writeBitLong(i.length);for(let s of i)this._writer.writeBitLong(s)}this._writer.writeBitLong(e.edges.length);for(let i of e.edges)this._writer.writeBitLong(i.start),this._writer.writeBitLong(i.end);this._writer.writeBitLong(e.edges.length);for(let i of e.edges)this._writer.writeBitDouble(i.crease??0);this._writer.writeBitLong(0)}_writeMLine(e){this._writer.writeBitDouble(e.scaleFactor),this._writer.writeByte(e.justification),this._writer.write3BitDouble(e.startPoint),this._writer.write3BitDouble(e.normal),this._writer.writeBitShort((e.flags&qi.Closed)!==0?3:1);let t=0;e.vertices.length>0&&(t=e.vertices[0].segments.length),this._writer.writeByte(t),this._writer.writeBitShort(e.vertices.length);for(let i of e.vertices){this._writer.write3BitDouble(i.position),this._writer.write3BitDouble(i.direction),this._writer.write3BitDouble(i.miter);for(let s=0;s0){let a=e.vertices[0];this._writer.write2RawDouble(a.location);for(let n=1;n0)){for(let a of s.fitPoints)this._writer.write2RawDouble(a);this._writer.write2RawDouble(s.startTangent),this._writer.write2RawDouble(s.endTangent)}}else throw new Error(`Unrecognized Boundary type: ${s.constructor.name}`)}this._writer.writeBitLong(i.entities.length);for(let s of i.entities)this._writer.handleReferenceTyped(_.SoftPointer,s)}if(this._writer.writeBitShort(e.style),this._writer.writeBitShort(e.patternType),!e.isSolid){let i=e.pattern;this._writer.writeBitDouble(e.patternAngle),this._writer.writeBitDouble(e.patternScale),this._writer.writeBit(e.isDouble),this._writer.writeBitShort(i.lines.length);for(let s of i.lines){this._writer.writeBitDouble(s.angle),this._writer.write2BitDouble(s.basePoint),this._writer.write2BitDouble(s.offset),this._writer.writeBitShort(s.dashLengths.length);for(let a of s.dashLengths)this._writer.writeBitDouble(a)}}t&&this._writer.writeBitDouble(e.pixelSize),this._writer.writeBitLong(e.seedPoints.length);for(let i of e.seedPoints)this._writer.write2RawDouble(i)}_writeLeader(e){this._writer.writeBit(!1),this._writer.writeBitShort(e.creationType),this._writer.writeBitShort(e.pathType),this._writer.writeBitLong(e.vertices.length);for(let t of e.vertices)this._writer.write3BitDouble(t);this._writer.write3BitDouble(e.vertices.length>0?e.vertices[0]:c.zero),this._writer.write3BitDouble(e.normal),this._writer.write3BitDouble(e.horizontalDirection),this._writer.write3BitDouble(e.blockOffset),this._version>=u.AC1014&&this._writer.write3BitDouble(e.annotationOffset),this.r13_14Only&&this._writer.writeBitDouble(e.style.dimensionLineGap),this._version<=u.AC1021&&(this._writer.writeBitDouble(e.textHeight),this._writer.writeBitDouble(e.textWidth)),this._writer.writeBit(e.hookLineDirection===Zi.Same),this._writer.writeBit(e.arrowHeadEnabled),this.r13_14Only&&(this._writer.writeBitShort(0),this._writer.writeBitDouble(e.style.arrowSize*e.style.scaleFactor),this._writer.writeBit(!1),this._writer.writeBit(!1),this._writer.writeBitShort(0),this._writer.writeBitShort(0),this._writer.writeBit(!1),this._writer.writeBit(!1)),this.r2000Plus&&(this._writer.writeBitShort(0),this._writer.writeBit(!1),this._writer.writeBit(!1)),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,e.style)}_writeOle2Frame(e){this._writer.writeBitShort(e.version),this.r2000Plus&&this._writer.writeBitShort(0),this._writer.writeBitLong(e.binaryData.length),this._writer.writeBytes(e.binaryData),this.r2000Plus&&this._writer.writeByte(3)}_writeMultiLeader(e){if(this.r2010Plus&&this._writer.writeBitShort(2),this._writeMultiLeaderAnnotContextSubObject(!0,e.contextData),this._writer.handleReferenceTyped(_.HardPointer,e.style),this._writer.writeBitLong(e.propertyOverrideFlags),this._writer.writeBitShort(e.pathType),this._writer.writeCmColor(e.lineColor),this._writer.handleReferenceTyped(_.HardPointer,e.leaderLineType),this._writer.writeBitLong(e.leaderLineWeight),this._writer.writeBit(e.enableLanding),this._writer.writeBit(e.enableDogleg),this._writer.writeBitDouble(e.landingDistance),this._writer.handleReferenceTyped(_.HardPointer,e.arrowhead),this._writer.writeBitDouble(e.arrowheadSize),this._writer.writeBitShort(e.contentType),this._writer.handleReferenceTyped(_.HardPointer,e.textStyle),this._writer.writeBitShort(e.textLeftAttachment),this._writer.writeBitShort(e.textRightAttachment),this._writer.writeBitShort(e.textAngle),this._writer.writeBitShort(e.textAlignment),this._writer.writeCmColor(e.textColor),this._writer.writeBit(e.textFrame),this._writer.handleReferenceTyped(_.HardPointer,e.blockContentId),this._writer.writeCmColor(e.blockContentColor),this._writer.write3BitDouble(e.blockContentScale),this._writer.writeBitDouble(e.blockContentRotation),this._writer.writeBitShort(e.blockContentConnection),this._writer.writeBit(e.enableAnnotationScale),this.r2007Pre){let i=[];e.arrowhead!=null&&i.push({handle:e.arrowhead,isDefault:!0});for(let s of e.contextData.leaderRoots)for(let a of s.lines)a.arrowhead!=null&&i.push({handle:a.arrowhead,isDefault:!1});this._writer.writeBitLong(i.length);for(let s of i)this._writer.writeBit(s.isDefault),this._writer.handleReference(s.handle)}let t=e.blockAttributes.length;this._writer.writeBitLong(t);for(let i=0;i0){this._writer.writeBitLong(e.segmentIndex),this._writer.writeBitLong(e.startEndPoints.length);for(let t of e.startEndPoints)this._writer.write3BitDouble(t.startPoint),this._writer.write3BitDouble(t.endPoint)}this._writer.writeBitLong(e.index),this.r2010Plus&&(this._writer.writeBitShort(e.pathType),this._writer.writeCmColor(e.lineColor),this._writer.handleReferenceTyped(_.HardPointer,e.lineType),this._writer.writeBitLong(e.lineWeight),this._writer.writeBitDouble(e.arrowheadSize),this._writer.handleReferenceTyped(_.HardPointer,e.arrowhead),this._writer.writeBitLong(e.overrideFlags))}_writeLine(e){if(this.r13_14Only&&(this._writer.write3BitDouble(e.startPoint),this._writer.write3BitDouble(e.endPoint)),this.r2000Plus){let t=e.startPoint.z===0&&e.endPoint.z===0;this._writer.writeBit(t),this._writer.writeRawDouble(e.startPoint.x),this._writer.writeBitDoubleWithDefault(e.endPoint.x,e.startPoint.x),this._writer.writeRawDouble(e.startPoint.y),this._writer.writeBitDoubleWithDefault(e.endPoint.y,e.startPoint.y),t||(this._writer.writeRawDouble(e.startPoint.z),this._writer.writeBitDoubleWithDefault(e.endPoint.z,e.startPoint.z))}this._writer.writeBitThickness(e.thickness),this._writer.writeBitExtrusion(e.normal)}_writePoint(e){this._writer.write3BitDouble(e.location),this._writer.writeBitThickness(e.thickness),this._writer.writeBitExtrusion(e.normal),this._writer.writeBitDouble(e.rotation)}_writeProxyEntity(e){this._writeCommonProxyData(e)}_writeWall(e){this.r2000Plus&&this._writer.writeBitLong(e.version),e.rawData!=null&&e.rawData.length>0&&this._writer.writeBytes(e.rawData),this._writer.handleReference(e.binRecord??e.binRecordHandle??0),this._writer.handleReference(e.style??0),this._writer.handleReference(e.cleanupGroup??0),this._enqueueObject(e.binRecord),this._enqueueObject(e.style),this._enqueueObject(e.cleanupGroup)}_writePolyfaceMesh(e){if(this._writer.writeBitShort(e.vertices.length),this._writer.writeBitShort(e.faces.length),this.r2004Plus){this._writer.writeBitLong(e.vertices.length+e.faces.length);for(let t of e.vertices)this._writer.handleReferenceTyped(_.SoftPointer,t);for(let t of e.faces)this._writer.handleReferenceTyped(_.SoftPointer,t)}if(this.r13_15Only){let t=[...e.vertices,...e.faces];this._writer.handleReferenceTyped(_.SoftPointer,t.length>0?t[0]:null),this._writer.handleReferenceTyped(_.SoftPointer,t.length>0?t[t.length-1]:null)}this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.seqend)}_writePolyline2D(e){if(this._writer.writeBitShort(e.flags),this._writer.writeBitShort(e.smoothSurface),this._writer.writeBitDouble(e.startWidth),this._writer.writeBitDouble(e.endWidth),this._writer.writeBitThickness(e.thickness),this._writer.writeBitDouble(e.elevation),this._writer.writeBitExtrusion(e.normal),this.r2004Plus){this._writer.writeBitLong(e.vertices.length);for(let t of e.vertices)this._writer.handleReferenceTyped(_.HardOwnership,t)}this._version>=u.AC1012&&this._version<=u.AC1015&&(this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[0]:null),this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[e.vertices.length-1]:null)),this._writer.handleReferenceTyped(_.HardOwnership,e.vertices.seqend)}_writePolyline3D(e){if(this._writer.writeByte(0),this._writer.writeByte((e.flags&$e.ClosedPolylineOrClosedPolygonMeshInM)!==0?1:0),this.r2004Plus){this._writer.writeBitLong(e.vertices.length);for(let t of e.vertices)this._writer.handleReferenceTyped(_.HardOwnership,t)}this._version>=u.AC1012&&this._version<=u.AC1015&&(this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[0]:null),this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[e.vertices.length-1]:null)),this._writer.handleReferenceTyped(_.HardOwnership,e.vertices.seqend)}_writePolygonMesh(e){if(this._writer.writeBitShort(e.flags),this._writer.writeBitShort(e.smoothSurface),this._writer.writeBitShort(e.mVertexCount),this._writer.writeBitShort(e.nVertexCount),this._writer.writeBitShort(e.mSmoothSurfaceDensity),this._writer.writeBitShort(e.nSmoothSurfaceDensity),this._version>=u.AC1012&&this._version<=u.AC1015&&(this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[0]:null),this._writer.handleReferenceTyped(_.SoftPointer,e.vertices.length>0?e.vertices[e.vertices.length-1]:null)),this.r2004Plus){this._writer.writeBitLong(e.vertices.length);for(let t of e.vertices)this._writer.handleReferenceTyped(_.HardOwnership,t)}this._writer.handleReferenceTyped(_.HardOwnership,e.vertices.seqend)}_writeSeqend(e){if(e==null)return;let t=this._prev,i=this._next;this._prev=null,this._next=null,this._writeCommonEntityData(e),this._registerObject(e),this._prev=t,this._next=i}_writeShape(e){this._writer.write3BitDouble(e.insertionPoint),this._writer.writeBitDouble(e.size),this._writer.writeBitDouble(e.rotation),this._writer.writeBitDouble(e.relativeXScale),this._writer.writeBitDouble(e.obliqueAngle),this._writer.writeBitDouble(e.thickness),this._writer.writeBitShort(e.shapeIndex),this._writer.write3BitDouble(e.normal),this._writer.handleReferenceTyped(_.HardPointer,e.shapeStyle??null)}_writeSolid(e){this._writer.writeBitThickness(e.thickness),this._writer.writeBitDouble(e.firstCorner.z),this._writer.writeRawDouble(e.firstCorner.x),this._writer.writeRawDouble(e.firstCorner.y),this._writer.writeRawDouble(e.secondCorner.x),this._writer.writeRawDouble(e.secondCorner.y),this._writer.writeRawDouble(e.thirdCorner.x),this._writer.writeRawDouble(e.thirdCorner.y),this._writer.writeRawDouble(e.fourthCorner.x),this._writer.writeRawDouble(e.fourthCorner.y),this._writer.writeBitExtrusion(e.normal)}_writeSolid3D(e){this._writeModelerGeometry(e),this.r2007Plus&&this._writer.handleReference(0)}_writeTableEntity(e){if(this._writeInsert(e),this.r2010Plus){this._writer.writeByte(e.version),this._writer.handleReference(0),this._writer.writeBitLong(0),this.r2013Plus?this._writer.writeBitLong(0):this._writer.writeBit(!1);return}this._writer.writeBitShort(e.valueFlag),this._writer.write3BitDouble(e.horizontalDirection),this._writer.writeBitLong(e.columns.length),this._writer.writeBitLong(e.rows.length);for(let t of e.columns)this._writer.writeBitDouble(t.width);for(let t of e.rows)this._writer.writeBitDouble(t.height);this._writer.handleReference(e.style);for(let t of e.rows)for(let i of t.cells)this._writeTableCell(i);this._writer.writeBit(!1),this._writer.writeBit(!1),this._writer.writeBit(!1),this._writer.writeBit(!1)}_writeCadBody(e){this._writeModelerGeometry(e)}_writeRegion(e){this._writeModelerGeometry(e)}_writeModelerGeometry(e){this.r2013Plus||this._writer.writeBit(!0),this._writer.writeBit(!0);let t=e.point.x!==0||e.point.y!==0||e.point.z!==0;if(this._writer.writeBit(t),t&&this._writer.write3BitDouble(e.point),this._writer.writeBitLong(0),this._writer.writeBit(e.wires.length>0),e.wires.length>0){this._writer.writeBitLong(e.wires.length);for(let i of e.wires)this._writeModelerGeometryWire(i)}this._writer.writeBitLong(e.silhouettes.length);for(let i of e.silhouettes)if(this._writer.writeBitLongLong(i.viewportId),this._writer.write3BitDouble(i.viewportTarget),this._writer.write3BitDouble(i.viewportDirectionFromTarget),this._writer.write3BitDouble(i.viewportUpDirection),this._writer.writeBit(i.viewportPerspective),this._writer.writeBit(i.wires.length>0),i.wires.length>0){this._writer.writeBitLong(i.wires.length);for(let s of i.wires)this._writeModelerGeometryWire(s)}this._writer.writeBit(!0),this.r2007Plus&&this._writer.writeBitLong(0)}_writeModelerGeometryWire(e){this._writer.writeByte(e.type),this._writer.writeBitLong(e.selectionMarker),this._writer.writeBitShort(e.color?.getApproxIndex()??256),this._writer.writeBitLong(e.acisIndex),this._writer.writeBitLong(e.points.length);for(let t of e.points)this._writer.write3BitDouble(t);this._writer.writeBit(e.applyTransformPresent),e.applyTransformPresent&&(this._writer.write3BitDouble(e.xAxis),this._writer.write3BitDouble(e.yAxis),this._writer.write3BitDouble(e.zAxis),this._writer.write3BitDouble(e.translation),this._writer.writeBitDouble(e.scale),this._writer.writeBit(e.hasRotation),this._writer.writeBit(e.hasReflection),this._writer.writeBit(e.hasShear))}_writeTableCell(e){if(this._writer.writeBitShort(e.type),this._writer.writeByte(e.edgeFlags),this._writer.writeBit(e.mergedValue!==0),this._writer.writeBit(e.autoFit),this._writer.writeBitLong(e.borderWidth),this._writer.writeBitLong(e.borderHeight),this._writer.writeBitDouble(e.rotation),this._writer.handleReference(0),e.type===Ds.Text){let t=e.content?.cadValue.value;this._writer.writeVariableText(typeof t=="string"?t:t==null?"":String(t))}else e.type===Ds.Block&&(this._writer.writeBitDouble(e.blockScale),this._writer.writeBit(!1));this._writer.writeBit(!1),this.r2007Plus&&(this._writer.writeBitLong(0),this._writeCadValue(e.content?.cadValue??{...new vt,valueType:4,value:""}))}_writeCadImage(e){switch(this._writer.writeBitLong(e.classVersion),this._writer.write3BitDouble(e.insertPoint),this._writer.write3BitDouble(e.uVector),this._writer.write3BitDouble(e.vVector),this._writer.write2RawDouble(e.size),this._writer.writeBitShort(e.flags),this._writer.writeBit(e.clippingState),this._writer.writeByte(e.brightness),this._writer.writeByte(e.contrast),this._writer.writeByte(e.fade),this.r2010Plus&&this._writer.writeBit(e.clipMode===$i.Inside),this._writer.writeBitShort(e.clipType),e.clipType){case bi.Rectangular:this._writer.write2RawDouble(e.clipBoundaryVertices[0]),this._writer.write2RawDouble(e.clipBoundaryVertices[1]);break;case bi.Polygonal:this._writer.writeBitLong(e.clipBoundaryVertices.length);for(let t=0;t0;switch(t){case 1:this._writer.writeBit((e.flags&Xe.Rational)!==0),this._writer.writeBit((e.flags&Xe.Closed)!==0),this._writer.writeBit((e.flags&Xe.Periodic)!==0),this._writer.writeBitDouble(e.knotTolerance),this._writer.writeBitDouble(e.controlPointTolerance),this._writer.writeBitLong(e.knots.length),this._writer.writeBitLong(e.controlPoints.length),this._writer.writeBit(i);for(let s of e.knots)this._writer.writeBitDouble(s);for(let s=0;su.AC1027&&(e.backgroundFillFlags&Or.TextFrame)>0)&&(this._writer.writeBitDouble(e.backgroundScale),this._writer.writeCmColor(e.backgroundColor),this._writer.writeBitLong(e.backgroundTransparency))),!this.r2018Plus||(this._writer.writeBit(!e.isAnnotative),e.isAnnotative))return;this._writer.writeBitShort(4),this._writer.writeBit(!0),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.writeBitLong(e.attachmentPoint),this._writer.write3BitDouble(e.alignmentPoint),this._writer.write3BitDouble(e.insertPoint),this._writer.writeBitDouble(e.rectangleWidth),this._writer.writeBitDouble(e.rectangleHeight),this._writer.writeBitDouble(e.horizontalWidth),this._writer.writeBitDouble(e.verticalHeight);let t=e.columnData,i=t?.columnType??dr.NoColumns;if(this._writer.writeBitShort(i),i===dr.NoColumns||t==null)return;let s=t.columnCount;if(this._writer.writeBitLong(s),this._writer.writeBitDouble(t.width),this._writer.writeBitDouble(t.gutter),this._writer.writeBit(t.autoHeight),this._writer.writeBit(t.flowReversed),!t.autoHeight&&i===dr.DynamicColumns)for(let a of t.heights)this._writer.writeBitDouble(a)}_writeFaceRecord(e){this._writer.writeBitShort(e.index1),this._writer.writeBitShort(e.index2),this._writer.writeBitShort(e.index3),this._writer.writeBitShort(e.index4)}_writeVertex2D(e){this._writer.writeByte(e.flags),this._writer.writeBitDouble(e.location.x),this._writer.writeBitDouble(e.location.y),this._writer.writeBitDouble(0),e.startWidth!==0&&e.endWidth===e.startWidth?this._writer.writeBitDouble(0-e.startWidth):(this._writer.writeBitDouble(e.startWidth),this._writer.writeBitDouble(e.endWidth)),this._writer.writeBitDouble(e.bulge),this.r2010Plus&&this._writer.writeBitLong(e.id),this._writer.writeBitDouble(e.curveTangent)}_writeVertex(e){this._writer.writeByte(e.flags),this._writer.write3BitDouble(e.location)}_writeTolerance(e){this.r13_14Only&&(this._writer.writeBitShort(0),this._writer.writeBitDouble(0),this._writer.writeBitDouble(0)),this._writer.write3BitDouble(e.insertionPoint),this._writer.write3BitDouble(e.direction),this._writer.write3BitDouble(e.normal),this._writer.writeVariableText(e.text),this._writer.handleReferenceTyped(_.HardPointer,e.style)}_writeViewport(e){if(this._writer.write3BitDouble(e.center),this._writer.writeBitDouble(e.width),this._writer.writeBitDouble(e.height),this.r2000Plus&&(this._writer.write3BitDouble(e.viewTarget),this._writer.write3BitDouble(e.viewDirection),this._writer.writeBitDouble(e.twistAngle),this._writer.writeBitDouble(e.viewHeight),this._writer.writeBitDouble(e.lensLength),this._writer.writeBitDouble(e.frontClipPlane),this._writer.writeBitDouble(e.backClipPlane),this._writer.writeBitDouble(e.snapAngle),this._writer.write2RawDouble(e.viewCenter),this._writer.write2RawDouble(e.snapBase),this._writer.write2RawDouble(e.snapSpacing),this._writer.write2RawDouble(e.gridSpacing),this._writer.writeBitShort(e.circleZoomPercent)),this.r2007Plus&&this._writer.writeBitShort(e.majorGridLineFrequency),this.r2000Plus&&(this._writer.writeBitLong(e.frozenLayers.length),this._writer.writeBitLong(e.status),this._writer.writeVariableText(""),this._writer.writeByte(e.renderMode),this._writer.writeBit(e.displayUcsIcon),this._writer.writeBit(e.ucsPerViewport),this._writer.write3BitDouble(e.ucsOrigin),this._writer.write3BitDouble(e.ucsXAxis),this._writer.write3BitDouble(e.ucsYAxis),this._writer.writeBitDouble(e.elevation),this._writer.writeBitShort(e.ucsOrthographicType)),this.r2004Plus&&this._writer.writeBitShort(e.shadePlotMode),this.r2007Plus&&(this._writer.writeBit(e.useDefaultLighting),this._writer.writeByte(e.defaultLightingType),this._writer.writeBitDouble(e.brightness),this._writer.writeBitDouble(e.contrast),this._writer.writeCmColor(e.ambientLightColor)),this.r13_14Only&&this._writer.handleReferenceTyped(_.HardPointer,null),this.r2000Plus){for(let t of e.frozenLayers)this.r2004Plus?this._writer.handleReferenceTyped(_.SoftPointer,t):this._writer.handleReferenceTyped(_.HardPointer,t);this._writer.handleReferenceTyped(_.HardPointer,e.boundary)}this._version===u.AC1015&&this._writer.handleReferenceTyped(_.HardPointer,null),this.r2000Plus&&(this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2007Plus&&(this._writer.handleReferenceTyped(_.SoftPointer,null),this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.SoftPointer,null),this._writer.handleReferenceTyped(_.HardOwnership,null))}_writeXLine(e){this._writer.write3BitDouble(e.firstPoint),this._writer.write3BitDouble(e.direction)}_writeChildEntities(e,t){if(e.length===0)return;let i=this._prev,s=this._next;this._prev=null,this._next=null;let a=e[0];for(let n=1;n0;){let e=this._objects.shift();this._writeObject(e)}}_writeObject(e){let{skip:t,notify:i}=this._skipEntry(e);if(t){i&&this.notify(`Object type not implemented ${e.constructor.name}`,y.NotImplemented);return}if(this._writeCommonNonEntityData(e),e instanceof vi)this._writeAcdbPlaceHolder(e);else if(e instanceof Ei)this._writeBookColor(e);else if(e instanceof ai)this._writeCadDictionaryWithDefault(e);else if(e instanceof re)this._writeDictionary(e);else if(e instanceof oa)this._writeAecBinRecord(e);else if(e instanceof aa)this._writeAecCleanupGroup(e);else if(e instanceof na)this._writeAecWallStyle(e);else if(e instanceof Ke)this._writeDictionaryVariable(e);else if(e instanceof Dt)this._writeDimensionAssociation(e);else if(e instanceof Vt)this._writeEvaluationGraph(e);else if(e instanceof dt)this._writeTableStyle(e);else if(e instanceof ft)this._writeMaterial(e);else if(e instanceof Ni)this._writeVisualStyle(e);else if(e instanceof ci)this._writeProxyObject(e);else if(e instanceof ni)this._writeBlockRepresentationData(e);else if(e instanceof ki)this._writeBlockReferenceObjectContextData(e);else if(e instanceof Pi)this._writeMTextAttributeObjectContextData(e);else if(e instanceof _r)this._writeGeoData(e);else if(e instanceof Ft)this._writeGroup(e);else if(e instanceof Ut)this._writeImageDefinitionReactor(e);else if(e instanceof oi)this._writeImageDefinition(e);else if(e instanceof ke)this._writeLayout(e);else if(e instanceof At)this._writeMLineStyle(e);else if(e instanceof ct)this._writeMultiLeaderStyle(e);else if(e instanceof Jt)this._writeObjectContextData(e),this._writeAnnotScaleObjectContextData(e),this._writeMultiLeaderAnnotContext(e);else if(e instanceof Ai)this._writePdfDefinition(e);else if(e instanceof Bt)this._writePlotSettings(e);else if(e instanceof li)this._writeRasterVariables(e);else if(e instanceof lt)this._writeScale(e);else if(e instanceof pt)this._writeSortEntitiesTable(e);else if(e instanceof br)this._writeSpatialFilter(e);else if(e instanceof Li)this._writeField(e);else if(e instanceof ji)this._writeFieldList(e);else if(e instanceof Mt)this._writeXRecord(e);else throw new Error(`Object not implemented : ${e.constructor.name}`);this._registerObject(e)}_writeAcdbPlaceHolder(e){}_writeAecBinRecord(e){this.r2000Plus&&this._writer.writeBitLong(e.version),e.binaryData.length>0&&this._writer.writeBytes(e.binaryData)}_writeAecCleanupGroup(e){this.r2000Plus&&this._writer.writeBitLong(e.version),this._writer.writeVariableText(e.description),e.rawData!=null&&e.rawData.length>0&&this._writer.writeBytes(e.rawData)}_writeAecWallStyle(e){this.r2000Plus&&this._writer.writeBitLong(e.version),this._writer.writeVariableText(e.description),e.rawData!=null&&e.rawData.length>0&&this._writer.writeBytes(e.rawData)}_writeAnnotScaleObjectContextData(e){this._writer.handleReferenceTyped(_.HardPointer,e.scale)}_writeObjectContextData(e){this._writer.writeBitShort(e.version),this._writer.writeBit(e.hasFileToExtensionDictionary),this._writer.writeBit(e.default)}_writeBookColor(e){if(this._writer.writeBitShort(0),this.r2004Plus){let t=new Uint8Array([e.color.b,e.color.g,e.color.r,194]),i=new DataView(t.buffer).getUint32(0,!0);this._writer.writeBitLong(i);let s=0;e.name&&(s|=1),e.bookName&&(s|=2),this._writer.writeByte(s),e.colorName&&this._writer.writeVariableText(e.colorName),e.bookName&&this._writer.writeVariableText(e.bookName)}}_writeCadDictionaryWithDefault(e){this._writeDictionary(e),this._writer.handleReferenceTyped(_.HardPointer,e.defaultEntry)}_writeDictionary(e){let t=[];for(let i of e)this._skipEntry(i).skip||t.push(i);this._writer.writeBitLong(t.length),this._version===u.AC1014&&this._writer.writeByte(0),this.r2000Plus&&(this._writer.writeBitShort(e.clonningFlags),this._writer.writeByte(e.hardOwnerFlag?1:0));for(let i of t)this._skipEntry(i).skip||(this._writer.writeVariableText(i.name),this._writer.handleReferenceTyped(_.SoftOwnership,i.handle));this._addEntriesToWriter(e)}_writeDictionaryVariable(e){this._writer.writeByte(0),this._writer.writeVariableText(e.value)}_writeDimensionAssociation(e){this._writer.handleReferenceTyped(_.SoftPointer,e.dimension),this._writer.writeBitLong(e.associativityFlags),this._writer.writeBit(e.isTransSpace),this._writer.writeByte(e.rotatedDimensionType),(e.associativityFlags&we.FirstPointReference)!==0&&this._writeOsnapPointRef(e.firstPointRef),(e.associativityFlags&we.SecondPointReference)!==0&&this._writeOsnapPointRef(e.secondPointRef),(e.associativityFlags&we.ThirdPointReference)!==0&&this._writeOsnapPointRef(e.thirdPointRef),(e.associativityFlags&we.FourthPointReference)!==0&&this._writeOsnapPointRef(e.fourthPointRef)}_writeOsnapPointRef(e){this._writer.writeVariableText(Dt.osnapPointRefClassName),this._writer.writeByte(e.objectOsnapType),this._writer.handleReferenceTyped(_.Undefined,e.geometry)}_writeProxyObject(e){this._writeCommonProxyData(e)}_writeBlockRepresentationData(e){this._writer.writeBitShort(e.value70),this._writer.handleReference(e.block)}_writeBlockReferenceObjectContextData(e){this._writeObjectContextData(e),this._writeAnnotScaleObjectContextData(e),this._writer.writeBitDouble(e.rotation),this._writer.write3BitDouble(e.insertionPoint),this._writer.writeBitDouble(e.xScale),this._writer.writeBitDouble(e.yScale),this._writer.writeBitDouble(e.zScale)}_writeMTextAttributeObjectContextData(e){this._writeObjectContextData(e),this._writeAnnotScaleObjectContextData(e)}_writeEvaluationGraph(e){this._writer.writeBitLong(e.value96),this._writer.writeBitLong(e.value97),this._writer.writeBitLong(e.nodes.length);for(let t of e.nodes)this._writer.writeBitLong(t.index),this._writer.writeBitLong(t.flags),this._writer.writeBitLong(t.nextNodeIndex),this._writer.handleReference(t.expression??0),this._writer.writeBitLong(t.data1),this._writer.writeBitLong(t.data2),this._writer.writeBitLong(t.data3),this._writer.writeBitLong(t.data4);this._writer.writeBitLong(e.edges.length)}_writeVisualStyle(e){this._writer.writeVariableText(e.name),this._writer.writeBitLong(e.type),this._writer.writeBitShort(0),this._writer.writeBit(e.internalFlag),this._writer.writeBitLong(0)}_writeTableStyle(e){if(this.r2007Plus){let t=e.cellStyles.length>0?e.cellStyles:[e.dataCellStyle,e.titleCellStyle,e.headerCellStyle];this._writer.writeByte(0),this._writer.writeVariableText(e.description),this._writer.writeBitLong(0),this._writer.writeBitLong(0),this._writer.handleReference(0),this._writeCellStyle(e.tableCellStyle),this._writer.writeBitLong(e.tableCellStyle.id),this._writer.writeBitLong(e.tableCellStyle.styleClass),this._writer.writeVariableText(e.tableCellStyle.name),this._writer.writeBitLong(t.length);for(let i of t)this._writer.writeBitLong(0),this._writeCellStyle(i),this._writer.writeBitLong(i.id),this._writer.writeBitLong(i.styleClass),this._writer.writeVariableText(i.name);return}this._writer.writeVariableText(e.description),this._writer.writeBitShort(e.flowDirection),this._writer.writeBitShort(e.flags),this._writer.writeBitDouble(e.horizontalCellMargin),this._writer.writeBitDouble(e.verticalCellMargin),this._writer.writeBit(e.suppressTitle),this._writer.writeBit(e.suppressHeaderRow),this._writeRowCellStyle(e.dataCellStyle),this._writeRowCellStyle(e.titleCellStyle),this._writeRowCellStyle(e.headerCellStyle)}_writeTableStyleColor(e){if(this.r2004Pre&&this._writer instanceof ca){this._writer.writeMergedCmColor(e);return}this._writer.writeCmColor(e)}_writeRowCellStyle(e){this._writer.handleReference(e.textStyle),this._writer.writeBitDouble(e.textHeight),this._writer.writeBitShort(e.cellAlignment),this._writeTableStyleColor(e.textColor),this._writeTableStyleColor(e.backgroundColor),this._writer.writeBit(e.isFillColorOn),this._writeBorderStyle(e.topBorder),this._writeBorderStyle(e.horizontalInsideBorder),this._writeBorderStyle(e.bottomBorder),this._writeBorderStyle(e.leftBorder),this._writeBorderStyle(e.verticalInsideBorder),this._writeBorderStyle(e.rightBorder)}_writeBorderStyle(e){this._writer.writeBitShort(e.lineWeight),this._writer.writeBit(!e.isInvisible),this._writeTableStyleColor(e.color)}_writeCellStyle(e){if(this._writer.writeBitLong(e.cellStyleType),this._writer.writeBitShort(e.hasData?1:0),!e.hasData)return;this._writer.writeBitLong(e.propertyOverrideFlags),this._writer.writeBitLong(e.tableCellStylePropertyFlags),this._writer.writeCmColor(e.backgroundColor),this._writer.writeBitLong(e.contentLayoutFlags),this._writeCellContentFormat(e),this._writer.writeBitShort(e.marginOverrideFlags),(e.marginOverrideFlags&Ya.Override)!==0&&(this._writer.writeBitDouble(e.verticalMargin),this._writer.writeBitDouble(e.horizontalMargin),this._writer.writeBitDouble(e.bottomMargin),this._writer.writeBitDouble(e.rightMargin),this._writer.writeBitDouble(e.marginHorizontalSpacing),this._writer.writeBitDouble(e.marginVerticalSpacing));let t=[e.topBorder,e.rightBorder,e.bottomBorder,e.leftBorder,e.verticalInsideBorder,e.horizontalInsideBorder].filter(i=>i.edgeFlags!==Ve.Unknown);this._writer.writeBitLong(t.length);for(let i of t)this._writer.writeBitLong(i.edgeFlags),this._writeBorder(i)}_writeBorder(e){this._writer.writeBitLong(e.propertyOverrideFlags),this._writer.writeBitLong(e.type),this._writer.writeCmColor(e.color),this._writer.writeBitLong(e.lineWeight),this._writer.handleReference(0),this._writer.writeBitLong(e.isInvisible?1:0),this._writer.writeBitDouble(e.doubleLineSpacing)}_writeCellContentFormat(e){this._writer.writeBitLong(e.propertyOverrideFlags),this._writer.writeBitLong(e.propertyFlags),this._writer.writeBitLong(e.valueDataType),this._writer.writeBitLong(e.valueUnitType),this._writer.writeVariableText(e.valueFormatString),this._writer.writeBitDouble(e.rotation),this._writer.writeBitDouble(e.scale),this._writer.writeBitLong(e.alignment),this._writer.writeCmColor(e.color),this._writer.handleReference(e.textStyle),this._writer.writeBitDouble(e.textHeight)}_writeMaterial(e){this._writer.writeVariableText(e.name),this._writer.writeVariableText(e.description),this._writeMaterialColor(e.ambientColorMethod,e.ambientColorFactor,e.ambientColor),this._writeMaterialColor(e.diffuseColorMethod,e.diffuseColorFactor,e.diffuseColor),this._writer.writeBitDouble(e.diffuseMapBlendFactor),this._writer.writeByte(e.diffuseProjectionMethod),this._writer.writeByte(e.diffuseTilingMethod),this._writer.writeByte(e.diffuseAutoTransform),this._writeMatrix4Values(e.diffuseMatrix),this._writeMaterialMap(e.diffuseMapSource,e.diffuseMapFileName),this._writeMaterialColor(e.specularColorMethod,e.specularColorFactor,e.specularColor),this._writer.writeBitDouble(e.specularMapBlendFactor),this._writer.writeByte(e.specularProjectionMethod),this._writer.writeByte(e.specularTilingMethod),this._writer.writeByte(e.specularAutoTransform),this._writeMatrix4Values(e.specularMatrix),this._writeMaterialMap(e.specularMapSource,e.specularMapFileName),this._writer.writeBitDouble(e.specularGlossFactor),this._writer.writeBitDouble(e.reflectionMapBlendFactor),this._writer.writeByte(e.reflectionProjectionMethod),this._writer.writeByte(e.reflectionTilingMethod),this._writer.writeByte(e.reflectionAutoTransform),this._writeMatrix4Values(e.reflectionMatrix),this._writeMaterialMap(e.reflectionMapSource,e.reflectionMapFileName),this._writer.writeBitDouble(e.opacity),this._writer.writeBitDouble(e.opacityMapBlendFactor),this._writer.writeByte(e.opacityProjectionMethod),this._writer.writeByte(e.opacityTilingMethod),this._writer.writeByte(e.opacityAutoTransform),this._writeMatrix4Values(e.opacityMatrix),this._writeMaterialMap(e.opacityMapSource,e.opacityMapFileName),this._writer.writeBitDouble(e.bumpMapBlendFactor),this._writer.writeByte(e.bumpProjectionMethod),this._writer.writeByte(e.bumpTilingMethod),this._writer.writeByte(e.bumpAutoTransform),this._writeMatrix4Values(e.bumpMatrix),this._writeMaterialMap(e.bumpMapSource,e.bumpMapFileName),this._writer.writeBitDouble(e.refractionIndex),this._writer.writeBitDouble(e.refractionMapBlendFactor),this._writer.writeByte(e.refractionProjectionMethod),this._writer.writeByte(e.refractionTilingMethod),this._writer.writeByte(e.refractionAutoTransform),this._writeMatrix4Values(e.refractionMatrix),this._writeMaterialMap(e.refractionMapSource,e.refractionMapFileName)}_writeMaterialColor(e,t,i){this._writer.writeByte(e),this._writer.writeBitDouble(t),e===cr.Override&&this._writer.writeBitLong((i.b|i.g<<8|i.r<<16)>>>0)}_writeMaterialMap(e,t){let i=e;e===et.Procedural&&(this.notify("Procedural material maps are downgraded to current-scene maps when writing DWG.",y.Warning),i=et.UseCurrentScene),this._writer.writeByte(i),i===et.UseImageFile&&this._writer.writeVariableText(t)}_writeMatrix4Values(e){for(let t=0;t<16;t++){let i=t%5===0;this._writer.writeBitDouble(e[t]??(i?1:0))}}_writeField(e){this._writer.writeVariableText(e.evaluatorId),this._writer.writeVariableText(e.fieldCode),this._writer.writeBitLong(e.children.length);for(let t of e.children)this._writer.handleReferenceTyped(_.HardOwnership,e);this._writer.writeBitLong(e.cadObjects.length);for(let t of e.cadObjects)this._writer.handleReferenceTyped(_.SoftPointer,t);this._version>>32|0,a=i|0;t=new Uint8Array(8);let n=new DataView(t.buffer);n.setInt32(0,s,!1),n.setInt32(4,a,!1)}this._writer.writeBitLong(t.length),this._writer.writeBytes(t)}else this._writer.writeBitLong(0)}_writeStringCadValue(e){e||this._writer.writeBitLong(0);let t;this.r2007Plus?(t=this._encodeUtf16LE(e),this._writer.writeBitLong(t.length+2),this._writer.writeBytes(t),this._writer.writeByte(0),this._writer.writeByte(0)):(t=this._encodeText(e),this._writer.writeBitLong(t.length+1),this._writer.writeBytes(t),this._writer.writeByte(0))}_writeGeoData(e){switch(this._writer.writeBitLong(e.version),this._writer.handleReferenceTyped(_.SoftPointer,e.hostBlock),this._writer.writeBitShort(e.coordinatesType),e.version){case qe.R2009:this._writer.write3BitDouble(e.referencePoint),this._writer.writeBitLong(e.horizontalUnits),this._writer.write3BitDouble(e.designPoint),this._writer.write3BitDouble(c.zero),this._writer.write3BitDouble(e.upDirection),this._writer.writeBitDouble(Math.PI/2-e.northDirection.getAngle()),this._writer.write3BitDouble(new c(1,1,1)),this._writer.writeVariableText(e.coordinateSystemDefinition),this._writer.writeVariableText(e.geoRssTag),this._writer.writeBitDouble(e.horizontalUnitScale),e.verticalUnitScale=e.horizontalUnitScale,this._writer.writeVariableText(""),this._writer.writeVariableText("");break;case qe.R2010:case qe.R2013:this._writer.write3BitDouble(e.designPoint),this._writer.write3BitDouble(e.referencePoint),this._writer.writeBitDouble(e.horizontalUnitScale),this._writer.writeBitLong(e.horizontalUnits),this._writer.writeBitDouble(e.verticalUnitScale),this._writer.writeBitLong(e.horizontalUnits),this._writer.write3BitDouble(e.upDirection),this._writer.write2RawDouble(e.northDirection),this._writer.writeBitLong(e.scaleEstimationMethod),this._writer.writeBitDouble(e.userSpecifiedScaleFactor),this._writer.writeBit(e.enableSeaLevelCorrection),this._writer.writeBitDouble(e.seaLevelElevation),this._writer.writeBitDouble(e.coordinateProjectionRadius),this._writer.writeVariableText(e.coordinateSystemDefinition),this._writer.writeVariableText(e.geoRssTag);break}this._writer.writeVariableText(e.observationFromTag),this._writer.writeVariableText(e.observationToTag),this._writer.writeVariableText(e.observationCoverageTag),this._writer.writeBitLong(e.points.length);for(let t of e.points)this._writer.write2RawDouble(t.source),this._writer.write2RawDouble(t.destination);this._writer.writeBitLong(e.faces.length);for(let t of e.faces)this._writer.writeBitLong(t.index1),this._writer.writeBitLong(t.index2),this._writer.writeBitLong(t.index3)}_writeGroup(e){this._writer.writeVariableText(e.description),this._writer.writeBitShort(e.isUnnamed?1:0),this._writer.writeBitShort(e.selectable?1:0),this._writer.writeBitLong(e.entities.length);for(let t of e.entities)this._writer.handleReferenceTyped(_.HardPointer,t)}_writeImageDefinition(e){this._writer.writeBitLong(e.classVersion),this._writer.write2RawDouble(e.size),this._writer.writeVariableText(e.fileName),this._writer.writeBit(e.isLoaded),this._writer.writeByte(e.units),this._writer.write2RawDouble(e.defaultSize)}_writeImageDefinitionReactor(e){this._writer.writeBitLong(e.classVersion)}_writeLayout(e){if(this._writePlotSettings(e),this._writer.writeVariableText(e.name),this._writer.writeBitLong(e.tabOrder),this._writer.writeBitShort(e.layoutFlags),this._writer.write3BitDouble(e.origin),this._writer.write2RawDouble(e.minLimits),this._writer.write2RawDouble(e.minLimits),this._writer.write3BitDouble(e.insertionBasePoint),this._writer.write3BitDouble(e.xAxis),this._writer.write3BitDouble(e.yAxis),this._writer.writeBitDouble(e.elevation),this._writer.writeBitShort(e.ucsOrthographicType),this._writer.write3BitDouble(e.minExtents),this._writer.write3BitDouble(e.maxExtents),this.r2004Plus&&this._writer.writeBitLong(e.viewports.length),this._writer.handleReferenceTyped(_.SoftPointer,e.associatedBlock),this._writer.handleReferenceTyped(_.SoftPointer,e.lastActiveViewport),e.ucsOrthographicType===lr.None?(this._writer.handleReferenceTyped(_.HardPointer,null),this._writer.handleReferenceTyped(_.HardPointer,e.ucs)):(this._writer.handleReferenceTyped(_.HardPointer,e.baseUCS),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2004Plus)for(let t of e.viewports)this._writer.handleReferenceTyped(_.SoftPointer,t)}_writeMLineStyle(e){this._writer.writeVariableText(e.name),this._writer.writeVariableText(e.description);let t=0;(e.flags&Te.DisplayJoints)!==0&&(t|=1),(e.flags&Te.FillOn)!==0&&(t|=2),(e.flags&Te.StartSquareCap)!==0&&(t|=16),(e.flags&Te.StartRoundCap)!==0&&(t|=32),(e.flags&Te.StartInnerArcsCap)!==0&&(t|=64),(e.flags&Te.EndSquareCap)!==0&&(t|=256),(e.flags&Te.EndRoundCap)!==0&&(t|=512),(e.flags&Te.EndInnerArcsCap)!==0&&(t|=1024),this._writer.writeBitShort(t),this._writer.writeCmColor(e.fillColor),this._writer.writeBitDouble(e.startAngle),this._writer.writeBitDouble(e.endAngle),this._writer.writeByte(e.elements.length);for(let i of e.elements)this._writer.writeBitDouble(i.offset),this._writer.writeCmColor(i.color),this.r2018Plus?this._writer.handleReferenceTyped(_.HardPointer,i.lineType):this._writer.writeBitShort(0)}_writeMultiLeaderAnnotContext(e){this._writeMultiLeaderAnnotContextSubObject(!1,e)}_writeMultiLeaderStyle(e){this.r2010Plus&&this._writer.writeBitShort(2),this._writer.writeBitShort(e.contentType),this._writer.writeBitShort(e.multiLeaderDrawOrder),this._writer.writeBitShort(e.leaderDrawOrder),this._writer.writeBitLong(e.maxLeaderSegmentsPoints),this._writer.writeBitDouble(e.firstSegmentAngleConstraint),this._writer.writeBitDouble(e.secondSegmentAngleConstraint),this._writer.writeBitShort(e.pathType),this._writer.writeCmColor(e.lineColor),this._writer.handleReferenceTyped(_.HardPointer,e.leaderLineType),this._writer.writeBitLong(e.leaderLineWeight),this._writer.writeBit(e.enableLanding),this._writer.writeBitDouble(e.landingGap),this._writer.writeBit(e.enableDogleg),this._writer.writeBitDouble(e.landingDistance),this._writer.writeVariableText(e.description),this._writer.handleReferenceTyped(_.HardPointer,e.arrowhead),this._writer.writeBitDouble(e.arrowheadSize),this._writer.writeVariableText(e.defaultTextContents),this._writer.handleReferenceTyped(_.HardPointer,e.textStyle),this._writer.writeBitShort(e.textLeftAttachment),this._writer.writeBitShort(e.textRightAttachment),this._writer.writeBitShort(e.textAngle),this._writer.writeBitShort(e.textAlignment),this._writer.writeCmColor(e.textColor),this._writer.writeBitDouble(e.textHeight),this._writer.writeBit(e.textFrame),this._writer.writeBit(e.textAlignAlwaysLeft),this._writer.writeBitDouble(e.alignSpace),this._writer.handleReferenceTyped(_.HardPointer,e.blockContent),this._writer.writeCmColor(e.blockContentColor),this._writer.write3BitDouble(e.blockContentScale),this._writer.writeBit(e.enableBlockContentScale),this._writer.writeBitDouble(e.blockContentRotation),this._writer.writeBit(e.enableBlockContentRotation),this._writer.writeBitShort(e.blockContentConnection),this._writer.writeBitDouble(e.scaleFactor),this._writer.writeBit(e.overwritePropertyValue),this._writer.writeBit(e.isAnnotative),this._writer.writeBitDouble(e.breakGapSize),this.r2010Plus&&(this._writer.writeBitShort(e.textAttachmentDirection),this._writer.writeBitShort(e.textBottomAttachment),this._writer.writeBitShort(e.textTopAttachment)),this.r2013Plus&&this._writer.writeBit(e.unknownFlag298)}_writePdfDefinition(e){this._writer.writeVariableText(e.file),this._writer.writeVariableText(e.page)}_writePlotSettings(e){this._writer.writeVariableText(e.pageName),this._writer.writeVariableText(e.systemPrinterName),this._writer.writeBitShort(e.flags),this._writer.writeBitDouble(e.unprintableMargin.left),this._writer.writeBitDouble(e.unprintableMargin.bottom),this._writer.writeBitDouble(e.unprintableMargin.right),this._writer.writeBitDouble(e.unprintableMargin.top),this._writer.writeBitDouble(e.paperWidth),this._writer.writeBitDouble(e.paperHeight),this._writer.writeVariableText(e.paperSize),this._writer.writeBitDouble(e.plotOriginX),this._writer.writeBitDouble(e.plotOriginY),this._writer.writeBitShort(e.paperUnits),this._writer.writeBitShort(e.paperRotation),this._writer.writeBitShort(e.plotType),this._writer.writeBitDouble(e.windowLowerLeftX),this._writer.writeBitDouble(e.windowLowerLeftY),this._writer.writeBitDouble(e.windowUpperLeftX),this._writer.writeBitDouble(e.windowUpperLeftY),this._version>=u.AC1012&&this._version<=u.AC1015&&this._writer.writeVariableText(e.plotViewName),this._writer.writeBitDouble(e.numeratorScale),this._writer.writeBitDouble(e.denominatorScale),this._writer.writeVariableText(e.styleSheet),this._writer.writeBitShort(e.scaledFit),this._writer.writeBitDouble(e.standardScale),this._writer.write2BitDouble(e.paperImageOrigin),this.r2004Plus&&(this._writer.writeBitShort(e.shadePlotMode),this._writer.writeBitShort(e.shadePlotResolutionMode),this._writer.writeBitShort(e.shadePlotDPI),this._writer.handleReferenceTyped(_.HardPointer,null)),this.r2007Plus&&this._writer.handleReferenceTyped(_.SoftPointer,null)}_writeRasterVariables(e){this._writer.writeBitLong(e.classVersion),this._writer.writeBitShort(e.isDisplayFrameShown?1:0),this._writer.writeBitShort(e.displayQuality),this._writer.writeBitShort(e.units)}_writeScale(e){this._writer.writeBitShort(0),this._writer.writeVariableText(e.name),this._writer.writeBitDouble(e.paperUnits),this._writer.writeBitDouble(e.drawingUnits),this._writer.writeBit(e.isUnitScale)}_writeSortEntitiesTable(e){this._writer.handleReferenceTyped(_.SoftPointer,e.blockOwner);let t=Array.from(e);this._writer.writeBitLong(t.length);for(let i of t)this._writer.main.handleReference(i.sortHandle),this._writer.handleReferenceTyped(_.SoftPointer,i.entity)}_writeSpatialFilter(e){this._writer.writeBitShort(e.boundaryPoints.length);for(let t of e.boundaryPoints)this._writer.write2RawDouble(t);this._writer.write3BitDouble(e.normal),this._writer.write3BitDouble(e.origin),this._writer.writeBitShort(e.displayBoundary?1:0),this._writer.writeBitShort(e.clipFrontPlane?1:0),e.clipFrontPlane&&this._writer.writeBitDouble(e.frontDistance),this._writer.writeBitShort(e.clipBackPlane?1:0),e.clipBackPlane&&this._writer.writeBitDouble(e.backDistance),this._write4x3Matrix(e.inverseInsertTransform),this._write4x3Matrix(e.insertTransform)}_writeXRecord(e){let t=[],i=l=>typeof l=="number"?l:typeof l=="bigint"?Number(l):l instanceof A?l.handle:0,s=l=>{t.push(l&255,l>>8&255)},a=l=>{t.push(l&255,l>>8&255,l>>16&255,l>>24&255)},n=l=>{let p=typeof l=="bigint"?l:BigInt(Math.trunc(l));p=BigInt.asUintN(64,p);for(let b=0;b<8;b++)t.push(Number(p>>BigInt(b*8)&0xffn))},o=l=>{let p=new ArrayBuffer(8);new DataView(p).setFloat64(0,l,!0);let b=new Uint8Array(p);for(let x=0;x<8;x++)t.push(b[x])};for(let l of e.entries){if(l.value==null)continue;let p=Ne.transformValue(l.code);if(!((p===f.ObjectId||p===f.ExtendedDataHandle)&&i(l.value)===0))switch(s(l.code),p){case f.Byte:case f.Bool:t.push(Number(l.value)&255);break;case f.Int16:case f.ExtendedDataInt16:s(Number(l.value));break;case f.Int32:case f.ExtendedDataInt32:a(Number(l.value));break;case f.Int64:n(Number(l.value));break;case f.Double:case f.ExtendedDataDouble:o(Number(l.value));break;case f.Point3D:{let b=l.value;o(b.x),o(b.y),o(b.z);break}case f.Chunk:case f.ExtendedDataChunk:{let b=l.value;t.push(b.length&255);for(let x=0;x>8&255);let s=this._encodeUtf16LE(t);for(let a=0;a>8&255);let a=q.getCodeIndex(q.getCodePage(this._writer.encoding));e.push(a);for(let n=0;n>>8&255}super.writeBytes(i)}writeTextUnicode(e){this.writeRawShort(e.length+1);let t=new Uint8Array(e.length*2);for(let i=0;i>>8&255}this.writeBytes(t),this.writeByte(0),this.writeByte(0)}};var jc=class extends _o{constructor(e,t){super(e,t)}writeObjectType(e){if(e<=255)this.write2Bits(0),this.writeByte(e&255);else if(e>=496&&e<=751)this.write2Bits(1),this.writeByte(e-496&255);else{this.write2Bits(2);let t=new Uint8Array(2);new DataView(t.buffer).setInt16(0,e,!0),this.writeBytes(t)}}};var Oc=class extends J{get sectionName(){return R.summaryInfo}get bytesWritten(){return Math.ceil(this._writer.positionInBits/8)}get writerStream(){return this._writer.main.stream}_writer;_writeStringMethod;_encoding;constructor(e,t,i){super(e),this._version=e,this._encoding=i,this._writer=Le.getStreamWriter(e,t,i),ethis._writeUnicodeString(s):this._writeStringMethod=s=>this._writer.writeTextUnicode(s)}write(e){this._writeStringMethod(e.title??""),this._writeStringMethod(e.subject??""),this._writeStringMethod(e.author??""),this._writeStringMethod(e.keywords??""),this._writeStringMethod(e.comments??""),this._writeStringMethod(e.lastSavedBy??""),this._writeStringMethod(e.revisionNumber??""),this._writeStringMethod(e.hyperlinkBase??""),this._writer.writeInt(0),this._writer.writeInt(0),this._writer.write8BitJulianDate(e.createdDate??new Date),this._writer.write8BitJulianDate(e.modifiedDate??new Date);let t=e.properties?.size??0;if(this._writer.writeRawShort(t),e.properties)for(let[i,s]of e.properties)this._writeStringMethod(i),this._writeStringMethod(s);this._writer.writeInt(0),this._writer.writeInt(0)}_writeUnicodeString(e){let t=ts(e??"",this._encoding);this._writer.writeRawShort(t.length+1),this._writer.writeBytes(t),this._writer.writeByte(0)}};var Ic=class extends Xs{};uo("AC12",po);uo("AC15",fo);uo("AC18",wo);uo("AC21",_o);uo("AC24",jc);Nd("MergedAC14",kc);Nd("Merged",ca);var ph=class r extends Gs{preview=null;get _version(){return this._document.header.version}_fileHeader;_fileHeaderWriter;_handlesMap=new Map;get bytesWritten(){return this._fileHeaderWriter?.bytesWritten??0}constructor(e,t){super(e,t),this._fileHeader=rs.createFileHeader(this._version)}createDefaultConfiguration(){return new Ic}write(){if(super.write(),this._versionthis.triggerNotification(s,a),t.write();let i=new Uint8Array(t.startWriterStream).slice(0,t.bytesWritten);this._fileHeaderWriter.addSection(R.header,i,!0)}_writeClasses(){let e=new Uint8Array(0),t=new Bc(e,this._document,this._encoding);t.write();let i=new Uint8Array(t.startWriterStream).slice(0,t.bytesWritten);this._fileHeaderWriter.addSection(R.classes,i,!0)}_writeSummaryInfo(){if(!(this._fileHeader.acadVersionthis.triggerNotification(i,s),t.write(),this._handlesMap=t.map,this._fileHeaderWriter.addSection(R.acDbObjects,t.getWrittenData(),!0)}_writeObjFreeSpace(){let e=new Uint8Array(53),t=new DataView(e.buffer),i=0;t.setInt32(i,0,!0),i+=4,t.setUint32(i,this._handlesMap.size,!0),i+=4;let s=this._version>=u.AC1015?this._document.header.universalUpdateDateTime:this._document.header.updateDateTime,{jdate:a,milliseconds:n}=q.dateToJulian(s);t.setInt32(i,a,!0),i+=4,t.setInt32(i,n,!0),i+=4,t.setUint32(i,0,!0),i+=4,e[i]=4,i+=1,t.setUint32(i,50,!0),i+=4,t.setUint32(i,0,!0),i+=4,t.setUint32(i,100,!0),i+=4,t.setUint32(i,0,!0),i+=4,t.setUint32(i,512,!0),i+=4,t.setUint32(i,0,!0),i+=4,t.setUint32(i,4294967295,!0),i+=4,t.setUint32(i,0,!0),i+=4,this._fileHeaderWriter.addSection(R.objFreeSpace,e,!0)}_writeTemplate(){let e=new Uint8Array(4),t=new DataView(e.buffer);t.setInt16(0,0,!0),t.setUint16(2,this._document.header.measurementUnits,!0),this._fileHeaderWriter.addSection(R.template,e,!0)}_writeHandles(){let t=new vc(this._version,this._handlesMap).write(this._fileHeaderWriter.handleSectionOffset);this._fileHeaderWriter.addSection(R.handles,t,!0)}_writeAuxHeader(){let e=new Uint8Array(4096),t=new Sc(e,this._encoding,this._document.header);t.write();let i=new Uint8Array(t.writerStream).slice(0,t.bytesWritten);this._fileHeaderWriter.addSection(R.auxHeader,i,!0)}};var fh;(function(r){r[r.AcDb_Unknown=0]="AcDb_Unknown",r[r.AcDb_Security=1241646314]="AcDb_Security",r[r.AcDb_FileDepList=1816266186]="AcDb_FileDepList",r[r.AcDb_VBAProject=1483605316]="AcDb_VBAProject",r[r.AcDb_AppInfo=1067451454]="AcDb_AppInfo",r[r.AcDb_Preview=1084884083]="AcDb_Preview",r[r.AcDb_SummaryInfo=1903822351]="AcDb_SummaryInfo",r[r.AcDb_RevHistory=1621231027]="AcDb_RevHistory",r[r.AcDb_AcDbObjects=1733035433]="AcDb_AcDbObjects",r[r.AcDb_ObjFreeSpace=2011301407]="AcDb_ObjFreeSpace",r[r.AcDb_Template=1242825934]="AcDb_Template",r[r.AcDb_Handles=1064174672]="AcDb_Handles",r[r.AcDb_Classes=1062470751]="AcDb_Classes",r[r.AcDb_AuxHeader=1425016074]="AcDb_AuxHeader",r[r.AcDb_Header=850920409]="AcDb_Header",r[r.AcDb_Signature=-1]="AcDb_Signature"})(fh||(fh={}));var Mc=class{entities=[];objects=[]};xr();var bo=class extends qa{configuration;get keepUnknownEntities(){return this.configuration.keepUnknownEntities}get keepUnknownNonGraphicalObjects(){return this.configuration.keepUnknownNonGraphicalObjects}modelSpaceEntities=new Set;modelSpaceTemplate=null;orphanTemplates=[];constructor(e,t,i){super(e,t),this.configuration=i}buildDocument(){if(this.modelSpaceTemplate===null){let e=U.modelSpace;this.blockRecords.add(e),this.modelSpaceTemplate=new ti(e),this.addTemplate(this.modelSpaceTemplate)}this.createMissingHandles();for(let e of this.modelSpaceEntities)this.modelSpaceTemplate.ownedObjectsHandlers.add(e.handle);this.registerTables(),this.buildTables(),this.buildDictionaries();for(let e of this.orphanTemplates)this._assignOwner(e);super.buildDocument(),this.configuration.createDefaults&&this.documentToBuild.createDefaults()}buildEntities(){let e=[];for(let t of this.cadObjectsTemplates.values())t instanceof O&&(t.build(this),t.setUnlinkedReferences());for(let t of this.cadObjectsTemplates.values())t instanceof O&&t.cadObject.owner===null&&(t.cadObject.handle=0,e.push(t.cadObject));return e}_assignOwner(e){if(e.cadObject.owner!==null||e.cadObject instanceof re||!e.ownerHandle)return;let t=this.tryGetObjectTemplate(e.ownerHandle);if(t){let i=t;i instanceof ti&&e.cadObject instanceof N||(i instanceof wr&&e.cadObject instanceof tt?i.ownedObjectsHandlers.add(e.cadObject.handle):i instanceof wr&&e.cadObject instanceof Se?i.seqendHandle=e.cadObject.handle:i instanceof ii&&e.cadObject instanceof zt?i.ownedObjectsHandlers.add(e.cadObject.handle):i instanceof ii&&e.cadObject instanceof Se?i.seqendHandle=e.cadObject.handle:this.notify(`Owner ${i.constructor.name} with handle ${e.ownerHandle} assignation not implemented for ${e.cadObject.constructor.name} with handle ${e.cadObject.handle}`,y.Warning))}else this.notify(`Owner ${e.ownerHandle} not found for ${e.constructor.name} with handle ${e.cadObject.handle}`,y.Warning)}};var ul=class extends Ja{clearCache=!0;createDefaults=!1};ie();T();var yo=class{encoding=Ss("ANSI_1252");dxfCode=w.Invalid;groupCodeValue=f.None;get code(){return this.dxfCode}value="";position=0;valueRaw="";get valueAsString(){return String(this.value).replace(/\^J/g,` `).replace(/\^M/g,"\r").replace(/\^I/g," ").replace(/\^ /g,"^")}get valueAsBool(){return!!this.value}get valueAsShort(){return Number(this.value)&65535}get valueAsUShort(){return(Number(this.value)&65535)>>>0}get valueAsInt(){return Number(this.value)|0}get valueAsLong(){return Number(this.value)}get valueAsDouble(){return Number(this.value)}get valueAsAngle(){return ae.degToRad(Number(this.value))}get valueAsHandle(){return Number(this.value)}get valueAsBinaryChunk(){return this.value}readNext(){this.dxfCode=this.readCode(),this.groupCodeValue=Ne.transformValue(this.code),this.value=this._transformValue(this.groupCodeValue),this.dxfCode===w.Comment&&this.readNext()}find(e){this.start();do this.readNext();while(this.valueAsString!==e&&this.valueAsString!==h.endOfFile);return this.valueAsString===e}expectedCode(e){if(this.readNext(),this.code!==e)throw new Bi(e,this.position)}toString(){return`${this.code} | ${this.value}`}start(){this.dxfCode=w.Invalid,this.value="",this._streamPosition=0,this.position=0}_streamPosition=0;decodeString(e){return au(e,this.encoding)}_transformValue(e){switch(e){case f.String:case f.Comment:case f.ExtendedDataString:return this.readStringLine();case f.Point3D:case f.Double:case f.ExtendedDataDouble:return this.lineAsDouble();case f.Byte:case f.Int16:case f.ExtendedDataInt16:return this.lineAsShort();case f.Int32:case f.ExtendedDataInt32:return this.lineAsInt();case f.Int64:return this.lineAsLong();case f.Handle:case f.ObjectId:case f.ExtendedDataHandle:return this.lineAsHandle();case f.Bool:return this.lineAsBool();case f.Chunk:case f.ExtendedDataChunk:return this.lineAsBinaryChunk();case f.None:default:throw new Bi(e,this.position)}}};ie();var Vc=class extends yo{get baseStream(){return this._data}_data;_bytePos=0;constructor(e){super(),this._data=e,this.start()}start(){super.start(),this._bytePos=0}readNext(){super.readNext(),this.position+=2}readStringLine(){let e=this._bytePos;for(;e0&&t[t.length-1]===13&&(t=t.subarray(0,t.length-1));let i=this.decodeString(t);return i=i.trim(),this.valueRaw=i,this.valueRaw}readCode(){let e=this.readStringLine(),t=parseInt(e,10);return isNaN(t)?(this.position++,w.Invalid):t}lineAsBool(){let e=this.readStringLine(),t=parseInt(e,10);return isNaN(t)?!1:t>0}lineAsDouble(){let e=this.readStringLine(),t=parseFloat(e);return isNaN(t)?0:t}lineAsShort(){let e=this.readStringLine(),t=parseInt(e,10);return isNaN(t)?0:t}lineAsInt(){let e=this.readStringLine(),t=parseInt(e,10);return isNaN(t)?0:t}lineAsLong(){let e=this.readStringLine(),t=parseInt(e,10);return isNaN(t)?0:t}lineAsHandle(){let e=this.readStringLine(),t=parseInt(e,16);return isNaN(t)?0:t}lineAsBinaryChunk(){let e=this.readStringLine(),t=[];for(let i=0;i0}lineAsDouble(){let e=this._view.getFloat64(this._pos,!0);return this._pos+=8,this.position=this._pos,e}lineAsShort(){let e=this._view.getInt16(this._pos,!0);return this._pos+=2,this.position=this._pos,e}lineAsInt(){let e=this._view.getInt32(this._pos,!0);return this._pos+=4,this.position=this._pos,e}lineAsLong(){let e=this._view.getUint32(this._pos,!0),t=this._view.getInt32(this._pos+4,!0);return this._pos+=8,this.position=this._pos,t*4294967296+e}lineAsHandle(){let e=this.readStringLine(),t=parseInt(e,16);return isNaN(t)?0:t}lineAsBinaryChunk(){let e=this._data[this._pos++],t=this._data.slice(this._pos,this._pos+e);return this._pos+=e,this.position=this._pos,t}};var Hc=class extends Es{constructor(e){super(e)}readCode(){let e=this._data[this._pos++];return e===255&&(e=this._view.getInt16(this._pos,!0),this._pos+=2),e}};D();B();var da=class r extends O{get vertex(){return this.cadObject}constructor(e){super(e??new r.VertexPlaceholder)}setVertexObject(e){e.handle=this.cadObject.handle,e.owner=this.cadObject.owner,e.xDictionary=this.cadObject.xDictionary,e.color=this.cadObject.color,e.lineWeight=this.cadObject.lineWeight,e.lineTypeScale=this.cadObject.lineTypeScale,e.isInvisible=this.cadObject.isInvisible,e.transparency=this.cadObject.transparency;let t=this.cadObject;e.location=t.location,e.startWidth=t.startWidth,e.endWidth=t.endWidth,e.bulge=t.bulge,e.flags=t.flags,e.curveTangent=t.curveTangent,e.id=t.id,this.cadObject=e}};(function(r){class e extends tt{get objectType(){return m.INVALID}get subclassMarker(){return d.polylineVertex}}r.VertexPlaceholder=e})(da||(da={}));ie();T();D();B();Aa();var _s=class{_reader;_builder;lockPointer=!1;currentSubclass=null;constructor(e,t){this._reader=e,this._builder=t}readCommonObjectData(e){if(e!==void 0){for(;this._reader.dxfCode!==w.Subclass;){switch(this._reader.code){case 0:break;case 5:e.cadObject.handle=this._reader.valueAsHandle;break;case 102:this._readDefinedGroups(e);break;case 330:e.ownerHandle=this._reader.valueAsHandle;break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} at line ${this._reader.position}.`,y.None);break}this._reader.readNext()}return}let t={name:null,handle:0,ownerHandle:null,xdictHandle:null,reactors:new Set};for((this._reader.dxfCode===w.Start||this._reader.dxfCode===w.Subclass)&&this._reader.readNext();this._reader.dxfCode!==w.Start&&this._reader.dxfCode!==w.Subclass;){switch(this._reader.code){case 2:t.name=this._reader.valueAsString;break;case 5:case 105:t.handle=this._reader.valueAsHandle;break;case 102:{let i=this._readDefinedGroupsRaw();t.xdictHandle=i.xdictHandle,t.reactors=i.reactors;break}case 330:t.ownerHandle=this._reader.valueAsHandle;break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} at line ${this._reader.position}.`);break}this._reader.readNext()}return t}readCommonCodes(e,t,i){switch(t.value=!1,this._reader.code){case 2:if("name"in e.cadObject){e.cadObject.name=this._reader.valueAsString;break}this._builder.notify(`[${this.currentSubclass}] Unhandled dxf code ${this._reader.code} with value ${this._reader.valueAsString}`,y.None);break;case 5:e.cadObject.handle=this._reader.valueAsHandle;break;case 100:this.currentSubclass=this._reader.valueAsString,i&&!i.subClasses.has(this._reader.valueAsString)&&this._builder.notify(`[${e.cadObject.objectName}] Unidentified subclass ${this._reader.valueAsString}`,y.Warning);break;case 102:this._readDefinedGroups(e);break;case 330:e.ownerHandle=this._reader.valueAsHandle;break;case 1001:t.value=!0,this.readExtendedData(e.eDataTemplateByAppName);break;default:this._builder.notify(`[${this.currentSubclass}] Unhandled dxf code ${this._reader.code} with value ${this._reader.valueAsString}`,y.None);break}}readEntity(){switch(this.currentSubclass="",this._reader.valueAsString){case h.entityAttribute:return this.readEntityCodes(new Zs(new zt),this._readAttributeDefinition.bind(this),zt);case h.entityAttributeDefinition:return this.readEntityCodes(new Zs(new nr),this._readAttributeDefinition.bind(this),nr);case h.entityArc:return this.readEntityCodes(new O(new We),this._readArc.bind(this),We);case h.entityBody:return this.readEntityCodes(new O(new gs),this._readEntitySubclassMap.bind(this),gs);case h.entityCircle:return this.readEntityCodes(new O(new Et),this._readCircle.bind(this),Et);case h.entityDimension:{let e=this.readEntityCodes(new ri,this._readDimension.bind(this),K);return e.cadObject instanceof on?(this._builder.notify(`[${h.entityDimension}] No subtype found, object discarded.`,y.Warning),null):e}case h.entity3DFace:return this.readEntityCodes(new O(new xi),this._readEntitySubclassMap.bind(this),xi);case h.entityEllipse:return this.readEntityCodes(new O(new bt),this._readEntitySubclassMap.bind(this),bt);case h.entityLeader:return this.readEntityCodes(new hn,this._readLeader.bind(this),zr);case h.entityLine:return this.readEntityCodes(new O(new Me),this._readEntitySubclassMap.bind(this),Me);case h.entityLwPolyline:return this.readEntityCodes(new O(new hr),this._readLwPolyline.bind(this),hr);case h.entityMesh:return this.readEntityCodes(new wn,this._readMesh.bind(this),$r);case h.entityHatch:return this.readEntityCodes(new ss,this.readHatch.bind(this),Kt);case h.entityInsert:return this.readEntityCodes(new ii,this._readInsert.bind(this),Ye);case h.entityMText:return this.readEntityCodes(new si(new ve),this._readTextEntity.bind(this),ve);case h.entityMLine:return this.readEntityCodes(new pn,this._readMLine.bind(this),Gr);case h.entityMultiLeader:return this.readEntityCodes(new un,this._readMLeader.bind(this),Xr);case h.entityPdfUnderlay:return this.readEntityCodes(new Vn(new Ci),this._readUnderlayEntity.bind(this),Ci);case h.entityPoint:return this.readEntityCodes(new O(new kt),this._readEntitySubclassMap.bind(this),kt);case h.entityPolyline:return this._readPolyline();case h.entityOle2Frame:return this.readEntityCodes(new _n,this._readOle2Frame.bind(this),Yr);case h.entityRay:return this.readEntityCodes(new O(new Di),this._readEntitySubclassMap.bind(this),Di);case h.endSequence:return this.readEntityCodes(new O(new Se),this._readEntitySubclassMap.bind(this),Se);case h.entityTrace:case h.entitySolid:return this.readEntityCodes(new O(new mr),this._readModelerGeometry.bind(this),mr);case h.entityTable:return this.readEntityCodes(new kn,this._readTableEntity.bind(this),es);case h.entityText:return this.readEntityCodes(new si(new at),this._readTextEntity.bind(this),at);case h.entityTolerance:return this.readEntityCodes(new xn(new pr),this._readTolerance.bind(this),pr);case h.entityVertex:return this.readEntityCodes(new da,this._readVertex.bind(this),N);case h.entityViewport:return this.readEntityCodes(new Tn,this._readViewport.bind(this),Ue);case h.entityShape:return this.readEntityCodes(new bn(new qr),this._readShape.bind(this),qr);case h.entitySpline:return this.readEntityCodes(new gn,this._readSpline.bind(this),Lt);case h.entity3DSolid:return this.readEntityCodes(new yn,this._readSolid3d.bind(this),Ki);case h.entityRegion:return this.readEntityCodes(new O(new Cs),this._readModelerGeometry.bind(this),Cs);case h.entityImage:return this.readEntityCodes(new Ba(new yi),this._readWipeoutBase.bind(this),yi);case h.entityWipeout:return this.readEntityCodes(new Ba(new Ts),this._readWipeoutBase.bind(this),Ts);case h.entityXline:return this.readEntityCodes(new O(new Si),this._readEntitySubclassMap.bind(this),Si);default:{let e=Ie.create(N),t=null,i=this._builder.documentToBuild.classes.tryGetByName(this._reader.valueAsString);i?(this._builder.notify(`Entity not supported read as an UnknownEntity: ${this._reader.valueAsString}`,y.NotImplemented),t=new Mn(new er(i))):this._builder.notify(`Entity not supported: ${this._reader.valueAsString}`,y.NotImplemented),this._reader.readNext();do{if(t!==null&&this._builder.keepUnknownEntities){let s={value:!1};if(this.readCommonEntityCodes(t,s,e),s.value)continue}this._reader.readNext()}while(this._reader.dxfCode!==w.Start);return t}}}readEntityCodes(e,t,i){this._reader.readNext();let s=Ie.create(typeof i=="string"?i:i.name);for(;this._reader.dxfCode!==w.Start;){if(!t(e,s)){let a={value:!1};if(this.readCommonEntityCodes(e,a,s),a.value)continue}if(this.lockPointer){this.lockPointer=!1;continue}this._reader.code!==w.Start&&this._reader.readNext()}return e}readCommonEntityCodes(e,t,i){switch(t.value=!1,this._reader.code){case 6:e.lineTypeName=this._reader.valueAsString;break;case 8:e.layerName=this._reader.valueAsString;break;case 67:break;case 92:case 160:case 310:break;case 347:e.materialHandle=this._reader.valueAsHandle;break;case 430:e.bookColorName=this._reader.valueAsString;break;default:this.tryAssignCurrentValue(e.cadObject,i.subClasses.get(d.entity))||this.readCommonCodes(e,t,i);break}}checkObjectEnd(e,t,i){return this._reader.dxfCode===w.Start?!0:i(e,t)}checkEntityEnd(e,t,i,s){return this._reader.dxfCode===w.Start?!0:s(e,t,i)}_readCircle(e,t,i){let s=e.cadObject;if(this._reader.code===40){let a=this._reader.valueAsDouble;return a<=0?s.radius=ae.epsilon:s.radius=a,!0}else return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.circle))}_readArc(e,t,i){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.arc))?!0:this._readCircle(e,t,d.circle)}}_readAttributeDefinition(e,t,i){let s=t.subClasses.get(e.cadObject.subclassMarker),a=e;switch(this._reader.code){case 44:case 46:return!0;case 101:{let n=a.cadObject;n.mText=new ve;let o=new si(n.mText);return a.mTextTemplate=o,this.readEntityCodes(o,this._readTextEntity.bind(this),ve),!0}default:return this.tryAssignCurrentValue(e.cadObject,s)?!0:this._readTextEntity(e,t,d.text)}}_readTableEntity(e,t,i){let s=i||e.cadObject.subclassMarker,a=e,n=a.cadObject;switch(this._reader.code){case 1:{let o;if(a.currentCell.content===null?(o=new Qi,o.cadValue.valueType=V.String,a.currentCell.contents.push(o)):o=a.currentCell.content,o.cadValue.value===null)o.cadValue.setValue(this._reader.valueAsString,V.String);else{let l=o.cadValue.value;l+=this._reader.valueAsString,o.cadValue.setValue(l,V.String)}return!0}case 2:{if(this.currentSubclass!==null&&this.currentSubclass.toUpperCase()===d.tableEntity.toUpperCase()){let o=a.currentCell.content;if(o.cadValue.value===null)o.cadValue.setValue(this._reader.valueAsString,V.String);else{let l=o.cadValue.value;l+=this._reader.valueAsString,o.cadValue.setValue(l,V.String)}}else a.blockName=this._reader.valueAsString;return!0}case 177:return!0;case 279:return a.currentCell.styleOverride.topBorder.lineWeight=this._reader.valueAsShort,!0;case 275:return a.currentCell.styleOverride.rightBorder.lineWeight=this._reader.valueAsShort,!0;case 276:return a.currentCell.styleOverride.bottomBorder.lineWeight=this._reader.valueAsShort,!0;case 278:return a.currentCell.styleOverride.leftBorder.lineWeight=this._reader.valueAsShort,!0;case 69:return a.currentCell.styleOverride.topBorder.color=new S(this._reader.valueAsShort),!0;case 65:return a.currentCell.styleOverride.rightBorder.color=new S(this._reader.valueAsShort),!0;case 66:return a.currentCell.styleOverride.bottomBorder.color=new S(this._reader.valueAsShort),!0;case 68:return a.currentCell.styleOverride.leftBorder.color=new S(this._reader.valueAsShort),!0;case 40:return a.horizontalMargin=this._reader.valueAsDouble,!0;case 63:return a.currentCell.styleOverride.backgroundColor=new S(this._reader.valueAsShort),!0;case 64:return a.currentCell.styleOverride.contentColor=new S(this._reader.valueAsShort),!0;case 140:return a.currentCellTemplate!==null&&(a.currentCellTemplate.formatTextHeight=this._reader.valueAsDouble),!0;case 283:return a.currentCell.styleOverride.isFillColorOn=this._reader.valueAsBool,!0;case 342:return a.styleHandle=this._reader.valueAsHandle,!0;case 343:return a.blockOwnerHandle=this._reader.valueAsHandle,!0;case 141:{let o=new zs;return o.height=this._reader.valueAsDouble,n.rows.push(o),!0}case 142:{let o=new Ws;return o.width=this._reader.valueAsDouble,n.columns.push(o),!0}case 144:return a.currentCellTemplate.formatTextHeight=this._reader.valueAsDouble,!0;case 145:return a.currentCell.rotation=this._reader.valueAsDouble,!0;case 170:return!0;case 171:return a.createCell(this._reader.valueAsInt),!0;case 172:return a.currentCell.edgeFlags=this._reader.valueAsShort,!0;case 173:return a.currentCell.mergedValue=this._reader.valueAsShort,!0;case 174:return a.currentCell.autoFit=this._reader.valueAsBool,!0;case 175:return a.currentCell.borderWidth=this._reader.valueAsInt,!0;case 176:return a.currentCell.borderHeight=this._reader.valueAsInt,!0;case 178:return a.currentCell.virtualEdgeFlag=this._reader.valueAsShort,!0;case 179:return!0;case 301:{let o=new Qi,l=new Ln(o);a.currentCell.contents.push(o);let p=this.readCadValue(o.cadValue);return l.cadValueTemplate=p,!0}case 340:return a.currentCellTemplate.valueHandle=this._reader.valueAsHandle,!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.insert))?!0:this._readEntitySubclassMap(e,t,d.tableEntity)}}readCadValue(e){this._reader.readNext();let t=new no(e),i=L.create(e.constructor,"CadValue");for(;this._reader.code!==304;){switch(this._reader.code){case 1:e.setValue(this._reader.valueAsString);break;case 2:e.setValue(e.value+this._reader.valueAsString);break;case 11:{let s=new c;s.x=this._reader.valueAsDouble,e.setValue(s);break}case 21:{let s=e.value;s[1]=this._reader.valueAsDouble,e.setValue(s);break}case 31:{let s=e.value,a=new c(s?.x??0,s?.y??0,this._reader.valueAsDouble);e.setValue(a);break}case 91:e.setValue(this._reader.valueAsInt);break;case 140:e.setValue(this._reader.valueAsDouble);break;case 330:t.valueHandle=this._reader.valueAsHandle;break;default:this.tryAssignCurrentValue(e,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCadValue method.`,y.None);break}this._reader.readNext()}return t}_readTextEntity(e,t,i){let s=i||e.cadObject.subclassMarker,a=e;switch(this._reader.code){case 1:case 3:return a.cadObject instanceof ve?(a.cadObject.value+=this._reader.valueAsString,!0):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s));case 50:if(a.cadObject instanceof ve){let n=this._reader.valueAsAngle;return a.cadObject.alignmentPoint=new c(Math.cos(n),Math.sin(n),0),!0}return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s));case 7:return a.styleName=this._reader.valueAsString,!0;case 101:return a.cadObject instanceof ve?(this._readColumnData(a.cadObject),this.lockPointer=!0,!0):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s));default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s))}}_readColumnData(e){for(this._reader.readNext();this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 70:break;case 71:e.columnData.columnType=this._reader.valueAsShort;break;case 72:e.columnData.columnCount=this._reader.valueAsInt;break;case 10:case 20:case 30:case 11:case 21:case 31:case 40:case 41:case 42:case 43:break;case 44:e.columnData.width=this._reader.valueAsDouble;break;case 45:e.columnData.gutter=this._reader.valueAsDouble;break;case 46:e.columnData.heights.push(this._reader.valueAsDouble);break;case 73:e.columnData.autoHeight=this._reader.valueAsBool;break;case 74:e.columnData.flowReversed=this._reader.valueAsBool;break;default:this._builder.notify(`[MText.ColumnData] unknown dxf code ${this._reader.code}.`,y.None);break}this._reader.readNext()}}_readTolerance(e,t,i){let s=e;return this._reader.code===3?(s.dimensionStyleName=this._reader.valueAsString,!0):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(e.cadObject.subclassMarker))}_readDimension(e,t,i){let s=e;switch(this._reader.code){case 2:return s.blockName=this._reader.valueAsString,!0;case 3:return s.styleName=this._reader.valueAsString,!0;case 50:{let a=new _t;return s.setDimensionObject(a),a.rotation=this._reader.valueAsAngle,t.subClasses.has(d.linearDimension)||t.subClasses.set(d.linearDimension,L.create(_t)),!0}case 70:{if(s.setDimensionFlags(this._reader.valueAsShort),s.cadObject instanceof on&&this._builder.version=0&&(o.color=S.fromTrueColor(l)),!0}case 470:return a.gradientColor.name=this._reader.valueAsString,!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(e.cadObject.subclassMarker))}}_readInsert(e,t,i){let s=e;switch(this._reader.code){case 2:return s.blockName=this._reader.valueAsString,!0;case 100:return!0;case 66:return!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.insert))}}_readPolyline(){if(this._builder.version===u.Unknown||this._builder.version===u.AC1009)return this._readLegacyPolyline();let e=new wr;if(this.readEntityCodes(e,this._readPolylineCodes.bind(this),N),e.cadObject.objectType===m.INVALID)return this._builder.notify(`[${h.entityPolyline}] Subclass not found, entity discarded`,y.Warning),null;for(;this._reader.code===0&&this._reader.valueAsString===h.entityVertex;){let t=this.readEntityCodes(new da,this._readVertex.bind(this),N);t.ownerHandle===null&&(t.ownerHandle=e.cadObject.handle),e.ownedObjectsHandlers.add(t.cadObject.handle),this._builder.addTemplate(t)}for(;this._reader.code===0&&this._reader.valueAsString===h.endSequence;){let t=new Se,i=new O(t);this.readEntityCodes(i,this._readEntitySubclassMap.bind(this),Se),i.ownerHandle===null&&(i.ownerHandle=e.cadObject.handle),e.ownedObjectsHandlers.add(i.cadObject.handle),this._builder.addTemplate(i)}return e}_readLegacyPolyline(){let e=new Ge,t=new wr(e);for(this.readEntityCodes(t,this._readPolylineCodes.bind(this),Ge);this._reader.code===0&&this._reader.valueAsString===h.entityVertex;){let i=new yt,s=new da(i);this.readEntityCodes(s,this._readVertex.bind(this),yt),s.vertex.handle===0?(i.owner=e,e.vertices.push(i)):(t.ownedObjectsHandlers.add(s.vertex.handle),this._builder.addTemplate(s))}for(;this._reader.code===0&&this._reader.valueAsString===h.endSequence;){let i=new Se,s=new O(i);this.readEntityCodes(s,this._readEntitySubclassMap.bind(this),Se),i.owner=e,e.vertices.seqend=i}return t}_readPolylineCodes(e,t,i){let s=e;switch(this._reader.code){case 10:case 20:case 66:return!0;case 100:switch(this._reader.valueAsString){case d.polyline:return s.setPolyLineObject(new Ge),t.subClasses.set(d.polyline,L.create(Ge)),!0;case d.polyline3d:return s.setPolyLineObject(new gt),t.subClasses.set(d.polyline3d,L.create(gt)),!0;case d.polyfaceMesh:return s.setPolyLineObject(new jt),t.subClasses.set(d.polyfaceMesh,L.create(jt)),!0;case d.polygonMesh:return s.setPolyLineObject(new Qt),t.subClasses.set(d.polygonMesh,L.create(Qt)),!0;default:return!1}default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s.cadObject.subclassMarker))}}_readLeader(e,t,i){let s=e;switch(this._reader.code){case 3:return s.dimstyleName=this._reader.valueAsString,!0;case 10:return s.cadObject.vertices.push(new c(this._reader.valueAsDouble,0,0)),!0;case 20:{let a=s.cadObject.vertices[s.cadObject.vertices.length-1];return a.y=this._reader.valueAsDouble,s.cadObject.vertices[s.cadObject.vertices.length-1]=a,!0}case 30:{let a=s.cadObject.vertices[s.cadObject.vertices.length-1];return a.z=this._reader.valueAsDouble,s.cadObject.vertices[s.cadObject.vertices.length-1]=a,!0}case 340:return s.annotationHandle=this._reader.valueAsHandle,!0;case 75:case 76:return!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s.cadObject.subclassMarker))}}_readLwPolyline(e,t,i){let s=e,a=s.cadObject,n=a.vertices[a.vertices.length-1]??null;switch(this._reader.code){case 10:return a.vertices.push(new Xi(new g(this._reader.valueAsDouble,0))),!0;case 20:return n!==null&&(n.location=new g(n.location.x,this._reader.valueAsDouble)),!0;case 40:return n!==null&&(n.startWidth=this._reader.valueAsDouble),!0;case 41:return n!==null&&(n.endWidth=this._reader.valueAsDouble),!0;case 42:return n!==null&&(n.bulge=this._reader.valueAsDouble),!0;case 50:return n!==null&&(n.curveTangent=this._reader.valueAsDouble),!0;case 66:case 90:return!0;case 91:return n!==null&&(n.id=this._reader.valueAsInt),!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(s.cadObject.subclassMarker))}}_readMesh(e,t,i){let s=e;switch(this._reader.code){case 100:return this._reader.valueAsString.toUpperCase()===d.mesh.toUpperCase()&&(s.subclassMarker=!0),!0;case 90:return!0;case 92:{if(!s.subclassMarker)return!1;let a=this._reader.valueAsInt;for(let n=0;n=w.ExtendedDataAsciiString;){if(this._reader.dxfCode===w.ExtendedDataRegAppName){this.readExtendedData(e);break}let i=null,s=0,a=0,n=0;switch(this._reader.dxfCode){case w.ExtendedDataAsciiString:i=new jr(this._reader.valueAsString);break;case w.ExtendedDataControlString:i=new Fe(this._reader.valueAsString==="}");break;case w.ExtendedDataLayerName:{let o=this._builder.layers.get(this._reader.valueAsString);o?i=new lo(o.handle):this._builder.notify(`[XData] Could not found the linked Layer ${this._reader.valueAsString}.`,y.Warning);break}case w.ExtendedDataBinaryChunk:i=new Er(this._reader.valueAsBinaryChunk);break;case w.ExtendedDataHandle:i=new Vi(this._reader.valueAsHandle);break;case w.ExtendedDataXCoordinate:s=this._reader.valueAsDouble,this._reader.readNext(),a=this._reader.valueAsDouble,this._reader.readNext(),n=this._reader.valueAsDouble,i=new kr(new c(s,a,n));break;case w.ExtendedDataWorldXCoordinate:s=this._reader.valueAsDouble,this._reader.readNext(),a=this._reader.valueAsDouble,this._reader.readNext(),n=this._reader.valueAsDouble,i=new ws(new c(s,a,n));break;case w.ExtendedDataWorldXDisp:s=this._reader.valueAsDouble,this._reader.readNext(),a=this._reader.valueAsDouble,this._reader.readNext(),n=this._reader.valueAsDouble,i=new us(new c(s,a,n));break;case w.ExtendedDataWorldXDir:s=this._reader.valueAsDouble,this._reader.readNext(),a=this._reader.valueAsDouble,this._reader.readNext(),n=this._reader.valueAsDouble,i=new fs(new c(s,a,n));break;case w.ExtendedDataReal:i=new Lr(this._reader.valueAsDouble);break;case w.ExtendedDataDist:i=new ms(this._reader.valueAsDouble);break;case w.ExtendedDataScale:i=new ps(this._reader.valueAsDouble);break;case w.ExtendedDataInteger16:i=new ot(this._reader.valueAsShort);break;case w.ExtendedDataInteger32:i=new Pr(this._reader.valueAsInt);break;default:this._builder.notify(`Unknown code for extended data: ${this._reader.dxfCode}`,y.Warning);break}i!==null&&t.push(i),this._reader.readNext()}}_readPattern(e,t){this._reader.readNext();for(let i=0;ie.reactorsHandles.add(s))}}_readDefinedGroupsRaw(){let e=null,t=new Set;switch(this._reader.valueAsString){case h.dictionaryToken:return this._reader.readNext(),e=this._reader.valueAsHandle,this._reader.readNext(),{xdictHandle:e,reactors:t};case h.reactorsToken:t=this._readReactors();break;case h.blkRefToken:default:do this._reader.readNext();while(this._reader.dxfCode!==w.ControlString);return{xdictHandle:e,reactors:t}}return{xdictHandle:e,reactors:t}}_readReactors(){let e=new Set;for(this._reader.readNext();this._reader.dxfCode!==w.ControlString;)e.add(this._reader.valueAsHandle),this._reader.readNext();return e}tryAssignCurrentValue(e,t){if(t instanceof Ie){if(!this.currentSubclass)return!1;let i=t.subClasses.get(this.currentSubclass);return i?this.tryAssignCurrentValue(e,i):!1}try{let i=t.dxfProperties.get(this._reader.code);if(i){if((i.referenceType&Qe.Count)!==0)return!0;if((i.referenceType&Qe.Handle)!==0||(i.referenceType&Qe.Name)!==0)return!1;let s=this._reader.value;return(i.referenceType&Qe.IsAngle)!==0&&(s=ae.degToRad(s)),i.setValue(this._reader.code,e,s),!0}}catch(i){if(this._builder.configuration.failsafe)this._builder.notify("An error occurred while assigning a property using mapper",y.Error,i instanceof Error?i:null);else throw i}return!1}};ie();T();D();var Fc=class extends _s{constructor(e,t){super(e,t)}read(){for(this._reader.readNext();this._reader.valueAsString!==h.endSection;){if(this._reader.valueAsString===h.tableEntry)this._readTable();else throw new Bi(`Unexpected token at the beginning of a table: ${this._reader.valueAsString}`,this._reader.position);if(this._reader.valueAsString===h.endTable)this._reader.readNext();else throw new Bi(`Unexpected token at the end of a table: ${this._reader.valueAsString}`,this._reader.position)}}_readTable(){this._reader.readNext();let e=0,t=null,i=new Map,s=this.readCommonObjectData(),{name:a,handle:n,ownerHandle:o,xdictHandle:l,reactors:p}=s;if(this._reader.dxfCode===w.Subclass)for(;this._reader.code!==w.Start;){switch(this._reader.code){case 70:e=this._reader.valueAsInt;break;case 100:if(this._reader.valueAsString===d.dimensionStyleTable){for(;this._reader.code!==w.Start;)this._reader.readNext();break}break;case 1001:this.readExtendedData(i);break;default:this._builder.notify(`[AcDbSymbolTable] Unhandled dxf code ${this._reader.code} at line ${this._reader.position}.`);break}if(this._reader.code===w.Start)break;this._reader.readNext()}else{if(this._reader.valueAsString===h.endTable)return;this._reader.readNext()}switch(a){case h.tableAppId:t=new rt(new Dr),this._readEntries(t),t.cadObject.handle=n,this._builder.appIds=t.cadObject;break;case h.tableBlockRecord:t=new nn(new Tr),this._readEntries(t),t.cadObject.handle=n,this._builder.blockRecords=t.cadObject;break;case h.tableVport:t=new rt(new vr),this._readEntries(t),t.cadObject.handle=n,this._builder.vPorts=t.cadObject;break;case h.tableLinetype:t=new rt(new Br),this._readEntries(t),t.cadObject.handle=n,this._builder.lineTypesTable=t.cadObject;break;case h.tableLayer:t=new rt(new Sr),this._readEntries(t),t.cadObject.handle=n,this._builder.layers=t.cadObject;break;case h.tableStyle:t=new rt(new Rr),this._readEntries(t),t.cadObject.handle=n,this._builder.textStyles=t.cadObject;break;case h.tableView:t=new rt(new Ar),this._readEntries(t),t.cadObject.handle=n,this._builder.views=t.cadObject;break;case h.tableUcs:t=new rt(new Nr),this._readEntries(t),t.cadObject.handle=n,this._builder.ucSs=t.cadObject;break;case h.tableDimstyle:t=new rt(new Wt),this._readEntries(t),t.cadObject.handle=n,this._builder.dimensionStyles=t.cadObject;break;default:throw new Bi(`Unknown table name ${a}`)}t.ownerHandle=o??null,t.xDictHandle=l,t.reactorsHandles=p,t.eDataTemplateByAppName=i,this._builder.addTemplate(t)}_readEntries(e){for(;this._reader.valueAsString!==h.endTable;){this._reader.readNext();let t=null;switch(e.cadObject.objectName){case h.tableAppId:t=this._readTableEntry(new xe(new Re),this._readAppId.bind(this));break;case h.tableBlockRecord:{let i=new ti;t=this._readTableEntry(i,this._readBlockRecord.bind(this)),i.cadObject.name.toUpperCase()===U.modelSpaceName.toUpperCase()&&(this._builder.modelSpaceTemplate=i);break}case h.tableDimstyle:t=this._readTableEntry(new ln,this._readDimensionStyle.bind(this));break;case h.tableLayer:t=this._readTableEntry(new cn,this._readLayer.bind(this));break;case h.tableLinetype:t=this._readTableEntry(new as,this._readLineType.bind(this));break;case h.tableStyle:t=this._readTableEntry(new xe(new oe),this._readTextStyle.bind(this));break;case h.tableUcs:t=this._readTableEntry(new Cn,this._readUcs.bind(this));break;case h.tableView:t=this._readTableEntry(new Dn,this._readView.bind(this));break;case h.tableVport:t=this._readTableEntry(new Sn,this._readVPort.bind(this));break;default:break}if(t!==null){let i=t.cadObject;e.cadObject.contains(t.name)&&this._builder.configuration.failsafe&&(this._builder.notify(`Duplicated entry with name ${t.name} found in ${t.cadObject.objectName}`,y.Warning),e.cadObject.remove(t.name)),e.cadObject.add(i),this._builder.addTemplate(t)}}}_readTableEntry(e,t){let i=Ie.create(e.cadObject.constructor);for(;this._reader.dxfCode!==w.Start;){if(!t(e,i.subClasses.get(e.cadObject.subclassMarker))){let s={value:!1};if(this._readCommonTableEntryCodes(e,s,i),s.value)continue}this._reader.code!==w.Start&&this._reader.readNext()}return e}_readCommonTableEntryCodes(e,t,i){switch(t.value=!1,this._reader.code){case 2:{let s=this._reader.valueAsString||(e.cadObject instanceof nt?nt.defaultName:"");e.cadObject.name=s;break}case 70:e.cadObject.flags=this._reader.valueAsUShort;break;case 100:break;default:this.readCommonCodes(e,t,i);break}}_readAppId(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t)}}_readBlockRecord(e,t){return this._reader.code===340?(e.layoutHandle=this._reader.valueAsHandle,!0):this.tryAssignCurrentValue(e.cadObject,t)}_readDimensionStyle(e,t){let i=e.cadObject;switch(this._reader.code){case 3:return i.postFix=this._reader.valueAsString,!0;case 4:return i.alternateDimensioningSuffix=this._reader.valueAsString,!0;case 5:return e.dimbL_Name=this._reader.valueAsString,!0;case 6:return e.dimblK1_Name=this._reader.valueAsString,!0;case 7:return e.dimblK2_Name=this._reader.valueAsString,!0;case 40:try{i.scaleFactor=this._reader.valueAsDouble}catch(s){i.scaleFactor=ae.epsilon,this._builder.notify(`[${i.subclassMarker}] Assignation error for scaleFactor.`,y.Warning,s instanceof Error?s:null)}return!0;case 41:try{i.arrowSize=this._reader.valueAsDouble}catch(s){this._builder.notify(`[${i.subclassMarker}] Assignation error for arrowSize.`,y.Warning,s instanceof Error?s:null)}return!0;case 42:return i.extensionLineOffset=this._reader.valueAsDouble,!0;case 43:return i.dimensionLineIncrement=this._reader.valueAsDouble,!0;case 44:return i.extensionLineExtension=this._reader.valueAsDouble,!0;case 45:return i.rounding=this._reader.valueAsDouble,!0;case 46:return i.dimensionLineExtension=this._reader.valueAsDouble,!0;case 47:return i.plusTolerance=this._reader.valueAsDouble,!0;case 48:return i.minusTolerance=this._reader.valueAsDouble,!0;case 49:return i.fixedExtensionLineLength=this._reader.valueAsDouble,!0;case 50:try{i.joggedRadiusDimensionTransverseSegmentAngle=this._reader.valueAsAngle}catch(s){this._builder.notify(`[${i.subclassMarker}] Assignation error for joggedRadiusDimensionTransverseSegmentAngle.`,y.Warning,s instanceof Error?s:null)}return!0;case 69:return i.textBackgroundFillMode=this._reader.valueAsShort,!0;case 70:if(e.dxfFlagsAssigned)this._reader.valueAsShort>=0&&(i.textBackgroundColor=new S(this._reader.valueAsShort));else return e.dxfFlagsAssigned=!0,!0;return!0;case 71:return i.generateTolerances=this._reader.valueAsBool,!0;case 72:return i.limitsGeneration=this._reader.valueAsBool,!0;case 73:return i.textInsideHorizontal=this._reader.valueAsBool,!0;case 74:return i.textOutsideHorizontal=this._reader.valueAsBool,!0;case 75:return i.suppressFirstExtensionLine=this._reader.valueAsBool,!0;case 76:return i.suppressSecondExtensionLine=this._reader.valueAsBool,!0;case 77:return i.textVerticalAlignment=this._reader.valueAsShort,!0;case 78:return i.zeroHandling=this._reader.valueAsShort,!0;case 79:return i.angularZeroHandling=this._reader.valueAsShort,!0;case 90:return i.arcLengthSymbolPosition=this._reader.valueAsShort,!0;case 105:return i.handle=this._reader.valueAsHandle,!0;case 140:try{i.textHeight=this._reader.valueAsDouble}catch(s){this._builder.notify(`[${i.subclassMarker}] Assignation error for textHeight.`,y.Warning,s instanceof Error?s:null)}return!0;case 141:return i.centerMarkSize=this._reader.valueAsDouble,!0;case 142:return i.tickSize=this._reader.valueAsDouble,!0;case 143:return i.alternateUnitScaleFactor=this._reader.valueAsDouble,!0;case 144:return i.linearScaleFactor=this._reader.valueAsDouble,!0;case 145:return i.textVerticalPosition=this._reader.valueAsDouble,!0;case 146:return i.toleranceScaleFactor=this._reader.valueAsDouble,!0;case 147:return i.dimensionLineGap=this._reader.valueAsDouble,!0;case 148:return i.alternateUnitRounding=this._reader.valueAsDouble,!0;case 170:return i.alternateUnitDimensioning=this._reader.valueAsBool,!0;case 171:return i.alternateUnitDecimalPlaces=this._reader.valueAsShort,!0;case 172:return i.textOutsideExtensions=this._reader.valueAsBool,!0;case 173:return i.separateArrowBlocks=this._reader.valueAsBool,!0;case 174:return i.textInsideExtensions=this._reader.valueAsBool,!0;case 175:return i.suppressOutsideExtensions=this._reader.valueAsBool,!0;case 176:return i.dimensionLineColor=new S(this._reader.valueAsShort),!0;case 177:return i.extensionLineColor=new S(this._reader.valueAsShort),!0;case 178:return i.textColor=new S(this._reader.valueAsShort),!0;case 179:return i.angularDecimalPlaces=this._reader.valueAsShort,!0;case 270:return i.linearUnitFormat=this._reader.valueAsShort,!0;case 271:return i.decimalPlaces=this._reader.valueAsShort,!0;case 272:return i.toleranceDecimalPlaces=this._reader.valueAsShort,!0;case 273:return i.alternateUnitFormat=this._reader.valueAsShort,!0;case 274:return i.alternateUnitToleranceDecimalPlaces=this._reader.valueAsShort,!0;case 275:return i.angularUnit=this._reader.valueAsShort,!0;case 276:return i.fractionFormat=this._reader.valueAsShort,!0;case 277:return i.linearUnitFormat=this._reader.valueAsShort,!0;case 278:return i.decimalSeparator=String.fromCharCode(this._reader.valueAsShort),!0;case 279:return i.textMovement=this._reader.valueAsShort,!0;case 280:return i.textHorizontalAlignment=this._reader.valueAsShort,!0;case 281:return i.suppressFirstDimensionLine=this._reader.valueAsBool,!0;case 282:return i.suppressSecondDimensionLine=this._reader.valueAsBool,!0;case 283:return i.toleranceAlignment=this._reader.valueAsShort,!0;case 284:return i.toleranceZeroHandling=this._reader.valueAsShort,!0;case 285:return i.alternateUnitZeroHandling=this._reader.valueAsShort,!0;case 286:return i.alternateUnitToleranceZeroHandling=this._reader.valueAsShort,!0;case 287:return i.dimensionFit=this._reader.valueAsShort,!0;case 288:return i.cursorUpdate=this._reader.valueAsBool,!0;case 289:return i.dimensionTextArrowFit=this._reader.valueAsShort,!0;case 290:return i.isExtensionLineLengthFixed=this._reader.valueAsBool,!0;case 340:return e.textStyleHandle=this._reader.valueAsHandle,!0;case 341:return e.dimldrblk=this._reader.valueAsHandle,!0;case 342:return e.dimblk=this._reader.valueAsHandle,!0;case 343:return e.dimblk1=this._reader.valueAsHandle,!0;case 344:return e.dimblk2=this._reader.valueAsHandle,!0;case 345:return e.dimltype=this._reader.valueAsHandle,!0;case 346:return e.dimltex1=this._reader.valueAsHandle,!0;case 347:return e.dimltex2=this._reader.valueAsHandle,!0;case 371:return i.dimensionLineWeight=this._reader.valueAsShort,!0;case 372:return i.extensionLineWeight=this._reader.valueAsShort,!0;default:return!1}}_readLayer(e,t){let i=e.cadObject;switch(this._reader.code){case 6:return e.lineTypeName=this._reader.valueAsString,!0;case 62:{let s=this._reader.valueAsShort;s<0&&(i.isOn=!1,s=Math.abs(s));let a=new S(s);return a.isByBlock||a.isByLayer?this._builder.notify(`Wrong index ${s} for layer ${i.name}`,y.Warning):i.color=new S(s),!0}case 347:return e.materialHandle=this._reader.valueAsHandle,!0;case 348:return!0;case 390:return i.plotStyleName=this._reader.valueAsHandle,!0;case 430:return e.trueColorName=this._reader.valueAsString,!0;default:return this.tryAssignCurrentValue(e.cadObject,t)}}_readLineType(e,t){switch(this._reader.code){case 40:return e.totalLen=this._reader.valueAsDouble,!0;case 49:do e.segmentTemplates.push(this._readLineTypeSegment());while(this._reader.code===49);return!0;case 73:return!0;default:return this.tryAssignCurrentValue(e.cadObject,t)}}_readLineTypeSegment(){let e=new as.SegmentTemplate;for(e.segment.length=this._reader.valueAsDouble,this._reader.readNext();this._reader.code!==49&&this._reader.code!==0;){switch(this._reader.code){case 9:e.segment.text=this._reader.valueAsString;break;case 44:e.segment.offset=new g(this._reader.valueAsDouble,e.segment.offset.y);break;case 45:e.segment.offset=new g(e.segment.offset.x,this._reader.valueAsDouble);break;case 46:e.segment.scale=this._reader.valueAsDouble;break;case 50:e.segment.rotation=this._reader.valueAsAngle;break;case 74:e.segment.shapeFlags=this._reader.valueAsUShort;break;case 75:e.segment.shapeNumber=this._reader.valueAsInt;break;case 340:break;default:this._builder.notify(`[LineTypeSegment] Unhandled dxf code ${this._reader.code} with value ${this._reader.valueAsString}, position ${this._reader.position}`,y.None);break}this._reader.readNext()}return e}_readTextStyle(e,t){return this._reader.code===2?(this._reader.valueAsString&&(e.cadObject.name=this._reader.valueAsString),!0):this.tryAssignCurrentValue(e.cadObject,t)}_readUcs(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t)}}_readView(e,t){return this._reader.code===348?(e.visualStyleHandle=this._reader.valueAsHandle,!0):this.tryAssignCurrentValue(e.cadObject,t)}_readVPort(e,t){switch(this._reader.code){case 65:case 73:return!0;case 348:return e.styleHandle=this._reader.valueAsHandle,!0;default:return this.tryAssignCurrentValue(e.cadObject,t)}}};ie();T();D();var Uc=class extends O{ownedObjectsHandlers=new Set;constructor(e){super(e)}};var Wc=class extends _s{constructor(e,t){super(e,t)}read(){for(this._reader.readNext();this._reader.valueAsString!==h.endSection;)try{if(this._reader.valueAsString===h.block)this._readBlock();else throw new Bi(`Unexpected token at the BLOCKS table: ${this._reader.valueAsString}`,this._reader.position)}catch(e){if(!this._builder.configuration.failsafe)throw e;for(this._builder.notify(`Error while reading a block at line ${this._reader.position}`,y.Error,e instanceof Error?e:void 0);!(this._reader.dxfCode===w.Start&&this._reader.valueAsString===h.endSection)&&!(this._reader.dxfCode===w.Start&&this._reader.valueAsString===h.block);)this._reader.readNext()}}_readBlock(){this._reader.readNext();let e=Ie.create(fi),t=new fi,i=new Uc(t),s=null,a=null,n=null;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 2:case 3:s=this._reader.valueAsString,s.toUpperCase()==="$MODEL_SPACE"?s=U.modelSpaceName:s.toUpperCase()==="$PAPER_SPACE"&&(s=U.paperSpaceName),a===null&&(a=this._builder.tryGetTableEntry(s),a?a.blockEntity=t:this._builder.notify(`Block record [${s}] not found at line ${this._reader.position}`,y.Warning));break;case 330:a===null&&(a=this._builder.tryGetCadObject(this._reader.valueAsHandle),a?a.blockEntity=t:this._builder.notify(`Block record with handle [${this._reader.valueAsString}] not found at line ${this._reader.position}`,y.Warning));break;default:if(!this.tryAssignCurrentValue(i.cadObject,e.subClasses.get(d.blockBegin))){let o={value:!1};if(this.readCommonEntityCodes(i,o,e),o.value)continue}break}this._reader.readNext()}for(a===null?(a=new U(s??""),a.blockEntity=t,n=new ti(a),this._builder.addTemplate(n),this._builder.blockRecords.add(a),n.cadObject.name.toUpperCase()===U.modelSpaceName.toUpperCase()&&(this._builder.modelSpaceTemplate=n)):(n=this._builder.tryGetObjectTemplate(a.handle),n||(n=new ti(a))),n.blockEntityTemplate=i;this._reader.valueAsString!==h.endBlock;){let o=null;try{o=this.readEntity()}catch(l){if(!this._builder.configuration.failsafe)throw l;for(this._builder.notify(`Error while reading a block with name ${a.name} at line ${this._reader.position}`,y.Error,l instanceof Error?l:void 0);this._reader.dxfCode!==w.Start;)this._reader.readNext()}if(o!==null)if(this._builder.addTemplate(o),o.ownerHandle===null)n.referenceTemplates.add(o);else{let l=this._builder.tryGetObjectTemplate(o.ownerHandle);l?l.ownedObjectsHandlers.add(o.cadObject.handle):this._builder.orphanTemplates.push(o)}}this._readBlockEnd(a.blockEnd),this._builder.addTemplate(i)}_readBlockEnd(e){let t=Ie.create(Ps),i=new O(e);for(this._reader.dxfCode===w.Start&&this._reader.readNext();this._reader.dxfCode!==w.Start;){if(!this.tryAssignCurrentValue(i.cadObject,t.subClasses.get(d.blockEnd))){let s={value:!1};if(this.readCommonEntityCodes(i,s,t),s.value)continue}this._reader.readNext()}this._builder.addTemplate(i)}};ie();T();var zc=class extends _s{constructor(e,t){super(e,t)}read(){for(this._reader.readNext();this._reader.valueAsString!==h.endSection;){let e=null;try{e=this.readEntity()}catch(i){if(!this._builder.configuration.failsafe)throw i;for(this._builder.notify(`Error while reading an entity at line ${this._reader.position}`,y.Error,i instanceof Error?i:void 0);this._reader.dxfCode!==w.Start;)this._reader.readNext()}if(e===null)continue;this._builder.addTemplate(e);let t=this._builder.tryGetObjectTemplate(e.ownerHandle);e.ownerHandle===null?this._builder.modelSpaceEntities.add(e.cadObject):t?t.ownedObjectsHandlers.add(e.cadObject.handle):this._builder.orphanTemplates.push(e)}}};De();T();D();B();te();D();var Ad=class extends M{get subclassMarker(){return d.linkedData}description=""},vd=class extends Ad{get subclassMarker(){return d.linkedTableData}rows=[];columns=[]},$c=class extends vd{get subclassMarker(){return d.formattedTableData}mergedCellRanges=[];cellStyleOverride=new xt};var ml=class extends $c{get objectType(){return m.UNLISTED}get objectName(){return h.objectTableContent}get subclassMarker(){return d.tableContent}style=null;styleOverride=null};var Gc=class extends Y{sytleHandle=0;constructor(e){super(e??new ml)}};var Xc=class extends ee{hasFrontPlane=!1;insertTransformRead=!1;constructor(e){super(e??new br)}};var Yc=class extends ei{entries=[];constructor(e){super(e??new ci)}};xr();ie();T();D();var Zc=class extends _s{constructor(e,t){super(e,t)}read(){for(this._reader.readNext();this._reader.valueAsString!==h.endSection;){let e=null;try{e=this._readObject()}catch(t){if(!this._builder.configuration.failsafe)throw t;for(this._builder.notify(`Error while reading an object at line ${this._reader.position}`,y.Error,t instanceof Error?t:null);this._reader.dxfCode!==w.Start;)this._reader.readNext()}e!==null&&this._builder.addTemplate(e)}}_readObject(){switch(this.currentSubclass="",this._reader.valueAsString){case h.blkRefObjectContextData:return this.readObjectCodes(new ns(new ki),this._readAnnotScaleObjectContextData.bind(this),ki);case h.mTextAttributeObjectContextData:return this.readObjectCodes(new ns(new Pi),this._readAnnotScaleObjectContextData.bind(this),Pi);case h.objectPlaceholder:return this.readObjectCodes(new ee(new vi),this._readObjectSubclassMap.bind(this),vi);case h.objectDBColor:return this.readObjectCodes(new ee(new Ei),this._readBookColor.bind(this),Ei);case h.objectDimensionAssociation:return this.readObjectCodes(new cs,this._readDimensionAssociation.bind(this),Dt);case h.objectDictionary:return this.readObjectCodes(new qs,this._readDictionary.bind(this),re);case h.objectDictionaryWithDefault:return this.readObjectCodes(new Bn,this._readDictionaryWithDefault.bind(this),ai);case h.objectLayout:return this.readObjectCodes(new dn,this._readLayout.bind(this),ke);case h.objectPlotSettings:return this.readObjectCodes(new ee(new Bt),this._readPlotSettings.bind(this),Bt);case h.objectEvalGraph:return this.readObjectCodes(new ds,this._readEvaluationGraph.bind(this),Vt);case h.objectImageDefinition:return this.readObjectCodes(new ee(new oi),this._readObjectSubclassMap.bind(this),oi);case h.objectDictionaryVar:return this.readObjectCodes(new ee(new Ke),this._readObjectSubclassMap.bind(this),Ke);case h.objectPdfDefinition:return this.readObjectCodes(new ee(new Ai),this._readObjectSubclassMap.bind(this),Ai);case h.objectSortEntsTable:return this._readSortentsTable();case h.objectImageDefinitionReactor:return this.readObjectCodes(new ee(new Ut),this._readObjectSubclassMap.bind(this),Ut);case h.objectProxyObject:return this.readObjectCodes(new Yc,this._readProxyObject.bind(this),ci);case h.objectRasterVariables:return this.readObjectCodes(new ee(new li),this._readObjectSubclassMap.bind(this),li);case h.objectGroup:return this.readObjectCodes(new vn,this._readGroup.bind(this),Ft);case h.objectGeoData:return this.readObjectCodes(new An,this._readGeoData.bind(this),_r);case h.objectMaterial:return this.readObjectCodes(new fn,this._readMaterial.bind(this),ft);case h.objectScale:return this.readObjectCodes(new ee(new lt),this._readScale.bind(this),lt);case h.objectTableContent:return this.readObjectCodes(new Gc,this._readTableContent.bind(this),ml);case h.objectVisualStyle:return this.readObjectCodes(new ee(new Ni),this._readVisualStyle.bind(this),Ni);case h.objectSpatialFilter:return this.readObjectCodes(new Xc,this._readSpatialFilter.bind(this),br);case h.objectMLineStyle:return this.readObjectCodes(new os,this._readMLineStyle.bind(this),At);case h.objectMLeaderStyle:return this.readObjectCodes(new mn,this._readMLeaderStyle.bind(this),ct);case h.objectTableStyle:return this.readObjectCodes(new jn,this._readTableStyle.bind(this),dt);case h.objectXRecord:return this.readObjectCodes(new On,this._readXRecord.bind(this),Mt);case h.objectBlockRepresentationData:return this.readObjectCodes(new Kn,this._readBlockRepresentationData.bind(this),ni);case h.objectBlockGripLocationComponent:return this.readObjectCodes(new io,this._readBlockGripExpression.bind(this),sa);case h.objectBlockVisibilityGrip:return this.readObjectCodes(new ro,this._readBlockVisibilityGrip.bind(this),to);case h.objectBlockVisibilityParameter:return this.readObjectCodes(new hs,this._readBlockVisibilityParameter.bind(this),ta);case h.objectBlockRotationParameter:return this.readObjectCodes(new Gn,this._readBlockRotationParameter.bind(this),ea);case h.objectBlockRotationGrip:return this.readObjectCodes(new eo,this._readBlockRotationGrip.bind(this),Jn);case h.objectBlockRotateAction:return this.readObjectCodes(new qn,this._readBlockRotationAction.bind(this),ra);case h.objectField:return this.readObjectCodes(new so(new Li),this._readField.bind(this),Li);case h.objectFieldList:return this.readObjectCodes(new ao(new ji),this._readFieldList.bind(this),ji);default:{let e=Ie.create(A),t=null,i=this._builder.documentToBuild.classes.tryGetByName(this._reader.valueAsString);i?(this._builder.notify(`NonGraphicalObject not supported read as an UnknownNonGraphicalObject: ${this._reader.valueAsString}`,y.NotImplemented),t=new In(new Kr(i))):this._builder.notify(`UnknownNonGraphicalObject not supported: ${this._reader.valueAsString}`,y.NotImplemented),this._reader.readNext();do{if(t!==null&&this._builder.keepUnknownEntities){let s={value:!1};if(this.readCommonCodes(t,s,e),s.value)continue}this._reader.readNext()}while(this._reader.dxfCode!==w.Start);return t}}}readObjectCodes(e,t,i){this._reader.readNext();let s=this.readCommonObjectData();e.cadObject.handle=s.handle,e.ownerHandle=s.ownerHandle,e.xDictHandle=s.xdictHandle,e.reactorsHandles=s.reactors;let a=e.cadObject;s.name&&"name"in a&&(a.name=s.name);let n=Ie.create(typeof i=="string"?i:i.name);for(;this._reader.dxfCode!==w.Start;){if(!t(e,n)){let o={value:!1};if(this.readCommonCodes(e,o,n),o.value)continue}if(this.lockPointer){this.lockPointer=!1;continue}this._reader.code!==w.Start&&this._reader.readNext()}return e}_readFieldList(e,t){let i=e;switch(this._reader.code){case 100:return this._reader.valueAsString===d.idSet?(this.currentSubclass=this._reader.valueAsString,!0):!1;case 90:return this.currentSubclass===d.idSet;case 330:return this.currentSubclass===d.idSet?(i.ownedObjectsHandlers.add(this._reader.valueAsHandle),!0):!1;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.fieldList))}}_readField(e,t){let i=e;switch(this._reader.code){case 3:return i.cadObject.fieldCode+=this._reader.valueAsString,!0;case 98:return!0;case 6:{let s=this._reader.valueAsString,a=this.readCadValue(new vt);return i.cadObject.values.set(s,a.cadValue),i.cadValueTemplates.push(a),!0}case 7:{let s=this.readCadValue(new vt);return i.cadObject.value=s.cadValue,i.cadValueTemplates.push(s),!0}case 331:return i.cadObjectsHandles.push(this._reader.valueAsHandle),!0;case 360:return i.childrenHandles.push(this._reader.valueAsHandle),!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.field))}}_readProxyObject(e,t){let i=e,s=e.cadObject;switch(this._reader.code){case 90:case 94:case 97:case 71:return!0;case 95:{let a=this._reader.valueAsInt;return s.version=a&65535,s.maintenanceVersion=a>>16,!0}case 91:{let a=this._reader.valueAsShort,n=this._builder.documentToBuild.classes.tryGetByClassNumber(a);return n.found&&n.result&&(s.dxfClass=n.result),!0}case 161:case 162:return!0;case 310:return s.binaryData===null&&(s.binaryData=new Uint8Array(0)),s.binaryData=this._appendBinaryChunk(s.binaryData,this._reader.valueAsBinaryChunk),!0;case 311:return s.data===null&&(s.data=new Uint8Array(0)),s.data=this._appendBinaryChunk(s.data,this._reader.valueAsBinaryChunk),!0;case 330:case 340:case 350:case 360:return i.entries.push(this._reader.valueAsHandle),!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.proxyObject))}}_readObjectSubclassMap(e,t){switch(this._reader.code){default:return this.currentSubclass?this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(this.currentSubclass)):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(e.cadObject.subclassMarker))}}_readAnnotScaleObjectContextData(e,t){let i=e;return this._reader.code===340?(i.scaleHandle=this._reader.valueAsHandle,!0):this.currentSubclass?this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(this.currentSubclass)):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(e.cadObject.subclassMarker))}_readPlotSettings(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.plotSettings))}}_readEvaluationGraph(e,t){let i=e,s=i.cadObject;switch(this._reader.code){case 91:for(;this._reader.code===91;){let a=new ds.GraphNodeTemplate,n=a.node;n.index=this._reader.valueAsInt,this._reader.expectedCode(93),n.flags=this._reader.valueAsInt,this._reader.expectedCode(95),n.nextNodeIndex=this._reader.valueAsInt,this._reader.expectedCode(360),a.expressionHandle=this._reader.valueAsHandle,this._reader.expectedCode(92),n.data1=this._reader.valueAsInt,this._reader.expectedCode(92),n.data2=this._reader.valueAsInt,this._reader.expectedCode(92),n.data3=this._reader.valueAsInt,this._reader.expectedCode(92),n.data4=this._reader.valueAsInt,this._reader.readNext(),i.nodeTemplates.push(a)}return this.lockPointer=!0,!0;case 92:for(;this._reader.code===92;)this._reader.expectedCode(93),this._reader.expectedCode(94),this._reader.expectedCode(91),this._reader.expectedCode(91),this._reader.expectedCode(92),this._reader.expectedCode(92),this._reader.expectedCode(92),this._reader.expectedCode(92),this._reader.expectedCode(92),this._reader.readNext();return this.lockPointer=!0,!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.evalGraph))}}_readLayout(e,t){let i=e;switch(this._reader.code){case 330:return e.ownerHandle!==null?(i.paperSpaceBlockHandle=this._reader.valueAsHandle,!0):!1;case 331:return i.lasActiveViewportHandle=this._reader.valueAsHandle,!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.layout))?!0:this._readPlotSettings(e,t)}}_readGroup(e,t){let i=e;switch(this._reader.code){case 70:return!0;case 340:return i.handles.add(this._reader.valueAsHandle),!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(e.cadObject.subclassMarker))}}_readGeoData(e,t){let i=e;switch(this._reader.code){case 40:return i.cadObject.version===qe.R2009?(i.cadObject.referencePoint=new c(i.cadObject.referencePoint.x,this._reader.valueAsDouble,i.cadObject.referencePoint.z),!0):!1;case 41:return i.cadObject.version===qe.R2009?(i.cadObject.referencePoint=new c(this._reader.valueAsDouble,i.cadObject.referencePoint.y,i.cadObject.referencePoint.z),!0):!1;case 42:return i.cadObject.version===qe.R2009?(i.cadObject.referencePoint=new c(i.cadObject.referencePoint.x,i.cadObject.referencePoint.y,this._reader.valueAsDouble),!0):!1;case 46:return i.cadObject.version===qe.R2009?(i.cadObject.horizontalUnitScale=this._reader.valueAsDouble,!0):!1;case 52:if(i.cadObject.version===qe.R2009){let s=Math.PI/2-this._reader.valueAsAngle;return i.cadObject.northDirection=new g(Math.cos(s),Math.sin(s)),!0}return!1;case 93:{let s=this._reader.valueAsInt;for(let a=0;a{let o=[];for(let l=0;l<16;l++)o.push(this._reader.valueAsDouble),this._reader.readNext();return n(o),this.checkObjectEnd(e,t,this._readMaterial.bind(this))};switch(this._reader.code){case 43:return s(43,a=>i.cadObject.diffuseMatrix=a);case 47:return s(47,a=>i.cadObject.specularMatrix=a);case 49:return s(49,a=>i.cadObject.reflectionMatrix=a);case 142:return s(142,a=>i.cadObject.opacityMatrix=a);case 144:return s(144,a=>i.cadObject.bumpMatrix=a);case 147:return s(147,a=>i.cadObject.refractionMatrix=a);default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(i.cadObject.subclassMarker))}}_readScale(e,t){return this._reader.code===70?!0:this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.scale))}_readLinkedData(e,t){let s=e.cadObject;for(this._reader.readNext();this._reader.dxfCode!==w.Start&&this._reader.dxfCode!==w.Subclass;){switch(this._reader.code){default:this.tryAssignCurrentValue(s,t.subClasses.get(d.linkedData))||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedData ${this._reader.position}.`,y.None);break}this._reader.readNext()}}_readTableContent(e,t){return this._reader.code===100?this._reader.valueAsString.toUpperCase()===d.tableContent.toUpperCase()?(this._readTableContentSubclass(e,t),this.lockPointer=!0,!0):this._reader.valueAsString.toUpperCase()===d.formattedTableData.toUpperCase()?(this._readFormattedTableDataSubclass(e,t),this.lockPointer=!0,!0):this._reader.valueAsString.toUpperCase()===d.linkedTableData.toUpperCase()?(this._readLinkedTableDataSubclass(e,t),this.lockPointer=!0,!0):this._reader.valueAsString.toUpperCase()===d.linkedData.toUpperCase()?(this._readLinkedData(e,t),this.lockPointer=!0,!0):!1:!1}_readTableContentSubclass(e,t){let i=e,s=i.cadObject;for(this._reader.readNext();this._reader.dxfCode!==w.Start&&this._reader.dxfCode!==w.Subclass;)this._reader.code===340?i.sytleHandle=this._reader.valueAsHandle:this.tryAssignCurrentValue(s,t.subClasses.get(d.tableContent))||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableContentSubclass ${this._reader.position}.`,y.None),this._reader.readNext()}_readFormattedTableDataSubclass(e,t){let s=e.cadObject;this._reader.readNext();let a=null;for(;this._reader.dxfCode!==w.Start&&this._reader.dxfCode!==w.Subclass;){switch(this._reader.code){case 90:break;case 91:a===null&&(a=new Sa,s.mergedCellRanges.push(a)),a.topRowIndex=this._reader.valueAsInt;break;case 92:a===null&&(a=new Sa,s.mergedCellRanges.push(a)),a.leftColumnIndex=this._reader.valueAsInt;break;case 93:a===null&&(a=new Sa,s.mergedCellRanges.push(a)),a.bottomRowIndex=this._reader.valueAsInt;break;case 94:a===null&&(a=new Sa,s.mergedCellRanges.push(a)),a.rightColumnIndex=this._reader.valueAsInt,a=null;break;case 300:this._reader.valueAsString.toUpperCase()==="TABLEFORMAT"&&this._readStyleOverride(new It(s.cellStyleOverride));break;default:this.tryAssignCurrentValue(s,t.subClasses.get(d.formattedTableData))||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readFormattedTableDataSubclass ${this._reader.position}.`,y.None);break}this._reader.readNext()}}_readLinkedTableDataSubclass(e,t){let s=e.cadObject;for(this._reader.readNext();this._reader.dxfCode!==w.Start&&this._reader.dxfCode!==w.Subclass;){switch(this._reader.code){case 90:case 91:case 92:break;case 300:this._reader.valueAsString.toUpperCase()===h.objectTableColumn.toUpperCase()&&this._readTableColumn();break;case 301:this._reader.valueAsString.toUpperCase()===h.objectTableRow.toUpperCase()&&this._readTableRow();break;default:this.tryAssignCurrentValue(s,t.subClasses.get(d.linkedTableData))||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedTableDataSubclass ${this._reader.position}.`,y.None);break}this._reader.readNext()}}_readTableColumn(){this._reader.readNext();let e=new Ws,t=!1;for(;this._reader.dxfCode!==w.Start;){if(this._reader.code===1?this._reader.valueAsString.toUpperCase()===h.linkedTableDataColumn_BEGIN.toUpperCase()?this._readLinkedTableColumn(e):this._reader.valueAsString.toUpperCase()===h.formattedTableDataColumn_BEGIN.toUpperCase()?this._readFormattedTableColumn(e):this._reader.valueAsString.toUpperCase()===h.objectTableColumnBegin.toUpperCase()&&(this._readTableColumnData(e),t=!0):this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableColumn method.`,y.None),t)return e;this._reader.readNext()}return e}_readTableRow(){this._reader.readNext();let e=new zs,t=!1;for(;this._reader.dxfCode!==w.Start;){if(this._reader.code===1?this._reader.valueAsString.toUpperCase()===h.linkedTableDataRow_BEGIN.toUpperCase()?this._readLinkedTableRow(e):this._reader.valueAsString.toUpperCase()===h.formattedTableDataRow_BEGIN.toUpperCase()?this._readFormattedTableRow(e):this._reader.valueAsString.toUpperCase()===h.objectTableRowBegin.toUpperCase()&&(this._readTableRowData(e),t=!0):this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableRow method.`,y.None),t)return e;this._reader.readNext()}return e}_readTableRowData(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 40:e.height=this._reader.valueAsDouble;break;case 90:break;case 309:t=this._reader.valueAsString.toUpperCase()==="TABLEROW_END";break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableRowData method.`,y.None);break}if(t)break;this._reader.readNext()}}_readFormattedTableRow(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 300:break;case 1:this._reader.valueAsString.toUpperCase()==="TABLEFORMAT_BEGIN"&&this._readStyleOverride(new It(e.cellStyleOverride));break;case 309:t=this._reader.valueAsString.toUpperCase()==="FORMATTEDTABLEDATAROW_END";break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readFormattedTableRow method.`,y.None);break}if(t)break;this._reader.readNext()}}_readTableColumnData(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:if(this._reader.valueAsString.toUpperCase()==="TABLECOLUMN_BEGIN")break;t=!0;break;case 40:e.width=this._reader.valueAsDouble;break;case 90:break;case 309:t=this._reader.valueAsString.toUpperCase()==="TABLECOLUMN_END";break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableColumnData method.`,y.None);break}if(t)break;this._reader.readNext()}}_readLinkedTableColumn(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:if(this._reader.valueAsString.toUpperCase()===h.linkedTableDataColumn_BEGIN.toUpperCase())break;t=!0;break;case 91:e.customData=this._reader.valueAsInt;break;case 300:e.name=this._reader.valueAsString;break;case 301:this._reader.valueAsString.toUpperCase()===h.customData.toUpperCase()&&this._readCustomData();break;case 309:t=this._reader.valueAsString.toUpperCase()===h.linkedTableDataColumn_END.toUpperCase();break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedTableColumn method.`,y.None);break}if(t)break;this._reader.readNext()}}_readLinkedTableRow(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:if(this._reader.valueAsString.toUpperCase()===h.linkedTableDataRow_BEGIN.toUpperCase())break;break;case 90:break;case 91:e.customData=this._reader.valueAsInt;break;case 300:this._reader.valueAsString.toUpperCase()===h.objectCell.toUpperCase()&&this._readCell();break;case 301:this._reader.valueAsString.toUpperCase()===h.customData.toUpperCase()&&this._readCustomData();break;case 309:t=this._reader.valueAsString.toUpperCase()===h.linkedTableDataRow_END.toUpperCase();break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedTableRow method.`,y.None);break}if(t)break;this._reader.readNext()}}_readCell(){this._reader.readNext();let e=new Us,t=!1;for(;this._reader.dxfCode!==w.Start;){if(this._reader.code===1?this._reader.valueAsString.toUpperCase()==="LINKEDTABLEDATACELL_BEGIN"?this._readLinkedTableCell(e):this._reader.valueAsString.toUpperCase()==="FORMATTEDTABLEDATACELL_BEGIN"?this._readFormattedTableCell(e):this._reader.valueAsString.toUpperCase()==="TABLECELL_BEGIN"&&(this._readTableCellData(e),t=!0):this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCell method.`,y.None),t)return e;this._reader.readNext()}return e}_readTableCellData(e){let t=L.create(e.constructor,"TABLECELL_BEGIN");this._reader.readNext();let i=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 40:case 41:break;case 309:i=this._reader.valueAsString.toUpperCase()==="TABLECELL_END";break;case 330:break;default:this.tryAssignCurrentValue(e,t)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readTableCellData ${this._reader.position}.`,y.None);break}if(i)break;this._reader.readNext()}}_readFormattedTableCell(e){let t=L.create(e.constructor,"FORMATTEDTABLEDATACELL_BEGIN");this._reader.readNext();let i=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 300:if(this._reader.valueAsString.toUpperCase()==="CELLTABLEFORMAT"){this._readCellTableFormat(e);continue}break;case 309:i=this._reader.valueAsString.toUpperCase()==="FORMATTEDTABLEDATACELL_END";break;default:this.tryAssignCurrentValue(e,t)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readFormattedTableCell ${this._reader.position}.`,y.None);break}if(i)break;this._reader.readNext()}}_readCellTableFormat(e){let t=L.create(e.constructor,"CELLTABLEFORMAT");this._reader.readNext();let i=!1;for(;this._reader.code===1&&(this._reader.valueAsString.toUpperCase()==="TABLEFORMAT_BEGIN"?this._readStyleOverride(new It(e.styleOverride)):this._reader.valueAsString.toUpperCase()==="CELLSTYLE_BEGIN"?this._readCellStyle(new It):this.tryAssignCurrentValue(e,t)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCellTableFormat ${this._reader.position}.`,y.None),!i);)this._reader.readNext()}_readCellStyle(e){this._reader.readNext();let t=!1;for(;this._reader.code!==1&&(this._reader.code===309?t=this._reader.valueAsString.toUpperCase()==="CELLSTYLE_END":this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCellStyle ${this._reader.position}.`,y.None),!t);)this._reader.readNext()}_readLinkedTableCell(e){let t=L.create(e.constructor,"LINKEDTABLEDATACELL_BEGIN");this._reader.readNext();let i=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 95:break;case 301:this._reader.valueAsString.toUpperCase()===h.customData.toUpperCase()&&this._readCustomData();break;case 302:this._reader.valueAsString.toUpperCase()==="CONTENT"&&this._readLinkedTableCellContent();break;case 309:i=this._reader.valueAsString.toUpperCase()==="LINKEDTABLEDATACELL_END";break;default:this.tryAssignCurrentValue(e,t)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedTableCell ${this._reader.position}.`,y.None);break}if(i)break;this._reader.readNext()}}_readLinkedTableCellContent(){let e=new Qi,t=new Ln(e),i=L.create(e.constructor,"CONTENT");this._reader.readNext();let s=!1;for(;this._reader.dxfCode!==w.Start&&(this._reader.code===1?this._reader.valueAsString.toUpperCase()==="FORMATTEDCELLCONTENT_BEGIN"?(this._readFormattedCellContent(),s=!0):this._reader.valueAsString.toUpperCase()==="CELLCONTENT_BEGIN"&&this._readCellContent(t):this.tryAssignCurrentValue(e,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readLinkedTableCellContent ${this._reader.position}.`,y.None),!s);)this._reader.readNext();return t}_readCellContent(e){let t=e.content,i=L.create(t.constructor,"CELLCONTENT_BEGIN");this._reader.readNext();let s=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 91:break;case 300:if(this._reader.valueAsString.toUpperCase()==="VALUE"){let a=this.readCadValue(t.cadValue);e.cadValueTemplate=a}break;case 309:s=this._reader.valueAsString.toUpperCase()==="CELLCONTENT_END";break;case 340:e.blockRecordHandle=this._reader.valueAsHandle;break;default:this.tryAssignCurrentValue(t,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCellContent ${this._reader.position}.`,y.None);break}if(s)break;this._reader.readNext()}}_readFormattedCellContent(){let e=new Fs,t=new Pn(e),i=L.create(e.constructor,"FORMATTEDCELLCONTENT");this._reader.readNext();let s=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 300:this._reader.valueAsString.toUpperCase()==="CONTENTFORMAT"&&this._readContentFormat(t);break;case 309:s=this._reader.valueAsString.toUpperCase()==="FORMATTEDCELLCONTENT_END";break;default:this.tryAssignCurrentValue(e,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readFormattedCellContent method.`,y.None);break}if(s)break;this._reader.readNext()}}_readContentFormat(e){let t=e.format,i=L.create(t.constructor,"CONTENTFORMAT_BEGIN");this._reader.readNext();let s=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:if(this._reader.valueAsString.toUpperCase()==="CONTENTFORMAT_BEGIN")break;break;case 309:s=this._reader.valueAsString.toUpperCase()==="CONTENTFORMAT_END";break;case 340:e.textStyleHandle=this._reader.valueAsHandle;break;default:this.tryAssignCurrentValue(t,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readContentFormat method.`,y.None);break}if(s)break;this._reader.readNext()}}_readFormattedTableColumn(e){this._reader.readNext();let t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 300:break;case 1:this._reader.valueAsString.toUpperCase()==="TABLEFORMAT_BEGIN"&&this._readStyleOverride(new It(e.cellStyleOverride));break;case 309:t=this._reader.valueAsString.toUpperCase()===h.formattedTableDataColumn_END.toUpperCase();break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readFormattedTableColumn method.`,y.None);break}if(t)break;this._reader.readNext()}}_readStyleOverride(e){let t=e.format,i=L.create(t.constructor,"TABLEFORMAT_STYLE"),s=L.create(Fs,"TABLEFORMAT_BEGIN");this._reader.readNext();let a=!1,n=Ve.Unknown;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 95:n=this._reader.valueAsInt;break;case 1:break;case 300:this._reader.valueAsString.toUpperCase()==="CONTENTFORMAT"&&this._readContentFormat(new Pn(new Fs));break;case 301:this._reader.valueAsString.toUpperCase()==="MARGIN"&&this._readCellMargin(e);break;case 302:if(this._reader.valueAsString.toUpperCase()==="GRIDFORMAT"){let o=new Ji(n);this._readGridFormat(e,o)}break;case 309:a=this._reader.valueAsString.toUpperCase()==="TABLEFORMAT_END";break;default:!this.tryAssignCurrentValue(t,i)&&!this.tryAssignCurrentValue(t,s)&&this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readStyleOverride method.`,y.None);break}if(a)break;this._reader.readNext()}}_readGridFormat(e,t){let i=L.create(t.constructor,"CellBorder");this._reader.readNext();let s=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:break;case 62:t.color=new S(this._reader.valueAsShort);break;case 92:t.lineWeight=this._reader.valueAsInt;break;case 93:t.isInvisible=this._reader.valueAsBool;break;case 340:e.borderLinetypePairs.push([t,this._reader.valueAsHandle]);break;case 309:s=this._reader.valueAsString.toUpperCase()==="GRIDFORMAT_END";break;default:this.tryAssignCurrentValue(t,i)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readGridFormat method.`,y.None);break}if(s)break;this._reader.readNext()}}_readCellMargin(e){let t=e.format;this._reader.readNext();let i=!1,s=0;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:break;case 40:switch(s){case 0:t.verticalMargin=this._reader.valueAsDouble;break;case 1:t.horizontalMargin=this._reader.valueAsDouble;break;case 2:t.bottomMargin=this._reader.valueAsDouble;break;case 3:t.rightMargin=this._reader.valueAsDouble;break;case 4:t.marginHorizontalSpacing=this._reader.valueAsDouble;break;case 5:t.marginVerticalSpacing=this._reader.valueAsDouble;break}s++;break;case 309:i=this._reader.valueAsString.toUpperCase()==="CELLMARGIN_END";break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCellMargin method.`,y.None);break}if(i)break;this._reader.readNext()}}_readCustomData(){this._reader.readNext();let e=0,t=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 1:break;case 90:e=this._reader.valueAsInt;break;case 300:break;case 301:this._reader.valueAsString.toUpperCase()==="DATAMAP_VALUE"&&this._readDataMapValue();break;case 309:t=this._reader.valueAsString.toUpperCase()==="DATAMAP_END";break;default:this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readCustomData method.`,y.None);break}if(t)break;this._reader.readNext()}}_readDataMapValue(){let e=new vt,t=L.create(e.constructor,"DATAMAP_VALUE");this._reader.readNext();let i=!1;for(;this._reader.dxfCode!==w.Start;){switch(this._reader.code){case 11:case 21:case 31:case 91:case 92:case 140:case 310:break;case 304:i=this._reader.valueAsString.toUpperCase()==="ACVALUE_END";break;default:this.tryAssignCurrentValue(e,t)||this._builder.notify(`Unhandled dxf code ${this._reader.code} value ${this._reader.valueAsString} at readDataMapValue method.`,y.None);break}if(i)break;this._reader.readNext()}}_readVisualStyle(e,t){switch(this._reader.code){case 176:case 177:case 420:return!0;default:return!0}}_readSpatialFilter(e,t){let i=e,s=i.cadObject;switch(this._reader.code){case 10:return s.boundaryPoints.push(new g(this._reader.valueAsDouble,0)),!0;case 20:{let a=s.boundaryPoints[s.boundaryPoints.length-1];return s.boundaryPoints.push(new g(a.x,this._reader.valueAsDouble)),!0}case 40:{s.clipFrontPlane&&!i.hasFrontPlane&&(s.frontDistance=this._reader.valueAsDouble,i.hasFrontPlane=!0);let a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];for(let n=0;n<12;n++)a[n]=this._reader.valueAsDouble,n<11&&this._reader.readNext();return i.insertTransformRead?(s.insertTransform=new mt(a),i.insertTransformRead=!0):s.inverseInsertTransform=new mt(a),!0}default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.spatialFilter))}}_readMLineStyle(e,t){let i=e,s=e.cadObject;switch(this._reader.code){case 6:{let a=i.elementTemplates[i.elementTemplates.length-1];return a&&(a.lineTypeName=this._reader.valueAsString),!0}case 49:{let a=new js,n=new os.ElementTemplate(a);return a.offset=this._reader.valueAsDouble,i.elementTemplates.push(n),s.addElement(a),!0}default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(i.cadObject.subclassMarker))}}_readTableStyle(e,t){let i=e,s=i.cadObject,a=i.currentCellStyleTemplate?.cellStyle??null;switch(this._reader.code){case 7:return i.createCurrentCellStyleTemplate(),i.currentCellStyleTemplate.textStyleName=this._reader.valueAsString,!0;case 94:return a&&(a.alignment=this._reader.valueAsInt),!0;case 62:return a&&(a.color=new S(this._reader.valueAsShort)),!0;case 63:return a&&(a.backgroundColor=new S(this._reader.valueAsShort)),!0;case 140:return a&&(a.textHeight=this._reader.valueAsDouble),!0;case 170:return a&&(a.cellAlignment=this._reader.valueAsShort),!0;case 283:return a&&(a.isFillColorOn=this._reader.valueAsBool),!0;case 90:return a&&(a.cellStyleType=this._reader.valueAsShort),!0;case 91:return a&&(a.styleClass=this._reader.valueAsShort),!0;case 1:return!0;case 274:return a&&(a.topBorder.lineWeight=this._reader.valueAsInt),!0;case 275:return a&&(a.horizontalInsideBorder.lineWeight=this._reader.valueAsInt),!0;case 276:return a&&(a.bottomBorder.lineWeight=this._reader.valueAsInt),!0;case 277:return a&&(a.leftBorder.lineWeight=this._reader.valueAsInt),!0;case 278:return a&&(a.verticalInsideBorder.lineWeight=this._reader.valueAsInt),!0;case 279:return a&&(a.rightBorder.lineWeight=this._reader.valueAsInt),!0;case 284:return a&&(a.topBorder.isInvisible=this._reader.valueAsBool),!0;case 285:return a&&(a.horizontalInsideBorder.isInvisible=this._reader.valueAsBool),!0;case 286:return a&&(a.bottomBorder.isInvisible=this._reader.valueAsBool),!0;case 287:return a&&(a.leftBorder.isInvisible=this._reader.valueAsBool),!0;case 288:return a&&(a.verticalInsideBorder.isInvisible=this._reader.valueAsBool),!0;case 289:return a&&(a.rightBorder.isInvisible=this._reader.valueAsBool),!0;case 64:return a&&(a.topBorder.color=new S(this._reader.valueAsShort)),!0;case 65:return a&&(a.horizontalInsideBorder.color=new S(this._reader.valueAsShort)),!0;case 66:return a&&(a.bottomBorder.color=new S(this._reader.valueAsShort)),!0;case 67:return a&&(a.leftBorder.color=new S(this._reader.valueAsShort)),!0;case 68:return a&&(a.verticalInsideBorder.color=new S(this._reader.valueAsShort)),!0;case 69:return a&&(a.rightBorder.color=new S(this._reader.valueAsShort)),!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(i.cadObject.subclassMarker))}}_readMLeaderStyle(e,t){let i=e;switch(this._reader.code){case 179:return!0;case 340:return i.leaderLineTypeHandle=this._reader.valueAsHandle,!0;case 342:return i.mTextStyleHandle=this._reader.valueAsHandle,!0;default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(i.cadObject.subclassMarker))}}_readEvaluationExpression(e,t){let i=e;return this._reader.code===1?(this._reader.expectedCode(70),this._reader.expectedCode(140),!0):this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.evalGraphExpr))}_readBlockElement(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.blockElement))?!0:this._readEvaluationExpression(e,t)}}_readBlockAction(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.blockAction))?!0:this._readBlockElement(e,t)}}_readBlockActionBasePt(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.blockActionBasePt))?!0:this._readBlockAction(e,t)}}_readBlockRotationAction(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.blockRotationAction))?!0:this._readBlockActionBasePt(e,t)}}_readBlockParameter(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.blockParameter))?!0:this._readBlockElement(e,t)}}_readBlock1PtParameter(e,t){switch(this._reader.code){default:return this.tryAssignCurrentValue(e.cadObject,t.subClasses.get(d.block1PtParameter))?!0:this._readBlockParameter(e,t)}}_readBlock2PtParameter(e,t){return this._reader.code===91||this.tryAssignCurrentValue(e.cadObject,t)?!0:this._readBlockParameter(e,t)}_readBlockVisibilityParameter(e,t){let i=e;switch(this._reader.code){case 92:{let s=this._reader.valueAsInt;for(let a=0;a=0&&i.splice(s,1),this._reader.code){case 303:e.name=this._reader.valueAsString;break;case 94:{let a=this._reader.valueAsInt;for(let n=0;nEs.sentinelBytes.length){let a=e[Es.sentinelBytes.length];a!==void 0&&a!==0&&(i=!0)}let s=this._createReader(t,i);if(!s.find(h.headerSection))return this.triggerNotification("Header section not found, using a generic reader.",y.Warning),this._version=u.Unknown,s.start(),s;for(;s.valueAsString!==h.endSection;){if(s.valueAsString==="$ACADVER"){if(s.readNext(),this._version=q.getVersionFromName(s.valueAsString),this._versionthis._buffer.length&&(this._flushBuffer(),e>this._buffer.length&&(this._buffer=new Uint8Array(e*2),this._writer=new DataView(this._buffer.buffer)))}_flushBuffer(){this._position>0&&(this._stream.write(this._buffer.slice(0,this._position)),this._position=0)}};ie();T();D();Aa();var rr=class{onNotification=null;get version(){return this._document.header.version}holder;configuration;_writer;_document;constructor(e,t,i,s){this._writer=e,this._document=t,this.holder=i,this.configuration=s}write(){this._writer.write(w.Start,h.beginSection),this._writer.write(w.SymbolTableName,this.sectionName),this.writeSection(),this._writer.write(w.Start,h.endSection)}writeCadValue(e){switch(this._writer.write(93,e.flags),this._writer.write(90,e.valueType),e.valueType){case V.Unknown:this._writer.write(91,0);break;case V.Double:this._writer.write(140,Number(e.value));break;case V.Date:this._writer.write(91,0);break;case V.General:case V.String:this.writeLongTextValue(1,2,e.value);break;case V.Point2D:case V.Point3D:this._writer.writeVector(11,e.value);break;case V.Long:this._writer.write(91,Number(e.value));break;case V.Handle:{let t=e.value;t&&this._writer.writeHandle(330,t);break}case V.Buffer:case V.ResultBuffer:this._writer.write(91,0);break}}writeCommonObjectData(e){if(e instanceof Q?this._writer.write(w.DimVarHandle,e.handle):this._writer.write(w.Handle,e.handle),e.xDictionary!==null&&(this._writer.write(w.ControlString,h.dictionaryToken),this._writer.write(w.HardOwnershipId,e.xDictionary.handle),this._writer.write(w.ControlString,"}"),this.holder.objects.push(e.xDictionary)),e.cleanReactors(),e.reactors.length>0){this._writer.write(w.ControlString,h.reactorsToken);for(let t of e.reactors)this._writer.write(w.SoftPointerId,t.handle);this._writer.write(w.ControlString,"}")}this._writer.write(w.SoftPointerId,e.owner.handle)}writeExtendedData(e){if(!(e===null||!this.configuration.writeXData))for(let[t,i]of e){this._writer.write(w.ExtendedDataRegAppName,t.name);for(let s of i.records)if(s instanceof Er)this._writer.write(s.code,s.value);else if(s instanceof Fe)this._writer.write(s.code,s.value);else if(s instanceof ot)this._writer.write(s.code,s.value);else if(s instanceof Pr)this._writer.write(s.code,s.value);else if(s instanceof Lr)this._writer.write(s.code,s.value);else if(s instanceof ps)this._writer.write(s.code,s.value);else if(s instanceof ms)this._writer.write(s.code,s.value);else if(s instanceof us)this._writer.write(s.code,s.value);else if(s instanceof fs)this._writer.writeVector(s.code,s.value);else if(s instanceof kr)this._writer.writeVector(s.code,s.value);else if(s instanceof ws)this._writer.writeVector(s.code,s.value);else if(typeof s.resolveReference=="function"){let a=s,n=a.value;a.resolveReference(this._document)===null&&(n=0),this._writer.write(w.ExtendedDataHandle,n)}else if(s instanceof jr)this._writer.write(s.code,s.value);else throw new Error(`ExtendedDataRecord of type ${s.constructor.name} not supported.`)}}writeCommonEntityData(e){let t=L.create(N);if(this._writer.write(w.Subclass,d.entity),this._writer.write(8,e.layer?.name??"0"),this._writer.write(6,e.lineType?.name??"ByLayer"),e.bookColor!==null?(this._writer.write(62,e.bookColor.color.getApproxIndex()),this._writer.writeTrueColor(420,e.bookColor.color),this._writer.write(430,e.bookColor.name)):e.color.isTrueColor?this._writer.writeTrueColor(420,e.color):this._writer.write(62,e.color.index),e.transparency.value>=0&&this._writer.write(440,Ee.toAlphaValue(e.transparency)),this._writer.write(48,e.lineTypeScale,t),this._writer.write(60,e.isInvisible?1:0,t),e.owner instanceof U){let i=e.owner;i.layout!==null&&this._writer.write(67,i.layout.isPaperSpace?1:0)}this._writer.write(370,e.lineWeight)}writeLongTextValue(e,t,i){for(;i.length>250;)this._writer.write(t,i.substring(0,250)),i=i.substring(250);this._writer.write(e,i)}notify(e,t=y.None,i){this.onNotification&&this.onNotification(this,new tr(e,t,i))}writeEntity(e){if(!this._isEntitySupported(e))return;this._writer.write(w.Start,e.objectName),this.writeCommonObjectData(e),this.writeCommonEntityData(e);let t=Ie.create(e.constructor.name);e instanceof We?this._writeArc(e,t):e instanceof Et?this._writeCircle(e,t):e instanceof _t?this._writeDimension(e,t):e instanceof ze?this._writeDimension(e,t):e instanceof Zt?this._writeDimension(e,t):e instanceof Xt?this._writeDimension(e,t):e instanceof $t?this._writeDimension(e,t):e instanceof Gt?this._writeDimension(e,t):e instanceof Yt?this._writeDimension(e,t):e instanceof bt?this._writeEllipse(e,t):e instanceof xi?this._writeFace3D(e,t):e instanceof Kt?this._writeHatch(e,t):e instanceof Ye?this._writeInsert(e,t):e instanceof zr?this._writeLeader(e,t):e instanceof Me?this._writeLine(e,t):e instanceof hr?this._writeLwPolyline(e,t):e instanceof $r?this._writeMesh(e,t):e instanceof Gr?this._writeMLine(e,t):e instanceof ve?this._writeMText(e,t):e instanceof Xr?this._writeMultiLeader(e,t):e instanceof Yr?this._writeOle2Frame(e,t):e instanceof Ci?this._writePdfUnderlay(e,t):e instanceof kt?this._writePoint(e,t):e instanceof Ge?this._writePolyline(e,t):e instanceof gt?this._writePolyline(e,t):e instanceof jt?this._writePolyline(e,t):e instanceof Qt?this._writePolyline(e,t):e instanceof Di?this._writeRay(e,t):e instanceof qr?this._writeShape(e,t):e instanceof mr?this._writeSolid(e,t):e instanceof Lt?this._writeSpline(e,t):e instanceof at?this._writeTextEntity(e,t):e instanceof pr?this._writeTolerance(e,t):e instanceof Ue?this._writeViewport(e,t):e instanceof Si?this._writeXLine(e,t):e instanceof yi||e instanceof Ts?this._writeCadImage(e,t):e instanceof Se?this._writeSeqend(e,t):this.notify(`Entity not implemented: ${e.constructor.name}`,y.NotImplemented),this.writeExtendedData(e.extendedData)}_isEntitySupported(e){return!(e instanceof er)}_writeArc(e,t){this._writeCircle(e,t);let i=t.subClasses.get(d.arc);this._writer.write(w.Subclass,d.arc),this._writer.write(50,e.startAngle,i),this._writer.write(51,e.endAngle,i)}_writeCircle(e,t){let i=t.subClasses.get(d.circle);this._writer.write(w.Subclass,d.circle),this._writer.writeVector(10,e.center,i),this._writer.write(40,e.radius,i),this._writer.write(39,e.thickness,i),this._writer.writeVector(210,e.normal,i)}_writeDimension(e,t){let i=t.subClasses.get(d.dimension);this._writer.write(w.Subclass,d.dimension),this._writer.write(2,e.block?.name??"",i),this._writer.writeVector(10,e.definitionPoint,i),this._writer.writeVector(11,e.textMiddlePoint,i),this._writer.write(70,e.flags,i),this._writer.write(71,e.attachmentPoint,i),this._writer.write(72,e.lineSpacingStyle,i),this._writer.write(41,e.lineSpacingFactor,i),this._writer.write(42,e.measurement,i),this._writer.write(1,e.text,i),this._writer.write(53,e.textRotation,i),this._writer.write(51,e.horizontalDirection,i),this._writer.writeVector(210,e.normal,i),this._writer.write(3,e.style?.name??"",i),e instanceof ze&&this._writeDimensionAligned(e,t),e instanceof _t&&this._writeDimensionLinear(e,t),e instanceof Zt&&this._writeDimensionRadius(e,t),e instanceof Xt&&this._writeDimensionDiameter(e,t),e instanceof $t&&this._writeDimensionAngular2Line(e,t),e instanceof Gt&&this._writeDimensionAngular3Pt(e,t),e instanceof Yt&&this._writeDimensionOrdinate(e,t)}_writeDimensionAligned(e,t){let i=t.subClasses.get(d.alignedDimension);this._writer.write(w.Subclass,d.alignedDimension),this._writer.writeVector(13,e.firstPoint,i),this._writer.writeVector(14,e.secondPoint,i)}_writeDimensionLinear(e,t){this._writeDimensionAligned(e,t);let i=t.subClasses.get(d.linearDimension);this._writer.write(w.Subclass,d.linearDimension),this._writer.write(50,e.rotation,i)}_writeDimensionRadius(e,t){let i=t.subClasses.get(d.radialDimension);this._writer.write(w.Subclass,d.radialDimension),this._writer.writeVector(15,e.angleVertex,i),this._writer.write(40,e.leaderLength,i)}_writeDimensionDiameter(e,t){let i=t.subClasses.get(d.diametricDimension);this._writer.write(w.Subclass,d.diametricDimension),this._writer.writeVector(15,e.angleVertex,i),this._writer.write(40,e.leaderLength,i)}_writeDimensionAngular2Line(e,t){let i=t.subClasses.get(d.angular2LineDimension);this._writer.write(w.Subclass,d.angular2LineDimension),this._writer.writeVector(13,e.firstPoint,i),this._writer.writeVector(14,e.secondPoint,i),this._writer.writeVector(15,e.angleVertex,i),this._writer.writeVector(16,e.dimensionArc,i)}_writeDimensionAngular3Pt(e,t){let i=t.subClasses.get(d.angular3PointDimension);this._writer.write(w.Subclass,d.angular3PointDimension),this._writer.writeVector(13,e.firstPoint,i),this._writer.writeVector(14,e.secondPoint,i),this._writer.writeVector(15,e.angleVertex,i)}_writeDimensionOrdinate(e,t){let i=t.subClasses.get(d.ordinateDimension);this._writer.write(w.Subclass,d.ordinateDimension),this._writer.writeVector(13,e.featureLocation,i),this._writer.writeVector(14,e.leaderEndpoint,i)}_writeEllipse(e,t){let i=t.subClasses.get(d.ellipse);this._writer.write(w.Subclass,d.ellipse),this._writer.writeVector(10,e.center,i),this._writer.writeVector(11,e.majorAxisEndPoint,i),this._writer.writeVector(210,e.normal,i),this._writer.write(40,e.radiusRatio,i),this._writer.write(41,e.startParameter,i),this._writer.write(42,e.endParameter,i)}_writeFace3D(e,t){let i=t.subClasses.get(d.face3d);this._writer.write(w.Subclass,d.face3d),this._writer.writeVector(10,e.firstCorner,i),this._writer.writeVector(11,e.secondCorner,i),this._writer.writeVector(12,e.thirdCorner,i),this._writer.writeVector(13,e.fourthCorner,i),this._writer.write(70,e.flags,i)}_writeHatch(e,t){let i=t.subClasses.get(d.hatch);this._writer.write(w.Subclass,d.hatch),this._writer.write(30,e.elevation,i),this._writer.writeVector(210,e.normal,i),this._writer.write(2,e.pattern.name,i),this._writer.write(70,e.isSolid?1:0,i),this._writer.write(71,e.isAssociative?1:0,i),this._writer.write(91,e.paths.length);for(let s of e.paths)this._writeBoundaryPath(s);if(this._writer.write(75,e.style,i),this._writer.write(76,e.patternType,i),!e.isSolid){this._writer.write(52,e.patternAngle,i),this._writer.write(41,e.patternScale,i),this._writer.write(77,e.isDouble?1:0,i),this._writer.write(78,e.pattern.lines.length);for(let s of e.pattern.lines){this._writer.write(53,s.angle),this._writer.write(43,s.basePoint.x),this._writer.write(44,s.basePoint.y),this._writer.write(45,s.offset.x),this._writer.write(46,s.offset.y),this._writer.write(79,s.dashLengths.length);for(let a of s.dashLengths)this._writer.write(49,a)}}this._writer.write(47,e.pixelSize,i),this._writer.write(98,e.seedPoints.length);for(let s of e.seedPoints)this._writer.write(10,s.x),this._writer.write(20,s.y);if(e.gradientColor.enabled){this._writer.write(450,e.gradientColor.enabled?1:0),this._writer.write(451,e.gradientColor.reserved),this._writer.write(452,e.gradientColor.isSingleColorGradient?1:0),this._writer.write(453,e.gradientColor.colors.length);for(let s of e.gradientColor.colors)this._writer.write(463,s.value),this._writer.write(63,s.color.index),this._writer.write(421,s.color.trueColor);this._writer.write(460,e.gradientColor.angle),this._writer.write(461,e.gradientColor.shift),this._writer.write(462,e.gradientColor.colorTint),this._writer.write(470,e.gradientColor.name)}}_writeBoundaryPath(e){if(this._writer.write(92,e.flags),(e.flags&wt.Polyline)!==0)for(let t of e.edges)t instanceof Mr&&this._writePolylineBoundary(t);else{this._writer.write(93,e.edges.length);for(let t of e.edges)this._writeBoundaryEdge(t)}this._writer.write(97,e.entities.length);for(let t of e.entities)this._writer.write(330,t.handle)}_writePolylineBoundary(e){let t=e.vertices.some(i=>i.z!==0);this._writer.write(72,t?1:0),this._writer.write(73,e.isClosed?1:0),this._writer.write(93,e.vertices.length);for(let i of e.vertices)this._writer.write(10,i.x),this._writer.write(20,i.y),t&&this._writer.write(42,i.z)}_writeBoundaryEdge(e){if(e instanceof Ur)this._writer.write(72,1),this._writer.write(10,e.start.x),this._writer.write(20,e.start.y),this._writer.write(11,e.end.x),this._writer.write(21,e.end.y);else if(e instanceof Hr)this._writer.write(72,2),this._writer.write(10,e.center.x),this._writer.write(20,e.center.y),this._writer.write(40,e.radius),this._writer.write(50,ae.radToDeg(e.startAngle)),this._writer.write(51,ae.radToDeg(e.endAngle)),this._writer.write(73,e.counterClockWise?1:0);else if(e instanceof Fr)this._writer.write(72,3),this._writer.write(10,e.center.x),this._writer.write(20,e.center.y),this._writer.write(11,e.majorAxisEndPoint.x),this._writer.write(21,e.majorAxisEndPoint.y),this._writer.write(40,e.minorToMajorRatio),this._writer.write(50,ae.radToDeg(e.startAngle)),this._writer.write(51,ae.radToDeg(e.endAngle)),this._writer.write(73,e.counterClockWise?1:0);else if(e instanceof Wr){this._writer.write(72,4),this._writer.write(94,e.degree),this._writer.write(73,e.isRational?1:0),this._writer.write(74,e.isPeriodic?1:0),this._writer.write(95,e.knots.length),this._writer.write(96,e.controlPoints.length);for(let t of e.knots)this._writer.write(40,t);for(let t of e.controlPoints)this._writer.write(10,t.x),this._writer.write(20,t.y),e.isRational&&this._writer.write(42,t.z);if(e.fitPoints.length>0){this._writer.write(97,e.fitPoints.length);for(let t of e.fitPoints)this._writer.write(11,t.x),this._writer.write(21,t.y)}this._writer.write(12,e.startTangent.x),this._writer.write(22,e.startTangent.y),this._writer.write(13,e.endTangent.x),this._writer.write(23,e.endTangent.y)}}_writeInsert(e,t){let i=t.subClasses.get(d.insert);this._writer.write(w.Subclass,d.insert),this._writer.write(66,e.hasAttributes?1:0),this._writer.write(2,e.block?.name??"",i),this._writer.writeVector(10,e.insertPoint,i),this._writer.write(41,e.xScale,i),this._writer.write(42,e.yScale,i),this._writer.write(43,e.zScale,i),this._writer.write(50,e.rotation,i),this._writer.write(70,e.columnCount,i),this._writer.write(71,e.rowCount,i),this._writer.write(44,e.columnSpacing,i),this._writer.write(45,e.rowSpacing,i),this._writer.writeVector(210,e.normal,i);for(let s of e.attributes)this.writeEntity(s);e.hasAttributes&&e.attributes.seqend&&this.writeEntity(e.attributes.seqend)}_writeLeader(e,t){let i=t.subClasses.get(d.leader);this._writer.write(w.Subclass,d.leader),this._writer.write(3,e.style?.name??"",i),this._writer.write(71,e.arrowHeadEnabled?1:0,i),this._writer.write(72,e.pathType,i),this._writer.write(73,e.creationType,i),this._writer.write(74,e.hookLineDirection?1:0,i),this._writer.write(75,e.hasHookline?1:0,i),this._writer.write(40,e.textHeight,i),this._writer.write(41,e.textWidth,i),this._writer.write(76,e.vertices.length);for(let s of e.vertices)this._writer.writeVector(10,s);this._writer.write(77,e.color?1:0,i),this._writer.writeHandle(340,e.associatedAnnotation),this._writer.writeVector(210,e.normal,i),this._writer.writeVector(211,e.horizontalDirection,i),this._writer.writeVector(212,e.blockOffset,i),this._writer.writeVector(213,e.annotationOffset,i)}_writeLine(e,t){let i=t.subClasses.get(d.line);this._writer.write(w.Subclass,d.line),this._writer.write(39,e.thickness,i),this._writer.writeVector(10,e.startPoint,i),this._writer.writeVector(11,e.endPoint,i),this._writer.writeVector(210,e.normal,i)}_writeLwPolyline(e,t){let i=t.subClasses.get(d.lwPolyline);this._writer.write(w.Subclass,d.lwPolyline),this._writer.write(90,e.vertices.length),this._writer.write(70,e.flags,i),this._writer.write(43,e.constantWidth,i),this._writer.write(38,e.elevation,i),this._writer.write(39,e.thickness,i),this._writer.writeVector(210,e.normal,i);for(let s of e.vertices)this._writer.write(10,s.location.x),this._writer.write(20,s.location.y),this._writer.write(40,s.startWidth),this._writer.write(41,s.endWidth),this._writer.write(42,s.bulge),s.id!==0&&this._writer.write(91,s.id)}_writeMesh(e,t){let i=t.subClasses.get(d.mesh);this._writer.write(w.Subclass,d.mesh),this._writer.write(71,e.subdivisionLevel,i),this._writer.write(72,0),this._writer.write(91,0),this._writer.write(92,e.vertices.length);for(let a of e.vertices)this._writer.writeVector(10,a);let s=0;for(let a of e.faces)s+=1+a.length;this._writer.write(93,s);for(let a of e.faces){this._writer.write(90,a.length);for(let n of a)this._writer.write(90,n)}this._writer.write(94,e.edges.length);for(let a of e.edges)this._writer.write(90,a.start),this._writer.write(90,a.end);this._writer.write(95,e.edges.length);for(let a of e.edges)this._writer.write(140,a.crease)}_writeMLine(e,t){let i=t.subClasses.get(d.mLine);this._writer.write(w.Subclass,d.mLine),this._writer.writeHandle(340,e.style,i),this._writer.write(40,e.scaleFactor,i),this._writer.write(70,e.justification,i),this._writer.write(71,e.flags,i),this._writer.write(72,e.vertices.length),this._writer.write(73,e.style?.elements.length??0),this._writer.writeVector(10,e.startPoint,i),this._writer.writeVector(210,e.normal,i);for(let s of e.vertices){this._writer.writeVector(11,s.position),this._writer.writeVector(12,s.direction),this._writer.writeVector(13,s.miter);for(let a of s.segments){this._writer.write(74,a.parameters.length);for(let n of a.parameters)this._writer.write(41,n);this._writer.write(75,a.areaFillParameters.length);for(let n of a.areaFillParameters)this._writer.write(42,n)}}}_writeMText(e,t){let i=t.subClasses.get(d.mText);this._writer.write(w.Subclass,d.mText),this._writer.writeVector(10,e.insertPoint,i),this._writer.write(40,e.height,i),this._writer.write(41,e.rectangleWidth,i),this._writer.write(46,e.rectangleHeight,i),this._writer.write(71,e.attachmentPoint,i),this._writer.write(72,e.drawingDirection,i),this.writeLongTextValue(1,3,e.value??""),this._writer.write(7,e.style?.name??"",i),this._writer.writeVector(210,e.normal,i),this._writer.writeVector(11,e.alignmentPoint,i),this._writer.write(73,e.lineSpacingStyle,i),this._writer.write(44,e.lineSpacing,i),this._writer.write(90,e.backgroundFillFlags,i),e.backgroundFillFlags>0&&(this._writer.write(63,e.backgroundColor.index),this._writer.write(45,e.backgroundScale,i),this._writer.writeTrueColor(420,e.backgroundColor),this._writer.write(441,e.backgroundTransparency))}_writeMultiLeader(e,t){let i=t.subClasses.get(d.leader);this._writer.write(w.Subclass,d.leader),this._writer.write(270,e.contentType,i),this._writer.writeHandle(340,e.style),this._writer.writeHandle(341,e.leaderLineType),this._writer.writeCmColor(91,e.lineColor,i),this._writer.write(170,e.pathType,i),this._writer.write(171,e.lineColor,i),this._writer.writeHandle(343,e.textStyle),this._writer.write(173,e.textLeftAttachment,i),this._writer.write(95,e.textRightAttachment,i),e.contextData&&(this._writer.write(300,"CONTEXT_DATA{"),this._writeAnnotContext(e.contextData,t),this._writer.write(301,"}")),this._writer.write(44,e.scaleFactor,i),this._writer.write(294,e.textDirectionNegative,i),this._writer.write(274,e.textAligninIPE,i),this._writer.write(178,e.textAttachmentDirection,i),this._writer.write(175,e.textAttachmentDirection,i),this._writer.write(176,e.textAttachmentDirection,i)}_writeAnnotContext(e,t){let i=L.create(Jt);this._writer.writeVector(10,e.contentBasePoint,i),this._writer.write(41,e.textHeight,i),this._writer.write(140,e.arrowheadSize,i),this._writer.write(145,e.landingGap,i),this._writer.write(174,e.textLeftAttachment,i),this._writer.write(175,e.textRightAttachment,i),this._writer.write(176,e.textAlignment,i),this._writer.write(177,e.blockContentConnection,i),this._writer.write(290,e.hasTextContents,i),this._writer.writeVector(110,e.contentBasePoint,i),this._writer.writeVector(111,e.baseDirection,i),this._writer.writeVector(112,e.baseVertical,i),this._writer.write(297,e.normalReversed,i),this._writer.writeVector(12,e.textLocation,i),this._writer.writeVector(13,e.direction,i);for(let s of e.leaderRoots)this._writer.write(302,"LEADER{"),this._writeLeaderRoot(s),this._writer.write(303,"}");this._writer.writeHandle(340,e.textStyle)}_writeLeaderRoot(e){let t=L.create(e.constructor,"LeaderRoot");this._writer.write(290,e.contentValid,t),this._writer.writeVector(10,e.connectionPoint,t),this._writer.writeVector(11,e.direction,t);for(let i of e.lines)this._writer.write(304,"LEADER_LINE{"),this._writeLeaderLine(i),this._writer.write(305,"}");this._writer.write(271,e.textAttachmentDirection,t)}_writeLeaderLine(e){for(let t of e.points)this._writer.writeVector(10,t);this._writer.write(91,e.breakInfoCount)}_writeOle2Frame(e,t){let i=t.subClasses.get(d.ole2Frame);this._writer.write(w.Subclass,d.ole2Frame),this._writer.write(70,e.oleObjectType,i),this._writer.write(3,e.sourceApplication,i),this._writer.writeVector(10,e.upperLeftCorner,i),this._writer.writeVector(11,e.lowerRightCorner,i)}_writePdfUnderlay(e,t){let i=t.subClasses.get(d.underlay);this._writer.write(w.Subclass,d.underlay),this._writer.writeHandle(340,e.definition,i),this._writer.writeVector(10,e.insertPoint,i),this._writer.write(41,e.xScale,i),this._writer.write(42,e.yScale,i),this._writer.write(43,e.zScale,i),this._writer.write(50,e.rotation,i),this._writer.write(280,e.flags,i),this._writer.write(281,e.contrast,i),this._writer.write(282,e.fade,i)}_writePoint(e,t){let i=t.subClasses.get(d.point);this._writer.write(w.Subclass,d.point),this._writer.writeVector(10,e.location,i),this._writer.write(39,e.thickness,i),this._writer.writeVector(210,e.normal,i),this._writer.write(50,e.rotation,i)}_writePolyline(e,t){this._writer.write(w.Subclass,e.subclassMarker),this._writer.write(66,1),this._writer.write(70,e.flags),this._writer.writeVector(210,e.normal);for(let i of e.vertices)i instanceof tt&&this._writeVertex(i,t);this._writeSeqend(e.vertices.seqend,t)}_writeVertex(e,t){this._writer.write(w.Start,e.objectName),this.writeCommonObjectData(e),this.writeCommonEntityData(e),this._writer.write(w.Subclass,d.vertex),this._writer.write(w.Subclass,e.subclassMarker),this._writer.writeVector(10,e.location),this._writer.write(70,e.flags),e instanceof yt?(this._writer.write(40,e.startWidth),this._writer.write(41,e.endWidth),this._writer.write(42,e.bulge),this._writer.write(50,e.curveTangent)):e instanceof fr&&(this._writer.write(71,e.index1),this._writer.write(72,e.index2),this._writer.write(73,e.index3),this._writer.write(74,e.index4))}_writeRay(e,t){let i=t.subClasses.get(d.ray);this._writer.write(w.Subclass,d.ray),this._writer.writeVector(10,e.startPoint,i),this._writer.writeVector(11,e.direction,i)}_writeShape(e,t){let i=t.subClasses.get(d.shape);this._writer.write(w.Subclass,d.shape),this._writer.writeVector(10,e.insertionPoint,i),this._writer.write(40,e.size,i),this._writer.write(2,e.shapeIndex,i),this._writer.write(50,e.rotation,i),this._writer.write(41,e.relativeXScale,i),this._writer.write(51,e.obliqueAngle,i),this._writer.write(39,e.thickness,i),this._writer.writeVector(210,e.normal,i)}_writeSolid(e,t){let i=t.subClasses.get(d.solid);this._writer.write(w.Subclass,d.solid),this._writer.writeVector(10,e.firstCorner,i),this._writer.writeVector(11,e.secondCorner,i),this._writer.writeVector(12,e.thirdCorner,i),this._writer.writeVector(13,e.fourthCorner,i),this._writer.write(39,e.thickness,i),this._writer.writeVector(210,e.normal,i)}_writeSpline(e,t){let i=t.subClasses.get(d.spline);this._writer.write(w.Subclass,d.spline),this._writer.writeVector(210,e.normal,i),this._writer.write(70,e.flags,i),this._writer.write(71,e.degree,i),this._writer.write(72,e.knots.length),this._writer.write(73,e.controlPoints.length),this._writer.write(74,e.fitPoints.length),this._writer.write(42,e.knotTolerance,i),this._writer.write(43,e.controlPointTolerance,i),this._writer.write(44,e.fitTolerance,i),e.startTangent&&this._writer.writeVector(12,e.startTangent),e.endTangent&&this._writer.writeVector(13,e.endTangent);for(let s of e.knots)this._writer.write(40,s);for(let s=0;s=u.AC1015&&e.isUnloaded&&this._writer.write(71,e.isUnloaded?1:0,t),this._writer.writeVector(10,e.basePoint,t),this._writer.write(3,e.name,t),this._writer.write(4,e.comments,t)}_processEntities(e){if(e.name===U.modelSpaceName||e.name===U.paperSpaceName)for(let t of e.entities)t instanceof Se,this.holder.entities.push(t);else for(let t of e.entities)this.writeEntity(t)}_writeBlockEnd(e){this._writer.write(w.Start,e.objectName),this.writeCommonObjectData(e),this._writer.write(w.Subclass,d.entity),this._writer.write(8,e.layer.name),this._writer.write(w.Subclass,d.blockEnd)}};T();var Qc=class extends rr{get sectionName(){return h.classesSection}constructor(e,t,i,s){super(e,t,i,s)}writeSection(){let e=this._document.classes;if(!(e==null||typeof e[Symbol.iterator]!="function"))for(let t of e)this._writer.write(0,h.classEntry),this._writer.write(1,t.dxfName),this._writer.write(2,t.cppClassName),this._writer.write(3,t.applicationName),this._writer.write(90,t.proxyFlags),this.version>u.AC1015&&this._writer.write(91,t.instanceCount),this._writer.write(280,t.wasZombie),this._writer.write(281,t.isAnEntity)}};T();var ed=class extends rr{get sectionName(){return h.entitiesSection}constructor(e,t,i,s){super(e,t,i,s)}writeSection(){for(;this.holder.entities.length>0;){let e=this.holder.entities.shift();this.writeEntity(e)}}};T();ie();var td=class extends rr{get sectionName(){return h.headerSection}get header(){return this._document.header}constructor(e,t,i,s){super(e,t,i,s)}writeSection(){let e=Nt.getHeaderMap();for(let[t,i]of e)if(!(!this.configuration.writeAllHeaderVariables&&!this.configuration.headerVariables.has(t))&&(i.referenceType&Qe.Ignored)===0&&!(i.getValue(this.header)===null||i.getValue(this.header)===void 0)){if(this._writer.write(w.CLShapeText,t),t==="$HANDSEED"){this._writer.write(w.Handle,this._document.header.handleSeed);continue}if(t==="$CECOLOR"){this._writer.write(62,this._document.header.currentEntityColor.getApproxIndex());continue}for(let s of i.dxfCodes){let a=i.getSystemValue(s,this._document.header);a!=null&&this._writer.write(s,a)}}}};T();ie();D();xr();var rd=class extends rr{get sectionName(){return h.objectsSection}constructor(e,t,i,s){super(e,t,i,s)}writeBookColor(e){this._writer.write(w.Subclass,d.dbColor),this._writer.write(62,e.color.getApproxIndex()),this._writer.writeTrueColor(420,e.color),this._writer.write(430,`${e.name}$${e.bookName}`)}writeDictionary(e){this._writer.write(w.Subclass,d.dictionary),this._writer.write(280,e.hardOwnerFlag),this._writer.write(281,e.clonningFlags);for(let t of e)t instanceof Mt&&!this.configuration.writeXRecords||(this._writer.write(3,t.name),this._writer.write(350,t.handle),this.holder.objects.push(t));e instanceof ai&&(this._writer.write(100,d.dictionaryWithDefault),this._writer.writeHandle(340,e.defaultEntry))}writeDictionaryVariable(e){let t=L.create(Ke);this._writer.write(100,d.dictionaryVariables),this._writer.write(1,e.value,t),this._writer.write(280,e.objectSchemaNumber,t)}writeGeoData(e){let t=L.create(_r);switch(this._writer.write(100,d.geoData,t),this.version){case u.Unknown:case u.MC0_0:case u.AC1_2:case u.AC1_4:case u.AC1_50:case u.AC2_10:case u.AC1002:case u.AC1003:case u.AC1004:case u.AC1006:case u.AC1009:case u.AC1012:case u.AC1014:case u.AC1015:case u.AC1018:case u.AC1021:this._writer.write(90,1,t);break;case u.AC1024:this._writer.write(90,2,t);break;case u.AC1027:case u.AC1032:this._writer.write(90,3,t);break}if(e.hostBlock!==null&&this._writer.write(330,e.hostBlock.handle,t),this._writer.write(70,e.coordinatesType,t),this.version<=u.AC1021){this._writer.write(40,e.referencePoint.y,t),this._writer.write(41,e.referencePoint.x,t),this._writer.write(42,e.referencePoint.z,t),this._writer.write(91,e.horizontalUnits,t),this._writer.writeVector(10,e.designPoint,t),this._writer.writeVector(11,c.zero,t),this._writer.writeVector(210,e.upDirection,t),this._writer.write(52,ae.radToDeg(Math.PI/2-e.northDirection.getAngle()),t),this._writer.write(43,1,t),this._writer.write(44,1,t),this._writer.write(45,1,t),this._writer.write(301,e.coordinateSystemDefinition,t),this._writer.write(302,e.geoRssTag,t),this._writer.write(46,e.userSpecifiedScaleFactor,t),this._writer.write(303,"",t),this._writer.write(304,"",t),this._writer.write(305,e.observationFromTag,t),this._writer.write(306,e.observationToTag,t),this._writer.write(307,e.observationCoverageTag,t),this._writer.write(93,e.points.length,t);for(let i of e.points)this._writer.writeVector(12,i.source,t),this._writer.writeVector(13,i.destination,t);this._writer.write(96,e.faces.length,t);for(let i of e.faces)this._writer.write(97,i.index1,t),this._writer.write(98,i.index2,t),this._writer.write(99,i.index3,t);this._writer.write(3,"CIVIL3D_DATA_BEGIN",t),this._writer.write(292,!1,t),this._writer.writeVector(14,new g(e.referencePoint.x,e.referencePoint.y),t),this._writer.writeVector(15,new g(e.referencePoint.x,e.referencePoint.y),t),this._writer.write(93,0,t),this._writer.write(94,0,t),this._writer.write(293,!1,t),this._writer.writeVector(16,g.zero,t),this._writer.writeVector(17,g.zero,t),this._writer.write(54,ae.radToDeg(Math.PI/2-e.northDirection.getAngle()),t),this._writer.write(140,Math.PI/2-e.northDirection.getAngle(),t),this._writer.write(95,e.scaleEstimationMethod,t),this._writer.write(141,e.userSpecifiedScaleFactor,t),this._writer.write(294,e.enableSeaLevelCorrection,t),this._writer.write(142,e.seaLevelElevation,t),this._writer.write(143,e.coordinateProjectionRadius,t),this._writer.write(4,"CIVIL3D_DATA_END",t)}else{this._writer.writeVector(10,e.designPoint,t),this._writer.writeVector(11,e.referencePoint,t),this._writer.write(40,e.verticalUnitScale,t),this._writer.write(91,e.horizontalUnits,t),this._writer.write(41,e.verticalUnitScale,t),this._writer.write(92,e.verticalUnits,t),this._writer.writeVector(210,e.upDirection,t),this._writer.writeVector(12,e.northDirection,t),this._writer.write(95,e.scaleEstimationMethod,t),this._writer.write(141,e.userSpecifiedScaleFactor,t),this._writer.write(294,e.enableSeaLevelCorrection,t),this._writer.write(142,e.seaLevelElevation,t),this._writer.write(143,e.coordinateProjectionRadius,t),this.writeLongTextValue(301,303,e.coordinateSystemDefinition),this._writer.write(302,e.geoRssTag,t),this._writer.write(305,e.observationFromTag,t),this._writer.write(306,e.observationToTag,t),this._writer.write(307,e.observationCoverageTag,t),this._writer.write(93,e.points.length,t);for(let i of e.points)this._writer.writeVector(13,i.source,t),this._writer.writeVector(14,i.destination,t);this._writer.write(96,e.faces.length,t);for(let i of e.faces)this._writer.write(97,i.index1,t),this._writer.write(98,i.index2,t),this._writer.write(99,i.index3,t)}}writeGroup(e){this._writer.write(100,d.group),this._writer.write(300,e.description),this._writer.write(70,e.isUnnamed?1:0),this._writer.write(71,e.selectable?1:0);for(let t of e.entities)this._writer.writeHandle(340,t)}writeImageDefinition(e){let t=L.create(oi);this._writer.write(100,d.rasterImageDef),this._writer.write(90,e.classVersion,t),this._writer.write(1,e.fileName,t),this._writer.writeVector(10,e.size,t),this._writer.write(280,e.isLoaded?1:0,t),this._writer.write(281,e.units,t)}writeLayout(e){let t=L.create(ke);this.writePlotSettings(e),this._writer.write(100,d.layout),this._writer.write(1,e.name,t),this._writer.write(71,e.tabOrder,t),this._writer.writeVector(10,e.minLimits,t),this._writer.writeVector(11,e.maxLimits,t),this._writer.writeVector(12,e.insertionBasePoint,t),this._writer.writeVector(13,e.origin,t),this._writer.writeVector(14,e.minExtents,t),this._writer.writeVector(15,e.maxExtents,t),this._writer.writeVector(16,e.xAxis,t),this._writer.writeVector(17,e.yAxis,t),this._writer.write(146,e.elevation,t),this._writer.write(76,0,t),this._writer.writeHandle(330,e.associatedBlock,t)}writeMLineStyle(e){let t=L.create(At);this._writer.write(100,d.mLineStyle),this._writer.write(2,e.name,t),this._writer.write(70,e.flags,t),this._writer.write(3,e.description,t),this._writer.write(62,e.fillColor.getApproxIndex(),t),this._writer.write(51,e.startAngle,t),this._writer.write(52,e.endAngle,t),this._writer.write(71,e.elements.length,t);for(let i of e.elements)this._writer.write(49,i.offset,t),this._writer.write(62,i.color.index,t),this._writer.write(6,i.lineType?.name??"ByLayer",t)}writeMultiLeaderStyle(e){let t=L.create(ct);this._writer.write(100,d.mLeaderStyle),this._writer.write(179,2),this._writer.write(170,e.contentType,t),this._writer.write(171,e.multiLeaderDrawOrder,t),this._writer.write(172,e.leaderDrawOrder,t),this._writer.write(90,e.maxLeaderSegmentsPoints,t),this._writer.write(40,e.firstSegmentAngleConstraint,t),this._writer.write(41,e.secondSegmentAngleConstraint,t),this._writer.write(173,e.pathType,t),this._writer.writeCmColor(91,e.lineColor,t),this._writer.writeHandle(340,e.leaderLineType),this._writer.write(92,e.leaderLineWeight,t),this._writer.write(290,e.enableLanding,t),this._writer.write(42,e.landingGap,t),this._writer.write(291,e.enableDogleg,t),this._writer.write(43,e.landingDistance,t),this._writer.write(3,e.description,t),this._writer.writeHandle(341,e.arrowhead),this._writer.write(44,e.arrowheadSize,t),this._writer.write(300,e.defaultTextContents,t),this._writer.writeHandle(342,e.textStyle),this._writer.write(174,e.textLeftAttachment,t),this._writer.write(178,e.textRightAttachment,t),this._writer.write(175,e.textAngle,t),this._writer.write(176,e.textAlignment,t),this._writer.writeCmColor(93,e.textColor,t),this._writer.write(45,e.textHeight,t),this._writer.write(292,e.textFrame,t),this._writer.write(297,e.textAlignAlwaysLeft,t),this._writer.write(46,e.alignSpace,t),this._writer.writeHandle(343,e.blockContent),this._writer.writeCmColor(94,e.blockContentColor,t),this._writer.write(47,e.blockContentScale.x,t),this._writer.write(49,e.blockContentScale.y,t),this._writer.write(140,e.blockContentScale.z,t),this._writer.write(293,e.enableBlockContentScale,t),this._writer.write(141,e.blockContentRotation,t),this._writer.write(294,e.enableBlockContentRotation,t),this._writer.write(177,e.blockContentConnection,t),this._writer.write(142,e.scaleFactor,t),this._writer.write(295,e.overwritePropertyValue,t),this._writer.write(296,e.isAnnotative,t),this._writer.write(143,e.breakGapSize,t),this._writer.write(271,e.textAttachmentDirection,t),this._writer.write(272,e.textBottomAttachment,t),this._writer.write(273,e.textTopAttachment,t),this._writer.write(298,!1)}writeObject(e){if(this._isObjectSupported(e)&&!(e instanceof Mt&&!this.configuration.writeXRecords)){if(this._writer.write(w.Start,e.objectName),this.writeCommonObjectData(e),e instanceof vi){this._writeAcdbPlaceHolder(e);return}else if(e instanceof Ei){this.writeBookColor(e);return}else if(e instanceof re){this.writeDictionary(e);return}else if(e instanceof Ke)this.writeDictionaryVariable(e);else if(e instanceof Dt)this._writeDimensionAssociation(e);else if(e instanceof _r)this.writeGeoData(e);else if(e instanceof Ft)this.writeGroup(e);else if(e instanceof oi){this.writeImageDefinition(e);return}else if(e instanceof Ut){this._writeImageDefinitionReactor(e);return}else if(e instanceof ke)this.writeLayout(e);else if(e instanceof Li)this._writeField(e);else if(e instanceof ji)this._writeFieldList(e);else if(e instanceof At)this.writeMLineStyle(e);else if(e instanceof ct)this.writeMultiLeaderStyle(e);else if(e instanceof Bt)this.writePlotSettings(e);else if(e instanceof Ai)this.writePdfUnderlayDefinition(e);else if(e instanceof li)this.writeRasterVariables(e);else if(e instanceof lt)this.writeScale(e);else if(e instanceof br)this._writeSpatialFilter(e);else if(e instanceof pt)this._writeSortentsTable(e);else if(e instanceof Mt)this.writeXRecord(e);else throw new Error(`Object not implemented : ${e.constructor.name}`);this.writeExtendedData(e.extendedData)}}writePdfUnderlayDefinition(e){let t=L.create(Bt);this._writer.write(100,d.underlayDefinition),this._writer.write(1,e.file,t),this._writer.write(2,e.page,t)}writePlotSettings(e){let t=L.create(Bt);this._writer.write(100,d.plotSettings),this._writer.write(1,e.pageName,t),this._writer.write(2,e.systemPrinterName,t),this._writer.write(4,e.paperSize,t),this._writer.write(6,e.plotViewName,t),this._writer.write(7,e.styleSheet,t),this._writer.write(40,e.unprintableMargin.left,t),this._writer.write(41,e.unprintableMargin.bottom,t),this._writer.write(42,e.unprintableMargin.right,t),this._writer.write(43,e.unprintableMargin.top,t),this._writer.write(44,e.paperWidth,t),this._writer.write(45,e.paperHeight,t),this._writer.write(46,e.plotOriginX,t),this._writer.write(47,e.plotOriginY,t),this._writer.write(48,e.windowLowerLeftX,t),this._writer.write(49,e.windowLowerLeftY,t),this._writer.write(140,e.windowUpperLeftX,t),this._writer.write(141,e.windowUpperLeftY,t),this._writer.write(142,e.numeratorScale,t),this._writer.write(143,e.denominatorScale,t),this._writer.write(70,e.flags,t),this._writer.write(72,e.paperUnits,t),this._writer.write(73,e.paperRotation,t),this._writer.write(74,e.plotType,t),this._writer.write(75,e.scaledFit,t),this._writer.write(76,e.shadePlotMode,t),this._writer.write(77,e.shadePlotResolutionMode,t),this._writer.write(78,e.shadePlotDPI,t),this._writer.write(147,e.printScale,t),this._writer.write(148,e.paperImageOrigin.x,t),this._writer.write(149,e.paperImageOrigin.y,t)}writeRasterVariables(e){let t=L.create(li);this._writer.write(100,d.rasterVariables),this._writer.write(90,e.classVersion,t),this._writer.write(70,e.isDisplayFrameShown?1:0,t),this._writer.write(71,e.displayQuality,t),this._writer.write(72,e.displayQuality,t)}writeScale(e){this._writer.write(100,d.scale),this._writer.write(70,0),this._writer.write(300,e.name),this._writer.write(140,e.paperUnits),this._writer.write(141,e.drawingUnits),this._writer.write(290,e.isUnitScale?1:0)}writeSection(){for(;this.holder.objects.length>0;){let e=this.holder.objects.shift();this.writeObject(e)}}writeXRecord(e){this._writer.write(w.Subclass,d.xRecord),this._writer.write(280,e.cloningFlags);for(let t of e.entries)switch(t.groupCode){case f.None:break;case f.Point3D:let i=t.value;i&&typeof i.x=="number"&&typeof i.y=="number"?this._writer.writeVector(t.code,t.value):this._writer.write(t.code,t.value);break;case f.Handle:case f.ObjectId:case f.ExtendedDataHandle:{let s=t.value;this._writer.write(t.code,s.handle);break}default:this._writer.write(t.code,t.value);break}}_isObjectSupported(e){return e instanceof Kr?!1:e instanceof na||e instanceof aa||e instanceof oa||e instanceof Dt||e instanceof Vt||e instanceof ft||e instanceof Jt||e instanceof Ni||e instanceof dt||e instanceof ci||e instanceof ni||e instanceof Pi||e instanceof ki?(this.notify(`Object not implemented : ${e.constructor.name}`,y.NotImplemented),!1):!0}_writeAcdbPlaceHolder(e){}_writeDimensionAssociation(e){let t=L.create(Dt);this._writer.write(100,d.dimensionAssociation),this._writer.writeHandle(330,e.dimension,t),this._writer.write(90,e.associativityFlags,t),this._writer.write(70,e.isTransSpace,t),this._writer.write(71,e.rotatedDimensionType,t),(e.associativityFlags&we.FirstPointReference)!==0&&this._writeOsnapPointRef(e.firstPointRef),(e.associativityFlags&we.SecondPointReference)!==0&&this._writeOsnapPointRef(e.secondPointRef),(e.associativityFlags&we.ThirdPointReference)!==0&&this._writeOsnapPointRef(e.thirdPointRef),(e.associativityFlags&we.FourthPointReference)!==0&&this._writeOsnapPointRef(e.fourthPointRef)}_writeField(e){this._writer.write(w.Subclass,d.field),this._writer.write(1,e.evaluatorId),this.writeLongTextValue(2,3,e.fieldCode),this._writer.write(90,e.children.length);for(let t of e.children)this._writer.writeHandle(360,t);this._writer.write(97,e.cadObjects.length);for(let t of e.cadObjects)this._writer.writeHandle(331,t);this._writer.write(91,e.evaluationOptionFlags),this._writer.write(92,e.filingOptionFlags),this._writer.write(94,e.fieldStateFlags),this._writer.write(95,e.evaluationStatusFlags),this._writer.write(96,e.evaluationErrorCode),this._writer.write(300,e.evaluationErrorMessage),this._writer.write(93,e.values.size);for(let[t,i]of e.values)this._writer.write(6,t),this.writeCadValue(i);this._writer.write(7,"ACFD_FIELD_VALUE"),this.writeCadValue(e.value),this.writeLongTextValue(301,9,e.formatString),this._writer.write(98,e.formatString.length)}_writeFieldList(e){this._writer.write(w.Subclass,d.idSet),this._writer.write(90,e.fields.length);for(let t of e.fields)this._writer.writeHandle(330,t),this.holder.objects.push(t);this._writer.write(w.Subclass,d.fieldList)}_writeImageDefinitionReactor(e){this._writer.write(w.Subclass,d.rasterImageDefReactor),this._writer.write(90,e.classVersion),this._writer.writeHandle(330,e.image)}_writeOsnapPointRef(e){e!==null&&(this._writer.write(1,Dt.osnapPointRefClassName),this._writer.write(72,e.objectOsnapType),this._writer.writeHandle(331,e.geometry),this._writer.write(73,e.subentType),this._writer.write(91,e.gsMarker),this._writer.write(40,e.geometryParameter),this._writer.writeVector(10,e.osnapPoint),this._writer.write(75,e.hasLastPointRef?1:0))}_writeSortentsTable(e){this._writer.write(w.Subclass,d.sortentsTable),this._writer.writeHandle(330,e.blockOwner);for(let t of e)this._writer.writeHandle(331,t.entity),this._writer.write(5,t.sortHandle)}_writeSpatialFilter(e){let t=L.create(br);this._writer.write(100,d.filter),this._writer.write(100,d.spatialFilter),this._writer.write(70,e.boundaryPoints.length,t);for(let s of e.boundaryPoints)this._writer.writeVector(10,s,t);this._writer.writeVector(210,e.normal,t),this._writer.writeVector(11,e.origin,t),this._writer.write(71,e.displayBoundary?1:0,t),this._writer.write(72,e.clipFrontPlane?1:0,t),e.clipFrontPlane&&this._writer.write(40,e.frontDistance,t),this._writer.write(73,e.clipBackPlane?1:0,t),e.clipBackPlane&&this._writer.write(41,e.backDistance,t);let i=[e.inverseInsertTransform.m00,e.inverseInsertTransform.m01,e.inverseInsertTransform.m02,e.inverseInsertTransform.m03,e.inverseInsertTransform.m10,e.inverseInsertTransform.m11,e.inverseInsertTransform.m12,e.inverseInsertTransform.m13,e.inverseInsertTransform.m20,e.inverseInsertTransform.m21,e.inverseInsertTransform.m22,e.inverseInsertTransform.m23,e.insertTransform.m00,e.insertTransform.m01,e.insertTransform.m02,e.insertTransform.m03,e.insertTransform.m10,e.insertTransform.m11,e.insertTransform.m12,e.insertTransform.m13,e.insertTransform.m20,e.insertTransform.m21,e.insertTransform.m22,e.insertTransform.m23];for(let s=0;st.toLowerCase()).includes(e.toLowerCase()))throw new Error(`The variable ${e} cannot be removed from the set`);return this._headerVariables.delete(e)}};ie();T();var _h=class{_stream;_encoding;_position=0;constructor(e,t){this._stream=e,this._encoding=t}write(e){let t=ts(e,this._encoding);this._ensureCapacity(t.length),this._stream.set(t,this._position),this._position+=t.length}flush(){}close(){}_ensureCapacity(e){if(this._position+e>this._stream.length)throw new Error("DXF output buffer is too small.")}},bh=class{_stream;_position=0;constructor(e){this._stream=e}write(e){this._ensureCapacity(e.length),this._stream.set(e,this._position),this._position+=e.length}flush(){}close(){}_ensureCapacity(e){if(this._position+e>this._stream.length)throw new Error("DXF output buffer is too small.")}},yh=class r extends Gs{isBinary;_writer;_objectHolder=new Mc;constructor(e,t,i=!1){super(e,t),this.isBinary=i,this.configuration=new pl}write(){super.write(),this._createStreamWriter(),this._objectHolder.objects.push(this._document.rootDictionary),this._writeHeader(),this._writeDxfClasses(),this._writeTables(),this._writeBlocks(),this._writeEntities(),this._writeObjects(),this._writeACDSData(),this._writer.write(w.Start,h.endOfFile),this._writer.flush(),this.configuration.closeStream&&this._writer.close()}dispose(){this._writer.dispose()}static writeToStream(e,t,i=!1,s,a){let n=new r(e,t,i);s&&(n.configuration=s),n.onNotification=a??null,n.write(),n.dispose()}_createStreamWriter(){this.isBinary?this._writer=new Kc(this._createBinaryTarget(),this._encoding):this._writer=new qc(this._createTextTarget()),this._writer.writeOptional=this.configuration.writeOptionalValues}_createTextTarget(){return this._stream instanceof Uint8Array?new _h(this._stream,this._encoding):this._stream}_createBinaryTarget(){return this._stream instanceof Uint8Array?new bh(this._stream):this._stream}_writeHeader(){let e=new td(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeDxfClasses(){let e=new Qc(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeTables(){let e=new id(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeBlocks(){let e=new Jc(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeEntities(){let e=new ed(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeObjects(){let e=new rd(this._writer,this._document,this._objectHolder,this.configuration);e.onNotification=this.triggerNotification.bind(this),e.write()}_writeACDSData(){}createDefaultConfiguration(){return new pl}};var gh=class r{static _maxChunkSize=1048576*1024;static _maxChunkShift=30;static _maxChunkMask=1048576*1024-1;_currentChunk;_currentInChunk=0;_length;_position=0;_chunks;static create(e){return e<=2147483647?new Uint8Array(e):new r(e)}constructor(e){if(typeof e=="number"){let t=e;this._length=t,this._position=0,this._chunks=[];let i=t;for(;i>0;){let s=Math.min(i,r._maxChunkSize);this._chunks.push(new Uint8Array(s)),i-=s}this.position=0}else this._chunks=e,this._length=e.reduce((t,i)=>t+i.length,0),this.position=0}get canRead(){return!0}get canSeek(){return!0}get canWrite(){return!0}get length(){return this._length}get position(){return this._position}set position(e){this._position=e,this._currentChunk=this._chunks[e>>r._maxChunkShift],this._currentInChunk=e&r._maxChunkMask}read(e,t,i){if(i===1)return e[t]=this._currentChunk[this._currentInChunk],this.position++,1;if(this._currentInChunk+i>r._maxChunkSize){let s=r._maxChunkSize-this._currentInChunk;return e.set(this._currentChunk.subarray(this._currentInChunk,this._currentInChunk+s),t),this.position+=s,s+this.read(e,t+s,i-s)}else return e.set(this._currentChunk.subarray(this._currentInChunk,this._currentInChunk+i),t),this.position+=i,i}readByte(){let e=this._currentChunk[this._currentInChunk];return this.position++,e}write(e,t,i){if(i===1){this._currentChunk[this._currentInChunk]=e[t],this.position++;return}if(this._currentInChunk+i>r._maxChunkSize){let s=r._maxChunkSize-this._currentInChunk;this._currentChunk.set(e.subarray(t,t+s),this._currentInChunk),this.position+=s,this.write(e,t+s,i-s)}else this._currentChunk.set(e.subarray(t,t+i),this._currentInChunk),this.position+=i}writeByte(e){this._currentChunk[this._currentInChunk]=e,this.position++}clone(){return new r(this._chunks)}static cloneStream(e){if(e instanceof r)return e.clone();if(e instanceof Uint8Array)return new Uint8Array(e);throw new Error("The provided stream type is not supported for cloning.")}};var sd=class extends Xs{lineWeightRatio=100;defaultLineWeight=.01;pointRadius=.1;arcPoints=256;getLineWeightValue(e,t){let i=Math.abs(e);if(t===ce.Unitless)return i/this.lineWeightRatio;switch(e){case F.Default:return this.defaultLineWeight;case F.W0:return .001}return Zl.getLineWeightValue(e)}};var I=class r{static toSvg(e){return e.toString()}static toSvgWithUnits(e,t){let i="";switch(t){case ce.Centimeters:i="cm";break;case ce.Millimeters:i="mm";break;case ce.Inches:i="in";break}return`${e.toString()}${i}`}static vectorToSvg(e){return`${r.toSvg(e.x)},${r.toSvg(e.y)}`}static vectorToSvgWithUnits(e,t){return`${r.toSvgWithUnits(e.x,t)},${r.toSvgWithUnits(e.y,t)}`}static toPixelSize(e,t){switch(t){case ce.Inches:return e*96;case ce.Millimeters:return e*96/25.4;case ce.Unitless:return e;default:throw new Error(`Invalid units value: ${t}`)}}static vectorToPixelSize(e,t){let i={...e};return i.x=r.toPixelSize(i.x,t),i.y=r.toPixelSize(i.y,t),i.z!==void 0&&(i.z=r.toPixelSize(i.z,t)),i}};var fl=class{translation=new c(0,0,0);scale=new c(1,1,1);eulerRotation=new c(0,0,0);matrix=null;constructor(e,t,i){e&&(this.translation=e),t&&(this.scale=t),i&&(this.eulerRotation=i)}applyTransform(e){return new c(e.x+this.translation.x,e.y+this.translation.y,e.z+this.translation.z)}},Ra=class{onNotification=null;configuration;layout=null;units=ce.Unitless;formatting="Indented";_output="";_indent=0;_elementStack=[];_inAttribute=!1;_attrName="";_attrValue="";_currentElementOpen=!1;_stream;_encoding;constructor(e,t,i){this._stream=e,i!==void 0?(this._encoding=t,this.configuration=i):(this._encoding=null,this.configuration=t)}writeBlock(e){this.units=e.units;let t=this._getBlockBoundingBox(e);this._startDocument(t,t,this.units);for(let i of e.entities)this.writeEntity(i);this._endDocument()}writeLayout(e){this.layout=e,this.units=Za.toUnits(e.paperUnits);let t=e.paperWidth,i=e.paperHeight;switch(e.paperRotation){case pi.Degrees90:case pi.Degrees270:t=e.paperHeight,i=e.paperWidth;break}let s=new c(0,0,0),a=new c(t,i,0),n={min:s,max:a,width:t,height:i},o=new c(e.unprintableMargin?.bottomLeftCorner?.x??0,e.unprintableMargin?.bottomLeftCorner?.y??0,0);this._startDocument(n,null,ce.Millimeters);let l=new fl(I.vectorToPixelSize(o,ce.Millimeters),new c(e.printScale,e.printScale,e.printScale),new c(0,0,0));for(let p of e.associatedBlock.entities)this.writeEntity(p,l);this._endDocument()}writeStartDocument(){this._output+=` `}writeEndDocument(){}writeStartElement(e){this._closeOpenElement(),this._output+=`${this._getIndent()}<${e}`,this._elementStack.push(e),this._currentElementOpen=!0,this._indent++}writeEndElement(){if(this._indent--,this._currentElementOpen)this._output+=` /> `,this._currentElementOpen=!1,this._elementStack.pop();else{this._elementStack.pop(),this._output+=`${this._getIndent()}=0,""}`,this._output=this._output.slice(0,this._output.lastIndexOf(`${this._getIndent()}<`));let e=(this._elementStack.length>=0,"");this._output+=`${this._getIndent()} `}}writeAttributeString(e,t){typeof t=="number"?this._output+=` ${e}="${I.toSvgWithUnits(t,this.units)}"`:this._output+=` ${e}="${this._escapeXml(t)}"`}writeStartAttribute(e){this._inAttribute=!0,this._attrName=e,this._attrValue=""}writeEndAttribute(){this._output+=` ${this._attrName}="${this._escapeXml(this._attrValue)}"`,this._inAttribute=!1}writeValue(e){this._inAttribute?this._attrValue+=typeof e=="number"?e.toString():e:(this._closeOpenElement(),this._output+=this._escapeXml(typeof e=="number"?e.toString():e))}writeComment(e){this._closeOpenElement(),this._output+=`${this._getIndent()} `}writeString(e){this._closeOpenElement(),this._output+=this._escapeXml(e)}close(){let t=new TextEncoder().encode(this._output);this._stream instanceof Uint8Array&&this._stream.set(t)}getOutput(){return this._output}notify(e,t,i=null){this.onNotification&&this.onNotification(this,new tr(e,t,i))}triggerNotification(e,t){this.onNotification&&this.onNotification(e,t)}writeEntity(e,t){t||(t=new fl),this.writeComment(`${e.objectName} | ${e.handle}`),e instanceof We?this._writeArc(e,t):e instanceof K?this._writeDimension(e,t):e instanceof Me?this._writeLine(e,t):e instanceof kt?this._writePoint(e,t):e instanceof Et?this._writeCircle(e,t):e instanceof bt?this._writeEllipse(e,t):e instanceof Kt?this._writeHatch(e,t):e instanceof Ye?this._writeInsert(e,t):"isClosed"in e&&"vertices"in e?this._writePolyline(e,t):e instanceof at||e instanceof ve?this._writeText(e,t):e instanceof mr?this._writeSolid(e,t):this.notify(`[${e.objectName}] Entity not implemented.`,y.NotImplemented)}_closeOpenElement(){this._currentElementOpen&&(this._output+=`> `,this._currentElementOpen=!1)}_getIndent(){return" ".repeat(this._indent)}_getClosingTag(){return""}_escapeXml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}_colorSvg(e){return this.layout!==null&&e.equals(S.default)&&(e=S.black),`rgb(${e.r},${e.g},${e.b})`}_getBlockBoundingBox(e){let t=1/0,i=1/0,s=1/0,a=-1/0,n=-1/0,o=-1/0;for(let b of e.entities){if(!(b instanceof N))continue;let x=this._normalizeBoundingBox(b.getBoundingBox());x&&(t=Math.min(t,x.min.x),i=Math.min(i,x.min.y),s=Math.min(s,x.min.z),a=Math.max(a,x.max.x),n=Math.max(n,x.max.y),o=Math.max(o,x.max.z))}if(!Number.isFinite(t)||!Number.isFinite(a))return{min:new c(0,0,0),max:new c(0,0,0),width:0,height:0};let l=new c(t,i,s),p=new c(a,n,o);return{min:l,max:p,width:p.x-l.x,height:p.y-l.y}}_normalizeBoundingBox(e){if(!e||typeof e!="object")return null;let t=e,i=t.min??t.min,s=t.max??t.max;if(!i||!s)return null;let a=new c(i.x??0,i.y??0,i.z??0),n=new c(s.x??0,s.y??0,s.z??0);return{min:a,max:n,width:n.x-a.x,height:n.y-a.y}}_getPolylinePoints(e){if(typeof e.getPoints=="function")return e.getPoints(this.configuration.arcPoints);let t=[];for(let i of e.vertices??[]){if(i==null||typeof i!="object")continue;let s=typeof i.getLocation3D=="function"?i.getLocation3D():i.location;if(typeof s=="object"&&s!==null){let a=s;typeof a.x=="number"&&typeof a.y=="number"&&typeof a.z=="number"?t.push(new c(a.x,a.y,a.z)):typeof a.x=="number"&&typeof a.y=="number"&&t.push(new g(a.x,a.y))}}return t}_createPath(...e){let t="";for(let i of e){let s=this._getPolylinePoints(i);if(!s||s.length===0)continue;let a=I.vectorToPixelSize(s[0],this.units);t+=`M ${I.vectorToSvg(a)} `;for(let n=1;nMath.PI?1:0,l="";l+=`M ${I.vectorToSvg(I.vectorToPixelSize(s,this.units))}`,l+=" ",l+=`A ${I.toPixelSize(e.radius,this.units)} ${I.toPixelSize(e.radius,this.units)}`,l+=" ",l+=`0 ${o} 1 ${I.vectorToSvg(I.vectorToPixelSize(a,this.units))}`,this.writeAttributeString("d",l),this.writeAttributeString("fill","none"),this.writeEndElement()}_writeDimension(e,t){if(this.writeStartElement("g"),e.block&&e.block.entities)for(let i of e.block.entities)this.writeEntity(i,t);this.writeEndElement()}_writeCircle(e,t){let i=t.applyTransform(e.center);this.writeStartElement("circle"),this._writeEntityHeader(e,t),this.writeAttributeString("r",I.toSvgWithUnits(e.radius,this.units)),this.writeAttributeString("cx",I.toSvgWithUnits(i.x,this.units)),this.writeAttributeString("cy",I.toSvgWithUnits(i.y,this.units)),this.writeAttributeString("fill","none"),this.writeEndElement()}_writeDashes(e){let t="";for(let i of e)t+=Math.abs(I.toPixelSize(i,this.units)).toString(),t+=" ";this.writeAttributeString("stroke-dasharray",t.trim())}_writeDashesFromLineType(e,t){let i="";for(let s of e.segments)s.length===0?i+=I.toPixelSize(t,this.units).toString():i+=Math.abs(I.toPixelSize(s.length,this.units)).toString(),i+=" ";this.writeAttributeString("stroke-dasharray",i.trim())}_writeEllipse(e,t){if(e.isFullEllipse){this.writeStartElement("path"),this._writeEntityHeader(e,t);let i="",s=e.polarCoordinateRelativeToCenter?e.polarCoordinateRelativeToCenter(0):new c(0,0,0),a=e.polarCoordinateRelativeToCenter?e.polarCoordinateRelativeToCenter(Math.PI):new c(0,0,0);i+=`M ${I.vectorToSvg(I.vectorToPixelSize(s,this.units))} `,i+=`A ${e.majorAxis/2} ${e.minorAxis/2} ${e.rotation*180/Math.PI} 0 1 ${I.vectorToSvg(I.vectorToPixelSize(a,this.units))} `;let n=e.polarCoordinateRelativeToCenter?e.polarCoordinateRelativeToCenter(Math.PI):new c(0,0,0),o=e.polarCoordinateRelativeToCenter?e.polarCoordinateRelativeToCenter(Math.PI*2):new c(0,0,0);i+=`A ${e.majorAxis/2} ${e.minorAxis/2} ${e.rotation*180/Math.PI} 0 1 ${I.vectorToSvg(I.vectorToPixelSize(o,this.units))}`,this.writeAttributeString("d",i),this.writeAttributeString("fill","none"),this.writeEndElement()}else{this.writeStartElement("polyline"),this._writeEntityHeader(e,t);let i=e.polygonalVertexes?e.polygonalVertexes(256):[],s=this._svgPoints(i,t);this.writeAttributeString("points",s),this.writeAttributeString("fill","none"),this.writeEndElement()}}_writeEntityHeader(e,t,i=!0){let s=e.getActiveColor?e.getActiveColor():e.color??S.default;this.writeAttributeString("vector-effect","non-scaling-stroke"),i?this.writeAttributeString("stroke",this._colorSvg(s)):this.writeAttributeString("stroke","none");let a=e.getActiveLineWeightType?e.getActiveLineWeightType():F.Default;this.writeAttributeString("stroke-width",`${I.toSvgWithUnits(this.configuration.getLineWeightValue(a,this.units),ce.Millimeters)}`),this._writeTransformObj(t);let n=e.getActiveLineType?e.getActiveLineType():null;n&&this._drawableLineType(n)&&this._writeDashesFromLineType(n,this._getPointSize(e))}_writeHatch(e,t){this.writeStartElement("g");let i=this._writePattern(e),s=[];for(let a of e.paths){let n=a.getPoints?a.getPoints(this.configuration.arcPoints):[],o=new gt(n);s.push(o)}this.writeStartElement("path"),this._writeEntityHeader(e,t,!1),this.writeAttributeString("d",this._createPath(...s)),this.writeAttributeString("fill",`url(#${i})`),this.writeEndElement(),this.writeEndElement()}_writePatternHeader(e){let t=`${e.pattern.name}_pattern`;return this.writeStartElement("pattern"),this.writeAttributeString("id",t),this.writeAttributeString("patternUnits","userSpaceOnUse"),t}_writeSolidPattern(e){let t=this._writePatternHeader(e);return this.writeAttributeString("width","100%"),this.writeAttributeString("height","100%"),this.writeStartElement("rect"),this.writeAttributeString("width","100%"),this.writeAttributeString("height","100%"),this.writeAttributeString("fill",this._colorSvg(e.color)),this.writeEndElement(),this.writeEndElement(),t}_writePattern(e){if(e.isSolid)return this._writeSolidPattern(e);let t=new Map;for(let[n,o]of e.pattern.lines.entries()){let l=`${e.pattern.name}_${n}_line`;t.set(l,{min:new c(0,0,0),max:new c(o.lineOffset,o.lineOffset,0),width:o.lineOffset,height:o.lineOffset}),this.writeStartElement("pattern"),this.writeAttributeString("id",l),this.writeAttributeString("patternUnits","userSpaceOnUse"),this.writeAttributeString("width",I.toSvgWithUnits(o.lineOffset,this.units)),this.writeAttributeString("height",I.toSvgWithUnits(o.lineOffset,this.units)),this._writeTransformValues("patternTransform",I.vectorToPixelSize(new c(o.basePoint.x,o.basePoint.y,0),this.units)),this.writeStartElement("line");let p=Math.cos(o.angle)*10,b=Math.sin(o.angle)*10;this.writeAttributeString("x1",I.toSvgWithUnits(0,this.units)),this.writeAttributeString("y1",I.toSvgWithUnits(0,this.units)),this.writeAttributeString("x2",I.toSvgWithUnits(p,this.units)),this.writeAttributeString("y2",I.toSvgWithUnits(b,this.units)),this.writeAttributeString("stroke",this._colorSvg(e.color)),this.writeAttributeString("stroke-width",`${I.toSvgWithUnits(this.configuration.getLineWeightValue(e.lineWeight??F.Default,this.units),ce.Millimeters)}`),o.dashLengths&&o.dashLengths.length>0&&this._writeDashes(o.dashLengths),this.writeEndElement(),this.writeEndElement()}let i=this._writePatternHeader(e),s=0,a=0;for(let[,n]of t)n.width>s&&(s=n.width),n.height>a&&(a=n.height);this.writeAttributeString("width",I.toSvgWithUnits(s,this.units)),this.writeAttributeString("height",I.toSvgWithUnits(a,this.units));for(let[n,o]of t)this.writeStartElement("rect"),this.writeAttributeString("width",I.toSvgWithUnits(o.width,this.units)),this.writeAttributeString("height",I.toSvgWithUnits(o.height,this.units)),this.writeAttributeString("fill",`url(#${n})`),this.writeEndElement();return this.writeEndElement(),i}_writeInsert(e,t){let i=e.getTransform?e.getTransform():new fl,s=new fl(new c(t.translation.x+i.translation.x,t.translation.y+i.translation.y,t.translation.z+i.translation.z));this.writeStartElement("g"),this._writeTransformObj(s);for(let a of e.block.entities)this.writeEntity(a);this.writeEndElement()}_writeLine(e,t){this.writeStartElement("line"),this._writeEntityHeader(e,t),this.writeAttributeString("x1",I.toSvgWithUnits(e.startPoint.x,this.units)),this.writeAttributeString("y1",I.toSvgWithUnits(e.startPoint.y,this.units)),this.writeAttributeString("x2",I.toSvgWithUnits(e.endPoint.x,this.units)),this.writeAttributeString("y2",I.toSvgWithUnits(e.endPoint.y,this.units)),this.writeEndElement()}_writePoint(e,t){this.writeStartElement("circle"),this._writeEntityHeader(e,t),this.writeAttributeString("r",I.toSvgWithUnits(this.configuration.pointRadius,ce.Unitless)),this.writeAttributeString("cx",I.toSvgWithUnits(e.location.x,this.units)),this.writeAttributeString("cy",I.toSvgWithUnits(e.location.y,this.units)),this.writeAttributeString("fill",this._colorSvg(e.color)),this.writeEndElement()}_writePolyline(e,t){e.isClosed?this.writeStartElement("polygon"):this.writeStartElement("polyline"),this._writeEntityHeader(e,t);let i=this._getPolylinePoints(e),s=this._svgPoints(i,t);this.writeAttributeString("points",s),this.writeAttributeString("fill","none"),this.writeEndElement()}_writeText(e,t){let i;e instanceof at&&(e.horizontalAlignment!==Tt.Left||e.verticalAlignment!==St.Baseline)&&!(e.horizontalAlignment===Tt.Fit||e.horizontalAlignment===Tt.Aligned)?i=e.alignmentPoint:i=e.insertPoint,this.writeStartElement("g"),this._writeTransformObj(t),this.writeStartElement("text"),this._writeTransformValues("transform",I.vectorToPixelSize(i,this.units),new c(1,-1,0),e.rotation!==0?e.rotation:void 0),this.writeAttributeString("fill",this._colorSvg(e.color??S.default));let s="font:";if(s+=I.toSvgWithUnits(e.height,this.units),this.units===ce.Unitless&&(s+="px"),e.style?.trueType!==void 0&&(e.style.trueType&ua.Bold&&(s+="bold"),e.style.trueType&ua.Italic&&(s+="italic")),s+=" ",e.style?.filename){let n=e.style.filename.replace(/\.[^/.]+$/,"");s+=n}if(this.writeAttributeString("style",s),e instanceof ve){let a=e;switch(a.attachmentPoint){case se.TopLeft:this.writeAttributeString("alignment-baseline","hanging"),this.writeAttributeString("text-anchor","start");break;case se.TopCenter:this.writeAttributeString("alignment-baseline","hanging"),this.writeAttributeString("text-anchor","middle");break;case se.TopRight:this.writeAttributeString("alignment-baseline","hanging"),this.writeAttributeString("text-anchor","end");break;case se.MiddleLeft:this.writeAttributeString("alignment-baseline","middle"),this.writeAttributeString("text-anchor","start");break;case se.MiddleCenter:this.writeAttributeString("alignment-baseline","middle"),this.writeAttributeString("text-anchor","middle");break;case se.MiddleRight:this.writeAttributeString("alignment-baseline","middle"),this.writeAttributeString("text-anchor","end");break;case se.BottomLeft:this.writeAttributeString("alignment-baseline","baseline"),this.writeAttributeString("text-anchor","start");break;case se.BottomCenter:this.writeAttributeString("alignment-baseline","baseline"),this.writeAttributeString("text-anchor","middle");break;case se.BottomRight:this.writeAttributeString("alignment-baseline","baseline"),this.writeAttributeString("text-anchor","end");break}let n=a.getPlainTextLines?a.getPlainTextLines():[a.value];for(let o of n)this.writeStartElement("tspan"),this.writeAttributeString("x","0"),this.writeAttributeString("dy","1em"),this.writeString(o),this.writeEndElement();this.writeStartElement("tspan"),this.writeAttributeString("x","0"),this.writeAttributeString("dy","1em"),this.writeAttributeString("visibility","hidden"),this.writeString("."),this.writeEndElement()}else if(e instanceof at){let a=e;switch(a.horizontalAlignment){case Tt.Left:this.writeAttributeString("text-anchor","start");break;case Tt.Middle:case Tt.Center:this.writeAttributeString("text-anchor","middle");break;case Tt.Right:this.writeAttributeString("text-anchor","end");break}switch(a.verticalAlignment){case St.Baseline:case St.Bottom:this.writeAttributeString("alignment-baseline","baseline");break;case St.Middle:this.writeAttributeString("alignment-baseline","middle");break;case St.Top:this.writeAttributeString("alignment-baseline","hanging");break}this.writeString(e.value)}this.writeEndElement(),this.writeEndElement()}_writeSolid(e,t){this.writeStartElement("polygon"),this._writeEntityHeader(e,t);let i=this._svgPoints([e.firstCorner,e.secondCorner,e.thirdCorner,e.fourthCorner],t);this.writeAttributeString("points",i),this.writeAttributeString("fill",this._colorSvg(e.color)),this.writeEndElement()}_writeTransformObj(e){let t=e.translation.x!==0||e.translation.y!==0||e.translation.z!==0?e.translation:void 0,i=e.scale.x!==1||e.scale.y!==1?e.scale:void 0,s=e.eulerRotation.z!==0?e.eulerRotation.z:void 0;this._writeTransformValues("transform",t,i,s)}_writeTransformValues(e="transform",t,i,s){let a="";if(t&&(a+=`translate(${t.x.toString()},${t.y.toString()})`),i&&(a+=`scale(${i.x.toString()},${i.y.toString()})`),s!==void 0){let n=-(s*180/Math.PI);a+=`rotate(${n.toString()})`}a&&this.writeAttributeString(e,a)}};var xh=class extends Ra{entitiesWriter=null;lineTypeWriters=new Map;constructor(e,t,i){super(e,t,i)}writeLayout(e){this.units=Za.toUnits(e.paperUnits);let t=e.paperWidth,i=e.paperHeight;switch(e.paperRotation){case pi.Degrees90:case pi.Degrees270:t=e.paperHeight,i=e.paperWidth;break}let s=new c(0,0,0),a=new c(t,i,0),n={min:s,max:a,width:t,height:i},o=new c(e.unprintableMargin?.bottomLeftCorner?.x??0,e.unprintableMargin?.bottomLeftCorner?.y??0,0);this._startDocumentInternal(n);let l=I.vectorToPixelSize(o,this.units),p=new c(e.printScale,e.printScale,e.printScale);for(let b of e.associatedBlock.entities)this.writeEntity(b);this._endDocumentInternal()}_startDocumentInternal(e){this.writeStartDocument(),this.writeStartElement("svg"),this.writeAttributeString("xmlns","http://www.w3.org/2000/svg"),this.writeAttributeString("width",I.toSvgWithUnits(e.max.x-e.min.x,this.units)),this.writeAttributeString("height",I.toSvgWithUnits(e.max.y-e.min.y,this.units)),this.writeStartAttribute("viewBox"),this.writeValue(I.toSvgWithUnits(e.min.x,this.units)),this.writeValue(" "),this.writeValue(I.toSvgWithUnits(e.min.y,this.units)),this.writeValue(" "),this.writeValue(I.toSvgWithUnits(e.max.x-e.min.x,this.units)),this.writeValue(" "),this.writeValue(I.toSvgWithUnits(e.max.y-e.min.y,this.units)),this.writeEndAttribute(),this.writeAttributeString("transform","scale(1,-1)"),this.layout!==null&&this.writeAttributeString("style","background-color:white")}_endDocumentInternal(){this.writeEndElement(),this.writeEndDocument(),this.close()}_createWriter(){let e=new Ra(new Uint8Array(0),this.configuration);return e.formatting="Indented",e.onNotification=(t,i)=>this.triggerNotification(t,i),e}};var Ch=class extends Gs{_writer;constructor(e,t){super(e,t)}createDefaultConfiguration(){return new sd}dispose(){}write(){this.writeBlock(this._document.modelSpace)}writeBlock(e){this._createWriter(),this._writer.writeBlock(e)}writeLayout(e){this._createWriter(),this._writer.writeLayout(e)}_createWriter(){this._writer=new Ra(this._stream,this._encoding,this.configuration),this._writer.onNotification=(e,t)=>this.triggerNotification(e,t)}};var Dh;(function(r){r[r.AtLeast=1]="AtLeast",r[r.Exactly=2]="Exactly"})(Dh||(Dh={}));xr();var Th=class extends ge{constructor(e){super(e)}addOrUpdateVariable(e,t){let i=this.tryGet(e);i?i.value=t:this.add(new Ke(e,t))}addVariable(e,t){this.containsKey(e)||this.add(new Ke(e,t))}createDefaults(){this.addVariable(Ke.currentMultiLeaderStyle,ct.defaultName),this.addVariable(Ke.currentAnnotationScale,lt.defaultName),this.addVariable(Ke.currentTableStyle,dt.defaultName),this.addVariable(Ke.wipeoutFrame,"0"),this.addVariable("CVIEWDETAILSTYLE","Metric50"),this.addVariable("CVIEWSECTIONSTYLE","Metric50")}getValue(e){let t=this.tryGet(e);return t?t.value:null}};var Sh=class extends ge{constructor(e){super(e)}};var Bh=class extends ge{constructor(e){super(e)}createDefaults(){this._dictionary.tryAdd(ct.default_)}};var Rh=class extends ge{constructor(e){super(e)}};var Nh=class extends ge{constructor(e){super(e)}createDefaults(){let e=[{name:"1:1",paper:1,drawing:1,isUnit:!0},{name:"1:2",paper:1,drawing:2,isUnit:!1},{name:"1:4",paper:1,drawing:4,isUnit:!1},{name:"1:5",paper:1,drawing:5,isUnit:!1},{name:"1:8",paper:1,drawing:8,isUnit:!1},{name:"1:10",paper:1,drawing:10,isUnit:!1},{name:"1:16",paper:1,drawing:16,isUnit:!1},{name:"1:20",paper:1,drawing:20,isUnit:!1},{name:"1:30",paper:1,drawing:30,isUnit:!1},{name:"1:40",paper:1,drawing:40,isUnit:!1},{name:"1:50",paper:1,drawing:50,isUnit:!1},{name:"1:100",paper:1,drawing:100,isUnit:!1},{name:"2:1",paper:2,drawing:1,isUnit:!1},{name:"4:1",paper:4,drawing:1,isUnit:!1},{name:"8:1",paper:8,drawing:1,isUnit:!1},{name:"10:1",paper:10,drawing:1,isUnit:!1},{name:"100:1",paper:100,drawing:1,isUnit:!1}];for(let t of e){let i=new lt;i.name=t.name,i.paperUnits=t.paper,i.drawingUnits=t.drawing,i.isUnitScale=t.isUnit,this._dictionary.tryAdd(i)}}};var Ah=class extends ge{constructor(e){super(e)}createDefaults(){this._dictionary.tryAdd(dt.default_)}};yl();T();D();var vh=class extends Xn{get objectName(){return h.objectBlockBasePointParameter}get subclassMarker(){return d.blockBasePointParameter}point1010=new c(0,0,0);point1012=new c(0,0,0)};D();var Eh=class extends ia{get subclassMarker(){return d.blockFlipGrip}value140=0;value141=0;value142=0;value93N=0};T();D();B();var kh=class extends Qs{get objectType(){return m.UNLISTED}get objectName(){return h.objectBlockLinearParameter}get subclassMarker(){return d.blockLinearParameter}label="";description="";labelOffset=0};var Ph;(function(r){r[r.None=0]="None",r[r.PathType=1]="PathType",r[r.LineColor=2]="LineColor",r[r.LineType=4]="LineType",r[r.LineWeight=8]="LineWeight",r[r.ArrowheadSize=16]="ArrowheadSize",r[r.Arrowhead=32]="Arrowhead"})(Ph||(Ph={}));te();ld();var ad=class r{cache=new Map;_keySelector;constructor(e){this._keySelector=e}getProperty(e){return this.cache.get(e)}registerProperty(e,t){let i=new r.Prop;i.propertyName=e,i.attribute=t,i.getter=s=>s[e],i.setter=(s,a)=>{s[e]=a},this.cache.set(this._keySelector(e,t),i)}static fromClassProperties(e,t){let i=new r(t);for(let s of md(e))i.registerProperty(s.propertyName,s);return i}static fromSystemVariables(e,t){let i=new r(t);for(let s of Id(e))i.registerProperty(s.propertyName,s);return i}};(function(r){class e{getter=null;setter=null;attribute=null;propertyName=""}r.Prop=e})(ad||(ad={}));var Lh;(function(r){r[r.BlockExtents=0]="BlockExtents",r[r.BasePoint=1]="BasePoint"})(Lh||(Lh={}));var jh;(function(r){r[r.None=0]="None",r[r.XrefDependent=16]="XrefDependent",r[r.XrefResolved=32]="XrefResolved",r[r.Referenced=64]="Referenced"})(jh||(jh={}));var Oh;(function(r){r[r.ParllelToLastLeaderLine=0]="ParllelToLastLeaderLine",r[r.Horizontal=1]="Horizontal",r[r.Optimized=2]="Optimized"})(Oh||(Oh={}));B();var Ih;(function(r){r[r.Unitless=0]="Unitless",r[r.Millimeters=1]="Millimeters",r[r.Centimeters=2]="Centimeters",r[r.Meters=3]="Meters",r[r.Kilometers=4]="Kilometers",r[r.Inches=5]="Inches",r[r.Feet=6]="Feet",r[r.Yards=7]="Yards",r[r.Miles=8]="Miles"})(Ih||(Ih={}));var Mh;(function(r){r[r.NoDisplayOrPlotted=0]="NoDisplayOrPlotted",r[r.DisplayAndPlotted=1]="DisplayAndPlotted",r[r.DisplayNoPlotted=2]="DisplayNoPlotted"})(Mh||(Mh={}));_l();Aa();Pd();ht();export{u as ACadVersion,vi as AcdbPlaceHolder,oa as AecBinRecord,aa as AecCleanupGroup,na as AecWallStyle,Dl as AngularDirection,La as AngularUnitFormat,_i as AngularZeroHandling,Hs as AnnotScaleObjectContextData,Re as AppId,Dr as AppIdsTable,We as Arc,pa as ArcLengthSymbolPosition,we as AssociativityFlags,se as AttachmentPointType,Ea as AttributeBase,nr as AttributeDefinition,zt as AttributeEntity,Do as AttributeFlags,mi as AttributeType,Sl as AttributeVisibilityMode,Ui as AutoTransformMethodFlags,Or as BackgroundFillFlags,Zo as BigEndianConverter,fi as Block,Xn as Block1PtParameter,Qs as Block2PtParameter,Zn as BlockAction,cc as BlockActionBasePt,vh as BlockBasePointParameter,Lh as BlockContentConnectionType,Js as BlockElement,Ps as BlockEnd,yc as BlockFlipAction,Eh as BlockFlipGrip,gc as BlockFlipParameter,ia as BlockGrip,sa as BlockGripExpression,kh as BlockLinearParameter,$n as BlockParameter,U as BlockRecord,Tr as BlockRecordsTable,ki as BlockReferenceObjectContextData,ni as BlockRepresentationData,ra as BlockRotationAction,Jn as BlockRotationGrip,ea as BlockRotationParameter,ne as BlockTypeFlags,to as BlockVisibilityGrip,ta as BlockVisibilityParameter,Yn as BlockVisibilityState,Ei as BookColor,H as BorderOverrideFlags,wt as BoundaryPathFlags,E as BoundingBox,Td as BreakData,bd as BreakFlowDirection,Jd as BreakHeight,yd as BreakOptionFlags,Qd as BreakRowRange,Bs as CRC,ql as CRC32StreamHandler,Jr as CRC8StreamHandler,ns as CadAnnotScaleObjectContextDataTemplate,Zs as CadAttributeTemplate,lc as CadBlock1PtParameterTemplate,Wn as CadBlock2PtParameterTemplate,dc as CadBlockActionBasePtTemplate,Fn as CadBlockActionTemplate,nn as CadBlockCtrlObjectTemplate,Ks as CadBlockElementTemplate,Uc as CadBlockEntityTemplate,nc as CadBlockFlipActionTemplate,oc as CadBlockFlipParameterTemplate,io as CadBlockGripExpressionTemplate,Qn as CadBlockGripTemplate,Un as CadBlockParameterTemplate,ti as CadBlockRecordTemplate,Kn as CadBlockRepresentationDataTemplate,qn as CadBlockRotationActionTemplate,eo as CadBlockRotationGripTemplate,Gn as CadBlockRotationParameterTemplate,ro as CadBlockVisibilityGripTemplate,hs as CadBlockVisibilityParameterTemplate,gs as CadBody,It as CadCellStyleTemplate,re as CadDictionary,qs as CadDictionaryTemplate,ai as CadDictionaryWithDefault,Bn as CadDictionaryWithDefaultTemplate,cs as CadDimensionAssociationTemplate,ln as CadDimensionStyleTemplate,ri as CadDimensionTemplate,Is as CadDocument,qa as CadDocumentBuilder,O as CadEntityTemplate,He as CadEntityTemplateT,Hn as CadEvaluationExpressionTemplate,ds as CadEvaluationGraphTemplate,ao as CadFieldListTemplate,so as CadFieldTemplate,An as CadGeoDataTemplate,vn as CadGroupTemplate,ss as CadHatchTemplate,Nt as CadHeader,ii as CadInsertTemplate,cn as CadLayerTemplate,dn as CadLayoutTemplate,hn as CadLeaderTemplate,as as CadLineTypeTemplate,Ri as CadMLeaderAnnotContextTemplate,mn as CadMLeaderStyleTemplate,un as CadMLeaderTemplate,os as CadMLineStyleTemplate,pn as CadMLineTemplate,fn as CadMaterialTemplate,wn as CadMeshTemplate,ee as CadNonGraphicalObjectTemplate,Ze as CadNotSupportedException,A as CadObject,Co as CadObjectCollection,th as CadObjectExtensions,Mc as CadObjectHolder,_n as CadOle2FrameTemplate,ic as CadPlotSettingsTemplate,wr as CadPolyLineTemplate,Yc as CadProxyObjectTemplate,Ka as CadReaderBase,Ja as CadReaderConfiguration,bn as CadShapeTemplate,yn as CadSolid3DTemplate,En as CadSortensTableTemplate,Xc as CadSpatialFilterTemplate,gn as CadSplineTemplate,wi as CadSummaryInfo,kl as CadSystemVariable,ch as CadTableAttributeTemplate,Pn as CadTableCellContentFormatTemplate,Ln as CadTableCellContentTemplate,rl as CadTableCellTemplate,Gc as CadTableContentTemplate,kn as CadTableEntityTemplate,xe as CadTableEntryTemplate,jn as CadTableStyleTemplate,rt as CadTableTemplate,ei as CadTemplate,Y as CadTemplateT,si as CadTextEntityTemplate,xn as CadToleranceTemplate,Cn as CadUcsTemplate,Vn as CadUnderlayTemplate,Mn as CadUnknownEntityTemplate,In as CadUnknownNonGraphicalObjectTemplate,q as CadUtils,Sn as CadVPortTemplate,vt as CadValue,no as CadValueTemplate,V as CadValueType,Lo as CadValueUnitType,da as CadVertexTemplate,Dn as CadViewTemplate,sc as CadViewportEntityControlTemplate,ac as CadViewportEntityHeaderTemplate,Tn as CadViewportTemplate,hc as CadWallTemplate,Os as CadWipeoutBase,Ba as CadWipeoutBaseTemplate,Gs as CadWriterBase,Xs as CadWriterConfiguration,On as CadXRecordTemplate,gd as CellAlignmentType,Ji as CellBorder,Qi as CellContent,Kd as CellContentGeometry,Ve as CellEdgeFlags,Pe as CellOverrideFlags,Sa as CellRange,xt as CellStyle,xd as CellStyleClass,Cd as CellStyleType,Ds as CellType,Et as Circle,$i as ClipMode,bi as ClipType,C as CodePage,gr as CollectionChangedEventArgs,S as Color,Pl as ColorCollection,cr as ColorMethod,dr as ColumnType,Fs as ContentFormat,qd as CustomDataEntry,Po as DefaultLightingType,Qo as DesignCoordinatesType,ks as DictionaryCloningFlags,Ke as DictionaryVariable,Th as DictionaryVariableCollection,K as Dimension,ze as DimensionAligned,$t as DimensionAngular2Line,Gt as DimensionAngular3Pt,Bl as DimensionAssociation,Xt as DimensionDiameter,_t as DimensionLinear,Yt as DimensionOrdinate,on as DimensionPlaceholder,Zt as DimensionRadius,Q as DimensionStyle,Wt as DimensionStylesTable,No as DimensionTextBackgroundFillMode,Ao as DimensionTextHorizontalAlignment,vo as DimensionTextVerticalAlignment,G as DimensionType,Oo as DrawingDirectionType,Jl as Dwg21CompressedMetadata,hh as DwgAppInfoReader,Tc as DwgAppInfoWriter,Sc as DwgAuxHeaderWriter,Ct as DwgCheckSumCalculator,ec as DwgClassesReader,Bc as DwgClassesWriter,en as DwgDocumentBuilder,Xo as DwgException,rs as DwgFileHeader,is as DwgFileHeaderAC15,Rs as DwgFileHeaderAC18,Kl as DwgFileHeaderAC21,Rc as DwgFileHeaderWriterAC15,la as DwgFileHeaderWriterAC18,mh as DwgFileHeaderWriterAC21,mo as DwgFileHeaderWriterBase,tc as DwgHandleReader,vc as DwgHandleWriter,Qa as DwgHeaderHandlesCollection,rc as DwgHeaderReader,Ec as DwgHeaderWriter,Nc as DwgLZ77AC18Compressor,co as DwgLZ77AC18Decompressor,Ac as DwgLZ77AC21Compressor,ho as DwgLZ77AC21Decompressor,Ns as DwgLocalSectionMap,As as DwgMergedReader,ca as DwgMergedStreamWriter,xc as DwgObjectReader,Pc as DwgObjectWriter,_a as DwgPreview,Cc as DwgPreviewReader,Lc as DwgPreviewWriter,dh as DwgReader,qo as DwgReaderConfiguration,_ as DwgReferenceType,R as DwgSectionDefinition,Qr as DwgSectionDescriptor,fh as DwgSectionHash,J as DwgSectionIO,Ot as DwgSectionLocatorRecord,rn as DwgStreamReaderAC12,sn as DwgStreamReaderAC15,Ys as DwgStreamReaderAC18,an as DwgStreamReaderAC21,Ql as DwgStreamReaderAC24,Be as DwgStreamReaderBase,po as DwgStreamWriterAC12,fo as DwgStreamWriterAC15,wo as DwgStreamWriterAC18,_o as DwgStreamWriterAC21,jc as DwgStreamWriterAC24,Le as DwgStreamWriterBase,Dc as DwgSummaryInfoReader,Oc as DwgSummaryInfoWriter,ph as DwgWriter,Ic as DwgWriterConfiguration,kc as DwgmMergedStreamWriterAC14,qc as DxfAsciiWriter,Es as DxfBinaryReader,Hc as DxfBinaryReaderAC1009,Kc as DxfBinaryWriter,Wc as DxfBlockSectionReader,Jc as DxfBlocksSectionWriter,W as DxfClass,Gi as DxfClassCollection,L as DxfClassMap,Qc as DxfClassesSectionWriter,w as DxfCode,bo as DxfDocumentBuilder,zc as DxfEntitiesSectionReader,ed as DxfEntitiesSectionWriter,Bi as DxfException,h as DxfFileToken,td as DxfHeaderSectionWriter,Ie as DxfMap,Ia as DxfMapBase,Zc as DxfObjectsSectionReader,rd as DxfObjectsSectionWriter,Ml as DxfProperty,ja as DxfPropertyBase,wh as DxfReader,ul as DxfReaderConfiguration,Qe as DxfReferenceType,_s as DxfSectionReaderBase,rr as DxfSectionWriterBase,yo as DxfStreamReaderBase,go as DxfStreamWriterBase,d as DxfSubclassMarker,Fc as DxfTablesSectionReader,id as DxfTablesSectionWriter,Vc as DxfTextReader,yh as DxfWriter,pl as DxfWriterConfiguration,uc as EdgeStyleModel,Vr as EdgeType,bt as Ellipse,N as Entity,bs as EntityPlotStyleType,jh as EntryFlags,zn as EvaluationExpression,Vt as EvaluationGraph,jd as EvaluationGraphEdge,ka as EvaluationGraphNode,ll as EvaluationOptionFlags,cl as EvaluationStatusFlags,hi as ExtendedData,Er as ExtendedDataBinaryChunk,Fe as ExtendedDataControlString,kr as ExtendedDataCoordinate,xo as ExtendedDataDictionary,fs as ExtendedDataDirection,us as ExtendedDataDisplacement,ms as ExtendedDataDistance,Vi as ExtendedDataHandle,ot as ExtendedDataInteger16,Pr as ExtendedDataInteger32,lo as ExtendedDataLayer,Lr as ExtendedDataReal,Ii as ExtendedDataRecord,le as ExtendedDataRecordT,Pa as ExtendedDataReference,ps as ExtendedDataScale,jr as ExtendedDataString,ws as ExtendedDataWorldCoordinate,xi as Face3D,mc as FaceColorMode,pc as FaceLightingModelType,fc as FaceLightingQualityType,wc as FaceModifierType,Li as Field,ji as FieldList,dl as FieldStateFlags,hl as FilingOptionFlags,bc as Filter,ih as FlowDirectionType,ua as FontFlags,$c as FormattedTableData,or as FractionFormat,_r as GeoData,qe as GeoDataVersion,Rn as GeoMeshFace,Nn as GeoMeshPoint,Va as GradientColor,Oa as GridFlags,Ft as Group,Ne as GroupCodeValue,f as GroupCodeValueType,Ll as GroupCollection,Kt as Hatch,Wl as HatchBoundaryPath,Hr as HatchBoundaryPathArc,Ca as HatchBoundaryPathEdge,Fr as HatchBoundaryPathEllipse,Ur as HatchBoundaryPathLine,Mr as HatchBoundaryPathPolyline,Wr as HatchBoundaryPathSpline,Io as HatchGradientPattern,xa as HatchPattern,Ha as HatchPatternLine,Mo as HatchPatternType,Vo as HatchStyleType,Zi as HookLineDirection,gh as HugeMemoryStream,rh as INamedCadObjectExtensions,oi as ImageDefinition,Sh as ImageDefinitionCollection,Ut as ImageDefinitionReactor,Cr as ImageDisplayFlags,ol as ImageDisplayQuality,Ih as ImageUnits,Rl as IndexCreationFlags,Ye as Insert,ya as InvisibleEdgeFlags,Yi as KnotParametrization,pe as Layer,st as LayerFlags,Sr as LayersTable,ke as Layout,jl as LayoutCollection,Bo as LayoutFlags,zr as Leader,Ta as LeaderContentType,Ua as LeaderCreationType,Ko as LeaderDrawOrderType,$a as LeaderLine,Ph as LeaderLinePropertOverrideFlags,Ho as LeaderPathType,Ga as LeaderRoot,xl as LightingType,Me as Line,Dh as LineSpacingStyle,ba as LineSpacingStyleType,z as LineType,gl as LineTypeSegment,ut as LineTypeShapeFlags,Br as LineTypesTable,F as LineWeightType,Zl as LineWeightTypeExtensions,ma as LinearUnitFormat,Ad as LinkedData,vd as LinkedTableData,$s as LittleEndianConverter,hr as LwPolyline,qt as LwPolylineFlags,Xi as LwPolylineVertex,Bh as MLeaderStyleCollection,Gr as MLine,qi as MLineFlags,Fo as MLineJustification,Wa as MLineSegment,At as MLineStyle,Il as MLineStyleCollection,js as MLineStyleElement,Te as MLineStyleFlags,za as MLineVertex,ve as MText,Pi as MTextAttributeObjectContextData,et as MapSource,Ya as MarginFlags,ft as Material,Ol as MaterialCollection,ae as MathHelper,mt as Matrix4,Nl as MeasurementUnits,$r as Mesh,Da as MeshEdge,Ms as ModelerGeometry,Vl as ModelerGeometrySilhouette,jo as ModelerGeometryWire,Xr as MultiLeader,$l as MultiLeaderBlockAttribute,Jo as MultiLeaderDrawOrderType,Jt as MultiLeaderObjectContextData,Uo as MultiLeaderPathType,wd as MultiLeaderPropertyOverrideFlags,ct as MultiLeaderStyle,M as NonGraphicalObject,tr as NotificationEventArgs,y as NotificationType,zl as ObjectContextData,ge as ObjectDictionaryCollection,il as ObjectOsnapType,sh as ObjectSnapMode,Al as ObjectSortingFlags,m as ObjectType,Yr as Ole2Frame,Gl as OleObjectType,va as OnNameChangedArgs,lr as OrthographicType,vs as OsnapPointRef,Ht as PaperMargin,Rh as PdfDefinitionCollection,Ci as PdfUnderlay,Ai as PdfUnderlayDefinition,Ls as PlotFlags,Yo as PlotPaperUnits,pi as PlotRotation,Bt as PlotSettings,dd as PlotType,kt as Point,jt as PolyfaceMesh,Qt as PolygonMesh,xs as PolygonMeshVertex,Ir as Polyline,Ge as Polyline2D,gt as Polyline3D,ga as PolylineExtensions,$e as PolylineFlags,Wi as ProjectionMethod,ad as PropertyExpression,Xa as ProxyEntity,v as ProxyFlags,ci as ProxyObject,yi as RasterImage,li as RasterVariables,Di as Ray,Cs as Region,wa as RenderMode,nl as ResolutionUnit,sl as RotatedDimensionType,lt as Scale,Nh as ScaleCollection,el as ScaleEstimationType,hd as ScaledType,Se as Seqend,ur as SeqendCollection,ah as ShadeEdgeType,To as ShadePlotMode,So as ShadePlotResolutionMode,Wd as ShadowMode,qr as Shape,Fl as SmoothSurfaceType,mr as Solid,Ki as Solid3D,pt as SortEntitiesTable,ud as Sorter,Fi as SpaceLineTypeScaling,br as SpatialFilter,Lt as Spline,Xe as SplineFlags,Pt as SplineFlags1,vl as SplineType,ar as StandardFlags,Go as StartEndPointPair,ui as StyleFlags,al as SubentType,sd as SvgConfiguration,I as SvgConverter,xh as SvgDocumentBuilder,Ch as SvgWriter,Ra as SvgXmlWriter,Ae as Table,Zd as TableAttribute,zd as TableBorderPropertyFlags,$d as TableCellContentLayoutFlags,Dd as TableCellContentType,Gd as TableCellStateFlags,Xd as TableCellStylePropertyFlags,Sd as TableContent,es as TableEntity,_d as TableEntityBorderType,Us as TableEntityCell,Ws as TableEntityColumn,zs as TableEntityRow,Yd as TableEntityValueUnitType,ye as TableEntry,tl as TableFlowDirectionType,fe as TableOverrideFlags,dt as TableStyle,Ah as TableStyleCollection,Wo as TextAlignmentType,Oh as TextAngleType,Tl as TextArrowFitType,zo as TextAttachmentDirectionType,$o as TextAttachmentPointType,Vs as TextAttachmentType,fd as TextColumnData,Hi as TextDirection,at as TextEntity,Tt as TextHorizontalAlignment,Mi as TextMirrorFlag,Eo as TextMovement,Hl as TextProcessor,oe as TextStyle,Rr as TextStylesTable,St as TextVerticalAlignmentType,zi as TilingMethod,pr as Tolerance,ko as ToleranceAlignment,Z as Transform,Ee as Transparency,Rt as UCS,Nr as UCSTable,_c as UnderlayDefinition,Xl as UnderlayDisplayFlags,Yl as UnderlayEntity,Za as UnitExtensions,Ro as UnitStyleFormat,ce as UnitsType,er as UnknownEntity,Kr as UnknownNonGraphicalObject,gi as UscIconType,nt as VPort,vr as VPortsTable,tt as Vertex,yt as Vertex2D,Zr as Vertex3D,Ti as VertexFaceMesh,fr as VertexFaceRecord,Fa as VertexFlags,eh as VerticalAlignmentType,ls as View,de as ViewModeType,Ue as Viewport,ys as ViewportEntityControl,oo as ViewportEntityHeader,cd as ViewportStatusFlags,Ar as ViewsTable,Ni as VisualStyle,Ma as Wall,pd as WallJustification,Ts as Wipeout,Mh as WipeoutFrameType,El as XClipFrameType,Si as XLine,Mt as XRecord,Rd as XRecordEntry,g as XY,c as XYZ,Hh as XYZ_Zero,ue as ZeroHandling,Nd as registerMergedWriter,tn as registerStreamReader,uo as registerStreamWriter};