@layoutit/polycss-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +914 -0
- package/dist/index.d.ts +914 -0
- package/dist/index.js +3 -0
- package/package.json +53 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var xn="cubic";function St(e){let t=e.replace("#","");if(t.length===3){let r=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16);return Number.isNaN(r)||Number.isNaN(n)||Number.isNaN(o)?null:{rgb:[r,n,o],alpha:1}}if(t.length===6){let r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16);return Number.isNaN(r)||Number.isNaN(n)||Number.isNaN(o)?null:{rgb:[r,n,o],alpha:1}}return null}function It(e){let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/i);return t?{rgb:[Number(t[1]),Number(t[2]),Number(t[3])],alpha:t[4]?Number(t[4]):1}:null}function qe(e){if(!e)return null;let t=e.trim(),r=St(t);return r||It(t)}function me(e){return Math.max(0,Math.min(255,Math.round(e)))}function Le(e){let[t,r,n]=e.rgb.map(me);return e.alpha<1?`rgba(${t}, ${r}, ${n}, ${e.alpha})`:`rgb(${t}, ${r}, ${n})`}var tt={rgb:[204,204,204],alpha:1},Ct=new Map;function ye(e){if(!e)return null;let t=e.trim(),r=Ct.get(t);if(r)return r;let n=qe(t);return n?(Ct.set(t,n),n):null}function hn(e,t){let r=ye(e)??tt,n=[me(r.rgb[0]+t),me(r.rgb[1]+t),me(r.rgb[2]+t)];return Le({rgb:n,alpha:r.alpha})}var et={direction:[0,0,-1],color:"#ffffff",intensity:1},Tt={color:"#ffffff",intensity:.4};function Et(e){let t=Math.hypot(e[0],e[1],e[2]);return t<1e-12?[0,0,0]:[e[0]/t,e[1]/t,e[2]/t]}function Ot(e,t,r){let n=ye(t)??tt;return e*(n.rgb[r]/255)}function bn(e,t,r,n){let o=ye(t)??tt,i=Et(r?.direction??et.direction),s=r?.color??et.color,a=Math.max(0,r?.intensity??et.intensity),c=n?.color??Tt.color,f=Math.max(0,n?.intensity??Tt.intensity),l=Et(e),u=Math.max(0,-(l[0]*i[0]+l[1]*i[1]+l[2]*i[2])),g=a*u,m=[0,0,0];for(let p=0;p<3;p=p+1){let h=o.rgb[p],b=Ot(h,c,p)*f,y=Ot(h,s,p)*g;m[p]=me(b+y)}return Le({rgb:m,alpha:o.alpha})}var Rt="#cccccc",ke=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],Lt=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],kt=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],Ue=e=>Math.hypot(e[0],e[1],e[2]);function yn(e){let t=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,s=-1/0;for(let l of e)l[0]<t&&(t=l[0]),l[0]>o&&(o=l[0]),l[1]<r&&(r=l[1]),l[1]>i&&(i=l[1]),l[2]<n&&(n=l[2]),l[2]>s&&(s=l[2]);let a=o-t,c=i-r,f=s-n;return Math.hypot(a,c,f)}function Pn(){let e=globalThis;if(e.__POLYCSS_DEV__===!0)return!0;if(e.__POLYCSS_DEV__===!1)return!1;let t=e.process?.env?.NODE_ENV;return typeof t=="string"?t!=="production":!1}function nt(e){let t=[],r=[];if(!e||e.length===0)return{polygons:t,warnings:r};for(let n=0;n<e.length;n++){let o=e[n];if(!o||!Array.isArray(o.vertices)){r.push(`Polygon ${n}: missing vertices, dropped`);continue}let i=o.vertices;if(i.length<3){r.push(`Polygon ${n}: ${i.length} vertices (need >= 3), dropped`);continue}let s=ke(i[1],i[0]),a=ke(i[2],i[0]),c=Lt(s,a),f=Ue(c);if(i.length===3){if(f<1e-12){Ue(s)<1e-12||Ue(a)<1e-12?r.push(`Polygon ${n}: zero-area triangle (coincident vertices), dropped`):r.push(`Polygon ${n}: vertices collinear, dropped`);continue}}else if(f<1e-12){r.push(`Polygon ${n}: first 3 vertices collinear, dropped`);continue}let l=[{...o,vertices:i.slice()}];if(i.length>=4){let u=[c[0]/f,c[1]/f,c[2]/f],g=kt(u,i[0]),m=yn(i),p=Math.max(1e-6,m*.001),h=0;for(let b=3;b<i.length;b++){let y=Math.abs(kt(u,i[b])-g);y>h&&(h=y)}if(h>p){let b=[],y=o.uvs&&o.uvs.length===i.length?o.uvs:void 0;for(let M=1;M<i.length-1;M++){let C=[i[0].slice(),i[M].slice(),i[M+1].slice()],v=Lt(ke(C[1],C[0]),ke(C[2],C[0]));if(Ue(v)<1e-12)continue;let x={...o,vertices:C};y&&(x.uvs=[y[0].slice(),y[M].slice(),y[M+1].slice()]),b.push(x)}if(b.length===0){r.push(`Polygon ${n}: ${i.length} non-coplanar vertices, fan-triangulation produced no valid triangles, dropped`);continue}r.push(`Polygon ${n}: ${i.length} non-coplanar vertices, fan-triangulated to ${b.length} triangles`),l=b}}for(let u of l){let g=An(u,n,r);g&&t.push(g)}}return{polygons:t,warnings:r}}function An(e,t,r){let n={vertices:e.vertices},o=e.texture;if(typeof o=="string"&&o===""&&(o=void 0),e.color!==void 0&&o!==void 0&&Pn()&&r.push(`Polygon ${t}: color and texture both set; texture wins`),e.color!==void 0&&(ye(e.color)?n.color=e.color:(r.push(`Polygon ${t}: invalid color "${e.color}", replaced with ${Rt}`),n.color=Rt)),o!==void 0&&(n.texture=o),e.uvs!==void 0&&(!Array.isArray(e.uvs)||e.uvs.length!==e.vertices.length?r.push(`Polygon ${t}: uvs length ${Array.isArray(e.uvs)?e.uvs.length:"?"} != vertices length ${e.vertices.length}, uvs stripped`):n.uvs=e.uvs),e.data!==void 0&&e.data!==null&&typeof e.data=="object"){let i={},s=!1;for(let a of Object.keys(e.data)){let c=e.data[a];typeof c=="string"||typeof c=="number"||typeof c=="boolean"?i[a]=c:(s=!0,r.push(`Polygon ${t}: data["${a}"] has non-primitive value, key dropped`))}Object.keys(i).length>0&&(n.data=i)}return n}function Ut(e){if(!e||e.length===0)return{min:[0,0,0],max:[0,0,0]};let t=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,s=-1/0,a=!1;for(let c of e)if(c?.vertices)for(let f of c.vertices)f&&(a=!0,f[0]<t&&(t=f[0]),f[0]>o&&(o=f[0]),f[1]<r&&(r=f[1]),f[1]>i&&(i=f[1]),f[2]<n&&(n=f[2]),f[2]>s&&(s=f[2]));return a?{min:[t,r,n],max:[o,i,s]}:{min:[0,0,0],max:[0,0,0]}}function Vn(e){let t=e.polygons??[],r,n;if(e.skipNormalize)r=t,n=[];else{let a=nt(t);r=a.polygons,n=a.warnings}let o=Ut(r),i=[o.max[0]-o.min[0],o.max[1]-o.min[1],o.max[2]-o.min[2]];return{context:{polygons:r,sceneBbox:o,warnings:n},dimensions:{sceneBbox:o,size:i},warnings:n}}function vn(e){return!e.vertices||e.vertices.length<3?[]:[{v:e.vertices.map(t=>[t[0],t[1],t[2]]),color:e.color}]}function Mn(e){let t=e[0],r=e[1],n=e[2],o=[r[0]-t[0],r[1]-t[1],r[2]-t[2]],i=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],s=o[1]*i[2]-o[2]*i[1],a=o[2]*i[0]-o[0]*i[2],c=o[0]*i[1]-o[1]*i[0],f=Math.hypot(s,a,c);return f<=1e-9?null:[s/f,a/f,c/f]}function wn(e){let t=0;for(let r=0;r<e.length;r++){let[n,o]=e[r],[i,s]=e[(r+1)%e.length];t+=n*s-i*o}return Math.abs(t)/2}function Sn(e,t,r){if(!e||e.length<3)return null;let n=e.map(a=>[a[1]*t,a[0]*t,a[2]*r]),o=Mn(n);if(!o)return null;let i=1/0,s=0;for(let a=0;a<n.length;a++){let c=n[a],f=n[(a+1)%n.length],l=[f[0]-c[0],f[1]-c[1],f[2]-c[2]],u=l[0]*o[0]+l[1]*o[1]+l[2]*o[2],g=[l[0]-u*o[0],l[1]-u*o[1],l[2]-u*o[2]],m=Math.hypot(g[0],g[1],g[2]);if(m<=1e-9)continue;let p=[g[0]/m,g[1]/m,g[2]/m],h=[o[1]*p[2]-o[2]*p[1],o[2]*p[0]-o[0]*p[2],o[0]*p[1]-o[1]*p[0]],b=Math.hypot(h[0],h[1],h[2]);if(b<=1e-9)continue;let y=[h[0]/b,h[1]/b,h[2]/b],M=n.map(R=>{let F=R[0]-c[0],O=R[1]-c[1],z=R[2]-c[2];return[F*p[0]+O*p[1]+z*p[2],F*y[0]+O*y[1]+z*y[2]]}),C=1/0,v=1/0,x=-1/0,V=-1/0;for(let[R,F]of M)C=Math.min(C,R),v=Math.min(v,F),x=Math.max(x,R),V=Math.max(V,F);let I=x-C,S=V-v,E=Math.max(1,Math.ceil(I))*Math.max(1,Math.ceil(S)),U=wn(M);U<=1e-9||E<i&&(i=E,s=U)}return!Number.isFinite(i)||s<=1e-9?null:{elementArea:i,polygonArea:s}}function In(e,t={}){let r=t.tileSize??100,n=t.layerElevation??r,o=t.texturedOnly??!0,i=0,s=0,a=0,c=0,f=0;for(let u of e){let g=!!u.texture;if(o&&!g)continue;let m=Sn(u.vertices,r,n);m&&(i+=1,g&&(s+=1),a+=m.elementArea,c+=m.polygonArea,f=Math.max(f,Math.max(0,m.elementArea-m.polygonArea)/m.elementArea))}let l=Math.max(0,a-c);return{totalPolygons:e.length,measuredPolygons:i,texturedPolygons:s,elementArea:a,polygonArea:c,transparentArea:l,transparentRatio:a>0?l/a:0,overdrawRatio:c>0?a/c:0,worstTransparentRatio:f}}function Cn(e,t,r,n){let o=t*Math.PI/180,i=r*Math.PI/180,s=n*Math.PI/180,[a,c,f]=e;if(s!==0){let l=Math.cos(s),u=Math.sin(s);[a,c]=[a*l-c*u,a*u+c*l]}if(i!==0){let l=Math.cos(i),u=Math.sin(i);[a,f]=[a*l+f*u,-a*u+f*l]}if(o!==0){let l=Math.cos(o),u=Math.sin(o);[c,f]=[c*l-f*u,c*u+f*l]}return[a,c,f]}function Tn(e,t){let r=-t[0]*Math.PI/180,n=-t[1]*Math.PI/180,o=-t[2]*Math.PI/180,[i,s,a]=e;if(r!==0){let c=Math.cos(r),f=Math.sin(r);[s,a]=[s*c-a*f,s*f+a*c]}if(n!==0){let c=Math.cos(n),f=Math.sin(n);[i,a]=[i*c+a*f,-i*f+a*c]}if(o!==0){let c=Math.cos(o),f=Math.sin(o);[i,s]=[i*c-s*f,i*f+s*c]}return[i,s,a]}var En=50;function On(e){if(typeof e=="number")return e===0?void 0:e<0?-1:1;if(typeof e=="boolean")return e?-1:1}var Ae={target:[0,0,0],rotX:65,rotY:45,zoom:.65,distance:0},Nt=100,_t=1e4,Pe=e=>Math.round(e*Nt)/Nt,Rn=e=>Math.round(e*_t)/_t;function Ln(e={}){let t={target:e.target??[...Ae.target],rotX:e.rotX??Ae.rotX,rotY:e.rotY??Ae.rotY,zoom:e.zoom??Ae.zoom,distance:e.distance??Ae.distance};function r(o){o.target!==void 0&&(t.target=[Pe(o.target[0]),Pe(o.target[1]),Pe(o.target[2])]),o.rotX!==void 0&&(t.rotX=Pe(o.rotX)),o.rotY!==void 0&&(t.rotY=Pe(o.rotY)),o.zoom!==void 0&&(t.zoom=Rn(o.zoom)),o.distance!==void 0&&(t.distance=Pe(o.distance))}function n(o={}){let s=(o.cols??0)*50,a=(o.rows??0)*50,[c,f,l]=t.target,u=f*50,g=c*50,m=l*50;return{transform:`${t.distance!==0?` translateZ(${-t.distance}px)`:""}scale(${t.zoom}) rotateX(${t.rotX}deg) rotate(${t.rotY}deg) translate3d(${-u}px, ${-g}px, ${-m}px)`,width:`${s}px`,height:`${a}px`}}return{state:t,update:r,getStyle:n}}var le=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],Ne=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],we=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],rt=e=>Math.hypot(e[0],e[1],e[2]),fe=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2];function kn(e,t){let r=`${e[0]},${e[1]},${e[2]}`,n=`${t[0]},${t[1]},${t[2]}`;return r<n?`${r}|${n}`:`${n}|${r}`}function $t(e){if(e.length<3)return null;let t=le(e[1],e[0]),r=le(e[2],e[0]),n=Ne(t,r),o=rt(n);if(o<1e-12)return null;let i=[n[0]/o,n[1]/o,n[2]/o],s=we(i,e[0]);return{normal:i,d:s}}function Un(e,t){return we(e.normal,t.normal)<1-.001?!1:Math.abs(e.d-t.d)<.05}function Nn(e,t){return we(e.normal,t.normal)<1-.001?!1:Math.abs(e.d-t.d)<.001}function _n(e,t,r,n){let o=e.vertices.findIndex(S=>fe(S,r)),i=e.vertices.findIndex(S=>fe(S,n)),s=t.vertices.findIndex(S=>fe(S,r)),a=t.vertices.findIndex(S=>fe(S,n));if(o<0||i<0||s<0||a<0)return null;let c=e.vertices.length,f=t.vertices.length,l=(o+1)%c===i,u=(s+1)%f===a;if(l===u)return null;let g=l?i:o,m=l?o:i,p=u?a:s,h=u?s:a,b=!!(e.uvs&&t.uvs),y=[],M=b?[]:void 0,C=g;for(;y.push(e.vertices[C]),M&&M.push(e.uvs[C]),C!==m;)C=(C+1)%c;for(C=p;y.push(t.vertices[C]),M&&M.push(t.uvs[C]),C!==h;)C=(C+1)%f;let v=[],x=M?[]:void 0;for(let S=0;S<y.length;S++)(v.length===0||!fe(y[S],v[v.length-1]))&&(v.push(y[S]),x&&M&&x.push(M[S]));if(v.length>1&&fe(v[0],v[v.length-1])&&(v.pop(),x?.pop()),b)return Bn(v,x);let V=[],I=x?[]:void 0;for(let S=0;S<v.length;S++){let E=v[(S-1+v.length)%v.length],U=v[S],R=v[(S+1)%v.length],F=Ne(le(U,E),le(R,E));rt(F)>1e-9&&(V.push(U),I&&x&&I.push(x[S]))}return V.length<3?null:{vertices:V,uvs:I}}function $n(e,t){let r=e.length,n=0;for(let o=0;o<r;o++){let i=e[o],s=e[(o+1)%r],a=e[(o+2)%r],c=le(s,i),f=le(a,s),l=we(Ne(c,f),t);if(Math.abs(l)<1e-9)continue;let u=l>0?1:-1;if(n===0)n=u;else if(u!==n)return!1}return!0}function zn(e){if(e.length<3)return!1;let t=$t(e);if(!t)return!1;for(let r of e)if(Math.abs(we(t.normal,r)-t.d)>.001)return!1;return!0}function Fn(e){return e.map(t=>({vertices:t.vertices.map(r=>[...r]),uvs:t.uvs.map(r=>[...r])}))}function Gn(e,t){let r=[];for(let n=1;n<e.length-1;n++)r.push({vertices:[[...e[0]],[...e[n]],[...e[n+1]]],uvs:[[...t[0]],[...t[n]],[...t[n+1]]]});return r}function Bn(e,t){for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length],i=e[(r+2)%e.length];if(!(rt(Ne(le(o,n),le(i,n)))<=1e-9))return r===0?{vertices:e,uvs:t}:{vertices:[...e.slice(r),...e.slice(0,r)],uvs:t?[...t.slice(r),...t.slice(0,r)]:void 0}}return{vertices:e,uvs:t}}function Se(e){let t=[],r=[];for(let o of e??[]){if(!o||!o.vertices||o.vertices.length<3){o&&t.push(o);continue}let i=o.vertices.map(f=>[f[0],f[1],f[2]]),s=$t(i);if(!s){t.push(o);continue}let a=o.texture&&o.uvs&&o.uvs.length===i.length?o.uvs.map(f=>[f[0],f[1]]):void 0,c=o.texture&&a?o.textureTriangles?.length?Fn(o.textureTriangles):Gn(i,a):void 0;r.push({vertices:i,uvs:a,color:o.color??"#cccccc",texture:o.texture,textureTriangles:c,normal:s.normal,d:s.d,alive:!0,data:o.data})}let n=()=>{let o=new Map;for(let a=0;a<r.length;a++){let c=r[a];if(!c.alive)continue;let f=c.vertices.length;for(let l=0;l<f;l++){let u=c.vertices[l],g=c.vertices[(l+1)%f],m=kn(u,g),p=o.get(m);p||(p=[],o.set(m,p)),p.push(a)}}let i=!1,s=(a,c)=>{for(let f=0;f<a.vertices.length;f++){let l=a.vertices[f],u=a.vertices[(f+1)%a.vertices.length];for(let g=0;g<c.vertices.length;g++){let m=c.vertices[g],p=c.vertices[(g+1)%c.vertices.length];if(fe(l,p)&&fe(u,m))return[l,u]}}return null};for(let[,a]of o){if(a.length<2)continue;let[c,f]=a;if(c===f)continue;let l=r[c],u=r[f];if(!l.alive||!u.alive||l.color!==u.color||l.texture!==u.texture)continue;let g=!!(l.texture||u.texture);if(g&&(!l.textureTriangles||!u.textureTriangles)||!!l.uvs!=!!u.uvs||(g?!Nn(l,u):!Un(l,u)))continue;let m=s(l,u);if(!m)continue;let[p,h]=m,b=_n(l,u,p,h);b&&(g&&!zn(b.vertices)||$n(b.vertices,l.normal)&&(l.vertices=b.vertices,l.uvs=b.uvs,l.textureTriangles=g?[...l.textureTriangles??[],...u.textureTriangles??[]]:void 0,u.alive=!1,i=!0))}return i};for(;n(););for(let o of r){if(!o.alive)continue;let i={vertices:o.vertices,color:o.color};o.texture&&(i.texture=o.texture),o.uvs&&(i.uvs=o.uvs),o.textureTriangles?.length&&(i.textureTriangles=o.textureTriangles),o.data&&(i.data=o.data),t.push(i)}return t}var Dn=4,jn=8,Xn=.001,Yn=1e-9,Hn=1e6,Wn=1e6,ge=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],st=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]],Te=(e,t)=>[e[0]*t,e[1]*t,e[2]*t],de=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],Dt=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],jt=e=>Math.hypot(e[0],e[1],e[2]);function Ee(e){let t=jt(e);return t<=Yn?null:[e[0]/t,e[1]/t,e[2]/t]}function Ce(e,t){return Math.round(e*t)/t}function se(e){return Ce(e,Hn)}function ot(e){return Ce(e,Wn)}function it(e,t){return Math.abs(e[0]-t[0])<=1e-7&&Math.abs(e[1]-t[1])<=1e-7}function ce(e){return`${se(e[0])},${se(e[1])}`}function Zn(e){let t=ce(e.a),r=ce(e.b);return t<r?`${t}|${r}`:`${r}|${t}`}function Ve(e){return`${e[0]},${e[1]},${e[2]}`}function Xt(e,t){let r=Ve(e),n=Ve(t);return r<n?`${r}|${n}`:`${n}|${r}`}function ct(e){return e?Object.keys(e).sort().map(t=>`${t}:${String(e[t])}`).join("|"):""}function zt(e){return[e.color??"#cccccc",e.texture??"",e.uvs?"uv":"plain",ct(e.data)].join("|")}function Yt(e){let t=e.vertices;if(!t||t.length<3)return null;let r=t[0],n=[0,0,0];for(let i=1;i<t.length-1;i++)n=st(n,Dt(ge(t[i],r),ge(t[i+1],r)));let o=Ee(n);return o?{normal:o,d:de(o,r)}:null}function Kn(e,t,r){return de(e.normal,t.normal)>1-r&&Math.abs(e.d-t.d)<=r}function Jn(e){return!e.texture&&!e.uvs&&!e.textureTriangles}function Qn(e,t){let r=t[e[0]]?.data,n=ct(r);for(let o of e)if(ct(t[o].data)!==n)return;return r?{...r}:void 0}function qn(e,t){let r=e.map(c=>Jn(c)?Yt(c):null),n=r.map(Boolean),o=new Map;for(let c=0;c<e.length;c++){if(!r[c])continue;let f=e[c].vertices;for(let l=0;l<f.length;l++){let u=Xt(f[l],f[(l+1)%f.length]),g=o.get(u),m={polygon:c,edge:l};g?g.push(m):o.set(u,[m])}}let i=e.map(()=>new Set);for(let c of o.values())if(!(c.length<2))for(let f=0;f<c.length;f++)for(let l=f+1;l<c.length;l++){let u=c[f].polygon,g=c[l].polygon,m=r[u],p=r[g];!m||!p||zt(e[u])===zt(e[g])&&Kn(m,p,t)&&(i[u].add(g),i[g].add(u))}let s=new Set,a=[];for(let c=0;c<e.length;c++){if(!n[c]||s.has(c))continue;let f=[],l=[c];for(s.add(c);l.length>0;){let u=l.shift();f.push(u);for(let g of i[u])s.has(g)||(s.add(g),l.push(g))}a.push(f)}return{groups:a}}function er(e,t){let r=new Set(e),n=new Map;for(let i of e){let s=t[i].vertices;for(let a=0;a<s.length;a++){let c=Xt(s[a],s[(a+1)%s.length]),f=n.get(c),l={polygon:i,edge:a};f?f.push(l):n.set(c,[l])}}let o=[];for(let i of n.values()){let s=i.filter(a=>r.has(a.polygon));if(s.length===1){let a=s[0],c=t[a.polygon].vertices;o.push({a:c[a.edge],b:c[(a.edge+1)%c.length]})}else if(s.length!==2)return null}return o}function tr(e){let t=new Map;for(let r of e)t.set(Ve(r.a),(t.get(Ve(r.a))??0)+1),t.set(Ve(r.b),(t.get(Ve(r.b))??0)+1);for(let r of t.values())if(r%2!==0)return!1;return!0}function Ht(e){let t=[e[0],e[1],e[2]],r=Math.abs(t[0])>=Math.abs(t[1])&&Math.abs(t[0])>=Math.abs(t[2])?0:Math.abs(t[1])>=Math.abs(t[2])?1:2;return t[r]<0?[-t[0],-t[1],-t[2]]:t}function nr(e){let t=Ht(e);return`${Ce(t[0],1e3)},${Ce(t[1],1e3)},${Ce(t[2],1e3)}`}function rr(e){let t=Math.abs(e[0])<.9?[1,0,0]:[0,1,0],r=ge(t,Te(e,de(t,e)));return Ee(r)??[1,0,0]}function or(e,t,r){let n=new Map;for(let i of e){let s=ge(i.b,i.a),a=ge(s,Te(t,de(s,t))),c=Ee(a);if(!c)continue;let f=Ht(c),l=nr(f),u=jt(a),g=n.get(l);g?g.weight+=u:n.set(l,{axis:f,weight:u})}let o=[...n.values()].sort((i,s)=>s.weight-i.weight).slice(0,r).map(i=>i.axis);return o.length===0&&o.push(rr(t)),o}function Ft(e,t,r,n){let o=ge(e,t);return[se(de(o,r)),se(de(o,n))]}function ir(e){let t=[...e].sort((n,o)=>n-o),r=[];for(let n of t)(r.length===0||Math.abs(n-r[r.length-1])>1e-7)&&r.push(n);return r}function Ie(e,t){let[r,n]=e.a,[o,i]=e.b,s=(t-r)/(o-r);return se(n+(i-n)*s)}function at(e){let t=[];for(let n of e)(t.length===0||Math.abs(n[0]-t[t.length-1][0])>1e-7||Math.abs(n[1]-t[t.length-1][1])>1e-7)&&t.push(n);t.length>1&&Math.abs(t[0][0]-t[t.length-1][0])<=1e-7&&Math.abs(t[0][1]-t[t.length-1][1])<=1e-7&&t.pop();let r=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],i=t[n],s=t[(n+1)%t.length],a=(i[0]-o[0])*(s[1]-i[1])-(i[1]-o[1])*(s[0]-i[0]);Math.abs(a)>1e-8&&r.push(i)}return r}function $e(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1]}return t/2}function Gt(e){let t=1/0,r=1/0,n=-1/0,o=-1/0;for(let[i,s]of e)t=Math.min(t,i),r=Math.min(r,s),n=Math.max(n,i),o=Math.max(o,s);return{minX:t,minY:r,maxX:n,maxY:o}}function sr(e,t){let r=Gt(e),n=Gt(t);return!(r.maxX<n.minX-1e-7||n.maxX<r.minX-1e-7||r.maxY<n.minY-1e-7||n.maxY<r.minY-1e-7)}function _e(e){return Math.abs($e(e))}function cr(e){if(e.length<3)return!1;let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length],i=e[(r+2)%e.length],s=(o[0]-n[0])*(i[1]-o[1])-(o[1]-n[1])*(i[0]-o[0]);if(Math.abs(s)<=1e-8)continue;let a=s>0?1:-1;if(t===0)t=a;else if(t!==a)return!1}return!0}function ar(e,t,r){let n=r[0]-t[0],o=r[1]-t[1],i=e[0]-t[0],s=e[1]-t[1],a=n*s-o*i,c=Math.hypot(n,o);if(c<=1e-9||Math.abs(a)>Math.max(1e-8,c*1e-8))return!1;let f=i*n+s*o;return f>=-1e-8&&f<=n*n+o*o+1e-8}function fr(e,t,r){let n=r[0]-t[0],o=r[1]-t[1],i=n*n+o*o;return i<=1e-12?0:((e[0]-t[0])*n+(e[1]-t[1])*o)/i}function Bt(e,t){let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=e[(n+1)%e.length],s=[{t:0,point:o},{t:1,point:i}];for(let c of t)it(c,o)||it(c,i)||ar(c,o,i)&&s.push({t:fr(c,o,i),point:c});s.sort((c,f)=>c.t-f.t);let a=[];for(let c of s)a.some(f=>Math.abs(f.t-c.t)<=1e-8||it(f.point,c.point))||a.push(c);for(let c=0;c<a.length-1;c++){let f=a[c].point,l=a[c+1].point;Math.hypot(l[0]-f[0],l[1]-f[1])<=1e-8||r.push({a:[se(f[0]),se(f[1])],b:[se(l[0]),se(l[1])]})}}return r}function lr(e,t){if(!sr(e,t))return null;let r=[...Bt(e,t),...Bt(t,e)],n=new Map;for(let h of r){let b=Zn(h),y=n.get(b);y?y.push(h):n.set(b,[h])}let o=!1,i=[];for(let h of n.values()){if(h.length===1){i.push(h[0]);continue}o=!0;let b=h.filter(M=>ce(M.a)<ce(M.b)).length,y=h.length-b;if(b!==y)return null}if(!o||i.length<3)return null;let s=new Map;for(let h of i){let b=ce(h.a);if(s.has(b))return null;s.set(b,h)}let a=i[0],c=ce(a.a),f=[],l=new Set,u=c;for(let h=0;h<=i.length;h++){let b=s.get(u);if(!b)return null;let y=`${ce(b.a)}>${ce(b.b)}`;if(l.has(y))return null;if(l.add(y),f.push(b.a),u=ce(b.b),u===c)break}if(u!==c||l.size!==i.length)return null;let g=at(f);if(g.length<3||!cr(g))return null;let m=_e(g),p=_e(e)+_e(t);return Math.abs(m-p)>Math.max(1e-5,p*1e-5)?null:$e(g)>=0?g:[...g].reverse()}function ur(e){let t=e.map(at).filter(n=>n.length>=3&&_e(n)>1e-8),r=!0;for(;r;){r=!1;for(let n=0;n<t.length;n++){for(let o=n+1;o<t.length;o++){let i=lr(t[n],t[o]);if(i){t[n]=i,t.splice(o,1),r=!0;break}}if(r)break}}return t}function mr(e,t,r){let n=new Map;return o=>{let i=se(o[0]),s=se(o[1]),a=`${i},${s}`,c=n.get(a);if(c)return[c[0],c[1],c[2]];let f=st(e,st(Te(t,i),Te(r,s))),l=[ot(f[0]),ot(f[1]),ot(f[2])];return n.set(a,l),[l[0],l[1],l[2]]}}function gr(e,t,r,n,o){let i=r[0]?.a;if(!i)return null;let s=Ee(ge(o,Te(n,de(o,n))));if(!s)return null;let a=Ee(Dt(n,s));if(!a)return null;let c=[],f=[];for(let b of r){let y=Ft(b.a,i,s,a),M=Ft(b.b,i,s,a);Math.hypot(y[0]-M[0],y[1]-M[1])<=1e-7||(c.push({a:y,b:M}),f.push(y[0],M[0]))}let l=ir(f);if(c.length<3||l.length<2)return null;let u=t[e[0]].color,g=Qn(e,t),m=[];for(let b=0;b<l.length-1;b++){let y=l[b],M=l[b+1];if(M-y<=1e-7)continue;let C=(y+M)/2,v=c.filter(x=>{let V=Math.min(x.a[0],x.b[0]),I=Math.max(x.a[0],x.b[0]);return V<C&&C<I&&Math.abs(x.a[0]-x.b[0])>1e-7}).map(x=>({segment:x,yMid:Ie(x,C)})).sort((x,V)=>x.yMid-V.yMid);if(v.length!==0){if(v.length%2!==0)return null;for(let x=0;x<v.length;x+=2){let V=v[x].segment,I=v[x+1].segment,S=Ie(V,y),E=Ie(V,M),U=Ie(I,y),R=Ie(I,M),F=at([[y,S],[M,E],[M,R],[y,U]]);if(F.length<3||Math.abs($e(F))<=1e-8)continue;let O=$e(F)>0?F:[...F].reverse();m.push(O)}}}if(m.length===0)return null;let p=mr(i,s,a),h=ur(m).map(b=>({vertices:b.map(p),...u?{color:u}:{},...g?{data:g}:{}}));return Se(h)}function dr(e,t,r){let n=er(e,t);if(!n||n.length<3||!tr(n))return null;let o=Yt(t[e[0]]);if(!o)return null;let i=null;for(let s of or(n,o.normal,r)){let a=gr(e,t,n,o.normal,s);a&&(!i||a.length<i.length)&&(i=a)}return!i||i.length>=e.length?null:i}function pr(e,t={}){let r=t.minGroupPolygons??Dn,n=t.maxCandidateAxes??jn,o=t.planeEpsilon??Xn,i=e??[];if(i.length<r)return i;let{groups:s}=qn(i,o);if(s.length===0)return i;let a=new Map,c=new Set;for(let l of s){if(l.length<r)continue;let u=dr(l,i,n);if(u){a.set(l[0],u);for(let g of l)c.add(g)}}if(a.size===0)return i;let f=[];for(let l=0;l<i.length;l++){let u=a.get(l);if(u){f.push(...u);continue}c.has(l)||f.push(i[l])}return f}function xr(e){let t=e.vertices;if(!t||t.length<3)return null;let r=0,n=0,o=0;for(let[O,z,L]of t)r+=O,n+=z,o+=L;let i=1/t.length;r*=i,n*=i,o*=i;let s=t[0],a=t[1],c=t[2],f=a[0]-s[0],l=a[1]-s[1],u=a[2]-s[2],g=c[0]-s[0],m=c[1]-s[1],p=c[2]-s[2],h=l*p-u*m,b=u*g-f*p,y=f*m-l*g,M=Math.hypot(h,b,y);if(M<1e-9)return null;h/=M,b/=M,y/=M;let C=t.length-2,v=new Float64Array(C*9),x=0;for(let O=1;O<t.length-1;O++){let z=t[0],L=t[O],_=t[O+1];v[x++]=z[0],v[x++]=z[1],v[x++]=z[2],v[x++]=L[0],v[x++]=L[1],v[x++]=L[2],v[x++]=_[0],v[x++]=_[1],v[x++]=_[2]}let V=0,I=1/0,S=1/0,E=1/0,U=-1/0,R=-1/0,F=-1/0;for(let[O,z,L]of t){let _=O-r,T=z-n,P=L-o,d=_*_+T*T+P*P;d>V&&(V=d),O<I&&(I=O),O>U&&(U=O),z<S&&(S=z),z>R&&(R=z),L<E&&(E=L),L>F&&(F=L)}return{centroid:[r,n,o],normal:[h,b,y],vertices:t,triFlat:v,bcx:r,bcy:n,bcz:o,br2:V,minX:I,minY:S,minZ:E,maxX:U,maxY:R,maxZ:F}}function hr(e,t,r,n,o,i,s,a){let c=s[a],f=s[a+1],l=s[a+2],u=s[a+3]-c,g=s[a+4]-f,m=s[a+5]-l,p=s[a+6]-c,h=s[a+7]-f,b=s[a+8]-l,y=o*b-i*h,M=i*p-n*b,C=n*h-o*p,v=u*y+g*M+m*C;if(v>-1e-9&&v<1e-9)return!1;let x=1/v,V=e-c,I=t-f,S=r-l,E=x*(V*y+I*M+S*C);if(E<0||E>1)return!1;let U=I*m-S*g,R=S*u-V*m,F=V*g-I*u,O=x*(n*U+o*R+i*F);return O<0||E+O>1?!1:x*(p*U+h*R+b*F)>.001}function br(e,t,r,n,o,i,s){let a=s.bcx-e,c=s.bcy-t,f=s.bcz-r,l=a*n+c*o+f*i,u=a-l*n,g=c-l*o,m=f-l*i;if(u*u+g*g+m*m>s.br2)return!1;let p=s.triFlat,h=p.length;for(let b=0;b<h;b+=9)if(hr(e,t,r,n,o,i,p,b))return!0;return!1}var Oe=9,yr=6,ee=12;function ft(e,t,r,n,o,i){let s=n-e,a=o-t,c=i-r;return s*a+a*c+c*s}function Pr(e){let t=[];for(let V=0;V<e.length;V++)e[V]&&t.push(V);let r=t.length,n=new Int32Array(r);for(let V=0;V<r;V++)n[V]=t[V];let o=new Float64Array(r),i=new Float64Array(r),s=new Float64Array(r);for(let V=0;V<r;V++){let I=e[n[V]];o[V]=(I.minX+I.maxX)*.5,i[V]=(I.minY+I.maxY)*.5,s[V]=(I.minZ+I.maxZ)*.5}let a=2*Math.max(1,r)+1,c=new Float64Array(a*Oe),f=0,l=new Float64Array(ee),u=new Float64Array(ee),g=new Float64Array(ee),m=new Float64Array(ee),p=new Float64Array(ee),h=new Float64Array(ee),b=new Int32Array(ee),y=new Float64Array(ee-1),M=new Int32Array(ee-1),C=new Float64Array(ee-1),v=new Int32Array(ee-1);function x(V,I){let S=f++,E=S*Oe,U=I-V,R=1/0,F=1/0,O=1/0,z=-1/0,L=-1/0,_=-1/0;for(let B=V;B<I;B++){let Y=e[n[B]];Y.minX<R&&(R=Y.minX),Y.maxX>z&&(z=Y.maxX),Y.minY<F&&(F=Y.minY),Y.maxY>L&&(L=Y.maxY),Y.minZ<O&&(O=Y.minZ),Y.maxZ>_&&(_=Y.maxZ)}if(c[E]=R,c[E+1]=F,c[E+2]=O,c[E+3]=z,c[E+4]=L,c[E+5]=_,U<=yr)return c[E+6]=1,c[E+7]=V,c[E+8]=I,S;let T=1/0,P=1/0,d=1/0,A=-1/0,w=-1/0,N=-1/0;for(let B=V;B<I;B++)o[B]<T&&(T=o[B]),o[B]>A&&(A=o[B]),i[B]<P&&(P=i[B]),i[B]>w&&(w=i[B]),s[B]<d&&(d=s[B]),s[B]>N&&(N=s[B]);let k=A-T,G=w-P,$=N-d;if(k===0&&G===0&&$===0)return c[E+6]=1,c[E+7]=V,c[E+8]=I,S;let X=ft(R,F,O,z,L,_),H=X>0?1/X:0,Z=U+1,K=0,q=0;for(let B=0;B<3;B++){let Y=B===0?T:B===1?P:d,re=B===0?k:B===1?G:$;if(re===0)continue;let ae=B===0?o:B===1?i:s,ue=ee/re;l.fill(1/0),u.fill(1/0),g.fill(1/0),m.fill(-1/0),p.fill(-1/0),h.fill(-1/0),b.fill(0);for(let D=V;D<I;D++){let j=(ae[D]-Y)*ue|0;j>=ee&&(j=ee-1);let oe=e[n[D]];oe.minX<l[j]&&(l[j]=oe.minX),oe.maxX>m[j]&&(m[j]=oe.maxX),oe.minY<u[j]&&(u[j]=oe.minY),oe.maxY>p[j]&&(p[j]=oe.maxY),oe.minZ<g[j]&&(g[j]=oe.minZ),oe.maxZ>h[j]&&(h[j]=oe.maxZ),b[j]++}let he=1/0,be=1/0,De=1/0,je=-1/0,Xe=-1/0,Ye=-1/0,Mt=0;for(let D=0;D<ee-1;D++)l[D]<he&&(he=l[D]),m[D]>je&&(je=m[D]),u[D]<be&&(be=u[D]),p[D]>Xe&&(Xe=p[D]),g[D]<De&&(De=g[D]),h[D]>Ye&&(Ye=h[D]),Mt+=b[D],y[D]=ft(he,be,De,je,Xe,Ye),M[D]=Mt;let He=1/0,We=1/0,Ze=1/0,Ke=-1/0,Je=-1/0,Qe=-1/0,wt=0;for(let D=ee-2;D>=0;D--){let j=D+1;l[j]<He&&(He=l[j]),m[j]>Ke&&(Ke=m[j]),u[j]<We&&(We=u[j]),p[j]>Je&&(Je=p[j]),g[j]<Ze&&(Ze=g[j]),h[j]>Qe&&(Qe=h[j]),wt+=b[j],C[D]=ft(He,We,Ze,Ke,Je,Qe),v[D]=wt}for(let D=0;D<ee-1;D++){if(M[D]===0||v[D]===0)continue;let j=.125+(y[D]*M[D]+C[D]*v[D])*H;j<Z&&(Z=j,K=B,q=Y+(D+1)/ue)}}let ne=K===0?o:K===1?i:s,J=V,Q=I-1;for(;J<=Q;)if(ne[J]<q)J++;else{let B=n[J];n[J]=n[Q],n[Q]=B;let Y=o[J];o[J]=o[Q],o[Q]=Y;let re=i[J];i[J]=i[Q],i[Q]=re;let ae=s[J];s[J]=s[Q],s[Q]=ae,Q--}let ie=J;(ie===V||ie===I)&&(ie=V+I>>1),c[E+6]=0;let te=x(V,ie),W=x(ie,I);return c[S*Oe+7]=te,c[S*Oe+8]=W,S}return r>0&&x(0,r),{data:c,nodeCount:f,polyIndices:n,meta:e}}function Wt(e,t,r,n,o,i,s,a,c){if(a.nodeCount===0)return!1;let{data:f,polyIndices:l,meta:u}=a,g=n!==0?1/n:n>=0?1/0:-1/0,m=o!==0?1/o:o>=0?1/0:-1/0,p=i!==0?1/i:i>=0?1/0:-1/0,h=0;for(c[h++]=0;h>0;){let y=c[--h]*Oe,M=(f[y]-e)*g,C=(f[y+3]-e)*g,v=M<C?M:C,x=M<C?C:M,V=(f[y+1]-t)*m,I=(f[y+4]-t)*m,S=V<I?V:I,E=V<I?I:V;if(v>E||S>x)continue;S>v&&(v=S),E<x&&(x=E);let U=(f[y+2]-r)*p,R=(f[y+5]-r)*p,F=U<R?U:R,O=U<R?R:U;if(!(v>O||F>x)&&(O<x&&(x=O),!(x<.001)))if(f[y+6]===1){let z=f[y+7]|0,L=f[y+8]|0;for(let _=z;_<L;_++){let T=l[_];if(T===s)continue;let P=u[T];if(P&&br(e,t,r,n,o,i,P))return!0}}else c[h++]=f[y+7]|0,c[h++]=f[y+8]|0}return!1}function Ar(e){let t=(1+Math.sqrt(5))/2,r=new Float64Array(e*3);for(let n=0;n<e;n++){let o=(n+.5)/e,i=Math.sqrt(Math.max(0,1-o*o)),s=2*Math.PI*(n/t);r[n*3]=i*Math.cos(s),r[n*3+1]=i*Math.sin(s),r[n*3+2]=o}return r}function Vr(e){let t=Math.abs(e[0])>.9?0:1,r=Math.abs(e[0])>.9?1:0,n=r*e[2],o=-t*e[2],i=t*e[1]-r*e[0],s=Math.hypot(n,o,i);n/=s,o/=s,i/=s;let a=e[1]*i-e[2]*o,c=e[2]*n-e[0]*i,f=e[0]*o-e[1]*n;return{ux:n,uy:o,uz:i,vx:a,vy:c,vz:f}}function lt(e,t){let r=t?.samples??8;if(e.length<4||r<1)return e;let n=e.map(xr),o=Ar(r),i=[],s=Pr(n),a=new Int32Array(Math.max(64,s.nodeCount)),c=192,f=new Float64Array(c);for(let l=0;l<e.length;l++){let u=n[l];if(!u){i.push(e[l]);continue}let g=u.normal[0],m=u.normal[1],p=u.normal[2],h=.001*g,b=.001*m,y=.001*p;{let L=u.centroid[0]+h,_=u.centroid[1]+b,T=u.centroid[2]+y;if(!Wt(L,_,T,g,m,p,l,s,a)){i.push(e[l]);continue}}let{ux:M,uy:C,uz:v,vx:x,vy:V,vz:I}=Vr(u.normal),S=u.centroid[0],E=u.centroid[1],U=u.centroid[2],R=u.vertices,F=R.length,O=0;f[O++]=S+h,f[O++]=E+b,f[O++]=U+y;for(let L=0;L<F;L++){let _=R[L];f[O++]=_[0]+(S-_[0])*.08+h,f[O++]=_[1]+(E-_[1])*.08+b,f[O++]=_[2]+(U-_[2])*.08+y}for(let L=0;L<F;L++){let _=R[L],T=R[(L+1)%F],P=(_[0]+T[0])*.5,d=(_[1]+T[1])*.5,A=(_[2]+T[2])*.5;f[O++]=P+(S-P)*.08+h,f[O++]=d+(E-d)*.08+b,f[O++]=A+(U-A)*.08+y}let z=!1;e:for(let L=0;L<o.length;L+=3){let _=o[L],T=o[L+1],P=o[L+2],d=_*M+T*x+P*g,A=_*C+T*V+P*m,w=_*v+T*I+P*p;for(let N=0;N<O;N+=3){let k=f[N],G=f[N+1],$=f[N+2];if(!Wt(k,G,$,d,A,w,l,s,a)){z=!0;break e}}}z&&i.push(e[l])}return i}function ut(e,t,r,n,o){let i=(p,h,b)=>{let y=[0,0,0];return y[e]=p,y[(e+1)%3]=h,y[(e+2)%3]=b,y},s=i(t,-n,-n),a=i(t,n,-n),c=i(t,n,n),f=i(t,-n,n),l=i(r,-n,-n),u=i(r,n,-n),g=i(r,n,n),m=i(r,-n,n);return[{vertices:[s,a,c,f],color:o},{vertices:[l,u,g,m],color:o},{vertices:[s,a,u,l],color:o},{vertices:[a,c,g,u],color:o},{vertices:[c,f,m,g],color:o},{vertices:[f,s,l,m],color:o}]}function Zt(e={}){let t=e.size??5,r=e.thickness??.025,n=e.negative??!1,o=e.xColor??"#ff3a3a",i=e.yColor??"#3aff3a",s=e.zColor??"#3a8aff",a=t*r/2,c=n?-t:0;return[...ut(0,c,t,a,o),...ut(1,c,t,a,i),...ut(2,c,t,a,s)]}function Kt(e,t,r,n){let o=[0,0,0];return o[e]=t,o[(e+1)%3]=r,o[(e+2)%3]=n,o}function vr(e,t,r,n,o){let i=(p,h,b)=>Kt(e,p,h,b),s=i(t,-n,-n),a=i(t,n,-n),c=i(t,n,n),f=i(t,-n,n),l=i(r,-n,-n),u=i(r,n,-n),g=i(r,n,n),m=i(r,-n,n);return[{vertices:[s,a,c,f],color:o},{vertices:[l,u,g,m],color:o},{vertices:[s,a,u,l],color:o},{vertices:[a,c,g,u],color:o},{vertices:[c,f,m,g],color:o},{vertices:[f,s,l,m],color:o}]}function Mr(e,t,r,n,o){let i=(u,g,m)=>Kt(e,u,g,m),s=i(t,-n,-n),a=i(t,n,-n),c=i(t,n,n),f=i(t,-n,n),l=i(r,0,0);return[{vertices:[s,a,c,f],color:o},{vertices:[s,a,l],color:o},{vertices:[a,c,l],color:o},{vertices:[c,f,l],color:o},{vertices:[f,s,l],color:o}]}function wr(e){return e.map(t=>({...t,vertices:[...t.vertices].reverse()}))}function Jt(e){let t=e.axis,r=e.sign??1,n=e.shaftLength??4,o=e.shaftHalfThickness??.05,i=e.headLength??.8,s=e.headHalfThickness??.2,a=e.color??"#ffffff",c=n*r,f=Math.min(0,c),l=Math.max(0,c),u=c,g=(n+i)*r,m=Mr(t,u,g,s,a);return[...vr(t,f,l,o,a),...r===-1?wr(m):m]}function ze(e,t,r){let n=[0,0,0],o=(e+1)%3,i=(e+2)%3;return n[o]=Math.cos(r)*t,n[i]=Math.sin(r)*t,n}function Qt(e){let t=e.axis,r=e.radius,n=e.halfThickness??Math.max(.05,r*.04),o=e.segments??32,i=e.color??"#ffffff",s=r-n,a=r+n,c=[];for(let f=0;f<o;f++){let l=f/o*Math.PI*2,u=(f+1)/o*Math.PI*2,g=ze(t,s,l),m=ze(t,s,u),p=ze(t,a,l),h=ze(t,a,u);c.push({vertices:[g,p,h,m],color:i})}return c}function qt(e){let{center:t,size:r,color:n="#ffffff"}=e,[o,i,s]=t,a=[[o+r,i,s],[o-r,i,s],[o,i+r,s],[o,i-r,s],[o,i,s+r],[o,i,s-r]];return[[0,2,4],[2,1,4],[1,3,4],[3,0,4],[2,0,5],[1,2,5],[3,1,5],[0,3,5]].map(f=>({vertices:[a[f[0]],a[f[1]],a[f[2]]],color:n}))}var Sr=2200,Ir=2201,Cr=2202;function Tr(e,t){let r=0,n=1,o=1,i=2201,s=1/0,a=0,c=!1,f=null,l=!0,u=!1,g={clampWhenFinished:!1,get timeScale(){return o},set timeScale(m){o=m},get weight(){return n},set weight(m){n=m},get time(){return r},set time(m){r=m},get isRunning(){return c},get enabled(){return l},set enabled(m){l=m},get paused(){return u},set paused(m){u=m},play(){return c=!0,g},stop(){return c=!1,r=0,a=0,f=null,g},reset(){return r=0,a=0,g},fadeIn(m){return f={from:0,to:1,elapsed:0,duration:m},n=0,g},fadeOut(m){return f={from:n,to:0,elapsed:0,duration:m},g},crossFadeTo(m,p){return g.fadeOut(p),m.fadeIn(p),g},crossFadeFrom(m,p){return m.fadeOut(p),g.fadeIn(p),g},setLoop(m,p){return i=m,s=p,g},setEffectiveTimeScale(m){return o=m,g},setEffectiveWeight(m){return n=m,g}};return g._internal={get clip(){return e},get time(){return r},get weight(){return n},get enabled(){return l},get paused(){return u},get running(){return c},get loopMode(){return i},get repetitions(){return s},get completedReps(){return a},set completedReps(m){a=m},get clampWhenFinished(){return g.clampWhenFinished},get timeScale(){return o},get fade(){return f},advance(m){if(!c)return;if(f){f.elapsed+=m;let h=f.duration>0?Math.min(f.elapsed/f.duration,1):1;if(n=f.from+(f.to-f.from)*h,h>=1&&(n=f.to,f=null,n<=0)){c=!1;return}}if(u)return;let p=e.duration;if(!(p<=0)){if(r+=m*o,i===2200)r>=p&&(r=g.clampWhenFinished?p:0,c=!1);else if(i===2201){if(r>=p){let h=r%p,b=Math.floor(r/p);a+=b,r=h,s!==1/0&&a>=s&&(r=g.clampWhenFinished?p:0,c=!1)}}else if(p>0){let h=p*2,b=r%h;if(r>=h){let y=Math.floor(r/h);a+=y,s!==1/0&&a>=s?(r=g.clampWhenFinished?p:0,c=!1):r=b}}}},sampleTime(){if(i===2202){let m=e.duration,p=m*2,h=r%p;return h<=m?h:p-h}return r}},g}function Er(e){return e._internal}function mt(e,t){return typeof t=="number"?e[t]:e.find(r=>r.name===t)}function Or(e,t){let r=new Map;function n(f){let l=mt(t.clips,f);if(!l)throw new Error(`PolyAnimationMixer: no clip found for key "${f}". Available: ${t.clips.map(g=>g.name).join(", ")}`);let u=r.get(l.index);return u||(u=Tr(l,t),r.set(l.index,u)),u}function o(f){let l=mt(t.clips,f);return l?r.get(l.index)??null:null}function i(f){let l=[];for(let h of r.values()){let b=Er(h);b.advance(f),b.running&&b.enabled&&l.push({internal:b,clip:b.clip})}if(l.length===0)return;if(l.length===1){let{internal:h,clip:b}=l[0],y=t.sample(b.name,h.sampleTime());e.setPolygons(y);return}let u=0;for(let{internal:h}of l)u+=h.weight;if(u<=0)return;let g=l.map(({internal:h,clip:b})=>({polygons:t.sample(b.name,h.sampleTime()),weight:h.weight/u})),m=g[0].polygons;if(m.length===0)return;let p=m.map((h,b)=>{let y=h.vertices.map((M,C)=>{let v=0,x=0,V=0;for(let{polygons:I,weight:S}of g){let E=I[b];if(!E)continue;let U=E.vertices[C];U&&(v+=U[0]*S,x+=U[1]*S,V+=U[2]*S)}return[v,x,V]});return{...h,vertices:y}});e.setPolygons(p)}function s(){for(let f of r.values())f.stop()}function a(f){let l=mt(t.clips,f);l&&r.delete(l.index)}function c(){r.clear()}return{clipAction:n,existingAction:o,update:i,stopAllAction:s,uncacheClip:a,uncacheRoot:c}}var Rr=/^[0-9A-Fa-f]{6}$/,Lr=["#3b82f6","#ef4444","#22c55e","#eab308","#a855f7","#06b6d4","#f97316","#ec4899"];function gt(e,t){let r=t?.targetSize??60,n=t?.gridShift??1,o=t?.defaultColor??"#888888",i=t?.palette??Lr,s=t?.materialColors??{},a=t?.materialTextures??{},c=[],f=[],l=[],u=[],g=new Map,m=o,p,h=t?.includeObjects?new Set(t.includeObjects):null,b=t?.excludeObjects?new Set(t.excludeObjects):null,y=null,M=()=>y===null?h===null:!(h&&!h.has(y)||b&&b.has(y)),C=T=>T in s?s[T]:Rr.test(T)?`#${T}`:(g.has(T)||(g.set(T,i[u.length%i.length]),u.push(T)),g.get(T)),v=e.split(`
|
|
2
|
+
`);for(let T of v)if(!(T.length===0||T.charCodeAt(0)===35)){if(T.startsWith("v ")){let P=T.trim().split(/\s+/);c.push([parseFloat(P[1]),parseFloat(P[2]),parseFloat(P[3])])}else if(T.startsWith("vt ")){let P=T.trim().split(/\s+/);f.push([parseFloat(P[1]),parseFloat(P[2])])}else if(T.startsWith("o "))y=T.trim().slice(2).trim();else if(T.startsWith("usemtl ")){let P=T.trim().split(/\s+/)[1];m=C(P),p=a[P]}else if(T.startsWith("f ")){if(!M())continue;let P=T.trim().split(/\s+/).slice(1),d=[],A=[];for(let w of P){let N=w.split("/");d.push(parseInt(N[0],10)-1);let k=N[1];if(k&&k.length>0){let G=parseInt(k,10)-1;A.push(Number.isFinite(G)?G:null)}else A.push(null)}l.push({idx:d,uvIdx:A,color:m,texture:p})}}if(c.length===0||l.length===0)return kr(u,e.length);let x=new Set;for(let T of l)for(let P of T.idx)x.add(P);let V=1/0,I=1/0,S=1/0,E=-1/0,U=-1/0,R=-1/0;for(let T of x){let P=c[T];P&&(P[0]<V&&(V=P[0]),P[0]>E&&(E=P[0]),P[1]<I&&(I=P[1]),P[1]>U&&(U=P[1]),P[2]<S&&(S=P[2]),P[2]>R&&(R=P[2]))}let F=Math.max(E-V,U-I,R-S),O=F>0?r/F:1,z=T=>Math.round(T*1e3)/1e3,L=c.map(([T,P,d])=>[z((d-S)*O+n),z((T-V)*O+n),z((P-I)*O+n)]),_=[];for(let{idx:T,uvIdx:P,color:d,texture:A}of l)for(let w=1;w<T.length-1;w++){let N=T[0],k=T[w],G=T[w+1],$=L[N],X=L[k],H=L[G];if(!$||!X||!H||$[0]===X[0]&&$[1]===X[1]&&$[2]===X[2]||$[0]===H[0]&&$[1]===H[1]&&$[2]===H[2]||X[0]===H[0]&&X[1]===H[1]&&X[2]===H[2])continue;let Z;if(A){let q=P[0],ne=P[w],J=P[w+1];if(q!=null&&ne!=null&&J!=null){let Q=f[q],ie=f[ne],te=f[J];Q&&ie&&te&&(Z=[Q,ie,te])}}let K={vertices:[$,X,H],color:d};A&&(K.texture=A),Z&&(K.uvs=Z),_.push(K)}return{polygons:_,objectUrls:[],dispose:()=>{},warnings:[],metadata:{triangleCount:_.length,materials:u,sourceBytes:e.length}}}function kr(e,t){return{polygons:[],objectUrls:[],dispose:()=>{},warnings:[],metadata:{triangleCount:0,materials:e,sourceBytes:t}}}var dt=e=>Math.round(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0");function pt(e){let t={},r={},n=null;for(let o of e.split(`
|
|
3
|
+
`)){let i=o.trim();if(!(i.length===0||i.charCodeAt(0)===35)){if(i.startsWith("newmtl ")){n=i.slice(7).trim();continue}if(n){if(i.startsWith("Kd ")){let s=i.split(/\s+/),a=parseFloat(s[1]),c=parseFloat(s[2]),f=parseFloat(s[3]);Number.isFinite(a)&&Number.isFinite(c)&&Number.isFinite(f)&&(t[n]=`#${dt(a)}${dt(c)}${dt(f)}`)}else if(i.startsWith("map_Kd ")){let s=i.split(/\s+/),a=s[s.length-1]?.replace(/\\+/g,"/");a&&a!=="map_Kd"&&(r[n]=a)}}}}return{colors:t,textures:r}}var on={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},sn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function cn(e){let t=globalThis.TextDecoder;return new t().decode(e)}function Ur(e){let t=e.indexOf(",");if(t<0)throw new Error("parseGltf: malformed data: URI");let r=e.slice(5,t),n=e.slice(t+1);if(!r.includes(";base64")){let s=decodeURIComponent(n),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c)&255;return a}let o=globalThis.atob(n),i=new Uint8Array(o.length);for(let s=0;s<o.length;s++)i[s]=o.charCodeAt(s);return i}function Nr(e,t){let r=e.buffers?.[0];if(!r)throw new Error("parseGltf: JSON doc has no buffers[0]");let n=r.uri;if(!n)throw new Error("parseGltf: JSON doc buffer has no uri (and there's no GLB BIN chunk)");if(n.startsWith("data:"))return Ur(n);if(t){let o=t(n);if(o instanceof Uint8Array)return o;throw new Error("parseGltf: resolveBuffer returned a Promise; use parseGltf via async if your buffers are external")}throw new Error(`parseGltf: external buffer URI "${n}" \u2014 provide options.resolveBuffer`)}function _r(e){let t=new DataView(e);if(t.getUint32(0,!0)!==1179937895)throw new Error("parseGltf: not a GLB (bad magic)");let r=t.getUint32(4,!0);if(r!==2)throw new Error(`parseGltf: only glTF v2 supported (got v${r})`);let n=12,o=null,i=null;for(;n<e.byteLength;){let s=t.getUint32(n,!0),a=t.getUint32(n+4,!0),c=n+8;if(a===1313821514){let f=new Uint8Array(e,c,s);o=JSON.parse(cn(f))}else a===5130562&&(i=new Uint8Array(e,c,s));n=c+s}if(!o)throw new Error("parseGltf: no JSON chunk in GLB");return{doc:o,bin:i}}function xt(e,t,r){let n=e.accessors?.[r],o=e.bufferViews?.[n?.bufferView??-1];if(!n||!o)throw new Error(`parseGltf: bad accessor/bufferView ${r}`);let i=on[n.componentType],s=sn[n.type];if(!i||!s)throw new Error(`parseGltf: unsupported accessor type ${n.type}/${n.componentType}`);let a=(o.byteOffset??0)+(n.byteOffset??0),c=n.count*s,f=t.buffer.slice(t.byteOffset+a,t.byteOffset+a+c*i),l;switch(n.componentType){case 5126:l=new Float32Array(f);break;case 5123:l=new Uint16Array(f);break;case 5125:l=new Uint32Array(f);break;case 5121:l=new Uint8Array(f);break;default:throw new Error(`parseGltf: unhandled componentType ${n.componentType}`)}return{array:l,count:n.count,componentCount:s}}function $r(e,t,r){switch(r){case 5120:return e.getInt8(t);case 5121:return e.getUint8(t);case 5122:return e.getInt16(t,!0);case 5123:return e.getUint16(t,!0);case 5125:return e.getUint32(t,!0);case 5126:return e.getFloat32(t,!0);default:throw new Error(`parseGltf: unhandled componentType ${r}`)}}function zr(e,t){switch(t){case 5120:return Math.max(e/127,-1);case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5123:return e/65535;default:return e}}function Be(e,t,r){let n=e.accessors?.[r],o=e.bufferViews?.[n?.bufferView??-1];if(!n||!o)throw new Error(`parseGltf: bad accessor/bufferView ${r}`);let i=on[n.componentType],s=sn[n.type];if(!i||!s)throw new Error(`parseGltf: unsupported accessor type ${n.type}/${n.componentType}`);let a=t.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),c=o.byteStride??i*s,f=new DataView(t.buffer),l=new Array(n.count*s),u=0;for(let g=0;g<n.count;g++){let m=a+g*c;for(let p=0;p<s;p++){let h=$r(f,m+p*i,n.componentType);l[u++]=n.normalized?zr(h,n.componentType):h}}return{values:l,count:n.count,componentCount:s}}function Fr(e,t,r){let n=[],o=[],i=globalThis;for(let s of e.images??[]){if(s.uri){if(r&&!s.uri.startsWith("data:"))try{n.push(new i.URL(s.uri,r).href)}catch{n.push(s.uri)}else n.push(s.uri);continue}if(s.bufferView!==void 0){let a=e.bufferViews?.[s.bufferView];if(!a){n.push("");continue}let c=a.byteOffset??0,f=t.subarray(c,c+a.byteLength),l=s.mimeType??"image/png",u=new i.Blob([f],{type:l}),g=i.URL.createObjectURL(u);n.push(g),o.push(g)}else n.push("")}return{urls:n,objectUrls:o}}function Gr(e,t){let r=new Map,n=e.materials??[];for(let o=0;o<n.length;o++){let i=n[o].pbrMetallicRoughness?.baseColorTexture?.index;if(i===void 0)continue;let s=e.textures?.[i]?.source;if(s===void 0)continue;let a=t[s];a&&r.set(o,a)}return r}function Br(e,t){let r=e?.pbrMetallicRoughness?.baseColorFactor;if(!r||r.length<3)return t;let n=o=>Math.round(Math.max(0,Math.min(1,o))*255).toString(16).padStart(2,"0");return`#${n(r[0])}${n(r[1])}${n(r[2])}`}var ve=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function ht(e,t){let r=new Array(16);for(let n=0;n<4;n++)for(let o=0;o<4;o++)r[o*4+n]=e[0+n]*t[o*4+0]+e[4+n]*t[o*4+1]+e[8+n]*t[o*4+2]+e[12+n]*t[o*4+3];return r}function Ge(e,t){return[e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12],e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13],e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]]}function an(e,t,r){let n=e?.[0]??0,o=e?.[1]??0,i=e?.[2]??0,s=t?.[0]??0,a=t?.[1]??0,c=t?.[2]??0,f=t?.[3]??1,l=r?.[0]??1,u=r?.[1]??1,g=r?.[2]??1,m=s+s,p=a+a,h=c+c,b=s*m,y=s*p,M=s*h,C=a*p,v=a*h,x=c*h,V=f*m,I=f*p,S=f*h;return[(1-(C+x))*l,(y+S)*l,(M-I)*l,0,(y-S)*u,(1-(b+x))*u,(v+V)*u,0,(M+I)*g,(v-V)*g,(1-(b+C))*g,0,n,o,i,1]}function Dr(e){return e.matrix&&e.matrix.length===16?e.matrix.slice():an(e.translation,e.rotation,e.scale)}function jr(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function en(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function fn(e,t,r){let n=new Array(Math.min(e.length,t.length));for(let o=0;o<n.length;o++)n[o]=e[o]+(t[o]-e[o])*r;return n}function Re(e){let t=Math.hypot(e[0]??0,e[1]??0,e[2]??0,e[3]??1)||1;return[(e[0]??0)/t,(e[1]??0)/t,(e[2]??0)/t,(e[3]??1)/t]}function Xr(e,t,r){let n=Re(e),o=Re(t),i=n[0]*o[0]+n[1]*o[1]+n[2]*o[2]+n[3]*o[3];if(i<0&&(i=-i,o=[-o[0],-o[1],-o[2],-o[3]]),i>.9995)return Re(fn(n,o,r));let s=Math.acos(Math.max(-1,Math.min(1,i))),a=Math.sin(s),c=Math.sin((1-r)*s)/a,f=Math.sin(r*s)/a;return Re([n[0]*c+o[0]*f,n[1]*c+o[1]*f,n[2]*c+o[2]*f,n[3]*c+o[3]*f])}function Yr(e){return{translation:e?.translation?.slice()??[0,0,0],rotation:e?.rotation?.slice()??[0,0,0,1],scale:e?.scale?.slice()??[1,1,1],matrix:e?.matrix&&e.matrix.length===16?e.matrix.slice():void 0}}function tn(e){return e.matrix?e.matrix.slice():an(e.translation,e.rotation,e.scale)}function Hr(e){let t=e.scene??0,r=e.scenes?.[t]?.nodes;return r&&r.length>0?r:[]}function nn(e,t){let r=e.nodes??[],n=new Array(r.length),o=new Set,i=(a,c)=>{if(a<0||a>=r.length)return;let f=ht(c,t[a]??ve);n[a]=f,o.add(a);for(let l of r[a].children??[])i(l,f)},s=Hr(e);if(s.length>0)for(let a of s)i(a,ve);for(let a=0;a<r.length;a++)o.has(a)||i(a,ve);return n}function rn(e,t,r,n,o){if(r===void 0)return;let{values:i,count:s,componentCount:a}=Be(e,t,r);if(s!==o||a<1)return;let c=[];for(let f=0;f<s;f++){let l=[];for(let u=0;u<n;u++)l.push(i[f*a+u]??0);c.push(l)}return c}function Wr(e,t,r,n){if(r===void 0)return Array.from({length:n},()=>ve.slice());let{values:o,componentCount:i,count:s}=Be(e,t,r);if(i!==16)throw new Error(`parseGltf: inverseBindMatrices accessor ${r} is not MAT4`);let a=[];for(let c=0;c<n;c++){let f=Math.min(c,s-1);a.push(o.slice(f*16,f*16+16))}return a}function Fe(e,t){let r=e.componentCount,n=e.interpolation==="CUBICSPLINE"?(t*3+1)*r:t*r;return e.output.slice(n,n+r)}function Zr(e,t,r){let n=e.input;if(n.length===0)return[];if(n.length===1||t<=n[0])return Fe(e,0);let o=n.length-1;if(t>=n[o])return Fe(e,o);let i=0,s=o;for(;i+1<s;){let g=i+s>>1;n[g]<=t?i=g:s=g}let a=n[i],c=n[i+1],f=c>a?(t-a)/(c-a):0,l=Fe(e,i),u=Fe(e,i+1);return e.interpolation==="STEP"?l:r==="rotation"?Xr(l,u,f):fn(l,u,f)}function Kr(e,t,r,n){let o=e.animations??[];if(o.length===0||r.length===0)return;let i=(e.nodes??[]).map(m=>Yr(m)),s=i.map(tn),a=nn(e,s),c=(e.skins??[]).map(m=>({joints:m.joints??[],inverseBindMatrices:Wr(e,t,m.inverseBindMatrices,m.joints?.length??0)})),f=[];for(let m=0;m<o.length;m++){let p=o[m],h=(p.samplers??[]).map(M=>{let C=Be(e,t,M.input),v=Be(e,t,M.output);return{input:C.values,output:v.values,componentCount:v.componentCount,interpolation:M.interpolation??"LINEAR"}}),b=[];for(let M of p.channels??[]){let C=M.target.node,v=M.target.path,x=h[M.sampler];C===void 0||!v||!x||v==="weights"||b.push({sampler:x,targetNode:C,path:v})}let y=b.reduce((M,C)=>{let v=C.sampler.input;return Math.max(M,v[v.length-1]??0)},0);f.push({info:{index:m,name:p.name??`animation_${m}`,duration:y,channelCount:b.length},channels:b})}let l=f.map(m=>m.info);if(l.length===0)return;let u=(m,p,h,b,y,M)=>{let C=n(m),v=n(p),x=n(h);if(C[0]===v[0]&&C[1]===v[1]&&C[2]===v[2]||C[0]===x[0]&&C[1]===x[1]&&C[2]===x[2]||v[0]===x[0]&&v[1]===x[1]&&v[2]===x[2])return null;let V={vertices:[C,v,x],color:b};return y&&(V.texture=y),M&&(V.uvs=M),V};return{clips:l,sample:(m,p)=>{let h=typeof m=="number"?f[m]:f.find(x=>x.info.name===m);if(!h)return[];let b=h.info.duration,y=b>0?(p%b+b)%b:Math.max(0,p),M=i.map(x=>({translation:x.translation.slice(),rotation:x.rotation.slice(),scale:x.scale.slice(),matrix:x.matrix?x.matrix.slice():void 0}));for(let x of h.channels){let V=M[x.targetNode];if(!V)continue;let I=Zr(x.sampler,y,x.path);V.matrix=void 0,x.path==="translation"?V.translation=I.slice(0,3):x.path==="rotation"?V.rotation=Re(I.slice(0,4)):x.path==="scale"&&(V.scale=I.slice(0,3))}let C=nn(e,M.map(tn)),v=[];for(let x of r){let V=[];if(x.skinIndex!==void 0&&x.joints&&x.weights&&c[x.skinIndex]){let I=c[x.skinIndex];for(let S=0;S<x.positions.length;S++){let E=x.positions[S],U=[0,0,0],R=0,F=x.joints[S]??[],O=x.weights[S]??[];for(let z=0;z<4;z++){let L=O[z]??0;if(L<=0)continue;let _=Math.round(F[z]??0),T=I.joints[_],P=C[T],d=I.inverseBindMatrices[_];if(!P||!d)continue;let A=ht(P,d);U=jr(U,en(Ge(A,E),L)),R+=L}V.push(R>0?en(U,1/R):Ge(x.meshBindWorld,E))}}else{let I=x.meshNode!==null?C[x.meshNode]??x.meshBindWorld:x.meshBindWorld;for(let S of x.positions)V.push(Ge(I,S))}for(let I=0;I+2<x.indices.length;I+=3){let S=x.indices[I],E=x.indices[I+1],U=x.indices[I+2],R=V[S],F=V[E],O=V[U];if(!R||!F||!O)continue;let z;if(x.uvs&&x.texture){let _=x.uvs[S],T=x.uvs[E],P=x.uvs[U];_&&T&&P&&(z=[_,T,P])}let L=u(R,F,O,x.color,x.texture,z);L&&v.push(L)}}return v}}}function bt(e,t){let r=t?.targetSize??60,n=t?.gridShift??1,o=t?.defaultColor??"#888888",i=t?.materialColors??{},s=e instanceof Uint8Array?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e,a=s.byteLength,c,f;if(s.byteLength>=4&&new DataView(s).getUint32(0,!0)===1179937895){let d=_r(s);if(c=d.doc,!d.bin)throw new Error("parseGltf: GLB has no binary chunk");f=d.bin}else c=JSON.parse(cn(new Uint8Array(s))),f=Nr(c,t?.resolveBuffer);let{urls:l,objectUrls:u}=Fr(c,f,t?.baseUrl),g=Gr(c,l),m=[],p=[],h=(c.meshes??[]).map((d,A)=>d.name??`mesh_${A}`),b=(c.materials??[]).map((d,A)=>d.name??`material_${A}`);function y(d,A,w){let N=c.meshes?.[d];if(N)for(let k of N.primitives){if((k.mode??4)!==4)continue;let $=k.material!==void 0?c.materials?.[k.material]?.name:void 0,H=($?i[$]:void 0)??Br(k.material!==void 0?c.materials?.[k.material]:void 0,o),Z=k.material!==void 0?g.get(k.material):void 0,{array:K,count:q}=xt(c,f,k.attributes.POSITION);if(!(K instanceof Float32Array))continue;let ne=[],J=[];for(let W=0;W<q;W++){let B=[K[W*3],K[W*3+1],K[W*3+2]];ne.push(B),J.push(Ge(A,B))}let Q=null,ie=k.attributes.TEXCOORD_0;if(Z&&ie!==void 0){let{array:W,count:B}=xt(c,f,ie);Q=[];let Y=1;W instanceof Uint8Array?Y=1/255:W instanceof Uint16Array&&(Y=1/65535);for(let re=0;re<B;re++){let ae=W[re*2]*Y,ue=W[re*2+1]*Y;Q.push([ae,1-ue])}}let te;if(k.indices!==void 0){let{array:W,count:B}=xt(c,f,k.indices);te=[];for(let Y=0;Y<B;Y++)te.push(Number(W[Y]))}else te=J.map((W,B)=>B);if((c.animations?.length??0)>0){let W=rn(c,f,k.attributes.JOINTS_0,4,q),B=rn(c,f,k.attributes.WEIGHTS_0,4,q);p.push({meshNode:w,meshBindWorld:A,skinIndex:w!==null?c.nodes?.[w]?.skin:void 0,positions:ne,indices:te,color:H,texture:Z,uvs:Q??void 0,joints:W,weights:B})}for(let W=0;W+2<te.length;W+=3){let B=J[te[W]],Y=J[te[W+1]],re=J[te[W+2]];if(!B||!Y||!re)continue;let ae;if(Q&&Z){let ue=Q[te[W]],he=Q[te[W+1]],be=Q[te[W+2]];ue&&he&&be&&(ae=[ue,he,be])}m.push({v0:B,v1:Y,v2:re,color:H,texture:Z,uvs:ae})}}}function M(d,A){let w=c.nodes?.[d];if(!w)return;let N=ht(A,Dr(w));typeof w.mesh=="number"&&y(w.mesh,N,d);for(let k of w.children??[])M(k,N)}let C=c.scene??0,v=c.scenes?.[C]?.nodes;if(v&&v.length>0)for(let d of v)M(d,ve);else for(let d=0;d<(c.meshes?.length??0);d++)y(d,ve,null);let x=Jr(u);if(m.length===0)return{polygons:[],objectUrls:u,dispose:x,warnings:[],metadata:{triangleCount:0,meshes:h,materials:b,sourceBytes:a}};let V=1/0,I=1/0,S=1/0,E=-1/0,U=-1/0,R=-1/0;for(let d of m)for(let A of[d.v0,d.v1,d.v2])A[0]<V&&(V=A[0]),A[0]>E&&(E=A[0]),A[1]<I&&(I=A[1]),A[1]>U&&(U=A[1]),A[2]<S&&(S=A[2]),A[2]>R&&(R=A[2]);let F=Math.max(E-V,U-I,R-S),O=F>0?r/F:1,z=d=>Math.round(d*1e3)/1e3,_=(t?.upAxis??"y")==="z"?([d,A,w])=>[z((d-V)*O+n),z((A-I)*O+n),z((w-S)*O+n)]:([d,A,w])=>[z((w-S)*O+n),z((d-V)*O+n),z((A-I)*O+n)],T=Kr(c,f,p,_),P=[];for(let d of m){let A=_(d.v0),w=_(d.v1),N=_(d.v2);if(A[0]===w[0]&&A[1]===w[1]&&A[2]===w[2]||A[0]===N[0]&&A[1]===N[1]&&A[2]===N[2]||w[0]===N[0]&&w[1]===N[1]&&w[2]===N[2])continue;let k={vertices:[A,w,N],color:d.color};d.texture&&(k.texture=d.texture),d.uvs&&(k.uvs=d.uvs),P.push(k)}return{polygons:P,animation:T,objectUrls:u,dispose:x,warnings:[],metadata:{triangleCount:P.length,meshes:h,materials:b,animations:T?.clips,sourceBytes:a}}}function Jr(e){let t=!1;return()=>{if(t)return;t=!0;let r=globalThis.URL;if(r?.revokeObjectURL)for(let n of e)try{r.revokeObjectURL(n)}catch{}}}function yt(e){return e.material?.texture??e.texture}function Qr(){let e=globalThis;return typeof e.Image!="function"||typeof e.document?.createElement!="function"?null:{Image:e.Image,createCanvas(){return e.document.createElement("canvas")}}}function qr(e,t){return new Promise((r,n)=>{let o=new t,i=!1,s=a=>{i||(i=!0,a())};o.decoding="async",o.onload=()=>s(()=>r(o)),o.onerror=()=>s(()=>n(new Error(`texture load failed: ${e}`))),o.src=e,typeof o.decode=="function"&&o.decode().then(()=>s(()=>r(o)),()=>{})})}async function eo(e,t,r){try{let n=await qr(e,t.Image),o=Math.max(0,Math.floor(n.naturalWidth||n.width||0)),i=Math.max(0,Math.floor(n.naturalHeight||n.height||0));if(o<=0||i<=0||o*i>r)return null;let s=t.createCanvas();s.width=o,s.height=i;let a=s.getContext("2d",{willReadFrequently:!0});return a?(a.drawImage(n,0,0,o,i),{width:o,height:i,data:a.getImageData(0,0,o,i).data}):null}catch{return null}}function ln(e,t,r){return Math.max(t,Math.min(r,e))}function to(e,t){let r=t[0],n=1-t[1];if(!Number.isFinite(r)||!Number.isFinite(n))return null;let o=ln(Math.floor(r*e.width),0,e.width-1),s=(ln(Math.floor(n*e.height),0,e.height-1)*e.width+o)*4;return{r:e.data[s]??0,g:e.data[s+1]??0,b:e.data[s+2]??0,a:e.data[s+3]??255}}function pe(e,t,r,n,o,i){return[e[0]*n+t[0]*o+r[0]*i,e[1]*n+t[1]*o+r[1]*i]}function no(e){let[t,r,n]=e;return[pe(t,r,n,1/3,1/3,1/3),pe(t,r,n,.8,.1,.1),pe(t,r,n,.1,.8,.1),pe(t,r,n,.1,.1,.8),pe(t,r,n,.45,.45,.1),pe(t,r,n,.45,.1,.45),pe(t,r,n,.1,.45,.45)]}function un(e){if(e.textureTriangles?.length)return e.textureTriangles;let t=e.uvs;if(!t||t.length!==e.vertices.length||t.length<3)return[];let r=[];for(let n=1;n+1<t.length;n++)r.push({uvs:[t[0],t[n],t[n+1]]});return r}function ro(e,t,r){return Math.abs(e.r-t.r)<=r&&Math.abs(e.g-t.g)<=r&&Math.abs(e.b-t.b)<=r&&Math.abs(e.a-t.a)<=r}function oo(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");if(e.a>=255)return`#${t(e.r)}${t(e.g)}${t(e.b)}`;let r=Math.round(Math.max(0,Math.min(255,e.a))/255*1e3)/1e3;return`rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${r})`}function io(e,t,r){let n=un(e);if(n.length===0)return null;let o=null;for(let i of n)for(let s of no(i.uvs)){let a=to(t,s);if(!a)return null;if(!o)o=a;else if(!ro(o,a,r))return null}return o?oo(o):null}function so(e,t){let{texture:r,material:n,uvs:o,textureTriangles:i,...s}=e;return{...s,color:t}}async function mn(e,t={}){if(t.enabled===!1)return null;let r=Qr();if(!r)return null;let n=e.filter(a=>yt(a)&&un(a).length>0);if(n.length===0)return null;let o=t.maxTexturePixels??16777216,i=new Map;await Promise.all(Array.from(new Set(n.map(a=>yt(a)))).map(async a=>{i.set(a,await eo(a,r,o))}));let s=t.colorTolerance??2;return{bake(a){let c=!1,f=a.map(l=>{let u=yt(l);if(!u)return l;let g=i.get(u);if(!g)return l;let m=io(l,g,s);return m?(c=!0,so(l,m)):l});return{polygons:c?f:a,changed:c}}}}async function co(e,t={}){let r=await mn(e,t);return r?r.bake(e).polygons:e}async function Pt(e,t={}){let r=await mn(e.polygons,t);if(!r)return e;let n=r.bake(e.polygons);return!n.changed&&!e.animation?e:{...e,polygons:n.polygons,animation:e.animation?{...e.animation,sample(o,i){return r.bake(e.animation.sample(o,i)).polygons}}:e.animation}}var ao=[0,4294967295,4291624959,4288282623,4284940287,4281597951,4278255615,4294954239,4291611903,4288269567,4284927231,4281584895,4278242559,4294941183,4291598847,4288256511,4284914175,4281571839,4278229503,4294928127,4291585791,4288243455,4284901119,4281558783,4278216447,4294915071,4291572735,4288230399,4284888063,4281545727,4278203391,4294902015,4291559679,4288217343,4284875007,4281532671,4278190335,4294967244,4291624908,4288282572,4284940236,4281597900,4278255564,4294954188,4291611852,4288269516,4284927180,4281584844,4278242508,4294941132,4291598796,4288256460,4284914124,4281571788,4278229452,4294928076,4291585740,4288243404,4284901068,4281558732,4278216396,4294915020,4291572684,4288230348,4284888012,4281545676,4278203340,4294901964,4291559628,4288217292,4284874956,4281532620,4278190284,4294967193,4291624857,4288282521,4284940185,4281597849,4278255513,4294954137,4291611801,4288269465,4284927129,4281584793,4278242457,4294941081,4291598745,4288256409,4284914073,4281571737,4278229401,4294928025,4291585689,4288243353,4284901017,4281558681,4278216345,4294914969,4291572633,4288230297,4284887961,4281545625,4278203289,4294901913,4291559577,4288217241,4284874905,4281532569,4278190233,4294967142,4291624806,4288282470,4284940134,4281597798,4278255462,4294954086,4291611750,4288269414,4284927078,4281584742,4278242406,4294941030,4291598694,4288256358,4284914022,4281571686,4278229350,4294927974,4291585638,4288243302,4284900966,4281558630,4278216294,4294914918,4291572582,4288230246,4284887910,4281545574,4278203238,4294901862,4291559526,4288217190,4284874854,4281532518,4278190182,4294967091,4291624755,4288282419,4284940083,4281597747,4278255411,4294954035,4291611699,4288269363,4284927027,4281584691,4278242355,4294940979,4291598643,4288256307,4284913971,4281571635,4278229299,4294927923,4291585587,4288243251,4284900915,4281558579,4278216243,4294914867,4291572531,4288230195,4284887859,4281545523,4278203187,4294901811,4291559475,4288217139,4284874803,4281532467,4278190131,4294967040,4291624704,4288282368,4284940032,4281597696,4278255360,4294953984,4291611648,4288269312,4284926976,4281584640,4278242304,4294940928,4291598592,4288256256,4284913920,4281571584,4278229248,4294927872,4291585536,4288243200,4284900864,4281558528,4278216192,4294914816,4291572480,4288230144,4284887808,4281545472,4278203136,4294901760,4291559424,4288217088,4284874752,4281532416,4278190318,4278190301,4278190267,4278190250,4278190216,4278190199,4278190165,4278190148,4278190114,4278190097,4278251008,4278246656,4278237952,4278233600,4278224896,4278220544,4278211840,4278207488,4278198784,4278194432,4293787648,4292673536,4290445312,4289331200,4287102976,4285988864,4283760640,4282646528,4280418304,4279304192,4293848814,4292730333,4290493371,4289374890,4287137928,4286019447,4283782485,4282664004,4280427042,4279308561];function fo(e){let t=e>>0&255,r=e>>8&255,n=e>>16&255;return[t,r,n]}function At(e){return(e&255).toString(16).padStart(2,"0")}function gn(e,t,r){return`#${At(e)}${At(t)}${At(r)}`}var lo=542658390;function Vt(e,t){let r=t?.targetSize??60,n=t?.gridShift??0,o=e.byteLength;if(e.byteLength<8)return Me(o,["parseVox: buffer too small to be a valid .vox file"]);let i=new DataView(e);if(i.getUint32(0,!0)!==lo)return Me(o,["parseVox: not a .vox file (bad magic)"]);if(e.byteLength<20)return Me(o,["parseVox: buffer too small for MAIN chunk"]);if(dn(i,8)!=="MAIN")return Me(o,["parseVox: expected MAIN chunk at offset 8"]);let f=20+i.getUint32(12,!0),l=f+i.getUint32(16,!0),u=[],g=[],m=null;for(;f<l&&f+12<=e.byteLength;){let P=dn(i,f),d=i.getUint32(f+4,!0),A=i.getUint32(f+8,!0),w=f+12,N=w+d+A;if(P==="SIZE"){if(d>=12&&w+12<=e.byteLength){let k=i.getUint32(w,!0),G=i.getUint32(w+4,!0),$=i.getUint32(w+8,!0);u.push({sx:k,sy:G,sz:$})}}else if(P==="XYZI"){if(d>=4&&w+4<=e.byteLength){let k=i.getUint32(w,!0),G=[],$=Math.min(k,Math.floor((d-4)/4));for(let X=0;X<$;X++){let H=w+4+X*4;G.push({x:i.getUint8(H),y:i.getUint8(H+1),z:i.getUint8(H+2),colorIndex:i.getUint8(H+3)})}g.push(G)}}else if(P==="RGBA"&&d>=1024&&w+1024<=e.byteLength){m=[];for(let k=0;k<256;k++){let G=w+k*4,$=i.getUint8(G),X=i.getUint8(G+1),H=i.getUint8(G+2);m.push(gn($,X,H))}}f=N}let p=[],h=new Set;for(let P of g)for(let d of P){if(d.colorIndex===0)continue;let A=`${d.x},${d.y},${d.z}`;h.has(A)||(h.add(A),p.push(d))}if(p.length===0)return Me(o,[]);let b=P=>{let d=P-1;if(m!==null)return m[d]??"#888888";let A=ao[P]??0,[w,N,k]=fo(A);return gn(w,N,k)},y=(P,d,A)=>h.has(`${P},${d},${A}`),M=new Map,C=(P,d,A,w,N)=>{let k=`${P}:${d}:${N}`,G=M.get(k);G||(G=new Set,M.set(k,G)),G.add(`${A},${w}`)};for(let P of p){let{x:d,y:A,z:w}=P,N=b(P.colorIndex);y(d+1,A,w)||C(0,d+1,A,w,N),y(d-1,A,w)||C(1,d,A,w,N),y(d,A+1,w)||C(2,A+1,d,w,N),y(d,A-1,w)||C(3,A,d,w,N),y(d,A,w+1)||C(4,w+1,d,A,N),y(d,A,w-1)||C(5,w,d,A,N)}function v(P){let d=new Set,A=[],w=1/0,N=-1/0,k=1/0,G=-1/0;for(let $ of P){let[X,H]=$.split(","),Z=+X,K=+H;Z<w&&(w=Z),Z>N&&(N=Z),K<k&&(k=K),K>G&&(G=K)}for(let $=k;$<=G;$++)for(let X=w;X<=N;X++){let H=`${X},${$}`;if(!P.has(H)||d.has(H))continue;let Z=1;for(;X+Z<=N;){let q=`${X+Z},${$}`;if(!P.has(q)||d.has(q))break;Z++}let K=1;e:for(;$+K<=G;){for(let q=0;q<Z;q++){let ne=`${X+q},${$+K}`;if(!P.has(ne)||d.has(ne))break e}K++}for(let q=0;q<K;q++)for(let ne=0;ne<Z;ne++)d.add(`${X+ne},${$+q}`);A.push({u:X,v:$,w:Z,h:K})}return A}let x=(P,d,A,w,N,k)=>{let G=A+N,$=w+k;switch(P){case 0:return[[d,A,w],[d,G,w],[d,G,$],[d,A,$]];case 1:return[[d,G,w],[d,A,w],[d,A,$],[d,G,$]];case 2:return[[A,d,w],[A,d,$],[G,d,$],[G,d,w]];case 3:return[[G,d,w],[G,d,$],[A,d,$],[A,d,w]];case 4:return[[A,w,d],[G,w,d],[G,$,d],[A,$,d]];default:return[[A,$,d],[G,$,d],[G,w,d],[A,w,d]]}},V=[];for(let[P,d]of M){let A=P.indexOf(":"),w=P.indexOf(":",A+1),N=+P.slice(0,A),k=+P.slice(A+1,w),G=P.slice(w+1);for(let{u:$,v:X,w:H,h:Z}of v(d))V.push({vertices:x(N,k,$,X,H,Z),color:G})}if(V.length===0)return Me(o,[]);let I=1/0,S=1/0,E=1/0,U=-1/0,R=-1/0,F=-1/0;for(let P of V)for(let d of P.vertices)d[0]<I&&(I=d[0]),d[0]>U&&(U=d[0]),d[1]<S&&(S=d[1]),d[1]>R&&(R=d[1]),d[2]<E&&(E=d[2]),d[2]>F&&(F=d[2]);let O=Math.max(U-I,R-S,F-E),z=O>0?r/O:1,L=P=>Math.round(P*1e3)/1e3,_=P=>[L((P[0]-I)*z+n),L((P[1]-S)*z+n),L((P[2]-E)*z+n)],T=V.map(({vertices:P,color:d})=>({vertices:P.map(_),color:d}));return{polygons:T,objectUrls:[],dispose:()=>{},warnings:[],metadata:{triangleCount:T.length,sourceBytes:o,voxelCount:p.length}}}function dn(e,t){return String.fromCharCode(e.getUint8(t))+String.fromCharCode(e.getUint8(t+1))+String.fromCharCode(e.getUint8(t+2))+String.fromCharCode(e.getUint8(t+3))}function Me(e,t){return{polygons:[],objectUrls:[],dispose:()=>{},warnings:t,metadata:{triangleCount:0,sourceBytes:e}}}var xe="loadMesh";function vt(e){let t=lt(e.polygons),r=Se(t);return r.length===e.polygons.length?e:{...e,polygons:r}}async function pn(e,t){let r=t?.solidTextureSamples;return r===!1?e:Pt(e,typeof r=="object"?r:void 0)}function uo(e){let t=e.split("?")[0].split("#")[0],r=t.lastIndexOf(".");return r<0?"":t.slice(r+1).toLowerCase()}async function mo(e,t){let r=uo(e);if(r==="mtl")throw new Error(`${xe}: .mtl is a material file, not a mesh \u2014 use parseMtl directly`);let n=globalThis.fetch;if(!n)throw new Error(`${xe}: no fetch() in this environment`);let o=t?.baseUrl??e;if(r==="obj"){let i=await n(e);if(!i.ok)throw new Error(`${xe}: ${e} \u2192 ${i.status}`);let s=await i.text(),a=t?.objOptions;if(t?.mtlUrl){let f=await n(t.mtlUrl);if(!f.ok)throw new Error(`${xe}: ${t.mtlUrl} \u2192 ${f.status}`);let l=await f.text(),{colors:u,textures:g}=pt(l),m={},p=globalThis.URL,h=globalThis.document?.baseURI,b=t.mtlUrl;if(p&&h)try{b=new p(t.mtlUrl,h).toString()}catch{}for(let[y,M]of Object.entries(g)){if(p)try{m[y]=new p(M,b).toString();continue}catch{}let C=t.mtlUrl.lastIndexOf("/"),v=C>=0?t.mtlUrl.slice(0,C+1):"";m[y]=M.startsWith("/")||/^https?:\/\//.test(M)?M:v+M}a={...a??{},materialColors:{...u,...a?.materialColors??{}},materialTextures:{...m,...a?.materialTextures??{}}}}let c=gt(s,a);return vt(await pn(c,t))}if(r==="glb"||r==="gltf"){let i=await n(e);if(!i.ok)throw new Error(`${xe}: ${e} \u2192 ${i.status}`);let s=await i.arrayBuffer(),a=bt(s,{baseUrl:o,...t?.gltfOptions??{}});return vt(await pn(a,t))}if(r==="vox"){let i=await n(e);if(!i.ok)throw new Error(`${xe}: ${e} \u2192 ${i.status}`);let s=await i.arrayBuffer();return vt(Vt(s,t?.voxOptions))}throw new Error(`${xe}: unsupported extension ".${r}" (supported: obj, glb, gltf, vox)`)}export{En as BASE_TILE,Ae as DEFAULT_CAMERA_STATE,xn as DEFAULT_PROJECTION,Sr as LoopOnce,Cr as LoopPingPong,Ir as LoopRepeat,Jt as arrowPolygons,Zt as axesHelperPolygons,co as bakeSolidTextureSampledPolygons,Pt as bakeSolidTextureSamples,Vn as buildSceneContext,me as clampChannel,Ut as computeSceneBbox,bn as computeShapeLighting,In as computeTexturePaintMetrics,pr as coverPlanarPolygons,Ln as createIsometricCamera,Or as createPolyAnimationMixer,lt as cullInteriorPolygons,Le as formatColor,Tn as inverseRotateVec3,mo as loadMesh,Se as mergePolygons,On as normalizeInvertMultiplier,nt as normalizePolygons,qt as octahedronPolygons,ye as parseColor,bt as parseGltf,St as parseHexColor,pt as parseMtl,gt as parseObj,qe as parsePureColor,It as parseRgbColor,Vt as parseVox,vn as polygonFaces,Qt as ringPolygons,Cn as rotateVec3,hn as shadeColor};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@layoutit/polycss-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Pure math engine for CSS polygon mesh rendering. Zero browser globals.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"polycss",
|
|
11
|
+
"polygon",
|
|
12
|
+
"mesh",
|
|
13
|
+
"3d",
|
|
14
|
+
"css",
|
|
15
|
+
"matrix3d",
|
|
16
|
+
"dom",
|
|
17
|
+
"rendering"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/LayoutitStudio/polycss.git",
|
|
23
|
+
"directory": "packages/core"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/LayoutitStudio/polycss/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/LayoutitStudio/polycss#readme",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"require": "./dist/index.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.0.1",
|
|
44
|
+
"typescript": "^5.3.3",
|
|
45
|
+
"vitest": "^3.1.1",
|
|
46
|
+
"@vitest/coverage-v8": "^3.1.1"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup",
|
|
50
|
+
"test": "vitest run --passWithNoTests",
|
|
51
|
+
"test:coverage": "vitest run --coverage --passWithNoTests"
|
|
52
|
+
}
|
|
53
|
+
}
|