@mlightcad/cad-simple-viewer-cli 1.5.11 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +139 -139
- package/dist-runner/assets/cad-html-plugin-k7CVaAuj.js +675 -0
- package/dist-runner/assets/{cad-pdf-plugin-BK4sGA5p.js → cad-pdf-plugin-CqZVmSm2.js} +2 -2
- package/dist-runner/assets/{cad-svg-plugin-pfRr575l.js → cad-svg-plugin-BvSmrelr.js} +7 -7
- package/dist-runner/assets/{index-rDY9i-tf.js → index-BvxDFe8e.js} +356 -224
- package/dist-runner/index.html +12 -12
- package/dist-runner/viewer-runtime.iife.js +271 -154
- package/dist-runner/workers/libredwg-parser-worker.js +25 -7515
- package/dist-runner/workers/libredwg-web.wasm +0 -0
- package/examples/batch-export-html.mjs +105 -105
- package/examples/batch-export-png.mjs +103 -103
- package/examples/create-drawing-dxf.scr +15 -15
- package/examples/create-drawing-png.scr +19 -19
- package/examples/create-shapes-dxf.scr +17 -17
- package/examples/export-dxf.scr +5 -5
- package/examples/export-html.scr +9 -9
- package/examples/export-png.scr +9 -9
- package/examples/freeze-layer-png.scr +15 -15
- package/examples/index.json +87 -87
- package/package.json +7 -7
- package/dist-runner/assets/cad-html-plugin-Bu0XYtd-.js +0 -477
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import{y as Ee,z as Ne,u as Ct,h as v,v as dt,w as B,c as Ze,a as D,b as Ye,t as Xe,k as Ge,i as We,n as Ke,T as ee,f as Je,E as ne,d as qe,L as Qe,e as tn,M as en,g as Ot,j as nn,l as rn,S as an,m as on,A as ln,o as sn,p as cn,q as dn,r as _t,s as un,x as fn,B as mn,C as pn,D as hn,F as gn,G as wn,H as yn,I as vn,J as bn,K as xn,N as An,O as kn,P as Mn,Q as Cn,R as Ln,U as Sn,V as zn,W as Pn,X as R,Y as yt,Z as Pe,_ as In,$ as vt,a0 as Bn,a1 as Un,a2 as $n,a3 as jn}from"./index-rDY9i-tf.js";import{a4 as Ka,a5 as Ja}from"./index-rDY9i-tf.js";const ft=2;var P=Uint8Array,z=Uint16Array,Et=Int32Array,Nt=new P([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Zt=new P([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),re=new P([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ie=function(t,e){for(var n=new z(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var a=new Et(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return{b:n,r:a}},Be=Ie(Nt,2),Tn=Be.b,Ut=Be.r;Tn[28]=258,Ut[258]=28;var Hn=Ie(Zt,0),ae=Hn.r,$t=new z(32768);for(var y=0;y<32768;++y){var G=(y&43690)>>1|(y&21845)<<1;G=(G&52428)>>2|(G&13107)<<2,G=(G&61680)>>4|(G&3855)<<4,$t[y]=((G&65280)>>8|(G&255)<<8)>>1}var ut=(function(t,e,n){for(var r=t.length,a=0,i=new z(e);a<r;++a)t[a]&&++i[t[a]-1];var o=new z(e);for(a=1;a<e;++a)o[a]=o[a-1]+i[a-1]<<1;var l;if(n){l=new z(1<<e);var s=15-e;for(a=0;a<r;++a)if(t[a])for(var c=a<<4|t[a],d=e-t[a],u=o[t[a]-1]++<<d,f=u|(1<<d)-1;u<=f;++u)l[$t[u]>>s]=c}else for(l=new z(r),a=0;a<r;++a)t[a]&&(l[a]=$t[o[t[a]-1]++]>>15-t[a]);return l}),J=new P(288);for(var y=0;y<144;++y)J[y]=8;for(var y=144;y<256;++y)J[y]=9;for(var y=256;y<280;++y)J[y]=7;for(var y=280;y<288;++y)J[y]=8;var pt=new P(32);for(var y=0;y<32;++y)pt[y]=5;var Fn=ut(J,9,0),Dn=ut(pt,5,0),Ue=function(t){return(t+7)/8|0},$e=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new P(t.subarray(e,n))},Z=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},st=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},Lt=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var a=n.length,i=n.slice();if(!a)return{t:Te,l:0};if(a==1){var o=new P(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(I,j){return I.f-j.f}),n.push({s:-1,f:25001});var l=n[0],s=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:l.f+s.f,l,r:s};d!=a-1;)l=n[n[c].f<n[u].f?c++:u++],s=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:l.f+s.f,l,r:s};for(var f=i[0].s,r=1;r<a;++r)i[r].s>f&&(f=i[r].s);var p=new z(f+1),g=jt(n[d-1],p,0);if(g>e){var r=0,m=0,x=g-e,V=1<<x;for(i.sort(function(j,C){return p[C.s]-p[j.s]||j.f-C.f});r<a;++r){var N=i[r].s;if(p[N]>e)m+=V-(1<<g-p[N]),p[N]=e;else break}for(m>>=x;m>0;){var W=i[r].s;p[W]<e?m-=1<<e-p[W]++-1:++r}for(;r>=0&&m;--r){var $=i[r].s;p[$]==e&&(--p[$],++m)}g=e}return{t:new P(p),l:g}},jt=function(t,e,n){return t.s==-1?Math.max(jt(t.l,e,n+1),jt(t.r,e,n+1)):e[t.s]=n},ie=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new z(++e),r=0,a=t[0],i=1,o=function(s){n[r++]=s},l=1;l<=e;++l)if(t[l]==a&&l!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=t[l]}return{c:n.subarray(0,r),n:e}},ct=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},je=function(t,e,n){var r=n.length,a=Ue(e+2);t[a]=r&255,t[a+1]=r>>8,t[a+2]=t[a]^255,t[a+3]=t[a+1]^255;for(var i=0;i<r;++i)t[a+i+4]=n[i];return(a+4+r)*8},oe=function(t,e,n,r,a,i,o,l,s,c,d){Z(e,d++,n),++a[256];for(var u=Lt(a,15),f=u.t,p=u.l,g=Lt(i,15),m=g.t,x=g.l,V=ie(f),N=V.c,W=V.n,$=ie(m),I=$.c,j=$.n,C=new z(19),w=0;w<N.length;++w)++C[N[w]&31];for(var w=0;w<I.length;++w)++C[I[w]&31];for(var h=Lt(C,7),L=h.t,q=h.l,S=19;S>4&&!L[re[S-1]];--S);var Q=c+5<<3,T=ct(a,J)+ct(i,pt)+o,H=ct(a,f)+ct(i,m)+o+14+3*S+ct(C,L)+2*C[16]+3*C[17]+7*C[18];if(s>=0&&Q<=T&&Q<=H)return je(e,d,t.subarray(s,s+c));var O,A,F,X;if(Z(e,d,1+(H<T)),d+=2,H<T){O=ut(f,p,0),A=f,F=ut(m,x,0),X=m;var xt=ut(L,q,0);Z(e,d,W-257),Z(e,d+5,j-1),Z(e,d+10,S-4),d+=14;for(var w=0;w<S;++w)Z(e,d+3*w,L[re[w]]);d+=3*S;for(var _=[N,I],lt=0;lt<2;++lt)for(var tt=_[lt],w=0;w<tt.length;++w){var E=tt[w]&31;Z(e,d,xt[E]),d+=L[E],E>15&&(Z(e,d,tt[w]>>5&127),d+=tt[w]>>12)}}else O=Fn,A=J,F=Dn,X=pt;for(var w=0;w<l;++w){var k=r[w];if(k>255){var E=k>>18&31;st(e,d,O[E+257]),d+=A[E+257],E>7&&(Z(e,d,k>>23&31),d+=Nt[E]);var et=k&31;st(e,d,F[et]),d+=X[et],et>3&&(st(e,d,k>>5&8191),d+=Zt[et])}else st(e,d,O[k]),d+=A[k]}return st(e,d,O[256]),d+A[256]},Rn=new Et([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Te=new P(0),Vn=function(t,e,n,r,a,i){var o=i.z||t.length,l=new P(r+o+5*(1+Math.ceil(o/7e3))+a),s=l.subarray(r,l.length-a),c=i.l,d=(i.r||0)&7;if(e){d&&(s[0]=i.r>>3);for(var u=Rn[e-1],f=u>>13,p=u&8191,g=(1<<n)-1,m=i.p||new z(32768),x=i.h||new z(g+1),V=Math.ceil(n/3),N=2*V,W=function(Mt){return(t[Mt]^t[Mt+1]<<V^t[Mt+2]<<N)&g},$=new Et(25e3),I=new z(288),j=new z(32),C=0,w=0,h=i.i||0,L=0,q=i.w||0,S=0;h+2<o;++h){var Q=W(h),T=h&32767,H=x[Q];if(m[T]=H,x[Q]=T,q<=h){var O=o-h;if((C>7e3||L>24576)&&(O>423||!c)){d=oe(t,s,0,$,I,j,w,L,S,h-S,d),L=C=w=0,S=h;for(var A=0;A<286;++A)I[A]=0;for(var A=0;A<30;++A)j[A]=0}var F=2,X=0,xt=p,_=T-H&32767;if(O>2&&Q==W(h-_))for(var lt=Math.min(f,O)-1,tt=Math.min(32767,h),E=Math.min(258,O);_<=tt&&--xt&&T!=H;){if(t[h+F]==t[h+F-_]){for(var k=0;k<E&&t[h+k]==t[h+k-_];++k);if(k>F){if(F=k,X=_,k>lt)break;for(var et=Math.min(_,k-2),Jt=0,A=0;A<et;++A){var At=h-_+A&32767,_e=m[At],qt=At-_e&32767;qt>Jt&&(Jt=qt,H=At)}}}T=H,H=m[T],_+=T-H&32767}if(X){$[L++]=268435456|Ut[F]<<18|ae[X];var Qt=Ut[F]&31,te=ae[X]&31;w+=Nt[Qt]+Zt[te],++I[257+Qt],++j[te],q=h+F,++C}else $[L++]=t[h],++I[t[h]]}}for(h=Math.max(h,q);h<o;++h)$[L++]=t[h],++I[t[h]];d=oe(t,s,c,$,I,j,w,L,S,h-S,d),c||(i.r=d&7|s[d/8|0]<<3,d-=7,i.h=x,i.p=m,i.i=h,i.w=q)}else{for(var h=i.w||0;h<o+c;h+=65535){var kt=h+65535;kt>=o&&(s[d/8|0]=c,kt=o),d=je(s,d+1,t.subarray(h,kt))}i.i=o}return $e(l,0,r+Ue(d)+a)},On=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t})(),_n=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=On[n&255^e[r]]^n>>>8;t=n},d:function(){return~t}}},En=function(t,e,n,r,a){if(!a&&(a={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new P(i.length+t.length);o.set(i),o.set(t,i.length),t=o,a.w=i.length}return Vn(t,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,a)},Tt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Nn=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Tt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},Zn=function(t){return 10+(t.filename?t.filename.length+1:0)};function Yn(t,e){e||(e={});var n=_n(),r=t.length;n.p(t);var a=En(t,e,Zn(e),8),i=a.length;return Nn(a,e),Tt(a,i-8,n.d()),Tt(a,i-4,r),a}var le=typeof TextEncoder<"u"&&new TextEncoder,Xn=typeof TextDecoder<"u"&&new TextDecoder,Gn=0;try{Xn.decode(Te,{stream:!0}),Gn=1}catch{}function Wn(t,e){var n;if(le)return le.encode(t);for(var r=t.length,a=new P(t.length+(t.length>>1)),i=0,o=function(d){a[i++]=d},n=0;n<r;++n){if(i+5>a.length){var l=new P(i+8+(r-n<<1));l.set(a),a=l}var s=t.charCodeAt(n);s<128||e?o(s):s<2048?(o(192|s>>6),o(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|t.charCodeAt(++n)&1023,o(240|s>>18),o(128|s>>12&63),o(128|s>>6&63),o(128|s&63)):(o(224|s>>12),o(128|s>>6&63),o(128|s&63))}return $e(a,0,i)}const Kn="gzip";function Jn(t){return{bytes:Yn(t),compression:Kn}}const qn=1480934209,se=1,ce=2,de=4,ue=8,fe=1,me=2,pe=4,he=8,ge=16,Qn=32;function tr(t){if(t.version!==ft)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=new ar;e.writeU32(qn),e.writeU8(ft),e.writeU8(0),e.writeU8(0),e.writeU8(0),e.writeJson(t.meta),e.writeJson(t.layers),e.writeString(t.activeLayoutBtrId),e.writeU32(t.layouts.length);for(const n of t.layouts)er(e,n);return e.toUint8Array()}function er(t,e){t.writeString(e.btrId),t.writeString(e.name),t.writeU8(e.isModelSpace?1:0),t.writeJson(e.osnap??null),t.writeU32(e.lineBatches.length);for(const n of e.lineBatches)nr(t,n);t.writeU32(e.meshBatches.length);for(const n of e.meshBatches)rr(t,n)}function nr(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let n=0;e.indices&&e.indices.length>0&&(n|=se),e.linePattern&&(n|=ce),e.lineDistances&&e.lineDistances.length>0&&(n|=de),e.lineWidth!=null&&e.lineWidth>0&&(n|=ue),t.writeU8(n),n&se&&t.writeUint32Array(e.indices),n&ce&&t.writeJson(e.linePattern),n&de&&t.writeFloat32Array(e.lineDistances),n&ue&&t.writeF32(e.lineWidth)}function rr(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let n=0;e.indices&&e.indices.length>0&&(n|=fe),e.hatchPattern&&(n|=me),e.gradientFill&&(n|=pe),e.gradientPositions&&e.gradientPositions.length>0&&(n|=he),e.side!=null&&(n|=ge),e.points&&(n|=Qn),t.writeU8(n),n&fe&&t.writeUint32Array(e.indices),n&me&&t.writeJson(e.hatchPattern),n&pe&&t.writeJson(e.gradientFill),n&he&&t.writeFloat32Array(e.gradientPositions),n&ge&&t.writeU8(e.side)}class ar{constructor(){this.chunks=[],this.length=0}writeU8(e){const n=new Uint8Array(1);n[0]=e&255,this.chunks.push(n),this.length+=1}writeU32(e){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,e>>>0,!0),this.chunks.push(n),this.length+=4}writeF32(e){const n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,e,!0),this.chunks.push(n),this.length+=4}writeF64(e){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,e,!0),this.chunks.push(n),this.length+=8}writeBytes(e){this.chunks.push(e),this.length+=e.length}writeString(e){const n=Wn(e);this.writeU32(n.length),this.writeBytes(n)}writeJson(e){this.writeString(JSON.stringify(e))}writeFloat32Array(e){this.alignTo(4);const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(n.length),this.writeBytes(n)}writeUint32Array(e){this.alignTo(4);const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(n.length),this.writeBytes(n)}alignTo(e){const n=this.length%e;if(n===0)return;const r=e-n;for(let a=0;a<r;a++)this.writeU8(0)}toUint8Array(){const e=new Uint8Array(this.length);let n=0;for(const r of this.chunks)e.set(r,n),n+=r.length;return e}}const ir="application/vnd.mlightcad.acex-snapshot+binary";function or(t){if(t.version!==ft)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=tr(t),n=Jn(e);return{payload:sr(n.bytes),compression:n.compression}}function lr(){return ir}function sr(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function ot(t,e,n){if(n<=0)return new Float32Array(0);const r=new Float32Array(n);for(let a=0;a<n;a++)r[a]=t[e+a];return r}function cr(t,e,n){if(n<=0)return new Uint32Array(0);const r=new Uint32Array(n);for(let a=0;a<n;a++)r[a]=t[e+a];return r}function He(t,e){if(e.length===0)return{positions:t,indices:e};let n=0;for(let a=0;a<e.length;a++){const i=e[a];i>n&&(n=i)}const r=(n+1)*3;return r>=t.length?{positions:t,indices:e}:{positions:ot(t,0,r),indices:e}}function we(t,e){return t+e}const nt={x:0,y:0,z:0};function dr(t){t.updateMatrixWorld(!0);const e=t.matrixWorld.elements;return nt.x=e[12],nt.y=e[13],nt.z=e[14],[nt.x,nt.y,nt.z]}function ur(t,e){const n=e.elements,r=t.positions;if(r.length===0)return{positions:new Float32Array(0),indices:t.indices};const a=new Float32Array(r.length);for(let i=0;i<r.length;i+=3){const o=r[i],l=r[i+1],s=r[i+2];a[i]=n[0]*o+n[4]*l+n[8]*s+n[12],a[i+1]=n[1]*o+n[5]*l+n[9]*s+n[13],a[i+2]=n[2]*o+n[6]*l+n[10]*s+n[14]}return{positions:a,indices:t.indices?new Uint32Array(t.indices):void 0}}function fr(t){const e=t.positions;if(e.length<3)return{slice:t,offset:[0,0,0]};let n=1/0,r=1/0,a=1/0,i=-1/0,o=-1/0,l=-1/0;for(let d=0;d<e.length;d+=3){const u=e[d],f=e[d+1],p=e[d+2];n=Math.min(n,u),r=Math.min(r,f),a=Math.min(a,p),i=Math.max(i,u),o=Math.max(o,f),l=Math.max(l,p)}const s=[(n+i)/2,(r+o)/2,(a+l)/2],c=new Float32Array(e.length);for(let d=0;d<e.length;d+=3)c[d]=e[d]-s[0],c[d+1]=e[d+1]-s[1],c[d+2]=e[d+2]-s[2];return{slice:{positions:c,indices:t.indices?new Uint32Array(t.indices):void 0},offset:s}}function mr(t,e,n={}){t.updateMatrixWorld(!0);const r=ur(e,t.matrixWorld);return n.preserveWorldSpaceForPatternFill?{slice:r,offset:[0,0,0]}:fr(r)}function Yt(t){const e=t;if(e.isShaderMaterial===!0||t.type==="ShaderMaterial")return e}function pr(t){var e;const n=Yt(t);if(!n)return;const r=n.uniforms.pattern,a=n.uniforms.patternLength;if(!r||!a)return;const i=r.value;if(!(!Array.isArray(i)||i.length===0))return{pattern:[...i],patternLength:Number(a.value),viewportScale:Number(((e=n.uniforms.u_viewportScale)==null?void 0:e.value)??1)}}function hr(t){var e;const n=Yt(t);if(!n)return;const r=n.uniforms.u_patternLines;if(!r)return;const a=r.value;if(!(!Array.isArray(a)||a.length===0))return{patternAngle:Number(((e=n.uniforms.u_patternAngle)==null?void 0:e.value)??0),patternLines:a.map(wr)}}function gr(t){var e,n,r,a,i;const o=Yt(t);if(!o||o.uniforms.u_patternLines)return;const l=(e=o.uniforms.u_startColor)==null?void 0:e.value,s=(n=o.uniforms.u_endColor)==null?void 0:n.value,c=o.uniforms.u_gradientType;if(!(!(l!=null&&l.getHex)||c==null))return{startColor:l.getHex(),endColor:((r=s==null?void 0:s.getHex)==null?void 0:r.call(s))??l.getHex(),angle:Number(((a=o.uniforms.u_angle)==null?void 0:a.value)??0),shift:Number(((i=o.uniforms.u_shift)==null?void 0:i.value)??0),gradientType:Number(c.value)}}function wr(t){return{angle:t.angle,base:[t.base.x,t.base.y],offset:[t.offset.x,t.offset.y],dashLengths:[...t.dashLengths],patternLength:t.patternLength}}function Fe(t){const e=t.length/3;if(e<2)return new Float32Array(0);const n=new Float32Array(e);for(let r=0;r<e;r+=2){r===0?n[r]=0:n[r]=n[r-1];const a=t[r*3],i=t[r*3+1],o=t[r*3+2]??0,l=t[(r+1)*3],s=t[(r+1)*3+1],c=t[(r+1)*3+2]??0,d=l-a,u=s-i,f=c-o;n[r+1]=n[r]+Math.sqrt(d*d+u*u+f*f)}return n}function yr(t,e){const n=t.getAttribute(e);if(!n||n.count===0)return;const r=n.itemSize;if(t.getIndex()){const d=n.array;return ot(d,0,n.count*r)}const a=t.drawRange,i=n.count,o=Math.max(0,Math.min(Math.floor(a.start),i)),l=Math.max(0,i-o),s=!Number.isFinite(a.count)||a.count<=0?l:Math.min(Math.floor(a.count),l);if(s<=0)return;const c=n.array;return ot(c,o*r,s*r)}function vr(t,e){const n=Math.atan2(e[1],e[0]),r=(i,o)=>[e[0]*i+e[4]*o+e[12],e[1]*i+e[5]*o+e[13]],a=(i,o)=>[e[0]*i+e[4]*o,e[1]*i+e[5]*o];return{patternAngle:t.patternAngle+n,patternLines:t.patternLines.map(i=>({angle:i.angle+n,base:r(i.base[0],i.base[1]),offset:a(i.offset[0],i.offset[1]),dashLengths:[...i.dashLengths],patternLength:i.patternLength}))}}function Ht(t,e){return!Number.isFinite(t)||t<0?0:Math.min(Math.floor(t),e)}function Ft(t,e,n){const r=Math.max(0,e-n);return!Number.isFinite(t)||t<=0?r:Math.min(Math.floor(t),r)}function ye(t){const e=t.getAttribute("position");if(!e)return{positions:new Float32Array(0)};const n=t.drawRange,r=e.array,a=e.itemSize,i=t.getIndex();if(i){const s=ot(r,0,e.count*a),c=i.array,d=Ht(n.start,i.count),u=Ft(n.count,i.count,d),f=cr(c,d,u);return He(s,f)}const o=Ht(n.start,e.count),l=Ft(n.count,e.count,o);return{positions:ot(r,o*a,l*a)}}function Dt(t){return Sn(t.flags)&&zn(t.flags)}function Xt(t,e){const n=e.getAttribute("position");if(!n)return{positions:new Float32Array(0)};const r=n.itemSize,a=n.array,i=e.getIndex(),{count:o}=t.mappingStats;if(i){const s=ot(a,0,n.count*r),c=i.array,d=[];for(let u=0;u<o;u++){let f;try{f=t.getGeometryRangeAt(u)}catch{continue}const p=f.indexStart??0,g=f.indexCount??0;if(!(!Dt(f)||g<=0))for(let m=0;m<g;m++)d.push(c[p+m])}return d.length===0?{positions:new Float32Array(0)}:He(s,new Uint32Array(d))}const l=[];for(let s=0;s<o;s++){let c;try{c=t.getGeometryRangeAt(s)}catch{continue}if(!Dt(c)||c.vertexCount<=0)continue;const d=c.vertexStart*r,u=c.vertexCount*r;for(let f=0;f<u;f++)l.push(a[d+f])}return{positions:new Float32Array(l)}}function ht(t,e,n){t.push(e.getX(n),e.getY(n),e.getZ(n))}function br(t,e){const n=e.getAttribute("instanceStart"),r=e.getAttribute("instanceEnd");if(!n||!r)return{positions:new Float32Array(0)};const{count:a}=t.mappingStats,i=[];for(let o=0;o<a;o++){let l;try{l=t.getGeometryRangeAt(o)}catch{continue}if(!Dt(l)||l.vertexCount<=0)continue;const s=l.vertexStart,c=s+l.vertexCount;for(let d=s;d<c;d++)ht(i,n,d),ht(i,r,d)}return{positions:new Float32Array(i)}}function xr(t,e){const n=t.instanceCount;if(Number.isFinite(n)&&n>=0)return Math.min(Math.floor(n),e);const r=t.drawRange,a=Ht(r.start,e);return Ft(r.count,e,a)}function Ar(t){const e=t.getAttribute("instanceStart"),n=t.getAttribute("instanceEnd");if(!e||!n||e.count===0)return{positions:new Float32Array(0)};const r=xr(t,e.count);if(r<=0)return{positions:new Float32Array(0)};const a=[];for(let i=0;i<r;i++)ht(a,e,i),ht(a,n,i);return{positions:new Float32Array(a)}}function St(t){return nn(t)}function De(t){if(t instanceof on)return t.linewidth}function zt(t){if("material"in t){const e=t.userData.originalMaterial??t.material;return Array.isArray(e)?e[0]:e}return t.material}function it(t){var e;const n=rn(t),r=n.layer??"0",a=t;let i=a.color!=null?a.color.getHex():n.color??16777215;const o=pr(t),l=hr(t),s=gr(t);if(t instanceof an||t.type==="ShaderMaterial"){const c=(e=t.uniforms.u_color)==null?void 0:e.value;c!=null&&c.getHex?i=c.getHex():s&&(i=s.startColor)}return{color:i,layer:r,linePattern:o,hatchPattern:l,gradientFill:s,side:l||s?t.side:void 0}}function kr(t,e){if(!e)return;const n=t.userData.bakedWorldMatrix;return!n||n.length<16?e:vr(e,n)}function bt(t){return dr(t)}function Pt(t,e,n={}){const r=mr(t,e,n);return{...r.slice,offset:r.offset}}function Gt(t,e,n,r,a){const i=it(e),o=kr(n,i.hatchPattern),l=i.gradientFill?yr(t,"gradientPosition"):void 0;return{layer:i.layer,color:i.color,offset:a,hatchPattern:o,gradientFill:i.gradientFill,gradientPositions:l,side:i.side,...r}}function Mr(t){const e=br(t,t.geometry);if(e.positions.length===0)return;const{color:n,layer:r}=it(t.material),a=De(t.material);return{layer:r,color:n,offset:bt(t),lineWidth:a,...e}}function Cr(t){const e=Xt(t,t.geometry);if(e.positions.length===0)return;const{color:n,layer:r,linePattern:a}=it(t.material),i=a?Fe(e.positions):void 0;return{layer:r,color:n,offset:bt(t),linePattern:a,lineDistances:i,...e}}function Lr(t){const e=Xt(t,t.geometry);if(e.positions.length!==0)return Gt(t.geometry,t.material,t,e,bt(t))}function Sr(t){const e=Xt(t,t.geometry);if(e.positions.length!==0)return{points:!0,...Gt(t.geometry,t.material,t,e,bt(t))}}function ve(t){const e=[],n=[];return t.traverse(r=>{if(!(We(r)||Ke(r))){if(r instanceof ee){const a=Cr(r);a&&e.push(a);return}if(r instanceof Je){const a=Mr(r);a&&e.push(a);return}if(r instanceof ne){const a=Lr(r);a&&n.push(a);return}if(r instanceof qe){const a=Sr(r);a&&n.push(a);return}if(r instanceof Qe){if(!St(r))return;const a=Ar(r.geometry);if(a.positions.length===0)return;const i=zt(r),{color:o,layer:l}=it(i),{offset:s,...c}=Pt(r,a);e.push({layer:l,color:o,offset:s,lineWidth:De(i),...c})}else if(r instanceof tn&&!(r instanceof ee)){if(!St(r))return;const a=ye(r.geometry);if(a.positions.length===0)return;const i=zt(r),{color:o,layer:l,linePattern:s}=it(i),{offset:c,...d}=Pt(r,a),u=s?Fe(d.positions):void 0;e.push({layer:l,color:o,offset:c,linePattern:s,lineDistances:u,...d})}else if(r instanceof en&&!(r instanceof ne)){if(!St(r))return;const a=ye(r.geometry);if(a.positions.length===0)return;const i=zt(r),o=it(i),{offset:l,...s}=Pt(r,a,{preserveWorldSpaceForPatternFill:!!o.hatchPattern});n.push(Gt(r.geometry,i,r,s,l))}}}),{lineBatches:e,meshBatches:n}}function be(t,e){const n=t.extmin,r=t.extmax;return{title:e==null?void 0:e.title,extents:{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y},units:{insunits:t.insunits,lunits:t.lunits,luprec:t.luprec,aunits:t.aunits,auprec:t.auprec,measurement:t.measurement,ltscale:t.ltscale,angbase:t.angbase,angdir:t.angdir},background:(e==null?void 0:e.background)??0}}function Wt(t){return t.z>=0?1:-1}const zr=1e6;function b(t,e){const n=new R(e.x,e.y,e.z??0).applyMatrix4(t);return{x:n.x,y:n.y}}function Pr(t){const e=t.elements;return new Ot(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])}function gt(t,e){return new Ot().multiplyMatrices(t,Pr(e))}function Kt(t,e){const n=new R(e.x,e.y,e.z??0).transformDirection(t).normalize();return{x:n.x,y:n.y}}function Rt(t){const e=new R(t.elements[0],t.elements[1],t.elements[2]).length(),n=new R(t.elements[4],t.elements[5],t.elements[6]).length();return yt.equal(e,n,Pe*Math.max(e,n,1))}function Ir(t,e){const n=t.tables.blockTable.getIdAt(e);if(n)return n;for(const a of t.tables.blockTable.newIterator())if(a.objectId===e)return a;const r=t.tables.blockTable.modelSpace;if(r.objectId===e)return r}function Br(t){if(t instanceof Pn)return!0;const e=t;return(e.type==="LINE"||e.type==="Line")&&e.startPoint!=null&&e.endPoint!=null}function Ur(t,e,n,r){Y(t,e,n,r.startPoint,r.endPoint)}function Re(t,e){return t.blockTableRecord??(t.blockName?e.tables.blockTable.getAt(t.blockName):void 0)}function $r(t,e){const n=t.dimBlockId;return n?e.tables.blockTable.getAt(n):void 0}function jr(t,e){const n=Re(t,e);if(n)return n;const r=t.owningBlockRecordId;return r?e.tables.blockTable.getAt(r):void 0}function Ve(t){return t.getFullInsertionTransform()}function Tr(t){for(const e of t.newIterator())return!0;return!1}function Hr(t){return typeof t.getFullInsertionTransform=="function"&&"blockTableRecord"in t}function Y(t,e,n,r,a){const i=b(n,r),o=b(n,a),l={kind:"line",layer:e,x0:i.x,y0:i.y,x1:o.x,y1:o.y};t.push(l)}function xe(t,e,n,r,a,i){const o=b(n,r),l=Kt(n,a),s=Math.hypot(l.x,l.y)||1,c=l.x/s,d=l.y/s,u=zr,f=i?o.x-c*u:o.x,p=i?o.y-d*u:o.y,g=o.x+c*u,m=o.y+d*u;t.push({kind:"line",layer:e,x0:f,y0:p,x1:g,y1:m})}function K(t,e,n,r,a){if(r.length<2)return;const i=a?r.length:r.length-1;for(let o=0;o<i;o++)Y(t,e,n,r[o],r[(o+1)%r.length])}function Fr(t,e,n,r){const a=[r.startPosition];for(const i of r.segments)a.push(i.position);K(t,e,n,a,r.closed)}function Dr(t,e,n){if(n.vertices.length>=2)return n.vertices;if(n.vertices.length===0)return[];const r=n.vertices[0],a=e.lastLeaderLinePoint??e.landingPoint??t.landingPoint??t.contentBasePosition;if(!a)return n.vertices;const i=r.x-a.x,o=r.y-a.y,l=(r.z??0)-(a.z??0);return Math.hypot(i,o,l)<=Pe?n.vertices:[r,a]}function Rr(t,e,n,r){var a,i;for(const l of r.leaders)for(const s of l.leaderLines){const c=Dr(r,l,s);K(t,e,n,c,!1)}const o=l=>{if(!l)return;const s=b(n,l);t.push({kind:"point",layer:e,x:s.x,y:s.y})};o(r.contentBasePosition),o((a=r.mtextContent)==null?void 0:a.anchorPoint),o((i=r.blockContent)==null?void 0:i.position)}function Vr(t,e,n,r){const a=r.numberOfVertices;if(a<2)return;const i=r.elevation,o=r.closed?a:a-1;for(let l=0;l<o;l++){const s=r.getPointAt(l),c=r.getPointAt((l+1)%a),d=r.getBulgeAt(l),u={x:s.x,y:s.y,z:i},f={x:c.x,y:c.y,z:i};if(yt.isPositive(Math.abs(d))){const p=b(n,u),g=b(n,f),m=new vt(p,g,d),x=m.center;t.push({kind:"arc",layer:e,cx:x.x,cy:x.y,r:m.radius,startAngle:m.startAngle,endAngle:m.endAngle,normalSign:m.clockwise?-1:1})}else Y(t,e,n,u,f)}}function Or(t,e,n,r,a,i){const o=b(n,r),l=new R(n.elements[0],n.elements[1],n.elements[2]).length(),s={kind:"circle",layer:e,cx:o.x,cy:o.y,r:a*l,normalSign:Wt(i)};t.push(s)}function _r(t,e,n,r){const a=b(n,r.center),i=new R(n.elements[0],n.elements[1],n.elements[2]).length(),o={kind:"arc",layer:e,cx:a.x,cy:a.y,r:r.radius*i,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:Wt(r.normal)};t.push(o)}function It(t,e,n,r){const a=b(n,r.center),i=r._geo,o=(i==null?void 0:i.majorAxis)??{x:1,y:0,z:0},l=Kt(n,o),s=Math.hypot(l.x,l.y)||1,c=new R(n.elements[0],n.elements[1],n.elements[2]).length(),d=new R(n.elements[4],n.elements[5],n.elements[6]).length(),u={kind:"ellipse",layer:e,cx:a.x,cy:a.y,majorX:l.x/s,majorY:l.y/s,majorR:r.majorAxisRadius*c,minorR:r.minorAxisRadius*d,startAngle:r.startAngle,endAngle:r.endAngle,closed:r.closed,normalSign:Wt(r.normal)};t.push(u)}function Er(t,e,n,r){var a,i;const o=r._geo;if(!((a=o==null?void 0:o.controlPoints)!=null&&a.length))return;const l=[];for(const c of o.controlPoints){const d=b(n,c);l.push(d.x,d.y)}const s={kind:"spline",layer:e,controlPoints:l,degree:o.degree??3,knots:[...o.knots??[]],weights:[...o.weights??[]],closed:o.closed??!1};if((i=o.fitPoints)!=null&&i.length){s.fitPoints=[];for(const c of o.fitPoints){const d=b(n,c);s.fitPoints.push(d.x,d.y)}}t.push(s)}function Nr(t,e,n,r){var a;const i=(a=r._geo)==null?void 0:a.vertices,o=i&&i.length>1?i.map(c=>({x:c.x,y:c.y,bulge:c.bulge})):Array.from({length:r.numberOfVertices},(c,d)=>{const u=r.getPoint2dAt(d);return{x:u.x,y:u.y,bulge:0}}),l=o.length;if(l<2)return;const s=r.closed?l:l-1;for(let c=0;c<s;c++){const d=o[c],u=o[(c+1)%l],f=d.bulge??0;if(yt.isPositive(Math.abs(f))){const p=b(n,{x:d.x,y:d.y,z:0}),g=b(n,{x:u.x,y:u.y,z:0}),m=new vt(p,g,f),x=m.center;t.push({kind:"arc",layer:e,cx:x.x,cy:x.y,r:m.radius,startAngle:m.startAngle,endAngle:m.endAngle,normalSign:m.clockwise?-1:1})}else Y(t,e,n,{x:d.x,y:d.y,z:0},{x:u.x,y:u.y,z:0})}}function Zr(t,e,n,r,a){if(Rt(n)){const i=b(n,{x:r.center.x,y:r.center.y,z:a}),o=new R(n.elements[0],n.elements[1],n.elements[2]).length();t.push({kind:"arc",layer:e,cx:i.x,cy:i.y,r:r.radius*o,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:r.clockwise?-1:1});return}Y(t,e,n,{x:r.startPoint.x,y:r.startPoint.y,z:a},{x:r.endPoint.x,y:r.endPoint.y,z:a})}function Yr(t,e,n,r,a){const i=b(n,{x:r.center.x,y:r.center.y,z:a}),o=Kt(n,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),l=Math.hypot(o.x,o.y)||1,s=new R(n.elements[0],n.elements[1],n.elements[2]).length(),c=new R(n.elements[4],n.elements[5],n.elements[6]).length();t.push({kind:"ellipse",layer:e,cx:i.x,cy:i.y,majorX:o.x/l,majorY:o.y/l,majorR:r.majorAxisRadius*s,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function Xr(t,e,n,r,a){var i;const o=r.numberOfVertices;if(o<2)return;const l=r.closed?o:o-1;for(let s=0;s<l;s++){const c=r.getPointAt(s),d=r.getPointAt((s+1)%o),u=((i=r.vertices[s])==null?void 0:i.bulge)??0,f={x:c.x,y:c.y,z:a},p={x:d.x,y:d.y,z:a};if(yt.isPositive(Math.abs(u))){const g=b(n,f),m=b(n,p),x=new vt(g,m,u),V=x.center;t.push({kind:"arc",layer:e,cx:V.x,cy:V.y,r:x.radius,startAngle:x.startAngle,endAngle:x.endAngle,normalSign:x.clockwise?-1:1})}else Y(t,e,n,f,p)}}function Gr(t,e,n,r,a){if(r instanceof Bn){Xr(t,e,n,r,a);return}if(r instanceof Un)for(const i of r.curves)i instanceof $n?Y(t,e,n,{x:i.startPoint.x,y:i.startPoint.y,z:a},{x:i.endPoint.x,y:i.endPoint.y,z:a}):i instanceof vt?Zr(t,e,n,i,a):i instanceof jn&&Yr(t,e,n,i,a)}function Wr(t,e,n,r){var a;const i=(a=r._geo)==null?void 0:a.loops;if(!(i!=null&&i.length))return;const o=r.elevation;for(const l of i)Gr(t,e,n,l,o)}function Kr(t,e,n,r){const a=gt(n,Ve(r)),i=[0];for(let c=0;c<r.numColumns;c++)i.push(i[c]+r.columnWidth(c));const o=[0];for(let c=0;c<r.numRows;c++)o.push(o[c]-r.rowHeight(c));const l=i[i.length-1],s=o[o.length-1];for(const c of o)Y(t,e,a,{x:0,y:c,z:0},{x:l,y:c,z:0});for(const c of i)Y(t,e,a,{x:c,y:0,z:0},{x:c,y:s,z:0})}function Jr(t,e,n,r,a,i,o){const l=Vt(t.layer,n);if(o&&!o(l))return;const s=jr(t,i);if(s&&!a.has(s.objectId)&&Tr(s)){a.add(s.objectId);const d=gt(e,Ve(t));wt(s,d,l,r,a,i,o),a.delete(s.objectId);return}Kr(r,l,e,t);const c=b(e,t.position);r.push({kind:"point",layer:l,x:c.x,y:c.y})}function qr(t,e,n,r){let a=r.boundaryPath();if(a.length>1){const o=a[0],l=a[a.length-1];o.x===l.x&&o.y===l.y&&(o.z??0)===(l.z??0)&&(a=a.slice(0,-1))}a.length>=2&&K(t,e,n,a,!0);const i=b(n,r.position);t.push({kind:"point",layer:e,x:i.x,y:i.y})}function Vt(t,e){return t==="0"?e:t}function Qr(t,e,n,r,a,i,o){if(!t.visibility)return;const l=Vt(t.layer,n);if(!(o&&!o(l))){if(t instanceof ln){Jr(t,e,n,r,a,i,o);return}if(Hr(t)){const s=Re(t,i);if(!s||a.has(s.objectId))return;a.add(s.objectId);const c=gt(e,t.getFullInsertionTransform()),d=Vt(t.layer,n);wt(s,c,d,r,a,i,o),a.delete(s.objectId);return}if(t instanceof sn){const s=t,c=$r(s,i);if(!c||a.has(c.objectId))return;a.add(c.objectId);const d=gt(e,s.getFullDimBlockTransform());wt(c,d,l,r,a,i,o),a.delete(c.objectId);return}if(Br(t)){Ur(r,l,e,t);return}if(t instanceof cn){Rt(e)?Or(r,l,e,t.center,t.radius,t.normal):It(r,l,e,ta(t));return}if(t instanceof dn){Rt(e)?_r(r,l,e,t):It(r,l,e,ea(t));return}if(t instanceof _t){It(r,l,e,t);return}if(t instanceof un){Er(r,l,e,t);return}if(t instanceof fn){Nr(r,l,e,t);return}if(t instanceof mn){Vr(r,l,e,t);return}if(t instanceof pn){const s=[];for(let c=0;c<t.numberOfVertices;c++)s.push(t.getPointAt(c));K(r,l,e,s,t.closed);return}if(t instanceof hn){Wr(r,l,e,t);return}if(t instanceof gn){xe(r,l,e,t.basePoint,t.unitDir,!1);return}if(t instanceof wn){xe(r,l,e,t.basePoint,t.unitDir,!0);return}if(t instanceof yn){const s=[t.getPointAt(0),t.getPointAt(1),t.getPointAt(2),t.getPointAt(3)];K(r,l,e,s,!0);return}if(t instanceof vn){const s=t.subGetGripPoints();s.length>=2&&K(r,l,e,s,s.length>=3);return}if(t instanceof bn){const s=t.vertices;s.length>=2&&K(r,l,e,s,!1);return}if(t instanceof xn){Fr(r,l,e,t);return}if(t instanceof An){Rr(r,l,e,t);return}if(t instanceof kn){const s=b(e,t.position);r.push({kind:"point",layer:l,x:s.x,y:s.y});return}if(t instanceof Mn){const s=b(e,t.location);r.push({kind:"point",layer:l,x:s.x,y:s.y});return}if(t instanceof Cn){qr(r,l,e,t);return}if(t instanceof Ln){const s=b(e,t.position);r.push({kind:"point",layer:l,x:s.x,y:s.y})}}}function wt(t,e,n,r,a,i,o){for(const l of t.newIterator())Qr(l,e,n,r,a,i,o)}function ta(t){return new _t(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,0,In)}function ea(t){return new _t(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,t.startAngle,t.endAngle)}function Ae(t,e,n={}){const r=Ir(t,e);if(!r)return{primitives:[]};const a=[],i=new Ot;return wt(r,i,"0",a,new Set,t,n.includeLayer),{primitives:a}}const na=["en","zh","cs","tr"];function ra(t){if(t==null||t==="")return null;const e=t.toLowerCase().replace("_","-");for(const n of na)if(e===n||e.startsWith(`${n}-`))return n;return null}const aa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M9.3333 14.125 5.875 10.6667V14.125H9.3333Zm4.7917-3.4583-3.4583 3.4583H14.125V10.6667ZM10.6667 5.875 14.125 9.3333V5.875H10.6667ZM5.875 9.3333 9.3333 5.875H5.875V9.3333Zm9.2083 5.475c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917S.9417 7.275 4.1083 4.1083C7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Z"/></svg>',ia='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M3.75 9.25h12.5v1.5H3.75v-1.5ZM2.25 6.5h1.5v7h-1.5v-7ZM16.25 6.5h1.5v7h-1.5v-7Z"/></svg>',oa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><polygon fill="currentColor" points="5.74 7.13 7 9.5 4.15 7.72 3.2 7.12 3 7 7 4.5 6.17 6.05 5.67 7 5.74 7.13"/><polygon fill="currentColor" points="16 12.5 13.5 16.5 12.66 15.15 11.92 13.97 11 12.5 12 13.03 12.98 13.55 13.5 13.83 16 12.5"/><rect fill="currentColor" x="2" y="2.5" width="1" height="15"/><rect fill="currentColor" x="3" y="16.5" width="15" height="1"/><path fill="currentColor" d="M14,13c0,.18,0,.37,0,.55v0a6.82,6.82,0,0,1-.32,1.57l-.74-1.18L13,13.5c0-.14,0-.31,0-.47v0a6,6,0,0,0-6-6,6.74,6.74,0,0,0-1.26.13l-.29.07a5.61,5.61,0,0,0-1.3.52l-1-.6a7.07,7.07,0,0,1,2-.88,6.78,6.78,0,0,1,1-.19A7.7,7.7,0,0,1,7,6a7,7,0,0,1,7,7Z"/></svg>',la='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><rect fill="currentColor" x="2" y="16" width="2" height="2"/><rect fill="currentColor" x="16" y="2" width="2" height="2"/><rect fill="currentColor" x="6.1" y="6.11" width="2" height="2"/><path fill="currentColor" d="M4.99,9.11c-1.15,1.74-1.94,3.74-2.24,5.89h.81c.32-2.18,1.16-4.18,2.39-5.89h-.96Z"/><path fill="currentColor" d="M9.1,5v.96c1.71-1.23,3.72-2.07,5.9-2.4v-.81c-2.16,.3-4.16,1.09-5.9,2.24Z"/></svg>',sa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M4 4h12v12H4V4Zm1.5 1.5v9h9v-9h-9Z"/><circle fill="currentColor" cx="4" cy="4" r="1.5"/><circle fill="currentColor" cx="16" cy="4" r="1.5"/><circle fill="currentColor" cx="4" cy="16" r="1.5"/><circle fill="currentColor" cx="16" cy="16" r="1.5"/></svg>',ca='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M9.25 2h1.5v5.25H16v1.5h-5.25V16h-1.5v-7.25H4v-1.5h5.25V2Z"/><circle fill="currentColor" cx="10" cy="10" r="1.75"/></svg>',da='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"/><path d="M10 11v6M14 11v6"/><path d="M9 6V4a1 1 0 011-1h4a1 1 0 011 1v2"/></svg>',ua='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65-149.36-68.1c-16.19-7.4-42.69-7.4-58.88 0L77.3 137.65c-17.6 8-17.6 21.09 0 29.09l148 67.5c16.89 7.7 44.69 7.7 61.58 0l148-67.5c17.52-8 17.52-21.1-.08-29.09M160 308.52l-82.7 37.11c-17.6 8-17.6 21.1 0 29.1l148 67.5c16.89 7.69 44.69 7.69 61.58 0l148-67.5c17.6-8 17.6-21.1 0-29.1l-79.94-38.47"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m160 204.48-82.8 37.16c-17.6 8-17.6 21.1 0 29.1l148 67.49c16.89 7.7 44.69 7.7 61.58 0l148-67.49c17.7-8 17.7-21.1.1-29.1L352 204.48"/></svg>',fa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10.09 3.53 16.09 6.97 10.09 10.29 4.18 7 10.09 3.56M10.09 2.4 2.17 7 3.31 7.65 10.09 11.45 17 7.62 18.17 7 10.08 2.37 10.09 2.4Z"/><path fill="currentColor" d="M10.25 14.83 18.17 10.22 17 9.57 10.22 13.57 3.32 9.59 2.17 10.22 10.25 14.83Z"/><path fill="currentColor" d="M10.25 17.63 18.17 13 17 12.37 10.22 16.37 3.32 12.38 2.17 13 10.25 17.63Z"/></svg>',ma='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10.09 5.15 16.09 8.59 10.09 11.91 4.18 8.59 10.09 5.15ZM10.09 4 2.17 8.61 3.31 9.25 10.09 13.06 17 9.24 18.16 8.61 10.08 4 10.09 4Z"/><path fill="currentColor" d="M10.25 16.46 18.17 11.85 17 11.2 10.22 15.2 3.32 11.21 2.17 11.85 10.25 16.46Z"/><path fill="currentColor" d="M3.5 3.5 16.5 16.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/></svg>',pa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="m18.5 10 4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725 16.676 16.676 0 0 1 3.524 17.273l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877 16.165 16.165 0 0 0 11.91 6.001L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg>',ha='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-hidden="true"><path fill="currentColor" d="M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088l-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36l-116.224-25.088l-65.28 113.152l79.68 88.192l-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136l-79.808 88.192l65.344 113.152l116.224-25.024l22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152l24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296l116.288 25.024l65.28-113.152l-79.744-88.192l1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136l79.808-88.128l-65.344-113.152l-116.288 24.96l-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384a192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256a128 128 0 0 0 0-256"/></svg>',ga='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',wa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M16.98 11L18.5 11L18.5 10L16.98 10C16.86 8.13 16.05 6.44 14.8 5.2L16.88 2.83L16.12 2.17L14.05 4.54C12.79 3.57 11.21 3 9.5 3C5.36 3 2 6.36 2 10.5C2 14.64 5.36 18 9.5 18C13.47 18 16.73 14.91 16.98 11ZM15.98 10C15.86 8.43 15.18 7.01 14.14 5.95L10.6 10L15.98 10ZM13.39 5.29L8.4 11L15.98 11C15.73 14.36 12.92 17 9.5 17C5.91 17 3 14.09 3 10.5C3 6.91 5.91 4 9.5 4C10.96 4 12.31 4.48 13.39 5.29Z"/></svg>',ya='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path fill="#e75958" d="M22 12H12l5 8.66A10 10 0 0 0 22 12Z"/><path fill="#814dff" d="M17 20.66 12 12 7 20.66A10 10 0 0 0 17 20.66Z"/><path fill="#13b0ce" d="M7 20.66 12 12H2A10 10 0 0 0 7 20.66Z"/><path fill="#4ecd83" d="M2 12H12L7 3.34A10 10 0 0 0 2 12Z"/><path fill="#ffc33f" d="M7 3.34 12 12l5-8.66A10 10 0 0 0 7 3.34Z"/><path fill="#ff9543" d="M17 3.34 12 12H22A10 10 0 0 0 17 3.34Z"/></svg>',va='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 6.5 5.5 11h9L10 6.5Z"/></svg>',M={zoomExtent:aa,measureDistance:ia,measureAngle:oa,measureArc:la,measureArea:sa,measureCoordinate:ca,clearMeasurements:da,layer:ua,layerOn:fa,layerOff:ma,language:pa,setting:ha,orthoMode:ga,polarTracking:wa,color:ya,chevronUp:va};function U(t,e,n){const r=Object.entries(n).map(([a,i])=>`${a}="${Bt(i)}"`).join(" ");return`<button type="button" class="mlcad-tool-btn" title="${Bt(e)}" aria-label="${Bt(e)}" ${r}>${t}</button>`}function Bt(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}const ba=583902,xa=[90,45,30,23,18,10,5];function Aa(t){return`#${t.toString(16).padStart(6,"0")}`}function Oe(){return`<button type="button" class="mlcad-tool-btn mlcad-lang-btn" id="mlcad-lang-btn" data-i18n-key="toolbar.languageSwitch" data-i18n-attr="title aria-label" title="Switch language" aria-label="Switch language">
|
|
2
|
-
${M.language}
|
|
3
|
-
<span class="mlcad-lang-badge" id="mlcad-lang-badge">EN</span>
|
|
4
|
-
</button>`}function ka(){const t=xa.map(e=>`<button type="button" class="mlcad-tool-btn mlcad-settings-option-btn mlcad-polar-angle-btn" data-polar-ang="${e}" title="${e}°" aria-label="${e}°"><span class="mlcad-settings-option-indicator" aria-hidden="true"></span><span class="mlcad-settings-option-text">${e}°</span></button>`).join("");return`
|
|
5
|
-
<div id="mlcad-settings-wrap" hidden>
|
|
6
|
-
<div id="mlcad-settings-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="settings.toolbar" aria-label="Measure settings">
|
|
7
|
-
<button type="button" class="mlcad-tool-btn mlcad-color-btn" id="mlcad-measure-color-btn" data-i18n-key="settings.measureColor" data-i18n-attr="title aria-label" title="Measure color" aria-label="Measure color">
|
|
8
|
-
${M.color}
|
|
9
|
-
</button>
|
|
10
|
-
<input type="color" id="mlcad-measure-color-input" class="mlcad-color-input" value="${Aa(ba)}" tabindex="-1" aria-hidden="true" />
|
|
11
|
-
${U(M.orthoMode,"Orthogonal mode",{id:"mlcad-ortho-btn","data-toggle":"ortho","data-i18n-key":"settings.ortho","data-i18n-attr":"title aria-label"})}
|
|
12
|
-
${U(M.polarTracking,"Polar tracking",{id:"mlcad-polar-btn","data-toggle":"polar","data-i18n-key":"settings.polar","data-i18n-attr":"title aria-label"})}
|
|
13
|
-
${Oe()}
|
|
14
|
-
</div>
|
|
15
|
-
<div id="mlcad-polar-angles" role="group" data-i18n-attr="aria-label" data-i18n-key="settings.polarAngles" aria-label="Polar tracking angles" hidden>
|
|
16
|
-
${t}
|
|
17
|
-
</div>
|
|
18
|
-
</div>`}const Ma=`
|
|
19
|
-
:root {
|
|
20
|
-
--mlcad-ui-bg: rgba(24, 26, 30, 0.94);
|
|
21
|
-
--mlcad-ui-bg-elevated: rgba(32, 35, 40, 0.98);
|
|
22
|
-
--mlcad-ui-border: rgba(255, 255, 255, 0.1);
|
|
23
|
-
--mlcad-ui-text: #e8eaed;
|
|
24
|
-
--mlcad-ui-muted: #9aa0a6;
|
|
25
|
-
--mlcad-accent: #08e8de;
|
|
26
|
-
--mlcad-accent-active: #1a8cff;
|
|
27
|
-
--mlcad-measure-accent: #08e8de;
|
|
28
|
-
--mlcad-measure-accent-border: rgba(8, 232, 222, 0.45);
|
|
29
|
-
--mlcad-measure-accent-fill: rgba(8, 232, 222, 0.2);
|
|
30
|
-
--mlcad-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
|
|
31
|
-
--mlcad-toolbar-width: 44px;
|
|
32
|
-
--mlcad-drawer-width: 220px;
|
|
33
|
-
--mlcad-drawer-gap: 8px;
|
|
34
|
-
--mlcad-ui-inset: 12px;
|
|
35
|
-
--mlcad-z-chrome: 7;
|
|
36
|
-
--mlcad-z-measure: 5;
|
|
37
|
-
}
|
|
38
|
-
html, body {
|
|
39
|
-
margin: 0; height: 100%; overflow: hidden;
|
|
40
|
-
background: #121418;
|
|
41
|
-
font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
|
|
42
|
-
color: var(--mlcad-ui-text);
|
|
43
|
-
}
|
|
44
|
-
#mlcad-root { position: relative; width: 100%; height: 100%; }
|
|
45
|
-
#mlcad-root canvas {
|
|
46
|
-
display: block;
|
|
47
|
-
width: 100%;
|
|
48
|
-
height: 100%;
|
|
49
|
-
touch-action: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
#mlcad-sidebar {
|
|
53
|
-
position: absolute;
|
|
54
|
-
left: var(--mlcad-ui-inset);
|
|
55
|
-
top: 50%;
|
|
56
|
-
z-index: var(--mlcad-z-chrome);
|
|
57
|
-
transform: translateY(-50%);
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: flex-start;
|
|
60
|
-
gap: var(--mlcad-drawer-gap);
|
|
61
|
-
max-width: calc(100% - 2 * var(--mlcad-ui-inset));
|
|
62
|
-
box-sizing: border-box;
|
|
63
|
-
pointer-events: none;
|
|
64
|
-
}
|
|
65
|
-
#mlcad-sidebar > * { pointer-events: auto; }
|
|
66
|
-
|
|
67
|
-
#mlcad-toolbar {
|
|
68
|
-
flex-shrink: 0;
|
|
69
|
-
display: flex; flex-direction: column; gap: 4px;
|
|
70
|
-
padding: 6px;
|
|
71
|
-
background: var(--mlcad-ui-bg);
|
|
72
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
73
|
-
border-radius: 8px;
|
|
74
|
-
box-shadow: var(--mlcad-shadow);
|
|
75
|
-
backdrop-filter: blur(12px);
|
|
76
|
-
}
|
|
77
|
-
.mlcad-tool-btn {
|
|
78
|
-
display: flex; align-items: center; justify-content: center;
|
|
79
|
-
width: var(--mlcad-toolbar-width); height: var(--mlcad-toolbar-width);
|
|
80
|
-
margin: 0; padding: 0;
|
|
81
|
-
border: 1px solid transparent;
|
|
82
|
-
border-radius: 6px;
|
|
83
|
-
background: transparent;
|
|
84
|
-
color: var(--mlcad-ui-text);
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
87
|
-
}
|
|
88
|
-
.mlcad-tool-btn:hover {
|
|
89
|
-
background: rgba(255, 255, 255, 0.08);
|
|
90
|
-
border-color: var(--mlcad-ui-border);
|
|
91
|
-
}
|
|
92
|
-
.mlcad-tool-btn.active {
|
|
93
|
-
background: rgba(26, 140, 255, 0.22);
|
|
94
|
-
border-color: rgba(26, 140, 255, 0.55);
|
|
95
|
-
color: #fff;
|
|
96
|
-
}
|
|
97
|
-
.mlcad-tool-btn svg {
|
|
98
|
-
width: 20px; height: 20px; display: block; flex-shrink: 0;
|
|
99
|
-
}
|
|
100
|
-
#mlcad-toolbar-toggle {
|
|
101
|
-
height: calc(var(--mlcad-toolbar-width) / 2);
|
|
102
|
-
margin-top: -4px;
|
|
103
|
-
margin-bottom: -4px;
|
|
104
|
-
border-radius: 4px;
|
|
105
|
-
}
|
|
106
|
-
#mlcad-toolbar-toggle svg {
|
|
107
|
-
width: calc(var(--mlcad-toolbar-width) / 2);
|
|
108
|
-
height: calc(var(--mlcad-toolbar-width) / 2);
|
|
109
|
-
}
|
|
110
|
-
.mlcad-tool-separator {
|
|
111
|
-
height: 1px;
|
|
112
|
-
margin: 4px 8px;
|
|
113
|
-
background: var(--mlcad-ui-border);
|
|
114
|
-
}
|
|
115
|
-
.mlcad-lang-btn { position: relative; }
|
|
116
|
-
.mlcad-lang-badge {
|
|
117
|
-
position: absolute; right: 3px; bottom: 3px;
|
|
118
|
-
min-width: 14px; height: 14px; padding: 0 3px;
|
|
119
|
-
border-radius: 3px;
|
|
120
|
-
background: rgba(8, 232, 222, 0.2);
|
|
121
|
-
border: 1px solid rgba(8, 232, 222, 0.45);
|
|
122
|
-
color: var(--mlcad-accent);
|
|
123
|
-
font-size: 9px; font-weight: 700; line-height: 12px;
|
|
124
|
-
letter-spacing: -0.02em;
|
|
125
|
-
pointer-events: none;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
#mlcad-layer-drawer {
|
|
129
|
-
flex-shrink: 1;
|
|
130
|
-
min-width: 0;
|
|
131
|
-
width: var(--mlcad-drawer-width);
|
|
132
|
-
max-height: min(420px, calc(100vh - 48px));
|
|
133
|
-
display: flex; flex-direction: column;
|
|
134
|
-
background: var(--mlcad-ui-bg-elevated);
|
|
135
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
136
|
-
border-radius: 8px;
|
|
137
|
-
box-shadow: var(--mlcad-shadow);
|
|
138
|
-
backdrop-filter: blur(12px);
|
|
139
|
-
overflow: hidden;
|
|
140
|
-
}
|
|
141
|
-
#mlcad-layer-drawer[hidden] { display: none; }
|
|
142
|
-
|
|
143
|
-
.mlcad-drawer-header {
|
|
144
|
-
display: flex; align-items: center; justify-content: space-between;
|
|
145
|
-
gap: 6px; padding: 8px 10px;
|
|
146
|
-
border-bottom: 1px solid var(--mlcad-ui-border);
|
|
147
|
-
font-size: 13px; font-weight: 600;
|
|
148
|
-
}
|
|
149
|
-
.mlcad-drawer-close {
|
|
150
|
-
width: 28px; height: 28px; padding: 0;
|
|
151
|
-
border: none; border-radius: 4px;
|
|
152
|
-
background: transparent; color: var(--mlcad-ui-muted);
|
|
153
|
-
cursor: pointer; font-size: 18px; line-height: 1;
|
|
154
|
-
}
|
|
155
|
-
.mlcad-drawer-close:hover {
|
|
156
|
-
background: rgba(255, 255, 255, 0.08); color: var(--mlcad-ui-text);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.mlcad-layer-actions {
|
|
160
|
-
display: flex; gap: 4px; padding: 6px 8px;
|
|
161
|
-
border-bottom: 1px solid var(--mlcad-ui-border);
|
|
162
|
-
}
|
|
163
|
-
.mlcad-layer-action-btn {
|
|
164
|
-
flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
165
|
-
min-height: 30px; padding: 4px 8px;
|
|
166
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
167
|
-
border-radius: 5px;
|
|
168
|
-
background: rgba(255, 255, 255, 0.04);
|
|
169
|
-
color: var(--mlcad-ui-text);
|
|
170
|
-
font-size: 12px; cursor: pointer;
|
|
171
|
-
}
|
|
172
|
-
.mlcad-layer-action-btn:hover { background: rgba(255, 255, 255, 0.1); }
|
|
173
|
-
.mlcad-layer-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
174
|
-
|
|
175
|
-
#mlcad-layer-list {
|
|
176
|
-
flex: 1; overflow: auto; padding: 4px 0;
|
|
177
|
-
}
|
|
178
|
-
.mlcad-layer-item {
|
|
179
|
-
display: grid;
|
|
180
|
-
grid-template-columns: auto auto 1fr auto;
|
|
181
|
-
align-items: center; gap: 6px;
|
|
182
|
-
padding: 5px 8px;
|
|
183
|
-
font-size: 12px; cursor: pointer;
|
|
184
|
-
}
|
|
185
|
-
.mlcad-layer-item:hover { background: rgba(255, 255, 255, 0.05); }
|
|
186
|
-
.mlcad-layer-item input { margin: 0; cursor: pointer; }
|
|
187
|
-
.mlcad-layer-swatch {
|
|
188
|
-
width: 12px; height: 12px; border-radius: 2px;
|
|
189
|
-
border: 1px solid rgba(255, 255, 255, 0.28);
|
|
190
|
-
}
|
|
191
|
-
.mlcad-layer-name {
|
|
192
|
-
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
193
|
-
}
|
|
194
|
-
.mlcad-layer-zoom {
|
|
195
|
-
display: flex; align-items: center; justify-content: center;
|
|
196
|
-
width: 22px; height: 22px; padding: 0;
|
|
197
|
-
border: 1px solid transparent; border-radius: 4px;
|
|
198
|
-
background: transparent; color: var(--mlcad-ui-muted);
|
|
199
|
-
cursor: pointer;
|
|
200
|
-
}
|
|
201
|
-
.mlcad-layer-zoom svg {
|
|
202
|
-
width: 14px; height: 14px; display: block;
|
|
203
|
-
}
|
|
204
|
-
.mlcad-layer-zoom:hover:not(:disabled) {
|
|
205
|
-
color: var(--mlcad-accent);
|
|
206
|
-
border-color: var(--mlcad-ui-border);
|
|
207
|
-
background: rgba(255, 255, 255, 0.06);
|
|
208
|
-
}
|
|
209
|
-
.mlcad-layer-zoom:disabled { opacity: 0.35; cursor: not-allowed; }
|
|
210
|
-
|
|
211
|
-
#mlcad-status-bar {
|
|
212
|
-
position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: var(--mlcad-z-chrome);
|
|
213
|
-
display: flex; align-items: center; min-height: 28px; padding: 0 12px;
|
|
214
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
215
|
-
border-radius: 6px;
|
|
216
|
-
background: var(--mlcad-ui-bg);
|
|
217
|
-
color: var(--mlcad-ui-muted);
|
|
218
|
-
font-size: 12px;
|
|
219
|
-
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
|
|
220
|
-
backdrop-filter: blur(10px);
|
|
221
|
-
pointer-events: none;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
#mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-settings-wrap,
|
|
225
|
-
#mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-layer-drawer {
|
|
226
|
-
display: none !important;
|
|
227
|
-
}
|
|
228
|
-
#mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-btn:not(#mlcad-toolbar-toggle) {
|
|
229
|
-
display: none;
|
|
230
|
-
}
|
|
231
|
-
#mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-separator {
|
|
232
|
-
display: none;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
#mlcad-settings-wrap {
|
|
236
|
-
flex-shrink: 0;
|
|
237
|
-
min-width: 0;
|
|
238
|
-
display: flex;
|
|
239
|
-
flex-direction: row;
|
|
240
|
-
align-items: flex-start;
|
|
241
|
-
gap: var(--mlcad-drawer-gap);
|
|
242
|
-
}
|
|
243
|
-
#mlcad-settings-wrap[hidden] { display: none; }
|
|
244
|
-
|
|
245
|
-
#mlcad-settings-strip {
|
|
246
|
-
flex-shrink: 0;
|
|
247
|
-
display: flex;
|
|
248
|
-
flex-direction: column;
|
|
249
|
-
align-items: stretch;
|
|
250
|
-
gap: 4px;
|
|
251
|
-
padding: 6px;
|
|
252
|
-
background: var(--mlcad-ui-bg);
|
|
253
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
254
|
-
border-radius: 8px;
|
|
255
|
-
box-shadow: var(--mlcad-shadow);
|
|
256
|
-
backdrop-filter: blur(12px);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
#mlcad-polar-angles {
|
|
260
|
-
flex-shrink: 0;
|
|
261
|
-
display: inline-flex;
|
|
262
|
-
flex-direction: column;
|
|
263
|
-
align-items: stretch;
|
|
264
|
-
gap: 4px;
|
|
265
|
-
padding: 6px;
|
|
266
|
-
max-width: min(280px, calc(100vw - 2 * var(--mlcad-ui-inset) - 3 * var(--mlcad-toolbar-width) - 3 * var(--mlcad-drawer-gap)));
|
|
267
|
-
background: var(--mlcad-ui-bg);
|
|
268
|
-
border: 1px solid var(--mlcad-ui-border);
|
|
269
|
-
border-radius: 8px;
|
|
270
|
-
box-shadow: var(--mlcad-shadow);
|
|
271
|
-
backdrop-filter: blur(12px);
|
|
272
|
-
}
|
|
273
|
-
#mlcad-polar-angles[hidden] { display: none; }
|
|
274
|
-
|
|
275
|
-
.mlcad-color-input {
|
|
276
|
-
position: absolute;
|
|
277
|
-
width: 0;
|
|
278
|
-
height: 0;
|
|
279
|
-
opacity: 0;
|
|
280
|
-
pointer-events: none;
|
|
281
|
-
}
|
|
282
|
-
.mlcad-settings-option-btn {
|
|
283
|
-
width: 100%;
|
|
284
|
-
box-sizing: border-box;
|
|
285
|
-
height: var(--mlcad-toolbar-width);
|
|
286
|
-
justify-content: flex-start;
|
|
287
|
-
gap: 8px;
|
|
288
|
-
padding: 0 10px;
|
|
289
|
-
font-size: 11px;
|
|
290
|
-
font-weight: 500;
|
|
291
|
-
}
|
|
292
|
-
.mlcad-settings-option-indicator {
|
|
293
|
-
flex-shrink: 0;
|
|
294
|
-
width: 10px;
|
|
295
|
-
height: 10px;
|
|
296
|
-
border: 1px solid var(--mlcad-ui-muted);
|
|
297
|
-
border-radius: 2px;
|
|
298
|
-
box-sizing: border-box;
|
|
299
|
-
transition: background 0.15s ease, border-color 0.15s ease;
|
|
300
|
-
}
|
|
301
|
-
.mlcad-settings-option-btn.active .mlcad-settings-option-indicator {
|
|
302
|
-
background: var(--mlcad-accent);
|
|
303
|
-
border-color: var(--mlcad-accent);
|
|
304
|
-
}
|
|
305
|
-
.mlcad-settings-option-text {
|
|
306
|
-
overflow: hidden;
|
|
307
|
-
text-overflow: ellipsis;
|
|
308
|
-
white-space: nowrap;
|
|
309
|
-
pointer-events: none;
|
|
310
|
-
line-height: 1.2;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
#mlcad-measure-overlays {
|
|
314
|
-
position: absolute;
|
|
315
|
-
inset: 0;
|
|
316
|
-
pointer-events: none;
|
|
317
|
-
z-index: var(--mlcad-z-measure);
|
|
318
|
-
overflow: hidden;
|
|
319
|
-
}
|
|
320
|
-
.mlcad-measure-canvas {
|
|
321
|
-
position: absolute;
|
|
322
|
-
left: 0;
|
|
323
|
-
top: 0;
|
|
324
|
-
pointer-events: none;
|
|
325
|
-
}
|
|
326
|
-
.mlcad-measure-dot {
|
|
327
|
-
position: absolute;
|
|
328
|
-
width: 10px;
|
|
329
|
-
height: 10px;
|
|
330
|
-
border-radius: 50%;
|
|
331
|
-
background: var(--mlcad-measure-accent);
|
|
332
|
-
border: 2px solid rgba(255, 255, 255, 0.9);
|
|
333
|
-
box-sizing: border-box;
|
|
334
|
-
transform: translate(-50%, -50%);
|
|
335
|
-
pointer-events: none;
|
|
336
|
-
}
|
|
337
|
-
.mlcad-measure-badge {
|
|
338
|
-
position: absolute;
|
|
339
|
-
padding: 3px 10px;
|
|
340
|
-
border-radius: 14px;
|
|
341
|
-
background: var(--mlcad-ui-bg-elevated);
|
|
342
|
-
border: 1px solid var(--mlcad-measure-accent-border);
|
|
343
|
-
color: var(--mlcad-measure-accent);
|
|
344
|
-
font-size: 12px;
|
|
345
|
-
font-weight: 600;
|
|
346
|
-
white-space: nowrap;
|
|
347
|
-
transform: translate(-50%, -50%);
|
|
348
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
|
|
349
|
-
pointer-events: none;
|
|
350
|
-
}
|
|
351
|
-
.mlcad-measure-badge--coordinate {
|
|
352
|
-
transform: translate(-50%, calc(-50% - 16px));
|
|
353
|
-
}
|
|
354
|
-
.mlcad-measure-dot.mlcad-measure-selected {
|
|
355
|
-
border-color: #ffd54f;
|
|
356
|
-
box-shadow: 0 0 0 2px rgba(255, 213, 79, 0.55);
|
|
357
|
-
}
|
|
358
|
-
.mlcad-measure-badge.mlcad-measure-selected {
|
|
359
|
-
border-color: rgba(255, 213, 79, 0.75);
|
|
360
|
-
color: #ffd54f;
|
|
361
|
-
}
|
|
362
|
-
.mlcad-measure-canvas.mlcad-measure-selected {
|
|
363
|
-
filter: drop-shadow(0 0 3px #ffd54f);
|
|
364
|
-
}
|
|
365
|
-
.mlcad-measure-live-label {
|
|
366
|
-
position: absolute;
|
|
367
|
-
pointer-events: none;
|
|
368
|
-
color: var(--mlcad-measure-accent);
|
|
369
|
-
font-size: 12px;
|
|
370
|
-
font-weight: 600;
|
|
371
|
-
text-shadow: 0 0 4px #000, 0 1px 3px #000;
|
|
372
|
-
transform: translate(-50%, -120%);
|
|
373
|
-
display: none;
|
|
374
|
-
}
|
|
375
|
-
#mlcad-loading {
|
|
376
|
-
position: fixed; inset: 0; z-index: 100;
|
|
377
|
-
display: flex; align-items: center; justify-content: center;
|
|
378
|
-
background: #121418;
|
|
379
|
-
transition: opacity 0.35s ease, visibility 0.35s ease;
|
|
380
|
-
}
|
|
381
|
-
#mlcad-loading.mlcad-loading--done {
|
|
382
|
-
opacity: 0; visibility: hidden; pointer-events: none;
|
|
383
|
-
}
|
|
384
|
-
.mlcad-loading-spinner {
|
|
385
|
-
width: 48px; height: 48px; box-sizing: border-box;
|
|
386
|
-
border: 3px solid rgba(255, 255, 255, 0.12);
|
|
387
|
-
border-top-color: var(--mlcad-accent);
|
|
388
|
-
border-radius: 50%;
|
|
389
|
-
animation: mlcad-spin 0.85s linear infinite;
|
|
390
|
-
}
|
|
391
|
-
@keyframes mlcad-spin { to { transform: rotate(360deg); } }
|
|
392
|
-
|
|
393
|
-
@media (max-width: ${Ge}px) {
|
|
394
|
-
:root {
|
|
395
|
-
--mlcad-drawer-width: min(200px, calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap)));
|
|
396
|
-
--mlcad-ui-inset: 8px;
|
|
397
|
-
}
|
|
398
|
-
#mlcad-sidebar {
|
|
399
|
-
left: var(--mlcad-ui-inset);
|
|
400
|
-
right: var(--mlcad-ui-inset);
|
|
401
|
-
width: auto;
|
|
402
|
-
}
|
|
403
|
-
#mlcad-layer-drawer {
|
|
404
|
-
margin-left: auto;
|
|
405
|
-
max-width: calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap));
|
|
406
|
-
}
|
|
407
|
-
.mlcad-layer-action-btn {
|
|
408
|
-
min-height: 28px;
|
|
409
|
-
padding: 3px 6px;
|
|
410
|
-
font-size: 11px;
|
|
411
|
-
gap: 4px;
|
|
412
|
-
}
|
|
413
|
-
.mlcad-layer-action-btn svg { width: 12px; height: 12px; }
|
|
414
|
-
.mlcad-layer-zoom {
|
|
415
|
-
width: 20px;
|
|
416
|
-
height: 20px;
|
|
417
|
-
}
|
|
418
|
-
.mlcad-layer-zoom svg {
|
|
419
|
-
width: 12px;
|
|
420
|
-
height: 12px;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
`;function Ca(t,e="measure"){const n=e==="measure"?La():"",r=e==="measure"?Sa():"",a=e==="view"?Oe():"";return`
|
|
424
|
-
<div id="mlcad-loading" aria-hidden="true" style="background:${t}">
|
|
425
|
-
<div class="mlcad-loading-spinner"></div>
|
|
426
|
-
</div>
|
|
427
|
-
<div id="mlcad-root">
|
|
428
|
-
<aside id="mlcad-sidebar">
|
|
429
|
-
<nav id="mlcad-toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.viewerTools" aria-label="Viewer tools">
|
|
430
|
-
${U(M.zoomExtent,"Zoom extents",{"data-action":"fit","data-i18n-key":"toolbar.zoomExtents","data-i18n-attr":"title aria-label"})}
|
|
431
|
-
${e==="measure"?ke():""}
|
|
432
|
-
${n}
|
|
433
|
-
${e==="measure"?ke():""}
|
|
434
|
-
${U(M.layer,"Layers",{id:"mlcad-layers-btn","aria-haspopup":"dialog","aria-expanded":"false","data-i18n-key":"toolbar.layers","data-i18n-attr":"title aria-label"})}
|
|
435
|
-
${r}
|
|
436
|
-
${a}
|
|
437
|
-
${U(M.chevronUp,"Collapse toolbar",{id:"mlcad-toolbar-toggle","aria-expanded":"true","data-i18n-key":"toolbar.collapse","data-i18n-attr":"title aria-label"})}
|
|
438
|
-
</nav>
|
|
439
|
-
${e==="measure"?ka():""}
|
|
440
|
-
<div id="mlcad-layer-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="layers.title" aria-label="Layers" hidden>
|
|
441
|
-
<div class="mlcad-drawer-header">
|
|
442
|
-
<span data-i18n-key="layers.title" data-i18n-text>Layers</span>
|
|
443
|
-
<button type="button" class="mlcad-drawer-close" id="mlcad-layer-close" data-i18n-key="layers.close" data-i18n-attr="aria-label" aria-label="Close layers">×</button>
|
|
444
|
-
</div>
|
|
445
|
-
<div class="mlcad-layer-actions">
|
|
446
|
-
<button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-show-all">
|
|
447
|
-
${M.layerOn}<span data-i18n-key="layers.showAll" data-i18n-text>Show all</span>
|
|
448
|
-
</button>
|
|
449
|
-
<button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-hide-all">
|
|
450
|
-
${M.layerOff}<span data-i18n-key="layers.hideAll" data-i18n-text>Hide all</span>
|
|
451
|
-
</button>
|
|
452
|
-
</div>
|
|
453
|
-
<div id="mlcad-layer-list"></div>
|
|
454
|
-
</div>
|
|
455
|
-
</aside>
|
|
456
|
-
${e==="measure"?'<footer id="mlcad-status-bar" aria-live="polite"></footer>':""}
|
|
457
|
-
</div>`}function ke(){return'<div class="mlcad-tool-separator" aria-hidden="true"></div>'}function La(){return`
|
|
458
|
-
${U(M.measureDistance,"Measure distance",{"data-action":"measure","data-measure-mode":"distance","data-i18n-key":"toolbar.measureDistance","data-i18n-attr":"title aria-label"})}
|
|
459
|
-
${U(M.measureAngle,"Measure angle",{"data-action":"measure","data-measure-mode":"angle","data-i18n-key":"toolbar.measureAngle","data-i18n-attr":"title aria-label"})}
|
|
460
|
-
${U(M.measureArc,"Measure arc length",{"data-action":"measure","data-measure-mode":"arc","data-i18n-key":"toolbar.measureArc","data-i18n-attr":"title aria-label"})}
|
|
461
|
-
${U(M.measureArea,"Measure area",{"data-action":"measure","data-measure-mode":"area","data-i18n-key":"toolbar.measureArea","data-i18n-attr":"title aria-label"})}
|
|
462
|
-
${U(M.measureCoordinate,"Measure coordinates",{"data-action":"measure","data-measure-mode":"coordinate","data-i18n-key":"toolbar.measureCoordinate","data-i18n-attr":"title aria-label"})}
|
|
463
|
-
${U(M.clearMeasurements,"Clear measurements",{"data-action":"clear-measurements","data-i18n-key":"toolbar.clearMeasurements","data-i18n-attr":"title aria-label"})}`}function Sa(){return U(M.setting,"Measure settings",{id:"mlcad-settings-btn","aria-haspopup":"true","aria-expanded":"false","data-i18n-key":"toolbar.settings","data-i18n-attr":"title aria-label"})}function Me(t,e){const n=e.title??t.meta.title??"CAD Drawing",r=or(t),a=e.viewerRuntime,i=lr(),o=r.compression,l=`#${t.meta.background.toString(16).padStart(6,"0")}`,s=ra(t.meta.locale)??"en",c=t.meta.viewerMode??"measure";return`<!DOCTYPE html>
|
|
464
|
-
<html lang="${s}">
|
|
465
|
-
<head>
|
|
466
|
-
<meta charset="utf-8" />
|
|
467
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
468
|
-
<meta name="generator" content="mlightcad-cad-html-plugin" />
|
|
469
|
-
<title>${za(n)}</title>
|
|
470
|
-
<style>${Ma}</style>
|
|
471
|
-
</head>
|
|
472
|
-
<body>
|
|
473
|
-
${Ca(l,c)}
|
|
474
|
-
<script id="mlcad-snapshot" type="${i}+${o};base64">${r.payload}<\/script>
|
|
475
|
-
<script>${Pa(a)}<\/script>
|
|
476
|
-
</body>
|
|
477
|
-
</html>`}function za(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Pa(t){return t.replace(/<\/script/gi,"<\\/script")}const Ia=400;function at(t={}){return{exportInvisibleLayers:t.exportInvisibleLayers!==!1,initialView:t.initialView??"fit",viewerMode:t.viewerMode??"measure"}}function Ba(t){const e=t.activeLayoutView,n=e.center,r=e.trCamera.zoom,a=Math.max(e.height,1),i=r*(2*Ia)/a;return{centerX:n.x,centerY:n.y,zoom:i}}const Ua="./viewer-runtime.iife.js";let mt={};function $a(t){mt={...mt,...t}}function ja(){return{...mt}}function Ta(t){return t!=null?String(t):mt.viewerRuntimeUrl!=null?String(mt.viewerRuntimeUrl):Ua}function Ha(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function Fa(t,e,n){if(e.length<3)return;const r=n[0],a=n[1];for(let i=0;i+2<e.length;i+=3){const o=we(e[i],r),l=we(e[i+1],a);t.valid?(o<t.minX&&(t.minX=o),o>t.maxX&&(t.maxX=o),l<t.minY&&(t.minY=l),l>t.maxY&&(t.maxY=l)):(t.minX=t.maxX=o,t.minY=t.maxY=l,t.valid=!0)}}function Ce(t,e){Fa(t,e.positions,e.offset)}function Da(t){return t.valid?{minX:t.minX,minY:t.minY,maxX:t.maxX,maxY:t.maxY}:null}function Ra(t,e){const n=Ha();for(const r of t)Ce(n,r);for(const r of e)Ce(n,r);return Da(n)}class Va{build(e,n,r={}){return this.buildSync(e,n,r)}async buildAsync(e,n,r={}){await D();const a=r.exportInvisibleLayers!==!1,i=a?void 0:c=>rt(e,c,a),o=be(n,{title:r.title,background:r.background}),l=[];e.layers.forEach(c=>{rt(e,c.name,a)&&l.push({name:c.name,color:c.color.RGB??16777215,visible:!c.isOff&&!c.isFrozen})});const s=[];for(const[c,d]of e.layouts){const u=[],f=[];for(const[,p]of d.layers){if(!rt(e,p.name,a))continue;const g=ve(p.internalObject);u.push(...g.lineBatches),f.push(...g.meshBatches),await D()}s.push({btrId:c,name:ze(n,c),isModelSpace:c===e.modelSpaceBtrId,lineBatches:u,meshBatches:f,osnap:Se(r)?Ae(n,c,{includeLayer:i}):void 0}),await D()}return{version:ft,meta:Le(o,r,s,e.activeLayoutBtrId||e.modelSpaceBtrId),layers:l,layouts:s,activeLayoutBtrId:e.activeLayoutBtrId||e.modelSpaceBtrId}}buildSync(e,n,r){const a=r.exportInvisibleLayers!==!1,i=a?void 0:c=>rt(e,c,a),o=be(n,{title:r.title,background:r.background}),l=[];e.layers.forEach(c=>{rt(e,c.name,a)&&l.push({name:c.name,color:c.color.RGB??16777215,visible:!c.isOff&&!c.isFrozen})});const s=[];return e.layouts.forEach((c,d)=>{const u=[],f=[];for(const[,p]of c.layers){if(!rt(e,p.name,a))continue;const g=ve(p.internalObject);u.push(...g.lineBatches),f.push(...g.meshBatches)}s.push({btrId:d,name:ze(n,d),isModelSpace:d===e.modelSpaceBtrId,lineBatches:u,meshBatches:f,osnap:Se(r)?Ae(n,d,{includeLayer:i}):void 0})}),{version:ft,meta:Le(o,r,s,e.activeLayoutBtrId||e.modelSpaceBtrId),layers:l,layouts:s,activeLayoutBtrId:e.activeLayoutBtrId||e.modelSpaceBtrId}}}function Le(t,e,n,r){const a=n.find(l=>l.btrId===r)??n[0],i=a?Ra(a.lineBatches,a.meshBatches):null,o=e.initialView??"fit";return{title:t.title,createdAt:new Date().toISOString(),extents:t.extents,viewExtents:i??void 0,units:t.units,background:t.background,locale:e.locale??v.currentLocale,initialView:o,viewState:o==="current"?e.viewState:void 0,viewerMode:e.viewerMode??"measure"}}function Se(t){return(t.viewerMode??"measure")==="measure"}function rt(t,e,n){if(n)return!0;const r=t.layers.get(e);return r?!r.isOff&&!r.isFrozen:!0}function ze(t,e){for(const n of t.tables.blockTable.newIterator())if(n.objectId===e)return n.name;return e}class Oa{constructor(e={}){this.options=e,this._snapshotBuilder=new Va}async prepareAcTrView2dForHtmlExport(e,n={}){if(!e||!("cadScene"in e)||!e.cadScene)throw new Error("CAD scene is not available. Open a drawing before exporting to HTML.");if(!(e instanceof Ze))throw new Error("HTML export requires a 2D CAD view. Open a drawing before exporting.");const r=at(n);return await e.ensureEntitiesConvertedForExport({includeInvisibleLayers:r.exportInvisibleLayers}),await D(),e}async convert(e,n={},r){const a=dt.instance,i=at(n);await a.withBusyIndicator(async()=>{await D();const o=a.curDocument,l=await this.prepareAcTrView2dForHtmlExport(r??a.curView,i),s=e||o.fileName||o.docTitle,c=await this._snapshotBuilder.buildAsync(l.cadScene,o.database,{title:Ye(s),background:l.backgroundColor,exportInvisibleLayers:i.exportInvisibleLayers,initialView:i.initialView,viewerMode:i.viewerMode,viewState:i.initialView==="current"?Ba(l):void 0});await D();const d=await this.loadViewerRuntime();await D();const u=Me(c,{title:c.meta.title,viewerRuntime:d});await D(),this.downloadHtml(u,Xe(s,"html"))})}async packSnapshot(e,n){await dt.instance.withBusyIndicator(async()=>{await D();const r=await this.loadViewerRuntime();await D();const a=Me(e,{title:e.meta.title,viewerRuntime:r});await D(),this.downloadHtml(a,n)})}async loadViewerRuntime(){const e=Ta(this.options.viewerRuntimeUrl),n=await fetch(e);if(!n.ok)throw new Error(`Failed to load HTML viewer runtime from "${e}" (${n.status}). Install @mlightcad/cad-html-plugin, copy viewer-runtime.iife.js to your app assets, and set viewerRuntimeUrl on registerLazyHtmlPlugin / createHtmlPlugin / AcApHtmlConvertor.`);return n.text()}downloadHtml(e,n){const r=new Blob([e],{type:"text/html;charset=utf-8"}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.setTimeout(()=>URL.revokeObjectURL(a),6e4)}}class _a extends Ne{constructor(e={}){super(),this.pluginOptions=e}async execute(e){const n=await this.promptOptions();n&&await new Oa(this.pluginOptions).convert(e.doc.fileName||e.doc.docTitle,n,e.view)}async promptOptions(){const e=await this.promptExportInvisibleLayers();if(e===void 0)return;const n=await this.promptInitialView();if(n===void 0)return;const r=await this.promptViewerMode();if(r!==void 0)return at({exportInvisibleLayers:e,initialView:n,viewerMode:r})}async promptExportInvisibleLayers(){const e=at(),n=new Ct(v.t("jig.chtml.exportInvisibleLayers"));n.allowNone=!0;const r=n.keywords.add(v.t("jig.chtml.keywords.yes.display"),v.t("jig.chtml.keywords.yes.global"),v.t("jig.chtml.keywords.yes.local")),a=n.keywords.add(v.t("jig.chtml.keywords.no.display"),v.t("jig.chtml.keywords.no.global"),v.t("jig.chtml.keywords.no.local"));n.keywords.default=e.exportInvisibleLayers?r:a;const i=await dt.instance.editor.getKeywords(n);if(i.status!==B.Cancel){if(i.status===B.None)return e.exportInvisibleLayers;if(i.status===B.OK||i.status===B.Keyword)return i.stringResult?i.stringResult==="Yes":e.exportInvisibleLayers}}async promptInitialView(){const e=at(),n=new Ct(v.t("jig.chtml.initialView"));n.allowNone=!0;const r=n.keywords.add(v.t("jig.chtml.keywords.extents.display"),v.t("jig.chtml.keywords.extents.global"),v.t("jig.chtml.keywords.extents.local")),a=n.keywords.add(v.t("jig.chtml.keywords.current.display"),v.t("jig.chtml.keywords.current.global"),v.t("jig.chtml.keywords.current.local"));n.keywords.default=e.initialView==="current"?a:r;const i=await dt.instance.editor.getKeywords(n);if(i.status!==B.Cancel){if(i.status===B.None)return e.initialView;if(i.status===B.OK||i.status===B.Keyword)return i.stringResult?i.stringResult==="Current"?"current":"fit":e.initialView}}async promptViewerMode(){const e=at(),n=new Ct(v.t("jig.chtml.viewerMode"));n.allowNone=!0;const r=n.keywords.add(v.t("jig.chtml.keywords.view.display"),v.t("jig.chtml.keywords.view.global"),v.t("jig.chtml.keywords.view.local")),a=n.keywords.add(v.t("jig.chtml.keywords.measure.display"),v.t("jig.chtml.keywords.measure.global"),v.t("jig.chtml.keywords.measure.local"));n.keywords.default=e.viewerMode==="view"?r:a;const i=await dt.instance.editor.getKeywords(n);if(i.status!==B.Cancel){if(i.status===B.None)return e.viewerMode;if(i.status===B.OK||i.status===B.Keyword)return i.stringResult?i.stringResult==="View"?"view":"measure":e.viewerMode}}}const Ea="1.5.11",Na={version:Ea};class Za{constructor(e={}){this.options=e,this.name="HtmlPlugin",this.version=Na.version,this.description="HTML export (-chtml) command",this.registeredCommands=[]}onLoad(e,n){const r=Ee.SYSTEMT_COMMAND_GROUP_NAME,a=new _a(this.options);n.addCommand(r,"-chtml","-chtml",a),this.registeredCommands.push({group:r,name:"-chtml"}),n.lookupGlobalCmd("chtml")||(n.addCommand(r,"chtml","chtml",a),this.registeredCommands.push({group:r,name:"chtml"}))}onUnload(e,n){for(const r of this.registeredCommands)n.removeCmd(r.group,r.name);this.registeredCommands=[]}}async function Xa(t={}){return t.viewerRuntimeUrl!=null&&$a(t),new Za(ja())}export{Kn as ACEX_SNAPSHOT_COMPRESSION,ft as ACEX_SNAPSHOT_VERSION,_a as AcApExportHtmlCmd,Oa as AcApHtmlConvertor,Va as AcApHtmlSnapshotBuilder,Ua as DEFAULT_HTML_VIEWER_RUNTIME_URL,Ka as HTML_PLUGIN_NAME,Ja as HTML_PLUGIN_TRIGGERS,Ae as buildOsnapCatalog,be as buildViewerMetadata,Ba as captureAcApHtmlViewState,ve as collectBatchesFromObject3D,Jn as compressSnapshotBinary,$a as configureHtmlPlugin,Xa as createHtmlPlugin,or as encodeSnapshot,tr as encodeSnapshotBinary,br as exportActiveBatchedLine2Slice,Xt as exportActiveBatchedSlice,ye as exportBufferGeometrySlice,ja as getHtmlPluginOptions,Me as packHtml,at as resolveAcApHtmlExportOptions,ra as resolveAcExHtmlLocale,Ta as resolveViewerRuntimeUrl,lr as snapshotMimeType};
|