@mlightcad/libredwg-converter 3.5.34 → 3.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { AcDbFace as j, AcGeVector3d as A, AcDbArc as z, transformOcsPointToWcs as C, AcDbCircle as W, AcDbEllipse as X, AcDbLine as U, AcGePoint3d as S, AcDbSpline as M, AcDbPoint as G, AcDbTrace as Y, AcDbPolyline as Z, AcGePoint2d as m, AcDbPolygonMesh as _, AcDbPolyFaceMesh as K, AcDbPoly2dType as b, AcDb2dPolyline as q, AcDbPoly3dType as P, AcDb3dPolyline as J, AcDbHatch as Q, AcGePolyline2d as $, AcGeLine2d as ee, AcGeCircArc2d as te, AcGeVector2d as ne, AcGeEllipseArc2d as oe, AcGeSpline3d as v, AcGeLoop2d as k, AcDbHatchObjectType as re, AcDbTable as ie, AcDbText as se, AcDbMText as ce, AcDbLeader as ae, AcDbMLine as le, AcDbMLeader as de, AcDbMLeaderLineType as fe, AcDbMLeaderContentType as w, AcDbAlignedDimension as pe, AcDbRotatedDimension as ge, AcDb3PointAngularDimension as ue, AcDbOrdinateDimension as he, AcDbRadialDimension as De, AcDbDiametricDimension as ye, AcDbRasterImage as Ae, AcDbWipeout as be, AcDbViewport as Ie, AcDbRay as Pe, AcDbXline as we, AcDbAttributeFlags as I, AcDbAttributeMTextFlag as O, AcDbAttribute as N, AcDbAttributeDefinition as Te, AcDbBlockReference as Le, AcCmColor as F, AcCmTransparency as Ee, AcDbDatabaseConverter as xe, createWorkerApi as Ce, AcDbLinetypeTableRecord as Se, AcDbTextStyleTableRecord as Me, DEFAULT_TEXT_STYLE as R, AcDbDimStyleTableRecord as me, AcDbLayerTableRecord as ve, AcDbViewportTableRecord as ke, AcDbBlockTableRecord as Oe, AcDbBatchProcessing as Ne, ByLayer as Re, AcDbLayout as Ve, AcDbRasterImageDef as Fe } from "@mlightcad/data-model";
2
- class V {
1
+ import { AcDbFace as j, AcGeVector3d as A, AcDbArc as z, transformOcsPointToWcs as x, AcDbCircle as U, AcDbEllipse as X, AcDbLine as _, AcGePoint3d as M, AcDbSpline as S, AcDbPoint as G, AcDbTrace as Y, AcDbPolyline as Z, AcGePoint2d as m, AcDbPolygonMesh as K, AcDbPolyFaceMesh as q, AcDbPoly2dType as b, AcDb2dPolyline as J, AcDbPoly3dType as I, AcDb3dPolyline as Q, AcDbHatch as $, AcGePolyline2d as ee, AcGeLine2d as te, AcGeCircArc2d as ne, AcGeVector2d as oe, AcGeEllipseArc2d as ie, AcGeSpline3d as v, AcGeLoop2d as O, AcDbHatchObjectType as re, AcDbTable as se, AcDbText as ce, AcDbMText as ae, AcDbLeader as le, AcDbMLine as de, AcDbMLeader as fe, AcDbMLeaderLineType as pe, AcDbMLeaderContentType as T, AcDbAlignedDimension as ue, AcDbRotatedDimension as ge, AcDb3PointAngularDimension as he, AcDbOrdinateDimension as De, AcDbRadialDimension as ye, AcDbDiametricDimension as Ae, AcDbRasterImage as be, AcDbWipeout as Pe, AcDbViewport as Ie, AcDbRay as Te, AcDbXline as Le, AcDbAttributeFlags as P, AcDbAttributeMTextFlag as k, AcDbAttribute as N, AcDbAttributeDefinition as we, AcDbBlockReference as Ee, AcCmColor as B, AcCmTransparency as Ce, AcDbDatabaseConverter as xe, createWorkerApi as Me, AcDbLinetypeTableRecord as Se, AcDbTextStyleTableRecord as me, DEFAULT_TEXT_STYLE as R, AcDbDimStyleTableRecord as ve, AcDbLayerTableRecord as Oe, AcDbViewportTableRecord as ke, VPORT_FALLBACK_CENTER_2D as V, VPORT_FALLBACK_LLC as Ne, VPORT_FALLBACK_URC as Re, VPORT_FALLBACK_VIEW_DIR as Ve, VPORT_FALLBACK_VIEW_TARGET as Fe, AcDbBlockTableRecord as Be, AcDbBatchProcessing as He, ByLayer as We, AcDbLayout as je, AcDbRasterImageDef as ze } from "@mlightcad/data-model";
2
+ class F {
3
3
  convert(e) {
4
4
  const t = this.createEntity(e);
5
5
  return t && this.processCommonAttrs(e, t), t;
@@ -14,7 +14,7 @@ class V {
14
14
  convertArc(e) {
15
15
  const t = e.extrusionDirection ?? A.Z_AXIS;
16
16
  return new z(
17
- C(e.center, t),
17
+ x(e.center, t),
18
18
  e.radius,
19
19
  e.startAngle,
20
20
  e.endAngle,
@@ -23,8 +23,8 @@ class V {
23
23
  }
24
24
  convertCirle(e) {
25
25
  const t = e.extrusionDirection ?? A.Z_AXIS;
26
- return new W(
27
- C(e.center, t),
26
+ return new U(
27
+ x(e.center, t),
28
28
  e.radius,
29
29
  t
30
30
  );
@@ -43,15 +43,15 @@ class V {
43
43
  }
44
44
  convertLine(e) {
45
45
  const t = e.startPoint, o = e.endPoint;
46
- return new U(
47
- new S(t.x, t.y, t.z),
48
- new S(o.x, o.y, o.z)
46
+ return new _(
47
+ new M(t.x, t.y, t.z),
48
+ new M(o.x, o.y, o.z)
49
49
  );
50
50
  }
51
51
  convertSpline(e) {
52
52
  try {
53
53
  if (e.numberOfControlPoints > 0 && e.numberOfKnots > 0)
54
- return new M(
54
+ return new S(
55
55
  e.controlPoints,
56
56
  e.knots,
57
57
  e.weights,
@@ -59,7 +59,7 @@ class V {
59
59
  !!(e.flag & 1)
60
60
  );
61
61
  if (e.numberOfFitPoints > 0)
62
- return new M(
62
+ return new S(
63
63
  e.fitPoints,
64
64
  "Uniform",
65
65
  e.degree,
@@ -84,9 +84,9 @@ class V {
84
84
  const t = new Z();
85
85
  t.closed = !!(e.flag & 512);
86
86
  const o = e.constantWidth ?? -1;
87
- return e.vertices.forEach((n, r) => {
87
+ return e.vertices.forEach((n, i) => {
88
88
  t.addVertexAt(
89
- r,
89
+ i,
90
90
  new m(n.x, n.y),
91
91
  n.bulge,
92
92
  n.startWidth ?? o,
@@ -95,12 +95,12 @@ class V {
95
95
  }), t;
96
96
  }
97
97
  convertPolyline2d(e) {
98
- const t = !!(e.flag & 1), o = !!(e.flag & 16), n = !!(e.flag & 64), r = !!(e.flag & 32), i = [], a = [], s = [];
98
+ const t = !!(e.flag & 1), o = !!(e.flag & 16), n = !!(e.flag & 64), i = !!(e.flag & 32), r = [], a = [], s = [];
99
99
  if (e.vertices.map((c) => {
100
100
  if (!(c.flag & 16))
101
101
  if (n && c.flag & 128)
102
102
  if (c.flag & 64)
103
- i.push({
103
+ r.push({
104
104
  x: c.x,
105
105
  y: c.y,
106
106
  z: c.z
@@ -110,22 +110,22 @@ class V {
110
110
  c.polyfaceIndex0 != null && c.polyfaceIndex0 != 0 && d.push(Math.abs(c.polyfaceIndex0) - 1), c.polyfaceIndex1 != null && c.polyfaceIndex1 != 0 && d.push(Math.abs(c.polyfaceIndex1) - 1), c.polyfaceIndex2 != null && c.polyfaceIndex2 != 0 && d.push(Math.abs(c.polyfaceIndex2) - 1), c.polyfaceIndex3 != null && c.polyfaceIndex3 != 0 && d.push(Math.abs(c.polyfaceIndex3) - 1), d.length >= 3 && s.push(d);
111
111
  }
112
112
  else
113
- i.push({
113
+ r.push({
114
114
  x: c.x,
115
115
  y: c.y,
116
116
  z: c.z
117
117
  }), a.push(c.bulge ?? 0);
118
118
  }), o) {
119
119
  const c = e.meshMVertexCount ?? 2, d = e.meshNVertexCount ?? 2;
120
- return new _(c, d, i, t, r);
120
+ return new K(c, d, r, t, i);
121
121
  } else {
122
122
  if (n)
123
- return new K(i, s);
123
+ return new q(r, s);
124
124
  {
125
125
  let c = b.SimplePoly;
126
- return e.flag & 2 ? c = b.FitCurvePoly : e.flag & 4 && (e.smoothType == 6 ? c = b.CubicSplinePoly : e.smoothType == 5 && (c = b.QuadSplinePoly)), new q(
126
+ return e.flag & 2 ? c = b.FitCurvePoly : e.flag & 4 && (e.smoothType == 6 ? c = b.CubicSplinePoly : e.smoothType == 5 && (c = b.QuadSplinePoly)), new J(
127
127
  c,
128
- i,
128
+ r,
129
129
  0,
130
130
  t,
131
131
  e.startWidth,
@@ -137,29 +137,29 @@ class V {
137
137
  }
138
138
  convertPolyline3d(e) {
139
139
  const t = !!(e.flag & 1), o = [];
140
- e.vertices.map((r) => {
141
- r.flag & 16 || o.push({
142
- x: r.x,
143
- y: r.y,
144
- z: r.z
140
+ e.vertices.map((i) => {
141
+ i.flag & 16 || o.push({
142
+ x: i.x,
143
+ y: i.y,
144
+ z: i.z
145
145
  });
146
146
  });
147
- let n = P.SimplePoly;
148
- return e.flag & 4 && (e.smoothType == 6 ? n = P.CubicSplinePoly : e.smoothType == 5 && (n = P.QuadSplinePoly)), new J(n, o, t);
147
+ let n = I.SimplePoly;
148
+ return e.flag & 4 && (e.smoothType == 6 ? n = I.CubicSplinePoly : e.smoothType == 5 && (n = I.QuadSplinePoly)), new Q(n, o, t);
149
149
  }
150
150
  convertHatch(e) {
151
151
  var n;
152
- const t = new Q();
153
- if ((n = e.definitionLines) == null || n.forEach((r) => {
152
+ const t = new $();
153
+ if ((n = e.definitionLines) == null || n.forEach((i) => {
154
154
  t.definitionLines.push({
155
- angle: r.angle,
156
- base: r.base,
157
- offset: r.offset,
158
- dashLengths: r.numberOfDashLengths > 0 ? r.dashLengths : []
155
+ angle: i.angle,
156
+ base: i.base,
157
+ offset: i.offset,
158
+ dashLengths: i.numberOfDashLengths > 0 ? i.dashLengths : []
159
159
  });
160
- }), t.isSolidFill = e.solidFill == 1, t.hatchStyle = e.hatchStyle, t.patternName = e.patternName, t.patternType = e.patternType, t.patternAngle = e.patternAngle == null ? 0 : e.patternAngle, t.patternScale = e.patternScale == null ? 0 : e.patternScale, e.boundaryPaths.forEach((r) => {
161
- if (r.boundaryPathTypeFlag & 2) {
162
- const a = r, s = new $();
160
+ }), t.isSolidFill = e.solidFill == 1, t.hatchStyle = e.hatchStyle, t.patternName = e.patternName, t.patternType = e.patternType, t.patternAngle = e.patternAngle == null ? 0 : e.patternAngle, t.patternScale = e.patternScale == null ? 0 : e.patternScale, e.boundaryPaths.forEach((i) => {
161
+ if (i.boundaryPathTypeFlag & 2) {
162
+ const a = i, s = new ee();
163
163
  s.closed = a.isClosed, a.vertices.forEach((c, d) => {
164
164
  s.addVertexAt(d, {
165
165
  x: c.x,
@@ -168,16 +168,16 @@ class V {
168
168
  });
169
169
  }), t.add(s);
170
170
  } else {
171
- const a = r, s = [];
171
+ const a = i, s = [];
172
172
  a.edges.forEach((d) => {
173
173
  if (d != null) {
174
174
  if (d.type == 1) {
175
175
  const l = d;
176
- s.push(new ee(l.start, l.end));
176
+ s.push(new te(l.start, l.end));
177
177
  } else if (d.type == 2) {
178
178
  const l = d;
179
179
  s.push(
180
- new te(
180
+ new ne(
181
181
  l.center,
182
182
  l.radius,
183
183
  l.startAngle,
@@ -187,18 +187,18 @@ class V {
187
187
  );
188
188
  } else if (d.type == 3) {
189
189
  const l = d;
190
- new ne().subVectors(l.end, l.center);
190
+ new oe().subVectors(l.end, l.center);
191
191
  const p = Math.sqrt(
192
192
  Math.pow(l.end.x, 2) + Math.pow(l.end.y, 2)
193
- ), g = p * l.lengthOfMinorAxis;
194
- let u = l.startAngle, y = l.endAngle;
193
+ ), u = p * l.lengthOfMinorAxis;
194
+ let g = l.startAngle, y = l.endAngle;
195
195
  const h = Math.atan2(l.end.y, l.end.x);
196
- l.isCCW || (u = Math.PI * 2 - u, y = Math.PI * 2 - y), s.push(
197
- new oe(
196
+ l.isCCW || (g = Math.PI * 2 - g, y = Math.PI * 2 - y), s.push(
197
+ new ie(
198
198
  { ...l.center, z: 0 },
199
199
  p,
200
- g,
201
200
  u,
201
+ g,
202
202
  y,
203
203
  !l.isCCW,
204
204
  h
@@ -208,19 +208,19 @@ class V {
208
208
  const l = d;
209
209
  if (l.numberOfControlPoints > 0 && l.numberOfKnots > 0) {
210
210
  const f = l.controlPoints.map(
211
- (u) => ({
212
- x: u.x,
213
- y: u.y,
211
+ (g) => ({
212
+ x: g.x,
213
+ y: g.y,
214
214
  z: 0
215
215
  })
216
216
  );
217
217
  let p = !0;
218
- const g = l.controlPoints.map((u) => (u.weight == null && (p = !1), u.weight || 1));
218
+ const u = l.controlPoints.map((g) => (g.weight == null && (p = !1), g.weight || 1));
219
219
  s.push(
220
220
  new v(
221
221
  f,
222
222
  l.knots,
223
- p ? g : void 0
223
+ p ? u : void 0
224
224
  )
225
225
  );
226
226
  } else if (l.numberOfFitData > 0) {
@@ -234,20 +234,20 @@ class V {
234
234
  }
235
235
  }
236
236
  });
237
- const c = k.buildFromEdges(s);
238
- c.length == 0 && s.length > 0 ? t.add(new k(s)) : c.forEach((d) => t.add(d));
237
+ const c = O.buildFromEdges(s);
238
+ c.length == 0 && s.length > 0 ? t.add(new O(s)) : c.forEach((d) => t.add(d));
239
239
  }
240
240
  }), e.gradientFlag) {
241
- const r = e;
242
- if (t.hatchObjectType = re.GradientObject, t.gradientName = r.gradientName, t.gradientAngle = r.gradientRotation ?? 0, t.gradientShift = r.gradientDefinition ?? 0, t.gradientOneColorMode = r.gradientColorFlag == 1, t.shadeTintValue = r.colorTint ?? 0, r.gradientColors) {
243
- const i = r.gradientColors.length;
244
- i > 1 ? (t.gradientStartColor = r.gradientColors[0].rgb, t.gradientEndColor = r.gradientColors[1].rgb) : i > 0 && (t.gradientStartColor = r.gradientColors[0].rgb);
241
+ const i = e;
242
+ if (t.hatchObjectType = re.GradientObject, t.gradientName = i.gradientName, t.gradientAngle = i.gradientRotation ?? 0, t.gradientShift = i.gradientDefinition ?? 0, t.gradientOneColorMode = i.gradientColorFlag == 1, t.shadeTintValue = i.colorTint ?? 0, i.gradientColors) {
243
+ const r = i.gradientColors.length;
244
+ r > 1 ? (t.gradientStartColor = i.gradientColors[0].rgb, t.gradientEndColor = i.gradientColors[1].rgb) : r > 0 && (t.gradientStartColor = i.gradientColors[0].rgb);
245
245
  }
246
246
  }
247
247
  return t;
248
248
  }
249
249
  convertTable(e) {
250
- const t = new ie(
250
+ const t = new se(
251
251
  e.name,
252
252
  e.rowCount,
253
253
  e.columnCount
@@ -261,23 +261,23 @@ class V {
261
261
  }), t;
262
262
  }
263
263
  convertText(e) {
264
- const t = new se();
264
+ const t = new ce();
265
265
  t.textString = e.text, t.styleName = e.styleName, t.height = e.textHeight, t.position.copy(e.startPoint);
266
266
  const o = !e.endPoint || e.endPoint.x === 0 && e.endPoint.y === 0 && (e.endPoint.z ?? 0) === 0;
267
267
  return e.endPoint && !o ? t.alignmentPoint.copy(e.endPoint) : t.alignmentPoint.copy(e.startPoint), t.rotation = e.rotation, t.oblique = e.obliqueAngle ?? 0, t.thickness = e.thickness, t.horizontalMode = e.halign, t.verticalMode = e.valign, t.widthFactor = e.xScale ?? 1, t;
268
268
  }
269
269
  convertMText(e) {
270
- const t = new ce();
270
+ const t = new ae();
271
271
  return t.contents = e.text, e.styleName != null && (t.styleName = e.styleName), t.height = e.textHeight, t.width = e.rectWidth, t.rotation = e.rotation || 0, t.location = e.insertionPoint, t.attachmentPoint = e.attachmentPoint, e.direction && (t.direction = new A(e.direction)), t.drawingDirection = e.drawingDirection, t;
272
272
  }
273
273
  convertLeader(e) {
274
- const t = new ae();
274
+ const t = new le();
275
275
  return e.vertices.forEach((o) => {
276
276
  t.appendVertex(o);
277
277
  }), t.hasArrowHead = e.isArrowheadEnabled, t.hasHookLine = e.isHooklineExists, t.isSplined = e.isSpline, t.dimensionStyle = e.styleName, t.annoType = e.leaderCreationFlag, t;
278
278
  }
279
279
  convertMLine(e) {
280
- const t = new le();
280
+ const t = new de();
281
281
  return t.styleName = e.mlineStyle || "STANDARD", t.scale = e.scale, t.flags = e.flags, t.justification = e.justification, t.startPosition = e.startPoint, t.normal = e.extrusionDirection ?? A.Z_AXIS, t.styleCount = e.numberOfLines ?? 0, t.segments = (e.vertices ?? []).map((o) => ({
282
282
  position: o.vertex,
283
283
  direction: o.vertexDirection,
@@ -291,25 +291,25 @@ class V {
291
291
  })), t;
292
292
  }
293
293
  convertMLeader(e) {
294
- var p, g, u, y;
295
- const t = new de(), o = e;
294
+ var p, u, g, y;
295
+ const t = new fe(), o = e;
296
296
  t.leaderLineType = this.readNumber(o, [
297
297
  "multileaderType",
298
298
  "leaderLineType",
299
299
  "leaderType"
300
- ]) ?? fe.StraightLeader;
301
- const n = this.readNumber(o, ["contentType"]) ?? (e.textContent ? w.MTextContent : e.blockContent ? w.BlockContent : w.NoneContent);
300
+ ]) ?? pe.StraightLeader;
301
+ const n = this.readNumber(o, ["contentType"]) ?? (e.textContent ? T.MTextContent : e.blockContent ? T.BlockContent : T.NoneContent);
302
302
  t.contentType = n, t.doglegEnabled = this.readBoolean(o, ["doglegEnabled", "enableDogleg"]) ?? !1, t.doglegLength = this.readNumber(o, ["doglegLength"]) ?? 0, e.landingPoint && (t.landingPoint = e.landingPoint), e.doglegVector && (t.doglegVector = e.doglegVector);
303
- const r = this.readString(o, [
303
+ const i = this.readString(o, [
304
304
  "mleaderStyleId",
305
305
  "mLeaderStyleId",
306
306
  "mleaderStyleHandle",
307
307
  "styleHandle",
308
308
  "styleName"
309
309
  ]);
310
- r && (t.mleaderStyleId = r);
311
- const i = this.readPoint(o, ["normal", "extrusionDirection"]);
312
- i && (t.normal = i);
310
+ i && (t.mleaderStyleId = i);
311
+ const r = this.readPoint(o, ["normal", "extrusionDirection"]);
312
+ r && (t.normal = r);
313
313
  const a = e.textContent, s = this.readString(a ?? {}, ["styleName", "textStyleName"]) ?? this.readString(o, ["textStyleName", "textStyle", "styleName"]);
314
314
  s && (t.textStyleName = s), t.textHeight = this.readNumber(a ?? {}, ["textHeight", "height"]) ?? this.readNumber(o, [
315
315
  "textHeight",
@@ -350,7 +350,7 @@ class V {
350
350
  ]);
351
351
  h != null && D && (t.mtextContent = { text: h, anchorPoint: D });
352
352
  }
353
- if ((g = e.blockContent) != null && g.blockHandle && e.blockContent.position)
353
+ if ((u = e.blockContent) != null && u.blockHandle && e.blockContent.position)
354
354
  t.blockContent = {
355
355
  blockHandle: e.blockContent.blockHandle,
356
356
  position: e.blockContent.position
@@ -369,21 +369,21 @@ class V {
369
369
  position: D
370
370
  });
371
371
  }
372
- return (u = e.leaders) == null || u.forEach((h) => {
373
- var T;
372
+ return (g = e.leaders) == null || g.forEach((h) => {
373
+ var L;
374
374
  const D = t.addLeader({
375
375
  landingPoint: h.landingPoint ?? e.landingPoint,
376
376
  doglegVector: h.doglegVector ?? e.doglegVector,
377
377
  doglegLength: h.doglegLength ?? e.doglegLength
378
378
  });
379
- (T = h.leaderLines) == null || T.forEach((L) => {
379
+ (L = h.leaderLines) == null || L.forEach((w) => {
380
380
  var E;
381
- const H = t.addLeaderLine(
381
+ const W = t.addLeaderLine(
382
382
  D,
383
- L.vertices ?? []
383
+ w.vertices ?? []
384
384
  );
385
- (E = L.breaks) == null || E.forEach((x) => {
386
- t.addBreak(D, H, x.start, x.end);
385
+ (E = w.breaks) == null || E.forEach((C) => {
386
+ t.addBreak(D, W, C.start, C.end);
387
387
  });
388
388
  });
389
389
  }), t.numberOfLeaders === 0 && ((y = this.readLeaderLineArray(o)) == null || y.forEach((h) => {
@@ -397,7 +397,7 @@ class V {
397
397
  }
398
398
  convertDimension(e) {
399
399
  if (e.subclassMarker == "AcDbAlignedDimension") {
400
- const t = e, o = new pe(
400
+ const t = e, o = new ue(
401
401
  t.subDefinitionPoint1,
402
402
  t.subDefinitionPoint2,
403
403
  t.definitionPoint
@@ -419,7 +419,7 @@ class V {
419
419
  z: 0
420
420
  }), o.rotation = t.rotationAngle, this.processDimensionCommonAttrs(e, o), o;
421
421
  } else if (e.subclassMarker == "AcDb3PointAngularDimension") {
422
- const t = e, o = new ue(
422
+ const t = e, o = new he(
423
423
  t.centerPoint,
424
424
  t.subDefinitionPoint1,
425
425
  t.subDefinitionPoint2,
@@ -427,20 +427,20 @@ class V {
427
427
  );
428
428
  return this.processDimensionCommonAttrs(e, o), o;
429
429
  } else if (e.subclassMarker == "AcDbOrdinateDimension") {
430
- const t = e, o = new he(
430
+ const t = e, o = new De(
431
431
  t.subDefinitionPoint1,
432
432
  t.subDefinitionPoint2
433
433
  );
434
434
  return this.processDimensionCommonAttrs(e, o), o;
435
435
  } else if (e.subclassMarker == "AcDbRadialDimension") {
436
- const t = e, o = new De(
436
+ const t = e, o = new ye(
437
437
  t.definitionPoint,
438
438
  t.centerPoint,
439
439
  t.leaderLength
440
440
  );
441
441
  return this.processDimensionCommonAttrs(e, o), o;
442
442
  } else if (e.subclassMarker == "AcDbDiametricDimension") {
443
- const t = e, o = new ye(
443
+ const t = e, o = new Ae(
444
444
  t.definitionPoint,
445
445
  t.centerPoint,
446
446
  t.leaderLength
@@ -459,11 +459,11 @@ class V {
459
459
  ) * e.imageSize.y, t.rotation = Math.atan2(e.uPixel.y, e.uPixel.x);
460
460
  }
461
461
  convertImage(e) {
462
- const t = new Ae();
462
+ const t = new be();
463
463
  return this.processImage(e, t), t;
464
464
  }
465
465
  convertWipeout(e) {
466
- const t = new be();
466
+ const t = new Pe();
467
467
  return this.processImage(e, t), t;
468
468
  }
469
469
  convertViewport(e) {
@@ -471,29 +471,29 @@ class V {
471
471
  return t.number = e.viewportId, t.centerPoint.copy(e.viewportCenter), t.height = e.height, t.width = e.width, t.viewCenter.copy(e.displayCenter), t.viewHeight = e.viewHeight, t;
472
472
  }
473
473
  convertRay(e) {
474
- const t = new Pe();
474
+ const t = new Te();
475
475
  return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
476
476
  }
477
477
  convertXline(e) {
478
- const t = new we();
478
+ const t = new Le();
479
479
  return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
480
480
  }
481
481
  convertAttributeCommon(e, t) {
482
482
  const o = e.text;
483
483
  t.textString = o.text, t.styleName = o.styleName, t.height = o.textHeight, t.position.copy(o.startPoint);
484
- const n = e.alignmentPoint ?? o.endPoint, r = !n || n.x === 0 && n.y === 0 && (n.z ?? 0) === 0;
485
- n && !r ? t.alignmentPoint.copy(n) : t.alignmentPoint.copy(o.startPoint), t.rotation = o.rotation, t.oblique = o.obliqueAngle ?? 0, t.thickness = o.thickness, t.horizontalMode = o.halign, t.verticalMode = o.valign, t.widthFactor = o.xScale ?? 1, t.tag = e.tag, t.fieldLength = e.fieldLength, t.isInvisible = (e.flags & I.Invisible) !== 0, t.isConst = (e.flags & I.Const) !== 0, t.isVerifiable = (e.flags & I.Verifiable) !== 0, t.isPreset = (e.flags & I.Preset) !== 0, t.lockPositionInBlock = e.lockPositionFlag, t.isReallyLocked = e.isReallyLocked, t.isMTextAttribute = (e.mtextFlag & O.MultiLine) !== 0, t.isConstMTextAttribute = (e.mtextFlag & O.ConstMultiLine) !== 0;
484
+ const n = e.alignmentPoint ?? o.endPoint, i = !n || n.x === 0 && n.y === 0 && (n.z ?? 0) === 0;
485
+ n && !i ? t.alignmentPoint.copy(n) : t.alignmentPoint.copy(o.startPoint), t.rotation = o.rotation, t.oblique = o.obliqueAngle ?? 0, t.thickness = o.thickness, t.horizontalMode = o.halign, t.verticalMode = o.valign, t.widthFactor = o.xScale ?? 1, t.tag = e.tag, t.fieldLength = e.fieldLength, t.isInvisible = (e.flags & P.Invisible) !== 0, t.isConst = (e.flags & P.Const) !== 0, t.isVerifiable = (e.flags & P.Verifiable) !== 0, t.isPreset = (e.flags & P.Preset) !== 0, t.lockPositionInBlock = e.lockPositionFlag, t.isReallyLocked = e.isReallyLocked, t.isMTextAttribute = (e.mtextFlag & k.MultiLine) !== 0, t.isConstMTextAttribute = (e.mtextFlag & k.ConstMultiLine) !== 0;
486
486
  }
487
487
  convertAttribute(e) {
488
488
  const t = new N();
489
489
  return this.convertAttributeCommon(e, t), t;
490
490
  }
491
491
  convertAttributeDefinition(e) {
492
- const t = new Te();
492
+ const t = new we();
493
493
  return this.convertAttributeCommon(e, t), t.prompt = e.prompt, t;
494
494
  }
495
495
  convertBlockReference(e) {
496
- const t = new Le(e.name);
496
+ const t = new Ee(e.name);
497
497
  return e.insertionPoint && t.position.copy(e.insertionPoint), t.scaleFactors.x = e.xScale, t.scaleFactors.y = e.yScale, t.scaleFactors.z = e.zScale, t.rotation = e.rotation, t.normal.copy(e.extrusionDirection), e.handle != null && (t.objectId = e.handle), e.attribs && e.attribs.forEach((o) => {
498
498
  const n = this.convert(o);
499
499
  n instanceof N && t.appendAttributes(n);
@@ -504,11 +504,11 @@ class V {
504
504
  }
505
505
  processCommonAttrs(e, t) {
506
506
  if (t.layer = e.layer || "0", t.objectId = e.handle, e.ownerBlockRecordSoftId != null && (t.ownerId = e.ownerBlockRecordSoftId), e.lineType != null && (t.lineType = e.lineType), e.lineweight != null && (t.lineWeight = e.lineweight), e.lineTypeScale != null && (t.linetypeScale = e.lineTypeScale), e.color != null || e.colorIndex != null || e.colorName) {
507
- const o = new F();
507
+ const o = new B();
508
508
  e.color != null && o.setRGBValue(e.color), e.colorIndex != null && (e.color == null || e.colorIndex === 7) && (o.colorIndex = e.colorIndex), e.colorName && (o.colorName = e.colorName), t.color = o;
509
509
  }
510
510
  if (e.isVisible != null && (t.visibility = e.isVisible), e.transparency != null) {
511
- const o = new Ee();
511
+ const o = new Ce();
512
512
  o.method = e.transparencyType, (o.isByBlock || o.isByBlock) && (o.alpha = e.transparency), t.transparency = o;
513
513
  }
514
514
  }
@@ -544,12 +544,12 @@ class V {
544
544
  if (Array.isArray(t))
545
545
  return t.map((n) => {
546
546
  if (!n || typeof n != "object") return;
547
- const r = n.vertices;
548
- return Array.isArray(r) ? r.filter((i) => this.isPointLike(i)) : void 0;
547
+ const i = n.vertices;
548
+ return Array.isArray(i) ? i.filter((r) => this.isPointLike(r)) : void 0;
549
549
  }).filter((n) => !!n && n.length > 0);
550
550
  const o = e.vertices;
551
551
  if (Array.isArray(o)) {
552
- const n = o.filter((r) => this.isPointLike(r));
552
+ const n = o.filter((i) => this.isPointLike(i));
553
553
  return n.length > 0 ? [n] : void 0;
554
554
  }
555
555
  }
@@ -557,93 +557,93 @@ class V {
557
557
  return !!e && typeof e == "object" && typeof e.x == "number" && typeof e.y == "number";
558
558
  }
559
559
  }
560
- const Be = "*MODEL_SPACE";
561
- class je extends xe {
560
+ const Ue = "*MODEL_SPACE";
561
+ class _e extends xe {
562
562
  constructor(e = {}) {
563
563
  super(e), e.useWorker = !0, e.parserWorkerUrl || (e.parserWorkerUrl = "/assets/libredwg-parser-worker.js");
564
564
  }
565
565
  async parse(e, t) {
566
566
  const o = this.config, n = this.getParserWorkerTimeout(e, t);
567
567
  if (o.useWorker && o.parserWorkerUrl) {
568
- const r = Ce({
568
+ const i = Me({
569
569
  workerUrl: o.parserWorkerUrl,
570
570
  timeout: n,
571
571
  maxConcurrentWorkers: 1
572
- }), i = await r.execute(e);
573
- if (r.destroy(), i.success)
574
- return i.data;
572
+ }), r = await i.execute(e);
573
+ if (i.destroy(), r.success)
574
+ return r.data;
575
575
  throw new Error(
576
- `Failed to parse drawing due to error: '${i.error}'`
576
+ `Failed to parse drawing due to error: '${r.error}'`
577
577
  );
578
578
  } else
579
579
  throw new Error("dwg converter can run in web worker only!");
580
580
  }
581
581
  getFonts(e) {
582
582
  const t = /* @__PURE__ */ new Map();
583
- e.tables.BLOCK_RECORD.entries.forEach((i) => {
584
- t.set(i.name, i);
583
+ e.tables.BLOCK_RECORD.entries.forEach((r) => {
584
+ t.set(r.name, r);
585
585
  });
586
- const o = /* @__PURE__ */ new Map(), n = (i) => {
587
- if (i) {
588
- const a = i.lastIndexOf(".");
589
- return a >= 0 ? i.substring(0, a).toLowerCase() : i.toLowerCase();
586
+ const o = /* @__PURE__ */ new Map(), n = (r) => {
587
+ if (r) {
588
+ const a = r.lastIndexOf(".");
589
+ return a >= 0 ? r.substring(0, a).toLowerCase() : r.toLowerCase();
590
590
  }
591
591
  };
592
- e.tables.STYLE.entries.forEach((i) => {
592
+ e.tables.STYLE.entries.forEach((r) => {
593
593
  const a = [];
594
- let s = n(i.font);
595
- s && a.push(s), s = n(i.bigFont), s && a.push(s), o.set(i.name, a);
594
+ let s = n(r.font);
595
+ s && a.push(s), s = n(r.bigFont), s && a.push(s), o.set(r.name, a);
596
596
  });
597
- const r = /* @__PURE__ */ new Set();
598
- return this.getFontsInBlock(e.entities, t, o, r), Array.from(r);
597
+ const i = /* @__PURE__ */ new Set();
598
+ return this.getFontsInBlock(e.entities, t, o, i), Array.from(i);
599
599
  }
600
600
  getFontsInBlock(e, t, o, n) {
601
- const r = /\\f(.*?)\|/g;
602
- e.forEach((i) => {
603
- if (i.type == "MTEXT") {
604
- const a = i;
605
- [...a.text.matchAll(r)].forEach((c) => {
601
+ const i = /\\f(.*?)\|/g;
602
+ e.forEach((r) => {
603
+ if (r.type == "MTEXT") {
604
+ const a = r;
605
+ [...a.text.matchAll(i)].forEach((c) => {
606
606
  n.add(c[1].toLowerCase());
607
607
  });
608
608
  const s = o.get(a.styleName);
609
609
  s == null || s.forEach((c) => n.add(c));
610
- } else if (i.type == "TEXT") {
611
- const a = i, s = o.get(a.styleName);
610
+ } else if (r.type == "TEXT") {
611
+ const a = r, s = o.get(a.styleName);
612
612
  s == null || s.forEach((c) => n.add(c));
613
- } else if (i.type == "MULTILEADER" || i.type == "MLEADER") {
614
- const a = i, s = a.textContent;
615
- [...(typeof (s == null ? void 0 : s.text) == "string" ? s.text : "").matchAll(r)].forEach((f) => {
613
+ } else if (r.type == "MULTILEADER" || r.type == "MLEADER") {
614
+ const a = r, s = a.textContent;
615
+ [...(typeof (s == null ? void 0 : s.text) == "string" ? s.text : "").matchAll(i)].forEach((f) => {
616
616
  n.add(f[1].toLowerCase());
617
617
  });
618
618
  const d = typeof (s == null ? void 0 : s.styleName) == "string" ? s.styleName : typeof a.textStyleName == "string" ? a.textStyleName : typeof a.styleName == "string" ? a.styleName : void 0, l = d ? o.get(d) : void 0;
619
619
  l == null || l.forEach((f) => n.add(f));
620
- } else if (i.type == "INSERT") {
621
- const a = i, s = t.get(a.name);
620
+ } else if (r.type == "INSERT") {
621
+ const a = r, s = t.get(a.name);
622
622
  s && this.getFontsInBlock(s.entities, t, o, n);
623
623
  }
624
624
  });
625
625
  }
626
626
  processLineTypes(e, t) {
627
627
  e.tables.LTYPE.entries.forEach((n) => {
628
- const r = {
628
+ const i = {
629
629
  name: n.name,
630
630
  description: n.description,
631
631
  standardFlag: n.standardFlag,
632
632
  totalPatternLength: n.totalPatternLength,
633
633
  pattern: n.pattern
634
- }, i = new Se(r);
635
- this.processCommonTableEntryAttrs(n, i), i.name = n.name, t.tables.linetypeTable.add(i);
634
+ }, r = new Se(i);
635
+ this.processCommonTableEntryAttrs(n, r), r.name = n.name, t.tables.linetypeTable.add(r);
636
636
  });
637
637
  }
638
638
  processTextStyles(e, t) {
639
639
  e.tables.STYLE.entries.forEach((n) => {
640
- const r = new Me(n);
641
- this.processCommonTableEntryAttrs(n, r), t.tables.textStyleTable.add(r);
640
+ const i = new me(n);
641
+ this.processCommonTableEntryAttrs(n, i), t.tables.textStyleTable.add(i);
642
642
  });
643
643
  }
644
644
  processDimStyles(e, t) {
645
645
  e.tables.DIMSTYLE.entries.forEach((n) => {
646
- const r = {
646
+ const i = {
647
647
  name: n.name,
648
648
  ownerId: n.ownerHandle,
649
649
  dimpost: n.DIMPOST || "",
@@ -712,55 +712,59 @@ class je extends xe {
712
712
  dimblk2: n.DIMBLK2 || "",
713
713
  dimlwd: n.DIMLWD,
714
714
  dimlwe: n.DIMLWE
715
- }, i = new me(r);
716
- this.processCommonTableEntryAttrs(n, i), t.tables.dimStyleTable.add(i);
715
+ }, r = new ve(i);
716
+ this.processCommonTableEntryAttrs(n, r), t.tables.dimStyleTable.add(r);
717
717
  });
718
718
  }
719
719
  processLayers(e, t) {
720
720
  e.tables.LAYER.entries.forEach((n) => {
721
- const r = new F();
722
- r.colorIndex = n.colorIndex;
723
- const i = new ve({
721
+ const i = new B();
722
+ i.colorIndex = n.colorIndex;
723
+ const r = new Oe({
724
724
  name: n.name,
725
725
  standardFlags: n.standardFlag,
726
726
  linetype: n.lineType,
727
727
  lineWeight: n.lineweight,
728
728
  isOff: n.off,
729
- color: r,
729
+ color: i,
730
730
  isPlottable: n.plotFlag != 0
731
731
  });
732
- this.processCommonTableEntryAttrs(n, i), t.tables.layerTable.add(i);
732
+ this.processCommonTableEntryAttrs(n, r), t.tables.layerTable.add(r);
733
733
  });
734
734
  }
735
735
  processViewports(e, t) {
736
736
  e.tables.VPORT.entries.forEach((n) => {
737
- const r = new ke();
738
- this.processCommonTableEntryAttrs(n, r), n.circleSides && (r.circleSides = n.circleSides), r.standardFlag = n.standardFlag, r.center.copy(n.center), r.lowerLeftCorner.copy(n.lowerLeftCorner), r.upperRightCorner.copy(n.upperRightCorner), n.snapBasePoint && r.snapBase.copy(n.snapBasePoint), n.snapRotationAngle && (r.snapAngle = n.snapRotationAngle), n.snapSpacing && r.snapIncrements.copy(n.snapSpacing), n.majorGridLines && (r.gridMajor = n.majorGridLines), n.gridSpacing && r.gridIncrements.copy(n.gridSpacing), n.backgroundObjectId && (r.backgroundObjectId = n.backgroundObjectId), r.gsView.center.copy(n.center), r.gsView.viewDirectionFromTarget.copy(n.viewDirectionFromTarget), r.gsView.viewTarget.copy(n.viewTarget), n.lensLength && (r.gsView.lensLength = n.lensLength), n.frontClippingPlane && (r.gsView.frontClippingPlane = n.frontClippingPlane), n.backClippingPlane && (r.gsView.backClippingPlane = n.backClippingPlane), n.viewHeight && (r.gsView.viewHeight = n.viewHeight), n.viewTwistAngle && (r.gsView.viewTwistAngle = n.viewTwistAngle), n.frozenLayers && (r.gsView.frozenLayers = n.frozenLayers), n.styleSheet && (r.gsView.styleSheet = n.styleSheet), n.renderMode && (r.gsView.renderMode = n.renderMode), n.viewMode && (r.gsView.viewMode = n.viewMode), n.ucsIconSetting && (r.gsView.ucsIconSetting = n.ucsIconSetting), n.ucsOrigin && r.gsView.ucsOrigin.copy(n.ucsOrigin), n.ucsXAxis && r.gsView.ucsXAxis.copy(n.ucsXAxis), n.ucsYAxis && r.gsView.ucsYAxis.copy(n.ucsYAxis), n.orthographicType && (r.gsView.orthographicType = n.orthographicType), n.shadePlotSetting && (r.gsView.shadePlotSetting = n.shadePlotSetting), n.shadePlotObjectId && (r.gsView.shadePlotObjectId = n.shadePlotObjectId), n.visualStyleObjectId && (r.gsView.visualStyleObjectId = n.visualStyleObjectId), n.isDefaultLightingOn && (r.gsView.isDefaultLightingOn = n.isDefaultLightingOn), n.defaultLightingType && (r.gsView.defaultLightingType = n.defaultLightingType), n.brightness && (r.gsView.brightness = n.brightness), n.contrast && (r.gsView.contrast = n.contrast), n.ambientColor && (r.gsView.ambientColor = n.ambientColor), t.tables.viewportTable.add(r);
737
+ const i = new ke();
738
+ this.processCommonTableEntryAttrs(n, i), n.circleSides && (i.circleSides = n.circleSides), i.standardFlag = n.standardFlag, i.center.copy(n.center ?? V), i.lowerLeftCorner.copy(n.lowerLeftCorner ?? Ne), i.upperRightCorner.copy(n.upperRightCorner ?? Re), n.snapBasePoint && i.snapBase.copy(n.snapBasePoint), n.snapRotationAngle && (i.snapAngle = n.snapRotationAngle), n.snapSpacing && i.snapIncrements.copy(n.snapSpacing), n.majorGridLines && (i.gridMajor = n.majorGridLines), n.gridSpacing && i.gridIncrements.copy(n.gridSpacing), n.backgroundObjectId && (i.backgroundObjectId = n.backgroundObjectId), i.gsView.center.copy(n.center ?? V), i.gsView.viewDirectionFromTarget.copy(
739
+ n.viewDirectionFromTarget ?? Ve
740
+ ), i.gsView.viewTarget.copy(
741
+ n.viewTarget ?? Fe
742
+ ), n.lensLength && (i.gsView.lensLength = n.lensLength), n.frontClippingPlane && (i.gsView.frontClippingPlane = n.frontClippingPlane), n.backClippingPlane && (i.gsView.backClippingPlane = n.backClippingPlane), n.viewHeight && (i.gsView.viewHeight = n.viewHeight), n.viewTwistAngle && (i.gsView.viewTwistAngle = n.viewTwistAngle), n.frozenLayers && (i.gsView.frozenLayers = n.frozenLayers), n.styleSheet && (i.gsView.styleSheet = n.styleSheet), n.renderMode && (i.gsView.renderMode = n.renderMode), n.viewMode && (i.gsView.viewMode = n.viewMode), n.ucsIconSetting && (i.gsView.ucsIconSetting = n.ucsIconSetting), n.ucsOrigin && i.gsView.ucsOrigin.copy(n.ucsOrigin), n.ucsXAxis && i.gsView.ucsXAxis.copy(n.ucsXAxis), n.ucsYAxis && i.gsView.ucsYAxis.copy(n.ucsYAxis), n.orthographicType && (i.gsView.orthographicType = n.orthographicType), n.shadePlotSetting && (i.gsView.shadePlotSetting = n.shadePlotSetting), n.shadePlotObjectId && (i.gsView.shadePlotObjectId = n.shadePlotObjectId), n.visualStyleObjectId && (i.gsView.visualStyleObjectId = n.visualStyleObjectId), n.isDefaultLightingOn && (i.gsView.isDefaultLightingOn = n.isDefaultLightingOn), n.defaultLightingType && (i.gsView.defaultLightingType = n.defaultLightingType), n.brightness && (i.gsView.brightness = n.brightness), n.contrast && (i.gsView.contrast = n.contrast), n.ambientColor && (i.gsView.ambientColor = n.ambientColor), t.tables.viewportTable.add(i);
739
743
  });
740
744
  }
741
745
  processBlockTables(e, t) {
742
746
  e.tables.BLOCK_RECORD.entries.forEach((n) => {
743
- let r = t.tables.blockTable.getAt(n.name);
744
- r || (r = new Oe(), r.objectId = n.handle, r.name = n.name, r.ownerId = n.ownerHandle, r.origin.copy(n.basePoint), r.layoutId = n.layout, r.blockInsertUnits = n.insertionUnits, r.explodability = n.explodability, r.blockScaling = n.scalability, n.bmpPreview && (r.bmpPreview = n.bmpPreview), t.tables.blockTable.add(r)), !r.isModelSapce && n.entities && n.entities.length > 0 && this.processEntitiesInBlock(n.entities, r);
747
+ let i = t.tables.blockTable.getAt(n.name);
748
+ i || (i = new Be(), i.objectId = n.handle, i.name = n.name, i.ownerId = n.ownerHandle, i.origin.copy(n.basePoint), i.layoutId = n.layout, i.blockInsertUnits = n.insertionUnits, i.explodability = n.explodability, i.blockScaling = n.scalability, n.bmpPreview && (i.bmpPreview = n.bmpPreview), t.tables.blockTable.add(i)), !i.isModelSapce && n.entities && n.entities.length > 0 && this.processEntitiesInBlock(n.entities, i);
745
749
  });
746
750
  }
747
751
  processBlocks(e, t) {
748
752
  }
749
753
  async processEntitiesInBlock(e, t) {
750
- const o = new V(), n = e.length, r = [];
751
- for (let i = 0; i < n; i++) {
752
- const a = e[i], s = o.convert(a);
753
- s && r.push(s);
754
+ const o = new F(), n = e.length, i = [];
755
+ for (let r = 0; r < n; r++) {
756
+ const a = e[r], s = o.convert(a);
757
+ s && i.push(s);
754
758
  }
755
- t.appendEntity(r);
759
+ t.appendEntity(i);
756
760
  }
757
- async processEntities(e, t, o, n, r) {
758
- const i = new V();
761
+ async processEntities(e, t, o, n, i) {
762
+ const r = new F();
759
763
  let a = [];
760
764
  e.tables.BLOCK_RECORD.entries.forEach((l) => {
761
765
  this.isModelSpace(l.name) && (a = l.entities);
762
766
  });
763
- const s = a.length, c = new Ne(
767
+ const s = a.length, c = new He(
764
768
  s,
765
769
  100 - n.value,
766
770
  o
@@ -769,19 +773,19 @@ class je extends xe {
769
773
  const d = t.tables.blockTable.modelSpace;
770
774
  await c.processChunk(async (l, f) => {
771
775
  const p = [];
772
- for (let g = l; g < f; g++) {
773
- const u = a[g], y = i.convert(u);
776
+ for (let u = l; u < f; u++) {
777
+ const g = a[u], y = r.convert(g);
774
778
  y && p.push(y);
775
779
  }
776
- if (d.appendEntity(p), r) {
777
- let g = n.value + f / s * (100 - n.value);
778
- g > 100 && (g = 100), await r(g, "ENTITY", "IN-PROGRESS");
780
+ if (d.appendEntity(p), i) {
781
+ let u = n.value + f / s * (100 - n.value);
782
+ u > 100 && (u = 100), await i(u, "ENTITY", "IN-PROGRESS");
779
783
  }
780
784
  });
781
785
  }
782
786
  processHeader(e, t) {
783
787
  const o = e.header;
784
- o.CECOLOR && (o.CECOLOR.index >= 0 && o.CECOLOR.index <= 256 ? t.cecolor.colorIndex = o.CECOLOR.index : t.cecolor.setRGBValue(o.CECOLOR.rgb)), t.angBase = o.ANGBASE ?? 0, t.angDir = o.ANGDIR ?? 0, t.aunits = o.AUNITS ?? 0, t.celtype = o.CELTYPE ?? Re, t.celtscale = o.CELTSCALE ?? 1, t.ltscale = o.LTSCALE ?? 1, o.EXTMAX && (t.extmax = o.EXTMAX), o.EXTMIN && (t.extmin = o.EXTMIN), t.insunits = o.INSUNITS ?? 1, t.pdmode = o.PDMODE ?? 0, t.pdsize = o.PDSIZE ?? 0, t.textstyle = o.TEXTSTYLE ?? R;
788
+ o.CECOLOR && (o.CECOLOR.index >= 0 && o.CECOLOR.index <= 256 ? t.cecolor.colorIndex = o.CECOLOR.index : t.cecolor.setRGBValue(o.CECOLOR.rgb)), t.angbase = o.ANGBASE ?? 0, t.angdir = o.ANGDIR ?? 0, t.aunits = o.AUNITS ?? 0, o.AUPREC != null && (t.auprec = o.AUPREC), o.LUNITS != null && (t.lunits = o.LUNITS), o.LUPREC != null && (t.luprec = o.LUPREC), o.UNITMODE != null && (t.unitmode = o.UNITMODE), o.MEASUREMENT != null && (t.measurement = o.MEASUREMENT), t.celtype = o.CELTYPE ?? We, t.celtscale = o.CELTSCALE ?? 1, t.ltscale = o.LTSCALE ?? 1, o.EXTMAX && (t.extmax = o.EXTMAX), o.EXTMIN && (t.extmin = o.EXTMIN), t.insunits = o.INSUNITS ?? 1, t.pdmode = o.PDMODE ?? 0, t.pdsize = o.PDSIZE ?? 0, t.textstyle = o.TEXTSTYLE ?? R;
785
789
  }
786
790
  processCommonTableEntryAttrs(e, t) {
787
791
  t.name = e.name, t.objectId = e.handle, e.ownerHandle != null && (t.ownerId = e.ownerHandle);
@@ -791,24 +795,24 @@ class je extends xe {
791
795
  }
792
796
  processLayouts(e, t) {
793
797
  const o = t.objects.layout;
794
- e.objects.LAYOUT.forEach((r) => {
795
- const i = new Ve();
796
- i.layoutName = r.layoutName, i.tabOrder = r.tabOrder;
798
+ e.objects.LAYOUT.forEach((i) => {
799
+ const r = new je();
800
+ r.layoutName = i.layoutName, r.tabOrder = i.tabOrder;
797
801
  const a = t.tables.blockTable.newIterator();
798
- i.objectId = r.handle;
802
+ r.objectId = i.handle;
799
803
  for (const s of a)
800
- if (s.layoutId === i.objectId) {
801
- i.blockTableRecordId = s.objectId;
804
+ if (s.layoutId === r.objectId) {
805
+ r.blockTableRecordId = s.objectId;
802
806
  break;
803
807
  }
804
- i.blockTableRecordId || r.layoutName === "Model" && (i.blockTableRecordId = t.tables.blockTable.modelSpace.objectId), i.limits.min.copy(r.minLimit), i.limits.max.copy(r.maxLimit), i.extents.min.copy(r.minExtent), i.extents.max.copy(r.maxExtent), r.viewportId && i.viewportArray.push(r.viewportId), this.processCommonObjectAttrs(r, i), o.setAt(i.layoutName, i);
808
+ r.blockTableRecordId || i.layoutName === "Model" && (r.blockTableRecordId = t.tables.blockTable.modelSpace.objectId), r.limits.min.copy(i.minLimit), r.limits.max.copy(i.maxLimit), r.extents.min.copy(i.minExtent), r.extents.max.copy(i.maxExtent), i.viewportId && r.viewportArray.push(i.viewportId), this.processCommonObjectAttrs(i, r), o.setAt(r.layoutName, r);
805
809
  });
806
810
  }
807
811
  processImageDefs(e, t) {
808
812
  const o = t.objects.imageDefinition;
809
- e.objects.IMAGEDEF.forEach((r) => {
810
- const i = new Fe();
811
- i.sourceFileName = r.fileName, this.processCommonObjectAttrs(r, i), o.setAt(i.objectId, i);
813
+ e.objects.IMAGEDEF.forEach((i) => {
814
+ const r = new ze();
815
+ r.sourceFileName = i.fileName, this.processCommonObjectAttrs(i, r), o.setAt(r.objectId, r);
812
816
  });
813
817
  }
814
818
  processCommonObjectAttrs(e, t) {
@@ -821,9 +825,9 @@ class je extends xe {
821
825
  return o.flatMap((n) => t[n]);
822
826
  }
823
827
  isModelSpace(e) {
824
- return e && e.toUpperCase() == Be;
828
+ return e && e.toUpperCase() == Ue;
825
829
  }
826
830
  }
827
831
  export {
828
- je as AcDbLibreDwgConverter
832
+ _e as AcDbLibreDwgConverter
829
833
  };