25 lines
161 KiB
JavaScript
25 lines
161 KiB
JavaScript
var Ze=Object.defineProperty;var qe=(t,n,o)=>n in t?Ze(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var M=(t,n,o)=>qe(t,typeof n!="symbol"?n+"":n,o);const Qe="modulepreload",je=function(t){return"/"+t},le={},Ee=function(n,o,e){let a=Promise.resolve();if(o&&o.length>0){let d=function(c){return Promise.all(c.map(E=>Promise.resolve(E).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};var r=d;document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),_=s?.nonce||s?.getAttribute("nonce");a=d(o.map(c=>{if(c=je(c),c in le)return;le[c]=!0;const E=c.endsWith(".css"),u=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const l=document.createElement("link");if(l.rel=E?"stylesheet":Qe,E||(l.as="script"),l.crossOrigin="",l.href=c,_&&l.setAttribute("nonce",_),document.head.appendChild(l),E)return new Promise((I,f)=>{l.addEventListener("load",I),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const _=new Event("vite:preloadError",{cancelable:!0});if(_.payload=s,window.dispatchEvent(_),!_.defaultPrevented)throw s}return a.then(s=>{for(const _ of s||[])_.status==="rejected"&&i(_.reason);return n().catch(i)})};function to(t){return{format:t.format,sourceName:t.sourceName,units:t.units,header:t.header??{},layers:t.layers??{},lineTypes:t.lineTypes??{},blocks:t.blocks??{},entities:t.entities??[],pages:t.pages,savedView:t.savedView,dataLinks:t.dataLinks,dataTables:t.dataTables,xrecords:t.xrecords,dictionaries:t.dictionaries,metadata:t.metadata??{},warnings:t.warnings??[],raw:t.raw}}function ue(t){switch(String(t??"").toUpperCase()){case"LINE":return"line";case"CIRCLE":return"circle";case"ARC":return"arc";case"LWPOLYLINE":case"POLYLINE":case"POLYLINE_2D":case"POLYLINE2D":case"POLYLINE_3D":case"POLYLINE3D":case"LEADER":case"MULTILEADER":return"polyline";case"ELLIPSE":return"ellipse";case"TEXT":case"MTEXT":case"ATTRIB":case"ATTDEF":case"DIMENSION":return"text";case"POINT":return"point";case"INSERT":case"MINSERT":return"insert";case"SOLID":case"TRACE":case"3DFACE":return"solid";case"HATCH":return"hatch";case"SPLINE":return"spline";case"PATH":case"XPS_PATH":case"DWF_PATH":return"path";case"IMAGE":case"RASTER_IMAGE":case"DWF_IMAGE":return"image";case"VIEWPORT":return"viewport";case"TABLE":case"ACAD_TABLE":case"ACDBTABLE":return"table";default:return"unsupported"}}function Re(t,n,o={}){const e=n??String(t.type??t.entityType??t.objectName??"UNKNOWN").toUpperCase(),a=o.includeUnknownProperties===!1?{type:e,kind:ue(e)}:{...t,type:e,kind:ue(e)};o.keepRaw&&(a.raw=t),a.handle=y(t.handle??t.id),a.layer=y(t.layer??t.layerName),a.lineType=y(t.lineType??t.linetype),a.lineTypeScale=P(t.lineTypeScale??t.linetypeScale??t.ltscale)??a.lineTypeScale,a.flag=P(t.flag??t.flags)??a.flag,a.constantWidth=P(t.constantWidth??t.constWidth??t.const_width)??a.constantWidth,a.thickness=P(t.thickness)??a.thickness;const i=t.isClosed===!0||t.closed===!0||t.shape===!0,r=/^(POLYLINE|POLYLINE_2D|POLYLINE2D|POLYLINE_3D|POLYLINE3D|SPLINE)$/.test(e),s=e==="LWPOLYLINE";(i||r&&(Number(a.flag??0)&1)===1||s&&(Number(a.flag??0)&512)===512)&&(a.isClosed=!0);const _=o.numericColorMode??"auto",d=P(t.color),c=P(t.colorIndex??t.colorNumber??t.aci??t.aciColor??t.color_index);a.colorIndex=c??(_!=="rgb"&&d!==void 0&&Math.abs(d)<=257?d:void 0);const E=t.trueColor??t.true_color??t.truecolor??t.colorRGB??t.colorRgb??t.rgbColor??t.rgb,u=d!==void 0&&d>=0&&d<=16777215&&(_==="rgb"||_==="auto"&&Math.abs(d)>257);a.trueColor=E??(u?d:void 0),(typeof t.color=="string"||typeof t.color=="number")&&(a.color=t.color),a.colorNumber=P(t.colorNumber)??a.colorNumber,a.colorName=y(t.colorName??t.color_name)??a.colorName,a.fillColor=t.fillColor??t.fill_color,a.fillColorIndex=P(t.fillColorIndex??t.fill_color_index??t.fillColorNumber)??a.fillColorIndex,a.opacity=P(t.opacity??t.alpha)??a.opacity,a.lineweight=P(t.lineweight??t.lineWeight),a.isVisible=!(t.isVisible===!1||t.visible===!1);const l=O(t.text);a.startPoint=b(t.startPoint??l?.startPoint??t.start??t.p0??t.from)??a.startPoint,a.endPoint=b(t.endPoint??l?.endPoint??t.end??t.p1??t.to)??a.endPoint,a.center=b(t.center??t.centerPoint)??a.center,a.insertionPoint=b(t.insertionPoint??l?.startPoint??t.position??t.location??t.point??t.basePoint)??a.insertionPoint,a.radius=P(t.radius)??a.radius,a.startAngle=P(t.startAngle??t.start_angle)??a.startAngle,a.endAngle=P(t.endAngle??t.end_angle)??a.endAngle,a.majorAxisEndPoint=b(t.majorAxisEndPoint??t.majorAxis??t.major)??a.majorAxisEndPoint,a.axisRatio=P(t.axisRatio??t.ratio)??a.axisRatio,a.height=P(t.height??t.textHeight??l?.textHeight)??a.height,a.textHeight=P(t.textHeight??t.height??l?.textHeight)??a.textHeight,a.xScale=P(t.xScale??t.widthFactor??l?.xScale)??a.xScale,a.generationFlag=P(t.generationFlag??t.textGenerationFlag??l?.generationFlag)??a.generationFlag,a.halign=P(t.halign??t.horizontalAlignment??l?.halign)??a.halign,a.valign=P(t.valign??t.verticalAlignment??l?.valign)??a.valign,a.extrusionDirection=b(t.extrusionDirection??t.extrusion??l?.extrusionDirection)??a.extrusionDirection,a.rotation=P(t.rotation??t.angle??l?.rotation)??a.rotation,a.text=y(l?.text??t.text??t.value??t.string??t.contents??t.defaultValue??t.default_value)??a.text,a.value=y(t.value??l?.text??t.text??t.string??t.contents??t.defaultValue??t.default_value)??a.value,a.name=y(t.name??t.blockName)??a.name,a.blockName=y(t.blockName??t.name)??a.blockName,a.effectiveBlockName=y(t.effectiveBlockName??t.effectiveName??t.dynamicBlockName??t.originalBlockName)??a.effectiveBlockName,a.extensionDictionaryHandle=Rt(t.extensionDictionaryHandle??t.ownerDictionaryHardId??t.ownerdictionaryHardId??t.xdicobjhandle)??a.extensionDictionaryHandle,a.ownerBlockRecordHandle=Rt(t.ownerBlockRecordHandle??t.ownerBlockRecordSoftId??t.ownerHandle)??a.ownerBlockRecordHandle,a.attributeTag=y(t.attributeTag??t.tag??t.tagString??t.attrTag)??a.attributeTag,a.attributePrompt=y(t.attributePrompt??t.prompt??t.promptString)??a.attributePrompt,a.attributeFlags=P(t.attributeFlags??t.flags??t.flag)??a.attributeFlags,(e==="INSERT"||e==="MINSERT")&&(a.insertRowCount=j(t.insertRowCount??t.rowCount??t.numRows??t.num_rows)??a.insertRowCount,a.insertColumnCount=j(t.insertColumnCount??t.columnCount??t.numColumns??t.numCols??t.num_cols)??a.insertColumnCount,a.insertRowSpacing=P(t.insertRowSpacing??t.rowSpacing??t.row_spacing)??a.insertRowSpacing,a.insertColumnSpacing=P(t.insertColumnSpacing??t.columnSpacing??t.col_spacing)??a.insertColumnSpacing);const I=Ne(t.xdata??t.extendedData??t.xData);if(I.length>0&&(a.xdata=I),e==="INSERT"||e==="MINSERT"){const p=b(t.scale);if(p)a.scale=p;else{const C=P(t.scaleX??t.xScale),L=P(t.scaleY??t.yScale)??C,R=P(t.scaleZ??t.zScale);C!==void 0&&L!==void 0&&(a.scale=R===void 0?{x:C,y:L}:{x:C,y:L,z:R})}}const f=Dn(t.vertices??t.points);f.length>0&&(a.vertices=f);const A=Dn(t.controlPoints??t.control_points);A.length>0&&(a.controlPoints=A);const h=Dn(t.fitPoints??t.fit_points);h.length>0&&(a.fitPoints=h);const g=t.attribs??t.attributes??t.attributeEntities;return Array.isArray(g)&&(a.attribs=g.filter(p=>!!p&&typeof p=="object").map(p=>Re(p,void 0,o))),(e==="TABLE"||e==="ACAD_TABLE"||e==="ACDBTABLE")&&(a.table=no(t)),a}function no(t){const n=O(t.ldata??t.linkedData),o=O(t.tdata??t.linkedTableData),e=j(t.rowCount??t.rowsCount??t.numRows??t.num_rows??o?.numRows??o?.num_rows)??0,a=j(t.columnCount??t.columnsCount??t.numColumns??t.numCols??t.num_cols??o?.numColumns??o?.numCols??o?.num_cols)??0,i=me(t.cells??t.tableCells??t.cellValues??o?.rows??t.data),r=a||io(i),s=e||(r>0?Math.ceil(i.length/r):0),_=i.map(({cell:d,index:c})=>ro(d,c,r));return{name:y(t.tableName??t.name??n?.name??n?.description),rowCount:s,columnCount:r,cells:_,rowHeights:Ae(t.rowHeights??t.rowHeightArr??t.row_heights),columnWidths:Ae(t.columnWidths??t.columnWidthArr??t.col_widths),dataLinkHandle:Rt(t.dataLinkHandle??t.dataLink??t.data_link),titleSuppressed:nn(t.titleSuppressed??t.title_suppressed),headerSuppressed:nn(t.headerSuppressed??t.header_suppressed)}}function b(t){if(!t||typeof t!="object")return;const n=t,o=Number(n.x??n.X??n[0]),e=Number(n.y??n.Y??n[1]),a=n.z??n.Z??n[2],i=a===void 0?void 0:Number(a);if(!(!Number.isFinite(o)||!Number.isFinite(e)))return Number.isFinite(i)?{x:o,y:e,z:i}:{x:o,y:e}}function Dn(t){if(!Array.isArray(t))return[];const n=[];for(const o of t){const e=b(o);if(!e)continue;const a=o,i=e,r=P(a.bulge);r!==void 0&&(i.bulge=r);const s=P(a.startWidth??a.start_width);s!==void 0&&(i.startWidth=s);const _=P(a.endWidth??a.end_width);_!==void 0&&(i.endWidth=_),n.push(i)}return n}function eo(t,n){n.name&&(t[n.name]=n,t[n.name.toLowerCase()]=n)}function oo(t,n){n.name&&(t[n.name]=n,t[n.name.toLowerCase()]=n)}function ao(t,n){n.name&&(t[n.name]=n,t[n.name.toLowerCase()]=n,n.handle&&(t[n.handle]=n,t[n.handle.toLowerCase()]=n))}function P(t){const n=Number(t);return Number.isFinite(n)?n:void 0}function y(t){if(typeof t!="string"&&typeof t!="number")return;const n=String(t);return n.length>0?n:void 0}function O(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function j(t){const n=P(t);if(!(n===void 0||n<=0))return Math.max(1,Math.trunc(n))}function nn(t){if(typeof t=="boolean")return t;if(t===0||t==="0")return!1;if(t===1||t==="1")return!0}function Ae(t){if(!Array.isArray(t))return;const n=t.map(P).filter(o=>o!==void 0);return n.length>0?n:void 0}function Rt(t){if(Array.isArray(t))return y(t[3]??t[2]??t[t.length-1]);if(t&&typeof t=="object"){const n=t;return y(n.absolute_ref??n.absoluteRef??n.handle??n.id??n.value)}return y(t)}function me(t){if(!Array.isArray(t)){const e=O(t),a=e?.rows??e?.values??e?.cells;return Array.isArray(a)?me(a):[]}const n=[];let o=0;for(const e of t){if(Array.isArray(e)){for(const r of e)n.push({cell:r,index:o++});continue}const a=O(e),i=a?.cells??a?.values;if(Array.isArray(i)&&!("text"in(a??{}))&&!("value"in(a??{}))){for(const r of i)n.push({cell:r,index:o++});continue}n.push({cell:e,index:o++})}return n}function io(t){let n=-1;for(const{cell:o}of t){const e=O(o),a=P(e?.column??e?.columnIndex??e?.col??e?.column_index);a!==void 0&&(n=Math.max(n,Math.trunc(a)))}return n>=0?n+1:0}function ro(t,n,o){const e=O(t),a=e?so(e):X(t),r=y(e?e.text??e.textValue??e.text_value??e.valueString??e.value_string??e.displayValue:t)??Se(a),s=Math.max(0,Math.trunc(P(e?.row??e?.rowIndex??e?.row_index)??(o>0?Math.floor(n/o):n))),_=Math.max(0,Math.trunc(P(e?.column??e?.columnIndex??e?.col??e?.column_index)??(o>0?n%o:0))),d=y(e?.attrText??e?.attributeText),c=d?{value:d}:_o(e?.blockAttributes??e?.attributes);return{row:s,column:_,text:r,...a!==void 0?{value:a}:{},...y(e?.dataType??e?.typeName)||P(e?.cellType??e?.type)!==void 0?{dataType:y(e?.dataType??e?.typeName)??P(e?.cellType??e?.type)}:{},...y(e?.formula??e?.expression)?{formula:y(e?.formula??e?.expression)}:{},...j(e?.rowSpan??e?.mergedHeight??e?.merged_height_flag)?{rowSpan:j(e?.rowSpan??e?.mergedHeight??e?.merged_height_flag)}:{},...j(e?.columnSpan??e?.mergedWidth??e?.merged_width_flag)?{columnSpan:j(e?.columnSpan??e?.mergedWidth??e?.merged_width_flag)}:{},...nn(e?.isMerged??e?.mergedValue??e?.is_merged_value)!==void 0?{isMerged:nn(e?.isMerged??e?.mergedValue??e?.is_merged_value)}:{},...P(e?.textHeight??e?.text_height)!==void 0?{textHeight:P(e?.textHeight??e?.text_height)}:{},...Rt(e?.blockTableRecordId??e?.blockRecordHandle??e?.block_handle)?{blockTableRecordId:Rt(e?.blockTableRecordId??e?.blockRecordHandle??e?.block_handle)}:{},...c&&Object.keys(c).length>0?{blockAttributes:c}:{}}}function so(t){const n=O(t.value),o=[n?.valueString,n?.value_string,n?.dataString,n?.data_string,n?.dataLong,n?.data_long,n?.dataDouble,n?.data_double,n?.dataDate,n?.data_date,n?.dataPoint,n?.data_point,n?.data3dPoint,n?.data_3dpoint,t.rawValue,t.value];for(const e of o){const a=X(e);if(a!==void 0&&a!=="")return a}}function Se(t){if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(!Array.isArray(t)&&typeof t=="object"&&"x"in t&&"y"in t){const n=t;return[n.x,n.y,n.z].filter(o=>o!==void 0).join(", ")}try{return JSON.stringify(t)}catch{return String(t)}}function _o(t){const n=O(t);if(!n)return;const o={};for(const[e,a]of Object.entries(n)){const i=y(a)??Se(X(a));i&&(o[e]=i)}return Object.keys(o).length>0?o:void 0}function Ne(t){if(!t)return[];if(Array.isArray(t)){if(t.some(s=>O(s)?.appName!==void 0||O(s)?.applicationName!==void 0))return t.flatMap(s=>Ne(s));const r=t.map(Qt).filter(s=>!!s);return r.length>0?[{entries:r}]:[]}const n=O(t);if(!n)return[];const o=y(n.appName??n.applicationName??n.app),e=Array.isArray(n.customStrings)?n.customStrings.map(r=>({code:1e3,value:r})):void 0,a=n.entries??n.value??n.values??n.data??e;if(Array.isArray(a)){const r=a.map(Qt).filter(s=>!!s);return r.length>0?[{appName:o,entries:r}]:[]}if(o){const r=Qt(a);return r?[{appName:o,entries:[r]}]:[]}const i=[];for(const[r,s]of Object.entries(n)){const _=(Array.isArray(s)?s:[s]).map(Qt).filter(d=>!!d);_.length>0&&i.push({appName:r,entries:_})}return i}function Qt(t){const n=O(t);if(n){const e=X(n.value??n.data??n.text??n);return e===void 0?void 0:{...P(n.code??n.groupCode)!==void 0?{code:P(n.code??n.groupCode)}:{},...y(n.name??n.key)?{name:y(n.name??n.key)}:{},value:e}}const o=X(t);return o===void 0?void 0:{value:o}}function X(t,n=0,o=new WeakSet){if(t===null)return null;if(typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number")return Number.isFinite(t)?t:String(t);if(typeof t=="bigint")return t.toString();if(t instanceof Date)return t.toISOString();if(ArrayBuffer.isView(t))return Array.from(new Uint8Array(t.buffer,t.byteOffset,Math.min(t.byteLength,65536)));if(n>=12||!t||typeof t!="object")return;if(o.has(t))return"[Circular]";if(o.add(t),Array.isArray(t)){const a=t.slice(0,1e5).map(i=>X(i,n+1,o)).filter(i=>i!==void 0);return o.delete(t),a}const e={};for(const[a,i]of Object.entries(t).slice(0,1e4)){const r=X(i,n+1,o);r!==void 0&&(e[a]=r)}return o.delete(t),e}function co(t){return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.slice().buffer}function lo(t,n){return{a:t.a*n.a+t.c*n.b,b:t.b*n.a+t.d*n.b,c:t.a*n.c+t.c*n.d,d:t.b*n.c+t.d*n.d,e:t.a*n.e+t.c*n.f+t.e,f:t.b*n.e+t.d*n.f+t.f}}function Eo(t){const n=Math.cos(t),o=Math.sin(t);return{a:n,b:o,c:-o,d:n,e:0,f:0}}const uo={AC1009:"R12",AC1012:"R13",AC1014:"R14",AC1015:"R2000",AC1018:"R2004",AC1021:"R2007",AC1024:"R2010",AC1027:"R2013",AC1032:"R2018"};function Ao(t){const n=Array.from(t.slice(0,6),e=>String.fromCharCode(e)).join(""),o=uo[n]??"UNKNOWN";return{signature:n,release:o,supportedByOpenDesignSpec:o!=="UNKNOWN",notes:o==="UNKNOWN"?"Unknown or unsupported DWG signature.":void 0}}const fe=new Map;async function fo(t,n={}){const o=performance.now(),e=n.sourceName;n.onProgress?.({phase:"detect",format:"dwg",message:"Validating DWG header…",total:t.byteLength});const a=Ao(t);if(!a.signature.startsWith("AC"))throw new Error(`Invalid DWG header: ${JSON.stringify(a.signature)}.`);n.onProgress?.({phase:"wasm-init",format:"dwg",message:"Initializing LibreDWG WebAssembly…",total:t.byteLength});const i=await De(n.wasmPath??"/wasm/");n.onProgress?.({phase:"parse",format:"dwg",message:`Decoding ${a.signature} DWG…`,total:t.byteLength,percent:35});const r=co(t),s=i.Dwg_File_Type?.DWG??0,_=i.instance.dwg_read_data(r,s);if(!_)throw new Error("LibreDWG returned an empty DWG result.");if(typeof _.error=="number"&&_.error!==0)throw new Error(`LibreDWG parse error code: ${_.error}.`);n.onProgress?.({phase:"normalize",format:"dwg",message:"Normalizing DWG database…",total:t.byteLength,percent:72});const d=typeof i.instance.convert=="function"?i.instance.convert(_):_;Po(d,To(i.instance,_,i.module.Dwg_Object_Type));try{typeof i.instance.dwg_free=="function"&&i.instance.dwg_free(_)}catch{}const c=ho(d,e,a,{keepRaw:!!n.keepRaw}),E=performance.now()-o;return n.onProgress?.({phase:"done",format:"dwg",message:"DWG loaded.",total:t.byteLength,percent:100,elapsedMs:E}),{document:c,raw:n.keepRaw?d:void 0,bytes:t.byteLength,elapsedMs:E,format:"dwg",warnings:c.warnings}}async function De(t="/wasm/"){const n=Bo(t);let o=fe.get(n);o||(o=Ee(()=>Promise.resolve().then(()=>Le),[]).then(async i=>{const r=i,s=r.LibreDwg;if(!s||typeof s.create!="function")throw new Error("@mlightcad/libredwg-web did not expose LibreDwg.create().");try{if(typeof r.createModule=="function"&&typeof s.createByWasmInstance=="function"){const _=Te(n),d=await Fo(_),c=await r.createModule({wasmBinary:d,locateFile:E=>new URL(E,Ge(n)).href});return Ie(s.createByWasmInstance(c))}return Ie(await s.create(n))}catch(_){const d=_ instanceof Error?_.message:String(_);throw new Error(`Failed to initialize LibreDWG WebAssembly from ${n}. Ensure libredwg-web.wasm is deployed at ${Te(n)} and wasmPath is resolved relative to the page, not the worker script. Run npm run copy:wasm before dev/build. Original error: ${d}`)}}),fe.set(n,o));const e=await o,a=await Ee(()=>Promise.resolve().then(()=>Le),void 0);return{module:a,instance:e,Dwg_File_Type:a.Dwg_File_Type}}function Ie(t){if(!t||t.__cadViewerCompatibilityGuards===!0)return t;const n=t.dwg_ptr_to_ltype_dash_array;if(typeof n=="function")try{t.dwg_ptr_to_ltype_dash_array=(...o)=>{const e=n.apply(t,o);return Array.isArray(e)?e.map(a=>({length:$(a,"length"),complex_shapecode:$(a,"complex_shapecode"),shape_flag:$(a,"shape_flag"),style:Io(t,$(a,"style")),scale:$(a,"scale"),rotation:$(a,"rotation"),x_offset:$(a,"x_offset"),y_offset:$(a,"y_offset"),text:$(a,"text")})):[]}}catch{}try{Object.defineProperty(t,"__cadViewerCompatibilityGuards",{value:!0})}catch{}return t}function $(t,n){if(!(!t||typeof t!="object"))try{return t[n]}catch{return}}function Io(t,n){if(n)try{return t.dwg_ref_get_absref?.(n)==null?void 0:n}catch{return}}function ho(t,n,o,e={}){const a=t&&typeof t=="object"?t:{},i=Go(a,e),r=Do(a),s=Mo(a,e,r),_=vo(a,e),d=Yo(a.header,o),c=No(s),E=Wo(a,d),u=E.view,l=Co(a),I=yo(a,l),f=Ro(a),A=mo(a),h=Array.isArray(a.entities)?a.entities:[],g={keepRaw:!!e.keepRaw,includeUnknownProperties:!!e.keepRaw},p=h.filter(R=>!!R&&typeof R=="object").map(R=>xe(R,g)),C=to({format:"dwg",sourceName:n,header:d,layers:i,lineTypes:s,blocks:_,entities:p,savedView:u,dictionaries:l,xrecords:I,dataLinks:f,dataTables:A,metadata:{parser:"@mlightcad/libredwg-web",parserMode:"wasm",version:o,savedView:u,requiredShxFonts:c,businessData:{dictionaries:l.length,xrecords:I.length,dataLinks:f.length,dataTables:A.length}},warnings:E.warning?[E.warning]:[],raw:e.keepRaw?t:void 0});if(p.length===0&&C.warnings.push("DWG parsed successfully but no model-space entities were exposed by the converter. Check layout/paper-space content or unsupported proxy objects."),[...new Set(Object.values(s))].some(R=>R.pattern.some(D=>Number(D.elementTypeFlag??0)!==0))){const R=c.length>0?` This drawing references external shape font${c.length===1?"":"s"} ${c.join(", ")}, whose outlines are not embedded in the DWG.`:"";C.warnings.push(`Complex SHX linetype glyphs are preserved in the normalized LTYPE definition and rendered as a dash/dot approximation.${R}`)}return C}function To(t,n,o){const e={DATALINK:[],DATATABLE:[],TABLECONTENT:[],TABLES:[]};if(!t||!n||!o)return e;e.DATALINK=xn(t,n,o.DWG_TYPE_DATALINK,(i,r)=>{const s=P(N(t,i,"year")),_=P(N(t,i,"month")),d=P(N(t,i,"day")),c=P(N(t,i,"hour")),E=P(N(t,i,"minute")),u=P(N(t,i,"seconds"));return jt({handle:r,dataAdapter:N(t,i,"data_adapter"),description:N(t,i,"description"),tooltip:N(t,i,"tooltip"),connectionString:N(t,i,"connection_string"),option:N(t,i,"option"),updateOption:N(t,i,"update_option"),pathOption:N(t,i,"path_option"),updateStatus:N(t,i,"update_status"),lastUpdated:go(s,_,d,c,E,u)})}),e.DATATABLE=xn(t,n,o.DWG_TYPE_DATATABLE,(i,r)=>jt({handle:r,flags:N(t,i,"flags"),rowCount:N(t,i,"num_rows"),columnCount:N(t,i,"num_cols"),tableName:N(t,i,"table_name"),columns:_t(N(t,i,"cols"))})),e.TABLECONTENT=xn(t,n,o.DWG_TYPE_TABLECONTENT,(i,r)=>jt({handle:r,linkedData:_t(N(t,i,"ldata")),linkedTableData:_t(N(t,i,"tdata")),formattedTableData:_t(N(t,i,"fdata")),tableStyle:W(N(t,i,"tablestyle"))}));const a=o.DWG_TYPE_TABLE;if(Number.isFinite(a)&&typeof t.dwg_getall_entities_in_model_space=="function")try{for(const i of t.dwg_getall_entities_in_model_space(n)??[]){if(t.dwg_object_get_fixedtype?.(i)!==a)continue;const r=t.dwg_object_to_entity?.(i),s=t.dwg_object_to_entity_tio?.(i);if(!r||!s)continue;const _=W(t.dwg_object_entity_get_handle_object?.(r)?.value);e.TABLES.push(jt({handle:_,linkedData:_t(N(t,s,"ldata")),linkedTableData:_t(N(t,s,"tdata")),formattedTableData:_t(N(t,s,"fdata"))}))}}catch{}return e}function Po(t,n){if(!t||typeof t!="object")return;const o=t,e=o.objects&&typeof o.objects=="object"?o.objects:o.objects={};for(const a of["DATALINK","DATATABLE","TABLECONTENT"]){if(n[a].length===0)continue;const i=Array.isArray(e[a])?e[a]:[];e[a]=po(i,n[a])}if(n.TABLES.length>0&&Array.isArray(o.entities)){const a=new Map(n.TABLES.map(i=>[y(i.handle)?.toLocaleUpperCase(),i]));for(const i of o.entities){if(!i||typeof i!="object")continue;const r=i,s=a.get(y(r.handle)?.toLocaleUpperCase());s&&Object.assign(r,s)}}}function xn(t,n,o,e){if(!Number.isFinite(o)||typeof t.dwg_getall_object_by_type!="function")return[];const a=[];try{for(const i of t.dwg_getall_object_by_type(n,o)??[]){const r=t.dwg_obj_generic_to_object?.(i),s=W(r?t.dwg_object_get_handle_object?.(r)?.value:void 0);a.push(e(i,s))}}catch{}return a}function N(t,n,o){try{return typeof t.dwg_dynapi_entity_data=="function"?t.dwg_dynapi_entity_data(n,o):t.dwg_dynapi_entity_value?.(n,o)?.data}catch{return}}function _t(t){if(!(!t||typeof t!="object"||typeof t=="number"))return X(t)}function W(t){if(typeof t=="bigint")return t.toString(16).toLocaleUpperCase();if(typeof t=="number"&&Number.isFinite(t))return Math.trunc(t).toString(16).toLocaleUpperCase();if(typeof t=="string")return t.trim()||void 0;if(Array.isArray(t))return W(t[3]??t[2]);if(t&&typeof t=="object"){const n=t;return W(n.absolute_ref??n.absoluteRef??n.value??n.handle)}}function jt(t){return Object.fromEntries(Object.entries(t).filter(([,n])=>n!=null&&n!==""))}function go(t,n,o,e=0,a=0,i=0){if(!t||!n||!o)return;const r=new Date(Date.UTC(t,n-1,o,e,a,i));return Number.isNaN(r.getTime())?void 0:r.toISOString()}function po(t,n){const o=[...t],e=new Map;o.forEach((a,i)=>{if(a&&typeof a=="object"){const r=W(a.handle);r&&e.set(r.toLocaleUpperCase(),i)}});for(const a of n){const i=W(a.handle),r=i?e.get(i.toLocaleUpperCase()):void 0;r===void 0?o.push(a):o[r]={...o[r],...a}}return o}function Co(t){const n=t.objects&&typeof t.objects=="object"?t.objects:void 0,o=[n?.DICTIONARY,n?.dictionary,t.dictionaries],e=[],a=new Set;for(const i of o)for(const r of dn(i)){if(!r||typeof r!="object")continue;const s=r,_=W(s.handle??s.id);if(_&&a.has(_.toLocaleUpperCase()))continue;const d=[];if(s.entries&&typeof s.entries=="object"&&!Array.isArray(s.entries))for(const[c,E]of Object.entries(s.entries)){const u=W(E);c&&u&&d.push({name:c,handle:u})}else if(Array.isArray(s.texts)&&Array.isArray(s.itemhandles))for(let c=0;c<Math.min(s.texts.length,s.itemhandles.length);c+=1){const E=y(s.texts[c]),u=W(s.itemhandles[c]);E&&u&&d.push({name:E,handle:u})}e.push({handle:_,ownerHandle:W(s.ownerHandle??s.owner),entries:d}),_&&a.add(_.toLocaleUpperCase())}return e}function yo(t,n){const o=t.objects&&typeof t.objects=="object"?t.objects:void 0,e=[o?.XRECORD,o?.xrecords,t.xrecords],a=[],i=new Set;for(const r of e)for(const s of dn(r)){if(!s||typeof s!="object")continue;const _=s,d=W(_.handle??_.id);if(d&&i.has(d.toLocaleUpperCase()))continue;const c=(Array.isArray(_.data)?_.data:Array.isArray(_.entries)?_.entries:[]).flatMap(l=>{const I=l&&typeof l=="object"?l:void 0,f=X(I?.value??I?.data??l);if(f===void 0)return[];const A=P(I?.code??I?.groupCode);return[{...A!==void 0?{code:A}:{},value:f}]}),E=W(_.ownerHandle??_.owner),u=Lo(d,E,n);a.push({handle:d,ownerHandle:E,entryName:y(_.entryName)??u.entryName,dictionaryPath:Array.isArray(_.dictionaryPath)?_.dictionaryPath.map(String):u.path,extensionDictionary:W(_.extensionDictionary),cloning:P(_.cloning),data:c}),d&&i.add(d.toLocaleUpperCase())}return a}function Lo(t,n,o){if(!t)return{};const e=new Map(o.filter(d=>d.handle).map(d=>[d.handle.toLocaleUpperCase(),d])),a=n?e.get(n.toLocaleUpperCase()):void 0,i=a?.entries.find(d=>d.handle.toLocaleUpperCase()===t.toLocaleUpperCase())?.name;if(!a)return{entryName:i};const r=i?[i]:[];let s=a;const _=new Set;for(;s.handle&&s.ownerHandle&&!_.has(s.handle.toLocaleUpperCase());){_.add(s.handle.toLocaleUpperCase());const d=e.get(s.ownerHandle.toLocaleUpperCase());if(!d)break;const c=d.entries.find(E=>E.handle.toLocaleUpperCase()===s.handle.toLocaleUpperCase())?.name;c&&r.unshift(c),s=d}return{entryName:i,path:r.length>0?r:void 0}}function Ro(t){const n=t.objects&&typeof t.objects=="object"?t.objects:void 0,o=[],e=new Set;for(const a of dn(n?.DATALINK??n?.dataLinks??t.dataLinks)){if(!a||typeof a!="object")continue;const i=a,r=W(i.handle??i.id);r&&e.has(r.toLocaleUpperCase())||(o.push({handle:r,dataAdapter:y(i.dataAdapter??i.data_adapter),description:y(i.description),tooltip:y(i.tooltip),connectionString:y(i.connectionString??i.connection_string),updateStatus:y(i.updateStatus??i.update_status),updateOption:P(i.updateOption??i.update_option),pathOption:P(i.pathOption??i.path_option),lastUpdated:y(i.lastUpdated??i.last_updated)}),r&&e.add(r.toLocaleUpperCase()))}return o}function mo(t){const n=t.objects&&typeof t.objects=="object"?t.objects:void 0,o=[n?.DATATABLE,n?.dataTables,t.dataTables,n?.TABLECONTENT],e=[],a=new Set;for(const i of o)for(const r of dn(i)){if(!r||typeof r!="object")continue;const s=r,_=W(s.handle??s.id);if(_&&a.has(_.toLocaleUpperCase()))continue;const d=ut(s.linkedData??s.ldata),c=ut(s.linkedTableData??s.tdata),E=So(s.columns??s.cols,c),u=Math.max(0,Math.trunc(P(s.rowCount??s.numRows??s.num_rows??c?.numRows??c?.num_rows)??0),...E.map(I=>I.values.length)),l=Math.max(E.length,Math.trunc(P(s.columnCount??s.numColumns??s.numCols??s.num_cols??c?.numColumns??c?.numCols??c?.num_cols)??0));E.length===0&&u===0&&l===0||(e.push({handle:_,name:y(s.tableName??s.table_name??s.name??d?.name??d?.description),rowCount:u,columnCount:l,columns:E}),_&&a.add(_.toLocaleUpperCase()))}return e}function So(t,n){const o=Array.isArray(t)?t:Array.isArray(n?.columns)?n.columns:Array.isArray(n?.cols)?n.cols:[];if(o.length>0)return o.map((r,s)=>{const _=ut(r),d=Array.isArray(_?.rows)?_.rows:Array.isArray(_?.values)?_.values:[];return{name:y(_?.name??_?.text)??`Column ${s+1}`,type:y(_?.type)??P(_?.type),values:d.map(he).filter(c=>c!==void 0)}});const a=(Array.isArray(n?.rows)?n.rows:[]).map(r=>{const s=ut(r);return Array.isArray(s?.cells)?s.cells:[]}),i=Math.max(0,...a.map(r=>r.length));return Array.from({length:i},(r,s)=>({name:`Column ${s+1}`,values:a.map(_=>he(_[s])).filter(_=>_!==void 0)}))}function he(t){const n=ut(t),e=(Array.isArray(n?.cellContents)?n.cellContents:Array.isArray(n?.cell_contents)?n.cell_contents:void 0)?.[0]??n?.value??t,a=ut(e);for(const i of[a?.valueString,a?.value_string,a?.dataString,a?.data_string,a?.dataLong,a?.data_long,a?.dataDouble,a?.data_double,a?.dataDate,a?.data_date,a?.dataPoint,a?.data_point,a?.data3dPoint,a?.data_3dpoint,e]){const r=X(i);if(r!=null&&r!==""&&!(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0))return r}}function dn(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t!="object")return[];const n=t;for(const o of["entries","records","items","values"])if(Array.isArray(n[o]))return n[o];return Object.values(n).filter(o=>o&&typeof o=="object")}function ut(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function No(t){const n=new Set;for(const o of new Set(Object.values(t)))for(const e of o.pattern)Number(e.elementTypeFlag??0)!==0&&e.fontName&&n.add(e.fontName);return[...n].sort((o,e)=>o.localeCompare(e))}function Do(t){const n=t.tables,o=[t.STYLE,t.styles,n?.STYLE,n?.styles],e=new Map,a=new Set;for(const i of o)for(const r of xt(i)){if(!r||typeof r!="object")continue;const s=r,_=y(s.font??s.fontFileName??s.primaryFontFileName);if(!_||!/\.shx$/i.test(_))continue;((P(s.standardFlag??s.flag)??0)&1)===1&&a.add(_);for(const c of[s.handle,s.id,s.name]){const E=Ye(c);E&&e.set(E,_)}}return{byReference:e,shapeFonts:[...a]}}function xe(t,n){const o=Re(t,void 0,{...n,numericColorMode:"rgb"}),e=P(t.color);e!==void 0&&e>=0&&e<=16777215&&(o.color=e,o.trueColor=e),o.colorIndex=P(t.colorIndex??t.colorNumber??t.aci)??o.colorIndex,o.colorName=y(t.colorName??t.color_name)??o.colorName;const a=P(t.flag??t.flags);a!==void 0&&(o.flag=a);const i=String(t.type??t.entityType??"").toUpperCase(),r=/^(POLYLINE|POLYLINE_2D|POLYLINE2D|POLYLINE_3D|POLYLINE3D)$/.test(i);return(t.isClosed===!0||t.closed===!0||r&&(Number(a??0)&1)===1||i==="LWPOLYLINE"&&(Number(a??0)&512)===512)&&(o.isClosed=!0),o}function xo(t){return typeof t=="number"&&Number.isFinite(t)&&Math.abs(Math.trunc(t))>=1&&Math.abs(Math.trunc(t))<=255}function Yo(t,n){const o=t&&typeof t=="object"?{...t}:{};return n&&(o.dwgVersion=n),o}function Go(t,n){const o={},e=[],a=t.tables;for(const i of["LAYER","layer","layers"]){const r=t[i]??a?.[i];r&&e.push(r)}for(const i of e)for(const r of xt(i)){const s=r,_=y(s.name??s.layerName??s.entryName);if(!_)continue;const d=P(s.colorIndex??s.colorNumber),c=P(s.trueColor??s.true_color??s.truecolor??s.colorRGB??s.colorRgb??s.rgbColor??s.rgb),E=P(s.color),u=xo(d),l=c??(!u&&E!==void 0&&E>=0&&E<=16777215?E:void 0),I={name:_,color:u?void 0:s.color??s.colorName,colorIndex:d??(E!==void 0&&Math.abs(E)<=257?E:void 0),trueColor:l,lineType:y(s.lineType??s.linetype),lineweight:P(s.lineweight??s.lineWeight),isVisible:!(s.isVisible===!1||s.off===!0||Number(d??s.color??1)<0),isFrozen:!!(s.isFrozen??s.frozen),isLocked:!!(s.isLocked??s.locked),raw:n.keepRaw?s:void 0};eo(o,I)}return o}function Mo(t,n,o){const e={},a=t.tables,i=[t.LTYPE,t.ltype,t.lineTypes,a?.LTYPE,a?.ltype,a?.lineTypes];for(const r of i)for(const s of xt(r)){const _=s,d=y(_.name??_.lineTypeName??_.entryName);if(!d)continue;const E=(Array.isArray(_.pattern)?_.pattern:Array.isArray(_.dashes)?_.dashes:[]).flatMap(u=>{if(typeof u=="number")return[{length:u}];if(!u||typeof u!="object")return[];const l=u,I=P(l.elementLength??l.length??l.dashLength);if(I===void 0)return[];const f=P(l.elementTypeFlag),A=P(l.shapeNumber),h=f!==void 0&&A!==void 0,g=h?A:P(l.typeFlag??l.elementTypeFlag),p=y(l.styleObjectId??l.styleHandle??l.style),C=(p?o.byReference.get(Ye(p)):void 0)??((Number(g??0)&4)===4&&o.shapeFonts.length===1?o.shapeFonts[0]:void 0);return[{length:I,elementTypeFlag:g,shapeNumber:h?f:P(l.shapeCode??l.shapeNumber),scale:P(l.scale),rotation:P(l.rotation),offsetX:P(l.offsetX),offsetY:P(l.offsetY),text:y(l.text),styleHandle:p,fontName:C}]});ao(e,{name:d,handle:y(_.handle??_.id),description:y(_.description),totalPatternLength:P(_.totalPatternLength??_.patternLength),pattern:E,raw:n.keepRaw?_:void 0})}return e}function Ye(t){return String(t??"").trim().replace(/^0x/i,"").replace(/^0+(?=[0-9a-f])/i,"").toLowerCase()}function Wo(t,n){const o=t.tables,a=xt(t.VPORT??t.vports??o?.VPORT??o?.vports).filter(h=>!!h&&typeof h=="object").find(h=>String(h.name??"").trim().toLowerCase()==="*active"),i=a?"vport":"header-ucs",r=a??n,s=b(r.ucsOrigin??r.UCSORG??n.UCSORG),_=b(r.ucsXAxis??r.UCSXDIR??n.UCSXDIR),d=b(r.ucsYAxis??r.UCSYDIR??n.UCSYDIR),c=P(r.viewTwistAngle??r.twistAngle??r.VIEWTWIST)??0,E=b(r.viewDirectionFromTarget??r.viewDirection??r.direction??r.VIEWDIR),u=!Oo(s,_,d);if(!(!!a||!!E||u||Math.abs(c)>1e-12))return{};const I=wo(E),f=I?bo(s,_,d,c):{a:1,b:0,c:0,d:1,e:0,f:0},A={source:i,name:y(r.name),handle:y(r.handle),center:b(r.center??r.VIEWCTR),target:b(r.viewTarget??r.target??r.TARGET),direction:E,viewHeight:P(r.viewHeight??r.height??r.VIEWSIZE),aspectRatio:P(r.aspectRatio),twistAngle:c,ucsOrigin:s,ucsXAxis:_,ucsYAxis:d,sceneTransformApplied:I,sceneTransform:f};return I?{view:A}:{view:A,warning:"The saved CAD view has a missing, non-finite, or tilted VIEWDIR. File Viewer kept world coordinates instead of applying an unsafe 2D UCS/PLAN rotation."}}function bo(t,n,o,e){const a=Yn(n)??{x:1,y:0},i=Yn(o)??{x:-a.y,y:a.x},r=a.x*i.x+a.y*i.y,s=Yn({x:i.x-a.x*r,y:i.y-a.y*r})??{x:-a.y,y:a.x},_={a:a.x,b:s.x,c:a.y,d:s.y,e:t?-(t.x*a.x+t.y*a.y):0,f:t?-(t.x*s.x+t.y*s.y):0};return lo(Eo(Number.isFinite(e)?e:0),_)}function Yn(t){if(!t||Math.abs(Number(t.z??0))>1e-6)return;const n=Math.hypot(t.x,t.y);if(!(!Number.isFinite(n)||n<1e-12))return{x:t.x/n,y:t.y/n}}function wo(t){if(!t||!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(t.z))return!1;const n=Math.hypot(t.x,t.y,Number(t.z));return!Number.isFinite(n)||n<1e-12?!1:Math.hypot(t.x,t.y)/n<=1e-4&&Math.abs(Number(t.z))/n>=1-1e-8}function Oo(t,n,o){const e=(s,_)=>Number.isFinite(s)&&Math.abs(Number(s)-_)<=1e-10,a=!t||e(t.x,0)&&e(t.y,0)&&e(t.z??0,0),i=!n||e(n.x,1)&&e(n.y,0)&&e(n.z??0,0),r=!o||e(o.x,0)&&e(o.y,1)&&e(o.z??0,0);return a&&i&&r}function vo(t,n){const o={},e=[t.blocks,t.blockHeaders,t.block_records,t.blockRecords],a=t.tables;e.push(a?.BLOCK,a?.BLOCK_RECORD,a?.blocks);const i={keepRaw:!!n.keepRaw,includeUnknownProperties:!!n.keepRaw};for(const r of e)for(const s of xt(r)){const _=s,d=y(_.name??_.blockName??_.name2);if(!d)continue;const E=(Array.isArray(_.entities)?_.entities:Array.isArray(_.ownedObjects)?_.ownedObjects:[]).filter(u=>!!u&&typeof u=="object").map(u=>xe(u,i));oo(o,{name:d,basePoint:b(_.basePoint??_.origin)??{x:0,y:0},entities:E,raw:n.keepRaw?_:void 0})}return o}function xt(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t!="object")return[];const n=t,o=Object.values(n).filter(a=>a&&typeof a=="object"),e=["entries","records","items","values","layers","blocks"].flatMap(a=>Array.isArray(n[a])?n[a]:[]);return e.length>0?e:o}function Bo(t){const n=t.trim()||"/wasm";if(n==="/")return Pe();const o=n.replace(/\/+$/,"");return ko(o)?o:o.startsWith("/")?`${Pe()}${o}`:new URL(o,Me()).href.replace(/\/+$/,"")}function Te(t){return new URL("libredwg-web.wasm",Ge(t)).href}function Ge(t){return t.endsWith("/")?t:`${t}/`}function ko(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)}function Me(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof location<"u"&&location.href?location.href:"http://localhost/"}function Pe(){return typeof location<"u"&&location.origin?location.origin:new URL(Me()).origin}async function Fo(t){if(typeof fetch!="function")throw new Error("fetch() is not available, so the LibreDWG WASM binary cannot be loaded.");const n=await fetch(t,{credentials:"same-origin",cache:"force-cache"});if(!n.ok)throw new Error(`WASM asset request failed with HTTP ${n.status} for ${t}.`);const o=new Uint8Array(await n.arrayBuffer());if(!Uo(o)){const e=Vo(o),a=n.headers.get("content-type")??"unknown content-type";throw new Error(`Invalid WASM asset at ${t}. Expected bytes 00 61 73 6d, got ${Ho(o)} (${a}). The server probably returned an HTML fallback page instead of libredwg-web.wasm. Response preview: ${e}`)}return o}function Uo(t){return t.length>=4&&t[0]===0&&t[1]===97&&t[2]===115&&t[3]===109}function Ho(t){return Array.from(t.slice(0,4)).map(n=>n.toString(16).padStart(2,"0")).join(" ")}function Vo(t){const n=Array.from(t.slice(0,32)).map(o=>o>=32&&o<=126?String.fromCharCode(o):".").join("");return JSON.stringify(n)}const Et=self;Et.postMessage({type:"ready"});Et.onmessage=async t=>{const n=t.data;if(!n)return;const o=performance.now(),e=a=>{Et.postMessage({type:"progress",requestId:n.requestId,progress:a})};try{if(n.type==="warmup"){e({phase:"wasm-init",format:"dwg",message:"Warming LibreDWG WebAssembly instance…"}),await De(n.options?.wasmPath??"/wasm/"),Et.postMessage({type:"warmup-result",requestId:n.requestId,elapsedMs:performance.now()-o});return}if(n.type!=="load")return;e({phase:"worker-ready",format:"dwg",message:"DWG worker received file bytes.",total:n.bytes.byteLength});const a=await fo(new Uint8Array(n.bytes),{...n.options,sourceName:n.fileName,keepRaw:!!n.options?.keepRaw,onProgress:e});a.document.metadata.loaderMode="worker",a.elapsedMs=performance.now()-o,Et.postMessage({type:"result",requestId:n.requestId,result:a})}catch(a){const i=Xo(a);Et.postMessage({type:"error",requestId:n.requestId,error:i})}};function Xo(t){return t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:{message:String(t)}}var Wn;(function(t){t[t.CP_UTF8=0]="CP_UTF8",t[t.CP_US_ASCII=1]="CP_US_ASCII",t[t.CP_ISO_8859_1=2]="CP_ISO_8859_1",t[t.CP_ISO_8859_2=3]="CP_ISO_8859_2",t[t.CP_ISO_8859_3=4]="CP_ISO_8859_3",t[t.CP_ISO_8859_4=5]="CP_ISO_8859_4",t[t.CP_ISO_8859_5=6]="CP_ISO_8859_5",t[t.CP_ISO_8859_6=7]="CP_ISO_8859_6",t[t.CP_ISO_8859_7=8]="CP_ISO_8859_7",t[t.CP_ISO_8859_8=9]="CP_ISO_8859_8",t[t.CP_ISO_8859_9=10]="CP_ISO_8859_9",t[t.CP_CP437=11]="CP_CP437",t[t.CP_CP850=12]="CP_CP850",t[t.CP_CP852=13]="CP_CP852",t[t.CP_CP855=14]="CP_CP855",t[t.CP_CP857=15]="CP_CP857",t[t.CP_CP860=16]="CP_CP860",t[t.CP_CP861=17]="CP_CP861",t[t.CP_CP863=18]="CP_CP863",t[t.CP_CP864=19]="CP_CP864",t[t.CP_CP865=20]="CP_CP865",t[t.CP_CP869=21]="CP_CP869",t[t.CP_CP932=22]="CP_CP932",t[t.CP_MACINTOSH=23]="CP_MACINTOSH",t[t.CP_BIG5=24]="CP_BIG5",t[t.CP_CP949=25]="CP_CP949",t[t.CP_JOHAB=26]="CP_JOHAB",t[t.CP_CP866=27]="CP_CP866",t[t.CP_ANSI_1250=28]="CP_ANSI_1250",t[t.CP_ANSI_1251=29]="CP_ANSI_1251",t[t.CP_ANSI_1252=30]="CP_ANSI_1252",t[t.CP_GB2312=31]="CP_GB2312",t[t.CP_ANSI_1253=32]="CP_ANSI_1253",t[t.CP_ANSI_1254=33]="CP_ANSI_1254",t[t.CP_ANSI_1255=34]="CP_ANSI_1255",t[t.CP_ANSI_1256=35]="CP_ANSI_1256",t[t.CP_ANSI_1257=36]="CP_ANSI_1257",t[t.CP_ANSI_874=37]="CP_ANSI_874",t[t.CP_ANSI_932=38]="CP_ANSI_932",t[t.CP_ANSI_936=39]="CP_ANSI_936",t[t.CP_ANSI_949=40]="CP_ANSI_949",t[t.CP_ANSI_950=41]="CP_ANSI_950",t[t.CP_ANSI_1361=42]="CP_ANSI_1361",t[t.CP_UTF16=43]="CP_UTF16",t[t.CP_ANSI_1258=44]="CP_ANSI_1258",t[t.CP_UNDEFINED=255]="CP_UNDEFINED"})(Wn||(Wn={}));const Ko=["utf-8","utf-8","iso-8859-1","iso-8859-2","iso-8859-3","iso-8859-4","iso-8859-5","iso-8859-6","iso-8859-7","iso-8859-8","iso-8859-9","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","utf-8","shift-jis","macintosh","big5","utf-8","utf-8","ibm866","windows-1250","windows-1251","windows-1252","gbk","windows-1253","windows-1254","windows-1255","windows-1256","windows-1257","windows-874","shift-jis","gbk","euc-kr","big5","utf-8","utf-16le","windows-1258"],bn=t=>Ko[t];var wn;(function(t){t[t.Rotated=0]="Rotated",t[t.Aligned=1]="Aligned",t[t.Angular=2]="Angular",t[t.Diameter=3]="Diameter",t[t.Radius=4]="Radius",t[t.Angular3Point=5]="Angular3Point",t[t.Ordinate=6]="Ordinate",t[t.ReferenceIsExclusive=32]="ReferenceIsExclusive",t[t.IsOrdinateXTypeFlag=64]="IsOrdinateXTypeFlag",t[t.IsCustomTextPositionFlag=128]="IsCustomTextPositionFlag"})(wn||(wn={}));var J;(function(t){t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"})(J||(J={}));var On;(function(t){t[t.AtLeast=1]="AtLeast",t[t.Exact=2]="Exact"})(On||(On={}));var vn;(function(t){t[t.Center=0]="Center",t[t.Above=1]="Above",t[t.Outside=2]="Outside",t[t.JIS=3]="JIS",t[t.Below=4]="Below"})(vn||(vn={}));var Bn;(function(t){t[t.Feet=0]="Feet",t[t.None=1]="None",t[t.Inch=2]="Inch",t[t.FeetAndInch=3]="FeetAndInch",t[t.Leading=4]="Leading",t[t.Trailing=8]="Trailing",t[t.LeadingAndTrailing=12]="LeadingAndTrailing"})(Bn||(Bn={}));var kn;(function(t){t[t.None=0]="None",t[t.Leading=1]="Leading",t[t.Trailing=2]="Trailing",t[t.LeadingAndTrailing=3]="LeadingAndTrailing"})(kn||(kn={}));var Fn;(function(t){t[t.Center=0]="Center",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.OverFirst=3]="OverFirst",t[t.OverSecond=4]="OverSecond"})(Fn||(Fn={}));var Un;(function(t){t[t.Bottom=0]="Bottom",t[t.Center=1]="Center",t[t.Top=2]="Top"})(Un||(Un={}));var mt;(function(t){t[t.PatternFill=0]="PatternFill",t[t.SolidFill=1]="SolidFill"})(mt||(mt={}));var St;(function(t){t[t.NonAssociative=0]="NonAssociative",t[t.Associative=1]="Associative"})(St||(St={}));var Hn;(function(t){t[t.Normal=0]="Normal",t[t.Outer=1]="Outer",t[t.Ignore=2]="Ignore"})(Hn||(Hn={}));var Vn;(function(t){t[t.UserDefined=0]="UserDefined",t[t.Predefined=1]="Predefined",t[t.Custom=2]="Custom"})(Vn||(Vn={}));var Xn;(function(t){t[t.NotAnnotated=0]="NotAnnotated",t[t.Annotated=1]="Annotated"})(Xn||(Xn={}));var en;(function(t){t[t.Solid=0]="Solid",t[t.Gradient=1]="Gradient"})(en||(en={}));var Nt;(function(t){t[t.TwoColor=0]="TwoColor",t[t.OneColor=1]="OneColor"})(Nt||(Nt={}));var Kn;(function(t){t[t.Default=0]="Default",t[t.External=1]="External",t[t.Polyline=2]="Polyline",t[t.Derived=4]="Derived",t[t.Textbox=8]="Textbox",t[t.Outermost=16]="Outermost"})(Kn||(Kn={}));var dt;(function(t){t[t.Line=1]="Line",t[t.Circular=2]="Circular",t[t.Elliptic=3]="Elliptic",t[t.Spline=4]="Spline"})(dt||(dt={}));var zn;(function(t){t[t.CLOSED_POLYLINE=1]="CLOSED_POLYLINE",t[t.CURVE_FIT=2]="CURVE_FIT",t[t.SPLINE_FIT=4]="SPLINE_FIT",t[t.POLYLINE_3D=8]="POLYLINE_3D",t[t.POLYGON_3D=16]="POLYGON_3D",t[t.CLOSED_POLYGON=32]="CLOSED_POLYGON",t[t.POLYFACE=64]="POLYFACE",t[t.CONTINUOUS=128]="CONTINUOUS"})(zn||(zn={}));var $n;(function(t){t[t.NONE=0]="NONE",t[t.QUADRATIC=5]="QUADRATIC",t[t.CUBIC=6]="CUBIC",t[t.BEZIER=8]="BEZIER"})($n||($n={}));var Jn;(function(t){t[t.Dwg=0]="Dwg",t[t.Dxf=1]="Dxf"})(Jn||(Jn={}));var Zn;(function(t){t[t.NONE=0]="NONE",t[t.MIRRORED_X=2]="MIRRORED_X",t[t.MIRRORED_Y=4]="MIRRORED_Y"})(Zn||(Zn={}));var Dt;(function(t){t[t.LEFT=0]="LEFT",t[t.CENTER=1]="CENTER",t[t.RIGHT=2]="RIGHT",t[t.ALIGNED=3]="ALIGNED",t[t.MIDDLE=4]="MIDDLE",t[t.FIT=5]="FIT"})(Dt||(Dt={}));var qn;(function(t){t[t.BASELINE=0]="BASELINE",t[t.BOTTOM=1]="BOTTOM",t[t.MIDDLE=2]="MIDDLE",t[t.TOP=3]="TOP"})(qn||(qn={}));const We=Object.freeze(["ACADMAINTVER","ACADVER","ANGBASE","ANGDIR","ATTMODE","AUNITS","AUPREC","CECOLOR","CELTSCALE","CELTYPE","CELWEIGHT","CEPSNID","CEPSNTYPE","CHAMFERA","CHAMFERB","CHAMFERC","CHAMFERD","CLAYER","CMLJUST","CMLSCALE","CMLSTYLE","CSHADOW","DIMADEC","DIMALT","DIMALTD","DIMALTF","DIMALTRND","DIMALTTD","DIMALTTZ","DIMALTU","DIMALTZ","DIMAPOST","DIMASO","DIMASSOC","DIMASZ","DIMATFIT","DIMAUNIT","DIMAZIN","DIMBLK","DIMBLK1","DIMBLK2","DIMCEN","DIMCLRD","DIMCLRE","DIMCLRT","DIMDEC","DIMDLE","DIMDLI","DIMDSEP","DIMEXE","DIMEXO","DIMFAC","DIMGAP","DIMJUST","DIMLDRBLK","DIMLFAC","DIMLIM","DIMLUNIT","DIMLWD","DIMLWE","DIMPOST","DIMRND","DIMSAH","DIMSCALE","DIMSD1","DIMSD2","DIMSE1","DIMSE2","DIMSHO","DIMSOXD","DIMSTYLE","DIMTAD","DIMTDEC","DIMTFAC","DIMTIH","DIMTIX","DIMTM","DIMTMOVE","DIMTOFL","DIMTOH","DIMTOL","DIMTOLJ","DIMTP","DIMTSZ","DIMTVP","DIMTXSTY","DIMTXT","DIMTZIN","DIMUPT","DIMZIN","DISPSILH","DRAGVS","DWGCODEPAGE","ELEVATION","ENDCAPS","EXTMAX","EXTMIN","EXTNAMES","FILLETRAD","FILLMODE","FINGERPRINTGUID","HALOGAP","HANDSEED","HIDETEXT","HYPERLINKBASE","INDEXCTL","INSBASE","INSUNITS","INTERFERECOLOR","INTERFEREOBJVS","INTERFEREVPVS","INTERSECTIONCOLOR","INTERSECTIONDISPLAY","JOINSTYLE","LIMCHECK","LIMMAX","LIMMIN","LTSCALE","LUNITS","LUPREC","LWDISPLAY","MAXACTVP","MEASUREMENT","MENU","MIRRTEXT","OBSCOLOR","OBSLTYPE","ORTHOMODE","PDMODE","PDSIZE","PELEVATION","PEXTMAX","PEXTMIN","PINSBASE","PLIMCHECK","PLIMMAX","PLIMMIN","PLINEGEN","PLINEWID","PROJECTNAME","PROXYGRAPHICS","PSLTSCALE","PSTYLEMODE","PSVPSCALE","PUCSBASE","PUCSNAME","PUCSORG","PUCSORGBACK","PUCSORGBOTTOM","PUCSORGFRONT","PUCSORGLEFT","PUCSORGRIGHT","PUCSORGTOP","PUCSORTHOREF","PUCSORTHOVIEW","PUCSXDIR","PUCSYDIR","QTEXTMODE","REGENMODE","SHADEDGE","SHADEDIF","SHADOWPLANELOCATION","SKETCHINC","SKPOLY","SORTENTS","SPLINESEGS","SPLINETYPE","SURFTAB1","SURFTAB2","SURFTYPE","SURFU","SURFV","TDCREATE","TDINDWG","TDUCREATE","TDUPDATE","TDUSRTIMER","TDUUPDATE","TEXTSIZE","TEXTSTYLE","THICKNESS","TILEMODE","TRACEWID","TREEDEPTH","UCSBASE","UCSNAME","UCSORG","UCSORGBACK","UCSORGBOTTOM","UCSORGFRONT","UCSORGLEFT","UCSORGRIGHT","UCSORGTOP","UCSORTHOREF","UCSORTHOVIEW","UCSXDIR","UCSYDIR","UNITMODE","USERI1","USERI2","USERI3","USERI4","USERI5","USERR1","USERR2","USERR3","USERR4","USERR5","USRTIMER","VERSIONGUID","VISRETAIN","WORLDVIEW","XCLIPFRAME","XEDIT"]);var Qn;(function(t){t[t.NotApplicable=0]="NotApplicable",t[t.KeepExisting=1]="KeepExisting",t[t.UseClone=2]="UseClone",t[t.XrefName=3]="XrefName",t[t.Name=4]="Name",t[t.UnmangleName=5]="UnmangleName"})(Qn||(Qn={}));const be=[{type:"invalid",hdr:"INVALI",description:"No DWG",version:0},{type:"r1.1",hdr:"MC0.0",description:"MicroCAD Release 1.1",version:0},{type:"r1.2",hdr:"AC1.2",description:"AutoCAD Release 1.2",version:0},{type:"r1.3",hdr:"AC1.3",description:"AutoCAD Release 1.3",version:1},{type:"r1.4",hdr:"AC1.40",description:"AutoCAD Release 1.4",version:2},{type:"r2.0b",hdr:"AC1.50",description:"AutoCAD 2.0 beta",version:3},{type:"r2.0",hdr:"AC1.50",description:"AutoCAD Release 2.0",version:4},{type:"r2.10",hdr:"AC2.10",description:"AutoCAD Release 2.10",version:5},{type:"r2.21",hdr:"AC2.21",description:"AutoCAD Release 2.21",version:6},{type:"r2.22",hdr:"AC2.22",description:"AutoCAD Release 2.22",version:7},{type:"r2.4",hdr:"AC1001",description:"AutoCAD Release 2.4",version:8},{type:"r2.5",hdr:"AC1002",description:"AutoCAD Release 2.5",version:9},{type:"r2.6",hdr:"AC1003",description:"AutoCAD Release 2.6",version:10},{type:"r9",hdr:"AC1004",description:"AutoCAD Release 9",version:11},{type:"r9c1",hdr:"AC1005",description:"AutoCAD Release 9c1",version:12},{type:"r10",hdr:"AC1006",description:"AutoCAD Release 10",version:13},{type:"r11b1",hdr:"AC1007",description:"AutoCAD 11 beta 1",version:14},{type:"r11b2",hdr:"AC1008",description:"AutoCAD 11 beta 2",version:15},{type:"r11",hdr:"AC1009",description:"AutoCAD Release 11/12 (LT R1/R2)",version:16},{type:"r13b1",hdr:"AC1010",description:"AutoCAD pre-R13 a",version:17},{type:"r13b2",hdr:"AC1011",description:"AutoCAD pre-R13 b",version:18},{type:"r13",hdr:"AC1012",description:"AutoCAD Release 13",version:19},{type:"r13c3",hdr:"AC1013",description:"AutoCAD Release 13c3",version:20},{type:"r14",hdr:"AC1014",description:"AutoCAD Release 14",version:21},{type:"r2000b",hdr:"AC1500",description:"AutoCAD 2000 beta",version:22},{type:"r2000",hdr:"AC1015",description:"AutoCAD Release 2000",version:23},{type:"r2000i",hdr:"AC1016",description:"AutoCAD Release 2000i",version:23},{type:"r2002",hdr:"AC1017",description:"AutoCAD Release 2002",version:23},{type:"r2004a",hdr:"AC402a",description:"AutoCAD 2004 alpha a",version:24},{type:"r2004b",hdr:"AC402b",description:"AutoCAD 2004 alpha b",version:24},{type:"r2004c",hdr:"AC1018",description:"AutoCAD 2004 beta",version:24},{type:"r2004",hdr:"AC1018",description:"AutoCAD Release 2004",version:25},{type:"r2007a",hdr:"AC701a",description:"AutoCAD 2007 alpha",version:26},{type:"r2007b",hdr:"AC1021",description:"AutoCAD 2007 beta",version:26},{type:"r2007",hdr:"AC1021",description:"AutoCAD Release 2007",version:27},{type:"r2010b",hdr:"AC1024",description:"AutoCAD 2010 beta",version:28},{type:"r2010",hdr:"AC1024",description:"AutoCAD Release 2010",version:29},{type:"r2013b",hdr:"AC1027",description:"AutoCAD 2013 beta",version:30},{type:"r2013",hdr:"AC1027",description:"AutoCAD Release 2013",version:31},{type:"r2018b",hdr:"AC1032",description:"AutoCAD 2018 beta",version:32},{type:"r2018",hdr:"AC1032",description:"AutoCAD Release 2018",version:33},{type:"r2022b",hdr:"AC103-4",description:"AutoCAD 2022 beta",version:36},{type:"r>2022",hdr:"",description:"AutoCAD Release >2022",version:0}];async function jn(t={}){const n=zo(t),o=await import(n),e=o.default??o.createModule??o;if(typeof e!="function")throw new Error(`LibreDWG runtime module at ${n} did not export a createModule function.`);return e(t)}function zo(t){const n=t.locateFile;if(typeof n=="function")try{const o=n("libredwg-web.js","");if(typeof o=="string"&&o.length>0)return o}catch{}return typeof document<"u"&&document.baseURI?new URL("wasm/libredwg-web.js",document.baseURI).href:typeof location<"u"&&location.href?new URL("/wasm/libredwg-web.js",location.origin).href:"/wasm/libredwg-web.js"}var on;(function(t){t[t.DWG_SUPERTYPE_ENTITY=0]="DWG_SUPERTYPE_ENTITY",t[t.DWG_SUPERTYPE_OBJECT=1]="DWG_SUPERTYPE_OBJECT"})(on||(on={}));var an;(function(t){t[t.WRONGCRC=1]="WRONGCRC",t[t.NOTYETSUPPORTED=2]="NOTYETSUPPORTED",t[t.UNHANDLEDCLASS=4]="UNHANDLEDCLASS",t[t.INVALIDTYPE=8]="INVALIDTYPE",t[t.INVALIDHANDLE=16]="INVALIDHANDLE",t[t.INVALIDEED=32]="INVALIDEED",t[t.VALUEOUTOFBOUNDS=64]="VALUEOUTOFBOUNDS",t[t.CLASSESNOTFOUND=128]="CLASSESNOTFOUND",t[t.SECTIONNOTFOUND=256]="SECTIONNOTFOUND",t[t.PAGENOTFOUND=512]="PAGENOTFOUND",t[t.INTERNALERROR=1024]="INTERNALERROR",t[t.INVALIDDWG=2048]="INVALIDDWG",t[t.IOERROR=4096]="IOERROR",t[t.OUTOFMEM=8192]="OUTOFMEM"})(an||(an={}));var T;(function(t){t[t.DWG_TYPE_UNUSED=0]="DWG_TYPE_UNUSED",t[t.DWG_TYPE_TEXT=1]="DWG_TYPE_TEXT",t[t.DWG_TYPE_ATTRIB=2]="DWG_TYPE_ATTRIB",t[t.DWG_TYPE_ATTDEF=3]="DWG_TYPE_ATTDEF",t[t.DWG_TYPE_BLOCK=4]="DWG_TYPE_BLOCK",t[t.DWG_TYPE_ENDBLK=5]="DWG_TYPE_ENDBLK",t[t.DWG_TYPE_SEQEND=6]="DWG_TYPE_SEQEND",t[t.DWG_TYPE_INSERT=7]="DWG_TYPE_INSERT",t[t.DWG_TYPE_MINSERT=8]="DWG_TYPE_MINSERT",t[t.DWG_TYPE_VERTEX_2D=10]="DWG_TYPE_VERTEX_2D",t[t.DWG_TYPE_VERTEX_3D=11]="DWG_TYPE_VERTEX_3D",t[t.DWG_TYPE_VERTEX_MESH=12]="DWG_TYPE_VERTEX_MESH",t[t.DWG_TYPE_VERTEX_PFACE=13]="DWG_TYPE_VERTEX_PFACE",t[t.DWG_TYPE_VERTEX_PFACE_FACE=14]="DWG_TYPE_VERTEX_PFACE_FACE",t[t.DWG_TYPE_POLYLINE_2D=15]="DWG_TYPE_POLYLINE_2D",t[t.DWG_TYPE_POLYLINE_3D=16]="DWG_TYPE_POLYLINE_3D",t[t.DWG_TYPE_ARC=17]="DWG_TYPE_ARC",t[t.DWG_TYPE_CIRCLE=18]="DWG_TYPE_CIRCLE",t[t.DWG_TYPE_LINE=19]="DWG_TYPE_LINE",t[t.DWG_TYPE_DIMENSION_ORDINATE=20]="DWG_TYPE_DIMENSION_ORDINATE",t[t.DWG_TYPE_DIMENSION_LINEAR=21]="DWG_TYPE_DIMENSION_LINEAR",t[t.DWG_TYPE_DIMENSION_ALIGNED=22]="DWG_TYPE_DIMENSION_ALIGNED",t[t.DWG_TYPE_DIMENSION_ANG3PT=23]="DWG_TYPE_DIMENSION_ANG3PT",t[t.DWG_TYPE_DIMENSION_ANG2LN=24]="DWG_TYPE_DIMENSION_ANG2LN",t[t.DWG_TYPE_DIMENSION_RADIUS=25]="DWG_TYPE_DIMENSION_RADIUS",t[t.DWG_TYPE_DIMENSION_DIAMETER=26]="DWG_TYPE_DIMENSION_DIAMETER",t[t.DWG_TYPE_POINT=27]="DWG_TYPE_POINT",t[t.DWG_TYPE_3DFACE=28]="DWG_TYPE_3DFACE",t[t.DWG_TYPE_POLYLINE_PFACE=29]="DWG_TYPE_POLYLINE_PFACE",t[t.DWG_TYPE_POLYLINE_MESH=30]="DWG_TYPE_POLYLINE_MESH",t[t.DWG_TYPE_SOLID=31]="DWG_TYPE_SOLID",t[t.DWG_TYPE_TRACE=32]="DWG_TYPE_TRACE",t[t.DWG_TYPE_SHAPE=33]="DWG_TYPE_SHAPE",t[t.DWG_TYPE_VIEWPORT=34]="DWG_TYPE_VIEWPORT",t[t.DWG_TYPE_ELLIPSE=35]="DWG_TYPE_ELLIPSE",t[t.DWG_TYPE_SPLINE=36]="DWG_TYPE_SPLINE",t[t.DWG_TYPE_REGION=37]="DWG_TYPE_REGION",t[t.DWG_TYPE_3DSOLID=38]="DWG_TYPE_3DSOLID",t[t.DWG_TYPE_BODY=39]="DWG_TYPE_BODY",t[t.DWG_TYPE_RAY=40]="DWG_TYPE_RAY",t[t.DWG_TYPE_XLINE=41]="DWG_TYPE_XLINE",t[t.DWG_TYPE_DICTIONARY=42]="DWG_TYPE_DICTIONARY",t[t.DWG_TYPE_OLEFRAME=43]="DWG_TYPE_OLEFRAME",t[t.DWG_TYPE_MTEXT=44]="DWG_TYPE_MTEXT",t[t.DWG_TYPE_LEADER=45]="DWG_TYPE_LEADER",t[t.DWG_TYPE_TOLERANCE=46]="DWG_TYPE_TOLERANCE",t[t.DWG_TYPE_MLINE=47]="DWG_TYPE_MLINE",t[t.DWG_TYPE_BLOCK_CONTROL=48]="DWG_TYPE_BLOCK_CONTROL",t[t.DWG_TYPE_BLOCK_HEADER=49]="DWG_TYPE_BLOCK_HEADER",t[t.DWG_TYPE_LAYER_CONTROL=50]="DWG_TYPE_LAYER_CONTROL",t[t.DWG_TYPE_LAYER=51]="DWG_TYPE_LAYER",t[t.DWG_TYPE_STYLE_CONTROL=52]="DWG_TYPE_STYLE_CONTROL",t[t.DWG_TYPE_STYLE=53]="DWG_TYPE_STYLE",t[t.DWG_TYPE_LTYPE_CONTROL=56]="DWG_TYPE_LTYPE_CONTROL",t[t.DWG_TYPE_LTYPE=57]="DWG_TYPE_LTYPE",t[t.DWG_TYPE_VIEW_CONTROL=60]="DWG_TYPE_VIEW_CONTROL",t[t.DWG_TYPE_VIEW=61]="DWG_TYPE_VIEW",t[t.DWG_TYPE_UCS_CONTROL=62]="DWG_TYPE_UCS_CONTROL",t[t.DWG_TYPE_UCS=63]="DWG_TYPE_UCS",t[t.DWG_TYPE_VPORT_CONTROL=64]="DWG_TYPE_VPORT_CONTROL",t[t.DWG_TYPE_VPORT=65]="DWG_TYPE_VPORT",t[t.DWG_TYPE_APPID_CONTROL=66]="DWG_TYPE_APPID_CONTROL",t[t.DWG_TYPE_APPID=67]="DWG_TYPE_APPID",t[t.DWG_TYPE_DIMSTYLE_CONTROL=68]="DWG_TYPE_DIMSTYLE_CONTROL",t[t.DWG_TYPE_DIMSTYLE=69]="DWG_TYPE_DIMSTYLE",t[t.DWG_TYPE_VX_CONTROL=70]="DWG_TYPE_VX_CONTROL",t[t.DWG_TYPE_VX_TABLE_RECORD=71]="DWG_TYPE_VX_TABLE_RECORD",t[t.DWG_TYPE_GROUP=72]="DWG_TYPE_GROUP",t[t.DWG_TYPE_MLINESTYLE=73]="DWG_TYPE_MLINESTYLE",t[t.DWG_TYPE_OLE2FRAME=74]="DWG_TYPE_OLE2FRAME",t[t.DWG_TYPE_DUMMY=75]="DWG_TYPE_DUMMY",t[t.DWG_TYPE_LONG_TRANSACTION=76]="DWG_TYPE_LONG_TRANSACTION",t[t.DWG_TYPE_LWPOLYLINE=77]="DWG_TYPE_LWPOLYLINE",t[t.DWG_TYPE_HATCH=78]="DWG_TYPE_HATCH",t[t.DWG_TYPE_XRECORD=79]="DWG_TYPE_XRECORD",t[t.DWG_TYPE_PLACEHOLDER=80]="DWG_TYPE_PLACEHOLDER",t[t.DWG_TYPE_VBA_PROJECT=81]="DWG_TYPE_VBA_PROJECT",t[t.DWG_TYPE_LAYOUT=82]="DWG_TYPE_LAYOUT",t[t.DWG_TYPE_PROXY_ENTITY=498]="DWG_TYPE_PROXY_ENTITY",t[t.DWG_TYPE_PROXY_OBJECT=499]="DWG_TYPE_PROXY_OBJECT",t[t.DWG_TYPE_ACDSRECORD=500]="DWG_TYPE_ACDSRECORD",t[t.DWG_TYPE_ACDSSCHEMA=501]="DWG_TYPE_ACDSSCHEMA",t[t.DWG_TYPE_ACMECOMMANDHISTORY=502]="DWG_TYPE_ACMECOMMANDHISTORY",t[t.DWG_TYPE_ACMESCOPE=503]="DWG_TYPE_ACMESCOPE",t[t.DWG_TYPE_ACMESTATEMGR=504]="DWG_TYPE_ACMESTATEMGR",t[t.DWG_TYPE_ACSH_BOOLEAN_CLASS=505]="DWG_TYPE_ACSH_BOOLEAN_CLASS",t[t.DWG_TYPE_ACSH_BOX_CLASS=506]="DWG_TYPE_ACSH_BOX_CLASS",t[t.DWG_TYPE_ACSH_BREP_CLASS=507]="DWG_TYPE_ACSH_BREP_CLASS",t[t.DWG_TYPE_ACSH_CHAMFER_CLASS=508]="DWG_TYPE_ACSH_CHAMFER_CLASS",t[t.DWG_TYPE_ACSH_CONE_CLASS=509]="DWG_TYPE_ACSH_CONE_CLASS",t[t.DWG_TYPE_ACSH_CYLINDER_CLASS=510]="DWG_TYPE_ACSH_CYLINDER_CLASS",t[t.DWG_TYPE_ACSH_EXTRUSION_CLASS=511]="DWG_TYPE_ACSH_EXTRUSION_CLASS",t[t.DWG_TYPE_ACSH_FILLET_CLASS=512]="DWG_TYPE_ACSH_FILLET_CLASS",t[t.DWG_TYPE_ACSH_HISTORY_CLASS=513]="DWG_TYPE_ACSH_HISTORY_CLASS",t[t.DWG_TYPE_ACSH_LOFT_CLASS=514]="DWG_TYPE_ACSH_LOFT_CLASS",t[t.DWG_TYPE_ACSH_PYRAMID_CLASS=515]="DWG_TYPE_ACSH_PYRAMID_CLASS",t[t.DWG_TYPE_ACSH_REVOLVE_CLASS=516]="DWG_TYPE_ACSH_REVOLVE_CLASS",t[t.DWG_TYPE_ACSH_SPHERE_CLASS=517]="DWG_TYPE_ACSH_SPHERE_CLASS",t[t.DWG_TYPE_ACSH_SWEEP_CLASS=518]="DWG_TYPE_ACSH_SWEEP_CLASS",t[t.DWG_TYPE_ACSH_TORUS_CLASS=519]="DWG_TYPE_ACSH_TORUS_CLASS",t[t.DWG_TYPE_ACSH_WEDGE_CLASS=520]="DWG_TYPE_ACSH_WEDGE_CLASS",t[t.DWG_TYPE_ALDIMOBJECTCONTEXTDATA=521]="DWG_TYPE_ALDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_ALIGNMENTPARAMETERENTITY=522]="DWG_TYPE_ALIGNMENTPARAMETERENTITY",t[t.DWG_TYPE_ANGDIMOBJECTCONTEXTDATA=523]="DWG_TYPE_ANGDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA=524]="DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA",t[t.DWG_TYPE_ARCALIGNEDTEXT=525]="DWG_TYPE_ARCALIGNEDTEXT",t[t.DWG_TYPE_ARC_DIMENSION=526]="DWG_TYPE_ARC_DIMENSION",t[t.DWG_TYPE_ASSOC2DCONSTRAINTGROUP=527]="DWG_TYPE_ASSOC2DCONSTRAINTGROUP",t[t.DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY=528]="DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY",t[t.DWG_TYPE_ASSOCACTION=529]="DWG_TYPE_ASSOCACTION",t[t.DWG_TYPE_ASSOCACTIONPARAM=530]="DWG_TYPE_ASSOCACTIONPARAM",t[t.DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY=531]="DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYACTIONBODY=532]="DWG_TYPE_ASSOCARRAYACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY=533]="DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY",t[t.DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS=534]="DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYPATHPARAMETERS=535]="DWG_TYPE_ASSOCARRAYPATHPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYPOLARPARAMETERS=536]="DWG_TYPE_ASSOCARRAYPOLARPARAMETERS",t[t.DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS=537]="DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS",t[t.DWG_TYPE_ASSOCASMBODYACTIONPARAM=538]="DWG_TYPE_ASSOCASMBODYACTIONPARAM",t[t.DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY=539]="DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM=540]="DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM",t[t.DWG_TYPE_ASSOCDEPENDENCY=541]="DWG_TYPE_ASSOCDEPENDENCY",t[t.DWG_TYPE_ASSOCDIMDEPENDENCYBODY=542]="DWG_TYPE_ASSOCDIMDEPENDENCYBODY",t[t.DWG_TYPE_ASSOCEDGEACTIONPARAM=543]="DWG_TYPE_ASSOCEDGEACTIONPARAM",t[t.DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY=544]="DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY",t[t.DWG_TYPE_ASSOCEDGEFILLETACTIONBODY=545]="DWG_TYPE_ASSOCEDGEFILLETACTIONBODY",t[t.DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY=546]="DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY=547]="DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCFACEACTIONPARAM=548]="DWG_TYPE_ASSOCFACEACTIONPARAM",t[t.DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY=549]="DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCGEOMDEPENDENCY=550]="DWG_TYPE_ASSOCGEOMDEPENDENCY",t[t.DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY=551]="DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCMLEADERACTIONBODY=552]="DWG_TYPE_ASSOCMLEADERACTIONBODY",t[t.DWG_TYPE_ASSOCNETWORK=553]="DWG_TYPE_ASSOCNETWORK",t[t.DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY=554]="DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCOBJECTACTIONPARAM=555]="DWG_TYPE_ASSOCOBJECTACTIONPARAM",t[t.DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY=556]="DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCORDINATEDIMACTIONBODY=557]="DWG_TYPE_ASSOCORDINATEDIMACTIONBODY",t[t.DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM=558]="DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM",t[t.DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY=559]="DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCPATHACTIONPARAM=560]="DWG_TYPE_ASSOCPATHACTIONPARAM",t[t.DWG_TYPE_ASSOCPERSSUBENTMANAGER=561]="DWG_TYPE_ASSOCPERSSUBENTMANAGER",t[t.DWG_TYPE_ASSOCPLANESURFACEACTIONBODY=562]="DWG_TYPE_ASSOCPLANESURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCPOINTREFACTIONPARAM=563]="DWG_TYPE_ASSOCPOINTREFACTIONPARAM",t[t.DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY=564]="DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY",t[t.DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY=565]="DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCROTATEDDIMACTIONBODY=566]="DWG_TYPE_ASSOCROTATEDDIMACTIONBODY",t[t.DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY=567]="DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY=568]="DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY",t[t.DWG_TYPE_ASSOCVALUEDEPENDENCY=569]="DWG_TYPE_ASSOCVALUEDEPENDENCY",t[t.DWG_TYPE_ASSOCVARIABLE=570]="DWG_TYPE_ASSOCVARIABLE",t[t.DWG_TYPE_ASSOCVERTEXACTIONPARAM=571]="DWG_TYPE_ASSOCVERTEXACTIONPARAM",t[t.DWG_TYPE_BASEPOINTPARAMETERENTITY=572]="DWG_TYPE_BASEPOINTPARAMETERENTITY",t[t.DWG_TYPE_BLKREFOBJECTCONTEXTDATA=573]="DWG_TYPE_BLKREFOBJECTCONTEXTDATA",t[t.DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER=574]="DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKALIGNMENTGRIP=575]="DWG_TYPE_BLOCKALIGNMENTGRIP",t[t.DWG_TYPE_BLOCKALIGNMENTPARAMETER=576]="DWG_TYPE_BLOCKALIGNMENTPARAMETER",t[t.DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER=577]="DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKARRAYACTION=578]="DWG_TYPE_BLOCKARRAYACTION",t[t.DWG_TYPE_BLOCKBASEPOINTPARAMETER=579]="DWG_TYPE_BLOCKBASEPOINTPARAMETER",t[t.DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER=580]="DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKFLIPACTION=581]="DWG_TYPE_BLOCKFLIPACTION",t[t.DWG_TYPE_BLOCKFLIPGRIP=582]="DWG_TYPE_BLOCKFLIPGRIP",t[t.DWG_TYPE_BLOCKFLIPPARAMETER=583]="DWG_TYPE_BLOCKFLIPPARAMETER",t[t.DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT=584]="DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT",t[t.DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER=585]="DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER=586]="DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKLINEARGRIP=587]="DWG_TYPE_BLOCKLINEARGRIP",t[t.DWG_TYPE_BLOCKLINEARPARAMETER=588]="DWG_TYPE_BLOCKLINEARPARAMETER",t[t.DWG_TYPE_BLOCKLOOKUPACTION=589]="DWG_TYPE_BLOCKLOOKUPACTION",t[t.DWG_TYPE_BLOCKLOOKUPGRIP=590]="DWG_TYPE_BLOCKLOOKUPGRIP",t[t.DWG_TYPE_BLOCKLOOKUPPARAMETER=591]="DWG_TYPE_BLOCKLOOKUPPARAMETER",t[t.DWG_TYPE_BLOCKMOVEACTION=592]="DWG_TYPE_BLOCKMOVEACTION",t[t.DWG_TYPE_BLOCKPARAMDEPENDENCYBODY=593]="DWG_TYPE_BLOCKPARAMDEPENDENCYBODY",t[t.DWG_TYPE_BLOCKPOINTPARAMETER=594]="DWG_TYPE_BLOCKPOINTPARAMETER",t[t.DWG_TYPE_BLOCKPOLARGRIP=595]="DWG_TYPE_BLOCKPOLARGRIP",t[t.DWG_TYPE_BLOCKPOLARPARAMETER=596]="DWG_TYPE_BLOCKPOLARPARAMETER",t[t.DWG_TYPE_BLOCKPOLARSTRETCHACTION=597]="DWG_TYPE_BLOCKPOLARSTRETCHACTION",t[t.DWG_TYPE_BLOCKPROPERTIESTABLE=598]="DWG_TYPE_BLOCKPROPERTIESTABLE",t[t.DWG_TYPE_BLOCKPROPERTIESTABLEGRIP=599]="DWG_TYPE_BLOCKPROPERTIESTABLEGRIP",t[t.DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER=600]="DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKREPRESENTATION=601]="DWG_TYPE_BLOCKREPRESENTATION",t[t.DWG_TYPE_BLOCKROTATEACTION=602]="DWG_TYPE_BLOCKROTATEACTION",t[t.DWG_TYPE_BLOCKROTATIONGRIP=603]="DWG_TYPE_BLOCKROTATIONGRIP",t[t.DWG_TYPE_BLOCKROTATIONPARAMETER=604]="DWG_TYPE_BLOCKROTATIONPARAMETER",t[t.DWG_TYPE_BLOCKSCALEACTION=605]="DWG_TYPE_BLOCKSCALEACTION",t[t.DWG_TYPE_BLOCKSTRETCHACTION=606]="DWG_TYPE_BLOCKSTRETCHACTION",t[t.DWG_TYPE_BLOCKUSERPARAMETER=607]="DWG_TYPE_BLOCKUSERPARAMETER",t[t.DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER=608]="DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER",t[t.DWG_TYPE_BLOCKVISIBILITYGRIP=609]="DWG_TYPE_BLOCKVISIBILITYGRIP",t[t.DWG_TYPE_BLOCKVISIBILITYPARAMETER=610]="DWG_TYPE_BLOCKVISIBILITYPARAMETER",t[t.DWG_TYPE_BLOCKXYGRIP=611]="DWG_TYPE_BLOCKXYGRIP",t[t.DWG_TYPE_BLOCKXYPARAMETER=612]="DWG_TYPE_BLOCKXYPARAMETER",t[t.DWG_TYPE_CAMERA=613]="DWG_TYPE_CAMERA",t[t.DWG_TYPE_CELLSTYLEMAP=614]="DWG_TYPE_CELLSTYLEMAP",t[t.DWG_TYPE_CONTEXTDATAMANAGER=615]="DWG_TYPE_CONTEXTDATAMANAGER",t[t.DWG_TYPE_CSACDOCUMENTOPTIONS=616]="DWG_TYPE_CSACDOCUMENTOPTIONS",t[t.DWG_TYPE_CURVEPATH=617]="DWG_TYPE_CURVEPATH",t[t.DWG_TYPE_DATALINK=618]="DWG_TYPE_DATALINK",t[t.DWG_TYPE_DATATABLE=619]="DWG_TYPE_DATATABLE",t[t.DWG_TYPE_DBCOLOR=620]="DWG_TYPE_DBCOLOR",t[t.DWG_TYPE_DETAILVIEWSTYLE=621]="DWG_TYPE_DETAILVIEWSTYLE",t[t.DWG_TYPE_DGNDEFINITION=622]="DWG_TYPE_DGNDEFINITION",t[t.DWG_TYPE_DGNUNDERLAY=623]="DWG_TYPE_DGNUNDERLAY",t[t.DWG_TYPE_DICTIONARYVAR=624]="DWG_TYPE_DICTIONARYVAR",t[t.DWG_TYPE_DICTIONARYWDFLT=625]="DWG_TYPE_DICTIONARYWDFLT",t[t.DWG_TYPE_DIMASSOC=626]="DWG_TYPE_DIMASSOC",t[t.DWG_TYPE_DMDIMOBJECTCONTEXTDATA=627]="DWG_TYPE_DMDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_DWFDEFINITION=628]="DWG_TYPE_DWFDEFINITION",t[t.DWG_TYPE_DWFUNDERLAY=629]="DWG_TYPE_DWFUNDERLAY",t[t.DWG_TYPE_DYNAMICBLOCKPROXYNODE=630]="DWG_TYPE_DYNAMICBLOCKPROXYNODE",t[t.DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER=631]="DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER",t[t.DWG_TYPE_EVALUATION_GRAPH=632]="DWG_TYPE_EVALUATION_GRAPH",t[t.DWG_TYPE_EXTRUDEDSURFACE=633]="DWG_TYPE_EXTRUDEDSURFACE",t[t.DWG_TYPE_FCFOBJECTCONTEXTDATA=634]="DWG_TYPE_FCFOBJECTCONTEXTDATA",t[t.DWG_TYPE_FIELD=635]="DWG_TYPE_FIELD",t[t.DWG_TYPE_FIELDLIST=636]="DWG_TYPE_FIELDLIST",t[t.DWG_TYPE_FLIPPARAMETERENTITY=637]="DWG_TYPE_FLIPPARAMETERENTITY",t[t.DWG_TYPE_FLIPACTIONENTITY=638]="DWG_TYPE_FLIPACTIONENTITY",t[t.DWG_TYPE_GEODATA=639]="DWG_TYPE_GEODATA",t[t.DWG_TYPE_GEOMAPIMAGE=640]="DWG_TYPE_GEOMAPIMAGE",t[t.DWG_TYPE_GEOPOSITIONMARKER=641]="DWG_TYPE_GEOPOSITIONMARKER",t[t.DWG_TYPE_GRADIENT_BACKGROUND=642]="DWG_TYPE_GRADIENT_BACKGROUND",t[t.DWG_TYPE_GROUND_PLANE_BACKGROUND=643]="DWG_TYPE_GROUND_PLANE_BACKGROUND",t[t.DWG_TYPE_HELIX=644]="DWG_TYPE_HELIX",t[t.DWG_TYPE_IBL_BACKGROUND=645]="DWG_TYPE_IBL_BACKGROUND",t[t.DWG_TYPE_IDBUFFER=646]="DWG_TYPE_IDBUFFER",t[t.DWG_TYPE_IMAGE=647]="DWG_TYPE_IMAGE",t[t.DWG_TYPE_IMAGEDEF=648]="DWG_TYPE_IMAGEDEF",t[t.DWG_TYPE_IMAGEDEF_REACTOR=649]="DWG_TYPE_IMAGEDEF_REACTOR",t[t.DWG_TYPE_IMAGE_BACKGROUND=650]="DWG_TYPE_IMAGE_BACKGROUND",t[t.DWG_TYPE_INDEX=651]="DWG_TYPE_INDEX",t[t.DWG_TYPE_LARGE_RADIAL_DIMENSION=652]="DWG_TYPE_LARGE_RADIAL_DIMENSION",t[t.DWG_TYPE_LAYERFILTER=653]="DWG_TYPE_LAYERFILTER",t[t.DWG_TYPE_LAYER_INDEX=654]="DWG_TYPE_LAYER_INDEX",t[t.DWG_TYPE_LAYOUTPRINTCONFIG=655]="DWG_TYPE_LAYOUTPRINTCONFIG",t[t.DWG_TYPE_LEADEROBJECTCONTEXTDATA=656]="DWG_TYPE_LEADEROBJECTCONTEXTDATA",t[t.DWG_TYPE_LIGHT=657]="DWG_TYPE_LIGHT",t[t.DWG_TYPE_LIGHTLIST=658]="DWG_TYPE_LIGHTLIST",t[t.DWG_TYPE_LINEARPARAMETERENTITY=659]="DWG_TYPE_LINEARPARAMETERENTITY",t[t.DWG_TYPE_LOFTEDSURFACE=660]="DWG_TYPE_LOFTEDSURFACE",t[t.DWG_TYPE_MATERIAL=661]="DWG_TYPE_MATERIAL",t[t.DWG_TYPE_MENTALRAYRENDERSETTINGS=662]="DWG_TYPE_MENTALRAYRENDERSETTINGS",t[t.DWG_TYPE_MESH=663]="DWG_TYPE_MESH",t[t.DWG_TYPE_MLEADEROBJECTCONTEXTDATA=664]="DWG_TYPE_MLEADEROBJECTCONTEXTDATA",t[t.DWG_TYPE_MLEADERSTYLE=665]="DWG_TYPE_MLEADERSTYLE",t[t.DWG_TYPE_MOVEACTIONENTITY=666]="DWG_TYPE_MOVEACTIONENTITY",t[t.DWG_TYPE_MOTIONPATH=667]="DWG_TYPE_MOTIONPATH",t[t.DWG_TYPE_MPOLYGON=668]="DWG_TYPE_MPOLYGON",t[t.DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA=669]="DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA",t[t.DWG_TYPE_MTEXTOBJECTCONTEXTDATA=670]="DWG_TYPE_MTEXTOBJECTCONTEXTDATA",t[t.DWG_TYPE_MULTILEADER=671]="DWG_TYPE_MULTILEADER",t[t.DWG_TYPE_NAVISWORKSMODEL=672]="DWG_TYPE_NAVISWORKSMODEL",t[t.DWG_TYPE_NAVISWORKSMODELDEF=673]="DWG_TYPE_NAVISWORKSMODELDEF",t[t.DWG_TYPE_NPOCOLLECTION=674]="DWG_TYPE_NPOCOLLECTION",t[t.DWG_TYPE_NURBSURFACE=675]="DWG_TYPE_NURBSURFACE",t[t.DWG_TYPE_OBJECT_PTR=676]="DWG_TYPE_OBJECT_PTR",t[t.DWG_TYPE_ORDDIMOBJECTCONTEXTDATA=677]="DWG_TYPE_ORDDIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_PARTIAL_VIEWING_INDEX=678]="DWG_TYPE_PARTIAL_VIEWING_INDEX",t[t.DWG_TYPE_PDFDEFINITION=679]="DWG_TYPE_PDFDEFINITION",t[t.DWG_TYPE_PDFUNDERLAY=680]="DWG_TYPE_PDFUNDERLAY",t[t.DWG_TYPE_PERSUBENTMGR=681]="DWG_TYPE_PERSUBENTMGR",t[t.DWG_TYPE_PLANESURFACE=682]="DWG_TYPE_PLANESURFACE",t[t.DWG_TYPE_PLOTSETTINGS=683]="DWG_TYPE_PLOTSETTINGS",t[t.DWG_TYPE_POINTCLOUD=684]="DWG_TYPE_POINTCLOUD",t[t.DWG_TYPE_POINTCLOUDCOLORMAP=685]="DWG_TYPE_POINTCLOUDCOLORMAP",t[t.DWG_TYPE_POINTCLOUDDEF=686]="DWG_TYPE_POINTCLOUDDEF",t[t.DWG_TYPE_POINTCLOUDDEFEX=687]="DWG_TYPE_POINTCLOUDDEFEX",t[t.DWG_TYPE_POINTCLOUDDEF_REACTOR=688]="DWG_TYPE_POINTCLOUDDEF_REACTOR",t[t.DWG_TYPE_POINTCLOUDDEF_REACTOR_EX=689]="DWG_TYPE_POINTCLOUDDEF_REACTOR_EX",t[t.DWG_TYPE_POINTCLOUDEX=690]="DWG_TYPE_POINTCLOUDEX",t[t.DWG_TYPE_POINTPARAMETERENTITY=691]="DWG_TYPE_POINTPARAMETERENTITY",t[t.DWG_TYPE_POINTPATH=692]="DWG_TYPE_POINTPATH",t[t.DWG_TYPE_POLARGRIPENTITY=693]="DWG_TYPE_POLARGRIPENTITY",t[t.DWG_TYPE_RADIMLGOBJECTCONTEXTDATA=694]="DWG_TYPE_RADIMLGOBJECTCONTEXTDATA",t[t.DWG_TYPE_RADIMOBJECTCONTEXTDATA=695]="DWG_TYPE_RADIMOBJECTCONTEXTDATA",t[t.DWG_TYPE_RAPIDRTRENDERSETTINGS=696]="DWG_TYPE_RAPIDRTRENDERSETTINGS",t[t.DWG_TYPE_RASTERVARIABLES=697]="DWG_TYPE_RASTERVARIABLES",t[t.DWG_TYPE_RENDERENTRY=698]="DWG_TYPE_RENDERENTRY",t[t.DWG_TYPE_RENDERENVIRONMENT=699]="DWG_TYPE_RENDERENVIRONMENT",t[t.DWG_TYPE_RENDERGLOBAL=700]="DWG_TYPE_RENDERGLOBAL",t[t.DWG_TYPE_RENDERSETTINGS=701]="DWG_TYPE_RENDERSETTINGS",t[t.DWG_TYPE_REVOLVEDSURFACE=702]="DWG_TYPE_REVOLVEDSURFACE",t[t.DWG_TYPE_ROTATIONPARAMETERENTITY=703]="DWG_TYPE_ROTATIONPARAMETERENTITY",t[t.DWG_TYPE_ROTATEACTIONENTITY=704]="DWG_TYPE_ROTATEACTIONENTITY",t[t.DWG_TYPE_RTEXT=705]="DWG_TYPE_RTEXT",t[t.DWG_TYPE_SCALE=706]="DWG_TYPE_SCALE",t[t.DWG_TYPE_SCALEACTIONENTITY=707]="DWG_TYPE_SCALEACTIONENTITY",t[t.DWG_TYPE_SECTIONOBJECT=708]="DWG_TYPE_SECTIONOBJECT",t[t.DWG_TYPE_SECTIONVIEWSTYLE=709]="DWG_TYPE_SECTIONVIEWSTYLE",t[t.DWG_TYPE_SECTION_MANAGER=710]="DWG_TYPE_SECTION_MANAGER",t[t.DWG_TYPE_SECTION_SETTINGS=711]="DWG_TYPE_SECTION_SETTINGS",t[t.DWG_TYPE_SKYLIGHT_BACKGROUND=712]="DWG_TYPE_SKYLIGHT_BACKGROUND",t[t.DWG_TYPE_SOLID_BACKGROUND=713]="DWG_TYPE_SOLID_BACKGROUND",t[t.DWG_TYPE_SORTENTSTABLE=714]="DWG_TYPE_SORTENTSTABLE",t[t.DWG_TYPE_SPATIAL_FILTER=715]="DWG_TYPE_SPATIAL_FILTER",t[t.DWG_TYPE_SPATIAL_INDEX=716]="DWG_TYPE_SPATIAL_INDEX",t[t.DWG_TYPE_STRETCHACTIONENTITY=717]="DWG_TYPE_STRETCHACTIONENTITY",t[t.DWG_TYPE_SUN=718]="DWG_TYPE_SUN",t[t.DWG_TYPE_SUNSTUDY=719]="DWG_TYPE_SUNSTUDY",t[t.DWG_TYPE_SWEPTSURFACE=720]="DWG_TYPE_SWEPTSURFACE",t[t.DWG_TYPE_TABLE=721]="DWG_TYPE_TABLE",t[t.DWG_TYPE_TABLECONTENT=722]="DWG_TYPE_TABLECONTENT",t[t.DWG_TYPE_TABLEGEOMETRY=723]="DWG_TYPE_TABLEGEOMETRY",t[t.DWG_TYPE_TABLESTYLE=724]="DWG_TYPE_TABLESTYLE",t[t.DWG_TYPE_TEXTOBJECTCONTEXTDATA=725]="DWG_TYPE_TEXTOBJECTCONTEXTDATA",t[t.DWG_TYPE_TVDEVICEPROPERTIES=726]="DWG_TYPE_TVDEVICEPROPERTIES",t[t.DWG_TYPE_VISIBILITYGRIPENTITY=727]="DWG_TYPE_VISIBILITYGRIPENTITY",t[t.DWG_TYPE_VISIBILITYPARAMETERENTITY=728]="DWG_TYPE_VISIBILITYPARAMETERENTITY",t[t.DWG_TYPE_VISUALSTYLE=729]="DWG_TYPE_VISUALSTYLE",t[t.DWG_TYPE_WIPEOUT=730]="DWG_TYPE_WIPEOUT",t[t.DWG_TYPE_WIPEOUTVARIABLES=731]="DWG_TYPE_WIPEOUTVARIABLES",t[t.DWG_TYPE_XREFPANELOBJECT=732]="DWG_TYPE_XREFPANELOBJECT",t[t.DWG_TYPE_XYPARAMETERENTITY=733]="DWG_TYPE_XYPARAMETERENTITY",t[t.DWG_TYPE_BREAKDATA=734]="DWG_TYPE_BREAKDATA",t[t.DWG_TYPE_BREAKPOINTREF=735]="DWG_TYPE_BREAKPOINTREF",t[t.DWG_TYPE_FLIPGRIPENTITY=736]="DWG_TYPE_FLIPGRIPENTITY",t[t.DWG_TYPE_LINEARGRIPENTITY=737]="DWG_TYPE_LINEARGRIPENTITY",t[t.DWG_TYPE_ROTATIONGRIPENTITY=738]="DWG_TYPE_ROTATIONGRIPENTITY",t[t.DWG_TYPE_XYGRIPENTITY=739]="DWG_TYPE_XYGRIPENTITY",t[t.DWG_TYPE__3DLINE=740]="DWG_TYPE__3DLINE",t[t.DWG_TYPE_REPEAT=741]="DWG_TYPE_REPEAT",t[t.DWG_TYPE_ENDREP=742]="DWG_TYPE_ENDREP",t[t.DWG_TYPE_JUMP=743]="DWG_TYPE_JUMP",t[t.DWG_TYPE_LOAD=744]="DWG_TYPE_LOAD",t[t.DWG_TYPE_FREED=65533]="DWG_TYPE_FREED",t[t.DWG_TYPE_UNKNOWN_ENT=65534]="DWG_TYPE_UNKNOWN_ENT",t[t.DWG_TYPE_UNKNOWN_OBJ=65535]="DWG_TYPE_UNKNOWN_OBJ"})(T||(T={}));const $o=Object.fromEntries(Object.entries(T).map(([t,n])=>[n,t]));var rn;(function(t){t[t.DWG=0]="DWG",t[t.DXF=1]="DXF"})(rn||(rn={}));var ct;(function(t){t[t.Line=1]="Line",t[t.CircularArc=2]="CircularArc",t[t.EllipticArc=3]="EllipticArc",t[t.Spline=4]="Spline"})(ct||(ct={}));var Z;(function(t){t[t.ByLayer=192]="ByLayer",t[t.ByBlock=193]="ByBlock",t[t.Entities=194]="Entities",t[t.TrueColor=195]="TrueColor",t[t.ForegroundColor=197]="ForegroundColor",t[t.None=200]="None"})(Z||(Z={}));const ge=192,pe=193,Jo=194,Gn=195,Ce=200;function we(t){if(t==null)return;const n=t.method,o=t.method!=null&&n!==0?n:t.rgb>>>24&255,e=t.index;if(t.rgb!=null&&o>=ge&&o<=Ce&&(t.rgb>>>24&255)===o)return t.rgb>>0;if(o===Z.ByLayer||e===256)return ge<<24>>0;if(o===Z.ByBlock||e===0)return pe<<24>>0;if(o===Z.None)return Ce<<24>>0;if(o===Z.TrueColor){const a=t.rgb!=null?t.rgb&16777215:void 0;if(a!=null)return(Jo<<24|a)>>0}return o===Z.ForegroundColor?(Gn<<24|7)>>0:o===Z.Entities&&e>0&&e<256||e>0&&e<256?(Gn<<24|e&255)>>0:pe<<24>>0}const Zo="*MODEL_SPACE",qo="*PAPER_SPACE",Oe=t=>t&&t.toUpperCase()==Zo,Qo=t=>t&&t.toUpperCase().startsWith(qo),w=t=>t.toString(16).toUpperCase(),Lt=t=>{const n=new Array(t.length);for(let o=0;o<t.length;o++)n[o]=t[o].toString(16).toUpperCase().padStart(2,"0");return n.join("")},jo=t=>{if(!t||t.length<98)return null;const n=new DataView(t.buffer,t.byteOffset,t.byteLength),o=i=>({x:n.getFloat64(i,!0),y:n.getFloat64(i+8,!0),z:n.getFloat64(i+16,!0)}),e=o(2),a=o(50);return[e.x,e.y,e.z,a.x,a.y,a.z].every(Number.isFinite)?{upperLeft:e,lowerRight:a}:null};class ta{constructor(n){M(this,"libredwg");M(this,"layers",new Map);M(this,"ltypes",new Map);M(this,"classes",[]);M(this,"unknownEntityCount");this.libredwg=n,this.unknownEntityCount=0}prepare(n,o=!1){(o||this.layers.size==0)&&(this.layers.clear(),n.tables.LAYER.entries.forEach(e=>{this.layers.set(e.handle,e.name)})),(o||this.ltypes.size==0)&&(this.ltypes.clear(),n.tables.LTYPE.entries.forEach(e=>{this.ltypes.set(e.handle,e.name)})),this.classes=n.classes,this.unknownEntityCount=0}setClasses(n){this.classes=n}clear(){this.layers.clear(),this.ltypes.clear(),this.classes=[],this.unknownEntityCount=0}convert(n){const o=this.libredwg,e=o.dwg_object_to_entity(n),a=o.dwg_object_to_entity_tio(n);if(e&&a){const i=this.getCommonAttrs(e),r=o.dwg_object_get_fixedtype(n);if(r==T.DWG_TYPE_3DFACE)return this.convert3dFace(a,i);if(r==T.DWG_TYPE_3DSOLID)return this.convert3dSolid(a,i);if(r==T.DWG_TYPE_ARC)return this.convertArc(a,i);if(r==T.DWG_TYPE_ATTDEF)return this.convertAttdef(a,i);if(r==T.DWG_TYPE_CIRCLE)return this.convertCircle(a,i);if(r==T.DWG_TYPE_DIMENSION_ALIGNED||r==T.DWG_TYPE_DIMENSION_LINEAR)return this.convertAlignedDimension(a,i);if(r==T.DWG_TYPE_DIMENSION_ANG3PT)return this.convert3PointAngularDimension(a,i);if(r==T.DWG_TYPE_DIMENSION_ANG2LN)return this.convert2LineAngularDimension(a,i);if(r==T.DWG_TYPE_DIMENSION_DIAMETER)return this.convertDiameterDimension(a,i);if(r==T.DWG_TYPE_DIMENSION_ORDINATE)return this.convertOrdinateDimension(a,i);if(r==T.DWG_TYPE_DIMENSION_RADIUS)return this.convertRadiusDimension(a,i);if(r==T.DWG_TYPE_ELLIPSE)return this.convertEllise(a,i);if(r==T.DWG_TYPE_HATCH)return this.convertHatch(a,i);if(r==T.DWG_TYPE_IMAGE)return this.convertImage(a,i);if(r==T.DWG_TYPE_INSERT)return this.convertInsert(a,i);if(r==T.DWG_TYPE_LEADER)return this.convertLeader(a,i);if(r==T.DWG_TYPE_LINE)return this.convertLine(a,i);if(r==T.DWG_TYPE_LWPOLYLINE)return this.convertLWPolyline(a,i);if(r==T.DWG_TYPE_MLINE)return this.convertMLine(a,i);if(r==T.DWG_TYPE_MULTILEADER)return this.convertMultiLeader(a,i);if(r==T.DWG_TYPE_MTEXT)return this.convertMText(a,i);if(r==T.DWG_TYPE_OLE2FRAME)return this.convertOle2Frame(a,i);if(r==T.DWG_TYPE_OLEFRAME)return this.convertOleFrame(a,i);if(r==T.DWG_TYPE_POINT)return this.convertPoint(a,i);if(r==T.DWG_TYPE_POLYLINE_2D)return this.convertPolyline2d(a,i,n);if(r==T.DWG_TYPE_POLYLINE_3D)return this.convertPolyline3d(a,i,n);if(r==T.DWG_TYPE_PROXY_ENTITY)return this.convertProxyEntity(a,i,n);if(r==T.DWG_TYPE_RAY)return this.convertRay(a,i);if(r==T.DWG_TYPE_SECTIONOBJECT)return this.convertSection(a,i);if(r==T.DWG_TYPE_SHAPE)return this.convertShape(a,i);if(r==T.DWG_TYPE_SOLID)return this.convertSolid(a,i);if(r==T.DWG_TYPE_SPLINE)return this.convertSpline(a,i);if(r==T.DWG_TYPE_TABLE)return this.convertTable(a,i);if(r==T.DWG_TYPE_TEXT)return this.convertText(a,i);if(r==T.DWG_TYPE_TOLERANCE)return this.convertTolerance(a,i);if(r==T.DWG_TYPE_VIEWPORT)return this.convertViewport(a,i);if(r==T.DWG_TYPE_WIPEOUT)return this.convertWipeout(a,i);if(r==T.DWG_TYPE_XLINE)return this.convertXline(a,i);r===T.DWG_TYPE_UNKNOWN_ENT&&this.unknownEntityCount++}}convert3dFace(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"corner1"),i=e.dwg_dynapi_entity_data(n,"corner2"),r=e.dwg_dynapi_entity_data(n,"corner3"),s=e.dwg_dynapi_entity_data(n,"corner4"),_=e.dwg_dynapi_entity_data(n,"invis_flags");return{type:"3DFACE",...o,corner1:a,corner2:i,corner3:r,corner4:s,flag:_}}convert3dSolid(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"version"),i=e.dwg_dynapi_entity_data(n,"acis_empty"),r=e.dwg_dynapi_entity_data(n,"acis_data"),s=e.dwg_dynapi_entity_data(n,"has_revision_guid"),_=e.dwg_dynapi_entity_data(n,"history_id"),d=e.dwg_ref_get_id(_),c={type:"3DSOLID",subclassMarker:"AcDb3dSolid",...o};if(a&&(c.version=a),c.satCache=i,r&&(c.data=r),s){const E=e.dwg_dynapi_entity_field_offset(n,"revision_guid");if(E>=0){const u=e.UTF8ToString(n+E,38);u&&(c.guid=u)}}return d&&(c.historyObjectSoftId=d),c}convertArc(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"center"),i=e.dwg_dynapi_entity_data(n,"radius"),r=e.dwg_dynapi_entity_data(n,"thickness"),s=e.dwg_dynapi_entity_data(n,"extrusion"),_=e.dwg_dynapi_entity_data(n,"start_angle"),d=e.dwg_dynapi_entity_data(n,"end_angle");return{type:"ARC",...o,thickness:r,center:a,radius:i,startAngle:_,endAngle:d,extrusionDirection:s}}convertEmbeddedMText(n,o){const e=this.libredwg,a=e.dwg_dynapi_subclass_data(n,o,"attachment"),i=e.dwg_dynapi_subclass_data(n,o,"ins_pt"),r=e.dwg_dynapi_subclass_data(n,o,"x_axis_dir"),s=e.dwg_dynapi_subclass_data(n,o,"rect_height"),_=e.dwg_dynapi_subclass_data(n,o,"rect_width"),d=e.dwg_dynapi_subclass_data(n,o,"extents_height"),c=e.dwg_dynapi_subclass_data(n,o,"extents_width");return{insertionPoint:i,rectHeight:s,rectWidth:_,extentsHeight:d,extentsWidth:c,attachmentPoint:a,direction:r}}convertAttdef(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"default_value"),i=this.convertTextBase(n);i.text=a;const r=e.dwg_dynapi_entity_data(n,"prompt"),s=e.dwg_dynapi_entity_data(n,"tag"),_=e.dwg_dynapi_entity_data(n,"flags"),d=e.dwg_dynapi_entity_data(n,"field_length"),c=e.dwg_dynapi_entity_data(n,"lock_position_flag"),E=e.dwg_dynapi_entity_data(n,"keep_duplicate_records"),u=e.dwg_dynapi_entity_data(n,"is_really_locked"),l=e.dwg_dynapi_entity_data(n,"mtext_type"),I=e.dwg_dynapi_entity_data(n,"alignment_pt");return{type:"ATTDEF",...o,text:this.convertTextBase(n),prompt:r,tag:s,flags:_,fieldLength:d,lockPositionFlag:c>0,duplicateRecordCloningFlag:E>0,mtextFlag:l,isReallyLocked:u>0,alignmentPoint:I,annotationScale:1,attrTag:"",mtext:this.convertEmbeddedMText(n,"ATTDEF_mtext")}}convertAttrib(n,o){const e=this.libredwg,a=this.convertTextBase(n),i=e.dwg_dynapi_entity_data(n,"tag"),r=e.dwg_dynapi_entity_data(n,"flags"),s=e.dwg_dynapi_entity_data(n,"field_length"),_=e.dwg_dynapi_entity_data(n,"lock_position_flag"),d=e.dwg_dynapi_entity_data(n,"keep_duplicate_records"),c=e.dwg_dynapi_entity_data(n,"mtext_type"),E=e.dwg_dynapi_entity_data(n,"is_really_locked"),u=e.dwg_dynapi_entity_data(n,"alignment_pt");return{type:"ATTRIB",...o,text:a,tag:i,flags:r,fieldLength:s,lockPositionFlag:!!_,duplicateRecordCloningFlag:!!d,mtextFlag:c,isReallyLocked:!!E,numberOfSecondaryAttrs:0,secondaryAttrsHardId:"0",alignmentPoint:{...u,z:0},annotationScale:1,attrTag:"",mtext:this.convertEmbeddedMText(n,"ATTDEF_mtext")}}convertCircle(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"center"),i=e.dwg_dynapi_entity_data(n,"radius"),r=e.dwg_dynapi_entity_data(n,"thickness"),s=e.dwg_dynapi_entity_data(n,"extrusion");return{type:"CIRCLE",...o,thickness:r,center:a,radius:i,extrusionDirection:s}}convertAlignedDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"clone_ins_pt"),r=e.dwg_dynapi_entity_data(n,"xline1_pt"),s=e.dwg_dynapi_entity_data(n,"xline2_pt"),_=e.dwg_dynapi_entity_data(n,"ins_rotation"),d=e.dwg_dynapi_entity_data(n,"oblique_angle");return{subclassMarker:"AcDbAlignedDimension",...o,...a,insertionPoint:i,subDefinitionPoint1:r,subDefinitionPoint2:s,rotationAngle:_??0,obliqueAngle:d}}convert3PointAngularDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"xline1_pt"),r=e.dwg_dynapi_entity_data(n,"xline2_pt"),s=e.dwg_dynapi_entity_data(n,"center_pt"),_=e.dwg_dynapi_entity_data(n,"xline2end_pt");return{subclassMarker:"AcDb3PointAngularDimension",...o,...a,subDefinitionPoint1:i,subDefinitionPoint2:r,centerPoint:s,arcPoint:_}}convert2LineAngularDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"xline1start_pt"),r=e.dwg_dynapi_entity_data(n,"xline1end_pt"),s=e.dwg_dynapi_entity_data(n,"xline2start_pt"),_=e.dwg_dynapi_entity_data(n,"xline2end_pt"),d=e.dwg_dynapi_entity_data(n,"def_pt");return _&&(a.definitionPoint=_),{subclassMarker:"AcDb2LineAngularDimension",...o,...a,subDefinitionPoint1:i??r??d??_,subDefinitionPoint2:s??_??d??r,centerPoint:d??s??r??_,arcPoint:_??a.definitionPoint}}convertDiameterDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"first_arc_pt"),r=e.dwg_dynapi_entity_data(n,"leader_len");return{subclassMarker:"AcDbDiametricDimension",...o,...a,centerPoint:i,leaderLength:r}}convertOrdinateDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"feature_location_pt"),r=e.dwg_dynapi_entity_data(n,"leader_endpt");return{subclassMarker:"AcDbOrdinateDimension",...o,...a,subDefinitionPoint1:i,subDefinitionPoint2:r}}convertRadiusDimension(n,o){const e=this.libredwg,a=this.getDimensionCommonAttrs(n),i=e.dwg_dynapi_entity_data(n,"first_arc_pt"),r=e.dwg_dynapi_entity_data(n,"leader_len");return{subclassMarker:"AcDbRadialDimension",...o,...a,centerPoint:i,leaderLength:r}}convertEllise(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"center"),i=e.dwg_dynapi_entity_data(n,"sm_axis"),r=e.dwg_dynapi_entity_data(n,"extrusion"),s=e.dwg_dynapi_entity_data(n,"axis_ratio"),_=e.dwg_dynapi_entity_data(n,"start_angle"),d=e.dwg_dynapi_entity_data(n,"end_angle");return{type:"ELLIPSE",...o,center:a,majorAxisEndPoint:i,extrusionDirection:r,axisRatio:s,startAngle:_,endAngle:d}}convertHatch(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"extrusion"),i=e.dwg_dynapi_entity_data(n,"name"),r=e.dwg_dynapi_entity_data(n,"is_solid_fill"),s=e.dwg_dynapi_entity_data(n,"is_associative"),_=e.dwg_dynapi_entity_data(n,"num_paths"),d=e.dwg_dynapi_entity_data(n,"paths"),c=e.dwg_ptr_to_hatch_path_array(d,_),E=e.dwg_dynapi_entity_data(n,"style"),u=e.dwg_dynapi_entity_data(n,"pattern_type"),l=e.dwg_dynapi_entity_data(n,"angle"),I=e.dwg_dynapi_entity_data(n,"scale_spacing"),f=e.dwg_dynapi_entity_data(n,"num_deflines"),A=e.dwg_dynapi_entity_data(n,"deflines"),h=e.dwg_ptr_to_hatch_defline_array(A,f),g=e.dwg_dynapi_entity_data(n,"pixel_size"),p=e.dwg_dynapi_entity_data(n,"num_seeds"),C=e.dwg_dynapi_entity_data(n,"seeds"),L=e.dwg_ptr_to_point2d_array(C,p),R={...o,extrusionDirection:a,patternName:i,solidFill:r?mt.SolidFill:mt.PatternFill,associativity:s?St.Associative:St.NonAssociative,numberOfBoundaryPaths:_,boundaryPaths:this.convertHatchBoundaryPaths(c),hatchStyle:E,patternType:u,patternAngle:l,patternScale:I,numberOfDefinitionLines:f,definitionLines:h.map(Y=>({angle:Y.angle,base:Y.pt0,offset:Y.offset,numberOfDashLengths:Y.dashes.length,dashLengths:Y.dashes})),pixelSize:g,numberOfSeedPoints:p,seedPoints:L};if(e.dwg_dynapi_entity_data(n,"is_gradient_fill")>0){const Y=e.dwg_dynapi_entity_data(n,"gradient_name"),U=e.dwg_dynapi_entity_data(n,"gradient_angle"),H=e.dwg_dynapi_entity_data(n,"gradient_shift"),v=e.dwg_dynapi_entity_data(n,"gradient_tint"),B=e.dwg_dynapi_entity_data(n,"single_color_gradient"),V=e.dwg_dynapi_entity_data(n,"colors"),K=e.dwg_ptr_to_hatch_gradient_color_array(V,B==1?1:2);return{type:"HATCH",...R,gradientFlag:en.Gradient,gradientColorFlag:B==1?Nt.OneColor:Nt.TwoColor,gradientName:Y,gradientRotation:U,gradientDefinition:H,colorTint:v,gradientColors:K}}else return{type:"HATCH",...R}}convertHatchBoundaryPaths(n){return n.filter(e=>e.num_segs_or_paths>0).map(e=>{const a={boundaryPathTypeFlag:e.flag};if(e.flag&2)return{...a,hasBulge:e.bulges_present,isClosed:e.closed,numberOfVertices:e.num_segs_or_paths,vertices:e.polyline_paths.map(i=>({x:i.point.x,y:i.point.y,bulge:i.bulge}))};{const i=e.segs.map(r=>{if(r.curve_type==ct.Line)return{type:dt.Line,start:r.first_endpoint,end:r.second_endpoint};if(r.curve_type==ct.CircularArc)return{type:dt.Circular,center:r.center,radius:r.radius,startAngle:r.start_angle,endAngle:r.end_angle,isCCW:r.is_ccw};if(r.curve_type==ct.EllipticArc)return{type:dt.Elliptic,center:r.center,end:r.endpoint,lengthOfMinorAxis:r.minor_major_ratio,startAngle:r.start_angle,endAngle:r.end_angle,isCCW:r.is_ccw};if(r.curve_type==ct.Spline)return{type:dt.Spline,degree:r.degree,isRational:r.is_rational,isPeriodic:r.is_periodic,numberOfKnots:r.num_knots,numberOfControlPoints:r.num_control_points,knots:r.knots,controlPoints:r.control_points,numberOfFitData:r.num_fitpts,fitDatum:r.fitpts,startTangent:r.start_tangent,endTangent:r.end_tangent}});return{...a,numberOfEdges:e.num_segs_or_paths,edges:i}}})}convertImage(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"class_version"),i=e.dwg_dynapi_entity_data(n,"pt0"),r=e.dwg_dynapi_entity_data(n,"uvec"),s=e.dwg_dynapi_entity_data(n,"vvec"),_=e.dwg_dynapi_entity_data(n,"image_size"),d=e.dwg_dynapi_entity_data(n,"display_props"),c=e.dwg_dynapi_entity_data(n,"clipping"),E=e.dwg_dynapi_entity_data(n,"brightness"),u=e.dwg_dynapi_entity_data(n,"contrast"),l=e.dwg_dynapi_entity_data(n,"fade"),I=e.dwg_dynapi_entity_data(n,"clip_mode"),f=e.dwg_dynapi_entity_data(n,"clip_boundary_type"),A=e.dwg_dynapi_entity_data(n,"num_clip_verts"),h=e.dwg_dynapi_entity_data(n,"clip_verts"),g=e.dwg_ptr_to_point3d_array(h,A),p=e.dwg_dynapi_entity_data(n,"imagedef"),C=e.dwg_ref_get_id(p)??"",L=e.dwg_dynapi_entity_data(n,"imagedefreactor"),R=e.dwg_ref_get_id(L)??"";return{type:"IMAGE",...o,version:a,position:i,uPixel:r,vPixel:s,imageSize:_,imageDefHandle:C,flags:d,clipping:c,brightness:E,contrast:u,fade:l,imageDefReactorHandle:R,clippingBoundaryType:f,countBoundaryPoints:A,clippingBoundaryPath:g,clipMode:I}}convertInsert(n,o){const e=this.libredwg;let a="";const i=e.dwg_dynapi_entity_data(n,"block_header");if(i){const A=e.dwg_ref_get_object(i);if(A){const h=e.dwg_object_to_object_tio(A);h&&(a=e.dwg_entity_block_header_get_block(h).name)}}a||(a=e.dwg_dynapi_entity_data(n,"block_name"));const r=e.dwg_dynapi_entity_data(n,"ins_pt"),s=e.dwg_dynapi_entity_data(n,"scale"),_=e.dwg_dynapi_entity_data(n,"rotation"),d=e.dwg_dynapi_entity_data(n,"num_cols"),c=e.dwg_dynapi_entity_data(n,"num_rows"),E=e.dwg_dynapi_entity_data(n,"col_spacing"),u=e.dwg_dynapi_entity_data(n,"row_spacing"),l=e.dwg_dynapi_entity_data(n,"extrusion"),I=e.dwg_entity_insert_get_attribs(n),f=[];return I.forEach(A=>{const h=e.dwg_object_to_entity(A),g=e.dwg_object_to_entity_tio(A);if(h&&g){const p=this.getCommonAttrs(h);e.dwg_object_get_fixedtype(A)==T.DWG_TYPE_ATTRIB&&f.push(this.convertAttrib(g,p))}}),{type:"INSERT",...o,name:a,insertionPoint:r,xScale:s?s.x:1,yScale:s?s.y:1,zScale:s?s.z:1,rotation:_,columnCount:d,rowCount:c,columnSpacing:E,rowSpacing:u,extrusionDirection:l,attribs:f}}convertLeader(n,o){const e=this.libredwg,a=e.dwg_entity_mtext_get_style_name(n),i=e.dwg_dynapi_entity_data(n,"arrowhead_type"),r=e.dwg_dynapi_entity_data(n,"path_type"),s=e.dwg_dynapi_entity_data(n,"annot_type"),_=e.dwg_dynapi_entity_data(n,"hookline_dir"),d=e.dwg_dynapi_entity_data(n,"hookline_on"),c=e.dwg_dynapi_entity_data(n,"box_height"),E=e.dwg_dynapi_entity_data(n,"box_width"),u=e.dwg_dynapi_entity_data(n,"num_points"),l=e.dwg_dynapi_entity_data(n,"points"),I=u>0?e.dwg_ptr_to_point3d_array(l,u):[],f=e.dwg_dynapi_entity_data(n,"byblock_color"),A=e.dwg_dynapi_entity_data(n,"extrusion"),h=e.dwg_dynapi_entity_data(n,"x_direction"),g=e.dwg_dynapi_entity_data(n,"inspt_offset"),p=e.dwg_dynapi_entity_data(n,"endptproj");return{type:"LEADER",...o,styleName:a,isArrowheadEnabled:i>0,isSpline:r>0,leaderCreationFlag:s,isHooklineSameDirection:_>0,isHooklineExists:d>0,textHeight:c,textWidth:E,numberOfVertices:u,vertices:I,byBlockColor:f,normal:A,horizontalDirection:h,offsetFromBlock:g,offsetFromAnnotation:p}}convertLine(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"start"),i=e.dwg_dynapi_entity_data(n,"end"),r=e.dwg_dynapi_entity_data(n,"thickness"),s=e.dwg_dynapi_entity_data(n,"extrusion");return{type:"LINE",...o,thickness:r,startPoint:a,endPoint:i,extrusionDirection:s}}convertLWPolyline(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"num_points"),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"const_width"),s=e.dwg_dynapi_entity_data(n,"elevation"),_=e.dwg_dynapi_entity_data(n,"thickness"),d=e.dwg_dynapi_entity_data(n,"extrusion"),c=[],E=e.dwg_dynapi_entity_data(n,"num_points"),u=e.dwg_dynapi_entity_data(n,"points"),l=e.dwg_ptr_to_point2d_array(u,E),I=e.dwg_dynapi_entity_data(n,"num_bulges"),f=e.dwg_dynapi_entity_data(n,"bulges"),A=e.dwg_ptr_to_double_array(f,I);return l.forEach((h,g)=>{c.push({id:g,x:h.x,y:h.y,bulge:A.length>g?A[g]:0})}),{type:"LWPOLYLINE",...o,numberOfVertices:a,flag:i,constantWidth:r,elevation:s,thickness:_,extrusionDirection:d,vertices:c}}convertMLine(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"scale"),i=e.dwg_dynapi_entity_data(n,"flags"),r=e.dwg_dynapi_entity_data(n,"justification"),s=e.dwg_dynapi_entity_data(n,"base_point"),_=e.dwg_dynapi_entity_data(n,"extrusion"),d=e.dwg_dynapi_entity_data(n,"num_lines"),c=e.dwg_dynapi_entity_data(n,"num_verts"),E=e.dwg_dynapi_entity_data(n,"verts"),u=e.dwg_ptr_to_mline_vertex_array(E,c),l=[];return u.forEach(I=>{l.push({vertex:I.vertex,vertexDirection:I.vertex_direction,miterDirection:I.miter_direction,numberOfLines:I.num_lines,lines:I.lines.map(f=>({numberOfSegmentParams:f.num_segparms,segmentParams:f.segparms,numberOfAreaFillParams:f.num_areafillparms,areaFillParams:f.areafillparms}))})}),{type:"MLINE",...o,scale:a,flags:i,justification:r,startPoint:s,extrusionDirection:_,numberOfLines:d,numberOfVertices:c,vertices:l,mlineStyle:""}}convertMultiLeader(n,o){const e=this.libredwg,a=S=>e.dwg_dynapi_entity_data(n,S),i=(S,x,lt)=>e.dwg_dynapi_subclass_data(S,x,lt),r=S=>e.dwg_ref_get_id(S),s=S=>S>0,_=S=>S!=null?we(S):void 0,d=a("class_version"),c=r(a("mleaderstyle")),E=a("flags"),u=a("type"),l=_(a("line_color")),I=r(a("line_ltype")),f=a("line_linewt"),A=s(a("has_landing")),h=s(a("has_dogleg")),g=a("landing_dist"),p=r(a("arrow_handle")),C=a("arrow_size"),L=a("style_content"),R=r(a("text_style")),D=a("text_left"),Y=a("text_right"),U=a("text_angletype"),H=a("text_alignment"),v=_(a("text_color")),B=s(a("has_text_frame")),V=r(a("block_style")),K=_(a("block_color")),tt=a("block_scale"),nt=a("block_rotation"),et=a("style_attachment"),ot=s(a("is_annotative")),q=s(a("is_neg_textdir")),at=a("ipe_alignment");let z=a("justification");const it=a("attach_dir"),At=a("attach_bottom"),ft=a("attach_top"),It=a("scale_factor"),ht=a("num_arrowheads"),Tt=a("arrowheads"),Pt=e.dwg_dynapi_subclass_size("LEADER_ArrowHead"),rt=[];for(let S=0;S<ht;S++){const x=Tt+S*Pt;rt.push({index:i(x,"LEADER_ArrowHead","is_default"),handle:r(i(x,"LEADER_ArrowHead","arrowhead"))??""})}const gt=a("num_blocklabels"),pt=a("blocklabels"),cn=e.dwg_dynapi_subclass_size("LEADER_BlockLabel"),Ct=[];for(let S=0;S<gt;S++){const x=pt+S*cn;Ct.push({id:r(i(x,"LEADER_BlockLabel","attdef")),index:i(x,"LEADER_BlockLabel","ui_index"),width:i(x,"LEADER_BlockLabel","width"),text:i(x,"LEADER_BlockLabel","label_text")})}const G=n+e.dwg_dynapi_entity_field_offset(n,"ctx"),m=G+e.dwg_dynapi_subclass_field_offset("MLEADER_AnnotContext","content"),ln=i(G,"MLEADER_AnnotContext","scale_factor"),En=i(G,"MLEADER_AnnotContext","content_base"),un=i(G,"MLEADER_AnnotContext","landing_gap"),An=i(G,"MLEADER_AnnotContext","attach_dir"),fn=i(G,"MLEADER_AnnotContext","text_height"),In=i(G,"MLEADER_AnnotContext","arrow_size"),hn=i(G,"MLEADER_AnnotContext","text_left"),Tn=i(G,"MLEADER_AnnotContext","text_right"),Pn=i(G,"MLEADER_AnnotContext","text_angletype"),gn=i(G,"MLEADER_AnnotContext","text_alignment"),Yt=s(i(G,"MLEADER_AnnotContext","has_content_txt")),Gt=s(i(G,"MLEADER_AnnotContext","has_content_blk")),pn=i(G,"MLEADER_AnnotContext","base"),Cn=i(G,"MLEADER_AnnotContext","base_dir"),yn=i(G,"MLEADER_AnnotContext","base_vert"),Ln=s(i(G,"MLEADER_AnnotContext","is_normal_reversed"));let Mt,Wt,bt,wt,Ot,vt,Bt,kt,Ft,Ut,Ht,Vt,Xt,Kt,zt,$t,Jt,Zt,qt,oe,ae;if(Yt){const S=i(m,"MLEADER_Content_MText","alignment");S!=null&&S!==0&&(z=S),Wt=i(m,"MLEADER_Content_MText","normal"),Bt=i(m,"MLEADER_Content_MText","location"),bt=i(m,"MLEADER_Content_MText","rotation"),kt=i(m,"MLEADER_Content_MText","direction"),wt=i(m,"MLEADER_Content_MText","width"),Ot=i(m,"MLEADER_Content_MText","line_spacing_factor"),vt=i(m,"MLEADER_Content_MText","line_spacing_style"),Mt=i(m,"MLEADER_Content_MText","flow"),Ft=_(i(m,"MLEADER_Content_MText","bg_color")),Ut=i(m,"MLEADER_Content_MText","bg_scale"),Ht=i(m,"MLEADER_Content_MText","bg_transparency"),Xt=s(i(m,"MLEADER_Content_MText","is_bg_fill")),Vt=s(i(m,"MLEADER_Content_MText","is_bg_mask_fill")),Kt=i(m,"MLEADER_Content_MText","col_type"),zt=s(i(m,"MLEADER_Content_MText","is_height_auto")),$t=i(m,"MLEADER_Content_MText","col_width"),Jt=i(m,"MLEADER_Content_MText","col_gutter"),Zt=s(i(m,"MLEADER_Content_MText","is_col_flow_reversed"));const x=i(m,"MLEADER_Content_MText","num_col_sizes"),lt=i(m,"MLEADER_Content_MText","col_sizes");x>0&&(qt=e.dwg_ptr_to_double_array(lt,x)[0]),oe=s(i(m,"MLEADER_Content_MText","word_break")),ae=i(m,"MLEADER_Content_MText","default_text")}let ie;if(Gt){const S=i(m,"MLEADER_Content_Block","transform");ie={blockContentId:r(i(m,"MLEADER_Content_Block","block_table")),normal:i(m,"MLEADER_Content_Block","normal"),position:i(m,"MLEADER_Content_Block","location"),scale:i(m,"MLEADER_Content_Block","scale"),rotation:i(m,"MLEADER_Content_Block","rotation"),color:_(i(m,"MLEADER_Content_Block","color")),transformationMatrix:S?e.dwg_ptr_to_double_array(S,16):void 0}}const ve=i(G,"MLEADER_AnnotContext","num_leaders"),Be=i(G,"MLEADER_AnnotContext","leaders"),ke=e.dwg_dynapi_subclass_size("LEADER_Node"),Fe=e.dwg_dynapi_subclass_size("LEADER_Line"),re=e.dwg_dynapi_subclass_size("LEADER_Break"),Rn=[];for(let S=0;S<ve;S++){const x=Be+S*ke,lt=s(i(x,"LEADER_Node","has_lastleaderlinepoint")),se=s(i(x,"LEADER_Node","has_dogleg")),Ue=i(x,"LEADER_Node","num_breaks"),He=i(x,"LEADER_Node","breaks"),mn=[];for(let st=0;st<Ue;st++){const Q=He+st*re;mn.push({start:i(Q,"LEADER_Break","start"),end:i(Q,"LEADER_Break","end")})}const Ve=i(x,"LEADER_Node","num_lines"),Xe=i(x,"LEADER_Node","lines"),_e=[];for(let st=0;st<Ve;st++){const Q=Xe+st*Fe,de=i(Q,"LEADER_Line","num_points"),Ke=i(Q,"LEADER_Line","points"),ze=de>0?e.dwg_ptr_to_point3d_array(Ke,de):[],$e=i(Q,"LEADER_Line","num_breaks"),Je=i(Q,"LEADER_Line","breaks"),Sn=[];for(let Nn=0;Nn<$e;Nn++){const ce=Je+Nn*re;Sn.push({start:i(ce,"LEADER_Break","start"),end:i(ce,"LEADER_Break","end")})}_e.push({vertices:ze,leaderLineIndex:i(Q,"LEADER_Line","line_index"),breaks:Sn.length>0?Sn:void 0})}Rn.push({lastLeaderLinePoint:lt?i(x,"LEADER_Node","lastleaderlinepoint"):void 0,lastLeaderLinePointSet:lt,doglegVector:se?i(x,"LEADER_Node","dogleg_vector"):void 0,doglegVectorSet:se,doglegLength:i(x,"LEADER_Node","dogleg_length"),breaks:mn.length>0?mn:void 0,leaderBranchIndex:i(x,"LEADER_Node","branch_index"),leaderLines:_e})}return{type:"MULTILEADER",...o,subclassMarker:"AcDbMLeader",version:d,leaderStyleId:c,propertyOverrideFlag:E,leaderLineType:u,leaderLineColor:l,leaderLineTypeId:I,leaderLineWeight:f,landingEnabled:A,doglegEnabled:h,doglegLength:g,arrowheadId:p,arrowheadSize:C||In,contentType:L,textStyleId:R,textLeftAttachmentType:D||hn,textRightAttachmentType:Y||Tn,textAngleType:U||Pn,textAlignmentType:H||gn,textColor:v,textFrameEnabled:B,landingGap:un,textAttachment:An,textFlowDirection:Mt,blockContentId:V,blockContentColor:K,blockContentScale:tt,blockContentRotation:nt,blockContentConnectionType:et,annotativeScaleEnabled:ot,arrowheadOverrides:rt.length>0?rt:void 0,blockAttributes:Ct.length>0?Ct:void 0,textDirectionNegative:q,textAlignInIPE:at,textAttachmentPoint:z,textAttachmentDirection:it,bottomTextAttachmentDirection:At,topTextAttachmentDirection:ft,contentScale:It||ln,contentBasePosition:En,normal:Wt,textHeight:fn,textRotation:bt,textWidth:wt,textLineSpacingFactor:Ot,textLineSpacingStyle:vt,textAnchor:Bt,textDirection:kt,textBackgroundColor:Ft,textBackgroundScaleFactor:Ut,textBackgroundTransparency:Ht,textBackgroundColorOn:Vt,textFillOn:Xt,textColumnType:Kt,textUseAutoHeight:zt,textColumnWidth:$t,textColumnGutterWidth:Jt,textColumnFlowReversed:Zt,textColumnHeight:qt,textUseWordBreak:oe,textContent:ae,hasMText:Yt,hasBlock:Gt,blockContent:ie,planeOrigin:pn,planeXAxisDirection:Cn,planeYAxisDirection:yn,planeNormalReversed:Ln,leaderSections:Rn.length>0?Rn:void 0}}convertOle2Frame(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"oleversion"),i=e.dwg_dynapi_entity_data(n,"oleclient"),r=e.dwg_dynapi_entity_data(n,"data_size");let s=e.dwg_dynapi_entity_data(n,"pt1"),_=e.dwg_dynapi_entity_data(n,"pt2");const d=e.dwg_dynapi_entity_data(n,"lock_aspect"),c=e.dwg_dynapi_entity_data(n,"type"),E=e.dwg_dynapi_entity_data(n,"mode"),u=e.dwg_entity_ole2frame_get_data(n),l=u?Lt(u):"";if(u){const I=jo(u);I&&(s=I.upperLeft,_=I.lowerRight)}return{type:"OLE2FRAME",...o,oleVersion:a,oleClient:i,dataSize:r,leftUpPoint:s,rightDownPoint:_,lockAspect:d,oleObjectType:c,tileModeDescriptor:E,binaryData:l}}convertOleFrame(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"flag"),i=e.dwg_dynapi_entity_data(n,"mode"),r=e.dwg_dynapi_entity_data(n,"data_size"),s=e.dwg_entity_oleframe_get_data(n),_=s?Lt(s):"";return{type:"OLEFRAME",...o,flag:a,mode:i,dataSize:r,binaryData:_}}convertMText(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"ins_pt"),i=e.dwg_dynapi_entity_data(n,"text_height"),r=e.dwg_dynapi_entity_data(n,"rect_height"),s=e.dwg_dynapi_entity_data(n,"rect_width"),_=e.dwg_dynapi_entity_data(n,"extents_width"),d=e.dwg_dynapi_entity_data(n,"extents_height"),c=e.dwg_dynapi_entity_data(n,"attachment"),E=e.dwg_dynapi_entity_data(n,"flow_dir"),u=e.dwg_dynapi_entity_data(n,"text"),l=e.dwg_entity_mtext_get_style_name(n),I=e.dwg_dynapi_entity_data(n,"extrusion"),f=e.dwg_dynapi_entity_data(n,"x_axis_dir"),A=e.dwg_dynapi_entity_data(n,"linespace_style"),h=e.dwg_dynapi_entity_data(n,"linespace_factor"),g=e.dwg_dynapi_entity_data(n,"bg_fill_flag"),p=e.dwg_dynapi_entity_data(n,"bg_fill_scale"),C=e.dwg_dynapi_entity_data(n,"bg_fill_color"),L=e.dwg_dynapi_entity_data(n,"bg_fill_trans"),R=e.dwg_dynapi_entity_data(n,"column_type"),D=e.dwg_dynapi_entity_data(n,"flow_reversed"),Y=e.dwg_dynapi_entity_data(n,"auto_height"),U=e.dwg_dynapi_entity_data(n,"column_width"),H=e.dwg_dynapi_entity_data(n,"gutter"),v=e.dwg_dynapi_entity_data(n,"num_column_heights"),B=e.dwg_dynapi_entity_data(n,"column_heights"),V=e.dwg_ptr_to_double_array(B,v);return{type:"MTEXT",...o,insertionPoint:a,textHeight:i,rectHeight:r,rectWidth:s,extentsHeight:d,extentsWidth:_,attachmentPoint:c,drawingDirection:E,text:u,styleName:l,extrusionDirection:I,direction:f,rotation:0,lineSpacingStyle:A,lineSpacing:h,backgroundFill:g,fillBoxScale:p,backgroundFillColor:C.rgb,backgroundFillTransparency:L,columnType:R,columnFlowReversed:D,columnAutoHeight:Y,columnWidth:U,columnGutter:H,columnHeightCount:v,columnHeights:V}}convertPoint(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"x"),i=e.dwg_dynapi_entity_data(n,"y"),r=e.dwg_dynapi_entity_data(n,"z"),s=e.dwg_dynapi_entity_data(n,"thickness"),_=e.dwg_dynapi_entity_data(n,"extrusion"),d=e.dwg_dynapi_entity_data(n,"x_ang");return{type:"POINT",...o,position:{x:a,y:i,z:r},thickness:s,extrusionDirection:_,angle:d}}convertPolyline2d(n,o,e){const a=this.libredwg,i=a.dwg_dynapi_entity_data(n,"flag"),r=a.dwg_dynapi_entity_data(n,"curve_type"),s=a.dwg_dynapi_entity_data(n,"start_width"),_=a.dwg_dynapi_entity_data(n,"end_width"),d=a.dwg_dynapi_entity_data(n,"elevation"),c=a.dwg_dynapi_entity_data(n,"thickness"),E=a.dwg_dynapi_entity_data(n,"extrusion"),u=a.dwg_entity_polyline_2d_get_vertices(e);return{type:"POLYLINE2D",...o,flag:i,smoothType:r,startWidth:s,endWidth:_,elevation:d,thickness:c,extrusionDirection:E,vertices:u.map(l=>({x:l.point.x,y:l.point.y,z:l.point.z,startWidth:l.start_width,endWidth:l.end_width,bulge:l.bulge,flag:l.flag,tangentDirection:l.tangent_dir})),meshMVertexCount:0,meshNVertexCount:0,surfaceMDensity:0,surfaceNDensity:0}}convertPolyline3d(n,o,e){const a=this.libredwg,i=a.dwg_dynapi_entity_data(n,"flag"),r=a.dwg_dynapi_entity_data(n,"curve_type"),s=a.dwg_dynapi_entity_data(n,"start_width"),_=a.dwg_dynapi_entity_data(n,"end_width"),d=a.dwg_dynapi_entity_data(n,"extrusion"),c=a.dwg_entity_polyline_3d_get_vertices(e);return{type:"POLYLINE3D",...o,flag:i,smoothType:r,startWidth:s,endWidth:_,extrusionDirection:d,vertices:c.map(E=>({x:E.point.x,y:E.point.y,z:E.point.z,flag:E.flag}))}}convertProxyEntity(n,o,e){const a=this.libredwg,i=a.dwg_dynapi_entity_data(n,"proxy_id"),r=a.dwg_dynapi_entity_data(n,"class_id"),s=a.dwg_dynapi_entity_data(n,"data_numbits"),_=a.dwg_dynapi_entity_data(n,"version"),d=a.dwg_dynapi_entity_data(n,"from_dxf"),c=a.dwg_dynapi_entity_data(n,"num_objids"),E=a.dwg_entity_get_preview(e),u=E?.length??0,l=a.dwg_entity_proxy_entity_get_entity_data(n),I=E?Lt(E):void 0,f=l?Lt(l):void 0;let A;if(c>0){const p=a.dwg_dynapi_entity_data(n,"objids");p&&(A=a.dwg_ptr_to_object_ref_array(p,c).map(L=>w(L.absolute_ref)))}const h=this.getOriginalDxfName(r),g={type:"ACAD_PROXY_ENTITY",subclassMarker:"AcDbProxyEntity",...o,proxyEntityClassId:i||498,applicationEntityClassId:r};return h&&(g.originalDxfName=h),u>0&&(g.graphicsDataSize=u),I&&(g.graphicsData=I),s>0&&(g.entityDataSize=s),f&&(g.entityData=f),A&&A.length>0&&(g.linkedObjectIds=A),_&&(g.objectDrawingFormat=_),(d===0||d===1)&&(g.originalDataFormat=d),g}getOriginalDxfName(n){if(this.classes.length===0||n<0)return;const o=n>=500?n-500:n;if(o>=0&&o<this.classes.length)return this.classes[o].dxfName}convertRay(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"point"),i=e.dwg_dynapi_entity_data(n,"vector");return{type:"RAY",...o,firstPoint:a,unitDirection:i}}convertSection(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"state"),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"name"),s=e.dwg_dynapi_entity_data(n,"vert_dir"),_=e.dwg_dynapi_entity_data(n,"top_height"),d=e.dwg_dynapi_entity_data(n,"bottom_height"),c=e.dwg_dynapi_entity_data(n,"indicator_alpha"),E=e.dwg_dynapi_entity_data(n,"indicator_color"),u=e.dwg_dynapi_entity_data(n,"num_verts"),l=e.dwg_dynapi_entity_data(n,"verts"),I=u>0?e.dwg_ptr_to_point3d_array(l,u):[],f=e.dwg_dynapi_entity_data(n,"num_blverts"),A=e.dwg_dynapi_entity_data(n,"blverts"),h=f>0?e.dwg_ptr_to_point3d_array(A,f):[],g=e.dwg_dynapi_entity_data(n,"geometrySettingHardId"),p=e.dwg_ref_get_handle_absolute_ref(g)??0n;return{type:"SECTION",...o,state:a,flags:i,name:r,verticalDirection:s,topHeight:_,bottomHeight:d,indicatorTransparency:c,indicatorColor:E.rgb,numberOfVertices:u,vertices:I,numberOfBackLineVertices:f,backLineVertices:h,geometrySettingHardId:p}}convertShape(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"ins_pt"),i=e.dwg_dynapi_entity_data(n,"scale"),r=e.dwg_dynapi_entity_data(n,"rotation"),s=e.dwg_dynapi_entity_data(n,"width_factor"),_=e.dwg_dynapi_entity_data(n,"oblique_angle"),d=e.dwg_dynapi_entity_data(n,"thickness"),c=e.dwg_dynapi_entity_data(n,"extrusion"),E=e.dwg_dynapi_entity_data(n,"style_id"),u=e.dwg_entity_text_get_style_name(n);return{type:"SHAPE",subclassMarker:"AcDbShape",...o,thickness:d,insertionPoint:a,size:i,shapeNumber:E,styleName:u,rotation:r,xScale:s,obliqueAngle:_,extrusionDirection:c}}convertSolid(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"corner1"),i=e.dwg_dynapi_entity_data(n,"corner2"),r=e.dwg_dynapi_entity_data(n,"corner3"),s=e.dwg_dynapi_entity_data(n,"corner4"),_=e.dwg_dynapi_entity_data(n,"thickness"),d=e.dwg_dynapi_entity_data(n,"extrusion");return{type:"SOLID",...o,corner1:a,corner2:i,corner3:r,corner4:s,thickness:_,extrusionDirection:d}}convertSpline(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"splineflags"),i=e.dwg_dynapi_entity_data(n,"degree"),r=e.dwg_dynapi_entity_data(n,"knot_tol"),s=e.dwg_dynapi_entity_data(n,"num_knots"),_=e.dwg_dynapi_entity_data(n,"knots"),d=e.dwg_ptr_to_double_array(_,s),c=e.dwg_dynapi_entity_data(n,"fit_tol"),E=e.dwg_dynapi_entity_data(n,"num_fit_pts"),u=e.dwg_dynapi_entity_data(n,"fit_pts"),l=e.dwg_ptr_to_point3d_array(u,E),I=e.dwg_dynapi_entity_data(n,"weighted"),f=e.dwg_dynapi_entity_data(n,"ctrl_tol"),A=e.dwg_dynapi_entity_data(n,"num_ctrl_pts"),h=e.dwg_dynapi_entity_data(n,"ctrl_pts"),g=e.dwg_ptr_to_point4d_array(h,A),p=e.dwg_dynapi_entity_data(n,"beg_tan_vec"),C=e.dwg_dynapi_entity_data(n,"end_tan_vec");return{type:"SPLINE",...o,flag:a,degree:i,numberOfKnots:s,numberOfControlPoints:A,numberOfFitPoints:E,knotTolerance:r,controlTolerance:f,fitTolerance:c,startTangent:p,endTangent:C,knots:d,weights:I?g.map(L=>L.w):void 0,controlPoints:g.map(L=>({x:L.x,y:L.y,z:L.z})),fitPoints:l}}convertTable(n,o){const e=this.libredwg,a=e.dwg_dynapi_subclass_data(n,"ldata","name"),i=e.dwg_dynapi_entity_data(n,"ins_pt"),r=e.dwg_dynapi_entity_data(n,"horiz_direction"),s=e.dwg_dynapi_entity_data(n,"flag_for_table_value"),_=e.dwg_dynapi_entity_data(n,"num_rows"),d=e.dwg_dynapi_entity_data(n,"num_cols"),c=e.dwg_dynapi_entity_data(n,"row_heights"),E=e.dwg_ptr_to_double_array(c,_),u=e.dwg_dynapi_entity_data(n,"col_widths"),l=e.dwg_ptr_to_double_array(u,d),I=e.dwg_dynapi_entity_data(n,"tablestyle"),f=e.dwg_ref_get_id(I)??"",A=e.dwg_dynapi_entity_data(n,"block_header"),h=e.dwg_ref_get_id(A)??"",g=e.dwg_dynapi_entity_data(n,"table_flag_override"),p=e.dwg_dynapi_entity_data(n,"border_color_overrides_flag"),C=e.dwg_dynapi_entity_data(n,"border_lineweight_overrides_flag"),L=e.dwg_dynapi_entity_data(n,"border_visibility_overrides_flag"),R=e.dwg_dynapi_entity_data(n,"num_cells"),D=e.dwg_dynapi_entity_data(n,"cells"),Y=e.dwg_ptr_to_table_cell_array(D,R);return{type:"ACAD_TABLE",...o,name:a,startPoint:i,directionVector:r,tableValue:s,rowCount:_,columnCount:d,overrideFlag:g,borderColorOverrideFlag:p,borderLineWeightOverrideFlag:C,borderVisibilityOverrideFlag:L,rowHeightArr:E,columnWidthArr:l,tableStyleId:f,blockRecordHandle:h,cells:this.convertTableCells(Y),bmpPreview:""}}convertTableCells(n){return n.map(o=>({text:o.text_value,attachmentPoint:o.cell_alignment,textStyle:o.text_style?String(o.text_style):void 0,rotation:o.rotation,cellType:o.type,flagValue:o.flags,mergedValue:o.is_merged_value,autoFit:o.is_autofit_flag,topBorderVisibility:!!o.top_visibility,bottomBorderVisibility:!!o.bottom_visibility,leftBorderVisibility:!!o.left_visibility,rightBorderVisibility:!!o.right_visibility,overrideFlag:o.cell_flag_override,virtualEdgeFlag:o.virtual_edge_flag,blockTableRecordId:o.block_handle?String(o.block_handle.absolute_ref??""):void 0,blockScale:o.block_scale,blockAttrNum:o.attr_defs?.length??0,attrDefineId:o.attr_defs?.map(e=>String(e.attdef?.absolute_ref??"")),textHeight:o.text_height??0,extendedCellFlags:o.additional_data_flag}))}convertTextBase(n){const o=this.libredwg,e=o.dwg_dynapi_entity_data(n,"text_value"),a=o.dwg_dynapi_entity_data(n,"thickness"),i=o.dwg_dynapi_entity_data(n,"ins_pt"),r=o.dwg_dynapi_entity_data(n,"alignment_pt"),s=o.dwg_dynapi_entity_data(n,"rotation"),_=o.dwg_dynapi_entity_data(n,"height"),d=o.dwg_dynapi_entity_data(n,"width_factor"),c=o.dwg_dynapi_entity_data(n,"oblique_angle"),E=o.dwg_entity_text_get_style_name(n),u=o.dwg_dynapi_entity_data(n,"generation"),l=o.dwg_dynapi_entity_data(n,"horiz_alignment"),I=o.dwg_dynapi_entity_data(n,"vert_alignment"),f=o.dwg_dynapi_entity_data(n,"extrusion");return{text:e,thickness:a,startPoint:i,endPoint:r,textHeight:_,rotation:s,xScale:d,obliqueAngle:c,styleName:E,generationFlag:u,halign:l,valign:I,extrusionDirection:f}}convertText(n,o){return{type:"TEXT",...o,...this.convertTextBase(n)}}convertTolerance(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"ins_pt"),i=e.dwg_dynapi_entity_data(n,"text_value"),r=e.dwg_dynapi_entity_data(n,"x_direction"),s=e.dwg_dynapi_entity_data(n,"extrusion"),_=e.dwg_entity_get_dimstyle_name(n);return{type:"TOLERANCE",...o,styleName:_,insertionPoint:a,text:i,extrusionDirection:s,xAxisDirection:r}}convertViewport(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"center"),i=e.dwg_dynapi_entity_data(n,"width"),r=e.dwg_dynapi_entity_data(n,"height"),s=e.dwg_dynapi_entity_data(n,"on_off"),_=e.dwg_dynapi_entity_data(n,"VIEWCTR"),d=e.dwg_dynapi_entity_data(n,"SNAPBASE"),c=e.dwg_dynapi_entity_data(n,"SNAPUNIT"),E=e.dwg_dynapi_entity_data(n,"GRIDUNIT"),u=e.dwg_dynapi_entity_data(n,"VIEWDIR"),l=e.dwg_dynapi_entity_data(n,"view_target"),I=e.dwg_dynapi_entity_data(n,"lens_length"),f=e.dwg_dynapi_entity_data(n,"front_clip_z"),A=e.dwg_dynapi_entity_data(n,"back_clip_z"),h=e.dwg_dynapi_entity_data(n,"VIEWSIZE"),g=e.dwg_dynapi_entity_data(n,"SNAPANG"),p=e.dwg_dynapi_entity_data(n,"twist_angle"),C=e.dwg_dynapi_entity_data(n,"circle_zoom"),L=e.dwg_dynapi_entity_data(n,"status_flag"),R=e.dwg_dynapi_entity_data(n,"style_sheet"),D=e.dwg_dynapi_entity_data(n,"render_mode"),Y=e.dwg_dynapi_entity_data(n,"UCSVP"),U=e.dwg_dynapi_entity_data(n,"ucsorg"),H=e.dwg_dynapi_entity_data(n,"ucsxdir"),v=e.dwg_dynapi_entity_data(n,"ucsydir"),B=e.dwg_dynapi_entity_data(n,"named_ucs"),V=e.dwg_ref_get_id(B),K=e.dwg_dynapi_entity_data(n,"base_ucs"),tt=e.dwg_ref_get_id(K),nt=e.dwg_dynapi_entity_data(n,"UCSORTHOVIEW"),et=e.dwg_dynapi_entity_data(n,"ucs_elevation"),ot=e.dwg_dynapi_entity_data(n,"shadeplot_mode"),q=e.dwg_dynapi_entity_data(n,"use_default_lights"),at=e.dwg_dynapi_entity_data(n,"default_lighting_type"),z=e.dwg_dynapi_entity_data(n,"brightness"),it=e.dwg_dynapi_entity_data(n,"contrast"),At=e.dwg_dynapi_entity_data(n,"grid_major"),ft=e.dwg_dynapi_entity_data(n,"background"),It=e.dwg_ref_get_id(ft),ht=e.dwg_dynapi_entity_data(n,"shadeplot"),Tt=e.dwg_ref_get_id(ht),Pt=e.dwg_dynapi_entity_data(n,"visualstyle"),rt=e.dwg_ref_get_id(Pt),gt=e.dwg_dynapi_entity_data(n,"sun"),pt=e.dwg_ref_get_id(gt);return{type:"VIEWPORT",...o,viewportCenter:a,width:i,height:r,status:s,viewportId:0,displayCenter:_,snapBase:d,snapSpacing:c,gridSpacing:E,viewDirection:u,targetPoint:l,perspectiveLensLength:I,frontClipZ:f,backClipZ:A,viewHeight:h,snapAngle:g,viewTwistAngle:p,circleZoomPercent:C,statusBitFlags:L,sheetName:R,renderMode:D,ucsPerViewport:Y,ucsOrigin:U,ucsXAxis:H,ucsYAxis:v,ucsId:V??"",ucsBaseId:tt??"",orthographicType:nt,elevation:et,shadePlotMode:ot,majorGridFrequency:At,backgroundId:It??"",shadePlotId:Tt??"",visualStyleId:rt??"",isDefaultLighting:!!q,defaultLightingType:at,brightness:z,contrast:it,sunId:pt??""}}convertWipeout(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"class_version"),i=e.dwg_dynapi_entity_data(n,"pt0"),r=e.dwg_dynapi_entity_data(n,"uvec"),s=e.dwg_dynapi_entity_data(n,"vvec"),_=e.dwg_dynapi_entity_data(n,"image_size"),d=e.dwg_dynapi_entity_data(n,"display_props"),c=e.dwg_dynapi_entity_data(n,"clipping"),E=e.dwg_dynapi_entity_data(n,"brightness"),u=e.dwg_dynapi_entity_data(n,"contrast"),l=e.dwg_dynapi_entity_data(n,"fade"),I=e.dwg_dynapi_entity_data(n,"clip_mode"),f=e.dwg_dynapi_entity_data(n,"clip_boundary_type"),A=e.dwg_dynapi_entity_data(n,"num_clip_verts"),h=e.dwg_dynapi_entity_data(n,"clip_verts"),g=e.dwg_ptr_to_point2d_array(h,A),p=e.dwg_dynapi_entity_data(n,"imagedef"),C=e.dwg_ref_get_absref(p)??0,L=e.dwg_dynapi_entity_data(n,"imagedefreactor"),R=e.dwg_ref_get_absref(L)??0;return{type:"WIPEOUT",...o,version:a,position:i,uPixel:r,vPixel:s,imageSize:_,imageDefHandle:C,flags:d,clipping:c,brightness:E,contrast:u,fade:l,imageDefReactorHandle:R,clippingBoundaryType:f,countBoundaryPoints:A,clippingBoundaryPath:g,clipMode:I}}convertXline(n,o){const e=this.libredwg,a=e.dwg_dynapi_entity_data(n,"point"),i=e.dwg_dynapi_entity_data(n,"vector");return{type:"XLINE",...o,firstPoint:a,unitDirection:i}}getDimensionCommonAttrs(n){const o=this.libredwg,e=o.dwg_dynapi_entity_data(n,"class_version"),a=o.dwg_entity_get_block_name(n,"block"),i=o.dwg_dynapi_entity_data(n,"def_pt"),r=o.dwg_dynapi_entity_data(n,"text_midpt"),s=o.dwg_dynapi_entity_data(n,"attachmentPoint"),_=o.dwg_dynapi_entity_data(n,"flag"),d=o.dwg_dynapi_entity_data(n,"lspace_factor"),c=o.dwg_dynapi_entity_data(n,"lspace_factor"),E=o.dwg_dynapi_entity_data(n,"act_measurement"),u=o.dwg_dynapi_entity_data(n,"user_text"),l=o.dwg_dynapi_entity_data(n,"text_rotation"),I=o.dwg_dynapi_entity_data(n,"ins_rotation"),f=o.dwg_dynapi_entity_data(n,"extrusion"),A=o.dwg_entity_get_dimstyle_name(n);return{type:"DIMENSION",version:e,name:a,definitionPoint:i,textPoint:r,dimensionType:_,attachmentPoint:s,textLineSpacingStyle:d,textLineSpacingFactor:c||1,measurement:E,text:u,textRotation:l,ocsRotation:I,extrusionDirection:f,styleName:A}}getCommonAttrs(n){const o=this.libredwg,e=o.dwg_object_entity_get_color_object(n),a=e.method,i=e.index;let r;(a==194||(e.rgb>>>24&255)===194)&&(r=e.rgb&16777215);const s=this.getLayerName(n),_=o.dwg_object_entity_get_handle_object(n),d=o.dwg_object_entity_get_ownerhandle_object(n),c=o.dwg_object_entity_get_xdicobjhandle_object(n),E=this.getLtypeName(n),u=o.dwg_object_entity_get_line_weight(n),l=o.dwg_object_entity_get_ltype_scale(n),I=!o.dwg_object_entity_get_invisible(n),f=o.dwg_object_entity_get_xdata(n);return{handle:w(_.value),ownerDictionaryHardId:w(c.absolute_ref),ownerBlockRecordSoftId:w(d.absolute_ref),layer:s,color:r,colorIndex:i,colorName:e.name,lineType:E,lineweight:u,lineTypeScale:l,isVisible:I,transparency:e.alpha,transparencyType:e.alpha_type,xdata:f}}getLayerName(n){const e=this.libredwg.dwg_object_entity_get_layer_object_ref(n);return this.layers.get(w(e.handleref.value))??"0"}getLtypeName(n){const e=this.libredwg.dwg_object_entity_get_ltype_object_ref(n);return this.ltypes.get(w(e.handleref.value))??""}}class ye{constructor(n){M(this,"libredwg");M(this,"entityConverter");this.libredwg=n,this.entityConverter=new ta(n)}convert(n){this.entityConverter.clear();const o={tables:{APPID:{entries:[]},BLOCK_RECORD:{entries:[]},DIMSTYLE:{entries:[]},LAYER:{entries:[]},LTYPE:{entries:[]},STYLE:{entries:[]},VPORT:{entries:[]}},objects:{DICTIONARY:[],IMAGEDEF:[],LAYER_FILTER:[],LAYER_INDEX:[],LAYOUT:[],MLEADERSTYLE:[],SPATIAL_FILTER:[],XRECORD:[]},header:{},entities:[],classes:[]},e=this.libredwg;this.convertHeader(n,o.header),this.convertClasses(n,o.classes),this.entityConverter.setClasses(o.classes);const a=e.dwg_get_num_objects(n);for(let s=0;s<a;s++){const _=e.dwg_get_object(n,s);if(_){const d=this.safeObjectTio(_);if(d)switch(e.dwg_object_get_fixedtype(_)){case T.DWG_TYPE_LAYER:{const E=this.convertLayer(d,_);o.tables.LAYER.entries.push(E),this.entityConverter.layers.set(E.handle,E.name)}break;case T.DWG_TYPE_LTYPE:{const E=this.convertLineType(d,_);o.tables.LTYPE.entries.push(E),this.entityConverter.ltypes.set(E.handle,E.name)}break}}}for(let s=0;s<a;s++){const _=e.dwg_get_object(n,s);if(_){const d=this.safeObjectTio(_);if(d)switch(e.dwg_object_get_fixedtype(_)){case T.DWG_TYPE_APPID:o.tables.APPID.entries.push(this.convertAppId(d));break;case T.DWG_TYPE_BLOCK_HEADER:{const E=this.convertBlockRecord(d,_);o.tables.BLOCK_RECORD.entries.push(E),(Oe(E.name)||Qo(E.name))&&E.entities.forEach(u=>{o.entities.push(u),u.type==="INSERT"&&u.attribs.forEach(l=>{o.entities.push(l)})})}break;case T.DWG_TYPE_DIMSTYLE:o.tables.DIMSTYLE.entries.push(this.convertDimStyle(d,_));break;case T.DWG_TYPE_STYLE:o.tables.STYLE.entries.push(this.convertStyle(d,_));break;case T.DWG_TYPE_VPORT:o.tables.VPORT.entries.push(this.convertViewport(d,_));break;case T.DWG_TYPE_DICTIONARY:o.objects.DICTIONARY.push(this.convertDictionary(d,_));break;case T.DWG_TYPE_IMAGEDEF:o.objects.IMAGEDEF.push(this.convertImageDef(d,_));break;case T.DWG_TYPE_LAYERFILTER:o.objects.LAYER_FILTER.push(this.convertLayerFilter(d,_));break;case T.DWG_TYPE_LAYER_INDEX:o.objects.LAYER_INDEX.push(this.convertLayerIndex(d,_));break;case T.DWG_TYPE_LAYOUT:o.objects.LAYOUT.push(this.convertLayout(d,_));break;case T.DWG_TYPE_MLEADERSTYLE:o.objects.MLEADERSTYLE.push(this.convertMLeaderStyle(d,_));break;case T.DWG_TYPE_SPATIAL_FILTER:o.objects.SPATIAL_FILTER.push(this.convertSpatialFilter(d,_));break;case T.DWG_TYPE_XRECORD:o.objects.XRECORD.push(this.convertXRecord(d,_));break}}}const i=o.entities.filter(s=>s.type==="VIEWPORT");i.sort((s,_)=>{const d=parseInt(s.handle,16),c=parseInt(_.handle,16);return d-c}),i.forEach((s,_)=>{s.viewportId=_+1});const r=e.dwg_bmp(n);return r?.data?.length&&(o.thumbnailImage=r.data),o}getConversionStats(){return{unknownEntityCount:this.entityConverter.unknownEntityCount}}safeObjectTio(n){const o=this.libredwg;try{if(o.dwg_object_get_supertype(n)!=on.DWG_SUPERTYPE_OBJECT)return null;const e=o.dwg_object_to_object_tio(n);return e||null}catch{return null}}convertHeader(n,o){const e=this.libredwg;We.forEach(a=>{let i=a;(a=="DIMBLK"||a=="DIMBLK1"||a=="DIMBLK2")&&(i=i+"_T");let r=e.dwg_dynapi_header_data(n,i);a=="CELTYPE"||a=="CLAYER"||a=="CLAYER"||a=="DIMSTYLE"||a=="DIMTXSTY"||a=="TEXTSTYLE"?r=r?e.dwg_ref_get_object_name(r):"":a=="DRAGVS"&&(r=r?e.dwg_ref_get_absref(r)??2:2),o[a]=r})}convertClasses(n,o){const e=this.libredwg,a=e.dwg_get_num_classes(n);for(let i=0;i<a;i++){const r=e.dwg_get_class(n,i);o.push({dxfName:r.dxfname,cppName:r.cppname,appName:r.appname,capabilitiesFlag:r.proxyflag,instanceCount:r.num_instances,wasAProxyFlag:r.s_zombie,isAnEntityFlag:r.item_class_id===498})}}convertAppId(n){const o=this.libredwg,e=o.dwg_dynapi_entity_data(n,"name"),a=o.dwg_dynapi_entity_data(n,"flag");return{name:e,standardFlag:a}}convertBlockRecord(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_entity_block_header_get_block(n);i.name&&(a.name=i.name);const r=e.dwg_dynapi_entity_data(n,"num_owned"),s=e.dwg_dynapi_entity_data(n,"flag"),_=e.dwg_dynapi_entity_data(n,"description"),d=e.dwg_dynapi_entity_data(n,"base_pt"),c=e.dwg_dynapi_entity_data(n,"insert_units"),E=e.dwg_dynapi_entity_data(n,"explodable"),u=e.dwg_dynapi_entity_data(n,"block_scaling"),l=e.dwg_dynapi_entity_data(n,"layout"),I=e.dwg_ref_get_id(l)??"";let f;const A=e.dwg_entity_block_header_get_preview(n);A&&A.length>0&&(f=Lt(A));let h=this.convertEntities(o,a.handle);if(!h||h.length==0){h=[];const g=e.dwg_dynapi_entity_data(n,"entities");if(g){const p=e.dwg_ptr_to_object_ref_ptr_array(g,r),C=this.entityConverter;for(let L=0;L<r;L++){const R=e.dwg_ref_get_object(p[L]),D=C.convert(R);D&&(D.ownerBlockRecordSoftId=a.handle,h.push(D))}}}return{...a,flags:s,description:_,basePoint:d,layout:I,insertionUnits:c,explodability:E,scalability:u,bmpPreview:f,entities:h}}convertEntities(n,o){const e=this.libredwg,a=this.entityConverter,i=[];let r=e.get_first_owned_entity(n);for(;r;){const s=a.convert(r);s&&(s.ownerBlockRecordSoftId=o,i.push(s)),r=e.get_next_owned_entity(n,r)}return i}convertDimStyle(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_dynapi_entity_data(n,"DIMTOL"),r=e.dwg_dynapi_entity_data(n,"DIMLIM"),s=e.dwg_dynapi_entity_data(n,"DIMTIH"),_=e.dwg_dynapi_entity_data(n,"DIMTOH"),d=e.dwg_dynapi_entity_data(n,"DIMSE1"),c=e.dwg_dynapi_entity_data(n,"DIMSE2"),E=e.dwg_dynapi_entity_data(n,"DIMALT"),u=e.dwg_dynapi_entity_data(n,"DIMTOFL"),l=e.dwg_dynapi_entity_data(n,"DIMSAH"),I=e.dwg_dynapi_entity_data(n,"DIMTIX"),f=e.dwg_dynapi_entity_data(n,"DIMSOXD"),A=e.dwg_dynapi_entity_data(n,"DIMALTD"),h=e.dwg_dynapi_entity_data(n,"DIMZIN"),g=e.dwg_dynapi_entity_data(n,"DIMSD1"),p=e.dwg_dynapi_entity_data(n,"DIMSD2"),C=e.dwg_dynapi_entity_data(n,"DIMTOLJ"),L=e.dwg_dynapi_entity_data(n,"DIMJUST"),R=e.dwg_dynapi_entity_data(n,"DIMFIT"),D=e.dwg_dynapi_entity_data(n,"DIMUPT"),Y=e.dwg_dynapi_entity_data(n,"DIMTZIN"),U=e.dwg_dynapi_entity_data(n,"DIMALTZ"),H=e.dwg_dynapi_entity_data(n,"DIMALTTZ"),v=e.dwg_dynapi_entity_data(n,"DIMTAD"),B=e.dwg_dynapi_entity_data(n,"DIMUNIT"),V=e.dwg_dynapi_entity_data(n,"DIMAUNIT"),K=e.dwg_dynapi_entity_data(n,"DIMDEC"),tt=e.dwg_dynapi_entity_data(n,"DIMTDEC"),nt=e.dwg_dynapi_entity_data(n,"DIMALTU"),et=e.dwg_dynapi_entity_data(n,"DIMALTTD"),ot=e.dwg_dynapi_entity_data(n,"DIMSCALE"),q=e.dwg_dynapi_entity_data(n,"DIMASZ"),at=e.dwg_dynapi_entity_data(n,"DIMEXO"),z=e.dwg_dynapi_entity_data(n,"DIMDLI"),it=e.dwg_dynapi_entity_data(n,"DIMEXE"),At=e.dwg_dynapi_entity_data(n,"DIMRND"),ft=e.dwg_dynapi_entity_data(n,"DIMDLE"),It=e.dwg_dynapi_entity_data(n,"DIMTP"),ht=e.dwg_dynapi_entity_data(n,"DIMTM"),Tt=e.dwg_dynapi_entity_data(n,"DIMFXL"),Pt=e.dwg_dynapi_entity_data(n,"DIMJOGANG"),rt=e.dwg_dynapi_entity_data(n,"DIMTFILL"),gt=e.dwg_dynapi_entity_data(n,"DIMTFILLCLR"),pt=e.dwg_dynapi_entity_data(n,"DIMAZIN"),cn=e.dwg_dynapi_entity_data(n,"DIMARCSYM"),Ct=e.dwg_dynapi_entity_data(n,"DIMTXT"),G=e.dwg_dynapi_entity_data(n,"DIMCEN"),m=e.dwg_dynapi_entity_data(n,"DIMTSZ"),ln=e.dwg_dynapi_entity_data(n,"DIMALTF"),En=e.dwg_dynapi_entity_data(n,"DIMLFAC"),un=e.dwg_dynapi_entity_data(n,"DIMTVP"),An=e.dwg_dynapi_entity_data(n,"DIMTFAC"),fn=e.dwg_dynapi_entity_data(n,"DIMGAP"),In=e.dwg_dynapi_entity_data(n,"DIMPOST"),hn=e.dwg_dynapi_entity_data(n,"DIMAPOST"),Tn=e.dwg_dynapi_entity_data(n,"DIMBLK_T"),Pn=e.dwg_dynapi_entity_data(n,"DIMBLK1_T"),gn=e.dwg_dynapi_entity_data(n,"DIMBLK2_T"),Yt=e.dwg_dynapi_entity_data(n,"DIMALTRND"),Gt=e.dwg_dynapi_entity_data(n,"DIMCLRD_N"),pn=e.dwg_dynapi_entity_data(n,"DIMCLRE_N"),Cn=e.dwg_dynapi_entity_data(n,"DIMCLRT_N"),yn=e.dwg_dynapi_entity_data(n,"DIMCLRD"),Ln=e.dwg_dynapi_entity_data(n,"DIMCLRE"),Mt=e.dwg_dynapi_entity_data(n,"DIMCLRT"),Wt=e.dwg_dynapi_entity_data(n,"DIMADEC"),bt=e.dwg_dynapi_entity_data(n,"DIMFRAC"),wt=e.dwg_dynapi_entity_data(n,"DIMLUNIT"),Ot=e.dwg_dynapi_entity_data(n,"DIMDSEP"),vt=e.dwg_dynapi_entity_data(n,"DIMTMOVE"),Bt=e.dwg_dynapi_entity_data(n,"DIMATFIT"),kt=e.dwg_dynapi_entity_data(n,"DIMFXLON"),Ft=e.dwg_dynapi_entity_data(n,"DIMTXTDIRECTION"),Ut=e.dwg_dynapi_entity_data(n,"DIMALTMZF"),Ht=e.dwg_dynapi_entity_data(n,"DIMALTMZS"),Vt=e.dwg_dynapi_entity_data(n,"DIMMZF"),Xt=e.dwg_dynapi_entity_data(n,"DIMMZS"),Kt=e.dwg_dynapi_entity_data(n,"DIMLWD"),zt=e.dwg_dynapi_entity_data(n,"DIMLWE"),$t=e.dwg_dynapi_entity_data(n,"DIMTXSTY"),Jt=e.dwg_ref_get_absref($t)??void 0,Zt=e.dwg_dynapi_entity_data(n,"DIMLDRBLK"),qt=e.dwg_ref_get_absref(Zt)??void 0;return{...a,DIMPOST:In,DIMAPOST:hn,DIMBLK:Tn,DIMBLK1:Pn,DIMBLK2:gn,DIMSCALE:ot,DIMASZ:q,DIMEXO:at,DIMDLI:z,DIMEXE:it,DIMRND:At,DIMDLE:ft,DIMTP:It,DIMTM:ht,DIMTXT:Ct,DIMCEN:G,DIMTSZ:m,DIMALTF:ln,DIMLFAC:En,DIMTVP:un,DIMTFAC:An,DIMGAP:fn,DIMALTRND:Yt,DIMTOL:i,DIMLIM:r,DIMTIH:s,DIMTOH:_,DIMSE1:d,DIMSE2:c,DIMTAD:v,DIMZIN:h,DIMAZIN:pt,DIMALT:E,DIMALTD:A,DIMTOFL:u,DIMSAH:l,DIMTIX:I,DIMSOXD:f,DIMCLRD:yn,DIMCLRE:Ln,DIMCLRT:Mt,DIMADEC:Wt,DIMUNIT:B,DIMDEC:K,DIMTDEC:tt,DIMALTU:nt,DIMALTTD:et,DIMAUNIT:V,DIMFRAC:bt,DIMLUNIT:wt,DIMDSEP:String.fromCharCode(Ot),DIMTMOVE:vt,DIMJUST:L,DIMSD1:g,DIMSD2:p,DIMTOLJ:C,DIMTZIN:Y,DIMALTZ:U,DIMALTTZ:H,DIMFIT:R,DIMUPT:D,DIMATFIT:Bt,DIMTXSTY:Jt,DIMLDRBLK:qt,DIMLWD:Kt,DIMLWE:zt,DIMFXL:Tt,DIMJOGANG:Pt,DIMTFILL:rt,DIMTFILLCLR:gt,DIMARCSYM:cn,DIMCLRD_N:Gt,DIMCLRE_N:pn,DIMCLRT_N:Cn,DIMFXLON:kt,DIMTXTDIRECTION:Ft,DIMALTMZF:Ut,DIMALTMZS:Ht,DIMMZF:Vt,DIMMZS:Xt}}convertLayer(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"frozen"),s=e.dwg_dynapi_entity_data(n,"off"),_=e.dwg_dynapi_entity_data(n,"frozen_in_new"),d=e.dwg_dynapi_entity_data(n,"plotflockedlag"),c=e.dwg_dynapi_entity_data(n,"plotflag"),E=e.dwg_dynapi_entity_data(n,"linewt"),u=e.dwg_dynapi_entity_data(n,"color"),l=e.dwg_dynapi_entity_data(n,"ltype");let I="Continuous";if(l)try{I=e.dwg_ref_get_object_name(l)}catch{}const f=u.method;let A=256,h=16777215;return f===195||(u.rgb>>>24&255)===195?A=u.rgb&255:f==194||(u.rgb>>>24&255)===194?h=u.rgb&16777215:u.index>=1&&u.index<=255&&(A=u.index),{...a,standardFlag:i,colorIndex:A,color:h,colorName:u.name,transparency:u.alpha,lineType:I,frozen:r!=0,off:s!=0,frozenInNew:_!=0,locked:d!=0,plotFlag:c,lineweight:E,plotStyleNameObjectId:"",materialObjectId:""}}convertLineType(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"description"),s=e.dwg_dynapi_entity_data(n,"numdashes"),_=e.dwg_dynapi_entity_data(n,"pattern_len"),d=e.dwg_dynapi_entity_data(n,"dashes"),c=d?e.dwg_ptr_to_ltype_dash_array(d,s):[];return{...a,description:r,standardFlag:i,numberOfLineTypes:s,totalPatternLength:_,pattern:this.convertLineTypePattern(c)}}convertLineTypePattern(n){const o=[];return n.forEach(e=>{o.push({elementLength:e.length||0,elementTypeFlag:e.complex_shapecode,shapeNumber:e.shape_flag,styleObjectId:e.style?w(this.libredwg.dwg_ref_get_absref(e.style)):void 0,scale:e.scale,rotation:e.rotation,offsetX:e.x_offset,offsetY:e.y_offset,text:e.text})}),o}convertStyle(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"width_factor"),s=e.dwg_dynapi_entity_data(n,"oblique_angle"),_=e.dwg_dynapi_entity_data(n,"generation"),d=e.dwg_dynapi_entity_data(n,"last_height"),c=e.dwg_dynapi_entity_data(n,"font_file"),E=e.dwg_dynapi_entity_data(n,"bigfont_file");return{...a,standardFlag:i,fixedTextHeight:0,widthFactor:r,obliqueAngle:s,textGenerationFlag:_,lastHeight:d,font:c,bigFont:E}}convertViewport(n,o){const e=this.libredwg,a=this.getCommonTableEntryAttrs(n,o),i=e.dwg_dynapi_entity_data(n,"flag"),r=e.dwg_dynapi_entity_data(n,"VIEWSIZE"),s=e.dwg_dynapi_entity_data(n,"aspect_ratio"),_=e.dwg_dynapi_entity_data(n,"VIEWCTR"),d=e.dwg_dynapi_entity_data(n,"view_target"),c=e.dwg_dynapi_entity_data(n,"VIEWDIR"),E=e.dwg_dynapi_entity_data(n,"view_twist"),u=e.dwg_dynapi_entity_data(n,"lens_length"),l=e.dwg_dynapi_entity_data(n,"front_clip_z"),I=e.dwg_dynapi_entity_data(n,"back_clip_z"),f=e.dwg_dynapi_entity_data(n,"VIEWMODE"),A=e.dwg_dynapi_entity_data(n,"render_mode"),h=e.dwg_dynapi_entity_data(n,"use_default_lights")!=0,g=e.dwg_dynapi_entity_data(n,"default_lightning_type"),p=e.dwg_dynapi_entity_data(n,"brightness"),C=e.dwg_dynapi_entity_data(n,"contrast"),L=e.dwg_dynapi_entity_data(n,"ambient_color"),R=e.dwg_dynapi_entity_data(n,"lower_left"),D=e.dwg_dynapi_entity_data(n,"upper_right"),Y=e.dwg_dynapi_entity_data(n,"circle_zoom"),U=e.dwg_dynapi_entity_data(n,"UCSICON"),H=e.dwg_dynapi_entity_data(n,"GRIDUNIT"),v=e.dwg_dynapi_entity_data(n,"SNAPANG"),B=e.dwg_dynapi_entity_data(n,"SNAPBASE"),V=e.dwg_dynapi_entity_data(n,"SNAPUNIT"),K=e.dwg_dynapi_entity_data(n,"ucsorg"),tt=e.dwg_dynapi_entity_data(n,"ucsxdir"),nt=e.dwg_dynapi_entity_data(n,"ucsydir"),et=e.dwg_dynapi_entity_data(n,"ucs_elevation"),ot=e.dwg_dynapi_entity_data(n,"grid_major"),q=e.dwg_dynapi_entity_data(n,"background"),at=q?e.dwg_ref_get_id(q)??"":void 0,z=e.dwg_dynapi_entity_data(n,"visualstyle"),it=z?e.dwg_ref_get_id(z)??"":void 0;return{...a,standardFlag:i,lowerLeftCorner:R,upperRightCorner:D,center:_,snapBasePoint:B,snapSpacing:V,gridSpacing:H,viewDirectionFromTarget:c,viewTarget:d,lensLength:u,frontClippingPlane:l,backClippingPlane:I,viewHeight:r,aspectRatio:s,snapRotationAngle:v,viewTwistAngle:E,circleSides:Y,frozenLayers:[],styleSheet:"",renderMode:A,viewMode:f,ucsIconSetting:U,ucsOrigin:K,ucsXAxis:tt,ucsYAxis:nt,orthographicType:0,elevation:et,shadePlotSetting:0,majorGridLines:ot,backgroundObjectId:at,visualStyleObjectId:it,isDefaultLightingOn:h,defaultLightingType:g,brightness:p,contrast:C,ambientColor:L.index}}getCommonTableEntryAttrs(n,o){const e=this.libredwg,a=e.dwg_object_get_tio(o),i=e.dwg_object_object_get_ownerhandle_object(a),r=e.dwg_object_get_handle_object(o);return{handle:w(r.value),ownerHandle:w(i.absolute_ref),name:e.dwg_dynapi_entity_data(n,"name")}}convertDictionary(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"is_hardowner"),r=e.dwg_dynapi_entity_data(n,"cloning"),s=e.dwg_dynapi_entity_data(n,"numitems"),_=e.dwg_dynapi_entity_data(n,"itemhandles"),d=e.dwg_ptr_to_object_ref_array(_,s),c=e.dwg_object_dictionary_get_texts(o),E={};return d.forEach((u,l)=>E[c[l]]=w(u.absolute_ref)),{...a,isHardOwner:!!i,cloningFlag:r,entries:E}}convertImageDef(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"image_size"),r=e.dwg_dynapi_entity_data(n,"file_path"),s=e.dwg_dynapi_entity_data(n,"is_loaded"),_=e.dwg_dynapi_entity_data(n,"pixel_size"),d=e.dwg_dynapi_entity_data(n,"resunits");return{...a,fileName:r,size:i,sizeOfOnePixel:_,isLoaded:s,resolutionUnits:d}}convertLayerFilter(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"num_names")??0,r=e.dwg_dynapi_entity_data(n,"names"),s=r&&i>0?e.dwg_ptr_to_wchar_string_array(r,i).filter(_=>_!=null&&_!==""):[];return{...a,...s.length?{layerNames:s}:{}}}convertLayerIndex(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"last_updated"),r=e.dwg_dynapi_entity_data(n,"num_entries")??0,s=e.dwg_dynapi_entity_data(n,"entries"),_=e.dwg_dynapi_subclass_size("LAYER_entry"),d=[],c=[],E=[];if(s&&_>0)for(let u=0;u<r;u++){const l=s+u*_,I=e.dwg_dynapi_subclass_data(l,"LAYER_entry","name");d.push(I??"");const f=e.dwg_dynapi_subclass_data(l,"LAYER_entry","handle");c.push(f?e.dwg_ref_get_id(f)??"":""),E.push(e.dwg_dynapi_subclass_data(l,"LAYER_entry","numlayers")??0)}return{...a,...i!=null?{timeStamp:i}:{},...d.length?{layerNames:d}:{},...c.length?{idBufferIds:c}:{},...E.length?{idBufferEntryCounts:E}:{}}}convertLayout(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"layout_name"),r=e.dwg_dynapi_entity_data(n,"tab_order"),s=e.dwg_dynapi_entity_data(n,"layout_flags"),_=e.dwg_dynapi_entity_data(n,"INSBASE"),d=e.dwg_dynapi_entity_data(n,"LIMMIN"),c=e.dwg_dynapi_entity_data(n,"LIMMAX"),E=e.dwg_dynapi_entity_data(n,"UCSORG"),u=e.dwg_dynapi_entity_data(n,"UCSXDIR"),l=e.dwg_dynapi_entity_data(n,"UCSYDIR"),I=e.dwg_dynapi_entity_data(n,"UCSORTHOVIEW"),f=e.dwg_dynapi_entity_data(n,"EXTMIN"),A=e.dwg_dynapi_entity_data(n,"EXTMAX"),h=e.dwg_dynapi_entity_data(n,"ucs_elevation"),g=e.dwg_dynapi_entity_data(n,"block_header"),p=e.dwg_ref_get_id(g)??"",C=e.dwg_dynapi_entity_data(n,"active_viewport"),L=e.dwg_ref_get_id(C)??"",R=e.dwg_dynapi_entity_data(n,"named_ucs"),D=R?e.dwg_ref_get_id(R)??"":void 0;return{...a,layoutName:i,controlFlag:s,tabOrder:r,minLimit:d,maxLimit:c,insertionPoint:_,minExtent:f,maxExtent:A,elevation:h,ucsOrigin:E,ucsXAxis:u,ucsYAxis:l,orthographicType:I,paperSpaceTableId:p,viewportId:L,namedUcsId:D,shadePlotId:""}}convertMLeaderStyle(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=d=>e.dwg_dynapi_entity_data(n,d),r=d=>e.dwg_ref_get_id(d),s=d=>d>0,_=d=>d!=null?we(d):void 0;return{...a,subclassMarker:"AcDbMLeaderStyle",unknown1:i("class_version"),contentType:i("content_type"),drawMLeaderOrderType:i("mleader_order"),drawLeaderOrderType:i("leader_order"),maxLeaderSegmentPoints:i("max_points"),firstSegmentAngleConstraint:i("first_seg_angle"),secondSegmentAngleConstraint:i("second_seg_angle"),leaderLineType:i("type"),leaderLineColor:_(i("line_color")),leaderLineTypeId:r(i("line_type")),leaderLineWeight:i("linewt"),landingEnabled:s(i("has_landing")),landingGap:i("landing_gap"),doglegEnabled:s(i("has_dogleg")),doglegLength:i("landing_dist"),description:i("description"),arrowheadId:r(i("arrow_head")),arrowheadSize:i("arrow_head_size"),defaultMTextContents:i("text_default"),textStyleId:r(i("text_style")),textLeftAttachmentType:i("attach_left"),textAngleType:i("text_angle_type"),textAlignmentType:i("text_align_type"),textRightAttachmentType:i("attach_right"),textColor:_(i("text_color")),textHeight:i("text_height"),textFrameEnabled:s(i("has_text_frame")),textAlignAlwaysLeft:s(i("text_always_left")),alignSpace:i("align_space"),blockContentId:r(i("block")),blockContentColor:_(i("block_color")),blockContentScale:i("block_scale"),blockContentScaleEnabled:s(i("use_block_scale")),blockContentRotation:i("block_rotation"),blockContentRotationEnabled:s(i("use_block_rotation")),blockContentConnectionType:i("block_connection"),scale:i("scale"),overwritePropertyValue:s(i("is_changed")),annotative:s(i("is_annotative")),breakGapSize:i("break_size"),textAttachmentDirection:i("attach_dir"),bottomTextAttachmentDirection:i("attach_bottom"),topTextAttachmentDirection:i("attach_top"),unknown2:s(i("text_extended"))}}convertSpatialFilter(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"origin"),r=e.dwg_dynapi_entity_data(n,"num_clip_verts"),s=e.dwg_dynapi_entity_data(n,"clip_verts"),_=e.dwg_ptr_to_point2d_array(s,r),d=e.dwg_dynapi_entity_data(n,"extrusion"),c=e.dwg_dynapi_entity_data(n,"display_boundary_on"),E=e.dwg_dynapi_entity_data(n,"front_clip_on"),u=e.dwg_dynapi_entity_data(n,"front_clip_z"),l=e.dwg_dynapi_entity_data(n,"back_clip_on"),I=e.dwg_dynapi_entity_data(n,"back_clip_z"),f=e.dwg_dynapi_entity_data(n,"transform"),A=e.dwg_ptr_to_double_array(f,12),h=e.dwg_dynapi_entity_data(n,"inverse_transform"),g=e.dwg_ptr_to_double_array(h,12);return{...a,origin:i,numberOfPointsOnClipBoundary:r,vertices:_,extrusionDirection:d,clipBoundaryVisible:!!c,frontClippingPlaneFlag:!!E,frontClippingPlaneDistance:u,backClippingPlaneFlag:!!l,backClippingPlaneDistance:I,matrix:A,invertBlockMatrix:g}}convertXRecord(n,o){const e=this.libredwg,a=this.getCommonObjectAttrs(o),i=e.dwg_dynapi_entity_data(n,"cloning"),r=e.dwg_object_xrecord_get_xdata(n)??[],s=e.dwg_object_get_tio(o),_=s?e.dwg_object_object_get_xdicobjhandle_object(s):null,d=_&&_.absolute_ref?w(_.absolute_ref):void 0;return{...a,...i!=null?{cloning:i}:{},...d?{extensionDictionary:d}:{},data:r}}getCommonObjectAttrs(n){const o=this.libredwg,e=o.dwg_object_get_tio(n),a=o.dwg_object_object_get_ownerhandle_object(e),i=o.dwg_object_get_handle_object(n);return{handle:w(i.value),ownerHandle:w(a.absolute_ref)}}}class k{constructor(){M(this,"min");M(this,"max");M(this,"valid");this.min={x:1/0,y:1/0},this.max={x:-1/0,y:-1/0},this.valid=!1}expandByPoint(n){return this.min.x=Math.min(this.min.x,n.x),this.min.y=Math.min(this.min.y,n.y),this.max.x=Math.max(this.max.x,n.x),this.max.y=Math.max(this.max.y,n.y),this.valid=!0,this}transform(n,o){const e=this.getCorners().map(a=>({x:a.x*n.x+o.x,y:a.y*n.y+o.y}));this.reset();for(const a of e)this.expandByPoint(a);return this}rotate(n,o){const e=Math.cos(n),a=Math.sin(n),i=this.getCorners().map(r=>{const s=r.x-o.x,_=r.y-o.y;return{x:o.x+s*e-_*a,y:o.y+s*a+_*e}});this.reset();for(const r of i)this.expandByPoint(r);return this}clone(){const n=new k;return n.min={x:this.min.x,y:this.min.y},n.max={x:this.max.x,y:this.max.y},n.valid=this.valid,n}reset(){this.min={x:1/0,y:1/0},this.max={x:-1/0,y:-1/0},this.valid=!1}getCorners(){return[{x:this.min.x,y:this.min.y},{x:this.min.x,y:this.max.y},{x:this.max.x,y:this.min.y},{x:this.max.x,y:this.max.y}]}}function na(t,n,o,e,a){const i=o.length;if(i===0)throw new Error("points must not be empty");const r=o[0].length;if(t<0||t>1)throw new Error(`t out of bounds [0,1]: ${t}`);if(n<1)throw new Error("degree must be at least 1 (linear)");if(n>i-1)throw new Error("degree must be less than or equal to point count - 1");const s=a??new Array(i).fill(1),_=e??(()=>{const f=[];for(let A=0;A<i+n+1;A++)f.push(A);return f})();if(_.length!==i+n+1)throw new Error("bad knot vector length");const d=[n,_.length-1-n],c=_[d[0]],E=_[d[1]];t=t*(E-c)+c,t=Math.max(t,c),t=Math.min(t,E);let u=d[0];for(;u<d[1]&&!(t>=_[u]&&t<=_[u+1]);u++);const l=new Array(i);for(let f=0;f<i;f++){l[f]=new Array(r+1);for(let A=0;A<r;A++)l[f][A]=o[f][A]*s[f];l[f][r]=s[f]}for(let f=1;f<=n+1;f++)for(let A=u;A>u-n-1+f;A--){const h=_[A+n+1-f]-_[A],g=h===0?0:(t-_[A])/h;for(let p=0;p<r+1;p++)l[A][p]=(1-g)*l[A-1][p]+g*l[A][p]}const I=new Array(r);for(let f=0;f<r;f++)I[f]=ea(l[u][f]/l[u][r],-9);return I}function ea(t,n){if(isNaN(t)||!Number.isInteger(n))return NaN;const[o,e="0"]=t.toString().split("e"),a=Math.round(+`${o}e${+e-n}`),[i,r="0"]=a.toString().split("e");return+`${i}e${+r+n}`}const tn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Mn=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];function yt(t,n,o){return Math.max(n,Math.min(o,t))}const sn=class sn{constructor(){M(this,"_colorIndex");M(this,"_color");M(this,"_colorName");this._colorIndex=256,this._color=null,this._colorName=null}get color(){return this._color}set color(n){n==null?this._color=null:(this._color=Math.round(yt(n,0,256*256*256-1)),this._colorIndex=this.getColorIndexByValue(this._color),this._colorName=this.getColorNameByValue(this._color))}get hexColor(){if(this._color&&this._color>0&&this._color<=16777215){let n=this._color.toString(16).toUpperCase();for(;n.length<6;)n="0"+n;return`0x${n}`}return""}get cssColor(){return`rgb(${this.red},${this.green},${this.blue})`}get red(){return this.color!=null?this.color>>16&255:null}get green(){return this.color!=null?this.color>>8&255:null}get blue(){return this.color!=null?this.color&255:null}get colorIndex(){return this._colorIndex}set colorIndex(n){n==null?this._colorIndex=null:(this._colorIndex=yt(n,0,256),this._color=Mn[n],this._colorName=this.getColorNameByValue(this._color))}get colorName(){return this._colorName}set colorName(n){if(n){const o=tn[n.toLowerCase()];o!==void 0?(this._colorName=n,this._color=o,this._colorIndex=this.getColorIndexByValue(this._color)):console.warn("Unknown color: "+n)}else this._colorName=null}get hasColorName(){return this._colorName==null}get hasColorIndex(){return this._colorIndex==null}get isByLayer(){return this.colorIndex==256}setByLayer(){return this.colorIndex=256,this}get isByBlock(){return this.colorIndex==0}setByBlock(){return this.colorIndex=0,this}setScalar(n){return this.setRGB(n,n,n),this}setRGB(n,o,e){const a=Math.round(yt(n,0,255)),i=Math.round(yt(o,0,255)),r=Math.round(yt(e,0,255));return this.color=(a<<16)+(i<<8)+r,this}setColorName(n){const o=tn[n.toLowerCase()];return o!==void 0?this.color=o:console.warn("Unknown color "+n),this}clone(){const n=new sn;return n.colorIndex=this.colorIndex,n.color=this.color,n._colorName=this._colorName,this}copy(n){return this.colorIndex=n.colorIndex,this.color=n.color,this._colorName=n._colorName,this}equals(n){return n.color==this.color&&n.colorIndex==this.colorIndex&&n._colorName==this._colorName}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this.colorName?this.colorName:this.hexColor}getColorNameByValue(n){for(const[o,e]of Object.entries(tn))if(e===n)return o;return null}getColorIndexByValue(n){const o=Mn.length-1;for(let e=1;e<o;++e)if(Mn[e]===n)return e;return null}};M(sn,"NAMES",tn);let te=sn;class F{constructor(n,o){M(this,"x");M(this,"y");this.x=n,this.y=o}add(n){return new F(this.x+n.x,this.y+n.y)}sub(n){return new F(this.x-n.x,this.y-n.y)}multiply(n){return new F(this.x*n,this.y*n)}length(){return Math.sqrt(this.x**2+this.y**2)}norm(){const n=this.length();return n===0?new F(0,0):new F(this.x/n,this.y/n)}}function oa(t,n,o,e=5){let a,i,r;o<0?(a=Math.atan(-o)*4,i=new F(t.x,t.y),r=new F(n.x,n.y)):(a=Math.atan(o)*4,i=new F(n.x,n.y),r=new F(t.x,t.y));const s=r.sub(i),_=s.length(),d=i.add(s.multiply(.5)),c=Math.abs(_/2/Math.tan(a/2)),E=s.norm(),u=new F(E.x*Math.cos(Math.PI/2)-E.y*Math.sin(Math.PI/2),E.y*Math.cos(Math.PI/2)+E.x*Math.sin(Math.PI/2)),l=a<Math.PI?d.add(u.multiply(-c)):d.add(u.multiply(c)),I=Math.atan2(r.y-l.y,r.x-l.x)/Math.PI*180;let f=Math.atan2(i.y-l.y,i.x-l.x)/Math.PI*180;f<I&&(f+=360);const A=r.sub(l).length(),h=Math.floor(I/e)*e+e,g=Math.ceil(f/e)*e-e,p=[];for(let C=h;C<=g;C+=e){const L=C/180*Math.PI,R=l.add(new F(Math.cos(L)*A,Math.sin(L)*A));p.push(R)}return o<0&&p.reverse(),p}function aa(t,n=!1){let o=[];const e=t.vertices.map(a=>({x:a.x,y:a.y,bulge:a.bulge}));n&&e.push(e[0]);for(let a=0,i=e.length;a<i-1;++a){const r=e[a],s=e[a+1];o.push(r),e[a].bulge&&(o=o.concat(oa(r,s,t.vertices[a].bulge))),a===i-2&&o.push(s)}return o}class ia{constructor(){M(this,"blockMap",new Map)}rotate(n,o){const e=Math.cos(o),a=Math.sin(o);return{x:n.x*e-n.y*a,y:n.x*a+n.y*e}}interpolateBSpline(n,o,e,a=25,i){const r=[],s=n.map(c=>[c.x,c.y]),_=[e[o]],d=[e[o],e[e.length-1-o]];for(let c=o+1;c<e.length-o;++c)_[_.length-1]!==e[c]&&_.push(e[c]);for(let c=1;c<_.length;++c){const E=_[c-1],u=_[c];for(let l=0;l<=a;++l){let f=(l/a*(u-E)+E-d[0])/(d[1]-d[0]);f=Math.max(0,Math.min(1,f));const A=na(f,o,s,e,i);r.push({x:A[0],y:A[1]})}}return r}addFlipXIfApplicable(n,{bbox:o,element:e}){return"extrusionDirection"in n&&n.extrusionDirection.z===-1?{bbox:new k().expandByPoint({x:-o.min.x,y:o.min.y}).expandByPoint({x:-o.max.x,y:o.max.y}),element:`<g transform="matrix(-1 0 0 1 0 0)">${e}</g>`}:{bbox:o,element:e}}line(n){const o=new k().expandByPoint({x:n.startPoint.x,y:n.startPoint.y}).expandByPoint({x:n.endPoint.x,y:n.endPoint.y}),e=`<line x1="${n.startPoint.x}" y1="${n.startPoint.y}" x2="${n.endPoint.x}" y2="${n.endPoint.y}" />`;return{bbox:o,element:e}}ray(n){const e=n.firstPoint,a={x:e.x+n.unitDirection.x*1e4,y:e.y+n.unitDirection.y*1e4},i=new k().expandByPoint(e).expandByPoint(a),r=`<line x1="${e.x}" y1="${e.y}" x2="${a.x}" y2="${a.y}" />`;return{bbox:i,element:r}}xline(n){const e={x:n.firstPoint.x-n.unitDirection.x*1e4,y:n.firstPoint.y-n.unitDirection.y*1e4},a={x:n.firstPoint.x+n.unitDirection.x*1e4,y:n.firstPoint.y+n.unitDirection.y*1e4},i=new k().expandByPoint(e).expandByPoint(a),r=`<line x1="${e.x}" y1="${e.y}" x2="${a.x}" y2="${a.y}" />`;return{bbox:i,element:r}}extractMTextLines(n){return n.replace(/\\U\+([0-9A-Fa-f]{4})/g,(o,e)=>String.fromCharCode(parseInt(e,16))).replace(/\\P/g,`
|
||
`).replace(/\\[LOlo]/g,"").replace(/\\[Ff][^;\\]*?(?:\|[^;\\]*)*;/g,"").replace(/\\[KkCcHhWwTtAa][^;\\]*;?/g,"").replace(/\\[a-zA-Z]+;?/g,"").replace(/%%(d|p|c|%)/gi,"").replace(/\\\\/g,"\\").replace(/\\~/g," ").replace(/[{}]/g,"").split(`
|
||
`).map(o=>o.trim()).filter(o=>o.length>0)}lines(n,o,e,a,i="start"){const r=new k().expandByPoint({x:e.x,y:e.y}).expandByPoint({x:e.x+a,y:e.y-n.length*o*1.5}),s=n.map((_,d)=>{const c=e.x,E=e.y-d*o*1.5,u=`translate(${c},${E}) scale(1,-1) translate(${-c},${-E})`;return`<text x="${c}" y="${E}" font-size="${o}" text-anchor="${i}" transform="${u}">${_}</text>`});return{bbox:r,element:s.join(`
|
||
`)}}mtext(n){const o=n.textHeight,e=n.insertionPoint,a=this.extractMTextLines(n.text),i=n.attachmentPoint;let r="start";return i==J.BottomCenter||i==J.MiddleCenter||i==J.TopCenter?r="middle":(i==J.BottomRight||i==J.MiddleRight||i==J.TopRight)&&(r="end"),this.lines(a,o,e,n.extentsWidth,r)}table(n){const{rowCount:o,columnCount:e,rowHeightArr:a,columnWidthArr:i,startPoint:r,cells:s}=n,_=r.x,d=r.y,c=[];for(let A=0,h=d;A<o;A++){const g=a[A];let p=_;for(let C=0;C<e;C++){const L=A*e+C,R=s[L],D=i[C];c.push({x:p,y:h,width:D,height:g,cell:R,row:A,col:C}),p+=D}h+=g}const E=c.map(({x:A,y:h,width:g,height:p,cell:C})=>{const L=[];C.topBorderVisibility&&L.push(`<line x1="${A}" y1="${h}" x2="${A+g}" y2="${h}" stroke="black" />`),C.bottomBorderVisibility&&L.push(`<line x1="${A}" y1="${h+p}" x2="${A+g}" y2="${h+p}" stroke="black" />`),C.leftBorderVisibility&&L.push(`<line x1="${A}" y1="${h}" x2="${A}" y2="${h+p}" stroke="black" />`),C.rightBorderVisibility&&L.push(`<line x1="${A+g}" y1="${h}" x2="${A+g}" y2="${h+p}" stroke="black" />`);const R=A+g/2,D=h+p/2+C.textHeight/3,Y=`<text x="${R}" y="${D}" font-size="${C.textHeight}" text-anchor="middle" dominant-baseline="middle">${C.text}</text>`;return[...L,Y].join(`
|
||
`)}).join(`
|
||
`),u=i.reduce((A,h)=>A+h,0),l=a.reduce((A,h)=>A+h,0),I=new k().expandByPoint({x:_,y:d}).expandByPoint({x:_+u,y:d+l}),f=`
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${l}" viewBox="${_} ${d} ${u} ${l}">
|
||
${E}
|
||
</svg>
|
||
`.trim();return{bbox:I,element:f}}text(n){const o=n.textHeight,e=n.startPoint,a=[n.text];let i=n.endPoint.x-n.endPoint.x;n.halign==0&&(i=n.text.length*o+n.startPoint.x);let r="start";return n.halign==Dt.CENTER?r="middle":n.halign==Dt.RIGHT&&(r="end"),this.lines(a,o,e,i,r)}vertices(n,o=!1){const e=n.reduce((i,r)=>i.expandByPoint(r),new k);let a=n.reduce((i,r,s)=>(i+=s===0?"M":"L",i+=r.x+","+r.y,i),"");return o&&(a+="Z"),{bbox:e,element:`<path d="${a}" />`}}circle(n){const o=new k().expandByPoint({x:n.center.x+n.radius,y:n.center.y+n.radius}).expandByPoint({x:n.center.x-n.radius,y:n.center.y-n.radius}),e=`<circle cx="${n.center.x}" cy="${n.center.y}" r="${n.radius}" />`;return{bbox:o,element:e}}ellipseOrArc(n,o,e,a,i,r,s){const _=Math.sqrt(e*e+a*a),d=i*_,c=-Math.atan2(-a,e),E=this.bboxEllipseOrArc(n,o,e,a,i,r,s);if(Math.abs(r-s)<1e-9||Math.abs(r-s+Math.PI*2)<1e-9){const u=`<g transform="rotate(${c/Math.PI*180} ${n}, ${o})"><ellipse cx="${n}" cy="${o}" rx="${_}" ry="${d}" /></g>`;return{bbox:E,element:u}}else{const u=this.rotate({x:Math.cos(r)*_,y:Math.sin(r)*d},c),l={x:n+u.x,y:o+u.y},I=this.rotate({x:Math.cos(s)*_,y:Math.sin(s)*d},c),f={x:n+I.x,y:o+I.y},h=(s<r?s+Math.PI*2:s)-r<Math.PI?0:1,p=`<path d="${`M ${l.x} ${l.y} A ${_} ${d} ${c/Math.PI*180} ${h} 1 ${f.x} ${f.y}`}" />`;return{bbox:E,element:p}}}bboxEllipseOrArc(n,o,e,a,i,r,s){for(;r<0;)r+=Math.PI*2;for(;s<=r;)s+=Math.PI*2;const _=[];if(Math.abs(e)<1e-12||Math.abs(a)<1e-12)for(let l=0;l<4;l++)_.push(l/2*Math.PI);else _[0]=Math.atan(-a*i/e)-Math.PI,_[1]=Math.atan(e*i/a)-Math.PI,_[2]=_[0]-Math.PI,_[3]=_[1]-Math.PI;for(let l=4;l>=0;l--){for(;_[l]<r;)_[l]+=Math.PI*2;_[l]>s&&_.splice(l,1)}_.push(r),_.push(s);const d=_.map(l=>({x:Math.cos(l),y:Math.sin(l)})),c=[[e,-a*i],[a,e*i]];return d.map(l=>({x:l.x*c[0][0]+l.y*c[0][1]+n,y:l.x*c[1][0]+l.y*c[1][1]+o})).reduce((l,I)=>(l.expandByPoint(I),l),new k)}ellipse(n){const{bbox:o,element:e}=this.ellipseOrArc(n.center.x,n.center.y,n.majorAxisEndPoint.x,n.majorAxisEndPoint.y,n.axisRatio,n.startAngle,n.endAngle);return{bbox:o,element:e}}arc(n){const{bbox:o,element:e}=this.ellipseOrArc(n.center.x,n.center.y,n.radius,0,1,n.startAngle,n.endAngle);return{bbox:o,element:e}}dimension(n){const o=this.blockMap.get(n.name);return o?{bbox:o.bbox,element:`<use href="#${n.name}" />`}:null}insert(n){const o=this.blockMap.get(n.name);if(o){const e=n.insertionPoint,a=n.rotation*(180/Math.PI),i=`translate(${e.x},${e.y}) rotate(${a}) scale(${n.xScale},${n.yScale})`;return{bbox:o.bbox.clone().transform({x:n.xScale,y:n.yScale},{x:e.x,y:e.y}).rotate(n.rotation,e),element:`<use href="#${n.name}" transform="${i}" />`}}return null}block(n,o){const e=n.entities,{bbox:a,elements:i}=e.reduce((r,s)=>{const _=this.entityToBoundsAndElement(s);if(_){const{bbox:d,element:c}=_;d.valid&&(r.bbox.expandByPoint(d.min),r.bbox.expandByPoint(d.max));const E=this.getEntityColor(o.tables.LAYER.entries,s),u=s.type=="TEXT"||s.type=="MTEXT"?E.cssColor:"none";E.isByBlock?r.elements.push(`<g id="${s.handle}">${c}</g>`):r.elements.push(`<g id="${s.handle}" stroke="${E.cssColor}" fill="${u}">${c}</g>`)}return r},{bbox:new k,elements:[]});return a.valid?{bbox:a,element:`<g id="${n.name}">${i.join(`
|
||
`)}</g>`}:null}entityToBoundsAndElement(n){let o=null;switch(n.type){case"ARC":o=this.arc(n);break;case"CIRCLE":o=this.circle(n);break;case"DIMENSION":o=this.dimension(n);break;case"ELLIPSE":o=this.ellipse(n);break;case"INSERT":o=this.insert(n);break;case"LINE":o=this.line(n);break;case"LWPOLYLINE":{const e=n,a=!!(e.flag&512),i=aa(e,a);o=this.vertices(i,a);break}case"MTEXT":o=this.mtext(n);break;case"SPLINE":{const e=n;o=this.vertices(this.interpolateBSpline(e.controlPoints,e.degree,e.knots,25,e.weights));break}case"POLYLINE":break;case"RAY":o=this.ray(n);break;case"TABLE":case"ACAD_TABLE":o=this.table(n);break;case"TEXT":o=this.text(n);break;case"XLINE":o=this.xline(n);break;default:o=null;break}return o?this.addFlipXIfApplicable(n,o):null}getEntityColor(n,o){const e=new te;if(o.colorIndex!=null?e.colorIndex=o.colorIndex:o.colorName?e.colorName=o.colorName:o.color!=null&&(e.color=o.color),e.colorIndex==7&&(e.colorIndex=256),e.isByLayer){const a=n.find(i=>i.name===o.layer);a!=null&&(e.colorIndex=a.colorIndex)}return e.color==null&&(e.color=16777215),e}convert(n){let o=null;this.blockMap.clear();let e="";n.tables.BLOCK_RECORD.entries.forEach(r=>{if(Oe(r.name))o=r;else{const s=this.block(r,n);s&&(e+=s.element,this.blockMap.set(r.name,s))}});const a=this.block(o,n),i=a&&a.bbox.valid?{x:a.bbox.min.x,y:-a.bbox.max.y,width:a.bbox.max.x-a.bbox.min.x,height:a.bbox.max.y-a.bbox.min.y}:{x:0,y:0,width:0,height:0};return`<?xml version="1.0"?>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
|
||
preserveAspectRatio="xMinYMin meet"
|
||
viewBox="${i.x} ${i.y} ${i.width} ${i.height}"
|
||
width="100%" height="100%"
|
||
>
|
||
<defs>${e}</defs>
|
||
<g stroke="#000000" stroke-width="0.1%" fill="none" transform="matrix(1,0,0,-1,0,0)">
|
||
${a?a.element:""}
|
||
</g>
|
||
</svg>`}}var ne;(function(t){t[t.BMP=2]="BMP",t[t.WMF=3]="WMF",t[t.PNG=6]="PNG"})(ne||(ne={}));const _n=class _n{constructor(n){M(this,"wasmInstance");M(this,"decoder");return this.wasmInstance=n,new Proxy(this,{get:(o,e,a)=>e in o?Reflect.get(o,e,a):Reflect.get(o.wasmInstance,e,a)})}dwg_read_data(n,o){if(o==rn.DWG){const e="tmp.dwg";try{this.wasmInstance.FS.writeFile(e,new Uint8Array(n));const a=this.wasmInstance.dwg_read_file(e);if(a.error&an.OUTOFMEM)throw this.wasmInstance.dwg_abandon(a.data),new Error("Failed to decode DWG: out of WASM memory. Rebuild with pnpm build:wasm (INITIAL_MEMORY=1GB) or use a smaller file.");return a.error!=0&&console.warn("Open dwg file with error code:",a.error),a.data}finally{this.wasmInstance.FS.analyzePath(e,!1).exists&&this.wasmInstance.FS.unlink(e)}}}dwg_write_dxf(n){const o="tmp.dwg",e="tmp.dxf";try{this.wasmInstance.FS.writeFile(o,new Uint8Array(n));const a=this.wasmInstance.dwg_write_dxf(o,e);return a!=0?(console.log("Convert dwg to dxf with error code: ",a),null):this.wasmInstance.FS.readFile(e)}finally{this.wasmInstance.FS.analyzePath(o,!1).exists&&this.wasmInstance.FS.unlink(o),this.wasmInstance.FS.analyzePath(e,!1).exists&&this.wasmInstance.FS.unlink(e)}}dwg_get_version_type(n){const o=this.wasmInstance.dwg_get_version_type(n);return be[o]}dwg_get_codepage(n){return this.wasmInstance.dwg_get_codepage(n)}dwg_bmp(n){return this.wasmInstance.dwg_bmp(n)}dwg_get_num_classes(n){return this.wasmInstance.dwg_get_num_classes(n)}dwg_get_class(n,o){return this.wasmInstance.dwg_get_class(n,o)}convert(n){const o=this.dwg_get_codepage(n),e=bn(o);return this.decoder=new TextDecoder(e),new ye(this).convert(n)}convertEx(n){const o=this.dwg_get_codepage(n),e=bn(o);this.decoder=new TextDecoder(e);const a=new ye(this);return{database:a.convert(n),stats:a.getConversionStats()}}dwg_to_svg(n){return new ia().convert(n)}dwg_free(n){if(n)try{this.wasmInstance.dwg_free(n)}catch{try{this.wasmInstance.dwg_abandon(n)}catch{}}}dwg_free_object(n){this.wasmInstance.dwg_free_object(n)}dwg_ref_object(n,o){return this.wasmInstance.dwg_ref_object(n,o)}dwg_ref_object_silent(n,o){return this.wasmInstance.dwg_ref_object_silent(n,o)}dwg_ref_object_relative(n,o,e){return this.wasmInstance.dwg_ref_object_relative(n,o,e)}dwg_resolve_handle(n,o){return this.wasmInstance.dwg_resolve_handle(n,o)}dwg_resolve_handle_silent(n,o){return this.wasmInstance.dwg_resolve_handle_silent(n,o)}dwg_resolve_handleref(n,o){return this.wasmInstance.dwg_resolve_handleref(n,o)}dwg_ref_get_absref(n){if(!n)return null;const o=this.wasmInstance.dwg_ref_get_absref(n);return o===0?null:o}dwg_ref_get_handle_value(n){if(!n)return null;const o=this.wasmInstance.dwg_ref_get_handle_value(n);return o===0n?null:o}dwg_ref_get_handle_absolute_ref(n){if(!n)return null;const o=this.wasmInstance.dwg_ref_get_handle_absolute_ref(n);return o===0n?null:o}dwg_obj_get_handle_value(n){if(!n)return null;const o=this.wasmInstance.dwg_obj_get_handle_value(n);return o===0n?null:o}dwg_ref_get_id(n){const o=this.dwg_ref_get_absref(n);return o?.toString(16).toUpperCase()}dwg_ref_get_object_name(n){const o=this.wasmInstance,e=o.dwg_ref_get_object(n),a=o.dwg_object_to_object_tio(e);return this.dwg_dynapi_entity_data(a,"name")}dwg_obj_obj_to_object(n){return this.wasmInstance.dwg_obj_obj_to_object(n)}dwg_obj_generic_to_object(n){return this.wasmInstance.dwg_obj_generic_to_object(n)}dwg_object_to_object(n){return this.wasmInstance.dwg_object_to_object(n)}dwg_object_to_object_tio(n){return this.wasmInstance.dwg_object_to_object_tio(n)}dwg_object_to_entity(n){return this.wasmInstance.dwg_object_to_entity(n)}dwg_object_to_entity_tio(n){return this.wasmInstance.dwg_object_to_entity_tio(n)}dwg_getall_entities_in_model_space(n){const o=this.wasmInstance,e=o.dwg_model_space_object(n),a=[];let i=o.get_first_owned_entity(e);for(;i;)a.push(i),i=o.get_next_owned_entity(e,i);return a}dwg_getall_object_by_type(n,o){const e=this.wasmInstance,a=e.dwg_get_num_objects(n),i=[];for(let r=0;r<a;r++){const s=e.dwg_get_object(n,r),_=e.dwg_object_to_object_tio(s);_&&e.dwg_object_get_fixedtype(s)==o&&i.push(_)}return i}dwg_getall_entity_by_type(n,o){const e=this.wasmInstance,a=e.dwg_get_num_objects(n),i=[];for(let r=0;r<a;r++){const s=e.dwg_get_object(n,r),_=e.dwg_object_to_entity_tio(s);_&&e.dwg_object_get_fixedtype(s)==o&&i.push(_)}return i}dwg_getall_LAYER(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_LAYER)}dwg_getall_LTYPE(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_LTYPE)}dwg_getall_STYLE(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_STYLE)}dwg_getall_DIMSTYLE(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_DIMSTYLE)}dwg_getall_VPORT(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_VPORT)}dwg_getall_LAYOUT(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_LAYOUT)}dwg_getall_BLOCK(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_BLOCK)}dwg_getall_BLOCK_HEADER(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_BLOCK_HEADER)}dwg_getall_IMAGEDEF(n){return this.dwg_getall_object_by_type(n,T.DWG_TYPE_IMAGEDEF)}dwg_getall_VERTEX_2D(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_VERTEX_2D)}dwg_getall_VERTEX_3D(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_VERTEX_3D)}dwg_getall_POLYLINE_2D(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_POLYLINE_2D)}dwg_getall_POLYLINE_3D(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_POLYLINE_3D)}dwg_getall_IMAGE(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_IMAGE)}dwg_getall_LWPOLYLINE(n){return this.dwg_getall_entity_by_type(n,T.DWG_TYPE_LWPOLYLINE)}dwg_ptr_to_object_ref_array(n,o){return this.wasmInstance.dwg_ptr_to_object_ref_array(n,o)}dwg_ptr_to_object_ref_ptr_array(n,o){return this.wasmInstance.dwg_ptr_to_object_ref_ptr_array(n,o)}dwg_ptr_to_wchar_string_array(n,o){return this.wasmInstance.dwg_ptr_to_wchar_string_array(n,o)}dwg_ptr_to_unsigned_char_array(n,o){return this.wasmInstance.dwg_ptr_to_unsigned_char_array(n,o)}dwg_ptr_to_signed_char_array(n,o){return this.wasmInstance.dwg_ptr_to_signed_char_array(n,o)}dwg_ptr_to_uint16_t_array(n,o){return this.wasmInstance.dwg_ptr_to_uint16_t_array(n,o)}dwg_ptr_to_int16_t_array(n,o){return this.wasmInstance.dwg_ptr_to_int16_t_array(n,o)}dwg_ptr_to_uint32_t_array(n,o){return this.wasmInstance.dwg_ptr_to_uint32_t_array(n,o)}dwg_ptr_to_int32_t_array(n,o){return this.wasmInstance.dwg_ptr_to_int32_t_array(n,o)}dwg_ptr_to_uint64_t_array(n,o){return this.wasmInstance.dwg_ptr_to_uint64_t_array(n,o)}dwg_ptr_to_int64_t_array(n,o){return this.wasmInstance.dwg_ptr_to_int64_t_array(n,o)}dwg_ptr_to_double_array(n,o){return this.wasmInstance.dwg_ptr_to_double_array(n,o)}dwg_ptr_to_point2d_array(n,o){return this.wasmInstance.dwg_ptr_to_point2d_array(n,o)}dwg_ptr_to_point3d_array(n,o){return this.wasmInstance.dwg_ptr_to_point3d_array(n,o)}dwg_ptr_to_point4d_array(n,o){return this.wasmInstance.dwg_ptr_to_point4d_array(n,o)}dwg_ptr_to_ltype_dash_array(n,o){return this.wasmInstance.dwg_ptr_to_ltype_dash_array(n,o)}dwg_ptr_to_table_cell_array(n,o){return this.wasmInstance.dwg_ptr_to_table_cell_array(n,o)}dwg_ptr_to_hatch_defline_array(n,o){return this.wasmInstance.dwg_ptr_to_hatch_defline_array(n,o)}dwg_ptr_to_hatch_path_array(n,o){return this.wasmInstance.dwg_ptr_to_hatch_path_array(n,o)}dwg_ptr_to_hatch_gradient_color_array(n,o){return this.wasmInstance.dwg_ptr_to_hatch_gradient_color_array(n,o)}dwg_ptr_to_mline_vertex_array(n,o){return this.wasmInstance.dwg_ptr_to_mline_vertex_array(n,o)}dwg_dynapi_entity_value(n,o){const e=this.wasmInstance.dwg_dynapi_entity_value(n,o);return e.bin&&this.decoder&&(e.data=this.decoder.decode(e.bin)),e}dwg_dynapi_entity_data(n,o){return this.dwg_dynapi_entity_value(n,o).data}dwg_dynapi_header_value(n,o){return this.wasmInstance.dwg_dynapi_header_value(n,o)}dwg_dynapi_header_data(n,o){return this.dwg_dynapi_header_value(n,o).data}dwg_dynapi_common_value(n,o){return this.wasmInstance.dwg_dynapi_common_value(n,o)}dwg_dynapi_common_data(n,o){return this.dwg_dynapi_common_value(n,o).data}dwg_dynapi_subclass_value(n,o,e){return this.wasmInstance.dwg_dynapi_subclass_value(n,o,e)}dwg_dynapi_subclass_data(n,o,e){return this.dwg_dynapi_subclass_value(n,o,e).data}dwg_dynapi_subclass_size(n){return this.wasmInstance.dwg_dynapi_subclass_size(n)}dwg_dynapi_entity_field_offset(n,o){return this.wasmInstance.dwg_dynapi_entity_field_offset(n,o)}dwg_dynapi_subclass_field_offset(n,o){return this.wasmInstance.dwg_dynapi_subclass_field_offset(n,o)}dwg_object_get_handle_object(n){return this.wasmInstance.dwg_object_get_handle_object(n)}dwg_object_object_get_handle_object(n){return this.wasmInstance.dwg_object_object_get_handle_object(n)}dwg_object_object_get_ownerhandle_object(n){return this.wasmInstance.dwg_object_object_get_ownerhandle_object(n)}dwg_object_entity_get_handle_object(n){return this.wasmInstance.dwg_object_entity_get_handle_object(n)}dwg_object_entity_get_ownerhandle_object(n){return this.wasmInstance.dwg_object_entity_get_ownerhandle_object(n)}dwg_object_entity_get_xdicobjhandle_object(n){return this.wasmInstance.dwg_object_entity_get_xdicobjhandle_object(n)}dwg_object_entity_get_layer_object_ref(n){return this.wasmInstance.dwg_object_entity_get_layer_object_ref(n)}dwg_object_entity_get_ltype_object_ref(n){return this.wasmInstance.dwg_object_entity_get_ltype_object_ref(n)}dwg_object_entity_get_color_object(n){return this.wasmInstance.dwg_object_entity_get_color_object(n)}dwg_object_entity_get_xdata(n){return this.wasmInstance.dwg_object_entity_get_xdata(n)}dwg_object_object_get_xdicobjhandle_object(n){return this.wasmInstance.dwg_object_object_get_xdicobjhandle_object(n)}dwg_object_xrecord_get_xdata(n){return this.wasmInstance.dwg_object_xrecord_get_xdata(n)??[]}dwg_entity_owner(n){return this.wasmInstance.dwg_entity_owner(n)}dwg_entity_get_block_name(n,o){const e=this.wasmInstance,a=this.dwg_dynapi_entity_data(n,o),i=e.dwg_ref_get_object(a),r=e.dwg_object_to_object_tio(i);return this.dwg_entity_block_header_get_block(r).name}dwg_entity_get_dimstyle_name(n,o="dimstyle"){const e=this.wasmInstance,a=this.dwg_dynapi_entity_data(n,o),i=e.dwg_ref_get_object(a),r=e.dwg_object_to_object_tio(i);return this.dwg_dynapi_entity_data(r,"name")}dwg_entity_block_header_get_block(n){const o=this.wasmInstance,e=this.dwg_dynapi_entity_data(n,"block_entity"),a=o.dwg_ref_get_object(e),i=o.dwg_object_to_entity_tio(a),r=this.dwg_dynapi_entity_data(i,"name"),s=this.dwg_dynapi_entity_data(i,"base_pt");return{name:r,base_pt:s}}dwg_entity_block_header_get_preview(n){const o=this.wasmInstance;return typeof o.dwg_entity_block_header_get_preview!="function"?null:o.dwg_entity_block_header_get_preview(n)?.data??null}dwg_entity_get_preview(n){const o=this.wasmInstance;return typeof o.dwg_entity_get_preview!="function"?null:o.dwg_entity_get_preview(n)?.data??null}dwg_entity_proxy_entity_get_entity_data(n){const o=this.wasmInstance;return typeof o.dwg_entity_proxy_entity_get_entity_data!="function"?null:o.dwg_entity_proxy_entity_get_entity_data(n)?.data??null}dwg_entity_ole2frame_get_data(n){const o=this.wasmInstance;return typeof o.dwg_entity_ole2frame_get_data!="function"?null:o.dwg_entity_ole2frame_get_data(n)?.data??null}dwg_entity_oleframe_get_data(n){const o=this.wasmInstance;return typeof o.dwg_entity_oleframe_get_data!="function"?null:o.dwg_entity_oleframe_get_data(n)?.data??null}get_first_owned_entity(n){return this.wasmInstance.get_first_owned_entity(n)}get_next_owned_entity(n,o){return this.wasmInstance.get_next_owned_entity(n,o)}dwg_entity_mtext_get_style_name(n){const o=this.wasmInstance,e=this.dwg_dynapi_entity_data(n,"style"),a=o.dwg_ref_get_object(e),i=o.dwg_object_to_object_tio(a);return this.dwg_dynapi_entity_data(i,"name")}dwg_entity_text_get_style_name(n){return this.dwg_entity_mtext_get_style_name(n)}dwg_entity_polyline_2d_get_numpoints(n){return this.wasmInstance.dwg_entity_polyline_2d_get_numpoints(n).data}dwg_entity_polyline_2d_get_points(n){return this.wasmInstance.dwg_entity_polyline_2d_get_points(n).data}dwg_entity_polyline_2d_get_vertices(n){return this.wasmInstance.dwg_entity_polyline_2d_get_vertices(n).data}dwg_entity_polyline_3d_get_numpoints(n){return this.wasmInstance.dwg_entity_polyline_3d_get_numpoints(n).data}dwg_entity_polyline_3d_get_points(n){return this.wasmInstance.dwg_entity_polyline_3d_get_points(n).data}dwg_entity_polyline_3d_get_vertices(n){return this.wasmInstance.dwg_entity_polyline_3d_get_vertices(n).data}dwg_entity_insert_get_attribs(n){return this.wasmInstance.dwg_entity_insert_get_attribs(n).data}dwg_object_dictionary_get_texts(n){return this.wasmInstance.dwg_object_dictionary_get_texts(n).data}static createByWasmInstance(n){return this.instance==null?new _n(n):this.instance}static async create(n){const o=n==null?await jn():await jn({locateFile:e=>`${n}/${e}`});return this.createByWasmInstance(o)}};M(_n,"instance");let ee=_n;const Le=Object.freeze(Object.defineProperty({__proto__:null,get DwgAttachmentPoint(){return J},get DwgBoundaryPathEdgeType(){return dt},get DwgBoundaryPathTypeFlag(){return Kn},get DwgCodePage(){return Wn},get DwgDictionaryCloningFlags(){return Qn},get DwgDimensionTextHorizontal(){return Fn},get DwgDimensionTextLineSpacing(){return On},get DwgDimensionTextVertical(){return vn},get DwgDimensionToleranceTextVertical(){return Un},get DwgDimensionType(){return wn},get DwgDimensionZeroSuppression(){return Bn},get DwgDimensionZeroSuppressionAngular(){return kn},get DwgHatchAssociativity(){return St},get DwgHatchBoundaryAnnotation(){return Xn},get DwgHatchGradientColorFlag(){return Nt},get DwgHatchGradientFlag(){return en},get DwgHatchPatternType(){return Vn},get DwgHatchSolidFill(){return mt},get DwgHatchStyle(){return Hn},get DwgPolylineFlag(){return zn},get DwgProxyOriginalDataFormat(){return Jn},get DwgSmoothType(){return $n},get DwgTextGenerationFlag(){return Zn},get DwgTextHorizontalAlign(){return Dt},get DwgTextVerticalAlign(){return qn},get DwgThumbnailImageType(){return ne},get Dwg_Color_Method(){return Z},get Dwg_Error(){return an},get Dwg_File_Type(){return rn},get Dwg_Hatch_Edge_Type(){return ct},get Dwg_Object_Supertype(){return on},get Dwg_Object_Type(){return T},Dwg_Object_Type_Inverted:$o,HEADER_VARIABLES:We,LibreDwg:ee,createModule:jn,dwgCodePageToEncoding:bn,dwgVersions:be},Symbol.toStringTag,{value:"Module"}));
|
||
//# sourceMappingURL=dwg-worker.js.map
|