@mlightcad/data-model 1.15.19 → 1.15.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/data-model.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
`,t=new Uint8Array(22);for(let e=0;e<i.length;e++)t[e]=i.charCodeAt(e);return t[20]=26,t[21]=0,t})(),u1=new TextDecoder("utf-8"),Li=(()=>{const i=new Int8Array(128);for(let t=0;t<10;t++)i[48+t]=t;for(let t=0;t<6;t++)i[65+t]=10+t,i[97+t]=10+t;return i})();function Fg(i){if(i.length<Ro.length)return!1;for(let t=0;t<Ro.length;t++)if(i[t]!==Ro[t])return!1;return!0}function de(i){return i===32||i>=9&&i<=13}function Vs(i){return de(i)||i===160||i===5760||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279||i>=8192&&i<=8202}function d1(i,t,e){const n=e-t;if(n<=0)return"";if(n<=16){let a="";for(let o=t;o<e;o++)a+=String.fromCharCode(i[o]);return a}const r=4096;let s="";for(let a=t;a<e;a+=r){const o=Math.min(a+r,e);s+=String.fromCharCode.apply(null,i.subarray(a,o))}return s}function gn(i,t,e,n,r){return n?r.decode(i.subarray(t,e)):d1(i,t,e)}function g1(i,t,e,n,r){if(n){const h=Number(gn(i,t,e,!0,r).trim());return Number.isFinite(h)?h:NaN}let s=t;for(;s<e&&de(i[s]);)s++;if(s>=e)return NaN;let a=1;const o=i[s];o===45?(a=-1,s++):o===43&&s++;let c=0,l=0;for(;s<e;){const h=i[s];if(h>=48&&h<=57)c=c*10+(h-48),l++,s++;else break}if(l===0)return NaN;for(;s<e;){if(!de(i[s]))return NaN;s++}return a*c}const _u=(Number.MAX_SAFE_INTEGER-9)/10;function f1(i,t,e){let n=t;for(;n<e&&de(i[n]);)n++;if(n>=e)return 0;let r=1;const s=i[n];s===45?(r=-1,n++):s===43&&n++;let a=0,o=0,c=!1,l=!1;for(;n<e;){const d=i[n];if(d<48||d>57)break;if(c=!0,n++,!(a===0&&d===48)){if(a>_u){l=!0;continue}a=a*10+(d-48)}}if(n<e&&i[n]===46)for(n++;n<e;){const d=i[n];if(d<48||d>57)break;if(c=!0,n++,a===0&&d===48){o--;continue}if(a>_u){l=!0;continue}a=a*10+(d-48),o--}if(n<e&&(i[n]===101||i[n]===69)){n++;let d=1;const g=i[n];g===45?(d=-1,n++):g===43&&n++;let f=0,p=0;for(;n<e;){const m=i[n];if(m<48||m>57)break;n++,p++,f<=1e4&&(f=f*10+(m-48))}if(p===0)return;o+=d*f}for(;n<e;){if(!de(i[n]))return;n++}if(!c)return 0;if(l)return;if(a===0)return r*a;if(o>22||o<-22)return;let h=1;const u=o<0?-o:o;for(let d=0;d<u;d++)h*=10;return r*(o<0?a/h:a*h)}function p1(i,t,e){let n=t;for(;!(n>=e);){const l=i[n];if(l>=128)return;if(!de(l))break;n++}let r=1;const s=i[n];if(s===45?(r=-1,n++):s===43&&n++,n<e&&i[n]>=128)return;let a=0,o=0,c=!1;for(;n<e;){const l=i[n];if(l<48||l>57)break;if(n++,c=!0,!(a===0&&l===48)){if(o>=15)return;a=a*10+(l-48),o++}}return c?r*a:0}function m1(i,t,e){let n=t;for(;n<e&&de(i[n]);)n++;let r=1;const s=i[n];s===45?(r=-1,n++):s===43&&n++;let a=0,o=0,c=!1;for(;n<e;){const l=i[n];if(l<48||l>57)break;if(n++,c=!0,!(a===0&&l===48)){if(o>=15)return;a=a*10+(l-48),o++}}for(;n<e;){if(!de(i[n]))return;n++}return c?r*a:0}function y1(i,t,e,n){if(!n){for(;t<e&&de(i[t]);)t++;for(;e>t&&de(i[e-1]);)e--;return t>=e?!1:!(e-t===1&&i[t]===48)}}function b1(i,t,e){for(;t<e&&Vs(i.charCodeAt(t));)t++;for(;e>t&&Vs(i.charCodeAt(e-1));)e--;const n=e-t>>>1,r=new Uint8Array(n);for(let s=0;s<n;s++){const a=Li[i.charCodeAt(t+s*2)&127],o=Li[i.charCodeAt(t+s*2+1)&127];r[s]=a<<4|o}return r}function _1(i,t,e,n,r){for(;t<e&&de(i[t]);)t++;for(;e>t&&de(i[e-1]);)e--;if(n){const o=gn(i,t,e,!0,r);return b1(o,0,o.length)}const s=e-t>>>1,a=new Uint8Array(s);for(let o=0;o<s;o++){const c=Li[i[t+o*2]&127],l=Li[i[t+o*2+1]&127];a[o]=c<<4|l}return a}function x1(i,t,e,n,r,s){const a=$i(i);if(a==="comment")return null;switch(a){case"string":return{code:i,type:a,value:Il(gn(t,e,n,r,s))};case"int":{const o=p1(t,e,n),c=o===void 0?parseInt(gn(t,e,n,r,s),10):o;return{code:i,type:a,value:Number.isFinite(c)?c:0}}case"long":{const o=m1(t,e,n);if(o!==void 0)return{code:i,type:a,value:o};const c=gn(t,e,n,r,s),l=Number(c);if(Number.isSafeInteger(l))return{code:i,type:a,value:l};try{return{code:i,type:a,value:BigInt(c.trim())}}catch{return{code:i,type:a,value:0}}}case"double":{const o=f1(t,e,n),c=o===void 0?Number(gn(t,e,n,r,s)):o;return{code:i,type:a,value:Number.isFinite(c)?c:0}}case"bool":{const o=y1(t,e,n,r);if(o!==void 0)return{code:i,type:a,value:o};const c=gn(t,e,n,r,s).trim();return{code:i,type:a,value:c!==""&&c!=="0"}}case"handle":{const o=gn(t,e,n,r,s);if(o.length===0)return{code:i,type:a,value:o};const c=o.charCodeAt(0),l=o.charCodeAt(o.length-1);return!Vs(c)&&!Vs(l)?{code:i,type:a,value:o}:{code:i,type:a,value:o.trim()}}case"binary":return{code:i,type:a,value:_1(t,e,n,r,s)};default:return null}}function w1(i){const t=i.toLowerCase().replace(/_/g,"-");return t==="utf-8"||t==="utf8"||t==="unicode-1-1-utf-8"}function bc(i,t="utf-8"){const e=w1(t)?u1:new TextDecoder(t);let n=i.length>=3&&i[0]===239&&i[1]===187&&i[2]===191?3:0,r=1,s,a=!1;function o(){if(n>=i.length)return;const l=n;let h=n,u=0;for(;h<i.length;){const g=i[h];if(g===10||g===13)break;u|=g,h++}let d=h;return d<i.length&&i[d]===13&&d++,d<i.length&&i[d]===10&&d++,n=d,r++,{start:l,end:h,nonAscii:u>=128}}function c(){for(;;){const l=o();if(l===void 0)return;const h=g1(i,l.start,l.end,l.nonAscii,e);if(Number.isNaN(h))continue;if(h===999){if(o()===void 0)return;continue}const u=o();if(u===void 0)return;const d=x1(h,i,u.start,u.end,u.nonAscii,e);if(d)return d}}return{kind:"ascii",next(){if(a){const l=s;return s=void 0,a=!1,l}return c()},peek(){return a||(s=c(),a=!0),s},position(){return{line:r,byteOffset:n}}}}function _c(i){return bc(i,"utf-8")}function v1(i,t){const e=El(i,{encoding:"utf-8",legacyR12:t});let n=null,r=null,s=!1,a=null;for(let o=e.next();o;o=e.next()){if(o.code===0&&o.type==="string"){const c=o.value;if(c==="SECTION"){const l=e.next();(l==null?void 0:l.code)===2&&l.type==="string"&&l.value==="HEADER"&&(s=!0),a=null;continue}if(c==="ENDSEC"&&s)return{version:n,encoding:r};a=null;continue}if(s){if(o.code===9&&o.type==="string"){a=o.value;continue}if(a==="$ACADVER"&&o.code===1&&o.type==="string")try{n=new Lt(o.value)}catch{}else a==="$DWGCODEPAGE"&&o.code===3&&o.type==="string"&&(r=kl(o.value));if(a!==null&&(a=null,n&&r))return{version:n,encoding:r}}}return{version:n,encoding:r}}function xu(i){return i.version&&!i.version.capabilities.supportsUtf8CodePage&&i.encoding?i.encoding:null}function zg(i){var c,l,h;const e=new TextDecoder("utf-8");let n=0,r="",s=null,a=null,o=!1;for(;n<i.byteLength;){const u=Math.min(n+65536,i.byteLength),d=i.slice(n,u);n=u;const f=(r+e.decode(d,{stream:!0})).split(/\r?\n/);r=f.pop()??"";for(let p=0;p<f.length;p++){const m=f[p].trim();if(m==="SECTION"&&((c=f[p+2])==null?void 0:c.trim())==="HEADER")o=!0;else if(m==="ENDSEC"&&o)return{version:s,encoding:a};if(o&&m==="$ACADVER"){const y=(l=f[p+2])==null?void 0:l.trim();y&&(s=new Lt(y))}else if(o&&m==="$DWGCODEPAGE"){const y=(h=f[p+2])==null?void 0:h.trim();y&&(a=kl(y))}if(s&&a)return{version:s,encoding:a}}}return{version:s,encoding:a}}function A1(i){const t=i.trim(),e=t.length>>>1,n=new Uint8Array(e);for(let r=0;r<e;r++){const s=Li[t.charCodeAt(r*2)&127],a=Li[t.charCodeAt(r*2+1)&127];n[r]=s<<4|a}return n}function S1(i,t){const e=$i(i);if(e==="comment")return null;switch(e){case"string":return{code:i,type:e,value:Il(t)};case"int":{const n=parseInt(t.trim(),10);return{code:i,type:e,value:Number.isFinite(n)?n:0}}case"long":{const n=t.trim(),r=Number(n);if(Number.isSafeInteger(r))return{code:i,type:e,value:r};try{return{code:i,type:e,value:BigInt(n)}}catch{return{code:i,type:e,value:0}}}case"double":{const n=Number(t.trim());return{code:i,type:e,value:Number.isFinite(n)?n:0}}case"bool":{const n=t.trim();return{code:i,type:e,value:n!=="0"&&n!==""}}case"handle":return{code:i,type:e,value:t.trim()};case"binary":return{code:i,type:e,value:A1(t)};default:return null}}function Xg(i){let t=0,e=1,n,r=!1;function s(){if(t>=i.length)return;let o=t;for(;o<i.length;){const l=i.charCodeAt(o);if(l===10||l===13)break;o++}const c=i.slice(t,o);return o<i.length&&i.charCodeAt(o)===13&&o++,o<i.length&&i.charCodeAt(o)===10&&o++,t=o,e++,c}function a(){for(;;){const o=s();if(o===void 0)return;const c=o.trim();if(c==="")continue;const l=s();if(l===void 0)return;const h=Number(c);if(!Number.isFinite(h)||h===999)continue;const u=S1(h,l);if(u)return u}}return{kind:"ascii",next(){if(r){const o=n;return n=void 0,r=!1,o}return a()},peek(){return r||(n=a(),r=!0),n},position(){return{line:e,byteOffset:t}}}}function P1(i){return _c(i)}function k1(i){const t=BigInt(Number.MAX_SAFE_INTEGER),e=-t;return i>=e&&i<=t?Number(i):i}function El(i,t={}){const e=t.encoding??"utf-8",n=t.legacyR12??!1,r=new TextDecoder(e),s=22,a=new DataView(i.buffer,i.byteOffset,i.byteLength);let o=i.length>=s?s:i.length,c,l=!1;function h(){if(o>=i.length)return;if(n){const w=i[o];if(w===void 0)return;if(w===255){if(o+3>i.length)return;o+=1;const P=i[o],S=i[o+1];return o+=2,S<<8|P}return o+=1,w}if(o+2>i.length)return;const _=a.getUint16(o,!0);return o+=2,_}function u(){const _=o;for(;o<i.length&&i[o]!==0;)o+=1;if(o>=i.length)return;const w=i.subarray(_,o);return o+=1,r.decode(w)}function d(){if(o+2>i.length)return;const _=a.getInt16(o,!0);return o+=2,_}function g(){if(o+4>i.length)return;const _=a.getInt32(o,!0);return o+=4,_}function f(){if(o+8>i.length)return;const _=a.getBigInt64(o,!0);return o+=8,k1(_)}function p(){if(o+8>i.length)return;const _=a.getFloat64(o,!0);return o+=8,_}function m(){if(o>=i.length)return;const _=i[o];if(_!==void 0)return o+=1,_!==0}function y(){if(o>=i.length)return;const _=i[o];if(_===void 0||(o+=1,o+_>i.length))return;const w=i.slice(o,o+_);return o+=_,w}function b(){for(;o<i.length;){const _=h();if(_===void 0)return;if(_===999){if(u()===void 0)return;continue}switch($i(_)){case"string":{const P=u();return P===void 0?void 0:{code:_,type:"string",value:Il(P)}}case"int":{const P=Tg(_)?g():d();return P===void 0?void 0:{code:_,type:"int",value:P}}case"long":{const P=f();return P===void 0?void 0:{code:_,type:"long",value:P}}case"double":{const P=p();return P===void 0?void 0:{code:_,type:"double",value:P}}case"bool":{const P=m();return P===void 0?void 0:{code:_,type:"bool",value:P}}case"handle":{const P=u();return P===void 0?void 0:{code:_,type:"handle",value:P}}case"binary":{const P=y();return P===void 0?void 0:{code:_,type:"binary",value:P}}case"comment":continue;default:u();continue}}}return{kind:"binary",next(){if(l){const _=c;return c=void 0,l=!1,_}return b()},peek(){return l||(c=b(),l=!0),c},position(){return{byteOffset:o}}}}function I1(i){const t=i.length;let e=0;for(;e<t;){const n=i[e];if(n<128){e++;continue}if(n<194)return!1;if(n<224){if(e+1>=t||(i[e+1]&192)!==128)return!1;e+=2;continue}if(n<240){if(e+2>=t)return!1;const r=i[e+1];if((r&192)!==128||n===224&&r<160||n===237&&r>=160||(i[e+2]&192)!==128)return!1;e+=3;continue}if(n<245){if(e+3>=t)return!1;const r=i[e+1];if((r&192)!==128||n===240&&r<144||n===244&&r>=144||(i[e+2]&192)!==128||(i[e+3]&192)!==128)return!1;e+=4;continue}return!1}return!0}function Yg(i,t={}){const e=i instanceof Uint8Array?i:new Uint8Array(i),n=t.encoding?Og(t.encoding):void 0;if(Fg(e)){let s=n,a=t.legacyR12;if(a==null){const c=e[22],l=e[23],h=e[24];c===0&&l===83?a=!0:a=!1}if(s==null){try{s=xu(v1(e,a))??void 0}catch{}s=s??"utf-8"}return El(e,{encoding:s,legacyR12:a})}if(n)return bc(e,n);if(I1(e))return _c(e);let r=null;try{const s=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);r=xu(zg(s))}catch{}return r?bc(e,r):_c(e)}var jg=(i=>(i[i.Ok=0]="Ok",i[i.EndOfFile=1]="EndOfFile",i[i.EndOfObject=2]="EndOfObject",i[i.InvalidDxfCode=3]="InvalidDxfCode",i[i.BadDxfSequence=4]="BadDxfSequence",i[i.NotThatKindOfClass=5]="NotThatKindOfClass",i[i.WrongMode=6]="WrongMode",i))(jg||{});const E1=(()=>{const i=`AutoCAD Binary DXF\r
|
|
3
3
|
`,t=new Uint8Array(22);for(let e=0;e<i.length;e++)t[e]=i.charCodeAt(e);return t[20]=26,t[21]=0,t})();class en{constructor(t={}){this._binaryLength=0,this._handseedValueLine=-1,this._pushed=[],this._status=0,this._errorMessage="",this._database=t.database,this._precision=Math.max(0,Math.min(16,t.precision??16)),this._version=t.version instanceof Lt?t.version:t.version!=null?new Lt(t.version):void 0,this._outputFormat=t.outputFormat??"ascii",this._lines=[],this._binaryChunks=[],this._handleMap=new Map,this._nextHandle=1,this._mode=t.reader?"read":"write",this._reader=t.reader,this._mode==="write"&&this._outputFormat==="binary"&&this.appendBinary(E1)}static forReading(t,e={}){return new en({...e,reader:t})}static fromBuffer(t,e={}){return en.forReading(Yg(t,{encoding:e.encoding}),e)}static fromString(t,e={}){return en.forReading(Xg(t),e)}get mode(){return this._mode}get database(){return this._database}set database(t){this._database=t}get precision(){return this._precision}setPrecision(t){return this._precision=Math.max(0,Math.min(16,t)),this}get version(){return this._version}get nextHandle(){return this._nextHandle}get filerStatus(){return this._status}get errorMessage(){return this._errorMessage}setVersion(t){return this._version=t instanceof Lt?t:new Lt(t),this}setError(t,e=""){return this._status=t,this._errorMessage=e,this}resetStatus(){return this._status=0,this._errorMessage="",this}toString(){if(this.assertWriteMode(),this._outputFormat==="binary")throw new Error("Use toBinary() for binary DXF output");return this._lines.join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`}toBinary(){if(this.assertWriteMode(),this._outputFormat!=="binary")throw new Error("Filer is not in binary output mode");const t=new Uint8Array(this._binaryLength);let e=0;for(const n of this._binaryChunks)t.set(n,e),e+=n.length;return t}registerHandle(t){return this._handleMap.has(t)||(/^[0-9A-F]+$/i.test(t)?this._handleMap.set(t,t.toUpperCase()):(this._handleMap.set(t,this._nextHandle.toString(16).toUpperCase()),this._nextHandle+=1)),this._handleMap.get(t)}computeHandseed(){let t=this._nextHandle-1;for(const e of this._handleMap.values()){const n=Number.parseInt(e,16);Number.isFinite(n)&&n>t&&(t=n)}return(t+1).toString(16).toUpperCase()}writeHandseedPlaceholder(){return this.writeString(9,"$HANDSEED"),this._outputFormat==="binary"?(this.writeString(5,this.computeHandseed()),this):(this.writeGroup(5,this.computeHandseed()),this._handseedValueLine=this._lines.length-1,this)}finalizeHandseed(){return this._handseedValueLine>=0&&this._handseedValueLine<this._lines.length&&(this._lines[this._handseedValueLine]=this.computeHandseed()),this}resolveHandle(t){if(t)return this.registerHandle(t)}get atEof(){var t;return this._mode!=="read"||this._pushed.length>0?!1:((t=this._reader)==null?void 0:t.peek())===void 0}position(){return this._mode!=="read"||!this._reader?{byteOffset:0}:this._reader.position()}get atEndOfObject(){if(this._mode!=="read")return!0;const t=this.peekPair();return t===void 0||t.code===0}get atExtendedData(){if(this._mode!=="read")return!1;const t=this.peekPair();return t?t.code===1001||t.code===1e3||t.code===1002:!1}atSubclassData(t){if(this._mode!=="read")return!1;const e=this.peekPair();return!e||e.code!==100||typeof e.value!="string"||e.value!==t?!1:(this.readPair(),!0)}peekItem(){const t=this.peekPair();return t?this.pairToTypedValue(t):void 0}readItem(){const t=this.readPair();if(!t){this._status=1;return}return this._status=0,this.pairToTypedValue(t)}pushBackItem(t){if(t&&"type"in t){this._pushed.push(t);return}if(t){this._pushed.push(this.typedValueToPair(t));return}this._lastRead&&this._pushed.push(this._lastRead)}skipToEndOfObject(){for(;!this.atEndOfObject&&!this.atEof;)this.readPair()}readString(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="string"||e.type==="handle"?e.value:String(e.value)}}readInt16(t){return this.readNumber(t)}readInt32(t){return this.readNumber(t)}readInt64(t){const e=this.readPair();if(!e)return;if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}if(e.type==="long"||e.type==="int"||e.type==="double")return e.value;if(e.type==="bool")return e.value?1:0;const n=Number(e.value);return Number.isFinite(n)?n:0}readDouble(t){return this.readNumber(t)}readBoolean(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="bool"?e.value:typeof e.value=="number"?e.value!==0:typeof e.value=="string"?e.value!=="0"&&e.value!=="":!!e.value}}readHandle(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="handle"||e.type==="string"?e.value:String(e.value)}}readObjectId(t){return this.readHandle(t)}readPoint2d(t){const e=this.readDouble(t);if(e===void 0)return;const n=this.peekPair();let r=0;return n&&n.code===t+10&&(r=this.readNumber()??0),new M(e,r)}readPoint3d(t){const e=this.readDouble(t);if(e===void 0)return;let n=0,r=0;const s=this.peekPair();s&&s.code===t+10&&(n=this.readNumber()??0);const a=this.peekPair();return a&&a.code===t+20&&(r=this.readNumber()??0),new x(e,n,r)}readVector3d(t){const e=this.readPoint3d(t);return e?new A(e.x,e.y,e.z):void 0}readCmColorInto(t,e=62,n=420){const r=this.peekPair();if(!r)return!1;if(r.code===e){const s=this.readNumber();return s!=null&&(t.colorIndex=s),!0}if(r.code===n){const s=this.readNumber();return s!=null&&t.setRGBValue(s),!0}return!1}writeGroup(t,e){if(this.assertWriteMode(),e==null)return this;if(this._outputFormat==="binary")return this.writeBinaryGroup(t,e);this._lines.push(String(Math.trunc(t)));const n=this.formatValue(e);return this._lines.push(n===""?"0":n),this}writeStart(t){return this.writeString(0,t)}get capabilities(){return(this._version??Lt.latest).capabilities}writeSubclassMarker(t){return this.capabilities.supportsSubclassMarkers?this.writeString(100,t):this}writeString(t,e){return e==null||e===""?this:this.writeGroup(t,e)}writeMTextContents(t){for(const e of Dg(t??""))this.writeString(e.code,e.value);return this}writeInt8(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt16(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt32(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt64(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeUInt16(t,e){return e==null?this:this.writeGroup(t,Math.max(0,e))}writeUInt32(t,e){return e==null?this:this.writeGroup(t,Math.max(0,e))}writeBoolean(t,e){return e==null?this:this.writeGroup(t,e?1:0)}writeBool(t,e){return this.writeBoolean(t,e)}writeDouble(t,e){return e==null||!Number.isFinite(e)?this:this.writeGroup(t,e)}writeAngle(t,e){return e==null||!Number.isFinite(e)?this:this.writeDouble(t,e*180/Math.PI)}writeHandle(t,e){if(!this.capabilities.supportsHandles)return this;const n=this.resolveHandle(e);return n?this.writeString(t,n):this}writeObjectId(t,e){return this.writeHandle(t,e)}writeLineWeight(t,e){return e==null||!this.capabilities.supportsLineWeight?this:this.writeInt16(t,e)}writePoint2d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this):this}writePoint3d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this.writeDouble(t+20,e.z??0),this):this}writeVector3d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this.writeDouble(t+20,e.z??0),this):this}writeCmColor(t,e=62,n=420){if(!t)return this;const r=t.colorIndex;r!=null&&this.writeInt16(e,r);const s=t.RGB;return s!=null&&t.colorIndex==null&&(this.capabilities.supportsTrueColor?this.writeInt32(n,s):this.writeInt16(e,7)),this}writeTransparency(t,e=440){return!t||t.method===exports.AcCmTransparencyMethod.ErrorValue||!this.capabilities.supportsTransparency?this:this.writeInt32(e,t.serialize())}writeResultBuffer(t){return this.writeTypedValues(t)}writeTypedValues(t){if(!t)return this;for(const e of t){const n=Number(e.code);if(n===1e3&&typeof e.value=="string"){const r=this.capabilities.supportsUtf8CodePage?Rg(e.value,yc):l1(this.sanitizeStringForDxfLine(e.value),yc);for(const s of r)this.writeGroup(1e3,s);continue}if(n===1004){const r=L1(e.value);if(r){for(const s of Bg(r,Ng))this._outputFormat==="binary"?this.writeGroup(1004,s):this.writeGroup(1004,wu(s));continue}}if(n>=1010&&n<=1013){const r=M1(e.value);if(r){this.writePoint3d(n,r);continue}}this.writeGroup(e.code,e.value)}return this}startSection(t){return this.writeStart("SECTION"),this.writeString(2,t),this}endSection(){return this.writeStart("ENDSEC"),this}startTable(t){return this.writeStart("TABLE"),this.writeString(2,t),this}endTable(){return this.writeStart("ENDTAB"),this}assertWriteMode(){if(this._mode!=="write")throw new Error("AcDbDxfFiler is in read mode")}appendBinary(t){this._binaryChunks.push(t),this._binaryLength+=t.length}writeBinaryCode(t){const e=Math.trunc(t)&65535;if(!this.capabilities.supportsSubclassMarkers){e<=255?this.appendBinary(Uint8Array.of(e)):this.appendBinary(Uint8Array.of(255,e&255,e>>8&255));return}const r=new Uint8Array(2);new DataView(r.buffer).setUint16(0,e,!0),this.appendBinary(r)}writeBinaryGroup(t,e){const n=$i(Math.trunc(t));switch(this.writeBinaryCode(Math.trunc(t)),n){case"string":case"handle":{const r=typeof e=="string"?this.encodeStringForWrite(e):this.formatValue(e),s=new TextEncoder().encode(r),a=new Uint8Array(s.length+1);a.set(s),a[s.length]=0,this.appendBinary(a);break}case"int":{const r=Math.trunc(Number(e))||0;if(Tg(Math.trunc(t))){const s=new Uint8Array(4);new DataView(s.buffer).setInt32(0,r,!0),this.appendBinary(s)}else{const s=new Uint8Array(2);new DataView(s.buffer).setInt16(0,r,!0),this.appendBinary(s)}break}case"long":{const r=new Uint8Array(8),s=new DataView(r.buffer);typeof e=="bigint"?s.setBigInt64(0,e,!0):s.setBigInt64(0,BigInt(Math.trunc(Number(e))||0),!0),this.appendBinary(r);break}case"double":{const r=new Uint8Array(8),s=Number(e);new DataView(r.buffer).setFloat64(0,Number.isFinite(s)?s:0,!0),this.appendBinary(r);break}case"bool":{const r=typeof e=="boolean"?e:Number(e)!==0&&e!==""&&e!=null;this.appendBinary(Uint8Array.of(r?1:0));break}case"binary":{const r=e instanceof Uint8Array?e:new Uint8Array(0),s=Math.min(255,r.length),a=new Uint8Array(1+s);a[0]=s,a.set(r.subarray(0,s),1),this.appendBinary(a);break}default:{const r=this.formatValue(e),s=new TextEncoder().encode(r===""?"0":r),a=new Uint8Array(s.length+1);a.set(s),a[s.length]=0,this.appendBinary(a);break}}return this}assertReadMode(){if(this._mode!=="read"||!this._reader)throw new Error("AcDbDxfFiler is not in read mode")}peekPair(){return this.assertReadMode(),this._pushed.length>0?this._pushed[this._pushed.length-1]:this._reader.peek()}readPair(){if(this.assertReadMode(),this._pushed.length>0){const e=this._pushed.pop();return this._lastRead=e,e}const t=this._reader.next();return this._lastRead=t,t}pushBackPair(t){this._pushed.push(t)}readNumber(t){const e=this.readPair();if(!e)return;if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}if(e.type==="double"||e.type==="int"||e.type==="long"){const r=e.value;return typeof r=="bigint"?Number(r):r}if(e.type==="bool")return e.value?1:0;const n=Number(e.value);return Number.isFinite(n)?n:0}pairToTypedValue(t){return{code:t.code,value:t.value}}typedValueToPair(t){const e=Number(t.code),n=t.value;return typeof n=="boolean"?{code:e,type:"bool",value:n}:typeof n=="number"?Number.isInteger(n)?{code:e,type:"int",value:n}:{code:e,type:"double",value:n}:typeof n=="bigint"?{code:e,type:"long",value:n}:n instanceof Uint8Array?{code:e,type:"binary",value:n}:{code:e,type:"string",value:String(n??"")}}formatValue(t){if(typeof t=="string")return this.encodeStringForWrite(t);if(typeof t=="boolean")return t?"1":"0";if(typeof t=="number"){if(!Number.isFinite(t))return"0";if(Number.isInteger(t))return String(t);const n=t.toFixed(this._precision).replace(/\.?0+$/,"");return n===""||n==="-"?"0":n}return t instanceof Uint8Array?wu(t):String(t)}sanitizeStringForDxfLine(t){return t.replace(/\r\n|\r|\n/g," ").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"")}encodeStringForWrite(t){const e=this.sanitizeStringForDxfLine(t);return this.capabilities.supportsUtf8CodePage?e:h1(e)}}function wu(i){let t="";for(let e=0;e<i.length;e++)t+=(i[e]??0).toString(16).padStart(2,"0").toUpperCase();return t}function T1(i){const t=i.replace(/\s+/g,""),e=t.length>>>1,n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=Number.parseInt(t.slice(r*2,r*2+2),16)||0;return n}function L1(i){if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i)&&!(i instanceof DataView)){const t=i;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof i=="string"){const t=i.replace(/\s+/g,"");return t.length===0?new Uint8Array(0):!/^[0-9A-Fa-f]*$/.test(t)||t.length%2!==0?void 0:T1(t)}if(Array.isArray(i)&&i.every(t=>typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=255))return Uint8Array.from(i)}function M1(i){if(!(i==null||typeof i=="number"||typeof i=="string")){if(typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"){const t=i;return{x:t.x,y:t.y,z:t.z??0}}if(Array.isArray(i)&&typeof i[0]=="number"&&typeof i[1]=="number")return{x:i[0],y:i[1],z:typeof i[2]=="number"?i[2]:0}}}var Cn=256,Vg=[],vu=256,cs;for(;Cn--;)Vg[Cn]=(Cn+256).toString(16).substring(1);function C1(i){var t=0,e=11;if(!cs||Cn+e>vu*2)for(cs="",Cn=0;t<vu;t++)cs+=Vg[Math.random()*256|0];return cs.substring(Cn,Cn+++e)}class ze{constructor(t){if(this._values=[],t)for(const e of t)this._values.push({...e})}get length(){return this._values.length}at(t){return this._values[t]}add(t){this._values.push(t)}addRange(t){for(const e of t)this._values.push(e)}clear(){this._values.length=0}toArray(){return this._values.map(t=>({...t}))}clone(){return new ze(this._values)}[Symbol.iterator](){return this._values[Symbol.iterator]()}}const yn="TEMP_";let Xn;function Ug(i){Xn=i}function Hg(i){Xn&&(Xn().workingDatabase=i)}function Gg(){if(Xn)return Xn().workingDatabase;throw new Error("The current working database must be set before using it!")}const Ee=class Ee{constructor(t,e){t=t||{},this._attrs=new lc(t,e),this._attrs.get("objectId")||(this._database?this._attrs.set("objectId",this._database.generateHandle()):this._attrs.set("objectId",this.generateTemporaryHandle()))}generateTemporaryHandle(){return yn+C1()}get attrs(){return this._attrs}getAttr(t){const e=this._attrs.get(t);if(e===void 0)throw new Error(`[AcDbObject] Attribute name '${t}' does't exist in this object!`);return e}getAttrWithoutException(t){return this._attrs.get(t)}setAttr(t,e){this._attrs.set(t,e)}get objectId(){return this.getAttr("objectId")}set objectId(t){this._attrs.set("objectId",t),t&&!t.startsWith(yn)&&this._database&&this._database.updateMaxHandle(t)}get isTemp(){const t=this.getAttrWithoutException("objectId");return!!t&&t.startsWith(yn)}get ownerId(){return this.getAttr("ownerId")}set ownerId(t){this._attrs.set("ownerId",t)}get extensionDictionary(){return this.getAttrWithoutException("extensionDictionary")}set extensionDictionary(t){this._attrs.set("extensionDictionary",t)}get database(){if(this._database)return this._database;if(Xn)return Xn().workingDatabase;throw new Error("The current working database must be set before using it!")}set database(t){this.assignDatabase(t)}assignDatabase(t){this._database!==t&&(this._database=t,this.onDatabaseChanged(t))}onDatabaseChanged(t){}findImportedXDataRange(t){const e=this._importedXData;if(!e)return;let n=0;for(;n<e.length;){if(Number(e[n])!==Z.ExtendedDataRegAppName){n+=2;continue}const r=String(e[n+1]??"");let s=n+2;for(;s<e.length&&Number(e[s])!==Z.ExtendedDataRegAppName;)s+=2;if(r===t)return[n,s];n=s}}removeImportedXData(t){const e=this._importedXData,n=this.findImportedXDataRange(t);!e||!n||(e.splice(n[0],n[1]-n[0]),e.length===0&&(this._importedXData=void 0))}rememberXDataApp(t){if(!t)return;const e=this._xDataOrder??(this._xDataOrder=[]);e.indexOf(t)===-1&&e.push(t)}forgetXDataApp(t){const e=this._xDataOrder;if(!e)return;const n=e.indexOf(t);n>=0&&e.splice(n,1),e.length===0&&(this._xDataOrder=void 0)}clearMaterializedXData(t){const e=this._xDataMap;e&&(e.delete(t),e.size===0&&(this._xDataMap=void 0))}onXDataChanged(t){}notifyXDataChanged(t){this.onXDataChanged(t)}*importedXDataValues(t,e){const n=this._importedXData;if(n)for(let r=t;r<e;r+=2)yield{code:Number(n[r]),value:n[r+1]}}setImportedXData(t){const e=[];let n,r;for(const s of t){const a=Number(s.code);if(a===Z.ExtendedDataRegAppName){n&&r&&e.push({appId:n,flat:r}),n=String(s.value),r=[a,s.value];continue}!n||!r||r.push(a,s.value)}if(n&&r&&e.push({appId:n,flat:r}),e.length!==0)for(const s of e){if(!s.appId)continue;this.removeImportedXData(s.appId),this.clearMaterializedXData(s.appId);const a=this._importedXData??(this._importedXData=[]);for(const o of s.flat)a.push(o);this.rememberXDataApp(s.appId),this.notifyXDataChanged(s.appId)}}getXData(t){var s;const e=(s=this._xDataMap)==null?void 0:s.get(t);if(e)return e;const n=this.findImportedXDataRange(t);if(!n)return;const r=new ze;for(const a of this.importedXDataValues(n[0],n[1]))r.add(a);return this.removeImportedXData(t),(this._xDataMap??(this._xDataMap=new Map)).set(t,r),r}*iterateXData(t){var r;const e=(r=this._xDataMap)==null?void 0:r.get(t);if(e){yield*e;return}const n=this.findImportedXDataRange(t);n&&(yield*this.importedXDataValues(n[0],n[1]))}setXData(t){for(const e of t)if(e.code===Z.ExtendedDataRegAppName){const n=e.value;this.removeImportedXData(n),(this._xDataMap??(this._xDataMap=new Map)).set(n,t),this.rememberXDataApp(n),this.notifyXDataChanged(n)}}removeXData(t){this.removeImportedXData(t),this.clearMaterializedXData(t),this.forgetXDataApp(t),this.notifyXDataChanged(t)}createExtensionDictionary(){const t=this.extensionDictionary;if(t)return t;const e=this.database;if(e)return e.createExtensionDictionaryFor(this)}close(){}getOwnSnapshotKeys(){return Reflect.ownKeys(this).filter(t=>typeof t=="string"&&!Ee.SNAPSHOT_EXCLUDED_KEYS.has(t))}cloneAttrs(t){const e=this.cloneValue(t.attributes);return new lc(e)}restoreAttrsFrom(t){const e=this.cloneValue(t.attributes),n=this._attrs.attributes;for(const r of Object.keys(n))r in e||this._attrs.set(r,void 0,{unset:!0,silent:!0});this._attrs.set(e,{silent:!0})}restoreXDataMapFrom(t){if(!t||t.size===0){this._xDataMap=void 0;return}const e=new Map;for(const[n,r]of t.entries())e.set(n,this.cloneValue(r));this._xDataMap=e}copySnapshotStateTo(t){t._attrs=this.cloneAttrs(this._attrs),t._xDataMap=this._xDataMap?this.cloneValue(this._xDataMap):void 0;const e=this,n=t;for(const r of this.getOwnSnapshotKeys())Ee.SNAPSHOT_INTERNAL_KEYS.has(r)||(n[r]=this.cloneValue(e[r]))}clone(){const t=Object.create(Object.getPrototypeOf(this));return this.copySnapshotStateTo(t),t.objectId=this.generateTemporaryHandle(),t}clonePreservingIdentity(){const t=this.clone(),e=this.getAttrWithoutException("objectId");e&&t._attrs.set("objectId",e);const n=this.getAttrWithoutException("ownerId");return n!==void 0&&t._attrs.set("ownerId",n),this._database&&(t._database=this._database),t}restoreFrom(t){const e=this.objectId,n=this._database;this.restoreAttrsFrom(t._attrs),this.restoreXDataMapFrom(t._xDataMap);const r=t,s=this,a=new Set(t.getOwnSnapshotKeys());for(const o of a)Ee.SNAPSHOT_INTERNAL_KEYS.has(o)||Ee.SNAPSHOT_EXCLUDED_KEYS.has(o)||(s[o]=this.cloneValue(r[o]));for(const o of this.getOwnSnapshotKeys())Ee.SNAPSHOT_INTERNAL_KEYS.has(o)||Ee.SNAPSHOT_EXCLUDED_KEYS.has(o)||a.has(o)||delete s[o];this.objectId=e,n&&(this.database=n)}cloneValue(t){if(t==null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(Array.isArray(t))return t.map(r=>this.cloneValue(r));if(t instanceof Map){const r=new Map;for(const[s,a]of t.entries())r.set(this.cloneValue(s),this.cloneValue(a));return r}if(t instanceof Set){const r=new Set;for(const s of t.values())r.add(this.cloneValue(s));return r}if(ArrayBuffer.isView(t)){if(t instanceof DataView)return new DataView(t.buffer.slice(0));const r=t.constructor;return new r(t)}if(t instanceof ArrayBuffer)return t.slice(0);if(typeof Blob<"u"&&t instanceof Blob||t&&typeof t=="object"&&"tables"in t&&"transactionManager"in t)return t;if("clone"in t&&typeof t.clone=="function")return t.clone();const e=Object.create(Object.getPrototypeOf(t)),n=t;for(const r of Object.keys(n))e[r]=this.cloneValue(n[r]);return e}dxfOut(...t){const[e,n=!1]=t;return e.writeHandle(5,this.objectId),e.writeObjectId(330,this.ownerId),e.writeObjectId(360,this.extensionDictionary),this.dxfOutFields(e),n&&this.dxfOutXData(e),this}dxfOutXData(t){var s;const e=this._xDataOrder;if(e){for(const a of e){const o=(s=this._xDataMap)==null?void 0:s.get(a);if(o){t.writeResultBuffer(o);continue}const c=this.findImportedXDataRange(a);c&&t.writeTypedValues(this.importedXDataValues(c[0],c[1]))}return}const n=this._importedXData;if(n){let a=0;for(;a<n.length;){let o=a+2;for(;o<n.length&&Number(n[o])!==Z.ExtendedDataRegAppName;)o+=2;t.writeTypedValues(this.importedXDataValues(a,o)),a=o}}const r=this._xDataMap;if(r)for(const a of r.values())t.writeResultBuffer(a)}dxfOutFields(t){return this}dxfIn(t){for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===5||n===105)this.objectId=String(e.value);else if(n===330)this.ownerId=String(e.value);else if(n===360)this.extensionDictionary=String(e.value);else if(n===102)this.dxfInControlString(t,String(e.value));else if(n===100){t.pushBackItem(e);break}else{t.pushBackItem(e);break}}return this.dxfInFields(t),t.atExtendedData&&this.dxfInXData(t),this}dxfInControlString(t,e){const n=e==="{ACAD_XDICTIONARY"||e==="ACAD_XDICTIONARY";for(;!t.atEndOfObject&&!t.atEof;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===102){const a=String(r.value);if(a==="}"||a==="")break;this.dxfInControlString(t,a);continue}n&&s===360&&!this.extensionDictionary&&(this.extensionDictionary=String(r.value))}}dxfInFields(t){return this}dxfInXData(t){let e;const n=()=>{e&&e.length>0&&this.setXData(e),e=void 0};for(;!t.atEndOfObject&&!t.atEof;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===1001)n(),e=new ze([{code:r.code,value:r.value}]);else if(s>=1e3&&s<=1071)e||(e=new ze),e.add({code:r.code,value:r.value});else{t.pushBackItem(r);break}}n()}};Ee.SNAPSHOT_EXCLUDED_KEYS=new Set(["_database","transactionManager"]),Ee.SNAPSHOT_INTERNAL_KEYS=new Set(["_attrs","_xDataMap"]);let mt=Ee;exports.AcGiArrowType=void 0;(function(i){i.ClosedFilled="",i.Dot="_DOT",i.DotSmall="_DOTSMALL",i.DotBlank="_DOTBLANK",i.Origin="_ORIGIN",i.Origin2="_ORIGIN2",i.Open="_OPEN",i.Open90="_OPEN90",i.Open30="_OPEN30",i.Closed="_CLOSED",i.Small="_SMALL",i.None="_NONE",i.Oblique="_OBLIQUE",i.BoxFilled="_BOXFILLED",i.Box="_BOXBLANK",i.ClosedBlank="_CLOSEDBLANK",i.DatumBlank="_DATUMBLANK",i.DatumFilled="_DATUMFILLED",i.Integral="_INTEGRAL",i.ArchTick="_ARCHTICK"})(exports.AcGiArrowType||(exports.AcGiArrowType={}));exports.AcGiLineWeight=void 0;(function(i){i[i.ByBlock=-2]="ByBlock",i[i.ByDIPs=-4]="ByDIPs",i[i.ByLayer=-1]="ByLayer",i[i.ByLineWeightDefault=-3]="ByLineWeightDefault",i[i.LineWeight000=0]="LineWeight000",i[i.LineWeight005=5]="LineWeight005",i[i.LineWeight009=9]="LineWeight009",i[i.LineWeight013=13]="LineWeight013",i[i.LineWeight015=15]="LineWeight015",i[i.LineWeight018=18]="LineWeight018",i[i.LineWeight020=20]="LineWeight020",i[i.LineWeight025=25]="LineWeight025",i[i.LineWeight030=30]="LineWeight030",i[i.LineWeight035=35]="LineWeight035",i[i.LineWeight040=40]="LineWeight040",i[i.LineWeight050=50]="LineWeight050",i[i.LineWeight053=53]="LineWeight053",i[i.LineWeight060=60]="LineWeight060",i[i.LineWeight070=70]="LineWeight070",i[i.LineWeight080=80]="LineWeight080",i[i.LineWeight090=90]="LineWeight090",i[i.LineWeight100=100]="LineWeight100",i[i.LineWeight106=106]="LineWeight106",i[i.LineWeight120=120]="LineWeight120",i[i.LineWeight140=140]="LineWeight140",i[i.LineWeight158=158]="LineWeight158",i[i.LineWeight200=200]="LineWeight200",i[i.LineWeight211=211]="LineWeight211"})(exports.AcGiLineWeight||(exports.AcGiLineWeight={}));var to=(function(){function i(t){t===void 0&&(t={});var e,n,r,s;this.database=t.database,this.foregroundOnDark=(e=t.foregroundOnDark)!==null&&e!==void 0?e:Sr,this.foregroundOnLight=(n=t.foregroundOnLight)!==null&&n!==void 0?n:Pr,this.backgroundIsDark=(r=t.backgroundIsDark)!==null&&r!==void 0?r:!0,this.fallbackRgb=(s=t.fallbackRgb)!==null&&s!==void 0?s:16777215}return i.prototype.resolveSubEntityTraitsRgb=function(t){var e,n,r,s=t.color;return s.isForeground?this.backgroundIsDark?this.foregroundOnDark:this.foregroundOnLight:s.isByLayer||s.isByBlock?(e=this.fallbackRgb)!==null&&e!==void 0?e:16777215:(r=(n=s.RGB)!==null&&n!==void 0?n:this.fallbackRgb)!==null&&r!==void 0?r:16777215},i.fromBackgroundColor=function(t,e){return t===void 0&&(t=Wg),new i({database:e,foregroundOnDark:Sr,foregroundOnLight:Pr,backgroundIsDark:!$g(t),fallbackRgb:16777215})},i})(),Wg=0,Sr=16777215,Pr=0,O1=16777215,N1=128,D1=new to({database:void 0,foregroundOnDark:Sr,foregroundOnLight:Pr,backgroundIsDark:!0,fallbackRgb:16777215});function $g(i){var t=i>>16&255,e=i>>8&255,n=i&255;return .299*t+.587*e+.114*n>N1}function R1(i){var t=to.fromBackgroundColor(i);return t.backgroundIsDark?t.foregroundOnDark:t.foregroundOnLight}function B1(i){return i?Pr:Sr}function F1(i,t){return to.fromBackgroundColor(t).resolveSubEntityTraitsRgb(i)}exports.AcGiMTextFlowDirection=void 0;(function(i){i[i.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",i[i.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",i[i.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM",i[i.BOTTOM_TO_TOP=4]="BOTTOM_TO_TOP",i[i.BY_STYLE=5]="BY_STYLE"})(exports.AcGiMTextFlowDirection||(exports.AcGiMTextFlowDirection={}));exports.AcGiMTextAttachmentPoint=void 0;(function(i){i[i.TopLeft=1]="TopLeft",i[i.TopCenter=2]="TopCenter",i[i.TopRight=3]="TopRight",i[i.MiddleLeft=4]="MiddleLeft",i[i.MiddleCenter=5]="MiddleCenter",i[i.MiddleRight=6]="MiddleRight",i[i.BottomLeft=7]="BottomLeft",i[i.BottomCenter=8]="BottomCenter",i[i.BottomRight=9]="BottomRight",i[i.BaselineLeft=10]="BaselineLeft",i[i.BaselineCenter=11]="BaselineCenter",i[i.BaselineRight=12]="BaselineRight"})(exports.AcGiMTextAttachmentPoint||(exports.AcGiMTextAttachmentPoint={}));exports.AcGiRenderMode=void 0;(function(i){i[i.OPTIMIZED_2D=0]="OPTIMIZED_2D",i[i.WIREFRAME=1]="WIREFRAME",i[i.HIDDEN_LINE=2]="HIDDEN_LINE",i[i.FLAT_SHADED=3]="FLAT_SHADED",i[i.GOURAUD_SHADED=4]="GOURAUD_SHADED",i[i.FLAT_SHADED_WITH_WIREFRAME=5]="FLAT_SHADED_WITH_WIREFRAME",i[i.GOURAUD_SHADED_WITH_WIREFRAME=6]="GOURAUD_SHADED_WITH_WIREFRAME"})(exports.AcGiRenderMode||(exports.AcGiRenderMode={}));exports.AcGiOrthographicType=void 0;(function(i){i[i.NON_ORTHOGRAPHIC=0]="NON_ORTHOGRAPHIC",i[i.TOP=1]="TOP",i[i.BOTTOM=2]="BOTTOM",i[i.FRONT=3]="FRONT",i[i.BACK=4]="BACK",i[i.LEFT=5]="LEFT",i[i.RIGHT=6]="RIGHT"})(exports.AcGiOrthographicType||(exports.AcGiOrthographicType={}));exports.AcGiDefaultLightingType=void 0;(function(i){i[i.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",i[i.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS"})(exports.AcGiDefaultLightingType||(exports.AcGiDefaultLightingType={}));var Au=function(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var n=e.call(i),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return s},Su=function(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return i.concat(s||Array.prototype.slice.call(t))},qg=(function(){function i(){this._number=-1,this._id="",this._groupId="",this._centerPoint=new x,this._height=0,this._width=0,this._viewCenter=new x,this._viewTarget=new x,this._viewTwistAngle=0,this._viewHeight=0,this._frozenLayerIds=[],this._frozenLayers=[],this._annotationScaleName="",this._annotationScaleFactor=0}return Object.defineProperty(i.prototype,"number",{get:function(){return this._number},set:function(t){this._number=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupId",{get:function(){return this._groupId},set:function(t){this._groupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"frozenLayerIds",{get:function(){return this._frozenLayerIds},set:function(t){this._frozenLayerIds=Su([],Au(t),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"frozenLayers",{get:function(){return this._frozenLayers},set:function(t){this._frozenLayers=Su([],Au(t),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"annotationScaleName",{get:function(){return this._annotationScaleName},set:function(t){this._annotationScaleName=t??""},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"annotationScaleFactor",{get:function(){return this._annotationScaleFactor},set:function(t){this._annotationScaleFactor=t>0?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"centerPoint",{get:function(){return this._centerPoint},set:function(t){this._centerPoint.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"box",{get:function(){var t=new Ct;return t.setFromCenterAndSize(this.centerPoint,{x:this.width,y:this.height}),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewCenter",{get:function(){return this._viewCenter},set:function(t){this._viewCenter.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewTarget",{get:function(){return this._viewTarget},set:function(t){this._viewTarget.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewTwistAngle",{get:function(){return this._viewTwistAngle},set:function(t){this._viewTwistAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewHeight",{get:function(){return this._viewHeight},set:function(t){this._viewHeight=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewWidth",{get:function(){return this.viewHeight*(this.width/this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewBox",{get:function(){var t=i.dcsCenterToWcs(this.viewCenter,this.viewTarget,this.viewTwistAngle),e=new Ct;return e.setFromCenterAndSize(t,{x:this.viewWidth,y:this.viewHeight}),e},enumerable:!1,configurable:!0}),i.dcsCenterToWcs=function(t,e,n){var r=t.x,s=t.y;if(Number.isFinite(n)&&n!==0){var a=Math.cos(n),o=Math.sin(n);r=t.x*a-t.y*o,s=t.x*o+t.y*a}return e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&(r+=e.x,s+=e.y),new x(r,s,0)},i.prototype.clone=function(){var t=new i;return t.id=this.id,t.groupId=this.groupId,t.number=this.number,t.centerPoint.copy(this.centerPoint),t.height=this.height,t.width=this.width,t.viewCenter.copy(this.viewCenter),t.viewTarget.copy(this.viewTarget),t.viewTwistAngle=this.viewTwistAngle,t.viewHeight=this.viewHeight,t.frozenLayerIds=this.frozenLayerIds,t.frozenLayers=this.frozenLayers,t.annotationScaleName=this.annotationScaleName,t.annotationScaleFactor=this.annotationScaleFactor,t},i.prototype.copy=function(t){return this.id=t.id,this.groupId=t.groupId,this.number=t.number,this.centerPoint.copy(t.centerPoint),this.height=t.height,this.width=t.width,this.viewCenter.copy(t.viewCenter),this.viewTarget.copy(t.viewTarget),this.viewTwistAngle=t.viewTwistAngle,this.viewHeight=t.viewHeight,this.frozenLayerIds=t.frozenLayerIds,this.frozenLayers=t.frozenLayers,this.annotationScaleName=t.annotationScaleName,this.annotationScaleFactor=t.annotationScaleFactor,this},i})();const wn="Continuous",ft="Standard",Qe="Standard",Je="Standard",z1="ANSI31",Kg="ANGLE",xi="SOLID";function cr(i){return i==null?!1:i.trim().toUpperCase().replace(/^_+/,"")===xi}const Zg="USER",Qg="LINEAR",kt="ByLayer",Ne="ByBlock",Mi="*Active",xc="mlightcad",wc="ACAD",X1=Object.freeze({x:0,y:0}),Y1=Object.freeze({x:0,y:0}),j1=Object.freeze({x:1,y:1}),V1=Object.freeze({x:0,y:0,z:1}),U1=Object.freeze({x:0,y:0,z:0}),Jg=150,vc=1,Ac=255,tf=12,Sc=1,Pc=255,H1=0,G1=32767,W1=0,$1=2,ef=5,kc=1,Ic=255,nf=1,rf=2,sf=4,af=8,of=16,cf=32,lf=64,hf=0,uf=0,df=nf|rf|sf|af|of|cf|lf,Us=0,eo=0,no=1,Hs=5,io=1,ro=25,Gs=1,so=0,ao=1,Ws=6,oo=0,co=14;function Ce(i,t,e,n){const r=Math.trunc(t);if(!Number.isFinite(r)||r<e||r>n)throw new Error(`Invalid ${i} value! Valid range is ${e} to ${n}.`);return r}function sr(i,t,e){const n=Math.trunc(i);if(!(!Number.isFinite(n)||n<t||n>e))return n}var Ln=(i=>(i[i.OnBothOperands=0]="OnBothOperands",i[i.ExtendThis=1]="ExtendThis",i[i.ExtendArg=2]="ExtendArg",i[i.ExtendBoth=3]="ExtendBoth",i))(Ln||{});const oh=class oh extends mt{constructor(){super(...arguments),this._colorIsByLayerDefault=!1,this._visibility=!0,this._transparencySet=!1,this._dxfPaperSpace=!1}get type(){return this.constructor.typeName}get layer(){return this._layer==null&&(this._layer=this.database.clayer??"0"),this._layer}set layer(t){this._layer=t}get color(){return this.getEntityColor()}set color(t){this.setEntityColor(t)}get resolvedColor(){return this.resolveStandardColor()}resolveStandardColor(){let t=this.color;if(t.isByLayer){const e=this.getLayerColor();e&&e.RGB!=null&&(t=e)}else t.isByBlock&&(t=new V().setForeground());return t}get lineType(){var t;return this._lineType==null&&(this._lineType=((t=this.database)==null?void 0:t.celtype)??kt),this._lineType}set lineType(t){t?t.toUpperCase()==="BYLAYER"?this._lineType=kt:t.toUpperCase()==="BYBLOCK"?this._lineType=Ne:this._lineType=t:this._lineType=kt}get lineWeight(){return this._lineWeight==null&&(this._lineWeight=this.database.celweight??exports.AcGiLineWeight.ByLayer),this._lineWeight}set lineWeight(t){this._lineWeight=t}get linetypeScale(){return this._linetypeScale==null&&(this._linetypeScale=this.database.celtscale??-1),this._linetypeScale}set linetypeScale(t){this._linetypeScale=t}get visibility(){return this._visibility}set visibility(t){this._visibility=t}get transparency(){return this._transparency??(this._transparency=new St)}set transparency(t){this._transparency=t.clone(),this._transparencySet=!0}hasExplicitLayer(){return this._layer!=null}hasExplicitColor(){return this._color!=null||this._colorIsByLayerDefault}getEntityColor(){return this._color==null&&(this._colorIsByLayerDefault?this._color=new V().setByLayer():(this._color=new V,this.database.cecolor&&this._color.copy(this.database.cecolor))),this._color}setEntityColor(t){this._colorIsByLayerDefault=!1,this._color==null&&(this._color=new V),this._color.copy(t)}shouldResolveColorFromCecolor(){return!this._colorIsByLayerDefault}applyDxfFileDefaults(){this._color==null&&(this._colorIsByLayerDefault=!0)}hasExplicitTransparency(){return this._transparencySet}dxfOutFields(t){t.writeSubclassMarker("AcDbEntity"),t.writeString(8,this.layer),t.writeString(6,this.lineType),t.writeDouble(48,this.linetypeScale),t.writeInt16(60,this.visibility?0:1),t.writeCmColor(this.color),t.writeLineWeight(370,this.lineWeight),t.writeTransparency(this.transparency);const e=this.database.tables.blockTable.getIdAt(this.ownerId);return e!=null&&e.isPaperSapce&&t.writeInt16(67,1),this}dxfInFields(t){super.dxfInFields(t);const e=t.atSubclassData("AcDbEntity");if(!e){const r=t.peekItem();if(r&&Number(r.code)===100)return this}let n;for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===100){t.pushBackItem(r);break}switch(s){case 8:this.layer=String(r.value);break;case 6:this.lineType=String(r.value);break;case 48:this.linetypeScale=Number(r.value);break;case 60:this.visibility=Number(r.value)===0;break;case 62:n==null&&(n=new V),n.colorIndex=Number(r.value);break;case 420:n==null&&(n=new V),n.setRGBValue(Number(r.value));break;case 370:this.lineWeight=Number(r.value);break;case 440:this.transparency=St.deserialize(Number(r.value));break;case 67:this._dxfPaperSpace=Number(r.value)!==0;break;case 410:break;case 92:case 160:case 310:break;case 284:case 347:case 380:case 390:case 430:break;default:if(!e)return t.pushBackItem(r),n!=null&&(this.color=n),this.applyDxfFileDefaults(),this;break}}return n!=null&&(this.color=n),this.applyDxfFileDefaults(),this}get dxfPaperSpace(){return this._dxfPaperSpace}resolveEffectiveProperties(){this._layer==null&&(this._layer=this.database.clayer??"0"),this._color==null&&this.shouldResolveColorFromCecolor()&&(this._color=new V,this.database.cecolor&&this._color.copy(this.database.cecolor)),this._lineType==null&&(this._lineType=this.database.celtype??kt),this._linetypeScale==null&&(this._linetypeScale=this.database.celtscale??-1),this._lineWeight==null&&(this._lineWeight=this.database.celweight??exports.AcGiLineWeight.ByLayer)}get properties(){return{type:this.type,groups:[this.getGeneralProperties()]}}subGetGripPoints(){return new Array}subMoveGripPointsAt(t,e){return this}subGetOsnapPoints(t,e,n,r,s,a){}intersectWith(t,e=Ln.OnBothOperands,n){const r=this.subGetIntersectCurves(),s=t.subGetIntersectCurves();if(r.length===0||s.length===0)return[];const a=e===Ln.ExtendThis||e===Ln.ExtendBoth,o=e===Ln.ExtendArg||e===Ln.ExtendBoth;return Fb(r,s,a,o,n)}subGetIntersectCurves(){return[]}transformBy(t){return this}erase(){return this.database.tables.blockTable.removeEntity(this.objectId)}get directBatchPrimitive(){return null}worldDraw(t,e){if(!this.database.isLayerDrawable(this.layer))return;const n=t.subEntityTraits;n.color=this.resolvedColor,n.lineType=this.lineStyle,n.lineTypeScale=this.linetypeScale,n.lineWeight=this.lineWeight,n.transparency=this.transparency,n.layer=this.layer,n.drawOrder=0,n.isBackgroundFill=!1,"thickness"in this&&(n.thickness=this.thickness),t.context.database=this.database;const r=this.subWorldDraw(t,e);return this.attachEntityInfo(r),r}getGeneralProperties(){return{groupName:"general",properties:[{name:"handle",type:"int",editable:!1,accessor:{get:()=>this.objectId}},{name:"color",type:"color",editable:!0,accessor:{get:()=>this.color,set:t=>{this.color=t}}},{name:"layer",type:"string",editable:!0,accessor:{get:()=>this.layer,set:t=>{this.layer=t}}},{name:"linetype",type:"linetype",editable:!0,accessor:{get:()=>this.lineType,set:t=>{this.lineType=t}}},{name:"linetypeScale",type:"float",editable:!0,accessor:{get:()=>this.linetypeScale,set:t=>{this.linetypeScale=t}}},{name:"lineWeight",type:"lineweight",editable:!0,accessor:{get:()=>this.lineWeight,set:t=>{this.lineWeight=t}}},{name:"transparency",type:"transparency",editable:!0,accessor:{get:()=>this.transparency,set:t=>{this.transparency=t}}}]}}get lineStyle(){var r;const{type:t,name:e}=this.getLineType(),n=(r=this.database)==null?void 0:r.tables.linetypeTable.getAt(e);return n?{type:t,...n.linetype}:{type:t,name:e,standardFlag:0,description:"",totalPatternLength:0}}getLineType(){if(this.lineType==kt){const t=this.database.tables.layerTable.getAt(this.layer);if(t&&t.linetype)return{type:"ByLayer",name:t.linetype}}else return this.lineType==Ne?{type:"ByBlock",name:wn}:{type:"UserSpecified",name:this.lineType};return{type:"UserSpecified",name:wn}}getLayerColor(){const t=this.database.tables.layerTable.getAt(this.layer);return t!=null?t.color:null}attachEntityInfo(t){t&&(t.objectId=this.objectId,this.attrs.has("ownerId")&&(t.ownerId=this.ownerId),t.layerName=this.layer,t.visible=this.visibility)}};oh.typeName="Entity";let st=oh;class gf extends mt{constructor(){super(...arguments),this._classVersion=4,this._isDefault=!1}get classVersion(){return this._classVersion}set classVersion(t){this._classVersion=t}get isDefault(){return this._isDefault}set isDefault(t){this._isDefault=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbObjectContextData"),t.writeInt16(70,this._classVersion),t.writeBoolean(290,this._isDefault),this}dxfInObjectContextData(t){for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===100)return String(e.value);switch(n){case 70:this._classVersion=Number(e.value);break;case 290:this._isDefault=!!Number(e.value);break}}}}class ve extends gf{constructor(){super(...arguments),this._scaleId=""}get scaleId(){return this._scaleId}set scaleId(t){this._scaleId=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbAnnotScaleObjectContextData"),t.writeObjectId(340,this._scaleId),this}}class kr extends ve{constructor(){super(...arguments),this._position=new x,this._rotation=0,this._scaleX=1,this._scaleY=1,this._scaleZ=1}get position(){return this._position}set position(t){this._position.copy(t)}get rotation(){return this._rotation}set rotation(t){this._rotation=t}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}set scaleZ(t){this._scaleZ=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbBlkRefObjectContextData"),t.writePoint3d(10,this._position),t.writeDouble(50,this._rotation),t.writeDouble(41,this._scaleX),t.writeDouble(42,this._scaleY),t.writeDouble(43,this._scaleZ),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbBlkRefObjectContextData"){e="blk";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}if(e==="blk")switch(r){case 10:this._position.x=Number(n.value);break;case 20:this._position.y=Number(n.value);break;case 30:this._position.z=Number(n.value);break;case 50:this._rotation=Number(n.value);break;case 41:this._scaleX=Number(n.value);break;case 42:this._scaleY=Number(n.value);break;case 43:this._scaleZ=Number(n.value);break}}return this}}class Ci{constructor(t){this.i=0,t instanceof Map?(this._records=t,this._array=null,this._keys=Array.from(t.keys())):(this._records=null,this._array=t,this._keys=[])}get count(){var t;return((t=this._records)==null?void 0:t.size)??this._array.length}toArray(){return this._records?Array.from(this._records.values()):[...this._array]}[Symbol.iterator](){return this}next(){if(this._array){if(this.i<this._array.length){const t=this._array[this.i];return this.i+=1,{value:t,done:!1}}return{value:null,done:!0}}for(;this.i<this._keys.length;){const t=this._records.get(this._keys[this.i]);return this.i+=1,{value:t,done:!1}}return{value:null,done:!0}}}class K extends mt{constructor(t){super(),this.database=t,this.objectId=t.generateHandle(),this._recordsByName=new Map}get numEntries(){return this._recordsByName.size}setAt(t,e){const n=this.database.transactionManager;if(n.strictMode&&!n.isRecording()&&!n.isApplyingUndoRedo())throw new Error("Cannot modify dictionary entries outside an active transaction.");const r=this.getAt(t);r&&(n.isRecording()&&n.recordRemove({type:"dictionary",dictionaryId:this.objectId,key:t},r),this.database.releaseObjectHandle(r)),e.database=this.database,this.database.commitObjectHandle(e,s=>this.hasId(s)),e.ownerId=this.objectId,this._recordsByName.set(t,e),n.isRecording()&&n.recordAppend({type:"dictionary",dictionaryId:this.objectId,key:t},e),!n.isRecording()&&!n.isApplyingUndoRedo()&&this.database.notifyDictObjectSet(e,t)}remove(t){const e=this.getAt(t);return e?(this.removeStoredObject(e,t),!0):!1}removeId(t){const e=this.getIdAt(t);if(e){let n="";return this._recordsByName.forEach((r,s)=>{r===e&&(n=s)}),this.removeStoredObject(e,n),!0}return!1}removeStoredObject(t,e){const n=this.database.transactionManager;if(n.strictMode&&!n.isRecording()&&!n.isApplyingUndoRedo())throw new Error("Cannot remove dictionary entries outside an active transaction.");n.isRecording()&&n.recordRemove({type:"dictionary",dictionaryId:this.objectId,key:e},t),this._recordsByName.forEach((r,s)=>{r===t&&this._recordsByName.delete(s)}),this.database.releaseObjectHandle(t),e&&!n.isRecording()&&!n.isApplyingUndoRedo()&&this.database.notifyDictObjectErased(t,e)}removeAll(){this._recordsByName.forEach((t,e)=>{this.database.releaseObjectHandle(t),this.database.events.dictObjectErased.dispatch({database:this.database,object:t,key:e})}),this._recordsByName.clear()}has(t){return this._recordsByName.has(t.toUpperCase())}hasId(t){return this.getIdAt(t)!==void 0}getAt(t){return this._recordsByName.get(t)}getIdAt(t){const e=this.database.getObjectById(t);if(!(!e||e.getAttrWithoutException("ownerId")!==this.objectId))return e}newIterator(){return new Ci(this._recordsByName)}entries(){return this._recordsByName.entries()}dxfOutFields(t){super.dxfOutFields(t),t.writeSubclassMarker("AcDbDictionary"),t.writeInt16(280,1),t.writeInt16(281,1);for(const[e,n]of this._recordsByName)t.writeString(3,e),t.writeObjectId(350,n.objectId);return this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbDictionary");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;if(Number(e.code)===100){t.pushBackItem(e);break}}return this}}class Ir extends ve{constructor(){super(...arguments),this._blockName="",this._definitionPoint=new x,this._dimLinePoint=new x,this._hasDimLinePoint=!1,this._b293=!1,this._b294=!1,this._bd140=0,this._b298=!1,this._b291=!1,this._flag=0,this._b292=!1,this._bs71=0,this._b280=0,this._b295=!1,this._b296=!1,this._b297=!1}get blockName(){return this._blockName}set blockName(t){this._blockName=t}get definitionPoint(){return this._definitionPoint}set definitionPoint(t){this._definitionPoint.copy(t)}get dimLinePoint(){return this._dimLinePoint}set dimLinePoint(t){this._dimLinePoint.copy(t),this._hasDimLinePoint=!0}get hasDimLinePoint(){return this._hasDimLinePoint}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbDimensionObjectContextData"),t.writeString(2,this._blockName),t.writeBoolean(293,this._b293),t.writePoint3d(10,this._definitionPoint),t.writeBoolean(294,this._b294),t.writeDouble(140,this._bd140),t.writeBoolean(298,this._b298),t.writeBoolean(291,this._b291),t.writeInt16(70,this._flag),t.writeBoolean(292,this._b292),t.writeInt16(71,this._bs71),t.writeInt16(280,this._b280),t.writeBoolean(295,this._b295),t.writeBoolean(296,this._b296),t.writeBoolean(297,this._b297),this._hasDimLinePoint&&t.writePoint3d(11,this._dimLinePoint),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbDimensionObjectContextData"){e="dim";continue}if(s.includes("DimensionObjectContextData")){e="typed";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"){r===340&&(this.scaleId=String(n.value));continue}switch(r){case 2:this._blockName=String(n.value);break;case 10:this._definitionPoint.x=Number(n.value);break;case 20:this._definitionPoint.y=Number(n.value);break;case 30:this._definitionPoint.z=Number(n.value);break;case 11:this._dimLinePoint.x=Number(n.value),this._hasDimLinePoint=!0;break;case 21:this._dimLinePoint.y=Number(n.value),this._hasDimLinePoint=!0;break;case 31:this._dimLinePoint.z=Number(n.value),this._hasDimLinePoint=!0;break;case 293:this._b293=!!Number(n.value);break;case 294:this._b294=!!Number(n.value);break;case 140:this._bd140=Number(n.value);break;case 298:this._b298=!!Number(n.value);break;case 291:this._b291=!!Number(n.value);break;case 70:this._flag=Number(n.value);break;case 292:this._b292=!!Number(n.value);break;case 71:this._bs71=Number(n.value);break;case 280:this._b280=Number(n.value);break;case 295:this._b295=!!Number(n.value);break;case 296:this._b296=!!Number(n.value);break;case 297:this._b297=!!Number(n.value);break}}return this}}class Er extends ve{constructor(){super(...arguments),this._patternScale=1}get patternScale(){return this._patternScale}set patternScale(t){this._patternScale=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbHatchScaleContextData"),t.writeDouble(40,this._patternScale),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbHatchScaleContextData"){e="hatch";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}e==="hatch"&&r===40&&(this._patternScale=Number(n.value))}return this}}class Tl extends ve{dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbLeaderObjectContextData"),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbLeaderObjectContextData"){e="leader";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}e==="annot"&&r===340&&(this.scaleId=String(n.value))}return this}}class Tr extends ve{constructor(){super(...arguments),this._contentScale=1,this._textHeight=0,this._arrowheadSize=0,this._textAnchor=new x,this._hasTextAnchor=!1}get contentScale(){return this._contentScale}set contentScale(t){this._contentScale=t>0?t:1}get textHeight(){return this._textHeight}set textHeight(t){this._textHeight=t}get arrowheadSize(){return this._arrowheadSize}set arrowheadSize(t){this._arrowheadSize=t}get textAnchor(){return this._textAnchor}set textAnchor(t){this._textAnchor.copy(t),this._hasTextAnchor=!0}get hasTextAnchor(){return this._hasTextAnchor}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbMLeaderObjectContextData"),t.writeDouble(40,this._contentScale),this._textHeight>0&&t.writeDouble(41,this._textHeight),this._arrowheadSize>0&&t.writeDouble(140,this._arrowheadSize),this._hasTextAnchor&&t.writePoint3d(12,this._textAnchor),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbMLeaderObjectContextData"){e="mleader";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}switch(r){case 40:this._contentScale=Number(n.value)>0?Number(n.value):1;break;case 41:case 44:Number(n.value)>0&&(this._textHeight=Number(n.value));break;case 140:Number(n.value)>0&&(this._arrowheadSize=Number(n.value));break;case 12:this._textAnchor.x=Number(n.value),this._hasTextAnchor=!0;break;case 22:this._textAnchor.y=Number(n.value),this._hasTextAnchor=!0;break;case 32:this._textAnchor.z=Number(n.value),this._hasTextAnchor=!0;break}}return this}}class sn extends ve{constructor(){super(...arguments),this._attachmentPoint=1,this._direction=new A(1,0,0),this._insertionPoint=new x,this._definedWidth=0,this._definedHeight=0,this._extentsWidth=0,this._extentsHeight=0,this._columnType=0}get attachmentPoint(){return this._attachmentPoint}set attachmentPoint(t){this._attachmentPoint=t}get direction(){return this._direction}set direction(t){this._direction.copy(t)}get insertionPoint(){return this._insertionPoint}set insertionPoint(t){this._insertionPoint.copy(t)}get definedWidth(){return this._definedWidth}set definedWidth(t){this._definedWidth=t}get definedHeight(){return this._definedHeight}set definedHeight(t){this._definedHeight=t}get extentsWidth(){return this._extentsWidth}set extentsWidth(t){this._extentsWidth=t}get extentsHeight(){return this._extentsHeight}set extentsHeight(t){this._extentsHeight=t}get columnType(){return this._columnType}set columnType(t){this._columnType=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeInt16(70,this._attachmentPoint),t.writeVector3d(10,this._direction),t.writePoint3d(11,this._insertionPoint),t.writeDouble(40,this._definedWidth),t.writeDouble(41,this._definedHeight),t.writeDouble(42,this._extentsWidth),t.writeDouble(43,this._extentsHeight),t.writeInt16(71,this._columnType),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbMTextObjectContextData"||s==="AcDbMTextAttributeObjectContextData"){e="mtext";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}switch(r){case 340:this.scaleId=String(n.value);break;case 70:this._attachmentPoint=Number(n.value);break;case 10:this._direction.x=Number(n.value);break;case 20:this._direction.y=Number(n.value);break;case 30:this._direction.z=Number(n.value);break;case 11:this._insertionPoint.x=Number(n.value);break;case 21:this._insertionPoint.y=Number(n.value);break;case 31:this._insertionPoint.z=Number(n.value);break;case 40:this._definedWidth=Number(n.value);break;case 41:this._definedHeight=Number(n.value);break;case 42:this._extentsWidth=Number(n.value);break;case 43:this._extentsHeight=Number(n.value);break;case 71:this._columnType=Number(n.value);break}}return this}}class $s extends sn{dxfOutFields(t){return super.dxfOutFields(t),this}dxfInFields(t){return super.dxfInFields(t)}}class Yn extends mt{constructor(){super(...arguments),this._classVersion=0,this._scaleName="",this._paperUnits=1,this._drawingUnits=1,this._isUnitScale=!1}get classVersion(){return this._classVersion}set classVersion(t){this._classVersion=t}get scaleName(){return this._scaleName}set scaleName(t){this._scaleName=t}get paperUnits(){return this._paperUnits}set paperUnits(t){this._paperUnits=t>0?t:1}get drawingUnits(){return this._drawingUnits}set drawingUnits(t){this._drawingUnits=t>0?t:1}get isUnitScale(){return this._isUnitScale}set isUnitScale(t){this._isUnitScale=t}get scaleFactor(){return this._drawingUnits/this._paperUnits}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbScale"),t.writeInt16(70,this._classVersion),t.writeString(300,this._scaleName),t.writeDouble(140,this._paperUnits),t.writeDouble(141,this._drawingUnits),t.writeBoolean(290,this._isUnitScale),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbScale");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===100){t.pushBackItem(e);break}switch(n){case 70:this._classVersion=Number(e.value);break;case 300:this._scaleName=String(e.value);break;case 140:this.paperUnits=Number(e.value);break;case 141:this.drawingUnits=Number(e.value);break;case 290:this._isUnitScale=!!Number(e.value);break}}return this}}class Wr extends ve{constructor(){super(...arguments),this._horizontalMode=0,this._rotation=0,this._alignmentPoint=new x,this._position=new x}get horizontalMode(){return this._horizontalMode}set horizontalMode(t){this._horizontalMode=t}get rotation(){return this._rotation}set rotation(t){this._rotation=t}get alignmentPoint(){return this._alignmentPoint}set alignmentPoint(t){this._alignmentPoint.copy(t)}get position(){return this._position}set position(t){this._position.copy(t)}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbTextObjectContextData"),t.writeInt16(70,this._horizontalMode),t.writeDouble(50,this._rotation),t.writePoint3d(10,this._alignmentPoint),t.writePoint3d(11,this._position),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbTextObjectContextData"){e="text";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"){r===340&&(this.scaleId=String(n.value));continue}switch(r){case 70:this._horizontalMode=Number(n.value);break;case 50:this._rotation=Number(n.value);break;case 10:this._alignmentPoint.x=Number(n.value);break;case 20:this._alignmentPoint.y=Number(n.value);break;case 30:this._alignmentPoint.z=Number(n.value);break;case 11:this._position.x=Number(n.value);break;case 21:this._position.y=Number(n.value);break;case 31:this._position.z=Number(n.value);break}}return this}}var ff=(i=>(i[i.NotApplicable=0]="NotApplicable",i[i.Ignore=1]="Ignore",i[i.Replace=2]="Replace",i[i.XrefMangleName=3]="XrefMangleName",i[i.MangleName=4]="MangleName",i))(ff||{});class lo extends mt{constructor(){super(...arguments),this._data=null}get data(){return this._data}set data(t){this._data=t}clear(){var t;(t=this._data)==null||t.clear()}clone(){return super.clone()}getDuplicateRecordCloning(){return this._cloningFlag??0}setDuplicateRecordCloning(t){this._cloningFlag=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbXrecord"),t.writeInt16(280,this._cloningFlag??1),t.writeResultBuffer(this.data),this}dxfInFields(t){super.dxfInFields(t),t.atSubclassData("AcDbXrecord");const e=new ze;for(;!t.atEndOfObject&&!t.atEof;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===1001||r>=1e3&&r<=1071){t.pushBackItem(n);break}if(r===100){t.pushBackItem(n);break}switch(r){case 280:this._cloningFlag=Number(n.value);break;default:e.add({code:n.code,value:n.value});break}}return this._data=e.length>0?e:null,this}}const Pn=i=>i?i.trim().toUpperCase():"",pf="ASDK_XREC_ANNOTATION_SCALE_INFO",Lr="AcadAnnotative";function fe(i){const t=i.getXData(Lr);if(!t)return!1;const e=t.toArray();for(const n of e)if(Number(n.code)===1070&&Number(n.value)===1)return!0;return!1}function Ae(i){return fe(i)||Wt(i).length>0}function pe(i,t){if(!t){i.removeXData(Lr),Q1(i);return}if(fe(i))return;const e=new ze([{code:Z.ExtendedDataRegAppName,value:Lr},{code:Z.ExtendedDataAsciiString,value:"AnnotativeData"},{code:Z.ExtendedDataControlString,value:"{"},{code:Z.ExtendedDataInteger16,value:1},{code:Z.ExtendedDataInteger16,value:1},{code:Z.ExtendedDataControlString,value:"}"}]);i.setXData(e)}function Oi(i,t){if(!t)return;const e=Pn(t),n=i.getObjectById(e);if(n instanceof Yn)return n;const r=i.objects.scale,s=r.getAt(t);if(s instanceof Yn)return s;for(const[,a]of r.entries())if(a.scaleName===t)return a}function Wt(i){const t=i.extensionDictionary;if(!t)return[];let e;try{e=i.database}catch{return[]}if(!e)return[];const n=e.getObjectById(Pn(t));if(!(n instanceof K))return[];const r=n.getAt("AcDbContextDataManager");if(!(r instanceof K))return[];const s=r.getAt("ACDB_ANNOTATIONSCALES");if(!(s instanceof K))return[];const a=[];for(const[,o]of s.entries()){let c,l,h=!1;o instanceof ve?(c=o,l=o.scaleId,h=o.isDefault):l=o.objectId;const u=l?Oi(e,l):void 0;u&&a.push({scale:u,contextData:c,isDefault:h})}return a}function De(i,t){if(!(i>0)||t.length===0)return i;const n=(t.find(r=>r.isDefault)??t[0]).scale.scaleFactor;return n>0?i/n:i}function Re(i,t){return i>0?i*(t>0?t:1):i}function Ve(i,t,e){if(i.length!==0){if(t){const n=i.find(r=>r.scale.scaleName===t);if(n)return n}if(e!=null&&e>0){const n=i.find(r=>Math.abs(r.scale.scaleFactor-e)<1e-9);if(n)return n}return i.find(n=>n.isDefault)??i[0]}}function mf(i){var a;const t=i.extensionDictionary;if(!t)return;let e;try{e=i.database}catch{return}if(!e)return;const n=e.getObjectById(Pn(t));if(!(n instanceof K))return;const r=n.getAt(pf);if(!r)return;let s;if(r instanceof lo){const o=((a=r.data)==null?void 0:a.toArray())??[];for(const c of o)if(Number(c.code)===340){s=String(c.value);break}}else if(r instanceof Yn)return r;return Oi(e,s)}function Ue(i,t){return{drawnScaleFactor:t.scale.scaleFactor,drawnScaleName:t.scale.scaleName,supportedScaleFactors:i.map(e=>e.scale.scaleFactor),supportedScaleNames:i.map(e=>e.scale.scaleName)}}const q1=[{name:"1:1",drawingUnits:1},{name:"1:2",drawingUnits:2},{name:"1:5",drawingUnits:5},{name:"1:10",drawingUnits:10},{name:"1:20",drawingUnits:20},{name:"1:50",drawingUnits:50},{name:"1:100",drawingUnits:100},{name:"1:200",drawingUnits:200},{name:"1:500",drawingUnits:500},{name:"1:1000",drawingUnits:1e3}];function yf(i){const t=[];for(const[,e]of i.objects.scale.entries())e instanceof Yn&&t.push(e);return t.sort((e,n)=>e.scaleFactor-n.scaleFactor)}function K1(i){for(const t of q1)Ll(i,t.name,t.drawingUnits);return yf(i)}function Ll(i,t,e){const n=Oi(i,t);if(n)return n;const r=new Yn;r.database=i,r.scaleName=t,r.paperUnits=1;let s=e;if(!(s!=null&&s>0)){const a=/^1\s*:\s*(\d+(?:\.\d+)?)$/i.exec(t.trim());s=a?Number(a[1]):1}return r.drawingUnits=s>0?s:1,i.objects.scale.setAt(t,r),r}function Ml(i){try{return i.database}catch{return}}function bf(i,t){const e=t.extensionDictionary;if(!e)return;const n=i.getObjectById(Pn(e));if(!(n instanceof K))return;const r=n.getAt("AcDbContextDataManager");if(!(r instanceof K))return;const s=r.getAt("ACDB_ANNOTATIONSCALES");return s instanceof K?s:void 0}function Z1(i,t){let e=t.extensionDictionary;if(e||(e=i.createExtensionDictionaryFor(t)),!e)throw new Error("Failed to create extension dictionary for object");const n=i.getObjectById(Pn(e));if(!(n instanceof K))throw new Error("Extension dictionary is not an AcDbDictionary");let r=n.getAt("AcDbContextDataManager");r instanceof K||(r=new K(i),r.database=i,n.setAt("AcDbContextDataManager",r));let s=r.getAt("ACDB_ANNOTATIONSCALES");return s instanceof K||(s=new K(i),s.database=i,r.setAt("ACDB_ANNOTATIONSCALES",s)),s}function _f(i,t){const e=Pn(t.objectId);if(e){if(i.objects.objectContextData.getIdAt(e)){i.objects.objectContextData.removeId(e);return}for(const[n,r]of[...i.objects.objectContextData.entries()])(r===t||Pn(r.objectId)===e)&&i.objects.objectContextData.remove(n)}}function Q1(i){const t=Ml(i);if(!t)return;const e=bf(t,i);if(e)for(const[n,r]of[...e.entries()])e.remove(n),_f(t,r)}function J1(i){var n;const t=Wt(i);if(t.length===0||t.some(r=>r.isDefault))return;const e=(n=t[0])==null?void 0:n.contextData;e&&(e.isDefault=!0)}function t_(i){const t=i;return typeof t.type=="string"?t.type:""}function e_(i,t,e){if(e instanceof Wr){i.horizontalMode=e.horizontalMode,i.rotation=e.rotation,i.alignmentPoint=e.alignmentPoint,i.position=e.position;return}const n=t;n.horizontalMode!=null&&(i.horizontalMode=n.horizontalMode),n.rotation!=null&&(i.rotation=n.rotation),n.alignmentPoint&&(i.alignmentPoint=n.alignmentPoint),n.position&&(i.position=n.position)}function Pu(i,t,e){if(e instanceof sn){i.attachmentPoint=e.attachmentPoint,i.direction=e.direction,i.insertionPoint=e.insertionPoint,i.definedWidth=e.definedWidth,i.definedHeight=e.definedHeight,i.extentsWidth=e.extentsWidth,i.extentsHeight=e.extentsHeight,i.columnType=e.columnType;return}const n=t;n.attachmentPoint!=null&&(i.attachmentPoint=n.attachmentPoint),n.direction&&(i.direction=n.direction),n.location&&(i.insertionPoint=n.location),n.width!=null&&(i.definedWidth=n.width),n.height!=null&&(i.definedHeight=n.height),n.extentsWidth!=null&&(i.extentsWidth=n.extentsWidth),n.extentsHeight!=null&&(i.extentsHeight=n.extentsHeight),n.columnType!=null&&(i.columnType=n.columnType)}function n_(i,t,e){var a,o,c,l,h,u;const n=t_(i),r=((a=t.find(d=>d.isDefault))==null?void 0:a.contextData)??((o=t[0])==null?void 0:o.contextData),s=!!i.mtext;if(n==="Attrib"&&(s||r instanceof $s)){const d=new $s;return Pu(d,i.mtext??i,r),d}if(n==="MText"){const d=new sn;return Pu(d,i,r),d}if(n==="Text"||n==="Attrib"||n==="AttDef"){const d=new Wr;return e_(d,i,r),d}if(n.includes("Dimension")){const d=new Ir;if(r instanceof Ir)d.blockName=r.blockName,d.definitionPoint=r.definitionPoint,r.hasDimLinePoint&&(d.dimLinePoint=r.dimLinePoint);else{const g=i;g.dimBlockId&&(d.blockName=g.dimBlockId),g.dimBlockPosition&&(d.definitionPoint=g.dimBlockPosition)}return d}if(n==="Hatch"){const d=new Er;if(r instanceof Er)d.patternScale=r.patternScale;else{const g=i,f=g.patternScale!=null&&g.patternScale>0?g.patternScale:1,p=((c=t.find(y=>y.isDefault))==null?void 0:c.scale.scaleFactor)??((l=t[0])==null?void 0:l.scale.scaleFactor)??1,m=p>0?f/p:f;d.patternScale=m*(e>0?e:1)}return d}if(n==="BlockReference"){const d=new kr;if(r instanceof kr)d.position=r.position,d.rotation=r.rotation,d.scaleX=r.scaleX,d.scaleY=r.scaleY,d.scaleZ=r.scaleZ;else{const g=i;g.position&&(d.position=g.position),g.rotation!=null&&(d.rotation=g.rotation),g.scaleFactors&&(d.scaleX=g.scaleFactors.x,d.scaleY=g.scaleFactors.y,d.scaleZ=g.scaleFactors.z)}return d}if(n==="MLeader"){const d=new Tr;if(r instanceof Tr)d.contentScale=r.contentScale,d.textHeight=r.textHeight,d.arrowheadSize=r.arrowheadSize,r.hasTextAnchor&&(d.textAnchor=r.textAnchor);else{const g=i,f=((h=t.find(y=>y.isDefault))==null?void 0:h.scale.scaleFactor)??((u=t[0])==null?void 0:u.scale.scaleFactor)??1,p=g.textHeight!=null&&f>0?g.textHeight/f:g.textHeight,m=g.arrowheadSize!=null&&f>0?g.arrowheadSize/f:g.arrowheadSize;p!=null&&(d.textHeight=p*(e>0?e:1)),m!=null&&(d.arrowheadSize=m*(e>0?e:1)),d.contentScale=e>0?e:1}return d}return n==="Leader"?new Tl:new ve}function i_(i,t){const e=Ml(i);if(!e)return!1;const n=Ll(e,t),r=Wt(i);if(r.some(c=>c.scale.objectId===n.objectId))return!1;const s=Z1(e,i),a=n_(i,r,n.scaleFactor);a.database=e,a.scaleId=n.objectId,a.isDefault=r.length===0;const o=n.scaleName||n.objectId;return e.objects.objectContextData.setAt(`${i.objectId}_${o}`,a),s.setAt(o,a),fe(i)||pe(i,!0),!0}function r_(i,t){const e=Ml(i);if(!e)return!1;const n=bf(e,i);if(!n)return!1;let r=!1;for(const[a,o]of[...n.entries()]){let c;o instanceof ve?c=Oi(e,o.scaleId):c=Oi(e,o.objectId),c&&(c.scaleName===t||c.objectId===Pn(t))&&(n.remove(a),_f(e,o),r=!0)}return r?(Wt(i).length===0?i.removeXData(Lr):J1(i),!0):!1}function jn(i){var n;const t=Wt(i);if(t.length===0)return{contexts:t};const e=Ve(t,(n=i.database)==null?void 0:n.cannoscale)??t.find(r=>r.isDefault)??t[0];return{contexts:t,preferred:e,annotationScale:Ue(t,e)}}class bn extends Error{constructor(t="Unexpected end of buffer."){super(t),this.name="AcDbProxyGraphicEndOfBufferError"}}function xf(i){return i instanceof ArrayBuffer?new Uint8Array(i):i}class ie{constructor(t,e=4){this._index=0,this._buffer=xf(t),this._align=e}get index(){return this._index}get hasData(){return this._index<this._buffer.length}alignIndex(t){const e=t%this._align;return e?t+this._align-e:t}readStruct(t){if(!this.hasData)throw new bn;const e=[];let n=0;for(const r of t){const s=new DataView(this._buffer.buffer,this._buffer.byteOffset+this._index+n,r);if(r===8)e.push(s.getFloat64(0,!0));else if(r===4)e.push(s.getUint32(0,!0));else throw new Error(`Unsupported struct size: ${r}`);n+=r}return this._index=this.alignIndex(this._index+n),e}readFloat(){return this.readStruct([8])[0]}readLong(){return this.readStruct([4])[0]}readSignedLong(){if(!this.hasData)throw new bn;const e=new DataView(this._buffer.buffer,this._buffer.byteOffset+this._index,4).getInt32(0,!0);return this._index=this.alignIndex(this._index+4),e}readVertex(){return this.readStruct([8,8,8])}readPaddedString(t="utf-8"){const e=this._buffer;for(let n=this._index;n<e.length;n++)if(e[n]===0){const r=this._index;this._index=this.alignIndex(n+1);const s=e.subarray(r,n);return new TextDecoder(t).decode(s)}throw new bn("Did not detect terminating zero byte.")}readPaddedUnicodeString(){const t=this._buffer;for(let e=this._index;e<t.length;e+=2)if(e+1<t.length&&t[e]===0&&t[e+1]===0){const n=this._index;this._index=this.alignIndex(e+2);const r=t.subarray(n,e);return new TextDecoder("utf-16le").decode(r)}throw new bn("Did not detect terminating zero bytes.")}}class wf{constructor(t,e="AC1015",n="cp1252"){this._bitIndex=0,this._buffer=xf(t),this.dxfversion=e,this.encoding=n}get hasData(){return this._bitIndex>>3<this._buffer.length}readBit(){const t=this._bitIndex;this._bitIndex+=1;const e=t>>3;if(e>=this._buffer.length)throw new bn;return this._buffer[e]&128>>(t&7)?1:0}readBits(t){const e=this._bitIndex,n=e+t;if(n-1>>3>=this._buffer.length)throw new bn;this._bitIndex=n;let r=128>>(e&7),s=e>>3,a=0,o=this._buffer[s];for(;t>0;)a<<=1,o&r&&(a|=1),t-=1,r>>=1,!r&&t&&(r=128,s+=1,o=this._buffer[s]);return a}readUnsignedByte(){return this.readBits(8)}readSignedByte(){const t=this.readBits(8);return t&128?-((~t&255)+1):t}readAlignedBytes(t){const e=this._bitIndex>>3,n=e+t;if(n>this._buffer.length)throw new bn;return this._bitIndex+=t<<3,this._buffer.subarray(e,n)}readUnsignedShort(){if(this._bitIndex&7){const e=this.readBits(8);return(this.readBits(8)<<8)+e}const t=this.readAlignedBytes(2);return t[1]<<8|t[0]}readSignedShort(){const t=this.readUnsignedShort();return t&32768?-((~t&65535)+1):t}readUnsignedLong(){if(this._bitIndex&7){const e=this.readBits(8),n=this.readBits(8),r=this.readBits(8);return(this.readBits(8)<<24)+(r<<16)+(n<<8)+e}const t=this.readAlignedBytes(4);return(t[3]<<24)+(t[2]<<16)+(t[1]<<8)+t[0]}readSignedLong(){const t=this.readUnsignedLong();return t&2147483648?-((~t&4294967295)+1):t}readFloat(){if(this._bitIndex&7){const n=new Uint8Array(8);for(let r=0;r<8;r++)n[r]=this.readBits(8);return new DataView(n.buffer).getFloat64(0,!0)}const t=this.readAlignedBytes(8),e=new Uint8Array(t);return new DataView(e.buffer).getFloat64(0,!0)}readRawDouble(t=1){return t===1?this.readFloat():Array.from({length:t},()=>this.readFloat())}readBitShort(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readSignedShort():n===1?this.readUnsignedByte():n===2?0:256};return t===1?e():Array.from({length:t},()=>e())}readBitLong(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readSignedLong():n===1?this.readUnsignedByte():n===2?0:256};return t===1?e():Array.from({length:t},()=>e())}readBitDouble(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readFloat():n===1?1:0};return t===1?e():Array.from({length:t},()=>e())}readBitDoubleDefault(t=1,e=0){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,e,!0);const r=()=>{const s=this.readBits(2);if(s===0)return e;if(s===1){const a=new Uint8Array(n);return a[0]=this.readUnsignedByte(),a[1]=this.readUnsignedByte(),a[2]=this.readUnsignedByte(),a[3]=this.readUnsignedByte(),new DataView(a.buffer).getFloat64(0,!0)}if(s===2){const a=new Uint8Array(n);return a[4]=this.readUnsignedByte(),a[5]=this.readUnsignedByte(),a[0]=this.readUnsignedByte(),a[1]=this.readUnsignedByte(),a[2]=this.readUnsignedByte(),a[3]=this.readUnsignedByte(),new DataView(a.buffer).getFloat64(0,!0)}return this.readFloat()};return t===1?r():Array.from({length:t},()=>r())}}function ho(i){return Array.from(i,t=>t.toString(16).padStart(2,"0")).join("").toUpperCase()}function Cl(i){const t=i.reduce((r,s)=>r+Math.floor(s.length/2),0),e=new Uint8Array(t);let n=0;for(const r of i)for(let s=0;s<r.length;s+=2)e[n++]=parseInt(r.slice(s,s+2),16);return e}function $r(i){if(i.length===0)return new Uint8Array;const t=[];for(const s of i)s instanceof Uint8Array?t.push(s):t.push(Cl([String(s)]));const e=t.reduce((s,a)=>s+a.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}class cn extends mt{constructor(t,e){t=t||{},ge(t,{name:""}),super(t,e)}get name(){return this.getAttr("name")}set name(t){this.setAttr("name",t)}setAttr(t,e){this.assertOpenForWrite(),super.setAttr(t,e)}assertOpenForWrite(){if(this.isTemp)return;const t=this.database;if(!t)return;const e=t.transactionManager;if(!e.isApplyingUndoRedo()){if(e.strictMode&&!e.isRecording())throw new Error("Cannot modify symbol table records outside an active transaction.");if(e.isRecording()&&!e.isOpenedForWriteInTransaction(this.objectId))throw new Error(`Symbol table record "${this.name||this.objectId}" is not open for write. Use openObjectForWrite().`)}}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbSymbolTableRecord"),this}}var vf=(i=>(i[i.Any=0]="Any",i[i.Uniform=1]="Uniform",i))(vf||{}),lr=(i=>(i[i.None=0]="None",i[i.Anonymous=1]="Anonymous",i[i.HasNonConstantAttributes=2]="HasNonConstantAttributes",i[i.Xref=4]="Xref",i[i.XrefOverlay=8]="XrefOverlay",i[i.ExternallyDependent=16]="ExternallyDependent",i[i.Resolved=32]="Resolved",i[i.Referenced=64]="Referenced",i))(lr||{});const fn=class fn extends cn{static isModelSapceName(t){return t.toLowerCase()==fn.MODEL_SPACE_NAME.toLowerCase()}static isPaperSapceName(t){return t.toLowerCase().startsWith(fn.PAPER_SPACE_NAME_PREFIX.toLowerCase())}static sanitizeImportedFlags(t){return t&-97}constructor(t,e){t=t||{},ge(t,{origin:new x,layoutId:"",flags:0,pathName:"",blockInsertUnits:0,explodability:1,blockScaling:1,previewIcon:void 0}),super(t,e),this._entities=[]}get isModelSapce(){return fn.isModelSapceName(this.name)}get isPaperSapce(){return fn.isPaperSapceName(this.name)}get origin(){return this.getAttr("origin")}set origin(t){this.getAttr("origin").copy(t)}get layoutId(){return this.getAttr("layoutId")}set layoutId(t){this.setAttr("layoutId",t)}get flags(){return this.getAttr("flags")}set flags(t){this.setAttr("flags",t)}get annotative(){return Ae(this)}set annotative(t){pe(this,t)}get pathName(){return this.getAttr("pathName")}set pathName(t){this.setAttr("pathName",t)}get isXref(){return(this.flags&12)!==0}get isOverlayReference(){return(this.flags&8)!==0}get isUnresolvedXref(){return!this.isXref||(this.flags&32)!==0?!1:this._entities.length===0}get blockInsertUnits(){return this.getAttr("blockInsertUnits")}set blockInsertUnits(t){this.setAttr("blockInsertUnits",t)}get explodability(){return this.getAttr("explodability")}set explodability(t){this.setAttr("explodability",t)}get blockScaling(){return this.getAttr("blockScaling")}set blockScaling(t){this.setAttr("blockScaling",t)}get previewIcon(){return this.getAttrWithoutException("previewIcon")}set previewIcon(t){if(!t||t.length===0){this.setAttr("previewIcon",void 0);return}this.setAttr("previewIcon",t)}appendEntity(t){const e=this.database.transactionManager;if(e.strictMode&&!e.isRecording()&&!e.isApplyingUndoRedo())throw new Error("Cannot append entities outside an active transaction.");const n=s=>{s.database=this.database,this.database.ensureEntityStyleDefaults(s),this.database.commitObjectHandle(s,a=>this.hasEntityId(a)),s.ownerId=this.objectId,s.resolveEffectiveProperties(),this._entities.push(s),s.dxfTypeName==="INSERT"&&"syncAttributeDatabases"in s&&typeof s.syncAttributeDatabases=="function"&&s.syncAttributeDatabases()},r=Array.isArray(t)?t:[t];for(const s of r)n(s);if(e.isRecording())for(const s of r)e.recordAppend({type:"blockTableRecord",ownerId:this.objectId},s);(this.isModelSapce||this.isPaperSapce)&&!e.isRecording()&&!e.isApplyingUndoRedo()&&this.database.notifyEntityAppended(t)}removeEntity(t){const e=this.database.transactionManager;if(e.strictMode&&!e.isRecording()&&!e.isApplyingUndoRedo())throw new Error("Cannot remove entities outside an active transaction.");const n=Array.isArray(t)?t:[t];if(n.length===0)return!1;const r=new Set(n),s=[];let a=0;for(const o of this._entities)r.has(o.objectId)?(e.isRecording()&&e.recordRemove({type:"blockTableRecord",ownerId:this.objectId},o),s.push(o),this.database.releaseObjectHandle(o)):this._entities[a++]=o;return this._entities.length=a,s.length>0&&!e.isRecording()&&!e.isApplyingUndoRedo()&&this.database.notifyEntityErased(s),s.length>0}newIterator(){return new Ci(this._entities)}getIdAt(t){const e=this.database.getObjectById(t);if(!(!(e instanceof st)||e.getAttrWithoutException("ownerId")!==this.objectId))return e}hasEntityId(t){return this.getIdAt(t)!==void 0}dxfOutBlockRecord(t){return t.writeStart("BLOCK_RECORD"),this.dxfOut(t),this}dxfOutBlockBegin(t){return t.writeStart("BLOCK"),t.writeHandle(5,this.database.generateHandle()),t.writeObjectId(330,this.objectId),t.writeSubclassMarker("AcDbEntity"),t.writeString(8,"0"),t.writeSubclassMarker("AcDbBlockBegin"),t.writeString(2,this.name),t.writeInt16(70,this.flags),t.writePoint3d(10,this.origin),t.writeString(3,this.name),this.pathName&&t.writeString(1,this.pathName),this}dxfOutBlockEnd(t){return t.writeStart("ENDBLK"),t.writeHandle(5,this.database.generateHandle()),t.writeObjectId(330,this.objectId),t.writeSubclassMarker("AcDbEntity"),t.writeSubclassMarker("AcDbBlockEnd"),this}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbBlockTableRecord"),t.writeString(2,this.name),t.capabilities.supportsBlockRecordUnitsFlags&&(t.writeInt16(70,this.blockInsertUnits),t.writeInt16(280,this.explodability),t.writeInt16(281,this.blockScaling)),(this.isModelSapce||this.isPaperSapce)&&t.writeObjectId(340,this.layoutId),this}dxfInFields(t){super.dxfInFields(t),t.atSubclassData("AcDbSymbolTableRecord"),t.atSubclassData("AcDbBlockTableRecord");const e=[];for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){t.pushBackItem(n);break}switch(r){case 2:this.name=String(n.value);break;case 70:this.blockInsertUnits=Number(n.value);break;case 280:this.explodability=Number(n.value);break;case 281:this.blockScaling=Number(n.value);break;case 340:this.layoutId=String(n.value);break;case 310:{const s=String(n.value).replace(/\s+/g,"");s&&e.push(s);break}}}return e.length>0&&(this.previewIcon=Cl(e)),this}};fn.MODEL_SPACE_NAME="*Model_Space",fn.PAPER_SPACE_NAME_PREFIX="*Paper_Space";let lt=fn;var Af=(i=>(i[i.kInches=0]="kInches",i[i.kMillimeters=1]="kMillimeters",i[i.kPixels=2]="kPixels",i))(Af||{}),Sf=(i=>(i[i.k0degrees=0]="k0degrees",i[i.k90degrees=1]="k90degrees",i[i.k180degrees=2]="k180degrees",i[i.k270degrees=3]="k270degrees",i))(Sf||{}),Pf=(i=>(i[i.kDisplay=0]="kDisplay",i[i.kExtents=1]="kExtents",i[i.kLimits=2]="kLimits",i[i.kView=3]="kView",i[i.kWindow=4]="kWindow",i[i.kLayout=5]="kLayout",i))(Pf||{}),kf=(i=>(i[i.kDraft=0]="kDraft",i[i.kPreview=1]="kPreview",i[i.kNormal=2]="kNormal",i[i.kPresentation=3]="kPresentation",i[i.kMaximum=4]="kMaximum",i[i.kCustom=5]="kCustom",i))(kf||{}),If=(i=>(i[i.kAsDisplayed=0]="kAsDisplayed",i[i.kWireframe=1]="kWireframe",i[i.kHidden=2]="kHidden",i[i.kRendered=3]="kRendered",i[i.kVisualStyle=4]="kVisualStyle",i[i.kRenderPreset=5]="kRenderPreset",i))(If||{}),Ef=(i=>(i[i.kScaleToFit=0]="kScaleToFit",i[i.k1_128in_1ft=1]="k1_128in_1ft",i[i.k1_64in_1ft=2]="k1_64in_1ft",i[i.k1_32in_1ft=3]="k1_32in_1ft",i[i.k1_16in_1ft=4]="k1_16in_1ft",i[i.k3_32in_1ft=5]="k3_32in_1ft",i[i.k1_8in_1ft=6]="k1_8in_1ft",i[i.k3_16in_1ft=7]="k3_16in_1ft",i[i.k1_4in_1ft=8]="k1_4in_1ft",i[i.k3_8in_1ft=9]="k3_8in_1ft",i[i.k1_2in_1ft=10]="k1_2in_1ft",i[i.k3_4in_1ft=11]="k3_4in_1ft",i[i.k1in_1ft=12]="k1in_1ft",i[i.k3in_1ft=13]="k3in_1ft",i[i.k6in_1ft=14]="k6in_1ft",i[i.k1ft_1ft=15]="k1ft_1ft",i[i.k1_1=16]="k1_1",i[i.k1_2=17]="k1_2",i[i.k1_4=18]="k1_4",i[i.k1_5=19]="k1_5",i[i.k1_8=20]="k1_8",i[i.k1_10=21]="k1_10",i[i.k1_16=22]="k1_16",i[i.k1_20=23]="k1_20",i[i.k1_30=24]="k1_30",i[i.k1_40=25]="k1_40",i[i.k1_50=26]="k1_50",i[i.k1_100=27]="k1_100",i[i.k2_1=28]="k2_1",i[i.k4_1=29]="k4_1",i[i.k8_1=30]="k8_1",i[i.k10_1=31]="k10_1",i[i.k100_1=32]="k100_1",i[i.k1000_1=33]="k1000_1",i[i.k1and1_2in_1ft=34]="k1and1_2in_1ft",i))(Ef||{});const s_={0:0,1:1/1536,2:1/768,3:1/384,4:1/192,5:1/128,6:1/96,7:1/64,8:1/48,9:1/32,10:1/24,11:1/16,12:1/12,13:1/4,14:1/2,15:1,16:1,17:1/2,18:1/4,19:1/5,20:1/8,21:1/10,22:1/16,23:1/20,24:1/30,25:1/40,26:1/50,27:1/100,28:2,29:4,30:8,31:10,32:100,33:1e3,34:1/8};class Tf extends mt{constructor(t=!1){super(),this._plotSettingsName="",this._plotCfgName="",this._canonicalMediaName="",this._currentStyleSheet="",this._plotOrigin=new M,this._customPrintScale={numerator:1,denominator:1},this._plotPaperSize=new M,this._plotPaperMargins={left:0,right:0,top:0,bottom:0},this._plotViewName="",this._paperImageOrigin=new M,this._plotWindowArea=new Ct,this._modelType=t,this._plotCentered=!1,this._plotHidden=!1,this._plotPaperUnits=1,this._plotPlotStyles=!0,this._plotRotation=0,this._plotType=5,this._plotViewportBorders=!1,this._printLineweights=!0,this._scaleLineweights=!1,this._drawViewportsFirst=!1,this._showPlotStyles=!0,this._shadePlotType=0,this._shadePlotResLevel=2,this._shadePlotCustomDpi=300,this._shadePlotId=void 0,this._stdScaleType=0,this._useStandardScale=!0}get plotSettingsName(){return this._plotSettingsName}set plotSettingsName(t){this._plotSettingsName=t}getPlotSettingsName(){return this._plotSettingsName}setPlotSettingsName(t){this._plotSettingsName=t}get plotCfgName(){return this._plotCfgName}set plotCfgName(t){this._plotCfgName=t}getPlotCfgName(){return this._plotCfgName}get canonicalMediaName(){return this._canonicalMediaName}set canonicalMediaName(t){this._canonicalMediaName=t}getCanonicalMediaName(){return this._canonicalMediaName}get currentStyleSheet(){return this._currentStyleSheet}set currentStyleSheet(t){this._currentStyleSheet=t}getCurrentStyleSheet(){return this._currentStyleSheet}get plotOrigin(){return this._plotOrigin}set plotOrigin(t){this._plotOrigin=t}getPlotOrigin(){return this._plotOrigin}get customPrintScale(){return this._customPrintScale}set customPrintScale(t){this._customPrintScale=t}getCustomPrintScale(){return this._customPrintScale}get plotPaperSize(){return this._plotPaperSize}set plotPaperSize(t){this._plotPaperSize=t}getPlotPaperSize(){return this._plotPaperSize}get plotPaperMargins(){return this._plotPaperMargins}set plotPaperMargins(t){this._plotPaperMargins=t}getPlotPaperMargins(){return this._plotPaperMargins}get plotViewName(){return this._plotViewName}set plotViewName(t){this._plotViewName=t}getPlotViewName(){return this._plotViewName}get paperImageOrigin(){return this._paperImageOrigin}set paperImageOrigin(t){this._paperImageOrigin=t}get plotWindowArea(){return this._plotWindowArea}set plotWindowArea(t){this._plotWindowArea=t}getPlotWindowArea(){return this._plotWindowArea}get modelType(){return this._modelType}set modelType(t){this._modelType=t}getModelType(){return this._modelType}setModelType(t){this._modelType=t}get drawViewportsFirst(){return this._drawViewportsFirst}set drawViewportsFirst(t){this._drawViewportsFirst=t}setDrawViewportsFirst(t){this._drawViewportsFirst=t}get plotCentered(){return this._plotCentered}set plotCentered(t){this._plotCentered=t}setPlotCentered(t){this._plotCentered=t}get plotHidden(){return this._plotHidden}set plotHidden(t){this._plotHidden=t}setPlotHidden(t){this._plotHidden=t}get plotPaperUnits(){return this._plotPaperUnits}set plotPaperUnits(t){this._plotPaperUnits=t}get plotPlotStyles(){return this._plotPlotStyles}set plotPlotStyles(t){this._plotPlotStyles=t}setPlotPlotStyles(t){this._plotPlotStyles=t}get plotRotation(){return this._plotRotation}set plotRotation(t){this._plotRotation=t}get plotType(){return this._plotType}set plotType(t){this._plotType=t}get plotViewportBorders(){return this._plotViewportBorders}set plotViewportBorders(t){this._plotViewportBorders=t}setPlotViewportBorders(t){this._plotViewportBorders=t}get printLineweights(){return this._printLineweights}set printLineweights(t){this._printLineweights=t}setPrintLineweights(t){this._printLineweights=t}get scaleLineweights(){return this._scaleLineweights}set scaleLineweights(t){this._scaleLineweights=t}setScaleLineweights(t){this._scaleLineweights=t}get showPlotStyles(){return this._showPlotStyles}set showPlotStyles(t){this._showPlotStyles=t}setShowPlotStyles(t){this._showPlotStyles=t}get shadePlot(){return this._shadePlotType}set shadePlot(t){this._shadePlotType=t}setShadePlot(t){this._shadePlotType=t}get shadePlotResLevel(){return this._shadePlotResLevel}set shadePlotResLevel(t){this._shadePlotResLevel=t}setShadePlotResLevel(t){this._shadePlotResLevel=t}get shadePlotCustomDPI(){return this._shadePlotCustomDpi}set shadePlotCustomDPI(t){this._shadePlotCustomDpi=t}setShadePlotCustomDPI(t){this._shadePlotCustomDpi=t}get shadePlotId(){return this._shadePlotId}set shadePlotId(t){this._shadePlotId=t}get plotWireframe(){return this._shadePlotType===1}get plotAsRaster(){return this._shadePlotType===3||this._shadePlotType===4||this._shadePlotType===5}get stdScaleType(){return this._stdScaleType}set stdScaleType(t){this._stdScaleType=t}get stdScale(){return s_[this._stdScaleType]??1}get useStandardScale(){return this._useStandardScale}set useStandardScale(t){this._useStandardScale=t}dxfOutFields(t){super.dxfOutFields(t),t.writeSubclassMarker("AcDbPlotSettings"),t.writeString(1,this.plotSettingsName),t.writeString(2,this.plotCfgName),t.writeString(4,this.canonicalMediaName),t.writeString(6,this.plotViewName),t.writeDouble(40,this.plotPaperMargins.left),t.writeDouble(41,this.plotPaperMargins.bottom),t.writeDouble(42,this.plotPaperMargins.right),t.writeDouble(43,this.plotPaperMargins.top),t.writeDouble(44,this.plotPaperSize.x),t.writeDouble(45,this.plotPaperSize.y),t.writeDouble(46,this.plotOrigin.x),t.writeDouble(47,this.plotOrigin.y),t.writeDouble(48,this.plotWindowArea.min.x),t.writeDouble(49,this.plotWindowArea.min.y),t.writeDouble(140,this.plotWindowArea.max.x),t.writeDouble(141,this.plotWindowArea.max.y),t.writeDouble(142,this.customPrintScale.numerator),t.writeDouble(143,this.customPrintScale.denominator);let e=0;return this.plotViewportBorders&&(e|=1),this.showPlotStyles&&(e|=2),this.plotCentered&&(e|=4),this.plotHidden&&(e|=8),this.useStandardScale&&(e|=16),this.plotPlotStyles&&(e|=32),this.scaleLineweights&&(e|=64),this.printLineweights&&(e|=128),this.drawViewportsFirst&&(e|=512),this.modelType&&(e|=1024),t.writeInt16(70,e),t.writeInt16(72,this.plotPaperUnits),t.writeInt16(73,this.plotRotation),t.writeInt16(74,this.plotType),t.writeString(7,this.currentStyleSheet),t.writeInt16(75,this.stdScaleType),t.writeInt16(76,this.shadePlot),t.writeInt16(77,this.shadePlotResLevel),t.writeInt16(78,this.shadePlotCustomDPI),t.writeDouble(147,this.stdScale),t.writeDouble(148,this.paperImageOrigin.x),t.writeDouble(149,this.paperImageOrigin.y),t.writeObjectId(333,this.shadePlotId),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbPlotSettings");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code),r=Number(e.value);switch(n){case 1:this.plotSettingsName=String(e.value);break;case 2:this.plotCfgName=String(e.value);break;case 4:this.canonicalMediaName=String(e.value);break;case 6:this.plotViewName=String(e.value);break;case 7:this.currentStyleSheet=String(e.value);break;case 40:this.plotPaperMargins.left=r;break;case 41:this.plotPaperMargins.bottom=r;break;case 42:this.plotPaperMargins.right=r;break;case 43:this.plotPaperMargins.top=r;break;case 44:this.plotPaperSize.x=r;break;case 45:this.plotPaperSize.y=r;break;case 46:this.plotOrigin.x=r;break;case 47:this.plotOrigin.y=r;break;case 48:this.plotWindowArea.min.x=r;break;case 49:this.plotWindowArea.min.y=r;break;case 140:this.plotWindowArea.max.x=r;break;case 141:this.plotWindowArea.max.y=r;break;case 142:this.customPrintScale.numerator=r;break;case 143:this.customPrintScale.denominator=r;break;case 70:{const s=r;this.plotViewportBorders=(s&1)!==0,this.showPlotStyles=(s&2)!==0,this.plotCentered=(s&4)!==0,this.plotHidden=(s&8)!==0,this.useStandardScale=(s&16)!==0,this.plotPlotStyles=(s&32)!==0,this.scaleLineweights=(s&64)!==0,this.printLineweights=(s&128)!==0,this.drawViewportsFirst=(s&512)!==0,this.modelType=(s&1024)!==0;break}case 72:this.plotPaperUnits=r;break;case 73:this.plotRotation=r;break;case 74:this.plotType=r;break;case 75:this.stdScaleType=r;break;case 76:this.shadePlot=r;break;case 77:this.shadePlotResLevel=r;break;case 78:this.shadePlotCustomDPI=r;break;case 147:break;case 148:this.paperImageOrigin.x=r;break;case 149:this.paperImageOrigin.y=r;break;case 333:this.shadePlotId=String(e.value);break;case 100:return t.pushBackItem(e),this}}return this}}class Vn extends Tf{constructor(){super(),this._insertionPoint=new x,this._ucsOrigin=new x,this._ucsXAxis=new A(1,0,0),this._ucsYAxis=new A(0,1,0),this._elevation=0,this._orthographicType=0,this._tabOrder=-1,this._tabSelected=!1,this._blockTableRecordId="",this._layoutName="",this._limits=new Ct,this._extents=new H,this._viewportArray=[]}get layoutName(){return this._layoutName}set layoutName(t){this._layoutName=t.length>256?t.slice(0,256):t}get tabOrder(){return this._tabOrder}set tabOrder(t){this._tabOrder=t}get tabSelected(){return this._tabSelected}set tabSelected(t){this._tabSelected=t}get blockTableRecordId(){return this._blockTableRecordId}set blockTableRecordId(t){this._blockTableRecordId=t}get limits(){return this._limits}set limits(t){this._limits.copy(t)}get extents(){return this._extents}set extents(t){this._extents.copy(t)}get viewportArray(){return this._viewportArray}set viewportArray(t){this._viewportArray=t.slice()}get namedUcsId(){return this._namedUcsId}set namedUcsId(t){this._namedUcsId=t}get orthographicUcsId(){return this._orthographicUcsId}set orthographicUcsId(t){this._orthographicUcsId=t}get insertionPoint(){return this._insertionPoint}set insertionPoint(t){this._insertionPoint.copy(t)}get ucsOrigin(){return this._ucsOrigin}set ucsOrigin(t){this._ucsOrigin.copy(t)}get ucsXAxis(){return this._ucsXAxis}set ucsXAxis(t){this._ucsXAxis.copy(t)}get ucsYAxis(){return this._ucsYAxis}set ucsYAxis(t){this._ucsYAxis.copy(t)}get elevation(){return this._elevation}set elevation(t){this._elevation=t}get orthographicType(){return this._orthographicType}set orthographicType(t){this._orthographicType=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbLayout"),t.writeString(1,this.layoutName),t.writeInt16(70,this.tabSelected?1:0),t.writeInt16(71,this.tabOrder),t.writeObjectId(330,this.blockTableRecordId),t.writeObjectId(331,this._viewportArray.length>0?this._viewportArray[0]:"0"),t.writePoint2d(10,this.limits.min),t.writePoint2d(11,this.limits.max),t.writePoint3d(14,this.extents.min),t.writePoint3d(15,this.extents.max),t.writePoint3d(12,this.insertionPoint),t.writePoint3d(13,this.ucsOrigin),t.writeVector3d(16,this.ucsXAxis),t.writeVector3d(17,this.ucsYAxis),t.writeDouble(146,this.elevation),t.writeInt16(76,this.orthographicType),t.writeObjectId(345,this._namedUcsId),t.writeObjectId(346,this._orthographicUcsId),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbLayout");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code),r=Number(e.value);switch(n){case 1:this.layoutName=String(e.value);break;case 70:this.tabSelected=r!==0;break;case 71:this.tabOrder=r;break;case 330:this.blockTableRecordId=String(e.value);break;case 331:{const s=String(e.value);s&&s!=="0"&&(this.viewportArray=[s]);break}case 10:this.limits.min.x=r;break;case 20:this.limits.min.y=r;break;case 11:this.limits.max.x=r;break;case 21:this.limits.max.y=r;break;case 14:this.extents.min.x=r;break;case 24:this.extents.min.y=r;break;case 34:this.extents.min.z=r;break;case 15:this.extents.max.x=r;break;case 25:this.extents.max.y=r;break;case 35:this.extents.max.z=r;break;case 345:this.namedUcsId=String(e.value);break;case 346:this.orthographicUcsId=String(e.value);break;case 12:this.insertionPoint.x=r;break;case 22:this.insertionPoint.y=r;break;case 32:this.insertionPoint.z=r;break;case 13:this.ucsOrigin.x=r;break;case 23:this.ucsOrigin.y=r;break;case 33:this.ucsOrigin.z=r;break;case 16:this.ucsXAxis.x=r;break;case 26:this.ucsXAxis.y=r;break;case 36:this.ucsXAxis.z=r;break;case 17:this.ucsYAxis.x=r;break;case 27:this.ucsYAxis.y=r;break;case 37:this.ucsYAxis.z=r;break;case 76:this.orthographicType=r;break;case 146:this.elevation=r;break;case 100:return t.pushBackItem(e),this}}return this}}class Lf{constructor(){this.events={layoutCreated:new vt,layoutRemoved:new vt,layoutRenamed:new vt,layoutSwitched:new vt}}countLayouts(t){return this.getWorkingDatabase(t).objects.layout.numEntries}findLayoutNamed(t,e){return this.getWorkingDatabase(e).objects.layout.getAt(t)}findActiveLayout(){const t=this.getActiveLayout();return t?t.layoutName:"Model"}setCurrentLayoutId(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getIdAt(t);return this.setCurrentLayoutInternal(r,n)}setCurrentLayoutBtrId(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getBtrIdAt(t);return this.setCurrentLayoutInternal(r,n)}setCurrentLayout(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getAt(t);return this.setCurrentLayoutInternal(r,n)}renameLayout(t,e,n){const s=this.getWorkingDatabase(n).objects.layout.getAt(t);return s?(s.layoutName=e,this.events.layoutRenamed.dispatch({layout:s,oldName:t,newName:e}),!0):!1}layoutExists(t,e){return this.getWorkingDatabase(e).objects.layout.has(t)}deleteLayout(t,e){const n=this.getWorkingDatabase(e).objects.layout,r=n.getAt(t);let s=!1;return r&&(s=n.remove(t),s&&this.events.layoutRemoved.dispatch({layout:r})),s}createLayout(t,e){const n=this.getWorkingDatabase(e),r=new Vn;r.layoutName=t,r.tabOrder=n.objects.layout.maxTabOrder;const s=new lt;return s.name=`*Paper_Space${r.tabOrder}`,n.tables.blockTable.add(s),n.objects.layout.setAt(t,r),this.events.layoutCreated.dispatch({layout:r}),{layout:r,btr:s}}getActiveLayout(t){const e=this.getWorkingDatabase(t);return e.objects.layout.getBtrIdAt(e.currentSpaceId)}getWorkingDatabase(t){return t||Gg()}setCurrentLayoutInternal(t,e){return t?(this.events.layoutSwitched.dispatch({layout:t}),e.currentSpaceId=t.blockTableRecordId,!0):!1}}let Is;function a_(i){Is=i}function Mf(){return qs.instance}const Ya=class Ya{constructor(){this._workingDatabase=null}get workingDatabase(){if(this._workingDatabase==null)throw new Error("The current working database must be set before using it!");return this._workingDatabase}set workingDatabase(t){this._workingDatabase=t}get layoutManager(){return this._layoutManager||(Is||(Is=()=>new Lf),this._layoutManager=Is()),this._layoutManager}};Ya.instance=new Ya;let qs=Ya;Ug(Mf);var Ni=(i=>(i.kForRead="kForRead",i.kForWrite="kForWrite",i))(Ni||{});function o_(i){let t="";for(let e=0;e<i.length;e++){const n=i.charCodeAt(e);t+=n<=32?i[e]:String.fromCharCode(159-n)}return t}function c_(i){const t=i.trimStart();return!(!t||/^\d/.test(t)||/^ACIS/i.test(t)||/^ASM/i.test(t)||/^(body|point|plane|cone|cylinder|sphere|torus|lump|shell|face|edge|wire|transform)\b/i.test(t)||/\b(body|point|straight-curve|ellipse-curve)\s+\$/.test(t))}function l_(i){return!i||!c_(i)?i:o_(i)}function h_(i){return i.length===0?"":i.map(t=>l_(t)).join(`
|
|
5
|
+
`}toBinary(){if(this.assertWriteMode(),this._outputFormat!=="binary")throw new Error("Filer is not in binary output mode");const t=new Uint8Array(this._binaryLength);let e=0;for(const n of this._binaryChunks)t.set(n,e),e+=n.length;return t}registerHandle(t){return this._handleMap.has(t)||(/^[0-9A-F]+$/i.test(t)?this._handleMap.set(t,t.toUpperCase()):(this._handleMap.set(t,this._nextHandle.toString(16).toUpperCase()),this._nextHandle+=1)),this._handleMap.get(t)}computeHandseed(){let t=this._nextHandle-1;for(const e of this._handleMap.values()){const n=Number.parseInt(e,16);Number.isFinite(n)&&n>t&&(t=n)}return(t+1).toString(16).toUpperCase()}writeHandseedPlaceholder(){return this.writeString(9,"$HANDSEED"),this._outputFormat==="binary"?(this.writeString(5,this.computeHandseed()),this):(this.writeGroup(5,this.computeHandseed()),this._handseedValueLine=this._lines.length-1,this)}finalizeHandseed(){return this._handseedValueLine>=0&&this._handseedValueLine<this._lines.length&&(this._lines[this._handseedValueLine]=this.computeHandseed()),this}resolveHandle(t){if(t)return this.registerHandle(t)}get atEof(){var t;return this._mode!=="read"||this._pushed.length>0?!1:((t=this._reader)==null?void 0:t.peek())===void 0}position(){return this._mode!=="read"||!this._reader?{byteOffset:0}:this._reader.position()}get atEndOfObject(){if(this._mode!=="read")return!0;const t=this.peekPair();return t===void 0||t.code===0}get atExtendedData(){if(this._mode!=="read")return!1;const t=this.peekPair();return t?t.code===1001||t.code===1e3||t.code===1002:!1}atSubclassData(t){if(this._mode!=="read")return!1;const e=this.peekPair();return!e||e.code!==100||typeof e.value!="string"||e.value!==t?!1:(this.readPair(),!0)}peekItem(){const t=this.peekPair();return t?this.pairToTypedValue(t):void 0}readItem(){const t=this.readPair();if(!t){this._status=1;return}return this._status=0,this.pairToTypedValue(t)}pushBackItem(t){if(t&&"type"in t){this._pushed.push(t);return}if(t){this._pushed.push(this.typedValueToPair(t));return}this._lastRead&&this._pushed.push(this._lastRead)}skipToEndOfObject(){for(;!this.atEndOfObject&&!this.atEof;)this.readPair()}readString(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="string"||e.type==="handle"?e.value:String(e.value)}}readInt16(t){return this.readNumber(t)}readInt32(t){return this.readNumber(t)}readInt64(t){const e=this.readPair();if(!e)return;if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}if(e.type==="long"||e.type==="int"||e.type==="double")return e.value;if(e.type==="bool")return e.value?1:0;const n=Number(e.value);return Number.isFinite(n)?n:0}readDouble(t){return this.readNumber(t)}readBoolean(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="bool"?e.value:typeof e.value=="number"?e.value!==0:typeof e.value=="string"?e.value!=="0"&&e.value!=="":!!e.value}}readHandle(t){const e=this.readPair();if(e){if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}return e.type==="handle"||e.type==="string"?e.value:String(e.value)}}readObjectId(t){return this.readHandle(t)}readPoint2d(t){const e=this.readDouble(t);if(e===void 0)return;const n=this.peekPair();let r=0;return n&&n.code===t+10&&(r=this.readNumber()??0),new M(e,r)}readPoint3d(t){const e=this.readDouble(t);if(e===void 0)return;let n=0,r=0;const s=this.peekPair();s&&s.code===t+10&&(n=this.readNumber()??0);const a=this.peekPair();return a&&a.code===t+20&&(r=this.readNumber()??0),new x(e,n,r)}readVector3d(t){const e=this.readPoint3d(t);return e?new A(e.x,e.y,e.z):void 0}readCmColorInto(t,e=62,n=420){const r=this.peekPair();if(!r)return!1;if(r.code===e){const s=this.readNumber();return s!=null&&(t.colorIndex=s),!0}if(r.code===n){const s=this.readNumber();return s!=null&&t.setRGBValue(s),!0}return!1}writeGroup(t,e){if(this.assertWriteMode(),e==null)return this;if(this._outputFormat==="binary")return this.writeBinaryGroup(t,e);this._lines.push(String(Math.trunc(t)));const n=this.formatValue(e);return this._lines.push(n===""?"0":n),this}writeStart(t){return this.writeString(0,t)}get capabilities(){return(this._version??Lt.latest).capabilities}writeSubclassMarker(t){return this.capabilities.supportsSubclassMarkers?this.writeString(100,t):this}writeString(t,e){return e==null||e===""?this:this.writeGroup(t,e)}writeMTextContents(t){for(const e of Dg(t??""))this.writeString(e.code,e.value);return this}writeInt8(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt16(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt32(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeInt64(t,e){return e==null?this:this.writeGroup(t,Math.trunc(e))}writeUInt16(t,e){return e==null?this:this.writeGroup(t,Math.max(0,e))}writeUInt32(t,e){return e==null?this:this.writeGroup(t,Math.max(0,e))}writeBoolean(t,e){return e==null?this:this.writeGroup(t,e?1:0)}writeBool(t,e){return this.writeBoolean(t,e)}writeDouble(t,e){return e==null||!Number.isFinite(e)?this:this.writeGroup(t,e)}writeAngle(t,e){return e==null||!Number.isFinite(e)?this:this.writeDouble(t,e*180/Math.PI)}writeHandle(t,e){if(!this.capabilities.supportsHandles)return this;const n=this.resolveHandle(e);return n?this.writeString(t,n):this}writeObjectId(t,e){return this.writeHandle(t,e)}writeLineWeight(t,e){return e==null||!this.capabilities.supportsLineWeight?this:this.writeInt16(t,e)}writePoint2d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this):this}writePoint3d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this.writeDouble(t+20,e.z??0),this):this}writeVector3d(t,e){return e?(this.writeDouble(t,e.x),this.writeDouble(t+10,e.y),this.writeDouble(t+20,e.z??0),this):this}writeCmColor(t,e=62,n=420){if(!t)return this;const r=t.colorIndex;r!=null&&this.writeInt16(e,r);const s=t.RGB;return s!=null&&t.colorIndex==null&&(this.capabilities.supportsTrueColor?this.writeInt32(n,s):this.writeInt16(e,7)),this}writeTransparency(t,e=440){return!t||t.method===exports.AcCmTransparencyMethod.ErrorValue||!this.capabilities.supportsTransparency?this:this.writeInt32(e,t.serialize())}writeResultBuffer(t){return this.writeTypedValues(t)}writeTypedValues(t){if(!t)return this;for(const e of t){const n=Number(e.code);if(n===1e3&&typeof e.value=="string"){const r=this.capabilities.supportsUtf8CodePage?Rg(e.value,yc):l1(this.sanitizeStringForDxfLine(e.value),yc);for(const s of r)this.writeGroup(1e3,s);continue}if(n===1004){const r=L1(e.value);if(r){for(const s of Bg(r,Ng))this._outputFormat==="binary"?this.writeGroup(1004,s):this.writeGroup(1004,wu(s));continue}}if(n>=1010&&n<=1013){const r=M1(e.value);if(r){this.writePoint3d(n,r);continue}}this.writeGroup(e.code,e.value)}return this}startSection(t){return this.writeStart("SECTION"),this.writeString(2,t),this}endSection(){return this.writeStart("ENDSEC"),this}startTable(t){return this.writeStart("TABLE"),this.writeString(2,t),this}endTable(){return this.writeStart("ENDTAB"),this}assertWriteMode(){if(this._mode!=="write")throw new Error("AcDbDxfFiler is in read mode")}appendBinary(t){this._binaryChunks.push(t),this._binaryLength+=t.length}writeBinaryCode(t){const e=Math.trunc(t)&65535;if(!this.capabilities.supportsSubclassMarkers){e<=255?this.appendBinary(Uint8Array.of(e)):this.appendBinary(Uint8Array.of(255,e&255,e>>8&255));return}const r=new Uint8Array(2);new DataView(r.buffer).setUint16(0,e,!0),this.appendBinary(r)}writeBinaryGroup(t,e){const n=$i(Math.trunc(t));switch(this.writeBinaryCode(Math.trunc(t)),n){case"string":case"handle":{const r=typeof e=="string"?this.encodeStringForWrite(e):this.formatValue(e),s=new TextEncoder().encode(r),a=new Uint8Array(s.length+1);a.set(s),a[s.length]=0,this.appendBinary(a);break}case"int":{const r=Math.trunc(Number(e))||0;if(Tg(Math.trunc(t))){const s=new Uint8Array(4);new DataView(s.buffer).setInt32(0,r,!0),this.appendBinary(s)}else{const s=new Uint8Array(2);new DataView(s.buffer).setInt16(0,r,!0),this.appendBinary(s)}break}case"long":{const r=new Uint8Array(8),s=new DataView(r.buffer);typeof e=="bigint"?s.setBigInt64(0,e,!0):s.setBigInt64(0,BigInt(Math.trunc(Number(e))||0),!0),this.appendBinary(r);break}case"double":{const r=new Uint8Array(8),s=Number(e);new DataView(r.buffer).setFloat64(0,Number.isFinite(s)?s:0,!0),this.appendBinary(r);break}case"bool":{const r=typeof e=="boolean"?e:Number(e)!==0&&e!==""&&e!=null;this.appendBinary(Uint8Array.of(r?1:0));break}case"binary":{const r=e instanceof Uint8Array?e:new Uint8Array(0),s=Math.min(255,r.length),a=new Uint8Array(1+s);a[0]=s,a.set(r.subarray(0,s),1),this.appendBinary(a);break}default:{const r=this.formatValue(e),s=new TextEncoder().encode(r===""?"0":r),a=new Uint8Array(s.length+1);a.set(s),a[s.length]=0,this.appendBinary(a);break}}return this}assertReadMode(){if(this._mode!=="read"||!this._reader)throw new Error("AcDbDxfFiler is not in read mode")}peekPair(){return this.assertReadMode(),this._pushed.length>0?this._pushed[this._pushed.length-1]:this._reader.peek()}readPair(){if(this.assertReadMode(),this._pushed.length>0){const e=this._pushed.pop();return this._lastRead=e,e}const t=this._reader.next();return this._lastRead=t,t}pushBackPair(t){this._pushed.push(t)}readNumber(t){const e=this.readPair();if(!e)return;if(t!=null&&e.code!==t){this.pushBackPair(e),this.setError(3,`Expected group code ${t}, got ${e.code}`);return}if(e.type==="double"||e.type==="int"||e.type==="long"){const r=e.value;return typeof r=="bigint"?Number(r):r}if(e.type==="bool")return e.value?1:0;const n=Number(e.value);return Number.isFinite(n)?n:0}pairToTypedValue(t){return{code:t.code,value:t.value}}typedValueToPair(t){const e=Number(t.code),n=t.value;return typeof n=="boolean"?{code:e,type:"bool",value:n}:typeof n=="number"?Number.isInteger(n)?{code:e,type:"int",value:n}:{code:e,type:"double",value:n}:typeof n=="bigint"?{code:e,type:"long",value:n}:n instanceof Uint8Array?{code:e,type:"binary",value:n}:{code:e,type:"string",value:String(n??"")}}formatValue(t){if(typeof t=="string")return this.encodeStringForWrite(t);if(typeof t=="boolean")return t?"1":"0";if(typeof t=="number"){if(!Number.isFinite(t))return"0";if(Number.isInteger(t))return String(t);const n=t.toFixed(this._precision).replace(/\.?0+$/,"");return n===""||n==="-"?"0":n}return t instanceof Uint8Array?wu(t):String(t)}sanitizeStringForDxfLine(t){return t.replace(/\r\n|\r|\n/g," ").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"")}encodeStringForWrite(t){const e=this.sanitizeStringForDxfLine(t);return this.capabilities.supportsUtf8CodePage?e:h1(e)}}function wu(i){let t="";for(let e=0;e<i.length;e++)t+=(i[e]??0).toString(16).padStart(2,"0").toUpperCase();return t}function T1(i){const t=i.replace(/\s+/g,""),e=t.length>>>1,n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=Number.parseInt(t.slice(r*2,r*2+2),16)||0;return n}function L1(i){if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i)&&!(i instanceof DataView)){const t=i;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof i=="string"){const t=i.replace(/\s+/g,"");return t.length===0?new Uint8Array(0):!/^[0-9A-Fa-f]*$/.test(t)||t.length%2!==0?void 0:T1(t)}if(Array.isArray(i)&&i.every(t=>typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=255))return Uint8Array.from(i)}function M1(i){if(!(i==null||typeof i=="number"||typeof i=="string")){if(typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"){const t=i;return{x:t.x,y:t.y,z:t.z??0}}if(Array.isArray(i)&&typeof i[0]=="number"&&typeof i[1]=="number")return{x:i[0],y:i[1],z:typeof i[2]=="number"?i[2]:0}}}var Cn=256,Vg=[],vu=256,cs;for(;Cn--;)Vg[Cn]=(Cn+256).toString(16).substring(1);function C1(i){var t=0,e=11;if(!cs||Cn+e>vu*2)for(cs="",Cn=0;t<vu;t++)cs+=Vg[Math.random()*256|0];return cs.substring(Cn,Cn+++e)}class ze{constructor(t){if(this._values=[],t)for(const e of t)this._values.push({...e})}get length(){return this._values.length}at(t){return this._values[t]}add(t){this._values.push(t)}addRange(t){for(const e of t)this._values.push(e)}clear(){this._values.length=0}toArray(){return this._values.map(t=>({...t}))}clone(){return new ze(this._values)}[Symbol.iterator](){return this._values[Symbol.iterator]()}}const yn="TEMP_";let Xn;function Ug(i){Xn=i}function Hg(i){Xn&&(Xn().workingDatabase=i)}function Gg(){if(Xn)return Xn().workingDatabase;throw new Error("The current working database must be set before using it!")}const Ee=class Ee{constructor(t,e){t=t||{},this._attrs=new lc(t,e),this._attrs.get("objectId")||(this._database?this._attrs.set("objectId",this._database.generateHandle()):this._attrs.set("objectId",this.generateTemporaryHandle()))}generateTemporaryHandle(){return yn+C1()}get attrs(){return this._attrs}getAttr(t){const e=this._attrs.get(t);if(e===void 0)throw new Error(`[AcDbObject] Attribute name '${t}' does't exist in this object!`);return e}getAttrWithoutException(t){return this._attrs.get(t)}setAttr(t,e){this._attrs.set(t,e)}get objectId(){return this.getAttr("objectId")}set objectId(t){this._attrs.set("objectId",t),t&&!t.startsWith(yn)&&this._database&&this._database.updateMaxHandle(t)}get isTemp(){const t=this.getAttrWithoutException("objectId");return!!t&&t.startsWith(yn)}get ownerId(){return this.getAttr("ownerId")}set ownerId(t){this._attrs.set("ownerId",t)}get extensionDictionary(){return this.getAttrWithoutException("extensionDictionary")}set extensionDictionary(t){this._attrs.set("extensionDictionary",t)}get database(){if(this._database)return this._database;if(Xn)return Xn().workingDatabase;throw new Error("The current working database must be set before using it!")}set database(t){this.assignDatabase(t)}assignDatabase(t){this._database!==t&&(this._database=t,this.onDatabaseChanged(t))}onDatabaseChanged(t){}findImportedXDataRange(t){const e=this._importedXData;if(!e)return;let n=0;for(;n<e.length;){if(Number(e[n])!==Z.ExtendedDataRegAppName){n+=2;continue}const r=String(e[n+1]??"");let s=n+2;for(;s<e.length&&Number(e[s])!==Z.ExtendedDataRegAppName;)s+=2;if(r===t)return[n,s];n=s}}removeImportedXData(t){const e=this._importedXData,n=this.findImportedXDataRange(t);!e||!n||(e.splice(n[0],n[1]-n[0]),e.length===0&&(this._importedXData=void 0))}rememberXDataApp(t){if(!t)return;const e=this._xDataOrder??(this._xDataOrder=[]);e.indexOf(t)===-1&&e.push(t)}forgetXDataApp(t){const e=this._xDataOrder;if(!e)return;const n=e.indexOf(t);n>=0&&e.splice(n,1),e.length===0&&(this._xDataOrder=void 0)}clearMaterializedXData(t){const e=this._xDataMap;e&&(e.delete(t),e.size===0&&(this._xDataMap=void 0))}onXDataChanged(t){}notifyXDataChanged(t){this.onXDataChanged(t)}*importedXDataValues(t,e){const n=this._importedXData;if(n)for(let r=t;r<e;r+=2)yield{code:Number(n[r]),value:n[r+1]}}setImportedXData(t){const e=[];let n,r;for(const s of t){const a=Number(s.code);if(a===Z.ExtendedDataRegAppName){n&&r&&e.push({appId:n,flat:r}),n=String(s.value),r=[a,s.value];continue}!n||!r||r.push(a,s.value)}if(n&&r&&e.push({appId:n,flat:r}),e.length!==0)for(const s of e){if(!s.appId)continue;this.removeImportedXData(s.appId),this.clearMaterializedXData(s.appId);const a=this._importedXData??(this._importedXData=[]);for(const o of s.flat)a.push(o);this.rememberXDataApp(s.appId),this.notifyXDataChanged(s.appId)}}getXData(t){var s;const e=(s=this._xDataMap)==null?void 0:s.get(t);if(e)return e;const n=this.findImportedXDataRange(t);if(!n)return;const r=new ze;for(const a of this.importedXDataValues(n[0],n[1]))r.add(a);return this.removeImportedXData(t),(this._xDataMap??(this._xDataMap=new Map)).set(t,r),r}*iterateXData(t){var r;const e=(r=this._xDataMap)==null?void 0:r.get(t);if(e){yield*e;return}const n=this.findImportedXDataRange(t);n&&(yield*this.importedXDataValues(n[0],n[1]))}setXData(t){for(const e of t)if(e.code===Z.ExtendedDataRegAppName){const n=e.value;this.removeImportedXData(n),(this._xDataMap??(this._xDataMap=new Map)).set(n,t),this.rememberXDataApp(n),this.notifyXDataChanged(n)}}removeXData(t){this.removeImportedXData(t),this.clearMaterializedXData(t),this.forgetXDataApp(t),this.notifyXDataChanged(t)}createExtensionDictionary(){const t=this.extensionDictionary;if(t)return t;const e=this.database;if(e)return e.createExtensionDictionaryFor(this)}close(){}getOwnSnapshotKeys(){return Reflect.ownKeys(this).filter(t=>typeof t=="string"&&!Ee.SNAPSHOT_EXCLUDED_KEYS.has(t))}cloneAttrs(t){const e=this.cloneValue(t.attributes);return new lc(e)}restoreAttrsFrom(t){const e=this.cloneValue(t.attributes),n=this._attrs.attributes;for(const r of Object.keys(n))r in e||this._attrs.set(r,void 0,{unset:!0,silent:!0});this._attrs.set(e,{silent:!0})}restoreXDataMapFrom(t){if(!t||t.size===0){this._xDataMap=void 0;return}const e=new Map;for(const[n,r]of t.entries())e.set(n,this.cloneValue(r));this._xDataMap=e}copySnapshotStateTo(t){t._attrs=this.cloneAttrs(this._attrs),t._xDataMap=this._xDataMap?this.cloneValue(this._xDataMap):void 0;const e=this,n=t;for(const r of this.getOwnSnapshotKeys())Ee.SNAPSHOT_INTERNAL_KEYS.has(r)||(n[r]=this.cloneValue(e[r]))}clone(){const t=Object.create(Object.getPrototypeOf(this));return this.copySnapshotStateTo(t),t.objectId=this.generateTemporaryHandle(),t}clonePreservingIdentity(){const t=this.clone(),e=this.getAttrWithoutException("objectId");e&&t._attrs.set("objectId",e);const n=this.getAttrWithoutException("ownerId");return n!==void 0&&t._attrs.set("ownerId",n),this._database&&(t._database=this._database),t}restoreFrom(t){const e=this.objectId,n=this._database;this.restoreAttrsFrom(t._attrs),this.restoreXDataMapFrom(t._xDataMap);const r=t,s=this,a=new Set(t.getOwnSnapshotKeys());for(const o of a)Ee.SNAPSHOT_INTERNAL_KEYS.has(o)||Ee.SNAPSHOT_EXCLUDED_KEYS.has(o)||(s[o]=this.cloneValue(r[o]));for(const o of this.getOwnSnapshotKeys())Ee.SNAPSHOT_INTERNAL_KEYS.has(o)||Ee.SNAPSHOT_EXCLUDED_KEYS.has(o)||a.has(o)||delete s[o];this.objectId=e,n&&(this.database=n)}cloneValue(t){if(t==null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(Array.isArray(t))return t.map(r=>this.cloneValue(r));if(t instanceof Map){const r=new Map;for(const[s,a]of t.entries())r.set(this.cloneValue(s),this.cloneValue(a));return r}if(t instanceof Set){const r=new Set;for(const s of t.values())r.add(this.cloneValue(s));return r}if(ArrayBuffer.isView(t)){if(t instanceof DataView)return new DataView(t.buffer.slice(0));const r=t.constructor;return new r(t)}if(t instanceof ArrayBuffer)return t.slice(0);if(typeof Blob<"u"&&t instanceof Blob||t&&typeof t=="object"&&"tables"in t&&"transactionManager"in t)return t;if("clone"in t&&typeof t.clone=="function")return t.clone();const e=Object.create(Object.getPrototypeOf(t)),n=t;for(const r of Object.keys(n))e[r]=this.cloneValue(n[r]);return e}dxfOut(...t){const[e,n=!1]=t;return e.writeHandle(5,this.objectId),e.writeObjectId(330,this.ownerId),e.writeObjectId(360,this.extensionDictionary),this.dxfOutFields(e),n&&this.dxfOutXData(e),this}dxfOutXData(t){var s;const e=this._xDataOrder;if(e){for(const a of e){const o=(s=this._xDataMap)==null?void 0:s.get(a);if(o){t.writeResultBuffer(o);continue}const c=this.findImportedXDataRange(a);c&&t.writeTypedValues(this.importedXDataValues(c[0],c[1]))}return}const n=this._importedXData;if(n){let a=0;for(;a<n.length;){let o=a+2;for(;o<n.length&&Number(n[o])!==Z.ExtendedDataRegAppName;)o+=2;t.writeTypedValues(this.importedXDataValues(a,o)),a=o}}const r=this._xDataMap;if(r)for(const a of r.values())t.writeResultBuffer(a)}dxfOutFields(t){return this}dxfIn(t){for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===5||n===105)this.objectId=String(e.value);else if(n===330)this.ownerId=String(e.value);else if(n===360)this.extensionDictionary=String(e.value);else if(n===102)this.dxfInControlString(t,String(e.value));else if(n===100){t.pushBackItem(e);break}else{t.pushBackItem(e);break}}return this.dxfInFields(t),t.atExtendedData&&this.dxfInXData(t),this}dxfInControlString(t,e){const n=e==="{ACAD_XDICTIONARY"||e==="ACAD_XDICTIONARY";for(;!t.atEndOfObject&&!t.atEof;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===102){const a=String(r.value);if(a==="}"||a==="")break;this.dxfInControlString(t,a);continue}n&&s===360&&!this.extensionDictionary&&(this.extensionDictionary=String(r.value))}}dxfInFields(t){return this}dxfInXData(t){let e;const n=()=>{e&&e.length>0&&this.setXData(e),e=void 0};for(;!t.atEndOfObject&&!t.atEof;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===1001)n(),e=new ze([{code:r.code,value:r.value}]);else if(s>=1e3&&s<=1071)e||(e=new ze),e.add({code:r.code,value:r.value});else{t.pushBackItem(r);break}}n()}};Ee.SNAPSHOT_EXCLUDED_KEYS=new Set(["_database","transactionManager"]),Ee.SNAPSHOT_INTERNAL_KEYS=new Set(["_attrs","_xDataMap"]);let mt=Ee;exports.AcGiArrowType=void 0;(function(i){i.ClosedFilled="",i.Dot="_DOT",i.DotSmall="_DOTSMALL",i.DotBlank="_DOTBLANK",i.Origin="_ORIGIN",i.Origin2="_ORIGIN2",i.Open="_OPEN",i.Open90="_OPEN90",i.Open30="_OPEN30",i.Closed="_CLOSED",i.Small="_SMALL",i.None="_NONE",i.Oblique="_OBLIQUE",i.BoxFilled="_BOXFILLED",i.Box="_BOXBLANK",i.ClosedBlank="_CLOSEDBLANK",i.DatumBlank="_DATUMBLANK",i.DatumFilled="_DATUMFILLED",i.Integral="_INTEGRAL",i.ArchTick="_ARCHTICK"})(exports.AcGiArrowType||(exports.AcGiArrowType={}));exports.AcGiLineWeight=void 0;(function(i){i[i.ByBlock=-2]="ByBlock",i[i.ByDIPs=-4]="ByDIPs",i[i.ByLayer=-1]="ByLayer",i[i.ByLineWeightDefault=-3]="ByLineWeightDefault",i[i.LineWeight000=0]="LineWeight000",i[i.LineWeight005=5]="LineWeight005",i[i.LineWeight009=9]="LineWeight009",i[i.LineWeight013=13]="LineWeight013",i[i.LineWeight015=15]="LineWeight015",i[i.LineWeight018=18]="LineWeight018",i[i.LineWeight020=20]="LineWeight020",i[i.LineWeight025=25]="LineWeight025",i[i.LineWeight030=30]="LineWeight030",i[i.LineWeight035=35]="LineWeight035",i[i.LineWeight040=40]="LineWeight040",i[i.LineWeight050=50]="LineWeight050",i[i.LineWeight053=53]="LineWeight053",i[i.LineWeight060=60]="LineWeight060",i[i.LineWeight070=70]="LineWeight070",i[i.LineWeight080=80]="LineWeight080",i[i.LineWeight090=90]="LineWeight090",i[i.LineWeight100=100]="LineWeight100",i[i.LineWeight106=106]="LineWeight106",i[i.LineWeight120=120]="LineWeight120",i[i.LineWeight140=140]="LineWeight140",i[i.LineWeight158=158]="LineWeight158",i[i.LineWeight200=200]="LineWeight200",i[i.LineWeight211=211]="LineWeight211"})(exports.AcGiLineWeight||(exports.AcGiLineWeight={}));var to=(function(){function i(t){t===void 0&&(t={});var e,n,r,s;this.database=t.database,this.foregroundOnDark=(e=t.foregroundOnDark)!==null&&e!==void 0?e:Sr,this.foregroundOnLight=(n=t.foregroundOnLight)!==null&&n!==void 0?n:Pr,this.backgroundIsDark=(r=t.backgroundIsDark)!==null&&r!==void 0?r:!0,this.fallbackRgb=(s=t.fallbackRgb)!==null&&s!==void 0?s:16777215}return i.prototype.resolveSubEntityTraitsRgb=function(t){var e,n,r,s=t.color;return s.isForeground?this.backgroundIsDark?this.foregroundOnDark:this.foregroundOnLight:s.isByLayer||s.isByBlock?(e=this.fallbackRgb)!==null&&e!==void 0?e:16777215:(r=(n=s.RGB)!==null&&n!==void 0?n:this.fallbackRgb)!==null&&r!==void 0?r:16777215},i.fromBackgroundColor=function(t,e){return t===void 0&&(t=Wg),new i({database:e,foregroundOnDark:Sr,foregroundOnLight:Pr,backgroundIsDark:!$g(t),fallbackRgb:16777215})},i})(),Wg=0,Sr=16777215,Pr=0,O1=16777215,N1=128,D1=new to({database:void 0,foregroundOnDark:Sr,foregroundOnLight:Pr,backgroundIsDark:!0,fallbackRgb:16777215});function $g(i){var t=i>>16&255,e=i>>8&255,n=i&255;return .299*t+.587*e+.114*n>N1}function R1(i){var t=to.fromBackgroundColor(i);return t.backgroundIsDark?t.foregroundOnDark:t.foregroundOnLight}function B1(i){return i?Pr:Sr}function F1(i,t){return to.fromBackgroundColor(t).resolveSubEntityTraitsRgb(i)}exports.AcGiMTextFlowDirection=void 0;(function(i){i[i.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",i[i.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",i[i.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM",i[i.BOTTOM_TO_TOP=4]="BOTTOM_TO_TOP",i[i.BY_STYLE=5]="BY_STYLE"})(exports.AcGiMTextFlowDirection||(exports.AcGiMTextFlowDirection={}));exports.AcGiMTextAttachmentPoint=void 0;(function(i){i[i.TopLeft=1]="TopLeft",i[i.TopCenter=2]="TopCenter",i[i.TopRight=3]="TopRight",i[i.MiddleLeft=4]="MiddleLeft",i[i.MiddleCenter=5]="MiddleCenter",i[i.MiddleRight=6]="MiddleRight",i[i.BottomLeft=7]="BottomLeft",i[i.BottomCenter=8]="BottomCenter",i[i.BottomRight=9]="BottomRight",i[i.BaselineLeft=10]="BaselineLeft",i[i.BaselineCenter=11]="BaselineCenter",i[i.BaselineRight=12]="BaselineRight"})(exports.AcGiMTextAttachmentPoint||(exports.AcGiMTextAttachmentPoint={}));exports.AcGiRenderMode=void 0;(function(i){i[i.OPTIMIZED_2D=0]="OPTIMIZED_2D",i[i.WIREFRAME=1]="WIREFRAME",i[i.HIDDEN_LINE=2]="HIDDEN_LINE",i[i.FLAT_SHADED=3]="FLAT_SHADED",i[i.GOURAUD_SHADED=4]="GOURAUD_SHADED",i[i.FLAT_SHADED_WITH_WIREFRAME=5]="FLAT_SHADED_WITH_WIREFRAME",i[i.GOURAUD_SHADED_WITH_WIREFRAME=6]="GOURAUD_SHADED_WITH_WIREFRAME"})(exports.AcGiRenderMode||(exports.AcGiRenderMode={}));exports.AcGiOrthographicType=void 0;(function(i){i[i.NON_ORTHOGRAPHIC=0]="NON_ORTHOGRAPHIC",i[i.TOP=1]="TOP",i[i.BOTTOM=2]="BOTTOM",i[i.FRONT=3]="FRONT",i[i.BACK=4]="BACK",i[i.LEFT=5]="LEFT",i[i.RIGHT=6]="RIGHT"})(exports.AcGiOrthographicType||(exports.AcGiOrthographicType={}));exports.AcGiDefaultLightingType=void 0;(function(i){i[i.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",i[i.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS"})(exports.AcGiDefaultLightingType||(exports.AcGiDefaultLightingType={}));var Au=function(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var n=e.call(i),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return s},Su=function(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return i.concat(s||Array.prototype.slice.call(t))},qg=(function(){function i(){this._number=-1,this._id="",this._groupId="",this._centerPoint=new x,this._height=0,this._width=0,this._viewCenter=new x,this._viewTarget=new x,this._viewTwistAngle=0,this._viewHeight=0,this._frozenLayerIds=[],this._frozenLayers=[],this._annotationScaleName="",this._annotationScaleFactor=0}return Object.defineProperty(i.prototype,"number",{get:function(){return this._number},set:function(t){this._number=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupId",{get:function(){return this._groupId},set:function(t){this._groupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"frozenLayerIds",{get:function(){return this._frozenLayerIds},set:function(t){this._frozenLayerIds=Su([],Au(t),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"frozenLayers",{get:function(){return this._frozenLayers},set:function(t){this._frozenLayers=Su([],Au(t),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"annotationScaleName",{get:function(){return this._annotationScaleName},set:function(t){this._annotationScaleName=t??""},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"annotationScaleFactor",{get:function(){return this._annotationScaleFactor},set:function(t){this._annotationScaleFactor=t>0?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"centerPoint",{get:function(){return this._centerPoint},set:function(t){this._centerPoint.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"box",{get:function(){var t=new Ct;return t.setFromCenterAndSize(this.centerPoint,{x:this.width,y:this.height}),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewCenter",{get:function(){return this._viewCenter},set:function(t){this._viewCenter.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewTarget",{get:function(){return this._viewTarget},set:function(t){this._viewTarget.copy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewTwistAngle",{get:function(){return this._viewTwistAngle},set:function(t){this._viewTwistAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewHeight",{get:function(){return this._viewHeight},set:function(t){this._viewHeight=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewWidth",{get:function(){return this.viewHeight*(this.width/this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewBox",{get:function(){var t=i.dcsCenterToWcs(this.viewCenter,this.viewTarget,this.viewTwistAngle),e=new Ct;return e.setFromCenterAndSize(t,{x:this.viewWidth,y:this.viewHeight}),e},enumerable:!1,configurable:!0}),i.dcsCenterToWcs=function(t,e,n){var r=t.x,s=t.y;if(Number.isFinite(n)&&n!==0){var a=Math.cos(n),o=Math.sin(n);r=t.x*a-t.y*o,s=t.x*o+t.y*a}return e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&(r+=e.x,s+=e.y),new x(r,s,0)},i.prototype.clone=function(){var t=new i;return t.id=this.id,t.groupId=this.groupId,t.number=this.number,t.centerPoint.copy(this.centerPoint),t.height=this.height,t.width=this.width,t.viewCenter.copy(this.viewCenter),t.viewTarget.copy(this.viewTarget),t.viewTwistAngle=this.viewTwistAngle,t.viewHeight=this.viewHeight,t.frozenLayerIds=this.frozenLayerIds,t.frozenLayers=this.frozenLayers,t.annotationScaleName=this.annotationScaleName,t.annotationScaleFactor=this.annotationScaleFactor,t},i.prototype.copy=function(t){return this.id=t.id,this.groupId=t.groupId,this.number=t.number,this.centerPoint.copy(t.centerPoint),this.height=t.height,this.width=t.width,this.viewCenter.copy(t.viewCenter),this.viewTarget.copy(t.viewTarget),this.viewTwistAngle=t.viewTwistAngle,this.viewHeight=t.viewHeight,this.frozenLayerIds=t.frozenLayerIds,this.frozenLayers=t.frozenLayers,this.annotationScaleName=t.annotationScaleName,this.annotationScaleFactor=t.annotationScaleFactor,this},i})();const wn="Continuous",ft="Standard",Qe="Standard",Je="Standard",z1="ANSI31",Kg="ANGLE",xi="SOLID";function cr(i){return i==null?!1:i.trim().toUpperCase().replace(/^_+/,"")===xi}const Zg="USER",Qg="LINEAR",kt="ByLayer",Ne="ByBlock",Mi="*Active",xc="mlightcad",wc="ACAD",X1=Object.freeze({x:0,y:0}),Y1=Object.freeze({x:0,y:0}),j1=Object.freeze({x:1,y:1}),V1=Object.freeze({x:0,y:0,z:1}),U1=Object.freeze({x:0,y:0,z:0}),Jg=150,vc=1,Ac=255,tf=12,Sc=1,Pc=255,H1=0,G1=32767,W1=0,$1=2,ef=5,kc=1,Ic=255,nf=1,rf=2,sf=4,af=8,of=16,cf=32,lf=64,hf=0,uf=0,df=nf|rf|sf|af|of|cf|lf,Us=0,eo=0,no=1,Hs=5,io=1,ro=25,Gs=1,so=0,ao=1,Ws=6,oo=0,co=14;function Ce(i,t,e,n){const r=Math.trunc(t);if(!Number.isFinite(r)||r<e||r>n)throw new Error(`Invalid ${i} value! Valid range is ${e} to ${n}.`);return r}function sr(i,t,e){const n=Math.trunc(i);if(!(!Number.isFinite(n)||n<t||n>e))return n}var Ln=(i=>(i[i.OnBothOperands=0]="OnBothOperands",i[i.ExtendThis=1]="ExtendThis",i[i.ExtendArg=2]="ExtendArg",i[i.ExtendBoth=3]="ExtendBoth",i))(Ln||{});const oh=class oh extends mt{constructor(){super(...arguments),this._colorIsByLayerDefault=!1,this._visibility=!0,this._transparencySet=!1,this._dxfPaperSpace=!1}get type(){return this.constructor.typeName}get layer(){return this._layer==null&&(this._layer=this.database.clayer??"0"),this._layer}set layer(t){this._layer=t}get color(){return this.getEntityColor()}set color(t){this.setEntityColor(t)}get resolvedColor(){return this.resolveStandardColor()}resolveStandardColor(){let t=this.color;if(t.isByLayer){const e=this.getLayerColor();e&&e.RGB!=null&&(t=e)}else t.isByBlock&&(t=new V().setForeground());return t}get lineType(){var t;return this._lineType==null&&(this._lineType=((t=this.database)==null?void 0:t.celtype)??kt),this._lineType}set lineType(t){t?t.toUpperCase()==="BYLAYER"?this._lineType=kt:t.toUpperCase()==="BYBLOCK"?this._lineType=Ne:this._lineType=t:this._lineType=kt}get lineWeight(){return this._lineWeight==null&&(this._lineWeight=this.database.celweight??exports.AcGiLineWeight.ByLayer),this._lineWeight}set lineWeight(t){this._lineWeight=t}get linetypeScale(){return this._linetypeScale==null&&(this._linetypeScale=this.database.celtscale??-1),this._linetypeScale}set linetypeScale(t){this._linetypeScale=t}get visibility(){return this._visibility}set visibility(t){this._visibility=t}get transparency(){return this._transparency??(this._transparency=new St)}set transparency(t){this._transparency=t.clone(),this._transparencySet=!0}hasExplicitLayer(){return this._layer!=null}hasExplicitColor(){return this._color!=null||this._colorIsByLayerDefault}getEntityColor(){return this._color==null&&(this._colorIsByLayerDefault?this._color=new V().setByLayer():(this._color=new V,this.database.cecolor&&this._color.copy(this.database.cecolor))),this._color}setEntityColor(t){this._colorIsByLayerDefault=!1,this._color==null&&(this._color=new V),this._color.copy(t)}shouldResolveColorFromCecolor(){return!this._colorIsByLayerDefault}applyDxfFileDefaults(){this._color==null&&(this._colorIsByLayerDefault=!0)}hasExplicitTransparency(){return this._transparencySet}dxfOutFields(t){t.writeSubclassMarker("AcDbEntity"),t.writeString(8,this.layer),t.writeString(6,this.lineType),t.writeDouble(48,this.linetypeScale),t.writeInt16(60,this.visibility?0:1),t.writeCmColor(this.color),t.writeLineWeight(370,this.lineWeight),t.writeTransparency(this.transparency);const e=this.database.tables.blockTable.getIdAt(this.ownerId);return e!=null&&e.isPaperSapce&&t.writeInt16(67,1),this}dxfInFields(t){super.dxfInFields(t);const e=t.atSubclassData("AcDbEntity");if(!e){const r=t.peekItem();if(r&&Number(r.code)===100)return this}let n;for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const r=t.readItem();if(!r)break;const s=Number(r.code);if(s===100){t.pushBackItem(r);break}switch(s){case 8:this.layer=String(r.value);break;case 6:this.lineType=String(r.value);break;case 48:this.linetypeScale=Number(r.value);break;case 60:this.visibility=Number(r.value)===0;break;case 62:n==null&&(n=new V),n.colorIndex=Number(r.value);break;case 420:n==null&&(n=new V),n.setRGBValue(Number(r.value));break;case 370:this.lineWeight=Number(r.value);break;case 440:this.transparency=St.deserialize(Number(r.value));break;case 67:this._dxfPaperSpace=Number(r.value)!==0;break;case 410:break;case 92:case 160:case 310:break;case 284:case 347:case 380:case 390:case 430:break;default:if(!e)return t.pushBackItem(r),n!=null&&(this.color=n),this.applyDxfFileDefaults(),this;break}}return n!=null&&(this.color=n),this.applyDxfFileDefaults(),this}get dxfPaperSpace(){return this._dxfPaperSpace}resolveEffectiveProperties(){this._layer==null&&(this._layer=this.database.clayer??"0"),this._color==null&&this.shouldResolveColorFromCecolor()&&(this._color=new V,this.database.cecolor&&this._color.copy(this.database.cecolor)),this._lineType==null&&(this._lineType=this.database.celtype??kt),this._linetypeScale==null&&(this._linetypeScale=this.database.celtscale??-1),this._lineWeight==null&&(this._lineWeight=this.database.celweight??exports.AcGiLineWeight.ByLayer)}get properties(){return{type:this.type,groups:[this.getGeneralProperties()]}}subGetGripPoints(){return new Array}subMoveGripPointsAt(t,e){return this}subGetOsnapPoints(t,e,n,r,s,a){}intersectWith(t,e=Ln.OnBothOperands,n){const r=this.subGetIntersectCurves(),s=t.subGetIntersectCurves();if(r.length===0||s.length===0)return[];const a=e===Ln.ExtendThis||e===Ln.ExtendBoth,o=e===Ln.ExtendArg||e===Ln.ExtendBoth;return Fb(r,s,a,o,n)}subGetIntersectCurves(){return[]}transformBy(t){return this}erase(){return this.database.tables.blockTable.removeEntity(this.objectId)}get directBatchPrimitive(){return null}worldDraw(t,e){if(!this.database.isLayerDrawable(this.layer))return;const n=t.subEntityTraits;n.isColorByLayer=this.color.isByLayer,n.color=this.resolvedColor,n.lineType=this.lineStyle,n.lineTypeScale=this.linetypeScale,n.lineWeight=this.lineWeight,n.transparency=this.transparency,n.layer=this.layer,n.drawOrder=0,n.isBackgroundFill=!1,"thickness"in this&&(n.thickness=this.thickness),t.context.database=this.database;const r=this.subWorldDraw(t,e);return this.attachEntityInfo(r),r}getGeneralProperties(){return{groupName:"general",properties:[{name:"handle",type:"int",editable:!1,accessor:{get:()=>this.objectId}},{name:"color",type:"color",editable:!0,accessor:{get:()=>this.color,set:t=>{this.color=t}}},{name:"layer",type:"string",editable:!0,accessor:{get:()=>this.layer,set:t=>{this.layer=t}}},{name:"linetype",type:"linetype",editable:!0,accessor:{get:()=>this.lineType,set:t=>{this.lineType=t}}},{name:"linetypeScale",type:"float",editable:!0,accessor:{get:()=>this.linetypeScale,set:t=>{this.linetypeScale=t}}},{name:"lineWeight",type:"lineweight",editable:!0,accessor:{get:()=>this.lineWeight,set:t=>{this.lineWeight=t}}},{name:"transparency",type:"transparency",editable:!0,accessor:{get:()=>this.transparency,set:t=>{this.transparency=t}}}]}}get lineStyle(){var r;const{type:t,name:e}=this.getLineType(),n=(r=this.database)==null?void 0:r.tables.linetypeTable.getAt(e);return n?{type:t,...n.linetype}:{type:t,name:e,standardFlag:0,description:"",totalPatternLength:0}}getLineType(){if(this.lineType==kt){const t=this.database.tables.layerTable.getAt(this.layer);if(t&&t.linetype)return{type:"ByLayer",name:t.linetype}}else return this.lineType==Ne?{type:"ByBlock",name:wn}:{type:"UserSpecified",name:this.lineType};return{type:"UserSpecified",name:wn}}getLayerColor(){const t=this.database.tables.layerTable.getAt(this.layer);return t!=null?t.color:null}attachEntityInfo(t){t&&(t.objectId=this.objectId,this.attrs.has("ownerId")&&(t.ownerId=this.ownerId),t.layerName=this.layer,t.visible=this.visibility)}};oh.typeName="Entity";let st=oh;class gf extends mt{constructor(){super(...arguments),this._classVersion=4,this._isDefault=!1}get classVersion(){return this._classVersion}set classVersion(t){this._classVersion=t}get isDefault(){return this._isDefault}set isDefault(t){this._isDefault=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbObjectContextData"),t.writeInt16(70,this._classVersion),t.writeBoolean(290,this._isDefault),this}dxfInObjectContextData(t){for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===100)return String(e.value);switch(n){case 70:this._classVersion=Number(e.value);break;case 290:this._isDefault=!!Number(e.value);break}}}}class ve extends gf{constructor(){super(...arguments),this._scaleId=""}get scaleId(){return this._scaleId}set scaleId(t){this._scaleId=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbAnnotScaleObjectContextData"),t.writeObjectId(340,this._scaleId),this}}class kr extends ve{constructor(){super(...arguments),this._position=new x,this._rotation=0,this._scaleX=1,this._scaleY=1,this._scaleZ=1}get position(){return this._position}set position(t){this._position.copy(t)}get rotation(){return this._rotation}set rotation(t){this._rotation=t}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}set scaleZ(t){this._scaleZ=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbBlkRefObjectContextData"),t.writePoint3d(10,this._position),t.writeDouble(50,this._rotation),t.writeDouble(41,this._scaleX),t.writeDouble(42,this._scaleY),t.writeDouble(43,this._scaleZ),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbBlkRefObjectContextData"){e="blk";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}if(e==="blk")switch(r){case 10:this._position.x=Number(n.value);break;case 20:this._position.y=Number(n.value);break;case 30:this._position.z=Number(n.value);break;case 50:this._rotation=Number(n.value);break;case 41:this._scaleX=Number(n.value);break;case 42:this._scaleY=Number(n.value);break;case 43:this._scaleZ=Number(n.value);break}}return this}}class Ci{constructor(t){this.i=0,t instanceof Map?(this._records=t,this._array=null,this._keys=Array.from(t.keys())):(this._records=null,this._array=t,this._keys=[])}get count(){var t;return((t=this._records)==null?void 0:t.size)??this._array.length}toArray(){return this._records?Array.from(this._records.values()):[...this._array]}[Symbol.iterator](){return this}next(){if(this._array){if(this.i<this._array.length){const t=this._array[this.i];return this.i+=1,{value:t,done:!1}}return{value:null,done:!0}}for(;this.i<this._keys.length;){const t=this._records.get(this._keys[this.i]);return this.i+=1,{value:t,done:!1}}return{value:null,done:!0}}}class K extends mt{constructor(t){super(),this.database=t,this.objectId=t.generateHandle(),this._recordsByName=new Map}get numEntries(){return this._recordsByName.size}setAt(t,e){const n=this.database.transactionManager;if(n.strictMode&&!n.isRecording()&&!n.isApplyingUndoRedo())throw new Error("Cannot modify dictionary entries outside an active transaction.");const r=this.getAt(t);r&&(n.isRecording()&&n.recordRemove({type:"dictionary",dictionaryId:this.objectId,key:t},r),this.database.releaseObjectHandle(r)),e.database=this.database,this.database.commitObjectHandle(e,s=>this.hasId(s)),e.ownerId=this.objectId,this._recordsByName.set(t,e),n.isRecording()&&n.recordAppend({type:"dictionary",dictionaryId:this.objectId,key:t},e),!n.isRecording()&&!n.isApplyingUndoRedo()&&this.database.notifyDictObjectSet(e,t)}remove(t){const e=this.getAt(t);return e?(this.removeStoredObject(e,t),!0):!1}removeId(t){const e=this.getIdAt(t);if(e){let n="";return this._recordsByName.forEach((r,s)=>{r===e&&(n=s)}),this.removeStoredObject(e,n),!0}return!1}removeStoredObject(t,e){const n=this.database.transactionManager;if(n.strictMode&&!n.isRecording()&&!n.isApplyingUndoRedo())throw new Error("Cannot remove dictionary entries outside an active transaction.");n.isRecording()&&n.recordRemove({type:"dictionary",dictionaryId:this.objectId,key:e},t),this._recordsByName.forEach((r,s)=>{r===t&&this._recordsByName.delete(s)}),this.database.releaseObjectHandle(t),e&&!n.isRecording()&&!n.isApplyingUndoRedo()&&this.database.notifyDictObjectErased(t,e)}removeAll(){this._recordsByName.forEach((t,e)=>{this.database.releaseObjectHandle(t),this.database.events.dictObjectErased.dispatch({database:this.database,object:t,key:e})}),this._recordsByName.clear()}has(t){return this._recordsByName.has(t.toUpperCase())}hasId(t){return this.getIdAt(t)!==void 0}getAt(t){return this._recordsByName.get(t)}getIdAt(t){const e=this.database.getObjectById(t);if(!(!e||e.getAttrWithoutException("ownerId")!==this.objectId))return e}newIterator(){return new Ci(this._recordsByName)}entries(){return this._recordsByName.entries()}dxfOutFields(t){super.dxfOutFields(t),t.writeSubclassMarker("AcDbDictionary"),t.writeInt16(280,1),t.writeInt16(281,1);for(const[e,n]of this._recordsByName)t.writeString(3,e),t.writeObjectId(350,n.objectId);return this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbDictionary");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;if(Number(e.code)===100){t.pushBackItem(e);break}}return this}}class Ir extends ve{constructor(){super(...arguments),this._blockName="",this._definitionPoint=new x,this._dimLinePoint=new x,this._hasDimLinePoint=!1,this._b293=!1,this._b294=!1,this._bd140=0,this._b298=!1,this._b291=!1,this._flag=0,this._b292=!1,this._bs71=0,this._b280=0,this._b295=!1,this._b296=!1,this._b297=!1}get blockName(){return this._blockName}set blockName(t){this._blockName=t}get definitionPoint(){return this._definitionPoint}set definitionPoint(t){this._definitionPoint.copy(t)}get dimLinePoint(){return this._dimLinePoint}set dimLinePoint(t){this._dimLinePoint.copy(t),this._hasDimLinePoint=!0}get hasDimLinePoint(){return this._hasDimLinePoint}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbDimensionObjectContextData"),t.writeString(2,this._blockName),t.writeBoolean(293,this._b293),t.writePoint3d(10,this._definitionPoint),t.writeBoolean(294,this._b294),t.writeDouble(140,this._bd140),t.writeBoolean(298,this._b298),t.writeBoolean(291,this._b291),t.writeInt16(70,this._flag),t.writeBoolean(292,this._b292),t.writeInt16(71,this._bs71),t.writeInt16(280,this._b280),t.writeBoolean(295,this._b295),t.writeBoolean(296,this._b296),t.writeBoolean(297,this._b297),this._hasDimLinePoint&&t.writePoint3d(11,this._dimLinePoint),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbDimensionObjectContextData"){e="dim";continue}if(s.includes("DimensionObjectContextData")){e="typed";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"){r===340&&(this.scaleId=String(n.value));continue}switch(r){case 2:this._blockName=String(n.value);break;case 10:this._definitionPoint.x=Number(n.value);break;case 20:this._definitionPoint.y=Number(n.value);break;case 30:this._definitionPoint.z=Number(n.value);break;case 11:this._dimLinePoint.x=Number(n.value),this._hasDimLinePoint=!0;break;case 21:this._dimLinePoint.y=Number(n.value),this._hasDimLinePoint=!0;break;case 31:this._dimLinePoint.z=Number(n.value),this._hasDimLinePoint=!0;break;case 293:this._b293=!!Number(n.value);break;case 294:this._b294=!!Number(n.value);break;case 140:this._bd140=Number(n.value);break;case 298:this._b298=!!Number(n.value);break;case 291:this._b291=!!Number(n.value);break;case 70:this._flag=Number(n.value);break;case 292:this._b292=!!Number(n.value);break;case 71:this._bs71=Number(n.value);break;case 280:this._b280=Number(n.value);break;case 295:this._b295=!!Number(n.value);break;case 296:this._b296=!!Number(n.value);break;case 297:this._b297=!!Number(n.value);break}}return this}}class Er extends ve{constructor(){super(...arguments),this._patternScale=1}get patternScale(){return this._patternScale}set patternScale(t){this._patternScale=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbHatchScaleContextData"),t.writeDouble(40,this._patternScale),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbHatchScaleContextData"){e="hatch";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}e==="hatch"&&r===40&&(this._patternScale=Number(n.value))}return this}}class Tl extends ve{dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbLeaderObjectContextData"),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbLeaderObjectContextData"){e="leader";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}e==="annot"&&r===340&&(this.scaleId=String(n.value))}return this}}class Tr extends ve{constructor(){super(...arguments),this._contentScale=1,this._textHeight=0,this._arrowheadSize=0,this._textAnchor=new x,this._hasTextAnchor=!1}get contentScale(){return this._contentScale}set contentScale(t){this._contentScale=t>0?t:1}get textHeight(){return this._textHeight}set textHeight(t){this._textHeight=t}get arrowheadSize(){return this._arrowheadSize}set arrowheadSize(t){this._arrowheadSize=t}get textAnchor(){return this._textAnchor}set textAnchor(t){this._textAnchor.copy(t),this._hasTextAnchor=!0}get hasTextAnchor(){return this._hasTextAnchor}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbMLeaderObjectContextData"),t.writeDouble(40,this._contentScale),this._textHeight>0&&t.writeDouble(41,this._textHeight),this._arrowheadSize>0&&t.writeDouble(140,this._arrowheadSize),this._hasTextAnchor&&t.writePoint3d(12,this._textAnchor),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbMLeaderObjectContextData"){e="mleader";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"&&r===340){this.scaleId=String(n.value);continue}switch(r){case 40:this._contentScale=Number(n.value)>0?Number(n.value):1;break;case 41:case 44:Number(n.value)>0&&(this._textHeight=Number(n.value));break;case 140:Number(n.value)>0&&(this._arrowheadSize=Number(n.value));break;case 12:this._textAnchor.x=Number(n.value),this._hasTextAnchor=!0;break;case 22:this._textAnchor.y=Number(n.value),this._hasTextAnchor=!0;break;case 32:this._textAnchor.z=Number(n.value),this._hasTextAnchor=!0;break}}return this}}class sn extends ve{constructor(){super(...arguments),this._attachmentPoint=1,this._direction=new A(1,0,0),this._insertionPoint=new x,this._definedWidth=0,this._definedHeight=0,this._extentsWidth=0,this._extentsHeight=0,this._columnType=0}get attachmentPoint(){return this._attachmentPoint}set attachmentPoint(t){this._attachmentPoint=t}get direction(){return this._direction}set direction(t){this._direction.copy(t)}get insertionPoint(){return this._insertionPoint}set insertionPoint(t){this._insertionPoint.copy(t)}get definedWidth(){return this._definedWidth}set definedWidth(t){this._definedWidth=t}get definedHeight(){return this._definedHeight}set definedHeight(t){this._definedHeight=t}get extentsWidth(){return this._extentsWidth}set extentsWidth(t){this._extentsWidth=t}get extentsHeight(){return this._extentsHeight}set extentsHeight(t){this._extentsHeight=t}get columnType(){return this._columnType}set columnType(t){this._columnType=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeInt16(70,this._attachmentPoint),t.writeVector3d(10,this._direction),t.writePoint3d(11,this._insertionPoint),t.writeDouble(40,this._definedWidth),t.writeDouble(41,this._definedHeight),t.writeDouble(42,this._extentsWidth),t.writeDouble(43,this._extentsHeight),t.writeInt16(71,this._columnType),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbMTextObjectContextData"||s==="AcDbMTextAttributeObjectContextData"){e="mtext";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}switch(r){case 340:this.scaleId=String(n.value);break;case 70:this._attachmentPoint=Number(n.value);break;case 10:this._direction.x=Number(n.value);break;case 20:this._direction.y=Number(n.value);break;case 30:this._direction.z=Number(n.value);break;case 11:this._insertionPoint.x=Number(n.value);break;case 21:this._insertionPoint.y=Number(n.value);break;case 31:this._insertionPoint.z=Number(n.value);break;case 40:this._definedWidth=Number(n.value);break;case 41:this._definedHeight=Number(n.value);break;case 42:this._extentsWidth=Number(n.value);break;case 43:this._extentsHeight=Number(n.value);break;case 71:this._columnType=Number(n.value);break}}return this}}class $s extends sn{dxfOutFields(t){return super.dxfOutFields(t),this}dxfInFields(t){return super.dxfInFields(t)}}class Yn extends mt{constructor(){super(...arguments),this._classVersion=0,this._scaleName="",this._paperUnits=1,this._drawingUnits=1,this._isUnitScale=!1}get classVersion(){return this._classVersion}set classVersion(t){this._classVersion=t}get scaleName(){return this._scaleName}set scaleName(t){this._scaleName=t}get paperUnits(){return this._paperUnits}set paperUnits(t){this._paperUnits=t>0?t:1}get drawingUnits(){return this._drawingUnits}set drawingUnits(t){this._drawingUnits=t>0?t:1}get isUnitScale(){return this._isUnitScale}set isUnitScale(t){this._isUnitScale=t}get scaleFactor(){return this._drawingUnits/this._paperUnits}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbScale"),t.writeInt16(70,this._classVersion),t.writeString(300,this._scaleName),t.writeDouble(140,this._paperUnits),t.writeDouble(141,this._drawingUnits),t.writeBoolean(290,this._isUnitScale),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbScale");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code);if(n===100){t.pushBackItem(e);break}switch(n){case 70:this._classVersion=Number(e.value);break;case 300:this._scaleName=String(e.value);break;case 140:this.paperUnits=Number(e.value);break;case 141:this.drawingUnits=Number(e.value);break;case 290:this._isUnitScale=!!Number(e.value);break}}return this}}class Wr extends ve{constructor(){super(...arguments),this._horizontalMode=0,this._rotation=0,this._alignmentPoint=new x,this._position=new x}get horizontalMode(){return this._horizontalMode}set horizontalMode(t){this._horizontalMode=t}get rotation(){return this._rotation}set rotation(t){this._rotation=t}get alignmentPoint(){return this._alignmentPoint}set alignmentPoint(t){this._alignmentPoint.copy(t)}get position(){return this._position}set position(t){this._position.copy(t)}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbTextObjectContextData"),t.writeInt16(70,this._horizontalMode),t.writeDouble(50,this._rotation),t.writePoint3d(10,this._alignmentPoint),t.writePoint3d(11,this._position),this}dxfInFields(t){super.dxfInFields(t);let e="object";for(t.atSubclassData("AcDbObjectContextData");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){const s=String(n.value);if(s==="AcDbAnnotScaleObjectContextData"){e="annot";continue}if(s==="AcDbTextObjectContextData"){e="text";continue}t.pushBackItem(n);break}if(e==="object"){switch(r){case 70:this.classVersion=Number(n.value);break;case 290:this.isDefault=!!Number(n.value);break}continue}if(e==="annot"){r===340&&(this.scaleId=String(n.value));continue}switch(r){case 70:this._horizontalMode=Number(n.value);break;case 50:this._rotation=Number(n.value);break;case 10:this._alignmentPoint.x=Number(n.value);break;case 20:this._alignmentPoint.y=Number(n.value);break;case 30:this._alignmentPoint.z=Number(n.value);break;case 11:this._position.x=Number(n.value);break;case 21:this._position.y=Number(n.value);break;case 31:this._position.z=Number(n.value);break}}return this}}var ff=(i=>(i[i.NotApplicable=0]="NotApplicable",i[i.Ignore=1]="Ignore",i[i.Replace=2]="Replace",i[i.XrefMangleName=3]="XrefMangleName",i[i.MangleName=4]="MangleName",i))(ff||{});class lo extends mt{constructor(){super(...arguments),this._data=null}get data(){return this._data}set data(t){this._data=t}clear(){var t;(t=this._data)==null||t.clear()}clone(){return super.clone()}getDuplicateRecordCloning(){return this._cloningFlag??0}setDuplicateRecordCloning(t){this._cloningFlag=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbXrecord"),t.writeInt16(280,this._cloningFlag??1),t.writeResultBuffer(this.data),this}dxfInFields(t){super.dxfInFields(t),t.atSubclassData("AcDbXrecord");const e=new ze;for(;!t.atEndOfObject&&!t.atEof;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===1001||r>=1e3&&r<=1071){t.pushBackItem(n);break}if(r===100){t.pushBackItem(n);break}switch(r){case 280:this._cloningFlag=Number(n.value);break;default:e.add({code:n.code,value:n.value});break}}return this._data=e.length>0?e:null,this}}const Pn=i=>i?i.trim().toUpperCase():"",pf="ASDK_XREC_ANNOTATION_SCALE_INFO",Lr="AcadAnnotative";function fe(i){const t=i.getXData(Lr);if(!t)return!1;const e=t.toArray();for(const n of e)if(Number(n.code)===1070&&Number(n.value)===1)return!0;return!1}function Ae(i){return fe(i)||Wt(i).length>0}function pe(i,t){if(!t){i.removeXData(Lr),Q1(i);return}if(fe(i))return;const e=new ze([{code:Z.ExtendedDataRegAppName,value:Lr},{code:Z.ExtendedDataAsciiString,value:"AnnotativeData"},{code:Z.ExtendedDataControlString,value:"{"},{code:Z.ExtendedDataInteger16,value:1},{code:Z.ExtendedDataInteger16,value:1},{code:Z.ExtendedDataControlString,value:"}"}]);i.setXData(e)}function Oi(i,t){if(!t)return;const e=Pn(t),n=i.getObjectById(e);if(n instanceof Yn)return n;const r=i.objects.scale,s=r.getAt(t);if(s instanceof Yn)return s;for(const[,a]of r.entries())if(a.scaleName===t)return a}function Wt(i){const t=i.extensionDictionary;if(!t)return[];let e;try{e=i.database}catch{return[]}if(!e)return[];const n=e.getObjectById(Pn(t));if(!(n instanceof K))return[];const r=n.getAt("AcDbContextDataManager");if(!(r instanceof K))return[];const s=r.getAt("ACDB_ANNOTATIONSCALES");if(!(s instanceof K))return[];const a=[];for(const[,o]of s.entries()){let c,l,h=!1;o instanceof ve?(c=o,l=o.scaleId,h=o.isDefault):l=o.objectId;const u=l?Oi(e,l):void 0;u&&a.push({scale:u,contextData:c,isDefault:h})}return a}function De(i,t){if(!(i>0)||t.length===0)return i;const n=(t.find(r=>r.isDefault)??t[0]).scale.scaleFactor;return n>0?i/n:i}function Re(i,t){return i>0?i*(t>0?t:1):i}function Ve(i,t,e){if(i.length!==0){if(t){const n=i.find(r=>r.scale.scaleName===t);if(n)return n}if(e!=null&&e>0){const n=i.find(r=>Math.abs(r.scale.scaleFactor-e)<1e-9);if(n)return n}return i.find(n=>n.isDefault)??i[0]}}function mf(i){var a;const t=i.extensionDictionary;if(!t)return;let e;try{e=i.database}catch{return}if(!e)return;const n=e.getObjectById(Pn(t));if(!(n instanceof K))return;const r=n.getAt(pf);if(!r)return;let s;if(r instanceof lo){const o=((a=r.data)==null?void 0:a.toArray())??[];for(const c of o)if(Number(c.code)===340){s=String(c.value);break}}else if(r instanceof Yn)return r;return Oi(e,s)}function Ue(i,t){return{drawnScaleFactor:t.scale.scaleFactor,drawnScaleName:t.scale.scaleName,supportedScaleFactors:i.map(e=>e.scale.scaleFactor),supportedScaleNames:i.map(e=>e.scale.scaleName)}}const q1=[{name:"1:1",drawingUnits:1},{name:"1:2",drawingUnits:2},{name:"1:5",drawingUnits:5},{name:"1:10",drawingUnits:10},{name:"1:20",drawingUnits:20},{name:"1:50",drawingUnits:50},{name:"1:100",drawingUnits:100},{name:"1:200",drawingUnits:200},{name:"1:500",drawingUnits:500},{name:"1:1000",drawingUnits:1e3}];function yf(i){const t=[];for(const[,e]of i.objects.scale.entries())e instanceof Yn&&t.push(e);return t.sort((e,n)=>e.scaleFactor-n.scaleFactor)}function K1(i){for(const t of q1)Ll(i,t.name,t.drawingUnits);return yf(i)}function Ll(i,t,e){const n=Oi(i,t);if(n)return n;const r=new Yn;r.database=i,r.scaleName=t,r.paperUnits=1;let s=e;if(!(s!=null&&s>0)){const a=/^1\s*:\s*(\d+(?:\.\d+)?)$/i.exec(t.trim());s=a?Number(a[1]):1}return r.drawingUnits=s>0?s:1,i.objects.scale.setAt(t,r),r}function Ml(i){try{return i.database}catch{return}}function bf(i,t){const e=t.extensionDictionary;if(!e)return;const n=i.getObjectById(Pn(e));if(!(n instanceof K))return;const r=n.getAt("AcDbContextDataManager");if(!(r instanceof K))return;const s=r.getAt("ACDB_ANNOTATIONSCALES");return s instanceof K?s:void 0}function Z1(i,t){let e=t.extensionDictionary;if(e||(e=i.createExtensionDictionaryFor(t)),!e)throw new Error("Failed to create extension dictionary for object");const n=i.getObjectById(Pn(e));if(!(n instanceof K))throw new Error("Extension dictionary is not an AcDbDictionary");let r=n.getAt("AcDbContextDataManager");r instanceof K||(r=new K(i),r.database=i,n.setAt("AcDbContextDataManager",r));let s=r.getAt("ACDB_ANNOTATIONSCALES");return s instanceof K||(s=new K(i),s.database=i,r.setAt("ACDB_ANNOTATIONSCALES",s)),s}function _f(i,t){const e=Pn(t.objectId);if(e){if(i.objects.objectContextData.getIdAt(e)){i.objects.objectContextData.removeId(e);return}for(const[n,r]of[...i.objects.objectContextData.entries()])(r===t||Pn(r.objectId)===e)&&i.objects.objectContextData.remove(n)}}function Q1(i){const t=Ml(i);if(!t)return;const e=bf(t,i);if(e)for(const[n,r]of[...e.entries()])e.remove(n),_f(t,r)}function J1(i){var n;const t=Wt(i);if(t.length===0||t.some(r=>r.isDefault))return;const e=(n=t[0])==null?void 0:n.contextData;e&&(e.isDefault=!0)}function t_(i){const t=i;return typeof t.type=="string"?t.type:""}function e_(i,t,e){if(e instanceof Wr){i.horizontalMode=e.horizontalMode,i.rotation=e.rotation,i.alignmentPoint=e.alignmentPoint,i.position=e.position;return}const n=t;n.horizontalMode!=null&&(i.horizontalMode=n.horizontalMode),n.rotation!=null&&(i.rotation=n.rotation),n.alignmentPoint&&(i.alignmentPoint=n.alignmentPoint),n.position&&(i.position=n.position)}function Pu(i,t,e){if(e instanceof sn){i.attachmentPoint=e.attachmentPoint,i.direction=e.direction,i.insertionPoint=e.insertionPoint,i.definedWidth=e.definedWidth,i.definedHeight=e.definedHeight,i.extentsWidth=e.extentsWidth,i.extentsHeight=e.extentsHeight,i.columnType=e.columnType;return}const n=t;n.attachmentPoint!=null&&(i.attachmentPoint=n.attachmentPoint),n.direction&&(i.direction=n.direction),n.location&&(i.insertionPoint=n.location),n.width!=null&&(i.definedWidth=n.width),n.height!=null&&(i.definedHeight=n.height),n.extentsWidth!=null&&(i.extentsWidth=n.extentsWidth),n.extentsHeight!=null&&(i.extentsHeight=n.extentsHeight),n.columnType!=null&&(i.columnType=n.columnType)}function n_(i,t,e){var a,o,c,l,h,u;const n=t_(i),r=((a=t.find(d=>d.isDefault))==null?void 0:a.contextData)??((o=t[0])==null?void 0:o.contextData),s=!!i.mtext;if(n==="Attrib"&&(s||r instanceof $s)){const d=new $s;return Pu(d,i.mtext??i,r),d}if(n==="MText"){const d=new sn;return Pu(d,i,r),d}if(n==="Text"||n==="Attrib"||n==="AttDef"){const d=new Wr;return e_(d,i,r),d}if(n.includes("Dimension")){const d=new Ir;if(r instanceof Ir)d.blockName=r.blockName,d.definitionPoint=r.definitionPoint,r.hasDimLinePoint&&(d.dimLinePoint=r.dimLinePoint);else{const g=i;g.dimBlockId&&(d.blockName=g.dimBlockId),g.dimBlockPosition&&(d.definitionPoint=g.dimBlockPosition)}return d}if(n==="Hatch"){const d=new Er;if(r instanceof Er)d.patternScale=r.patternScale;else{const g=i,f=g.patternScale!=null&&g.patternScale>0?g.patternScale:1,p=((c=t.find(y=>y.isDefault))==null?void 0:c.scale.scaleFactor)??((l=t[0])==null?void 0:l.scale.scaleFactor)??1,m=p>0?f/p:f;d.patternScale=m*(e>0?e:1)}return d}if(n==="BlockReference"){const d=new kr;if(r instanceof kr)d.position=r.position,d.rotation=r.rotation,d.scaleX=r.scaleX,d.scaleY=r.scaleY,d.scaleZ=r.scaleZ;else{const g=i;g.position&&(d.position=g.position),g.rotation!=null&&(d.rotation=g.rotation),g.scaleFactors&&(d.scaleX=g.scaleFactors.x,d.scaleY=g.scaleFactors.y,d.scaleZ=g.scaleFactors.z)}return d}if(n==="MLeader"){const d=new Tr;if(r instanceof Tr)d.contentScale=r.contentScale,d.textHeight=r.textHeight,d.arrowheadSize=r.arrowheadSize,r.hasTextAnchor&&(d.textAnchor=r.textAnchor);else{const g=i,f=((h=t.find(y=>y.isDefault))==null?void 0:h.scale.scaleFactor)??((u=t[0])==null?void 0:u.scale.scaleFactor)??1,p=g.textHeight!=null&&f>0?g.textHeight/f:g.textHeight,m=g.arrowheadSize!=null&&f>0?g.arrowheadSize/f:g.arrowheadSize;p!=null&&(d.textHeight=p*(e>0?e:1)),m!=null&&(d.arrowheadSize=m*(e>0?e:1)),d.contentScale=e>0?e:1}return d}return n==="Leader"?new Tl:new ve}function i_(i,t){const e=Ml(i);if(!e)return!1;const n=Ll(e,t),r=Wt(i);if(r.some(c=>c.scale.objectId===n.objectId))return!1;const s=Z1(e,i),a=n_(i,r,n.scaleFactor);a.database=e,a.scaleId=n.objectId,a.isDefault=r.length===0;const o=n.scaleName||n.objectId;return e.objects.objectContextData.setAt(`${i.objectId}_${o}`,a),s.setAt(o,a),fe(i)||pe(i,!0),!0}function r_(i,t){const e=Ml(i);if(!e)return!1;const n=bf(e,i);if(!n)return!1;let r=!1;for(const[a,o]of[...n.entries()]){let c;o instanceof ve?c=Oi(e,o.scaleId):c=Oi(e,o.objectId),c&&(c.scaleName===t||c.objectId===Pn(t))&&(n.remove(a),_f(e,o),r=!0)}return r?(Wt(i).length===0?i.removeXData(Lr):J1(i),!0):!1}function jn(i){var n;const t=Wt(i);if(t.length===0)return{contexts:t};const e=Ve(t,(n=i.database)==null?void 0:n.cannoscale)??t.find(r=>r.isDefault)??t[0];return{contexts:t,preferred:e,annotationScale:Ue(t,e)}}class bn extends Error{constructor(t="Unexpected end of buffer."){super(t),this.name="AcDbProxyGraphicEndOfBufferError"}}function xf(i){return i instanceof ArrayBuffer?new Uint8Array(i):i}class ie{constructor(t,e=4){this._index=0,this._buffer=xf(t),this._align=e}get index(){return this._index}get hasData(){return this._index<this._buffer.length}alignIndex(t){const e=t%this._align;return e?t+this._align-e:t}readStruct(t){if(!this.hasData)throw new bn;const e=[];let n=0;for(const r of t){const s=new DataView(this._buffer.buffer,this._buffer.byteOffset+this._index+n,r);if(r===8)e.push(s.getFloat64(0,!0));else if(r===4)e.push(s.getUint32(0,!0));else throw new Error(`Unsupported struct size: ${r}`);n+=r}return this._index=this.alignIndex(this._index+n),e}readFloat(){return this.readStruct([8])[0]}readLong(){return this.readStruct([4])[0]}readSignedLong(){if(!this.hasData)throw new bn;const e=new DataView(this._buffer.buffer,this._buffer.byteOffset+this._index,4).getInt32(0,!0);return this._index=this.alignIndex(this._index+4),e}readVertex(){return this.readStruct([8,8,8])}readPaddedString(t="utf-8"){const e=this._buffer;for(let n=this._index;n<e.length;n++)if(e[n]===0){const r=this._index;this._index=this.alignIndex(n+1);const s=e.subarray(r,n);return new TextDecoder(t).decode(s)}throw new bn("Did not detect terminating zero byte.")}readPaddedUnicodeString(){const t=this._buffer;for(let e=this._index;e<t.length;e+=2)if(e+1<t.length&&t[e]===0&&t[e+1]===0){const n=this._index;this._index=this.alignIndex(e+2);const r=t.subarray(n,e);return new TextDecoder("utf-16le").decode(r)}throw new bn("Did not detect terminating zero bytes.")}}class wf{constructor(t,e="AC1015",n="cp1252"){this._bitIndex=0,this._buffer=xf(t),this.dxfversion=e,this.encoding=n}get hasData(){return this._bitIndex>>3<this._buffer.length}readBit(){const t=this._bitIndex;this._bitIndex+=1;const e=t>>3;if(e>=this._buffer.length)throw new bn;return this._buffer[e]&128>>(t&7)?1:0}readBits(t){const e=this._bitIndex,n=e+t;if(n-1>>3>=this._buffer.length)throw new bn;this._bitIndex=n;let r=128>>(e&7),s=e>>3,a=0,o=this._buffer[s];for(;t>0;)a<<=1,o&r&&(a|=1),t-=1,r>>=1,!r&&t&&(r=128,s+=1,o=this._buffer[s]);return a}readUnsignedByte(){return this.readBits(8)}readSignedByte(){const t=this.readBits(8);return t&128?-((~t&255)+1):t}readAlignedBytes(t){const e=this._bitIndex>>3,n=e+t;if(n>this._buffer.length)throw new bn;return this._bitIndex+=t<<3,this._buffer.subarray(e,n)}readUnsignedShort(){if(this._bitIndex&7){const e=this.readBits(8);return(this.readBits(8)<<8)+e}const t=this.readAlignedBytes(2);return t[1]<<8|t[0]}readSignedShort(){const t=this.readUnsignedShort();return t&32768?-((~t&65535)+1):t}readUnsignedLong(){if(this._bitIndex&7){const e=this.readBits(8),n=this.readBits(8),r=this.readBits(8);return(this.readBits(8)<<24)+(r<<16)+(n<<8)+e}const t=this.readAlignedBytes(4);return(t[3]<<24)+(t[2]<<16)+(t[1]<<8)+t[0]}readSignedLong(){const t=this.readUnsignedLong();return t&2147483648?-((~t&4294967295)+1):t}readFloat(){if(this._bitIndex&7){const n=new Uint8Array(8);for(let r=0;r<8;r++)n[r]=this.readBits(8);return new DataView(n.buffer).getFloat64(0,!0)}const t=this.readAlignedBytes(8),e=new Uint8Array(t);return new DataView(e.buffer).getFloat64(0,!0)}readRawDouble(t=1){return t===1?this.readFloat():Array.from({length:t},()=>this.readFloat())}readBitShort(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readSignedShort():n===1?this.readUnsignedByte():n===2?0:256};return t===1?e():Array.from({length:t},()=>e())}readBitLong(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readSignedLong():n===1?this.readUnsignedByte():n===2?0:256};return t===1?e():Array.from({length:t},()=>e())}readBitDouble(t=1){const e=()=>{const n=this.readBits(2);return n===0?this.readFloat():n===1?1:0};return t===1?e():Array.from({length:t},()=>e())}readBitDoubleDefault(t=1,e=0){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,e,!0);const r=()=>{const s=this.readBits(2);if(s===0)return e;if(s===1){const a=new Uint8Array(n);return a[0]=this.readUnsignedByte(),a[1]=this.readUnsignedByte(),a[2]=this.readUnsignedByte(),a[3]=this.readUnsignedByte(),new DataView(a.buffer).getFloat64(0,!0)}if(s===2){const a=new Uint8Array(n);return a[4]=this.readUnsignedByte(),a[5]=this.readUnsignedByte(),a[0]=this.readUnsignedByte(),a[1]=this.readUnsignedByte(),a[2]=this.readUnsignedByte(),a[3]=this.readUnsignedByte(),new DataView(a.buffer).getFloat64(0,!0)}return this.readFloat()};return t===1?r():Array.from({length:t},()=>r())}}function ho(i){return Array.from(i,t=>t.toString(16).padStart(2,"0")).join("").toUpperCase()}function Cl(i){const t=i.reduce((r,s)=>r+Math.floor(s.length/2),0),e=new Uint8Array(t);let n=0;for(const r of i)for(let s=0;s<r.length;s+=2)e[n++]=parseInt(r.slice(s,s+2),16);return e}function $r(i){if(i.length===0)return new Uint8Array;const t=[];for(const s of i)s instanceof Uint8Array?t.push(s):t.push(Cl([String(s)]));const e=t.reduce((s,a)=>s+a.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}class cn extends mt{constructor(t,e){t=t||{},ge(t,{name:""}),super(t,e)}get name(){return this.getAttr("name")}set name(t){this.setAttr("name",t)}setAttr(t,e){this.assertOpenForWrite(),super.setAttr(t,e)}assertOpenForWrite(){if(this.isTemp)return;const t=this.database;if(!t)return;const e=t.transactionManager;if(!e.isApplyingUndoRedo()){if(e.strictMode&&!e.isRecording())throw new Error("Cannot modify symbol table records outside an active transaction.");if(e.isRecording()&&!e.isOpenedForWriteInTransaction(this.objectId))throw new Error(`Symbol table record "${this.name||this.objectId}" is not open for write. Use openObjectForWrite().`)}}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbSymbolTableRecord"),this}}var vf=(i=>(i[i.Any=0]="Any",i[i.Uniform=1]="Uniform",i))(vf||{}),lr=(i=>(i[i.None=0]="None",i[i.Anonymous=1]="Anonymous",i[i.HasNonConstantAttributes=2]="HasNonConstantAttributes",i[i.Xref=4]="Xref",i[i.XrefOverlay=8]="XrefOverlay",i[i.ExternallyDependent=16]="ExternallyDependent",i[i.Resolved=32]="Resolved",i[i.Referenced=64]="Referenced",i))(lr||{});const fn=class fn extends cn{static isModelSapceName(t){return t.toLowerCase()==fn.MODEL_SPACE_NAME.toLowerCase()}static isPaperSapceName(t){return t.toLowerCase().startsWith(fn.PAPER_SPACE_NAME_PREFIX.toLowerCase())}static sanitizeImportedFlags(t){return t&-97}constructor(t,e){t=t||{},ge(t,{origin:new x,layoutId:"",flags:0,pathName:"",blockInsertUnits:0,explodability:1,blockScaling:1,previewIcon:void 0}),super(t,e),this._entities=[]}get isModelSapce(){return fn.isModelSapceName(this.name)}get isPaperSapce(){return fn.isPaperSapceName(this.name)}get origin(){return this.getAttr("origin")}set origin(t){this.getAttr("origin").copy(t)}get layoutId(){return this.getAttr("layoutId")}set layoutId(t){this.setAttr("layoutId",t)}get flags(){return this.getAttr("flags")}set flags(t){this.setAttr("flags",t)}get annotative(){return Ae(this)}set annotative(t){pe(this,t)}get pathName(){return this.getAttr("pathName")}set pathName(t){this.setAttr("pathName",t)}get isXref(){return(this.flags&12)!==0}get isOverlayReference(){return(this.flags&8)!==0}get isUnresolvedXref(){return!this.isXref||(this.flags&32)!==0?!1:this._entities.length===0}get blockInsertUnits(){return this.getAttr("blockInsertUnits")}set blockInsertUnits(t){this.setAttr("blockInsertUnits",t)}get explodability(){return this.getAttr("explodability")}set explodability(t){this.setAttr("explodability",t)}get blockScaling(){return this.getAttr("blockScaling")}set blockScaling(t){this.setAttr("blockScaling",t)}get previewIcon(){return this.getAttrWithoutException("previewIcon")}set previewIcon(t){if(!t||t.length===0){this.setAttr("previewIcon",void 0);return}this.setAttr("previewIcon",t)}appendEntity(t){const e=this.database.transactionManager;if(e.strictMode&&!e.isRecording()&&!e.isApplyingUndoRedo())throw new Error("Cannot append entities outside an active transaction.");const n=s=>{s.database=this.database,this.database.ensureEntityStyleDefaults(s),this.database.commitObjectHandle(s,a=>this.hasEntityId(a)),s.ownerId=this.objectId,s.resolveEffectiveProperties(),this._entities.push(s),s.dxfTypeName==="INSERT"&&"syncAttributeDatabases"in s&&typeof s.syncAttributeDatabases=="function"&&s.syncAttributeDatabases()},r=Array.isArray(t)?t:[t];for(const s of r)n(s);if(e.isRecording())for(const s of r)e.recordAppend({type:"blockTableRecord",ownerId:this.objectId},s);(this.isModelSapce||this.isPaperSapce)&&!e.isRecording()&&!e.isApplyingUndoRedo()&&this.database.notifyEntityAppended(t)}removeEntity(t){const e=this.database.transactionManager;if(e.strictMode&&!e.isRecording()&&!e.isApplyingUndoRedo())throw new Error("Cannot remove entities outside an active transaction.");const n=Array.isArray(t)?t:[t];if(n.length===0)return!1;const r=new Set(n),s=[];let a=0;for(const o of this._entities)r.has(o.objectId)?(e.isRecording()&&e.recordRemove({type:"blockTableRecord",ownerId:this.objectId},o),s.push(o),this.database.releaseObjectHandle(o)):this._entities[a++]=o;return this._entities.length=a,s.length>0&&!e.isRecording()&&!e.isApplyingUndoRedo()&&this.database.notifyEntityErased(s),s.length>0}newIterator(){return new Ci(this._entities)}getIdAt(t){const e=this.database.getObjectById(t);if(!(!(e instanceof st)||e.getAttrWithoutException("ownerId")!==this.objectId))return e}hasEntityId(t){return this.getIdAt(t)!==void 0}dxfOutBlockRecord(t){return t.writeStart("BLOCK_RECORD"),this.dxfOut(t),this}dxfOutBlockBegin(t){return t.writeStart("BLOCK"),t.writeHandle(5,this.database.generateHandle()),t.writeObjectId(330,this.objectId),t.writeSubclassMarker("AcDbEntity"),t.writeString(8,"0"),t.writeSubclassMarker("AcDbBlockBegin"),t.writeString(2,this.name),t.writeInt16(70,this.flags),t.writePoint3d(10,this.origin),t.writeString(3,this.name),this.pathName&&t.writeString(1,this.pathName),this}dxfOutBlockEnd(t){return t.writeStart("ENDBLK"),t.writeHandle(5,this.database.generateHandle()),t.writeObjectId(330,this.objectId),t.writeSubclassMarker("AcDbEntity"),t.writeSubclassMarker("AcDbBlockEnd"),this}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbBlockTableRecord"),t.writeString(2,this.name),t.capabilities.supportsBlockRecordUnitsFlags&&(t.writeInt16(70,this.blockInsertUnits),t.writeInt16(280,this.explodability),t.writeInt16(281,this.blockScaling)),(this.isModelSapce||this.isPaperSapce)&&t.writeObjectId(340,this.layoutId),this}dxfInFields(t){super.dxfInFields(t),t.atSubclassData("AcDbSymbolTableRecord"),t.atSubclassData("AcDbBlockTableRecord");const e=[];for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const n=t.readItem();if(!n)break;const r=Number(n.code);if(r===100){t.pushBackItem(n);break}switch(r){case 2:this.name=String(n.value);break;case 70:this.blockInsertUnits=Number(n.value);break;case 280:this.explodability=Number(n.value);break;case 281:this.blockScaling=Number(n.value);break;case 340:this.layoutId=String(n.value);break;case 310:{const s=String(n.value).replace(/\s+/g,"");s&&e.push(s);break}}}return e.length>0&&(this.previewIcon=Cl(e)),this}};fn.MODEL_SPACE_NAME="*Model_Space",fn.PAPER_SPACE_NAME_PREFIX="*Paper_Space";let lt=fn;var Af=(i=>(i[i.kInches=0]="kInches",i[i.kMillimeters=1]="kMillimeters",i[i.kPixels=2]="kPixels",i))(Af||{}),Sf=(i=>(i[i.k0degrees=0]="k0degrees",i[i.k90degrees=1]="k90degrees",i[i.k180degrees=2]="k180degrees",i[i.k270degrees=3]="k270degrees",i))(Sf||{}),Pf=(i=>(i[i.kDisplay=0]="kDisplay",i[i.kExtents=1]="kExtents",i[i.kLimits=2]="kLimits",i[i.kView=3]="kView",i[i.kWindow=4]="kWindow",i[i.kLayout=5]="kLayout",i))(Pf||{}),kf=(i=>(i[i.kDraft=0]="kDraft",i[i.kPreview=1]="kPreview",i[i.kNormal=2]="kNormal",i[i.kPresentation=3]="kPresentation",i[i.kMaximum=4]="kMaximum",i[i.kCustom=5]="kCustom",i))(kf||{}),If=(i=>(i[i.kAsDisplayed=0]="kAsDisplayed",i[i.kWireframe=1]="kWireframe",i[i.kHidden=2]="kHidden",i[i.kRendered=3]="kRendered",i[i.kVisualStyle=4]="kVisualStyle",i[i.kRenderPreset=5]="kRenderPreset",i))(If||{}),Ef=(i=>(i[i.kScaleToFit=0]="kScaleToFit",i[i.k1_128in_1ft=1]="k1_128in_1ft",i[i.k1_64in_1ft=2]="k1_64in_1ft",i[i.k1_32in_1ft=3]="k1_32in_1ft",i[i.k1_16in_1ft=4]="k1_16in_1ft",i[i.k3_32in_1ft=5]="k3_32in_1ft",i[i.k1_8in_1ft=6]="k1_8in_1ft",i[i.k3_16in_1ft=7]="k3_16in_1ft",i[i.k1_4in_1ft=8]="k1_4in_1ft",i[i.k3_8in_1ft=9]="k3_8in_1ft",i[i.k1_2in_1ft=10]="k1_2in_1ft",i[i.k3_4in_1ft=11]="k3_4in_1ft",i[i.k1in_1ft=12]="k1in_1ft",i[i.k3in_1ft=13]="k3in_1ft",i[i.k6in_1ft=14]="k6in_1ft",i[i.k1ft_1ft=15]="k1ft_1ft",i[i.k1_1=16]="k1_1",i[i.k1_2=17]="k1_2",i[i.k1_4=18]="k1_4",i[i.k1_5=19]="k1_5",i[i.k1_8=20]="k1_8",i[i.k1_10=21]="k1_10",i[i.k1_16=22]="k1_16",i[i.k1_20=23]="k1_20",i[i.k1_30=24]="k1_30",i[i.k1_40=25]="k1_40",i[i.k1_50=26]="k1_50",i[i.k1_100=27]="k1_100",i[i.k2_1=28]="k2_1",i[i.k4_1=29]="k4_1",i[i.k8_1=30]="k8_1",i[i.k10_1=31]="k10_1",i[i.k100_1=32]="k100_1",i[i.k1000_1=33]="k1000_1",i[i.k1and1_2in_1ft=34]="k1and1_2in_1ft",i))(Ef||{});const s_={0:0,1:1/1536,2:1/768,3:1/384,4:1/192,5:1/128,6:1/96,7:1/64,8:1/48,9:1/32,10:1/24,11:1/16,12:1/12,13:1/4,14:1/2,15:1,16:1,17:1/2,18:1/4,19:1/5,20:1/8,21:1/10,22:1/16,23:1/20,24:1/30,25:1/40,26:1/50,27:1/100,28:2,29:4,30:8,31:10,32:100,33:1e3,34:1/8};class Tf extends mt{constructor(t=!1){super(),this._plotSettingsName="",this._plotCfgName="",this._canonicalMediaName="",this._currentStyleSheet="",this._plotOrigin=new M,this._customPrintScale={numerator:1,denominator:1},this._plotPaperSize=new M,this._plotPaperMargins={left:0,right:0,top:0,bottom:0},this._plotViewName="",this._paperImageOrigin=new M,this._plotWindowArea=new Ct,this._modelType=t,this._plotCentered=!1,this._plotHidden=!1,this._plotPaperUnits=1,this._plotPlotStyles=!0,this._plotRotation=0,this._plotType=5,this._plotViewportBorders=!1,this._printLineweights=!0,this._scaleLineweights=!1,this._drawViewportsFirst=!1,this._showPlotStyles=!0,this._shadePlotType=0,this._shadePlotResLevel=2,this._shadePlotCustomDpi=300,this._shadePlotId=void 0,this._stdScaleType=0,this._useStandardScale=!0}get plotSettingsName(){return this._plotSettingsName}set plotSettingsName(t){this._plotSettingsName=t}getPlotSettingsName(){return this._plotSettingsName}setPlotSettingsName(t){this._plotSettingsName=t}get plotCfgName(){return this._plotCfgName}set plotCfgName(t){this._plotCfgName=t}getPlotCfgName(){return this._plotCfgName}get canonicalMediaName(){return this._canonicalMediaName}set canonicalMediaName(t){this._canonicalMediaName=t}getCanonicalMediaName(){return this._canonicalMediaName}get currentStyleSheet(){return this._currentStyleSheet}set currentStyleSheet(t){this._currentStyleSheet=t}getCurrentStyleSheet(){return this._currentStyleSheet}get plotOrigin(){return this._plotOrigin}set plotOrigin(t){this._plotOrigin=t}getPlotOrigin(){return this._plotOrigin}get customPrintScale(){return this._customPrintScale}set customPrintScale(t){this._customPrintScale=t}getCustomPrintScale(){return this._customPrintScale}get plotPaperSize(){return this._plotPaperSize}set plotPaperSize(t){this._plotPaperSize=t}getPlotPaperSize(){return this._plotPaperSize}get plotPaperMargins(){return this._plotPaperMargins}set plotPaperMargins(t){this._plotPaperMargins=t}getPlotPaperMargins(){return this._plotPaperMargins}get plotViewName(){return this._plotViewName}set plotViewName(t){this._plotViewName=t}getPlotViewName(){return this._plotViewName}get paperImageOrigin(){return this._paperImageOrigin}set paperImageOrigin(t){this._paperImageOrigin=t}get plotWindowArea(){return this._plotWindowArea}set plotWindowArea(t){this._plotWindowArea=t}getPlotWindowArea(){return this._plotWindowArea}get modelType(){return this._modelType}set modelType(t){this._modelType=t}getModelType(){return this._modelType}setModelType(t){this._modelType=t}get drawViewportsFirst(){return this._drawViewportsFirst}set drawViewportsFirst(t){this._drawViewportsFirst=t}setDrawViewportsFirst(t){this._drawViewportsFirst=t}get plotCentered(){return this._plotCentered}set plotCentered(t){this._plotCentered=t}setPlotCentered(t){this._plotCentered=t}get plotHidden(){return this._plotHidden}set plotHidden(t){this._plotHidden=t}setPlotHidden(t){this._plotHidden=t}get plotPaperUnits(){return this._plotPaperUnits}set plotPaperUnits(t){this._plotPaperUnits=t}get plotPlotStyles(){return this._plotPlotStyles}set plotPlotStyles(t){this._plotPlotStyles=t}setPlotPlotStyles(t){this._plotPlotStyles=t}get plotRotation(){return this._plotRotation}set plotRotation(t){this._plotRotation=t}get plotType(){return this._plotType}set plotType(t){this._plotType=t}get plotViewportBorders(){return this._plotViewportBorders}set plotViewportBorders(t){this._plotViewportBorders=t}setPlotViewportBorders(t){this._plotViewportBorders=t}get printLineweights(){return this._printLineweights}set printLineweights(t){this._printLineweights=t}setPrintLineweights(t){this._printLineweights=t}get scaleLineweights(){return this._scaleLineweights}set scaleLineweights(t){this._scaleLineweights=t}setScaleLineweights(t){this._scaleLineweights=t}get showPlotStyles(){return this._showPlotStyles}set showPlotStyles(t){this._showPlotStyles=t}setShowPlotStyles(t){this._showPlotStyles=t}get shadePlot(){return this._shadePlotType}set shadePlot(t){this._shadePlotType=t}setShadePlot(t){this._shadePlotType=t}get shadePlotResLevel(){return this._shadePlotResLevel}set shadePlotResLevel(t){this._shadePlotResLevel=t}setShadePlotResLevel(t){this._shadePlotResLevel=t}get shadePlotCustomDPI(){return this._shadePlotCustomDpi}set shadePlotCustomDPI(t){this._shadePlotCustomDpi=t}setShadePlotCustomDPI(t){this._shadePlotCustomDpi=t}get shadePlotId(){return this._shadePlotId}set shadePlotId(t){this._shadePlotId=t}get plotWireframe(){return this._shadePlotType===1}get plotAsRaster(){return this._shadePlotType===3||this._shadePlotType===4||this._shadePlotType===5}get stdScaleType(){return this._stdScaleType}set stdScaleType(t){this._stdScaleType=t}get stdScale(){return s_[this._stdScaleType]??1}get useStandardScale(){return this._useStandardScale}set useStandardScale(t){this._useStandardScale=t}dxfOutFields(t){super.dxfOutFields(t),t.writeSubclassMarker("AcDbPlotSettings"),t.writeString(1,this.plotSettingsName),t.writeString(2,this.plotCfgName),t.writeString(4,this.canonicalMediaName),t.writeString(6,this.plotViewName),t.writeDouble(40,this.plotPaperMargins.left),t.writeDouble(41,this.plotPaperMargins.bottom),t.writeDouble(42,this.plotPaperMargins.right),t.writeDouble(43,this.plotPaperMargins.top),t.writeDouble(44,this.plotPaperSize.x),t.writeDouble(45,this.plotPaperSize.y),t.writeDouble(46,this.plotOrigin.x),t.writeDouble(47,this.plotOrigin.y),t.writeDouble(48,this.plotWindowArea.min.x),t.writeDouble(49,this.plotWindowArea.min.y),t.writeDouble(140,this.plotWindowArea.max.x),t.writeDouble(141,this.plotWindowArea.max.y),t.writeDouble(142,this.customPrintScale.numerator),t.writeDouble(143,this.customPrintScale.denominator);let e=0;return this.plotViewportBorders&&(e|=1),this.showPlotStyles&&(e|=2),this.plotCentered&&(e|=4),this.plotHidden&&(e|=8),this.useStandardScale&&(e|=16),this.plotPlotStyles&&(e|=32),this.scaleLineweights&&(e|=64),this.printLineweights&&(e|=128),this.drawViewportsFirst&&(e|=512),this.modelType&&(e|=1024),t.writeInt16(70,e),t.writeInt16(72,this.plotPaperUnits),t.writeInt16(73,this.plotRotation),t.writeInt16(74,this.plotType),t.writeString(7,this.currentStyleSheet),t.writeInt16(75,this.stdScaleType),t.writeInt16(76,this.shadePlot),t.writeInt16(77,this.shadePlotResLevel),t.writeInt16(78,this.shadePlotCustomDPI),t.writeDouble(147,this.stdScale),t.writeDouble(148,this.paperImageOrigin.x),t.writeDouble(149,this.paperImageOrigin.y),t.writeObjectId(333,this.shadePlotId),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbPlotSettings");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code),r=Number(e.value);switch(n){case 1:this.plotSettingsName=String(e.value);break;case 2:this.plotCfgName=String(e.value);break;case 4:this.canonicalMediaName=String(e.value);break;case 6:this.plotViewName=String(e.value);break;case 7:this.currentStyleSheet=String(e.value);break;case 40:this.plotPaperMargins.left=r;break;case 41:this.plotPaperMargins.bottom=r;break;case 42:this.plotPaperMargins.right=r;break;case 43:this.plotPaperMargins.top=r;break;case 44:this.plotPaperSize.x=r;break;case 45:this.plotPaperSize.y=r;break;case 46:this.plotOrigin.x=r;break;case 47:this.plotOrigin.y=r;break;case 48:this.plotWindowArea.min.x=r;break;case 49:this.plotWindowArea.min.y=r;break;case 140:this.plotWindowArea.max.x=r;break;case 141:this.plotWindowArea.max.y=r;break;case 142:this.customPrintScale.numerator=r;break;case 143:this.customPrintScale.denominator=r;break;case 70:{const s=r;this.plotViewportBorders=(s&1)!==0,this.showPlotStyles=(s&2)!==0,this.plotCentered=(s&4)!==0,this.plotHidden=(s&8)!==0,this.useStandardScale=(s&16)!==0,this.plotPlotStyles=(s&32)!==0,this.scaleLineweights=(s&64)!==0,this.printLineweights=(s&128)!==0,this.drawViewportsFirst=(s&512)!==0,this.modelType=(s&1024)!==0;break}case 72:this.plotPaperUnits=r;break;case 73:this.plotRotation=r;break;case 74:this.plotType=r;break;case 75:this.stdScaleType=r;break;case 76:this.shadePlot=r;break;case 77:this.shadePlotResLevel=r;break;case 78:this.shadePlotCustomDPI=r;break;case 147:break;case 148:this.paperImageOrigin.x=r;break;case 149:this.paperImageOrigin.y=r;break;case 333:this.shadePlotId=String(e.value);break;case 100:return t.pushBackItem(e),this}}return this}}class Vn extends Tf{constructor(){super(),this._insertionPoint=new x,this._ucsOrigin=new x,this._ucsXAxis=new A(1,0,0),this._ucsYAxis=new A(0,1,0),this._elevation=0,this._orthographicType=0,this._tabOrder=-1,this._tabSelected=!1,this._blockTableRecordId="",this._layoutName="",this._limits=new Ct,this._extents=new H,this._viewportArray=[]}get layoutName(){return this._layoutName}set layoutName(t){this._layoutName=t.length>256?t.slice(0,256):t}get tabOrder(){return this._tabOrder}set tabOrder(t){this._tabOrder=t}get tabSelected(){return this._tabSelected}set tabSelected(t){this._tabSelected=t}get blockTableRecordId(){return this._blockTableRecordId}set blockTableRecordId(t){this._blockTableRecordId=t}get limits(){return this._limits}set limits(t){this._limits.copy(t)}get extents(){return this._extents}set extents(t){this._extents.copy(t)}get viewportArray(){return this._viewportArray}set viewportArray(t){this._viewportArray=t.slice()}get namedUcsId(){return this._namedUcsId}set namedUcsId(t){this._namedUcsId=t}get orthographicUcsId(){return this._orthographicUcsId}set orthographicUcsId(t){this._orthographicUcsId=t}get insertionPoint(){return this._insertionPoint}set insertionPoint(t){this._insertionPoint.copy(t)}get ucsOrigin(){return this._ucsOrigin}set ucsOrigin(t){this._ucsOrigin.copy(t)}get ucsXAxis(){return this._ucsXAxis}set ucsXAxis(t){this._ucsXAxis.copy(t)}get ucsYAxis(){return this._ucsYAxis}set ucsYAxis(t){this._ucsYAxis.copy(t)}get elevation(){return this._elevation}set elevation(t){this._elevation=t}get orthographicType(){return this._orthographicType}set orthographicType(t){this._orthographicType=t}dxfOutFields(t){return super.dxfOutFields(t),t.writeSubclassMarker("AcDbLayout"),t.writeString(1,this.layoutName),t.writeInt16(70,this.tabSelected?1:0),t.writeInt16(71,this.tabOrder),t.writeObjectId(330,this.blockTableRecordId),t.writeObjectId(331,this._viewportArray.length>0?this._viewportArray[0]:"0"),t.writePoint2d(10,this.limits.min),t.writePoint2d(11,this.limits.max),t.writePoint3d(14,this.extents.min),t.writePoint3d(15,this.extents.max),t.writePoint3d(12,this.insertionPoint),t.writePoint3d(13,this.ucsOrigin),t.writeVector3d(16,this.ucsXAxis),t.writeVector3d(17,this.ucsYAxis),t.writeDouble(146,this.elevation),t.writeInt16(76,this.orthographicType),t.writeObjectId(345,this._namedUcsId),t.writeObjectId(346,this._orthographicUcsId),this}dxfInFields(t){for(super.dxfInFields(t),t.atSubclassData("AcDbLayout");!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const e=t.readItem();if(!e)break;const n=Number(e.code),r=Number(e.value);switch(n){case 1:this.layoutName=String(e.value);break;case 70:this.tabSelected=r!==0;break;case 71:this.tabOrder=r;break;case 330:this.blockTableRecordId=String(e.value);break;case 331:{const s=String(e.value);s&&s!=="0"&&(this.viewportArray=[s]);break}case 10:this.limits.min.x=r;break;case 20:this.limits.min.y=r;break;case 11:this.limits.max.x=r;break;case 21:this.limits.max.y=r;break;case 14:this.extents.min.x=r;break;case 24:this.extents.min.y=r;break;case 34:this.extents.min.z=r;break;case 15:this.extents.max.x=r;break;case 25:this.extents.max.y=r;break;case 35:this.extents.max.z=r;break;case 345:this.namedUcsId=String(e.value);break;case 346:this.orthographicUcsId=String(e.value);break;case 12:this.insertionPoint.x=r;break;case 22:this.insertionPoint.y=r;break;case 32:this.insertionPoint.z=r;break;case 13:this.ucsOrigin.x=r;break;case 23:this.ucsOrigin.y=r;break;case 33:this.ucsOrigin.z=r;break;case 16:this.ucsXAxis.x=r;break;case 26:this.ucsXAxis.y=r;break;case 36:this.ucsXAxis.z=r;break;case 17:this.ucsYAxis.x=r;break;case 27:this.ucsYAxis.y=r;break;case 37:this.ucsYAxis.z=r;break;case 76:this.orthographicType=r;break;case 146:this.elevation=r;break;case 100:return t.pushBackItem(e),this}}return this}}class Lf{constructor(){this.events={layoutCreated:new vt,layoutRemoved:new vt,layoutRenamed:new vt,layoutSwitched:new vt}}countLayouts(t){return this.getWorkingDatabase(t).objects.layout.numEntries}findLayoutNamed(t,e){return this.getWorkingDatabase(e).objects.layout.getAt(t)}findActiveLayout(){const t=this.getActiveLayout();return t?t.layoutName:"Model"}setCurrentLayoutId(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getIdAt(t);return this.setCurrentLayoutInternal(r,n)}setCurrentLayoutBtrId(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getBtrIdAt(t);return this.setCurrentLayoutInternal(r,n)}setCurrentLayout(t,e){const n=this.getWorkingDatabase(e),r=n.objects.layout.getAt(t);return this.setCurrentLayoutInternal(r,n)}renameLayout(t,e,n){const s=this.getWorkingDatabase(n).objects.layout.getAt(t);return s?(s.layoutName=e,this.events.layoutRenamed.dispatch({layout:s,oldName:t,newName:e}),!0):!1}layoutExists(t,e){return this.getWorkingDatabase(e).objects.layout.has(t)}deleteLayout(t,e){const n=this.getWorkingDatabase(e).objects.layout,r=n.getAt(t);let s=!1;return r&&(s=n.remove(t),s&&this.events.layoutRemoved.dispatch({layout:r})),s}createLayout(t,e){const n=this.getWorkingDatabase(e),r=new Vn;r.layoutName=t,r.tabOrder=n.objects.layout.maxTabOrder;const s=new lt;return s.name=`*Paper_Space${r.tabOrder}`,n.tables.blockTable.add(s),n.objects.layout.setAt(t,r),this.events.layoutCreated.dispatch({layout:r}),{layout:r,btr:s}}getActiveLayout(t){const e=this.getWorkingDatabase(t);return e.objects.layout.getBtrIdAt(e.currentSpaceId)}getWorkingDatabase(t){return t||Gg()}setCurrentLayoutInternal(t,e){return t?(this.events.layoutSwitched.dispatch({layout:t}),e.currentSpaceId=t.blockTableRecordId,!0):!1}}let Is;function a_(i){Is=i}function Mf(){return qs.instance}const Ya=class Ya{constructor(){this._workingDatabase=null}get workingDatabase(){if(this._workingDatabase==null)throw new Error("The current working database must be set before using it!");return this._workingDatabase}set workingDatabase(t){this._workingDatabase=t}get layoutManager(){return this._layoutManager||(Is||(Is=()=>new Lf),this._layoutManager=Is()),this._layoutManager}};Ya.instance=new Ya;let qs=Ya;Ug(Mf);var Ni=(i=>(i.kForRead="kForRead",i.kForWrite="kForWrite",i))(Ni||{});function o_(i){let t="";for(let e=0;e<i.length;e++){const n=i.charCodeAt(e);t+=n<=32?i[e]:String.fromCharCode(159-n)}return t}function c_(i){const t=i.trimStart();return!(!t||/^\d/.test(t)||/^ACIS/i.test(t)||/^ASM/i.test(t)||/^(body|point|plane|cone|cylinder|sphere|torus|lump|shell|face|edge|wire|transform)\b/i.test(t)||/\b(body|point|straight-curve|ellipse-curve)\s+\$/.test(t))}function l_(i){return!i||!c_(i)?i:o_(i)}function h_(i){return i.length===0?"":i.map(t=>l_(t)).join(`
|
|
6
6
|
`)}function ku(i,t,e){if(t===1){i.push(e);return}if(i.length===0){i.push(e);return}i[i.length-1]+=e}const u_=["ACIS BinaryFile","ASM BinaryFile4"],Cf=new Set(["End-of-ACIS-data","End-of-ASM-data","End-of-ACIS-History-data"]),Q={Int:4,Double:6,Str:7,BoolTrue:10,BoolFalse:11,Pointer:12,EntityType:13,EntityTypeEx:14,SubtypeStart:15,SubtypeEnd:16,RecordEnd:17,LiteralStr:18,LocationVec:19,DirectionVec:20,Enum:21,Unknown0x17:23};class d_{constructor(t){this.data=t,this.index=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}get hasData(){return this.index<this.data.length}require(t){if(this.index+t>this.data.length)throw new RangeError(`SAB: read past end of data (need ${String(t)} at ${String(this.index)})`)}readByte(){return this.require(1),this.data[this.index++]??0}readInt(){this.require(4);const t=this.view.getInt32(this.index,!0);return this.index+=4,t}readFloat(){this.require(8);const t=this.view.getFloat64(this.index,!0);return this.index+=8,t}readStr(t){this.require(t);const e=g_.decode(this.data.subarray(this.index,this.index+t));return this.index+=t,e}}const g_=new TextDecoder("latin1");function f_(i,t){let e="";for(const g of u_)if(y_(t,g)){e=g,i.index=g.length;break}if(e==="")throw new RangeError("SAB: not a SAB stream (missing signature)");const n=i.readInt(),r=i.readInt(),s=i.readInt(),a=i.readInt(),o=Bo(i),c=Bo(i),l=Bo(i),h=Fo(i),u=Fo(i),d=Fo(i);return{signature:e,version:n,numRecords:r,numEntities:s,flags:a,productId:o,acisVersion:c,creationDate:l,unitsInMm:h,resTol:u,norTol:d}}function Bo(i){if(i.readByte()!==Q.Str)throw new RangeError("SAB: expected string tag (0x07)");return i.readStr(i.readByte())}function Fo(i){if(i.readByte()!==Q.Double)throw new RangeError("SAB: expected double tag (0x06)");return i.readFloat()}function p_(i){const t=[],e=[];let n="",r=0;for(;;){if(!i.hasData){if(Cf.has(n))return{type:n,tokens:t};throw new RangeError("SAB: premature end of data")}const s=i.readByte();switch(s){case Q.Int:t.push({tag:s,value:i.readInt()});break;case Q.Double:t.push({tag:s,value:i.readFloat()});break;case Q.Str:t.push({tag:s,value:i.readStr(i.readByte())});break;case Q.Pointer:t.push({tag:s,value:i.readInt()});break;case Q.BoolTrue:t.push({tag:s,value:!0});break;case Q.BoolFalse:t.push({tag:s,value:!1});break;case Q.LiteralStr:t.push({tag:s,value:i.readStr(i.readInt())});break;case Q.EntityTypeEx:e.push(i.readStr(i.readByte()));break;case Q.EntityType:{e.push(i.readStr(i.readByte()));const a=e.join("-");e.length=0,n===""&&(n=a),t.push({tag:s,value:a});break}case Q.LocationVec:t.push({tag:s,value:Iu(i)});break;case Q.DirectionVec:t.push({tag:s,value:Iu(i)});break;case Q.Enum:t.push({tag:s,value:i.readInt()});break;case Q.Unknown0x17:t.push({tag:s,value:i.readFloat()});break;case Q.SubtypeStart:r++,t.push({tag:s,value:r});break;case Q.SubtypeEnd:t.push({tag:s,value:r}),r--;break;case Q.RecordEnd:return{type:n,tokens:t};default:throw new RangeError(`SAB: unknown tag 0x${s.toString(16)} (${String(s)}) in record '${n}'`)}}}function Iu(i){return[i.readFloat(),i.readFloat(),i.readFloat()]}function m_(i){const t=new d_(i),e=f_(t,i),n=[];for(;t.hasData;){const r=p_(t);if(n.push(r),Cf.has(r.type))break}return{header:e,records:n}}function y_(i,t){if(i.length<t.length)return!1;for(let e=0;e<t.length;e++)if(i[e]!==t.charCodeAt(e))return!1;return!0}const b_=new Set(["End-of-ACIS-data","End-of-ASM-data","End-of-ACIS-History-data"]);function __(i){const e=i.records.map((a,o)=>({index:o,type:a.type,record:a,refs:[]}));for(const a of e)for(const o of a.record.tokens){if(o.tag!==Q.Pointer)continue;const c=o.value;a.refs.push(c>=0&&c<e.length?e[c]:null)}const n=e,r=new Map,s=new Map;for(const a of n){if(b_.has(a.type))continue;let o=r.get(a.type);o===void 0&&(o=[],r.set(a.type,o)),o.push(a),s.set(a.type,(s.get(a.type)??0)+1)}return{header:i.header,nodes:n,bodies:r.get("body")??[],typeCounts:s,nodesOfType:a=>r.get(a)??[],pointLocations(){const a=[];for(const o of r.get("point")??[]){const c=o.record.tokens.find(l=>l.tag===Q.LocationVec);c!==void 0&&a.push(c.value)}return a}}}const x_=["ACIS BinaryFile","ASM BinaryFile","ASM BinaryFile4"];function w_(i,t){if(t.length===0||i.length<t.length)return-1;const e=t.charCodeAt(0);for(let n=0;n<=i.length-t.length;n++){if(i[n]!==e)continue;let r=!0;for(let s=1;s<t.length;s++)if(i[n+s]!==t.charCodeAt(s)){r=!1;break}if(r)return n}return-1}function v_(i){for(const t of x_){const e=w_(i,t);if(e>=0)return e}return-1}function A_(i){if(i.length===0)return null;const t=v_(i);if(t<0)return null;try{return __(m_(i.subarray(t)))}catch{return null}}const Ks={xAxis:[1,0,0],yAxis:[0,1,0],zAxis:[0,0,1],translation:[0,0,0],scale:1},S_=1e-12,P_=new Set([Q.LocationVec,Q.DirectionVec]),Es=(i,t)=>Math.abs(i-t)<=S_,ls=(i,t)=>Es(i[0],t[0])&&Es(i[1],t[1])&&Es(i[2],t[2]);function Ol(){return Ks}function Of(i,t){return Es(i.scale,t.scale)&&ls(i.xAxis,t.xAxis)&&ls(i.yAxis,t.yAxis)&&ls(i.zAxis,t.zAxis)&&ls(i.translation,t.translation)}function k_(i){const t=[];let e;for(const n of i.record.tokens){if(P_.has(n.tag)){t.push(n.value);continue}n.tag===Q.Double&&t.length>=4&&e===void 0&&(e=n.value)}return t.length<4?null:{xAxis:t[0],yAxis:t[1],zAxis:t[2],translation:t[3],scale:e??1}}function I_(i){const t=i.refs.find(e=>(e==null?void 0:e.type)==="transform");return t==null?Ks:k_(t)??Ks}function hr(i){return Of(i,Ks)}function Be(i,t){const e=t.scale,[n,r,s]=i,{xAxis:a,yAxis:o,zAxis:c,translation:l}=t;return[e*(a[0]*n+o[0]*r+c[0]*s)+l[0],e*(a[1]*n+o[1]*r+c[1]*s)+l[1],e*(a[2]*n+o[2]*r+c[2]*s)+l[2]]}function Le(i,t){const e=t.scale,[n,r,s]=i,{xAxis:a,yAxis:o,zAxis:c}=t;return[e*(a[0]*n+o[0]*r+c[0]*s),e*(a[1]*n+o[1]*r+c[1]*s),e*(a[2]*n+o[2]*r+c[2]*s)]}function Nf(i){const t=new Map,e=(n,r,s)=>{if(!(n==null||s.has(n.index))&&!n.type.includes("attrib")){s.add(n.index),t.has(n.index)||t.set(n.index,r);for(const a of n.refs)e(a,r,s)}};for(const n of i.bodies)e(n,I_(n),new Set);return t}function E_(i,t){if(hr(t)||i.length<3)return i;const e=new Float32Array(i.length);for(let n=0;n+2<i.length;n+=3){const[r,s,a]=Be([i[n],i[n+1],i[n+2]],t);e[n]=r,e[n+1]=s,e[n+2]=a}return e}class Df{constructor(t){this.tokens=t,this.i=0}next(...t){for(;this.i<this.tokens.length;){const e=this.tokens[this.i++];if(e!==void 0&&t.includes(e.tag))return e}}nextVec(){var t;return(t=this.next(Q.LocationVec,Q.DirectionVec))==null?void 0:t.value}nextDouble(){var t;return(t=this.next(Q.Double))==null?void 0:t.value}}const li=(i,t)=>i.refs.find(e=>e!==null&&(e.type===t||e.type.endsWith(t)))??null,Rf=(i,t)=>i.refs.filter(e=>e!==null&&e.type===t);function zo(i){if(i===null)return null;const t=li(i,"point");if(t===null)return null;const e=t.record.tokens.find(n=>n.tag===Q.LocationVec);return e?e.value:null}function T_(i){const t=new Df(i.record.tokens);if(i.type==="straight-curve"){const e=t.nextVec(),n=t.nextVec();if(e&&n)return{kind:"straight",origin:e,direction:n}}else if(i.type==="ellipse-curve"){const e=t.nextVec(),n=t.nextVec(),r=t.nextVec(),s=t.nextDouble();if(e&&n&&r&&s!==void 0)return{kind:"ellipse",center:e,normal:n,majorAxis:r,ratio:s}}else if(i.type==="intcurve-curve")return{kind:"intcurve",controlPoints:L_(i.record.tokens)};return{kind:"unknown"}}function L_(i){var a,o,c;const t=i.findIndex(l=>l.tag===Q.EntityType&&(l.value==="nubs"||l.value==="nurbs"));if(t<0)return[];let e=t+1,n=-1;for(;e<i.length;e++){const l=i[e];if(l===void 0||l.tag===Q.Double)break;if(l.tag===Q.Int&&(n=l.value),l.tag===Q.EntityType||l.tag===Q.SubtypeEnd)return[]}if(n<0)return[];for(let l=0;l<n;l++){if(((a=i[e])==null?void 0:a.tag)!==Q.Double)return[];e+=1,((o=i[e])==null?void 0:o.tag)===Q.Int&&(e+=1)}const r=[];for(;((c=i[e])==null?void 0:c.tag)===Q.Double;){const l=i[e];if(l===void 0)break;r.push(l.value),e+=1}const s=[];for(let l=0;l+3<=r.length;l+=3){const h=r[l],u=r[l+1],d=r[l+2];if(h===void 0||u===void 0||d===void 0)break;s.push([h,u,d])}return s}function Bf(i){const t=new Df(i.record.tokens);if(i.type==="plane-surface"){const e=t.nextVec(),n=t.nextVec(),r=t.nextVec();if(e&&n)return r?{kind:"plane",origin:e,normal:n,uDir:r}:{kind:"plane",origin:e,normal:n}}else if(i.type==="cone-surface"){const e=t.nextVec(),n=t.nextVec(),r=t.nextVec(),s=t.nextDouble(),a=t.nextDouble(),o=t.nextDouble();if(e&&n&&r&&s!==void 0&&a!==void 0&&o!==void 0)return{kind:"cone",origin:e,axis:n,majorAxis:r,ratio:s,sineAngle:a,cosineAngle:o}}else if(i.type==="torus-surface"){const e=t.nextVec(),n=t.nextVec(),r=t.nextDouble(),s=t.nextDouble();if(e&&n&&r!==void 0&&s!==void 0)return{kind:"torus",center:e,axis:n,majorRadius:r,minorRadius:s}}else if(i.type==="sphere-surface"){const e=t.nextVec(),n=t.nextDouble(),r=t.nextVec(),s=t.nextVec();if(e&&n!==void 0&&r&&s)return{kind:"sphere",center:e,radius:n,uDir:r,poleAxis:s}}return{kind:"unknown"}}function M_(i){return Bf(i)}const C_={"plane-surface":"plane","cone-surface":"cone","torus-surface":"torus","sphere-surface":"sphere","spline-surface":"spline"},O_={"straight-curve":"straight","ellipse-curve":"ellipse","intcurve-curve":"intcurve"};function N_(i){const t=li(i,"coedge");if(t===null)return 0;const e=new Set;let n=t;for(;n!==null&&!e.has(n.index);)e.add(n.index),n=Rf(n,"coedge")[0]??null;return e.size}function D_(i,t){return i.kind==="straight"?{kind:"straight",origin:Be(i.origin,t),direction:Le(i.direction,t)}:i.kind==="ellipse"?{kind:"ellipse",center:Be(i.center,t),normal:Le(i.normal,t),majorAxis:Le(i.majorAxis,t),ratio:i.ratio}:i.kind==="intcurve"?{kind:"intcurve",controlPoints:i.controlPoints.map(e=>Be(e,t))}:i}function R_(i,t){return i.kind==="plane"?{kind:"plane",origin:Be(i.origin,t),normal:Le(i.normal,t),...i.uDir?{uDir:Le(i.uDir,t)}:{}}:i.kind==="cone"?{kind:"cone",origin:Be(i.origin,t),axis:Le(i.axis,t),majorAxis:Le(i.majorAxis,t),ratio:i.ratio,sineAngle:i.sineAngle,cosineAngle:i.cosineAngle}:i.kind==="torus"?{kind:"torus",center:Be(i.center,t),axis:Le(i.axis,t),majorRadius:i.majorRadius*t.scale,minorRadius:i.minorRadius*t.scale}:i.kind==="sphere"?{kind:"sphere",center:Be(i.center,t),radius:i.radius*t.scale,uDir:Le(i.uDir,t),poleAxis:Le(i.poleAxis,t)}:i}function B_(i){const t=[],e=Nf(i),n=Ol(),r=y=>e.get(y)??n,s=(y,b)=>{if(y===null)return null;const _=r(b);return hr(_)?y:Be(y,_)};let a=1/0,o=1/0,c=1/0,l=-1/0,h=-1/0,u=-1/0;const d=y=>{y[0]<a&&(a=y[0]),y[0]>l&&(l=y[0]),y[1]<o&&(o=y[1]),y[1]>h&&(h=y[1]),y[2]<c&&(c=y[2]),y[2]>u&&(u=y[2])},g=i.nodesOfType("vertex").map(y=>{const b=s(zo(y),y.index);return b===null?t.push(`vertex#${String(y.index)}: no resolvable point`):d(b),{nodeIndex:y.index,point:b}}),f=i.nodesOfType("edge").map(y=>{const b=Rf(y,"vertex"),_=s(zo(b[0]??null),y.index),w=s(zo(b[1]??null),y.index),P=li(y,"-curve"),S=P?O_[P.type]??"unknown":"unknown";let v=P?T_(P):void 0;const k=r(y.index);return v!==void 0&&v.kind!=="unknown"&&!hr(k)&&(v=D_(v,k)),_!==null&&w!==null&&_[0]===w[0]&&_[1]===w[1]&&_[2]===w[2]&&t.push(`edge#${String(y.index)}: degenerate (coincident endpoints)`),v===void 0||v.kind==="unknown"?{nodeIndex:y.index,start:_,end:w,curveType:S}:{nodeIndex:y.index,start:_,end:w,curveType:S,curve:v}}),p=i.nodesOfType("face").map(y=>{const b=li(y,"-surface"),_=b?C_[b.type]??"unknown":"unknown";let w=b?Bf(b):void 0;const P=r(y.index);w!==void 0&&w.kind!=="unknown"&&!hr(P)&&(w=R_(w,P));const S=[],v=new Set;let k=li(y,"loop");for(;k!==null&&!v.has(k.index);)v.add(k.index),S.push({nodeIndex:k.index,coedgeCount:N_(k)}),k=li(k,"loop");return b===null&&t.push(`face#${String(y.index)}: no surface`),w===void 0||w.kind==="unknown"?{nodeIndex:y.index,surfaceType:_,loops:S}:{nodeIndex:y.index,surfaceType:_,surface:w,loops:S}});return{vertices:g,edges:f,faces:p,bbox:a===1/0?null:{min:[a,o,c],max:[l,h,u]},diagnostics:t}}const Mn=(i,t)=>[i[0]+t[0],i[1]+t[1],i[2]+t[2]],pn=(i,t)=>[i[0]*t,i[1]*t,i[2]*t],F_=i=>Math.hypot(i[0],i[1],i[2]),Ts=(i,t)=>[i[1]*t[2]-i[2]*t[1],i[2]*t[0]-i[0]*t[2],i[0]*t[1]-i[1]*t[0]],si=i=>{const t=Math.hypot(i[0],i[1],i[2]);return t>0?[i[0]/t,i[1]/t,i[2]/t]:[0,0,0]};function z_(i){const t=[];for(const r of i.record.tokens)if(r.tag===Q.Double&&(t.push(r.value),t.length===2))break;const e=t[0],n=t[1];return e===void 0||n===void 0?null:[e,n]}function Ff(i,t,e,n){const r=pn(Ts(si(i.normal),i.majorAxis),i.ratio),s=Math.max(1,n),a=[];for(let o=0;o<=s;o++){const c=t+(e-t)*o/s;a.push(Mn(i.center,Mn(pn(i.majorAxis,Math.cos(c)),pn(r,Math.sin(c)))))}return a}function X_(i,t=16){const e=si(i.poleAxis);let n=si(i.uDir),r=Ts(e,n);F_(r)<1e-9?(n=Math.abs(e[0])<.9?[1,0,0]:[0,1,0],r=si(Ts(e,n))):r=si(r),n=si(Ts(r,e));const s=[],a=(o,c)=>{const l=[],h=Math.max(8,t);for(let u=0;u<=h;u++){const d=Math.PI*2*u/h;l.push(Mn(i.center,Mn(pn(o,i.radius*Math.cos(d)),pn(c,i.radius*Math.sin(d)))))}s.push(l)};a(n,r),a(n,e),a(r,e);for(const o of[-.5,.5]){const c=pn(e,i.radius*o),l=Mn(i.center,c),h=i.radius*Math.sqrt(Math.max(0,1-o*o));if(h>1e-6){const u=[],d=Math.max(8,t);for(let g=0;g<=d;g++){const f=Math.PI*2*g/d;u.push(Mn(l,Mn(pn(n,h*Math.cos(f)),pn(r,h*Math.sin(f)))))}s.push(u)}}return s}const Y_=16,j_=(i,t)=>i.refs.find(e=>e!==null&&(e.type===t||e.type.endsWith(t)))??null;function zf(i,t,e){i.push(t[0],t[1],t[2],e[0],e[1],e[2])}function Zs(i,t){for(let e=0;e+1<t.length;e++){const n=t[e],r=t[e+1];n&&r&&zf(i,n,r)}}function V_(i){const t=[],e=Nf(i),n=Ol();for(const r of i.nodesOfType("face")){const s=j_(r,"-surface");if((s==null?void 0:s.type)!=="sphere-surface")continue;const a=M_(s);if(a.kind!=="sphere")continue;const o=e.get(r.index)??n;for(const c of X_(a)){if(hr(o)){Zs(t,c);continue}Zs(t,c.map(l=>Be(l,o)))}}return new Float32Array(t)}function U_(i,t){var n,r;const e=[];for(const s of i.edges){const a=t==null?void 0:t.nodes[s.nodeIndex];if(((n=s.curve)==null?void 0:n.kind)==="ellipse"){const o=a!==void 0?z_(a):null,c=(o==null?void 0:o[0])??0,l=(o==null?void 0:o[1])??Math.PI*2;Zs(e,Ff(s.curve,c,l,Y_));continue}if(((r=s.curve)==null?void 0:r.kind)==="intcurve"&&s.curve.controlPoints.length>0){Zs(e,s.curve.controlPoints);continue}s.start&&s.end&&zf(e,s.start,s.end)}return new Float32Array(e)}function H_(i){const t=A_(i);if(t===null)return null;const e=B_(t),n=U_(e,t);if(n.length>0)return n;const r=V_(t);return r.length>0?r:null}const G_=16;function Nl(i,t=!0){const e=i.split(/\s+/),n=[];let r=!t;for(const s of e){if(!r&&/^-?\d+$/.test(s)){r=!0;continue}if(s.startsWith("$")||s==="I"||s==="F"||s==="#")continue;const a=Number.parseFloat(s);Number.isFinite(a)&&n.push(a)}return n}function Eu(i,t,e){i.push(t[0],t[1],t[2],e[0],e[1],e[2])}function Xf(i){return i.split("#").map(t=>t.trim()).filter(t=>t.length>0)}function W_(i){const t=[];return i.forEach((e,n)=>{const r=/^-(\d+)\b/.exec(e),s=r?Number(r[1]):n;t[s]=e}),t}function Tu(i){if(!/(?:^|\s)transform\b/.test(i))return null;const t=Nl(i);return t.length<13?null:{xAxis:[t[0],t[1],t[2]],yAxis:[t[3],t[4],t[5]],zAxis:[t[6],t[7],t[8]],translation:[t[9],t[10],t[11]],scale:t[12]}}function $_(i){const t=Ol(),e=W_(Xf(i)),n=[];for(const s of e){if(s==null||!/(?:^|\s)body\b/.test(s))continue;const a=[...s.matchAll(/\$(-?\d+)/g)].map(o=>Number(o[1]));for(const o of a){if(o<0)continue;const c=e[o];if(c==null)continue;const l=Tu(c);if(l!=null){n.push(l);break}}}if(n.length===0){const s=[];for(const a of e){if(a==null)continue;const o=Tu(a);o!=null&&s.push(o)}return s.length===1?s[0]:t}const r=n[0];for(let s=1;s<n.length;s++)if(!Of(n[s],r))return t;return r}function q_(i){if(!i.includes("straight-curve"))return null;const t=Nl(i);if(t.length<6)return null;const e=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5];return[[e,n,r],[e+s,n+a,r+o]]}function K_(i){if(!i.includes("ellipse-curve"))return null;const t=Nl(i);return t.length<10?null:{kind:"ellipse",center:[t[0],t[1],t[2]],normal:[t[3],t[4],t[5]],majorAxis:[t[6],t[7],t[8]],ratio:t[9]}}function Z_(i){const t=[];if(!i||i.trim().length===0)return new Float32Array(0);for(const e of Xf(i)){const n=q_(e);if(n!==null){Eu(t,n[0],n[1]);continue}const r=K_(e);if(r!==null){const s=Ff(r,0,Math.PI*2,G_);for(let a=1;a<s.length;a++)Eu(t,s[a-1],s[a])}}return t.length===0?new Float32Array(0):E_(new Float32Array(t),$_(i))}const Q_=/\bpoint\s+(?:\$-?\d+\s+){1,4}([-\d.eE+]+)\s+([-\d.eE+]+)\s+([-\d.eE+]+)/g;function J_(i){return i.split("#").map(t=>t.trim()).filter(t=>t.length>0)}function tx(i,t=1){const e=i.split(/\s+/),n=[];for(let r=t;r<e.length;r++){const s=e[r];if(s.startsWith("$")||s==="I"||s==="F")continue;const a=Number.parseFloat(s);Number.isFinite(a)&&n.push(a)}return n}function ex(i){const t=[];for(const e of i.matchAll(Q_)){const n=Number.parseFloat(e[1]),r=Number.parseFloat(e[2]),s=Number.parseFloat(e[3]);Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(s)&&t.push(new x(n,r,s))}if(t.length>0)return t;for(const e of J_(i)){if(!e.startsWith("point "))continue;const n=tx(e);if(n.length>=3){const r=n[n.length-3],s=n[n.length-2],a=n[n.length-1];t.push(new x(r,s,a))}}return t}function nx(i){const t=[];for(let e=0;e<i.length;e+=3){const n=i[e],r=i[e+1],s=i[e+2];t.push(new x(n,r,s))}return t}function ix(i,t){return typeof i=="string"?{satText:i,version:t}:{sabBytes:i.sabBytes,satText:i.satText??i.acisData??"",version:i.version??t}}const ch=class ch extends st{constructor(t,e){super(),this._points=[],this._wireframe=new Float32Array(0);const n=ix(t,e);this._acisData=n.satText,this._sabBytes=n.sabBytes,this._version=n.version,this.rebuildGeometryCaches()}get dxfTypeName(){return"3DSOLID"}get acisData(){return this._acisData}get version(){return this._version}get historyObjectSoftId(){return this._historyObjectSoftId}set historyObjectSoftId(t){this._historyObjectSoftId=t}get guid(){return this._guid}set guid(t){this._guid=t}get satCache(){return this._satCache}set satCache(t){this._satCache=t}setAcisData(t,e){this._acisData=t??"",e!=null&&(this._version=e),this.rebuildGeometryCaches()}setSabBytes(t){this._sabBytes=t&&t.length>0?t:void 0,this.rebuildGeometryCaches()}get sabBytes(){return this._sabBytes}rebuildGeometryCaches(){let t=new Float32Array(0);this._sabBytes&&this._sabBytes.length>0&&(t=H_(this._sabBytes)??new Float32Array(0)),t.length===0&&this._acisData&&(t=Z_(this._acisData)),this._wireframe=t,this._points=t.length>0?nx(t):ex(this._acisData)}get hasRenderableGeometry(){return this._wireframe.length>0||this._points.length>0}get geometricExtents(){return this._points.length===0?new H(new x(0,0,0),new x(0,0,0)):new H().setFromPoints(this._points)}subGetIntersectCurves(){const t=[];for(let e=0;e+5<this._wireframe.length;e+=6)t.push({kind:"line",line:new Bt({x:this._wireframe[e],y:this._wireframe[e+1],z:this._wireframe[e+2]},{x:this._wireframe[e+3],y:this._wireframe[e+4],z:this._wireframe[e+5]}),extent:"bounded",extendable:!1});return t}transformBy(t){if(this._points.forEach(e=>e.applyMatrix4(t)),this._wireframe.length>0){const e=new Float32Array(this._wireframe.length);for(let n=0;n<this._wireframe.length;n+=3){const r=new x(this._wireframe[n],this._wireframe[n+1],this._wireframe[n+2]);r.applyMatrix4(t),e[n]=r.x,e[n+1]=r.y,e[n+2]=r.z}this._wireframe=e}return this}subWorldDraw(t){if(this._wireframe.length>=6){const c=this._wireframe.length/3,l=new Uint16Array(c);for(let h=0;h<c;h++)l[h]=h;return t.lineSegments(this._wireframe,3,l)}if(this._points.length===0)return;const e=this.geometricExtents,n=e.min,r=e.max,s=[new x(n.x,n.y,n.z),new x(r.x,n.y,n.z),new x(r.x,r.y,n.z),new x(n.x,r.y,n.z),new x(n.x,n.y,r.z),new x(r.x,n.y,r.z),new x(r.x,r.y,r.z),new x(n.x,r.y,r.z)],a=new Float32Array(s.length*3);s.forEach((c,l)=>{a[l*3]=c.x,a[l*3+1]=c.y,a[l*3+2]=c.z});const o=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);return t.lineSegments(a,3,o)}dxfOutFields(t){super.dxfOutFields(t),t.writeSubclassMarker("AcDb3dSolid"),this._version!=null&&t.writeInt16(70,this._version),this._guid!=null&&t.writeString(2,this._guid),this._satCache!=null&&t.writeInt16(290,this._satCache?1:0);const e=255,n=this._acisData.split(`
|
|
7
7
|
`);for(let r=0;r<n.length;r++){const s=r===n.length-1;let a=n[r];for(;a.length>e;)t.writeString(3,a.slice(0,e)),a=a.slice(e);t.writeString(s?1:3,a)}return this}dxfInFields(t){super.dxfInFields(t),t.atSubclassData("AcDbModelerGeometry");const e=[];let n=this._version;for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const r=t.peekItem();if(!r)break;const s=Number(r.code);if(s===100){if(t.readItem(),String(r.value)==="AcDb3dSolid")continue;t.pushBackItem(r);break}t.readItem();const a=Number(r.value);switch(s){case 1:ku(e,1,String(r.value));break;case 3:ku(e,3,String(r.value));break;case 70:n=a;break;case 350:this._historyObjectSoftId=String(r.value);break;case 2:this._guid=String(r.value);break;case 290:this._satCache=a!==0;break}}return this.setAcisData(h_(e),n),this}};ch.typeName="3dSolid";let Mr=ch;var E=(i=>(i[i.EndPoint=1]="EndPoint",i[i.MidPoint=2]="MidPoint",i[i.Center=3]="Center",i[i.Node=4]="Node",i[i.Quadrant=5]="Quadrant",i[i.Intersection=6]="Intersection",i[i.Insertion=7]="Insertion",i[i.Perpendicular=8]="Perpendicular",i[i.Tangent=9]="Tangent",i[i.Nearest=10]="Nearest",i[i.Centroid=11]="Centroid",i))(E||{});function rx(i){let t=0;for(const e of i)t|=1<<e-1;return t}function sx(i){const t=[];for(const e of Object.values(E)){if(typeof e!="number")continue;const n=1<<e-1;(i&n)!==0&&t.push(e)}return t}function ax(i,t){return i^1<<t-1}function ox(i,t){return(i&1<<t-1)!==0}const lh=class lh extends st{getOffsetSideAtPoint(t){return 1}};lh.typeName="Curve";let Ot=lh;function Et(i,t){for(const e of i)Number.isInteger(e)&&e>=0&&t(e)}function le(i,t,e){Et(i,n=>{n===0&&e.add(t)})}function ur(i,t,e){const n=i[t];n&&(n.x+=e.x,n.y+=e.y)}function qi(i,t,e){Et(i,n=>{const r=e[n];r&&r.add(t)})}function cx(i){if(typeof i!="string")return{objectId:i,occurrence:0};const t=/^(.*)#(\d+)$/.exec(i);return t?{objectId:t[1],occurrence:Number(t[2])}:{objectId:i,occurrence:0}}function Lu(i,t){const e=i.x-t.x,n=i.y-t.y,r=(i.z||0)-(t.z||0);return e*e+n*n+r*r}function me(i,t){if(t.length===0)return;let e=new x(t[0].x,t[0].y,t[0].z||0),n=Lu(i,e);for(let r=1;r<t.length;r++){const s=t[r],a=new x(s.x,s.y,s.z||0),o=Lu(i,a);o<n&&(e=a,n=o)}return e}function Ki(i,t,e,n,r){const s=new x(i.x,i.y,i.z||0),a=new x(t.x,t.y,t.z||0),o=new Bt(s,a);switch(e){case E.EndPoint:r.push(s,a);break;case E.MidPoint:r.push(o.midPoint);break;case E.Nearest:r.push(o.nearestPoint(n));break;case E.Perpendicular:r.push(o.perpPoint(n));break}}function Cr(i,t,e,n,r,s,a){if(e){const o=new tt(i,t,e);switch(r){case E.EndPoint:a.push(new x(o.startPoint.x,o.startPoint.y,n),new x(o.endPoint.x,o.endPoint.y,n));break;case E.MidPoint:a.push(new x(o.midPoint.x,o.midPoint.y,n));break;case E.Nearest:{const c=o.nearestPoint({x:s.x,y:s.y});a.push(new x(c.x,c.y,n));break}case E.Perpendicular:{o.perpendicularPoints({x:s.x,y:s.y}).forEach(l=>a.push(new x(l.x,l.y,n)));break}case E.Tangent:{o.tangentPoints({x:s.x,y:s.y}).forEach(l=>a.push(new x(l.x,l.y,n)));break}}return}Ki(new x(i.x,i.y,n),new x(t.x,t.y,n),r,s,a)}function uo(i,t,e,n,r){if(i.length!==0)switch(e){case E.EndPoint:i.forEach(s=>r.push(new x(s.x,s.y,s.z||0)));break;case E.MidPoint:case E.Nearest:case E.Perpendicular:{const s=i.length,a=[];for(let o=0;o<s;o++){const c=[];Ki(i[o],i[(o+1)%i.length],e,n,c),a.push(...c)}if(e===E.MidPoint)r.push(...a);else{const o=me(n,a);o&&r.push(o)}break}}}const Qn=new A,hs=new A,Mu=new x,ja=class ja extends Ot{constructor(t,e,n,r,s=A.Z_AXIS){if(super(),this._geoData=null,this._thickness=0,t!==void 0&&e!==void 0&&n!==void 0&&r!==void 0){const a=ki(s);this._geo=new _t(t,e,n,r,s,a)}}get dxfTypeName(){return"ARC"}get _geo(){return this._geoData==null&&(this._geoData=new _t(new x,1,0,Math.PI/2,A.Z_AXIS,A.X_AXIS)),this._geoData}set _geo(t){this._geoData=t}get center(){return this._geo.center}set center(t){this._geo.center=t}get radius(){return this._geo.radius}set radius(t){this._geo.radius=t}get startAngle(){return this._geo.startAngle}set startAngle(t){this._geo.startAngle=t}get endAngle(){return this._geo.endAngle}set endAngle(t){this._geo.endAngle=t}get normal(){return this._geo.normal}set normal(t){this.setNormalAndRefVec(t)}get thickness(){return this._thickness}set thickness(t){this._thickness=t}get startPoint(){return this._geo.startPoint}get endPoint(){return this._geo.endPoint}get midPoint(){return this._geo.midPoint}get geometricExtents(){return this._geo.box}subGetIntersectCurves(){return[{kind:"circArc",arc:this._geo.clone(),extendable:!this.closed}]}get closed(){return this._geo.closed}get area(){return this._geo.area}get properties(){return{type:this.type,groups:[this.getGeneralProperties(),{groupName:"geometry",properties:[{name:"centerX",type:"float",editable:!0,accessor:{get:()=>this.center.x,set:t=>{this.center.x=t}}},{name:"centerY",type:"float",editable:!0,accessor:{get:()=>this.center.y,set:t=>{this.center.y=t}}},{name:"centerZ",type:"float",editable:!0,accessor:{get:()=>this.center.z,set:t=>{this.center.z=t}}},{name:"radius",type:"float",editable:!0,accessor:{get:()=>this.radius,set:t=>{this.radius=t}}},{name:"startAngle",type:"float",editable:!0,accessor:{get:()=>this.startAngle,set:t=>{this.startAngle=t}}},{name:"endAngle",type:"float",editable:!0,accessor:{get:()=>this.endAngle,set:t=>{this.endAngle=t}}},{name:"normalX",type:"float",editable:!0,accessor:{get:()=>this.normal.x,set:t=>{this.normal.x=t}}},{name:"normalY",type:"float",editable:!0,accessor:{get:()=>this.normal.y,set:t=>{this.normal.y=t}}},{name:"normalZ",type:"float",editable:!0,accessor:{get:()=>this.normal.z,set:t=>{this.normal.z=t}}},{name:"arcLength",type:"float",editable:!1,accessor:{get:()=>this._geo.length}},{name:"totalAngle",type:"float",editable:!1,accessor:{get:()=>O.radToDeg(Math.abs(this._geo.deltaAngle))}},{name:"area",type:"float",editable:!1,accessor:{get:()=>this.area}}]}]}}subGetGripPoints(){const t=new Array;return t.push(this.center),t.push(this.startPoint),t.push(this.endPoint),t}subMoveGripPointsAt(t,e){return Et(t,n=>{this.moveGripAt(n,e)}),this}subGetOsnapPoints(t,e,n,r){const s=this.startPoint,a=this.endPoint;switch(t){case E.EndPoint:r.push(s),r.push(a);break;case E.MidPoint:r.push(this.midPoint);break;case E.Center:case E.Centroid:r.push(this._geo.center);break;case E.Quadrant:{const o=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const c of o)O.isBetweenAngle(c,this.startAngle,this.endAngle)&&r.push(this._geo.getPointAtAngle(c));break}case E.Nearest:{const o=this._geo.nearestPoint(e);r.push(o)}break;case E.Perpendicular:{const o=this._geo.perpendicularPoints(e),c=me(e,o);c&&r.push(c);break}case E.Tangent:{const o=this._geo.tangentPoints(e);r.push(...o);break}}}transformBy(t){return this._geo.transform(t),this}get directBatchPrimitive(){return"lineStrip"}subWorldDraw(t){return t.circularArc(this._geo)}dxfOutFields(t){super.dxfOutFields(t);const e=Zt(this.center,this.normal);return t.writeSubclassMarker("AcDbCircle"),this.thickness!==0&&t.writeDouble(39,this.thickness),t.writePoint3d(10,e),t.writeDouble(40,this.radius),t.writeVector3d(210,this.normal),t.writeSubclassMarker("AcDbArc"),t.writeAngle(50,qe(this.center,this.startPoint,this.normal)),t.writeAngle(51,qe(this.center,this.endPoint,this.normal)),this}dxfInFields(t){var d;super.dxfInFields(t);let e=0,n=0,r=0,s=this.radius,a=O.radToDeg(this.startAngle),o=O.radToDeg(this.endAngle),c=this.normal.x,l=this.normal.y,h=this.normal.z;const u=g=>{for(;!t.atEndOfObject&&!t.atEof&&!t.atExtendedData;){const f=t.readItem();if(!f)break;const p=Number(f.code);if(g&&p===100)return t.pushBackItem(f),!0;const m=Number(f.value);switch(p){case 10:e=m;break;case 20:n=m;break;case 30:r=m;break;case 40:s=m;break;case 39:this.thickness=m;break;case 50:a=m;break;case 51:o=m;break;case 210:c=m;break;case 220:l=m;break;case 230:h=m;break}}return!1};return t.atSubclassData("AcDbCircle")&&u(!0),(t.atSubclassData("AcDbArc")||!t.peekItem()||Number((d=t.peekItem())==null?void 0:d.code)!==100)&&u(!1),this.applyDxfInGeometry(e,n,r,s,a,o,c,l,h),this}applyDxfInGeometry(t,e,n,r,s,a,o,c,l){Qn.set(o,c,l),Qn.lengthSq()>0&&Qn.normalize(),Os(hs,Qn),pl(Mu,{x:t,y:e,z:n},Qn),this._geo=new _t(Mu,r,O.degToRad(s),O.degToRad(a),Qn,hs)}setNormalAndRefVec(t){this._geo.normal=t,Os(hs,this._geo.normal),this._geo.refVec=hs}getOffsetCurves(t){const e=this.createOffsetCurve(t);return e?[e]:[]}getOffsetSideAtPoint(t){const e=this.center,n=this.radius;return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)>=n?1:-1}moveGripAt(t,e){switch(t){case 0:this.transformBy(z.makeTranslation(e));break;case 1:{const n=this._geo.startPoint;this._geo.startAngle=qe(this._geo.center,{x:n.x+e.x,y:n.y+e.y,z:(n.z??0)+(e.z??0)},this._geo.normal);break}case 2:{const n=this._geo.endPoint;this._geo.endAngle=qe(this._geo.center,{x:n.x+e.x,y:n.y+e.y,z:(n.z??0)+(e.z??0)},this._geo.normal);break}}}createOffsetCurve(t){const e=this._geo.offset(t);return e?new ja(e.center,e.radius,e.startAngle,e.endAngle,e.normal):null}};ja.typeName="Arc";let Or=ja;const lx=1,hx=/\\[fF][^\\|{}]*(?:\|[^;\\|{}]*)*;./i,ux=/\\[fF][^\\|{}]*(?:\|[^;\\|{}]*)*;./gi;function Dl(i){return i.replace(/\\[PpNn]/g,`
|
|
8
8
|
`).replace(/\\[A-Za-z][^;]*;/g,"").replace(/[{}]/g,"")}function dx(i){return i.replace(/\\/g,"\\\\").replace(/([{}])/g,"\\$1")}function gx(i){return i.replace(/\\[PpNn]/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbEntity.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,SAAS,EAET,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,wBAAwB,EAC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S,CAAA;IAE1C;;;;;OAKG;IACH,KAAK;IAIL;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAY,CACnB,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,OAAO,GACd,UAAU,GAAG,SAAS;IAEzB;;;;;;;;;;OAUG;IACH,IAAI,oBAAoB,IAAI,wBAAwB,GAAG,IAAI,CAE1D;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS;IA6B1E;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,oBAAoB,IAAI,uBAAuB;IAmFzD;;;;;;;;;;;;OAYG;IACH,IAAI,SAAS,IAAI,aAAa,CAc7B;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,WAAW;IA2BnB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,aAAa;IAYvB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;CAUzB"}
|
package/lib/entity/AcDbEntity.js
CHANGED
|
@@ -862,6 +862,11 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
862
862
|
return undefined;
|
|
863
863
|
}
|
|
864
864
|
var traits = renderer.subEntityTraits;
|
|
865
|
+
// Keep `color` resolved (the layer swatch is what actually gets drawn), but
|
|
866
|
+
// record whether it was authored ByLayer. The two are indistinguishable
|
|
867
|
+
// afterwards — ByLayer on an ACI-7 layer also resolves to an absolute ACI 7
|
|
868
|
+
// — and INSERT layer-0 inheritance depends on telling them apart.
|
|
869
|
+
traits.isColorByLayer = this.color.isByLayer;
|
|
865
870
|
traits.color = this.resolvedColor;
|
|
866
871
|
traits.lineType = this.lineStyle;
|
|
867
872
|
traits.lineTypeScale = this.linetypeScale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbEntity.js","sourceRoot":"","sources":["../../src/entity/AcDbEntity.ts"],"names":[],"mappings":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nB,CAAmB;IA4iCpC,iBAAC;CAAA,AA9iCD,CAAyC,UAAU,GA8iClD;SA9iCqB,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/data-model",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"uid": "^2.0.2",
|
|
42
|
-
"@mlightcad/
|
|
43
|
-
"@mlightcad/
|
|
44
|
-
"@mlightcad/graphic-interface": "3.15.
|
|
45
|
-
"@mlightcad/
|
|
42
|
+
"@mlightcad/common": "1.15.20",
|
|
43
|
+
"@mlightcad/emf-converter": "1.15.20",
|
|
44
|
+
"@mlightcad/graphic-interface": "3.15.20",
|
|
45
|
+
"@mlightcad/geometry-engine": "3.15.20"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"analyze": "pnpm run analyze:lib",
|