@mlightcad/cad-html-core 1.8.0-preview.5 → 1.8.0-preview.6
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/cad-html-core.js +1360 -1351
- package/dist/cad-html-core.umd.cjs +29 -29
- package/lib/AcExHtmlOsnapPrimitiveBuilder.d.ts.map +1 -1
- package/lib/AcExHtmlOsnapPrimitiveBuilder.js +8 -5
- package/lib/AcExHtmlOsnapPrimitiveBuilder.js.map +1 -1
- package/lib/AcExHtmlPackagePreview.d.ts +19 -0
- package/lib/AcExHtmlPackagePreview.d.ts.map +1 -0
- package/lib/AcExHtmlPackagePreview.js +49 -0
- package/lib/AcExHtmlPackagePreview.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(m,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("@mlightcad/three-renderer"),require("three"),require("three/examples/jsm/lines/LineMaterial.js"),require("three/examples/jsm/lines/LineSegments2.js"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/three-renderer","three","three/examples/jsm/lines/LineMaterial.js","three/examples/jsm/lines/LineSegments2.js","@mlightcad/data-model"],P):(m=typeof globalThis<"u"?globalThis:m||self,P(m["cad-html-core"]={},m.threeRenderer,m.THREE,m.LineMaterial_js,m.LineSegments2_js,m.dataModel))})(this,(function(m,P,_i,Lr,Bi,w){"use strict";function Ti(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=Ti(_i);var I=Uint8Array,G=Uint16Array,en=Int32Array,ot=new I([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]),it=new I([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]),tn=new I([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ar=function(e,t){for(var n=new G(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new en(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return{b:n,r:a}},Cr=Ar(ot,2),Er=Cr.b,nn=Cr.r;Er[28]=258,nn[258]=28;for(var Hr=Ar(it,0),zi=Hr.b,Sr=Hr.r,rn=new G(32768),M=0;M<32768;++M){var le=(M&43690)>>1|(M&21845)<<1;le=(le&52428)>>2|(le&13107)<<2,le=(le&61680)>>4|(le&3855)<<4,rn[M]=((le&65280)>>8|(le&255)<<8)>>1}for(var q=(function(e,t,n){for(var r=e.length,a=0,o=new G(t);a<r;++a)e[a]&&++o[e[a]-1];var i=new G(t);for(a=1;a<t;++a)i[a]=i[a-1]+o[a-1]<<1;var l;if(n){l=new G(1<<t);var s=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],d=t-e[a],u=i[e[a]-1]++<<d,f=u|(1<<d)-1;u<=f;++u)l[rn[u]>>s]=c}else for(l=new G(r),a=0;a<r;++a)e[a]&&(l[a]=rn[i[e[a]-1]++]>>15-e[a]);return l}),ce=new I(288),M=0;M<144;++M)ce[M]=8;for(var M=144;M<256;++M)ce[M]=9;for(var M=256;M<280;++M)ce[M]=7;for(var M=280;M<288;++M)ce[M]=8;for(var Pe=new I(32),M=0;M<32;++M)Pe[M]=5;var Fi=q(ce,9,0),Oi=q(ce,9,1),Ri=q(Pe,5,0),Di=q(Pe,5,1),an=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},W=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},on=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},sn=function(e){return(e+7)/8|0},Ie=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new I(e.subarray(t,n))},Ui=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],O=function(e,t,n){var r=new Error(t||Ui[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,O),!n)throw r;return r},Mr=function(e,t,n,r){var a=e.length,o=r?r.length:0;if(!a||t.f&&!t.l)return n||new I(0);var i=!n,l=i||t.i!=2,s=t.i;i&&(n=new I(a*3));var c=function(rt){var at=n.length;if(rt>at){var Me=new I(Math.max(at*2,rt));Me.set(n),n=Me}},d=t.f||0,u=t.p||0,f=t.b||0,p=t.l,h=t.d,g=t.m,y=t.n,v=a*8;do{if(!p){d=W(e,u,1);var x=W(e,u+1,3);if(u+=3,x)if(x==1)p=Oi,h=Di,g=9,y=5;else if(x==2){var H=W(e,u,31)+257,S=W(e,u+10,15)+4,A=H+W(e,u+5,31)+1;u+=14;for(var k=new I(A),D=new I(19),F=0;F<S;++F)D[tn[F]]=W(e,u+F*3,7);u+=S*3;for(var X=an(D),pe=(1<<X)-1,$=q(D,X,1),F=0;F<A;){var V=$[W(e,u,pe)];u+=V&15;var b=V>>4;if(b<16)k[F++]=b;else{var U=0,_=0;for(b==16?(_=3+W(e,u,3),u+=2,U=k[F-1]):b==17?(_=3+W(e,u,7),u+=3):b==18&&(_=11+W(e,u,127),u+=7);_--;)k[F++]=U}}var Y=k.subarray(0,H),N=k.subarray(H);g=an(Y),y=an(N),p=q(Y,g,1),h=q(N,y,1)}else O(1);else{var b=sn(u)+4,L=e[b-4]|e[b-3]<<8,E=b+L;if(E>a){s&&O(0);break}l&&c(f+L),n.set(e.subarray(b,E),f),t.b=f+=L,t.p=u=E*8,t.f=d;continue}if(u>v){s&&O(0);break}}l&&c(f+131072);for(var nt=(1<<g)-1,Z=(1<<y)-1,se=u;;se=u){var U=p[on(e,u)&nt],j=U>>4;if(u+=U&15,u>v){s&&O(0);break}if(U||O(2),j<256)n[f++]=j;else if(j==256){se=u,p=null;break}else{var K=j-254;if(j>264){var F=j-257,B=ot[F];K=W(e,u,(1<<B)-1)+Er[F],u+=B}var re=h[on(e,u)&Z],He=re>>4;re||O(3),u+=re&15;var N=zi[He];if(He>3){var B=it[He];N+=on(e,u)&(1<<B)-1,u+=B}if(u>v){s&&O(0);break}l&&c(f+131072);var Se=f+K;if(f<N){var qt=o-N,Qt=Math.min(N,Se);for(qt+f<0&&O(3);f<Qt;++f)n[f]=r[qt+f]}for(;f<Se;++f)n[f]=n[f-N]}}t.l=p,t.p=se,t.b=f,t.f=d,p&&(d=1,t.m=g,t.d=h,t.n=y)}while(!d);return f!=n.length&&i?Ie(n,0,f):n.subarray(0,f)},ae=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},_e=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},ln=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return{t:Br,l:0};if(a==1){var i=new I(n[0].s+1);return i[n[0].s]=1,{t:i,l:1}}n.sort(function(E,H){return E.f-H.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=o[0].s,r=1;r<a;++r)o[r].s>f&&(f=o[r].s);var p=new G(f+1),h=cn(n[d-1],p,0);if(h>t){var r=0,g=0,y=h-t,v=1<<y;for(o.sort(function(H,S){return p[S.s]-p[H.s]||H.f-S.f});r<a;++r){var x=o[r].s;if(p[x]>t)g+=v-(1<<h-p[x]),p[x]=t;else break}for(g>>=y;g>0;){var b=o[r].s;p[b]<t?g-=1<<t-p[b]++-1:++r}for(;r>=0&&g;--r){var L=o[r].s;p[L]==t&&(--p[L],++g)}h=t}return{t:new I(p),l:h}},cn=function(e,t,n){return e.s==-1?Math.max(cn(e.l,t,n+1),cn(e.r,t,n+1)):t[e.s]=n},Pr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new G(++t),r=0,a=e[0],o=1,i=function(s){n[r++]=s},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=e[l]}return{c:n.subarray(0,r),n:t}},Be=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ir=function(e,t,n){var r=n.length,a=sn(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},_r=function(e,t,n,r,a,o,i,l,s,c,d){ae(t,d++,n),++a[256];for(var u=ln(a,15),f=u.t,p=u.l,h=ln(o,15),g=h.t,y=h.l,v=Pr(f),x=v.c,b=v.n,L=Pr(g),E=L.c,H=L.n,S=new G(19),A=0;A<x.length;++A)++S[x[A]&31];for(var A=0;A<E.length;++A)++S[E[A]&31];for(var k=ln(S,7),D=k.t,F=k.l,X=19;X>4&&!D[tn[X-1]];--X);var pe=c+5<<3,$=Be(a,ce)+Be(o,Pe)+i,V=Be(a,f)+Be(o,g)+i+14+3*X+Be(S,D)+2*S[16]+3*S[17]+7*S[18];if(s>=0&&pe<=$&&pe<=V)return Ir(t,d,e.subarray(s,s+c));var U,_,Y,N;if(ae(t,d,1+(V<$)),d+=2,V<$){U=q(f,p,0),_=f,Y=q(g,y,0),N=g;var nt=q(D,F,0);ae(t,d,b-257),ae(t,d+5,H-1),ae(t,d+10,X-4),d+=14;for(var A=0;A<X;++A)ae(t,d+3*A,D[tn[A]]);d+=3*X;for(var Z=[x,E],se=0;se<2;++se)for(var j=Z[se],A=0;A<j.length;++A){var K=j[A]&31;ae(t,d,nt[K]),d+=D[K],K>15&&(ae(t,d,j[A]>>5&127),d+=j[A]>>12)}}else U=Fi,_=ce,Y=Ri,N=Pe;for(var A=0;A<l;++A){var B=r[A];if(B>255){var K=B>>18&31;_e(t,d,U[K+257]),d+=_[K+257],K>7&&(ae(t,d,B>>23&31),d+=ot[K]);var re=B&31;_e(t,d,Y[re]),d+=N[re],re>3&&(_e(t,d,B>>5&8191),d+=it[re])}else _e(t,d,U[B]),d+=_[B]}return _e(t,d,U[256]),d+_[256]},Ni=new en([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Br=new I(0),Xi=function(e,t,n,r,a,o){var i=o.z||e.length,l=new I(r+i+5*(1+Math.ceil(i/7e3))+a),s=l.subarray(r,l.length-a),c=o.l,d=(o.r||0)&7;if(t){d&&(s[0]=o.r>>3);for(var u=Ni[t-1],f=u>>13,p=u&8191,h=(1<<n)-1,g=o.p||new G(32768),y=o.h||new G(h+1),v=Math.ceil(n/3),x=2*v,b=function(kr){return(e[kr]^e[kr+1]<<v^e[kr+2]<<x)&h},L=new en(25e3),E=new G(288),H=new G(32),S=0,A=0,k=o.i||0,D=0,F=o.w||0,X=0;k+2<i;++k){var pe=b(k),$=k&32767,V=y[pe];if(g[$]=V,y[pe]=$,F<=k){var U=i-k;if((S>7e3||D>24576)&&(U>423||!c)){d=_r(e,s,0,L,E,H,A,D,X,k-X,d),D=S=A=0,X=k;for(var _=0;_<286;++_)E[_]=0;for(var _=0;_<30;++_)H[_]=0}var Y=2,N=0,nt=p,Z=$-V&32767;if(U>2&&pe==b(k-Z))for(var se=Math.min(f,U)-1,j=Math.min(32767,k),K=Math.min(258,U);Z<=j&&--nt&&$!=V;){if(e[k+Y]==e[k+Y-Z]){for(var B=0;B<K&&e[k+B]==e[k+B-Z];++B);if(B>Y){if(Y=B,N=Z,B>se)break;for(var re=Math.min(Z,B-2),He=0,_=0;_<re;++_){var Se=k-Z+_&32767,qt=g[Se],Qt=Se-qt&32767;Qt>He&&(He=Qt,V=Se)}}}$=V,V=g[$],Z+=$-V&32767}if(N){L[D++]=268435456|nn[Y]<<18|Sr[N];var rt=nn[Y]&31,at=Sr[N]&31;A+=ot[rt]+it[at],++E[257+rt],++H[at],F=k+Y,++S}else L[D++]=e[k],++E[e[k]]}}for(k=Math.max(k,F);k<i;++k)L[D++]=e[k],++E[e[k]];d=_r(e,s,c,L,E,H,A,D,X,k-X,d),c||(o.r=d&7|s[d/8|0]<<3,d-=7,o.h=y,o.p=g,o.i=k,o.w=F)}else{for(var k=o.w||0;k<i+c;k+=65535){var Me=k+65535;Me>=i&&(s[d/8|0]=c,Me=i),d=Ir(s,d+1,e.subarray(k,Me))}o.i=i}return Ie(l,0,r+sn(d)+a)},Vi=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Tr=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Vi[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},zr=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),i=new I(o.length+e.length);i.set(o),i.set(e,o.length),e=i,a.w=o.length}return Xi(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},Fr=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Q=function(e,t){return e[t]|e[t+1]<<8},J=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},dn=function(e,t){return J(e,t)+J(e,t+4)*4294967296},T=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Yi=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&T(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Gi=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&O(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},$i=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ji=function(e){return 10+(e.filename?e.filename.length+1:0)};function Ki(e,t){return zr(e,t||{},0,0)}function Zi(e,t){return Mr(e,{i:2},t&&t.out,t&&t.dictionary)}function Wi(e,t){t||(t={});var n=Tr(),r=e.length;n.p(e);var a=zr(e,t,ji(t),8),o=a.length;return Yi(a,t),T(a,o-8,n.d()),T(a,o-4,r),a}function Ji(e,t){var n=Gi(e);return n+8>e.length&&O(6,"invalid gzip data"),Mr(e.subarray(n,-8),{i:2},new I($i(e)),t)}var Or=function(e,t,n,r){for(var a in e){var o=e[a],i=t+a,l=r;Array.isArray(o)&&(l=Fr(r,o[1]),o=o[0]),o instanceof I?n[i]=[o,l]:(n[i+="/"]=[new I(0),l],Or(o,i,n,r))}},Rr=typeof TextEncoder<"u"&&new TextEncoder,un=typeof TextDecoder<"u"&&new TextDecoder,qi=0;try{un.decode(Br,{stream:!0}),qi=1}catch{}var Qi=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return{s:t,r:Ie(e,n-1)};a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function xe(e,t){var n;if(Rr)return Rr.encode(e);for(var r=e.length,a=new I(e.length+(e.length>>1)),o=0,i=function(c){a[o++]=c},n=0;n<r;++n){if(o+5>a.length){var l=new I(o+8+(r-n<<1));l.set(a),a=l}var s=e.charCodeAt(n);s<128||t?i(s):s<2048?(i(192|s>>6),i(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|e.charCodeAt(++n)&1023,i(240|s>>18),i(128|s>>12&63),i(128|s>>6&63),i(128|s&63)):(i(224|s>>12),i(128|s>>6&63),i(128|s&63))}return Ie(a,0,o)}function mn(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(un)return un.decode(e);var a=Qi(e),o=a.s,n=a.r;return n.length&&O(8),o}}var es=function(e,t){return t+30+Q(e,t+26)+Q(e,t+28)},ts=function(e,t,n){var r=Q(e,t+28),a=mn(e.subarray(t+46,t+46+r),!(Q(e,t+8)&2048)),o=t+46+r,i=J(e,t+20),l=n&&i==4294967295?ns(e,o):[i,J(e,t+24),J(e,t+42)],s=l[0],c=l[1],d=l[2];return[Q(e,t+10),s,c,a,o+Q(e,t+30)+Q(e,t+32),d]},ns=function(e,t){for(;Q(e,t)!=1;t+=4+Q(e,t+2));return[dn(e,t+12),dn(e,t+4),dn(e,t+20)]},pn=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&O(9),t+=r+4}return t},Dr=function(e,t,n,r,a,o,i,l){var s=r.length,c=n.extra,d=l&&l.length,u=pn(c);T(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=a&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&O(10),T(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,o!=-1&&(T(e,t,n.crc),T(e,t+4,o<0?-o-2:o),T(e,t+8,n.size)),T(e,t+12,s),T(e,t+14,u),t+=16,i!=null&&(T(e,t,d),T(e,t+6,n.attrs),T(e,t+10,i),t+=14),e.set(r,t),t+=s,u)for(var h in c){var g=c[h],y=g.length;T(e,t,+h),T(e,t+2,y),e.set(g,t+4),t+=4+y}return d&&(e.set(l,t),t+=d),t},rs=function(e,t,n,r,a){T(e,t,101010256),T(e,t+8,n),T(e,t+10,n),T(e,t+12,r),T(e,t+16,a)};function as(e,t){t||(t={});var n={},r=[];Or(e,"",n,t);var a=0,o=0;for(var i in n){var l=n[i],s=l[0],c=l[1],d=c.level==0?0:8,u=xe(i),f=u.length,p=c.comment,h=p&&xe(p),g=h&&h.length,y=pn(c.extra);f>65535&&O(11);var v=d?Ki(s,c):s,x=v.length,b=Tr();b.p(s),r.push(Fr(c,{size:s.length,crc:b.d(),c:v,f:u,m:h,u:f!=i.length||h&&p.length!=g,o:a,compression:d})),a+=30+f+y+x,o+=76+2*(f+y)+(g||0)+x}for(var L=new I(o+22),E=a,H=o-a,S=0;S<r.length;++S){var u=r[S];Dr(L,u.o,u,u.f,u.u,u.c.length);var A=30+u.f.length+pn(u.extra);L.set(u.c,u.o+A),Dr(L,a,u,u.f,u.u,u.c.length,u.o,u.m),a+=16+A+(u.m?u.m.length:0)}return rs(L,a,r.length,H,E),L}function os(e,t){for(var n={},r=e.length-22;J(e,r)!=101010256;--r)(!r||e.length-r>65558)&&O(13);var a=Q(e,r+8);if(!a)return{};var o=J(e,r+16),i=o==4294967295||a==65535;if(i){var l=J(e,r-12);i=J(e,l)==101075792,i&&(a=J(e,l+32),o=J(e,l+48))}for(var s=0;s<a;++s){var c=ts(e,o,i),d=c[0],u=c[1],f=c[2],p=c[3],h=c[4],g=c[5],y=es(e,g);o=h,d?d==8?n[p]=Zi(e.subarray(y,y+u),{out:new I(f)}):O(14,"unknown compression type "+d):n[p]=Ie(e,y,y+u)}return n}const Ur=512*1024*1024,fn=512*1024*1024;class st{constructor(){this.chunks=[],this.length=0}writeU8(t){const n=new Uint8Array(1);n[0]=t&255,this.chunks.push(n),this.length+=1}writeU32(t){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t>>>0,!0),this.chunks.push(n),this.length+=4}writeI32(t){const n=new Uint8Array(4);new DataView(n.buffer).setInt32(0,t|0,!0),this.chunks.push(n),this.length+=4}writeF32(t){const n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,t,!0),this.chunks.push(n),this.length+=4}writeF64(t){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,t,!0),this.chunks.push(n),this.length+=8}writeBytes(t){this.chunks.push(t),this.length+=t.length}writeString(t){const n=xe(t);this.writeU32(n.length),this.writeBytes(n)}writeJson(t){this.writeString(JSON.stringify(t))}writeFloat32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}writeUint32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}alignTo(t){const n=this.length%t;if(n===0)return;const r=t-n;for(let a=0;a<r;a++)this.writeU8(0)}toUint8Array(){const t=new Uint8Array(this.length);let n=0;for(const r of this.chunks)t.set(r,n),n+=r.length;return t}}class lt{constructor(t){this.bytes=t,this.offset=0}ensureAvailable(t){if(t<0||!Number.isFinite(t))throw new Error("Invalid binary length");if(this.offset+t>this.bytes.length)throw new Error("Unexpected end of binary buffer")}readU8(){return this.ensureAvailable(1),this.bytes[this.offset++]}readU32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getUint32(0,!0);return this.offset+=4,n}readI32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getInt32(0,!0);return this.offset+=4,n}readF32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getFloat32(0,!0);return this.offset+=4,n}readF64(){this.ensureAvailable(8);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,8).getFloat64(0,!0);return this.offset+=8,n}readBytes(t){this.ensureAvailable(t);const n=this.bytes.subarray(this.offset,this.offset+t);return this.offset+=t,n}readString(){const t=this.readU32();if(t===0)return"";if(t>Ur)throw new Error("Binary string exceeds size limit");return mn(this.readBytes(t))}readJson(){const t=this.readString();if(t.length===0)throw new Error("Expected JSON payload");return JSON.parse(t)}alignTo(t){const n=this.offset%t;if(n===0)return;const r=t-n;this.ensureAvailable(r),this.offset+=r}readFloat32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Float32Array(0);if(t%4!==0)throw new Error("Invalid float32 buffer length");if(t>fn)throw new Error("Float32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Float32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Float32Array(r)}readUint32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Uint32Array(0);if(t%4!==0)throw new Error("Invalid uint32 buffer length");if(t>fn)throw new Error("Uint32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Uint32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Uint32Array(r)}}const R=4,ct="gzip",Nr=512*1024*1024,dt=256*1024*1024;let Te=null;function is(e){Te=e}function we(e){return{bytes:Te?Te.gzipSync(e):Wi(e),compression:ct}}async function hn(e){if(Te)return{bytes:await Te.gzip(e),compression:ct};if(typeof CompressionStream>"u")return we(e);try{const t=new Uint8Array(e.byteLength);t.set(e);const n=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip"));return{bytes:new Uint8Array(await new Response(n).arrayBuffer()),compression:ct}}catch{return we(e)}}function gn(e){return e.byteLength>=2&&e[0]===31&&e[1]===139}function ut(e){if(e.byteLength>dt)throw new Error("Compressed payload exceeds size limit");const t=Ji(e);if(t.byteLength>Nr)throw new Error("Decompressed payload exceeds size limit");return t}const mt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%()*+,-.;=?@[]^_{|}~",yn=new Int16Array(128).fill(-1);for(let e=0;e<mt.length;e++)yn[mt.charCodeAt(e)]=e;function xn(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes(";base85")||t.endsWith("base85")?"base85":"base64"}function ve(e,t){return t==="base85"?Xr(e):ls(e)}function ze(e,t){const n=e.length>0&&(e.charCodeAt(0)<=32||e.charCodeAt(e.length-1)<=32)?e.trim():e;return t==="base85"?Vr(n):cs(n)}function Xr(e){const t=e.length;if(t===0)return"";const n=(4-t%4)%4,r=t+n,a=[];for(let i=0;i<r;i+=4){const l=e[i]??0,s=i+1<t?e[i+1]:0,c=i+2<t?e[i+2]:0,d=i+3<t?e[i+3]:0;let u=(l<<24>>>0)+(s<<16)+(c<<8)+d;const f=new Array(5);for(let p=4;p>=0;p--)f[p]=u%85,u=u/85|0;for(let p=0;p<5;p++)a.push(mt[f[p]])}const o=Math.ceil(t*5/4);return a.slice(0,o).join("")}function Vr(e){const t=e.replace(/\s+/g,""),n=t.length;if(n===0)return new Uint8Array(0);const r=Math.floor(n*4/5),a=(5-n%5)%5,o=n+a,i=new Uint8Array(o/5*4),l=mt.length-1;let s=0;for(let c=0;c<o;c+=5){let d=0;for(let u=0;u<5;u++){const f=c+u<n?ss(t.charCodeAt(c+u)):l;d=d*85+f}i[s++]=d>>>24&255,i[s++]=d>>>16&255,i[s++]=d>>>8&255,i[s++]=d&255}return i.subarray(0,r)}function ss(e){if(e<0||e>=yn.length)throw new Error("Invalid base85 character");const t=yn[e];if(t<0)throw new Error("Invalid base85 character");return t}function ls(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function cs(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const pt=1,ft=2,ht=4,gt=8,yt=16,wn=32,xt=1,wt=2,vt=4,bt=8,kt=16,vn=32,Lt=64,At=128;function Ct(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.lineDistances&&(t+=e.lineDistances.byteLength),e.linePattern&&(t+=64+e.linePattern.pattern.length*8),t}function Et(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.gradientPositions&&(t+=e.gradientPositions.byteLength),e.uvs&&(t+=e.uvs.byteLength),e.texture&&(t+=e.texture.bytes.byteLength+64),e.hatchPattern&&(t+=128),e.gradientFill&&(t+=64),t}function bn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=pt),t.linePattern&&(n|=ft),t.lineDistances&&t.lineDistances.length>0&&(n|=ht),t.lineWidth!=null&&t.lineWidth>0&&(n|=gt),t.renderOrder!=null&&t.renderOrder!==0&&(n|=yt),t.excludeFromOsnap&&(n|=wn),e.writeU8(n),n&pt&&e.writeUint32Array(t.indices),n&ft&&e.writeJson(t.linePattern),n&ht&&e.writeFloat32Array(t.lineDistances),n>&&e.writeF32(t.lineWidth),n&yt&&e.writeI32(t.renderOrder)}function kn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};return o&pt&&(i.indices=e.readUint32Array()),o&ft&&(i.linePattern=e.readJson()),o&ht&&(i.lineDistances=e.readFloat32Array()),o>&&(i.lineWidth=e.readF32()),o&yt&&(i.renderOrder=e.readI32()),o&wn&&(i.excludeFromOsnap=!0),i}function Ln(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=xt),t.hatchPattern&&(n|=wt),t.gradientFill&&(n|=vt),t.gradientPositions&&t.gradientPositions.length>0&&(n|=bt),t.side!=null&&(n|=kt),t.points&&(n|=vn),t.renderOrder!=null&&t.renderOrder!==0&&(n|=Lt),t.texture&&t.texture.bytes.length>0&&t.uvs&&t.uvs.length>=2&&(n|=At),e.writeU8(n),n&xt&&e.writeUint32Array(t.indices),n&wt&&e.writeJson(t.hatchPattern),n&vt&&e.writeJson(t.gradientFill),n&bt&&e.writeFloat32Array(t.gradientPositions),n&kt&&e.writeU8(t.side),n&Lt&&e.writeI32(t.renderOrder),n&At&&(e.writeFloat32Array(t.uvs),e.writeString(t.texture.mimeType||"image/png"),e.writeU32(t.texture.bytes.byteLength),e.writeBytes(t.texture.bytes))}function An(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};if(o&xt&&(i.indices=e.readUint32Array()),o&wt&&(i.hatchPattern=e.readJson()),o&vt&&(i.gradientFill=e.readJson()),o&bt&&(i.gradientPositions=e.readFloat32Array()),o&kt&&(i.side=e.readU8()),o&vn&&(i.points=!0),o&Lt&&(i.renderOrder=e.readI32()),o&At){i.uvs=e.readFloat32Array();const l=e.readString()||"image/png",s=e.readU32();i.texture={mimeType:l,bytes:e.readBytes(s)}}return i}const Ht=1329939265,Cn=1,Yr=5e5,ds=1e5,Gr=1,$r=2,jr=3,Kr=4,Zr=5,Wr=6,Jr=7;function En(e){var t;switch(e.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+e.vertices.length*8;case"spline":return 10+(e.controlPoints.length+e.knots.length+e.weights.length+(((t=e.fitPoints)==null?void 0:t.length)??0))*8+16;default:return e}}function qr(e,t){if(e.length===0)return[];const n=[];let r=[],a=64;const o=()=>{r.length!==0&&(n.push(r),r=[],a=64)};for(const i of e){const l=En(i);r.length>0&&a+l>t&&o(),r.push(i),a+=l}return o(),n}function be(e){const t=new st;t.writeU32(Ht),t.writeU8(Cn),t.writeU8(0),t.writeU8(0),t.writeU8(0);const n=[],r=new Map,a=o=>{const i=r.get(o);if(i!=null)return i;const l=n.length;return n.push(o),r.set(o,l),l};for(const o of e.primitives)a(o.layer);t.writeU32(n.length);for(const o of n)t.writeString(o);t.writeU32(e.primitives.length);for(const o of e.primitives)ms(t,o,a(o.layer));return t.toUint8Array()}function St(e){const t=new lt(e);if(t.readU32()!==Ht)throw new Error("Invalid osnap catalog magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==Cn)throw new Error(`Unsupported osnap catalog version: ${r}`);const a=t.readU32();if(a>ds)throw new Error("Osnap layer count exceeds limit");const o=[];for(let s=0;s<a;s++)o.push(t.readString());const i=t.readU32();if(i>Yr)throw new Error("Osnap primitive count exceeds limit");const l=[];for(let s=0;s<i;s++)l.push(ps(t,o));return{primitives:l}}function Qr(e){const t=be(e),n=we(t).bytes;return{uncompressed:t,compressed:n}}async function us(e){const t=be(e),n=(await hn(t)).bytes;return{uncompressed:t,compressed:n}}function ea(e){return St(ut(e))}function ta(e){return gn(e)?ea(e):St(e)}function Hn(e,t){e.writeU8(t<0?0:1)}function Sn(e){return e.readU8()===0?-1:1}function Fe(e,t){e.writeU32(t.length);for(const n of t)e.writeF64(n)}function Oe(e){const t=e.readU32();if(t>Yr)throw new Error("Float64 array count exceeds limit");const n=[];for(let r=0;r<t;r++)n.push(e.readF64());return n}function ms(e,t,n){switch(t.kind){case"line":e.writeU8(Gr),e.writeU32(n),e.writeF64(t.x0),e.writeF64(t.y0),e.writeF64(t.x1),e.writeF64(t.y1);return;case"circle":e.writeU8($r),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),Hn(e,t.normalSign);return;case"arc":e.writeU8(jr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),e.writeF64(t.startAngle),e.writeF64(t.endAngle),Hn(e,t.normalSign);return;case"ellipse":e.writeU8(Kr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.majorX),e.writeF64(t.majorY),e.writeF64(t.majorR),e.writeF64(t.minorR),e.writeF64(t.startAngle),e.writeF64(t.endAngle),e.writeU8(t.closed?1:0),Hn(e,t.normalSign??1);return;case"spline":e.writeU8(Zr),e.writeU32(n),Fe(e,t.controlPoints),e.writeU32(t.degree),Fe(e,t.knots),Fe(e,t.weights),e.writeU8(t.closed?1:0),Fe(e,t.fitPoints??[]);return;case"point":e.writeU8(Wr),e.writeU32(n),e.writeF64(t.x),e.writeF64(t.y);return;case"path":e.writeU8(Jr),e.writeU32(n),e.writeU8(t.closed?1:0),Fe(e,t.vertices);return;default:{const r=t;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}function ps(e,t){const n=e.readU8(),r=e.readU32(),a=t[r];if(a==null)throw new Error(`Invalid osnap layer index: ${r}`);switch(n){case Gr:return{kind:"line",layer:a,x0:e.readF64(),y0:e.readF64(),x1:e.readF64(),y1:e.readF64()};case $r:return{kind:"circle",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),normalSign:Sn(e)};case jr:return{kind:"arc",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),normalSign:Sn(e)};case Kr:return{kind:"ellipse",layer:a,cx:e.readF64(),cy:e.readF64(),majorX:e.readF64(),majorY:e.readF64(),majorR:e.readF64(),minorR:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),closed:e.readU8()!==0,normalSign:Sn(e)};case Zr:{const o=Oe(e),i=e.readU32(),l=Oe(e),s=Oe(e),c=e.readU8()!==0,d=Oe(e);return{kind:"spline",layer:a,controlPoints:o,degree:i,knots:l,weights:s,closed:c,...d.length>0?{fitPoints:d}:{}}}case Wr:return{kind:"point",layer:a,x:e.readF64(),y:e.readF64()};case Jr:{const o=e.readU8()!==0,i=Oe(e);return{kind:"path",layer:a,closed:o,vertices:i}}default:throw new Error(`Unsupported osnap primitive kind: ${n}`)}}const na=1480934209;function ra(e){if(e.version!==R)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=new st;t.writeU32(na),t.writeU8(R),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeJson(fs(e)),t.writeJson(e.layers),t.writeString(e.activeLayoutBtrId),t.writeU32(e.layouts.length);for(const n of e.layouts)gs(t,n);return t.toUint8Array()}function aa(e){const t=new lt(e);if(t.readU32()!==na)throw new Error("Invalid snapshot magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==R)throw new Error(`Unsupported snapshot version: ${r}`);const a=t.readJson(),o=t.readJson(),i=t.readString(),l=t.readU32(),s=[];for(let c=0;c<l;c++)s.push(xs(t));return hs(s,a.savedViews,a.fitExtents),{version:R,meta:a,layers:o,layouts:s,activeLayoutBtrId:i}}function fs(e){const t={...e.meta.savedViews??{}},n={...e.meta.fitExtents??{}};for(const s of e.layouts)s.savedView&&(t[s.btrId]=s.savedView),s.fitExtents&&(n[s.btrId]=s.fitExtents);const r=Object.keys(t).length>0,a=Object.keys(n).length>0;if(!r&&!a){if(e.meta.savedViews==null&&e.meta.fitExtents==null)return e.meta;const{savedViews:s,fitExtents:c,...d}=e.meta;return d}const{savedViews:o,fitExtents:i,...l}=e.meta;return{...l,...r?{savedViews:t}:{},...a?{fitExtents:n}:{}}}function hs(e,t,n){if(!(!t&&!n))for(const r of e){if(!r.savedView){const a=t==null?void 0:t[r.btrId];a&&(r.savedView=a)}if(!r.fitExtents){const a=n==null?void 0:n[r.btrId];a&&(r.fitExtents=a)}}}function gs(e,t){e.writeString(t.btrId),e.writeString(t.name),e.writeU8(t.isModelSpace?1:0),ys(e,t.osnap),e.writeJson(t.viewports??null),e.writeU32(t.lineBatches.length);for(const n of t.lineBatches)bn(e,n);e.writeU32(t.meshBatches.length);for(const n of t.meshBatches)Ln(e,n)}function ys(e,t){if(!t||t.primitives.length===0){e.writeU32(0);return}const n=be(t);e.writeU32(n.length),e.writeBytes(n)}function xs(e){const t=e.readString(),n=e.readString(),r=e.readU8()!==0,a=vs(e),o=ws(e.readJson()),i=e.readU32(),l=[];for(let d=0;d<i;d++)l.push(kn(e));const s=e.readU32(),c=[];for(let d=0;d<s;d++)c.push(An(e));return{btrId:t,name:n,isModelSpace:r,lineBatches:l,meshBatches:c,osnap:a,viewports:o}}function ws(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="object")return e.viewports??void 0}}function vs(e){const t=e.readU32();if(t===0)return;const n=e.readBytes(t);if(bs(n))return St(n);const r=mn(n);if(!(r.length===0||r==="null"))return JSON.parse(r)}function bs(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Ht}const ks="application/vnd.mlightcad.acex-snapshot+binary";function oa(e){if(e.version!==R)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=ra(e),n=we(t);return{payload:ve(n.bytes,"base85"),compression:n.compression}}function Ls(e,t="base85"){return ia(sa(e,t))}function ia(e){const t=ut(e);return aa(t)}function sa(e,t="base85"){const n=t==="base64"||t==="base85"?t:xn(t);return ze(e,n)}function la(){return ks}function ee(e,t,n){if(n<=0)return new Float32Array(0);if(e instanceof Float32Array)return e.subarray(t,t+n).slice();const r=new Float32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function ca(e,t,n){if(n<=0)return new Uint32Array(0);const r=new Uint32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function Mn(e,t){if(t.length===0)return{positions:e,indices:t};let n=0;for(let a=0;a<t.length;a++){const o=t[a];o>n&&(n=o)}const r=(n+1)*3;return r>=e.length?{positions:e,indices:t}:{positions:ee(e,0,r),indices:t}}function Re(e,t){return e+t}const ke={x:0,y:0,z:0};function da(e){e.updateMatrixWorld(!0);const t=e.matrixWorld.elements;return ke.x=t[12],ke.y=t[13],ke.z=t[14],[ke.x,ke.y,ke.z]}function Mt(e,t){const n=t.elements,r=e.positions;if(r.length===0)return{positions:new Float32Array(0),indices:e.indices};const a=new Float32Array(r.length);for(let o=0;o<r.length;o+=3){const i=r[o],l=r[o+1],s=r[o+2];a[o]=n[0]*i+n[4]*l+n[8]*s+n[12],a[o+1]=n[1]*i+n[5]*l+n[9]*s+n[13],a[o+2]=n[2]*i+n[6]*l+n[10]*s+n[14]}return{positions:a,indices:e.indices?new Uint32Array(e.indices):void 0}}function ua(e,t){const n=t*3;return Number.isFinite(e[n])&&Number.isFinite(e[n+1])&&Number.isFinite(e[n+2])}function fe(e,t){const n=e.positions,r=n.length/3|0;if(r===0||t<=0)return e;let a=!1;for(let l=0;l<n.length;l++)if(!Number.isFinite(n[l])){a=!0;break}if(!a)return e;const o=e.indices;if(o&&o.length>0){const l=[];for(let u=0;u+t<=o.length;u+=t){let f=!0;for(let p=0;p<t;p++){const h=o[u+p];if(h<0||h>=r||!ua(n,h)){f=!1;break}}if(f)for(let p=0;p<t;p++)l.push(o[u+p])}if(l.length===0)return{positions:new Float32Array(0)};const s=new Int32Array(r);s.fill(-1);const c=[],d=new Uint32Array(l.length);for(let u=0;u<l.length;u++){const f=l[u];let p=s[f];if(p<0){p=c.length/3,s[f]=p;const h=f*3;c.push(n[h],n[h+1],n[h+2])}d[u]=p}return{positions:Float32Array.from(c),indices:d}}const i=[];for(let l=0;l+t<=r;l+=t){let s=!0;for(let c=0;c<t;c++)if(!ua(n,l+c)){s=!1;break}if(s)for(let c=0;c<t;c++){const d=(l+c)*3;i.push(n[d],n[d+1],n[d+2])}}return i.length===0?{positions:new Float32Array(0)}:{positions:Float32Array.from(i)}}function Pt(e){const t=e.positions;if(t.length<3)return{slice:e,offset:[0,0,0]};let n=1/0,r=1/0,a=1/0,o=-1/0,i=-1/0,l=-1/0,s=0;for(let u=0;u<t.length;u+=3){const f=t[u],p=t[u+1],h=t[u+2];!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(h)||(s++,n=Math.min(n,f),r=Math.min(r,p),a=Math.min(a,h),o=Math.max(o,f),i=Math.max(i,p),l=Math.max(l,h))}if(s===0)return{slice:{positions:new Float32Array(0)},offset:[0,0,0]};const c=[(n+o)/2,(r+i)/2,(a+l)/2],d=new Float32Array(t.length);for(let u=0;u<t.length;u+=3){const f=t[u],p=t[u+1],h=t[u+2];if(!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(h)){d[u]=0,d[u+1]=0,d[u+2]=0;continue}d[u]=f-c[0],d[u+1]=p-c[1],d[u+2]=h-c[2]}return{slice:{positions:d,indices:e.indices?new Uint32Array(e.indices):void 0},offset:c}}function ma(e,t,n={}){e.updateMatrixWorld(!0);const r=Mt(t,e.matrixWorld);return Pt(r)}let pa;function As(e){pa=e}function fa(e){const t=e.image;if(!t)return;if(typeof document>"u")return Cs(t);const n=document.createElement("canvas"),r=n.getContext("2d");if(!r)return;try{if(t instanceof ImageData)n.width=t.width,n.height=t.height,r.putImageData(t,0,0);else if(ha(t)){n.width=t.width,n.height=t.height;const s=Ss(t.data,t.width*t.height),c=new ImageData(new Uint8ClampedArray(s),t.width,t.height);r.putImageData(c,0,0)}else if(Es(t)){const s=Hs(t);if(!s)return;n.width=s.width,n.height=s.height,r.drawImage(t,0,0)}else return}catch{return}const a=n.toDataURL("image/png"),o=a.indexOf(",");if(o<0)return;const i=atob(a.slice(o+1)),l=new Uint8Array(i.length);for(let s=0;s<i.length;s++)l[s]=i.charCodeAt(s);return{mimeType:"image/png",bytes:l}}function Cs(e){const t=pa;if(!(!t||!ha(e)))try{const n=t(e);return n!=null&&n.byteLength?{mimeType:"image/png",bytes:n}:void 0}catch{return}}function Es(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement}function ha(e){if(!e||typeof e!="object")return!1;const t=e;return t.data!=null&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>=1&&t.height>=1}function Hs(e){let t=Number(e.width),n=Number(e.height);if(e instanceof HTMLImageElement?(t=e.naturalWidth||e.width,n=e.naturalHeight||e.height):typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement&&(t=e.videoWidth||e.width,n=e.videoHeight||e.height),!(!Number.isFinite(t)||!Number.isFinite(n)||t<1||n<1))return{width:t,height:n}}function Ss(e,t){const n=t*4;if(e instanceof Uint8ClampedArray&&e.length>=n)return e.length===n?e:e.subarray(0,n);const r=new Uint8ClampedArray(n),a=Math.min(n,e.length);for(let o=0;o<a;o++)r[o]=e[o];if(e.length>=t*3&&e.length<n)for(let o=t-1;o>=0;o--){const i=o*3,l=o*4;r[l]=e[i],r[l+1]=e[i+1],r[l+2]=e[i+2],r[l+3]=255}return r}function ga(e,t){const n=e.getAttribute("uv");if(!n||n.count===0||n.itemSize<2)return;const a=Math.floor(t.length/3)*2;if(a<=0)return;const o=n.array;if(!(n.count*n.itemSize<a))return ee(o,0,a)}function Pn(e){const t=e;return t.map?!1:t.transparent===!0&&typeof t.opacity=="number"&&t.opacity<.01}function ya(e,t={}){const n=new Blob([e.bytes],{type:e.mimeType||"image/png"}),r=URL.createObjectURL(n),a=new C.TextureLoader().load(r,o=>{var i;URL.revokeObjectURL(r),(i=t.onLoad)==null||i.call(t,o)},void 0,()=>{var o;URL.revokeObjectURL(r),(o=t.onError)==null||o.call(t)});return a.colorSpace=C.SRGBColorSpace,a.needsUpdate=!0,a}function xa(e){e&&(e.bytes=new Uint8Array(0))}const In={value:1};function _n(e){const t=e;if(t.isShaderMaterial===!0||e.type==="ShaderMaterial")return t}function wa(e){var o;const t=_n(e);if(!t)return;const n=t.uniforms.pattern,r=t.uniforms.patternLength;if(!n||!r)return;const a=n.value;if(!(!Array.isArray(a)||a.length===0))return{pattern:[...a],patternLength:Number(r.value),viewportScale:Number(((o=t.uniforms.u_viewportScale)==null?void 0:o.value)??1)}}function va(e){var a;const t=_n(e);if(!t)return;const n=t.uniforms.u_patternLines;if(!n)return;const r=n.value;if(!(!Array.isArray(r)||r.length===0))return{patternAngle:Number(((a=t.uniforms.u_patternAngle)==null?void 0:a.value)??0),patternLines:r.map(Ms)}}function ba(e){var o,i,l,s,c;const t=_n(e);if(!t||t.uniforms.u_patternLines)return;const n=(o=t.uniforms.u_startColor)==null?void 0:o.value,r=(i=t.uniforms.u_endColor)==null?void 0:i.value,a=t.uniforms.u_gradientType;if(!(!(n!=null&&n.getHex)||a==null))return{startColor:n.getHex(),endColor:((l=r==null?void 0:r.getHex)==null?void 0:l.call(r))??n.getHex(),angle:Number(((s=t.uniforms.u_angle)==null?void 0:s.value)??0),shift:Number(((c=t.uniforms.u_shift)==null?void 0:c.value)??0),gradientType:Number(a.value)}}function Ms(e){return{angle:e.angle,base:[e.base.x,e.base.y],offset:[e.offset.x,e.offset.y],dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Ps(e){return{angle:e.angle,base:new C.Vector2(e.base[0],e.base[1]),offset:new C.Vector2(e.offset[0],e.offset[1]),dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function It(e){const t=e.length/3;if(t<2)return new Float32Array(0);const n=new Float32Array(t);for(let r=0;r<t;r+=2){r===0?n[r]=0:n[r]=n[r-1];const a=e[r*3],o=e[r*3+1],i=e[r*3+2]??0,l=e[(r+1)*3],s=e[(r+1)*3+1],c=e[(r+1)*3+2]??0,d=l-a,u=s-o,f=c-i;n[r+1]=n[r]+Math.sqrt(d*d+u*u+f*f)}return n}function Is(e){const t=e.getAttribute("lineDistance");if(!t||t.count===0)return;if(e.getIndex()){const c=t.array;return ee(c,0,t.count)}const r=e.drawRange,a=t.count,o=Math.max(0,Math.min(Math.floor(r.start),a)),i=Math.max(0,a-o),l=!Number.isFinite(r.count)||r.count<=0?i:Math.min(Math.floor(r.count),i);if(l<=0)return;const s=t.array;return ee(s,o,l)}function ka(e,t){const n=e.getAttribute(t);if(!n||n.count===0)return;const r=n.itemSize;if(e.getIndex()){const u=n.array;return ee(u,0,n.count*r)}const o=e.drawRange,i=n.count,l=Math.max(0,Math.min(Math.floor(o.start),i)),s=Math.max(0,i-l),c=!Number.isFinite(o.count)||o.count<=0?s:Math.min(Math.floor(o.count),s);if(c<=0)return;const d=n.array;return ee(d,l*r,c*r)}function _s(e,t){if(e.lineWidth!=null&&e.lineWidth>0){const n=new Lr.LineMaterial({color:e.color,linewidth:e.lineWidth});return t&&n.resolution.copy(t),n}return e.linePattern?P.AcTrLinePatternShaders.createLineShaderMaterialFromScaledPattern(e.linePattern.pattern,e.linePattern.patternLength,e.color,e.linePattern.viewportScale,In):new C.LineBasicMaterial({color:e.color})}function Bs(e){return new C.PointsMaterial({color:e.color,size:1,sizeAttenuation:!1})}function Bn(e,t){const n=t[0],r=t[1],a=t[4],o=t[5],i=t[12],l=t[13],s=Math.atan2(r,n),c=(f,p)=>[n*f+a*p+i,r*f+o*p+l],d=(f,p)=>[n*f+a*p,r*f+o*p],u=(f,p,h)=>{const g=Math.cos(h),y=Math.sin(h);return[g*f-y*p,y*f+g*p]};return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(f=>{const p=f.angle+e.patternAngle,h=f.angle+s,g=h+e.patternAngle,[y,v]=d(Math.cos(p),Math.sin(p)),x=Math.hypot(y,v),[b,L]=u(f.offset[0],f.offset[1],p),[E,H]=d(b,L),S=u(E,H,-g);return{angle:h,base:c(f.base[0],f.base[1]),offset:S,dashLengths:f.dashLengths.map(A=>A*x),patternLength:f.patternLength*x}})}}function La(e,t){return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(n=>{const r=new C.Vector2(n.base[0]-t[0],n.base[1]-t[1]),a=new C.Vector2(n.offset[0],n.offset[1]);return P.wrapPatternBaseToLocalFrame(r,a,n.angle,e.patternAngle,n.patternLength),{angle:n.angle,base:[r.x,r.y],offset:[n.offset[0],n.offset[1]],dashLengths:[...n.dashLengths],patternLength:n.patternLength}})}}function Ts(e,t={}){if(e.hatchPattern&&e.hatchPattern.patternLines.length>0)try{const n=e.hatchPattern.patternLines.map(Ps);return P.createHatchPatternShaderMaterial(n,e.hatchPattern.patternAngle,In,new C.Color(e.color),0,e.side??C.FrontSide)}catch{}if(e.gradientFill&&e.gradientPositions&&e.gradientPositions.length>=2)try{return P.createGradientHatchShaderMaterialFromUniforms(e.gradientFill,e.side??C.FrontSide)}catch{}if(e.texture&&e.uvs&&e.uvs.length>=2){const n=new C.MeshBasicMaterial({color:16777215,side:C.DoubleSide,transparent:!0,opacity:0,depthWrite:!1});return n.map=ya(e.texture,{onLoad:()=>{var r;xa(e.texture),n.opacity=1,n.depthWrite=!0,n.needsUpdate=!0,(r=t.onTextureLoad)==null||r.call(t)}}),n}return new C.MeshBasicMaterial({color:e.color,side:C.DoubleSide})}function Tn(e,t){return!Number.isFinite(e)||e<0?0:Math.min(Math.floor(e),t)}function zn(e,t,n){const r=Math.max(0,t-n);return!Number.isFinite(e)||e<=0?r:Math.min(Math.floor(e),r)}function De(e){const t=e.getAttribute("position");if(!t)return{positions:new Float32Array(0)};const n=e.drawRange,r=t.array,a=t.itemSize,o=e.getIndex();if(o){const c=ee(r,0,t.count*a),d=o.array,u=Tn(n.start,o.count),f=zn(n.count,o.count,u),p=ca(d,u,f);return Mn(c,p)}const i=Tn(n.start,t.count),l=zn(n.count,t.count,i);return{positions:ee(r,i*a,l*a)}}function Ue(e){return P.isBatchGeometryActive(e.flags)&&P.isBatchGeometryVisible(e.flags)}function Fn(e,t){const n=(t==null?void 0:t.geometryLayerName)??"";if(!e||!(t!=null&&t.insertLayerByObjectId)||!t.frozenLayers)return n;const r=t.insertLayerByObjectId.get(e);return r&&r!==n&&t.frozenLayers.has(r)?r:n}function _t(e,t){const n=new Map,{count:r}=e.mappingStats;for(let a=0;a<r;a++){let o;try{o=e.getGeometryRangeAt(a)}catch{continue}if(!Ue(o))continue;const i=Fn(o.objectId,t),l=n.get(i);l?l.push(a):n.set(i,[a])}return n}function Aa(e){const{count:t}=e.mappingStats;for(let n=0;n<t;n++){let r;try{r=e.getGeometryRangeAt(n)}catch{continue}if(Ue(r)&&r.bboxIntersectionCheck)return!0}return!1}function On(e){return P.getSceneDrawableUserData(e).bboxIntersectionCheck===!0}function Bt(e,t,n){const r=t.getAttribute("position");if(!r)return{positions:new Float32Array(0)};const a=r.itemSize,o=r.array,i=t.getIndex(),l=n??Array.from({length:e.mappingStats.count},(f,p)=>p);if(i){const f=ee(o,0,r.count*a),p=i.array;let h=0;const g=[];for(const x of l){let b;try{b=e.getGeometryRangeAt(x)}catch{continue}const L=b.indexStart??0,E=b.indexCount??0;!Ue(b)||E<=0||(g.push({start:L,count:E}),h+=E)}if(h===0)return{positions:new Float32Array(0)};const y=new Uint32Array(h);let v=0;for(const x of g)for(let b=0;b<x.count;b++)y[v++]=p[x.start+b];return Mn(f,y)}let s=0;const c=[];for(const f of l){let p;try{p=e.getGeometryRangeAt(f)}catch{continue}if(!Ue(p)||p.vertexCount<=0)continue;const h=p.vertexCount*a;c.push({start:p.vertexStart*a,floatCount:h}),s+=h}if(s===0)return{positions:new Float32Array(0)};const d=new Float32Array(s);let u=0;if(o instanceof Float32Array)for(const f of c)d.set(o.subarray(f.start,f.start+f.floatCount),u),u+=f.floatCount;else for(const f of c)for(let p=0;p<f.floatCount;p++)d[u++]=o[f.start+p];return{positions:d}}function Ca(e,t,n){e.push(t.getX(n),t.getY(n),t.getZ(n))}function Ea(e,t,n){const r=t.getAttribute("instanceStart"),a=t.getAttribute("instanceEnd");if(!r||!a)return{positions:new Float32Array(0)};const o=n??Array.from({length:e.mappingStats.count},(l,s)=>s),i=[];for(const l of o){let s;try{s=e.getGeometryRangeAt(l)}catch{continue}if(!Ue(s)||s.vertexCount<=0)continue;const c=s.vertexStart,d=c+s.vertexCount;for(let u=c;u<d;u++)Ca(i,r,u),Ca(i,a,u)}return{positions:new Float32Array(i)}}function zs(e,t){const r=e.instanceCount;if(Number.isFinite(r)&&r>=0)return Math.min(Math.floor(r),t);const a=e.drawRange,o=Tn(a.start,t);return zn(a.count,t,o)}function Fs(e){const t=e.getAttribute("instanceStart"),n=e.getAttribute("instanceEnd");if(!t||!n||t.count===0)return{positions:new Float32Array(0)};const r=zs(e,t.count);if(r<=0)return{positions:new Float32Array(0)};const a=[];for(let o=0;o<r;o++){const i=[t.getX(o),t.getY(o),t.getZ(o)],l=[n.getX(o),n.getY(o),n.getZ(o)];!i.every(Number.isFinite)||!l.every(Number.isFinite)||a.push(i[0],i[1],i[2],l[0],l[1],l[2])}return{positions:new Float32Array(a)}}function Tt(e,t){let n=e;for(;n&&n!==t;){if(n.visible===!1)return!1;n=n.parent}return!0}function Ha(e){if(e instanceof Lr.LineMaterial)return e.linewidth}function Ne(e){if("material"in e){const n=e.userData.originalMaterial??e.material;return Array.isArray(n)?n[0]:n}return e.material}function de(e){var c;const t=P.getMaterialMetadata(e),n=t.layer??"0",r=e;let a=r.color!=null?r.color.getHex():t.color??16777215;const o=wa(e),i=va(e),l=ba(e);if(e instanceof C.ShaderMaterial||e.type==="ShaderMaterial"){const u=(c=e.uniforms.u_color)==null?void 0:c.value;u!=null&&u.getHex?a=u.getHex():l&&(a=l.startColor)}return{color:a,layer:n,linePattern:o,hatchPattern:i,gradientFill:l,side:!!i||!!l?e.side:void 0}}function Os(e,t){const r=P.getMaterialMetadata(t).drawOrder??e.renderOrder;return r===0?void 0:r}function Le(e,t,n){const r=Os(t,n);r!=null&&(e.renderOrder=r)}function Rs(e,t){if(!t)return;const n=e.userData.bakedWorldMatrix;return n&&n.length>=16?Bn(t,n):(e.updateMatrixWorld(!0),Bn(t,Array.from(e.matrixWorld.elements)))}function zt(e){return da(e)}function Rn(e,t,n={}){const r=ma(e,t,n);return{...r.slice,offset:r.offset}}function Ds(e){if(e.indices&&e.indices.length>=3)return e;const t=e.positions.length/3|0;if(t<3||t%3!==0)return e;const n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=r;return{...e,indices:n}}function Xe(e,t,n,r,a,o=!1){o&&(r=Ds(r));const i=de(t),l=Rs(n,i.hatchPattern),s=l?La(l,a):void 0,c=i.gradientFill?ka(e,"gradientPosition"):void 0,d={layer:i.layer,color:i.color,offset:a,hatchPattern:s,gradientFill:i.gradientFill,gradientPositions:c,side:i.side,...r},u=t;if(u.map){const f=fa(u.map),p=ga(e,r.positions);if(!f||!p)return;d.texture=f,d.uvs=p,d.color=16777215,d.side=C.DoubleSide}return Le(d,n,t),d}function Us(e,t){const n=_t(e,t);if(n.size===0)return[];const{color:r}=de(e.material),a=Ha(e.material),o=zt(e),i=Aa(e),l=e.material,s=[];for(const[c,d]of n){const u=Ea(e,e.geometry,d);if(u.positions.length===0)continue;const f={layer:c,color:r,offset:o,lineWidth:a,...u};i&&(f.excludeFromOsnap=!0),Le(f,e,l),s.push(f)}return s}function Ns(e,t){const n=_t(e,t);if(n.size===0)return[];const{color:r,linePattern:a}=de(e.material),o=zt(e),i=Aa(e),l=e.material,s=[];for(const[c,d]of n){const u=Bt(e,e.geometry,d);if(u.positions.length===0)continue;const f=a?It(u.positions):void 0,p={layer:c,color:r,offset:o,linePattern:a,lineDistances:f,...u};i&&(p.excludeFromOsnap=!0),Le(p,e,l),s.push(p)}return s}function Xs(e,t){const n=_t(e,t);if(n.size===0)return[];const r=[];for(const[a,o]of n){const i=Bt(e,e.geometry,o);if(i.positions.length===0)continue;const l=Xe(e.geometry,e.material,e,i,zt(e),!0);l&&(l.layer=a,r.push(l))}return r}function Vs(e,t){const n=_t(e,t);if(n.size===0)return[];const r=[];for(const[a,o]of n){const i=Bt(e,e.geometry,o);if(i.positions.length===0)continue;const l=Xe(e.geometry,e.material,e,i,zt(e));l&&(l.layer=a,r.push({points:!0,...l}))}return r}const te=new C.Matrix4,Ft=new C.Matrix4,Ve=new C.Object3D;Ve.matrixAutoUpdate=!1;function Ys(e){const t=e;return t.isInstancedMesh===!0&&t.instanceMatrix!=null&&typeof t.count=="number"&&t.geometry!=null}function Gs(e){return e.renderOrder<1e4||e.isInstancedMesh===!0?!1:P.getSceneDrawableUserData(e).sharesTemplateGeometry===!0}function Ot(e){const t=e.elements;for(let o=0;o<16;o++)if(!Number.isFinite(t[o]))return!1;const n=Math.hypot(t[0],t[1],t[2]),r=Math.hypot(t[4],t[5],t[6]),a=Math.hypot(t[8],t[9],t[10]);return n+r+a>=1e-8}function $s(e,t){let n=e;for(;n;){const r=n.getObjectIdAt;if(typeof r=="function")return r.call(n,t);n=n.parent}}function Sa(e,t){e.updateMatrixWorld(!0);const n=e.instanceMatrix.array,r=new Map,a=(t==null?void 0:t.geometryLayerName)??"";for(let o=0;o<e.count;o++){if(te.fromArray(n,o*16),!Ot(te))continue;const i=$s(e,o),l=Fn(i,t)||a,s=r.get(l);s?s.push(o):r.set(l,[o])}return r}function Ma(e,t,n){var h;const r=fe(De(e.geometry),t),a=r.positions.length;if(a===0)return;e.updateMatrixWorld(!0);const o=e.instanceMatrix.array,i=((h=r.indices)==null?void 0:h.length)??0,l=n??Array.from({length:e.count},(g,y)=>y);let s=0;for(const g of l)te.fromArray(o,g*16),Ot(te)&&s++;if(s===0)return;const c=new Float32Array(s*a),d=r.indices!=null?new Uint32Array(s*i):void 0,u=a/3;let f=0;for(const g of l){if(te.fromArray(o,g*16),!Ot(te))continue;Ft.multiplyMatrices(e.matrixWorld,te);const y=Mt(r,Ft);if(c.set(y.positions,f*a),d&&y.indices){const v=f*u;for(let x=0;x<y.indices.length;x++)d[f*i+x]=y.indices[x]+v}f++}const p=Pt(fe({positions:c,indices:d},t));if(p.slice.positions.length!==0)return{slice:p.slice,offset:p.offset}}function js(e){const t=de(e),n=e;return!!(t.hatchPattern||t.gradientFill||n.map)}function Ks(e,t,n){e.updateMatrixWorld(!0);const r=e.instanceMatrix.array,a=n??Array.from({length:e.count},(o,i)=>i);for(const o of a)te.fromArray(r,o*16),Ot(te)&&(Ft.multiplyMatrices(e.matrixWorld,te),t(Ft,o))}function Zs(e,t,n){const r=Sa(e,n);if(r.size===0)return;const a=Ne(e),{color:o,layer:i,linePattern:l}=de(a),s=(n==null?void 0:n.geometryLayerName)||i,c=On(e);for(const[d,u]of r){const f=Ma(e,2,u);if(!f)continue;const p=l?It(f.slice.positions):void 0,h={layer:d||s,color:o,offset:f.offset,linePattern:l,lineDistances:p,...f.slice};c&&(h.excludeFromOsnap=!0),Le(h,e,a),t.push(h)}}function Pa(e,t,n,r){const a=Ne(e);if(!n&&Pn(a))return;const o=Sa(e,r);if(o.size===0)return;const i=(r==null?void 0:r.geometryLayerName)||de(a).layer;if(!n&&js(a)){const l=fe(De(e.geometry),3);if(l.positions.length===0)return;for(const[s,c]of o)Ks(e,d=>{const u=fe(Mt(l,d),3);if(u.positions.length===0)return;const f=Pt(u);Ve.matrix.copy(d),Ve.matrixWorld.copy(d),Ve.matrixWorldNeedsUpdate=!1;const p=Xe(e.geometry,a,Ve,f.slice,f.offset,!0);p&&(p.layer=s||i,t.push(p))},c);return}for(const[l,s]of o){const c=Ma(e,n?1:3,s);if(!c)continue;const d=Xe(e.geometry,a,e,c.slice,c.offset,!n);d&&(d.layer=l||i,t.push(n?{...d,points:!0}:d))}}function Rt(e){const t=e;return e instanceof Bi.LineSegments2||t.isLineSegments2===!0||e.type==="LineSegments2"}function Ia(e){const t=e;return e instanceof C.LineSegments||t.isLineSegments===!0||e.type==="LineSegments"}function _a(e){const t=e;return e instanceof C.Mesh||t.isMesh===!0||t.isInstancedMesh===!0||e.type==="Mesh"}function Ba(e,t){const n=[],r=[],a=(t==null?void 0:t.geometryLayerName)??"",o=i=>{const l=i.userData,s=l.objectId??l.sharedInstanceObjectId;return Fn(s,t)};return e.traverse(i=>{if(!(P.isHighlightOverlayDescendant(i)||P.isHighlightCloneDrawable(i)||Gs(i))){if(Ys(i)){if(!Tt(i,e))return;i.isPoints===!0?Pa(i,r,!0,t):Ia(i)&&!Rt(i)?Zs(i,n,t):_a(i)&&!Rt(i)&&Pa(i,r,!1,t);return}if(i instanceof P.AcTrBatchedLine){n.push(...Ns(i,t));return}if(i instanceof P.AcTrBatchedLine2){n.push(...Us(i,t));return}if(i instanceof P.AcTrBatchedMesh){r.push(...Xs(i,t));return}if(i instanceof P.AcTrBatchedPoint){r.push(...Vs(i,t));return}if(Rt(i)){if(!Tt(i,e))return;const l=Fs(i.geometry);if(l.positions.length===0)return;const s=Ne(i),{color:c}=de(s),{offset:d,...u}=Rn(i,l),f={layer:o(i)||a,color:c,offset:d,lineWidth:Ha(s),...u};On(i)&&(f.excludeFromOsnap=!0),Le(f,i,s),n.push(f)}else if(Ia(i)&&!(i instanceof P.AcTrBatchedLine)){if(!Tt(i,e))return;const l=fe(De(i.geometry),2);if(l.positions.length===0)return;const s=Ne(i),{color:c,linePattern:d}=de(s),{offset:u,...f}=Rn(i,l),p=d?It(f.positions):void 0,h={layer:o(i)||a,color:c,offset:u,linePattern:d,lineDistances:p,...f};On(i)&&(h.excludeFromOsnap=!0),Le(h,i,s),n.push(h)}else if(_a(i)&&!Rt(i)&&!(i instanceof P.AcTrBatchedMesh)){if(!Tt(i,e))return;const l=Ne(i);if(Pn(l))return;const s=fe(De(i.geometry),3);if(s.positions.length===0)return;const{offset:c,...d}=Rn(i,s),u=Xe(i.geometry,l,i,d,c,!0);u&&(u.layer=o(i)||a,r.push(u))}}}),{lineBatches:n,meshBatches:r}}const Ta={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function za(e){const t=new w.AcCmColor(w.AcCmColorMethod.ByACI,e);return t.cssColor??`rgb(${t.red}, ${t.green}, ${t.blue})`}function Ws(e){try{const t=w.AcDbSysVarManager.instance(),n=t.getVar(w.AcDbSystemVariables.GRIPSIZE,e),r=t.getVar(w.AcDbSystemVariables.GRIPCOLOR,e),a=t.getVar(w.AcDbSystemVariables.GRIPHOT,e);return!(n>0)||!Number.isFinite(n)?Ta:{size:n,colorCss:za(r),hotColorCss:za(a)}}catch{return Ta}}function Dn(e,t){const n=e.extmin,r=e.extmax,a=Ws(e);return{title:t==null?void 0:t.title,extents:{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y},units:{insunits:e.insunits,lunits:e.lunits,luprec:e.luprec,aunits:e.aunits,auprec:e.auprec,measurement:e.measurement,ltscale:e.ltscale,angbase:e.angbase,angdir:e.angdir},grip:a,background:(t==null?void 0:t.background)??0}}const Js=["endpoint","midpoint","center","quadrant","intersection","nearest"];function Un(e,t){let n=t-e;for(;n<=0;)n+=w.TAU;for(;n>w.TAU;)n-=w.TAU;return n}function Nn(e,t,n,r,a){const o=a===-1?-1:1;return new w.AcGePoint2d(e+o*n*Math.cos(r),t+n*Math.sin(r))}function Xn(e,t,n,r,a){return Math.atan2(r-t,a*(n-e))}function Fa(e){const t=Nn(e.cx,e.cy,e.r,e.startAngle,e.normalSign),n=Nn(e.cx,e.cy,e.r,e.endAngle,e.normalSign),r=Un(e.startAngle,e.endAngle),a=e.normalSign*Math.tan(r/4);return new w.AcGeCircArc2d(t,n,a)}function Oa(e){return Un(e.startAngle,e.endAngle)}function qs(e,t){const n=Oa(e),r=e.startAngle+t*n,a=e.normalSign??1,o=e.majorR*Math.cos(r),i=a*e.minorR*Math.sin(r),l=e.majorX,s=e.majorY;return new w.AcGePoint2d(e.cx+o*l-i*s,e.cy+o*s+i*l)}function Ra(e){return e.kind==="circle"?new w.AcGeCircArc2d({x:e.cx,y:e.cy},e.r,0,w.TAU,e.normalSign===-1):Fa(e)}function Da(e){const t=Math.atan2(e.majorY,e.majorX);return new w.AcGeEllipseArc2d({x:e.cx,y:e.cy,z:0},e.majorR,e.minorR,e.startAngle,e.endAngle,e.closed,t)}function Ua(e){const t=[];for(let n=0;n+1<e.controlPoints.length;n+=2)t.push({x:e.controlPoints[n],y:e.controlPoints[n+1],z:0});return new w.AcGeNurbsCurve(e.degree,e.knots,t,e.weights.length>0?e.weights:void 0)}function Qs(e){switch(e.kind){case"line":return{kind:"line",curve:new w.AcGeLine2d({x:e.x0,y:e.y0},{x:e.x1,y:e.y1})};case"circle":case"arc":return{kind:"circArc",curve:Ra(e)};case"ellipse":return{kind:"ellipse",curve:Da(e)};case"spline":return{kind:"spline",curve:Ua(e)};case"point":return{kind:"point",point:new w.AcGePoint2d(e.x,e.y)};case"path":throw new Error("path primitives must be expanded before curve conversion")}}function Vn(e){return e.z>=0?1:-1}function Na(e,t,n){if(!(n.radius>0)||!Number.isFinite(n.radius))return;const r=n.clockwise?-1:1,a=n.center.x,o=n.center.y;e.push({kind:"arc",layer:t,cx:a,cy:o,r:n.radius,startAngle:Xn(a,o,n.startPoint.x,n.startPoint.y,r),endAngle:Xn(a,o,n.endPoint.x,n.endPoint.y,r),normalSign:r})}function z(e,t){const n=new C.Vector3(t.x,t.y,t.z??0).applyMatrix4(e);return{x:n.x,y:n.y}}function el(e){const t=e.elements;return new C.Matrix4(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function Dt(e,t){return new C.Matrix4().multiplyMatrices(e,el(t))}function Xa(e,t){const n=new C.Vector3(t.x,t.y,t.z??0).transformDirection(e).normalize();return{x:n.x,y:n.y}}function Yn(e){const t=new C.Vector3(e.elements[0],e.elements[1],e.elements[2]).length(),n=new C.Vector3(e.elements[4],e.elements[5],e.elements[6]).length();return w.AcGeTol.equal(t,n,w.FLOAT_TOL*Math.max(t,n,1))}function tl(e,t){const n=e.tables.blockTable.getIdAt(t);if(n)return n;for(const a of e.tables.blockTable.newIterator())if(a.objectId===t)return a;const r=e.tables.blockTable.modelSpace;if(r.objectId===t)return r}function nl(e){if(e instanceof w.AcDbLine)return!0;const t=e;return(t.type==="LINE"||t.type==="Line")&&t.startPoint!=null&&t.endPoint!=null}function rl(e,t,n,r){r.startPoint,r.endPoint}function Va(e,t){return e.blockTableRecord??(e.blockName?t.tables.blockTable.getAt(e.blockName):void 0)}function al(e,t){const n=e.dimBlockId;return n?t.tables.blockTable.getAt(n):void 0}function ol(e,t){const r=Va(e,t);if(r)return r;const a=e.owningBlockRecordId;return a?t.tables.blockTable.getAt(a):void 0}function Ya(e){return e.getFullInsertionTransform()}function il(e){for(const t of e.newIterator())return!0;return!1}function sl(e){return typeof e.getFullInsertionTransform=="function"&&"blockTableRecord"in e}function iu(e,t,n,r,a){}function su(e,t,n,r,a,o){}function ue(e,t,n,r,a){if(r.length<2)return;const o=Yn(n),l=n.elements[0]*n.elements[5]-n.elements[4]*n.elements[1]<0?-1:1,s=[];for(const c of r){const d=z(n,c);let u=c.bulge??0;w.AcGeTol.isPositive(Math.abs(u))&&(u=o?u*l:0),s.push(d.x,d.y,u)}e.push({kind:"path",layer:t,closed:a,vertices:s})}function Ga(e,t){return w.AcGeTol.equal(e.x,t.x)&&w.AcGeTol.equal(e.y,t.y)}function ll(e){return(e.clockwise?-1:1)*Math.tan(e.deltaAngle/4)}function $a(e,t,n,r){if(e.length===0){e.push({x:t.x,y:t.y,z:t.z??0,bulge:r}),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0});return}const a=e[e.length-1];Ga(a,t)?a.bulge=r:(a.bulge=0,e.push({x:t.x,y:t.y,z:t.z??0,bulge:r})),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0})}function ja(e){return e.length>=2&&Ga(e[0],e[e.length-1])&&e.pop(),e}function Ye(e,t,n,r,a){if(r.length<2)return;const o=a?r.length:r.length-1;for(let i=0;i<o;i++)r[i],r[(i+1)%r.length]}function cl(e,t,n,r){const a=[r.startPosition];for(const o of r.segments)a.push(o.position);Ye(e,t,n,a,r.closed)}function dl(e,t,n){if(n.vertices.length===0)return[];const r=n.vertices[n.vertices.length-1],a=t.lastLeaderLinePoint??t.landingPoint??e.landingPoint??e.contentBasePosition;if(!a)return n.vertices;const o=r.x-a.x,i=r.y-a.y,l=(r.z??0)-(a.z??0);return Math.hypot(o,i,l)<=w.FLOAT_TOL?n.vertices:[...n.vertices,a]}function ul(e,t,n,r){var o,i;for(const l of r.leaders)for(const s of l.leaderLines){const c=dl(r,l,s);Ye(e,t,n,c,!1)}const a=l=>{if(!l)return;const s=z(n,l);e.push({kind:"point",layer:t,x:s.x,y:s.y})};a(r.contentBasePosition),a((o=r.mtextContent)==null?void 0:o.anchorPoint),a((i=r.blockContent)==null?void 0:i.position)}function ml(e,t,n,r){const a=r.numberOfVertices;if(a<2)return;const o=r.elevation,i=r.closed?a:a-1;for(let l=0;l<i;l++){const s=r.getPointAt(l),c=r.getPointAt((l+1)%a),d=r.getBulgeAt(l),u={x:s.x,y:s.y,z:o},f={x:c.x,y:c.y,z:o};if(w.AcGeTol.isPositive(Math.abs(d))){const p=z(n,u),h=z(n,f);Na(e,t,new w.AcGeCircArc2d(p,h,d))}}}function pl(e,t,n,r,a,o){const i=z(n,r),l=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),s={kind:"circle",layer:t,cx:i.x,cy:i.y,r:a*l,normalSign:Vn(o)};e.push(s)}function fl(e,t,n,r){const a=z(n,r.center),o=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),i={kind:"arc",layer:t,cx:a.x,cy:a.y,r:r.radius*o,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:Vn(r.normal)};e.push(i)}function Gn(e,t,n,r){const a=z(n,r.center),o=r._geo,i=(o==null?void 0:o.majorAxis)??{x:1,y:0,z:0},l=Xa(n,i),s=Math.hypot(l.x,l.y)||1,c=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),d=new C.Vector3(n.elements[4],n.elements[5],n.elements[6]).length(),u={kind:"ellipse",layer:t,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:Vn(r.normal)};e.push(u)}function hl(e,t,n,r){var l,s;const a=r._geo;if(!((l=a==null?void 0:a.controlPoints)!=null&&l.length))return;const o=[];for(const c of a.controlPoints){const d=z(n,c);o.push(d.x,d.y)}const i={kind:"spline",layer:t,controlPoints:o,degree:a.degree??3,knots:[...a.knots??[]],weights:[...a.weights??[]],closed:a.closed??!1};if((s=a.fitPoints)!=null&&s.length){i.fitPoints=[];for(const c of a.fitPoints){const d=z(n,c);i.fitPoints.push(d.x,d.y)}}e.push(i)}const Ka=1e-6;function gl(e){var r;const t=e.elevation,n=(r=e._geo)==null?void 0:r.vertices;return n&&n.length>1?n.map(a=>({x:a.x,y:a.y,z:t,bulge:a.bulge,startWidth:a.startWidth,endWidth:a.endWidth})):Array.from({length:e.numberOfVertices},(a,o)=>{const i=e.getPoint2dAt(o);return{x:i.x,y:i.y,z:t,bulge:0}})}function yl(e){return e.some(t=>{const n=Math.max(0,t.startWidth??0),r=Math.max(0,t.endWidth??0);return n>Ka||r>Ka})}function xl(e,t,n,r){const a=gl(r),o=a.length;if(o<2)return;if(yl(a)){ue(e,t,n,a,r.closed);return}const i=r.closed?o:o-1;for(let l=0;l<i;l++){const s=a[l],c=a[(l+1)%o],d=s.bulge??0;if(w.AcGeTol.isPositive(Math.abs(d))){const u=z(n,s),f=z(n,c);Na(e,t,new w.AcGeCircArc2d(u,f,d))}}}function wl(e,t,n,r,a){const o=z(n,{x:r.center.x,y:r.center.y,z:a}),i=Xa(n,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),l=Math.hypot(i.x,i.y)||1,s=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),c=new C.Vector3(n.elements[4],n.elements[5],n.elements[6]).length();e.push({kind:"ellipse",layer:t,cx:o.x,cy:o.y,majorX:i.x/l,majorY:i.y/l,majorR:r.majorAxisRadius*s,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function vl(e,t,n,r,a){var l;const o=r.numberOfVertices;if(o<2)return;const i=[];for(let s=0;s<o;s++){const c=r.getPointAt(s);i.push({x:c.x,y:c.y,z:a,bulge:((l=r.vertices[s])==null?void 0:l.bulge)??0})}ue(e,t,n,i,r.closed)}function bl(e,t,n,r,a){if(r instanceof w.AcGePolyline2d){vl(e,t,n,r,a);return}if(!(r instanceof w.AcGeLoop2d))return;const o=[];let i=!1;const l=()=>{const c=ja(o);c.length>=2&&ue(e,t,n,c,!1),o.length=0};for(const c of r.curves)c instanceof w.AcGeLine2d?$a(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},0):c instanceof w.AcGeCircArc2d?$a(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},ll(c)):c instanceof w.AcGeEllipseArc2d&&(i=!0,l(),wl(e,t,n,c,a));const s=ja(o);s.length>=2&&ue(e,t,n,s,!i)}function kl(e,t,n,r){var i;const a=(i=r._geo)==null?void 0:i.loops;if(!(a!=null&&a.length))return;const o=r.elevation;for(const l of a)bl(e,t,n,l,o)}function Ll(e,t,n,r){Dt(n,Ya(r));const a=[0];for(let i=0;i<r.numColumns;i++)a.push(a[i]+r.columnWidth(i));const o=[0];for(let i=0;i<r.numRows;i++)o.push(o[i]-r.rowHeight(i));a[a.length-1],o[o.length-1];for(const i of o);for(const i of a);}function Al(e,t,n,r,a,o,i,l=!0){const s=$n(e.layer,n);if(i&&!i(s))return;const c=ol(e,o);if(c&&!a.has(c.objectId)&&il(c)){a.add(c.objectId);const u=Dt(t,Ya(e));Ut(c,u,s,r,a,o,i,l),a.delete(c.objectId);return}Ll(r,s,t,e);const d=z(t,e.position);r.push({kind:"point",layer:s,x:d.x,y:d.y})}function Cl(e,t,n,r){let a=r.boundaryPath();if(a.length>1){const i=a[0],l=a[a.length-1];i.x===l.x&&i.y===l.y&&(i.z??0)===(l.z??0)&&(a=a.slice(0,-1))}a.length>=2&&ue(e,t,n,a,!0);const o=z(n,r.position);e.push({kind:"point",layer:t,x:o.x,y:o.y})}function El(e,t,n,r){const a=r.position();ue(e,t,n,[a.upperLeft,a.upperRight,a.lowerRight,a.lowerLeft],!0);const o=z(n,r.getLocation());e.push({kind:"point",layer:t,x:o.x,y:o.y})}function Hl(e){var n;const t=(n=e.attributeIterator)==null?void 0:n.call(e);return t?typeof t.toArray=="function"?t.toArray():[...t]:[]}function $n(e,t){return e==="0"?t:e}function Za(e,t,n,r,a,o,i,l=!0){if(!e.visibility)return;const s=$n(e.layer,n);if(!(i&&!i(s))){if(e instanceof w.AcDbTable){Al(e,t,n,r,a,o,i,l);return}if(sl(e)){const c=Va(e,o);if(!c||a.has(c.objectId))return;a.add(c.objectId);const d=e.getFullInsertionTransform(),u=Math.max(1,e.columnCount??1),f=Math.max(1,e.rowCount??1),p=e.columnSpacing??0,h=e.rowSpacing??0,g=$n(e.layer,n);for(let y=0;y<f;y++)for(let v=0;v<u;v++){const x=Dt(t,d);(v!==0||y!==0)&&x.multiply(new C.Matrix4().makeTranslation(v*p,y*h,0));const b=z(x,{x:0,y:0,z:0});r.push({kind:"point",layer:g,x:b.x,y:b.y}),Ut(c,x,g,r,a,o,i,l)}for(const y of Hl(e))(y instanceof w.AcDbAttribute?y.isInvisible:y.isInvisible)||Za(y,t,g,r,a,o,i,l);a.delete(c.objectId);return}if(e instanceof w.AcDbDimension){const c=e,d=al(c,o);if(!d||a.has(d.objectId))return;a.add(d.objectId);const u=Dt(t,c.getFullDimBlockTransform());Ut(d,u,s,r,a,o,i,!0),a.delete(d.objectId);return}if(nl(e)){rl(r,s,t,e);return}if(e instanceof w.AcDbCircle){Yn(t)?pl(r,s,t,e.center,e.radius,e.normal):Gn(r,s,t,Sl(e));return}if(e instanceof w.AcDbArc){Yn(t)?fl(r,s,t,e):Gn(r,s,t,Ml(e));return}if(e instanceof w.AcDbEllipse){Gn(r,s,t,e);return}if(e instanceof w.AcDbSpline){hl(r,s,t,e);return}if(e instanceof w.AcDbPolyline){xl(r,s,t,e);return}if(e instanceof w.AcDb2dPolyline){ml(r,s,t,e);return}if(e instanceof w.AcDb3dPolyline){const c=[];for(let d=0;d<e.numberOfVertices;d++)c.push(e.getPointAt(d));Ye(r,s,t,c,e.closed);return}if(e instanceof w.AcDbHatch){l&&kl(r,s,t,e);return}if(e instanceof w.AcDbRay){e.basePoint,e.unitDir;return}if(e instanceof w.AcDbXline){e.basePoint,e.unitDir;return}if(e instanceof w.AcDbSolid){ue(r,s,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof w.AcDbTrace){l&&ue(r,s,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof w.AcDbFace){const c=e.subGetGripPoints();c.length>=2&&Ye(r,s,t,c,c.length>=3);return}if(e instanceof w.AcDbLeader){const c=e.vertices;c.length>=2&&Ye(r,s,t,c,!1);return}if(e instanceof w.AcDbMLine){cl(r,s,t,e);return}if(e instanceof w.AcDbMLeader){ul(r,s,t,e);return}if(e instanceof w.AcDbText){const c=z(t,e.position);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(e instanceof w.AcDbMText){const c=z(t,e.location);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(e instanceof w.AcDbOle2Frame){l&&El(r,s,t,e);return}if(e instanceof w.AcDbRasterImage){l&&Cl(r,s,t,e);return}if(e instanceof w.AcDbPoint){const c=z(t,e.position);r.push({kind:"point",layer:s,x:c.x,y:c.y})}}}function Ut(e,t,n,r,a,o,i,l=!0){for(const s of e.newIterator())Za(s,t,n,r,a,o,i,l)}function Sl(e){return new w.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,0,w.TAU)}function Ml(e){return new w.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,e.startAngle,e.endAngle)}function Wa(e,t,n={}){const r=tl(e,t);if(!r)return{primitives:[]};const a=[],o=new C.Matrix4;return Ut(r,o,"0",a,new Set,e,n.includeLayer),{primitives:a.filter(i=>i.kind!=="line"&&Pl(i))}}function Pl(e){switch(e.kind){case"line":return Number.isFinite(e.x0)&&Number.isFinite(e.y0)&&Number.isFinite(e.x1)&&Number.isFinite(e.y1);case"circle":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r);case"arc":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"ellipse":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.majorX)&&Number.isFinite(e.majorY)&&Number.isFinite(e.majorR)&&Number.isFinite(e.minorR)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"spline":return e.controlPoints.every(t=>Number.isFinite(t))&&e.knots.every(t=>Number.isFinite(t))&&e.weights.every(t=>Number.isFinite(t));case"point":return Number.isFinite(e.x)&&Number.isFinite(e.y);case"path":return e.vertices.length>=6&&e.vertices.length%3===0&&e.vertices.every(t=>Number.isFinite(t));default:return e}}const Il={toolbar:{viewerTools:"ビューア ツール",select:"選択",pan:"画面移動",zoom:"ズーム",zoomExtents:"範囲",zoomSmartExtents:"スマート",zoomWindow:"窓",zoomSaved:"保存済み",zoomOriginal:"保存済み",measureDistance:"距離",measureContinuous:"連続",measureAngle:"角度",measureArc:"円弧",measureRadius:"半径",measureArea:"面積",measureCoordinate:"座標",clearMeasurements:"クリア",measureHide:"非表示",measureShow:"表示",measureImport:"読み込み",measureExport:"書き出し",measurementPanel:"結果",measure:"計測",annotation:"レビュー",markupCloud:"雲マーク",markupCallout:"吹き出し",markupText:"文字",markupRect:"長方形",markupCircle:"円",markupArrow:"矢印",markupStamp:"スタンプ",markupPanel:"結果",markupHide:"非表示",markupShow:"表示",clearMarkups:"クリア",markupImport:"読み込み",markupExport:"書き出し",snap:"スナップ",layers:"画層",layout:"レイアウト",settings:"設定",simulatedMouseOn:"マウス",simulatedMouseOff:"ルーペ",themeLight:"ライト",themeDark:"ダーク",switchBg:"背景",language:"言語",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"ツールバーを折りたたむ",expand:"ツールバーを展開",moreOverflow:"その他のツール"},settings:{ortho:"直交モードの切り替え",polar:"極トラッキング角度",polarAngles:"極トラッキング角度"},drawStyle:{color:"色",fontSize:"文字の高さ",pickerTitle:"色を選択",close:"閉じる",ok:"OK",cancel:"キャンセル",index:"色番号: ",rgb:"RGB: ",input:"色",inputPlaceholder:"1-255 または #RRGGBB"},shortCutToolbar:{more:"その他",undo:"元に戻す",redo:"やり直し",erase:"削除",collapse:"ツールバーを折りたたむ",expand:"ツールバーを展開"},textHeight:{title:"文字の高さ",close:"閉じる",ok:"OK",cancel:"キャンセル",adaptive:"画面に合わせる",custom:"カスタムの文字の高さ",customPlaceholder:"ワールドの高さ",fromScreen:"画面上のサイズから",fromScreenHint:"現在のズームで文字を画面上にどの大きさで表示するかを入力します。これはワールド空間の固定の高さに変換され、後でズームしても変わりません。",screenPxPlaceholder:"フォント サイズ",screenUnit:"px",convert:"変換"},entityPick:{cancel:"選択をキャンセル"},layers:{title:"画層",close:"画層を閉じる",showAll:"すべて表示",hideAll:"すべて非表示",zoomTo:"{name} にズーム"},review:{title:"レビュー",close:"レビューを閉じる",searchPlaceholder:"マークアップを検索",empty:"マークアップはまだありません",type:"種類",status:"状態",author:"作成者",summary:"概要",details:"詳細",closeDetails:"詳細を閉じる",label:"ラベル",comment:"コメント",zoomTo:"ズーム",delete:"削除",clear:"すべてクリア",statusValues:{open:"未対応",question:"質問",answered:"回答済み",closed:"完了"}},measurePanel:{title:"計測",close:"計測を閉じる",filterGroup:"種類でフィルタ",filterDistance:"距離",filterArc:"円弧",filterRadius:"半径",filterAngle:"角度",filterArea:"面積",empty:"計測はまだありません",type:"種類",value:"値",delete:"削除",clear:"すべてクリア"},session:{length:"長さ",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"確定",cancel:"キャンセル",help:"ヘルプ",back:"戻る",collapse:"折りたたむ",expand:"展開",undo:"元に戻す"},touchPointTutorial:{title:"点を正確に指定するには?",description:"画面を約 0.5 秒長押しします。指の上に十字カーソルが表示されて指の動きに追従し、図形にスナップするため、より正確に点を指定できます。",snoozeToday:"今日は表示しない",hideForever:"今後表示しない",ok:"わかりました"},status:{ready:"準備完了",zoomWindowHint:"2 つのコーナーをクリックして窓ズームします。",measureDistanceHint:"2 点をクリックして距離を計測します (オブジェクト スナップ有効)。",measureContinuousHint:"点を順にタップして各セグメントを計測し、✓ をタップして終了します。長押しで正確にスナップできます。",measureAreaHint:"多角形の頂点をタップし、3 点以上指定したら ✓ をタップして終了します。長押しで正確にスナップできます。",measureAngleHint:"頂点をクリックし、次に各辺上の点を 1 つずつクリックします (オブジェクト スナップ有効)。",measureArcHint:"円または円弧をクリックしてそれに沿って計測するか、始点、円弧上の点、終点を順にクリックします (オブジェクト スナップ有効)。Ctrl (Mac では ⌘) で優弧/劣弧を切り替えます。",measureRadiusHint:"円または円弧をクリックして半径を計測します (オブジェクト スナップ有効)。",measureCoordinateHint:"点をクリックして X/Y 座標を表示します (オブジェクト スナップ有効)。",measureExported:"{count} 件の計測を書き出しました。",measureImported:"{count} 件の計測を読み込みました。",measureImportFailed:"計測の読み込みに失敗しました: {error}",markupCloudHint:"2 つのコーナーをクリックして雲マークを作成します。",markupCalloutHint:"引出線の先端、または吹き出しのない雲マーク / 長方形 / 円の輪郭をクリックし、次に文字の基点をクリックします。",markupTextHint:"点をクリックして文字を配置します。",markupRectHint:"2 つのコーナーをクリックして長方形を作成します。",markupCircleHint:"中心をクリックし、次に円周上の点をクリックします。",markupArrowHint:"始点をクリックし、次に矢印の先端をクリックします。",markupStampHint:"クリックしてスタンプを配置します (承認 / 却下 / … と順に切り替わります)。",markupArrowEndHint:"矢印の先端をクリックします。",markupRectCornerHint:"もう一方のコーナーをクリックします。",markupCloudCornerHint:"もう一方のコーナーをクリックします。",markupCalloutAnchorHint:"吹き出しの文字の位置をクリックします。",markupCircleRadiusHint:"円周上の点をクリックします。",markupTextPrompt:"マークアップの文字を入力",markupTextEditHint:"キャンバス上で文字を入力します。Enter で確定、Esc でキャンセルします。",markupShapeCalloutHint:"クリックして文字ボックスを配置します (引出線は図形に接続されます)。Esc で吹き出しをキャンセルします。",markupDefaultLabel:"メモ",markupSelected:"選択中のマークアップ: {type}",markupSelectedCount:"選択中のマークアップ: {count}",markupCount:"マークアップ: {count}",markupExported:"{count} 件のマークアップを書き出しました。",markupImported:"{count} 件のマークアップを読み込みました。",markupImportFailed:"マークアップの読み込みに失敗しました: {error}",distance:"距離: {value}",coordinates:"X: {x} | Y: {y}",angle:"角度: {value}",arcLength:"円弧の長さ: {length} | 半径: {radius} | 角度: {angle} | 弦: {chord}",radius:"半径: {value}",continuousTotal:"合計長さ: {value}",area:"面積: {value}",lengthTotal:"長さの合計: {value}",areaTotal:"面積の合計: {value}",zoomLayer:"ズーム: {name}",loadFailed:"図面の読み込みに失敗しました: {error}",noLayout:"スナップショットにレイアウト データがありません。",loadingChunks:"図形を読み込み中… {loaded}/{total}",loadingOsnap:"オブジェクト スナップを読み込み中… {loaded}/{total}",buildingOsnap:"オブジェクト スナップのインデックスを作成中…"},package:{title:"図面パッケージを開く",hint:"このページと同じ場所に drawing.acex.json が見つかりませんでした。ローカルのパッケージ フォルダを選択するか、マニフェストの URL を入力してください。",hintUrlOnly:"このページと同じ場所に drawing.acex.json が見つかりませんでした。パッケージを開くにはマニフェストの URL を入力してください。",chooseFolder:"ローカル フォルダを選択",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL を開く",urlRequired:"マニフェストの URL を入力してください。",manifestNotFound:"このページと同じ場所に drawing.acex.json が見つかりませんでした。",invalidManifest:"パッケージ マニフェストが無効か、サポートされていないバージョンです: {error}",folderMissingManifest:"選択したフォルダには drawing.acex.json が含まれている必要があります。",folderUnsupported:"このブラウザーではローカルのパッケージ フォルダを開けません。代わりにマニフェストの URL を貼り付けてください。",loadFailed:"パッケージを開けませんでした: {error}"},access:{title:"保護された図面",passwordPrompt:"このファイルを開くにはパスワードを入力してください。",passwordPlaceholder:"パスワード",unlock:"ロック解除",passwordRequired:"パスワードを入力してください。",wrongPassword:"パスワードが正しくありません。もう一度お試しください。",expired:"このファイルは有効期限が切れているため、開くことができません。",expiredTitle:"ファイルの有効期限切れ",expiredDetail:"このファイルは {time} に有効期限が切れたため、開くことができません。",expiresAt:"有効期限: {time}",badgeExpires:"{time} に期限切れ",badgeCountdown:"残り {time}",tooManyAttempts:"パスワードの入力ミスが多すぎます。ページを更新してもう一度お試しください。"}},_l={toolbar:{viewerTools:"뷰어 도구",select:"선택",pan:"초점이동",zoom:"줌",zoomExtents:"범위",zoomSmartExtents:"스마트",zoomWindow:"윈도우",zoomSaved:"저장된 뷰",zoomOriginal:"저장된 뷰",measureDistance:"거리",measureContinuous:"연속",measureAngle:"각도",measureArc:"호",measureRadius:"반지름",measureArea:"면적",measureCoordinate:"XY",clearMeasurements:"지우기",measureHide:"숨기기",measureShow:"표시",measureImport:"가져오기",measureExport:"내보내기",measurementPanel:"결과",measure:"측정",annotation:"검토",markupCloud:"구름",markupCallout:"설명선",markupText:"문자",markupRect:"직사각형",markupCircle:"원",markupArrow:"화살표",markupStamp:"스탬프",markupPanel:"결과",markupHide:"숨기기",markupShow:"표시",clearMarkups:"지우기",markupImport:"가져오기",markupExport:"내보내기",snap:"스냅",layers:"도면층",layout:"배치",settings:"설정",simulatedMouseOn:"마우스",simulatedMouseOff:"돋보기",themeLight:"밝게",themeDark:"어둡게",switchBg:"배경",language:"언어",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"도구막대 접기",expand:"도구막대 펼치기",moreOverflow:"추가 도구"},settings:{ortho:"직교 모드 전환",polar:"극좌표 추적 각도",polarAngles:"극좌표 추적 각도"},drawStyle:{color:"색상",fontSize:"문자 높이",pickerTitle:"색상 선택",close:"닫기",ok:"확인",cancel:"취소",index:"색상 번호: ",rgb:"RGB: ",input:"색상",inputPlaceholder:"1-255 또는 #RRGGBB"},shortCutToolbar:{more:"더 보기",undo:"명령 취소",redo:"명령 복구",erase:"삭제",collapse:"도구막대 접기",expand:"도구막대 펼치기"},textHeight:{title:"문자 높이",close:"닫기",ok:"확인",cancel:"취소",adaptive:"화면에 맞춤",custom:"사용자 문자 높이",customPlaceholder:"월드 높이",fromScreen:"화면 크기 기준",fromScreenHint:"현재 줌 상태에서 문자가 화면에 표시될 크기를 입력하십시오. 이 값은 고정된 월드 공간 높이로 변환되어 이후 줌해도 일정하게 유지됩니다.",screenPxPlaceholder:"글꼴 크기",screenUnit:"px",convert:"변환"},entityPick:{cancel:"선택 취소"},layers:{title:"도면층",close:"도면층 닫기",showAll:"모두 표시",hideAll:"모두 숨기기",zoomTo:"{name}(으)로 줌"},review:{title:"검토",close:"검토 닫기",searchPlaceholder:"마크업 검색",empty:"아직 마크업이 없습니다",type:"유형",status:"상태",author:"작성자",summary:"요약",details:"상세 정보",closeDetails:"상세 정보 닫기",label:"레이블",comment:"설명",zoomTo:"줌",delete:"삭제",clear:"모두 지우기",statusValues:{open:"열림",question:"질문",answered:"답변됨",closed:"닫힘"}},measurePanel:{title:"측정",close:"측정 닫기",filterGroup:"유형별 필터",filterDistance:"거리",filterArc:"호",filterRadius:"반지름",filterAngle:"각도",filterArea:"면적",empty:"아직 측정이 없습니다",type:"유형",value:"값",delete:"삭제",clear:"모두 지우기"},session:{length:"길이",angle:"각도",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"확인",cancel:"취소",help:"도움말",back:"뒤로",collapse:"접기",expand:"펼치기",undo:"명령 취소"},touchPointTutorial:{title:"점을 정확하게 선택하려면?",description:"화면을 약 0.5초 동안 길게 누르십시오. 손가락 위에 십자선이 나타나 이동에 따라 움직이며, 형상에 스냅되어 더 정확하게 선택할 수 있습니다.",snoozeToday:"오늘은 다시 알리지 않음",hideForever:"다시 알리지 않음",ok:"확인"},status:{ready:"준비",zoomWindowHint:"두 구석을 클릭하여 윈도우로 줌합니다.",measureDistanceHint:"두 점을 클릭하여 거리를 측정합니다(객체 스냅 사용).",measureContinuousHint:"연속된 점을 탭하여 각 세그먼트를 측정하고, ✓를 탭하여 마칩니다. 정확한 스냅을 위해 길게 누르십시오.",measureAreaHint:"다각형 정점을 탭하고, 세 점 이상 지정한 후 ✓를 탭하여 마칩니다. 정확한 스냅을 위해 길게 누르십시오.",measureAngleHint:"정점을 클릭한 다음 각 변의 점을 클릭합니다(객체 스냅 사용).",measureArcHint:"원 또는 호를 클릭하여 그 길이를 측정하거나, 시작점, 호 위의 점, 끝점을 차례로 클릭합니다(객체 스냅 사용). Ctrl(Mac에서는 ⌘)로 큰 호/작은 호를 전환합니다.",measureRadiusHint:"원 또는 호를 클릭하여 반지름을 측정합니다(객체 스냅 사용).",measureCoordinateHint:"점을 클릭하여 X/Y 좌표를 읽습니다(객체 스냅 사용).",measureExported:"측정 {count}개를 내보냈습니다.",measureImported:"측정 {count}개를 가져왔습니다.",measureImportFailed:"측정을 가져오지 못했습니다: {error}",markupCloudHint:"두 구석을 클릭하여 구름형 수정 기호를 그립니다.",markupCalloutHint:"지시선 끝 또는 설명선이 없는 구름 / 직사각형 / 원의 윤곽을 클릭한 다음, 문자 기준점을 클릭합니다.",markupTextHint:"점을 클릭하여 문자를 배치합니다.",markupRectHint:"두 구석을 클릭하여 직사각형을 그립니다.",markupCircleHint:"중심을 클릭한 다음 원주 위의 점을 클릭합니다.",markupArrowHint:"시작점을 클릭한 다음 화살표 끝을 클릭합니다.",markupStampHint:"클릭하여 스탬프를 배치합니다(승인 / 반려 / … 순환).",markupArrowEndHint:"화살표 끝을 클릭합니다.",markupRectCornerHint:"반대쪽 구석을 클릭합니다.",markupCloudCornerHint:"반대쪽 구석을 클릭합니다.",markupCalloutAnchorHint:"문자 말풍선 위치를 클릭합니다.",markupCircleRadiusHint:"원주 위의 점을 클릭합니다.",markupTextPrompt:"마크업 문자 입력",markupTextEditHint:"캔버스에 문자를 입력하십시오. Enter로 마치고 Esc로 취소합니다.",markupShapeCalloutHint:"클릭하여 문자 상자를 배치합니다(지시선이 도형에 부착됨). Esc로 설명선을 취소합니다.",markupDefaultLabel:"메모",markupSelected:"선택된 마크업: {type}",markupSelectedCount:"선택된 마크업: {count}개",markupCount:"마크업: {count}개",markupExported:"마크업 {count}개를 내보냈습니다.",markupImported:"마크업 {count}개를 가져왔습니다.",markupImportFailed:"마크업을 가져오지 못했습니다: {error}",distance:"거리: {value}",coordinates:"X: {x} | Y: {y}",angle:"각도: {value}",arcLength:"호 길이: {length} | 반지름: {radius} | 각도: {angle} | 현: {chord}",radius:"반지름: {value}",continuousTotal:"총 길이: {value}",area:"면적: {value}",lengthTotal:"길이 합계: {value}",areaTotal:"면적 합계: {value}",zoomLayer:"줌: {name}",loadFailed:"도면을 로드하지 못했습니다: {error}",noLayout:"스냅샷에 배치 데이터가 없습니다.",loadingChunks:"형상 로드 중… {loaded}/{total}",loadingOsnap:"객체 스냅 로드 중… {loaded}/{total}",buildingOsnap:"객체 스냅 인덱스 작성 중…"},package:{title:"도면 패키지 열기",hint:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다. 로컬 패키지 폴더를 선택하거나 매니페스트 URL을 입력하십시오.",hintUrlOnly:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다. 패키지를 열려면 매니페스트 URL을 입력하십시오.",chooseFolder:"로컬 폴더 선택",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL 열기",urlRequired:"매니페스트 URL을 입력하십시오.",manifestNotFound:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다.",invalidManifest:"패키지 매니페스트가 잘못되었거나 지원되지 않는 버전입니다: {error}",folderMissingManifest:"선택한 폴더에 drawing.acex.json이 있어야 합니다.",folderUnsupported:"이 브라우저에서는 로컬 패키지 폴더를 열 수 없습니다. 대신 매니페스트 URL을 붙여 넣으십시오.",loadFailed:"패키지를 열지 못했습니다: {error}"},access:{title:"보호된 도면",passwordPrompt:"이 파일을 열려면 암호를 입력하십시오.",passwordPlaceholder:"암호",unlock:"잠금 해제",passwordRequired:"암호를 입력하십시오.",wrongPassword:"암호가 올바르지 않습니다. 다시 시도하십시오.",expired:"이 파일은 만료되어 더 이상 열 수 없습니다.",expiredTitle:"파일 만료됨",expiredDetail:"이 파일은 {time}에 만료되어 더 이상 열 수 없습니다.",expiresAt:"만료: {time}",badgeExpires:"{time} 만료",badgeCountdown:"{time} 후 만료",tooManyAttempts:"잘못된 암호 입력 횟수가 너무 많습니다. 다시 시도하려면 페이지를 새로 고치십시오."}},he=["en","zh","ja","ko","cs","tr","ar"],jn={en:"EN",zh:"中",ja:"日",ko:"한",cs:"CS",tr:"TR",ar:"AR"},Kn="mlcad-html-locale",Zn={...{en:{toolbar:{viewerTools:"Viewer tools",select:"Select",pan:"Pan",zoom:"Zoom",zoomExtents:"Extents",zoomSmartExtents:"Smart",zoomWindow:"Window",zoomSaved:"Saved",zoomOriginal:"Saved",measureDistance:"Distance",measureContinuous:"Continuous",measureAngle:"Angle",measureArc:"Arc",measureRadius:"Radius",measureArea:"Area",measureCoordinate:"XY",clearMeasurements:"Clear",measureHide:"Hide",measureShow:"Show",measureImport:"Import",measureExport:"Export",measurementPanel:"Results",measure:"Measure",annotation:"Review",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rect",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupPanel:"Results",markupHide:"Hide",markupShow:"Show",clearMarkups:"Clear",markupImport:"Import",markupExport:"Export",snap:"Snap",layers:"Layers",layout:"Layout",settings:"Settings",simulatedMouseOn:"Mouse",simulatedMouseOff:"Loupe",themeLight:"Light",themeDark:"Dark",switchBg:"Background",language:"Language",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Collapse toolbar",expand:"Expand toolbar",moreOverflow:"More tools"},settings:{ortho:"Toggle orthogonal mode",polar:"Polar tracking angles",polarAngles:"Polar tracking angles"},drawStyle:{color:"Color",fontSize:"Text height",pickerTitle:"Select Color",close:"Close",ok:"OK",cancel:"Cancel",index:"Color Index: ",rgb:"RGB: ",input:"Color",inputPlaceholder:"1-255 or #RRGGBB"},shortCutToolbar:{more:"More",undo:"Undo",redo:"Redo",erase:"Delete",collapse:"Collapse toolbar",expand:"Expand toolbar"},textHeight:{title:"Text Height",close:"Close",ok:"OK",cancel:"Cancel",adaptive:"Fit to screen",custom:"Custom text height",customPlaceholder:"World height",fromScreen:"From screen size",fromScreenHint:"Enter how large the text should look on screen at the current zoom. It is converted to a fixed world-space height that stays constant when you zoom later.",screenPxPlaceholder:"Font size",screenUnit:"px",convert:"Convert"},entityPick:{cancel:"Cancel selection"},layers:{title:"Layers",close:"Close layers",showAll:"Show all",hideAll:"Hide all",zoomTo:"Zoom to {name}"},review:{title:"Review",close:"Close review",searchPlaceholder:"Search markups",empty:"No markups yet",type:"Type",status:"Status",author:"Author",summary:"Summary",details:"Details",closeDetails:"Close details",label:"Label",comment:"Comment",zoomTo:"Zoom to",delete:"Delete",clear:"Clear all",statusValues:{open:"Open",question:"Question",answered:"Answered",closed:"Closed"}},measurePanel:{title:"Measurements",close:"Close measurements",filterGroup:"Filter by type",filterDistance:"Distance",filterArc:"Arc",filterRadius:"Radius",filterAngle:"Angle",filterArea:"Area",empty:"No measurements yet",type:"Type",value:"Value",delete:"Delete",clear:"Clear all"},session:{length:"Length",angle:"Angle",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Confirm",cancel:"Cancel",help:"Help",back:"Back",collapse:"Collapse",expand:"Expand",undo:"Undo"},touchPointTutorial:{title:"How to pick points precisely?",description:"Long-press on the screen for about 0.5 seconds. A cross appears above your finger and follows as you move, snapping to geometry for more accurate picks.",snoozeToday:"Don't remind me today",hideForever:"Don't remind me again",ok:"Got it"},status:{ready:"Ready",zoomWindowHint:"Click two corners to zoom to a window.",measureDistanceHint:"Click two points to measure distance (object snap enabled).",measureContinuousHint:"Tap successive points to measure each segment; tap ✓ to finish. Long-press for precise snap.",measureAreaHint:"Tap polygon vertices; tap ✓ to finish when at least three points are set. Long-press for precise snap.",measureAngleHint:"Click vertex, then two points on each arm (object snap enabled).",measureArcHint:"Click a circle or arc to measure along it, or click start, a point on the arc, then end (object snap enabled). Ctrl (⌘ on Mac) switches major/minor arc.",measureRadiusHint:"Click a circle or arc to measure its radius (object snap enabled).",measureCoordinateHint:"Click a point to read its X/Y coordinates (object snap enabled).",measureExported:"Exported {count} measurement(s).",measureImported:"Imported {count} measurement(s).",measureImportFailed:"Failed to import measurements: {error}",markupCloudHint:"Click two corners to draw a revision cloud.",markupCalloutHint:"Click the leader tip, or the outline of a cloud / rectangle / circle that has no callout, then the text anchor.",markupTextHint:"Click a point to place text.",markupRectHint:"Click two corners to draw a rectangle.",markupCircleHint:"Click the center, then a point on the circumference.",markupArrowHint:"Click the start point, then the arrow tip.",markupStampHint:"Click to place a stamp (cycles approved / rejected / …).",markupArrowEndHint:"Click the arrow tip.",markupRectCornerHint:"Click the opposite corner.",markupCloudCornerHint:"Click the opposite corner.",markupCalloutAnchorHint:"Click the text bubble position.",markupCircleRadiusHint:"Click a point on the circumference.",markupTextPrompt:"Enter markup text",markupTextEditHint:"Type text on the canvas. Enter to finish, Esc to cancel.",markupShapeCalloutHint:"Click to place the text box (leader attaches to the shape). Esc cancels the callout.",markupDefaultLabel:"Note",markupSelected:"Selected markup: {type}",markupSelectedCount:"Selected markups: {count}",markupCount:"Markups: {count}",markupExported:"Exported {count} markup(s).",markupImported:"Imported {count} markup(s).",markupImportFailed:"Failed to import markups: {error}",distance:"Distance: {value}",coordinates:"X: {x} | Y: {y}",angle:"Angle: {value}",arcLength:"Arc length: {length} | Radius: {radius} | Angle: {angle} | Chord: {chord}",radius:"Radius: {value}",continuousTotal:"Total length: {value}",area:"Area: {value}",lengthTotal:"Length total: {value}",areaTotal:"Area total: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Failed to load drawing: {error}",noLayout:"No layout data in snapshot.",loadingChunks:"Loading geometry… {loaded}/{total}",loadingOsnap:"Loading object snap… {loaded}/{total}",buildingOsnap:"Building object snap index…"},package:{title:"Open drawing package",hint:"No drawing.acex.json was found next to this page. Choose a local package folder or enter the manifest URL.",hintUrlOnly:"No drawing.acex.json was found next to this page. Enter the manifest URL to open the package.",chooseFolder:"Choose local folder",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Open URL",urlRequired:"Please enter a manifest URL.",manifestNotFound:"drawing.acex.json was not found next to this page.",invalidManifest:"The package manifest is invalid or uses an unsupported version: {error}",folderMissingManifest:"The selected folder must contain drawing.acex.json.",folderUnsupported:"This browser cannot open a local package folder. Paste a manifest URL instead.",loadFailed:"Failed to open package: {error}"},access:{title:"Protected drawing",passwordPrompt:"Enter the password to open this file.",passwordPlaceholder:"Password",unlock:"Unlock",passwordRequired:"Please enter a password.",wrongPassword:"Incorrect password. Try again.",expired:"This file has expired and can no longer be opened.",expiredTitle:"File expired",expiredDetail:"This file expired on {time} and can no longer be opened.",expiresAt:"Expires: {time}",badgeExpires:"Expires {time}",badgeCountdown:"Expires in {time}",tooManyAttempts:"Too many incorrect password attempts. Refresh the page to try again."}},zh:{toolbar:{viewerTools:"查看器工具",select:"选择",pan:"平移",zoom:"缩放",zoomExtents:"范围",zoomSmartExtents:"智能",zoomWindow:"窗口",zoomSaved:"保存的视图",zoomOriginal:"保存的视图",measureDistance:"测距离",measureContinuous:"连续测",measureAngle:"测角度",measureArc:"测弧长",measureRadius:"测半径",measureArea:"测面积",measureCoordinate:"测坐标",clearMeasurements:"清除",measureHide:"隐藏",measureShow:"显示",measureImport:"导入",measureExport:"导出",measurementPanel:"看结果",measure:"测量",annotation:"审阅",markupCloud:"云线",markupCallout:"标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupPanel:"看结果",markupHide:"隐藏",markupShow:"显示",clearMarkups:"清除",markupImport:"导入",markupExport:"导出",snap:"捕捉",layers:"图层",layout:"布局",settings:"设置",simulatedMouseOn:"鼠标",simulatedMouseOff:"放大",themeLight:"浅色",themeDark:"深色",switchBg:"背景",language:"语言",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"收起工具栏",expand:"展开工具栏",moreOverflow:"更多工具"},settings:{ortho:"切换正交模式",polar:"极轴追踪角度",polarAngles:"极轴追踪角度"},drawStyle:{color:"颜色",fontSize:"字高",pickerTitle:"选择颜色",close:"关闭",ok:"确定",cancel:"取消",index:"颜色索引:",rgb:"RGB:",input:"颜色",inputPlaceholder:"1-255 或 #RRGGBB"},shortCutToolbar:{more:"更多",undo:"撤销",redo:"重做",erase:"删除",collapse:"收起工具栏",expand:"展开工具栏"},textHeight:{title:"字高设置",close:"关闭",ok:"确定",cancel:"取消",adaptive:"自适应屏幕",custom:"自定义字高",customPlaceholder:"世界坐标字高",fromScreen:"按屏幕字号换算",fromScreenHint:"按当前视图缩放,输入希望看到的屏幕字号(像素),换算为固定的世界坐标字高;之后缩放时字的世界高度不变。",screenPxPlaceholder:"屏幕字号",screenUnit:"px",convert:"换算"},entityPick:{cancel:"取消选择"},layers:{title:"图层",close:"关闭图层",showAll:"全部显示",hideAll:"全部隐藏",zoomTo:"缩放到 {name}"},review:{title:"批注",close:"关闭批注面板",searchPlaceholder:"搜索批注",empty:"暂无批注",type:"类型",status:"状态",author:"作者",summary:"摘要",details:"详情",closeDetails:"关闭详情",label:"标签",comment:"评论",zoomTo:"缩放到",delete:"删除",clear:"全部清除",statusValues:{open:"打开",question:"疑问",answered:"已答复",closed:"已关闭"}},measurePanel:{title:"测量",close:"关闭测量面板",filterGroup:"按类型筛选",filterDistance:"距离",filterArc:"弧长",filterRadius:"半径",filterAngle:"角度",filterArea:"面积",empty:"暂无测量",type:"类型",value:"数值",delete:"删除",clear:"全部清除"},session:{length:"长度",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"确定",cancel:"取消",help:"帮助",back:"返回",collapse:"收起",expand:"展开",undo:"撤销"},touchPointTutorial:{title:"怎样可以精确取点?",description:"手指在屏幕上长按0.5s左右,上方出现十字,手指移动时十字跟随移动并自动捕捉。取点更精准。",snoozeToday:"今日不再提醒",hideForever:"不再提醒",ok:"我知道了"},status:{ready:"就绪",zoomWindowHint:"点击两个角点以窗口缩放。",measureDistanceHint:"点击两点以测量距离(已启用对象捕捉)。",measureContinuousHint:"依次点击多个点测量各段距离,点 ✓ 完成。长按可精确捕捉。",measureAreaHint:"依次点击多边形顶点;至少三点后点 ✓ 完成。长按可精确捕捉。",measureAngleHint:"依次点击顶点与两条边上的点(已启用对象捕捉)。",measureArcHint:"点击圆或圆弧可沿其测量;否则依次点击弧起点、弧上一点与弧端点(已启用对象捕捉)。锁定后按 Ctrl(Mac 为 Control 或 ⌘)可在大弧与小弧之间切换。",measureRadiusHint:"点击圆或圆弧以测量半径(已启用对象捕捉)。",measureCoordinateHint:"点击一点以读取其 X/Y 坐标(已启用对象捕捉)。",measureExported:"已导出 {count} 条测量。",measureImported:"已导入 {count} 条测量。",measureImportFailed:"导入测量失败:{error}",markupCloudHint:"点击两个对角点绘制修订云线。",markupCalloutHint:"先点击引线端点,或点击尚无标注的云线/矩形/圆外框,再点击文字位置。",markupTextHint:"点击一点放置文字。",markupRectHint:"点击两个对角点绘制矩形。",markupCircleHint:"先点击圆心,再点击圆周上一点。",markupArrowHint:"先点击起点,再点击箭头端点。",markupStampHint:"点击放置图章(在批准/拒绝等之间循环)。",markupArrowEndHint:"点击箭头端点。",markupRectCornerHint:"点击对角点。",markupCloudCornerHint:"点击对角点。",markupCalloutAnchorHint:"点击文字气泡位置。",markupCircleRadiusHint:"点击圆周上一点。",markupTextPrompt:"输入批注文字",markupTextEditHint:"在画布上输入文字。Enter 完成,Esc 取消。",markupShapeCalloutHint:"点击放置文本框(引线自动贴到图形)。Esc 取消引线和文本框。",markupDefaultLabel:"批注",markupSelected:"已选批注:{type}",markupSelectedCount:"已选批注:{count} 个",markupCount:"批注数:{count}",markupExported:"已导出 {count} 条批注。",markupImported:"已导入 {count} 条批注。",markupImportFailed:"导入批注失败:{error}",distance:"距离:{value}",coordinates:"X:{x} | Y:{y}",angle:"角度:{value}",arcLength:"弧长:{length} | 半径:{radius} | 总角度:{angle} | 弦长:{chord}",radius:"半径:{value}",continuousTotal:"总长度:{value}",area:"面积:{value}",lengthTotal:"长度合计:{value}",areaTotal:"面积合计:{value}",zoomLayer:"缩放:{name}",loadFailed:"无法加载图纸:{error}",noLayout:"快照中没有布局数据。",loadingChunks:"正在加载几何… {loaded}/{total}",loadingOsnap:"正在加载对象捕捉… {loaded}/{total}",buildingOsnap:"正在构建对象捕捉索引…"},package:{title:"打开图纸包",hint:"当前页面同级目录未找到 drawing.acex.json。请选择本地包文件夹,或输入清单 URL。",hintUrlOnly:"当前页面同级目录未找到 drawing.acex.json。请输入清单 URL 以打开图纸包。",chooseFolder:"选择本地文件夹",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"打开 URL",urlRequired:"请输入清单 URL。",manifestNotFound:"当前页面同级目录未找到 drawing.acex.json。",invalidManifest:"包清单无效或版本不受支持:{error}",folderMissingManifest:"所选文件夹必须包含 drawing.acex.json。",folderUnsupported:"当前浏览器无法选择本地包文件夹,请改为输入清单 URL。",loadFailed:"无法打开图纸包:{error}"},access:{title:"受保护的图纸",passwordPrompt:"请输入密码以打开此文件。",passwordPlaceholder:"密码",unlock:"解锁",passwordRequired:"请输入密码。",wrongPassword:"密码错误,请重试。",expired:"此文件已过期,无法打开。",expiredTitle:"文件已过期",expiredDetail:"此文件已于 {time} 过期,无法打开。",expiresAt:"有效期至:{time}",badgeExpires:"有效期至 {time}",badgeCountdown:"剩余 {time}",tooManyAttempts:"密码错误次数过多,请刷新页面后重新输入。"}},cs:{toolbar:{viewerTools:"Nástroje prohlížeče",select:"Výběr",pan:"Posun",zoom:"Přiblížení",zoomExtents:"Rozsah",zoomSmartExtents:"Chytrý",zoomWindow:"Okno",zoomSaved:"Uložený",zoomOriginal:"Uložený",measureDistance:"Vzdálenost",measureContinuous:"Spojité",measureAngle:"Úhel",measureArc:"Oblouk",measureRadius:"Poloměr",measureArea:"Plocha",measureCoordinate:"Souřadnice",clearMeasurements:"Vymazat",measureHide:"Skrýt",measureShow:"Zobrazit",measureImport:"Import",measureExport:"Export",measurementPanel:"Výsledky",measure:"Měření",annotation:"Kontrola",markupCloud:"Obláček",markupCallout:"Odkaz",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupPanel:"Výsledky",markupHide:"Skrýt",markupShow:"Zobrazit",clearMarkups:"Vymazat",markupImport:"Import",markupExport:"Export",snap:"Uchopit",layers:"Hladiny",layout:"Rozvržení",settings:"Nastavení",simulatedMouseOn:"Myš",simulatedMouseOff:"Lupa",themeLight:"Světlý",themeDark:"Tmavý",switchBg:"Pozadí",language:"Jazyk",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů",moreOverflow:"Další nástroje"},settings:{ortho:"Přepnout ortogonální režim",polar:"Úhly polárního trasování",polarAngles:"Úhly polárního trasování"},drawStyle:{color:"Barva",fontSize:"Výška textu",pickerTitle:"Vybrat barvu",close:"Zavřít",ok:"OK",cancel:"Zrušit",index:"Index barvy: ",rgb:"RGB: ",input:"Barva",inputPlaceholder:"1-255 nebo #RRGGBB"},shortCutToolbar:{more:"Více",undo:"Zpět",redo:"Znovu",erase:"Smazat",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů"},textHeight:{title:"Výška textu",close:"Zavřít",ok:"OK",cancel:"Zrušit",adaptive:"Přizpůsobit obrazovce",custom:"Vlastní výška textu",customPlaceholder:"Světová výška",fromScreen:"Ze velikosti na obrazovce",fromScreenHint:"Zadejte, jak velký má text vypadat na obrazovce při aktuálním zoomu. Přepočítá se na pevnou světovou výšku, která se při pozdějším zoomování nemění.",screenPxPlaceholder:"Velikost písma",screenUnit:"px",convert:"Přepočítat"},entityPick:{cancel:"Zrušit výběr"},layers:{title:"Hladiny",close:"Zavřít hladiny",showAll:"Zobrazit vše",hideAll:"Skrýt vše",zoomTo:"Přiblížit na {name}"},review:{title:"Kontrola",close:"Zavřít kontrolu",searchPlaceholder:"Hledat poznámky",empty:"Zatím žádné poznámky",type:"Typ",status:"Stav",author:"Autor",summary:"Souhrn",details:"Podrobnosti",closeDetails:"Zavřít podrobnosti",label:"Popisek",comment:"Komentář",zoomTo:"Přiblížit na",delete:"Odstranit",clear:"Vymazat vše",statusValues:{open:"Otevřeno",question:"Otázka",answered:"Zodpovězeno",closed:"Uzavřeno"}},measurePanel:{title:"Měření",close:"Zavřít měření",filterGroup:"Filtrovat podle typu",filterDistance:"Vzdálenost",filterArc:"Oblouk",filterRadius:"Poloměr",filterAngle:"Úhel",filterArea:"Plocha",empty:"Zatím žádná měření",type:"Typ",value:"Hodnota",delete:"Odstranit",clear:"Vymazat vše"},session:{length:"Délka",angle:"Úhel",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Potvrdit",cancel:"Zrušit",help:"Nápověda",back:"Zpět",collapse:"Sbalit",expand:"Rozbalit",undo:"Zpět"},touchPointTutorial:{title:"Jak přesně vybrat bod?",description:"Podržte prst na obrazovce asi 0,5 sekundy. Nad prstem se objeví kříž, který při pohybu sleduje prst a přichytává se k geometrii pro přesnější výběr.",snoozeToday:"Dnes už nepřipomínat",hideForever:"Už nepřipomínat",ok:"Rozumím"},status:{ready:"Připraveno",zoomWindowHint:"Klikněte na dva rohy pro přiblížení oknem.",measureDistanceHint:"Klikněte na dva body pro změření vzdálenosti (uchopení objektů zapnuto).",measureContinuousHint:"Klepejte na další body pro měření každého úseku; dokončete klepnutím na ✓. Dlouhé stisknutí pro přesné uchopení.",measureAngleHint:"Klikněte na vrchol, poté na dva body na každém rameni (uchopení objektů zapnuto).",measureArcHint:"Klikněte na kružnici nebo oblouk pro měření podél něj, nebo klikněte na začátek, bod na oblouku a konec (uchopení objektů zapnuto). Ctrl (⌘ na Macu) přepíná velký/malý oblouk.",measureRadiusHint:"Klikněte na kružnici nebo oblouk pro změření poloměru (uchopení objektů zapnuto).",measureAreaHint:"Klepejte na vrcholy mnohoúhelníku; dokončete klepnutím na ✓ po alespoň třech bodech.",measureCoordinateHint:"Klikněte na bod pro zobrazení jeho souřadnic X/Y (uchopení objektů zapnuto).",measureExported:"Exportováno {count} měření.",measureImported:"Importováno {count} měření.",measureImportFailed:"Import měření selhal: {error}",markupCloudHint:"Klikněte na dva rohy pro nakreslení obláčku.",markupCalloutHint:"Klikněte na hrot vodítka, nebo na obrys obláčku/obdélníku/kružnice bez odkazu, a poté na kotvu textu.",markupTextHint:"Klikněte pro umístění textu.",markupRectHint:"Klikněte na dva rohy pro nakreslení obdélníku.",markupCircleHint:"Klikněte na střed a poté na bod na kružnici.",markupArrowHint:"Klikněte na začátek a poté na hrot šipky.",markupStampHint:"Klikněte pro umístění razítka (schváleno / zamítnuto / …).",markupArrowEndHint:"Klikněte na hrot šipky.",markupRectCornerHint:"Klikněte na protilehlý roh.",markupCloudCornerHint:"Klikněte na protilehlý roh.",markupCalloutAnchorHint:"Klikněte na pozici textové bubliny.",markupCircleRadiusHint:"Klikněte na bod na kružnici.",markupTextPrompt:"Zadejte text poznámky",markupTextEditHint:"Pište text přímo na plátno. Enter dokončí, Esc zruší.",markupShapeCalloutHint:"Klikněte pro umístění textového pole (vodítko se připojí k tvaru). Esc zruší odkaz.",markupDefaultLabel:"Poznámka",markupSelected:"Vybraná poznámka: {type}",markupSelectedCount:"Vybrané poznámky: {count}",markupCount:"Poznámky: {count}",markupExported:"Exportováno {count} poznámek.",markupImported:"Importováno {count} poznámek.",markupImportFailed:"Import poznámek selhal: {error}",distance:"Vzdálenost: {value}",coordinates:"X: {x} | Y: {y}",angle:"Úhel: {value}",arcLength:"Délka oblouku: {length} | Poloměr: {radius} | Úhel: {angle} | Tětiva: {chord}",radius:"Poloměr: {value}",continuousTotal:"Celková délka: {value}",area:"Plocha: {value}",lengthTotal:"Celková délka: {value}",areaTotal:"Celková plocha: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Nepodařilo se načíst výkres: {error}",noLayout:"Snímek neobsahuje data rozvržení.",loadingChunks:"Načítání geometrie… {loaded}/{total}",loadingOsnap:"Načítání uchopování… {loaded}/{total}",buildingOsnap:"Sestavování indexu uchopování…"},package:{title:"Otevřít balíček výkresu",hint:"Vedle této stránky nebyl nalezen drawing.acex.json. Vyberte místní složku balíčku nebo zadejte URL manifestu.",hintUrlOnly:"Vedle této stránky nebyl nalezen drawing.acex.json. Zadejte URL manifestu pro otevření balíčku.",chooseFolder:"Vybrat místní složku",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Otevřít URL",urlRequired:"Zadejte URL manifestu.",manifestNotFound:"drawing.acex.json nebyl vedle této stránky nalezen.",invalidManifest:"Manifest balíčku je neplatný nebo používá nepodporovanou verzi: {error}",folderMissingManifest:"Vybraná složka musí obsahovat drawing.acex.json.",folderUnsupported:"Tento prohlížeč neumí otevřít místní složku balíčku. Zadejte místo toho URL manifestu.",loadFailed:"Nepodařilo se otevřít balíček: {error}"},access:{title:"Chráněný výkres",passwordPrompt:"Zadejte heslo pro otevření tohoto souboru.",passwordPlaceholder:"Heslo",unlock:"Odemknout",passwordRequired:"Zadejte heslo.",wrongPassword:"Nesprávné heslo. Zkuste to znovu.",expired:"Platnost tohoto souboru vypršela a nelze jej otevřít.",expiredTitle:"Soubor vypršel",expiredDetail:"Platnost tohoto souboru vypršela dne {time} a již jej nelze otevřít.",expiresAt:"Platnost do: {time}",badgeExpires:"Platnost do {time}",badgeCountdown:"Vyprší za {time}",tooManyAttempts:"Příliš mnoho nesprávných pokusů o heslo. Obnovte stránku a zkuste to znovu."}},tr:{toolbar:{viewerTools:"Görüntüleyici araçları",select:"Seç",pan:"Kaydır",zoom:"Yakınlaştır",zoomExtents:"Sınırlar",zoomSmartExtents:"Akıllı",zoomWindow:"Pencere",zoomSaved:"Kayıtlı",zoomOriginal:"Kayıtlı",measureDistance:"Mesafe",measureContinuous:"Sürekli",measureAngle:"Açı",measureArc:"Yay",measureRadius:"Yarıçap",measureArea:"Alan",measureCoordinate:"XY",clearMeasurements:"Temizle",measureHide:"Gizle",measureShow:"Göster",measureImport:"İçe aktar",measureExport:"Dışa aktar",measurementPanel:"Sonuç",measure:"Ölçüm",annotation:"İnceleme",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupPanel:"Sonuç",markupHide:"Gizle",markupShow:"Göster",clearMarkups:"Temizle",markupImport:"İçe aktar",markupExport:"Dışa aktar",snap:"Yakalama",layers:"Katman",layout:"Düzen",settings:"Ayarlar",simulatedMouseOn:"Fare",simulatedMouseOff:"Büyüteç",themeLight:"Açık",themeDark:"Koyu",switchBg:"Arka plan",language:"Dil",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet",moreOverflow:"Diğer araçlar"},settings:{ortho:"Dik modu aç/kapat",polar:"Kutupsal izleme açıları",polarAngles:"Kutupsal izleme açıları"},drawStyle:{color:"Renk",fontSize:"Yazı yüksekliği",pickerTitle:"Renk Seç",close:"Kapat",ok:"Tamam",cancel:"İptal",index:"Renk İndeksi: ",rgb:"RGB: ",input:"Renk",inputPlaceholder:"1-255 veya #RRGGBB"},shortCutToolbar:{more:"Daha fazla",undo:"Geri al",redo:"Yinele",erase:"Sil",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet"},textHeight:{title:"Yazı Yüksekliği",close:"Kapat",ok:"Tamam",cancel:"İptal",adaptive:"Ekrana uyarla",custom:"Özel yazı yüksekliği",customPlaceholder:"Dünya yüksekliği",fromScreen:"Ekran boyutundan",fromScreenHint:"Geçerli yakınlaştırmada ekranda istediğiniz yazı boyutunu girin. Sabit bir dünya yüksekliğine dönüştürülür; sonra yakınlaştırınca bu yükseklik değişmez.",screenPxPlaceholder:"Yazı boyutu",screenUnit:"px",convert:"Dönüştür"},entityPick:{cancel:"Seçimi iptal et"},layers:{title:"Katmanlar",close:"Katmanları kapat",showAll:"Tümünü göster",hideAll:"Tümünü gizle",zoomTo:"{name} katmanına yakınlaştır"},review:{title:"İnceleme",close:"İncelemeyi kapat",searchPlaceholder:"İşaretlerde ara",empty:"Henüz işaret yok",type:"Tür",status:"Durum",author:"Yazar",summary:"Özet",details:"Ayrıntılar",closeDetails:"Ayrıntıları kapat",label:"Etiket",comment:"Yorum",zoomTo:"Yakınlaştır",delete:"Sil",clear:"Tümünü temizle",statusValues:{open:"Açık",question:"Soru",answered:"Yanıtlandı",closed:"Kapalı"}},measurePanel:{title:"Ölçümler",close:"Ölçümleri kapat",filterGroup:"Türe göre filtrele",filterDistance:"Mesafe",filterArc:"Yay",filterRadius:"Yarıçap",filterAngle:"Açı",filterArea:"Alan",empty:"Henüz ölçüm yok",type:"Tür",value:"Değer",delete:"Sil",clear:"Tümünü temizle"},session:{length:"Uzunluk",angle:"Açı",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Onayla",cancel:"İptal",help:"Yardım",back:"Geri",collapse:"Daralt",expand:"Genişlet",undo:"Geri al"},touchPointTutorial:{title:"Noktalar nasıl hassas seçilir?",description:"Ekranda yaklaşık 0,5 saniye basılı tutun. Parmağınızın üstünde bir artı belirir ve hareket ederken geometriye yapışarak daha doğru seçim yapmanızı sağlar.",snoozeToday:"Bugün tekrar hatırlatma",hideForever:"Bir daha hatırlatma",ok:"Anladım"},status:{ready:"Hazır",zoomWindowHint:"Pencere yakınlaştırmak için iki köşeyi tıklayın.",measureDistanceHint:"Mesafe ölçmek için iki nokta tıklayın (nesne yakalama etkin).",measureContinuousHint:"Her segmenti ölçmek için ardışık noktalar dokunun; bitirmek için ✓. Hassas yakalama için basılı tutun.",measureAngleHint:"Önce köşe noktasını, sonra her koldan birer nokta tıklayın (nesne yakalama etkin).",measureArcHint:"Ölçmek için bir çember veya yaya tıklayın; ya da yay başlangıcı, yay üzerindeki bir nokta ve yay sonunu tıklayın (nesne yakalama etkin). Ctrl (Mac’te ⌘) büyük/küçük yay arasında geçiş yapar.",measureRadiusHint:"Yarıçap ölçmek için bir çember veya yaya tıklayın (nesne yakalama etkin).",measureAreaHint:"Çokgen köşelerini dokunun; en az üç noktadan sonra bitirmek için ✓.",measureCoordinateHint:"X/Y koordinatlarını okumak için bir nokta tıklayın (nesne yakalama etkin).",measureExported:"{count} ölçüm dışa aktarıldı.",measureImported:"{count} ölçüm içe aktarıldı.",measureImportFailed:"Ölçüm içe aktarılamadı: {error}",markupCloudHint:"Revizyon bulutu çizmek için iki köşe tıklayın.",markupCalloutHint:"Lider ucunu veya çağrısı olmayan bulut/dikdörtgen/daire dış çerçevesini tıklayın, ardından metin konumunu tıklayın.",markupTextHint:"Metin yerleştirmek için bir nokta tıklayın.",markupRectHint:"Dikdörtgen çizmek için iki köşe tıklayın.",markupCircleHint:"Önce merkezi, sonra çevre üzerindeki bir noktayı tıklayın.",markupArrowHint:"Önce başlangıcı, sonra ok ucunu tıklayın.",markupStampHint:"Damga yerleştirmek için tıklayın (onaylandı / reddedildi / …).",markupArrowEndHint:"Ok ucunu tıklayın.",markupRectCornerHint:"Karşı köşeyi tıklayın.",markupCloudCornerHint:"Karşı köşeyi tıklayın.",markupCalloutAnchorHint:"Metin balonu konumunu tıklayın.",markupCircleRadiusHint:"Çevre üzerindeki bir noktayı tıklayın.",markupTextPrompt:"İşaretleme metnini girin",markupTextEditHint:"Metni tuval üzerinde yazın. Enter ile bitirin, Esc ile iptal edin.",markupShapeCalloutHint:"Metin kutusunu yerleştirmek için tıklayın (lider şekle bağlanır). Esc çağrıyı iptal eder.",markupDefaultLabel:"Not",markupSelected:"Seçili işaretleme: {type}",markupSelectedCount:"Seçili işaretlemeler: {count}",markupCount:"İşaretlemeler: {count}",markupExported:"{count} işaretleme dışa aktarıldı.",markupImported:"{count} işaretleme içe aktarıldı.",markupImportFailed:"İşaretleme içe aktarılamadı: {error}",distance:"Mesafe: {value}",coordinates:"X: {x} | Y: {y}",angle:"Açı: {value}",arcLength:"Yay uzunluğu: {length} | Yarıçap: {radius} | Açı: {angle} | Kiriş: {chord}",radius:"Yarıçap: {value}",continuousTotal:"Toplam uzunluk: {value}",area:"Alan: {value}",lengthTotal:"Toplam uzunluk: {value}",areaTotal:"Toplam alan: {value}",zoomLayer:"Yakınlaştır: {name}",loadFailed:"Çizim yüklenemedi: {error}",noLayout:"Anlık görüntüde yerleşim verisi yok.",loadingChunks:"Geometri yükleniyor… {loaded}/{total}",loadingOsnap:"Nesne yakalama yükleniyor… {loaded}/{total}",buildingOsnap:"Nesne yakalama dizini oluşturuluyor…"},package:{title:"Çizim paketini aç",hint:"Bu sayfanın yanında drawing.acex.json bulunamadı. Yerel bir paket klasörü seçin veya manifesto URL’sini girin.",hintUrlOnly:"Bu sayfanın yanında drawing.acex.json bulunamadı. Paketi açmak için manifesto URL’sini girin.",chooseFolder:"Yerel klasör seç",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL aç",urlRequired:"Lütfen bir manifesto URL’si girin.",manifestNotFound:"Bu sayfanın yanında drawing.acex.json bulunamadı.",invalidManifest:"Paket manifestosu geçersiz veya desteklenmeyen bir sürüm kullanıyor: {error}",folderMissingManifest:"Seçilen klasör drawing.acex.json içermelidir.",folderUnsupported:"Bu tarayıcı yerel paket klasörü açamıyor. Bunun yerine manifesto URL’si yapıştırın.",loadFailed:"Paket açılamadı: {error}"},access:{title:"Korumalı çizim",passwordPrompt:"Bu dosyayı açmak için parolayı girin.",passwordPlaceholder:"Parola",unlock:"Kilidi aç",passwordRequired:"Lütfen bir parola girin.",wrongPassword:"Parola yanlış. Tekrar deneyin.",expired:"Bu dosyanın süresi doldu ve artık açılamaz.",expiredTitle:"Dosyanın süresi doldu",expiredDetail:"Bu dosyanın süresi {time} tarihinde doldu ve artık açılamaz.",expiresAt:"Son geçerlilik: {time}",badgeExpires:"Son geçerlilik {time}",badgeCountdown:"Kalan süre {time}",tooManyAttempts:"Çok fazla yanlış parola denemesi yapıldı. Tekrar denemek için sayfayı yenileyin."}}},ja:Il,ko:_l,ar:{toolbar:{viewerTools:"أدوات العارض",select:"تحديد",pan:"تحريك",zoom:"تكبير/تصغير",zoomExtents:"ملاءمة",zoomSmartExtents:"ذكية",zoomWindow:"نافذة",zoomSaved:"محفوظ",zoomOriginal:"محفوظ",measureDistance:"مسافة",measureContinuous:"مستمر",measureAngle:"زاوية",measureArc:"قوس",measureRadius:"نصف القطر",measureArea:"مساحة",measureCoordinate:"إحداثيات",clearMeasurements:"مسح",measureHide:"إخفاء",measureShow:"إظهار",measureImport:"استيراد",measureExport:"تصدير",measurementPanel:"نتائج",measure:"قياس",annotation:"مراجعة",markupCloud:"سحابة",markupCallout:"تعليق",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupPanel:"نتائج",markupHide:"إخفاء",markupShow:"إظهار",clearMarkups:"مسح",markupImport:"استيراد",markupExport:"تصدير",snap:"التقاط",layers:"طبقات",layout:"تخطيط",settings:"إعدادات",simulatedMouseOn:"ماوس",simulatedMouseOff:"عدسة",themeLight:"فاتح",themeDark:"داكن",switchBg:"خلفية",language:"اللغة",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات",moreOverflow:"المزيد من الأدوات"},settings:{ortho:"تبديل الوضع المتعامد",polar:"زوايا التتبع القطبي",polarAngles:"زوايا التتبع القطبي"},drawStyle:{color:"اللون",fontSize:"ارتفاع النص",pickerTitle:"تحديد اللون",close:"إغلاق",ok:"موافق",cancel:"إلغاء",index:"فهرس اللون: ",rgb:"RGB: ",input:"اللون",inputPlaceholder:"1-255 أو #RRGGBB"},shortCutToolbar:{more:"المزيد",undo:"تراجع",redo:"إعادة",erase:"حذف",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات"},textHeight:{title:"ارتفاع النص",close:"إغلاق",ok:"موافق",cancel:"إلغاء",adaptive:"ملاءمة الشاشة",custom:"ارتفاع نص مخصص",customPlaceholder:"ارتفاع العالم",fromScreen:"من حجم الشاشة",fromScreenHint:"أدخل حجم النص المطلوب على الشاشة عند التكبير الحالي. يُحوَّل إلى ارتفاع ثابت في إحداثيات الرسم ويبقى كما هو عند تغيير التكبير لاحقًا.",screenPxPlaceholder:"حجم الخط",screenUnit:"px",convert:"تحويل"},entityPick:{cancel:"إلغاء التحديد"},layers:{title:"الطبقات",close:"إغلاق الطبقات",showAll:"إظهار الكل",hideAll:"إخفاء الكل",zoomTo:"تكبير إلى {name}"},review:{title:"مراجعة",close:"إغلاق المراجعة",searchPlaceholder:"البحث في الملاحظات",empty:"لا توجد ملاحظات بعد",type:"النوع",status:"الحالة",author:"المؤلف",summary:"الملخص",details:"التفاصيل",closeDetails:"إغلاق التفاصيل",label:"التسمية",comment:"التعليق",zoomTo:"تكبير إلى",delete:"حذف",clear:"مسح الكل",statusValues:{open:"مفتوح",question:"سؤال",answered:"تمت الإجابة",closed:"مغلق"}},measurePanel:{title:"القياسات",close:"إغلاق القياسات",filterGroup:"التصفية حسب النوع",filterDistance:"مسافة",filterArc:"قوس",filterRadius:"نصف القطر",filterAngle:"زاوية",filterArea:"مساحة",empty:"لا توجد قياسات حتى الآن",type:"النوع",value:"القيمة",delete:"حذف",clear:"مسح الكل"},session:{length:"الطول",angle:"الزاوية",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"تأكيد",cancel:"إلغاء",help:"مساعدة",back:"رجوع",collapse:"طي",expand:"توسيع",undo:"تراجع"},touchPointTutorial:{title:"كيف أختار النقاط بدقة؟",description:"اضغط مطولاً على الشاشة لمدة نصف ثانية تقريباً. يظهر صليب فوق إصبعك ويتبعه أثناء الحركة ويلتقط إلى الهندسة لاختيار أدق.",snoozeToday:"لا تذكرني اليوم",hideForever:"لا تذكرني مرة أخرى",ok:"فهمت"},status:{ready:"جاهز",zoomWindowHint:"انقر على ركنين لتحديد نافذة التكبير.",measureDistanceHint:"انقر على نقطتين لقياس المسافة (التقاط الكائنات مفعّل).",measureContinuousHint:"انقر على نقاط متتالية لقياس كل قطعة؛ انقر ✓ للإنهاء. اضغط مطولاً للالتقاط الدقيق.",measureAngleHint:"انقر على رأس الزاوية، ثم نقطة على كل ضلع (التقاط الكائنات مفعّل).",measureArcHint:"انقر على دائرة أو قوس للقياس عليه، أو انقر على نقطة البداية ثم نقطة على القوس ثم نقطة النهاية (التقاط الكائنات مفعّل). استخدم Ctrl (⌘ على Mac) للتبديل بين القوس الأكبر والأصغر.",measureRadiusHint:"انقر على دائرة أو قوس لقياس نصف القطر (التقاط الكائنات مفعّل).",measureAreaHint:"انقر على رؤوس المضلع؛ انقر ✓ للإنهاء بعد ثلاث نقاط على الأقل.",measureCoordinateHint:"انقر على نقطة لقراءة إحداثيات X/Y الخاصة بها (التقاط الكائنات مفعّل).",measureExported:"تم تصدير {count} من القياسات.",measureImported:"تم استيراد {count} من القياسات.",measureImportFailed:"فشل استيراد القياسات: {error}",markupCloudHint:"انقر على ركنين لرسم سحابة مراجعة.",markupCalloutHint:"انقر على طرف خط الإشارة، أو على إطار سحابة/مستطيل/دائرة بدون تعليق توضيحي، ثم موضع النص.",markupTextHint:"انقر على نقطة لوضع النص.",markupRectHint:"انقر على ركنين لرسم مستطيل.",markupCircleHint:"انقر على المركز، ثم على نقطة على المحيط.",markupArrowHint:"انقر على نقطة البداية، ثم على رأس السهم.",markupStampHint:"انقر لوضع ختم (يتنقل بين معتمد / مرفوض / …).",markupArrowEndHint:"انقر على رأس السهم.",markupRectCornerHint:"انقر على الركن المقابل.",markupCloudCornerHint:"انقر على الركن المقابل.",markupCalloutAnchorHint:"انقر على موضع فقاعة النص.",markupCircleRadiusHint:"انقر على نقطة على المحيط.",markupTextPrompt:"أدخل نص الملاحظة",markupTextEditHint:"اكتب النص على مساحة الرسم. اضغط Enter للإنهاء أو Esc للإلغاء.",markupShapeCalloutHint:"انقر لوضع مربع النص (يتصل خط الإشارة بالشكل). اضغط Esc لإلغاء التعليق التوضيحي.",markupDefaultLabel:"ملاحظة",markupSelected:"الملاحظة المحددة: {type}",markupSelectedCount:"الملاحظات المحددة: {count}",markupCount:"عدد الملاحظات: {count}",markupExported:"تم تصدير {count} من الملاحظات.",markupImported:"تم استيراد {count} من الملاحظات.",markupImportFailed:"فشل استيراد الملاحظات: {error}",distance:"المسافة: {value}",coordinates:"X: {x} | Y: {y}",angle:"الزاوية: {value}",arcLength:"طول القوس: {length} | نصف القطر: {radius} | الزاوية: {angle} | الوتر: {chord}",radius:"نصف القطر: {value}",continuousTotal:"إجمالي الطول: {value}",area:"المساحة: {value}",lengthTotal:"إجمالي الطول: {value}",areaTotal:"إجمالي المساحة: {value}",zoomLayer:"تكبير: {name}",loadFailed:"فشل تحميل الرسم: {error}",noLayout:"لا توجد بيانات تخطيط في اللقطة.",loadingChunks:"جاري تحميل الهندسة… {loaded}/{total}",loadingOsnap:"جاري تحميل الالتقاط… {loaded}/{total}",buildingOsnap:"جاري بناء فهرس الالتقاط…"},package:{title:"فتح حزمة الرسم",hint:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. اختر مجلد الحزمة المحلي أو أدخل عنوان URL للقائمة.",hintUrlOnly:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. أدخل عنوان URL للقائمة لفتح الحزمة.",chooseFolder:"اختيار مجلد محلي",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"فتح الرابط",urlRequired:"يرجى إدخال عنوان URL للقائمة.",manifestNotFound:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة.",invalidManifest:"قائمة الحزمة غير صالحة أو تستخدم إصداراً غير مدعوم: {error}",folderMissingManifest:"يجب أن يحتوي المجلد المحدد على drawing.acex.json.",folderUnsupported:"لا يمكن لهذا المتصفح فتح مجلد حزمة محلي. الصق عنوان URL للقائمة بدلاً من ذلك.",loadFailed:"تعذر فتح الحزمة: {error}"},access:{title:"رسم محمي",passwordPrompt:"أدخل كلمة المرور لفتح هذا الملف.",passwordPlaceholder:"كلمة المرور",unlock:"فتح",passwordRequired:"يرجى إدخال كلمة المرور.",wrongPassword:"كلمة المرور غير صحيحة. حاول مرة أخرى.",expired:"انتهت صلاحية هذا الملف ولا يمكن فتحه.",expiredTitle:"انتهت صلاحية الملف",expiredDetail:"انتهت صلاحية هذا الملف في {time} ولا يمكن فتحه.",expiresAt:"ينتهي في: {time}",badgeExpires:"ينتهي في {time}",badgeCountdown:"متبقي {time}",tooManyAttempts:"عدد محاولات إدخال كلمة المرور كبير جدًا. قم بتحديث الصفحة للمحاولة مرة أخرى."}}};function Bl(e){return he.includes(e)}function Ae(e){if(e==null||e==="")return null;const t=e.toLowerCase().replace("_","-");for(const n of he)if(t===n||t.startsWith(`${n}-`))return n;return null}function Ja(){if(typeof navigator>"u")return"en";const e=[...navigator.languages??[],navigator.language].filter(Boolean);for(const t of e){const n=Ae(t);if(n)return n}return"en"}function qa(){if(typeof localStorage<"u")try{const e=localStorage.getItem(Kn),t=Ae(e);if(t)return t}catch{}return Ja()}function Qa(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r=="string")return;r=r[a]}return typeof r=="string"?r:void 0}function eo(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const a=t[r];return a!=null?String(a):`{${r}}`}):e}class Tl{constructor(t){this._onChange=null,this._locale=t??qa()}get locale(){return this._locale}get localeBadge(){return jn[this._locale]}setOnChange(t){this._onChange=t}t(t,n){const r=Qa(Zn[this._locale],t)??Qa(Zn.en,t)??t;return eo(r,n)}toggleLocale(){const t=he.indexOf(this._locale),n=he[(t+1)%he.length];return this.setLocale(n),n}setLocale(t){var n;if(this._locale!==t){this._locale=t,typeof document<"u"&&(document.documentElement.lang=t);try{typeof localStorage<"u"&&localStorage.setItem(Kn,t)}catch{}this.applyToDocument(),(n=this._onChange)==null||n.call(this)}}applyToDocument(t){if(typeof document>"u")return;const n=t??document;document.documentElement.lang=this._locale,n.querySelectorAll("[data-i18n-text]").forEach(a=>{const o=a.dataset.i18nKey;o&&(a.textContent=this.t(o))}),n.querySelectorAll("[data-i18n-attr]").forEach(a=>{var s;const o=a.dataset.i18nKey,i=((s=a.dataset.i18nAttr)==null?void 0:s.split(/\s+/))??[];if(!o||i.length===0)return;const l=this.t(o);for(const c of i)a.setAttribute(c,l)});const r=document.getElementById("mlcad-lang-badge");r&&(r.textContent=this.localeBadge)}}const Wn=1128612673,to=1e5;function Ge(e){if(e.version!==R)throw new Error(`Unsupported chunk version: ${e.version}`);const t=new st;t.writeU32(Wn),t.writeU8(R),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeString(e.layoutBtrId),t.writeU32(e.lineBatches.length);for(const n of e.lineBatches)bn(t,n);t.writeU32(e.meshBatches.length);for(const n of e.meshBatches)Ln(t,n);return t.toUint8Array()}function Jn(e){const t=new lt(e);if(t.readU32()!==Wn)throw new Error("Invalid chunk magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==R)throw new Error(`Unsupported chunk version: ${r}`);const a=t.readString(),o=t.readU32();if(o>to)throw new Error("Chunk line batch count exceeds limit");const i=[];for(let c=0;c<o;c++)i.push(kn(t));const l=t.readU32();if(l>to)throw new Error("Chunk mesh batch count exceeds limit");const s=[];for(let c=0;c<l;c++)s.push(An(t));return{version:R,layoutBtrId:a,lineBatches:i,meshBatches:s}}function no(e){const t=Ge(e),n=we(t).bytes;return{uncompressed:t,compressed:n}}async function zl(e){const t=Ge(e),n=(await hn(t)).bytes;return{uncompressed:t,compressed:n}}function ro(e){return Jn(ut(e))}function qn(e){return gn(e)?ro(e):Jn(e)}const Qn=1,ao=2*1024*1024,$e=2*1024*1024,Fl=512*1024,oo=8*1024*1024,er=12*1024*1024,io=2*1024*1024,Nt=6;function Xt(e,t,n){const r=e.length,a=r>0?Math.max(1,Math.min(Number.isFinite(t)?Math.floor(t):1,r)):0,o=new Array(r);let i=0,l=0;const s=c=>{const d=Promise.resolve().then(()=>n(e[c],c));d.catch(()=>{}),o[c]=d,i+=1};for(;i<a;)s(i);return{async next(){if(l>=r)return null;const c=l;l+=1;const d=await o[c];return i<r&&s(i),{item:e[c],index:c,bytes:d}}}}const Ol=/^(?:\.[/\\])?[A-Za-z0-9._-]+(?:[/\\][A-Za-z0-9._-]+)*$/;function so(e){const t=e.trim();return!t||t!==e||t.startsWith("/")||t.startsWith("\\")||t.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.includes("..")||t.includes("\\")?!1:Ol.test(t)}function Vt(e,t){if(!so(e))throw new Error(`Invalid ${t}: must be a relative package path`)}function je(e){if(!e||typeof e!="object")throw new Error("Invalid package manifest");const t=e;if(t.format!=="acex-package")throw new Error("Unsupported package format");if(t.packageVersion!==Qn)throw new Error(`Unsupported package version: ${String(t.packageVersion)}`);if(t.snapshotVersion!==R)throw new Error(`Unsupported snapshot version: ${String(t.snapshotVersion)}`);if(!Array.isArray(t.layouts)||!Array.isArray(t.chunks))throw new Error("Invalid package manifest structure");for(const n of t.chunks){if(!n||typeof n!="object")throw new Error("Invalid package chunk entry");Vt(n.href,"chunk href")}for(const n of t.osnapChunks??[]){if(!n||typeof n!="object")throw new Error("Invalid package osnap chunk entry");Vt(n.href,"osnap chunk href")}return t}function lo(e){return{version:R,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:e.layouts.map(t=>({btrId:t.btrId,name:t.name,isModelSpace:t.isModelSpace,lineBatches:[],meshBatches:[],viewports:t.viewports,...t.savedView?{savedView:t.savedView}:{},...t.fitExtents?{fitExtents:t.fitExtents}:{}}))}}function Yt(e,t){Vt(t,"chunk href");let n,r;try{n=new URL(t,e),r=new URL(e)}catch{throw new Error("Invalid chunk or manifest URL")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("Chunk URL must share the manifest origin");const a=r.pathname.replace(/[^/]*$/,""),o=n.pathname;if(!o.startsWith(a))throw new Error("Chunk URL escapes package directory");if(o.split("/").includes(".."))throw new Error("Chunk URL escapes package directory");return n.toString()}function co(e,t){Vt(e,"manifestUrl");let n,r;try{n=new URL(e,t),r=new URL(t)}catch{throw new Error("Invalid manifestUrl")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("manifestUrl must be same-origin");return n.toString()}async function tr(e,t,n){const r=await e(t);if(!r.ok)throw new Error(`Failed to load ${n} (${r.status})`);const a=r.headers.get("content-length");if(a!=null){const i=Number(a);if(Number.isFinite(i)&&i>dt)throw new Error(`${n} exceeds size limit`)}const o=await r.arrayBuffer();if(o.byteLength>dt)throw new Error(`${n} exceeds size limit`);return new Uint8Array(o)}async function Rl(e){var f;const t=e.fetchImpl??Ze,n=e.loadOsnap!==!1,r=e.fetchConcurrency??Nt,a=await t(e.manifestUrl);if(!a.ok)throw new Error(`Failed to load package manifest (${a.status})`);const o=je(await a.json()),i=lo(o),l=new Map(i.layouts.map(p=>[p.btrId,p])),s=e.layoutFilter==null?null:e.layoutFilter instanceof Set?e.layoutFilter:new Set(e.layoutFilter),c=o.chunks.filter(p=>s==null||s.has(p.layoutBtrId)),d=Xt(c,r,p=>tr(t,Yt(e.manifestUrl,p.href),"geometry chunk"));let u=0;for(;;){const p=await d.next();if(!p)break;const h=p.item,g=l.get(h.layoutBtrId);if(!g)throw new Error("Unknown layout for package chunk");const y=qn(p.bytes);if(y.layoutBtrId!==h.layoutBtrId)throw new Error("Chunk layout mismatch");mo(g,y.lineBatches,y.meshBatches),u+=1,await((f=e.onChunk)==null?void 0:f.call(e,g,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:h.layoutBtrId,chunkId:h.id}))}if(n)for(const p of o.layouts){if(s!=null&&!s.has(p.btrId))continue;const h=l.get(p.btrId);h&&await uo(o,e.manifestUrl,p.btrId,h,{fetchImpl:t})}return i}async function Dl(e,t,n,r,a={}){var f;const o=a.fetchImpl??Ze,i=a.fetchConcurrency??Nt,l=e.layouts.find(p=>p.btrId===n);if(!l)throw new Error(`Layout not found: ${n}`);const s=new Map(e.chunks.map(p=>[p.id,p])),c=l.chunkIds.map(p=>s.get(p)).filter(p=>p!=null),d=Xt(c,i,p=>tr(o,Yt(t,p.href),"geometry chunk"));let u=0;for(;;){const p=await d.next();if(!p)break;const h=p.item,g=qn(p.bytes);mo(r,g.lineBatches,g.meshBatches),u+=1,await((f=a.onChunk)==null?void 0:f.call(a,r,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:n,chunkId:h.id}))}}async function uo(e,t,n,r,a={}){var v;if(r.osnap)return;const o=e.layouts.find(x=>x.btrId===n);if(!o)return;const i=o.osnapChunkIds;if(!i||i.length===0)return;const l=new Map((e.osnapChunks??[]).map(x=>[x.id,x])),s=i.map(x=>l.get(x)).filter(x=>x!=null);if(s.length===0)return;const c=a.fetchImpl??Ze,d=a.fetchConcurrency??Nt,u=a.yieldFn??(()=>new Promise(x=>{setTimeout(x,0)})),f=s.reduce((x,b)=>x+b.primitiveCount,0),p=f>0?new Array(f):[];let h=0;const g=Xt(s,d,x=>tr(c,Yt(t,x.href),"osnap chunk"));let y=0;for(;;){const x=await g.next();if(!x)break;const b=x.item,E=ta(x.bytes).primitives;if(f>0)for(let H=0;H<E.length;H++)p[h++]=E[H];else for(const H of E)p.push(H);y+=1,await((v=a.onChunk)==null?void 0:v.call(a,{loadedChunks:y,totalChunks:s.length,layoutBtrId:n,chunkId:b.id})),await u()}f>0&&h!==f&&(p.length=h),r.osnap={primitives:p}}function mo(e,t,n){e.lineBatches.push(...t),e.meshBatches.push(...n)}const ne="drawing.acex.json",nr=`./${ne}`,po=["manifest","acex"],Ke="https://acex-package.invalid/",Ze=(e,t)=>globalThis.fetch(e,t);function Ul(e){return e.directoryPicker||e.webkitDirectory}function Nl(e){const t=(e==null?void 0:e.hasDirectoryPicker)??typeof globalThis.showDirectoryPicker=="function",n=(e==null?void 0:e.isSecureContext)??(typeof globalThis.isSecureContext=="boolean"?globalThis.isSecureContext:!0);let r=e==null?void 0:e.supportsWebkitDirectoryAttribute;if(r==null&&(r=!1,typeof document<"u")){const a=document.createElement("input");a.type="file",r="webkitdirectory"in a||"directory"in a}return{directoryPicker:t&&n,webkitDirectory:r}}function fo(e){var r;const t=e.startsWith("?")?e.slice(1):e;if(!t)return null;let n;try{n=new URLSearchParams(t)}catch{return null}for(const a of po){const o=(r=n.get(a))==null?void 0:r.trim();if(o)return o}return null}function Xl(e){var r;const t=fo(e.search??"");if(t)return{href:t,fromQuery:!0};const n=(r=e.configManifestUrl)==null?void 0:r.trim();return n?{href:n,fromQuery:!1}:{href:nr,fromQuery:!1}}function ho(e){return/^https?:\/\//i.test(e.trim())}function Vl(e,t){const n=e.trim();if(!n)throw new Error("Missing manifest URL");if(ho(n))try{return new URL(n).toString()}catch{throw new Error("Invalid manifest URL")}return co(n,t)}async function Yl(e,t=Ze){let n;try{n=await t(e)}catch(a){return{ok:!1,reason:"network",error:a instanceof Error?a:new Error(String(a))}}if(n.status===404||n.status===410)return{ok:!1,reason:"not-found",error:new Error(`Failed to load package manifest (${n.status})`)};if(!n.ok)return{ok:!1,reason:"network",error:new Error(`Failed to load package manifest (${n.status})`)};let r;try{r=await n.json()}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error("Invalid package manifest JSON")}}try{return{ok:!0,manifest:je(r)}}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error(String(a))}}}function go(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");if(t){const r=t.replace(/\\/g,"/").replace(/\/+$/,"");n===r?n="":n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n.replace(/^\.\//,"")}function yo(e){const t=[...e].map(o=>o.replace(/\\/g,"/").replace(/^\/+/,"")).filter(Boolean);if(t.length===0)return null;const n=t[0].split("/")[0];return!n||n===ne||!t.every(o=>o.split("/")[0]===n)?null:t.some(o=>o.includes("/"))?n:null}function Gl(e){const t=[...e],n=yo(t.map(a=>a.relativePath)),r=new Map;for(const a of t){const o=go(a.relativePath,n);!o||o.endsWith("/")||r.set(o,a.bytes)}return r}function $l(e,t){const n=(t==null?void 0:t.manifestFileName)??ne;if(!e.has(n))throw new Error(`Missing ${n} in selected folder`);const r=new URL(n,Ke).toString(),a=new URL(Ke).origin;return{manifestUrl:r,fetchImpl:async i=>{const l=new URL(String(i));if(l.origin!==a)return new Response(null,{status:404});const s=decodeURIComponent(l.pathname.replace(/^\/+/,"")),c=e.get(s);if(!c)return new Response(null,{status:404});if(s.endsWith(".json")){const u=new TextDecoder().decode(c);return new Response(u,{status:200,headers:{"Content-Type":"application/json"}})}const d=new Uint8Array(c.byteLength);return d.set(c),new Response(d,{status:200})}}}function jl(e){return e.has(ne)?ne:null}function rr(...e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${e.map(n=>`<path fill="currentColor" d="${n}"/>`).join("")}</svg>`}const Kl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.4379 15.2979h.002l4.86-4.86-9.722-4.86 4.86 9.72Zm7.562-5.298-3.434 3.434 3.2 3.2-1.132 1.132-3.2-3.2-3.434 3.434-7.6-15.6 15.6 7.6Z"/></svg>',Zl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.08 12.8537l.002-.002V5.5897c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.6381-.414-.6381 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.4437c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.2317c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388-.26-.446-.518-.892-.776-1.338-.338-.482-1.1-.15-.794.38.326.566.652 1.132.978 1.698.006.012.014.026.02.04.552.946 1.106 1.89 1.658 2.834.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.7921-.124 2.5601-.612.3-.19.572-.416.816-.68.326-.368.57-.776.734-1.204.176-.482.258-.97.258-1.494Zm-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894-.216.564-.53 1.114-.964 1.576-.318.34-.666.632-1.046.884-.978.612-2.1461.862-3.2601.774-1.128-.102-2.228-.564-3.098-1.352-.326-.292-.612-.646-.87-1.034-.558-.96-1.114-1.92-1.672-2.88l-.012-.028c-.326-.568-.652-1.138-.978-1.706-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096.04.074.082.146.122.218V4.2337c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.9721-.51 2.2221.102 2.2221 1.284v.06c.022-.014.046-.026.068-.04Z"/></svg>',xo='<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"/>',Wl=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${xo}</svg>`,wo='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.0833 14.8083c1.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-.6917C.8417 12.3667.9417 7.275 4.1083 4.1083 7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Zm-3.55-2.6083V7.2083H7.2083v5.5833h5.5833ZM5.875 5.875h8.25v8.25H5.875V5.875Z"/></svg>',Jl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65l-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.48l-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>',ql='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="2" y="2" width="8.2" height="5" rx="1.2" fill="currentColor"/><rect x="2" y="8.5" width="8.2" height="9.5" rx="1.2" fill="currentColor"/><rect x="11.7" y="2" width="6.3" height="10" rx="1.2" fill="currentColor"/><rect x="11.7" y="13.5" width="6.3" height="4.5" rx="1.2" fill="currentColor"/></svg>',Ql='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M1.5 7h17v6h-17ZM4.25 7h1v2.5h-1ZM7.5 7h.75v1.5H7.5ZM10.25 7h1v2.5h-1ZM13.5 7h.75v1.5H13.5ZM16.25 7h1v2.5h-1Z"/></svg>',ec='<polygon fill="currentColor" points="17 15 17 17 16 17 16 15 14 15 14 18 13 18 13 15 11 15 11 17 10 17 10 15 8 15 8 18 7 18 7 15 5 15 5 17 4 17 4 15 2 15 2 19 18 19 18 15 17 15"/>',me="var(--el-color-primary, var(--ml-ui-accent, #409eff))";function ge(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${e}${ec}</svg>`}const vo='<rect fill="currentColor" x="2" y="5" width="1" height="8"/><rect fill="currentColor" x="17" y="5" width="1" height="8"/><polygon fill="currentColor" points="3 8.5 7 11 5.67 8.5 7 6 3 8.5"/><polygon fill="currentColor" points="17 8.5 13 11 14.33 8.5 13 6 17 8.5"/><rect fill="currentColor" x="5" y="8" width="10" height="1"/>',tc=ge(vo),nc=ge(`${vo}<path fill="none" stroke="currentColor" d="M8.5 7V3M8.5 5a1.5 1.5 0 0 1 3 0v2"/>`),rc=ge('<polygon fill="currentColor" points="5.74 3.63 7 6 4.15 4.22 3.2 3.62 3 3.5 7 1 6.17 2.55 5.67 3.5 5.74 3.63"/><polygon fill="currentColor" points="16 9 13.5 13 12.66 11.65 11.92 10.47 11 9 12 9.53 12.98 10.05 13.5 10.33 16 9"/><path fill="currentColor" d="M2,6.08v1a5.65,5.65,0,0,1,1,.26v-1A6.59,6.59,0,0,0,2,6.08Z"/><rect fill="currentColor" x="2" y="1" width="1" height="13"/><rect fill="currentColor" x="3" y="13" width="15" height="1"/><path fill="currentColor" d="M14,9.5c0,.18,0,.37,0,.55v0a6.82,6.82,0,0,1-.32,1.57l-.74-1.18L13,10c0-.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,2.5,7,7,0,0,1,14,9.5Z"/>'),ac=ge('<polygon fill="currentColor" points="2 4 18 9 18 13 2 13"/>'),oc=ge('<rect fill="currentColor" x="17" y="1" width="1" height="7"/><rect fill="currentColor" x="2" y="13" width="8" height="1"/><path fill="currentColor" d="M18,6l-.26,1a7.53,7.53,0,0,0-.95,0h-.08a9.46,9.46,0,0,0-8.08,5.69,6.36,6.36,0,0,0-.35.95l-1-.26a7.51,7.51,0,0,1,.34-.94A10.5,10.5,0,0,1,17,6h0A6.68,6.68,0,0,1,18,6Z"/><path fill="currentColor" d="M16.46,3.16l0,0L13,1l1.18,2.23a11.56,11.56,0,0,0-9.09,6.89l-.54-.29L3,9l2.5,4,.12-.2.6-1L8,9l-1.53.81a10.47,10.47,0,0,1,7.39-5.42L13.53,5,13,6l1.47-.92,1.18-.74.19-.12L16.25,4,17,3.5Z"/>'),ic=ge('<polygon fill="currentColor" points="5.51 6.63 6.71 11.09 7.4 8.51 9.97 7.82 5.51 6.63"/><path fill="none" stroke="currentColor" d="M10.46 11.58 6.93 8.04"/><path fill="currentColor" d="M3.14 11.9a6.86 6.86 0 0 1 13.71 0H18a8 8 0 0 0-16 0Z"/>'),sc=ge('<text fill="currentColor" x="12.26" y="6" font-size="6.09" font-family="Arial,Helvetica,sans-serif">X</text><text fill="currentColor" x="12.35" y="13" font-size="6.09" font-family="Arial,Helvetica,sans-serif">Y</text><path fill="currentColor" d="M6,10v3H3V10H6M7,9H2v5H7V9Z"/><path fill="currentColor" d="M17.5,7H10.56a.47.47,0,0,0-.35.15L6.15,11.21a.5.5,0,1,0,.7.7L10.76,8H17.5a.5.5,0,0,0,0-1Z"/>'),bo='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true"><path d="M 459.5 0 L 475.5 0 L 476.5 1 L 479.5 1 L 485.5 3 Q 487.8 6.2 492.5 7 L 501 14.5 L 505 19.5 L 511 32.5 Q 510.2 35.8 512 36.5 L 512 52.5 L 511 53.5 L 511 56.5 L 509 62.5 L 506 68.5 L 493 89.5 L 483 108.5 L 478 115.5 L 472 127.5 L 467 134.5 L 457 153.5 L 452 160.5 L 442 179.5 L 437 186.5 L 431 198.5 L 440 213.5 L 440 215.5 L 443 220.5 L 447 232.5 L 448 240.5 L 449 241.5 L 449 245.5 L 450 246.5 L 450 254.5 L 451 255.5 L 451 274.5 L 450 275.5 L 450 283.5 L 449 284.5 L 449 289.5 L 448 290.5 L 448 294.5 L 447 295.5 L 446 302.5 L 442 314.5 L 438 322.5 L 438 324.5 L 428 345.5 L 428 347.5 L 425 352.5 L 422 361.5 L 418 368.5 L 418 370.5 L 415 375.5 L 412 384.5 L 408 391.5 L 408 393.5 L 405 398.5 L 402 407.5 L 398 414.5 L 395 423.5 L 391 430.5 L 391 432.5 L 381 453.5 L 381 455.5 L 378 460.5 L 375 469.5 L 371 476.5 L 368 485.5 L 361.5 497 L 353.5 501 L 348.5 501 L 347.5 500 L 344.5 500 L 329.5 495 L 326.5 493 L 321.5 492 L 318.5 490 L 303.5 485 L 289.5 478 L 287.5 478 L 282 473.5 L 279 467.5 L 279 459.5 L 280 458.5 L 280 455.5 L 281 454.5 L 281 451.5 L 282 450.5 L 283 442.5 L 284 441.5 L 286 431.5 L 285.5 431 L 281.5 435 L 259.5 455 L 255.5 457 L 246.5 457 L 223.5 444 L 189.5 421 L 155.5 394 L 133 373.5 L 130 367.5 L 130 359.5 L 134 352.5 L 223 233.5 L 242 206.5 L 254.5 192 L 271.5 177 L 285.5 168 L 299.5 161 L 314.5 156 L 317.5 156 L 318.5 155 L 330.5 154 L 331.5 153 L 352.5 153 L 354 151.5 L 356 146.5 L 372 120.5 L 374 115.5 L 387 94.5 L 397 75.5 L 402 68.5 L 408 56.5 L 413 49.5 L 423 30.5 L 431 17.5 L 439.5 9 L 449.5 3 L 455.5 1 L 458.5 1 L 459.5 0 Z M 466 30 L 459 33 L 454 39 L 448 51 L 443 58 L 433 77 L 428 84 L 414 110 L 409 117 L 407 122 L 405 124 L 403 129 L 401 131 L 399 136 L 384 161 L 386 162 L 388 162 L 396 166 L 409 175 L 422 153 L 424 148 L 429 141 L 431 136 L 433 134 L 435 129 L 437 127 L 439 122 L 444 115 L 454 96 L 459 89 L 469 70 L 474 63 L 482 47 L 482 43 L 480 38 L 475 32 L 469 30 L 466 30 Z M 333 183 L 332 184 L 328 184 L 327 185 L 324 185 L 323 186 L 320 186 L 314 188 L 300 195 L 286 205 L 271 220 L 267 225 L 266 228 L 410 310 L 412 307 L 412 305 L 416 296 L 418 285 L 419 284 L 419 279 L 420 278 L 420 252 L 419 251 L 419 246 L 417 241 L 417 238 L 411 224 L 402 211 L 389 198 L 371 188 L 362 185 L 352 184 L 351 183 L 333 183 Z M 248 252 L 195 322 L 193 326 L 172 353 L 167 361 L 194 384 L 228 409 L 249 422 L 256 417 L 303 372 L 310 368 L 318 368 L 322 370 L 328 378 Q 327 381 329 382 L 329 386 L 326 395 L 326 399 L 323 408 L 323 411 L 322 412 L 322 416 L 319 425 L 319 428 L 318 429 L 318 432 L 317 433 L 317 437 L 314 446 L 314 449 L 313 450 L 313 453 L 312 454 L 316 456 L 318 456 L 331 462 L 343 466 L 351 448 L 351 446 L 354 441 L 354 439 L 357 434 L 357 432 L 364 418 L 364 416 L 367 411 L 367 409 L 370 404 L 370 402 L 377 388 L 377 386 L 380 381 L 380 379 L 383 374 L 383 372 L 387 365 L 390 356 L 393 351 L 393 349 L 396 344 L 397 339 L 375 326 L 373 324 L 368 322 L 366 320 L 361 318 L 354 313 L 349 311 L 347 309 L 342 307 L 340 305 L 335 303 L 321 294 L 316 292 L 314 290 L 309 288 L 307 286 L 302 284 L 295 279 L 276 269 L 248 252 Z "/><path d="M 170.5 100 L 179.5 100 Q 185 102 188 106.5 L 190 110.5 L 190 134.5 L 184.5 142 L 177.5 145 L 171.5 145 L 166.5 143 L 162 138.5 L 159 129.5 L 159 115.5 L 160 114.5 Q 159.2 109.7 161 107.5 L 166.5 102 L 170.5 100 Z "/><path d="M 131.5 140 L 151.5 140 L 156.5 142 L 162 147.5 L 164 151.5 L 164 159.5 L 163 162.5 L 158.5 168 L 152.5 171 L 130.5 171 L 124.5 168 L 122 165.5 L 119 159.5 L 119 151.5 Q 121.3 145.3 126.5 142 L 131.5 140 Z "/><path d="M 197.5 140 L 218.5 140 L 223.5 142 L 228 146.5 L 231 152.5 L 231 158.5 L 229 163.5 L 223.5 169 L 218.5 171 L 197.5 171 L 192.5 169 L 188 164.5 L 186 160.5 L 185 153.5 L 188 146.5 L 191.5 143 L 197.5 140 Z "/><path d="M 171.5 166 L 177.5 166 L 180.5 167 L 187 171.5 L 190 176.5 L 190 200.5 Q 188 206 183.5 209 L 179.5 211 L 173.5 212 L 167.5 210 L 161 203.5 Q 159.2 201.3 160 196.5 L 159 195.5 L 159 181.5 L 162 172.5 L 165.5 169 L 171.5 166 Z "/><path d="M 50.5 223 L 60.5 223 L 68 228.5 L 71 234.5 L 71 256.5 Q 69.1 262.6 64.5 266 L 59.5 268 L 51.5 268 Q 45.3 265.7 42 260.5 L 40 255.5 L 40 235.5 L 42 230.5 L 48.5 224 L 50.5 223 Z "/><path d="M 13.5 263 L 30.5 263 Q 31.5 265 35.5 264 L 43 270.5 L 45 274.5 L 45 282.5 Q 43.1 288.6 38.5 292 L 33.5 294 L 10.5 294 Q 5 292 2 287.5 L 0 283.5 L 0 274.5 Q 2.3 268.3 7.5 265 L 13.5 263 Z "/><path d="M 80.5 263 L 97.5 263 L 103.5 265 L 108 268.5 L 111 273.5 L 112 279.5 L 109 287.5 L 104.5 292 L 100.5 294 L 77.5 294 Q 71.3 291.7 68 286.5 L 66 281.5 L 66 276.5 L 69 269.5 L 72.5 266 L 80.5 263 Z "/><path d="M 54.5 289 L 61.5 290 L 69 296.5 L 71 301.5 L 71 322.5 L 69 327.5 L 63.5 333 L 58.5 335 L 53.5 335 L 46.5 332 L 43 328.5 L 40 321.5 L 40 302.5 Q 41.8 301.8 41 298.5 L 46.5 292 L 54.5 289 Z "/><path d="M 98.5 400 L 107.5 402 L 113 407.5 L 115 411.5 L 115 434.5 Q 112.7 440.7 107.5 444 L 101.5 446 L 96.5 446 L 90.5 443 L 87 439.5 L 84 430.5 L 84 415.5 L 85 414.5 Q 84.3 410.3 86 408.5 L 92.5 402 L 98.5 400 Z "/><path d="M 55.5 441 L 77.5 441 L 80.5 442 L 86 446.5 L 89 451.5 L 89 460.5 Q 86.7 466.7 81.5 470 L 76.5 472 L 56.5 472 L 51.5 470 L 46 464.5 L 44 460.5 L 44 452.5 L 45 449.5 L 49.5 444 L 55.5 441 Z "/><path d="M 121.5 441 L 144.5 441 Q 150.7 443.3 154 448.5 L 156 453.5 L 156 458.5 L 154 464.5 L 148.5 470 L 146.5 470 L 143.5 472 L 122.5 472 L 116.5 469 L 113 465.5 L 111 461.5 L 110 455.5 Q 112 454.5 111 450.5 L 117.5 443 L 121.5 441 Z "/><path d="M 96.5 467 L 103.5 467 L 106.5 468 L 113 473.5 L 115 478.5 L 115 501.5 Q 113 507 108.5 510 L 104.5 512 L 95.5 512 Q 89.3 509.7 86 504.5 Q 84.3 502.7 85 498.5 L 84 497.5 L 84 482.5 L 87 473.5 L 91.5 469 L 96.5 467 Z "/></svg>',lc=bo,cc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" fill="currentColor"/><rect x="14" y="14" width="7" height="7" fill="none" stroke="currentColor" stroke-width="1"/><path d="M12 4a8 8 0 0 1 7.25 7.25" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M20.75 10 L17.25 10 L19 12.5 Z" fill="currentColor"/><path d="M12 20a8 8 0 0 1-8-8" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M6 14 L2.5 14 L4 11 Z" fill="currentColor"/></svg>',dc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" style="fill:none"><g fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"><path d="M12.4 3.25H5.5A2.25 2.25 0 0 0 3.25 5.5v9A2.25 2.25 0 0 0 5.5 16.75h9A2.25 2.25 0 0 0 16.75 14.5V8.6"/><g transform="rotate(45 13.2 6.7)"><rect x="11.7" y="1.55" width="3" height="7.45" rx="1.45"/><path d="M11.7 3.2h3"/><path d="M11.7 9 13.2 12.15 14.7 9"/><rect x="12.8" y="7.05" width="0.8" height="1.2" rx="0.4"/></g></g></svg>',uc='<path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="butt" stroke-linejoin="miter" d="M2.6 6.8v8.5h5.2l2.2 2.4 2.2-2.4h5.2"/>',ko='<g fill="none" stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" transform="rotate(46 14.8 9)"><rect x="13.65" y="4.7" width="2.3" height="5.6" rx="1.05"/><path d="M13.65 10.3 14.8 12.9 15.95 10.3"/></g>';function Ce(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${uc}${e}</svg>`}const mc=Ce('<path fill="currentColor" d="M6.4 12.2c-1.85 0-3.3-1.25-3.3-2.85 0-1.35.95-2.5 2.3-2.8.45-1.7 1.95-2.85 3.7-2.85 1.25 0 2.35.55 3.05 1.45.55-.7 1.45-1.15 2.5-1.15 1.85 0 3.25 1.3 3.25 2.95 0 .3-.05.55-.1.8 1.2.4 2.05 1.4 2.05 2.65 0 1.55-1.5 2.8-3.4 2.8H6.4Z"/>'),pc=Ce(`<rect fill="none" stroke="currentColor" stroke-width="1.25" x="5" y="2.8" width="8.2" height="7.2"/><rect fill="${me}" x="4.2" y="2" width="2" height="2"/><rect fill="${me}" x="12.2" y="9" width="2" height="2"/>${ko}`),fc=Ce(`<ellipse fill="none" stroke="currentColor" stroke-width="1.25" cx="9" cy="6.6" rx="4" ry="3.6"/><rect fill="${me}" x="8" y="2.1" width="2" height="2"/><rect fill="${me}" x="4" y="5.6" width="2" height="2"/>${ko}`),hc=Ce('<path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M4.4 12.6 10.2 7"/><rect fill="currentColor" x="10.2" y="1.2" width="7.8" height="5.8" rx=".35"/>'),gc=Ce('<path fill="currentColor" fill-rule="evenodd" d="M10 2.2 15.3 13.1h-2.2l-1.05-2.95H7.95L6.9 13.1H4.7L10 2.2Zm0 3.4-1.15 3.2h2.3L10 5.6Z"/>'),yc=Ce('<g transform="rotate(-40 10 7.6)" fill="currentColor"><path d="M3.5 6.75h9V5.15L16.7 7.6 12.5 10.05V8.45h-9Z"/></g>'),xc=rr("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"),Lo=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="3.5" y="3" width="13" height="14" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.25"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 6.5h13"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M6.5 9.5h7M6.5 12h7M6.5 14.5h3.2"/><g fill="none" stroke="${me}" stroke-width="1.25" stroke-linecap="round"><circle cx="14.5" cy="14.7" r="4.2"/><path d="M17.5 17.7 19.5 19.7"/></g></svg>`,wc=Lo.replace(me,"currentColor"),vc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M4.5 2h6.4L15.5 6.6V16.5A1.5 1.5 0 0 1 14 18H4.5A1.5 1.5 0 0 1 3 16.5V3.5A1.5 1.5 0 0 1 4.5 2z"/><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M10.9 2v4.6h4.6"/><path stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" d="M10 5.8v6M7.2 9.6 10 12.5l2.8-2.9"/></svg>',bc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M15.5 2H9.1L4.5 6.6V16.5A1.5 1.5 0 0 0 6 18h9.5A1.5 1.5 0 0 0 17 16.5V3.5A1.5 1.5 0 0 0 15.5 2z"/><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M9.1 2v4.6H4.5"/><path stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" d="M10 14.2V8M7.2 10.4 10 7.5l2.8 2.9"/></svg>',kc=bo,Lc=rr("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"),Ac=rr("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"),Cc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><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>',Ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><circle cx="10" cy="10" r="4" fill="currentColor"/><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2v2M10 16v2M2 10h2M16 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4"/></svg>',Hc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 3a7 7 0 1 0 0 14 9 9 0 0 1 0-14Z"/></svg>',Sc='<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>',Mc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',Ao='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 2.6 18 9.8h-2.1V17h-4.4v-4.4H8.5V17H4.1V9.8H2L10 2.6Zm0 1.8L5.3 9.8V15.8h2V11.4h5.4v4.4h2V9.8L10 4.4Z"/></svg>',Pc=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${xo}<path fill="${me}" d="M14.85 0.85 15.95 4.05 19.15 5.15 15.95 6.25 14.85 9.45 13.75 6.25 10.55 5.15 13.75 4.05Z"/><path fill="${me}" d="M17.55 8.35 18.15 10.15 19.95 10.75 18.15 11.35 17.55 13.15 16.95 11.35 15.15 10.75 16.95 10.15Z"/></svg>`,Ic='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M8.08 2.1h3.84l.32 1.52a6.4 6.4 0 0 1 1.36.78l1.48-.64 1.92 1.92-.64 1.48c.3.42.54.88.78 1.36l1.52.32v3.84l-1.52.32a6.4 6.4 0 0 1-.78 1.36l.64 1.48-1.92 1.92-1.48-.64a6.4 6.4 0 0 1-1.36.78l-.32 1.52H8.08l-.32-1.52a6.4 6.4 0 0 1-1.36-.78l-1.48.64-1.92-1.92.64-1.48a6.4 6.4 0 0 1-.78-1.36L1.34 11.92V8.08l1.52-.32c.24-.48.48-.94.78-1.36l-.64-1.48 1.92-1.92 1.48.64c.42-.3.88-.54 1.36-.78L8.08 2.1ZM10 7.2A2.8 2.8 0 1 0 10 12.8 2.8 2.8 0 0 0 10 7.2Z"/></svg>',_c='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2.5v6M7 5.5h6"/><circle cx="10" cy="14.5" r="3.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="10" cy="14.5" r="1.1" fill="currentColor"/></svg>',Bc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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>',Tc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',zc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M2.25 2.25h4.878v4.878H2.25V2.25Zm.978.978v2.924h2.924V3.228H3.228Z"/><path fill="currentColor" d="M5.175 20.773V7.128H4.204V21.75H21.75V4.204H7.128v.971H20.773v15.598H5.175Z"/></svg>',Fc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',Oc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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>',Rc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><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>',Dc=wo,Uc=sc,Nc=mc,Xc=pc,Vc=fc,Yc=Lc,Co=Ac,Ee={select:Kl,pan:Zl,zoomExtent:Wl,zoomSmart:Pc,zoomBox:Dc,measureDistance:tc,measureContinuous:nc,measureAngle:rc,measureArc:oc,measureRadius:ic,measureArea:ac,measureCoordinate:Uc,clearMeasurements:lc,layer:Jl,layout:ql,zoomWindow:wo,zoomOriginal:Ao,zoomSaved:Ao,layerOn:Bc,layerOff:Tc,language:Cc,osnap:zc,orthoMode:Fc,polarTracking:Oc,color:Rc,chevronUp:Sc,chevronDown:Mc,measure:Ql,annotation:dc,markupCloud:Nc,markupCallout:hc,markupText:gc,markupRect:Xc,markupCircle:Vc,markupArrow:yc,markupStamp:xc,markupPanel:Lo,measurementPanel:wc,markupImport:vc,markupExport:bc,markupShow:Yc,markupHide:Co,markupVisibility:Co,clearMarkups:kc,settings:Ic,simulatedMouse:_c,switchBg:cc,themeLight:Ec,themeDark:Hc};function ar(e,t,n){const r=Object.entries(n).map(([i,l])=>`${i}="${oe(l)}"`).join(" "),a=n["data-i18n-key"],o=a?`<span class="mlcad-tool-btn-label" data-i18n-key="${oe(a)}" data-i18n-text>${oe(t)}</span>`:"";return`<button type="button" class="mlcad-tool-btn" title="${oe(t)}" aria-label="${oe(t)}" ${r}><span class="mlcad-tool-btn-icon" aria-hidden="true">${e}</span>${o}</button>`}function Gc(e,t,n){const r=Object.entries(n).map(([i,l])=>`${i}="${oe(l)}"`).join(" "),a=n["data-i18n-key"],o=a?` data-i18n-key="${oe(a)}" data-i18n-text`:"";return`<button type="button" class="mlcad-dropdown-item" role="menuitem" title="${oe(t)}" ${r}><span class="mlcad-dropdown-icon" aria-hidden="true">${e}</span><span class="mlcad-dropdown-label"${o}>${oe(t)}</span></button>`}function oe(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}const Eo=[90,45,30,23,18,10,5],Ho=90,$c=Ho,jc={en:"toolbar.localeEn",zh:"toolbar.localeZh",ja:"toolbar.localeJa",ko:"toolbar.localeKo",cs:"toolbar.localeCs",tr:"toolbar.localeTr",ar:"toolbar.localeAr"},Kc={en:"English",zh:"中文",ja:"日本語",ko:"한국어",cs:"Čeština",tr:"Türkçe",ar:"العربية"};function Zc(){return`<div id="mlcad-locale-strip-wrap" hidden>
|
|
1
|
+
(function(m,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("@mlightcad/three-renderer"),require("three"),require("three/examples/jsm/lines/LineMaterial.js"),require("three/examples/jsm/lines/LineSegments2.js"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/three-renderer","three","three/examples/jsm/lines/LineMaterial.js","three/examples/jsm/lines/LineSegments2.js","@mlightcad/data-model"],P):(m=typeof globalThis<"u"?globalThis:m||self,P(m["cad-html-core"]={},m.threeRenderer,m.THREE,m.LineMaterial_js,m.LineSegments2_js,m.dataModel))})(this,(function(m,P,Bi,Ar,Ti,w){"use strict";function zi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=zi(Bi);var I=Uint8Array,G=Uint16Array,en=Int32Array,ot=new I([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]),it=new I([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]),tn=new I([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cr=function(e,t){for(var n=new G(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new en(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return{b:n,r:a}},Er=Cr(ot,2),Hr=Er.b,nn=Er.r;Hr[28]=258,nn[258]=28;for(var Sr=Cr(it,0),Fi=Sr.b,Mr=Sr.r,rn=new G(32768),M=0;M<32768;++M){var le=(M&43690)>>1|(M&21845)<<1;le=(le&52428)>>2|(le&13107)<<2,le=(le&61680)>>4|(le&3855)<<4,rn[M]=((le&65280)>>8|(le&255)<<8)>>1}for(var J=(function(e,t,n){for(var r=e.length,a=0,o=new G(t);a<r;++a)e[a]&&++o[e[a]-1];var i=new G(t);for(a=1;a<t;++a)i[a]=i[a-1]+o[a-1]<<1;var l;if(n){l=new G(1<<t);var s=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],d=t-e[a],u=i[e[a]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)l[rn[u]>>s]=c}else for(l=new G(r),a=0;a<r;++a)e[a]&&(l[a]=rn[i[e[a]-1]++]>>15-e[a]);return l}),ce=new I(288),M=0;M<144;++M)ce[M]=8;for(var M=144;M<256;++M)ce[M]=9;for(var M=256;M<280;++M)ce[M]=7;for(var M=280;M<288;++M)ce[M]=8;for(var Pe=new I(32),M=0;M<32;++M)Pe[M]=5;var Oi=J(ce,9,0),Ri=J(ce,9,1),Di=J(Pe,5,0),Ui=J(Pe,5,1),an=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},W=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},on=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},sn=function(e){return(e+7)/8|0},Ie=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new I(e.subarray(t,n))},Ni=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],O=function(e,t,n){var r=new Error(t||Ni[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,O),!n)throw r;return r},Pr=function(e,t,n,r){var a=e.length,o=r?r.length:0;if(!a||t.f&&!t.l)return n||new I(0);var i=!n,l=i||t.i!=2,s=t.i;i&&(n=new I(a*3));var c=function(rt){var at=n.length;if(rt>at){var Me=new I(Math.max(at*2,rt));Me.set(n),n=Me}},d=t.f||0,u=t.p||0,p=t.b||0,f=t.l,h=t.d,g=t.m,x=t.n,v=a*8;do{if(!f){d=W(e,u,1);var y=W(e,u+1,3);if(u+=3,y)if(y==1)f=Ri,h=Ui,g=9,x=5;else if(y==2){var H=W(e,u,31)+257,S=W(e,u+10,15)+4,A=H+W(e,u+5,31)+1;u+=14;for(var L=new I(A),D=new I(19),F=0;F<S;++F)D[tn[F]]=W(e,u+F*3,7);u+=S*3;for(var X=an(D),pe=(1<<X)-1,$=J(D,X,1),F=0;F<A;){var V=$[W(e,u,pe)];u+=V&15;var b=V>>4;if(b<16)L[F++]=b;else{var U=0,_=0;for(b==16?(_=3+W(e,u,3),u+=2,U=L[F-1]):b==17?(_=3+W(e,u,7),u+=3):b==18&&(_=11+W(e,u,127),u+=7);_--;)L[F++]=U}}var Y=L.subarray(0,H),N=L.subarray(H);g=an(Y),x=an(N),f=J(Y,g,1),h=J(N,x,1)}else O(1);else{var b=sn(u)+4,k=e[b-4]|e[b-3]<<8,E=b+k;if(E>a){s&&O(0);break}l&&c(p+k),n.set(e.subarray(b,E),p),t.b=p+=k,t.p=u=E*8,t.f=d;continue}if(u>v){s&&O(0);break}}l&&c(p+131072);for(var nt=(1<<g)-1,Z=(1<<x)-1,se=u;;se=u){var U=f[on(e,u)&nt],j=U>>4;if(u+=U&15,u>v){s&&O(0);break}if(U||O(2),j<256)n[p++]=j;else if(j==256){se=u,f=null;break}else{var K=j-254;if(j>264){var F=j-257,B=ot[F];K=W(e,u,(1<<B)-1)+Hr[F],u+=B}var re=h[on(e,u)&Z],He=re>>4;re||O(3),u+=re&15;var N=Fi[He];if(He>3){var B=it[He];N+=on(e,u)&(1<<B)-1,u+=B}if(u>v){s&&O(0);break}l&&c(p+131072);var Se=p+K;if(p<N){var Jt=o-N,Qt=Math.min(N,Se);for(Jt+p<0&&O(3);p<Qt;++p)n[p]=r[Jt+p]}for(;p<Se;++p)n[p]=n[p-N]}}t.l=f,t.p=se,t.b=p,t.f=d,f&&(d=1,t.m=g,t.d=h,t.n=x)}while(!d);return p!=n.length&&i?Ie(n,0,p):n.subarray(0,p)},ae=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},_e=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},ln=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return{t:Tr,l:0};if(a==1){var i=new I(n[0].s+1);return i[n[0].s]=1,{t:i,l:1}}n.sort(function(E,H){return E.f-H.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 p=o[0].s,r=1;r<a;++r)o[r].s>p&&(p=o[r].s);var f=new G(p+1),h=cn(n[d-1],f,0);if(h>t){var r=0,g=0,x=h-t,v=1<<x;for(o.sort(function(H,S){return f[S.s]-f[H.s]||H.f-S.f});r<a;++r){var y=o[r].s;if(f[y]>t)g+=v-(1<<h-f[y]),f[y]=t;else break}for(g>>=x;g>0;){var b=o[r].s;f[b]<t?g-=1<<t-f[b]++-1:++r}for(;r>=0&&g;--r){var k=o[r].s;f[k]==t&&(--f[k],++g)}h=t}return{t:new I(f),l:h}},cn=function(e,t,n){return e.s==-1?Math.max(cn(e.l,t,n+1),cn(e.r,t,n+1)):t[e.s]=n},Ir=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new G(++t),r=0,a=e[0],o=1,i=function(s){n[r++]=s},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=e[l]}return{c:n.subarray(0,r),n:t}},Be=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},_r=function(e,t,n){var r=n.length,a=sn(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},Br=function(e,t,n,r,a,o,i,l,s,c,d){ae(t,d++,n),++a[256];for(var u=ln(a,15),p=u.t,f=u.l,h=ln(o,15),g=h.t,x=h.l,v=Ir(p),y=v.c,b=v.n,k=Ir(g),E=k.c,H=k.n,S=new G(19),A=0;A<y.length;++A)++S[y[A]&31];for(var A=0;A<E.length;++A)++S[E[A]&31];for(var L=ln(S,7),D=L.t,F=L.l,X=19;X>4&&!D[tn[X-1]];--X);var pe=c+5<<3,$=Be(a,ce)+Be(o,Pe)+i,V=Be(a,p)+Be(o,g)+i+14+3*X+Be(S,D)+2*S[16]+3*S[17]+7*S[18];if(s>=0&&pe<=$&&pe<=V)return _r(t,d,e.subarray(s,s+c));var U,_,Y,N;if(ae(t,d,1+(V<$)),d+=2,V<$){U=J(p,f,0),_=p,Y=J(g,x,0),N=g;var nt=J(D,F,0);ae(t,d,b-257),ae(t,d+5,H-1),ae(t,d+10,X-4),d+=14;for(var A=0;A<X;++A)ae(t,d+3*A,D[tn[A]]);d+=3*X;for(var Z=[y,E],se=0;se<2;++se)for(var j=Z[se],A=0;A<j.length;++A){var K=j[A]&31;ae(t,d,nt[K]),d+=D[K],K>15&&(ae(t,d,j[A]>>5&127),d+=j[A]>>12)}}else U=Oi,_=ce,Y=Di,N=Pe;for(var A=0;A<l;++A){var B=r[A];if(B>255){var K=B>>18&31;_e(t,d,U[K+257]),d+=_[K+257],K>7&&(ae(t,d,B>>23&31),d+=ot[K]);var re=B&31;_e(t,d,Y[re]),d+=N[re],re>3&&(_e(t,d,B>>5&8191),d+=it[re])}else _e(t,d,U[B]),d+=_[B]}return _e(t,d,U[256]),d+_[256]},Xi=new en([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tr=new I(0),Vi=function(e,t,n,r,a,o){var i=o.z||e.length,l=new I(r+i+5*(1+Math.ceil(i/7e3))+a),s=l.subarray(r,l.length-a),c=o.l,d=(o.r||0)&7;if(t){d&&(s[0]=o.r>>3);for(var u=Xi[t-1],p=u>>13,f=u&8191,h=(1<<n)-1,g=o.p||new G(32768),x=o.h||new G(h+1),v=Math.ceil(n/3),y=2*v,b=function(Lr){return(e[Lr]^e[Lr+1]<<v^e[Lr+2]<<y)&h},k=new en(25e3),E=new G(288),H=new G(32),S=0,A=0,L=o.i||0,D=0,F=o.w||0,X=0;L+2<i;++L){var pe=b(L),$=L&32767,V=x[pe];if(g[$]=V,x[pe]=$,F<=L){var U=i-L;if((S>7e3||D>24576)&&(U>423||!c)){d=Br(e,s,0,k,E,H,A,D,X,L-X,d),D=S=A=0,X=L;for(var _=0;_<286;++_)E[_]=0;for(var _=0;_<30;++_)H[_]=0}var Y=2,N=0,nt=f,Z=$-V&32767;if(U>2&&pe==b(L-Z))for(var se=Math.min(p,U)-1,j=Math.min(32767,L),K=Math.min(258,U);Z<=j&&--nt&&$!=V;){if(e[L+Y]==e[L+Y-Z]){for(var B=0;B<K&&e[L+B]==e[L+B-Z];++B);if(B>Y){if(Y=B,N=Z,B>se)break;for(var re=Math.min(Z,B-2),He=0,_=0;_<re;++_){var Se=L-Z+_&32767,Jt=g[Se],Qt=Se-Jt&32767;Qt>He&&(He=Qt,V=Se)}}}$=V,V=g[$],Z+=$-V&32767}if(N){k[D++]=268435456|nn[Y]<<18|Mr[N];var rt=nn[Y]&31,at=Mr[N]&31;A+=ot[rt]+it[at],++E[257+rt],++H[at],F=L+Y,++S}else k[D++]=e[L],++E[e[L]]}}for(L=Math.max(L,F);L<i;++L)k[D++]=e[L],++E[e[L]];d=Br(e,s,c,k,E,H,A,D,X,L-X,d),c||(o.r=d&7|s[d/8|0]<<3,d-=7,o.h=x,o.p=g,o.i=L,o.w=F)}else{for(var L=o.w||0;L<i+c;L+=65535){var Me=L+65535;Me>=i&&(s[d/8|0]=c,Me=i),d=_r(s,d+1,e.subarray(L,Me))}o.i=i}return Ie(l,0,r+sn(d)+a)},Yi=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),zr=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Yi[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Fr=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),i=new I(o.length+e.length);i.set(o),i.set(e,o.length),e=i,a.w=o.length}return Vi(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},Or=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Q=function(e,t){return e[t]|e[t+1]<<8},q=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},dn=function(e,t){return q(e,t)+q(e,t+4)*4294967296},T=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Gi=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&T(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},$i=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&O(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},ji=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Ki=function(e){return 10+(e.filename?e.filename.length+1:0)};function Zi(e,t){return Fr(e,t||{},0,0)}function Wi(e,t){return Pr(e,{i:2},t&&t.out,t&&t.dictionary)}function qi(e,t){t||(t={});var n=zr(),r=e.length;n.p(e);var a=Fr(e,t,Ki(t),8),o=a.length;return Gi(a,t),T(a,o-8,n.d()),T(a,o-4,r),a}function Ji(e,t){var n=$i(e);return n+8>e.length&&O(6,"invalid gzip data"),Pr(e.subarray(n,-8),{i:2},new I(ji(e)),t)}var Rr=function(e,t,n,r){for(var a in e){var o=e[a],i=t+a,l=r;Array.isArray(o)&&(l=Or(r,o[1]),o=o[0]),o instanceof I?n[i]=[o,l]:(n[i+="/"]=[new I(0),l],Rr(o,i,n,r))}},Dr=typeof TextEncoder<"u"&&new TextEncoder,un=typeof TextDecoder<"u"&&new TextDecoder,Qi=0;try{un.decode(Tr,{stream:!0}),Qi=1}catch{}var es=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return{s:t,r:Ie(e,n-1)};a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function xe(e,t){var n;if(Dr)return Dr.encode(e);for(var r=e.length,a=new I(e.length+(e.length>>1)),o=0,i=function(c){a[o++]=c},n=0;n<r;++n){if(o+5>a.length){var l=new I(o+8+(r-n<<1));l.set(a),a=l}var s=e.charCodeAt(n);s<128||t?i(s):s<2048?(i(192|s>>6),i(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|e.charCodeAt(++n)&1023,i(240|s>>18),i(128|s>>12&63),i(128|s>>6&63),i(128|s&63)):(i(224|s>>12),i(128|s>>6&63),i(128|s&63))}return Ie(a,0,o)}function mn(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(un)return un.decode(e);var a=es(e),o=a.s,n=a.r;return n.length&&O(8),o}}var ts=function(e,t){return t+30+Q(e,t+26)+Q(e,t+28)},ns=function(e,t,n){var r=Q(e,t+28),a=mn(e.subarray(t+46,t+46+r),!(Q(e,t+8)&2048)),o=t+46+r,i=q(e,t+20),l=n&&i==4294967295?rs(e,o):[i,q(e,t+24),q(e,t+42)],s=l[0],c=l[1],d=l[2];return[Q(e,t+10),s,c,a,o+Q(e,t+30)+Q(e,t+32),d]},rs=function(e,t){for(;Q(e,t)!=1;t+=4+Q(e,t+2));return[dn(e,t+12),dn(e,t+4),dn(e,t+20)]},pn=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&O(9),t+=r+4}return t},Ur=function(e,t,n,r,a,o,i,l){var s=r.length,c=n.extra,d=l&&l.length,u=pn(c);T(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=a&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&O(10),T(e,t,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,o!=-1&&(T(e,t,n.crc),T(e,t+4,o<0?-o-2:o),T(e,t+8,n.size)),T(e,t+12,s),T(e,t+14,u),t+=16,i!=null&&(T(e,t,d),T(e,t+6,n.attrs),T(e,t+10,i),t+=14),e.set(r,t),t+=s,u)for(var h in c){var g=c[h],x=g.length;T(e,t,+h),T(e,t+2,x),e.set(g,t+4),t+=4+x}return d&&(e.set(l,t),t+=d),t},as=function(e,t,n,r,a){T(e,t,101010256),T(e,t+8,n),T(e,t+10,n),T(e,t+12,r),T(e,t+16,a)};function os(e,t){t||(t={});var n={},r=[];Rr(e,"",n,t);var a=0,o=0;for(var i in n){var l=n[i],s=l[0],c=l[1],d=c.level==0?0:8,u=xe(i),p=u.length,f=c.comment,h=f&&xe(f),g=h&&h.length,x=pn(c.extra);p>65535&&O(11);var v=d?Zi(s,c):s,y=v.length,b=zr();b.p(s),r.push(Or(c,{size:s.length,crc:b.d(),c:v,f:u,m:h,u:p!=i.length||h&&f.length!=g,o:a,compression:d})),a+=30+p+x+y,o+=76+2*(p+x)+(g||0)+y}for(var k=new I(o+22),E=a,H=o-a,S=0;S<r.length;++S){var u=r[S];Ur(k,u.o,u,u.f,u.u,u.c.length);var A=30+u.f.length+pn(u.extra);k.set(u.c,u.o+A),Ur(k,a,u,u.f,u.u,u.c.length,u.o,u.m),a+=16+A+(u.m?u.m.length:0)}return as(k,a,r.length,H,E),k}function is(e,t){for(var n={},r=e.length-22;q(e,r)!=101010256;--r)(!r||e.length-r>65558)&&O(13);var a=Q(e,r+8);if(!a)return{};var o=q(e,r+16),i=o==4294967295||a==65535;if(i){var l=q(e,r-12);i=q(e,l)==101075792,i&&(a=q(e,l+32),o=q(e,l+48))}for(var s=0;s<a;++s){var c=ns(e,o,i),d=c[0],u=c[1],p=c[2],f=c[3],h=c[4],g=c[5],x=ts(e,g);o=h,d?d==8?n[f]=Wi(e.subarray(x,x+u),{out:new I(p)}):O(14,"unknown compression type "+d):n[f]=Ie(e,x,x+u)}return n}const Nr=512*1024*1024,fn=512*1024*1024;class st{constructor(){this.chunks=[],this.length=0}writeU8(t){const n=new Uint8Array(1);n[0]=t&255,this.chunks.push(n),this.length+=1}writeU32(t){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t>>>0,!0),this.chunks.push(n),this.length+=4}writeI32(t){const n=new Uint8Array(4);new DataView(n.buffer).setInt32(0,t|0,!0),this.chunks.push(n),this.length+=4}writeF32(t){const n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,t,!0),this.chunks.push(n),this.length+=4}writeF64(t){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,t,!0),this.chunks.push(n),this.length+=8}writeBytes(t){this.chunks.push(t),this.length+=t.length}writeString(t){const n=xe(t);this.writeU32(n.length),this.writeBytes(n)}writeJson(t){this.writeString(JSON.stringify(t))}writeFloat32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}writeUint32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}alignTo(t){const n=this.length%t;if(n===0)return;const r=t-n;for(let a=0;a<r;a++)this.writeU8(0)}toUint8Array(){const t=new Uint8Array(this.length);let n=0;for(const r of this.chunks)t.set(r,n),n+=r.length;return t}}class lt{constructor(t){this.bytes=t,this.offset=0}ensureAvailable(t){if(t<0||!Number.isFinite(t))throw new Error("Invalid binary length");if(this.offset+t>this.bytes.length)throw new Error("Unexpected end of binary buffer")}readU8(){return this.ensureAvailable(1),this.bytes[this.offset++]}readU32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getUint32(0,!0);return this.offset+=4,n}readI32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getInt32(0,!0);return this.offset+=4,n}readF32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getFloat32(0,!0);return this.offset+=4,n}readF64(){this.ensureAvailable(8);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,8).getFloat64(0,!0);return this.offset+=8,n}readBytes(t){this.ensureAvailable(t);const n=this.bytes.subarray(this.offset,this.offset+t);return this.offset+=t,n}readString(){const t=this.readU32();if(t===0)return"";if(t>Nr)throw new Error("Binary string exceeds size limit");return mn(this.readBytes(t))}readJson(){const t=this.readString();if(t.length===0)throw new Error("Expected JSON payload");return JSON.parse(t)}alignTo(t){const n=this.offset%t;if(n===0)return;const r=t-n;this.ensureAvailable(r),this.offset+=r}readFloat32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Float32Array(0);if(t%4!==0)throw new Error("Invalid float32 buffer length");if(t>fn)throw new Error("Float32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Float32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Float32Array(r)}readUint32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Uint32Array(0);if(t%4!==0)throw new Error("Invalid uint32 buffer length");if(t>fn)throw new Error("Uint32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Uint32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Uint32Array(r)}}const R=4,ct="gzip",Xr=512*1024*1024,dt=256*1024*1024;let Te=null;function ss(e){Te=e}function we(e){return{bytes:Te?Te.gzipSync(e):qi(e),compression:ct}}async function hn(e){if(Te)return{bytes:await Te.gzip(e),compression:ct};if(typeof CompressionStream>"u")return we(e);try{const t=new Uint8Array(e.byteLength);t.set(e);const n=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip"));return{bytes:new Uint8Array(await new Response(n).arrayBuffer()),compression:ct}}catch{return we(e)}}function gn(e){return e.byteLength>=2&&e[0]===31&&e[1]===139}function ut(e){if(e.byteLength>dt)throw new Error("Compressed payload exceeds size limit");const t=Ji(e);if(t.byteLength>Xr)throw new Error("Decompressed payload exceeds size limit");return t}const mt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%()*+,-.;=?@[]^_{|}~",yn=new Int16Array(128).fill(-1);for(let e=0;e<mt.length;e++)yn[mt.charCodeAt(e)]=e;function xn(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes(";base85")||t.endsWith("base85")?"base85":"base64"}function ve(e,t){return t==="base85"?Vr(e):cs(e)}function ze(e,t){const n=e.length>0&&(e.charCodeAt(0)<=32||e.charCodeAt(e.length-1)<=32)?e.trim():e;return t==="base85"?Yr(n):ds(n)}function Vr(e){const t=e.length;if(t===0)return"";const n=(4-t%4)%4,r=t+n,a=[];for(let i=0;i<r;i+=4){const l=e[i]??0,s=i+1<t?e[i+1]:0,c=i+2<t?e[i+2]:0,d=i+3<t?e[i+3]:0;let u=(l<<24>>>0)+(s<<16)+(c<<8)+d;const p=new Array(5);for(let f=4;f>=0;f--)p[f]=u%85,u=u/85|0;for(let f=0;f<5;f++)a.push(mt[p[f]])}const o=Math.ceil(t*5/4);return a.slice(0,o).join("")}function Yr(e){const t=e.replace(/\s+/g,""),n=t.length;if(n===0)return new Uint8Array(0);const r=Math.floor(n*4/5),a=(5-n%5)%5,o=n+a,i=new Uint8Array(o/5*4),l=mt.length-1;let s=0;for(let c=0;c<o;c+=5){let d=0;for(let u=0;u<5;u++){const p=c+u<n?ls(t.charCodeAt(c+u)):l;d=d*85+p}i[s++]=d>>>24&255,i[s++]=d>>>16&255,i[s++]=d>>>8&255,i[s++]=d&255}return i.subarray(0,r)}function ls(e){if(e<0||e>=yn.length)throw new Error("Invalid base85 character");const t=yn[e];if(t<0)throw new Error("Invalid base85 character");return t}function cs(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function ds(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const pt=1,ft=2,ht=4,gt=8,yt=16,wn=32,xt=1,wt=2,vt=4,bt=8,kt=16,vn=32,Lt=64,At=128;function Ct(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.lineDistances&&(t+=e.lineDistances.byteLength),e.linePattern&&(t+=64+e.linePattern.pattern.length*8),t}function Et(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.gradientPositions&&(t+=e.gradientPositions.byteLength),e.uvs&&(t+=e.uvs.byteLength),e.texture&&(t+=e.texture.bytes.byteLength+64),e.hatchPattern&&(t+=128),e.gradientFill&&(t+=64),t}function bn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=pt),t.linePattern&&(n|=ft),t.lineDistances&&t.lineDistances.length>0&&(n|=ht),t.lineWidth!=null&&t.lineWidth>0&&(n|=gt),t.renderOrder!=null&&t.renderOrder!==0&&(n|=yt),t.excludeFromOsnap&&(n|=wn),e.writeU8(n),n&pt&&e.writeUint32Array(t.indices),n&ft&&e.writeJson(t.linePattern),n&ht&&e.writeFloat32Array(t.lineDistances),n>&&e.writeF32(t.lineWidth),n&yt&&e.writeI32(t.renderOrder)}function kn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};return o&pt&&(i.indices=e.readUint32Array()),o&ft&&(i.linePattern=e.readJson()),o&ht&&(i.lineDistances=e.readFloat32Array()),o>&&(i.lineWidth=e.readF32()),o&yt&&(i.renderOrder=e.readI32()),o&wn&&(i.excludeFromOsnap=!0),i}function Ln(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=xt),t.hatchPattern&&(n|=wt),t.gradientFill&&(n|=vt),t.gradientPositions&&t.gradientPositions.length>0&&(n|=bt),t.side!=null&&(n|=kt),t.points&&(n|=vn),t.renderOrder!=null&&t.renderOrder!==0&&(n|=Lt),t.texture&&t.texture.bytes.length>0&&t.uvs&&t.uvs.length>=2&&(n|=At),e.writeU8(n),n&xt&&e.writeUint32Array(t.indices),n&wt&&e.writeJson(t.hatchPattern),n&vt&&e.writeJson(t.gradientFill),n&bt&&e.writeFloat32Array(t.gradientPositions),n&kt&&e.writeU8(t.side),n&Lt&&e.writeI32(t.renderOrder),n&At&&(e.writeFloat32Array(t.uvs),e.writeString(t.texture.mimeType||"image/png"),e.writeU32(t.texture.bytes.byteLength),e.writeBytes(t.texture.bytes))}function An(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};if(o&xt&&(i.indices=e.readUint32Array()),o&wt&&(i.hatchPattern=e.readJson()),o&vt&&(i.gradientFill=e.readJson()),o&bt&&(i.gradientPositions=e.readFloat32Array()),o&kt&&(i.side=e.readU8()),o&vn&&(i.points=!0),o&Lt&&(i.renderOrder=e.readI32()),o&At){i.uvs=e.readFloat32Array();const l=e.readString()||"image/png",s=e.readU32();i.texture={mimeType:l,bytes:e.readBytes(s)}}return i}const Ht=1329939265,Cn=1,Gr=5e5,us=1e5,$r=1,jr=2,Kr=3,Zr=4,Wr=5,qr=6,Jr=7;function En(e){var t;switch(e.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+e.vertices.length*8;case"spline":return 10+(e.controlPoints.length+e.knots.length+e.weights.length+(((t=e.fitPoints)==null?void 0:t.length)??0))*8+16;default:return e}}function Qr(e,t){if(e.length===0)return[];const n=[];let r=[],a=64;const o=()=>{r.length!==0&&(n.push(r),r=[],a=64)};for(const i of e){const l=En(i);r.length>0&&a+l>t&&o(),r.push(i),a+=l}return o(),n}function be(e){const t=new st;t.writeU32(Ht),t.writeU8(Cn),t.writeU8(0),t.writeU8(0),t.writeU8(0);const n=[],r=new Map,a=o=>{const i=r.get(o);if(i!=null)return i;const l=n.length;return n.push(o),r.set(o,l),l};for(const o of e.primitives)a(o.layer);t.writeU32(n.length);for(const o of n)t.writeString(o);t.writeU32(e.primitives.length);for(const o of e.primitives)ps(t,o,a(o.layer));return t.toUint8Array()}function St(e){const t=new lt(e);if(t.readU32()!==Ht)throw new Error("Invalid osnap catalog magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==Cn)throw new Error(`Unsupported osnap catalog version: ${r}`);const a=t.readU32();if(a>us)throw new Error("Osnap layer count exceeds limit");const o=[];for(let s=0;s<a;s++)o.push(t.readString());const i=t.readU32();if(i>Gr)throw new Error("Osnap primitive count exceeds limit");const l=[];for(let s=0;s<i;s++)l.push(fs(t,o));return{primitives:l}}function ea(e){const t=be(e),n=we(t).bytes;return{uncompressed:t,compressed:n}}async function ms(e){const t=be(e),n=(await hn(t)).bytes;return{uncompressed:t,compressed:n}}function ta(e){return St(ut(e))}function na(e){return gn(e)?ta(e):St(e)}function Hn(e,t){e.writeU8(t<0?0:1)}function Sn(e){return e.readU8()===0?-1:1}function Fe(e,t){e.writeU32(t.length);for(const n of t)e.writeF64(n)}function Oe(e){const t=e.readU32();if(t>Gr)throw new Error("Float64 array count exceeds limit");const n=[];for(let r=0;r<t;r++)n.push(e.readF64());return n}function ps(e,t,n){switch(t.kind){case"line":e.writeU8($r),e.writeU32(n),e.writeF64(t.x0),e.writeF64(t.y0),e.writeF64(t.x1),e.writeF64(t.y1);return;case"circle":e.writeU8(jr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),Hn(e,t.normalSign);return;case"arc":e.writeU8(Kr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),e.writeF64(t.startAngle),e.writeF64(t.endAngle),Hn(e,t.normalSign);return;case"ellipse":e.writeU8(Zr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.majorX),e.writeF64(t.majorY),e.writeF64(t.majorR),e.writeF64(t.minorR),e.writeF64(t.startAngle),e.writeF64(t.endAngle),e.writeU8(t.closed?1:0),Hn(e,t.normalSign??1);return;case"spline":e.writeU8(Wr),e.writeU32(n),Fe(e,t.controlPoints),e.writeU32(t.degree),Fe(e,t.knots),Fe(e,t.weights),e.writeU8(t.closed?1:0),Fe(e,t.fitPoints??[]);return;case"point":e.writeU8(qr),e.writeU32(n),e.writeF64(t.x),e.writeF64(t.y);return;case"path":e.writeU8(Jr),e.writeU32(n),e.writeU8(t.closed?1:0),Fe(e,t.vertices);return;default:{const r=t;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}function fs(e,t){const n=e.readU8(),r=e.readU32(),a=t[r];if(a==null)throw new Error(`Invalid osnap layer index: ${r}`);switch(n){case $r:return{kind:"line",layer:a,x0:e.readF64(),y0:e.readF64(),x1:e.readF64(),y1:e.readF64()};case jr:return{kind:"circle",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),normalSign:Sn(e)};case Kr:return{kind:"arc",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),normalSign:Sn(e)};case Zr:return{kind:"ellipse",layer:a,cx:e.readF64(),cy:e.readF64(),majorX:e.readF64(),majorY:e.readF64(),majorR:e.readF64(),minorR:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),closed:e.readU8()!==0,normalSign:Sn(e)};case Wr:{const o=Oe(e),i=e.readU32(),l=Oe(e),s=Oe(e),c=e.readU8()!==0,d=Oe(e);return{kind:"spline",layer:a,controlPoints:o,degree:i,knots:l,weights:s,closed:c,...d.length>0?{fitPoints:d}:{}}}case qr:return{kind:"point",layer:a,x:e.readF64(),y:e.readF64()};case Jr:{const o=e.readU8()!==0,i=Oe(e);return{kind:"path",layer:a,closed:o,vertices:i}}default:throw new Error(`Unsupported osnap primitive kind: ${n}`)}}const ra=1480934209;function aa(e){if(e.version!==R)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=new st;t.writeU32(ra),t.writeU8(R),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeJson(hs(e)),t.writeJson(e.layers),t.writeString(e.activeLayoutBtrId),t.writeU32(e.layouts.length);for(const n of e.layouts)ys(t,n);return t.toUint8Array()}function oa(e){const t=new lt(e);if(t.readU32()!==ra)throw new Error("Invalid snapshot magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==R)throw new Error(`Unsupported snapshot version: ${r}`);const a=t.readJson(),o=t.readJson(),i=t.readString(),l=t.readU32(),s=[];for(let c=0;c<l;c++)s.push(ws(t));return gs(s,a.savedViews,a.fitExtents),{version:R,meta:a,layers:o,layouts:s,activeLayoutBtrId:i}}function hs(e){const t={...e.meta.savedViews??{}},n={...e.meta.fitExtents??{}};for(const s of e.layouts)s.savedView&&(t[s.btrId]=s.savedView),s.fitExtents&&(n[s.btrId]=s.fitExtents);const r=Object.keys(t).length>0,a=Object.keys(n).length>0;if(!r&&!a){if(e.meta.savedViews==null&&e.meta.fitExtents==null)return e.meta;const{savedViews:s,fitExtents:c,...d}=e.meta;return d}const{savedViews:o,fitExtents:i,...l}=e.meta;return{...l,...r?{savedViews:t}:{},...a?{fitExtents:n}:{}}}function gs(e,t,n){if(!(!t&&!n))for(const r of e){if(!r.savedView){const a=t==null?void 0:t[r.btrId];a&&(r.savedView=a)}if(!r.fitExtents){const a=n==null?void 0:n[r.btrId];a&&(r.fitExtents=a)}}}function ys(e,t){e.writeString(t.btrId),e.writeString(t.name),e.writeU8(t.isModelSpace?1:0),xs(e,t.osnap),e.writeJson(t.viewports??null),e.writeU32(t.lineBatches.length);for(const n of t.lineBatches)bn(e,n);e.writeU32(t.meshBatches.length);for(const n of t.meshBatches)Ln(e,n)}function xs(e,t){if(!t||t.primitives.length===0){e.writeU32(0);return}const n=be(t);e.writeU32(n.length),e.writeBytes(n)}function ws(e){const t=e.readString(),n=e.readString(),r=e.readU8()!==0,a=bs(e),o=vs(e.readJson()),i=e.readU32(),l=[];for(let d=0;d<i;d++)l.push(kn(e));const s=e.readU32(),c=[];for(let d=0;d<s;d++)c.push(An(e));return{btrId:t,name:n,isModelSpace:r,lineBatches:l,meshBatches:c,osnap:a,viewports:o}}function vs(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="object")return e.viewports??void 0}}function bs(e){const t=e.readU32();if(t===0)return;const n=e.readBytes(t);if(ks(n))return St(n);const r=mn(n);if(!(r.length===0||r==="null"))return JSON.parse(r)}function ks(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Ht}const Ls="application/vnd.mlightcad.acex-snapshot+binary";function ia(e){if(e.version!==R)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=aa(e),n=we(t);return{payload:ve(n.bytes,"base85"),compression:n.compression}}function As(e,t="base85"){return sa(la(e,t))}function sa(e){const t=ut(e);return oa(t)}function la(e,t="base85"){const n=t==="base64"||t==="base85"?t:xn(t);return ze(e,n)}function ca(){return Ls}function ee(e,t,n){if(n<=0)return new Float32Array(0);if(e instanceof Float32Array)return e.subarray(t,t+n).slice();const r=new Float32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function da(e,t,n){if(n<=0)return new Uint32Array(0);const r=new Uint32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function Mn(e,t){if(t.length===0)return{positions:e,indices:t};let n=0;for(let a=0;a<t.length;a++){const o=t[a];o>n&&(n=o)}const r=(n+1)*3;return r>=e.length?{positions:e,indices:t}:{positions:ee(e,0,r),indices:t}}function Re(e,t){return e+t}const ke={x:0,y:0,z:0};function ua(e){e.updateMatrixWorld(!0);const t=e.matrixWorld.elements;return ke.x=t[12],ke.y=t[13],ke.z=t[14],[ke.x,ke.y,ke.z]}function Mt(e,t){const n=t.elements,r=e.positions;if(r.length===0)return{positions:new Float32Array(0),indices:e.indices};const a=new Float32Array(r.length);for(let o=0;o<r.length;o+=3){const i=r[o],l=r[o+1],s=r[o+2];a[o]=n[0]*i+n[4]*l+n[8]*s+n[12],a[o+1]=n[1]*i+n[5]*l+n[9]*s+n[13],a[o+2]=n[2]*i+n[6]*l+n[10]*s+n[14]}return{positions:a,indices:e.indices?new Uint32Array(e.indices):void 0}}function ma(e,t){const n=t*3;return Number.isFinite(e[n])&&Number.isFinite(e[n+1])&&Number.isFinite(e[n+2])}function fe(e,t){const n=e.positions,r=n.length/3|0;if(r===0||t<=0)return e;let a=!1;for(let l=0;l<n.length;l++)if(!Number.isFinite(n[l])){a=!0;break}if(!a)return e;const o=e.indices;if(o&&o.length>0){const l=[];for(let u=0;u+t<=o.length;u+=t){let p=!0;for(let f=0;f<t;f++){const h=o[u+f];if(h<0||h>=r||!ma(n,h)){p=!1;break}}if(p)for(let f=0;f<t;f++)l.push(o[u+f])}if(l.length===0)return{positions:new Float32Array(0)};const s=new Int32Array(r);s.fill(-1);const c=[],d=new Uint32Array(l.length);for(let u=0;u<l.length;u++){const p=l[u];let f=s[p];if(f<0){f=c.length/3,s[p]=f;const h=p*3;c.push(n[h],n[h+1],n[h+2])}d[u]=f}return{positions:Float32Array.from(c),indices:d}}const i=[];for(let l=0;l+t<=r;l+=t){let s=!0;for(let c=0;c<t;c++)if(!ma(n,l+c)){s=!1;break}if(s)for(let c=0;c<t;c++){const d=(l+c)*3;i.push(n[d],n[d+1],n[d+2])}}return i.length===0?{positions:new Float32Array(0)}:{positions:Float32Array.from(i)}}function Pt(e){const t=e.positions;if(t.length<3)return{slice:e,offset:[0,0,0]};let n=1/0,r=1/0,a=1/0,o=-1/0,i=-1/0,l=-1/0,s=0;for(let u=0;u<t.length;u+=3){const p=t[u],f=t[u+1],h=t[u+2];!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(h)||(s++,n=Math.min(n,p),r=Math.min(r,f),a=Math.min(a,h),o=Math.max(o,p),i=Math.max(i,f),l=Math.max(l,h))}if(s===0)return{slice:{positions:new Float32Array(0)},offset:[0,0,0]};const c=[(n+o)/2,(r+i)/2,(a+l)/2],d=new Float32Array(t.length);for(let u=0;u<t.length;u+=3){const p=t[u],f=t[u+1],h=t[u+2];if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(h)){d[u]=0,d[u+1]=0,d[u+2]=0;continue}d[u]=p-c[0],d[u+1]=f-c[1],d[u+2]=h-c[2]}return{slice:{positions:d,indices:e.indices?new Uint32Array(e.indices):void 0},offset:c}}function pa(e,t,n={}){e.updateMatrixWorld(!0);const r=Mt(t,e.matrixWorld);return Pt(r)}let fa;function Cs(e){fa=e}function ha(e){const t=e.image;if(!t)return;if(typeof document>"u")return Es(t);const n=document.createElement("canvas"),r=n.getContext("2d");if(!r)return;try{if(t instanceof ImageData)n.width=t.width,n.height=t.height,r.putImageData(t,0,0);else if(ga(t)){n.width=t.width,n.height=t.height;const s=Ms(t.data,t.width*t.height),c=new ImageData(new Uint8ClampedArray(s),t.width,t.height);r.putImageData(c,0,0)}else if(Hs(t)){const s=Ss(t);if(!s)return;n.width=s.width,n.height=s.height,r.drawImage(t,0,0)}else return}catch{return}const a=n.toDataURL("image/png"),o=a.indexOf(",");if(o<0)return;const i=atob(a.slice(o+1)),l=new Uint8Array(i.length);for(let s=0;s<i.length;s++)l[s]=i.charCodeAt(s);return{mimeType:"image/png",bytes:l}}function Es(e){const t=fa;if(!(!t||!ga(e)))try{const n=t(e);return n!=null&&n.byteLength?{mimeType:"image/png",bytes:n}:void 0}catch{return}}function Hs(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement}function ga(e){if(!e||typeof e!="object")return!1;const t=e;return t.data!=null&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>=1&&t.height>=1}function Ss(e){let t=Number(e.width),n=Number(e.height);if(e instanceof HTMLImageElement?(t=e.naturalWidth||e.width,n=e.naturalHeight||e.height):typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement&&(t=e.videoWidth||e.width,n=e.videoHeight||e.height),!(!Number.isFinite(t)||!Number.isFinite(n)||t<1||n<1))return{width:t,height:n}}function Ms(e,t){const n=t*4;if(e instanceof Uint8ClampedArray&&e.length>=n)return e.length===n?e:e.subarray(0,n);const r=new Uint8ClampedArray(n),a=Math.min(n,e.length);for(let o=0;o<a;o++)r[o]=e[o];if(e.length>=t*3&&e.length<n)for(let o=t-1;o>=0;o--){const i=o*3,l=o*4;r[l]=e[i],r[l+1]=e[i+1],r[l+2]=e[i+2],r[l+3]=255}return r}function ya(e,t){const n=e.getAttribute("uv");if(!n||n.count===0||n.itemSize<2)return;const a=Math.floor(t.length/3)*2;if(a<=0)return;const o=n.array;if(!(n.count*n.itemSize<a))return ee(o,0,a)}function Pn(e){const t=e;return t.map?!1:t.transparent===!0&&typeof t.opacity=="number"&&t.opacity<.01}function xa(e,t={}){const n=new Blob([e.bytes],{type:e.mimeType||"image/png"}),r=URL.createObjectURL(n),a=new C.TextureLoader().load(r,o=>{var i;URL.revokeObjectURL(r),(i=t.onLoad)==null||i.call(t,o)},void 0,()=>{var o;URL.revokeObjectURL(r),(o=t.onError)==null||o.call(t)});return a.colorSpace=C.SRGBColorSpace,a.needsUpdate=!0,a}function wa(e){e&&(e.bytes=new Uint8Array(0))}const In={value:1};function _n(e){const t=e;if(t.isShaderMaterial===!0||e.type==="ShaderMaterial")return t}function va(e){var o;const t=_n(e);if(!t)return;const n=t.uniforms.pattern,r=t.uniforms.patternLength;if(!n||!r)return;const a=n.value;if(!(!Array.isArray(a)||a.length===0))return{pattern:[...a],patternLength:Number(r.value),viewportScale:Number(((o=t.uniforms.u_viewportScale)==null?void 0:o.value)??1)}}function ba(e){var a;const t=_n(e);if(!t)return;const n=t.uniforms.u_patternLines;if(!n)return;const r=n.value;if(!(!Array.isArray(r)||r.length===0))return{patternAngle:Number(((a=t.uniforms.u_patternAngle)==null?void 0:a.value)??0),patternLines:r.map(Ps)}}function ka(e){var o,i,l,s,c;const t=_n(e);if(!t||t.uniforms.u_patternLines)return;const n=(o=t.uniforms.u_startColor)==null?void 0:o.value,r=(i=t.uniforms.u_endColor)==null?void 0:i.value,a=t.uniforms.u_gradientType;if(!(!(n!=null&&n.getHex)||a==null))return{startColor:n.getHex(),endColor:((l=r==null?void 0:r.getHex)==null?void 0:l.call(r))??n.getHex(),angle:Number(((s=t.uniforms.u_angle)==null?void 0:s.value)??0),shift:Number(((c=t.uniforms.u_shift)==null?void 0:c.value)??0),gradientType:Number(a.value)}}function Ps(e){return{angle:e.angle,base:[e.base.x,e.base.y],offset:[e.offset.x,e.offset.y],dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Is(e){return{angle:e.angle,base:new C.Vector2(e.base[0],e.base[1]),offset:new C.Vector2(e.offset[0],e.offset[1]),dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function It(e){const t=e.length/3;if(t<2)return new Float32Array(0);const n=new Float32Array(t);for(let r=0;r<t;r+=2){r===0?n[r]=0:n[r]=n[r-1];const a=e[r*3],o=e[r*3+1],i=e[r*3+2]??0,l=e[(r+1)*3],s=e[(r+1)*3+1],c=e[(r+1)*3+2]??0,d=l-a,u=s-o,p=c-i;n[r+1]=n[r]+Math.sqrt(d*d+u*u+p*p)}return n}function _s(e){const t=e.getAttribute("lineDistance");if(!t||t.count===0)return;if(e.getIndex()){const c=t.array;return ee(c,0,t.count)}const r=e.drawRange,a=t.count,o=Math.max(0,Math.min(Math.floor(r.start),a)),i=Math.max(0,a-o),l=!Number.isFinite(r.count)||r.count<=0?i:Math.min(Math.floor(r.count),i);if(l<=0)return;const s=t.array;return ee(s,o,l)}function La(e,t){const n=e.getAttribute(t);if(!n||n.count===0)return;const r=n.itemSize;if(e.getIndex()){const u=n.array;return ee(u,0,n.count*r)}const o=e.drawRange,i=n.count,l=Math.max(0,Math.min(Math.floor(o.start),i)),s=Math.max(0,i-l),c=!Number.isFinite(o.count)||o.count<=0?s:Math.min(Math.floor(o.count),s);if(c<=0)return;const d=n.array;return ee(d,l*r,c*r)}function Bs(e,t){if(e.lineWidth!=null&&e.lineWidth>0){const n=new Ar.LineMaterial({color:e.color,linewidth:e.lineWidth});return t&&n.resolution.copy(t),n}return e.linePattern?P.AcTrLinePatternShaders.createLineShaderMaterialFromScaledPattern(e.linePattern.pattern,e.linePattern.patternLength,e.color,e.linePattern.viewportScale,In):new C.LineBasicMaterial({color:e.color})}function Ts(e){return new C.PointsMaterial({color:e.color,size:1,sizeAttenuation:!1})}function Bn(e,t){const n=t[0],r=t[1],a=t[4],o=t[5],i=t[12],l=t[13],s=Math.atan2(r,n),c=(p,f)=>[n*p+a*f+i,r*p+o*f+l],d=(p,f)=>[n*p+a*f,r*p+o*f],u=(p,f,h)=>{const g=Math.cos(h),x=Math.sin(h);return[g*p-x*f,x*p+g*f]};return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(p=>{const f=p.angle+e.patternAngle,h=p.angle+s,g=h+e.patternAngle,[x,v]=d(Math.cos(f),Math.sin(f)),y=Math.hypot(x,v),[b,k]=u(p.offset[0],p.offset[1],f),[E,H]=d(b,k),S=u(E,H,-g);return{angle:h,base:c(p.base[0],p.base[1]),offset:S,dashLengths:p.dashLengths.map(A=>A*y),patternLength:p.patternLength*y}})}}function Aa(e,t){return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(n=>{const r=new C.Vector2(n.base[0]-t[0],n.base[1]-t[1]),a=new C.Vector2(n.offset[0],n.offset[1]);return P.wrapPatternBaseToLocalFrame(r,a,n.angle,e.patternAngle,n.patternLength),{angle:n.angle,base:[r.x,r.y],offset:[n.offset[0],n.offset[1]],dashLengths:[...n.dashLengths],patternLength:n.patternLength}})}}function zs(e,t={}){if(e.hatchPattern&&e.hatchPattern.patternLines.length>0)try{const n=e.hatchPattern.patternLines.map(Is);return P.createHatchPatternShaderMaterial(n,e.hatchPattern.patternAngle,In,new C.Color(e.color),0,e.side??C.FrontSide)}catch{}if(e.gradientFill&&e.gradientPositions&&e.gradientPositions.length>=2)try{return P.createGradientHatchShaderMaterialFromUniforms(e.gradientFill,e.side??C.FrontSide)}catch{}if(e.texture&&e.uvs&&e.uvs.length>=2){const n=new C.MeshBasicMaterial({color:16777215,side:C.DoubleSide,transparent:!0,opacity:0,depthWrite:!1});return n.map=xa(e.texture,{onLoad:()=>{var r;wa(e.texture),n.opacity=1,n.depthWrite=!0,n.needsUpdate=!0,(r=t.onTextureLoad)==null||r.call(t)}}),n}return new C.MeshBasicMaterial({color:e.color,side:C.DoubleSide})}function Tn(e,t){return!Number.isFinite(e)||e<0?0:Math.min(Math.floor(e),t)}function zn(e,t,n){const r=Math.max(0,t-n);return!Number.isFinite(e)||e<=0?r:Math.min(Math.floor(e),r)}function De(e){const t=e.getAttribute("position");if(!t)return{positions:new Float32Array(0)};const n=e.drawRange,r=t.array,a=t.itemSize,o=e.getIndex();if(o){const c=ee(r,0,t.count*a),d=o.array,u=Tn(n.start,o.count),p=zn(n.count,o.count,u),f=da(d,u,p);return Mn(c,f)}const i=Tn(n.start,t.count),l=zn(n.count,t.count,i);return{positions:ee(r,i*a,l*a)}}function Ue(e){return P.isBatchGeometryActive(e.flags)&&P.isBatchGeometryVisible(e.flags)}function Fn(e,t){const n=(t==null?void 0:t.geometryLayerName)??"";if(!e||!(t!=null&&t.insertLayerByObjectId)||!t.frozenLayers)return n;const r=t.insertLayerByObjectId.get(e);return r&&r!==n&&t.frozenLayers.has(r)?r:n}function _t(e,t){const n=new Map,{count:r}=e.mappingStats;for(let a=0;a<r;a++){let o;try{o=e.getGeometryRangeAt(a)}catch{continue}if(!Ue(o))continue;const i=Fn(o.objectId,t),l=n.get(i);l?l.push(a):n.set(i,[a])}return n}function Ca(e){const{count:t}=e.mappingStats;for(let n=0;n<t;n++){let r;try{r=e.getGeometryRangeAt(n)}catch{continue}if(Ue(r)&&r.bboxIntersectionCheck)return!0}return!1}function On(e){return P.getSceneDrawableUserData(e).bboxIntersectionCheck===!0}function Bt(e,t,n){const r=t.getAttribute("position");if(!r)return{positions:new Float32Array(0)};const a=r.itemSize,o=r.array,i=t.getIndex(),l=n??Array.from({length:e.mappingStats.count},(p,f)=>f);if(i){const p=ee(o,0,r.count*a),f=i.array;let h=0;const g=[];for(const y of l){let b;try{b=e.getGeometryRangeAt(y)}catch{continue}const k=b.indexStart??0,E=b.indexCount??0;!Ue(b)||E<=0||(g.push({start:k,count:E}),h+=E)}if(h===0)return{positions:new Float32Array(0)};const x=new Uint32Array(h);let v=0;for(const y of g)for(let b=0;b<y.count;b++)x[v++]=f[y.start+b];return Mn(p,x)}let s=0;const c=[];for(const p of l){let f;try{f=e.getGeometryRangeAt(p)}catch{continue}if(!Ue(f)||f.vertexCount<=0)continue;const h=f.vertexCount*a;c.push({start:f.vertexStart*a,floatCount:h}),s+=h}if(s===0)return{positions:new Float32Array(0)};const d=new Float32Array(s);let u=0;if(o instanceof Float32Array)for(const p of c)d.set(o.subarray(p.start,p.start+p.floatCount),u),u+=p.floatCount;else for(const p of c)for(let f=0;f<p.floatCount;f++)d[u++]=o[p.start+f];return{positions:d}}function Ea(e,t,n){e.push(t.getX(n),t.getY(n),t.getZ(n))}function Ha(e,t,n){const r=t.getAttribute("instanceStart"),a=t.getAttribute("instanceEnd");if(!r||!a)return{positions:new Float32Array(0)};const o=n??Array.from({length:e.mappingStats.count},(l,s)=>s),i=[];for(const l of o){let s;try{s=e.getGeometryRangeAt(l)}catch{continue}if(!Ue(s)||s.vertexCount<=0)continue;const c=s.vertexStart,d=c+s.vertexCount;for(let u=c;u<d;u++)Ea(i,r,u),Ea(i,a,u)}return{positions:new Float32Array(i)}}function Fs(e,t){const r=e.instanceCount;if(Number.isFinite(r)&&r>=0)return Math.min(Math.floor(r),t);const a=e.drawRange,o=Tn(a.start,t);return zn(a.count,t,o)}function Os(e){const t=e.getAttribute("instanceStart"),n=e.getAttribute("instanceEnd");if(!t||!n||t.count===0)return{positions:new Float32Array(0)};const r=Fs(e,t.count);if(r<=0)return{positions:new Float32Array(0)};const a=[];for(let o=0;o<r;o++){const i=[t.getX(o),t.getY(o),t.getZ(o)],l=[n.getX(o),n.getY(o),n.getZ(o)];!i.every(Number.isFinite)||!l.every(Number.isFinite)||a.push(i[0],i[1],i[2],l[0],l[1],l[2])}return{positions:new Float32Array(a)}}function Tt(e,t){let n=e;for(;n&&n!==t;){if(n.visible===!1)return!1;n=n.parent}return!0}function Sa(e){if(e instanceof Ar.LineMaterial)return e.linewidth}function Ne(e){if("material"in e){const n=e.userData.originalMaterial??e.material;return Array.isArray(n)?n[0]:n}return e.material}function de(e){var c;const t=P.getMaterialMetadata(e),n=t.layer??"0",r=e;let a=r.color!=null?r.color.getHex():t.color??16777215;const o=va(e),i=ba(e),l=ka(e);if(e instanceof C.ShaderMaterial||e.type==="ShaderMaterial"){const u=(c=e.uniforms.u_color)==null?void 0:c.value;u!=null&&u.getHex?a=u.getHex():l&&(a=l.startColor)}return{color:a,layer:n,linePattern:o,hatchPattern:i,gradientFill:l,side:!!i||!!l?e.side:void 0}}function Rs(e,t){const r=P.getMaterialMetadata(t).drawOrder??e.renderOrder;return r===0?void 0:r}function Le(e,t,n){const r=Rs(t,n);r!=null&&(e.renderOrder=r)}function Ds(e,t){if(!t)return;const n=e.userData.bakedWorldMatrix;return n&&n.length>=16?Bn(t,n):(e.updateMatrixWorld(!0),Bn(t,Array.from(e.matrixWorld.elements)))}function zt(e){return ua(e)}function Rn(e,t,n={}){const r=pa(e,t,n);return{...r.slice,offset:r.offset}}function Us(e){if(e.indices&&e.indices.length>=3)return e;const t=e.positions.length/3|0;if(t<3||t%3!==0)return e;const n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=r;return{...e,indices:n}}function Xe(e,t,n,r,a,o=!1){o&&(r=Us(r));const i=de(t),l=Ds(n,i.hatchPattern),s=l?Aa(l,a):void 0,c=i.gradientFill?La(e,"gradientPosition"):void 0,d={layer:i.layer,color:i.color,offset:a,hatchPattern:s,gradientFill:i.gradientFill,gradientPositions:c,side:i.side,...r},u=t;if(u.map){const p=ha(u.map),f=ya(e,r.positions);if(!p||!f)return;d.texture=p,d.uvs=f,d.color=16777215,d.side=C.DoubleSide}return Le(d,n,t),d}function Ns(e,t){const n=_t(e,t);if(n.size===0)return[];const{color:r}=de(e.material),a=Sa(e.material),o=zt(e),i=Ca(e),l=e.material,s=[];for(const[c,d]of n){const u=Ha(e,e.geometry,d);if(u.positions.length===0)continue;const p={layer:c,color:r,offset:o,lineWidth:a,...u};i&&(p.excludeFromOsnap=!0),Le(p,e,l),s.push(p)}return s}function Xs(e,t){const n=_t(e,t);if(n.size===0)return[];const{color:r,linePattern:a}=de(e.material),o=zt(e),i=Ca(e),l=e.material,s=[];for(const[c,d]of n){const u=Bt(e,e.geometry,d);if(u.positions.length===0)continue;const p=a?It(u.positions):void 0,f={layer:c,color:r,offset:o,linePattern:a,lineDistances:p,...u};i&&(f.excludeFromOsnap=!0),Le(f,e,l),s.push(f)}return s}function Vs(e,t){const n=_t(e,t);if(n.size===0)return[];const r=[];for(const[a,o]of n){const i=Bt(e,e.geometry,o);if(i.positions.length===0)continue;const l=Xe(e.geometry,e.material,e,i,zt(e),!0);l&&(l.layer=a,r.push(l))}return r}function Ys(e,t){const n=_t(e,t);if(n.size===0)return[];const r=[];for(const[a,o]of n){const i=Bt(e,e.geometry,o);if(i.positions.length===0)continue;const l=Xe(e.geometry,e.material,e,i,zt(e));l&&(l.layer=a,r.push({points:!0,...l}))}return r}const te=new C.Matrix4,Ft=new C.Matrix4,Ve=new C.Object3D;Ve.matrixAutoUpdate=!1;function Gs(e){const t=e;return t.isInstancedMesh===!0&&t.instanceMatrix!=null&&typeof t.count=="number"&&t.geometry!=null}function $s(e){return e.renderOrder<1e4||e.isInstancedMesh===!0?!1:P.getSceneDrawableUserData(e).sharesTemplateGeometry===!0}function Ot(e){const t=e.elements;for(let o=0;o<16;o++)if(!Number.isFinite(t[o]))return!1;const n=Math.hypot(t[0],t[1],t[2]),r=Math.hypot(t[4],t[5],t[6]),a=Math.hypot(t[8],t[9],t[10]);return n+r+a>=1e-8}function js(e,t){let n=e;for(;n;){const r=n.getObjectIdAt;if(typeof r=="function")return r.call(n,t);n=n.parent}}function Ma(e,t){e.updateMatrixWorld(!0);const n=e.instanceMatrix.array,r=new Map,a=(t==null?void 0:t.geometryLayerName)??"";for(let o=0;o<e.count;o++){if(te.fromArray(n,o*16),!Ot(te))continue;const i=js(e,o),l=Fn(i,t)||a,s=r.get(l);s?s.push(o):r.set(l,[o])}return r}function Pa(e,t,n){var h;const r=fe(De(e.geometry),t),a=r.positions.length;if(a===0)return;e.updateMatrixWorld(!0);const o=e.instanceMatrix.array,i=((h=r.indices)==null?void 0:h.length)??0,l=n??Array.from({length:e.count},(g,x)=>x);let s=0;for(const g of l)te.fromArray(o,g*16),Ot(te)&&s++;if(s===0)return;const c=new Float32Array(s*a),d=r.indices!=null?new Uint32Array(s*i):void 0,u=a/3;let p=0;for(const g of l){if(te.fromArray(o,g*16),!Ot(te))continue;Ft.multiplyMatrices(e.matrixWorld,te);const x=Mt(r,Ft);if(c.set(x.positions,p*a),d&&x.indices){const v=p*u;for(let y=0;y<x.indices.length;y++)d[p*i+y]=x.indices[y]+v}p++}const f=Pt(fe({positions:c,indices:d},t));if(f.slice.positions.length!==0)return{slice:f.slice,offset:f.offset}}function Ks(e){const t=de(e),n=e;return!!(t.hatchPattern||t.gradientFill||n.map)}function Zs(e,t,n){e.updateMatrixWorld(!0);const r=e.instanceMatrix.array,a=n??Array.from({length:e.count},(o,i)=>i);for(const o of a)te.fromArray(r,o*16),Ot(te)&&(Ft.multiplyMatrices(e.matrixWorld,te),t(Ft,o))}function Ws(e,t,n){const r=Ma(e,n);if(r.size===0)return;const a=Ne(e),{color:o,layer:i,linePattern:l}=de(a),s=(n==null?void 0:n.geometryLayerName)||i,c=On(e);for(const[d,u]of r){const p=Pa(e,2,u);if(!p)continue;const f=l?It(p.slice.positions):void 0,h={layer:d||s,color:o,offset:p.offset,linePattern:l,lineDistances:f,...p.slice};c&&(h.excludeFromOsnap=!0),Le(h,e,a),t.push(h)}}function Ia(e,t,n,r){const a=Ne(e);if(!n&&Pn(a))return;const o=Ma(e,r);if(o.size===0)return;const i=(r==null?void 0:r.geometryLayerName)||de(a).layer;if(!n&&Ks(a)){const l=fe(De(e.geometry),3);if(l.positions.length===0)return;for(const[s,c]of o)Zs(e,d=>{const u=fe(Mt(l,d),3);if(u.positions.length===0)return;const p=Pt(u);Ve.matrix.copy(d),Ve.matrixWorld.copy(d),Ve.matrixWorldNeedsUpdate=!1;const f=Xe(e.geometry,a,Ve,p.slice,p.offset,!0);f&&(f.layer=s||i,t.push(f))},c);return}for(const[l,s]of o){const c=Pa(e,n?1:3,s);if(!c)continue;const d=Xe(e.geometry,a,e,c.slice,c.offset,!n);d&&(d.layer=l||i,t.push(n?{...d,points:!0}:d))}}function Rt(e){const t=e;return e instanceof Ti.LineSegments2||t.isLineSegments2===!0||e.type==="LineSegments2"}function _a(e){const t=e;return e instanceof C.LineSegments||t.isLineSegments===!0||e.type==="LineSegments"}function Ba(e){const t=e;return e instanceof C.Mesh||t.isMesh===!0||t.isInstancedMesh===!0||e.type==="Mesh"}function Ta(e,t){const n=[],r=[],a=(t==null?void 0:t.geometryLayerName)??"",o=i=>{const l=i.userData,s=l.objectId??l.sharedInstanceObjectId;return Fn(s,t)};return e.traverse(i=>{if(!(P.isHighlightOverlayDescendant(i)||P.isHighlightCloneDrawable(i)||$s(i))){if(Gs(i)){if(!Tt(i,e))return;i.isPoints===!0?Ia(i,r,!0,t):_a(i)&&!Rt(i)?Ws(i,n,t):Ba(i)&&!Rt(i)&&Ia(i,r,!1,t);return}if(i instanceof P.AcTrBatchedLine){n.push(...Xs(i,t));return}if(i instanceof P.AcTrBatchedLine2){n.push(...Ns(i,t));return}if(i instanceof P.AcTrBatchedMesh){r.push(...Vs(i,t));return}if(i instanceof P.AcTrBatchedPoint){r.push(...Ys(i,t));return}if(Rt(i)){if(!Tt(i,e))return;const l=Os(i.geometry);if(l.positions.length===0)return;const s=Ne(i),{color:c}=de(s),{offset:d,...u}=Rn(i,l),p={layer:o(i)||a,color:c,offset:d,lineWidth:Sa(s),...u};On(i)&&(p.excludeFromOsnap=!0),Le(p,i,s),n.push(p)}else if(_a(i)&&!(i instanceof P.AcTrBatchedLine)){if(!Tt(i,e))return;const l=fe(De(i.geometry),2);if(l.positions.length===0)return;const s=Ne(i),{color:c,linePattern:d}=de(s),{offset:u,...p}=Rn(i,l),f=d?It(p.positions):void 0,h={layer:o(i)||a,color:c,offset:u,linePattern:d,lineDistances:f,...p};On(i)&&(h.excludeFromOsnap=!0),Le(h,i,s),n.push(h)}else if(Ba(i)&&!Rt(i)&&!(i instanceof P.AcTrBatchedMesh)){if(!Tt(i,e))return;const l=Ne(i);if(Pn(l))return;const s=fe(De(i.geometry),3);if(s.positions.length===0)return;const{offset:c,...d}=Rn(i,s),u=Xe(i.geometry,l,i,d,c,!0);u&&(u.layer=o(i)||a,r.push(u))}}}),{lineBatches:n,meshBatches:r}}const za={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function Fa(e){const t=new w.AcCmColor(w.AcCmColorMethod.ByACI,e);return t.cssColor??`rgb(${t.red}, ${t.green}, ${t.blue})`}function qs(e){try{const t=w.AcDbSysVarManager.instance(),n=t.getVar(w.AcDbSystemVariables.GRIPSIZE,e),r=t.getVar(w.AcDbSystemVariables.GRIPCOLOR,e),a=t.getVar(w.AcDbSystemVariables.GRIPHOT,e);return!(n>0)||!Number.isFinite(n)?za:{size:n,colorCss:Fa(r),hotColorCss:Fa(a)}}catch{return za}}function Dn(e,t){const n=e.extmin,r=e.extmax,a=qs(e);return{title:t==null?void 0:t.title,extents:{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y},units:{insunits:e.insunits,lunits:e.lunits,luprec:e.luprec,aunits:e.aunits,auprec:e.auprec,measurement:e.measurement,ltscale:e.ltscale,angbase:e.angbase,angdir:e.angdir},grip:a,background:(t==null?void 0:t.background)??0}}const Js=["endpoint","midpoint","center","quadrant","intersection","nearest"];function Un(e,t){let n=t-e;for(;n<=0;)n+=w.TAU;for(;n>w.TAU;)n-=w.TAU;return n}function Nn(e,t,n,r,a){const o=a===-1?-1:1;return new w.AcGePoint2d(e+o*n*Math.cos(r),t+n*Math.sin(r))}function Xn(e,t,n,r,a){return Math.atan2(r-t,a*(n-e))}function Oa(e){const t=Nn(e.cx,e.cy,e.r,e.startAngle,e.normalSign),n=Nn(e.cx,e.cy,e.r,e.endAngle,e.normalSign),r=Un(e.startAngle,e.endAngle),a=e.normalSign*Math.tan(r/4);return new w.AcGeCircArc2d(t,n,a)}function Ra(e){return Un(e.startAngle,e.endAngle)}function Qs(e,t){const n=Ra(e),r=e.startAngle+t*n,a=e.normalSign??1,o=e.majorR*Math.cos(r),i=a*e.minorR*Math.sin(r),l=e.majorX,s=e.majorY;return new w.AcGePoint2d(e.cx+o*l-i*s,e.cy+o*s+i*l)}function Da(e){return e.kind==="circle"?new w.AcGeCircArc2d({x:e.cx,y:e.cy},e.r,0,w.TAU,e.normalSign===-1):Oa(e)}function Ua(e){const t=Math.atan2(e.majorY,e.majorX);return new w.AcGeEllipseArc2d({x:e.cx,y:e.cy,z:0},e.majorR,e.minorR,e.startAngle,e.endAngle,e.closed,t)}function Na(e){const t=[];for(let n=0;n+1<e.controlPoints.length;n+=2)t.push({x:e.controlPoints[n],y:e.controlPoints[n+1],z:0});return new w.AcGeNurbsCurve(e.degree,e.knots,t,e.weights.length>0?e.weights:void 0)}function el(e){switch(e.kind){case"line":return{kind:"line",curve:new w.AcGeLine2d({x:e.x0,y:e.y0},{x:e.x1,y:e.y1})};case"circle":case"arc":return{kind:"circArc",curve:Da(e)};case"ellipse":return{kind:"ellipse",curve:Ua(e)};case"spline":return{kind:"spline",curve:Na(e)};case"point":return{kind:"point",point:new w.AcGePoint2d(e.x,e.y)};case"path":throw new Error("path primitives must be expanded before curve conversion")}}function Vn(e){return e.z>=0?1:-1}function Xa(e,t,n){if(!(n.radius>0)||!Number.isFinite(n.radius))return;const r=n.clockwise?-1:1,a=n.center.x,o=n.center.y;e.push({kind:"arc",layer:t,cx:a,cy:o,r:n.radius,startAngle:Xn(a,o,n.startPoint.x,n.startPoint.y,r),endAngle:Xn(a,o,n.endPoint.x,n.endPoint.y,r),normalSign:r})}function z(e,t){const n=new C.Vector3(t.x,t.y,t.z??0).applyMatrix4(e);return{x:n.x,y:n.y}}function tl(e){const t=e.elements;return new C.Matrix4(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function Dt(e,t){return new C.Matrix4().multiplyMatrices(e,tl(t))}function Va(e,t){const n=new C.Vector3(t.x,t.y,t.z??0).transformDirection(e).normalize();return{x:n.x,y:n.y}}function Yn(e){const t=new C.Vector3(e.elements[0],e.elements[1],e.elements[2]).length(),n=new C.Vector3(e.elements[4],e.elements[5],e.elements[6]).length();return w.AcGeTol.equal(t,n,w.FLOAT_TOL*Math.max(t,n,1))}function nl(e,t){const n=e.tables.blockTable.getIdAt(t);if(n)return n;for(const a of e.tables.blockTable.newIterator())if(a.objectId===t)return a;const r=e.tables.blockTable.modelSpace;if(r.objectId===t)return r}function rl(e){if(e instanceof w.AcDbLine)return!0;const t=e;return(t.type==="LINE"||t.type==="Line")&&t.startPoint!=null&&t.endPoint!=null}function al(e,t,n,r){r.startPoint,r.endPoint}function Ya(e,t){return e.blockTableRecord??(e.blockName?t.tables.blockTable.getAt(e.blockName):void 0)}function ol(e,t){const n=e.dimBlockId;return n?t.tables.blockTable.getAt(n):void 0}function il(e,t){const r=Ya(e,t);if(r)return r;const a=e.owningBlockRecordId;return a?t.tables.blockTable.getAt(a):void 0}function Ga(e){return e.getFullInsertionTransform()}function sl(e){for(const t of e.newIterator())return!0;return!1}function ll(e){return typeof e.getFullInsertionTransform=="function"&&"blockTableRecord"in e}function lu(e,t,n,r,a){}function cu(e,t,n,r,a,o){}function ue(e,t,n,r,a){if(r.length<2)return;const o=Yn(n),l=n.elements[0]*n.elements[5]-n.elements[4]*n.elements[1]<0?-1:1,s=[];for(const c of r){const d=z(n,c);let u=c.bulge??0;w.AcGeTol.isPositive(Math.abs(u))&&(u=o?u*l:0),s.push(d.x,d.y,u)}e.push({kind:"path",layer:t,closed:a,vertices:s})}function $a(e,t){return w.AcGeTol.equal(e.x,t.x)&&w.AcGeTol.equal(e.y,t.y)}function cl(e){return(e.clockwise?-1:1)*Math.tan(e.deltaAngle/4)}function ja(e,t,n,r){if(e.length===0){e.push({x:t.x,y:t.y,z:t.z??0,bulge:r}),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0});return}const a=e[e.length-1];$a(a,t)?a.bulge=r:(a.bulge=0,e.push({x:t.x,y:t.y,z:t.z??0,bulge:r})),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0})}function Ka(e){return e.length>=2&&$a(e[0],e[e.length-1])&&e.pop(),e}function Ye(e,t,n,r,a){if(r.length<2)return;const o=a?r.length:r.length-1;for(let i=0;i<o;i++)r[i],r[(i+1)%r.length]}function dl(e,t,n,r){const a=[r.startPosition];for(const o of r.segments)a.push(o.position);Ye(e,t,n,a,r.closed)}function ul(e,t,n){if(n.vertices.length===0)return[];const r=n.vertices[n.vertices.length-1],a=t.lastLeaderLinePoint??t.landingPoint??e.landingPoint??e.contentBasePosition;if(!a)return n.vertices;const o=r.x-a.x,i=r.y-a.y,l=(r.z??0)-(a.z??0);return Math.hypot(o,i,l)<=w.FLOAT_TOL?n.vertices:[...n.vertices,a]}function ml(e,t,n,r){var o,i;for(const l of r.leaders)for(const s of l.leaderLines){const c=ul(r,l,s);Ye(e,t,n,c,!1)}const a=l=>{if(!l)return;const s=z(n,l);e.push({kind:"point",layer:t,x:s.x,y:s.y})};a(r.contentBasePosition),a((o=r.mtextContent)==null?void 0:o.anchorPoint),a((i=r.blockContent)==null?void 0:i.position)}function pl(e,t,n,r){const a=r.numberOfVertices;if(a<2)return;const o=r.elevation,i=r.closed?a:a-1;for(let l=0;l<i;l++){const s=r.getPointAt(l),c=r.getPointAt((l+1)%a),d=r.getBulgeAt(l),u={x:s.x,y:s.y,z:o},p={x:c.x,y:c.y,z:o};if(w.AcGeTol.isPositive(Math.abs(d))){const f=z(n,u),h=z(n,p);Xa(e,t,new w.AcGeCircArc2d(f,h,d))}}}function fl(e,t,n,r,a,o){const i=z(n,r),l=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),s={kind:"circle",layer:t,cx:i.x,cy:i.y,r:a*l,normalSign:Vn(o)};e.push(s)}function hl(e,t,n,r){const a=z(n,r.center),o=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),i={kind:"arc",layer:t,cx:a.x,cy:a.y,r:r.radius*o,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:Vn(r.normal)};e.push(i)}function Gn(e,t,n,r){const a=z(n,r.center),o=r._geo,i=(o==null?void 0:o.majorAxis)??{x:1,y:0,z:0},l=Va(n,i),s=Math.hypot(l.x,l.y)||1,c=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),d=new C.Vector3(n.elements[4],n.elements[5],n.elements[6]).length(),u={kind:"ellipse",layer:t,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:Vn(r.normal)};e.push(u)}function gl(e,t,n,r){var l,s;const a=r._geo;if(!((l=a==null?void 0:a.controlPoints)!=null&&l.length))return;const o=[];for(const c of a.controlPoints){const d=z(n,c);o.push(d.x,d.y)}const i={kind:"spline",layer:t,controlPoints:o,degree:a.degree??3,knots:[...a.knots??[]],weights:[...a.weights??[]],closed:a.closed??!1};if((s=a.fitPoints)!=null&&s.length){i.fitPoints=[];for(const c of a.fitPoints){const d=z(n,c);i.fitPoints.push(d.x,d.y)}}e.push(i)}const Za=1e-6;function yl(e){var r;const t=e.elevation,n=(r=e._geo)==null?void 0:r.vertices;return n&&n.length>1?n.map(a=>({x:a.x,y:a.y,z:t,bulge:a.bulge,startWidth:a.startWidth,endWidth:a.endWidth})):Array.from({length:e.numberOfVertices},(a,o)=>{const i=e.getPoint2dAt(o);return{x:i.x,y:i.y,z:t,bulge:0}})}function xl(e){return e.some(t=>{const n=Math.max(0,t.startWidth??0),r=Math.max(0,t.endWidth??0);return n>Za||r>Za})}function wl(e,t,n,r){const a=yl(r),o=a.length;if(o<2)return;if(xl(a)){ue(e,t,n,a,r.closed);return}const i=r.closed?o:o-1;for(let l=0;l<i;l++){const s=a[l],c=a[(l+1)%o],d=s.bulge??0;if(w.AcGeTol.isPositive(Math.abs(d))){const u=z(n,s),p=z(n,c);Xa(e,t,new w.AcGeCircArc2d(u,p,d))}}}function vl(e,t,n,r,a){const o=z(n,{x:r.center.x,y:r.center.y,z:a}),i=Va(n,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),l=Math.hypot(i.x,i.y)||1,s=new C.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),c=new C.Vector3(n.elements[4],n.elements[5],n.elements[6]).length();e.push({kind:"ellipse",layer:t,cx:o.x,cy:o.y,majorX:i.x/l,majorY:i.y/l,majorR:r.majorAxisRadius*s,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function bl(e,t,n,r,a){var l;const o=r.numberOfVertices;if(o<2)return;const i=[];for(let s=0;s<o;s++){const c=r.getPointAt(s);i.push({x:c.x,y:c.y,z:a,bulge:((l=r.vertices[s])==null?void 0:l.bulge)??0})}ue(e,t,n,i,r.closed)}function kl(e,t,n,r,a){if(r instanceof w.AcGePolyline2d){bl(e,t,n,r,a);return}if(!(r instanceof w.AcGeLoop2d))return;const o=[];let i=!1;const l=()=>{const c=Ka(o);c.length>=2&&ue(e,t,n,c,!1),o.length=0};for(const c of r.curves)c instanceof w.AcGeLine2d?ja(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},0):c instanceof w.AcGeCircArc2d?ja(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},cl(c)):c instanceof w.AcGeEllipseArc2d&&(i=!0,l(),vl(e,t,n,c,a));const s=Ka(o);s.length>=2&&ue(e,t,n,s,!i)}function Ll(e,t,n,r){var i;const a=(i=r._geo)==null?void 0:i.loops;if(!(a!=null&&a.length))return;const o=r.elevation;for(const l of a)kl(e,t,n,l,o)}function Al(e,t,n,r){Dt(n,Ga(r));const a=[0];for(let i=0;i<r.numColumns;i++)a.push(a[i]+r.columnWidth(i));const o=[0];for(let i=0;i<r.numRows;i++)o.push(o[i]-r.rowHeight(i));a[a.length-1],o[o.length-1];for(const i of o);for(const i of a);}function Cl(e,t,n,r,a,o,i,l=!0){const s=$n(e.layer,n);if(i&&!i(s))return;const c=il(e,o);if(c&&!a.has(c.objectId)&&sl(c)){a.add(c.objectId);const u=Dt(t,Ga(e));Ut(c,u,s,r,a,o,i,l),a.delete(c.objectId);return}Al(r,s,t,e);const d=z(t,e.position);r.push({kind:"point",layer:s,x:d.x,y:d.y})}function El(e,t,n,r){let a=r.boundaryPath();if(a.length>1){const i=a[0],l=a[a.length-1];i.x===l.x&&i.y===l.y&&(i.z??0)===(l.z??0)&&(a=a.slice(0,-1))}a.length>=2&&ue(e,t,n,a,!0);const o=z(n,r.position);e.push({kind:"point",layer:t,x:o.x,y:o.y})}function Hl(e,t,n,r){const a=r.position();ue(e,t,n,[a.upperLeft,a.upperRight,a.lowerRight,a.lowerLeft],!0);const o=z(n,r.getLocation());e.push({kind:"point",layer:t,x:o.x,y:o.y})}function Sl(e){var n;const t=(n=e.attributeIterator)==null?void 0:n.call(e);return t?typeof t.toArray=="function"?t.toArray():[...t]:[]}function $n(e,t){return e==="0"?t:e}function Wa(e,t,n,r,a,o,i,l=!0){if(!e.visibility)return;const s=$n(e.layer,n);if(!(i&&!i(s))){if(e instanceof w.AcDbTable){Cl(e,t,n,r,a,o,i,l);return}if(ll(e)){const c=Ya(e,o);if(!c||a.has(c.objectId))return;a.add(c.objectId);const d=e.getFullInsertionTransform(),u=e,p=u instanceof w.AcDbMInsertBlock?u:void 0,f=Math.max(1,(p==null?void 0:p.columns)??1),h=Math.max(1,(p==null?void 0:p.rows)??1),g=(p==null?void 0:p.columnSpacing)??0,x=(p==null?void 0:p.rowSpacing)??0,v=$n(e.layer,n);for(let y=0;y<h;y++)for(let b=0;b<f;b++){const k=Dt(t,d);(b!==0||y!==0)&&k.multiply(new C.Matrix4().makeTranslation(b*g,y*x,0));const E=z(k,{x:0,y:0,z:0});r.push({kind:"point",layer:v,x:E.x,y:E.y}),Ut(c,k,v,r,a,o,i,l)}for(const y of Sl(e))(y instanceof w.AcDbAttribute?y.isInvisible:y.isInvisible)||Wa(y,t,v,r,a,o,i,l);a.delete(c.objectId);return}if(e instanceof w.AcDbDimension){const c=e,d=ol(c,o);if(!d||a.has(d.objectId))return;a.add(d.objectId);const u=Dt(t,c.getFullDimBlockTransform());Ut(d,u,s,r,a,o,i,!0),a.delete(d.objectId);return}if(rl(e)){al(r,s,t,e);return}if(e instanceof w.AcDbCircle){Yn(t)?fl(r,s,t,e.center,e.radius,e.normal):Gn(r,s,t,Ml(e));return}if(e instanceof w.AcDbArc){Yn(t)?hl(r,s,t,e):Gn(r,s,t,Pl(e));return}if(e instanceof w.AcDbEllipse){Gn(r,s,t,e);return}if(e instanceof w.AcDbSpline){gl(r,s,t,e);return}if(e instanceof w.AcDbPolyline){wl(r,s,t,e);return}if(e instanceof w.AcDb2dPolyline){pl(r,s,t,e);return}if(e instanceof w.AcDb3dPolyline){const c=[];for(let d=0;d<e.numberOfVertices;d++)c.push(e.getPointAt(d));Ye(r,s,t,c,e.closed);return}if(e instanceof w.AcDbHatch){l&&Ll(r,s,t,e);return}if(e instanceof w.AcDbRay){e.basePoint,e.unitDir;return}if(e instanceof w.AcDbXline){e.basePoint,e.unitDir;return}if(e instanceof w.AcDbSolid){ue(r,s,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof w.AcDbTrace){l&&ue(r,s,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof w.AcDbFace){const c=e.subGetGripPoints();c.length>=2&&Ye(r,s,t,c,c.length>=3);return}if(e instanceof w.AcDbLeader){const c=e.vertices;c.length>=2&&Ye(r,s,t,c,!1);return}if(e instanceof w.AcDbMLine){dl(r,s,t,e);return}if(e instanceof w.AcDbMLeader){ml(r,s,t,e);return}if(e instanceof w.AcDbText){const c=z(t,e.position);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(e instanceof w.AcDbMText){const c=z(t,e.location);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(e instanceof w.AcDbOle2Frame){l&&Hl(r,s,t,e);return}if(e instanceof w.AcDbRasterImage){l&&El(r,s,t,e);return}if(e instanceof w.AcDbPoint){const c=z(t,e.position);r.push({kind:"point",layer:s,x:c.x,y:c.y})}}}function Ut(e,t,n,r,a,o,i,l=!0){for(const s of e.newIterator())Wa(s,t,n,r,a,o,i,l)}function Ml(e){return new w.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,0,w.TAU)}function Pl(e){return new w.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,e.startAngle,e.endAngle)}function qa(e,t,n={}){const r=nl(e,t);if(!r)return{primitives:[]};const a=[],o=new C.Matrix4;return Ut(r,o,"0",a,new Set,e,n.includeLayer),{primitives:a.filter(i=>i.kind!=="line"&&Il(i))}}function Il(e){switch(e.kind){case"line":return Number.isFinite(e.x0)&&Number.isFinite(e.y0)&&Number.isFinite(e.x1)&&Number.isFinite(e.y1);case"circle":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r);case"arc":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"ellipse":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.majorX)&&Number.isFinite(e.majorY)&&Number.isFinite(e.majorR)&&Number.isFinite(e.minorR)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"spline":return e.controlPoints.every(t=>Number.isFinite(t))&&e.knots.every(t=>Number.isFinite(t))&&e.weights.every(t=>Number.isFinite(t));case"point":return Number.isFinite(e.x)&&Number.isFinite(e.y);case"path":return e.vertices.length>=6&&e.vertices.length%3===0&&e.vertices.every(t=>Number.isFinite(t));default:return e}}const _l={toolbar:{viewerTools:"ビューア ツール",select:"選択",pan:"画面移動",zoom:"ズーム",zoomExtents:"範囲",zoomSmartExtents:"スマート",zoomWindow:"窓",zoomSaved:"保存済み",zoomOriginal:"保存済み",measureDistance:"距離",measureContinuous:"連続",measureAngle:"角度",measureArc:"円弧",measureRadius:"半径",measureArea:"面積",measureCoordinate:"座標",clearMeasurements:"クリア",measureHide:"非表示",measureShow:"表示",measureImport:"読み込み",measureExport:"書き出し",measurementPanel:"結果",measure:"計測",annotation:"レビュー",markupCloud:"雲マーク",markupCallout:"吹き出し",markupText:"文字",markupRect:"長方形",markupCircle:"円",markupArrow:"矢印",markupStamp:"スタンプ",markupPanel:"結果",markupHide:"非表示",markupShow:"表示",clearMarkups:"クリア",markupImport:"読み込み",markupExport:"書き出し",snap:"スナップ",layers:"画層",layout:"レイアウト",settings:"設定",simulatedMouseOn:"マウス",simulatedMouseOff:"ルーペ",themeLight:"ライト",themeDark:"ダーク",switchBg:"背景",language:"言語",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"ツールバーを折りたたむ",expand:"ツールバーを展開",moreOverflow:"その他のツール"},settings:{ortho:"直交モードの切り替え",polar:"極トラッキング角度",polarAngles:"極トラッキング角度"},drawStyle:{color:"色",fontSize:"文字の高さ",pickerTitle:"色を選択",close:"閉じる",ok:"OK",cancel:"キャンセル",index:"色番号: ",rgb:"RGB: ",input:"色",inputPlaceholder:"1-255 または #RRGGBB"},shortCutToolbar:{more:"その他",undo:"元に戻す",redo:"やり直し",erase:"削除",collapse:"ツールバーを折りたたむ",expand:"ツールバーを展開"},textHeight:{title:"文字の高さ",close:"閉じる",ok:"OK",cancel:"キャンセル",adaptive:"画面に合わせる",custom:"カスタムの文字の高さ",customPlaceholder:"ワールドの高さ",fromScreen:"画面上のサイズから",fromScreenHint:"現在のズームで文字を画面上にどの大きさで表示するかを入力します。これはワールド空間の固定の高さに変換され、後でズームしても変わりません。",screenPxPlaceholder:"フォント サイズ",screenUnit:"px",convert:"変換"},entityPick:{cancel:"選択をキャンセル"},layers:{title:"画層",close:"画層を閉じる",showAll:"すべて表示",hideAll:"すべて非表示",zoomTo:"{name} にズーム"},review:{title:"レビュー",close:"レビューを閉じる",searchPlaceholder:"マークアップを検索",empty:"マークアップはまだありません",type:"種類",status:"状態",author:"作成者",summary:"概要",details:"詳細",closeDetails:"詳細を閉じる",label:"ラベル",comment:"コメント",zoomTo:"ズーム",delete:"削除",clear:"すべてクリア",statusValues:{open:"未対応",question:"質問",answered:"回答済み",closed:"完了"}},measurePanel:{title:"計測",close:"計測を閉じる",filterGroup:"種類でフィルタ",filterDistance:"距離",filterArc:"円弧",filterRadius:"半径",filterAngle:"角度",filterArea:"面積",empty:"計測はまだありません",type:"種類",value:"値",delete:"削除",clear:"すべてクリア"},session:{length:"長さ",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"確定",cancel:"キャンセル",help:"ヘルプ",back:"戻る",collapse:"折りたたむ",expand:"展開",undo:"元に戻す"},touchPointTutorial:{title:"点を正確に指定するには?",description:"画面を約 0.5 秒長押しします。指の上に十字カーソルが表示されて指の動きに追従し、図形にスナップするため、より正確に点を指定できます。",snoozeToday:"今日は表示しない",hideForever:"今後表示しない",ok:"わかりました"},status:{ready:"準備完了",zoomWindowHint:"2 つのコーナーをクリックして窓ズームします。",measureDistanceHint:"2 点をクリックして距離を計測します (オブジェクト スナップ有効)。",measureContinuousHint:"点を順にタップして各セグメントを計測し、✓ をタップして終了します。長押しで正確にスナップできます。",measureAreaHint:"多角形の頂点をタップし、3 点以上指定したら ✓ をタップして終了します。長押しで正確にスナップできます。",measureAngleHint:"頂点をクリックし、次に各辺上の点を 1 つずつクリックします (オブジェクト スナップ有効)。",measureArcHint:"円または円弧をクリックしてそれに沿って計測するか、始点、円弧上の点、終点を順にクリックします (オブジェクト スナップ有効)。Ctrl (Mac では ⌘) で優弧/劣弧を切り替えます。",measureRadiusHint:"円または円弧をクリックして半径を計測します (オブジェクト スナップ有効)。",measureCoordinateHint:"点をクリックして X/Y 座標を表示します (オブジェクト スナップ有効)。",measureExported:"{count} 件の計測を書き出しました。",measureImported:"{count} 件の計測を読み込みました。",measureImportFailed:"計測の読み込みに失敗しました: {error}",markupCloudHint:"2 つのコーナーをクリックして雲マークを作成します。",markupCalloutHint:"引出線の先端、または吹き出しのない雲マーク / 長方形 / 円の輪郭をクリックし、次に文字の基点をクリックします。",markupTextHint:"点をクリックして文字を配置します。",markupRectHint:"2 つのコーナーをクリックして長方形を作成します。",markupCircleHint:"中心をクリックし、次に円周上の点をクリックします。",markupArrowHint:"始点をクリックし、次に矢印の先端をクリックします。",markupStampHint:"クリックしてスタンプを配置します (承認 / 却下 / … と順に切り替わります)。",markupArrowEndHint:"矢印の先端をクリックします。",markupRectCornerHint:"もう一方のコーナーをクリックします。",markupCloudCornerHint:"もう一方のコーナーをクリックします。",markupCalloutAnchorHint:"吹き出しの文字の位置をクリックします。",markupCircleRadiusHint:"円周上の点をクリックします。",markupTextPrompt:"マークアップの文字を入力",markupTextEditHint:"キャンバス上で文字を入力します。Enter で確定、Esc でキャンセルします。",markupShapeCalloutHint:"クリックして文字ボックスを配置します (引出線は図形に接続されます)。Esc で吹き出しをキャンセルします。",markupDefaultLabel:"メモ",markupSelected:"選択中のマークアップ: {type}",markupSelectedCount:"選択中のマークアップ: {count}",markupCount:"マークアップ: {count}",markupExported:"{count} 件のマークアップを書き出しました。",markupImported:"{count} 件のマークアップを読み込みました。",markupImportFailed:"マークアップの読み込みに失敗しました: {error}",distance:"距離: {value}",coordinates:"X: {x} | Y: {y}",angle:"角度: {value}",arcLength:"円弧の長さ: {length} | 半径: {radius} | 角度: {angle} | 弦: {chord}",radius:"半径: {value}",continuousTotal:"合計長さ: {value}",area:"面積: {value}",lengthTotal:"長さの合計: {value}",areaTotal:"面積の合計: {value}",zoomLayer:"ズーム: {name}",loadFailed:"図面の読み込みに失敗しました: {error}",noLayout:"スナップショットにレイアウト データがありません。",loadingChunks:"図形を読み込み中… {loaded}/{total}",loadingOsnap:"オブジェクト スナップを読み込み中… {loaded}/{total}",buildingOsnap:"オブジェクト スナップのインデックスを作成中…"},package:{title:"図面パッケージを開く",hint:"このページと同じ場所に drawing.acex.json が見つかりませんでした。ローカルのパッケージ フォルダを選択するか、マニフェストの URL を入力してください。",hintUrlOnly:"このページと同じ場所に drawing.acex.json が見つかりませんでした。パッケージを開くにはマニフェストの URL を入力してください。",chooseFolder:"ローカル フォルダを選択",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL を開く",urlRequired:"マニフェストの URL を入力してください。",manifestNotFound:"このページと同じ場所に drawing.acex.json が見つかりませんでした。",invalidManifest:"パッケージ マニフェストが無効か、サポートされていないバージョンです: {error}",folderMissingManifest:"選択したフォルダには drawing.acex.json が含まれている必要があります。",folderUnsupported:"このブラウザーではローカルのパッケージ フォルダを開けません。代わりにマニフェストの URL を貼り付けてください。",loadFailed:"パッケージを開けませんでした: {error}"},access:{title:"保護された図面",passwordPrompt:"このファイルを開くにはパスワードを入力してください。",passwordPlaceholder:"パスワード",unlock:"ロック解除",passwordRequired:"パスワードを入力してください。",wrongPassword:"パスワードが正しくありません。もう一度お試しください。",expired:"このファイルは有効期限が切れているため、開くことができません。",expiredTitle:"ファイルの有効期限切れ",expiredDetail:"このファイルは {time} に有効期限が切れたため、開くことができません。",expiresAt:"有効期限: {time}",badgeExpires:"{time} に期限切れ",badgeCountdown:"残り {time}",tooManyAttempts:"パスワードの入力ミスが多すぎます。ページを更新してもう一度お試しください。"}},Bl={toolbar:{viewerTools:"뷰어 도구",select:"선택",pan:"초점이동",zoom:"줌",zoomExtents:"범위",zoomSmartExtents:"스마트",zoomWindow:"윈도우",zoomSaved:"저장된 뷰",zoomOriginal:"저장된 뷰",measureDistance:"거리",measureContinuous:"연속",measureAngle:"각도",measureArc:"호",measureRadius:"반지름",measureArea:"면적",measureCoordinate:"XY",clearMeasurements:"지우기",measureHide:"숨기기",measureShow:"표시",measureImport:"가져오기",measureExport:"내보내기",measurementPanel:"결과",measure:"측정",annotation:"검토",markupCloud:"구름",markupCallout:"설명선",markupText:"문자",markupRect:"직사각형",markupCircle:"원",markupArrow:"화살표",markupStamp:"스탬프",markupPanel:"결과",markupHide:"숨기기",markupShow:"표시",clearMarkups:"지우기",markupImport:"가져오기",markupExport:"내보내기",snap:"스냅",layers:"도면층",layout:"배치",settings:"설정",simulatedMouseOn:"마우스",simulatedMouseOff:"돋보기",themeLight:"밝게",themeDark:"어둡게",switchBg:"배경",language:"언어",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"도구막대 접기",expand:"도구막대 펼치기",moreOverflow:"추가 도구"},settings:{ortho:"직교 모드 전환",polar:"극좌표 추적 각도",polarAngles:"극좌표 추적 각도"},drawStyle:{color:"색상",fontSize:"문자 높이",pickerTitle:"색상 선택",close:"닫기",ok:"확인",cancel:"취소",index:"색상 번호: ",rgb:"RGB: ",input:"색상",inputPlaceholder:"1-255 또는 #RRGGBB"},shortCutToolbar:{more:"더 보기",undo:"명령 취소",redo:"명령 복구",erase:"삭제",collapse:"도구막대 접기",expand:"도구막대 펼치기"},textHeight:{title:"문자 높이",close:"닫기",ok:"확인",cancel:"취소",adaptive:"화면에 맞춤",custom:"사용자 문자 높이",customPlaceholder:"월드 높이",fromScreen:"화면 크기 기준",fromScreenHint:"현재 줌 상태에서 문자가 화면에 표시될 크기를 입력하십시오. 이 값은 고정된 월드 공간 높이로 변환되어 이후 줌해도 일정하게 유지됩니다.",screenPxPlaceholder:"글꼴 크기",screenUnit:"px",convert:"변환"},entityPick:{cancel:"선택 취소"},layers:{title:"도면층",close:"도면층 닫기",showAll:"모두 표시",hideAll:"모두 숨기기",zoomTo:"{name}(으)로 줌"},review:{title:"검토",close:"검토 닫기",searchPlaceholder:"마크업 검색",empty:"아직 마크업이 없습니다",type:"유형",status:"상태",author:"작성자",summary:"요약",details:"상세 정보",closeDetails:"상세 정보 닫기",label:"레이블",comment:"설명",zoomTo:"줌",delete:"삭제",clear:"모두 지우기",statusValues:{open:"열림",question:"질문",answered:"답변됨",closed:"닫힘"}},measurePanel:{title:"측정",close:"측정 닫기",filterGroup:"유형별 필터",filterDistance:"거리",filterArc:"호",filterRadius:"반지름",filterAngle:"각도",filterArea:"면적",empty:"아직 측정이 없습니다",type:"유형",value:"값",delete:"삭제",clear:"모두 지우기"},session:{length:"길이",angle:"각도",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"확인",cancel:"취소",help:"도움말",back:"뒤로",collapse:"접기",expand:"펼치기",undo:"명령 취소"},touchPointTutorial:{title:"점을 정확하게 선택하려면?",description:"화면을 약 0.5초 동안 길게 누르십시오. 손가락 위에 십자선이 나타나 이동에 따라 움직이며, 형상에 스냅되어 더 정확하게 선택할 수 있습니다.",snoozeToday:"오늘은 다시 알리지 않음",hideForever:"다시 알리지 않음",ok:"확인"},status:{ready:"준비",zoomWindowHint:"두 구석을 클릭하여 윈도우로 줌합니다.",measureDistanceHint:"두 점을 클릭하여 거리를 측정합니다(객체 스냅 사용).",measureContinuousHint:"연속된 점을 탭하여 각 세그먼트를 측정하고, ✓를 탭하여 마칩니다. 정확한 스냅을 위해 길게 누르십시오.",measureAreaHint:"다각형 정점을 탭하고, 세 점 이상 지정한 후 ✓를 탭하여 마칩니다. 정확한 스냅을 위해 길게 누르십시오.",measureAngleHint:"정점을 클릭한 다음 각 변의 점을 클릭합니다(객체 스냅 사용).",measureArcHint:"원 또는 호를 클릭하여 그 길이를 측정하거나, 시작점, 호 위의 점, 끝점을 차례로 클릭합니다(객체 스냅 사용). Ctrl(Mac에서는 ⌘)로 큰 호/작은 호를 전환합니다.",measureRadiusHint:"원 또는 호를 클릭하여 반지름을 측정합니다(객체 스냅 사용).",measureCoordinateHint:"점을 클릭하여 X/Y 좌표를 읽습니다(객체 스냅 사용).",measureExported:"측정 {count}개를 내보냈습니다.",measureImported:"측정 {count}개를 가져왔습니다.",measureImportFailed:"측정을 가져오지 못했습니다: {error}",markupCloudHint:"두 구석을 클릭하여 구름형 수정 기호를 그립니다.",markupCalloutHint:"지시선 끝 또는 설명선이 없는 구름 / 직사각형 / 원의 윤곽을 클릭한 다음, 문자 기준점을 클릭합니다.",markupTextHint:"점을 클릭하여 문자를 배치합니다.",markupRectHint:"두 구석을 클릭하여 직사각형을 그립니다.",markupCircleHint:"중심을 클릭한 다음 원주 위의 점을 클릭합니다.",markupArrowHint:"시작점을 클릭한 다음 화살표 끝을 클릭합니다.",markupStampHint:"클릭하여 스탬프를 배치합니다(승인 / 반려 / … 순환).",markupArrowEndHint:"화살표 끝을 클릭합니다.",markupRectCornerHint:"반대쪽 구석을 클릭합니다.",markupCloudCornerHint:"반대쪽 구석을 클릭합니다.",markupCalloutAnchorHint:"문자 말풍선 위치를 클릭합니다.",markupCircleRadiusHint:"원주 위의 점을 클릭합니다.",markupTextPrompt:"마크업 문자 입력",markupTextEditHint:"캔버스에 문자를 입력하십시오. Enter로 마치고 Esc로 취소합니다.",markupShapeCalloutHint:"클릭하여 문자 상자를 배치합니다(지시선이 도형에 부착됨). Esc로 설명선을 취소합니다.",markupDefaultLabel:"메모",markupSelected:"선택된 마크업: {type}",markupSelectedCount:"선택된 마크업: {count}개",markupCount:"마크업: {count}개",markupExported:"마크업 {count}개를 내보냈습니다.",markupImported:"마크업 {count}개를 가져왔습니다.",markupImportFailed:"마크업을 가져오지 못했습니다: {error}",distance:"거리: {value}",coordinates:"X: {x} | Y: {y}",angle:"각도: {value}",arcLength:"호 길이: {length} | 반지름: {radius} | 각도: {angle} | 현: {chord}",radius:"반지름: {value}",continuousTotal:"총 길이: {value}",area:"면적: {value}",lengthTotal:"길이 합계: {value}",areaTotal:"면적 합계: {value}",zoomLayer:"줌: {name}",loadFailed:"도면을 로드하지 못했습니다: {error}",noLayout:"스냅샷에 배치 데이터가 없습니다.",loadingChunks:"형상 로드 중… {loaded}/{total}",loadingOsnap:"객체 스냅 로드 중… {loaded}/{total}",buildingOsnap:"객체 스냅 인덱스 작성 중…"},package:{title:"도면 패키지 열기",hint:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다. 로컬 패키지 폴더를 선택하거나 매니페스트 URL을 입력하십시오.",hintUrlOnly:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다. 패키지를 열려면 매니페스트 URL을 입력하십시오.",chooseFolder:"로컬 폴더 선택",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL 열기",urlRequired:"매니페스트 URL을 입력하십시오.",manifestNotFound:"이 페이지 옆에서 drawing.acex.json을 찾을 수 없습니다.",invalidManifest:"패키지 매니페스트가 잘못되었거나 지원되지 않는 버전입니다: {error}",folderMissingManifest:"선택한 폴더에 drawing.acex.json이 있어야 합니다.",folderUnsupported:"이 브라우저에서는 로컬 패키지 폴더를 열 수 없습니다. 대신 매니페스트 URL을 붙여 넣으십시오.",loadFailed:"패키지를 열지 못했습니다: {error}"},access:{title:"보호된 도면",passwordPrompt:"이 파일을 열려면 암호를 입력하십시오.",passwordPlaceholder:"암호",unlock:"잠금 해제",passwordRequired:"암호를 입력하십시오.",wrongPassword:"암호가 올바르지 않습니다. 다시 시도하십시오.",expired:"이 파일은 만료되어 더 이상 열 수 없습니다.",expiredTitle:"파일 만료됨",expiredDetail:"이 파일은 {time}에 만료되어 더 이상 열 수 없습니다.",expiresAt:"만료: {time}",badgeExpires:"{time} 만료",badgeCountdown:"{time} 후 만료",tooManyAttempts:"잘못된 암호 입력 횟수가 너무 많습니다. 다시 시도하려면 페이지를 새로 고치십시오."}},he=["en","zh","ja","ko","cs","tr","ar"],jn={en:"EN",zh:"中",ja:"日",ko:"한",cs:"CS",tr:"TR",ar:"AR"},Kn="mlcad-html-locale",Zn={...{en:{toolbar:{viewerTools:"Viewer tools",select:"Select",pan:"Pan",zoom:"Zoom",zoomExtents:"Extents",zoomSmartExtents:"Smart",zoomWindow:"Window",zoomSaved:"Saved",zoomOriginal:"Saved",measureDistance:"Distance",measureContinuous:"Continuous",measureAngle:"Angle",measureArc:"Arc",measureRadius:"Radius",measureArea:"Area",measureCoordinate:"XY",clearMeasurements:"Clear",measureHide:"Hide",measureShow:"Show",measureImport:"Import",measureExport:"Export",measurementPanel:"Results",measure:"Measure",annotation:"Review",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rect",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupPanel:"Results",markupHide:"Hide",markupShow:"Show",clearMarkups:"Clear",markupImport:"Import",markupExport:"Export",snap:"Snap",layers:"Layers",layout:"Layout",settings:"Settings",simulatedMouseOn:"Mouse",simulatedMouseOff:"Loupe",themeLight:"Light",themeDark:"Dark",switchBg:"Background",language:"Language",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Collapse toolbar",expand:"Expand toolbar",moreOverflow:"More tools"},settings:{ortho:"Toggle orthogonal mode",polar:"Polar tracking angles",polarAngles:"Polar tracking angles"},drawStyle:{color:"Color",fontSize:"Text height",pickerTitle:"Select Color",close:"Close",ok:"OK",cancel:"Cancel",index:"Color Index: ",rgb:"RGB: ",input:"Color",inputPlaceholder:"1-255 or #RRGGBB"},shortCutToolbar:{more:"More",undo:"Undo",redo:"Redo",erase:"Delete",collapse:"Collapse toolbar",expand:"Expand toolbar"},textHeight:{title:"Text Height",close:"Close",ok:"OK",cancel:"Cancel",adaptive:"Fit to screen",custom:"Custom text height",customPlaceholder:"World height",fromScreen:"From screen size",fromScreenHint:"Enter how large the text should look on screen at the current zoom. It is converted to a fixed world-space height that stays constant when you zoom later.",screenPxPlaceholder:"Font size",screenUnit:"px",convert:"Convert"},entityPick:{cancel:"Cancel selection"},layers:{title:"Layers",close:"Close layers",showAll:"Show all",hideAll:"Hide all",zoomTo:"Zoom to {name}"},review:{title:"Review",close:"Close review",searchPlaceholder:"Search markups",empty:"No markups yet",type:"Type",status:"Status",author:"Author",summary:"Summary",details:"Details",closeDetails:"Close details",label:"Label",comment:"Comment",zoomTo:"Zoom to",delete:"Delete",clear:"Clear all",statusValues:{open:"Open",question:"Question",answered:"Answered",closed:"Closed"}},measurePanel:{title:"Measurements",close:"Close measurements",filterGroup:"Filter by type",filterDistance:"Distance",filterArc:"Arc",filterRadius:"Radius",filterAngle:"Angle",filterArea:"Area",empty:"No measurements yet",type:"Type",value:"Value",delete:"Delete",clear:"Clear all"},session:{length:"Length",angle:"Angle",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Confirm",cancel:"Cancel",help:"Help",back:"Back",collapse:"Collapse",expand:"Expand",undo:"Undo"},touchPointTutorial:{title:"How to pick points precisely?",description:"Long-press on the screen for about 0.5 seconds. A cross appears above your finger and follows as you move, snapping to geometry for more accurate picks.",snoozeToday:"Don't remind me today",hideForever:"Don't remind me again",ok:"Got it"},status:{ready:"Ready",zoomWindowHint:"Click two corners to zoom to a window.",measureDistanceHint:"Click two points to measure distance (object snap enabled).",measureContinuousHint:"Tap successive points to measure each segment; tap ✓ to finish. Long-press for precise snap.",measureAreaHint:"Tap polygon vertices; tap ✓ to finish when at least three points are set. Long-press for precise snap.",measureAngleHint:"Click vertex, then two points on each arm (object snap enabled).",measureArcHint:"Click a circle or arc to measure along it, or click start, a point on the arc, then end (object snap enabled). Ctrl (⌘ on Mac) switches major/minor arc.",measureRadiusHint:"Click a circle or arc to measure its radius (object snap enabled).",measureCoordinateHint:"Click a point to read its X/Y coordinates (object snap enabled).",measureExported:"Exported {count} measurement(s).",measureImported:"Imported {count} measurement(s).",measureImportFailed:"Failed to import measurements: {error}",markupCloudHint:"Click two corners to draw a revision cloud.",markupCalloutHint:"Click the leader tip, or the outline of a cloud / rectangle / circle that has no callout, then the text anchor.",markupTextHint:"Click a point to place text.",markupRectHint:"Click two corners to draw a rectangle.",markupCircleHint:"Click the center, then a point on the circumference.",markupArrowHint:"Click the start point, then the arrow tip.",markupStampHint:"Click to place a stamp (cycles approved / rejected / …).",markupArrowEndHint:"Click the arrow tip.",markupRectCornerHint:"Click the opposite corner.",markupCloudCornerHint:"Click the opposite corner.",markupCalloutAnchorHint:"Click the text bubble position.",markupCircleRadiusHint:"Click a point on the circumference.",markupTextPrompt:"Enter markup text",markupTextEditHint:"Type text on the canvas. Enter to finish, Esc to cancel.",markupShapeCalloutHint:"Click to place the text box (leader attaches to the shape). Esc cancels the callout.",markupDefaultLabel:"Note",markupSelected:"Selected markup: {type}",markupSelectedCount:"Selected markups: {count}",markupCount:"Markups: {count}",markupExported:"Exported {count} markup(s).",markupImported:"Imported {count} markup(s).",markupImportFailed:"Failed to import markups: {error}",distance:"Distance: {value}",coordinates:"X: {x} | Y: {y}",angle:"Angle: {value}",arcLength:"Arc length: {length} | Radius: {radius} | Angle: {angle} | Chord: {chord}",radius:"Radius: {value}",continuousTotal:"Total length: {value}",area:"Area: {value}",lengthTotal:"Length total: {value}",areaTotal:"Area total: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Failed to load drawing: {error}",noLayout:"No layout data in snapshot.",loadingChunks:"Loading geometry… {loaded}/{total}",loadingOsnap:"Loading object snap… {loaded}/{total}",buildingOsnap:"Building object snap index…"},package:{title:"Open drawing package",hint:"No drawing.acex.json was found next to this page. Choose a local package folder or enter the manifest URL.",hintUrlOnly:"No drawing.acex.json was found next to this page. Enter the manifest URL to open the package.",chooseFolder:"Choose local folder",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Open URL",urlRequired:"Please enter a manifest URL.",manifestNotFound:"drawing.acex.json was not found next to this page.",invalidManifest:"The package manifest is invalid or uses an unsupported version: {error}",folderMissingManifest:"The selected folder must contain drawing.acex.json.",folderUnsupported:"This browser cannot open a local package folder. Paste a manifest URL instead.",loadFailed:"Failed to open package: {error}"},access:{title:"Protected drawing",passwordPrompt:"Enter the password to open this file.",passwordPlaceholder:"Password",unlock:"Unlock",passwordRequired:"Please enter a password.",wrongPassword:"Incorrect password. Try again.",expired:"This file has expired and can no longer be opened.",expiredTitle:"File expired",expiredDetail:"This file expired on {time} and can no longer be opened.",expiresAt:"Expires: {time}",badgeExpires:"Expires {time}",badgeCountdown:"Expires in {time}",tooManyAttempts:"Too many incorrect password attempts. Refresh the page to try again."}},zh:{toolbar:{viewerTools:"查看器工具",select:"选择",pan:"平移",zoom:"缩放",zoomExtents:"范围",zoomSmartExtents:"智能",zoomWindow:"窗口",zoomSaved:"保存的视图",zoomOriginal:"保存的视图",measureDistance:"测距离",measureContinuous:"连续测",measureAngle:"测角度",measureArc:"测弧长",measureRadius:"测半径",measureArea:"测面积",measureCoordinate:"测坐标",clearMeasurements:"清除",measureHide:"隐藏",measureShow:"显示",measureImport:"导入",measureExport:"导出",measurementPanel:"看结果",measure:"测量",annotation:"审阅",markupCloud:"云线",markupCallout:"标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupPanel:"看结果",markupHide:"隐藏",markupShow:"显示",clearMarkups:"清除",markupImport:"导入",markupExport:"导出",snap:"捕捉",layers:"图层",layout:"布局",settings:"设置",simulatedMouseOn:"鼠标",simulatedMouseOff:"放大",themeLight:"浅色",themeDark:"深色",switchBg:"背景",language:"语言",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"收起工具栏",expand:"展开工具栏",moreOverflow:"更多工具"},settings:{ortho:"切换正交模式",polar:"极轴追踪角度",polarAngles:"极轴追踪角度"},drawStyle:{color:"颜色",fontSize:"字高",pickerTitle:"选择颜色",close:"关闭",ok:"确定",cancel:"取消",index:"颜色索引:",rgb:"RGB:",input:"颜色",inputPlaceholder:"1-255 或 #RRGGBB"},shortCutToolbar:{more:"更多",undo:"撤销",redo:"重做",erase:"删除",collapse:"收起工具栏",expand:"展开工具栏"},textHeight:{title:"字高设置",close:"关闭",ok:"确定",cancel:"取消",adaptive:"自适应屏幕",custom:"自定义字高",customPlaceholder:"世界坐标字高",fromScreen:"按屏幕字号换算",fromScreenHint:"按当前视图缩放,输入希望看到的屏幕字号(像素),换算为固定的世界坐标字高;之后缩放时字的世界高度不变。",screenPxPlaceholder:"屏幕字号",screenUnit:"px",convert:"换算"},entityPick:{cancel:"取消选择"},layers:{title:"图层",close:"关闭图层",showAll:"全部显示",hideAll:"全部隐藏",zoomTo:"缩放到 {name}"},review:{title:"批注",close:"关闭批注面板",searchPlaceholder:"搜索批注",empty:"暂无批注",type:"类型",status:"状态",author:"作者",summary:"摘要",details:"详情",closeDetails:"关闭详情",label:"标签",comment:"评论",zoomTo:"缩放到",delete:"删除",clear:"全部清除",statusValues:{open:"打开",question:"疑问",answered:"已答复",closed:"已关闭"}},measurePanel:{title:"测量",close:"关闭测量面板",filterGroup:"按类型筛选",filterDistance:"距离",filterArc:"弧长",filterRadius:"半径",filterAngle:"角度",filterArea:"面积",empty:"暂无测量",type:"类型",value:"数值",delete:"删除",clear:"全部清除"},session:{length:"长度",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"确定",cancel:"取消",help:"帮助",back:"返回",collapse:"收起",expand:"展开",undo:"撤销"},touchPointTutorial:{title:"怎样可以精确取点?",description:"手指在屏幕上长按0.5s左右,上方出现十字,手指移动时十字跟随移动并自动捕捉。取点更精准。",snoozeToday:"今日不再提醒",hideForever:"不再提醒",ok:"我知道了"},status:{ready:"就绪",zoomWindowHint:"点击两个角点以窗口缩放。",measureDistanceHint:"点击两点以测量距离(已启用对象捕捉)。",measureContinuousHint:"依次点击多个点测量各段距离,点 ✓ 完成。长按可精确捕捉。",measureAreaHint:"依次点击多边形顶点;至少三点后点 ✓ 完成。长按可精确捕捉。",measureAngleHint:"依次点击顶点与两条边上的点(已启用对象捕捉)。",measureArcHint:"点击圆或圆弧可沿其测量;否则依次点击弧起点、弧上一点与弧端点(已启用对象捕捉)。锁定后按 Ctrl(Mac 为 Control 或 ⌘)可在大弧与小弧之间切换。",measureRadiusHint:"点击圆或圆弧以测量半径(已启用对象捕捉)。",measureCoordinateHint:"点击一点以读取其 X/Y 坐标(已启用对象捕捉)。",measureExported:"已导出 {count} 条测量。",measureImported:"已导入 {count} 条测量。",measureImportFailed:"导入测量失败:{error}",markupCloudHint:"点击两个对角点绘制修订云线。",markupCalloutHint:"先点击引线端点,或点击尚无标注的云线/矩形/圆外框,再点击文字位置。",markupTextHint:"点击一点放置文字。",markupRectHint:"点击两个对角点绘制矩形。",markupCircleHint:"先点击圆心,再点击圆周上一点。",markupArrowHint:"先点击起点,再点击箭头端点。",markupStampHint:"点击放置图章(在批准/拒绝等之间循环)。",markupArrowEndHint:"点击箭头端点。",markupRectCornerHint:"点击对角点。",markupCloudCornerHint:"点击对角点。",markupCalloutAnchorHint:"点击文字气泡位置。",markupCircleRadiusHint:"点击圆周上一点。",markupTextPrompt:"输入批注文字",markupTextEditHint:"在画布上输入文字。Enter 完成,Esc 取消。",markupShapeCalloutHint:"点击放置文本框(引线自动贴到图形)。Esc 取消引线和文本框。",markupDefaultLabel:"批注",markupSelected:"已选批注:{type}",markupSelectedCount:"已选批注:{count} 个",markupCount:"批注数:{count}",markupExported:"已导出 {count} 条批注。",markupImported:"已导入 {count} 条批注。",markupImportFailed:"导入批注失败:{error}",distance:"距离:{value}",coordinates:"X:{x} | Y:{y}",angle:"角度:{value}",arcLength:"弧长:{length} | 半径:{radius} | 总角度:{angle} | 弦长:{chord}",radius:"半径:{value}",continuousTotal:"总长度:{value}",area:"面积:{value}",lengthTotal:"长度合计:{value}",areaTotal:"面积合计:{value}",zoomLayer:"缩放:{name}",loadFailed:"无法加载图纸:{error}",noLayout:"快照中没有布局数据。",loadingChunks:"正在加载几何… {loaded}/{total}",loadingOsnap:"正在加载对象捕捉… {loaded}/{total}",buildingOsnap:"正在构建对象捕捉索引…"},package:{title:"打开图纸包",hint:"当前页面同级目录未找到 drawing.acex.json。请选择本地包文件夹,或输入清单 URL。",hintUrlOnly:"当前页面同级目录未找到 drawing.acex.json。请输入清单 URL 以打开图纸包。",chooseFolder:"选择本地文件夹",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"打开 URL",urlRequired:"请输入清单 URL。",manifestNotFound:"当前页面同级目录未找到 drawing.acex.json。",invalidManifest:"包清单无效或版本不受支持:{error}",folderMissingManifest:"所选文件夹必须包含 drawing.acex.json。",folderUnsupported:"当前浏览器无法选择本地包文件夹,请改为输入清单 URL。",loadFailed:"无法打开图纸包:{error}"},access:{title:"受保护的图纸",passwordPrompt:"请输入密码以打开此文件。",passwordPlaceholder:"密码",unlock:"解锁",passwordRequired:"请输入密码。",wrongPassword:"密码错误,请重试。",expired:"此文件已过期,无法打开。",expiredTitle:"文件已过期",expiredDetail:"此文件已于 {time} 过期,无法打开。",expiresAt:"有效期至:{time}",badgeExpires:"有效期至 {time}",badgeCountdown:"剩余 {time}",tooManyAttempts:"密码错误次数过多,请刷新页面后重新输入。"}},cs:{toolbar:{viewerTools:"Nástroje prohlížeče",select:"Výběr",pan:"Posun",zoom:"Přiblížení",zoomExtents:"Rozsah",zoomSmartExtents:"Chytrý",zoomWindow:"Okno",zoomSaved:"Uložený",zoomOriginal:"Uložený",measureDistance:"Vzdálenost",measureContinuous:"Spojité",measureAngle:"Úhel",measureArc:"Oblouk",measureRadius:"Poloměr",measureArea:"Plocha",measureCoordinate:"Souřadnice",clearMeasurements:"Vymazat",measureHide:"Skrýt",measureShow:"Zobrazit",measureImport:"Import",measureExport:"Export",measurementPanel:"Výsledky",measure:"Měření",annotation:"Kontrola",markupCloud:"Obláček",markupCallout:"Odkaz",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupPanel:"Výsledky",markupHide:"Skrýt",markupShow:"Zobrazit",clearMarkups:"Vymazat",markupImport:"Import",markupExport:"Export",snap:"Uchopit",layers:"Hladiny",layout:"Rozvržení",settings:"Nastavení",simulatedMouseOn:"Myš",simulatedMouseOff:"Lupa",themeLight:"Světlý",themeDark:"Tmavý",switchBg:"Pozadí",language:"Jazyk",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů",moreOverflow:"Další nástroje"},settings:{ortho:"Přepnout ortogonální režim",polar:"Úhly polárního trasování",polarAngles:"Úhly polárního trasování"},drawStyle:{color:"Barva",fontSize:"Výška textu",pickerTitle:"Vybrat barvu",close:"Zavřít",ok:"OK",cancel:"Zrušit",index:"Index barvy: ",rgb:"RGB: ",input:"Barva",inputPlaceholder:"1-255 nebo #RRGGBB"},shortCutToolbar:{more:"Více",undo:"Zpět",redo:"Znovu",erase:"Smazat",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů"},textHeight:{title:"Výška textu",close:"Zavřít",ok:"OK",cancel:"Zrušit",adaptive:"Přizpůsobit obrazovce",custom:"Vlastní výška textu",customPlaceholder:"Světová výška",fromScreen:"Ze velikosti na obrazovce",fromScreenHint:"Zadejte, jak velký má text vypadat na obrazovce při aktuálním zoomu. Přepočítá se na pevnou světovou výšku, která se při pozdějším zoomování nemění.",screenPxPlaceholder:"Velikost písma",screenUnit:"px",convert:"Přepočítat"},entityPick:{cancel:"Zrušit výběr"},layers:{title:"Hladiny",close:"Zavřít hladiny",showAll:"Zobrazit vše",hideAll:"Skrýt vše",zoomTo:"Přiblížit na {name}"},review:{title:"Kontrola",close:"Zavřít kontrolu",searchPlaceholder:"Hledat poznámky",empty:"Zatím žádné poznámky",type:"Typ",status:"Stav",author:"Autor",summary:"Souhrn",details:"Podrobnosti",closeDetails:"Zavřít podrobnosti",label:"Popisek",comment:"Komentář",zoomTo:"Přiblížit na",delete:"Odstranit",clear:"Vymazat vše",statusValues:{open:"Otevřeno",question:"Otázka",answered:"Zodpovězeno",closed:"Uzavřeno"}},measurePanel:{title:"Měření",close:"Zavřít měření",filterGroup:"Filtrovat podle typu",filterDistance:"Vzdálenost",filterArc:"Oblouk",filterRadius:"Poloměr",filterAngle:"Úhel",filterArea:"Plocha",empty:"Zatím žádná měření",type:"Typ",value:"Hodnota",delete:"Odstranit",clear:"Vymazat vše"},session:{length:"Délka",angle:"Úhel",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Potvrdit",cancel:"Zrušit",help:"Nápověda",back:"Zpět",collapse:"Sbalit",expand:"Rozbalit",undo:"Zpět"},touchPointTutorial:{title:"Jak přesně vybrat bod?",description:"Podržte prst na obrazovce asi 0,5 sekundy. Nad prstem se objeví kříž, který při pohybu sleduje prst a přichytává se k geometrii pro přesnější výběr.",snoozeToday:"Dnes už nepřipomínat",hideForever:"Už nepřipomínat",ok:"Rozumím"},status:{ready:"Připraveno",zoomWindowHint:"Klikněte na dva rohy pro přiblížení oknem.",measureDistanceHint:"Klikněte na dva body pro změření vzdálenosti (uchopení objektů zapnuto).",measureContinuousHint:"Klepejte na další body pro měření každého úseku; dokončete klepnutím na ✓. Dlouhé stisknutí pro přesné uchopení.",measureAngleHint:"Klikněte na vrchol, poté na dva body na každém rameni (uchopení objektů zapnuto).",measureArcHint:"Klikněte na kružnici nebo oblouk pro měření podél něj, nebo klikněte na začátek, bod na oblouku a konec (uchopení objektů zapnuto). Ctrl (⌘ na Macu) přepíná velký/malý oblouk.",measureRadiusHint:"Klikněte na kružnici nebo oblouk pro změření poloměru (uchopení objektů zapnuto).",measureAreaHint:"Klepejte na vrcholy mnohoúhelníku; dokončete klepnutím na ✓ po alespoň třech bodech.",measureCoordinateHint:"Klikněte na bod pro zobrazení jeho souřadnic X/Y (uchopení objektů zapnuto).",measureExported:"Exportováno {count} měření.",measureImported:"Importováno {count} měření.",measureImportFailed:"Import měření selhal: {error}",markupCloudHint:"Klikněte na dva rohy pro nakreslení obláčku.",markupCalloutHint:"Klikněte na hrot vodítka, nebo na obrys obláčku/obdélníku/kružnice bez odkazu, a poté na kotvu textu.",markupTextHint:"Klikněte pro umístění textu.",markupRectHint:"Klikněte na dva rohy pro nakreslení obdélníku.",markupCircleHint:"Klikněte na střed a poté na bod na kružnici.",markupArrowHint:"Klikněte na začátek a poté na hrot šipky.",markupStampHint:"Klikněte pro umístění razítka (schváleno / zamítnuto / …).",markupArrowEndHint:"Klikněte na hrot šipky.",markupRectCornerHint:"Klikněte na protilehlý roh.",markupCloudCornerHint:"Klikněte na protilehlý roh.",markupCalloutAnchorHint:"Klikněte na pozici textové bubliny.",markupCircleRadiusHint:"Klikněte na bod na kružnici.",markupTextPrompt:"Zadejte text poznámky",markupTextEditHint:"Pište text přímo na plátno. Enter dokončí, Esc zruší.",markupShapeCalloutHint:"Klikněte pro umístění textového pole (vodítko se připojí k tvaru). Esc zruší odkaz.",markupDefaultLabel:"Poznámka",markupSelected:"Vybraná poznámka: {type}",markupSelectedCount:"Vybrané poznámky: {count}",markupCount:"Poznámky: {count}",markupExported:"Exportováno {count} poznámek.",markupImported:"Importováno {count} poznámek.",markupImportFailed:"Import poznámek selhal: {error}",distance:"Vzdálenost: {value}",coordinates:"X: {x} | Y: {y}",angle:"Úhel: {value}",arcLength:"Délka oblouku: {length} | Poloměr: {radius} | Úhel: {angle} | Tětiva: {chord}",radius:"Poloměr: {value}",continuousTotal:"Celková délka: {value}",area:"Plocha: {value}",lengthTotal:"Celková délka: {value}",areaTotal:"Celková plocha: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Nepodařilo se načíst výkres: {error}",noLayout:"Snímek neobsahuje data rozvržení.",loadingChunks:"Načítání geometrie… {loaded}/{total}",loadingOsnap:"Načítání uchopování… {loaded}/{total}",buildingOsnap:"Sestavování indexu uchopování…"},package:{title:"Otevřít balíček výkresu",hint:"Vedle této stránky nebyl nalezen drawing.acex.json. Vyberte místní složku balíčku nebo zadejte URL manifestu.",hintUrlOnly:"Vedle této stránky nebyl nalezen drawing.acex.json. Zadejte URL manifestu pro otevření balíčku.",chooseFolder:"Vybrat místní složku",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Otevřít URL",urlRequired:"Zadejte URL manifestu.",manifestNotFound:"drawing.acex.json nebyl vedle této stránky nalezen.",invalidManifest:"Manifest balíčku je neplatný nebo používá nepodporovanou verzi: {error}",folderMissingManifest:"Vybraná složka musí obsahovat drawing.acex.json.",folderUnsupported:"Tento prohlížeč neumí otevřít místní složku balíčku. Zadejte místo toho URL manifestu.",loadFailed:"Nepodařilo se otevřít balíček: {error}"},access:{title:"Chráněný výkres",passwordPrompt:"Zadejte heslo pro otevření tohoto souboru.",passwordPlaceholder:"Heslo",unlock:"Odemknout",passwordRequired:"Zadejte heslo.",wrongPassword:"Nesprávné heslo. Zkuste to znovu.",expired:"Platnost tohoto souboru vypršela a nelze jej otevřít.",expiredTitle:"Soubor vypršel",expiredDetail:"Platnost tohoto souboru vypršela dne {time} a již jej nelze otevřít.",expiresAt:"Platnost do: {time}",badgeExpires:"Platnost do {time}",badgeCountdown:"Vyprší za {time}",tooManyAttempts:"Příliš mnoho nesprávných pokusů o heslo. Obnovte stránku a zkuste to znovu."}},tr:{toolbar:{viewerTools:"Görüntüleyici araçları",select:"Seç",pan:"Kaydır",zoom:"Yakınlaştır",zoomExtents:"Sınırlar",zoomSmartExtents:"Akıllı",zoomWindow:"Pencere",zoomSaved:"Kayıtlı",zoomOriginal:"Kayıtlı",measureDistance:"Mesafe",measureContinuous:"Sürekli",measureAngle:"Açı",measureArc:"Yay",measureRadius:"Yarıçap",measureArea:"Alan",measureCoordinate:"XY",clearMeasurements:"Temizle",measureHide:"Gizle",measureShow:"Göster",measureImport:"İçe aktar",measureExport:"Dışa aktar",measurementPanel:"Sonuç",measure:"Ölçüm",annotation:"İnceleme",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupPanel:"Sonuç",markupHide:"Gizle",markupShow:"Göster",clearMarkups:"Temizle",markupImport:"İçe aktar",markupExport:"Dışa aktar",snap:"Yakalama",layers:"Katman",layout:"Düzen",settings:"Ayarlar",simulatedMouseOn:"Fare",simulatedMouseOff:"Büyüteç",themeLight:"Açık",themeDark:"Koyu",switchBg:"Arka plan",language:"Dil",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet",moreOverflow:"Diğer araçlar"},settings:{ortho:"Dik modu aç/kapat",polar:"Kutupsal izleme açıları",polarAngles:"Kutupsal izleme açıları"},drawStyle:{color:"Renk",fontSize:"Yazı yüksekliği",pickerTitle:"Renk Seç",close:"Kapat",ok:"Tamam",cancel:"İptal",index:"Renk İndeksi: ",rgb:"RGB: ",input:"Renk",inputPlaceholder:"1-255 veya #RRGGBB"},shortCutToolbar:{more:"Daha fazla",undo:"Geri al",redo:"Yinele",erase:"Sil",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet"},textHeight:{title:"Yazı Yüksekliği",close:"Kapat",ok:"Tamam",cancel:"İptal",adaptive:"Ekrana uyarla",custom:"Özel yazı yüksekliği",customPlaceholder:"Dünya yüksekliği",fromScreen:"Ekran boyutundan",fromScreenHint:"Geçerli yakınlaştırmada ekranda istediğiniz yazı boyutunu girin. Sabit bir dünya yüksekliğine dönüştürülür; sonra yakınlaştırınca bu yükseklik değişmez.",screenPxPlaceholder:"Yazı boyutu",screenUnit:"px",convert:"Dönüştür"},entityPick:{cancel:"Seçimi iptal et"},layers:{title:"Katmanlar",close:"Katmanları kapat",showAll:"Tümünü göster",hideAll:"Tümünü gizle",zoomTo:"{name} katmanına yakınlaştır"},review:{title:"İnceleme",close:"İncelemeyi kapat",searchPlaceholder:"İşaretlerde ara",empty:"Henüz işaret yok",type:"Tür",status:"Durum",author:"Yazar",summary:"Özet",details:"Ayrıntılar",closeDetails:"Ayrıntıları kapat",label:"Etiket",comment:"Yorum",zoomTo:"Yakınlaştır",delete:"Sil",clear:"Tümünü temizle",statusValues:{open:"Açık",question:"Soru",answered:"Yanıtlandı",closed:"Kapalı"}},measurePanel:{title:"Ölçümler",close:"Ölçümleri kapat",filterGroup:"Türe göre filtrele",filterDistance:"Mesafe",filterArc:"Yay",filterRadius:"Yarıçap",filterAngle:"Açı",filterArea:"Alan",empty:"Henüz ölçüm yok",type:"Tür",value:"Değer",delete:"Sil",clear:"Tümünü temizle"},session:{length:"Uzunluk",angle:"Açı",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Onayla",cancel:"İptal",help:"Yardım",back:"Geri",collapse:"Daralt",expand:"Genişlet",undo:"Geri al"},touchPointTutorial:{title:"Noktalar nasıl hassas seçilir?",description:"Ekranda yaklaşık 0,5 saniye basılı tutun. Parmağınızın üstünde bir artı belirir ve hareket ederken geometriye yapışarak daha doğru seçim yapmanızı sağlar.",snoozeToday:"Bugün tekrar hatırlatma",hideForever:"Bir daha hatırlatma",ok:"Anladım"},status:{ready:"Hazır",zoomWindowHint:"Pencere yakınlaştırmak için iki köşeyi tıklayın.",measureDistanceHint:"Mesafe ölçmek için iki nokta tıklayın (nesne yakalama etkin).",measureContinuousHint:"Her segmenti ölçmek için ardışık noktalar dokunun; bitirmek için ✓. Hassas yakalama için basılı tutun.",measureAngleHint:"Önce köşe noktasını, sonra her koldan birer nokta tıklayın (nesne yakalama etkin).",measureArcHint:"Ölçmek için bir çember veya yaya tıklayın; ya da yay başlangıcı, yay üzerindeki bir nokta ve yay sonunu tıklayın (nesne yakalama etkin). Ctrl (Mac’te ⌘) büyük/küçük yay arasında geçiş yapar.",measureRadiusHint:"Yarıçap ölçmek için bir çember veya yaya tıklayın (nesne yakalama etkin).",measureAreaHint:"Çokgen köşelerini dokunun; en az üç noktadan sonra bitirmek için ✓.",measureCoordinateHint:"X/Y koordinatlarını okumak için bir nokta tıklayın (nesne yakalama etkin).",measureExported:"{count} ölçüm dışa aktarıldı.",measureImported:"{count} ölçüm içe aktarıldı.",measureImportFailed:"Ölçüm içe aktarılamadı: {error}",markupCloudHint:"Revizyon bulutu çizmek için iki köşe tıklayın.",markupCalloutHint:"Lider ucunu veya çağrısı olmayan bulut/dikdörtgen/daire dış çerçevesini tıklayın, ardından metin konumunu tıklayın.",markupTextHint:"Metin yerleştirmek için bir nokta tıklayın.",markupRectHint:"Dikdörtgen çizmek için iki köşe tıklayın.",markupCircleHint:"Önce merkezi, sonra çevre üzerindeki bir noktayı tıklayın.",markupArrowHint:"Önce başlangıcı, sonra ok ucunu tıklayın.",markupStampHint:"Damga yerleştirmek için tıklayın (onaylandı / reddedildi / …).",markupArrowEndHint:"Ok ucunu tıklayın.",markupRectCornerHint:"Karşı köşeyi tıklayın.",markupCloudCornerHint:"Karşı köşeyi tıklayın.",markupCalloutAnchorHint:"Metin balonu konumunu tıklayın.",markupCircleRadiusHint:"Çevre üzerindeki bir noktayı tıklayın.",markupTextPrompt:"İşaretleme metnini girin",markupTextEditHint:"Metni tuval üzerinde yazın. Enter ile bitirin, Esc ile iptal edin.",markupShapeCalloutHint:"Metin kutusunu yerleştirmek için tıklayın (lider şekle bağlanır). Esc çağrıyı iptal eder.",markupDefaultLabel:"Not",markupSelected:"Seçili işaretleme: {type}",markupSelectedCount:"Seçili işaretlemeler: {count}",markupCount:"İşaretlemeler: {count}",markupExported:"{count} işaretleme dışa aktarıldı.",markupImported:"{count} işaretleme içe aktarıldı.",markupImportFailed:"İşaretleme içe aktarılamadı: {error}",distance:"Mesafe: {value}",coordinates:"X: {x} | Y: {y}",angle:"Açı: {value}",arcLength:"Yay uzunluğu: {length} | Yarıçap: {radius} | Açı: {angle} | Kiriş: {chord}",radius:"Yarıçap: {value}",continuousTotal:"Toplam uzunluk: {value}",area:"Alan: {value}",lengthTotal:"Toplam uzunluk: {value}",areaTotal:"Toplam alan: {value}",zoomLayer:"Yakınlaştır: {name}",loadFailed:"Çizim yüklenemedi: {error}",noLayout:"Anlık görüntüde yerleşim verisi yok.",loadingChunks:"Geometri yükleniyor… {loaded}/{total}",loadingOsnap:"Nesne yakalama yükleniyor… {loaded}/{total}",buildingOsnap:"Nesne yakalama dizini oluşturuluyor…"},package:{title:"Çizim paketini aç",hint:"Bu sayfanın yanında drawing.acex.json bulunamadı. Yerel bir paket klasörü seçin veya manifesto URL’sini girin.",hintUrlOnly:"Bu sayfanın yanında drawing.acex.json bulunamadı. Paketi açmak için manifesto URL’sini girin.",chooseFolder:"Yerel klasör seç",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL aç",urlRequired:"Lütfen bir manifesto URL’si girin.",manifestNotFound:"Bu sayfanın yanında drawing.acex.json bulunamadı.",invalidManifest:"Paket manifestosu geçersiz veya desteklenmeyen bir sürüm kullanıyor: {error}",folderMissingManifest:"Seçilen klasör drawing.acex.json içermelidir.",folderUnsupported:"Bu tarayıcı yerel paket klasörü açamıyor. Bunun yerine manifesto URL’si yapıştırın.",loadFailed:"Paket açılamadı: {error}"},access:{title:"Korumalı çizim",passwordPrompt:"Bu dosyayı açmak için parolayı girin.",passwordPlaceholder:"Parola",unlock:"Kilidi aç",passwordRequired:"Lütfen bir parola girin.",wrongPassword:"Parola yanlış. Tekrar deneyin.",expired:"Bu dosyanın süresi doldu ve artık açılamaz.",expiredTitle:"Dosyanın süresi doldu",expiredDetail:"Bu dosyanın süresi {time} tarihinde doldu ve artık açılamaz.",expiresAt:"Son geçerlilik: {time}",badgeExpires:"Son geçerlilik {time}",badgeCountdown:"Kalan süre {time}",tooManyAttempts:"Çok fazla yanlış parola denemesi yapıldı. Tekrar denemek için sayfayı yenileyin."}}},ja:_l,ko:Bl,ar:{toolbar:{viewerTools:"أدوات العارض",select:"تحديد",pan:"تحريك",zoom:"تكبير/تصغير",zoomExtents:"ملاءمة",zoomSmartExtents:"ذكية",zoomWindow:"نافذة",zoomSaved:"محفوظ",zoomOriginal:"محفوظ",measureDistance:"مسافة",measureContinuous:"مستمر",measureAngle:"زاوية",measureArc:"قوس",measureRadius:"نصف القطر",measureArea:"مساحة",measureCoordinate:"إحداثيات",clearMeasurements:"مسح",measureHide:"إخفاء",measureShow:"إظهار",measureImport:"استيراد",measureExport:"تصدير",measurementPanel:"نتائج",measure:"قياس",annotation:"مراجعة",markupCloud:"سحابة",markupCallout:"تعليق",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupPanel:"نتائج",markupHide:"إخفاء",markupShow:"إظهار",clearMarkups:"مسح",markupImport:"استيراد",markupExport:"تصدير",snap:"التقاط",layers:"طبقات",layout:"تخطيط",settings:"إعدادات",simulatedMouseOn:"ماوس",simulatedMouseOff:"عدسة",themeLight:"فاتح",themeDark:"داكن",switchBg:"خلفية",language:"اللغة",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",localeJa:"日本語",localeKo:"한국어",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات",moreOverflow:"المزيد من الأدوات"},settings:{ortho:"تبديل الوضع المتعامد",polar:"زوايا التتبع القطبي",polarAngles:"زوايا التتبع القطبي"},drawStyle:{color:"اللون",fontSize:"ارتفاع النص",pickerTitle:"تحديد اللون",close:"إغلاق",ok:"موافق",cancel:"إلغاء",index:"فهرس اللون: ",rgb:"RGB: ",input:"اللون",inputPlaceholder:"1-255 أو #RRGGBB"},shortCutToolbar:{more:"المزيد",undo:"تراجع",redo:"إعادة",erase:"حذف",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات"},textHeight:{title:"ارتفاع النص",close:"إغلاق",ok:"موافق",cancel:"إلغاء",adaptive:"ملاءمة الشاشة",custom:"ارتفاع نص مخصص",customPlaceholder:"ارتفاع العالم",fromScreen:"من حجم الشاشة",fromScreenHint:"أدخل حجم النص المطلوب على الشاشة عند التكبير الحالي. يُحوَّل إلى ارتفاع ثابت في إحداثيات الرسم ويبقى كما هو عند تغيير التكبير لاحقًا.",screenPxPlaceholder:"حجم الخط",screenUnit:"px",convert:"تحويل"},entityPick:{cancel:"إلغاء التحديد"},layers:{title:"الطبقات",close:"إغلاق الطبقات",showAll:"إظهار الكل",hideAll:"إخفاء الكل",zoomTo:"تكبير إلى {name}"},review:{title:"مراجعة",close:"إغلاق المراجعة",searchPlaceholder:"البحث في الملاحظات",empty:"لا توجد ملاحظات بعد",type:"النوع",status:"الحالة",author:"المؤلف",summary:"الملخص",details:"التفاصيل",closeDetails:"إغلاق التفاصيل",label:"التسمية",comment:"التعليق",zoomTo:"تكبير إلى",delete:"حذف",clear:"مسح الكل",statusValues:{open:"مفتوح",question:"سؤال",answered:"تمت الإجابة",closed:"مغلق"}},measurePanel:{title:"القياسات",close:"إغلاق القياسات",filterGroup:"التصفية حسب النوع",filterDistance:"مسافة",filterArc:"قوس",filterRadius:"نصف القطر",filterAngle:"زاوية",filterArea:"مساحة",empty:"لا توجد قياسات حتى الآن",type:"النوع",value:"القيمة",delete:"حذف",clear:"مسح الكل"},session:{length:"الطول",angle:"الزاوية",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"تأكيد",cancel:"إلغاء",help:"مساعدة",back:"رجوع",collapse:"طي",expand:"توسيع",undo:"تراجع"},touchPointTutorial:{title:"كيف أختار النقاط بدقة؟",description:"اضغط مطولاً على الشاشة لمدة نصف ثانية تقريباً. يظهر صليب فوق إصبعك ويتبعه أثناء الحركة ويلتقط إلى الهندسة لاختيار أدق.",snoozeToday:"لا تذكرني اليوم",hideForever:"لا تذكرني مرة أخرى",ok:"فهمت"},status:{ready:"جاهز",zoomWindowHint:"انقر على ركنين لتحديد نافذة التكبير.",measureDistanceHint:"انقر على نقطتين لقياس المسافة (التقاط الكائنات مفعّل).",measureContinuousHint:"انقر على نقاط متتالية لقياس كل قطعة؛ انقر ✓ للإنهاء. اضغط مطولاً للالتقاط الدقيق.",measureAngleHint:"انقر على رأس الزاوية، ثم نقطة على كل ضلع (التقاط الكائنات مفعّل).",measureArcHint:"انقر على دائرة أو قوس للقياس عليه، أو انقر على نقطة البداية ثم نقطة على القوس ثم نقطة النهاية (التقاط الكائنات مفعّل). استخدم Ctrl (⌘ على Mac) للتبديل بين القوس الأكبر والأصغر.",measureRadiusHint:"انقر على دائرة أو قوس لقياس نصف القطر (التقاط الكائنات مفعّل).",measureAreaHint:"انقر على رؤوس المضلع؛ انقر ✓ للإنهاء بعد ثلاث نقاط على الأقل.",measureCoordinateHint:"انقر على نقطة لقراءة إحداثيات X/Y الخاصة بها (التقاط الكائنات مفعّل).",measureExported:"تم تصدير {count} من القياسات.",measureImported:"تم استيراد {count} من القياسات.",measureImportFailed:"فشل استيراد القياسات: {error}",markupCloudHint:"انقر على ركنين لرسم سحابة مراجعة.",markupCalloutHint:"انقر على طرف خط الإشارة، أو على إطار سحابة/مستطيل/دائرة بدون تعليق توضيحي، ثم موضع النص.",markupTextHint:"انقر على نقطة لوضع النص.",markupRectHint:"انقر على ركنين لرسم مستطيل.",markupCircleHint:"انقر على المركز، ثم على نقطة على المحيط.",markupArrowHint:"انقر على نقطة البداية، ثم على رأس السهم.",markupStampHint:"انقر لوضع ختم (يتنقل بين معتمد / مرفوض / …).",markupArrowEndHint:"انقر على رأس السهم.",markupRectCornerHint:"انقر على الركن المقابل.",markupCloudCornerHint:"انقر على الركن المقابل.",markupCalloutAnchorHint:"انقر على موضع فقاعة النص.",markupCircleRadiusHint:"انقر على نقطة على المحيط.",markupTextPrompt:"أدخل نص الملاحظة",markupTextEditHint:"اكتب النص على مساحة الرسم. اضغط Enter للإنهاء أو Esc للإلغاء.",markupShapeCalloutHint:"انقر لوضع مربع النص (يتصل خط الإشارة بالشكل). اضغط Esc لإلغاء التعليق التوضيحي.",markupDefaultLabel:"ملاحظة",markupSelected:"الملاحظة المحددة: {type}",markupSelectedCount:"الملاحظات المحددة: {count}",markupCount:"عدد الملاحظات: {count}",markupExported:"تم تصدير {count} من الملاحظات.",markupImported:"تم استيراد {count} من الملاحظات.",markupImportFailed:"فشل استيراد الملاحظات: {error}",distance:"المسافة: {value}",coordinates:"X: {x} | Y: {y}",angle:"الزاوية: {value}",arcLength:"طول القوس: {length} | نصف القطر: {radius} | الزاوية: {angle} | الوتر: {chord}",radius:"نصف القطر: {value}",continuousTotal:"إجمالي الطول: {value}",area:"المساحة: {value}",lengthTotal:"إجمالي الطول: {value}",areaTotal:"إجمالي المساحة: {value}",zoomLayer:"تكبير: {name}",loadFailed:"فشل تحميل الرسم: {error}",noLayout:"لا توجد بيانات تخطيط في اللقطة.",loadingChunks:"جاري تحميل الهندسة… {loaded}/{total}",loadingOsnap:"جاري تحميل الالتقاط… {loaded}/{total}",buildingOsnap:"جاري بناء فهرس الالتقاط…"},package:{title:"فتح حزمة الرسم",hint:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. اختر مجلد الحزمة المحلي أو أدخل عنوان URL للقائمة.",hintUrlOnly:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. أدخل عنوان URL للقائمة لفتح الحزمة.",chooseFolder:"اختيار مجلد محلي",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"فتح الرابط",urlRequired:"يرجى إدخال عنوان URL للقائمة.",manifestNotFound:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة.",invalidManifest:"قائمة الحزمة غير صالحة أو تستخدم إصداراً غير مدعوم: {error}",folderMissingManifest:"يجب أن يحتوي المجلد المحدد على drawing.acex.json.",folderUnsupported:"لا يمكن لهذا المتصفح فتح مجلد حزمة محلي. الصق عنوان URL للقائمة بدلاً من ذلك.",loadFailed:"تعذر فتح الحزمة: {error}"},access:{title:"رسم محمي",passwordPrompt:"أدخل كلمة المرور لفتح هذا الملف.",passwordPlaceholder:"كلمة المرور",unlock:"فتح",passwordRequired:"يرجى إدخال كلمة المرور.",wrongPassword:"كلمة المرور غير صحيحة. حاول مرة أخرى.",expired:"انتهت صلاحية هذا الملف ولا يمكن فتحه.",expiredTitle:"انتهت صلاحية الملف",expiredDetail:"انتهت صلاحية هذا الملف في {time} ولا يمكن فتحه.",expiresAt:"ينتهي في: {time}",badgeExpires:"ينتهي في {time}",badgeCountdown:"متبقي {time}",tooManyAttempts:"عدد محاولات إدخال كلمة المرور كبير جدًا. قم بتحديث الصفحة للمحاولة مرة أخرى."}}};function Tl(e){return he.includes(e)}function Ae(e){if(e==null||e==="")return null;const t=e.toLowerCase().replace("_","-");for(const n of he)if(t===n||t.startsWith(`${n}-`))return n;return null}function Ja(){if(typeof navigator>"u")return"en";const e=[...navigator.languages??[],navigator.language].filter(Boolean);for(const t of e){const n=Ae(t);if(n)return n}return"en"}function Qa(){if(typeof localStorage<"u")try{const e=localStorage.getItem(Kn),t=Ae(e);if(t)return t}catch{}return Ja()}function eo(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r=="string")return;r=r[a]}return typeof r=="string"?r:void 0}function to(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const a=t[r];return a!=null?String(a):`{${r}}`}):e}class zl{constructor(t){this._onChange=null,this._locale=t??Qa()}get locale(){return this._locale}get localeBadge(){return jn[this._locale]}setOnChange(t){this._onChange=t}t(t,n){const r=eo(Zn[this._locale],t)??eo(Zn.en,t)??t;return to(r,n)}toggleLocale(){const t=he.indexOf(this._locale),n=he[(t+1)%he.length];return this.setLocale(n),n}setLocale(t){var n;if(this._locale!==t){this._locale=t,typeof document<"u"&&(document.documentElement.lang=t);try{typeof localStorage<"u"&&localStorage.setItem(Kn,t)}catch{}this.applyToDocument(),(n=this._onChange)==null||n.call(this)}}applyToDocument(t){if(typeof document>"u")return;const n=t??document;document.documentElement.lang=this._locale,n.querySelectorAll("[data-i18n-text]").forEach(a=>{const o=a.dataset.i18nKey;o&&(a.textContent=this.t(o))}),n.querySelectorAll("[data-i18n-attr]").forEach(a=>{var s;const o=a.dataset.i18nKey,i=((s=a.dataset.i18nAttr)==null?void 0:s.split(/\s+/))??[];if(!o||i.length===0)return;const l=this.t(o);for(const c of i)a.setAttribute(c,l)});const r=document.getElementById("mlcad-lang-badge");r&&(r.textContent=this.localeBadge)}}const Wn=1128612673,no=1e5;function Ge(e){if(e.version!==R)throw new Error(`Unsupported chunk version: ${e.version}`);const t=new st;t.writeU32(Wn),t.writeU8(R),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeString(e.layoutBtrId),t.writeU32(e.lineBatches.length);for(const n of e.lineBatches)bn(t,n);t.writeU32(e.meshBatches.length);for(const n of e.meshBatches)Ln(t,n);return t.toUint8Array()}function qn(e){const t=new lt(e);if(t.readU32()!==Wn)throw new Error("Invalid chunk magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==R)throw new Error(`Unsupported chunk version: ${r}`);const a=t.readString(),o=t.readU32();if(o>no)throw new Error("Chunk line batch count exceeds limit");const i=[];for(let c=0;c<o;c++)i.push(kn(t));const l=t.readU32();if(l>no)throw new Error("Chunk mesh batch count exceeds limit");const s=[];for(let c=0;c<l;c++)s.push(An(t));return{version:R,layoutBtrId:a,lineBatches:i,meshBatches:s}}function ro(e){const t=Ge(e),n=we(t).bytes;return{uncompressed:t,compressed:n}}async function Fl(e){const t=Ge(e),n=(await hn(t)).bytes;return{uncompressed:t,compressed:n}}function ao(e){return qn(ut(e))}function Jn(e){return gn(e)?ao(e):qn(e)}const Qn=1,oo=2*1024*1024,$e=2*1024*1024,Ol=512*1024,io=8*1024*1024,er=12*1024*1024,so=2*1024*1024,Nt=6;function Xt(e,t,n){const r=e.length,a=r>0?Math.max(1,Math.min(Number.isFinite(t)?Math.floor(t):1,r)):0,o=new Array(r);let i=0,l=0;const s=c=>{const d=Promise.resolve().then(()=>n(e[c],c));d.catch(()=>{}),o[c]=d,i+=1};for(;i<a;)s(i);return{async next(){if(l>=r)return null;const c=l;l+=1;const d=await o[c];return i<r&&s(i),{item:e[c],index:c,bytes:d}}}}const Rl=/^(?:\.[/\\])?[A-Za-z0-9._-]+(?:[/\\][A-Za-z0-9._-]+)*$/;function lo(e){const t=e.trim();return!t||t!==e||t.startsWith("/")||t.startsWith("\\")||t.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.includes("..")||t.includes("\\")?!1:Rl.test(t)}function Vt(e,t){if(!lo(e))throw new Error(`Invalid ${t}: must be a relative package path`)}function je(e){if(!e||typeof e!="object")throw new Error("Invalid package manifest");const t=e;if(t.format!=="acex-package")throw new Error("Unsupported package format");if(t.packageVersion!==Qn)throw new Error(`Unsupported package version: ${String(t.packageVersion)}`);if(t.snapshotVersion!==R)throw new Error(`Unsupported snapshot version: ${String(t.snapshotVersion)}`);if(!Array.isArray(t.layouts)||!Array.isArray(t.chunks))throw new Error("Invalid package manifest structure");for(const n of t.chunks){if(!n||typeof n!="object")throw new Error("Invalid package chunk entry");Vt(n.href,"chunk href")}for(const n of t.osnapChunks??[]){if(!n||typeof n!="object")throw new Error("Invalid package osnap chunk entry");Vt(n.href,"osnap chunk href")}return t}function co(e){return{version:R,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:e.layouts.map(t=>({btrId:t.btrId,name:t.name,isModelSpace:t.isModelSpace,lineBatches:[],meshBatches:[],viewports:t.viewports,...t.savedView?{savedView:t.savedView}:{},...t.fitExtents?{fitExtents:t.fitExtents}:{}}))}}function Yt(e,t){Vt(t,"chunk href");let n,r;try{n=new URL(t,e),r=new URL(e)}catch{throw new Error("Invalid chunk or manifest URL")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("Chunk URL must share the manifest origin");const a=r.pathname.replace(/[^/]*$/,""),o=n.pathname;if(!o.startsWith(a))throw new Error("Chunk URL escapes package directory");if(o.split("/").includes(".."))throw new Error("Chunk URL escapes package directory");return n.toString()}function uo(e,t){Vt(e,"manifestUrl");let n,r;try{n=new URL(e,t),r=new URL(t)}catch{throw new Error("Invalid manifestUrl")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("manifestUrl must be same-origin");return n.toString()}async function tr(e,t,n){const r=await e(t);if(!r.ok)throw new Error(`Failed to load ${n} (${r.status})`);const a=r.headers.get("content-length");if(a!=null){const i=Number(a);if(Number.isFinite(i)&&i>dt)throw new Error(`${n} exceeds size limit`)}const o=await r.arrayBuffer();if(o.byteLength>dt)throw new Error(`${n} exceeds size limit`);return new Uint8Array(o)}async function Dl(e){var p;const t=e.fetchImpl??Ze,n=e.loadOsnap!==!1,r=e.fetchConcurrency??Nt,a=await t(e.manifestUrl);if(!a.ok)throw new Error(`Failed to load package manifest (${a.status})`);const o=je(await a.json()),i=co(o),l=new Map(i.layouts.map(f=>[f.btrId,f])),s=e.layoutFilter==null?null:e.layoutFilter instanceof Set?e.layoutFilter:new Set(e.layoutFilter),c=o.chunks.filter(f=>s==null||s.has(f.layoutBtrId)),d=Xt(c,r,f=>tr(t,Yt(e.manifestUrl,f.href),"geometry chunk"));let u=0;for(;;){const f=await d.next();if(!f)break;const h=f.item,g=l.get(h.layoutBtrId);if(!g)throw new Error("Unknown layout for package chunk");const x=Jn(f.bytes);if(x.layoutBtrId!==h.layoutBtrId)throw new Error("Chunk layout mismatch");po(g,x.lineBatches,x.meshBatches),u+=1,await((p=e.onChunk)==null?void 0:p.call(e,g,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:h.layoutBtrId,chunkId:h.id}))}if(n)for(const f of o.layouts){if(s!=null&&!s.has(f.btrId))continue;const h=l.get(f.btrId);h&&await mo(o,e.manifestUrl,f.btrId,h,{fetchImpl:t})}return i}async function Ul(e,t,n,r,a={}){var p;const o=a.fetchImpl??Ze,i=a.fetchConcurrency??Nt,l=e.layouts.find(f=>f.btrId===n);if(!l)throw new Error(`Layout not found: ${n}`);const s=new Map(e.chunks.map(f=>[f.id,f])),c=l.chunkIds.map(f=>s.get(f)).filter(f=>f!=null),d=Xt(c,i,f=>tr(o,Yt(t,f.href),"geometry chunk"));let u=0;for(;;){const f=await d.next();if(!f)break;const h=f.item,g=Jn(f.bytes);po(r,g.lineBatches,g.meshBatches),u+=1,await((p=a.onChunk)==null?void 0:p.call(a,r,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:n,chunkId:h.id}))}}async function mo(e,t,n,r,a={}){var v;if(r.osnap)return;const o=e.layouts.find(y=>y.btrId===n);if(!o)return;const i=o.osnapChunkIds;if(!i||i.length===0)return;const l=new Map((e.osnapChunks??[]).map(y=>[y.id,y])),s=i.map(y=>l.get(y)).filter(y=>y!=null);if(s.length===0)return;const c=a.fetchImpl??Ze,d=a.fetchConcurrency??Nt,u=a.yieldFn??(()=>new Promise(y=>{setTimeout(y,0)})),p=s.reduce((y,b)=>y+b.primitiveCount,0),f=p>0?new Array(p):[];let h=0;const g=Xt(s,d,y=>tr(c,Yt(t,y.href),"osnap chunk"));let x=0;for(;;){const y=await g.next();if(!y)break;const b=y.item,E=na(y.bytes).primitives;if(p>0)for(let H=0;H<E.length;H++)f[h++]=E[H];else for(const H of E)f.push(H);x+=1,await((v=a.onChunk)==null?void 0:v.call(a,{loadedChunks:x,totalChunks:s.length,layoutBtrId:n,chunkId:b.id})),await u()}p>0&&h!==p&&(f.length=h),r.osnap={primitives:f}}function po(e,t,n){e.lineBatches.push(...t),e.meshBatches.push(...n)}const ne="drawing.acex.json",nr=`./${ne}`,fo=["manifest","acex"],Ke="https://acex-package.invalid/",Ze=(e,t)=>globalThis.fetch(e,t);function Nl(e){return e.directoryPicker||e.webkitDirectory}function Xl(e){const t=(e==null?void 0:e.hasDirectoryPicker)??typeof globalThis.showDirectoryPicker=="function",n=(e==null?void 0:e.isSecureContext)??(typeof globalThis.isSecureContext=="boolean"?globalThis.isSecureContext:!0);let r=e==null?void 0:e.supportsWebkitDirectoryAttribute;if(r==null&&(r=!1,typeof document<"u")){const a=document.createElement("input");a.type="file",r="webkitdirectory"in a||"directory"in a}return{directoryPicker:t&&n,webkitDirectory:r}}function ho(e){var r;const t=e.startsWith("?")?e.slice(1):e;if(!t)return null;let n;try{n=new URLSearchParams(t)}catch{return null}for(const a of fo){const o=(r=n.get(a))==null?void 0:r.trim();if(o)return o}return null}function Vl(e){var r;const t=ho(e.search??"");if(t)return{href:t,fromQuery:!0};const n=(r=e.configManifestUrl)==null?void 0:r.trim();return n?{href:n,fromQuery:!1}:{href:nr,fromQuery:!1}}function go(e){return/^https?:\/\//i.test(e.trim())}function Yl(e,t){const n=e.trim();if(!n)throw new Error("Missing manifest URL");if(go(n))try{return new URL(n).toString()}catch{throw new Error("Invalid manifest URL")}return uo(n,t)}async function Gl(e,t=Ze){let n;try{n=await t(e)}catch(a){return{ok:!1,reason:"network",error:a instanceof Error?a:new Error(String(a))}}if(n.status===404||n.status===410)return{ok:!1,reason:"not-found",error:new Error(`Failed to load package manifest (${n.status})`)};if(!n.ok)return{ok:!1,reason:"network",error:new Error(`Failed to load package manifest (${n.status})`)};let r;try{r=await n.json()}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error("Invalid package manifest JSON")}}try{return{ok:!0,manifest:je(r)}}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error(String(a))}}}function yo(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");if(t){const r=t.replace(/\\/g,"/").replace(/\/+$/,"");n===r?n="":n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n.replace(/^\.\//,"")}function xo(e){const t=[...e].map(o=>o.replace(/\\/g,"/").replace(/^\/+/,"")).filter(Boolean);if(t.length===0)return null;const n=t[0].split("/")[0];return!n||n===ne||!t.every(o=>o.split("/")[0]===n)?null:t.some(o=>o.includes("/"))?n:null}function $l(e){const t=[...e],n=xo(t.map(a=>a.relativePath)),r=new Map;for(const a of t){const o=yo(a.relativePath,n);!o||o.endsWith("/")||r.set(o,a.bytes)}return r}function jl(e,t){const n=(t==null?void 0:t.manifestFileName)??ne;if(!e.has(n))throw new Error(`Missing ${n} in selected folder`);const r=new URL(n,Ke).toString(),a=new URL(Ke).origin;return{manifestUrl:r,fetchImpl:async i=>{const l=new URL(String(i));if(l.origin!==a)return new Response(null,{status:404});const s=decodeURIComponent(l.pathname.replace(/^\/+/,"")),c=e.get(s);if(!c)return new Response(null,{status:404});if(s.endsWith(".json")){const u=new TextDecoder().decode(c);return new Response(u,{status:200,headers:{"Content-Type":"application/json"}})}const d=new Uint8Array(c.byteLength);return d.set(c),new Response(d,{status:200})}}}function Kl(e){return e.has(ne)?ne:null}function rr(...e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${e.map(n=>`<path fill="currentColor" d="${n}"/>`).join("")}</svg>`}const Zl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.4379 15.2979h.002l4.86-4.86-9.722-4.86 4.86 9.72Zm7.562-5.298-3.434 3.434 3.2 3.2-1.132 1.132-3.2-3.2-3.434 3.434-7.6-15.6 15.6 7.6Z"/></svg>',Wl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.08 12.8537l.002-.002V5.5897c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.6381-.414-.6381 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.4437c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.2317c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388-.26-.446-.518-.892-.776-1.338-.338-.482-1.1-.15-.794.38.326.566.652 1.132.978 1.698.006.012.014.026.02.04.552.946 1.106 1.89 1.658 2.834.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.7921-.124 2.5601-.612.3-.19.572-.416.816-.68.326-.368.57-.776.734-1.204.176-.482.258-.97.258-1.494Zm-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894-.216.564-.53 1.114-.964 1.576-.318.34-.666.632-1.046.884-.978.612-2.1461.862-3.2601.774-1.128-.102-2.228-.564-3.098-1.352-.326-.292-.612-.646-.87-1.034-.558-.96-1.114-1.92-1.672-2.88l-.012-.028c-.326-.568-.652-1.138-.978-1.706-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096.04.074.082.146.122.218V4.2337c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.9721-.51 2.2221.102 2.2221 1.284v.06c.022-.014.046-.026.068-.04Z"/></svg>',wo='<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"/>',ql=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${wo}</svg>`,vo='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.0833 14.8083c1.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-.6917C.8417 12.3667.9417 7.275 4.1083 4.1083 7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Zm-3.55-2.6083V7.2083H7.2083v5.5833h5.5833ZM5.875 5.875h8.25v8.25H5.875V5.875Z"/></svg>',Jl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65l-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.48l-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>',Ql='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="2" y="2" width="8.2" height="5" rx="1.2" fill="currentColor"/><rect x="2" y="8.5" width="8.2" height="9.5" rx="1.2" fill="currentColor"/><rect x="11.7" y="2" width="6.3" height="10" rx="1.2" fill="currentColor"/><rect x="11.7" y="13.5" width="6.3" height="4.5" rx="1.2" fill="currentColor"/></svg>',ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M1.5 7h17v6h-17ZM4.25 7h1v2.5h-1ZM7.5 7h.75v1.5H7.5ZM10.25 7h1v2.5h-1ZM13.5 7h.75v1.5H13.5ZM16.25 7h1v2.5h-1Z"/></svg>',tc='<polygon fill="currentColor" points="17 15 17 17 16 17 16 15 14 15 14 18 13 18 13 15 11 15 11 17 10 17 10 15 8 15 8 18 7 18 7 15 5 15 5 17 4 17 4 15 2 15 2 19 18 19 18 15 17 15"/>',me="var(--el-color-primary, var(--ml-ui-accent, #409eff))";function ge(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${e}${tc}</svg>`}const bo='<rect fill="currentColor" x="2" y="5" width="1" height="8"/><rect fill="currentColor" x="17" y="5" width="1" height="8"/><polygon fill="currentColor" points="3 8.5 7 11 5.67 8.5 7 6 3 8.5"/><polygon fill="currentColor" points="17 8.5 13 11 14.33 8.5 13 6 17 8.5"/><rect fill="currentColor" x="5" y="8" width="10" height="1"/>',nc=ge(bo),rc=ge(`${bo}<path fill="none" stroke="currentColor" d="M8.5 7V3M8.5 5a1.5 1.5 0 0 1 3 0v2"/>`),ac=ge('<polygon fill="currentColor" points="5.74 3.63 7 6 4.15 4.22 3.2 3.62 3 3.5 7 1 6.17 2.55 5.67 3.5 5.74 3.63"/><polygon fill="currentColor" points="16 9 13.5 13 12.66 11.65 11.92 10.47 11 9 12 9.53 12.98 10.05 13.5 10.33 16 9"/><path fill="currentColor" d="M2,6.08v1a5.65,5.65,0,0,1,1,.26v-1A6.59,6.59,0,0,0,2,6.08Z"/><rect fill="currentColor" x="2" y="1" width="1" height="13"/><rect fill="currentColor" x="3" y="13" width="15" height="1"/><path fill="currentColor" d="M14,9.5c0,.18,0,.37,0,.55v0a6.82,6.82,0,0,1-.32,1.57l-.74-1.18L13,10c0-.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,2.5,7,7,0,0,1,14,9.5Z"/>'),oc=ge('<polygon fill="currentColor" points="2 4 18 9 18 13 2 13"/>'),ic=ge('<rect fill="currentColor" x="17" y="1" width="1" height="7"/><rect fill="currentColor" x="2" y="13" width="8" height="1"/><path fill="currentColor" d="M18,6l-.26,1a7.53,7.53,0,0,0-.95,0h-.08a9.46,9.46,0,0,0-8.08,5.69,6.36,6.36,0,0,0-.35.95l-1-.26a7.51,7.51,0,0,1,.34-.94A10.5,10.5,0,0,1,17,6h0A6.68,6.68,0,0,1,18,6Z"/><path fill="currentColor" d="M16.46,3.16l0,0L13,1l1.18,2.23a11.56,11.56,0,0,0-9.09,6.89l-.54-.29L3,9l2.5,4,.12-.2.6-1L8,9l-1.53.81a10.47,10.47,0,0,1,7.39-5.42L13.53,5,13,6l1.47-.92,1.18-.74.19-.12L16.25,4,17,3.5Z"/>'),sc=ge('<polygon fill="currentColor" points="5.51 6.63 6.71 11.09 7.4 8.51 9.97 7.82 5.51 6.63"/><path fill="none" stroke="currentColor" d="M10.46 11.58 6.93 8.04"/><path fill="currentColor" d="M3.14 11.9a6.86 6.86 0 0 1 13.71 0H18a8 8 0 0 0-16 0Z"/>'),lc=ge('<text fill="currentColor" x="12.26" y="6" font-size="6.09" font-family="Arial,Helvetica,sans-serif">X</text><text fill="currentColor" x="12.35" y="13" font-size="6.09" font-family="Arial,Helvetica,sans-serif">Y</text><path fill="currentColor" d="M6,10v3H3V10H6M7,9H2v5H7V9Z"/><path fill="currentColor" d="M17.5,7H10.56a.47.47,0,0,0-.35.15L6.15,11.21a.5.5,0,1,0,.7.7L10.76,8H17.5a.5.5,0,0,0,0-1Z"/>'),ko='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true"><path d="M 459.5 0 L 475.5 0 L 476.5 1 L 479.5 1 L 485.5 3 Q 487.8 6.2 492.5 7 L 501 14.5 L 505 19.5 L 511 32.5 Q 510.2 35.8 512 36.5 L 512 52.5 L 511 53.5 L 511 56.5 L 509 62.5 L 506 68.5 L 493 89.5 L 483 108.5 L 478 115.5 L 472 127.5 L 467 134.5 L 457 153.5 L 452 160.5 L 442 179.5 L 437 186.5 L 431 198.5 L 440 213.5 L 440 215.5 L 443 220.5 L 447 232.5 L 448 240.5 L 449 241.5 L 449 245.5 L 450 246.5 L 450 254.5 L 451 255.5 L 451 274.5 L 450 275.5 L 450 283.5 L 449 284.5 L 449 289.5 L 448 290.5 L 448 294.5 L 447 295.5 L 446 302.5 L 442 314.5 L 438 322.5 L 438 324.5 L 428 345.5 L 428 347.5 L 425 352.5 L 422 361.5 L 418 368.5 L 418 370.5 L 415 375.5 L 412 384.5 L 408 391.5 L 408 393.5 L 405 398.5 L 402 407.5 L 398 414.5 L 395 423.5 L 391 430.5 L 391 432.5 L 381 453.5 L 381 455.5 L 378 460.5 L 375 469.5 L 371 476.5 L 368 485.5 L 361.5 497 L 353.5 501 L 348.5 501 L 347.5 500 L 344.5 500 L 329.5 495 L 326.5 493 L 321.5 492 L 318.5 490 L 303.5 485 L 289.5 478 L 287.5 478 L 282 473.5 L 279 467.5 L 279 459.5 L 280 458.5 L 280 455.5 L 281 454.5 L 281 451.5 L 282 450.5 L 283 442.5 L 284 441.5 L 286 431.5 L 285.5 431 L 281.5 435 L 259.5 455 L 255.5 457 L 246.5 457 L 223.5 444 L 189.5 421 L 155.5 394 L 133 373.5 L 130 367.5 L 130 359.5 L 134 352.5 L 223 233.5 L 242 206.5 L 254.5 192 L 271.5 177 L 285.5 168 L 299.5 161 L 314.5 156 L 317.5 156 L 318.5 155 L 330.5 154 L 331.5 153 L 352.5 153 L 354 151.5 L 356 146.5 L 372 120.5 L 374 115.5 L 387 94.5 L 397 75.5 L 402 68.5 L 408 56.5 L 413 49.5 L 423 30.5 L 431 17.5 L 439.5 9 L 449.5 3 L 455.5 1 L 458.5 1 L 459.5 0 Z M 466 30 L 459 33 L 454 39 L 448 51 L 443 58 L 433 77 L 428 84 L 414 110 L 409 117 L 407 122 L 405 124 L 403 129 L 401 131 L 399 136 L 384 161 L 386 162 L 388 162 L 396 166 L 409 175 L 422 153 L 424 148 L 429 141 L 431 136 L 433 134 L 435 129 L 437 127 L 439 122 L 444 115 L 454 96 L 459 89 L 469 70 L 474 63 L 482 47 L 482 43 L 480 38 L 475 32 L 469 30 L 466 30 Z M 333 183 L 332 184 L 328 184 L 327 185 L 324 185 L 323 186 L 320 186 L 314 188 L 300 195 L 286 205 L 271 220 L 267 225 L 266 228 L 410 310 L 412 307 L 412 305 L 416 296 L 418 285 L 419 284 L 419 279 L 420 278 L 420 252 L 419 251 L 419 246 L 417 241 L 417 238 L 411 224 L 402 211 L 389 198 L 371 188 L 362 185 L 352 184 L 351 183 L 333 183 Z M 248 252 L 195 322 L 193 326 L 172 353 L 167 361 L 194 384 L 228 409 L 249 422 L 256 417 L 303 372 L 310 368 L 318 368 L 322 370 L 328 378 Q 327 381 329 382 L 329 386 L 326 395 L 326 399 L 323 408 L 323 411 L 322 412 L 322 416 L 319 425 L 319 428 L 318 429 L 318 432 L 317 433 L 317 437 L 314 446 L 314 449 L 313 450 L 313 453 L 312 454 L 316 456 L 318 456 L 331 462 L 343 466 L 351 448 L 351 446 L 354 441 L 354 439 L 357 434 L 357 432 L 364 418 L 364 416 L 367 411 L 367 409 L 370 404 L 370 402 L 377 388 L 377 386 L 380 381 L 380 379 L 383 374 L 383 372 L 387 365 L 390 356 L 393 351 L 393 349 L 396 344 L 397 339 L 375 326 L 373 324 L 368 322 L 366 320 L 361 318 L 354 313 L 349 311 L 347 309 L 342 307 L 340 305 L 335 303 L 321 294 L 316 292 L 314 290 L 309 288 L 307 286 L 302 284 L 295 279 L 276 269 L 248 252 Z "/><path d="M 170.5 100 L 179.5 100 Q 185 102 188 106.5 L 190 110.5 L 190 134.5 L 184.5 142 L 177.5 145 L 171.5 145 L 166.5 143 L 162 138.5 L 159 129.5 L 159 115.5 L 160 114.5 Q 159.2 109.7 161 107.5 L 166.5 102 L 170.5 100 Z "/><path d="M 131.5 140 L 151.5 140 L 156.5 142 L 162 147.5 L 164 151.5 L 164 159.5 L 163 162.5 L 158.5 168 L 152.5 171 L 130.5 171 L 124.5 168 L 122 165.5 L 119 159.5 L 119 151.5 Q 121.3 145.3 126.5 142 L 131.5 140 Z "/><path d="M 197.5 140 L 218.5 140 L 223.5 142 L 228 146.5 L 231 152.5 L 231 158.5 L 229 163.5 L 223.5 169 L 218.5 171 L 197.5 171 L 192.5 169 L 188 164.5 L 186 160.5 L 185 153.5 L 188 146.5 L 191.5 143 L 197.5 140 Z "/><path d="M 171.5 166 L 177.5 166 L 180.5 167 L 187 171.5 L 190 176.5 L 190 200.5 Q 188 206 183.5 209 L 179.5 211 L 173.5 212 L 167.5 210 L 161 203.5 Q 159.2 201.3 160 196.5 L 159 195.5 L 159 181.5 L 162 172.5 L 165.5 169 L 171.5 166 Z "/><path d="M 50.5 223 L 60.5 223 L 68 228.5 L 71 234.5 L 71 256.5 Q 69.1 262.6 64.5 266 L 59.5 268 L 51.5 268 Q 45.3 265.7 42 260.5 L 40 255.5 L 40 235.5 L 42 230.5 L 48.5 224 L 50.5 223 Z "/><path d="M 13.5 263 L 30.5 263 Q 31.5 265 35.5 264 L 43 270.5 L 45 274.5 L 45 282.5 Q 43.1 288.6 38.5 292 L 33.5 294 L 10.5 294 Q 5 292 2 287.5 L 0 283.5 L 0 274.5 Q 2.3 268.3 7.5 265 L 13.5 263 Z "/><path d="M 80.5 263 L 97.5 263 L 103.5 265 L 108 268.5 L 111 273.5 L 112 279.5 L 109 287.5 L 104.5 292 L 100.5 294 L 77.5 294 Q 71.3 291.7 68 286.5 L 66 281.5 L 66 276.5 L 69 269.5 L 72.5 266 L 80.5 263 Z "/><path d="M 54.5 289 L 61.5 290 L 69 296.5 L 71 301.5 L 71 322.5 L 69 327.5 L 63.5 333 L 58.5 335 L 53.5 335 L 46.5 332 L 43 328.5 L 40 321.5 L 40 302.5 Q 41.8 301.8 41 298.5 L 46.5 292 L 54.5 289 Z "/><path d="M 98.5 400 L 107.5 402 L 113 407.5 L 115 411.5 L 115 434.5 Q 112.7 440.7 107.5 444 L 101.5 446 L 96.5 446 L 90.5 443 L 87 439.5 L 84 430.5 L 84 415.5 L 85 414.5 Q 84.3 410.3 86 408.5 L 92.5 402 L 98.5 400 Z "/><path d="M 55.5 441 L 77.5 441 L 80.5 442 L 86 446.5 L 89 451.5 L 89 460.5 Q 86.7 466.7 81.5 470 L 76.5 472 L 56.5 472 L 51.5 470 L 46 464.5 L 44 460.5 L 44 452.5 L 45 449.5 L 49.5 444 L 55.5 441 Z "/><path d="M 121.5 441 L 144.5 441 Q 150.7 443.3 154 448.5 L 156 453.5 L 156 458.5 L 154 464.5 L 148.5 470 L 146.5 470 L 143.5 472 L 122.5 472 L 116.5 469 L 113 465.5 L 111 461.5 L 110 455.5 Q 112 454.5 111 450.5 L 117.5 443 L 121.5 441 Z "/><path d="M 96.5 467 L 103.5 467 L 106.5 468 L 113 473.5 L 115 478.5 L 115 501.5 Q 113 507 108.5 510 L 104.5 512 L 95.5 512 Q 89.3 509.7 86 504.5 Q 84.3 502.7 85 498.5 L 84 497.5 L 84 482.5 L 87 473.5 L 91.5 469 L 96.5 467 Z "/></svg>',cc=ko,dc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" fill="currentColor"/><rect x="14" y="14" width="7" height="7" fill="none" stroke="currentColor" stroke-width="1"/><path d="M12 4a8 8 0 0 1 7.25 7.25" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M20.75 10 L17.25 10 L19 12.5 Z" fill="currentColor"/><path d="M12 20a8 8 0 0 1-8-8" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M6 14 L2.5 14 L4 11 Z" fill="currentColor"/></svg>',uc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" style="fill:none"><g fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"><path d="M12.4 3.25H5.5A2.25 2.25 0 0 0 3.25 5.5v9A2.25 2.25 0 0 0 5.5 16.75h9A2.25 2.25 0 0 0 16.75 14.5V8.6"/><g transform="rotate(45 13.2 6.7)"><rect x="11.7" y="1.55" width="3" height="7.45" rx="1.45"/><path d="M11.7 3.2h3"/><path d="M11.7 9 13.2 12.15 14.7 9"/><rect x="12.8" y="7.05" width="0.8" height="1.2" rx="0.4"/></g></g></svg>',mc='<path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="butt" stroke-linejoin="miter" d="M2.6 6.8v8.5h5.2l2.2 2.4 2.2-2.4h5.2"/>',Lo='<g fill="none" stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" transform="rotate(46 14.8 9)"><rect x="13.65" y="4.7" width="2.3" height="5.6" rx="1.05"/><path d="M13.65 10.3 14.8 12.9 15.95 10.3"/></g>';function Ce(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${mc}${e}</svg>`}const pc=Ce('<path fill="currentColor" d="M6.4 12.2c-1.85 0-3.3-1.25-3.3-2.85 0-1.35.95-2.5 2.3-2.8.45-1.7 1.95-2.85 3.7-2.85 1.25 0 2.35.55 3.05 1.45.55-.7 1.45-1.15 2.5-1.15 1.85 0 3.25 1.3 3.25 2.95 0 .3-.05.55-.1.8 1.2.4 2.05 1.4 2.05 2.65 0 1.55-1.5 2.8-3.4 2.8H6.4Z"/>'),fc=Ce(`<rect fill="none" stroke="currentColor" stroke-width="1.25" x="5" y="2.8" width="8.2" height="7.2"/><rect fill="${me}" x="4.2" y="2" width="2" height="2"/><rect fill="${me}" x="12.2" y="9" width="2" height="2"/>${Lo}`),hc=Ce(`<ellipse fill="none" stroke="currentColor" stroke-width="1.25" cx="9" cy="6.6" rx="4" ry="3.6"/><rect fill="${me}" x="8" y="2.1" width="2" height="2"/><rect fill="${me}" x="4" y="5.6" width="2" height="2"/>${Lo}`),gc=Ce('<path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M4.4 12.6 10.2 7"/><rect fill="currentColor" x="10.2" y="1.2" width="7.8" height="5.8" rx=".35"/>'),yc=Ce('<path fill="currentColor" fill-rule="evenodd" d="M10 2.2 15.3 13.1h-2.2l-1.05-2.95H7.95L6.9 13.1H4.7L10 2.2Zm0 3.4-1.15 3.2h2.3L10 5.6Z"/>'),xc=Ce('<g transform="rotate(-40 10 7.6)" fill="currentColor"><path d="M3.5 6.75h9V5.15L16.7 7.6 12.5 10.05V8.45h-9Z"/></g>'),wc=rr("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"),Ao=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="3.5" y="3" width="13" height="14" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.25"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 6.5h13"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M6.5 9.5h7M6.5 12h7M6.5 14.5h3.2"/><g fill="none" stroke="${me}" stroke-width="1.25" stroke-linecap="round"><circle cx="14.5" cy="14.7" r="4.2"/><path d="M17.5 17.7 19.5 19.7"/></g></svg>`,vc=Ao.replace(me,"currentColor"),bc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M4.5 2h6.4L15.5 6.6V16.5A1.5 1.5 0 0 1 14 18H4.5A1.5 1.5 0 0 1 3 16.5V3.5A1.5 1.5 0 0 1 4.5 2z"/><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M10.9 2v4.6h4.6"/><path stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" d="M10 5.8v6M7.2 9.6 10 12.5l2.8-2.9"/></svg>',kc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M15.5 2H9.1L4.5 6.6V16.5A1.5 1.5 0 0 0 6 18h9.5A1.5 1.5 0 0 0 17 16.5V3.5A1.5 1.5 0 0 0 15.5 2z"/><path stroke="currentColor" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round" d="M9.1 2v4.6H4.5"/><path stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" d="M10 14.2V8M7.2 10.4 10 7.5l2.8 2.9"/></svg>',Lc=ko,Ac=rr("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"),Cc=rr("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"),Ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><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>',Hc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><circle cx="10" cy="10" r="4" fill="currentColor"/><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2v2M10 16v2M2 10h2M16 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4"/></svg>',Sc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 3a7 7 0 1 0 0 14 9 9 0 0 1 0-14Z"/></svg>',Mc='<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>',Pc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',Co='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 2.6 18 9.8h-2.1V17h-4.4v-4.4H8.5V17H4.1V9.8H2L10 2.6Zm0 1.8L5.3 9.8V15.8h2V11.4h5.4v4.4h2V9.8L10 4.4Z"/></svg>',Ic=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${wo}<path fill="${me}" d="M14.85 0.85 15.95 4.05 19.15 5.15 15.95 6.25 14.85 9.45 13.75 6.25 10.55 5.15 13.75 4.05Z"/><path fill="${me}" d="M17.55 8.35 18.15 10.15 19.95 10.75 18.15 11.35 17.55 13.15 16.95 11.35 15.15 10.75 16.95 10.15Z"/></svg>`,_c='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M8.08 2.1h3.84l.32 1.52a6.4 6.4 0 0 1 1.36.78l1.48-.64 1.92 1.92-.64 1.48c.3.42.54.88.78 1.36l1.52.32v3.84l-1.52.32a6.4 6.4 0 0 1-.78 1.36l.64 1.48-1.92 1.92-1.48-.64a6.4 6.4 0 0 1-1.36.78l-.32 1.52H8.08l-.32-1.52a6.4 6.4 0 0 1-1.36-.78l-1.48.64-1.92-1.92.64-1.48a6.4 6.4 0 0 1-.78-1.36L1.34 11.92V8.08l1.52-.32c.24-.48.48-.94.78-1.36l-.64-1.48 1.92-1.92 1.48.64c.42-.3.88-.54 1.36-.78L8.08 2.1ZM10 7.2A2.8 2.8 0 1 0 10 12.8 2.8 2.8 0 0 0 10 7.2Z"/></svg>',Bc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2.5v6M7 5.5h6"/><circle cx="10" cy="14.5" r="3.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="10" cy="14.5" r="1.1" fill="currentColor"/></svg>',Tc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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>',zc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',Fc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M2.25 2.25h4.878v4.878H2.25V2.25Zm.978.978v2.924h2.924V3.228H3.228Z"/><path fill="currentColor" d="M5.175 20.773V7.128H4.204V21.75H21.75V4.204H7.128v.971H20.773v15.598H5.175Z"/></svg>',Oc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',Rc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><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>',Dc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><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>',Uc=vo,Nc=lc,Xc=pc,Vc=fc,Yc=hc,Gc=Ac,Eo=Cc,Ee={select:Zl,pan:Wl,zoomExtent:ql,zoomSmart:Ic,zoomBox:Uc,measureDistance:nc,measureContinuous:rc,measureAngle:ac,measureArc:ic,measureRadius:sc,measureArea:oc,measureCoordinate:Nc,clearMeasurements:cc,layer:Jl,layout:Ql,zoomWindow:vo,zoomOriginal:Co,zoomSaved:Co,layerOn:Tc,layerOff:zc,language:Ec,osnap:Fc,orthoMode:Oc,polarTracking:Rc,color:Dc,chevronUp:Mc,chevronDown:Pc,measure:ec,annotation:uc,markupCloud:Xc,markupCallout:gc,markupText:yc,markupRect:Vc,markupCircle:Yc,markupArrow:xc,markupStamp:wc,markupPanel:Ao,measurementPanel:vc,markupImport:bc,markupExport:kc,markupShow:Gc,markupHide:Eo,markupVisibility:Eo,clearMarkups:Lc,settings:_c,simulatedMouse:Bc,switchBg:dc,themeLight:Hc,themeDark:Sc};function ar(e,t,n){const r=Object.entries(n).map(([i,l])=>`${i}="${oe(l)}"`).join(" "),a=n["data-i18n-key"],o=a?`<span class="mlcad-tool-btn-label" data-i18n-key="${oe(a)}" data-i18n-text>${oe(t)}</span>`:"";return`<button type="button" class="mlcad-tool-btn" title="${oe(t)}" aria-label="${oe(t)}" ${r}><span class="mlcad-tool-btn-icon" aria-hidden="true">${e}</span>${o}</button>`}function $c(e,t,n){const r=Object.entries(n).map(([i,l])=>`${i}="${oe(l)}"`).join(" "),a=n["data-i18n-key"],o=a?` data-i18n-key="${oe(a)}" data-i18n-text`:"";return`<button type="button" class="mlcad-dropdown-item" role="menuitem" title="${oe(t)}" ${r}><span class="mlcad-dropdown-icon" aria-hidden="true">${e}</span><span class="mlcad-dropdown-label"${o}>${oe(t)}</span></button>`}function oe(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}const Ho=[90,45,30,23,18,10,5],So=90,jc=So,Kc={en:"toolbar.localeEn",zh:"toolbar.localeZh",ja:"toolbar.localeJa",ko:"toolbar.localeKo",cs:"toolbar.localeCs",tr:"toolbar.localeTr",ar:"toolbar.localeAr"},Zc={en:"English",zh:"中文",ja:"日本語",ko:"한국어",cs:"Čeština",tr:"Türkçe",ar:"العربية"};function Wc(){return`<div id="mlcad-locale-strip-wrap" hidden>
|
|
2
2
|
<div id="mlcad-locale-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.language" aria-label="Language">
|
|
3
|
-
${he.map(t=>{const n=
|
|
3
|
+
${he.map(t=>{const n=Zc[t],r=Kc[t],a=jn[t];return`<button type="button" class="mlcad-tool-btn mlcad-locale-option" data-locale="${t}" data-i18n-key="${r}" data-i18n-attr="title aria-label" title="${n}" aria-label="${n}"><span class="mlcad-tool-btn-icon" aria-hidden="true"><span class="mlcad-locale-option-badge">${a}</span></span><span class="mlcad-tool-btn-label" data-i18n-key="${r}" data-i18n-text>${n}</span></button>`}).join("")}
|
|
4
4
|
</div>
|
|
5
5
|
</div>`}function or(){return`<div id="mlcad-polar-angles" role="group" data-i18n-attr="aria-label" data-i18n-key="settings.polarAngles" aria-label="Polar tracking angles" hidden>
|
|
6
|
-
${
|
|
7
|
-
</div>`}function
|
|
6
|
+
${Ho.map(t=>`<button type="button" class="mlcad-tool-btn mlcad-settings-option-btn mlcad-polar-angle-btn" data-polar-ang="${t}" title="${t}°" aria-label="${t}°"><span class="mlcad-settings-option-indicator" aria-hidden="true"></span><span class="mlcad-settings-option-text">${t}°</span></button>`).join("")}
|
|
7
|
+
</div>`}function qc(){return`<div id="mlcad-snap-strip-wrap" hidden>
|
|
8
8
|
<div id="mlcad-snap-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.snap" aria-label="Object snap">
|
|
9
9
|
${ar(Ee.orthoMode,"Orthogonal mode",{id:"mlcad-ortho-btn","data-toggle":"ortho","data-i18n-key":"settings.ortho","data-i18n-attr":"title aria-label"})}
|
|
10
10
|
${ar(Ee.polarTracking,"Polar tracking",{id:"mlcad-polar-btn","data-toggle":"polar","data-i18n-key":"settings.polar","data-i18n-attr":"title aria-label"})}
|
|
11
11
|
</div>
|
|
12
12
|
${or()}
|
|
13
|
-
</div>`}const
|
|
13
|
+
</div>`}const Mo=600,Po=960,Io=1.231,Jc=13,Gt=`
|
|
14
14
|
:root {
|
|
15
15
|
--mlcad-ui-bg: rgba(24, 26, 30, 0.94);
|
|
16
16
|
--mlcad-ui-bg-elevated: rgba(32, 35, 40, 0.98);
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
}
|
|
862
862
|
.mlcad-measure-badge--coordinate {
|
|
863
863
|
/* em so the lift tracks the capsule when text height changes. */
|
|
864
|
-
transform: translate(-50%, calc(-50% - ${
|
|
864
|
+
transform: translate(-50%, calc(-50% - ${Io}em));
|
|
865
865
|
}
|
|
866
866
|
.mlcad-measure-badge.mlcad-measure-selected {
|
|
867
867
|
/* Hard ring at half original em thickness + soft glow */
|
|
@@ -1149,7 +1149,7 @@
|
|
|
1149
1149
|
font-variant-numeric: tabular-nums;
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
|
-
@media (max-width: ${
|
|
1152
|
+
@media (max-width: ${Mo}px) {
|
|
1153
1153
|
:root {
|
|
1154
1154
|
--mlcad-drawer-width: min(280px, calc(100vw - 16px));
|
|
1155
1155
|
--mlcad-ui-inset: 0px;
|
|
@@ -1377,7 +1377,7 @@
|
|
|
1377
1377
|
}
|
|
1378
1378
|
|
|
1379
1379
|
/* Pad / coarse pointer: same toolbar as desktop, minus select and pan. */
|
|
1380
|
-
@media (max-width: ${
|
|
1380
|
+
@media (max-width: ${Po}px), (pointer: coarse) {
|
|
1381
1381
|
#mlcad-toolbar [data-action="select"],
|
|
1382
1382
|
#mlcad-toolbar [data-action="pan"] {
|
|
1383
1383
|
display: none !important;
|
|
@@ -1393,7 +1393,7 @@
|
|
|
1393
1393
|
visibility: hidden !important;
|
|
1394
1394
|
pointer-events: none !important;
|
|
1395
1395
|
}
|
|
1396
|
-
`;function $t(e,t="measure",n=!0){const r=t==="measure"?`${or()}${
|
|
1396
|
+
`;function $t(e,t="measure",n=!0){const r=t==="measure"?`${or()}${ed()}${Qc()}`:"";return`
|
|
1397
1397
|
<div id="mlcad-loading" aria-hidden="true" style="background:${e}">
|
|
1398
1398
|
<div class="mlcad-loading-spinner"></div>
|
|
1399
1399
|
<div id="mlcad-access-gate" hidden>
|
|
@@ -1447,7 +1447,7 @@
|
|
|
1447
1447
|
`}function ir(e,t,n){return`<div class="mlcad-drawer-sheet-chrome">
|
|
1448
1448
|
<div class="mlcad-drawer-grabber" role="separator" aria-orientation="horizontal"></div>
|
|
1449
1449
|
<button type="button" class="mlcad-drawer-sheet-close" id="${e}" data-i18n-key="${t}" data-i18n-attr="aria-label" aria-label="${n}">${Ee.chevronDown}</button>
|
|
1450
|
-
</div>`}function
|
|
1450
|
+
</div>`}function Qc(){return`<div id="mlcad-review-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="review.title" aria-label="Review" hidden>
|
|
1451
1451
|
${ir("mlcad-review-sheet-close","review.close","Close review")}
|
|
1452
1452
|
<div class="mlcad-drawer-header">
|
|
1453
1453
|
<span data-i18n-key="review.title" data-i18n-text>Review</span>
|
|
@@ -1496,7 +1496,7 @@
|
|
|
1496
1496
|
<button type="button" class="mlcad-review-delete" data-i18n-key="review.delete" data-i18n-text>Delete</button>
|
|
1497
1497
|
</div>
|
|
1498
1498
|
</div>
|
|
1499
|
-
</div>`}function
|
|
1499
|
+
</div>`}function ed(){return`<div id="mlcad-measure-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="measurePanel.title" aria-label="Measurements" hidden>
|
|
1500
1500
|
${ir("mlcad-measure-sheet-close","measurePanel.close","Close measurements")}
|
|
1501
1501
|
<div class="mlcad-drawer-header">
|
|
1502
1502
|
<span data-i18n-key="measurePanel.title" data-i18n-text>Measurements</span>
|
|
@@ -1524,20 +1524,20 @@
|
|
|
1524
1524
|
<tbody></tbody>
|
|
1525
1525
|
</table>
|
|
1526
1526
|
</div>
|
|
1527
|
-
</div>`}function
|
|
1528
|
-
`:"",
|
|
1527
|
+
</div>`}function td(e,t){var h;const n=t.title??e.meta.title??"CAD Drawing",r=t.encoded??ia(e),a=t.viewerRuntime,o=ca(),i=r.compression,l=((h=t.accessManifest)==null?void 0:h.encrypted)===!0,s=`#${e.meta.background.toString(16).padStart(6,"0")}`,c=Ae(e.meta.locale)??"en",d=e.meta.viewerMode??"measure",u=e.meta.exportLayouts!==!1,p=t.accessManifest?` <script id="mlcad-access" type="application/json">${To(JSON.stringify(t.accessManifest))}<\/script>
|
|
1528
|
+
`:"",f=l?`${o}+aes-gcm;base85`:`${o}+${i};base85`;return`<!DOCTYPE html>
|
|
1529
1529
|
<html lang="${c}">
|
|
1530
1530
|
<head>
|
|
1531
1531
|
<meta charset="utf-8" />
|
|
1532
1532
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
1533
1533
|
<meta name="generator" content="mlightcad-cad-html-plugin" />
|
|
1534
|
-
<title>${
|
|
1534
|
+
<title>${_o(n)}</title>
|
|
1535
1535
|
<style>${Gt}</style>
|
|
1536
1536
|
</head>
|
|
1537
1537
|
<body>
|
|
1538
1538
|
${$t(s,d,u)}
|
|
1539
|
-
${
|
|
1540
|
-
<script>${
|
|
1539
|
+
${p} <script id="mlcad-snapshot" type="${f}">${r.payload}<\/script>
|
|
1540
|
+
<script>${Bo(a)}<\/script>
|
|
1541
1541
|
</body>
|
|
1542
1542
|
</html>`}function sr(e,t){var d;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Ae(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",l=e.meta.exportLayouts!==!1,s=(d=t.manifestUrl)==null?void 0:d.trim(),c=JSON.stringify(s&&s!==nr?{manifestUrl:s}:{});return`<!DOCTYPE html>
|
|
1543
1543
|
<html lang="${o}">
|
|
@@ -1545,32 +1545,32 @@ ${f} <script id="mlcad-snapshot" type="${p}">${r.payload}<\/script>
|
|
|
1545
1545
|
<meta charset="utf-8" />
|
|
1546
1546
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
1547
1547
|
<meta name="generator" content="mlightcad-cad-html-plugin" />
|
|
1548
|
-
<title>${
|
|
1548
|
+
<title>${_o(n)}</title>
|
|
1549
1549
|
<style>${Gt}</style>
|
|
1550
1550
|
</head>
|
|
1551
1551
|
<body>
|
|
1552
1552
|
${$t(a,i,l)}
|
|
1553
|
-
<script id="mlcad-package" type="application/json">${
|
|
1554
|
-
<script>${
|
|
1553
|
+
<script id="mlcad-package" type="application/json">${To(c)}<\/script>
|
|
1554
|
+
<script>${Bo(r)}<\/script>
|
|
1555
1555
|
</body>
|
|
1556
|
-
</html>`}function
|
|
1557
|
-
`;return l.unshift({path:r,bytes:xe(h)}),{manifest:
|
|
1558
|
-
`),
|
|
1556
|
+
</html>`}function _o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Bo(e){return e.replace(/<\/script/gi,"<\\/script")}function To(e){return e.replace(/</g,"\\u003c")}const zo=1,Fo=600*1e3,nd=1e5,rd=16,lr=12,ad={en:"en",zh:"zh-CN",cs:"cs",tr:"tr",ar:"ar"};function od(e,t=Date.now(),n){return e==="never"?null:e==="custom"?n??null:t+e*24*60*60*1e3}function cr(e){var n;const t=!!((n=e.password)!=null&&n.trim());return e.expiresAt!=null||t}function id(e,t=Date.now()){return e.expiresAt!=null&&t>e.expiresAt}function sd(e,t=Date.now()){const n=e-t;return n>0&&n<=Fo}function ld(e,t="en"){const n=ad[t]??t;try{return new Date(e).toLocaleString(n,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return new Date(e).toISOString()}}function cd(e){const t=Math.max(0,Math.ceil(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60,o=String(r).padStart(2,"0"),i=String(a).padStart(2,"0");return n>0?`${n}:${o}:${i}`:`${r}:${i}`}function dd(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.v)!==zo?null:n}catch{return null}}function We(e){var n;if(!cr(e))return;const t=!!((n=e.password)!=null&&n.trim());return{v:zo,expiresAt:e.expiresAt,encrypted:t,...t&&e.salt?{salt:e.salt}:{}}}async function jt(e,t){const n=t!=null&&t.trim()?new Uint8Array(No(t)):crypto.getRandomValues(new Uint8Array(rd));return{key:await pd(e,n),salt:Uo(n)}}async function Kt(e,t){const n=crypto.getRandomValues(new Uint8Array(lr)),r=new Uint8Array(t),a=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,r)),o=new Uint8Array(n.length+a.length);return o.set(n,0),o.set(a,n.length),o}async function Zt(e,t){const n=new Uint8Array(t.subarray(0,lr)),r=new Uint8Array(t.subarray(lr));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:n},e,r))}async function Oo(e,t,n="base85"){const{key:r,salt:a}=await jt(e),o=ze(t,n),i=await Kt(r,o);return{encryptedPayload:ve(i,n),salt:a}}async function ud(e,t,n,r="base85"){const{key:a}=await jt(e,n),o=await Zt(a,ze(t,r));return ve(o,r)}function Ro(e){return Uo(e)}function Do(e){return No(e)}async function md(e,t){var r;if(!cr(t))return{encoded:e};const n=(r=t.password)==null?void 0:r.trim();if(n){const{encryptedPayload:a,salt:o}=await Oo(n,e.payload);return{encoded:{payload:a,compression:e.compression},manifest:We({expiresAt:t.expiresAt,password:n,salt:o})}}return{encoded:e,manifest:We({expiresAt:t.expiresAt})}}async function pd(e,t){const n=new TextEncoder,r=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(t),iterations:nd,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Uo(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function No(e){const t=atob(e.trim()),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const fd=256;function Xo(e,t=$e){return!(t>0)||Ct(e)<=t?[e]:e.indices&&e.indices.length>=2?gd(e,t):hd(e,t)}function Vo(e,t=$e){return e.texture?[e]:!(t>0)||Et(e)<=t?[e]:e.points?xd(e,t):!e.indices||e.indices.length<3?Go(e,t):vd(e,t)}function Yo(e){return e.linePattern?64+e.linePattern.pattern.length*8:0}function dr(e){return(e.hatchPattern?128:0)+(e.gradientFill?64:0)}function qe(e,t,n){const r=e-fd-t;return r<n?1:Math.max(1,Math.floor(r/n))}function hd(e,t){var l;const n=(((l=e.lineDistances)==null?void 0:l.length)??0)>=2,r=24+(n?8:0),a=qe(t,Yo(e),r),o=e.positions.length/6|0;if(o<=1)return[e];const i=[];for(let s=0;s<o;s+=a){const c=Math.min(a,o-s),d=s*6,u={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(d,d+c*6)};if(Ko(e,u),n&&e.lineDistances){const p=s*2;u.lineDistances=e.lineDistances.slice(p,p+c*2)}i.push(u)}return i.length>0?i:[e]}function gd(e,t){var l;const n=e.indices,a=32+((((l=e.lineDistances)==null?void 0:l.length)??0)>0?8:0),o=qe(t,Yo(e),a),i=[];for(let s=0;s+1<n.length;){const c=Math.min(o*2,n.length-s),d=c-c%2;if(d<2)break;i.push(yd(e,s,d)),s+=d}return i.length>0?i:[e]}function yd(e,t,n){const r=jo(e.positions,e.indices.subarray(t,t+n),e.lineDistances?[e.lineDistances]:[],[1]),a={layer:e.layer,color:e.color,offset:e.offset,positions:r.positions,indices:r.indices};return Ko(e,a),r.attributes[0]&&r.attributes[0].length>0&&(a.lineDistances=r.attributes[0]),a}function xd(e,t){return e.indices&&e.indices.length>0?wd(e,t):Go(e,t)}function wd(e,t){const n=e.indices,r=16+(e.uvs?8:0)+(e.gradientPositions?8:0),a=qe(t,dr(e),r),o=[];for(let i=0;i<n.length;){const l=Math.min(a,n.length-i);if(l<1)break;o.push($o(e,i,l)),i+=l}return o.length>0?o:[e]}function Go(e,t){const n=e.positions.length/3|0;if(n<=1)return[e];const r=12+(e.uvs?8:0)+(e.gradientPositions?8:0),a=qe(t,dr(e),r),o=e.points?1:3,i=Math.max(o,a-a%o),l=[];for(let s=0;s<n;s+=i){const c=Math.min(i,n-s),d=c-c%o;if(d<o)break;l.push(bd(e,s,d))}return l.length>0?l:[e]}function vd(e,t){const n=e.indices,r=48+(e.uvs?24:0)+(e.gradientPositions?24:0),a=qe(t,dr(e),r),o=[];for(let i=0;i+2<n.length;){const l=Math.min(a*3,n.length-i),s=l-l%3;if(s<3)break;o.push($o(e,i,s)),i+=s}return o.length>0?o:[e]}function bd(e,t,n){const r=t*3,a={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(r,r+n*3)};return Zo(e,a),e.uvs&&(a.uvs=e.uvs.slice(t*2,(t+n)*2)),e.gradientPositions&&(a.gradientPositions=e.gradientPositions.slice(t*2,(t+n)*2)),a}function $o(e,t,n){const r=[],a=[];e.uvs&&(r.push(e.uvs),a.push(2)),e.gradientPositions&&(r.push(e.gradientPositions),a.push(2));const o=jo(e.positions,e.indices.subarray(t,t+n),r,a),i={layer:e.layer,color:e.color,offset:e.offset,positions:o.positions,indices:o.indices};Zo(e,i);let l=0;return e.uvs&&(i.uvs=o.attributes[l++]),e.gradientPositions&&(i.gradientPositions=o.attributes[l]),i}function jo(e,t,n,r){const a=new Map,o=[],i=new Uint32Array(t.length),l=n.map(()=>[]);for(let s=0;s<t.length;s++){const c=t[s];let d=a.get(c);if(d==null){d=a.size,a.set(c,d);const u=c*3;o.push(e[u]??0,e[u+1]??0,e[u+2]??0);for(let p=0;p<n.length;p++){const f=r[p],h=n[p],g=c*f;for(let x=0;x<f;x++)l[p].push(h[g+x]??0)}}i[s]=d}return{positions:Float32Array.from(o),indices:i,attributes:l.map(s=>Float32Array.from(s))}}function Ko(e,t){e.linePattern&&(t.linePattern=e.linePattern),e.lineWidth!=null&&(t.lineWidth=e.lineWidth),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.excludeFromOsnap&&(t.excludeFromOsnap=!0)}function Zo(e,t){e.hatchPattern&&(t.hatchPattern=e.hatchPattern),e.gradientFill&&(t.gradientFill=e.gradientFill),e.side!=null&&(t.side=e.side),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.points&&(t.points=!0)}function Wo(e,t,n=$e){const r=[];let a={lineBatches:[],meshBatches:[],estimatedBytes:64};const o=()=>{a.lineBatches.length===0&&a.meshBatches.length===0&&r.length>0||(r.push(a),a={lineBatches:[],meshBatches:[],estimatedBytes:64})},i=c=>{const d=Ct(c);a.estimatedBytes+d>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.lineBatches.push(c),a.estimatedBytes+=d},l=c=>{const d=Et(c);a.estimatedBytes+d>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.meshBatches.push(c),a.estimatedBytes+=d},s=Math.min(t,n);for(const c of e.lineBatches)for(const d of Xo(c,s))i(d);for(const c of e.meshBatches)for(const d of Vo(c,s))l(d);return(r.length===0||a.lineBatches.length>0||a.meshBatches.length>0)&&o(),r.length===0&&r.push({lineBatches:[],meshBatches:[],estimatedBytes:64}),r}function qo(e,t){if(e.version!==R)throw new Error(`Unsupported snapshot version: ${e.version}`);const n=t.maxChunkBytes??oo,r=t.maxBatchBytes??$e,a=t.maxOsnapChunkBytes??n,o=t.compressChunks!==!1,i=o?"acex.gz":"acex",l=o?"osnap.gz":"osnap",s=ne,c=Ed(e.layouts,e.activeLayoutBtrId),d=[],u=[],p=new Map;return c.forEach((f,h)=>{var b;p.set(f.btrId,h);const g=Wo(f,n,r),x=[];g.forEach((k,E)=>{const H=`L${h}-${String(E).padStart(3,"0")}`,S=`chunks/${H}.${i}`;x.push(H),d.push({kind:"geometry",id:H,href:S,layoutBtrId:f.btrId,lineBatchCount:k.lineBatches.length,meshBatchCount:k.meshBatches.length,chunk:{version:R,layoutBtrId:f.btrId,lineBatches:k.lineBatches,meshBatches:k.meshBatches}})});const v={btrId:f.btrId,name:f.name,isModelSpace:f.isModelSpace,viewports:f.viewports,...f.savedView?{savedView:f.savedView}:{},...f.fitExtents?{fitExtents:f.fitExtents}:{},chunkIds:x},y=(b=f.osnap)==null?void 0:b.primitives;if(y&&y.length>0){const k=Qr(y,a),E=[];k.forEach((H,S)=>{const A=`L${h}-osnap-${String(S).padStart(3,"0")}`,L=`chunks/${A}.${l}`;E.push(A),d.push({kind:"osnap",id:A,href:L,layoutBtrId:f.btrId,primitiveCount:H.length,primitives:H})}),v.osnapChunkIds=E}u.push(v)}),{jobs:d,layoutRefs:u,layoutIndexByBtrId:p,manifestFileName:s,compressChunks:o}}function Jo(e,t,n,r,a){var g,x;const o=[],i=[],l=[];for(const v of a){const{job:y,uncompressedByteLength:b,compressed:k}=v;l.push({path:y.href,bytes:k}),y.kind==="geometry"?o.push({id:y.id,href:y.href,layoutBtrId:y.layoutBtrId,byteLength:b,compressedByteLength:k.byteLength,lineBatchCount:y.lineBatchCount,meshBatchCount:y.meshBatchCount}):i.push({id:y.id,href:y.href,layoutBtrId:y.layoutBtrId,byteLength:b,compressedByteLength:k.byteLength,primitiveCount:y.primitiveCount})}const s=e.layouts.map(v=>{const y=n.get(v.btrId);return t[y]}),c=new Set(((g=s.find(v=>v.btrId===e.activeLayoutBtrId))==null?void 0:g.chunkIds)??[]),d=[...o.filter(v=>c.has(v.id)),...o.filter(v=>!c.has(v.id))],u=new Set(((x=s.find(v=>v.btrId===e.activeLayoutBtrId))==null?void 0:x.osnapChunkIds)??[]),p=[...i.filter(v=>u.has(v.id)),...i.filter(v=>!u.has(v.id))],f={format:"acex-package",packageVersion:Qn,snapshotVersion:R,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:s,chunks:d,...p.length>0?{osnapChunks:p}:{}},h=`${JSON.stringify(f)}
|
|
1557
|
+
`;return l.unshift({path:r,bytes:xe(h)}),{manifest:f,manifestFileName:r,files:l}}function kd(e,t){if(e.kind==="geometry"){if(!t){const i=Ge(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=ro(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=be({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=ea({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}async function Ld(e,t){if(e.kind==="geometry"){if(!t){const i=Ge(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=await Fl(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=be({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=await ms({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}function Qo(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=qo(e,t),l=n.map(s=>kd(s,i));return Jo(e,r,a,o,l)}async function ur(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=qo(e,t),l=await Promise.all(n.map(s=>Ld(s,i)));return Jo(e,r,a,o,l)}function Ad(e,t){const n=Qo(e,t),r=sr(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:xe(r)},...n.files]}}async function Cd(e,t){const n=await ur(e,t),r=sr(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:xe(r)},...n.files]}}function Ed(e,t){const n=e.find(a=>a.btrId===t),r=e.filter(a=>a.btrId!==t);return n?[n,...r]:[...e]}const ei="application/vnd.mlightcad.acex-chunk;base85",Hd="application/vnd.mlightcad.acex-chunk;base64",ti="application/vnd.mlightcad.acex-chunk+aes-gcm;base85",Sd="application/vnd.mlightcad.acex-chunk+aes-gcm;base64",ie="data-acex-href";function ni(e){var n;let t=0;for(const r of e.layouts){for(const o of r.lineBatches)t+=Ct(o);for(const o of r.meshBatches)t+=Et(o);const a=(n=r.osnap)==null?void 0:n.primitives;if(a)for(const o of a)t+=En(o)}return t}function Md(e,t=io){return ni(e)>=t}async function Pd(e,t){var x;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Ae(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",l=e.meta.exportLayouts!==!1,s=t.expiresAt??null,c=((x=t.password)==null?void 0:x.trim())||void 0,d={maxChunkBytes:t.maxChunkBytes??er,maxBatchBytes:t.maxBatchBytes??t.maxChunkBytes??er,maxOsnapChunkBytes:t.maxOsnapChunkBytes??so},u=await ur(e,d);let p,f,h;if(c){const{key:v,salt:y}=await jt(c);p=We({expiresAt:s,password:c,salt:y});const b=new TextEncoder().encode(`${JSON.stringify(u.manifest)}
|
|
1558
|
+
`),k=await Kt(v,b);f={mode:"embedded",encrypted:!0,encryptedManifest:Ro(k)},h=await _d(u.files,v)}else p=We({expiresAt:s}),f={mode:"embedded",manifest:u.manifest},h=Id(u.files);const g=p?` <script id="mlcad-access" type="application/json">${si(JSON.stringify(p))}<\/script>
|
|
1559
1559
|
`:"";return`<!DOCTYPE html>
|
|
1560
1560
|
<html lang="${o}">
|
|
1561
1561
|
<head>
|
|
1562
1562
|
<meta charset="utf-8" />
|
|
1563
1563
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
1564
1564
|
<meta name="generator" content="mlightcad-cad-html-plugin" />
|
|
1565
|
-
<title>${
|
|
1565
|
+
<title>${oi(n)}</title>
|
|
1566
1566
|
<style>${Gt}</style>
|
|
1567
1567
|
</head>
|
|
1568
1568
|
<body>
|
|
1569
1569
|
${$t(a,i,l)}
|
|
1570
|
-
${g} <script id="mlcad-package" type="application/json">${
|
|
1571
|
-
${h} <script>${
|
|
1570
|
+
${g} <script id="mlcad-package" type="application/json">${si(JSON.stringify(f))}<\/script>
|
|
1571
|
+
${h} <script>${Rd(r)}<\/script>
|
|
1572
1572
|
</body>
|
|
1573
|
-
</html>`}function
|
|
1574
|
-
`);return t.join("")}async function
|
|
1575
|
-
`)}return n.join("")}function mr(e){const t=e.textContent??"";if(t.length===0)return;const n=t.charCodeAt(0)<=32||t.charCodeAt(t.length-1)<=32?t.trim():t;if(n.length===0)return;const r=xn(e.getAttribute("type"));return ze(n,r)}function
|
|
1576
|
-
`,o=e.decryptKey??null,i=e.consumeOnFetch!==!1,l=e.chunkBytes,s=e.getChunk;return{manifestUrl:n,fetchImpl:async d=>{const u=new URL(String(d));if(u.origin!==r)return new Response(null,{status:404});const f=decodeURIComponent(u.pathname.replace(/^\/+/,""));if(f===t)return new Response(a,{status:200,headers:{"Content-Type":"application/json"}});let p;if(s?p=await s(f):l&&(p=l.get(f)),!p)return new Response(null,{status:404});const h=o?await Zt(o,p):p;return i&&l&&l.delete(f),new Response(h,{status:200})}}}async function Fd(e,t){const n=await Zt(t,Ro(e)),r=new TextDecoder().decode(n);return je(JSON.parse(r))}function ai(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function oi(e){return ai(e).replace(/'/g,"'")}function Od(e){return e.replace(/<\/script/gi,"<\\/script")}function ii(e){return e.replace(/</g,"\\u003c")}function si(e){return!e||e.startsWith("/")||e.includes("\\")||e.includes("\0")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."&&/^[A-Za-z0-9._-]+$/.test(n))}function Rd(e){return e.endsWith(".gz")}function Dd(e){const t={};for(const n of e.files){if(!si(n.path))throw new Error(`Unsafe package path: ${n.path}`);Rd(n.path)?t[n.path]=[n.bytes,{level:0}]:t[n.path]=[n.bytes,{level:6}]}return as(t)}function Ud(e){const t=os(e),n=[];for(const[r,a]of Object.entries(t)){if(!si(r))throw new Error("Unsafe path in package archive");n.push({path:r,bytes:a})}return n}const qe=0,Wt=16777215;function li(e){return e==="white"||e==="space"?e:"black"}function ci(e){return e==="white"?Wt:qe}function pr(e,t,n){return e==="space"?t?qe:Wt:n>>>0}function di(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255;return(n*299+r*587+a*114)/1e3>=128}function Nd(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255,o=Math.max(n,r,a),i=Math.min(n,r,a);return o-i>16?null:o<=40?Wt:i>=215?qe:null}function Jt(e){return Nd(e)??e}function ui(e,t,n){if(di(t)!==di(n)){for(const r of e.lineBatches)r.color=Jt(r.color);for(const r of e.meshBatches){if(r.texture)continue;r.color=Jt(r.color);const a=r.gradientFill;a&&(a.startColor=Jt(a.startColor),a.endColor=Jt(a.endColor))}}}function mi(e,t,n){const r=n>>>0;e.meta.background=r;for(const a of e.layouts)ui(a,t,r)}function Xd(e,t,n){const r=li(n);if(e.meta.backgroundMode=r,r==="space"){for(const o of e.layouts)ui(o,t,pr("space",o.isModelSpace,0));const a=e.layouts.find(o=>o.btrId===e.activeLayoutBtrId);e.meta.background=pr("space",a==null||a.isModelSpace,qe);return}mi(e,t,ci(r)),e.meta.backgroundMode=r}const Vd="guide/magnifier.html",fr="https://mlightcad.com/cad-viewer/docs/";let hr=gr(fr);function pi(){return hr}function Yd(e){hr=gr(e)}function Gd(e,t){const n=t.toLowerCase().split(/[-_]/)[0],r=!n||n==="en"?"":`/${n}`,a=e.replace(/^\/+/,"");return`${hr}${r}/${a}`}function gr(e){const t=e.trim();return t?t.replace(/\/+$/,""):fr.replace(/\/+$/,"")}function yr(e,t,n){var o;if(t===n)return!1;const r=(o=e.tables)==null?void 0:o.blockTable,a=typeof(r==null?void 0:r.getIdAt)=="function"?r.getIdAt(t):void 0;if(!(a!=null&&a.newIterator))return!0;for(const i of a.newIterator()){if(i instanceof w.AcDbViewport){if(P.AcTrViewportView.isDefaultPaperSpaceViewport(i))continue;return!1}return!1}return!0}function xr(e,t){if(e.length<8)return e;const n=e.map(h=>({value:t==="x"?(h.minX+h.maxX)/2:(h.minY+h.maxY)/2,box:h})).sort((h,g)=>h.value-g.value),r=n[n.length-1].value-n[0].value;if(!(r>0))return e;let a=0,o=0;for(let h=1;h<n.length;h++){const g=n[h].value-n[h-1].value;g>a&&(a=g,o=h)}if(a<r*.2)return e;const i=n.slice(0,o),l=n.slice(o),s=i.length>=l.length?i:l,c=e.map(h=>Math.max(h.maxX-h.minX,h.maxY-h.minY,1e-9));c.sort((h,g)=>h-g);const d=c[Math.floor(c.length/2)]||1,u=[];for(let h=1;h<s.length;h++)u.push(s[h].value-s[h-1].value);u.sort((h,g)=>h-g);const f=u.length>0&&u[Math.floor(u.length/2)]||d,p=Math.max(f*10,d*20);return a<p?e:s.map(h=>h.box)}function fi(e){if(e.length===0)return null;const t=hi(e);if(e.length<8)return t;let n=e.slice(),r=-1;for(;n.length!==r;)r=n.length,n=xr(n,"x"),n=xr(n,"y");return hi(n)??t}function hi(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.minX<t&&(t=o.minX),o.minY<n&&(n=o.minY),o.maxX>r&&(r=o.maxX),o.maxY>a&&(a=o.maxY);return!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)?null:{minX:t,minY:n,maxX:r,maxY:a}}function Qe(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function gi(e,t,n){if(t.length<3)return;const r=n[0],a=n[1];for(let o=0;o+2<t.length;o+=3){const i=Re(t[o],r),l=Re(t[o+1],a);e.valid?(i<e.minX&&(e.minX=i),i>e.maxX&&(e.maxX=i),l<e.minY&&(e.minY=l),l>e.maxY&&(e.maxY=l)):(e.minX=e.maxX=i,e.minY=e.maxY=l,e.valid=!0)}}function ye(e,t){gi(e,t.positions,t.offset)}function et(e){return e.valid?{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY}:null}function yi(e,t){const n=Qe();for(const r of e)ye(n,r);for(const r of t)ye(n,r);return et(n)}function wr(e,t){return e?t?{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}:e:t??null}function xi(e){if(!e||e.length===0)return null;let t=null;for(const n of e)t=wr(t,n.paper);return t}function tt(e){return wr(yi(e.lineBatches,e.meshBatches),xi(e.viewports))}function $d(e,t){return e.fitExtents??tt(e)??t??{minX:0,minY:0,maxX:1,maxY:1}}function jd(e,t){return e.btrId===t.activeLayoutBtrId?t.meta.viewExtents??e.savedView??t.meta.extents:e.savedView??t.meta.extents}function wi(e){const t=[],n=r=>{if(r.positions.length<3)return;const a=Qe();ye(a,r);const o=et(a);o&&t.push({layer:r.layer,extents:o})};for(const r of e.lineBatches)n(r);for(const r of e.meshBatches)n(r);return t}function vi(e,t){var d;const n=t==null?void 0:t.isLayerVisible,r=e.filter(u=>!n||n(u.layer));if(r.length===0&&!((d=t==null?void 0:t.viewports)!=null&&d.length))return null;const a=r.map(u=>Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY,1e-9));for(const u of(t==null?void 0:t.viewports)??[])a.push(Math.max(u.paper.maxX-u.paper.minX,u.paper.maxY-u.paper.minY,1e-9));a.sort((u,f)=>u-f);const o=a[Math.floor(a.length/2)]||1,i=Math.max(o*50,1e10),l=[],s=(t==null?void 0:t.sampleFromLayout)!=null;for(const u of r){if(Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY)>=i){if(s){const p=t.sampleFromLayout,h=bi(p.lineBatches,u)??bi(p.meshBatches,u);if(h&&h.positions.length>=3){Jd(h,l);continue}}continue}l.push(u.extents)}for(const u of(t==null?void 0:t.viewports)??[])l.push(u.paper);const c=Kd(l);return fi(c.length>0?c:l)}function Kd(e){if(e.length<2)return e;const t=e.map(d=>({x:(d.minX+d.maxX)/2,y:(d.minY+d.maxY)/2,box:d})),n=t.map(d=>d.x).sort((d,u)=>d-u),r=t.map(d=>d.y).sort((d,u)=>d-u),a=n[Math.floor(n.length/2)],o=r[Math.floor(r.length/2)],i=e.map(d=>Math.max(d.maxX-d.minX,d.maxY-d.minY,1e-9));i.sort((d,u)=>d-u);const l=i[Math.floor(i.length/2)]||1,s=Math.max(l*50,1e10),c=t.filter(d=>Math.hypot(d.x-a,d.y-o)<=s);return c.length>0?c.map(d=>d.box):e}function bi(e,t){for(const n of e){if(n.layer!==t.layer||n.positions.length<3)continue;const r=Qe();ye(r,n);const a=et(r);if(a&&a.minX===t.extents.minX&&a.minY===t.extents.minY&&a.maxX===t.extents.maxX&&a.maxY===t.extents.maxY)return n}}function Zd(e,t){const n=wi(e);return vi(n,{isLayerVisible:t,viewports:e.viewports,sampleFromLayout:e})??tt(e)}const Wd=256;function Jd(e,t){const n=e.positions,r=e.offset,a=Math.floor(n.length/3);if(a<=0)return;const o=Math.max(1,Math.ceil(a/Wd));for(let i=0;i<a;i+=o){const l=i*3,s=Re(n[l],r[0]),c=Re(n[l+1],r[1]);!Number.isFinite(s)||!Number.isFinite(c)||t.push({minX:s,minY:c,maxX:s,maxY:c})}}function qd(e,t){const n=new Map,r=o=>{let i=n.get(o);return i||(i=Qe(),n.set(o,i)),i};for(const o of e)ye(r(o.layer),o);for(const o of t)ye(r(o.layer),o);const a=new Map;for(const[o,i]of n)a.set(o,et(i));return a}function ki(e,t,n){if(n)return;const r=eu(e,t);if(!(r!=null&&r.newIterator))return;const a=[];for(const o of r.newIterator()){if(!(o instanceof w.AcDbViewport)||P.AcTrViewportView.isDefaultPaperSpaceViewport(o)||typeof o.toGiViewport!="function")continue;const i=o.toGiViewport(),l=i.box,s=i.viewBox,c=Li(l),d=Li(s);if(!c||!d)continue;const u=Number.isFinite(i.viewTwistAngle)?i.viewTwistAngle:o.viewTwistAngle,f=Qd(i,o),p={paper:c,model:d};Number.isFinite(u)&&Math.abs(u)>1e-12&&(p.twist=u),f.length>0&&(p.frozenLayers=f),a.push(p)}return a.length>0?a:void 0}function Qd(e,t){var i;const n=e.frozenLayers;if(n&&n.length>0)return[...n];const r=t.frozenLayerIds;if(!(r!=null&&r.length))return[];const a=(i=t.database)==null?void 0:i.tables.layerTable;if(!a)return[];const o=[];for(const l of r){const s=a.getIdAt(l);s&&o.push(s.name)}return o}function Li(e){if(typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function eu(e,t){var o;const n=(o=e.tables)==null?void 0:o.blockTable;if(!n)return;const r=typeof n.getIdAt=="function"?n.getIdAt(t):void 0;if(r)return r;if(typeof n.newIterator=="function"){for(const i of n.newIterator())if(i.objectId===t)return i}const a=n.modelSpace;if((a==null?void 0:a.objectId)===t)return a}const Ai=16/9;function Ci(e,t,n,r=Ai){var i,l,s,c;const a=Number.isFinite(r)&&r>0?r:Ai;if(n){const d=(s=(l=(i=e.tables)==null?void 0:i.viewportTable)==null?void 0:l.getActiveVportBox)==null?void 0:s.call(l,a);return Ei(d)}const o=(c=e.objects)==null?void 0:c.layout;if(o!=null&&o.newIterator){for(const d of o.newIterator())if(d.blockTableRecordId===t)return Ei(d.limits)}}function Ei(e){if(!e||typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function vr(e){var r;const t=(r=e.objects)==null?void 0:r.layout;if(!(t!=null&&t.newIterator))return[];const n=[];for(const a of t.newIterator()){const o=a.blockTableRecordId;o&&n.push({name:a.layoutName||o,tabOrder:a.tabOrder??0,blockTableRecordId:o})}return n.sort((a,o)=>a.tabOrder-o.tabOrder),n}function tu(e,t,n={}){return ru(e,t,n)}async function nu(e,t,n={}){const r=n.yieldBetweenLayouts;r&&await r();const a=n.exportInvisibleLayers!==!1,o=n.exportLayouts!==!1,i=n.exportEmptyLayouts===!0,l=a?void 0:g=>br(t,g,a),s=Dn(e,{title:n.title,background:n.background}),c=Hi(t,a),d=vr(e),u=new Map(d.map(g=>[g.blockTableRecordId,g.name])),f=Pi(e,t,o,i),p=Mi(e,t,d,o,i),h=[];for(const g of p)h.push(Ii(e,t,g,u,n,l)),r&&await r();return{version:R,meta:Si(s,n,h,f),layers:c,layouts:h,activeLayoutBtrId:f}}function ru(e,t,n){const r=n.exportInvisibleLayers!==!1,a=n.exportLayouts!==!1,o=n.exportEmptyLayouts===!0,i=r?void 0:h=>br(t,h,r),l=Dn(e,{title:n.title,background:n.background}),s=Hi(t,r),c=vr(e),d=new Map(c.map(h=>[h.blockTableRecordId,h.name])),u=Pi(e,t,a,o),f=Mi(e,t,c,a,o),p=[];for(const h of f)p.push(Ii(e,t,h,d,n,i));return{version:R,meta:Si(l,n,p,u),layers:s,layouts:p,activeLayoutBtrId:u}}function Hi(e,t){const n=[];for(const r of e.layers)br(e,r.name,t)&&n.push({name:r.name,color:r.color,visible:r.visible});return n}function Si(e,t,n,r){const a=n.find(l=>l.btrId===r)??n[0],o=a?tt(a):null,i=t.initialView??"fit";return{title:e.title,createdAt:new Date().toISOString(),extents:e.extents,viewExtents:o??void 0,units:e.units,grip:e.grip,background:e.background,locale:t.locale??"en",initialView:i,viewState:i==="current"?t.viewState:void 0,viewerMode:t.viewerMode??"measure",exportLayouts:t.exportLayouts!==!1,docsBaseUrl:t.docsBaseUrl??pi()}}function au(e){return(e.viewerMode??"measure")==="measure"}function br(e,t,n){if(n)return!0;const r=e.layers.find(a=>a.name===t);return r?r.visible:!0}function Mi(e,t,n,r,a){if(!r){const s=t.layouts.find(c=>c.btrId===t.modelSpaceBtrId);return s?[s]:[]}const o=new Map(t.layouts.map(s=>[s.btrId,s])),i=new Set,l=[];for(const s of n){if(i.has(s.blockTableRecordId)||(i.add(s.blockTableRecordId),!a&&yr(e,s.blockTableRecordId,t.modelSpaceBtrId)))continue;const c=o.get(s.blockTableRecordId);l.push(c??{btrId:s.blockTableRecordId,name:s.name,isModelSpace:s.blockTableRecordId===t.modelSpaceBtrId,layers:[]})}if(!l.some(s=>s.btrId===t.modelSpaceBtrId)){const s=o.get(t.modelSpaceBtrId);l.unshift(s??{btrId:t.modelSpaceBtrId,isModelSpace:!0,layers:[]})}return l}function Pi(e,t,n,r){if(!n)return t.modelSpaceBtrId;const a=t.activeLayoutBtrId||t.modelSpaceBtrId;return r||!yr(e,a,t.modelSpaceBtrId)?a:t.modelSpaceBtrId}function Ii(e,t,n,r,a,o){const i=[],l=[],s=t.frozenLayers&&t.frozenLayers.length>0?new Set(t.frozenLayers):void 0;for(const h of n.layers){if(o&&!o(h.name))continue;const g=Ba(h.root,{geometryLayerName:h.name,insertLayerByObjectId:n.insertLayerByObjectId,frozenLayers:s});for(const y of g.lineBatches)y.layer||(y.layer=h.name);for(const y of g.meshBatches)y.layer||(y.layer=h.name);i.push(...g.lineBatches),l.push(...g.meshBatches)}const c=n.isModelSpace||n.btrId===t.modelSpaceBtrId,d=Ci(e,n.btrId,c,a.canvasAspectRatio),u=ki(e,n.btrId,c),f=tt({lineBatches:i,meshBatches:l,viewports:u})??void 0;let p;if(au(a)){const h=performance.now();p=Wa(e,n.btrId,{includeLayer:o}),console.log(`[chtml] osnap catalog ${r.get(n.btrId)??n.name??n.btrId}: ${(performance.now()-h).toFixed(0)} ms (${(p==null?void 0:p.primitives.length)??0} primitives)`)}return{btrId:n.btrId,name:r.get(n.btrId)??n.name??ou(e,n.btrId),isModelSpace:c,lineBatches:i,meshBatches:l,osnap:p,viewports:u,...d?{savedView:d}:{},...f?{fitExtents:f}:{}}}function ou(e,t){var r;const n=(r=e.tables)==null?void 0:r.blockTable;if(n!=null&&n.newIterator){for(const a of n.newIterator())if(a.objectId===t)return a.name}return t}m.ACEC_CHUNK_MAGIC=Wn,m.ACEO_OSNAP_MAGIC=Ht,m.ACEO_OSNAP_VERSION=Cn,m.ACEX_COORDINATE_BADGE_LIFT_EM=Po,m.ACEX_COORDINATE_BADGE_REF_FONT_PX=Jc,m.ACEX_DEFAULT_CHUNK_MAX_BYTES=ao,m.ACEX_DEFAULT_DOCS_BASE_URL=fr,m.ACEX_DEFAULT_MANIFEST_FILE=ne,m.ACEX_DEFAULT_MANIFEST_HREF=nr,m.ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES=Fl,m.ACEX_DEFAULT_OSNAP_MODES=Js,m.ACEX_DEFAULT_POLAR_ANGLE=$c,m.ACEX_DOCS_PATH_MAGNIFIER=Vd,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME=ei,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME_BASE64=Hd,m.ACEX_EMBEDDED_CHUNK_HREF_ATTR=ie,m.ACEX_EMBEDDED_CHUNK_MAX_BYTES=er,m.ACEX_EMBEDDED_CHUNK_MIME=Qo,m.ACEX_EMBEDDED_CHUNK_MIME_BASE64=Ed,m.ACEX_EMBEDDED_CHUNK_THRESHOLD_BYTES=oo,m.ACEX_EMBEDDED_OSNAP_CHUNK_MAX_BYTES=io,m.ACEX_GEOMETRY_CHUNK_FETCH_CONCURRENCY=Nt,m.ACEX_HTML_BACKGROUND_BLACK=qe,m.ACEX_HTML_BACKGROUND_WHITE=Wt,m.ACEX_HTML_EXPIRY_COUNTDOWN_MS=zo,m.ACEX_HTML_LOCALES=he,m.ACEX_HTML_LOCALE_BADGES=jn,m.ACEX_HTML_LOCALE_STORAGE_KEY=Kn,m.ACEX_HTML_MESSAGES=Zn,m.ACEX_HTML_SHELL_CSS=Gt,m.ACEX_MANIFEST_QUERY_KEYS=po,m.ACEX_MAX_BINARY_ARRAY_BYTES=fn,m.ACEX_MAX_BINARY_STRING_BYTES=Ur,m.ACEX_MAX_COMPRESSED_BYTES=dt,m.ACEX_MAX_DECOMPRESSED_BYTES=Nr,m.ACEX_MAX_GEOMETRY_BATCH_BYTES=$e,m.ACEX_ORTHO_POLAR_ANGLE=Ho,m.ACEX_PACKAGE_DIRECTORY_ORIGIN=Ke,m.ACEX_PACKAGE_VERSION=Qn,m.ACEX_POLAR_ANGLE_INCREMENTS=Eo,m.ACEX_SNAPSHOT_COMPRESSION=ct,m.ACEX_SNAPSHOT_VERSION=R,m.AcExHtmlBinaryReader=lt,m.AcExHtmlBinaryWriter=st,m.AcExHtmlCameraZoomUniform=In,m.AcExHtmlI18n=Tl,m.AcExHtmlIcons=Ee,m.F_LINE_DISTANCES=ht,m.F_LINE_EXCLUDE_OSNAP=wn,m.F_LINE_INDICES=pt,m.F_LINE_PATTERN=ft,m.F_LINE_RENDER_ORDER=yt,m.F_LINE_WIDTH=gt,m.F_MESH_GRADIENT_FILL=vt,m.F_MESH_GRADIENT_POS=bt,m.F_MESH_HATCH=wt,m.F_MESH_INDICES=xt,m.F_MESH_POINTS=vn,m.F_MESH_RENDER_ORDER=Lt,m.F_MESH_SIDE=kt,m.F_MESH_TEXTURE=At,m.ML_UI_COMPACT_MAX_WIDTH=Mo,m.ML_UI_MOBILE_MAX_WIDTH=So,m.acexHtmlApplyBackground=Xd,m.acexHtmlArcToAcGe=Fa,m.acexHtmlArcWcsPoint=Nn,m.acexHtmlBackgroundRgb=ci,m.acexHtmlBakePlainDrawableSlice=Mt,m.acexHtmlBase64ToBytes=Ro,m.acexHtmlBase85ToBytes=Vr,m.acexHtmlBuildAccessManifest=We,m.acexHtmlBuildLocaleStrip=Zc,m.acexHtmlBuildOsnapCatalog=Wa,m.acexHtmlBuildPackage=Ld,m.acexHtmlBuildPackageAsync=Ad,m.acexHtmlBuildPackageData=qo,m.acexHtmlBuildPackageDataAsync=ur,m.acexHtmlBuildPackageDirectoryFileMap=Gl,m.acexHtmlBuildPolarAnglesPanel=or,m.acexHtmlBuildShellBody=$t,m.acexHtmlBuildSnapStrip=Wc,m.acexHtmlBuildSnapshotFromExportScene=tu,m.acexHtmlBuildSnapshotFromExportSceneAsync=nu,m.acexHtmlBuildViewerMetadata=Dn,m.acexHtmlBytesToBase64=Oo,m.acexHtmlBytesToBase85=Xr,m.acexHtmlBytesToText=ve,m.acexHtmlCanOpenLocalPackageFolder=Ul,m.acexHtmlCaptureSavedViewExtents=Ci,m.acexHtmlChooseInitialManifestHref=Xl,m.acexHtmlCircleOrArcToAcGe=Ra,m.acexHtmlCollectBatchesFromObject3D=Ba,m.acexHtmlCollectEmbeddedChunkBytes=Bd,m.acexHtmlCollectLayoutBatchExtentEntries=wi,m.acexHtmlCollectLayoutViewports=ki,m.acexHtmlCompactIndexedSlice=Mn,m.acexHtmlCompressSnapshotBinary=we,m.acexHtmlCompressSnapshotBinaryAsync=hn,m.acexHtmlComputeIntelligentExtentsFromBatchEntries=vi,m.acexHtmlComputeIntelligentLayoutExtents=Zd,m.acexHtmlComputeLayerExtentsMap=qd,m.acexHtmlComputeLayoutExtents=yi,m.acexHtmlComputeLayoutViewExtents=tt,m.acexHtmlComputeLineDistancesForSegments=It,m.acexHtmlComputeViewportPaperExtents=xi,m.acexHtmlConsumeEmbeddedChunkFromDom=ni,m.acexHtmlCopyFloat32Range=ee,m.acexHtmlCopyUint32Range=ca,m.acexHtmlCreateAccessKey=jt,m.acexHtmlCreateDomEmbeddedPackageFetch=zd,m.acexHtmlCreateEmbeddedPackageFetch=ri,m.acexHtmlCreateEmptyExtents=Qe,m.acexHtmlCreateOrderedBytePrefetcher=Xt,m.acexHtmlCreatePackageDirectoryFetch=$l,m.acexHtmlCreateTextureFromExportedBytes=ya,m.acexHtmlCreateViewerLineMaterial=_s,m.acexHtmlCreateViewerMeshMaterial=Ts,m.acexHtmlCreateViewerPointsMaterial=Bs,m.acexHtmlDecodeChunkBinary=Jn,m.acexHtmlDecodeChunkGzip=ro,m.acexHtmlDecodeChunkPayload=qn,m.acexHtmlDecodeOsnapCatalogBinary=St,m.acexHtmlDecodeOsnapCatalogGzip=ea,m.acexHtmlDecodeOsnapCatalogPayload=ta,m.acexHtmlDecodeSnapshot=Ls,m.acexHtmlDecodeSnapshotBinary=aa,m.acexHtmlDecodeSnapshotFromCompressedBytes=ia,m.acexHtmlDecompressSnapshotBinary=ut,m.acexHtmlDecryptBytes=Zt,m.acexHtmlDecryptEmbeddedManifest=Fd,m.acexHtmlDecryptSnapshotPayload=dd,m.acexHtmlDetectBrowserLocale=Ja,m.acexHtmlDetectLocalFolderOpenSupport=Nl,m.acexHtmlDetectLocale=qa,m.acexHtmlDetectSharedDirectoryRoot=yo,m.acexHtmlDocsUrl=Gd,m.acexHtmlDropdownItem=Gc,m.acexHtmlEllipseArcDelta=Oa,m.acexHtmlEllipsePointAtNormalized=qs,m.acexHtmlEllipseToAcGe=Da,m.acexHtmlEncodeChunkBinary=Ge,m.acexHtmlEncodeChunkGzip=no,m.acexHtmlEncodeOsnapCatalogBinary=be,m.acexHtmlEncodeOsnapCatalogGzip=Qr,m.acexHtmlEncodeSnapshot=oa,m.acexHtmlEncodeSnapshotBinary=ra,m.acexHtmlEncodeTextureForExport=fa,m.acexHtmlEncryptBytes=Kt,m.acexHtmlEncryptSnapshotPayload=Fo,m.acexHtmlEstimateLineBatchBytes=Ct,m.acexHtmlEstimateMeshBatchBytes=Et,m.acexHtmlEstimateOsnapPrimitiveBytes=En,m.acexHtmlEstimateSnapshotGeometryBytes=ti,m.acexHtmlExpandExtentsFromBatch=ye,m.acexHtmlExpandExtentsFromPositions=gi,m.acexHtmlExportActiveBatchedLine2Slice=Ea,m.acexHtmlExportActiveBatchedSlice=Bt,m.acexHtmlExportBufferGeometrySlice=De,m.acexHtmlExportLineDistanceSlice=Is,m.acexHtmlExportPlainDrawableSlice=ma,m.acexHtmlExportUvsForPositionSlice=ga,m.acexHtmlExportVertexAttributeSlice=ka,m.acexHtmlExtractGradientFill=ba,m.acexHtmlExtractHatchPattern=va,m.acexHtmlExtractLinePattern=wa,m.acexHtmlFindDefaultManifestInDirectory=jl,m.acexHtmlFormatCountdown=ld,m.acexHtmlFormatExpiresAt=sd,m.acexHtmlFormatMessage=eo,m.acexHtmlGetDocsBaseUrl=pi,m.acexHtmlGlobalFetch=Ze,m.acexHtmlIsAbsoluteHttpUrl=ho,m.acexHtmlIsAccessExpired=od,m.acexHtmlIsEmptyPaperSpaceLayout=yr,m.acexHtmlIsExpiryCountdownActive=id,m.acexHtmlIsGzipPayload=gn,m.acexHtmlIsLocale=Bl,m.acexHtmlIsSafePackageHref=so,m.acexHtmlIsTransparentImagePlaceholder=Pn,m.acexHtmlLayoutBackground=pr,m.acexHtmlListDatabaseLayouts=vr,m.acexHtmlLoadPackage=Rl,m.acexHtmlLoadPackageLayout=Dl,m.acexHtmlLoadPackageLayoutOsnap=uo,m.acexHtmlNeedsAccessControl=cr,m.acexHtmlNormalizeArcDelta=Un,m.acexHtmlNormalizeDocsBaseUrl=gr,m.acexHtmlNormalizePackageDirectoryPath=go,m.acexHtmlOmitNonFinitePrimitives=fe,m.acexHtmlPackHtml=ed,m.acexHtmlPackHtmlEmbeddedPackage=Md,m.acexHtmlPackHtmlPackage=sr,m.acexHtmlParseAccessManifest=cd,m.acexHtmlParseBinaryEncoding=xn,m.acexHtmlParseEmbeddedPackageConfig=_d,m.acexHtmlParsePackageManifest=je,m.acexHtmlPrimitiveToAcGeCurve=Qs,m.acexHtmlProbePackageManifest=Yl,m.acexHtmlProtectEncodedSnapshot=ud,m.acexHtmlReadBatchWorldOffset=da,m.acexHtmlReadEmbeddedChunkFromDom=Td,m.acexHtmlReadLineBatch=kn,m.acexHtmlReadManifestUrlFromSearchParams=fo,m.acexHtmlReadMeshBatch=An,m.acexHtmlRebaseHatchPatternToLocalOffset=La,m.acexHtmlRebasePlainDrawableSliceAroundCentroid=Pt,m.acexHtmlReleaseExportedTextureBytes=xa,m.acexHtmlRemapSnapshotForegroundForBackground=mi,m.acexHtmlResolveBackground=li,m.acexHtmlResolveChunkUrl=Yt,m.acexHtmlResolveExpiresAt=ad,m.acexHtmlResolveLayoutFallbackExtents=jd,m.acexHtmlResolveLayoutViewExtents=$d,m.acexHtmlResolveLocale=Ae,m.acexHtmlResolvePackageManifestUrl=co,m.acexHtmlResolveViewerManifestUrl=Vl,m.acexHtmlSetDocsBaseUrl=Yd,m.acexHtmlSetHeadlessPngEncoder=As,m.acexHtmlSetSnapshotCompressor=is,m.acexHtmlShouldEmbedChunks=Sd,m.acexHtmlSnapshotMimeType=la,m.acexHtmlSnapshotPayloadToCompressedBytes=sa,m.acexHtmlSnapshotSkeletonFromManifest=lo,m.acexHtmlSplineToAcGe=Ua,m.acexHtmlSplitDominantCluster=xr,m.acexHtmlSplitLayoutIntoSlices=Zo,m.acexHtmlSplitLineBatch=No,m.acexHtmlSplitMeshBatch=Xo,m.acexHtmlSplitOsnapPrimitives=qr,m.acexHtmlTextToBytes=ze,m.acexHtmlToExtents=et,m.acexHtmlToWcsCoord=Re,m.acexHtmlToolbarButton=ar,m.acexHtmlTransformHatchPatternToWorldSpace=Bn,m.acexHtmlUnionDominantCluster=fi,m.acexHtmlUnionExtents=wr,m.acexHtmlUnzipPackageFiles=Ud,m.acexHtmlWcsPointToOcsArcAngle=Xn,m.acexHtmlWriteLineBatch=bn,m.acexHtmlWriteMeshBatch=Ln,m.acexHtmlZipPackageFiles=Dd,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
|
|
1573
|
+
</html>`}function Id(e){const t=[];for(const n of e)n.path!==ne&&t.push(` <script type="${ei}" ${ie}="${ii(n.path)}">${ve(n.bytes,"base85")}<\/script>
|
|
1574
|
+
`);return t.join("")}async function _d(e,t){const n=[];for(const r of e){if(r.path===ne)continue;const a=await Kt(t,r.bytes);n.push(` <script type="${ti}" ${ie}="${ii(r.path)}">${ve(a,"base85")}<\/script>
|
|
1575
|
+
`)}return n.join("")}function mr(e){const t=e.textContent??"";if(t.length===0)return;const n=t.charCodeAt(0)<=32||t.charCodeAt(t.length-1)<=32?t.trim():t;if(n.length===0)return;const r=xn(e.getAttribute("type"));return ze(n,r)}function Bd(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.mode)!=="embedded"?null:n.encrypted===!0?typeof n.encryptedManifest!="string"?null:n:n.manifest?{mode:"embedded",manifest:je(n.manifest)}:null}catch{return null}}function Td(e=document){const t=new Map;return e.querySelectorAll(`script[${ie}]`).forEach(r=>{var i;const a=(i=r.getAttribute(ie))==null?void 0:i.trim();if(!a)return;const o=mr(r);o&&t.set(a,o)}),t}function zd(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())===e)return mr(o)}}function ri(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())!==e)continue;const l=mr(o);return l?(o.remove(),l):void 0}}function Fd(e){const t=e.root??document,n=new Map;return ai({manifest:e.manifest,decryptKey:e.decryptKey,getChunk:async r=>{const a=n.get(r);if(a)return a;const o=ri(r,t);return o&&n.set(r,o),o}})}function ai(e){const t=ne,n=new URL(t,Ke).toString(),r=new URL(Ke).origin,a=`${JSON.stringify(e.manifest)}
|
|
1576
|
+
`,o=e.decryptKey??null,i=e.consumeOnFetch!==!1,l=e.chunkBytes,s=e.getChunk;return{manifestUrl:n,fetchImpl:async d=>{const u=new URL(String(d));if(u.origin!==r)return new Response(null,{status:404});const p=decodeURIComponent(u.pathname.replace(/^\/+/,""));if(p===t)return new Response(a,{status:200,headers:{"Content-Type":"application/json"}});let f;if(s?f=await s(p):l&&(f=l.get(p)),!f)return new Response(null,{status:404});const h=o?await Zt(o,f):f;return i&&l&&l.delete(p),new Response(h,{status:200})}}}async function Od(e,t){const n=await Zt(t,Do(e)),r=new TextDecoder().decode(n);return je(JSON.parse(r))}function oi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function ii(e){return oi(e).replace(/'/g,"'")}function Rd(e){return e.replace(/<\/script/gi,"<\\/script")}function si(e){return e.replace(/</g,"\\u003c")}function li(e){return!e||e.startsWith("/")||e.includes("\\")||e.includes("\0")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."&&/^[A-Za-z0-9._-]+$/.test(n))}function Dd(e){return e.endsWith(".gz")}function Ud(e){const t={};for(const n of e.files){if(!li(n.path))throw new Error(`Unsafe package path: ${n.path}`);Dd(n.path)?t[n.path]=[n.bytes,{level:0}]:t[n.path]=[n.bytes,{level:6}]}return os(t)}function Nd(e){const t=is(e),n=[];for(const[r,a]of Object.entries(t)){if(!li(r))throw new Error("Unsafe path in package archive");n.push({path:r,bytes:a})}return n}const pr="preview.jpg";function Xd(e,t){return t!=null&&t.length?[...e.filter(n=>n.path!==pr),{path:pr,bytes:t}]:e}const Je=0,Wt=16777215;function ci(e){return e==="white"||e==="space"?e:"black"}function di(e){return e==="white"?Wt:Je}function fr(e,t,n){return e==="space"?t?Je:Wt:n>>>0}function ui(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255;return(n*299+r*587+a*114)/1e3>=128}function Vd(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255,o=Math.max(n,r,a),i=Math.min(n,r,a);return o-i>16?null:o<=40?Wt:i>=215?Je:null}function qt(e){return Vd(e)??e}function mi(e,t,n){if(ui(t)!==ui(n)){for(const r of e.lineBatches)r.color=qt(r.color);for(const r of e.meshBatches){if(r.texture)continue;r.color=qt(r.color);const a=r.gradientFill;a&&(a.startColor=qt(a.startColor),a.endColor=qt(a.endColor))}}}function pi(e,t,n){const r=n>>>0;e.meta.background=r;for(const a of e.layouts)mi(a,t,r)}function Yd(e,t,n){const r=ci(n);if(e.meta.backgroundMode=r,r==="space"){for(const o of e.layouts)mi(o,t,fr("space",o.isModelSpace,0));const a=e.layouts.find(o=>o.btrId===e.activeLayoutBtrId);e.meta.background=fr("space",a==null||a.isModelSpace,Je);return}pi(e,t,di(r)),e.meta.backgroundMode=r}const Gd="guide/magnifier.html",hr="https://mlightcad.com/cad-viewer/docs/";let gr=yr(hr);function fi(){return gr}function $d(e){gr=yr(e)}function jd(e,t){const n=t.toLowerCase().split(/[-_]/)[0],r=!n||n==="en"?"":`/${n}`,a=e.replace(/^\/+/,"");return`${gr}${r}/${a}`}function yr(e){const t=e.trim();return t?t.replace(/\/+$/,""):hr.replace(/\/+$/,"")}function xr(e,t,n){var o;if(t===n)return!1;const r=(o=e.tables)==null?void 0:o.blockTable,a=typeof(r==null?void 0:r.getIdAt)=="function"?r.getIdAt(t):void 0;if(!(a!=null&&a.newIterator))return!0;for(const i of a.newIterator()){if(i instanceof w.AcDbViewport){if(P.AcTrViewportView.isDefaultPaperSpaceViewport(i))continue;return!1}return!1}return!0}function wr(e,t){if(e.length<8)return e;const n=e.map(h=>({value:t==="x"?(h.minX+h.maxX)/2:(h.minY+h.maxY)/2,box:h})).sort((h,g)=>h.value-g.value),r=n[n.length-1].value-n[0].value;if(!(r>0))return e;let a=0,o=0;for(let h=1;h<n.length;h++){const g=n[h].value-n[h-1].value;g>a&&(a=g,o=h)}if(a<r*.2)return e;const i=n.slice(0,o),l=n.slice(o),s=i.length>=l.length?i:l,c=e.map(h=>Math.max(h.maxX-h.minX,h.maxY-h.minY,1e-9));c.sort((h,g)=>h-g);const d=c[Math.floor(c.length/2)]||1,u=[];for(let h=1;h<s.length;h++)u.push(s[h].value-s[h-1].value);u.sort((h,g)=>h-g);const p=u.length>0&&u[Math.floor(u.length/2)]||d,f=Math.max(p*10,d*20);return a<f?e:s.map(h=>h.box)}function hi(e){if(e.length===0)return null;const t=gi(e);if(e.length<8)return t;let n=e.slice(),r=-1;for(;n.length!==r;)r=n.length,n=wr(n,"x"),n=wr(n,"y");return gi(n)??t}function gi(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.minX<t&&(t=o.minX),o.minY<n&&(n=o.minY),o.maxX>r&&(r=o.maxX),o.maxY>a&&(a=o.maxY);return!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)?null:{minX:t,minY:n,maxX:r,maxY:a}}function Qe(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function yi(e,t,n){if(t.length<3)return;const r=n[0],a=n[1];for(let o=0;o+2<t.length;o+=3){const i=Re(t[o],r),l=Re(t[o+1],a);e.valid?(i<e.minX&&(e.minX=i),i>e.maxX&&(e.maxX=i),l<e.minY&&(e.minY=l),l>e.maxY&&(e.maxY=l)):(e.minX=e.maxX=i,e.minY=e.maxY=l,e.valid=!0)}}function ye(e,t){yi(e,t.positions,t.offset)}function et(e){return e.valid?{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY}:null}function xi(e,t){const n=Qe();for(const r of e)ye(n,r);for(const r of t)ye(n,r);return et(n)}function vr(e,t){return e?t?{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}:e:t??null}function wi(e){if(!e||e.length===0)return null;let t=null;for(const n of e)t=vr(t,n.paper);return t}function tt(e){return vr(xi(e.lineBatches,e.meshBatches),wi(e.viewports))}function Kd(e,t){return e.fitExtents??tt(e)??t??{minX:0,minY:0,maxX:1,maxY:1}}function Zd(e,t){return e.btrId===t.activeLayoutBtrId?t.meta.viewExtents??e.savedView??t.meta.extents:e.savedView??t.meta.extents}function vi(e){const t=[],n=r=>{if(r.positions.length<3)return;const a=Qe();ye(a,r);const o=et(a);o&&t.push({layer:r.layer,extents:o})};for(const r of e.lineBatches)n(r);for(const r of e.meshBatches)n(r);return t}function bi(e,t){var d;const n=t==null?void 0:t.isLayerVisible,r=e.filter(u=>!n||n(u.layer));if(r.length===0&&!((d=t==null?void 0:t.viewports)!=null&&d.length))return null;const a=r.map(u=>Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY,1e-9));for(const u of(t==null?void 0:t.viewports)??[])a.push(Math.max(u.paper.maxX-u.paper.minX,u.paper.maxY-u.paper.minY,1e-9));a.sort((u,p)=>u-p);const o=a[Math.floor(a.length/2)]||1,i=Math.max(o*50,1e10),l=[],s=(t==null?void 0:t.sampleFromLayout)!=null;for(const u of r){if(Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY)>=i){if(s){const f=t.sampleFromLayout,h=ki(f.lineBatches,u)??ki(f.meshBatches,u);if(h&&h.positions.length>=3){Qd(h,l);continue}}continue}l.push(u.extents)}for(const u of(t==null?void 0:t.viewports)??[])l.push(u.paper);const c=Wd(l);return hi(c.length>0?c:l)}function Wd(e){if(e.length<2)return e;const t=e.map(d=>({x:(d.minX+d.maxX)/2,y:(d.minY+d.maxY)/2,box:d})),n=t.map(d=>d.x).sort((d,u)=>d-u),r=t.map(d=>d.y).sort((d,u)=>d-u),a=n[Math.floor(n.length/2)],o=r[Math.floor(r.length/2)],i=e.map(d=>Math.max(d.maxX-d.minX,d.maxY-d.minY,1e-9));i.sort((d,u)=>d-u);const l=i[Math.floor(i.length/2)]||1,s=Math.max(l*50,1e10),c=t.filter(d=>Math.hypot(d.x-a,d.y-o)<=s);return c.length>0?c.map(d=>d.box):e}function ki(e,t){for(const n of e){if(n.layer!==t.layer||n.positions.length<3)continue;const r=Qe();ye(r,n);const a=et(r);if(a&&a.minX===t.extents.minX&&a.minY===t.extents.minY&&a.maxX===t.extents.maxX&&a.maxY===t.extents.maxY)return n}}function qd(e,t){const n=vi(e);return bi(n,{isLayerVisible:t,viewports:e.viewports,sampleFromLayout:e})??tt(e)}const Jd=256;function Qd(e,t){const n=e.positions,r=e.offset,a=Math.floor(n.length/3);if(a<=0)return;const o=Math.max(1,Math.ceil(a/Jd));for(let i=0;i<a;i+=o){const l=i*3,s=Re(n[l],r[0]),c=Re(n[l+1],r[1]);!Number.isFinite(s)||!Number.isFinite(c)||t.push({minX:s,minY:c,maxX:s,maxY:c})}}function eu(e,t){const n=new Map,r=o=>{let i=n.get(o);return i||(i=Qe(),n.set(o,i)),i};for(const o of e)ye(r(o.layer),o);for(const o of t)ye(r(o.layer),o);const a=new Map;for(const[o,i]of n)a.set(o,et(i));return a}function Li(e,t,n){if(n)return;const r=nu(e,t);if(!(r!=null&&r.newIterator))return;const a=[];for(const o of r.newIterator()){if(!(o instanceof w.AcDbViewport)||P.AcTrViewportView.isDefaultPaperSpaceViewport(o)||typeof o.toGiViewport!="function")continue;const i=o.toGiViewport(),l=i.box,s=i.viewBox,c=Ai(l),d=Ai(s);if(!c||!d)continue;const u=Number.isFinite(i.viewTwistAngle)?i.viewTwistAngle:o.viewTwistAngle,p=tu(i,o),f={paper:c,model:d};Number.isFinite(u)&&Math.abs(u)>1e-12&&(f.twist=u),p.length>0&&(f.frozenLayers=p),a.push(f)}return a.length>0?a:void 0}function tu(e,t){var i;const n=e.frozenLayers;if(n&&n.length>0)return[...n];const r=t.frozenLayerIds;if(!(r!=null&&r.length))return[];const a=(i=t.database)==null?void 0:i.tables.layerTable;if(!a)return[];const o=[];for(const l of r){const s=a.getIdAt(l);s&&o.push(s.name)}return o}function Ai(e){if(typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function nu(e,t){var o;const n=(o=e.tables)==null?void 0:o.blockTable;if(!n)return;const r=typeof n.getIdAt=="function"?n.getIdAt(t):void 0;if(r)return r;if(typeof n.newIterator=="function"){for(const i of n.newIterator())if(i.objectId===t)return i}const a=n.modelSpace;if((a==null?void 0:a.objectId)===t)return a}const Ci=16/9;function Ei(e,t,n,r=Ci){var i,l,s,c;const a=Number.isFinite(r)&&r>0?r:Ci;if(n){const d=(s=(l=(i=e.tables)==null?void 0:i.viewportTable)==null?void 0:l.getActiveVportBox)==null?void 0:s.call(l,a);return Hi(d)}const o=(c=e.objects)==null?void 0:c.layout;if(o!=null&&o.newIterator){for(const d of o.newIterator())if(d.blockTableRecordId===t)return Hi(d.limits)}}function Hi(e){if(!e||typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function br(e){var r;const t=(r=e.objects)==null?void 0:r.layout;if(!(t!=null&&t.newIterator))return[];const n=[];for(const a of t.newIterator()){const o=a.blockTableRecordId;o&&n.push({name:a.layoutName||o,tabOrder:a.tabOrder??0,blockTableRecordId:o})}return n.sort((a,o)=>a.tabOrder-o.tabOrder),n}function ru(e,t,n={}){return ou(e,t,n)}async function au(e,t,n={}){const r=n.yieldBetweenLayouts;r&&await r();const a=n.exportInvisibleLayers!==!1,o=n.exportLayouts!==!1,i=n.exportEmptyLayouts===!0,l=a?void 0:g=>kr(t,g,a),s=Dn(e,{title:n.title,background:n.background}),c=Si(t,a),d=br(e),u=new Map(d.map(g=>[g.blockTableRecordId,g.name])),p=Ii(e,t,o,i),f=Pi(e,t,d,o,i),h=[];for(const g of f)h.push(_i(e,t,g,u,n,l)),r&&await r();return{version:R,meta:Mi(s,n,h,p),layers:c,layouts:h,activeLayoutBtrId:p}}function ou(e,t,n){const r=n.exportInvisibleLayers!==!1,a=n.exportLayouts!==!1,o=n.exportEmptyLayouts===!0,i=r?void 0:h=>kr(t,h,r),l=Dn(e,{title:n.title,background:n.background}),s=Si(t,r),c=br(e),d=new Map(c.map(h=>[h.blockTableRecordId,h.name])),u=Ii(e,t,a,o),p=Pi(e,t,c,a,o),f=[];for(const h of p)f.push(_i(e,t,h,d,n,i));return{version:R,meta:Mi(l,n,f,u),layers:s,layouts:f,activeLayoutBtrId:u}}function Si(e,t){const n=[];for(const r of e.layers)kr(e,r.name,t)&&n.push({name:r.name,color:r.color,visible:r.visible});return n}function Mi(e,t,n,r){const a=n.find(l=>l.btrId===r)??n[0],o=a?tt(a):null,i=t.initialView??"fit";return{title:e.title,createdAt:new Date().toISOString(),extents:e.extents,viewExtents:o??void 0,units:e.units,grip:e.grip,background:e.background,locale:t.locale??"en",initialView:i,viewState:i==="current"?t.viewState:void 0,viewerMode:t.viewerMode??"measure",exportLayouts:t.exportLayouts!==!1,docsBaseUrl:t.docsBaseUrl??fi()}}function iu(e){return(e.viewerMode??"measure")==="measure"}function kr(e,t,n){if(n)return!0;const r=e.layers.find(a=>a.name===t);return r?r.visible:!0}function Pi(e,t,n,r,a){if(!r){const s=t.layouts.find(c=>c.btrId===t.modelSpaceBtrId);return s?[s]:[]}const o=new Map(t.layouts.map(s=>[s.btrId,s])),i=new Set,l=[];for(const s of n){if(i.has(s.blockTableRecordId)||(i.add(s.blockTableRecordId),!a&&xr(e,s.blockTableRecordId,t.modelSpaceBtrId)))continue;const c=o.get(s.blockTableRecordId);l.push(c??{btrId:s.blockTableRecordId,name:s.name,isModelSpace:s.blockTableRecordId===t.modelSpaceBtrId,layers:[]})}if(!l.some(s=>s.btrId===t.modelSpaceBtrId)){const s=o.get(t.modelSpaceBtrId);l.unshift(s??{btrId:t.modelSpaceBtrId,isModelSpace:!0,layers:[]})}return l}function Ii(e,t,n,r){if(!n)return t.modelSpaceBtrId;const a=t.activeLayoutBtrId||t.modelSpaceBtrId;return r||!xr(e,a,t.modelSpaceBtrId)?a:t.modelSpaceBtrId}function _i(e,t,n,r,a,o){const i=[],l=[],s=t.frozenLayers&&t.frozenLayers.length>0?new Set(t.frozenLayers):void 0;for(const h of n.layers){if(o&&!o(h.name))continue;const g=Ta(h.root,{geometryLayerName:h.name,insertLayerByObjectId:n.insertLayerByObjectId,frozenLayers:s});for(const x of g.lineBatches)x.layer||(x.layer=h.name);for(const x of g.meshBatches)x.layer||(x.layer=h.name);i.push(...g.lineBatches),l.push(...g.meshBatches)}const c=n.isModelSpace||n.btrId===t.modelSpaceBtrId,d=Ei(e,n.btrId,c,a.canvasAspectRatio),u=Li(e,n.btrId,c),p=tt({lineBatches:i,meshBatches:l,viewports:u})??void 0;let f;if(iu(a)){const h=performance.now();f=qa(e,n.btrId,{includeLayer:o}),console.log(`[chtml] osnap catalog ${r.get(n.btrId)??n.name??n.btrId}: ${(performance.now()-h).toFixed(0)} ms (${(f==null?void 0:f.primitives.length)??0} primitives)`)}return{btrId:n.btrId,name:r.get(n.btrId)??n.name??su(e,n.btrId),isModelSpace:c,lineBatches:i,meshBatches:l,osnap:f,viewports:u,...d?{savedView:d}:{},...p?{fitExtents:p}:{}}}function su(e,t){var r;const n=(r=e.tables)==null?void 0:r.blockTable;if(n!=null&&n.newIterator){for(const a of n.newIterator())if(a.objectId===t)return a.name}return t}m.ACEC_CHUNK_MAGIC=Wn,m.ACEO_OSNAP_MAGIC=Ht,m.ACEO_OSNAP_VERSION=Cn,m.ACEX_COORDINATE_BADGE_LIFT_EM=Io,m.ACEX_COORDINATE_BADGE_REF_FONT_PX=Jc,m.ACEX_DEFAULT_CHUNK_MAX_BYTES=oo,m.ACEX_DEFAULT_DOCS_BASE_URL=hr,m.ACEX_DEFAULT_MANIFEST_FILE=ne,m.ACEX_DEFAULT_MANIFEST_HREF=nr,m.ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES=Ol,m.ACEX_DEFAULT_OSNAP_MODES=Js,m.ACEX_DEFAULT_POLAR_ANGLE=jc,m.ACEX_DOCS_PATH_MAGNIFIER=Gd,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME=ti,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME_BASE64=Sd,m.ACEX_EMBEDDED_CHUNK_HREF_ATTR=ie,m.ACEX_EMBEDDED_CHUNK_MAX_BYTES=er,m.ACEX_EMBEDDED_CHUNK_MIME=ei,m.ACEX_EMBEDDED_CHUNK_MIME_BASE64=Hd,m.ACEX_EMBEDDED_CHUNK_THRESHOLD_BYTES=io,m.ACEX_EMBEDDED_OSNAP_CHUNK_MAX_BYTES=so,m.ACEX_GEOMETRY_CHUNK_FETCH_CONCURRENCY=Nt,m.ACEX_HTML_BACKGROUND_BLACK=Je,m.ACEX_HTML_BACKGROUND_WHITE=Wt,m.ACEX_HTML_EXPIRY_COUNTDOWN_MS=Fo,m.ACEX_HTML_LOCALES=he,m.ACEX_HTML_LOCALE_BADGES=jn,m.ACEX_HTML_LOCALE_STORAGE_KEY=Kn,m.ACEX_HTML_MESSAGES=Zn,m.ACEX_HTML_SHELL_CSS=Gt,m.ACEX_MANIFEST_QUERY_KEYS=fo,m.ACEX_MAX_BINARY_ARRAY_BYTES=fn,m.ACEX_MAX_BINARY_STRING_BYTES=Nr,m.ACEX_MAX_COMPRESSED_BYTES=dt,m.ACEX_MAX_DECOMPRESSED_BYTES=Xr,m.ACEX_MAX_GEOMETRY_BATCH_BYTES=$e,m.ACEX_ORTHO_POLAR_ANGLE=So,m.ACEX_PACKAGE_DIRECTORY_ORIGIN=Ke,m.ACEX_PACKAGE_PREVIEW_FILE=pr,m.ACEX_PACKAGE_VERSION=Qn,m.ACEX_POLAR_ANGLE_INCREMENTS=Ho,m.ACEX_SNAPSHOT_COMPRESSION=ct,m.ACEX_SNAPSHOT_VERSION=R,m.AcExHtmlBinaryReader=lt,m.AcExHtmlBinaryWriter=st,m.AcExHtmlCameraZoomUniform=In,m.AcExHtmlI18n=zl,m.AcExHtmlIcons=Ee,m.F_LINE_DISTANCES=ht,m.F_LINE_EXCLUDE_OSNAP=wn,m.F_LINE_INDICES=pt,m.F_LINE_PATTERN=ft,m.F_LINE_RENDER_ORDER=yt,m.F_LINE_WIDTH=gt,m.F_MESH_GRADIENT_FILL=vt,m.F_MESH_GRADIENT_POS=bt,m.F_MESH_HATCH=wt,m.F_MESH_INDICES=xt,m.F_MESH_POINTS=vn,m.F_MESH_RENDER_ORDER=Lt,m.F_MESH_SIDE=kt,m.F_MESH_TEXTURE=At,m.ML_UI_COMPACT_MAX_WIDTH=Po,m.ML_UI_MOBILE_MAX_WIDTH=Mo,m.acexHtmlAppendPackagePreview=Xd,m.acexHtmlApplyBackground=Yd,m.acexHtmlArcToAcGe=Oa,m.acexHtmlArcWcsPoint=Nn,m.acexHtmlBackgroundRgb=di,m.acexHtmlBakePlainDrawableSlice=Mt,m.acexHtmlBase64ToBytes=Do,m.acexHtmlBase85ToBytes=Yr,m.acexHtmlBuildAccessManifest=We,m.acexHtmlBuildLocaleStrip=Wc,m.acexHtmlBuildOsnapCatalog=qa,m.acexHtmlBuildPackage=Ad,m.acexHtmlBuildPackageAsync=Cd,m.acexHtmlBuildPackageData=Qo,m.acexHtmlBuildPackageDataAsync=ur,m.acexHtmlBuildPackageDirectoryFileMap=$l,m.acexHtmlBuildPolarAnglesPanel=or,m.acexHtmlBuildShellBody=$t,m.acexHtmlBuildSnapStrip=qc,m.acexHtmlBuildSnapshotFromExportScene=ru,m.acexHtmlBuildSnapshotFromExportSceneAsync=au,m.acexHtmlBuildViewerMetadata=Dn,m.acexHtmlBytesToBase64=Ro,m.acexHtmlBytesToBase85=Vr,m.acexHtmlBytesToText=ve,m.acexHtmlCanOpenLocalPackageFolder=Nl,m.acexHtmlCaptureSavedViewExtents=Ei,m.acexHtmlChooseInitialManifestHref=Vl,m.acexHtmlCircleOrArcToAcGe=Da,m.acexHtmlCollectBatchesFromObject3D=Ta,m.acexHtmlCollectEmbeddedChunkBytes=Td,m.acexHtmlCollectLayoutBatchExtentEntries=vi,m.acexHtmlCollectLayoutViewports=Li,m.acexHtmlCompactIndexedSlice=Mn,m.acexHtmlCompressSnapshotBinary=we,m.acexHtmlCompressSnapshotBinaryAsync=hn,m.acexHtmlComputeIntelligentExtentsFromBatchEntries=bi,m.acexHtmlComputeIntelligentLayoutExtents=qd,m.acexHtmlComputeLayerExtentsMap=eu,m.acexHtmlComputeLayoutExtents=xi,m.acexHtmlComputeLayoutViewExtents=tt,m.acexHtmlComputeLineDistancesForSegments=It,m.acexHtmlComputeViewportPaperExtents=wi,m.acexHtmlConsumeEmbeddedChunkFromDom=ri,m.acexHtmlCopyFloat32Range=ee,m.acexHtmlCopyUint32Range=da,m.acexHtmlCreateAccessKey=jt,m.acexHtmlCreateDomEmbeddedPackageFetch=Fd,m.acexHtmlCreateEmbeddedPackageFetch=ai,m.acexHtmlCreateEmptyExtents=Qe,m.acexHtmlCreateOrderedBytePrefetcher=Xt,m.acexHtmlCreatePackageDirectoryFetch=jl,m.acexHtmlCreateTextureFromExportedBytes=xa,m.acexHtmlCreateViewerLineMaterial=Bs,m.acexHtmlCreateViewerMeshMaterial=zs,m.acexHtmlCreateViewerPointsMaterial=Ts,m.acexHtmlDecodeChunkBinary=qn,m.acexHtmlDecodeChunkGzip=ao,m.acexHtmlDecodeChunkPayload=Jn,m.acexHtmlDecodeOsnapCatalogBinary=St,m.acexHtmlDecodeOsnapCatalogGzip=ta,m.acexHtmlDecodeOsnapCatalogPayload=na,m.acexHtmlDecodeSnapshot=As,m.acexHtmlDecodeSnapshotBinary=oa,m.acexHtmlDecodeSnapshotFromCompressedBytes=sa,m.acexHtmlDecompressSnapshotBinary=ut,m.acexHtmlDecryptBytes=Zt,m.acexHtmlDecryptEmbeddedManifest=Od,m.acexHtmlDecryptSnapshotPayload=ud,m.acexHtmlDetectBrowserLocale=Ja,m.acexHtmlDetectLocalFolderOpenSupport=Xl,m.acexHtmlDetectLocale=Qa,m.acexHtmlDetectSharedDirectoryRoot=xo,m.acexHtmlDocsUrl=jd,m.acexHtmlDropdownItem=$c,m.acexHtmlEllipseArcDelta=Ra,m.acexHtmlEllipsePointAtNormalized=Qs,m.acexHtmlEllipseToAcGe=Ua,m.acexHtmlEncodeChunkBinary=Ge,m.acexHtmlEncodeChunkGzip=ro,m.acexHtmlEncodeOsnapCatalogBinary=be,m.acexHtmlEncodeOsnapCatalogGzip=ea,m.acexHtmlEncodeSnapshot=ia,m.acexHtmlEncodeSnapshotBinary=aa,m.acexHtmlEncodeTextureForExport=ha,m.acexHtmlEncryptBytes=Kt,m.acexHtmlEncryptSnapshotPayload=Oo,m.acexHtmlEstimateLineBatchBytes=Ct,m.acexHtmlEstimateMeshBatchBytes=Et,m.acexHtmlEstimateOsnapPrimitiveBytes=En,m.acexHtmlEstimateSnapshotGeometryBytes=ni,m.acexHtmlExpandExtentsFromBatch=ye,m.acexHtmlExpandExtentsFromPositions=yi,m.acexHtmlExportActiveBatchedLine2Slice=Ha,m.acexHtmlExportActiveBatchedSlice=Bt,m.acexHtmlExportBufferGeometrySlice=De,m.acexHtmlExportLineDistanceSlice=_s,m.acexHtmlExportPlainDrawableSlice=pa,m.acexHtmlExportUvsForPositionSlice=ya,m.acexHtmlExportVertexAttributeSlice=La,m.acexHtmlExtractGradientFill=ka,m.acexHtmlExtractHatchPattern=ba,m.acexHtmlExtractLinePattern=va,m.acexHtmlFindDefaultManifestInDirectory=Kl,m.acexHtmlFormatCountdown=cd,m.acexHtmlFormatExpiresAt=ld,m.acexHtmlFormatMessage=to,m.acexHtmlGetDocsBaseUrl=fi,m.acexHtmlGlobalFetch=Ze,m.acexHtmlIsAbsoluteHttpUrl=go,m.acexHtmlIsAccessExpired=id,m.acexHtmlIsEmptyPaperSpaceLayout=xr,m.acexHtmlIsExpiryCountdownActive=sd,m.acexHtmlIsGzipPayload=gn,m.acexHtmlIsLocale=Tl,m.acexHtmlIsSafePackageHref=lo,m.acexHtmlIsTransparentImagePlaceholder=Pn,m.acexHtmlLayoutBackground=fr,m.acexHtmlListDatabaseLayouts=br,m.acexHtmlLoadPackage=Dl,m.acexHtmlLoadPackageLayout=Ul,m.acexHtmlLoadPackageLayoutOsnap=mo,m.acexHtmlNeedsAccessControl=cr,m.acexHtmlNormalizeArcDelta=Un,m.acexHtmlNormalizeDocsBaseUrl=yr,m.acexHtmlNormalizePackageDirectoryPath=yo,m.acexHtmlOmitNonFinitePrimitives=fe,m.acexHtmlPackHtml=td,m.acexHtmlPackHtmlEmbeddedPackage=Pd,m.acexHtmlPackHtmlPackage=sr,m.acexHtmlParseAccessManifest=dd,m.acexHtmlParseBinaryEncoding=xn,m.acexHtmlParseEmbeddedPackageConfig=Bd,m.acexHtmlParsePackageManifest=je,m.acexHtmlPrimitiveToAcGeCurve=el,m.acexHtmlProbePackageManifest=Gl,m.acexHtmlProtectEncodedSnapshot=md,m.acexHtmlReadBatchWorldOffset=ua,m.acexHtmlReadEmbeddedChunkFromDom=zd,m.acexHtmlReadLineBatch=kn,m.acexHtmlReadManifestUrlFromSearchParams=ho,m.acexHtmlReadMeshBatch=An,m.acexHtmlRebaseHatchPatternToLocalOffset=Aa,m.acexHtmlRebasePlainDrawableSliceAroundCentroid=Pt,m.acexHtmlReleaseExportedTextureBytes=wa,m.acexHtmlRemapSnapshotForegroundForBackground=pi,m.acexHtmlResolveBackground=ci,m.acexHtmlResolveChunkUrl=Yt,m.acexHtmlResolveExpiresAt=od,m.acexHtmlResolveLayoutFallbackExtents=Zd,m.acexHtmlResolveLayoutViewExtents=Kd,m.acexHtmlResolveLocale=Ae,m.acexHtmlResolvePackageManifestUrl=uo,m.acexHtmlResolveViewerManifestUrl=Yl,m.acexHtmlSetDocsBaseUrl=$d,m.acexHtmlSetHeadlessPngEncoder=Cs,m.acexHtmlSetSnapshotCompressor=ss,m.acexHtmlShouldEmbedChunks=Md,m.acexHtmlSnapshotMimeType=ca,m.acexHtmlSnapshotPayloadToCompressedBytes=la,m.acexHtmlSnapshotSkeletonFromManifest=co,m.acexHtmlSplineToAcGe=Na,m.acexHtmlSplitDominantCluster=wr,m.acexHtmlSplitLayoutIntoSlices=Wo,m.acexHtmlSplitLineBatch=Xo,m.acexHtmlSplitMeshBatch=Vo,m.acexHtmlSplitOsnapPrimitives=Qr,m.acexHtmlTextToBytes=ze,m.acexHtmlToExtents=et,m.acexHtmlToWcsCoord=Re,m.acexHtmlToolbarButton=ar,m.acexHtmlTransformHatchPatternToWorldSpace=Bn,m.acexHtmlUnionDominantCluster=hi,m.acexHtmlUnionExtents=vr,m.acexHtmlUnzipPackageFiles=Nd,m.acexHtmlWcsPointToOcsArcAngle=Xn,m.acexHtmlWriteLineBatch=bn,m.acexHtmlWriteMeshBatch=Ln,m.acexHtmlZipPackageFiles=Ud,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
|